mx3d 2024.1.22 → 2024.5.28
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/mx3d.min.js +1 -1
- package/package.json +1 -1
package/mx3d.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("Runtime")):"function"==typeof define&&define.amd?define("MX3D",["Runtime"],t):"object"==typeof exports?exports.MX3D=t(require("Runtime")):e.MX3D=t(e.Runtime)}(self,(e=>(()=>{var t={452:function(e,t,i){var n;e.exports=(n=i(249),i(269),i(214),i(888),i(109),function(){var e=n,t=e.lib.BlockCipher,i=e.algo,s=[],r=[],o=[],a=[],c=[],h=[],l=[],u=[],d=[],f=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var i=0,n=0;for(t=0;t<256;t++){var p=n^n<<1^n<<2^n<<3^n<<4;p=p>>>8^255&p^99,s[i]=p,r[p]=i;var m=e[i],g=e[m],A=e[g],y=257*e[p]^16843008*p;o[i]=y<<24|y>>>8,a[i]=y<<16|y>>>16,c[i]=y<<8|y>>>24,h[i]=y,y=16843009*A^65537*g^257*m^16843008*i,l[p]=y<<24|y>>>8,u[p]=y<<16|y>>>16,d[p]=y<<8|y>>>24,f[p]=y,i?(i=m^e[e[e[A^m]]],n^=e[e[n]]):i=n=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],m=i.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,i=e.sigBytes/4,n=4*((this._nRounds=i+6)+1),r=this._keySchedule=[],o=0;o<n;o++)o<i?r[o]=t[o]:(h=r[o-1],o%i?i>6&&o%i==4&&(h=s[h>>>24]<<24|s[h>>>16&255]<<16|s[h>>>8&255]<<8|s[255&h]):(h=s[(h=h<<8|h>>>24)>>>24]<<24|s[h>>>16&255]<<16|s[h>>>8&255]<<8|s[255&h],h^=p[o/i|0]<<24),r[o]=r[o-i]^h);for(var a=this._invKeySchedule=[],c=0;c<n;c++){if(o=n-c,c%4)var h=r[o];else h=r[o-4];a[c]=c<4||o<=4?h:l[s[h>>>24]]^u[s[h>>>16&255]]^d[s[h>>>8&255]]^f[s[255&h]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,o,a,c,h,s)},decryptBlock:function(e,t){var i=e[t+1];e[t+1]=e[t+3],e[t+3]=i,this._doCryptBlock(e,t,this._invKeySchedule,l,u,d,f,r),i=e[t+1],e[t+1]=e[t+3],e[t+3]=i},_doCryptBlock:function(e,t,i,n,s,r,o,a){for(var c=this._nRounds,h=e[t]^i[0],l=e[t+1]^i[1],u=e[t+2]^i[2],d=e[t+3]^i[3],f=4,p=1;p<c;p++){var m=n[h>>>24]^s[l>>>16&255]^r[u>>>8&255]^o[255&d]^i[f++],g=n[l>>>24]^s[u>>>16&255]^r[d>>>8&255]^o[255&h]^i[f++],A=n[u>>>24]^s[d>>>16&255]^r[h>>>8&255]^o[255&l]^i[f++],y=n[d>>>24]^s[h>>>16&255]^r[l>>>8&255]^o[255&u]^i[f++];h=m,l=g,u=A,d=y}m=(a[h>>>24]<<24|a[l>>>16&255]<<16|a[u>>>8&255]<<8|a[255&d])^i[f++],g=(a[l>>>24]<<24|a[u>>>16&255]<<16|a[d>>>8&255]<<8|a[255&h])^i[f++],A=(a[u>>>24]<<24|a[d>>>16&255]<<16|a[h>>>8&255]<<8|a[255&l])^i[f++],y=(a[d>>>24]<<24|a[h>>>16&255]<<16|a[l>>>8&255]<<8|a[255&u])^i[f++],e[t]=m,e[t+1]=g,e[t+2]=A,e[t+3]=y},keySize:8});e.AES=t._createHelper(m)}(),n.AES)},109:function(e,t,i){var n;e.exports=(n=i(249),i(888),void(n.lib.Cipher||function(e){var t=n,i=t.lib,s=i.Base,r=i.WordArray,o=i.BufferedBlockAlgorithm,a=t.enc,c=(a.Utf8,a.Base64),h=t.algo.EvpKDF,l=i.Cipher=o.extend({cfg:s.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,i){this.cfg=this.cfg.extend(i),this._xformMode=e,this._key=t,this.reset()},reset:function(){o.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?b:A}return function(t){return{encrypt:function(i,n,s){return e(n).encrypt(t,i,n,s)},decrypt:function(i,n,s){return e(n).decrypt(t,i,n,s)}}}}()}),u=(i.StreamCipher=l.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),t.mode={}),d=i.BlockCipherMode=s.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),f=u.CBC=function(){var t=d.extend();function i(t,i,n){var s,r=this._iv;r?(s=r,this._iv=e):s=this._prevBlock;for(var o=0;o<n;o++)t[i+o]^=s[o]}return t.Encryptor=t.extend({processBlock:function(e,t){var n=this._cipher,s=n.blockSize;i.call(this,e,t,s),n.encryptBlock(e,t),this._prevBlock=e.slice(t,t+s)}}),t.Decryptor=t.extend({processBlock:function(e,t){var n=this._cipher,s=n.blockSize,r=e.slice(t,t+s);n.decryptBlock(e,t),i.call(this,e,t,s),this._prevBlock=r}}),t}(),p=(t.pad={}).Pkcs7={pad:function(e,t){for(var i=4*t,n=i-e.sigBytes%i,s=n<<24|n<<16|n<<8|n,o=[],a=0;a<n;a+=4)o.push(s);var c=r.create(o,n);e.concat(c)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},m=(i.BlockCipher=l.extend({cfg:l.cfg.extend({mode:f,padding:p}),reset:function(){var e;l.reset.call(this);var t=this.cfg,i=t.iv,n=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=n.createEncryptor:(e=n.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,i&&i.words):(this._mode=e.call(n,this,i&&i.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4}),i.CipherParams=s.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}})),g=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,i=e.salt;return(i?r.create([1398893684,1701076831]).concat(i).concat(t):t).toString(c)},parse:function(e){var t,i=c.parse(e),n=i.words;return 1398893684==n[0]&&1701076831==n[1]&&(t=r.create(n.slice(2,4)),n.splice(0,4),i.sigBytes-=16),m.create({ciphertext:i,salt:t})}},A=i.SerializableCipher=s.extend({cfg:s.extend({format:g}),encrypt:function(e,t,i,n){n=this.cfg.extend(n);var s=e.createEncryptor(i,n),r=s.finalize(t),o=s.cfg;return m.create({ciphertext:r,key:i,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,i,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),e.createDecryptor(i,n).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),y=(t.kdf={}).OpenSSL={execute:function(e,t,i,n){n||(n=r.random(8));var s=h.create({keySize:t+i}).compute(e,n),o=r.create(s.words.slice(t),4*i);return s.sigBytes=4*t,m.create({key:s,iv:o,salt:n})}},b=i.PasswordBasedCipher=A.extend({cfg:A.cfg.extend({kdf:y}),encrypt:function(e,t,i,n){var s=(n=this.cfg.extend(n)).kdf.execute(i,e.keySize,e.ivSize);n.iv=s.iv;var r=A.encrypt.call(this,e,t,s.key,n);return r.mixIn(s),r},decrypt:function(e,t,i,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var s=n.kdf.execute(i,e.keySize,e.ivSize,t.salt);return n.iv=s.iv,A.decrypt.call(this,e,t,s.key,n)}})}()))},249:function(e,t,i){var n;e.exports=(n=n||function(e,t){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==i.g&&i.g.crypto&&(n=i.g.crypto),!n)try{n=i(480)}catch(e){}var s=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},r=Object.create||function(){function e(){}return function(t){var i;return e.prototype=t,i=new e,e.prototype=null,i}}(),o={},a=o.lib={},c=a.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},h=a.WordArray=c.extend({init:function(e,i){e=this.words=e||[],this.sigBytes=i!=t?i:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,i=e.words,n=this.sigBytes,s=e.sigBytes;if(this.clamp(),n%4)for(var r=0;r<s;r++){var o=i[r>>>2]>>>24-r%4*8&255;t[n+r>>>2]|=o<<24-(n+r)%4*8}else for(var a=0;a<s;a+=4)t[n+a>>>2]=i[a>>>2];return this.sigBytes+=s,this},clamp:function(){var t=this.words,i=this.sigBytes;t[i>>>2]&=4294967295<<32-i%4*8,t.length=e.ceil(i/4)},clone:function(){var e=c.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],i=0;i<e;i+=4)t.push(s());return new h.init(t,e)}}),l=o.enc={},u=l.Hex={stringify:function(e){for(var t=e.words,i=e.sigBytes,n=[],s=0;s<i;s++){var r=t[s>>>2]>>>24-s%4*8&255;n.push((r>>>4).toString(16)),n.push((15&r).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,i=[],n=0;n<t;n+=2)i[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new h.init(i,t/2)}},d=l.Latin1={stringify:function(e){for(var t=e.words,i=e.sigBytes,n=[],s=0;s<i;s++){var r=t[s>>>2]>>>24-s%4*8&255;n.push(String.fromCharCode(r))}return n.join("")},parse:function(e){for(var t=e.length,i=[],n=0;n<t;n++)i[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new h.init(i,t)}},f=l.Utf8={stringify:function(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return d.parse(unescape(encodeURIComponent(e)))}},p=a.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new h.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var i,n=this._data,s=n.words,r=n.sigBytes,o=this.blockSize,a=r/(4*o),c=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*o,l=e.min(4*c,r);if(c){for(var u=0;u<c;u+=o)this._doProcessBlock(s,u);i=s.splice(0,c),n.sigBytes-=l}return new h.init(i,l)},clone:function(){var e=c.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),m=(a.Hasher=p.extend({cfg:c.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,i){return new e.init(i).finalize(t)}},_createHmacHelper:function(e){return function(t,i){return new m.HMAC.init(e,i).finalize(t)}}}),o.algo={});return o}(Math),n)},269:function(e,t,i){var n;e.exports=(n=i(249),function(){var e=n,t=e.lib.WordArray;function i(e,i,n){for(var s=[],r=0,o=0;o<i;o++)if(o%4){var a=n[e.charCodeAt(o-1)]<<o%4*2|n[e.charCodeAt(o)]>>>6-o%4*2;s[r>>>2]|=a<<24-r%4*8,r++}return t.create(s,r)}e.enc.Base64={stringify:function(e){var t=e.words,i=e.sigBytes,n=this._map;e.clamp();for(var s=[],r=0;r<i;r+=3)for(var o=(t[r>>>2]>>>24-r%4*8&255)<<16|(t[r+1>>>2]>>>24-(r+1)%4*8&255)<<8|t[r+2>>>2]>>>24-(r+2)%4*8&255,a=0;a<4&&r+.75*a<i;a++)s.push(n.charAt(o>>>6*(3-a)&63));var c=n.charAt(64);if(c)for(;s.length%4;)s.push(c);return s.join("")},parse:function(e){var t=e.length,n=this._map,s=this._reverseMap;if(!s){s=this._reverseMap=[];for(var r=0;r<n.length;r++)s[n.charCodeAt(r)]=r}var o=n.charAt(64);if(o){var a=e.indexOf(o);-1!==a&&(t=a)}return i(e,t,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),n.enc.Base64)},786:function(e,t,i){var n;e.exports=(n=i(249),function(){var e=n,t=e.lib.WordArray;function i(e,i,n){for(var s=[],r=0,o=0;o<i;o++)if(o%4){var a=n[e.charCodeAt(o-1)]<<o%4*2|n[e.charCodeAt(o)]>>>6-o%4*2;s[r>>>2]|=a<<24-r%4*8,r++}return t.create(s,r)}e.enc.Base64url={stringify:function(e,t=!0){var i=e.words,n=e.sigBytes,s=t?this._safe_map:this._map;e.clamp();for(var r=[],o=0;o<n;o+=3)for(var a=(i[o>>>2]>>>24-o%4*8&255)<<16|(i[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|i[o+2>>>2]>>>24-(o+2)%4*8&255,c=0;c<4&&o+.75*c<n;c++)r.push(s.charAt(a>>>6*(3-c)&63));var h=s.charAt(64);if(h)for(;r.length%4;)r.push(h);return r.join("")},parse:function(e,t=!0){var n=e.length,s=t?this._safe_map:this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var o=0;o<s.length;o++)r[s.charCodeAt(o)]=o}var a=s.charAt(64);if(a){var c=e.indexOf(a);-1!==c&&(n=c)}return i(e,n,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"}}(),n.enc.Base64url)},298:function(e,t,i){var n;e.exports=(n=i(249),function(){var e=n,t=e.lib.WordArray,i=e.enc;function s(e){return e<<8&4278255360|e>>>8&16711935}i.Utf16=i.Utf16BE={stringify:function(e){for(var t=e.words,i=e.sigBytes,n=[],s=0;s<i;s+=2){var r=t[s>>>2]>>>16-s%4*8&65535;n.push(String.fromCharCode(r))}return n.join("")},parse:function(e){for(var i=e.length,n=[],s=0;s<i;s++)n[s>>>1]|=e.charCodeAt(s)<<16-s%2*16;return t.create(n,2*i)}},i.Utf16LE={stringify:function(e){for(var t=e.words,i=e.sigBytes,n=[],r=0;r<i;r+=2){var o=s(t[r>>>2]>>>16-r%4*8&65535);n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var i=e.length,n=[],r=0;r<i;r++)n[r>>>1]|=s(e.charCodeAt(r)<<16-r%2*16);return t.create(n,2*i)}}}(),n.enc.Utf16)},888:function(e,t,i){var n,s,r,o,a,c,h,l;e.exports=(l=i(249),i(783),i(824),s=(n=l).lib,r=s.Base,o=s.WordArray,a=n.algo,c=a.MD5,h=a.EvpKDF=r.extend({cfg:r.extend({keySize:4,hasher:c,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var i,n=this.cfg,s=n.hasher.create(),r=o.create(),a=r.words,c=n.keySize,h=n.iterations;a.length<c;){i&&s.update(i),i=s.update(e).finalize(t),s.reset();for(var l=1;l<h;l++)i=s.finalize(i),s.reset();r.concat(i)}return r.sigBytes=4*c,r}}),n.EvpKDF=function(e,t,i){return h.create(i).compute(e,t)},l.EvpKDF)},209:function(e,t,i){var n,s,r,o;e.exports=(o=i(249),i(109),s=(n=o).lib.CipherParams,r=n.enc.Hex,n.format.Hex={stringify:function(e){return e.ciphertext.toString(r)},parse:function(e){var t=r.parse(e);return s.create({ciphertext:t})}},o.format.Hex)},824:function(e,t,i){var n,s,r,o;e.exports=(n=i(249),r=(s=n).lib.Base,o=s.enc.Utf8,void(s.algo.HMAC=r.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=o.parse(t));var i=e.blockSize,n=4*i;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var s=this._oKey=t.clone(),r=this._iKey=t.clone(),a=s.words,c=r.words,h=0;h<i;h++)a[h]^=1549556828,c[h]^=909522486;s.sigBytes=r.sigBytes=n,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,i=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(i))}})))},354:function(e,t,i){var n;e.exports=(n=i(249),i(938),i(433),i(298),i(269),i(786),i(214),i(783),i(153),i(792),i(34),i(460),i(327),i(706),i(824),i(112),i(888),i(109),i(568),i(242),i(968),i(660),i(148),i(615),i(807),i(77),i(475),i(991),i(209),i(452),i(253),i(857),i(454),i(974),n)},433:function(e,t,i){var n;e.exports=(n=i(249),function(){if("function"==typeof ArrayBuffer){var e=n.lib.WordArray,t=e.init,i=e.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var i=e.byteLength,n=[],s=0;s<i;s++)n[s>>>2]|=e[s]<<24-s%4*8;t.call(this,n,i)}else t.apply(this,arguments)};i.prototype=e}}(),n.lib.WordArray)},214:function(e,t,i){var n;e.exports=(n=i(249),function(e){var t=n,i=t.lib,s=i.WordArray,r=i.Hasher,o=t.algo,a=[];!function(){for(var t=0;t<64;t++)a[t]=4294967296*e.abs(e.sin(t+1))|0}();var c=o.MD5=r.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var i=0;i<16;i++){var n=t+i,s=e[n];e[n]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}var r=this._hash.words,o=e[t+0],c=e[t+1],f=e[t+2],p=e[t+3],m=e[t+4],g=e[t+5],A=e[t+6],y=e[t+7],b=e[t+8],B=e[t+9],v=e[t+10],C=e[t+11],w=e[t+12],E=e[t+13],M=e[t+14],T=e[t+15],x=r[0],I=r[1],R=r[2],S=r[3];x=h(x,I,R,S,o,7,a[0]),S=h(S,x,I,R,c,12,a[1]),R=h(R,S,x,I,f,17,a[2]),I=h(I,R,S,x,p,22,a[3]),x=h(x,I,R,S,m,7,a[4]),S=h(S,x,I,R,g,12,a[5]),R=h(R,S,x,I,A,17,a[6]),I=h(I,R,S,x,y,22,a[7]),x=h(x,I,R,S,b,7,a[8]),S=h(S,x,I,R,B,12,a[9]),R=h(R,S,x,I,v,17,a[10]),I=h(I,R,S,x,C,22,a[11]),x=h(x,I,R,S,w,7,a[12]),S=h(S,x,I,R,E,12,a[13]),R=h(R,S,x,I,M,17,a[14]),x=l(x,I=h(I,R,S,x,T,22,a[15]),R,S,c,5,a[16]),S=l(S,x,I,R,A,9,a[17]),R=l(R,S,x,I,C,14,a[18]),I=l(I,R,S,x,o,20,a[19]),x=l(x,I,R,S,g,5,a[20]),S=l(S,x,I,R,v,9,a[21]),R=l(R,S,x,I,T,14,a[22]),I=l(I,R,S,x,m,20,a[23]),x=l(x,I,R,S,B,5,a[24]),S=l(S,x,I,R,M,9,a[25]),R=l(R,S,x,I,p,14,a[26]),I=l(I,R,S,x,b,20,a[27]),x=l(x,I,R,S,E,5,a[28]),S=l(S,x,I,R,f,9,a[29]),R=l(R,S,x,I,y,14,a[30]),x=u(x,I=l(I,R,S,x,w,20,a[31]),R,S,g,4,a[32]),S=u(S,x,I,R,b,11,a[33]),R=u(R,S,x,I,C,16,a[34]),I=u(I,R,S,x,M,23,a[35]),x=u(x,I,R,S,c,4,a[36]),S=u(S,x,I,R,m,11,a[37]),R=u(R,S,x,I,y,16,a[38]),I=u(I,R,S,x,v,23,a[39]),x=u(x,I,R,S,E,4,a[40]),S=u(S,x,I,R,o,11,a[41]),R=u(R,S,x,I,p,16,a[42]),I=u(I,R,S,x,A,23,a[43]),x=u(x,I,R,S,B,4,a[44]),S=u(S,x,I,R,w,11,a[45]),R=u(R,S,x,I,T,16,a[46]),x=d(x,I=u(I,R,S,x,f,23,a[47]),R,S,o,6,a[48]),S=d(S,x,I,R,y,10,a[49]),R=d(R,S,x,I,M,15,a[50]),I=d(I,R,S,x,g,21,a[51]),x=d(x,I,R,S,w,6,a[52]),S=d(S,x,I,R,p,10,a[53]),R=d(R,S,x,I,v,15,a[54]),I=d(I,R,S,x,c,21,a[55]),x=d(x,I,R,S,b,6,a[56]),S=d(S,x,I,R,T,10,a[57]),R=d(R,S,x,I,A,15,a[58]),I=d(I,R,S,x,E,21,a[59]),x=d(x,I,R,S,m,6,a[60]),S=d(S,x,I,R,C,10,a[61]),R=d(R,S,x,I,f,15,a[62]),I=d(I,R,S,x,B,21,a[63]),r[0]=r[0]+x|0,r[1]=r[1]+I|0,r[2]=r[2]+R|0,r[3]=r[3]+S|0},_doFinalize:function(){var t=this._data,i=t.words,n=8*this._nDataBytes,s=8*t.sigBytes;i[s>>>5]|=128<<24-s%32;var r=e.floor(n/4294967296),o=n;i[15+(s+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),i[14+(s+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),t.sigBytes=4*(i.length+1),this._process();for(var a=this._hash,c=a.words,h=0;h<4;h++){var l=c[h];c[h]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return a},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}});function h(e,t,i,n,s,r,o){var a=e+(t&i|~t&n)+s+o;return(a<<r|a>>>32-r)+t}function l(e,t,i,n,s,r,o){var a=e+(t&n|i&~n)+s+o;return(a<<r|a>>>32-r)+t}function u(e,t,i,n,s,r,o){var a=e+(t^i^n)+s+o;return(a<<r|a>>>32-r)+t}function d(e,t,i,n,s,r,o){var a=e+(i^(t|~n))+s+o;return(a<<r|a>>>32-r)+t}t.MD5=r._createHelper(c),t.HmacMD5=r._createHmacHelper(c)}(Math),n.MD5)},568:function(e,t,i){var n;e.exports=(n=i(249),i(109),n.mode.CFB=function(){var e=n.lib.BlockCipherMode.extend();function t(e,t,i,n){var s,r=this._iv;r?(s=r.slice(0),this._iv=void 0):s=this._prevBlock,n.encryptBlock(s,0);for(var o=0;o<i;o++)e[t+o]^=s[o]}return e.Encryptor=e.extend({processBlock:function(e,i){var n=this._cipher,s=n.blockSize;t.call(this,e,i,s,n),this._prevBlock=e.slice(i,i+s)}}),e.Decryptor=e.extend({processBlock:function(e,i){var n=this._cipher,s=n.blockSize,r=e.slice(i,i+s);t.call(this,e,i,s,n),this._prevBlock=r}}),e}(),n.mode.CFB)},968:function(e,t,i){var n;e.exports=(n=i(249),i(109),n.mode.CTRGladman=function(){var e=n.lib.BlockCipherMode.extend();function t(e){if(255==(e>>24&255)){var t=e>>16&255,i=e>>8&255,n=255&e;255===t?(t=0,255===i?(i=0,255===n?n=0:++n):++i):++t,e=0,e+=t<<16,e+=i<<8,e+=n}else e+=1<<24;return e}function i(e){return 0===(e[0]=t(e[0]))&&(e[1]=t(e[1])),e}var s=e.Encryptor=e.extend({processBlock:function(e,t){var n=this._cipher,s=n.blockSize,r=this._iv,o=this._counter;r&&(o=this._counter=r.slice(0),this._iv=void 0),i(o);var a=o.slice(0);n.encryptBlock(a,0);for(var c=0;c<s;c++)e[t+c]^=a[c]}});return e.Decryptor=s,e}(),n.mode.CTRGladman)},242:function(e,t,i){var n,s,r;e.exports=(r=i(249),i(109),r.mode.CTR=(n=r.lib.BlockCipherMode.extend(),s=n.Encryptor=n.extend({processBlock:function(e,t){var i=this._cipher,n=i.blockSize,s=this._iv,r=this._counter;s&&(r=this._counter=s.slice(0),this._iv=void 0);var o=r.slice(0);i.encryptBlock(o,0),r[n-1]=r[n-1]+1|0;for(var a=0;a<n;a++)e[t+a]^=o[a]}}),n.Decryptor=s,n),r.mode.CTR)},148:function(e,t,i){var n,s;e.exports=(s=i(249),i(109),s.mode.ECB=((n=s.lib.BlockCipherMode.extend()).Encryptor=n.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}}),n.Decryptor=n.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}}),n),s.mode.ECB)},660:function(e,t,i){var n,s,r;e.exports=(r=i(249),i(109),r.mode.OFB=(n=r.lib.BlockCipherMode.extend(),s=n.Encryptor=n.extend({processBlock:function(e,t){var i=this._cipher,n=i.blockSize,s=this._iv,r=this._keystream;s&&(r=this._keystream=s.slice(0),this._iv=void 0),i.encryptBlock(r,0);for(var o=0;o<n;o++)e[t+o]^=r[o]}}),n.Decryptor=s,n),r.mode.OFB)},615:function(e,t,i){var n;e.exports=(n=i(249),i(109),n.pad.AnsiX923={pad:function(e,t){var i=e.sigBytes,n=4*t,s=n-i%n,r=i+s-1;e.clamp(),e.words[r>>>2]|=s<<24-r%4*8,e.sigBytes+=s},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Ansix923)},807:function(e,t,i){var n;e.exports=(n=i(249),i(109),n.pad.Iso10126={pad:function(e,t){var i=4*t,s=i-e.sigBytes%i;e.concat(n.lib.WordArray.random(s-1)).concat(n.lib.WordArray.create([s<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Iso10126)},77:function(e,t,i){var n;e.exports=(n=i(249),i(109),n.pad.Iso97971={pad:function(e,t){e.concat(n.lib.WordArray.create([2147483648],1)),n.pad.ZeroPadding.pad(e,t)},unpad:function(e){n.pad.ZeroPadding.unpad(e),e.sigBytes--}},n.pad.Iso97971)},991:function(e,t,i){var n;e.exports=(n=i(249),i(109),n.pad.NoPadding={pad:function(){},unpad:function(){}},n.pad.NoPadding)},475:function(e,t,i){var n;e.exports=(n=i(249),i(109),n.pad.ZeroPadding={pad:function(e,t){var i=4*t;e.clamp(),e.sigBytes+=i-(e.sigBytes%i||i)},unpad:function(e){var t=e.words,i=e.sigBytes-1;for(i=e.sigBytes-1;i>=0;i--)if(t[i>>>2]>>>24-i%4*8&255){e.sigBytes=i+1;break}}},n.pad.ZeroPadding)},112:function(e,t,i){var n,s,r,o,a,c,h,l,u;e.exports=(u=i(249),i(783),i(824),s=(n=u).lib,r=s.Base,o=s.WordArray,a=n.algo,c=a.SHA1,h=a.HMAC,l=a.PBKDF2=r.extend({cfg:r.extend({keySize:4,hasher:c,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var i=this.cfg,n=h.create(i.hasher,e),s=o.create(),r=o.create([1]),a=s.words,c=r.words,l=i.keySize,u=i.iterations;a.length<l;){var d=n.update(t).finalize(r);n.reset();for(var f=d.words,p=f.length,m=d,g=1;g<u;g++){m=n.finalize(m),n.reset();for(var A=m.words,y=0;y<p;y++)f[y]^=A[y]}s.concat(d),c[0]++}return s.sigBytes=4*l,s}}),n.PBKDF2=function(e,t,i){return l.create(i).compute(e,t)},u.PBKDF2)},974:function(e,t,i){var n;e.exports=(n=i(249),i(269),i(214),i(888),i(109),function(){var e=n,t=e.lib.StreamCipher,i=e.algo,s=[],r=[],o=[],a=i.RabbitLegacy=t.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,i=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],n=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var s=0;s<4;s++)c.call(this);for(s=0;s<8;s++)n[s]^=i[s+4&7];if(t){var r=t.words,o=r[0],a=r[1],h=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),u=h>>>16|4294901760&l,d=l<<16|65535&h;for(n[0]^=h,n[1]^=u,n[2]^=l,n[3]^=d,n[4]^=h,n[5]^=u,n[6]^=l,n[7]^=d,s=0;s<4;s++)c.call(this)}},_doProcessBlock:function(e,t){var i=this._X;c.call(this),s[0]=i[0]^i[5]>>>16^i[3]<<16,s[1]=i[2]^i[7]>>>16^i[5]<<16,s[2]=i[4]^i[1]>>>16^i[7]<<16,s[3]=i[6]^i[3]>>>16^i[1]<<16;for(var n=0;n<4;n++)s[n]=16711935&(s[n]<<8|s[n]>>>24)|4278255360&(s[n]<<24|s[n]>>>8),e[t+n]^=s[n]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,i=0;i<8;i++)r[i]=t[i];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<r[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<r[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<r[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<r[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<r[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<r[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<r[6]>>>0?1:0)|0,this._b=t[7]>>>0<r[7]>>>0?1:0,i=0;i<8;i++){var n=e[i]+t[i],s=65535&n,a=n>>>16,c=((s*s>>>17)+s*a>>>15)+a*a,h=((4294901760&n)*n|0)+((65535&n)*n|0);o[i]=c^h}e[0]=o[0]+(o[7]<<16|o[7]>>>16)+(o[6]<<16|o[6]>>>16)|0,e[1]=o[1]+(o[0]<<8|o[0]>>>24)+o[7]|0,e[2]=o[2]+(o[1]<<16|o[1]>>>16)+(o[0]<<16|o[0]>>>16)|0,e[3]=o[3]+(o[2]<<8|o[2]>>>24)+o[1]|0,e[4]=o[4]+(o[3]<<16|o[3]>>>16)+(o[2]<<16|o[2]>>>16)|0,e[5]=o[5]+(o[4]<<8|o[4]>>>24)+o[3]|0,e[6]=o[6]+(o[5]<<16|o[5]>>>16)+(o[4]<<16|o[4]>>>16)|0,e[7]=o[7]+(o[6]<<8|o[6]>>>24)+o[5]|0}e.RabbitLegacy=t._createHelper(a)}(),n.RabbitLegacy)},454:function(e,t,i){var n;e.exports=(n=i(249),i(269),i(214),i(888),i(109),function(){var e=n,t=e.lib.StreamCipher,i=e.algo,s=[],r=[],o=[],a=i.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,i=0;i<4;i++)e[i]=16711935&(e[i]<<8|e[i]>>>24)|4278255360&(e[i]<<24|e[i]>>>8);var n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],s=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,i=0;i<4;i++)c.call(this);for(i=0;i<8;i++)s[i]^=n[i+4&7];if(t){var r=t.words,o=r[0],a=r[1],h=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),u=h>>>16|4294901760&l,d=l<<16|65535&h;for(s[0]^=h,s[1]^=u,s[2]^=l,s[3]^=d,s[4]^=h,s[5]^=u,s[6]^=l,s[7]^=d,i=0;i<4;i++)c.call(this)}},_doProcessBlock:function(e,t){var i=this._X;c.call(this),s[0]=i[0]^i[5]>>>16^i[3]<<16,s[1]=i[2]^i[7]>>>16^i[5]<<16,s[2]=i[4]^i[1]>>>16^i[7]<<16,s[3]=i[6]^i[3]>>>16^i[1]<<16;for(var n=0;n<4;n++)s[n]=16711935&(s[n]<<8|s[n]>>>24)|4278255360&(s[n]<<24|s[n]>>>8),e[t+n]^=s[n]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,i=0;i<8;i++)r[i]=t[i];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<r[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<r[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<r[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<r[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<r[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<r[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<r[6]>>>0?1:0)|0,this._b=t[7]>>>0<r[7]>>>0?1:0,i=0;i<8;i++){var n=e[i]+t[i],s=65535&n,a=n>>>16,c=((s*s>>>17)+s*a>>>15)+a*a,h=((4294901760&n)*n|0)+((65535&n)*n|0);o[i]=c^h}e[0]=o[0]+(o[7]<<16|o[7]>>>16)+(o[6]<<16|o[6]>>>16)|0,e[1]=o[1]+(o[0]<<8|o[0]>>>24)+o[7]|0,e[2]=o[2]+(o[1]<<16|o[1]>>>16)+(o[0]<<16|o[0]>>>16)|0,e[3]=o[3]+(o[2]<<8|o[2]>>>24)+o[1]|0,e[4]=o[4]+(o[3]<<16|o[3]>>>16)+(o[2]<<16|o[2]>>>16)|0,e[5]=o[5]+(o[4]<<8|o[4]>>>24)+o[3]|0,e[6]=o[6]+(o[5]<<16|o[5]>>>16)+(o[4]<<16|o[4]>>>16)|0,e[7]=o[7]+(o[6]<<8|o[6]>>>24)+o[5]|0}e.Rabbit=t._createHelper(a)}(),n.Rabbit)},857:function(e,t,i){var n;e.exports=(n=i(249),i(269),i(214),i(888),i(109),function(){var e=n,t=e.lib.StreamCipher,i=e.algo,s=i.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,i=e.sigBytes,n=this._S=[],s=0;s<256;s++)n[s]=s;s=0;for(var r=0;s<256;s++){var o=s%i,a=t[o>>>2]>>>24-o%4*8&255;r=(r+n[s]+a)%256;var c=n[s];n[s]=n[r],n[r]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=r.call(this)},keySize:8,ivSize:0});function r(){for(var e=this._S,t=this._i,i=this._j,n=0,s=0;s<4;s++){i=(i+e[t=(t+1)%256])%256;var r=e[t];e[t]=e[i],e[i]=r,n|=e[(e[t]+e[i])%256]<<24-8*s}return this._i=t,this._j=i,n}e.RC4=t._createHelper(s);var o=i.RC4Drop=s.extend({cfg:s.cfg.extend({drop:192}),_doReset:function(){s._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)r.call(this)}});e.RC4Drop=t._createHelper(o)}(),n.RC4)},706:function(e,t,i){var n;e.exports=(n=i(249),function(e){var t=n,i=t.lib,s=i.WordArray,r=i.Hasher,o=t.algo,a=s.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),c=s.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),h=s.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),l=s.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),u=s.create([0,1518500249,1859775393,2400959708,2840853838]),d=s.create([1352829926,1548603684,1836072691,2053994217,0]),f=o.RIPEMD160=r.extend({_doReset:function(){this._hash=s.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var i=0;i<16;i++){var n=t+i,s=e[n];e[n]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}var r,o,f,B,v,C,w,E,M,T,x,I=this._hash.words,R=u.words,S=d.words,O=a.words,D=c.words,F=h.words,_=l.words;for(C=r=I[0],w=o=I[1],E=f=I[2],M=B=I[3],T=v=I[4],i=0;i<80;i+=1)x=r+e[t+O[i]]|0,x+=i<16?p(o,f,B)+R[0]:i<32?m(o,f,B)+R[1]:i<48?g(o,f,B)+R[2]:i<64?A(o,f,B)+R[3]:y(o,f,B)+R[4],x=(x=b(x|=0,F[i]))+v|0,r=v,v=B,B=b(f,10),f=o,o=x,x=C+e[t+D[i]]|0,x+=i<16?y(w,E,M)+S[0]:i<32?A(w,E,M)+S[1]:i<48?g(w,E,M)+S[2]:i<64?m(w,E,M)+S[3]:p(w,E,M)+S[4],x=(x=b(x|=0,_[i]))+T|0,C=T,T=M,M=b(E,10),E=w,w=x;x=I[1]+f+M|0,I[1]=I[2]+B+T|0,I[2]=I[3]+v+C|0,I[3]=I[4]+r+w|0,I[4]=I[0]+o+E|0,I[0]=x},_doFinalize:function(){var e=this._data,t=e.words,i=8*this._nDataBytes,n=8*e.sigBytes;t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),e.sigBytes=4*(t.length+1),this._process();for(var s=this._hash,r=s.words,o=0;o<5;o++){var a=r[o];r[o]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}return s},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}});function p(e,t,i){return e^t^i}function m(e,t,i){return e&t|~e&i}function g(e,t,i){return(e|~t)^i}function A(e,t,i){return e&i|t&~i}function y(e,t,i){return e^(t|~i)}function b(e,t){return e<<t|e>>>32-t}t.RIPEMD160=r._createHelper(f),t.HmacRIPEMD160=r._createHmacHelper(f)}(Math),n.RIPEMD160)},783:function(e,t,i){var n,s,r,o,a,c,h,l;e.exports=(l=i(249),s=(n=l).lib,r=s.WordArray,o=s.Hasher,a=n.algo,c=[],h=a.SHA1=o.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var i=this._hash.words,n=i[0],s=i[1],r=i[2],o=i[3],a=i[4],h=0;h<80;h++){if(h<16)c[h]=0|e[t+h];else{var l=c[h-3]^c[h-8]^c[h-14]^c[h-16];c[h]=l<<1|l>>>31}var u=(n<<5|n>>>27)+a+c[h];u+=h<20?1518500249+(s&r|~s&o):h<40?1859775393+(s^r^o):h<60?(s&r|s&o|r&o)-1894007588:(s^r^o)-899497514,a=o,o=r,r=s<<30|s>>>2,s=n,n=u}i[0]=i[0]+n|0,i[1]=i[1]+s|0,i[2]=i[2]+r|0,i[3]=i[3]+o|0,i[4]=i[4]+a|0},_doFinalize:function(){var e=this._data,t=e.words,i=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(i/4294967296),t[15+(n+64>>>9<<4)]=i,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}}),n.SHA1=o._createHelper(h),n.HmacSHA1=o._createHmacHelper(h),l.SHA1)},792:function(e,t,i){var n,s,r,o,a,c;e.exports=(c=i(249),i(153),s=(n=c).lib.WordArray,r=n.algo,o=r.SHA256,a=r.SHA224=o.extend({_doReset:function(){this._hash=new s.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=o._doFinalize.call(this);return e.sigBytes-=4,e}}),n.SHA224=o._createHelper(a),n.HmacSHA224=o._createHmacHelper(a),c.SHA224)},153:function(e,t,i){var n;e.exports=(n=i(249),function(e){var t=n,i=t.lib,s=i.WordArray,r=i.Hasher,o=t.algo,a=[],c=[];!function(){function t(t){for(var i=e.sqrt(t),n=2;n<=i;n++)if(!(t%n))return!1;return!0}function i(e){return 4294967296*(e-(0|e))|0}for(var n=2,s=0;s<64;)t(n)&&(s<8&&(a[s]=i(e.pow(n,.5))),c[s]=i(e.pow(n,1/3)),s++),n++}();var h=[],l=o.SHA256=r.extend({_doReset:function(){this._hash=new s.init(a.slice(0))},_doProcessBlock:function(e,t){for(var i=this._hash.words,n=i[0],s=i[1],r=i[2],o=i[3],a=i[4],l=i[5],u=i[6],d=i[7],f=0;f<64;f++){if(f<16)h[f]=0|e[t+f];else{var p=h[f-15],m=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,g=h[f-2],A=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;h[f]=m+h[f-7]+A+h[f-16]}var y=n&s^n&r^s&r,b=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),B=d+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&l^~a&u)+c[f]+h[f];d=u,u=l,l=a,a=o+B|0,o=r,r=s,s=n,n=B+(b+y)|0}i[0]=i[0]+n|0,i[1]=i[1]+s|0,i[2]=i[2]+r|0,i[3]=i[3]+o|0,i[4]=i[4]+a|0,i[5]=i[5]+l|0,i[6]=i[6]+u|0,i[7]=i[7]+d|0},_doFinalize:function(){var t=this._data,i=t.words,n=8*this._nDataBytes,s=8*t.sigBytes;return i[s>>>5]|=128<<24-s%32,i[14+(s+64>>>9<<4)]=e.floor(n/4294967296),i[15+(s+64>>>9<<4)]=n,t.sigBytes=4*i.length,this._process(),this._hash},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=r._createHelper(l),t.HmacSHA256=r._createHmacHelper(l)}(Math),n.SHA256)},327:function(e,t,i){var n;e.exports=(n=i(249),i(938),function(e){var t=n,i=t.lib,s=i.WordArray,r=i.Hasher,o=t.x64.Word,a=t.algo,c=[],h=[],l=[];!function(){for(var e=1,t=0,i=0;i<24;i++){c[e+5*t]=(i+1)*(i+2)/2%64;var n=(2*e+3*t)%5;e=t%5,t=n}for(e=0;e<5;e++)for(t=0;t<5;t++)h[e+5*t]=t+(2*e+3*t)%5*5;for(var s=1,r=0;r<24;r++){for(var a=0,u=0,d=0;d<7;d++){if(1&s){var f=(1<<d)-1;f<32?u^=1<<f:a^=1<<f-32}128&s?s=s<<1^113:s<<=1}l[r]=o.create(a,u)}}();var u=[];!function(){for(var e=0;e<25;e++)u[e]=o.create()}();var d=a.SHA3=r.extend({cfg:r.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],t=0;t<25;t++)e[t]=new o.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,t){for(var i=this._state,n=this.blockSize/2,s=0;s<n;s++){var r=e[t+2*s],o=e[t+2*s+1];r=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),(I=i[s]).high^=o,I.low^=r}for(var a=0;a<24;a++){for(var d=0;d<5;d++){for(var f=0,p=0,m=0;m<5;m++)f^=(I=i[d+5*m]).high,p^=I.low;var g=u[d];g.high=f,g.low=p}for(d=0;d<5;d++){var A=u[(d+4)%5],y=u[(d+1)%5],b=y.high,B=y.low;for(f=A.high^(b<<1|B>>>31),p=A.low^(B<<1|b>>>31),m=0;m<5;m++)(I=i[d+5*m]).high^=f,I.low^=p}for(var v=1;v<25;v++){var C=(I=i[v]).high,w=I.low,E=c[v];E<32?(f=C<<E|w>>>32-E,p=w<<E|C>>>32-E):(f=w<<E-32|C>>>64-E,p=C<<E-32|w>>>64-E);var M=u[h[v]];M.high=f,M.low=p}var T=u[0],x=i[0];for(T.high=x.high,T.low=x.low,d=0;d<5;d++)for(m=0;m<5;m++){var I=i[v=d+5*m],R=u[v],S=u[(d+1)%5+5*m],O=u[(d+2)%5+5*m];I.high=R.high^~S.high&O.high,I.low=R.low^~S.low&O.low}I=i[0];var D=l[a];I.high^=D.high,I.low^=D.low}},_doFinalize:function(){var t=this._data,i=t.words,n=(this._nDataBytes,8*t.sigBytes),r=32*this.blockSize;i[n>>>5]|=1<<24-n%32,i[(e.ceil((n+1)/r)*r>>>5)-1]|=128,t.sigBytes=4*i.length,this._process();for(var o=this._state,a=this.cfg.outputLength/8,c=a/8,h=[],l=0;l<c;l++){var u=o[l],d=u.high,f=u.low;d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),f=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),h.push(f),h.push(d)}return new s.init(h,a)},clone:function(){for(var e=r.clone.call(this),t=e._state=this._state.slice(0),i=0;i<25;i++)t[i]=t[i].clone();return e}});t.SHA3=r._createHelper(d),t.HmacSHA3=r._createHmacHelper(d)}(Math),n.SHA3)},460:function(e,t,i){var n,s,r,o,a,c,h,l;e.exports=(l=i(249),i(938),i(34),s=(n=l).x64,r=s.Word,o=s.WordArray,a=n.algo,c=a.SHA512,h=a.SHA384=c.extend({_doReset:function(){this._hash=new o.init([new r.init(3418070365,3238371032),new r.init(1654270250,914150663),new r.init(2438529370,812702999),new r.init(355462360,4144912697),new r.init(1731405415,4290775857),new r.init(2394180231,1750603025),new r.init(3675008525,1694076839),new r.init(1203062813,3204075428)])},_doFinalize:function(){var e=c._doFinalize.call(this);return e.sigBytes-=16,e}}),n.SHA384=c._createHelper(h),n.HmacSHA384=c._createHmacHelper(h),l.SHA384)},34:function(e,t,i){var n;e.exports=(n=i(249),i(938),function(){var e=n,t=e.lib.Hasher,i=e.x64,s=i.Word,r=i.WordArray,o=e.algo;function a(){return s.create.apply(s,arguments)}var c=[a(1116352408,3609767458),a(1899447441,602891725),a(3049323471,3964484399),a(3921009573,2173295548),a(961987163,4081628472),a(1508970993,3053834265),a(2453635748,2937671579),a(2870763221,3664609560),a(3624381080,2734883394),a(310598401,1164996542),a(607225278,1323610764),a(1426881987,3590304994),a(1925078388,4068182383),a(2162078206,991336113),a(2614888103,633803317),a(3248222580,3479774868),a(3835390401,2666613458),a(4022224774,944711139),a(264347078,2341262773),a(604807628,2007800933),a(770255983,1495990901),a(1249150122,1856431235),a(1555081692,3175218132),a(1996064986,2198950837),a(2554220882,3999719339),a(2821834349,766784016),a(2952996808,2566594879),a(3210313671,3203337956),a(3336571891,1034457026),a(3584528711,2466948901),a(113926993,3758326383),a(338241895,168717936),a(666307205,1188179964),a(773529912,1546045734),a(1294757372,1522805485),a(1396182291,2643833823),a(1695183700,2343527390),a(1986661051,1014477480),a(2177026350,1206759142),a(2456956037,344077627),a(2730485921,1290863460),a(2820302411,3158454273),a(3259730800,3505952657),a(3345764771,106217008),a(3516065817,3606008344),a(3600352804,1432725776),a(4094571909,1467031594),a(275423344,851169720),a(430227734,3100823752),a(506948616,1363258195),a(659060556,3750685593),a(883997877,3785050280),a(958139571,3318307427),a(1322822218,3812723403),a(1537002063,2003034995),a(1747873779,3602036899),a(1955562222,1575990012),a(2024104815,1125592928),a(2227730452,2716904306),a(2361852424,442776044),a(2428436474,593698344),a(2756734187,3733110249),a(3204031479,2999351573),a(3329325298,3815920427),a(3391569614,3928383900),a(3515267271,566280711),a(3940187606,3454069534),a(4118630271,4000239992),a(116418474,1914138554),a(174292421,2731055270),a(289380356,3203993006),a(460393269,320620315),a(685471733,587496836),a(852142971,1086792851),a(1017036298,365543100),a(1126000580,2618297676),a(1288033470,3409855158),a(1501505948,4234509866),a(1607167915,987167468),a(1816402316,1246189591)],h=[];!function(){for(var e=0;e<80;e++)h[e]=a()}();var l=o.SHA512=t.extend({_doReset:function(){this._hash=new r.init([new s.init(1779033703,4089235720),new s.init(3144134277,2227873595),new s.init(1013904242,4271175723),new s.init(2773480762,1595750129),new s.init(1359893119,2917565137),new s.init(2600822924,725511199),new s.init(528734635,4215389547),new s.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var i=this._hash.words,n=i[0],s=i[1],r=i[2],o=i[3],a=i[4],l=i[5],u=i[6],d=i[7],f=n.high,p=n.low,m=s.high,g=s.low,A=r.high,y=r.low,b=o.high,B=o.low,v=a.high,C=a.low,w=l.high,E=l.low,M=u.high,T=u.low,x=d.high,I=d.low,R=f,S=p,O=m,D=g,F=A,_=y,G=b,L=B,P=v,k=C,N=w,U=E,H=M,j=T,J=x,V=I,z=0;z<80;z++){var K,W,Q=h[z];if(z<16)W=Q.high=0|e[t+2*z],K=Q.low=0|e[t+2*z+1];else{var X=h[z-15],Y=X.high,q=X.low,Z=(Y>>>1|q<<31)^(Y>>>8|q<<24)^Y>>>7,$=(q>>>1|Y<<31)^(q>>>8|Y<<24)^(q>>>7|Y<<25),ee=h[z-2],te=ee.high,ie=ee.low,ne=(te>>>19|ie<<13)^(te<<3|ie>>>29)^te>>>6,se=(ie>>>19|te<<13)^(ie<<3|te>>>29)^(ie>>>6|te<<26),re=h[z-7],oe=re.high,ae=re.low,ce=h[z-16],he=ce.high,le=ce.low;W=(W=(W=Z+oe+((K=$+ae)>>>0<$>>>0?1:0))+ne+((K+=se)>>>0<se>>>0?1:0))+he+((K+=le)>>>0<le>>>0?1:0),Q.high=W,Q.low=K}var ue,de=P&N^~P&H,fe=k&U^~k&j,pe=R&O^R&F^O&F,me=S&D^S&_^D&_,ge=(R>>>28|S<<4)^(R<<30|S>>>2)^(R<<25|S>>>7),Ae=(S>>>28|R<<4)^(S<<30|R>>>2)^(S<<25|R>>>7),ye=(P>>>14|k<<18)^(P>>>18|k<<14)^(P<<23|k>>>9),be=(k>>>14|P<<18)^(k>>>18|P<<14)^(k<<23|P>>>9),Be=c[z],ve=Be.high,Ce=Be.low,we=J+ye+((ue=V+be)>>>0<V>>>0?1:0),Ee=Ae+me;J=H,V=j,H=N,j=U,N=P,U=k,P=G+(we=(we=(we=we+de+((ue+=fe)>>>0<fe>>>0?1:0))+ve+((ue+=Ce)>>>0<Ce>>>0?1:0))+W+((ue+=K)>>>0<K>>>0?1:0))+((k=L+ue|0)>>>0<L>>>0?1:0)|0,G=F,L=_,F=O,_=D,O=R,D=S,R=we+(ge+pe+(Ee>>>0<Ae>>>0?1:0))+((S=ue+Ee|0)>>>0<ue>>>0?1:0)|0}p=n.low=p+S,n.high=f+R+(p>>>0<S>>>0?1:0),g=s.low=g+D,s.high=m+O+(g>>>0<D>>>0?1:0),y=r.low=y+_,r.high=A+F+(y>>>0<_>>>0?1:0),B=o.low=B+L,o.high=b+G+(B>>>0<L>>>0?1:0),C=a.low=C+k,a.high=v+P+(C>>>0<k>>>0?1:0),E=l.low=E+U,l.high=w+N+(E>>>0<U>>>0?1:0),T=u.low=T+j,u.high=M+H+(T>>>0<j>>>0?1:0),I=d.low=I+V,d.high=x+J+(I>>>0<V>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,i=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(i/4294967296),t[31+(n+128>>>10<<5)]=i,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(l),e.HmacSHA512=t._createHmacHelper(l)}(),n.SHA512)},253:function(e,t,i){var n;e.exports=(n=i(249),i(269),i(214),i(888),i(109),function(){var e=n,t=e.lib,i=t.WordArray,s=t.BlockCipher,r=e.algo,o=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],a=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],h=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],u=r.DES=s.extend({_doReset:function(){for(var e=this._key.words,t=[],i=0;i<56;i++){var n=o[i]-1;t[i]=e[n>>>5]>>>31-n%32&1}for(var s=this._subKeys=[],r=0;r<16;r++){var h=s[r]=[],l=c[r];for(i=0;i<24;i++)h[i/6|0]|=t[(a[i]-1+l)%28]<<31-i%6,h[4+(i/6|0)]|=t[28+(a[i+24]-1+l)%28]<<31-i%6;for(h[0]=h[0]<<1|h[0]>>>31,i=1;i<7;i++)h[i]=h[i]>>>4*(i-1)+3;h[7]=h[7]<<5|h[7]>>>27}var u=this._invSubKeys=[];for(i=0;i<16;i++)u[i]=s[15-i]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,i){this._lBlock=e[t],this._rBlock=e[t+1],d.call(this,4,252645135),d.call(this,16,65535),f.call(this,2,858993459),f.call(this,8,16711935),d.call(this,1,1431655765);for(var n=0;n<16;n++){for(var s=i[n],r=this._lBlock,o=this._rBlock,a=0,c=0;c<8;c++)a|=h[c][((o^s[c])&l[c])>>>0];this._lBlock=o,this._rBlock=r^a}var u=this._lBlock;this._lBlock=this._rBlock,this._rBlock=u,d.call(this,1,1431655765),f.call(this,8,16711935),f.call(this,2,858993459),d.call(this,16,65535),d.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function d(e,t){var i=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=i,this._lBlock^=i<<e}function f(e,t){var i=(this._rBlock>>>e^this._lBlock)&t;this._lBlock^=i,this._rBlock^=i<<e}e.DES=s._createHelper(u);var p=r.TripleDES=s.extend({_doReset:function(){var e=this._key.words;if(2!==e.length&&4!==e.length&&e.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var t=e.slice(0,2),n=e.length<4?e.slice(0,2):e.slice(2,4),s=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=u.createEncryptor(i.create(t)),this._des2=u.createEncryptor(i.create(n)),this._des3=u.createEncryptor(i.create(s))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=s._createHelper(p)}(),n.TripleDES)},938:function(e,t,i){var n;e.exports=(n=i(249),function(e){var t=n,i=t.lib,s=i.Base,r=i.WordArray,o=t.x64={};o.Word=s.extend({init:function(e,t){this.high=e,this.low=t}}),o.WordArray=s.extend({init:function(t,i){t=this.words=t||[],this.sigBytes=i!=e?i:8*t.length},toX32:function(){for(var e=this.words,t=e.length,i=[],n=0;n<t;n++){var s=e[n];i.push(s.high),i.push(s.low)}return r.create(i,this.sigBytes)},clone:function(){for(var e=s.clone.call(this),t=e.words=this.words.slice(0),i=t.length,n=0;n<i;n++)t[n]=t[n].clone();return e}})}(),n)},74:t=>{"use strict";t.exports=e},125:()=>{},480:()=>{}},i={};function n(e){var s=i[e];if(void 0!==s)return s.exports;var r=i[e]={exports:{}};return t[e].call(r.exports,r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};return(()=>{"use strict";n.d(s,{default:()=>ef});var e={};n.r(e),n.d(e,{decode:()=>ec,name:()=>$a});var t={};n.r(t),n.d(t,{name:()=>oc,preprocess:()=>ac});var i={};n.r(i),n.d(i,{name:()=>hc,preprocess:()=>lc});var r={};n.r(r),n.d(r,{decode:()=>mc,encode:()=>gc,name:()=>fc,preprocess:()=>pc});var o={};n.r(o),n.d(o,{decode:()=>Gc,name:()=>Oc});var a={};n.r(a),n.d(a,{decode:()=>Hc,encode:()=>jc,name:()=>Uc});var c={};n.r(c),n.d(c,{decode:()=>zc,encode:()=>Kc,name:()=>Vc});var h={};n.r(h),n.d(h,{decode:()=>Xc,encode:()=>Yc,name:()=>Qc});var l={};n.r(l),n.d(l,{decode:()=>eh,name:()=>$c});var u,d=n(74);class f{constructor(e){this.isMove=0,this.waitingTime=5,this.touchtime=0,this.app=e}registerAfterRender(){(new Date).getTime()-this.touchtime>1e3*this.waitingTime&&this.app.camera._isAutoRotation&&(this.app.camera.arcRotateCamera.alpha+=this.app.camera.autoRotationSpeed)}runRender(){}onPointer(e){switch(this.touchtime=(new Date).getTime(),e.type){case d.PointerEventTypes.POINTERDOWN:this.isMove=0;case d.PointerEventTypes.POINTERMOVE:if(this.isMove++,!this.app.toolTips)return;e?this.app.toolTips.update(e):this.app.toolTips.close();break;case d.PointerEventTypes.POINTERWHEEL:this.app.camera._wheel(e.event),e.event.preventDefault();break;case d.PointerEventTypes.POINTERUP:if(this.isMove>2)return;e.pickInfo.pickedMesh||2!=e.event.button||this.app.project.goBack()}}onKeyboard(e){if(this.touchtime=(new Date).getTime(),e.type===d.KeyboardEventTypes.KEYDOWN)70===e.event.keyCode&&prompt("请复制输入框内的视角参数",this.app.camera.getSightJson())}}class p{constructor(e){this.isFPS=!1,this.angle=Math.PI/2,this.direction=new d.Vector3(Math.cos(this.angle),0,Math.sin(this.angle)),this.isMoveLeft=!1,this.isMoveRight=!1,this.isMoveDown=!1,this.isMoveUp=!1,this.app=e,this.isFPS=!1}registerAfterRender(){}runRender(){if(this.app.scene.activeCamera instanceof d.FreeCamera&&(this.isMoveDown||this.isMoveLeft||this.isMoveRight||this.isMoveUp)){var e=this.app.camera.freeCamera.speed;this.isMoveLeft?(this.app.camera.freeCamera.rotation.y+=e,this.direction.copyFromFloats(0,0,0)):this.isMoveUp?this.direction.copyFromFloats(0,0,e):this.isMoveRight?(this.app.camera.freeCamera.rotation.y-=e,this.direction.copyFromFloats(0,0,0)):this.isMoveDown&&this.direction.copyFromFloats(0,0,-e),this.app.camera.freeCamera.getScene().useRightHandedSystem&&(this.direction.z*=-1),this.app.camera.freeCamera.getViewMatrix().invertToRef(this.app.camera.freeCamera._cameraTransformMatrix),d.Vector3.TransformNormalToRef(this.direction,this.app.camera.freeCamera._cameraTransformMatrix,this.app.camera.freeCamera._transformedDirection),this.app.camera.freeCamera.cameraDirection.addInPlace(this.app.camera.freeCamera._transformedDirection)}}onPointer(e){switch(e.type){case d.PointerEventTypes.POINTERUP:if(this.isFPS)return;this.app.camera.freeCamera.position=d.Vector3.Zero(),this.app.camera.freeCamera.position.y=this.app.project.current.instance.position.y+1.5,this.app.scene.activeCamera=this.app.camera.freeCamera,this.app.camera.freeCamera.attachControl(this.app.canvas,!0),this.isFPS=!0;break;case d.PointerEventTypes.POINTERMOVE:break;case d.PointerEventTypes.POINTERWHEEL:e.event.preventDefault()}}onKeyboard(e){}}class m{static vector3ToJson(e){return{x:Math.floor(1e3*e.x)/1e3,y:Math.floor(1e3*e.y)/1e3,z:Math.floor(1e3*e.z)/1e3}}static vector3ARRToJson(e){let t=[];return e.forEach((e=>t.push({x:Math.floor(1e3*e.x)/1e3,y:Math.floor(1e3*e.y)/1e3,z:Math.floor(1e3*e.z)/1e3}))),t}static ToVector3(e){return new d.Vector3(Math.floor(1e3*e.x)/1e3,Math.floor(1e3*e.y)/1e3,Math.floor(1e3*e.z)/1e3)}static ToARRVector3(e){let t=[];return e.forEach((e=>t.push(new d.Vector3(Math.floor(1e3*e.x)/1e3,Math.floor(1e3*e.y)/1e3,Math.floor(1e3*e.z)/1e3)))),t}static computeBounds(e){let t=e.getChildMeshes(),i=e.getBoundingInfo();if(t.length>0){for(var n=t[0].getBoundingInfo(),s=n.minimum.add(t[0].position),r=n.maximum.add(t[0].position),o=1;o<t.length;o++)n=t[o].getBoundingInfo(),s=d.Vector3.Minimize(s,n.minimum.add(t[o].position)),r=d.Vector3.Maximize(r,n.maximum.add(t[o].position));i=new d.BoundingInfo(s,r)}return i}static computeBoundsToARR(e){for(var t=e[0].getBoundingInfo(),i=t.minimum.add(e[0].position),n=t.maximum.add(e[0].position),s=1;s<e.length;s++)t=e[s].getBoundingInfo(),i=d.Vector3.Minimize(i,t.minimum.add(e[s].position)),n=d.Vector3.Maximize(n,t.maximum.add(e[s].position));return new d.BoundingInfo(i,n)}static Expand(e,t){let i=new Array,n=e.length;for(let s=0;s<n;s++){let r=e[s],o=e[0==s?n-1:s-1],a=e[s==n-1?0:s+1],c=o.x-r.x,h=o.z-r.z,l=this.norm(c,h);c/=l,h/=l;let u=a.x-r.x,f=a.z-r.z,p=this.norm(u,f);u/=p,f/=p;let m=-t/Math.sqrt((1-(c*u+h*f))/2),g=c+u,A=h+f,y=0==this.norm(g,A)?0:m/this.norm(g,A);g*=y,A*=y,i[s]=new d.Vector3(g+r.x,0,A+r.z)}return i}static norm(e,t){return Math.sqrt(e*e+t*t)}static MergeMeshes(e,t){let i=new d.Mesh((new Date).getDate().toString(),t.scene);return setTimeout((()=>{let t,n=null;for(let i=0;i<e.length;i++)if(e[i]){var s=e[i],r=s.computeWorldMatrix(!0);t=d.VertexData.ExtractFromMesh(s,!0,!0),t.transform(r),n?n.merge(t,!0):n=t,s.dispose(!1,!0)}n.applyToMesh(i)})),i}static DeconsTructMesh(e,t,i){if(e.subMeshes.length>1){for(var n=d.VertexData.ExtractFromMesh(e,!0,!0),s=n.indices,r=n.normals,o=n.positions,a=n.uvs,c=new Array,h=0;h<e.subMeshes.length;h++){for(var l=new d.VertexData,u=s.slice(e.subMeshes[h].indexStart,e.subMeshes[h].indexStart+e.subMeshes[h].indexCount),f=r.slice(3*e.subMeshes[h].verticesStart,3*e.subMeshes[h].verticesStart+3*e.subMeshes[h].verticesCount),p=o.slice(3*e.subMeshes[h].verticesStart,3*e.subMeshes[h].verticesStart+3*e.subMeshes[h].verticesCount),m=a.slice(2*e.subMeshes[h].verticesStart,2*e.subMeshes[h].verticesStart+2*e.subMeshes[h].verticesCount),g=0;g<u.length;g++)u[g]=u[g]-e.subMeshes[h].verticesStart;l.indices=u,l.normals=f,l.positions=p,l.uvs=m;var A=new d.Mesh(e.id+"-"+h,i.scene);l.applyToMesh(A),A.position.y=parseFloat(t),A.setEnabled(!1),c.push(A)}return e.dispose(!1,!0),c}return[e]}static getVisualAngle(e,t){let i={},n=e.boundingSphere.radiusWorld,s=t.engine.getAspectRatio(t.camera.arcRotateCamera),r=t.camera.arcRotateCamera.fov/1.2;return s<1&&(r=Math.atan(s*Math.tan(t.camera.arcRotateCamera.fov/2))),i.radius=1.1*Math.abs(n/Math.sin(r)),i.alpha=Math.PI/2,i.beta=Math.PI/3,i.focus=e.boundingSphere.center.clone(),i}static pathTransformation(e,t){let i=new d.Path3D(e).getTangents(),n=[];for(let s=0;s<e.length;s++)if(s>0&&s<e.length-1){let r=e[s-1],o=e[s+1],a=e[s],c=i[s-1],h=i[s];if(!c.equals(h)){let e=d.Vector3.Lerp(a,r,t/d.Vector3.Distance(r,a)),i=d.Vector3.Lerp(a,o,t/d.Vector3.Distance(o,a)),s=d.Curve3.CreateQuadraticBezier(e,a,i,10);n=n.concat(s.getPoints())}}else n.push(e[s]);return n}static createTube(e,t,i=.05,n){return d.MeshBuilder.CreateTube(e,{path:this.pathTransformation(t,i),radius:i/2},n.scene)}static getAngleFromVector2(e,t,i){const n=(e.x-t.x)*(i.x-t.x)+(e.y-t.y)*(i.y-t.y),s=(e.x-t.x)*(i.y-t.y)-(e.y-t.y)*(i.x-t.x),r=Math.atan2(s,n);return Math.PI-r}static getAngleFromVector3(e,t,i){return this.getAngleFromVector2(new d.Vector2(e.x,e.z),new d.Vector2(t.x,t.z),new d.Vector2(i.x,i.z))}static RandomNumBoth(e,t){var i=t-e,n=Math.random();return e+Math.round(n*i)}static rand(e,t){return Math.floor(Math.random()*(t-e+1)+e)}}class g{constructor(e){this._isAutoRotation=!1,this.autoRotationSpeed=.01,this.app=e,this.arcRotateCamera=new d.ArcRotateCamera("arcRotateCamera",-Math.PI/4,Math.PI/4,50,new d.Vector3(0,0,0),this.app.scene),this.arcRotateCamera.pinchPrecision=200,this.arcRotateCamera.minZ=.3,this.arcRotateCamera.wheelDeltaPercentage=.01,this.frustrum=5,this.freeCamera=new d.FreeCamera("FreeCamera",d.Vector3.Zero(),this.app.scene),this.freeCamera.minZ=.45,this.freeCamera.speed=.01,this.freeCamera.keysUp=[87],this.freeCamera.keysDown=[83],this.freeCamera.keysLeft=[65],this.freeCamera.keysRight=[68],this.switchArcRotateCamera()}orthographic(e){e||(e=this.app.project.current),this.arcRotateCamera.lowerBetaLimit=0,this.arcRotateCamera.upperBetaLimit=0,this.arcRotateCamera.lowerAlphaLimit=Math.PI/2,this.arcRotateCamera.upperAlphaLimit=Math.PI/2,this.arcRotateCamera.mode=d.Camera.ORTHOGRAPHIC_CAMERA,this.arcRotateCamera.lowerRadiusLimit=2*e.Sight.radius,this.arcRotateCamera.radius=e.Sight.radius,this.arcRotateCamera.target=e.Sight.focus.clone(),this.frustrum=.5*e.Sight.radius,this.computeCameraView()}startAutoRotation(e){e&&(this.autoRotationSpeed=e),this._isAutoRotation=!0}stopAutoRotation(){this._isAutoRotation=!1}perspective(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,e||(e=this.app.project.current),this.arcRotateCamera.lowerRadiusLimit=e.Sight.minimumLimit?e.Sight.minimumLimit:1,this.arcRotateCamera.upperRadiusLimit=e.Sight.maximumLimit?e.Sight.maximumLimit:3e3,this.arcRotateCamera.panningSensibility=1e3,this.arcRotateCamera.lowerBetaLimit=e.Sight.minBeta?e.Sight.minBeta:.01,this.arcRotateCamera.upperBetaLimit=e.Sight.maxBeta?e.Sight.maxBeta:Math.PI/2*.98,this.arcRotateCamera.lowerAlphaLimit=null,this.arcRotateCamera.upperAlphaLimit=null,this.arcRotateCamera.mode=d.Camera.PERSPECTIVE_CAMERA,(this.arcRotateCamera.alpha>2*Math.PI||this.arcRotateCamera.alpha<-2*Math.PI)&&(this.arcRotateCamera.alpha=this.arcRotateCamera.alpha-Math.floor(this.arcRotateCamera.alpha/(2*Math.PI))*(2*Math.PI));var t=new d.Animation("camtarget","target",30,d.Animation.ANIMATIONTYPE_VECTOR3,d.Animation.ANIMATIONLOOPMODE_CYCLE);t.setKeys([{frame:0,value:this.arcRotateCamera.target},{frame:30,value:e.Sight.focus.clone()}]);var i=new d.Animation("camAlpha","alpha",30,d.Animation.ANIMATIONTYPE_FLOAT,d.Animation.ANIMATIONLOOPMODE_CYCLE);i.setKeys([{frame:0,value:this.arcRotateCamera.alpha},{frame:30,value:e.Sight.alpha}]);var n=new d.Animation("camRadius","radius",30,d.Animation.ANIMATIONTYPE_FLOAT,d.Animation.ANIMATIONLOOPMODE_CYCLE);n.setKeys([{frame:0,value:this.arcRotateCamera.radius},{frame:30,value:e.Sight.radius}]);var s=new d.Animation("camBeta","beta",30,d.Animation.ANIMATIONTYPE_FLOAT,d.Animation.ANIMATIONLOOPMODE_CYCLE);s.setKeys([{frame:0,value:this.arcRotateCamera.beta},{frame:30,value:e.Sight.beta}]),this.app.scene.beginDirectAnimation(this.arcRotateCamera,[t,i,n,s],0,60,!1),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}flyTo(e,t=.5){e||(e=this.app.project.current.Sight),this.arcRotateCamera.mode=d.Camera.PERSPECTIVE_CAMERA;var i=20,n=new d.Animation("camTarget","target",i,d.Animation.ANIMATIONTYPE_VECTOR3,d.Animation.ANIMATIONLOOPMODE_CONSTANT);n.setKeys([{frame:0,value:this.arcRotateCamera.target},{frame:i,value:e.focus.clone()}]);var s=new d.Animation("camRadius","radius",i,d.Animation.ANIMATIONTYPE_FLOAT,d.Animation.ANIMATIONLOOPMODE_CYCLE);s.setKeys([{frame:i,value:this.arcRotateCamera.radius},{frame:40,value:e.radius}]),this.app.scene.beginDirectAnimation(this.arcRotateCamera,[n,s],0,40,!1),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}flyToObject(e,t=.5){this.flyTo(e.Sight,t)}lookToTheFront(e,t=.5){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.arcRotateCamera.lowerRadiusLimit=e.Sight.minimumLimit?e.Sight.minimumLimit:1,this.arcRotateCamera.upperRadiusLimit=e.Sight.maximumLimit?e.Sight.maximumLimit:3e3,this.arcRotateCamera.panningSensibility=1e3,this.arcRotateCamera.lowerBetaLimit=e.Sight.minBeta?e.Sight.minBeta:.01,this.arcRotateCamera.upperBetaLimit=e.Sight.maxBeta?e.Sight.maxBeta:Math.PI/2*.98,this.arcRotateCamera.lowerAlphaLimit=null,this.arcRotateCamera.upperAlphaLimit=null,this.arcRotateCamera.mode=d.Camera.PERSPECTIVE_CAMERA;let i=Math.atan2(-e.instance.forward.z,-e.instance.forward.x);(this.arcRotateCamera.alpha>2*Math.PI||this.arcRotateCamera.alpha<-2*Math.PI)&&(this.arcRotateCamera.alpha=this.arcRotateCamera.alpha-Math.floor(this.arcRotateCamera.alpha/(2*Math.PI))*(2*Math.PI));var n=new d.Animation("camtarget","target",30,d.Animation.ANIMATIONTYPE_VECTOR3,d.Animation.ANIMATIONLOOPMODE_CYCLE);n.setKeys([{frame:0,value:this.arcRotateCamera.target},{frame:30*t,value:e.Sight.focus.clone()}]);var s=new d.Animation("camAlpha","alpha",30,d.Animation.ANIMATIONTYPE_FLOAT,d.Animation.ANIMATIONLOOPMODE_CYCLE);s.setKeys([{frame:0,value:this.arcRotateCamera.alpha},{frame:30*t,value:i}]);var r=new d.Animation("camRadius","radius",30,d.Animation.ANIMATIONTYPE_FLOAT,d.Animation.ANIMATIONLOOPMODE_CYCLE);r.setKeys([{frame:0,value:this.arcRotateCamera.radius},{frame:30*t,value:e.Sight.radius/1.2}]);var o=new d.Animation("camBeta","beta",30,d.Animation.ANIMATIONTYPE_FLOAT,d.Animation.ANIMATIONLOOPMODE_CYCLE);o.setKeys([{frame:0,value:this.arcRotateCamera.beta},{frame:30*t,value:Math.PI/2}]),this.app.scene.beginDirectAnimation(this.arcRotateCamera,[n,s,r,o],0,30*t,!1),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}getSightJson(){return JSON.stringify({alpha:this.arcRotateCamera.alpha,focus:m.vector3ToJson(this.arcRotateCamera.target),radius:this.arcRotateCamera.radius,beta:this.arcRotateCamera.beta,minimumLimit:this.arcRotateCamera.lowerRadiusLimit,maximumLimit:this.arcRotateCamera.upperRadiusLimit,minBeta:this.arcRotateCamera.lowerBetaLimit,maxBeta:this.arcRotateCamera.upperBetaLimit})}computeCameraView(){const e=this.app.canvas.clientWidth/this.app.canvas.clientHeight;this.arcRotateCamera.orthoLeft=-e*this.frustrum,this.arcRotateCamera.orthoRight=e*this.frustrum,this.arcRotateCamera.orthoTop=this.frustrum,this.arcRotateCamera.orthoBottom=-this.frustrum;let t=1e3/(this.frustrum/20);this.arcRotateCamera.panningSensibility=t>2e3?2e3:t<10?10:t}_wheel(e){if(this.arcRotateCamera.mode!=d.Camera.PERSPECTIVE_CAMERA){var t=(e.wheelDelta||24*-e.detail)<0?1.1:.9;this.frustrum*=t,this.computeCameraView()}else{let e=1e3/(this.app.camera.arcRotateCamera.radius/20);this.app.camera.arcRotateCamera.panningSensibility=e>2e3?2e3:e<10?10:e}}switchArcRotateCamera(){this.app.scene.activeCamera=this.arcRotateCamera,this.arcRotateCamera.attachControl(this.app.canvas,!0,!0),this.app.iEvent=new f(this.app)}switchFPSCamera(){this.app.iEvent=new p(this.app)}}class A{constructor(){this.map={}}add(e,t){this.map[e]=t}find(e){return this.map[e]}remove(e){delete this.map[e]}termRemove(e){for(var t in this.map)e(this.map[t])&&delete this.map[t]}showAll(){for(var e in this.map)e+" -> "+this.map[e]+"; "}count(){var e=0;for(var t in Object.keys(this.map))++e;return e}clear(){for(var e in this.map)delete this.map[e]}}class y{static getGUID(e){var t,i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=[];let s=i.length;var r;if(e)for(t=0;t<e;t++)n[t]=i[0|Math.random()*s];else for(n[8]=n[13]=n[18]=n[23]="-",n[14]="4",t=0;t<36;t++)n[t]||(r=0|16*Math.random(),n[t]=i[19==t?3&r|8:r]);return n.join("")}}class b{constructor(e){this.objectType="Light",this.app=e}load(){}}class B extends b{load(){this.light=new d.DirectionalLight(this.id,this.direction,this.app.scene),this.light.position=this.position,this.light.intensity=this.intensity,this.light.diffuse=d.Color3.FromHexString(this.color),this.light.specular=d.Color3.Black()}}class v extends b{load(){this.light=new d.HemisphericLight(this.id,this.direction,this.app.scene),this.light.intensity=this.intensity,this.light.diffuse=d.Color3.FromHexString(this.color),this.light.specular=d.Color3.Black()}}!function(e){e.Point="Point",e.Spot="Spot",e.Directional="Directional",e.Hemispheric="Hemispheric"}(u||(u={}));class C extends b{load(){this.light=new d.PointLight(this.id,this.position.clone(),this.app.scene),this.light.range=this.range,this.light.intensity=this.intensity,this.light.diffuse=d.Color3.FromHexString(this.color),this.light.specular=d.Color3.Black()}}class w extends b{load(){this.light=new d.SpotLight(this.id,this.position.clone(),this.direction.clone(),this.angle*Math.PI/180,this.exponent,this.app.scene),this.light.range=this.range,this.light.position=this.position,this.light.intensity=this.intensity,this.light.diffuse=d.Color3.FromHexString(this.color),this.light.specular=d.Color3.Black()}}class E{set text(e){this._text=e,this.ele.innerText=e,e?this.ele.style.display=null:this.close()}constructor(e){this._text="",this.app=e,this.ele=document.createElement("div"),this.ele.style.cssText="position: absolute;z-index:999999999; font-size: 10px;color: rgb(211, 211, 211);text-shadow:rgba(0, 0, 0, 0.2) 1px 1px 0; padding: 8px 10px;border: 1px solid #353535;background: #292929;border-radius: 20%;",this.app.canvas.parentElement.appendChild(this.ele),this.close()}update(e){this._text&&(this.ele.style.top=e.event.offsetY+"px",this.ele.style.left=e.event.offsetX+20+"px")}close(){this.ele.style.display="none"}setBackground(e){this.url=e,this.ele.style.background="url("+this.url+") no-repeat",this.ele.style.backgroundSize="cover"}dispose(){this.app.canvas.parentElement.removeChild(this.ele),this.ele=null}}class M{constructor(e){this.lights=new A,this.reflexEnabled=!0,this.reflexIntensity=.5,this.app=e,this.color=new d.Color4(0,.0588,.1176,1),this.reflex(ef.rl+"resources/environment.env",.5),this.app.scene.fogEnabled=!0,this.app.scene.fogMode=2,this.fogDistance=800,d.Effect.IncludesShadersStore.fogVertex="\n #ifdef FOG\n vFogDistance=(worldPos).xyz;\n #endif\n "}setTransparent(e=1){this.app.scene.clearColor=new d.Color4(this._color.r,this._color.g,this._color.b,this._color.a*e)}default(){this.color=new d.Color4(0,.0588,.1176,1)}set fogDistance(e){this.app.scene.fogDensity=1/e}set color(e){this._color=new d.Color4(e.r,e.g,e.b,e.a),this.app.scene.clearColor=this._color,this.app.scene.fogColor=new d.Color3(this._color.r,this._color.g,this._color.b)}reflex(e,t){const i=new d.CubeTexture(e,this.app.scene);this.app.scene.environmentTexture=i,this.app.scene.environmentIntensity=t}setBackground(e){this.background&&this.background.dispose(),this.background=new d.Layer("background",e,this.app.scene),this.background.isBackground=!0}setReflexEnabled(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.reflexEnabled=e,this.app.scene.environmentIntensity=this.reflexEnabled?this.reflexIntensity:0,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setFlexIntensity(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.reflexIntensity=e,this.app.scene.environmentIntensity=this.reflexIntensity,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}defaultLights(){let e=new v(this.app);e.id=y.getGUID(12),e.lightType="Hemispheric",e.name="半球光_"+this.lights.count(),e.direction=new d.Vector3(1,1,0),e.color="#FFFFFF",e.intensity=1,this.lights.add(e.id,e);let t=new v(this.app);t.id=y.getGUID(12),t.lightType="Hemispheric",t.name="半球光_"+this.lights.count(),t.direction=new d.Vector3(-1,1,0),t.color="#FFFFFF",t.intensity=.7,this.lights.add(t.id,t)}offAllLight(){for(const e in this.lights.map)this.lights.find(e).light&&(this.lights.find(e).light.intensity=0,this.app.scene.removeLight(this.lights.find(e).light),this.lights.find(e).light.dispose()),this.lights.find(e).light=null}openAllLight(){for(const e in this.lights.map)this.lights.find(e).load()}loadLight(e){for(let t=0;t<e.length;t++){const i=e[t];let n;i.lightType==u.Hemispheric?(n=new v(this.app),n.id=i.id,n.lightType=i.lightType,n.name=i.name,n.direction=m.ToVector3(i.direction),n.color=i.color,n.intensity=i.intensity):i.lightType==u.Directional?(n=new B(this.app),n.id=i.id,n.lightType=i.lightType,n.name=i.name,n.direction=m.ToVector3(i.direction),n.position=m.ToVector3(i.position),n.color=i.color,n.intensity=i.intensity):i.lightType==u.Spot?(n=new w(this.app),n.id=i.id,n.lightType=i.lightType,n.name=i.name,n.direction=m.ToVector3(i.direction),n.position=m.ToVector3(i.position),n.angle=i.angle,n.exponent=i.exponent,n.range=i.range,n.color=i.color,n.intensity=i.intensity):i.lightType==u.Point&&(n=new C(this.app),n.id=i.id,n.lightType=i.lightType,n.name=i.name,n.position=m.ToVector3(i.position),n.range=i.range,n.color=i.color,n.intensity=i.intensity),n&&this.lights.add(n.id,n)}this.lights.count()<1&&this.defaultLights(),this.openAllLight()}setLightIntensity(e=1){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.lights;for(const t in this.lights.map)this.lights.find(t).light.intensity=this.lights.find(t).intensity*e;this.app.scene.environmentIntensity=this.reflexIntensity*e,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}showTips(){this.app.toolTips=new E(this.app)}closeTips(){this.app.toolTips&&this.app.toolTips.dispose(),this.app.toolTips=null}showFps(e="position: absolute;left: 5px;bottom: 5px;z-index:999999999; font-size: 10px;color: rgb(0, 255, 0);text-shadow:rgba(0, 0, 0, 0.2) 1px 1px 0;"){this.app.fps||(this.app.fps=document.createElement("div"),this.app.canvas.parentElement.appendChild(this.app.fps)),this.app.fps.style.cssText=e}hideFps(){this.app.fps&&this.app.canvas.parentElement.removeChild(this.app.fps),this.app.fps=null}showDebug(){this.app.scene.debugLayer.show()}}var T,x,I;!function(e){e.Cabinet="Cabinet",e.RackModel="RackModel",e.Corner="Corner",e.Other="Other",e.Door="Door",e.Floor="Floor",e.LeakWater="LeakWater",e.UI3D="UI3D",e.VirtualBox="VirtualBox",e.Wall="Wall",e.Window="Window",e.Conduit="Conduit",e.Building="Building",e.Storey="Storey",e.Campus="Campus"}(T||(T={})),function(e){e.leftClick="leftClick",e.rightClick="rightClick",e.doubleClick="doubleClick",e.eover="eover",e.longPress="longPress",e.out="out",e.click="click"}(x||(x={}));class R{toJosn(e){let t=JSON.parse(e);this.alpha=t.alpha,this.beta=t.beta,this.radius=t.radius,this.minimumLimit=t.minimumLimit,this.maximumLimit=t.maximumLimit,this.minBeta=t.minBeta,this.maxBeta=t.maxBeta,this.focus=m.ToVector3(t.focus)}toString(){return JSON.stringify({alpha:this.alpha,focus:m.vector3ToJson(this.focus),radius:this.radius,beta:this.beta,minimumLimit:this.minimumLimit,maximumLimit:this.maximumLimit,minBeta:this.minBeta,maxBeta:this.maxBeta})}setLimit(e,t){this.minimumLimit=e+.3,this.maximumLimit=t}setBeta(e,t){this.minBeta=e,this.maxBeta=t}}!function(e){e[e.Opaque=0]="Opaque",e[e.Flash=1]="Flash",e[e.Transparent=2]="Transparent"}(I||(I={}));class S{constructor(e){this.statusType=I.Opaque,this.app=e}getInto(){}goBack(){}loadProperties(e){this.id="墙角_"+y.getGUID(12),this.name="墙角",this.parentId=e.parentId,this.customNumber=this.id,this.objectType=T.Corner,this.customType=this.objectType,this.height=e.height,this.pints=e.corners}alwaysActive(){this.instance.getChildMeshes().forEach((e=>{e.alwaysSelectAsActiveMesh=!0,e.doNotSyncBoundingInfo=!1,e.ignoreNonUniformScaling=!0})),this.instance.alwaysSelectAsActiveMesh=!0,this.instance.doNotSyncBoundingInfo=!1}optimization(e){this.instance.getChildMeshes().forEach((t=>{e?t.freezeWorldMatrix():t.unfreezeWorldMatrix()})),e?this.instance.freezeWorldMatrix():this.instance.unfreezeWorldMatrix(),this.instance.material&&(e?this.instance.material.freeze():this.instance.material.unfreeze())}setFlash(e){}setEnabled(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.setEnabled(e),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}addEventListener(e,t){}removeEventListener(e){}computeView(){}bind(){let e=new Array;for(let t=0;t<this.pints.length;t++)if(this.pints[t].pints.length>2){let i=d.MeshBuilder.CreatePolygon(this.id,{shape:this.pints[t].pints,sideOrientation:d.Mesh.FRONTSIDE},this.app.scene);i.setEnabled(!1),i.position.y=this.pints[t].height,i.isPickable=!0,i.enablePointerMoveEvents=!1,e.push(i)}return!(e.length<1)&&(e.length>1?this.instance=m.MergeMeshes(e,this.app):this.instance=e[0],this.instance.id=this.id,this.instance.name=this.id,this.instance.position.y=this.height,this.instance.setEnabled(!1),this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1,!0)}toJson(){return{id:this.id,parentId:this.parentId,name:this.name,customNumber:this.customNumber,customType:this.customType,objectType:this.objectType}}completed(){this.alwaysActive(),this.optimization(!0)}setOpaque(){this.setEnabled(!0),this.statusType=I.Opaque}setTransparent(){this.setEnabled(!1),this.statusType=I.Transparent}}class O{static init(){let e=new d.TWEEN.Tween(this.colors[1]).to({r:1,g:0,b:0},500),t=new d.TWEEN.Tween(this.colors[1]).to({r:1,g:.5,b:.5},500);t.chain(e),e.chain(t),e.start();let i=new d.TWEEN.Tween(this.colors[2]).to({r:1,g:.55,b:0},500),n=new d.TWEEN.Tween(this.colors[2]).to({r:0,g:0,b:0},500);i.chain(n),n.chain(i),i.start();let s=new d.TWEEN.Tween(this.colors[3]).to({r:1,g:.84,b:0},500),r=new d.TWEEN.Tween(this.colors[3]).to({r:0,g:0,b:0},500);s.chain(r),r.chain(s),s.start();let o=new d.TWEEN.Tween(this.colors[4]).to({r:0,g:.75,b:1},500),a=new d.TWEEN.Tween(this.colors[4]).to({r:0,g:0,b:0},500);o.chain(a),a.chain(o),o.start();let c=new d.TWEEN.Tween(this.colors[5]).to({r:.53,g:.8,b:0},500),h=new d.TWEEN.Tween(this.colors[5]).to({r:0,g:0,b:0},500);c.chain(h),h.chain(c),c.start();let l=new d.TWEEN.Tween(this.colors[6]).to({r:.8,g:.8,b:.8},500),u=new d.TWEEN.Tween(this.colors[6]).to({r:0,g:0,b:0},500);l.chain(u),u.chain(l),l.start()}}O.colors={1:d.Color3.Red(),2:new d.Color3(1,.5,0),3:d.Color3.Yellow(),4:new d.Color3(0,1,1),5:d.Color3.Green(),6:d.Color3.Gray()};class D{constructor(e){this.executes=new A,this.clickEvents=new A,this.touchtime=(new Date).getTime(),this.statusType=I.Opaque,this.app=e}loadProperties(e){this.id=e.id,this.customNumber=e.customNumber,this.parentId=e.parentId,this.name=e.name,this.baseModel=e.baseModel,this.isLoop=e.isLoop,this.objectType=e.objectType,this.customType=e.customType,this.position=m.ToVector3(e.position),this.rotation=m.ToVector3(e.rotation),this.scaling=m.ToVector3(e.scaling)}setEnabled(e){if(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach((e=>e.dispose())),e){let e=new d.Mesh(this.id,this.app.scene);this.app.resources.resources.find(this.baseModel.modelId).meshes[0].getChildMeshes().forEach((t=>{var i=t.createInstance(this.id);i.isPickable=!1,i.enablePointerMoveEvents=!1,i.parent=e})),e.rotation=m.ToVector3(this.rotation.clone()),e.position=m.ToVector3(this.position.clone()),e.scaling=m.ToVector3(this.scaling.clone()),this.instance.addChild(e),this.alwaysActive(),this.optimization(!0)}this.instance.setEnabled(e),this.isPickable=e,this.statusType=I.Opaque,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}set showBoundingBox(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.showBoundingBox=e,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}get showBoundingBox(){return this.instance.showBoundingBox}set isPickable(e){e?(this.instance.isPickable=this.executes.count()>0,this.executes.find(x.eover)||this.executes.find(x.out)?this.instance.enablePointerMoveEvents=!0:this.instance.enablePointerMoveEvents=!1):(this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1)}get isPickable(){return this.instance.isPickable}bind(){let e=this.app.resources.resources.find(this.baseModel.modelId),t=m.computeBounds(e.meshes[0]);this.instance=this.app.resources.BOX.clone(this.id),this.instance.id=this.id,this.instance.enablePointerMoveEvents=!1,this.instance.isPickable=!1,this.instance.scaling=new d.Vector3((t.maximum.x-t.minimum.x)*this.scaling.x,(t.maximum.y-t.minimum.y)*this.scaling.y,(t.maximum.z-t.minimum.z)*this.scaling.z),0==this.instance.scaling.y&&(this.instance.scaling.y=.01),this.instance.position=m.ToVector3(this.position.clone()),this.instance.position.y=(t.maximum.y-t.minimum.y)/2+this.position.y,this.instance.rotation=m.ToVector3(this.rotation.clone()),this.instance.setEnabled(!1),this.completed()}completed(){this.alwaysActive(),this.optimization(!0),this.computeView()}computeView(){this.Sight=new R;let e=this.instance.getBoundingInfo(),t=m.getVisualAngle(e,this.app);this.Sight.alpha=t.alpha,this.Sight.beta=t.beta,this.Sight.focus=this.instance.getAbsolutePosition(),this.Sight.radius=5*e.boundingSphere.radius,this.Sight.minimumLimit=.3,this.Sight.maximumLimit=2*this.Sight.radius,this.Sight.minBeta=.01,this.Sight.maxBeta=Math.PI/2*.98}optimization(e){this.instance.getChildMeshes().forEach((t=>{e?t.freezeWorldMatrix():t.unfreezeWorldMatrix()})),e?this.instance.freezeWorldMatrix():this.instance.unfreezeWorldMatrix(),this.instance.material&&(e?this.instance.material.freeze():this.instance.material.unfreeze())}alwaysActive(){this.instance.getChildMeshes().forEach((e=>{e.alwaysSelectAsActiveMesh=!0,e.doNotSyncBoundingInfo=!1,e.ignoreNonUniformScaling=!0})),this.instance.alwaysSelectAsActiveMesh=!0,this.instance.doNotSyncBoundingInfo=!1}addEventListener(e,t){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let i=null;if(e==x.leftClick||e==x.rightClick||e==x.doubleClick?(this.clickEvents.remove(e),this.clickEvents.add(e,t),this.instance.isPickable=!0,i=new d.ExecuteCodeAction(d.ActionManager.OnPickTrigger,(e=>{let t=this.clickEvents.find(x.leftClick);t&&0==e.sourceEvent.button&&t(this,e);let i=this.clickEvents.find(x.rightClick);i&&2==e.sourceEvent.button&&i(this,e);let n=this.clickEvents.find(x.doubleClick);n&&0==e.sourceEvent.button&&(new Date).getTime()-this.touchtime<500&&n(this,e),this.touchtime=(new Date).getTime()})),e=x.click):e==x.eover?(i=new d.ExecuteCodeAction(d.ActionManager.OnPointerOverTrigger,(e=>t(this,e))),this.instance.enablePointerMoveEvents=!0):e==x.longPress?i=new d.ExecuteCodeAction(d.ActionManager.OnLongPressTrigger,(e=>t(this,e))):e==x.out&&(i=new d.ExecuteCodeAction(d.ActionManager.OnPointerOutTrigger,(e=>t(this,e))),this.instance.enablePointerMoveEvents=!0),i){this.action||(this.action=new d.ActionManager(this.app.scene),this.instance.actionManager=this.action);let t=this.executes.find(e);t&&this.action.unregisterAction(t),this.executes.remove(e),this.executes.add(e,i),this.action.registerAction(i)}this.isPickable=!0,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}removeEventListener(e){if(e==x.leftClick||e==x.rightClick||e==x.doubleClick){if(this.clickEvents.remove(e),this.clickEvents.count()>0)return;e=x.click}this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let t=this.executes.find(e);t&&this.action.unregisterAction(t),this.executes.remove(e),0==this.executes.count()&&(this.action=null,this.instance.actionManager=this.action),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setFlash(e){this.statusType==I.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach((t=>{t.instancedBuffers&&(t.instancedBuffers.color=O.colors[e])})),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.statusType=I.Flash)}setOpaque(){this.statusType!=I.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach((e=>{e.setEnabled(!0),e.instancedBuffers&&(e.instancedBuffers.color=new d.Color4(1,1,1,1))})),this.instance.disableEdgesRendering(),this.instance.visibility=0,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.statusType=I.Opaque)}setTransparent(e=.3,t=!1){this.statusType==I.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach((e=>e.setEnabled(!1))),this.instance.visibility=e,t&&this.instance.enableEdgesRendering(),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.statusType=I.Transparent)}setColor(e="#ffffff"){this.statusType==I.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach((t=>{t.instancedBuffers&&(t.instancedBuffers.color=d.Color4.FromHexString(e))})),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1)}play(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach((e=>{let t;e.animations.forEach((e=>{-1!=e.name.indexOf("open")&&(t=e)})),t?this.app.scene.beginDirectAnimation(e,[t],0,10*t.getKeys().length,this.isLoop):e.animations.forEach((t=>this.app.scene.beginDirectAnimation(e,[t],0,10*t.getKeys().length,this.isLoop)))})),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}stop(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach((e=>{let t;e.animations.forEach((e=>{-1!=e.name.indexOf("close")&&(t=e)})),t?this.app.scene.beginDirectAnimation(e,[t],0,10*t.getKeys().length,!1):e.animations.forEach((t=>this.app.scene.beginDirectAnimation(e,[t],10*t.getKeys().length,0,!1)))})),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}toJson(){return{id:this.id,parentId:this.parentId,name:this.name,customNumber:this.customNumber,customType:this.customType,objectType:this.objectType}}getInto(){this.app.camera.flyTo(this.Sight)}goBack(){}}class F extends D{loadProperties(e){this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.baseModel=e.baseModel,this.objectType=T.Floor,this.vectors=e.vectors,this.buckles=e.buckles,this.height=e.height}setEnabled(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.setEnabled(e),e?(this.instance.isPickable=this.executes.count()>0,this.executes.find(x.eover)||this.executes.find(x.out)?this.instance.enablePointerMoveEvents=!0:this.instance.enablePointerMoveEvents=!1):(this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}bind(){this.instance=d.MeshBuilder.CreatePolygon("地板",{shape:m.Expand(this.vectors,-.01),holes:this.buckles,sideOrientation:d.Mesh.DOUBLESIDE},this.app.scene),this.instance.setEnabled(!1),this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1,this.instance.position.y=this.height-.01,this.instance.id=this.id,this.instance.name="地板";var e=this.app.resources.GetMaterial(this.baseModel).clone(this.id);let t=this.instance.getBoundingInfo();this.Sight=m.getVisualAngle(t,this.app),this.baseModel.isTiling&&(e.diffuseTexture.uScale=(t.maximum.x-t.minimum.x)/this.baseModel.width,e.diffuseTexture.vScale=(t.maximum.z-t.minimum.z)/this.baseModel.length),this.instance.material=e,this.completed()}computeView(){this.Sight=new R;let e=this.instance.getBoundingInfo(),t=m.getVisualAngle(e,this.app);this.Sight.alpha=t.alpha,this.Sight.beta=t.beta,this.Sight.focus=e.boundingBox.center.clone(),this.Sight.focus.y=this.instance.position.y,this.Sight.radius=2*e.boundingSphere.radius,this.Sight.minimumLimit=.3,this.Sight.maximumLimit=2*this.Sight.radius,this.Sight.minBeta=.01,this.Sight.maxBeta=Math.PI/2*.98}setOpaque(){this.statusType!=I.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.visibility=1,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.statusType=I.Opaque)}}class _ extends D{loadProperties(e){this.id="墙_"+y.getGUID(12),this.objectType=T.Wall,this.parentId=e.parentId,this.name="墙体",this.customNumber=this.id,this.customType=this.objectType,this.walls=e.walls,this.height=e.height,this.baseModel=e.baseModel,this.baseModel&&!this.baseModel.length&&(this.baseModel.length=3.1)}setEnabled(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.setEnabled(e),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}bind(){this.instance=m.MergeMeshes(this.walls,this.app),this.instance.setEnabled(!1),this.instance.receiveShadows=!0,this.baseModel?this.nativeMaterial=this.app.resources.GetMergeMaterial(this.baseModel):this.nativeMaterial=null,this.instance.material=this.nativeMaterial,this.instance.id=this.id,this.instance.name=this.id,this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1,this.instance.position.y+=this.height,this.completed()}completed(){this.alwaysActive(),this.optimization(!0)}setOpaque(){this.statusType!=I.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.visibility=1,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.statusType=I.Opaque)}}class G{constructor(e){this.executes=new A,this.clickEvents=new A,this.touchtime=(new Date).getTime(),this.app=e}loadProperties(e){}bind(){}completed(){this.computeView()}setEnabled(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.setEnabled(e),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}addEventListener(e,t){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let i=null;if(e==x.leftClick||e==x.rightClick||e==x.doubleClick?(this.clickEvents.remove(e),this.clickEvents.add(e,t),this.instance.isPickable=!0,i=new d.ExecuteCodeAction(d.ActionManager.OnPickTrigger,(e=>{let t=this.clickEvents.find(x.leftClick);t&&0==e.sourceEvent.button&&t(this,e);let i=this.clickEvents.find(x.rightClick);i&&2==e.sourceEvent.button&&i(this,e);let n=this.clickEvents.find(x.doubleClick);n&&0==e.sourceEvent.button&&(new Date).getTime()-this.touchtime<500&&n(this,e),this.touchtime=(new Date).getTime()})),e=x.click):e==x.eover?(i=new d.ExecuteCodeAction(d.ActionManager.OnPointerOverTrigger,(e=>t(this,e))),this.instance.enablePointerMoveEvents=!0):e==x.longPress?i=new d.ExecuteCodeAction(d.ActionManager.OnLongPressTrigger,(e=>t(this,e))):e==x.out&&(i=new d.ExecuteCodeAction(d.ActionManager.OnPointerOutTrigger,(e=>t(this,e))),this.instance.enablePointerMoveEvents=!0),i){this.action||(this.action=new d.ActionManager(this.app.scene),this.instance.actionManager=this.action);let t=this.executes.find(e);t&&this.action.unregisterAction(t),this.executes.remove(e),this.executes.add(e,i),this.action.registerAction(i)}this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}removeEventListener(e){if(e==x.leftClick||e==x.rightClick||e==x.doubleClick){if(this.clickEvents.remove(e),this.clickEvents.count()>0)return;e=x.click}this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let t=this.executes.find(e);t&&this.action.unregisterAction(t),this.executes.remove(e),0==this.executes.count()&&(this.action=null,this.instance.actionManager=this.action),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}load(e,t){let i=new Array;for(let e=0;e<t.length;e++){let n=t[e];n.objectType==T.Wall&&(n.height||(n.height=3.1),n.ply||(n.ply=.09),i.push(n))}let n=new A;for(let e=0;e<t.length;e++){let s=t[e];s.objectType==T.Corner&&(n.add(s.id,s.corner),s.pints.length>2&&(s.height=3.1,s.walls.forEach((e=>{i.forEach((t=>{e==t.id&&parseFloat(t.height)<s.height&&(s.height=parseFloat(t.height))}))}))))}if(!e){let e=new Array;for(let i=0;i<t.length;i++){let n=t[i];n.objectType==T.Corner&&e.push(n)}let i=new S(this.app);i.loadProperties({parentId:this.id,height:this.position.y,corners:e}),i.bind()?this.app.project.objectDatas.add(i.id,i):i=null}for(let e=0;e<t.length;e++){let i=t[e];if(i.objectType!=T.Floor)continue;i.vectors=new Array;let s=t[e];s.pints.forEach((e=>{n.find(e),i.vectors.push(n.find(e))})),i.buckles=new Array,s.holes&&s.holes.forEach((e=>{let t=new Array;e.forEach((e=>t.push(n.find(e)))),i.buckles.push(t)})),s.middles&&s.middles.forEach((e=>{let s=Array();for(let i=0;i<t.length;i++)t[i].id==e&&t[i].pints.forEach((e=>{let t=n.find(e);s.push(new d.Vector3(t.x,0,t.z))}));i.buckles.push(s)})),i.height=this.position.y;let r=new F(this.app);r.loadProperties(i),r.bind(),this.app.project.objectDatas.add(r.id,r)}if(n=null,!e){let e=new A;e.add("body",{t:"",walls:new Array});for(let t=0;t<i.length;t++){let n=d.MeshBuilder.ExtrudePolygon(i[t].id,{shape:[m.ToVector3(i[t].wtop),m.ToVector3(i[t].wleft),m.ToVector3(i[t].wbottom),m.ToVector3(i[t].wright)],depth:parseFloat(i[t].height),sideOrientation:d.Mesh.FRONTSIDE},this.app.scene);n.setEnabled(!1),n.position.y=parseFloat(i[t].height),n.subMeshes=[];var s=n.getTotalVertices();n.subMeshes.push(new d.SubMesh(0,0,s,0,6,n)),n.subMeshes.push(new d.SubMesh(0,1,s,18,6,n)),n.subMeshes.push(new d.SubMesh(0,2,s,30,6,n));for(let e=0;e<i[t].wallwindows.length;e++){const s=d.CSG.FromMesh(n);let a=this.app.project.objectDatas.find(i[t].wallwindows[e]);var r=a.instance.getBoundingInfo(),o=d.MeshBuilder.CreateBox((new Date).getTime().toString(),{height:r.maximum.y-r.minimum.y,width:r.maximum.x-r.minimum.x,depth:2*parseFloat(i[t].ply)+.1},this.app.scene);o.position=a.instance.position.clone(),o.position.y=(r.maximum.y-r.minimum.y)/2+a.height,o.rotation=a.instance.rotation.clone();const c=d.CSG.FromMesh(o);let h=s.subtract(c);o.dispose(),n.dispose(),n=h.toMesh(i[t].id,null,this.app.scene,!0),n.setEnabled(!1)}let a=e.find(i[t].leftMap.modelId);a||(a={t:i[t].leftMap,walls:new Array},e.add(i[t].leftMap.modelId,a));let c=e.find(i[t].rightMap.modelId);c||(c={t:i[t].rightMap,walls:new Array},e.add(i[t].rightMap.modelId,c));let h=m.DeconsTructMesh(n,parseFloat(i[t].height),this.app);for(let t=0;t<h.length;t++)2==t||3==t?a.walls.push(h[t]):4==t||5==t?c.walls.push(h[t]):e.find("body").walls.push(h[t])}for(const t in e.map){let i=e.find(t);if(i.walls.length>0){let e=new _(this.app);e.loadProperties({baseModel:i.t,walls:i.walls,parentId:this.id,height:this.position.y}),e.bind(),this.app.project.objectDatas.add(e.id,e)}}}this.completed(),i=null}toJson(){return{id:this.id,parentId:this.parentId,name:this.name,customNumber:this.customNumber,customType:this.customType,objectType:this.objectType,index:this.index,layerHeight:this.layerHeight,layerName:this.layerName}}computeView(){var e,t;let i=this.app.project.getChildsById(this.id,!0);i.length>0&&(e=t=i[0].instance.position.clone());for(let n=0;n<i.length;n++){let s=i[n];if(s.objectType==T.Storey||s.objectType==T.Campus)continue;let r=s.instance.getBoundingInfo();e=d.Vector3.Minimize(e,r.minimum.add(s.instance.position)),t=d.Vector3.Maximize(t,r.maximum.add(s.instance.position))}e&&t||(e=d.Vector3.Zero(),t=new d.Vector3(12,0,8)),this.Sight=new R;let n=m.getVisualAngle(new d.BoundingInfo(e,t),this.app);this.Sight.alpha=n.alpha,this.Sight.beta=n.beta,this.Sight.focus=n.focus,this.Sight.radius=n.radius,this.Sight.minimumLimit=.3,this.Sight.maximumLimit=2*this.Sight.radius,this.Sight.minBeta=.01,this.Sight.maxBeta=Math.PI/2*.98}getInto(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;for(let e in this.app.project.objectDatas.map){let t=this.app.project.objectDatas.find(e);t instanceof D&&t.setOpaque(),t.setEnabled(t.parentId==this.id)}this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}goBack(){}}class L extends D{loadProperties(e){this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.baseModel=e.baseModel,this.height=e.baseModel.height,this.objectType=T.Door,this.rotation=m.ToVector3(e.rotation),this.position=m.ToVector3(e.position)}setEnabled(e){if(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach((e=>e.dispose())),e){let e=new d.Mesh(this.id,this.app.scene);this.app.resources.resources.find(this.baseModel.modelId).meshes[0].getChildMeshes().forEach((t=>{var i=t.createInstance(this.id);i.isPickable=!1,i.enablePointerMoveEvents=!1,i.parent=e})),e.rotation=m.ToVector3(this.rotation.clone()),e.position=m.ToVector3(this.position.clone()),this.instance.addChild(e),this.alwaysActive(),this.optimization(!0)}this.instance.setEnabled(e),this.isPickable=e,this.statusType=I.Opaque,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}bind(){let e=this.app.resources.resources.find(this.baseModel.modelId),t=m.computeBounds(e.meshes[0]);this.instance=this.app.resources.BOX.clone(this.id),this.instance.setBoundingInfo(t),this.instance.id=this.id,this.instance.enablePointerMoveEvents=!1,this.instance.isPickable=!1,this.instance.scaling=new d.Vector3(t.maximum.x-t.minimum.x,t.maximum.y-t.minimum.y,t.maximum.z-t.minimum.z),this.instance.position=m.ToVector3(this.position.clone()),this.instance.position.y=(t.maximum.y-t.minimum.y)/2+this.position.y,this.instance.rotation=m.ToVector3(this.rotation.clone()),this.instance.setEnabled(!1),this.completed()}}class P extends D{loadProperties(e){this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.baseModel=e.baseModel,this.height=e.baseModel.height,this.objectType=T.Window,this.rotation=m.ToVector3(e.rotation),this.position=m.ToVector3(e.position)}setEnabled(e){if(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach((e=>e.dispose())),e){let e=new d.Mesh(this.id,this.app.scene);this.app.resources.resources.find(this.baseModel.modelId).meshes[0].getChildMeshes().forEach((t=>{var i=t.createInstance(this.id);i.isPickable=!1,i.enablePointerMoveEvents=!1,i.parent=e})),e.rotation=m.ToVector3(this.rotation.clone()),e.position=m.ToVector3(this.position.clone()),this.instance.addChild(e),this.alwaysActive(),this.optimization(!0)}this.instance.setEnabled(e),this.isPickable=e,this.statusType=I.Opaque,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}bind(){let e=this.app.resources.resources.find(this.baseModel.modelId),t=m.computeBounds(e.meshes[0]);this.instance=this.app.resources.BOX.clone(this.id),this.instance.setBoundingInfo(t),this.instance.id=this.id,this.instance.enablePointerMoveEvents=!1,this.instance.isPickable=!1,this.instance.scaling=new d.Vector3(t.maximum.x-t.minimum.x,t.maximum.y-t.minimum.y,t.maximum.z-t.minimum.z),this.instance.position=m.ToVector3(this.position.clone()),this.instance.position.y=(t.maximum.y-t.minimum.y)/2+this.position.y,this.instance.rotation=m.ToVector3(this.rotation.clone()),this.instance.setEnabled(!1),this.completed()}}class k extends G{loadProperties(e){this.id=e.id,this.name=e.name,this.parentId=e.parentId,this.index=e.index,this.layerName=this.index<0?"B"+this.index:"F"+(this.index+1),this.layerHeight=e.layerHeight,this.objectType=e.objectType,this.customNumber=e.customNumber?e.customNumber:e.id,this.customType=e.customType?e.customType:this.objectType,this.position=m.ToVector3(e.position),this.rotation=m.ToVector3(e.rotation),this.scaling=m.ToVector3(e.scaling)}bind(){this.instance=d.MeshBuilder.CreateGround(this.id,{width:this.scaling.x,height:this.scaling.z},this.app.scene),this.instance.enablePointerMoveEvents=!1,this.instance.isPickable=!1;let e=new d.StandardMaterial("mat_"+this.id,this.app.scene);e.diffuseColor=d.Color3.White(),e.alpha=0,e.backFaceCulling=!1,this.instance.material=e,this.instance.position=this.position,this.instance.position.y-=.01,this.instance.rotation=this.rotation.clone(),this.setEnabled(!1)}alwaysActive(){this.instance.getChildMeshes().forEach((e=>{e.alwaysSelectAsActiveMesh=!0,e.doNotSyncBoundingInfo=!1,e.ignoreNonUniformScaling=!0})),this.instance.alwaysSelectAsActiveMesh=!0,this.instance.doNotSyncBoundingInfo=!1}completed(){this.alwaysActive(),this.computeView()}computeView(){var e,t;let i=this.app.project.getChildsById(this.id);i.length>0&&(e=t=i[0].instance.position.clone());for(let n=0;n<i.length;n++){let s=i[n];if(s.objectType==T.Storey||s.objectType==T.Campus||s.objectType==T.Wall||s.objectType==T.Corner)continue;let r=s.instance.getBoundingInfo();e=d.Vector3.Minimize(e,r.minimum.add(s.instance.position)),t=d.Vector3.Maximize(t,r.maximum.add(s.instance.position))}e&&t||(e=d.Vector3.Zero(),t=new d.Vector3(12,0,8)),this.Sight=m.getVisualAngle(new d.BoundingInfo(e,t),this.app)}}class N extends D{completed(){this.alwaysActive(),this.optimization(!0),this.computeView()}computeView(){let e=this.app.resources.resources.find(this.baseModel.modelId);this.instance.setBoundingInfo(m.computeBounds(e.meshes[0])),this.Sight=new R;let t=this.instance.getBoundingInfo(),i=m.getVisualAngle(t,this.app);this.Sight.alpha=i.alpha,this.Sight.beta=i.beta,this.Sight.focus=this.position.clone(),this.Sight.radius=2*t.boundingSphere.radius,this.Sight.minimumLimit=.3,this.Sight.maximumLimit=3*this.Sight.radius,this.Sight.minBeta=.01,this.Sight.maxBeta=Math.PI/2*.98}getInto(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let e=new A;this.app.project.getChildsById(this.id).forEach((t=>{let i=!0,n=this.app.project.getChildsById(t.id);for(let s=0;s<n.length;s++){let r=n[s];(r instanceof _||r instanceof L||r instanceof S||r instanceof P||r instanceof F)&&(e.add(r.id,r.id),i=!1),r instanceof _&&t instanceof k&&(r.addEventListener(x.leftClick,(()=>{this.app.project.switchLevel(t.id)})),r.addEventListener(x.eover,(()=>{this.app.toolTips.text=t.layerName})),r.addEventListener(x.out,(()=>{this.app.toolTips.text=""})))}e.add(t.id,t.id)}));for(const t in this.app.project.objectDatas.map){let i=this.app.project.objectDatas.find(t);e.find(i.id)||i.parentId==this.parentId?i.setEnabled(!0):i.setEnabled(!1)}this.setEnabled(!1);let t=this.app.project.getChildsById(this.parentId);for(let e=0;e<t.length;e++){const i=t[e];i instanceof N&&i.id!=this.id&&(i.isPickable=!1,this.app.resources.setTransparentById(i.baseModel.modelId,.3))}this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}goBack(){let e=this.app.project.getChildsById(this.parentId);for(let t=0;t<e.length;t++){const i=e[t];i instanceof N&&i.id!=this.id&&(i.isPickable=!0,this.app.resources.setTransparentById(i.baseModel.modelId,1))}this.app.toolTips.text="",this.app.project.getChildsById(this.id).forEach((e=>{let t=this.app.project.getChildsById(e.id);for(let e=0;e<t.length;e++){let i=t[e];i instanceof _&&(i.removeEventListener(x.leftClick),i.removeEventListener(x.eover),i.removeEventListener(x.out))}}))}}class U{constructor(e){this.objectDatas=new A,this.app=e}clear(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;for(const e in this.objectDatas.map)this.objectDatas.find(e).instance&&this.objectDatas.find(e).instance.dispose();this.objectDatas.clear(),this.current=null,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}optimization(){this.app.scene.freezeActiveMeshes()}getChildsById(e=this.root.id,t=!1){e||(e=this.root.id);let i=new Array;const n=e=>{for(const s in this.objectDatas.map){let r=this.objectDatas.find(s);r.parentId==e&&(i.push(r),t&&n(r.id))}};return n(e),i}getSceneTree(e=this.root.id,t=[]){e||(e=this.root.id);const i=(e,n)=>{for(const s in this.objectDatas.map){let r=this.objectDatas.find(s);if(r.parentId!=e)continue;let o=!1;for(let e=0;e<t.length;e++)r.customType!=t[e]||(o=!0);o||(n.push(Object.assign(Object.assign({},r.toJson()),{children:[]})),i(r.id,n[n.length-1].children))}};let n=this.objectDatas.find(e);if(!n)return void console.error("指定的层级不存在");let s=Object.assign(Object.assign({},n.toJson()),{children:[]});return i(this.root.id,s.children),s}findObjectById(e){return this.objectDatas.find(e)}findObjectByCustomNumber(e){let t=[];for(const i in this.objectDatas.map){let n=this.objectDatas.find(i);n.customNumber==e&&t.push(n)}return 0==t.length?null:(t.length>1&&t.length,t[0])}findObjectsByCustomType(e,t={isCurrent:!1,isEnabled:!1}){let i=[],n=this.current.id;this.current instanceof G||!this.current.parentId||(n=this.current.parentId);for(const s in this.objectDatas.map){let r=this.objectDatas.find(s);r.customType==e&&(t.isCurrent&&r.parentId!=n||t.isEnabled&&1!=r.instance.isEnabled()||i.push(r))}return i}findObjectsByType(e){let t=new Array;for(const i in this.objectDatas.map){let n=this.objectDatas.find(i);n.objectType==e&&t.push(n)}return t}computeSight(e){var t=d.Vector3.Zero(),i=d.Vector3.Zero();for(let n=0;n<e.length;n++){let s=e[n];if(s.objectType==T.Storey||s.objectType==T.Campus)continue;let r=s.instance.getBoundingInfo();t&&i||(t=i=r.boundingBox.center.clone()),t=d.Vector3.Minimize(t,r.minimum.add(s.instance.position)),i=d.Vector3.Maximize(i,r.maximum.add(s.instance.position))}return t&&i||(t=d.Vector3.Zero(),i=new d.Vector3(12,0,8)),m.getVisualAngle(new d.BoundingInfo(t,i),this.app)}switchLevel(e=this.root.id,t=!0){e||(e=this.root.id);let i=this.objectDatas.find(e);if(i){if(this.current&&this.current.goBack(),!(i instanceof G||i instanceof N)){let e=this.objectDatas.find(i.parentId);this.current instanceof G||this.current instanceof N?i.parentId!=this.current.id&&e.getInto():i.parentId!=this.current.parentId&&e.getInto()}i.getInto(),this.current=i,this.levelEvent&&this.levelEvent(this.current),t&&(i instanceof G||i instanceof N)&&this.app.camera.perspective(i)}else console.error("层级不存在")}goBack(){this.app.isDefaultMutual&&(this.current?this.current.parentId?(this.current.goBack&&this.current.goBack(),this.switchLevel(this.current.parentId)):console.error("已经是最顶层级!"):console.error("层级有误、未知错误!"))}getTypes(e=null){let t=[],i=new A;for(let t in this.objectDatas.map){let n=this.objectDatas.find(t);e&&n.parentId!=e||(i.find(n.objectType)||i.add(n.objectType,n.objectType))}for(let e in i.map)t.push(e);return t}getCustomTypes(e=null){let t=[],i=new A;for(let t in this.objectDatas.map){let n=this.objectDatas.find(t);e&&n.parentId!=e||(i.find(n.customType)||i.add(n.customType,n.customType))}for(let e in i.map)t.push(e);return t}}var H=function(e,t,i,n){return new(i||(i=Promise))((function(s,r){function o(e){try{c(n.next(e))}catch(e){r(e)}}function a(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};class j{constructor(e){this.walls=new A,this.resources=new A,this.ndoeMats=new A,this.Materials=new A,this.Textures=new A,this.MergeMaterials=new A,this.app=e;let t=y.getGUID(12);this.transparentBox=d.MeshBuilder.CreateBox(t,{size:1},this.app.scene),this.transparentBox.alwaysSelectAsActiveMesh=!0;let i=new d.StandardMaterial(t,this.app.scene);i.diffuseTexture=new d.Texture(ef.rl+"resources/white.jpg",this.app.scene,!0,!1),i.alphaMode=d.Engine.ALPHA_COMBINE,i.emissiveColor=d.Color3.Green(),this.transparentBox.material=i,this.transparentBox.setEnabled(!1),this.transparentBox.visibility=.3;let n=y.getGUID(12);this.BOX=d.MeshBuilder.CreateBox(n,{size:1},this.app.scene),this.BOX.edgesColor=d.Color4.FromHexString("#4ba3fff2"),this.BOX.setEnabled(!1),this.BOX.visibility=0,this.FogTex=new d.Texture(ef.rl+"resources/fogtex.png",this.app.scene,!0,!1)}loadModelMesh(e){return H(this,void 0,void 0,(function*(){let t=this.resources.find(e.modelId);if(!t)try{t=yield d.SceneLoader.LoadAssetContainerAsync(ef.rl+"bundle/"+e.modelId+"/",e.modelId+e.extension,this.app.scene),t.animationGroups.length>0&&t.animationGroups[0].stop(),t.addAllToScene(),t.meshes[0].setEnabled(!1),t.meshes[0].getChildMeshes().forEach((i=>{if(i.metadata&&i.metadata.gltf&&i.metadata.gltf.extras){if(i.metadata.gltf.extras.LightMapName){let t=this.LoadLightMap(e.modelId,i.metadata.gltf.extras.LightMapName);t.coordinatesIndex=1,t.level=2,i.material.lightmapTexture=t,i.material.useLightmapAsShadowmap=!0}t.isExtras=!0,i.metadata.gltf.extras.U&&d.Animation.CreateAndStartAnimation("u",i.material.albedoTexture,"uOffset",30*i.metadata.gltf.extras.Uspeed,30,0,1,1),i.metadata.gltf.extras.V&&d.Animation.CreateAndStartAnimation("v",i.material.albedoTexture,"vOffset",30*i.metadata.gltf.extras.Vspeed,30,0,1,1)}})),t.meshes[0].getChildMeshes().forEach((e=>{e.registerInstancedBuffer("color",4),e.instancedBuffers.color=new d.Color4(1,1,1,1)})),this.resources.add(e.modelId,t)}catch(t){console.error("模型下载失败!模型编号:"+e.modelId+";错误信息:"+t)}return t}))}loadModelMeshAsync(e,t){let i=this.resources.find(e.modelId);i?t(i):d.SceneLoader.LoadAssetContainerAsync(ef.rl+"bundle/"+e.modelId+"/",e.modelId+e.extension,this.app.scene).then((i=>{i.animationGroups.length>0&&i.animationGroups[0].stop(),this.resources.add(e.modelId,i),t(i)})).catch((()=>{console.error("模型下载失败!模型编号:"+e.modelId)}))}GetMaterial(e){let t=this.Materials.find(e.modelId);if(void 0===t){let i=this.GetTexture(e);t=new d.StandardMaterial(e.modelId,this.app.scene),t.alphaMode=d.Engine.ALPHA_COMBINE,t.diffuseTexture=i,this.Materials.add(e.modelId,t)}return t}GetTexture(e){let t=this.Textures.find(e.modelId);return void 0===t&&(t=new d.Texture(ef.rl+"texture/"+e.modelId+e.extension,this.app.scene,!1),".png"==e.extension&&(t.hasAlpha=!0),this.Textures.add(e.modelId,t)),t}LoadLightMap(e,t){let i=this.Textures.find(e+t);return void 0===i&&(i=new d.Texture(ef.rl+"bundle/"+e+"/"+t,this.app.scene,!1,!1),this.Textures.add(e+t,i)),i}GetMergeMaterial(e){let t=this.MergeMaterials.find(e.modelId);if(void 0===t){t=new d.CustomMaterial(e.modelId,this.app.scene),t.alphaMode=2,this.MergeMaterials.add(e.modelId,t),t.AddUniform("textureData","sampler2D",null),t.Vertex_Definitions("\n varying vec3 localPos ; \n varying vec3 localNrm ;\n "),t.Fragment_Definitions("\n varying vec3 localPos ;\n varying vec3 localNrm ;"),t.Vertex_Before_PositionUpdated("\n localPos = position.xyz;\n localNrm = normal;\n ");let i=this.GetTexture(e);".png"==e.extension&&(i.hasAlpha=!0,t.alpha=.9),e.length||(e.length=3.1),e.width||(e.width=1.6),t.onBindObservable.add((()=>t.getEffect().setTexture("textureData",i))),t.Fragment_Custom_Diffuse("\n vec3 newUV = vec3(abs(localPos.x)/"+e.width+",abs(localPos.y)/"+e.length+",abs(localPos.z)/"+e.width+");\n if(abs(localNrm.z)>abs(localNrm.x)){\n vec4 res = texture2D(textureData,newUV.xy);\n diffuseColor = res.rgb; \n alpha = res.a;\n }\n else {\n vec4 res = texture2D(textureData,newUV.zy);\n diffuseColor = res.rgb; \n alpha = res.a;\n }\n "),t.freeze()}return t}delete(e=!1){if(this.BOX&&this.BOX.dispose(),this.transparentBox&&this.transparentBox.dispose(!0,!0),this.BOX=null,this.transparentBox=null,e){for(const e in this.resources.map)this.resources.find(e).removeAllFromScene(),this.resources.remove(e);this.resources.clear();for(const e in this.Textures.map)this.Textures.find(e).dispose(),this.Textures.remove(e);this.Textures.clear()}}GetWalls(e,t){return H(this,void 0,void 0,(function*(){let i=yield d.SceneLoader.LoadAssetContainerAsync(e,t+".gltf",this.app.scene);if(i.meshes){let e=i.meshes[0].getChildMeshes();for(let t=0;t<e.length;t++)this.walls.add(e[t].id,e[t])}}))}setTransparent(e=1){for(const t in this.resources.map){this.resources.find(t).meshes.forEach((t=>t.visibility=e))}}setTransparentById(e,t=1){let i=this.resources.find(e);i&&i.meshes.forEach((e=>e.visibility=t))}}function J(e,t){return function(){return e.apply(t,arguments)}}const{toString:V}=Object.prototype,{getPrototypeOf:z}=Object,K=(e=>t=>{const i=V.call(t);return e[i]||(e[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),W=e=>(e=e.toLowerCase(),t=>K(t)===e),Q=e=>t=>typeof t===e,{isArray:X}=Array,Y=Q("undefined");const q=W("ArrayBuffer");const Z=Q("string"),$=Q("function"),ee=Q("number"),te=e=>null!==e&&"object"==typeof e,ie=e=>{if("object"!==K(e))return!1;const t=z(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},ne=W("Date"),se=W("File"),re=W("Blob"),oe=W("FileList"),ae=W("URLSearchParams");function ce(e,t,{allOwnKeys:i=!1}={}){if(null==e)return;let n,s;if("object"!=typeof e&&(e=[e]),X(e))for(n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else{const s=i?Object.getOwnPropertyNames(e):Object.keys(e),r=s.length;let o;for(n=0;n<r;n++)o=s[n],t.call(null,e[o],o,e)}}function he(e,t){t=t.toLowerCase();const i=Object.keys(e);let n,s=i.length;for(;s-- >0;)if(n=i[s],t===n.toLowerCase())return n;return null}const le="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,ue=e=>!Y(e)&&e!==le;const de=(fe="undefined"!=typeof Uint8Array&&z(Uint8Array),e=>fe&&e instanceof fe);var fe;const pe=W("HTMLFormElement"),me=(({hasOwnProperty:e})=>(t,i)=>e.call(t,i))(Object.prototype),ge=W("RegExp"),Ae=(e,t)=>{const i=Object.getOwnPropertyDescriptors(e),n={};ce(i,((i,s)=>{!1!==t(i,s,e)&&(n[s]=i)})),Object.defineProperties(e,n)},ye="abcdefghijklmnopqrstuvwxyz",be="0123456789",Be={DIGIT:be,ALPHA:ye,ALPHA_DIGIT:ye+ye.toUpperCase()+be};const ve=W("AsyncFunction"),Ce={isArray:X,isArrayBuffer:q,isBuffer:function(e){return null!==e&&!Y(e)&&null!==e.constructor&&!Y(e.constructor)&&$(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||$(e.append)&&("formdata"===(t=K(e))||"object"===t&&$(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&q(e.buffer),t},isString:Z,isNumber:ee,isBoolean:e=>!0===e||!1===e,isObject:te,isPlainObject:ie,isUndefined:Y,isDate:ne,isFile:se,isBlob:re,isRegExp:ge,isFunction:$,isStream:e=>te(e)&&$(e.pipe),isURLSearchParams:ae,isTypedArray:de,isFileList:oe,forEach:ce,merge:function e(){const{caseless:t}=ue(this)&&this||{},i={},n=(n,s)=>{const r=t&&he(i,s)||s;ie(i[r])&&ie(n)?i[r]=e(i[r],n):ie(n)?i[r]=e({},n):X(n)?i[r]=n.slice():i[r]=n};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&ce(arguments[e],n);return i},extend:(e,t,i,{allOwnKeys:n}={})=>(ce(t,((t,n)=>{i&&$(t)?e[n]=J(t,i):e[n]=t}),{allOwnKeys:n}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,i,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),i&&Object.assign(e.prototype,i)},toFlatObject:(e,t,i,n)=>{let s,r,o;const a={};if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),r=s.length;r-- >0;)o=s[r],n&&!n(o,e,t)||a[o]||(t[o]=e[o],a[o]=!0);e=!1!==i&&z(e)}while(e&&(!i||i(e,t))&&e!==Object.prototype);return t},kindOf:K,kindOfTest:W,endsWith:(e,t,i)=>{e=String(e),(void 0===i||i>e.length)&&(i=e.length),i-=t.length;const n=e.indexOf(t,i);return-1!==n&&n===i},toArray:e=>{if(!e)return null;if(X(e))return e;let t=e.length;if(!ee(t))return null;const i=new Array(t);for(;t-- >0;)i[t]=e[t];return i},forEachEntry:(e,t)=>{const i=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=i.next())&&!n.done;){const i=n.value;t.call(e,i[0],i[1])}},matchAll:(e,t)=>{let i;const n=[];for(;null!==(i=e.exec(t));)n.push(i);return n},isHTMLForm:pe,hasOwnProperty:me,hasOwnProp:me,reduceDescriptors:Ae,freezeMethods:e=>{Ae(e,((t,i)=>{if($(e)&&-1!==["arguments","caller","callee"].indexOf(i))return!1;const n=e[i];$(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")}))}))},toObjectSet:(e,t)=>{const i={},n=e=>{e.forEach((e=>{i[e]=!0}))};return X(e)?n(e):n(String(e).split(t)),i},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,i){return t.toUpperCase()+i})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:he,global:le,isContextDefined:ue,ALPHABET:Be,generateString:(e=16,t=Be.ALPHA_DIGIT)=>{let i="";const{length:n}=t;for(;e--;)i+=t[Math.random()*n|0];return i},isSpecCompliantForm:function(e){return!!(e&&$(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),i=(e,n)=>{if(te(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;const s=X(e)?[]:{};return ce(e,((e,t)=>{const r=i(e,n+1);!Y(r)&&(s[t]=r)})),t[n]=void 0,s}}return e};return i(e,0)},isAsyncFn:ve,isThenable:e=>e&&(te(e)||$(e))&&$(e.then)&&$(e.catch)};function we(e,t,i,n,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),i&&(this.config=i),n&&(this.request=n),s&&(this.response=s)}Ce.inherits(we,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Ce.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Ee=we.prototype,Me={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{Me[e]={value:e}})),Object.defineProperties(we,Me),Object.defineProperty(Ee,"isAxiosError",{value:!0}),we.from=(e,t,i,n,s,r)=>{const o=Object.create(Ee);return Ce.toFlatObject(e,o,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),we.call(o,e.message,t,i,n,s),o.cause=e,o.name=e.name,r&&Object.assign(o,r),o};const Te=we;function xe(e){return Ce.isPlainObject(e)||Ce.isArray(e)}function Ie(e){return Ce.endsWith(e,"[]")?e.slice(0,-2):e}function Re(e,t,i){return e?e.concat(t).map((function(e,t){return e=Ie(e),!i&&t?"["+e+"]":e})).join(i?".":""):t}const Se=Ce.toFlatObject(Ce,{},null,(function(e){return/^is[A-Z]/.test(e)}));const Oe=function(e,t,i){if(!Ce.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(i=Ce.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!Ce.isUndefined(t[e])}))).metaTokens,s=i.visitor||h,r=i.dots,o=i.indexes,a=(i.Blob||"undefined"!=typeof Blob&&Blob)&&Ce.isSpecCompliantForm(t);if(!Ce.isFunction(s))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(Ce.isDate(e))return e.toISOString();if(!a&&Ce.isBlob(e))throw new Te("Blob is not supported. Use a Buffer instead.");return Ce.isArrayBuffer(e)||Ce.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function h(e,i,s){let a=e;if(e&&!s&&"object"==typeof e)if(Ce.endsWith(i,"{}"))i=n?i:i.slice(0,-2),e=JSON.stringify(e);else if(Ce.isArray(e)&&function(e){return Ce.isArray(e)&&!e.some(xe)}(e)||(Ce.isFileList(e)||Ce.endsWith(i,"[]"))&&(a=Ce.toArray(e)))return i=Ie(i),a.forEach((function(e,n){!Ce.isUndefined(e)&&null!==e&&t.append(!0===o?Re([i],n,r):null===o?i:i+"[]",c(e))})),!1;return!!xe(e)||(t.append(Re(s,i,r),c(e)),!1)}const l=[],u=Object.assign(Se,{defaultVisitor:h,convertValue:c,isVisitable:xe});if(!Ce.isObject(e))throw new TypeError("data must be an object");return function e(i,n){if(!Ce.isUndefined(i)){if(-1!==l.indexOf(i))throw Error("Circular reference detected in "+n.join("."));l.push(i),Ce.forEach(i,(function(i,r){!0===(!(Ce.isUndefined(i)||null===i)&&s.call(t,i,Ce.isString(r)?r.trim():r,n,u))&&e(i,n?n.concat(r):[r])})),l.pop()}}(e),t};function De(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function Fe(e,t){this._pairs=[],e&&Oe(e,this,t)}const _e=Fe.prototype;_e.append=function(e,t){this._pairs.push([e,t])},_e.toString=function(e){const t=e?function(t){return e.call(this,t,De)}:De;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const Ge=Fe;function Le(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Pe(e,t,i){if(!t)return e;const n=i&&i.encode||Le,s=i&&i.serialize;let r;if(r=s?s(t,i):Ce.isURLSearchParams(t)?t.toString():new Ge(t,i).toString(n),r){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e}const ke=class{constructor(){this.handlers=[]}use(e,t,i){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!i&&i.synchronous,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Ce.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Ne={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ue={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Ge,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&("undefined"!=typeof window&&"undefined"!=typeof document)})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]};const He=function(e){function t(e,i,n,s){let r=e[s++];const o=Number.isFinite(+r),a=s>=e.length;if(r=!r&&Ce.isArray(n)?n.length:r,a)return Ce.hasOwnProp(n,r)?n[r]=[n[r],i]:n[r]=i,!o;n[r]&&Ce.isObject(n[r])||(n[r]=[]);return t(e,i,n[r],s)&&Ce.isArray(n[r])&&(n[r]=function(e){const t={},i=Object.keys(e);let n;const s=i.length;let r;for(n=0;n<s;n++)r=i[n],t[r]=e[r];return t}(n[r])),!o}if(Ce.isFormData(e)&&Ce.isFunction(e.entries)){const i={};return Ce.forEachEntry(e,((e,n)=>{t(function(e){return Ce.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),n,i,0)})),i}return null},je={"Content-Type":void 0};const Je={transitional:Ne,adapter:["xhr","http"],transformRequest:[function(e,t){const i=t.getContentType()||"",n=i.indexOf("application/json")>-1,s=Ce.isObject(e);s&&Ce.isHTMLForm(e)&&(e=new FormData(e));if(Ce.isFormData(e))return n&&n?JSON.stringify(He(e)):e;if(Ce.isArrayBuffer(e)||Ce.isBuffer(e)||Ce.isStream(e)||Ce.isFile(e)||Ce.isBlob(e))return e;if(Ce.isArrayBufferView(e))return e.buffer;if(Ce.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let r;if(s){if(i.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Oe(e,new Ue.classes.URLSearchParams,Object.assign({visitor:function(e,t,i,n){return Ue.isNode&&Ce.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((r=Ce.isFileList(e))||i.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Oe(r?{"files[]":e}:e,t&&new t,this.formSerializer)}}return s||n?(t.setContentType("application/json",!1),function(e,t,i){if(Ce.isString(e))try{return(t||JSON.parse)(e),Ce.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(i||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Je.transitional,i=t&&t.forcedJSONParsing,n="json"===this.responseType;if(e&&Ce.isString(e)&&(i&&!this.responseType||n)){const i=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(e){if(i){if("SyntaxError"===e.name)throw Te.from(e,Te.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ue.classes.FormData,Blob:Ue.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};Ce.forEach(["delete","get","head"],(function(e){Je.headers[e]={}})),Ce.forEach(["post","put","patch"],(function(e){Je.headers[e]=Ce.merge(je)}));const Ve=Je,ze=Ce.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Ke=Symbol("internals");function We(e){return e&&String(e).trim().toLowerCase()}function Qe(e){return!1===e||null==e?e:Ce.isArray(e)?e.map(Qe):String(e)}function Xe(e,t,i,n,s){return Ce.isFunction(n)?n.call(this,t,i):(s&&(t=i),Ce.isString(t)?Ce.isString(n)?-1!==t.indexOf(n):Ce.isRegExp(n)?n.test(t):void 0:void 0)}class Ye{constructor(e){e&&this.set(e)}set(e,t,i){const n=this;function s(e,t,i){const s=We(t);if(!s)throw new Error("header name must be a non-empty string");const r=Ce.findKey(n,s);(!r||void 0===n[r]||!0===i||void 0===i&&!1!==n[r])&&(n[r||t]=Qe(e))}const r=(e,t)=>Ce.forEach(e,((e,i)=>s(e,i,t)));return Ce.isPlainObject(e)||e instanceof this.constructor?r(e,t):Ce.isString(e)&&(e=e.trim())&&!(e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))(e)?r((e=>{const t={};let i,n,s;return e&&e.split("\n").forEach((function(e){s=e.indexOf(":"),i=e.substring(0,s).trim().toLowerCase(),n=e.substring(s+1).trim(),!i||t[i]&&ze[i]||("set-cookie"===i?t[i]?t[i].push(n):t[i]=[n]:t[i]=t[i]?t[i]+", "+n:n)})),t})(e),t):null!=e&&s(t,e,i),this}get(e,t){if(e=We(e)){const i=Ce.findKey(this,e);if(i){const e=this[i];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=i.exec(e);)t[n[1]]=n[2];return t}(e);if(Ce.isFunction(t))return t.call(this,e,i);if(Ce.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=We(e)){const i=Ce.findKey(this,e);return!(!i||void 0===this[i]||t&&!Xe(0,this[i],i,t))}return!1}delete(e,t){const i=this;let n=!1;function s(e){if(e=We(e)){const s=Ce.findKey(i,e);!s||t&&!Xe(0,i[s],s,t)||(delete i[s],n=!0)}}return Ce.isArray(e)?e.forEach(s):s(e),n}clear(e){const t=Object.keys(this);let i=t.length,n=!1;for(;i--;){const s=t[i];e&&!Xe(0,this[s],s,e,!0)||(delete this[s],n=!0)}return n}normalize(e){const t=this,i={};return Ce.forEach(this,((n,s)=>{const r=Ce.findKey(i,s);if(r)return t[r]=Qe(n),void delete t[s];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,i)=>t.toUpperCase()+i))}(s):String(s).trim();o!==s&&delete t[s],t[o]=Qe(n),i[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Ce.forEach(this,((i,n)=>{null!=i&&!1!==i&&(t[n]=e&&Ce.isArray(i)?i.join(", "):i)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const i=new this(e);return t.forEach((e=>i.set(e))),i}static accessor(e){const t=(this[Ke]=this[Ke]={accessors:{}}).accessors,i=this.prototype;function n(e){const n=We(e);t[n]||(!function(e,t){const i=Ce.toCamelCase(" "+t);["get","set","has"].forEach((n=>{Object.defineProperty(e,n+i,{value:function(e,i,s){return this[n].call(this,t,e,i,s)},configurable:!0})}))}(i,e),t[n]=!0)}return Ce.isArray(e)?e.forEach(n):n(e),this}}Ye.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Ce.freezeMethods(Ye.prototype),Ce.freezeMethods(Ye);const qe=Ye;function Ze(e,t){const i=this||Ve,n=t||i,s=qe.from(n.headers);let r=n.data;return Ce.forEach(e,(function(e){r=e.call(i,r,s.normalize(),t?t.status:void 0)})),s.normalize(),r}function $e(e){return!(!e||!e.__CANCEL__)}function et(e,t,i){Te.call(this,null==e?"canceled":e,Te.ERR_CANCELED,t,i),this.name="CanceledError"}Ce.inherits(et,Te,{__CANCEL__:!0});const tt=et;const it=Ue.isStandardBrowserEnv?{write:function(e,t,i,n,s,r){const o=[];o.push(e+"="+encodeURIComponent(t)),Ce.isNumber(i)&&o.push("expires="+new Date(i).toGMTString()),Ce.isString(n)&&o.push("path="+n),Ce.isString(s)&&o.push("domain="+s),!0===r&&o.push("secure"),document.cookie=o.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function nt(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const st=Ue.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let i;function n(i){let n=i;return e&&(t.setAttribute("href",n),n=t.href),t.setAttribute("href",n),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return i=n(window.location.href),function(e){const t=Ce.isString(e)?n(e):e;return t.protocol===i.protocol&&t.host===i.host}}():function(){return!0};const rt=function(e,t){e=e||10;const i=new Array(e),n=new Array(e);let s,r=0,o=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),h=n[o];s||(s=c),i[r]=a,n[r]=c;let l=o,u=0;for(;l!==r;)u+=i[l++],l%=e;if(r=(r+1)%e,r===o&&(o=(o+1)%e),c-s<t)return;const d=h&&c-h;return d?Math.round(1e3*u/d):void 0}};function ot(e,t){let i=0;const n=rt(50,250);return s=>{const r=s.loaded,o=s.lengthComputable?s.total:void 0,a=r-i,c=n(a);i=r;const h={loaded:r,total:o,progress:o?r/o:void 0,bytes:a,rate:c||void 0,estimated:c&&o&&r<=o?(o-r)/c:void 0,event:s};h[t?"download":"upload"]=!0,e(h)}}const at="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,i){let n=e.data;const s=qe.from(e.headers).normalize(),r=e.responseType;let o;function a(){e.cancelToken&&e.cancelToken.unsubscribe(o),e.signal&&e.signal.removeEventListener("abort",o)}Ce.isFormData(n)&&(Ue.isStandardBrowserEnv||Ue.isStandardBrowserWebWorkerEnv?s.setContentType(!1):s.setContentType("multipart/form-data;",!1));let c=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",i=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";s.set("Authorization","Basic "+btoa(t+":"+i))}const h=nt(e.baseURL,e.url);function l(){if(!c)return;const n=qe.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(e,t,i){const n=i.config.validateStatus;i.status&&n&&!n(i.status)?t(new Te("Request failed with status code "+i.status,[Te.ERR_BAD_REQUEST,Te.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i)):e(i)}((function(e){t(e),a()}),(function(e){i(e),a()}),{data:r&&"text"!==r&&"json"!==r?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:n,config:e,request:c}),c=null}if(c.open(e.method.toUpperCase(),Pe(h,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=l:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(l)},c.onabort=function(){c&&(i(new Te("Request aborted",Te.ECONNABORTED,e,c)),c=null)},c.onerror=function(){i(new Te("Network Error",Te.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const n=e.transitional||Ne;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),i(new Te(t,n.clarifyTimeoutError?Te.ETIMEDOUT:Te.ECONNABORTED,e,c)),c=null},Ue.isStandardBrowserEnv){const t=(e.withCredentials||st(h))&&e.xsrfCookieName&&it.read(e.xsrfCookieName);t&&s.set(e.xsrfHeaderName,t)}void 0===n&&s.setContentType(null),"setRequestHeader"in c&&Ce.forEach(s.toJSON(),(function(e,t){c.setRequestHeader(t,e)})),Ce.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),r&&"json"!==r&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",ot(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",ot(e.onUploadProgress)),(e.cancelToken||e.signal)&&(o=t=>{c&&(i(!t||t.type?new tt(null,e,c):t),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(o),e.signal&&(e.signal.aborted?o():e.signal.addEventListener("abort",o)));const u=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(h);u&&-1===Ue.protocols.indexOf(u)?i(new Te("Unsupported protocol "+u+":",Te.ERR_BAD_REQUEST,e)):c.send(n||null)}))},ct={http:null,xhr:at};Ce.forEach(ct,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const ht=e=>{e=Ce.isArray(e)?e:[e];const{length:t}=e;let i,n;for(let s=0;s<t&&(i=e[s],!(n=Ce.isString(i)?ct[i.toLowerCase()]:i));s++);if(!n){if(!1===n)throw new Te(`Adapter ${i} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(Ce.hasOwnProp(ct,i)?`Adapter '${i}' is not available in the build`:`Unknown adapter '${i}'`)}if(!Ce.isFunction(n))throw new TypeError("adapter is not a function");return n};function lt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new tt(null,e)}function ut(e){lt(e),e.headers=qe.from(e.headers),e.data=Ze.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return ht(e.adapter||Ve.adapter)(e).then((function(t){return lt(e),t.data=Ze.call(e,e.transformResponse,t),t.headers=qe.from(t.headers),t}),(function(t){return $e(t)||(lt(e),t&&t.response&&(t.response.data=Ze.call(e,e.transformResponse,t.response),t.response.headers=qe.from(t.response.headers))),Promise.reject(t)}))}const dt=e=>e instanceof qe?e.toJSON():e;function ft(e,t){t=t||{};const i={};function n(e,t,i){return Ce.isPlainObject(e)&&Ce.isPlainObject(t)?Ce.merge.call({caseless:i},e,t):Ce.isPlainObject(t)?Ce.merge({},t):Ce.isArray(t)?t.slice():t}function s(e,t,i){return Ce.isUndefined(t)?Ce.isUndefined(e)?void 0:n(void 0,e,i):n(e,t,i)}function r(e,t){if(!Ce.isUndefined(t))return n(void 0,t)}function o(e,t){return Ce.isUndefined(t)?Ce.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function a(i,s,r){return r in t?n(i,s):r in e?n(void 0,i):void 0}const c={url:r,method:r,data:r,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(e,t)=>s(dt(e),dt(t),!0)};return Ce.forEach(Object.keys(Object.assign({},e,t)),(function(n){const r=c[n]||s,o=r(e[n],t[n],n);Ce.isUndefined(o)&&r!==a||(i[n]=o)})),i}const pt="1.4.0",mt={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{mt[e]=function(i){return typeof i===e||"a"+(t<1?"n ":" ")+e}}));const gt={};mt.transitional=function(e,t,i){function n(e,t){return"[Axios v1.4.0] Transitional option '"+e+"'"+t+(i?". "+i:"")}return(i,s,r)=>{if(!1===e)throw new Te(n(s," has been removed"+(t?" in "+t:"")),Te.ERR_DEPRECATED);return t&&!gt[s]&&(gt[s]=!0,console.warn(n(s," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(i,s,r)}};const At={assertOptions:function(e,t,i){if("object"!=typeof e)throw new Te("options must be an object",Te.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let s=n.length;for(;s-- >0;){const r=n[s],o=t[r];if(o){const t=e[r],i=void 0===t||o(t,r,e);if(!0!==i)throw new Te("option "+r+" must be "+i,Te.ERR_BAD_OPTION_VALUE)}else if(!0!==i)throw new Te("Unknown option "+r,Te.ERR_BAD_OPTION)}},validators:mt},yt=At.validators;class bt{constructor(e){this.defaults=e,this.interceptors={request:new ke,response:new ke}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=ft(this.defaults,t);const{transitional:i,paramsSerializer:n,headers:s}=t;let r;void 0!==i&&At.assertOptions(i,{silentJSONParsing:yt.transitional(yt.boolean),forcedJSONParsing:yt.transitional(yt.boolean),clarifyTimeoutError:yt.transitional(yt.boolean)},!1),null!=n&&(Ce.isFunction(n)?t.paramsSerializer={serialize:n}:At.assertOptions(n,{encode:yt.function,serialize:yt.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase(),r=s&&Ce.merge(s.common,s[t.method]),r&&Ce.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete s[e]})),t.headers=qe.concat(r,s);const o=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,o.unshift(e.fulfilled,e.rejected))}));const c=[];let h;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let l,u=0;if(!a){const e=[ut.bind(this),void 0];for(e.unshift.apply(e,o),e.push.apply(e,c),l=e.length,h=Promise.resolve(t);u<l;)h=h.then(e[u++],e[u++]);return h}l=o.length;let d=t;for(u=0;u<l;){const e=o[u++],t=o[u++];try{d=e(d)}catch(e){t.call(this,e);break}}try{h=ut.call(this,d)}catch(e){return Promise.reject(e)}for(u=0,l=c.length;u<l;)h=h.then(c[u++],c[u++]);return h}getUri(e){return Pe(nt((e=ft(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}Ce.forEach(["delete","get","head","options"],(function(e){bt.prototype[e]=function(t,i){return this.request(ft(i||{},{method:e,url:t,data:(i||{}).data}))}})),Ce.forEach(["post","put","patch"],(function(e){function t(t){return function(i,n,s){return this.request(ft(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:i,data:n}))}}bt.prototype[e]=t(),bt.prototype[e+"Form"]=t(!0)}));const Bt=bt;class vt{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const i=this;this.promise.then((e=>{if(!i._listeners)return;let t=i._listeners.length;for(;t-- >0;)i._listeners[t](e);i._listeners=null})),this.promise.then=e=>{let t;const n=new Promise((e=>{i.subscribe(e),t=e})).then(e);return n.cancel=function(){i.unsubscribe(t)},n},e((function(e,n,s){i.reason||(i.reason=new tt(e,n,s),t(i.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;const t=new vt((function(t){e=t}));return{token:t,cancel:e}}}const Ct=vt;const wt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(wt).forEach((([e,t])=>{wt[t]=e}));const Et=wt;const Mt=function e(t){const i=new Bt(t),n=J(Bt.prototype.request,i);return Ce.extend(n,Bt.prototype,i,{allOwnKeys:!0}),Ce.extend(n,i,null,{allOwnKeys:!0}),n.create=function(i){return e(ft(t,i))},n}(Ve);Mt.Axios=Bt,Mt.CanceledError=tt,Mt.CancelToken=Ct,Mt.isCancel=$e,Mt.VERSION=pt,Mt.toFormData=Oe,Mt.AxiosError=Te,Mt.Cancel=Mt.CanceledError,Mt.all=function(e){return Promise.all(e)},Mt.spread=function(e){return function(t){return e.apply(null,t)}},Mt.isAxiosError=function(e){return Ce.isObject(e)&&!0===e.isAxiosError},Mt.mergeConfig=ft,Mt.AxiosHeaders=qe,Mt.formToJSON=e=>He(Ce.isHTMLForm(e)?new FormData(e):e),Mt.HttpStatusCode=Et,Mt.default=Mt;const Tt=Mt.create();Tt.defaults.headers.post["Content-Type"]="application/json",Tt.interceptors.request.use((e=>{let t=localStorage.getItem("mx3d-token");return t&&(e.headers.Authorization="Bearer "+t),e}),(e=>Promise.reject(e))),Tt.interceptors.response.use((e=>e),(e=>{if(e.response)switch(e.response.status){case 401:console.error("开发者授权码异常");break;case 403:console.error("当前用户没有权限");break;case 400:console.error(e.response.data.message)}return Promise.reject(e)}));const xt=Tt;var It=n(354),Rt=n.n(It);class St{static de(e){let t=localStorage.getItem("mx3d-long");var i=Rt().enc.Utf8.parse(t.substring(0,32)),n=Rt().enc.Utf8.parse(t.substring(32,48)),s=Rt().enc.Hex.parse(e),r=Rt().enc.Base64.stringify(s);return Rt().AES.decrypt(r,i,{iv:n,mode:Rt().mode.CBC,padding:Rt().pad.Pkcs7}).toString(Rt().enc.Utf8).toString()}}class Ot extends D{loadProperties(e){this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.baseModel=e.baseModel,this.objectType=T.LeakWater,this.lines=m.ToARRVector3(e.lines)}setEnabled(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.setEnabled(e),e?(this.instance.isPickable=this.executes.count()>0,this.executes.find(x.eover)||this.executes.find(x.out)?this.instance.enablePointerMoveEvents=!0:this.instance.enablePointerMoveEvents=!1):(this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}bind(){this.instance=m.createTube(this.id,this.lines,.02,this.app),this.instance.setEnabled(!1);var e=this.app.resources.GetMaterial(this.baseModel).clone(this.id);d.Animation.CreateAndStartAnimation("u",e.diffuseTexture,"vOffset",15,30,0,1,1),e.diffuseTexture.vScale=this.instance.getTotalVertices()/50,this.instance.material=e,this.completed()}completed(){this.alwaysActive(),this.computeView()}computeView(){this.Sight=new R;let e=this.instance.getBoundingInfo(),t=m.getVisualAngle(e,this.app);this.Sight.alpha=t.alpha,this.Sight.beta=t.beta,this.Sight.radius=e.boundingSphere.radiusWorld+3,this.Sight.minimumLimit=.3,this.Sight.maximumLimit=2*this.Sight.radius,this.Sight.minBeta=.01,this.Sight.maxBeta=Math.PI/2*.98}addEventListener(e,t){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let i=null;if(e==x.leftClick||e==x.rightClick||e==x.doubleClick?(this.clickEvents.remove(e),this.clickEvents.add(e,t),this.instance.isPickable=!0,i=new d.ExecuteCodeAction(d.ActionManager.OnPickTrigger,(e=>{let t=this.clickEvents.find(x.leftClick);t&&0==e.sourceEvent.button&&t(this,e);let i=this.clickEvents.find(x.rightClick);i&&2==e.sourceEvent.button&&i(this,e);let n=this.clickEvents.find(x.doubleClick);n&&0==e.sourceEvent.button&&(new Date).getTime()-this.touchtime<500&&n(this,e),this.touchtime=(new Date).getTime()})),e="click"):e==x.eover?(i=new d.ExecuteCodeAction(d.ActionManager.OnPointerOverTrigger,(e=>t(this,e))),this.instance.enablePointerMoveEvents=!0):e==x.longPress?i=new d.ExecuteCodeAction(d.ActionManager.OnLongPressTrigger,(e=>t(this,e))):e==x.out&&(i=new d.ExecuteCodeAction(d.ActionManager.OnPointerOutTrigger,(e=>t(this,e))),this.instance.enablePointerMoveEvents=!0),i){this.action||(this.action=new d.ActionManager(this.app.scene),this.instance.actionManager=this.action);let t=this.executes.find(e);t&&this.action.unregisterAction(t),this.executes.remove(e),this.executes.add(e,i),this.action.registerAction(i)}this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}removeEventListener(e){if(e==x.leftClick||e==x.rightClick||e==x.doubleClick){if(this.clickEvents.remove(e),this.clickEvents.count()>0)return;e="click"}this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let t=this.executes.find(e);t&&this.action.unregisterAction(t),this.executes.remove(e),0==this.executes.count()&&(this.action=null,this.instance.actionManager=this.action,this.instance.getChildMeshes().forEach((e=>e.actionManager=this.action))),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}class Dt extends D{loadProperties(e){this.id=e.id,this.customNumber=e.customNumber,this.parentId=e.parentId,this.name=e.name,this.radius=e.radius,this.pints=m.ToARRVector3(e.pints),this.objectType=e.objectType,this.customType=e.customType,this.position=m.ToVector3(e.position),this.rotation=m.ToVector3(e.rotation),this.color=e.color,this.alpha=e.alpha}setEnabled(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.setEnabled(e),e?(this.instance.isPickable=this.executes.count()>0,this.executes.find(x.eover)||this.executes.find(x.out)?this.instance.enablePointerMoveEvents=!0:this.instance.enablePointerMoveEvents=!1):(this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}bind(){this.instance=new d.Mesh(this.id);let e=m.createTube(this.id,this.pints,this.radius,this.app);this.instance.position=e.getBoundingInfo().boundingBox.center.clone(),this.instance.addChild(e),this.instance.rotation=this.rotation.clone(),this.instance.position=this.position.clone(),e.setParent(this.instance.parent),this.instance.dispose(),this.instance=e;let t=new d.StandardMaterial("mat_"+this.id,this.app.scene);t.diffuseColor=d.Color3.FromHexString(this.color),t.alpha=this.alpha,this.instance.material=t,this.instance.enablePointerMoveEvents=!1,this.instance.isPickable=!1,this.setEnabled(!1),this.completed()}setColor(e="#fff"){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.optimization(!1),this.instance.material.diffuseColor=d.Color3.FromHexString(e),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}reColor(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.optimization(!1),this.instance.material.diffuseColor=d.Color3.FromHexString(this.color),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}computeView(){this.Sight=new R;let e=this.instance.getBoundingInfo(),t=m.getVisualAngle(e,this.app);this.alpha=t.alpha,this.Sight.beta=t.beta,this.Sight.focus=t.focus,this.Sight.radius=t.radius,this.Sight.minimumLimit=.3,this.Sight.maximumLimit=2*this.Sight.radius,this.Sight.minBeta=.01,this.Sight.maxBeta=Math.PI/2*.98}setFlash(e=1){this.statusType==I.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.optimization(!1),this.instance.material.emissiveColor=O.colors[e],this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.statusType=I.Flash)}setOpaque(){this.statusType!=I.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.optimization(!0),this.instance.material.alpha=this.alpha,this.instance.material.emissiveColor=null,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.statusType=I.Opaque)}setTransparent(e=.3){this.statusType==I.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.optimization(!1),this.instance.material.alpha=e,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.statusType=I.Transparent)}}class Ft extends D{constructor(){super(...arguments),this.tconfig={color:"",position:null,rotation:null,scaling:null,clearColor:""},this.isLookAt=!1}setEnabled(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.setEnabled(e),e?(this.instance.isPickable=this.executes.count()>0,this.executes.find(x.eover)||this.executes.find(x.out)?this.instance.enablePointerMoveEvents=!0:this.instance.enablePointerMoveEvents=!1):(this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}loadProperties(e){if(this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.objectType=T.UI3D,this.isLookAt=e.isLookAt,this.tconfig.color=e.color,e.size){this.tconfig.clearColor=null,this.tconfig.position=m.ToVector3(e.position);let t=m.ToVector3(e.rotation);this.tconfig.rotation=new d.Vector3(t.x+Math.PI,t.y,t.z);let i=Number.parseInt(e.size.replace("px",""))/40,n=e.scaling?m.ToVector3(e.scaling):d.Vector3.One();this.tconfig.scaling=new d.Vector3(14*i/50*n.x,1,14*i/50*n.z)}else this.tconfig.clearColor=e.clearColor,this.tconfig.position=m.ToVector3(e.position),this.tconfig.rotation=m.ToVector3(e.rotation),this.tconfig.scaling=m.ToVector3(e.scaling)}bind(){var e="bold 100px Arial";let t=new d.DynamicTexture(this.id,64,this.app.scene,!1);var i=t.getContext();i.font=e;var n=i.measureText(this.name).width+8,s=.02*n;t=new d.DynamicTexture(this.id,{width:n,height:150},this.app.scene,!1);var r=new d.StandardMaterial(this.id,this.app.scene);r.backFaceCulling=!1,r.diffuseTexture=t,this.tconfig.clearColor||(t.hasAlpha=!0),t.drawText(this.name,null,null,e,this.tconfig.color,this.tconfig.clearColor,!1),this.instance=d.Mesh.CreateGround(this.id,s,3,1,this.app.scene),this.instance.setEnabled(!1),this.instance.scaling=this.tconfig.scaling,this.instance.position=this.tconfig.position,this.instance.rotation=this.tconfig.rotation,this.instance.material=r,this.isLookAt&&(this.instance.billboardMode=d.Mesh.BILLBOARDMODE_Y),this.alwaysActive(),this.computeView()}}class _t extends D{loadProperties(e){this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.objectType=T.VirtualBox,this.virtualType=e.virtualType,this.color=d.Color3.FromHexString(e.color),this.alpha=e.alpha,this.isEdges=e.isEdges,this.edgesWidth=e.edgesWidth,this.edgesColor=d.Color3.FromHexString(e.edgesColor).toColor4(1),this.rotation=m.ToVector3(e.rotation),this.position=m.ToVector3(e.position),this.scaling=m.ToVector3(e.scaling)}setEnabled(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.setEnabled(e),e?(this.instance.isPickable=this.executes.count()>0,this.executes.find(x.eover)||this.executes.find(x.out)?this.instance.enablePointerMoveEvents=!0:this.instance.enablePointerMoveEvents=!1):(this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}bind(){"Cylinder"==this.virtualType?this.instance=d.MeshBuilder.CreateCylinder(this.id,{height:1,diameterTop:1,diameterBottom:1},this.app.scene):this.instance=d.MeshBuilder.CreateBox(this.id,{size:1},this.app.scene),this.instance.setEnabled(!1),this.instance.id=this.id;let e=new d.StandardMaterial(this.id,this.app.scene);e.diffuseColor=this.color,this.alpha<.98&&(e.alpha=this.alpha,e.alphaMode=2,e.useAlphaFromDiffuseTexture=!0),this.instance.material=e,this.isEdges&&(this.instance.enableEdgesRendering(),this.instance.edgesWidth=1,this.instance.edgesColor=new d.Color4(0,1,1,1)),this.edgesWidth&&this.edgesWidth>0&&(this.instance.enableEdgesRendering(),this.instance.edgesWidth=this.edgesWidth,this.instance.edgesColor=this.edgesColor),this.instance.enablePointerMoveEvents=!1,this.instance.isPickable=!1,this.instance.rotation=this.rotation.clone(),this.instance.position=this.position.clone(),this.instance.scaling=this.scaling.clone(),this.completed()}}class Gt extends G{addEventListener(e,t){}removeEventListener(e){}setEnabled(e){this.instance.setEnabled(e)}loadProperties(e){this.id=e.id,this.name=e.name,this.parentId=e.parentId,this.index=e.index,this.layerName=this.index<0?"B"+this.index:"F"+(this.index+1),this.layerHeight=e.layerHeight,this.objectType=e.objectType,this.customNumber=e.customNumber?e.customNumber:e.id,this.customType=e.customType?e.customType:this.objectType,this.position=m.ToVector3(e.position),this.rotation=m.ToVector3(e.rotation)}bind(){this.instance=new d.Mesh(this.id,this.app.scene),this.instance.enablePointerMoveEvents=!1,this.instance.isPickable=!1,this.instance.position=this.position,this.instance.position.y-=.01,this.instance.rotation=this.rotation.clone(),this.setEnabled(!1)}}class Lt{constructor(e,t){this.objectType=T.RackModel,this.executes=new A,this.clickEvents=new A,this.touchtime=(new Date).getTime(),this.direction=!0,this.app=e,this.parentId=t}setEnabled(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.setEnabled(e),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}loadProperties(e){this.id=e.id,this.name=e.name,this.customNumber=e.id,this.customType=this.objectType,this.uHeight=e.uHeight,this.uStart=e.uStart,this.color=e.color?e.color:"#acacac",this.frontImgUrl=e.frontImgUrl,this.backImgUrl=e.backImgUrl,0==e.direction&&(this.direction=!1),this.width=.45,this.depth=e.depth}bind(){if(this.app.project.objectDatas.find(this.id))return void console.error("编号重复");let e=this.app.project.objectDatas.find(this.parentId);if(!(e&&e instanceof Pt&&e.rack))return void console.error("无法找到机柜或机柜模型不处于可见状态");this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let t=e.rack.getBoundingInfo();this.depth=this.depth?this.depth:t.maximum.z-t.minimum.z-.05,this.instance=d.MeshBuilder.CreateBox(this.id,{height:.04445*this.uHeight,width:this.width,depth:this.depth},this.app.scene),this.instance.registerInstancedBuffer("color",4),this.instance.instancedBuffers.color=new d.Color4(1,1,1,1);let i=new d.MultiMaterial(this.id,this.app.scene),n=new d.StandardMaterial(this.id+"_body",this.app.scene);n.diffuseColor=d.Color3.FromHexString(this.color);let s,r,o=new d.StandardMaterial(this.id+"_font",this.app.scene),a=new d.StandardMaterial(this.id+"_back",this.app.scene);this.frontImgUrl&&(s=new d.Texture(this.frontImgUrl,this.app.scene,!1,!1,null,null,(()=>{o.diffuseTexture=null,o.diffuseColor=new d.Color3(.8,.8,.8)}))),this.backImgUrl&&(r=new d.Texture(this.backImgUrl,this.app.scene,!1,!1,null,null,(()=>{a.diffuseTexture=null,a.diffuseColor=new d.Color3(.8,.8,.8)}))),s&&(o.diffuseTexture=s),r&&(a.diffuseTexture=r,r.wAng=Math.PI),i.subMaterials.push(n),i.subMaterials.push(o),i.subMaterials.push(a),this.instance.subMeshes=[];var c=this.instance.getTotalVertices();this.instance.subMeshes.push(new d.SubMesh(1,0,c,0,6,this.instance)),this.instance.subMeshes.push(new d.SubMesh(2,1,c,6,6,this.instance)),this.instance.subMeshes.push(new d.SubMesh(0,2,c,12,6,this.instance)),this.instance.subMeshes.push(new d.SubMesh(0,3,c,18,6,this.instance)),this.instance.subMeshes.push(new d.SubMesh(0,4,c,24,6,this.instance)),this.instance.subMeshes.push(new d.SubMesh(0,5,c,30,6,this.instance)),this.instance.material&&this.instance.material.dispose(),this.instance.material=i,this.instance.scaling.x=1/e.scaling.x;let h=this.instance.getBoundingInfo();this.instance.position.y=(h.maximum.y-h.minimum.y)/2+.04445*(this.uStart-1),this.direction?this.instance.position.z=(t.maximum.z-t.minimum.z-.03-(h.maximum.z-h.minimum.z))/2:(this.instance.position.z=-(t.maximum.z-t.minimum.z-.03-(h.maximum.z-h.minimum.z))/2,this.instance.rotation.y=Math.PI),this.instance.parent=e.rack,this.instance.setParent(null),this.app.project.objectDatas.add(this.id,this),this.completed(),this.statusType=I.Opaque,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}optimization(e){this.instance.getChildMeshes().forEach((t=>{e?t.freezeWorldMatrix():t.unfreezeWorldMatrix()})),e?this.instance.freezeWorldMatrix():this.instance.unfreezeWorldMatrix(),this.instance.material&&(e?this.instance.material.freeze():this.instance.material.unfreeze())}alwaysActive(){this.instance.getChildMeshes().forEach((e=>{e.alwaysSelectAsActiveMesh=!0,e.doNotSyncBoundingInfo=!1,e.ignoreNonUniformScaling=!0})),this.instance.alwaysSelectAsActiveMesh=!0,this.instance.doNotSyncBoundingInfo=!1}addEventListener(e,t){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let i=null;if(e==x.leftClick||e==x.rightClick||e==x.doubleClick?(this.clickEvents.remove(e),this.clickEvents.add(e,t),this.instance.isPickable=!0,i=new d.ExecuteCodeAction(d.ActionManager.OnPickTrigger,(e=>{let t=this.clickEvents.find(x.leftClick);t&&0==e.sourceEvent.button&&t(this,e);let i=this.clickEvents.find(x.rightClick);i&&2==e.sourceEvent.button&&i(this,e);let n=this.clickEvents.find(x.doubleClick);n&&0==e.sourceEvent.button&&(new Date).getTime()-this.touchtime<500&&n(this,e),this.touchtime=(new Date).getTime()})),e=x.click):e==x.eover?(i=new d.ExecuteCodeAction(d.ActionManager.OnPointerOverTrigger,(e=>t(this,e))),this.instance.enablePointerMoveEvents=!0):e==x.longPress?i=new d.ExecuteCodeAction(d.ActionManager.OnLongPressTrigger,(e=>t(this,e))):e==x.out&&(i=new d.ExecuteCodeAction(d.ActionManager.OnPointerOutTrigger,(e=>t(this,e))),this.instance.enablePointerMoveEvents=!0),i){this.action||(this.action=new d.ActionManager(this.app.scene),this.instance.actionManager=this.action);let t=this.executes.find(e);t&&this.action.unregisterAction(t),this.executes.remove(e),this.executes.add(e,i),this.action.registerAction(i)}this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}removeEventListener(e){if(e==x.leftClick||e==x.rightClick||e==x.doubleClick){if(this.clickEvents.remove(e),this.clickEvents.count()>0)return;e=x.click}this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let t=this.executes.find(e);t&&this.action.unregisterAction(t),this.executes.remove(e),0==this.executes.count()&&(this.action=null,this.instance.actionManager=this.action),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setFlash(e){this.statusType==I.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.instancedBuffers.color=O.colors[e],this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.statusType=I.Flash)}setOpaque(){this.statusType!=I.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.instancedBuffers.color=new d.Color4(1,1,1,1),this.instance.visibility=1,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.statusType=I.Opaque)}setTransparent(e=.3){this.statusType==I.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.visibility=e,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.statusType=I.Transparent)}setColor(e="#ffffff"){this.statusType==I.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.instancedBuffers.color=d.Color4.FromHexString(e),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1)}computeView(){this.Sight=new R;let e=this.instance.getBoundingInfo(),t=m.getVisualAngle(e,this.app);this.Sight.alpha=t.alpha,this.Sight.beta=t.beta,this.Sight.focus=this.instance.getAbsolutePosition(),this.Sight.radius=5*e.boundingSphere.radius,this.Sight.minimumLimit=.3,this.Sight.maximumLimit=2*this.Sight.radius,this.Sight.minBeta=.01,this.Sight.maxBeta=Math.PI/2*.98}completed(){this.alwaysActive(),this.optimization(!0),this.computeView()}toJson(){return{id:this.id,parentId:this.parentId,name:this.name,customNumber:this.customNumber,customType:this.customType,objectType:this.objectType}}getInto(){this.app.camera.lookToTheFront(this)}goBack(){}}class Pt extends D{computeView(){this.objectType=T.Cabinet,this.Sight=new R;let e=this.instance.getBoundingInfo(),t=m.getVisualAngle(e,this.app);this.Sight.alpha=t.alpha,this.Sight.beta=t.beta,this.Sight.focus=this.instance.getAbsolutePosition(),this.Sight.radius=e.boundingSphere.radiusWorld+3,this.Sight.minimumLimit=.3,this.Sight.maximumLimit=2*this.Sight.radius,this.Sight.minBeta=.01,this.Sight.maxBeta=Math.PI/2*.98}setEnabled(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach((e=>e.dispose())),this.rack=null;let t=this.app.project.getChildsById(this.id);for(let e=0;e<t.length;e++)t[e].instance.dispose(),this.app.project.objectDatas.remove(t[e].id);if(e){let e=new d.Mesh(this.id,this.app.scene);this.app.resources.resources.find(this.baseModel.modelId).meshes[0].getChildMeshes().forEach((t=>{var i=t.createInstance(this.id);i.isPickable=!1,i.enablePointerMoveEvents=!1,i.parent=e,-1!=t.id.indexOf("rule")&&(this.rack=i)})),e.rotation=m.ToVector3(this.rotation.clone()),e.position=m.ToVector3(this.position.clone()),e.scaling=m.ToVector3(this.scaling.clone()),this.instance.addChild(e),this.alwaysActive(),this.optimization(!0)}this.instance.setEnabled(e),this.isPickable=e,this.statusType=I.Opaque,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}bind(){let e=this.app.resources.resources.find(this.baseModel.modelId),t=m.computeBounds(e.meshes[0]);this.instance=this.app.resources.BOX.clone(this.id),this.instance.id=this.id,this.instance.enablePointerMoveEvents=!1,this.instance.isPickable=!1,this.instance.scaling=new d.Vector3((t.maximum.x-t.minimum.x)*this.scaling.x,(t.maximum.y-t.minimum.y)*this.scaling.y,(t.maximum.z-t.minimum.z)*this.scaling.z),0==this.instance.scaling.y&&(this.instance.scaling.y=.01),this.instance.position=m.ToVector3(this.position.clone()),this.instance.position.y=(t.maximum.y-t.minimum.y)/2+this.position.y,this.instance.rotation=m.ToVector3(this.rotation.clone()),this.instance.setEnabled(!1),this.completed()}loadRacks(e){for(let t=0;t<e.length;t++){let i=new Lt(this.app,this.id);i.loadProperties(e[t]),i.bind()}}unloadRacks(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let e=this.app.project.getChildsById(this.id);for(let t=0;t<e.length;t++)e[t].instance.dispose(),this.app.project.objectDatas.remove(e[t].id);this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}open(){this.play(),this.isPickable=!1}close(){this.stop(),this.isPickable=!0}}var kt=function(e,t,i,n){return new(i||(i=Promise))((function(s,r){function o(e){try{c(n.next(e))}catch(e){r(e)}}function a(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};class Nt{constructor(e,t){this.anchor=e,this.ratio=t}dispose(){this.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.mesh&&this.mesh.dispose(),this.textMesh&&this.textMesh.dispose(),this.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}class Ut{constructor(e){this.displayValue=!1,this.anchor=e,this.id=y.getGUID(12),this.texts=new Array}isEnabled(e){this.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.mesh.setEnabled(e),this.texts.forEach((t=>t.isVisible=!!e&&this.displayValue)),this.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}set displayValues(e){this.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.texts.forEach((t=>t.isVisible=e)),this.displayValue=e,this.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}dispose(){this.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.mesh&&this.mesh.dispose();for(let e=0;e<this.texts.length;e++)this.texts[e].linkedMesh&&this.texts[e].linkedMesh.dispose(),this.texts[e].dispose();this.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}class Ht{constructor(){this.color="#00ff00",this.width=1}update(){this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance&&this.instance.dispose();let e=[];this.objs.forEach((t=>e.push(t.instance.getAbsolutePosition().clone()))),this.instance=m.createTube(this.id,e,this.width/100,this.objs[0].app);let t=new d.StandardMaterial("mat_"+this.id,this.objs[0].app.scene);t.diffuseColor=d.Color3.FromHexString(this.color),this.instance.material=t,this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}addEventListener(e){if(this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.actionManager&&this.instance.actionManager.dispose(),this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1,e){this.instance.isPickable=!0,this.instance.enablePointerMoveEvents=!0;let t=new d.ActionManager(this.objs[0].app.scene);t.registerAction(new d.ExecuteCodeAction(d.ActionManager.OnPickTrigger,(t=>e(this.id)))),this.instance.actionManager=t}this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}isEnabled(e){this.instance&&(this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.setEnabled(e),this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!1)}dispose(){this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance&&this.instance.dispose(),this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}class jt{constructor(){this.color="#00ff00",this.width=5,this.isDotted=!1}update(){this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance&&this.instance.dispose(),this.instance=new d.MultiLine,this.objs[0].app.container.addControl(this.instance),this.instance.lineWidth=this.width,this.instance.color=this.color,this.isDotted&&(this.instance.dash=[1]),this.objs.forEach((e=>this.instance.add(e.instance))),this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}addEventListener(e){this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,e?(this.instance.isPointerBlocker=!1,this.instance.onPointerClickObservable.add((()=>{e(this.id)}))):this.instance.onPointerClickObservable.clear(),this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}isEnabled(e){this.instance&&(this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.isVisible=e,this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!1)}dispose(){this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance&&this.instance.dispose(),this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}class Jt{constructor(e,t){this.textDics=new Array,this.id=e,this.scene=t}set background(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this._background&&this._background.dispose(),this._background=new d.Image(y.getGUID(12)+"_Image",e),this._background.width=this.size.width+"px",this._background.height=this.size.height+"px",this.rect.addControl(this._background),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}addEventListener(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,e?(this._background.isPointerBlocker=!1,this._background.onPointerClickObservable.add((()=>{e(this.id)}))):this._background.onPointerClickObservable.clear(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setTexts(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.textDics.forEach((e=>e.dispose())),this.textDics.length=0;for(let t=0;t<e.length;t++){let i=new d.TextBlock;i.text=e[t].text,i.fontSize=e[t].fontSize?e[t].fontSize:"20px",i.color=e[t].color?e[t].color:"white",i.top=e[t].top?e[t].top:0,i.left=e[t].left?e[t].left:0,this.rect.addControl(i),this.textDics.push(i)}this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}line(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this._line&&this._line.dispose(),this._line=new d.Line,this._line.lineWidth=e.width?e.width:1.5,this._line.color=e.color?e.color:"green",this._line.y2=this.size.height/2,this.container.addControl(this._line),this._line.linkWithMesh(this.pint),this._line.connectedControl=this.rect,this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}dispose(){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.rect&&this.rect.dispose(),this._line&&this._line.dispose(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}isEnabled(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.rect&&(this.rect.isVisible=e),this._line&&(this._line.isVisible=e),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}var Vt,zt=function(e,t,i,n){return new(i||(i=Promise))((function(s,r){function o(e){try{c(n.next(e))}catch(e){r(e)}}function a(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};class Kt{constructor(e,t,i,n,s){this.id=e,this.scene=s,this.scaling=i,this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance=d.MeshBuilder.CreatePlane(this.id,{size:i,updatable:!0,sideOrientation:d.Mesh.DOUBLESIDE},this.scene),this.instance.alwaysSelectAsActiveMesh=!0,this.instance.position=t.clone(),this.instance.position.y+=n,this.instance.rotation.y+=Math.PI,this.instance.billboardMode=d.Mesh.BILLBOARDMODE_Y;let r=new d.StandardMaterial("Mat_"+this.id,this.scene);r.diffuseColor=d.Color3.White(),r.emissiveColor=d.Color3.White(),this.instance.material=r,this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setBackground(e){return zt(this,void 0,void 0,(function*(){if(this.url=e,!(this.textArr&&this.textArr.length>0))return new Promise((e=>{let t=new Image;t.src=this.url,t.onload=()=>{this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.scaling.y=this.scaling/(t.width/t.height)/this.scaling;let i=new d.DynamicTexture(this.id,{width:t.width,height:t.height},this.scene,!1);i.hasAlpha=!0,this.instance.material.diffuseTexture=i,i.getContext().drawImage(t,0,0),i.update(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1,e(!0)}}));yield this.setContents(this.textArr)}))}addEventListener(e){if(this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.actionManager&&this.instance.actionManager.dispose(),this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1,e){this.instance.isPickable=!0,this.instance.enablePointerMoveEvents=!0;let t=new d.ActionManager(this.scene);t.registerAction(new d.ExecuteCodeAction(d.ActionManager.OnPickTrigger,(t=>e(this.id)))),this.instance.actionManager=t}this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setColor(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.material.diffuseColor=d.Color3.FromHexString(e),this.instance.material.emissiveColor=d.Color3.FromHexString(e),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setContents(e){return this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.textArr=e,new Promise((t=>{let i=new Image;i.src=this.url,i.onload=()=>{this.instance.scaling.y=this.scaling/(i.width/i.height)/this.scaling;let n=new d.DynamicTexture(this.id,{width:i.width,height:i.height},this.scene,!1);n.hasAlpha=!0,this.instance.material.diffuseTexture=n,n.getContext().drawImage(i,0,0),e.forEach((e=>n.drawText(e.text,e.left,e.top,"bold "+e.fontSize+" monospace",e.color?e.color:"#fffffb","",!0,!1))),n.update(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1,t(!0)}}))}dispose(){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.dispose(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}isEnabled(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.setEnabled(e),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}class Wt{constructor(e){this.thunderNum=20,this.thunders=new Array,this.app=e}start(){this.canvas=document.createElement("canvas"),this.canvas.id="thunderEffect",this.canvas.style.cssText="position: absolute;left: 0;right: 0;top: 0;bottom: 0;width: 100%;height: 100%;outline-width: 0;-webkit-tap-highlight-color:transparent;z-index: 0;background: #000F1E;pointer-events: none;",this.app.canvas.parentElement.appendChild(this.canvas),this.canvasThunderCtx=this.canvas.getContext("2d"),this.X=this.canvas.width=window.innerWidth,this.Y=this.canvas.height=window.innerHeight,this.app.environment.setTransparent(.5);for(var e=0;e<this.thunderNum;e++){var t=new Qt(this.canvasThunderCtx,m.rand(0,this.X),m.rand(0,this.Y/3),m.rand(1,5),this.X,this.Y);this.thunders.push(t)}this.render()}close(){this.app.canvas.parentElement.removeChild(this.canvas),this.app.environment.setTransparent(1)}render(){this.clearCanvasThunder();for(var e=0;e<this.thunders.length;e++)this.thunders[e].render();window.requestAnimationFrame((()=>{this.render()}))}clearCanvasThunder(){this.canvasThunderCtx.globalCompositeOperation="darken",this.canvasThunderCtx.globalAlpha=.01,this.canvasThunderCtx.fillStyle="rgb(19, 16, 65)",this.canvasThunderCtx.fillRect(0,0,this.X,this.Y),this.canvasThunderCtx.globalCompositeOperation="source-over",this.canvasThunderCtx.globalAlpha=1,Math.random()<.02&&(this.canvasThunderCtx.fillStyle="rgb(128, 128, 128)",this.canvasThunderCtx.fillRect(0,0,this.X,this.Y))}}class Qt{constructor(e,t,i,n,s,r){this.ctx=e,this.X=s,this.Y=r,this.init(t,i,n)}init(e,t,i){this.x=e,this.y=t,this.r=i,this.l=m.rand(this.Y,3*this.Y),this.c="rgb(201, 162, 198)"}draw(){this.ctx.beginPath(),this.ctx.lineWidth=this.r,this.ctx.strokeStyle=this.c,this.ctx.moveTo(this.x,this.y),this.x+=m.rand(-10,10),this.y+=m.rand(10,15),this.ctx.lineTo(this.x,this.y),this.ctx.stroke()}updateParams(){this.y>this.l&&this.init(m.rand(0,this.X),m.rand(0,this.Y/3),m.rand(1,5))}render(){this.updateParams(),this.draw()}}class Xt{constructor(e){this.rainNum=1e3,this.rains=new Array,this.app=e}start(){this.canvas=document.createElement("canvas"),this.canvas.id="RainEffect",this.canvas.style.cssText="position: absolute;left: 0;right: 0;top: 0;bottom: 0;width: 100%;height: 100%;outline-width: 0;-webkit-tap-highlight-color:transparent; z-index: 2;pointer-events: none;",this.app.canvas.parentElement.appendChild(this.canvas),this.canvasRainCtx=this.canvas.getContext("2d"),this.X=this.canvas.width=window.innerWidth,this.Y=this.canvas.height=window.innerHeight;for(var e=0;e<this.rainNum;e++){var t=new Yt(this.canvasRainCtx,m.rand(0,this.X),m.rand(0,this.Y),1,this.Y);this.rains.push(t)}this.render()}close(){this.app.canvas.parentElement.removeChild(this.canvas)}render(){this.clearCanvasRain();for(var e=0;e<this.rains.length;e++)this.rains[e].render();window.requestAnimationFrame((()=>{this.render()}))}clearCanvasRain(){this.canvasRainCtx.clearRect(0,0,this.X,this.Y)}}class Yt{constructor(e,t,i,n,s){this.rainSpeed=10,this.ctx=e,this.Y=s,this.init(t,i,n)}init(e,t,i){this.x=e,this.y=t,this.r=i,this.c="rgb(179, 203, 255)",this.v={y:this.rainSpeed}}draw(){var e=this.ctx;e.beginPath(),e.fillStyle=this.c,e.arc(this.x,this.y,this.r,0,2*Math.PI,!1),e.fill()}updatePosition(){this.y+=this.v.y}wrapPosition(){this.y>this.Y&&(this.y=0)}render(){this.updatePosition(),this.wrapPosition(),this.draw()}}class qt{constructor(e){this.cloudNum=50,this.clouds=new Array,this.app=e}start(){this.canvas=document.createElement("canvas"),this.canvas.id="CloudEffect",this.canvas.style.cssText="position: absolute;left: 0;right: 0;top: 0;bottom: 0;width: 100%;height: 100%;outline-width: 0;-webkit-tap-highlight-color:transparent; z-index: 1;pointer-events: none;",this.app.canvas.parentElement.appendChild(this.canvas),this.canvasCloudCtx=this.canvas.getContext("2d"),this.X=this.canvas.width=window.innerWidth,this.Y=this.canvas.height=window.innerHeight;for(var e=0;e<this.cloudNum;e++){var t=new Zt(this.canvasCloudCtx,m.rand(-100,this.X+100),m.rand(0,this.Y/2),this.X);this.clouds.push(t)}this.render()}close(){this.app.canvas.parentElement.removeChild(this.canvas)}render(){this.clearCanvasCloud();for(var e=0;e<this.clouds.length;e++)this.clouds[e].render();window.requestAnimationFrame((()=>{this.render()}))}clearCanvasCloud(){this.canvasCloudCtx.clearRect(0,0,this.X,this.Y)}}class Zt{constructor(e,t,i,n){this.rainSpeed=10,this.ctx=e,this.X=n,this.init(t,i)}init(e,t){this.x=e,this.y=t,this.c="rgb(201, 162, 198)",this.r=m.rand(100,200),this.v={x:.5,y:0},this.color={r:0,g:0,b:0,a:1}}draw(){this.ctx.save(),this.ctx.scale(2,1),this.ctx.beginPath(),this.ctx.globalAlpha=.2,this.ctx.fillStyle=this.gradient(),this.ctx.arc(this.x,this.y,this.r,2*Math.PI,0,!1),this.ctx.fill(),this.ctx.scale(.5,1),this.ctx.restore()}gradient(){var e=this.color.r+","+this.color.g+","+this.color.b,t=this.ctx.createRadialGradient(this.x,this.y,0,this.x,this.y,this.r);return t.addColorStop(0,"rgba("+e+", "+1*this.color.a+")"),t.addColorStop(.5,"rgba("+e+", "+.5*this.color.a+")"),t.addColorStop(1,"rgba("+e+", "+0*this.color.a+")"),t}updatePosition(){this.x+=this.v.x}wrapPosition(){this.x-this.r>this.X&&(this.x=0-this.r)}render(){this.updatePosition(),this.wrapPosition(),this.draw()}}!function(e){e.Thunder="Thunder",e.Rain="Rain",e.Cloud="Cloud"}(Vt||(Vt={}));class $t{static add(e,t){switch(e){case Vt.Thunder:{let e=new Wt(t);e.start(),this.effects.add(Vt.Thunder,e)}break;case Vt.Rain:{let e=new Xt(t);e.start(),this.effects.add(Vt.Rain,e)}break;case Vt.Cloud:{let e=new qt(t);e.start(),this.effects.add(Vt.Cloud,e)}}}static remove(e){let t=this.effects.find(e);t&&t.close(),this.effects.remove(e)}}$t.effects=new A;const ei=e=>"boolean"==typeof e,ti=e=>"function"==typeof e,ii=e=>null!==e&&"object"==typeof e,ni=e=>ii(e)&&e.constructor==={}.constructor,si=e=>e&&"function"==typeof e[Symbol.iterator],ri=e=>e&&"function"==typeof e[Symbol.asyncIterator],oi=e=>"undefined"!=typeof Response&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json,ai=e=>"undefined"!=typeof Blob&&e instanceof Blob,ci=e=>e&&"object"==typeof e&&e.isBuffer,hi=e=>(e=>"undefined"!=typeof ReadableStream&&e instanceof ReadableStream||ii(e)&&ti(e.tee)&&ti(e.cancel)&&ti(e.getReader))(e)||(e=>ii(e)&&ti(e.read)&&ti(e.pipe)&&ei(e.readable))(e);function li(e,t){if(!e)throw new Error(t||"loader assertion failed.")}function ui(e){var t;if(!e)return!1;Array.isArray(e)&&(e=e[0]);return Array.isArray(null===(t=e)||void 0===t?void 0:t.extensions)}function di(e){var t,i;let n;return li(e,"null loader"),li(ui(e),"invalid loader"),Array.isArray(e)&&(n=e[1],e=e[0],e={...e,options:{...e.options,...n}}),(null!==(t=e)&&void 0!==t&&t.parseTextSync||null!==(i=e)&&void 0!==i&&i.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}let fi="";const pi={};const mi=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,gi=/^([-\w.]+\/[-\w.+]+)/;function Ai(e){const t=mi.exec(e);return t?t[1]:""}const yi=/\?.*/;function bi(e){return e.replace(yi,"")}function Bi(e){if(oi(e)){return e.url}if(ai(e)){return e.name||""}return"string"==typeof e?e:""}function vi(e){if(oi(e)){const t=e,i=t.headers.get("content-type")||"",n=bi(t.url);return function(e){const t=gi.exec(e);return t?t[1]:e}(i)||Ai(n)}if(ai(e)){return e.type||""}return"string"==typeof e?Ai(e):""}async function Ci(e){if(oi(e))return e;const t={},i=function(e){if(oi(e))return e.headers["content-length"]||-1;if(ai(e))return e.size;return"string"==typeof e?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}(e);i>=0&&(t["content-length"]=String(i));const n=Bi(e),s=vi(e);s&&(t["content-type"]=s);const r=await async function(e){const t=5;if("string"==typeof e)return"data:,".concat(e.slice(0,t));if(e instanceof Blob){const t=e.slice(0,5);return await new Promise((e=>{const i=new FileReader;i.onload=t=>{var i;return e(null==t||null===(i=t.target)||void 0===i?void 0:i.result)},i.readAsDataURL(t)}))}if(e instanceof ArrayBuffer){const i=function(e){let t="";const i=new Uint8Array(e);for(let e=0;e<i.byteLength;e++)t+=String.fromCharCode(i[e]);return btoa(t)}(e.slice(0,t));return"data:base64,".concat(i)}return null}(e);r&&(t["x-first-bytes"]=r),"string"==typeof e&&(e=(new TextEncoder).encode(e));const o=new Response(e,{headers:t});return Object.defineProperty(o,"url",{value:n}),o}async function wi(e,t){if("string"==typeof e){e=function(e){for(const t in pi)if(e.startsWith(t)){const i=pi[t];e=e.replace(t,i)}return e.startsWith("http://")||e.startsWith("https://")||(e="".concat(fi).concat(e)),e}(e);let i=t;return null!=t&&t.fetch&&"function"!=typeof(null==t?void 0:t.fetch)&&(i=t.fetch),await fetch(e,i)}return await Ci(e)}function Ei(e){return Ei="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ei(e)}function Mi(e){var t=function(e,t){if("object"!==Ei(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!==Ei(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Ei(t)?t:String(t)}function Ti(e,t,i){return(t=Mi(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function xi(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||function(e){if("undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type)return!0;if("undefined"!=typeof process&&"object"==typeof process.versions&&Boolean(process.versions.electron))return!0;const t="object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent,i=e||t;return!!(i&&i.indexOf("Electron")>=0)}()}const Ii="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source";xi();class Ri{constructor(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";Ti(this,"storage",void 0),Ti(this,"id",void 0),Ti(this,"config",void 0),this.storage=function(e){try{const t=window[e],i="__storage_test__";return t.setItem(i,i),t.removeItem(i),t}catch(e){return null}}(i),this.id=e,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){const e=JSON.stringify(this.config);this.storage.setItem(this.id,e)}}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}function Si(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600;const s=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(i=Math.min(i,n/e.width));const r=e.width*i,o=e.height*i,a=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(r/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(s,");"),"background-size:".concat(r,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),a]}let Oi;!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"}(Oi||(Oi={}));const Di=10;function Fi(e){return"string"!=typeof e?e:(e=e.toUpperCase(),Oi[e]||Oi.WHITE)}function _i(e,t){if(!e)throw new Error(t||"Assertion failed")}globalThis,globalThis.self||globalThis.window||globalThis.global;const Gi=globalThis.window||globalThis.self||globalThis.global,Li=(globalThis.document,globalThis.process||{});globalThis.console,globalThis.navigator;function Pi(){let e;var t,i;if(xi()&&Gi.performance)e=null==Gi||null===(t=Gi.performance)||void 0===t||null===(i=t.now)||void 0===i?void 0:i.call(t);else if("hrtime"in Li){var n;const t=null==Li||null===(n=Li.hrtime)||void 0===n?void 0:n.call(Li);e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}const ki={debug:xi()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Ni={enabled:!0,level:0};function Ui(){}const Hi={},ji={once:!0};class Ji{constructor(){let{id:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:""};Ti(this,"id",void 0),Ti(this,"VERSION",Ii),Ti(this,"_startTs",Pi()),Ti(this,"_deltaTs",Pi()),Ti(this,"_storage",void 0),Ti(this,"userData",{}),Ti(this,"LOG_THROTTLE_TIMEOUT",0),this.id=e,this.userData={},this._storage=new Ri("__probe-".concat(this.id,"__"),Ni),this.timeStamp("".concat(this.id," started")),function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"];const i=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(i),s=e;for(const i of n){const n=s[i];"function"==typeof n&&(t.find((e=>i===e))||(s[i]=n.bind(e)))}}(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Pi()-this._startTs).toPrecision(10))}getDelta(){return Number((Pi()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.setConfiguration({enabled:e}),this}setLevel(e){return this._storage.setConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,t){this._storage.setConfiguration({[e]:t})}settings(){console.table?console.table(this._storage.config):this._storage.config}assert(e,t){_i(e,t)}warn(e){return this._getLogFunction(0,e,ki.warn,arguments,ji)}error(e){return this._getLogFunction(0,e,ki.error,arguments)}deprecated(e,t){return this.warn("`".concat(e,"` is deprecated and will be removed in a later version. Use `").concat(t,"` instead"))}removed(e,t){return this.error("`".concat(e,"` has been removed. Use `").concat(t,"` instead"))}probe(e,t){return this._getLogFunction(e,t,ki.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,ki.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){return this._getLogFunction(e,t,ki.debug||ki.info,arguments,ji)}table(e,t,i){return t?this._getLogFunction(e,t,console.table||Ui,i&&[i],{tag:Ki(t)}):Ui}image(e){let{logLevel:t,priority:i,image:n,message:s="",scale:r=1}=e;return this._shouldLog(t||i)?xi()?function(e){let{image:t,message:i="",scale:n=1}=e;if("string"==typeof t){const e=new Image;return e.onload=()=>{Si(e,i,n)},e.src=t,Ui}const s=t.nodeName||"";if("img"===s.toLowerCase())return Si(t,i,n),Ui;if("canvas"===s.toLowerCase()){const e=new Image;return e.onload=()=>console.log(...Si(e,i,n)),e.src=t.toDataURL(),Ui}return Ui}({image:n,message:s,scale:r}):function(e){let{image:t,message:i="",scale:n=1}=e;return console.warn("removed"),Ui}({image:n,message:s,scale:r}):Ui}time(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}timeEnd(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,t){return this._getLogFunction(e,t,console.timeStamp||Ui)}group(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1};const n=zi({logLevel:e,message:t,opts:i}),{collapsed:s}=i;return n.method=(s?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}groupCollapsed(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(e,t,Object.assign({},i,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||Ui)}withGroup(e,t,i){this.group(e,t)();try{i()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=Vi(e)}_getLogFunction(e,t,i,n,s){if(this._shouldLog(e)){s=zi({logLevel:e,message:t,args:n,opts:s}),_i(i=i||s.method),s.total=this.getTotal(),s.delta=this.getDelta(),this._deltaTs=Pi();const r=s.tag||s.message;if(s.once&&r){if(Hi[r])return Ui;Hi[r]=Pi()}return t=function(e,t,i){if("string"==typeof t){const n=i.time?function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;const i=Math.max(t-e.length,0);return"".concat(" ".repeat(i)).concat(e)}(function(e){let t;return t=e<10?"".concat(e.toFixed(2),"ms"):e<100?"".concat(e.toFixed(1),"ms"):e<1e3?"".concat(e.toFixed(0),"ms"):"".concat((e/1e3).toFixed(2),"s"),t}(i.total)):"";t=function(e,t,i){if(!xi&&"string"==typeof e){if(t){const i=Fi(t);e="[".concat(i,"m").concat(e,"[39m")}if(i){const t=Fi(i);e="[".concat(t+Di,"m").concat(e,"[49m")}}return e}(t=i.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),i.color,i.background)}return t}(this.id,s.message,s),i.bind(console,t,...s.args)}return Ui}}function Vi(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 _i(Number.isFinite(t)&&t>=0),t}function zi(e){const{logLevel:t,message:i}=e;e.logLevel=Vi(t);const n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==i;);switch(typeof t){case"string":case"function":void 0!==i&&n.unshift(i),e.message=t;break;case"object":Object.assign(e,t)}"function"==typeof e.message&&(e.message=e.message());const s=typeof e.message;return _i("string"===s||"object"===s),Object.assign(e,{args:n},e.opts)}function Ki(e){for(const t in e)for(const i in e[t])return i||"untitled";return"empty"}Ti(Ji,"VERSION",Ii);const Wi=new Ji({id:"loaders.gl"});class Qi{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}"undefined"!=typeof self&&self,"undefined"!=typeof window&&window,void 0!==n.g&&n.g,"undefined"!=typeof document&&document;const Xi=Boolean("object"!=typeof process||"[object process]"!==String(process)||process.browser),Yi="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),qi=(Yi&&parseFloat(Yi[1]),{fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){Ti(this,"console",void 0),this.console=console}log(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.console.log.bind(this.console,...t)}info(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.console.info.bind(this.console,...t)}warn(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.console.warn.bind(this.console,...t)}error(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.console.error.bind(this.console,...t)}},CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:Xi,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]}),Zi={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 $i(){globalThis.loaders=globalThis.loaders||{};const{loaders:e}=globalThis;return e._state=e._state||{},e._state}const en=()=>{const e=$i();return e.globalOptions=e.globalOptions||{...qi},e.globalOptions};function tn(e,t,i,n){return i=i||[],function(e,t){nn(e,null,qi,Zi,t);for(const i of t){const n=e&&e[i.id]||{},s=i.options&&i.options[i.id]||{},r=i.deprecatedOptions&&i.deprecatedOptions[i.id]||{};nn(n,i.id,s,r,t)}}(e,i=Array.isArray(i)?i:[i]),rn(t,e,n)}function nn(e,t,i,n,s){const r=t||"Top level",o=t?"".concat(t,"."):"";for(const a in e){const c=!t&&ii(e[a]);if(!(a in i)&&!("baseUri"===a&&!t)&&!("workerUrl"===a&&t))if(a in n)Wi.warn("".concat(r," loader option '").concat(o).concat(a,"' no longer supported, use '").concat(n[a],"'"))();else if(!c){const e=sn(a,s);Wi.warn("".concat(r," loader option '").concat(o).concat(a,"' not recognized. ").concat(e))()}}}function sn(e,t){const i=e.toLowerCase();let n="";for(const s of t)for(const t in s.options){if(e===t)return"Did you mean '".concat(s.id,".").concat(t,"'?");const r=t.toLowerCase();(i.startsWith(r)||r.startsWith(i))&&(n=n||"Did you mean '".concat(s.id,".").concat(t,"'?"))}return n}function rn(e,t,i){const n={...e.options||{}};return function(e,t){t&&!("baseUri"in e)&&(e.baseUri=t)}(n,i),null===n.log&&(n.log=new Qi),on(n,en()),on(n,t),n}function on(e,t){for(const i in t)if(i in t){const n=t[i];ni(n)&&ni(e[i])?e[i]={...e[i],...t[i]}:e[i]=t[i]}}function an(e,t){const i=en(),n=e||i;return"function"==typeof n.fetch?n.fetch:ii(n.fetch)?e=>wi(e,n):null!=t&&t.fetch?null==t?void 0:t.fetch:wi}function cn(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}const hn="3.4.4";const ln={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==n.g&&n.g,document:"undefined"!=typeof document&&document},un=ln.global||ln.self||ln.window||{},dn="object"!=typeof process||"[object process]"!==String(process)||process.browser,fn="function"==typeof importScripts,pn="undefined"!=typeof window&&void 0!==window.orientation,mn="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);mn&&parseFloat(mn[1]);class gn{terminate(){}}const An=new Map;function yn(e){cn(e.source&&!e.url||!e.source&&e.url);let t=An.get(e.source||e.url);return t||(e.url&&(t=function(e){if(!e.startsWith("http"))return e;return bn((t=e,"try {\n importScripts('".concat(t,"');\n} catch (error) {\n console.error(error);\n throw error;\n}")));var t}(e.url),An.set(e.url,t)),e.source&&(t=bn(e.source),An.set(e.source,t))),cn(t),t}function bn(e){const t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function Bn(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2?arguments[2]:void 0;const n=i||new Set;if(e){if(vn(e))n.add(e);else if(vn(e.buffer))n.add(e.buffer);else if(ArrayBuffer.isView(e));else if(t&&"object"==typeof e)for(const i in e)Bn(e[i],t,n)}else;return void 0===i?Array.from(n):[]}function vn(e){return!!e&&(e instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&e instanceof MessagePort||("undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas)))}const Cn=()=>{};class wn{static isSupported(){return"undefined"!=typeof Worker&&dn||void 0!==gn&&!dn}constructor(e){Ti(this,"name",void 0),Ti(this,"source",void 0),Ti(this,"url",void 0),Ti(this,"terminated",!1),Ti(this,"worker",void 0),Ti(this,"onMessage",void 0),Ti(this,"onError",void 0),Ti(this,"_loadableURL","");const{name:t,source:i,url:n}=e;cn(i||n),this.name=t,this.source=i,this.url=n,this.onMessage=Cn,this.onError=e=>console.log(e),this.worker=dn?this._createBrowserWorker():this._createNodeWorker()}destroy(){this.onMessage=Cn,this.onError=Cn,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(e,t){t=t||Bn(e),this.worker.postMessage(e,t)}_getErrorFromErrorEvent(e){let t="Failed to load ";return t+="worker ".concat(this.name," from ").concat(this.url,". "),e.message&&(t+="".concat(e.message," in ")),e.lineno&&(t+=":".concat(e.lineno,":").concat(e.colno)),new Error(t)}_createBrowserWorker(){this._loadableURL=yn({source:this.source,url:this.url});const e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=e=>{e.data?this.onMessage(e.data):this.onError(new Error("No data received"))},e.onerror=e=>{this.onError(this._getErrorFromErrorEvent(e)),this.terminated=!0},e.onmessageerror=e=>console.error(e),e}_createNodeWorker(){let e;if(this.url){const t=this.url.includes(":/")||this.url.startsWith("/")?this.url:"./".concat(this.url);e=new gn(t,{eval:!1})}else{if(!this.source)throw new Error("no worker");e=new gn(this.source,{eval:!0})}return e.on("message",(e=>{this.onMessage(e)})),e.on("error",(e=>{this.onError(e)})),e.on("exit",(e=>{})),e}}class En{constructor(e,t){Ti(this,"name",void 0),Ti(this,"workerThread",void 0),Ti(this,"isRunning",!0),Ti(this,"result",void 0),Ti(this,"_resolve",(()=>{})),Ti(this,"_reject",(()=>{})),this.name=e,this.workerThread=t,this.result=new Promise(((e,t)=>{this._resolve=e,this._reject=t}))}postMessage(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}done(e){cn(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){cn(this.isRunning),this.isRunning=!1,this._reject(e)}}class Mn{static isSupported(){return wn.isSupported()}constructor(e){Ti(this,"name","unnamed"),Ti(this,"source",void 0),Ti(this,"url",void 0),Ti(this,"maxConcurrency",1),Ti(this,"maxMobileConcurrency",1),Ti(this,"onDebug",(()=>{})),Ti(this,"reuseWorkers",!0),Ti(this,"props",{}),Ti(this,"jobQueue",[]),Ti(this,"idleQueue",[]),Ti(this,"count",0),Ti(this,"isDestroyed",!1),this.source=e.source,this.url=e.url,this.setProps(e)}destroy(){this.idleQueue.forEach((e=>e.destroy())),this.isDestroyed=!0}setProps(e){this.props={...this.props,...e},void 0!==e.name&&(this.name=e.name),void 0!==e.maxConcurrency&&(this.maxConcurrency=e.maxConcurrency),void 0!==e.maxMobileConcurrency&&(this.maxMobileConcurrency=e.maxMobileConcurrency),void 0!==e.reuseWorkers&&(this.reuseWorkers=e.reuseWorkers),void 0!==e.onDebug&&(this.onDebug=e.onDebug)}async startJob(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e,t,i)=>e.done(i),i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:(e,t)=>e.error(t);const n=new Promise((n=>(this.jobQueue.push({name:e,onMessage:t,onError:i,onStart:n}),this)));return this._startQueuedJob(),await n}async _startQueuedJob(){if(!this.jobQueue.length)return;const e=this._getAvailableWorker();if(!e)return;const t=this.jobQueue.shift();if(t){this.onDebug({message:"Starting job",name:t.name,workerThread:e,backlog:this.jobQueue.length});const i=new En(t.name,e);e.onMessage=e=>t.onMessage(i,e.type,e.payload),e.onError=e=>t.onError(i,e),t.onStart(i);try{await i.result}finally{this.returnWorkerToQueue(e)}}}returnWorkerToQueue(e){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;const e="".concat(this.name.toLowerCase()," (#").concat(this.count," of ").concat(this.maxConcurrency,")");return new wn({name:e,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return pn?this.maxMobileConcurrency:this.maxConcurrency}}const Tn={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}};class xn{static isSupported(){return wn.isSupported()}static getWorkerFarm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return xn._workerFarm=xn._workerFarm||new xn({}),xn._workerFarm.setProps(e),xn._workerFarm}constructor(e){Ti(this,"props",void 0),Ti(this,"workerPools",new Map),this.props={...Tn},this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy();this.workerPools=new Map}setProps(e){this.props={...this.props,...e};for(const e of this.workerPools.values())e.setProps(this._getWorkerPoolProps())}getWorkerPool(e){const{name:t,source:i,url:n}=e;let s=this.workerPools.get(t);return s||(s=new Mn({name:t,source:i,url:n}),s.setProps(this._getWorkerPoolProps()),this.workerPools.set(t,s)),s}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}Ti(xn,"_workerFarm",void 0);const In="latest";async function Rn(e,t,i,n,s){const r=e.id,o=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=t[e.id]||{},n="".concat(e.id,"-worker.js");let s=i.workerUrl;if(s||"compression"!==e.id||(s=t.workerUrl),"test"===t._workerType&&(s="modules/".concat(e.module,"/dist/").concat(n)),!s){let t=e.version;"latest"===t&&(t=In);const i=t?"@".concat(t):"";s="https://unpkg.com/@loaders.gl/".concat(e.module).concat(i,"/dist/").concat(n)}return cn(s),s}(e,i),a=xn.getWorkerFarm(i).getWorkerPool({name:r,url:o});i=JSON.parse(JSON.stringify(i)),n=JSON.parse(JSON.stringify(n||{}));const c=await a.startJob("process-on-worker",Sn.bind(null,s));c.postMessage("process",{input:t,options:i,context:n});const h=await c.result;return await h.result}async function Sn(e,t,i,n){switch(i){case"done":t.done(n);break;case"error":t.error(new Error(n.error));break;case"process":const{id:s,input:r,options:o}=n;try{const i=await e(r,o);t.postMessage("done",{id:s,result:i})}catch(e){const i=e instanceof Error?e.message:"unknown error";t.postMessage("error",{id:s,error:i})}break;default:console.warn("parse-with-worker unknown message ".concat(i))}}function On(e,t,i){const n=void 0!==i?new Uint8Array(e).subarray(t,t+i):new Uint8Array(e).subarray(t);return new Uint8Array(n).buffer}async function Dn(e){const t=[];for await(const i of e)t.push(i);return function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];const n=t.map((e=>e instanceof ArrayBuffer?new Uint8Array(e):e)),s=n.reduce(((e,t)=>e+t.byteLength),0),r=new Uint8Array(s);let o=0;for(const e of n)r.set(e,o),o+=e.byteLength;return r.buffer}(...t)}const Fn=262144;const _n=262144;const Gn=1048576;function Ln(e){if((t=e)&&"object"==typeof t&&t.isBuffer)return e;var t;if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e))return 0===e.byteOffset&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);if("string"==typeof e){const t=e;return(new TextEncoder).encode(t).buffer}if(e&&"object"==typeof e&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}function Pn(e,t){return Xi?async function*(e,t){const i=e.getReader();let n;try{for(;;){const e=n||i.read();null!=t&&t._streamReadAhead&&(n=i.read());const{done:s,value:r}=await e;if(s)return;yield Ln(r)}}catch(e){i.releaseLock()}}(e,t):async function*(e,t){for await(const t of e)yield Ln(t)}(e)}function kn(e,t){if("string"==typeof e)return function*(e,t){const i=(null==t?void 0:t.chunkSize)||Fn;let n=0;const s=new TextEncoder;for(;n<e.length;){const t=Math.min(e.length-n,i),r=e.slice(n,n+t);n+=t,yield s.encode(r)}}(e,t);if(e instanceof ArrayBuffer)return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){const{chunkSize:i=_n}=t;let n=0;for(;n<e.byteLength;){const t=Math.min(e.byteLength-n,i),s=new ArrayBuffer(t),r=new Uint8Array(e,n,t);new Uint8Array(s).set(r),n+=t,yield s}}()}(e,t);if(ai(e))return async function*(e,t){const i=(null==t?void 0:t.chunkSize)||Gn;let n=0;for(;n<e.size;){const t=n+i,s=await e.slice(n,t).arrayBuffer();n=t,yield s}}(e,t);if(hi(e))return Pn(e,t);if(oi(e)){return Pn(e.body,t)}throw new Error("makeIterator")}const Nn="Cannot convert supplied data type";async function Un(e,t,i){const n=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if("string"==typeof e||n)return function(e,t,i){if(t.text&&"string"==typeof e)return e;if(ci(e)&&(e=e.buffer),e instanceof ArrayBuffer){const 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;const n=e.byteLength||e.length;return 0===e.byteOffset&&n===i.byteLength||(i=i.slice(e.byteOffset,e.byteOffset+n)),i}throw new Error(Nn)}(e,t);if(ai(e)&&(e=await Ci(e)),oi(e)){const i=e;return await async function(e){if(!e.ok){const t=await async function(e){let t="Failed to fetch resource ".concat(e.url," (").concat(e.status,"): ");try{const i=e.headers.get("Content-Type");let n=e.statusText;i.includes("application/json")&&(n+=" ".concat(await e.text())),t+=n,t=t.length>60?"".concat(t.slice(0,60),"..."):t}catch(e){}return t}(e);throw new Error(t)}}(i),t.binary?await i.arrayBuffer():await i.text()}if(hi(e)&&(e=kn(e,i)),si(e)||ri(e))return Dn(e);throw new Error(Nn)}function Hn(e){const t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(t+1):""}function jn(e){const t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(0,t):""}function Jn(e,t,i){if(i)return i;const n={fetch:an(t,e),...e};if(n.url){const e=bi(n.url);n.baseUrl=e,n.queryString=function(e){const t=e.match(yi);return t&&t[0]}(n.url),n.filename=Hn(e),n.baseUrl=jn(e)}return Array.isArray(n.loaders)||(n.loaders=null),n}const Vn=new Ji({id:"loaders.gl"}),zn=()=>{const e=$i();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};const Kn=/\.([^.]+)$/;function Wn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;if(!Qn(e))return null;if(t&&!Array.isArray(t))return di(t);let s=[];t&&(s=s.concat(t)),null!=i&&i.ignoreRegisteredLoaders||s.push(...zn()),function(e){for(const t of e)di(t)}(s);const r=function(e,t,i,n){const s=Bi(e),r=vi(e),o=bi(s)||(null==n?void 0:n.url);let a=null,c="";null!=i&&i.mimeType&&(a=Yn(t,null==i?void 0:i.mimeType),c="match forced by supplied MIME type ".concat(null==i?void 0:i.mimeType));var h;a=a||function(e,t){const i=t&&Kn.exec(t),n=i&&i[1];return n?function(e,t){t=t.toLowerCase();for(const i of e)for(const e of i.extensions)if(e.toLowerCase()===t)return i;return null}(e,n):null}(t,o),c=c||(a?"matched url ".concat(o):""),a=a||Yn(t,r),c=c||(a?"matched MIME type ".concat(r):""),a=a||function(e,t){if(!t)return null;for(const i of e)if("string"==typeof t){if(qn(t,i))return i}else if(ArrayBuffer.isView(t)){if(Zn(t.buffer,t.byteOffset,i))return i}else if(t instanceof ArrayBuffer){if(Zn(t,0,i))return i}return null}(t,e),c=c||(a?"matched initial data ".concat($n(e)):""),a=a||Yn(t,null==i?void 0:i.fallbackMimeType),c=c||(a?"matched fallback MIME type ".concat(r):""),c&&Vn.log(1,"selectLoader selected ".concat(null===(h=a)||void 0===h?void 0:h.name,": ").concat(c,"."));return a}(e,s,i,n);if(!(r||null!=i&&i.nothrow))throw new Error(Xn(e));return r}function Qn(e){return!(e instanceof Response&&204===e.status)}function Xn(e){const t=Bi(e),i=vi(e);let n="No valid loader found (";n+=t?"".concat(Hn(t),", "):"no url provided, ",n+="MIME type: ".concat(i?'"'.concat(i,'"'):"not provided",", ");const s=e?$n(e):"";return n+=s?' first bytes: "'.concat(s,'"'):"first bytes: not available",n+=")",n}function Yn(e,t){for(const i of e){if(i.mimeTypes&&i.mimeTypes.includes(t))return i;if(t==="application/x.".concat(i.id))return i}return null}function qn(e,t){if(t.testText)return t.testText(e);return(Array.isArray(t.tests)?t.tests:[t.tests]).some((t=>e.startsWith(t)))}function Zn(e,t,i){return(Array.isArray(i.tests)?i.tests:[i.tests]).some((n=>function(e,t,i,n){if(n instanceof ArrayBuffer)return function(e,t,i){if(i=i||e.byteLength,e.byteLength<i||t.byteLength<i)return!1;const n=new Uint8Array(e),s=new Uint8Array(t);for(let e=0;e<n.length;++e)if(n[e]!==s[e])return!1;return!0}(n,e,n.byteLength);switch(typeof n){case"function":return n(e,i);case"string":return n===es(e,t,n.length);default:return!1}}(e,t,i,n)))}function $n(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if("string"==typeof e)return e.slice(0,t);if(ArrayBuffer.isView(e))return es(e.buffer,e.byteOffset,t);if(e instanceof ArrayBuffer){return es(e,0,t)}return""}function es(e,t,i){if(e.byteLength<t+i)return"";const n=new DataView(e);let s="";for(let e=0;e<i;e++)s+=String.fromCharCode(n.getUint8(t+e));return s}async function ts(e,t,i,n){cn(!n||"object"==typeof n),!t||Array.isArray(t)||ui(t)||(n=void 0,i=t,t=void 0),i=i||{};const s=Bi(e=await e),r=function(e,t){if(!t&&e&&!Array.isArray(e))return e;let i;if(e&&(i=Array.isArray(e)?e:[e]),t&&t.loaders){const e=Array.isArray(t.loaders)?t.loaders:[t.loaders];i=i?[...i,...e]:e}return i&&i.length?i:null}(t,n),o=await async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;if(!Qn(e))return null;let s=Wn(e,t,{...i,nothrow:!0},n);if(s)return s;if(ai(e)&&(s=Wn(e=await e.slice(0,10).arrayBuffer(),t,i,n)),!(s||null!=i&&i.nothrow))throw new Error(Xn(e));return s}(e,r,i);return o?(n=Jn({url:s,parse:ts,loaders:r},i=tn(i,o,r,s),n||null),await async function(e,t,i,n){if(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:hn;cn(e,"no worker provided");const i=e.version}(e),oi(t)){const e=t,{ok:i,redirected:s,status:r,statusText:o,type:a,url:c}=e,h=Object.fromEntries(e.headers.entries());n.response={headers:h,ok:i,redirected:s,status:r,statusText:o,type:a,url:c}}if(t=await Un(t,e,i),e.parseTextSync&&"string"==typeof t)return i.dataType="text",e.parseTextSync(t,i,n,e);if(function(e,t){return!!xn.isSupported()&&!!(dn||null!=t&&t._nodeWorkers)&&e.worker&&(null==t?void 0:t.worker)}(e,i))return await Rn(e,t,i,n,ts);if(e.parseText&&"string"==typeof t)return await e.parseText(t,i,n,e);if(e.parse)return await e.parse(t,i,n,e);throw cn(!e.parseSync),new Error("".concat(e.id," loader - no parser found and worker is disabled"))}(o,e,i,n)):null}async function is(e,t,i,n){Array.isArray(t)||ui(t)||(void 0,i=t,t=void 0);const s=an(i);let r=e;return"string"==typeof e&&(r=await s(e)),ai(e)&&(r=await s(e)),await ts(r,t,i)}const ns={ADD:1,REPLACE:2},ss={EMPTY:"empty",SCENEGRAPH:"scenegraph",POINTCLOUD:"pointcloud",MESH:"mesh"},rs={I3S:"I3S",TILES3D:"TILES3D"},os={GEOMETRIC_ERROR:"geometricError",MAX_SCREEN_THRESHOLD:"maxScreenThreshold"},as="3.4.4",cs={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"};Object.keys(cs);function hs(e,t,i){li(e instanceof ArrayBuffer);const n=new TextDecoder("utf8"),s=new Uint8Array(e,t,i);return n.decode(s)}const ls="3.4.4",us={draco:{decoderType:"object"==typeof WebAssembly?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}},ds={name:"Draco",id:dn?"draco":"draco-nodejs",module:"draco",shapes:["mesh"],version:ls,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:us};class fs{constructor(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Map;Ti(this,"name",void 0),Ti(this,"type",void 0),Ti(this,"nullable",void 0),Ti(this,"metadata",void 0),this.name=e,this.type=t,this.nullable=i,this.metadata=n}get typeId(){return this.type&&this.type.typeId}clone(){return new fs(this.name,this.type,this.nullable,this.metadata)}compareTo(e){return this.name===e.name&&this.type===e.type&&this.nullable===e.nullable&&this.metadata===e.metadata}toString(){return"".concat(this.type).concat(this.nullable?", nullable":"").concat(this.metadata?", metadata: ".concat(this.metadata):"")}}let ps,ms,gs,As,ys,bs,Bs,vs,Cs=function(e){return e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.Float=3]="Float",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct=13]="Struct",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Dictionary=-1]="Dictionary",e[e.Int8=-2]="Int8",e[e.Int16=-3]="Int16",e[e.Int32=-4]="Int32",e[e.Int64=-5]="Int64",e[e.Uint8=-6]="Uint8",e[e.Uint16=-7]="Uint16",e[e.Uint32=-8]="Uint32",e[e.Uint64=-9]="Uint64",e[e.Float16=-10]="Float16",e[e.Float32=-11]="Float32",e[e.Float64=-12]="Float64",e[e.DateDay=-13]="DateDay",e[e.DateMillisecond=-14]="DateMillisecond",e[e.TimestampSecond=-15]="TimestampSecond",e[e.TimestampMillisecond=-16]="TimestampMillisecond",e[e.TimestampMicrosecond=-17]="TimestampMicrosecond",e[e.TimestampNanosecond=-18]="TimestampNanosecond",e[e.TimeSecond=-19]="TimeSecond",e[e.TimeMillisecond=-20]="TimeMillisecond",e[e.TimeMicrosecond=-21]="TimeMicrosecond",e[e.TimeNanosecond=-22]="TimeNanosecond",e[e.DenseUnion=-23]="DenseUnion",e[e.SparseUnion=-24]="SparseUnion",e[e.IntervalDayTime=-25]="IntervalDayTime",e[e.IntervalYearMonth=-26]="IntervalYearMonth",e}({});class ws{static isNull(e){return e&&e.typeId===Cs.Null}static isInt(e){return e&&e.typeId===Cs.Int}static isFloat(e){return e&&e.typeId===Cs.Float}static isBinary(e){return e&&e.typeId===Cs.Binary}static isUtf8(e){return e&&e.typeId===Cs.Utf8}static isBool(e){return e&&e.typeId===Cs.Bool}static isDecimal(e){return e&&e.typeId===Cs.Decimal}static isDate(e){return e&&e.typeId===Cs.Date}static isTime(e){return e&&e.typeId===Cs.Time}static isTimestamp(e){return e&&e.typeId===Cs.Timestamp}static isInterval(e){return e&&e.typeId===Cs.Interval}static isList(e){return e&&e.typeId===Cs.List}static isStruct(e){return e&&e.typeId===Cs.Struct}static isUnion(e){return e&&e.typeId===Cs.Union}static isFixedSizeBinary(e){return e&&e.typeId===Cs.FixedSizeBinary}static isFixedSizeList(e){return e&&e.typeId===Cs.FixedSizeList}static isMap(e){return e&&e.typeId===Cs.Map}static isDictionary(e){return e&&e.typeId===Cs.Dictionary}get typeId(){return Cs.NONE}compareTo(e){return this===e}}class Es extends(null){get typeId(){return Type.Null}get[Symbol.toStringTag](){return"Null"}toString(){return"Null"}}class Ms extends(null){get typeId(){return Type.Bool}get[Symbol.toStringTag](){return"Bool"}toString(){return"Bool"}}ps=Symbol.toStringTag;class Ts extends ws{constructor(e,t){super(),Ti(this,"isSigned",void 0),Ti(this,"bitWidth",void 0),this.isSigned=e,this.bitWidth=t}get typeId(){return Cs.Int}get[ps](){return"Int"}toString(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}}class xs extends Ts{constructor(){super(!0,8)}}class Is extends Ts{constructor(){super(!0,16)}}class Rs extends Ts{constructor(){super(!0,32)}}class Ss extends Ts{constructor(){super(!1,8)}}class Os extends Ts{constructor(){super(!1,16)}}class Ds extends Ts{constructor(){super(!1,32)}}const Fs=32,_s=64;ms=Symbol.toStringTag;class Gs extends ws{constructor(e){super(),Ti(this,"precision",void 0),this.precision=e}get typeId(){return Cs.Float}get[ms](){return"Float"}toString(){return"Float".concat(this.precision)}}class Ls extends Gs{constructor(){super(Fs)}}class Ps extends Gs{constructor(){super(_s)}}class ks extends(null){constructor(){super()}get typeId(){return Type.Binary}toString(){return"Binary"}get[Symbol.toStringTag](){return"Binary"}}class Ns extends(null){get typeId(){return Type.Utf8}get[Symbol.toStringTag](){return"Utf8"}toString(){return"Utf8"}}gs=Symbol.toStringTag;As=Symbol.toStringTag;ys=Symbol.toStringTag;bs=Symbol.toStringTag;Bs=Symbol.toStringTag;class Us extends ws{constructor(e,t){super(),Ti(this,"listSize",void 0),Ti(this,"children",void 0),this.listSize=e,this.children=[t]}get typeId(){return Cs.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[Bs](){return"FixedSizeList"}toString(){return"FixedSizeList[".concat(this.listSize,"]<").concat(this.valueType,">")}}vs=Symbol.toStringTag;function Hs(e,t,i){const n=function(e){switch(e.constructor){case Int8Array:return new xs;case Uint8Array:return new Ss;case Int16Array:return new Is;case Uint16Array:return new Os;case Int32Array:return new Rs;case Uint32Array:return new Ds;case Float32Array:return new Ls;case Float64Array:return new Ps;default:throw new Error("array type not supported")}}(t.value),s=i||function(e){const t=new Map;"byteOffset"in e&&t.set("byteOffset",e.byteOffset.toString(10));"byteStride"in e&&t.set("byteStride",e.byteStride.toString(10));"normalized"in e&&t.set("normalized",e.normalized.toString());return t}(t);return new fs(e,new Us(t.size,new fs("value",n)),!1,s)}class js{constructor(e,t){Ti(this,"fields",void 0),Ti(this,"metadata",void 0),function(e,t){if(!e)throw new Error(t||"loader assertion failed.")}(Array.isArray(e)),function(e){const t={};for(const i of e)t[i.name]&&console.warn("Schema: duplicated field name",i.name,i),t[i.name]=!0}(e),this.fields=e,this.metadata=t||new Map}compareTo(e){if(this.metadata!==e.metadata)return!1;if(this.fields.length!==e.fields.length)return!1;for(let t=0;t<this.fields.length;++t)if(!this.fields[t].compareTo(e.fields[t]))return!1;return!0}select(){const e=Object.create(null);for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];for(const t of i)e[t]=!0;const s=this.fields.filter((t=>e[t.name]));return new js(s,this.metadata)}selectAt(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];const n=t.map((e=>this.fields[e])).filter(Boolean);return new js(n,this.metadata)}assign(e){let t,i=this.metadata;if(e instanceof js){const n=e;t=n.fields,i=Js(Js(new Map,this.metadata),n.metadata)}else t=e;const n=Object.create(null);for(const e of this.fields)n[e.name]=e;for(const e of t)n[e.name]=e;const s=Object.values(n);return new js(s,i)}}function Js(e,t){return new Map([...e||new Map,...t||new Map])}function Vs(e,t,i){return Hs(e,t,i?zs(i.metadata):void 0)}function zs(e){const t=new Map;for(const i in e)t.set("".concat(i,".string"),JSON.stringify(e[i]));return t}const Ks={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},Ws={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class Qs{constructor(e){Ti(this,"draco",void 0),Ti(this,"decoder",void 0),Ti(this,"metadataQuerier",void 0),this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=new this.draco.DecoderBuffer;i.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(t);const n=this.decoder.GetEncodedGeometryType(i),s=n===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let e;switch(n){case this.draco.TRIANGULAR_MESH:e=this.decoder.DecodeBufferToMesh(i,s);break;case this.draco.POINT_CLOUD:e=this.decoder.DecodeBufferToPointCloud(i,s);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!e.ok()||!s.ptr){const t="DRACO decompression failed: ".concat(e.error_msg());throw new Error(t)}const r=this._getDracoLoaderData(s,n,t),o=this._getMeshData(s,r,t),a=function(e){let t=1/0,i=1/0,n=1/0,s=-1/0,r=-1/0,o=-1/0;const a=e.POSITION?e.POSITION.value:[],c=a&&a.length;for(let e=0;e<c;e+=3){const c=a[e],h=a[e+1],l=a[e+2];t=c<t?c:t,i=h<i?h:i,n=l<n?l:n,s=c>s?c:s,r=h>r?h:r,o=l>o?l:o}return[[t,i,n],[s,r,o]]}(o.attributes),c=function(e,t,i){const n=zs(t.metadata),s=[],r=function(e){const t={};for(const i in e){const n=e[i];t[n.name||"undefined"]=n}return t}(t.attributes);for(const t in e){const i=Vs(t,e[t],r[t]);s.push(i)}if(i){const e=Vs("indices",i);s.push(e)}return new js(s,n)}(o.attributes,r,o.indices);return{loader:"draco",loaderData:r,header:{vertexCount:s.num_points(),boundingBox:a},...o,schema:c}}finally{this.draco.destroy(i),s&&this.draco.destroy(s)}}_getDracoLoaderData(e,t,i){const n=this._getTopLevelMetadata(e),s=this._getDracoAttributes(e,i);return{geometry_type:t,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:n,attributes:s}}_getDracoAttributes(e,t){const i={};for(let n=0;n<e.num_attributes();n++){const s=this.decoder.GetAttribute(e,n),r=this._getAttributeMetadata(e,n);i[s.unique_id()]={unique_id:s.unique_id(),attribute_type:s.attribute_type(),data_type:s.data_type(),num_components:s.num_components(),byte_offset:s.byte_offset(),byte_stride:s.byte_stride(),normalized:s.normalized(),attribute_index:n,metadata:r};const o=this._getQuantizationTransform(s,t);o&&(i[s.unique_id()].quantization_transform=o);const a=this._getOctahedronTransform(s,t);a&&(i[s.unique_id()].octahedron_transform=a)}return i}_getMeshData(e,t,i){const n=this._getMeshAttributes(t,e,i);if(!n.POSITION)throw new Error("DRACO: No position attribute found.");return e instanceof this.draco.Mesh?"triangle-strip"===i.topology?{topology:"triangle-strip",mode:4,attributes:n,indices:{value:this._getTriangleStripIndices(e),size:1}}:{topology:"triangle-list",mode:5,attributes:n,indices:{value:this._getTriangleListIndices(e),size:1}}:{topology:"point-list",mode:0,attributes:n}}_getMeshAttributes(e,t,i){const n={};for(const s of Object.values(e.attributes)){const e=this._deduceAttributeName(s,i);s.name=e;const{value:r,size:o}=this._getAttributeValues(t,s);n[e]={value:r,size:o,byteOffset:s.byte_offset,byteStride:s.byte_stride,normalized:s.normalized}}return n}_getTriangleListIndices(e){const t=3*e.num_faces(),i=4*t,n=this.draco._malloc(i);try{return this.decoder.GetTrianglesUInt32Array(e,i,n),new Uint32Array(this.draco.HEAPF32.buffer,n,t).slice()}finally{this.draco._free(n)}}_getTriangleStripIndices(e){const t=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(e,t),function(e){const t=e.size(),i=new Int32Array(t);for(let n=0;n<t;n++)i[n]=e.GetValue(n);return i}(t)}finally{this.draco.destroy(t)}}_getAttributeValues(e,t){const i=Ws[t.data_type],n=t.num_components,s=e.num_points()*n,r=s*i.BYTES_PER_ELEMENT,o=function(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}}(this.draco,i);let a;const c=this.draco._malloc(r);try{const n=this.decoder.GetAttribute(e,t.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(e,n,o,r,c),a=new i(this.draco.HEAPF32.buffer,c,s).slice()}finally{this.draco._free(c)}return{value:a,size:n}}_deduceAttributeName(e,t){const i=e.unique_id;for(const[e,n]of Object.entries(t.extraAttributes||{}))if(n===i)return e;const n=e.attribute_type;for(const e in Ks){if(this.draco[e]===n)return Ks[e]}const s=t.attributeNameEntry||"name";return e.metadata[s]?e.metadata[s].string:"CUSTOM_ATTRIBUTE_".concat(i)}_getTopLevelMetadata(e){const t=this.decoder.GetMetadata(e);return this._getDracoMetadata(t)}_getAttributeMetadata(e,t){const i=this.decoder.GetAttributeMetadata(e,t);return this._getDracoMetadata(i)}_getDracoMetadata(e){if(!e||!e.ptr)return{};const t={},i=this.metadataQuerier.NumEntries(e);for(let n=0;n<i;n++){const i=this.metadataQuerier.GetEntryName(e,n);t[i]=this._getDracoMetadataField(e,i)}return t}_getDracoMetadataField(e,t){const i=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(e,t,i);const n=function(e){const t=e.size(),i=new Int32Array(t);for(let n=0;n<t;n++)i[n]=e.GetValue(n);return i}(i);return{int:this.metadataQuerier.GetIntEntry(e,t),string:this.metadataQuerier.GetStringEntry(e,t),double:this.metadataQuerier.GetDoubleEntry(e,t),intArray:n}}finally{this.draco.destroy(i)}}_disableAttributeTransforms(e){const{quantizedAttributes:t=[],octahedronAttributes:i=[]}=e,n=[...t,...i];for(const e of n)this.decoder.SkipAttributeTransform(this.draco[e])}_getQuantizationTransform(e,t){const{quantizedAttributes:i=[]}=t,n=e.attribute_type();if(i.map((e=>this.decoder[e])).includes(n)){const t=new this.draco.AttributeQuantizationTransform;try{if(t.InitFromAttribute(e))return{quantization_bits:t.quantization_bits(),range:t.range(),min_values:new Float32Array([1,2,3]).map((e=>t.min_value(e)))}}finally{this.draco.destroy(t)}}return null}_getOctahedronTransform(e,t){const{octahedronAttributes:i=[]}=t,n=e.attribute_type();if(i.map((e=>this.decoder[e])).includes(n)){const t=new this.draco.AttributeQuantizationTransform;try{if(t.InitFromAttribute(e))return{quantization_bits:t.quantization_bits()}}finally{this.draco.destroy(t)}}return null}}var Xs=n(125);const Ys="3.4.4",qs={};async function Zs(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t&&(e=function(e,t,i){if(e.startsWith("http"))return e;const n=i.modules||{};if(n[e])return n[e];if(!dn)return"modules/".concat(t,"/dist/libs/").concat(e);if(i.CDN)return cn(i.CDN.startsWith("http")),"".concat(i.CDN,"/").concat(t,"@").concat(Ys,"/dist/libs/").concat(e);if(fn)return"../src/libs/".concat(e);return"modules/".concat(t,"/src/libs/").concat(e)}(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})),qs[e]=qs[e]||async function(e){if(e.endsWith("wasm")){const t=await fetch(e);return await t.arrayBuffer()}if(!dn)try{return Xs&&Xs.requireFromFile&&await Xs.requireFromFile(e)}catch{return null}if(fn)return importScripts(e);const t=await fetch(e);return function(e,t){if(!dn)return Xs.requireFromString&&Xs.requireFromString(e,t);if(fn)return eval.call(un,e),null;const i=document.createElement("script");i.id=t;try{i.appendChild(document.createTextNode(e))}catch(t){i.text=e}return document.body.appendChild(i),null}(await t.text(),e)}(e),await qs[e]}const $s="https://www.gstatic.com/draco/versioned/decoders/".concat("1.5.5"),er="".concat($s,"/draco_decoder.js"),tr="".concat($s,"/draco_wasm_wrapper.js"),ir="".concat($s,"/draco_decoder.wasm");"https://raw.githubusercontent.com/google/draco/".concat("1.4.1","/javascript/draco_encoder.js");let nr;async function sr(e){const t=e.modules||{};return nr=t.draco3d?nr||t.draco3d.createDecoderModule({}).then((e=>({draco:e}))):nr||async function(e){let t,i;if("js"===(e.draco&&e.draco.decoderType))t=await Zs(er,"draco",e);else[t,i]=await Promise.all([await Zs(tr,"draco",e),await Zs(ir,"draco",e)]);return t=t||globalThis.DracoDecoderModule,await function(e,t){const i={};t&&(i.wasmBinary=t);return new Promise((t=>{e({...i,onModuleLoaded:e=>t({draco:e})})}))}(t,i)}(e),await nr}const rr={...ds,parse:async function(e,t){const{draco:i}=await sr(t),n=new Qs(i);try{return n.parseSync(e,null==t?void 0:t.draco)}finally{n.destroy()}}};const or={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},ar={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,...or},cr=1/Math.PI*180,hr=1/180*Math.PI,lr={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0};function ur(e,{precision:t=lr.precision}={}){return e=function(e){return Math.round(e/lr.EPSILON)*lr.EPSILON}(e),"".concat(parseFloat(e.toPrecision(t)))}function dr(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function fr(e){return function(e,t){return gr(e,(e=>e*hr),t)}(e)}function pr(e){return function(e,t){return gr(e,(e=>e*cr),t)}(e)}function mr(e,t,i){const n=lr.EPSILON;i&&(lr.EPSILON=i);try{if(e===t)return!0;if(dr(e)&&dr(t)){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(!mr(e[i],t[i]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):"number"==typeof e&&"number"==typeof t&&Math.abs(e-t)<=lr.EPSILON*Math.max(1,Math.abs(e),Math.abs(t))}finally{lr.EPSILON=n}}function gr(e,t,i){if(dr(e)){const n=e;i=i||function(e){return e.clone?e.clone():new Array(e.length)}(n);for(let s=0;s<i.length&&s<n.length;++s)i[s]=t(e[s],s,i);return i}return t(e)}class Ar extends(function(e){function t(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}(Array)){clone(){return(new this.constructor).copy(this)}fromArray(e,t=0){for(let i=0;i<this.ELEMENTS;++i)this[i]=e[i+t];return this.check()}toArray(e=[],t=0){for(let i=0;i<this.ELEMENTS;++i)e[t+i]=this[i];return e}from(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}to(e){return e===this?this:dr(e)?this.toArray(e):this.toObject(e)}toTarget(e){return e?this.to(e):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(lr)}formatString(e){let t="";for(let i=0;i<this.ELEMENTS;++i)t+=(i>0?", ":"")+ur(this[i],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}equals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(!mr(this[t],e[t]))return!1;return!0}exactEquals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(this[t]!==e[t])return!1;return!0}negate(){for(let e=0;e<this.ELEMENTS;++e)this[e]=-this[e];return this.check()}lerp(e,t,i){if(void 0===i)return this.lerp(this,e,t);for(let n=0;n<this.ELEMENTS;++n){const s=e[n];this[n]=s+i*(t[n]-s)}return this.check()}min(e){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.min(e[t],this[t]);return this.check()}max(e){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.max(e[t],this[t]);return this.check()}clamp(e,t){for(let i=0;i<this.ELEMENTS;++i)this[i]=Math.min(Math.max(this[i],e[i]),t[i]);return this.check()}add(...e){for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]+=t[e];return this.check()}subtract(...e){for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]-=t[e];return this.check()}scale(e){if("number"==typeof e)for(let t=0;t<this.ELEMENTS;++t)this[t]*=e;else for(let t=0;t<this.ELEMENTS&&t<e.length;++t)this[t]*=e[t];return this.check()}multiplyByScalar(e){for(let t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}check(){if(lr.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let e=this.length===this.ELEMENTS;for(let t=0;t<this.ELEMENTS;++t)e=e&&Number.isFinite(this[t]);return e}sub(e){return this.subtract(e)}setScalar(e){for(let t=0;t<this.ELEMENTS;++t)this[t]=e;return this.check()}addScalar(e){for(let t=0;t<this.ELEMENTS;++t)this[t]+=e;return this.check()}subScalar(e){return this.addScalar(-e)}multiplyScalar(e){for(let t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}divideScalar(e){return this.multiplyByScalar(1/e)}clampScalar(e,t){for(let i=0;i<this.ELEMENTS;++i)this[i]=Math.min(Math.max(this[i],e),t);return this.check()}get elements(){return this}}function yr(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(e));return e}function br(e,t,i=""){if(lr.debug&&!function(e,t){if(e.length!==t)return!1;for(let t=0;t<e.length;++t)if(!Number.isFinite(e[t]))return!1;return!0}(e,t))throw new Error("math.gl: ".concat(i," some fields set to invalid numbers'"));return e}function Br(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}class vr extends Ar{get x(){return this[0]}set x(e){this[0]=yr(e)}get y(){return this[1]}set y(e){this[1]=yr(e)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let e=0;for(let t=0;t<this.ELEMENTS;++t)e+=this[t]*this[t];return e}magnitudeSquared(){return this.lengthSquared()}distance(e){return Math.sqrt(this.distanceSquared(e))}distanceSquared(e){let t=0;for(let i=0;i<this.ELEMENTS;++i){const n=this[i]-e[i];t+=n*n}return yr(t)}dot(e){let t=0;for(let i=0;i<this.ELEMENTS;++i)t+=this[i]*e[i];return yr(t)}normalize(){const e=this.magnitude();if(0!==e)for(let t=0;t<this.ELEMENTS;++t)this[t]/=e;return this.check()}multiply(...e){for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]*=t[e];return this.check()}divide(...e){for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]/=t[e];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(e){return this.distance(e)}distanceToSquared(e){return this.distanceSquared(e)}getComponent(e){return Br(e>=0&&e<this.ELEMENTS,"index is out of range"),yr(this[e])}setComponent(e,t){return Br(e>=0&&e<this.ELEMENTS,"index is out of range"),this[e]=t,this.check()}addVectors(e,t){return this.copy(e).add(t)}subVectors(e,t){return this.copy(e).subtract(t)}multiplyVectors(e,t){return this.copy(e).multiply(t)}addScaledVector(e,t){return this.add(new this.constructor(e).multiplyScalar(t))}}var Cr=1e-6,wr="undefined"!=typeof Float32Array?Float32Array:Array;Math.random;Math.PI;function Er(){var e=new wr(3);return wr!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function Mr(e){var t=e[0],i=e[1],n=e[2];return Math.hypot(t,i,n)}function Tr(e,t,i){var n=new wr(3);return n[0]=e,n[1]=t,n[2]=i,n}function xr(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Ir(e,t,i){var n=t[0],s=t[1],r=t[2],o=i[0],a=i[1],c=i[2];return e[0]=s*c-r*a,e[1]=r*o-n*c,e[2]=n*a-s*o,e}function Rr(e,t,i){var n=t[0],s=t[1],r=t[2],o=i[3]*n+i[7]*s+i[11]*r+i[15];return o=o||1,e[0]=(i[0]*n+i[4]*s+i[8]*r+i[12])/o,e[1]=(i[1]*n+i[5]*s+i[9]*r+i[13])/o,e[2]=(i[2]*n+i[6]*s+i[10]*r+i[14])/o,e}function Sr(e,t,i){var n=t[0],s=t[1],r=t[2];return e[0]=n*i[0]+s*i[3]+r*i[6],e[1]=n*i[1]+s*i[4]+r*i[7],e[2]=n*i[2]+s*i[5]+r*i[8],e}function Or(e,t,i){var n=i[0],s=i[1],r=i[2],o=i[3],a=t[0],c=t[1],h=t[2],l=s*h-r*c,u=r*a-n*h,d=n*c-s*a,f=s*d-r*u,p=r*l-n*d,m=n*u-s*l,g=2*o;return l*=g,u*=g,d*=g,f*=2,p*=2,m*=2,e[0]=a+l+f,e[1]=c+u+p,e[2]=h+d+m,e}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var Dr,Fr=Mr;Dr=Er();function _r(e,t,i){const n=t[0],s=t[1],r=i[3]*n+i[7]*s||1;return e[0]=(i[0]*n+i[4]*s)/r,e[1]=(i[1]*n+i[5]*s)/r,e}function Gr(e,t,i){const n=t[0],s=t[1],r=t[2],o=i[3]*n+i[7]*s+i[11]*r||1;return e[0]=(i[0]*n+i[4]*s+i[8]*r)/o,e[1]=(i[1]*n+i[5]*s+i[9]*r)/o,e[2]=(i[2]*n+i[6]*s+i[10]*r)/o,e}function Lr(e,t,i){const n=t[0],s=t[1],r=t[2];return e[0]=i[0]*n+i[3]*s+i[6]*r,e[1]=i[1]*n+i[4]*s+i[7]*r,e[2]=i[2]*n+i[5]*s+i[8]*r,e[3]=t[3],e}const Pr=[0,0,0];let kr;class Nr extends vr{static get ZERO(){return kr||(kr=new Nr(0,0,0),Object.freeze(kr)),kr}constructor(e=0,t=0,i=0){super(-0,-0,-0),1===arguments.length&&dr(e)?this.copy(e):(lr.debug&&(yr(e),yr(t),yr(i)),this[0]=e,this[1]=t,this[2]=i)}set(e,t,i){return this[0]=e,this[1]=t,this[2]=i,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this.check()}fromObject(e){return lr.debug&&(yr(e.x),yr(e.y),yr(e.z)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e}get ELEMENTS(){return 3}get z(){return this[2]}set z(e){this[2]=yr(e)}angle(e){return function(e,t){var i=e[0],n=e[1],s=e[2],r=t[0],o=t[1],a=t[2],c=Math.sqrt(i*i+n*n+s*s)*Math.sqrt(r*r+o*o+a*a),h=c&&xr(e,t)/c;return Math.acos(Math.min(Math.max(h,-1),1))}(this,e)}cross(e){return Ir(this,this,e),this.check()}rotateX({radians:e,origin:t=Pr}){return function(e,t,i,n){var s=[],r=[];s[0]=t[0]-i[0],s[1]=t[1]-i[1],s[2]=t[2]-i[2],r[0]=s[0],r[1]=s[1]*Math.cos(n)-s[2]*Math.sin(n),r[2]=s[1]*Math.sin(n)+s[2]*Math.cos(n),e[0]=r[0]+i[0],e[1]=r[1]+i[1],e[2]=r[2]+i[2]}(this,this,t,e),this.check()}rotateY({radians:e,origin:t=Pr}){return function(e,t,i,n){var s=[],r=[];s[0]=t[0]-i[0],s[1]=t[1]-i[1],s[2]=t[2]-i[2],r[0]=s[2]*Math.sin(n)+s[0]*Math.cos(n),r[1]=s[1],r[2]=s[2]*Math.cos(n)-s[0]*Math.sin(n),e[0]=r[0]+i[0],e[1]=r[1]+i[1],e[2]=r[2]+i[2]}(this,this,t,e),this.check()}rotateZ({radians:e,origin:t=Pr}){return function(e,t,i,n){var s=[],r=[];s[0]=t[0]-i[0],s[1]=t[1]-i[1],s[2]=t[2]-i[2],r[0]=s[0]*Math.cos(n)-s[1]*Math.sin(n),r[1]=s[0]*Math.sin(n)+s[1]*Math.cos(n),r[2]=s[2],e[0]=r[0]+i[0],e[1]=r[1]+i[1],e[2]=r[2]+i[2]}(this,this,t,e),this.check()}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return Rr(this,this,e),this.check()}transformAsVector(e){return Gr(this,this,e),this.check()}transformByMatrix3(e){return Sr(this,this,e),this.check()}transformByMatrix2(e){return function(e,t,i){const n=t[0],s=t[1];e[0]=i[0]*n+i[2]*s,e[1]=i[1]*n+i[3]*s,e[2]=t[2]}(this,this,e),this.check()}transformByQuaternion(e){return Or(this,this,e),this.check()}}const Ur={[or.DOUBLE]:Float64Array,[or.FLOAT]:Float32Array,[or.UNSIGNED_SHORT]:Uint16Array,[or.UNSIGNED_INT]:Uint32Array,[or.UNSIGNED_BYTE]:Uint8Array,[or.BYTE]:Int8Array,[or.SHORT]:Int16Array,[or.INT]:Int32Array},Hr={DOUBLE:or.DOUBLE,FLOAT:or.FLOAT,UNSIGNED_SHORT:or.UNSIGNED_SHORT,UNSIGNED_INT:or.UNSIGNED_INT,UNSIGNED_BYTE:or.UNSIGNED_BYTE,BYTE:or.BYTE,SHORT:or.SHORT,INT:or.INT},jr="Failed to convert GL type";class Jr{static fromTypedArray(e){e=ArrayBuffer.isView(e)?e.constructor:e;for(const t in Ur){if(Ur[t]===e)return t}throw new Error(jr)}static fromName(e){const t=Hr[e];if(!t)throw new Error(jr);return t}static getArrayType(e){switch(e){case or.UNSIGNED_SHORT_5_6_5:case or.UNSIGNED_SHORT_4_4_4_4:case or.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:const t=Ur[e];if(!t)throw new Error(jr);return t}}static getByteSize(e){return Jr.getArrayType(e).BYTES_PER_ELEMENT}static validate(e){return Boolean(Jr.getArrayType(e))}static createTypedArray(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0;void 0===n&&(n=(t.byteLength-i)/Jr.getByteSize(e));return new(Jr.getArrayType(e))(t,i,n)}}class Vr{constructor(e,t){Ti(this,"json",void 0),Ti(this,"buffer",void 0),Ti(this,"featuresLength",0),Ti(this,"_cachedTypedArrays",{}),this.json=e,this.buffer=t}getExtension(e){return this.json.extensions&&this.json.extensions[e]}hasProperty(e){return Boolean(this.json[e])}getGlobalProperty(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ar.UNSIGNED_INT,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const n=this.json[e];return n&&Number.isFinite(n.byteOffset)?this._getTypedArrayFromBinary(e,t,i,1,n.byteOffset):n}getPropertyArray(e,t,i){const n=this.json[e];return n&&Number.isFinite(n.byteOffset)?("componentType"in n&&(t=Jr.fromName(n.componentType)),this._getTypedArrayFromBinary(e,t,i,this.featuresLength,n.byteOffset)):this._getTypedArrayFromArray(e,t,n)}getProperty(e,t,i,n,s){const r=this.json[e];if(!r)return r;const o=this.getPropertyArray(e,t,i);if(1===i)return o[n];for(let e=0;e<i;++e)s[e]=o[i*n+e];return s}_getTypedArrayFromBinary(e,t,i,n,s){const r=this._cachedTypedArrays;let o=r[e];return o||(o=Jr.createTypedArray(t,this.buffer.buffer,this.buffer.byteOffset+s,n*i),r[e]=o),o}_getTypedArrayFromArray(e,t,i){const n=this._cachedTypedArrays;let s=n[e];return s||(s=Jr.createTypedArray(t,i),n[e]=s),s}}const zr={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Kr={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]]},Wr={SCALAR:(e,t,i)=>{t[i]=e},VEC2:(e,t,i)=>{t[2*i+0]=e[0],t[2*i+1]=e[1]},VEC3:(e,t,i)=>{t[3*i+0]=e[0],t[3*i+1]=e[1],t[3*i+2]=e[2]},VEC4:(e,t,i)=>{t[4*i+0]=e[0],t[4*i+1]=e[1],t[4*i+2]=e[2],t[4*i+3]=e[3]},MAT2:(e,t,i)=>{t[4*i+0]=e[0],t[4*i+1]=e[1],t[4*i+2]=e[2],t[4*i+3]=e[3]},MAT3:(e,t,i)=>{t[9*i+0]=e[0],t[9*i+1]=e[1],t[9*i+2]=e[2],t[9*i+3]=e[3],t[9*i+4]=e[4],t[9*i+5]=e[5],t[9*i+6]=e[6],t[9*i+7]=e[7],t[9*i+8]=e[8],t[9*i+9]=e[9]},MAT4:(e,t,i)=>{t[16*i+0]=e[0],t[16*i+1]=e[1],t[16*i+2]=e[2],t[16*i+3]=e[3],t[16*i+4]=e[4],t[16*i+5]=e[5],t[16*i+6]=e[6],t[16*i+7]=e[7],t[16*i+8]=e[8],t[16*i+9]=e[9],t[16*i+10]=e[10],t[16*i+11]=e[11],t[16*i+12]=e[12],t[16*i+13]=e[13],t[16*i+14]=e[14],t[16*i+15]=e[15]}};const Qr=e=>void 0!==e;function Xr(e,t,i){if(!t)return null;let n=e.getExtension("3DTILES_batch_table_hierarchy");const s=t.HIERARCHY;return s&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),t.extensions=t.extensions||{},t.extensions["3DTILES_batch_table_hierarchy"]=s,n=s),n?function(e,t){let i,n,s;const r=e.instancesLength,o=e.classes;let a,c=e.classIds,h=e.parentCounts,l=e.parentIds,u=r;Qr(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,GL.UNSIGNED_SHORT),c.type=AttributeType.SCALAR,s=getBinaryAccessor(c),c=s.createArrayBufferView(t.buffer,t.byteOffset+c.byteOffset,r));if(Qr(h))for(Qr(h.byteOffset)&&(h.componentType=defaultValue(h.componentType,GL.UNSIGNED_SHORT),h.type=AttributeType.SCALAR,s=getBinaryAccessor(h),h=s.createArrayBufferView(t.buffer,t.byteOffset+h.byteOffset,r)),a=new Uint16Array(r),u=0,i=0;i<r;++i)a[i]=u,u+=h[i];Qr(l)&&Qr(l.byteOffset)&&(l.componentType=defaultValue(l.componentType,GL.UNSIGNED_SHORT),l.type=AttributeType.SCALAR,s=getBinaryAccessor(l),l=s.createArrayBufferView(t.buffer,t.byteOffset+l.byteOffset,u));const d=o.length;for(i=0;i<d;++i){const e=o[i].length,n=o[i].instances,s=getBinaryProperties(e,n,t);o[i].instances=combine(s,n)}const f=new Array(d).fill(0),p=new Uint16Array(r);for(i=0;i<r;++i)n=c[i],p[i]=f[n],++f[n];const m={classes:o,classIds:c,classIndexes:p,parentCounts:h,parentIndexes:a,parentIds:l};return function(e){const t=e.classIds,i=t.length;for(let t=0;t<i;++t)qr(e,t,stack)}(m),m}(n,i):null}function Yr(e,t,i){if(!e)return;const n=e.parentCounts;return e.parentIds?i(e,t):n>0?function(e,t,i){const n=e.classIds,s=e.parentCounts,r=e.parentIds,o=e.parentIndexes,a=n.length,c=scratchVisited;c.length=Math.max(c.length,a);const h=++marker,l=scratchStack;l.length=0,l.push(t);for(;l.length>0;){if(c[t=l.pop()]===h)continue;c[t]=h;const n=i(e,t);if(Qr(n))return n;const a=s[t],u=o[t];for(let e=0;e<a;++e){const i=r[u+e];i!==t&&l.push(i)}}return null}(e,t,i):function(e,t,i){let n=!0;for(;n;){const s=i(e,t);if(Qr(s))return s;const r=e.parentIds[t];n=r!==t,t=r}throw new Error("traverseHierarchySingleParent")}(e,t,i)}function qr(e,t,i){const n=e.parentCounts,s=e.parentIds,r=e.parentIndexes,o=e.classIds.length;if(!Qr(s))return;assert(t<o,"Parent index ".concat(t," exceeds the total number of instances: ").concat(o)),assert(-1===i.indexOf(t),"Circular dependency detected in the batch table hierarchy."),i.push(t);const a=Qr(n)?n[t]:1,c=Qr(n)?r[t]:t;for(let n=0;n<a;++n){const r=s[c+n];r!==t&&qr(e,r,i)}i.pop(t)}function Zr(e){return null!=e}const $r=(e,t)=>e,eo={HIERARCHY:!0,extensions:!0,extras:!0};class to{constructor(e,t,i){var n;let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};Ti(this,"json",void 0),Ti(this,"binary",void 0),Ti(this,"featureCount",void 0),Ti(this,"_extensions",void 0),Ti(this,"_properties",void 0),Ti(this,"_binaryProperties",void 0),Ti(this,"_hierarchy",void 0),li(i>=0),this.json=e||{},this.binary=t,this.featureCount=i,this._extensions=(null===(n=this.json)||void 0===n?void 0:n.extensions)||{},this._properties={};for(const e in this.json)eo[e]||(this._properties[e]=this.json[e]);this._binaryProperties=this._initializeBinaryProperties(),s["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=Xr(this,this.json,this.binary))}getExtension(e){return this.json&&this.json.extensions&&this.json.extensions[e]}memorySizeInBytes(){return 0}isClass(e,t){if(this._checkBatchId(e),li("string"==typeof t,t),this._hierarchy){return Zr(Yr(this._hierarchy,e,((e,i)=>{const n=e.classIds[i];return e.classes[n].name===t})))}return!1}isExactClass(e,t){return li("string"==typeof t,t),this.getExactClassName(e)===t}getExactClassName(e){if(this._checkBatchId(e),this._hierarchy){const t=this._hierarchy.classIds[e];return this._hierarchy.classes[t].name}}hasProperty(e,t){return this._checkBatchId(e),li("string"==typeof t,t),Zr(this._properties[t])||this._hasPropertyInHierarchy(e,t)}getPropertyNames(e,t){this._checkBatchId(e),(t=Zr(t)?t:[]).length=0;const i=Object.keys(this._properties);return t.push(...i),this._hierarchy&&this._getPropertyNamesInHierarchy(e,t),t}getProperty(e,t){if(this._checkBatchId(e),li("string"==typeof t,t),this._binaryProperties){const i=this._binaryProperties[t];if(Zr(i))return this._getBinaryProperty(i,e)}const i=this._properties[t];if(Zr(i))return $r(i[e]);if(this._hierarchy){const i=this._getHierarchyProperty(e,t);if(Zr(i))return i}}setProperty(e,t,i){const n=this.featureCount;if(this._checkBatchId(e),li("string"==typeof t,t),this._binaryProperties){const n=this._binaryProperties[t];if(n)return void this._setBinaryProperty(n,e,i)}if(this._hierarchy&&this._setHierarchyProperty(this,e,t,i))return;let s=this._properties[t];Zr(s)||(this._properties[t]=new Array(n),s=this._properties[t]),s[e]=$r(i)}_checkBatchId(e){if(!(e>=0&&e<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}_getBinaryProperty(e,t){return e.unpack(e.typedArray,t)}_setBinaryProperty(e,t,i){e.pack(i,e.typedArray,t)}_initializeBinaryProperties(){let e=null;for(const t in this._properties){const i=this._properties[t],n=this._initializeBinaryProperty(t,i);n&&(e=e||{},e[t]=n)}return e}_initializeBinaryProperty(e,t){if("byteOffset"in t){const i=t;li(this.binary,"Property ".concat(e," requires a batch table binary.")),li(i.type,"Property ".concat(e," requires a type."));const n=function(e,t,i,n){const{componentType:s}=e;li(e.componentType);const r="string"==typeof s?Jr.fromName(s):s,o=zr[e.type],a=Kr[e.type],c=Wr[e.type];return i+=e.byteOffset,{values:Jr.createTypedArray(r,t,i,o*n),type:r,size:o,unpacker:a,packer:c}}(i,this.binary.buffer,0|this.binary.byteOffset,this.featureCount);return{typedArray:n.values,componentCount:n.size,unpack:n.unpacker,pack:n.packer}}return null}_hasPropertyInHierarchy(e,t){if(!this._hierarchy)return!1;const i=Yr(this._hierarchy,e,((e,i)=>{const n=e.classIds[i];return Zr(e.classes[n].instances[t])}));return Zr(i)}_getPropertyNamesInHierarchy(e,t){Yr(this._hierarchy,e,((e,i)=>{const n=e.classIds[i],s=e.classes[n].instances;for(const e in s)s.hasOwnProperty(e)&&-1===t.indexOf(e)&&t.push(e)}))}_getHierarchyProperty(e,t){return Yr(this._hierarchy,e,((e,i)=>{const n=e.classIds[i],s=e.classes[n],r=e.classIndexes[i],o=s.instances[t];return Zr(o)?Zr(o.typedArray)?this._getBinaryProperty(o,r):$r(o[r]):null}))}_setHierarchyProperty(e,t,i,n){const s=Yr(this._hierarchy,t,((e,s)=>{const r=e.classIds[s],o=e.classes[r],a=e.classIndexes[s],c=o.instances[i];return!!Zr(c)&&(li(s===t,'Inherited property "'.concat(i,'" is read-only.')),Zr(c.typedArray)?this._setBinaryProperty(c,a,n):c[a]=$r(n),!0)}));return Zr(s)}}const io=4;function no(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=new DataView(t);if(e.magic=n.getUint32(i,!0),i+=io,e.version=n.getUint32(i,!0),i+=io,e.byteLength=n.getUint32(i,!0),i+=io,1!==e.version)throw new Error("3D Tile Version ".concat(e.version," not supported"));return i}const so=4,ro="b3dm tile in legacy format.";function oo(e,t,i){const n=new DataView(t);let s;e.header=e.header||{};let r=n.getUint32(i,!0);i+=so;let o=n.getUint32(i,!0);i+=so;let a=n.getUint32(i,!0);i+=so;let c=n.getUint32(i,!0);return i+=so,a>=570425344?(i-=2*so,s=r,a=o,c=0,r=0,o=0,console.warn(ro)):c>=570425344&&(i-=so,s=a,a=r,c=o,r=0,o=0,console.warn(ro)),e.header.featureTableJsonByteLength=r,e.header.featureTableBinaryByteLength=o,e.header.batchTableJsonByteLength=a,e.header.batchTableBinaryByteLength=c,e.header.batchLength=s,i}function ao(e,t,i,n){return i=function(e,t,i,n){const{featureTableJsonByteLength:s,featureTableBinaryByteLength:r,batchLength:o}=e.header;if(e.featureTableJson={BATCH_LENGTH:o||0},s>0){const n=hs(t,i,s);e.featureTableJson=JSON.parse(n)}return i+=s,e.featureTableBinary=new Uint8Array(t,i,r),i+=r,i}(e,t,i),i=function(e,t,i,n){const{batchTableJsonByteLength:s,batchTableBinaryByteLength:r}=e.header;if(s>0){const n=hs(t,i,s);e.batchTableJson=JSON.parse(n),i+=s,r>0&&(e.batchTableBinary=new Uint8Array(t,i,r),e.batchTableBinary=new Uint8Array(e.batchTableBinary),i+=r)}return i}(e,t,i),i}function co(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];const i=e>>11&31,n=e>>5&63,s=31&e;return t[0]=i<<3,t[1]=n<<2,t[2]=s<<3,t}function ho(e,t,i){if(!(t||e&&e.batchIds&&i))return null;const{batchIds:n,isRGB565:s,pointCount:r}=e;if(n&&i){const e=new Uint8ClampedArray(3*r);for(let t=0;t<r;t++){const s=n[t],r=i.getProperty(s,"dimensions").map((e=>255*e));e[3*t]=r[0],e[3*t+1]=r[1],e[3*t+2]=r[2]}return{type:ar.UNSIGNED_BYTE,value:e,size:3,normalized:!0}}if(s){const e=new Uint8ClampedArray(3*r);for(let i=0;i<r;i++){const n=co(t[i]);e[3*i]=n[0],e[3*i+1]=n[1],e[3*i+2]=n[2]}return{type:ar.UNSIGNED_BYTE,value:e,size:3,normalized:!0}}return t&&t.length===3*r?{type:ar.UNSIGNED_BYTE,value:t,size:3,normalized:!0}:{type:ar.UNSIGNED_BYTE,value:t,size:4,normalized:!0}}function lo(e,t,i){var n=t[0],s=t[1];return e[0]=i[0]*n+i[3]*s+i[6],e[1]=i[1]*n+i[4]*s+i[7],e}function uo(e,t,i){var n=t[0],s=t[1];return e[0]=i[0]*n+i[4]*s+i[12],e[1]=i[1]*n+i[5]*s+i[13],e}!function(){var e,t=(e=new wr(2),wr!=Float32Array&&(e[0]=0,e[1]=0),e)}();class fo extends vr{constructor(e=0,t=0){super(2),dr(e)&&1===arguments.length?this.copy(e):(lr.debug&&(yr(e),yr(t)),this[0]=e,this[1]=t)}set(e,t){return this[0]=e,this[1]=t,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this.check()}fromObject(e){return lr.debug&&(yr(e.x),yr(e.y)),this[0]=e.x,this[1]=e.y,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e}get ELEMENTS(){return 2}horizontalAngle(){return Math.atan2(this.y,this.x)}verticalAngle(){return Math.atan2(this.x,this.y)}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return uo(this,this,e),this.check()}transformAsVector(e){return _r(this,this,e),this.check()}transformByMatrix3(e){return lo(this,this,e),this.check()}transformByMatrix2x3(e){return function(e,t,i){var n=t[0],s=t[1];e[0]=i[0]*n+i[2]*s+i[4],e[1]=i[1]*n+i[3]*s+i[5]}(this,this,e),this.check()}transformByMatrix2(e){return function(e,t,i){var n=t[0],s=t[1];e[0]=i[0]*n+i[2]*s,e[1]=i[1]*n+i[3]*s}(this,this,e),this.check()}}new fo,new Nr,new fo,new fo,new Uint8Array(1);function po(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:255;return function(e,t,i){return gr(e,(e=>Math.max(t,Math.min(i,e))))}(e,0,t)/t*2-1}function mo(e){return e<0?-1:1}function go(e,t,i,n){if(function(e,t){if(!e)throw new Error("math.gl assertion failed. ".concat(t))}(n),e<0||e>i||t<0||t>i)throw new Error("x and y must be unsigned normalized integers between 0 and ".concat(i));if(n.x=po(e,i),n.y=po(t,i),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){const e=n.x;n.x=(1-Math.abs(n.y))*mo(e),n.y=(1-Math.abs(e))*mo(n.y)}return n.normalize()}function Ao(e,t,i){return go(e,t,255,i)}const yo=new Nr;function bo(e,t,i){return e.isQuantized?i["3d-tiles"]&&i["3d-tiles"].decodeQuantizedPositions?(e.isQuantized=!1,function(e,t){const i=new Nr,n=new Float32Array(3*e.pointCount);for(let s=0;s<e.pointCount;s++)i.set(t[3*s],t[3*s+1],t[3*s+2]).scale(1/e.quantizedRange).multiply(e.quantizedVolumeScale).add(e.quantizedVolumeOffset).toArray(n,3*s);return n}(e,t)):{type:ar.UNSIGNED_SHORT,value:t,size:3,normalized:!0}:t}async function Bo(e,t,i,n,s){i=ao(e,t,i=oo(e,t,i=no(e,t,i))),function(e){e.attributes={positions:null,colors:null,normals:null,batchIds:null},e.isQuantized=!1,e.isTranslucent=!1,e.isRGB565=!1,e.isOctEncoded16P=!1}(e);const{featureTable:r,batchTable:o}=function(e){const t=new Vr(e.featureTableJson,e.featureTableBinary),i=t.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(i))throw new Error("POINTS_LENGTH must be defined");t.featuresLength=i,e.featuresLength=i,e.pointsLength=i,e.pointCount=i,e.rtcCenter=t.getGlobalProperty("RTC_CENTER",ar.FLOAT,3);const n=function(e,t){let i=null;if(!e.batchIds&&t.hasProperty("BATCH_ID")&&(e.batchIds=t.getPropertyArray("BATCH_ID",ar.UNSIGNED_SHORT,1),e.batchIds)){const n=t.getGlobalProperty("BATCH_LENGTH");if(!n)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");const{batchTableJson:s,batchTableBinary:r}=e;i=new to(s,r,n)}return i}(e,t);return{featureTable:t,batchTable:n}}(e);return await async function(e,t,i,n,s){let r,o,a;const c=e.batchTableJson&&e.batchTableJson.extensions&&e.batchTableJson.extensions["3DTILES_draco_point_compression"];c&&(a=c.properties);const h=t.getExtension("3DTILES_draco_point_compression");if(h){o=h.properties;const t=h.byteOffset,i=h.byteLength;if(!o||!Number.isFinite(t)||!i)throw new Error("Draco properties, byteOffset, and byteLength must be defined");r=e.featureTableBinary.slice(t,t+i),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(!r)return!0;const l={buffer:r,properties:{...o,...a},featureTableProperties:o,batchTableProperties:a,dequantizeInShader:!1};return await async function(e,t,i,n){const{parse:s}=n,r={...i,draco:{...i.draco,extraAttributes:t.batchTableProperties||{}}};delete r["3d-tiles"];const o=await s(t.buffer,rr,r),a=o.attributes.POSITION&&o.attributes.POSITION.value,c=o.attributes.COLOR_0&&o.attributes.COLOR_0.value,h=o.attributes.NORMAL&&o.attributes.NORMAL.value,l=o.attributes.BATCH_ID&&o.attributes.BATCH_ID.value,u=a&&o.attributes.POSITION.value.quantization,d=h&&o.attributes.NORMAL.value.quantization;if(u){const t=o.POSITION.data.quantization,i=t.range;e.quantizedVolumeScale=new Nr(i,i,i),e.quantizedVolumeOffset=new Nr(t.minValues),e.quantizedRange=(1<<t.quantizationBits)-1,e.isQuantizedDraco=!0}d&&(e.octEncodedRange=(1<<o.NORMAL.data.quantization.quantizationBits)-1,e.isOctEncodedDraco=!0);const f={};if(t.batchTableProperties)for(const e of Object.keys(t.batchTableProperties))o.attributes[e]&&o.attributes[e].value&&(f[e.toLowerCase()]=o.attributes[e].value);e.attributes={positions:a,colors:ho(e,c,void 0),normals:h,batchIds:l,...f}}(e,l,n,s)}(e,r,0,n,s),function(e,t,i){if(!e.attributes.positions)if(t.hasProperty("POSITION"))e.attributes.positions=t.getPropertyArray("POSITION",ar.FLOAT,3);else if(t.hasProperty("POSITION_QUANTIZED")){const n=t.getPropertyArray("POSITION_QUANTIZED",ar.UNSIGNED_SHORT,3);if(e.isQuantized=!0,e.quantizedRange=65535,e.quantizedVolumeScale=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",ar.FLOAT,3),!e.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(e.quantizedVolumeOffset=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",ar.FLOAT,3),!e.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");e.attributes.positions=bo(e,n,i)}if(!e.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}(e,r,n),function(e,t,i){if(!e.attributes.colors){let n=null;t.hasProperty("RGBA")?(n=t.getPropertyArray("RGBA",ar.UNSIGNED_BYTE,4),e.isTranslucent=!0):t.hasProperty("RGB")?n=t.getPropertyArray("RGB",ar.UNSIGNED_BYTE,3):t.hasProperty("RGB565")&&(n=t.getPropertyArray("RGB565",ar.UNSIGNED_SHORT,1),e.isRGB565=!0),e.attributes.colors=ho(e,n,i)}t.hasProperty("CONSTANT_RGBA")&&(e.constantRGBA=t.getGlobalProperty("CONSTANT_RGBA",ar.UNSIGNED_BYTE,4))}(e,r,o),function(e,t){if(!e.attributes.normals){let i=null;t.hasProperty("NORMAL")?i=t.getPropertyArray("NORMAL",ar.FLOAT,3):t.hasProperty("NORMAL_OCT16P")&&(i=t.getPropertyArray("NORMAL_OCT16P",ar.UNSIGNED_BYTE,2),e.isOctEncoded16P=!0),e.attributes.normals=function(e,t){if(!t)return null;if(e.isOctEncoded16P){const i=new Float32Array(3*e.pointsLength);for(let n=0;n<e.pointsLength;n++)Ao(t[2*n],t[2*n+1],yo),yo.toArray(i,3*n);return{type:ar.FLOAT,size:2,value:i}}return{type:ar.FLOAT,size:2,value:t}}(e,i)}}(e,r),i}const vo="3.4.4",Co="https://unpkg.com/@loaders.gl/textures@".concat(vo,"/dist/libs/basis_encoder.wasm"),wo="https://unpkg.com/@loaders.gl/textures@".concat(vo,"/dist/libs/basis_encoder.js");let Eo,Mo;async function To(e){const t=e.modules||{};return t.basis?t.basis:(Eo=Eo||async function(e){let t=null,i=null;return[t,i]=await Promise.all([await Zs("basis_transcoder.js","textures",e),await Zs("basis_transcoder.wasm","textures",e)]),t=t||globalThis.BASIS,await function(e,t){const i={};t&&(i.wasmBinary=t);return new Promise((t=>{e(i).then((e=>{const{BasisFile:i,initializeBasis:n}=e;n(),t({BasisFile:i})}))}))}(t,i)}(e),await Eo)}async function xo(e){const t=e.modules||{};return t.basisEncoder?t.basisEncoder:(Mo=Mo||async function(e){let t=null,i=null;return[t,i]=await Promise.all([await Zs(wo,"textures",e),await Zs(Co,"textures",e)]),t=t||globalThis.BASIS,await function(e,t){const i={};t&&(i.wasmBinary=t);return new Promise((t=>{e(i).then((e=>{const{BasisFile:i,KTX2File:n,initializeBasis:s,BasisEncoder:r}=e;s(),t({BasisFile:i,KTX2File:n,BasisEncoder:r})}))}))}(t,i)}(e),await Mo)}const Io=33776,Ro=33779,So=35840,Oo=35842,Do=36196,Fo=37808,_o=["","WEBKIT_","MOZ_"],Go={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"};let Lo=null;function Po(e){if(!Lo){e=e||function(){try{return document.createElement("canvas").getContext("webgl")}catch(e){return null}}()||void 0,Lo=new Set;for(const t of _o)for(const i in Go)if(e&&e.getExtension("".concat(t).concat(i))){const e=Go[i];Lo.add(e)}}return Lo}new Uint8Array([0]);var ko,No,Uo,Ho,jo,Jo,Vo,zo;!function(e){e[e.NONE=0]="NONE",e[e.BASISLZ=1]="BASISLZ",e[e.ZSTD=2]="ZSTD",e[e.ZLIB=3]="ZLIB"}(ko||(ko={})),function(e){e[e.BASICFORMAT=0]="BASICFORMAT"}(No||(No={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.ETC1S=163]="ETC1S",e[e.UASTC=166]="UASTC"}(Uo||(Uo={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SRGB=1]="SRGB"}(Ho||(Ho={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.LINEAR=1]="LINEAR",e[e.SRGB=2]="SRGB",e[e.ITU=3]="ITU",e[e.NTSC=4]="NTSC",e[e.SLOG=5]="SLOG",e[e.SLOG2=6]="SLOG2"}(jo||(jo={})),function(e){e[e.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",e[e.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(Jo||(Jo={})),function(e){e[e.RGB=0]="RGB",e[e.RRR=3]="RRR",e[e.GGG=4]="GGG",e[e.AAA=15]="AAA"}(Vo||(Vo={})),function(e){e[e.RGB=0]="RGB",e[e.RGBA=3]="RGBA",e[e.RRR=4]="RRR",e[e.RRRG=5]="RRRG"}(zo||(zo={}));const Ko=[171,75,84,88,32,50,48,187,13,10,26,10];const Wo={etc1:{basisFormat:0,compressed:!0,format:Do},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:Io},bc3:{basisFormat:3,compressed:!0,format:Ro},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:So},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:Oo},"astc-4x4":{basisFormat:10,compressed:!0,format:Fo},"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}};function Qo(e,t,i){const n=new e(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("Failed to start basis transcoding");const e=n.getNumImages(),t=[];for(let s=0;s<e;s++){const e=n.getNumLevels(s),r=[];for(let t=0;t<e;t++)r.push(Xo(n,s,t,i));t.push(r)}return t}finally{n.close(),n.delete()}}function Xo(e,t,i,n){const s=e.getImageWidth(t,i),r=e.getImageHeight(t,i),o=e.getHasAlpha(),{compressed:a,format:c,basisFormat:h}=Zo(n,o),l=e.getImageTranscodedSizeInBytes(t,i,h),u=new Uint8Array(l);if(!e.transcodeImage(u,t,i,h,0,0))throw new Error("failed to start Basis transcoding");return{width:s,height:r,data:u,compressed:a,format:c,hasAlpha:o}}function Yo(e,t,i){const n=new e(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("failed to start KTX2 transcoding");const e=n.getLevels(),t=[];for(let s=0;s<e;s++){t.push(qo(n,s,i));break}return[t]}finally{n.close(),n.delete()}}function qo(e,t,i){const{alphaFlag:n,height:s,width:r}=e.getImageLevelInfo(t,0,0),{compressed:o,format:a,basisFormat:c}=Zo(i,n),h=e.getImageTranscodedSizeInBytes(t,0,0,c),l=new Uint8Array(h);if(!e.transcodeImage(l,t,0,0,c,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:r,height:s,data:l,compressed:o,levelSize:h,hasAlpha:n,format:a}}function Zo(e,t){let i=e&&e.basis&&e.basis.format;return"auto"===i&&(i=$o()),"object"==typeof i&&(i=t?i.alpha:i.noAlpha),i=i.toLowerCase(),Wo[i]}function $o(){const e=Po();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"}const ea={name:"Basis",id:dn?"basis":"basis-nodejs",module:"textures",version:"3.4.4",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"}}},ta={...ea,parse:async function(e,t){if("auto"===t.basis.containerFormat){if(function(e){const 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])}(e)){return Yo((await xo(t)).KTX2File,e,t)}const{BasisFile:i}=await To(t);return Qo(i,e,t)}if("encoder"===t.basis.module){const i=await xo(t);return"ktx2"===t.basis.containerFormat?Yo(i.KTX2File,e,t):Qo(i.BasisFile,e,t)}{const{BasisFile:i}=await To(t);return Qo(i,e,t)}}},{_parseImageNode:ia}=globalThis,na="undefined"!=typeof Image,sa="undefined"!=typeof ImageBitmap,ra=Boolean(ia),oa=!!Xi||ra;function aa(e){const t=ha(e);if(!t)throw new Error("Not an image");return t}function ca(e){switch(aa(e)){case"data":return e;case"image":case"imagebitmap":const t=document.createElement("canvas"),i=t.getContext("2d");if(!i)throw new Error("getImageData");return t.width=e.width,t.height=e.height,i.drawImage(e,0,0),i.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}function ha(e){return"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&e instanceof Image?"image":e&&"object"==typeof e&&e.data&&e.width&&e.height?"data":null}const la=/^data:image\/svg\+xml/,ua=/\.svg((\?|#).*)?$/;function da(e){return e&&(la.test(e)||ua.test(e))}function fa(e,t){if(da(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function pa(e,t,i){const n=function(e,t){if(da(t)){let t=(new TextDecoder).decode(e);try{"function"==typeof unescape&&"function"==typeof encodeURIComponent&&(t=unescape(encodeURIComponent(t)))}catch(e){throw new Error(e.message)}return"data:image/svg+xml;base64,".concat(btoa(t))}return fa(e,t)}(e,i),s=self.URL||self.webkitURL,r="string"!=typeof n&&s.createObjectURL(n);try{return await async function(e,t){const i=new Image;if(i.src=e,t.image&&t.image.decode&&i.decode)return await i.decode(),i;return await new Promise(((t,n)=>{try{i.onload=()=>t(i),i.onerror=t=>n(new Error("Could not load image ".concat(e,": ").concat(t)))}catch(e){n(e)}}))}(r||n,t)}finally{r&&s.revokeObjectURL(r)}}const ma={};let ga=!0;async function Aa(e,t,i){let n;if(da(i)){n=await pa(e,t,i)}else n=fa(e,i);const s=t&&t.imagebitmap;return await async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;!function(e){for(const t in e||ma)return!1;return!0}(t)&&ga||(t=null);if(t)try{return await createImageBitmap(e,t)}catch(e){console.warn(e),ga=!1}return await createImageBitmap(e)}(n,s)}function ya(e){return function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=(s=t,[...s].map((e=>e.charCodeAt(0))));var s;for(let t=0;t<n.length;++t)if(n[t]!==e[t+i])return!1;return!0}(e,"ftyp",4)?0==(96&e[8])?null:function(e){switch((t=e,i=8,n=12,String.fromCharCode(...t.slice(i,n))).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}var t,i,n}(e):null}const ba=!1,Ba=!0;function va(e){const t=Ca(e);return function(e){const t=Ca(e),i=t.byteLength>=24&&2303741511===t.getUint32(0,ba);if(!i)return null;return{mimeType:"image/png",width:t.getUint32(16,ba),height:t.getUint32(20,ba)}}(t)||function(e){const t=Ca(e),i=t.byteLength>=3&&65496===t.getUint16(0,ba)&&255===t.getUint8(2);if(!i)return null;const{tableMarkers:n,sofMarkers:s}=function(){const e=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)e.add(t);const t=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:e,sofMarkers:t}}();let r=2;for(;r+9<t.byteLength;){const e=t.getUint16(r,ba);if(s.has(e))return{mimeType:"image/jpeg",height:t.getUint16(r+5,ba),width:t.getUint16(r+7,ba)};if(!n.has(e))return null;r+=2,r+=t.getUint16(r,ba)}return null}(t)||function(e){const t=Ca(e),i=t.byteLength>=10&&1195984440===t.getUint32(0,ba);if(!i)return null;return{mimeType:"image/gif",width:t.getUint16(6,Ba),height:t.getUint16(8,Ba)}}(t)||function(e){const t=Ca(e),i=t.byteLength>=14&&16973===t.getUint16(0,ba)&&t.getUint32(2,Ba)===t.byteLength;if(!i)return null;return{mimeType:"image/bmp",width:t.getUint32(18,Ba),height:t.getUint32(22,Ba)}}(t)||function(e){const t=new Uint8Array(e instanceof DataView?e.buffer:e),i=ya(t);if(!i)return null;return{mimeType:i.mimeType,width:0,height:0}}(t)}function Ca(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")}const wa={id:"image",module:"images",name:"Images",version:"3.4.4",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],parse:async function(e,t,i){const n=((t=t||{}).image||{}).type||"auto",{url:s}=i||{};let r;switch(function(e){switch(e){case"auto":case"data":return function(){if(sa)return"imagebitmap";if(na)return"image";if(oa)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(e){switch(e){case"auto":return sa||na||oa;case"imagebitmap":return sa;case"image":return na;case"data":return oa;default:throw new Error("@loaders.gl/images: image ".concat(e," not supported in this environment"))}}(e),e}}(n)){case"imagebitmap":r=await Aa(e,t,s);break;case"image":r=await pa(e,t,s);break;case"data":r=await async function(e,t){const{mimeType:i}=va(e)||{},n=globalThis._parseImageNode;return li(n),await n(e,i)}(e);break;default:li(!1)}return"data"===n&&(r=ca(r)),r},tests:[e=>Boolean(va(new DataView(e)))],options:{image:{type:"auto",decode:!0}}};function Ea(e,t,i){if(e.byteLength<=t+i)return"";const n=new DataView(e);let s="";for(let e=0;e<i;e++)s+=String.fromCharCode(n.getUint8(t+e));return s}function Ma(e){try{return JSON.parse(e)}catch(t){throw new Error('Failed to parse JSON from data starting with "'.concat(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if("string"==typeof e)return e.slice(0,t);if(ArrayBuffer.isView(e))return Ea(e.buffer,e.byteOffset,t);if(e instanceof ArrayBuffer)return Ea(e,0,t);return""}(e),'"'))}}function Ta(e,t){if(!e)throw new Error(t||"assert failed: gltf")}function xa(e,t){if(e.startsWith("data:")||e.startsWith("http:")||e.startsWith("https:"))return e;const i=t.baseUri||t.uri;if(!i)throw new Error("'baseUri' must be provided to resolve relative url ".concat(e));return i.substr(0,i.lastIndexOf("/")+1)+e}function Ia(e,t,i){const n=e.bufferViews[i];Ta(n);const s=t[n.buffer];Ta(s);const r=(n.byteOffset||0)+s.byteOffset;return new Uint8Array(s.arrayBuffer,r,n.byteLength)}function Ra(e,t){return li(e>=0),li(t>0),e+(t-1)&~(t-1)}function Sa(e,t,i){let n;if(e instanceof ArrayBuffer)n=new Uint8Array(e);else{const t=e.byteOffset,i=e.byteLength;n=new Uint8Array(e.buffer||e.arrayBuffer,t,i)}return t.set(n,i),i+Ra(n.byteLength,4)}const Oa=["SCALAR","VEC2","VEC3","VEC4"],Da=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],Fa=new Map(Da),_a={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ga={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},La={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Pa(e){return Oa[e-1]||Oa[0]}function ka(e){const t=Fa.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function Na(e,t){const i=La[e.componentType],n=_a[e.type],s=Ga[e.componentType],r=e.count*n,o=e.count*n*s;return Ta(o>=0&&o<=t.byteLength),{ArrayType:i,length:r,byteLength:o}}function Ua(e){let{images:t,bufferViews:i}=e;t=t||[],i=i||[];const n=t.map((e=>e.bufferView));i=i.filter((e=>!n.includes(e)));const s=i.reduce(((e,t)=>e+t.byteLength),0),r=t.reduce(((e,t)=>{const{width:i,height:n}=t.image;return e+i*n}),0);return s+Math.ceil(4*r*1.33)}const Ha={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class ja{constructor(e){Ti(this,"gltf",void 0),Ti(this,"sourceBuffers",void 0),Ti(this,"byteLength",void 0),this.gltf=e||{json:{...Ha},buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(e){return this.json[e]}getExtraData(e){return(this.json.extras||{})[e]}getExtension(e){const t=this.getUsedExtensions().find((t=>t===e)),i=this.json.extensions||{};return t?i[e]||!0:null}getRequiredExtension(e){return this.getRequiredExtensions().find((t=>t===e))?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getRemovedExtensions(){return this.json.extensionsRemoved||[]}getObjectExtension(e,t){return(e.extensions||{})[t]}getScene(e){return this.getObject("scenes",e)}getNode(e){return this.getObject("nodes",e)}getSkin(e){return this.getObject("skins",e)}getMesh(e){return this.getObject("meshes",e)}getMaterial(e){return this.getObject("materials",e)}getAccessor(e){return this.getObject("accessors",e)}getTexture(e){return this.getObject("textures",e)}getSampler(e){return this.getObject("samplers",e)}getImage(e){return this.getObject("images",e)}getBufferView(e){return this.getObject("bufferViews",e)}getBuffer(e){return this.getObject("buffers",e)}getObject(e,t){if("object"==typeof t)return t;const i=this.json[e]&&this.json[e][t];if(!i)throw new Error("glTF file error: Could not find ".concat(e,"[").concat(t,"]"));return i}getTypedArrayForBufferView(e){const t=(e=this.getBufferView(e)).buffer,i=this.gltf.buffers[t];Ta(i);const n=(e.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,n,e.byteLength)}getTypedArrayForAccessor(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),i=this.getBuffer(t.buffer).data,{ArrayType:n,length:s}=Na(e,t);return new n(i,t.byteOffset+e.byteOffset,s)}getTypedArrayForImageData(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),i=this.getBuffer(t.buffer).data,n=t.byteOffset||0;return new Uint8Array(i,n,t.byteLength)}addApplicationData(e,t){return this.json[e]=t,this}addExtraData(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}addObjectExtension(e,t,i){return e.extensions=e.extensions||{},e.extensions[t]=i,this.registerUsedExtension(t),this}setObjectExtension(e,t,i){(e.extensions||{})[t]=i}removeObjectExtension(e,t){const i=e.extensions||{},n=i[t];return delete i[t],n}addExtension(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Ta(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Ta(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find((t=>t===e))||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find((t=>t===e))||this.json.extensionsRequired.push(e)}removeExtension(e){if(!this.getExtension(e))return;this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e),this.json.extensions&&delete this.json.extensions[e],Array.isArray(this.json.extensionsRemoved)||(this.json.extensionsRemoved=[]);const t=this.json.extensionsRemoved;t.includes(e)||t.push(e)}setDefaultScene(e){this.json.scene=e}addScene(e){const{nodeIndices:t}=e;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}addNode(e){const{meshIndex:t,matrix:i}=e;this.json.nodes=this.json.nodes||[];const n={mesh:t};return i&&(n.matrix=i),this.json.nodes.push(n),this.json.nodes.length-1}addMesh(e){const{attributes:t,indices:i,material:n,mode:s=4}=e,r={primitives:[{attributes:this._addAttributes(t),mode:s}]};if(i){const e=this._addIndices(i);r.primitives[0].indices=e}return Number.isFinite(n)&&(r.primitives[0].material=n),this.json.meshes=this.json.meshes||[],this.json.meshes.push(r),this.json.meshes.length-1}addPointCloud(e){const t={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(t),this.json.meshes.length-1}addImage(e,t){const i=va(e),n=t||(null==i?void 0:i.mimeType),s={bufferView:this.addBufferView(e),mimeType:n};return this.json.images=this.json.images||[],this.json.images.push(s),this.json.images.length-1}addBufferView(e){const t=e.byteLength;Ta(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);const i={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=Ra(t,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(i),this.json.bufferViews.length-1}addAccessor(e,t){const i={bufferView:e,type:Pa(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(i),this.json.accessors.length-1}addBinaryBuffer(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{size:3};const i=this.addBufferView(e);let n={min:t.min,max:t.max};n.min&&n.max||(n=this._getAccessorMinMax(e,t.size));const s={size:t.size,componentType:ka(e),count:Math.round(e.length/t.size),min:n.min,max:n.max};return this.addAccessor(i,Object.assign(s,t))}addTexture(e){const{imageIndex:t}=e,i={source:t};return this.json.textures=this.json.textures||[],this.json.textures.push(i),this.json.textures.length-1}addMaterial(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}createBinaryChunk(){var e,t;this.gltf.buffers=[];const i=this.byteLength,n=new ArrayBuffer(i),s=new Uint8Array(n);let r=0;for(const e of this.sourceBuffers||[])r=Sa(e,s,r);null!==(e=this.json)&&void 0!==e&&null!==(t=e.buffers)&&void 0!==t&&t[0]?this.json.buffers[0].byteLength=i:this.json.buffers=[{byteLength:i}],this.gltf.binary=n,this.sourceBuffers=[n]}_removeStringFromArray(e,t){let i=!0;for(;i;){const n=e.indexOf(t);n>-1?e.splice(n,1):i=!1}}_addAttributes(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={};for(const i in e){const n=e[i],s=this._getGltfAttributeName(i),r=this.addBinaryBuffer(n.value,n);t[s]=r}return t}_addIndices(e){return this.addBinaryBuffer(e,{size:1})}_getGltfAttributeName(e){switch(e.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 e}}_getAccessorMinMax(e,t){const i={min:null,max:null};if(e.length<t)return i;i.min=[],i.max=[];const n=e.subarray(0,t);for(const e of n)i.min.push(e),i.max.push(e);for(let n=t;n<e.length;n+=t)for(let s=0;s<t;s++)i.min[0+s]=Math.min(i.min[0+s],e[n+s]),i.max[0+s]=Math.max(i.max[0+s],e[n+s]);return i}}const Ja="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",Va="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",za=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]),Ka=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]),Wa={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},Qa={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};let Xa;async function Ya(){return Xa||(Xa=async function(){let e=Ja;WebAssembly.validate(za)&&(e=Va);const t=await WebAssembly.instantiate(function(e){const t=new Uint8Array(e.length);for(let i=0;i<e.length;++i){const n=e.charCodeAt(i);t[i]=n>96?n-71:n>64?n-65:n>47?n+4:n>46?63:62}let i=0;for(let n=0;n<e.length;++n)t[i++]=t[n]<60?Ka[t[n]]:64*(t[n]-60)+t[++n];return t.buffer.slice(0,i)}(e),{});return await t.instance.exports.__wasm_call_ctors(),t.instance}()),Xa}function qa(e,t,i,n,s,r,o){const a=e.exports.sbrk,c=n+3&-4,h=a(c*s),l=a(r.length),u=new Uint8Array(e.exports.memory.buffer);u.set(r,l);const d=t(h,n,s,l,r.length);if(0===d&&o&&o(h,c,s),i.set(u.subarray(h,h+n*s)),a(h-a(0)),0!==d)throw new Error("Malformed buffer data: ".concat(d))}const Za="EXT_meshopt_compression",$a=Za;async function ec(e,t){var i;const n=new ja(e);if(null==t||null===(i=t.gltf)||void 0===i||!i.decompressMeshes)return;const s=[];for(const t of e.json.bufferViews||[])s.push(tc(n,t));await Promise.all(s),n.removeExtension(Za)}async function tc(e,t){const i=e.getObjectExtension(t,Za);if(i){const{byteOffset:n=0,byteLength:s=0,byteStride:r,count:o,mode:a,filter:c="NONE",buffer:h}=i,l=e.gltf.buffers[h],u=new Uint8Array(l.arrayBuffer,l.byteOffset+n,s),d=new Uint8Array(e.gltf.buffers[t.buffer].arrayBuffer,t.byteOffset,t.byteLength);return await async function(e,t,i,n,s){let r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"NONE";const o=await Ya();qa(o,o.exports[Qa[s]],e,t,i,n,o.exports[Wa[r||"NONE"]])}(d,o,r,u,a,c),d}return null}const ic={};function nc(e){if(void 0===ic[e]){const t=Xi?function(e){switch(e){case"image/avif":case"image/webp":return function(e){try{const t=document.createElement("canvas");return 0===t.toDataURL(e).indexOf("data:".concat(e))}catch{return!1}}(e);default:return!0}}(e):sc(e);ic[e]=t}return ic[e]}function sc(e){const t=["image/png","image/jpeg","image/gif"],{_parseImageNode:i,_imageFormatsNode:n=t}=globalThis;return Boolean(i)&&n.includes(e)}const rc="EXT_texture_webp",oc=rc;function ac(e,t){const i=new ja(e);if(!nc("image/webp")){if(i.getRequiredExtensions().includes(rc))throw new Error("gltf: Required extension ".concat(rc," not supported by browser"));return}const{json:n}=i;for(const e of n.textures||[]){const t=i.getObjectExtension(e,rc);t&&(e.source=t.source),i.removeObjectExtension(e,rc)}i.removeExtension(rc)}const cc="KHR_texture_basisu",hc=cc;function lc(e,t){const i=new ja(e),{json:n}=i;for(const e of n.textures||[]){const t=i.getObjectExtension(e,cc);t&&(e.source=t.source),i.removeObjectExtension(e,cc)}i.removeExtension(cc)}function uc(e){const{buffer:t,size:i,count:n}=function(e){let t=e,i=1,n=0;e&&e.value&&(t=e.value,i=e.size||1);t&&(ArrayBuffer.isView(t)||(t=function(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e)return null;if(Array.isArray(e))return new t(e);if(i&&!(e instanceof t))return new t(e);return e}(t,Float32Array)),n=t.length/i);return{buffer:t,size:i,count:n}}(e);return{value:t,size:i,byteOffset:0,count:n,type:Pa(i),componentType:ka(t)}}const dc="KHR_draco_mesh_compression",fc=dc;function pc(e,t,i){const n=new ja(e);for(const e of bc(n))n.getObjectExtension(e,dc)}async function mc(e,t,i){var n;if(null==t||null===(n=t.gltf)||void 0===n||!n.decompressMeshes)return;const s=new ja(e),r=[];for(const e of bc(s))s.getObjectExtension(e,dc)&&r.push(Ac(s,e,t,i));await Promise.all(r),s.removeExtension(dc)}function gc(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=new ja(e);for(const e of i.json.meshes||[])yc(e,t),i.addRequiredExtension(dc)}async function Ac(e,t,i,n){const s=e.getObjectExtension(t,dc);if(!s)return;const r=e.getTypedArrayForBufferView(s.bufferView),o=On(r.buffer,r.byteOffset),{parse:a}=n,c={...i};delete c["3d-tiles"];const h=await a(o,rr,c,n),l=function(e){const t={};for(const i in e){const n=e[i];if("indices"!==i){const e=uc(n);t[i]=e}}return t}(h.attributes);for(const[i,n]of Object.entries(l))if(i in t.attributes){const s=t.attributes[i],r=e.getAccessor(s);null!=r&&r.min&&null!=r&&r.max&&(n.min=r.min,n.max=r.max)}t.attributes=l,h.indices&&(t.indices=uc(h.indices)),function(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}(t)}function yc(e,t){var i;let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,s=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0;if(!s.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");const o=s.DracoWriter.encodeSync({attributes:e}),a=null==r||null===(i=r.parseSync)||void 0===i?void 0:i.call(r,{attributes:e}),c=s._addFauxAttributes(a.attributes),h=s.addBufferView(o);return{primitives:[{attributes:c,mode:n,extensions:{[dc]:{bufferView:h,attributes:c}}}]}}function*bc(e){for(const t of e.json.meshes||[])for(const e of t.primitives)yield e}class Bc extends Ar{toString(){let e="[";if(lr.printRowMajor){e+="row-major:";for(let t=0;t<this.RANK;++t)for(let i=0;i<this.RANK;++i)e+=" ".concat(this[i*this.RANK+t])}else{e+="column-major:";for(let t=0;t<this.ELEMENTS;++t)e+=" ".concat(this[t])}return e+="]",e}getElementIndex(e,t){return t*this.RANK+e}getElement(e,t){return this[t*this.RANK+e]}setElement(e,t,i){return this[t*this.RANK+e]=yr(i),this}getColumn(e,t=new Array(this.RANK).fill(-0)){const i=e*this.RANK;for(let e=0;e<this.RANK;++e)t[e]=this[i+e];return t}setColumn(e,t){const i=e*this.RANK;for(let e=0;e<this.RANK;++e)this[i+e]=t[e];return this}}function vc(e,t,i){var n=t[0],s=t[1],r=t[2],o=t[3],a=t[4],c=t[5],h=t[6],l=t[7],u=t[8],d=i[0],f=i[1],p=i[2],m=i[3],g=i[4],A=i[5],y=i[6],b=i[7],B=i[8];return e[0]=d*n+f*o+p*h,e[1]=d*s+f*a+p*l,e[2]=d*r+f*c+p*u,e[3]=m*n+g*o+A*h,e[4]=m*s+g*a+A*l,e[5]=m*r+g*c+A*u,e[6]=y*n+b*o+B*h,e[7]=y*s+b*a+B*l,e[8]=y*r+b*c+B*u,e}function Cc(e,t,i){var n=i[0],s=i[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=s*t[3],e[4]=s*t[4],e[5]=s*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}var wc;!function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL1ROW0=3]="COL1ROW0",e[e.COL1ROW1=4]="COL1ROW1",e[e.COL1ROW2=5]="COL1ROW2",e[e.COL2ROW0=6]="COL2ROW0",e[e.COL2ROW1=7]="COL2ROW1",e[e.COL2ROW2=8]="COL2ROW2"}(wc||(wc={}));const Ec=Object.freeze([1,0,0,0,1,0,0,0,1]);class Mc extends Bc{static get IDENTITY(){return function(){xc||(xc=new Mc,Object.freeze(xc));return xc}()}static get ZERO(){return function(){Tc||(Tc=new Mc([0,0,0,0,0,0,0,0,0]),Object.freeze(Tc));return Tc}()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return wc}constructor(e,...t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(e)?this.copy(e):t.length>0?this.copy([e,...t]):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this.check()}identity(){return this.copy(Ec)}fromObject(e){return this.check()}fromQuaternion(e){return function(e,t){var i=t[0],n=t[1],s=t[2],r=t[3],o=i+i,a=n+n,c=s+s,h=i*o,l=n*o,u=n*a,d=s*o,f=s*a,p=s*c,m=r*o,g=r*a,A=r*c;e[0]=1-u-p,e[3]=l-A,e[6]=d+g,e[1]=l+A,e[4]=1-h-p,e[7]=f-m,e[2]=d-g,e[5]=f+m,e[8]=1-h-u}(this,e),this.check()}set(e,t,i,n,s,r,o,a,c){return this[0]=e,this[1]=t,this[2]=i,this[3]=n,this[4]=s,this[5]=r,this[6]=o,this[7]=a,this[8]=c,this.check()}setRowMajor(e,t,i,n,s,r,o,a,c){return this[0]=e,this[1]=n,this[2]=o,this[3]=t,this[4]=s,this[5]=a,this[6]=i,this[7]=r,this[8]=c,this.check()}determinant(){return function(e){var t=e[0],i=e[1],n=e[2],s=e[3],r=e[4],o=e[5],a=e[6],c=e[7],h=e[8];return t*(h*r-o*c)+i*(-h*s+o*a)+n*(c*s-r*a)}(this)}transpose(){return function(e,t){if(e===t){var i=t[1],n=t[2],s=t[5];e[1]=t[3],e[2]=t[6],e[3]=i,e[5]=t[7],e[6]=n,e[7]=s}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8]}(this,this),this.check()}invert(){return function(e,t){var i=t[0],n=t[1],s=t[2],r=t[3],o=t[4],a=t[5],c=t[6],h=t[7],l=t[8],u=l*o-a*h,d=-l*r+a*c,f=h*r-o*c,p=i*u+n*d+s*f;p&&(p=1/p,e[0]=u*p,e[1]=(-l*n+s*h)*p,e[2]=(a*n-s*o)*p,e[3]=d*p,e[4]=(l*i-s*c)*p,e[5]=(-a*i+s*r)*p,e[6]=f*p,e[7]=(-h*i+n*c)*p,e[8]=(o*i-n*r)*p)}(this,this),this.check()}multiplyLeft(e){return vc(this,e,this),this.check()}multiplyRight(e){return vc(this,this,e),this.check()}rotate(e){return function(e,t,i){var n=t[0],s=t[1],r=t[2],o=t[3],a=t[4],c=t[5],h=t[6],l=t[7],u=t[8],d=Math.sin(i),f=Math.cos(i);e[0]=f*n+d*o,e[1]=f*s+d*a,e[2]=f*r+d*c,e[3]=f*o-d*n,e[4]=f*a-d*s,e[5]=f*c-d*r,e[6]=h,e[7]=l,e[8]=u}(this,this,e),this.check()}scale(e){return Array.isArray(e)?Cc(this,this,e):Cc(this,this,[e,e]),this.check()}translate(e){return function(e,t,i){var n=t[0],s=t[1],r=t[2],o=t[3],a=t[4],c=t[5],h=t[6],l=t[7],u=t[8],d=i[0],f=i[1];e[0]=n,e[1]=s,e[2]=r,e[3]=o,e[4]=a,e[5]=c,e[6]=d*n+f*o+h,e[7]=d*s+f*a+l,e[8]=d*r+f*c+u}(this,this,e),this.check()}transform(e,t){let i;switch(e.length){case 2:i=lo(t||[-0,-0],e,this);break;case 3:i=Sr(t||[-0,-0,-0],e,this);break;case 4:i=Lr(t||[-0,-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return br(i,e.length),i}transformVector(e,t){return this.transform(e,t)}transformVector2(e,t){return this.transform(e,t)}transformVector3(e,t){return this.transform(e,t)}}let Tc,xc;const Ic={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Rc={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4};const Sc="KHR_texture_transform",Oc=Sc,Dc=new Nr,Fc=new Mc,_c=new Mc;async function Gc(e,t){if(!new ja(e).getExtension(Sc))return;const i=e.json.materials||[];for(let t=0;t<i.length;t++)Lc(t,e)}function Lc(e,t){var i,n,s;const r=[],o=null===(i=t.json.materials)||void 0===i?void 0:i[e],a=null==o||null===(n=o.pbrMetallicRoughness)||void 0===n?void 0:n.baseColorTexture;a&&Pc(t,e,a,r);const c=null==o?void 0:o.emissiveTexture;c&&Pc(t,e,c,r);const h=null==o?void 0:o.normalTexture;h&&Pc(t,e,h,r);const l=null==o?void 0:o.occlusionTexture;l&&Pc(t,e,l,r);const u=null==o||null===(s=o.pbrMetallicRoughness)||void 0===s?void 0:s.metallicRoughnessTexture;u&&Pc(t,e,u,r)}function Pc(e,t,i,n){const s=function(e,t){var i;const n=null===(i=e.extensions)||void 0===i?void 0:i[Sc],{texCoord:s=0}=e,{texCoord:r=s}=n,o=-1!==t.findIndex((e=>{let[t,i]=e;return t===s&&i===r}));if(!o){const i=function(e){const{offset:t=[0,0],rotation:i=0,scale:n=[1,1]}=e,s=(new Mc).set(1,0,0,0,1,0,t[0],t[1],1),r=Fc.set(Math.cos(i),Math.sin(i),0,-Math.sin(i),Math.cos(i),0,0,0,1),o=_c.set(n[0],0,0,0,n[1],0,0,0,1);return s.multiplyRight(r).multiplyRight(o)}(n);return s!==r&&(e.texCoord=r),t.push([s,r]),{originalTexCoord:s,texCoord:r,matrix:i}}return null}(i,n);if(!s)return;const r=e.json.meshes||[];for(const i of r)for(const n of i.primitives){const i=n.material;Number.isFinite(i)&&t===i&&kc(e,n,s)}}function kc(e,t,i){const{originalTexCoord:n,texCoord:s,matrix:r}=i,o=t.attributes["TEXCOORD_".concat(n)];if(Number.isFinite(o)){var a;const i=null===(a=e.json.accessors)||void 0===a?void 0:a[o];if(i&&i.bufferView){var c;const o=null===(c=e.json.bufferViews)||void 0===c?void 0:c[i.bufferView];if(o){const{arrayBuffer:a,byteOffset:c}=e.buffers[o.buffer],h=(c||0)+(i.byteOffset||0)+(o.byteOffset||0),{ArrayType:l,length:u}=Na(i,o),d=Rc[i.componentType],f=Ic[i.type],p=o.byteStride||d*f,m=new Float32Array(u);for(let e=0;e<i.count;e++){const t=new l(a,h+e*p,2);Dc.set(t[0],t[1],1),Dc.transformByMatrix3(r),m.set([Dc[0],Dc[1]],e*f)}n===s?function(e,t,i,n){e.componentType=5126,i.push({arrayBuffer:n.buffer,byteOffset:0,byteLength:n.buffer.byteLength}),t.buffer=i.length-1,t.byteLength=n.buffer.byteLength,t.byteOffset=0,delete t.byteStride}(i,o,e.buffers,m):function(e,t,i,n,s){n.buffers.push({arrayBuffer:s.buffer,byteOffset:0,byteLength:s.buffer.byteLength});const r=n.json.bufferViews;if(!r)return;r.push({buffer:n.buffers.length-1,byteLength:s.buffer.byteLength,byteOffset:0});const o=n.json.accessors;if(!o)return;o.push({bufferView:(null==r?void 0:r.length)-1,byteOffset:0,componentType:5126,count:t.count,type:"VEC2"}),i.attributes["TEXCOORD_".concat(e)]=o.length-1}(s,i,t,e,m)}}}}const Nc="KHR_lights_punctual",Uc=Nc;async function Hc(e){const t=new ja(e),{json:i}=t,n=t.getExtension(Nc);n&&(t.json.lights=n.lights,t.removeExtension(Nc));for(const e of i.nodes||[]){const i=t.getObjectExtension(e,Nc);i&&(e.light=i.light),t.removeObjectExtension(e,Nc)}}async function jc(e){const t=new ja(e),{json:i}=t;if(i.lights){const e=t.addExtension(Nc);Ta(!e.lights),e.lights=i.lights,delete i.lights}if(t.json.lights){for(const e of t.json.lights){const i=e.node;t.addObjectExtension(i,Nc,e)}delete t.json.lights}}const Jc="KHR_materials_unlit",Vc=Jc;async function zc(e){const t=new ja(e),{json:i}=t;for(const e of i.materials||[]){e.extensions&&e.extensions.KHR_materials_unlit&&(e.unlit=!0),t.removeObjectExtension(e,Jc)}t.removeExtension(Jc)}function Kc(e){const t=new ja(e),{json:i}=t;if(t.materials)for(const e of i.materials||[])e.unlit&&(delete e.unlit,t.addObjectExtension(e,Jc,{}),t.addExtension(Jc))}const Wc="KHR_techniques_webgl",Qc=Wc;async function Xc(e){const t=new ja(e),{json:i}=t,n=t.getExtension(Wc);if(n){const e=function(e,t){const{programs:i=[],shaders:n=[],techniques:s=[]}=e,r=new TextDecoder;return n.forEach((e=>{if(!Number.isFinite(e.bufferView))throw new Error("KHR_techniques_webgl: no shader code");e.code=r.decode(t.getTypedArrayForBufferView(e.bufferView))})),i.forEach((e=>{e.fragmentShader=n[e.fragmentShader],e.vertexShader=n[e.vertexShader]})),s.forEach((e=>{e.program=i[e.program]})),s}(n,t);for(const n of i.materials||[]){const i=t.getObjectExtension(n,Wc);i&&(n.technique=Object.assign({},i,e[i.technique]),n.technique.values=qc(n.technique,t)),t.removeObjectExtension(n,Wc)}t.removeExtension(Wc)}}async function Yc(e,t){}function qc(e,t){const i=Object.assign({},e.values);return Object.keys(e.uniforms||{}).forEach((t=>{e.uniforms[t].value&&!(t in i)&&(i[t]=e.uniforms[t].value)})),Object.keys(i).forEach((e=>{"object"==typeof i[e]&&void 0!==i[e].index&&(i[e].texture=t.getTexture(i[e].index))})),i}const Zc="EXT_feature_metadata",$c=Zc;async function eh(e){!function(e){var t;const i=e.getExtension(Zc),n=null==i||null===(t=i.schema)||void 0===t?void 0:t.classes,s=null==i?void 0:i.featureTables;(null==i?void 0:i.featureTextures)&&console.warn('featureTextures is not yet supported in the "EXT_feature_metadata" extension.');if(n&&s)for(const t in n){const i=n[t],r=nh(s,t);r&&th(e,r,i)}}(new ja(e))}function th(e,t,i){for(const s in i.properties){var n;const r=i.properties[s],o=null==t||null===(n=t.properties)||void 0===n?void 0:n[s],a=t.count;if(o){const t=ih(e,r,a,o);o.data=t}}}function ih(e,t,i,n){const s=n.bufferView;let r=e.getTypedArrayForBufferView(s);switch(t.type){case"STRING":{const t=n.stringOffsetBufferView;r=function(e,t,i){const n=[],s=new TextDecoder("utf8");let r=0;const o=4;for(let a=0;a<i;a++){const i=t[(a+1)*o]-t[a*o],c=e.subarray(r,i+r),h=s.decode(c);n.push(h),r+=i}return n}(r,e.getTypedArrayForBufferView(t),i);break}}return r}function nh(e,t){for(const i in e){const n=e[i];if(n.class===t)return n}return null}const sh=[e,t,i,r,a,c,h,o,l];function rh(e,t){var i;const n=(null==t||null===(i=t.gltf)||void 0===i?void 0:i.excludeExtensions)||{};return!(e in n&&!n[e])}const oh="KHR_binary_glTF";const ah={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},ch={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"};class hh{constructor(){Ti(this,"idToIndexMap",{animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}),Ti(this,"json",void 0)}normalize(e,t){this.json=e.json;const i=e.json;switch(i.asset&&i.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn("glTF: Unknown version ".concat(i.asset.version))}if(!t.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),function(e){const t=new ja(e),{json:i}=t;for(const e of i.images||[]){const i=t.getObjectExtension(e,oh);i&&Object.assign(e,i),t.removeObjectExtension(e,oh)}i.buffers&&i.buffers[0]&&delete i.buffers[0].uri,t.removeExtension(oh)}(e),this._convertObjectIdsToArrayIndices(i),this._updateObjects(i),this._updateMaterial(i)}_addAsset(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(e){for(const t in ah)this._convertTopLevelObjectToArray(e,t)}_convertTopLevelObjectToArray(e,t){const i=e[t];if(i&&!Array.isArray(i)){e[t]=[];for(const n in i){const s=i[n];s.id=s.id||n;const r=e[t].length;e[t].push(s),this.idToIndexMap[t][n]=r}}}_convertObjectIdsToArrayIndices(e){for(const t in ah)this._convertIdsToIndices(e,t);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));for(const t of e.textures)this._convertTextureIds(t);for(const t of e.meshes)this._convertMeshIds(t);for(const t of e.nodes)this._convertNodeIds(t);for(const t of e.scenes)this._convertSceneIds(t)}_convertTextureIds(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}_convertMeshIds(e){for(const t of e.primitives){const{attributes:e,indices:i,material:n}=t;for(const t in e)e[t]=this._convertIdToIndex(e[t],"accessor");i&&(t.indices=this._convertIdToIndex(i,"accessor")),n&&(t.material=this._convertIdToIndex(n,"material"))}}_convertNodeIds(e){e.children&&(e.children=e.children.map((e=>this._convertIdToIndex(e,"node")))),e.meshes&&(e.meshes=e.meshes.map((e=>this._convertIdToIndex(e,"mesh"))))}_convertSceneIds(e){e.nodes&&(e.nodes=e.nodes.map((e=>this._convertIdToIndex(e,"node"))))}_convertIdsToIndices(e,t){e[t]||(console.warn("gltf v1: json doesn't contain attribute ".concat(t)),e[t]=[]);for(const i of e[t])for(const e in i){const t=i[e],n=this._convertIdToIndex(t,e);i[e]=n}}_convertIdToIndex(e,t){const i=ch[t];if(i in this.idToIndexMap){const n=this.idToIndexMap[i][e];if(!Number.isFinite(n))throw new Error("gltf v1: failed to resolve ".concat(t," with id ").concat(e));return n}return e}_updateObjects(e){for(const e of this.json.buffers)delete e.type}_updateMaterial(e){for(const s of e.materials){var t,i,n;s.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};const r=(null===(t=s.values)||void 0===t?void 0:t.tex)||(null===(i=s.values)||void 0===i?void 0:i.texture2d_0)||(null===(n=s.values)||void 0===n?void 0:n.diffuseTex),o=e.textures.findIndex((e=>e.id===r));-1!==o&&(s.pbrMetallicRoughness.baseColorTexture={index:o})}}}const lh={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},uh={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},dh=10240,fh=10241,ph=10242,mh=10243,gh=10497,Ah={magFilter:dh,minFilter:fh,wrapS:ph,wrapT:mh},yh={[dh]:9729,[fh]:9986,[ph]:gh,[mh]:gh};class bh{constructor(){Ti(this,"baseUri",""),Ti(this,"json",{}),Ti(this,"buffers",[]),Ti(this,"images",[])}postProcess(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{json:i,buffers:n=[],images:s=[],baseUri:r=""}=e;return Ta(i),this.baseUri=r,this.json=i,this.buffers=n,this.images=s,this._resolveTree(this.json,t),this.json}_resolveTree(e){e.bufferViews&&(e.bufferViews=e.bufferViews.map(((e,t)=>this._resolveBufferView(e,t)))),e.images&&(e.images=e.images.map(((e,t)=>this._resolveImage(e,t)))),e.samplers&&(e.samplers=e.samplers.map(((e,t)=>this._resolveSampler(e,t)))),e.textures&&(e.textures=e.textures.map(((e,t)=>this._resolveTexture(e,t)))),e.accessors&&(e.accessors=e.accessors.map(((e,t)=>this._resolveAccessor(e,t)))),e.materials&&(e.materials=e.materials.map(((e,t)=>this._resolveMaterial(e,t)))),e.meshes&&(e.meshes=e.meshes.map(((e,t)=>this._resolveMesh(e,t)))),e.nodes&&(e.nodes=e.nodes.map(((e,t)=>this._resolveNode(e,t)))),e.skins&&(e.skins=e.skins.map(((e,t)=>this._resolveSkin(e,t)))),e.scenes&&(e.scenes=e.scenes.map(((e,t)=>this._resolveScene(e,t)))),void 0!==e.scene&&(e.scene=e.scenes[this.json.scene])}getScene(e){return this._get("scenes",e)}getNode(e){return this._get("nodes",e)}getSkin(e){return this._get("skins",e)}getMesh(e){return this._get("meshes",e)}getMaterial(e){return this._get("materials",e)}getAccessor(e){return this._get("accessors",e)}getCamera(e){return null}getTexture(e){return this._get("textures",e)}getSampler(e){return this._get("samplers",e)}getImage(e){return this._get("images",e)}getBufferView(e){return this._get("bufferViews",e)}getBuffer(e){return this._get("buffers",e)}_get(e,t){if("object"==typeof t)return t;const i=this.json[e]&&this.json[e][t];return i||console.warn("glTF file error: Could not find ".concat(e,"[").concat(t,"]")),i}_resolveScene(e,t){return e.id=e.id||"scene-".concat(t),e.nodes=(e.nodes||[]).map((e=>this.getNode(e))),e}_resolveNode(e,t){return e.id=e.id||"node-".concat(t),e.children&&(e.children=e.children.map((e=>this.getNode(e)))),void 0!==e.mesh?e.mesh=this.getMesh(e.mesh):void 0!==e.meshes&&e.meshes.length&&(e.mesh=e.meshes.reduce(((e,t)=>{const i=this.getMesh(t);return e.id=i.id,e.primitives=e.primitives.concat(i.primitives),e}),{primitives:[]})),void 0!==e.camera&&(e.camera=this.getCamera(e.camera)),void 0!==e.skin&&(e.skin=this.getSkin(e.skin)),e}_resolveSkin(e,t){return e.id=e.id||"skin-".concat(t),e.inverseBindMatrices=this.getAccessor(e.inverseBindMatrices),e}_resolveMesh(e,t){return e.id=e.id||"mesh-".concat(t),e.primitives&&(e.primitives=e.primitives.map((e=>{const t=(e={...e}).attributes;e.attributes={};for(const i in t)e.attributes[i]=this.getAccessor(t[i]);return void 0!==e.indices&&(e.indices=this.getAccessor(e.indices)),void 0!==e.material&&(e.material=this.getMaterial(e.material)),e}))),e}_resolveMaterial(e,t){if(e.id=e.id||"material-".concat(t),e.normalTexture&&(e.normalTexture={...e.normalTexture},e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture={...e.occlustionTexture},e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture={...e.emmisiveTexture},e.emissiveTexture.texture=this.getTexture(e.emissiveTexture.index)),e.emissiveFactor||(e.emissiveFactor=e.emmisiveTexture?[1,1,1]:[0,0,0]),e.pbrMetallicRoughness){e.pbrMetallicRoughness={...e.pbrMetallicRoughness};const t=e.pbrMetallicRoughness;t.baseColorTexture&&(t.baseColorTexture={...t.baseColorTexture},t.baseColorTexture.texture=this.getTexture(t.baseColorTexture.index)),t.metallicRoughnessTexture&&(t.metallicRoughnessTexture={...t.metallicRoughnessTexture},t.metallicRoughnessTexture.texture=this.getTexture(t.metallicRoughnessTexture.index))}return e}_resolveAccessor(e,t){var i,n;if(e.id=e.id||"accessor-".concat(t),void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView)),e.bytesPerComponent=(i=e.componentType,uh[i]),e.components=(n=e.type,lh[n]),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){const t=e.bufferView.buffer,{ArrayType:i,byteLength:n}=Na(e,e.bufferView),s=(e.bufferView.byteOffset||0)+(e.byteOffset||0)+t.byteOffset;let r=t.arrayBuffer.slice(s,s+n);e.bufferView.byteStride&&(r=this._getValueFromInterleavedBuffer(t,s,e.bufferView.byteStride,e.bytesPerElement,e.count)),e.value=new i(r)}return e}_getValueFromInterleavedBuffer(e,t,i,n,s){const r=new Uint8Array(s*n);for(let o=0;o<s;o++){const s=t+o*i;r.set(new Uint8Array(e.arrayBuffer.slice(s,s+n)),o*n)}return r.buffer}_resolveTexture(e,t){return e.id=e.id||"texture-".concat(t),e.sampler="sampler"in e?this.getSampler(e.sampler):yh,e.source=this.getImage(e.source),e}_resolveSampler(e,t){e.id=e.id||"sampler-".concat(t),e.parameters={};for(const t in e){const i=this._enumSamplerParameter(t);void 0!==i&&(e.parameters[i]=e[t])}return e}_enumSamplerParameter(e){return Ah[e]}_resolveImage(e,t){e.id=e.id||"image-".concat(t),void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView));const i=this.images[t];return i&&(e.image=i),e}_resolveBufferView(e,t){const i=e.buffer,n={id:"bufferView-".concat(t),...e,buffer:this.buffers[i]},s=this.buffers[i].arrayBuffer;let r=this.buffers[i].byteOffset||0;return"byteOffset"in e&&(r+=e.byteOffset),n.data=new Uint8Array(s,r,e.byteLength),n}_resolveCamera(e,t){return e.id=e.id||"camera-".concat(t),e.perspective,e.orthographic,e}}const Bh=1735152710,vh=12,Ch=8,wh=1313821514,Eh=5130562,Mh=0,Th=1,xh=0,Ih=!0;function Rh(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const s=new DataView(t),r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"".concat(String.fromCharCode(e.getUint8(t+0))).concat(String.fromCharCode(e.getUint8(t+1))).concat(String.fromCharCode(e.getUint8(t+2))).concat(String.fromCharCode(e.getUint8(t+3)))}(s,i+0),o=s.getUint32(i+4,Ih),a=s.getUint32(i+8,Ih);switch(Object.assign(e,{header:{byteOffset:i,byteLength:a,hasBinChunk:!1},type:r,version:o,json:{},binChunks:[]}),i+=vh,e.version){case 1:return function(e,t,i){li(e.header.byteLength>vh+Ch);const n=t.getUint32(i+0,Ih),s=t.getUint32(i+4,Ih);return i+=Ch,li(s===xh),Sh(e,t,i,n),i+=n,i+=Oh(e,t,i,e.header.byteLength),i}(e,s,i);case 2:return function(e,t,i,n){return li(e.header.byteLength>vh+Ch),function(e,t,i,n){for(;i+8<=e.header.byteLength;){const s=t.getUint32(i+0,Ih),r=t.getUint32(i+4,Ih);switch(i+=Ch,r){case wh:Sh(e,t,i,s);break;case Eh:Oh(e,t,i,s);break;case Mh:n.strict||Sh(e,t,i,s);break;case Th:n.strict||Oh(e,t,i,s)}i+=Ra(s,4)}}(e,t,i,n),i+e.header.byteLength}(e,s,i,n={});default:throw new Error("Invalid GLB version ".concat(e.version,". Only supports v1 and v2."))}}function Sh(e,t,i,n){const s=new Uint8Array(t.buffer,i,n),r=new TextDecoder("utf8").decode(s);return e.json=JSON.parse(r),Ra(n,4)}function Oh(e,t,i,n){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:i,byteLength:n,arrayBuffer:t.buffer}),Ra(n,4)}async function Dh(e,t){var i,n,s,r;let o=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;!function(e,t,i,n){n.uri&&(e.baseUri=n.uri);if(t instanceof ArrayBuffer&&!function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=new DataView(e),{magic:s=Bh}=i,r=n.getUint32(t,!1);return r===s||r===Bh}(t,i,n)){t=(new TextDecoder).decode(t)}if("string"==typeof t)e.json=Ma(t);else if(t instanceof ArrayBuffer){const s={};i=Rh(s,t,i,n.glb),Ta("glTF"===s.type,"Invalid GLB magic string ".concat(s.type)),e._glb=s,e.json=s.json}else Ta(!1,"GLTF: must be ArrayBuffer or string");const s=e.json.buffers||[];if(e.buffers=new Array(s.length).fill(null),e._glb&&e._glb.header.hasBinChunk){const{binChunks:t}=e._glb;e.buffers[0]={arrayBuffer:t[0].arrayBuffer,byteOffset:t[0].byteOffset,byteLength:t[0].byteLength}}const r=e.json.images||[];e.images=new Array(r.length).fill({})}(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o),function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(new hh).normalize(e,t)}(e,{normalize:null==o||null===(i=o.gltf)||void 0===i?void 0:i.normalize}),function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;const n=sh.filter((e=>rh(e.name,t)));for(const r of n){var s;null===(s=r.preprocess)||void 0===s||s.call(r,e,t,i)}}(e,o,a);const c=[];if(null!=o&&null!==(n=o.gltf)&&void 0!==n&&n.loadBuffers&&e.json.buffers&&await async function(e,t,i){const n=e.json.buffers||[];for(let o=0;o<n.length;++o){const a=n[o];if(a.uri){var s,r;const{fetch:n}=i;Ta(n);const c=xa(a.uri,t),h=await(null==i||null===(s=i.fetch)||void 0===s?void 0:s.call(i,c)),l=await(null==h||null===(r=h.arrayBuffer)||void 0===r?void 0:r.call(h));e.buffers[o]={arrayBuffer:l,byteOffset:0,byteLength:l.byteLength},delete a.uri}else null===e.buffers[o]&&(e.buffers[o]={arrayBuffer:new ArrayBuffer(a.byteLength),byteOffset:0,byteLength:a.byteLength})}}(e,o,a),null!=o&&null!==(s=o.gltf)&&void 0!==s&&s.loadImages){const t=async function(e,t,i){const n=function(e){const t=new Set,i=e.json.textures||[];for(const e of i)void 0!==e.source&&t.add(e.source);return Array.from(t).sort()}(e),s=e.json.images||[],r=[];for(const o of n)r.push(Fh(e,s[o],o,t,i));return await Promise.all(r)}(e,o,a);c.push(t)}const h=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;const n=sh.filter((e=>rh(e.name,t)));for(const r of n){var s;await(null===(s=r.decode)||void 0===s?void 0:s.call(r,e,t,i))}}(e,o,a);return c.push(h),await Promise.all(c),null!=o&&null!==(r=o.gltf)&&void 0!==r&&r.postProcess?function(e,t){return(new bh).postProcess(e,t)}(e,o):e}async function Fh(e,t,i,n,s){const{fetch:r,parse:o}=s;let a;if(t.uri&&!t.hasOwnProperty("bufferView")){const e=xa(t.uri,n),i=await r(e);a=await i.arrayBuffer(),t.bufferView={data:a}}if(Number.isFinite(t.bufferView)){const i=Ia(e.json,e.buffers,t.bufferView);a=On(i.buffer,i.byteOffset,i.byteLength)}Ta(a,"glTF image has no data");let c=await o(a,[wa,ta],{mimeType:t.mimeType,basis:n.basis||{format:$o()}},s);c&&c[0]&&(c={compressed:!0,mipmaps:!1,width:c[0].width,height:c[0].height,data:c[0]}),e.images=e.images||[],e.images[i]=c}const _h={name:"glTF",id:"gltf",module:"gltf",version:"3.4.4",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;t={..._h.options,...t},t.gltf={..._h.options.gltf,...t.gltf};const{byteOffset:n=0}=t;return await Dh({},e,n,t,i)},options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0,postProcess:!0},log:console},deprecatedOptions:{fetchImages:"gltf.loadImages",createImages:"gltf.loadImages",decompress:"gltf.decompressMeshes",postProcess:"gltf.postProcess",gltf:{decompress:"gltf.decompressMeshes"}}};const Gh={URI:0,EMBEDDED:1};function Lh(e,t,i,n){e.rotateYtoZ=!0;const s=e.byteOffset+e.byteLength-i;if(0===s)throw new Error("glTF byte length must be greater than 0.");return e.gltfUpAxis=n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",e.gltfArrayBuffer=On(t,i,s),e.gltfByteOffset=0,e.gltfByteLength=s,i%4==0||console.warn("".concat(e.type,": embedded glb is not aligned to a 4-byte boundary.")),e.byteOffset+e.byteLength}async function Ph(e,t,i,n){const s=i["3d-tiles"]||{};if(function(e,t,i){switch(t){case Gh.URI:const t=new Uint8Array(e.gltfArrayBuffer,e.gltfByteOffset),i=(new TextDecoder).decode(t);e.gltfUrl=i.replace(/[\s\0]+$/,""),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength;break;case Gh.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}(e,t),s.loadGLTF){const{parse:t,fetch:s}=n;e.gltfUrl&&(e.gltfArrayBuffer=await s(e.gltfUrl,i),e.gltfByteOffset=0),e.gltfArrayBuffer&&(e.gltf=await t(e.gltfArrayBuffer,_h,i,n),e.gpuMemoryUsageInBytes=Ua(e.gltf),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength)}}async function kh(e,t,i,n,s){var r;i=function(e,t,i,n,s){i=no(e,t,i),i=oo(e,t,i),i=ao(e,t,i),i=Lh(e,t,i,n);const r=new Vr(e.featureTableJson,e.featureTableBinary);return e.rtcCenter=r.getGlobalProperty("RTC_CENTER",ar.FLOAT,3),i}(e,t,i,n),await Ph(e,Gh.EMBEDDED,n,s);const o=null==e||null===(r=e.gltf)||void 0===r?void 0:r.extensions;return o&&o.CESIUM_RTC&&(e.rtcCenter=o.CESIUM_RTC.center),i}let Nh;class Uh extends vr{static get ZERO(){return Nh||(Nh=new Uh(0,0,0,0),Object.freeze(Nh)),Nh}constructor(e=0,t=0,i=0,n=0){super(-0,-0,-0,-0),dr(e)&&1===arguments.length?this.copy(e):(lr.debug&&(yr(e),yr(t),yr(i),yr(n)),this[0]=e,this[1]=t,this[2]=i,this[3]=n)}set(e,t,i,n){return this[0]=e,this[1]=t,this[2]=i,this[3]=n,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}fromObject(e){return lr.debug&&(yr(e.x),yr(e.y),yr(e.z),yr(e.w)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e.w=this[3],e}get ELEMENTS(){return 4}get z(){return this[2]}set z(e){this[2]=yr(e)}get w(){return this[3]}set w(e){this[3]=yr(e)}transform(e){return Rr(this,this,e),this.check()}transformByMatrix3(e){return Lr(this,this,e),this.check()}transformByMatrix2(e){return function(e,t,i){const n=t[0],s=t[1];e[0]=i[0]*n+i[2]*s,e[1]=i[1]*n+i[3]*s,e[2]=t[2],e[3]=t[3]}(this,this,e),this.check()}transformByQuaternion(e){return Or(this,this,e),this.check()}applyMatrix4(e){return e.transform(this,this),this}}function Hh(e){var t=e[0],i=e[1],n=e[2],s=e[3];return Math.hypot(t,i,n,s)}function jh(e){var t=e[0],i=e[1],n=e[2],s=e[3];return t*t+i*i+n*n+s*s}!function(){var e,t=(e=new wr(4),wr!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e)}();function Jh(){var e=new wr(4);return wr!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function Vh(e,t,i){i*=.5;var n=Math.sin(i);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(i),e}function zh(e,t,i){var n=t[0],s=t[1],r=t[2],o=t[3],a=i[0],c=i[1],h=i[2],l=i[3];return e[0]=n*l+o*a+s*h-r*c,e[1]=s*l+o*c+r*a-n*h,e[2]=r*l+o*h+n*c-s*a,e[3]=o*l-n*a-s*c-r*h,e}function Kh(e,t,i,n){var s,r,o,a,c,h=t[0],l=t[1],u=t[2],d=t[3],f=i[0],p=i[1],m=i[2],g=i[3];return(r=h*f+l*p+u*m+d*g)<0&&(r=-r,f=-f,p=-p,m=-m,g=-g),1-r>Cr?(s=Math.acos(r),o=Math.sin(s),a=Math.sin((1-n)*s)/o,c=Math.sin(n*s)/o):(a=1-n,c=n),e[0]=a*h+c*f,e[1]=a*l+c*p,e[2]=a*u+c*m,e[3]=a*d+c*g,e}function Wh(e,t){var i,n=t[0]+t[4]+t[8];if(n>0)i=Math.sqrt(n+1),e[3]=.5*i,i=.5/i,e[0]=(t[5]-t[7])*i,e[1]=(t[6]-t[2])*i,e[2]=(t[1]-t[3])*i;else{var s=0;t[4]>t[0]&&(s=1),t[8]>t[3*s+s]&&(s=2);var r=(s+1)%3,o=(s+2)%3;i=Math.sqrt(t[3*s+s]-t[3*r+r]-t[3*o+o]+1),e[s]=.5*i,i=.5/i,e[3]=(t[3*r+o]-t[3*o+r])*i,e[r]=(t[3*r+s]+t[3*s+r])*i,e[o]=(t[3*o+s]+t[3*s+o])*i}return e}var Qh,Xh,Yh,qh,Zh,$h,el,tl=function(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e[3]=t[3]+i[3],e},il=function(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e},nl=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},sl=function(e,t,i,n){var s=t[0],r=t[1],o=t[2],a=t[3];return e[0]=s+n*(i[0]-s),e[1]=r+n*(i[1]-r),e[2]=o+n*(i[2]-o),e[3]=a+n*(i[3]-a),e},rl=Hh,ol=jh,al=function(e,t){var i=t[0],n=t[1],s=t[2],r=t[3],o=i*i+n*n+s*s+r*r;return o>0&&(o=1/Math.sqrt(o)),e[0]=i*o,e[1]=n*o,e[2]=s*o,e[3]=r*o,e},cl=(Qh=Er(),Xh=Tr(1,0,0),Yh=Tr(0,1,0),function(e,t,i){var n=xr(t,i);return n<-.999999?(Ir(Qh,Xh,t),Fr(Qh)<1e-6&&Ir(Qh,Yh,t),function(e,t){var i=t[0],n=t[1],s=t[2],r=i*i+n*n+s*s;r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r}(Qh,Qh),Vh(e,Qh,Math.PI),e):n>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(Ir(Qh,t,i),e[0]=Qh[0],e[1]=Qh[1],e[2]=Qh[2],e[3]=1+n,al(e,e))});qh=Jh(),Zh=Jh(),$h=new wr(9),wr!=Float32Array&&($h[1]=0,$h[2]=0,$h[3]=0,$h[5]=0,$h[6]=0,$h[7]=0),$h[0]=1,$h[4]=1,$h[8]=1,el=$h;const hl=[0,0,0,1];class ll extends Ar{constructor(e=0,t=0,i=0,n=1){super(-0,-0,-0,-0),Array.isArray(e)&&1===arguments.length?this.copy(e):this.set(e,t,i,n)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}set(e,t,i,n){return this[0]=e,this[1]=t,this[2]=i,this[3]=n,this.check()}fromObject(e){return this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this.check()}fromMatrix3(e){return Wh(this,e),this.check()}fromAxisRotation(e,t){return Vh(this,e,t),this.check()}identity(){return function(e){e[0]=0,e[1]=0,e[2]=0,e[3]=1}(this),this.check()}setAxisAngle(e,t){return this.fromAxisRotation(e,t)}get ELEMENTS(){return 4}get x(){return this[0]}set x(e){this[0]=yr(e)}get y(){return this[1]}set y(e){this[1]=yr(e)}get z(){return this[2]}set z(e){this[2]=yr(e)}get w(){return this[3]}set w(e){this[3]=yr(e)}len(){return rl(this)}lengthSquared(){return ol(this)}dot(e){return nl(this,e)}rotationTo(e,t){return cl(this,e,t),this.check()}add(e){return tl(this,this,e),this.check()}calculateW(){return function(e,t){var i=t[0],n=t[1],s=t[2];e[0]=i,e[1]=n,e[2]=s,e[3]=Math.sqrt(Math.abs(1-i*i-n*n-s*s))}(this,this),this.check()}conjugate(){return function(e,t){e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3]}(this,this),this.check()}invert(){return function(e,t){var i=t[0],n=t[1],s=t[2],r=t[3],o=i*i+n*n+s*s+r*r,a=o?1/o:0;e[0]=-i*a,e[1]=-n*a,e[2]=-s*a,e[3]=r*a}(this,this),this.check()}lerp(e,t,i){return void 0===i?this.lerp(this,e,t):(sl(this,e,t,i),this.check())}multiplyRight(e){return zh(this,this,e),this.check()}multiplyLeft(e){return zh(this,e,this),this.check()}normalize(){const e=this.len(),t=e>0?1/e:0;return this[0]=this[0]*t,this[1]=this[1]*t,this[2]=this[2]*t,this[3]=this[3]*t,0===e&&(this[3]=1),this.check()}rotateX(e){return function(e,t,i){i*=.5;var n=t[0],s=t[1],r=t[2],o=t[3],a=Math.sin(i),c=Math.cos(i);e[0]=n*c+o*a,e[1]=s*c+r*a,e[2]=r*c-s*a,e[3]=o*c-n*a}(this,this,e),this.check()}rotateY(e){return function(e,t,i){i*=.5;var n=t[0],s=t[1],r=t[2],o=t[3],a=Math.sin(i),c=Math.cos(i);e[0]=n*c-r*a,e[1]=s*c+o*a,e[2]=r*c+n*a,e[3]=o*c-s*a}(this,this,e),this.check()}rotateZ(e){return function(e,t,i){i*=.5;var n=t[0],s=t[1],r=t[2],o=t[3],a=Math.sin(i),c=Math.cos(i);e[0]=n*c+s*a,e[1]=s*c-n*a,e[2]=r*c+o*a,e[3]=o*c-r*a}(this,this,e),this.check()}scale(e){return il(this,this,e),this.check()}slerp(e,t,i){let n,s,r;switch(arguments.length){case 1:({start:n=hl,target:s,ratio:r}=e);break;case 2:n=this,s=e,r=t;break;default:n=e,s=t,r=i}return Kh(this,n,s,r),this.check()}transformVector4(e,t=new Uh){return function(e,t,i){var n=t[0],s=t[1],r=t[2],o=i[0],a=i[1],c=i[2],h=i[3],l=h*n+a*r-c*s,u=h*s+c*n-o*r,d=h*r+o*s-a*n,f=-o*n-a*s-c*r;e[0]=l*h+f*-o+u*-c-d*-a,e[1]=u*h+f*-a+d*-o-l*-c,e[2]=d*h+f*-c+l*-a-u*-o,e[3]=t[3]}(t,e,this),br(t,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(e,t){return this.setAxisAngle(e,t)}premultiply(e){return this.multiplyLeft(e)}multiply(e){return this.multiplyRight(e)}}function ul(e,t,i){var n=t[0],s=t[1],r=t[2],o=t[3],a=t[4],c=t[5],h=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12],g=t[13],A=t[14],y=t[15],b=i[0],B=i[1],v=i[2],C=i[3];return e[0]=b*n+B*a+v*u+C*m,e[1]=b*s+B*c+v*d+C*g,e[2]=b*r+B*h+v*f+C*A,e[3]=b*o+B*l+v*p+C*y,b=i[4],B=i[5],v=i[6],C=i[7],e[4]=b*n+B*a+v*u+C*m,e[5]=b*s+B*c+v*d+C*g,e[6]=b*r+B*h+v*f+C*A,e[7]=b*o+B*l+v*p+C*y,b=i[8],B=i[9],v=i[10],C=i[11],e[8]=b*n+B*a+v*u+C*m,e[9]=b*s+B*c+v*d+C*g,e[10]=b*r+B*h+v*f+C*A,e[11]=b*o+B*l+v*p+C*y,b=i[12],B=i[13],v=i[14],C=i[15],e[12]=b*n+B*a+v*u+C*m,e[13]=b*s+B*c+v*d+C*g,e[14]=b*r+B*h+v*f+C*A,e[15]=b*o+B*l+v*p+C*y,e}function dl(e,t){var i=t[0],n=t[1],s=t[2],r=t[4],o=t[5],a=t[6],c=t[8],h=t[9],l=t[10];return e[0]=Math.hypot(i,n,s),e[1]=Math.hypot(r,o,a),e[2]=Math.hypot(c,h,l),e}var fl=function(e,t,i,n,s){var r,o=1/Math.tan(t/2);return e[0]=o/i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=s&&s!==1/0?(r=1/(n-s),e[10]=(s+n)*r,e[14]=2*s*n*r):(e[10]=-1,e[14]=-2*n),e};var pl=function(e,t,i,n,s,r,o){var a=1/(t-i),c=1/(n-s),h=1/(r-o);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*h,e[11]=0,e[12]=(t+i)*a,e[13]=(s+n)*c,e[14]=(o+r)*h,e[15]=1,e};var ml;!function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL0ROW3=3]="COL0ROW3",e[e.COL1ROW0=4]="COL1ROW0",e[e.COL1ROW1=5]="COL1ROW1",e[e.COL1ROW2=6]="COL1ROW2",e[e.COL1ROW3=7]="COL1ROW3",e[e.COL2ROW0=8]="COL2ROW0",e[e.COL2ROW1=9]="COL2ROW1",e[e.COL2ROW2=10]="COL2ROW2",e[e.COL2ROW3=11]="COL2ROW3",e[e.COL3ROW0=12]="COL3ROW0",e[e.COL3ROW1=13]="COL3ROW1",e[e.COL3ROW2=14]="COL3ROW2",e[e.COL3ROW3=15]="COL3ROW3"}(ml||(ml={}));const gl=45*Math.PI/180,Al=1,yl=.1,bl=500,Bl=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);class vl extends Bc{static get IDENTITY(){return function(){wl||(wl=new vl,Object.freeze(wl));return wl}()}static get ZERO(){return function(){Cl||(Cl=new vl([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(Cl));return Cl}()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return ml}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this[9]=e[9],this[10]=e[10],this[11]=e[11],this[12]=e[12],this[13]=e[13],this[14]=e[14],this[15]=e[15],this.check()}set(e,t,i,n,s,r,o,a,c,h,l,u,d,f,p,m){return this[0]=e,this[1]=t,this[2]=i,this[3]=n,this[4]=s,this[5]=r,this[6]=o,this[7]=a,this[8]=c,this[9]=h,this[10]=l,this[11]=u,this[12]=d,this[13]=f,this[14]=p,this[15]=m,this.check()}setRowMajor(e,t,i,n,s,r,o,a,c,h,l,u,d,f,p,m){return this[0]=e,this[1]=s,this[2]=c,this[3]=d,this[4]=t,this[5]=r,this[6]=h,this[7]=f,this[8]=i,this[9]=o,this[10]=l,this[11]=p,this[12]=n,this[13]=a,this[14]=u,this[15]=m,this.check()}toRowMajor(e){return e[0]=this[0],e[1]=this[4],e[2]=this[8],e[3]=this[12],e[4]=this[1],e[5]=this[5],e[6]=this[9],e[7]=this[13],e[8]=this[2],e[9]=this[6],e[10]=this[10],e[11]=this[14],e[12]=this[3],e[13]=this[7],e[14]=this[11],e[15]=this[15],e}identity(){return this.copy(Bl)}fromObject(e){return this.check()}fromQuaternion(e){return function(e,t){var i=t[0],n=t[1],s=t[2],r=t[3],o=i+i,a=n+n,c=s+s,h=i*o,l=n*o,u=n*a,d=s*o,f=s*a,p=s*c,m=r*o,g=r*a,A=r*c;e[0]=1-u-p,e[1]=l+A,e[2]=d-g,e[3]=0,e[4]=l-A,e[5]=1-h-p,e[6]=f+m,e[7]=0,e[8]=d+g,e[9]=f-m,e[10]=1-h-u,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1}(this,e),this.check()}frustum(e){const{left:t,right:i,bottom:n,top:s,near:r=yl,far:o=bl}=e;return o===1/0?function(e,t,i,n,s,r){const o=2*r/(i-t),a=2*r/(s-n),c=(i+t)/(i-t),h=(s+n)/(s-n),l=-1,u=-1,d=-2*r;e[0]=o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=c,e[9]=h,e[10]=l,e[11]=u,e[12]=0,e[13]=0,e[14]=d,e[15]=0}(this,t,i,n,s,r):function(e,t,i,n,s,r,o){var a=1/(i-t),c=1/(s-n),h=1/(r-o);e[0]=2*r*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*r*c,e[6]=0,e[7]=0,e[8]=(i+t)*a,e[9]=(s+n)*c,e[10]=(o+r)*h,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*r*2*h,e[15]=0}(this,t,i,n,s,r,o),this.check()}lookAt(e){const{eye:t,center:i=[0,0,0],up:n=[0,1,0]}=e;return function(e,t,i,n){var s,r,o,a,c,h,l,u,d,f,p=t[0],m=t[1],g=t[2],A=n[0],y=n[1],b=n[2],B=i[0],v=i[1],C=i[2];Math.abs(p-B)<Cr&&Math.abs(m-v)<Cr&&Math.abs(g-C)<Cr?function(e){e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1}(e):(l=p-B,u=m-v,d=g-C,s=y*(d*=f=1/Math.hypot(l,u,d))-b*(u*=f),r=b*(l*=f)-A*d,o=A*u-y*l,(f=Math.hypot(s,r,o))?(s*=f=1/f,r*=f,o*=f):(s=0,r=0,o=0),a=u*o-d*r,c=d*s-l*o,h=l*r-u*s,(f=Math.hypot(a,c,h))?(a*=f=1/f,c*=f,h*=f):(a=0,c=0,h=0),e[0]=s,e[1]=a,e[2]=l,e[3]=0,e[4]=r,e[5]=c,e[6]=u,e[7]=0,e[8]=o,e[9]=h,e[10]=d,e[11]=0,e[12]=-(s*p+r*m+o*g),e[13]=-(a*p+c*m+h*g),e[14]=-(l*p+u*m+d*g),e[15]=1)}(this,t,i,n),this.check()}ortho(e){const{left:t,right:i,bottom:n,top:s,near:r=yl,far:o=bl}=e;return pl(this,t,i,n,s,r,o),this.check()}orthographic(e){const{fovy:t=gl,aspect:i=Al,focalDistance:n=1,near:s=yl,far:r=bl}=e;El(t);const o=t/2,a=n*Math.tan(o),c=a*i;return this.ortho({left:-c,right:c,bottom:-a,top:a,near:s,far:r})}perspective(e){const{fovy:t=45*Math.PI/180,aspect:i=1,near:n=.1,far:s=500}=e;return El(t),fl(this,t,i,n,s),this.check()}determinant(){return function(e){var t=e[0],i=e[1],n=e[2],s=e[3],r=e[4],o=e[5],a=e[6],c=e[7],h=e[8],l=e[9],u=e[10],d=e[11],f=e[12],p=e[13],m=e[14],g=e[15];return(t*o-i*r)*(u*g-d*m)-(t*a-n*r)*(l*g-d*p)+(t*c-s*r)*(l*m-u*p)+(i*a-n*o)*(h*g-d*f)-(i*c-s*o)*(h*m-u*f)+(n*c-s*a)*(h*p-l*f)}(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e,t){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=t||[-0,-0,-0];const i=this.getScale(t),n=1/i[0],s=1/i[1],r=1/i[2];return e[0]=this[0]*n,e[1]=this[1]*s,e[2]=this[2]*r,e[3]=0,e[4]=this[4]*n,e[5]=this[5]*s,e[6]=this[6]*r,e[7]=0,e[8]=this[8]*n,e[9]=this[9]*s,e[10]=this[10]*r,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e,t){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=t||[-0,-0,-0];const i=this.getScale(t),n=1/i[0],s=1/i[1],r=1/i[2];return e[0]=this[0]*n,e[1]=this[1]*s,e[2]=this[2]*r,e[3]=this[4]*n,e[4]=this[5]*s,e[5]=this[6]*r,e[6]=this[8]*n,e[7]=this[9]*s,e[8]=this[10]*r,e}transpose(){return function(e,t){if(e===t){var i=t[1],n=t[2],s=t[3],r=t[6],o=t[7],a=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=i,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=r,e[11]=t[14],e[12]=s,e[13]=o,e[14]=a}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15]}(this,this),this.check()}invert(){return function(e,t){var i=t[0],n=t[1],s=t[2],r=t[3],o=t[4],a=t[5],c=t[6],h=t[7],l=t[8],u=t[9],d=t[10],f=t[11],p=t[12],m=t[13],g=t[14],A=t[15],y=i*a-n*o,b=i*c-s*o,B=i*h-r*o,v=n*c-s*a,C=n*h-r*a,w=s*h-r*c,E=l*m-u*p,M=l*g-d*p,T=l*A-f*p,x=u*g-d*m,I=u*A-f*m,R=d*A-f*g,S=y*R-b*I+B*x+v*T-C*M+w*E;S&&(S=1/S,e[0]=(a*R-c*I+h*x)*S,e[1]=(s*I-n*R-r*x)*S,e[2]=(m*w-g*C+A*v)*S,e[3]=(d*C-u*w-f*v)*S,e[4]=(c*T-o*R-h*M)*S,e[5]=(i*R-s*T+r*M)*S,e[6]=(g*B-p*w-A*b)*S,e[7]=(l*w-d*B+f*b)*S,e[8]=(o*I-a*T+h*E)*S,e[9]=(n*T-i*I-r*E)*S,e[10]=(p*C-m*B+A*y)*S,e[11]=(u*B-l*C-f*y)*S,e[12]=(a*M-o*x-c*E)*S,e[13]=(i*x-n*M+s*E)*S,e[14]=(m*b-p*v-g*y)*S,e[15]=(l*v-u*b+d*y)*S)}(this,this),this.check()}multiplyLeft(e){return ul(this,e,this),this.check()}multiplyRight(e){return ul(this,this,e),this.check()}rotateX(e){return function(e,t,i){var n=Math.sin(i),s=Math.cos(i),r=t[4],o=t[5],a=t[6],c=t[7],h=t[8],l=t[9],u=t[10],d=t[11];t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=r*s+h*n,e[5]=o*s+l*n,e[6]=a*s+u*n,e[7]=c*s+d*n,e[8]=h*s-r*n,e[9]=l*s-o*n,e[10]=u*s-a*n,e[11]=d*s-c*n}(this,this,e),this.check()}rotateY(e){return function(e,t,i){var n=Math.sin(i),s=Math.cos(i),r=t[0],o=t[1],a=t[2],c=t[3],h=t[8],l=t[9],u=t[10],d=t[11];t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=r*s-h*n,e[1]=o*s-l*n,e[2]=a*s-u*n,e[3]=c*s-d*n,e[8]=r*n+h*s,e[9]=o*n+l*s,e[10]=a*n+u*s,e[11]=c*n+d*s}(this,this,e),this.check()}rotateZ(e){return function(e,t,i){var n=Math.sin(i),s=Math.cos(i),r=t[0],o=t[1],a=t[2],c=t[3],h=t[4],l=t[5],u=t[6],d=t[7];t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=r*s+h*n,e[1]=o*s+l*n,e[2]=a*s+u*n,e[3]=c*s+d*n,e[4]=h*s-r*n,e[5]=l*s-o*n,e[6]=u*s-a*n,e[7]=d*s-c*n}(this,this,e),this.check()}rotateXYZ(e){return this.rotateX(e[0]).rotateY(e[1]).rotateZ(e[2])}rotateAxis(e,t){return function(e,t,i,n){var s,r,o,a,c,h,l,u,d,f,p,m,g,A,y,b,B,v,C,w,E,M,T,x,I=n[0],R=n[1],S=n[2],O=Math.hypot(I,R,S);O<Cr||(I*=O=1/O,R*=O,S*=O,s=Math.sin(i),o=1-(r=Math.cos(i)),a=t[0],c=t[1],h=t[2],l=t[3],u=t[4],d=t[5],f=t[6],p=t[7],m=t[8],g=t[9],A=t[10],y=t[11],b=I*I*o+r,B=R*I*o+S*s,v=S*I*o-R*s,C=I*R*o-S*s,w=R*R*o+r,E=S*R*o+I*s,M=I*S*o+R*s,T=R*S*o-I*s,x=S*S*o+r,e[0]=a*b+u*B+m*v,e[1]=c*b+d*B+g*v,e[2]=h*b+f*B+A*v,e[3]=l*b+p*B+y*v,e[4]=a*C+u*w+m*E,e[5]=c*C+d*w+g*E,e[6]=h*C+f*w+A*E,e[7]=l*C+p*w+y*E,e[8]=a*M+u*T+m*x,e[9]=c*M+d*T+g*x,e[10]=h*M+f*T+A*x,e[11]=l*M+p*T+y*x,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]))}(this,this,e,t),this.check()}scale(e){return function(e,t,i){var n=i[0],s=i[1],r=i[2];e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*s,e[5]=t[5]*s,e[6]=t[6]*s,e[7]=t[7]*s,e[8]=t[8]*r,e[9]=t[9]*r,e[10]=t[10]*r,e[11]=t[11]*r,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]}(this,this,Array.isArray(e)?e:[e,e,e]),this.check()}translate(e){return function(e,t,i){var n,s,r,o,a,c,h,l,u,d,f,p,m=i[0],g=i[1],A=i[2];t===e?(e[12]=t[0]*m+t[4]*g+t[8]*A+t[12],e[13]=t[1]*m+t[5]*g+t[9]*A+t[13],e[14]=t[2]*m+t[6]*g+t[10]*A+t[14],e[15]=t[3]*m+t[7]*g+t[11]*A+t[15]):(n=t[0],s=t[1],r=t[2],o=t[3],a=t[4],c=t[5],h=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],e[0]=n,e[1]=s,e[2]=r,e[3]=o,e[4]=a,e[5]=c,e[6]=h,e[7]=l,e[8]=u,e[9]=d,e[10]=f,e[11]=p,e[12]=n*m+a*g+u*A+t[12],e[13]=s*m+c*g+d*A+t[13],e[14]=r*m+h*g+f*A+t[14],e[15]=o*m+l*g+p*A+t[15])}(this,this,e),this.check()}transform(e,t){return 4===e.length?(t=function(e,t,i){var n=t[0],s=t[1],r=t[2],o=t[3];return e[0]=i[0]*n+i[4]*s+i[8]*r+i[12]*o,e[1]=i[1]*n+i[5]*s+i[9]*r+i[13]*o,e[2]=i[2]*n+i[6]*s+i[10]*r+i[14]*o,e[3]=i[3]*n+i[7]*s+i[11]*r+i[15]*o,e}(t||[-0,-0,-0,-0],e,this),br(t,4),t):this.transformAsPoint(e,t)}transformAsPoint(e,t){const{length:i}=e;let n;switch(i){case 2:n=uo(t||[-0,-0],e,this);break;case 3:n=Rr(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return br(n,e.length),n}transformAsVector(e,t){let i;switch(e.length){case 2:i=_r(t||[-0,-0],e,this);break;case 3:i=Gr(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return br(i,e.length),i}transformPoint(e,t){return this.transformAsPoint(e,t)}transformVector(e,t){return this.transformAsPoint(e,t)}transformDirection(e,t){return this.transformAsVector(e,t)}makeRotationX(e){return this.identity().rotateX(e)}makeTranslation(e,t,i){return this.identity().translate([e,t,i])}}let Cl,wl;function El(e){if(e>2*Math.PI)throw Error("expected radians")}const Ml={EPSILON1:.1,EPSILON2:.01,EPSILON3:.001,EPSILON4:1e-4,EPSILON5:1e-5,EPSILON6:1e-6,EPSILON7:1e-7,EPSILON8:1e-8,EPSILON9:1e-9,EPSILON10:1e-10,EPSILON11:1e-11,EPSILON12:1e-12,EPSILON13:1e-13,EPSILON14:1e-14,EPSILON15:1e-15,EPSILON16:1e-16,EPSILON17:1e-17,EPSILON18:1e-18,EPSILON19:1e-19,EPSILON20:1e-20,PI_OVER_TWO:Math.PI/2,PI_OVER_FOUR:Math.PI/4,PI_OVER_SIX:Math.PI/6,TWO_PI:2*Math.PI},Tl=6378137,xl=6378137,Il=6356752.314245179;Math.max(Tl,xl,Il);function Rl(e){return e}new Nr;function Sl(e,t=[],i=Rl){return"longitude"in e?(t[0]=i(e.longitude),t[1]=i(e.latitude),t[2]=e.height):"x"in e?(t[0]=i(e.x),t[1]=i(e.y),t[2]=e.z):(t[0]=i(e[0]),t[1]=i(e[1]),t[2]=e[2]),t}function Ol(e,t,i=Rl){return"longitude"in t?(t.longitude=i(e[0]),t.latitude=i(e[1]),t.height=e[2]):"x"in t?(t.x=i(e[0]),t.y=i(e[1]),t.z=e[2]):(t[0]=i(e[0]),t[1]=i(e[1]),t[2]=e[2]),t}const Dl=new Nr,Fl=new Nr,_l=new Nr;const Gl=new Nr,Ll={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},Pl={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},kl={east:new Nr,north:new Nr,up:new Nr,west:new Nr,south:new Nr,down:new Nr},Nl=new Nr,Ul=new Nr,Hl=new Nr;function jl(e,t,i,n,s,r){const o=Ll[t]&&Ll[t][i];let a,c,h;Br(o&&(!n||n===o));const l=Gl.copy(s);if(mr(l.x,0,1e-14)&&mr(l.y,0,1e-14)){const e=Math.sign(l.z);a=Nl.fromArray(Pl[t]),"east"!==t&&"west"!==t&&a.scale(e),c=Ul.fromArray(Pl[i]),"east"!==i&&"west"!==i&&c.scale(e),h=Hl.fromArray(Pl[n]),"east"!==n&&"west"!==n&&h.scale(e)}else{const{up:s,east:r,north:o}=kl;r.set(-l.y,l.x,0).normalize(),e.geodeticSurfaceNormal(l,s),o.copy(s).cross(r);const{down:u,west:d,south:f}=kl;u.copy(s).scale(-1),d.copy(r).scale(-1),f.copy(o).scale(-1),a=kl[t],c=kl[i],h=kl[n]}return r[0]=a.x,r[1]=a.y,r[2]=a.z,r[3]=0,r[4]=c.x,r[5]=c.y,r[6]=c.z,r[7]=0,r[8]=h.x,r[9]=h.y,r[10]=h.z,r[11]=0,r[12]=l.x,r[13]=l.y,r[14]=l.z,r[15]=1,r}const Jl=new Nr,Vl=new Nr,zl=new Nr,Kl=new Nr,Wl=new Nr,Ql=new Nr;class Xl{constructor(e=0,t=0,i=0){Ti(this,"radii",void 0),Ti(this,"radiiSquared",void 0),Ti(this,"radiiToTheFourth",void 0),Ti(this,"oneOverRadii",void 0),Ti(this,"oneOverRadiiSquared",void 0),Ti(this,"minimumRadius",void 0),Ti(this,"maximumRadius",void 0),Ti(this,"centerToleranceSquared",Ml.EPSILON1),Ti(this,"squaredXOverSquaredZ",void 0),Br(e>=0),Br(t>=0),Br(i>=0),this.radii=new Nr(e,t,i),this.radiiSquared=new Nr(e*e,t*t,i*i),this.radiiToTheFourth=new Nr(e*e*e*e,t*t*t*t,i*i*i*i),this.oneOverRadii=new Nr(0===e?0:1/e,0===t?0:1/t,0===i?0:1/i),this.oneOverRadiiSquared=new Nr(0===e?0:1/(e*e),0===t?0:1/(t*t),0===i?0:1/(i*i)),this.minimumRadius=Math.min(e,t,i),this.maximumRadius=Math.max(e,t,i),0!==this.radiiSquared.z&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(e){return this===e||Boolean(e&&this.radii.equals(e.radii))}toString(){return this.radii.toString()}cartographicToCartesian(e,t=[0,0,0]){const i=Vl,n=zl,[,,s]=e;this.geodeticSurfaceNormalCartographic(e,i),n.copy(this.radiiSquared).scale(i);const r=Math.sqrt(i.dot(n));return n.scale(1/r),i.scale(s),n.add(i),n.to(t)}cartesianToCartographic(e,t=[0,0,0]){Ql.from(e);const i=this.scaleToGeodeticSurface(Ql,Kl);if(!i)return;const n=this.geodeticSurfaceNormal(i,Vl),s=Wl;s.copy(Ql).subtract(i);const r=Math.atan2(n.y,n.x),o=Math.asin(n.z),a=Math.sign(xr(s,Ql))*Mr(s);return Ol([r,o,a],t,lr._cartographicRadians?Rl:pr)}eastNorthUpToFixedFrame(e,t=new vl){return jl(this,"east","north","up",e,t)}localFrameToFixedFrame(e,t,i,n,s=new vl){return jl(this,e,t,i,n,s)}geocentricSurfaceNormal(e,t=[0,0,0]){return Jl.from(e).normalize().to(t)}geodeticSurfaceNormalCartographic(e,t=[0,0,0]){const i=function(e,t=[]){return Sl(e,t,lr._cartographicRadians?Rl:fr)}(e),n=i[0],s=i[1],r=Math.cos(s);return Jl.set(r*Math.cos(n),r*Math.sin(n),Math.sin(s)).normalize(),Jl.to(t)}geodeticSurfaceNormal(e,t=[0,0,0]){return Jl.from(e).scale(this.oneOverRadiiSquared).normalize().to(t)}scaleToGeodeticSurface(e,t){return function(e,t,i=[]){const{oneOverRadii:n,oneOverRadiiSquared:s,centerToleranceSquared:r}=t;Dl.from(e);const o=Dl.x,a=Dl.y,c=Dl.z,h=n.x,l=n.y,u=n.z,d=o*o*h*h,f=a*a*l*l,p=c*c*u*u,m=d+f+p,g=Math.sqrt(1/m);if(!Number.isFinite(g))return;const A=Fl;if(A.copy(e).scale(g),m<r)return A.to(i);const y=s.x,b=s.y,B=s.z,v=_l;v.set(A.x*y*2,A.y*b*2,A.z*B*2);let C,w,E,M,T=(1-g)*Dl.len()/(.5*v.len()),x=0;do{T-=x,C=1/(1+T*y),w=1/(1+T*b),E=1/(1+T*B);const e=C*C,t=w*w,i=E*E;M=d*e+f*t+p*i-1,x=M/(-2*(d*(e*C)*y+f*(t*w)*b+p*(i*E)*B))}while(Math.abs(M)>Ml.EPSILON12);return Dl.scale([C,w,E]).to(i)}(e,this,t)}scaleToGeocentricSurface(e,t=[0,0,0]){Kl.from(e);const i=Kl.x,n=Kl.y,s=Kl.z,r=this.oneOverRadiiSquared,o=1/Math.sqrt(i*i*r.x+n*n*r.y+s*s*r.z);return Kl.multiplyScalar(o).to(t)}transformPositionToScaledSpace(e,t=[0,0,0]){return Kl.from(e).scale(this.oneOverRadii).to(t)}transformPositionFromScaledSpace(e,t=[0,0,0]){return Kl.from(e).scale(this.radii).to(t)}getSurfaceNormalIntersectionWithZAxis(e,t=0,i=[0,0,0]){Br(mr(this.radii.x,this.radii.y,Ml.EPSILON15)),Br(this.radii.z>0),Kl.from(e);const n=Kl.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(n)>=this.radii.z-t))return Kl.set(0,0,n).to(i)}}async function Yl(e,t,i,n,s){return i=function(e,t,i,n,s){if(i=no(e,t,i),1!==e.version)throw new Error("Instanced 3D Model version ".concat(e.version," is not supported"));i=oo(e,t,i);const r=new DataView(t);if(e.gltfFormat=r.getUint32(i,!0),i+=4,i=ao(e,t,i),i=Lh(e,t,i,n),0===e.featureTableJsonByteLength)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");const o=new Vr(e.featureTableJson,e.featureTableBinary),a=o.getGlobalProperty("INSTANCES_LENGTH");if(o.featuresLength=a,!Number.isFinite(a))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");e.eastNorthUp=o.getGlobalProperty("EAST_NORTH_UP"),e.rtcCenter=o.getGlobalProperty("RTC_CENTER",ar.FLOAT,3);new to(e.batchTableJson,e.batchTableBinary,a);return function(e,t,i,n){const s={instances:new Array(n),batchTable:e._batchTable,cull:!1,url:void 0,gltf:void 0,basePath:void 0,incrementallyLoadTextures:!1,forwardAxis:[1,0,0]},r=s.instances,o=new Nr,a=new Nr,c=new Nr,h=new Nr,l=new Mc,u=new ll,d=new Nr,f={},p=new vl,m=[],g=[],A=new Nr,y=new Nr;for(let i=0;i<n;i++){let n;if(t.hasProperty("POSITION"))n=t.getProperty("POSITION",ar.FLOAT,3,i,o);else if(t.hasProperty("POSITION_QUANTIZED")){n=t.getProperty("POSITION_QUANTIZED",ar.UNSIGNED_SHORT,3,i,o);const e=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",ar.FLOAT,3,A);if(!e)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");const s=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",ar.FLOAT,3,y);if(!s)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");const r=65535;for(let t=0;t<3;t++)n[t]=n[t]/r*s[t]+e[t]}if(!n)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");o.copy(n),f.translation=o,e.normalUp=t.getProperty("NORMAL_UP",ar.FLOAT,3,i,m),e.normalRight=t.getProperty("NORMAL_RIGHT",ar.FLOAT,3,i,g);const s=!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",ar.UNSIGNED_SHORT,2,m),e.octNormalRight=t.getProperty("NORMAL_RIGHT_OCT32P",ar.UNSIGNED_SHORT,2,g),e.octNormalUp){if(!e.octNormalRight)throw new Error("i3dm: oct-encoded orientation requires NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P");throw new Error("i3dm: oct-encoded orientation not implemented")}e.eastNorthUp?(Xl.WGS84.eastNorthUpToFixedFrame(o,p),p.getRotationMatrix3(l)):l.identity()}s&&(h.copy(a).cross(c).normalize(),l.setColumn(0,a),l.setColumn(1,c),l.setColumn(2,h)),u.fromMatrix3(l),f.rotation=u,d.set(1,1,1);const b=t.getProperty("SCALE",ar.FLOAT,1,i);Number.isFinite(b)&&d.multiplyByScalar(b);const B=t.getProperty("SCALE_NON_UNIFORM",ar.FLOAT,3,i,m);B&&d.scale(B),f.scale=d;let v=t.getProperty("BATCH_ID",ar.UNSIGNED_SHORT,1,i);void 0===v&&(v=i);const C=(new vl).fromQuaternion(f.rotation);p.identity(),p.translate(f.translation),p.multiplyRight(C),p.scale(f.scale);const w=p.clone();r[i]={modelMatrix:w,batchId:v}}e.instances=r}(e,o,0,a),i}(e,t,i,n),await Ph(e,e.gltfFormat,n,s),i}async function ql(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};switch(s.byteOffset=t,s.type=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const i=new DataView(e);return"".concat(String.fromCharCode(i.getUint8(t+0))).concat(String.fromCharCode(i.getUint8(t+1))).concat(String.fromCharCode(i.getUint8(t+2))).concat(String.fromCharCode(i.getUint8(t+3)))}(e,t),s.type){case cs.COMPOSITE:return await async function(e,t,i,n,s,r){i=no(e,t,i);const o=new DataView(t);for(e.tilesLength=o.getUint32(i,!0),i+=4,e.tiles=[];e.tiles.length<e.tilesLength&&e.byteLength-i>12;){const o={};e.tiles.push(o),i=await r(t,i,n,s,o)}return i}(s,e,t,i,n,ql);case cs.BATCHED_3D_MODEL:return await kh(s,e,t,i,n);case cs.GLTF:return await async function(e,t,i,n){e.rotateYtoZ=!0,e.gltfUpAxis=i["3d-tiles"]&&i["3d-tiles"].assetGltfUpAxis?i["3d-tiles"].assetGltfUpAxis:"Y";const{parse:s}=n;e.gltf=await s(t,_h,i,n),e.gpuMemoryUsageInBytes=Ua(e.gltf)}(s,e,i,n);case cs.INSTANCED_3D_MODEL:return await Yl(s,e,t,i,n);case cs.POINT_CLOUD:return await Bo(s,e,t,i,n);default:throw new Error("3DTileLoader: unknown type ".concat(s.type))}}Ti(Xl,"WGS84",new Xl(Tl,xl,Il));async function Zl(e,t,i,n){const s=e[t].bufferView,r=e.bufferViews[s],o=e.buffers[r.buffer];if(null==n||!n.url||!n.fetch)throw new Error("Url is not provided");if(!n.fetch)throw new Error("fetch is not provided");if(o.uri){const e=function(e,t){if(t.startsWith("http")){const i=new URL(e,t);return decodeURI(i.toString())}const i="http://".concat(t),n=new URL(e,i);return"/".concat(n.host).concat(n.pathname)}(o.uri,null==n?void 0:n.url),t=await n.fetch(e),i=await t.arrayBuffer();return new Uint8Array(i,r.byteOffset,r.byteLength)}return new Uint8Array(i,r.byteOffset,r.byteLength)}function $l(e){const t=new DataView(e);return t.getUint32(0,!0)+2**32*t.getUint32(4,!0)}const eu={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:as,extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:async function(e,t,i){if(1952609651!==new Uint32Array(e.slice(0,4))[0])throw new Error("Wrong subtree file magic number");if(1!==new Uint32Array(e.slice(4,8))[0])throw new Error("Wrong subtree file verson, must be 1");const n=$l(e.slice(8,16)),s=new Uint8Array(e,24,n),r=new TextDecoder("utf8").decode(s),o=JSON.parse(r),a=$l(e.slice(16,24));let c=new ArrayBuffer(0);return a&&(c=e.slice(24+n)),"bufferView"in o.tileAvailability&&(o.tileAvailability.explicitBitstream=await Zl(o,"tileAvailability",c,i)),"bufferView"in o.contentAvailability&&(o.contentAvailability.explicitBitstream=await Zl(o,"contentAvailability",c,i)),"bufferView"in o.childSubtreeAvailability&&(o.childSubtreeAvailability.explicitBitstream=await Zl(o,"childSubtreeAvailability",c,i)),o},options:{}};var tu=null;try{tu=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(e){}function iu(e,t,i){this.low=0|e,this.high=0|t,this.unsigned=!!i}function nu(e){return!0===(e&&e.__isLong__)}function su(e){var t=Math.clz32(e&-e);return e?31-t:t}iu.prototype.__isLong__,Object.defineProperty(iu.prototype,"__isLong__",{value:!0}),iu.isLong=nu;var ru={},ou={};function au(e,t){var i,n,s;return t?(s=0<=(e>>>=0)&&e<256)&&(n=ou[e])?n:(i=hu(e,0,!0),s&&(ou[e]=i),i):(s=-128<=(e|=0)&&e<128)&&(n=ru[e])?n:(i=hu(e,e<0?-1:0,!1),s&&(ru[e]=i),i)}function cu(e,t){if(isNaN(e))return t?yu:Au;if(t){if(e<0)return yu;if(e>=pu)return wu}else{if(e<=-mu)return Eu;if(e+1>=mu)return Cu}return e<0?cu(-e,t).neg():hu(e%fu|0,e/fu|0,t)}function hu(e,t,i){return new iu(e,t,i)}iu.fromInt=au,iu.fromNumber=cu,iu.fromBits=hu;var lu=Math.pow;function uu(e,t,i){if(0===e.length)throw Error("empty string");if("number"==typeof t?(i=t,t=!1):t=!!t,"NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return t?yu:Au;if((i=i||10)<2||36<i)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return uu(e.substring(1),t,i).neg();for(var s=cu(lu(i,8)),r=Au,o=0;o<e.length;o+=8){var a=Math.min(8,e.length-o),c=parseInt(e.substring(o,o+a),i);if(a<8){var h=cu(lu(i,a));r=r.mul(h).add(cu(c))}else r=(r=r.mul(s)).add(cu(c))}return r.unsigned=t,r}function du(e,t){return"number"==typeof e?cu(e,t):"string"==typeof e?uu(e,t):hu(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}iu.fromString=uu,iu.fromValue=du;var fu=4294967296,pu=fu*fu,mu=pu/2,gu=au(1<<24),Au=au(0);iu.ZERO=Au;var yu=au(0,!0);iu.UZERO=yu;var bu=au(1);iu.ONE=bu;var Bu=au(1,!0);iu.UONE=Bu;var vu=au(-1);iu.NEG_ONE=vu;var Cu=hu(-1,2147483647,!1);iu.MAX_VALUE=Cu;var wu=hu(-1,-1,!0);iu.MAX_UNSIGNED_VALUE=wu;var Eu=hu(0,-2147483648,!1);iu.MIN_VALUE=Eu;var Mu=iu.prototype;Mu.toInt=function(){return this.unsigned?this.low>>>0:this.low},Mu.toNumber=function(){return this.unsigned?(this.high>>>0)*fu+(this.low>>>0):this.high*fu+(this.low>>>0)},Mu.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(Eu)){var t=cu(e),i=this.div(t),n=i.mul(t).sub(this);return i.toString(e)+n.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var s=cu(lu(e,6),this.unsigned),r=this,o="";;){var a=r.div(s),c=(r.sub(a.mul(s)).toInt()>>>0).toString(e);if((r=a).isZero())return c+o;for(;c.length<6;)c="0"+c;o=""+c+o}},Mu.getHighBits=function(){return this.high},Mu.getHighBitsUnsigned=function(){return this.high>>>0},Mu.getLowBits=function(){return this.low},Mu.getLowBitsUnsigned=function(){return this.low>>>0},Mu.getNumBitsAbs=function(){if(this.isNegative())return this.eq(Eu)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},Mu.isZero=function(){return 0===this.high&&0===this.low},Mu.eqz=Mu.isZero,Mu.isNegative=function(){return!this.unsigned&&this.high<0},Mu.isPositive=function(){return this.unsigned||this.high>=0},Mu.isOdd=function(){return 1==(1&this.low)},Mu.isEven=function(){return 0==(1&this.low)},Mu.equals=function(e){return nu(e)||(e=du(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},Mu.eq=Mu.equals,Mu.notEquals=function(e){return!this.eq(e)},Mu.neq=Mu.notEquals,Mu.ne=Mu.notEquals,Mu.lessThan=function(e){return this.comp(e)<0},Mu.lt=Mu.lessThan,Mu.lessThanOrEqual=function(e){return this.comp(e)<=0},Mu.lte=Mu.lessThanOrEqual,Mu.le=Mu.lessThanOrEqual,Mu.greaterThan=function(e){return this.comp(e)>0},Mu.gt=Mu.greaterThan,Mu.greaterThanOrEqual=function(e){return this.comp(e)>=0},Mu.gte=Mu.greaterThanOrEqual,Mu.ge=Mu.greaterThanOrEqual,Mu.compare=function(e){if(nu(e)||(e=du(e)),this.eq(e))return 0;var t=this.isNegative(),i=e.isNegative();return t&&!i?-1:!t&&i?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},Mu.comp=Mu.compare,Mu.negate=function(){return!this.unsigned&&this.eq(Eu)?Eu:this.not().add(bu)},Mu.neg=Mu.negate,Mu.add=function(e){nu(e)||(e=du(e));var t=this.high>>>16,i=65535&this.high,n=this.low>>>16,s=65535&this.low,r=e.high>>>16,o=65535&e.high,a=e.low>>>16,c=0,h=0,l=0,u=0;return l+=(u+=s+(65535&e.low))>>>16,h+=(l+=n+a)>>>16,c+=(h+=i+o)>>>16,c+=t+r,hu((l&=65535)<<16|(u&=65535),(c&=65535)<<16|(h&=65535),this.unsigned)},Mu.subtract=function(e){return nu(e)||(e=du(e)),this.add(e.neg())},Mu.sub=Mu.subtract,Mu.multiply=function(e){if(this.isZero())return this;if(nu(e)||(e=du(e)),tu)return hu(tu.mul(this.low,this.high,e.low,e.high),tu.get_high(),this.unsigned);if(e.isZero())return this.unsigned?yu:Au;if(this.eq(Eu))return e.isOdd()?Eu:Au;if(e.eq(Eu))return this.isOdd()?Eu:Au;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(gu)&&e.lt(gu))return cu(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,i=65535&this.high,n=this.low>>>16,s=65535&this.low,r=e.high>>>16,o=65535&e.high,a=e.low>>>16,c=65535&e.low,h=0,l=0,u=0,d=0;return u+=(d+=s*c)>>>16,l+=(u+=n*c)>>>16,u&=65535,l+=(u+=s*a)>>>16,h+=(l+=i*c)>>>16,l&=65535,h+=(l+=n*a)>>>16,l&=65535,h+=(l+=s*o)>>>16,h+=t*c+i*a+n*o+s*r,hu((u&=65535)<<16|(d&=65535),(h&=65535)<<16|(l&=65535),this.unsigned)},Mu.mul=Mu.multiply,Mu.divide=function(e){if(nu(e)||(e=du(e)),e.isZero())throw Error("division by zero");var t,i,n;if(tu)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?hu((this.unsigned?tu.div_u:tu.div_s)(this.low,this.high,e.low,e.high),tu.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?yu:Au;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return yu;if(e.gt(this.shru(1)))return Bu;n=yu}else{if(this.eq(Eu))return e.eq(bu)||e.eq(vu)?Eu:e.eq(Eu)?bu:(t=this.shr(1).div(e).shl(1)).eq(Au)?e.isNegative()?bu:vu:(i=this.sub(e.mul(t)),n=t.add(i.div(e)));if(e.eq(Eu))return this.unsigned?yu:Au;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();n=Au}for(i=this;i.gte(e);){t=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var s=Math.ceil(Math.log(t)/Math.LN2),r=s<=48?1:lu(2,s-48),o=cu(t),a=o.mul(e);a.isNegative()||a.gt(i);)a=(o=cu(t-=r,this.unsigned)).mul(e);o.isZero()&&(o=bu),n=n.add(o),i=i.sub(a)}return n},Mu.div=Mu.divide,Mu.modulo=function(e){return nu(e)||(e=du(e)),tu?hu((this.unsigned?tu.rem_u:tu.rem_s)(this.low,this.high,e.low,e.high),tu.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},Mu.mod=Mu.modulo,Mu.rem=Mu.modulo,Mu.not=function(){return hu(~this.low,~this.high,this.unsigned)},Mu.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},Mu.clz=Mu.countLeadingZeros,Mu.countTrailingZeros=function(){return this.low?su(this.low):su(this.high)+32},Mu.ctz=Mu.countTrailingZeros,Mu.and=function(e){return nu(e)||(e=du(e)),hu(this.low&e.low,this.high&e.high,this.unsigned)},Mu.or=function(e){return nu(e)||(e=du(e)),hu(this.low|e.low,this.high|e.high,this.unsigned)},Mu.xor=function(e){return nu(e)||(e=du(e)),hu(this.low^e.low,this.high^e.high,this.unsigned)},Mu.shiftLeft=function(e){return nu(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?hu(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):hu(0,this.low<<e-32,this.unsigned)},Mu.shl=Mu.shiftLeft,Mu.shiftRight=function(e){return nu(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?hu(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):hu(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},Mu.shr=Mu.shiftRight,Mu.shiftRightUnsigned=function(e){return nu(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?hu(this.low>>>e|this.high<<32-e,this.high>>>e,this.unsigned):hu(32===e?this.high:this.high>>>e-32,0,this.unsigned)},Mu.shru=Mu.shiftRightUnsigned,Mu.shr_u=Mu.shiftRightUnsigned,Mu.rotateLeft=function(e){var t;return nu(e)&&(e=e.toInt()),0==(e&=63)?this:32===e?hu(this.high,this.low,this.unsigned):e<32?(t=32-e,hu(this.low<<e|this.high>>>t,this.high<<e|this.low>>>t,this.unsigned)):(t=32-(e-=32),hu(this.high<<e|this.low>>>t,this.low<<e|this.high>>>t,this.unsigned))},Mu.rotl=Mu.rotateLeft,Mu.rotateRight=function(e){var t;return nu(e)&&(e=e.toInt()),0==(e&=63)?this:32===e?hu(this.high,this.low,this.unsigned):e<32?(t=32-e,hu(this.high<<t|this.low>>>e,this.low<<t|this.high>>>e,this.unsigned)):(t=32-(e-=32),hu(this.low<<t|this.high>>>e,this.high<<t|this.low>>>e,this.unsigned))},Mu.rotr=Mu.rotateRight,Mu.toSigned=function(){return this.unsigned?hu(this.low,this.high,!1):this},Mu.toUnsigned=function(){return this.unsigned?this:hu(this.low,this.high,!0)},Mu.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},Mu.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},Mu.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},iu.fromBytes=function(e,t,i){return i?iu.fromBytesLE(e,t):iu.fromBytesBE(e,t)},iu.fromBytesLE=function(e,t){return new iu(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},iu.fromBytesBE=function(e,t){return new iu(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)};const Tu=iu,xu=16;function Iu(e){"X"===e&&(e="");const t=e.padEnd(xu,"0");return Tu.fromString(t,!0,16)}const Ru=-1,Su=0,Ou=1;new Nr,new Nr;const Du=new Nr,Fu=new Nr;class _u{constructor(e=[0,0,0],t=0){Ti(this,"center",void 0),Ti(this,"radius",void 0),this.radius=-0,this.center=new Nr,this.fromCenterRadius(e,t)}fromCenterRadius(e,t){return this.center.from(e),this.radius=t,this}fromCornerPoints(e,t){return t=Du.from(t),this.center=(new Nr).from(e).add(t).scale(.5),this.radius=this.center.distance(t),this}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.radius===e.radius}clone(){return new _u(this.center,this.radius)}union(e){const t=this.center,i=this.radius,n=e.center,s=e.radius,r=Du.copy(n).subtract(t),o=r.magnitude();if(i>=o+s)return this.clone();if(s>=o+i)return e.clone();const a=.5*(i+o+s);return Fu.copy(r).scale((-i+a)/o).add(t),this.center.copy(Fu),this.radius=a,this}expand(e){const t=Du.from(e).subtract(this.center).magnitude();return t>this.radius&&(this.radius=t),this}transform(e){this.center.transform(e);const t=dl(Du,e);return this.radius=Math.max(t[0],Math.max(t[1],t[2]))*this.radius,this}distanceSquaredTo(e){const t=this.distanceTo(e);return t*t}distanceTo(e){const t=Du.from(e).subtract(this.center);return Math.max(0,t.len()-this.radius)}intersectPlane(e){const t=this.center,i=this.radius,n=e.normal.dot(t)+e.distance;return n<-i?Ru:n<i?Su:Ou}}const Gu=new Nr,Lu=new Nr,Pu=new Nr,ku=new Nr,Nu=new Nr,Uu=new Nr,Hu=new Nr,ju=0,Ju=1,Vu=2,zu=3,Ku=4,Wu=5,Qu=6,Xu=7,Yu=8;class qu{constructor(e=[0,0,0],t=[0,0,0,0,0,0,0,0,0]){Ti(this,"center",void 0),Ti(this,"halfAxes",void 0),this.center=(new Nr).from(e),this.halfAxes=new Mc(t)}get halfSize(){const e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),i=this.halfAxes.getColumn(2);return[new Nr(e).len(),new Nr(t).len(),new Nr(i).len()]}get quaternion(){const e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),i=this.halfAxes.getColumn(2),n=new Nr(e).normalize(),s=new Nr(t).normalize(),r=new Nr(i).normalize();return(new ll).fromMatrix3(new Mc([...n,...s,...r]))}fromCenterHalfSizeQuaternion(e,t,i){const n=new ll(i),s=(new Mc).fromQuaternion(n);return s[0]=s[0]*t[0],s[1]=s[1]*t[0],s[2]=s[2]*t[0],s[3]=s[3]*t[1],s[4]=s[4]*t[1],s[5]=s[5]*t[1],s[6]=s[6]*t[2],s[7]=s[7]*t[2],s[8]=s[8]*t[2],this.center=(new Nr).from(e),this.halfAxes=s,this}clone(){return new qu(this.center,this.halfAxes)}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.halfAxes.equals(e.halfAxes)}getBoundingSphere(e=new _u){const t=this.halfAxes,i=t.getColumn(0,Pu),n=t.getColumn(1,ku),s=t.getColumn(2,Nu),r=Gu.copy(i).add(n).add(s);return e.center.copy(this.center),e.radius=r.magnitude(),e}intersectPlane(e){const t=this.center,i=e.normal,n=this.halfAxes,s=i.x,r=i.y,o=i.z,a=Math.abs(s*n[ju]+r*n[Ju]+o*n[Vu])+Math.abs(s*n[zu]+r*n[Ku]+o*n[Wu])+Math.abs(s*n[Qu]+r*n[Xu]+o*n[Yu]),c=i.dot(t)+e.distance;return c<=-a?Ru:c>=a?Ou:Su}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){const t=Lu.from(e).subtract(this.center),i=this.halfAxes,n=i.getColumn(0,Pu),s=i.getColumn(1,ku),r=i.getColumn(2,Nu),o=n.magnitude(),a=s.magnitude(),c=r.magnitude();n.normalize(),s.normalize(),r.normalize();let h,l=0;return h=Math.abs(t.dot(n))-o,h>0&&(l+=h*h),h=Math.abs(t.dot(s))-a,h>0&&(l+=h*h),h=Math.abs(t.dot(r))-c,h>0&&(l+=h*h),l}computePlaneDistances(e,t,i=[-0,-0]){let n=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;const r=this.center,o=this.halfAxes,a=o.getColumn(0,Pu),c=o.getColumn(1,ku),h=o.getColumn(2,Nu),l=Uu.copy(a).add(c).add(h).add(r),u=Hu.copy(l).subtract(e);let d=t.dot(u);return n=Math.min(d,n),s=Math.max(d,s),l.copy(r).add(a).add(c).subtract(h),u.copy(l).subtract(e),d=t.dot(u),n=Math.min(d,n),s=Math.max(d,s),l.copy(r).add(a).subtract(c).add(h),u.copy(l).subtract(e),d=t.dot(u),n=Math.min(d,n),s=Math.max(d,s),l.copy(r).add(a).subtract(c).subtract(h),u.copy(l).subtract(e),d=t.dot(u),n=Math.min(d,n),s=Math.max(d,s),r.copy(l).subtract(a).add(c).add(h),u.copy(l).subtract(e),d=t.dot(u),n=Math.min(d,n),s=Math.max(d,s),r.copy(l).subtract(a).add(c).subtract(h),u.copy(l).subtract(e),d=t.dot(u),n=Math.min(d,n),s=Math.max(d,s),r.copy(l).subtract(a).subtract(c).add(h),u.copy(l).subtract(e),d=t.dot(u),n=Math.min(d,n),s=Math.max(d,s),r.copy(l).subtract(a).subtract(c).subtract(h),u.copy(l).subtract(e),d=t.dot(u),n=Math.min(d,n),s=Math.max(d,s),i[0]=n,i[1]=s,i}transform(e){this.center.transformAsPoint(e);const t=this.halfAxes.getColumn(0,Pu);t.transformAsPoint(e);const i=this.halfAxes.getColumn(1,ku);i.transformAsPoint(e);const n=this.halfAxes.getColumn(2,Nu);return n.transformAsPoint(e),this.halfAxes=new Mc([...t,...i,...n]),this}getTransform(){throw new Error("not implemented")}}const Zu=new Nr,$u=new Nr;class ed{constructor(e=[0,0,1],t=0){Ti(this,"normal",void 0),Ti(this,"distance",void 0),this.normal=new Nr,this.distance=-0,this.fromNormalDistance(e,t)}fromNormalDistance(e,t){return Br(Number.isFinite(t)),this.normal.from(e).normalize(),this.distance=t,this}fromPointNormal(e,t){e=Zu.from(e),this.normal.from(t).normalize();const i=-this.normal.dot(e);return this.distance=i,this}fromCoefficients(e,t,i,n){return this.normal.set(e,t,i),Br(mr(this.normal.len(),1)),this.distance=n,this}clone(){return new ed(this.normal,this.distance)}equals(e){return mr(this.distance,e.distance)&&mr(this.normal,e.normal)}getPointDistance(e){return this.normal.dot(e)+this.distance}transform(e){const t=$u.copy(this.normal).transformAsVector(e).normalize(),i=this.normal.scale(-this.distance).transform(e);return this.fromPointNormal(i,t)}projectPointOntoPlane(e,t=[0,0,0]){e=Zu.from(e);const i=this.getPointDistance(e),n=$u.copy(this.normal).scale(i);return e.subtract(n).to(t)}}const td=[new Nr([1,0,0]),new Nr([0,1,0]),new Nr([0,0,1])],id=new Nr,nd=new Nr;new ed(new Nr(1,0,0),0);class sd{constructor(e=[]){Ti(this,"planes",void 0),this.planes=e}fromBoundingSphere(e){this.planes.length=2*td.length;const t=e.center,i=e.radius;let n=0;for(const e of td){let s=this.planes[n],r=this.planes[n+1];s||(s=this.planes[n]=new ed),r||(r=this.planes[n+1]=new ed);const o=id.copy(e).scale(-i).add(t);e.dot(o);s.fromPointNormal(o,e);const a=id.copy(e).scale(i).add(t),c=nd.copy(e).negate();c.dot(a);r.fromPointNormal(a,c),n+=2}return this}computeVisibility(e){let t=Ou;for(const i of this.planes){switch(e.intersectPlane(i)){case Ru:return Ru;case Su:t=Su}}return t}computeVisibilityWithPlaneMask(e,t){if(Br(Number.isFinite(t),"parentPlaneMask is required."),t===sd.MASK_OUTSIDE||t===sd.MASK_INSIDE)return t;let i=sd.MASK_INSIDE;const n=this.planes;for(let s=0;s<this.planes.length;++s){const r=s<31?1<<s:0;if(s<31&&0==(t&r))continue;const o=n[s],a=e.intersectPlane(o);if(a===Ru)return sd.MASK_OUTSIDE;a===Su&&(i|=r)}return i}}Ti(sd,"MASK_OUTSIDE",4294967295),Ti(sd,"MASK_INSIDE",0),Ti(sd,"MASK_INDETERMINATE",2147483647);new Nr,new Nr,new Nr,new Nr,new Nr;new Nr,new Nr,new Nr,new Nr,new Nr,new Nr,new Nr,new Nr,new Nr,new Nr,new Nr,new Nr,Math.PI;const rd=new Mc,od=new Mc,ad=new Mc,cd=new Mc,hd=new Mc;function ld(e,t={}){const i=Ml.EPSILON20;let n=0,s=0;const r=od,o=ad;r.identity(),o.copy(e);const a=i*function(e){let t=0;for(let i=0;i<9;++i){const n=e[i];t+=n*n}return Math.sqrt(t)}(o);for(;s<10&&fd(o)>a;)pd(o,cd),hd.copy(cd).transpose(),o.multiplyRight(cd),o.multiplyLeft(hd),r.multiplyRight(cd),++n>2&&(++s,n=0);return t.unitary=r.toTarget(t.unitary),t.diagonal=o.toTarget(t.diagonal),t}const ud=[1,0,0],dd=[2,2,1];function fd(e){let t=0;for(let i=0;i<3;++i){const n=e[rd.getElementIndex(dd[i],ud[i])];t+=2*n*n}return Math.sqrt(t)}function pd(e,t){const i=Ml.EPSILON15;let n=0,s=1;for(let t=0;t<3;++t){const i=Math.abs(e[rd.getElementIndex(dd[t],ud[t])]);i>n&&(s=t,n=i)}const r=ud[s],o=dd[s];let a=1,c=0;if(Math.abs(e[rd.getElementIndex(o,r)])>i){const t=(e[rd.getElementIndex(o,o)]-e[rd.getElementIndex(r,r)])/2/e[rd.getElementIndex(o,r)];let i;i=t<0?-1/(-t+Math.sqrt(1+t*t)):1/(t+Math.sqrt(1+t*t)),a=1/Math.sqrt(1+i*i),c=i*a}return Mc.IDENTITY.to(t),t[rd.getElementIndex(r,r)]=t[rd.getElementIndex(o,o)]=a,t[rd.getElementIndex(o,r)]=c,t[rd.getElementIndex(r,o)]=-c,t}const md=new Nr,gd=new Nr,Ad=new Nr,yd=new Nr,bd=new Nr,Bd=new Mc,vd={diagonal:new Mc,unitary:new Mc};const Cd=3,wd=61,Ed=180/Math.PI;function Md(e,t,i){const n=1<<t;return[(e[0]+i[0])/n,(e[1]+i[1])/n]}function Td(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function xd(e){return[Td(e[0]),Td(e[1])]}function Id(e,t){let[i,n]=t;switch(e){case 0:return[1,i,n];case 1:return[-i,1,n];case 2:return[-i,-n,1];case 3:return[-1,-n,-i];case 4:return[n,-1,-i];case 5:return[n,i,-1];default:throw new Error("Invalid face")}}function Rd(e){let[t,i,n]=e;const s=Math.atan2(n,Math.sqrt(t*t+i*i));return[Math.atan2(i,t)*Ed,s*Ed]}function Sd(e,t,i,n){if(0===n){1===i&&(t[0]=e-1-t[0],t[1]=e-1-t[1]);const n=t[0];t[0]=t[1],t[1]=n}}function Od(e){const t=function(e){if(e.indexOf("/")>0)return e;const t=Iu(e);return function(e){if(e.isZero())return"";let t=e.toString(2);for(;t.length<Cd+wd;)t="0"+t;const i=t.lastIndexOf("1"),n=t.substring(0,3),s=t.substring(3,i),r=s.length/2,o=Tu.fromString(n,!0,2).toString(10);let a="";if(0!==r)for(a=Tu.fromString(s,!0,2).toString(4);a.length<r;)a="0"+a;return"".concat(o,"/").concat(a)}(t)}(e),i=function(e){if(0===e.length)throw new Error("Invalid Hilbert quad key ".concat(e));const t=e.split("/"),i=parseInt(t[0],10),n=t[1],s=n.length;let r=0;const o=[0,0];for(let e=s-1;e>=0;e--){r=s-e;const t=n[e];let i=0,a=0;"1"===t?a=1:"2"===t?(i=1,a=1):"3"===t&&(i=1);const c=Math.pow(2,r-1);Sd(c,o,i,a),o[0]+=c*i,o[1]+=c*a}if(i%2==1){const e=o[0];o[0]=o[1],o[1]=e}return{face:i,ij:o,level:r}}(t);return i}const Dd=100;function Fd(e){const{face:t,ij:i,level:n}=e,s=[[0,0],[0,1],[1,1],[1,0],[0,0]],r=Math.max(1,Math.ceil(Dd*Math.pow(2,-n))),o=new Float64Array(4*r*2+2);let a=0,c=0;for(let e=0;e<4;e++){const h=s[e].slice(0),l=s[e+1],u=(l[0]-h[0])/r,d=(l[1]-h[1])/r;for(let e=0;e<r;e++){h[0]+=u,h[1]+=d;const e=Rd(Id(t,xd(Md(i,n,h))));Math.abs(e[1])>89.999&&(e[0]=c);const s=e[0]-c;e[0]+=s>180?-360:s<-180?360:0,o[a++]=e[0],o[a++]=e[1],c=e[0]}}return o[a++]=o[0],o[a++]=o[1],o}function _d(e){if(e.length%2!=0)throw new Error("Invalid corners");const t=[],i=[];for(let n=0;n<e.length;n+=2)t.push(e[n]),i.push(e[n+1]);return t.sort(((e,t)=>e-t)),i.sort(((e,t)=>e-t)),{west:t[0],east:t[t.length-1],north:i[i.length-1],south:i[0]}}function Gd(e,t){const i=(null==t?void 0:t.minimumHeight)||0,n=(null==t?void 0:t.maximumHeight)||0,s=function(e){let t;if(2===e.face||5===e.face){let i=null,n=0;for(let t=0;t<4;t++){const s=Fd(Od("".concat(e.face,"/").concat(t)));null==i&&(i=new Float64Array(4*s.length)),i.set(s,n),n+=s.length}t=_d(i)}else t=_d(Fd(e));return t}(Od(e)),r=s.west,o=s.south,a=s.east,c=s.north,h=[];return h.push(new Nr(r,c,i)),h.push(new Nr(a,c,i)),h.push(new Nr(a,o,i)),h.push(new Nr(r,o,i)),h.push(new Nr(r,c,n)),h.push(new Nr(a,c,n)),h.push(new Nr(a,o,n)),h.push(new Nr(r,o,n)),h}function Ld(e){return function(e){const t=xd(Md(e.ij,e.level,[.5,.5]));return Rd(Id(e.face,t))}(Od(e))}function Pd(e){const t=e.token,i={minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight},n=Gd(t,i),s=Ld(t),r=s[0],o=s[1],a=Xl.WGS84.cartographicToCartesian([r,o,i.maximumHeight]),c=new Nr(a[0],a[1],a[2]);n.push(c);const h=function(e,t=new qu){if(!e||0===e.length)return t.halfAxes=new Mc([0,0,0,0,0,0,0,0,0]),t.center=new Nr,t;const i=e.length,n=new Nr(0,0,0);for(const t of e)n.add(t);const s=1/i;n.multiplyByScalar(s);let r=0,o=0,a=0,c=0,h=0,l=0;for(const t of e){const e=md.copy(t).subtract(n);r+=e.x*e.x,o+=e.x*e.y,a+=e.x*e.z,c+=e.y*e.y,h+=e.y*e.z,l+=e.z*e.z}r*=s,o*=s,a*=s,c*=s,h*=s,l*=s;const u=Bd;u[0]=r,u[1]=o,u[2]=a,u[3]=o,u[4]=c,u[5]=h,u[6]=a,u[7]=h,u[8]=l;const{unitary:d}=ld(u,vd),f=t.halfAxes.copy(d);let p=f.getColumn(0,Ad),m=f.getColumn(1,yd),g=f.getColumn(2,bd),A=-Number.MAX_VALUE,y=-Number.MAX_VALUE,b=-Number.MAX_VALUE,B=Number.MAX_VALUE,v=Number.MAX_VALUE,C=Number.MAX_VALUE;for(const t of e)md.copy(t),A=Math.max(md.dot(p),A),y=Math.max(md.dot(m),y),b=Math.max(md.dot(g),b),B=Math.min(md.dot(p),B),v=Math.min(md.dot(m),v),C=Math.min(md.dot(g),C);p=p.multiplyByScalar(.5*(B+A)),m=m.multiplyByScalar(.5*(v+y)),g=g.multiplyByScalar(.5*(C+b)),t.center.copy(p).add(m).add(g);const w=gd.set(A-B,y-v,b-C).multiplyByScalar(.5),E=new Mc([w[0],0,0,0,w[1],0,0,0,w[2]]);return t.halfAxes.multiplyRight(E),t}(n);return[...h.center,...h.halfAxes]}const kd={QUADTREE:4,OCTREE:8};function Nd(e,t,i){if(null!=e&&e.box){const n=function(e,t){const i=function(e){return e.and(e.not().add(1))}(e).shiftRightUnsigned(2);return e.add(Tu.fromNumber(2*t+1-4).multiply(i))}(Iu(e.s2VolumeInfo.token),t),s=function(e){if(e.isZero())return"X";let t=e.countTrailingZeros();t=(t-t%4)/4;const i=t;t*=4;const n=e.shiftRightUnsigned(t).toString(16).replace(/0+$/,"");return Array(17-i-n.length).join("0")+n}(n),r={...e.s2VolumeInfo};if(r.token=s,"OCTREE"===i){const t=e.s2VolumeInfo,i=t.maximumHeight-t.minimumHeight,n=i/2,s=t.minimumHeight+i/2;t.minimumHeight=s-n,t.maximumHeight=s+n}return{box:Pd(r),s2VolumeInfo:r}}}async function Ud(e){const{options:t,parentData:i={mortonIndex:0,x:0,y:0,z:0},childIndex:n=0,globalData:s={level:0,mortonIndex:0,x:0,y:0,z:0},s2VolumeBox:r}=e;let{subtree:o,level:a=0}=e;const{subdivisionScheme:c,subtreeLevels:h,maximumLevel:l,contentUrlTemplate:u,subtreesUriTemplate:d,basePath:f}=t,p={children:[],lodMetricValue:0,contentUrl:""},m=kd[c],g=1&n,A=n>>1&1,y=n>>2&1,b=(m**a-1)/(m-1);let B=Jd(i.mortonIndex,n),v=b+B,C=Jd(i.x,g),w=Jd(i.y,A),E=Jd(i.z,y),M=!1;a+1>h&&(M=Hd(o.childSubtreeAvailability,B));const T=Jd(s.x,C),x=Jd(s.y,w),I=Jd(s.z,E),R=a+s.level;if(M){const e=Vd("".concat(f,"/").concat(d),R,T,x,I);o=await is(e,eu),s.mortonIndex=B,s.x=C,s.y=w,s.z=E,s.level=a,B=0,v=0,C=0,w=0,E=0,a=0}if(!Hd(o.tileAvailability,v)||a>l)return p;Hd(o.contentAvailability,v)&&(p.contentUrl=Vd(u,R,T,x,I));const S=a+1,O={mortonIndex:B,x:C,y:w,z:E};for(let e=0;e<m;e++){const i=Nd(r,e,c),n=await Ud({subtree:o,options:t,parentData:O,childIndex:e,level:S,globalData:s,s2VolumeBox:i});if(n.contentUrl||n.children.length){const e=jd(n,R+1,{childTileX:C,childTileY:w,childTileZ:E},t,r);p.children.push(e)}}return p}function Hd(e,t){return"constant"in e?Boolean(e.constant):!!e.explicitBitstream&&function(e,t){const i=Math.floor(e/8),n=e%8;return 1==(t[i]>>n&1)}(t,e.explicitBitstream)}function jd(e,t,i,n,s){const{basePath:r,refine:o,getRefine:a,lodMetricType:c,getTileType:h,rootLodMetricValue:l,rootBoundingVolume:u}=n,d=e.contentUrl&&e.contentUrl.replace("".concat(r,"/"),""),f=l/2**t,p=function(e,t,i){if(t.region){const{childTileX:n,childTileY:s,childTileZ:r}=i,[o,a,c,h,l,u]=t.region,d=2**e,f=(c-o)/d,p=(h-a)/d,m=(u-l)/d,[g,A]=[o+f*n,o+f*(n+1)],[y,b]=[a+p*s,a+p*(s+1)],[B,v]=[l+m*r,l+m*(r+1)];return{region:[g,y,A,b,B,v]}}if(t.box)return t;throw new Error("Unsupported bounding volume type ".concat(t))}(t,null!=s&&s.box?{box:s.box}:u,i);return{children:e.children,contentUrl:e.contentUrl,content:{uri:d},id:e.contentUrl,refine:a(o),type:h(e),lodMetricType:c,lodMetricValue:f,geometricError:f,transform:e.transform,boundingVolume:p}}function Jd(e,t){return parseInt(e.toString(2)+t.toString(2),2)}function Vd(e,t,i,n,s){const r=function(e){const t={};for(const i in e)t["{".concat(i,"}")]=e[i];return t}({level:t,x:i,y:n,z:s});return e.replace(/{level}|{x}|{y}|{z}/gi,(e=>r[e]))}function zd(e){if(!e.contentUrl)return ss.EMPTY;const t=e.contentUrl.split("?")[0].split(".").pop();switch(t){case"pnts":return ss.POINTCLOUD;case"i3dm":case"b3dm":case"glb":case"gltf":return ss.SCENEGRAPH;default:return t}}function Kd(e){switch(e){case"REPLACE":case"replace":return ns.REPLACE;case"ADD":case"add":return ns.ADD;default:return e}}function Wd(e,t){if(/^[a-z][0-9a-z+.-]*:/i.test(t)){const i=new URL(e,"".concat(t,"/"));return decodeURI(i.toString())}return e.startsWith("/")?e:"".concat(t,"/").concat(e)}function Qd(e,t){if(!e)return null;if(e.content){const i=e.content.uri||e.content.url;e.contentUrl=Wd(i,t.basePath)}return e.id=e.contentUrl,e.lodMetricType=os.GEOMETRIC_ERROR,e.lodMetricValue=e.geometricError,e.transformMatrix=e.transform,e.type=zd(e),e.refine=Kd(e.refine),e}async function Xd(e,t,i,n){var s,r;const o=t.basePath,{subdivisionScheme:a,maximumLevel:c,subtreeLevels:h,subtrees:{uri:l}}=i,u=Wd(Vd(l,0,0,0,0),o),d=await is(u,eu,n),f=Wd(e.content.uri,o),p=null==t||null===(s=t.root)||void 0===s?void 0:s.refine,m=e.geometricError,g=null===(r=e.boundingVolume.extensions)||void 0===r?void 0:r["3DTILES_bounding_volume_S2"];if(g){const t={box:Pd(g),s2VolumeInfo:g};e.boundingVolume=t}const A=e.boundingVolume,y={contentUrlTemplate:f,subtreesUriTemplate:l,subdivisionScheme:a,subtreeLevels:h,maximumLevel:c,refine:p,basePath:o,lodMetricType:os.GEOMETRIC_ERROR,rootLodMetricValue:m,rootBoundingVolume:A,getTileType:zd,getRefine:Kd};return await async function(e,t,i){if(!e)return null;e.lodMetricType=os.GEOMETRIC_ERROR,e.lodMetricValue=e.geometricError,e.transformMatrix=e.transform;const{children:n,contentUrl:s}=await Ud({subtree:t,options:i,s2VolumeBox:e});s&&(e.contentUrl=s,e.content={uri:s.replace("".concat(i.basePath,"/"),"")});return e.refine=Kd(e.refine),e.type=zd(e),e.children=n,e.id=e.contentUrl,e}(e,d,y)}function Yd(e){var t;return(null==e||null===(t=e.extensions)||void 0===t?void 0:t["3DTILES_implicit_tiling"])||(null==e?void 0:e.implicitTiling)}const qd={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:as,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:async function(e,t,i){const n=t["3d-tiles"]||{};let s;s="auto"===n.isTileset?i.url&&-1!==i.url.indexOf(".json"):n.isTileset;e=s?await async function(e,t,i){var n;const s=JSON.parse((new TextDecoder).decode(e));return s.loader=t.loader||qd,s.url=i.url,s.queryString=i.queryString,s.basePath=function(e){return jn(e.url)}(s),s.root=await async function(e,t){const i=e.basePath;let n;const s=Yd(null==e?void 0:e.root);n=s&&e.root?await Xd(e.root,e,s,t):Qd(e.root,e);const r=[];for(r.push(n);r.length>0;){const n=(r.pop()||{}).children||[];for(let s of n){const n=Yd(s);n?s=await Xd(s,e,n,t):Qd(s,{basePath:i}),r.push(s)}}return n}(s,t),s.type=rs.TILES3D,s.lodMetricType=os.GEOMETRIC_ERROR,s.lodMetricValue=(null===(n=s.root)||void 0===n?void 0:n.lodMetricValue)||0,s}(e,t,i):await async function(e,t,i){const n={content:{featureIds:null}},s=0;return await ql(e,s,t,i,n.content),n.content}(e,t,i);return e},options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};var Zd=function(e,t,i,n){return new(i||(i=Promise))((function(s,r){function o(e){try{c(n.next(e))}catch(e){r(e)}}function a(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};class $d{}$d.sl="https://www.wodashijie.com/",$d.rl="https://models.wodashijie.com/",$d.App=class{constructor(e){this.isDefaultMutual=!1,e.sl&&(ef.sl=e.sl),e.rl&&(ef.rl=e.rl),xt.defaults.baseURL=ef.sl,this.canvas=document.createElement("canvas"),this.canvas.style.cssText="position: absolute;left: 0;right: 0;top: 0;bottom: 0;width: 100%;height: 100%;background-color: transparent;outline-width: 0;-webkit-tap-highlight-color:transparent;z-index: 2;",e.container.appendChild(this.canvas),this.engine=new d.Engine(this.canvas,!0,{premultipliedAlpha:!0,preserveDrawingBuffer:!0,stencil:!0,doNotHandleContextLost:!1}),this.engine.setHardwareScalingLevel(.5),this.scene=new d.Scene(this.engine,{useGeometryUniqueIdsMap:!0,useClonedMeshMap:!0,useMaterialMeshMap:!0}),this.scene.useRightHandedSystem=!0,this.scene.getBoundingBoxRenderer().frontColor=d.Color3.Green(),this.scene.getBoundingBoxRenderer().showBackLines=!1,this.camera=new g(this),this.highlightLayer=new d.HighlightLayer("highlightLayer",this.scene),this.iEvent=new f(this),this.container=d.AdvancedDynamicTexture.CreateFullscreenUI("screenUI"),this.toolTips=new E(this),this.environment=new M(this),this.environment.defaultLights(),this.environment.openAllLight(),this.resources=new j(this),this.project=new U(this);let t=new d.UtilityLayerRenderer(this.scene);this.positionGizmo=new d.PositionGizmo(t),O.init(),this.engine.runRenderLoop((()=>{this.fps&&(this.fps.innerText=this.engine.getFps().toFixed()+" fps"),this.scene.render(),d.TWEEN.update(),this.iEvent&&this.iEvent.runRender()})),window.addEventListener("resize",(()=>{this.engine.resize()})),this.scene.onPointerObservable.add((e=>{this.iEvent&&this.iEvent.onPointer(e)})),this.scene.onKeyboardObservable.add((e=>{this.iEvent&&this.iEvent.onKeyboard(e)})),this.scene.registerAfterRender((()=>{this.iEvent&&this.iEvent.registerAfterRender()}))}load(e){return kt(this,void 0,void 0,(function*(){try{e.pk=null==e.pk?"project":e.pk,e.isDefaultLevel=null==e.isDefaultLevel||e.isDefaultLevel,e.isDefaultMutual=null==e.isDefaultMutual||e.isDefaultMutual,ef.pk=e.pk;let t=yield xt.get(`api/service/GetToken?accessToken=${ef.accessToken}`);if(200!=t.status)return;localStorage.setItem("mx3d-token",t.data);let i=yield xt.get("api/service");if(200!=i.status)return;localStorage.setItem("mx3d-long",i.data);let n=yield xt.get(`api/service/${ef.pk}`);if(200!=n.status)return;let s=JSON.parse(St.de(n.data));return new Promise(((t,i)=>kt(this,void 0,void 0,(function*(){try{(new Date).toLocaleString(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let i=new A,n=!1;if(s.modelLists){for(let e=0;e<s.modelLists.length;e++)i.add(s.modelLists[e].modelId,s.modelLists[e]);n=!0}let r=new A;for(let e=0;e<s.objectDatas.length;e++){let t,o=s.objectDatas[e];o.baseModel&&n&&(o.baseModel=i.find(o.baseModel)),o.baseModel&&!i.find(o.baseModel.modelId)&&i.add(o.baseModel.modelId,o.baseModel),o.objectType!=T.Corner&&o.objectType!=T.Floor&&(o.objectType!=T.Wall?(o.objectType==T.Window?t=new P(this):o.objectType==T.Door?t=new L(this):o.objectType==T.Campus?(t=new Gt(this),r.add(o.id,new Array)):o.objectType==T.Storey?(t=new k(this),r.add(o.id,new Array)):t=o.objectType==T.LeakWater?new Ot(this):o.objectType==T.Conduit?new Dt(this):o.objectType==T.UI3D?new Ft(this):o.objectType==T.Cabinet?new Pt(this):o.objectType==T.VirtualBox?new _t(this):o.objectType==T.Building?new N(this):new D(this),t.loadProperties(o),this.project.objectDatas.add(t.id,t)):(o.leftMap&&n&&(o.leftMap=i.find(o.leftMap)),o.rightMap&&n&&(o.rightMap=i.find(o.rightMap))))}for(let e=0;e<s.objectDatas.length;e++){let t=s.objectDatas[e];if(t.objectType==T.Corner||t.objectType==T.Wall||t.objectType==T.Floor){r.find(t.parentId).push(t)}}let o=0,a=i.count();for(const t in i.map){let n=i.find(t);".gltf"!=n.extension&&".glb"!=n.extension||(yield this.resources.loadModelMesh(n)),o++,e&&e.progress&&e.progress(o/a*.3)}o=0,i=null,a=this.project.objectDatas.count();for(const t in this.project.objectDatas.map){let i=this.project.objectDatas.find(t);yield i.bind(),o++,e&&e.progress&&e.progress(.3+o/a*.5)}o=0,a=r.count();let c=!1;for(const t in r.map){o++,e&&e.progress&&e.progress(.8+o/a*.2);let i=this.project.objectDatas.find(t);i&&i instanceof G?i.load(c,r.find(t)):console.error("出现错误,场景不存在或未创建成功",t,i)}this.project.root=this.project.objectDatas.find(s.id),this.project.optimization(),e.isDefaultMutual&&(this.defaultMutual=!0),e.isDefaultLevel&&this.project.switchLevel(null,!0),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1,(new Date).toLocaleString(),t(null),this.engine.resize(),e&&e.complete&&e.complete()}catch(t){i(t),e&&e.onError&&e.onError(t)}}))))}catch(t){e&&e.onError&&e.onError(t)}}))}set defaultMutual(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.isDefaultMutual=e;for(let e in this.project.objectDatas.map){let t=this.project.objectDatas.find(e);t instanceof N&&(this.project.getChildsById(t.id).length<1||(this.isDefaultMutual?t.addEventListener(x.leftClick,(()=>this.project.switchLevel(t.id))):t.removeEventListener(x.leftClick)))}this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}dispose(){this.environment.hideFps(),this.project.clear(),this.resources.delete(),this.engine.dispose()}},$d.Request=xt,$d.AlarmFlashing=O,$d.UI=class{static createIconFromMesh(e,t,i,n){let s=t.Sight.focus.clone(),r=t.instance.getBoundingInfo();return s.y+=(r.boundingBox.maximum.y-r.boundingBox.minimum.y)/2,new Kt(e,s,i,n,t.app.scene)}static createIcon(e,t,i,n){let s;t.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,s=new Jt(e,t.app.scene),s.size=i,s.height=n,s.pint=new d.Mesh(e+"_pint");let r=t.Sight.focus.clone();return s.pint.position=r,s.pint.position.y+=n,s.rect=new d.Rectangle,s.rect.isPointerBlocker=!1,s.rect.width=i.width+"px",s.rect.height=i.height+"px",s.rect.thickness=0,t.app.container.addControl(s.rect),s.rect.linkWithMesh(s.pint),t.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,s}},$d.Builder=class{static createMatrixCloud(e){let t;if(e.displayValues=null!=e.displayValues&&e.displayValues,e.isAlpha=null==e.isAlpha||e.isAlpha,e.isParticle=null!=e.isParticle&&e.isParticle,e.height=e.height||.5,e.radius=e.radius||2.8,e.isLevelRender=null==e.isLevelRender||e.isLevelRender,e.range=e.range||{max:30,min:16},!(e.value||e.value.maxX||e.value.maxY||e.value.data||e.anchor))return t;e.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,t=new Ut(e.anchor);let i=e.anchor.instance.getBoundingInfo();t.mesh=e.anchor.instance.clone(t.id),t.mesh.position.y+=e.height;let n=i.maximum.x-i.minimum.x,s=n/(2*e.value.maxX),r=i.maximum.z-i.minimum.z,o=r/(2*e.value.maxY),a=new Array;for(let c=0;c<2*e.value.maxX;c++)for(let h=0;h<2*e.value.maxY;h++){let l={x:c,y:h,value:e.range.min};for(let a=0;a<e.value.data.length;a++){const u=e.value.data[a];if(2*u.x+1==c&&2*u.y+1==h){l.value=u.value;let a=new d.Vector3(i.boundingSphere.center.x-(n/2-s*c),t.mesh.position.y,i.boundingSphere.center.z-(r/2-o*h));t.texts.push(this.createTempVlaue(l.value+"℃",a,e.anchor.app.scene,e.anchor.app.container))}}a.push(l)}t.displayValues=e.displayValues;let c=d.h337.create({width:2*e.value.maxX,height:2*e.value.maxY,radius:e.radius});c.setData({min:e.range.min,max:e.range.max,data:a});let h=new d.StandardMaterial(t.id,e.anchor.app.scene);return h.diffuseTexture=new d.Texture(c.getDataURL(),e.anchor.app.scene,!1,!1),h.specularColor=new d.Color3(0,0,0),h.alpha=.5,e.isAlpha&&(h.diffuseTexture.hasAlpha=!0),e.isLevelRender&&(t.mesh.renderingGroupId=1),t.mesh.material=h,t.mesh.alwaysSelectAsActiveMesh=!0,t.mesh.freezeWorldMatrix(),e.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,t}static _getMatrixParticleTex(e,t,i,n,s,r){let o,a=t.clone(),c=n.getBoundingInfo().boundingBox;let h=(c.extendSizeWorld.x+c.extendSizeWorld.z)/9,l=1500*h*h;c.minimumWorld.subtract(new d.Vector3(-0,0,-0)),c.maximumWorld.subtract(new d.Vector3(0,0,0));o&&o.dispose(),d.GPUParticleSystem.IsSupported&&(o=new d.GPUParticleSystem("particles",{capacity:l},s),o.activeParticleCount=l,o.manualEmitCount=o.activeParticleCount,o.minEmitBox=c.minimumWorld,o.maxEmitBox=c.maximumWorld),o.particleTexture=a,o.emitter=n,r&&(o.renderingGroupId=1),o.isLocal=!0;let u=new d.NodeMaterial("nm_heatmapBox_"+n.id,s);return u.loadAsync(e+"resources/horizontalNodeMat.json").then((()=>{u.build(!1),u.getBlockByName("boxTex").texture=i,u.getBlockByName("emitXMin").value=o.minEmitBox.x,u.getBlockByName("emitXMax").value=o.maxEmitBox.x,u.getBlockByName("emitYMin").value=o.minEmitBox.z,u.getBlockByName("emitYMax").value=o.maxEmitBox.z,u.createEffectForParticles(o)})),n.onDispose=()=>{o&&o.dispose()},o.onDispose=()=>{u&&u.dispose(),a&&a.dispose()},o.color1=new d.Color4(.8,.8,.8,.1),o.color2=new d.Color4(.95,.95,.95,.15),o.colorDead=new d.Color4(.9,.9,.9,.1),o.minSize=1.4,o.maxSize=2,o.minLifeTime=Number.MAX_SAFE_INTEGER,o.emitRate=5e4*h,o.blendMode=d.ParticleSystem.BLENDMODE_STANDARD,o.gravity=new d.Vector3(0,0,0),o.direction1=new d.Vector3(0,0,0),o.direction2=new d.Vector3(0,0,0),o.minAngularSpeed=-2,o.maxAngularSpeed=2,o.minEmitPower=.5,o.maxEmitPower=1,o.updateSpeed=.005,o.start(),o}static createPunctateCloud(e){if(e.displayValues=null!=e.displayValues&&e.displayValues,e.isAlpha=null==e.isAlpha||e.isAlpha,e.isParticle=null!=e.isParticle&&e.isParticle,e.radius=e.radius||1,e.isLevelRender=null==e.isLevelRender||e.isLevelRender,e.range=e.range||{max:30,min:16},!e.value&&!e.anchor)return console.error("要创建的云图数值为空!"),null;let t;e.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,t=new Ut(e.anchor),t.mesh=d.MeshBuilder.CreateDisc(t.id,{radius:1,sideOrientation:2},e.anchor.app.scene),t.mesh.scaling=new d.Vector3(e.radius,e.radius,e.radius),t.mesh.alwaysSelectAsActiveMesh=!0,t.mesh.enablePointerMoveEvents=!1,t.mesh.isPickable=!1,t.mesh.position=e.anchor.instance.position.clone(),t.mesh.rotation.x=Math.PI/2;let i=[];for(let t=0;t<6;t++)for(let n=0;n<6;n++){let s={x:t,y:n,value:e.range.min};s.value=2==t&&2==n||3==t&&2==n||2==t&&3==n||3==t&&3==n?e.value:e.value-2*(Math.abs(2-t)+Math.abs(2-n)),i.push(s)}t.displayValues=e.displayValues;let n=d.h337.create({width:5,height:5,radius:2});n.setData({min:e.range.min,max:e.range.max,data:i});let s=new d.StandardMaterial(t.id,e.anchor.app.scene);return s.diffuseTexture=new d.Texture(n.getDataURL(),e.anchor.app.scene,!1,!1),s.specularColor=new d.Color3(0,0,0),s.alpha=.5,e.isAlpha&&(s.diffuseTexture.hasAlpha=!0),e.isLevelRender&&(t.mesh.renderingGroupId=1),t.mesh.material=s,t.mesh.alwaysSelectAsActiveMesh=!0,t.mesh.freezeWorldMatrix(),e.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,t}static createColumnCloud(e){if(e.displayValues=null!=e.displayValues&&e.displayValues,e.isAlpha=null==e.isAlpha||e.isAlpha,e.isParticle=null!=e.isParticle&&e.isParticle,e.radius=e.radius||4,e.isLevelRender=null==e.isLevelRender||e.isLevelRender,e.range=e.range||{max:30,min:16},!e.data&&e.data.length<1&&!e.anchor)return console.error("要创建的云图数值为空!"),null;let t;e.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,t=new Ut(e.anchor);let i=.98*e.anchor.instance.scaling.y;t.mesh=d.MeshBuilder.CreatePlane(t.id,{width:.98*e.anchor.instance.scaling.x,height:i,sideOrientation:2},e.anchor.app.scene),t.mesh.alwaysSelectAsActiveMesh=!0,t.mesh.enablePointerMoveEvents=!1,t.mesh.isPickable=!1,t.mesh.position=e.anchor.instance.position.clone(),t.mesh.rotation.z=Math.PI,t.mesh.rotation.y=e.anchor.instance.rotation.y,e.isLevelRender&&(t.mesh.renderingGroupId=1);let n=[];for(let t=0;t<4;t++)for(let i=0;i<3*e.data.length;i++){let s={x:t,y:i,value:e.range.min};for(let n=0;n<e.data.length;n++){const r=e.data[n];2==t&&3*n+2==i&&(s.value=r.value)}n.push(s)}let s=i/e.data.length;for(let n=0;n<e.data.length;n++){let r=t.mesh.position.clone();r.y=r.y-i/2+(i-s*n-s/2),t.texts.push(this.createTempVlaue(e.data[n].value+"℃",r,e.anchor.app.scene,t.anchor.app.container))}t.displayValues=e.displayValues;let r=d.h337.create({width:4,height:3*e.data.length,radius:e.radius});r.setData({min:e.range.min,max:e.range.max,data:n});let o=new d.StandardMaterial(t.id,e.anchor.app.scene);return o.diffuseTexture=new d.Texture(r.getDataURL(),e.anchor.app.scene,!1,!1),o.specularColor=new d.Color3(0,0,0),o.alpha=.5,e.isAlpha&&(o.diffuseTexture.hasAlpha=!0),t.mesh.material=o,t.mesh.alwaysSelectAsActiveMesh=!0,t.mesh.freezeWorldMatrix(),e.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,t}static _getColumnarParticleTex(e,t,i,n,s){let r,o=n.clone(),a=t.getBoundingInfo().boundingBox;a.extendSizeWorld.x,a.extendSizeWorld.z;d.Effect.ShadersStore.particlesVertexShader="\n precision highp float;\n in vec3 position;\n in vec4 color;\n in float angle;\n in vec2 size;\n in vec2 offset;\n uniform mat4 view;\n uniform mat4 projection;\n uniform vec2 translationPivot;\n out vec2 vUV;\n out vec4 vColor;\n out vec3 vPositionW;\n out vec3 vPosition;\n uniform mat4 invView;\n uniform vec3 eyePosition;\n\n vec3 rotate(vec3 yaxis,vec3 rotatedCorner) {\n vec3 xaxis=normalize(cross(vec3(0.,1.0,0.),yaxis));\n vec3 zaxis=normalize(cross(yaxis,xaxis));\n vec3 row0=vec3(xaxis.x,xaxis.y,xaxis.z);\n vec3 row1=vec3(yaxis.x,yaxis.y,yaxis.z);\n vec3 row2=vec3(zaxis.x,zaxis.y,zaxis.z);\n mat3 rotMatrix=mat3(row0,row1,row2);\n vec3 alignedCorner=rotMatrix*rotatedCorner;\n return position+alignedCorner;\n }\n\n void main(void) {\n vec2 cornerPos;\n cornerPos=(vec2(offset.x-0.5,offset.y-0.5)-translationPivot)*size+translationPivot;\n vec3 rotatedCorner;\n rotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\n rotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\n rotatedCorner.z=0.;\n vec3 viewPos=(view*vec4(position,1.0)).xyz+rotatedCorner;\n vPositionW=(invView*vec4(viewPos,1)).xyz;\n vPosition = position;\n gl_Position=projection*vec4(viewPos,1.0);\n vColor=color;\n vUV=offset;\n }\n \n ",d.Effect.ShadersStore[t.id+"myParticleFragmentShader"]="\n #ifdef GL_ES\n precision highp float;\n #endif\n\n attribute vec3 position;\n\n varying vec2 vUV; // Provided by Runtime.js\n varying vec4 vColor; // Provided by Runtime.js\n\n varying vec3 vPosition;\n\n uniform sampler2D diffuseSampler; // Provided by Runtime.js\n uniform float time; // This one is custom so we need to declare it to the effect\n\n uniform float u_emitXMin;\n uniform float u_emitXMax;\n uniform float u_emitYMin;\n uniform float u_emitYMax;\n\n uniform sampler2D boxTexSampler;\n\n uniform mat4 emitBox_WorldM;\n\n\n void main(void) {\n vec4 position = inverse(emitBox_WorldM) * vec4(vPosition, 1.0);\n\n float x = position.x;\n float z = position.y;\n float output0 = 0.0 + (x - u_emitXMin) * (1.0 - 0.0) / (u_emitXMax - u_emitXMin);\n float output1 = 0.0 + (z - u_emitYMin) * (1.0 - 0.0) / (u_emitYMax - u_emitYMin);\n vec2 xy = vec2(output0, output1);\n vec4 baseTex = texture2D(boxTexSampler, xy);\n\n vec4 baseColor = texture2D(diffuseSampler, vUV);\n\n vec4 resAlpha = baseColor * vColor ;\n\n gl_FragColor = vec4(baseTex.xyz, resAlpha.a);\n }\n ";var c=i.getEngine().createEffectForParticles(t.id+"myParticle",["time","u_emitXMin","u_emitYMin","u_emitXMax","u_emitYMax","emitBox_WorldM"],["boxTexSampler"],"");return t.onAfterWorldMatrixUpdateObservable.add((()=>{})),c.onCompileObservable.add((()=>{c.setMatrix("emitBox_WorldM",t.getWorldMatrix()),c.setFloat("u_emitXMin",r.minEmitBox.x),c.setFloat("u_emitYMin",r.minEmitBox.y),c.setFloat("u_emitXMax",r.maxEmitBox.x),c.setFloat("u_emitYMax",r.maxEmitBox.y)})),c.onBind=function(){c.setTexture("boxTexSampler",e)},r&&r.dispose(),d.GPUParticleSystem.IsSupported&&(r=new d.ParticleSystem("particles",200,i,c),r.manualEmitCount=r.getCapacity(),r.minEmitBox=a.minimum,r.maxEmitBox=a.maximum),t.onDispose=()=>{r&&r.dispose()},r.onDispose=()=>{o&&o.dispose()},r.particleTexture=o.clone(),r.emitter=t,s&&(r.renderingGroupId=1),r.isLocal=!0,r.color1=new d.Color4(.8,.8,.8,.1),r.color2=new d.Color4(.95,.95,.95,.15),r.colorDead=new d.Color4(.9,.9,.9,.1),r.minSize=.7,r.maxSize=1,r.minLifeTime=Number.MAX_SAFE_INTEGER,r.emitRate=50,r.blendMode=d.ParticleSystem.BLENDMODE_STANDARD,r.gravity=new d.Vector3(0,0,0),r.direction1=new d.Vector3(0,0,0),r.direction2=new d.Vector3(0,0,0),r.minAngularSpeed=-2,r.maxAngularSpeed=2,r.minEmitPower=.5,r.maxEmitPower=1,r.updateSpeed=.005,r.start(),r}static createTempVlaue(e,t,i,n){let s=new d.Mesh("temp_"+y.getGUID(12),i);s.position=t;let r=new d.TextBlock;return r.isPointerBlocker=!1,r.text="默认提示",r.color="white",r.resizeToFit=!0,r.fontSize="20px",r.text=e,n.addControl(r),r.linkWithMesh(s),r}static createCapacity(e,t,i,n="200px"){let s=new Nt(e,t);s.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let r=s.anchor.instance.scaling.clone();s.mesh=d.MeshBuilder.CreateBox("RATIO_"+s.anchor.id,{width:r.x,height:r.y,depth:r.z}),s.mesh.position=s.anchor.instance.position.clone(),s.mesh.scaling.x=.98,s.mesh.scaling.z=.98,s.mesh.rotation=s.anchor.instance.rotation.clone(),s.mesh.alwaysSelectAsActiveMesh=!0,s.mesh.visibility=1;let o=t<.25?d.Color3.Blue():t>=.25&&t<.5?d.Color3.Green():t>=.5&&t<.75?d.Color3.Yellow():d.Color3.Red();s.color=o.toHexString(),t*=s.mesh.scaling.y;var a=new d.Vector3(0,-r.y/2,0);s.mesh.setPivotPoint(a);let c=new d.StandardMaterial(s.mesh.id,s.anchor.instance._scene);return c.diffuseColor=o,s.mesh.material=c,d.Animation.CreateAndStartAnimation(s.mesh.id,s.mesh,"scaling.y",15,30,.02,t,0,null),s.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,i&&(s.textMesh=this.createTextMesh(e,i,r.y*t,n,"#fff")),s}static createTextMesh(e,t,i,n="200px",s="white"){e.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let r=d.Mesh.CreatePlane("text_"+e.id,e.instance.scaling.x,e.app.scene,!0,d.Mesh.DOUBLESIDE);r.alwaysSelectAsActiveMesh=!0,r.position=e.instance.position.clone(),r.position.y=i+.05,r.rotation.y=Math.PI-e.instance.rotation.y,r.rotation.x=-Math.PI/2;let o=new d.StandardMaterial("text_mat_"+e.id,e.app.scene);o.diffuseColor=d.Color3.White(),o.emissiveColor=d.Color3.White();let a=new d.DynamicTexture("text_tex_"+e.id,{width:1e3*e.instance.scaling.x,height:500*e.instance.scaling.x},e.app.scene,!1);return a.hasAlpha=!0,o.diffuseTexture=a,o.opacityTexture=a,a.drawText(t,1e3*e.instance.scaling.x/4,500*e.instance.scaling.x/2,"bold "+n+" NexaBold",s,"",!0,!0),a.update(),r.material=o,e.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,r}static create2DLine(e,t,i){if(t.length<2)return void console.error("要连线的对象不能少于2个。");let n=new jt;return n.id=e,n.objs=t,i&&i.width&&(n.width=i.width),i&&i.color&&(n.color=i.color),i&&i.isDotted&&(n.isDotted=i.isDotted),n.update(),n}static create3DLine(e,t,i){if(t.length<2)return void console.error("要连线的对象不能少于2个。");let n=new Ht;return n.id=e,n.objs=t,i&&i.width&&(n.width=i.width),i&&i.color&&(n.color=i.color),n.update(),n}},$d.EffectType=Vt,$d.EventType=x,$d.StatusType=I,$d.Effect=$t,$d.TileLoader=class{constructor(e){this.app=e}load(e){return Zd(this,void 0,void 0,(function*(){const t=yield is(e,qd),i=new d.Mesh("tileset",this.app.scene);t.data;const n=t.data.attributes.POSITION.value,s=t.data.indices.value,r=new d.VertexData;r.positions=n,r.indices=s,r.applyToMesh(i);let o=new d.StandardMaterial("tilesetMaterial",this.app.scene);o.diffuseColor=new d.Color3(1,0,0),i.material=o}))}};const ef=$d})(),s=s.default})()));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("Runtime")):"function"==typeof define&&define.amd?define("MX3D",["Runtime"],t):"object"==typeof exports?exports.MX3D=t(require("Runtime")):e.MX3D=t(e.Runtime)}(self,(e=>(()=>{var t={452:function(e,t,i){var n;e.exports=(n=i(249),i(269),i(214),i(888),i(109),function(){var e=n,t=e.lib.BlockCipher,i=e.algo,s=[],r=[],o=[],a=[],c=[],h=[],l=[],u=[],d=[],f=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var i=0,n=0;for(t=0;t<256;t++){var p=n^n<<1^n<<2^n<<3^n<<4;p=p>>>8^255&p^99,s[i]=p,r[p]=i;var m=e[i],g=e[m],A=e[g],y=257*e[p]^16843008*p;o[i]=y<<24|y>>>8,a[i]=y<<16|y>>>16,c[i]=y<<8|y>>>24,h[i]=y,y=16843009*A^65537*g^257*m^16843008*i,l[p]=y<<24|y>>>8,u[p]=y<<16|y>>>16,d[p]=y<<8|y>>>24,f[p]=y,i?(i=m^e[e[e[A^m]]],n^=e[e[n]]):i=n=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],m=i.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,i=e.sigBytes/4,n=4*((this._nRounds=i+6)+1),r=this._keySchedule=[],o=0;o<n;o++)o<i?r[o]=t[o]:(h=r[o-1],o%i?i>6&&o%i==4&&(h=s[h>>>24]<<24|s[h>>>16&255]<<16|s[h>>>8&255]<<8|s[255&h]):(h=s[(h=h<<8|h>>>24)>>>24]<<24|s[h>>>16&255]<<16|s[h>>>8&255]<<8|s[255&h],h^=p[o/i|0]<<24),r[o]=r[o-i]^h);for(var a=this._invKeySchedule=[],c=0;c<n;c++){if(o=n-c,c%4)var h=r[o];else h=r[o-4];a[c]=c<4||o<=4?h:l[s[h>>>24]]^u[s[h>>>16&255]]^d[s[h>>>8&255]]^f[s[255&h]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,o,a,c,h,s)},decryptBlock:function(e,t){var i=e[t+1];e[t+1]=e[t+3],e[t+3]=i,this._doCryptBlock(e,t,this._invKeySchedule,l,u,d,f,r),i=e[t+1],e[t+1]=e[t+3],e[t+3]=i},_doCryptBlock:function(e,t,i,n,s,r,o,a){for(var c=this._nRounds,h=e[t]^i[0],l=e[t+1]^i[1],u=e[t+2]^i[2],d=e[t+3]^i[3],f=4,p=1;p<c;p++){var m=n[h>>>24]^s[l>>>16&255]^r[u>>>8&255]^o[255&d]^i[f++],g=n[l>>>24]^s[u>>>16&255]^r[d>>>8&255]^o[255&h]^i[f++],A=n[u>>>24]^s[d>>>16&255]^r[h>>>8&255]^o[255&l]^i[f++],y=n[d>>>24]^s[h>>>16&255]^r[l>>>8&255]^o[255&u]^i[f++];h=m,l=g,u=A,d=y}m=(a[h>>>24]<<24|a[l>>>16&255]<<16|a[u>>>8&255]<<8|a[255&d])^i[f++],g=(a[l>>>24]<<24|a[u>>>16&255]<<16|a[d>>>8&255]<<8|a[255&h])^i[f++],A=(a[u>>>24]<<24|a[d>>>16&255]<<16|a[h>>>8&255]<<8|a[255&l])^i[f++],y=(a[d>>>24]<<24|a[h>>>16&255]<<16|a[l>>>8&255]<<8|a[255&u])^i[f++],e[t]=m,e[t+1]=g,e[t+2]=A,e[t+3]=y},keySize:8});e.AES=t._createHelper(m)}(),n.AES)},109:function(e,t,i){var n;e.exports=(n=i(249),i(888),void(n.lib.Cipher||function(e){var t=n,i=t.lib,s=i.Base,r=i.WordArray,o=i.BufferedBlockAlgorithm,a=t.enc,c=(a.Utf8,a.Base64),h=t.algo.EvpKDF,l=i.Cipher=o.extend({cfg:s.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,i){this.cfg=this.cfg.extend(i),this._xformMode=e,this._key=t,this.reset()},reset:function(){o.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?b:A}return function(t){return{encrypt:function(i,n,s){return e(n).encrypt(t,i,n,s)},decrypt:function(i,n,s){return e(n).decrypt(t,i,n,s)}}}}()}),u=(i.StreamCipher=l.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),t.mode={}),d=i.BlockCipherMode=s.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),f=u.CBC=function(){var t=d.extend();function i(t,i,n){var s,r=this._iv;r?(s=r,this._iv=e):s=this._prevBlock;for(var o=0;o<n;o++)t[i+o]^=s[o]}return t.Encryptor=t.extend({processBlock:function(e,t){var n=this._cipher,s=n.blockSize;i.call(this,e,t,s),n.encryptBlock(e,t),this._prevBlock=e.slice(t,t+s)}}),t.Decryptor=t.extend({processBlock:function(e,t){var n=this._cipher,s=n.blockSize,r=e.slice(t,t+s);n.decryptBlock(e,t),i.call(this,e,t,s),this._prevBlock=r}}),t}(),p=(t.pad={}).Pkcs7={pad:function(e,t){for(var i=4*t,n=i-e.sigBytes%i,s=n<<24|n<<16|n<<8|n,o=[],a=0;a<n;a+=4)o.push(s);var c=r.create(o,n);e.concat(c)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},m=(i.BlockCipher=l.extend({cfg:l.cfg.extend({mode:f,padding:p}),reset:function(){var e;l.reset.call(this);var t=this.cfg,i=t.iv,n=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=n.createEncryptor:(e=n.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,i&&i.words):(this._mode=e.call(n,this,i&&i.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4}),i.CipherParams=s.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}})),g=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,i=e.salt;return(i?r.create([1398893684,1701076831]).concat(i).concat(t):t).toString(c)},parse:function(e){var t,i=c.parse(e),n=i.words;return 1398893684==n[0]&&1701076831==n[1]&&(t=r.create(n.slice(2,4)),n.splice(0,4),i.sigBytes-=16),m.create({ciphertext:i,salt:t})}},A=i.SerializableCipher=s.extend({cfg:s.extend({format:g}),encrypt:function(e,t,i,n){n=this.cfg.extend(n);var s=e.createEncryptor(i,n),r=s.finalize(t),o=s.cfg;return m.create({ciphertext:r,key:i,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,i,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),e.createDecryptor(i,n).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),y=(t.kdf={}).OpenSSL={execute:function(e,t,i,n){n||(n=r.random(8));var s=h.create({keySize:t+i}).compute(e,n),o=r.create(s.words.slice(t),4*i);return s.sigBytes=4*t,m.create({key:s,iv:o,salt:n})}},b=i.PasswordBasedCipher=A.extend({cfg:A.cfg.extend({kdf:y}),encrypt:function(e,t,i,n){var s=(n=this.cfg.extend(n)).kdf.execute(i,e.keySize,e.ivSize);n.iv=s.iv;var r=A.encrypt.call(this,e,t,s.key,n);return r.mixIn(s),r},decrypt:function(e,t,i,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var s=n.kdf.execute(i,e.keySize,e.ivSize,t.salt);return n.iv=s.iv,A.decrypt.call(this,e,t,s.key,n)}})}()))},249:function(e,t,i){var n;e.exports=(n=n||function(e,t){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==i.g&&i.g.crypto&&(n=i.g.crypto),!n)try{n=i(480)}catch(e){}var s=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},r=Object.create||function(){function e(){}return function(t){var i;return e.prototype=t,i=new e,e.prototype=null,i}}(),o={},a=o.lib={},c=a.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},h=a.WordArray=c.extend({init:function(e,i){e=this.words=e||[],this.sigBytes=i!=t?i:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,i=e.words,n=this.sigBytes,s=e.sigBytes;if(this.clamp(),n%4)for(var r=0;r<s;r++){var o=i[r>>>2]>>>24-r%4*8&255;t[n+r>>>2]|=o<<24-(n+r)%4*8}else for(var a=0;a<s;a+=4)t[n+a>>>2]=i[a>>>2];return this.sigBytes+=s,this},clamp:function(){var t=this.words,i=this.sigBytes;t[i>>>2]&=4294967295<<32-i%4*8,t.length=e.ceil(i/4)},clone:function(){var e=c.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],i=0;i<e;i+=4)t.push(s());return new h.init(t,e)}}),l=o.enc={},u=l.Hex={stringify:function(e){for(var t=e.words,i=e.sigBytes,n=[],s=0;s<i;s++){var r=t[s>>>2]>>>24-s%4*8&255;n.push((r>>>4).toString(16)),n.push((15&r).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,i=[],n=0;n<t;n+=2)i[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new h.init(i,t/2)}},d=l.Latin1={stringify:function(e){for(var t=e.words,i=e.sigBytes,n=[],s=0;s<i;s++){var r=t[s>>>2]>>>24-s%4*8&255;n.push(String.fromCharCode(r))}return n.join("")},parse:function(e){for(var t=e.length,i=[],n=0;n<t;n++)i[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new h.init(i,t)}},f=l.Utf8={stringify:function(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return d.parse(unescape(encodeURIComponent(e)))}},p=a.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new h.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var i,n=this._data,s=n.words,r=n.sigBytes,o=this.blockSize,a=r/(4*o),c=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*o,l=e.min(4*c,r);if(c){for(var u=0;u<c;u+=o)this._doProcessBlock(s,u);i=s.splice(0,c),n.sigBytes-=l}return new h.init(i,l)},clone:function(){var e=c.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),m=(a.Hasher=p.extend({cfg:c.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,i){return new e.init(i).finalize(t)}},_createHmacHelper:function(e){return function(t,i){return new m.HMAC.init(e,i).finalize(t)}}}),o.algo={});return o}(Math),n)},269:function(e,t,i){var n;e.exports=(n=i(249),function(){var e=n,t=e.lib.WordArray;function i(e,i,n){for(var s=[],r=0,o=0;o<i;o++)if(o%4){var a=n[e.charCodeAt(o-1)]<<o%4*2|n[e.charCodeAt(o)]>>>6-o%4*2;s[r>>>2]|=a<<24-r%4*8,r++}return t.create(s,r)}e.enc.Base64={stringify:function(e){var t=e.words,i=e.sigBytes,n=this._map;e.clamp();for(var s=[],r=0;r<i;r+=3)for(var o=(t[r>>>2]>>>24-r%4*8&255)<<16|(t[r+1>>>2]>>>24-(r+1)%4*8&255)<<8|t[r+2>>>2]>>>24-(r+2)%4*8&255,a=0;a<4&&r+.75*a<i;a++)s.push(n.charAt(o>>>6*(3-a)&63));var c=n.charAt(64);if(c)for(;s.length%4;)s.push(c);return s.join("")},parse:function(e){var t=e.length,n=this._map,s=this._reverseMap;if(!s){s=this._reverseMap=[];for(var r=0;r<n.length;r++)s[n.charCodeAt(r)]=r}var o=n.charAt(64);if(o){var a=e.indexOf(o);-1!==a&&(t=a)}return i(e,t,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),n.enc.Base64)},786:function(e,t,i){var n;e.exports=(n=i(249),function(){var e=n,t=e.lib.WordArray;function i(e,i,n){for(var s=[],r=0,o=0;o<i;o++)if(o%4){var a=n[e.charCodeAt(o-1)]<<o%4*2|n[e.charCodeAt(o)]>>>6-o%4*2;s[r>>>2]|=a<<24-r%4*8,r++}return t.create(s,r)}e.enc.Base64url={stringify:function(e,t=!0){var i=e.words,n=e.sigBytes,s=t?this._safe_map:this._map;e.clamp();for(var r=[],o=0;o<n;o+=3)for(var a=(i[o>>>2]>>>24-o%4*8&255)<<16|(i[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|i[o+2>>>2]>>>24-(o+2)%4*8&255,c=0;c<4&&o+.75*c<n;c++)r.push(s.charAt(a>>>6*(3-c)&63));var h=s.charAt(64);if(h)for(;r.length%4;)r.push(h);return r.join("")},parse:function(e,t=!0){var n=e.length,s=t?this._safe_map:this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var o=0;o<s.length;o++)r[s.charCodeAt(o)]=o}var a=s.charAt(64);if(a){var c=e.indexOf(a);-1!==c&&(n=c)}return i(e,n,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"}}(),n.enc.Base64url)},298:function(e,t,i){var n;e.exports=(n=i(249),function(){var e=n,t=e.lib.WordArray,i=e.enc;function s(e){return e<<8&4278255360|e>>>8&16711935}i.Utf16=i.Utf16BE={stringify:function(e){for(var t=e.words,i=e.sigBytes,n=[],s=0;s<i;s+=2){var r=t[s>>>2]>>>16-s%4*8&65535;n.push(String.fromCharCode(r))}return n.join("")},parse:function(e){for(var i=e.length,n=[],s=0;s<i;s++)n[s>>>1]|=e.charCodeAt(s)<<16-s%2*16;return t.create(n,2*i)}},i.Utf16LE={stringify:function(e){for(var t=e.words,i=e.sigBytes,n=[],r=0;r<i;r+=2){var o=s(t[r>>>2]>>>16-r%4*8&65535);n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var i=e.length,n=[],r=0;r<i;r++)n[r>>>1]|=s(e.charCodeAt(r)<<16-r%2*16);return t.create(n,2*i)}}}(),n.enc.Utf16)},888:function(e,t,i){var n,s,r,o,a,c,h,l;e.exports=(l=i(249),i(783),i(824),s=(n=l).lib,r=s.Base,o=s.WordArray,a=n.algo,c=a.MD5,h=a.EvpKDF=r.extend({cfg:r.extend({keySize:4,hasher:c,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var i,n=this.cfg,s=n.hasher.create(),r=o.create(),a=r.words,c=n.keySize,h=n.iterations;a.length<c;){i&&s.update(i),i=s.update(e).finalize(t),s.reset();for(var l=1;l<h;l++)i=s.finalize(i),s.reset();r.concat(i)}return r.sigBytes=4*c,r}}),n.EvpKDF=function(e,t,i){return h.create(i).compute(e,t)},l.EvpKDF)},209:function(e,t,i){var n,s,r,o;e.exports=(o=i(249),i(109),s=(n=o).lib.CipherParams,r=n.enc.Hex,n.format.Hex={stringify:function(e){return e.ciphertext.toString(r)},parse:function(e){var t=r.parse(e);return s.create({ciphertext:t})}},o.format.Hex)},824:function(e,t,i){var n,s,r,o;e.exports=(n=i(249),r=(s=n).lib.Base,o=s.enc.Utf8,void(s.algo.HMAC=r.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=o.parse(t));var i=e.blockSize,n=4*i;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var s=this._oKey=t.clone(),r=this._iKey=t.clone(),a=s.words,c=r.words,h=0;h<i;h++)a[h]^=1549556828,c[h]^=909522486;s.sigBytes=r.sigBytes=n,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,i=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(i))}})))},354:function(e,t,i){var n;e.exports=(n=i(249),i(938),i(433),i(298),i(269),i(786),i(214),i(783),i(153),i(792),i(34),i(460),i(327),i(706),i(824),i(112),i(888),i(109),i(568),i(242),i(968),i(660),i(148),i(615),i(807),i(77),i(475),i(991),i(209),i(452),i(253),i(857),i(454),i(974),n)},433:function(e,t,i){var n;e.exports=(n=i(249),function(){if("function"==typeof ArrayBuffer){var e=n.lib.WordArray,t=e.init,i=e.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var i=e.byteLength,n=[],s=0;s<i;s++)n[s>>>2]|=e[s]<<24-s%4*8;t.call(this,n,i)}else t.apply(this,arguments)};i.prototype=e}}(),n.lib.WordArray)},214:function(e,t,i){var n;e.exports=(n=i(249),function(e){var t=n,i=t.lib,s=i.WordArray,r=i.Hasher,o=t.algo,a=[];!function(){for(var t=0;t<64;t++)a[t]=4294967296*e.abs(e.sin(t+1))|0}();var c=o.MD5=r.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var i=0;i<16;i++){var n=t+i,s=e[n];e[n]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}var r=this._hash.words,o=e[t+0],c=e[t+1],f=e[t+2],p=e[t+3],m=e[t+4],g=e[t+5],A=e[t+6],y=e[t+7],b=e[t+8],B=e[t+9],v=e[t+10],C=e[t+11],w=e[t+12],E=e[t+13],M=e[t+14],T=e[t+15],x=r[0],I=r[1],R=r[2],S=r[3];x=h(x,I,R,S,o,7,a[0]),S=h(S,x,I,R,c,12,a[1]),R=h(R,S,x,I,f,17,a[2]),I=h(I,R,S,x,p,22,a[3]),x=h(x,I,R,S,m,7,a[4]),S=h(S,x,I,R,g,12,a[5]),R=h(R,S,x,I,A,17,a[6]),I=h(I,R,S,x,y,22,a[7]),x=h(x,I,R,S,b,7,a[8]),S=h(S,x,I,R,B,12,a[9]),R=h(R,S,x,I,v,17,a[10]),I=h(I,R,S,x,C,22,a[11]),x=h(x,I,R,S,w,7,a[12]),S=h(S,x,I,R,E,12,a[13]),R=h(R,S,x,I,M,17,a[14]),x=l(x,I=h(I,R,S,x,T,22,a[15]),R,S,c,5,a[16]),S=l(S,x,I,R,A,9,a[17]),R=l(R,S,x,I,C,14,a[18]),I=l(I,R,S,x,o,20,a[19]),x=l(x,I,R,S,g,5,a[20]),S=l(S,x,I,R,v,9,a[21]),R=l(R,S,x,I,T,14,a[22]),I=l(I,R,S,x,m,20,a[23]),x=l(x,I,R,S,B,5,a[24]),S=l(S,x,I,R,M,9,a[25]),R=l(R,S,x,I,p,14,a[26]),I=l(I,R,S,x,b,20,a[27]),x=l(x,I,R,S,E,5,a[28]),S=l(S,x,I,R,f,9,a[29]),R=l(R,S,x,I,y,14,a[30]),x=u(x,I=l(I,R,S,x,w,20,a[31]),R,S,g,4,a[32]),S=u(S,x,I,R,b,11,a[33]),R=u(R,S,x,I,C,16,a[34]),I=u(I,R,S,x,M,23,a[35]),x=u(x,I,R,S,c,4,a[36]),S=u(S,x,I,R,m,11,a[37]),R=u(R,S,x,I,y,16,a[38]),I=u(I,R,S,x,v,23,a[39]),x=u(x,I,R,S,E,4,a[40]),S=u(S,x,I,R,o,11,a[41]),R=u(R,S,x,I,p,16,a[42]),I=u(I,R,S,x,A,23,a[43]),x=u(x,I,R,S,B,4,a[44]),S=u(S,x,I,R,w,11,a[45]),R=u(R,S,x,I,T,16,a[46]),x=d(x,I=u(I,R,S,x,f,23,a[47]),R,S,o,6,a[48]),S=d(S,x,I,R,y,10,a[49]),R=d(R,S,x,I,M,15,a[50]),I=d(I,R,S,x,g,21,a[51]),x=d(x,I,R,S,w,6,a[52]),S=d(S,x,I,R,p,10,a[53]),R=d(R,S,x,I,v,15,a[54]),I=d(I,R,S,x,c,21,a[55]),x=d(x,I,R,S,b,6,a[56]),S=d(S,x,I,R,T,10,a[57]),R=d(R,S,x,I,A,15,a[58]),I=d(I,R,S,x,E,21,a[59]),x=d(x,I,R,S,m,6,a[60]),S=d(S,x,I,R,C,10,a[61]),R=d(R,S,x,I,f,15,a[62]),I=d(I,R,S,x,B,21,a[63]),r[0]=r[0]+x|0,r[1]=r[1]+I|0,r[2]=r[2]+R|0,r[3]=r[3]+S|0},_doFinalize:function(){var t=this._data,i=t.words,n=8*this._nDataBytes,s=8*t.sigBytes;i[s>>>5]|=128<<24-s%32;var r=e.floor(n/4294967296),o=n;i[15+(s+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),i[14+(s+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),t.sigBytes=4*(i.length+1),this._process();for(var a=this._hash,c=a.words,h=0;h<4;h++){var l=c[h];c[h]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return a},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}});function h(e,t,i,n,s,r,o){var a=e+(t&i|~t&n)+s+o;return(a<<r|a>>>32-r)+t}function l(e,t,i,n,s,r,o){var a=e+(t&n|i&~n)+s+o;return(a<<r|a>>>32-r)+t}function u(e,t,i,n,s,r,o){var a=e+(t^i^n)+s+o;return(a<<r|a>>>32-r)+t}function d(e,t,i,n,s,r,o){var a=e+(i^(t|~n))+s+o;return(a<<r|a>>>32-r)+t}t.MD5=r._createHelper(c),t.HmacMD5=r._createHmacHelper(c)}(Math),n.MD5)},568:function(e,t,i){var n;e.exports=(n=i(249),i(109),n.mode.CFB=function(){var e=n.lib.BlockCipherMode.extend();function t(e,t,i,n){var s,r=this._iv;r?(s=r.slice(0),this._iv=void 0):s=this._prevBlock,n.encryptBlock(s,0);for(var o=0;o<i;o++)e[t+o]^=s[o]}return e.Encryptor=e.extend({processBlock:function(e,i){var n=this._cipher,s=n.blockSize;t.call(this,e,i,s,n),this._prevBlock=e.slice(i,i+s)}}),e.Decryptor=e.extend({processBlock:function(e,i){var n=this._cipher,s=n.blockSize,r=e.slice(i,i+s);t.call(this,e,i,s,n),this._prevBlock=r}}),e}(),n.mode.CFB)},968:function(e,t,i){var n;e.exports=(n=i(249),i(109),n.mode.CTRGladman=function(){var e=n.lib.BlockCipherMode.extend();function t(e){if(255==(e>>24&255)){var t=e>>16&255,i=e>>8&255,n=255&e;255===t?(t=0,255===i?(i=0,255===n?n=0:++n):++i):++t,e=0,e+=t<<16,e+=i<<8,e+=n}else e+=1<<24;return e}function i(e){return 0===(e[0]=t(e[0]))&&(e[1]=t(e[1])),e}var s=e.Encryptor=e.extend({processBlock:function(e,t){var n=this._cipher,s=n.blockSize,r=this._iv,o=this._counter;r&&(o=this._counter=r.slice(0),this._iv=void 0),i(o);var a=o.slice(0);n.encryptBlock(a,0);for(var c=0;c<s;c++)e[t+c]^=a[c]}});return e.Decryptor=s,e}(),n.mode.CTRGladman)},242:function(e,t,i){var n,s,r;e.exports=(r=i(249),i(109),r.mode.CTR=(n=r.lib.BlockCipherMode.extend(),s=n.Encryptor=n.extend({processBlock:function(e,t){var i=this._cipher,n=i.blockSize,s=this._iv,r=this._counter;s&&(r=this._counter=s.slice(0),this._iv=void 0);var o=r.slice(0);i.encryptBlock(o,0),r[n-1]=r[n-1]+1|0;for(var a=0;a<n;a++)e[t+a]^=o[a]}}),n.Decryptor=s,n),r.mode.CTR)},148:function(e,t,i){var n,s;e.exports=(s=i(249),i(109),s.mode.ECB=((n=s.lib.BlockCipherMode.extend()).Encryptor=n.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}}),n.Decryptor=n.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}}),n),s.mode.ECB)},660:function(e,t,i){var n,s,r;e.exports=(r=i(249),i(109),r.mode.OFB=(n=r.lib.BlockCipherMode.extend(),s=n.Encryptor=n.extend({processBlock:function(e,t){var i=this._cipher,n=i.blockSize,s=this._iv,r=this._keystream;s&&(r=this._keystream=s.slice(0),this._iv=void 0),i.encryptBlock(r,0);for(var o=0;o<n;o++)e[t+o]^=r[o]}}),n.Decryptor=s,n),r.mode.OFB)},615:function(e,t,i){var n;e.exports=(n=i(249),i(109),n.pad.AnsiX923={pad:function(e,t){var i=e.sigBytes,n=4*t,s=n-i%n,r=i+s-1;e.clamp(),e.words[r>>>2]|=s<<24-r%4*8,e.sigBytes+=s},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Ansix923)},807:function(e,t,i){var n;e.exports=(n=i(249),i(109),n.pad.Iso10126={pad:function(e,t){var i=4*t,s=i-e.sigBytes%i;e.concat(n.lib.WordArray.random(s-1)).concat(n.lib.WordArray.create([s<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Iso10126)},77:function(e,t,i){var n;e.exports=(n=i(249),i(109),n.pad.Iso97971={pad:function(e,t){e.concat(n.lib.WordArray.create([2147483648],1)),n.pad.ZeroPadding.pad(e,t)},unpad:function(e){n.pad.ZeroPadding.unpad(e),e.sigBytes--}},n.pad.Iso97971)},991:function(e,t,i){var n;e.exports=(n=i(249),i(109),n.pad.NoPadding={pad:function(){},unpad:function(){}},n.pad.NoPadding)},475:function(e,t,i){var n;e.exports=(n=i(249),i(109),n.pad.ZeroPadding={pad:function(e,t){var i=4*t;e.clamp(),e.sigBytes+=i-(e.sigBytes%i||i)},unpad:function(e){var t=e.words,i=e.sigBytes-1;for(i=e.sigBytes-1;i>=0;i--)if(t[i>>>2]>>>24-i%4*8&255){e.sigBytes=i+1;break}}},n.pad.ZeroPadding)},112:function(e,t,i){var n,s,r,o,a,c,h,l,u;e.exports=(u=i(249),i(783),i(824),s=(n=u).lib,r=s.Base,o=s.WordArray,a=n.algo,c=a.SHA1,h=a.HMAC,l=a.PBKDF2=r.extend({cfg:r.extend({keySize:4,hasher:c,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var i=this.cfg,n=h.create(i.hasher,e),s=o.create(),r=o.create([1]),a=s.words,c=r.words,l=i.keySize,u=i.iterations;a.length<l;){var d=n.update(t).finalize(r);n.reset();for(var f=d.words,p=f.length,m=d,g=1;g<u;g++){m=n.finalize(m),n.reset();for(var A=m.words,y=0;y<p;y++)f[y]^=A[y]}s.concat(d),c[0]++}return s.sigBytes=4*l,s}}),n.PBKDF2=function(e,t,i){return l.create(i).compute(e,t)},u.PBKDF2)},974:function(e,t,i){var n;e.exports=(n=i(249),i(269),i(214),i(888),i(109),function(){var e=n,t=e.lib.StreamCipher,i=e.algo,s=[],r=[],o=[],a=i.RabbitLegacy=t.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,i=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],n=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var s=0;s<4;s++)c.call(this);for(s=0;s<8;s++)n[s]^=i[s+4&7];if(t){var r=t.words,o=r[0],a=r[1],h=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),u=h>>>16|4294901760&l,d=l<<16|65535&h;for(n[0]^=h,n[1]^=u,n[2]^=l,n[3]^=d,n[4]^=h,n[5]^=u,n[6]^=l,n[7]^=d,s=0;s<4;s++)c.call(this)}},_doProcessBlock:function(e,t){var i=this._X;c.call(this),s[0]=i[0]^i[5]>>>16^i[3]<<16,s[1]=i[2]^i[7]>>>16^i[5]<<16,s[2]=i[4]^i[1]>>>16^i[7]<<16,s[3]=i[6]^i[3]>>>16^i[1]<<16;for(var n=0;n<4;n++)s[n]=16711935&(s[n]<<8|s[n]>>>24)|4278255360&(s[n]<<24|s[n]>>>8),e[t+n]^=s[n]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,i=0;i<8;i++)r[i]=t[i];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<r[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<r[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<r[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<r[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<r[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<r[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<r[6]>>>0?1:0)|0,this._b=t[7]>>>0<r[7]>>>0?1:0,i=0;i<8;i++){var n=e[i]+t[i],s=65535&n,a=n>>>16,c=((s*s>>>17)+s*a>>>15)+a*a,h=((4294901760&n)*n|0)+((65535&n)*n|0);o[i]=c^h}e[0]=o[0]+(o[7]<<16|o[7]>>>16)+(o[6]<<16|o[6]>>>16)|0,e[1]=o[1]+(o[0]<<8|o[0]>>>24)+o[7]|0,e[2]=o[2]+(o[1]<<16|o[1]>>>16)+(o[0]<<16|o[0]>>>16)|0,e[3]=o[3]+(o[2]<<8|o[2]>>>24)+o[1]|0,e[4]=o[4]+(o[3]<<16|o[3]>>>16)+(o[2]<<16|o[2]>>>16)|0,e[5]=o[5]+(o[4]<<8|o[4]>>>24)+o[3]|0,e[6]=o[6]+(o[5]<<16|o[5]>>>16)+(o[4]<<16|o[4]>>>16)|0,e[7]=o[7]+(o[6]<<8|o[6]>>>24)+o[5]|0}e.RabbitLegacy=t._createHelper(a)}(),n.RabbitLegacy)},454:function(e,t,i){var n;e.exports=(n=i(249),i(269),i(214),i(888),i(109),function(){var e=n,t=e.lib.StreamCipher,i=e.algo,s=[],r=[],o=[],a=i.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,i=0;i<4;i++)e[i]=16711935&(e[i]<<8|e[i]>>>24)|4278255360&(e[i]<<24|e[i]>>>8);var n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],s=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,i=0;i<4;i++)c.call(this);for(i=0;i<8;i++)s[i]^=n[i+4&7];if(t){var r=t.words,o=r[0],a=r[1],h=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),u=h>>>16|4294901760&l,d=l<<16|65535&h;for(s[0]^=h,s[1]^=u,s[2]^=l,s[3]^=d,s[4]^=h,s[5]^=u,s[6]^=l,s[7]^=d,i=0;i<4;i++)c.call(this)}},_doProcessBlock:function(e,t){var i=this._X;c.call(this),s[0]=i[0]^i[5]>>>16^i[3]<<16,s[1]=i[2]^i[7]>>>16^i[5]<<16,s[2]=i[4]^i[1]>>>16^i[7]<<16,s[3]=i[6]^i[3]>>>16^i[1]<<16;for(var n=0;n<4;n++)s[n]=16711935&(s[n]<<8|s[n]>>>24)|4278255360&(s[n]<<24|s[n]>>>8),e[t+n]^=s[n]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,i=0;i<8;i++)r[i]=t[i];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<r[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<r[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<r[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<r[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<r[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<r[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<r[6]>>>0?1:0)|0,this._b=t[7]>>>0<r[7]>>>0?1:0,i=0;i<8;i++){var n=e[i]+t[i],s=65535&n,a=n>>>16,c=((s*s>>>17)+s*a>>>15)+a*a,h=((4294901760&n)*n|0)+((65535&n)*n|0);o[i]=c^h}e[0]=o[0]+(o[7]<<16|o[7]>>>16)+(o[6]<<16|o[6]>>>16)|0,e[1]=o[1]+(o[0]<<8|o[0]>>>24)+o[7]|0,e[2]=o[2]+(o[1]<<16|o[1]>>>16)+(o[0]<<16|o[0]>>>16)|0,e[3]=o[3]+(o[2]<<8|o[2]>>>24)+o[1]|0,e[4]=o[4]+(o[3]<<16|o[3]>>>16)+(o[2]<<16|o[2]>>>16)|0,e[5]=o[5]+(o[4]<<8|o[4]>>>24)+o[3]|0,e[6]=o[6]+(o[5]<<16|o[5]>>>16)+(o[4]<<16|o[4]>>>16)|0,e[7]=o[7]+(o[6]<<8|o[6]>>>24)+o[5]|0}e.Rabbit=t._createHelper(a)}(),n.Rabbit)},857:function(e,t,i){var n;e.exports=(n=i(249),i(269),i(214),i(888),i(109),function(){var e=n,t=e.lib.StreamCipher,i=e.algo,s=i.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,i=e.sigBytes,n=this._S=[],s=0;s<256;s++)n[s]=s;s=0;for(var r=0;s<256;s++){var o=s%i,a=t[o>>>2]>>>24-o%4*8&255;r=(r+n[s]+a)%256;var c=n[s];n[s]=n[r],n[r]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=r.call(this)},keySize:8,ivSize:0});function r(){for(var e=this._S,t=this._i,i=this._j,n=0,s=0;s<4;s++){i=(i+e[t=(t+1)%256])%256;var r=e[t];e[t]=e[i],e[i]=r,n|=e[(e[t]+e[i])%256]<<24-8*s}return this._i=t,this._j=i,n}e.RC4=t._createHelper(s);var o=i.RC4Drop=s.extend({cfg:s.cfg.extend({drop:192}),_doReset:function(){s._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)r.call(this)}});e.RC4Drop=t._createHelper(o)}(),n.RC4)},706:function(e,t,i){var n;e.exports=(n=i(249),function(e){var t=n,i=t.lib,s=i.WordArray,r=i.Hasher,o=t.algo,a=s.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),c=s.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),h=s.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),l=s.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),u=s.create([0,1518500249,1859775393,2400959708,2840853838]),d=s.create([1352829926,1548603684,1836072691,2053994217,0]),f=o.RIPEMD160=r.extend({_doReset:function(){this._hash=s.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var i=0;i<16;i++){var n=t+i,s=e[n];e[n]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}var r,o,f,B,v,C,w,E,M,T,x,I=this._hash.words,R=u.words,S=d.words,O=a.words,D=c.words,F=h.words,_=l.words;for(C=r=I[0],w=o=I[1],E=f=I[2],M=B=I[3],T=v=I[4],i=0;i<80;i+=1)x=r+e[t+O[i]]|0,x+=i<16?p(o,f,B)+R[0]:i<32?m(o,f,B)+R[1]:i<48?g(o,f,B)+R[2]:i<64?A(o,f,B)+R[3]:y(o,f,B)+R[4],x=(x=b(x|=0,F[i]))+v|0,r=v,v=B,B=b(f,10),f=o,o=x,x=C+e[t+D[i]]|0,x+=i<16?y(w,E,M)+S[0]:i<32?A(w,E,M)+S[1]:i<48?g(w,E,M)+S[2]:i<64?m(w,E,M)+S[3]:p(w,E,M)+S[4],x=(x=b(x|=0,_[i]))+T|0,C=T,T=M,M=b(E,10),E=w,w=x;x=I[1]+f+M|0,I[1]=I[2]+B+T|0,I[2]=I[3]+v+C|0,I[3]=I[4]+r+w|0,I[4]=I[0]+o+E|0,I[0]=x},_doFinalize:function(){var e=this._data,t=e.words,i=8*this._nDataBytes,n=8*e.sigBytes;t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),e.sigBytes=4*(t.length+1),this._process();for(var s=this._hash,r=s.words,o=0;o<5;o++){var a=r[o];r[o]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}return s},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}});function p(e,t,i){return e^t^i}function m(e,t,i){return e&t|~e&i}function g(e,t,i){return(e|~t)^i}function A(e,t,i){return e&i|t&~i}function y(e,t,i){return e^(t|~i)}function b(e,t){return e<<t|e>>>32-t}t.RIPEMD160=r._createHelper(f),t.HmacRIPEMD160=r._createHmacHelper(f)}(Math),n.RIPEMD160)},783:function(e,t,i){var n,s,r,o,a,c,h,l;e.exports=(l=i(249),s=(n=l).lib,r=s.WordArray,o=s.Hasher,a=n.algo,c=[],h=a.SHA1=o.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var i=this._hash.words,n=i[0],s=i[1],r=i[2],o=i[3],a=i[4],h=0;h<80;h++){if(h<16)c[h]=0|e[t+h];else{var l=c[h-3]^c[h-8]^c[h-14]^c[h-16];c[h]=l<<1|l>>>31}var u=(n<<5|n>>>27)+a+c[h];u+=h<20?1518500249+(s&r|~s&o):h<40?1859775393+(s^r^o):h<60?(s&r|s&o|r&o)-1894007588:(s^r^o)-899497514,a=o,o=r,r=s<<30|s>>>2,s=n,n=u}i[0]=i[0]+n|0,i[1]=i[1]+s|0,i[2]=i[2]+r|0,i[3]=i[3]+o|0,i[4]=i[4]+a|0},_doFinalize:function(){var e=this._data,t=e.words,i=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(i/4294967296),t[15+(n+64>>>9<<4)]=i,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}}),n.SHA1=o._createHelper(h),n.HmacSHA1=o._createHmacHelper(h),l.SHA1)},792:function(e,t,i){var n,s,r,o,a,c;e.exports=(c=i(249),i(153),s=(n=c).lib.WordArray,r=n.algo,o=r.SHA256,a=r.SHA224=o.extend({_doReset:function(){this._hash=new s.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=o._doFinalize.call(this);return e.sigBytes-=4,e}}),n.SHA224=o._createHelper(a),n.HmacSHA224=o._createHmacHelper(a),c.SHA224)},153:function(e,t,i){var n;e.exports=(n=i(249),function(e){var t=n,i=t.lib,s=i.WordArray,r=i.Hasher,o=t.algo,a=[],c=[];!function(){function t(t){for(var i=e.sqrt(t),n=2;n<=i;n++)if(!(t%n))return!1;return!0}function i(e){return 4294967296*(e-(0|e))|0}for(var n=2,s=0;s<64;)t(n)&&(s<8&&(a[s]=i(e.pow(n,.5))),c[s]=i(e.pow(n,1/3)),s++),n++}();var h=[],l=o.SHA256=r.extend({_doReset:function(){this._hash=new s.init(a.slice(0))},_doProcessBlock:function(e,t){for(var i=this._hash.words,n=i[0],s=i[1],r=i[2],o=i[3],a=i[4],l=i[5],u=i[6],d=i[7],f=0;f<64;f++){if(f<16)h[f]=0|e[t+f];else{var p=h[f-15],m=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,g=h[f-2],A=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;h[f]=m+h[f-7]+A+h[f-16]}var y=n&s^n&r^s&r,b=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),B=d+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&l^~a&u)+c[f]+h[f];d=u,u=l,l=a,a=o+B|0,o=r,r=s,s=n,n=B+(b+y)|0}i[0]=i[0]+n|0,i[1]=i[1]+s|0,i[2]=i[2]+r|0,i[3]=i[3]+o|0,i[4]=i[4]+a|0,i[5]=i[5]+l|0,i[6]=i[6]+u|0,i[7]=i[7]+d|0},_doFinalize:function(){var t=this._data,i=t.words,n=8*this._nDataBytes,s=8*t.sigBytes;return i[s>>>5]|=128<<24-s%32,i[14+(s+64>>>9<<4)]=e.floor(n/4294967296),i[15+(s+64>>>9<<4)]=n,t.sigBytes=4*i.length,this._process(),this._hash},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=r._createHelper(l),t.HmacSHA256=r._createHmacHelper(l)}(Math),n.SHA256)},327:function(e,t,i){var n;e.exports=(n=i(249),i(938),function(e){var t=n,i=t.lib,s=i.WordArray,r=i.Hasher,o=t.x64.Word,a=t.algo,c=[],h=[],l=[];!function(){for(var e=1,t=0,i=0;i<24;i++){c[e+5*t]=(i+1)*(i+2)/2%64;var n=(2*e+3*t)%5;e=t%5,t=n}for(e=0;e<5;e++)for(t=0;t<5;t++)h[e+5*t]=t+(2*e+3*t)%5*5;for(var s=1,r=0;r<24;r++){for(var a=0,u=0,d=0;d<7;d++){if(1&s){var f=(1<<d)-1;f<32?u^=1<<f:a^=1<<f-32}128&s?s=s<<1^113:s<<=1}l[r]=o.create(a,u)}}();var u=[];!function(){for(var e=0;e<25;e++)u[e]=o.create()}();var d=a.SHA3=r.extend({cfg:r.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],t=0;t<25;t++)e[t]=new o.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,t){for(var i=this._state,n=this.blockSize/2,s=0;s<n;s++){var r=e[t+2*s],o=e[t+2*s+1];r=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),(I=i[s]).high^=o,I.low^=r}for(var a=0;a<24;a++){for(var d=0;d<5;d++){for(var f=0,p=0,m=0;m<5;m++)f^=(I=i[d+5*m]).high,p^=I.low;var g=u[d];g.high=f,g.low=p}for(d=0;d<5;d++){var A=u[(d+4)%5],y=u[(d+1)%5],b=y.high,B=y.low;for(f=A.high^(b<<1|B>>>31),p=A.low^(B<<1|b>>>31),m=0;m<5;m++)(I=i[d+5*m]).high^=f,I.low^=p}for(var v=1;v<25;v++){var C=(I=i[v]).high,w=I.low,E=c[v];E<32?(f=C<<E|w>>>32-E,p=w<<E|C>>>32-E):(f=w<<E-32|C>>>64-E,p=C<<E-32|w>>>64-E);var M=u[h[v]];M.high=f,M.low=p}var T=u[0],x=i[0];for(T.high=x.high,T.low=x.low,d=0;d<5;d++)for(m=0;m<5;m++){var I=i[v=d+5*m],R=u[v],S=u[(d+1)%5+5*m],O=u[(d+2)%5+5*m];I.high=R.high^~S.high&O.high,I.low=R.low^~S.low&O.low}I=i[0];var D=l[a];I.high^=D.high,I.low^=D.low}},_doFinalize:function(){var t=this._data,i=t.words,n=(this._nDataBytes,8*t.sigBytes),r=32*this.blockSize;i[n>>>5]|=1<<24-n%32,i[(e.ceil((n+1)/r)*r>>>5)-1]|=128,t.sigBytes=4*i.length,this._process();for(var o=this._state,a=this.cfg.outputLength/8,c=a/8,h=[],l=0;l<c;l++){var u=o[l],d=u.high,f=u.low;d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),f=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),h.push(f),h.push(d)}return new s.init(h,a)},clone:function(){for(var e=r.clone.call(this),t=e._state=this._state.slice(0),i=0;i<25;i++)t[i]=t[i].clone();return e}});t.SHA3=r._createHelper(d),t.HmacSHA3=r._createHmacHelper(d)}(Math),n.SHA3)},460:function(e,t,i){var n,s,r,o,a,c,h,l;e.exports=(l=i(249),i(938),i(34),s=(n=l).x64,r=s.Word,o=s.WordArray,a=n.algo,c=a.SHA512,h=a.SHA384=c.extend({_doReset:function(){this._hash=new o.init([new r.init(3418070365,3238371032),new r.init(1654270250,914150663),new r.init(2438529370,812702999),new r.init(355462360,4144912697),new r.init(1731405415,4290775857),new r.init(2394180231,1750603025),new r.init(3675008525,1694076839),new r.init(1203062813,3204075428)])},_doFinalize:function(){var e=c._doFinalize.call(this);return e.sigBytes-=16,e}}),n.SHA384=c._createHelper(h),n.HmacSHA384=c._createHmacHelper(h),l.SHA384)},34:function(e,t,i){var n;e.exports=(n=i(249),i(938),function(){var e=n,t=e.lib.Hasher,i=e.x64,s=i.Word,r=i.WordArray,o=e.algo;function a(){return s.create.apply(s,arguments)}var c=[a(1116352408,3609767458),a(1899447441,602891725),a(3049323471,3964484399),a(3921009573,2173295548),a(961987163,4081628472),a(1508970993,3053834265),a(2453635748,2937671579),a(2870763221,3664609560),a(3624381080,2734883394),a(310598401,1164996542),a(607225278,1323610764),a(1426881987,3590304994),a(1925078388,4068182383),a(2162078206,991336113),a(2614888103,633803317),a(3248222580,3479774868),a(3835390401,2666613458),a(4022224774,944711139),a(264347078,2341262773),a(604807628,2007800933),a(770255983,1495990901),a(1249150122,1856431235),a(1555081692,3175218132),a(1996064986,2198950837),a(2554220882,3999719339),a(2821834349,766784016),a(2952996808,2566594879),a(3210313671,3203337956),a(3336571891,1034457026),a(3584528711,2466948901),a(113926993,3758326383),a(338241895,168717936),a(666307205,1188179964),a(773529912,1546045734),a(1294757372,1522805485),a(1396182291,2643833823),a(1695183700,2343527390),a(1986661051,1014477480),a(2177026350,1206759142),a(2456956037,344077627),a(2730485921,1290863460),a(2820302411,3158454273),a(3259730800,3505952657),a(3345764771,106217008),a(3516065817,3606008344),a(3600352804,1432725776),a(4094571909,1467031594),a(275423344,851169720),a(430227734,3100823752),a(506948616,1363258195),a(659060556,3750685593),a(883997877,3785050280),a(958139571,3318307427),a(1322822218,3812723403),a(1537002063,2003034995),a(1747873779,3602036899),a(1955562222,1575990012),a(2024104815,1125592928),a(2227730452,2716904306),a(2361852424,442776044),a(2428436474,593698344),a(2756734187,3733110249),a(3204031479,2999351573),a(3329325298,3815920427),a(3391569614,3928383900),a(3515267271,566280711),a(3940187606,3454069534),a(4118630271,4000239992),a(116418474,1914138554),a(174292421,2731055270),a(289380356,3203993006),a(460393269,320620315),a(685471733,587496836),a(852142971,1086792851),a(1017036298,365543100),a(1126000580,2618297676),a(1288033470,3409855158),a(1501505948,4234509866),a(1607167915,987167468),a(1816402316,1246189591)],h=[];!function(){for(var e=0;e<80;e++)h[e]=a()}();var l=o.SHA512=t.extend({_doReset:function(){this._hash=new r.init([new s.init(1779033703,4089235720),new s.init(3144134277,2227873595),new s.init(1013904242,4271175723),new s.init(2773480762,1595750129),new s.init(1359893119,2917565137),new s.init(2600822924,725511199),new s.init(528734635,4215389547),new s.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var i=this._hash.words,n=i[0],s=i[1],r=i[2],o=i[3],a=i[4],l=i[5],u=i[6],d=i[7],f=n.high,p=n.low,m=s.high,g=s.low,A=r.high,y=r.low,b=o.high,B=o.low,v=a.high,C=a.low,w=l.high,E=l.low,M=u.high,T=u.low,x=d.high,I=d.low,R=f,S=p,O=m,D=g,F=A,_=y,G=b,L=B,P=v,k=C,N=w,U=E,H=M,j=T,J=x,V=I,z=0;z<80;z++){var K,W,Q=h[z];if(z<16)W=Q.high=0|e[t+2*z],K=Q.low=0|e[t+2*z+1];else{var X=h[z-15],Y=X.high,q=X.low,Z=(Y>>>1|q<<31)^(Y>>>8|q<<24)^Y>>>7,$=(q>>>1|Y<<31)^(q>>>8|Y<<24)^(q>>>7|Y<<25),ee=h[z-2],te=ee.high,ie=ee.low,ne=(te>>>19|ie<<13)^(te<<3|ie>>>29)^te>>>6,se=(ie>>>19|te<<13)^(ie<<3|te>>>29)^(ie>>>6|te<<26),re=h[z-7],oe=re.high,ae=re.low,ce=h[z-16],he=ce.high,le=ce.low;W=(W=(W=Z+oe+((K=$+ae)>>>0<$>>>0?1:0))+ne+((K+=se)>>>0<se>>>0?1:0))+he+((K+=le)>>>0<le>>>0?1:0),Q.high=W,Q.low=K}var ue,de=P&N^~P&H,fe=k&U^~k&j,pe=R&O^R&F^O&F,me=S&D^S&_^D&_,ge=(R>>>28|S<<4)^(R<<30|S>>>2)^(R<<25|S>>>7),Ae=(S>>>28|R<<4)^(S<<30|R>>>2)^(S<<25|R>>>7),ye=(P>>>14|k<<18)^(P>>>18|k<<14)^(P<<23|k>>>9),be=(k>>>14|P<<18)^(k>>>18|P<<14)^(k<<23|P>>>9),Be=c[z],ve=Be.high,Ce=Be.low,we=J+ye+((ue=V+be)>>>0<V>>>0?1:0),Ee=Ae+me;J=H,V=j,H=N,j=U,N=P,U=k,P=G+(we=(we=(we=we+de+((ue+=fe)>>>0<fe>>>0?1:0))+ve+((ue+=Ce)>>>0<Ce>>>0?1:0))+W+((ue+=K)>>>0<K>>>0?1:0))+((k=L+ue|0)>>>0<L>>>0?1:0)|0,G=F,L=_,F=O,_=D,O=R,D=S,R=we+(ge+pe+(Ee>>>0<Ae>>>0?1:0))+((S=ue+Ee|0)>>>0<ue>>>0?1:0)|0}p=n.low=p+S,n.high=f+R+(p>>>0<S>>>0?1:0),g=s.low=g+D,s.high=m+O+(g>>>0<D>>>0?1:0),y=r.low=y+_,r.high=A+F+(y>>>0<_>>>0?1:0),B=o.low=B+L,o.high=b+G+(B>>>0<L>>>0?1:0),C=a.low=C+k,a.high=v+P+(C>>>0<k>>>0?1:0),E=l.low=E+U,l.high=w+N+(E>>>0<U>>>0?1:0),T=u.low=T+j,u.high=M+H+(T>>>0<j>>>0?1:0),I=d.low=I+V,d.high=x+J+(I>>>0<V>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,i=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(i/4294967296),t[31+(n+128>>>10<<5)]=i,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(l),e.HmacSHA512=t._createHmacHelper(l)}(),n.SHA512)},253:function(e,t,i){var n;e.exports=(n=i(249),i(269),i(214),i(888),i(109),function(){var e=n,t=e.lib,i=t.WordArray,s=t.BlockCipher,r=e.algo,o=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],a=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],h=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],u=r.DES=s.extend({_doReset:function(){for(var e=this._key.words,t=[],i=0;i<56;i++){var n=o[i]-1;t[i]=e[n>>>5]>>>31-n%32&1}for(var s=this._subKeys=[],r=0;r<16;r++){var h=s[r]=[],l=c[r];for(i=0;i<24;i++)h[i/6|0]|=t[(a[i]-1+l)%28]<<31-i%6,h[4+(i/6|0)]|=t[28+(a[i+24]-1+l)%28]<<31-i%6;for(h[0]=h[0]<<1|h[0]>>>31,i=1;i<7;i++)h[i]=h[i]>>>4*(i-1)+3;h[7]=h[7]<<5|h[7]>>>27}var u=this._invSubKeys=[];for(i=0;i<16;i++)u[i]=s[15-i]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,i){this._lBlock=e[t],this._rBlock=e[t+1],d.call(this,4,252645135),d.call(this,16,65535),f.call(this,2,858993459),f.call(this,8,16711935),d.call(this,1,1431655765);for(var n=0;n<16;n++){for(var s=i[n],r=this._lBlock,o=this._rBlock,a=0,c=0;c<8;c++)a|=h[c][((o^s[c])&l[c])>>>0];this._lBlock=o,this._rBlock=r^a}var u=this._lBlock;this._lBlock=this._rBlock,this._rBlock=u,d.call(this,1,1431655765),f.call(this,8,16711935),f.call(this,2,858993459),d.call(this,16,65535),d.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function d(e,t){var i=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=i,this._lBlock^=i<<e}function f(e,t){var i=(this._rBlock>>>e^this._lBlock)&t;this._lBlock^=i,this._rBlock^=i<<e}e.DES=s._createHelper(u);var p=r.TripleDES=s.extend({_doReset:function(){var e=this._key.words;if(2!==e.length&&4!==e.length&&e.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var t=e.slice(0,2),n=e.length<4?e.slice(0,2):e.slice(2,4),s=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=u.createEncryptor(i.create(t)),this._des2=u.createEncryptor(i.create(n)),this._des3=u.createEncryptor(i.create(s))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=s._createHelper(p)}(),n.TripleDES)},938:function(e,t,i){var n;e.exports=(n=i(249),function(e){var t=n,i=t.lib,s=i.Base,r=i.WordArray,o=t.x64={};o.Word=s.extend({init:function(e,t){this.high=e,this.low=t}}),o.WordArray=s.extend({init:function(t,i){t=this.words=t||[],this.sigBytes=i!=e?i:8*t.length},toX32:function(){for(var e=this.words,t=e.length,i=[],n=0;n<t;n++){var s=e[n];i.push(s.high),i.push(s.low)}return r.create(i,this.sigBytes)},clone:function(){for(var e=s.clone.call(this),t=e.words=this.words.slice(0),i=t.length,n=0;n<i;n++)t[n]=t[n].clone();return e}})}(),n)},74:t=>{"use strict";t.exports=e},125:()=>{},480:()=>{}},i={};function n(e){var s=i[e];if(void 0!==s)return s.exports;var r=i[e]={exports:{}};return t[e].call(r.exports,r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};return(()=>{"use strict";n.d(s,{default:()=>ef});var e={};n.r(e),n.d(e,{decode:()=>ec,name:()=>$a});var t={};n.r(t),n.d(t,{name:()=>oc,preprocess:()=>ac});var i={};n.r(i),n.d(i,{name:()=>hc,preprocess:()=>lc});var r={};n.r(r),n.d(r,{decode:()=>mc,encode:()=>gc,name:()=>fc,preprocess:()=>pc});var o={};n.r(o),n.d(o,{decode:()=>Gc,name:()=>Oc});var a={};n.r(a),n.d(a,{decode:()=>Hc,encode:()=>jc,name:()=>Uc});var c={};n.r(c),n.d(c,{decode:()=>zc,encode:()=>Kc,name:()=>Vc});var h={};n.r(h),n.d(h,{decode:()=>Xc,encode:()=>Yc,name:()=>Qc});var l={};n.r(l),n.d(l,{decode:()=>eh,name:()=>$c});var u,d=n(74);class f{constructor(e){this.isMove=0,this.waitingTime=5,this.touchtime=0,this.app=e}registerAfterRender(){(new Date).getTime()-this.touchtime>1e3*this.waitingTime&&this.app.camera._isAutoRotation&&(this.app.camera.arcRotateCamera.alpha+=this.app.camera.autoRotationSpeed)}runRender(){}onPointer(e){switch(this.touchtime=(new Date).getTime(),e.type){case d.PointerEventTypes.POINTERDOWN:this.isMove=0;case d.PointerEventTypes.POINTERMOVE:if(this.isMove++,!this.app.toolTips)return;e?this.app.toolTips.update(e):this.app.toolTips.close();break;case d.PointerEventTypes.POINTERWHEEL:this.app.camera._wheel(e.event),e.event.preventDefault();break;case d.PointerEventTypes.POINTERUP:if(this.isMove>2)return;e.pickInfo.pickedMesh||2!=e.event.button||this.app.project.goBack()}}onKeyboard(e){if(this.touchtime=(new Date).getTime(),e.type===d.KeyboardEventTypes.KEYDOWN)70===e.event.keyCode&&prompt("请复制输入框内的视角参数",this.app.camera.getSightJson())}}class p{constructor(e){this.isFPS=!1,this.angle=Math.PI/2,this.direction=new d.Vector3(Math.cos(this.angle),0,Math.sin(this.angle)),this.isMoveLeft=!1,this.isMoveRight=!1,this.isMoveDown=!1,this.isMoveUp=!1,this.app=e,this.isFPS=!1}registerAfterRender(){}runRender(){if(this.app.scene.activeCamera instanceof d.FreeCamera&&(this.isMoveDown||this.isMoveLeft||this.isMoveRight||this.isMoveUp)){var e=this.app.camera.freeCamera.speed;this.isMoveLeft?(this.app.camera.freeCamera.rotation.y+=e,this.direction.copyFromFloats(0,0,0)):this.isMoveUp?this.direction.copyFromFloats(0,0,e):this.isMoveRight?(this.app.camera.freeCamera.rotation.y-=e,this.direction.copyFromFloats(0,0,0)):this.isMoveDown&&this.direction.copyFromFloats(0,0,-e),this.app.camera.freeCamera.getScene().useRightHandedSystem&&(this.direction.z*=-1),this.app.camera.freeCamera.getViewMatrix().invertToRef(this.app.camera.freeCamera._cameraTransformMatrix),d.Vector3.TransformNormalToRef(this.direction,this.app.camera.freeCamera._cameraTransformMatrix,this.app.camera.freeCamera._transformedDirection),this.app.camera.freeCamera.cameraDirection.addInPlace(this.app.camera.freeCamera._transformedDirection)}}onPointer(e){switch(e.type){case d.PointerEventTypes.POINTERUP:if(this.isFPS)return;this.app.camera.freeCamera.position=d.Vector3.Zero(),this.app.camera.freeCamera.position.y=this.app.project.current.instance.position.y+1.5,this.app.scene.activeCamera=this.app.camera.freeCamera,this.app.camera.freeCamera.attachControl(this.app.canvas,!0),this.isFPS=!0;break;case d.PointerEventTypes.POINTERMOVE:break;case d.PointerEventTypes.POINTERWHEEL:e.event.preventDefault()}}onKeyboard(e){}}class m{static vector3ToJson(e){return{x:Math.floor(1e3*e.x)/1e3,y:Math.floor(1e3*e.y)/1e3,z:Math.floor(1e3*e.z)/1e3}}static vector3ARRToJson(e){let t=[];return e.forEach((e=>t.push({x:Math.floor(1e3*e.x)/1e3,y:Math.floor(1e3*e.y)/1e3,z:Math.floor(1e3*e.z)/1e3}))),t}static ToVector3(e){return new d.Vector3(Math.floor(1e3*e.x)/1e3,Math.floor(1e3*e.y)/1e3,Math.floor(1e3*e.z)/1e3)}static ToARRVector3(e){let t=[];return e.forEach((e=>t.push(new d.Vector3(Math.floor(1e3*e.x)/1e3,Math.floor(1e3*e.y)/1e3,Math.floor(1e3*e.z)/1e3)))),t}static computeBounds(e){let t=e.getChildMeshes(),i=e.getBoundingInfo();if(t.length>0){for(var n=t[0].getBoundingInfo(),s=n.minimum.add(t[0].position),r=n.maximum.add(t[0].position),o=1;o<t.length;o++)n=t[o].getBoundingInfo(),s=d.Vector3.Minimize(s,n.minimum.add(t[o].position)),r=d.Vector3.Maximize(r,n.maximum.add(t[o].position));i=new d.BoundingInfo(s,r)}return i}static computeBoundsToARR(e){for(var t=e[0].getBoundingInfo(),i=t.minimum.add(e[0].position),n=t.maximum.add(e[0].position),s=1;s<e.length;s++)t=e[s].getBoundingInfo(),i=d.Vector3.Minimize(i,t.minimum.add(e[s].position)),n=d.Vector3.Maximize(n,t.maximum.add(e[s].position));return new d.BoundingInfo(i,n)}static Expand(e,t){let i=new Array,n=e.length;for(let s=0;s<n;s++){let r=e[s],o=e[0==s?n-1:s-1],a=e[s==n-1?0:s+1],c=o.x-r.x,h=o.z-r.z,l=this.norm(c,h);c/=l,h/=l;let u=a.x-r.x,f=a.z-r.z,p=this.norm(u,f);u/=p,f/=p;let m=-t/Math.sqrt((1-(c*u+h*f))/2),g=c+u,A=h+f,y=0==this.norm(g,A)?0:m/this.norm(g,A);g*=y,A*=y,i[s]=new d.Vector3(g+r.x,0,A+r.z)}return i}static norm(e,t){return Math.sqrt(e*e+t*t)}static MergeMeshes(e,t){let i=new d.Mesh((new Date).getDate().toString(),t.scene);return setTimeout((()=>{let t,n=null;for(let i=0;i<e.length;i++)if(e[i]){var s=e[i],r=s.computeWorldMatrix(!0);t=d.VertexData.ExtractFromMesh(s,!0,!0),t.transform(r),n?n.merge(t,!0):n=t,s.dispose(!1,!0)}n.applyToMesh(i)})),i}static DeconsTructMesh(e,t,i){if(e.subMeshes.length>1){for(var n=d.VertexData.ExtractFromMesh(e,!0,!0),s=n.indices,r=n.normals,o=n.positions,a=n.uvs,c=new Array,h=0;h<e.subMeshes.length;h++){for(var l=new d.VertexData,u=s.slice(e.subMeshes[h].indexStart,e.subMeshes[h].indexStart+e.subMeshes[h].indexCount),f=r.slice(3*e.subMeshes[h].verticesStart,3*e.subMeshes[h].verticesStart+3*e.subMeshes[h].verticesCount),p=o.slice(3*e.subMeshes[h].verticesStart,3*e.subMeshes[h].verticesStart+3*e.subMeshes[h].verticesCount),m=a.slice(2*e.subMeshes[h].verticesStart,2*e.subMeshes[h].verticesStart+2*e.subMeshes[h].verticesCount),g=0;g<u.length;g++)u[g]=u[g]-e.subMeshes[h].verticesStart;l.indices=u,l.normals=f,l.positions=p,l.uvs=m;var A=new d.Mesh(e.id+"-"+h,i.scene);l.applyToMesh(A),A.position.y=parseFloat(t),A.setEnabled(!1),c.push(A)}return e.dispose(!1,!0),c}return[e]}static getVisualAngle(e,t){let i={},n=e.boundingSphere.radiusWorld,s=t.engine.getAspectRatio(t.camera.arcRotateCamera),r=t.camera.arcRotateCamera.fov/1.2;return s<1&&(r=Math.atan(s*Math.tan(t.camera.arcRotateCamera.fov/2))),i.radius=1.1*Math.abs(n/Math.sin(r)),i.alpha=Math.PI/2,i.beta=Math.PI/3,i.focus=e.boundingSphere.center.clone(),i}static pathTransformation(e,t){let i=new d.Path3D(e).getTangents(),n=[];for(let s=0;s<e.length;s++)if(s>0&&s<e.length-1){let r=e[s-1],o=e[s+1],a=e[s],c=i[s-1],h=i[s];if(!c.equals(h)){let e=d.Vector3.Lerp(a,r,t/d.Vector3.Distance(r,a)),i=d.Vector3.Lerp(a,o,t/d.Vector3.Distance(o,a)),s=d.Curve3.CreateQuadraticBezier(e,a,i,10);n=n.concat(s.getPoints())}}else n.push(e[s]);return n}static createTube(e,t,i=.05,n){return d.MeshBuilder.CreateTube(e,{path:this.pathTransformation(t,i),radius:i/2},n.scene)}static getAngleFromVector2(e,t,i){const n=(e.x-t.x)*(i.x-t.x)+(e.y-t.y)*(i.y-t.y),s=(e.x-t.x)*(i.y-t.y)-(e.y-t.y)*(i.x-t.x),r=Math.atan2(s,n);return Math.PI-r}static getAngleFromVector3(e,t,i){return this.getAngleFromVector2(new d.Vector2(e.x,e.z),new d.Vector2(t.x,t.z),new d.Vector2(i.x,i.z))}static RandomNumBoth(e,t){var i=t-e,n=Math.random();return e+Math.round(n*i)}static rand(e,t){return Math.floor(Math.random()*(t-e+1)+e)}}class g{constructor(e){this._isAutoRotation=!1,this.autoRotationSpeed=.01,this.app=e,this.arcRotateCamera=new d.ArcRotateCamera("arcRotateCamera",-Math.PI/4,Math.PI/4,50,new d.Vector3(0,0,0),this.app.scene),this.arcRotateCamera.pinchPrecision=200,this.arcRotateCamera.minZ=.3,this.arcRotateCamera.wheelDeltaPercentage=.01,this.frustrum=5,this.freeCamera=new d.FreeCamera("FreeCamera",d.Vector3.Zero(),this.app.scene),this.freeCamera.minZ=.45,this.freeCamera.speed=.01,this.freeCamera.keysUp=[87],this.freeCamera.keysDown=[83],this.freeCamera.keysLeft=[65],this.freeCamera.keysRight=[68],this.switchArcRotateCamera()}orthographic(e){e||(e=this.app.project.current),this.arcRotateCamera.lowerBetaLimit=0,this.arcRotateCamera.upperBetaLimit=0,this.arcRotateCamera.lowerAlphaLimit=Math.PI/2,this.arcRotateCamera.upperAlphaLimit=Math.PI/2,this.arcRotateCamera.mode=d.Camera.ORTHOGRAPHIC_CAMERA,this.arcRotateCamera.lowerRadiusLimit=2*e.Sight.radius,this.arcRotateCamera.radius=e.Sight.radius,this.arcRotateCamera.target=e.Sight.focus.clone(),this.frustrum=.5*e.Sight.radius,this.computeCameraView()}startAutoRotation(e){e&&(this.autoRotationSpeed=e),this._isAutoRotation=!0}stopAutoRotation(){this._isAutoRotation=!1}perspective(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,e||(e=this.app.project.current),this.arcRotateCamera.lowerRadiusLimit=e.Sight.minimumLimit?e.Sight.minimumLimit:1,this.arcRotateCamera.upperRadiusLimit=e.Sight.maximumLimit?e.Sight.maximumLimit:3e3,this.arcRotateCamera.panningSensibility=1e3,this.arcRotateCamera.lowerBetaLimit=e.Sight.minBeta?e.Sight.minBeta:.01,this.arcRotateCamera.upperBetaLimit=e.Sight.maxBeta?e.Sight.maxBeta:Math.PI/2*.98,this.arcRotateCamera.lowerAlphaLimit=null,this.arcRotateCamera.upperAlphaLimit=null,this.arcRotateCamera.mode=d.Camera.PERSPECTIVE_CAMERA,(this.arcRotateCamera.alpha>2*Math.PI||this.arcRotateCamera.alpha<-2*Math.PI)&&(this.arcRotateCamera.alpha=this.arcRotateCamera.alpha-Math.floor(this.arcRotateCamera.alpha/(2*Math.PI))*(2*Math.PI));var t=new d.Animation("camtarget","target",30,d.Animation.ANIMATIONTYPE_VECTOR3,d.Animation.ANIMATIONLOOPMODE_CYCLE);t.setKeys([{frame:0,value:this.arcRotateCamera.target},{frame:30,value:e.Sight.focus.clone()}]);var i=new d.Animation("camAlpha","alpha",30,d.Animation.ANIMATIONTYPE_FLOAT,d.Animation.ANIMATIONLOOPMODE_CYCLE);i.setKeys([{frame:0,value:this.arcRotateCamera.alpha},{frame:30,value:e.Sight.alpha}]);var n=new d.Animation("camRadius","radius",30,d.Animation.ANIMATIONTYPE_FLOAT,d.Animation.ANIMATIONLOOPMODE_CYCLE);n.setKeys([{frame:0,value:this.arcRotateCamera.radius},{frame:30,value:e.Sight.radius}]);var s=new d.Animation("camBeta","beta",30,d.Animation.ANIMATIONTYPE_FLOAT,d.Animation.ANIMATIONLOOPMODE_CYCLE);s.setKeys([{frame:0,value:this.arcRotateCamera.beta},{frame:30,value:e.Sight.beta}]),this.app.scene.beginDirectAnimation(this.arcRotateCamera,[t,i,n,s],0,60,!1),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}flyTo(e,t=.5){e||(e=this.app.project.current.Sight),this.arcRotateCamera.mode=d.Camera.PERSPECTIVE_CAMERA;var i=20,n=new d.Animation("camTarget","target",i,d.Animation.ANIMATIONTYPE_VECTOR3,d.Animation.ANIMATIONLOOPMODE_CONSTANT);n.setKeys([{frame:0,value:this.arcRotateCamera.target},{frame:i,value:e.focus.clone()}]);var s=new d.Animation("camRadius","radius",i,d.Animation.ANIMATIONTYPE_FLOAT,d.Animation.ANIMATIONLOOPMODE_CYCLE);s.setKeys([{frame:i,value:this.arcRotateCamera.radius},{frame:40,value:e.radius}]),this.app.scene.beginDirectAnimation(this.arcRotateCamera,[n,s],0,40,!1),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}flyToObject(e,t=.5){this.flyTo(e.Sight,t)}lookToTheFront(e,t=.5){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.arcRotateCamera.lowerRadiusLimit=e.Sight.minimumLimit?e.Sight.minimumLimit:1,this.arcRotateCamera.upperRadiusLimit=e.Sight.maximumLimit?e.Sight.maximumLimit:3e3,this.arcRotateCamera.panningSensibility=1e3,this.arcRotateCamera.lowerBetaLimit=e.Sight.minBeta?e.Sight.minBeta:.01,this.arcRotateCamera.upperBetaLimit=e.Sight.maxBeta?e.Sight.maxBeta:Math.PI/2*.98,this.arcRotateCamera.lowerAlphaLimit=null,this.arcRotateCamera.upperAlphaLimit=null,this.arcRotateCamera.mode=d.Camera.PERSPECTIVE_CAMERA;let i=Math.atan2(-e.instance.forward.z,-e.instance.forward.x);(this.arcRotateCamera.alpha>2*Math.PI||this.arcRotateCamera.alpha<-2*Math.PI)&&(this.arcRotateCamera.alpha=this.arcRotateCamera.alpha-Math.floor(this.arcRotateCamera.alpha/(2*Math.PI))*(2*Math.PI));var n=new d.Animation("camtarget","target",30,d.Animation.ANIMATIONTYPE_VECTOR3,d.Animation.ANIMATIONLOOPMODE_CYCLE);n.setKeys([{frame:0,value:this.arcRotateCamera.target},{frame:30*t,value:e.Sight.focus.clone()}]);var s=new d.Animation("camAlpha","alpha",30,d.Animation.ANIMATIONTYPE_FLOAT,d.Animation.ANIMATIONLOOPMODE_CYCLE);s.setKeys([{frame:0,value:this.arcRotateCamera.alpha},{frame:30*t,value:i}]);var r=new d.Animation("camRadius","radius",30,d.Animation.ANIMATIONTYPE_FLOAT,d.Animation.ANIMATIONLOOPMODE_CYCLE);r.setKeys([{frame:0,value:this.arcRotateCamera.radius},{frame:30*t,value:e.Sight.radius/1.2}]);var o=new d.Animation("camBeta","beta",30,d.Animation.ANIMATIONTYPE_FLOAT,d.Animation.ANIMATIONLOOPMODE_CYCLE);o.setKeys([{frame:0,value:this.arcRotateCamera.beta},{frame:30*t,value:Math.PI/2}]),this.app.scene.beginDirectAnimation(this.arcRotateCamera,[n,s,r,o],0,30*t,!1),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}getSightJson(){return JSON.stringify({alpha:this.arcRotateCamera.alpha,focus:m.vector3ToJson(this.arcRotateCamera.target),radius:this.arcRotateCamera.radius,beta:this.arcRotateCamera.beta,minimumLimit:this.arcRotateCamera.lowerRadiusLimit,maximumLimit:this.arcRotateCamera.upperRadiusLimit,minBeta:this.arcRotateCamera.lowerBetaLimit,maxBeta:this.arcRotateCamera.upperBetaLimit})}computeCameraView(){const e=this.app.canvas.clientWidth/this.app.canvas.clientHeight;this.arcRotateCamera.orthoLeft=-e*this.frustrum,this.arcRotateCamera.orthoRight=e*this.frustrum,this.arcRotateCamera.orthoTop=this.frustrum,this.arcRotateCamera.orthoBottom=-this.frustrum;let t=1e3/(this.frustrum/20);this.arcRotateCamera.panningSensibility=t>2e3?2e3:t<10?10:t}_wheel(e){if(this.arcRotateCamera.mode!=d.Camera.PERSPECTIVE_CAMERA){var t=(e.wheelDelta||24*-e.detail)<0?1.1:.9;this.frustrum*=t,this.computeCameraView()}else{let e=1e3/(this.app.camera.arcRotateCamera.radius/20);this.app.camera.arcRotateCamera.panningSensibility=e>2e3?2e3:e<10?10:e}}switchArcRotateCamera(){this.app.scene.activeCamera=this.arcRotateCamera,this.arcRotateCamera.attachControl(this.app.canvas,!0,!0),this.app.iEvent=new f(this.app)}switchFPSCamera(){this.app.iEvent=new p(this.app)}}class A{constructor(){this.map={}}add(e,t){this.map[e]=t}find(e){return this.map[e]}remove(e){delete this.map[e]}termRemove(e){for(var t in this.map)e(this.map[t])&&delete this.map[t]}showAll(){for(var e in this.map)e+" -> "+this.map[e]+"; "}count(){var e=0;for(var t in Object.keys(this.map))++e;return e}clear(){for(var e in this.map)delete this.map[e]}}class y{static getGUID(e){var t,i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=[];let s=i.length;var r;if(e)for(t=0;t<e;t++)n[t]=i[0|Math.random()*s];else for(n[8]=n[13]=n[18]=n[23]="-",n[14]="4",t=0;t<36;t++)n[t]||(r=0|16*Math.random(),n[t]=i[19==t?3&r|8:r]);return n.join("")}}class b{constructor(e){this.objectType="Light",this.app=e}load(){}}class B extends b{load(){this.light=new d.DirectionalLight(this.id,this.direction,this.app.scene),this.light.position=this.position,this.light.intensity=this.intensity,this.light.diffuse=d.Color3.FromHexString(this.color),this.light.specular=d.Color3.Black()}}class v extends b{load(){this.light=new d.HemisphericLight(this.id,this.direction,this.app.scene),this.light.intensity=this.intensity,this.light.diffuse=d.Color3.FromHexString(this.color),this.light.specular=d.Color3.Black()}}!function(e){e.Point="Point",e.Spot="Spot",e.Directional="Directional",e.Hemispheric="Hemispheric"}(u||(u={}));class C extends b{load(){this.light=new d.PointLight(this.id,this.position.clone(),this.app.scene),this.light.range=this.range,this.light.intensity=this.intensity,this.light.diffuse=d.Color3.FromHexString(this.color),this.light.specular=d.Color3.Black()}}class w extends b{load(){this.light=new d.SpotLight(this.id,this.position.clone(),this.direction.clone(),this.angle*Math.PI/180,this.exponent,this.app.scene),this.light.range=this.range,this.light.position=this.position,this.light.intensity=this.intensity,this.light.diffuse=d.Color3.FromHexString(this.color),this.light.specular=d.Color3.Black()}}class E{set text(e){this._text=e,this.ele.innerText=e,e?this.ele.style.display=null:this.close()}constructor(e){this._text="",this.app=e,this.ele=document.createElement("div"),this.ele.style.cssText="position: absolute;z-index:999999999; font-size: 10px;color: rgb(211, 211, 211);text-shadow:rgba(0, 0, 0, 0.2) 1px 1px 0; padding: 8px 10px;border: 1px solid #353535;background: #292929;border-radius: 20%;",this.app.canvas.parentElement.appendChild(this.ele),this.close()}update(e){this._text&&(this.ele.style.top=e.event.offsetY+"px",this.ele.style.left=e.event.offsetX+20+"px")}close(){this.ele.style.display="none"}setBackground(e){this.url=e,this.ele.style.background="url("+this.url+") no-repeat",this.ele.style.backgroundSize="cover"}dispose(){this.app.canvas.parentElement.removeChild(this.ele),this.ele=null}}class M{constructor(e){this.lights=new A,this.reflexEnabled=!0,this.reflexIntensity=.5,this.app=e,this.color=new d.Color4(0,.0588,.1176,1),this.reflex(ef.rl+"resources/environment.env",.5),this.app.scene.fogEnabled=!0,this.app.scene.fogMode=2,this.fogDistance=800,d.Effect.IncludesShadersStore.fogVertex="\n #ifdef FOG\n vFogDistance=(worldPos).xyz;\n #endif\n "}setTransparent(e=1){this.app.scene.clearColor=new d.Color4(this._color.r,this._color.g,this._color.b,this._color.a*e)}default(){this.color=new d.Color4(0,.0588,.1176,1)}set fogDistance(e){this.app.scene.fogDensity=1/e}set color(e){this._color=new d.Color4(e.r,e.g,e.b,e.a),this.app.scene.clearColor=this._color,this.app.scene.fogColor=new d.Color3(this._color.r,this._color.g,this._color.b)}reflex(e,t){const i=new d.CubeTexture(e,this.app.scene);this.app.scene.environmentTexture=i,this.app.scene.environmentIntensity=t}setBackground(e){this.background&&this.background.dispose(),this.background=new d.Layer("background",e,this.app.scene),this.background.isBackground=!0}setReflexEnabled(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.reflexEnabled=e,this.app.scene.environmentIntensity=this.reflexEnabled?this.reflexIntensity:0,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setFlexIntensity(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.reflexIntensity=e,this.app.scene.environmentIntensity=this.reflexIntensity,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}defaultLights(){let e=new v(this.app);e.id=y.getGUID(12),e.lightType="Hemispheric",e.name="半球光_"+this.lights.count(),e.direction=new d.Vector3(1,1,0),e.color="#FFFFFF",e.intensity=1,this.lights.add(e.id,e);let t=new v(this.app);t.id=y.getGUID(12),t.lightType="Hemispheric",t.name="半球光_"+this.lights.count(),t.direction=new d.Vector3(-1,1,0),t.color="#FFFFFF",t.intensity=.7,this.lights.add(t.id,t)}offAllLight(){for(const e in this.lights.map)this.lights.find(e).light&&(this.lights.find(e).light.intensity=0,this.app.scene.removeLight(this.lights.find(e).light),this.lights.find(e).light.dispose()),this.lights.find(e).light=null}openAllLight(){for(const e in this.lights.map)this.lights.find(e).load()}loadLight(e){for(let t=0;t<e.length;t++){const i=e[t];let n;i.lightType==u.Hemispheric?(n=new v(this.app),n.id=i.id,n.lightType=i.lightType,n.name=i.name,n.direction=m.ToVector3(i.direction),n.color=i.color,n.intensity=i.intensity):i.lightType==u.Directional?(n=new B(this.app),n.id=i.id,n.lightType=i.lightType,n.name=i.name,n.direction=m.ToVector3(i.direction),n.position=m.ToVector3(i.position),n.color=i.color,n.intensity=i.intensity):i.lightType==u.Spot?(n=new w(this.app),n.id=i.id,n.lightType=i.lightType,n.name=i.name,n.direction=m.ToVector3(i.direction),n.position=m.ToVector3(i.position),n.angle=i.angle,n.exponent=i.exponent,n.range=i.range,n.color=i.color,n.intensity=i.intensity):i.lightType==u.Point&&(n=new C(this.app),n.id=i.id,n.lightType=i.lightType,n.name=i.name,n.position=m.ToVector3(i.position),n.range=i.range,n.color=i.color,n.intensity=i.intensity),n&&this.lights.add(n.id,n)}this.lights.count()<1&&this.defaultLights(),this.openAllLight()}setLightIntensity(e=1){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.lights;for(const t in this.lights.map)this.lights.find(t).light.intensity=this.lights.find(t).intensity*e;this.app.scene.environmentIntensity=this.reflexIntensity*e,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}showTips(){this.app.toolTips=new E(this.app)}closeTips(){this.app.toolTips&&this.app.toolTips.dispose(),this.app.toolTips=null}showFps(e="position: absolute;left: 5px;bottom: 5px;z-index:999999999; font-size: 10px;color: rgb(0, 255, 0);text-shadow:rgba(0, 0, 0, 0.2) 1px 1px 0;"){this.app.fps||(this.app.fps=document.createElement("div"),this.app.canvas.parentElement.appendChild(this.app.fps)),this.app.fps.style.cssText=e}hideFps(){this.app.fps&&this.app.canvas.parentElement.removeChild(this.app.fps),this.app.fps=null}showDebug(){this.app.scene.debugLayer.show()}}var T,x,I;!function(e){e.Cabinet="Cabinet",e.RackModel="RackModel",e.Corner="Corner",e.Other="Other",e.Door="Door",e.Floor="Floor",e.LeakWater="LeakWater",e.UI3D="UI3D",e.VirtualBox="VirtualBox",e.Wall="Wall",e.Window="Window",e.Conduit="Conduit",e.Building="Building",e.Storey="Storey",e.Campus="Campus"}(T||(T={})),function(e){e.leftClick="leftClick",e.rightClick="rightClick",e.doubleClick="doubleClick",e.eover="eover",e.longPress="longPress",e.out="out",e.click="click"}(x||(x={}));class R{toJosn(e){let t=JSON.parse(e);this.alpha=t.alpha,this.beta=t.beta,this.radius=t.radius,this.minimumLimit=t.minimumLimit,this.maximumLimit=t.maximumLimit,this.minBeta=t.minBeta,this.maxBeta=t.maxBeta,this.focus=m.ToVector3(t.focus)}toString(){return JSON.stringify({alpha:this.alpha,focus:m.vector3ToJson(this.focus),radius:this.radius,beta:this.beta,minimumLimit:this.minimumLimit,maximumLimit:this.maximumLimit,minBeta:this.minBeta,maxBeta:this.maxBeta})}setLimit(e,t){this.minimumLimit=e+.3,this.maximumLimit=t}setBeta(e,t){this.minBeta=e,this.maxBeta=t}}!function(e){e[e.Opaque=0]="Opaque",e[e.Flash=1]="Flash",e[e.Transparent=2]="Transparent"}(I||(I={}));class S{constructor(e){this.statusType=I.Opaque,this.app=e}getInto(){}goBack(){}loadProperties(e){this.id="墙角_"+y.getGUID(12),this.name="墙角",this.parentId=e.parentId,this.customNumber=this.id,this.objectType=T.Corner,this.customType=this.objectType,this.height=e.height,this.pints=e.corners}alwaysActive(){this.instance.getChildMeshes().forEach((e=>{e.alwaysSelectAsActiveMesh=!0,e.doNotSyncBoundingInfo=!1,e.ignoreNonUniformScaling=!0})),this.instance.alwaysSelectAsActiveMesh=!0,this.instance.doNotSyncBoundingInfo=!1}optimization(e){this.instance.getChildMeshes().forEach((t=>{e?t.freezeWorldMatrix():t.unfreezeWorldMatrix()})),e?this.instance.freezeWorldMatrix():this.instance.unfreezeWorldMatrix(),this.instance.material&&(e?this.instance.material.freeze():this.instance.material.unfreeze())}setFlash(e){}setEnabled(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.setEnabled(e),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}addEventListener(e,t){}removeEventListener(e){}computeView(){}bind(){let e=new Array;for(let t=0;t<this.pints.length;t++)if(this.pints[t].pints.length>2){let i=d.MeshBuilder.CreatePolygon(this.id,{shape:this.pints[t].pints,sideOrientation:d.Mesh.FRONTSIDE},this.app.scene);i.setEnabled(!1),i.position.y=this.pints[t].height,i.isPickable=!0,i.enablePointerMoveEvents=!1,e.push(i)}return!(e.length<1)&&(e.length>1?this.instance=m.MergeMeshes(e,this.app):this.instance=e[0],this.instance.id=this.id,this.instance.name=this.id,this.instance.position.y=this.height,this.instance.setEnabled(!1),this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1,!0)}toJson(){return{id:this.id,parentId:this.parentId,name:this.name,customNumber:this.customNumber,customType:this.customType,objectType:this.objectType}}completed(){this.alwaysActive(),this.optimization(!0)}setOpaque(){this.setEnabled(!0),this.statusType=I.Opaque}setTransparent(){this.setEnabled(!1),this.statusType=I.Transparent}}class O{static init(){let e=new d.TWEEN.Tween(this.colors[1]).to({r:1,g:0,b:0},500),t=new d.TWEEN.Tween(this.colors[1]).to({r:1,g:.5,b:.5},500);t.chain(e),e.chain(t),e.start();let i=new d.TWEEN.Tween(this.colors[2]).to({r:1,g:.55,b:0},500),n=new d.TWEEN.Tween(this.colors[2]).to({r:0,g:0,b:0},500);i.chain(n),n.chain(i),i.start();let s=new d.TWEEN.Tween(this.colors[3]).to({r:1,g:.84,b:0},500),r=new d.TWEEN.Tween(this.colors[3]).to({r:0,g:0,b:0},500);s.chain(r),r.chain(s),s.start();let o=new d.TWEEN.Tween(this.colors[4]).to({r:0,g:.75,b:1},500),a=new d.TWEEN.Tween(this.colors[4]).to({r:0,g:0,b:0},500);o.chain(a),a.chain(o),o.start();let c=new d.TWEEN.Tween(this.colors[5]).to({r:.53,g:.8,b:0},500),h=new d.TWEEN.Tween(this.colors[5]).to({r:0,g:0,b:0},500);c.chain(h),h.chain(c),c.start();let l=new d.TWEEN.Tween(this.colors[6]).to({r:.8,g:.8,b:.8},500),u=new d.TWEEN.Tween(this.colors[6]).to({r:0,g:0,b:0},500);l.chain(u),u.chain(l),l.start()}}O.colors={1:d.Color3.Red(),2:new d.Color3(1,.5,0),3:d.Color3.Yellow(),4:new d.Color3(0,1,1),5:d.Color3.Green(),6:d.Color3.Gray()};class D{constructor(e){this.executes=new A,this.clickEvents=new A,this.touchtime=(new Date).getTime(),this.statusType=I.Opaque,this.app=e}loadProperties(e){this.id=e.id,this.customNumber=e.customNumber,this.parentId=e.parentId,this.name=e.name,this.baseModel=e.baseModel,this.isLoop=e.isLoop,this.objectType=e.objectType,this.customType=e.customType,this.position=m.ToVector3(e.position),this.rotation=m.ToVector3(e.rotation),this.scaling=m.ToVector3(e.scaling)}setEnabled(e){if(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach((e=>e.dispose())),e){let e=new d.Mesh(this.id,this.app.scene);this.app.resources.resources.find(this.baseModel.modelId).meshes[0].getChildMeshes().forEach((t=>{var i=t.createInstance(this.id);i.isPickable=!1,i.enablePointerMoveEvents=!1,i.parent=e})),e.rotation=m.ToVector3(this.rotation.clone()),e.position=m.ToVector3(this.position.clone()),e.scaling=m.ToVector3(this.scaling.clone()),this.instance.addChild(e),this.alwaysActive(),this.optimization(!0)}this.instance.setEnabled(e),this.isPickable=e,this.statusType=I.Opaque,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}set showBoundingBox(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.showBoundingBox=e,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}get showBoundingBox(){return this.instance.showBoundingBox}set isPickable(e){e?(this.instance.isPickable=this.executes.count()>0,this.executes.find(x.eover)||this.executes.find(x.out)?this.instance.enablePointerMoveEvents=!0:this.instance.enablePointerMoveEvents=!1):(this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1)}get isPickable(){return this.instance.isPickable}bind(){let e=this.app.resources.resources.find(this.baseModel.modelId),t=m.computeBounds(e.meshes[0]);this.instance=this.app.resources.BOX.clone(this.id),this.instance.id=this.id,this.instance.enablePointerMoveEvents=!1,this.instance.isPickable=!1,this.instance.scaling=new d.Vector3((t.maximum.x-t.minimum.x)*this.scaling.x,(t.maximum.y-t.minimum.y)*this.scaling.y,(t.maximum.z-t.minimum.z)*this.scaling.z),0==this.instance.scaling.y&&(this.instance.scaling.y=.01),this.instance.position=m.ToVector3(this.position.clone()),this.instance.position.y=(t.maximum.y-t.minimum.y)/2+this.position.y,this.instance.rotation=m.ToVector3(this.rotation.clone()),this.instance.setEnabled(!1),this.completed()}completed(){this.alwaysActive(),this.optimization(!0),this.computeView()}computeView(){this.Sight=new R;let e=this.instance.getBoundingInfo(),t=m.getVisualAngle(e,this.app);this.Sight.alpha=t.alpha,this.Sight.beta=t.beta,this.Sight.focus=this.instance.getAbsolutePosition(),this.Sight.radius=5*e.boundingSphere.radius,this.Sight.minimumLimit=.3,this.Sight.maximumLimit=2*this.Sight.radius,this.Sight.minBeta=.01,this.Sight.maxBeta=Math.PI/2*.98}optimization(e){this.instance.getChildMeshes().forEach((t=>{e?t.freezeWorldMatrix():t.unfreezeWorldMatrix()})),e?this.instance.freezeWorldMatrix():this.instance.unfreezeWorldMatrix(),this.instance.material&&(e?this.instance.material.freeze():this.instance.material.unfreeze())}alwaysActive(){this.instance.getChildMeshes().forEach((e=>{e.alwaysSelectAsActiveMesh=!0,e.doNotSyncBoundingInfo=!1,e.ignoreNonUniformScaling=!0})),this.instance.alwaysSelectAsActiveMesh=!0,this.instance.doNotSyncBoundingInfo=!1}addEventListener(e,t){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let i=null;if(e==x.leftClick||e==x.rightClick||e==x.doubleClick?(this.clickEvents.remove(e),this.clickEvents.add(e,t),this.instance.isPickable=!0,i=new d.ExecuteCodeAction(d.ActionManager.OnPickTrigger,(e=>{let t=this.clickEvents.find(x.leftClick);t&&0==e.sourceEvent.button&&t(this,e);let i=this.clickEvents.find(x.rightClick);i&&2==e.sourceEvent.button&&i(this,e);let n=this.clickEvents.find(x.doubleClick);n&&0==e.sourceEvent.button&&(new Date).getTime()-this.touchtime<500&&n(this,e),this.touchtime=(new Date).getTime()})),e=x.click):e==x.eover?(i=new d.ExecuteCodeAction(d.ActionManager.OnPointerOverTrigger,(e=>t(this,e))),this.instance.enablePointerMoveEvents=!0):e==x.longPress?i=new d.ExecuteCodeAction(d.ActionManager.OnLongPressTrigger,(e=>t(this,e))):e==x.out&&(i=new d.ExecuteCodeAction(d.ActionManager.OnPointerOutTrigger,(e=>t(this,e))),this.instance.enablePointerMoveEvents=!0),i){this.action||(this.action=new d.ActionManager(this.app.scene),this.instance.actionManager=this.action);let t=this.executes.find(e);t&&this.action.unregisterAction(t),this.executes.remove(e),this.executes.add(e,i),this.action.registerAction(i)}this.isPickable=!0,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}removeEventListener(e){if(e==x.leftClick||e==x.rightClick||e==x.doubleClick){if(this.clickEvents.remove(e),this.clickEvents.count()>0)return;e=x.click}this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let t=this.executes.find(e);t&&this.action.unregisterAction(t),this.executes.remove(e),0==this.executes.count()&&(this.action=null,this.instance.actionManager=this.action),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setFlash(e){this.statusType==I.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach((t=>{t.instancedBuffers&&(t.instancedBuffers.color=O.colors[e])})),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.statusType=I.Flash)}setOpaque(){this.statusType!=I.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach((e=>{e.setEnabled(!0),e.instancedBuffers&&(e.instancedBuffers.color=new d.Color4(1,1,1,1))})),this.instance.disableEdgesRendering(),this.instance.visibility=0,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.statusType=I.Opaque)}setTransparent(e=.3,t=!1){this.statusType==I.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach((e=>e.setEnabled(!1))),this.instance.visibility=e,t&&this.instance.enableEdgesRendering(),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.statusType=I.Transparent)}setColor(e="#ffffff"){this.statusType==I.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach((t=>{t.instancedBuffers&&(t.instancedBuffers.color=d.Color4.FromHexString(e))})),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1)}play(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach((e=>{let t;e.animations.forEach((e=>{-1!=e.name.indexOf("open")&&(t=e)})),t?this.app.scene.beginDirectAnimation(e,[t],0,10*t.getKeys().length,this.isLoop):e.animations.forEach((t=>this.app.scene.beginDirectAnimation(e,[t],0,10*t.getKeys().length,this.isLoop)))})),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}stop(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach((e=>{let t;e.animations.forEach((e=>{-1!=e.name.indexOf("close")&&(t=e)})),t?this.app.scene.beginDirectAnimation(e,[t],0,10*t.getKeys().length,!1):e.animations.forEach((t=>this.app.scene.beginDirectAnimation(e,[t],10*t.getKeys().length,0,!1)))})),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}toJson(){return{id:this.id,parentId:this.parentId,name:this.name,customNumber:this.customNumber,customType:this.customType,objectType:this.objectType}}getInto(){this.app.camera.flyTo(this.Sight)}goBack(){}}class F extends D{loadProperties(e){this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.baseModel=e.baseModel,this.objectType=T.Floor,this.vectors=e.vectors,this.buckles=e.buckles,this.height=e.height}setEnabled(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.setEnabled(e),e?(this.instance.isPickable=this.executes.count()>0,this.executes.find(x.eover)||this.executes.find(x.out)?this.instance.enablePointerMoveEvents=!0:this.instance.enablePointerMoveEvents=!1):(this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}bind(){this.instance=d.MeshBuilder.CreatePolygon("地板",{shape:m.Expand(this.vectors,-.01),holes:this.buckles,sideOrientation:d.Mesh.DOUBLESIDE},this.app.scene),this.instance.setEnabled(!1),this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1,this.instance.position.y=this.height-.01,this.instance.id=this.id,this.instance.name="地板";var e=this.app.resources.GetMaterial(this.baseModel).clone(this.id);let t=this.instance.getBoundingInfo();this.Sight=m.getVisualAngle(t,this.app),this.baseModel.isTiling&&(e.diffuseTexture.uScale=(t.maximum.x-t.minimum.x)/this.baseModel.width,e.diffuseTexture.vScale=(t.maximum.z-t.minimum.z)/this.baseModel.length),this.instance.material=e,this.completed()}computeView(){this.Sight=new R;let e=this.instance.getBoundingInfo(),t=m.getVisualAngle(e,this.app);this.Sight.alpha=t.alpha,this.Sight.beta=t.beta,this.Sight.focus=e.boundingBox.center.clone(),this.Sight.focus.y=this.instance.position.y,this.Sight.radius=2*e.boundingSphere.radius,this.Sight.minimumLimit=.3,this.Sight.maximumLimit=2*this.Sight.radius,this.Sight.minBeta=.01,this.Sight.maxBeta=Math.PI/2*.98}setOpaque(){this.statusType!=I.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.visibility=1,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.statusType=I.Opaque)}}class _ extends D{loadProperties(e){this.id="墙_"+y.getGUID(12),this.objectType=T.Wall,this.parentId=e.parentId,this.name="墙体",this.customNumber=this.id,this.customType=this.objectType,this.walls=e.walls,this.height=e.height,this.baseModel=e.baseModel,this.baseModel&&!this.baseModel.length&&(this.baseModel.length=3.1)}setEnabled(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.setEnabled(e),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}bind(){this.instance=m.MergeMeshes(this.walls,this.app),this.instance.setEnabled(!1),this.instance.receiveShadows=!0,this.baseModel?this.nativeMaterial=this.app.resources.GetMergeMaterial(this.baseModel):this.nativeMaterial=null,this.instance.material=this.nativeMaterial,this.instance.id=this.id,this.instance.name=this.id,this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1,this.instance.position.y+=this.height,this.completed()}completed(){this.alwaysActive(),this.optimization(!0)}setOpaque(){this.statusType!=I.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.visibility=1,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.statusType=I.Opaque)}}class G{constructor(e){this.executes=new A,this.clickEvents=new A,this.touchtime=(new Date).getTime(),this.app=e}loadProperties(e){}bind(){}completed(){this.computeView()}setEnabled(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.setEnabled(e),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}addEventListener(e,t){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let i=null;if(e==x.leftClick||e==x.rightClick||e==x.doubleClick?(this.clickEvents.remove(e),this.clickEvents.add(e,t),this.instance.isPickable=!0,i=new d.ExecuteCodeAction(d.ActionManager.OnPickTrigger,(e=>{let t=this.clickEvents.find(x.leftClick);t&&0==e.sourceEvent.button&&t(this,e);let i=this.clickEvents.find(x.rightClick);i&&2==e.sourceEvent.button&&i(this,e);let n=this.clickEvents.find(x.doubleClick);n&&0==e.sourceEvent.button&&(new Date).getTime()-this.touchtime<500&&n(this,e),this.touchtime=(new Date).getTime()})),e=x.click):e==x.eover?(i=new d.ExecuteCodeAction(d.ActionManager.OnPointerOverTrigger,(e=>t(this,e))),this.instance.enablePointerMoveEvents=!0):e==x.longPress?i=new d.ExecuteCodeAction(d.ActionManager.OnLongPressTrigger,(e=>t(this,e))):e==x.out&&(i=new d.ExecuteCodeAction(d.ActionManager.OnPointerOutTrigger,(e=>t(this,e))),this.instance.enablePointerMoveEvents=!0),i){this.action||(this.action=new d.ActionManager(this.app.scene),this.instance.actionManager=this.action);let t=this.executes.find(e);t&&this.action.unregisterAction(t),this.executes.remove(e),this.executes.add(e,i),this.action.registerAction(i)}this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}removeEventListener(e){if(e==x.leftClick||e==x.rightClick||e==x.doubleClick){if(this.clickEvents.remove(e),this.clickEvents.count()>0)return;e=x.click}this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let t=this.executes.find(e);t&&this.action.unregisterAction(t),this.executes.remove(e),0==this.executes.count()&&(this.action=null,this.instance.actionManager=this.action),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}load(e,t){let i=new Array;for(let e=0;e<t.length;e++){let n=t[e];n.objectType==T.Wall&&(n.height||(n.height=3.1),n.ply||(n.ply=.09),i.push(n))}let n=new A;for(let e=0;e<t.length;e++){let s=t[e];s.objectType==T.Corner&&(n.add(s.id,s.corner),s.pints.length>2&&(s.height=3.1,s.walls.forEach((e=>{i.forEach((t=>{e==t.id&&parseFloat(t.height)<s.height&&(s.height=parseFloat(t.height))}))}))))}if(!e){let e=new Array;for(let i=0;i<t.length;i++){let n=t[i];n.objectType==T.Corner&&e.push(n)}let i=new S(this.app);i.loadProperties({parentId:this.id,height:this.position.y,corners:e}),i.bind()?this.app.project.objectDatas.add(i.id,i):i=null}for(let e=0;e<t.length;e++){let i=t[e];if(i.objectType!=T.Floor)continue;i.vectors=new Array;let s=t[e];s.pints.forEach((e=>{n.find(e),i.vectors.push(n.find(e))})),i.buckles=new Array,s.holes&&s.holes.forEach((e=>{let t=new Array;e.forEach((e=>t.push(n.find(e)))),i.buckles.push(t)})),s.middles&&s.middles.forEach((e=>{let s=Array();for(let i=0;i<t.length;i++)t[i].id==e&&t[i].pints.forEach((e=>{let t=n.find(e);s.push(new d.Vector3(t.x,0,t.z))}));i.buckles.push(s)})),i.height=this.position.y;let r=new F(this.app);r.loadProperties(i),r.bind(),this.app.project.objectDatas.add(r.id,r)}if(n=null,!e){let e=new A;e.add("body",{t:"",walls:new Array});for(let t=0;t<i.length;t++){let n=d.MeshBuilder.ExtrudePolygon(i[t].id,{shape:[m.ToVector3(i[t].wtop),m.ToVector3(i[t].wleft),m.ToVector3(i[t].wbottom),m.ToVector3(i[t].wright)],depth:parseFloat(i[t].height),sideOrientation:d.Mesh.FRONTSIDE},this.app.scene);n.setEnabled(!1),n.position.y=parseFloat(i[t].height),n.subMeshes=[];var s=n.getTotalVertices();n.subMeshes.push(new d.SubMesh(0,0,s,0,6,n)),n.subMeshes.push(new d.SubMesh(0,1,s,18,6,n)),n.subMeshes.push(new d.SubMesh(0,2,s,30,6,n));for(let e=0;e<i[t].wallwindows.length;e++){const s=d.CSG.FromMesh(n);let a=this.app.project.objectDatas.find(i[t].wallwindows[e]);var r=a.instance.getBoundingInfo(),o=d.MeshBuilder.CreateBox((new Date).getTime().toString(),{height:r.maximum.y-r.minimum.y,width:r.maximum.x-r.minimum.x,depth:2*parseFloat(i[t].ply)+.1},this.app.scene);o.position=a.instance.position.clone(),o.position.y=(r.maximum.y-r.minimum.y)/2+a.height,o.rotation=a.instance.rotation.clone();const c=d.CSG.FromMesh(o);let h=s.subtract(c);o.dispose(),n.dispose(),n=h.toMesh(i[t].id,null,this.app.scene,!0),n.setEnabled(!1)}let a=e.find(i[t].leftMap.modelId);a||(a={t:i[t].leftMap,walls:new Array},e.add(i[t].leftMap.modelId,a));let c=e.find(i[t].rightMap.modelId);c||(c={t:i[t].rightMap,walls:new Array},e.add(i[t].rightMap.modelId,c));let h=m.DeconsTructMesh(n,parseFloat(i[t].height),this.app);for(let t=0;t<h.length;t++)2==t||3==t?a.walls.push(h[t]):4==t||5==t?c.walls.push(h[t]):e.find("body").walls.push(h[t])}for(const t in e.map){let i=e.find(t);if(i.walls.length>0){let e=new _(this.app);e.loadProperties({baseModel:i.t,walls:i.walls,parentId:this.id,height:this.position.y}),e.bind(),this.app.project.objectDatas.add(e.id,e)}}}this.completed(),i=null}toJson(){return{id:this.id,parentId:this.parentId,name:this.name,customNumber:this.customNumber,customType:this.customType,objectType:this.objectType,index:this.index,layerHeight:this.layerHeight,layerName:this.layerName}}computeView(){var e,t;let i=this.app.project.getChildsById(this.id,!0);i.length>0&&(e=t=i[0].instance.position.clone());for(let n=0;n<i.length;n++){let s=i[n];if(s.objectType==T.Storey||s.objectType==T.Campus)continue;let r=s.instance.getBoundingInfo();e=d.Vector3.Minimize(e,r.minimum.add(s.instance.position)),t=d.Vector3.Maximize(t,r.maximum.add(s.instance.position))}e&&t||(e=d.Vector3.Zero(),t=new d.Vector3(12,0,8)),this.Sight=new R;let n=m.getVisualAngle(new d.BoundingInfo(e,t),this.app);this.Sight.alpha=n.alpha,this.Sight.beta=n.beta,this.Sight.focus=n.focus,this.Sight.radius=n.radius,this.Sight.minimumLimit=.3,this.Sight.maximumLimit=2*this.Sight.radius,this.Sight.minBeta=.01,this.Sight.maxBeta=Math.PI/2*.98}getInto(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;for(let e in this.app.project.objectDatas.map){let t=this.app.project.objectDatas.find(e);t instanceof D&&t.setOpaque(),t.setEnabled(t.parentId==this.id)}this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}goBack(){}}class L extends D{loadProperties(e){this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.baseModel=e.baseModel,this.height=e.baseModel.height,this.objectType=T.Door,this.rotation=m.ToVector3(e.rotation),this.position=m.ToVector3(e.position)}setEnabled(e){if(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach((e=>e.dispose())),e){let e=new d.Mesh(this.id,this.app.scene);this.app.resources.resources.find(this.baseModel.modelId).meshes[0].getChildMeshes().forEach((t=>{var i=t.createInstance(this.id);i.isPickable=!1,i.enablePointerMoveEvents=!1,i.parent=e})),e.rotation=m.ToVector3(this.rotation.clone()),e.position=m.ToVector3(this.position.clone()),this.instance.addChild(e),this.alwaysActive(),this.optimization(!0)}this.instance.setEnabled(e),this.isPickable=e,this.statusType=I.Opaque,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}bind(){let e=this.app.resources.resources.find(this.baseModel.modelId),t=m.computeBounds(e.meshes[0]);this.instance=this.app.resources.BOX.clone(this.id),this.instance.setBoundingInfo(t),this.instance.id=this.id,this.instance.enablePointerMoveEvents=!1,this.instance.isPickable=!1,this.instance.scaling=new d.Vector3(t.maximum.x-t.minimum.x,t.maximum.y-t.minimum.y,t.maximum.z-t.minimum.z),this.instance.position=m.ToVector3(this.position.clone()),this.instance.position.y=(t.maximum.y-t.minimum.y)/2+this.position.y,this.instance.rotation=m.ToVector3(this.rotation.clone()),this.instance.setEnabled(!1),this.completed()}}class P extends D{loadProperties(e){this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.baseModel=e.baseModel,this.height=e.baseModel.height,this.objectType=T.Window,this.rotation=m.ToVector3(e.rotation),this.position=m.ToVector3(e.position)}setEnabled(e){if(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach((e=>e.dispose())),e){let e=new d.Mesh(this.id,this.app.scene);this.app.resources.resources.find(this.baseModel.modelId).meshes[0].getChildMeshes().forEach((t=>{var i=t.createInstance(this.id);i.isPickable=!1,i.enablePointerMoveEvents=!1,i.parent=e})),e.rotation=m.ToVector3(this.rotation.clone()),e.position=m.ToVector3(this.position.clone()),this.instance.addChild(e),this.alwaysActive(),this.optimization(!0)}this.instance.setEnabled(e),this.isPickable=e,this.statusType=I.Opaque,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}bind(){let e=this.app.resources.resources.find(this.baseModel.modelId),t=m.computeBounds(e.meshes[0]);this.instance=this.app.resources.BOX.clone(this.id),this.instance.setBoundingInfo(t),this.instance.id=this.id,this.instance.enablePointerMoveEvents=!1,this.instance.isPickable=!1,this.instance.scaling=new d.Vector3(t.maximum.x-t.minimum.x,t.maximum.y-t.minimum.y,t.maximum.z-t.minimum.z),this.instance.position=m.ToVector3(this.position.clone()),this.instance.position.y=(t.maximum.y-t.minimum.y)/2+this.position.y,this.instance.rotation=m.ToVector3(this.rotation.clone()),this.instance.setEnabled(!1),this.completed()}}class k extends G{loadProperties(e){this.id=e.id,this.name=e.name,this.parentId=e.parentId,this.index=e.index,this.layerName=this.index<0?"B"+this.index:"F"+(this.index+1),this.layerHeight=e.layerHeight,this.objectType=e.objectType,this.customNumber=e.customNumber?e.customNumber:e.id,this.customType=e.customType?e.customType:this.objectType,this.position=m.ToVector3(e.position),this.rotation=m.ToVector3(e.rotation),this.scaling=m.ToVector3(e.scaling)}bind(){this.instance=d.MeshBuilder.CreateGround(this.id,{width:this.scaling.x,height:this.scaling.z},this.app.scene),this.instance.enablePointerMoveEvents=!1,this.instance.isPickable=!1;let e=new d.StandardMaterial("mat_"+this.id,this.app.scene);e.diffuseColor=d.Color3.White(),e.alpha=0,e.backFaceCulling=!1,this.instance.material=e,this.instance.position=this.position,this.instance.position.y-=.01,this.instance.rotation=this.rotation.clone(),this.setEnabled(!1)}alwaysActive(){this.instance.getChildMeshes().forEach((e=>{e.alwaysSelectAsActiveMesh=!0,e.doNotSyncBoundingInfo=!1,e.ignoreNonUniformScaling=!0})),this.instance.alwaysSelectAsActiveMesh=!0,this.instance.doNotSyncBoundingInfo=!1}completed(){this.alwaysActive(),this.computeView()}computeView(){var e,t;let i=this.app.project.getChildsById(this.id);i.length>0&&(e=t=i[0].instance.position.clone());for(let n=0;n<i.length;n++){let s=i[n];if(s.objectType==T.Storey||s.objectType==T.Campus||s.objectType==T.Wall||s.objectType==T.Corner)continue;let r=s.instance.getBoundingInfo();e=d.Vector3.Minimize(e,r.minimum.add(s.instance.position)),t=d.Vector3.Maximize(t,r.maximum.add(s.instance.position))}e&&t||(e=d.Vector3.Zero(),t=new d.Vector3(12,0,8)),this.Sight=m.getVisualAngle(new d.BoundingInfo(e,t),this.app)}}class N extends D{completed(){this.alwaysActive(),this.optimization(!0),this.computeView()}computeView(){let e=this.app.resources.resources.find(this.baseModel.modelId);this.instance.setBoundingInfo(m.computeBounds(e.meshes[0])),this.Sight=new R;let t=this.instance.getBoundingInfo(),i=m.getVisualAngle(t,this.app);this.Sight.alpha=i.alpha,this.Sight.beta=i.beta,this.Sight.focus=this.position.clone(),this.Sight.radius=2*t.boundingSphere.radius,this.Sight.minimumLimit=.3,this.Sight.maximumLimit=3*this.Sight.radius,this.Sight.minBeta=.01,this.Sight.maxBeta=Math.PI/2*.98}getInto(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let e=new A;this.app.project.getChildsById(this.id).forEach((t=>{let i=!0,n=this.app.project.getChildsById(t.id);for(let s=0;s<n.length;s++){let r=n[s];(r instanceof _||r instanceof L||r instanceof S||r instanceof P||r instanceof F)&&(e.add(r.id,r.id),i=!1),r instanceof _&&t instanceof k&&(r.addEventListener(x.leftClick,(()=>{this.app.project.switchLevel(t.id)})),r.addEventListener(x.eover,(()=>{this.app.toolTips.text=t.layerName})),r.addEventListener(x.out,(()=>{this.app.toolTips.text=""})))}e.add(t.id,t.id)}));for(const t in this.app.project.objectDatas.map){let i=this.app.project.objectDatas.find(t);e.find(i.id)||i.parentId==this.parentId?i.setEnabled(!0):i.setEnabled(!1)}this.setEnabled(!1);let t=this.app.project.getChildsById(this.parentId);for(let e=0;e<t.length;e++){const i=t[e];i instanceof N&&i.id!=this.id&&(i.isPickable=!1,this.app.resources.setTransparentById(i.baseModel.modelId,.3))}this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}goBack(){let e=this.app.project.getChildsById(this.parentId);for(let t=0;t<e.length;t++){const i=e[t];i instanceof N&&i.id!=this.id&&(i.isPickable=!0,this.app.resources.setTransparentById(i.baseModel.modelId,1))}this.app.toolTips.text="",this.app.project.getChildsById(this.id).forEach((e=>{let t=this.app.project.getChildsById(e.id);for(let e=0;e<t.length;e++){let i=t[e];i instanceof _&&(i.removeEventListener(x.leftClick),i.removeEventListener(x.eover),i.removeEventListener(x.out))}}))}}class U{constructor(e){this.objectDatas=new A,this.app=e}clear(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;for(const e in this.objectDatas.map)this.objectDatas.find(e).instance&&this.objectDatas.find(e).instance.dispose();this.objectDatas.clear(),this.current=null,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}optimization(){this.app.scene.freezeActiveMeshes()}getChildsById(e=this.root.id,t=!1){e||(e=this.root.id);let i=new Array;const n=e=>{for(const s in this.objectDatas.map){let r=this.objectDatas.find(s);r.parentId==e&&(i.push(r),t&&n(r.id))}};return n(e),i}getSceneTree(e=this.root.id,t=[]){e||(e=this.root.id);const i=(e,n)=>{for(const s in this.objectDatas.map){let r=this.objectDatas.find(s);if(r.parentId!=e)continue;let o=!1;for(let e=0;e<t.length;e++)r.customType!=t[e]||(o=!0);o||(n.push(Object.assign(Object.assign({},r.toJson()),{children:[]})),i(r.id,n[n.length-1].children))}};let n=this.objectDatas.find(e);if(!n)return void console.error("指定的层级不存在");let s=Object.assign(Object.assign({},n.toJson()),{children:[]});return i(this.root.id,s.children),s}findObjectById(e){return this.objectDatas.find(e)}findObjectByCustomNumber(e){let t=[];for(const i in this.objectDatas.map){let n=this.objectDatas.find(i);n.customNumber==e&&t.push(n)}return 0==t.length?null:(t.length>1&&t.length,t[0])}findObjectsByCustomType(e,t={isCurrent:!1,isEnabled:!1}){let i=[],n=this.current.id;this.current instanceof G||!this.current.parentId||(n=this.current.parentId);for(const s in this.objectDatas.map){let r=this.objectDatas.find(s);r.customType==e&&(t.isCurrent&&r.parentId!=n||t.isEnabled&&1!=r.instance.isEnabled()||i.push(r))}return i}findObjectsByType(e){let t=new Array;for(const i in this.objectDatas.map){let n=this.objectDatas.find(i);n.objectType==e&&t.push(n)}return t}computeSight(e){var t=d.Vector3.Zero(),i=d.Vector3.Zero();for(let n=0;n<e.length;n++){let s=e[n];if(s.objectType==T.Storey||s.objectType==T.Campus)continue;let r=s.instance.getBoundingInfo();t&&i||(t=i=r.boundingBox.center.clone()),t=d.Vector3.Minimize(t,r.minimum.add(s.instance.position)),i=d.Vector3.Maximize(i,r.maximum.add(s.instance.position))}return t&&i||(t=d.Vector3.Zero(),i=new d.Vector3(12,0,8)),m.getVisualAngle(new d.BoundingInfo(t,i),this.app)}switchLevel(e=this.root.id,t=!0){e||(e=this.root.id);let i=this.objectDatas.find(e);if(i){if(this.current&&this.current.goBack(),!(i instanceof G||i instanceof N)){let e=this.objectDatas.find(i.parentId);this.current instanceof G||this.current instanceof N?i.parentId!=this.current.id&&e.getInto():i.parentId!=this.current.parentId&&e.getInto()}i.getInto(),this.current=i,this.levelEvent&&this.levelEvent(this.current),t&&(i instanceof G||i instanceof N)&&this.app.camera.perspective(i)}else console.error("层级不存在")}goBack(){this.app.isDefaultMutual&&(this.current?this.current.parentId?(this.current.goBack&&this.current.goBack(),this.switchLevel(this.current.parentId)):console.error("已经是最顶层级!"):console.error("层级有误、未知错误!"))}getTypes(e=null){let t=[],i=new A;for(let t in this.objectDatas.map){let n=this.objectDatas.find(t);e&&n.parentId!=e||(i.find(n.objectType)||i.add(n.objectType,n.objectType))}for(let e in i.map)t.push(e);return t}getCustomTypes(e=null){let t=[],i=new A;for(let t in this.objectDatas.map){let n=this.objectDatas.find(t);e&&n.parentId!=e||(i.find(n.customType)||i.add(n.customType,n.customType))}for(let e in i.map)t.push(e);return t}}var H=function(e,t,i,n){return new(i||(i=Promise))((function(s,r){function o(e){try{c(n.next(e))}catch(e){r(e)}}function a(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};class j{constructor(e){this.walls=new A,this.resources=new A,this.ndoeMats=new A,this.Materials=new A,this.Textures=new A,this.MergeMaterials=new A,this.app=e;let t=y.getGUID(12);this.transparentBox=d.MeshBuilder.CreateBox(t,{size:1},this.app.scene),this.transparentBox.alwaysSelectAsActiveMesh=!0;let i=new d.StandardMaterial(t,this.app.scene);i.diffuseTexture=new d.Texture(ef.rl+"resources/white.jpg",this.app.scene,!0,!1),i.alphaMode=d.Engine.ALPHA_COMBINE,i.emissiveColor=d.Color3.Green(),this.transparentBox.material=i,this.transparentBox.setEnabled(!1),this.transparentBox.visibility=.3;let n=y.getGUID(12);this.BOX=d.MeshBuilder.CreateBox(n,{size:1},this.app.scene),this.BOX.edgesColor=d.Color4.FromHexString("#4ba3fff2"),this.BOX.setEnabled(!1),this.BOX.visibility=0,this.FogTex=new d.Texture(ef.rl+"resources/fogtex.png",this.app.scene,!0,!1)}loadModelMesh(e){return H(this,void 0,void 0,(function*(){let t=this.resources.find(e.modelId);if(!t)try{t=yield d.SceneLoader.LoadAssetContainerAsync(ef.rl+"bundle/"+e.modelId+"/",e.modelId+e.extension,this.app.scene),t.animationGroups.length>0&&t.animationGroups[0].stop(),t.addAllToScene(),t.meshes[0].setEnabled(!1),t.meshes[0].getChildMeshes().forEach((i=>{if(i.metadata&&i.metadata.gltf&&i.metadata.gltf.extras){if(i.metadata.gltf.extras.LightMapName){let t=this.LoadLightMap(e.modelId,i.metadata.gltf.extras.LightMapName);t.coordinatesIndex=1,t.level=2,i.material.lightmapTexture=t,i.material.useLightmapAsShadowmap=!0}t.isExtras=!0,i.metadata.gltf.extras.U&&d.Animation.CreateAndStartAnimation("u",i.material.albedoTexture,"uOffset",30*i.metadata.gltf.extras.Uspeed,30,0,1,1),i.metadata.gltf.extras.V&&d.Animation.CreateAndStartAnimation("v",i.material.albedoTexture,"vOffset",30*i.metadata.gltf.extras.Vspeed,30,0,1,1)}})),t.meshes[0].getChildMeshes().forEach((e=>{e.registerInstancedBuffer("color",4),e.instancedBuffers.color=new d.Color4(1,1,1,1)})),this.resources.add(e.modelId,t)}catch(t){console.error("模型下载失败!模型编号:"+e.modelId+";错误信息:"+t)}return t}))}loadModelMeshAsync(e,t){let i=this.resources.find(e.modelId);i?t(i):d.SceneLoader.LoadAssetContainerAsync(ef.rl+"bundle/"+e.modelId+"/",e.modelId+e.extension,this.app.scene).then((i=>{i.animationGroups.length>0&&i.animationGroups[0].stop(),this.resources.add(e.modelId,i),t(i)})).catch((()=>{console.error("模型下载失败!模型编号:"+e.modelId)}))}GetMaterial(e){let t=this.Materials.find(e.modelId);if(void 0===t){let i=this.GetTexture(e);t=new d.StandardMaterial(e.modelId,this.app.scene),t.alphaMode=d.Engine.ALPHA_COMBINE,t.diffuseTexture=i,this.Materials.add(e.modelId,t)}return t}GetTexture(e){let t=this.Textures.find(e.modelId);return void 0===t&&(t=new d.Texture(ef.rl+"texture/"+e.modelId+e.extension,this.app.scene,!1),".png"==e.extension&&(t.hasAlpha=!0),this.Textures.add(e.modelId,t)),t}LoadLightMap(e,t){let i=this.Textures.find(e+t);return void 0===i&&(i=new d.Texture(ef.rl+"bundle/"+e+"/"+t,this.app.scene,!1,!1),this.Textures.add(e+t,i)),i}GetMergeMaterial(e){let t=this.MergeMaterials.find(e.modelId);if(void 0===t){t=new d.CustomMaterial(e.modelId,this.app.scene),t.alphaMode=2,this.MergeMaterials.add(e.modelId,t),t.AddUniform("textureData","sampler2D",null),t.Vertex_Definitions("\n varying vec3 localPos ; \n varying vec3 localNrm ;\n "),t.Fragment_Definitions("\n varying vec3 localPos ;\n varying vec3 localNrm ;"),t.Vertex_Before_PositionUpdated("\n localPos = position.xyz;\n localNrm = normal;\n ");let i=this.GetTexture(e);".png"==e.extension&&(i.hasAlpha=!0,t.alpha=.9),e.length||(e.length=3.1),e.width||(e.width=1.6),t.onBindObservable.add((()=>t.getEffect().setTexture("textureData",i))),t.Fragment_Custom_Diffuse("\n vec3 newUV = vec3(abs(localPos.x)/"+e.width+",abs(localPos.y)/"+e.length+",abs(localPos.z)/"+e.width+");\n if(abs(localNrm.z)>abs(localNrm.x)){\n vec4 res = texture2D(textureData,newUV.xy);\n diffuseColor = res.rgb; \n alpha = res.a;\n }\n else {\n vec4 res = texture2D(textureData,newUV.zy);\n diffuseColor = res.rgb; \n alpha = res.a;\n }\n "),t.freeze()}return t}delete(e=!1){if(this.BOX&&this.BOX.dispose(),this.transparentBox&&this.transparentBox.dispose(!0,!0),this.BOX=null,this.transparentBox=null,e){for(const e in this.resources.map)this.resources.find(e).removeAllFromScene(),this.resources.remove(e);this.resources.clear();for(const e in this.Textures.map)this.Textures.find(e).dispose(),this.Textures.remove(e);this.Textures.clear()}}GetWalls(e,t){return H(this,void 0,void 0,(function*(){let i=yield d.SceneLoader.LoadAssetContainerAsync(e,t+".gltf",this.app.scene);if(i.meshes){let e=i.meshes[0].getChildMeshes();for(let t=0;t<e.length;t++)this.walls.add(e[t].id,e[t])}}))}setTransparent(e=1){for(const t in this.resources.map){this.resources.find(t).meshes.forEach((t=>t.visibility=e))}}setTransparentById(e,t=1){let i=this.resources.find(e);i&&i.meshes.forEach((e=>e.visibility=t))}}function J(e,t){return function(){return e.apply(t,arguments)}}const{toString:V}=Object.prototype,{getPrototypeOf:z}=Object,K=(e=>t=>{const i=V.call(t);return e[i]||(e[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),W=e=>(e=e.toLowerCase(),t=>K(t)===e),Q=e=>t=>typeof t===e,{isArray:X}=Array,Y=Q("undefined");const q=W("ArrayBuffer");const Z=Q("string"),$=Q("function"),ee=Q("number"),te=e=>null!==e&&"object"==typeof e,ie=e=>{if("object"!==K(e))return!1;const t=z(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},ne=W("Date"),se=W("File"),re=W("Blob"),oe=W("FileList"),ae=W("URLSearchParams");function ce(e,t,{allOwnKeys:i=!1}={}){if(null==e)return;let n,s;if("object"!=typeof e&&(e=[e]),X(e))for(n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else{const s=i?Object.getOwnPropertyNames(e):Object.keys(e),r=s.length;let o;for(n=0;n<r;n++)o=s[n],t.call(null,e[o],o,e)}}function he(e,t){t=t.toLowerCase();const i=Object.keys(e);let n,s=i.length;for(;s-- >0;)if(n=i[s],t===n.toLowerCase())return n;return null}const le="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,ue=e=>!Y(e)&&e!==le;const de=(fe="undefined"!=typeof Uint8Array&&z(Uint8Array),e=>fe&&e instanceof fe);var fe;const pe=W("HTMLFormElement"),me=(({hasOwnProperty:e})=>(t,i)=>e.call(t,i))(Object.prototype),ge=W("RegExp"),Ae=(e,t)=>{const i=Object.getOwnPropertyDescriptors(e),n={};ce(i,((i,s)=>{!1!==t(i,s,e)&&(n[s]=i)})),Object.defineProperties(e,n)},ye="abcdefghijklmnopqrstuvwxyz",be="0123456789",Be={DIGIT:be,ALPHA:ye,ALPHA_DIGIT:ye+ye.toUpperCase()+be};const ve=W("AsyncFunction"),Ce={isArray:X,isArrayBuffer:q,isBuffer:function(e){return null!==e&&!Y(e)&&null!==e.constructor&&!Y(e.constructor)&&$(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||$(e.append)&&("formdata"===(t=K(e))||"object"===t&&$(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&q(e.buffer),t},isString:Z,isNumber:ee,isBoolean:e=>!0===e||!1===e,isObject:te,isPlainObject:ie,isUndefined:Y,isDate:ne,isFile:se,isBlob:re,isRegExp:ge,isFunction:$,isStream:e=>te(e)&&$(e.pipe),isURLSearchParams:ae,isTypedArray:de,isFileList:oe,forEach:ce,merge:function e(){const{caseless:t}=ue(this)&&this||{},i={},n=(n,s)=>{const r=t&&he(i,s)||s;ie(i[r])&&ie(n)?i[r]=e(i[r],n):ie(n)?i[r]=e({},n):X(n)?i[r]=n.slice():i[r]=n};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&ce(arguments[e],n);return i},extend:(e,t,i,{allOwnKeys:n}={})=>(ce(t,((t,n)=>{i&&$(t)?e[n]=J(t,i):e[n]=t}),{allOwnKeys:n}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,i,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),i&&Object.assign(e.prototype,i)},toFlatObject:(e,t,i,n)=>{let s,r,o;const a={};if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),r=s.length;r-- >0;)o=s[r],n&&!n(o,e,t)||a[o]||(t[o]=e[o],a[o]=!0);e=!1!==i&&z(e)}while(e&&(!i||i(e,t))&&e!==Object.prototype);return t},kindOf:K,kindOfTest:W,endsWith:(e,t,i)=>{e=String(e),(void 0===i||i>e.length)&&(i=e.length),i-=t.length;const n=e.indexOf(t,i);return-1!==n&&n===i},toArray:e=>{if(!e)return null;if(X(e))return e;let t=e.length;if(!ee(t))return null;const i=new Array(t);for(;t-- >0;)i[t]=e[t];return i},forEachEntry:(e,t)=>{const i=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=i.next())&&!n.done;){const i=n.value;t.call(e,i[0],i[1])}},matchAll:(e,t)=>{let i;const n=[];for(;null!==(i=e.exec(t));)n.push(i);return n},isHTMLForm:pe,hasOwnProperty:me,hasOwnProp:me,reduceDescriptors:Ae,freezeMethods:e=>{Ae(e,((t,i)=>{if($(e)&&-1!==["arguments","caller","callee"].indexOf(i))return!1;const n=e[i];$(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")}))}))},toObjectSet:(e,t)=>{const i={},n=e=>{e.forEach((e=>{i[e]=!0}))};return X(e)?n(e):n(String(e).split(t)),i},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,i){return t.toUpperCase()+i})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:he,global:le,isContextDefined:ue,ALPHABET:Be,generateString:(e=16,t=Be.ALPHA_DIGIT)=>{let i="";const{length:n}=t;for(;e--;)i+=t[Math.random()*n|0];return i},isSpecCompliantForm:function(e){return!!(e&&$(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),i=(e,n)=>{if(te(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;const s=X(e)?[]:{};return ce(e,((e,t)=>{const r=i(e,n+1);!Y(r)&&(s[t]=r)})),t[n]=void 0,s}}return e};return i(e,0)},isAsyncFn:ve,isThenable:e=>e&&(te(e)||$(e))&&$(e.then)&&$(e.catch)};function we(e,t,i,n,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),i&&(this.config=i),n&&(this.request=n),s&&(this.response=s)}Ce.inherits(we,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Ce.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Ee=we.prototype,Me={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{Me[e]={value:e}})),Object.defineProperties(we,Me),Object.defineProperty(Ee,"isAxiosError",{value:!0}),we.from=(e,t,i,n,s,r)=>{const o=Object.create(Ee);return Ce.toFlatObject(e,o,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),we.call(o,e.message,t,i,n,s),o.cause=e,o.name=e.name,r&&Object.assign(o,r),o};const Te=we;function xe(e){return Ce.isPlainObject(e)||Ce.isArray(e)}function Ie(e){return Ce.endsWith(e,"[]")?e.slice(0,-2):e}function Re(e,t,i){return e?e.concat(t).map((function(e,t){return e=Ie(e),!i&&t?"["+e+"]":e})).join(i?".":""):t}const Se=Ce.toFlatObject(Ce,{},null,(function(e){return/^is[A-Z]/.test(e)}));const Oe=function(e,t,i){if(!Ce.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(i=Ce.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!Ce.isUndefined(t[e])}))).metaTokens,s=i.visitor||h,r=i.dots,o=i.indexes,a=(i.Blob||"undefined"!=typeof Blob&&Blob)&&Ce.isSpecCompliantForm(t);if(!Ce.isFunction(s))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(Ce.isDate(e))return e.toISOString();if(!a&&Ce.isBlob(e))throw new Te("Blob is not supported. Use a Buffer instead.");return Ce.isArrayBuffer(e)||Ce.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function h(e,i,s){let a=e;if(e&&!s&&"object"==typeof e)if(Ce.endsWith(i,"{}"))i=n?i:i.slice(0,-2),e=JSON.stringify(e);else if(Ce.isArray(e)&&function(e){return Ce.isArray(e)&&!e.some(xe)}(e)||(Ce.isFileList(e)||Ce.endsWith(i,"[]"))&&(a=Ce.toArray(e)))return i=Ie(i),a.forEach((function(e,n){!Ce.isUndefined(e)&&null!==e&&t.append(!0===o?Re([i],n,r):null===o?i:i+"[]",c(e))})),!1;return!!xe(e)||(t.append(Re(s,i,r),c(e)),!1)}const l=[],u=Object.assign(Se,{defaultVisitor:h,convertValue:c,isVisitable:xe});if(!Ce.isObject(e))throw new TypeError("data must be an object");return function e(i,n){if(!Ce.isUndefined(i)){if(-1!==l.indexOf(i))throw Error("Circular reference detected in "+n.join("."));l.push(i),Ce.forEach(i,(function(i,r){!0===(!(Ce.isUndefined(i)||null===i)&&s.call(t,i,Ce.isString(r)?r.trim():r,n,u))&&e(i,n?n.concat(r):[r])})),l.pop()}}(e),t};function De(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function Fe(e,t){this._pairs=[],e&&Oe(e,this,t)}const _e=Fe.prototype;_e.append=function(e,t){this._pairs.push([e,t])},_e.toString=function(e){const t=e?function(t){return e.call(this,t,De)}:De;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const Ge=Fe;function Le(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Pe(e,t,i){if(!t)return e;const n=i&&i.encode||Le,s=i&&i.serialize;let r;if(r=s?s(t,i):Ce.isURLSearchParams(t)?t.toString():new Ge(t,i).toString(n),r){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e}const ke=class{constructor(){this.handlers=[]}use(e,t,i){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!i&&i.synchronous,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Ce.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Ne={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ue={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Ge,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&("undefined"!=typeof window&&"undefined"!=typeof document)})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]};const He=function(e){function t(e,i,n,s){let r=e[s++];const o=Number.isFinite(+r),a=s>=e.length;if(r=!r&&Ce.isArray(n)?n.length:r,a)return Ce.hasOwnProp(n,r)?n[r]=[n[r],i]:n[r]=i,!o;n[r]&&Ce.isObject(n[r])||(n[r]=[]);return t(e,i,n[r],s)&&Ce.isArray(n[r])&&(n[r]=function(e){const t={},i=Object.keys(e);let n;const s=i.length;let r;for(n=0;n<s;n++)r=i[n],t[r]=e[r];return t}(n[r])),!o}if(Ce.isFormData(e)&&Ce.isFunction(e.entries)){const i={};return Ce.forEachEntry(e,((e,n)=>{t(function(e){return Ce.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),n,i,0)})),i}return null},je={"Content-Type":void 0};const Je={transitional:Ne,adapter:["xhr","http"],transformRequest:[function(e,t){const i=t.getContentType()||"",n=i.indexOf("application/json")>-1,s=Ce.isObject(e);s&&Ce.isHTMLForm(e)&&(e=new FormData(e));if(Ce.isFormData(e))return n&&n?JSON.stringify(He(e)):e;if(Ce.isArrayBuffer(e)||Ce.isBuffer(e)||Ce.isStream(e)||Ce.isFile(e)||Ce.isBlob(e))return e;if(Ce.isArrayBufferView(e))return e.buffer;if(Ce.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let r;if(s){if(i.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Oe(e,new Ue.classes.URLSearchParams,Object.assign({visitor:function(e,t,i,n){return Ue.isNode&&Ce.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((r=Ce.isFileList(e))||i.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Oe(r?{"files[]":e}:e,t&&new t,this.formSerializer)}}return s||n?(t.setContentType("application/json",!1),function(e,t,i){if(Ce.isString(e))try{return(t||JSON.parse)(e),Ce.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(i||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Je.transitional,i=t&&t.forcedJSONParsing,n="json"===this.responseType;if(e&&Ce.isString(e)&&(i&&!this.responseType||n)){const i=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(e){if(i){if("SyntaxError"===e.name)throw Te.from(e,Te.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ue.classes.FormData,Blob:Ue.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};Ce.forEach(["delete","get","head"],(function(e){Je.headers[e]={}})),Ce.forEach(["post","put","patch"],(function(e){Je.headers[e]=Ce.merge(je)}));const Ve=Je,ze=Ce.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Ke=Symbol("internals");function We(e){return e&&String(e).trim().toLowerCase()}function Qe(e){return!1===e||null==e?e:Ce.isArray(e)?e.map(Qe):String(e)}function Xe(e,t,i,n,s){return Ce.isFunction(n)?n.call(this,t,i):(s&&(t=i),Ce.isString(t)?Ce.isString(n)?-1!==t.indexOf(n):Ce.isRegExp(n)?n.test(t):void 0:void 0)}class Ye{constructor(e){e&&this.set(e)}set(e,t,i){const n=this;function s(e,t,i){const s=We(t);if(!s)throw new Error("header name must be a non-empty string");const r=Ce.findKey(n,s);(!r||void 0===n[r]||!0===i||void 0===i&&!1!==n[r])&&(n[r||t]=Qe(e))}const r=(e,t)=>Ce.forEach(e,((e,i)=>s(e,i,t)));return Ce.isPlainObject(e)||e instanceof this.constructor?r(e,t):Ce.isString(e)&&(e=e.trim())&&!(e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))(e)?r((e=>{const t={};let i,n,s;return e&&e.split("\n").forEach((function(e){s=e.indexOf(":"),i=e.substring(0,s).trim().toLowerCase(),n=e.substring(s+1).trim(),!i||t[i]&&ze[i]||("set-cookie"===i?t[i]?t[i].push(n):t[i]=[n]:t[i]=t[i]?t[i]+", "+n:n)})),t})(e),t):null!=e&&s(t,e,i),this}get(e,t){if(e=We(e)){const i=Ce.findKey(this,e);if(i){const e=this[i];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=i.exec(e);)t[n[1]]=n[2];return t}(e);if(Ce.isFunction(t))return t.call(this,e,i);if(Ce.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=We(e)){const i=Ce.findKey(this,e);return!(!i||void 0===this[i]||t&&!Xe(0,this[i],i,t))}return!1}delete(e,t){const i=this;let n=!1;function s(e){if(e=We(e)){const s=Ce.findKey(i,e);!s||t&&!Xe(0,i[s],s,t)||(delete i[s],n=!0)}}return Ce.isArray(e)?e.forEach(s):s(e),n}clear(e){const t=Object.keys(this);let i=t.length,n=!1;for(;i--;){const s=t[i];e&&!Xe(0,this[s],s,e,!0)||(delete this[s],n=!0)}return n}normalize(e){const t=this,i={};return Ce.forEach(this,((n,s)=>{const r=Ce.findKey(i,s);if(r)return t[r]=Qe(n),void delete t[s];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,i)=>t.toUpperCase()+i))}(s):String(s).trim();o!==s&&delete t[s],t[o]=Qe(n),i[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Ce.forEach(this,((i,n)=>{null!=i&&!1!==i&&(t[n]=e&&Ce.isArray(i)?i.join(", "):i)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const i=new this(e);return t.forEach((e=>i.set(e))),i}static accessor(e){const t=(this[Ke]=this[Ke]={accessors:{}}).accessors,i=this.prototype;function n(e){const n=We(e);t[n]||(!function(e,t){const i=Ce.toCamelCase(" "+t);["get","set","has"].forEach((n=>{Object.defineProperty(e,n+i,{value:function(e,i,s){return this[n].call(this,t,e,i,s)},configurable:!0})}))}(i,e),t[n]=!0)}return Ce.isArray(e)?e.forEach(n):n(e),this}}Ye.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Ce.freezeMethods(Ye.prototype),Ce.freezeMethods(Ye);const qe=Ye;function Ze(e,t){const i=this||Ve,n=t||i,s=qe.from(n.headers);let r=n.data;return Ce.forEach(e,(function(e){r=e.call(i,r,s.normalize(),t?t.status:void 0)})),s.normalize(),r}function $e(e){return!(!e||!e.__CANCEL__)}function et(e,t,i){Te.call(this,null==e?"canceled":e,Te.ERR_CANCELED,t,i),this.name="CanceledError"}Ce.inherits(et,Te,{__CANCEL__:!0});const tt=et;const it=Ue.isStandardBrowserEnv?{write:function(e,t,i,n,s,r){const o=[];o.push(e+"="+encodeURIComponent(t)),Ce.isNumber(i)&&o.push("expires="+new Date(i).toGMTString()),Ce.isString(n)&&o.push("path="+n),Ce.isString(s)&&o.push("domain="+s),!0===r&&o.push("secure"),document.cookie=o.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function nt(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const st=Ue.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let i;function n(i){let n=i;return e&&(t.setAttribute("href",n),n=t.href),t.setAttribute("href",n),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return i=n(window.location.href),function(e){const t=Ce.isString(e)?n(e):e;return t.protocol===i.protocol&&t.host===i.host}}():function(){return!0};const rt=function(e,t){e=e||10;const i=new Array(e),n=new Array(e);let s,r=0,o=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),h=n[o];s||(s=c),i[r]=a,n[r]=c;let l=o,u=0;for(;l!==r;)u+=i[l++],l%=e;if(r=(r+1)%e,r===o&&(o=(o+1)%e),c-s<t)return;const d=h&&c-h;return d?Math.round(1e3*u/d):void 0}};function ot(e,t){let i=0;const n=rt(50,250);return s=>{const r=s.loaded,o=s.lengthComputable?s.total:void 0,a=r-i,c=n(a);i=r;const h={loaded:r,total:o,progress:o?r/o:void 0,bytes:a,rate:c||void 0,estimated:c&&o&&r<=o?(o-r)/c:void 0,event:s};h[t?"download":"upload"]=!0,e(h)}}const at="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,i){let n=e.data;const s=qe.from(e.headers).normalize(),r=e.responseType;let o;function a(){e.cancelToken&&e.cancelToken.unsubscribe(o),e.signal&&e.signal.removeEventListener("abort",o)}Ce.isFormData(n)&&(Ue.isStandardBrowserEnv||Ue.isStandardBrowserWebWorkerEnv?s.setContentType(!1):s.setContentType("multipart/form-data;",!1));let c=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",i=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";s.set("Authorization","Basic "+btoa(t+":"+i))}const h=nt(e.baseURL,e.url);function l(){if(!c)return;const n=qe.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(e,t,i){const n=i.config.validateStatus;i.status&&n&&!n(i.status)?t(new Te("Request failed with status code "+i.status,[Te.ERR_BAD_REQUEST,Te.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i)):e(i)}((function(e){t(e),a()}),(function(e){i(e),a()}),{data:r&&"text"!==r&&"json"!==r?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:n,config:e,request:c}),c=null}if(c.open(e.method.toUpperCase(),Pe(h,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=l:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(l)},c.onabort=function(){c&&(i(new Te("Request aborted",Te.ECONNABORTED,e,c)),c=null)},c.onerror=function(){i(new Te("Network Error",Te.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const n=e.transitional||Ne;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),i(new Te(t,n.clarifyTimeoutError?Te.ETIMEDOUT:Te.ECONNABORTED,e,c)),c=null},Ue.isStandardBrowserEnv){const t=(e.withCredentials||st(h))&&e.xsrfCookieName&&it.read(e.xsrfCookieName);t&&s.set(e.xsrfHeaderName,t)}void 0===n&&s.setContentType(null),"setRequestHeader"in c&&Ce.forEach(s.toJSON(),(function(e,t){c.setRequestHeader(t,e)})),Ce.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),r&&"json"!==r&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",ot(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",ot(e.onUploadProgress)),(e.cancelToken||e.signal)&&(o=t=>{c&&(i(!t||t.type?new tt(null,e,c):t),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(o),e.signal&&(e.signal.aborted?o():e.signal.addEventListener("abort",o)));const u=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(h);u&&-1===Ue.protocols.indexOf(u)?i(new Te("Unsupported protocol "+u+":",Te.ERR_BAD_REQUEST,e)):c.send(n||null)}))},ct={http:null,xhr:at};Ce.forEach(ct,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const ht=e=>{e=Ce.isArray(e)?e:[e];const{length:t}=e;let i,n;for(let s=0;s<t&&(i=e[s],!(n=Ce.isString(i)?ct[i.toLowerCase()]:i));s++);if(!n){if(!1===n)throw new Te(`Adapter ${i} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(Ce.hasOwnProp(ct,i)?`Adapter '${i}' is not available in the build`:`Unknown adapter '${i}'`)}if(!Ce.isFunction(n))throw new TypeError("adapter is not a function");return n};function lt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new tt(null,e)}function ut(e){lt(e),e.headers=qe.from(e.headers),e.data=Ze.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return ht(e.adapter||Ve.adapter)(e).then((function(t){return lt(e),t.data=Ze.call(e,e.transformResponse,t),t.headers=qe.from(t.headers),t}),(function(t){return $e(t)||(lt(e),t&&t.response&&(t.response.data=Ze.call(e,e.transformResponse,t.response),t.response.headers=qe.from(t.response.headers))),Promise.reject(t)}))}const dt=e=>e instanceof qe?e.toJSON():e;function ft(e,t){t=t||{};const i={};function n(e,t,i){return Ce.isPlainObject(e)&&Ce.isPlainObject(t)?Ce.merge.call({caseless:i},e,t):Ce.isPlainObject(t)?Ce.merge({},t):Ce.isArray(t)?t.slice():t}function s(e,t,i){return Ce.isUndefined(t)?Ce.isUndefined(e)?void 0:n(void 0,e,i):n(e,t,i)}function r(e,t){if(!Ce.isUndefined(t))return n(void 0,t)}function o(e,t){return Ce.isUndefined(t)?Ce.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function a(i,s,r){return r in t?n(i,s):r in e?n(void 0,i):void 0}const c={url:r,method:r,data:r,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(e,t)=>s(dt(e),dt(t),!0)};return Ce.forEach(Object.keys(Object.assign({},e,t)),(function(n){const r=c[n]||s,o=r(e[n],t[n],n);Ce.isUndefined(o)&&r!==a||(i[n]=o)})),i}const pt="1.4.0",mt={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{mt[e]=function(i){return typeof i===e||"a"+(t<1?"n ":" ")+e}}));const gt={};mt.transitional=function(e,t,i){function n(e,t){return"[Axios v1.4.0] Transitional option '"+e+"'"+t+(i?". "+i:"")}return(i,s,r)=>{if(!1===e)throw new Te(n(s," has been removed"+(t?" in "+t:"")),Te.ERR_DEPRECATED);return t&&!gt[s]&&(gt[s]=!0,console.warn(n(s," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(i,s,r)}};const At={assertOptions:function(e,t,i){if("object"!=typeof e)throw new Te("options must be an object",Te.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let s=n.length;for(;s-- >0;){const r=n[s],o=t[r];if(o){const t=e[r],i=void 0===t||o(t,r,e);if(!0!==i)throw new Te("option "+r+" must be "+i,Te.ERR_BAD_OPTION_VALUE)}else if(!0!==i)throw new Te("Unknown option "+r,Te.ERR_BAD_OPTION)}},validators:mt},yt=At.validators;class bt{constructor(e){this.defaults=e,this.interceptors={request:new ke,response:new ke}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=ft(this.defaults,t);const{transitional:i,paramsSerializer:n,headers:s}=t;let r;void 0!==i&&At.assertOptions(i,{silentJSONParsing:yt.transitional(yt.boolean),forcedJSONParsing:yt.transitional(yt.boolean),clarifyTimeoutError:yt.transitional(yt.boolean)},!1),null!=n&&(Ce.isFunction(n)?t.paramsSerializer={serialize:n}:At.assertOptions(n,{encode:yt.function,serialize:yt.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase(),r=s&&Ce.merge(s.common,s[t.method]),r&&Ce.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete s[e]})),t.headers=qe.concat(r,s);const o=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,o.unshift(e.fulfilled,e.rejected))}));const c=[];let h;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let l,u=0;if(!a){const e=[ut.bind(this),void 0];for(e.unshift.apply(e,o),e.push.apply(e,c),l=e.length,h=Promise.resolve(t);u<l;)h=h.then(e[u++],e[u++]);return h}l=o.length;let d=t;for(u=0;u<l;){const e=o[u++],t=o[u++];try{d=e(d)}catch(e){t.call(this,e);break}}try{h=ut.call(this,d)}catch(e){return Promise.reject(e)}for(u=0,l=c.length;u<l;)h=h.then(c[u++],c[u++]);return h}getUri(e){return Pe(nt((e=ft(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}Ce.forEach(["delete","get","head","options"],(function(e){bt.prototype[e]=function(t,i){return this.request(ft(i||{},{method:e,url:t,data:(i||{}).data}))}})),Ce.forEach(["post","put","patch"],(function(e){function t(t){return function(i,n,s){return this.request(ft(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:i,data:n}))}}bt.prototype[e]=t(),bt.prototype[e+"Form"]=t(!0)}));const Bt=bt;class vt{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const i=this;this.promise.then((e=>{if(!i._listeners)return;let t=i._listeners.length;for(;t-- >0;)i._listeners[t](e);i._listeners=null})),this.promise.then=e=>{let t;const n=new Promise((e=>{i.subscribe(e),t=e})).then(e);return n.cancel=function(){i.unsubscribe(t)},n},e((function(e,n,s){i.reason||(i.reason=new tt(e,n,s),t(i.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;const t=new vt((function(t){e=t}));return{token:t,cancel:e}}}const Ct=vt;const wt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(wt).forEach((([e,t])=>{wt[t]=e}));const Et=wt;const Mt=function e(t){const i=new Bt(t),n=J(Bt.prototype.request,i);return Ce.extend(n,Bt.prototype,i,{allOwnKeys:!0}),Ce.extend(n,i,null,{allOwnKeys:!0}),n.create=function(i){return e(ft(t,i))},n}(Ve);Mt.Axios=Bt,Mt.CanceledError=tt,Mt.CancelToken=Ct,Mt.isCancel=$e,Mt.VERSION=pt,Mt.toFormData=Oe,Mt.AxiosError=Te,Mt.Cancel=Mt.CanceledError,Mt.all=function(e){return Promise.all(e)},Mt.spread=function(e){return function(t){return e.apply(null,t)}},Mt.isAxiosError=function(e){return Ce.isObject(e)&&!0===e.isAxiosError},Mt.mergeConfig=ft,Mt.AxiosHeaders=qe,Mt.formToJSON=e=>He(Ce.isHTMLForm(e)?new FormData(e):e),Mt.HttpStatusCode=Et,Mt.default=Mt;const Tt=Mt.create();Tt.defaults.headers.post["Content-Type"]="application/json",Tt.interceptors.request.use((e=>{let t=localStorage.getItem("mx3d-token");return t&&(e.headers.Authorization="Bearer "+t),e}),(e=>Promise.reject(e))),Tt.interceptors.response.use((e=>e),(e=>{if(e.response)switch(e.response.status){case 401:console.error("开发者授权码异常");break;case 403:console.error("当前用户没有权限");break;case 400:console.error(e.response.data.message)}return Promise.reject(e)}));const xt=Tt;var It=n(354),Rt=n.n(It);class St{static de(e){let t=localStorage.getItem("mx3d-long");var i=Rt().enc.Utf8.parse(t.substring(0,32)),n=Rt().enc.Utf8.parse(t.substring(32,48)),s=Rt().enc.Hex.parse(e),r=Rt().enc.Base64.stringify(s);return Rt().AES.decrypt(r,i,{iv:n,mode:Rt().mode.CBC,padding:Rt().pad.Pkcs7}).toString(Rt().enc.Utf8).toString()}}class Ot extends D{loadProperties(e){this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.baseModel=e.baseModel,this.objectType=T.LeakWater,this.lines=m.ToARRVector3(e.lines)}setEnabled(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.setEnabled(e),e?(this.instance.isPickable=this.executes.count()>0,this.executes.find(x.eover)||this.executes.find(x.out)?this.instance.enablePointerMoveEvents=!0:this.instance.enablePointerMoveEvents=!1):(this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}bind(){this.instance=m.createTube(this.id,this.lines,.02,this.app),this.instance.setEnabled(!1);var e=this.app.resources.GetMaterial(this.baseModel).clone(this.id);d.Animation.CreateAndStartAnimation("u",e.diffuseTexture,"vOffset",15,30,0,1,1),e.diffuseTexture.vScale=this.instance.getTotalVertices()/50,this.instance.material=e,this.completed()}completed(){this.alwaysActive(),this.computeView()}computeView(){this.Sight=new R;let e=this.instance.getBoundingInfo(),t=m.getVisualAngle(e,this.app);this.Sight.alpha=t.alpha,this.Sight.beta=t.beta,this.Sight.radius=e.boundingSphere.radiusWorld+3,this.Sight.minimumLimit=.3,this.Sight.maximumLimit=2*this.Sight.radius,this.Sight.minBeta=.01,this.Sight.maxBeta=Math.PI/2*.98}addEventListener(e,t){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let i=null;if(e==x.leftClick||e==x.rightClick||e==x.doubleClick?(this.clickEvents.remove(e),this.clickEvents.add(e,t),this.instance.isPickable=!0,i=new d.ExecuteCodeAction(d.ActionManager.OnPickTrigger,(e=>{let t=this.clickEvents.find(x.leftClick);t&&0==e.sourceEvent.button&&t(this,e);let i=this.clickEvents.find(x.rightClick);i&&2==e.sourceEvent.button&&i(this,e);let n=this.clickEvents.find(x.doubleClick);n&&0==e.sourceEvent.button&&(new Date).getTime()-this.touchtime<500&&n(this,e),this.touchtime=(new Date).getTime()})),e="click"):e==x.eover?(i=new d.ExecuteCodeAction(d.ActionManager.OnPointerOverTrigger,(e=>t(this,e))),this.instance.enablePointerMoveEvents=!0):e==x.longPress?i=new d.ExecuteCodeAction(d.ActionManager.OnLongPressTrigger,(e=>t(this,e))):e==x.out&&(i=new d.ExecuteCodeAction(d.ActionManager.OnPointerOutTrigger,(e=>t(this,e))),this.instance.enablePointerMoveEvents=!0),i){this.action||(this.action=new d.ActionManager(this.app.scene),this.instance.actionManager=this.action);let t=this.executes.find(e);t&&this.action.unregisterAction(t),this.executes.remove(e),this.executes.add(e,i),this.action.registerAction(i)}this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}removeEventListener(e){if(e==x.leftClick||e==x.rightClick||e==x.doubleClick){if(this.clickEvents.remove(e),this.clickEvents.count()>0)return;e="click"}this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let t=this.executes.find(e);t&&this.action.unregisterAction(t),this.executes.remove(e),0==this.executes.count()&&(this.action=null,this.instance.actionManager=this.action,this.instance.getChildMeshes().forEach((e=>e.actionManager=this.action))),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}class Dt extends D{loadProperties(e){this.id=e.id,this.customNumber=e.customNumber,this.parentId=e.parentId,this.name=e.name,this.radius=e.radius,this.pints=m.ToARRVector3(e.pints),this.objectType=e.objectType,this.customType=e.customType,this.position=m.ToVector3(e.position),this.rotation=m.ToVector3(e.rotation),this.color=e.color,this.alpha=e.alpha}setEnabled(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.setEnabled(e),e?(this.instance.isPickable=this.executes.count()>0,this.executes.find(x.eover)||this.executes.find(x.out)?this.instance.enablePointerMoveEvents=!0:this.instance.enablePointerMoveEvents=!1):(this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}bind(){this.instance=new d.Mesh(this.id);let e=m.createTube(this.id,this.pints,this.radius,this.app);this.instance.position=e.getBoundingInfo().boundingBox.center.clone(),this.instance.addChild(e),this.instance.rotation=this.rotation.clone(),this.instance.position=this.position.clone(),e.setParent(this.instance.parent),this.instance.dispose(),this.instance=e;let t=new d.StandardMaterial("mat_"+this.id,this.app.scene);t.diffuseColor=d.Color3.FromHexString(this.color),t.alpha=this.alpha,this.instance.material=t,this.instance.enablePointerMoveEvents=!1,this.instance.isPickable=!1,this.setEnabled(!1),this.completed()}setColor(e="#fff"){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.optimization(!1),this.instance.material.diffuseColor=d.Color3.FromHexString(e),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}reColor(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.optimization(!1),this.instance.material.diffuseColor=d.Color3.FromHexString(this.color),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}computeView(){this.Sight=new R;let e=this.instance.getBoundingInfo(),t=m.getVisualAngle(e,this.app);this.alpha=t.alpha,this.Sight.beta=t.beta,this.Sight.focus=t.focus,this.Sight.radius=t.radius,this.Sight.minimumLimit=.3,this.Sight.maximumLimit=2*this.Sight.radius,this.Sight.minBeta=.01,this.Sight.maxBeta=Math.PI/2*.98}setFlash(e=1){this.statusType==I.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.optimization(!1),this.instance.material.emissiveColor=O.colors[e],this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.statusType=I.Flash)}setOpaque(){this.statusType!=I.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.optimization(!0),this.instance.material.alpha=this.alpha,this.instance.material.emissiveColor=null,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.statusType=I.Opaque)}setTransparent(e=.3){this.statusType==I.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.optimization(!1),this.instance.material.alpha=e,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.statusType=I.Transparent)}}class Ft extends D{constructor(){super(...arguments),this.tconfig={color:"",position:null,rotation:null,scaling:null,clearColor:""},this.isLookAt=!1}setEnabled(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.setEnabled(e),e?(this.instance.isPickable=this.executes.count()>0,this.executes.find(x.eover)||this.executes.find(x.out)?this.instance.enablePointerMoveEvents=!0:this.instance.enablePointerMoveEvents=!1):(this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}loadProperties(e){if(this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.objectType=T.UI3D,this.isLookAt=e.isLookAt,this.tconfig.color=e.color,e.size){this.tconfig.clearColor=null,this.tconfig.position=m.ToVector3(e.position);let t=m.ToVector3(e.rotation);this.tconfig.rotation=new d.Vector3(t.x+Math.PI,t.y,t.z);let i=Number.parseInt(e.size.replace("px",""))/40,n=e.scaling?m.ToVector3(e.scaling):d.Vector3.One();this.tconfig.scaling=new d.Vector3(14*i/50*n.x,1,14*i/50*n.z)}else this.tconfig.clearColor=e.clearColor,this.tconfig.position=m.ToVector3(e.position),this.tconfig.rotation=m.ToVector3(e.rotation),this.tconfig.scaling=m.ToVector3(e.scaling)}bind(){var e="bold 100px Arial";let t=new d.DynamicTexture(this.id,64,this.app.scene,!1);var i=t.getContext();i.font=e;var n=i.measureText(this.name).width+8,s=.02*n;t=new d.DynamicTexture(this.id,{width:n,height:150},this.app.scene,!1);var r=new d.StandardMaterial(this.id,this.app.scene);r.backFaceCulling=!1,r.diffuseTexture=t,this.tconfig.clearColor||(t.hasAlpha=!0),t.drawText(this.name,null,null,e,this.tconfig.color,this.tconfig.clearColor,!1),this.instance=d.Mesh.CreateGround(this.id,s,3,1,this.app.scene),this.instance.setEnabled(!1),this.instance.scaling=this.tconfig.scaling,this.instance.position=this.tconfig.position,this.instance.rotation=this.tconfig.rotation,this.instance.material=r,this.isLookAt&&(this.instance.billboardMode=d.Mesh.BILLBOARDMODE_Y),this.alwaysActive(),this.computeView()}}class _t extends D{loadProperties(e){this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.objectType=T.VirtualBox,this.virtualType=e.virtualType,this.color=d.Color3.FromHexString(e.color),this.alpha=e.alpha,this.isEdges=e.isEdges,this.edgesWidth=e.edgesWidth,this.edgesColor=d.Color3.FromHexString(e.edgesColor).toColor4(1),this.rotation=m.ToVector3(e.rotation),this.position=m.ToVector3(e.position),this.scaling=m.ToVector3(e.scaling)}setEnabled(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.setEnabled(e),e?(this.instance.isPickable=this.executes.count()>0,this.executes.find(x.eover)||this.executes.find(x.out)?this.instance.enablePointerMoveEvents=!0:this.instance.enablePointerMoveEvents=!1):(this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}bind(){"Cylinder"==this.virtualType?this.instance=d.MeshBuilder.CreateCylinder(this.id,{height:1,diameterTop:1,diameterBottom:1},this.app.scene):this.instance=d.MeshBuilder.CreateBox(this.id,{size:1},this.app.scene),this.instance.setEnabled(!1),this.instance.id=this.id;let e=new d.StandardMaterial(this.id,this.app.scene);e.diffuseColor=this.color,this.alpha<.98&&(e.alpha=this.alpha,e.alphaMode=2,e.useAlphaFromDiffuseTexture=!0),this.instance.material=e,this.isEdges&&(this.instance.enableEdgesRendering(),this.instance.edgesWidth=1,this.instance.edgesColor=new d.Color4(0,1,1,1)),this.edgesWidth&&this.edgesWidth>0&&(this.instance.enableEdgesRendering(),this.instance.edgesWidth=this.edgesWidth,this.instance.edgesColor=this.edgesColor),this.instance.enablePointerMoveEvents=!1,this.instance.isPickable=!1,this.instance.rotation=this.rotation.clone(),this.instance.position=this.position.clone(),this.instance.scaling=this.scaling.clone(),this.completed()}}class Gt extends G{addEventListener(e,t){}removeEventListener(e){}setEnabled(e){this.instance.setEnabled(e)}loadProperties(e){this.id=e.id,this.name=e.name,this.parentId=e.parentId,this.index=e.index,this.layerName=this.index<0?"B"+this.index:"F"+(this.index+1),this.layerHeight=e.layerHeight,this.objectType=e.objectType,this.customNumber=e.customNumber?e.customNumber:e.id,this.customType=e.customType?e.customType:this.objectType,this.position=m.ToVector3(e.position),this.rotation=m.ToVector3(e.rotation)}bind(){this.instance=new d.Mesh(this.id,this.app.scene),this.instance.enablePointerMoveEvents=!1,this.instance.isPickable=!1,this.instance.position=this.position,this.instance.position.y-=.01,this.instance.rotation=this.rotation.clone(),this.setEnabled(!1)}}class Lt{constructor(e,t){this.objectType=T.RackModel,this.executes=new A,this.clickEvents=new A,this.touchtime=(new Date).getTime(),this.direction=!0,this.app=e,this.parentId=t}setEnabled(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.setEnabled(e),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}loadProperties(e){this.id=e.id,this.name=e.name,this.customNumber=e.id,this.customType=this.objectType,this.uHeight=e.uHeight,this.uStart=e.uStart,this.color=e.color?e.color:"#acacac",this.frontImgUrl=e.frontImgUrl,this.backImgUrl=e.backImgUrl,0==e.direction&&(this.direction=!1),this.width=.45,this.depth=e.depth}bind(){if(this.app.project.objectDatas.find(this.id))return void console.error("编号重复");let e=this.app.project.objectDatas.find(this.parentId);if(!(e&&e instanceof Pt&&e.rack))return void console.error("无法找到机柜或机柜模型不处于可见状态");this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let t=e.rack.getBoundingInfo();this.depth=this.depth?this.depth:t.maximum.z-t.minimum.z-.05,this.instance=d.MeshBuilder.CreateBox(this.id,{height:.04445*this.uHeight,width:this.width,depth:this.depth},this.app.scene),this.instance.registerInstancedBuffer("color",4),this.instance.instancedBuffers.color=new d.Color4(1,1,1,1);let i=new d.MultiMaterial(this.id,this.app.scene),n=new d.StandardMaterial(this.id+"_body",this.app.scene);n.diffuseColor=d.Color3.FromHexString(this.color);let s,r,o=new d.StandardMaterial(this.id+"_font",this.app.scene),a=new d.StandardMaterial(this.id+"_back",this.app.scene);this.frontImgUrl&&(s=new d.Texture(this.frontImgUrl,this.app.scene,!1,!1,null,null,(()=>{o.diffuseTexture=null,o.diffuseColor=new d.Color3(.8,.8,.8)}))),this.backImgUrl&&(r=new d.Texture(this.backImgUrl,this.app.scene,!1,!1,null,null,(()=>{a.diffuseTexture=null,a.diffuseColor=new d.Color3(.8,.8,.8)}))),s&&(o.diffuseTexture=s),r&&(a.diffuseTexture=r,r.wAng=Math.PI),i.subMaterials.push(n),i.subMaterials.push(o),i.subMaterials.push(a),this.instance.subMeshes=[];var c=this.instance.getTotalVertices();this.instance.subMeshes.push(new d.SubMesh(1,0,c,0,6,this.instance)),this.instance.subMeshes.push(new d.SubMesh(2,1,c,6,6,this.instance)),this.instance.subMeshes.push(new d.SubMesh(0,2,c,12,6,this.instance)),this.instance.subMeshes.push(new d.SubMesh(0,3,c,18,6,this.instance)),this.instance.subMeshes.push(new d.SubMesh(0,4,c,24,6,this.instance)),this.instance.subMeshes.push(new d.SubMesh(0,5,c,30,6,this.instance)),this.instance.material&&this.instance.material.dispose(),this.instance.material=i,this.instance.scaling.x=1/e.scaling.x;let h=this.instance.getBoundingInfo();this.instance.position.y=(h.maximum.y-h.minimum.y)/2+.04445*(this.uStart-1),this.direction?this.instance.position.z=(t.maximum.z-t.minimum.z-.03-(h.maximum.z-h.minimum.z))/2:(this.instance.position.z=-(t.maximum.z-t.minimum.z-.03-(h.maximum.z-h.minimum.z))/2,this.instance.rotation.y=Math.PI),this.instance.parent=e.rack,this.instance.setParent(null),this.app.project.objectDatas.add(this.id,this),this.completed(),this.statusType=I.Opaque,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}optimization(e){this.instance.getChildMeshes().forEach((t=>{e?t.freezeWorldMatrix():t.unfreezeWorldMatrix()})),e?this.instance.freezeWorldMatrix():this.instance.unfreezeWorldMatrix(),this.instance.material&&(e?this.instance.material.freeze():this.instance.material.unfreeze())}alwaysActive(){this.instance.getChildMeshes().forEach((e=>{e.alwaysSelectAsActiveMesh=!0,e.doNotSyncBoundingInfo=!1,e.ignoreNonUniformScaling=!0})),this.instance.alwaysSelectAsActiveMesh=!0,this.instance.doNotSyncBoundingInfo=!1}addEventListener(e,t){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let i=null;if(e==x.leftClick||e==x.rightClick||e==x.doubleClick?(this.clickEvents.remove(e),this.clickEvents.add(e,t),this.instance.isPickable=!0,i=new d.ExecuteCodeAction(d.ActionManager.OnPickTrigger,(e=>{let t=this.clickEvents.find(x.leftClick);t&&0==e.sourceEvent.button&&t(this,e);let i=this.clickEvents.find(x.rightClick);i&&2==e.sourceEvent.button&&i(this,e);let n=this.clickEvents.find(x.doubleClick);n&&0==e.sourceEvent.button&&(new Date).getTime()-this.touchtime<500&&n(this,e),this.touchtime=(new Date).getTime()})),e=x.click):e==x.eover?(i=new d.ExecuteCodeAction(d.ActionManager.OnPointerOverTrigger,(e=>t(this,e))),this.instance.enablePointerMoveEvents=!0):e==x.longPress?i=new d.ExecuteCodeAction(d.ActionManager.OnLongPressTrigger,(e=>t(this,e))):e==x.out&&(i=new d.ExecuteCodeAction(d.ActionManager.OnPointerOutTrigger,(e=>t(this,e))),this.instance.enablePointerMoveEvents=!0),i){this.action||(this.action=new d.ActionManager(this.app.scene),this.instance.actionManager=this.action);let t=this.executes.find(e);t&&this.action.unregisterAction(t),this.executes.remove(e),this.executes.add(e,i),this.action.registerAction(i)}this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}removeEventListener(e){if(e==x.leftClick||e==x.rightClick||e==x.doubleClick){if(this.clickEvents.remove(e),this.clickEvents.count()>0)return;e=x.click}this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let t=this.executes.find(e);t&&this.action.unregisterAction(t),this.executes.remove(e),0==this.executes.count()&&(this.action=null,this.instance.actionManager=this.action),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setFlash(e){this.statusType==I.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.instancedBuffers.color=O.colors[e],this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.statusType=I.Flash)}setOpaque(){this.statusType!=I.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.instancedBuffers.color=new d.Color4(1,1,1,1),this.instance.visibility=1,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.statusType=I.Opaque)}setTransparent(e=.3){this.statusType==I.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.visibility=e,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.statusType=I.Transparent)}setColor(e="#ffffff"){this.statusType==I.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.instancedBuffers.color=d.Color4.FromHexString(e),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1)}computeView(){this.Sight=new R;let e=this.instance.getBoundingInfo(),t=m.getVisualAngle(e,this.app);this.Sight.alpha=t.alpha,this.Sight.beta=t.beta,this.Sight.focus=this.instance.getAbsolutePosition(),this.Sight.radius=5*e.boundingSphere.radius,this.Sight.minimumLimit=.3,this.Sight.maximumLimit=2*this.Sight.radius,this.Sight.minBeta=.01,this.Sight.maxBeta=Math.PI/2*.98}completed(){this.alwaysActive(),this.optimization(!0),this.computeView()}toJson(){return{id:this.id,parentId:this.parentId,name:this.name,customNumber:this.customNumber,customType:this.customType,objectType:this.objectType}}getInto(){this.app.camera.lookToTheFront(this)}goBack(){}}class Pt extends D{computeView(){this.objectType=T.Cabinet,this.Sight=new R;let e=this.instance.getBoundingInfo(),t=m.getVisualAngle(e,this.app);this.Sight.alpha=t.alpha,this.Sight.beta=t.beta,this.Sight.focus=this.instance.getAbsolutePosition(),this.Sight.radius=e.boundingSphere.radiusWorld+3,this.Sight.minimumLimit=.3,this.Sight.maximumLimit=2*this.Sight.radius,this.Sight.minBeta=.01,this.Sight.maxBeta=Math.PI/2*.98}setEnabled(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach((e=>e.dispose())),this.rack=null;let t=this.app.project.getChildsById(this.id);for(let e=0;e<t.length;e++)t[e].instance.dispose(),this.app.project.objectDatas.remove(t[e].id);if(e){let e=new d.Mesh(this.id,this.app.scene);this.app.resources.resources.find(this.baseModel.modelId).meshes[0].getChildMeshes().forEach((t=>{var i=t.createInstance(this.id);i.isPickable=!1,i.enablePointerMoveEvents=!1,i.parent=e,-1!=t.id.indexOf("rule")&&(this.rack=i)})),e.rotation=m.ToVector3(this.rotation.clone()),e.position=m.ToVector3(this.position.clone()),e.scaling=m.ToVector3(this.scaling.clone()),this.instance.addChild(e),this.alwaysActive(),this.optimization(!0)}this.instance.setEnabled(e),this.isPickable=e,this.statusType=I.Opaque,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}bind(){let e=this.app.resources.resources.find(this.baseModel.modelId),t=m.computeBounds(e.meshes[0]);this.instance=this.app.resources.BOX.clone(this.id),this.instance.id=this.id,this.instance.enablePointerMoveEvents=!1,this.instance.isPickable=!1,this.instance.scaling=new d.Vector3((t.maximum.x-t.minimum.x)*this.scaling.x,(t.maximum.y-t.minimum.y)*this.scaling.y,(t.maximum.z-t.minimum.z)*this.scaling.z),0==this.instance.scaling.y&&(this.instance.scaling.y=.01),this.instance.position=m.ToVector3(this.position.clone()),this.instance.position.y=(t.maximum.y-t.minimum.y)/2+this.position.y,this.instance.rotation=m.ToVector3(this.rotation.clone()),this.instance.setEnabled(!1),this.completed()}loadRacks(e){for(let t=0;t<e.length;t++){let i=new Lt(this.app,this.id);i.loadProperties(e[t]),i.bind()}}unloadRacks(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let e=this.app.project.getChildsById(this.id);for(let t=0;t<e.length;t++)e[t].instance.dispose(),this.app.project.objectDatas.remove(e[t].id);this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}open(){this.play(),this.isPickable=!1}close(){this.stop(),this.isPickable=!0}}var kt=function(e,t,i,n){return new(i||(i=Promise))((function(s,r){function o(e){try{c(n.next(e))}catch(e){r(e)}}function a(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};class Nt{constructor(e,t){this.anchor=e,this.ratio=t}dispose(){this.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.mesh&&this.mesh.dispose(),this.textMesh&&this.textMesh.dispose(),this.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}class Ut{constructor(e){this.displayValue=!1,this.anchor=e,this.id=y.getGUID(12),this.texts=new Array}isEnabled(e){this.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.mesh.setEnabled(e),this.texts.forEach((t=>t.isVisible=!!e&&this.displayValue)),this.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}set displayValues(e){this.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.texts.forEach((t=>t.isVisible=e)),this.displayValue=e,this.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}dispose(){this.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.mesh&&this.mesh.dispose();for(let e=0;e<this.texts.length;e++)this.texts[e].linkedMesh&&this.texts[e].linkedMesh.dispose(),this.texts[e].dispose();this.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}class Ht{constructor(){this.color="#00ff00",this.width=1}update(){this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance&&this.instance.dispose();let e=[];this.objs.forEach((t=>e.push(t.instance.getAbsolutePosition().clone()))),this.instance=m.createTube(this.id,e,this.width/100,this.objs[0].app);let t=new d.StandardMaterial("mat_"+this.id,this.objs[0].app.scene);t.diffuseColor=d.Color3.FromHexString(this.color),this.instance.material=t,this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}addEventListener(e){if(this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.actionManager&&this.instance.actionManager.dispose(),this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1,e){this.instance.isPickable=!0,this.instance.enablePointerMoveEvents=!0;let t=new d.ActionManager(this.objs[0].app.scene);t.registerAction(new d.ExecuteCodeAction(d.ActionManager.OnPickTrigger,(t=>e(this.id)))),this.instance.actionManager=t}this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}isEnabled(e){this.instance&&(this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.setEnabled(e),this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!1)}dispose(){this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance&&this.instance.dispose(),this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}class jt{constructor(){this.color="#00ff00",this.width=5,this.isDotted=!1}update(){this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance&&this.instance.dispose(),this.instance=new d.MultiLine,this.objs[0].app.container.addControl(this.instance),this.instance.lineWidth=this.width,this.instance.color=this.color,this.isDotted&&(this.instance.dash=[1]),this.objs.forEach((e=>this.instance.add(e.instance))),this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}addEventListener(e){this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,e?(this.instance.isPointerBlocker=!1,this.instance.onPointerClickObservable.add((()=>{e(this.id)}))):this.instance.onPointerClickObservable.clear(),this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}isEnabled(e){this.instance&&(this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.isVisible=e,this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!1)}dispose(){this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance&&this.instance.dispose(),this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}class Jt{constructor(e,t){this.textDics=new Array,this.id=e,this.scene=t}set background(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this._background&&this._background.dispose(),this._background=new d.Image(y.getGUID(12)+"_Image",e),this._background.width=this.size.width+"px",this._background.height=this.size.height+"px",this.rect.addControl(this._background),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}addEventListener(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,e?(this._background.isPointerBlocker=!1,this._background.onPointerClickObservable.add((()=>{e(this.id)}))):this._background.onPointerClickObservable.clear(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setTexts(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.textDics.forEach((e=>e.dispose())),this.textDics.length=0;for(let t=0;t<e.length;t++){let i=new d.TextBlock;i.text=e[t].text,i.fontSize=e[t].fontSize?e[t].fontSize:"20px",i.color=e[t].color?e[t].color:"white",i.top=e[t].top?e[t].top:0,i.left=e[t].left?e[t].left:0,this.rect.addControl(i),this.textDics.push(i)}this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}line(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this._line&&this._line.dispose(),this._line=new d.Line,this._line.lineWidth=e.width?e.width:1.5,this._line.color=e.color?e.color:"green",this._line.y2=this.size.height/2,this.container.addControl(this._line),this._line.linkWithMesh(this.pint),this._line.connectedControl=this.rect,this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}dispose(){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.rect&&this.rect.dispose(),this._line&&this._line.dispose(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}isEnabled(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.rect&&(this.rect.isVisible=e),this._line&&(this._line.isVisible=e),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}var Vt,zt=function(e,t,i,n){return new(i||(i=Promise))((function(s,r){function o(e){try{c(n.next(e))}catch(e){r(e)}}function a(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};class Kt{constructor(e,t,i,n,s){this.id=e,this.scene=s,this.scaling=i,this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance=d.MeshBuilder.CreatePlane(this.id,{size:i,updatable:!0,sideOrientation:d.Mesh.DOUBLESIDE},this.scene),this.instance.alwaysSelectAsActiveMesh=!0,this.instance.position=t.clone(),this.instance.position.y+=n,this.instance.rotation.y+=Math.PI,this.instance.billboardMode=d.Mesh.BILLBOARDMODE_Y;let r=new d.StandardMaterial("Mat_"+this.id,this.scene);r.diffuseColor=d.Color3.White(),r.emissiveColor=d.Color3.White(),this.instance.material=r,this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setBackground(e){return zt(this,void 0,void 0,(function*(){if(this.url=e,!(this.textArr&&this.textArr.length>0))return new Promise((e=>{let t=new Image;t.src=this.url,t.onload=()=>{this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.scaling.y=this.scaling/(t.width/t.height)/this.scaling;let i=new d.DynamicTexture(this.id,{width:t.width,height:t.height},this.scene,!1);i.hasAlpha=!0,this.instance.material.diffuseTexture=i,i.getContext().drawImage(t,0,0),i.update(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1,e(!0)}}));yield this.setContents(this.textArr)}))}addEventListener(e){if(this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.actionManager&&this.instance.actionManager.dispose(),this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1,e){this.instance.isPickable=!0,this.instance.enablePointerMoveEvents=!0;let t=new d.ActionManager(this.scene);t.registerAction(new d.ExecuteCodeAction(d.ActionManager.OnPickTrigger,(t=>e(this.id)))),this.instance.actionManager=t}this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setColor(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.material.diffuseColor=d.Color3.FromHexString(e),this.instance.material.emissiveColor=d.Color3.FromHexString(e),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setContents(e){return this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.textArr=e,new Promise((t=>{let i=new Image;i.src=this.url,i.onload=()=>{this.instance.scaling.y=this.scaling/(i.width/i.height)/this.scaling;let n=new d.DynamicTexture(this.id,{width:i.width,height:i.height},this.scene,!1);n.hasAlpha=!0,this.instance.material.diffuseTexture=n,n.getContext().drawImage(i,0,0),e.forEach((e=>n.drawText(e.text,e.left,e.top,"bold "+e.fontSize+" monospace",e.color?e.color:"#fffffb","",!0,!1))),n.update(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1,t(!0)}}))}dispose(){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.dispose(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}isEnabled(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.setEnabled(e),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}class Wt{constructor(e){this.thunderNum=20,this.thunders=new Array,this.app=e}start(){this.canvas=document.createElement("canvas"),this.canvas.id="thunderEffect",this.canvas.style.cssText="position: absolute;left: 0;right: 0;top: 0;bottom: 0;width: 100%;height: 100%;outline-width: 0;-webkit-tap-highlight-color:transparent;z-index: 0;background: #000F1E;pointer-events: none;",this.app.canvas.parentElement.appendChild(this.canvas),this.canvasThunderCtx=this.canvas.getContext("2d"),this.X=this.canvas.width=window.innerWidth,this.Y=this.canvas.height=window.innerHeight,this.app.environment.setTransparent(.5);for(var e=0;e<this.thunderNum;e++){var t=new Qt(this.canvasThunderCtx,m.rand(0,this.X),m.rand(0,this.Y/3),m.rand(1,5),this.X,this.Y);this.thunders.push(t)}this.render()}close(){this.app.canvas.parentElement.removeChild(this.canvas),this.app.environment.setTransparent(1)}render(){this.clearCanvasThunder();for(var e=0;e<this.thunders.length;e++)this.thunders[e].render();window.requestAnimationFrame((()=>{this.render()}))}clearCanvasThunder(){this.canvasThunderCtx.globalCompositeOperation="darken",this.canvasThunderCtx.globalAlpha=.01,this.canvasThunderCtx.fillStyle="rgb(19, 16, 65)",this.canvasThunderCtx.fillRect(0,0,this.X,this.Y),this.canvasThunderCtx.globalCompositeOperation="source-over",this.canvasThunderCtx.globalAlpha=1,Math.random()<.02&&(this.canvasThunderCtx.fillStyle="rgb(128, 128, 128)",this.canvasThunderCtx.fillRect(0,0,this.X,this.Y))}}class Qt{constructor(e,t,i,n,s,r){this.ctx=e,this.X=s,this.Y=r,this.init(t,i,n)}init(e,t,i){this.x=e,this.y=t,this.r=i,this.l=m.rand(this.Y,3*this.Y),this.c="rgb(201, 162, 198)"}draw(){this.ctx.beginPath(),this.ctx.lineWidth=this.r,this.ctx.strokeStyle=this.c,this.ctx.moveTo(this.x,this.y),this.x+=m.rand(-10,10),this.y+=m.rand(10,15),this.ctx.lineTo(this.x,this.y),this.ctx.stroke()}updateParams(){this.y>this.l&&this.init(m.rand(0,this.X),m.rand(0,this.Y/3),m.rand(1,5))}render(){this.updateParams(),this.draw()}}class Xt{constructor(e){this.rainNum=1e3,this.rains=new Array,this.app=e}start(){this.canvas=document.createElement("canvas"),this.canvas.id="RainEffect",this.canvas.style.cssText="position: absolute;left: 0;right: 0;top: 0;bottom: 0;width: 100%;height: 100%;outline-width: 0;-webkit-tap-highlight-color:transparent; z-index: 2;pointer-events: none;",this.app.canvas.parentElement.appendChild(this.canvas),this.canvasRainCtx=this.canvas.getContext("2d"),this.X=this.canvas.width=window.innerWidth,this.Y=this.canvas.height=window.innerHeight;for(var e=0;e<this.rainNum;e++){var t=new Yt(this.canvasRainCtx,m.rand(0,this.X),m.rand(0,this.Y),1,this.Y);this.rains.push(t)}this.render()}close(){this.app.canvas.parentElement.removeChild(this.canvas)}render(){this.clearCanvasRain();for(var e=0;e<this.rains.length;e++)this.rains[e].render();window.requestAnimationFrame((()=>{this.render()}))}clearCanvasRain(){this.canvasRainCtx.clearRect(0,0,this.X,this.Y)}}class Yt{constructor(e,t,i,n,s){this.rainSpeed=10,this.ctx=e,this.Y=s,this.init(t,i,n)}init(e,t,i){this.x=e,this.y=t,this.r=i,this.c="rgb(179, 203, 255)",this.v={y:this.rainSpeed}}draw(){var e=this.ctx;e.beginPath(),e.fillStyle=this.c,e.arc(this.x,this.y,this.r,0,2*Math.PI,!1),e.fill()}updatePosition(){this.y+=this.v.y}wrapPosition(){this.y>this.Y&&(this.y=0)}render(){this.updatePosition(),this.wrapPosition(),this.draw()}}class qt{constructor(e){this.cloudNum=50,this.clouds=new Array,this.app=e}start(){this.canvas=document.createElement("canvas"),this.canvas.id="CloudEffect",this.canvas.style.cssText="position: absolute;left: 0;right: 0;top: 0;bottom: 0;width: 100%;height: 100%;outline-width: 0;-webkit-tap-highlight-color:transparent; z-index: 1;pointer-events: none;",this.app.canvas.parentElement.appendChild(this.canvas),this.canvasCloudCtx=this.canvas.getContext("2d"),this.X=this.canvas.width=window.innerWidth,this.Y=this.canvas.height=window.innerHeight;for(var e=0;e<this.cloudNum;e++){var t=new Zt(this.canvasCloudCtx,m.rand(-100,this.X+100),m.rand(0,this.Y/2),this.X);this.clouds.push(t)}this.render()}close(){this.app.canvas.parentElement.removeChild(this.canvas)}render(){this.clearCanvasCloud();for(var e=0;e<this.clouds.length;e++)this.clouds[e].render();window.requestAnimationFrame((()=>{this.render()}))}clearCanvasCloud(){this.canvasCloudCtx.clearRect(0,0,this.X,this.Y)}}class Zt{constructor(e,t,i,n){this.rainSpeed=10,this.ctx=e,this.X=n,this.init(t,i)}init(e,t){this.x=e,this.y=t,this.c="rgb(201, 162, 198)",this.r=m.rand(100,200),this.v={x:.5,y:0},this.color={r:0,g:0,b:0,a:1}}draw(){this.ctx.save(),this.ctx.scale(2,1),this.ctx.beginPath(),this.ctx.globalAlpha=.2,this.ctx.fillStyle=this.gradient(),this.ctx.arc(this.x,this.y,this.r,2*Math.PI,0,!1),this.ctx.fill(),this.ctx.scale(.5,1),this.ctx.restore()}gradient(){var e=this.color.r+","+this.color.g+","+this.color.b,t=this.ctx.createRadialGradient(this.x,this.y,0,this.x,this.y,this.r);return t.addColorStop(0,"rgba("+e+", "+1*this.color.a+")"),t.addColorStop(.5,"rgba("+e+", "+.5*this.color.a+")"),t.addColorStop(1,"rgba("+e+", "+0*this.color.a+")"),t}updatePosition(){this.x+=this.v.x}wrapPosition(){this.x-this.r>this.X&&(this.x=0-this.r)}render(){this.updatePosition(),this.wrapPosition(),this.draw()}}!function(e){e.Thunder="Thunder",e.Rain="Rain",e.Cloud="Cloud"}(Vt||(Vt={}));class $t{static add(e,t){switch(e){case Vt.Thunder:{let e=new Wt(t);e.start(),this.effects.add(Vt.Thunder,e)}break;case Vt.Rain:{let e=new Xt(t);e.start(),this.effects.add(Vt.Rain,e)}break;case Vt.Cloud:{let e=new qt(t);e.start(),this.effects.add(Vt.Cloud,e)}}}static remove(e){let t=this.effects.find(e);t&&t.close(),this.effects.remove(e)}}$t.effects=new A;const ei=e=>"boolean"==typeof e,ti=e=>"function"==typeof e,ii=e=>null!==e&&"object"==typeof e,ni=e=>ii(e)&&e.constructor==={}.constructor,si=e=>e&&"function"==typeof e[Symbol.iterator],ri=e=>e&&"function"==typeof e[Symbol.asyncIterator],oi=e=>"undefined"!=typeof Response&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json,ai=e=>"undefined"!=typeof Blob&&e instanceof Blob,ci=e=>e&&"object"==typeof e&&e.isBuffer,hi=e=>(e=>"undefined"!=typeof ReadableStream&&e instanceof ReadableStream||ii(e)&&ti(e.tee)&&ti(e.cancel)&&ti(e.getReader))(e)||(e=>ii(e)&&ti(e.read)&&ti(e.pipe)&&ei(e.readable))(e);function li(e,t){if(!e)throw new Error(t||"loader assertion failed.")}function ui(e){var t;if(!e)return!1;Array.isArray(e)&&(e=e[0]);return Array.isArray(null===(t=e)||void 0===t?void 0:t.extensions)}function di(e){var t,i;let n;return li(e,"null loader"),li(ui(e),"invalid loader"),Array.isArray(e)&&(n=e[1],e=e[0],e={...e,options:{...e.options,...n}}),(null!==(t=e)&&void 0!==t&&t.parseTextSync||null!==(i=e)&&void 0!==i&&i.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}let fi="";const pi={};const mi=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,gi=/^([-\w.]+\/[-\w.+]+)/;function Ai(e){const t=mi.exec(e);return t?t[1]:""}const yi=/\?.*/;function bi(e){return e.replace(yi,"")}function Bi(e){if(oi(e)){return e.url}if(ai(e)){return e.name||""}return"string"==typeof e?e:""}function vi(e){if(oi(e)){const t=e,i=t.headers.get("content-type")||"",n=bi(t.url);return function(e){const t=gi.exec(e);return t?t[1]:e}(i)||Ai(n)}if(ai(e)){return e.type||""}return"string"==typeof e?Ai(e):""}async function Ci(e){if(oi(e))return e;const t={},i=function(e){if(oi(e))return e.headers["content-length"]||-1;if(ai(e))return e.size;return"string"==typeof e?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}(e);i>=0&&(t["content-length"]=String(i));const n=Bi(e),s=vi(e);s&&(t["content-type"]=s);const r=await async function(e){const t=5;if("string"==typeof e)return"data:,".concat(e.slice(0,t));if(e instanceof Blob){const t=e.slice(0,5);return await new Promise((e=>{const i=new FileReader;i.onload=t=>{var i;return e(null==t||null===(i=t.target)||void 0===i?void 0:i.result)},i.readAsDataURL(t)}))}if(e instanceof ArrayBuffer){const i=function(e){let t="";const i=new Uint8Array(e);for(let e=0;e<i.byteLength;e++)t+=String.fromCharCode(i[e]);return btoa(t)}(e.slice(0,t));return"data:base64,".concat(i)}return null}(e);r&&(t["x-first-bytes"]=r),"string"==typeof e&&(e=(new TextEncoder).encode(e));const o=new Response(e,{headers:t});return Object.defineProperty(o,"url",{value:n}),o}async function wi(e,t){if("string"==typeof e){e=function(e){for(const t in pi)if(e.startsWith(t)){const i=pi[t];e=e.replace(t,i)}return e.startsWith("http://")||e.startsWith("https://")||(e="".concat(fi).concat(e)),e}(e);let i=t;return null!=t&&t.fetch&&"function"!=typeof(null==t?void 0:t.fetch)&&(i=t.fetch),await fetch(e,i)}return await Ci(e)}function Ei(e){return Ei="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ei(e)}function Mi(e){var t=function(e,t){if("object"!==Ei(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!==Ei(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Ei(t)?t:String(t)}function Ti(e,t,i){return(t=Mi(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function xi(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||function(e){if("undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type)return!0;if("undefined"!=typeof process&&"object"==typeof process.versions&&Boolean(process.versions.electron))return!0;const t="object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent,i=e||t;return!!(i&&i.indexOf("Electron")>=0)}()}const Ii="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source";xi();class Ri{constructor(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";Ti(this,"storage",void 0),Ti(this,"id",void 0),Ti(this,"config",void 0),this.storage=function(e){try{const t=window[e],i="__storage_test__";return t.setItem(i,i),t.removeItem(i),t}catch(e){return null}}(i),this.id=e,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){const e=JSON.stringify(this.config);this.storage.setItem(this.id,e)}}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}function Si(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600;const s=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(i=Math.min(i,n/e.width));const r=e.width*i,o=e.height*i,a=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(r/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(s,");"),"background-size:".concat(r,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),a]}let Oi;!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"}(Oi||(Oi={}));const Di=10;function Fi(e){return"string"!=typeof e?e:(e=e.toUpperCase(),Oi[e]||Oi.WHITE)}function _i(e,t){if(!e)throw new Error(t||"Assertion failed")}globalThis,globalThis.self||globalThis.window||globalThis.global;const Gi=globalThis.window||globalThis.self||globalThis.global,Li=(globalThis.document,globalThis.process||{});globalThis.console,globalThis.navigator;function Pi(){let e;var t,i;if(xi()&&Gi.performance)e=null==Gi||null===(t=Gi.performance)||void 0===t||null===(i=t.now)||void 0===i?void 0:i.call(t);else if("hrtime"in Li){var n;const t=null==Li||null===(n=Li.hrtime)||void 0===n?void 0:n.call(Li);e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}const ki={debug:xi()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Ni={enabled:!0,level:0};function Ui(){}const Hi={},ji={once:!0};class Ji{constructor(){let{id:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:""};Ti(this,"id",void 0),Ti(this,"VERSION",Ii),Ti(this,"_startTs",Pi()),Ti(this,"_deltaTs",Pi()),Ti(this,"_storage",void 0),Ti(this,"userData",{}),Ti(this,"LOG_THROTTLE_TIMEOUT",0),this.id=e,this.userData={},this._storage=new Ri("__probe-".concat(this.id,"__"),Ni),this.timeStamp("".concat(this.id," started")),function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"];const i=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(i),s=e;for(const i of n){const n=s[i];"function"==typeof n&&(t.find((e=>i===e))||(s[i]=n.bind(e)))}}(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Pi()-this._startTs).toPrecision(10))}getDelta(){return Number((Pi()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.setConfiguration({enabled:e}),this}setLevel(e){return this._storage.setConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,t){this._storage.setConfiguration({[e]:t})}settings(){console.table?console.table(this._storage.config):this._storage.config}assert(e,t){_i(e,t)}warn(e){return this._getLogFunction(0,e,ki.warn,arguments,ji)}error(e){return this._getLogFunction(0,e,ki.error,arguments)}deprecated(e,t){return this.warn("`".concat(e,"` is deprecated and will be removed in a later version. Use `").concat(t,"` instead"))}removed(e,t){return this.error("`".concat(e,"` has been removed. Use `").concat(t,"` instead"))}probe(e,t){return this._getLogFunction(e,t,ki.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,ki.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){return this._getLogFunction(e,t,ki.debug||ki.info,arguments,ji)}table(e,t,i){return t?this._getLogFunction(e,t,console.table||Ui,i&&[i],{tag:Ki(t)}):Ui}image(e){let{logLevel:t,priority:i,image:n,message:s="",scale:r=1}=e;return this._shouldLog(t||i)?xi()?function(e){let{image:t,message:i="",scale:n=1}=e;if("string"==typeof t){const e=new Image;return e.onload=()=>{Si(e,i,n)},e.src=t,Ui}const s=t.nodeName||"";if("img"===s.toLowerCase())return Si(t,i,n),Ui;if("canvas"===s.toLowerCase()){const e=new Image;return e.onload=()=>console.log(...Si(e,i,n)),e.src=t.toDataURL(),Ui}return Ui}({image:n,message:s,scale:r}):function(e){let{image:t,message:i="",scale:n=1}=e;return console.warn("removed"),Ui}({image:n,message:s,scale:r}):Ui}time(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}timeEnd(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,t){return this._getLogFunction(e,t,console.timeStamp||Ui)}group(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1};const n=zi({logLevel:e,message:t,opts:i}),{collapsed:s}=i;return n.method=(s?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}groupCollapsed(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(e,t,Object.assign({},i,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||Ui)}withGroup(e,t,i){this.group(e,t)();try{i()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=Vi(e)}_getLogFunction(e,t,i,n,s){if(this._shouldLog(e)){s=zi({logLevel:e,message:t,args:n,opts:s}),_i(i=i||s.method),s.total=this.getTotal(),s.delta=this.getDelta(),this._deltaTs=Pi();const r=s.tag||s.message;if(s.once&&r){if(Hi[r])return Ui;Hi[r]=Pi()}return t=function(e,t,i){if("string"==typeof t){const n=i.time?function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;const i=Math.max(t-e.length,0);return"".concat(" ".repeat(i)).concat(e)}(function(e){let t;return t=e<10?"".concat(e.toFixed(2),"ms"):e<100?"".concat(e.toFixed(1),"ms"):e<1e3?"".concat(e.toFixed(0),"ms"):"".concat((e/1e3).toFixed(2),"s"),t}(i.total)):"";t=function(e,t,i){if(!xi&&"string"==typeof e){if(t){const i=Fi(t);e="[".concat(i,"m").concat(e,"[39m")}if(i){const t=Fi(i);e="[".concat(t+Di,"m").concat(e,"[49m")}}return e}(t=i.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),i.color,i.background)}return t}(this.id,s.message,s),i.bind(console,t,...s.args)}return Ui}}function Vi(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 _i(Number.isFinite(t)&&t>=0),t}function zi(e){const{logLevel:t,message:i}=e;e.logLevel=Vi(t);const n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==i;);switch(typeof t){case"string":case"function":void 0!==i&&n.unshift(i),e.message=t;break;case"object":Object.assign(e,t)}"function"==typeof e.message&&(e.message=e.message());const s=typeof e.message;return _i("string"===s||"object"===s),Object.assign(e,{args:n},e.opts)}function Ki(e){for(const t in e)for(const i in e[t])return i||"untitled";return"empty"}Ti(Ji,"VERSION",Ii);const Wi=new Ji({id:"loaders.gl"});class Qi{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}"undefined"!=typeof self&&self,"undefined"!=typeof window&&window,void 0!==n.g&&n.g,"undefined"!=typeof document&&document;const Xi=Boolean("object"!=typeof process||"[object process]"!==String(process)||process.browser),Yi="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),qi=(Yi&&parseFloat(Yi[1]),{fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){Ti(this,"console",void 0),this.console=console}log(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.console.log.bind(this.console,...t)}info(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.console.info.bind(this.console,...t)}warn(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.console.warn.bind(this.console,...t)}error(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.console.error.bind(this.console,...t)}},CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:Xi,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]}),Zi={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 $i(){globalThis.loaders=globalThis.loaders||{};const{loaders:e}=globalThis;return e._state=e._state||{},e._state}const en=()=>{const e=$i();return e.globalOptions=e.globalOptions||{...qi},e.globalOptions};function tn(e,t,i,n){return i=i||[],function(e,t){nn(e,null,qi,Zi,t);for(const i of t){const n=e&&e[i.id]||{},s=i.options&&i.options[i.id]||{},r=i.deprecatedOptions&&i.deprecatedOptions[i.id]||{};nn(n,i.id,s,r,t)}}(e,i=Array.isArray(i)?i:[i]),rn(t,e,n)}function nn(e,t,i,n,s){const r=t||"Top level",o=t?"".concat(t,"."):"";for(const a in e){const c=!t&&ii(e[a]);if(!(a in i)&&!("baseUri"===a&&!t)&&!("workerUrl"===a&&t))if(a in n)Wi.warn("".concat(r," loader option '").concat(o).concat(a,"' no longer supported, use '").concat(n[a],"'"))();else if(!c){const e=sn(a,s);Wi.warn("".concat(r," loader option '").concat(o).concat(a,"' not recognized. ").concat(e))()}}}function sn(e,t){const i=e.toLowerCase();let n="";for(const s of t)for(const t in s.options){if(e===t)return"Did you mean '".concat(s.id,".").concat(t,"'?");const r=t.toLowerCase();(i.startsWith(r)||r.startsWith(i))&&(n=n||"Did you mean '".concat(s.id,".").concat(t,"'?"))}return n}function rn(e,t,i){const n={...e.options||{}};return function(e,t){t&&!("baseUri"in e)&&(e.baseUri=t)}(n,i),null===n.log&&(n.log=new Qi),on(n,en()),on(n,t),n}function on(e,t){for(const i in t)if(i in t){const n=t[i];ni(n)&&ni(e[i])?e[i]={...e[i],...t[i]}:e[i]=t[i]}}function an(e,t){const i=en(),n=e||i;return"function"==typeof n.fetch?n.fetch:ii(n.fetch)?e=>wi(e,n):null!=t&&t.fetch?null==t?void 0:t.fetch:wi}function cn(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}const hn="3.4.4";const ln={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==n.g&&n.g,document:"undefined"!=typeof document&&document},un=ln.global||ln.self||ln.window||{},dn="object"!=typeof process||"[object process]"!==String(process)||process.browser,fn="function"==typeof importScripts,pn="undefined"!=typeof window&&void 0!==window.orientation,mn="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);mn&&parseFloat(mn[1]);class gn{terminate(){}}const An=new Map;function yn(e){cn(e.source&&!e.url||!e.source&&e.url);let t=An.get(e.source||e.url);return t||(e.url&&(t=function(e){if(!e.startsWith("http"))return e;return bn((t=e,"try {\n importScripts('".concat(t,"');\n} catch (error) {\n console.error(error);\n throw error;\n}")));var t}(e.url),An.set(e.url,t)),e.source&&(t=bn(e.source),An.set(e.source,t))),cn(t),t}function bn(e){const t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function Bn(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2?arguments[2]:void 0;const n=i||new Set;if(e){if(vn(e))n.add(e);else if(vn(e.buffer))n.add(e.buffer);else if(ArrayBuffer.isView(e));else if(t&&"object"==typeof e)for(const i in e)Bn(e[i],t,n)}else;return void 0===i?Array.from(n):[]}function vn(e){return!!e&&(e instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&e instanceof MessagePort||("undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas)))}const Cn=()=>{};class wn{static isSupported(){return"undefined"!=typeof Worker&&dn||void 0!==gn&&!dn}constructor(e){Ti(this,"name",void 0),Ti(this,"source",void 0),Ti(this,"url",void 0),Ti(this,"terminated",!1),Ti(this,"worker",void 0),Ti(this,"onMessage",void 0),Ti(this,"onError",void 0),Ti(this,"_loadableURL","");const{name:t,source:i,url:n}=e;cn(i||n),this.name=t,this.source=i,this.url=n,this.onMessage=Cn,this.onError=e=>console.log(e),this.worker=dn?this._createBrowserWorker():this._createNodeWorker()}destroy(){this.onMessage=Cn,this.onError=Cn,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(e,t){t=t||Bn(e),this.worker.postMessage(e,t)}_getErrorFromErrorEvent(e){let t="Failed to load ";return t+="worker ".concat(this.name," from ").concat(this.url,". "),e.message&&(t+="".concat(e.message," in ")),e.lineno&&(t+=":".concat(e.lineno,":").concat(e.colno)),new Error(t)}_createBrowserWorker(){this._loadableURL=yn({source:this.source,url:this.url});const e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=e=>{e.data?this.onMessage(e.data):this.onError(new Error("No data received"))},e.onerror=e=>{this.onError(this._getErrorFromErrorEvent(e)),this.terminated=!0},e.onmessageerror=e=>console.error(e),e}_createNodeWorker(){let e;if(this.url){const t=this.url.includes(":/")||this.url.startsWith("/")?this.url:"./".concat(this.url);e=new gn(t,{eval:!1})}else{if(!this.source)throw new Error("no worker");e=new gn(this.source,{eval:!0})}return e.on("message",(e=>{this.onMessage(e)})),e.on("error",(e=>{this.onError(e)})),e.on("exit",(e=>{})),e}}class En{constructor(e,t){Ti(this,"name",void 0),Ti(this,"workerThread",void 0),Ti(this,"isRunning",!0),Ti(this,"result",void 0),Ti(this,"_resolve",(()=>{})),Ti(this,"_reject",(()=>{})),this.name=e,this.workerThread=t,this.result=new Promise(((e,t)=>{this._resolve=e,this._reject=t}))}postMessage(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}done(e){cn(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){cn(this.isRunning),this.isRunning=!1,this._reject(e)}}class Mn{static isSupported(){return wn.isSupported()}constructor(e){Ti(this,"name","unnamed"),Ti(this,"source",void 0),Ti(this,"url",void 0),Ti(this,"maxConcurrency",1),Ti(this,"maxMobileConcurrency",1),Ti(this,"onDebug",(()=>{})),Ti(this,"reuseWorkers",!0),Ti(this,"props",{}),Ti(this,"jobQueue",[]),Ti(this,"idleQueue",[]),Ti(this,"count",0),Ti(this,"isDestroyed",!1),this.source=e.source,this.url=e.url,this.setProps(e)}destroy(){this.idleQueue.forEach((e=>e.destroy())),this.isDestroyed=!0}setProps(e){this.props={...this.props,...e},void 0!==e.name&&(this.name=e.name),void 0!==e.maxConcurrency&&(this.maxConcurrency=e.maxConcurrency),void 0!==e.maxMobileConcurrency&&(this.maxMobileConcurrency=e.maxMobileConcurrency),void 0!==e.reuseWorkers&&(this.reuseWorkers=e.reuseWorkers),void 0!==e.onDebug&&(this.onDebug=e.onDebug)}async startJob(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e,t,i)=>e.done(i),i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:(e,t)=>e.error(t);const n=new Promise((n=>(this.jobQueue.push({name:e,onMessage:t,onError:i,onStart:n}),this)));return this._startQueuedJob(),await n}async _startQueuedJob(){if(!this.jobQueue.length)return;const e=this._getAvailableWorker();if(!e)return;const t=this.jobQueue.shift();if(t){this.onDebug({message:"Starting job",name:t.name,workerThread:e,backlog:this.jobQueue.length});const i=new En(t.name,e);e.onMessage=e=>t.onMessage(i,e.type,e.payload),e.onError=e=>t.onError(i,e),t.onStart(i);try{await i.result}finally{this.returnWorkerToQueue(e)}}}returnWorkerToQueue(e){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;const e="".concat(this.name.toLowerCase()," (#").concat(this.count," of ").concat(this.maxConcurrency,")");return new wn({name:e,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return pn?this.maxMobileConcurrency:this.maxConcurrency}}const Tn={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}};class xn{static isSupported(){return wn.isSupported()}static getWorkerFarm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return xn._workerFarm=xn._workerFarm||new xn({}),xn._workerFarm.setProps(e),xn._workerFarm}constructor(e){Ti(this,"props",void 0),Ti(this,"workerPools",new Map),this.props={...Tn},this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy();this.workerPools=new Map}setProps(e){this.props={...this.props,...e};for(const e of this.workerPools.values())e.setProps(this._getWorkerPoolProps())}getWorkerPool(e){const{name:t,source:i,url:n}=e;let s=this.workerPools.get(t);return s||(s=new Mn({name:t,source:i,url:n}),s.setProps(this._getWorkerPoolProps()),this.workerPools.set(t,s)),s}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}Ti(xn,"_workerFarm",void 0);const In="latest";async function Rn(e,t,i,n,s){const r=e.id,o=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=t[e.id]||{},n="".concat(e.id,"-worker.js");let s=i.workerUrl;if(s||"compression"!==e.id||(s=t.workerUrl),"test"===t._workerType&&(s="modules/".concat(e.module,"/dist/").concat(n)),!s){let t=e.version;"latest"===t&&(t=In);const i=t?"@".concat(t):"";s="https://unpkg.com/@loaders.gl/".concat(e.module).concat(i,"/dist/").concat(n)}return cn(s),s}(e,i),a=xn.getWorkerFarm(i).getWorkerPool({name:r,url:o});i=JSON.parse(JSON.stringify(i)),n=JSON.parse(JSON.stringify(n||{}));const c=await a.startJob("process-on-worker",Sn.bind(null,s));c.postMessage("process",{input:t,options:i,context:n});const h=await c.result;return await h.result}async function Sn(e,t,i,n){switch(i){case"done":t.done(n);break;case"error":t.error(new Error(n.error));break;case"process":const{id:s,input:r,options:o}=n;try{const i=await e(r,o);t.postMessage("done",{id:s,result:i})}catch(e){const i=e instanceof Error?e.message:"unknown error";t.postMessage("error",{id:s,error:i})}break;default:console.warn("parse-with-worker unknown message ".concat(i))}}function On(e,t,i){const n=void 0!==i?new Uint8Array(e).subarray(t,t+i):new Uint8Array(e).subarray(t);return new Uint8Array(n).buffer}async function Dn(e){const t=[];for await(const i of e)t.push(i);return function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];const n=t.map((e=>e instanceof ArrayBuffer?new Uint8Array(e):e)),s=n.reduce(((e,t)=>e+t.byteLength),0),r=new Uint8Array(s);let o=0;for(const e of n)r.set(e,o),o+=e.byteLength;return r.buffer}(...t)}const Fn=262144;const _n=262144;const Gn=1048576;function Ln(e){if((t=e)&&"object"==typeof t&&t.isBuffer)return e;var t;if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e))return 0===e.byteOffset&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);if("string"==typeof e){const t=e;return(new TextEncoder).encode(t).buffer}if(e&&"object"==typeof e&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}function Pn(e,t){return Xi?async function*(e,t){const i=e.getReader();let n;try{for(;;){const e=n||i.read();null!=t&&t._streamReadAhead&&(n=i.read());const{done:s,value:r}=await e;if(s)return;yield Ln(r)}}catch(e){i.releaseLock()}}(e,t):async function*(e,t){for await(const t of e)yield Ln(t)}(e)}function kn(e,t){if("string"==typeof e)return function*(e,t){const i=(null==t?void 0:t.chunkSize)||Fn;let n=0;const s=new TextEncoder;for(;n<e.length;){const t=Math.min(e.length-n,i),r=e.slice(n,n+t);n+=t,yield s.encode(r)}}(e,t);if(e instanceof ArrayBuffer)return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){const{chunkSize:i=_n}=t;let n=0;for(;n<e.byteLength;){const t=Math.min(e.byteLength-n,i),s=new ArrayBuffer(t),r=new Uint8Array(e,n,t);new Uint8Array(s).set(r),n+=t,yield s}}()}(e,t);if(ai(e))return async function*(e,t){const i=(null==t?void 0:t.chunkSize)||Gn;let n=0;for(;n<e.size;){const t=n+i,s=await e.slice(n,t).arrayBuffer();n=t,yield s}}(e,t);if(hi(e))return Pn(e,t);if(oi(e)){return Pn(e.body,t)}throw new Error("makeIterator")}const Nn="Cannot convert supplied data type";async function Un(e,t,i){const n=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if("string"==typeof e||n)return function(e,t,i){if(t.text&&"string"==typeof e)return e;if(ci(e)&&(e=e.buffer),e instanceof ArrayBuffer){const 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;const n=e.byteLength||e.length;return 0===e.byteOffset&&n===i.byteLength||(i=i.slice(e.byteOffset,e.byteOffset+n)),i}throw new Error(Nn)}(e,t);if(ai(e)&&(e=await Ci(e)),oi(e)){const i=e;return await async function(e){if(!e.ok){const t=await async function(e){let t="Failed to fetch resource ".concat(e.url," (").concat(e.status,"): ");try{const i=e.headers.get("Content-Type");let n=e.statusText;i.includes("application/json")&&(n+=" ".concat(await e.text())),t+=n,t=t.length>60?"".concat(t.slice(0,60),"..."):t}catch(e){}return t}(e);throw new Error(t)}}(i),t.binary?await i.arrayBuffer():await i.text()}if(hi(e)&&(e=kn(e,i)),si(e)||ri(e))return Dn(e);throw new Error(Nn)}function Hn(e){const t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(t+1):""}function jn(e){const t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(0,t):""}function Jn(e,t,i){if(i)return i;const n={fetch:an(t,e),...e};if(n.url){const e=bi(n.url);n.baseUrl=e,n.queryString=function(e){const t=e.match(yi);return t&&t[0]}(n.url),n.filename=Hn(e),n.baseUrl=jn(e)}return Array.isArray(n.loaders)||(n.loaders=null),n}const Vn=new Ji({id:"loaders.gl"}),zn=()=>{const e=$i();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};const Kn=/\.([^.]+)$/;function Wn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;if(!Qn(e))return null;if(t&&!Array.isArray(t))return di(t);let s=[];t&&(s=s.concat(t)),null!=i&&i.ignoreRegisteredLoaders||s.push(...zn()),function(e){for(const t of e)di(t)}(s);const r=function(e,t,i,n){const s=Bi(e),r=vi(e),o=bi(s)||(null==n?void 0:n.url);let a=null,c="";null!=i&&i.mimeType&&(a=Yn(t,null==i?void 0:i.mimeType),c="match forced by supplied MIME type ".concat(null==i?void 0:i.mimeType));var h;a=a||function(e,t){const i=t&&Kn.exec(t),n=i&&i[1];return n?function(e,t){t=t.toLowerCase();for(const i of e)for(const e of i.extensions)if(e.toLowerCase()===t)return i;return null}(e,n):null}(t,o),c=c||(a?"matched url ".concat(o):""),a=a||Yn(t,r),c=c||(a?"matched MIME type ".concat(r):""),a=a||function(e,t){if(!t)return null;for(const i of e)if("string"==typeof t){if(qn(t,i))return i}else if(ArrayBuffer.isView(t)){if(Zn(t.buffer,t.byteOffset,i))return i}else if(t instanceof ArrayBuffer){if(Zn(t,0,i))return i}return null}(t,e),c=c||(a?"matched initial data ".concat($n(e)):""),a=a||Yn(t,null==i?void 0:i.fallbackMimeType),c=c||(a?"matched fallback MIME type ".concat(r):""),c&&Vn.log(1,"selectLoader selected ".concat(null===(h=a)||void 0===h?void 0:h.name,": ").concat(c,"."));return a}(e,s,i,n);if(!(r||null!=i&&i.nothrow))throw new Error(Xn(e));return r}function Qn(e){return!(e instanceof Response&&204===e.status)}function Xn(e){const t=Bi(e),i=vi(e);let n="No valid loader found (";n+=t?"".concat(Hn(t),", "):"no url provided, ",n+="MIME type: ".concat(i?'"'.concat(i,'"'):"not provided",", ");const s=e?$n(e):"";return n+=s?' first bytes: "'.concat(s,'"'):"first bytes: not available",n+=")",n}function Yn(e,t){for(const i of e){if(i.mimeTypes&&i.mimeTypes.includes(t))return i;if(t==="application/x.".concat(i.id))return i}return null}function qn(e,t){if(t.testText)return t.testText(e);return(Array.isArray(t.tests)?t.tests:[t.tests]).some((t=>e.startsWith(t)))}function Zn(e,t,i){return(Array.isArray(i.tests)?i.tests:[i.tests]).some((n=>function(e,t,i,n){if(n instanceof ArrayBuffer)return function(e,t,i){if(i=i||e.byteLength,e.byteLength<i||t.byteLength<i)return!1;const n=new Uint8Array(e),s=new Uint8Array(t);for(let e=0;e<n.length;++e)if(n[e]!==s[e])return!1;return!0}(n,e,n.byteLength);switch(typeof n){case"function":return n(e,i);case"string":return n===es(e,t,n.length);default:return!1}}(e,t,i,n)))}function $n(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if("string"==typeof e)return e.slice(0,t);if(ArrayBuffer.isView(e))return es(e.buffer,e.byteOffset,t);if(e instanceof ArrayBuffer){return es(e,0,t)}return""}function es(e,t,i){if(e.byteLength<t+i)return"";const n=new DataView(e);let s="";for(let e=0;e<i;e++)s+=String.fromCharCode(n.getUint8(t+e));return s}async function ts(e,t,i,n){cn(!n||"object"==typeof n),!t||Array.isArray(t)||ui(t)||(n=void 0,i=t,t=void 0),i=i||{};const s=Bi(e=await e),r=function(e,t){if(!t&&e&&!Array.isArray(e))return e;let i;if(e&&(i=Array.isArray(e)?e:[e]),t&&t.loaders){const e=Array.isArray(t.loaders)?t.loaders:[t.loaders];i=i?[...i,...e]:e}return i&&i.length?i:null}(t,n),o=await async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;if(!Qn(e))return null;let s=Wn(e,t,{...i,nothrow:!0},n);if(s)return s;if(ai(e)&&(s=Wn(e=await e.slice(0,10).arrayBuffer(),t,i,n)),!(s||null!=i&&i.nothrow))throw new Error(Xn(e));return s}(e,r,i);return o?(n=Jn({url:s,parse:ts,loaders:r},i=tn(i,o,r,s),n||null),await async function(e,t,i,n){if(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:hn;cn(e,"no worker provided");const i=e.version}(e),oi(t)){const e=t,{ok:i,redirected:s,status:r,statusText:o,type:a,url:c}=e,h=Object.fromEntries(e.headers.entries());n.response={headers:h,ok:i,redirected:s,status:r,statusText:o,type:a,url:c}}if(t=await Un(t,e,i),e.parseTextSync&&"string"==typeof t)return i.dataType="text",e.parseTextSync(t,i,n,e);if(function(e,t){return!!xn.isSupported()&&!!(dn||null!=t&&t._nodeWorkers)&&e.worker&&(null==t?void 0:t.worker)}(e,i))return await Rn(e,t,i,n,ts);if(e.parseText&&"string"==typeof t)return await e.parseText(t,i,n,e);if(e.parse)return await e.parse(t,i,n,e);throw cn(!e.parseSync),new Error("".concat(e.id," loader - no parser found and worker is disabled"))}(o,e,i,n)):null}async function is(e,t,i,n){Array.isArray(t)||ui(t)||(void 0,i=t,t=void 0);const s=an(i);let r=e;return"string"==typeof e&&(r=await s(e)),ai(e)&&(r=await s(e)),await ts(r,t,i)}const ns={ADD:1,REPLACE:2},ss={EMPTY:"empty",SCENEGRAPH:"scenegraph",POINTCLOUD:"pointcloud",MESH:"mesh"},rs={I3S:"I3S",TILES3D:"TILES3D"},os={GEOMETRIC_ERROR:"geometricError",MAX_SCREEN_THRESHOLD:"maxScreenThreshold"},as="3.4.4",cs={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"};Object.keys(cs);function hs(e,t,i){li(e instanceof ArrayBuffer);const n=new TextDecoder("utf8"),s=new Uint8Array(e,t,i);return n.decode(s)}const ls="3.4.4",us={draco:{decoderType:"object"==typeof WebAssembly?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}},ds={name:"Draco",id:dn?"draco":"draco-nodejs",module:"draco",shapes:["mesh"],version:ls,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:us};class fs{constructor(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Map;Ti(this,"name",void 0),Ti(this,"type",void 0),Ti(this,"nullable",void 0),Ti(this,"metadata",void 0),this.name=e,this.type=t,this.nullable=i,this.metadata=n}get typeId(){return this.type&&this.type.typeId}clone(){return new fs(this.name,this.type,this.nullable,this.metadata)}compareTo(e){return this.name===e.name&&this.type===e.type&&this.nullable===e.nullable&&this.metadata===e.metadata}toString(){return"".concat(this.type).concat(this.nullable?", nullable":"").concat(this.metadata?", metadata: ".concat(this.metadata):"")}}let ps,ms,gs,As,ys,bs,Bs,vs,Cs=function(e){return e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.Float=3]="Float",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct=13]="Struct",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Dictionary=-1]="Dictionary",e[e.Int8=-2]="Int8",e[e.Int16=-3]="Int16",e[e.Int32=-4]="Int32",e[e.Int64=-5]="Int64",e[e.Uint8=-6]="Uint8",e[e.Uint16=-7]="Uint16",e[e.Uint32=-8]="Uint32",e[e.Uint64=-9]="Uint64",e[e.Float16=-10]="Float16",e[e.Float32=-11]="Float32",e[e.Float64=-12]="Float64",e[e.DateDay=-13]="DateDay",e[e.DateMillisecond=-14]="DateMillisecond",e[e.TimestampSecond=-15]="TimestampSecond",e[e.TimestampMillisecond=-16]="TimestampMillisecond",e[e.TimestampMicrosecond=-17]="TimestampMicrosecond",e[e.TimestampNanosecond=-18]="TimestampNanosecond",e[e.TimeSecond=-19]="TimeSecond",e[e.TimeMillisecond=-20]="TimeMillisecond",e[e.TimeMicrosecond=-21]="TimeMicrosecond",e[e.TimeNanosecond=-22]="TimeNanosecond",e[e.DenseUnion=-23]="DenseUnion",e[e.SparseUnion=-24]="SparseUnion",e[e.IntervalDayTime=-25]="IntervalDayTime",e[e.IntervalYearMonth=-26]="IntervalYearMonth",e}({});class ws{static isNull(e){return e&&e.typeId===Cs.Null}static isInt(e){return e&&e.typeId===Cs.Int}static isFloat(e){return e&&e.typeId===Cs.Float}static isBinary(e){return e&&e.typeId===Cs.Binary}static isUtf8(e){return e&&e.typeId===Cs.Utf8}static isBool(e){return e&&e.typeId===Cs.Bool}static isDecimal(e){return e&&e.typeId===Cs.Decimal}static isDate(e){return e&&e.typeId===Cs.Date}static isTime(e){return e&&e.typeId===Cs.Time}static isTimestamp(e){return e&&e.typeId===Cs.Timestamp}static isInterval(e){return e&&e.typeId===Cs.Interval}static isList(e){return e&&e.typeId===Cs.List}static isStruct(e){return e&&e.typeId===Cs.Struct}static isUnion(e){return e&&e.typeId===Cs.Union}static isFixedSizeBinary(e){return e&&e.typeId===Cs.FixedSizeBinary}static isFixedSizeList(e){return e&&e.typeId===Cs.FixedSizeList}static isMap(e){return e&&e.typeId===Cs.Map}static isDictionary(e){return e&&e.typeId===Cs.Dictionary}get typeId(){return Cs.NONE}compareTo(e){return this===e}}class Es extends(null){get typeId(){return Type.Null}get[Symbol.toStringTag](){return"Null"}toString(){return"Null"}}class Ms extends(null){get typeId(){return Type.Bool}get[Symbol.toStringTag](){return"Bool"}toString(){return"Bool"}}ps=Symbol.toStringTag;class Ts extends ws{constructor(e,t){super(),Ti(this,"isSigned",void 0),Ti(this,"bitWidth",void 0),this.isSigned=e,this.bitWidth=t}get typeId(){return Cs.Int}get[ps](){return"Int"}toString(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}}class xs extends Ts{constructor(){super(!0,8)}}class Is extends Ts{constructor(){super(!0,16)}}class Rs extends Ts{constructor(){super(!0,32)}}class Ss extends Ts{constructor(){super(!1,8)}}class Os extends Ts{constructor(){super(!1,16)}}class Ds extends Ts{constructor(){super(!1,32)}}const Fs=32,_s=64;ms=Symbol.toStringTag;class Gs extends ws{constructor(e){super(),Ti(this,"precision",void 0),this.precision=e}get typeId(){return Cs.Float}get[ms](){return"Float"}toString(){return"Float".concat(this.precision)}}class Ls extends Gs{constructor(){super(Fs)}}class Ps extends Gs{constructor(){super(_s)}}class ks extends(null){constructor(){super()}get typeId(){return Type.Binary}toString(){return"Binary"}get[Symbol.toStringTag](){return"Binary"}}class Ns extends(null){get typeId(){return Type.Utf8}get[Symbol.toStringTag](){return"Utf8"}toString(){return"Utf8"}}gs=Symbol.toStringTag;As=Symbol.toStringTag;ys=Symbol.toStringTag;bs=Symbol.toStringTag;Bs=Symbol.toStringTag;class Us extends ws{constructor(e,t){super(),Ti(this,"listSize",void 0),Ti(this,"children",void 0),this.listSize=e,this.children=[t]}get typeId(){return Cs.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[Bs](){return"FixedSizeList"}toString(){return"FixedSizeList[".concat(this.listSize,"]<").concat(this.valueType,">")}}vs=Symbol.toStringTag;function Hs(e,t,i){const n=function(e){switch(e.constructor){case Int8Array:return new xs;case Uint8Array:return new Ss;case Int16Array:return new Is;case Uint16Array:return new Os;case Int32Array:return new Rs;case Uint32Array:return new Ds;case Float32Array:return new Ls;case Float64Array:return new Ps;default:throw new Error("array type not supported")}}(t.value),s=i||function(e){const t=new Map;"byteOffset"in e&&t.set("byteOffset",e.byteOffset.toString(10));"byteStride"in e&&t.set("byteStride",e.byteStride.toString(10));"normalized"in e&&t.set("normalized",e.normalized.toString());return t}(t);return new fs(e,new Us(t.size,new fs("value",n)),!1,s)}class js{constructor(e,t){Ti(this,"fields",void 0),Ti(this,"metadata",void 0),function(e,t){if(!e)throw new Error(t||"loader assertion failed.")}(Array.isArray(e)),function(e){const t={};for(const i of e)t[i.name]&&console.warn("Schema: duplicated field name",i.name,i),t[i.name]=!0}(e),this.fields=e,this.metadata=t||new Map}compareTo(e){if(this.metadata!==e.metadata)return!1;if(this.fields.length!==e.fields.length)return!1;for(let t=0;t<this.fields.length;++t)if(!this.fields[t].compareTo(e.fields[t]))return!1;return!0}select(){const e=Object.create(null);for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];for(const t of i)e[t]=!0;const s=this.fields.filter((t=>e[t.name]));return new js(s,this.metadata)}selectAt(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];const n=t.map((e=>this.fields[e])).filter(Boolean);return new js(n,this.metadata)}assign(e){let t,i=this.metadata;if(e instanceof js){const n=e;t=n.fields,i=Js(Js(new Map,this.metadata),n.metadata)}else t=e;const n=Object.create(null);for(const e of this.fields)n[e.name]=e;for(const e of t)n[e.name]=e;const s=Object.values(n);return new js(s,i)}}function Js(e,t){return new Map([...e||new Map,...t||new Map])}function Vs(e,t,i){return Hs(e,t,i?zs(i.metadata):void 0)}function zs(e){const t=new Map;for(const i in e)t.set("".concat(i,".string"),JSON.stringify(e[i]));return t}const Ks={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},Ws={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class Qs{constructor(e){Ti(this,"draco",void 0),Ti(this,"decoder",void 0),Ti(this,"metadataQuerier",void 0),this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=new this.draco.DecoderBuffer;i.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(t);const n=this.decoder.GetEncodedGeometryType(i),s=n===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let e;switch(n){case this.draco.TRIANGULAR_MESH:e=this.decoder.DecodeBufferToMesh(i,s);break;case this.draco.POINT_CLOUD:e=this.decoder.DecodeBufferToPointCloud(i,s);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!e.ok()||!s.ptr){const t="DRACO decompression failed: ".concat(e.error_msg());throw new Error(t)}const r=this._getDracoLoaderData(s,n,t),o=this._getMeshData(s,r,t),a=function(e){let t=1/0,i=1/0,n=1/0,s=-1/0,r=-1/0,o=-1/0;const a=e.POSITION?e.POSITION.value:[],c=a&&a.length;for(let e=0;e<c;e+=3){const c=a[e],h=a[e+1],l=a[e+2];t=c<t?c:t,i=h<i?h:i,n=l<n?l:n,s=c>s?c:s,r=h>r?h:r,o=l>o?l:o}return[[t,i,n],[s,r,o]]}(o.attributes),c=function(e,t,i){const n=zs(t.metadata),s=[],r=function(e){const t={};for(const i in e){const n=e[i];t[n.name||"undefined"]=n}return t}(t.attributes);for(const t in e){const i=Vs(t,e[t],r[t]);s.push(i)}if(i){const e=Vs("indices",i);s.push(e)}return new js(s,n)}(o.attributes,r,o.indices);return{loader:"draco",loaderData:r,header:{vertexCount:s.num_points(),boundingBox:a},...o,schema:c}}finally{this.draco.destroy(i),s&&this.draco.destroy(s)}}_getDracoLoaderData(e,t,i){const n=this._getTopLevelMetadata(e),s=this._getDracoAttributes(e,i);return{geometry_type:t,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:n,attributes:s}}_getDracoAttributes(e,t){const i={};for(let n=0;n<e.num_attributes();n++){const s=this.decoder.GetAttribute(e,n),r=this._getAttributeMetadata(e,n);i[s.unique_id()]={unique_id:s.unique_id(),attribute_type:s.attribute_type(),data_type:s.data_type(),num_components:s.num_components(),byte_offset:s.byte_offset(),byte_stride:s.byte_stride(),normalized:s.normalized(),attribute_index:n,metadata:r};const o=this._getQuantizationTransform(s,t);o&&(i[s.unique_id()].quantization_transform=o);const a=this._getOctahedronTransform(s,t);a&&(i[s.unique_id()].octahedron_transform=a)}return i}_getMeshData(e,t,i){const n=this._getMeshAttributes(t,e,i);if(!n.POSITION)throw new Error("DRACO: No position attribute found.");return e instanceof this.draco.Mesh?"triangle-strip"===i.topology?{topology:"triangle-strip",mode:4,attributes:n,indices:{value:this._getTriangleStripIndices(e),size:1}}:{topology:"triangle-list",mode:5,attributes:n,indices:{value:this._getTriangleListIndices(e),size:1}}:{topology:"point-list",mode:0,attributes:n}}_getMeshAttributes(e,t,i){const n={};for(const s of Object.values(e.attributes)){const e=this._deduceAttributeName(s,i);s.name=e;const{value:r,size:o}=this._getAttributeValues(t,s);n[e]={value:r,size:o,byteOffset:s.byte_offset,byteStride:s.byte_stride,normalized:s.normalized}}return n}_getTriangleListIndices(e){const t=3*e.num_faces(),i=4*t,n=this.draco._malloc(i);try{return this.decoder.GetTrianglesUInt32Array(e,i,n),new Uint32Array(this.draco.HEAPF32.buffer,n,t).slice()}finally{this.draco._free(n)}}_getTriangleStripIndices(e){const t=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(e,t),function(e){const t=e.size(),i=new Int32Array(t);for(let n=0;n<t;n++)i[n]=e.GetValue(n);return i}(t)}finally{this.draco.destroy(t)}}_getAttributeValues(e,t){const i=Ws[t.data_type],n=t.num_components,s=e.num_points()*n,r=s*i.BYTES_PER_ELEMENT,o=function(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}}(this.draco,i);let a;const c=this.draco._malloc(r);try{const n=this.decoder.GetAttribute(e,t.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(e,n,o,r,c),a=new i(this.draco.HEAPF32.buffer,c,s).slice()}finally{this.draco._free(c)}return{value:a,size:n}}_deduceAttributeName(e,t){const i=e.unique_id;for(const[e,n]of Object.entries(t.extraAttributes||{}))if(n===i)return e;const n=e.attribute_type;for(const e in Ks){if(this.draco[e]===n)return Ks[e]}const s=t.attributeNameEntry||"name";return e.metadata[s]?e.metadata[s].string:"CUSTOM_ATTRIBUTE_".concat(i)}_getTopLevelMetadata(e){const t=this.decoder.GetMetadata(e);return this._getDracoMetadata(t)}_getAttributeMetadata(e,t){const i=this.decoder.GetAttributeMetadata(e,t);return this._getDracoMetadata(i)}_getDracoMetadata(e){if(!e||!e.ptr)return{};const t={},i=this.metadataQuerier.NumEntries(e);for(let n=0;n<i;n++){const i=this.metadataQuerier.GetEntryName(e,n);t[i]=this._getDracoMetadataField(e,i)}return t}_getDracoMetadataField(e,t){const i=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(e,t,i);const n=function(e){const t=e.size(),i=new Int32Array(t);for(let n=0;n<t;n++)i[n]=e.GetValue(n);return i}(i);return{int:this.metadataQuerier.GetIntEntry(e,t),string:this.metadataQuerier.GetStringEntry(e,t),double:this.metadataQuerier.GetDoubleEntry(e,t),intArray:n}}finally{this.draco.destroy(i)}}_disableAttributeTransforms(e){const{quantizedAttributes:t=[],octahedronAttributes:i=[]}=e,n=[...t,...i];for(const e of n)this.decoder.SkipAttributeTransform(this.draco[e])}_getQuantizationTransform(e,t){const{quantizedAttributes:i=[]}=t,n=e.attribute_type();if(i.map((e=>this.decoder[e])).includes(n)){const t=new this.draco.AttributeQuantizationTransform;try{if(t.InitFromAttribute(e))return{quantization_bits:t.quantization_bits(),range:t.range(),min_values:new Float32Array([1,2,3]).map((e=>t.min_value(e)))}}finally{this.draco.destroy(t)}}return null}_getOctahedronTransform(e,t){const{octahedronAttributes:i=[]}=t,n=e.attribute_type();if(i.map((e=>this.decoder[e])).includes(n)){const t=new this.draco.AttributeQuantizationTransform;try{if(t.InitFromAttribute(e))return{quantization_bits:t.quantization_bits()}}finally{this.draco.destroy(t)}}return null}}var Xs=n(125);const Ys="3.4.4",qs={};async function Zs(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t&&(e=function(e,t,i){if(e.startsWith("http"))return e;const n=i.modules||{};if(n[e])return n[e];if(!dn)return"modules/".concat(t,"/dist/libs/").concat(e);if(i.CDN)return cn(i.CDN.startsWith("http")),"".concat(i.CDN,"/").concat(t,"@").concat(Ys,"/dist/libs/").concat(e);if(fn)return"../src/libs/".concat(e);return"modules/".concat(t,"/src/libs/").concat(e)}(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})),qs[e]=qs[e]||async function(e){if(e.endsWith("wasm")){const t=await fetch(e);return await t.arrayBuffer()}if(!dn)try{return Xs&&Xs.requireFromFile&&await Xs.requireFromFile(e)}catch{return null}if(fn)return importScripts(e);const t=await fetch(e);return function(e,t){if(!dn)return Xs.requireFromString&&Xs.requireFromString(e,t);if(fn)return eval.call(un,e),null;const i=document.createElement("script");i.id=t;try{i.appendChild(document.createTextNode(e))}catch(t){i.text=e}return document.body.appendChild(i),null}(await t.text(),e)}(e),await qs[e]}const $s="https://www.gstatic.com/draco/versioned/decoders/".concat("1.5.5"),er="".concat($s,"/draco_decoder.js"),tr="".concat($s,"/draco_wasm_wrapper.js"),ir="".concat($s,"/draco_decoder.wasm");"https://raw.githubusercontent.com/google/draco/".concat("1.4.1","/javascript/draco_encoder.js");let nr;async function sr(e){const t=e.modules||{};return nr=t.draco3d?nr||t.draco3d.createDecoderModule({}).then((e=>({draco:e}))):nr||async function(e){let t,i;if("js"===(e.draco&&e.draco.decoderType))t=await Zs(er,"draco",e);else[t,i]=await Promise.all([await Zs(tr,"draco",e),await Zs(ir,"draco",e)]);return t=t||globalThis.DracoDecoderModule,await function(e,t){const i={};t&&(i.wasmBinary=t);return new Promise((t=>{e({...i,onModuleLoaded:e=>t({draco:e})})}))}(t,i)}(e),await nr}const rr={...ds,parse:async function(e,t){const{draco:i}=await sr(t),n=new Qs(i);try{return n.parseSync(e,null==t?void 0:t.draco)}finally{n.destroy()}}};const or={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},ar={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,...or},cr=1/Math.PI*180,hr=1/180*Math.PI,lr={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0};function ur(e,{precision:t=lr.precision}={}){return e=function(e){return Math.round(e/lr.EPSILON)*lr.EPSILON}(e),"".concat(parseFloat(e.toPrecision(t)))}function dr(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function fr(e){return function(e,t){return gr(e,(e=>e*hr),t)}(e)}function pr(e){return function(e,t){return gr(e,(e=>e*cr),t)}(e)}function mr(e,t,i){const n=lr.EPSILON;i&&(lr.EPSILON=i);try{if(e===t)return!0;if(dr(e)&&dr(t)){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(!mr(e[i],t[i]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):"number"==typeof e&&"number"==typeof t&&Math.abs(e-t)<=lr.EPSILON*Math.max(1,Math.abs(e),Math.abs(t))}finally{lr.EPSILON=n}}function gr(e,t,i){if(dr(e)){const n=e;i=i||function(e){return e.clone?e.clone():new Array(e.length)}(n);for(let s=0;s<i.length&&s<n.length;++s)i[s]=t(e[s],s,i);return i}return t(e)}class Ar extends(function(e){function t(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}(Array)){clone(){return(new this.constructor).copy(this)}fromArray(e,t=0){for(let i=0;i<this.ELEMENTS;++i)this[i]=e[i+t];return this.check()}toArray(e=[],t=0){for(let i=0;i<this.ELEMENTS;++i)e[t+i]=this[i];return e}from(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}to(e){return e===this?this:dr(e)?this.toArray(e):this.toObject(e)}toTarget(e){return e?this.to(e):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(lr)}formatString(e){let t="";for(let i=0;i<this.ELEMENTS;++i)t+=(i>0?", ":"")+ur(this[i],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}equals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(!mr(this[t],e[t]))return!1;return!0}exactEquals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(this[t]!==e[t])return!1;return!0}negate(){for(let e=0;e<this.ELEMENTS;++e)this[e]=-this[e];return this.check()}lerp(e,t,i){if(void 0===i)return this.lerp(this,e,t);for(let n=0;n<this.ELEMENTS;++n){const s=e[n];this[n]=s+i*(t[n]-s)}return this.check()}min(e){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.min(e[t],this[t]);return this.check()}max(e){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.max(e[t],this[t]);return this.check()}clamp(e,t){for(let i=0;i<this.ELEMENTS;++i)this[i]=Math.min(Math.max(this[i],e[i]),t[i]);return this.check()}add(...e){for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]+=t[e];return this.check()}subtract(...e){for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]-=t[e];return this.check()}scale(e){if("number"==typeof e)for(let t=0;t<this.ELEMENTS;++t)this[t]*=e;else for(let t=0;t<this.ELEMENTS&&t<e.length;++t)this[t]*=e[t];return this.check()}multiplyByScalar(e){for(let t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}check(){if(lr.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let e=this.length===this.ELEMENTS;for(let t=0;t<this.ELEMENTS;++t)e=e&&Number.isFinite(this[t]);return e}sub(e){return this.subtract(e)}setScalar(e){for(let t=0;t<this.ELEMENTS;++t)this[t]=e;return this.check()}addScalar(e){for(let t=0;t<this.ELEMENTS;++t)this[t]+=e;return this.check()}subScalar(e){return this.addScalar(-e)}multiplyScalar(e){for(let t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}divideScalar(e){return this.multiplyByScalar(1/e)}clampScalar(e,t){for(let i=0;i<this.ELEMENTS;++i)this[i]=Math.min(Math.max(this[i],e),t);return this.check()}get elements(){return this}}function yr(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(e));return e}function br(e,t,i=""){if(lr.debug&&!function(e,t){if(e.length!==t)return!1;for(let t=0;t<e.length;++t)if(!Number.isFinite(e[t]))return!1;return!0}(e,t))throw new Error("math.gl: ".concat(i," some fields set to invalid numbers'"));return e}function Br(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}class vr extends Ar{get x(){return this[0]}set x(e){this[0]=yr(e)}get y(){return this[1]}set y(e){this[1]=yr(e)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let e=0;for(let t=0;t<this.ELEMENTS;++t)e+=this[t]*this[t];return e}magnitudeSquared(){return this.lengthSquared()}distance(e){return Math.sqrt(this.distanceSquared(e))}distanceSquared(e){let t=0;for(let i=0;i<this.ELEMENTS;++i){const n=this[i]-e[i];t+=n*n}return yr(t)}dot(e){let t=0;for(let i=0;i<this.ELEMENTS;++i)t+=this[i]*e[i];return yr(t)}normalize(){const e=this.magnitude();if(0!==e)for(let t=0;t<this.ELEMENTS;++t)this[t]/=e;return this.check()}multiply(...e){for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]*=t[e];return this.check()}divide(...e){for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]/=t[e];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(e){return this.distance(e)}distanceToSquared(e){return this.distanceSquared(e)}getComponent(e){return Br(e>=0&&e<this.ELEMENTS,"index is out of range"),yr(this[e])}setComponent(e,t){return Br(e>=0&&e<this.ELEMENTS,"index is out of range"),this[e]=t,this.check()}addVectors(e,t){return this.copy(e).add(t)}subVectors(e,t){return this.copy(e).subtract(t)}multiplyVectors(e,t){return this.copy(e).multiply(t)}addScaledVector(e,t){return this.add(new this.constructor(e).multiplyScalar(t))}}var Cr=1e-6,wr="undefined"!=typeof Float32Array?Float32Array:Array;Math.random;Math.PI;function Er(){var e=new wr(3);return wr!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function Mr(e){var t=e[0],i=e[1],n=e[2];return Math.hypot(t,i,n)}function Tr(e,t,i){var n=new wr(3);return n[0]=e,n[1]=t,n[2]=i,n}function xr(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Ir(e,t,i){var n=t[0],s=t[1],r=t[2],o=i[0],a=i[1],c=i[2];return e[0]=s*c-r*a,e[1]=r*o-n*c,e[2]=n*a-s*o,e}function Rr(e,t,i){var n=t[0],s=t[1],r=t[2],o=i[3]*n+i[7]*s+i[11]*r+i[15];return o=o||1,e[0]=(i[0]*n+i[4]*s+i[8]*r+i[12])/o,e[1]=(i[1]*n+i[5]*s+i[9]*r+i[13])/o,e[2]=(i[2]*n+i[6]*s+i[10]*r+i[14])/o,e}function Sr(e,t,i){var n=t[0],s=t[1],r=t[2];return e[0]=n*i[0]+s*i[3]+r*i[6],e[1]=n*i[1]+s*i[4]+r*i[7],e[2]=n*i[2]+s*i[5]+r*i[8],e}function Or(e,t,i){var n=i[0],s=i[1],r=i[2],o=i[3],a=t[0],c=t[1],h=t[2],l=s*h-r*c,u=r*a-n*h,d=n*c-s*a,f=s*d-r*u,p=r*l-n*d,m=n*u-s*l,g=2*o;return l*=g,u*=g,d*=g,f*=2,p*=2,m*=2,e[0]=a+l+f,e[1]=c+u+p,e[2]=h+d+m,e}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var Dr,Fr=Mr;Dr=Er();function _r(e,t,i){const n=t[0],s=t[1],r=i[3]*n+i[7]*s||1;return e[0]=(i[0]*n+i[4]*s)/r,e[1]=(i[1]*n+i[5]*s)/r,e}function Gr(e,t,i){const n=t[0],s=t[1],r=t[2],o=i[3]*n+i[7]*s+i[11]*r||1;return e[0]=(i[0]*n+i[4]*s+i[8]*r)/o,e[1]=(i[1]*n+i[5]*s+i[9]*r)/o,e[2]=(i[2]*n+i[6]*s+i[10]*r)/o,e}function Lr(e,t,i){const n=t[0],s=t[1],r=t[2];return e[0]=i[0]*n+i[3]*s+i[6]*r,e[1]=i[1]*n+i[4]*s+i[7]*r,e[2]=i[2]*n+i[5]*s+i[8]*r,e[3]=t[3],e}const Pr=[0,0,0];let kr;class Nr extends vr{static get ZERO(){return kr||(kr=new Nr(0,0,0),Object.freeze(kr)),kr}constructor(e=0,t=0,i=0){super(-0,-0,-0),1===arguments.length&&dr(e)?this.copy(e):(lr.debug&&(yr(e),yr(t),yr(i)),this[0]=e,this[1]=t,this[2]=i)}set(e,t,i){return this[0]=e,this[1]=t,this[2]=i,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this.check()}fromObject(e){return lr.debug&&(yr(e.x),yr(e.y),yr(e.z)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e}get ELEMENTS(){return 3}get z(){return this[2]}set z(e){this[2]=yr(e)}angle(e){return function(e,t){var i=e[0],n=e[1],s=e[2],r=t[0],o=t[1],a=t[2],c=Math.sqrt(i*i+n*n+s*s)*Math.sqrt(r*r+o*o+a*a),h=c&&xr(e,t)/c;return Math.acos(Math.min(Math.max(h,-1),1))}(this,e)}cross(e){return Ir(this,this,e),this.check()}rotateX({radians:e,origin:t=Pr}){return function(e,t,i,n){var s=[],r=[];s[0]=t[0]-i[0],s[1]=t[1]-i[1],s[2]=t[2]-i[2],r[0]=s[0],r[1]=s[1]*Math.cos(n)-s[2]*Math.sin(n),r[2]=s[1]*Math.sin(n)+s[2]*Math.cos(n),e[0]=r[0]+i[0],e[1]=r[1]+i[1],e[2]=r[2]+i[2]}(this,this,t,e),this.check()}rotateY({radians:e,origin:t=Pr}){return function(e,t,i,n){var s=[],r=[];s[0]=t[0]-i[0],s[1]=t[1]-i[1],s[2]=t[2]-i[2],r[0]=s[2]*Math.sin(n)+s[0]*Math.cos(n),r[1]=s[1],r[2]=s[2]*Math.cos(n)-s[0]*Math.sin(n),e[0]=r[0]+i[0],e[1]=r[1]+i[1],e[2]=r[2]+i[2]}(this,this,t,e),this.check()}rotateZ({radians:e,origin:t=Pr}){return function(e,t,i,n){var s=[],r=[];s[0]=t[0]-i[0],s[1]=t[1]-i[1],s[2]=t[2]-i[2],r[0]=s[0]*Math.cos(n)-s[1]*Math.sin(n),r[1]=s[0]*Math.sin(n)+s[1]*Math.cos(n),r[2]=s[2],e[0]=r[0]+i[0],e[1]=r[1]+i[1],e[2]=r[2]+i[2]}(this,this,t,e),this.check()}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return Rr(this,this,e),this.check()}transformAsVector(e){return Gr(this,this,e),this.check()}transformByMatrix3(e){return Sr(this,this,e),this.check()}transformByMatrix2(e){return function(e,t,i){const n=t[0],s=t[1];e[0]=i[0]*n+i[2]*s,e[1]=i[1]*n+i[3]*s,e[2]=t[2]}(this,this,e),this.check()}transformByQuaternion(e){return Or(this,this,e),this.check()}}const Ur={[or.DOUBLE]:Float64Array,[or.FLOAT]:Float32Array,[or.UNSIGNED_SHORT]:Uint16Array,[or.UNSIGNED_INT]:Uint32Array,[or.UNSIGNED_BYTE]:Uint8Array,[or.BYTE]:Int8Array,[or.SHORT]:Int16Array,[or.INT]:Int32Array},Hr={DOUBLE:or.DOUBLE,FLOAT:or.FLOAT,UNSIGNED_SHORT:or.UNSIGNED_SHORT,UNSIGNED_INT:or.UNSIGNED_INT,UNSIGNED_BYTE:or.UNSIGNED_BYTE,BYTE:or.BYTE,SHORT:or.SHORT,INT:or.INT},jr="Failed to convert GL type";class Jr{static fromTypedArray(e){e=ArrayBuffer.isView(e)?e.constructor:e;for(const t in Ur){if(Ur[t]===e)return t}throw new Error(jr)}static fromName(e){const t=Hr[e];if(!t)throw new Error(jr);return t}static getArrayType(e){switch(e){case or.UNSIGNED_SHORT_5_6_5:case or.UNSIGNED_SHORT_4_4_4_4:case or.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:const t=Ur[e];if(!t)throw new Error(jr);return t}}static getByteSize(e){return Jr.getArrayType(e).BYTES_PER_ELEMENT}static validate(e){return Boolean(Jr.getArrayType(e))}static createTypedArray(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0;void 0===n&&(n=(t.byteLength-i)/Jr.getByteSize(e));return new(Jr.getArrayType(e))(t,i,n)}}class Vr{constructor(e,t){Ti(this,"json",void 0),Ti(this,"buffer",void 0),Ti(this,"featuresLength",0),Ti(this,"_cachedTypedArrays",{}),this.json=e,this.buffer=t}getExtension(e){return this.json.extensions&&this.json.extensions[e]}hasProperty(e){return Boolean(this.json[e])}getGlobalProperty(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ar.UNSIGNED_INT,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const n=this.json[e];return n&&Number.isFinite(n.byteOffset)?this._getTypedArrayFromBinary(e,t,i,1,n.byteOffset):n}getPropertyArray(e,t,i){const n=this.json[e];return n&&Number.isFinite(n.byteOffset)?("componentType"in n&&(t=Jr.fromName(n.componentType)),this._getTypedArrayFromBinary(e,t,i,this.featuresLength,n.byteOffset)):this._getTypedArrayFromArray(e,t,n)}getProperty(e,t,i,n,s){const r=this.json[e];if(!r)return r;const o=this.getPropertyArray(e,t,i);if(1===i)return o[n];for(let e=0;e<i;++e)s[e]=o[i*n+e];return s}_getTypedArrayFromBinary(e,t,i,n,s){const r=this._cachedTypedArrays;let o=r[e];return o||(o=Jr.createTypedArray(t,this.buffer.buffer,this.buffer.byteOffset+s,n*i),r[e]=o),o}_getTypedArrayFromArray(e,t,i){const n=this._cachedTypedArrays;let s=n[e];return s||(s=Jr.createTypedArray(t,i),n[e]=s),s}}const zr={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Kr={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]]},Wr={SCALAR:(e,t,i)=>{t[i]=e},VEC2:(e,t,i)=>{t[2*i+0]=e[0],t[2*i+1]=e[1]},VEC3:(e,t,i)=>{t[3*i+0]=e[0],t[3*i+1]=e[1],t[3*i+2]=e[2]},VEC4:(e,t,i)=>{t[4*i+0]=e[0],t[4*i+1]=e[1],t[4*i+2]=e[2],t[4*i+3]=e[3]},MAT2:(e,t,i)=>{t[4*i+0]=e[0],t[4*i+1]=e[1],t[4*i+2]=e[2],t[4*i+3]=e[3]},MAT3:(e,t,i)=>{t[9*i+0]=e[0],t[9*i+1]=e[1],t[9*i+2]=e[2],t[9*i+3]=e[3],t[9*i+4]=e[4],t[9*i+5]=e[5],t[9*i+6]=e[6],t[9*i+7]=e[7],t[9*i+8]=e[8],t[9*i+9]=e[9]},MAT4:(e,t,i)=>{t[16*i+0]=e[0],t[16*i+1]=e[1],t[16*i+2]=e[2],t[16*i+3]=e[3],t[16*i+4]=e[4],t[16*i+5]=e[5],t[16*i+6]=e[6],t[16*i+7]=e[7],t[16*i+8]=e[8],t[16*i+9]=e[9],t[16*i+10]=e[10],t[16*i+11]=e[11],t[16*i+12]=e[12],t[16*i+13]=e[13],t[16*i+14]=e[14],t[16*i+15]=e[15]}};const Qr=e=>void 0!==e;function Xr(e,t,i){if(!t)return null;let n=e.getExtension("3DTILES_batch_table_hierarchy");const s=t.HIERARCHY;return s&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),t.extensions=t.extensions||{},t.extensions["3DTILES_batch_table_hierarchy"]=s,n=s),n?function(e,t){let i,n,s;const r=e.instancesLength,o=e.classes;let a,c=e.classIds,h=e.parentCounts,l=e.parentIds,u=r;Qr(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,GL.UNSIGNED_SHORT),c.type=AttributeType.SCALAR,s=getBinaryAccessor(c),c=s.createArrayBufferView(t.buffer,t.byteOffset+c.byteOffset,r));if(Qr(h))for(Qr(h.byteOffset)&&(h.componentType=defaultValue(h.componentType,GL.UNSIGNED_SHORT),h.type=AttributeType.SCALAR,s=getBinaryAccessor(h),h=s.createArrayBufferView(t.buffer,t.byteOffset+h.byteOffset,r)),a=new Uint16Array(r),u=0,i=0;i<r;++i)a[i]=u,u+=h[i];Qr(l)&&Qr(l.byteOffset)&&(l.componentType=defaultValue(l.componentType,GL.UNSIGNED_SHORT),l.type=AttributeType.SCALAR,s=getBinaryAccessor(l),l=s.createArrayBufferView(t.buffer,t.byteOffset+l.byteOffset,u));const d=o.length;for(i=0;i<d;++i){const e=o[i].length,n=o[i].instances,s=getBinaryProperties(e,n,t);o[i].instances=combine(s,n)}const f=new Array(d).fill(0),p=new Uint16Array(r);for(i=0;i<r;++i)n=c[i],p[i]=f[n],++f[n];const m={classes:o,classIds:c,classIndexes:p,parentCounts:h,parentIndexes:a,parentIds:l};return function(e){const t=e.classIds,i=t.length;for(let t=0;t<i;++t)qr(e,t,stack)}(m),m}(n,i):null}function Yr(e,t,i){if(!e)return;const n=e.parentCounts;return e.parentIds?i(e,t):n>0?function(e,t,i){const n=e.classIds,s=e.parentCounts,r=e.parentIds,o=e.parentIndexes,a=n.length,c=scratchVisited;c.length=Math.max(c.length,a);const h=++marker,l=scratchStack;l.length=0,l.push(t);for(;l.length>0;){if(c[t=l.pop()]===h)continue;c[t]=h;const n=i(e,t);if(Qr(n))return n;const a=s[t],u=o[t];for(let e=0;e<a;++e){const i=r[u+e];i!==t&&l.push(i)}}return null}(e,t,i):function(e,t,i){let n=!0;for(;n;){const s=i(e,t);if(Qr(s))return s;const r=e.parentIds[t];n=r!==t,t=r}throw new Error("traverseHierarchySingleParent")}(e,t,i)}function qr(e,t,i){const n=e.parentCounts,s=e.parentIds,r=e.parentIndexes,o=e.classIds.length;if(!Qr(s))return;assert(t<o,"Parent index ".concat(t," exceeds the total number of instances: ").concat(o)),assert(-1===i.indexOf(t),"Circular dependency detected in the batch table hierarchy."),i.push(t);const a=Qr(n)?n[t]:1,c=Qr(n)?r[t]:t;for(let n=0;n<a;++n){const r=s[c+n];r!==t&&qr(e,r,i)}i.pop(t)}function Zr(e){return null!=e}const $r=(e,t)=>e,eo={HIERARCHY:!0,extensions:!0,extras:!0};class to{constructor(e,t,i){var n;let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};Ti(this,"json",void 0),Ti(this,"binary",void 0),Ti(this,"featureCount",void 0),Ti(this,"_extensions",void 0),Ti(this,"_properties",void 0),Ti(this,"_binaryProperties",void 0),Ti(this,"_hierarchy",void 0),li(i>=0),this.json=e||{},this.binary=t,this.featureCount=i,this._extensions=(null===(n=this.json)||void 0===n?void 0:n.extensions)||{},this._properties={};for(const e in this.json)eo[e]||(this._properties[e]=this.json[e]);this._binaryProperties=this._initializeBinaryProperties(),s["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=Xr(this,this.json,this.binary))}getExtension(e){return this.json&&this.json.extensions&&this.json.extensions[e]}memorySizeInBytes(){return 0}isClass(e,t){if(this._checkBatchId(e),li("string"==typeof t,t),this._hierarchy){return Zr(Yr(this._hierarchy,e,((e,i)=>{const n=e.classIds[i];return e.classes[n].name===t})))}return!1}isExactClass(e,t){return li("string"==typeof t,t),this.getExactClassName(e)===t}getExactClassName(e){if(this._checkBatchId(e),this._hierarchy){const t=this._hierarchy.classIds[e];return this._hierarchy.classes[t].name}}hasProperty(e,t){return this._checkBatchId(e),li("string"==typeof t,t),Zr(this._properties[t])||this._hasPropertyInHierarchy(e,t)}getPropertyNames(e,t){this._checkBatchId(e),(t=Zr(t)?t:[]).length=0;const i=Object.keys(this._properties);return t.push(...i),this._hierarchy&&this._getPropertyNamesInHierarchy(e,t),t}getProperty(e,t){if(this._checkBatchId(e),li("string"==typeof t,t),this._binaryProperties){const i=this._binaryProperties[t];if(Zr(i))return this._getBinaryProperty(i,e)}const i=this._properties[t];if(Zr(i))return $r(i[e]);if(this._hierarchy){const i=this._getHierarchyProperty(e,t);if(Zr(i))return i}}setProperty(e,t,i){const n=this.featureCount;if(this._checkBatchId(e),li("string"==typeof t,t),this._binaryProperties){const n=this._binaryProperties[t];if(n)return void this._setBinaryProperty(n,e,i)}if(this._hierarchy&&this._setHierarchyProperty(this,e,t,i))return;let s=this._properties[t];Zr(s)||(this._properties[t]=new Array(n),s=this._properties[t]),s[e]=$r(i)}_checkBatchId(e){if(!(e>=0&&e<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}_getBinaryProperty(e,t){return e.unpack(e.typedArray,t)}_setBinaryProperty(e,t,i){e.pack(i,e.typedArray,t)}_initializeBinaryProperties(){let e=null;for(const t in this._properties){const i=this._properties[t],n=this._initializeBinaryProperty(t,i);n&&(e=e||{},e[t]=n)}return e}_initializeBinaryProperty(e,t){if("byteOffset"in t){const i=t;li(this.binary,"Property ".concat(e," requires a batch table binary.")),li(i.type,"Property ".concat(e," requires a type."));const n=function(e,t,i,n){const{componentType:s}=e;li(e.componentType);const r="string"==typeof s?Jr.fromName(s):s,o=zr[e.type],a=Kr[e.type],c=Wr[e.type];return i+=e.byteOffset,{values:Jr.createTypedArray(r,t,i,o*n),type:r,size:o,unpacker:a,packer:c}}(i,this.binary.buffer,0|this.binary.byteOffset,this.featureCount);return{typedArray:n.values,componentCount:n.size,unpack:n.unpacker,pack:n.packer}}return null}_hasPropertyInHierarchy(e,t){if(!this._hierarchy)return!1;const i=Yr(this._hierarchy,e,((e,i)=>{const n=e.classIds[i];return Zr(e.classes[n].instances[t])}));return Zr(i)}_getPropertyNamesInHierarchy(e,t){Yr(this._hierarchy,e,((e,i)=>{const n=e.classIds[i],s=e.classes[n].instances;for(const e in s)s.hasOwnProperty(e)&&-1===t.indexOf(e)&&t.push(e)}))}_getHierarchyProperty(e,t){return Yr(this._hierarchy,e,((e,i)=>{const n=e.classIds[i],s=e.classes[n],r=e.classIndexes[i],o=s.instances[t];return Zr(o)?Zr(o.typedArray)?this._getBinaryProperty(o,r):$r(o[r]):null}))}_setHierarchyProperty(e,t,i,n){const s=Yr(this._hierarchy,t,((e,s)=>{const r=e.classIds[s],o=e.classes[r],a=e.classIndexes[s],c=o.instances[i];return!!Zr(c)&&(li(s===t,'Inherited property "'.concat(i,'" is read-only.')),Zr(c.typedArray)?this._setBinaryProperty(c,a,n):c[a]=$r(n),!0)}));return Zr(s)}}const io=4;function no(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=new DataView(t);if(e.magic=n.getUint32(i,!0),i+=io,e.version=n.getUint32(i,!0),i+=io,e.byteLength=n.getUint32(i,!0),i+=io,1!==e.version)throw new Error("3D Tile Version ".concat(e.version," not supported"));return i}const so=4,ro="b3dm tile in legacy format.";function oo(e,t,i){const n=new DataView(t);let s;e.header=e.header||{};let r=n.getUint32(i,!0);i+=so;let o=n.getUint32(i,!0);i+=so;let a=n.getUint32(i,!0);i+=so;let c=n.getUint32(i,!0);return i+=so,a>=570425344?(i-=2*so,s=r,a=o,c=0,r=0,o=0,console.warn(ro)):c>=570425344&&(i-=so,s=a,a=r,c=o,r=0,o=0,console.warn(ro)),e.header.featureTableJsonByteLength=r,e.header.featureTableBinaryByteLength=o,e.header.batchTableJsonByteLength=a,e.header.batchTableBinaryByteLength=c,e.header.batchLength=s,i}function ao(e,t,i,n){return i=function(e,t,i,n){const{featureTableJsonByteLength:s,featureTableBinaryByteLength:r,batchLength:o}=e.header;if(e.featureTableJson={BATCH_LENGTH:o||0},s>0){const n=hs(t,i,s);e.featureTableJson=JSON.parse(n)}return i+=s,e.featureTableBinary=new Uint8Array(t,i,r),i+=r,i}(e,t,i),i=function(e,t,i,n){const{batchTableJsonByteLength:s,batchTableBinaryByteLength:r}=e.header;if(s>0){const n=hs(t,i,s);e.batchTableJson=JSON.parse(n),i+=s,r>0&&(e.batchTableBinary=new Uint8Array(t,i,r),e.batchTableBinary=new Uint8Array(e.batchTableBinary),i+=r)}return i}(e,t,i),i}function co(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];const i=e>>11&31,n=e>>5&63,s=31&e;return t[0]=i<<3,t[1]=n<<2,t[2]=s<<3,t}function ho(e,t,i){if(!(t||e&&e.batchIds&&i))return null;const{batchIds:n,isRGB565:s,pointCount:r}=e;if(n&&i){const e=new Uint8ClampedArray(3*r);for(let t=0;t<r;t++){const s=n[t],r=i.getProperty(s,"dimensions").map((e=>255*e));e[3*t]=r[0],e[3*t+1]=r[1],e[3*t+2]=r[2]}return{type:ar.UNSIGNED_BYTE,value:e,size:3,normalized:!0}}if(s){const e=new Uint8ClampedArray(3*r);for(let i=0;i<r;i++){const n=co(t[i]);e[3*i]=n[0],e[3*i+1]=n[1],e[3*i+2]=n[2]}return{type:ar.UNSIGNED_BYTE,value:e,size:3,normalized:!0}}return t&&t.length===3*r?{type:ar.UNSIGNED_BYTE,value:t,size:3,normalized:!0}:{type:ar.UNSIGNED_BYTE,value:t,size:4,normalized:!0}}function lo(e,t,i){var n=t[0],s=t[1];return e[0]=i[0]*n+i[3]*s+i[6],e[1]=i[1]*n+i[4]*s+i[7],e}function uo(e,t,i){var n=t[0],s=t[1];return e[0]=i[0]*n+i[4]*s+i[12],e[1]=i[1]*n+i[5]*s+i[13],e}!function(){var e,t=(e=new wr(2),wr!=Float32Array&&(e[0]=0,e[1]=0),e)}();class fo extends vr{constructor(e=0,t=0){super(2),dr(e)&&1===arguments.length?this.copy(e):(lr.debug&&(yr(e),yr(t)),this[0]=e,this[1]=t)}set(e,t){return this[0]=e,this[1]=t,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this.check()}fromObject(e){return lr.debug&&(yr(e.x),yr(e.y)),this[0]=e.x,this[1]=e.y,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e}get ELEMENTS(){return 2}horizontalAngle(){return Math.atan2(this.y,this.x)}verticalAngle(){return Math.atan2(this.x,this.y)}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return uo(this,this,e),this.check()}transformAsVector(e){return _r(this,this,e),this.check()}transformByMatrix3(e){return lo(this,this,e),this.check()}transformByMatrix2x3(e){return function(e,t,i){var n=t[0],s=t[1];e[0]=i[0]*n+i[2]*s+i[4],e[1]=i[1]*n+i[3]*s+i[5]}(this,this,e),this.check()}transformByMatrix2(e){return function(e,t,i){var n=t[0],s=t[1];e[0]=i[0]*n+i[2]*s,e[1]=i[1]*n+i[3]*s}(this,this,e),this.check()}}new fo,new Nr,new fo,new fo,new Uint8Array(1);function po(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:255;return function(e,t,i){return gr(e,(e=>Math.max(t,Math.min(i,e))))}(e,0,t)/t*2-1}function mo(e){return e<0?-1:1}function go(e,t,i,n){if(function(e,t){if(!e)throw new Error("math.gl assertion failed. ".concat(t))}(n),e<0||e>i||t<0||t>i)throw new Error("x and y must be unsigned normalized integers between 0 and ".concat(i));if(n.x=po(e,i),n.y=po(t,i),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){const e=n.x;n.x=(1-Math.abs(n.y))*mo(e),n.y=(1-Math.abs(e))*mo(n.y)}return n.normalize()}function Ao(e,t,i){return go(e,t,255,i)}const yo=new Nr;function bo(e,t,i){return e.isQuantized?i["3d-tiles"]&&i["3d-tiles"].decodeQuantizedPositions?(e.isQuantized=!1,function(e,t){const i=new Nr,n=new Float32Array(3*e.pointCount);for(let s=0;s<e.pointCount;s++)i.set(t[3*s],t[3*s+1],t[3*s+2]).scale(1/e.quantizedRange).multiply(e.quantizedVolumeScale).add(e.quantizedVolumeOffset).toArray(n,3*s);return n}(e,t)):{type:ar.UNSIGNED_SHORT,value:t,size:3,normalized:!0}:t}async function Bo(e,t,i,n,s){i=ao(e,t,i=oo(e,t,i=no(e,t,i))),function(e){e.attributes={positions:null,colors:null,normals:null,batchIds:null},e.isQuantized=!1,e.isTranslucent=!1,e.isRGB565=!1,e.isOctEncoded16P=!1}(e);const{featureTable:r,batchTable:o}=function(e){const t=new Vr(e.featureTableJson,e.featureTableBinary),i=t.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(i))throw new Error("POINTS_LENGTH must be defined");t.featuresLength=i,e.featuresLength=i,e.pointsLength=i,e.pointCount=i,e.rtcCenter=t.getGlobalProperty("RTC_CENTER",ar.FLOAT,3);const n=function(e,t){let i=null;if(!e.batchIds&&t.hasProperty("BATCH_ID")&&(e.batchIds=t.getPropertyArray("BATCH_ID",ar.UNSIGNED_SHORT,1),e.batchIds)){const n=t.getGlobalProperty("BATCH_LENGTH");if(!n)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");const{batchTableJson:s,batchTableBinary:r}=e;i=new to(s,r,n)}return i}(e,t);return{featureTable:t,batchTable:n}}(e);return await async function(e,t,i,n,s){let r,o,a;const c=e.batchTableJson&&e.batchTableJson.extensions&&e.batchTableJson.extensions["3DTILES_draco_point_compression"];c&&(a=c.properties);const h=t.getExtension("3DTILES_draco_point_compression");if(h){o=h.properties;const t=h.byteOffset,i=h.byteLength;if(!o||!Number.isFinite(t)||!i)throw new Error("Draco properties, byteOffset, and byteLength must be defined");r=e.featureTableBinary.slice(t,t+i),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(!r)return!0;const l={buffer:r,properties:{...o,...a},featureTableProperties:o,batchTableProperties:a,dequantizeInShader:!1};return await async function(e,t,i,n){const{parse:s}=n,r={...i,draco:{...i.draco,extraAttributes:t.batchTableProperties||{}}};delete r["3d-tiles"];const o=await s(t.buffer,rr,r),a=o.attributes.POSITION&&o.attributes.POSITION.value,c=o.attributes.COLOR_0&&o.attributes.COLOR_0.value,h=o.attributes.NORMAL&&o.attributes.NORMAL.value,l=o.attributes.BATCH_ID&&o.attributes.BATCH_ID.value,u=a&&o.attributes.POSITION.value.quantization,d=h&&o.attributes.NORMAL.value.quantization;if(u){const t=o.POSITION.data.quantization,i=t.range;e.quantizedVolumeScale=new Nr(i,i,i),e.quantizedVolumeOffset=new Nr(t.minValues),e.quantizedRange=(1<<t.quantizationBits)-1,e.isQuantizedDraco=!0}d&&(e.octEncodedRange=(1<<o.NORMAL.data.quantization.quantizationBits)-1,e.isOctEncodedDraco=!0);const f={};if(t.batchTableProperties)for(const e of Object.keys(t.batchTableProperties))o.attributes[e]&&o.attributes[e].value&&(f[e.toLowerCase()]=o.attributes[e].value);e.attributes={positions:a,colors:ho(e,c,void 0),normals:h,batchIds:l,...f}}(e,l,n,s)}(e,r,0,n,s),function(e,t,i){if(!e.attributes.positions)if(t.hasProperty("POSITION"))e.attributes.positions=t.getPropertyArray("POSITION",ar.FLOAT,3);else if(t.hasProperty("POSITION_QUANTIZED")){const n=t.getPropertyArray("POSITION_QUANTIZED",ar.UNSIGNED_SHORT,3);if(e.isQuantized=!0,e.quantizedRange=65535,e.quantizedVolumeScale=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",ar.FLOAT,3),!e.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(e.quantizedVolumeOffset=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",ar.FLOAT,3),!e.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");e.attributes.positions=bo(e,n,i)}if(!e.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}(e,r,n),function(e,t,i){if(!e.attributes.colors){let n=null;t.hasProperty("RGBA")?(n=t.getPropertyArray("RGBA",ar.UNSIGNED_BYTE,4),e.isTranslucent=!0):t.hasProperty("RGB")?n=t.getPropertyArray("RGB",ar.UNSIGNED_BYTE,3):t.hasProperty("RGB565")&&(n=t.getPropertyArray("RGB565",ar.UNSIGNED_SHORT,1),e.isRGB565=!0),e.attributes.colors=ho(e,n,i)}t.hasProperty("CONSTANT_RGBA")&&(e.constantRGBA=t.getGlobalProperty("CONSTANT_RGBA",ar.UNSIGNED_BYTE,4))}(e,r,o),function(e,t){if(!e.attributes.normals){let i=null;t.hasProperty("NORMAL")?i=t.getPropertyArray("NORMAL",ar.FLOAT,3):t.hasProperty("NORMAL_OCT16P")&&(i=t.getPropertyArray("NORMAL_OCT16P",ar.UNSIGNED_BYTE,2),e.isOctEncoded16P=!0),e.attributes.normals=function(e,t){if(!t)return null;if(e.isOctEncoded16P){const i=new Float32Array(3*e.pointsLength);for(let n=0;n<e.pointsLength;n++)Ao(t[2*n],t[2*n+1],yo),yo.toArray(i,3*n);return{type:ar.FLOAT,size:2,value:i}}return{type:ar.FLOAT,size:2,value:t}}(e,i)}}(e,r),i}const vo="3.4.4",Co="https://unpkg.com/@loaders.gl/textures@".concat(vo,"/dist/libs/basis_encoder.wasm"),wo="https://unpkg.com/@loaders.gl/textures@".concat(vo,"/dist/libs/basis_encoder.js");let Eo,Mo;async function To(e){const t=e.modules||{};return t.basis?t.basis:(Eo=Eo||async function(e){let t=null,i=null;return[t,i]=await Promise.all([await Zs("basis_transcoder.js","textures",e),await Zs("basis_transcoder.wasm","textures",e)]),t=t||globalThis.BASIS,await function(e,t){const i={};t&&(i.wasmBinary=t);return new Promise((t=>{e(i).then((e=>{const{BasisFile:i,initializeBasis:n}=e;n(),t({BasisFile:i})}))}))}(t,i)}(e),await Eo)}async function xo(e){const t=e.modules||{};return t.basisEncoder?t.basisEncoder:(Mo=Mo||async function(e){let t=null,i=null;return[t,i]=await Promise.all([await Zs(wo,"textures",e),await Zs(Co,"textures",e)]),t=t||globalThis.BASIS,await function(e,t){const i={};t&&(i.wasmBinary=t);return new Promise((t=>{e(i).then((e=>{const{BasisFile:i,KTX2File:n,initializeBasis:s,BasisEncoder:r}=e;s(),t({BasisFile:i,KTX2File:n,BasisEncoder:r})}))}))}(t,i)}(e),await Mo)}const Io=33776,Ro=33779,So=35840,Oo=35842,Do=36196,Fo=37808,_o=["","WEBKIT_","MOZ_"],Go={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"};let Lo=null;function Po(e){if(!Lo){e=e||function(){try{return document.createElement("canvas").getContext("webgl")}catch(e){return null}}()||void 0,Lo=new Set;for(const t of _o)for(const i in Go)if(e&&e.getExtension("".concat(t).concat(i))){const e=Go[i];Lo.add(e)}}return Lo}new Uint8Array([0]);var ko,No,Uo,Ho,jo,Jo,Vo,zo;!function(e){e[e.NONE=0]="NONE",e[e.BASISLZ=1]="BASISLZ",e[e.ZSTD=2]="ZSTD",e[e.ZLIB=3]="ZLIB"}(ko||(ko={})),function(e){e[e.BASICFORMAT=0]="BASICFORMAT"}(No||(No={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.ETC1S=163]="ETC1S",e[e.UASTC=166]="UASTC"}(Uo||(Uo={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SRGB=1]="SRGB"}(Ho||(Ho={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.LINEAR=1]="LINEAR",e[e.SRGB=2]="SRGB",e[e.ITU=3]="ITU",e[e.NTSC=4]="NTSC",e[e.SLOG=5]="SLOG",e[e.SLOG2=6]="SLOG2"}(jo||(jo={})),function(e){e[e.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",e[e.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(Jo||(Jo={})),function(e){e[e.RGB=0]="RGB",e[e.RRR=3]="RRR",e[e.GGG=4]="GGG",e[e.AAA=15]="AAA"}(Vo||(Vo={})),function(e){e[e.RGB=0]="RGB",e[e.RGBA=3]="RGBA",e[e.RRR=4]="RRR",e[e.RRRG=5]="RRRG"}(zo||(zo={}));const Ko=[171,75,84,88,32,50,48,187,13,10,26,10];const Wo={etc1:{basisFormat:0,compressed:!0,format:Do},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:Io},bc3:{basisFormat:3,compressed:!0,format:Ro},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:So},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:Oo},"astc-4x4":{basisFormat:10,compressed:!0,format:Fo},"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}};function Qo(e,t,i){const n=new e(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("Failed to start basis transcoding");const e=n.getNumImages(),t=[];for(let s=0;s<e;s++){const e=n.getNumLevels(s),r=[];for(let t=0;t<e;t++)r.push(Xo(n,s,t,i));t.push(r)}return t}finally{n.close(),n.delete()}}function Xo(e,t,i,n){const s=e.getImageWidth(t,i),r=e.getImageHeight(t,i),o=e.getHasAlpha(),{compressed:a,format:c,basisFormat:h}=Zo(n,o),l=e.getImageTranscodedSizeInBytes(t,i,h),u=new Uint8Array(l);if(!e.transcodeImage(u,t,i,h,0,0))throw new Error("failed to start Basis transcoding");return{width:s,height:r,data:u,compressed:a,format:c,hasAlpha:o}}function Yo(e,t,i){const n=new e(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("failed to start KTX2 transcoding");const e=n.getLevels(),t=[];for(let s=0;s<e;s++){t.push(qo(n,s,i));break}return[t]}finally{n.close(),n.delete()}}function qo(e,t,i){const{alphaFlag:n,height:s,width:r}=e.getImageLevelInfo(t,0,0),{compressed:o,format:a,basisFormat:c}=Zo(i,n),h=e.getImageTranscodedSizeInBytes(t,0,0,c),l=new Uint8Array(h);if(!e.transcodeImage(l,t,0,0,c,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:r,height:s,data:l,compressed:o,levelSize:h,hasAlpha:n,format:a}}function Zo(e,t){let i=e&&e.basis&&e.basis.format;return"auto"===i&&(i=$o()),"object"==typeof i&&(i=t?i.alpha:i.noAlpha),i=i.toLowerCase(),Wo[i]}function $o(){const e=Po();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"}const ea={name:"Basis",id:dn?"basis":"basis-nodejs",module:"textures",version:"3.4.4",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"}}},ta={...ea,parse:async function(e,t){if("auto"===t.basis.containerFormat){if(function(e){const 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])}(e)){return Yo((await xo(t)).KTX2File,e,t)}const{BasisFile:i}=await To(t);return Qo(i,e,t)}if("encoder"===t.basis.module){const i=await xo(t);return"ktx2"===t.basis.containerFormat?Yo(i.KTX2File,e,t):Qo(i.BasisFile,e,t)}{const{BasisFile:i}=await To(t);return Qo(i,e,t)}}},{_parseImageNode:ia}=globalThis,na="undefined"!=typeof Image,sa="undefined"!=typeof ImageBitmap,ra=Boolean(ia),oa=!!Xi||ra;function aa(e){const t=ha(e);if(!t)throw new Error("Not an image");return t}function ca(e){switch(aa(e)){case"data":return e;case"image":case"imagebitmap":const t=document.createElement("canvas"),i=t.getContext("2d");if(!i)throw new Error("getImageData");return t.width=e.width,t.height=e.height,i.drawImage(e,0,0),i.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}function ha(e){return"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&e instanceof Image?"image":e&&"object"==typeof e&&e.data&&e.width&&e.height?"data":null}const la=/^data:image\/svg\+xml/,ua=/\.svg((\?|#).*)?$/;function da(e){return e&&(la.test(e)||ua.test(e))}function fa(e,t){if(da(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function pa(e,t,i){const n=function(e,t){if(da(t)){let t=(new TextDecoder).decode(e);try{"function"==typeof unescape&&"function"==typeof encodeURIComponent&&(t=unescape(encodeURIComponent(t)))}catch(e){throw new Error(e.message)}return"data:image/svg+xml;base64,".concat(btoa(t))}return fa(e,t)}(e,i),s=self.URL||self.webkitURL,r="string"!=typeof n&&s.createObjectURL(n);try{return await async function(e,t){const i=new Image;if(i.src=e,t.image&&t.image.decode&&i.decode)return await i.decode(),i;return await new Promise(((t,n)=>{try{i.onload=()=>t(i),i.onerror=t=>n(new Error("Could not load image ".concat(e,": ").concat(t)))}catch(e){n(e)}}))}(r||n,t)}finally{r&&s.revokeObjectURL(r)}}const ma={};let ga=!0;async function Aa(e,t,i){let n;if(da(i)){n=await pa(e,t,i)}else n=fa(e,i);const s=t&&t.imagebitmap;return await async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;!function(e){for(const t in e||ma)return!1;return!0}(t)&&ga||(t=null);if(t)try{return await createImageBitmap(e,t)}catch(e){console.warn(e),ga=!1}return await createImageBitmap(e)}(n,s)}function ya(e){return function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=(s=t,[...s].map((e=>e.charCodeAt(0))));var s;for(let t=0;t<n.length;++t)if(n[t]!==e[t+i])return!1;return!0}(e,"ftyp",4)?0==(96&e[8])?null:function(e){switch((t=e,i=8,n=12,String.fromCharCode(...t.slice(i,n))).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}var t,i,n}(e):null}const ba=!1,Ba=!0;function va(e){const t=Ca(e);return function(e){const t=Ca(e),i=t.byteLength>=24&&2303741511===t.getUint32(0,ba);if(!i)return null;return{mimeType:"image/png",width:t.getUint32(16,ba),height:t.getUint32(20,ba)}}(t)||function(e){const t=Ca(e),i=t.byteLength>=3&&65496===t.getUint16(0,ba)&&255===t.getUint8(2);if(!i)return null;const{tableMarkers:n,sofMarkers:s}=function(){const e=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)e.add(t);const t=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:e,sofMarkers:t}}();let r=2;for(;r+9<t.byteLength;){const e=t.getUint16(r,ba);if(s.has(e))return{mimeType:"image/jpeg",height:t.getUint16(r+5,ba),width:t.getUint16(r+7,ba)};if(!n.has(e))return null;r+=2,r+=t.getUint16(r,ba)}return null}(t)||function(e){const t=Ca(e),i=t.byteLength>=10&&1195984440===t.getUint32(0,ba);if(!i)return null;return{mimeType:"image/gif",width:t.getUint16(6,Ba),height:t.getUint16(8,Ba)}}(t)||function(e){const t=Ca(e),i=t.byteLength>=14&&16973===t.getUint16(0,ba)&&t.getUint32(2,Ba)===t.byteLength;if(!i)return null;return{mimeType:"image/bmp",width:t.getUint32(18,Ba),height:t.getUint32(22,Ba)}}(t)||function(e){const t=new Uint8Array(e instanceof DataView?e.buffer:e),i=ya(t);if(!i)return null;return{mimeType:i.mimeType,width:0,height:0}}(t)}function Ca(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")}const wa={id:"image",module:"images",name:"Images",version:"3.4.4",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],parse:async function(e,t,i){const n=((t=t||{}).image||{}).type||"auto",{url:s}=i||{};let r;switch(function(e){switch(e){case"auto":case"data":return function(){if(sa)return"imagebitmap";if(na)return"image";if(oa)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(e){switch(e){case"auto":return sa||na||oa;case"imagebitmap":return sa;case"image":return na;case"data":return oa;default:throw new Error("@loaders.gl/images: image ".concat(e," not supported in this environment"))}}(e),e}}(n)){case"imagebitmap":r=await Aa(e,t,s);break;case"image":r=await pa(e,t,s);break;case"data":r=await async function(e,t){const{mimeType:i}=va(e)||{},n=globalThis._parseImageNode;return li(n),await n(e,i)}(e);break;default:li(!1)}return"data"===n&&(r=ca(r)),r},tests:[e=>Boolean(va(new DataView(e)))],options:{image:{type:"auto",decode:!0}}};function Ea(e,t,i){if(e.byteLength<=t+i)return"";const n=new DataView(e);let s="";for(let e=0;e<i;e++)s+=String.fromCharCode(n.getUint8(t+e));return s}function Ma(e){try{return JSON.parse(e)}catch(t){throw new Error('Failed to parse JSON from data starting with "'.concat(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if("string"==typeof e)return e.slice(0,t);if(ArrayBuffer.isView(e))return Ea(e.buffer,e.byteOffset,t);if(e instanceof ArrayBuffer)return Ea(e,0,t);return""}(e),'"'))}}function Ta(e,t){if(!e)throw new Error(t||"assert failed: gltf")}function xa(e,t){if(e.startsWith("data:")||e.startsWith("http:")||e.startsWith("https:"))return e;const i=t.baseUri||t.uri;if(!i)throw new Error("'baseUri' must be provided to resolve relative url ".concat(e));return i.substr(0,i.lastIndexOf("/")+1)+e}function Ia(e,t,i){const n=e.bufferViews[i];Ta(n);const s=t[n.buffer];Ta(s);const r=(n.byteOffset||0)+s.byteOffset;return new Uint8Array(s.arrayBuffer,r,n.byteLength)}function Ra(e,t){return li(e>=0),li(t>0),e+(t-1)&~(t-1)}function Sa(e,t,i){let n;if(e instanceof ArrayBuffer)n=new Uint8Array(e);else{const t=e.byteOffset,i=e.byteLength;n=new Uint8Array(e.buffer||e.arrayBuffer,t,i)}return t.set(n,i),i+Ra(n.byteLength,4)}const Oa=["SCALAR","VEC2","VEC3","VEC4"],Da=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],Fa=new Map(Da),_a={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ga={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},La={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Pa(e){return Oa[e-1]||Oa[0]}function ka(e){const t=Fa.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function Na(e,t){const i=La[e.componentType],n=_a[e.type],s=Ga[e.componentType],r=e.count*n,o=e.count*n*s;return Ta(o>=0&&o<=t.byteLength),{ArrayType:i,length:r,byteLength:o}}function Ua(e){let{images:t,bufferViews:i}=e;t=t||[],i=i||[];const n=t.map((e=>e.bufferView));i=i.filter((e=>!n.includes(e)));const s=i.reduce(((e,t)=>e+t.byteLength),0),r=t.reduce(((e,t)=>{const{width:i,height:n}=t.image;return e+i*n}),0);return s+Math.ceil(4*r*1.33)}const Ha={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class ja{constructor(e){Ti(this,"gltf",void 0),Ti(this,"sourceBuffers",void 0),Ti(this,"byteLength",void 0),this.gltf=e||{json:{...Ha},buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(e){return this.json[e]}getExtraData(e){return(this.json.extras||{})[e]}getExtension(e){const t=this.getUsedExtensions().find((t=>t===e)),i=this.json.extensions||{};return t?i[e]||!0:null}getRequiredExtension(e){return this.getRequiredExtensions().find((t=>t===e))?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getRemovedExtensions(){return this.json.extensionsRemoved||[]}getObjectExtension(e,t){return(e.extensions||{})[t]}getScene(e){return this.getObject("scenes",e)}getNode(e){return this.getObject("nodes",e)}getSkin(e){return this.getObject("skins",e)}getMesh(e){return this.getObject("meshes",e)}getMaterial(e){return this.getObject("materials",e)}getAccessor(e){return this.getObject("accessors",e)}getTexture(e){return this.getObject("textures",e)}getSampler(e){return this.getObject("samplers",e)}getImage(e){return this.getObject("images",e)}getBufferView(e){return this.getObject("bufferViews",e)}getBuffer(e){return this.getObject("buffers",e)}getObject(e,t){if("object"==typeof t)return t;const i=this.json[e]&&this.json[e][t];if(!i)throw new Error("glTF file error: Could not find ".concat(e,"[").concat(t,"]"));return i}getTypedArrayForBufferView(e){const t=(e=this.getBufferView(e)).buffer,i=this.gltf.buffers[t];Ta(i);const n=(e.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,n,e.byteLength)}getTypedArrayForAccessor(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),i=this.getBuffer(t.buffer).data,{ArrayType:n,length:s}=Na(e,t);return new n(i,t.byteOffset+e.byteOffset,s)}getTypedArrayForImageData(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),i=this.getBuffer(t.buffer).data,n=t.byteOffset||0;return new Uint8Array(i,n,t.byteLength)}addApplicationData(e,t){return this.json[e]=t,this}addExtraData(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}addObjectExtension(e,t,i){return e.extensions=e.extensions||{},e.extensions[t]=i,this.registerUsedExtension(t),this}setObjectExtension(e,t,i){(e.extensions||{})[t]=i}removeObjectExtension(e,t){const i=e.extensions||{},n=i[t];return delete i[t],n}addExtension(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Ta(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Ta(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find((t=>t===e))||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find((t=>t===e))||this.json.extensionsRequired.push(e)}removeExtension(e){if(!this.getExtension(e))return;this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e),this.json.extensions&&delete this.json.extensions[e],Array.isArray(this.json.extensionsRemoved)||(this.json.extensionsRemoved=[]);const t=this.json.extensionsRemoved;t.includes(e)||t.push(e)}setDefaultScene(e){this.json.scene=e}addScene(e){const{nodeIndices:t}=e;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}addNode(e){const{meshIndex:t,matrix:i}=e;this.json.nodes=this.json.nodes||[];const n={mesh:t};return i&&(n.matrix=i),this.json.nodes.push(n),this.json.nodes.length-1}addMesh(e){const{attributes:t,indices:i,material:n,mode:s=4}=e,r={primitives:[{attributes:this._addAttributes(t),mode:s}]};if(i){const e=this._addIndices(i);r.primitives[0].indices=e}return Number.isFinite(n)&&(r.primitives[0].material=n),this.json.meshes=this.json.meshes||[],this.json.meshes.push(r),this.json.meshes.length-1}addPointCloud(e){const t={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(t),this.json.meshes.length-1}addImage(e,t){const i=va(e),n=t||(null==i?void 0:i.mimeType),s={bufferView:this.addBufferView(e),mimeType:n};return this.json.images=this.json.images||[],this.json.images.push(s),this.json.images.length-1}addBufferView(e){const t=e.byteLength;Ta(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);const i={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=Ra(t,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(i),this.json.bufferViews.length-1}addAccessor(e,t){const i={bufferView:e,type:Pa(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(i),this.json.accessors.length-1}addBinaryBuffer(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{size:3};const i=this.addBufferView(e);let n={min:t.min,max:t.max};n.min&&n.max||(n=this._getAccessorMinMax(e,t.size));const s={size:t.size,componentType:ka(e),count:Math.round(e.length/t.size),min:n.min,max:n.max};return this.addAccessor(i,Object.assign(s,t))}addTexture(e){const{imageIndex:t}=e,i={source:t};return this.json.textures=this.json.textures||[],this.json.textures.push(i),this.json.textures.length-1}addMaterial(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}createBinaryChunk(){var e,t;this.gltf.buffers=[];const i=this.byteLength,n=new ArrayBuffer(i),s=new Uint8Array(n);let r=0;for(const e of this.sourceBuffers||[])r=Sa(e,s,r);null!==(e=this.json)&&void 0!==e&&null!==(t=e.buffers)&&void 0!==t&&t[0]?this.json.buffers[0].byteLength=i:this.json.buffers=[{byteLength:i}],this.gltf.binary=n,this.sourceBuffers=[n]}_removeStringFromArray(e,t){let i=!0;for(;i;){const n=e.indexOf(t);n>-1?e.splice(n,1):i=!1}}_addAttributes(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={};for(const i in e){const n=e[i],s=this._getGltfAttributeName(i),r=this.addBinaryBuffer(n.value,n);t[s]=r}return t}_addIndices(e){return this.addBinaryBuffer(e,{size:1})}_getGltfAttributeName(e){switch(e.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 e}}_getAccessorMinMax(e,t){const i={min:null,max:null};if(e.length<t)return i;i.min=[],i.max=[];const n=e.subarray(0,t);for(const e of n)i.min.push(e),i.max.push(e);for(let n=t;n<e.length;n+=t)for(let s=0;s<t;s++)i.min[0+s]=Math.min(i.min[0+s],e[n+s]),i.max[0+s]=Math.max(i.max[0+s],e[n+s]);return i}}const Ja="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",Va="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",za=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]),Ka=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]),Wa={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},Qa={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};let Xa;async function Ya(){return Xa||(Xa=async function(){let e=Ja;WebAssembly.validate(za)&&(e=Va);const t=await WebAssembly.instantiate(function(e){const t=new Uint8Array(e.length);for(let i=0;i<e.length;++i){const n=e.charCodeAt(i);t[i]=n>96?n-71:n>64?n-65:n>47?n+4:n>46?63:62}let i=0;for(let n=0;n<e.length;++n)t[i++]=t[n]<60?Ka[t[n]]:64*(t[n]-60)+t[++n];return t.buffer.slice(0,i)}(e),{});return await t.instance.exports.__wasm_call_ctors(),t.instance}()),Xa}function qa(e,t,i,n,s,r,o){const a=e.exports.sbrk,c=n+3&-4,h=a(c*s),l=a(r.length),u=new Uint8Array(e.exports.memory.buffer);u.set(r,l);const d=t(h,n,s,l,r.length);if(0===d&&o&&o(h,c,s),i.set(u.subarray(h,h+n*s)),a(h-a(0)),0!==d)throw new Error("Malformed buffer data: ".concat(d))}const Za="EXT_meshopt_compression",$a=Za;async function ec(e,t){var i;const n=new ja(e);if(null==t||null===(i=t.gltf)||void 0===i||!i.decompressMeshes)return;const s=[];for(const t of e.json.bufferViews||[])s.push(tc(n,t));await Promise.all(s),n.removeExtension(Za)}async function tc(e,t){const i=e.getObjectExtension(t,Za);if(i){const{byteOffset:n=0,byteLength:s=0,byteStride:r,count:o,mode:a,filter:c="NONE",buffer:h}=i,l=e.gltf.buffers[h],u=new Uint8Array(l.arrayBuffer,l.byteOffset+n,s),d=new Uint8Array(e.gltf.buffers[t.buffer].arrayBuffer,t.byteOffset,t.byteLength);return await async function(e,t,i,n,s){let r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"NONE";const o=await Ya();qa(o,o.exports[Qa[s]],e,t,i,n,o.exports[Wa[r||"NONE"]])}(d,o,r,u,a,c),d}return null}const ic={};function nc(e){if(void 0===ic[e]){const t=Xi?function(e){switch(e){case"image/avif":case"image/webp":return function(e){try{const t=document.createElement("canvas");return 0===t.toDataURL(e).indexOf("data:".concat(e))}catch{return!1}}(e);default:return!0}}(e):sc(e);ic[e]=t}return ic[e]}function sc(e){const t=["image/png","image/jpeg","image/gif"],{_parseImageNode:i,_imageFormatsNode:n=t}=globalThis;return Boolean(i)&&n.includes(e)}const rc="EXT_texture_webp",oc=rc;function ac(e,t){const i=new ja(e);if(!nc("image/webp")){if(i.getRequiredExtensions().includes(rc))throw new Error("gltf: Required extension ".concat(rc," not supported by browser"));return}const{json:n}=i;for(const e of n.textures||[]){const t=i.getObjectExtension(e,rc);t&&(e.source=t.source),i.removeObjectExtension(e,rc)}i.removeExtension(rc)}const cc="KHR_texture_basisu",hc=cc;function lc(e,t){const i=new ja(e),{json:n}=i;for(const e of n.textures||[]){const t=i.getObjectExtension(e,cc);t&&(e.source=t.source),i.removeObjectExtension(e,cc)}i.removeExtension(cc)}function uc(e){const{buffer:t,size:i,count:n}=function(e){let t=e,i=1,n=0;e&&e.value&&(t=e.value,i=e.size||1);t&&(ArrayBuffer.isView(t)||(t=function(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e)return null;if(Array.isArray(e))return new t(e);if(i&&!(e instanceof t))return new t(e);return e}(t,Float32Array)),n=t.length/i);return{buffer:t,size:i,count:n}}(e);return{value:t,size:i,byteOffset:0,count:n,type:Pa(i),componentType:ka(t)}}const dc="KHR_draco_mesh_compression",fc=dc;function pc(e,t,i){const n=new ja(e);for(const e of bc(n))n.getObjectExtension(e,dc)}async function mc(e,t,i){var n;if(null==t||null===(n=t.gltf)||void 0===n||!n.decompressMeshes)return;const s=new ja(e),r=[];for(const e of bc(s))s.getObjectExtension(e,dc)&&r.push(Ac(s,e,t,i));await Promise.all(r),s.removeExtension(dc)}function gc(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=new ja(e);for(const e of i.json.meshes||[])yc(e,t),i.addRequiredExtension(dc)}async function Ac(e,t,i,n){const s=e.getObjectExtension(t,dc);if(!s)return;const r=e.getTypedArrayForBufferView(s.bufferView),o=On(r.buffer,r.byteOffset),{parse:a}=n,c={...i};delete c["3d-tiles"];const h=await a(o,rr,c,n),l=function(e){const t={};for(const i in e){const n=e[i];if("indices"!==i){const e=uc(n);t[i]=e}}return t}(h.attributes);for(const[i,n]of Object.entries(l))if(i in t.attributes){const s=t.attributes[i],r=e.getAccessor(s);null!=r&&r.min&&null!=r&&r.max&&(n.min=r.min,n.max=r.max)}t.attributes=l,h.indices&&(t.indices=uc(h.indices)),function(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}(t)}function yc(e,t){var i;let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,s=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0;if(!s.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");const o=s.DracoWriter.encodeSync({attributes:e}),a=null==r||null===(i=r.parseSync)||void 0===i?void 0:i.call(r,{attributes:e}),c=s._addFauxAttributes(a.attributes),h=s.addBufferView(o);return{primitives:[{attributes:c,mode:n,extensions:{[dc]:{bufferView:h,attributes:c}}}]}}function*bc(e){for(const t of e.json.meshes||[])for(const e of t.primitives)yield e}class Bc extends Ar{toString(){let e="[";if(lr.printRowMajor){e+="row-major:";for(let t=0;t<this.RANK;++t)for(let i=0;i<this.RANK;++i)e+=" ".concat(this[i*this.RANK+t])}else{e+="column-major:";for(let t=0;t<this.ELEMENTS;++t)e+=" ".concat(this[t])}return e+="]",e}getElementIndex(e,t){return t*this.RANK+e}getElement(e,t){return this[t*this.RANK+e]}setElement(e,t,i){return this[t*this.RANK+e]=yr(i),this}getColumn(e,t=new Array(this.RANK).fill(-0)){const i=e*this.RANK;for(let e=0;e<this.RANK;++e)t[e]=this[i+e];return t}setColumn(e,t){const i=e*this.RANK;for(let e=0;e<this.RANK;++e)this[i+e]=t[e];return this}}function vc(e,t,i){var n=t[0],s=t[1],r=t[2],o=t[3],a=t[4],c=t[5],h=t[6],l=t[7],u=t[8],d=i[0],f=i[1],p=i[2],m=i[3],g=i[4],A=i[5],y=i[6],b=i[7],B=i[8];return e[0]=d*n+f*o+p*h,e[1]=d*s+f*a+p*l,e[2]=d*r+f*c+p*u,e[3]=m*n+g*o+A*h,e[4]=m*s+g*a+A*l,e[5]=m*r+g*c+A*u,e[6]=y*n+b*o+B*h,e[7]=y*s+b*a+B*l,e[8]=y*r+b*c+B*u,e}function Cc(e,t,i){var n=i[0],s=i[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=s*t[3],e[4]=s*t[4],e[5]=s*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}var wc;!function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL1ROW0=3]="COL1ROW0",e[e.COL1ROW1=4]="COL1ROW1",e[e.COL1ROW2=5]="COL1ROW2",e[e.COL2ROW0=6]="COL2ROW0",e[e.COL2ROW1=7]="COL2ROW1",e[e.COL2ROW2=8]="COL2ROW2"}(wc||(wc={}));const Ec=Object.freeze([1,0,0,0,1,0,0,0,1]);class Mc extends Bc{static get IDENTITY(){return function(){xc||(xc=new Mc,Object.freeze(xc));return xc}()}static get ZERO(){return function(){Tc||(Tc=new Mc([0,0,0,0,0,0,0,0,0]),Object.freeze(Tc));return Tc}()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return wc}constructor(e,...t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(e)?this.copy(e):t.length>0?this.copy([e,...t]):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this.check()}identity(){return this.copy(Ec)}fromObject(e){return this.check()}fromQuaternion(e){return function(e,t){var i=t[0],n=t[1],s=t[2],r=t[3],o=i+i,a=n+n,c=s+s,h=i*o,l=n*o,u=n*a,d=s*o,f=s*a,p=s*c,m=r*o,g=r*a,A=r*c;e[0]=1-u-p,e[3]=l-A,e[6]=d+g,e[1]=l+A,e[4]=1-h-p,e[7]=f-m,e[2]=d-g,e[5]=f+m,e[8]=1-h-u}(this,e),this.check()}set(e,t,i,n,s,r,o,a,c){return this[0]=e,this[1]=t,this[2]=i,this[3]=n,this[4]=s,this[5]=r,this[6]=o,this[7]=a,this[8]=c,this.check()}setRowMajor(e,t,i,n,s,r,o,a,c){return this[0]=e,this[1]=n,this[2]=o,this[3]=t,this[4]=s,this[5]=a,this[6]=i,this[7]=r,this[8]=c,this.check()}determinant(){return function(e){var t=e[0],i=e[1],n=e[2],s=e[3],r=e[4],o=e[5],a=e[6],c=e[7],h=e[8];return t*(h*r-o*c)+i*(-h*s+o*a)+n*(c*s-r*a)}(this)}transpose(){return function(e,t){if(e===t){var i=t[1],n=t[2],s=t[5];e[1]=t[3],e[2]=t[6],e[3]=i,e[5]=t[7],e[6]=n,e[7]=s}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8]}(this,this),this.check()}invert(){return function(e,t){var i=t[0],n=t[1],s=t[2],r=t[3],o=t[4],a=t[5],c=t[6],h=t[7],l=t[8],u=l*o-a*h,d=-l*r+a*c,f=h*r-o*c,p=i*u+n*d+s*f;p&&(p=1/p,e[0]=u*p,e[1]=(-l*n+s*h)*p,e[2]=(a*n-s*o)*p,e[3]=d*p,e[4]=(l*i-s*c)*p,e[5]=(-a*i+s*r)*p,e[6]=f*p,e[7]=(-h*i+n*c)*p,e[8]=(o*i-n*r)*p)}(this,this),this.check()}multiplyLeft(e){return vc(this,e,this),this.check()}multiplyRight(e){return vc(this,this,e),this.check()}rotate(e){return function(e,t,i){var n=t[0],s=t[1],r=t[2],o=t[3],a=t[4],c=t[5],h=t[6],l=t[7],u=t[8],d=Math.sin(i),f=Math.cos(i);e[0]=f*n+d*o,e[1]=f*s+d*a,e[2]=f*r+d*c,e[3]=f*o-d*n,e[4]=f*a-d*s,e[5]=f*c-d*r,e[6]=h,e[7]=l,e[8]=u}(this,this,e),this.check()}scale(e){return Array.isArray(e)?Cc(this,this,e):Cc(this,this,[e,e]),this.check()}translate(e){return function(e,t,i){var n=t[0],s=t[1],r=t[2],o=t[3],a=t[4],c=t[5],h=t[6],l=t[7],u=t[8],d=i[0],f=i[1];e[0]=n,e[1]=s,e[2]=r,e[3]=o,e[4]=a,e[5]=c,e[6]=d*n+f*o+h,e[7]=d*s+f*a+l,e[8]=d*r+f*c+u}(this,this,e),this.check()}transform(e,t){let i;switch(e.length){case 2:i=lo(t||[-0,-0],e,this);break;case 3:i=Sr(t||[-0,-0,-0],e,this);break;case 4:i=Lr(t||[-0,-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return br(i,e.length),i}transformVector(e,t){return this.transform(e,t)}transformVector2(e,t){return this.transform(e,t)}transformVector3(e,t){return this.transform(e,t)}}let Tc,xc;const Ic={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Rc={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4};const Sc="KHR_texture_transform",Oc=Sc,Dc=new Nr,Fc=new Mc,_c=new Mc;async function Gc(e,t){if(!new ja(e).getExtension(Sc))return;const i=e.json.materials||[];for(let t=0;t<i.length;t++)Lc(t,e)}function Lc(e,t){var i,n,s;const r=[],o=null===(i=t.json.materials)||void 0===i?void 0:i[e],a=null==o||null===(n=o.pbrMetallicRoughness)||void 0===n?void 0:n.baseColorTexture;a&&Pc(t,e,a,r);const c=null==o?void 0:o.emissiveTexture;c&&Pc(t,e,c,r);const h=null==o?void 0:o.normalTexture;h&&Pc(t,e,h,r);const l=null==o?void 0:o.occlusionTexture;l&&Pc(t,e,l,r);const u=null==o||null===(s=o.pbrMetallicRoughness)||void 0===s?void 0:s.metallicRoughnessTexture;u&&Pc(t,e,u,r)}function Pc(e,t,i,n){const s=function(e,t){var i;const n=null===(i=e.extensions)||void 0===i?void 0:i[Sc],{texCoord:s=0}=e,{texCoord:r=s}=n,o=-1!==t.findIndex((e=>{let[t,i]=e;return t===s&&i===r}));if(!o){const i=function(e){const{offset:t=[0,0],rotation:i=0,scale:n=[1,1]}=e,s=(new Mc).set(1,0,0,0,1,0,t[0],t[1],1),r=Fc.set(Math.cos(i),Math.sin(i),0,-Math.sin(i),Math.cos(i),0,0,0,1),o=_c.set(n[0],0,0,0,n[1],0,0,0,1);return s.multiplyRight(r).multiplyRight(o)}(n);return s!==r&&(e.texCoord=r),t.push([s,r]),{originalTexCoord:s,texCoord:r,matrix:i}}return null}(i,n);if(!s)return;const r=e.json.meshes||[];for(const i of r)for(const n of i.primitives){const i=n.material;Number.isFinite(i)&&t===i&&kc(e,n,s)}}function kc(e,t,i){const{originalTexCoord:n,texCoord:s,matrix:r}=i,o=t.attributes["TEXCOORD_".concat(n)];if(Number.isFinite(o)){var a;const i=null===(a=e.json.accessors)||void 0===a?void 0:a[o];if(i&&i.bufferView){var c;const o=null===(c=e.json.bufferViews)||void 0===c?void 0:c[i.bufferView];if(o){const{arrayBuffer:a,byteOffset:c}=e.buffers[o.buffer],h=(c||0)+(i.byteOffset||0)+(o.byteOffset||0),{ArrayType:l,length:u}=Na(i,o),d=Rc[i.componentType],f=Ic[i.type],p=o.byteStride||d*f,m=new Float32Array(u);for(let e=0;e<i.count;e++){const t=new l(a,h+e*p,2);Dc.set(t[0],t[1],1),Dc.transformByMatrix3(r),m.set([Dc[0],Dc[1]],e*f)}n===s?function(e,t,i,n){e.componentType=5126,i.push({arrayBuffer:n.buffer,byteOffset:0,byteLength:n.buffer.byteLength}),t.buffer=i.length-1,t.byteLength=n.buffer.byteLength,t.byteOffset=0,delete t.byteStride}(i,o,e.buffers,m):function(e,t,i,n,s){n.buffers.push({arrayBuffer:s.buffer,byteOffset:0,byteLength:s.buffer.byteLength});const r=n.json.bufferViews;if(!r)return;r.push({buffer:n.buffers.length-1,byteLength:s.buffer.byteLength,byteOffset:0});const o=n.json.accessors;if(!o)return;o.push({bufferView:(null==r?void 0:r.length)-1,byteOffset:0,componentType:5126,count:t.count,type:"VEC2"}),i.attributes["TEXCOORD_".concat(e)]=o.length-1}(s,i,t,e,m)}}}}const Nc="KHR_lights_punctual",Uc=Nc;async function Hc(e){const t=new ja(e),{json:i}=t,n=t.getExtension(Nc);n&&(t.json.lights=n.lights,t.removeExtension(Nc));for(const e of i.nodes||[]){const i=t.getObjectExtension(e,Nc);i&&(e.light=i.light),t.removeObjectExtension(e,Nc)}}async function jc(e){const t=new ja(e),{json:i}=t;if(i.lights){const e=t.addExtension(Nc);Ta(!e.lights),e.lights=i.lights,delete i.lights}if(t.json.lights){for(const e of t.json.lights){const i=e.node;t.addObjectExtension(i,Nc,e)}delete t.json.lights}}const Jc="KHR_materials_unlit",Vc=Jc;async function zc(e){const t=new ja(e),{json:i}=t;for(const e of i.materials||[]){e.extensions&&e.extensions.KHR_materials_unlit&&(e.unlit=!0),t.removeObjectExtension(e,Jc)}t.removeExtension(Jc)}function Kc(e){const t=new ja(e),{json:i}=t;if(t.materials)for(const e of i.materials||[])e.unlit&&(delete e.unlit,t.addObjectExtension(e,Jc,{}),t.addExtension(Jc))}const Wc="KHR_techniques_webgl",Qc=Wc;async function Xc(e){const t=new ja(e),{json:i}=t,n=t.getExtension(Wc);if(n){const e=function(e,t){const{programs:i=[],shaders:n=[],techniques:s=[]}=e,r=new TextDecoder;return n.forEach((e=>{if(!Number.isFinite(e.bufferView))throw new Error("KHR_techniques_webgl: no shader code");e.code=r.decode(t.getTypedArrayForBufferView(e.bufferView))})),i.forEach((e=>{e.fragmentShader=n[e.fragmentShader],e.vertexShader=n[e.vertexShader]})),s.forEach((e=>{e.program=i[e.program]})),s}(n,t);for(const n of i.materials||[]){const i=t.getObjectExtension(n,Wc);i&&(n.technique=Object.assign({},i,e[i.technique]),n.technique.values=qc(n.technique,t)),t.removeObjectExtension(n,Wc)}t.removeExtension(Wc)}}async function Yc(e,t){}function qc(e,t){const i=Object.assign({},e.values);return Object.keys(e.uniforms||{}).forEach((t=>{e.uniforms[t].value&&!(t in i)&&(i[t]=e.uniforms[t].value)})),Object.keys(i).forEach((e=>{"object"==typeof i[e]&&void 0!==i[e].index&&(i[e].texture=t.getTexture(i[e].index))})),i}const Zc="EXT_feature_metadata",$c=Zc;async function eh(e){!function(e){var t;const i=e.getExtension(Zc),n=null==i||null===(t=i.schema)||void 0===t?void 0:t.classes,s=null==i?void 0:i.featureTables;(null==i?void 0:i.featureTextures)&&console.warn('featureTextures is not yet supported in the "EXT_feature_metadata" extension.');if(n&&s)for(const t in n){const i=n[t],r=nh(s,t);r&&th(e,r,i)}}(new ja(e))}function th(e,t,i){for(const s in i.properties){var n;const r=i.properties[s],o=null==t||null===(n=t.properties)||void 0===n?void 0:n[s],a=t.count;if(o){const t=ih(e,r,a,o);o.data=t}}}function ih(e,t,i,n){const s=n.bufferView;let r=e.getTypedArrayForBufferView(s);switch(t.type){case"STRING":{const t=n.stringOffsetBufferView;r=function(e,t,i){const n=[],s=new TextDecoder("utf8");let r=0;const o=4;for(let a=0;a<i;a++){const i=t[(a+1)*o]-t[a*o],c=e.subarray(r,i+r),h=s.decode(c);n.push(h),r+=i}return n}(r,e.getTypedArrayForBufferView(t),i);break}}return r}function nh(e,t){for(const i in e){const n=e[i];if(n.class===t)return n}return null}const sh=[e,t,i,r,a,c,h,o,l];function rh(e,t){var i;const n=(null==t||null===(i=t.gltf)||void 0===i?void 0:i.excludeExtensions)||{};return!(e in n&&!n[e])}const oh="KHR_binary_glTF";const ah={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},ch={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"};class hh{constructor(){Ti(this,"idToIndexMap",{animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}),Ti(this,"json",void 0)}normalize(e,t){this.json=e.json;const i=e.json;switch(i.asset&&i.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn("glTF: Unknown version ".concat(i.asset.version))}if(!t.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),function(e){const t=new ja(e),{json:i}=t;for(const e of i.images||[]){const i=t.getObjectExtension(e,oh);i&&Object.assign(e,i),t.removeObjectExtension(e,oh)}i.buffers&&i.buffers[0]&&delete i.buffers[0].uri,t.removeExtension(oh)}(e),this._convertObjectIdsToArrayIndices(i),this._updateObjects(i),this._updateMaterial(i)}_addAsset(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(e){for(const t in ah)this._convertTopLevelObjectToArray(e,t)}_convertTopLevelObjectToArray(e,t){const i=e[t];if(i&&!Array.isArray(i)){e[t]=[];for(const n in i){const s=i[n];s.id=s.id||n;const r=e[t].length;e[t].push(s),this.idToIndexMap[t][n]=r}}}_convertObjectIdsToArrayIndices(e){for(const t in ah)this._convertIdsToIndices(e,t);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));for(const t of e.textures)this._convertTextureIds(t);for(const t of e.meshes)this._convertMeshIds(t);for(const t of e.nodes)this._convertNodeIds(t);for(const t of e.scenes)this._convertSceneIds(t)}_convertTextureIds(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}_convertMeshIds(e){for(const t of e.primitives){const{attributes:e,indices:i,material:n}=t;for(const t in e)e[t]=this._convertIdToIndex(e[t],"accessor");i&&(t.indices=this._convertIdToIndex(i,"accessor")),n&&(t.material=this._convertIdToIndex(n,"material"))}}_convertNodeIds(e){e.children&&(e.children=e.children.map((e=>this._convertIdToIndex(e,"node")))),e.meshes&&(e.meshes=e.meshes.map((e=>this._convertIdToIndex(e,"mesh"))))}_convertSceneIds(e){e.nodes&&(e.nodes=e.nodes.map((e=>this._convertIdToIndex(e,"node"))))}_convertIdsToIndices(e,t){e[t]||(console.warn("gltf v1: json doesn't contain attribute ".concat(t)),e[t]=[]);for(const i of e[t])for(const e in i){const t=i[e],n=this._convertIdToIndex(t,e);i[e]=n}}_convertIdToIndex(e,t){const i=ch[t];if(i in this.idToIndexMap){const n=this.idToIndexMap[i][e];if(!Number.isFinite(n))throw new Error("gltf v1: failed to resolve ".concat(t," with id ").concat(e));return n}return e}_updateObjects(e){for(const e of this.json.buffers)delete e.type}_updateMaterial(e){for(const s of e.materials){var t,i,n;s.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};const r=(null===(t=s.values)||void 0===t?void 0:t.tex)||(null===(i=s.values)||void 0===i?void 0:i.texture2d_0)||(null===(n=s.values)||void 0===n?void 0:n.diffuseTex),o=e.textures.findIndex((e=>e.id===r));-1!==o&&(s.pbrMetallicRoughness.baseColorTexture={index:o})}}}const lh={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},uh={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},dh=10240,fh=10241,ph=10242,mh=10243,gh=10497,Ah={magFilter:dh,minFilter:fh,wrapS:ph,wrapT:mh},yh={[dh]:9729,[fh]:9986,[ph]:gh,[mh]:gh};class bh{constructor(){Ti(this,"baseUri",""),Ti(this,"json",{}),Ti(this,"buffers",[]),Ti(this,"images",[])}postProcess(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{json:i,buffers:n=[],images:s=[],baseUri:r=""}=e;return Ta(i),this.baseUri=r,this.json=i,this.buffers=n,this.images=s,this._resolveTree(this.json,t),this.json}_resolveTree(e){e.bufferViews&&(e.bufferViews=e.bufferViews.map(((e,t)=>this._resolveBufferView(e,t)))),e.images&&(e.images=e.images.map(((e,t)=>this._resolveImage(e,t)))),e.samplers&&(e.samplers=e.samplers.map(((e,t)=>this._resolveSampler(e,t)))),e.textures&&(e.textures=e.textures.map(((e,t)=>this._resolveTexture(e,t)))),e.accessors&&(e.accessors=e.accessors.map(((e,t)=>this._resolveAccessor(e,t)))),e.materials&&(e.materials=e.materials.map(((e,t)=>this._resolveMaterial(e,t)))),e.meshes&&(e.meshes=e.meshes.map(((e,t)=>this._resolveMesh(e,t)))),e.nodes&&(e.nodes=e.nodes.map(((e,t)=>this._resolveNode(e,t)))),e.skins&&(e.skins=e.skins.map(((e,t)=>this._resolveSkin(e,t)))),e.scenes&&(e.scenes=e.scenes.map(((e,t)=>this._resolveScene(e,t)))),void 0!==e.scene&&(e.scene=e.scenes[this.json.scene])}getScene(e){return this._get("scenes",e)}getNode(e){return this._get("nodes",e)}getSkin(e){return this._get("skins",e)}getMesh(e){return this._get("meshes",e)}getMaterial(e){return this._get("materials",e)}getAccessor(e){return this._get("accessors",e)}getCamera(e){return null}getTexture(e){return this._get("textures",e)}getSampler(e){return this._get("samplers",e)}getImage(e){return this._get("images",e)}getBufferView(e){return this._get("bufferViews",e)}getBuffer(e){return this._get("buffers",e)}_get(e,t){if("object"==typeof t)return t;const i=this.json[e]&&this.json[e][t];return i||console.warn("glTF file error: Could not find ".concat(e,"[").concat(t,"]")),i}_resolveScene(e,t){return e.id=e.id||"scene-".concat(t),e.nodes=(e.nodes||[]).map((e=>this.getNode(e))),e}_resolveNode(e,t){return e.id=e.id||"node-".concat(t),e.children&&(e.children=e.children.map((e=>this.getNode(e)))),void 0!==e.mesh?e.mesh=this.getMesh(e.mesh):void 0!==e.meshes&&e.meshes.length&&(e.mesh=e.meshes.reduce(((e,t)=>{const i=this.getMesh(t);return e.id=i.id,e.primitives=e.primitives.concat(i.primitives),e}),{primitives:[]})),void 0!==e.camera&&(e.camera=this.getCamera(e.camera)),void 0!==e.skin&&(e.skin=this.getSkin(e.skin)),e}_resolveSkin(e,t){return e.id=e.id||"skin-".concat(t),e.inverseBindMatrices=this.getAccessor(e.inverseBindMatrices),e}_resolveMesh(e,t){return e.id=e.id||"mesh-".concat(t),e.primitives&&(e.primitives=e.primitives.map((e=>{const t=(e={...e}).attributes;e.attributes={};for(const i in t)e.attributes[i]=this.getAccessor(t[i]);return void 0!==e.indices&&(e.indices=this.getAccessor(e.indices)),void 0!==e.material&&(e.material=this.getMaterial(e.material)),e}))),e}_resolveMaterial(e,t){if(e.id=e.id||"material-".concat(t),e.normalTexture&&(e.normalTexture={...e.normalTexture},e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture={...e.occlustionTexture},e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture={...e.emmisiveTexture},e.emissiveTexture.texture=this.getTexture(e.emissiveTexture.index)),e.emissiveFactor||(e.emissiveFactor=e.emmisiveTexture?[1,1,1]:[0,0,0]),e.pbrMetallicRoughness){e.pbrMetallicRoughness={...e.pbrMetallicRoughness};const t=e.pbrMetallicRoughness;t.baseColorTexture&&(t.baseColorTexture={...t.baseColorTexture},t.baseColorTexture.texture=this.getTexture(t.baseColorTexture.index)),t.metallicRoughnessTexture&&(t.metallicRoughnessTexture={...t.metallicRoughnessTexture},t.metallicRoughnessTexture.texture=this.getTexture(t.metallicRoughnessTexture.index))}return e}_resolveAccessor(e,t){var i,n;if(e.id=e.id||"accessor-".concat(t),void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView)),e.bytesPerComponent=(i=e.componentType,uh[i]),e.components=(n=e.type,lh[n]),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){const t=e.bufferView.buffer,{ArrayType:i,byteLength:n}=Na(e,e.bufferView),s=(e.bufferView.byteOffset||0)+(e.byteOffset||0)+t.byteOffset;let r=t.arrayBuffer.slice(s,s+n);e.bufferView.byteStride&&(r=this._getValueFromInterleavedBuffer(t,s,e.bufferView.byteStride,e.bytesPerElement,e.count)),e.value=new i(r)}return e}_getValueFromInterleavedBuffer(e,t,i,n,s){const r=new Uint8Array(s*n);for(let o=0;o<s;o++){const s=t+o*i;r.set(new Uint8Array(e.arrayBuffer.slice(s,s+n)),o*n)}return r.buffer}_resolveTexture(e,t){return e.id=e.id||"texture-".concat(t),e.sampler="sampler"in e?this.getSampler(e.sampler):yh,e.source=this.getImage(e.source),e}_resolveSampler(e,t){e.id=e.id||"sampler-".concat(t),e.parameters={};for(const t in e){const i=this._enumSamplerParameter(t);void 0!==i&&(e.parameters[i]=e[t])}return e}_enumSamplerParameter(e){return Ah[e]}_resolveImage(e,t){e.id=e.id||"image-".concat(t),void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView));const i=this.images[t];return i&&(e.image=i),e}_resolveBufferView(e,t){const i=e.buffer,n={id:"bufferView-".concat(t),...e,buffer:this.buffers[i]},s=this.buffers[i].arrayBuffer;let r=this.buffers[i].byteOffset||0;return"byteOffset"in e&&(r+=e.byteOffset),n.data=new Uint8Array(s,r,e.byteLength),n}_resolveCamera(e,t){return e.id=e.id||"camera-".concat(t),e.perspective,e.orthographic,e}}const Bh=1735152710,vh=12,Ch=8,wh=1313821514,Eh=5130562,Mh=0,Th=1,xh=0,Ih=!0;function Rh(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const s=new DataView(t),r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"".concat(String.fromCharCode(e.getUint8(t+0))).concat(String.fromCharCode(e.getUint8(t+1))).concat(String.fromCharCode(e.getUint8(t+2))).concat(String.fromCharCode(e.getUint8(t+3)))}(s,i+0),o=s.getUint32(i+4,Ih),a=s.getUint32(i+8,Ih);switch(Object.assign(e,{header:{byteOffset:i,byteLength:a,hasBinChunk:!1},type:r,version:o,json:{},binChunks:[]}),i+=vh,e.version){case 1:return function(e,t,i){li(e.header.byteLength>vh+Ch);const n=t.getUint32(i+0,Ih),s=t.getUint32(i+4,Ih);return i+=Ch,li(s===xh),Sh(e,t,i,n),i+=n,i+=Oh(e,t,i,e.header.byteLength),i}(e,s,i);case 2:return function(e,t,i,n){return li(e.header.byteLength>vh+Ch),function(e,t,i,n){for(;i+8<=e.header.byteLength;){const s=t.getUint32(i+0,Ih),r=t.getUint32(i+4,Ih);switch(i+=Ch,r){case wh:Sh(e,t,i,s);break;case Eh:Oh(e,t,i,s);break;case Mh:n.strict||Sh(e,t,i,s);break;case Th:n.strict||Oh(e,t,i,s)}i+=Ra(s,4)}}(e,t,i,n),i+e.header.byteLength}(e,s,i,n={});default:throw new Error("Invalid GLB version ".concat(e.version,". Only supports v1 and v2."))}}function Sh(e,t,i,n){const s=new Uint8Array(t.buffer,i,n),r=new TextDecoder("utf8").decode(s);return e.json=JSON.parse(r),Ra(n,4)}function Oh(e,t,i,n){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:i,byteLength:n,arrayBuffer:t.buffer}),Ra(n,4)}async function Dh(e,t){var i,n,s,r;let o=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;!function(e,t,i,n){n.uri&&(e.baseUri=n.uri);if(t instanceof ArrayBuffer&&!function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=new DataView(e),{magic:s=Bh}=i,r=n.getUint32(t,!1);return r===s||r===Bh}(t,i,n)){t=(new TextDecoder).decode(t)}if("string"==typeof t)e.json=Ma(t);else if(t instanceof ArrayBuffer){const s={};i=Rh(s,t,i,n.glb),Ta("glTF"===s.type,"Invalid GLB magic string ".concat(s.type)),e._glb=s,e.json=s.json}else Ta(!1,"GLTF: must be ArrayBuffer or string");const s=e.json.buffers||[];if(e.buffers=new Array(s.length).fill(null),e._glb&&e._glb.header.hasBinChunk){const{binChunks:t}=e._glb;e.buffers[0]={arrayBuffer:t[0].arrayBuffer,byteOffset:t[0].byteOffset,byteLength:t[0].byteLength}}const r=e.json.images||[];e.images=new Array(r.length).fill({})}(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o),function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(new hh).normalize(e,t)}(e,{normalize:null==o||null===(i=o.gltf)||void 0===i?void 0:i.normalize}),function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;const n=sh.filter((e=>rh(e.name,t)));for(const r of n){var s;null===(s=r.preprocess)||void 0===s||s.call(r,e,t,i)}}(e,o,a);const c=[];if(null!=o&&null!==(n=o.gltf)&&void 0!==n&&n.loadBuffers&&e.json.buffers&&await async function(e,t,i){const n=e.json.buffers||[];for(let o=0;o<n.length;++o){const a=n[o];if(a.uri){var s,r;const{fetch:n}=i;Ta(n);const c=xa(a.uri,t),h=await(null==i||null===(s=i.fetch)||void 0===s?void 0:s.call(i,c)),l=await(null==h||null===(r=h.arrayBuffer)||void 0===r?void 0:r.call(h));e.buffers[o]={arrayBuffer:l,byteOffset:0,byteLength:l.byteLength},delete a.uri}else null===e.buffers[o]&&(e.buffers[o]={arrayBuffer:new ArrayBuffer(a.byteLength),byteOffset:0,byteLength:a.byteLength})}}(e,o,a),null!=o&&null!==(s=o.gltf)&&void 0!==s&&s.loadImages){const t=async function(e,t,i){const n=function(e){const t=new Set,i=e.json.textures||[];for(const e of i)void 0!==e.source&&t.add(e.source);return Array.from(t).sort()}(e),s=e.json.images||[],r=[];for(const o of n)r.push(Fh(e,s[o],o,t,i));return await Promise.all(r)}(e,o,a);c.push(t)}const h=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;const n=sh.filter((e=>rh(e.name,t)));for(const r of n){var s;await(null===(s=r.decode)||void 0===s?void 0:s.call(r,e,t,i))}}(e,o,a);return c.push(h),await Promise.all(c),null!=o&&null!==(r=o.gltf)&&void 0!==r&&r.postProcess?function(e,t){return(new bh).postProcess(e,t)}(e,o):e}async function Fh(e,t,i,n,s){const{fetch:r,parse:o}=s;let a;if(t.uri&&!t.hasOwnProperty("bufferView")){const e=xa(t.uri,n),i=await r(e);a=await i.arrayBuffer(),t.bufferView={data:a}}if(Number.isFinite(t.bufferView)){const i=Ia(e.json,e.buffers,t.bufferView);a=On(i.buffer,i.byteOffset,i.byteLength)}Ta(a,"glTF image has no data");let c=await o(a,[wa,ta],{mimeType:t.mimeType,basis:n.basis||{format:$o()}},s);c&&c[0]&&(c={compressed:!0,mipmaps:!1,width:c[0].width,height:c[0].height,data:c[0]}),e.images=e.images||[],e.images[i]=c}const _h={name:"glTF",id:"gltf",module:"gltf",version:"3.4.4",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;t={..._h.options,...t},t.gltf={..._h.options.gltf,...t.gltf};const{byteOffset:n=0}=t;return await Dh({},e,n,t,i)},options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0,postProcess:!0},log:console},deprecatedOptions:{fetchImages:"gltf.loadImages",createImages:"gltf.loadImages",decompress:"gltf.decompressMeshes",postProcess:"gltf.postProcess",gltf:{decompress:"gltf.decompressMeshes"}}};const Gh={URI:0,EMBEDDED:1};function Lh(e,t,i,n){e.rotateYtoZ=!0;const s=e.byteOffset+e.byteLength-i;if(0===s)throw new Error("glTF byte length must be greater than 0.");return e.gltfUpAxis=n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",e.gltfArrayBuffer=On(t,i,s),e.gltfByteOffset=0,e.gltfByteLength=s,i%4==0||console.warn("".concat(e.type,": embedded glb is not aligned to a 4-byte boundary.")),e.byteOffset+e.byteLength}async function Ph(e,t,i,n){const s=i["3d-tiles"]||{};if(function(e,t,i){switch(t){case Gh.URI:const t=new Uint8Array(e.gltfArrayBuffer,e.gltfByteOffset),i=(new TextDecoder).decode(t);e.gltfUrl=i.replace(/[\s\0]+$/,""),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength;break;case Gh.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}(e,t),s.loadGLTF){const{parse:t,fetch:s}=n;e.gltfUrl&&(e.gltfArrayBuffer=await s(e.gltfUrl,i),e.gltfByteOffset=0),e.gltfArrayBuffer&&(e.gltf=await t(e.gltfArrayBuffer,_h,i,n),e.gpuMemoryUsageInBytes=Ua(e.gltf),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength)}}async function kh(e,t,i,n,s){var r;i=function(e,t,i,n,s){i=no(e,t,i),i=oo(e,t,i),i=ao(e,t,i),i=Lh(e,t,i,n);const r=new Vr(e.featureTableJson,e.featureTableBinary);return e.rtcCenter=r.getGlobalProperty("RTC_CENTER",ar.FLOAT,3),i}(e,t,i,n),await Ph(e,Gh.EMBEDDED,n,s);const o=null==e||null===(r=e.gltf)||void 0===r?void 0:r.extensions;return o&&o.CESIUM_RTC&&(e.rtcCenter=o.CESIUM_RTC.center),i}let Nh;class Uh extends vr{static get ZERO(){return Nh||(Nh=new Uh(0,0,0,0),Object.freeze(Nh)),Nh}constructor(e=0,t=0,i=0,n=0){super(-0,-0,-0,-0),dr(e)&&1===arguments.length?this.copy(e):(lr.debug&&(yr(e),yr(t),yr(i),yr(n)),this[0]=e,this[1]=t,this[2]=i,this[3]=n)}set(e,t,i,n){return this[0]=e,this[1]=t,this[2]=i,this[3]=n,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}fromObject(e){return lr.debug&&(yr(e.x),yr(e.y),yr(e.z),yr(e.w)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e.w=this[3],e}get ELEMENTS(){return 4}get z(){return this[2]}set z(e){this[2]=yr(e)}get w(){return this[3]}set w(e){this[3]=yr(e)}transform(e){return Rr(this,this,e),this.check()}transformByMatrix3(e){return Lr(this,this,e),this.check()}transformByMatrix2(e){return function(e,t,i){const n=t[0],s=t[1];e[0]=i[0]*n+i[2]*s,e[1]=i[1]*n+i[3]*s,e[2]=t[2],e[3]=t[3]}(this,this,e),this.check()}transformByQuaternion(e){return Or(this,this,e),this.check()}applyMatrix4(e){return e.transform(this,this),this}}function Hh(e){var t=e[0],i=e[1],n=e[2],s=e[3];return Math.hypot(t,i,n,s)}function jh(e){var t=e[0],i=e[1],n=e[2],s=e[3];return t*t+i*i+n*n+s*s}!function(){var e,t=(e=new wr(4),wr!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e)}();function Jh(){var e=new wr(4);return wr!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function Vh(e,t,i){i*=.5;var n=Math.sin(i);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(i),e}function zh(e,t,i){var n=t[0],s=t[1],r=t[2],o=t[3],a=i[0],c=i[1],h=i[2],l=i[3];return e[0]=n*l+o*a+s*h-r*c,e[1]=s*l+o*c+r*a-n*h,e[2]=r*l+o*h+n*c-s*a,e[3]=o*l-n*a-s*c-r*h,e}function Kh(e,t,i,n){var s,r,o,a,c,h=t[0],l=t[1],u=t[2],d=t[3],f=i[0],p=i[1],m=i[2],g=i[3];return(r=h*f+l*p+u*m+d*g)<0&&(r=-r,f=-f,p=-p,m=-m,g=-g),1-r>Cr?(s=Math.acos(r),o=Math.sin(s),a=Math.sin((1-n)*s)/o,c=Math.sin(n*s)/o):(a=1-n,c=n),e[0]=a*h+c*f,e[1]=a*l+c*p,e[2]=a*u+c*m,e[3]=a*d+c*g,e}function Wh(e,t){var i,n=t[0]+t[4]+t[8];if(n>0)i=Math.sqrt(n+1),e[3]=.5*i,i=.5/i,e[0]=(t[5]-t[7])*i,e[1]=(t[6]-t[2])*i,e[2]=(t[1]-t[3])*i;else{var s=0;t[4]>t[0]&&(s=1),t[8]>t[3*s+s]&&(s=2);var r=(s+1)%3,o=(s+2)%3;i=Math.sqrt(t[3*s+s]-t[3*r+r]-t[3*o+o]+1),e[s]=.5*i,i=.5/i,e[3]=(t[3*r+o]-t[3*o+r])*i,e[r]=(t[3*r+s]+t[3*s+r])*i,e[o]=(t[3*o+s]+t[3*s+o])*i}return e}var Qh,Xh,Yh,qh,Zh,$h,el,tl=function(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e[3]=t[3]+i[3],e},il=function(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e},nl=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},sl=function(e,t,i,n){var s=t[0],r=t[1],o=t[2],a=t[3];return e[0]=s+n*(i[0]-s),e[1]=r+n*(i[1]-r),e[2]=o+n*(i[2]-o),e[3]=a+n*(i[3]-a),e},rl=Hh,ol=jh,al=function(e,t){var i=t[0],n=t[1],s=t[2],r=t[3],o=i*i+n*n+s*s+r*r;return o>0&&(o=1/Math.sqrt(o)),e[0]=i*o,e[1]=n*o,e[2]=s*o,e[3]=r*o,e},cl=(Qh=Er(),Xh=Tr(1,0,0),Yh=Tr(0,1,0),function(e,t,i){var n=xr(t,i);return n<-.999999?(Ir(Qh,Xh,t),Fr(Qh)<1e-6&&Ir(Qh,Yh,t),function(e,t){var i=t[0],n=t[1],s=t[2],r=i*i+n*n+s*s;r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r}(Qh,Qh),Vh(e,Qh,Math.PI),e):n>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(Ir(Qh,t,i),e[0]=Qh[0],e[1]=Qh[1],e[2]=Qh[2],e[3]=1+n,al(e,e))});qh=Jh(),Zh=Jh(),$h=new wr(9),wr!=Float32Array&&($h[1]=0,$h[2]=0,$h[3]=0,$h[5]=0,$h[6]=0,$h[7]=0),$h[0]=1,$h[4]=1,$h[8]=1,el=$h;const hl=[0,0,0,1];class ll extends Ar{constructor(e=0,t=0,i=0,n=1){super(-0,-0,-0,-0),Array.isArray(e)&&1===arguments.length?this.copy(e):this.set(e,t,i,n)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}set(e,t,i,n){return this[0]=e,this[1]=t,this[2]=i,this[3]=n,this.check()}fromObject(e){return this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this.check()}fromMatrix3(e){return Wh(this,e),this.check()}fromAxisRotation(e,t){return Vh(this,e,t),this.check()}identity(){return function(e){e[0]=0,e[1]=0,e[2]=0,e[3]=1}(this),this.check()}setAxisAngle(e,t){return this.fromAxisRotation(e,t)}get ELEMENTS(){return 4}get x(){return this[0]}set x(e){this[0]=yr(e)}get y(){return this[1]}set y(e){this[1]=yr(e)}get z(){return this[2]}set z(e){this[2]=yr(e)}get w(){return this[3]}set w(e){this[3]=yr(e)}len(){return rl(this)}lengthSquared(){return ol(this)}dot(e){return nl(this,e)}rotationTo(e,t){return cl(this,e,t),this.check()}add(e){return tl(this,this,e),this.check()}calculateW(){return function(e,t){var i=t[0],n=t[1],s=t[2];e[0]=i,e[1]=n,e[2]=s,e[3]=Math.sqrt(Math.abs(1-i*i-n*n-s*s))}(this,this),this.check()}conjugate(){return function(e,t){e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3]}(this,this),this.check()}invert(){return function(e,t){var i=t[0],n=t[1],s=t[2],r=t[3],o=i*i+n*n+s*s+r*r,a=o?1/o:0;e[0]=-i*a,e[1]=-n*a,e[2]=-s*a,e[3]=r*a}(this,this),this.check()}lerp(e,t,i){return void 0===i?this.lerp(this,e,t):(sl(this,e,t,i),this.check())}multiplyRight(e){return zh(this,this,e),this.check()}multiplyLeft(e){return zh(this,e,this),this.check()}normalize(){const e=this.len(),t=e>0?1/e:0;return this[0]=this[0]*t,this[1]=this[1]*t,this[2]=this[2]*t,this[3]=this[3]*t,0===e&&(this[3]=1),this.check()}rotateX(e){return function(e,t,i){i*=.5;var n=t[0],s=t[1],r=t[2],o=t[3],a=Math.sin(i),c=Math.cos(i);e[0]=n*c+o*a,e[1]=s*c+r*a,e[2]=r*c-s*a,e[3]=o*c-n*a}(this,this,e),this.check()}rotateY(e){return function(e,t,i){i*=.5;var n=t[0],s=t[1],r=t[2],o=t[3],a=Math.sin(i),c=Math.cos(i);e[0]=n*c-r*a,e[1]=s*c+o*a,e[2]=r*c+n*a,e[3]=o*c-s*a}(this,this,e),this.check()}rotateZ(e){return function(e,t,i){i*=.5;var n=t[0],s=t[1],r=t[2],o=t[3],a=Math.sin(i),c=Math.cos(i);e[0]=n*c+s*a,e[1]=s*c-n*a,e[2]=r*c+o*a,e[3]=o*c-r*a}(this,this,e),this.check()}scale(e){return il(this,this,e),this.check()}slerp(e,t,i){let n,s,r;switch(arguments.length){case 1:({start:n=hl,target:s,ratio:r}=e);break;case 2:n=this,s=e,r=t;break;default:n=e,s=t,r=i}return Kh(this,n,s,r),this.check()}transformVector4(e,t=new Uh){return function(e,t,i){var n=t[0],s=t[1],r=t[2],o=i[0],a=i[1],c=i[2],h=i[3],l=h*n+a*r-c*s,u=h*s+c*n-o*r,d=h*r+o*s-a*n,f=-o*n-a*s-c*r;e[0]=l*h+f*-o+u*-c-d*-a,e[1]=u*h+f*-a+d*-o-l*-c,e[2]=d*h+f*-c+l*-a-u*-o,e[3]=t[3]}(t,e,this),br(t,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(e,t){return this.setAxisAngle(e,t)}premultiply(e){return this.multiplyLeft(e)}multiply(e){return this.multiplyRight(e)}}function ul(e,t,i){var n=t[0],s=t[1],r=t[2],o=t[3],a=t[4],c=t[5],h=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12],g=t[13],A=t[14],y=t[15],b=i[0],B=i[1],v=i[2],C=i[3];return e[0]=b*n+B*a+v*u+C*m,e[1]=b*s+B*c+v*d+C*g,e[2]=b*r+B*h+v*f+C*A,e[3]=b*o+B*l+v*p+C*y,b=i[4],B=i[5],v=i[6],C=i[7],e[4]=b*n+B*a+v*u+C*m,e[5]=b*s+B*c+v*d+C*g,e[6]=b*r+B*h+v*f+C*A,e[7]=b*o+B*l+v*p+C*y,b=i[8],B=i[9],v=i[10],C=i[11],e[8]=b*n+B*a+v*u+C*m,e[9]=b*s+B*c+v*d+C*g,e[10]=b*r+B*h+v*f+C*A,e[11]=b*o+B*l+v*p+C*y,b=i[12],B=i[13],v=i[14],C=i[15],e[12]=b*n+B*a+v*u+C*m,e[13]=b*s+B*c+v*d+C*g,e[14]=b*r+B*h+v*f+C*A,e[15]=b*o+B*l+v*p+C*y,e}function dl(e,t){var i=t[0],n=t[1],s=t[2],r=t[4],o=t[5],a=t[6],c=t[8],h=t[9],l=t[10];return e[0]=Math.hypot(i,n,s),e[1]=Math.hypot(r,o,a),e[2]=Math.hypot(c,h,l),e}var fl=function(e,t,i,n,s){var r,o=1/Math.tan(t/2);return e[0]=o/i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=s&&s!==1/0?(r=1/(n-s),e[10]=(s+n)*r,e[14]=2*s*n*r):(e[10]=-1,e[14]=-2*n),e};var pl=function(e,t,i,n,s,r,o){var a=1/(t-i),c=1/(n-s),h=1/(r-o);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*h,e[11]=0,e[12]=(t+i)*a,e[13]=(s+n)*c,e[14]=(o+r)*h,e[15]=1,e};var ml;!function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL0ROW3=3]="COL0ROW3",e[e.COL1ROW0=4]="COL1ROW0",e[e.COL1ROW1=5]="COL1ROW1",e[e.COL1ROW2=6]="COL1ROW2",e[e.COL1ROW3=7]="COL1ROW3",e[e.COL2ROW0=8]="COL2ROW0",e[e.COL2ROW1=9]="COL2ROW1",e[e.COL2ROW2=10]="COL2ROW2",e[e.COL2ROW3=11]="COL2ROW3",e[e.COL3ROW0=12]="COL3ROW0",e[e.COL3ROW1=13]="COL3ROW1",e[e.COL3ROW2=14]="COL3ROW2",e[e.COL3ROW3=15]="COL3ROW3"}(ml||(ml={}));const gl=45*Math.PI/180,Al=1,yl=.1,bl=500,Bl=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);class vl extends Bc{static get IDENTITY(){return function(){wl||(wl=new vl,Object.freeze(wl));return wl}()}static get ZERO(){return function(){Cl||(Cl=new vl([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(Cl));return Cl}()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return ml}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this[9]=e[9],this[10]=e[10],this[11]=e[11],this[12]=e[12],this[13]=e[13],this[14]=e[14],this[15]=e[15],this.check()}set(e,t,i,n,s,r,o,a,c,h,l,u,d,f,p,m){return this[0]=e,this[1]=t,this[2]=i,this[3]=n,this[4]=s,this[5]=r,this[6]=o,this[7]=a,this[8]=c,this[9]=h,this[10]=l,this[11]=u,this[12]=d,this[13]=f,this[14]=p,this[15]=m,this.check()}setRowMajor(e,t,i,n,s,r,o,a,c,h,l,u,d,f,p,m){return this[0]=e,this[1]=s,this[2]=c,this[3]=d,this[4]=t,this[5]=r,this[6]=h,this[7]=f,this[8]=i,this[9]=o,this[10]=l,this[11]=p,this[12]=n,this[13]=a,this[14]=u,this[15]=m,this.check()}toRowMajor(e){return e[0]=this[0],e[1]=this[4],e[2]=this[8],e[3]=this[12],e[4]=this[1],e[5]=this[5],e[6]=this[9],e[7]=this[13],e[8]=this[2],e[9]=this[6],e[10]=this[10],e[11]=this[14],e[12]=this[3],e[13]=this[7],e[14]=this[11],e[15]=this[15],e}identity(){return this.copy(Bl)}fromObject(e){return this.check()}fromQuaternion(e){return function(e,t){var i=t[0],n=t[1],s=t[2],r=t[3],o=i+i,a=n+n,c=s+s,h=i*o,l=n*o,u=n*a,d=s*o,f=s*a,p=s*c,m=r*o,g=r*a,A=r*c;e[0]=1-u-p,e[1]=l+A,e[2]=d-g,e[3]=0,e[4]=l-A,e[5]=1-h-p,e[6]=f+m,e[7]=0,e[8]=d+g,e[9]=f-m,e[10]=1-h-u,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1}(this,e),this.check()}frustum(e){const{left:t,right:i,bottom:n,top:s,near:r=yl,far:o=bl}=e;return o===1/0?function(e,t,i,n,s,r){const o=2*r/(i-t),a=2*r/(s-n),c=(i+t)/(i-t),h=(s+n)/(s-n),l=-1,u=-1,d=-2*r;e[0]=o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=c,e[9]=h,e[10]=l,e[11]=u,e[12]=0,e[13]=0,e[14]=d,e[15]=0}(this,t,i,n,s,r):function(e,t,i,n,s,r,o){var a=1/(i-t),c=1/(s-n),h=1/(r-o);e[0]=2*r*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*r*c,e[6]=0,e[7]=0,e[8]=(i+t)*a,e[9]=(s+n)*c,e[10]=(o+r)*h,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*r*2*h,e[15]=0}(this,t,i,n,s,r,o),this.check()}lookAt(e){const{eye:t,center:i=[0,0,0],up:n=[0,1,0]}=e;return function(e,t,i,n){var s,r,o,a,c,h,l,u,d,f,p=t[0],m=t[1],g=t[2],A=n[0],y=n[1],b=n[2],B=i[0],v=i[1],C=i[2];Math.abs(p-B)<Cr&&Math.abs(m-v)<Cr&&Math.abs(g-C)<Cr?function(e){e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1}(e):(l=p-B,u=m-v,d=g-C,s=y*(d*=f=1/Math.hypot(l,u,d))-b*(u*=f),r=b*(l*=f)-A*d,o=A*u-y*l,(f=Math.hypot(s,r,o))?(s*=f=1/f,r*=f,o*=f):(s=0,r=0,o=0),a=u*o-d*r,c=d*s-l*o,h=l*r-u*s,(f=Math.hypot(a,c,h))?(a*=f=1/f,c*=f,h*=f):(a=0,c=0,h=0),e[0]=s,e[1]=a,e[2]=l,e[3]=0,e[4]=r,e[5]=c,e[6]=u,e[7]=0,e[8]=o,e[9]=h,e[10]=d,e[11]=0,e[12]=-(s*p+r*m+o*g),e[13]=-(a*p+c*m+h*g),e[14]=-(l*p+u*m+d*g),e[15]=1)}(this,t,i,n),this.check()}ortho(e){const{left:t,right:i,bottom:n,top:s,near:r=yl,far:o=bl}=e;return pl(this,t,i,n,s,r,o),this.check()}orthographic(e){const{fovy:t=gl,aspect:i=Al,focalDistance:n=1,near:s=yl,far:r=bl}=e;El(t);const o=t/2,a=n*Math.tan(o),c=a*i;return this.ortho({left:-c,right:c,bottom:-a,top:a,near:s,far:r})}perspective(e){const{fovy:t=45*Math.PI/180,aspect:i=1,near:n=.1,far:s=500}=e;return El(t),fl(this,t,i,n,s),this.check()}determinant(){return function(e){var t=e[0],i=e[1],n=e[2],s=e[3],r=e[4],o=e[5],a=e[6],c=e[7],h=e[8],l=e[9],u=e[10],d=e[11],f=e[12],p=e[13],m=e[14],g=e[15];return(t*o-i*r)*(u*g-d*m)-(t*a-n*r)*(l*g-d*p)+(t*c-s*r)*(l*m-u*p)+(i*a-n*o)*(h*g-d*f)-(i*c-s*o)*(h*m-u*f)+(n*c-s*a)*(h*p-l*f)}(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e,t){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=t||[-0,-0,-0];const i=this.getScale(t),n=1/i[0],s=1/i[1],r=1/i[2];return e[0]=this[0]*n,e[1]=this[1]*s,e[2]=this[2]*r,e[3]=0,e[4]=this[4]*n,e[5]=this[5]*s,e[6]=this[6]*r,e[7]=0,e[8]=this[8]*n,e[9]=this[9]*s,e[10]=this[10]*r,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e,t){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=t||[-0,-0,-0];const i=this.getScale(t),n=1/i[0],s=1/i[1],r=1/i[2];return e[0]=this[0]*n,e[1]=this[1]*s,e[2]=this[2]*r,e[3]=this[4]*n,e[4]=this[5]*s,e[5]=this[6]*r,e[6]=this[8]*n,e[7]=this[9]*s,e[8]=this[10]*r,e}transpose(){return function(e,t){if(e===t){var i=t[1],n=t[2],s=t[3],r=t[6],o=t[7],a=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=i,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=r,e[11]=t[14],e[12]=s,e[13]=o,e[14]=a}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15]}(this,this),this.check()}invert(){return function(e,t){var i=t[0],n=t[1],s=t[2],r=t[3],o=t[4],a=t[5],c=t[6],h=t[7],l=t[8],u=t[9],d=t[10],f=t[11],p=t[12],m=t[13],g=t[14],A=t[15],y=i*a-n*o,b=i*c-s*o,B=i*h-r*o,v=n*c-s*a,C=n*h-r*a,w=s*h-r*c,E=l*m-u*p,M=l*g-d*p,T=l*A-f*p,x=u*g-d*m,I=u*A-f*m,R=d*A-f*g,S=y*R-b*I+B*x+v*T-C*M+w*E;S&&(S=1/S,e[0]=(a*R-c*I+h*x)*S,e[1]=(s*I-n*R-r*x)*S,e[2]=(m*w-g*C+A*v)*S,e[3]=(d*C-u*w-f*v)*S,e[4]=(c*T-o*R-h*M)*S,e[5]=(i*R-s*T+r*M)*S,e[6]=(g*B-p*w-A*b)*S,e[7]=(l*w-d*B+f*b)*S,e[8]=(o*I-a*T+h*E)*S,e[9]=(n*T-i*I-r*E)*S,e[10]=(p*C-m*B+A*y)*S,e[11]=(u*B-l*C-f*y)*S,e[12]=(a*M-o*x-c*E)*S,e[13]=(i*x-n*M+s*E)*S,e[14]=(m*b-p*v-g*y)*S,e[15]=(l*v-u*b+d*y)*S)}(this,this),this.check()}multiplyLeft(e){return ul(this,e,this),this.check()}multiplyRight(e){return ul(this,this,e),this.check()}rotateX(e){return function(e,t,i){var n=Math.sin(i),s=Math.cos(i),r=t[4],o=t[5],a=t[6],c=t[7],h=t[8],l=t[9],u=t[10],d=t[11];t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=r*s+h*n,e[5]=o*s+l*n,e[6]=a*s+u*n,e[7]=c*s+d*n,e[8]=h*s-r*n,e[9]=l*s-o*n,e[10]=u*s-a*n,e[11]=d*s-c*n}(this,this,e),this.check()}rotateY(e){return function(e,t,i){var n=Math.sin(i),s=Math.cos(i),r=t[0],o=t[1],a=t[2],c=t[3],h=t[8],l=t[9],u=t[10],d=t[11];t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=r*s-h*n,e[1]=o*s-l*n,e[2]=a*s-u*n,e[3]=c*s-d*n,e[8]=r*n+h*s,e[9]=o*n+l*s,e[10]=a*n+u*s,e[11]=c*n+d*s}(this,this,e),this.check()}rotateZ(e){return function(e,t,i){var n=Math.sin(i),s=Math.cos(i),r=t[0],o=t[1],a=t[2],c=t[3],h=t[4],l=t[5],u=t[6],d=t[7];t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=r*s+h*n,e[1]=o*s+l*n,e[2]=a*s+u*n,e[3]=c*s+d*n,e[4]=h*s-r*n,e[5]=l*s-o*n,e[6]=u*s-a*n,e[7]=d*s-c*n}(this,this,e),this.check()}rotateXYZ(e){return this.rotateX(e[0]).rotateY(e[1]).rotateZ(e[2])}rotateAxis(e,t){return function(e,t,i,n){var s,r,o,a,c,h,l,u,d,f,p,m,g,A,y,b,B,v,C,w,E,M,T,x,I=n[0],R=n[1],S=n[2],O=Math.hypot(I,R,S);O<Cr||(I*=O=1/O,R*=O,S*=O,s=Math.sin(i),o=1-(r=Math.cos(i)),a=t[0],c=t[1],h=t[2],l=t[3],u=t[4],d=t[5],f=t[6],p=t[7],m=t[8],g=t[9],A=t[10],y=t[11],b=I*I*o+r,B=R*I*o+S*s,v=S*I*o-R*s,C=I*R*o-S*s,w=R*R*o+r,E=S*R*o+I*s,M=I*S*o+R*s,T=R*S*o-I*s,x=S*S*o+r,e[0]=a*b+u*B+m*v,e[1]=c*b+d*B+g*v,e[2]=h*b+f*B+A*v,e[3]=l*b+p*B+y*v,e[4]=a*C+u*w+m*E,e[5]=c*C+d*w+g*E,e[6]=h*C+f*w+A*E,e[7]=l*C+p*w+y*E,e[8]=a*M+u*T+m*x,e[9]=c*M+d*T+g*x,e[10]=h*M+f*T+A*x,e[11]=l*M+p*T+y*x,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]))}(this,this,e,t),this.check()}scale(e){return function(e,t,i){var n=i[0],s=i[1],r=i[2];e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*s,e[5]=t[5]*s,e[6]=t[6]*s,e[7]=t[7]*s,e[8]=t[8]*r,e[9]=t[9]*r,e[10]=t[10]*r,e[11]=t[11]*r,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]}(this,this,Array.isArray(e)?e:[e,e,e]),this.check()}translate(e){return function(e,t,i){var n,s,r,o,a,c,h,l,u,d,f,p,m=i[0],g=i[1],A=i[2];t===e?(e[12]=t[0]*m+t[4]*g+t[8]*A+t[12],e[13]=t[1]*m+t[5]*g+t[9]*A+t[13],e[14]=t[2]*m+t[6]*g+t[10]*A+t[14],e[15]=t[3]*m+t[7]*g+t[11]*A+t[15]):(n=t[0],s=t[1],r=t[2],o=t[3],a=t[4],c=t[5],h=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],e[0]=n,e[1]=s,e[2]=r,e[3]=o,e[4]=a,e[5]=c,e[6]=h,e[7]=l,e[8]=u,e[9]=d,e[10]=f,e[11]=p,e[12]=n*m+a*g+u*A+t[12],e[13]=s*m+c*g+d*A+t[13],e[14]=r*m+h*g+f*A+t[14],e[15]=o*m+l*g+p*A+t[15])}(this,this,e),this.check()}transform(e,t){return 4===e.length?(t=function(e,t,i){var n=t[0],s=t[1],r=t[2],o=t[3];return e[0]=i[0]*n+i[4]*s+i[8]*r+i[12]*o,e[1]=i[1]*n+i[5]*s+i[9]*r+i[13]*o,e[2]=i[2]*n+i[6]*s+i[10]*r+i[14]*o,e[3]=i[3]*n+i[7]*s+i[11]*r+i[15]*o,e}(t||[-0,-0,-0,-0],e,this),br(t,4),t):this.transformAsPoint(e,t)}transformAsPoint(e,t){const{length:i}=e;let n;switch(i){case 2:n=uo(t||[-0,-0],e,this);break;case 3:n=Rr(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return br(n,e.length),n}transformAsVector(e,t){let i;switch(e.length){case 2:i=_r(t||[-0,-0],e,this);break;case 3:i=Gr(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return br(i,e.length),i}transformPoint(e,t){return this.transformAsPoint(e,t)}transformVector(e,t){return this.transformAsPoint(e,t)}transformDirection(e,t){return this.transformAsVector(e,t)}makeRotationX(e){return this.identity().rotateX(e)}makeTranslation(e,t,i){return this.identity().translate([e,t,i])}}let Cl,wl;function El(e){if(e>2*Math.PI)throw Error("expected radians")}const Ml={EPSILON1:.1,EPSILON2:.01,EPSILON3:.001,EPSILON4:1e-4,EPSILON5:1e-5,EPSILON6:1e-6,EPSILON7:1e-7,EPSILON8:1e-8,EPSILON9:1e-9,EPSILON10:1e-10,EPSILON11:1e-11,EPSILON12:1e-12,EPSILON13:1e-13,EPSILON14:1e-14,EPSILON15:1e-15,EPSILON16:1e-16,EPSILON17:1e-17,EPSILON18:1e-18,EPSILON19:1e-19,EPSILON20:1e-20,PI_OVER_TWO:Math.PI/2,PI_OVER_FOUR:Math.PI/4,PI_OVER_SIX:Math.PI/6,TWO_PI:2*Math.PI},Tl=6378137,xl=6378137,Il=6356752.314245179;Math.max(Tl,xl,Il);function Rl(e){return e}new Nr;function Sl(e,t=[],i=Rl){return"longitude"in e?(t[0]=i(e.longitude),t[1]=i(e.latitude),t[2]=e.height):"x"in e?(t[0]=i(e.x),t[1]=i(e.y),t[2]=e.z):(t[0]=i(e[0]),t[1]=i(e[1]),t[2]=e[2]),t}function Ol(e,t,i=Rl){return"longitude"in t?(t.longitude=i(e[0]),t.latitude=i(e[1]),t.height=e[2]):"x"in t?(t.x=i(e[0]),t.y=i(e[1]),t.z=e[2]):(t[0]=i(e[0]),t[1]=i(e[1]),t[2]=e[2]),t}const Dl=new Nr,Fl=new Nr,_l=new Nr;const Gl=new Nr,Ll={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},Pl={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},kl={east:new Nr,north:new Nr,up:new Nr,west:new Nr,south:new Nr,down:new Nr},Nl=new Nr,Ul=new Nr,Hl=new Nr;function jl(e,t,i,n,s,r){const o=Ll[t]&&Ll[t][i];let a,c,h;Br(o&&(!n||n===o));const l=Gl.copy(s);if(mr(l.x,0,1e-14)&&mr(l.y,0,1e-14)){const e=Math.sign(l.z);a=Nl.fromArray(Pl[t]),"east"!==t&&"west"!==t&&a.scale(e),c=Ul.fromArray(Pl[i]),"east"!==i&&"west"!==i&&c.scale(e),h=Hl.fromArray(Pl[n]),"east"!==n&&"west"!==n&&h.scale(e)}else{const{up:s,east:r,north:o}=kl;r.set(-l.y,l.x,0).normalize(),e.geodeticSurfaceNormal(l,s),o.copy(s).cross(r);const{down:u,west:d,south:f}=kl;u.copy(s).scale(-1),d.copy(r).scale(-1),f.copy(o).scale(-1),a=kl[t],c=kl[i],h=kl[n]}return r[0]=a.x,r[1]=a.y,r[2]=a.z,r[3]=0,r[4]=c.x,r[5]=c.y,r[6]=c.z,r[7]=0,r[8]=h.x,r[9]=h.y,r[10]=h.z,r[11]=0,r[12]=l.x,r[13]=l.y,r[14]=l.z,r[15]=1,r}const Jl=new Nr,Vl=new Nr,zl=new Nr,Kl=new Nr,Wl=new Nr,Ql=new Nr;class Xl{constructor(e=0,t=0,i=0){Ti(this,"radii",void 0),Ti(this,"radiiSquared",void 0),Ti(this,"radiiToTheFourth",void 0),Ti(this,"oneOverRadii",void 0),Ti(this,"oneOverRadiiSquared",void 0),Ti(this,"minimumRadius",void 0),Ti(this,"maximumRadius",void 0),Ti(this,"centerToleranceSquared",Ml.EPSILON1),Ti(this,"squaredXOverSquaredZ",void 0),Br(e>=0),Br(t>=0),Br(i>=0),this.radii=new Nr(e,t,i),this.radiiSquared=new Nr(e*e,t*t,i*i),this.radiiToTheFourth=new Nr(e*e*e*e,t*t*t*t,i*i*i*i),this.oneOverRadii=new Nr(0===e?0:1/e,0===t?0:1/t,0===i?0:1/i),this.oneOverRadiiSquared=new Nr(0===e?0:1/(e*e),0===t?0:1/(t*t),0===i?0:1/(i*i)),this.minimumRadius=Math.min(e,t,i),this.maximumRadius=Math.max(e,t,i),0!==this.radiiSquared.z&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(e){return this===e||Boolean(e&&this.radii.equals(e.radii))}toString(){return this.radii.toString()}cartographicToCartesian(e,t=[0,0,0]){const i=Vl,n=zl,[,,s]=e;this.geodeticSurfaceNormalCartographic(e,i),n.copy(this.radiiSquared).scale(i);const r=Math.sqrt(i.dot(n));return n.scale(1/r),i.scale(s),n.add(i),n.to(t)}cartesianToCartographic(e,t=[0,0,0]){Ql.from(e);const i=this.scaleToGeodeticSurface(Ql,Kl);if(!i)return;const n=this.geodeticSurfaceNormal(i,Vl),s=Wl;s.copy(Ql).subtract(i);const r=Math.atan2(n.y,n.x),o=Math.asin(n.z),a=Math.sign(xr(s,Ql))*Mr(s);return Ol([r,o,a],t,lr._cartographicRadians?Rl:pr)}eastNorthUpToFixedFrame(e,t=new vl){return jl(this,"east","north","up",e,t)}localFrameToFixedFrame(e,t,i,n,s=new vl){return jl(this,e,t,i,n,s)}geocentricSurfaceNormal(e,t=[0,0,0]){return Jl.from(e).normalize().to(t)}geodeticSurfaceNormalCartographic(e,t=[0,0,0]){const i=function(e,t=[]){return Sl(e,t,lr._cartographicRadians?Rl:fr)}(e),n=i[0],s=i[1],r=Math.cos(s);return Jl.set(r*Math.cos(n),r*Math.sin(n),Math.sin(s)).normalize(),Jl.to(t)}geodeticSurfaceNormal(e,t=[0,0,0]){return Jl.from(e).scale(this.oneOverRadiiSquared).normalize().to(t)}scaleToGeodeticSurface(e,t){return function(e,t,i=[]){const{oneOverRadii:n,oneOverRadiiSquared:s,centerToleranceSquared:r}=t;Dl.from(e);const o=Dl.x,a=Dl.y,c=Dl.z,h=n.x,l=n.y,u=n.z,d=o*o*h*h,f=a*a*l*l,p=c*c*u*u,m=d+f+p,g=Math.sqrt(1/m);if(!Number.isFinite(g))return;const A=Fl;if(A.copy(e).scale(g),m<r)return A.to(i);const y=s.x,b=s.y,B=s.z,v=_l;v.set(A.x*y*2,A.y*b*2,A.z*B*2);let C,w,E,M,T=(1-g)*Dl.len()/(.5*v.len()),x=0;do{T-=x,C=1/(1+T*y),w=1/(1+T*b),E=1/(1+T*B);const e=C*C,t=w*w,i=E*E;M=d*e+f*t+p*i-1,x=M/(-2*(d*(e*C)*y+f*(t*w)*b+p*(i*E)*B))}while(Math.abs(M)>Ml.EPSILON12);return Dl.scale([C,w,E]).to(i)}(e,this,t)}scaleToGeocentricSurface(e,t=[0,0,0]){Kl.from(e);const i=Kl.x,n=Kl.y,s=Kl.z,r=this.oneOverRadiiSquared,o=1/Math.sqrt(i*i*r.x+n*n*r.y+s*s*r.z);return Kl.multiplyScalar(o).to(t)}transformPositionToScaledSpace(e,t=[0,0,0]){return Kl.from(e).scale(this.oneOverRadii).to(t)}transformPositionFromScaledSpace(e,t=[0,0,0]){return Kl.from(e).scale(this.radii).to(t)}getSurfaceNormalIntersectionWithZAxis(e,t=0,i=[0,0,0]){Br(mr(this.radii.x,this.radii.y,Ml.EPSILON15)),Br(this.radii.z>0),Kl.from(e);const n=Kl.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(n)>=this.radii.z-t))return Kl.set(0,0,n).to(i)}}async function Yl(e,t,i,n,s){return i=function(e,t,i,n,s){if(i=no(e,t,i),1!==e.version)throw new Error("Instanced 3D Model version ".concat(e.version," is not supported"));i=oo(e,t,i);const r=new DataView(t);if(e.gltfFormat=r.getUint32(i,!0),i+=4,i=ao(e,t,i),i=Lh(e,t,i,n),0===e.featureTableJsonByteLength)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");const o=new Vr(e.featureTableJson,e.featureTableBinary),a=o.getGlobalProperty("INSTANCES_LENGTH");if(o.featuresLength=a,!Number.isFinite(a))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");e.eastNorthUp=o.getGlobalProperty("EAST_NORTH_UP"),e.rtcCenter=o.getGlobalProperty("RTC_CENTER",ar.FLOAT,3);new to(e.batchTableJson,e.batchTableBinary,a);return function(e,t,i,n){const s={instances:new Array(n),batchTable:e._batchTable,cull:!1,url:void 0,gltf:void 0,basePath:void 0,incrementallyLoadTextures:!1,forwardAxis:[1,0,0]},r=s.instances,o=new Nr,a=new Nr,c=new Nr,h=new Nr,l=new Mc,u=new ll,d=new Nr,f={},p=new vl,m=[],g=[],A=new Nr,y=new Nr;for(let i=0;i<n;i++){let n;if(t.hasProperty("POSITION"))n=t.getProperty("POSITION",ar.FLOAT,3,i,o);else if(t.hasProperty("POSITION_QUANTIZED")){n=t.getProperty("POSITION_QUANTIZED",ar.UNSIGNED_SHORT,3,i,o);const e=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",ar.FLOAT,3,A);if(!e)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");const s=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",ar.FLOAT,3,y);if(!s)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");const r=65535;for(let t=0;t<3;t++)n[t]=n[t]/r*s[t]+e[t]}if(!n)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");o.copy(n),f.translation=o,e.normalUp=t.getProperty("NORMAL_UP",ar.FLOAT,3,i,m),e.normalRight=t.getProperty("NORMAL_RIGHT",ar.FLOAT,3,i,g);const s=!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",ar.UNSIGNED_SHORT,2,m),e.octNormalRight=t.getProperty("NORMAL_RIGHT_OCT32P",ar.UNSIGNED_SHORT,2,g),e.octNormalUp){if(!e.octNormalRight)throw new Error("i3dm: oct-encoded orientation requires NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P");throw new Error("i3dm: oct-encoded orientation not implemented")}e.eastNorthUp?(Xl.WGS84.eastNorthUpToFixedFrame(o,p),p.getRotationMatrix3(l)):l.identity()}s&&(h.copy(a).cross(c).normalize(),l.setColumn(0,a),l.setColumn(1,c),l.setColumn(2,h)),u.fromMatrix3(l),f.rotation=u,d.set(1,1,1);const b=t.getProperty("SCALE",ar.FLOAT,1,i);Number.isFinite(b)&&d.multiplyByScalar(b);const B=t.getProperty("SCALE_NON_UNIFORM",ar.FLOAT,3,i,m);B&&d.scale(B),f.scale=d;let v=t.getProperty("BATCH_ID",ar.UNSIGNED_SHORT,1,i);void 0===v&&(v=i);const C=(new vl).fromQuaternion(f.rotation);p.identity(),p.translate(f.translation),p.multiplyRight(C),p.scale(f.scale);const w=p.clone();r[i]={modelMatrix:w,batchId:v}}e.instances=r}(e,o,0,a),i}(e,t,i,n),await Ph(e,e.gltfFormat,n,s),i}async function ql(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};switch(s.byteOffset=t,s.type=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const i=new DataView(e);return"".concat(String.fromCharCode(i.getUint8(t+0))).concat(String.fromCharCode(i.getUint8(t+1))).concat(String.fromCharCode(i.getUint8(t+2))).concat(String.fromCharCode(i.getUint8(t+3)))}(e,t),s.type){case cs.COMPOSITE:return await async function(e,t,i,n,s,r){i=no(e,t,i);const o=new DataView(t);for(e.tilesLength=o.getUint32(i,!0),i+=4,e.tiles=[];e.tiles.length<e.tilesLength&&e.byteLength-i>12;){const o={};e.tiles.push(o),i=await r(t,i,n,s,o)}return i}(s,e,t,i,n,ql);case cs.BATCHED_3D_MODEL:return await kh(s,e,t,i,n);case cs.GLTF:return await async function(e,t,i,n){e.rotateYtoZ=!0,e.gltfUpAxis=i["3d-tiles"]&&i["3d-tiles"].assetGltfUpAxis?i["3d-tiles"].assetGltfUpAxis:"Y";const{parse:s}=n;e.gltf=await s(t,_h,i,n),e.gpuMemoryUsageInBytes=Ua(e.gltf)}(s,e,i,n);case cs.INSTANCED_3D_MODEL:return await Yl(s,e,t,i,n);case cs.POINT_CLOUD:return await Bo(s,e,t,i,n);default:throw new Error("3DTileLoader: unknown type ".concat(s.type))}}Ti(Xl,"WGS84",new Xl(Tl,xl,Il));async function Zl(e,t,i,n){const s=e[t].bufferView,r=e.bufferViews[s],o=e.buffers[r.buffer];if(null==n||!n.url||!n.fetch)throw new Error("Url is not provided");if(!n.fetch)throw new Error("fetch is not provided");if(o.uri){const e=function(e,t){if(t.startsWith("http")){const i=new URL(e,t);return decodeURI(i.toString())}const i="http://".concat(t),n=new URL(e,i);return"/".concat(n.host).concat(n.pathname)}(o.uri,null==n?void 0:n.url),t=await n.fetch(e),i=await t.arrayBuffer();return new Uint8Array(i,r.byteOffset,r.byteLength)}return new Uint8Array(i,r.byteOffset,r.byteLength)}function $l(e){const t=new DataView(e);return t.getUint32(0,!0)+2**32*t.getUint32(4,!0)}const eu={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:as,extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:async function(e,t,i){if(1952609651!==new Uint32Array(e.slice(0,4))[0])throw new Error("Wrong subtree file magic number");if(1!==new Uint32Array(e.slice(4,8))[0])throw new Error("Wrong subtree file verson, must be 1");const n=$l(e.slice(8,16)),s=new Uint8Array(e,24,n),r=new TextDecoder("utf8").decode(s),o=JSON.parse(r),a=$l(e.slice(16,24));let c=new ArrayBuffer(0);return a&&(c=e.slice(24+n)),"bufferView"in o.tileAvailability&&(o.tileAvailability.explicitBitstream=await Zl(o,"tileAvailability",c,i)),"bufferView"in o.contentAvailability&&(o.contentAvailability.explicitBitstream=await Zl(o,"contentAvailability",c,i)),"bufferView"in o.childSubtreeAvailability&&(o.childSubtreeAvailability.explicitBitstream=await Zl(o,"childSubtreeAvailability",c,i)),o},options:{}};var tu=null;try{tu=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(e){}function iu(e,t,i){this.low=0|e,this.high=0|t,this.unsigned=!!i}function nu(e){return!0===(e&&e.__isLong__)}function su(e){var t=Math.clz32(e&-e);return e?31-t:t}iu.prototype.__isLong__,Object.defineProperty(iu.prototype,"__isLong__",{value:!0}),iu.isLong=nu;var ru={},ou={};function au(e,t){var i,n,s;return t?(s=0<=(e>>>=0)&&e<256)&&(n=ou[e])?n:(i=hu(e,0,!0),s&&(ou[e]=i),i):(s=-128<=(e|=0)&&e<128)&&(n=ru[e])?n:(i=hu(e,e<0?-1:0,!1),s&&(ru[e]=i),i)}function cu(e,t){if(isNaN(e))return t?yu:Au;if(t){if(e<0)return yu;if(e>=pu)return wu}else{if(e<=-mu)return Eu;if(e+1>=mu)return Cu}return e<0?cu(-e,t).neg():hu(e%fu|0,e/fu|0,t)}function hu(e,t,i){return new iu(e,t,i)}iu.fromInt=au,iu.fromNumber=cu,iu.fromBits=hu;var lu=Math.pow;function uu(e,t,i){if(0===e.length)throw Error("empty string");if("number"==typeof t?(i=t,t=!1):t=!!t,"NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return t?yu:Au;if((i=i||10)<2||36<i)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return uu(e.substring(1),t,i).neg();for(var s=cu(lu(i,8)),r=Au,o=0;o<e.length;o+=8){var a=Math.min(8,e.length-o),c=parseInt(e.substring(o,o+a),i);if(a<8){var h=cu(lu(i,a));r=r.mul(h).add(cu(c))}else r=(r=r.mul(s)).add(cu(c))}return r.unsigned=t,r}function du(e,t){return"number"==typeof e?cu(e,t):"string"==typeof e?uu(e,t):hu(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}iu.fromString=uu,iu.fromValue=du;var fu=4294967296,pu=fu*fu,mu=pu/2,gu=au(1<<24),Au=au(0);iu.ZERO=Au;var yu=au(0,!0);iu.UZERO=yu;var bu=au(1);iu.ONE=bu;var Bu=au(1,!0);iu.UONE=Bu;var vu=au(-1);iu.NEG_ONE=vu;var Cu=hu(-1,2147483647,!1);iu.MAX_VALUE=Cu;var wu=hu(-1,-1,!0);iu.MAX_UNSIGNED_VALUE=wu;var Eu=hu(0,-2147483648,!1);iu.MIN_VALUE=Eu;var Mu=iu.prototype;Mu.toInt=function(){return this.unsigned?this.low>>>0:this.low},Mu.toNumber=function(){return this.unsigned?(this.high>>>0)*fu+(this.low>>>0):this.high*fu+(this.low>>>0)},Mu.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(Eu)){var t=cu(e),i=this.div(t),n=i.mul(t).sub(this);return i.toString(e)+n.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var s=cu(lu(e,6),this.unsigned),r=this,o="";;){var a=r.div(s),c=(r.sub(a.mul(s)).toInt()>>>0).toString(e);if((r=a).isZero())return c+o;for(;c.length<6;)c="0"+c;o=""+c+o}},Mu.getHighBits=function(){return this.high},Mu.getHighBitsUnsigned=function(){return this.high>>>0},Mu.getLowBits=function(){return this.low},Mu.getLowBitsUnsigned=function(){return this.low>>>0},Mu.getNumBitsAbs=function(){if(this.isNegative())return this.eq(Eu)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},Mu.isZero=function(){return 0===this.high&&0===this.low},Mu.eqz=Mu.isZero,Mu.isNegative=function(){return!this.unsigned&&this.high<0},Mu.isPositive=function(){return this.unsigned||this.high>=0},Mu.isOdd=function(){return 1==(1&this.low)},Mu.isEven=function(){return 0==(1&this.low)},Mu.equals=function(e){return nu(e)||(e=du(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},Mu.eq=Mu.equals,Mu.notEquals=function(e){return!this.eq(e)},Mu.neq=Mu.notEquals,Mu.ne=Mu.notEquals,Mu.lessThan=function(e){return this.comp(e)<0},Mu.lt=Mu.lessThan,Mu.lessThanOrEqual=function(e){return this.comp(e)<=0},Mu.lte=Mu.lessThanOrEqual,Mu.le=Mu.lessThanOrEqual,Mu.greaterThan=function(e){return this.comp(e)>0},Mu.gt=Mu.greaterThan,Mu.greaterThanOrEqual=function(e){return this.comp(e)>=0},Mu.gte=Mu.greaterThanOrEqual,Mu.ge=Mu.greaterThanOrEqual,Mu.compare=function(e){if(nu(e)||(e=du(e)),this.eq(e))return 0;var t=this.isNegative(),i=e.isNegative();return t&&!i?-1:!t&&i?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},Mu.comp=Mu.compare,Mu.negate=function(){return!this.unsigned&&this.eq(Eu)?Eu:this.not().add(bu)},Mu.neg=Mu.negate,Mu.add=function(e){nu(e)||(e=du(e));var t=this.high>>>16,i=65535&this.high,n=this.low>>>16,s=65535&this.low,r=e.high>>>16,o=65535&e.high,a=e.low>>>16,c=0,h=0,l=0,u=0;return l+=(u+=s+(65535&e.low))>>>16,h+=(l+=n+a)>>>16,c+=(h+=i+o)>>>16,c+=t+r,hu((l&=65535)<<16|(u&=65535),(c&=65535)<<16|(h&=65535),this.unsigned)},Mu.subtract=function(e){return nu(e)||(e=du(e)),this.add(e.neg())},Mu.sub=Mu.subtract,Mu.multiply=function(e){if(this.isZero())return this;if(nu(e)||(e=du(e)),tu)return hu(tu.mul(this.low,this.high,e.low,e.high),tu.get_high(),this.unsigned);if(e.isZero())return this.unsigned?yu:Au;if(this.eq(Eu))return e.isOdd()?Eu:Au;if(e.eq(Eu))return this.isOdd()?Eu:Au;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(gu)&&e.lt(gu))return cu(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,i=65535&this.high,n=this.low>>>16,s=65535&this.low,r=e.high>>>16,o=65535&e.high,a=e.low>>>16,c=65535&e.low,h=0,l=0,u=0,d=0;return u+=(d+=s*c)>>>16,l+=(u+=n*c)>>>16,u&=65535,l+=(u+=s*a)>>>16,h+=(l+=i*c)>>>16,l&=65535,h+=(l+=n*a)>>>16,l&=65535,h+=(l+=s*o)>>>16,h+=t*c+i*a+n*o+s*r,hu((u&=65535)<<16|(d&=65535),(h&=65535)<<16|(l&=65535),this.unsigned)},Mu.mul=Mu.multiply,Mu.divide=function(e){if(nu(e)||(e=du(e)),e.isZero())throw Error("division by zero");var t,i,n;if(tu)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?hu((this.unsigned?tu.div_u:tu.div_s)(this.low,this.high,e.low,e.high),tu.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?yu:Au;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return yu;if(e.gt(this.shru(1)))return Bu;n=yu}else{if(this.eq(Eu))return e.eq(bu)||e.eq(vu)?Eu:e.eq(Eu)?bu:(t=this.shr(1).div(e).shl(1)).eq(Au)?e.isNegative()?bu:vu:(i=this.sub(e.mul(t)),n=t.add(i.div(e)));if(e.eq(Eu))return this.unsigned?yu:Au;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();n=Au}for(i=this;i.gte(e);){t=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var s=Math.ceil(Math.log(t)/Math.LN2),r=s<=48?1:lu(2,s-48),o=cu(t),a=o.mul(e);a.isNegative()||a.gt(i);)a=(o=cu(t-=r,this.unsigned)).mul(e);o.isZero()&&(o=bu),n=n.add(o),i=i.sub(a)}return n},Mu.div=Mu.divide,Mu.modulo=function(e){return nu(e)||(e=du(e)),tu?hu((this.unsigned?tu.rem_u:tu.rem_s)(this.low,this.high,e.low,e.high),tu.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},Mu.mod=Mu.modulo,Mu.rem=Mu.modulo,Mu.not=function(){return hu(~this.low,~this.high,this.unsigned)},Mu.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},Mu.clz=Mu.countLeadingZeros,Mu.countTrailingZeros=function(){return this.low?su(this.low):su(this.high)+32},Mu.ctz=Mu.countTrailingZeros,Mu.and=function(e){return nu(e)||(e=du(e)),hu(this.low&e.low,this.high&e.high,this.unsigned)},Mu.or=function(e){return nu(e)||(e=du(e)),hu(this.low|e.low,this.high|e.high,this.unsigned)},Mu.xor=function(e){return nu(e)||(e=du(e)),hu(this.low^e.low,this.high^e.high,this.unsigned)},Mu.shiftLeft=function(e){return nu(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?hu(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):hu(0,this.low<<e-32,this.unsigned)},Mu.shl=Mu.shiftLeft,Mu.shiftRight=function(e){return nu(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?hu(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):hu(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},Mu.shr=Mu.shiftRight,Mu.shiftRightUnsigned=function(e){return nu(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?hu(this.low>>>e|this.high<<32-e,this.high>>>e,this.unsigned):hu(32===e?this.high:this.high>>>e-32,0,this.unsigned)},Mu.shru=Mu.shiftRightUnsigned,Mu.shr_u=Mu.shiftRightUnsigned,Mu.rotateLeft=function(e){var t;return nu(e)&&(e=e.toInt()),0==(e&=63)?this:32===e?hu(this.high,this.low,this.unsigned):e<32?(t=32-e,hu(this.low<<e|this.high>>>t,this.high<<e|this.low>>>t,this.unsigned)):(t=32-(e-=32),hu(this.high<<e|this.low>>>t,this.low<<e|this.high>>>t,this.unsigned))},Mu.rotl=Mu.rotateLeft,Mu.rotateRight=function(e){var t;return nu(e)&&(e=e.toInt()),0==(e&=63)?this:32===e?hu(this.high,this.low,this.unsigned):e<32?(t=32-e,hu(this.high<<t|this.low>>>e,this.low<<t|this.high>>>e,this.unsigned)):(t=32-(e-=32),hu(this.low<<t|this.high>>>e,this.high<<t|this.low>>>e,this.unsigned))},Mu.rotr=Mu.rotateRight,Mu.toSigned=function(){return this.unsigned?hu(this.low,this.high,!1):this},Mu.toUnsigned=function(){return this.unsigned?this:hu(this.low,this.high,!0)},Mu.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},Mu.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},Mu.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},iu.fromBytes=function(e,t,i){return i?iu.fromBytesLE(e,t):iu.fromBytesBE(e,t)},iu.fromBytesLE=function(e,t){return new iu(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},iu.fromBytesBE=function(e,t){return new iu(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)};const Tu=iu,xu=16;function Iu(e){"X"===e&&(e="");const t=e.padEnd(xu,"0");return Tu.fromString(t,!0,16)}const Ru=-1,Su=0,Ou=1;new Nr,new Nr;const Du=new Nr,Fu=new Nr;class _u{constructor(e=[0,0,0],t=0){Ti(this,"center",void 0),Ti(this,"radius",void 0),this.radius=-0,this.center=new Nr,this.fromCenterRadius(e,t)}fromCenterRadius(e,t){return this.center.from(e),this.radius=t,this}fromCornerPoints(e,t){return t=Du.from(t),this.center=(new Nr).from(e).add(t).scale(.5),this.radius=this.center.distance(t),this}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.radius===e.radius}clone(){return new _u(this.center,this.radius)}union(e){const t=this.center,i=this.radius,n=e.center,s=e.radius,r=Du.copy(n).subtract(t),o=r.magnitude();if(i>=o+s)return this.clone();if(s>=o+i)return e.clone();const a=.5*(i+o+s);return Fu.copy(r).scale((-i+a)/o).add(t),this.center.copy(Fu),this.radius=a,this}expand(e){const t=Du.from(e).subtract(this.center).magnitude();return t>this.radius&&(this.radius=t),this}transform(e){this.center.transform(e);const t=dl(Du,e);return this.radius=Math.max(t[0],Math.max(t[1],t[2]))*this.radius,this}distanceSquaredTo(e){const t=this.distanceTo(e);return t*t}distanceTo(e){const t=Du.from(e).subtract(this.center);return Math.max(0,t.len()-this.radius)}intersectPlane(e){const t=this.center,i=this.radius,n=e.normal.dot(t)+e.distance;return n<-i?Ru:n<i?Su:Ou}}const Gu=new Nr,Lu=new Nr,Pu=new Nr,ku=new Nr,Nu=new Nr,Uu=new Nr,Hu=new Nr,ju=0,Ju=1,Vu=2,zu=3,Ku=4,Wu=5,Qu=6,Xu=7,Yu=8;class qu{constructor(e=[0,0,0],t=[0,0,0,0,0,0,0,0,0]){Ti(this,"center",void 0),Ti(this,"halfAxes",void 0),this.center=(new Nr).from(e),this.halfAxes=new Mc(t)}get halfSize(){const e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),i=this.halfAxes.getColumn(2);return[new Nr(e).len(),new Nr(t).len(),new Nr(i).len()]}get quaternion(){const e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),i=this.halfAxes.getColumn(2),n=new Nr(e).normalize(),s=new Nr(t).normalize(),r=new Nr(i).normalize();return(new ll).fromMatrix3(new Mc([...n,...s,...r]))}fromCenterHalfSizeQuaternion(e,t,i){const n=new ll(i),s=(new Mc).fromQuaternion(n);return s[0]=s[0]*t[0],s[1]=s[1]*t[0],s[2]=s[2]*t[0],s[3]=s[3]*t[1],s[4]=s[4]*t[1],s[5]=s[5]*t[1],s[6]=s[6]*t[2],s[7]=s[7]*t[2],s[8]=s[8]*t[2],this.center=(new Nr).from(e),this.halfAxes=s,this}clone(){return new qu(this.center,this.halfAxes)}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.halfAxes.equals(e.halfAxes)}getBoundingSphere(e=new _u){const t=this.halfAxes,i=t.getColumn(0,Pu),n=t.getColumn(1,ku),s=t.getColumn(2,Nu),r=Gu.copy(i).add(n).add(s);return e.center.copy(this.center),e.radius=r.magnitude(),e}intersectPlane(e){const t=this.center,i=e.normal,n=this.halfAxes,s=i.x,r=i.y,o=i.z,a=Math.abs(s*n[ju]+r*n[Ju]+o*n[Vu])+Math.abs(s*n[zu]+r*n[Ku]+o*n[Wu])+Math.abs(s*n[Qu]+r*n[Xu]+o*n[Yu]),c=i.dot(t)+e.distance;return c<=-a?Ru:c>=a?Ou:Su}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){const t=Lu.from(e).subtract(this.center),i=this.halfAxes,n=i.getColumn(0,Pu),s=i.getColumn(1,ku),r=i.getColumn(2,Nu),o=n.magnitude(),a=s.magnitude(),c=r.magnitude();n.normalize(),s.normalize(),r.normalize();let h,l=0;return h=Math.abs(t.dot(n))-o,h>0&&(l+=h*h),h=Math.abs(t.dot(s))-a,h>0&&(l+=h*h),h=Math.abs(t.dot(r))-c,h>0&&(l+=h*h),l}computePlaneDistances(e,t,i=[-0,-0]){let n=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;const r=this.center,o=this.halfAxes,a=o.getColumn(0,Pu),c=o.getColumn(1,ku),h=o.getColumn(2,Nu),l=Uu.copy(a).add(c).add(h).add(r),u=Hu.copy(l).subtract(e);let d=t.dot(u);return n=Math.min(d,n),s=Math.max(d,s),l.copy(r).add(a).add(c).subtract(h),u.copy(l).subtract(e),d=t.dot(u),n=Math.min(d,n),s=Math.max(d,s),l.copy(r).add(a).subtract(c).add(h),u.copy(l).subtract(e),d=t.dot(u),n=Math.min(d,n),s=Math.max(d,s),l.copy(r).add(a).subtract(c).subtract(h),u.copy(l).subtract(e),d=t.dot(u),n=Math.min(d,n),s=Math.max(d,s),r.copy(l).subtract(a).add(c).add(h),u.copy(l).subtract(e),d=t.dot(u),n=Math.min(d,n),s=Math.max(d,s),r.copy(l).subtract(a).add(c).subtract(h),u.copy(l).subtract(e),d=t.dot(u),n=Math.min(d,n),s=Math.max(d,s),r.copy(l).subtract(a).subtract(c).add(h),u.copy(l).subtract(e),d=t.dot(u),n=Math.min(d,n),s=Math.max(d,s),r.copy(l).subtract(a).subtract(c).subtract(h),u.copy(l).subtract(e),d=t.dot(u),n=Math.min(d,n),s=Math.max(d,s),i[0]=n,i[1]=s,i}transform(e){this.center.transformAsPoint(e);const t=this.halfAxes.getColumn(0,Pu);t.transformAsPoint(e);const i=this.halfAxes.getColumn(1,ku);i.transformAsPoint(e);const n=this.halfAxes.getColumn(2,Nu);return n.transformAsPoint(e),this.halfAxes=new Mc([...t,...i,...n]),this}getTransform(){throw new Error("not implemented")}}const Zu=new Nr,$u=new Nr;class ed{constructor(e=[0,0,1],t=0){Ti(this,"normal",void 0),Ti(this,"distance",void 0),this.normal=new Nr,this.distance=-0,this.fromNormalDistance(e,t)}fromNormalDistance(e,t){return Br(Number.isFinite(t)),this.normal.from(e).normalize(),this.distance=t,this}fromPointNormal(e,t){e=Zu.from(e),this.normal.from(t).normalize();const i=-this.normal.dot(e);return this.distance=i,this}fromCoefficients(e,t,i,n){return this.normal.set(e,t,i),Br(mr(this.normal.len(),1)),this.distance=n,this}clone(){return new ed(this.normal,this.distance)}equals(e){return mr(this.distance,e.distance)&&mr(this.normal,e.normal)}getPointDistance(e){return this.normal.dot(e)+this.distance}transform(e){const t=$u.copy(this.normal).transformAsVector(e).normalize(),i=this.normal.scale(-this.distance).transform(e);return this.fromPointNormal(i,t)}projectPointOntoPlane(e,t=[0,0,0]){e=Zu.from(e);const i=this.getPointDistance(e),n=$u.copy(this.normal).scale(i);return e.subtract(n).to(t)}}const td=[new Nr([1,0,0]),new Nr([0,1,0]),new Nr([0,0,1])],id=new Nr,nd=new Nr;new ed(new Nr(1,0,0),0);class sd{constructor(e=[]){Ti(this,"planes",void 0),this.planes=e}fromBoundingSphere(e){this.planes.length=2*td.length;const t=e.center,i=e.radius;let n=0;for(const e of td){let s=this.planes[n],r=this.planes[n+1];s||(s=this.planes[n]=new ed),r||(r=this.planes[n+1]=new ed);const o=id.copy(e).scale(-i).add(t);e.dot(o);s.fromPointNormal(o,e);const a=id.copy(e).scale(i).add(t),c=nd.copy(e).negate();c.dot(a);r.fromPointNormal(a,c),n+=2}return this}computeVisibility(e){let t=Ou;for(const i of this.planes){switch(e.intersectPlane(i)){case Ru:return Ru;case Su:t=Su}}return t}computeVisibilityWithPlaneMask(e,t){if(Br(Number.isFinite(t),"parentPlaneMask is required."),t===sd.MASK_OUTSIDE||t===sd.MASK_INSIDE)return t;let i=sd.MASK_INSIDE;const n=this.planes;for(let s=0;s<this.planes.length;++s){const r=s<31?1<<s:0;if(s<31&&0==(t&r))continue;const o=n[s],a=e.intersectPlane(o);if(a===Ru)return sd.MASK_OUTSIDE;a===Su&&(i|=r)}return i}}Ti(sd,"MASK_OUTSIDE",4294967295),Ti(sd,"MASK_INSIDE",0),Ti(sd,"MASK_INDETERMINATE",2147483647);new Nr,new Nr,new Nr,new Nr,new Nr;new Nr,new Nr,new Nr,new Nr,new Nr,new Nr,new Nr,new Nr,new Nr,new Nr,new Nr,new Nr,Math.PI;const rd=new Mc,od=new Mc,ad=new Mc,cd=new Mc,hd=new Mc;function ld(e,t={}){const i=Ml.EPSILON20;let n=0,s=0;const r=od,o=ad;r.identity(),o.copy(e);const a=i*function(e){let t=0;for(let i=0;i<9;++i){const n=e[i];t+=n*n}return Math.sqrt(t)}(o);for(;s<10&&fd(o)>a;)pd(o,cd),hd.copy(cd).transpose(),o.multiplyRight(cd),o.multiplyLeft(hd),r.multiplyRight(cd),++n>2&&(++s,n=0);return t.unitary=r.toTarget(t.unitary),t.diagonal=o.toTarget(t.diagonal),t}const ud=[1,0,0],dd=[2,2,1];function fd(e){let t=0;for(let i=0;i<3;++i){const n=e[rd.getElementIndex(dd[i],ud[i])];t+=2*n*n}return Math.sqrt(t)}function pd(e,t){const i=Ml.EPSILON15;let n=0,s=1;for(let t=0;t<3;++t){const i=Math.abs(e[rd.getElementIndex(dd[t],ud[t])]);i>n&&(s=t,n=i)}const r=ud[s],o=dd[s];let a=1,c=0;if(Math.abs(e[rd.getElementIndex(o,r)])>i){const t=(e[rd.getElementIndex(o,o)]-e[rd.getElementIndex(r,r)])/2/e[rd.getElementIndex(o,r)];let i;i=t<0?-1/(-t+Math.sqrt(1+t*t)):1/(t+Math.sqrt(1+t*t)),a=1/Math.sqrt(1+i*i),c=i*a}return Mc.IDENTITY.to(t),t[rd.getElementIndex(r,r)]=t[rd.getElementIndex(o,o)]=a,t[rd.getElementIndex(o,r)]=c,t[rd.getElementIndex(r,o)]=-c,t}const md=new Nr,gd=new Nr,Ad=new Nr,yd=new Nr,bd=new Nr,Bd=new Mc,vd={diagonal:new Mc,unitary:new Mc};const Cd=3,wd=61,Ed=180/Math.PI;function Md(e,t,i){const n=1<<t;return[(e[0]+i[0])/n,(e[1]+i[1])/n]}function Td(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function xd(e){return[Td(e[0]),Td(e[1])]}function Id(e,t){let[i,n]=t;switch(e){case 0:return[1,i,n];case 1:return[-i,1,n];case 2:return[-i,-n,1];case 3:return[-1,-n,-i];case 4:return[n,-1,-i];case 5:return[n,i,-1];default:throw new Error("Invalid face")}}function Rd(e){let[t,i,n]=e;const s=Math.atan2(n,Math.sqrt(t*t+i*i));return[Math.atan2(i,t)*Ed,s*Ed]}function Sd(e,t,i,n){if(0===n){1===i&&(t[0]=e-1-t[0],t[1]=e-1-t[1]);const n=t[0];t[0]=t[1],t[1]=n}}function Od(e){const t=function(e){if(e.indexOf("/")>0)return e;const t=Iu(e);return function(e){if(e.isZero())return"";let t=e.toString(2);for(;t.length<Cd+wd;)t="0"+t;const i=t.lastIndexOf("1"),n=t.substring(0,3),s=t.substring(3,i),r=s.length/2,o=Tu.fromString(n,!0,2).toString(10);let a="";if(0!==r)for(a=Tu.fromString(s,!0,2).toString(4);a.length<r;)a="0"+a;return"".concat(o,"/").concat(a)}(t)}(e),i=function(e){if(0===e.length)throw new Error("Invalid Hilbert quad key ".concat(e));const t=e.split("/"),i=parseInt(t[0],10),n=t[1],s=n.length;let r=0;const o=[0,0];for(let e=s-1;e>=0;e--){r=s-e;const t=n[e];let i=0,a=0;"1"===t?a=1:"2"===t?(i=1,a=1):"3"===t&&(i=1);const c=Math.pow(2,r-1);Sd(c,o,i,a),o[0]+=c*i,o[1]+=c*a}if(i%2==1){const e=o[0];o[0]=o[1],o[1]=e}return{face:i,ij:o,level:r}}(t);return i}const Dd=100;function Fd(e){const{face:t,ij:i,level:n}=e,s=[[0,0],[0,1],[1,1],[1,0],[0,0]],r=Math.max(1,Math.ceil(Dd*Math.pow(2,-n))),o=new Float64Array(4*r*2+2);let a=0,c=0;for(let e=0;e<4;e++){const h=s[e].slice(0),l=s[e+1],u=(l[0]-h[0])/r,d=(l[1]-h[1])/r;for(let e=0;e<r;e++){h[0]+=u,h[1]+=d;const e=Rd(Id(t,xd(Md(i,n,h))));Math.abs(e[1])>89.999&&(e[0]=c);const s=e[0]-c;e[0]+=s>180?-360:s<-180?360:0,o[a++]=e[0],o[a++]=e[1],c=e[0]}}return o[a++]=o[0],o[a++]=o[1],o}function _d(e){if(e.length%2!=0)throw new Error("Invalid corners");const t=[],i=[];for(let n=0;n<e.length;n+=2)t.push(e[n]),i.push(e[n+1]);return t.sort(((e,t)=>e-t)),i.sort(((e,t)=>e-t)),{west:t[0],east:t[t.length-1],north:i[i.length-1],south:i[0]}}function Gd(e,t){const i=(null==t?void 0:t.minimumHeight)||0,n=(null==t?void 0:t.maximumHeight)||0,s=function(e){let t;if(2===e.face||5===e.face){let i=null,n=0;for(let t=0;t<4;t++){const s=Fd(Od("".concat(e.face,"/").concat(t)));null==i&&(i=new Float64Array(4*s.length)),i.set(s,n),n+=s.length}t=_d(i)}else t=_d(Fd(e));return t}(Od(e)),r=s.west,o=s.south,a=s.east,c=s.north,h=[];return h.push(new Nr(r,c,i)),h.push(new Nr(a,c,i)),h.push(new Nr(a,o,i)),h.push(new Nr(r,o,i)),h.push(new Nr(r,c,n)),h.push(new Nr(a,c,n)),h.push(new Nr(a,o,n)),h.push(new Nr(r,o,n)),h}function Ld(e){return function(e){const t=xd(Md(e.ij,e.level,[.5,.5]));return Rd(Id(e.face,t))}(Od(e))}function Pd(e){const t=e.token,i={minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight},n=Gd(t,i),s=Ld(t),r=s[0],o=s[1],a=Xl.WGS84.cartographicToCartesian([r,o,i.maximumHeight]),c=new Nr(a[0],a[1],a[2]);n.push(c);const h=function(e,t=new qu){if(!e||0===e.length)return t.halfAxes=new Mc([0,0,0,0,0,0,0,0,0]),t.center=new Nr,t;const i=e.length,n=new Nr(0,0,0);for(const t of e)n.add(t);const s=1/i;n.multiplyByScalar(s);let r=0,o=0,a=0,c=0,h=0,l=0;for(const t of e){const e=md.copy(t).subtract(n);r+=e.x*e.x,o+=e.x*e.y,a+=e.x*e.z,c+=e.y*e.y,h+=e.y*e.z,l+=e.z*e.z}r*=s,o*=s,a*=s,c*=s,h*=s,l*=s;const u=Bd;u[0]=r,u[1]=o,u[2]=a,u[3]=o,u[4]=c,u[5]=h,u[6]=a,u[7]=h,u[8]=l;const{unitary:d}=ld(u,vd),f=t.halfAxes.copy(d);let p=f.getColumn(0,Ad),m=f.getColumn(1,yd),g=f.getColumn(2,bd),A=-Number.MAX_VALUE,y=-Number.MAX_VALUE,b=-Number.MAX_VALUE,B=Number.MAX_VALUE,v=Number.MAX_VALUE,C=Number.MAX_VALUE;for(const t of e)md.copy(t),A=Math.max(md.dot(p),A),y=Math.max(md.dot(m),y),b=Math.max(md.dot(g),b),B=Math.min(md.dot(p),B),v=Math.min(md.dot(m),v),C=Math.min(md.dot(g),C);p=p.multiplyByScalar(.5*(B+A)),m=m.multiplyByScalar(.5*(v+y)),g=g.multiplyByScalar(.5*(C+b)),t.center.copy(p).add(m).add(g);const w=gd.set(A-B,y-v,b-C).multiplyByScalar(.5),E=new Mc([w[0],0,0,0,w[1],0,0,0,w[2]]);return t.halfAxes.multiplyRight(E),t}(n);return[...h.center,...h.halfAxes]}const kd={QUADTREE:4,OCTREE:8};function Nd(e,t,i){if(null!=e&&e.box){const n=function(e,t){const i=function(e){return e.and(e.not().add(1))}(e).shiftRightUnsigned(2);return e.add(Tu.fromNumber(2*t+1-4).multiply(i))}(Iu(e.s2VolumeInfo.token),t),s=function(e){if(e.isZero())return"X";let t=e.countTrailingZeros();t=(t-t%4)/4;const i=t;t*=4;const n=e.shiftRightUnsigned(t).toString(16).replace(/0+$/,"");return Array(17-i-n.length).join("0")+n}(n),r={...e.s2VolumeInfo};if(r.token=s,"OCTREE"===i){const t=e.s2VolumeInfo,i=t.maximumHeight-t.minimumHeight,n=i/2,s=t.minimumHeight+i/2;t.minimumHeight=s-n,t.maximumHeight=s+n}return{box:Pd(r),s2VolumeInfo:r}}}async function Ud(e){const{options:t,parentData:i={mortonIndex:0,x:0,y:0,z:0},childIndex:n=0,globalData:s={level:0,mortonIndex:0,x:0,y:0,z:0},s2VolumeBox:r}=e;let{subtree:o,level:a=0}=e;const{subdivisionScheme:c,subtreeLevels:h,maximumLevel:l,contentUrlTemplate:u,subtreesUriTemplate:d,basePath:f}=t,p={children:[],lodMetricValue:0,contentUrl:""},m=kd[c],g=1&n,A=n>>1&1,y=n>>2&1,b=(m**a-1)/(m-1);let B=Jd(i.mortonIndex,n),v=b+B,C=Jd(i.x,g),w=Jd(i.y,A),E=Jd(i.z,y),M=!1;a+1>h&&(M=Hd(o.childSubtreeAvailability,B));const T=Jd(s.x,C),x=Jd(s.y,w),I=Jd(s.z,E),R=a+s.level;if(M){const e=Vd("".concat(f,"/").concat(d),R,T,x,I);o=await is(e,eu),s.mortonIndex=B,s.x=C,s.y=w,s.z=E,s.level=a,B=0,v=0,C=0,w=0,E=0,a=0}if(!Hd(o.tileAvailability,v)||a>l)return p;Hd(o.contentAvailability,v)&&(p.contentUrl=Vd(u,R,T,x,I));const S=a+1,O={mortonIndex:B,x:C,y:w,z:E};for(let e=0;e<m;e++){const i=Nd(r,e,c),n=await Ud({subtree:o,options:t,parentData:O,childIndex:e,level:S,globalData:s,s2VolumeBox:i});if(n.contentUrl||n.children.length){const e=jd(n,R+1,{childTileX:C,childTileY:w,childTileZ:E},t,r);p.children.push(e)}}return p}function Hd(e,t){return"constant"in e?Boolean(e.constant):!!e.explicitBitstream&&function(e,t){const i=Math.floor(e/8),n=e%8;return 1==(t[i]>>n&1)}(t,e.explicitBitstream)}function jd(e,t,i,n,s){const{basePath:r,refine:o,getRefine:a,lodMetricType:c,getTileType:h,rootLodMetricValue:l,rootBoundingVolume:u}=n,d=e.contentUrl&&e.contentUrl.replace("".concat(r,"/"),""),f=l/2**t,p=function(e,t,i){if(t.region){const{childTileX:n,childTileY:s,childTileZ:r}=i,[o,a,c,h,l,u]=t.region,d=2**e,f=(c-o)/d,p=(h-a)/d,m=(u-l)/d,[g,A]=[o+f*n,o+f*(n+1)],[y,b]=[a+p*s,a+p*(s+1)],[B,v]=[l+m*r,l+m*(r+1)];return{region:[g,y,A,b,B,v]}}if(t.box)return t;throw new Error("Unsupported bounding volume type ".concat(t))}(t,null!=s&&s.box?{box:s.box}:u,i);return{children:e.children,contentUrl:e.contentUrl,content:{uri:d},id:e.contentUrl,refine:a(o),type:h(e),lodMetricType:c,lodMetricValue:f,geometricError:f,transform:e.transform,boundingVolume:p}}function Jd(e,t){return parseInt(e.toString(2)+t.toString(2),2)}function Vd(e,t,i,n,s){const r=function(e){const t={};for(const i in e)t["{".concat(i,"}")]=e[i];return t}({level:t,x:i,y:n,z:s});return e.replace(/{level}|{x}|{y}|{z}/gi,(e=>r[e]))}function zd(e){if(!e.contentUrl)return ss.EMPTY;const t=e.contentUrl.split("?")[0].split(".").pop();switch(t){case"pnts":return ss.POINTCLOUD;case"i3dm":case"b3dm":case"glb":case"gltf":return ss.SCENEGRAPH;default:return t}}function Kd(e){switch(e){case"REPLACE":case"replace":return ns.REPLACE;case"ADD":case"add":return ns.ADD;default:return e}}function Wd(e,t){if(/^[a-z][0-9a-z+.-]*:/i.test(t)){const i=new URL(e,"".concat(t,"/"));return decodeURI(i.toString())}return e.startsWith("/")?e:"".concat(t,"/").concat(e)}function Qd(e,t){if(!e)return null;if(e.content){const i=e.content.uri||e.content.url;e.contentUrl=Wd(i,t.basePath)}return e.id=e.contentUrl,e.lodMetricType=os.GEOMETRIC_ERROR,e.lodMetricValue=e.geometricError,e.transformMatrix=e.transform,e.type=zd(e),e.refine=Kd(e.refine),e}async function Xd(e,t,i,n){var s,r;const o=t.basePath,{subdivisionScheme:a,maximumLevel:c,subtreeLevels:h,subtrees:{uri:l}}=i,u=Wd(Vd(l,0,0,0,0),o),d=await is(u,eu,n),f=Wd(e.content.uri,o),p=null==t||null===(s=t.root)||void 0===s?void 0:s.refine,m=e.geometricError,g=null===(r=e.boundingVolume.extensions)||void 0===r?void 0:r["3DTILES_bounding_volume_S2"];if(g){const t={box:Pd(g),s2VolumeInfo:g};e.boundingVolume=t}const A=e.boundingVolume,y={contentUrlTemplate:f,subtreesUriTemplate:l,subdivisionScheme:a,subtreeLevels:h,maximumLevel:c,refine:p,basePath:o,lodMetricType:os.GEOMETRIC_ERROR,rootLodMetricValue:m,rootBoundingVolume:A,getTileType:zd,getRefine:Kd};return await async function(e,t,i){if(!e)return null;e.lodMetricType=os.GEOMETRIC_ERROR,e.lodMetricValue=e.geometricError,e.transformMatrix=e.transform;const{children:n,contentUrl:s}=await Ud({subtree:t,options:i,s2VolumeBox:e});s&&(e.contentUrl=s,e.content={uri:s.replace("".concat(i.basePath,"/"),"")});return e.refine=Kd(e.refine),e.type=zd(e),e.children=n,e.id=e.contentUrl,e}(e,d,y)}function Yd(e){var t;return(null==e||null===(t=e.extensions)||void 0===t?void 0:t["3DTILES_implicit_tiling"])||(null==e?void 0:e.implicitTiling)}const qd={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:as,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:async function(e,t,i){const n=t["3d-tiles"]||{};let s;s="auto"===n.isTileset?i.url&&-1!==i.url.indexOf(".json"):n.isTileset;e=s?await async function(e,t,i){var n;const s=JSON.parse((new TextDecoder).decode(e));return s.loader=t.loader||qd,s.url=i.url,s.queryString=i.queryString,s.basePath=function(e){return jn(e.url)}(s),s.root=await async function(e,t){const i=e.basePath;let n;const s=Yd(null==e?void 0:e.root);n=s&&e.root?await Xd(e.root,e,s,t):Qd(e.root,e);const r=[];for(r.push(n);r.length>0;){const n=(r.pop()||{}).children||[];for(let s of n){const n=Yd(s);n?s=await Xd(s,e,n,t):Qd(s,{basePath:i}),r.push(s)}}return n}(s,t),s.type=rs.TILES3D,s.lodMetricType=os.GEOMETRIC_ERROR,s.lodMetricValue=(null===(n=s.root)||void 0===n?void 0:n.lodMetricValue)||0,s}(e,t,i):await async function(e,t,i){const n={content:{featureIds:null}},s=0;return await ql(e,s,t,i,n.content),n.content}(e,t,i);return e},options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};var Zd=function(e,t,i,n){return new(i||(i=Promise))((function(s,r){function o(e){try{c(n.next(e))}catch(e){r(e)}}function a(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};class $d{}$d.sl="https://www.wodashijie.com/editor-api/",$d.rl="https://models.wodashijie.com/",$d.App=class{constructor(e){this.isDefaultMutual=!1,e.sl&&(ef.sl=e.sl),e.rl&&(ef.rl=e.rl),xt.defaults.baseURL=ef.sl,xt.defaults.baseURL,this.canvas=document.createElement("canvas"),this.canvas.style.cssText="position: absolute;left: 0;right: 0;top: 0;bottom: 0;width: 100%;height: 100%;background-color: transparent;outline-width: 0;-webkit-tap-highlight-color:transparent;z-index: 2;",e.container.appendChild(this.canvas),this.engine=new d.Engine(this.canvas,!0,{premultipliedAlpha:!0,preserveDrawingBuffer:!0,stencil:!0,doNotHandleContextLost:!1}),this.engine.setHardwareScalingLevel(.5),this.scene=new d.Scene(this.engine,{useGeometryUniqueIdsMap:!0,useClonedMeshMap:!0,useMaterialMeshMap:!0}),this.scene.useRightHandedSystem=!0,this.scene.getBoundingBoxRenderer().frontColor=d.Color3.Green(),this.scene.getBoundingBoxRenderer().showBackLines=!1,this.camera=new g(this),this.highlightLayer=new d.HighlightLayer("highlightLayer",this.scene),this.iEvent=new f(this),this.container=d.AdvancedDynamicTexture.CreateFullscreenUI("screenUI"),this.toolTips=new E(this),this.environment=new M(this),this.environment.defaultLights(),this.environment.openAllLight(),this.resources=new j(this),this.project=new U(this);let t=new d.UtilityLayerRenderer(this.scene);this.positionGizmo=new d.PositionGizmo(t),O.init(),this.engine.runRenderLoop((()=>{this.fps&&(this.fps.innerText=this.engine.getFps().toFixed()+" fps"),this.scene.render(),d.TWEEN.update(),this.iEvent&&this.iEvent.runRender()})),window.addEventListener("resize",(()=>{this.engine.resize()})),this.scene.onPointerObservable.add((e=>{this.iEvent&&this.iEvent.onPointer(e)})),this.scene.onKeyboardObservable.add((e=>{this.iEvent&&this.iEvent.onKeyboard(e)})),this.scene.registerAfterRender((()=>{this.iEvent&&this.iEvent.registerAfterRender()}))}load(e){return kt(this,void 0,void 0,(function*(){e.pk=null==e.pk?"project":e.pk,e.isDefaultLevel=null==e.isDefaultLevel||e.isDefaultLevel,e.isDefaultMutual=null==e.isDefaultMutual||e.isDefaultMutual,ef.pk=e.pk;let t=yield xt.get(`api/service/GetToken?accessToken=${ef.accessToken}`);if(200!=t.status)return;localStorage.setItem("mx3d-token",t.data);let i=yield xt.get("api/service");if(200!=i.status)return;localStorage.setItem("mx3d-long",i.data);let n=yield xt.get(`api/service/${ef.pk}`);if(200!=n.status)return;let s=JSON.parse(St.de(n.data));return new Promise(((t,i)=>kt(this,void 0,void 0,(function*(){try{(new Date).toLocaleString(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let i=new A,n=!1;if(s.modelLists){for(let e=0;e<s.modelLists.length;e++)i.add(s.modelLists[e].modelId,s.modelLists[e]);n=!0}let r=new A;for(let e=0;e<s.objectDatas.length;e++){let t,o=s.objectDatas[e];o.baseModel&&n&&(o.baseModel=i.find(o.baseModel)),o.baseModel&&!i.find(o.baseModel.modelId)&&i.add(o.baseModel.modelId,o.baseModel),o.objectType!=T.Corner&&o.objectType!=T.Floor&&(o.objectType!=T.Wall?(o.objectType==T.Window?t=new P(this):o.objectType==T.Door?t=new L(this):o.objectType==T.Campus?(t=new Gt(this),r.add(o.id,new Array)):o.objectType==T.Storey?(t=new k(this),r.add(o.id,new Array)):t=o.objectType==T.LeakWater?new Ot(this):o.objectType==T.Conduit?new Dt(this):o.objectType==T.UI3D?new Ft(this):o.objectType==T.Cabinet?new Pt(this):o.objectType==T.VirtualBox?new _t(this):o.objectType==T.Building?new N(this):new D(this),t.loadProperties(o),this.project.objectDatas.add(t.id,t)):(o.leftMap&&n&&(o.leftMap=i.find(o.leftMap)),o.rightMap&&n&&(o.rightMap=i.find(o.rightMap))))}for(let e=0;e<s.objectDatas.length;e++){let t=s.objectDatas[e];if(t.objectType==T.Corner||t.objectType==T.Wall||t.objectType==T.Floor){r.find(t.parentId).push(t)}}let o=0,a=i.count();for(const t in i.map){let n=i.find(t);".gltf"!=n.extension&&".glb"!=n.extension||(yield this.resources.loadModelMesh(n)),o++,e&&e.progress&&e.progress(o/a*.3)}o=0,i=null,a=this.project.objectDatas.count();for(const t in this.project.objectDatas.map){let i=this.project.objectDatas.find(t);yield i.bind(),o++,e&&e.progress&&e.progress(.3+o/a*.5)}o=0,a=r.count();let c=!1;for(const t in r.map){o++,e&&e.progress&&e.progress(.8+o/a*.2);let i=this.project.objectDatas.find(t);i&&i instanceof G?i.load(c,r.find(t)):console.error("出现错误,场景不存在或未创建成功",t,i)}this.project.root=this.project.objectDatas.find(s.id),this.project.optimization(),e.isDefaultMutual&&(this.defaultMutual=!0),e.isDefaultLevel&&this.project.switchLevel(null,!0),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1,(new Date).toLocaleString(),t(null),this.engine.resize(),e&&e.complete&&e.complete()}catch(t){i(t),e&&e.onError&&e.onError(t)}}))))}))}set defaultMutual(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.isDefaultMutual=e;for(let e in this.project.objectDatas.map){let t=this.project.objectDatas.find(e);t instanceof N&&(this.project.getChildsById(t.id).length<1||(this.isDefaultMutual?t.addEventListener(x.leftClick,(()=>this.project.switchLevel(t.id))):t.removeEventListener(x.leftClick)))}this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}dispose(){this.environment.hideFps(),this.project.clear(),this.resources.delete(),this.engine.dispose()}},$d.Request=xt,$d.AlarmFlashing=O,$d.UI=class{static createIconFromMesh(e,t,i,n){let s=t.Sight.focus.clone(),r=t.instance.getBoundingInfo();return s.y+=(r.boundingBox.maximum.y-r.boundingBox.minimum.y)/2,new Kt(e,s,i,n,t.app.scene)}static createIcon(e,t,i,n){let s;t.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,s=new Jt(e,t.app.scene),s.size=i,s.height=n,s.pint=new d.Mesh(e+"_pint");let r=t.Sight.focus.clone();return s.pint.position=r,s.pint.position.y+=n,s.rect=new d.Rectangle,s.rect.isPointerBlocker=!1,s.rect.width=i.width+"px",s.rect.height=i.height+"px",s.rect.thickness=0,t.app.container.addControl(s.rect),s.rect.linkWithMesh(s.pint),t.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,s}},$d.Builder=class{static createMatrixCloud(e){let t;if(e.displayValues=null!=e.displayValues&&e.displayValues,e.isAlpha=null==e.isAlpha||e.isAlpha,e.isParticle=null!=e.isParticle&&e.isParticle,e.height=e.height||.5,e.radius=e.radius||2.8,e.isLevelRender=null==e.isLevelRender||e.isLevelRender,e.range=e.range||{max:30,min:16},!(e.value||e.value.maxX||e.value.maxY||e.value.data||e.anchor))return t;e.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,t=new Ut(e.anchor);let i=e.anchor.instance.getBoundingInfo();t.mesh=e.anchor.instance.clone(t.id),t.mesh.position.y+=e.height;let n=i.maximum.x-i.minimum.x,s=n/(2*e.value.maxX),r=i.maximum.z-i.minimum.z,o=r/(2*e.value.maxY),a=new Array;for(let c=0;c<2*e.value.maxX;c++)for(let h=0;h<2*e.value.maxY;h++){let l={x:c,y:h,value:e.range.min};for(let a=0;a<e.value.data.length;a++){const u=e.value.data[a];if(2*u.x+1==c&&2*u.y+1==h){l.value=u.value;let a=new d.Vector3(i.boundingSphere.center.x-(n/2-s*c),t.mesh.position.y,i.boundingSphere.center.z-(r/2-o*h));t.texts.push(this.createTempVlaue(l.value+"℃",a,e.anchor.app.scene,e.anchor.app.container))}}a.push(l)}t.displayValues=e.displayValues;let c=d.h337.create({width:2*e.value.maxX,height:2*e.value.maxY,radius:e.radius});c.setData({min:e.range.min,max:e.range.max,data:a});let h=new d.StandardMaterial(t.id,e.anchor.app.scene);return h.diffuseTexture=new d.Texture(c.getDataURL(),e.anchor.app.scene,!1,!1),h.specularColor=new d.Color3(0,0,0),h.alpha=.5,e.isAlpha&&(h.diffuseTexture.hasAlpha=!0),e.isLevelRender&&(t.mesh.renderingGroupId=1),t.mesh.material=h,t.mesh.alwaysSelectAsActiveMesh=!0,t.mesh.freezeWorldMatrix(),e.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,t}static _getMatrixParticleTex(e,t,i,n,s,r){let o,a=t.clone(),c=n.getBoundingInfo().boundingBox;let h=(c.extendSizeWorld.x+c.extendSizeWorld.z)/9,l=1500*h*h;c.minimumWorld.subtract(new d.Vector3(-0,0,-0)),c.maximumWorld.subtract(new d.Vector3(0,0,0));o&&o.dispose(),d.GPUParticleSystem.IsSupported&&(o=new d.GPUParticleSystem("particles",{capacity:l},s),o.activeParticleCount=l,o.manualEmitCount=o.activeParticleCount,o.minEmitBox=c.minimumWorld,o.maxEmitBox=c.maximumWorld),o.particleTexture=a,o.emitter=n,r&&(o.renderingGroupId=1),o.isLocal=!0;let u=new d.NodeMaterial("nm_heatmapBox_"+n.id,s);return u.loadAsync(e+"resources/horizontalNodeMat.json").then((()=>{u.build(!1),u.getBlockByName("boxTex").texture=i,u.getBlockByName("emitXMin").value=o.minEmitBox.x,u.getBlockByName("emitXMax").value=o.maxEmitBox.x,u.getBlockByName("emitYMin").value=o.minEmitBox.z,u.getBlockByName("emitYMax").value=o.maxEmitBox.z,u.createEffectForParticles(o)})),n.onDispose=()=>{o&&o.dispose()},o.onDispose=()=>{u&&u.dispose(),a&&a.dispose()},o.color1=new d.Color4(.8,.8,.8,.1),o.color2=new d.Color4(.95,.95,.95,.15),o.colorDead=new d.Color4(.9,.9,.9,.1),o.minSize=1.4,o.maxSize=2,o.minLifeTime=Number.MAX_SAFE_INTEGER,o.emitRate=5e4*h,o.blendMode=d.ParticleSystem.BLENDMODE_STANDARD,o.gravity=new d.Vector3(0,0,0),o.direction1=new d.Vector3(0,0,0),o.direction2=new d.Vector3(0,0,0),o.minAngularSpeed=-2,o.maxAngularSpeed=2,o.minEmitPower=.5,o.maxEmitPower=1,o.updateSpeed=.005,o.start(),o}static createPunctateCloud(e){if(e.displayValues=null!=e.displayValues&&e.displayValues,e.isAlpha=null==e.isAlpha||e.isAlpha,e.isParticle=null!=e.isParticle&&e.isParticle,e.radius=e.radius||1,e.isLevelRender=null==e.isLevelRender||e.isLevelRender,e.range=e.range||{max:30,min:16},!e.value&&!e.anchor)return console.error("要创建的云图数值为空!"),null;let t;e.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,t=new Ut(e.anchor),t.mesh=d.MeshBuilder.CreateDisc(t.id,{radius:1,sideOrientation:2},e.anchor.app.scene),t.mesh.scaling=new d.Vector3(e.radius,e.radius,e.radius),t.mesh.alwaysSelectAsActiveMesh=!0,t.mesh.enablePointerMoveEvents=!1,t.mesh.isPickable=!1,t.mesh.position=e.anchor.instance.position.clone(),t.mesh.rotation.x=Math.PI/2;let i=[];for(let t=0;t<6;t++)for(let n=0;n<6;n++){let s={x:t,y:n,value:e.range.min};s.value=2==t&&2==n||3==t&&2==n||2==t&&3==n||3==t&&3==n?e.value:e.value-2*(Math.abs(2-t)+Math.abs(2-n)),i.push(s)}t.displayValues=e.displayValues;let n=d.h337.create({width:5,height:5,radius:2});n.setData({min:e.range.min,max:e.range.max,data:i});let s=new d.StandardMaterial(t.id,e.anchor.app.scene);return s.diffuseTexture=new d.Texture(n.getDataURL(),e.anchor.app.scene,!1,!1),s.specularColor=new d.Color3(0,0,0),s.alpha=.5,e.isAlpha&&(s.diffuseTexture.hasAlpha=!0),e.isLevelRender&&(t.mesh.renderingGroupId=1),t.mesh.material=s,t.mesh.alwaysSelectAsActiveMesh=!0,t.mesh.freezeWorldMatrix(),e.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,t}static createColumnCloud(e){if(e.displayValues=null!=e.displayValues&&e.displayValues,e.isAlpha=null==e.isAlpha||e.isAlpha,e.isParticle=null!=e.isParticle&&e.isParticle,e.radius=e.radius||4,e.isLevelRender=null==e.isLevelRender||e.isLevelRender,e.range=e.range||{max:30,min:16},!e.data&&e.data.length<1&&!e.anchor)return console.error("要创建的云图数值为空!"),null;let t;e.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,t=new Ut(e.anchor);let i=.98*e.anchor.instance.scaling.y;t.mesh=d.MeshBuilder.CreatePlane(t.id,{width:.98*e.anchor.instance.scaling.x,height:i,sideOrientation:2},e.anchor.app.scene),t.mesh.alwaysSelectAsActiveMesh=!0,t.mesh.enablePointerMoveEvents=!1,t.mesh.isPickable=!1,t.mesh.position=e.anchor.instance.position.clone(),t.mesh.rotation.z=Math.PI,t.mesh.rotation.y=e.anchor.instance.rotation.y,e.isLevelRender&&(t.mesh.renderingGroupId=1);let n=[];for(let t=0;t<4;t++)for(let i=0;i<3*e.data.length;i++){let s={x:t,y:i,value:e.range.min};for(let n=0;n<e.data.length;n++){const r=e.data[n];2==t&&3*n+2==i&&(s.value=r.value)}n.push(s)}let s=i/e.data.length;for(let n=0;n<e.data.length;n++){let r=t.mesh.position.clone();r.y=r.y-i/2+(i-s*n-s/2),t.texts.push(this.createTempVlaue(e.data[n].value+"℃",r,e.anchor.app.scene,t.anchor.app.container))}t.displayValues=e.displayValues;let r=d.h337.create({width:4,height:3*e.data.length,radius:e.radius});r.setData({min:e.range.min,max:e.range.max,data:n});let o=new d.StandardMaterial(t.id,e.anchor.app.scene);return o.diffuseTexture=new d.Texture(r.getDataURL(),e.anchor.app.scene,!1,!1),o.specularColor=new d.Color3(0,0,0),o.alpha=.5,e.isAlpha&&(o.diffuseTexture.hasAlpha=!0),t.mesh.material=o,t.mesh.alwaysSelectAsActiveMesh=!0,t.mesh.freezeWorldMatrix(),e.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,t}static _getColumnarParticleTex(e,t,i,n,s){let r,o=n.clone(),a=t.getBoundingInfo().boundingBox;a.extendSizeWorld.x,a.extendSizeWorld.z;d.Effect.ShadersStore.particlesVertexShader="\n precision highp float;\n in vec3 position;\n in vec4 color;\n in float angle;\n in vec2 size;\n in vec2 offset;\n uniform mat4 view;\n uniform mat4 projection;\n uniform vec2 translationPivot;\n out vec2 vUV;\n out vec4 vColor;\n out vec3 vPositionW;\n out vec3 vPosition;\n uniform mat4 invView;\n uniform vec3 eyePosition;\n\n vec3 rotate(vec3 yaxis,vec3 rotatedCorner) {\n vec3 xaxis=normalize(cross(vec3(0.,1.0,0.),yaxis));\n vec3 zaxis=normalize(cross(yaxis,xaxis));\n vec3 row0=vec3(xaxis.x,xaxis.y,xaxis.z);\n vec3 row1=vec3(yaxis.x,yaxis.y,yaxis.z);\n vec3 row2=vec3(zaxis.x,zaxis.y,zaxis.z);\n mat3 rotMatrix=mat3(row0,row1,row2);\n vec3 alignedCorner=rotMatrix*rotatedCorner;\n return position+alignedCorner;\n }\n\n void main(void) {\n vec2 cornerPos;\n cornerPos=(vec2(offset.x-0.5,offset.y-0.5)-translationPivot)*size+translationPivot;\n vec3 rotatedCorner;\n rotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\n rotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\n rotatedCorner.z=0.;\n vec3 viewPos=(view*vec4(position,1.0)).xyz+rotatedCorner;\n vPositionW=(invView*vec4(viewPos,1)).xyz;\n vPosition = position;\n gl_Position=projection*vec4(viewPos,1.0);\n vColor=color;\n vUV=offset;\n }\n \n ",d.Effect.ShadersStore[t.id+"myParticleFragmentShader"]="\n #ifdef GL_ES\n precision highp float;\n #endif\n\n attribute vec3 position;\n\n varying vec2 vUV; // Provided by Runtime.js\n varying vec4 vColor; // Provided by Runtime.js\n\n varying vec3 vPosition;\n\n uniform sampler2D diffuseSampler; // Provided by Runtime.js\n uniform float time; // This one is custom so we need to declare it to the effect\n\n uniform float u_emitXMin;\n uniform float u_emitXMax;\n uniform float u_emitYMin;\n uniform float u_emitYMax;\n\n uniform sampler2D boxTexSampler;\n\n uniform mat4 emitBox_WorldM;\n\n\n void main(void) {\n vec4 position = inverse(emitBox_WorldM) * vec4(vPosition, 1.0);\n\n float x = position.x;\n float z = position.y;\n float output0 = 0.0 + (x - u_emitXMin) * (1.0 - 0.0) / (u_emitXMax - u_emitXMin);\n float output1 = 0.0 + (z - u_emitYMin) * (1.0 - 0.0) / (u_emitYMax - u_emitYMin);\n vec2 xy = vec2(output0, output1);\n vec4 baseTex = texture2D(boxTexSampler, xy);\n\n vec4 baseColor = texture2D(diffuseSampler, vUV);\n\n vec4 resAlpha = baseColor * vColor ;\n\n gl_FragColor = vec4(baseTex.xyz, resAlpha.a);\n }\n ";var c=i.getEngine().createEffectForParticles(t.id+"myParticle",["time","u_emitXMin","u_emitYMin","u_emitXMax","u_emitYMax","emitBox_WorldM"],["boxTexSampler"],"");return t.onAfterWorldMatrixUpdateObservable.add((()=>{})),c.onCompileObservable.add((()=>{c.setMatrix("emitBox_WorldM",t.getWorldMatrix()),c.setFloat("u_emitXMin",r.minEmitBox.x),c.setFloat("u_emitYMin",r.minEmitBox.y),c.setFloat("u_emitXMax",r.maxEmitBox.x),c.setFloat("u_emitYMax",r.maxEmitBox.y)})),c.onBind=function(){c.setTexture("boxTexSampler",e)},r&&r.dispose(),d.GPUParticleSystem.IsSupported&&(r=new d.ParticleSystem("particles",200,i,c),r.manualEmitCount=r.getCapacity(),r.minEmitBox=a.minimum,r.maxEmitBox=a.maximum),t.onDispose=()=>{r&&r.dispose()},r.onDispose=()=>{o&&o.dispose()},r.particleTexture=o.clone(),r.emitter=t,s&&(r.renderingGroupId=1),r.isLocal=!0,r.color1=new d.Color4(.8,.8,.8,.1),r.color2=new d.Color4(.95,.95,.95,.15),r.colorDead=new d.Color4(.9,.9,.9,.1),r.minSize=.7,r.maxSize=1,r.minLifeTime=Number.MAX_SAFE_INTEGER,r.emitRate=50,r.blendMode=d.ParticleSystem.BLENDMODE_STANDARD,r.gravity=new d.Vector3(0,0,0),r.direction1=new d.Vector3(0,0,0),r.direction2=new d.Vector3(0,0,0),r.minAngularSpeed=-2,r.maxAngularSpeed=2,r.minEmitPower=.5,r.maxEmitPower=1,r.updateSpeed=.005,r.start(),r}static createTempVlaue(e,t,i,n){let s=new d.Mesh("temp_"+y.getGUID(12),i);s.position=t;let r=new d.TextBlock;return r.isPointerBlocker=!1,r.text="默认提示",r.color="white",r.resizeToFit=!0,r.fontSize="20px",r.text=e,n.addControl(r),r.linkWithMesh(s),r}static createCapacity(e,t,i,n="200px"){let s=new Nt(e,t);s.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let r=s.anchor.instance.scaling.clone();s.mesh=d.MeshBuilder.CreateBox("RATIO_"+s.anchor.id,{width:r.x,height:r.y,depth:r.z}),s.mesh.position=s.anchor.instance.position.clone(),s.mesh.scaling.x=.98,s.mesh.scaling.z=.98,s.mesh.rotation=s.anchor.instance.rotation.clone(),s.mesh.alwaysSelectAsActiveMesh=!0,s.mesh.visibility=1;let o=t<.25?d.Color3.Blue():t>=.25&&t<.5?d.Color3.Green():t>=.5&&t<.75?d.Color3.Yellow():d.Color3.Red();s.color=o.toHexString(),t*=s.mesh.scaling.y;var a=new d.Vector3(0,-r.y/2,0);s.mesh.setPivotPoint(a);let c=new d.StandardMaterial(s.mesh.id,s.anchor.instance._scene);return c.diffuseColor=o,s.mesh.material=c,d.Animation.CreateAndStartAnimation(s.mesh.id,s.mesh,"scaling.y",15,30,.02,t,0,null),s.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,i&&(s.textMesh=this.createTextMesh(e,i,r.y*t,n,"#fff")),s}static createTextMesh(e,t,i,n="200px",s="white"){e.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let r=d.Mesh.CreatePlane("text_"+e.id,e.instance.scaling.x,e.app.scene,!0,d.Mesh.DOUBLESIDE);r.alwaysSelectAsActiveMesh=!0,r.position=e.instance.position.clone(),r.position.y=i+.05,r.rotation.y=Math.PI-e.instance.rotation.y,r.rotation.x=-Math.PI/2;let o=new d.StandardMaterial("text_mat_"+e.id,e.app.scene);o.diffuseColor=d.Color3.White(),o.emissiveColor=d.Color3.White();let a=new d.DynamicTexture("text_tex_"+e.id,{width:1e3*e.instance.scaling.x,height:500*e.instance.scaling.x},e.app.scene,!1);return a.hasAlpha=!0,o.diffuseTexture=a,o.opacityTexture=a,a.drawText(t,1e3*e.instance.scaling.x/4,500*e.instance.scaling.x/2,"bold "+n+" NexaBold",s,"",!0,!0),a.update(),r.material=o,e.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,r}static create2DLine(e,t,i){if(t.length<2)return void console.error("要连线的对象不能少于2个。");let n=new jt;return n.id=e,n.objs=t,i&&i.width&&(n.width=i.width),i&&i.color&&(n.color=i.color),i&&i.isDotted&&(n.isDotted=i.isDotted),n.update(),n}static create3DLine(e,t,i){if(t.length<2)return void console.error("要连线的对象不能少于2个。");let n=new Ht;return n.id=e,n.objs=t,i&&i.width&&(n.width=i.width),i&&i.color&&(n.color=i.color),n.update(),n}},$d.EffectType=Vt,$d.EventType=x,$d.StatusType=I,$d.Effect=$t,$d.TileLoader=class{constructor(e){this.app=e}load(e){return Zd(this,void 0,void 0,(function*(){const t=yield is(e,qd),i=new d.Mesh("tileset",this.app.scene);t.data;const n=t.data.attributes.POSITION.value,s=t.data.indices.value,r=new d.VertexData;r.positions=n,r.indices=s,r.applyToMesh(i);let o=new d.StandardMaterial("tilesetMaterial",this.app.scene);o.diffuseColor=new d.Color3(1,0,0),i.material=o}))}};const ef=$d})(),s=s.default})()));
|