@loaders.gl/tile-converter 4.0.0-alpha.8 → 4.0.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/3d-tiles-attributes-worker.js +1 -1
- package/dist/converter.min.js +2 -2
- package/dist/deps-installer/deps-installer.d.ts.map +1 -1
- package/dist/deps-installer/deps-installer.js +2 -1
- package/dist/dist.min.js +4 -2
- package/dist/es5/3d-tiles-attributes-worker.js +1 -1
- package/dist/es5/deps-installer/deps-installer.js +3 -2
- package/dist/es5/deps-installer/deps-installer.js.map +1 -1
- package/dist/es5/i3s-attributes-worker.js +1 -1
- package/dist/es5/pgm-loader.js +1 -1
- package/dist/esm/3d-tiles-attributes-worker.js +1 -1
- package/dist/esm/deps-installer/deps-installer.js +3 -2
- package/dist/esm/deps-installer/deps-installer.js.map +1 -1
- package/dist/esm/i3s-attributes-worker.js +1 -1
- package/dist/esm/pgm-loader.js +1 -1
- package/package.json +15 -15
- package/src/deps-installer/deps-installer.ts +2 -1
package/dist/converter.min.js
CHANGED
|
@@ -114,13 +114,13 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof Nn))r
|
|
|
114
114
|
`));var r=e.pax;if(r)for(var i in r)t+=MM(" "+i+"="+r[i]+`
|
|
115
115
|
`);return Buffer.from(t)};Kg.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};Kg.encode=function(e){var t=uet(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(hh(e.mode&met,6),100),t.write(hh(e.uid,6),108),t.write(hh(e.gid,6),116),t.write(hh(e.size,11),124),t.write(hh(e.mtime.getTime()/1e3|0,11),136),t[156]=Yue+yet(e.type),e.linkname&&t.write(e.linkname,157),$ue.copy(t,o1),het.copy(t,FM),e.uname&&t.write(e.uname,265),e.gname&&t.write(e.gname,297),t.write(hh(e.devmajor||0,6),329),t.write(hh(e.devminor||0,6),337),i&&t.write(i,345),t.write(hh(Jue(t),6),148),t)};Kg.decode=function(e,t,r){var i=e[156]===0?0:e[156]-Yue,n=Vg(e,0,100,t),a=dh(e,100,8),o=dh(e,108,8),s=dh(e,116,8),u=dh(e,124,12),l=dh(e,136,12),c=vet(i),f=e[157]===0?null:Vg(e,157,100,t),h=Vg(e,265,32),d=Vg(e,297,32),p=dh(e,329,8),y=dh(e,337,8),g=Jue(e);if(g===8*32)return null;if(g!==dh(e,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if($ue.compare(e,o1,o1+6)===0)e[345]&&(n=Vg(e,345,155,t)+"/"+n);else if(!(det.compare(e,o1,o1+6)===0&&pet.compare(e,FM,FM+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 LM=A((D3t,Que)=>{Que.exports=require("stream")});var nle=A((F3t,ile)=>{"use strict";function Zue(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 ele(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Zue(Object(r),!0).forEach(function(i){_et(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Zue(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function _et(e,t,r){return t=rle(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xet(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tle(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,rle(i.key),i)}}function wet(e,t,r){return t&&tle(e.prototype,t),r&&tle(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function rle(e){var t=Eet(e,"string");return typeof t=="symbol"?t:String(t)}function Eet(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 Aet=require("buffer"),kT=Aet.Buffer,Tet=require("util"),NM=Tet.inspect,ket=NM&&NM.custom||"inspect";function Ret(e,t,r){kT.prototype.copy.call(e,t,r)}ile.exports=function(){function e(){xet(this,e),this.head=null,this.tail=null,this.length=0}return wet(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 kT.alloc(0);for(var i=kT.allocUnsafe(r>>>0),n=this.head,a=0;n;)Ret(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=kT.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:ket,value:function(r,i){return NM(this,ele(ele({},i),{},{depth:0,customInspect:!1}))}}]),e}()});var UM=A((M3t,ole)=>{"use strict";function Cet(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(qM,this,e)):process.nextTick(qM,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(RT,r):(r._writableState.errorEmitted=!0,process.nextTick(ale,r,a)):process.nextTick(ale,r,a):t?(process.nextTick(RT,r),t(a)):process.nextTick(RT,r)}),this)}function ale(e,t){qM(e,t),RT(e)}function RT(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function Iet(){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 qM(e,t){e.emit("error",t)}function Pet(e,t){var r=e._readableState,i=e._writableState;r&&r.autoDestroy||i&&i.autoDestroy?e.destroy(t):e.emit("error",t)}ole.exports={destroy:Cet,undestroy:Iet,errorOrDestroy:Pet}});var ph=A((j3t,lle)=>{"use strict";var sle={};function xs(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,sle[e]=n}function ule(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 Oet(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function Bet(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function Det(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}xs("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);xs("ERR_INVALID_ARG_TYPE",function(e,t,r){let i;typeof t=="string"&&Oet(t,"not ")?(i="must not be",t=t.replace(/^not /,"")):i="must be";let n;if(Bet(e," argument"))n=`The ${e} ${i} ${ule(t,"type")}`;else{let a=Det(e,".")?"property":"argument";n=`The "${e}" ${a} ${i} ${ule(t,"type")}`}return n+=`. Received type ${typeof r}`,n},TypeError);xs("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");xs("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});xs("ERR_STREAM_PREMATURE_CLOSE","Premature close");xs("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});xs("ERR_MULTIPLE_CALLBACK","Callback called multiple times");xs("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");xs("ERR_STREAM_WRITE_AFTER_END","write after end");xs("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);xs("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);xs("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");lle.exports.codes=sle});var GM=A((L3t,cle)=>{"use strict";var Fet=ph().codes.ERR_INVALID_OPT_VALUE;function Met(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function jet(e,t,r,i){var n=Met(t,i,r);if(n!=null){if(!(isFinite(n)&&Math.floor(n)===n)||n<0){var a=i?r:"highWaterMark";throw new Fet(a,n)}return Math.floor(n)}return e.objectMode?16:16*1024}cle.exports={getHighWaterMark:jet}});var WM=A((N3t,gle)=>{"use strict";gle.exports=Qi;function fle(e){var t=this;this.next=null,this.entry=null,this.finish=function(){ctt(t,e)}}var Yg;Qi.WritableState=s1;var Let={deprecate:Cd()},hle=LM(),CT=require("buffer").Buffer,Net=(typeof global!="undefined"?global:typeof window!="undefined"?window:typeof self!="undefined"?self:{}).Uint8Array||function(){};function qet(e){return CT.from(e)}function Uet(e){return CT.isBuffer(e)||e instanceof Net}var zM=UM(),Get=GM(),zet=Get.getHighWaterMark,mh=ph().codes,Het=mh.ERR_INVALID_ARG_TYPE,Wet=mh.ERR_METHOD_NOT_IMPLEMENTED,Vet=mh.ERR_MULTIPLE_CALLBACK,Ket=mh.ERR_STREAM_CANNOT_PIPE,Yet=mh.ERR_STREAM_DESTROYED,$et=mh.ERR_STREAM_NULL_VALUES,Xet=mh.ERR_STREAM_WRITE_AFTER_END,Jet=mh.ERR_UNKNOWN_ENCODING,$g=zM.errorOrDestroy;tr()(Qi,hle);function Qet(){}function s1(e,t,r){Yg=Yg||tp(),e=e||{},typeof r!="boolean"&&(r=t instanceof Yg),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=zet(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){att(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 fle(this)}s1.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(s1.prototype,"buffer",{get:Let.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var IT;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(IT=Function.prototype[Symbol.hasInstance],Object.defineProperty(Qi,Symbol.hasInstance,{value:function(t){return IT.call(this,t)?!0:this!==Qi?!1:t&&t._writableState instanceof s1}})):IT=function(t){return t instanceof this};function Qi(e){Yg=Yg||tp();var t=this instanceof Yg;if(!t&&!IT.call(Qi,this))return new Qi(e);this._writableState=new s1(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)),hle.call(this)}Qi.prototype.pipe=function(){$g(this,new Ket)};function Zet(e,t){var r=new Xet;$g(e,r),process.nextTick(t,r)}function ett(e,t,r,i){var n;return r===null?n=new $et:typeof r!="string"&&!t.objectMode&&(n=new Het("chunk",["string","Buffer"],r)),n?($g(e,n),process.nextTick(i,n),!1):!0}Qi.prototype.write=function(e,t,r){var i=this._writableState,n=!1,a=!i.objectMode&&Uet(e);return a&&!CT.isBuffer(e)&&(e=qet(e)),typeof t=="function"&&(r=t,t=null),a?t="buffer":t||(t=i.defaultEncoding),typeof r!="function"&&(r=Qet),i.ending?Zet(this,r):(a||ett(this,i,e,r))&&(i.pendingcb++,n=rtt(this,i,a,e,t,r)),n};Qi.prototype.cork=function(){this._writableState.corked++};Qi.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&ple(this,e))};Qi.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 Jet(t);return this._writableState.defaultEncoding=t,this};Object.defineProperty(Qi.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function ttt(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=CT.from(t,r)),t}Object.defineProperty(Qi.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function rtt(e,t,r,i,n,a){if(!r){var o=ttt(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 HM(e,t,!1,s,i,n,a);return u}function HM(e,t,r,i,n,a,o){t.writelen=i,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new Yet("write")):r?e._writev(n,t.onwrite):e._write(n,a,t.onwrite),t.sync=!1}function itt(e,t,r,i,n){--t.pendingcb,r?(process.nextTick(n,i),process.nextTick(u1,e,t),e._writableState.errorEmitted=!0,$g(e,i)):(n(i),e._writableState.errorEmitted=!0,$g(e,i),u1(e,t))}function ntt(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function att(e,t){var r=e._writableState,i=r.sync,n=r.writecb;if(typeof n!="function")throw new Vet;if(ntt(r),t)itt(e,r,i,t,n);else{var a=mle(r)||e.destroyed;!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&ple(e,r),i?process.nextTick(dle,e,r,a,n):dle(e,r,a,n)}}function dle(e,t,r,i){r||ott(e,t),t.pendingcb--,i(),u1(e,t)}function ott(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function ple(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,HM(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 fle(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,l=r.encoding,c=r.callback,f=t.objectMode?1:u.length;if(HM(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}Qi.prototype._write=function(e,t,r){r(new Wet("_write()"))};Qi.prototype._writev=null;Qi.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||ltt(this,i,r),this};Object.defineProperty(Qi.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function mle(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function stt(e,t){e._final(function(r){t.pendingcb--,r&&$g(e,r),t.prefinished=!0,e.emit("prefinish"),u1(e,t)})}function utt(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(stt,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function u1(e,t){var r=mle(t);if(r&&(utt(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 ltt(e,t,r){t.ending=!0,u1(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function ctt(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(Qi.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(t){!this._writableState||(this._writableState.destroyed=t)}});Qi.prototype.destroy=zM.destroy;Qi.prototype._undestroy=zM.undestroy;Qi.prototype._destroy=function(e,t){t(e)}});var tp=A((q3t,yle)=>{"use strict";var ftt=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};yle.exports=fl;var vle=YM(),VM=WM();tr()(fl,vle);for(KM=ftt(VM.prototype),PT=0;PT<KM.length;PT++)OT=KM[PT],fl.prototype[OT]||(fl.prototype[OT]=VM.prototype[OT]);var KM,OT,PT;function fl(e){if(!(this instanceof fl))return new fl(e);vle.call(this,e),VM.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",htt)))}Object.defineProperty(fl.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(fl.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(fl.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function htt(){this._writableState.ended||process.nextTick(dtt,this)}function dtt(e){e.end()}Object.defineProperty(fl.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 JM=A(_le=>{"use strict";var $M=Fs().Buffer,ble=$M.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 ptt(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 mtt(e){var t=ptt(e);if(typeof t!="string"&&($M.isEncoding===ble||!ble(e)))throw new Error("Unknown encoding: "+e);return t||e}_le.StringDecoder=l1;function l1(e){this.encoding=mtt(e);var t;switch(this.encoding){case"utf16le":this.text=xtt,this.end=wtt,t=4;break;case"utf8":this.fillLast=ytt,t=4;break;case"base64":this.text=Ett,this.end=Stt,t=3;break;default:this.write=Att,this.end=Ttt;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=$M.allocUnsafe(t)}l1.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||""};l1.prototype.end=_tt;l1.prototype.text=btt;l1.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 XM(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function gtt(e,t,r){var i=t.length-1;if(i<r)return 0;var n=XM(t[i]);return n>=0?(n>0&&(e.lastNeed=n-1),n):--i<r||n===-2?0:(n=XM(t[i]),n>=0?(n>0&&(e.lastNeed=n-2),n):--i<r||n===-2?0:(n=XM(t[i]),n>=0?(n>0&&(n===2?n=0:e.lastNeed=n-3),n):0))}function vtt(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 ytt(e){var t=this.lastTotal-this.lastNeed,r=vtt(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 btt(e,t){var r=gtt(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 _tt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function xtt(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 wtt(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 Ett(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 Stt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function Att(e){return e.toString(this.encoding)}function Ttt(e){return e&&e.length?this.write(e):""}});var BT=A((G3t,Ele)=>{"use strict";var xle=ph().codes.ERR_STREAM_PREMATURE_CLOSE;function ktt(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 Rtt(){}function Ctt(e){return e.setHeader&&typeof e.abort=="function"}function wle(e,t,r){if(typeof t=="function")return wle(e,null,t);t||(t={}),r=ktt(r||Rtt);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 xle),r.call(e,p);if(n&&!o)return(!e._writableState||!e._writableState.ended)&&(p=new xle),r.call(e,p)},h=function(){e.req.on("finish",s)};return Ctt(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)}}Ele.exports=wle});var Ale=A((z3t,Sle)=>{"use strict";var DT;function gh(e,t,r){return t=Itt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Itt(e){var t=Ptt(e,"string");return typeof t=="symbol"?t:String(t)}function Ptt(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 Ott=BT(),vh=Symbol("lastResolve"),rp=Symbol("lastReject"),c1=Symbol("error"),FT=Symbol("ended"),ip=Symbol("lastPromise"),QM=Symbol("handlePromise"),np=Symbol("stream");function yh(e,t){return{value:e,done:t}}function Btt(e){var t=e[vh];if(t!==null){var r=e[np].read();r!==null&&(e[ip]=null,e[vh]=null,e[rp]=null,t(yh(r,!1)))}}function Dtt(e){process.nextTick(Btt,e)}function Ftt(e,t){return function(r,i){e.then(function(){if(t[FT]){r(yh(void 0,!0));return}t[QM](r,i)},i)}}var Mtt=Object.getPrototypeOf(function(){}),jtt=Object.setPrototypeOf((DT={get stream(){return this[np]},next:function(){var t=this,r=this[c1];if(r!==null)return Promise.reject(r);if(this[FT])return Promise.resolve(yh(void 0,!0));if(this[np].destroyed)return new Promise(function(o,s){process.nextTick(function(){t[c1]?s(t[c1]):o(yh(void 0,!0))})});var i=this[ip],n;if(i)n=new Promise(Ftt(i,this));else{var a=this[np].read();if(a!==null)return Promise.resolve(yh(a,!1));n=new Promise(this[QM])}return this[ip]=n,n}},gh(DT,Symbol.asyncIterator,function(){return this}),gh(DT,"return",function(){var t=this;return new Promise(function(r,i){t[np].destroy(null,function(n){if(n){i(n);return}r(yh(void 0,!0))})})}),DT),Mtt),Ltt=function(t){var r,i=Object.create(jtt,(r={},gh(r,np,{value:t,writable:!0}),gh(r,vh,{value:null,writable:!0}),gh(r,rp,{value:null,writable:!0}),gh(r,c1,{value:null,writable:!0}),gh(r,FT,{value:t._readableState.endEmitted,writable:!0}),gh(r,QM,{value:function(a,o){var s=i[np].read();s?(i[ip]=null,i[vh]=null,i[rp]=null,a(yh(s,!1))):(i[vh]=a,i[rp]=o)},writable:!0}),r));return i[ip]=null,Ott(t,function(n){if(n&&n.code!=="ERR_STREAM_PREMATURE_CLOSE"){var a=i[rp];a!==null&&(i[ip]=null,i[vh]=null,i[rp]=null,a(n)),i[c1]=n;return}var o=i[vh];o!==null&&(i[ip]=null,i[vh]=null,i[rp]=null,o(yh(void 0,!0))),i[FT]=!0}),t.on("readable",Dtt.bind(null,i)),i};Sle.exports=Ltt});var Cle=A((H3t,Rle)=>{"use strict";function Tle(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 Ntt(e){return function(){var t=this,r=arguments;return new Promise(function(i,n){var a=e.apply(t,r);function o(u){Tle(a,i,n,o,s,"next",u)}function s(u){Tle(a,i,n,o,s,"throw",u)}o(void 0)})}}function kle(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 qtt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?kle(Object(r),!0).forEach(function(i){Utt(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kle(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function Utt(e,t,r){return t=Gtt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Gtt(e){var t=ztt(e,"string");return typeof t=="symbol"?t:String(t)}function ztt(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 Htt=ph().codes.ERR_INVALID_ARG_TYPE;function Wtt(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 Htt("iterable",["Iterable"],t);var n=new e(qtt({objectMode:!0},r)),a=!1;n._read=function(){a||(a=!0,o())};function o(){return s.apply(this,arguments)}function s(){return s=Ntt(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}Rle.exports=Wtt});var YM=A((V3t,Nle)=>{"use strict";Nle.exports=Gr;var Xg;Gr.ReadableState=Ple;var W3t=require("events").EventEmitter,Ile=function(t,r){return t.listeners(r).length},f1=LM(),MT=require("buffer").Buffer,Vtt=(typeof global!="undefined"?global:typeof window!="undefined"?window:typeof self!="undefined"?self:{}).Uint8Array||function(){};function Ktt(e){return MT.from(e)}function Ytt(e){return MT.isBuffer(e)||e instanceof Vtt}var ZM=require("util"),br;ZM&&ZM.debuglog?br=ZM.debuglog("stream"):br=function(){};var $tt=nle(),e6=UM(),Xtt=GM(),Jtt=Xtt.getHighWaterMark,jT=ph().codes,Qtt=jT.ERR_INVALID_ARG_TYPE,Ztt=jT.ERR_STREAM_PUSH_AFTER_EOF,ert=jT.ERR_METHOD_NOT_IMPLEMENTED,trt=jT.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Jg,t6,r6;tr()(Gr,f1);var h1=e6.errorOrDestroy,i6=["error","close","destroy","pause","resume"];function rrt(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 Ple(e,t,r){Xg=Xg||tp(),e=e||{},typeof r!="boolean"&&(r=t instanceof Xg),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=Jtt(this,e,"readableHighWaterMark",r),this.buffer=new $tt,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&&(Jg||(Jg=JM().StringDecoder),this.decoder=new Jg(e.encoding),this.encoding=e.encoding)}function Gr(e){if(Xg=Xg||tp(),!(this instanceof Gr))return new Gr(e);var t=this instanceof Xg;this._readableState=new Ple(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),f1.call(this)}Object.defineProperty(Gr.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(t){!this._readableState||(this._readableState.destroyed=t)}});Gr.prototype.destroy=e6.destroy;Gr.prototype._undestroy=e6.undestroy;Gr.prototype._destroy=function(e,t){t(e)};Gr.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=MT.from(e,t),t=""),i=!0),Ole(this,e,t,!1,i)};Gr.prototype.unshift=function(e){return Ole(this,e,null,!0,!1)};function Ole(e,t,r,i,n){br("readableAddChunk",t);var a=e._readableState;if(t===null)a.reading=!1,art(e,a);else{var o;if(n||(o=irt(a,t)),o)h1(e,o);else if(a.objectMode||t&&t.length>0)if(typeof t!="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==MT.prototype&&(t=Ktt(t)),i)a.endEmitted?h1(e,new trt):n6(e,a,t,!0);else if(a.ended)h1(e,new Ztt);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||t.length!==0?n6(e,a,t,!1):a6(e,a)):n6(e,a,t,!1)}else i||(a.reading=!1,a6(e,a))}return!a.ended&&(a.length<a.highWaterMark||a.length===0)}function n6(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&<(e)),a6(e,t)}function irt(e,t){var r;return!Ytt(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new Qtt("chunk",["string","Buffer","Uint8Array"],t)),r}Gr.prototype.isPaused=function(){return this._readableState.flowing===!1};Gr.prototype.setEncoding=function(e){Jg||(Jg=JM().StringDecoder);var t=new Jg(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 Ble=1073741824;function nrt(e){return e>=Ble?e=Ble:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function Dle(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=nrt(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}Gr.prototype.read=function(e){br("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return br("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?s6(this):LT(this),null;if(e=Dle(e,t),e===0&&t.ended)return t.length===0&&s6(this),null;var i=t.needReadable;br("need readable",i),(t.length===0||t.length-e<t.highWaterMark)&&(i=!0,br("length less than watermark",i)),t.ended||t.reading?(i=!1,br("reading or ended",i)):i&&(br("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=Dle(r,t)));var n;return e>0?n=jle(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&&s6(this)),n!==null&&this.emit("data",n),n};function art(e,t){if(br("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?LT(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,Fle(e)))}}function LT(e){var t=e._readableState;br("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(br("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(Fle,e))}function Fle(e){var t=e._readableState;br("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,o6(e)}function a6(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(ort,e,t))}function ort(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){var r=t.length;if(br("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}Gr.prototype._read=function(e){h1(this,new ert("_read()"))};Gr.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,br("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){br("onunpipe"),g===r&&b&&b.hasUnpiped===!1&&(b.hasUnpiped=!0,c())}function s(){br("onend"),e.end()}var u=srt(r);e.on("drain",u);var l=!1;function c(){br("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){br("ondata");var b=e.write(g);br("dest.write",b),b===!1&&((i.pipesCount===1&&i.pipes===e||i.pipesCount>1&&Lle(i.pipes,e)!==-1)&&!l&&(br("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function h(g){br("onerror",g),y(),e.removeListener("error",h),Ile(e,"error")===0&&h1(e,g)}rrt(e,"error",h);function d(){e.removeListener("finish",p),y()}e.once("close",d);function p(){br("onfinish"),e.removeListener("close",d),y()}e.once("finish",p);function y(){br("unpipe"),r.unpipe(e)}return e.emit("pipe",r),i.flowing||(br("pipe resume"),r.resume()),e};function srt(e){return function(){var r=e._readableState;br("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&Ile(e,"data")&&(r.flowing=!0,o6(e))}}Gr.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var 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=Lle(t.pipes,e);return o===-1?this:(t.pipes.splice(o,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};Gr.prototype.on=function(e,t){var r=f1.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,br("on readable",i.length,i.reading),i.length?LT(this):i.reading||process.nextTick(urt,this)),r};Gr.prototype.addListener=Gr.prototype.on;Gr.prototype.removeListener=function(e,t){var r=f1.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(Mle,this),r};Gr.prototype.removeAllListeners=function(e){var t=f1.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(Mle,this),t};function Mle(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 urt(e){br("readable nexttick read 0"),e.read(0)}Gr.prototype.resume=function(){var e=this._readableState;return e.flowing||(br("resume"),e.flowing=!e.readableListening,lrt(this,e)),e.paused=!1,this};function lrt(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(crt,e,t))}function crt(e,t){br("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),o6(e),t.flowing&&!t.reading&&e.read(0)}Gr.prototype.pause=function(){return br("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(br("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function o6(e){var t=e._readableState;for(br("flow",t.flowing);t.flowing&&e.read()!==null;);}Gr.prototype.wrap=function(e){var t=this,r=this._readableState,i=!1;e.on("end",function(){if(br("wrapped end"),r.decoder&&!r.ended){var o=r.decoder.end();o&&o.length&&t.push(o)}t.push(null)}),e.on("data",function(o){if(br("wrapped data"),r.decoder&&(o=r.decoder.write(o)),!(r.objectMode&&o==null)&&!(!r.objectMode&&(!o||!o.length))){var s=t.push(o);s||(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<i6.length;a++)e.on(i6[a],this.emit.bind(this,i6[a]));return this._read=function(o){br("wrapped _read",o),i&&(i=!1,e.resume())},this};typeof Symbol=="function"&&(Gr.prototype[Symbol.asyncIterator]=function(){return t6===void 0&&(t6=Ale()),t6(this)});Object.defineProperty(Gr.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(Gr.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(Gr.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}});Gr._fromList=jle;Object.defineProperty(Gr.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function jle(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 s6(e){var t=e._readableState;br("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(frt,t,e))}function frt(e,t){if(br("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}typeof Symbol=="function"&&(Gr.from=function(e,t){return r6===void 0&&(r6=Cle()),r6(Gr,e,t)});function Lle(e,t){for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1}});var u6=A((K3t,Ule)=>{"use strict";Ule.exports=Ec;var NT=ph().codes,hrt=NT.ERR_METHOD_NOT_IMPLEMENTED,drt=NT.ERR_MULTIPLE_CALLBACK,prt=NT.ERR_TRANSFORM_ALREADY_TRANSFORMING,mrt=NT.ERR_TRANSFORM_WITH_LENGTH_0,qT=tp();tr()(Ec,qT);function grt(e,t){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(i===null)return this.emit("error",new drt);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 Ec(e){if(!(this instanceof Ec))return new Ec(e);qT.call(this,e),this._transformState={afterTransform:grt.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",vrt)}function vrt(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){qle(e,t,r)}):qle(this,null,null)}Ec.prototype.push=function(e,t){return this._transformState.needTransform=!1,qT.prototype.push.call(this,e,t)};Ec.prototype._transform=function(e,t,r){r(new hrt("_transform()"))};Ec.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)}};Ec.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};Ec.prototype._destroy=function(e,t){qT.prototype._destroy.call(this,e,function(r){t(r)})};function qle(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new mrt;if(e._transformState.transforming)throw new prt;return e.push(null)}});var Hle=A((Y3t,zle)=>{"use strict";zle.exports=d1;var Gle=u6();tr()(d1,Gle);function d1(e){if(!(this instanceof d1))return new d1(e);Gle.call(this,e)}d1.prototype._transform=function(e,t,r){r(null,e)}});var $le=A(($3t,Yle)=>{"use strict";var l6;function yrt(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var Wle=ph().codes,brt=Wle.ERR_MISSING_ARGS,_rt=Wle.ERR_STREAM_DESTROYED;function Vle(e){if(e)throw e}function xrt(e){return e.setHeader&&typeof e.abort=="function"}function wrt(e,t,r,i){i=yrt(i);var n=!1;e.on("close",function(){n=!0}),l6===void 0&&(l6=BT()),l6(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,xrt(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();i(o||new _rt("pipe"))}}}function Kle(e){e()}function Ert(e,t){return e.pipe(t)}function Srt(e){return!e.length||typeof e[e.length-1]!="function"?Vle:e.pop()}function Art(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var i=Srt(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new brt("streams");var n,a=t.map(function(o,s){var u=s<t.length-1,l=s>0;return wrt(o,u,l,function(c){n||(n=c),c&&a.forEach(Kle),!u&&(a.forEach(Kle),i(n))})});return t.reduce(Ert)}Yle.exports=Art});var g1=A((ws,m1)=>{var p1=require("stream");process.env.READABLE_STREAM==="disable"&&p1?(m1.exports=p1.Readable,Object.assign(m1.exports,p1),m1.exports.Stream=p1):(ws=m1.exports=YM(),ws.Stream=p1||ws,ws.Readable=ws,ws.Writable=WM(),ws.Duplex=tp(),ws.Transform=u6(),ws.PassThrough=Hle(),ws.finished=BT(),ws.pipeline=$le())});var rce=A((X3t,tce)=>{var Xle=require("util"),Trt=Kue(),v1=jM(),Jle=g1().Writable,Qle=g1().PassThrough,Zle=function(){},ece=function(e){return e&=511,e&&512-e},krt=function(e,t){var r=new UT(e,t);return r.end(),r},Rrt=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},UT=function(e,t){this._parent=e,this.offset=t,Qle.call(this,{autoDestroy:!1})};Xle.inherits(UT,Qle);UT.prototype.destroy=function(e){this._parent.destroy(e)};var Sc=function(e){if(!(this instanceof Sc))return new Sc(e);Jle.call(this,e),e=e||{},this._offset=0,this._buffer=Trt(),this._missing=0,this._partial=!1,this._onparse=Zle,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=ece(t._header.size);h?t._parse(h,o):t._parse(512,f),t._locked||i()},o=function(){t._buffer.consume(ece(t._header.size)),t._parse(512,f),i()},s=function(){var h=t._header.size;t._paxGlobal=v1.decodePax(r.slice(0,h)),r.consume(h),a()},u=function(){var h=t._header.size;t._pax=v1.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=v1.decodeLongPath(r.slice(0,h),e.filenameEncoding),r.consume(h),a()},c=function(){var h=t._header.size;this._gnuLongLinkPath=v1.decodeLongPath(r.slice(0,h),e.filenameEncoding),r.consume(h),a()},f=function(){var h=t._offset,d;try{d=t._header=v1.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=Rrt(d,t._pax),t._pax=null),t._locked=!0,!d.size||d.type==="directory"){t._parse(512,f),t.emit("entry",d,krt(t,h),n);return}t._stream=new UT(t,h),t.emit("entry",d,t._stream,n),t._parse(d.size,a),i()};this._onheader=f,this._parse(512,f)};Xle.inherits(Sc,Jle);Sc.prototype.destroy=function(e){this._destroyed||(this._destroyed=!0,e&&this.emit("error",e),this.emit("close"),this._stream&&this._stream.emit("close"))};Sc.prototype._parse=function(e,t){this._destroyed||(this._offset+=e,this._missing=e,t===this._onheader&&(this._partial=!1),this._onparse=t)};Sc.prototype._continue=function(){if(!this._destroyed){var e=this._cb;this._cb=Zle,this._overflow?this._write(this._overflow,void 0,e):e()}};Sc.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()}};Sc.prototype._final=function(e){if(this._partial)return this.destroy(new Error("Unexpected end of data"));e()};tce.exports=Sc});var nce=A((J3t,ice)=>{ice.exports=require("fs").constants||require("constants")});var sce=A((Q3t,oce)=>{var Crt=_A(),Irt=function(){},Prt=function(e){return e.setHeader&&typeof e.abort=="function"},Ort=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},ace=function(e,t,r){if(typeof t=="function")return ace(e,null,t);t||(t={}),r=Crt(r||Irt);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 Prt(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)),Ort(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)}};oce.exports=ace});var hce=A((Z3t,fce)=>{var Qg=nce(),uce=sce(),GT=tr(),Brt=Buffer.alloc,lce=g1().Readable,Zg=g1().Writable,Drt=require("string_decoder").StringDecoder,zT=jM(),Frt=parseInt("755",8),Mrt=parseInt("644",8),cce=Brt(1024),c6=function(){},f6=function(e,t){t&=511,t&&e.push(cce.slice(0,512-t))};function jrt(e){switch(e&Qg.S_IFMT){case Qg.S_IFBLK:return"block-device";case Qg.S_IFCHR:return"character-device";case Qg.S_IFDIR:return"directory";case Qg.S_IFIFO:return"fifo";case Qg.S_IFLNK:return"symlink"}return"file"}var HT=function(e){Zg.call(this),this.written=0,this._to=e,this._destroyed=!1};GT(HT,Zg);HT.prototype._write=function(e,t,r){if(this.written+=e.length,this._to.push(e))return r();this._to._drain=r};HT.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var WT=function(){Zg.call(this),this.linkname="",this._decoder=new Drt("utf-8"),this._destroyed=!1};GT(WT,Zg);WT.prototype._write=function(e,t,r){this.linkname+=this._decoder.write(e),r()};WT.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var y1=function(){Zg.call(this),this._destroyed=!1};GT(y1,Zg);y1.prototype._write=function(e,t,r){r(new Error("No body allowed for this entry"))};y1.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var hl=function(e){if(!(this instanceof hl))return new hl(e);lce.call(this,e),this._drain=c6,this._finalized=!1,this._finalizing=!1,this._destroyed=!1,this._stream=null};GT(hl,lce);hl.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=c6);var i=this;if((!e.size||e.type==="symlink")&&(e.size=0),e.type||(e.type=jrt(e.mode)),e.mode||(e.mode=e.type==="directory"?Frt:Mrt),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 f6(i,e.size),n?process.nextTick(r):this._drain=r,new y1}if(e.type==="symlink"&&!e.linkname){var a=new WT;return uce(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 y1;var o=new HT(this);return this._stream=o,uce(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"));f6(i,e.size),i._finalizing&&i.finalize(),r()}),o}};hl.prototype.finalize=function(){if(this._stream){this._finalizing=!0;return}this._finalized||(this._finalized=!0,this.push(cce),this.push(null))};hl.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())};hl.prototype._encode=function(e){if(!e.pax){var t=zT.encode(e);if(t){this.push(t);return}}this._encodePax(e)};hl.prototype._encodePax=function(e){var t=zT.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(zT.encode(r)),this.push(t),f6(this,t.length),r.size=e.size,r.type=e.type,this.push(zT.encode(r))};hl.prototype._read=function(e){var t=this._drain;this._drain=c6,t()};fce.exports=hl});var dce=A(h6=>{h6.extract=rce();h6.pack=hce()});var gce=A((tCt,mce)=>{var Lrt=require("zlib"),Nrt=dce(),pce=Rg(),Ac=function(e){if(!(this instanceof Ac))return new Ac(e);e=this.options=pce.defaults(e,{gzip:!1}),typeof e.gzipOptions!="object"&&(e.gzipOptions={}),this.supports={directory:!0,symlink:!0},this.engine=Nrt.pack(e),this.compressor=!1,e.gzip&&(this.compressor=Lrt.createGzip(e.gzipOptions),this.compressor.on("error",this._onCompressorError.bind(this)))};Ac.prototype._onCompressorError=function(e){this.engine.emit("error",e)};Ac.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"&&pce.collectStream(e,n)};Ac.prototype.finalize=function(){this.engine.finalize()};Ac.prototype.on=function(){return this.engine.on.apply(this.engine,arguments)};Ac.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)};Ac.prototype.unpipe=function(){return this.compressor?this.compressor.unpipe.apply(this.compressor,arguments):this.engine.unpipe.apply(this.engine,arguments)};mce.exports=Ac});var _ce=A((rCt,bce)=>{var qrt=require("util").inherits,vce=GD().Transform,Urt=CF(),yce=Rg(),bh=function(e){if(!(this instanceof bh))return new bh(e);e=this.options=yce.defaults(e,{}),vce.call(this,e),this.supports={directory:!0,symlink:!0},this.files=[]};qrt(bh,vce);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=Urt.unsigned(o),i.files.push(t),r(null,t)}t.sourceType==="buffer"?n(null,e):t.sourceType==="stream"&&yce.collectStream(e,n)};bh.prototype.finalize=function(){this._writeStringified(),this.end()};bce.exports=bh});var wce=A((iCt,xce)=>{var Grt=cae(),b1={},_h=function(e,t){return _h.create(e,t)};_h.create=function(e,t){if(b1[e]){var r=new Grt(e,t);return r.setFormat(e),r.setModule(new b1[e](t)),r}else throw new Error("create("+e+"): format not registered")};_h.registerFormat=function(e,t){if(b1[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");b1[e]=t};_h.isRegisteredFormat=function(e){return!!b1[e]};_h.registerFormat("zip",Hse());_h.registerFormat("tar",gce());_h.registerFormat("json",_ce());xce.exports=_h});var Tc=A(Do=>{"use strict";Do.base64=!0;Do.array=!0;Do.string=!0;Do.arraybuffer=typeof ArrayBuffer!="undefined"&&typeof Uint8Array!="undefined";Do.nodebuffer=typeof Buffer!="undefined";Do.uint8array=typeof Uint8Array!="undefined";if(typeof ArrayBuffer=="undefined")Do.blob=!1;else{d6=new ArrayBuffer(0);try{Do.blob=new Blob([d6],{type:"application/zip"}).size===0}catch{try{Ece=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,p6=new Ece,p6.append(d6),Do.blob=p6.getBlob("application/zip").size===0}catch{Do.blob=!1}}}var d6,Ece,p6;try{Do.nodestream=!!db().Readable}catch{Do.nodestream=!1}});var g6=A(m6=>{"use strict";var zrt=ji(),Hrt=Tc(),dl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";m6.encode=function(e){for(var t=[],r,i,n,a,o,s,u,l=0,c=e.length,f=c,h=zrt.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(dl.charAt(a)+dl.charAt(o)+dl.charAt(s)+dl.charAt(u));return t.join("")};m6.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)===dl.charAt(64)&&f--,e.charAt(e.length-2)===dl.charAt(64)&&f--,f%1!=0)throw new Error("Invalid base64 input, bad content length.");var h;for(Hrt.uint8array?h=new Uint8Array(f|0):h=new Array(f|0);u<e.length;)n=dl.indexOf(e.charAt(u++)),a=dl.indexOf(e.charAt(u++)),o=dl.indexOf(e.charAt(u++)),s=dl.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 _1=A((oCt,Sce)=>{"use strict";Sce.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 Rce=A((sCt,kce)=>{"use strict";var Ace=global.MutationObserver||global.WebKitMutationObserver,e0;process.browser?Ace?(v6=0,Tce=new Ace(w1),y6=global.document.createTextNode(""),Tce.observe(y6,{characterData:!0}),e0=function(){y6.data=v6=++v6%2}):!global.setImmediate&&typeof global.MessageChannel!="undefined"?(b6=new global.MessageChannel,b6.port1.onmessage=w1,e0=function(){b6.port2.postMessage(0)}):"document"in global&&"onreadystatechange"in global.document.createElement("script")?e0=function(){var e=global.document.createElement("script");e.onreadystatechange=function(){w1(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},global.document.documentElement.appendChild(e)}:e0=function(){setTimeout(w1,0)}:e0=function(){process.nextTick(w1)};var v6,Tce,y6,b6,_6,x1=[];function w1(){_6=!0;for(var e,t,r=x1.length;r;){for(t=x1,x1=[],e=-1;++e<r;)t[e]();r=x1.length}_6=!1}kce.exports=Wrt;function Wrt(e){x1.push(e)===1&&!_6&&e0()}});var Fce=A((uCt,Dce)=>{"use strict";var Cce=Rce();function t0(){}var Oa={},Ice=["REJECTED"],x6=["FULFILLED"],Pce=["PENDING"];process.browser||(E1=["UNHANDLED"]);var E1;Dce.exports=xh;function xh(e){if(typeof e!="function")throw new TypeError("resolver must be a function");this.state=Pce,this.queue=[],this.outcome=void 0,process.browser||(this.handled=E1),e!==t0&&Oce(this,e)}xh.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)}};xh.prototype.catch=function(e){return this.then(null,e)};xh.prototype.then=function(e,t){if(typeof e!="function"&&this.state===x6||typeof t!="function"&&this.state===Ice)return this;var r=new this.constructor(t0);if(process.browser||this.handled===E1&&(this.handled=null),this.state!==Pce){var i=this.state===x6?e:t;w6(r,i,this.outcome)}else this.queue.push(new S1(r,e,t));return r};function S1(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)}S1.prototype.callFulfilled=function(e){Oa.resolve(this.promise,e)};S1.prototype.otherCallFulfilled=function(e){w6(this.promise,this.onFulfilled,e)};S1.prototype.callRejected=function(e){Oa.reject(this.promise,e)};S1.prototype.otherCallRejected=function(e){w6(this.promise,this.onRejected,e)};function w6(e,t,r){Cce(function(){var i;try{i=t(r)}catch(n){return Oa.reject(e,n)}i===e?Oa.reject(e,new TypeError("Cannot resolve promise with itself")):Oa.resolve(e,i)})}Oa.resolve=function(e,t){var r=Bce(Vrt,t);if(r.status==="error")return Oa.reject(e,r.value);var i=r.value;if(i)Oce(e,i);else{e.state=x6,e.outcome=t;for(var n=-1,a=e.queue.length;++n<a;)e.queue[n].callFulfilled(t)}return e};Oa.reject=function(e,t){e.state=Ice,e.outcome=t,process.browser||e.handled===E1&&Cce(function(){e.handled===E1&&process.emit("unhandledRejection",t,e)});for(var r=-1,i=e.queue.length;++r<i;)e.queue[r].callRejected(t);return e};function Vrt(e){var t=e&&e.then;if(e&&(typeof e=="object"||typeof e=="function")&&typeof t=="function")return function(){t.apply(e,arguments)}}function Oce(e,t){var r=!1;function i(s){r||(r=!0,Oa.reject(e,s))}function n(s){r||(r=!0,Oa.resolve(e,s))}function a(){t(n,i)}var o=Bce(a);o.status==="error"&&i(o.value)}function Bce(e,t){var r={};try{r.value=e(t),r.status="success"}catch(i){r.status="error",r.value=i}return r}xh.resolve=Krt;function Krt(e){return e instanceof this?e:Oa.resolve(new this(t0),e)}xh.reject=Yrt;function Yrt(e){var t=new this(t0);return Oa.reject(t,e)}xh.all=$rt;function $rt(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,Oa.reject(s,h))});function f(h){n[c]=h,++a===r&&!i&&(i=!0,Oa.resolve(s,n))}}}xh.race=Xrt;function Xrt(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,Oa.resolve(a,u))},function(u){i||(i=!0,Oa.reject(a,u))})}}});var r0=A((lCt,Mce)=>{"use strict";var E6=null;typeof Promise!="undefined"?E6=Promise:E6=Fce();Mce.exports={Promise:E6}});var Lce=A(jce=>{(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 T=new Array(arguments.length-1),k=0;k<T.length;k++)T[k]=arguments[k+1];var R={callback:E,args:T};return i[r]=R,o(r),r++}function u(E){delete i[E]}function l(E){var T=E.callback,k=E.args;switch(k.length){case 0:T();break;case 1:T(k[0]);break;case 2:T(k[0],k[1]);break;case 3:T(k[0],k[1],k[2]);break;default:T.apply(t,k);break}}function c(E){if(n)setTimeout(c,0,E);else{var T=i[E];if(T){n=!0;try{l(T)}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,T=e.onmessage;return e.onmessage=function(){E=!1},e.postMessage("","*"),e.onmessage=T,E}}function d(){var E="setImmediate$"+Math.random()+"$",T=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",T,!1):e.attachEvent("onmessage",T),o=function(k){e.postMessage(E+k,"*")}}function p(){var E=new MessageChannel;E.port1.onmessage=function(T){var k=T.data;c(k)},o=function(T){E.port2.postMessage(T)}}function y(){var E=a.documentElement;o=function(T){var k=a.createElement("script");k.onreadystatechange=function(){c(T),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"?jce:global:self)});var ji=A(An=>{"use strict";var wh=Tc(),Jrt=g6(),i0=_1(),S6=r0();Lce();function Qrt(e){var t=null;return wh.uint8array?t=new Uint8Array(e.length):t=new Array(e.length),VT(e,t)}An.newBlob=function(e,t){An.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 A1(e){return e}function VT(e,t){for(var r=0;r<e.length;++r)t[r]=e.charCodeAt(r)&255;return t}var KT={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 wh.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return wh.nodebuffer&&String.fromCharCode.apply(null,i0.allocBuffer(1)).length===1}catch{return!1}}()}};function T1(e){var t=65536,r=An.getTypeOf(e),i=!0;if(r==="uint8array"?i=KT.applyCanBeUsed.uint8array:r==="nodebuffer"&&(i=KT.applyCanBeUsed.nodebuffer),i)for(;t>1;)try{return KT.stringifyByChunk(e,r,t)}catch{t=Math.floor(t/2)}return KT.stringifyByChar(e)}An.applyFromCharCode=T1;function YT(e,t){for(var r=0;r<e.length;r++)t[r]=e[r];return t}var Eh={};Eh.string={string:A1,array:function(e){return VT(e,new Array(e.length))},arraybuffer:function(e){return Eh.string.uint8array(e).buffer},uint8array:function(e){return VT(e,new Uint8Array(e.length))},nodebuffer:function(e){return VT(e,i0.allocBuffer(e.length))}};Eh.array={string:T1,array:A1,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return i0.newBufferFrom(e)}};Eh.arraybuffer={string:function(e){return T1(new Uint8Array(e))},array:function(e){return YT(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:A1,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return i0.newBufferFrom(new Uint8Array(e))}};Eh.uint8array={string:T1,array:function(e){return YT(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:A1,nodebuffer:function(e){return i0.newBufferFrom(e)}};Eh.nodebuffer={string:T1,array:function(e){return YT(e,new Array(e.length))},arraybuffer:function(e){return Eh.nodebuffer.uint8array(e).buffer},uint8array:function(e){return YT(e,new Uint8Array(e.length))},nodebuffer:A1};An.transformTo=function(e,t){if(t||(t=""),!e)return t;An.checkSupport(e);var r=An.getTypeOf(t),i=Eh[r][e](t);return i};An.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("/")};An.getTypeOf=function(e){if(typeof e=="string")return"string";if(Object.prototype.toString.call(e)==="[object Array]")return"array";if(wh.nodebuffer&&i0.isBuffer(e))return"nodebuffer";if(wh.uint8array&&e instanceof Uint8Array)return"uint8array";if(wh.arraybuffer&&e instanceof ArrayBuffer)return"arraybuffer"};An.checkSupport=function(e){var t=wh[e.toLowerCase()];if(!t)throw new Error(e+" is not supported by this platform")};An.MAX_VALUE_16BITS=65535;An.MAX_VALUE_32BITS=-1;An.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};An.delay=function(e,t,r){setImmediate(function(){e.apply(r||null,t||[])})};An.inherits=function(e,t){var r=function(){};r.prototype=t.prototype,e.prototype=new r};An.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};An.prepareContent=function(e,t,r,i,n){var a=S6.Promise.resolve(t).then(function(o){var s=wh.blob&&(o instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(o))!==-1);return s&&typeof FileReader!="undefined"?new S6.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=An.getTypeOf(o);return s?(s==="arraybuffer"?o=An.transformTo("uint8array",o):s==="string"&&(n?o=Jrt.decode(o):r&&i!==!0&&(o=Qrt(o))),o):S6.Promise.reject(new Error("Can't read the data of '"+e+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}});var Fo=A((hCt,qce)=>{"use strict";function Nce(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}Nce.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}};qce.exports=Nce});var a0=A(Sh=>{"use strict";var n0=ji(),ap=Tc(),Zrt=_1(),$T=Fo(),k1=new Array(256);for(kc=0;kc<256;kc++)k1[kc]=kc>=252?6:kc>=248?5:kc>=240?4:kc>=224?3:kc>=192?2:1;var kc;k1[254]=k1[254]=1;var eit=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(ap.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},tit=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+k1[e[r]]>t?r:t},rit=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=k1[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),n0.applyFromCharCode(o)};Sh.utf8encode=function(t){return ap.nodebuffer?Zrt.newBufferFrom(t,"utf-8"):eit(t)};Sh.utf8decode=function(t){return ap.nodebuffer?n0.transformTo("nodebuffer",t).toString("utf-8"):(t=n0.transformTo(ap.uint8array?"uint8array":"array",t),rit(t))};function XT(){$T.call(this,"utf-8 decode"),this.leftOver=null}n0.inherits(XT,$T);XT.prototype.processChunk=function(e){var t=n0.transformTo(ap.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(ap.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=tit(t),n=t;i!==t.length&&(ap.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:Sh.utf8decode(n),meta:e.meta})};XT.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:Sh.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)};Sh.Utf8DecodeWorker=XT;function A6(){$T.call(this,"utf-8 encode")}n0.inherits(A6,$T);A6.prototype.processChunk=function(e){this.push({data:Sh.utf8encode(e.data),meta:e.meta})};Sh.Utf8EncodeWorker=A6});var Hce=A((pCt,zce)=>{"use strict";var Uce=Fo(),Gce=ji();function T6(e){Uce.call(this,"ConvertWorker to "+e),this.destType=e}Gce.inherits(T6,Uce);T6.prototype.processChunk=function(e){this.push({data:Gce.transformTo(this.destType,e.data),meta:e.meta})};zce.exports=T6});var Kce=A((mCt,Vce)=>{"use strict";var Wce=db().Readable,iit=ji();iit.inherits(k6,Wce);function k6(e,t,r){Wce.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)})}k6.prototype._read=function(){this._helper.resume()};Vce.exports=k6});var R6=A((gCt,Xce)=>{"use strict";var op=ji(),nit=Hce(),ait=Fo(),oit=g6(),sit=Tc(),uit=r0(),Yce=null;if(sit.nodestream)try{Yce=Kce()}catch{}function lit(e,t,r){switch(e){case"blob":return op.newBlob(op.transformTo("arraybuffer",t),r);case"base64":return oit.encode(t);default:return op.transformTo(e,t)}}function cit(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 fit(e,t){return new uit.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=lit(o,cit(a,n),s);r(u)}catch(l){i(l)}n=[]}).resume()})}function $ce(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,op.checkSupport(i),this._worker=e.pipe(new nit(i)),e.lock()}catch(n){this._worker=new ait("error"),this._worker.error(n)}}$ce.prototype={accumulate:function(e){return fit(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(){op.delay(t,arguments,r)}),this},resume:function(){return op.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(op.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new Yce(this,{objectMode:this._outputType!=="nodebuffer"},e)}};Xce.exports=$ce});var C6=A(cu=>{"use strict";cu.base64=!1;cu.binary=!1;cu.dir=!1;cu.createFolders=!0;cu.date=null;cu.compression=null;cu.compressionOptions=null;cu.comment=null;cu.unixPermissions=null;cu.dosPermissions=null});var I6=A((yCt,Jce)=>{"use strict";var JT=ji(),QT=Fo(),hit=16*1024;function o0(e){QT.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=JT.getTypeOf(r),t.isPaused||t._tickAndRepeat()},function(r){t.error(r)})}JT.inherits(o0,QT);o0.prototype.cleanUp=function(){QT.prototype.cleanUp.call(this),this.data=null};o0.prototype.resume=function(){return QT.prototype.resume.call(this)?(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,JT.delay(this._tickAndRepeat,[],this)),!0):!1};o0.prototype._tickAndRepeat=function(){this._tickScheduled=!1,!(this.isPaused||this.isFinished)&&(this._tick(),this.isFinished||(JT.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))};o0.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=hit,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}})};Jce.exports=o0});var ZT=A((bCt,Zce)=>{"use strict";var dit=ji();function pit(){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 Qce=pit();function mit(e,t,r,i){var n=Qce,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 git(e,t,r,i){var n=Qce,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}Zce.exports=function(t,r){if(typeof t=="undefined"||!t.length)return 0;var i=dit.getTypeOf(t)!=="string";return i?mit(r|0,t,t.length,0):git(r|0,t,t.length,0)}});var O6=A((_Ct,tfe)=>{"use strict";var efe=Fo(),vit=ZT(),yit=ji();function P6(){efe.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}yit.inherits(P6,efe);P6.prototype.processChunk=function(e){this.streamInfo.crc32=vit(e.data,this.streamInfo.crc32||0),this.push(e)};tfe.exports=P6});var ife=A((xCt,rfe)=>{"use strict";var bit=ji(),B6=Fo();function D6(e){B6.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}bit.inherits(D6,B6);D6.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}B6.prototype.processChunk.call(this,e)};rfe.exports=D6});var e2=A((wCt,ofe)=>{"use strict";var nfe=r0(),afe=I6(),_it=O6(),F6=ife();function M6(e,t,r,i,n){this.compressedSize=e,this.uncompressedSize=t,this.crc32=r,this.compression=i,this.compressedContent=n}M6.prototype={getContentWorker:function(){var e=new afe(nfe.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new F6("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 afe(nfe.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}};M6.createWorkerFrom=function(e,t,r){return e.pipe(new _it).pipe(new F6("uncompressedSize")).pipe(t.compressWorker(r)).pipe(new F6("compressedSize")).withStreamInfo("compression",t)};ofe.exports=M6});var cfe=A((ECt,lfe)=>{"use strict";var xit=R6(),wit=I6(),j6=a0(),L6=e2(),sfe=Fo(),N6=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}};N6.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 j6.Utf8EncodeWorker)),!n&&i&&(t=t.pipe(new j6.Utf8DecodeWorker))}catch(a){t=new sfe("error"),t.error(a)}return new xit(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 L6&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var r=this._decompressWorker();return this._dataBinary||(r=r.pipe(new j6.Utf8EncodeWorker)),L6.createWorkerFrom(r,e,t)},_decompressWorker:function(){return this._data instanceof L6?this._data.getContentWorker():this._data instanceof sfe?this._data:new wit(this._data)}};var ufe=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],Eit=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")};for(t2=0;t2<ufe.length;t2++)N6.prototype[ufe[t2]]=Eit;var t2;lfe.exports=N6});var Rc=A($a=>{"use strict";var Sit=typeof Uint8Array!="undefined"&&typeof Uint16Array!="undefined"&&typeof Int32Array!="undefined";function Ait(e,t){return Object.prototype.hasOwnProperty.call(e,t)}$a.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)Ait(r,i)&&(e[i]=r[i])}}return e};$a.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var Tit={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}},kit={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)}};$a.setTyped=function(e){e?($a.Buf8=Uint8Array,$a.Buf16=Uint16Array,$a.Buf32=Int32Array,$a.assign($a,Tit)):($a.Buf8=Array,$a.Buf16=Array,$a.Buf32=Array,$a.assign($a,kit))};$a.setTyped(Sit)});var Bfe=A(l0=>{"use strict";var Rit=Rc(),Cit=4,ffe=0,hfe=1,Iit=2;function s0(e){for(var t=e.length;--t>=0;)e[t]=0}var Pit=0,dfe=1,Oit=2,Bit=3,Dit=258,q6=29,R1=256,C1=R1+1+q6,u0=30,U6=19,pfe=2*C1+1,sp=15,G6=16,Fit=7,z6=256,mfe=16,gfe=17,vfe=18,H6=[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],r2=[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],Mit=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],yfe=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],jit=512,Cc=new Array((C1+2)*2);s0(Cc);var I1=new Array(u0*2);s0(I1);var P1=new Array(jit);s0(P1);var O1=new Array(Dit-Bit+1);s0(O1);var W6=new Array(q6);s0(W6);var i2=new Array(u0);s0(i2);function V6(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 bfe,_fe,xfe;function K6(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function wfe(e){return e<256?P1[e]:P1[256+(e>>>7)]}function B1(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function co(e,t,r){e.bi_valid>G6-r?(e.bi_buf|=t<<e.bi_valid&65535,B1(e,e.bi_buf),e.bi_buf=t>>G6-e.bi_valid,e.bi_valid+=r-G6):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function pl(e,t,r){co(e,r[t*2],r[t*2+1])}function Efe(e,t){var r=0;do r|=e&1,e>>>=1,r<<=1;while(--t>0);return r>>>1}function Lit(e){e.bi_valid===16?(B1(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 Nit(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<=sp;h++)e.bl_count[h]=0;for(r[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<pfe;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 Sfe(e,t,r){var i=new Array(sp+1),n=0,a,o;for(a=1;a<=sp;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]=Efe(i[s]++,s))}}function qit(){var e,t,r,i,n,a=new Array(sp+1);for(r=0,i=0;i<q6-1;i++)for(W6[i]=r,e=0;e<1<<H6[i];e++)O1[r++]=i;for(O1[r-1]=i,n=0,i=0;i<16;i++)for(i2[i]=n,e=0;e<1<<r2[i];e++)P1[n++]=i;for(n>>=7;i<u0;i++)for(i2[i]=n<<7,e=0;e<1<<r2[i]-7;e++)P1[256+n++]=i;for(t=0;t<=sp;t++)a[t]=0;for(e=0;e<=143;)Cc[e*2+1]=8,e++,a[8]++;for(;e<=255;)Cc[e*2+1]=9,e++,a[9]++;for(;e<=279;)Cc[e*2+1]=7,e++,a[7]++;for(;e<=287;)Cc[e*2+1]=8,e++,a[8]++;for(Sfe(Cc,C1+1,a),e=0;e<u0;e++)I1[e*2+1]=5,I1[e*2]=Efe(e,5);bfe=new V6(Cc,H6,R1+1,C1,sp),_fe=new V6(I1,r2,0,u0,sp),xfe=new V6(new Array(0),Mit,0,U6,Fit)}function Afe(e){var t;for(t=0;t<C1;t++)e.dyn_ltree[t*2]=0;for(t=0;t<u0;t++)e.dyn_dtree[t*2]=0;for(t=0;t<U6;t++)e.bl_tree[t*2]=0;e.dyn_ltree[z6*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function Tfe(e){e.bi_valid>8?B1(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 Uit(e,t,r,i){Tfe(e),i&&(B1(e,r),B1(e,~r)),Rit.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}function kfe(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 Y6(e,t,r){for(var i=e.heap[r],n=r<<1;n<=e.heap_len&&(n<e.heap_len&&kfe(t,e.heap[n+1],e.heap[n],e.depth)&&n++,!kfe(t,i,e.heap[n],e.depth));)e.heap[r]=e.heap[n],r=n,n<<=1;e.heap[r]=i}function Rfe(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?pl(e,n,t):(o=O1[n],pl(e,o+R1+1,t),s=H6[o],s!==0&&(n-=W6[o],co(e,n,s)),i--,o=wfe(i),pl(e,o,r),s=r2[o],s!==0&&(i-=i2[o],co(e,i,s)));while(a<e.last_lit);pl(e,z6,t)}function $6(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=pfe,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--)Y6(e,r,o);l=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Y6(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++,Y6(e,r,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Nit(e,t),Sfe(r,u,e.bl_count)}function Cfe(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[mfe*2]++):s<=10?e.bl_tree[gfe*2]++:e.bl_tree[vfe*2]++,s=0,n=a,o===0?(u=138,l=3):a===o?(u=6,l=3):(u=7,l=4))}function Ife(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 pl(e,a,e.bl_tree);while(--s!=0);else a!==0?(a!==n&&(pl(e,a,e.bl_tree),s--),pl(e,mfe,e.bl_tree),co(e,s-3,2)):s<=10?(pl(e,gfe,e.bl_tree),co(e,s-3,3)):(pl(e,vfe,e.bl_tree),co(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 Git(e){var t;for(Cfe(e,e.dyn_ltree,e.l_desc.max_code),Cfe(e,e.dyn_dtree,e.d_desc.max_code),$6(e,e.bl_desc),t=U6-1;t>=3&&e.bl_tree[yfe[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function zit(e,t,r,i){var n;for(co(e,t-257,5),co(e,r-1,5),co(e,i-4,4),n=0;n<i;n++)co(e,e.bl_tree[yfe[n]*2+1],3);Ife(e,e.dyn_ltree,t-1),Ife(e,e.dyn_dtree,r-1)}function Hit(e){var t=4093624447,r;for(r=0;r<=31;r++,t>>>=1)if(t&1&&e.dyn_ltree[r*2]!==0)return ffe;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return hfe;for(r=32;r<R1;r++)if(e.dyn_ltree[r*2]!==0)return hfe;return ffe}var Pfe=!1;function Wit(e){Pfe||(qit(),Pfe=!0),e.l_desc=new K6(e.dyn_ltree,bfe),e.d_desc=new K6(e.dyn_dtree,_fe),e.bl_desc=new K6(e.bl_tree,xfe),e.bi_buf=0,e.bi_valid=0,Afe(e)}function Ofe(e,t,r,i){co(e,(Pit<<1)+(i?1:0),3),Uit(e,t,r,!0)}function Vit(e){co(e,dfe<<1,3),pl(e,z6,Cc),Lit(e)}function Kit(e,t,r,i){var n,a,o=0;e.level>0?(e.strm.data_type===Iit&&(e.strm.data_type=Hit(e)),$6(e,e.l_desc),$6(e,e.d_desc),o=Git(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?Ofe(e,t,r,i):e.strategy===Cit||a===n?(co(e,(dfe<<1)+(i?1:0),3),Rfe(e,Cc,I1)):(co(e,(Oit<<1)+(i?1:0),3),zit(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),Rfe(e,e.dyn_ltree,e.dyn_dtree)),Afe(e),i&&Tfe(e)}function Yit(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[(O1[r]+R1+1)*2]++,e.dyn_dtree[wfe(t)*2]++),e.last_lit===e.lit_bufsize-1}l0._tr_init=Wit;l0._tr_stored_block=Ofe;l0._tr_flush_block=Kit;l0._tr_tally=Yit;l0._tr_align=Vit});var X6=A((TCt,Dfe)=>{"use strict";function $it(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}Dfe.exports=$it});var J6=A((kCt,Ffe)=>{"use strict";function Xit(){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 Jit=Xit();function Qit(e,t,r,i){var n=Jit,a=i+r;e^=-1;for(var o=i;o<a;o++)e=e>>>8^n[(e^t[o])&255];return e^-1}Ffe.exports=Qit});var n2=A((RCt,Mfe)=>{"use strict";Mfe.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 Wfe=A(vl=>{"use strict";var Xa=Rc(),Es=Bfe(),jfe=X6(),Ah=J6(),Zit=n2(),up=0,ent=1,tnt=3,Th=4,Lfe=5,ml=0,Nfe=1,Ss=-2,rnt=-3,Q6=-5,int=-1,nnt=1,a2=2,ant=3,ont=4,snt=0,unt=2,o2=8,lnt=9,cnt=15,fnt=8,hnt=29,dnt=256,Z6=dnt+1+hnt,pnt=30,mnt=19,gnt=2*Z6+1,vnt=15,Pr=3,kh=258,fu=kh+Pr+1,ynt=32,s2=42,ej=69,u2=73,l2=91,c2=103,lp=113,D1=666,qn=1,F1=2,cp=3,c0=4,bnt=3;function Rh(e,t){return e.msg=Zit[t],t}function qfe(e){return(e<<1)-(e>4?9:0)}function Ch(e){for(var t=e.length;--t>=0;)e[t]=0}function Ih(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(Xa.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 ma(e,t){Es._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Ih(e.strm)}function Yr(e,t){e.pending_buf[e.pending++]=t}function M1(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function _nt(e,t,r,i){var n=e.avail_in;return n>i&&(n=i),n===0?0:(e.avail_in-=n,Xa.arraySet(t,e.input,e.next_in,n,r),e.state.wrap===1?e.adler=jfe(e.adler,t,n,r):e.state.wrap===2&&(e.adler=Ah(e.adler,t,n,r)),e.next_in+=n,e.total_in+=n,n)}function Ufe(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-fu?e.strstart-(e.w_size-fu):0,l=e.window,c=e.w_mask,f=e.prev,h=e.strstart+kh,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=kh-(h-i),i=h-kh,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 fp(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-fu)){Xa.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=_nt(e.strm,e.window,e.strstart+e.lookahead,a),e.lookahead+=i,e.lookahead+e.insert>=Pr)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+Pr-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<Pr)););}while(e.lookahead<fu&&e.strm.avail_in!==0)}function xnt(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(fp(e),e.lookahead===0&&t===up)return qn;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,ma(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-fu&&(ma(e,!1),e.strm.avail_out===0))return qn}return e.insert=0,t===Th?(ma(e,!0),e.strm.avail_out===0?cp:c0):(e.strstart>e.block_start&&(ma(e,!1),e.strm.avail_out===0),qn)}function tj(e,t){for(var r,i;;){if(e.lookahead<fu){if(fp(e),e.lookahead<fu&&t===up)return qn;if(e.lookahead===0)break}if(r=0,e.lookahead>=Pr&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+Pr-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-fu&&(e.match_length=Ufe(e,r)),e.match_length>=Pr)if(i=Es._tr_tally(e,e.strstart-e.match_start,e.match_length-Pr),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=Pr){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+Pr-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=Es._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(ma(e,!1),e.strm.avail_out===0))return qn}return e.insert=e.strstart<Pr-1?e.strstart:Pr-1,t===Th?(ma(e,!0),e.strm.avail_out===0?cp:c0):e.last_lit&&(ma(e,!1),e.strm.avail_out===0)?qn:F1}function f0(e,t){for(var r,i,n;;){if(e.lookahead<fu){if(fp(e),e.lookahead<fu&&t===up)return qn;if(e.lookahead===0)break}if(r=0,e.lookahead>=Pr&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+Pr-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=Pr-1,r!==0&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-fu&&(e.match_length=Ufe(e,r),e.match_length<=5&&(e.strategy===nnt||e.match_length===Pr&&e.strstart-e.match_start>4096)&&(e.match_length=Pr-1)),e.prev_length>=Pr&&e.match_length<=e.prev_length){n=e.strstart+e.lookahead-Pr,i=Es._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-Pr),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+Pr-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=Pr-1,e.strstart++,i&&(ma(e,!1),e.strm.avail_out===0))return qn}else if(e.match_available){if(i=Es._tr_tally(e,0,e.window[e.strstart-1]),i&&ma(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return qn}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(i=Es._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<Pr-1?e.strstart:Pr-1,t===Th?(ma(e,!0),e.strm.avail_out===0?cp:c0):e.last_lit&&(ma(e,!1),e.strm.avail_out===0)?qn:F1}function wnt(e,t){for(var r,i,n,a,o=e.window;;){if(e.lookahead<=kh){if(fp(e),e.lookahead<=kh&&t===up)return qn;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=Pr&&e.strstart>0&&(n=e.strstart-1,i=o[n],i===o[++n]&&i===o[++n]&&i===o[++n])){a=e.strstart+kh;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=kh-(a-n),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=Pr?(r=Es._tr_tally(e,1,e.match_length-Pr),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=Es._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(ma(e,!1),e.strm.avail_out===0))return qn}return e.insert=0,t===Th?(ma(e,!0),e.strm.avail_out===0?cp:c0):e.last_lit&&(ma(e,!1),e.strm.avail_out===0)?qn:F1}function Ent(e,t){for(var r;;){if(e.lookahead===0&&(fp(e),e.lookahead===0)){if(t===up)return qn;break}if(e.match_length=0,r=Es._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(ma(e,!1),e.strm.avail_out===0))return qn}return e.insert=0,t===Th?(ma(e,!0),e.strm.avail_out===0?cp:c0):e.last_lit&&(ma(e,!1),e.strm.avail_out===0)?qn:F1}function gl(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 h0;h0=[new gl(0,0,0,0,xnt),new gl(4,4,8,4,tj),new gl(4,5,16,8,tj),new gl(4,6,32,32,tj),new gl(4,4,16,16,f0),new gl(8,16,32,32,f0),new gl(8,16,128,128,f0),new gl(8,32,128,256,f0),new gl(32,128,258,1024,f0),new gl(32,258,258,4096,f0)];function Snt(e){e.window_size=2*e.w_size,Ch(e.head),e.max_lazy_match=h0[e.level].max_lazy,e.good_match=h0[e.level].good_length,e.nice_match=h0[e.level].nice_length,e.max_chain_length=h0[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=Pr-1,e.match_available=0,e.ins_h=0}function Ant(){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=o2,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 Xa.Buf16(gnt*2),this.dyn_dtree=new Xa.Buf16((2*pnt+1)*2),this.bl_tree=new Xa.Buf16((2*mnt+1)*2),Ch(this.dyn_ltree),Ch(this.dyn_dtree),Ch(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Xa.Buf16(vnt+1),this.heap=new Xa.Buf16(2*Z6+1),Ch(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Xa.Buf16(2*Z6+1),Ch(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 Gfe(e){var t;return!e||!e.state?Rh(e,Ss):(e.total_in=e.total_out=0,e.data_type=unt,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?s2:lp,e.adler=t.wrap===2?0:1,t.last_flush=up,Es._tr_init(t),ml)}function zfe(e){var t=Gfe(e);return t===ml&&Snt(e.state),t}function Tnt(e,t){return!e||!e.state||e.state.wrap!==2?Ss:(e.state.gzhead=t,ml)}function Hfe(e,t,r,i,n,a){if(!e)return Ss;var o=1;if(t===int&&(t=6),i<0?(o=0,i=-i):i>15&&(o=2,i-=16),n<1||n>lnt||r!==o2||i<8||i>15||t<0||t>9||a<0||a>ont)return Rh(e,Ss);i===8&&(i=9);var s=new Ant;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+Pr-1)/Pr),s.window=new Xa.Buf8(s.w_size*2),s.head=new Xa.Buf16(s.hash_size),s.prev=new Xa.Buf16(s.w_size),s.lit_bufsize=1<<n+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Xa.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,zfe(e)}function knt(e,t){return Hfe(e,t,o2,cnt,fnt,snt)}function Rnt(e,t){var r,i,n,a;if(!e||!e.state||t>Lfe||t<0)return e?Rh(e,Ss):Ss;if(i=e.state,!e.output||!e.input&&e.avail_in!==0||i.status===D1&&t!==Th)return Rh(e,e.avail_out===0?Q6:Ss);if(i.strm=e,r=i.last_flush,i.last_flush=t,i.status===s2)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>=a2||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=Ah(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=ej):(Yr(i,0),Yr(i,0),Yr(i,0),Yr(i,0),Yr(i,0),Yr(i,i.level===9?2:i.strategy>=a2||i.level<2?4:0),Yr(i,bnt),i.status=lp);else{var o=o2+(i.w_bits-8<<4)<<8,s=-1;i.strategy>=a2||i.level<2?s=0:i.level<6?s=1:i.level===6?s=2:s=3,o|=s<<6,i.strstart!==0&&(o|=ynt),o+=31-o%31,i.status=lp,M1(i,o),i.strstart!==0&&(M1(i,e.adler>>>16),M1(i,e.adler&65535)),e.adler=1}if(i.status===ej)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=Ah(e.adler,i.pending_buf,i.pending-n,n)),Ih(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=Ah(e.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=u2)}else i.status=u2;if(i.status===u2)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=Ah(e.adler,i.pending_buf,i.pending-n,n)),Ih(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=Ah(e.adler,i.pending_buf,i.pending-n,n)),a===0&&(i.gzindex=0,i.status=l2)}else i.status=l2;if(i.status===l2)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=Ah(e.adler,i.pending_buf,i.pending-n,n)),Ih(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=Ah(e.adler,i.pending_buf,i.pending-n,n)),a===0&&(i.status=c2)}else i.status=c2;if(i.status===c2&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&Ih(e),i.pending+2<=i.pending_buf_size&&(Yr(i,e.adler&255),Yr(i,e.adler>>8&255),e.adler=0,i.status=lp)):i.status=lp),i.pending!==0){if(Ih(e),e.avail_out===0)return i.last_flush=-1,ml}else if(e.avail_in===0&&qfe(t)<=qfe(r)&&t!==Th)return Rh(e,Q6);if(i.status===D1&&e.avail_in!==0)return Rh(e,Q6);if(e.avail_in!==0||i.lookahead!==0||t!==up&&i.status!==D1){var u=i.strategy===a2?Ent(i,t):i.strategy===ant?wnt(i,t):h0[i.level].func(i,t);if((u===cp||u===c0)&&(i.status=D1),u===qn||u===cp)return e.avail_out===0&&(i.last_flush=-1),ml;if(u===F1&&(t===ent?Es._tr_align(i):t!==Lfe&&(Es._tr_stored_block(i,0,0,!1),t===tnt&&(Ch(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),Ih(e),e.avail_out===0))return i.last_flush=-1,ml}return t!==Th?ml:i.wrap<=0?Nfe:(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)):(M1(i,e.adler>>>16),M1(i,e.adler&65535)),Ih(e),i.wrap>0&&(i.wrap=-i.wrap),i.pending!==0?ml:Nfe)}function Cnt(e){var t;return!e||!e.state?Ss:(t=e.state.status,t!==s2&&t!==ej&&t!==u2&&t!==l2&&t!==c2&&t!==lp&&t!==D1?Rh(e,Ss):(e.state=null,t===lp?Rh(e,rnt):ml))}function Int(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!==s2||i.lookahead))return Ss;for(o===1&&(e.adler=jfe(e.adler,t,r,0)),i.wrap=0,r>=i.w_size&&(o===0&&(Ch(i.head),i.strstart=0,i.block_start=0,i.insert=0),c=new Xa.Buf8(i.w_size),Xa.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,fp(i);i.lookahead>=Pr;){n=i.strstart,a=i.lookahead-(Pr-1);do i.ins_h=(i.ins_h<<i.hash_shift^i.window[n+Pr-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=Pr-1,fp(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=Pr-1,i.match_available=0,e.next_in=u,e.input=l,e.avail_in=s,i.wrap=o,ml}vl.deflateInit=knt;vl.deflateInit2=Hfe;vl.deflateReset=zfe;vl.deflateResetKeep=Gfe;vl.deflateSetHeader=Tnt;vl.deflate=Rnt;vl.deflateEnd=Cnt;vl.deflateSetDictionary=Int;vl.deflateInfo="pako deflate (from Nodeca project)"});var rj=A(d0=>{"use strict";var f2=Rc(),Vfe=!0,Kfe=!0;try{String.fromCharCode.apply(null,[0])}catch{Vfe=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Kfe=!1}var j1=new f2.Buf8(256);for(Ic=0;Ic<256;Ic++)j1[Ic]=Ic>=252?6:Ic>=248?5:Ic>=240?4:Ic>=224?3:Ic>=192?2:1;var Ic;j1[254]=j1[254]=1;d0.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 f2.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 Yfe(e,t){if(t<65534&&(e.subarray&&Kfe||!e.subarray&&Vfe))return String.fromCharCode.apply(null,f2.shrinkBuf(e,t));for(var r="",i=0;i<t;i++)r+=String.fromCharCode(e[i]);return r}d0.buf2binstring=function(e){return Yfe(e,e.length)};d0.binstring2buf=function(e){for(var t=new f2.Buf8(e.length),r=0,i=t.length;r<i;r++)t[r]=e.charCodeAt(r);return t};d0.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=j1[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 Yfe(s,i)};d0.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+j1[e[r]]>t?r:t}});var ij=A((PCt,$fe)=>{"use strict";function Pnt(){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}$fe.exports=Pnt});var Zfe=A(q1=>{"use strict";var L1=Wfe(),N1=Rc(),nj=rj(),aj=n2(),Ont=ij(),Xfe=Object.prototype.toString,Bnt=0,oj=4,p0=0,Jfe=1,Qfe=2,Dnt=-1,Fnt=0,Mnt=8;function hp(e){if(!(this instanceof hp))return new hp(e);this.options=N1.assign({level:Dnt,method:Mnt,chunkSize:16384,windowBits:15,memLevel:8,strategy:Fnt,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 Ont,this.strm.avail_out=0;var r=L1.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==p0)throw new Error(aj[r]);if(t.header&&L1.deflateSetHeader(this.strm,t.header),t.dictionary){var i;if(typeof t.dictionary=="string"?i=nj.string2buf(t.dictionary):Xfe.call(t.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(t.dictionary):i=t.dictionary,r=L1.deflateSetDictionary(this.strm,i),r!==p0)throw new Error(aj[r]);this._dict_set=!0}}hp.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?oj:Bnt,typeof e=="string"?r.input=nj.string2buf(e):Xfe.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 N1.Buf8(i),r.next_out=0,r.avail_out=i),n=L1.deflate(r,a),n!==Jfe&&n!==p0)return this.onEnd(n),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(a===oj||a===Qfe))&&(this.options.to==="string"?this.onData(nj.buf2binstring(N1.shrinkBuf(r.output,r.next_out))):this.onData(N1.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&n!==Jfe);return a===oj?(n=L1.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===p0):(a===Qfe&&(this.onEnd(p0),r.avail_out=0),!0)};hp.prototype.onData=function(e){this.chunks.push(e)};hp.prototype.onEnd=function(e){e===p0&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=N1.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function sj(e,t){var r=new hp(t);if(r.push(e,!0),r.err)throw r.msg||aj[r.err];return r.result}function jnt(e,t){return t=t||{},t.raw=!0,sj(e,t)}function Lnt(e,t){return t=t||{},t.gzip=!0,sj(e,t)}q1.Deflate=hp;q1.deflate=sj;q1.deflateRaw=jnt;q1.gzip=Lnt});var the=A((BCt,ehe)=>{"use strict";var h2=30,Nnt=12;ehe.exports=function(t,r){var i,n,a,o,s,u,l,c,f,h,d,p,y,g,b,E,T,k,R,D,C,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,T=(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){D=k&65535,R&=15,R&&(y<R&&(p+=V[n++]<<y,y+=8),D+=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&T];r:for(;;){if(R=k>>>24,p>>>=R,y-=R,R=k>>>16&255,R&16){if(C=k&65535,R&=15,y<R&&(p+=V[n++]<<y,y+=8,y<R&&(p+=V[n++]<<y,y+=8)),C+=p&(1<<R)-1,C>l){t.msg="invalid distance too far back",i.mode=h2;break e}if(p>>>=R,y-=R,R=o-s,C>R){if(R=C-R,R>f&&i.sane){t.msg="invalid distance too far back",i.mode=h2;break e}if(L=0,B=d,h===0){if(L+=c-R,R<D){D-=R;do N[o++]=d[L++];while(--R);L=o-C,B=N}}else if(h<R){if(L+=c+h-R,R-=h,R<D){D-=R;do N[o++]=d[L++];while(--R);if(L=0,h<D){R=h,D-=R;do N[o++]=d[L++];while(--R);L=o-C,B=N}}}else if(L+=h-R,R<D){D-=R;do N[o++]=d[L++];while(--R);L=o-C,B=N}for(;D>2;)N[o++]=B[L++],N[o++]=B[L++],N[o++]=B[L++],D-=3;D&&(N[o++]=B[L++],D>1&&(N[o++]=B[L++]))}else{L=o-C;do N[o++]=N[L++],N[o++]=N[L++],N[o++]=N[L++],D-=3;while(D>2);D&&(N[o++]=N[L++],D>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=h2;break e}break}}else if((R&64)==0){k=g[(k&65535)+(p&(1<<R)-1)];continue t}else if(R&32){i.mode=Nnt;break e}else{t.msg="invalid literal/length code",i.mode=h2;break e}break}}while(n<a&&o<u);D=y>>3,n-=D,y-=D<<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 uhe=A((DCt,she)=>{"use strict";var rhe=Rc(),m0=15,ihe=852,nhe=592,ahe=0,uj=1,ohe=2,qnt=[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],Unt=[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],Gnt=[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],znt=[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];she.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,T=0,k,R,D,C,L,B=null,V=0,N,z=new rhe.Buf16(m0+1),j=new rhe.Buf16(m0+1),H=null,$=0,te,re,ne;for(c=0;c<=m0;c++)z[c]=0;for(f=0;f<n;f++)z[r[i+f]]++;for(p=l,d=m0;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<=m0;c++)if(b<<=1,b-=z[c],b<0)return-1;if(b>0&&(t===ahe||d!==1))return-1;for(j[1]=0,c=1;c<m0;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===ahe?(B=H=s,N=19):t===uj?(B=qnt,V-=257,H=Unt,$-=257,N=256):(B=Gnt,H=znt,N=-1),T=0,f=0,c=h,L=o,y=p,g=0,D=-1,E=1<<p,C=E-1,t===uj&&E>ihe||t===ohe&&E>nhe)return 1;for(;;){te=c-g,s[f]<N?(re=0,ne=s[f]):s[f]>N?(re=H[$+s[f]],ne=B[V+s[f]]):(re=32+64,ne=0),k=1<<c-g,R=1<<y,h=R;do R-=k,a[L+(T>>g)+R]=te<<24|re<<16|ne|0;while(R!==0);for(k=1<<c-1;T&k;)k>>=1;if(k!==0?(T&=k-1,T+=k):T=0,f++,--z[c]==0){if(c===d)break;c=r[i+s[f]]}if(c>p&&(T&C)!==D){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===uj&&E>ihe||t===ohe&&E>nhe)return 1;D=T&C,a[D]=p<<24|y<<16|L-o|0}}return T!==0&&(a[L+T]=c-g<<24|64<<16|0),u.bits=p,0}});var zhe=A(hu=>{"use strict";var Mo=Rc(),lj=X6(),yl=J6(),Hnt=the(),U1=uhe(),Wnt=0,lhe=1,che=2,fhe=4,Vnt=5,d2=6,dp=0,Knt=1,Ynt=2,As=-2,hhe=-3,cj=-4,$nt=-5,dhe=8,phe=1,mhe=2,ghe=3,vhe=4,yhe=5,bhe=6,_he=7,xhe=8,whe=9,Ehe=10,p2=11,Pc=12,fj=13,She=14,hj=15,Ahe=16,The=17,khe=18,Rhe=19,m2=20,g2=21,Che=22,Ihe=23,Phe=24,Ohe=25,Bhe=26,dj=27,Dhe=28,Fhe=29,Ti=30,pj=31,Xnt=32,Jnt=852,Qnt=592,Znt=15,eat=Znt;function Mhe(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function tat(){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 Mo.Buf16(320),this.work=new Mo.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function jhe(e){var t;return!e||!e.state?As:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=phe,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Mo.Buf32(Jnt),t.distcode=t.distdyn=new Mo.Buf32(Qnt),t.sane=1,t.back=-1,dp)}function Lhe(e){var t;return!e||!e.state?As:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,jhe(e))}function Nhe(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))?As:(i.window!==null&&i.wbits!==t&&(i.window=null),i.wrap=r,i.wbits=t,Lhe(e))}function qhe(e,t){var r,i;return e?(i=new tat,e.state=i,i.window=null,r=Nhe(e,t),r!==dp&&(e.state=null),r):As}function rat(e){return qhe(e,eat)}var Uhe=!0,mj,gj;function iat(e){if(Uhe){var t;for(mj=new Mo.Buf32(512),gj=new Mo.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(U1(lhe,e.lens,0,288,mj,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;U1(che,e.lens,0,32,gj,0,e.work,{bits:5}),Uhe=!1}e.lencode=mj,e.lenbits=9,e.distcode=gj,e.distbits=5}function Ghe(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 Mo.Buf8(a.wsize)),i>=a.wsize?(Mo.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),Mo.arraySet(a.window,t,r-i,n,a.wnext),i-=n,i?(Mo.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 nat(e,t){var r,i,n,a,o,s,u,l,c,f,h,d,p,y,g=0,b,E,T,k,R,D,C,L,B=new Mo.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 As;r=e.state,r.mode===Pc&&(r.mode=fj),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=dp;e:for(;;)switch(r.mode){case phe:if(r.wrap===0){r.mode=fj;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=yl(r.check,B,2,0),l=0,c=0,r.mode=mhe;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=Ti;break}if((l&15)!==dhe){e.msg="unknown compression method",r.mode=Ti;break}if(l>>>=4,c-=4,C=(l&15)+8,r.wbits===0)r.wbits=C;else if(C>r.wbits){e.msg="invalid window size",r.mode=Ti;break}r.dmax=1<<C,e.adler=r.check=1,r.mode=l&512?Ehe:Pc,l=0,c=0;break;case mhe:for(;c<16;){if(s===0)break e;s--,l+=i[a++]<<c,c+=8}if(r.flags=l,(r.flags&255)!==dhe){e.msg="unknown compression method",r.mode=Ti;break}if(r.flags&57344){e.msg="unknown header flags set",r.mode=Ti;break}r.head&&(r.head.text=l>>8&1),r.flags&512&&(B[0]=l&255,B[1]=l>>>8&255,r.check=yl(r.check,B,2,0)),l=0,c=0,r.mode=ghe;case ghe: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=yl(r.check,B,4,0)),l=0,c=0,r.mode=vhe;case vhe: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=yl(r.check,B,2,0)),l=0,c=0,r.mode=yhe;case yhe: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=yl(r.check,B,2,0)),l=0,c=0}else r.head&&(r.head.extra=null);r.mode=bhe;case bhe:if(r.flags&1024&&(d=r.length,d>s&&(d=s),d&&(r.head&&(C=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),Mo.arraySet(r.head.extra,i,a,d,C)),r.flags&512&&(r.check=yl(r.check,i,d,a)),s-=d,a+=d,r.length-=d),r.length))break e;r.length=0,r.mode=_he;case _he:if(r.flags&2048){if(s===0)break e;d=0;do C=i[a+d++],r.head&&C&&r.length<65536&&(r.head.name+=String.fromCharCode(C));while(C&&d<s);if(r.flags&512&&(r.check=yl(r.check,i,d,a)),s-=d,a+=d,C)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=xhe;case xhe:if(r.flags&4096){if(s===0)break e;d=0;do C=i[a+d++],r.head&&C&&r.length<65536&&(r.head.comment+=String.fromCharCode(C));while(C&&d<s);if(r.flags&512&&(r.check=yl(r.check,i,d,a)),s-=d,a+=d,C)break e}else r.head&&(r.head.comment=null);r.mode=whe;case whe: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=Ti;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=Pc;break;case Ehe:for(;c<32;){if(s===0)break e;s--,l+=i[a++]<<c,c+=8}e.adler=r.check=Mhe(l),l=0,c=0,r.mode=p2;case p2: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,Ynt;e.adler=r.check=1,r.mode=Pc;case Pc:if(t===Vnt||t===d2)break e;case fj:if(r.last){l>>>=c&7,c-=c&7,r.mode=dj;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=She;break;case 1:if(iat(r),r.mode=m2,t===d2){l>>>=2,c-=2;break e}break;case 2:r.mode=The;break;case 3:e.msg="invalid block type",r.mode=Ti}l>>>=2,c-=2;break;case She: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=Ti;break}if(r.length=l&65535,l=0,c=0,r.mode=hj,t===d2)break e;case hj:r.mode=Ahe;case Ahe:if(d=r.length,d){if(d>s&&(d=s),d>u&&(d=u),d===0)break e;Mo.arraySet(n,i,a,d,o),s-=d,a+=d,u-=d,o+=d,r.length-=d;break}r.mode=Pc;break;case The: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=Ti;break}r.have=0,r.mode=khe;case khe: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=U1(Wnt,r.lens,0,19,r.lencode,0,r.work,V),r.lenbits=V.bits,L){e.msg="invalid code lengths set",r.mode=Ti;break}r.have=0,r.mode=Rhe;case Rhe:for(;r.have<r.nlen+r.ndist;){for(;g=r.lencode[l&(1<<r.lenbits)-1],b=g>>>24,E=g>>>16&255,T=g&65535,!(b<=c);){if(s===0)break e;s--,l+=i[a++]<<c,c+=8}if(T<16)l>>>=b,c-=b,r.lens[r.have++]=T;else{if(T===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=Ti;break}C=r.lens[r.have-1],d=3+(l&3),l>>>=2,c-=2}else if(T===17){for(N=b+3;c<N;){if(s===0)break e;s--,l+=i[a++]<<c,c+=8}l>>>=b,c-=b,C=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,C=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=Ti;break}for(;d--;)r.lens[r.have++]=C}}if(r.mode===Ti)break;if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block",r.mode=Ti;break}if(r.lenbits=9,V={bits:r.lenbits},L=U1(lhe,r.lens,0,r.nlen,r.lencode,0,r.work,V),r.lenbits=V.bits,L){e.msg="invalid literal/lengths set",r.mode=Ti;break}if(r.distbits=6,r.distcode=r.distdyn,V={bits:r.distbits},L=U1(che,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,V),r.distbits=V.bits,L){e.msg="invalid distances set",r.mode=Ti;break}if(r.mode=m2,t===d2)break e;case m2:r.mode=g2;case g2: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,Hnt(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===Pc&&(r.back=-1);break}for(r.back=0;g=r.lencode[l&(1<<r.lenbits)-1],b=g>>>24,E=g>>>16&255,T=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,D=T;g=r.lencode[D+((l&(1<<k+R)-1)>>k)],b=g>>>24,E=g>>>16&255,T=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=T,E===0){r.mode=Bhe;break}if(E&32){r.back=-1,r.mode=Pc;break}if(E&64){e.msg="invalid literal/length code",r.mode=Ti;break}r.extra=E&15,r.mode=Che;case Che: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=Ihe;case Ihe:for(;g=r.distcode[l&(1<<r.distbits)-1],b=g>>>24,E=g>>>16&255,T=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,D=T;g=r.distcode[D+((l&(1<<k+R)-1)>>k)],b=g>>>24,E=g>>>16&255,T=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=Ti;break}r.offset=T,r.extra=E&15,r.mode=Phe;case Phe: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=Ti;break}r.mode=Ohe;case Ohe: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=Ti;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=g2);break;case Bhe:if(u===0)break e;n[o++]=r.length,u--,r.mode=g2;break;case dj: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?yl(r.check,n,h,o-h):lj(r.check,n,h,o-h)),h=u,(r.flags?l:Mhe(l))!==r.check){e.msg="incorrect data check",r.mode=Ti;break}l=0,c=0}r.mode=Dhe;case Dhe: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=Ti;break}l=0,c=0}r.mode=Fhe;case Fhe:L=Knt;break e;case Ti:L=hhe;break e;case pj:return cj;case Xnt:default:return As}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<Ti&&(r.mode<dj||t!==fhe))&&Ghe(e,e.output,e.next_out,h-e.avail_out)?(r.mode=pj,cj):(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?yl(r.check,n,h,e.next_out-h):lj(r.check,n,h,e.next_out-h)),e.data_type=r.bits+(r.last?64:0)+(r.mode===Pc?128:0)+(r.mode===m2||r.mode===hj?256:0),(f===0&&h===0||t===fhe)&&L===dp&&(L=$nt),L)}function aat(e){if(!e||!e.state)return As;var t=e.state;return t.window&&(t.window=null),e.state=null,dp}function oat(e,t){var r;return!e||!e.state||(r=e.state,(r.wrap&2)==0)?As:(r.head=t,t.done=!1,dp)}function sat(e,t){var r=t.length,i,n,a;return!e||!e.state||(i=e.state,i.wrap!==0&&i.mode!==p2)?As:i.mode===p2&&(n=1,n=lj(n,t,r,0),n!==i.check)?hhe:(a=Ghe(e,t,r,r),a?(i.mode=pj,cj):(i.havedict=1,dp))}hu.inflateReset=Lhe;hu.inflateReset2=Nhe;hu.inflateResetKeep=jhe;hu.inflateInit=rat;hu.inflateInit2=qhe;hu.inflate=nat;hu.inflateEnd=aat;hu.inflateGetHeader=oat;hu.inflateSetDictionary=sat;hu.inflateInfo="pako inflate (from Nodeca project)"});var vj=A((MCt,Hhe)=>{"use strict";Hhe.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 Vhe=A((jCt,Whe)=>{"use strict";function uat(){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}Whe.exports=uat});var Yhe=A(z1=>{"use strict";var g0=zhe(),G1=Rc(),v2=rj(),cn=vj(),yj=n2(),lat=ij(),cat=Vhe(),Khe=Object.prototype.toString;function pp(e){if(!(this instanceof pp))return new pp(e);this.options=G1.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 lat,this.strm.avail_out=0;var r=g0.inflateInit2(this.strm,t.windowBits);if(r!==cn.Z_OK)throw new Error(yj[r]);if(this.header=new cat,g0.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=v2.string2buf(t.dictionary):Khe.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=g0.inflateSetDictionary(this.strm,t.dictionary),r!==cn.Z_OK)))throw new Error(yj[r])}pp.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?cn.Z_FINISH:cn.Z_NO_FLUSH,typeof e=="string"?r.input=v2.binstring2buf(e):Khe.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 G1.Buf8(i),r.next_out=0,r.avail_out=i),a=g0.inflate(r,cn.Z_NO_FLUSH),a===cn.Z_NEED_DICT&&n&&(a=g0.inflateSetDictionary(this.strm,n)),a===cn.Z_BUF_ERROR&&c===!0&&(a=cn.Z_OK,c=!1),a!==cn.Z_STREAM_END&&a!==cn.Z_OK)return this.onEnd(a),this.ended=!0,!1;r.next_out&&(r.avail_out===0||a===cn.Z_STREAM_END||r.avail_in===0&&(o===cn.Z_FINISH||o===cn.Z_SYNC_FLUSH))&&(this.options.to==="string"?(s=v2.utf8border(r.output,r.next_out),u=r.next_out-s,l=v2.buf2string(r.output,s),r.next_out=u,r.avail_out=i-u,u&&G1.arraySet(r.output,r.output,s,u,0),this.onData(l)):this.onData(G1.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!==cn.Z_STREAM_END);return a===cn.Z_STREAM_END&&(o=cn.Z_FINISH),o===cn.Z_FINISH?(a=g0.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===cn.Z_OK):(o===cn.Z_SYNC_FLUSH&&(this.onEnd(cn.Z_OK),r.avail_out=0),!0)};pp.prototype.onData=function(e){this.chunks.push(e)};pp.prototype.onEnd=function(e){e===cn.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=G1.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function bj(e,t){var r=new pp(t);if(r.push(e,!0),r.err)throw r.msg||yj[r.err];return r.result}function fat(e,t){return t=t||{},t.raw=!0,bj(e,t)}z1.Inflate=pp;z1.inflate=bj;z1.inflateRaw=fat;z1.ungzip=bj});var Jhe=A((NCt,Xhe)=>{"use strict";var hat=Rc().assign,dat=Zfe(),pat=Yhe(),mat=vj(),$he={};hat($he,dat,pat,mat);Xhe.exports=$he});var Zhe=A(b2=>{"use strict";var gat=typeof Uint8Array!="undefined"&&typeof Uint16Array!="undefined"&&typeof Uint32Array!="undefined",vat=Jhe(),Qhe=ji(),y2=Fo(),yat=gat?"uint8array":"array";b2.magic="\b\0";function mp(e,t){y2.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}Qhe.inherits(mp,y2);mp.prototype.processChunk=function(e){this.meta=e.meta,this._pako===null&&this._createPako(),this._pako.push(Qhe.transformTo(yat,e.data),!1)};mp.prototype.flush=function(){y2.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)};mp.prototype.cleanUp=function(){y2.prototype.cleanUp.call(this),this._pako=null};mp.prototype._createPako=function(){this._pako=new vat[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}};b2.compressWorker=function(e){return new mp("Deflate",e)};b2.uncompressWorker=function(){return new mp("Inflate",{})}});var xj=A(_j=>{"use strict";var ede=Fo();_j.STORE={magic:"\0\0",compressWorker:function(){return new ede("STORE compression")},uncompressWorker:function(){return new ede("STORE decompression")}};_j.DEFLATE=Zhe()});var wj=A(gp=>{"use strict";gp.LOCAL_FILE_HEADER="PK";gp.CENTRAL_FILE_HEADER="PK";gp.CENTRAL_DIRECTORY_END="PK";gp.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07";gp.ZIP64_CENTRAL_DIRECTORY_END="PK";gp.DATA_DESCRIPTOR="PK\x07\b"});var nde=A((zCt,ide)=>{"use strict";var v0=ji(),y0=Fo(),Ej=a0(),tde=ZT(),_2=wj(),wi=function(e,t){var r="",i;for(i=0;i<t;i++)r+=String.fromCharCode(e&255),e=e>>>8;return r},bat=function(e,t){var r=e;return e||(r=t?16893:33204),(r&65535)<<16},_at=function(e){return(e||0)&63},rde=function(e,t,r,i,n,a){var o=e.file,s=e.compression,u=a!==Ej.utf8encode,l=v0.transformTo("string",a(o.name)),c=v0.transformTo("string",Ej.utf8encode(o.name)),f=o.comment,h=v0.transformTo("string",a(f)),d=v0.transformTo("string",Ej.utf8encode(f)),p=c.length!==o.name.length,y=d.length!==f.length,g,b,E="",T="",k="",R=o.dir,D=o.date,C={crc32:0,compressedSize:0,uncompressedSize:0};(!t||r)&&(C.crc32=e.crc32,C.compressedSize=e.compressedSize,C.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|=bat(o.unixPermissions,R)):(V=20,B|=_at(o.dosPermissions,R)),g=D.getUTCHours(),g=g<<6,g=g|D.getUTCMinutes(),g=g<<5,g=g|D.getUTCSeconds()/2,b=D.getUTCFullYear()-1980,b=b<<4,b=b|D.getUTCMonth()+1,b=b<<5,b=b|D.getUTCDate(),p&&(T=wi(1,1)+wi(tde(l),4)+c,E+="up"+wi(T.length,2)+T),y&&(k=wi(1,1)+wi(tde(h),4)+d,E+="uc"+wi(k.length,2)+k);var N="";N+=`
|
|
116
116
|
\0`,N+=wi(L,2),N+=s.magic,N+=wi(g,2),N+=wi(b,2),N+=wi(C.crc32,4),N+=wi(C.compressedSize,4),N+=wi(C.uncompressedSize,4),N+=wi(l.length,2),N+=wi(E.length,2);var z=_2.LOCAL_FILE_HEADER+N+l+E,j=_2.CENTRAL_FILE_HEADER+wi(V,2)+N+wi(h.length,2)+"\0\0\0\0"+wi(B,4)+wi(i,4)+l+E+h;return{fileRecord:z,dirRecord:j}},xat=function(e,t,r,i,n){var a="",o=v0.transformTo("string",n(i));return a=_2.CENTRAL_DIRECTORY_END+"\0\0\0\0"+wi(e,2)+wi(e,2)+wi(t,4)+wi(r,4)+wi(o.length,2)+o,a},wat=function(e){var t="";return t=_2.DATA_DESCRIPTOR+wi(e.crc32,4)+wi(e.compressedSize,4)+wi(e.uncompressedSize,4),t};function du(e,t,r,i){y0.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=[]}v0.inherits(du,y0);du.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,y0.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:r?(t+100*(r-i-1))/r:100}}))};du.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var r=rde(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0};du.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,r=rde(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),t)this.push({data:wat(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};du.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=xat(this.dirRecords.length,r,e,this.zipComment,this.encodeFileName);this.push({data:i,meta:{percent:100}})};du.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()};du.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};du.prototype.resume=function(){if(!y0.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};du.prototype.error=function(e){var t=this._sources;if(!y0.prototype.error.call(this,e))return!1;for(var r=0;r<t.length;r++)try{t[r].error(e)}catch{}return!0};du.prototype.lock=function(){y0.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()};ide.exports=du});var ode=A(ade=>{"use strict";var Eat=xj(),Sat=nde(),Aat=function(e,t){var r=e||t,i=Eat[r];if(!i)throw new Error(r+" is not a valid compression method !");return i};ade.generateWorker=function(e,t,r){var i=new Sat(t.streamFiles,r,t.platform,t.encodeFileName),n=0;try{e.forEach(function(a,o){n++;var s=Aat(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 ude=A((WCt,sde)=>{"use strict";var Tat=ji(),x2=Fo();function H1(e,t){x2.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=!1,this._bindStream(t)}Tat.inherits(H1,x2);H1.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()})};H1.prototype.pause=function(){return x2.prototype.pause.call(this)?(this._stream.pause(),!0):!1};H1.prototype.resume=function(){return x2.prototype.resume.call(this)?(this._upstreamEnded?this.end():this._stream.resume(),!0):!1};sde.exports=H1});var yde=A((VCt,vde)=>{"use strict";var kat=a0(),W1=ji(),lde=Fo(),Rat=R6(),cde=C6(),fde=e2(),Cat=cfe(),Iat=ode(),hde=_1(),Pat=ude(),dde=function(e,t,r){var i=W1.getTypeOf(t),n,a=W1.extend(r||{},cde);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=pde(e)),a.createFolders&&(n=Oat(e))&&mde.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 fde&&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 fde||t instanceof lde?u=t:hde.isNode&&hde.isStream(t)?u=new Pat(e,t):u=W1.prepareContent(e,t,a.binary,a.optimizedBinaryString,a.base64);var l=new Cat(e,u,a);this.files[e]=l},Oat=function(e){e.slice(-1)==="/"&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return t>0?e.substring(0,t):""},pde=function(e){return e.slice(-1)!=="/"&&(e+="/"),e},mde=function(e,t){return t=typeof t!="undefined"?t:cde.createFolders,e=pde(e),this.files[e]||dde.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function gde(e){return Object.prototype.toString.call(e)==="[object RegExp]"}var Bat={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(gde(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,dde.call(this,e,t,r);return this},folder:function(e){if(!e)return this;if(gde(e))return this.filter(function(n,a){return a.dir&&e.test(n)});var t=this.root+e,r=mde.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=W1.extend(e||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:kat.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.");W1.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=Iat.generateWorker(this,r,i)}catch(n){t=new lde("error"),t.error(n)}return new Rat(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)}};vde.exports=Bat});var Sj=A((KCt,_de)=>{"use strict";var Dat=ji();function bde(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}bde.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 Dat.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))}};_de.exports=bde});var Aj=A((YCt,wde)=>{"use strict";var xde=Sj(),Fat=ji();function b0(e){xde.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=e[t]&255}Fat.inherits(b0,xde);b0.prototype.byteAt=function(e){return this.data[this.zero+e]};b0.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};b0.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]};b0.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};wde.exports=b0});var Ade=A(($Ct,Sde)=>{"use strict";var Ede=Sj(),Mat=ji();function _0(e){Ede.call(this,e)}Mat.inherits(_0,Ede);_0.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)};_0.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero};_0.prototype.readAndCheckSignature=function(e){var t=this.readData(4);return e===t};_0.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};Sde.exports=_0});var kj=A((XCt,kde)=>{"use strict";var Tde=Aj(),jat=ji();function Tj(e){Tde.call(this,e)}jat.inherits(Tj,Tde);Tj.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};kde.exports=Tj});var Ide=A((JCt,Cde)=>{"use strict";var Rde=kj(),Lat=ji();function Rj(e){Rde.call(this,e)}Lat.inherits(Rj,Rde);Rj.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};Cde.exports=Rj});var Cj=A((QCt,Ode)=>{"use strict";var w2=ji(),Pde=Tc(),Nat=Aj(),qat=Ade(),Uat=Ide(),Gat=kj();Ode.exports=function(e){var t=w2.getTypeOf(e);return w2.checkSupport(t),t==="string"&&!Pde.uint8array?new qat(e):t==="nodebuffer"?new Uat(e):Pde.uint8array?new Gat(w2.transformTo("uint8array",e)):new Nat(w2.transformTo("array",e))}});var Mde=A((ZCt,Fde)=>{"use strict";var Ij=Cj(),Ph=ji(),zat=e2(),Bde=ZT(),E2=a0(),S2=xj(),Hat=Tc(),Wat=0,Vat=3,Kat=function(e){for(var t in S2)if(!!Object.prototype.hasOwnProperty.call(S2,t)&&S2[t].magic===e)return S2[t];return null};function Dde(e,t){this.options=e,this.loadOptions=t}Dde.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=Kat(this.compressionMethod),t===null)throw new Error("Corrupted zip : compression "+Ph.pretty(this.compressionMethod)+" unknown (inner file : "+Ph.transformTo("string",this.fileName)+")");this.decompressed=new zat(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===Wat&&(this.dosPermissions=this.externalFileAttributes&63),e===Vat&&(this.unixPermissions=this.externalFileAttributes>>16&65535),!this.dir&&this.fileNameStr.slice(-1)==="/"&&(this.dir=!0)},parseZIP64ExtraField:function(){if(!!this.extraFields[1]){var e=Ij(this.extraFields[1].value);this.uncompressedSize===Ph.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===Ph.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===Ph.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===Ph.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=Hat.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=E2.utf8decode(this.fileName),this.fileCommentStr=E2.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(t!==null)this.fileNameStr=t;else{var r=Ph.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(r)}var i=this.findExtraFieldUnicodeComment();if(i!==null)this.fileCommentStr=i;else{var n=Ph.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(n)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=Ij(e.value);return t.readInt(1)!==1||Bde(this.fileName)!==t.readInt(4)?null:E2.utf8decode(t.readData(e.length-5))}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=Ij(e.value);return t.readInt(1)!==1||Bde(this.fileComment)!==t.readInt(4)?null:E2.utf8decode(t.readData(e.length-5))}return null}};Fde.exports=Dde});var Nde=A((eIt,Lde)=>{"use strict";var Yat=Cj(),Oc=ji(),pu=wj(),$at=Mde(),Xat=Tc();function jde(e){this.files=[],this.loadOptions=e}jde.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 ("+Oc.pretty(t)+", expected "+Oc.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=Xat.uint8array?"uint8array":"array",r=Oc.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(pu.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(pu.CENTRAL_FILE_HEADER);)e=new $at({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(pu.CENTRAL_DIRECTORY_END);if(e<0){var t=!this.isSignature(0,pu.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(pu.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===Oc.MAX_VALUE_16BITS||this.diskWithCentralDirStart===Oc.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===Oc.MAX_VALUE_16BITS||this.centralDirRecords===Oc.MAX_VALUE_16BITS||this.centralDirSize===Oc.MAX_VALUE_32BITS||this.centralDirOffset===Oc.MAX_VALUE_32BITS){if(this.zip64=!0,e=this.reader.lastIndexOfSignature(pu.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(pu.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,pu.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(pu.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(pu.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,pu.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=Yat(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}};Lde.exports=jde});var Gde=A((tIt,Ude)=>{"use strict";var Pj=ji(),A2=r0(),Jat=a0(),Qat=Nde(),Zat=O6(),qde=_1();function eot(e){return new A2.Promise(function(t,r){var i=e.decompressed.getContentWorker().pipe(new Zat);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()})}Ude.exports=function(e,t){var r=this;return t=Pj.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:Jat.utf8decode}),qde.isNode&&qde.isStream(e)?A2.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):Pj.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then(function(i){var n=new Qat(t);return n.load(i),n}).then(function(n){var a=[A2.Promise.resolve(n)],o=n.files;if(t.checkCRC32)for(var s=0;s<o.length;s++)a.push(eot(o[s]));return A2.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=Pj.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 Oj=A((rIt,zde)=>{"use strict";function Ts(){if(!(this instanceof Ts))return new Ts;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 Ts;for(var t in this)typeof this[t]!="function"&&(e[t]=this[t]);return e}}Ts.prototype=yde();Ts.prototype.loadAsync=Gde();Ts.support=Tc();Ts.defaults=C6();Ts.version="3.10.1";Ts.loadAsync=function(e,t){return new Ts().loadAsync(e,t)};Ts.external=r0();zde.exports=Ts});var Cpe=A((qIt,Dc)=>{var dst=za().default;function Rpe(){"use strict";Dc.exports=Rpe=function(){return e},Dc.exports.__esModule=!0,Dc.exports.default=Dc.exports;var e={},t=Object.prototype,r=t.hasOwnProperty,i=Object.defineProperty||function(z,j,H){z[j]=H.value},n=typeof Symbol=="function"?Symbol:{},a=n.iterator||"@@iterator",o=n.asyncIterator||"@@asyncIterator",s=n.toStringTag||"@@toStringTag";function u(z,j,H){return Object.defineProperty(z,j,{value:H,enumerable:!0,configurable:!0,writable:!0}),z[j]}try{u({},"")}catch{u=function(H,$,te){return H[$]=te}}function l(z,j,H,$){var te=j&&j.prototype instanceof h?j:h,re=Object.create(te.prototype),ne=new B($||[]);return i(re,"_invoke",{value:R(z,H,ne)}),re}function c(z,j,H){try{return{type:"normal",arg:z.call(j,H)}}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 T(z){["next","throw","return"].forEach(function(j){u(z,j,function(H){return this._invoke(j,H)})})}function k(z,j){function H(te,re,ne,ue){var pe=c(z[te],z,re);if(pe.type!=="throw"){var Le=pe.arg,Be=Le.value;return Be&&dst(Be)=="object"&&r.call(Be,"__await")?j.resolve(Be.__await).then(function(qe){H("next",qe,ne,ue)},function(qe){H("throw",qe,ne,ue)}):j.resolve(Be).then(function(qe){Le.value=qe,ne(Le)},function(qe){return H("throw",qe,ne,ue)})}ue(pe.arg)}var $;i(this,"_invoke",{value:function(re,ne){function ue(){return new j(function(pe,Le){H(re,ne,pe,Le)})}return $=$?$.then(ue,ue):ue()}})}function R(z,j,H){var $="suspendedStart";return function(te,re){if($==="executing")throw new Error("Generator is already running");if($==="completed"){if(te==="throw")throw re;return N()}for(H.method=te,H.arg=re;;){var ne=H.delegate;if(ne){var ue=D(ne,H);if(ue){if(ue===f)continue;return ue}}if(H.method==="next")H.sent=H._sent=H.arg;else if(H.method==="throw"){if($==="suspendedStart")throw $="completed",H.arg;H.dispatchException(H.arg)}else H.method==="return"&&H.abrupt("return",H.arg);$="executing";var pe=c(z,j,H);if(pe.type==="normal"){if($=H.done?"completed":"suspendedYield",pe.arg===f)continue;return{value:pe.arg,done:H.done}}pe.type==="throw"&&($="completed",H.method="throw",H.arg=pe.arg)}}}function D(z,j){var H=j.method,$=z.iterator[H];if($===void 0)return j.delegate=null,H==="throw"&&z.iterator.return&&(j.method="return",j.arg=void 0,D(z,j),j.method==="throw")||H!=="return"&&(j.method="throw",j.arg=new TypeError("The iterator does not provide a '"+H+"' method")),f;var te=c($,z.iterator,j.arg);if(te.type==="throw")return j.method="throw",j.arg=te.arg,j.delegate=null,f;var re=te.arg;return re?re.done?(j[z.resultName]=re.value,j.next=z.nextLoc,j.method!=="return"&&(j.method="next",j.arg=void 0),j.delegate=null,f):re:(j.method="throw",j.arg=new TypeError("iterator result is not an object"),j.delegate=null,f)}function C(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(C,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 H=-1,$=function te(){for(;++H<z.length;)if(r.call(z,H))return te.value=z[H],te.done=!1,te;return te.value=void 0,te.done=!0,te};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}},T(k.prototype),u(k.prototype,o,function(){return this}),e.AsyncIterator=k,e.async=function(z,j,H,$,te){te===void 0&&(te=Promise);var re=new k(l(z,j,H,$),te);return e.isGeneratorFunction(j)?re:re.next().then(function(ne){return ne.done?ne.value:re.next()})},T(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),H=[];for(var $ in j)H.push($);return H.reverse(),function te(){for(;H.length;){var re=H.pop();if(re in j)return te.value=re,te.done=!1,te}return te.done=!0,te}},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 H in this)H.charAt(0)==="t"&&r.call(this,H)&&!isNaN(+H.slice(1))&&(this[H]=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 H=this;function $(Le,Be){return ne.type="throw",ne.arg=j,H.next=Le,Be&&(H.method="next",H.arg=void 0),!!Be}for(var te=this.tryEntries.length-1;te>=0;--te){var re=this.tryEntries[te],ne=re.completion;if(re.tryLoc==="root")return $("end");if(re.tryLoc<=this.prev){var ue=r.call(re,"catchLoc"),pe=r.call(re,"finallyLoc");if(ue&&pe){if(this.prev<re.catchLoc)return $(re.catchLoc,!0);if(this.prev<re.finallyLoc)return $(re.finallyLoc)}else if(ue){if(this.prev<re.catchLoc)return $(re.catchLoc,!0)}else{if(!pe)throw new Error("try statement without catch or finally");if(this.prev<re.finallyLoc)return $(re.finallyLoc)}}}},abrupt:function(j,H){for(var $=this.tryEntries.length-1;$>=0;--$){var te=this.tryEntries[$];if(te.tryLoc<=this.prev&&r.call(te,"finallyLoc")&&this.prev<te.finallyLoc){var re=te;break}}re&&(j==="break"||j==="continue")&&re.tryLoc<=H&&H<=re.finallyLoc&&(re=null);var ne=re?re.completion:{};return ne.type=j,ne.arg=H,re?(this.method="next",this.next=re.finallyLoc,f):this.complete(ne)},complete:function(j,H){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"&&H&&(this.next=H),f},finish:function(j){for(var H=this.tryEntries.length-1;H>=0;--H){var $=this.tryEntries[H];if($.finallyLoc===j)return this.complete($.completion,$.afterLoc),L($),f}},catch:function(j){for(var H=this.tryEntries.length-1;H>=0;--H){var $=this.tryEntries[H];if($.tryLoc===j){var te=$.completion;if(te.type==="throw"){var re=te.arg;L($)}return re}}throw new Error("illegal catch attempt")},delegateYield:function(j,H,$){return this.delegate={iterator:V(j),resultName:H,nextLoc:$},this.method==="next"&&(this.arg=void 0),f}},e}Dc.exports=Rpe,Dc.exports.__esModule=!0,Dc.exports.default=Dc.exports});var Ppe=A((UIt,Ipe)=>{var O2=Cpe()();Ipe.exports=O2;try{regeneratorRuntime=O2}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=O2:Function("r","regeneratorRuntime = r")(O2)}});var Hj=A(B2=>{"use strict";var Gj=ti();Object.defineProperty(B2,"__esModule",{value:!0});B2.default=void 0;var pst=Gj(Wi()),mst=Gj(Vi()),Bh=Gj(ns()),gst=240,vst=[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],yst=372,bst=[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],_st=372,xst=[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],wst=12,zj=(3+1)*(3+2)/2,Est=2,Sst=function(){function e(t){(0,pst.default)(this,e),(0,Bh.default)(this,"_v00",0),(0,Bh.default)(this,"_v01",0),(0,Bh.default)(this,"_v10",0),(0,Bh.default)(this,"_v11",0),(0,Bh.default)(this,"_t",[]),(0,Bh.default)(this,"_ix",void 0),(0,Bh.default)(this,"_iy",void 0),(0,Bh.default)(this,"options",void 0),this.options=t,this._ix=this.options._width,this._iy=this.options._height}return(0,mst.default)(e,[{key:"getHeight",value:function(r,i){if(r=Math.abs(r)>90?NaN:r,isNaN(r)||isNaN(i))return NaN;var n=Ast(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(zj);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=bst;u!==0&&(y=u===this.options._height-2?xst:vst);var g=yst;u!==0&&(g=u===this.options._height-2?_st:gst);for(var b=0;b<zj;++b){d[b]=0;for(var E=0;E<wst;++E)d[b]+=p[E]*y[zj*E+b];d[b]/=g}}if(!this.options.cubic){var T=(1-a)*l+a*c,k=(1-a)*f+a*h,R=(1-o)*T+o*k,D=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,D}var C=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 C=this.options._offset+this.options._scale*C,this._ix=s,this._iy=u,this._t=d,C}},{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+Est*(i*this.options._swidth+r),a=this.options.data[n],o=this.options.data[n+1],s=a<<8|o;return s}}]),e}();B2.default=Sst;function Ast(e,t){t=Math.abs(t);var r=Ope(e,t);return 2*Math.abs(r)===t?r-=Ope(e,2*t)-r:2*Math.abs(r)>t&&(r+=r<0?t:-t),r}function Ope(e,t){return e-Math.floor(e/t)*t}});var Lpe=A(Wj=>{"use strict";var Bpe=ti();Object.defineProperty(Wj,"__esModule",{value:!0});Wj.parsePGM=Ost;var Dpe=Bpe(Ppe()),Tst=Bpe(Hj());function kst(e,t){var r=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Rst(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.
|
|
117
|
-
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 Rst(e,t){if(!!e){if(typeof e=="string")return Fpe(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 Fpe(e,t)}}function Fpe(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 Cst=Dpe.default.mark(Mpe),Ist=10,Pst=65535;function Ost(e,t){var r=Mpe(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 T=p.split(" ");if(T=T.filter(function(C){return C!==""}),c=parseInt(T[0],10),f=parseInt(T[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!==Pst)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,D=(f-1)/180;return new Tst.default({cubic:t.cubic,_width:c,_height:f,_rlonres:R,_rlatres:D,_offset:n,_scale:a,_swidth:d,_datastart:h,_maxerror:o,_rmserror:s,_description:u,_datetime:l,data:e})}function Mpe(e){var t,r,i,n;return Dpe.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:t=0;case 1:if(r=e.indexOf(Ist,t),r===-1){o.next=9;break}return i=e.subarray(t,r),t=r+1,o.next=7,{offset:t,line:jpe(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:jpe(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()}},Cst)}function jpe(e){var t="",r=kst(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 Npe=A(D2=>{"use strict";var Bst=ti();Object.defineProperty(D2,"__esModule",{value:!0});Object.defineProperty(D2,"parsePGM",{enumerable:!0,get:function(){return Dst.parsePGM}});Object.defineProperty(D2,"Geoid",{enumerable:!0,get:function(){return Fst.default}});var Dst=Lpe(),Fst=Bst(Hj())});var rme=A(N2=>{"use strict";Object.defineProperty(N2,"__esModule",{value:!0});N2.default=void 0;var hut={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};N2.default=hut});var wu=typeof process!="object"||String(process)!=="[object process]"||process.browser,Z2={self:typeof self!="undefined"&&self,window:typeof window!="undefined"&&window,global:typeof global!="undefined"&&global},mn=Z2.global||Z2.self||Z2.window;var jL={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"]=jL||{};function er(e,t,r){return t<=e&&e<=r}function yge(e,t){return e.indexOf(t)!==-1}var kl=Math.floor;function b_(e){if(e===void 0)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function bge(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 _ge(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 qo(e){return 0<=e&&e<=127}var Uo=qo,Rr=-1;function ek(e){this.tokens=[].slice.call(e),this.tokens.reverse()}ek.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 hi=-1;function Cr(e,t){if(e)throw TypeError("Decoder error");return t||65533}function Ps(e){throw TypeError("The code point "+e+" could not be encoded.")}function xge(){}xge.prototype={handler:function(e,t){}};function wge(){}wge.prototype={handler:function(e,t){}};function tk(e){return e=String(e).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(rk,e)?rk[e]:null}var LL=[{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"}],rk={};LL.forEach(function(e){e.encodings.forEach(function(t){t.labels.forEach(function(r){rk[r]=t})})});var Qa={},Za={};function Cp(e,t){return t&&t[e]||null}function Ip(e,t){var r=t.indexOf(e);return r===-1?null:r}function Ma(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 Ege(e){if(e>39419&&e<189e3||e>1237575)return null;if(e===7457)return 59335;var t=0,r=0,i=Ma("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 Sge(e){if(e===59335)return 7457;var t=0,r=0,i=Ma("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 Age(e){ik=ik||Ma("jis0208").map(function(r,i){return er(i,8272,8835)?null:r});var t=ik;return t.indexOf(e)}var ik;function Tge(e){nk=nk||Ma("big5").map(function(r,i){return i<(161-129)*157?null:r});var t=nk;return e===9552||e===9566||e===9569||e===9578||e===21313||e===21317?t.lastIndexOf(e):Ip(e,t)}var nk,NL="utf-8";function Nh(e,t){if(!(this instanceof Nh))throw TypeError("Called as a function. Did you forget 'new'?");e=e!==void 0?String(e):NL,t=b_(t),this._encoding=null,this._decoder=null,this._ignoreBOM=!1,this._BOMseen=!1,this._error_mode="replacement",this._do_not_flush=!1;var r=tk(e);if(r===null||r.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!Za[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(Nh.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(Nh.prototype,"fatal",{get:function(){return this._error_mode==="fatal"}}),Object.defineProperty(Nh.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}}));Nh.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=b_(r),this._do_not_flush||(this._decoder=Za[this._encoding.name]({fatal:this._error_mode==="fatal"}),this._BOMseen=!1),this._do_not_flush=Boolean(r.stream);for(var n=new ek(i),a=[],o;;){var s=n.read();if(s===Rr||(o=this._decoder.handler(n,s),o===hi))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===hi)break;o!==null&&(Array.isArray(o)?a.push.apply(a,o):a.push(o))}while(!n.endOfStream());this._decoder=null}function u(l){return yge(["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)),_ge(l)}return u.call(this,a)};function z0(e,t){if(!(this instanceof z0))throw TypeError("Called as a function. Did you forget 'new'?");t=b_(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):NL;var i=tk(e);if(i===null||i.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!Qa[i.name])throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");r._encoding=i}else r._encoding=tk("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(z0.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}});z0.prototype.encode=function(t,r){t=t===void 0?"":String(t),r=b_(r),this._do_not_flush||(this._encoder=Qa[this._encoding.name]({fatal:this._fatal==="fatal"})),this._do_not_flush=Boolean(r.stream);for(var i=new ek(bge(t)),n=[],a;;){var o=i.read();if(o===Rr||(a=this._encoder.handler(i,o),a===hi))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!==hi;)Array.isArray(a)?n.push.apply(n,a):n.push(a);this._encoder=null}return new Uint8Array(n)};function kge(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 hi;if(n===0){if(er(u,0,127))return u;if(er(u,194,223))n=1,r=u&31;else if(er(u,224,239))u===224&&(a=160),u===237&&(o=159),n=2,r=u&15;else if(er(u,240,244))u===240&&(a=144),u===244&&(o=143),n=3,r=u&7;else return Cr(t);return null}if(!er(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 Rge(e){var t=e.fatal;this.handler=function(r,i){if(i===Rr)return hi;if(Uo(i))return i;var n,a;er(i,128,2047)?(n=1,a=192):er(i,2048,65535)?(n=2,a=224):er(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}}Qa["UTF-8"]=function(e){return new Rge(e)};Za["UTF-8"]=function(e){return new kge(e)};function Cge(e,t){var r=t.fatal;this.handler=function(i,n){if(n===Rr)return hi;if(qo(n))return n;var a=e[n-128];return a===null?Cr(r):a}}function Ige(e,t){var r=t.fatal;this.handler=function(i,n){if(n===Rr)return hi;if(Uo(n))return n;var a=Ip(n,e);return a===null&&Ps(n),a+128}}(function(){"encoding-indexes"in global&&LL.forEach(function(e){e.heading==="Legacy single-byte encodings"&&e.encodings.forEach(function(t){var r=t.name,i=Ma(r.toLowerCase());Za[r]=function(n){return new Cge(i,n)},Qa[r]=function(n){return new Ige(i,n)}})})})();Za.GBK=function(e){return new qL(e)};Qa.GBK=function(e){return new UL(e,!0)};function qL(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 hi;o===Rr&&(r!==0||i!==0||n!==0)&&(r=0,i=0,n=0,Cr(t));var s;if(n!==0){s=null,er(o,48,57)&&(s=Ege((((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 er(o,129,254)?(n=o,null):(a.prepend([i,o]),r=0,i=0,Cr(t));if(r!==0){if(er(o,48,57))return i=o,null;var l=r,c=null;r=0;var f=o<127?64:65;return(er(o,64,126)||er(o,128,254))&&(c=(l-129)*190+(o-f)),s=c===null?null:Cp(c,Ma("gb18030")),s===null&&qo(o)&&a.prepend(o),s===null?Cr(t):s}return qo(o)?o:o===128?8364:er(o,129,254)?(r=o,null):Cr(t)}}function UL(e,t){var r=e.fatal;this.handler=function(i,n){if(n===Rr)return hi;if(Uo(n))return n;if(n===58853)return Ps(n);if(t&&n===8364)return 128;var a=Ip(n,Ma("gb18030"));if(a!==null){var o=kl(a/190)+129,s=a%190,u=s<63?64:65;return[o,s+u]}if(t)return Ps(n);a=Sge(n);var l=kl(a/10/126/10);a=a-l*10*126*10;var c=kl(a/10/126);a=a-c*10*126;var f=kl(a/10),h=a-f*10;return[l+129,c+48,f+129,h+48]}}Qa.gb18030=function(e){return new UL(e)};Za.gb18030=function(e){return new qL(e)};function Pge(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 hi;if(r!==0){var a=r,o=null;r=0;var s=n<127?64:98;switch((er(n,64,126)||er(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:Cp(o,Ma("big5"));return u===null&&qo(n)&&i.prepend(n),u===null?Cr(t):u}return qo(n)?n:er(n,129,254)?(r=n,null):Cr(t)}}function Oge(e){var t=e.fatal;this.handler=function(r,i){if(i===Rr)return hi;if(Uo(i))return i;var n=Tge(i);if(n===null)return Ps(i);var a=kl(n/157)+129;if(a<161)return Ps(i);var o=n%157,s=o<63?64:98;return[a,o+s]}}Qa.Big5=function(e){return new Oge(e)};Za.Big5=function(e){return new Pge(e)};function Bge(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 hi;if(i===142&&er(a,161,223))return i=0,65377-161+a;if(i===143&&er(a,161,254))return r=!0,i=a,null;if(i!==0){var o=i;i=0;var s=null;return er(o,161,254)&&er(a,161,254)&&(s=Cp((o-161)*94+(a-161),Ma(r?"jis0212":"jis0208"))),r=!1,er(a,161,254)||n.prepend(a),s===null?Cr(t):s}return qo(a)?a:a===142||a===143||er(a,161,254)?(i=a,null):Cr(t)}}function Dge(e){var t=e.fatal;this.handler=function(r,i){if(i===Rr)return hi;if(Uo(i))return i;if(i===165)return 92;if(i===8254)return 126;if(er(i,65377,65439))return[142,i-65377+161];i===8722&&(i=65293);var n=Ip(i,Ma("jis0208"));if(n===null)return Ps(i);var a=kl(n/94)+161,o=n%94+161;return[a,o]}}Qa["EUC-JP"]=function(e){return new Dge(e)};Za["EUC-JP"]=function(e){return new Bge(e)};function Fge(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):er(u,0,127)&&u!==14&&u!==15&&u!==27?(o=!1,u):u===Rr?hi:(o=!1,Cr(t));case r.Roman:return u===27?(i=r.EscapeStart,null):u===92?(o=!1,165):u===126?(o=!1,8254):er(u,0,127)&&u!==14&&u!==15&&u!==27&&u!==92&&u!==126?(o=!1,u):u===Rr?hi:(o=!1,Cr(t));case r.Katakana:return u===27?(i=r.EscapeStart,null):er(u,33,95)?(o=!1,65377-33+u):u===Rr?hi:(o=!1,Cr(t));case r.LeadByte:return u===27?(i=r.EscapeStart,null):er(u,33,126)?(o=!1,a=u,i=r.TrailByte,null):u===Rr?hi:(o=!1,Cr(t));case r.TrailByte:if(u===27)return i=r.EscapeStart,Cr(t);if(er(u,33,126)){i=r.LeadByte;var l=(a-33)*94+u-33,c=Cp(l,Ma("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 Mge(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 hi;if((i===r.ASCII||i===r.Roman)&&(a===14||a===15||a===27))return Ps(65533);if(i===r.ASCII&&Uo(a))return a;if(i===r.Roman&&(Uo(a)&&a!==92&&a!==126||a==165||a==8254)){if(Uo(a))return a;if(a===165)return 92;if(a===8254)return 126}if(Uo(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=Ip(a,Ma("jis0208"));if(o===null)return Ps(a);if(i!==r.jis0208)return n.prepend(a),i=r.jis0208,[27,36,66];var s=kl(o/94)+33,u=o%94+33;return[s,u]}}Qa["ISO-2022-JP"]=function(e){return new Mge(e)};Za["ISO-2022-JP"]=function(e){return new Fge(e)};function jge(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 hi;if(r!==0){var a=r,o=null;r=0;var s=n<127?64:65,u=a<160?129:193;if((er(n,64,126)||er(n,128,252))&&(o=(a-u)*188+n-s),er(o,8836,10715))return 57344-8836+o;var l=o===null?null:Cp(o,Ma("jis0208"));return l===null&&qo(n)&&i.prepend(n),l===null?Cr(t):l}return qo(n)||n===128?n:er(n,161,223)?65377-161+n:er(n,129,159)||er(n,224,252)?(r=n,null):Cr(t)}}function Lge(e){var t=e.fatal;this.handler=function(r,i){if(i===Rr)return hi;if(Uo(i)||i===128)return i;if(i===165)return 92;if(i===8254)return 126;if(er(i,65377,65439))return i-65377+161;i===8722&&(i=65293);var n=Age(i);if(n===null)return Ps(i);var a=kl(n/188),o=a<31?129:193,s=n%188,u=s<63?64:65;return[a+o,s+u]}}Qa.Shift_JIS=function(e){return new Lge(e)};Za.Shift_JIS=function(e){return new jge(e)};function Nge(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 hi;if(r!==0){var a=r,o=null;r=0,er(n,65,254)&&(o=(a-129)*190+(n-65));var s=o===null?null:Cp(o,Ma("euc-kr"));return o===null&&qo(n)&&i.prepend(n),s===null?Cr(t):s}return qo(n)?n:er(n,129,254)?(r=n,null):Cr(t)}}function qge(e){var t=e.fatal;this.handler=function(r,i){if(i===Rr)return hi;if(Uo(i))return i;var n=Ip(i,Ma("euc-kr"));if(n===null)return Ps(i);var a=kl(n/190)+129,o=n%190+65;return[a,o]}}Qa["EUC-KR"]=function(e){return new qge(e)};Za["EUC-KR"]=function(e){return new Nge(e)};function __(e,t){var r=e>>8,i=e&255;return t?[r,i]:[i,r]}function zL(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 hi;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,er(s,56320,57343)?65536+(u-55296)*1024+(s-56320):(a.prepend(__(s,e)),Cr(r))}return er(s,55296,56319)?(n=s,null):er(s,56320,57343)?Cr(r):s}}function HL(e,t){var r=t.fatal;this.handler=function(i,n){if(n===Rr)return hi;if(er(n,0,65535))return __(n,e);var a=__((n-65536>>10)+55296,e),o=__((n-65536&1023)+56320,e);return a.concat(o)}}Qa["UTF-16BE"]=function(e){return new HL(!0,e)};Za["UTF-16BE"]=function(e){return new zL(!0,e)};Qa["UTF-16LE"]=function(e){return new HL(!1,e)};Za["UTF-16LE"]=function(e){return new zL(!1,e)};function Uge(e){var t=e.fatal;this.handler=function(r,i){return i===Rr?hi:qo(i)?i:63360+i-128}}function Gge(e){var t=e.fatal;this.handler=function(r,i){return i===Rr?hi:Uo(i)?i:er(i,63360,63487)?i-63360+128:Ps(i)}}Qa["x-user-defined"]=function(e){return new Gge(e)};Za["x-user-defined"]=function(e){return new Uge(e)};var zge="rejected",Hge="fulfilled";function WL(e){let t=e.map(r=>r.then(i=>({status:Hge,value:i})).catch(i=>({status:zge,reason:i})));return Promise.all(t)}function x_(e){return Buffer.from(e).toString("base64")}function ak(e){return Buffer.from(e,"base64").toString("ascii")}var Go=class{constructor(t){this.map={},t instanceof Go?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=H0(t),r=VL(r);let i=this.map[t];this.map[t]=i?`${i}, ${r}`:r}delete(t){delete this.map[H0(t)]}get(t){return t=H0(t),this.has(t)?this.map[t]:null}has(t){return this.map.hasOwnProperty(H0(t))}set(t,r){this.map[H0(t)]=VL(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)}),ok(t)}values(){let t=[];return this.forEach(function(r){t.push(r)}),ok(t)}entries(){let t=[];return this.forEach(function(r,i){t.push([i,r])}),ok(t)}*[Symbol.iterator](){yield*this.entries()}};function H0(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 VL(e){return typeof e!="string"&&(e=String(e)),e}function ok(e){let t={next(){let r=e.shift();return{done:r===void 0,value:r}}};return t[Symbol.iterator]=function(){return t},t}function sk(e,t){if(!e)throw new Error(`@loaders.gl/polyfills assertion ${t}`)}var w_=Fe(require("zlib"));var Wge=e=>e&&e instanceof ArrayBuffer,Vge=e=>e&&e instanceof Buffer;function KL(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:uk(r),mimeType:i}}function uk(e){if(Wge(e))return e;if(Vge(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 YL(e,t){switch(t.get("content-encoding")){case"br":return e.pipe(w_.default.createBrotliDecompress());case"gzip":return e.pipe(w_.default.createGunzip());case"deflate":return e.pipe(w_.default.createDeflate());default:return e}}async function $L(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(uk(n))}),e.on("end",()=>{let n=Kge(t);r(n)})})}function Kge(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 ck=Fe(require("stream")),Yge=e=>typeof e=="boolean",XL=e=>typeof e=="function",$ge=e=>e!==null&&typeof e=="object",lk=e=>$ge(e)&&XL(e.read)&&XL(e.pipe)&&Yge(e.readable),Os=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 Go((r==null?void 0:r.headers)||{}),lk(t)?this._body=YL(t,i):typeof t=="string"?this._body=ck.Readable.from([new TextEncoder().encode(t)]):this._body=ck.Readable.from([t||new ArrayBuffer(0)])}get body(){return sk(!this.bodyUsed),sk(lk(this._body)),this.bodyUsed=!0,this._body}async arrayBuffer(){return lk(this._body)?await $L(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 JL=Fe(require("http")),QL=Fe(require("https"));var fk=Fe(require("fs"));async function hk(e,t){let r=e.split("?")[0];try{let i=await new Promise((s,u)=>{let l=fk.default.createReadStream(r,{encoding:null});l.once("readable",()=>s(l)),l.on("error",c=>u(c))}),n=200,a="OK",o=Xge(r);return new Os(i,{headers:o,status:n,statusText:a,url:e})}catch(i){let n=400,a=i.message,o={};return new Os(i.message,{headers:o,status:n,statusText:a,url:e})}}function Xge(e){let t={};if(!t["content-length"]){let r=fk.default.statSync(e);t["content-length"]=r.size}return e.endsWith(".gz")&&(e=e.slice(0,-3),t["content-encoding"]="gzip"),new Go(t)}var dk=e=>e.startsWith("data:"),Jge=e=>e.startsWith("http:")||e.startsWith("https:");async function W0(e,t){try{if(!Jge(e)&&!dk(e))return await hk(e,t);if(dk(e)){let{arrayBuffer:l,mimeType:c}=KL(e);return new Os(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 Qge(i,t),a=r0e(e,n,r),{status:o,statusText:s}=t0e(n),u=!t||t.followRedirect||t.followRedirect===void 0;if(o>=300&&o<400&&a.has("location")&&u){let l=Zge(e,a.get("location"));return await W0(l,t)}return new Os(n,{headers:a,status:o,statusText:s,url:e})}catch(r){return new Os(null,{status:400,statusText:String(r),url:e})}}async function Qge(e,t){return await new Promise((r,i)=>{let n=e0e(e,t),a=e.startsWith("https:")?QL.default.request(n,o=>r(o)):JL.default.request(n,o=>r(o));a.on("error",o=>i(o)),a.end()})}function Zge(e,t){if(t.startsWith("http"))return t;let r=new URL(e);return r.pathname=t,r.href}function e0e(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 Je(ae(ae({hostname:n.hostname,path:n.pathname,method:"GET"},t),t==null?void 0:t.fetch),{headers:i,port:n.port})}function t0e(e){return e.statusCode?{status:e.statusCode,statusText:e.statusMessage||"NA"}:{status:200,statusText:"OK"}}function r0e(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=i0e(e);Number.isFinite(n)&&(i["content-length"]=n)}return Object.assign(i,r),new Go(i)}function i0e(e){return dk(e)?e.length-"data:".length:null}var KN=Fe(WN()),YN=Fe(Z0());function VN(e){return Buffer.isBuffer(e)?new Uint8Array(e).buffer:e}function vbe(e,t){let r=t.type?t.type.replace("image/",""):"jpeg",i=(0,YN.default)(e.data,[e.width,e.height,4],[4,e.width*4,1],0);return(0,KN.default)(i,r,t)}function hR(e,t){let r=vbe(e,t);return new Promise(i=>{let n=[];r.on("data",a=>n.push(a)),r.on("end",()=>{let a=Buffer.concat(n);i(VN(a))})})}var kK=Fe(TK()),RK=["image/png","image/jpeg","image/gif"];async function gI(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 C3e(r,t)}function C3e(e,t){return new Promise(r=>(0,kK.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 PK=Fe(IK());delete global.ReadableStream;var $v=class extends PK.ReadableStream{};var vI=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 yI=class extends $v{constructor(t){super(new vI(t.values()),{type:"bytes"});this._chunks=t}async*[Symbol.asyncIterator](t){let r=this.getReader();yield*this._chunks,r.releaseLock()}};var vf=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 vf)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=I3e(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 vf([],{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 yI(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 I3e(e=""){let t=String(e).toLowerCase();return/[^\u0020-\u007E]/.test(t)?"":t}var bI=class extends vf{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 O3e=!wu||!("TextEncoder"in mn);O3e&&(mn.TextEncoder=z0);var B3e=!wu||!("TextDecoder"in mn);B3e&&(mn.TextDecoder=Nh);!wu&&!("atob"in mn)&&x_&&(mn.atob=x_);!wu&&!("btoa"in mn)&&ak&&(mn.btoa=ak);!wu&&!("Headers"in mn)&&Go&&(mn.Headers=Go);!wu&&!("Response"in mn)&&Os&&(mn.Response=Os);!wu&&!("fetch"in mn)&&W0&&(mn.fetch=W0);!wu&&!("_encodeImageNode"in mn)&&hR&&(mn._encodeImageNode=hR);!wu&&!("_parseImageNode"in mn)&&gI&&(mn._parseImageNode=gI,mn._imageFormatsNode=RK);"allSettled"in Promise||(Promise.allSettled=WL);var Bme=Fe(require("path"));function Ut(e,t){if(!e)throw new Error(t||"loader assertion failed.")}var Gu={self:typeof self!="undefined"&&self,window:typeof window!="undefined"&&window,global:typeof global!="undefined"&&global,document:typeof document!="undefined"&&document},OK=Gu.self||Gu.window||Gu.global||{},BK=Gu.window||Gu.self||Gu.global||{},DK=Gu.global||Gu.self||Gu.window||{},FK=Gu.document||{};var on=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var MK=typeof process!="undefined"&&process.version&&/v([0-9]*)/.exec(process.version),D3e=MK&&parseFloat(MK[1])||0;var yf="4.0.0-alpha.8";function Zn(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},ngt=zu.self||zu.window||zu.global||{},agt=zu.window||zu.self||zu.global||{},jK=zu.global||zu.self||zu.window||{},ogt=zu.document||{};var Ga=typeof process!="object"||String(process)!=="[object process]"||process.browser,Xv=typeof importScripts=="function",LK=typeof window!="undefined"&&typeof window.orientation!="undefined",NK=typeof process!="undefined"&&process.version&&/v([0-9]*)/.exec(process.version),sgt=NK&&parseFloat(NK[1])||0;var yw=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){Zn(this.isRunning),this.isRunning=!1,this._resolve(t)}error(t){Zn(this.isRunning),this.isRunning=!1,this._reject(t)}};var _m={};go(_m,{NodeWorker:()=>Jv});var qK=Fe(require("worker_threads"));G0(_m,Fe(require("worker_threads")));var Jv=qK.Worker;var _I=new Map;function UK(e){Zn(e.source&&!e.url||!e.source&&e.url);let t=_I.get(e.source||e.url);return t||(e.url&&(t=F3e(e.url),_I.set(e.url,t)),e.source&&(t=GK(e.source),_I.set(e.source,t))),Zn(t),t}function F3e(e){if(!e.startsWith("http"))return e;let t=M3e(e);return GK(t)}function GK(e){let t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function M3e(e){return`try {
|
|
117
|
+
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 Rst(e,t){if(!!e){if(typeof e=="string")return Fpe(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 Fpe(e,t)}}function Fpe(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 Cst=Dpe.default.mark(Mpe),Ist=10,Pst=65535;function Ost(e,t){var r=Mpe(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 T=p.split(" ");if(T=T.filter(function(C){return C!==""}),c=parseInt(T[0],10),f=parseInt(T[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!==Pst)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,D=(f-1)/180;return new Tst.default({cubic:t.cubic,_width:c,_height:f,_rlonres:R,_rlatres:D,_offset:n,_scale:a,_swidth:d,_datastart:h,_maxerror:o,_rmserror:s,_description:u,_datetime:l,data:e})}function Mpe(e){var t,r,i,n;return Dpe.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:t=0;case 1:if(r=e.indexOf(Ist,t),r===-1){o.next=9;break}return i=e.subarray(t,r),t=r+1,o.next=7,{offset:t,line:jpe(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:jpe(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()}},Cst)}function jpe(e){var t="",r=kst(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 Npe=A(D2=>{"use strict";var Bst=ti();Object.defineProperty(D2,"__esModule",{value:!0});Object.defineProperty(D2,"parsePGM",{enumerable:!0,get:function(){return Dst.parsePGM}});Object.defineProperty(D2,"Geoid",{enumerable:!0,get:function(){return Fst.default}});var Dst=Lpe(),Fst=Bst(Hj())});var rme=A(N2=>{"use strict";Object.defineProperty(N2,"__esModule",{value:!0});N2.default=void 0;var hut={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};N2.default=hut});var wu=typeof process!="object"||String(process)!=="[object process]"||process.browser,Z2={self:typeof self!="undefined"&&self,window:typeof window!="undefined"&&window,global:typeof global!="undefined"&&global},mn=Z2.global||Z2.self||Z2.window;var jL={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"]=jL||{};function er(e,t,r){return t<=e&&e<=r}function yge(e,t){return e.indexOf(t)!==-1}var kl=Math.floor;function b_(e){if(e===void 0)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function bge(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 _ge(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 qo(e){return 0<=e&&e<=127}var Uo=qo,Rr=-1;function ek(e){this.tokens=[].slice.call(e),this.tokens.reverse()}ek.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 hi=-1;function Cr(e,t){if(e)throw TypeError("Decoder error");return t||65533}function Ps(e){throw TypeError("The code point "+e+" could not be encoded.")}function xge(){}xge.prototype={handler:function(e,t){}};function wge(){}wge.prototype={handler:function(e,t){}};function tk(e){return e=String(e).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(rk,e)?rk[e]:null}var LL=[{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"}],rk={};LL.forEach(function(e){e.encodings.forEach(function(t){t.labels.forEach(function(r){rk[r]=t})})});var Qa={},Za={};function Cp(e,t){return t&&t[e]||null}function Ip(e,t){var r=t.indexOf(e);return r===-1?null:r}function Ma(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 Ege(e){if(e>39419&&e<189e3||e>1237575)return null;if(e===7457)return 59335;var t=0,r=0,i=Ma("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 Sge(e){if(e===59335)return 7457;var t=0,r=0,i=Ma("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 Age(e){ik=ik||Ma("jis0208").map(function(r,i){return er(i,8272,8835)?null:r});var t=ik;return t.indexOf(e)}var ik;function Tge(e){nk=nk||Ma("big5").map(function(r,i){return i<(161-129)*157?null:r});var t=nk;return e===9552||e===9566||e===9569||e===9578||e===21313||e===21317?t.lastIndexOf(e):Ip(e,t)}var nk,NL="utf-8";function Nh(e,t){if(!(this instanceof Nh))throw TypeError("Called as a function. Did you forget 'new'?");e=e!==void 0?String(e):NL,t=b_(t),this._encoding=null,this._decoder=null,this._ignoreBOM=!1,this._BOMseen=!1,this._error_mode="replacement",this._do_not_flush=!1;var r=tk(e);if(r===null||r.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!Za[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(Nh.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(Nh.prototype,"fatal",{get:function(){return this._error_mode==="fatal"}}),Object.defineProperty(Nh.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}}));Nh.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=b_(r),this._do_not_flush||(this._decoder=Za[this._encoding.name]({fatal:this._error_mode==="fatal"}),this._BOMseen=!1),this._do_not_flush=Boolean(r.stream);for(var n=new ek(i),a=[],o;;){var s=n.read();if(s===Rr||(o=this._decoder.handler(n,s),o===hi))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===hi)break;o!==null&&(Array.isArray(o)?a.push.apply(a,o):a.push(o))}while(!n.endOfStream());this._decoder=null}function u(l){return yge(["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)),_ge(l)}return u.call(this,a)};function z0(e,t){if(!(this instanceof z0))throw TypeError("Called as a function. Did you forget 'new'?");t=b_(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):NL;var i=tk(e);if(i===null||i.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!Qa[i.name])throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");r._encoding=i}else r._encoding=tk("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(z0.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}});z0.prototype.encode=function(t,r){t=t===void 0?"":String(t),r=b_(r),this._do_not_flush||(this._encoder=Qa[this._encoding.name]({fatal:this._fatal==="fatal"})),this._do_not_flush=Boolean(r.stream);for(var i=new ek(bge(t)),n=[],a;;){var o=i.read();if(o===Rr||(a=this._encoder.handler(i,o),a===hi))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!==hi;)Array.isArray(a)?n.push.apply(n,a):n.push(a);this._encoder=null}return new Uint8Array(n)};function kge(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 hi;if(n===0){if(er(u,0,127))return u;if(er(u,194,223))n=1,r=u&31;else if(er(u,224,239))u===224&&(a=160),u===237&&(o=159),n=2,r=u&15;else if(er(u,240,244))u===240&&(a=144),u===244&&(o=143),n=3,r=u&7;else return Cr(t);return null}if(!er(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 Rge(e){var t=e.fatal;this.handler=function(r,i){if(i===Rr)return hi;if(Uo(i))return i;var n,a;er(i,128,2047)?(n=1,a=192):er(i,2048,65535)?(n=2,a=224):er(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}}Qa["UTF-8"]=function(e){return new Rge(e)};Za["UTF-8"]=function(e){return new kge(e)};function Cge(e,t){var r=t.fatal;this.handler=function(i,n){if(n===Rr)return hi;if(qo(n))return n;var a=e[n-128];return a===null?Cr(r):a}}function Ige(e,t){var r=t.fatal;this.handler=function(i,n){if(n===Rr)return hi;if(Uo(n))return n;var a=Ip(n,e);return a===null&&Ps(n),a+128}}(function(){"encoding-indexes"in global&&LL.forEach(function(e){e.heading==="Legacy single-byte encodings"&&e.encodings.forEach(function(t){var r=t.name,i=Ma(r.toLowerCase());Za[r]=function(n){return new Cge(i,n)},Qa[r]=function(n){return new Ige(i,n)}})})})();Za.GBK=function(e){return new qL(e)};Qa.GBK=function(e){return new UL(e,!0)};function qL(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 hi;o===Rr&&(r!==0||i!==0||n!==0)&&(r=0,i=0,n=0,Cr(t));var s;if(n!==0){s=null,er(o,48,57)&&(s=Ege((((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 er(o,129,254)?(n=o,null):(a.prepend([i,o]),r=0,i=0,Cr(t));if(r!==0){if(er(o,48,57))return i=o,null;var l=r,c=null;r=0;var f=o<127?64:65;return(er(o,64,126)||er(o,128,254))&&(c=(l-129)*190+(o-f)),s=c===null?null:Cp(c,Ma("gb18030")),s===null&&qo(o)&&a.prepend(o),s===null?Cr(t):s}return qo(o)?o:o===128?8364:er(o,129,254)?(r=o,null):Cr(t)}}function UL(e,t){var r=e.fatal;this.handler=function(i,n){if(n===Rr)return hi;if(Uo(n))return n;if(n===58853)return Ps(n);if(t&&n===8364)return 128;var a=Ip(n,Ma("gb18030"));if(a!==null){var o=kl(a/190)+129,s=a%190,u=s<63?64:65;return[o,s+u]}if(t)return Ps(n);a=Sge(n);var l=kl(a/10/126/10);a=a-l*10*126*10;var c=kl(a/10/126);a=a-c*10*126;var f=kl(a/10),h=a-f*10;return[l+129,c+48,f+129,h+48]}}Qa.gb18030=function(e){return new UL(e)};Za.gb18030=function(e){return new qL(e)};function Pge(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 hi;if(r!==0){var a=r,o=null;r=0;var s=n<127?64:98;switch((er(n,64,126)||er(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:Cp(o,Ma("big5"));return u===null&&qo(n)&&i.prepend(n),u===null?Cr(t):u}return qo(n)?n:er(n,129,254)?(r=n,null):Cr(t)}}function Oge(e){var t=e.fatal;this.handler=function(r,i){if(i===Rr)return hi;if(Uo(i))return i;var n=Tge(i);if(n===null)return Ps(i);var a=kl(n/157)+129;if(a<161)return Ps(i);var o=n%157,s=o<63?64:98;return[a,o+s]}}Qa.Big5=function(e){return new Oge(e)};Za.Big5=function(e){return new Pge(e)};function Bge(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 hi;if(i===142&&er(a,161,223))return i=0,65377-161+a;if(i===143&&er(a,161,254))return r=!0,i=a,null;if(i!==0){var o=i;i=0;var s=null;return er(o,161,254)&&er(a,161,254)&&(s=Cp((o-161)*94+(a-161),Ma(r?"jis0212":"jis0208"))),r=!1,er(a,161,254)||n.prepend(a),s===null?Cr(t):s}return qo(a)?a:a===142||a===143||er(a,161,254)?(i=a,null):Cr(t)}}function Dge(e){var t=e.fatal;this.handler=function(r,i){if(i===Rr)return hi;if(Uo(i))return i;if(i===165)return 92;if(i===8254)return 126;if(er(i,65377,65439))return[142,i-65377+161];i===8722&&(i=65293);var n=Ip(i,Ma("jis0208"));if(n===null)return Ps(i);var a=kl(n/94)+161,o=n%94+161;return[a,o]}}Qa["EUC-JP"]=function(e){return new Dge(e)};Za["EUC-JP"]=function(e){return new Bge(e)};function Fge(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):er(u,0,127)&&u!==14&&u!==15&&u!==27?(o=!1,u):u===Rr?hi:(o=!1,Cr(t));case r.Roman:return u===27?(i=r.EscapeStart,null):u===92?(o=!1,165):u===126?(o=!1,8254):er(u,0,127)&&u!==14&&u!==15&&u!==27&&u!==92&&u!==126?(o=!1,u):u===Rr?hi:(o=!1,Cr(t));case r.Katakana:return u===27?(i=r.EscapeStart,null):er(u,33,95)?(o=!1,65377-33+u):u===Rr?hi:(o=!1,Cr(t));case r.LeadByte:return u===27?(i=r.EscapeStart,null):er(u,33,126)?(o=!1,a=u,i=r.TrailByte,null):u===Rr?hi:(o=!1,Cr(t));case r.TrailByte:if(u===27)return i=r.EscapeStart,Cr(t);if(er(u,33,126)){i=r.LeadByte;var l=(a-33)*94+u-33,c=Cp(l,Ma("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 Mge(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 hi;if((i===r.ASCII||i===r.Roman)&&(a===14||a===15||a===27))return Ps(65533);if(i===r.ASCII&&Uo(a))return a;if(i===r.Roman&&(Uo(a)&&a!==92&&a!==126||a==165||a==8254)){if(Uo(a))return a;if(a===165)return 92;if(a===8254)return 126}if(Uo(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=Ip(a,Ma("jis0208"));if(o===null)return Ps(a);if(i!==r.jis0208)return n.prepend(a),i=r.jis0208,[27,36,66];var s=kl(o/94)+33,u=o%94+33;return[s,u]}}Qa["ISO-2022-JP"]=function(e){return new Mge(e)};Za["ISO-2022-JP"]=function(e){return new Fge(e)};function jge(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 hi;if(r!==0){var a=r,o=null;r=0;var s=n<127?64:65,u=a<160?129:193;if((er(n,64,126)||er(n,128,252))&&(o=(a-u)*188+n-s),er(o,8836,10715))return 57344-8836+o;var l=o===null?null:Cp(o,Ma("jis0208"));return l===null&&qo(n)&&i.prepend(n),l===null?Cr(t):l}return qo(n)||n===128?n:er(n,161,223)?65377-161+n:er(n,129,159)||er(n,224,252)?(r=n,null):Cr(t)}}function Lge(e){var t=e.fatal;this.handler=function(r,i){if(i===Rr)return hi;if(Uo(i)||i===128)return i;if(i===165)return 92;if(i===8254)return 126;if(er(i,65377,65439))return i-65377+161;i===8722&&(i=65293);var n=Age(i);if(n===null)return Ps(i);var a=kl(n/188),o=a<31?129:193,s=n%188,u=s<63?64:65;return[a+o,s+u]}}Qa.Shift_JIS=function(e){return new Lge(e)};Za.Shift_JIS=function(e){return new jge(e)};function Nge(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 hi;if(r!==0){var a=r,o=null;r=0,er(n,65,254)&&(o=(a-129)*190+(n-65));var s=o===null?null:Cp(o,Ma("euc-kr"));return o===null&&qo(n)&&i.prepend(n),s===null?Cr(t):s}return qo(n)?n:er(n,129,254)?(r=n,null):Cr(t)}}function qge(e){var t=e.fatal;this.handler=function(r,i){if(i===Rr)return hi;if(Uo(i))return i;var n=Ip(i,Ma("euc-kr"));if(n===null)return Ps(i);var a=kl(n/190)+129,o=n%190+65;return[a,o]}}Qa["EUC-KR"]=function(e){return new qge(e)};Za["EUC-KR"]=function(e){return new Nge(e)};function __(e,t){var r=e>>8,i=e&255;return t?[r,i]:[i,r]}function zL(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 hi;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,er(s,56320,57343)?65536+(u-55296)*1024+(s-56320):(a.prepend(__(s,e)),Cr(r))}return er(s,55296,56319)?(n=s,null):er(s,56320,57343)?Cr(r):s}}function HL(e,t){var r=t.fatal;this.handler=function(i,n){if(n===Rr)return hi;if(er(n,0,65535))return __(n,e);var a=__((n-65536>>10)+55296,e),o=__((n-65536&1023)+56320,e);return a.concat(o)}}Qa["UTF-16BE"]=function(e){return new HL(!0,e)};Za["UTF-16BE"]=function(e){return new zL(!0,e)};Qa["UTF-16LE"]=function(e){return new HL(!1,e)};Za["UTF-16LE"]=function(e){return new zL(!1,e)};function Uge(e){var t=e.fatal;this.handler=function(r,i){return i===Rr?hi:qo(i)?i:63360+i-128}}function Gge(e){var t=e.fatal;this.handler=function(r,i){return i===Rr?hi:Uo(i)?i:er(i,63360,63487)?i-63360+128:Ps(i)}}Qa["x-user-defined"]=function(e){return new Gge(e)};Za["x-user-defined"]=function(e){return new Uge(e)};var zge="rejected",Hge="fulfilled";function WL(e){let t=e.map(r=>r.then(i=>({status:Hge,value:i})).catch(i=>({status:zge,reason:i})));return Promise.all(t)}function x_(e){return Buffer.from(e).toString("base64")}function ak(e){return Buffer.from(e,"base64").toString("ascii")}var Go=class{constructor(t){this.map={},t instanceof Go?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=H0(t),r=VL(r);let i=this.map[t];this.map[t]=i?`${i}, ${r}`:r}delete(t){delete this.map[H0(t)]}get(t){return t=H0(t),this.has(t)?this.map[t]:null}has(t){return this.map.hasOwnProperty(H0(t))}set(t,r){this.map[H0(t)]=VL(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)}),ok(t)}values(){let t=[];return this.forEach(function(r){t.push(r)}),ok(t)}entries(){let t=[];return this.forEach(function(r,i){t.push([i,r])}),ok(t)}*[Symbol.iterator](){yield*this.entries()}};function H0(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 VL(e){return typeof e!="string"&&(e=String(e)),e}function ok(e){let t={next(){let r=e.shift();return{done:r===void 0,value:r}}};return t[Symbol.iterator]=function(){return t},t}function sk(e,t){if(!e)throw new Error(`@loaders.gl/polyfills assertion ${t}`)}var w_=Fe(require("zlib"));var Wge=e=>e&&e instanceof ArrayBuffer,Vge=e=>e&&e instanceof Buffer;function KL(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:uk(r),mimeType:i}}function uk(e){if(Wge(e))return e;if(Vge(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 YL(e,t){switch(t.get("content-encoding")){case"br":return e.pipe(w_.default.createBrotliDecompress());case"gzip":return e.pipe(w_.default.createGunzip());case"deflate":return e.pipe(w_.default.createDeflate());default:return e}}async function $L(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(uk(n))}),e.on("end",()=>{let n=Kge(t);r(n)})})}function Kge(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 ck=Fe(require("stream")),Yge=e=>typeof e=="boolean",XL=e=>typeof e=="function",$ge=e=>e!==null&&typeof e=="object",lk=e=>$ge(e)&&XL(e.read)&&XL(e.pipe)&&Yge(e.readable),Os=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 Go((r==null?void 0:r.headers)||{}),lk(t)?this._body=YL(t,i):typeof t=="string"?this._body=ck.Readable.from([new TextEncoder().encode(t)]):this._body=ck.Readable.from([t||new ArrayBuffer(0)])}get body(){return sk(!this.bodyUsed),sk(lk(this._body)),this.bodyUsed=!0,this._body}async arrayBuffer(){return lk(this._body)?await $L(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 JL=Fe(require("http")),QL=Fe(require("https"));var fk=Fe(require("fs"));async function hk(e,t){let r=e.split("?")[0];try{let i=await new Promise((s,u)=>{let l=fk.default.createReadStream(r,{encoding:null});l.once("readable",()=>s(l)),l.on("error",c=>u(c))}),n=200,a="OK",o=Xge(r);return new Os(i,{headers:o,status:n,statusText:a,url:e})}catch(i){let n=400,a=i.message,o={};return new Os(i.message,{headers:o,status:n,statusText:a,url:e})}}function Xge(e){let t={};if(!t["content-length"]){let r=fk.default.statSync(e);t["content-length"]=r.size}return e.endsWith(".gz")&&(e=e.slice(0,-3),t["content-encoding"]="gzip"),new Go(t)}var dk=e=>e.startsWith("data:"),Jge=e=>e.startsWith("http:")||e.startsWith("https:");async function W0(e,t){try{if(!Jge(e)&&!dk(e))return await hk(e,t);if(dk(e)){let{arrayBuffer:l,mimeType:c}=KL(e);return new Os(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 Qge(i,t),a=r0e(e,n,r),{status:o,statusText:s}=t0e(n),u=!t||t.followRedirect||t.followRedirect===void 0;if(o>=300&&o<400&&a.has("location")&&u){let l=Zge(e,a.get("location"));return await W0(l,t)}return new Os(n,{headers:a,status:o,statusText:s,url:e})}catch(r){return new Os(null,{status:400,statusText:String(r),url:e})}}async function Qge(e,t){return await new Promise((r,i)=>{let n=e0e(e,t),a=e.startsWith("https:")?QL.default.request(n,o=>r(o)):JL.default.request(n,o=>r(o));a.on("error",o=>i(o)),a.end()})}function Zge(e,t){if(t.startsWith("http"))return t;let r=new URL(e);return r.pathname=t,r.href}function e0e(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 Je(ae(ae({hostname:n.hostname,path:n.pathname,method:"GET"},t),t==null?void 0:t.fetch),{headers:i,port:n.port})}function t0e(e){return e.statusCode?{status:e.statusCode,statusText:e.statusMessage||"NA"}:{status:200,statusText:"OK"}}function r0e(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=i0e(e);Number.isFinite(n)&&(i["content-length"]=n)}return Object.assign(i,r),new Go(i)}function i0e(e){return dk(e)?e.length-"data:".length:null}var KN=Fe(WN()),YN=Fe(Z0());function VN(e){return Buffer.isBuffer(e)?new Uint8Array(e).buffer:e}function vbe(e,t){let r=t.type?t.type.replace("image/",""):"jpeg",i=(0,YN.default)(e.data,[e.width,e.height,4],[4,e.width*4,1],0);return(0,KN.default)(i,r,t)}function hR(e,t){let r=vbe(e,t);return new Promise(i=>{let n=[];r.on("data",a=>n.push(a)),r.on("end",()=>{let a=Buffer.concat(n);i(VN(a))})})}var kK=Fe(TK()),RK=["image/png","image/jpeg","image/gif"];async function gI(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 C3e(r,t)}function C3e(e,t){return new Promise(r=>(0,kK.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 PK=Fe(IK());delete global.ReadableStream;var $v=class extends PK.ReadableStream{};var vI=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 yI=class extends $v{constructor(t){super(new vI(t.values()),{type:"bytes"});this._chunks=t}async*[Symbol.asyncIterator](t){let r=this.getReader();yield*this._chunks,r.releaseLock()}};var vf=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 vf)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=I3e(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 vf([],{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 yI(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 I3e(e=""){let t=String(e).toLowerCase();return/[^\u0020-\u007E]/.test(t)?"":t}var bI=class extends vf{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 O3e=!wu||!("TextEncoder"in mn);O3e&&(mn.TextEncoder=z0);var B3e=!wu||!("TextDecoder"in mn);B3e&&(mn.TextDecoder=Nh);!wu&&!("atob"in mn)&&x_&&(mn.atob=x_);!wu&&!("btoa"in mn)&&ak&&(mn.btoa=ak);!wu&&!("Headers"in mn)&&Go&&(mn.Headers=Go);!wu&&!("Response"in mn)&&Os&&(mn.Response=Os);!wu&&!("fetch"in mn)&&W0&&(mn.fetch=W0);!wu&&!("_encodeImageNode"in mn)&&hR&&(mn._encodeImageNode=hR);!wu&&!("_parseImageNode"in mn)&&gI&&(mn._parseImageNode=gI,mn._imageFormatsNode=RK);"allSettled"in Promise||(Promise.allSettled=WL);var Bme=Fe(require("path"));function Ut(e,t){if(!e)throw new Error(t||"loader assertion failed.")}var Gu={self:typeof self!="undefined"&&self,window:typeof window!="undefined"&&window,global:typeof global!="undefined"&&global,document:typeof document!="undefined"&&document},OK=Gu.self||Gu.window||Gu.global||{},BK=Gu.window||Gu.self||Gu.global||{},DK=Gu.global||Gu.self||Gu.window||{},FK=Gu.document||{};var on=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var MK=typeof process!="undefined"&&process.version&&/v([0-9]*)/.exec(process.version),D3e=MK&&parseFloat(MK[1])||0;var yf="4.0.0-alpha.9";function Zn(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},ngt=zu.self||zu.window||zu.global||{},agt=zu.window||zu.self||zu.global||{},jK=zu.global||zu.self||zu.window||{},ogt=zu.document||{};var Ga=typeof process!="object"||String(process)!=="[object process]"||process.browser,Xv=typeof importScripts=="function",LK=typeof window!="undefined"&&typeof window.orientation!="undefined",NK=typeof process!="undefined"&&process.version&&/v([0-9]*)/.exec(process.version),sgt=NK&&parseFloat(NK[1])||0;var yw=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){Zn(this.isRunning),this.isRunning=!1,this._resolve(t)}error(t){Zn(this.isRunning),this.isRunning=!1,this._reject(t)}};var _m={};go(_m,{NodeWorker:()=>Jv});var qK=Fe(require("worker_threads"));G0(_m,Fe(require("worker_threads")));var Jv=qK.Worker;var _I=new Map;function UK(e){Zn(e.source&&!e.url||!e.source&&e.url);let t=_I.get(e.source||e.url);return t||(e.url&&(t=F3e(e.url),_I.set(e.url,t)),e.source&&(t=GK(e.source),_I.set(e.source,t))),Zn(t),t}function F3e(e){if(!e.startsWith("http"))return e;let t=M3e(e);return GK(t)}function GK(e){let t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function M3e(e){return`try {
|
|
118
118
|
importScripts('${e}');
|
|
119
119
|
} catch (error) {
|
|
120
120
|
console.error(error);
|
|
121
121
|
throw error;
|
|
122
122
|
}`}function xI(e,t=!0,r){let i=r||new Set;if(e){if(zK(e))i.add(e);else if(zK(e.buffer))i.add(e.buffer);else if(!ArrayBuffer.isView(e)){if(t&&typeof e=="object")for(let n in e)xI(e[n],t,i)}}return r===void 0?Array.from(i):[]}function zK(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 wI(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]=wI(e[r]):typeof t[r]=="function"||t[r]instanceof RegExp?t[r]={}:t[r]=e[r]}),t}var EI=()=>{},nd=class{constructor(t){this.terminated=!1;this._loadableURL="";let{name:r,source:i,url:n}=t;Zn(i||n),this.name=r,this.source=i,this.url=n,this.onMessage=EI,this.onError=a=>console.log(a),this.worker=Ga?this._createBrowserWorker():this._createNodeWorker()}static isSupported(){return typeof Worker!="undefined"&&Ga||typeof Jv!="undefined"&&!Ga}destroy(){this.onMessage=EI,this.onError=EI,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(t,r){r=r||xI(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=UK({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 Jv(i,{eval:!1})}else if(this.source)t=new Jv(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 bw=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 nd.isSupported()}destroy(){this.idleQueue.forEach(t=>t.destroy()),this.isDestroyed=!0}setProps(t){this.props=ae(ae({},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 yw(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){!Ga||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 nd({name:t,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return LK?this.maxMobileConcurrency:this.maxConcurrency}};var j3e={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}},_n=class{constructor(t){this.workerPools=new Map;this.props=ae({},j3e),this.setProps(t),this.workerPools=new Map}static isSupported(){return nd.isSupported()}static getWorkerFarm(t={}){return _n._workerFarm=_n._workerFarm||new _n({}),_n._workerFarm.setProps(t),_n._workerFarm}destroy(){for(let t of this.workerPools.values())t.destroy();this.workerPools=new Map}setProps(t){this.props=ae(ae({},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 bw({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 HK="beta",WK=typeof yf!="undefined"?yf:HK;function VK(e){let t=e.version!==WK?` (worker-utils@${WK})`:"";return`${e.name}@${e.version}${t}`}function Ys(e,t={}){let r=t[e.id]||{},i=Ga?`${e.id}-worker.js`:`${e.id}-worker-node.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=HK);let o=a?`@${a}`:"";n=`https://unpkg.com/@loaders.gl/${e.module}${o}/dist/${i}`}return Zn(n),n}async function Qv(e,t,r={},i={}){let n=VK(e),a=_n.getWorkerFarm(r),{source:o}=r,s={name:n,source:o};o||(s.url=Ys(e,r));let u=a.getWorkerPool(s),l=r.jobName||e.name,c=await u.startJob(l,L3e.bind(null,i)),f=wI(r);return c.postMessage("process",{input:t,options:f}),(await c.result).result}async function L3e(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 SI(e,t=yf){Zn(e,"no worker provided");let r=e.version;return!(!t||!r)}var kI={};go(kI,{requireFromFile:()=>TI,requireFromString:()=>_w});var AI=Fe(require("module")),KK=Fe(require("path"));async function TI(e){if(e.startsWith("http")){let r=await(await fetch(e)).text();return _w(r)}return e.startsWith("/")||(e=`${process.cwd()}/${e}`),require(e)}function _w(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=AI.default._nodeModulePaths(KK.default.dirname(t)),n=module.parent,a=new AI.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 N3e="beta",q3e=typeof yf!="undefined"?yf:N3e,RI={};async function Hu(e,t=null,r={}){return t&&(e=YK(e,t,r)),RI[e]=RI[e]||U3e(e),await RI[e]}function YK(e,t,r){if(e.startsWith("http"))return e;let i=r.modules||{};return i[e]?i[e]:Ga?r.CDN?(Zn(r.CDN.startsWith("http")),`${r.CDN}/${t}@${q3e}/dist/libs/${e}`):Xv?`../src/libs/${e}`:`modules/${t}/src/libs/${e}`:`modules/${t}/dist/libs/${e}`}async function U3e(e){if(e.endsWith("wasm"))return await(await fetch(e)).arrayBuffer();if(!Ga)try{return kI&&TI&&await TI(e)}catch{return null}if(Xv)return importScripts(e);let r=await(await fetch(e)).text();return G3e(r,e)}function G3e(e,t){if(!Ga)return _w&&_w(e,t);if(Xv)return eval.call(jK,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 JK=Fe(require("child_process"));var $K=Fe(require("child_process"));function XK(e=3e3){return new Promise(t=>{$K.default.exec("lsof -i -P -n | grep LISTEN",(r,i)=>{if(r){t(e);return}let n=[],a=/:(\d+) \(LISTEN\)/;i.split(`
|
|
123
|
-
`).forEach(s=>{let u=a.exec(s);u&&n.push(Number(u[1]))});let o=e;for(;n.includes(o);)o++;t(o)})})}var QK={command:"",arguments:[],port:5e3,autoPort:!0,wait:2e3,onSuccess:e=>{console.log(`Started ${e.props.command}`)}},bf=class{constructor({id:t="browser-driver"}={}){this.props=ae({},QK);this.childProcess=null;this.port=0;this.id=t}async start(t){t=ae(ae({},QK),t),this.props=t;let r=[...t.arguments];return this.port=Number(t.port),t.portArg&&(t.autoPort&&(this.port=await XK(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=JK.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 CI(e,t){return!_n.isSupported()||!Ga&&!(t==null?void 0:t._nodeWorkers)?!1:e.worker&&(t==null?void 0:t.worker)}async function II(e,t,r,i,n){let a=e.id,o=Ys(e,r),u=_n.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",z3e.bind(null,n));return l.postMessage("process",{input:t,options:r,context:i}),await(await l.result).result}async function z3e(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 PI(e,t){return!_n.isSupported()||!on&&!(t==null?void 0:t._nodeWorkers)?!1:e.worker&&(t==null?void 0:t.worker)}function ZK(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?eY(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?eY(e,0,t):""}function eY(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 OI(e){try{return JSON.parse(e)}catch{throw new Error(`Failed to parse JSON from data starting with "${ZK(e)}"`)}}function BI(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 Wu(...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 ua(...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 ad(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 _f(e,t){return Ut(e>=0),Ut(t>0),e+(t-1)&~(t-1)}function DI(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+_f(i.byteLength,4)}async function FI(e){let t=[];for await(let r of e)t.push(r);return Wu(...t)}function xf(e){return xf=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},xf(e)}function MI(e,t){if(xf(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(xf(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function jI(e){var t=MI(e,"string");return xf(t)==="symbol"?t:String(t)}function Wt(e,t,r){return t=jI(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Zv(){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 xm=class{constructor(t,r){Wt(this,"name",void 0),Wt(this,"type",void 0),Wt(this,"sampleSize",1),Wt(this,"time",0),Wt(this,"count",0),Wt(this,"samples",0),Wt(this,"lastTiming",0),Wt(this,"lastSampleTime",0),Wt(this,"lastSampleCount",0),Wt(this,"_count",0),Wt(this,"_time",0),Wt(this,"_samples",0),Wt(this,"_startTime",0),Wt(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=Zv(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Zv()-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 ey=class{constructor(t){Wt(this,"id",void 0),Wt(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 xm?n=t:n=new xm(r,i),this.stats[r]=n),n}};var H3e="Queued Requests",W3e="Active Requests",V3e="Cancelled Requests",K3e="Queued Requests Ever",Y3e="Active Requests Ever",$3e={id:"request-scheduler",throttleRequests:!0,maxRequests:6},ty=class{constructor(t={}){this.activeRequestCount=0;this.requestQueue=[];this.requestMap=new Map;this.deferredUpdate=null;this.props=ae(ae({},$3e),t),this.stats=new ey({id:this.props.id}),this.stats.get(H3e),this.stats.get(W3e),this.stats.get(V3e),this.stats.get(K3e),this.stats.get(Y3e)}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 X3e="",tY={};function wf(e){for(let t in tY)if(e.startsWith(t)){let r=tY[t];e=e.replace(t,r)}return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${X3e}${e}`),e}var J3e="4.0.0-alpha.8",LI={name:"JSON",id:"json",module:"json",version:J3e,extensions:["json","geojson"],mimeTypes:["application/json"],category:"json",text:!0,parseTextSync:rY,parse:async e=>rY(new TextDecoder().decode(e)),options:{}};function rY(e){return JSON.parse(e)}function xw(e){return Buffer.isBuffer(e)?new Uint8Array(e.buffer,e.byteOffset,e.length).slice().buffer:e}function NI(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 iY(e){return e&&typeof e=="object"&&e.isBuffer}function qI(e){return NI?NI(e):e}function ww(e){if(iY(e))return xw(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 UI(e){return(t,r)=>new Promise((i,n)=>e(t,r,(a,o)=>a?n(a):i(o)))}function nY(e){return(t,r,i)=>new Promise((n,a)=>e(t,r,i,(o,s)=>o?a(o):n(s)))}var $s={};go($s,{dirname:()=>Z3e,filename:()=>Q3e,join:()=>eCe,resolve:()=>tCe});function aY(){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 Q3e(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(t+1):""}function Z3e(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(0,t):""}function eCe(...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 tCe(...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=aY()),o=n),o.length!==0&&(r=`${o}/${r}`,i=o.charCodeAt(0)===ry)}return r=rCe(r,!i),i?`/${r}`:r.length>0?r:"."}var ry=47,GI=46;function rCe(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===ry)break;a=ry}if(a===ry){if(!(i===s-1||n===1))if(i!==s-1&&n===2){if(r.length<2||!o||r.charCodeAt(r.length-1)!==GI||r.charCodeAt(r.length-2)!==GI){if(r.length>2){let u=r.length-1,l=u;for(;l>=0&&r.charCodeAt(l)!==ry;--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===GI&&n!==-1?++n:n=-1}return r}var Ew={};go(Ew,{_readToArrayBuffer:()=>iCe,close:()=>dY,createWriteStream:()=>mY,fstat:()=>pY,isSupported:()=>gY,open:()=>hY,read:()=>zI,readFile:()=>uY,readFileSync:()=>lY,readdir:()=>oY,stat:()=>sY,writeFile:()=>cY,writeFileSync:()=>fY});var ao=Fe(require("fs"));var oY,sY,uY,lY,cY,fY,hY,dY,zI,pY,mY,gY=Boolean(ao.default);try{oY=UI(ao.default.readdir),sY=UI(ao.default.stat),uY=ao.default.readFile,lY=ao.default.readFileSync,cY=nY(ao.default.writeFile),fY=ao.default.writeFileSync,hY=ao.default.open,dY=e=>new Promise((t,r)=>ao.default.close(e,i=>i?r(i):t())),zI=ao.default.read,pY=ao.default.fstat,mY=ao.default.createWriteStream,gY=Boolean(ao.default)}catch{}async function iCe(e,t,r){let i=Buffer.alloc(r),{bytesRead:n}=await zI(e,i,0,r,t);if(n!==r)throw new Error("fs.read failed");return xw(i)}var aCe=e=>typeof e=="boolean",iy=e=>typeof e=="function",od=e=>e!==null&&typeof e=="object",HI=e=>od(e)&&e.constructor==={}.constructor;var vY=e=>e&&typeof e[Symbol.iterator]=="function",yY=e=>e&&typeof e[Symbol.asyncIterator]=="function";var Zo=e=>typeof Response!="undefined"&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json;var es=e=>typeof Blob!="undefined"&&e instanceof Blob,bY=e=>e&&typeof e=="object"&&e.isBuffer;var oCe=e=>typeof ReadableStream!="undefined"&&e instanceof ReadableStream||od(e)&&iy(e.tee)&&iy(e.cancel)&&iy(e.getReader);var sCe=e=>od(e)&&iy(e.read)&&iy(e.pipe)&&aCe(e.readable),Sw=e=>oCe(e)||sCe(e);var uCe=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,lCe=/^([-\w.]+\/[-\w.+]+)/;function _Y(e){let t=lCe.exec(e);return t?t[1]:e}function WI(e){let t=uCe.exec(e);return t?t[1]:""}var xY=/\?.*/;function wY(e){let t=e.match(xY);return t&&t[0]}function wm(e){return e.replace(xY,"")}function sd(e){return Zo(e)?e.url:es(e)?e.name||"":typeof e=="string"?e:""}function ny(e){if(Zo(e)){let t=e,r=t.headers.get("content-type")||"",i=wm(t.url);return _Y(r)||WI(i)}return es(e)?e.type||"":typeof e=="string"?WI(e):""}function EY(e){return Zo(e)?e.headers["content-length"]||-1:es(e)?e.size:typeof e=="string"?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}async function Aw(e){if(Zo(e))return e;let t={},r=EY(e);r>=0&&(t["content-length"]=String(r));let i=sd(e),n=ny(e);n&&(t["content-type"]=n);let a=await fCe(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 SY(e){if(!e.ok){let t=await cCe(e);throw new Error(t)}}async function cCe(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 fCe(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,${hCe(r)}`}return null}function hCe(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 ea(e,t){if(typeof e=="string"){e=wf(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 Aw(e)}async function AY(e,t,r){e=wf(e),on||await Ew.writeFile(e,qI(t),{flag:"w"}),Ut(!1)}function VI(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 Xs(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||VI()}var dCe=globalThis.self||globalThis.window||globalThis.global,Em=globalThis.window||globalThis.self||globalThis.global,pCe=globalThis.document||{},ud=globalThis.process||{},mCe=globalThis.console,Bvt=globalThis.navigator||{};var Tw="4.0.0-alpha.8",Mvt=Xs();function gCe(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var KI=class{constructor(t,r){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";Wt(this,"storage",void 0),Wt(this,"id",void 0),Wt(this,"config",void 0),this.storage=gCe(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 TY(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 kY(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 kw(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 Rw;(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"})(Rw||(Rw={}));var vCe=10;function RY(e){return typeof e!="string"?e:(e=e.toUpperCase(),Rw[e]||Rw.WHITE)}function CY(e,t,r){if(!Xs&&typeof e=="string"){if(t){let i=RY(t);e="[".concat(i,"m").concat(e,"[39m")}if(r){let i=RY(r);e="[".concat(i+vCe,"m").concat(e,"[49m")}}return e}function IY(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 Sm(e,t){if(!e)throw new Error(t||"Assertion failed")}function ld(){let e;if(Xs()&&Em.performance){var t,r;e=Em===null||Em===void 0||(t=Em.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in ud){var i;let n=ud===null||ud===void 0||(i=ud.hrtime)===null||i===void 0?void 0:i.call(ud);e=n[0]*1e3+n[1]/1e6}else e=Date.now();return e}var Am={debug:Xs()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},yCe={enabled:!0,level:0};function ts(){}var PY={},OY={once:!0},Hl=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};Wt(this,"id",void 0),Wt(this,"VERSION",Tw),Wt(this,"_startTs",ld()),Wt(this,"_deltaTs",ld()),Wt(this,"_storage",void 0),Wt(this,"userData",{}),Wt(this,"LOG_THROTTLE_TIMEOUT",0),this.id=t,this.userData={},this._storage=new KI("__probe-".concat(this.id,"__"),yCe),this.timeStamp("".concat(this.id," started")),IY(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((ld()-this._startTs).toPrecision(10))}getDelta(){return Number((ld()-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){Sm(t,r)}warn(t){return this._getLogFunction(0,t,Am.warn,arguments,OY)}error(t){return this._getLogFunction(0,t,Am.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,Am.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,Am.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,Am.debug||Am.info,arguments,OY)}table(t,r,i){return r?this._getLogFunction(t,r,console.table||ts,i&&[i],{tag:wCe(r)}):ts}image(t){let{logLevel:r,priority:i,image:n,message:a="",scale:o=1}=t;return this._shouldLog(r||i)?Xs()?xCe({image:n,message:a,scale:o}):_Ce({image:n,message:a,scale:o}):ts}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||ts)}group(t,r){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},n=DY({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||ts)}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()>=BY(t)}_getLogFunction(t,r,i,n,a){if(this._shouldLog(t)){a=DY({logLevel:t,message:r,args:n,opts:a}),i=i||a.method,Sm(i),a.total=this.getTotal(),a.delta=this.getDelta(),this._deltaTs=ld();let o=a.tag||a.message;if(a.once&&o)if(!PY[o])PY[o]=ld();else return ts;return r=bCe(this.id,a.message,a),i.bind(console,r,...a.args)}return ts}};Wt(Hl,"VERSION",Tw);function BY(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 Sm(Number.isFinite(t)&&t>=0),t}function DY(e){let{logLevel:t,message:r}=e;e.logLevel=BY(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 Sm(n==="string"||n==="object"),Object.assign(e,{args:i},e.opts)}function bCe(e,t,r){if(typeof t=="string"){let i=r.time?kY(TY(r.total)):"";t=r.time?"".concat(e,": ").concat(i," ").concat(t):"".concat(e,": ").concat(t),t=CY(t,r.color,r.background)}return t}function _Ce(e){let{image:t,message:r="",scale:i=1}=e;return console.warn("removed"),ts}function xCe(e){let{image:t,message:r="",scale:i=1}=e;if(typeof t=="string"){let a=new Image;return a.onload=()=>{let o=kw(a,r,i);console.log(...o)},a.src=t,ts}let n=t.nodeName||"";if(n.toLowerCase()==="img")return console.log(...kw(t,r,i)),ts;if(n.toLowerCase()==="canvas"){let a=new Image;return a.onload=()=>console.log(...kw(a,r,i)),a.src=t.toDataURL(),ts}return ts}function wCe(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var lyt=new Hl({id:"@probe.gl/log"});var YI=new Hl({id:"loaders.gl"}),$I=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},XI=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 JI={fetch:null,mimeType:void 0,nothrow:!1,log:new XI,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:on,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},FY={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 QI(){globalThis.loaders=globalThis.loaders||{};let{loaders:e}=globalThis;return e._state=e._state||{},e._state}var wo=()=>{let e=QI();return e.globalOptions=e.globalOptions||ae({},JI),e.globalOptions};function MY(e,t,r,i){return r=r||[],r=Array.isArray(r)?r:[r],ECe(e,r),ACe(t,e,i)}function ECe(e,t){jY(e,null,JI,FY,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]||{};jY(i,r.id,n,a,t)}}function jY(e,t,r,i,n){let a=t||"Top level",o=t?`${t}.`:"";for(let s in e){let u=!t&&od(e[s]),l=s==="baseUri"&&!t,c=s==="workerUrl"&&t;if(!(s in r)&&!l&&!c){if(s in i)YI.warn(`${a} loader option '${o}${s}' no longer supported, use '${i[s]}'`)();else if(!u){let f=SCe(s,n);YI.warn(`${a} loader option '${o}${s}' not recognized. ${f}`)()}}}}function SCe(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 ACe(e,t,r){let i=e.options||{},n=ae({},i);return TCe(n,r),n.log===null&&(n.log=new $I),LY(n,wo()),LY(n,t),n}function LY(e,t){for(let r in t)if(r in t){let i=t[r];HI(i)&&HI(e[r])?e[r]=ae(ae({},e[r]),t[r]):e[r]=t[r]}}function TCe(e,t){t&&!("baseUri"in e)&&(e.baseUri=t)}function ay(e){return e?(Array.isArray(e)&&(e=e[0]),Array.isArray(e==null?void 0:e.extensions)):!1}function ZI(e){Ut(e,"null loader"),Ut(ay(e),"invalid loader");let t;return Array.isArray(e)&&(t=e[1],e=e[0],e=Je(ae({},e),{options:ae(ae({},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 kCe=()=>{let e=QI();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function NY(){return kCe()}var qY=new Hl({id:"loaders.gl"});var RCe=/\.([^.]+)$/;async function UY(e,t=[],r,i){if(!zY(e))return null;let n=GY(e,t,Je(ae({},r),{nothrow:!0}),i);if(n)return n;if(es(e)&&(e=await e.slice(0,10).arrayBuffer(),n=GY(e,t,r,i)),!n&&!(r==null?void 0:r.nothrow))throw new Error(HY(e));return n}function GY(e,t=[],r,i){if(!zY(e))return null;if(t&&!Array.isArray(t))return ZI(t);let n=[];t&&(n=n.concat(t)),(r==null?void 0:r.ignoreRegisteredLoaders)||n.push(...NY()),ICe(n);let a=CCe(e,n,r,i);if(!a&&!(r==null?void 0:r.nothrow))throw new Error(HY(e));return a}function CCe(e,t,r,i){let n=sd(e),a=ny(e),o=wm(n)||(i==null?void 0:i.url),s=null,u="";return(r==null?void 0:r.mimeType)&&(s=eP(t,r==null?void 0:r.mimeType),u=`match forced by supplied MIME type ${r==null?void 0:r.mimeType}`),s=s||PCe(t,o),u=u||(s?`matched url ${o}`:""),s=s||eP(t,a),u=u||(s?`matched MIME type ${a}`:""),s=s||BCe(t,e),u=u||(s?`matched initial data ${VY(e)}`:""),s=s||eP(t,r==null?void 0:r.fallbackMimeType),u=u||(s?`matched fallback MIME type ${a}`:""),u&&qY.log(1,`selectLoader selected ${s==null?void 0:s.name}: ${u}.`),s}function zY(e){return!(e instanceof Response&&e.status===204)}function HY(e){let t=sd(e),r=ny(e),i="No valid loader found (";i+=t?`${$s.filename(t)}, `:"no url provided, ",i+=`MIME type: ${r?`"${r}"`:"not provided"}, `;let n=e?VY(e):"";return i+=n?` first bytes: "${n}"`:"first bytes: not available",i+=")",i}function ICe(e){for(let t of e)ZI(t)}function PCe(e,t){let r=t&&RCe.exec(t),i=r&&r[1];return i?OCe(e,i):null}function OCe(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 eP(e,t){for(let r of e)if(r.mimeTypes&&r.mimeTypes.includes(t)||t===`application/x.${r.id}`)return r;return null}function BCe(e,t){if(!t)return null;for(let r of e)if(typeof t=="string"){if(DCe(t,r))return r}else if(ArrayBuffer.isView(t)){if(WY(t.buffer,t.byteOffset,r))return r}else if(t instanceof ArrayBuffer&&WY(t,0,r))return r;return null}function DCe(e,t){return t.testText?t.testText(e):(Array.isArray(t.tests)?t.tests:[t.tests]).some(i=>e.startsWith(i))}function WY(e,t,r){return(Array.isArray(r.tests)?r.tests:[r.tests]).some(n=>FCe(e,t,r,n))}function FCe(e,t,r,i){if(i instanceof ArrayBuffer)return BI(i,e,i.byteLength);switch(typeof i){case"function":return i(e,r);case"string":let n=tP(e,t,i.length);return i===n;default:return!1}}function VY(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?tP(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?tP(e,0,t):""}function tP(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 MCe=256*1024;function*KY(e,t){let r=(t==null?void 0:t.chunkSize)||MCe,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 jCe=256*1024;function*YY(e,t={}){let{chunkSize:r=jCe}=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 LCe=1024*1024;async function*$Y(e,t){let r=(t==null?void 0:t.chunkSize)||LCe,i=0;for(;i<e.size;){let n=i+r,a=await e.slice(i,n).arrayBuffer();i=n,yield a}}function rP(e,t){return on?NCe(e,t):qCe(e,t)}async function*NCe(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 ww(o)}}catch{r.releaseLock()}}async function*qCe(e,t){for await(let r of e)yield ww(r)}function XY(e,t){if(typeof e=="string")return KY(e,t);if(e instanceof ArrayBuffer)return YY(e,t);if(es(e))return $Y(e,t);if(Sw(e))return rP(e,t);if(Zo(e))return rP(e.body,t);throw new Error("makeIterator")}var JY="Cannot convert supplied data type";function UCe(e,t,r){if(t.text&&typeof e=="string")return e;if(bY(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(JY)}async function QY(e,t,r){let i=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if(typeof e=="string"||i)return UCe(e,t,r);if(es(e)&&(e=await Aw(e)),Zo(e)){let n=e;return await SY(n),t.binary?await n.arrayBuffer():await n.text()}if(Sw(e)&&(e=XY(e,r)),vY(e)||yY(e))return FI(e);throw new Error(JY)}function Cw(e,t){let r=wo(),i=e||r;return typeof i.fetch=="function"?i.fetch:od(i.fetch)?n=>ea(n,i):(t==null?void 0:t.fetch)?t==null?void 0:t.fetch:ea}function ZY(e,t,r){if(r)return r;let i=ae({fetch:Cw(t,e)},e);if(i.url){let n=wm(i.url);i.baseUrl=n,i.queryString=wY(i.url),i.filename=$s.filename(n),i.baseUrl=$s.dirname(n)}return Array.isArray(i.loaders)||(i.loaders=null),i}function e$(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 Eo(e,t,r,i){Zn(!i||typeof i=="object"),t&&!Array.isArray(t)&&!ay(t)&&(i=void 0,r=t,t=void 0),e=await e,r=r||{};let n=sd(e),o=e$(t,i),s=await UY(e,o,r);return s?(r=MY(r,s,o,n),i=ZY({url:n,parse:Eo,loaders:o},r,i||null),await GCe(s,e,r,i)):null}async function GCe(e,t,r,i){if(SI(e),Zo(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 QY(t,e,r),e.parseTextSync&&typeof t=="string")return r.dataType="text",e.parseTextSync(t,r,i,e);if(CI(e,r))return await II(e,t,r,i,Eo);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 Zn(!e.parseSync),new Error(`${e.id} loader - no parser found and worker is disabled`)}async function Wr(e,t,r,i){let n,a;!Array.isArray(t)&&!ay(t)?(n=[],a=t,i=void 0):(n=t,a=r);let o=Cw(a),s=e;return typeof e=="string"&&(s=await o(e)),es(e)&&(s=await o(e)),Array.isArray(n)?await Eo(s,n,a):await Eo(s,n,a)}async function Tm(e,t,r){let i=wo();if(r=ae(ae({},i),r),PI(t,r))return await Qv(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=t$(e,t,r),a=[];for await(let o of n)a.push(o);return Wu(...a)}if(!on&&t.encodeURLtoURL){let n=i$("input");await AY(n,e);let a=i$("output"),o=await r$(n,a,t,r);return(await ea(o)).arrayBuffer()}throw new Error("Writer could not encode data")}function t$(e,t,r){if(t.encodeInBatches){let i=zCe(e);return t.encodeInBatches(i,r)}throw new Error("Writer could not encode data in batches")}async function r$(e,t,r,i){if(e=wf(e),t=wf(t),on||!r.encodeURLtoURL)throw new Error;return await r.encodeURLtoURL(e,t,i)}function zCe(e){return[{table:e,start:0,end:e.length}]}function i$(e){return`/tmp/${e}`}var iu=Fe(dr()),Ym=Fe(Ra());function ky(){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 Um=class{constructor(t,r){Wt(this,"name",void 0),Wt(this,"type",void 0),Wt(this,"sampleSize",1),Wt(this,"time",0),Wt(this,"count",0),Wt(this,"samples",0),Wt(this,"lastTiming",0),Wt(this,"lastSampleTime",0),Wt(this,"lastSampleCount",0),Wt(this,"_count",0),Wt(this,"_time",0),Wt(this,"_samples",0),Wt(this,"_startTime",0),Wt(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=ky(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(ky()-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 Ry=class{constructor(t){Wt(this,"id",void 0),Wt(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 Um?n=t:n=new Um(r,i),this.stats[r]=n),n}};var GP=class{constructor(t,r,i){this.item=t,this.previous=r,this.next=i}};var zP=class{constructor(){this.head=null;this.tail=null;this._length=0}get length(){return this._length}add(t){let r=new GP(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 HP=class{constructor(){this._list=new zP,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 WP=Fe(Ra()),yd=Fe(dr());function dJ(e,t){Ut(e),Ut(t);let{rtcCenter:r,gltfUpAxis:i}=t,{computedTransform:n,boundingVolume:{center:a}}=e,o=new yd.Matrix4(n);switch(r&&o.translate(r),i){case"Z":break;case"Y":let f=new yd.Matrix4().rotateX(Math.PI/2);o=o.multiplyRight(f);break;case"X":let h=new yd.Matrix4().rotateY(-Math.PI/2);o=o.multiplyRight(h);break;default:break}t.isQuantized&&o.translate(t.quantizedVolumeOffset).scale(t.quantizedVolumeScale);let s=new yd.Vector3(a);t.cartesianModelMatrix=o,t.cartesianOrigin=s;let u=WP.Ellipsoid.WGS84.cartesianToCartographic(s,new yd.Vector3),c=WP.Ellipsoid.WGS84.eastNorthUpToFixedFrame(s).invert();t.cartographicModelMatrix=c.multiplyRight(o),t.cartographicOrigin=u,t.coordinateSystem||(t.modelMatrix=t.cartographicModelMatrix)}var el=Fe(dr()),rc=Fe(Zu()),UE=Fe(Ra()),LJ=new el.Vector3,lO=new el.Vector3,cO=new rc.CullingVolume([new rc.Plane,new rc.Plane,new rc.Plane,new rc.Plane,new rc.Plane,new rc.Plane]);function NJ(e,t){let{cameraDirection:r,cameraUp:i,height:n}=e,{metersPerUnit:a}=e.distanceScales,o=GE(e,e.center),s=UE.Ellipsoid.WGS84.eastNorthUpToFixedFrame(o),u=e.unprojectPosition(e.cameraPosition),l=UE.Ellipsoid.WGS84.cartographicToCartesian(u,new el.Vector3),c=new el.Vector3(s.transformAsVector(new el.Vector3(r).scale(a))).normalize(),f=new el.Vector3(s.transformAsVector(new el.Vector3(i).scale(a))).normalize();Ije(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:cO,frameNumber:t,sseDenominator:1.15}}function qJ(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 Ije(e){let t=e.getFrustumPlanes(),r=UJ(t.near,e.cameraPosition),i=GE(e,r),n=GE(e,e.cameraPosition,lO),a=0;cO.planes[a++].fromPointNormal(i,LJ.copy(i).subtract(n));for(let o in t){if(o==="near")continue;let s=t[o],u=UJ(s,r,lO),l=GE(e,u,lO);cO.planes[a++].fromPointNormal(l,LJ.copy(i).subtract(l))}}function UJ(e,t,r=new el.Vector3){let i=e.normal.dot(t);return r.copy(e.normal).scale(e.distance-i).add(t),r}function GE(e,t,r=new el.Vector3){let i=e.unprojectPosition(t);return UE.Ellipsoid.WGS84.cartographicToCartesian(i,r)}var fO=Fe(dr()),zE=Fe(Zu()),GJ=Fe(Ra()),Pje=6378137,Oje=6378137,hO=6356752314245179e-9,zJ=new fO.Vector3;function HJ(e,t){if(e instanceof zE.OrientedBoundingBox){let{halfAxes:r}=e,i=Bje(r);return Math.log2(hO/(i+t[2]))}else if(e instanceof zE.BoundingSphere){let{radius:r}=e;return Math.log2(hO/(r+t[2]))}else if(e.width&&e.height){let{width:r,height:i}=e,n=Math.log2(Pje/r),a=Math.log2(Oje/i);return(n+a)/2}return 1}function dO(e,t,r){let i=GJ.Ellipsoid.WGS84.cartographicToCartesian([e.xmax,e.ymax,e.zmax],new fO.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(hO/(n+t[2]))}function WJ(e,t,r){let[i,n,a,o]=e;return dO({xmin:i,xmax:a,ymin:n,ymax:o,zmin:0,zmax:0},t,r)}function Bje(e){e.getColumn(0,zJ);let t=e.getColumn(1),r=e.getColumn(2);return zJ.add(t).add(r).len()}var ru=Fe(dr()),YE=Fe(Zu());var Va={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},ta;(function(r){r[r.ADD=1]="ADD",r[r.REPLACE=2]="REPLACE"})(ta||(ta={}));var tl;(function(n){n.EMPTY="empty",n.SCENEGRAPH="scenegraph",n.POINTCLOUD="pointcloud",n.MESH="mesh"})(tl||(tl={}));var En;(function(r){r.I3S="I3S",r.TILES3D="TILES3D"})(En||(En={}));var ic;(function(r){r.GEOMETRIC_ERROR="geometricError",r.MAX_SCREEN_THRESHOLD="maxScreenThreshold"})(ic||(ic={}));var VJ={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0};var jr=Fe(dr()),HE=Fe(Zu()),Km=Fe(Ra());function KJ(e){return e!=null}var Ca=new jr.Vector3,WE=new jr.Vector3,Dje=new jr.Vector3,Fje=new jr.Vector3;function Of(e,t,r){if(Ut(e,"3D Tile: boundingVolume must be defined"),e.box)return Mje(e.box,t,r);if(e.region){let[i,n,a,o,s,u]=e.region,l=Km.Ellipsoid.WGS84.cartographicToCartesian([(0,jr.degrees)(i),(0,jr.degrees)(o),s],Dje),c=Km.Ellipsoid.WGS84.cartographicToCartesian([(0,jr.degrees)(a),(0,jr.degrees)(n),u],Fje),f=new jr.Vector3().addVectors(l,c).multiplyScalar(.5),h=new jr.Vector3().subVectors(l,c).len()/2;return $J([f[0],f[1],f[2],h],new jr.Matrix4)}if(e.sphere)return $J(e.sphere,t,r);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function YJ(e,t){if(e.box)return jje(t);if(e.region){let[r,i,n,a,o,s]=e.region;return[[(0,jr.degrees)(r),(0,jr.degrees)(i),o],[(0,jr.degrees)(n),(0,jr.degrees)(a),s]]}if(e.sphere)return Lje(t);throw new Error("Unkown boundingVolume type")}function Mje(e,t,r){let i=new jr.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 jr.Quaternion;c.fromArray(e,6);let f=new jr.Vector3([1,0,0]),h=new jr.Vector3([0,1,0]),d=new jr.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 jr.Matrix3([a[0],a[1],a[2],o[0],o[1],o[2],s[0],s[1],s[2]]);return KJ(r)?(r.center=i,r.halfAxes=u,r):new HE.OrientedBoundingBox(i,u)}function $J(e,t,r){let i=new jr.Vector3(e[0],e[1],e[2]);t.transform(i,i);let n=t.getScale(WE),a=Math.max(Math.max(n[0],n[1]),n[2]),o=e[3]*a;return KJ(r)?(r.center=i,r.radius=o,r):new HE.BoundingSphere(i,o)}function jje(e){let t=XJ(),{halfAxes:r}=e,i=new jr.Vector3(r.getColumn(0)),n=new jr.Vector3(r.getColumn(1)),a=new jr.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++)Ca.copy(e.center),Ca.add(i),Ca.add(n),Ca.add(a),JJ(t,Ca),a.negate();n.negate()}i.negate()}return t}function Lje(e){let t=XJ(),{center:r,radius:i}=e,n=Km.Ellipsoid.WGS84.scaleToGeodeticSurface(r,Ca),a;n?a=Km.Ellipsoid.WGS84.geodeticSurfaceNormal(n):a=new jr.Vector3(0,0,1);let o=new jr.Vector3(a[2],-a[1],0);o.len()>0?o.normalize():o=new jr.Vector3(0,1,0);let s=o.clone().cross(a);for(let u of[o,s,a]){WE.copy(u).scale(i);for(let l=0;l<2;l++)Ca.copy(r),Ca.add(WE),JJ(t,Ca),WE.negate()}return t}function XJ(){return[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]]}function JJ(e,t){Km.Ellipsoid.WGS84.cartesianToCartographic(t,Ca),e[0][0]=Math.min(e[0][0],Ca[0]),e[0][1]=Math.min(e[0][1],Ca[1]),e[0][2]=Math.min(e[0][2],Ca[2]),e[1][0]=Math.max(e[1][0],Ca[0]),e[1][1]=Math.max(e[1][1],Ca[1]),e[1][2]=Math.max(e[1][2],Ca[2])}var nc=Fe(dr()),T_t=new nc.Vector3,k_t=new nc.Vector3,R_t=new nc.Matrix4,C_t=new nc.Vector3,I_t=new nc.Vector3,P_t=new nc.Vector3;function Nje(e,t){let r=e*t;return 1-Math.exp(-(r*r))}function qje(e,t){if(e.dynamicScreenSpaceError&&e.dynamicScreenSpaceErrorComputedDensity){let r=e.dynamicScreenSpaceErrorComputedDensity,i=e.dynamicScreenSpaceErrorFactor;return Nje(t,r)*i}return 0}function QJ(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-=qje(i,o),c}var ac=Fe(dr()),VE=Fe(Ra()),pO=new ac.Vector3,ZJ=new ac.Vector3,Bf=new ac.Vector3,eQ=new ac.Vector3,Uje=new ac.Vector3,mO=new ac.Matrix4,tQ=new ac.Matrix4;function rQ(e,t){if(e.lodMetricValue===0||isNaN(e.lodMetricValue))return"DIG";let r=2*gO(e,t);return r<2?"OUT":!e.header.children||r<=e.lodMetricValue?"DRAW":e.header.children?"DIG":"OUT"}function gO(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);VE.Ellipsoid.WGS84.cartographicToCartesian(u,pO),ZJ.copy(pO).subtract(s).normalize(),VE.Ellipsoid.WGS84.eastNorthUpToFixedFrame(s,mO),tQ.copy(mO).invert(),Bf.copy(pO).transform(tQ);let l=Math.sqrt(Bf[0]*Bf[0]+Bf[1]*Bf[1]),c=l*l/Bf[2];eQ.copy([Bf[0],Bf[1],c]);let h=eQ.transform(mO).subtract(s).normalize(),p=ZJ.cross(h).normalize().scale(o).add(s),y=VE.Ellipsoid.WGS84.cartesianToCartographic(p),g=r.project([n,i,a]),b=r.project(y);return Uje.copy(g).subtract(b).magnitude()}function iQ(e){return{assetGltfUpAxis:e.asset&&e.asset.gltfUpAxis||"Y"}}var KE=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 Ut(t<this._array.length),this._array[t]}set(t,r){Ut(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){Ut(t>=0),t>this._array.length&&(this._array.length=t)}resize(t){Ut(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 Gje={loadSiblings:!1,skipLevelOfDetail:!1,maximumScreenSpaceError:2,updateTransforms:!0,onTraversalEnd:()=>{},viewportTraversersMap:{},basePath:""},oc=class{constructor(t){this.root=null;this.selectedTiles={};this.requestedTiles={};this.emptyTiles={};this.lastUpdate=new Date().getTime();this.updateDebounceTime=1e3;this._traversalStack=new KE;this._emptyTraversalStack=new KE;this._frameNumber=null;this.options=ae(ae({},Gje),t)}traversalFinished(t){return!0}traverse(t,r,i){this.root=t,this.options=ae(ae({},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===ta.ADD?(this.loadTile(a,r),this.selectTile(a,r)):a.refine===ta.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===ta.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 nQ=new ru.Vector3;function zje(e){return e!=null}var sc=class{constructor(t,r,i,n=""){this.lodMetricType="geometricError";this.lodMetricValue=0;this.boundingVolume=null;this.content=null;this.contentState=Va.UNLOADED;this.gpuMemoryUsageInBytes=0;this.children=[];this.depth=0;this.viewportIds=[];this.transform=new ru.Matrix4;this.extensions=null;this.implicitTiling=null;this.userData={};this.hasEmptyContent=!1;this.hasTilesetContent=!1;this.traverser=new oc({});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 ru.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===Va.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===Va.UNLOADED}get contentExpired(){return this.contentState===Va.EXPIRED}get contentFailed(){return this.contentState===Va.FAILED}get distanceToCamera(){return this._distanceToCamera}get screenSpaceError(){return this._screenSpaceError}get boundingBox(){return this._boundingBox||(this._boundingBox=YJ(this.header.boundingVolume,this.boundingVolume)),this._boundingBox}getScreenSpaceError(t,r){switch(this.tileset.type){case En.I3S:return gO(this,t);case En.TILES3D:return QJ(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===ta.ADD||r;if(i&&!this.isVisible&&this._visible!==void 0||this.tileset._frameNumber-this._touchedFrame>=1||this.contentState===Va.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=Va.LOADING;let r=await this.tileset._requestScheduler.scheduleRequest(this.id,this._getPriority.bind(this));if(!r)return this.contentState=Va.UNLOADED,!1;try{let i=this.tileset.getTileUrl(this.contentUrl),n=this.tileset.loader,a=Je(ae({},this.tileset.loadOptions),{[n.id]:ae(Je(ae({},this.tileset.loadOptions[n.id]),{isTileset:this.type==="json"}),this._getLoaderSpecificOptions(n.id))});return this.content=await Wr(i,n,a),this.tileset.options.contentLoader&&await this.tileset.options.contentLoader(this),this._isTileset()&&this.tileset._initializeTileHeaders(this.content,this),this.contentState=Va.READY,this._onContentLoaded(),!0}catch(i){throw this.contentState=Va.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=Va.UNLOADED,!0}updateVisibility(t,r){if(this._frameNumber===t.frameNumber)return;let i=this.parent,n=i?i._visibilityPlaneMask:YE.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!==YE.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 nQ.subVectors(r.center,t.position),t.direction.dot(nQ)}insideViewerRequestVolume(t){let r=this._viewerRequestVolume;return!r||r.distanceSquaredTo(t.camera.position)<=0}updateExpiration(){if(zje(this._expireDate)&&this.contentReady&&!this.hasEmptyContent){let t=Date.now();Date.lessThan(this._expireDate,t)&&(this.contentState=Va.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 ru.Matrix4(t.transform):new ru.Matrix4;let r=this.parent,i=this.tileset,n=r&&r.computedTransform?r.computedTransform.clone():i.modelMatrix.clone();this.computedTransform=new ru.Matrix4(n).multiplyRight(this.transform);let a=r&&r._initialTransform?r._initialTransform.clone():new ru.Matrix4;this._initialTransform=new ru.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=Va.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=YE.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||ta.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=Of(t.boundingVolume,this.computedTransform,this.boundingVolume);let r=t.content;!r||(r.boundingVolume&&(this._contentBoundingVolume=Of(r.boundingVolume,this.computedTransform,this._contentBoundingVolume)),t.viewerRequestVolume&&(this._viewerRequestVolume=Of(t.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)))}_updateTransform(t=new ru.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 Je(ae({},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 iQ(this.tileset.tileset)}}};var vO=class extends oc{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===ta.REPLACE,a=t._optimChildrenWithinParent===VJ.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!==ta.ADD?!1:!this.shouldRefine(t,r,!0)}};var yO=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 bO={REQUESTED:"REQUESTED",COMPLETED:"COMPLETED",ERROR:"ERROR"},_O=class{constructor(){this.pendingTilesRegister=new yO;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:bO.REQUESTED},this.pendingTilesRegister.register(o,a),t().then(s=>{this._statusMap[r].status=bO.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=bO.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 xO=class extends oc{constructor(t){super(t);this._tileManager=new _O}traversalFinished(t){return!this._tileManager.hasPendingTiles(t.viewport.id,this._frameNumber||0)}shouldRefine(t,r){return t._lodJudge=rQ(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=Je(ae({},r.loadOptions),{i3s:Je(ae({},r.loadOptions.i3s),{isTileHeader:!0})});return await Wr(n,i,a)}_onTileLoad(t,r,i){let n=new sc(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 Hje={description:"",ellipsoid:Ym.Ellipsoid.WGS84,modelMatrix:new iu.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:{}},$E="Tiles In Tileset(s)",wO="Tiles In Memory",aQ="Tiles In View",oQ="Tiles To Render",sQ="Tiles Loaded",EO="Tiles Loading",uQ="Tiles Unloaded",lQ="Failed Tile Loads",cQ="Points/Vertices",SO="Tile Memory Use",XE=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 HP;this.updatePromise=null;this.options=ae(ae({},Hje),r),this.tileset=t,this.loader=t.loader,this.type=t.type,this.url=t.url,this.basePath=t.basePath||$s.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 ty({throttleRequests:this.options.throttleRequests,maxRequests:this.options.maxRequests}),this.stats=new Ry({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=ae(ae({},this.options),t)}setOptions(t){this.options=ae(ae({},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=NJ(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]=qJ(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(aQ).count=this.selectedTiles.length,this.stats.get(oQ).count=t,this.stats.get(cQ).count=r}async _initializeTileSet(t){this.type===En.I3S&&(this.calculateViewPropsI3S(),t.root=await t.root),this.root=this._initializeTileHeaders(t,null),this.type===En.TILES3D&&(this._initializeTiles3DTileset(t),this.calculateViewPropsTiles3D()),this.type===En.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 iu.Vector3(n+(a-n)/2,o+(s-o)/2,u+(l-u)/2),this.cartesianCenter=Ym.Ellipsoid.WGS84.cartographicToCartesian(this.cartographicCenter,new iu.Vector3),this.zoom=dO(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 iu.Vector3(n+(o-n)/2,a+(s-a)/2,0),this.cartesianCenter=Ym.Ellipsoid.WGS84.cartographicToCartesian(this.cartographicCenter,new iu.Vector3),this.zoom=WJ(r,this.cartographicCenter,this.cartesianCenter);return}console.warn("Extent is not defined in the tileset header"),this.cartographicCenter=new iu.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 iu.Vector3,this.zoom=1;return}r[0]!==0||r[1]!==0||r[2]!==0?this.cartographicCenter=Ym.Ellipsoid.WGS84.cartesianToCartographic(r,new iu.Vector3):this.cartographicCenter=new iu.Vector3(0,0,-Ym.Ellipsoid.WGS84.radii[0]),this.cartesianCenter=r,this.zoom=HJ(t.boundingVolume,this.cartographicCenter)}_initializeStats(){this.stats.get($E),this.stats.get(EO),this.stats.get(wO),this.stats.get(aQ),this.stats.get(oQ),this.stats.get(sQ),this.stats.get(uQ),this.stats.get(lQ),this.stats.get(cQ),this.stats.get(SO,"memory")}_initializeTileHeaders(t,r){var n;let i=new sc(this,t.root,r);if(r&&(r.children.push(i),i.depth=r.depth+1),this.type===En.TILES3D){let a=[];for(a.push(i);a.length>0;){let o=a.pop();this.stats.get($E).incrementCount();let s=o.header.children||[];for(let u of s){let l=new sc(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 En.TILES3D:t=vO;break;case En.I3S:t=xO;break;default:t=oc}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(lQ).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===En.I3S){let a=((n=(i=this.tileset)==null?void 0:i.nodePagesTile)==null?void 0:n.nodesInNodePages)||0;this.stats.get($E).reset(),this.stats.get($E).addCount(a)}t&&t.content&&dJ(t,t.content),this.updateContentTypes(t),this._addTileToCache(t),this.options.onTileLoad(t)}}updateContentTypes(t){var r;if(this.type===En.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===En.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(EO).incrementCount()}_onEndTileLoading(){this._pendingCount--,this.stats.get(EO).decrementCount()}_addTileToCache(t){this._cache.add(this,t,r=>r._updateCacheStats(t))}_updateCacheStats(t){this.stats.get(sQ).incrementCount(),this.stats.get(wO).incrementCount(),this.gpuMemoryUsageInBytes+=t.gpuMemoryUsageInBytes||0,this.stats.get(SO).count=this.gpuMemoryUsageInBytes}_unloadTile(t){this.gpuMemoryUsageInBytes-=t.gpuMemoryUsageInBytes||0,this.stats.get(wO).decrementCount(),this.stats.get(uQ).incrementCount(),this.stats.get(SO).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=ae(ae({},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"&&this.asset.version!=="1.1")throw new Error("The tileset must be 3D Tiles version either 0.0 or 1.0 or 1.1.");"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 JE="4.0.0-alpha.8";var xd={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"},Rxt=Object.keys(xd);function AO(e,t,r){Ut(e instanceof ArrayBuffer);let i=new TextDecoder("utf8"),n=new Uint8Array(e,t,r);return i.decode(n)}function fQ(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 QE="4.0.0-alpha.8";var Wje={draco:{decoderType:typeof WebAssembly=="object"?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}},hQ={name:"Draco",id:"draco",module:"draco",version:QE,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:Wje};function dQ(e){switch(e.constructor){case Int8Array:return"int8";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int16Array:return"int16";case Uint16Array:return"uint16";case Int32Array:return"int32";case Uint32Array:return"uint32";case Float32Array:return"float32";case Float64Array:return"float64";default:return"null"}}function TO(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 kO(e,t,r){let i=dQ(t.value),n=r||pQ(t);return{name:e,type:{type:"fixed-size-list",listSize:t.size,children:[{name:"value",type:i}]},nullable:!1,metadata:n}}function pQ(e){let t={};return"byteOffset"in e&&(t.byteOffset=e.byteOffset.toString(10)),"byteStride"in e&&(t.byteStride=e.byteStride.toString(10)),"normalized"in e&&(t.normalized=e.normalized.toString()),t}function mQ(e,t,r){let i=vQ(t.metadata),n=[],a=Vje(t.attributes);for(let o in e){let s=e[o],u=gQ(o,s,a[o]);n.push(u)}if(r){let o=gQ("indices",r);n.push(o)}return{fields:n,metadata:i}}function Vje(e){let t={};for(let r in e){let i=e[r];t[i.name||"undefined"]=i}return t}function gQ(e,t,r){let i=r?vQ(r.metadata):void 0;return kO(e,t,i)}function vQ(e){Object.entries(e);let t={};for(let r in e)t[`${r}.string`]=JSON.stringify(e[r]);return t}var yQ={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},Kje={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},Yje=4,ZE=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=TO(u.attributes),c=mQ(u.attributes,s,u.indices);return Je(ae({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*Yje,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),Jje(r)}finally{this.draco.destroy(r)}}_getAttributeValues(t,r){let i=Kje[r.data_type],n=r.num_components,o=t.num_points()*n,s=o*i.BYTES_PER_ELEMENT,u=$je(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 yQ)if(this.draco[o]===n)return yQ[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=Xje(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 $je(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 Xje(e){let t=e.size(),r=new Int32Array(t);for(let i=0;i<t;i++)r[i]=e.GetValue(i);return r}function Jje(e){let t=e.size(),r=new Int32Array(t);for(let i=0;i<t;i++)r[i]=e.GetValue(i);return r}var Qje="1.5.5",Zje="1.4.1",RO=`https://www.gstatic.com/draco/versioned/decoders/${Qje}`,eLe=`${RO}/draco_decoder.js`,tLe=`${RO}/draco_wasm_wrapper.js`,rLe=`${RO}/draco_decoder.wasm`,Jxt=`https://raw.githubusercontent.com/google/draco/${Zje}/javascript/draco_encoder.js`,jy;async function bQ(e){let t=e.modules||{};return t.draco3d?jy=jy||t.draco3d.createDecoderModule({}).then(r=>({draco:r})):jy=jy||iLe(e),await jy}async function iLe(e){let t,r;switch(e.draco&&e.draco.decoderType){case"js":t=await Hu(eLe,"draco",e);break;case"wasm":default:[t,r]=await Promise.all([await Hu(tLe,"draco",e),await Hu(rLe,"draco",e)])}return t=t||globalThis.DracoDecoderModule,await nLe(t,r)}function nLe(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(i=>{e(Je(ae({},r),{onModuleLoaded:n=>i({draco:n})}))})}var Ly={id:"draco-writer",name:"Draco compressed geometry writer",module:"draco",version:QE,worker:!0,options:{draco:{},source:null}};var $m=Je(ae({},hQ),{parse:aLe});async function aLe(e,t){let{draco:r}=await bQ(t),i=new ZE(r);try{return i.parseSync(e,t==null?void 0:t.draco)}finally{i.destroy()}}var oLe={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},ln={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},Zt=ae(ae({},oLe),ln);var CO={[ln.DOUBLE]:Float64Array,[ln.FLOAT]:Float32Array,[ln.UNSIGNED_SHORT]:Uint16Array,[ln.UNSIGNED_INT]:Uint32Array,[ln.UNSIGNED_BYTE]:Uint8Array,[ln.BYTE]:Int8Array,[ln.SHORT]:Int16Array,[ln.INT]:Int32Array},sLe={DOUBLE:ln.DOUBLE,FLOAT:ln.FLOAT,UNSIGNED_SHORT:ln.UNSIGNED_SHORT,UNSIGNED_INT:ln.UNSIGNED_INT,UNSIGNED_BYTE:ln.UNSIGNED_BYTE,BYTE:ln.BYTE,SHORT:ln.SHORT,INT:ln.INT},IO="Failed to convert GL type",Ka=class{static fromTypedArray(t){t=ArrayBuffer.isView(t)?t.constructor:t;for(let r in CO)if(CO[r]===t)return r;throw new Error(IO)}static fromName(t){let r=sLe[t];if(!r)throw new Error(IO);return r}static getArrayType(t){switch(t){case ln.UNSIGNED_SHORT_5_6_5:case ln.UNSIGNED_SHORT_4_4_4_4:case ln.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:let r=CO[t];if(!r)throw new Error(IO);return r}}static getByteSize(t){return Ka.getArrayType(t).BYTES_PER_ELEMENT}static validate(t){return Boolean(Ka.getArrayType(t))}static createTypedArray(t,r,i=0,n){n===void 0&&(n=(r.byteLength-i)/Ka.getByteSize(t));let a=Ka.getArrayType(t);return new a(r,i,n)}};function _Q(e,t){if(!e)throw new Error(`math.gl assertion failed. ${t}`)}function PO(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 uc=Fe(dr());var cwt=1/256;var fwt=new uc.Vector2,hwt=new uc.Vector3,dwt=new uc.Vector2,pwt=new uc.Vector2,mwt=new Uint8Array(1);function xQ(e,t=255){return(0,uc.clamp)(e,0,t)/t*2-1}function wQ(e){return e<0?-1:1}function EQ(e,t,r,i){if(_Q(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=xQ(e,r),i.y=xQ(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))*wQ(n),i.y=(1-Math.abs(n))*wQ(i.y)}return i.normalize()}function OO(e,t,r){return EQ(e,t,255,r)}var FO=Fe(dr());var Df=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=Zt.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=Ka.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=Ka.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=Ka.createTypedArray(r,i),n[t]=a),a}};var uLe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},lLe={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]]},cLe={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 SQ(e,t,r,i){let{componentType:n}=e;Ut(e.componentType);let a=typeof n=="string"?Ka.fromName(n):n,o=uLe[e.type],s=lLe[e.type],u=cLe[e.type];return r+=e.byteOffset,{values:Ka.createTypedArray(a,t,r,o*i),type:a,size:o,unpacker:s,packer:u}}var rl=e=>e!==void 0;function AQ(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?fLe(i,r):null}function fLe(e,t){let r,i,n,a=e.instancesLength,o=e.classes,s=e.classIds,u=e.parentCounts,l=e.parentIds,c=a;rl(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(rl(u))for(rl(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];rl(l)&&rl(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 pLe(y),y}function Xm(e,t,r){if(!e)return;let i=e.parentCounts;return e.parentIds?r(e,t):i>0?hLe(e,t,r):dLe(e,t,r)}function hLe(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(rl(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 dLe(e,t,r){let i=!0;for(;i;){let n=r(e,t);if(rl(n))return n;let a=e.parentIds[t];i=a!==t,t=a}throw new Error("traverseHierarchySingleParent")}function pLe(e){let t=[],i=e.classIds.length;for(let n=0;n<i;++n)TQ(e,n,stack)}function TQ(e,t,r){let i=e.parentCounts,n=e.parentIds,a=e.parentIndexes,s=e.classIds.length;if(!rl(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=rl(i)?i[t]:1,l=rl(i)?a[t]:t;for(let c=0;c<u;++c){let f=n[l+c];f!==t&&TQ(e,f,r)}r.pop(t)}function uo(e){return e!=null}var eS=(e,t)=>e,mLe={HIERARCHY:!0,extensions:!0,extras:!0},Jm=class{constructor(t,r,i,n={}){var a;Ut(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)mLe[o]||(this._properties[o]=this.json[o]);this._binaryProperties=this._initializeBinaryProperties(),n["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=AQ(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),Ut(typeof r=="string",r),this._hierarchy){let i=Xm(this._hierarchy,t,(n,a)=>{let o=n.classIds[a];return n.classes[o].name===r});return uo(i)}return!1}isExactClass(t,r){return Ut(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),Ut(typeof r=="string",r),uo(this._properties[r])||this._hasPropertyInHierarchy(t,r)}getPropertyNames(t,r){this._checkBatchId(t),r=uo(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),Ut(typeof r=="string",r),this._binaryProperties){let n=this._binaryProperties[r];if(uo(n))return this._getBinaryProperty(n,t)}let i=this._properties[r];if(uo(i))return eS(i[t],!0);if(this._hierarchy){let n=this._getHierarchyProperty(t,r);if(uo(n))return n}}setProperty(t,r,i){let n=this.featureCount;if(this._checkBatchId(t),Ut(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];uo(a)||(this._properties[r]=new Array(n),a=this._properties[r]),a[t]=eS(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;Ut(this.binary,`Property ${t} requires a batch table binary.`),Ut(i.type,`Property ${t} requires a type.`);let n=SQ(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=Xm(this._hierarchy,t,(n,a)=>{let o=n.classIds[a],s=n.classes[o].instances;return uo(s[r])});return uo(i)}_getPropertyNamesInHierarchy(t,r){Xm(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 Xm(this._hierarchy,t,(i,n)=>{let a=i.classIds[n],o=i.classes[a],s=i.classIndexes[n],u=o.instances[r];return uo(u)?uo(u.typedArray)?this._getBinaryProperty(u,s):eS(u[s],!0):null})}_setHierarchyProperty(t,r,i,n){let a=Xm(this._hierarchy,r,(o,s)=>{let u=o.classIds[s],l=o.classes[u],c=o.classIndexes[s],f=l.instances[i];return uo(f)?(Ut(s===r,`Inherited property "${i}" is read-only.`),uo(f.typedArray)?this._setBinaryProperty(f,c,n):f[c]=eS(n,!0),!0):!1});return uo(a)}};var BO=4;function Ff(e,t,r=0){let i=new DataView(t);if(e.magic=i.getUint32(r,!0),r+=BO,e.version=i.getUint32(r,!0),r+=BO,e.byteLength=i.getUint32(r,!0),r+=BO,e.version!==1)throw new Error(`3D Tile Version ${e.version} not supported`);return r}var Qm=4,kQ="b3dm tile in legacy format.";function Zm(e,t,r){let i=new DataView(t),n;e.header=e.header||{};let a=i.getUint32(r,!0);r+=Qm;let o=i.getUint32(r,!0);r+=Qm;let s=i.getUint32(r,!0);r+=Qm;let u=i.getUint32(r,!0);return r+=Qm,s>=570425344?(r-=Qm*2,n=a,s=o,u=0,a=0,o=0,console.warn(kQ)):u>=570425344&&(r-=Qm,n=s,s=a,u=o,a=0,o=0,console.warn(kQ)),e.header.featureTableJsonByteLength=a,e.header.featureTableBinaryByteLength=o,e.header.batchTableJsonByteLength=s,e.header.batchTableBinaryByteLength=u,e.header.batchLength=n,r}function eg(e,t,r,i){return r=gLe(e,t,r,i),r=vLe(e,t,r,i),r}function gLe(e,t,r,i){let{featureTableJsonByteLength:n,featureTableBinaryByteLength:a,batchLength:o}=e.header||{};if(e.featureTableJson={BATCH_LENGTH:o||0},n&&n>0){let s=AO(t,r,n);e.featureTableJson=JSON.parse(s)}return r+=n||0,e.featureTableBinary=new Uint8Array(t,r,a),r+=a||0,r}function vLe(e,t,r,i){let{batchTableJsonByteLength:n,batchTableBinaryByteLength:a}=e.header||{};if(n&&n>0){let o=AO(t,r,n);e.batchTableJson=JSON.parse(o),r+=n,a&&a>0&&(e.batchTableBinary=new Uint8Array(t,r,a),e.batchTableBinary=new Uint8Array(e.batchTableBinary),r+=a)}return r}function DO(e,t,r){if(!t&&(!e||!e.batchIds||!r))return null;let{batchIds:i,isRGB565:n,pointCount:a=0}=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:Zt.UNSIGNED_BYTE,value:o,size:3,normalized:!0}}if(t&&n){let o=new Uint8ClampedArray(a*3);for(let s=0;s<a;s++){let u=PO(t[s]);o[s*3]=u[0],o[s*3+1]=u[1],o[s*3+2]=u[2]}return{type:Zt.UNSIGNED_BYTE,value:o,size:3,normalized:!0}}return t&&t.length===a*3?{type:Zt.UNSIGNED_BYTE,value:t,size:3,normalized:!0}:{type:Zt.UNSIGNED_BYTE,value:t||new Uint8ClampedArray,size:4,normalized:!0}}var RQ=Fe(dr());var CQ=new RQ.Vector3;function IQ(e,t){if(!t)return null;if(e.isOctEncoded16P){let r=new Float32Array((e.pointsLength||0)*3);for(let i=0;i<(e.pointsLength||0);i++)OO(t[i*2],t[i*2+1],CQ),CQ.toArray(r,i*3);return{type:Zt.FLOAT,size:2,value:r}}return{type:Zt.FLOAT,size:2,value:t}}var PQ=Fe(dr());function OQ(e,t,r){return e.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(e.isQuantized=!1,yLe(e,t)):{type:Zt.UNSIGNED_SHORT,value:t,size:3,normalized:!0}:t}function yLe(e,t){let r=new PQ.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 BQ(e,t,r,i,n){r=Ff(e,t,r),r=Zm(e,t,r),r=eg(e,t,r,i),bLe(e);let{featureTable:a,batchTable:o}=_Le(e);return await ALe(e,a,o,i,n),xLe(e,a,i),wLe(e,a,o),ELe(e,a),r}function bLe(e){e.attributes={positions:null,colors:null,normals:null,batchIds:null},e.isQuantized=!1,e.isTranslucent=!1,e.isRGB565=!1,e.isOctEncoded16P=!1}function _Le(e){let t=new Df(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",Zt.FLOAT,3);let i=SLe(e,t);return{featureTable:t,batchTable:i}}function xLe(e,t,r){if(e.attributes=e.attributes||{positions:null,colors:null,normals:null,batchIds:null},!e.attributes.positions){if(t.hasProperty("POSITION"))e.attributes.positions=t.getPropertyArray("POSITION",Zt.FLOAT,3);else if(t.hasProperty("POSITION_QUANTIZED")){let i=t.getPropertyArray("POSITION_QUANTIZED",Zt.UNSIGNED_SHORT,3);if(e.isQuantized=!0,e.quantizedRange=(1<<16)-1,e.quantizedVolumeScale=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Zt.FLOAT,3),!e.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(e.quantizedVolumeOffset=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Zt.FLOAT,3),!e.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");e.attributes.positions=OQ(e,i,r)}}if(!e.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function wLe(e,t,r){if(e.attributes=e.attributes||{positions:null,colors:null,normals:null,batchIds:null},!e.attributes.colors){let i=null;t.hasProperty("RGBA")?(i=t.getPropertyArray("RGBA",Zt.UNSIGNED_BYTE,4),e.isTranslucent=!0):t.hasProperty("RGB")?i=t.getPropertyArray("RGB",Zt.UNSIGNED_BYTE,3):t.hasProperty("RGB565")&&(i=t.getPropertyArray("RGB565",Zt.UNSIGNED_SHORT,1),e.isRGB565=!0),e.attributes.colors=DO(e,i,r)}t.hasProperty("CONSTANT_RGBA")&&(e.constantRGBA=t.getGlobalProperty("CONSTANT_RGBA",Zt.UNSIGNED_BYTE,4))}function ELe(e,t){if(e.attributes=e.attributes||{positions:null,colors:null,normals:null,batchIds:null},!e.attributes.normals){let r=null;t.hasProperty("NORMAL")?r=t.getPropertyArray("NORMAL",Zt.FLOAT,3):t.hasProperty("NORMAL_OCT16P")&&(r=t.getPropertyArray("NORMAL_OCT16P",Zt.UNSIGNED_BYTE,2),e.isOctEncoded16P=!0),e.attributes.normals=IQ(e,r)}}function SLe(e,t){let r=null;if(!e.batchIds&&t.hasProperty("BATCH_ID")&&(e.batchIds=t.getPropertyArray("BATCH_ID",Zt.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 Jm(n,a,i)}return r}async function ALe(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:ae(ae({},o),s),featureTableProperties:o,batchTableProperties:s,dequantizeInShader:!1};return await TLe(e,c,i,n)}async function TLe(e,t,r,i){if(!i)return;let{parse:n}=i,a=Je(ae({},r),{draco:Je(ae({},r==null?void 0:r.draco),{extraAttributes:t.batchTableProperties||{}})});delete a["3d-tiles"];let o=await n(t.buffer,$m,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 FO.Vector3(y,y,y),e.quantizedVolumeOffset=new FO.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=ae({positions:s,colors:DO(e,u,void 0),normals:l,batchIds:c},d)}var DQ="4.0.0-alpha.8";var tS="4.0.0-alpha.8";var{_parseImageNode:kLe}=globalThis,MO=typeof Image!="undefined",jO=typeof ImageBitmap!="undefined",RLe=Boolean(kLe),LO=on?!0:RLe;function FQ(e){switch(e){case"auto":return jO||MO||LO;case"imagebitmap":return jO;case"image":return MO;case"data":return LO;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function MQ(){if(jO)return"imagebitmap";if(MO)return"image";if(LO)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function jQ(e){let t=CLe(e);if(!t)throw new Error("Not an image");return t}function NO(e){return tg(e)}function tg(e){switch(jQ(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 CLe(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 ILe=/^data:image\/svg\+xml/,PLe=/\.svg((\?|#).*)?$/;function rS(e){return e&&(ILe.test(e)||PLe.test(e))}function LQ(e,t){if(rS(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 qO(e,t)}function qO(e,t){if(rS(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function Ny(e,t,r){let i=LQ(e,r),n=self.URL||self.webkitURL,a=typeof i!="string"&&n.createObjectURL(i);try{return await OLe(a||i,t)}finally{a&&n.revokeObjectURL(a)}}async function OLe(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 BLe={},NQ=!0;async function UO(e,t,r){let i;rS(r)?i=await Ny(e,t,r):i=qO(e,r);let n=t&&t.imagebitmap;return await DLe(i,n)}async function DLe(e,t=null){if((FLe(t)||!NQ)&&(t=null),t)try{return await createImageBitmap(e,t)}catch(r){console.warn(r),NQ=!1}return await createImageBitmap(e)}function FLe(e){for(let t in e||BLe)return!1;return!0}function qQ(e){return!NLe(e,"ftyp",4)||(e[8]&96)==0?null:MLe(e)}function MLe(e){switch(jLe(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function jLe(e,t,r){return String.fromCharCode(...e.slice(t,r))}function LLe(e){return[...e].map(t=>t.charCodeAt(0))}function NLe(e,t,r=0){let i=LLe(t);for(let n=0;n<i.length;++n)if(i[n]!==e[n+r])return!1;return!0}var il=!1,qy=!0;function wd(e){let t=Uy(e);return ULe(t)||HLe(t)||GLe(t)||zLe(t)||qLe(t)}function qLe(e){let t=new Uint8Array(e instanceof DataView?e.buffer:e),r=qQ(t);return r?{mimeType:r.mimeType,width:0,height:0}:null}function ULe(e){let t=Uy(e);return t.byteLength>=24&&t.getUint32(0,il)===2303741511?{mimeType:"image/png",width:t.getUint32(16,il),height:t.getUint32(20,il)}:null}function GLe(e){let t=Uy(e);return t.byteLength>=10&&t.getUint32(0,il)===1195984440?{mimeType:"image/gif",width:t.getUint16(6,qy),height:t.getUint16(8,qy)}:null}function zLe(e){let t=Uy(e);return t.byteLength>=14&&t.getUint16(0,il)===16973&&t.getUint32(2,qy)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,qy),height:t.getUint32(22,qy)}:null}function HLe(e){let t=Uy(e);if(!(t.byteLength>=3&&t.getUint16(0,il)===65496&&t.getUint8(2)===255))return null;let{tableMarkers:i,sofMarkers:n}=WLe(),a=2;for(;a+9<t.byteLength;){let o=t.getUint16(a,il);if(n.has(o))return{mimeType:"image/jpeg",height:t.getUint16(a+5,il),width:t.getUint16(a+7,il)};if(!i.has(o))return null;a+=2,a+=t.getUint16(a,il)}return null}function WLe(){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 Uy(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 GO(e,t){let{mimeType:r}=wd(e)||{},i=globalThis._parseImageNode;return Ut(i),await i(e,r)}async function zO(e,t,r){t=t||{};let n=(t.image||{}).type||"auto",{url:a}=r||{},o=VLe(n),s;switch(o){case"imagebitmap":s=await UO(e,t,a);break;case"image":s=await Ny(e,t,a);break;case"data":s=await GO(e,t);break;default:Ut(!1)}return n==="data"&&(s=tg(s)),s}function VLe(e){switch(e){case"auto":case"data":return MQ();default:return FQ(e),e}}var KLe=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],YLe=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],$Le={image:{type:"auto",decode:!0}},rg={id:"image",module:"images",name:"Images",version:tS,mimeTypes:YLe,extensions:KLe,parse:zO,tests:[e=>Boolean(wd(new DataView(e)))],options:$Le};var{_encodeImageNode:UQ}=globalThis;async function GQ(e,t){return t=t||{},t.image=t.image||{},UQ?UQ(e,{type:t.image.mimeType}):XLe(e,t)}var zQ=!0;async function XLe(e,t){let{mimeType:r,jpegQuality:i}=t.image,{width:n,height:a}=NO(e),o=document.createElement("canvas");o.width=n,o.height=a,JLe(e,o);let s=await new Promise(u=>{if(i&&zQ)try{o.toBlob(u,r,i);return}catch{zQ=!1}o.toBlob(u,r)});if(!s)throw new Error("image encoding failed");return await s.arrayBuffer()}function JLe(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 HO={name:"Images",id:"image",module:"images",version:tS,extensions:["jpeg"],options:{image:{mimeType:"image/png",jpegQuality:null}},encode:GQ};var WO={};function VO(e){if(WO[e]===void 0){let t=on?ZLe(e):QLe(e);WO[e]=t}return WO[e]}function QLe(e){let t=["image/png","image/jpeg","image/gif"],{_parseImageNode:r,_imageFormatsNode:i=t}=globalThis;return Boolean(r)&&i.includes(e)}function ZLe(e){switch(e){case"image/avif":case"image/webp":return e4e(e);default:return!0}}function e4e(e){try{return document.createElement("canvas").toDataURL(e).indexOf(`data:${e}`)===0}catch{return!1}}var ig="4.0.0-alpha.8";var HQ="4.0.0-alpha.8",t4e=`https://unpkg.com/@loaders.gl/textures@${HQ}/dist/libs/basis_encoder.wasm`,r4e=`https://unpkg.com/@loaders.gl/textures@${HQ}/dist/libs/basis_encoder.js`,KO;async function YO(e){let t=e.modules||{};return t.basis?t.basis:(KO=KO||i4e(e),await KO)}async function i4e(e){let t=null,r=null;return[t,r]=await Promise.all([await Hu("basis_transcoder.js","textures",e),await Hu("basis_transcoder.wasm","textures",e)]),t=t||globalThis.BASIS,await n4e(t,r)}function n4e(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 $O;async function XO(e){let t=e.modules||{};return t.basisEncoder?t.basisEncoder:($O=$O||a4e(e),await $O)}async function a4e(e){let t=null,r=null;return[t,r]=await Promise.all([await Hu(r4e,"textures",e),await Hu(t4e,"textures",e)]),t=t||globalThis.BASIS,await o4e(t,r)}function o4e(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 Se={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 s4e=["","WEBKIT_","MOZ_"],WQ={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"},iS=null;function Gy(e){if(!iS){e=e||u4e()||void 0,iS=new Set;for(let t of s4e)for(let r in WQ)if(e&&e.getExtension(`${t}${r}`)){let i=WQ[r];iS.add(i)}}return iS}function u4e(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var iZ=Fe(tZ());function ng(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=f4e(t,i,n,e,o),u=c4e(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 c4e(e,t,r,i){return Array.isArray(e)?e[t].levelData:new Uint8Array(e.buffer,e.byteOffset+r,i)}function f4e(e,t,r,i,n){return Array.isArray(i)?e.sizeFunction(i[n]):e.sizeFunction(t,r)}var h4e={131:Se.COMPRESSED_RGB_S3TC_DXT1_EXT,132:Se.COMPRESSED_SRGB_S3TC_DXT1_EXT,133:Se.COMPRESSED_RGBA_S3TC_DXT1_EXT,134:Se.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,135:Se.COMPRESSED_RGBA_S3TC_DXT3_EXT,136:Se.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,137:Se.COMPRESSED_RGBA_S3TC_DXT5_EXT,138:Se.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,139:Se.COMPRESSED_RED_RGTC1_EXT,140:Se.COMPRESSED_SIGNED_RED_RGTC1_EXT,141:Se.COMPRESSED_RED_GREEN_RGTC2_EXT,142:Se.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,147:Se.COMPRESSED_RGB8_ETC2,148:Se.COMPRESSED_SRGB8_ETC2,149:Se.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,150:Se.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,151:Se.COMPRESSED_RGBA8_ETC2_EAC,152:Se.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,153:Se.COMPRESSED_R11_EAC,154:Se.COMPRESSED_SIGNED_R11_EAC,155:Se.COMPRESSED_RG11_EAC,156:Se.COMPRESSED_SIGNED_RG11_EAC,157:Se.COMPRESSED_RGBA_ASTC_4x4_KHR,158:Se.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,159:Se.COMPRESSED_RGBA_ASTC_5x4_KHR,160:Se.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR,161:Se.COMPRESSED_RGBA_ASTC_5x5_KHR,162:Se.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,163:Se.COMPRESSED_RGBA_ASTC_6x5_KHR,164:Se.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,165:Se.COMPRESSED_RGBA_ASTC_6x6_KHR,166:Se.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,167:Se.COMPRESSED_RGBA_ASTC_8x5_KHR,168:Se.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,169:Se.COMPRESSED_RGBA_ASTC_8x6_KHR,170:Se.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,171:Se.COMPRESSED_RGBA_ASTC_8x8_KHR,172:Se.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,173:Se.COMPRESSED_RGBA_ASTC_10x5_KHR,174:Se.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,175:Se.COMPRESSED_RGBA_ASTC_10x6_KHR,176:Se.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,177:Se.COMPRESSED_RGBA_ASTC_10x8_KHR,178:Se.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,179:Se.COMPRESSED_RGBA_ASTC_10x10_KHR,180:Se.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,181:Se.COMPRESSED_RGBA_ASTC_12x10_KHR,182:Se.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,183:Se.COMPRESSED_RGBA_ASTC_12x12_KHR,184:Se.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,1000054e3:Se.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,1000054001:Se.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,1000066e3:Se.COMPRESSED_RGBA_ASTC_4x4_KHR,1000066001:Se.COMPRESSED_RGBA_ASTC_5x4_KHR,1000066002:Se.COMPRESSED_RGBA_ASTC_5x5_KHR,1000066003:Se.COMPRESSED_RGBA_ASTC_6x5_KHR,1000066004:Se.COMPRESSED_RGBA_ASTC_6x6_KHR,1000066005:Se.COMPRESSED_RGBA_ASTC_8x5_KHR,1000066006:Se.COMPRESSED_RGBA_ASTC_8x6_KHR,1000066007:Se.COMPRESSED_RGBA_ASTC_8x8_KHR,1000066008:Se.COMPRESSED_RGBA_ASTC_10x5_KHR,1000066009:Se.COMPRESSED_RGBA_ASTC_10x6_KHR,1000066010:Se.COMPRESSED_RGBA_ASTC_10x8_KHR,1000066011:Se.COMPRESSED_RGBA_ASTC_10x10_KHR,1000066012:Se.COMPRESSED_RGBA_ASTC_12x10_KHR,1000066013:Se.COMPRESSED_RGBA_ASTC_12x12_KHR};function rZ(e){return h4e[e]}var ko=[171,75,84,88,32,50,48,187,13,10,26,10];function uS(e){let t=new Uint8Array(e);return!(t.byteLength<ko.length||t[0]!==ko[0]||t[1]!==ko[1]||t[2]!==ko[2]||t[3]!==ko[3]||t[4]!==ko[4]||t[5]!==ko[5]||t[6]!==ko[6]||t[7]!==ko[7]||t[8]!==ko[8]||t[9]!==ko[9]||t[10]!==ko[10]||t[11]!==ko[11])}function nZ(e){let t=new Uint8Array(e),r=(0,iZ.read)(t),i=Math.max(1,r.levels.length),n=r.pixelWidth,a=r.pixelHeight,o=rZ(r.vkFormat);return ng(r.levels,{mipMapLevels:i,width:n,height:a,sizeFunction:s=>s.uncompressedByteLength,internalFormat:o})}var d4e={etc1:{basisFormat:0,compressed:!0,format:Se.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:Se.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:Se.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:Se.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:Se.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:Se.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 Hy(e,t){if(t.basis.containerFormat==="auto"){if(uS(e)){let i=await XO(t);return aZ(i.KTX2File,e,t)}let{BasisFile:r}=await YO(t);return tB(r,e,t)}switch(t.basis.module){case"encoder":let r=await XO(t);switch(t.basis.containerFormat){case"ktx2":return aZ(r.KTX2File,e,t);case"basis":default:return tB(r.BasisFile,e,t)}case"transcoder":default:let{BasisFile:i}=await YO(t);return tB(i,e,t)}}function tB(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(p4e(i,o,l,r));a.push(u)}return a}finally{i.close(),i.delete()}}function p4e(e,t,r,i){let n=e.getImageWidth(t,r),a=e.getImageHeight(t,r),o=e.getHasAlpha(),{compressed:s,format:u,basisFormat:l}=oZ(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 aZ(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(m4e(i,o,r));break}return[a]}finally{i.close(),i.delete()}}function m4e(e,t,r){let{alphaFlag:i,height:n,width:a}=e.getImageLevelInfo(t,0,0),{compressed:o,format:s,basisFormat:u}=oZ(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 oZ(e,t){let r=e&&e.basis&&e.basis.format;return r==="auto"&&(r=ag()),typeof r=="object"&&(r=t?r.alpha:r.noAlpha),r=r.toLowerCase(),d4e[r]}function ag(){let e=Gy();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 sZ={name:"Basis",id:"basis",module:"textures",version:ig,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"}}},Ed=Je(ae({},sZ),{parse:Hy});var Ro={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},g4e={DXT1:Se.COMPRESSED_RGB_S3TC_DXT1_EXT,DXT3:Se.COMPRESSED_RGBA_S3TC_DXT3_EXT,DXT5:Se.COMPRESSED_RGBA_S3TC_DXT5_EXT,"ATC ":Se.COMPRESSED_RGB_ATC_WEBGL,ATCA:Se.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,ATCI:Se.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL},v4e=cZ,y4e=lS,b4e=lS,_4e={DXT1:cZ,DXT3:lS,DXT5:lS,"ATC ":v4e,ATCA:y4e,ATCI:b4e};function uZ(e){return new Uint32Array(e,0,Ro.HEADER_LENGTH)[Ro.MAGIC_NUMBER_INDEX]===Ro.MAGIC_NUMBER}function lZ(e){let t=new Int32Array(e,0,Ro.HEADER_LENGTH),r=t[Ro.HEADER_PF_FOURCC_INDEX];Ut(Boolean(t[Ro.HEADER_PF_FLAGS_INDEX]&Ro.DDPF_FOURCC),"DDS: Unsupported format, must contain a FourCC code");let i=x4e(r),n=g4e[i],a=_4e[i];Ut(n&&a,`DDS: Unknown pixel format ${r}`);let o=1;t[Ro.HEADER_FLAGS_INDEX]&Ro.DDSD_MIPMAPCOUNT&&(o=Math.max(1,t[Ro.MIPMAPCOUNT_INDEX]));let s=t[Ro.HEADER_WIDTH_INDEX],u=t[Ro.HEADER_HEIGHT_INDEX],l=t[Ro.HEADER_SIZE_INDEX]+4,c=new Uint8Array(e,l);return ng(c,{mipMapLevels:o,width:s,height:u,sizeFunction:a,internalFormat:n})}function cZ(e,t){return(e+3>>2)*(t+3>>2)*8}function lS(e,t){return(e+3>>2)*(t+3>>2)*16}function x4e(e){return String.fromCharCode(e&255,e>>8&255,e>>16&255,e>>24&255)}var us={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},w4e={0:[Se.COMPRESSED_RGB_PVRTC_2BPPV1_IMG],1:[Se.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG],2:[Se.COMPRESSED_RGB_PVRTC_4BPPV1_IMG],3:[Se.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG],6:[Se.COMPRESSED_RGB_ETC1_WEBGL],7:[Se.COMPRESSED_RGB_S3TC_DXT1_EXT],9:[Se.COMPRESSED_RGBA_S3TC_DXT3_EXT],11:[Se.COMPRESSED_RGBA_S3TC_DXT5_EXT],22:[Se.COMPRESSED_RGB8_ETC2],23:[Se.COMPRESSED_RGBA8_ETC2_EAC],24:[Se.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2],25:[Se.COMPRESSED_R11_EAC],26:[Se.COMPRESSED_RG11_EAC],27:[Se.COMPRESSED_RGBA_ASTC_4X4_KHR,Se.COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR],28:[Se.COMPRESSED_RGBA_ASTC_5X4_KHR,Se.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR],29:[Se.COMPRESSED_RGBA_ASTC_5X5_KHR,Se.COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR],30:[Se.COMPRESSED_RGBA_ASTC_6X5_KHR,Se.COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR],31:[Se.COMPRESSED_RGBA_ASTC_6X6_KHR,Se.COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR],32:[Se.COMPRESSED_RGBA_ASTC_8X5_KHR,Se.COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR],33:[Se.COMPRESSED_RGBA_ASTC_8X6_KHR,Se.COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR],34:[Se.COMPRESSED_RGBA_ASTC_8X8_KHR,Se.COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR],35:[Se.COMPRESSED_RGBA_ASTC_10X5_KHR,Se.COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR],36:[Se.COMPRESSED_RGBA_ASTC_10X6_KHR,Se.COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR],37:[Se.COMPRESSED_RGBA_ASTC_10X8_KHR,Se.COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR],38:[Se.COMPRESSED_RGBA_ASTC_10X10_KHR,Se.COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR],39:[Se.COMPRESSED_RGBA_ASTC_12X10_KHR,Se.COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR],40:[Se.COMPRESSED_RGBA_ASTC_12X12_KHR,Se.COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR]},E4e={0:dZ,1:dZ,2:pZ,3:pZ,6:Wy,7:Wy,9:Vy,11:Vy,22:Wy,23:Vy,24:Wy,25:Wy,26:Vy,27:Vy,28:S4e,29:A4e,30:T4e,31:k4e,32:R4e,33:C4e,34:I4e,35:P4e,36:O4e,37:B4e,38:D4e,39:F4e,40:M4e};function fZ(e){let r=new Uint32Array(e,0,us.HEADER_LENGTH)[us.MAGIC_NUMBER_INDEX];return r===us.MAGIC_NUMBER||r===us.MAGIC_NUMBER_EXTRA}function hZ(e){let t=new Uint32Array(e,0,us.HEADER_LENGTH),r=t[us.PIXEL_FORMAT_INDEX],i=t[us.COLOUR_SPACE_INDEX],n=w4e[r]||[],a=n.length>1&&i?n[1]:n[0],o=E4e[r],s=t[us.MIPMAPCOUNT_INDEX],u=t[us.WIDTH_INDEX],l=t[us.HEIGHT_INDEX],c=us.HEADER_SIZE+t[us.METADATA_SIZE_INDEX],f=new Uint8Array(e,c);return ng(f,{mipMapLevels:s,width:u,height:l,sizeFunction:o,internalFormat:a})}function dZ(e,t){return e=Math.max(e,16),t=Math.max(t,8),e*t/4}function pZ(e,t){return e=Math.max(e,8),t=Math.max(t,8),e*t/2}function Wy(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8}function Vy(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16}function S4e(e,t){return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16}function A4e(e,t){return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16}function T4e(e,t){return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16}function k4e(e,t){return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16}function R4e(e,t){return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16}function C4e(e,t){return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16}function I4e(e,t){return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16}function P4e(e,t){return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16}function O4e(e,t){return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16}function B4e(e,t){return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16}function D4e(e,t){return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16}function F4e(e,t){return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16}function M4e(e,t){return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16}function mZ(e){if(uS(e))return nZ(e);if(uZ(e))return lZ(e);if(fZ(e))return hZ(e);throw new Error("Texture container format not recognized")}var j4e={"compressed-texture":{libraryPath:"libs/",useBasis:!1}},gZ={name:"Texture Containers",id:"compressed-texture",module:"textures",version:ig,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:j4e},cS=Je(ae({},gZ),{parse:async(e,t)=>t["compressed-texture"].useBasis?(t.basis=Je(ae({format:{alpha:"BC3",noAlpha:"BC1"}},t.basis),{containerFormat:"ktx2",module:"encoder"}),(await Hy(e,t))[0]):mZ(e)});var fS={name:"Basis Universal Supercompressed GPU Texture",id:"ktx2-basis-writer",module:"textures",version:ig,extensions:["ktx2"],worker:!0,options:{useSRGB:!1,qualityLevel:10,encodeUASTC:!1,mipmaps:!1}};function Ln(e,t){if(!e)throw new Error(t||"assert failed: gltf")}var og=!0,vZ=1735152710,rB=12,hS=8,L4e=1313821514,N4e=5130562,q4e=0,U4e=0,G4e=1;function z4e(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 yZ(e,t=0,r={}){let i=new DataView(e),{magic:n=vZ}=r,a=i.getUint32(t,!1);return a===n||a===vZ}function bZ(e,t,r=0,i={}){let n=new DataView(t),a=z4e(n,r+0),o=n.getUint32(r+4,og),s=n.getUint32(r+8,og);switch(Object.assign(e,{header:{byteOffset:r,byteLength:s,hasBinChunk:!1},type:a,version:o,json:{},binChunks:[]}),r+=rB,e.version){case 1:return H4e(e,n,r);case 2:return W4e(e,n,r,i={});default:throw new Error(`Invalid GLB version ${e.version}. Only supports version 1 and 2.`)}}function H4e(e,t,r){Ut(e.header.byteLength>rB+hS);let i=t.getUint32(r+0,og),n=t.getUint32(r+4,og);return r+=hS,Ut(n===q4e),iB(e,t,r,i),r+=i,r+=nB(e,t,r,e.header.byteLength),r}function W4e(e,t,r,i){return Ut(e.header.byteLength>rB+hS),V4e(e,t,r,i),r+e.header.byteLength}function V4e(e,t,r,i){for(;r+8<=e.header.byteLength;){let n=t.getUint32(r+0,og),a=t.getUint32(r+4,og);switch(r+=hS,a){case L4e:iB(e,t,r,n);break;case N4e:nB(e,t,r,n);break;case U4e:i.strict||iB(e,t,r,n);break;case G4e:i.strict||nB(e,t,r,n);break;default:break}r+=_f(n,4)}return r}function iB(e,t,r,i){let n=new Uint8Array(t.buffer,r,i),o=new TextDecoder("utf8").decode(n);return e.json=JSON.parse(o),_f(i,4)}function nB(e,t,r,i){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:r,byteLength:i,arrayBuffer:t.buffer}),_f(i,4)}function aB(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 _Z(e,t,r){let i=e.bufferViews[r];Ln(i);let n=i.buffer,a=t[n];Ln(a);let o=(i.byteOffset||0)+a.byteOffset;return new Uint8Array(a.arrayBuffer,o,i.byteLength)}var sB={};go(sB,{decode:()=>f5e,name:()=>c5e});var K4e=1.33,xZ=["SCALAR","VEC2","VEC3","VEC4"],Y4e=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],$4e=new Map(Y4e),X4e={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},J4e={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Q4e={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function dS(e){return xZ[e-1]||xZ[0]}function sg(e){let t=$4e.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function ug(e,t){let r=Q4e[e.componentType],i=X4e[e.type],n=J4e[e.componentType],a=e.count*i,o=e.count*i*n;return Ln(o>=0&&o<=t.byteLength),{ArrayType:r,length:a,byteLength:o}}function Ky(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*K4e)}function Z4e(){return{asset:{version:"2.0",generator:"loaders.gl"},buffers:[],extensions:{},extensionsRequired:[],extensionsUsed:[]}}var Si=class{constructor(t){this.gltf={json:(t==null?void 0:t.json)||Z4e(),buffers:(t==null?void 0:t.buffers)||[],images:(t==null?void 0:t.images)||[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(t){return this.json[t]}getExtraData(t){return(this.json.extras||{})[t]}hasExtension(t){let r=this.getUsedExtensions().find(n=>n===t),i=this.getRequiredExtensions().find(n=>n===t);return typeof r=="string"||typeof i=="string"}getExtension(t){let r=this.getUsedExtensions().find(n=>n===t),i=this.json.extensions||{};return r?i[t]: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];Ln(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}=ug(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==null?void 0:t.extensions)||{};if(i[r]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let n=this.json.extensionsRemoved;n.includes(r)||n.push(r)}delete i[r]}addExtension(t,r={}){return Ln(r),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=r,this.registerUsedExtension(t),r}addRequiredExtension(t,r={}){return Ln(r),this.addExtension(t,r),this.registerRequiredExtension(t),r}registerUsedExtension(t){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(r=>r===t)||this.json.extensionsUsed.push(t)}registerRequiredExtension(t){this.registerUsedExtension(t),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(r=>r===t)||this.json.extensionsRequired.push(t)}removeExtension(t){var r;if((r=this.json.extensions)==null?void 0:r[t]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let i=this.json.extensionsRemoved;i.includes(t)||i.push(t)}this.json.extensions&&delete this.json.extensions[t],this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,t),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,t)}setDefaultScene(t){this.json.scene=t}addScene(t){let{nodeIndices:r}=t;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:r}),this.json.scenes.length-1}addNode(t){let{meshIndex:r,matrix: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=wd(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,r=0,i=this.byteLength){let n=t.byteLength;Ln(Number.isFinite(n)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);let a={buffer:r,byteOffset:i,byteLength:n};return this.byteLength+=_f(n,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(a),this.json.bufferViews.length-1}addAccessor(t,r){let i={bufferView:t,type:dS(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:sg(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=DI(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 e5e="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",t5e="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",r5e=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]),i5e=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]),n5e={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},a5e={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};async function wZ(e,t,r,i,n,a="NONE"){let o=await o5e();l5e(o,o.exports[a5e[n]],e,t,r,i,o.exports[n5e[a||"NONE"]])}var oB;async function o5e(){return oB||(oB=s5e()),oB}async function s5e(){let e=e5e;WebAssembly.validate(r5e)&&(e=t5e,console.log("Warning: meshopt_decoder is using experimental SIMD support"));let t=await WebAssembly.instantiate(u5e(e),{});return await t.instance.exports.__wasm_call_ctors(),t.instance}function u5e(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?i5e[t[i]]:(t[i]-60)*64+t[++i];return t.buffer.slice(0,r)}function l5e(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 pS="EXT_meshopt_compression",c5e=pS;async function f5e(e,t){var n;let r=new Si(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(h5e(r,a));await Promise.all(i),r.removeExtension(pS)}async function h5e(e,t){let r=e.getObjectExtension(t,pS);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);await wZ(h,o,a,f,s,u),e.removeObjectExtension(t,pS)}}var uB={};go(uB,{name:()=>d5e,preprocess:()=>p5e});var lg="EXT_texture_webp",d5e=lg;function p5e(e,t){let r=new Si(e);if(!VO("image/webp")){if(r.getRequiredExtensions().includes(lg))throw new Error(`gltf: Required extension ${lg} not supported by browser`);return}let{json:i}=r;for(let n of i.textures||[]){let a=r.getObjectExtension(n,lg);a&&(n.source=a.source),r.removeObjectExtension(n,lg)}r.removeExtension(lg)}var lB={};go(lB,{name:()=>m5e,preprocess:()=>g5e});var mS="KHR_texture_basisu",m5e=mS;function g5e(e,t){let r=new Si(e),{json:i}=r;for(let n of i.textures||[]){let a=r.getObjectExtension(n,mS);a&&(n.source=a.source,r.removeObjectExtension(n,mS))}r.removeExtension(mS)}var fB={};go(fB,{decode:()=>x5e,encode:()=>w5e,name:()=>b5e,preprocess:()=>_5e});function EZ(e){let t={};for(let r in e){let i=e[r];if(r!=="indices"){let n=cB(i);t[r]=n}}return t}function cB(e){let{buffer:t,size:r,count:i}=v5e(e);return{value:t,size:r,byteOffset:0,count:i,type:dS(r),componentType:sg(t)}}function v5e(e){let t=e,r=1,i=0;return e&&e.value&&(t=e.value,r=e.size||1),t&&(ArrayBuffer.isView(t)||(t=y5e(t,Float32Array)),i=t.length/r),{buffer:t,size:r,count:i}}function y5e(e,t,r=!1){return e?Array.isArray(e)?new t(e):r&&!(e instanceof t)?new t(e):e:null}var Mf="KHR_draco_mesh_compression",b5e=Mf;function _5e(e,t,r){let i=new Si(e);for(let n of SZ(i))i.getObjectExtension(n,Mf)}async function x5e(e,t,r){var a;if(!((a=t==null?void 0:t.gltf)==null?void 0:a.decompressMeshes))return;let i=new Si(e),n=[];for(let o of SZ(i))i.getObjectExtension(o,Mf)&&n.push(E5e(i,o,t,r));await Promise.all(n),i.removeExtension(Mf)}function w5e(e,t={}){let r=new Si(e);for(let i of r.json.meshes||[])S5e(i,t),r.addRequiredExtension(Mf)}async function E5e(e,t,r,i){let n=e.getObjectExtension(t,Mf);if(!n)return;let a=e.getTypedArrayForBufferView(n.bufferView),o=ad(a.buffer,a.byteOffset),{parse:s}=i,u=ae({},r);delete u["3d-tiles"];let l=await s(o,$m,u,i),c=EZ(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=cB(l.indices)),e.removeObjectExtension(t,Mf),A5e(t)}function S5e(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:{[Mf]:{bufferView:u,attributes:s}}}]}}function A5e(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*SZ(e){for(let t of e.json.meshes||[])for(let r of t.primitives)yield r}var dB={};go(dB,{decode:()=>C5e,name:()=>T5e});var cg=Fe(dr());var AZ={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},TZ={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4};var hB="KHR_texture_transform",T5e=hB,gS=new cg.Vector3,k5e=new cg.Matrix3,R5e=new cg.Matrix3;async function C5e(e,t){if(!new Si(e).hasExtension(hB))return;let n=e.json.materials||[];for(let a=0;a<n.length;a++)I5e(a,e)}function I5e(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&&Yy(t,e,n,r);let a=i==null?void 0:i.emissiveTexture;a&&Yy(t,e,a,r);let o=i==null?void 0:i.normalTexture;o&&Yy(t,e,o,r);let s=i==null?void 0:i.occlusionTexture;s&&Yy(t,e,s,r);let u=(f=i==null?void 0:i.pbrMetallicRoughness)==null?void 0:f.metallicRoughnessTexture;u&&Yy(t,e,u,r)}function Yy(e,t,r,i){let n=P5e(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&&O5e(e,s,n)}}function P5e(e,t){var o;let r=(o=e.extensions)==null?void 0:o[hB],{texCoord:i=0}=e,{texCoord:n=i}=r;if(!(t.findIndex(([s,u])=>s===i&&u===n)!==-1)){let s=F5e(r);return i!==n&&(e.texCoord=n),t.push([i,n]),{originalTexCoord:i,texCoord:n,matrix:s}}return null}function O5e(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}=ug(l,c),g=TZ[l.componentType],b=AZ[l.type],E=c.byteStride||g*b,T=new Float32Array(y);for(let k=0;k<l.count;k++){let R=new p(f,d+k*E,2);gS.set(R[0],R[1],1),gS.transformByMatrix3(a),T.set([gS[0],gS[1]],k*b)}i===n?B5e(l,c,e.buffers,T):D5e(n,l,t,e,T)}}}}function B5e(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 D5e(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 F5e(e){let{offset:t=[0,0],rotation:r=0,scale:i=[1,1]}=e,n=new cg.Matrix3().set(1,0,0,0,1,0,t[0],t[1],1),a=k5e.set(Math.cos(r),Math.sin(r),0,-Math.sin(r),Math.cos(r),0,0,0,1),o=R5e.set(i[0],0,0,0,i[1],0,0,0,1);return n.multiplyRight(a).multiplyRight(o)}var pB={};go(pB,{decode:()=>j5e,encode:()=>L5e,name:()=>M5e});var Sd="KHR_lights_punctual",M5e=Sd;async function j5e(e){let t=new Si(e),{json:r}=t,i=t.getExtension(Sd);i&&(t.json.lights=i.lights,t.removeExtension(Sd));for(let n of r.nodes||[]){let a=t.getObjectExtension(n,Sd);a&&(n.light=a.light),t.removeObjectExtension(n,Sd)}}async function L5e(e){let t=new Si(e),{json:r}=t;if(r.lights){let i=t.addExtension(Sd);Ln(!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,Sd,i)}delete t.json.lights}}var mB={};go(mB,{decode:()=>q5e,encode:()=>U5e,name:()=>N5e});var $y="KHR_materials_unlit",N5e=$y;async function q5e(e){let t=new Si(e),{json:r}=t;for(let i of r.materials||[])i.extensions&&i.extensions.KHR_materials_unlit&&(i.unlit=!0),t.removeObjectExtension(i,$y);t.removeExtension($y)}function U5e(e){let t=new Si(e),{json:r}=t;if(t.materials)for(let i of r.materials||[])i.unlit&&(delete i.unlit,t.addObjectExtension(i,$y,{}),t.addExtension($y))}var gB={};go(gB,{decode:()=>z5e,encode:()=>H5e,name:()=>G5e});var Xy="KHR_techniques_webgl",G5e=Xy;async function z5e(e){let t=new Si(e),{json:r}=t,i=t.getExtension(Xy);if(i){let n=W5e(i,t);for(let a of r.materials||[]){let o=t.getObjectExtension(a,Xy);o&&(a.technique=Object.assign({},o,n[o.technique]),a.technique.values=V5e(a.technique,t)),t.removeObjectExtension(a,Xy)}t.removeExtension(Xy)}}async function H5e(e,t){}function W5e(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 V5e(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 vB={};go(vB,{decode:()=>Y5e,name:()=>K5e});var kZ="EXT_feature_metadata",K5e=kZ;async function Y5e(e,t){let r=new Si(e);$5e(r,t)}function $5e(e,t){var o,s;let r=e.getExtension(kZ);if(!r)return;let i=(o=r.schema)==null?void 0:o.classes,{featureTables:n}=r;if(i&&n)for(let u in i){let l=i[u],c=nNe(n,u);c&&X5e(e,c,l)}let{featureTextures:a}=r;if(i&&a&&((s=t.gltf)==null?void 0:s.loadImages))for(let u in i){let l=i[u],c=aNe(a,u);c&&J5e(e,c,l)}}function X5e(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=Q5e(e,a,s,o);o.data=u}}}function J5e(e,t,r){var n;let i=t.class;for(let a in r.properties){let o=(n=t==null?void 0:t.properties)==null?void 0:n[a];if(o){let s=Z5e(e,o,i);o.data=s}}}function Q5e(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);return oNe(a,s,r)}default:}return a}function Z5e(e,t,r){let i=e.gltf.json;if(!i.meshes)return[];let n=[];for(let a of i.meshes)for(let o of a.primitives)eNe(e,r,t,n,o);return n}function eNe(e,t,r,i,n){var k,R,D;let a=e.gltf.json,o=[],s=`TEXCOORD_${r.texture.texCoord}`,u=n.attributes[s],l=e.getBufferView(u),c=e.getTypedArrayForBufferView(l),f=new Float32Array(c.buffer,c.byteOffset,c.length/4),h=r.texture.index,d=(k=a.textures)==null?void 0:k[h],p=d==null?void 0:d.source;if(typeof p!="undefined"){let C=(R=a.images)==null?void 0:R[p],L=C==null?void 0:C.mimeType,B=(D=e.gltf.images)==null?void 0:D[p];if(B)for(let V=0;V<f.length;V+=2){let N=tNe(B,L,f,V,r.channels);o.push(N)}}let y=[];for(let C of o){let L=i.findIndex(B=>B===C);L===-1&&(L=i.push(C)-1),y.push(L)}let g=new Uint32Array(y),b=e.gltf.buffers.push({arrayBuffer:g.buffer,byteOffset:0,byteLength:g.byteLength})-1,E=e.addBufferView(g,b,0),T=e.addAccessor(E,{size:1,componentType:sg(g),count:g.length});n.attributes[t]=T}function tNe(e,t,r,i,n){let a={r:{offset:0,shift:0},g:{offset:1,shift:8},b:{offset:2,shift:16},a:{offset:3,shift:24}},o=r[i],s=r[i+1],u=1;t&&(t.indexOf("image/jpeg")!==-1||t.indexOf("image/png")!==-1)&&(u=4);let l=iNe(o,s,e,u),c=0;for(let f of n){let h=a[f];c|=rNe(e,l+h.offset)<<h.shift}return c}function rNe(e,t){let r=tg(e);if(r.data.length<=t)throw new Error(`${r.data.length} <= ${t}`);return r.data[t]}function iNe(e,t,r,i=1){let n=r.width,a=RZ(e)*(n-1),o=Math.round(a),s=r.height,u=RZ(t)*(s-1),l=Math.round(u),c=r.components?r.components:i;return(l*n+o)*c}function RZ(e){return(e%1+1)%1}function nNe(e,t){for(let r in e){let i=e[r];if(i.class===t)return i}return null}function aNe(e,t){for(let r in e){let i=e[r];if(i.class===t)return i}return null}function oNe(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 CZ=[sB,uB,lB,fB,pB,mB,gB,dB,vB];function IZ(e,t={},r){var n;let i=CZ.filter(a=>OZ(a.name,t));for(let a of i)(n=a.preprocess)==null||n.call(a,e,t,r)}async function PZ(e,t={},r){var n;let i=CZ.filter(a=>OZ(a.name,t));for(let a of i)await((n=a.decode)==null?void 0:n.call(a,e,t,r))}function OZ(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 yB="KHR_binary_glTF";function BZ(e){let t=new Si(e),{json:r}=t;for(let i of r.images||[]){let n=t.getObjectExtension(i,yB);n&&Object.assign(i,n),t.removeObjectExtension(i,yB)}r.buffers&&r.buffers[0]&&delete r.buffers[0].uri,t.removeExtension(yB)}var DZ={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},sNe={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},FZ=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),BZ(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 DZ)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 DZ)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=sNe[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 MZ(e,t={}){return new FZ().normalize(e,t)}async function jZ(e,t,r=0,i,n){var a,o,s;return uNe(e,t,r,i),MZ(e,{normalize:(a=i==null?void 0:i.gltf)==null?void 0:a.normalize}),IZ(e,i,n),((o=i==null?void 0:i.gltf)==null?void 0:o.loadBuffers)&&e.json.buffers&&await lNe(e,i,n),((s=i==null?void 0:i.gltf)==null?void 0:s.loadImages)&&await cNe(e,i,n),await PZ(e,i,n),e}function uNe(e,t,r,i){if(i.uri&&(e.baseUri=i.uri),t instanceof ArrayBuffer&&!yZ(t,r,i)&&(t=new TextDecoder().decode(t)),typeof t=="string")e.json=OI(t);else if(t instanceof ArrayBuffer){let o={};r=bZ(o,t,r,i.glb),Ln(o.type==="glTF",`Invalid GLB magic string ${o.type}`),e._glb=o,e.json=o.json}else Ln(!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 lNe(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;Ln(u);let l=aB(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 cNe(e,t,r){let i=fNe(e),n=e.json.images||[],a=[];for(let o of i)a.push(hNe(e,n[o],o,t,r));return await Promise.all(a)}function fNe(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 hNe(e,t,r,i,n){let{fetch:a,parse:o}=n,s;if(t.uri&&!t.hasOwnProperty("bufferView")){let l=aB(t.uri,i);s=await(await a(l)).arrayBuffer(),t.bufferView={data:s}}if(Number.isFinite(t.bufferView)){let l=_Z(e.json,e.buffers,t.bufferView);s=ad(l.buffer,l.byteOffset,l.byteLength)}Ln(s,"glTF image has no data");let u=await o(s,[rg,Ed],{mimeType:t.mimeType,basis:i.basis||{format:ag()}},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 lc={name:"glTF",id:"gltf",module:"gltf",version:DQ,extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:dNe,options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0},log:console},deprecatedOptions:{fetchImages:"gltf.loadImages",createImages:"gltf.loadImages",decompress:"gltf.decompressMeshes",postProcess:"gltf.postProcess",gltf:{decompress:"gltf.decompressMeshes",postProcess:"removed in v4"}}};async function dNe(e,t={},r){t=ae(ae({},lc.options),t),t.gltf=ae(ae({},lc.options.gltf),t.gltf);let{byteOffset:i=0}=t;return await jZ({},e,i,t,r)}var pNe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},mNe={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},ls={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},gNe={magFilter:ls.TEXTURE_MAG_FILTER,minFilter:ls.TEXTURE_MIN_FILTER,wrapS:ls.TEXTURE_WRAP_S,wrapT:ls.TEXTURE_WRAP_T},vNe={[ls.TEXTURE_MAG_FILTER]:ls.LINEAR,[ls.TEXTURE_MIN_FILTER]:ls.NEAREST_MIPMAP_LINEAR,[ls.TEXTURE_WRAP_S]:ls.REPEAT,[ls.TEXTURE_WRAP_T]:ls.REPEAT};function yNe(){return{id:"default-sampler",parameters:vNe}}function bNe(e){return mNe[e]}function _Ne(e){return pNe[e]}var LZ=class{constructor(){this.baseUri="";this.buffers=[];this.images=[]}postProcess(t,r={}){let{json:i,buffers:n=[],images:a=[]}=t,{baseUri:o=""}=t;return Ln(i),this.baseUri=o,this.buffers=n,this.images=a,this.jsonUnprocessed=i,this.json=this._resolveTree(t.json,r),this.json}_resolveTree(t,r={}){let i=ae({},t);return this.json=i,t.bufferViews&&(i.bufferViews=t.bufferViews.map((n,a)=>this._resolveBufferView(n,a))),t.images&&(i.images=t.images.map((n,a)=>this._resolveImage(n,a))),t.samplers&&(i.samplers=t.samplers.map((n,a)=>this._resolveSampler(n,a))),t.textures&&(i.textures=t.textures.map((n,a)=>this._resolveTexture(n,a))),t.accessors&&(i.accessors=t.accessors.map((n,a)=>this._resolveAccessor(n,a))),t.materials&&(i.materials=t.materials.map((n,a)=>this._resolveMaterial(n,a))),t.meshes&&(i.meshes=t.meshes.map((n,a)=>this._resolveMesh(n,a))),t.nodes&&(i.nodes=t.nodes.map((n,a)=>this._resolveNode(n,a)),i.nodes=i.nodes.map((n,a)=>this._resolveNodeChildren(n))),t.skins&&(i.skins=t.skins.map((n,a)=>this._resolveSkin(n,a))),t.scenes&&(i.scenes=t.scenes.map((n,a)=>this._resolveScene(n,a))),typeof this.json.scene=="number"&&i.scenes&&(i.scene=i.scenes[this.json.scene]),i}getScene(t){return this._get(this.json.scenes,t)}getNode(t){return this._get(this.json.nodes,t)}getSkin(t){return this._get(this.json.skins,t)}getMesh(t){return this._get(this.json.meshes,t)}getMaterial(t){return this._get(this.json.materials,t)}getAccessor(t){return this._get(this.json.accessors,t)}getCamera(t){return this._get(this.json.cameras,t)}getTexture(t){return this._get(this.json.textures,t)}getSampler(t){return this._get(this.json.samplers,t)}getImage(t){return this._get(this.json.images,t)}getBufferView(t){return this._get(this.json.bufferViews,t)}getBuffer(t){return this._get(this.json.buffers,t)}_get(t,r){if(typeof r=="object")return r;let i=t&&t[r];return i||console.warn(`glTF file error: Could not find ${t}[${r}]`),i}_resolveScene(t,r){return Je(ae({},t),{id:t.id||`scene-${r}`,nodes:(t.nodes||[]).map(i=>this.getNode(i))})}_resolveNode(t,r){let i=Je(ae({},t),{id:(t==null?void 0:t.id)||`node-${r}`});return t.mesh!==void 0&&(i.mesh=this.getMesh(t.mesh)),t.camera!==void 0&&(i.camera=this.getCamera(t.camera)),t.skin!==void 0&&(i.skin=this.getSkin(t.skin)),t.meshes!==void 0&&t.meshes.length&&(i.mesh=t.meshes.reduce((n,a)=>{let o=this.getMesh(a);return n.id=o.id,n.primitives=n.primitives.concat(o.primitives),n},{primitives:[]})),i}_resolveNodeChildren(t){return t.children&&(t.children=t.children.map(r=>this.getNode(r))),t}_resolveSkin(t,r){let i=typeof t.inverseBindMatrices=="number"?this.getAccessor(t.inverseBindMatrices):void 0;return Je(ae({},t),{id:t.id||`skin-${r}`,inverseBindMatrices:i})}_resolveMesh(t,r){let i=Je(ae({},t),{id:t.id||`mesh-${r}`,primitives:[]});return t.primitives&&(i.primitives=t.primitives.map(n=>{let a=Je(ae({},n),{attributes:{},indices:void 0,material:void 0}),o=n.attributes;for(let s in o)a.attributes[s]=this.getAccessor(o[s]);return n.indices!==void 0&&(a.indices=this.getAccessor(n.indices)),n.material!==void 0&&(a.material=this.getMaterial(n.material)),a})),i}_resolveMaterial(t,r){let i=Je(ae({},t),{id:t.id||`material-${r}`});if(i.normalTexture&&(i.normalTexture=ae({},i.normalTexture),i.normalTexture.texture=this.getTexture(i.normalTexture.index)),i.occlusionTexture&&(i.occlusionTexture=ae({},i.occlusionTexture),i.occlusionTexture.texture=this.getTexture(i.occlusionTexture.index)),i.emissiveTexture&&(i.emissiveTexture=ae({},i.emissiveTexture),i.emissiveTexture.texture=this.getTexture(i.emissiveTexture.index)),i.emissiveFactor||(i.emissiveFactor=i.emissiveTexture?[1,1,1]:[0,0,0]),i.pbrMetallicRoughness){i.pbrMetallicRoughness=ae({},i.pbrMetallicRoughness);let n=i.pbrMetallicRoughness;n.baseColorTexture&&(n.baseColorTexture=ae({},n.baseColorTexture),n.baseColorTexture.texture=this.getTexture(n.baseColorTexture.index)),n.metallicRoughnessTexture&&(n.metallicRoughnessTexture=ae({},n.metallicRoughnessTexture),n.metallicRoughnessTexture.texture=this.getTexture(n.metallicRoughnessTexture.index))}return i}_resolveAccessor(t,r){let i=bNe(t.componentType),n=_Ne(t.type),a=i*n,o=Je(ae({},t),{id:t.id||`accessor-${r}`,bytesPerComponent:i,components:n,bytesPerElement:a,value:void 0,bufferView:void 0,sparse:void 0});if(t.bufferView!==void 0&&(o.bufferView=this.getBufferView(t.bufferView)),o.bufferView){let s=o.bufferView.buffer,{ArrayType:u,byteLength:l}=ug(o,o.bufferView),c=(o.bufferView.byteOffset||0)+(o.byteOffset||0)+s.byteOffset,f=s.arrayBuffer.slice(c,c+l);o.bufferView.byteStride&&(f=this._getValueFromInterleavedBuffer(s,c,o.bufferView.byteStride,o.bytesPerElement,o.count)),o.value=new u(f)}return o}_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 Je(ae({},t),{id:t.id||`texture-${r}`,sampler:typeof t.sampler=="number"?this.getSampler(t.sampler):yNe(),source:typeof t.source=="number"?this.getImage(t.source):void 0})}_resolveSampler(t,r){let i=Je(ae({id:t.id||`sampler-${r}`},t),{parameters:{}});for(let n in i){let a=this._enumSamplerParameter(n);a!==void 0&&(i.parameters[a]=i[n])}return i}_enumSamplerParameter(t){return gNe[t]}_resolveImage(t,r){let i=Je(ae({},t),{id:t.id||`image-${r}`,image:null,bufferView:t.bufferView!==void 0?this.getBufferView(t.bufferView):void 0}),n=this.images[r];return n&&(i.image=n),i}_resolveBufferView(t,r){let i=t.buffer,n=this.buffers[i].arrayBuffer,a=this.buffers[i].byteOffset||0;return t.byteOffset&&(a+=t.byteOffset),Je(ae({id:`bufferView-${r}`},t),{buffer:this.buffers[i],data:new Uint8Array(n,a,t.byteLength)})}_resolveCamera(t,r){let i=Je(ae({},t),{id:t.id||`camera-${r}`});return i.perspective,i.orthographic,i}};function Jy(e,t){return new LZ().postProcess(e,t)}var vS={URI:0,EMBEDDED:1};function yS(e,t,r,i){e.rotateYtoZ=!0;let n=(e.byteOffset||0)+(e.byteLength||0)-r;if(n===0)throw new Error("glTF byte length must be greater than 0.");return e.gltfUpAxis=(i==null?void 0:i["3d-tiles"])&&i["3d-tiles"].assetGltfUpAxis?i["3d-tiles"].assetGltfUpAxis:"Y",e.gltfArrayBuffer=ad(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||0)+(e.byteLength||0)}async function bS(e,t,r,i){let n=(r==null?void 0:r["3d-tiles"])||{};if(xNe(e,t,r),n.loadGLTF){if(!i)return;let{parse:a,fetch:o}=i;if(e.gltfUrl){let s=await o(e.gltfUrl,r);e.gltfArrayBuffer=await s.arrayBuffer(),e.gltfByteOffset=0}if(e.gltfArrayBuffer){let s=await a(e.gltfArrayBuffer,lc,r,i);e.gltf=Jy(s),e.gpuMemoryUsageInBytes=Ky(e.gltf),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength}}}function xNe(e,t,r){switch(t){case vS.URI:if(e.gltfArrayBuffer){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 vS.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}async function NZ(e,t,r,i,n){var o;r=wNe(e,t,r,i,n),await bS(e,vS.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 wNe(e,t,r,i,n){r=Ff(e,t,r),r=Zm(e,t,r),r=eg(e,t,r,i),r=yS(e,t,r,i);let a=new Df(e.featureTableJson,e.featureTableBinary);return e.rtcCenter=a.getGlobalProperty("RTC_CENTER",Zt.FLOAT,3),r}var Co=Fe(dr()),qZ=Fe(Ra());async function UZ(e,t,r,i,n){return r=ENe(e,t,r,i,n),await bS(e,e.gltfFormat||0,i,n),r}function ENe(e,t,r,i,n){var l;if(r=Ff(e,t,r),e.version!==1)throw new Error(`Instanced 3D Model version ${e.version} is not supported`);r=Zm(e,t,r);let a=new DataView(t);if(e.gltfFormat=a.getUint32(r,!0),r+=4,r=eg(e,t,r,i),r=yS(e,t,r,i),!((l=e==null?void 0:e.header)==null?void 0:l.featureTableJsonByteLength)||e.header.featureTableJsonByteLength===0)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");let o=new Df(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",Zt.FLOAT,3);let u=new Jm(e.batchTableJson,e.batchTableBinary,s);return SNe(e,o,u,s),r}function SNe(e,t,r,i){let n=new Array(i),a=new Co.Vector3,o=new Co.Vector3,s=new Co.Vector3,u=new Co.Vector3,l=new Co.Matrix3,c=new Co.Quaternion,f=new Co.Vector3,h={},d=new Co.Matrix4,p=[],y=[],g=[],b=[];for(let E=0;E<i;E++){let T;if(t.hasProperty("POSITION"))T=t.getProperty("POSITION",Zt.FLOAT,3,E,a);else if(t.hasProperty("POSITION_QUANTIZED")){T=t.getProperty("POSITION_QUANTIZED",Zt.UNSIGNED_SHORT,3,E,a);let V=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Zt.FLOAT,3);if(!V)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let N=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Zt.FLOAT,3);if(!N)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let z=65535;for(let j=0;j<3;j++)T[j]=T[j]/z*N[j]+V[j]}if(!T)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");a.copy(T),h.translation=a,e.normalUp=t.getProperty("NORMAL_UP",Zt.FLOAT,3,E,p),e.normalRight=t.getProperty("NORMAL_RIGHT",Zt.FLOAT,3,E,y);let k=!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",Zt.UNSIGNED_SHORT,2,E,p),e.octNormalRight=t.getProperty("NORMAL_RIGHT_OCT32P",Zt.UNSIGNED_SHORT,2,E,y),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?(qZ.Ellipsoid.WGS84.eastNorthUpToFixedFrame(a,d),d.getRotationMatrix3(l)):l.identity()}k&&(u.copy(o).cross(s).normalize(),l.setColumn(0,o),l.setColumn(1,s),l.setColumn(2,u)),c.fromMatrix3(l),h.rotation=c,f.set(1,1,1);let R=t.getProperty("SCALE",Zt.FLOAT,1,E,g);Number.isFinite(R)&&f.multiplyByScalar(R);let D=t.getProperty("SCALE_NON_UNIFORM",Zt.FLOAT,3,E,p);D&&f.scale(D),h.scale=f;let C=t.getProperty("BATCH_ID",Zt.UNSIGNED_SHORT,1,E,b);C===void 0&&(C=E);let L=new Co.Matrix4().fromQuaternion(h.rotation);d.identity(),d.translate(h.translation),d.multiplyRight(L),d.scale(h.scale);let B=d.clone();n[E]={modelMatrix:B,batchId:C}}e.instances=n}async function GZ(e,t,r,i,n,a){r=Ff(e,t,r);let o=new DataView(t);for(e.tilesLength=o.getUint32(r,!0),r+=4,e.tiles=[];e.tiles.length<e.tilesLength&&(e.byteLength||0)-r>12;){let s={};e.tiles.push(s),r=await a(t,r,i,n,s)}return r}async function zZ(e,t,r,i){var n;if(e.rotateYtoZ=!0,e.gltfUpAxis=(r==null?void 0:r["3d-tiles"])&&r["3d-tiles"].assetGltfUpAxis?r["3d-tiles"].assetGltfUpAxis:"Y",(n=r==null?void 0:r["3d-tiles"])==null?void 0:n.loadGLTF){if(!i)return;let{parse:a}=i,o=await a(t,lc,r,i);e.gltf=Jy(o),e.gpuMemoryUsageInBytes=Ky(e.gltf)}else e.gltfArrayBuffer=t}async function bB(e,t=0,r,i,n={}){switch(n.byteOffset=t,n.type=fQ(e,t),n.type){case xd.COMPOSITE:return await GZ(n,e,t,r,i,bB);case xd.BATCHED_3D_MODEL:return await NZ(n,e,t,r,i);case xd.GLTF:return await zZ(n,e,r,i);case xd.INSTANCED_3D_MODEL:return await UZ(n,e,t,r,i);case xd.POINT_CLOUD:return await BQ(n,e,t,r,i);default:throw new Error(`3DTileLoader: unknown type ${n.type}`)}}var ANe=1952609651,TNe=1;async function _B(e,t,r){if(new Uint32Array(e.slice(0,4))[0]!==ANe)throw new Error("Wrong subtree file magic number");if(new Uint32Array(e.slice(4,8))[0]!==TNe)throw new Error("Wrong subtree file verson, must be 1");let a=HZ(e.slice(8,16)),o=new Uint8Array(e,24,a),u=new TextDecoder("utf8").decode(o),l=JSON.parse(u),c=HZ(e.slice(16,24)),f=new ArrayBuffer(0);return c&&(f=e.slice(24+a)),"bufferView"in l.tileAvailability&&(l.tileAvailability.explicitBitstream=await xB(l,"tileAvailability",f,r)),"bufferView"in l.contentAvailability&&(l.contentAvailability.explicitBitstream=await xB(l,"contentAvailability",f,r)),"bufferView"in l.childSubtreeAvailability&&(l.childSubtreeAvailability.explicitBitstream=await xB(l,"childSubtreeAvailability",f,r)),l}function kNe(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 xB(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=kNe(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 HZ(e){let t=new DataView(e),r=t.getUint32(0,!0),i=t.getUint32(4,!0);return r+2**32*i}var _S={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:JE,extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:_B,options:{}};var cs=null;try{cs=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 _i(e,t,r){this.low=e|0,this.high=t|0,this.unsigned=!!r}_i.prototype.__isLong__;Object.defineProperty(_i.prototype,"__isLong__",{value:!0});function Ia(e){return(e&&e.__isLong__)===!0}function WZ(e){var t=Math.clz32(e&-e);return e?31-t:t}_i.isLong=Ia;var VZ={},KZ={};function Ad(e,t){var r,i,n;return t?(e>>>=0,(n=0<=e&&e<256)&&(i=KZ[e],i)?i:(r=Vr(e,0,!0),n&&(KZ[e]=r),r)):(e|=0,(n=-128<=e&&e<128)&&(i=VZ[e],i)?i:(r=Vr(e,e<0?-1:0,!1),n&&(VZ[e]=r),r))}_i.fromInt=Ad;function fs(e,t){if(isNaN(e))return t?cc:au;if(t){if(e<0)return cc;if(e>=$Z)return eee}else{if(e<=-XZ)return lo;if(e+1>=XZ)return ZZ}return e<0?fs(-e,t).neg():Vr(e%fg|0,e/fg|0,t)}_i.fromNumber=fs;function Vr(e,t,r){return new _i(e,t,r)}_i.fromBits=Vr;var xS=Math.pow;function wB(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?cc:au;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 wB(e.substring(1),t,r).neg();for(var n=fs(xS(r,8)),a=au,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=fs(xS(r,s));a=a.mul(l).add(fs(u))}else a=a.mul(n),a=a.add(fs(u))}return a.unsigned=t,a}_i.fromString=wB;function nu(e,t){return typeof e=="number"?fs(e,t):typeof e=="string"?wB(e,t):Vr(e.low,e.high,typeof t=="boolean"?t:e.unsigned)}_i.fromValue=nu;var YZ=1<<16,RNe=1<<24,fg=YZ*YZ,$Z=fg*fg,XZ=$Z/2,JZ=Ad(RNe),au=Ad(0);_i.ZERO=au;var cc=Ad(0,!0);_i.UZERO=cc;var hg=Ad(1);_i.ONE=hg;var QZ=Ad(1,!0);_i.UONE=QZ;var EB=Ad(-1);_i.NEG_ONE=EB;var ZZ=Vr(4294967295|0,2147483647|0,!1);_i.MAX_VALUE=ZZ;var eee=Vr(4294967295|0,4294967295|0,!0);_i.MAX_UNSIGNED_VALUE=eee;var lo=Vr(0,2147483648|0,!1);_i.MIN_VALUE=lo;var ze=_i.prototype;ze.toInt=function(){return this.unsigned?this.low>>>0:this.low};ze.toNumber=function(){return this.unsigned?(this.high>>>0)*fg+(this.low>>>0):this.high*fg+(this.low>>>0)};ze.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(lo)){var r=fs(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=fs(xS(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}};ze.getHighBits=function(){return this.high};ze.getHighBitsUnsigned=function(){return this.high>>>0};ze.getLowBits=function(){return this.low};ze.getLowBitsUnsigned=function(){return this.low>>>0};ze.getNumBitsAbs=function(){if(this.isNegative())return this.eq(lo)?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};ze.isZero=function(){return this.high===0&&this.low===0};ze.eqz=ze.isZero;ze.isNegative=function(){return!this.unsigned&&this.high<0};ze.isPositive=function(){return this.unsigned||this.high>=0};ze.isOdd=function(){return(this.low&1)==1};ze.isEven=function(){return(this.low&1)==0};ze.equals=function(t){return Ia(t)||(t=nu(t)),this.unsigned!==t.unsigned&&this.high>>>31==1&&t.high>>>31==1?!1:this.high===t.high&&this.low===t.low};ze.eq=ze.equals;ze.notEquals=function(t){return!this.eq(t)};ze.neq=ze.notEquals;ze.ne=ze.notEquals;ze.lessThan=function(t){return this.comp(t)<0};ze.lt=ze.lessThan;ze.lessThanOrEqual=function(t){return this.comp(t)<=0};ze.lte=ze.lessThanOrEqual;ze.le=ze.lessThanOrEqual;ze.greaterThan=function(t){return this.comp(t)>0};ze.gt=ze.greaterThan;ze.greaterThanOrEqual=function(t){return this.comp(t)>=0};ze.gte=ze.greaterThanOrEqual;ze.ge=ze.greaterThanOrEqual;ze.compare=function(t){if(Ia(t)||(t=nu(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};ze.comp=ze.compare;ze.negate=function(){return!this.unsigned&&this.eq(lo)?lo:this.not().add(hg)};ze.neg=ze.negate;ze.add=function(t){Ia(t)||(t=nu(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,Vr(h<<16|d,c<<16|f,this.unsigned)};ze.subtract=function(t){return Ia(t)||(t=nu(t)),this.add(t.neg())};ze.sub=ze.subtract;ze.multiply=function(t){if(this.isZero())return this;if(Ia(t)||(t=nu(t)),cs){var r=cs.mul(this.low,this.high,t.low,t.high);return Vr(r,cs.get_high(),this.unsigned)}if(t.isZero())return this.unsigned?cc:au;if(this.eq(lo))return t.isOdd()?lo:au;if(t.eq(lo))return this.isOdd()?lo:au;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(JZ)&&t.lt(JZ))return fs(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,Vr(d<<16|p,f<<16|h,this.unsigned)};ze.mul=ze.multiply;ze.divide=function(t){if(Ia(t)||(t=nu(t)),t.isZero())throw Error("division by zero");if(cs){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var r=(this.unsigned?cs.div_u:cs.div_s)(this.low,this.high,t.low,t.high);return Vr(r,cs.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?cc:au;var i,n,a;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return cc;if(t.gt(this.shru(1)))return QZ;a=cc}else{if(this.eq(lo)){if(t.eq(hg)||t.eq(EB))return lo;if(t.eq(lo))return hg;var o=this.shr(1);return i=o.div(t).shl(1),i.eq(au)?t.isNegative()?hg:EB:(n=this.sub(t.mul(i)),a=i.add(n.div(t)),a)}else if(t.eq(lo))return this.unsigned?cc:au;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=au}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:xS(2,s-48),l=fs(i),c=l.mul(t);c.isNegative()||c.gt(n);)i-=u,l=fs(i,this.unsigned),c=l.mul(t);l.isZero()&&(l=hg),a=a.add(l),n=n.sub(c)}return a};ze.div=ze.divide;ze.modulo=function(t){if(Ia(t)||(t=nu(t)),cs){var r=(this.unsigned?cs.rem_u:cs.rem_s)(this.low,this.high,t.low,t.high);return Vr(r,cs.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))};ze.mod=ze.modulo;ze.rem=ze.modulo;ze.not=function(){return Vr(~this.low,~this.high,this.unsigned)};ze.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};ze.clz=ze.countLeadingZeros;ze.countTrailingZeros=function(){return this.low?WZ(this.low):WZ(this.high)+32};ze.ctz=ze.countTrailingZeros;ze.and=function(t){return Ia(t)||(t=nu(t)),Vr(this.low&t.low,this.high&t.high,this.unsigned)};ze.or=function(t){return Ia(t)||(t=nu(t)),Vr(this.low|t.low,this.high|t.high,this.unsigned)};ze.xor=function(t){return Ia(t)||(t=nu(t)),Vr(this.low^t.low,this.high^t.high,this.unsigned)};ze.shiftLeft=function(t){return Ia(t)&&(t=t.toInt()),(t&=63)==0?this:t<32?Vr(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):Vr(0,this.low<<t-32,this.unsigned)};ze.shl=ze.shiftLeft;ze.shiftRight=function(t){return Ia(t)&&(t=t.toInt()),(t&=63)==0?this:t<32?Vr(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):Vr(this.high>>t-32,this.high>=0?0:-1,this.unsigned)};ze.shr=ze.shiftRight;ze.shiftRightUnsigned=function(t){return Ia(t)&&(t=t.toInt()),(t&=63)==0?this:t<32?Vr(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):t===32?Vr(this.high,0,this.unsigned):Vr(this.high>>>t-32,0,this.unsigned)};ze.shru=ze.shiftRightUnsigned;ze.shr_u=ze.shiftRightUnsigned;ze.rotateLeft=function(t){var r;return Ia(t)&&(t=t.toInt()),(t&=63)==0?this:t===32?Vr(this.high,this.low,this.unsigned):t<32?(r=32-t,Vr(this.low<<t|this.high>>>r,this.high<<t|this.low>>>r,this.unsigned)):(t-=32,r=32-t,Vr(this.high<<t|this.low>>>r,this.low<<t|this.high>>>r,this.unsigned))};ze.rotl=ze.rotateLeft;ze.rotateRight=function(t){var r;return Ia(t)&&(t=t.toInt()),(t&=63)==0?this:t===32?Vr(this.high,this.low,this.unsigned):t<32?(r=32-t,Vr(this.high<<r|this.low>>>t,this.low<<r|this.high>>>t,this.unsigned)):(t-=32,r=32-t,Vr(this.low<<r|this.high>>>t,this.high<<r|this.low>>>t,this.unsigned))};ze.rotr=ze.rotateRight;ze.toSigned=function(){return this.unsigned?Vr(this.low,this.high,!1):this};ze.toUnsigned=function(){return this.unsigned?this:Vr(this.low,this.high,!0)};ze.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()};ze.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]};ze.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]};_i.fromBytes=function(t,r,i){return i?_i.fromBytesLE(t,r):_i.fromBytesBE(t,r)};_i.fromBytesLE=function(t,r){return new _i(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,r)};_i.fromBytesBE=function(t,r){return new _i(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],r)};var dg=_i;var CNe=16;function Qy(e){e==="X"&&(e="");let t=e.padEnd(CNe,"0");return dg.fromString(t,!0,16)}function SB(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 AB(e,t){let r=INe(e).shiftRightUnsigned(2);return e.add(dg.fromNumber(2*t+1-4).multiply(r))}function INe(e){return e.and(e.not().add(1))}var PNe=3,ONe=30,BNe=2*ONe+1,tee=180/Math.PI;function ree(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);DNe(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 iee(e){if(e.isZero())return"";let t=e.toString(2);for(;t.length<PNe+BNe;)t="0"+t;let r=t.lastIndexOf("1"),i=t.substring(0,3),n=t.substring(3,r),a=n.length/2,o=dg.fromString(i,!0,2).toString(10),s="";if(a!==0)for(s=dg.fromString(n,!0,2).toString(4);s.length<a;)s="0"+s;return`${o}/${s}`}function TB(e,t,r){let i=1<<t;return[(e[0]+r[0])/i,(e[1]+r[1])/i]}function nee(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function kB(e){return[nee(e[0]),nee(e[1])]}function RB(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 CB([e,t,r]){let i=Math.atan2(r,Math.sqrt(e*e+t*t));return[Math.atan2(t,e)*tee,i*tee]}function DNe(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 aee(e){let t=TB(e.ij,e.level,[.5,.5]),r=kB(t),i=RB(e.face,r);return CB(i)}var FNe=100;function IB(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(FNe*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=TB(r,i,c),g=kB(y),b=RB(t,g),E=CB(b);Math.abs(E[1])>89.999&&(E[0]=u);let T=E[0]-u;E[0]+=T>180?-360:T<-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 pg(e){let t=MNe(e);return ree(t)}function MNe(e){if(e.indexOf("/")>0)return e;let t=Qy(e);return iee(t)}function PB(e){let t=pg(e);return aee(t)}function oee(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=pg(a),s=IB(o);(typeof r=="undefined"||r===null)&&(r=new Float64Array(4*s.length)),r.set(s,i),i+=s.length}t=see(r)}else{let r=IB(e);t=see(r)}return t}function see(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 fc=Fe(dr());function OB(e,t){let r=(t==null?void 0:t.minimumHeight)||0,i=(t==null?void 0:t.maximumHeight)||0,n=pg(e),a=oee(n),o=a.west,s=a.south,u=a.east,l=a.north,c=[];return c.push(new fc.Vector3(o,l,r)),c.push(new fc.Vector3(u,l,r)),c.push(new fc.Vector3(u,s,r)),c.push(new fc.Vector3(o,s,r)),c.push(new fc.Vector3(o,l,i)),c.push(new fc.Vector3(u,l,i)),c.push(new fc.Vector3(u,s,i)),c.push(new fc.Vector3(o,s,i)),c}var uee=Fe(dr()),lee=Fe(Zu());var cee=Fe(Ra());function wS(e){let t=e.token,r={minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight},i=OB(t,r),n=PB(t),a=n[0],o=n[1],s=cee.Ellipsoid.WGS84.cartographicToCartesian([a,o,r.maximumHeight]),u=new uee.Vector3(s[0],s[1],s[2]);i.push(u);let l=(0,lee.makeOrientedBoundingBoxFromPoints)(i);return[...l.center,...l.halfAxes]}var jNe=4,LNe=8,NNe={QUADTREE:jNe,OCTREE:LNe};function qNe(e,t,r){if(e==null?void 0:e.box){let i=Qy(e.s2VolumeInfo.token),n=AB(i,t),a=SB(n),o=ae({},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:wS(o),s2VolumeInfo:o}}}async function BB(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=NNe[u],g=i&1,b=i>>1&1,E=i>>2&1,T=(y**s-1)/(y-1),k=Td(r.mortonIndex,i),R=T+k,D=Td(r.x,g),C=Td(r.y,b),L=Td(r.z,E),B=!1;s+1>l&&(B=DB(o.childSubtreeAvailability,k));let V=Td(n.x,D),N=Td(n.y,C),z=Td(n.z,L),j=s+n.level;if(B){let ne=`${d}/${h}`,ue=ES(ne,j,V,N,z);o=await Wr(ue,_S),n.mortonIndex=k,n.x=D,n.y=C,n.z=L,n.level=s,k=0,R=0,D=0,C=0,L=0,s=0}if(!DB(o.tileAvailability,R)||s>c)return p;DB(o.contentAvailability,R)&&(p.contentUrl=ES(f,j,V,N,z));let te=s+1,re={mortonIndex:k,x:D,y:C,z:L};for(let ne=0;ne<y;ne++){let ue=qNe(a,ne,u),pe=await BB({subtree:o,options:t,parentData:re,childIndex:ne,level:te,globalData:n,s2VolumeBox:ue});if(pe.contentUrl||pe.children.length){let Le=j+1,qe=UNe(pe,Le,{childTileX:D,childTileY:C,childTileZ:L},t,a);p.children.push(qe)}}return p}function DB(e,t){return"constant"in e?Boolean(e.constant):e.explicitBitstream?HNe(t,e.explicitBitstream):!1}function UNe(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=GNe(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 GNe(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,T]=[s+p*n,s+p*(n+1)],[k,R]=[c+y*a,c+y*(a+1)];return{region:[g,E,b,T,k,R]}}if(t.box)return t;throw new Error(`Unsupported bounding volume type ${t}`)}function Td(e,t){return parseInt(e.toString(2)+t.toString(2),2)}function ES(e,t,r,i,n){let a=zNe({level:t,x:r,y:i,z:n});return e.replace(/{level}|{x}|{y}|{z}/gi,o=>a[o])}function zNe(e){let t={};for(let r in e)t[`{${r}}`]=e[r];return t}function HNe(e,t){let r=Math.floor(e/8),i=e%8;return(t[r]>>i&1)===1}function FB(e,t=""){if(!t)return tl.EMPTY;let i=t.split("?")[0].split(".").pop();switch(i){case"pnts":return tl.POINTCLOUD;case"i3dm":case"b3dm":case"glb":case"gltf":return tl.SCENEGRAPH;default:return i||tl.EMPTY}}function MB(e){switch(e){case"REPLACE":case"replace":return ta.REPLACE;case"ADD":case"add":return ta.ADD;default:return e}}function jB(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 fee(e,t){var n;if(!e)return null;let r;if(e.content){let a=e.content.uri||((n=e.content)==null?void 0:n.url);r=jB(a,t)}return Je(ae({},e),{id:r,contentUrl:r,lodMetricType:ic.GEOMETRIC_ERROR,lodMetricValue:e.geometricError,transformMatrix:e.transform,type:FB(e,r),refine:MB(e.refine)})}async function hee(e,t,r){let i=null,n=pee(e.root);n&&e.root?i=await dee(e.root,e,t,n,r):i=fee(e.root,t);let a=[];for(a.push(i);a.length>0;){let o=a.pop()||{},s=o.children||[],u=[];for(let l of s){let c=pee(l),f;c?f=await dee(l,e,t,c,r):f=fee(l,t),f&&(u.push(f),a.push(f))}o.children=u}return i}async function dee(e,t,r,i,n){var E,T,k;let{subdivisionScheme:a,maximumLevel:o,subtreeLevels:s,subtrees:{uri:u}}=i,l=ES(u,0,0,0,0),c=jB(l,r),f=await Wr(c,_S,n),h=jB((E=e.content)==null?void 0:E.uri,r),d=(T=t==null?void 0:t.root)==null?void 0:T.refine,p=e.geometricError,y=(k=e.boundingVolume.extensions)==null?void 0:k["3DTILES_bounding_volume_S2"];if(y){let D={box:wS(y),s2VolumeInfo:y};e.boundingVolume=D}let g=e.boundingVolume,b={contentUrlTemplate:h,subtreesUriTemplate:u,subdivisionScheme:a,subtreeLevels:s,maximumLevel:o,refine:d,basePath:r,lodMetricType:ic.GEOMETRIC_ERROR,rootLodMetricValue:p,rootBoundingVolume:g,getTileType:FB,getRefine:MB};return await WNe(e,r,f,b)}async function WNe(e,t,r,i){if(!e)return null;let{children:n,contentUrl:a}=await BB({subtree:r,options:i}),o,s=null;return a&&(o=a,s={uri:a.replace(`${t}/`,"")}),Je(ae({},e),{id:o,contentUrl:o,lodMetricType:ic.GEOMETRIC_ERROR,lodMetricValue:e.geometricError,transformMatrix:e.transform,type:FB(e,o),refine:MB(e.refine),content:s||e.content,children:n})}function pee(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 hc={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:JE,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:VNe,options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};async function VNe(e,t={},r){let i=t["3d-tiles"]||{},n;return i.isTileset==="auto"?n=(r==null?void 0:r.url)&&r.url.indexOf(".json")!==-1:n=i.isTileset,n?KNe(e,t,r):YNe(e,t,r)}async function KNe(e,t,r){var u;let i=JSON.parse(new TextDecoder().decode(e)),n=(r==null?void 0:r.url)||"",a=$Ne(n),o=await hee(i,a,t||{});return Je(ae({},i),{loader:hc,url:n,queryString:(r==null?void 0:r.queryString)||"",basePath:a,root:o||i.root,type:En.TILES3D,lodMetricType:ic.GEOMETRIC_ERROR,lodMetricValue:((u=i.root)==null?void 0:u.geometricError)||0})}async function YNe(e,t,r){let i={content:{featureIds:null}};return await bB(e,0,t,r,i.content),i.content}function $Ne(e){return $s.dirname(e)}var mee="https://api.cesium.com/v1/assets";async function gee(e,t){if(!t){let a=await XNe(e);for(let o of a.items)o.type==="3DTILES"&&(t=o.id)}let r=await JNe(e,t),{type:i,url:n}=r;return Ut(i==="3DTILES"&&n),r.headers={Authorization:`Bearer ${r.accessToken}`},r}async function XNe(e){Ut(e);let t=mee,r={Authorization:`Bearer ${e}`},i=await ea(t,{fetch:{headers:r}});if(!i.ok)throw new Error(i.statusText);return await i.json()}async function JNe(e,t){Ut(e,t);let r={Authorization:`Bearer ${e}`},i=`${mee}/${t}`,n=await ea(`${i}`,{fetch:{headers:r}});if(!n.ok)throw new Error(n.statusText);let a=await n.json();if(n=await ea(`${i}/endpoint`,{fetch:{headers:r}}),!n.ok)throw new Error(n.statusText);let o=await n.json();return a=ae(ae({},a),o),a}async function QNe(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 gee(r,i)}var SS=Je(ae({},hc),{id:"cesium-ion",name:"Cesium Ion",preload:QNe,parse:async(e,t,r)=>(t=ae({},t),t["3d-tiles"]=t["cesium-ion"],t.loader=SS,hc.parse(e,t,r)),options:{"cesium-ion":Je(ae({},hc.options["3d-tiles"]),{accessToken:null})}});var Da=Fe(require("path"));var nl=Fe(Dee()),q2t=nl.default.v1,U2t=nl.default.v3,pc=nl.default.v4,G2t=nl.default.v5,z2t=nl.default.NIL,H2t=nl.default.version,W2t=nl.default.validate,V2t=nl.default.stringify,K2t=nl.default.parse;var bp=Fe(require("process")),L2=Fe(su()),eL=Fe(YB());var E0=Fe(require("path")),Yde=Fe(su());var Wee=()=>({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 x0=Fe(require("fs")),w0=Fe(require("path"));var Hde=Fe(require("zlib")),Wde=Fe(require("path")),V1=Fe(require("fs")),tot=Fe(wce());var rot=Fe(Oj());var iot=Fe(WB());function T2(e){let t=`${e}.gz`,r=(0,Hde.createGzip)(),i=(0,V1.createReadStream)(e),n=(0,V1.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 Vde(e,t,r,i,n){process.platform==="win32"?await aot(e,t,r,i,n):await not(e,t,r,i)}async function not(e,t,r=0,i="."){let n=K1(t),a=[`-${r}`,"-r",n,i];await new bf().start({command:"zip",arguments:a,spawn:{cwd:e},wait:0})}async function aot(e,t,r=0,i=(0,Wde.join)(".","*"),n){i[0]==="@"&&(i=`*${i.substr(1)}`);let a=K1(t),o=["a","-tzip",`-mx=${r}`,a,i];await new bf().start({command:n,arguments:o,spawn:{cwd:`${e}`},wait:0})}async function Un(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 x0.promises.mkdir(e,{recursive:!0});let n=(0,w0.join)(e,r);try{await x0.promises.writeFile(n,i)}catch(a){throw a}return console.log(`${n} saved.`),n}async function bl(e,t,r="index.json",i=!0,n){let a=await Un(e,t,r);if(i){if(n)return n.includes(a)?null:(n.push(a),`${a}.gz`);{let o=await T2(a);return await Bj(a),o}}return a}async function k2(e,t){return new Promise((r,i)=>{let n=0;console.log(`load ${e}/${t}.`);let a=setInterval(()=>{let o=(0,w0.join)(e,t);Wr(o,LI).then(s=>{clearInterval(a),r(s)}).catch(()=>{n++,n>100&&(clearInterval(a),i(new Error(`Cannon load ${e}/${t}.`)))})},200)})}async function Kde(e){try{return await x0.promises.stat(e),!0}catch{return!1}}function Y1(e){return x0.promises.rm(e,{recursive:!0})}function Bj(e){return x0.promises.unlink(e)}function K1(e){return(0,w0.isAbsolute)(e)?e:(0,w0.join)(process.cwd(),e)}var fo=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,E0.join)(this.converter.layers0Path,"nodepages"),i=`${t.toString()}.json`):(r=(0,E0.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,E0.join)(r,i);return await Kde(n)?(console.log(`load ${n}.`),await k2(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),fo.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?fo.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,Yde.default)({nodeCount:this.nodesCounter},Wee()),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,E0.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,E0.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}),fo.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 $1=Fe(require("path")),R2=Fe(require("fs"));function C2(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 I2(e){let{slpk:t,outputPath:r,tilesetName:i}=e,n=K1(r);try{if(t){let s=(0,$1.join)(n,`${i}.slpk`);return(await R2.promises.stat(s)).size}let a=(0,$1.join)(n,i);return await $de(a)}catch(a){return console.log("Calculate file sizes error: ",a),null}}async function $de(e){let t=0,r=await R2.promises.readdir(e);for(let i of r){let n=await R2.promises.stat((0,$1.join)(e,i));n.isDirectory()?t+=await $de((0,$1.join)(e,i)):t+=n.size}return t}var ks=Fe(dr()),Lj=Fe(Ra());var ppe=Fe(YB());var vp=3,S0=9;function Xde(e){let{positions:t,normals:r,texCoords:i,colors:n,uvRegions:a,featureIndices:o}=e,s=t.length/S0;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=oot(o),l=sot(ae(ae({},u),e)),c=uot(l);return lot(c,u.featureCount)}function oot(e){let t=1,r=1,i=Jde(e.slice(0,vp)),n=[],a=[],o=[i];n[0]=0,a[0]=i;for(let l=vp;l<e.length;l+=vp){let c=Jde(e.slice(l,l+vp));i!==c&&(n[t]=l/vp-1,n[t+1]=l/vp,a[r]=c,o.includes(c)||o.push(c),t+=2,r+=1),i=c}n[t]=e.length/vp-1;let s=new Uint32Array(n),u=o.length;return{faceRange:s,featureCount:u,featureIds:a}}function Jde(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 sot(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=X1("positions",y,g),E=X1("normals",y,g),T=X1("colors",y,g),k=X1("uvRegions",y,g),R=X1("texCoords",y,g);u.push({featureId:t[p],positions:l.slice(0,b),normals:c.slice(0,E),colors:f.slice(0,T),uvRegions:d.slice(0,k),texCoords:h.slice(0,R)}),l=l.slice(b),c=c.slice(E),f=f.slice(T),d=d.slice(k),h=h.slice(R)}return u.sort((p,y)=>p.featureId-y.featureId)}function X1(e,t,r){let i=4,n=2,a=r-t+1,o=a*3;switch(e){case"positions":case"normals":return a*S0;case"colors":case"uvRegions":return o*i;case"texCoords":return o*n;default:return 0}}function uot(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=ua(n.positions,i.positions),n.normals=ua(n.normals,i.normals),n.colors=ua(n.colors,i.colors),n.texCoords=ua(n.texCoords,i.texCoords)):t.push(i)}return t}function lot(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=ua(n,p.positions),a=ua(a,p.normals),o=ua(o,p.colors),s=ua(s,p.uvRegions),u=ua(u,p.texCoords);let y=e[c];l.push(y.positions.length/S0-1+f),l.push(y.positions.length/S0+f),f+=y.positions.length/S0,c+=1}return l.push(n.length/S0-1),{faceRange:new Uint32Array(l),featureIds:i,positions:n,normals:a,colors:o,uvRegions:s,texCoords:u,featureCount:t}}var Ba=Fe(dr()),A0=Fe(Ra()),Bc=Fe(Zu());function Dj(e,t){let r,i,n,a=A0.Ellipsoid.WGS84.cartesianToCartographic(e.center,new Ba.Vector3);return a[2]=a[2]-t.getHeight(a[1],a[0]),e instanceof Bc.OrientedBoundingBox?(i=e.halfSize,r=new Ba.Vector3(i[0],i[1],i[2]).len(),n=e.quaternion):(r=e.radius,i=[r,r,r],n=new Ba.Quaternion().fromMatrix3(new Ba.Matrix3([i[0],0,0,0,i[1],0,0,0,i[2]])).normalize()),{mbs:[a[0],a[1],a[2],r],obb:{center:[a[0],a[1],a[2]],halfSize:i,quaternion:n}}}function Qde(e,t){let r=cot(e),i=(0,Bc.makeOrientedBoundingBoxFromPoints)(r),n=(0,Bc.makeBoundingSphereFromPoints)(r),a=A0.Ellipsoid.WGS84.cartesianToCartographic(n.center,new Ba.Vector3),o=A0.Ellipsoid.WGS84.cartesianToCartographic(i.center,new Ba.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 cot(e){let t=[];for(let r=0;r<e.length;r+=3){let i=new Ba.Vector3([e[r],e[r+1],e[r+2]]);t.push(i)}return t}function Zde(e){let t;e instanceof Bc.BoundingSphere?t=e:t=e.getBoundingSphere();let r=t.center,i=t.radius,n=A0.Ellipsoid.WGS84.cartesianToCartographic(new Ba.Vector3(r[0]+i,r[1]+i,r[2]+i),new Ba.Vector3),a=A0.Ellipsoid.WGS84.cartesianToCartographic(new Ba.Vector3(r[0]-i,r[1]-i,r[2]-i),new Ba.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 Fj(e){let t=e[3],r=new Ba.Vector3(e[0],e[1],e[2]),i=new Ba.Matrix3([t,0,0,0,t,0,0,0,t]);return new Bc.OrientedBoundingBox(r,i)}var yp=Fe(dr()),epe=Fe(Ra());function tpe(e,t,r){var s,u,l,c,f,h,d,p;let i=((u=(s=e.gltf)==null?void 0:s.scene)==null?void 0:u.nodes)||((f=(c=(l=e.gltf)==null?void 0:l.scenes)==null?void 0:c[0])==null?void 0:f.nodes)||((h=e.gltf)==null?void 0:h.nodes)||[],n=((p=(d=e.gltf)==null?void 0:d.images)==null?void 0:p.map(y=>{var g,b;if((g=y==null?void 0:y.image)==null?void 0:g.compressed)return null;{let E=(b=y==null?void 0:y.image)==null?void 0:b.data,T=new Uint8Array(E.length);return T.set(E),{data:T,compressed:!1,height:y.image.height,width:y.image.width,components:y.image.components,mimeType:y.mimeType}}}))||[];rpe(i);let{cartographicOrigin:a,modelMatrix:o}=hot(e,t,r);return{nodes:i,images:n,cartographicOrigin:a,cartesianModelMatrix:o}}function fot(e){let t={};for(let r in e)t[r]={value:e[r].value};return t}function hot(e,t,r){let{rtcCenter:i,gltfUpAxis:n}=e,{center:a}=r,o=new yp.Matrix4(t);switch(i&&o.translate(i),n){case"Z":break;case"Y":let l=new yp.Matrix4().rotateX(Math.PI/2);o=o.multiplyRight(l);break;case"X":let c=new yp.Matrix4().rotateY(-Math.PI/2);o=o.multiplyRight(c);break;default:break}let s=new yp.Vector3(a),u=epe.Ellipsoid.WGS84.cartesianToCartographic(s,new yp.Vector3);return{modelMatrix:o,cartographicOrigin:u}}function rpe(e){var t;for(let r=0;r<e.length;r++){let i=e[r];i.mesh&&(e[r]=Je(ae({},i),{mesh:Je(ae({},i.mesh),{primitives:(t=i.mesh)==null?void 0:t.primitives.map(n=>{var a,o,s;return Je(ae({},n),{indices:{value:(a=n==null?void 0:n.indices)==null?void 0:a.value},attributes:fot(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&&rpe(i.children)}}var dot="EXT_mesh_features",pot="EXT_feature_metadata";function ipe(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 pot:return mot(e,a,r);case dot:return console.warn("EXT_mesh_features extension is not supported yet"),[];default:return[]}return[]}function mot(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 got(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 vot(n,y,r)}let a=(t==null?void 0:t.featureTextures)&&(t==null?void 0:t.featureTextures[0]);return a?e[a].value:[]}function got(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 vot(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&&(o==null?void 0:o.width)&&(o==null?void 0:o.height)&&(o==null?void 0:o.components))for(let h=0;h<t.length;h+=2){let d=t[h],p=t[h+1],y=Math.min(npe(d)*o.width|0,o.width-1),b=(Math.min(npe(p)*o.height|0,o.height-1)*o.width+y)*o.components+u,E=new Uint8Array(o.data)[b];s.push(E)}else console.warn(`Can't get batch Ids from ${(o==null?void 0:o.mimeType)||""} compressed texture`);return s}function npe(e){return(e%1+1)%1}function ape(e,t){let r={};for(let i in t){let n=t[i];r[i]=yot(n,e)}return r}function yot(e,t){let r=[];for(let i of t){let n=e[i]||null;r.push(n)}return r}function ope(e,t){let r=!1;for(let i of Object.values(t))e.length!==i.length&&(r=!0);return r}var J1="string",Mj="Int32",jj="double",P2="OBJECTID";function spe(e,t){return e===P2?P2:typeof t===J1?J1:typeof t=="number"?Number.isInteger(t)?Mj:jj:J1}function upe(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 P2:bot(i);break;case J1:hpe(i);break;case jj:_ot(i);break;case Mj:break;default:hpe(i)}return i}function lpe(e){switch(e){case P2:return"esriFieldTypeOID";case J1:return"esriFieldTypeString";case Mj:return"esriFieldTypeInteger";case jj:return"esriFieldTypeDouble";default:return"esriFieldTypeString"}}function cpe(e,t){return{name:e,type:t,alias:e}}function fpe(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 hpe(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 bot(e){e.attributeValues={valueType:"Oid32",valuesPerElement:1}}function _ot(e){e.attributeValues={valueType:"Float64",valuesPerElement:1}}var dpe=e=>{let t=new Uint32Array(e);for(let r=0;r<e;r++)t[r]=r;return t};var xot=1,wot=1,mu=3,Q1=2,Eot=4,Sot="string",Aot="Int32",Tot="Float64",kot="Oid32",mpe=["CUSTOM_ATTRIBUTE_2","_BATCHID","BATCHID"],gpe="EXT_feature_metadata",vpe="EXT_mesh_features",Oh=new ks.Vector3;async function Nj(e,t,r,i,n,a,o,s,u,l,c,f){var b;let h=u,d=await Got((b=e.gltf)==null?void 0:b.materials,l),p=tpe(e,t,r),y=await Iot(p,d,h);u&&Rot(y,c);let g=[];for(let E of d){let T=E.mergedMaterials[0].originalMaterialId;if(!y.has(T))continue;let k=y.get(T);if(!k)continue;let{material:R,texture:D}=E,C=await i();g.push(await Cot({convertedAttributes:k,material:R,texture:D,tileContent:e,nodeId:C,featuresHashArray:a,propertyTable:n,attributeStorageInfo:o,draco:s,workerSource:f}))}return g.length?g:null}function Rot(e,t){for(let r of e.values()){let i=Qde(r.positions,t);r.boundingVolumes=i;let n=i.obb.center;for(let a=0;a<r.positions.length;a+=mu){let o=r.positions.subarray(a,a+mu);Lj.Ellipsoid.WGS84.cartesianToCartographic(Array.from(o),Oh),Oh[2]=Oh[2]-t.getHeight(Oh[1],Oh[0]),Oh=Oh.subtract(n),r.positions.set(Oh,a)}}}async function Cot({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/mu,{faceRange:h,featureIds:d,positions:p,normals:y,colors:g,uvRegions:b,texCoords:E,featureCount:T}=Xde(e);i.batchTableJson&&Zot(d,e.featureIndices,a,i.batchTableJson);let k=new Uint32Array(2),R=ust(d);k.set([f,T],0);let D=new Uint8Array(Wu(k.buffer,p.buffer,y.buffer,r?E.buffer:new ArrayBuffer(0),g.buffer,b,R.buffer,h.buffer)),C=u?lst(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=ist(d,o,s)),{nodeId:n,geometry:D,compressedGeometry:C,texture:r,hasUvRegions:Boolean(b.length),sharedResources:Yot(((B=i.gltf)==null?void 0:B.materials)||[],n),meshMaterial:t,vertexCount:f,attributes:L,featureCount:T,boundingVolumes:c}}async function Iot(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)}ype(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 ype(e,t,r,i,n,a,o=new ks.Matrix4([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])){if(e)for(let s of e)Oot(s,t,r,i,n,a,o)}function Pot(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 Oot(e,t,r,i,n,a,o=new ks.Matrix4([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])){let s=Pot(e,o),u=e.mesh;u&&Bot(u,t,r,i,n,a,s),ype(e.children||[],t,r,i,n,a,s)}function Bot(e,t,r,i,n,a=!1,o=new ks.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.id),c=(s=l==null?void 0:l.mergedMaterials.find(({originalMaterialId:d})=>{var p;return d===((p=u.material)==null?void 0:p.id)}))==null?void 0:s.uvRegion):n.has("default")&&(l=n.get("default")),Ut(l!==null,"Primitive - material mapping failed"),Ut(u.mode===void 0||u.mode===Zt.TRIANGLES||u.mode===Zt.TRIANGLE_STRIP,`Primitive - unsupported mode ${u.mode}`);let f=u.attributes;if(!l)continue;let h=Dot(u);l.positions=ua(l.positions,bpe({vertices:f.POSITION.value,cartographicOrigin:r,cartesianModelMatrix:i,nodeMatrix:o,indices:h,attributeSpecificTransformation:Fot,useCartesianPositions:a})),l.normals=ua(l.normals,bpe({vertices:f.NORMAL&&f.NORMAL.value,cartographicOrigin:r,cartesianModelMatrix:i,nodeMatrix:o,indices:h,attributeSpecificTransformation:Mot,useCartesianPositions:!1})),l.texCoords=ua(l.texCoords,jot(f.TEXCOORD_0&&f.TEXCOORD_0.value,h)),l.colors=ua(l.colors,Lot(f.COLOR_0,h)),c&&(l.uvRegions=ua(l.uvRegions,Not(c,h))),l.featureIndicesGroups=l.featureIndicesGroups||[],l.featureIndicesGroups.push(qot(Uot(f,u,t),h))}}function Dot(e){var r;let t=(r=e.indices)==null?void 0:r.value;if(!t){let i=e.attributes.POSITION.value;return dpe(i.length/mu)}if(t&&e.mode===Zt.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 bpe(e){let{vertices:t,indices:r,attributeSpecificTransformation:i}=e,n=new Float32Array(r.length*mu);if(!t)return n;for(let a=0;a<r.length;a++){let o=r[a]*mu,s=t.subarray(o,o+mu),u=new ks.Vector3(Array.from(s));u=i(u,e),n[a*mu]=u.x,n[a*mu+1]=u.y,n[a*mu+2]=u.z}return n}function Fot(e,t){let{cartesianModelMatrix:r,cartographicOrigin:i,nodeMatrix:n,useCartesianPositions:a}=t;return n&&(e=e.transform(n)),e=e.transform(r),a||(Lj.Ellipsoid.WGS84.cartesianToCartographic([e[0],e[1],e[2]],e),e=e.subtract(i)),e}function Mot(e,t){let{cartesianModelMatrix:r,nodeMatrix:i}=t;return i&&(e=e.transformAsVector(i)),e=e.transformAsVector(r),e}function jot(e,t){let r=new Float32Array(t.length*Q1);if(!e)return r.fill(1),r;for(let i=0;i<t.length;i++){let n=t[i]*Q1,a=e.subarray(n,n+Q1);r[i*Q1]=a[0],r[i*Q1+1]=a[1]}return r}function Lot(e,t){let r=(e==null?void 0:e.components)||Eot,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 Not(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 qot(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 Uot(e,t,r){let i=ipe(e,t,r);if(i.length)return i;for(let n=0;n<mpe.length;n++){let a=mpe[n];if(e[a]&&e[a].value)return e[a].value}return[]}async function Got(e=[],t){let r=[];for(let i of e)r.push(Wot(i));return t&&(r=await zot(r)),r}async function zot(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 Hot(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:Kot(),mergedMaterials:[{originalMaterialId:"default"}]}),t}async function Hot(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 Wot(e){var n,a,o,s,u;let t={doubleSided:e.doubleSided,emissiveFactor:(n=e.emissiveFactor)==null?void 0:n.map(l=>Math.round(l*255)),alphaMode:Vot(e.alphaMode),pbrMetallicRoughness:{roughnessFactor:((a=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:a.roughnessFactor)||xot,metallicFactor:((o=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:o.metallicFactor)||wot}},r;((s=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:s.baseColorTexture)?(r=e.pbrMetallicRoughness.baseColorTexture.texture.source,t.pbrMetallicRoughness.baseColorTexture={textureSetDefinitionId:0}):e.emissiveTexture&&(r=e.emissiveTexture.texture.source,t.pbrMetallicRoughness.baseColorTexture={textureSetDefinitionId:0}),e.id=Number.isFinite(e.id)?e.id:pc();let i=[{originalMaterialId:e.id}];if(r)i[0].textureSize={width:r.image.width,height:r.image.height};else{let l=(u=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:u.baseColorFactor;t.pbrMetallicRoughness.baseColorFactor=l&&l.map(c=>Math.round(c*255))||void 0}return{material:t,texture:r,mergedMaterials:i}}function Vot(e){switch(e){case"OPAQUE":return"opaque";case"MASK":return"mask";case"BLEND":return"blend";default:return"opaque"}}function Kot(){return{alphaMode:"opaque",pbrMetallicRoughness:{metallicFactor:1,roughnessFactor:1}}}function Yot(e,t){let r={};if(!e||!e.length)return r;r.materialDefinitionInfos=[];for(let i of e){let{materialDefinitionInfo:n,textureDefinitionInfo:a}=$ot(i,t);r.materialDefinitionInfos.push(n),a&&(r.textureDefinitionInfos=r.textureDefinitionInfos||[],r.textureDefinitionInfos.push(a))}return r}function $ot(e,t){var s;let r=((s=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:s.baseColorTexture)||e.emissiveTexture,i=null;r&&(i=Jot(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:Xot(o||[1,1,1,1],a),textureDefinitionInfo:i}}function Xot(e,t=1){let r=.04/255,i=new ks.Vector4(0,0,0,1),n=new ks.Vector4(1,1,1,1),a=new ks.Vector4(r,r,r,0),o=new ks.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 Jot(e,t){var r,i,n,a;return{encoding:((r=e==null?void 0:e.source)==null?void 0:r.mimeType)?[e.source.mimeType]:void 0,images:[{id:Qot(e,t),size:(i=e.source)==null?void 0:i.image.width,length:((n=e.source)==null?void 0:n.image.data.length)?[(a=e.source)==null?void 0:a.image.data.length]:void 0}]}}function Qot(e,t){var y;let{width:r,height:i}=((y=e.source)==null?void 0:y.image)||{};if(!r||!i)return"";let 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 Zot(e,t,r,i){let n=est(e,i,r);_pe(t,n),_pe(e,n)}function est(e,t,r){let i={};for(let n=0;n<e.length;n++){let a=e[n],o=rst(n,t,r);i[a.toString()]=o}return i}function tst(e,t){let r="";for(let i in e)r+=e[i][t];return r}function rst(e,t,r){let i=tst(t,e),n=(0,ppe.default)(i);return r.includes(n)?r.indexOf(n):r.push(n)-1}function _pe(e,t){for(let r=0;r<e.length;r++)e[r]=t[e[r]]}function ist(e,t,r){let i=[],a=ope(e,t)?ape(e,t):t,o=ae({OBJECTID:e},a);for(let s in o){let u=ast(s,r),l=o[s],c=nst(u,l);i.push(c)}return i}function nst(e,t){let r;switch(e){case kot:case Aot:r=ost(t);break;case Tot:r=sst(t);break;case Sot:r=xpe(t);break;default:r=xpe(t)}return r}function ast(e,t){return t.find(i=>i.name===e).attributeValues.valueType}function ost(e){let t=new Uint32Array([e.length]),r=new Uint32Array(e);return Wu(t.buffer,r.buffer)}function sst(e){let t=new Uint32Array([e.length]),r=new Uint8Array(4),i=new Float64Array(e);return Wu(t.buffer,r.buffer,i.buffer)}function xpe(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 Wu(t.buffer,a.buffer,i.buffer,...n)}function ust(e){let t=new BigUint64Array(e.length);for(let r=0;r<e.length;r++)t[r]=BigInt(e[r]);return t}async function lst(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=cst(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"}),Tm({attributes:p,indices:f},Ly,Je(ae({},Ly.options),{source:i,reuseWorkers:!0,_nodeWorkers:!0,draco:{method:"MESH_SEQUENTIAL_ENCODING",attributesMetadata:y}}))}function cst(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)*mu;r.fill(i,n,o),i++,n=o+1}return r}function wpe(e){if(!e)return null;let t=e==null?void 0:e.batchTableJson;if(t)return t;let{extensionName:r,extension:i}=fst(e);switch(r){case vpe:return console.warn("The I3S converter does not yet support the EXT_mesh_features extension"),null;case gpe:return hst(i);default:return null}}function fst(e){var a,o,s,u;let t=[gpe,vpe];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 hst(e){var t,r;if(e==null?void 0:e.featureTables){let i=(t=Object.keys(e.featureTables))==null?void 0:t[0];if(i){let n=e==null?void 0:e.featureTables[i],a={};for(let o in n.properties)a[o]=n.properties[o].data;return a}}if(e==null?void 0:e.featureTextures){let i=(r=Object.keys(e.featureTextures))==null?void 0:r[0];if(i){let n=e==null?void 0:e.featureTextures[i],a={};for(let o in n.properties)a[o]=n.properties[o].data;return a}}return console.warn("The I3S converter couldn't handle EXT_feature_metadata extension: There is neither featureTables, no featureTextures in the extension."),null}var Spe=Fe(su()),Ape=Fe(require("path"));var Epe=()=>({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 Tpe(e,t,r){let i={serviceItemId:pc().replace(/-/gi,""),layerName:e,layers0:t},n=(0,Spe.default)(i,Epe()),a=(0,Ape.join)(r,"SceneServer");await Un(a,JSON.stringify(n))}var qj=16;function kpe(e,t){let r=[],i=e.boundingVolume,n=e.lodMetricValue||.1,a={metricType:"maxScreenThreshold",maxError:t.mbs[3]*2*qj/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 Uj(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=qj),e.header.mbs[3]*2*qj/r}var qpe=Fe(Npe()),Mst="4.0.0-alpha.8",F2={name:"PGM - Netpbm grayscale image format",id:"pgm",module:"tile-converter",version:Mst,mimeTypes:["image/x-portable-graymap"],parse:async(e,t)=>(0,qpe.parsePGM)(new Uint8Array(e),t),extensions:["pgm"],options:{cubic:!1}};var T0=Fe(su());var Upe={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 jst=()=>({wkid:{path:"wkid",default:4326},latestWkid:{path:"latestWkid",default:4326},vcsWkid:{path:"vcsWkid",default:5773},latestVcsWkid:{path:"latestVcsWkid",default:5773}}),Lst=()=>({heightModel:{path:"heightModel",default:"gravity_related_height"},vertCRS:{path:"vertCRS",default:"EGM96_Geoid"},heightUnit:{path:"heightUnit",default:"meter"}}),Nst=()=>({nodesPerPage:{path:"nodesPerPage"},lodSelectionMetricType:{path:"lodSelectionMetricType",default:"maxScreenThresholdSQ"}}),qst=()=>({xmin:{path:"xmin"},ymin:{path:"ymin"},xmax:{path:"xmax"},ymax:{path:"ymax"},zmin:{path:"zmin"},zmax:{path:"zmax"}}),Gpe=()=>({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,T0.default)(e,jst())},capabilities:{path:"capabilities",default:["View","Query"]},store:{path:"store",transform:e=>(0,T0.default)(e,Upe)},fullExtent:{path:"fullExtent",transform:e=>(0,T0.default)(e,qst())},heightModelInfo:{path:"heightModelInfo",transform:e=>(0,T0.default)(e,Lst())},nodePages:{path:"nodePages",transform:e=>(0,T0.default)(e,Nst())},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 Vj=Fe(su()),Ust=()=>({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}}}),Gst=()=>({"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}}}),zpe=()=>({geometryBuffers:{path:"geometryConfig",transform:e=>{let t=[(0,Vj.default)(e,Ust())];return e.draco&&t.push((0,Vj.default)({geometryConfig:e},Gst())),t}}});var Z1=Fe(su()),zst=()=>({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}}),Hst=()=>({name:{path:"name",default:"standard"},type:{path:"type",default:"standard"},params:{path:"params",transform:(e,t,r)=>(0,Z1.default)(r,zst())}}),Wst=()=>({id:{path:"id"},size:{path:"size"},href:{path:"href",default:["../textures/0"]},length:{path:"length"}}),Vst=()=>({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,Z1.default)(i,Wst()))}}),Hpe=()=>({materialDefinitions:{path:"materialDefinitionInfos",transform:Kst},textureDefinitions:{path:"textureDefinitionInfos",transform:Yst}});function Kst(e,t,r){let i={};for(let[n,a]of e.entries())i[`Mat${r.nodePath}${n}`]=(0,Z1.default)(a,Hst());return i}function Yst(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,Z1.default)(a,Vst())}return i}var M2=Fe(Zu()),Wpe=Fe(dr()),Kj=Fe(Ra()),$st=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 Vpe(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 Xst(t,e),Jst(t,e),t}function Xst(e,t){var o;let r=Qst(t.parentNode.obb),i=Zst(t);if(eut(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 Jst(e,t){var a;let r=Kpe(t.mbs),i=Kpe(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 Kpe(e){return new M2.BoundingSphere([e[0],e[1],e[2]],e[3])}function Qst(e){let{center:t,halfSize:r,quaternion:i}=e;return new M2.OrientedBoundingBox().fromCenterHalfSizeQuaternion(t,r,i)}function Zst(e){let t=e.obb.halfSize,r=$st,i=Kj.Ellipsoid.WGS84.cartographicToCartesian(e.obb.center),n=[];for(let a=0;a<r.length;a+=3){let s=new Wpe.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 eut(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=Kj.Ellipsoid.WGS84.cartesianToCartographic(n);if(e.distanceTo(a)>0){r=!1;break}}return r}var jo;(function(s){s.POINTS="POINTS",s.LINES="LINES",s.LINE_LOOP="LINE_LOOP",s.LINE_STRIP="LINE_STRIP",s.TRIANGLES="TRIANGLES",s.TRIANGLE_STRIP="TRIANGLE_STRIP",s.TRIANGLE_FAN="TRIANGLE_FAN"})(jo||(jo={}));var Yj=class extends Array{enqueue(t){this.push(t)}dequeue(){return this.shift()}peek(){return this[0]}isEmpty(){return this.length===0}};var Ype=Fe(require("process")),tut=4*1024*1024*1024,e_=class extends Yj{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),Ype.default.memoryUsage().rss>tut&&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 rut="4.0.0-alpha.8",$pe={id:"i3s-attributes",name:"I3S Attributes Worker",module:"tile-converter",version:rut,options:{useCartesianPositions:!1}};var k0="Tile converter does not work in browser, only in node js environment";var Xj=Fe(require("path")),Jj=Fe(su());var Xpe=Fe(su()),Jpe=()=>({mbs:{path:"mbs"},obb:{path:"obb"}}),iut=()=>({href:{path:"href"}}),nut=()=>ae(ae({id:{path:"id"}},iut()),Jpe()),$j=()=>Je(ae({version:{path:"version"},id:{path:"id"},path:{path:"path"},level:{path:"level"}},Jpe()),{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,Xpe.default)(e,nut()),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 _l=class{constructor(t,r){this.data=null;this.children=[];this._finalized=!1;this.inPageId=t,this.id=t===0?"root":t.toString(),this.converter=r}get finalized(){return this._finalized}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;if(this.finalized)return;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(ae({},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()}this.finalize()}async save(){this.data&&await this.write(this.data)}finalize(){this._finalized=!0;for(let t of this.children)t.flush()}async write(t){let r=(0,Xj.join)(this.converter.layers0Path,"nodes",this.id);this.converter.options.slpk?await this.converter.writeQueue.enqueue({archiveKey:`nodes/${this.id}/3dNodeIndexDocument.json.gz`,writePromise:()=>bl(r,JSON.stringify(t),"3dNodeIndexDocument.json",!0,this.converter.compressList)},!0):await this.converter.writeQueue.enqueue({writePromise:()=>Un(r,JSON.stringify(t))},!0)}async load(){if(this.data)return this.data;let t=this.id,r=(0,Xj.join)(this.converter.layers0Path,"nodes",t),i="index.json";return this.converter.options.slpk&&(i="3dNodeIndexDocument.json"),await k2(r,i)}flush(){this.data=null}static async createRootNode(t,r){let i=_l.createRootNodeIndexDocument(t);return await new _l(0,r).addData(i)}static async createNode(t,r,i,n,a,o){let s=await _l.createNodeIndexDocument(t,r,i,n,a);return await new _l(n.index,o).addData(s)}static createRootNodeIndexDocument(t){let r=Je(ae({version:`{${pc().toUpperCase()}}`,id:"root",level:0,lodSelection:[{metricType:"maxScreenThresholdSQ",maxError:0},{metricType:"maxScreenThreshold",maxError:0}]},t),{children:[]});return(0,Jj.default)(r,$j())}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=Je(ae({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,Jj.default)(c,$j());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 Qj=async(e,t,r)=>{let i=t.type==="json";if(!e||!t.contentUrl||!i)return;let n=Je(ae({},r),{[e.loader.id]:{isTileset:i,assetGltfUpAxis:e.asset&&e.asset.gltfUpAxis||"Y"}}),a=await Wr(t.contentUrl,e.loader,n);a.root&&(t.children=[a.root])},Zj=async(e,t,r)=>{let i=t.type==="json";if(!e||!t.contentUrl||i)return null;let n=Je(ae({},r),{[e.loader.id]:Je(ae({},r[e.loader.id]||{}),{isTileset:i,assetGltfUpAxis:e.asset&&e.asset.gltfUpAxis||"Y"})});return await Wr(t.contentUrl,e.loader,n)};var tL=Fe(dr());var j2=async(e,t,r,i,n,a=0)=>{if(n&&a>n)return;let o=[],s=await r(e,t);o.push(s);for(let u of e.children)await j2(u,s,r,i,n,a+1);i&&await i(o,t)};var aut=[jo.POINTS,jo.LINES,jo.LINE_LOOP,jo.LINE_STRIP,jo.TRIANGLES,jo.TRIANGLE_STRIP,jo.TRIANGLE_FAN],Qpe=async(e,t)=>{let r={meshTopologyTypes:new Set};if(!(t==null?void 0:t.gltfArrayBuffer))return r;let n=(await Eo(t.gltfArrayBuffer,lc,{gltf:{normalize:!1,loadBuffers:!1,loadImages:!1,decompressMeshes:!1}})).json;if(!n)return r;let a=out(n);return r.meshTopologyTypes=a,r},out=e=>{let t=new Set;for(let r of e.meshes||[])for(let i of r.primitives){let{mode:n}=i;typeof n!="number"&&(n=4),t.add(aut[n])}return t},Zpe=(e,t)=>{for(let r of t.meshTopologyTypes)e.meshTopologyTypes.add(r)};var tme,sut=((tme=bp.default.env)==null?void 0:tme.IonToken)||"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJlYWMxMzcyYy0zZjJkLTQwODctODNlNi01MDRkZmMzMjIxOWIiLCJpZCI6OTYyMCwic2NvcGVzIjpbImFzbCIsImFzciIsImdjIl0sImlhdCI6MTU2Mjg2NjI3M30.1FNiClUyk00YH_nWfSGpiQAjR5V2OvREDq1PJ5QMjWQ",eme=64,uut="3DTILES",lut="3DObject",cut=1800,fut="https://",t_=class{constructor(){this.boundingVolumeWarnings=[];this.conversionStartTime=[0,0];this.refreshTokenTime=[0,0];this.sourceTileset=null;this.loadOptions={_nodeWorkers:!0,reuseWorkers:!0,basis:{format:"rgba32",workerUrl:"./modules/textures/dist/basis-worker-node.js"},draco:{workerUrl:"./modules/draco/dist/draco-worker-node.js"},fetch:{}};this.geoidHeightModel=null;this.Loader=hc;this.workerSource={};this.writeQueue=new e_;this.compressList=null;this.preprocessData={meshTopologyTypes:new Set};this.nodePages=new fo(Un,eme,this),this.options={},this.layers0Path="",this.materialMap=new Map,this.materialDefinitions=[],this.geometryMap=new Map,this.geometryConfigs=[],this.vertexCounter=0,this.layers0=null,this.featuresHashArray=[],this.refinementCounter={tilesCount:0,tilesWithAddRefineCount:0},this.validate=!1,this.generateTextures=!1,this.generateBoundingVolumes=!1,this.layersHasTexture=!1,this.compressList=null}async convert(t){if(on)return console.log(k0),k0;this.conversionStartTime=bp.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(fut)!==-1?SS:hc,this.generateTextures=Boolean(h),this.generateBoundingVolumes=Boolean(d),this.writeQueue=new e_,this.writeQueue.startListening(),console.log("Loading egm file..."),this.geoidHeightModel=await Wr(n,F2),console.log("Loading egm file completed!"),i&&this.nodePages.useWriteFunction(bl),await this.loadWorkers();try{let g=await this._fetchPreloadOptions();g.headers&&(this.loadOptions.fetch={headers:g.headers}),this.sourceTileset=await Wr(a,this.Loader,this.loadOptions),await this.preprocessConversion()&&(await this._createAndSaveTileset(s,r),await this._finishConversion({slpk:Boolean(i),outputPath:s,tilesetName:r}))}catch(g){throw g}finally{await this.writeQueue.finalize(),_n.getWorkerFarm({}).destroy()}return"success"}async preprocessConversion(){console.log("Analyze source tileset");let t=this.sourceTileset.root;await j2(t,null,this.analyzeTile.bind(this),void 0,this.options.maxDepth);let{meshTopologyTypes:r}=this.preprocessData;return console.log("------------------------------------------------"),console.log("Preprocess results:"),console.log(`glTF mesh topology types: ${Array.from(r).join(", ")}`),console.log("------------------------------------------------"),!r.has(jo.TRIANGLES)&&!r.has(jo.TRIANGLE_STRIP)?(console.log("The tileset is of unsupported mesh topology types. The conversion will be interrupted."),console.log("------------------------------------------------"),!1):!0}async analyzeTile(t,r){if(t.type==="json")return await Qj(this.sourceTileset,t,this.loadOptions),null;t.id&&console.log(`[analyze]: ${t.id}`);let i=await Zj(this.sourceTileset,t,Je(ae({},this.loadOptions),{"3d-tiles":Je(ae({},this.loadOptions["3d-tiles"]),{loadGLTF:!1})})),n=await Qpe(t,i);return Zpe(this.preprocessData,n),null}async _createAndSaveTileset(t,r){var u,l,c;let i=(0,Da.join)(`${t}`,`${r}`);try{await Y1(i)}catch{}this.layers0Path=(0,Da.join)(i,"SceneServer","layers","0"),this.materialDefinitions=[],this.materialMap=new Map;let n=this.sourceTileset.root,a=Of(n.boundingVolume,new tL.Matrix4(n.transform),null);this._formLayers0(r,a,(c=(l=(u=this.sourceTileset)==null?void 0:u.root)==null?void 0:l.boundingVolume)==null?void 0:c.region);let o=Dj(a,this.geoidHeightModel);await this.nodePages.push({index:0,lodThreshold:0,obb:o.obb,children:[]});let s=await _l.createRootNode(o,this);await j2(n,{transform:new tL.Matrix4(n.transform),parentNodes:[s]},this.convertTile.bind(this),this.finalizeTile.bind(this),this.options.maxDepth),this.layers0.materialDefinitions=this.materialDefinitions,this.layers0.geometryDefinitions=(0,L2.default)(this.geometryConfigs.map(f=>({geometryConfig:Je(ae({},f),{draco:this.options.draco})})),zpe()),this.layersHasTexture===!1&&(this.layers0.store.defaultGeometrySchema.ordering=this.layers0.store.defaultGeometrySchema.ordering.filter(f=>f!=="uv0")),await this._writeLayers0(),Tpe(r,this.layers0,i);for(let f of this.compressList||[])await T2(f),await Bj(f);await this.nodePages.save(),await this.writeQueue.finalize(),await this._createSlpk(i)}_formLayers0(t,r,i){var s;if(!((s=this.sourceTileset)==null?void 0:s.root))return;let n=Zde(r);i&&(n.zmin=i[4],n.zmax=i[5]);let a=[n.xmin,n.ymin,n.xmax,n.ymax],o={version:`{${pc().toUpperCase()}}`,id:0,name:t,href:"./layers/0",store:{id:`{${pc().toUpperCase()}}`,extent:a},nodePages:{nodesPerPage:eme},compressGeometry:this.options.draco,fullExtent:n};this.layers0=(0,L2.default)(o,Gpe())}async _writeLayers0(){this.options.slpk?await this.writeQueue.enqueue({archiveKey:"3dSceneLayer.json.gz",writePromise:()=>bl(this.layers0Path,JSON.stringify(this.layers0),"3dSceneLayer.json")}):await this.writeQueue.enqueue({writePromise:()=>Un(this.layers0Path,JSON.stringify(this.layers0))})}async _createSlpk(t){if(this.options.slpk){let r=(0,Da.join)(t,"SceneServer","layers","0"),i=`${t}.slpk`;await Vde(r,i,0,".",this.options.sevenZipExe);try{await Y1(t)}catch{}}}async convertTile(t,r){if(t.type==="json"||t.type==="empty")return t.type==="json"&&(t.id&&console.log(`[load]: ${t.id}`),await Qj(this.sourceTileset,t,this.loadOptions)),r;t.id&&console.log(`[convert]: ${t.id}`);let{parentNodes:i,transform:n}=r,a=n.clone();t.transform&&(a=a.multiplyRight(t.transform));let o=i[0],s=await this._createNode(o,t,a);return await o.addChildren(s),{transform:a,parentNodes:s}}async finalizeTile(t,r){for(let i of t)for(let n of i.parentNodes)await n.addNeighbors();for(let i of r.parentNodes)await i.save()}async _createNode(t,r,i){var d,p;this._checkAddRefinementTypeForTile(r),await this._updateTilesetOptions();let n=await Zj(this.sourceTileset,r,this.loadOptions),a=Of(r.boundingVolume,i,null),o=Dj(a,this.geoidHeightModel),s=wpe(n);s&&!((p=(d=this.layers0)==null?void 0:d.attributeStorageInfo)==null?void 0:p.length)&&this._convertPropertyTableToNodeAttributes(s);let u=await this._convertResources(r,i,a,n,t.inPageId,s),l=[],c=[],f=[],h={geometry:null,compressedGeometry:null,texture:null,hasUvRegions:!1,sharedResources:null,meshMaterial:null,vertexCount:null,attributes:null,featureCount:null,boundingVolumes:null};for(let y of u||[h]){this.layersHasTexture=this.layersHasTexture||Boolean(y.texture),this.generateBoundingVolumes&&y.boundingVolumes&&(o=y.boundingVolumes);let g=kpe(r,o),b=g.find(R=>R.metricType==="maxScreenThresholdSQ")||{maxError:0},E=await this._updateNodeInNodePages(b,o,r,t.inPageId,y),T=await _l.createNodeIndexDocument(t,o,g,E,y),k=await new _l(E.index,this).addData(T);l.push(k),E.mesh&&await this._writeResources(y,k.id),this.validate&&(this.boundingVolumeWarnings=Vpe(T),this.boundingVolumeWarnings&&this.boundingVolumeWarnings.length&&console.warn("Bounding Volume Warnings: ",...this.boundingVolumeWarnings)),c.push(E.index),f.push(E)}return l}async _convertResources(t,r,i,n,a,o){var l;if(!this.isContentSupported(t)||!n)return null;let s={center:[],halfSize:[],quaternion:[]};return await Nj(n,r,i,async()=>(await this.nodePages.push({index:0,obb:s},a)).index,o,this.featuresHashArray,(l=this.layers0)==null?void 0:l.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),fo.updateAll(p,h),o&&fo.updateMaterialByNodeId(p,this._findOrCreateMaterial(o)),s){let y=s.image.height*s.image.width;fo.updateTexelCountHintByNodeId(p,y)}return u&&(this.vertexCounter+=u,fo.updateVertexCountByNodeId(p,u)),fo.updateNodeAttributeByNodeId(p),l&&fo.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,Da.join)(this.layers0Path,"nodes",r),l=(0,Da.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,Da.join)(i,"geometries");await this.writeQueue.enqueue({archiveKey:`${n}/geometries/0.bin.gz`,writePromise:()=>bl(a,t,"0.bin")})}else{let a=(0,Da.join)(i,"geometries/0/");await this.writeQueue.enqueue({writePromise:()=>Un(a,t,"index.bin")})}if(this.options.draco)if(this.options.slpk){let a=(0,Da.join)(i,"geometries");await this.writeQueue.enqueue({archiveKey:`${n}/geometries/1.bin.gz`,writePromise:()=>bl(a,r,"1.bin")})}else{let a=(0,Da.join)(i,"geometries/1/");await this.writeQueue.enqueue({writePromise:()=>Un(a,r,"index.bin")})}}async _writeShared(t,r,i,n){if(!t)return;t.nodePath=n;let a=(0,L2.default)(t,Hpe()),o=JSON.stringify(a);if(this.options.slpk){let s=(0,Da.join)(r,"shared");await this.writeQueue.enqueue({archiveKey:`${i}/shared/sharedResource.json.gz`,writePromise:()=>bl(s,o,"sharedResource.json")})}else{let s=(0,Da.join)(r,"shared/");await this.writeQueue.enqueue({writePromise:()=>Un(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=Tm(Je(ae({},t.image),{data:u}),fS,Je(ae({},fS.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=Tm(t.image.data[0],HO);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,Da.join)(n,"textures"),s=!1;await this.writeQueue.enqueue({archiveKey:`${a}/textures/${r}.${i}`,writePromise:()=>bl(o,t,`${r}.${i}`,s)})}else{let o=(0,Da.join)(n,`textures/${r}/`);await this.writeQueue.enqueue({writePromise:()=>Un(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,Da.join)(r,"attributes",s);await this.writeQueue.enqueue({archiveKey:`${i}/attributes/${s}.bin.gz`,writePromise:()=>bl(l,u,"0.bin")})}else{let l=(0,Da.join)(r,`attributes/${s}/0`);await this.writeQueue.enqueue({writePromise:()=>Un(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,eL.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,eL.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=ae({OBJECTID:[0]},t);for(let n in i){let a=i[n][0],o=spe(n,a),s=upe(r,n,o),u=lpe(o),l=cpe(n,u),c=fpe(i);this.layers0.attributeStorageInfo.push(s),this.layers0.fields.push(l),this.layers0.popupInfo=c,this.layers0.layerType=lut,r+=1}}async _finishConversion(t){let{tilesCount:r,tilesWithAddRefineCount:i}=this.refinementCounter,n=i?i/r*100:0,a=await I2(t),o=bp.default.hrtime(this.conversionStartTime),s=C2(o);console.log("------------------------------------------------"),console.log(`Finishing conversion of ${uut}`),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||sut}},r=await this.Loader.preload(this.options.inputUrl,t);return this.refreshTokenTime=bp.default.hrtime(),ae(ae({},t),r)}async _updateTilesetOptions(){if(bp.default.hrtime(this.refreshTokenTime)[0]<cut)return;this.refreshTokenTime=bp.default.hrtime();let r=await this._fetchPreloadOptions();r.headers&&(this.loadOptions.fetch=Je(ae({},this.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){return["b3dm","glTF","scenegraph"].includes(t.type||"")}async loadWorkers(){if(console.log("Loading workers source..."),this.options.draco){let n=Ys(Ly,ae({},wo())),o=await(await ea(n)).text();this.workerSource.draco=o}if(this.generateTextures){let n=Ys(fS,ae({},wo())),o=await(await ea(n)).text();this.workerSource.ktx2=o}let t=Ys($pe,ae({},wo())),i=await(await ea(t)).text();this.workerSource.I3SAttributes=i,console.log("Loading workers source completed!")}};var Ime=Fe(require("path")),sL=Fe(require("process")),Pme=Fe(su());var R0=Fe(rme());var ga;(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"})(ga||(ga={}));var r_;(function(r){r.vertexCount="vertexCount",r.featureCount="featureCount"})(r_||(r_={}));function rL(e){switch(e){case ga.UInt8:return Uint8Array;case ga.UInt16:return Uint16Array;case ga.UInt32:return Uint32Array;case ga.Float32:return Float32Array;case ga.UInt64:return Float64Array;default:throw new Error(`parse i3s tile content: unknown type of data: ${e}`)}}var ime={UInt8:R0.default.UNSIGNED_BYTE,UInt16:R0.default.UNSIGNED_SHORT,Float32:R0.default.FLOAT,UInt32:R0.default.UNSIGNED_INT,UInt64:R0.default.DOUBLE};function C0(e){switch(e){case ga.UInt8:return 1;case ga.UInt16:case ga.Int16:return 2;case ga.UInt32:case ga.Int32:case ga.Float32:return 4;case ga.UInt64:case ga.Int64:case ga.Float64:return 8;default:throw new Error(`parse i3s tile content: unknown size of data: ${e}`)}}var nme="String",ame="Oid32",ome="Float64",sme="Int16",gu;(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"})(gu||(gu={}));var Fh=Fe(dr()),q2=Fe(Ra());function Dh(e,t=null){return t?`${e}?token=${t}`:e}function ume(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 lme(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}function cme(e,t){let{attributeName:r,attributeType:i}=t;return r?{[r]:i?dut(i,e):null}:{}}function dut(e,t){switch(e){case nme:return gut(t);case ame:return fme(t);case ome:return mut(t);case sme:return put(t);default:return fme(t)}}function fme(e){let t=4;return new Uint32Array(e,t)}function put(e){let t=4;return new Int16Array(e,t)}function mut(e){let t=8;return new Float64Array(e,t)}function gut(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 vut="4.0.0-alpha.8";var i_={name:"I3S Attribute",id:"i3s-attribute",module:"i3s",version:vut,mimeTypes:["application/binary"],parse:async(e,t)=>cme(e,t),extensions:["bin"],options:{},binary:!0};function hme(e){return e.hasOwnProperty("objectIds")?"Oid32":e.hasOwnProperty("attributeValues")?e.attributeValues.valueType:""}async function dme(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 pme(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 pme(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]]=yut(o[a.name][f],n);for(let f=0;f<t.value.length;f++){let h=l[t.value[f]];!h||(n.i3s.colorsByAttribute.mode==="multiply"?h.forEach((d,p)=>{e.value[f*4+p]=e.value[f*4+p]*d/255}):e.value.set(h,f*4))}return e}function yut(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 pme(e,{attributeUrls:t},{attributeStorageInfo:r},i){var u;let n=r.findIndex(({name:l})=>e===l);if(n===-1)return null;let a=Dh(t[n],(u=i==null?void 0:i.i3s)==null?void 0:u.token),o=hme(r[n]);return await Wr(a,i_,{attributeName:e,attributeType:o})}var U2=new Fh.Vector3([0,0,0]);function but(e){switch(e){case"ktx-etc2":case"dds":return cS;case"ktx2":return Ed;case"jpg":case"png":default:return rg}}var _ut="i3s-attribute-type";async function mme(e,t,r,i,n){var o;let a={attributes:{},indices:null,featureIds:[],vertexCount:0,modelMatrix:new Fh.Matrix4,coordinateSystem:0,byteLength:0,texture:null};if(t.textureUrl){let s=Dh(t.textureUrl,(o=i==null?void 0:i.i3s)==null?void 0:o.token),u=but(t.textureFormat),c=await(await fetch(s,i==null?void 0:i.fetch)).arrayBuffer();if(i==null?void 0:i.i3s.decodeTextures){if(u===rg){let f=Je(ae({},t.textureLoaderOptions),{image:{type:"data"}});try{a.texture=await n.parse(c,f)}catch{a.texture=await Eo(c,u,f)}}else if(u===cS||u===Ed){let f=await Wr(c,u,t.textureLoaderOptions);u===Ed&&(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=Cut(t.materialDefinition,a.texture),a.material&&(a.texture=null),await xut(e,a,t,r,i)}async function xut(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 Eo(e,$m,{draco:{attributeNameEntry:_ut}});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"]:T}=d.attributes;o={position:p,normal:y,color:g,uv0:b,uvRegion:T,id:E},wut(o,d);let k=But(E);k&&Out(o,k)}else{let{vertexAttributes:d,ordering:p,featureAttributes:y,featureAttributeOrder:g}=i.store.defaultGeometrySchema,b=Sut(e,i);u=b.byteOffset,s=b.vertexCount,l=b.featureCount;let{attributes:E,byteOffset:T}=vme(e,u,d,s,p),{attributes:k}=vme(e,T,y,l,g);Put(k),o=Eut(E,k)}if(!((h=n==null?void 0:n.i3s)==null?void 0:h.coordinateSystem)||n.i3s.coordinateSystem===gu.METER_OFFSETS){let d=Tut(o.position,r);t.modelMatrix=d.invert(),t.coordinateSystem=gu.METER_OFFSETS}else t.modelMatrix=Rut(o.position),t.coordinateSystem=gu.LNGLAT_OFFSETS;o.color=await dme(o.color,o.id,r,i,n),t.attributes={positions:o.position,normals:o.normal,colors:gme(o.color),texCoords:o.uv0,uvRegions:gme(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 wut(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 Eut(e,t){return ae(ae({},e),t)}function gme(e){return e&&(e.normalized=!0,e)}function Sut(e,t){let r=0,i=0,n=0;for(let{property:a,type:o}of t.store.defaultGeometrySchema.header){let s=rL(o);switch(a){case r_.vertexCount:i=new s(e,0,4)[0],r+=C0(o);break;case r_.featureCount:n=new s(e,4,4)[0],r+=C0(o);break;default:break}}return{vertexCount:i,featureCount:n,byteOffset:r}}function vme(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*C0(s)<=e.byteLength){let l=e.slice(t),c;if(s==="UInt64")c=Aut(l,i*u,C0(s));else{let f=rL(s);c=new f(l,0,i*u)}switch(a[o]={value:c,type:ime[s],size:u},o){case"color":a.color.normalized=!0;break;case"position":case"region":case"normal":default:}t=t+i*u*C0(s)}else if(o!=="uv0")break}return{attributes:a,byteOffset:t}}function Aut(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 Tut(e,t){let r=t.mbs,i=e.value,n=e.metadata,a=new Fh.Matrix4,o=new Fh.Vector3(r[0],r[1],r[2]),s=new Fh.Vector3;return q2.Ellipsoid.WGS84.cartographicToCartesian(o,s),q2.Ellipsoid.WGS84.eastNorthUpToFixedFrame(s,a),e.value=kut(i,n,o),a}function kut(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)q2.Ellipsoid.WGS84.cartographicToCartesian(i.subarray(o,o+3),U2),i[o]=U2.x,i[o+1]=U2.y,i[o+2]=U2.z;return i}function Rut(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 Fh.Matrix4;return n[0]=r,n[5]=i,n}function Cut(e,t){let r;return e?r=Je(ae({},e),{pbrMetallicRoughness:e.pbrMetallicRoughness?ae({},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=yme(r.emissiveFactor)),r.pbrMetallicRoughness&&r.pbrMetallicRoughness.baseColorFactor&&(r.pbrMetallicRoughness.baseColorFactor=yme(r.pbrMetallicRoughness.baseColorFactor)),t&&Iut(r,t),r}function yme(e){let t=[...e];for(let r=0;r<e.length;r++)t[r]=e[r]/255;return t}function Iut(e,t){let r={source:{image:t}};e.pbrMetallicRoughness&&e.pbrMetallicRoughness.baseColorTexture?e.pbrMetallicRoughness.baseColorTexture=Je(ae({},e.pbrMetallicRoughness.baseColorTexture),{texture:r}):e.emissiveTexture?e.emissiveTexture=Je(ae({},e.emissiveTexture),{texture:r}):e.pbrMetallicRoughness&&e.pbrMetallicRoughness.metallicRoughnessTexture?e.pbrMetallicRoughness.metallicRoughnessTexture=Je(ae({},e.pbrMetallicRoughness.metallicRoughnessTexture),{texture:r}):e.normalTexture?e.normalTexture=Je(ae({},e.normalTexture),{texture:r}):e.occlusionTexture&&(e.occlusionTexture=Je(ae({},e.occlusionTexture),{texture:r}))}function Put(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 Out(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 But(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 Dut="4.0.0-alpha.8",bme={name:"I3S Content (Indexed Scene Layers)",id:"i3s-content",module:"i3s",worker:!0,version:Dut,mimeTypes:["application/octet-stream"],parse:Fut,extensions:["bin"],options:{"i3s-content":{}}};async function Fut(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 mme(e,s,u,t,r)}var xme=Fe(Zu()),nL=Fe(Ra());var Mut="4.0.0-alpha.8";async function jut(e,t){return JSON.parse(new TextDecoder().decode(e))}var _me={name:"I3S Node Page",id:"i3s-node-page",module:"i3s",version:Mut,mimeTypes:["application/json"],parse:jut,extensions:["json"],options:{}};var G2=class{constructor(t,r){this.nodePages=[];this.pendingNodePages=[];this.textureDefinitionsSelectedFormats=[];this.textureLoaderOptions={};var i,n;this.tileset=ae({},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=Dh(`${this.tileset.url}/nodepages/${r}`,(n=this.options.i3s)==null?void 0:n.token);this.pendingNodePages[r]={status:"Pending",promise:Wr(a,_me,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=lme(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:ag(),containerFormat:"ktx2",module:"encoder"}),this.textureDefinitionsSelectedFormats.push(o)}}getSupportedTextureFormats(){let t=[];if(!this.options.i3s||this.options.i3s.useCompressedTextures){let r=Gy();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 wme(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=ume(r,e)),iL(Je(ae({},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=[...nL.Ellipsoid.WGS84.cartographicToCartesian(e.mbs.slice(0,3)),e.mbs[3]];else if(e.obb){t.box=[...nL.Ellipsoid.WGS84.cartographicToCartesian(e.obb.center),...e.obb.halfSize,...e.obb.quaternion];let f=new xme.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=tl.MESH,s=ta.REPLACE;return Je(ae({},e),{mbs:r,boundingVolume:t,lodMetricType:i,lodMetricValue:n,transformMatrix:a,type:o,refine:s})}async function Eme(e,t,r){var i;if(e.url=r.url,e.nodePages)e.nodePagesTile=new G2(e,t),e.root=e.nodePagesTile.formTileFromNodePages(0);else{let n=Dh(`${e.url}/nodes/root`,(i=t.i3s)==null?void 0:i.token);e.root=await Wr(n,e.loader,Je(ae({},t),{i3s:Je(ae({},t.i3s),{loadContent:!1,isTileHeader:!0,isTileset:!1})}))}e.basePath=e.url,e.type=En.I3S,e.lodMetricType=e.root.lodMetricType,e.lodMetricValue=e.root.lodMetricValue}var Lut="4.0.0-alpha.8",Nut=/layers\/[0-9]+$/,qut=/nodes\/([0-9-]+|root)$/,Uut="504b0304",Gut="PointCloud",z2={name:"I3S (Indexed Scene Layers)",id:"i3s",module:"i3s",version:Lut,mimeTypes:["application/octet-stream"],parse:zut,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:gu.METER_OFFSETS,colorsByAttribute:null}}};async function zut(e,t={},r){let i=r.url;if(t.i3s=t.i3s||{},Kut(e)===Uut)throw new Error("Files with .slpk extention currently are not supported by I3SLoader");let a;t.i3s.isTileset==="auto"?a=Nut.test(i):a=t.i3s.isTileset;let o;return t.isTileHeader==="auto"?o=qut.test(i):o=t.i3s.isTileHeader,a?e=await Wut(e,t,r):o?e=await Vut(e,r):e=await Hut(e,t),e}async function Hut(e,t){return await Eo(e,bme,t)}async function Wut(e,t,r){let i=JSON.parse(new TextDecoder().decode(e));if((i==null?void 0:i.layerType)===Gut)throw new Error("Point Cloud layers currently are not supported by I3SLoader");return i.loader=z2,await Eme(i,t,r),i}async function Vut(e,t){return e=JSON.parse(new TextDecoder().decode(e)),wme(e,t)}function Kut(e){return e instanceof ArrayBuffer?[...new Uint8Array(e,0,4)].map(t=>t.toString(16).padStart(2,"0")).join(""):null}var Sme=Fe(dr()),Ame=Fe(Ra()),Tme=Fe(Zu());function aL(e,t){let r=[e.center[0],e.center[1],e.center[2]+t.getHeight(e.center[1],e.center[0])],i=Ame.Ellipsoid.WGS84.cartographicToCartesian(r,new Sme.Vector3),n=new Tme.OrientedBoundingBox().fromCenterHalfSizeQuaternion(i,e.halfSize,e.quaternion);return[...n.center,...n.halfAxes.toArray()]}var H2=Fe(su()),Yut=()=>({version:{path:"version",default:"1.0"}}),kme=()=>({boundingVolume:{path:"boundingVolume"},geometricError:{path:"geometricError"},content:{path:"content"},children:{path:"children",transform:e=>e.map(t=>(0,H2.default)(t,kme()))}}),Rme=()=>({asset:{path:"asset",transform:e=>(0,H2.default)(e,Yut())},geometricError:{path:"root",transform:e=>e.geometricError},root:{path:"root",transform:e=>(0,H2.default)(e,kme())}});var $ut="4.0.0-alpha.8",oL={id:"3d-tiles-attributes",name:"3DTiles Attributes Worker",module:"tile-converter",version:$ut,options:{featureAttributes:null}};function Cme(e,t){return Qv(oL,e,t)}var Xut="I3S",n_=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(on)return console.log(k0),k0;let{inputUrl:r,outputPath:i,tilesetName:n,maxDepth:a,egmFilePath:o}=t;this.conversionStartTime=sL.default.hrtime(),this.options={maxDepth:a},console.log("Loading egm file..."),this.geoidHeightModel=await Wr(o,F2),console.log("Loading egm file completed!"),await this.loadWorkers();let s=await Wr(r,z2,{});this.sourceTileset=new XE(s,{loadOptions:{_nodeWorkers:!0,reuseWorkers:!0,i3s:{coordinateSystem:gu.LNGLAT_OFFSETS,decodeTextures:!1}}}),await this.sourceTileset.tilesetInitializationPromise;let u=this.sourceTileset.root;u.header.obb||(u.header.obb=Fj(u.header.mbs)),this.tilesetPath=(0,Ime.join)(`${i}`,`${n}`),this.attributeStorageInfo=s.attributeStorageInfo;try{await Y1(this.tilesetPath)}catch{}let l={boundingVolume:{box:aL(u.header.obb,this.geoidHeightModel)},geometricError:Uj(u),children:[]};await this._addChildren(u,l,1);let c=(0,Pme.default)({root:l},Rme());await Un(this.tilesetPath,JSON.stringify(c),"tileset.json"),this._finishConversion({slpk:!1,outputPath:i,tilesetName:n}),_n.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=Fj(a.header.mbs));let u={box:aL(a.header.obb,this.geoidHeightModel)},l={boundingVolume:u,geometricError:Uj(a),children:[]},c={tileContent:a.content,textureFormat:(o=a==null?void 0:a.header)==null?void 0:o.textureFormat},f=await Cme(c,{source:this.workerSource.tile3dWorkerSource,featureAttributes:s});l.content={uri:`${a.id}.b3dm`,boundingVolume:u},await Un(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:Je(ae({},this.sourceTileset.loadOptions),{isTileHeader:!0,loadContent:!1})};console.log(`Node conversion: ${a}`),i=await Wr(a,n,o)}return new sc(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(Wr(s,i_,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 I2(t),i=sL.default.hrtime(this.conversionStartTime),n=C2(i);console.log("------------------------------------------------"),console.log(`Finish conversion of ${Xut}`),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=Ys(oL,ae({},wo())),i=await(await ea(t)).text();this.workerSource.tile3dWorkerSource=i,console.log("Loading workers source completed!")}};var Ome=Fe(Oj()),Jut="4.0.0-alpha.8",uL={id:"zip",module:"zip",name:"Zip Archive",version:Jut,extensions:["zip"],mimeTypes:["application/zip"],category:"archive",tests:["PK"],options:{},parse:Qut};async function Qut(e,t={}){let r=[],i={};try{let n=new Ome.default;return(await n.loadAsync(e,t)).forEach((o,s)=>{let u=s.name,l=Zut(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 Zut(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 lL=Fe(require("path"));var elt="4.0.0-alpha.8",tlt="https://raw.githubusercontent.com/visgl/deck.gl-data/master/egm/egm2008-5.zip",cL=class{async install(t="",r=""){console.log('Installing "EGM2008-5" model...');let i=await Wr(tlt,uL,{}),n=process.cwd();t&&(n=(0,lL.join)(n,t)),await Un(n,new Uint8Array(i["geoids/egm2008-5.pgm"]),"egm2008-5.pgm"),console.log('Installing "I3S Content Loader worker"'),await this.installWorker("i3s","i3s-content-worker-node.js",r),console.log('Installing "Draco Loader worker"'),await this.installWorker("draco","draco-worker-node.js",r),console.log('Installing "Basis Loader worker"'),await this.installWorker("textures","basis-worker-node.js",r),console.log('Installing "join-images" npm package'),await new bf().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 ea(`https://unpkg.com/@loaders.gl/${t}@${elt}/dist/${r}`)).arrayBuffer();if(!a)return;let o=(0,lL.join)(process.cwd(),i,"modules",t,"dist");await Un(o,a,r)}};var fL={I3S:"I3S",_3DTILES:"3DTILES"};async function rlt(){let[,,...e]=process.argv;e.length===0&&hL();let t=alt(e),r=olt(t);if(r.installDependencies){new cL().install("deps");return}let i=nlt(r);await ilt(i)}rlt().catch(e=>{console.log(e),process.exit(1)});function hL(){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 ilt(e){switch(console.log("------------------------------------------------"),console.log(`Starting conversion of ${e.inputType}`),console.log("------------------------------------------------"),e.inputType.toUpperCase()){case fL.I3S:new n_().convert({inputUrl:e.tileset,outputPath:e.output,tilesetName:e.name,maxDepth:e.maxDepth,egmFilePath:e.egm});break;case fL._3DTILES:await new t_().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:hL()}}function nlt(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(fL).includes(n.toUpperCase());(!n||a)&&r.push(t[i])}return r.length&&(r.forEach(i=>i()),process.exit(1)),e}function alt(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 olt(e){let t={output:"data",instantNodeWriting:!1,mergeMaterials:!0,sevenZipExe:"C:\\Program Files\\7-Zip\\7z.exe",egm:(0,Bme.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=Fc(i,e);break;case"--tileset":t.tileset=slt(i,e);break;case"--name":t.name=Fc(i,e);break;case"--output":t.output=Fc(i,e);break;case"--instant-node-writing":t.instantNodeWriting=Mh(i,e);break;case"--split-nodes":t.mergeMaterials=Mh(i,e);break;case"--max-depth":t.maxDepth=ult(i,e);break;case"--slpk":t.slpk=Mh(i,e);break;case"--7zExe":t.sevenZipExe=Fc(i,e);break;case"--egm":t.egm=Fc(i,e);break;case"--token":t.token=Fc(i,e);break;case"--no-draco":t.draco=Mh(i,e);break;case"--validate":t.validate=Mh(i,e);break;case"--install-dependencies":t.installDependencies=Mh(i,e);break;case"--generate-textures":t.generateTextures=Mh(i,e);break;case"--generate-bounding-volumes":t.generateBoundingVolumes=Mh(i,e);break;case"--help":hL();break;default:console.warn(`Unknown option ${r}`),process.exit(0)}}),t}function Fc(e,t){if(e+1>=t.length)return"";let r=t[e+1];return r.indexOf("--")===0?"":r}function slt(e,t){let r=Fc(e,t);return console.log(`Input tileset value: ${r}`),console.log(`Modified tileset value: ${r.replace(/\\/g,"/")}`),r.replace(/\\/g,"/")}function ult(e,t){let r=Fc(e,t),i=Number.parseInt(r);return isFinite(i)?i:NaN}function Mh(e,t){let r=Fc(e,t).toLowerCase().trim();return["--no-draco","--split-nodes"].includes(t[e])&&!r?!1:!r||r==="true"}
|
|
123
|
+
`).forEach(s=>{let u=a.exec(s);u&&n.push(Number(u[1]))});let o=e;for(;n.includes(o);)o++;t(o)})})}var QK={command:"",arguments:[],port:5e3,autoPort:!0,wait:2e3,onSuccess:e=>{console.log(`Started ${e.props.command}`)}},bf=class{constructor({id:t="browser-driver"}={}){this.props=ae({},QK);this.childProcess=null;this.port=0;this.id=t}async start(t){t=ae(ae({},QK),t),this.props=t;let r=[...t.arguments];return this.port=Number(t.port),t.portArg&&(t.autoPort&&(this.port=await XK(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=JK.spawn(t.command,r,t.spawn);this.childProcess=a,a.stdout.on("data",o=>{console.log(o.toString())}),a.stderr.on("data",o=>{console.log(`Child process wrote to stderr: "${o}".`),t.ignoreStderr||(this._clearTimeout(),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 CI(e,t){return!_n.isSupported()||!Ga&&!(t==null?void 0:t._nodeWorkers)?!1:e.worker&&(t==null?void 0:t.worker)}async function II(e,t,r,i,n){let a=e.id,o=Ys(e,r),u=_n.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",z3e.bind(null,n));return l.postMessage("process",{input:t,options:r,context:i}),await(await l.result).result}async function z3e(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 PI(e,t){return!_n.isSupported()||!on&&!(t==null?void 0:t._nodeWorkers)?!1:e.worker&&(t==null?void 0:t.worker)}function ZK(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?eY(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?eY(e,0,t):""}function eY(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 OI(e){try{return JSON.parse(e)}catch{throw new Error(`Failed to parse JSON from data starting with "${ZK(e)}"`)}}function BI(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 Wu(...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 ua(...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 ad(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 _f(e,t){return Ut(e>=0),Ut(t>0),e+(t-1)&~(t-1)}function DI(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+_f(i.byteLength,4)}async function FI(e){let t=[];for await(let r of e)t.push(r);return Wu(...t)}function xf(e){return xf=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},xf(e)}function MI(e,t){if(xf(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(xf(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function jI(e){var t=MI(e,"string");return xf(t)==="symbol"?t:String(t)}function Wt(e,t,r){return t=jI(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Zv(){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 xm=class{constructor(t,r){Wt(this,"name",void 0),Wt(this,"type",void 0),Wt(this,"sampleSize",1),Wt(this,"time",0),Wt(this,"count",0),Wt(this,"samples",0),Wt(this,"lastTiming",0),Wt(this,"lastSampleTime",0),Wt(this,"lastSampleCount",0),Wt(this,"_count",0),Wt(this,"_time",0),Wt(this,"_samples",0),Wt(this,"_startTime",0),Wt(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=Zv(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Zv()-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 ey=class{constructor(t){Wt(this,"id",void 0),Wt(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 xm?n=t:n=new xm(r,i),this.stats[r]=n),n}};var H3e="Queued Requests",W3e="Active Requests",V3e="Cancelled Requests",K3e="Queued Requests Ever",Y3e="Active Requests Ever",$3e={id:"request-scheduler",throttleRequests:!0,maxRequests:6},ty=class{constructor(t={}){this.activeRequestCount=0;this.requestQueue=[];this.requestMap=new Map;this.deferredUpdate=null;this.props=ae(ae({},$3e),t),this.stats=new ey({id:this.props.id}),this.stats.get(H3e),this.stats.get(W3e),this.stats.get(V3e),this.stats.get(K3e),this.stats.get(Y3e)}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 X3e="",tY={};function wf(e){for(let t in tY)if(e.startsWith(t)){let r=tY[t];e=e.replace(t,r)}return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${X3e}${e}`),e}var J3e="4.0.0-alpha.9",LI={name:"JSON",id:"json",module:"json",version:J3e,extensions:["json","geojson"],mimeTypes:["application/json"],category:"json",text:!0,parseTextSync:rY,parse:async e=>rY(new TextDecoder().decode(e)),options:{}};function rY(e){return JSON.parse(e)}function xw(e){return Buffer.isBuffer(e)?new Uint8Array(e.buffer,e.byteOffset,e.length).slice().buffer:e}function NI(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 iY(e){return e&&typeof e=="object"&&e.isBuffer}function qI(e){return NI?NI(e):e}function ww(e){if(iY(e))return xw(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 UI(e){return(t,r)=>new Promise((i,n)=>e(t,r,(a,o)=>a?n(a):i(o)))}function nY(e){return(t,r,i)=>new Promise((n,a)=>e(t,r,i,(o,s)=>o?a(o):n(s)))}var $s={};go($s,{dirname:()=>Z3e,filename:()=>Q3e,join:()=>eCe,resolve:()=>tCe});function aY(){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 Q3e(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(t+1):""}function Z3e(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(0,t):""}function eCe(...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 tCe(...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=aY()),o=n),o.length!==0&&(r=`${o}/${r}`,i=o.charCodeAt(0)===ry)}return r=rCe(r,!i),i?`/${r}`:r.length>0?r:"."}var ry=47,GI=46;function rCe(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===ry)break;a=ry}if(a===ry){if(!(i===s-1||n===1))if(i!==s-1&&n===2){if(r.length<2||!o||r.charCodeAt(r.length-1)!==GI||r.charCodeAt(r.length-2)!==GI){if(r.length>2){let u=r.length-1,l=u;for(;l>=0&&r.charCodeAt(l)!==ry;--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===GI&&n!==-1?++n:n=-1}return r}var Ew={};go(Ew,{_readToArrayBuffer:()=>iCe,close:()=>dY,createWriteStream:()=>mY,fstat:()=>pY,isSupported:()=>gY,open:()=>hY,read:()=>zI,readFile:()=>uY,readFileSync:()=>lY,readdir:()=>oY,stat:()=>sY,writeFile:()=>cY,writeFileSync:()=>fY});var ao=Fe(require("fs"));var oY,sY,uY,lY,cY,fY,hY,dY,zI,pY,mY,gY=Boolean(ao.default);try{oY=UI(ao.default.readdir),sY=UI(ao.default.stat),uY=ao.default.readFile,lY=ao.default.readFileSync,cY=nY(ao.default.writeFile),fY=ao.default.writeFileSync,hY=ao.default.open,dY=e=>new Promise((t,r)=>ao.default.close(e,i=>i?r(i):t())),zI=ao.default.read,pY=ao.default.fstat,mY=ao.default.createWriteStream,gY=Boolean(ao.default)}catch{}async function iCe(e,t,r){let i=Buffer.alloc(r),{bytesRead:n}=await zI(e,i,0,r,t);if(n!==r)throw new Error("fs.read failed");return xw(i)}var aCe=e=>typeof e=="boolean",iy=e=>typeof e=="function",od=e=>e!==null&&typeof e=="object",HI=e=>od(e)&&e.constructor==={}.constructor;var vY=e=>e&&typeof e[Symbol.iterator]=="function",yY=e=>e&&typeof e[Symbol.asyncIterator]=="function";var Zo=e=>typeof Response!="undefined"&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json;var es=e=>typeof Blob!="undefined"&&e instanceof Blob,bY=e=>e&&typeof e=="object"&&e.isBuffer;var oCe=e=>typeof ReadableStream!="undefined"&&e instanceof ReadableStream||od(e)&&iy(e.tee)&&iy(e.cancel)&&iy(e.getReader);var sCe=e=>od(e)&&iy(e.read)&&iy(e.pipe)&&aCe(e.readable),Sw=e=>oCe(e)||sCe(e);var uCe=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,lCe=/^([-\w.]+\/[-\w.+]+)/;function _Y(e){let t=lCe.exec(e);return t?t[1]:e}function WI(e){let t=uCe.exec(e);return t?t[1]:""}var xY=/\?.*/;function wY(e){let t=e.match(xY);return t&&t[0]}function wm(e){return e.replace(xY,"")}function sd(e){return Zo(e)?e.url:es(e)?e.name||"":typeof e=="string"?e:""}function ny(e){if(Zo(e)){let t=e,r=t.headers.get("content-type")||"",i=wm(t.url);return _Y(r)||WI(i)}return es(e)?e.type||"":typeof e=="string"?WI(e):""}function EY(e){return Zo(e)?e.headers["content-length"]||-1:es(e)?e.size:typeof e=="string"?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}async function Aw(e){if(Zo(e))return e;let t={},r=EY(e);r>=0&&(t["content-length"]=String(r));let i=sd(e),n=ny(e);n&&(t["content-type"]=n);let a=await fCe(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 SY(e){if(!e.ok){let t=await cCe(e);throw new Error(t)}}async function cCe(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 fCe(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,${hCe(r)}`}return null}function hCe(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 ea(e,t){if(typeof e=="string"){e=wf(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 Aw(e)}async function AY(e,t,r){e=wf(e),on||await Ew.writeFile(e,qI(t),{flag:"w"}),Ut(!1)}function VI(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 Xs(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||VI()}var dCe=globalThis.self||globalThis.window||globalThis.global,Em=globalThis.window||globalThis.self||globalThis.global,pCe=globalThis.document||{},ud=globalThis.process||{},mCe=globalThis.console,Bvt=globalThis.navigator||{};var Tw="4.0.0-alpha.9",Mvt=Xs();function gCe(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var KI=class{constructor(t,r){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";Wt(this,"storage",void 0),Wt(this,"id",void 0),Wt(this,"config",void 0),this.storage=gCe(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 TY(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 kY(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 kw(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 Rw;(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"})(Rw||(Rw={}));var vCe=10;function RY(e){return typeof e!="string"?e:(e=e.toUpperCase(),Rw[e]||Rw.WHITE)}function CY(e,t,r){if(!Xs&&typeof e=="string"){if(t){let i=RY(t);e="[".concat(i,"m").concat(e,"[39m")}if(r){let i=RY(r);e="[".concat(i+vCe,"m").concat(e,"[49m")}}return e}function IY(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 Sm(e,t){if(!e)throw new Error(t||"Assertion failed")}function ld(){let e;if(Xs()&&Em.performance){var t,r;e=Em===null||Em===void 0||(t=Em.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in ud){var i;let n=ud===null||ud===void 0||(i=ud.hrtime)===null||i===void 0?void 0:i.call(ud);e=n[0]*1e3+n[1]/1e6}else e=Date.now();return e}var Am={debug:Xs()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},yCe={enabled:!0,level:0};function ts(){}var PY={},OY={once:!0},Hl=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};Wt(this,"id",void 0),Wt(this,"VERSION",Tw),Wt(this,"_startTs",ld()),Wt(this,"_deltaTs",ld()),Wt(this,"_storage",void 0),Wt(this,"userData",{}),Wt(this,"LOG_THROTTLE_TIMEOUT",0),this.id=t,this.userData={},this._storage=new KI("__probe-".concat(this.id,"__"),yCe),this.timeStamp("".concat(this.id," started")),IY(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((ld()-this._startTs).toPrecision(10))}getDelta(){return Number((ld()-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){Sm(t,r)}warn(t){return this._getLogFunction(0,t,Am.warn,arguments,OY)}error(t){return this._getLogFunction(0,t,Am.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,Am.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,Am.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,Am.debug||Am.info,arguments,OY)}table(t,r,i){return r?this._getLogFunction(t,r,console.table||ts,i&&[i],{tag:wCe(r)}):ts}image(t){let{logLevel:r,priority:i,image:n,message:a="",scale:o=1}=t;return this._shouldLog(r||i)?Xs()?xCe({image:n,message:a,scale:o}):_Ce({image:n,message:a,scale:o}):ts}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||ts)}group(t,r){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},n=DY({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||ts)}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()>=BY(t)}_getLogFunction(t,r,i,n,a){if(this._shouldLog(t)){a=DY({logLevel:t,message:r,args:n,opts:a}),i=i||a.method,Sm(i),a.total=this.getTotal(),a.delta=this.getDelta(),this._deltaTs=ld();let o=a.tag||a.message;if(a.once&&o)if(!PY[o])PY[o]=ld();else return ts;return r=bCe(this.id,a.message,a),i.bind(console,r,...a.args)}return ts}};Wt(Hl,"VERSION",Tw);function BY(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 Sm(Number.isFinite(t)&&t>=0),t}function DY(e){let{logLevel:t,message:r}=e;e.logLevel=BY(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 Sm(n==="string"||n==="object"),Object.assign(e,{args:i},e.opts)}function bCe(e,t,r){if(typeof t=="string"){let i=r.time?kY(TY(r.total)):"";t=r.time?"".concat(e,": ").concat(i," ").concat(t):"".concat(e,": ").concat(t),t=CY(t,r.color,r.background)}return t}function _Ce(e){let{image:t,message:r="",scale:i=1}=e;return console.warn("removed"),ts}function xCe(e){let{image:t,message:r="",scale:i=1}=e;if(typeof t=="string"){let a=new Image;return a.onload=()=>{let o=kw(a,r,i);console.log(...o)},a.src=t,ts}let n=t.nodeName||"";if(n.toLowerCase()==="img")return console.log(...kw(t,r,i)),ts;if(n.toLowerCase()==="canvas"){let a=new Image;return a.onload=()=>console.log(...kw(a,r,i)),a.src=t.toDataURL(),ts}return ts}function wCe(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var lyt=new Hl({id:"@probe.gl/log"});var YI=new Hl({id:"loaders.gl"}),$I=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},XI=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 JI={fetch:null,mimeType:void 0,nothrow:!1,log:new XI,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:on,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},FY={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 QI(){globalThis.loaders=globalThis.loaders||{};let{loaders:e}=globalThis;return e._state=e._state||{},e._state}var wo=()=>{let e=QI();return e.globalOptions=e.globalOptions||ae({},JI),e.globalOptions};function MY(e,t,r,i){return r=r||[],r=Array.isArray(r)?r:[r],ECe(e,r),ACe(t,e,i)}function ECe(e,t){jY(e,null,JI,FY,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]||{};jY(i,r.id,n,a,t)}}function jY(e,t,r,i,n){let a=t||"Top level",o=t?`${t}.`:"";for(let s in e){let u=!t&&od(e[s]),l=s==="baseUri"&&!t,c=s==="workerUrl"&&t;if(!(s in r)&&!l&&!c){if(s in i)YI.warn(`${a} loader option '${o}${s}' no longer supported, use '${i[s]}'`)();else if(!u){let f=SCe(s,n);YI.warn(`${a} loader option '${o}${s}' not recognized. ${f}`)()}}}}function SCe(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 ACe(e,t,r){let i=e.options||{},n=ae({},i);return TCe(n,r),n.log===null&&(n.log=new $I),LY(n,wo()),LY(n,t),n}function LY(e,t){for(let r in t)if(r in t){let i=t[r];HI(i)&&HI(e[r])?e[r]=ae(ae({},e[r]),t[r]):e[r]=t[r]}}function TCe(e,t){t&&!("baseUri"in e)&&(e.baseUri=t)}function ay(e){return e?(Array.isArray(e)&&(e=e[0]),Array.isArray(e==null?void 0:e.extensions)):!1}function ZI(e){Ut(e,"null loader"),Ut(ay(e),"invalid loader");let t;return Array.isArray(e)&&(t=e[1],e=e[0],e=Je(ae({},e),{options:ae(ae({},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 kCe=()=>{let e=QI();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function NY(){return kCe()}var qY=new Hl({id:"loaders.gl"});var RCe=/\.([^.]+)$/;async function UY(e,t=[],r,i){if(!zY(e))return null;let n=GY(e,t,Je(ae({},r),{nothrow:!0}),i);if(n)return n;if(es(e)&&(e=await e.slice(0,10).arrayBuffer(),n=GY(e,t,r,i)),!n&&!(r==null?void 0:r.nothrow))throw new Error(HY(e));return n}function GY(e,t=[],r,i){if(!zY(e))return null;if(t&&!Array.isArray(t))return ZI(t);let n=[];t&&(n=n.concat(t)),(r==null?void 0:r.ignoreRegisteredLoaders)||n.push(...NY()),ICe(n);let a=CCe(e,n,r,i);if(!a&&!(r==null?void 0:r.nothrow))throw new Error(HY(e));return a}function CCe(e,t,r,i){let n=sd(e),a=ny(e),o=wm(n)||(i==null?void 0:i.url),s=null,u="";return(r==null?void 0:r.mimeType)&&(s=eP(t,r==null?void 0:r.mimeType),u=`match forced by supplied MIME type ${r==null?void 0:r.mimeType}`),s=s||PCe(t,o),u=u||(s?`matched url ${o}`:""),s=s||eP(t,a),u=u||(s?`matched MIME type ${a}`:""),s=s||BCe(t,e),u=u||(s?`matched initial data ${VY(e)}`:""),s=s||eP(t,r==null?void 0:r.fallbackMimeType),u=u||(s?`matched fallback MIME type ${a}`:""),u&&qY.log(1,`selectLoader selected ${s==null?void 0:s.name}: ${u}.`),s}function zY(e){return!(e instanceof Response&&e.status===204)}function HY(e){let t=sd(e),r=ny(e),i="No valid loader found (";i+=t?`${$s.filename(t)}, `:"no url provided, ",i+=`MIME type: ${r?`"${r}"`:"not provided"}, `;let n=e?VY(e):"";return i+=n?` first bytes: "${n}"`:"first bytes: not available",i+=")",i}function ICe(e){for(let t of e)ZI(t)}function PCe(e,t){let r=t&&RCe.exec(t),i=r&&r[1];return i?OCe(e,i):null}function OCe(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 eP(e,t){for(let r of e)if(r.mimeTypes&&r.mimeTypes.includes(t)||t===`application/x.${r.id}`)return r;return null}function BCe(e,t){if(!t)return null;for(let r of e)if(typeof t=="string"){if(DCe(t,r))return r}else if(ArrayBuffer.isView(t)){if(WY(t.buffer,t.byteOffset,r))return r}else if(t instanceof ArrayBuffer&&WY(t,0,r))return r;return null}function DCe(e,t){return t.testText?t.testText(e):(Array.isArray(t.tests)?t.tests:[t.tests]).some(i=>e.startsWith(i))}function WY(e,t,r){return(Array.isArray(r.tests)?r.tests:[r.tests]).some(n=>FCe(e,t,r,n))}function FCe(e,t,r,i){if(i instanceof ArrayBuffer)return BI(i,e,i.byteLength);switch(typeof i){case"function":return i(e,r);case"string":let n=tP(e,t,i.length);return i===n;default:return!1}}function VY(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?tP(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?tP(e,0,t):""}function tP(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 MCe=256*1024;function*KY(e,t){let r=(t==null?void 0:t.chunkSize)||MCe,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 jCe=256*1024;function*YY(e,t={}){let{chunkSize:r=jCe}=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 LCe=1024*1024;async function*$Y(e,t){let r=(t==null?void 0:t.chunkSize)||LCe,i=0;for(;i<e.size;){let n=i+r,a=await e.slice(i,n).arrayBuffer();i=n,yield a}}function rP(e,t){return on?NCe(e,t):qCe(e,t)}async function*NCe(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 ww(o)}}catch{r.releaseLock()}}async function*qCe(e,t){for await(let r of e)yield ww(r)}function XY(e,t){if(typeof e=="string")return KY(e,t);if(e instanceof ArrayBuffer)return YY(e,t);if(es(e))return $Y(e,t);if(Sw(e))return rP(e,t);if(Zo(e))return rP(e.body,t);throw new Error("makeIterator")}var JY="Cannot convert supplied data type";function UCe(e,t,r){if(t.text&&typeof e=="string")return e;if(bY(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(JY)}async function QY(e,t,r){let i=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if(typeof e=="string"||i)return UCe(e,t,r);if(es(e)&&(e=await Aw(e)),Zo(e)){let n=e;return await SY(n),t.binary?await n.arrayBuffer():await n.text()}if(Sw(e)&&(e=XY(e,r)),vY(e)||yY(e))return FI(e);throw new Error(JY)}function Cw(e,t){let r=wo(),i=e||r;return typeof i.fetch=="function"?i.fetch:od(i.fetch)?n=>ea(n,i):(t==null?void 0:t.fetch)?t==null?void 0:t.fetch:ea}function ZY(e,t,r){if(r)return r;let i=ae({fetch:Cw(t,e)},e);if(i.url){let n=wm(i.url);i.baseUrl=n,i.queryString=wY(i.url),i.filename=$s.filename(n),i.baseUrl=$s.dirname(n)}return Array.isArray(i.loaders)||(i.loaders=null),i}function e$(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 Eo(e,t,r,i){Zn(!i||typeof i=="object"),t&&!Array.isArray(t)&&!ay(t)&&(i=void 0,r=t,t=void 0),e=await e,r=r||{};let n=sd(e),o=e$(t,i),s=await UY(e,o,r);return s?(r=MY(r,s,o,n),i=ZY({url:n,parse:Eo,loaders:o},r,i||null),await GCe(s,e,r,i)):null}async function GCe(e,t,r,i){if(SI(e),Zo(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 QY(t,e,r),e.parseTextSync&&typeof t=="string")return r.dataType="text",e.parseTextSync(t,r,i,e);if(CI(e,r))return await II(e,t,r,i,Eo);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 Zn(!e.parseSync),new Error(`${e.id} loader - no parser found and worker is disabled`)}async function Wr(e,t,r,i){let n,a;!Array.isArray(t)&&!ay(t)?(n=[],a=t,i=void 0):(n=t,a=r);let o=Cw(a),s=e;return typeof e=="string"&&(s=await o(e)),es(e)&&(s=await o(e)),Array.isArray(n)?await Eo(s,n,a):await Eo(s,n,a)}async function Tm(e,t,r){let i=wo();if(r=ae(ae({},i),r),PI(t,r))return await Qv(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=t$(e,t,r),a=[];for await(let o of n)a.push(o);return Wu(...a)}if(!on&&t.encodeURLtoURL){let n=i$("input");await AY(n,e);let a=i$("output"),o=await r$(n,a,t,r);return(await ea(o)).arrayBuffer()}throw new Error("Writer could not encode data")}function t$(e,t,r){if(t.encodeInBatches){let i=zCe(e);return t.encodeInBatches(i,r)}throw new Error("Writer could not encode data in batches")}async function r$(e,t,r,i){if(e=wf(e),t=wf(t),on||!r.encodeURLtoURL)throw new Error;return await r.encodeURLtoURL(e,t,i)}function zCe(e){return[{table:e,start:0,end:e.length}]}function i$(e){return`/tmp/${e}`}var iu=Fe(dr()),Ym=Fe(Ra());function ky(){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 Um=class{constructor(t,r){Wt(this,"name",void 0),Wt(this,"type",void 0),Wt(this,"sampleSize",1),Wt(this,"time",0),Wt(this,"count",0),Wt(this,"samples",0),Wt(this,"lastTiming",0),Wt(this,"lastSampleTime",0),Wt(this,"lastSampleCount",0),Wt(this,"_count",0),Wt(this,"_time",0),Wt(this,"_samples",0),Wt(this,"_startTime",0),Wt(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=ky(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(ky()-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 Ry=class{constructor(t){Wt(this,"id",void 0),Wt(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 Um?n=t:n=new Um(r,i),this.stats[r]=n),n}};var GP=class{constructor(t,r,i){this.item=t,this.previous=r,this.next=i}};var zP=class{constructor(){this.head=null;this.tail=null;this._length=0}get length(){return this._length}add(t){let r=new GP(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 HP=class{constructor(){this._list=new zP,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 WP=Fe(Ra()),yd=Fe(dr());function dJ(e,t){Ut(e),Ut(t);let{rtcCenter:r,gltfUpAxis:i}=t,{computedTransform:n,boundingVolume:{center:a}}=e,o=new yd.Matrix4(n);switch(r&&o.translate(r),i){case"Z":break;case"Y":let f=new yd.Matrix4().rotateX(Math.PI/2);o=o.multiplyRight(f);break;case"X":let h=new yd.Matrix4().rotateY(-Math.PI/2);o=o.multiplyRight(h);break;default:break}t.isQuantized&&o.translate(t.quantizedVolumeOffset).scale(t.quantizedVolumeScale);let s=new yd.Vector3(a);t.cartesianModelMatrix=o,t.cartesianOrigin=s;let u=WP.Ellipsoid.WGS84.cartesianToCartographic(s,new yd.Vector3),c=WP.Ellipsoid.WGS84.eastNorthUpToFixedFrame(s).invert();t.cartographicModelMatrix=c.multiplyRight(o),t.cartographicOrigin=u,t.coordinateSystem||(t.modelMatrix=t.cartographicModelMatrix)}var el=Fe(dr()),rc=Fe(Zu()),UE=Fe(Ra()),LJ=new el.Vector3,lO=new el.Vector3,cO=new rc.CullingVolume([new rc.Plane,new rc.Plane,new rc.Plane,new rc.Plane,new rc.Plane,new rc.Plane]);function NJ(e,t){let{cameraDirection:r,cameraUp:i,height:n}=e,{metersPerUnit:a}=e.distanceScales,o=GE(e,e.center),s=UE.Ellipsoid.WGS84.eastNorthUpToFixedFrame(o),u=e.unprojectPosition(e.cameraPosition),l=UE.Ellipsoid.WGS84.cartographicToCartesian(u,new el.Vector3),c=new el.Vector3(s.transformAsVector(new el.Vector3(r).scale(a))).normalize(),f=new el.Vector3(s.transformAsVector(new el.Vector3(i).scale(a))).normalize();Ije(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:cO,frameNumber:t,sseDenominator:1.15}}function qJ(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 Ije(e){let t=e.getFrustumPlanes(),r=UJ(t.near,e.cameraPosition),i=GE(e,r),n=GE(e,e.cameraPosition,lO),a=0;cO.planes[a++].fromPointNormal(i,LJ.copy(i).subtract(n));for(let o in t){if(o==="near")continue;let s=t[o],u=UJ(s,r,lO),l=GE(e,u,lO);cO.planes[a++].fromPointNormal(l,LJ.copy(i).subtract(l))}}function UJ(e,t,r=new el.Vector3){let i=e.normal.dot(t);return r.copy(e.normal).scale(e.distance-i).add(t),r}function GE(e,t,r=new el.Vector3){let i=e.unprojectPosition(t);return UE.Ellipsoid.WGS84.cartographicToCartesian(i,r)}var fO=Fe(dr()),zE=Fe(Zu()),GJ=Fe(Ra()),Pje=6378137,Oje=6378137,hO=6356752314245179e-9,zJ=new fO.Vector3;function HJ(e,t){if(e instanceof zE.OrientedBoundingBox){let{halfAxes:r}=e,i=Bje(r);return Math.log2(hO/(i+t[2]))}else if(e instanceof zE.BoundingSphere){let{radius:r}=e;return Math.log2(hO/(r+t[2]))}else if(e.width&&e.height){let{width:r,height:i}=e,n=Math.log2(Pje/r),a=Math.log2(Oje/i);return(n+a)/2}return 1}function dO(e,t,r){let i=GJ.Ellipsoid.WGS84.cartographicToCartesian([e.xmax,e.ymax,e.zmax],new fO.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(hO/(n+t[2]))}function WJ(e,t,r){let[i,n,a,o]=e;return dO({xmin:i,xmax:a,ymin:n,ymax:o,zmin:0,zmax:0},t,r)}function Bje(e){e.getColumn(0,zJ);let t=e.getColumn(1),r=e.getColumn(2);return zJ.add(t).add(r).len()}var ru=Fe(dr()),YE=Fe(Zu());var Va={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},ta;(function(r){r[r.ADD=1]="ADD",r[r.REPLACE=2]="REPLACE"})(ta||(ta={}));var tl;(function(n){n.EMPTY="empty",n.SCENEGRAPH="scenegraph",n.POINTCLOUD="pointcloud",n.MESH="mesh"})(tl||(tl={}));var En;(function(r){r.I3S="I3S",r.TILES3D="TILES3D"})(En||(En={}));var ic;(function(r){r.GEOMETRIC_ERROR="geometricError",r.MAX_SCREEN_THRESHOLD="maxScreenThreshold"})(ic||(ic={}));var VJ={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0};var jr=Fe(dr()),HE=Fe(Zu()),Km=Fe(Ra());function KJ(e){return e!=null}var Ca=new jr.Vector3,WE=new jr.Vector3,Dje=new jr.Vector3,Fje=new jr.Vector3;function Of(e,t,r){if(Ut(e,"3D Tile: boundingVolume must be defined"),e.box)return Mje(e.box,t,r);if(e.region){let[i,n,a,o,s,u]=e.region,l=Km.Ellipsoid.WGS84.cartographicToCartesian([(0,jr.degrees)(i),(0,jr.degrees)(o),s],Dje),c=Km.Ellipsoid.WGS84.cartographicToCartesian([(0,jr.degrees)(a),(0,jr.degrees)(n),u],Fje),f=new jr.Vector3().addVectors(l,c).multiplyScalar(.5),h=new jr.Vector3().subVectors(l,c).len()/2;return $J([f[0],f[1],f[2],h],new jr.Matrix4)}if(e.sphere)return $J(e.sphere,t,r);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function YJ(e,t){if(e.box)return jje(t);if(e.region){let[r,i,n,a,o,s]=e.region;return[[(0,jr.degrees)(r),(0,jr.degrees)(i),o],[(0,jr.degrees)(n),(0,jr.degrees)(a),s]]}if(e.sphere)return Lje(t);throw new Error("Unkown boundingVolume type")}function Mje(e,t,r){let i=new jr.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 jr.Quaternion;c.fromArray(e,6);let f=new jr.Vector3([1,0,0]),h=new jr.Vector3([0,1,0]),d=new jr.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 jr.Matrix3([a[0],a[1],a[2],o[0],o[1],o[2],s[0],s[1],s[2]]);return KJ(r)?(r.center=i,r.halfAxes=u,r):new HE.OrientedBoundingBox(i,u)}function $J(e,t,r){let i=new jr.Vector3(e[0],e[1],e[2]);t.transform(i,i);let n=t.getScale(WE),a=Math.max(Math.max(n[0],n[1]),n[2]),o=e[3]*a;return KJ(r)?(r.center=i,r.radius=o,r):new HE.BoundingSphere(i,o)}function jje(e){let t=XJ(),{halfAxes:r}=e,i=new jr.Vector3(r.getColumn(0)),n=new jr.Vector3(r.getColumn(1)),a=new jr.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++)Ca.copy(e.center),Ca.add(i),Ca.add(n),Ca.add(a),JJ(t,Ca),a.negate();n.negate()}i.negate()}return t}function Lje(e){let t=XJ(),{center:r,radius:i}=e,n=Km.Ellipsoid.WGS84.scaleToGeodeticSurface(r,Ca),a;n?a=Km.Ellipsoid.WGS84.geodeticSurfaceNormal(n):a=new jr.Vector3(0,0,1);let o=new jr.Vector3(a[2],-a[1],0);o.len()>0?o.normalize():o=new jr.Vector3(0,1,0);let s=o.clone().cross(a);for(let u of[o,s,a]){WE.copy(u).scale(i);for(let l=0;l<2;l++)Ca.copy(r),Ca.add(WE),JJ(t,Ca),WE.negate()}return t}function XJ(){return[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]]}function JJ(e,t){Km.Ellipsoid.WGS84.cartesianToCartographic(t,Ca),e[0][0]=Math.min(e[0][0],Ca[0]),e[0][1]=Math.min(e[0][1],Ca[1]),e[0][2]=Math.min(e[0][2],Ca[2]),e[1][0]=Math.max(e[1][0],Ca[0]),e[1][1]=Math.max(e[1][1],Ca[1]),e[1][2]=Math.max(e[1][2],Ca[2])}var nc=Fe(dr()),T_t=new nc.Vector3,k_t=new nc.Vector3,R_t=new nc.Matrix4,C_t=new nc.Vector3,I_t=new nc.Vector3,P_t=new nc.Vector3;function Nje(e,t){let r=e*t;return 1-Math.exp(-(r*r))}function qje(e,t){if(e.dynamicScreenSpaceError&&e.dynamicScreenSpaceErrorComputedDensity){let r=e.dynamicScreenSpaceErrorComputedDensity,i=e.dynamicScreenSpaceErrorFactor;return Nje(t,r)*i}return 0}function QJ(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-=qje(i,o),c}var ac=Fe(dr()),VE=Fe(Ra()),pO=new ac.Vector3,ZJ=new ac.Vector3,Bf=new ac.Vector3,eQ=new ac.Vector3,Uje=new ac.Vector3,mO=new ac.Matrix4,tQ=new ac.Matrix4;function rQ(e,t){if(e.lodMetricValue===0||isNaN(e.lodMetricValue))return"DIG";let r=2*gO(e,t);return r<2?"OUT":!e.header.children||r<=e.lodMetricValue?"DRAW":e.header.children?"DIG":"OUT"}function gO(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);VE.Ellipsoid.WGS84.cartographicToCartesian(u,pO),ZJ.copy(pO).subtract(s).normalize(),VE.Ellipsoid.WGS84.eastNorthUpToFixedFrame(s,mO),tQ.copy(mO).invert(),Bf.copy(pO).transform(tQ);let l=Math.sqrt(Bf[0]*Bf[0]+Bf[1]*Bf[1]),c=l*l/Bf[2];eQ.copy([Bf[0],Bf[1],c]);let h=eQ.transform(mO).subtract(s).normalize(),p=ZJ.cross(h).normalize().scale(o).add(s),y=VE.Ellipsoid.WGS84.cartesianToCartographic(p),g=r.project([n,i,a]),b=r.project(y);return Uje.copy(g).subtract(b).magnitude()}function iQ(e){return{assetGltfUpAxis:e.asset&&e.asset.gltfUpAxis||"Y"}}var KE=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 Ut(t<this._array.length),this._array[t]}set(t,r){Ut(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){Ut(t>=0),t>this._array.length&&(this._array.length=t)}resize(t){Ut(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 Gje={loadSiblings:!1,skipLevelOfDetail:!1,maximumScreenSpaceError:2,updateTransforms:!0,onTraversalEnd:()=>{},viewportTraversersMap:{},basePath:""},oc=class{constructor(t){this.root=null;this.selectedTiles={};this.requestedTiles={};this.emptyTiles={};this.lastUpdate=new Date().getTime();this.updateDebounceTime=1e3;this._traversalStack=new KE;this._emptyTraversalStack=new KE;this._frameNumber=null;this.options=ae(ae({},Gje),t)}traversalFinished(t){return!0}traverse(t,r,i){this.root=t,this.options=ae(ae({},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===ta.ADD?(this.loadTile(a,r),this.selectTile(a,r)):a.refine===ta.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===ta.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 nQ=new ru.Vector3;function zje(e){return e!=null}var sc=class{constructor(t,r,i,n=""){this.lodMetricType="geometricError";this.lodMetricValue=0;this.boundingVolume=null;this.content=null;this.contentState=Va.UNLOADED;this.gpuMemoryUsageInBytes=0;this.children=[];this.depth=0;this.viewportIds=[];this.transform=new ru.Matrix4;this.extensions=null;this.implicitTiling=null;this.userData={};this.hasEmptyContent=!1;this.hasTilesetContent=!1;this.traverser=new oc({});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 ru.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===Va.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===Va.UNLOADED}get contentExpired(){return this.contentState===Va.EXPIRED}get contentFailed(){return this.contentState===Va.FAILED}get distanceToCamera(){return this._distanceToCamera}get screenSpaceError(){return this._screenSpaceError}get boundingBox(){return this._boundingBox||(this._boundingBox=YJ(this.header.boundingVolume,this.boundingVolume)),this._boundingBox}getScreenSpaceError(t,r){switch(this.tileset.type){case En.I3S:return gO(this,t);case En.TILES3D:return QJ(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===ta.ADD||r;if(i&&!this.isVisible&&this._visible!==void 0||this.tileset._frameNumber-this._touchedFrame>=1||this.contentState===Va.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=Va.LOADING;let r=await this.tileset._requestScheduler.scheduleRequest(this.id,this._getPriority.bind(this));if(!r)return this.contentState=Va.UNLOADED,!1;try{let i=this.tileset.getTileUrl(this.contentUrl),n=this.tileset.loader,a=Je(ae({},this.tileset.loadOptions),{[n.id]:ae(Je(ae({},this.tileset.loadOptions[n.id]),{isTileset:this.type==="json"}),this._getLoaderSpecificOptions(n.id))});return this.content=await Wr(i,n,a),this.tileset.options.contentLoader&&await this.tileset.options.contentLoader(this),this._isTileset()&&this.tileset._initializeTileHeaders(this.content,this),this.contentState=Va.READY,this._onContentLoaded(),!0}catch(i){throw this.contentState=Va.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=Va.UNLOADED,!0}updateVisibility(t,r){if(this._frameNumber===t.frameNumber)return;let i=this.parent,n=i?i._visibilityPlaneMask:YE.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!==YE.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 nQ.subVectors(r.center,t.position),t.direction.dot(nQ)}insideViewerRequestVolume(t){let r=this._viewerRequestVolume;return!r||r.distanceSquaredTo(t.camera.position)<=0}updateExpiration(){if(zje(this._expireDate)&&this.contentReady&&!this.hasEmptyContent){let t=Date.now();Date.lessThan(this._expireDate,t)&&(this.contentState=Va.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 ru.Matrix4(t.transform):new ru.Matrix4;let r=this.parent,i=this.tileset,n=r&&r.computedTransform?r.computedTransform.clone():i.modelMatrix.clone();this.computedTransform=new ru.Matrix4(n).multiplyRight(this.transform);let a=r&&r._initialTransform?r._initialTransform.clone():new ru.Matrix4;this._initialTransform=new ru.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=Va.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=YE.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||ta.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=Of(t.boundingVolume,this.computedTransform,this.boundingVolume);let r=t.content;!r||(r.boundingVolume&&(this._contentBoundingVolume=Of(r.boundingVolume,this.computedTransform,this._contentBoundingVolume)),t.viewerRequestVolume&&(this._viewerRequestVolume=Of(t.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)))}_updateTransform(t=new ru.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 Je(ae({},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 iQ(this.tileset.tileset)}}};var vO=class extends oc{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===ta.REPLACE,a=t._optimChildrenWithinParent===VJ.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!==ta.ADD?!1:!this.shouldRefine(t,r,!0)}};var yO=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 bO={REQUESTED:"REQUESTED",COMPLETED:"COMPLETED",ERROR:"ERROR"},_O=class{constructor(){this.pendingTilesRegister=new yO;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:bO.REQUESTED},this.pendingTilesRegister.register(o,a),t().then(s=>{this._statusMap[r].status=bO.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=bO.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 xO=class extends oc{constructor(t){super(t);this._tileManager=new _O}traversalFinished(t){return!this._tileManager.hasPendingTiles(t.viewport.id,this._frameNumber||0)}shouldRefine(t,r){return t._lodJudge=rQ(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=Je(ae({},r.loadOptions),{i3s:Je(ae({},r.loadOptions.i3s),{isTileHeader:!0})});return await Wr(n,i,a)}_onTileLoad(t,r,i){let n=new sc(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 Hje={description:"",ellipsoid:Ym.Ellipsoid.WGS84,modelMatrix:new iu.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:{}},$E="Tiles In Tileset(s)",wO="Tiles In Memory",aQ="Tiles In View",oQ="Tiles To Render",sQ="Tiles Loaded",EO="Tiles Loading",uQ="Tiles Unloaded",lQ="Failed Tile Loads",cQ="Points/Vertices",SO="Tile Memory Use",XE=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 HP;this.updatePromise=null;this.options=ae(ae({},Hje),r),this.tileset=t,this.loader=t.loader,this.type=t.type,this.url=t.url,this.basePath=t.basePath||$s.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 ty({throttleRequests:this.options.throttleRequests,maxRequests:this.options.maxRequests}),this.stats=new Ry({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=ae(ae({},this.options),t)}setOptions(t){this.options=ae(ae({},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=NJ(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]=qJ(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(aQ).count=this.selectedTiles.length,this.stats.get(oQ).count=t,this.stats.get(cQ).count=r}async _initializeTileSet(t){this.type===En.I3S&&(this.calculateViewPropsI3S(),t.root=await t.root),this.root=this._initializeTileHeaders(t,null),this.type===En.TILES3D&&(this._initializeTiles3DTileset(t),this.calculateViewPropsTiles3D()),this.type===En.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 iu.Vector3(n+(a-n)/2,o+(s-o)/2,u+(l-u)/2),this.cartesianCenter=Ym.Ellipsoid.WGS84.cartographicToCartesian(this.cartographicCenter,new iu.Vector3),this.zoom=dO(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 iu.Vector3(n+(o-n)/2,a+(s-a)/2,0),this.cartesianCenter=Ym.Ellipsoid.WGS84.cartographicToCartesian(this.cartographicCenter,new iu.Vector3),this.zoom=WJ(r,this.cartographicCenter,this.cartesianCenter);return}console.warn("Extent is not defined in the tileset header"),this.cartographicCenter=new iu.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 iu.Vector3,this.zoom=1;return}r[0]!==0||r[1]!==0||r[2]!==0?this.cartographicCenter=Ym.Ellipsoid.WGS84.cartesianToCartographic(r,new iu.Vector3):this.cartographicCenter=new iu.Vector3(0,0,-Ym.Ellipsoid.WGS84.radii[0]),this.cartesianCenter=r,this.zoom=HJ(t.boundingVolume,this.cartographicCenter)}_initializeStats(){this.stats.get($E),this.stats.get(EO),this.stats.get(wO),this.stats.get(aQ),this.stats.get(oQ),this.stats.get(sQ),this.stats.get(uQ),this.stats.get(lQ),this.stats.get(cQ),this.stats.get(SO,"memory")}_initializeTileHeaders(t,r){var n;let i=new sc(this,t.root,r);if(r&&(r.children.push(i),i.depth=r.depth+1),this.type===En.TILES3D){let a=[];for(a.push(i);a.length>0;){let o=a.pop();this.stats.get($E).incrementCount();let s=o.header.children||[];for(let u of s){let l=new sc(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 En.TILES3D:t=vO;break;case En.I3S:t=xO;break;default:t=oc}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(lQ).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===En.I3S){let a=((n=(i=this.tileset)==null?void 0:i.nodePagesTile)==null?void 0:n.nodesInNodePages)||0;this.stats.get($E).reset(),this.stats.get($E).addCount(a)}t&&t.content&&dJ(t,t.content),this.updateContentTypes(t),this._addTileToCache(t),this.options.onTileLoad(t)}}updateContentTypes(t){var r;if(this.type===En.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===En.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(EO).incrementCount()}_onEndTileLoading(){this._pendingCount--,this.stats.get(EO).decrementCount()}_addTileToCache(t){this._cache.add(this,t,r=>r._updateCacheStats(t))}_updateCacheStats(t){this.stats.get(sQ).incrementCount(),this.stats.get(wO).incrementCount(),this.gpuMemoryUsageInBytes+=t.gpuMemoryUsageInBytes||0,this.stats.get(SO).count=this.gpuMemoryUsageInBytes}_unloadTile(t){this.gpuMemoryUsageInBytes-=t.gpuMemoryUsageInBytes||0,this.stats.get(wO).decrementCount(),this.stats.get(uQ).incrementCount(),this.stats.get(SO).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=ae(ae({},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"&&this.asset.version!=="1.1")throw new Error("The tileset must be 3D Tiles version either 0.0 or 1.0 or 1.1.");"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 JE="4.0.0-alpha.9";var xd={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"},Rxt=Object.keys(xd);function AO(e,t,r){Ut(e instanceof ArrayBuffer);let i=new TextDecoder("utf8"),n=new Uint8Array(e,t,r);return i.decode(n)}function fQ(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 QE="4.0.0-alpha.9";var Wje={draco:{decoderType:typeof WebAssembly=="object"?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}},hQ={name:"Draco",id:"draco",module:"draco",version:QE,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:Wje};function dQ(e){switch(e.constructor){case Int8Array:return"int8";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int16Array:return"int16";case Uint16Array:return"uint16";case Int32Array:return"int32";case Uint32Array:return"uint32";case Float32Array:return"float32";case Float64Array:return"float64";default:return"null"}}function TO(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 kO(e,t,r){let i=dQ(t.value),n=r||pQ(t);return{name:e,type:{type:"fixed-size-list",listSize:t.size,children:[{name:"value",type:i}]},nullable:!1,metadata:n}}function pQ(e){let t={};return"byteOffset"in e&&(t.byteOffset=e.byteOffset.toString(10)),"byteStride"in e&&(t.byteStride=e.byteStride.toString(10)),"normalized"in e&&(t.normalized=e.normalized.toString()),t}function mQ(e,t,r){let i=vQ(t.metadata),n=[],a=Vje(t.attributes);for(let o in e){let s=e[o],u=gQ(o,s,a[o]);n.push(u)}if(r){let o=gQ("indices",r);n.push(o)}return{fields:n,metadata:i}}function Vje(e){let t={};for(let r in e){let i=e[r];t[i.name||"undefined"]=i}return t}function gQ(e,t,r){let i=r?vQ(r.metadata):void 0;return kO(e,t,i)}function vQ(e){Object.entries(e);let t={};for(let r in e)t[`${r}.string`]=JSON.stringify(e[r]);return t}var yQ={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},Kje={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},Yje=4,ZE=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=TO(u.attributes),c=mQ(u.attributes,s,u.indices);return Je(ae({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*Yje,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),Jje(r)}finally{this.draco.destroy(r)}}_getAttributeValues(t,r){let i=Kje[r.data_type],n=r.num_components,o=t.num_points()*n,s=o*i.BYTES_PER_ELEMENT,u=$je(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 yQ)if(this.draco[o]===n)return yQ[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=Xje(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 $je(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 Xje(e){let t=e.size(),r=new Int32Array(t);for(let i=0;i<t;i++)r[i]=e.GetValue(i);return r}function Jje(e){let t=e.size(),r=new Int32Array(t);for(let i=0;i<t;i++)r[i]=e.GetValue(i);return r}var Qje="1.5.5",Zje="1.4.1",RO=`https://www.gstatic.com/draco/versioned/decoders/${Qje}`,eLe=`${RO}/draco_decoder.js`,tLe=`${RO}/draco_wasm_wrapper.js`,rLe=`${RO}/draco_decoder.wasm`,Jxt=`https://raw.githubusercontent.com/google/draco/${Zje}/javascript/draco_encoder.js`,jy;async function bQ(e){let t=e.modules||{};return t.draco3d?jy=jy||t.draco3d.createDecoderModule({}).then(r=>({draco:r})):jy=jy||iLe(e),await jy}async function iLe(e){let t,r;switch(e.draco&&e.draco.decoderType){case"js":t=await Hu(eLe,"draco",e);break;case"wasm":default:[t,r]=await Promise.all([await Hu(tLe,"draco",e),await Hu(rLe,"draco",e)])}return t=t||globalThis.DracoDecoderModule,await nLe(t,r)}function nLe(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(i=>{e(Je(ae({},r),{onModuleLoaded:n=>i({draco:n})}))})}var Ly={id:"draco-writer",name:"Draco compressed geometry writer",module:"draco",version:QE,worker:!0,options:{draco:{},source:null}};var $m=Je(ae({},hQ),{parse:aLe});async function aLe(e,t){let{draco:r}=await bQ(t),i=new ZE(r);try{return i.parseSync(e,t==null?void 0:t.draco)}finally{i.destroy()}}var oLe={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},ln={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},Zt=ae(ae({},oLe),ln);var CO={[ln.DOUBLE]:Float64Array,[ln.FLOAT]:Float32Array,[ln.UNSIGNED_SHORT]:Uint16Array,[ln.UNSIGNED_INT]:Uint32Array,[ln.UNSIGNED_BYTE]:Uint8Array,[ln.BYTE]:Int8Array,[ln.SHORT]:Int16Array,[ln.INT]:Int32Array},sLe={DOUBLE:ln.DOUBLE,FLOAT:ln.FLOAT,UNSIGNED_SHORT:ln.UNSIGNED_SHORT,UNSIGNED_INT:ln.UNSIGNED_INT,UNSIGNED_BYTE:ln.UNSIGNED_BYTE,BYTE:ln.BYTE,SHORT:ln.SHORT,INT:ln.INT},IO="Failed to convert GL type",Ka=class{static fromTypedArray(t){t=ArrayBuffer.isView(t)?t.constructor:t;for(let r in CO)if(CO[r]===t)return r;throw new Error(IO)}static fromName(t){let r=sLe[t];if(!r)throw new Error(IO);return r}static getArrayType(t){switch(t){case ln.UNSIGNED_SHORT_5_6_5:case ln.UNSIGNED_SHORT_4_4_4_4:case ln.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:let r=CO[t];if(!r)throw new Error(IO);return r}}static getByteSize(t){return Ka.getArrayType(t).BYTES_PER_ELEMENT}static validate(t){return Boolean(Ka.getArrayType(t))}static createTypedArray(t,r,i=0,n){n===void 0&&(n=(r.byteLength-i)/Ka.getByteSize(t));let a=Ka.getArrayType(t);return new a(r,i,n)}};function _Q(e,t){if(!e)throw new Error(`math.gl assertion failed. ${t}`)}function PO(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 uc=Fe(dr());var cwt=1/256;var fwt=new uc.Vector2,hwt=new uc.Vector3,dwt=new uc.Vector2,pwt=new uc.Vector2,mwt=new Uint8Array(1);function xQ(e,t=255){return(0,uc.clamp)(e,0,t)/t*2-1}function wQ(e){return e<0?-1:1}function EQ(e,t,r,i){if(_Q(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=xQ(e,r),i.y=xQ(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))*wQ(n),i.y=(1-Math.abs(n))*wQ(i.y)}return i.normalize()}function OO(e,t,r){return EQ(e,t,255,r)}var FO=Fe(dr());var Df=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=Zt.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=Ka.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=Ka.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=Ka.createTypedArray(r,i),n[t]=a),a}};var uLe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},lLe={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]]},cLe={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 SQ(e,t,r,i){let{componentType:n}=e;Ut(e.componentType);let a=typeof n=="string"?Ka.fromName(n):n,o=uLe[e.type],s=lLe[e.type],u=cLe[e.type];return r+=e.byteOffset,{values:Ka.createTypedArray(a,t,r,o*i),type:a,size:o,unpacker:s,packer:u}}var rl=e=>e!==void 0;function AQ(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?fLe(i,r):null}function fLe(e,t){let r,i,n,a=e.instancesLength,o=e.classes,s=e.classIds,u=e.parentCounts,l=e.parentIds,c=a;rl(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(rl(u))for(rl(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];rl(l)&&rl(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 pLe(y),y}function Xm(e,t,r){if(!e)return;let i=e.parentCounts;return e.parentIds?r(e,t):i>0?hLe(e,t,r):dLe(e,t,r)}function hLe(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(rl(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 dLe(e,t,r){let i=!0;for(;i;){let n=r(e,t);if(rl(n))return n;let a=e.parentIds[t];i=a!==t,t=a}throw new Error("traverseHierarchySingleParent")}function pLe(e){let t=[],i=e.classIds.length;for(let n=0;n<i;++n)TQ(e,n,stack)}function TQ(e,t,r){let i=e.parentCounts,n=e.parentIds,a=e.parentIndexes,s=e.classIds.length;if(!rl(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=rl(i)?i[t]:1,l=rl(i)?a[t]:t;for(let c=0;c<u;++c){let f=n[l+c];f!==t&&TQ(e,f,r)}r.pop(t)}function uo(e){return e!=null}var eS=(e,t)=>e,mLe={HIERARCHY:!0,extensions:!0,extras:!0},Jm=class{constructor(t,r,i,n={}){var a;Ut(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)mLe[o]||(this._properties[o]=this.json[o]);this._binaryProperties=this._initializeBinaryProperties(),n["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=AQ(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),Ut(typeof r=="string",r),this._hierarchy){let i=Xm(this._hierarchy,t,(n,a)=>{let o=n.classIds[a];return n.classes[o].name===r});return uo(i)}return!1}isExactClass(t,r){return Ut(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),Ut(typeof r=="string",r),uo(this._properties[r])||this._hasPropertyInHierarchy(t,r)}getPropertyNames(t,r){this._checkBatchId(t),r=uo(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),Ut(typeof r=="string",r),this._binaryProperties){let n=this._binaryProperties[r];if(uo(n))return this._getBinaryProperty(n,t)}let i=this._properties[r];if(uo(i))return eS(i[t],!0);if(this._hierarchy){let n=this._getHierarchyProperty(t,r);if(uo(n))return n}}setProperty(t,r,i){let n=this.featureCount;if(this._checkBatchId(t),Ut(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];uo(a)||(this._properties[r]=new Array(n),a=this._properties[r]),a[t]=eS(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;Ut(this.binary,`Property ${t} requires a batch table binary.`),Ut(i.type,`Property ${t} requires a type.`);let n=SQ(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=Xm(this._hierarchy,t,(n,a)=>{let o=n.classIds[a],s=n.classes[o].instances;return uo(s[r])});return uo(i)}_getPropertyNamesInHierarchy(t,r){Xm(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 Xm(this._hierarchy,t,(i,n)=>{let a=i.classIds[n],o=i.classes[a],s=i.classIndexes[n],u=o.instances[r];return uo(u)?uo(u.typedArray)?this._getBinaryProperty(u,s):eS(u[s],!0):null})}_setHierarchyProperty(t,r,i,n){let a=Xm(this._hierarchy,r,(o,s)=>{let u=o.classIds[s],l=o.classes[u],c=o.classIndexes[s],f=l.instances[i];return uo(f)?(Ut(s===r,`Inherited property "${i}" is read-only.`),uo(f.typedArray)?this._setBinaryProperty(f,c,n):f[c]=eS(n,!0),!0):!1});return uo(a)}};var BO=4;function Ff(e,t,r=0){let i=new DataView(t);if(e.magic=i.getUint32(r,!0),r+=BO,e.version=i.getUint32(r,!0),r+=BO,e.byteLength=i.getUint32(r,!0),r+=BO,e.version!==1)throw new Error(`3D Tile Version ${e.version} not supported`);return r}var Qm=4,kQ="b3dm tile in legacy format.";function Zm(e,t,r){let i=new DataView(t),n;e.header=e.header||{};let a=i.getUint32(r,!0);r+=Qm;let o=i.getUint32(r,!0);r+=Qm;let s=i.getUint32(r,!0);r+=Qm;let u=i.getUint32(r,!0);return r+=Qm,s>=570425344?(r-=Qm*2,n=a,s=o,u=0,a=0,o=0,console.warn(kQ)):u>=570425344&&(r-=Qm,n=s,s=a,u=o,a=0,o=0,console.warn(kQ)),e.header.featureTableJsonByteLength=a,e.header.featureTableBinaryByteLength=o,e.header.batchTableJsonByteLength=s,e.header.batchTableBinaryByteLength=u,e.header.batchLength=n,r}function eg(e,t,r,i){return r=gLe(e,t,r,i),r=vLe(e,t,r,i),r}function gLe(e,t,r,i){let{featureTableJsonByteLength:n,featureTableBinaryByteLength:a,batchLength:o}=e.header||{};if(e.featureTableJson={BATCH_LENGTH:o||0},n&&n>0){let s=AO(t,r,n);e.featureTableJson=JSON.parse(s)}return r+=n||0,e.featureTableBinary=new Uint8Array(t,r,a),r+=a||0,r}function vLe(e,t,r,i){let{batchTableJsonByteLength:n,batchTableBinaryByteLength:a}=e.header||{};if(n&&n>0){let o=AO(t,r,n);e.batchTableJson=JSON.parse(o),r+=n,a&&a>0&&(e.batchTableBinary=new Uint8Array(t,r,a),e.batchTableBinary=new Uint8Array(e.batchTableBinary),r+=a)}return r}function DO(e,t,r){if(!t&&(!e||!e.batchIds||!r))return null;let{batchIds:i,isRGB565:n,pointCount:a=0}=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:Zt.UNSIGNED_BYTE,value:o,size:3,normalized:!0}}if(t&&n){let o=new Uint8ClampedArray(a*3);for(let s=0;s<a;s++){let u=PO(t[s]);o[s*3]=u[0],o[s*3+1]=u[1],o[s*3+2]=u[2]}return{type:Zt.UNSIGNED_BYTE,value:o,size:3,normalized:!0}}return t&&t.length===a*3?{type:Zt.UNSIGNED_BYTE,value:t,size:3,normalized:!0}:{type:Zt.UNSIGNED_BYTE,value:t||new Uint8ClampedArray,size:4,normalized:!0}}var RQ=Fe(dr());var CQ=new RQ.Vector3;function IQ(e,t){if(!t)return null;if(e.isOctEncoded16P){let r=new Float32Array((e.pointsLength||0)*3);for(let i=0;i<(e.pointsLength||0);i++)OO(t[i*2],t[i*2+1],CQ),CQ.toArray(r,i*3);return{type:Zt.FLOAT,size:2,value:r}}return{type:Zt.FLOAT,size:2,value:t}}var PQ=Fe(dr());function OQ(e,t,r){return e.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(e.isQuantized=!1,yLe(e,t)):{type:Zt.UNSIGNED_SHORT,value:t,size:3,normalized:!0}:t}function yLe(e,t){let r=new PQ.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 BQ(e,t,r,i,n){r=Ff(e,t,r),r=Zm(e,t,r),r=eg(e,t,r,i),bLe(e);let{featureTable:a,batchTable:o}=_Le(e);return await ALe(e,a,o,i,n),xLe(e,a,i),wLe(e,a,o),ELe(e,a),r}function bLe(e){e.attributes={positions:null,colors:null,normals:null,batchIds:null},e.isQuantized=!1,e.isTranslucent=!1,e.isRGB565=!1,e.isOctEncoded16P=!1}function _Le(e){let t=new Df(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",Zt.FLOAT,3);let i=SLe(e,t);return{featureTable:t,batchTable:i}}function xLe(e,t,r){if(e.attributes=e.attributes||{positions:null,colors:null,normals:null,batchIds:null},!e.attributes.positions){if(t.hasProperty("POSITION"))e.attributes.positions=t.getPropertyArray("POSITION",Zt.FLOAT,3);else if(t.hasProperty("POSITION_QUANTIZED")){let i=t.getPropertyArray("POSITION_QUANTIZED",Zt.UNSIGNED_SHORT,3);if(e.isQuantized=!0,e.quantizedRange=(1<<16)-1,e.quantizedVolumeScale=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Zt.FLOAT,3),!e.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(e.quantizedVolumeOffset=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Zt.FLOAT,3),!e.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");e.attributes.positions=OQ(e,i,r)}}if(!e.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function wLe(e,t,r){if(e.attributes=e.attributes||{positions:null,colors:null,normals:null,batchIds:null},!e.attributes.colors){let i=null;t.hasProperty("RGBA")?(i=t.getPropertyArray("RGBA",Zt.UNSIGNED_BYTE,4),e.isTranslucent=!0):t.hasProperty("RGB")?i=t.getPropertyArray("RGB",Zt.UNSIGNED_BYTE,3):t.hasProperty("RGB565")&&(i=t.getPropertyArray("RGB565",Zt.UNSIGNED_SHORT,1),e.isRGB565=!0),e.attributes.colors=DO(e,i,r)}t.hasProperty("CONSTANT_RGBA")&&(e.constantRGBA=t.getGlobalProperty("CONSTANT_RGBA",Zt.UNSIGNED_BYTE,4))}function ELe(e,t){if(e.attributes=e.attributes||{positions:null,colors:null,normals:null,batchIds:null},!e.attributes.normals){let r=null;t.hasProperty("NORMAL")?r=t.getPropertyArray("NORMAL",Zt.FLOAT,3):t.hasProperty("NORMAL_OCT16P")&&(r=t.getPropertyArray("NORMAL_OCT16P",Zt.UNSIGNED_BYTE,2),e.isOctEncoded16P=!0),e.attributes.normals=IQ(e,r)}}function SLe(e,t){let r=null;if(!e.batchIds&&t.hasProperty("BATCH_ID")&&(e.batchIds=t.getPropertyArray("BATCH_ID",Zt.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 Jm(n,a,i)}return r}async function ALe(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:ae(ae({},o),s),featureTableProperties:o,batchTableProperties:s,dequantizeInShader:!1};return await TLe(e,c,i,n)}async function TLe(e,t,r,i){if(!i)return;let{parse:n}=i,a=Je(ae({},r),{draco:Je(ae({},r==null?void 0:r.draco),{extraAttributes:t.batchTableProperties||{}})});delete a["3d-tiles"];let o=await n(t.buffer,$m,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 FO.Vector3(y,y,y),e.quantizedVolumeOffset=new FO.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=ae({positions:s,colors:DO(e,u,void 0),normals:l,batchIds:c},d)}var DQ="4.0.0-alpha.9";var tS="4.0.0-alpha.9";var{_parseImageNode:kLe}=globalThis,MO=typeof Image!="undefined",jO=typeof ImageBitmap!="undefined",RLe=Boolean(kLe),LO=on?!0:RLe;function FQ(e){switch(e){case"auto":return jO||MO||LO;case"imagebitmap":return jO;case"image":return MO;case"data":return LO;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function MQ(){if(jO)return"imagebitmap";if(MO)return"image";if(LO)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function jQ(e){let t=CLe(e);if(!t)throw new Error("Not an image");return t}function NO(e){return tg(e)}function tg(e){switch(jQ(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 CLe(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 ILe=/^data:image\/svg\+xml/,PLe=/\.svg((\?|#).*)?$/;function rS(e){return e&&(ILe.test(e)||PLe.test(e))}function LQ(e,t){if(rS(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 qO(e,t)}function qO(e,t){if(rS(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function Ny(e,t,r){let i=LQ(e,r),n=self.URL||self.webkitURL,a=typeof i!="string"&&n.createObjectURL(i);try{return await OLe(a||i,t)}finally{a&&n.revokeObjectURL(a)}}async function OLe(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 BLe={},NQ=!0;async function UO(e,t,r){let i;rS(r)?i=await Ny(e,t,r):i=qO(e,r);let n=t&&t.imagebitmap;return await DLe(i,n)}async function DLe(e,t=null){if((FLe(t)||!NQ)&&(t=null),t)try{return await createImageBitmap(e,t)}catch(r){console.warn(r),NQ=!1}return await createImageBitmap(e)}function FLe(e){for(let t in e||BLe)return!1;return!0}function qQ(e){return!NLe(e,"ftyp",4)||(e[8]&96)==0?null:MLe(e)}function MLe(e){switch(jLe(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function jLe(e,t,r){return String.fromCharCode(...e.slice(t,r))}function LLe(e){return[...e].map(t=>t.charCodeAt(0))}function NLe(e,t,r=0){let i=LLe(t);for(let n=0;n<i.length;++n)if(i[n]!==e[n+r])return!1;return!0}var il=!1,qy=!0;function wd(e){let t=Uy(e);return ULe(t)||HLe(t)||GLe(t)||zLe(t)||qLe(t)}function qLe(e){let t=new Uint8Array(e instanceof DataView?e.buffer:e),r=qQ(t);return r?{mimeType:r.mimeType,width:0,height:0}:null}function ULe(e){let t=Uy(e);return t.byteLength>=24&&t.getUint32(0,il)===2303741511?{mimeType:"image/png",width:t.getUint32(16,il),height:t.getUint32(20,il)}:null}function GLe(e){let t=Uy(e);return t.byteLength>=10&&t.getUint32(0,il)===1195984440?{mimeType:"image/gif",width:t.getUint16(6,qy),height:t.getUint16(8,qy)}:null}function zLe(e){let t=Uy(e);return t.byteLength>=14&&t.getUint16(0,il)===16973&&t.getUint32(2,qy)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,qy),height:t.getUint32(22,qy)}:null}function HLe(e){let t=Uy(e);if(!(t.byteLength>=3&&t.getUint16(0,il)===65496&&t.getUint8(2)===255))return null;let{tableMarkers:i,sofMarkers:n}=WLe(),a=2;for(;a+9<t.byteLength;){let o=t.getUint16(a,il);if(n.has(o))return{mimeType:"image/jpeg",height:t.getUint16(a+5,il),width:t.getUint16(a+7,il)};if(!i.has(o))return null;a+=2,a+=t.getUint16(a,il)}return null}function WLe(){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 Uy(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 GO(e,t){let{mimeType:r}=wd(e)||{},i=globalThis._parseImageNode;return Ut(i),await i(e,r)}async function zO(e,t,r){t=t||{};let n=(t.image||{}).type||"auto",{url:a}=r||{},o=VLe(n),s;switch(o){case"imagebitmap":s=await UO(e,t,a);break;case"image":s=await Ny(e,t,a);break;case"data":s=await GO(e,t);break;default:Ut(!1)}return n==="data"&&(s=tg(s)),s}function VLe(e){switch(e){case"auto":case"data":return MQ();default:return FQ(e),e}}var KLe=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],YLe=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],$Le={image:{type:"auto",decode:!0}},rg={id:"image",module:"images",name:"Images",version:tS,mimeTypes:YLe,extensions:KLe,parse:zO,tests:[e=>Boolean(wd(new DataView(e)))],options:$Le};var{_encodeImageNode:UQ}=globalThis;async function GQ(e,t){return t=t||{},t.image=t.image||{},UQ?UQ(e,{type:t.image.mimeType}):XLe(e,t)}var zQ=!0;async function XLe(e,t){let{mimeType:r,jpegQuality:i}=t.image,{width:n,height:a}=NO(e),o=document.createElement("canvas");o.width=n,o.height=a,JLe(e,o);let s=await new Promise(u=>{if(i&&zQ)try{o.toBlob(u,r,i);return}catch{zQ=!1}o.toBlob(u,r)});if(!s)throw new Error("image encoding failed");return await s.arrayBuffer()}function JLe(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 HO={name:"Images",id:"image",module:"images",version:tS,extensions:["jpeg"],options:{image:{mimeType:"image/png",jpegQuality:null}},encode:GQ};var WO={};function VO(e){if(WO[e]===void 0){let t=on?ZLe(e):QLe(e);WO[e]=t}return WO[e]}function QLe(e){let t=["image/png","image/jpeg","image/gif"],{_parseImageNode:r,_imageFormatsNode:i=t}=globalThis;return Boolean(r)&&i.includes(e)}function ZLe(e){switch(e){case"image/avif":case"image/webp":return e4e(e);default:return!0}}function e4e(e){try{return document.createElement("canvas").toDataURL(e).indexOf(`data:${e}`)===0}catch{return!1}}var ig="4.0.0-alpha.9";var HQ="4.0.0-alpha.9",t4e=`https://unpkg.com/@loaders.gl/textures@${HQ}/dist/libs/basis_encoder.wasm`,r4e=`https://unpkg.com/@loaders.gl/textures@${HQ}/dist/libs/basis_encoder.js`,KO;async function YO(e){let t=e.modules||{};return t.basis?t.basis:(KO=KO||i4e(e),await KO)}async function i4e(e){let t=null,r=null;return[t,r]=await Promise.all([await Hu("basis_transcoder.js","textures",e),await Hu("basis_transcoder.wasm","textures",e)]),t=t||globalThis.BASIS,await n4e(t,r)}function n4e(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 $O;async function XO(e){let t=e.modules||{};return t.basisEncoder?t.basisEncoder:($O=$O||a4e(e),await $O)}async function a4e(e){let t=null,r=null;return[t,r]=await Promise.all([await Hu(r4e,"textures",e),await Hu(t4e,"textures",e)]),t=t||globalThis.BASIS,await o4e(t,r)}function o4e(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 Se={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 s4e=["","WEBKIT_","MOZ_"],WQ={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"},iS=null;function Gy(e){if(!iS){e=e||u4e()||void 0,iS=new Set;for(let t of s4e)for(let r in WQ)if(e&&e.getExtension(`${t}${r}`)){let i=WQ[r];iS.add(i)}}return iS}function u4e(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var iZ=Fe(tZ());function ng(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=f4e(t,i,n,e,o),u=c4e(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 c4e(e,t,r,i){return Array.isArray(e)?e[t].levelData:new Uint8Array(e.buffer,e.byteOffset+r,i)}function f4e(e,t,r,i,n){return Array.isArray(i)?e.sizeFunction(i[n]):e.sizeFunction(t,r)}var h4e={131:Se.COMPRESSED_RGB_S3TC_DXT1_EXT,132:Se.COMPRESSED_SRGB_S3TC_DXT1_EXT,133:Se.COMPRESSED_RGBA_S3TC_DXT1_EXT,134:Se.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,135:Se.COMPRESSED_RGBA_S3TC_DXT3_EXT,136:Se.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,137:Se.COMPRESSED_RGBA_S3TC_DXT5_EXT,138:Se.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,139:Se.COMPRESSED_RED_RGTC1_EXT,140:Se.COMPRESSED_SIGNED_RED_RGTC1_EXT,141:Se.COMPRESSED_RED_GREEN_RGTC2_EXT,142:Se.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,147:Se.COMPRESSED_RGB8_ETC2,148:Se.COMPRESSED_SRGB8_ETC2,149:Se.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,150:Se.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,151:Se.COMPRESSED_RGBA8_ETC2_EAC,152:Se.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,153:Se.COMPRESSED_R11_EAC,154:Se.COMPRESSED_SIGNED_R11_EAC,155:Se.COMPRESSED_RG11_EAC,156:Se.COMPRESSED_SIGNED_RG11_EAC,157:Se.COMPRESSED_RGBA_ASTC_4x4_KHR,158:Se.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,159:Se.COMPRESSED_RGBA_ASTC_5x4_KHR,160:Se.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR,161:Se.COMPRESSED_RGBA_ASTC_5x5_KHR,162:Se.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,163:Se.COMPRESSED_RGBA_ASTC_6x5_KHR,164:Se.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,165:Se.COMPRESSED_RGBA_ASTC_6x6_KHR,166:Se.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,167:Se.COMPRESSED_RGBA_ASTC_8x5_KHR,168:Se.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,169:Se.COMPRESSED_RGBA_ASTC_8x6_KHR,170:Se.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,171:Se.COMPRESSED_RGBA_ASTC_8x8_KHR,172:Se.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,173:Se.COMPRESSED_RGBA_ASTC_10x5_KHR,174:Se.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,175:Se.COMPRESSED_RGBA_ASTC_10x6_KHR,176:Se.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,177:Se.COMPRESSED_RGBA_ASTC_10x8_KHR,178:Se.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,179:Se.COMPRESSED_RGBA_ASTC_10x10_KHR,180:Se.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,181:Se.COMPRESSED_RGBA_ASTC_12x10_KHR,182:Se.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,183:Se.COMPRESSED_RGBA_ASTC_12x12_KHR,184:Se.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,1000054e3:Se.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,1000054001:Se.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,1000066e3:Se.COMPRESSED_RGBA_ASTC_4x4_KHR,1000066001:Se.COMPRESSED_RGBA_ASTC_5x4_KHR,1000066002:Se.COMPRESSED_RGBA_ASTC_5x5_KHR,1000066003:Se.COMPRESSED_RGBA_ASTC_6x5_KHR,1000066004:Se.COMPRESSED_RGBA_ASTC_6x6_KHR,1000066005:Se.COMPRESSED_RGBA_ASTC_8x5_KHR,1000066006:Se.COMPRESSED_RGBA_ASTC_8x6_KHR,1000066007:Se.COMPRESSED_RGBA_ASTC_8x8_KHR,1000066008:Se.COMPRESSED_RGBA_ASTC_10x5_KHR,1000066009:Se.COMPRESSED_RGBA_ASTC_10x6_KHR,1000066010:Se.COMPRESSED_RGBA_ASTC_10x8_KHR,1000066011:Se.COMPRESSED_RGBA_ASTC_10x10_KHR,1000066012:Se.COMPRESSED_RGBA_ASTC_12x10_KHR,1000066013:Se.COMPRESSED_RGBA_ASTC_12x12_KHR};function rZ(e){return h4e[e]}var ko=[171,75,84,88,32,50,48,187,13,10,26,10];function uS(e){let t=new Uint8Array(e);return!(t.byteLength<ko.length||t[0]!==ko[0]||t[1]!==ko[1]||t[2]!==ko[2]||t[3]!==ko[3]||t[4]!==ko[4]||t[5]!==ko[5]||t[6]!==ko[6]||t[7]!==ko[7]||t[8]!==ko[8]||t[9]!==ko[9]||t[10]!==ko[10]||t[11]!==ko[11])}function nZ(e){let t=new Uint8Array(e),r=(0,iZ.read)(t),i=Math.max(1,r.levels.length),n=r.pixelWidth,a=r.pixelHeight,o=rZ(r.vkFormat);return ng(r.levels,{mipMapLevels:i,width:n,height:a,sizeFunction:s=>s.uncompressedByteLength,internalFormat:o})}var d4e={etc1:{basisFormat:0,compressed:!0,format:Se.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:Se.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:Se.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:Se.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:Se.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:Se.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 Hy(e,t){if(t.basis.containerFormat==="auto"){if(uS(e)){let i=await XO(t);return aZ(i.KTX2File,e,t)}let{BasisFile:r}=await YO(t);return tB(r,e,t)}switch(t.basis.module){case"encoder":let r=await XO(t);switch(t.basis.containerFormat){case"ktx2":return aZ(r.KTX2File,e,t);case"basis":default:return tB(r.BasisFile,e,t)}case"transcoder":default:let{BasisFile:i}=await YO(t);return tB(i,e,t)}}function tB(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(p4e(i,o,l,r));a.push(u)}return a}finally{i.close(),i.delete()}}function p4e(e,t,r,i){let n=e.getImageWidth(t,r),a=e.getImageHeight(t,r),o=e.getHasAlpha(),{compressed:s,format:u,basisFormat:l}=oZ(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 aZ(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(m4e(i,o,r));break}return[a]}finally{i.close(),i.delete()}}function m4e(e,t,r){let{alphaFlag:i,height:n,width:a}=e.getImageLevelInfo(t,0,0),{compressed:o,format:s,basisFormat:u}=oZ(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 oZ(e,t){let r=e&&e.basis&&e.basis.format;return r==="auto"&&(r=ag()),typeof r=="object"&&(r=t?r.alpha:r.noAlpha),r=r.toLowerCase(),d4e[r]}function ag(){let e=Gy();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 sZ={name:"Basis",id:"basis",module:"textures",version:ig,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"}}},Ed=Je(ae({},sZ),{parse:Hy});var Ro={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},g4e={DXT1:Se.COMPRESSED_RGB_S3TC_DXT1_EXT,DXT3:Se.COMPRESSED_RGBA_S3TC_DXT3_EXT,DXT5:Se.COMPRESSED_RGBA_S3TC_DXT5_EXT,"ATC ":Se.COMPRESSED_RGB_ATC_WEBGL,ATCA:Se.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,ATCI:Se.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL},v4e=cZ,y4e=lS,b4e=lS,_4e={DXT1:cZ,DXT3:lS,DXT5:lS,"ATC ":v4e,ATCA:y4e,ATCI:b4e};function uZ(e){return new Uint32Array(e,0,Ro.HEADER_LENGTH)[Ro.MAGIC_NUMBER_INDEX]===Ro.MAGIC_NUMBER}function lZ(e){let t=new Int32Array(e,0,Ro.HEADER_LENGTH),r=t[Ro.HEADER_PF_FOURCC_INDEX];Ut(Boolean(t[Ro.HEADER_PF_FLAGS_INDEX]&Ro.DDPF_FOURCC),"DDS: Unsupported format, must contain a FourCC code");let i=x4e(r),n=g4e[i],a=_4e[i];Ut(n&&a,`DDS: Unknown pixel format ${r}`);let o=1;t[Ro.HEADER_FLAGS_INDEX]&Ro.DDSD_MIPMAPCOUNT&&(o=Math.max(1,t[Ro.MIPMAPCOUNT_INDEX]));let s=t[Ro.HEADER_WIDTH_INDEX],u=t[Ro.HEADER_HEIGHT_INDEX],l=t[Ro.HEADER_SIZE_INDEX]+4,c=new Uint8Array(e,l);return ng(c,{mipMapLevels:o,width:s,height:u,sizeFunction:a,internalFormat:n})}function cZ(e,t){return(e+3>>2)*(t+3>>2)*8}function lS(e,t){return(e+3>>2)*(t+3>>2)*16}function x4e(e){return String.fromCharCode(e&255,e>>8&255,e>>16&255,e>>24&255)}var us={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},w4e={0:[Se.COMPRESSED_RGB_PVRTC_2BPPV1_IMG],1:[Se.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG],2:[Se.COMPRESSED_RGB_PVRTC_4BPPV1_IMG],3:[Se.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG],6:[Se.COMPRESSED_RGB_ETC1_WEBGL],7:[Se.COMPRESSED_RGB_S3TC_DXT1_EXT],9:[Se.COMPRESSED_RGBA_S3TC_DXT3_EXT],11:[Se.COMPRESSED_RGBA_S3TC_DXT5_EXT],22:[Se.COMPRESSED_RGB8_ETC2],23:[Se.COMPRESSED_RGBA8_ETC2_EAC],24:[Se.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2],25:[Se.COMPRESSED_R11_EAC],26:[Se.COMPRESSED_RG11_EAC],27:[Se.COMPRESSED_RGBA_ASTC_4X4_KHR,Se.COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR],28:[Se.COMPRESSED_RGBA_ASTC_5X4_KHR,Se.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR],29:[Se.COMPRESSED_RGBA_ASTC_5X5_KHR,Se.COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR],30:[Se.COMPRESSED_RGBA_ASTC_6X5_KHR,Se.COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR],31:[Se.COMPRESSED_RGBA_ASTC_6X6_KHR,Se.COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR],32:[Se.COMPRESSED_RGBA_ASTC_8X5_KHR,Se.COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR],33:[Se.COMPRESSED_RGBA_ASTC_8X6_KHR,Se.COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR],34:[Se.COMPRESSED_RGBA_ASTC_8X8_KHR,Se.COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR],35:[Se.COMPRESSED_RGBA_ASTC_10X5_KHR,Se.COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR],36:[Se.COMPRESSED_RGBA_ASTC_10X6_KHR,Se.COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR],37:[Se.COMPRESSED_RGBA_ASTC_10X8_KHR,Se.COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR],38:[Se.COMPRESSED_RGBA_ASTC_10X10_KHR,Se.COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR],39:[Se.COMPRESSED_RGBA_ASTC_12X10_KHR,Se.COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR],40:[Se.COMPRESSED_RGBA_ASTC_12X12_KHR,Se.COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR]},E4e={0:dZ,1:dZ,2:pZ,3:pZ,6:Wy,7:Wy,9:Vy,11:Vy,22:Wy,23:Vy,24:Wy,25:Wy,26:Vy,27:Vy,28:S4e,29:A4e,30:T4e,31:k4e,32:R4e,33:C4e,34:I4e,35:P4e,36:O4e,37:B4e,38:D4e,39:F4e,40:M4e};function fZ(e){let r=new Uint32Array(e,0,us.HEADER_LENGTH)[us.MAGIC_NUMBER_INDEX];return r===us.MAGIC_NUMBER||r===us.MAGIC_NUMBER_EXTRA}function hZ(e){let t=new Uint32Array(e,0,us.HEADER_LENGTH),r=t[us.PIXEL_FORMAT_INDEX],i=t[us.COLOUR_SPACE_INDEX],n=w4e[r]||[],a=n.length>1&&i?n[1]:n[0],o=E4e[r],s=t[us.MIPMAPCOUNT_INDEX],u=t[us.WIDTH_INDEX],l=t[us.HEIGHT_INDEX],c=us.HEADER_SIZE+t[us.METADATA_SIZE_INDEX],f=new Uint8Array(e,c);return ng(f,{mipMapLevels:s,width:u,height:l,sizeFunction:o,internalFormat:a})}function dZ(e,t){return e=Math.max(e,16),t=Math.max(t,8),e*t/4}function pZ(e,t){return e=Math.max(e,8),t=Math.max(t,8),e*t/2}function Wy(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8}function Vy(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16}function S4e(e,t){return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16}function A4e(e,t){return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16}function T4e(e,t){return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16}function k4e(e,t){return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16}function R4e(e,t){return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16}function C4e(e,t){return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16}function I4e(e,t){return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16}function P4e(e,t){return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16}function O4e(e,t){return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16}function B4e(e,t){return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16}function D4e(e,t){return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16}function F4e(e,t){return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16}function M4e(e,t){return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16}function mZ(e){if(uS(e))return nZ(e);if(uZ(e))return lZ(e);if(fZ(e))return hZ(e);throw new Error("Texture container format not recognized")}var j4e={"compressed-texture":{libraryPath:"libs/",useBasis:!1}},gZ={name:"Texture Containers",id:"compressed-texture",module:"textures",version:ig,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:j4e},cS=Je(ae({},gZ),{parse:async(e,t)=>t["compressed-texture"].useBasis?(t.basis=Je(ae({format:{alpha:"BC3",noAlpha:"BC1"}},t.basis),{containerFormat:"ktx2",module:"encoder"}),(await Hy(e,t))[0]):mZ(e)});var fS={name:"Basis Universal Supercompressed GPU Texture",id:"ktx2-basis-writer",module:"textures",version:ig,extensions:["ktx2"],worker:!0,options:{useSRGB:!1,qualityLevel:10,encodeUASTC:!1,mipmaps:!1}};function Ln(e,t){if(!e)throw new Error(t||"assert failed: gltf")}var og=!0,vZ=1735152710,rB=12,hS=8,L4e=1313821514,N4e=5130562,q4e=0,U4e=0,G4e=1;function z4e(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 yZ(e,t=0,r={}){let i=new DataView(e),{magic:n=vZ}=r,a=i.getUint32(t,!1);return a===n||a===vZ}function bZ(e,t,r=0,i={}){let n=new DataView(t),a=z4e(n,r+0),o=n.getUint32(r+4,og),s=n.getUint32(r+8,og);switch(Object.assign(e,{header:{byteOffset:r,byteLength:s,hasBinChunk:!1},type:a,version:o,json:{},binChunks:[]}),r+=rB,e.version){case 1:return H4e(e,n,r);case 2:return W4e(e,n,r,i={});default:throw new Error(`Invalid GLB version ${e.version}. Only supports version 1 and 2.`)}}function H4e(e,t,r){Ut(e.header.byteLength>rB+hS);let i=t.getUint32(r+0,og),n=t.getUint32(r+4,og);return r+=hS,Ut(n===q4e),iB(e,t,r,i),r+=i,r+=nB(e,t,r,e.header.byteLength),r}function W4e(e,t,r,i){return Ut(e.header.byteLength>rB+hS),V4e(e,t,r,i),r+e.header.byteLength}function V4e(e,t,r,i){for(;r+8<=e.header.byteLength;){let n=t.getUint32(r+0,og),a=t.getUint32(r+4,og);switch(r+=hS,a){case L4e:iB(e,t,r,n);break;case N4e:nB(e,t,r,n);break;case U4e:i.strict||iB(e,t,r,n);break;case G4e:i.strict||nB(e,t,r,n);break;default:break}r+=_f(n,4)}return r}function iB(e,t,r,i){let n=new Uint8Array(t.buffer,r,i),o=new TextDecoder("utf8").decode(n);return e.json=JSON.parse(o),_f(i,4)}function nB(e,t,r,i){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:r,byteLength:i,arrayBuffer:t.buffer}),_f(i,4)}function aB(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 _Z(e,t,r){let i=e.bufferViews[r];Ln(i);let n=i.buffer,a=t[n];Ln(a);let o=(i.byteOffset||0)+a.byteOffset;return new Uint8Array(a.arrayBuffer,o,i.byteLength)}var sB={};go(sB,{decode:()=>f5e,name:()=>c5e});var K4e=1.33,xZ=["SCALAR","VEC2","VEC3","VEC4"],Y4e=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],$4e=new Map(Y4e),X4e={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},J4e={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Q4e={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function dS(e){return xZ[e-1]||xZ[0]}function sg(e){let t=$4e.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function ug(e,t){let r=Q4e[e.componentType],i=X4e[e.type],n=J4e[e.componentType],a=e.count*i,o=e.count*i*n;return Ln(o>=0&&o<=t.byteLength),{ArrayType:r,length:a,byteLength:o}}function Ky(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*K4e)}function Z4e(){return{asset:{version:"2.0",generator:"loaders.gl"},buffers:[],extensions:{},extensionsRequired:[],extensionsUsed:[]}}var Si=class{constructor(t){this.gltf={json:(t==null?void 0:t.json)||Z4e(),buffers:(t==null?void 0:t.buffers)||[],images:(t==null?void 0:t.images)||[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(t){return this.json[t]}getExtraData(t){return(this.json.extras||{})[t]}hasExtension(t){let r=this.getUsedExtensions().find(n=>n===t),i=this.getRequiredExtensions().find(n=>n===t);return typeof r=="string"||typeof i=="string"}getExtension(t){let r=this.getUsedExtensions().find(n=>n===t),i=this.json.extensions||{};return r?i[t]: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];Ln(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}=ug(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==null?void 0:t.extensions)||{};if(i[r]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let n=this.json.extensionsRemoved;n.includes(r)||n.push(r)}delete i[r]}addExtension(t,r={}){return Ln(r),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=r,this.registerUsedExtension(t),r}addRequiredExtension(t,r={}){return Ln(r),this.addExtension(t,r),this.registerRequiredExtension(t),r}registerUsedExtension(t){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(r=>r===t)||this.json.extensionsUsed.push(t)}registerRequiredExtension(t){this.registerUsedExtension(t),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(r=>r===t)||this.json.extensionsRequired.push(t)}removeExtension(t){var r;if((r=this.json.extensions)==null?void 0:r[t]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let i=this.json.extensionsRemoved;i.includes(t)||i.push(t)}this.json.extensions&&delete this.json.extensions[t],this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,t),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,t)}setDefaultScene(t){this.json.scene=t}addScene(t){let{nodeIndices:r}=t;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:r}),this.json.scenes.length-1}addNode(t){let{meshIndex:r,matrix: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=wd(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,r=0,i=this.byteLength){let n=t.byteLength;Ln(Number.isFinite(n)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);let a={buffer:r,byteOffset:i,byteLength:n};return this.byteLength+=_f(n,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(a),this.json.bufferViews.length-1}addAccessor(t,r){let i={bufferView:t,type:dS(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:sg(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=DI(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 e5e="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",t5e="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",r5e=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]),i5e=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]),n5e={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},a5e={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};async function wZ(e,t,r,i,n,a="NONE"){let o=await o5e();l5e(o,o.exports[a5e[n]],e,t,r,i,o.exports[n5e[a||"NONE"]])}var oB;async function o5e(){return oB||(oB=s5e()),oB}async function s5e(){let e=e5e;WebAssembly.validate(r5e)&&(e=t5e,console.log("Warning: meshopt_decoder is using experimental SIMD support"));let t=await WebAssembly.instantiate(u5e(e),{});return await t.instance.exports.__wasm_call_ctors(),t.instance}function u5e(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?i5e[t[i]]:(t[i]-60)*64+t[++i];return t.buffer.slice(0,r)}function l5e(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 pS="EXT_meshopt_compression",c5e=pS;async function f5e(e,t){var n;let r=new Si(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(h5e(r,a));await Promise.all(i),r.removeExtension(pS)}async function h5e(e,t){let r=e.getObjectExtension(t,pS);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);await wZ(h,o,a,f,s,u),e.removeObjectExtension(t,pS)}}var uB={};go(uB,{name:()=>d5e,preprocess:()=>p5e});var lg="EXT_texture_webp",d5e=lg;function p5e(e,t){let r=new Si(e);if(!VO("image/webp")){if(r.getRequiredExtensions().includes(lg))throw new Error(`gltf: Required extension ${lg} not supported by browser`);return}let{json:i}=r;for(let n of i.textures||[]){let a=r.getObjectExtension(n,lg);a&&(n.source=a.source),r.removeObjectExtension(n,lg)}r.removeExtension(lg)}var lB={};go(lB,{name:()=>m5e,preprocess:()=>g5e});var mS="KHR_texture_basisu",m5e=mS;function g5e(e,t){let r=new Si(e),{json:i}=r;for(let n of i.textures||[]){let a=r.getObjectExtension(n,mS);a&&(n.source=a.source,r.removeObjectExtension(n,mS))}r.removeExtension(mS)}var fB={};go(fB,{decode:()=>x5e,encode:()=>w5e,name:()=>b5e,preprocess:()=>_5e});function EZ(e){let t={};for(let r in e){let i=e[r];if(r!=="indices"){let n=cB(i);t[r]=n}}return t}function cB(e){let{buffer:t,size:r,count:i}=v5e(e);return{value:t,size:r,byteOffset:0,count:i,type:dS(r),componentType:sg(t)}}function v5e(e){let t=e,r=1,i=0;return e&&e.value&&(t=e.value,r=e.size||1),t&&(ArrayBuffer.isView(t)||(t=y5e(t,Float32Array)),i=t.length/r),{buffer:t,size:r,count:i}}function y5e(e,t,r=!1){return e?Array.isArray(e)?new t(e):r&&!(e instanceof t)?new t(e):e:null}var Mf="KHR_draco_mesh_compression",b5e=Mf;function _5e(e,t,r){let i=new Si(e);for(let n of SZ(i))i.getObjectExtension(n,Mf)}async function x5e(e,t,r){var a;if(!((a=t==null?void 0:t.gltf)==null?void 0:a.decompressMeshes))return;let i=new Si(e),n=[];for(let o of SZ(i))i.getObjectExtension(o,Mf)&&n.push(E5e(i,o,t,r));await Promise.all(n),i.removeExtension(Mf)}function w5e(e,t={}){let r=new Si(e);for(let i of r.json.meshes||[])S5e(i,t),r.addRequiredExtension(Mf)}async function E5e(e,t,r,i){let n=e.getObjectExtension(t,Mf);if(!n)return;let a=e.getTypedArrayForBufferView(n.bufferView),o=ad(a.buffer,a.byteOffset),{parse:s}=i,u=ae({},r);delete u["3d-tiles"];let l=await s(o,$m,u,i),c=EZ(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=cB(l.indices)),e.removeObjectExtension(t,Mf),A5e(t)}function S5e(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:{[Mf]:{bufferView:u,attributes:s}}}]}}function A5e(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*SZ(e){for(let t of e.json.meshes||[])for(let r of t.primitives)yield r}var dB={};go(dB,{decode:()=>C5e,name:()=>T5e});var cg=Fe(dr());var AZ={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},TZ={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4};var hB="KHR_texture_transform",T5e=hB,gS=new cg.Vector3,k5e=new cg.Matrix3,R5e=new cg.Matrix3;async function C5e(e,t){if(!new Si(e).hasExtension(hB))return;let n=e.json.materials||[];for(let a=0;a<n.length;a++)I5e(a,e)}function I5e(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&&Yy(t,e,n,r);let a=i==null?void 0:i.emissiveTexture;a&&Yy(t,e,a,r);let o=i==null?void 0:i.normalTexture;o&&Yy(t,e,o,r);let s=i==null?void 0:i.occlusionTexture;s&&Yy(t,e,s,r);let u=(f=i==null?void 0:i.pbrMetallicRoughness)==null?void 0:f.metallicRoughnessTexture;u&&Yy(t,e,u,r)}function Yy(e,t,r,i){let n=P5e(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&&O5e(e,s,n)}}function P5e(e,t){var o;let r=(o=e.extensions)==null?void 0:o[hB],{texCoord:i=0}=e,{texCoord:n=i}=r;if(!(t.findIndex(([s,u])=>s===i&&u===n)!==-1)){let s=F5e(r);return i!==n&&(e.texCoord=n),t.push([i,n]),{originalTexCoord:i,texCoord:n,matrix:s}}return null}function O5e(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}=ug(l,c),g=TZ[l.componentType],b=AZ[l.type],E=c.byteStride||g*b,T=new Float32Array(y);for(let k=0;k<l.count;k++){let R=new p(f,d+k*E,2);gS.set(R[0],R[1],1),gS.transformByMatrix3(a),T.set([gS[0],gS[1]],k*b)}i===n?B5e(l,c,e.buffers,T):D5e(n,l,t,e,T)}}}}function B5e(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 D5e(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 F5e(e){let{offset:t=[0,0],rotation:r=0,scale:i=[1,1]}=e,n=new cg.Matrix3().set(1,0,0,0,1,0,t[0],t[1],1),a=k5e.set(Math.cos(r),Math.sin(r),0,-Math.sin(r),Math.cos(r),0,0,0,1),o=R5e.set(i[0],0,0,0,i[1],0,0,0,1);return n.multiplyRight(a).multiplyRight(o)}var pB={};go(pB,{decode:()=>j5e,encode:()=>L5e,name:()=>M5e});var Sd="KHR_lights_punctual",M5e=Sd;async function j5e(e){let t=new Si(e),{json:r}=t,i=t.getExtension(Sd);i&&(t.json.lights=i.lights,t.removeExtension(Sd));for(let n of r.nodes||[]){let a=t.getObjectExtension(n,Sd);a&&(n.light=a.light),t.removeObjectExtension(n,Sd)}}async function L5e(e){let t=new Si(e),{json:r}=t;if(r.lights){let i=t.addExtension(Sd);Ln(!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,Sd,i)}delete t.json.lights}}var mB={};go(mB,{decode:()=>q5e,encode:()=>U5e,name:()=>N5e});var $y="KHR_materials_unlit",N5e=$y;async function q5e(e){let t=new Si(e),{json:r}=t;for(let i of r.materials||[])i.extensions&&i.extensions.KHR_materials_unlit&&(i.unlit=!0),t.removeObjectExtension(i,$y);t.removeExtension($y)}function U5e(e){let t=new Si(e),{json:r}=t;if(t.materials)for(let i of r.materials||[])i.unlit&&(delete i.unlit,t.addObjectExtension(i,$y,{}),t.addExtension($y))}var gB={};go(gB,{decode:()=>z5e,encode:()=>H5e,name:()=>G5e});var Xy="KHR_techniques_webgl",G5e=Xy;async function z5e(e){let t=new Si(e),{json:r}=t,i=t.getExtension(Xy);if(i){let n=W5e(i,t);for(let a of r.materials||[]){let o=t.getObjectExtension(a,Xy);o&&(a.technique=Object.assign({},o,n[o.technique]),a.technique.values=V5e(a.technique,t)),t.removeObjectExtension(a,Xy)}t.removeExtension(Xy)}}async function H5e(e,t){}function W5e(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 V5e(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 vB={};go(vB,{decode:()=>Y5e,name:()=>K5e});var kZ="EXT_feature_metadata",K5e=kZ;async function Y5e(e,t){let r=new Si(e);$5e(r,t)}function $5e(e,t){var o,s;let r=e.getExtension(kZ);if(!r)return;let i=(o=r.schema)==null?void 0:o.classes,{featureTables:n}=r;if(i&&n)for(let u in i){let l=i[u],c=nNe(n,u);c&&X5e(e,c,l)}let{featureTextures:a}=r;if(i&&a&&((s=t.gltf)==null?void 0:s.loadImages))for(let u in i){let l=i[u],c=aNe(a,u);c&&J5e(e,c,l)}}function X5e(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=Q5e(e,a,s,o);o.data=u}}}function J5e(e,t,r){var n;let i=t.class;for(let a in r.properties){let o=(n=t==null?void 0:t.properties)==null?void 0:n[a];if(o){let s=Z5e(e,o,i);o.data=s}}}function Q5e(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);return oNe(a,s,r)}default:}return a}function Z5e(e,t,r){let i=e.gltf.json;if(!i.meshes)return[];let n=[];for(let a of i.meshes)for(let o of a.primitives)eNe(e,r,t,n,o);return n}function eNe(e,t,r,i,n){var k,R,D;let a=e.gltf.json,o=[],s=`TEXCOORD_${r.texture.texCoord}`,u=n.attributes[s],l=e.getBufferView(u),c=e.getTypedArrayForBufferView(l),f=new Float32Array(c.buffer,c.byteOffset,c.length/4),h=r.texture.index,d=(k=a.textures)==null?void 0:k[h],p=d==null?void 0:d.source;if(typeof p!="undefined"){let C=(R=a.images)==null?void 0:R[p],L=C==null?void 0:C.mimeType,B=(D=e.gltf.images)==null?void 0:D[p];if(B)for(let V=0;V<f.length;V+=2){let N=tNe(B,L,f,V,r.channels);o.push(N)}}let y=[];for(let C of o){let L=i.findIndex(B=>B===C);L===-1&&(L=i.push(C)-1),y.push(L)}let g=new Uint32Array(y),b=e.gltf.buffers.push({arrayBuffer:g.buffer,byteOffset:0,byteLength:g.byteLength})-1,E=e.addBufferView(g,b,0),T=e.addAccessor(E,{size:1,componentType:sg(g),count:g.length});n.attributes[t]=T}function tNe(e,t,r,i,n){let a={r:{offset:0,shift:0},g:{offset:1,shift:8},b:{offset:2,shift:16},a:{offset:3,shift:24}},o=r[i],s=r[i+1],u=1;t&&(t.indexOf("image/jpeg")!==-1||t.indexOf("image/png")!==-1)&&(u=4);let l=iNe(o,s,e,u),c=0;for(let f of n){let h=a[f];c|=rNe(e,l+h.offset)<<h.shift}return c}function rNe(e,t){let r=tg(e);if(r.data.length<=t)throw new Error(`${r.data.length} <= ${t}`);return r.data[t]}function iNe(e,t,r,i=1){let n=r.width,a=RZ(e)*(n-1),o=Math.round(a),s=r.height,u=RZ(t)*(s-1),l=Math.round(u),c=r.components?r.components:i;return(l*n+o)*c}function RZ(e){return(e%1+1)%1}function nNe(e,t){for(let r in e){let i=e[r];if(i.class===t)return i}return null}function aNe(e,t){for(let r in e){let i=e[r];if(i.class===t)return i}return null}function oNe(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 CZ=[sB,uB,lB,fB,pB,mB,gB,dB,vB];function IZ(e,t={},r){var n;let i=CZ.filter(a=>OZ(a.name,t));for(let a of i)(n=a.preprocess)==null||n.call(a,e,t,r)}async function PZ(e,t={},r){var n;let i=CZ.filter(a=>OZ(a.name,t));for(let a of i)await((n=a.decode)==null?void 0:n.call(a,e,t,r))}function OZ(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 yB="KHR_binary_glTF";function BZ(e){let t=new Si(e),{json:r}=t;for(let i of r.images||[]){let n=t.getObjectExtension(i,yB);n&&Object.assign(i,n),t.removeObjectExtension(i,yB)}r.buffers&&r.buffers[0]&&delete r.buffers[0].uri,t.removeExtension(yB)}var DZ={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},sNe={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},FZ=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),BZ(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 DZ)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 DZ)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=sNe[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 MZ(e,t={}){return new FZ().normalize(e,t)}async function jZ(e,t,r=0,i,n){var a,o,s;return uNe(e,t,r,i),MZ(e,{normalize:(a=i==null?void 0:i.gltf)==null?void 0:a.normalize}),IZ(e,i,n),((o=i==null?void 0:i.gltf)==null?void 0:o.loadBuffers)&&e.json.buffers&&await lNe(e,i,n),((s=i==null?void 0:i.gltf)==null?void 0:s.loadImages)&&await cNe(e,i,n),await PZ(e,i,n),e}function uNe(e,t,r,i){if(i.uri&&(e.baseUri=i.uri),t instanceof ArrayBuffer&&!yZ(t,r,i)&&(t=new TextDecoder().decode(t)),typeof t=="string")e.json=OI(t);else if(t instanceof ArrayBuffer){let o={};r=bZ(o,t,r,i.glb),Ln(o.type==="glTF",`Invalid GLB magic string ${o.type}`),e._glb=o,e.json=o.json}else Ln(!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 lNe(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;Ln(u);let l=aB(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 cNe(e,t,r){let i=fNe(e),n=e.json.images||[],a=[];for(let o of i)a.push(hNe(e,n[o],o,t,r));return await Promise.all(a)}function fNe(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 hNe(e,t,r,i,n){let{fetch:a,parse:o}=n,s;if(t.uri&&!t.hasOwnProperty("bufferView")){let l=aB(t.uri,i);s=await(await a(l)).arrayBuffer(),t.bufferView={data:s}}if(Number.isFinite(t.bufferView)){let l=_Z(e.json,e.buffers,t.bufferView);s=ad(l.buffer,l.byteOffset,l.byteLength)}Ln(s,"glTF image has no data");let u=await o(s,[rg,Ed],{mimeType:t.mimeType,basis:i.basis||{format:ag()}},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 lc={name:"glTF",id:"gltf",module:"gltf",version:DQ,extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:dNe,options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0},log:console},deprecatedOptions:{fetchImages:"gltf.loadImages",createImages:"gltf.loadImages",decompress:"gltf.decompressMeshes",postProcess:"gltf.postProcess",gltf:{decompress:"gltf.decompressMeshes",postProcess:"removed in v4"}}};async function dNe(e,t={},r){t=ae(ae({},lc.options),t),t.gltf=ae(ae({},lc.options.gltf),t.gltf);let{byteOffset:i=0}=t;return await jZ({},e,i,t,r)}var pNe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},mNe={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},ls={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},gNe={magFilter:ls.TEXTURE_MAG_FILTER,minFilter:ls.TEXTURE_MIN_FILTER,wrapS:ls.TEXTURE_WRAP_S,wrapT:ls.TEXTURE_WRAP_T},vNe={[ls.TEXTURE_MAG_FILTER]:ls.LINEAR,[ls.TEXTURE_MIN_FILTER]:ls.NEAREST_MIPMAP_LINEAR,[ls.TEXTURE_WRAP_S]:ls.REPEAT,[ls.TEXTURE_WRAP_T]:ls.REPEAT};function yNe(){return{id:"default-sampler",parameters:vNe}}function bNe(e){return mNe[e]}function _Ne(e){return pNe[e]}var LZ=class{constructor(){this.baseUri="";this.buffers=[];this.images=[]}postProcess(t,r={}){let{json:i,buffers:n=[],images:a=[]}=t,{baseUri:o=""}=t;return Ln(i),this.baseUri=o,this.buffers=n,this.images=a,this.jsonUnprocessed=i,this.json=this._resolveTree(t.json,r),this.json}_resolveTree(t,r={}){let i=ae({},t);return this.json=i,t.bufferViews&&(i.bufferViews=t.bufferViews.map((n,a)=>this._resolveBufferView(n,a))),t.images&&(i.images=t.images.map((n,a)=>this._resolveImage(n,a))),t.samplers&&(i.samplers=t.samplers.map((n,a)=>this._resolveSampler(n,a))),t.textures&&(i.textures=t.textures.map((n,a)=>this._resolveTexture(n,a))),t.accessors&&(i.accessors=t.accessors.map((n,a)=>this._resolveAccessor(n,a))),t.materials&&(i.materials=t.materials.map((n,a)=>this._resolveMaterial(n,a))),t.meshes&&(i.meshes=t.meshes.map((n,a)=>this._resolveMesh(n,a))),t.nodes&&(i.nodes=t.nodes.map((n,a)=>this._resolveNode(n,a)),i.nodes=i.nodes.map((n,a)=>this._resolveNodeChildren(n))),t.skins&&(i.skins=t.skins.map((n,a)=>this._resolveSkin(n,a))),t.scenes&&(i.scenes=t.scenes.map((n,a)=>this._resolveScene(n,a))),typeof this.json.scene=="number"&&i.scenes&&(i.scene=i.scenes[this.json.scene]),i}getScene(t){return this._get(this.json.scenes,t)}getNode(t){return this._get(this.json.nodes,t)}getSkin(t){return this._get(this.json.skins,t)}getMesh(t){return this._get(this.json.meshes,t)}getMaterial(t){return this._get(this.json.materials,t)}getAccessor(t){return this._get(this.json.accessors,t)}getCamera(t){return this._get(this.json.cameras,t)}getTexture(t){return this._get(this.json.textures,t)}getSampler(t){return this._get(this.json.samplers,t)}getImage(t){return this._get(this.json.images,t)}getBufferView(t){return this._get(this.json.bufferViews,t)}getBuffer(t){return this._get(this.json.buffers,t)}_get(t,r){if(typeof r=="object")return r;let i=t&&t[r];return i||console.warn(`glTF file error: Could not find ${t}[${r}]`),i}_resolveScene(t,r){return Je(ae({},t),{id:t.id||`scene-${r}`,nodes:(t.nodes||[]).map(i=>this.getNode(i))})}_resolveNode(t,r){let i=Je(ae({},t),{id:(t==null?void 0:t.id)||`node-${r}`});return t.mesh!==void 0&&(i.mesh=this.getMesh(t.mesh)),t.camera!==void 0&&(i.camera=this.getCamera(t.camera)),t.skin!==void 0&&(i.skin=this.getSkin(t.skin)),t.meshes!==void 0&&t.meshes.length&&(i.mesh=t.meshes.reduce((n,a)=>{let o=this.getMesh(a);return n.id=o.id,n.primitives=n.primitives.concat(o.primitives),n},{primitives:[]})),i}_resolveNodeChildren(t){return t.children&&(t.children=t.children.map(r=>this.getNode(r))),t}_resolveSkin(t,r){let i=typeof t.inverseBindMatrices=="number"?this.getAccessor(t.inverseBindMatrices):void 0;return Je(ae({},t),{id:t.id||`skin-${r}`,inverseBindMatrices:i})}_resolveMesh(t,r){let i=Je(ae({},t),{id:t.id||`mesh-${r}`,primitives:[]});return t.primitives&&(i.primitives=t.primitives.map(n=>{let a=Je(ae({},n),{attributes:{},indices:void 0,material:void 0}),o=n.attributes;for(let s in o)a.attributes[s]=this.getAccessor(o[s]);return n.indices!==void 0&&(a.indices=this.getAccessor(n.indices)),n.material!==void 0&&(a.material=this.getMaterial(n.material)),a})),i}_resolveMaterial(t,r){let i=Je(ae({},t),{id:t.id||`material-${r}`});if(i.normalTexture&&(i.normalTexture=ae({},i.normalTexture),i.normalTexture.texture=this.getTexture(i.normalTexture.index)),i.occlusionTexture&&(i.occlusionTexture=ae({},i.occlusionTexture),i.occlusionTexture.texture=this.getTexture(i.occlusionTexture.index)),i.emissiveTexture&&(i.emissiveTexture=ae({},i.emissiveTexture),i.emissiveTexture.texture=this.getTexture(i.emissiveTexture.index)),i.emissiveFactor||(i.emissiveFactor=i.emissiveTexture?[1,1,1]:[0,0,0]),i.pbrMetallicRoughness){i.pbrMetallicRoughness=ae({},i.pbrMetallicRoughness);let n=i.pbrMetallicRoughness;n.baseColorTexture&&(n.baseColorTexture=ae({},n.baseColorTexture),n.baseColorTexture.texture=this.getTexture(n.baseColorTexture.index)),n.metallicRoughnessTexture&&(n.metallicRoughnessTexture=ae({},n.metallicRoughnessTexture),n.metallicRoughnessTexture.texture=this.getTexture(n.metallicRoughnessTexture.index))}return i}_resolveAccessor(t,r){let i=bNe(t.componentType),n=_Ne(t.type),a=i*n,o=Je(ae({},t),{id:t.id||`accessor-${r}`,bytesPerComponent:i,components:n,bytesPerElement:a,value:void 0,bufferView:void 0,sparse:void 0});if(t.bufferView!==void 0&&(o.bufferView=this.getBufferView(t.bufferView)),o.bufferView){let s=o.bufferView.buffer,{ArrayType:u,byteLength:l}=ug(o,o.bufferView),c=(o.bufferView.byteOffset||0)+(o.byteOffset||0)+s.byteOffset,f=s.arrayBuffer.slice(c,c+l);o.bufferView.byteStride&&(f=this._getValueFromInterleavedBuffer(s,c,o.bufferView.byteStride,o.bytesPerElement,o.count)),o.value=new u(f)}return o}_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 Je(ae({},t),{id:t.id||`texture-${r}`,sampler:typeof t.sampler=="number"?this.getSampler(t.sampler):yNe(),source:typeof t.source=="number"?this.getImage(t.source):void 0})}_resolveSampler(t,r){let i=Je(ae({id:t.id||`sampler-${r}`},t),{parameters:{}});for(let n in i){let a=this._enumSamplerParameter(n);a!==void 0&&(i.parameters[a]=i[n])}return i}_enumSamplerParameter(t){return gNe[t]}_resolveImage(t,r){let i=Je(ae({},t),{id:t.id||`image-${r}`,image:null,bufferView:t.bufferView!==void 0?this.getBufferView(t.bufferView):void 0}),n=this.images[r];return n&&(i.image=n),i}_resolveBufferView(t,r){let i=t.buffer,n=this.buffers[i].arrayBuffer,a=this.buffers[i].byteOffset||0;return t.byteOffset&&(a+=t.byteOffset),Je(ae({id:`bufferView-${r}`},t),{buffer:this.buffers[i],data:new Uint8Array(n,a,t.byteLength)})}_resolveCamera(t,r){let i=Je(ae({},t),{id:t.id||`camera-${r}`});return i.perspective,i.orthographic,i}};function Jy(e,t){return new LZ().postProcess(e,t)}var vS={URI:0,EMBEDDED:1};function yS(e,t,r,i){e.rotateYtoZ=!0;let n=(e.byteOffset||0)+(e.byteLength||0)-r;if(n===0)throw new Error("glTF byte length must be greater than 0.");return e.gltfUpAxis=(i==null?void 0:i["3d-tiles"])&&i["3d-tiles"].assetGltfUpAxis?i["3d-tiles"].assetGltfUpAxis:"Y",e.gltfArrayBuffer=ad(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||0)+(e.byteLength||0)}async function bS(e,t,r,i){let n=(r==null?void 0:r["3d-tiles"])||{};if(xNe(e,t,r),n.loadGLTF){if(!i)return;let{parse:a,fetch:o}=i;if(e.gltfUrl){let s=await o(e.gltfUrl,r);e.gltfArrayBuffer=await s.arrayBuffer(),e.gltfByteOffset=0}if(e.gltfArrayBuffer){let s=await a(e.gltfArrayBuffer,lc,r,i);e.gltf=Jy(s),e.gpuMemoryUsageInBytes=Ky(e.gltf),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength}}}function xNe(e,t,r){switch(t){case vS.URI:if(e.gltfArrayBuffer){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 vS.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}async function NZ(e,t,r,i,n){var o;r=wNe(e,t,r,i,n),await bS(e,vS.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 wNe(e,t,r,i,n){r=Ff(e,t,r),r=Zm(e,t,r),r=eg(e,t,r,i),r=yS(e,t,r,i);let a=new Df(e.featureTableJson,e.featureTableBinary);return e.rtcCenter=a.getGlobalProperty("RTC_CENTER",Zt.FLOAT,3),r}var Co=Fe(dr()),qZ=Fe(Ra());async function UZ(e,t,r,i,n){return r=ENe(e,t,r,i,n),await bS(e,e.gltfFormat||0,i,n),r}function ENe(e,t,r,i,n){var l;if(r=Ff(e,t,r),e.version!==1)throw new Error(`Instanced 3D Model version ${e.version} is not supported`);r=Zm(e,t,r);let a=new DataView(t);if(e.gltfFormat=a.getUint32(r,!0),r+=4,r=eg(e,t,r,i),r=yS(e,t,r,i),!((l=e==null?void 0:e.header)==null?void 0:l.featureTableJsonByteLength)||e.header.featureTableJsonByteLength===0)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");let o=new Df(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",Zt.FLOAT,3);let u=new Jm(e.batchTableJson,e.batchTableBinary,s);return SNe(e,o,u,s),r}function SNe(e,t,r,i){let n=new Array(i),a=new Co.Vector3,o=new Co.Vector3,s=new Co.Vector3,u=new Co.Vector3,l=new Co.Matrix3,c=new Co.Quaternion,f=new Co.Vector3,h={},d=new Co.Matrix4,p=[],y=[],g=[],b=[];for(let E=0;E<i;E++){let T;if(t.hasProperty("POSITION"))T=t.getProperty("POSITION",Zt.FLOAT,3,E,a);else if(t.hasProperty("POSITION_QUANTIZED")){T=t.getProperty("POSITION_QUANTIZED",Zt.UNSIGNED_SHORT,3,E,a);let V=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Zt.FLOAT,3);if(!V)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let N=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Zt.FLOAT,3);if(!N)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let z=65535;for(let j=0;j<3;j++)T[j]=T[j]/z*N[j]+V[j]}if(!T)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");a.copy(T),h.translation=a,e.normalUp=t.getProperty("NORMAL_UP",Zt.FLOAT,3,E,p),e.normalRight=t.getProperty("NORMAL_RIGHT",Zt.FLOAT,3,E,y);let k=!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",Zt.UNSIGNED_SHORT,2,E,p),e.octNormalRight=t.getProperty("NORMAL_RIGHT_OCT32P",Zt.UNSIGNED_SHORT,2,E,y),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?(qZ.Ellipsoid.WGS84.eastNorthUpToFixedFrame(a,d),d.getRotationMatrix3(l)):l.identity()}k&&(u.copy(o).cross(s).normalize(),l.setColumn(0,o),l.setColumn(1,s),l.setColumn(2,u)),c.fromMatrix3(l),h.rotation=c,f.set(1,1,1);let R=t.getProperty("SCALE",Zt.FLOAT,1,E,g);Number.isFinite(R)&&f.multiplyByScalar(R);let D=t.getProperty("SCALE_NON_UNIFORM",Zt.FLOAT,3,E,p);D&&f.scale(D),h.scale=f;let C=t.getProperty("BATCH_ID",Zt.UNSIGNED_SHORT,1,E,b);C===void 0&&(C=E);let L=new Co.Matrix4().fromQuaternion(h.rotation);d.identity(),d.translate(h.translation),d.multiplyRight(L),d.scale(h.scale);let B=d.clone();n[E]={modelMatrix:B,batchId:C}}e.instances=n}async function GZ(e,t,r,i,n,a){r=Ff(e,t,r);let o=new DataView(t);for(e.tilesLength=o.getUint32(r,!0),r+=4,e.tiles=[];e.tiles.length<e.tilesLength&&(e.byteLength||0)-r>12;){let s={};e.tiles.push(s),r=await a(t,r,i,n,s)}return r}async function zZ(e,t,r,i){var n;if(e.rotateYtoZ=!0,e.gltfUpAxis=(r==null?void 0:r["3d-tiles"])&&r["3d-tiles"].assetGltfUpAxis?r["3d-tiles"].assetGltfUpAxis:"Y",(n=r==null?void 0:r["3d-tiles"])==null?void 0:n.loadGLTF){if(!i)return;let{parse:a}=i,o=await a(t,lc,r,i);e.gltf=Jy(o),e.gpuMemoryUsageInBytes=Ky(e.gltf)}else e.gltfArrayBuffer=t}async function bB(e,t=0,r,i,n={}){switch(n.byteOffset=t,n.type=fQ(e,t),n.type){case xd.COMPOSITE:return await GZ(n,e,t,r,i,bB);case xd.BATCHED_3D_MODEL:return await NZ(n,e,t,r,i);case xd.GLTF:return await zZ(n,e,r,i);case xd.INSTANCED_3D_MODEL:return await UZ(n,e,t,r,i);case xd.POINT_CLOUD:return await BQ(n,e,t,r,i);default:throw new Error(`3DTileLoader: unknown type ${n.type}`)}}var ANe=1952609651,TNe=1;async function _B(e,t,r){if(new Uint32Array(e.slice(0,4))[0]!==ANe)throw new Error("Wrong subtree file magic number");if(new Uint32Array(e.slice(4,8))[0]!==TNe)throw new Error("Wrong subtree file verson, must be 1");let a=HZ(e.slice(8,16)),o=new Uint8Array(e,24,a),u=new TextDecoder("utf8").decode(o),l=JSON.parse(u),c=HZ(e.slice(16,24)),f=new ArrayBuffer(0);return c&&(f=e.slice(24+a)),"bufferView"in l.tileAvailability&&(l.tileAvailability.explicitBitstream=await xB(l,"tileAvailability",f,r)),"bufferView"in l.contentAvailability&&(l.contentAvailability.explicitBitstream=await xB(l,"contentAvailability",f,r)),"bufferView"in l.childSubtreeAvailability&&(l.childSubtreeAvailability.explicitBitstream=await xB(l,"childSubtreeAvailability",f,r)),l}function kNe(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 xB(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=kNe(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 HZ(e){let t=new DataView(e),r=t.getUint32(0,!0),i=t.getUint32(4,!0);return r+2**32*i}var _S={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:JE,extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:_B,options:{}};var cs=null;try{cs=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 _i(e,t,r){this.low=e|0,this.high=t|0,this.unsigned=!!r}_i.prototype.__isLong__;Object.defineProperty(_i.prototype,"__isLong__",{value:!0});function Ia(e){return(e&&e.__isLong__)===!0}function WZ(e){var t=Math.clz32(e&-e);return e?31-t:t}_i.isLong=Ia;var VZ={},KZ={};function Ad(e,t){var r,i,n;return t?(e>>>=0,(n=0<=e&&e<256)&&(i=KZ[e],i)?i:(r=Vr(e,0,!0),n&&(KZ[e]=r),r)):(e|=0,(n=-128<=e&&e<128)&&(i=VZ[e],i)?i:(r=Vr(e,e<0?-1:0,!1),n&&(VZ[e]=r),r))}_i.fromInt=Ad;function fs(e,t){if(isNaN(e))return t?cc:au;if(t){if(e<0)return cc;if(e>=$Z)return eee}else{if(e<=-XZ)return lo;if(e+1>=XZ)return ZZ}return e<0?fs(-e,t).neg():Vr(e%fg|0,e/fg|0,t)}_i.fromNumber=fs;function Vr(e,t,r){return new _i(e,t,r)}_i.fromBits=Vr;var xS=Math.pow;function wB(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?cc:au;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 wB(e.substring(1),t,r).neg();for(var n=fs(xS(r,8)),a=au,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=fs(xS(r,s));a=a.mul(l).add(fs(u))}else a=a.mul(n),a=a.add(fs(u))}return a.unsigned=t,a}_i.fromString=wB;function nu(e,t){return typeof e=="number"?fs(e,t):typeof e=="string"?wB(e,t):Vr(e.low,e.high,typeof t=="boolean"?t:e.unsigned)}_i.fromValue=nu;var YZ=1<<16,RNe=1<<24,fg=YZ*YZ,$Z=fg*fg,XZ=$Z/2,JZ=Ad(RNe),au=Ad(0);_i.ZERO=au;var cc=Ad(0,!0);_i.UZERO=cc;var hg=Ad(1);_i.ONE=hg;var QZ=Ad(1,!0);_i.UONE=QZ;var EB=Ad(-1);_i.NEG_ONE=EB;var ZZ=Vr(4294967295|0,2147483647|0,!1);_i.MAX_VALUE=ZZ;var eee=Vr(4294967295|0,4294967295|0,!0);_i.MAX_UNSIGNED_VALUE=eee;var lo=Vr(0,2147483648|0,!1);_i.MIN_VALUE=lo;var ze=_i.prototype;ze.toInt=function(){return this.unsigned?this.low>>>0:this.low};ze.toNumber=function(){return this.unsigned?(this.high>>>0)*fg+(this.low>>>0):this.high*fg+(this.low>>>0)};ze.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(lo)){var r=fs(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=fs(xS(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}};ze.getHighBits=function(){return this.high};ze.getHighBitsUnsigned=function(){return this.high>>>0};ze.getLowBits=function(){return this.low};ze.getLowBitsUnsigned=function(){return this.low>>>0};ze.getNumBitsAbs=function(){if(this.isNegative())return this.eq(lo)?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};ze.isZero=function(){return this.high===0&&this.low===0};ze.eqz=ze.isZero;ze.isNegative=function(){return!this.unsigned&&this.high<0};ze.isPositive=function(){return this.unsigned||this.high>=0};ze.isOdd=function(){return(this.low&1)==1};ze.isEven=function(){return(this.low&1)==0};ze.equals=function(t){return Ia(t)||(t=nu(t)),this.unsigned!==t.unsigned&&this.high>>>31==1&&t.high>>>31==1?!1:this.high===t.high&&this.low===t.low};ze.eq=ze.equals;ze.notEquals=function(t){return!this.eq(t)};ze.neq=ze.notEquals;ze.ne=ze.notEquals;ze.lessThan=function(t){return this.comp(t)<0};ze.lt=ze.lessThan;ze.lessThanOrEqual=function(t){return this.comp(t)<=0};ze.lte=ze.lessThanOrEqual;ze.le=ze.lessThanOrEqual;ze.greaterThan=function(t){return this.comp(t)>0};ze.gt=ze.greaterThan;ze.greaterThanOrEqual=function(t){return this.comp(t)>=0};ze.gte=ze.greaterThanOrEqual;ze.ge=ze.greaterThanOrEqual;ze.compare=function(t){if(Ia(t)||(t=nu(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};ze.comp=ze.compare;ze.negate=function(){return!this.unsigned&&this.eq(lo)?lo:this.not().add(hg)};ze.neg=ze.negate;ze.add=function(t){Ia(t)||(t=nu(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,Vr(h<<16|d,c<<16|f,this.unsigned)};ze.subtract=function(t){return Ia(t)||(t=nu(t)),this.add(t.neg())};ze.sub=ze.subtract;ze.multiply=function(t){if(this.isZero())return this;if(Ia(t)||(t=nu(t)),cs){var r=cs.mul(this.low,this.high,t.low,t.high);return Vr(r,cs.get_high(),this.unsigned)}if(t.isZero())return this.unsigned?cc:au;if(this.eq(lo))return t.isOdd()?lo:au;if(t.eq(lo))return this.isOdd()?lo:au;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(JZ)&&t.lt(JZ))return fs(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,Vr(d<<16|p,f<<16|h,this.unsigned)};ze.mul=ze.multiply;ze.divide=function(t){if(Ia(t)||(t=nu(t)),t.isZero())throw Error("division by zero");if(cs){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var r=(this.unsigned?cs.div_u:cs.div_s)(this.low,this.high,t.low,t.high);return Vr(r,cs.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?cc:au;var i,n,a;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return cc;if(t.gt(this.shru(1)))return QZ;a=cc}else{if(this.eq(lo)){if(t.eq(hg)||t.eq(EB))return lo;if(t.eq(lo))return hg;var o=this.shr(1);return i=o.div(t).shl(1),i.eq(au)?t.isNegative()?hg:EB:(n=this.sub(t.mul(i)),a=i.add(n.div(t)),a)}else if(t.eq(lo))return this.unsigned?cc:au;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=au}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:xS(2,s-48),l=fs(i),c=l.mul(t);c.isNegative()||c.gt(n);)i-=u,l=fs(i,this.unsigned),c=l.mul(t);l.isZero()&&(l=hg),a=a.add(l),n=n.sub(c)}return a};ze.div=ze.divide;ze.modulo=function(t){if(Ia(t)||(t=nu(t)),cs){var r=(this.unsigned?cs.rem_u:cs.rem_s)(this.low,this.high,t.low,t.high);return Vr(r,cs.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))};ze.mod=ze.modulo;ze.rem=ze.modulo;ze.not=function(){return Vr(~this.low,~this.high,this.unsigned)};ze.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};ze.clz=ze.countLeadingZeros;ze.countTrailingZeros=function(){return this.low?WZ(this.low):WZ(this.high)+32};ze.ctz=ze.countTrailingZeros;ze.and=function(t){return Ia(t)||(t=nu(t)),Vr(this.low&t.low,this.high&t.high,this.unsigned)};ze.or=function(t){return Ia(t)||(t=nu(t)),Vr(this.low|t.low,this.high|t.high,this.unsigned)};ze.xor=function(t){return Ia(t)||(t=nu(t)),Vr(this.low^t.low,this.high^t.high,this.unsigned)};ze.shiftLeft=function(t){return Ia(t)&&(t=t.toInt()),(t&=63)==0?this:t<32?Vr(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):Vr(0,this.low<<t-32,this.unsigned)};ze.shl=ze.shiftLeft;ze.shiftRight=function(t){return Ia(t)&&(t=t.toInt()),(t&=63)==0?this:t<32?Vr(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):Vr(this.high>>t-32,this.high>=0?0:-1,this.unsigned)};ze.shr=ze.shiftRight;ze.shiftRightUnsigned=function(t){return Ia(t)&&(t=t.toInt()),(t&=63)==0?this:t<32?Vr(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):t===32?Vr(this.high,0,this.unsigned):Vr(this.high>>>t-32,0,this.unsigned)};ze.shru=ze.shiftRightUnsigned;ze.shr_u=ze.shiftRightUnsigned;ze.rotateLeft=function(t){var r;return Ia(t)&&(t=t.toInt()),(t&=63)==0?this:t===32?Vr(this.high,this.low,this.unsigned):t<32?(r=32-t,Vr(this.low<<t|this.high>>>r,this.high<<t|this.low>>>r,this.unsigned)):(t-=32,r=32-t,Vr(this.high<<t|this.low>>>r,this.low<<t|this.high>>>r,this.unsigned))};ze.rotl=ze.rotateLeft;ze.rotateRight=function(t){var r;return Ia(t)&&(t=t.toInt()),(t&=63)==0?this:t===32?Vr(this.high,this.low,this.unsigned):t<32?(r=32-t,Vr(this.high<<r|this.low>>>t,this.low<<r|this.high>>>t,this.unsigned)):(t-=32,r=32-t,Vr(this.low<<r|this.high>>>t,this.high<<r|this.low>>>t,this.unsigned))};ze.rotr=ze.rotateRight;ze.toSigned=function(){return this.unsigned?Vr(this.low,this.high,!1):this};ze.toUnsigned=function(){return this.unsigned?this:Vr(this.low,this.high,!0)};ze.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()};ze.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]};ze.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]};_i.fromBytes=function(t,r,i){return i?_i.fromBytesLE(t,r):_i.fromBytesBE(t,r)};_i.fromBytesLE=function(t,r){return new _i(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,r)};_i.fromBytesBE=function(t,r){return new _i(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],r)};var dg=_i;var CNe=16;function Qy(e){e==="X"&&(e="");let t=e.padEnd(CNe,"0");return dg.fromString(t,!0,16)}function SB(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 AB(e,t){let r=INe(e).shiftRightUnsigned(2);return e.add(dg.fromNumber(2*t+1-4).multiply(r))}function INe(e){return e.and(e.not().add(1))}var PNe=3,ONe=30,BNe=2*ONe+1,tee=180/Math.PI;function ree(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);DNe(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 iee(e){if(e.isZero())return"";let t=e.toString(2);for(;t.length<PNe+BNe;)t="0"+t;let r=t.lastIndexOf("1"),i=t.substring(0,3),n=t.substring(3,r),a=n.length/2,o=dg.fromString(i,!0,2).toString(10),s="";if(a!==0)for(s=dg.fromString(n,!0,2).toString(4);s.length<a;)s="0"+s;return`${o}/${s}`}function TB(e,t,r){let i=1<<t;return[(e[0]+r[0])/i,(e[1]+r[1])/i]}function nee(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function kB(e){return[nee(e[0]),nee(e[1])]}function RB(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 CB([e,t,r]){let i=Math.atan2(r,Math.sqrt(e*e+t*t));return[Math.atan2(t,e)*tee,i*tee]}function DNe(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 aee(e){let t=TB(e.ij,e.level,[.5,.5]),r=kB(t),i=RB(e.face,r);return CB(i)}var FNe=100;function IB(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(FNe*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=TB(r,i,c),g=kB(y),b=RB(t,g),E=CB(b);Math.abs(E[1])>89.999&&(E[0]=u);let T=E[0]-u;E[0]+=T>180?-360:T<-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 pg(e){let t=MNe(e);return ree(t)}function MNe(e){if(e.indexOf("/")>0)return e;let t=Qy(e);return iee(t)}function PB(e){let t=pg(e);return aee(t)}function oee(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=pg(a),s=IB(o);(typeof r=="undefined"||r===null)&&(r=new Float64Array(4*s.length)),r.set(s,i),i+=s.length}t=see(r)}else{let r=IB(e);t=see(r)}return t}function see(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 fc=Fe(dr());function OB(e,t){let r=(t==null?void 0:t.minimumHeight)||0,i=(t==null?void 0:t.maximumHeight)||0,n=pg(e),a=oee(n),o=a.west,s=a.south,u=a.east,l=a.north,c=[];return c.push(new fc.Vector3(o,l,r)),c.push(new fc.Vector3(u,l,r)),c.push(new fc.Vector3(u,s,r)),c.push(new fc.Vector3(o,s,r)),c.push(new fc.Vector3(o,l,i)),c.push(new fc.Vector3(u,l,i)),c.push(new fc.Vector3(u,s,i)),c.push(new fc.Vector3(o,s,i)),c}var uee=Fe(dr()),lee=Fe(Zu());var cee=Fe(Ra());function wS(e){let t=e.token,r={minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight},i=OB(t,r),n=PB(t),a=n[0],o=n[1],s=cee.Ellipsoid.WGS84.cartographicToCartesian([a,o,r.maximumHeight]),u=new uee.Vector3(s[0],s[1],s[2]);i.push(u);let l=(0,lee.makeOrientedBoundingBoxFromPoints)(i);return[...l.center,...l.halfAxes]}var jNe=4,LNe=8,NNe={QUADTREE:jNe,OCTREE:LNe};function qNe(e,t,r){if(e==null?void 0:e.box){let i=Qy(e.s2VolumeInfo.token),n=AB(i,t),a=SB(n),o=ae({},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:wS(o),s2VolumeInfo:o}}}async function BB(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=NNe[u],g=i&1,b=i>>1&1,E=i>>2&1,T=(y**s-1)/(y-1),k=Td(r.mortonIndex,i),R=T+k,D=Td(r.x,g),C=Td(r.y,b),L=Td(r.z,E),B=!1;s+1>l&&(B=DB(o.childSubtreeAvailability,k));let V=Td(n.x,D),N=Td(n.y,C),z=Td(n.z,L),j=s+n.level;if(B){let ne=`${d}/${h}`,ue=ES(ne,j,V,N,z);o=await Wr(ue,_S),n.mortonIndex=k,n.x=D,n.y=C,n.z=L,n.level=s,k=0,R=0,D=0,C=0,L=0,s=0}if(!DB(o.tileAvailability,R)||s>c)return p;DB(o.contentAvailability,R)&&(p.contentUrl=ES(f,j,V,N,z));let te=s+1,re={mortonIndex:k,x:D,y:C,z:L};for(let ne=0;ne<y;ne++){let ue=qNe(a,ne,u),pe=await BB({subtree:o,options:t,parentData:re,childIndex:ne,level:te,globalData:n,s2VolumeBox:ue});if(pe.contentUrl||pe.children.length){let Le=j+1,qe=UNe(pe,Le,{childTileX:D,childTileY:C,childTileZ:L},t,a);p.children.push(qe)}}return p}function DB(e,t){return"constant"in e?Boolean(e.constant):e.explicitBitstream?HNe(t,e.explicitBitstream):!1}function UNe(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=GNe(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 GNe(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,T]=[s+p*n,s+p*(n+1)],[k,R]=[c+y*a,c+y*(a+1)];return{region:[g,E,b,T,k,R]}}if(t.box)return t;throw new Error(`Unsupported bounding volume type ${t}`)}function Td(e,t){return parseInt(e.toString(2)+t.toString(2),2)}function ES(e,t,r,i,n){let a=zNe({level:t,x:r,y:i,z:n});return e.replace(/{level}|{x}|{y}|{z}/gi,o=>a[o])}function zNe(e){let t={};for(let r in e)t[`{${r}}`]=e[r];return t}function HNe(e,t){let r=Math.floor(e/8),i=e%8;return(t[r]>>i&1)===1}function FB(e,t=""){if(!t)return tl.EMPTY;let i=t.split("?")[0].split(".").pop();switch(i){case"pnts":return tl.POINTCLOUD;case"i3dm":case"b3dm":case"glb":case"gltf":return tl.SCENEGRAPH;default:return i||tl.EMPTY}}function MB(e){switch(e){case"REPLACE":case"replace":return ta.REPLACE;case"ADD":case"add":return ta.ADD;default:return e}}function jB(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 fee(e,t){var n;if(!e)return null;let r;if(e.content){let a=e.content.uri||((n=e.content)==null?void 0:n.url);r=jB(a,t)}return Je(ae({},e),{id:r,contentUrl:r,lodMetricType:ic.GEOMETRIC_ERROR,lodMetricValue:e.geometricError,transformMatrix:e.transform,type:FB(e,r),refine:MB(e.refine)})}async function hee(e,t,r){let i=null,n=pee(e.root);n&&e.root?i=await dee(e.root,e,t,n,r):i=fee(e.root,t);let a=[];for(a.push(i);a.length>0;){let o=a.pop()||{},s=o.children||[],u=[];for(let l of s){let c=pee(l),f;c?f=await dee(l,e,t,c,r):f=fee(l,t),f&&(u.push(f),a.push(f))}o.children=u}return i}async function dee(e,t,r,i,n){var E,T,k;let{subdivisionScheme:a,maximumLevel:o,subtreeLevels:s,subtrees:{uri:u}}=i,l=ES(u,0,0,0,0),c=jB(l,r),f=await Wr(c,_S,n),h=jB((E=e.content)==null?void 0:E.uri,r),d=(T=t==null?void 0:t.root)==null?void 0:T.refine,p=e.geometricError,y=(k=e.boundingVolume.extensions)==null?void 0:k["3DTILES_bounding_volume_S2"];if(y){let D={box:wS(y),s2VolumeInfo:y};e.boundingVolume=D}let g=e.boundingVolume,b={contentUrlTemplate:h,subtreesUriTemplate:u,subdivisionScheme:a,subtreeLevels:s,maximumLevel:o,refine:d,basePath:r,lodMetricType:ic.GEOMETRIC_ERROR,rootLodMetricValue:p,rootBoundingVolume:g,getTileType:FB,getRefine:MB};return await WNe(e,r,f,b)}async function WNe(e,t,r,i){if(!e)return null;let{children:n,contentUrl:a}=await BB({subtree:r,options:i}),o,s=null;return a&&(o=a,s={uri:a.replace(`${t}/`,"")}),Je(ae({},e),{id:o,contentUrl:o,lodMetricType:ic.GEOMETRIC_ERROR,lodMetricValue:e.geometricError,transformMatrix:e.transform,type:FB(e,o),refine:MB(e.refine),content:s||e.content,children:n})}function pee(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 hc={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:JE,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:VNe,options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};async function VNe(e,t={},r){let i=t["3d-tiles"]||{},n;return i.isTileset==="auto"?n=(r==null?void 0:r.url)&&r.url.indexOf(".json")!==-1:n=i.isTileset,n?KNe(e,t,r):YNe(e,t,r)}async function KNe(e,t,r){var u;let i=JSON.parse(new TextDecoder().decode(e)),n=(r==null?void 0:r.url)||"",a=$Ne(n),o=await hee(i,a,t||{});return Je(ae({},i),{loader:hc,url:n,queryString:(r==null?void 0:r.queryString)||"",basePath:a,root:o||i.root,type:En.TILES3D,lodMetricType:ic.GEOMETRIC_ERROR,lodMetricValue:((u=i.root)==null?void 0:u.geometricError)||0})}async function YNe(e,t,r){let i={content:{featureIds:null}};return await bB(e,0,t,r,i.content),i.content}function $Ne(e){return $s.dirname(e)}var mee="https://api.cesium.com/v1/assets";async function gee(e,t){if(!t){let a=await XNe(e);for(let o of a.items)o.type==="3DTILES"&&(t=o.id)}let r=await JNe(e,t),{type:i,url:n}=r;return Ut(i==="3DTILES"&&n),r.headers={Authorization:`Bearer ${r.accessToken}`},r}async function XNe(e){Ut(e);let t=mee,r={Authorization:`Bearer ${e}`},i=await ea(t,{fetch:{headers:r}});if(!i.ok)throw new Error(i.statusText);return await i.json()}async function JNe(e,t){Ut(e,t);let r={Authorization:`Bearer ${e}`},i=`${mee}/${t}`,n=await ea(`${i}`,{fetch:{headers:r}});if(!n.ok)throw new Error(n.statusText);let a=await n.json();if(n=await ea(`${i}/endpoint`,{fetch:{headers:r}}),!n.ok)throw new Error(n.statusText);let o=await n.json();return a=ae(ae({},a),o),a}async function QNe(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 gee(r,i)}var SS=Je(ae({},hc),{id:"cesium-ion",name:"Cesium Ion",preload:QNe,parse:async(e,t,r)=>(t=ae({},t),t["3d-tiles"]=t["cesium-ion"],t.loader=SS,hc.parse(e,t,r)),options:{"cesium-ion":Je(ae({},hc.options["3d-tiles"]),{accessToken:null})}});var Da=Fe(require("path"));var nl=Fe(Dee()),q2t=nl.default.v1,U2t=nl.default.v3,pc=nl.default.v4,G2t=nl.default.v5,z2t=nl.default.NIL,H2t=nl.default.version,W2t=nl.default.validate,V2t=nl.default.stringify,K2t=nl.default.parse;var bp=Fe(require("process")),L2=Fe(su()),eL=Fe(YB());var E0=Fe(require("path")),Yde=Fe(su());var Wee=()=>({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 x0=Fe(require("fs")),w0=Fe(require("path"));var Hde=Fe(require("zlib")),Wde=Fe(require("path")),V1=Fe(require("fs")),tot=Fe(wce());var rot=Fe(Oj());var iot=Fe(WB());function T2(e){let t=`${e}.gz`,r=(0,Hde.createGzip)(),i=(0,V1.createReadStream)(e),n=(0,V1.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 Vde(e,t,r,i,n){process.platform==="win32"?await aot(e,t,r,i,n):await not(e,t,r,i)}async function not(e,t,r=0,i="."){let n=K1(t),a=[`-${r}`,"-r",n,i];await new bf().start({command:"zip",arguments:a,spawn:{cwd:e},wait:0})}async function aot(e,t,r=0,i=(0,Wde.join)(".","*"),n){i[0]==="@"&&(i=`*${i.substr(1)}`);let a=K1(t),o=["a","-tzip",`-mx=${r}`,a,i];await new bf().start({command:n,arguments:o,spawn:{cwd:`${e}`},wait:0})}async function Un(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 x0.promises.mkdir(e,{recursive:!0});let n=(0,w0.join)(e,r);try{await x0.promises.writeFile(n,i)}catch(a){throw a}return console.log(`${n} saved.`),n}async function bl(e,t,r="index.json",i=!0,n){let a=await Un(e,t,r);if(i){if(n)return n.includes(a)?null:(n.push(a),`${a}.gz`);{let o=await T2(a);return await Bj(a),o}}return a}async function k2(e,t){return new Promise((r,i)=>{let n=0;console.log(`load ${e}/${t}.`);let a=setInterval(()=>{let o=(0,w0.join)(e,t);Wr(o,LI).then(s=>{clearInterval(a),r(s)}).catch(()=>{n++,n>100&&(clearInterval(a),i(new Error(`Cannon load ${e}/${t}.`)))})},200)})}async function Kde(e){try{return await x0.promises.stat(e),!0}catch{return!1}}function Y1(e){return x0.promises.rm(e,{recursive:!0})}function Bj(e){return x0.promises.unlink(e)}function K1(e){return(0,w0.isAbsolute)(e)?e:(0,w0.join)(process.cwd(),e)}var fo=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,E0.join)(this.converter.layers0Path,"nodepages"),i=`${t.toString()}.json`):(r=(0,E0.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,E0.join)(r,i);return await Kde(n)?(console.log(`load ${n}.`),await k2(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),fo.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?fo.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,Yde.default)({nodeCount:this.nodesCounter},Wee()),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,E0.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,E0.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}),fo.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 $1=Fe(require("path")),R2=Fe(require("fs"));function C2(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 I2(e){let{slpk:t,outputPath:r,tilesetName:i}=e,n=K1(r);try{if(t){let s=(0,$1.join)(n,`${i}.slpk`);return(await R2.promises.stat(s)).size}let a=(0,$1.join)(n,i);return await $de(a)}catch(a){return console.log("Calculate file sizes error: ",a),null}}async function $de(e){let t=0,r=await R2.promises.readdir(e);for(let i of r){let n=await R2.promises.stat((0,$1.join)(e,i));n.isDirectory()?t+=await $de((0,$1.join)(e,i)):t+=n.size}return t}var ks=Fe(dr()),Lj=Fe(Ra());var ppe=Fe(YB());var vp=3,S0=9;function Xde(e){let{positions:t,normals:r,texCoords:i,colors:n,uvRegions:a,featureIndices:o}=e,s=t.length/S0;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=oot(o),l=sot(ae(ae({},u),e)),c=uot(l);return lot(c,u.featureCount)}function oot(e){let t=1,r=1,i=Jde(e.slice(0,vp)),n=[],a=[],o=[i];n[0]=0,a[0]=i;for(let l=vp;l<e.length;l+=vp){let c=Jde(e.slice(l,l+vp));i!==c&&(n[t]=l/vp-1,n[t+1]=l/vp,a[r]=c,o.includes(c)||o.push(c),t+=2,r+=1),i=c}n[t]=e.length/vp-1;let s=new Uint32Array(n),u=o.length;return{faceRange:s,featureCount:u,featureIds:a}}function Jde(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 sot(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=X1("positions",y,g),E=X1("normals",y,g),T=X1("colors",y,g),k=X1("uvRegions",y,g),R=X1("texCoords",y,g);u.push({featureId:t[p],positions:l.slice(0,b),normals:c.slice(0,E),colors:f.slice(0,T),uvRegions:d.slice(0,k),texCoords:h.slice(0,R)}),l=l.slice(b),c=c.slice(E),f=f.slice(T),d=d.slice(k),h=h.slice(R)}return u.sort((p,y)=>p.featureId-y.featureId)}function X1(e,t,r){let i=4,n=2,a=r-t+1,o=a*3;switch(e){case"positions":case"normals":return a*S0;case"colors":case"uvRegions":return o*i;case"texCoords":return o*n;default:return 0}}function uot(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=ua(n.positions,i.positions),n.normals=ua(n.normals,i.normals),n.colors=ua(n.colors,i.colors),n.texCoords=ua(n.texCoords,i.texCoords)):t.push(i)}return t}function lot(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=ua(n,p.positions),a=ua(a,p.normals),o=ua(o,p.colors),s=ua(s,p.uvRegions),u=ua(u,p.texCoords);let y=e[c];l.push(y.positions.length/S0-1+f),l.push(y.positions.length/S0+f),f+=y.positions.length/S0,c+=1}return l.push(n.length/S0-1),{faceRange:new Uint32Array(l),featureIds:i,positions:n,normals:a,colors:o,uvRegions:s,texCoords:u,featureCount:t}}var Ba=Fe(dr()),A0=Fe(Ra()),Bc=Fe(Zu());function Dj(e,t){let r,i,n,a=A0.Ellipsoid.WGS84.cartesianToCartographic(e.center,new Ba.Vector3);return a[2]=a[2]-t.getHeight(a[1],a[0]),e instanceof Bc.OrientedBoundingBox?(i=e.halfSize,r=new Ba.Vector3(i[0],i[1],i[2]).len(),n=e.quaternion):(r=e.radius,i=[r,r,r],n=new Ba.Quaternion().fromMatrix3(new Ba.Matrix3([i[0],0,0,0,i[1],0,0,0,i[2]])).normalize()),{mbs:[a[0],a[1],a[2],r],obb:{center:[a[0],a[1],a[2]],halfSize:i,quaternion:n}}}function Qde(e,t){let r=cot(e),i=(0,Bc.makeOrientedBoundingBoxFromPoints)(r),n=(0,Bc.makeBoundingSphereFromPoints)(r),a=A0.Ellipsoid.WGS84.cartesianToCartographic(n.center,new Ba.Vector3),o=A0.Ellipsoid.WGS84.cartesianToCartographic(i.center,new Ba.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 cot(e){let t=[];for(let r=0;r<e.length;r+=3){let i=new Ba.Vector3([e[r],e[r+1],e[r+2]]);t.push(i)}return t}function Zde(e){let t;e instanceof Bc.BoundingSphere?t=e:t=e.getBoundingSphere();let r=t.center,i=t.radius,n=A0.Ellipsoid.WGS84.cartesianToCartographic(new Ba.Vector3(r[0]+i,r[1]+i,r[2]+i),new Ba.Vector3),a=A0.Ellipsoid.WGS84.cartesianToCartographic(new Ba.Vector3(r[0]-i,r[1]-i,r[2]-i),new Ba.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 Fj(e){let t=e[3],r=new Ba.Vector3(e[0],e[1],e[2]),i=new Ba.Matrix3([t,0,0,0,t,0,0,0,t]);return new Bc.OrientedBoundingBox(r,i)}var yp=Fe(dr()),epe=Fe(Ra());function tpe(e,t,r){var s,u,l,c,f,h,d,p;let i=((u=(s=e.gltf)==null?void 0:s.scene)==null?void 0:u.nodes)||((f=(c=(l=e.gltf)==null?void 0:l.scenes)==null?void 0:c[0])==null?void 0:f.nodes)||((h=e.gltf)==null?void 0:h.nodes)||[],n=((p=(d=e.gltf)==null?void 0:d.images)==null?void 0:p.map(y=>{var g,b;if((g=y==null?void 0:y.image)==null?void 0:g.compressed)return null;{let E=(b=y==null?void 0:y.image)==null?void 0:b.data,T=new Uint8Array(E.length);return T.set(E),{data:T,compressed:!1,height:y.image.height,width:y.image.width,components:y.image.components,mimeType:y.mimeType}}}))||[];rpe(i);let{cartographicOrigin:a,modelMatrix:o}=hot(e,t,r);return{nodes:i,images:n,cartographicOrigin:a,cartesianModelMatrix:o}}function fot(e){let t={};for(let r in e)t[r]={value:e[r].value};return t}function hot(e,t,r){let{rtcCenter:i,gltfUpAxis:n}=e,{center:a}=r,o=new yp.Matrix4(t);switch(i&&o.translate(i),n){case"Z":break;case"Y":let l=new yp.Matrix4().rotateX(Math.PI/2);o=o.multiplyRight(l);break;case"X":let c=new yp.Matrix4().rotateY(-Math.PI/2);o=o.multiplyRight(c);break;default:break}let s=new yp.Vector3(a),u=epe.Ellipsoid.WGS84.cartesianToCartographic(s,new yp.Vector3);return{modelMatrix:o,cartographicOrigin:u}}function rpe(e){var t;for(let r=0;r<e.length;r++){let i=e[r];i.mesh&&(e[r]=Je(ae({},i),{mesh:Je(ae({},i.mesh),{primitives:(t=i.mesh)==null?void 0:t.primitives.map(n=>{var a,o,s;return Je(ae({},n),{indices:{value:(a=n==null?void 0:n.indices)==null?void 0:a.value},attributes:fot(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&&rpe(i.children)}}var dot="EXT_mesh_features",pot="EXT_feature_metadata";function ipe(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 pot:return mot(e,a,r);case dot:return console.warn("EXT_mesh_features extension is not supported yet"),[];default:return[]}return[]}function mot(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 got(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 vot(n,y,r)}let a=(t==null?void 0:t.featureTextures)&&(t==null?void 0:t.featureTextures[0]);return a?e[a].value:[]}function got(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 vot(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&&(o==null?void 0:o.width)&&(o==null?void 0:o.height)&&(o==null?void 0:o.components))for(let h=0;h<t.length;h+=2){let d=t[h],p=t[h+1],y=Math.min(npe(d)*o.width|0,o.width-1),b=(Math.min(npe(p)*o.height|0,o.height-1)*o.width+y)*o.components+u,E=new Uint8Array(o.data)[b];s.push(E)}else console.warn(`Can't get batch Ids from ${(o==null?void 0:o.mimeType)||""} compressed texture`);return s}function npe(e){return(e%1+1)%1}function ape(e,t){let r={};for(let i in t){let n=t[i];r[i]=yot(n,e)}return r}function yot(e,t){let r=[];for(let i of t){let n=e[i]||null;r.push(n)}return r}function ope(e,t){let r=!1;for(let i of Object.values(t))e.length!==i.length&&(r=!0);return r}var J1="string",Mj="Int32",jj="double",P2="OBJECTID";function spe(e,t){return e===P2?P2:typeof t===J1?J1:typeof t=="number"?Number.isInteger(t)?Mj:jj:J1}function upe(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 P2:bot(i);break;case J1:hpe(i);break;case jj:_ot(i);break;case Mj:break;default:hpe(i)}return i}function lpe(e){switch(e){case P2:return"esriFieldTypeOID";case J1:return"esriFieldTypeString";case Mj:return"esriFieldTypeInteger";case jj:return"esriFieldTypeDouble";default:return"esriFieldTypeString"}}function cpe(e,t){return{name:e,type:t,alias:e}}function fpe(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 hpe(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 bot(e){e.attributeValues={valueType:"Oid32",valuesPerElement:1}}function _ot(e){e.attributeValues={valueType:"Float64",valuesPerElement:1}}var dpe=e=>{let t=new Uint32Array(e);for(let r=0;r<e;r++)t[r]=r;return t};var xot=1,wot=1,mu=3,Q1=2,Eot=4,Sot="string",Aot="Int32",Tot="Float64",kot="Oid32",mpe=["CUSTOM_ATTRIBUTE_2","_BATCHID","BATCHID"],gpe="EXT_feature_metadata",vpe="EXT_mesh_features",Oh=new ks.Vector3;async function Nj(e,t,r,i,n,a,o,s,u,l,c,f){var b;let h=u,d=await Got((b=e.gltf)==null?void 0:b.materials,l),p=tpe(e,t,r),y=await Iot(p,d,h);u&&Rot(y,c);let g=[];for(let E of d){let T=E.mergedMaterials[0].originalMaterialId;if(!y.has(T))continue;let k=y.get(T);if(!k)continue;let{material:R,texture:D}=E,C=await i();g.push(await Cot({convertedAttributes:k,material:R,texture:D,tileContent:e,nodeId:C,featuresHashArray:a,propertyTable:n,attributeStorageInfo:o,draco:s,workerSource:f}))}return g.length?g:null}function Rot(e,t){for(let r of e.values()){let i=Qde(r.positions,t);r.boundingVolumes=i;let n=i.obb.center;for(let a=0;a<r.positions.length;a+=mu){let o=r.positions.subarray(a,a+mu);Lj.Ellipsoid.WGS84.cartesianToCartographic(Array.from(o),Oh),Oh[2]=Oh[2]-t.getHeight(Oh[1],Oh[0]),Oh=Oh.subtract(n),r.positions.set(Oh,a)}}}async function Cot({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/mu,{faceRange:h,featureIds:d,positions:p,normals:y,colors:g,uvRegions:b,texCoords:E,featureCount:T}=Xde(e);i.batchTableJson&&Zot(d,e.featureIndices,a,i.batchTableJson);let k=new Uint32Array(2),R=ust(d);k.set([f,T],0);let D=new Uint8Array(Wu(k.buffer,p.buffer,y.buffer,r?E.buffer:new ArrayBuffer(0),g.buffer,b,R.buffer,h.buffer)),C=u?lst(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=ist(d,o,s)),{nodeId:n,geometry:D,compressedGeometry:C,texture:r,hasUvRegions:Boolean(b.length),sharedResources:Yot(((B=i.gltf)==null?void 0:B.materials)||[],n),meshMaterial:t,vertexCount:f,attributes:L,featureCount:T,boundingVolumes:c}}async function Iot(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)}ype(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 ype(e,t,r,i,n,a,o=new ks.Matrix4([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])){if(e)for(let s of e)Oot(s,t,r,i,n,a,o)}function Pot(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 Oot(e,t,r,i,n,a,o=new ks.Matrix4([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])){let s=Pot(e,o),u=e.mesh;u&&Bot(u,t,r,i,n,a,s),ype(e.children||[],t,r,i,n,a,s)}function Bot(e,t,r,i,n,a=!1,o=new ks.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.id),c=(s=l==null?void 0:l.mergedMaterials.find(({originalMaterialId:d})=>{var p;return d===((p=u.material)==null?void 0:p.id)}))==null?void 0:s.uvRegion):n.has("default")&&(l=n.get("default")),Ut(l!==null,"Primitive - material mapping failed"),Ut(u.mode===void 0||u.mode===Zt.TRIANGLES||u.mode===Zt.TRIANGLE_STRIP,`Primitive - unsupported mode ${u.mode}`);let f=u.attributes;if(!l)continue;let h=Dot(u);l.positions=ua(l.positions,bpe({vertices:f.POSITION.value,cartographicOrigin:r,cartesianModelMatrix:i,nodeMatrix:o,indices:h,attributeSpecificTransformation:Fot,useCartesianPositions:a})),l.normals=ua(l.normals,bpe({vertices:f.NORMAL&&f.NORMAL.value,cartographicOrigin:r,cartesianModelMatrix:i,nodeMatrix:o,indices:h,attributeSpecificTransformation:Mot,useCartesianPositions:!1})),l.texCoords=ua(l.texCoords,jot(f.TEXCOORD_0&&f.TEXCOORD_0.value,h)),l.colors=ua(l.colors,Lot(f.COLOR_0,h)),c&&(l.uvRegions=ua(l.uvRegions,Not(c,h))),l.featureIndicesGroups=l.featureIndicesGroups||[],l.featureIndicesGroups.push(qot(Uot(f,u,t),h))}}function Dot(e){var r;let t=(r=e.indices)==null?void 0:r.value;if(!t){let i=e.attributes.POSITION.value;return dpe(i.length/mu)}if(t&&e.mode===Zt.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 bpe(e){let{vertices:t,indices:r,attributeSpecificTransformation:i}=e,n=new Float32Array(r.length*mu);if(!t)return n;for(let a=0;a<r.length;a++){let o=r[a]*mu,s=t.subarray(o,o+mu),u=new ks.Vector3(Array.from(s));u=i(u,e),n[a*mu]=u.x,n[a*mu+1]=u.y,n[a*mu+2]=u.z}return n}function Fot(e,t){let{cartesianModelMatrix:r,cartographicOrigin:i,nodeMatrix:n,useCartesianPositions:a}=t;return n&&(e=e.transform(n)),e=e.transform(r),a||(Lj.Ellipsoid.WGS84.cartesianToCartographic([e[0],e[1],e[2]],e),e=e.subtract(i)),e}function Mot(e,t){let{cartesianModelMatrix:r,nodeMatrix:i}=t;return i&&(e=e.transformAsVector(i)),e=e.transformAsVector(r),e}function jot(e,t){let r=new Float32Array(t.length*Q1);if(!e)return r.fill(1),r;for(let i=0;i<t.length;i++){let n=t[i]*Q1,a=e.subarray(n,n+Q1);r[i*Q1]=a[0],r[i*Q1+1]=a[1]}return r}function Lot(e,t){let r=(e==null?void 0:e.components)||Eot,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 Not(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 qot(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 Uot(e,t,r){let i=ipe(e,t,r);if(i.length)return i;for(let n=0;n<mpe.length;n++){let a=mpe[n];if(e[a]&&e[a].value)return e[a].value}return[]}async function Got(e=[],t){let r=[];for(let i of e)r.push(Wot(i));return t&&(r=await zot(r)),r}async function zot(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 Hot(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:Kot(),mergedMaterials:[{originalMaterialId:"default"}]}),t}async function Hot(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 Wot(e){var n,a,o,s,u;let t={doubleSided:e.doubleSided,emissiveFactor:(n=e.emissiveFactor)==null?void 0:n.map(l=>Math.round(l*255)),alphaMode:Vot(e.alphaMode),pbrMetallicRoughness:{roughnessFactor:((a=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:a.roughnessFactor)||xot,metallicFactor:((o=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:o.metallicFactor)||wot}},r;((s=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:s.baseColorTexture)?(r=e.pbrMetallicRoughness.baseColorTexture.texture.source,t.pbrMetallicRoughness.baseColorTexture={textureSetDefinitionId:0}):e.emissiveTexture&&(r=e.emissiveTexture.texture.source,t.pbrMetallicRoughness.baseColorTexture={textureSetDefinitionId:0}),e.id=Number.isFinite(e.id)?e.id:pc();let i=[{originalMaterialId:e.id}];if(r)i[0].textureSize={width:r.image.width,height:r.image.height};else{let l=(u=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:u.baseColorFactor;t.pbrMetallicRoughness.baseColorFactor=l&&l.map(c=>Math.round(c*255))||void 0}return{material:t,texture:r,mergedMaterials:i}}function Vot(e){switch(e){case"OPAQUE":return"opaque";case"MASK":return"mask";case"BLEND":return"blend";default:return"opaque"}}function Kot(){return{alphaMode:"opaque",pbrMetallicRoughness:{metallicFactor:1,roughnessFactor:1}}}function Yot(e,t){let r={};if(!e||!e.length)return r;r.materialDefinitionInfos=[];for(let i of e){let{materialDefinitionInfo:n,textureDefinitionInfo:a}=$ot(i,t);r.materialDefinitionInfos.push(n),a&&(r.textureDefinitionInfos=r.textureDefinitionInfos||[],r.textureDefinitionInfos.push(a))}return r}function $ot(e,t){var s;let r=((s=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:s.baseColorTexture)||e.emissiveTexture,i=null;r&&(i=Jot(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:Xot(o||[1,1,1,1],a),textureDefinitionInfo:i}}function Xot(e,t=1){let r=.04/255,i=new ks.Vector4(0,0,0,1),n=new ks.Vector4(1,1,1,1),a=new ks.Vector4(r,r,r,0),o=new ks.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 Jot(e,t){var r,i,n,a;return{encoding:((r=e==null?void 0:e.source)==null?void 0:r.mimeType)?[e.source.mimeType]:void 0,images:[{id:Qot(e,t),size:(i=e.source)==null?void 0:i.image.width,length:((n=e.source)==null?void 0:n.image.data.length)?[(a=e.source)==null?void 0:a.image.data.length]:void 0}]}}function Qot(e,t){var y;let{width:r,height:i}=((y=e.source)==null?void 0:y.image)||{};if(!r||!i)return"";let 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 Zot(e,t,r,i){let n=est(e,i,r);_pe(t,n),_pe(e,n)}function est(e,t,r){let i={};for(let n=0;n<e.length;n++){let a=e[n],o=rst(n,t,r);i[a.toString()]=o}return i}function tst(e,t){let r="";for(let i in e)r+=e[i][t];return r}function rst(e,t,r){let i=tst(t,e),n=(0,ppe.default)(i);return r.includes(n)?r.indexOf(n):r.push(n)-1}function _pe(e,t){for(let r=0;r<e.length;r++)e[r]=t[e[r]]}function ist(e,t,r){let i=[],a=ope(e,t)?ape(e,t):t,o=ae({OBJECTID:e},a);for(let s in o){let u=ast(s,r),l=o[s],c=nst(u,l);i.push(c)}return i}function nst(e,t){let r;switch(e){case kot:case Aot:r=ost(t);break;case Tot:r=sst(t);break;case Sot:r=xpe(t);break;default:r=xpe(t)}return r}function ast(e,t){return t.find(i=>i.name===e).attributeValues.valueType}function ost(e){let t=new Uint32Array([e.length]),r=new Uint32Array(e);return Wu(t.buffer,r.buffer)}function sst(e){let t=new Uint32Array([e.length]),r=new Uint8Array(4),i=new Float64Array(e);return Wu(t.buffer,r.buffer,i.buffer)}function xpe(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 Wu(t.buffer,a.buffer,i.buffer,...n)}function ust(e){let t=new BigUint64Array(e.length);for(let r=0;r<e.length;r++)t[r]=BigInt(e[r]);return t}async function lst(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=cst(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"}),Tm({attributes:p,indices:f},Ly,Je(ae({},Ly.options),{source:i,reuseWorkers:!0,_nodeWorkers:!0,draco:{method:"MESH_SEQUENTIAL_ENCODING",attributesMetadata:y}}))}function cst(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)*mu;r.fill(i,n,o),i++,n=o+1}return r}function wpe(e){if(!e)return null;let t=e==null?void 0:e.batchTableJson;if(t)return t;let{extensionName:r,extension:i}=fst(e);switch(r){case vpe:return console.warn("The I3S converter does not yet support the EXT_mesh_features extension"),null;case gpe:return hst(i);default:return null}}function fst(e){var a,o,s,u;let t=[gpe,vpe];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 hst(e){var t,r;if(e==null?void 0:e.featureTables){let i=(t=Object.keys(e.featureTables))==null?void 0:t[0];if(i){let n=e==null?void 0:e.featureTables[i],a={};for(let o in n.properties)a[o]=n.properties[o].data;return a}}if(e==null?void 0:e.featureTextures){let i=(r=Object.keys(e.featureTextures))==null?void 0:r[0];if(i){let n=e==null?void 0:e.featureTextures[i],a={};for(let o in n.properties)a[o]=n.properties[o].data;return a}}return console.warn("The I3S converter couldn't handle EXT_feature_metadata extension: There is neither featureTables, no featureTextures in the extension."),null}var Spe=Fe(su()),Ape=Fe(require("path"));var Epe=()=>({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 Tpe(e,t,r){let i={serviceItemId:pc().replace(/-/gi,""),layerName:e,layers0:t},n=(0,Spe.default)(i,Epe()),a=(0,Ape.join)(r,"SceneServer");await Un(a,JSON.stringify(n))}var qj=16;function kpe(e,t){let r=[],i=e.boundingVolume,n=e.lodMetricValue||.1,a={metricType:"maxScreenThreshold",maxError:t.mbs[3]*2*qj/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 Uj(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=qj),e.header.mbs[3]*2*qj/r}var qpe=Fe(Npe()),Mst="4.0.0-alpha.9",F2={name:"PGM - Netpbm grayscale image format",id:"pgm",module:"tile-converter",version:Mst,mimeTypes:["image/x-portable-graymap"],parse:async(e,t)=>(0,qpe.parsePGM)(new Uint8Array(e),t),extensions:["pgm"],options:{cubic:!1}};var T0=Fe(su());var Upe={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 jst=()=>({wkid:{path:"wkid",default:4326},latestWkid:{path:"latestWkid",default:4326},vcsWkid:{path:"vcsWkid",default:5773},latestVcsWkid:{path:"latestVcsWkid",default:5773}}),Lst=()=>({heightModel:{path:"heightModel",default:"gravity_related_height"},vertCRS:{path:"vertCRS",default:"EGM96_Geoid"},heightUnit:{path:"heightUnit",default:"meter"}}),Nst=()=>({nodesPerPage:{path:"nodesPerPage"},lodSelectionMetricType:{path:"lodSelectionMetricType",default:"maxScreenThresholdSQ"}}),qst=()=>({xmin:{path:"xmin"},ymin:{path:"ymin"},xmax:{path:"xmax"},ymax:{path:"ymax"},zmin:{path:"zmin"},zmax:{path:"zmax"}}),Gpe=()=>({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,T0.default)(e,jst())},capabilities:{path:"capabilities",default:["View","Query"]},store:{path:"store",transform:e=>(0,T0.default)(e,Upe)},fullExtent:{path:"fullExtent",transform:e=>(0,T0.default)(e,qst())},heightModelInfo:{path:"heightModelInfo",transform:e=>(0,T0.default)(e,Lst())},nodePages:{path:"nodePages",transform:e=>(0,T0.default)(e,Nst())},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 Vj=Fe(su()),Ust=()=>({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}}}),Gst=()=>({"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}}}),zpe=()=>({geometryBuffers:{path:"geometryConfig",transform:e=>{let t=[(0,Vj.default)(e,Ust())];return e.draco&&t.push((0,Vj.default)({geometryConfig:e},Gst())),t}}});var Z1=Fe(su()),zst=()=>({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}}),Hst=()=>({name:{path:"name",default:"standard"},type:{path:"type",default:"standard"},params:{path:"params",transform:(e,t,r)=>(0,Z1.default)(r,zst())}}),Wst=()=>({id:{path:"id"},size:{path:"size"},href:{path:"href",default:["../textures/0"]},length:{path:"length"}}),Vst=()=>({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,Z1.default)(i,Wst()))}}),Hpe=()=>({materialDefinitions:{path:"materialDefinitionInfos",transform:Kst},textureDefinitions:{path:"textureDefinitionInfos",transform:Yst}});function Kst(e,t,r){let i={};for(let[n,a]of e.entries())i[`Mat${r.nodePath}${n}`]=(0,Z1.default)(a,Hst());return i}function Yst(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,Z1.default)(a,Vst())}return i}var M2=Fe(Zu()),Wpe=Fe(dr()),Kj=Fe(Ra()),$st=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 Vpe(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 Xst(t,e),Jst(t,e),t}function Xst(e,t){var o;let r=Qst(t.parentNode.obb),i=Zst(t);if(eut(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 Jst(e,t){var a;let r=Kpe(t.mbs),i=Kpe(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 Kpe(e){return new M2.BoundingSphere([e[0],e[1],e[2]],e[3])}function Qst(e){let{center:t,halfSize:r,quaternion:i}=e;return new M2.OrientedBoundingBox().fromCenterHalfSizeQuaternion(t,r,i)}function Zst(e){let t=e.obb.halfSize,r=$st,i=Kj.Ellipsoid.WGS84.cartographicToCartesian(e.obb.center),n=[];for(let a=0;a<r.length;a+=3){let s=new Wpe.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 eut(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=Kj.Ellipsoid.WGS84.cartesianToCartographic(n);if(e.distanceTo(a)>0){r=!1;break}}return r}var jo;(function(s){s.POINTS="POINTS",s.LINES="LINES",s.LINE_LOOP="LINE_LOOP",s.LINE_STRIP="LINE_STRIP",s.TRIANGLES="TRIANGLES",s.TRIANGLE_STRIP="TRIANGLE_STRIP",s.TRIANGLE_FAN="TRIANGLE_FAN"})(jo||(jo={}));var Yj=class extends Array{enqueue(t){this.push(t)}dequeue(){return this.shift()}peek(){return this[0]}isEmpty(){return this.length===0}};var Ype=Fe(require("process")),tut=4*1024*1024*1024,e_=class extends Yj{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),Ype.default.memoryUsage().rss>tut&&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 rut="4.0.0-alpha.9",$pe={id:"i3s-attributes",name:"I3S Attributes Worker",module:"tile-converter",version:rut,options:{useCartesianPositions:!1}};var k0="Tile converter does not work in browser, only in node js environment";var Xj=Fe(require("path")),Jj=Fe(su());var Xpe=Fe(su()),Jpe=()=>({mbs:{path:"mbs"},obb:{path:"obb"}}),iut=()=>({href:{path:"href"}}),nut=()=>ae(ae({id:{path:"id"}},iut()),Jpe()),$j=()=>Je(ae({version:{path:"version"},id:{path:"id"},path:{path:"path"},level:{path:"level"}},Jpe()),{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,Xpe.default)(e,nut()),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 _l=class{constructor(t,r){this.data=null;this.children=[];this._finalized=!1;this.inPageId=t,this.id=t===0?"root":t.toString(),this.converter=r}get finalized(){return this._finalized}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;if(this.finalized)return;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(ae({},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()}this.finalize()}async save(){this.data&&await this.write(this.data)}finalize(){this._finalized=!0;for(let t of this.children)t.flush()}async write(t){let r=(0,Xj.join)(this.converter.layers0Path,"nodes",this.id);this.converter.options.slpk?await this.converter.writeQueue.enqueue({archiveKey:`nodes/${this.id}/3dNodeIndexDocument.json.gz`,writePromise:()=>bl(r,JSON.stringify(t),"3dNodeIndexDocument.json",!0,this.converter.compressList)},!0):await this.converter.writeQueue.enqueue({writePromise:()=>Un(r,JSON.stringify(t))},!0)}async load(){if(this.data)return this.data;let t=this.id,r=(0,Xj.join)(this.converter.layers0Path,"nodes",t),i="index.json";return this.converter.options.slpk&&(i="3dNodeIndexDocument.json"),await k2(r,i)}flush(){this.data=null}static async createRootNode(t,r){let i=_l.createRootNodeIndexDocument(t);return await new _l(0,r).addData(i)}static async createNode(t,r,i,n,a,o){let s=await _l.createNodeIndexDocument(t,r,i,n,a);return await new _l(n.index,o).addData(s)}static createRootNodeIndexDocument(t){let r=Je(ae({version:`{${pc().toUpperCase()}}`,id:"root",level:0,lodSelection:[{metricType:"maxScreenThresholdSQ",maxError:0},{metricType:"maxScreenThreshold",maxError:0}]},t),{children:[]});return(0,Jj.default)(r,$j())}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=Je(ae({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,Jj.default)(c,$j());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 Qj=async(e,t,r)=>{let i=t.type==="json";if(!e||!t.contentUrl||!i)return;let n=Je(ae({},r),{[e.loader.id]:{isTileset:i,assetGltfUpAxis:e.asset&&e.asset.gltfUpAxis||"Y"}}),a=await Wr(t.contentUrl,e.loader,n);a.root&&(t.children=[a.root])},Zj=async(e,t,r)=>{let i=t.type==="json";if(!e||!t.contentUrl||i)return null;let n=Je(ae({},r),{[e.loader.id]:Je(ae({},r[e.loader.id]||{}),{isTileset:i,assetGltfUpAxis:e.asset&&e.asset.gltfUpAxis||"Y"})});return await Wr(t.contentUrl,e.loader,n)};var tL=Fe(dr());var j2=async(e,t,r,i,n,a=0)=>{if(n&&a>n)return;let o=[],s=await r(e,t);o.push(s);for(let u of e.children)await j2(u,s,r,i,n,a+1);i&&await i(o,t)};var aut=[jo.POINTS,jo.LINES,jo.LINE_LOOP,jo.LINE_STRIP,jo.TRIANGLES,jo.TRIANGLE_STRIP,jo.TRIANGLE_FAN],Qpe=async(e,t)=>{let r={meshTopologyTypes:new Set};if(!(t==null?void 0:t.gltfArrayBuffer))return r;let n=(await Eo(t.gltfArrayBuffer,lc,{gltf:{normalize:!1,loadBuffers:!1,loadImages:!1,decompressMeshes:!1}})).json;if(!n)return r;let a=out(n);return r.meshTopologyTypes=a,r},out=e=>{let t=new Set;for(let r of e.meshes||[])for(let i of r.primitives){let{mode:n}=i;typeof n!="number"&&(n=4),t.add(aut[n])}return t},Zpe=(e,t)=>{for(let r of t.meshTopologyTypes)e.meshTopologyTypes.add(r)};var tme,sut=((tme=bp.default.env)==null?void 0:tme.IonToken)||"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJlYWMxMzcyYy0zZjJkLTQwODctODNlNi01MDRkZmMzMjIxOWIiLCJpZCI6OTYyMCwic2NvcGVzIjpbImFzbCIsImFzciIsImdjIl0sImlhdCI6MTU2Mjg2NjI3M30.1FNiClUyk00YH_nWfSGpiQAjR5V2OvREDq1PJ5QMjWQ",eme=64,uut="3DTILES",lut="3DObject",cut=1800,fut="https://",t_=class{constructor(){this.boundingVolumeWarnings=[];this.conversionStartTime=[0,0];this.refreshTokenTime=[0,0];this.sourceTileset=null;this.loadOptions={_nodeWorkers:!0,reuseWorkers:!0,basis:{format:"rgba32",workerUrl:"./modules/textures/dist/basis-worker-node.js"},draco:{workerUrl:"./modules/draco/dist/draco-worker-node.js"},fetch:{}};this.geoidHeightModel=null;this.Loader=hc;this.workerSource={};this.writeQueue=new e_;this.compressList=null;this.preprocessData={meshTopologyTypes:new Set};this.nodePages=new fo(Un,eme,this),this.options={},this.layers0Path="",this.materialMap=new Map,this.materialDefinitions=[],this.geometryMap=new Map,this.geometryConfigs=[],this.vertexCounter=0,this.layers0=null,this.featuresHashArray=[],this.refinementCounter={tilesCount:0,tilesWithAddRefineCount:0},this.validate=!1,this.generateTextures=!1,this.generateBoundingVolumes=!1,this.layersHasTexture=!1,this.compressList=null}async convert(t){if(on)return console.log(k0),k0;this.conversionStartTime=bp.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(fut)!==-1?SS:hc,this.generateTextures=Boolean(h),this.generateBoundingVolumes=Boolean(d),this.writeQueue=new e_,this.writeQueue.startListening(),console.log("Loading egm file..."),this.geoidHeightModel=await Wr(n,F2),console.log("Loading egm file completed!"),i&&this.nodePages.useWriteFunction(bl),await this.loadWorkers();try{let g=await this._fetchPreloadOptions();g.headers&&(this.loadOptions.fetch={headers:g.headers}),this.sourceTileset=await Wr(a,this.Loader,this.loadOptions),await this.preprocessConversion()&&(await this._createAndSaveTileset(s,r),await this._finishConversion({slpk:Boolean(i),outputPath:s,tilesetName:r}))}catch(g){throw g}finally{await this.writeQueue.finalize(),_n.getWorkerFarm({}).destroy()}return"success"}async preprocessConversion(){console.log("Analyze source tileset");let t=this.sourceTileset.root;await j2(t,null,this.analyzeTile.bind(this),void 0,this.options.maxDepth);let{meshTopologyTypes:r}=this.preprocessData;return console.log("------------------------------------------------"),console.log("Preprocess results:"),console.log(`glTF mesh topology types: ${Array.from(r).join(", ")}`),console.log("------------------------------------------------"),!r.has(jo.TRIANGLES)&&!r.has(jo.TRIANGLE_STRIP)?(console.log("The tileset is of unsupported mesh topology types. The conversion will be interrupted."),console.log("------------------------------------------------"),!1):!0}async analyzeTile(t,r){if(t.type==="json")return await Qj(this.sourceTileset,t,this.loadOptions),null;t.id&&console.log(`[analyze]: ${t.id}`);let i=await Zj(this.sourceTileset,t,Je(ae({},this.loadOptions),{"3d-tiles":Je(ae({},this.loadOptions["3d-tiles"]),{loadGLTF:!1})})),n=await Qpe(t,i);return Zpe(this.preprocessData,n),null}async _createAndSaveTileset(t,r){var u,l,c;let i=(0,Da.join)(`${t}`,`${r}`);try{await Y1(i)}catch{}this.layers0Path=(0,Da.join)(i,"SceneServer","layers","0"),this.materialDefinitions=[],this.materialMap=new Map;let n=this.sourceTileset.root,a=Of(n.boundingVolume,new tL.Matrix4(n.transform),null);this._formLayers0(r,a,(c=(l=(u=this.sourceTileset)==null?void 0:u.root)==null?void 0:l.boundingVolume)==null?void 0:c.region);let o=Dj(a,this.geoidHeightModel);await this.nodePages.push({index:0,lodThreshold:0,obb:o.obb,children:[]});let s=await _l.createRootNode(o,this);await j2(n,{transform:new tL.Matrix4(n.transform),parentNodes:[s]},this.convertTile.bind(this),this.finalizeTile.bind(this),this.options.maxDepth),this.layers0.materialDefinitions=this.materialDefinitions,this.layers0.geometryDefinitions=(0,L2.default)(this.geometryConfigs.map(f=>({geometryConfig:Je(ae({},f),{draco:this.options.draco})})),zpe()),this.layersHasTexture===!1&&(this.layers0.store.defaultGeometrySchema.ordering=this.layers0.store.defaultGeometrySchema.ordering.filter(f=>f!=="uv0")),await this._writeLayers0(),Tpe(r,this.layers0,i);for(let f of this.compressList||[])await T2(f),await Bj(f);await this.nodePages.save(),await this.writeQueue.finalize(),await this._createSlpk(i)}_formLayers0(t,r,i){var s;if(!((s=this.sourceTileset)==null?void 0:s.root))return;let n=Zde(r);i&&(n.zmin=i[4],n.zmax=i[5]);let a=[n.xmin,n.ymin,n.xmax,n.ymax],o={version:`{${pc().toUpperCase()}}`,id:0,name:t,href:"./layers/0",store:{id:`{${pc().toUpperCase()}}`,extent:a},nodePages:{nodesPerPage:eme},compressGeometry:this.options.draco,fullExtent:n};this.layers0=(0,L2.default)(o,Gpe())}async _writeLayers0(){this.options.slpk?await this.writeQueue.enqueue({archiveKey:"3dSceneLayer.json.gz",writePromise:()=>bl(this.layers0Path,JSON.stringify(this.layers0),"3dSceneLayer.json")}):await this.writeQueue.enqueue({writePromise:()=>Un(this.layers0Path,JSON.stringify(this.layers0))})}async _createSlpk(t){if(this.options.slpk){let r=(0,Da.join)(t,"SceneServer","layers","0"),i=`${t}.slpk`;await Vde(r,i,0,".",this.options.sevenZipExe);try{await Y1(t)}catch{}}}async convertTile(t,r){if(t.type==="json"||t.type==="empty")return t.type==="json"&&(t.id&&console.log(`[load]: ${t.id}`),await Qj(this.sourceTileset,t,this.loadOptions)),r;t.id&&console.log(`[convert]: ${t.id}`);let{parentNodes:i,transform:n}=r,a=n.clone();t.transform&&(a=a.multiplyRight(t.transform));let o=i[0],s=await this._createNode(o,t,a);return await o.addChildren(s),{transform:a,parentNodes:s}}async finalizeTile(t,r){for(let i of t)for(let n of i.parentNodes)await n.addNeighbors();for(let i of r.parentNodes)await i.save()}async _createNode(t,r,i){var d,p;this._checkAddRefinementTypeForTile(r),await this._updateTilesetOptions();let n=await Zj(this.sourceTileset,r,this.loadOptions),a=Of(r.boundingVolume,i,null),o=Dj(a,this.geoidHeightModel),s=wpe(n);s&&!((p=(d=this.layers0)==null?void 0:d.attributeStorageInfo)==null?void 0:p.length)&&this._convertPropertyTableToNodeAttributes(s);let u=await this._convertResources(r,i,a,n,t.inPageId,s),l=[],c=[],f=[],h={geometry:null,compressedGeometry:null,texture:null,hasUvRegions:!1,sharedResources:null,meshMaterial:null,vertexCount:null,attributes:null,featureCount:null,boundingVolumes:null};for(let y of u||[h]){this.layersHasTexture=this.layersHasTexture||Boolean(y.texture),this.generateBoundingVolumes&&y.boundingVolumes&&(o=y.boundingVolumes);let g=kpe(r,o),b=g.find(R=>R.metricType==="maxScreenThresholdSQ")||{maxError:0},E=await this._updateNodeInNodePages(b,o,r,t.inPageId,y),T=await _l.createNodeIndexDocument(t,o,g,E,y),k=await new _l(E.index,this).addData(T);l.push(k),E.mesh&&await this._writeResources(y,k.id),this.validate&&(this.boundingVolumeWarnings=Vpe(T),this.boundingVolumeWarnings&&this.boundingVolumeWarnings.length&&console.warn("Bounding Volume Warnings: ",...this.boundingVolumeWarnings)),c.push(E.index),f.push(E)}return l}async _convertResources(t,r,i,n,a,o){var l;if(!this.isContentSupported(t)||!n)return null;let s={center:[],halfSize:[],quaternion:[]};return await Nj(n,r,i,async()=>(await this.nodePages.push({index:0,obb:s},a)).index,o,this.featuresHashArray,(l=this.layers0)==null?void 0:l.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),fo.updateAll(p,h),o&&fo.updateMaterialByNodeId(p,this._findOrCreateMaterial(o)),s){let y=s.image.height*s.image.width;fo.updateTexelCountHintByNodeId(p,y)}return u&&(this.vertexCounter+=u,fo.updateVertexCountByNodeId(p,u)),fo.updateNodeAttributeByNodeId(p),l&&fo.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,Da.join)(this.layers0Path,"nodes",r),l=(0,Da.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,Da.join)(i,"geometries");await this.writeQueue.enqueue({archiveKey:`${n}/geometries/0.bin.gz`,writePromise:()=>bl(a,t,"0.bin")})}else{let a=(0,Da.join)(i,"geometries/0/");await this.writeQueue.enqueue({writePromise:()=>Un(a,t,"index.bin")})}if(this.options.draco)if(this.options.slpk){let a=(0,Da.join)(i,"geometries");await this.writeQueue.enqueue({archiveKey:`${n}/geometries/1.bin.gz`,writePromise:()=>bl(a,r,"1.bin")})}else{let a=(0,Da.join)(i,"geometries/1/");await this.writeQueue.enqueue({writePromise:()=>Un(a,r,"index.bin")})}}async _writeShared(t,r,i,n){if(!t)return;t.nodePath=n;let a=(0,L2.default)(t,Hpe()),o=JSON.stringify(a);if(this.options.slpk){let s=(0,Da.join)(r,"shared");await this.writeQueue.enqueue({archiveKey:`${i}/shared/sharedResource.json.gz`,writePromise:()=>bl(s,o,"sharedResource.json")})}else{let s=(0,Da.join)(r,"shared/");await this.writeQueue.enqueue({writePromise:()=>Un(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=Tm(Je(ae({},t.image),{data:u}),fS,Je(ae({},fS.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=Tm(t.image.data[0],HO);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,Da.join)(n,"textures"),s=!1;await this.writeQueue.enqueue({archiveKey:`${a}/textures/${r}.${i}`,writePromise:()=>bl(o,t,`${r}.${i}`,s)})}else{let o=(0,Da.join)(n,`textures/${r}/`);await this.writeQueue.enqueue({writePromise:()=>Un(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,Da.join)(r,"attributes",s);await this.writeQueue.enqueue({archiveKey:`${i}/attributes/${s}.bin.gz`,writePromise:()=>bl(l,u,"0.bin")})}else{let l=(0,Da.join)(r,`attributes/${s}/0`);await this.writeQueue.enqueue({writePromise:()=>Un(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,eL.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,eL.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=ae({OBJECTID:[0]},t);for(let n in i){let a=i[n][0],o=spe(n,a),s=upe(r,n,o),u=lpe(o),l=cpe(n,u),c=fpe(i);this.layers0.attributeStorageInfo.push(s),this.layers0.fields.push(l),this.layers0.popupInfo=c,this.layers0.layerType=lut,r+=1}}async _finishConversion(t){let{tilesCount:r,tilesWithAddRefineCount:i}=this.refinementCounter,n=i?i/r*100:0,a=await I2(t),o=bp.default.hrtime(this.conversionStartTime),s=C2(o);console.log("------------------------------------------------"),console.log(`Finishing conversion of ${uut}`),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||sut}},r=await this.Loader.preload(this.options.inputUrl,t);return this.refreshTokenTime=bp.default.hrtime(),ae(ae({},t),r)}async _updateTilesetOptions(){if(bp.default.hrtime(this.refreshTokenTime)[0]<cut)return;this.refreshTokenTime=bp.default.hrtime();let r=await this._fetchPreloadOptions();r.headers&&(this.loadOptions.fetch=Je(ae({},this.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){return["b3dm","glTF","scenegraph"].includes(t.type||"")}async loadWorkers(){if(console.log("Loading workers source..."),this.options.draco){let n=Ys(Ly,ae({},wo())),o=await(await ea(n)).text();this.workerSource.draco=o}if(this.generateTextures){let n=Ys(fS,ae({},wo())),o=await(await ea(n)).text();this.workerSource.ktx2=o}let t=Ys($pe,ae({},wo())),i=await(await ea(t)).text();this.workerSource.I3SAttributes=i,console.log("Loading workers source completed!")}};var Ime=Fe(require("path")),sL=Fe(require("process")),Pme=Fe(su());var R0=Fe(rme());var ga;(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"})(ga||(ga={}));var r_;(function(r){r.vertexCount="vertexCount",r.featureCount="featureCount"})(r_||(r_={}));function rL(e){switch(e){case ga.UInt8:return Uint8Array;case ga.UInt16:return Uint16Array;case ga.UInt32:return Uint32Array;case ga.Float32:return Float32Array;case ga.UInt64:return Float64Array;default:throw new Error(`parse i3s tile content: unknown type of data: ${e}`)}}var ime={UInt8:R0.default.UNSIGNED_BYTE,UInt16:R0.default.UNSIGNED_SHORT,Float32:R0.default.FLOAT,UInt32:R0.default.UNSIGNED_INT,UInt64:R0.default.DOUBLE};function C0(e){switch(e){case ga.UInt8:return 1;case ga.UInt16:case ga.Int16:return 2;case ga.UInt32:case ga.Int32:case ga.Float32:return 4;case ga.UInt64:case ga.Int64:case ga.Float64:return 8;default:throw new Error(`parse i3s tile content: unknown size of data: ${e}`)}}var nme="String",ame="Oid32",ome="Float64",sme="Int16",gu;(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"})(gu||(gu={}));var Fh=Fe(dr()),q2=Fe(Ra());function Dh(e,t=null){return t?`${e}?token=${t}`:e}function ume(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 lme(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}function cme(e,t){let{attributeName:r,attributeType:i}=t;return r?{[r]:i?dut(i,e):null}:{}}function dut(e,t){switch(e){case nme:return gut(t);case ame:return fme(t);case ome:return mut(t);case sme:return put(t);default:return fme(t)}}function fme(e){let t=4;return new Uint32Array(e,t)}function put(e){let t=4;return new Int16Array(e,t)}function mut(e){let t=8;return new Float64Array(e,t)}function gut(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 vut="4.0.0-alpha.9";var i_={name:"I3S Attribute",id:"i3s-attribute",module:"i3s",version:vut,mimeTypes:["application/binary"],parse:async(e,t)=>cme(e,t),extensions:["bin"],options:{},binary:!0};function hme(e){return e.hasOwnProperty("objectIds")?"Oid32":e.hasOwnProperty("attributeValues")?e.attributeValues.valueType:""}async function dme(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 pme(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 pme(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]]=yut(o[a.name][f],n);for(let f=0;f<t.value.length;f++){let h=l[t.value[f]];!h||(n.i3s.colorsByAttribute.mode==="multiply"?h.forEach((d,p)=>{e.value[f*4+p]=e.value[f*4+p]*d/255}):e.value.set(h,f*4))}return e}function yut(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 pme(e,{attributeUrls:t},{attributeStorageInfo:r},i){var u;let n=r.findIndex(({name:l})=>e===l);if(n===-1)return null;let a=Dh(t[n],(u=i==null?void 0:i.i3s)==null?void 0:u.token),o=hme(r[n]);return await Wr(a,i_,{attributeName:e,attributeType:o})}var U2=new Fh.Vector3([0,0,0]);function but(e){switch(e){case"ktx-etc2":case"dds":return cS;case"ktx2":return Ed;case"jpg":case"png":default:return rg}}var _ut="i3s-attribute-type";async function mme(e,t,r,i,n){var o;let a={attributes:{},indices:null,featureIds:[],vertexCount:0,modelMatrix:new Fh.Matrix4,coordinateSystem:0,byteLength:0,texture:null};if(t.textureUrl){let s=Dh(t.textureUrl,(o=i==null?void 0:i.i3s)==null?void 0:o.token),u=but(t.textureFormat),c=await(await fetch(s,i==null?void 0:i.fetch)).arrayBuffer();if(i==null?void 0:i.i3s.decodeTextures){if(u===rg){let f=Je(ae({},t.textureLoaderOptions),{image:{type:"data"}});try{a.texture=await n.parse(c,f)}catch{a.texture=await Eo(c,u,f)}}else if(u===cS||u===Ed){let f=await Wr(c,u,t.textureLoaderOptions);u===Ed&&(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=Cut(t.materialDefinition,a.texture),a.material&&(a.texture=null),await xut(e,a,t,r,i)}async function xut(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 Eo(e,$m,{draco:{attributeNameEntry:_ut}});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"]:T}=d.attributes;o={position:p,normal:y,color:g,uv0:b,uvRegion:T,id:E},wut(o,d);let k=But(E);k&&Out(o,k)}else{let{vertexAttributes:d,ordering:p,featureAttributes:y,featureAttributeOrder:g}=i.store.defaultGeometrySchema,b=Sut(e,i);u=b.byteOffset,s=b.vertexCount,l=b.featureCount;let{attributes:E,byteOffset:T}=vme(e,u,d,s,p),{attributes:k}=vme(e,T,y,l,g);Put(k),o=Eut(E,k)}if(!((h=n==null?void 0:n.i3s)==null?void 0:h.coordinateSystem)||n.i3s.coordinateSystem===gu.METER_OFFSETS){let d=Tut(o.position,r);t.modelMatrix=d.invert(),t.coordinateSystem=gu.METER_OFFSETS}else t.modelMatrix=Rut(o.position),t.coordinateSystem=gu.LNGLAT_OFFSETS;o.color=await dme(o.color,o.id,r,i,n),t.attributes={positions:o.position,normals:o.normal,colors:gme(o.color),texCoords:o.uv0,uvRegions:gme(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 wut(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 Eut(e,t){return ae(ae({},e),t)}function gme(e){return e&&(e.normalized=!0,e)}function Sut(e,t){let r=0,i=0,n=0;for(let{property:a,type:o}of t.store.defaultGeometrySchema.header){let s=rL(o);switch(a){case r_.vertexCount:i=new s(e,0,4)[0],r+=C0(o);break;case r_.featureCount:n=new s(e,4,4)[0],r+=C0(o);break;default:break}}return{vertexCount:i,featureCount:n,byteOffset:r}}function vme(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*C0(s)<=e.byteLength){let l=e.slice(t),c;if(s==="UInt64")c=Aut(l,i*u,C0(s));else{let f=rL(s);c=new f(l,0,i*u)}switch(a[o]={value:c,type:ime[s],size:u},o){case"color":a.color.normalized=!0;break;case"position":case"region":case"normal":default:}t=t+i*u*C0(s)}else if(o!=="uv0")break}return{attributes:a,byteOffset:t}}function Aut(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 Tut(e,t){let r=t.mbs,i=e.value,n=e.metadata,a=new Fh.Matrix4,o=new Fh.Vector3(r[0],r[1],r[2]),s=new Fh.Vector3;return q2.Ellipsoid.WGS84.cartographicToCartesian(o,s),q2.Ellipsoid.WGS84.eastNorthUpToFixedFrame(s,a),e.value=kut(i,n,o),a}function kut(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)q2.Ellipsoid.WGS84.cartographicToCartesian(i.subarray(o,o+3),U2),i[o]=U2.x,i[o+1]=U2.y,i[o+2]=U2.z;return i}function Rut(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 Fh.Matrix4;return n[0]=r,n[5]=i,n}function Cut(e,t){let r;return e?r=Je(ae({},e),{pbrMetallicRoughness:e.pbrMetallicRoughness?ae({},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=yme(r.emissiveFactor)),r.pbrMetallicRoughness&&r.pbrMetallicRoughness.baseColorFactor&&(r.pbrMetallicRoughness.baseColorFactor=yme(r.pbrMetallicRoughness.baseColorFactor)),t&&Iut(r,t),r}function yme(e){let t=[...e];for(let r=0;r<e.length;r++)t[r]=e[r]/255;return t}function Iut(e,t){let r={source:{image:t}};e.pbrMetallicRoughness&&e.pbrMetallicRoughness.baseColorTexture?e.pbrMetallicRoughness.baseColorTexture=Je(ae({},e.pbrMetallicRoughness.baseColorTexture),{texture:r}):e.emissiveTexture?e.emissiveTexture=Je(ae({},e.emissiveTexture),{texture:r}):e.pbrMetallicRoughness&&e.pbrMetallicRoughness.metallicRoughnessTexture?e.pbrMetallicRoughness.metallicRoughnessTexture=Je(ae({},e.pbrMetallicRoughness.metallicRoughnessTexture),{texture:r}):e.normalTexture?e.normalTexture=Je(ae({},e.normalTexture),{texture:r}):e.occlusionTexture&&(e.occlusionTexture=Je(ae({},e.occlusionTexture),{texture:r}))}function Put(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 Out(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 But(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 Dut="4.0.0-alpha.9",bme={name:"I3S Content (Indexed Scene Layers)",id:"i3s-content",module:"i3s",worker:!0,version:Dut,mimeTypes:["application/octet-stream"],parse:Fut,extensions:["bin"],options:{"i3s-content":{}}};async function Fut(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 mme(e,s,u,t,r)}var xme=Fe(Zu()),nL=Fe(Ra());var Mut="4.0.0-alpha.9";async function jut(e,t){return JSON.parse(new TextDecoder().decode(e))}var _me={name:"I3S Node Page",id:"i3s-node-page",module:"i3s",version:Mut,mimeTypes:["application/json"],parse:jut,extensions:["json"],options:{}};var G2=class{constructor(t,r){this.nodePages=[];this.pendingNodePages=[];this.textureDefinitionsSelectedFormats=[];this.textureLoaderOptions={};var i,n;this.tileset=ae({},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=Dh(`${this.tileset.url}/nodepages/${r}`,(n=this.options.i3s)==null?void 0:n.token);this.pendingNodePages[r]={status:"Pending",promise:Wr(a,_me,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=lme(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:ag(),containerFormat:"ktx2",module:"encoder"}),this.textureDefinitionsSelectedFormats.push(o)}}getSupportedTextureFormats(){let t=[];if(!this.options.i3s||this.options.i3s.useCompressedTextures){let r=Gy();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 wme(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=ume(r,e)),iL(Je(ae({},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=[...nL.Ellipsoid.WGS84.cartographicToCartesian(e.mbs.slice(0,3)),e.mbs[3]];else if(e.obb){t.box=[...nL.Ellipsoid.WGS84.cartographicToCartesian(e.obb.center),...e.obb.halfSize,...e.obb.quaternion];let f=new xme.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=tl.MESH,s=ta.REPLACE;return Je(ae({},e),{mbs:r,boundingVolume:t,lodMetricType:i,lodMetricValue:n,transformMatrix:a,type:o,refine:s})}async function Eme(e,t,r){var i;if(e.url=r.url,e.nodePages)e.nodePagesTile=new G2(e,t),e.root=e.nodePagesTile.formTileFromNodePages(0);else{let n=Dh(`${e.url}/nodes/root`,(i=t.i3s)==null?void 0:i.token);e.root=await Wr(n,e.loader,Je(ae({},t),{i3s:Je(ae({},t.i3s),{loadContent:!1,isTileHeader:!0,isTileset:!1})}))}e.basePath=e.url,e.type=En.I3S,e.lodMetricType=e.root.lodMetricType,e.lodMetricValue=e.root.lodMetricValue}var Lut="4.0.0-alpha.9",Nut=/layers\/[0-9]+$/,qut=/nodes\/([0-9-]+|root)$/,Uut="504b0304",Gut="PointCloud",z2={name:"I3S (Indexed Scene Layers)",id:"i3s",module:"i3s",version:Lut,mimeTypes:["application/octet-stream"],parse:zut,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:gu.METER_OFFSETS,colorsByAttribute:null}}};async function zut(e,t={},r){let i=r.url;if(t.i3s=t.i3s||{},Kut(e)===Uut)throw new Error("Files with .slpk extention currently are not supported by I3SLoader");let a;t.i3s.isTileset==="auto"?a=Nut.test(i):a=t.i3s.isTileset;let o;return t.isTileHeader==="auto"?o=qut.test(i):o=t.i3s.isTileHeader,a?e=await Wut(e,t,r):o?e=await Vut(e,r):e=await Hut(e,t),e}async function Hut(e,t){return await Eo(e,bme,t)}async function Wut(e,t,r){let i=JSON.parse(new TextDecoder().decode(e));if((i==null?void 0:i.layerType)===Gut)throw new Error("Point Cloud layers currently are not supported by I3SLoader");return i.loader=z2,await Eme(i,t,r),i}async function Vut(e,t){return e=JSON.parse(new TextDecoder().decode(e)),wme(e,t)}function Kut(e){return e instanceof ArrayBuffer?[...new Uint8Array(e,0,4)].map(t=>t.toString(16).padStart(2,"0")).join(""):null}var Sme=Fe(dr()),Ame=Fe(Ra()),Tme=Fe(Zu());function aL(e,t){let r=[e.center[0],e.center[1],e.center[2]+t.getHeight(e.center[1],e.center[0])],i=Ame.Ellipsoid.WGS84.cartographicToCartesian(r,new Sme.Vector3),n=new Tme.OrientedBoundingBox().fromCenterHalfSizeQuaternion(i,e.halfSize,e.quaternion);return[...n.center,...n.halfAxes.toArray()]}var H2=Fe(su()),Yut=()=>({version:{path:"version",default:"1.0"}}),kme=()=>({boundingVolume:{path:"boundingVolume"},geometricError:{path:"geometricError"},content:{path:"content"},children:{path:"children",transform:e=>e.map(t=>(0,H2.default)(t,kme()))}}),Rme=()=>({asset:{path:"asset",transform:e=>(0,H2.default)(e,Yut())},geometricError:{path:"root",transform:e=>e.geometricError},root:{path:"root",transform:e=>(0,H2.default)(e,kme())}});var $ut="4.0.0-alpha.9",oL={id:"3d-tiles-attributes",name:"3DTiles Attributes Worker",module:"tile-converter",version:$ut,options:{featureAttributes:null}};function Cme(e,t){return Qv(oL,e,t)}var Xut="I3S",n_=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(on)return console.log(k0),k0;let{inputUrl:r,outputPath:i,tilesetName:n,maxDepth:a,egmFilePath:o}=t;this.conversionStartTime=sL.default.hrtime(),this.options={maxDepth:a},console.log("Loading egm file..."),this.geoidHeightModel=await Wr(o,F2),console.log("Loading egm file completed!"),await this.loadWorkers();let s=await Wr(r,z2,{});this.sourceTileset=new XE(s,{loadOptions:{_nodeWorkers:!0,reuseWorkers:!0,i3s:{coordinateSystem:gu.LNGLAT_OFFSETS,decodeTextures:!1}}}),await this.sourceTileset.tilesetInitializationPromise;let u=this.sourceTileset.root;u.header.obb||(u.header.obb=Fj(u.header.mbs)),this.tilesetPath=(0,Ime.join)(`${i}`,`${n}`),this.attributeStorageInfo=s.attributeStorageInfo;try{await Y1(this.tilesetPath)}catch{}let l={boundingVolume:{box:aL(u.header.obb,this.geoidHeightModel)},geometricError:Uj(u),children:[]};await this._addChildren(u,l,1);let c=(0,Pme.default)({root:l},Rme());await Un(this.tilesetPath,JSON.stringify(c),"tileset.json"),this._finishConversion({slpk:!1,outputPath:i,tilesetName:n}),_n.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=Fj(a.header.mbs));let u={box:aL(a.header.obb,this.geoidHeightModel)},l={boundingVolume:u,geometricError:Uj(a),children:[]},c={tileContent:a.content,textureFormat:(o=a==null?void 0:a.header)==null?void 0:o.textureFormat},f=await Cme(c,{source:this.workerSource.tile3dWorkerSource,featureAttributes:s});l.content={uri:`${a.id}.b3dm`,boundingVolume:u},await Un(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:Je(ae({},this.sourceTileset.loadOptions),{isTileHeader:!0,loadContent:!1})};console.log(`Node conversion: ${a}`),i=await Wr(a,n,o)}return new sc(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(Wr(s,i_,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 I2(t),i=sL.default.hrtime(this.conversionStartTime),n=C2(i);console.log("------------------------------------------------"),console.log(`Finish conversion of ${Xut}`),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=Ys(oL,ae({},wo())),i=await(await ea(t)).text();this.workerSource.tile3dWorkerSource=i,console.log("Loading workers source completed!")}};var Ome=Fe(Oj()),Jut="4.0.0-alpha.9",uL={id:"zip",module:"zip",name:"Zip Archive",version:Jut,extensions:["zip"],mimeTypes:["application/zip"],category:"archive",tests:["PK"],options:{},parse:Qut};async function Qut(e,t={}){let r=[],i={};try{let n=new Ome.default;return(await n.loadAsync(e,t)).forEach((o,s)=>{let u=s.name,l=Zut(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 Zut(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 lL=Fe(require("path"));var elt="4.0.0-alpha.9",tlt="https://raw.githubusercontent.com/visgl/deck.gl-data/master/egm/egm2008-5.zip",cL=class{async install(t="",r=""){console.log('Installing "EGM2008-5" model...');let i=await Wr(tlt,uL,{}),n=process.cwd();t&&(n=(0,lL.join)(n,t)),await Un(n,new Uint8Array(i["geoids/egm2008-5.pgm"]),"egm2008-5.pgm"),console.log('Installing "I3S Content Loader worker"'),await this.installWorker("i3s","i3s-content-worker-node.js",r),console.log('Installing "Draco Loader worker"'),await this.installWorker("draco","draco-worker-node.js",r),console.log('Installing "Basis Loader worker"'),await this.installWorker("textures","basis-worker-node.js",r),console.log('Installing "join-images" npm package'),await new bf().start({command:"npm",arguments:["install","sharp@0.30.4","join-images@1.1.3"],wait:0,ignoreStderr:!0}),console.log("All dependencies were installed succesfully.")}async installWorker(t,r,i){let a=await(await ea(`https://unpkg.com/@loaders.gl/${t}@${elt}/dist/${r}`)).arrayBuffer();if(!a)return;let o=(0,lL.join)(process.cwd(),i,"modules",t,"dist");await Un(o,a,r)}};var fL={I3S:"I3S",_3DTILES:"3DTILES"};async function rlt(){let[,,...e]=process.argv;e.length===0&&hL();let t=alt(e),r=olt(t);if(r.installDependencies){new cL().install("deps");return}let i=nlt(r);await ilt(i)}rlt().catch(e=>{console.log(e),process.exit(1)});function hL(){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 ilt(e){switch(console.log("------------------------------------------------"),console.log(`Starting conversion of ${e.inputType}`),console.log("------------------------------------------------"),e.inputType.toUpperCase()){case fL.I3S:new n_().convert({inputUrl:e.tileset,outputPath:e.output,tilesetName:e.name,maxDepth:e.maxDepth,egmFilePath:e.egm});break;case fL._3DTILES:await new t_().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:hL()}}function nlt(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(fL).includes(n.toUpperCase());(!n||a)&&r.push(t[i])}return r.length&&(r.forEach(i=>i()),process.exit(1)),e}function alt(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 olt(e){let t={output:"data",instantNodeWriting:!1,mergeMaterials:!0,sevenZipExe:"C:\\Program Files\\7-Zip\\7z.exe",egm:(0,Bme.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=Fc(i,e);break;case"--tileset":t.tileset=slt(i,e);break;case"--name":t.name=Fc(i,e);break;case"--output":t.output=Fc(i,e);break;case"--instant-node-writing":t.instantNodeWriting=Mh(i,e);break;case"--split-nodes":t.mergeMaterials=Mh(i,e);break;case"--max-depth":t.maxDepth=ult(i,e);break;case"--slpk":t.slpk=Mh(i,e);break;case"--7zExe":t.sevenZipExe=Fc(i,e);break;case"--egm":t.egm=Fc(i,e);break;case"--token":t.token=Fc(i,e);break;case"--no-draco":t.draco=Mh(i,e);break;case"--validate":t.validate=Mh(i,e);break;case"--install-dependencies":t.installDependencies=Mh(i,e);break;case"--generate-textures":t.generateTextures=Mh(i,e);break;case"--generate-bounding-volumes":t.generateBoundingVolumes=Mh(i,e);break;case"--help":hL();break;default:console.warn(`Unknown option ${r}`),process.exit(0)}}),t}function Fc(e,t){if(e+1>=t.length)return"";let r=t[e+1];return r.indexOf("--")===0?"":r}function slt(e,t){let r=Fc(e,t);return console.log(`Input tileset value: ${r}`),console.log(`Modified tileset value: ${r.replace(/\\/g,"/")}`),r.replace(/\\/g,"/")}function ult(e,t){let r=Fc(e,t),i=Number.parseInt(r);return isFinite(i)?i:NaN}function Mh(e,t){let r=Fc(e,t).toLowerCase().trim();return["--no-draco","--split-nodes"].includes(t[e])&&!r?!1:!r||r==="true"}
|
|
124
124
|
/*!
|
|
125
125
|
* Copyright 2010 LearnBoost <dev@learnboost.com>
|
|
126
126
|
*
|