@realsee/five 6.2.0-alpha.3 → 6.2.0-alpha.4
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/five/index.js +64 -64
- package/five/index.mjs +1181 -1181
- package/gltf-loader/index.js +2 -2
- package/gltf-loader/index.mjs +2 -2
- package/line/index.js +2 -2
- package/line/index.mjs +2 -2
- package/package.json +1 -1
- package/plugins/index.js +1 -1
- package/plugins/index.mjs +1 -1
- package/react/index.js +1 -1
- package/react/index.mjs +1 -1
- package/sticker/index.js +2 -2
- package/sticker/index.mjs +2 -2
- package/umd/five-gltf-loader.js +2 -2
- package/umd/five-line.js +2 -2
- package/umd/five-plugins.js +1 -1
- package/umd/five-react.js +1 -1
- package/umd/five-sticker.js +2 -2
- package/umd/five-vfx.js +1 -1
- package/umd/five-vue.js +1 -1
- package/umd/five.js +24 -24
- package/vfx/index.js +1 -1
- package/vfx/index.mjs +1 -1
- package/vue/index.js +1 -1
- package/vue/index.mjs +1 -1
package/five/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five
|
|
4
4
|
* Generated: 8/30/2024
|
|
5
|
-
* Version: 6.2.0-alpha.
|
|
5
|
+
* Version: 6.2.0-alpha.4
|
|
6
6
|
* Terms:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
* Update: July 28, 2021
|
|
@@ -252,7 +252,7 @@
|
|
|
252
252
|
* No amendment to or modification of this Agreement will be binding unless in
|
|
253
253
|
* writing and signed by Realsee. You and Realsee hereto confirm that this
|
|
254
254
|
* Agreement and all related documents shall be drafted in English.
|
|
255
|
-
*/"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Dn=require("three"),
|
|
255
|
+
*/"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Dn=require("three"),zu=require("protobufjs/minimal");function t0(n){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const e in n)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(t,e,r.get?r:{enumerable:!0,get:()=>n[e]})}}return t.default=n,Object.freeze(t)}const c=t0(Dn),qr=t0(zu);var Io=Number(c.REVISION);if(Io<115||Io>117)throw new Error('"Five" needs "THREE.js" version between 125 - 117.');/**
|
|
256
256
|
* @license
|
|
257
257
|
* The 'jsrsasign'(RSA-Sign JavaScript Library) License
|
|
258
258
|
*
|
|
@@ -340,11 +340,11 @@
|
|
|
340
340
|
* https://code.google.com/p/crypto-js/wiki/License
|
|
341
341
|
* PART: ext/cryptojs
|
|
342
342
|
*/var re={},we=we||function(n,t){var e={},r=e.lib={},i=r.Base=function(){function A(){}return{extend:function(m){A.prototype=this;var h=new A;return m&&h.mixIn(m),h.hasOwnProperty("init")||(h.init=function(){h.$super.init.apply(this,arguments)}),h.init.prototype=h,h.$super=this,h},create:function(){var m=this.extend();return m.init.apply(m,arguments),m},init:function(){},mixIn:function(m){for(var h in m)m.hasOwnProperty(h)&&(this[h]=m[h]);m.hasOwnProperty("toString")&&(this.toString=m.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),a=r.WordArray=i.extend({init:function(A,m){A=this.words=A||[],m!=t?this.sigBytes=m:this.sigBytes=A.length*4},toString:function(A){return(A||s).stringify(this)},concat:function(A){var m=this.words,h=A.words,v=this.sigBytes,y=A.sigBytes;if(this.clamp(),v%4)for(var p=0;p<y;p++){var g=h[p>>>2]>>>24-p%4*8&255;m[v+p>>>2]|=g<<24-(v+p)%4*8}else for(var p=0;p<y;p+=4)m[v+p>>>2]=h[p>>>2];return this.sigBytes+=y,this},clamp:function(){var A=this.words,m=this.sigBytes;A[m>>>2]&=4294967295<<32-m%4*8,A.length=n.ceil(m/4)},clone:function(){var A=i.clone.call(this);return A.words=this.words.slice(0),A},random:function(A){for(var m=[],h=0;h<A;h+=4)m.push(n.random()*4294967296|0);return new a.init(m,A)}}),o=e.enc={},s=o.Hex={stringify:function(A){for(var m=A.words,h=A.sigBytes,v=[],y=0;y<h;y++){var p=m[y>>>2]>>>24-y%4*8&255;v.push((p>>>4).toString(16)),v.push((p&15).toString(16))}return v.join("")},parse:function(A){for(var m=A.length,h=[],v=0;v<m;v+=2)h[v>>>3]|=parseInt(A.substr(v,2),16)<<24-v%8*4;return new a.init(h,m/2)}},l=o.Latin1={stringify:function(A){for(var m=A.words,h=A.sigBytes,v=[],y=0;y<h;y++){var p=m[y>>>2]>>>24-y%4*8&255;v.push(String.fromCharCode(p))}return v.join("")},parse:function(A){for(var m=A.length,h=[],v=0;v<m;v++)h[v>>>2]|=(A.charCodeAt(v)&255)<<24-v%4*8;return new a.init(h,m)}},u=o.Utf8={stringify:function(A){try{return decodeURIComponent(escape(l.stringify(A)))}catch(m){throw new Error("Malformed UTF-8 data")}},parse:function(A){return l.parse(unescape(encodeURIComponent(A)))}},d=r.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(A){typeof A=="string"&&(A=u.parse(A)),this._data.concat(A),this._nDataBytes+=A.sigBytes},_process:function(A){var m=this._data,h=m.words,v=m.sigBytes,y=this.blockSize,p=y*4,g=v/p;A?g=n.ceil(g):g=n.max((g|0)-this._minBufferSize,0);var x=g*y,b=n.min(x*4,v);if(x){for(var w=0;w<x;w+=y)this._doProcessBlock(h,w);var E=h.splice(0,x);m.sigBytes-=b}return new a.init(E,b)},clone:function(){var A=i.clone.call(this);return A._data=this._data.clone(),A},_minBufferSize:0});r.Hasher=d.extend({cfg:i.extend(),init:function(A){this.cfg=this.cfg.extend(A),this.reset()},reset:function(){d.reset.call(this),this._doReset()},update:function(A){return this._append(A),this._process(),this},finalize:function(A){A&&this._append(A);var m=this._doFinalize();return m},blockSize:512/32,_createHelper:function(A){return function(m,h){return new A.init(h).finalize(m)}},_createHmacHelper:function(A){return function(m,h){return new f.HMAC.init(A,h).finalize(m)}}});var f=e.algo={};return e}(Math);(function(n){for(var t=we,m=t.lib,e=m.WordArray,r=m.Hasher,m=t.algo,i=[],a=[],o=function(v){return 4294967296*(v-(v|0))|0},s=2,l=0;64>l;){var u;e:{u=s;for(var d=n.sqrt(u),f=2;f<=d;f++)if(!(u%f)){u=!1;break e}u=!0}u&&(8>l&&(i[l]=o(n.pow(s,.5))),a[l]=o(n.pow(s,1/3)),l++),s++}var A=[],m=m.SHA256=r.extend({_doReset:function(){this._hash=new e.init(i.slice(0))},_doProcessBlock:function(h,v){for(var y=this._hash.words,p=y[0],g=y[1],x=y[2],b=y[3],w=y[4],E=y[5],M=y[6],C=y[7],P=0;64>P;P++){if(16>P)A[P]=h[v+P]|0;else{var S=A[P-15],T=A[P-2];A[P]=((S<<25|S>>>7)^(S<<14|S>>>18)^S>>>3)+A[P-7]+((T<<15|T>>>17)^(T<<13|T>>>19)^T>>>10)+A[P-16]}S=C+((w<<26|w>>>6)^(w<<21|w>>>11)^(w<<7|w>>>25))+(w&E^~w&M)+a[P]+A[P],T=((p<<30|p>>>2)^(p<<19|p>>>13)^(p<<10|p>>>22))+(p&g^p&x^g&x),C=M,M=E,E=w,w=b+S|0,b=x,x=g,g=p,p=S+T|0}y[0]=y[0]+p|0,y[1]=y[1]+g|0,y[2]=y[2]+x|0,y[3]=y[3]+b|0,y[4]=y[4]+w|0,y[5]=y[5]+E|0,y[6]=y[6]+M|0,y[7]=y[7]+C|0},_doFinalize:function(){var h=this._data,v=h.words,y=8*this._nDataBytes,p=8*h.sigBytes;return v[p>>>5]|=128<<24-p%32,v[(p+64>>>9<<4)+14]=n.floor(y/4294967296),v[(p+64>>>9<<4)+15]=y,h.sigBytes=4*v.length,this._process(),this._hash},clone:function(){var h=r.clone.call(this);return h._hash=this._hash.clone(),h}});t.SHA256=r._createHelper(m),t.HmacSHA256=r._createHmacHelper(m)})(Math);we.lib.Cipher||function(n){var m=we,t=m.lib,e=t.Base,r=t.WordArray,i=t.BufferedBlockAlgorithm,a=m.enc.Base64,o=m.algo.EvpKDF,s=t.Cipher=i.extend({cfg:e.extend(),createEncryptor:function(v,y){return this.create(this._ENC_XFORM_MODE,v,y)},createDecryptor:function(v,y){return this.create(this._DEC_XFORM_MODE,v,y)},init:function(v,y,p){this.cfg=this.cfg.extend(p),this._xformMode=v,this._key=y,this.reset()},reset:function(){i.reset.call(this),this._doReset()},process:function(v){return this._append(v),this._process()},finalize:function(v){return v&&this._append(v),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(v){return{encrypt:function(y,p,g){return(typeof p=="string"?h:A).encrypt(v,y,p,g)},decrypt:function(y,p,g){return(typeof p=="string"?h:A).decrypt(v,y,p,g)}}}});t.StreamCipher=s.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var f=m.mode={},l=function(v,y,p){var g=this._iv;g?this._iv=n:g=this._prevBlock;for(var x=0;x<p;x++)v[y+x]^=g[x]},u=(t.BlockCipherMode=e.extend({createEncryptor:function(v,y){return this.Encryptor.create(v,y)},createDecryptor:function(v,y){return this.Decryptor.create(v,y)},init:function(v,y){this._cipher=v,this._iv=y}})).extend();u.Encryptor=u.extend({processBlock:function(v,y){var p=this._cipher,g=p.blockSize;l.call(this,v,y,g),p.encryptBlock(v,y),this._prevBlock=v.slice(y,y+g)}}),u.Decryptor=u.extend({processBlock:function(v,y){var p=this._cipher,g=p.blockSize,x=v.slice(y,y+g);p.decryptBlock(v,y),l.call(this,v,y,g),this._prevBlock=x}}),f=f.CBC=u,u=(m.pad={}).Pkcs7={pad:function(v,y){for(var p=4*y,p=p-v.sigBytes%p,g=p<<24|p<<16|p<<8|p,x=[],b=0;b<p;b+=4)x.push(g);p=r.create(x,p),v.concat(p)},unpad:function(v){v.sigBytes-=v.words[v.sigBytes-1>>>2]&255}},t.BlockCipher=s.extend({cfg:s.cfg.extend({mode:f,padding:u}),reset:function(){s.reset.call(this);var y=this.cfg,v=y.iv,y=y.mode;if(this._xformMode==this._ENC_XFORM_MODE)var p=y.createEncryptor;else p=y.createDecryptor,this._minBufferSize=1;this._mode=p.call(y,this,v&&v.words)},_doProcessBlock:function(v,y){this._mode.processBlock(v,y)},_doFinalize:function(){var v=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){v.pad(this._data,this.blockSize);var y=this._process(!0)}else y=this._process(!0),v.unpad(y);return y},blockSize:4});var d=t.CipherParams=e.extend({init:function(v){this.mixIn(v)},toString:function(v){return(v||this.formatter).stringify(this)}}),f=(m.format={}).OpenSSL={stringify:function(v){var y=v.ciphertext;return v=v.salt,(v?r.create([1398893684,1701076831]).concat(v).concat(y):y).toString(a)},parse:function(v){v=a.parse(v);var y=v.words;if(y[0]==1398893684&&y[1]==1701076831){var p=r.create(y.slice(2,4));y.splice(0,4),v.sigBytes-=16}return d.create({ciphertext:v,salt:p})}},A=t.SerializableCipher=e.extend({cfg:e.extend({format:f}),encrypt:function(v,y,p,g){g=this.cfg.extend(g);var x=v.createEncryptor(p,g);return y=x.finalize(y),x=x.cfg,d.create({ciphertext:y,key:p,iv:x.iv,algorithm:v,mode:x.mode,padding:x.padding,blockSize:v.blockSize,formatter:g.format})},decrypt:function(v,y,p,g){return g=this.cfg.extend(g),y=this._parse(y,g.format),v.createDecryptor(p,g).finalize(y.ciphertext)},_parse:function(v,y){return typeof v=="string"?y.parse(v,this):v}}),m=(m.kdf={}).OpenSSL={execute:function(v,y,p,g){return g||(g=r.random(8)),v=o.create({keySize:y+p}).compute(v,g),p=r.create(v.words.slice(y),4*p),v.sigBytes=4*y,d.create({key:v,iv:p,salt:g})}},h=t.PasswordBasedCipher=A.extend({cfg:A.cfg.extend({kdf:m}),encrypt:function(v,y,p,g){return g=this.cfg.extend(g),p=g.kdf.execute(p,v.keySize,v.ivSize),g.iv=p.iv,v=A.encrypt.call(this,v,y,p.key,g),v.mixIn(p),v},decrypt:function(v,y,p,g){return g=this.cfg.extend(g),y=this._parse(y,g.format),p=g.kdf.execute(p,v.keySize,v.ivSize,y.salt),g.iv=p.iv,A.decrypt.call(this,v,y,p.key,g)}})}();(function(){for(var n=we,t=n.lib.BlockCipher,E=n.algo,e=[],r=[],i=[],a=[],o=[],s=[],l=[],u=[],d=[],f=[],A=[],m=0;256>m;m++)A[m]=128>m?m<<1:m<<1^283;for(var h=0,v=0,m=0;256>m;m++){var y=v^v<<1^v<<2^v<<3^v<<4,y=y>>>8^y&255^99;e[h]=y,r[y]=h;var p=A[h],g=A[p],x=A[g],b=257*A[y]^16843008*y;i[h]=b<<24|b>>>8,a[h]=b<<16|b>>>16,o[h]=b<<8|b>>>24,s[h]=b,b=16843009*x^65537*g^257*p^16843008*h,l[y]=b<<24|b>>>8,u[y]=b<<16|b>>>16,d[y]=b<<8|b>>>24,f[y]=b,h?(h=p^A[A[A[x^p]]],v^=A[A[v]]):h=v=1}var w=[0,1,2,4,8,16,32,64,128,27,54],E=E.AES=t.extend({_doReset:function(){for(var P=this._key,M=P.words,C=P.sigBytes/4,P=4*((this._nRounds=C+6)+1),S=this._keySchedule=[],T=0;T<P;T++)if(T<C)S[T]=M[T];else{var B=S[T-1];T%C?6<C&&T%C==4&&(B=e[B>>>24]<<24|e[B>>>16&255]<<16|e[B>>>8&255]<<8|e[B&255]):(B=B<<8|B>>>24,B=e[B>>>24]<<24|e[B>>>16&255]<<16|e[B>>>8&255]<<8|e[B&255],B^=w[T/C|0]<<24),S[T]=S[T-C]^B}for(M=this._invKeySchedule=[],C=0;C<P;C++)T=P-C,B=C%4?S[T]:S[T-4],M[C]=4>C||4>=T?B:l[e[B>>>24]]^u[e[B>>>16&255]]^d[e[B>>>8&255]]^f[e[B&255]]},encryptBlock:function(M,C){this._doCryptBlock(M,C,this._keySchedule,i,a,o,s,e)},decryptBlock:function(M,C){var P=M[C+1];M[C+1]=M[C+3],M[C+3]=P,this._doCryptBlock(M,C,this._invKeySchedule,l,u,d,f,r),P=M[C+1],M[C+1]=M[C+3],M[C+3]=P},_doCryptBlock:function(M,C,P,S,T,B,L,k){for(var O=this._nRounds,J=M[C]^P[0],H=M[C+1]^P[1],j=M[C+2]^P[2],G=M[C+3]^P[3],D=4,N=1;N<O;N++)var X=S[J>>>24]^T[H>>>16&255]^B[j>>>8&255]^L[G&255]^P[D++],K=S[H>>>24]^T[j>>>16&255]^B[G>>>8&255]^L[J&255]^P[D++],Q=S[j>>>24]^T[G>>>16&255]^B[J>>>8&255]^L[H&255]^P[D++],G=S[G>>>24]^T[J>>>16&255]^B[H>>>8&255]^L[j&255]^P[D++],J=X,H=K,j=Q;X=(k[J>>>24]<<24|k[H>>>16&255]<<16|k[j>>>8&255]<<8|k[G&255])^P[D++],K=(k[H>>>24]<<24|k[j>>>16&255]<<16|k[G>>>8&255]<<8|k[J&255])^P[D++],Q=(k[j>>>24]<<24|k[G>>>16&255]<<16|k[J>>>8&255]<<8|k[H&255])^P[D++],G=(k[G>>>24]<<24|k[J>>>16&255]<<16|k[H>>>8&255]<<8|k[j&255])^P[D++],M[C]=X,M[C+1]=K,M[C+2]=Q,M[C+3]=G},keySize:8});n.AES=t._createHelper(E)})();/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
|
|
343
|
-
*/var Ur;function fe(n,t,e){n!=null&&(typeof n=="number"?this.fromNumber(n,t,e):t==null&&typeof n!="string"?this.fromString(n,256):this.fromString(n,t))}function Ot(){return new fe(null)}function zu(n,t,e,r,i,a){for(;--a>=0;){var o=t*this[n++]+e[r]+i;i=Math.floor(o/67108864),e[r++]=o&67108863}return i}function Qu(n,t,e,r,i,a){for(var o=t&32767,s=t>>15;--a>=0;){var l=this[n]&32767,u=this[n++]>>15,d=s*l+u*o;l=o*l+((d&32767)<<15)+e[r]+(i&1073741823),i=(l>>>30)+(d>>>15)+s*u+(i>>>30),e[r++]=l&1073741823}return i}function Uu(n,t,e,r,i,a){for(var o=t&16383,s=t>>14;--a>=0;){var l=this[n]&16383,u=this[n++]>>14,d=s*l+u*o;l=o*l+((d&16383)<<14)+e[r]+i,i=(l>>28)+(d>>14)+s*u,e[r++]=l&268435455}return i}typeof navigator!="undefined"&&navigator.appName=="Microsoft Internet Explorer"?(fe.prototype.am=Qu,Ur=30):typeof navigator!="undefined"&&navigator.appName!="Netscape"?(fe.prototype.am=zu,Ur=26):(fe.prototype.am=Uu,Ur=28);fe.prototype.DB=Ur;fe.prototype.DM=(1<<Ur)-1;fe.prototype.DV=1<<Ur;var Ga=52;fe.prototype.FV=Math.pow(2,Ga);fe.prototype.F1=Ga-Ur;fe.prototype.F2=2*Ur-Ga;var qu="0123456789abcdefghijklmnopqrstuvwxyz",Ti=new Array,Mn,kt;Mn=48;for(kt=0;kt<=9;++kt)Ti[Mn++]=kt;Mn=97;for(kt=10;kt<36;++kt)Ti[Mn++]=kt;Mn=65;for(kt=10;kt<36;++kt)Ti[Mn++]=kt;function yr(n){return qu.charAt(n)}function Hu(n,t){var e=Ti[n.charCodeAt(t)];return e==null?-1:e}function Gu(n){for(var t=this.t-1;t>=0;--t)n[t]=this[t];n.t=this.t,n.s=this.s}function Ku(n){this.t=1,this.s=n<0?-1:0,n>0?this[0]=n:n<-1?this[0]=n+this.DV:this.t=0}function Ka(n){var t=Ot();return t.fromInt(n),t}function ju(n,t){var e;if(t==16)e=4;else if(t==8)e=3;else if(t==256)e=8;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else{this.fromRadix(n,t);return}this.t=0,this.s=0;for(var r=n.length,i=!1,a=0;--r>=0;){var o=e==8?n[r]&255:Hu(n,r);if(o<0){n.charAt(r)=="-"&&(i=!0);continue}i=!1,a==0?this[this.t++]=o:a+e>this.DB?(this[this.t-1]|=(o&(1<<this.DB-a)-1)<<a,this[this.t++]=o>>this.DB-a):this[this.t-1]|=o<<a,a+=e,a>=this.DB&&(a-=this.DB)}e==8&&n[0]&128&&(this.s=-1,a>0&&(this[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),i&&fe.ZERO.subTo(this,this)}function Ju(){for(var n=this.s&this.DM;this.t>0&&this[this.t-1]==n;)--this.t}function Wu(n){if(this.s<0)return"-"+this.negate().toString(n);var t;if(n==16)t=4;else if(n==8)t=3;else if(n==2)t=1;else if(n==32)t=5;else if(n==4)t=2;else return this.toRadix(n);var e=(1<<t)-1,r,i=!1,a="",o=this.t,s=this.DB-o*this.DB%t;if(o-- >0)for(s<this.DB&&(r=this[o]>>s)>0&&(i=!0,a=yr(r));o>=0;)s<t?(r=(this[o]&(1<<s)-1)<<t-s,r|=this[--o]>>(s+=this.DB-t)):(r=this[o]>>(s-=t)&e,s<=0&&(s+=this.DB,--o)),r>0&&(i=!0),i&&(a+=yr(r));return i?a:"0"}function Xu(){var n=Ot();return fe.ZERO.subTo(this,n),n}function _u(){return this.s<0?this.negate():this}function Zu(n){var t=this.s-n.s;if(t!=0)return t;var e=this.t;if(t=e-n.t,t!=0)return this.s<0?-t:t;for(;--e>=0;)if((t=this[e]-n[e])!=0)return t;return 0}function ja(n){var t=1,e;return(e=n>>>16)!=0&&(n=e,t+=16),(e=n>>8)!=0&&(n=e,t+=8),(e=n>>4)!=0&&(n=e,t+=4),(e=n>>2)!=0&&(n=e,t+=2),(e=n>>1)!=0&&(n=e,t+=1),t}function Yu(){return this.t<=0?0:this.DB*(this.t-1)+ja(this[this.t-1]^this.s&this.DM)}function $u(n,t){var e;for(e=this.t-1;e>=0;--e)t[e+n]=this[e];for(e=n-1;e>=0;--e)t[e]=0;t.t=this.t+n,t.s=this.s}function el(n,t){for(var e=n;e<this.t;++e)t[e-n]=this[e];t.t=Math.max(this.t-n,0),t.s=this.s}function tl(n,t){var e=n%this.DB,r=this.DB-e,i=(1<<r)-1,a=Math.floor(n/this.DB),o=this.s<<e&this.DM,s;for(s=this.t-1;s>=0;--s)t[s+a+1]=this[s]>>r|o,o=(this[s]&i)<<e;for(s=a-1;s>=0;--s)t[s]=0;t[a]=o,t.t=this.t+a+1,t.s=this.s,t.clamp()}function rl(n,t){t.s=this.s;var e=Math.floor(n/this.DB);if(e>=this.t){t.t=0;return}var r=n%this.DB,i=this.DB-r,a=(1<<r)-1;t[0]=this[e]>>r;for(var o=e+1;o<this.t;++o)t[o-e-1]|=(this[o]&a)<<i,t[o-e]=this[o]>>r;r>0&&(t[this.t-e-1]|=(this.s&a)<<i),t.t=this.t-e,t.clamp()}function nl(n,t){for(var e=0,r=0,i=Math.min(n.t,this.t);e<i;)r+=this[e]-n[e],t[e++]=r&this.DM,r>>=this.DB;if(n.t<this.t){for(r-=n.s;e<this.t;)r+=this[e],t[e++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;e<n.t;)r-=n[e],t[e++]=r&this.DM,r>>=this.DB;r-=n.s}t.s=r<0?-1:0,r<-1?t[e++]=this.DV+r:r>0&&(t[e++]=r),t.t=e,t.clamp()}function il(n,t){var e=this.abs(),r=n.abs(),i=e.t;for(t.t=i+r.t;--i>=0;)t[i]=0;for(i=0;i<r.t;++i)t[i+e.t]=e.am(0,r[i],t,i,0,e.t);t.s=0,t.clamp(),this.s!=n.s&&fe.ZERO.subTo(t,t)}function al(n){for(var t=this.abs(),e=n.t=2*t.t;--e>=0;)n[e]=0;for(e=0;e<t.t-1;++e){var r=t.am(e,t[e],n,2*e,0,1);(n[e+t.t]+=t.am(e+1,2*t[e],n,2*e+1,r,t.t-e-1))>=t.DV&&(n[e+t.t]-=t.DV,n[e+t.t+1]=1)}n.t>0&&(n[n.t-1]+=t.am(e,t[e],n,2*e,0,1)),n.s=0,n.clamp()}function ol(n,t,e){var r=n.abs();if(!(r.t<=0)){var i=this.abs();if(i.t<r.t){t!=null&&t.fromInt(0),e!=null&&this.copyTo(e);return}e==null&&(e=Ot());var a=Ot(),o=this.s,s=n.s,l=this.DB-ja(r[r.t-1]);l>0?(r.lShiftTo(l,a),i.lShiftTo(l,e)):(r.copyTo(a),i.copyTo(e));var u=a.t,d=a[u-1];if(d!=0){var f=d*(1<<this.F1)+(u>1?a[u-2]>>this.F2:0),A=this.FV/f,m=(1<<this.F1)/f,h=1<<this.F2,v=e.t,y=v-u,p=t==null?Ot():t;for(a.dlShiftTo(y,p),e.compareTo(p)>=0&&(e[e.t++]=1,e.subTo(p,e)),fe.ONE.dlShiftTo(u,p),p.subTo(a,a);a.t<u;)a[a.t++]=0;for(;--y>=0;){var g=e[--v]==d?this.DM:Math.floor(e[v]*A+(e[v-1]+h)*m);if((e[v]+=a.am(0,g,e,y,0,u))<g)for(a.dlShiftTo(y,p),e.subTo(p,e);e[v]<--g;)e.subTo(p,e)}t!=null&&(e.drShiftTo(u,t),o!=s&&fe.ZERO.subTo(t,t)),e.t=u,e.clamp(),l>0&&e.rShiftTo(l,e),o<0&&fe.ZERO.subTo(e,e)}}}function sl(n){var t=Ot();return this.abs().divRemTo(n,null,t),this.s<0&&t.compareTo(fe.ZERO)>0&&n.subTo(t,t),t}function Sn(n){this.m=n}function ul(n){return n.s<0||n.compareTo(this.m)>=0?n.mod(this.m):n}function ll(n){return n}function cl(n){n.divRemTo(this.m,null,n)}function dl(n,t,e){n.multiplyTo(t,e),this.reduce(e)}function fl(n,t){n.squareTo(t),this.reduce(t)}Sn.prototype.convert=ul;Sn.prototype.revert=ll;Sn.prototype.reduce=cl;Sn.prototype.mulTo=dl;Sn.prototype.sqrTo=fl;function hl(){if(this.t<1)return 0;var n=this[0];if(!(n&1))return 0;var t=n&3;return t=t*(2-(n&15)*t)&15,t=t*(2-(n&255)*t)&255,t=t*(2-((n&65535)*t&65535))&65535,t=t*(2-n*t%this.DV)%this.DV,t>0?this.DV-t:-t}function In(n){this.m=n,this.mp=n.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<n.DB-15)-1,this.mt2=2*n.t}function pl(n){var t=Ot();return n.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),n.s<0&&t.compareTo(fe.ZERO)>0&&this.m.subTo(t,t),t}function vl(n){var t=Ot();return n.copyTo(t),this.reduce(t),t}function Al(n){for(;n.t<=this.mt2;)n[n.t++]=0;for(var t=0;t<this.m.t;++t){var e=n[t]&32767,r=e*this.mpl+((e*this.mph+(n[t]>>15)*this.mpl&this.um)<<15)&n.DM;for(e=t+this.m.t,n[e]+=this.m.am(0,r,n,t,0,this.m.t);n[e]>=n.DV;)n[e]-=n.DV,n[++e]++}n.clamp(),n.drShiftTo(this.m.t,n),n.compareTo(this.m)>=0&&n.subTo(this.m,n)}function ml(n,t){n.squareTo(t),this.reduce(t)}function gl(n,t,e){n.multiplyTo(t,e),this.reduce(e)}In.prototype.convert=pl;In.prototype.revert=vl;In.prototype.reduce=Al;In.prototype.mulTo=gl;In.prototype.sqrTo=ml;function yl(){return(this.t>0?this[0]&1:this.s)==0}function bl(n,t){if(n>4294967295||n<1)return fe.ONE;var e=Ot(),r=Ot(),i=t.convert(this),a=ja(n)-1;for(i.copyTo(e);--a>=0;)if(t.sqrTo(e,r),(n&1<<a)>0)t.mulTo(r,i,e);else{var o=e;e=r,r=o}return t.revert(e)}function xl(n,t){var e;return n<256||t.isEven()?e=new Sn(t):e=new In(t),this.exp(n,e)}fe.prototype.copyTo=Gu;fe.prototype.fromInt=Ku;fe.prototype.fromString=ju;fe.prototype.clamp=Ju;fe.prototype.dlShiftTo=$u;fe.prototype.drShiftTo=el;fe.prototype.lShiftTo=tl;fe.prototype.rShiftTo=rl;fe.prototype.subTo=nl;fe.prototype.multiplyTo=il;fe.prototype.squareTo=al;fe.prototype.divRemTo=ol;fe.prototype.invDigit=hl;fe.prototype.isEven=yl;fe.prototype.exp=bl;fe.prototype.toString=Wu;fe.prototype.negate=Xu;fe.prototype.abs=_u;fe.prototype.compareTo=Zu;fe.prototype.bitLength=Yu;fe.prototype.mod=sl;fe.prototype.modPowInt=xl;fe.ZERO=Ka(0);fe.ONE=Ka(1);/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function wl(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function El(n){return Math.floor(Math.LN2*this.DB/Math.log(n))}function Cl(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function Ml(n){if(n==null&&(n=10),this.signum()==0||n<2||n>36)return"0";var t=this.chunkSize(n),e=Math.pow(n,t),r=Ka(e),i=Ot(),a=Ot(),o="";for(this.divRemTo(r,i,a);i.signum()>0;)o=(e+a.intValue()).toString(n).substr(1)+o,i.divRemTo(r,i,a);return a.intValue().toString(n)+o}fe.prototype.chunkSize=El;fe.prototype.toRadix=Ml;fe.prototype.intValue=wl;fe.prototype.signum=Cl;/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */var An="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t0="=";function Sl(n){var t,e,r="";for(t=0;t+3<=n.length;t+=3)e=parseInt(n.substring(t,t+3),16),r+=An.charAt(e>>6)+An.charAt(e&63);for(t+1==n.length?(e=parseInt(n.substring(t,t+1),16),r+=An.charAt(e<<2)):t+2==n.length&&(e=parseInt(n.substring(t,t+2),16),r+=An.charAt(e>>2)+An.charAt((e&3)<<4));(r.length&3)>0;)r+=t0;return r}function Ja(n){var t="",e,r=0,i,a;for(e=0;e<n.length&&n.charAt(e)!=t0;++e)a=An.indexOf(n.charAt(e)),!(a<0)&&(r==0?(t+=yr(a>>2),i=a&3,r=1):r==1?(t+=yr(i<<2|a>>4),i=a&15,r=2):r==2?(t+=yr(i),t+=yr(a>>2),i=a&3,r=3):(t+=yr(i<<2|a>>4),t+=yr(a&15),r=0));return r==1&&(t+=yr(i<<2)),t}/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function yt(n,t){return new fe(n,t)}function Il(n,t){if(t<n.length+11)throw"Message too long for RSA";for(var e=new Array,r=n.length-1;r>=0&&t>0;){var i=n.charCodeAt(r--);i<128?e[--t]=i:i>127&&i<2048?(e[--t]=i&63|128,e[--t]=i>>6|192):(e[--t]=i&63|128,e[--t]=i>>6&63|128,e[--t]=i>>12|224)}e[--t]=0;for(var a=new SecureRandom,o=new Array;t>2;){for(o[0]=0;o[0]==0;)a.nextBytes(o);e[--t]=o[0]}return e[--t]=2,e[--t]=0,new fe(e)}function Io(n,t,e){for(var r="",i=0;r.length<t;)r+=e(String.fromCharCode.apply(String,n.concat([(i&4278190080)>>24,(i&16711680)>>16,(i&65280)>>8,i&255]))),i+=1;return r}function Tl(n,t,e,r){var i=re.crypto.MessageDigest,a=re.crypto.Util,o=null;if(e||(e="sha1"),typeof e=="string"&&(o=i.getCanonicalAlgName(e),r=i.getHashLength(o),e=function(v){return xr(a.hashHex(Pi(v),o))}),n.length+2*r+2>t)throw"Message too long for RSA";var s="",l;for(l=0;l<t-n.length-2*r-2;l+=1)s+="\0";var u=e("")+s+""+n,d=new Array(r);new SecureRandom().nextBytes(d);var f=Io(d,u.length,e),A=[];for(l=0;l<u.length;l+=1)A[l]=u.charCodeAt(l)^f.charCodeAt(l);var m=Io(A,d.length,e),h=[0];for(l=0;l<d.length;l+=1)h[l+1]=d[l]^m.charCodeAt(l);return new fe(h.concat(A))}function ke(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}function Pl(n,t){if(this.isPublic=!0,this.isPrivate=!1,typeof n!="string")this.n=n,this.e=t;else if(n!=null&&t!=null&&n.length>0&&t.length>0)this.n=yt(n,16),this.e=parseInt(t,16);else throw"Invalid RSA public key"}function Bl(n){return n.modPowInt(this.e,this.n)}function Rl(n){var t=Il(n,this.n.bitLength()+7>>3);if(t==null)return null;var e=this.doPublic(t);if(e==null)return null;var r=e.toString(16);return r.length&1?"0"+r:r}function kl(n,t,e){var r=Tl(n,this.n.bitLength()+7>>3,t,e);if(r==null)return null;var i=this.doPublic(r);if(i==null)return null;var a=i.toString(16);return a.length&1?"0"+a:a}ke.prototype.doPublic=Bl;ke.prototype.setPublic=Pl;ke.prototype.encrypt=Rl;ke.prototype.encryptOAEP=kl;ke.prototype.type="RSA";/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function Fl(n,t){for(var e=n.toByteArray(),r=0;r<e.length&&e[r]==0;)++r;if(e.length-r!=t-1||e[r]!=2)return null;for(++r;e[r]!=0;)if(++r>=e.length)return null;for(var i="";++r<e.length;){var a=e[r]&255;a<128?i+=String.fromCharCode(a):a>191&&a<224?(i+=String.fromCharCode((a&31)<<6|e[r+1]&63),++r):(i+=String.fromCharCode((a&15)<<12|(e[r+1]&63)<<6|e[r+2]&63),r+=2)}return i}function To(n,t,e){for(var r="",i=0;r.length<t;)r+=e(n+String.fromCharCode.apply(String,[(i&4278190080)>>24,(i&16711680)>>16,(i&65280)>>8,i&255])),i+=1;return r}function Ll(n,t,e,r){var i=re.crypto.MessageDigest,a=re.crypto.Util,o=null;e||(e="sha1"),typeof e=="string"&&(o=i.getCanonicalAlgName(e),r=i.getHashLength(o),e=function(y){return xr(a.hashHex(Pi(y),o))}),n=n.toByteArray();var f;for(f=0;f<n.length;f+=1)n[f]&=255;for(;n.length<t;)n.unshift(0);if(n=String.fromCharCode.apply(String,n),n.length<2*r+2)throw"Cipher too short";var s=n.substr(1,r),l=n.substr(r+1),u=To(l,r,e),d=[],f;for(f=0;f<s.length;f+=1)d[f]=s.charCodeAt(f)^u.charCodeAt(f);var A=To(String.fromCharCode.apply(String,d),n.length-r,e),m=[];for(f=0;f<l.length;f+=1)m[f]=l.charCodeAt(f)^A.charCodeAt(f);if(m=String.fromCharCode.apply(String,m),m.substr(0,r)!==e(""))throw"Hash mismatch";m=m.substr(r);var h=m.indexOf(""),v=h!=-1?m.substr(0,h).lastIndexOf("\0"):-1;if(v+1!=h)throw"Malformed data";return m.substr(h+1)}function Ol(n,t,e){if(this.isPrivate=!0,typeof n!="string")this.n=n,this.e=t,this.d=e;else if(n!=null&&t!=null&&n.length>0&&t.length>0)this.n=yt(n,16),this.e=parseInt(t,16),this.d=yt(e,16);else throw"Invalid RSA private key"}function Vl(n,t,e,r,i,a,o,s){if(this.isPrivate=!0,this.isPublic=!1,n==null)throw"RSASetPrivateEx N == null";if(t==null)throw"RSASetPrivateEx E == null";if(n.length==0)throw"RSASetPrivateEx N.length == 0";if(t.length==0)throw"RSASetPrivateEx E.length == 0";if(n!=null&&t!=null&&n.length>0&&t.length>0)this.n=yt(n,16),this.e=parseInt(t,16),this.d=yt(e,16),this.p=yt(r,16),this.q=yt(i,16),this.dmp1=yt(a,16),this.dmq1=yt(o,16),this.coeff=yt(s,16);else throw"Invalid RSA private key in RSASetPrivateEx"}function Nl(n){if(this.p==null||this.q==null)return n.modPow(this.d,this.n);for(var t=n.mod(this.p).modPow(this.dmp1,this.p),e=n.mod(this.q).modPow(this.dmq1,this.q);t.compareTo(e)<0;)t=t.add(this.p);return t.subtract(e).multiply(this.coeff).mod(this.p).multiply(this.q).add(e)}function Dl(n){if(n.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var t=yt(n,16),e=this.doPrivate(t);return e==null?null:Fl(e,this.n.bitLength()+7>>3)}function zl(n,t,e){if(n.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var r=yt(n,16),i=this.doPrivate(r);return i==null?null:Ll(i,this.n.bitLength()+7>>3,t,e)}ke.prototype.doPrivate=Nl;ke.prototype.setPrivate=Ol;ke.prototype.setPrivateEx=Vl;ke.prototype.decrypt=Dl;ke.prototype.decryptOAEP=zl;(typeof re.lang=="undefined"||!re.lang)&&(re.lang={});re.lang.String=function(){};function Ql(n){return n.length%4==2?n=n+"==":n.length%4==3&&(n=n+"="),n=n.replace(/-/g,"+"),n=n.replace(/_/g,"/"),n}function tt(n){return Ja(Ql(n))}function or(n){return decodeURIComponent(Kl(n))}function xr(n){for(var t="",e=0;e<n.length-1;e+=2)t+=String.fromCharCode(parseInt(n.substr(e,2),16));return t}function Pi(n){for(var t="",e=0;e<n.length;e++)t+=("0"+n.charCodeAt(e).toString(16)).slice(-2);return t}function Ul(n){return Sl(n)}function ql(n){var t=Ul(n),e=t.replace(/(.{64})/g,`$1\r
|
|
344
|
-
`);return e=e.replace(/\r\n$/,""),e}function
|
|
343
|
+
*/var Ur;function fe(n,t,e){n!=null&&(typeof n=="number"?this.fromNumber(n,t,e):t==null&&typeof n!="string"?this.fromString(n,256):this.fromString(n,t))}function Ot(){return new fe(null)}function Qu(n,t,e,r,i,a){for(;--a>=0;){var o=t*this[n++]+e[r]+i;i=Math.floor(o/67108864),e[r++]=o&67108863}return i}function Uu(n,t,e,r,i,a){for(var o=t&32767,s=t>>15;--a>=0;){var l=this[n]&32767,u=this[n++]>>15,d=s*l+u*o;l=o*l+((d&32767)<<15)+e[r]+(i&1073741823),i=(l>>>30)+(d>>>15)+s*u+(i>>>30),e[r++]=l&1073741823}return i}function qu(n,t,e,r,i,a){for(var o=t&16383,s=t>>14;--a>=0;){var l=this[n]&16383,u=this[n++]>>14,d=s*l+u*o;l=o*l+((d&16383)<<14)+e[r]+i,i=(l>>28)+(d>>14)+s*u,e[r++]=l&268435455}return i}typeof navigator!="undefined"&&navigator.appName=="Microsoft Internet Explorer"?(fe.prototype.am=Uu,Ur=30):typeof navigator!="undefined"&&navigator.appName!="Netscape"?(fe.prototype.am=Qu,Ur=26):(fe.prototype.am=qu,Ur=28);fe.prototype.DB=Ur;fe.prototype.DM=(1<<Ur)-1;fe.prototype.DV=1<<Ur;var Ka=52;fe.prototype.FV=Math.pow(2,Ka);fe.prototype.F1=Ka-Ur;fe.prototype.F2=2*Ur-Ka;var Hu="0123456789abcdefghijklmnopqrstuvwxyz",Ti=new Array,Mn,kt;Mn=48;for(kt=0;kt<=9;++kt)Ti[Mn++]=kt;Mn=97;for(kt=10;kt<36;++kt)Ti[Mn++]=kt;Mn=65;for(kt=10;kt<36;++kt)Ti[Mn++]=kt;function yr(n){return Hu.charAt(n)}function Gu(n,t){var e=Ti[n.charCodeAt(t)];return e==null?-1:e}function Ku(n){for(var t=this.t-1;t>=0;--t)n[t]=this[t];n.t=this.t,n.s=this.s}function ju(n){this.t=1,this.s=n<0?-1:0,n>0?this[0]=n:n<-1?this[0]=n+this.DV:this.t=0}function ja(n){var t=Ot();return t.fromInt(n),t}function Ju(n,t){var e;if(t==16)e=4;else if(t==8)e=3;else if(t==256)e=8;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else{this.fromRadix(n,t);return}this.t=0,this.s=0;for(var r=n.length,i=!1,a=0;--r>=0;){var o=e==8?n[r]&255:Gu(n,r);if(o<0){n.charAt(r)=="-"&&(i=!0);continue}i=!1,a==0?this[this.t++]=o:a+e>this.DB?(this[this.t-1]|=(o&(1<<this.DB-a)-1)<<a,this[this.t++]=o>>this.DB-a):this[this.t-1]|=o<<a,a+=e,a>=this.DB&&(a-=this.DB)}e==8&&n[0]&128&&(this.s=-1,a>0&&(this[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),i&&fe.ZERO.subTo(this,this)}function Wu(){for(var n=this.s&this.DM;this.t>0&&this[this.t-1]==n;)--this.t}function Xu(n){if(this.s<0)return"-"+this.negate().toString(n);var t;if(n==16)t=4;else if(n==8)t=3;else if(n==2)t=1;else if(n==32)t=5;else if(n==4)t=2;else return this.toRadix(n);var e=(1<<t)-1,r,i=!1,a="",o=this.t,s=this.DB-o*this.DB%t;if(o-- >0)for(s<this.DB&&(r=this[o]>>s)>0&&(i=!0,a=yr(r));o>=0;)s<t?(r=(this[o]&(1<<s)-1)<<t-s,r|=this[--o]>>(s+=this.DB-t)):(r=this[o]>>(s-=t)&e,s<=0&&(s+=this.DB,--o)),r>0&&(i=!0),i&&(a+=yr(r));return i?a:"0"}function _u(){var n=Ot();return fe.ZERO.subTo(this,n),n}function Zu(){return this.s<0?this.negate():this}function Yu(n){var t=this.s-n.s;if(t!=0)return t;var e=this.t;if(t=e-n.t,t!=0)return this.s<0?-t:t;for(;--e>=0;)if((t=this[e]-n[e])!=0)return t;return 0}function Ja(n){var t=1,e;return(e=n>>>16)!=0&&(n=e,t+=16),(e=n>>8)!=0&&(n=e,t+=8),(e=n>>4)!=0&&(n=e,t+=4),(e=n>>2)!=0&&(n=e,t+=2),(e=n>>1)!=0&&(n=e,t+=1),t}function $u(){return this.t<=0?0:this.DB*(this.t-1)+Ja(this[this.t-1]^this.s&this.DM)}function el(n,t){var e;for(e=this.t-1;e>=0;--e)t[e+n]=this[e];for(e=n-1;e>=0;--e)t[e]=0;t.t=this.t+n,t.s=this.s}function tl(n,t){for(var e=n;e<this.t;++e)t[e-n]=this[e];t.t=Math.max(this.t-n,0),t.s=this.s}function rl(n,t){var e=n%this.DB,r=this.DB-e,i=(1<<r)-1,a=Math.floor(n/this.DB),o=this.s<<e&this.DM,s;for(s=this.t-1;s>=0;--s)t[s+a+1]=this[s]>>r|o,o=(this[s]&i)<<e;for(s=a-1;s>=0;--s)t[s]=0;t[a]=o,t.t=this.t+a+1,t.s=this.s,t.clamp()}function nl(n,t){t.s=this.s;var e=Math.floor(n/this.DB);if(e>=this.t){t.t=0;return}var r=n%this.DB,i=this.DB-r,a=(1<<r)-1;t[0]=this[e]>>r;for(var o=e+1;o<this.t;++o)t[o-e-1]|=(this[o]&a)<<i,t[o-e]=this[o]>>r;r>0&&(t[this.t-e-1]|=(this.s&a)<<i),t.t=this.t-e,t.clamp()}function il(n,t){for(var e=0,r=0,i=Math.min(n.t,this.t);e<i;)r+=this[e]-n[e],t[e++]=r&this.DM,r>>=this.DB;if(n.t<this.t){for(r-=n.s;e<this.t;)r+=this[e],t[e++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;e<n.t;)r-=n[e],t[e++]=r&this.DM,r>>=this.DB;r-=n.s}t.s=r<0?-1:0,r<-1?t[e++]=this.DV+r:r>0&&(t[e++]=r),t.t=e,t.clamp()}function al(n,t){var e=this.abs(),r=n.abs(),i=e.t;for(t.t=i+r.t;--i>=0;)t[i]=0;for(i=0;i<r.t;++i)t[i+e.t]=e.am(0,r[i],t,i,0,e.t);t.s=0,t.clamp(),this.s!=n.s&&fe.ZERO.subTo(t,t)}function ol(n){for(var t=this.abs(),e=n.t=2*t.t;--e>=0;)n[e]=0;for(e=0;e<t.t-1;++e){var r=t.am(e,t[e],n,2*e,0,1);(n[e+t.t]+=t.am(e+1,2*t[e],n,2*e+1,r,t.t-e-1))>=t.DV&&(n[e+t.t]-=t.DV,n[e+t.t+1]=1)}n.t>0&&(n[n.t-1]+=t.am(e,t[e],n,2*e,0,1)),n.s=0,n.clamp()}function sl(n,t,e){var r=n.abs();if(!(r.t<=0)){var i=this.abs();if(i.t<r.t){t!=null&&t.fromInt(0),e!=null&&this.copyTo(e);return}e==null&&(e=Ot());var a=Ot(),o=this.s,s=n.s,l=this.DB-Ja(r[r.t-1]);l>0?(r.lShiftTo(l,a),i.lShiftTo(l,e)):(r.copyTo(a),i.copyTo(e));var u=a.t,d=a[u-1];if(d!=0){var f=d*(1<<this.F1)+(u>1?a[u-2]>>this.F2:0),A=this.FV/f,m=(1<<this.F1)/f,h=1<<this.F2,v=e.t,y=v-u,p=t==null?Ot():t;for(a.dlShiftTo(y,p),e.compareTo(p)>=0&&(e[e.t++]=1,e.subTo(p,e)),fe.ONE.dlShiftTo(u,p),p.subTo(a,a);a.t<u;)a[a.t++]=0;for(;--y>=0;){var g=e[--v]==d?this.DM:Math.floor(e[v]*A+(e[v-1]+h)*m);if((e[v]+=a.am(0,g,e,y,0,u))<g)for(a.dlShiftTo(y,p),e.subTo(p,e);e[v]<--g;)e.subTo(p,e)}t!=null&&(e.drShiftTo(u,t),o!=s&&fe.ZERO.subTo(t,t)),e.t=u,e.clamp(),l>0&&e.rShiftTo(l,e),o<0&&fe.ZERO.subTo(e,e)}}}function ul(n){var t=Ot();return this.abs().divRemTo(n,null,t),this.s<0&&t.compareTo(fe.ZERO)>0&&n.subTo(t,t),t}function Sn(n){this.m=n}function ll(n){return n.s<0||n.compareTo(this.m)>=0?n.mod(this.m):n}function cl(n){return n}function dl(n){n.divRemTo(this.m,null,n)}function fl(n,t,e){n.multiplyTo(t,e),this.reduce(e)}function hl(n,t){n.squareTo(t),this.reduce(t)}Sn.prototype.convert=ll;Sn.prototype.revert=cl;Sn.prototype.reduce=dl;Sn.prototype.mulTo=fl;Sn.prototype.sqrTo=hl;function pl(){if(this.t<1)return 0;var n=this[0];if(!(n&1))return 0;var t=n&3;return t=t*(2-(n&15)*t)&15,t=t*(2-(n&255)*t)&255,t=t*(2-((n&65535)*t&65535))&65535,t=t*(2-n*t%this.DV)%this.DV,t>0?this.DV-t:-t}function In(n){this.m=n,this.mp=n.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<n.DB-15)-1,this.mt2=2*n.t}function vl(n){var t=Ot();return n.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),n.s<0&&t.compareTo(fe.ZERO)>0&&this.m.subTo(t,t),t}function Al(n){var t=Ot();return n.copyTo(t),this.reduce(t),t}function ml(n){for(;n.t<=this.mt2;)n[n.t++]=0;for(var t=0;t<this.m.t;++t){var e=n[t]&32767,r=e*this.mpl+((e*this.mph+(n[t]>>15)*this.mpl&this.um)<<15)&n.DM;for(e=t+this.m.t,n[e]+=this.m.am(0,r,n,t,0,this.m.t);n[e]>=n.DV;)n[e]-=n.DV,n[++e]++}n.clamp(),n.drShiftTo(this.m.t,n),n.compareTo(this.m)>=0&&n.subTo(this.m,n)}function gl(n,t){n.squareTo(t),this.reduce(t)}function yl(n,t,e){n.multiplyTo(t,e),this.reduce(e)}In.prototype.convert=vl;In.prototype.revert=Al;In.prototype.reduce=ml;In.prototype.mulTo=yl;In.prototype.sqrTo=gl;function bl(){return(this.t>0?this[0]&1:this.s)==0}function xl(n,t){if(n>4294967295||n<1)return fe.ONE;var e=Ot(),r=Ot(),i=t.convert(this),a=Ja(n)-1;for(i.copyTo(e);--a>=0;)if(t.sqrTo(e,r),(n&1<<a)>0)t.mulTo(r,i,e);else{var o=e;e=r,r=o}return t.revert(e)}function wl(n,t){var e;return n<256||t.isEven()?e=new Sn(t):e=new In(t),this.exp(n,e)}fe.prototype.copyTo=Ku;fe.prototype.fromInt=ju;fe.prototype.fromString=Ju;fe.prototype.clamp=Wu;fe.prototype.dlShiftTo=el;fe.prototype.drShiftTo=tl;fe.prototype.lShiftTo=rl;fe.prototype.rShiftTo=nl;fe.prototype.subTo=il;fe.prototype.multiplyTo=al;fe.prototype.squareTo=ol;fe.prototype.divRemTo=sl;fe.prototype.invDigit=pl;fe.prototype.isEven=bl;fe.prototype.exp=xl;fe.prototype.toString=Xu;fe.prototype.negate=_u;fe.prototype.abs=Zu;fe.prototype.compareTo=Yu;fe.prototype.bitLength=$u;fe.prototype.mod=ul;fe.prototype.modPowInt=wl;fe.ZERO=ja(0);fe.ONE=ja(1);/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function El(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function Cl(n){return Math.floor(Math.LN2*this.DB/Math.log(n))}function Ml(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function Sl(n){if(n==null&&(n=10),this.signum()==0||n<2||n>36)return"0";var t=this.chunkSize(n),e=Math.pow(n,t),r=ja(e),i=Ot(),a=Ot(),o="";for(this.divRemTo(r,i,a);i.signum()>0;)o=(e+a.intValue()).toString(n).substr(1)+o,i.divRemTo(r,i,a);return a.intValue().toString(n)+o}fe.prototype.chunkSize=Cl;fe.prototype.toRadix=Sl;fe.prototype.intValue=El;fe.prototype.signum=Ml;/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */var An="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r0="=";function Il(n){var t,e,r="";for(t=0;t+3<=n.length;t+=3)e=parseInt(n.substring(t,t+3),16),r+=An.charAt(e>>6)+An.charAt(e&63);for(t+1==n.length?(e=parseInt(n.substring(t,t+1),16),r+=An.charAt(e<<2)):t+2==n.length&&(e=parseInt(n.substring(t,t+2),16),r+=An.charAt(e>>2)+An.charAt((e&3)<<4));(r.length&3)>0;)r+=r0;return r}function Wa(n){var t="",e,r=0,i,a;for(e=0;e<n.length&&n.charAt(e)!=r0;++e)a=An.indexOf(n.charAt(e)),!(a<0)&&(r==0?(t+=yr(a>>2),i=a&3,r=1):r==1?(t+=yr(i<<2|a>>4),i=a&15,r=2):r==2?(t+=yr(i),t+=yr(a>>2),i=a&3,r=3):(t+=yr(i<<2|a>>4),t+=yr(a&15),r=0));return r==1&&(t+=yr(i<<2)),t}/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function yt(n,t){return new fe(n,t)}function Tl(n,t){if(t<n.length+11)throw"Message too long for RSA";for(var e=new Array,r=n.length-1;r>=0&&t>0;){var i=n.charCodeAt(r--);i<128?e[--t]=i:i>127&&i<2048?(e[--t]=i&63|128,e[--t]=i>>6|192):(e[--t]=i&63|128,e[--t]=i>>6&63|128,e[--t]=i>>12|224)}e[--t]=0;for(var a=new SecureRandom,o=new Array;t>2;){for(o[0]=0;o[0]==0;)a.nextBytes(o);e[--t]=o[0]}return e[--t]=2,e[--t]=0,new fe(e)}function To(n,t,e){for(var r="",i=0;r.length<t;)r+=e(String.fromCharCode.apply(String,n.concat([(i&4278190080)>>24,(i&16711680)>>16,(i&65280)>>8,i&255]))),i+=1;return r}function Pl(n,t,e,r){var i=re.crypto.MessageDigest,a=re.crypto.Util,o=null;if(e||(e="sha1"),typeof e=="string"&&(o=i.getCanonicalAlgName(e),r=i.getHashLength(o),e=function(v){return xr(a.hashHex(Pi(v),o))}),n.length+2*r+2>t)throw"Message too long for RSA";var s="",l;for(l=0;l<t-n.length-2*r-2;l+=1)s+="\0";var u=e("")+s+""+n,d=new Array(r);new SecureRandom().nextBytes(d);var f=To(d,u.length,e),A=[];for(l=0;l<u.length;l+=1)A[l]=u.charCodeAt(l)^f.charCodeAt(l);var m=To(A,d.length,e),h=[0];for(l=0;l<d.length;l+=1)h[l+1]=d[l]^m.charCodeAt(l);return new fe(h.concat(A))}function ke(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}function Bl(n,t){if(this.isPublic=!0,this.isPrivate=!1,typeof n!="string")this.n=n,this.e=t;else if(n!=null&&t!=null&&n.length>0&&t.length>0)this.n=yt(n,16),this.e=parseInt(t,16);else throw"Invalid RSA public key"}function Rl(n){return n.modPowInt(this.e,this.n)}function kl(n){var t=Tl(n,this.n.bitLength()+7>>3);if(t==null)return null;var e=this.doPublic(t);if(e==null)return null;var r=e.toString(16);return r.length&1?"0"+r:r}function Fl(n,t,e){var r=Pl(n,this.n.bitLength()+7>>3,t,e);if(r==null)return null;var i=this.doPublic(r);if(i==null)return null;var a=i.toString(16);return a.length&1?"0"+a:a}ke.prototype.doPublic=Rl;ke.prototype.setPublic=Bl;ke.prototype.encrypt=kl;ke.prototype.encryptOAEP=Fl;ke.prototype.type="RSA";/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function Ll(n,t){for(var e=n.toByteArray(),r=0;r<e.length&&e[r]==0;)++r;if(e.length-r!=t-1||e[r]!=2)return null;for(++r;e[r]!=0;)if(++r>=e.length)return null;for(var i="";++r<e.length;){var a=e[r]&255;a<128?i+=String.fromCharCode(a):a>191&&a<224?(i+=String.fromCharCode((a&31)<<6|e[r+1]&63),++r):(i+=String.fromCharCode((a&15)<<12|(e[r+1]&63)<<6|e[r+2]&63),r+=2)}return i}function Po(n,t,e){for(var r="",i=0;r.length<t;)r+=e(n+String.fromCharCode.apply(String,[(i&4278190080)>>24,(i&16711680)>>16,(i&65280)>>8,i&255])),i+=1;return r}function Ol(n,t,e,r){var i=re.crypto.MessageDigest,a=re.crypto.Util,o=null;e||(e="sha1"),typeof e=="string"&&(o=i.getCanonicalAlgName(e),r=i.getHashLength(o),e=function(y){return xr(a.hashHex(Pi(y),o))}),n=n.toByteArray();var f;for(f=0;f<n.length;f+=1)n[f]&=255;for(;n.length<t;)n.unshift(0);if(n=String.fromCharCode.apply(String,n),n.length<2*r+2)throw"Cipher too short";var s=n.substr(1,r),l=n.substr(r+1),u=Po(l,r,e),d=[],f;for(f=0;f<s.length;f+=1)d[f]=s.charCodeAt(f)^u.charCodeAt(f);var A=Po(String.fromCharCode.apply(String,d),n.length-r,e),m=[];for(f=0;f<l.length;f+=1)m[f]=l.charCodeAt(f)^A.charCodeAt(f);if(m=String.fromCharCode.apply(String,m),m.substr(0,r)!==e(""))throw"Hash mismatch";m=m.substr(r);var h=m.indexOf(""),v=h!=-1?m.substr(0,h).lastIndexOf("\0"):-1;if(v+1!=h)throw"Malformed data";return m.substr(h+1)}function Vl(n,t,e){if(this.isPrivate=!0,typeof n!="string")this.n=n,this.e=t,this.d=e;else if(n!=null&&t!=null&&n.length>0&&t.length>0)this.n=yt(n,16),this.e=parseInt(t,16),this.d=yt(e,16);else throw"Invalid RSA private key"}function Nl(n,t,e,r,i,a,o,s){if(this.isPrivate=!0,this.isPublic=!1,n==null)throw"RSASetPrivateEx N == null";if(t==null)throw"RSASetPrivateEx E == null";if(n.length==0)throw"RSASetPrivateEx N.length == 0";if(t.length==0)throw"RSASetPrivateEx E.length == 0";if(n!=null&&t!=null&&n.length>0&&t.length>0)this.n=yt(n,16),this.e=parseInt(t,16),this.d=yt(e,16),this.p=yt(r,16),this.q=yt(i,16),this.dmp1=yt(a,16),this.dmq1=yt(o,16),this.coeff=yt(s,16);else throw"Invalid RSA private key in RSASetPrivateEx"}function Dl(n){if(this.p==null||this.q==null)return n.modPow(this.d,this.n);for(var t=n.mod(this.p).modPow(this.dmp1,this.p),e=n.mod(this.q).modPow(this.dmq1,this.q);t.compareTo(e)<0;)t=t.add(this.p);return t.subtract(e).multiply(this.coeff).mod(this.p).multiply(this.q).add(e)}function zl(n){if(n.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var t=yt(n,16),e=this.doPrivate(t);return e==null?null:Ll(e,this.n.bitLength()+7>>3)}function Ql(n,t,e){if(n.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var r=yt(n,16),i=this.doPrivate(r);return i==null?null:Ol(i,this.n.bitLength()+7>>3,t,e)}ke.prototype.doPrivate=Dl;ke.prototype.setPrivate=Vl;ke.prototype.setPrivateEx=Nl;ke.prototype.decrypt=zl;ke.prototype.decryptOAEP=Ql;(typeof re.lang=="undefined"||!re.lang)&&(re.lang={});re.lang.String=function(){};function Ul(n){return n.length%4==2?n=n+"==":n.length%4==3&&(n=n+"="),n=n.replace(/-/g,"+"),n=n.replace(/_/g,"/"),n}function tt(n){return Wa(Ul(n))}function or(n){return decodeURIComponent(jl(n))}function xr(n){for(var t="",e=0;e<n.length-1;e+=2)t+=String.fromCharCode(parseInt(n.substr(e,2),16));return t}function Pi(n){for(var t="",e=0;e<n.length;e++)t+=("0"+n.charCodeAt(e).toString(16)).slice(-2);return t}function ql(n){return Il(n)}function Hl(n){var t=ql(n),e=t.replace(/(.{64})/g,`$1\r
|
|
344
|
+
`);return e=e.replace(/\r\n$/,""),e}function Gl(n){var t=n.replace(/[^0-9A-Za-z\/+=]*/g,""),e=Wa(t);return e}function Kl(n,t){var e=Hl(n);return"-----BEGIN "+t+`-----\r
|
|
345
345
|
`+e+`\r
|
|
346
346
|
-----END `+t+`-----\r
|
|
347
|
-
`}function rn(n,t){if(n.indexOf("-----BEGIN ")==-1)throw"can't find PEM header: "+t;return t!==void 0?(n=n.replace(new RegExp("^[^]*-----BEGIN "+t+"-----"),""),n=n.replace(new RegExp("-----END "+t+"-----[^]*$"),"")):(n=n.replace(/^[^]*-----BEGIN [^-]+-----/,""),n=n.replace(/-----END [^-]+-----[^]*$/,"")),Hl(n)}function Kl(n){return n.replace(/(..)/g,"%$1")}function jl(n){if(!n.match(/^[0-9A-Fa-f]{32}$/))throw"malformed IPv6 address octet";n=n.toLowerCase();for(var t=n.match(/.{1,4}/g),e=0;e<8;e++)t[e]=t[e].replace(/^0+/,""),t[e]==""&&(t[e]="0");n=":"+t.join(":")+":";var r=n.match(/:(0:){2,}/g);if(r===null)return n.slice(1,-1);for(var i="",e=0;e<r.length;e++)r[e].length>i.length&&(i=r[e]);return n=n.replace(i,"::"),n.slice(1,-1)}function Po(n){var t="malformed hex value";if(!n.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw t;if(n.length==8){var e;try{return e=parseInt(n.substr(0,2),16)+"."+parseInt(n.substr(2,2),16)+"."+parseInt(n.substr(4,2),16)+"."+parseInt(n.substr(6,2),16),e}catch(r){throw t}}else return n.length==32?jl(n):n}function Jl(n){function t(i){var a=parseInt(i.substr(0,2),16),o=parseInt(i.substr(2),16);if(a==0&o<128)return String.fromCharCode(o);if(a<8){var s=192|(a&7)<<3|(o&192)>>6,l=128|o&63;return or(s.toString(16)+l.toString(16))}var s=224|(a&240)>>4,l=128|(a&15)<<2|(o&192)>>6,u=128|o&63;return or(s.toString(16)+l.toString(16)+u.toString(16))}var e=n.match(/.{4}/g),r=e.map(t);return r.join("")}re.lang.String.isHex=function(n){return r0(n)};function r0(n){return!!(n.length%2==0&&(n.match(/^[0-9a-f]+$/)||n.match(/^[0-9A-F]+$/)))}re.lang.String.isMail=function(n){return n.match(/^[A-Za-z0-9]{1}[A-Za-z0-9_.-]*@{1}[A-Za-z0-9_.-]{1,}\.[A-Za-z0-9]{1,}$/)!==null};function Bo(n){return n.length%2==1?"0"+n:n.substr(0,1)>"7"?"00"+n:n}function Wl(n){if(!r0(n))return null;try{var t=[],e=n.substr(0,2),r=parseInt(e,16);t[0]=new String(Math.floor(r/40)),t[1]=new String(r%40);for(var i=n.substr(2),a=[],o=0;o<i.length/2;o++)a.push(parseInt(i.substr(o*2,2),16));for(var s=[],l="",o=0;o<a.length;o++)a[o]&128?l=l+Ro((a[o]&127).toString(2),7):(l=l+Ro((a[o]&127).toString(2),7),s.push(new String(parseInt(l,2))),l="");var u=t.join(".");return s.length>0&&(u=u+"."+s.join(".")),u}catch(d){return null}}var Ro=function(n,t,e){return e==null&&(e="0"),n.length>=t?n:new Array(t-n.length+1).join(e)+n};function Xl(n){try{var t=n.substr(0,2);if(t=="00")return parseInt(n.substr(2),16);var e=parseInt(t,16),r=n.substr(2),i=parseInt(r,16).toString(2);return i=="0"&&(i="00000000"),i=i.slice(0,0-e),parseInt(i,2)}catch(a){return-1}}(typeof re.crypto=="undefined"||!re.crypto)&&(re.crypto={});re.crypto.Util=new function(){this.DIGESTINFOHEAD={sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",ripemd160:"3021300906052b2403020105000414"},this.DEFAULTPROVIDER={md5:"cryptojs",sha1:"cryptojs",sha224:"cryptojs",sha256:"cryptojs",sha384:"cryptojs",sha512:"cryptojs",ripemd160:"cryptojs",hmacmd5:"cryptojs",hmacsha1:"cryptojs",hmacsha224:"cryptojs",hmacsha256:"cryptojs",hmacsha384:"cryptojs",hmacsha512:"cryptojs",hmacripemd160:"cryptojs",MD5withRSA:"cryptojs/jsrsa",SHA1withRSA:"cryptojs/jsrsa",SHA224withRSA:"cryptojs/jsrsa",SHA256withRSA:"cryptojs/jsrsa",SHA384withRSA:"cryptojs/jsrsa",SHA512withRSA:"cryptojs/jsrsa",RIPEMD160withRSA:"cryptojs/jsrsa",MD5withECDSA:"cryptojs/jsrsa",SHA1withECDSA:"cryptojs/jsrsa",SHA224withECDSA:"cryptojs/jsrsa",SHA256withECDSA:"cryptojs/jsrsa",SHA384withECDSA:"cryptojs/jsrsa",SHA512withECDSA:"cryptojs/jsrsa",RIPEMD160withECDSA:"cryptojs/jsrsa",SHA1withDSA:"cryptojs/jsrsa",SHA224withDSA:"cryptojs/jsrsa",SHA256withDSA:"cryptojs/jsrsa",MD5withRSAandMGF1:"cryptojs/jsrsa",SHAwithRSAandMGF1:"cryptojs/jsrsa",SHA1withRSAandMGF1:"cryptojs/jsrsa",SHA224withRSAandMGF1:"cryptojs/jsrsa",SHA256withRSAandMGF1:"cryptojs/jsrsa",SHA384withRSAandMGF1:"cryptojs/jsrsa",SHA512withRSAandMGF1:"cryptojs/jsrsa",RIPEMD160withRSAandMGF1:"cryptojs/jsrsa"},this.CRYPTOJSMESSAGEDIGESTNAME={md5:we.algo.MD5,sha1:we.algo.SHA1,sha224:we.algo.SHA224,sha256:we.algo.SHA256,sha384:we.algo.SHA384,sha512:we.algo.SHA512,ripemd160:we.algo.RIPEMD160},this.hashString=function(n,t){var e=new re.crypto.MessageDigest({alg:t});return e.digestString(n)},this.hashHex=function(n,t){var e=new re.crypto.MessageDigest({alg:t});return e.digestHex(n)},this.sha1=function(n){return this.hashString(n,"sha1")},this.sha256=function(n){return this.hashString(n,"sha256")},this.sha256Hex=function(n){return this.hashHex(n,"sha256")},this.sha512=function(n){return this.hashString(n,"sha512")},this.sha512Hex=function(n){return this.hashHex(n,"sha512")}};re.crypto.MessageDigest=function(n){this.setAlgAndProvider=function(t,e){if(t=re.crypto.MessageDigest.getCanonicalAlgName(t),t!==null&&e===void 0&&(e=re.crypto.Util.DEFAULTPROVIDER[t]),":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(t)!=-1&&e=="cryptojs"){try{this.md=re.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[t].create()}catch(r){throw"setAlgAndProvider hash alg set fail alg="+t+"/"+r}this.updateString=function(r){this.md.update(r)},this.updateHex=function(r){var i=we.enc.Hex.parse(r);this.md.update(i)},this.digest=function(){var r=this.md.finalize();return r.toString(we.enc.Hex)},this.digestString=function(r){return this.updateString(r),this.digest()},this.digestHex=function(r){return this.updateHex(r),this.digest()}}if(":sha256:".indexOf(t)!=-1&&e=="sjcl"){try{this.md=new sjcl.hash.sha256}catch(r){throw"setAlgAndProvider hash alg set fail alg="+t+"/"+r}this.updateString=function(r){this.md.update(r)},this.updateHex=function(r){var i=sjcl.codec.hex.toBits(r);this.md.update(i)},this.digest=function(){var r=this.md.finalize();return sjcl.codec.hex.fromBits(r)},this.digestString=function(r){return this.updateString(r),this.digest()},this.digestHex=function(r){return this.updateHex(r),this.digest()}}},this.updateString=function(t){throw"updateString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.updateHex=function(t){throw"updateHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digest=function(){throw"digest() not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestString=function(t){throw"digestString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestHex=function(t){throw"digestHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},n!==void 0&&n.alg!==void 0&&(this.algName=n.alg,n.prov===void 0&&(this.provName=re.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))};re.crypto.MessageDigest.getCanonicalAlgName=function(n){return typeof n=="string"&&(n=n.toLowerCase(),n=n.replace(/-/,"")),n};re.crypto.MessageDigest.getHashLength=function(n){var t=re.crypto.MessageDigest,e=t.getCanonicalAlgName(n);if(t.HASHLENGTH[e]===void 0)throw"not supported algorithm: "+n;return t.HASHLENGTH[e]};re.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20};re.crypto.Signature=function(n){var t=null;if(this._setAlgNames=function(){var e=this.algName.match(/^(.+)with(.+)$/);e&&(this.mdAlgName=e[1].toLowerCase(),this.pubkeyAlgName=e[2].toLowerCase(),this.pubkeyAlgName=="rsaandmgf1"&&this.mdAlgName=="sha"&&(this.mdAlgName="sha1"))},this._zeroPaddingOfSignature=function(e,r){for(var i="",a=r/4-e.length,o=0;o<a;o++)i=i+"0";return i+e},this.setAlgAndProvider=function(e,r){if(this._setAlgNames(),r!="cryptojs/jsrsa")throw new Error("provider not supported: "+r);if(":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(this.mdAlgName)!=-1){try{this.md=new re.crypto.MessageDigest({alg:this.mdAlgName})}catch(i){throw new Error("setAlgAndProvider hash alg set fail alg="+this.mdAlgName+"/"+i)}this.init=function(i,a){var o=null;try{a===void 0?o=en.getKey(i):o=en.getKey(i,a)}catch(s){throw"init failed:"+s}if(o.isPrivate===!0)this.prvKey=o,this.state="SIGN";else if(o.isPublic===!0)this.pubKey=o,this.state="VERIFY";else throw"init failed.:"+o},this.updateString=function(i){this.md.updateString(i)},this.updateHex=function(i){this.md.updateHex(i)},this.verify=function(i){if(this.sHashHex=this.md.digest(),this.pubKey instanceof ke&&this.pubkeyAlgName==="rsaandmgf1")return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,i,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof ke&&this.pubkeyAlgName==="rsa")return this.pubKey.verifyWithMessageHash(this.sHashHex,i);throw"Signature: unsupported public key alg: "+this.pubkeyAlgName}}},this.init=function(e,r){throw"init(key, pass) not supported for this alg:prov="+this.algProvName},this.updateString=function(e){throw"updateString(str) not supported for this alg:prov="+this.algProvName},this.updateHex=function(e){throw"updateHex(hex) not supported for this alg:prov="+this.algProvName},this.verify=function(e){throw"verify(hSigVal) not supported for this alg:prov="+this.algProvName},this.initParams=n,n!==void 0&&(n.alg!==void 0&&(this.algName=n.alg,n.prov===void 0?this.provName=re.crypto.Util.DEFAULTPROVIDER[this.algName]:this.provName=n.prov,this.algProvName=this.algName+":"+this.provName,this.setAlgAndProvider(this.algName,this.provName),this._setAlgNames()),n.psssaltlen!==void 0&&(this.pssSaltLen=n.psssaltlen),n.prvkeypem!==void 0)){if(n.prvkeypas!==void 0)throw"both prvkeypem and prvkeypas parameters not supported";try{var t=en.getKey(n.prvkeypem);this.init(t)}catch(e){throw"fatal error to load pem private key: "+e}}};re.crypto.OID=new function(){this.oidhex2name={"2a864886f70d010101":"rsaEncryption","2a8648ce3d0201":"ecPublicKey","2a8648ce380401":"dsa","2a8648ce3d030107":"secp256r1","2b8104001f":"secp192k1","2b81040021":"secp224r1","2b8104000a":"secp256k1","2b81040023":"secp521r1","2b81040022":"secp384r1","2a8648ce380403":"SHA1withDSA","608648016503040301":"SHA224withDSA","608648016503040302":"SHA256withDSA"}};var en=function(){var n=function(h,v,y){return r(we.AES,h,v,y)},t=function(h,v,y){return r(we.TripleDES,h,v,y)},e=function(h,v,y){return r(we.DES,h,v,y)},r=function(h,v,y,p){var g=we.enc.Hex.parse(v),x=we.enc.Hex.parse(y),b=we.enc.Hex.parse(p),w={};w.key=x,w.iv=b,w.ciphertext=g;var E=h.decrypt(w,x,{iv:b});return we.enc.Hex.stringify(E)},i=function(h,v,y){return s(we.AES,h,v,y)},a=function(h,v,y){return s(we.TripleDES,h,v,y)},o=function(h,v,y){return s(we.DES,h,v,y)},s=function(h,v,y,p){var g=we.enc.Hex.parse(v),x=we.enc.Hex.parse(y),b=we.enc.Hex.parse(p),w=h.encrypt(g,x,{iv:b}),E=we.enc.Hex.parse(w.toString()),M=we.enc.Base64.stringify(E);return M},l={"AES-256-CBC":{proc:n,eproc:i,keylen:32,ivlen:16},"AES-192-CBC":{proc:n,eproc:i,keylen:24,ivlen:16},"AES-128-CBC":{proc:n,eproc:i,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:t,eproc:a,keylen:24,ivlen:8},"DES-CBC":{proc:e,eproc:o,keylen:8,ivlen:8}},u=function(h){var v=we.lib.WordArray.random(h),y=we.enc.Hex.stringify(v);return y},d=function(h){var v={},y=h.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));y&&(v.cipher=y[1],v.ivsalt=y[2]);var p=h.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));p&&(v.type=p[1]);var g=-1,x=0;h.indexOf(`\r
|
|
347
|
+
`}function rn(n,t){if(n.indexOf("-----BEGIN ")==-1)throw"can't find PEM header: "+t;return t!==void 0?(n=n.replace(new RegExp("^[^]*-----BEGIN "+t+"-----"),""),n=n.replace(new RegExp("-----END "+t+"-----[^]*$"),"")):(n=n.replace(/^[^]*-----BEGIN [^-]+-----/,""),n=n.replace(/-----END [^-]+-----[^]*$/,"")),Gl(n)}function jl(n){return n.replace(/(..)/g,"%$1")}function Jl(n){if(!n.match(/^[0-9A-Fa-f]{32}$/))throw"malformed IPv6 address octet";n=n.toLowerCase();for(var t=n.match(/.{1,4}/g),e=0;e<8;e++)t[e]=t[e].replace(/^0+/,""),t[e]==""&&(t[e]="0");n=":"+t.join(":")+":";var r=n.match(/:(0:){2,}/g);if(r===null)return n.slice(1,-1);for(var i="",e=0;e<r.length;e++)r[e].length>i.length&&(i=r[e]);return n=n.replace(i,"::"),n.slice(1,-1)}function Bo(n){var t="malformed hex value";if(!n.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw t;if(n.length==8){var e;try{return e=parseInt(n.substr(0,2),16)+"."+parseInt(n.substr(2,2),16)+"."+parseInt(n.substr(4,2),16)+"."+parseInt(n.substr(6,2),16),e}catch(r){throw t}}else return n.length==32?Jl(n):n}function Wl(n){function t(i){var a=parseInt(i.substr(0,2),16),o=parseInt(i.substr(2),16);if(a==0&o<128)return String.fromCharCode(o);if(a<8){var s=192|(a&7)<<3|(o&192)>>6,l=128|o&63;return or(s.toString(16)+l.toString(16))}var s=224|(a&240)>>4,l=128|(a&15)<<2|(o&192)>>6,u=128|o&63;return or(s.toString(16)+l.toString(16)+u.toString(16))}var e=n.match(/.{4}/g),r=e.map(t);return r.join("")}re.lang.String.isHex=function(n){return n0(n)};function n0(n){return!!(n.length%2==0&&(n.match(/^[0-9a-f]+$/)||n.match(/^[0-9A-F]+$/)))}re.lang.String.isMail=function(n){return n.match(/^[A-Za-z0-9]{1}[A-Za-z0-9_.-]*@{1}[A-Za-z0-9_.-]{1,}\.[A-Za-z0-9]{1,}$/)!==null};function Ro(n){return n.length%2==1?"0"+n:n.substr(0,1)>"7"?"00"+n:n}function Xl(n){if(!n0(n))return null;try{var t=[],e=n.substr(0,2),r=parseInt(e,16);t[0]=new String(Math.floor(r/40)),t[1]=new String(r%40);for(var i=n.substr(2),a=[],o=0;o<i.length/2;o++)a.push(parseInt(i.substr(o*2,2),16));for(var s=[],l="",o=0;o<a.length;o++)a[o]&128?l=l+ko((a[o]&127).toString(2),7):(l=l+ko((a[o]&127).toString(2),7),s.push(new String(parseInt(l,2))),l="");var u=t.join(".");return s.length>0&&(u=u+"."+s.join(".")),u}catch(d){return null}}var ko=function(n,t,e){return e==null&&(e="0"),n.length>=t?n:new Array(t-n.length+1).join(e)+n};function _l(n){try{var t=n.substr(0,2);if(t=="00")return parseInt(n.substr(2),16);var e=parseInt(t,16),r=n.substr(2),i=parseInt(r,16).toString(2);return i=="0"&&(i="00000000"),i=i.slice(0,0-e),parseInt(i,2)}catch(a){return-1}}(typeof re.crypto=="undefined"||!re.crypto)&&(re.crypto={});re.crypto.Util=new function(){this.DIGESTINFOHEAD={sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",ripemd160:"3021300906052b2403020105000414"},this.DEFAULTPROVIDER={md5:"cryptojs",sha1:"cryptojs",sha224:"cryptojs",sha256:"cryptojs",sha384:"cryptojs",sha512:"cryptojs",ripemd160:"cryptojs",hmacmd5:"cryptojs",hmacsha1:"cryptojs",hmacsha224:"cryptojs",hmacsha256:"cryptojs",hmacsha384:"cryptojs",hmacsha512:"cryptojs",hmacripemd160:"cryptojs",MD5withRSA:"cryptojs/jsrsa",SHA1withRSA:"cryptojs/jsrsa",SHA224withRSA:"cryptojs/jsrsa",SHA256withRSA:"cryptojs/jsrsa",SHA384withRSA:"cryptojs/jsrsa",SHA512withRSA:"cryptojs/jsrsa",RIPEMD160withRSA:"cryptojs/jsrsa",MD5withECDSA:"cryptojs/jsrsa",SHA1withECDSA:"cryptojs/jsrsa",SHA224withECDSA:"cryptojs/jsrsa",SHA256withECDSA:"cryptojs/jsrsa",SHA384withECDSA:"cryptojs/jsrsa",SHA512withECDSA:"cryptojs/jsrsa",RIPEMD160withECDSA:"cryptojs/jsrsa",SHA1withDSA:"cryptojs/jsrsa",SHA224withDSA:"cryptojs/jsrsa",SHA256withDSA:"cryptojs/jsrsa",MD5withRSAandMGF1:"cryptojs/jsrsa",SHAwithRSAandMGF1:"cryptojs/jsrsa",SHA1withRSAandMGF1:"cryptojs/jsrsa",SHA224withRSAandMGF1:"cryptojs/jsrsa",SHA256withRSAandMGF1:"cryptojs/jsrsa",SHA384withRSAandMGF1:"cryptojs/jsrsa",SHA512withRSAandMGF1:"cryptojs/jsrsa",RIPEMD160withRSAandMGF1:"cryptojs/jsrsa"},this.CRYPTOJSMESSAGEDIGESTNAME={md5:we.algo.MD5,sha1:we.algo.SHA1,sha224:we.algo.SHA224,sha256:we.algo.SHA256,sha384:we.algo.SHA384,sha512:we.algo.SHA512,ripemd160:we.algo.RIPEMD160},this.hashString=function(n,t){var e=new re.crypto.MessageDigest({alg:t});return e.digestString(n)},this.hashHex=function(n,t){var e=new re.crypto.MessageDigest({alg:t});return e.digestHex(n)},this.sha1=function(n){return this.hashString(n,"sha1")},this.sha256=function(n){return this.hashString(n,"sha256")},this.sha256Hex=function(n){return this.hashHex(n,"sha256")},this.sha512=function(n){return this.hashString(n,"sha512")},this.sha512Hex=function(n){return this.hashHex(n,"sha512")}};re.crypto.MessageDigest=function(n){this.setAlgAndProvider=function(t,e){if(t=re.crypto.MessageDigest.getCanonicalAlgName(t),t!==null&&e===void 0&&(e=re.crypto.Util.DEFAULTPROVIDER[t]),":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(t)!=-1&&e=="cryptojs"){try{this.md=re.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[t].create()}catch(r){throw"setAlgAndProvider hash alg set fail alg="+t+"/"+r}this.updateString=function(r){this.md.update(r)},this.updateHex=function(r){var i=we.enc.Hex.parse(r);this.md.update(i)},this.digest=function(){var r=this.md.finalize();return r.toString(we.enc.Hex)},this.digestString=function(r){return this.updateString(r),this.digest()},this.digestHex=function(r){return this.updateHex(r),this.digest()}}if(":sha256:".indexOf(t)!=-1&&e=="sjcl"){try{this.md=new sjcl.hash.sha256}catch(r){throw"setAlgAndProvider hash alg set fail alg="+t+"/"+r}this.updateString=function(r){this.md.update(r)},this.updateHex=function(r){var i=sjcl.codec.hex.toBits(r);this.md.update(i)},this.digest=function(){var r=this.md.finalize();return sjcl.codec.hex.fromBits(r)},this.digestString=function(r){return this.updateString(r),this.digest()},this.digestHex=function(r){return this.updateHex(r),this.digest()}}},this.updateString=function(t){throw"updateString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.updateHex=function(t){throw"updateHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digest=function(){throw"digest() not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestString=function(t){throw"digestString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestHex=function(t){throw"digestHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},n!==void 0&&n.alg!==void 0&&(this.algName=n.alg,n.prov===void 0&&(this.provName=re.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))};re.crypto.MessageDigest.getCanonicalAlgName=function(n){return typeof n=="string"&&(n=n.toLowerCase(),n=n.replace(/-/,"")),n};re.crypto.MessageDigest.getHashLength=function(n){var t=re.crypto.MessageDigest,e=t.getCanonicalAlgName(n);if(t.HASHLENGTH[e]===void 0)throw"not supported algorithm: "+n;return t.HASHLENGTH[e]};re.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20};re.crypto.Signature=function(n){var t=null;if(this._setAlgNames=function(){var e=this.algName.match(/^(.+)with(.+)$/);e&&(this.mdAlgName=e[1].toLowerCase(),this.pubkeyAlgName=e[2].toLowerCase(),this.pubkeyAlgName=="rsaandmgf1"&&this.mdAlgName=="sha"&&(this.mdAlgName="sha1"))},this._zeroPaddingOfSignature=function(e,r){for(var i="",a=r/4-e.length,o=0;o<a;o++)i=i+"0";return i+e},this.setAlgAndProvider=function(e,r){if(this._setAlgNames(),r!="cryptojs/jsrsa")throw new Error("provider not supported: "+r);if(":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(this.mdAlgName)!=-1){try{this.md=new re.crypto.MessageDigest({alg:this.mdAlgName})}catch(i){throw new Error("setAlgAndProvider hash alg set fail alg="+this.mdAlgName+"/"+i)}this.init=function(i,a){var o=null;try{a===void 0?o=en.getKey(i):o=en.getKey(i,a)}catch(s){throw"init failed:"+s}if(o.isPrivate===!0)this.prvKey=o,this.state="SIGN";else if(o.isPublic===!0)this.pubKey=o,this.state="VERIFY";else throw"init failed.:"+o},this.updateString=function(i){this.md.updateString(i)},this.updateHex=function(i){this.md.updateHex(i)},this.verify=function(i){if(this.sHashHex=this.md.digest(),this.pubKey instanceof ke&&this.pubkeyAlgName==="rsaandmgf1")return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,i,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof ke&&this.pubkeyAlgName==="rsa")return this.pubKey.verifyWithMessageHash(this.sHashHex,i);throw"Signature: unsupported public key alg: "+this.pubkeyAlgName}}},this.init=function(e,r){throw"init(key, pass) not supported for this alg:prov="+this.algProvName},this.updateString=function(e){throw"updateString(str) not supported for this alg:prov="+this.algProvName},this.updateHex=function(e){throw"updateHex(hex) not supported for this alg:prov="+this.algProvName},this.verify=function(e){throw"verify(hSigVal) not supported for this alg:prov="+this.algProvName},this.initParams=n,n!==void 0&&(n.alg!==void 0&&(this.algName=n.alg,n.prov===void 0?this.provName=re.crypto.Util.DEFAULTPROVIDER[this.algName]:this.provName=n.prov,this.algProvName=this.algName+":"+this.provName,this.setAlgAndProvider(this.algName,this.provName),this._setAlgNames()),n.psssaltlen!==void 0&&(this.pssSaltLen=n.psssaltlen),n.prvkeypem!==void 0)){if(n.prvkeypas!==void 0)throw"both prvkeypem and prvkeypas parameters not supported";try{var t=en.getKey(n.prvkeypem);this.init(t)}catch(e){throw"fatal error to load pem private key: "+e}}};re.crypto.OID=new function(){this.oidhex2name={"2a864886f70d010101":"rsaEncryption","2a8648ce3d0201":"ecPublicKey","2a8648ce380401":"dsa","2a8648ce3d030107":"secp256r1","2b8104001f":"secp192k1","2b81040021":"secp224r1","2b8104000a":"secp256k1","2b81040023":"secp521r1","2b81040022":"secp384r1","2a8648ce380403":"SHA1withDSA","608648016503040301":"SHA224withDSA","608648016503040302":"SHA256withDSA"}};var en=function(){var n=function(h,v,y){return r(we.AES,h,v,y)},t=function(h,v,y){return r(we.TripleDES,h,v,y)},e=function(h,v,y){return r(we.DES,h,v,y)},r=function(h,v,y,p){var g=we.enc.Hex.parse(v),x=we.enc.Hex.parse(y),b=we.enc.Hex.parse(p),w={};w.key=x,w.iv=b,w.ciphertext=g;var E=h.decrypt(w,x,{iv:b});return we.enc.Hex.stringify(E)},i=function(h,v,y){return s(we.AES,h,v,y)},a=function(h,v,y){return s(we.TripleDES,h,v,y)},o=function(h,v,y){return s(we.DES,h,v,y)},s=function(h,v,y,p){var g=we.enc.Hex.parse(v),x=we.enc.Hex.parse(y),b=we.enc.Hex.parse(p),w=h.encrypt(g,x,{iv:b}),E=we.enc.Hex.parse(w.toString()),M=we.enc.Base64.stringify(E);return M},l={"AES-256-CBC":{proc:n,eproc:i,keylen:32,ivlen:16},"AES-192-CBC":{proc:n,eproc:i,keylen:24,ivlen:16},"AES-128-CBC":{proc:n,eproc:i,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:t,eproc:a,keylen:24,ivlen:8},"DES-CBC":{proc:e,eproc:o,keylen:8,ivlen:8}},u=function(h){var v=we.lib.WordArray.random(h),y=we.enc.Hex.stringify(v);return y},d=function(h){var v={},y=h.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));y&&(v.cipher=y[1],v.ivsalt=y[2]);var p=h.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));p&&(v.type=p[1]);var g=-1,x=0;h.indexOf(`\r
|
|
348
348
|
\r
|
|
349
349
|
`)!=-1&&(g=h.indexOf(`\r
|
|
350
350
|
\r
|
|
@@ -359,7 +359,7 @@
|
|
|
359
359
|
`,P+=`\r
|
|
360
360
|
`,P+=C,P+=`\r
|
|
361
361
|
-----END `+h+` PRIVATE KEY-----\r
|
|
362
|
-
`,P},parseHexOfEncryptedPKCS8:function(h){var v=se,y=v.getChildIdx,p=v.getV,g={},x=y(h,0);if(x.length!=2)throw"malformed format: SEQUENCE(0).items != 2: "+x.length;g.ciphertext=p(h,x[1]);var b=y(h,x[0]);if(b.length!=2)throw"malformed format: SEQUENCE(0.0).items != 2: "+b.length;if(p(h,b[0])!="2a864886f70d01050d")throw"this only supports pkcs5PBES2";var w=y(h,b[1]);if(b.length!=2)throw"malformed format: SEQUENCE(0.0.1).items != 2: "+w.length;var E=y(h,w[1]);if(E.length!=2)throw"malformed format: SEQUENCE(0.0.1.1).items != 2: "+E.length;if(p(h,E[0])!="2a864886f70d0307")throw"this only supports TripleDES";g.encryptionSchemeAlg="TripleDES",g.encryptionSchemeIV=p(h,E[1]);var M=y(h,w[0]);if(M.length!=2)throw"malformed format: SEQUENCE(0.0.1.0).items != 2: "+M.length;if(p(h,M[0])!="2a864886f70d01050c")throw"this only supports pkcs5PBKDF2";var C=y(h,M[1]);if(C.length<2)throw"malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+C.length;g.pbkdf2Salt=p(h,C[0]);var P=p(h,C[1]);try{g.pbkdf2Iter=parseInt(P,16)}catch(S){throw"malformed format pbkdf2Iter: "+P}return g},getPBKDF2KeyHexFromParam:function(h,v){var y=we.enc.Hex.parse(h.pbkdf2Salt),p=h.pbkdf2Iter,g=we.PBKDF2(v,y,{keySize:192/32,iterations:p}),x=we.enc.Hex.stringify(g);return x},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(h,v){var y=rn(h,"ENCRYPTED PRIVATE KEY"),p=this.parseHexOfEncryptedPKCS8(y),g=en.getPBKDF2KeyHexFromParam(p,v),x={};x.ciphertext=we.enc.Hex.parse(p.ciphertext);var b=we.enc.Hex.parse(g),w=we.enc.Hex.parse(p.encryptionSchemeIV),E=we.TripleDES.decrypt(x,b,{iv:w}),M=we.enc.Hex.stringify(E);return M},getKeyFromEncryptedPKCS8PEM:function(h,v){var y=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(h,v),p=this.getKeyFromPlainPrivatePKCS8Hex(y);return p},parsePlainPrivatePKCS8Hex:function(h){var v=se,y=v.getChildIdx,p=v.getV,g={};if(g.algparam=null,h.substr(0,2)!="30")throw new Error("malformed plain PKCS8 private key(code:001)");var x=y(h,0);if(x.length<3)throw new Error("malformed plain PKCS8 private key(code:002)");if(h.substr(x[1],2)!="30")throw new Error("malformed PKCS8 private key(code:003)");var b=y(h,x[1]);if(b.length!=2)throw new Error("malformed PKCS8 private key(code:004)");if(h.substr(b[0],2)!="06")throw new Error("malformed PKCS8 private key(code:005)");if(g.algoid=p(h,b[0]),h.substr(b[1],2)=="06"&&(g.algparam=p(h,b[1])),h.substr(x[2],2)!="04")throw new Error("malformed PKCS8 private key(code:006)");return g.keyidx=v.getVidx(h,x[2]),g},getKeyFromPlainPrivatePKCS8PEM:function(h){var v=rn(h,"PRIVATE KEY"),y=this.getKeyFromPlainPrivatePKCS8Hex(v);return y},getKeyFromPlainPrivatePKCS8Hex:function(h){var v=this.parsePlainPrivatePKCS8Hex(h),y;if(v.algoid=="2a864886f70d010101")y=new ke;else if(re.crypto.DSA&&v.algoid=="2a8648ce380401")y=new re.crypto.DSA;else if(re.crypto.ECDSA&&v.algoid=="2a8648ce3d0201")y=new re.crypto.ECDSA;else throw"unsupported private key algorithm";return y.readPKCS8PrvKeyHex(h),y},_getKeyFromPublicPKCS8Hex:function(h){var v,y=se.getVbyList(h,0,[0,0],"06");if(y==="2a864886f70d010101")v=new ke;else if(re.crypto.DSA&&y==="2a8648ce380401")v=new re.crypto.DSA;else if(re.crypto.ECDSA&&y==="2a8648ce3d0201")v=new re.crypto.ECDSA;else throw"unsupported PKCS#8 public key hex";return v.readPKCS8PubKeyHex(h),v},parsePublicRawRSAKeyHex:function(h){var v=se,y=v.getChildIdx,p=v.getV,g={};if(h.substr(0,2)!="30")throw"malformed RSA key(code:001)";var x=y(h,0);if(x.length!=2)throw"malformed RSA key(code:002)";if(h.substr(x[0],2)!="02")throw"malformed RSA key(code:003)";if(g.n=p(h,x[0]),h.substr(x[1],2)!="02")throw"malformed RSA key(code:004)";return g.e=p(h,x[1]),g},parsePublicPKCS8Hex:function(h){var v=se,y=v.getChildIdx,p=v.getV,g={};g.algparam=null;var x=y(h,0);if(x.length!=2)throw"outer DERSequence shall have 2 elements: "+x.length;var b=x[0];if(h.substr(b,2)!="30")throw"malformed PKCS8 public key(code:001)";var w=y(h,b);if(w.length!=2)throw"malformed PKCS8 public key(code:002)";if(h.substr(w[0],2)!="06")throw"malformed PKCS8 public key(code:003)";if(g.algoid=p(h,w[0]),h.substr(w[1],2)=="06"?g.algparam=p(h,w[1]):h.substr(w[1],2)=="30"&&(g.algparam={},g.algparam.p=v.getVbyList(h,w[1],[0],"02"),g.algparam.q=v.getVbyList(h,w[1],[1],"02"),g.algparam.g=v.getVbyList(h,w[1],[2],"02")),h.substr(x[1],2)!="03")throw"malformed PKCS8 public key(code:004)";return g.key=p(h,x[1]).substr(2),g}}}();en.getKey=function(n,t,e){var r=se,i=r.getChildIdx;r.getV;var a=r.getVbyList,o=re.crypto,s=o.ECDSA,l=o.DSA,u=ke,d=rn,f=en;if(typeof u!="undefined"&&n instanceof u||typeof s!="undefined"&&n instanceof s||typeof l!="undefined"&&n instanceof l)return n;if(n.curve!==void 0&&n.xy!==void 0&&n.d===void 0)return new s({pub:n.xy,curve:n.curve});if(n.curve!==void 0&&n.d!==void 0)return new s({prv:n.d,curve:n.curve});if(n.kty===void 0&&n.n!==void 0&&n.e!==void 0&&n.d===void 0){var A=new u;return A.setPublic(n.n,n.e),A}if(n.kty===void 0&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0&&n.p!==void 0&&n.q!==void 0&&n.dp!==void 0&&n.dq!==void 0&&n.co!==void 0&&n.qi===void 0){var A=new u;return A.setPrivateEx(n.n,n.e,n.d,n.p,n.q,n.dp,n.dq,n.co),A}if(n.kty===void 0&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0&&n.p===void 0){var A=new u;return A.setPrivate(n.n,n.e,n.d),A}if(n.p!==void 0&&n.q!==void 0&&n.g!==void 0&&n.y!==void 0&&n.x===void 0){var A=new l;return A.setPublic(n.p,n.q,n.g,n.y),A}if(n.p!==void 0&&n.q!==void 0&&n.g!==void 0&&n.y!==void 0&&n.x!==void 0){var A=new l;return A.setPrivate(n.p,n.q,n.g,n.y,n.x),A}if(n.kty==="RSA"&&n.n!==void 0&&n.e!==void 0&&n.d===void 0){var A=new u;return A.setPublic(tt(n.n),tt(n.e)),A}if(n.kty==="RSA"&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0&&n.p!==void 0&&n.q!==void 0&&n.dp!==void 0&&n.dq!==void 0&&n.qi!==void 0){var A=new u;return A.setPrivateEx(tt(n.n),tt(n.e),tt(n.d),tt(n.p),tt(n.q),tt(n.dp),tt(n.dq),tt(n.qi)),A}if(n.kty==="RSA"&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0){var A=new u;return A.setPrivate(tt(n.n),tt(n.e),tt(n.d)),A}if(n.kty==="EC"&&n.crv!==void 0&&n.x!==void 0&&n.y!==void 0&&n.d===void 0){var m=new s({curve:n.crv}),h=m.ecparams.keylen/4,v=("0000000000"+tt(n.x)).slice(-h),y=("0000000000"+tt(n.y)).slice(-h),p="04"+v+y;return m.setPublicKeyHex(p),m}if(n.kty==="EC"&&n.crv!==void 0&&n.x!==void 0&&n.y!==void 0&&n.d!==void 0){var m=new s({curve:n.crv}),h=m.ecparams.keylen/4,v=("0000000000"+tt(n.x)).slice(-h),y=("0000000000"+tt(n.y)).slice(-h),p="04"+v+y,g=("0000000000"+tt(n.d)).slice(-h);return m.setPublicKeyHex(p),m.setPrivateKeyHex(g),m}if(e==="pkcs5prv"){var x=n,r=se,b,A;if(b=i(x,0),b.length===9)A=new u,A.readPKCS5PrvKeyHex(x);else if(b.length===6)A=new l,A.readPKCS5PrvKeyHex(x);else if(b.length>2&&x.substr(b[1],2)==="04")A=new s,A.readPKCS5PrvKeyHex(x);else throw"unsupported PKCS#1/5 hexadecimal key";return A}if(e==="pkcs8prv"){var A=f.getKeyFromPlainPrivatePKCS8Hex(n);return A}if(e==="pkcs8pub")return f._getKeyFromPublicPKCS8Hex(n);if(e==="x509pub")return Ke.getPublicKeyFromCertHex(n);if(n.indexOf("-END CERTIFICATE-",0)!=-1||n.indexOf("-END X509 CERTIFICATE-",0)!=-1||n.indexOf("-END TRUSTED CERTIFICATE-",0)!=-1)return Ke.getPublicKeyFromCertPEM(n);if(n.indexOf("-END PUBLIC KEY-")!=-1){var w=rn(n,"PUBLIC KEY");return f._getKeyFromPublicPKCS8Hex(w)}if(n.indexOf("-END RSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var E=d(n,"RSA PRIVATE KEY");return f.getKey(E,null,"pkcs5prv")}if(n.indexOf("-END DSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var M=d(n,"DSA PRIVATE KEY"),C=a(M,0,[1],"02"),P=a(M,0,[2],"02"),S=a(M,0,[3],"02"),T=a(M,0,[4],"02"),B=a(M,0,[5],"02"),A=new l;return A.setPrivate(new fe(C,16),new fe(P,16),new fe(S,16),new fe(T,16),new fe(B,16)),A}if(n.indexOf("-END EC PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var E=d(n,"EC PRIVATE KEY");return f.getKey(E,null,"pkcs5prv")}if(n.indexOf("-END PRIVATE KEY-")!=-1)return f.getKeyFromPlainPrivatePKCS8PEM(n);if(n.indexOf("-END RSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")!=-1){var L=f.getDecryptedKeyHex(n,t),k=new ke;return k.readPKCS5PrvKeyHex(L),k}if(n.indexOf("-END EC PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")!=-1){var M=f.getDecryptedKeyHex(n,t),A=a(M,0,[1],"04"),O=a(M,0,[2,0],"06"),D=a(M,0,[3,0],"03").substr(2),N="";if(re.crypto.OID.oidhex2name[O]!==void 0)N=re.crypto.OID.oidhex2name[O];else throw"undefined OID(hex) in KJUR.crypto.OID: "+O;var m=new s({curve:N});return m.setPublicKeyHex(D),m.setPrivateKeyHex(A),m.isPublic=!1,m}if(n.indexOf("-END DSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")!=-1){var M=f.getDecryptedKeyHex(n,t),C=a(M,0,[1],"02"),P=a(M,0,[2],"02"),S=a(M,0,[3],"02"),T=a(M,0,[4],"02"),B=a(M,0,[5],"02"),A=new l;return A.setPrivate(new fe(C,16),new fe(P,16),new fe(S,16),new fe(T,16),new fe(B,16)),A}if(n.indexOf("-END ENCRYPTED PRIVATE KEY-")!=-1)return f.getKeyFromEncryptedPKCS8PEM(n,t);throw new Error("not supported argument")};(typeof re.asn1=="undefined"||!re.asn1)&&(re.asn1={});re.asn1.ASN1Util={};re.asn1.ASN1Util.oidHexToInt=function(n){for(var i="",t=parseInt(n.substr(0,2),16),e=Math.floor(t/40),r=t%40,i=e+"."+r,a="",o=2;o<n.length;o+=2){var s=parseInt(n.substr(o,2),16),l=("00000000"+s.toString(2)).slice(-8);if(a=a+l.substr(1,7),l.substr(0,1)=="0"){var u=new fe(a,2);i=i+"."+u.toString(10),a=""}}return i};var se=new function(){};se.getLblen=function(n,t){if(n.substr(t+2,1)!="8")return 1;var e=parseInt(n.substr(t+3,1));return e==0?-1:0<e&&e<10?e+1:-2};se.getL=function(n,t){var e=se.getLblen(n,t);return e<1?"":n.substr(t+2,e*2)};se.getVblen=function(n,t){var e,r;return e=se.getL(n,t),e==""?-1:(e.substr(0,1)==="8"?r=new fe(e.substr(2),16):r=new fe(e,16),r.intValue())};se.getVidx=function(n,t){var e=se.getLblen(n,t);return e<0?e:t+(e+1)*2};se.getV=function(n,t){var e=se.getVidx(n,t),r=se.getVblen(n,t);return n.substr(e,r*2)};se.getTLV=function(n,t){return n.substr(t,2)+se.getL(n,t)+se.getV(n,t)};se.getTLVblen=function(n,t){return 2+se.getLblen(n,t)*2+se.getVblen(n,t)*2};se.getNextSiblingIdx=function(n,t){var e=se.getVidx(n,t),r=se.getVblen(n,t);return e+r*2};se.getChildIdx=function(n,t){var e=se,r=[],i,a,o;i=e.getVidx(n,t),a=e.getVblen(n,t)*2,n.substr(t,2)=="03"&&(i+=2,a-=2),o=0;for(var s=i;o<=a;){var l=e.getTLVblen(n,s);if(o+=l,o<=a&&r.push(s),s+=l,o>=a)break}return r};se.getNthChildIdx=function(n,t,e){var r=se.getChildIdx(n,t);return r[e]};se.getIdxbyList=function(n,t,e,r){var i=se,a,o;return e.length==0?r!==void 0&&n.substr(t,2)!==r?-1:t:(a=e.shift(),o=i.getChildIdx(n,t),a>=o.length?-1:i.getIdxbyList(n,o[a],e,r))};se.getIdxbyListEx=function(n,t,e,r){var i=se,a,o;if(e.length==0)return r!==void 0&&n.substr(t,2)!==r?-1:t;a=e.shift(),o=i.getChildIdx(n,t);for(var s=0,l=0;l<o.length;l++){var u=n.substr(o[l],2);if(typeof a=="number"&&!i.isContextTag(u)&&s==a||typeof a=="string"&&i.isContextTag(u,a))return i.getIdxbyListEx(n,o[l],e,r);i.isContextTag(u)||s++}return-1};se.getTLVbyList=function(n,t,e,r){var i=se,a=i.getIdxbyList(n,t,e,r);return a==-1||a>=n.length?null:i.getTLV(n,a)};se.getTLVbyListEx=function(n,t,e,r){var i=se,a=i.getIdxbyListEx(n,t,e,r);return a==-1?null:i.getTLV(n,a)};se.getVbyList=function(n,t,e,r,i){var a=se,o,s;return o=a.getIdxbyList(n,t,e,r),o==-1||o>=n.length?null:(s=a.getV(n,o),i===!0&&(s=s.substr(2)),s)};se.getVbyListEx=function(n,t,e,r,i){var a=se,o,s;return o=a.getIdxbyListEx(n,t,e,r),o==-1?null:(s=a.getV(n,o),n.substr(o,2)=="03"&&i!==!1&&(s=s.substr(2)),s)};se.getInt=function(n,t,e){e==null&&(e=-1);try{var r=n.substr(t,2);if(r!="02"&&r!="03")return e;var i=se.getV(n,t);return r=="02"?parseInt(i,16):Xl(i)}catch(a){return e}};se.getOID=function(n,t,e){e==null&&(e=null);try{if(n.substr(t,2)!="06")return e;var r=se.getV(n,t);return Wl(r)}catch(i){return e}};se.getOIDName=function(n,t,e){e==null&&(e=null);try{var r=se.getOID(n,t,e);if(r==e)return e;var i=re.asn1.x509.OID.oid2name(r);return i==""?r:i}catch(a){return e}};se.getString=function(n,t,e){e==null&&(e=null);try{var r=se.getV(n,t);return xr(r)}catch(i){return e}};se.hextooidstr=function(n){var t=function(f,A){return f.length>=A?f:new Array(A-f.length+1).join("0")+f},e=[],r=n.substr(0,2),i=parseInt(r,16);e[0]=new String(Math.floor(i/40)),e[1]=new String(i%40);for(var a=n.substr(2),o=[],s=0;s<a.length/2;s++)o.push(parseInt(a.substr(s*2,2),16));for(var l=[],u="",s=0;s<o.length;s++)o[s]&128?u=u+t((o[s]&127).toString(2),7):(u=u+t((o[s]&127).toString(2),7),l.push(new String(parseInt(u,2))),u="");var d=e.join(".");return l.length>0&&(d=d+"."+l.join(".")),d};se.isContextTag=function(n,t){n=n.toLowerCase();var e,r;try{e=parseInt(n,16)}catch(a){return-1}if(t===void 0)return(e&192)==128;try{var i=t.match(/^\[[0-9]+\]$/);return i==null||(r=parseInt(t.substr(1,t.length-1),10),r>31)?!1:(e&192)==128&&(e&31)==r}catch(a){return!1}};se.isASN1HEX=function(n){var t=se;if(n.length%2==1)return!1;var e=t.getVblen(n,0),r=n.substr(0,2),i=t.getL(n,0),a=n.length-r.length-i.length;return a==e*2};se.checkStrictDER=function(n,t,e,r,i){var a=se;if(e===void 0){if(typeof n!="string")throw new Error("not hex string");if(n=n.toLowerCase(),!re.lang.String.isHex(n))throw new Error("not hex string");e=n.length,r=n.length/2,r<128?i=1:i=Math.ceil(r.toString(16))+1}var o=a.getL(n,t);if(o.length>i*2)throw new Error("L of TLV too long: idx="+t);var s=a.getVblen(n,t);if(s>r)throw new Error("value of L too long than hex: idx="+t);var l=a.getTLV(n,t),u=l.length-2-a.getL(n,t).length;if(u!==s*2)throw new Error("V string length and L's value not the same:"+u+"/"+s*2);if(t===0&&n.length!=l.length)throw new Error("total length and TLV length unmatch:"+n.length+"!="+l.length);var d=n.substr(t,2);if(d==="02"){var f=a.getVidx(n,t);if(n.substr(f,2)=="00"&&n.charCodeAt(f+2)<56)throw new Error("not least zeros for DER INTEGER")}if(parseInt(d,16)&32){for(var A=a.getVblen(n,t),m=0,h=a.getChildIdx(n,t),v=0;v<h.length;v++){var y=a.getTLV(n,h[v]);m+=y.length,a.checkStrictDER(n,h[v],e,r,i)}if(A*2!=m)throw new Error("sum of children's TLV length and L unmatch: "+A*2+"!="+m)}};se.oidname=function(n){var t=re.asn1;re.lang.String.isHex(n)&&(n=t.ASN1Util.oidHexToInt(n));var e=t.x509.OID.oid2name(n);return e===""&&(e=n),e};(typeof re.asn1=="undefined"||!re.asn1)&&(re.asn1={});(typeof re.asn1.x509=="undefined"||!re.asn1.x509)&&(re.asn1.x509={});re.asn1.x509.AlgorithmIdentifier={};re.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"};re.asn1.x509.OID=new function(n){this.atype2oidList={CN:"2.5.4.3",L:"2.5.4.7",ST:"2.5.4.8",O:"2.5.4.10",OU:"2.5.4.11",C:"2.5.4.6",STREET:"2.5.4.9",DC:"0.9.2342.19200300.100.1.25",UID:"0.9.2342.19200300.100.1.1",SN:"2.5.4.4",T:"2.5.4.12",DN:"2.5.4.49",E:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",serialNumber:"2.5.4.5",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3"},this.name2oidList={sha1:"1.3.14.3.2.26",sha256:"2.16.840.1.101.3.4.2.1",sha384:"2.16.840.1.101.3.4.2.2",sha512:"2.16.840.1.101.3.4.2.3",sha224:"2.16.840.1.101.3.4.2.4",md5:"1.2.840.113549.2.5",md2:"1.3.14.7.2.2.1",ripemd160:"1.3.36.3.2.1",MD2withRSA:"1.2.840.113549.1.1.2",MD4withRSA:"1.2.840.113549.1.1.3",MD5withRSA:"1.2.840.113549.1.1.4",SHA1withRSA:"1.2.840.113549.1.1.5","pkcs1-MGF":"1.2.840.113549.1.1.8",rsaPSS:"1.2.840.113549.1.1.10",SHA224withRSA:"1.2.840.113549.1.1.14",SHA256withRSA:"1.2.840.113549.1.1.11",SHA384withRSA:"1.2.840.113549.1.1.12",SHA512withRSA:"1.2.840.113549.1.1.13",SHA1withECDSA:"1.2.840.10045.4.1",SHA224withECDSA:"1.2.840.10045.4.3.1",SHA256withECDSA:"1.2.840.10045.4.3.2",SHA384withECDSA:"1.2.840.10045.4.3.3",SHA512withECDSA:"1.2.840.10045.4.3.4",dsa:"1.2.840.10040.4.1",SHA1withDSA:"1.2.840.10040.4.3",SHA224withDSA:"2.16.840.1.101.3.4.3.1",SHA256withDSA:"2.16.840.1.101.3.4.3.2",rsaEncryption:"1.2.840.113549.1.1.1",commonName:"2.5.4.3",countryName:"2.5.4.6",localityName:"2.5.4.7",stateOrProvinceName:"2.5.4.8",streetAddress:"2.5.4.9",organizationName:"2.5.4.10",organizationalUnitName:"2.5.4.11",domainComponent:"0.9.2342.19200300.100.1.25",userId:"0.9.2342.19200300.100.1.1",surname:"2.5.4.4",givenName:"2.5.4.42",title:"2.5.4.12",distinguishedName:"2.5.4.49",emailAddress:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3",subjectDirectoryAttributes:"2.5.29.9",subjectKeyIdentifier:"2.5.29.14",keyUsage:"2.5.29.15",subjectAltName:"2.5.29.17",issuerAltName:"2.5.29.18",basicConstraints:"2.5.29.19",cRLNumber:"2.5.29.20",cRLReason:"2.5.29.21",nameConstraints:"2.5.29.30",cRLDistributionPoints:"2.5.29.31",certificatePolicies:"2.5.29.32",anyPolicy:"2.5.29.32.0",authorityKeyIdentifier:"2.5.29.35",policyConstraints:"2.5.29.36",extKeyUsage:"2.5.29.37",authorityInfoAccess:"1.3.6.1.5.5.7.1.1",ocsp:"1.3.6.1.5.5.7.48.1",ocspBasic:"1.3.6.1.5.5.7.48.1.1",ocspNonce:"1.3.6.1.5.5.7.48.1.2",ocspNoCheck:"1.3.6.1.5.5.7.48.1.5",caIssuers:"1.3.6.1.5.5.7.48.2",anyExtendedKeyUsage:"2.5.29.37.0",serverAuth:"1.3.6.1.5.5.7.3.1",clientAuth:"1.3.6.1.5.5.7.3.2",codeSigning:"1.3.6.1.5.5.7.3.3",emailProtection:"1.3.6.1.5.5.7.3.4",timeStamping:"1.3.6.1.5.5.7.3.8",ocspSigning:"1.3.6.1.5.5.7.3.9",dateOfBirth:"1.3.6.1.5.5.7.9.1",placeOfBirth:"1.3.6.1.5.5.7.9.2",gender:"1.3.6.1.5.5.7.9.3",countryOfCitizenship:"1.3.6.1.5.5.7.9.4",countryOfResidence:"1.3.6.1.5.5.7.9.5",ecPublicKey:"1.2.840.10045.2.1","P-256":"1.2.840.10045.3.1.7",secp256r1:"1.2.840.10045.3.1.7",secp256k1:"1.3.132.0.10",secp384r1:"1.3.132.0.34",pkcs5PBES2:"1.2.840.113549.1.5.13",pkcs5PBKDF2:"1.2.840.113549.1.5.12","des-EDE3-CBC":"1.2.840.113549.3.7",data:"1.2.840.113549.1.7.1","signed-data":"1.2.840.113549.1.7.2","enveloped-data":"1.2.840.113549.1.7.3","digested-data":"1.2.840.113549.1.7.5","encrypted-data":"1.2.840.113549.1.7.6","authenticated-data":"1.2.840.113549.1.9.16.1.2",tstinfo:"1.2.840.113549.1.9.16.1.4",signingCertificate:"1.2.840.113549.1.9.16.2.12",timeStampToken:"1.2.840.113549.1.9.16.2.14",signaturePolicyIdentifier:"1.2.840.113549.1.9.16.2.15",etsArchiveTimeStamp:"1.2.840.113549.1.9.16.2.27",signingCertificateV2:"1.2.840.113549.1.9.16.2.47",etsArchiveTimeStampV2:"1.2.840.113549.1.9.16.2.48",extensionRequest:"1.2.840.113549.1.9.14",contentType:"1.2.840.113549.1.9.3",messageDigest:"1.2.840.113549.1.9.4",signingTime:"1.2.840.113549.1.9.5",counterSignature:"1.2.840.113549.1.9.6",archiveTimeStampV3:"0.4.0.1733.2.4",pdfRevocationInfoArchival:"1.2.840.113583.1.1.8",adobeTimeStamp:"1.2.840.113583.1.1.9.1"},this.objCache={},this.name2obj=function(t){if(typeof this.objCache[t]!="undefined")return this.objCache[t];if(typeof this.name2oidList[t]=="undefined")throw"Name of ObjectIdentifier not defined: "+t;var e=this.name2oidList[t],r=new re.asn1.DERObjectIdentifier({oid:e});return this.objCache[t]=r,r},this.atype2obj=function(t){if(this.objCache[t]!==void 0)return this.objCache[t];var e;if(t.match(/^\d+\.\d+\.[0-9.]+$/))e=t;else if(this.atype2oidList[t]!==void 0)e=this.atype2oidList[t];else if(this.name2oidList[t]!==void 0)e=this.name2oidList[t];else throw"AttributeType name undefined: "+t;var r=new re.asn1.DERObjectIdentifier({oid:e});return this.objCache[t]=r,r}};re.asn1.x509.OID.oid2name=function(n){var t=re.asn1.x509.OID.name2oidList;for(var e in t)if(t[e]==n)return e;return""};re.asn1.x509.OID.oid2atype=function(n){var t=re.asn1.x509.OID.atype2oidList;for(var e in t)if(t[e]==n)return e;return n};re.asn1.x509.OID.name2oid=function(n){if(n.match(/^[0-9.]+$/))return n;var t=re.asn1.x509.OID.name2oidList;return t[n]===void 0?"":t[n]};ke.getPosArrayOfChildrenFromHex=function(n){return se.getChildIdx(n,0)};ke.getHexValueArrayOfChildrenFromHex=function(n){var t=se,e=t.getV,A=ke.getPosArrayOfChildrenFromHex(n),r=e(n,A[0]),i=e(n,A[1]),a=e(n,A[2]),o=e(n,A[3]),s=e(n,A[4]),l=e(n,A[5]),u=e(n,A[6]),d=e(n,A[7]),f=e(n,A[8]),A=new Array;return A.push(r,i,a,o,s,l,u,d,f),A};ke.prototype.readPrivateKeyFromPEMString=function(n){var t=rn(n),e=ke.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])};ke.prototype.readPKCS5PrvKeyHex=function(n){var t=ke.getHexValueArrayOfChildrenFromHex(n);this.setPrivateEx(t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])};ke.prototype.readPKCS8PrvKeyHex=function(n){var t,e,r,i,a,o,s,l,u=se,d=u.getVbyListEx;if(u.isASN1HEX(n)===!1)throw new Error("not ASN.1 hex string");try{t=d(n,0,[2,0,1],"02"),e=d(n,0,[2,0,2],"02"),r=d(n,0,[2,0,3],"02"),i=d(n,0,[2,0,4],"02"),a=d(n,0,[2,0,5],"02"),o=d(n,0,[2,0,6],"02"),s=d(n,0,[2,0,7],"02"),l=d(n,0,[2,0,8],"02")}catch(f){throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(t,e,r,i,a,o,s,l)};ke.prototype.readPKCS5PubKeyHex=function(n){var t=se,e=t.getV;if(t.isASN1HEX(n)===!1)throw new Error("keyHex is not ASN.1 hex string");var r=t.getChildIdx(n,0);if(r.length!==2||n.substr(r[0],2)!=="02"||n.substr(r[1],2)!=="02")throw new Error("wrong hex for PKCS#5 public key");var i=e(n,r[0]),a=e(n,r[1]);this.setPublic(i,a)};ke.prototype.readPKCS8PubKeyHex=function(n){var t=se;if(t.isASN1HEX(n)===!1)throw new Error("not ASN.1 hex string");if(t.getTLVbyListEx(n,0,[0,0])!=="06092a864886f70d010101")throw new Error("not PKCS8 RSA public key");var e=t.getTLVbyListEx(n,0,[1,0]);this.readPKCS5PubKeyHex(e)};ke.prototype.readCertPubKeyHex=function(n,t){var e,r;e=new Ke,e.readCertHex(n),r=e.getPublicKeyHex(),this.readPKCS8PubKeyHex(r)};function n0(n){for(var t in re.crypto.Util.DIGESTINFOHEAD){var e=re.crypto.Util.DIGESTINFOHEAD[t],r=e.length;if(n.substring(0,r)==e){var i=[t,n.substring(r)];return i}}return[]}ke.prototype.verify=function(n,t){if(t=t.toLowerCase(),t.match(/^[0-9a-f]+$/)==null)return!1;var e=yt(t,16),r=this.n.bitLength();if(e.bitLength()>r)return!1;var i=this.doPublic(e),a=i.toString(16);if(a.length+3!=r/4)return!1;var o=a.replace(/^1f+00/,""),s=n0(o);if(s.length==0)return!1;var l=s[0],u=s[1],d=function(A){return re.crypto.Util.hashString(A,l)},f=d(n);return u==f};ke.prototype.verifyWithMessageHash=function(n,t){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var e=yt(t,16);if(e.bitLength()>this.n.bitLength())return 0;var r=this.doPublic(e),i=r.toString(16).replace(/^1f+00/,""),a=n0(i);if(a.length==0)return!1;a[0];var o=a[1];return o==n};ke.prototype.verifyPSS=function(n,t,e,r){var i=function(o){return re.crypto.Util.hashHex(o,e)},a=i(Pi(n));return r===void 0&&(r=-1),this.verifyWithMessageHashPSS(a,t,e,r)};ke.prototype.verifyWithMessageHashPSS=function(n,t,e,r){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var i=new fe(t,16),a=function(g){return re.crypto.Util.hashHex(g,e)},o=xr(n),s=o.length,l=this.n.bitLength()-1,u=Math.ceil(l/8),d;if(r===-1||r===void 0)r=s;else if(r===-2)r=u-s-2;else if(r<-2)throw new Error("invalid salt length");if(u<s+r+2)throw new Error("data too long");var f=this.doPublic(i).toByteArray();for(d=0;d<f.length;d+=1)f[d]&=255;for(;f.length<u;)f.unshift(0);if(f[u-1]!==188)throw new Error("encoded message does not end in 0xbc");f=String.fromCharCode.apply(String,f);var A=f.substr(0,u-s-1),m=f.substr(A.length,s),h=65280>>8*u-l&255;if(A.charCodeAt(0)&h)throw new Error("bits beyond keysize not zero");var v=pss_mgf1_str(m,A.length,a),y=[];for(d=0;d<A.length;d+=1)y[d]=A.charCodeAt(d)^v.charCodeAt(d);y[0]&=~h;var p=u-s-r-2;for(d=0;d<p;d+=1)if(y[d]!==0)throw new Error("leftmost octets not zero");if(y[p]!==1)throw new Error("0x01 marker not found");return m===xr(a(Pi("\0\0\0\0\0\0\0\0"+o+String.fromCharCode.apply(String,y.slice(-r)))))};ke.SALT_LEN_HLEN=-1;ke.SALT_LEN_MAX=-2;ke.SALT_LEN_RECOVER=-2;function Ke(n){var t=se,e=t.getChildIdx,r=t.getV,i=t.getTLV,a=t.getVbyList,o=t.getVbyListEx,s=t.getTLVbyList,l=t.getTLVbyListEx,u=t.getIdxbyList,d=t.getIdxbyListEx,f=t.getVidx,A=t.getInt,m=t.oidname,h=t.hextooidstr,v=rn,y;try{y=re.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch(p){}this.HEX2STAG={"0c":"utf8",13:"prn",16:"ia5","1a":"vis","1e":"bmp"},this.hex=null,this.version=0,this.foffset=0,this.aExtInfo=null,this.getVersion=function(){if(this.hex===null||this.version!==0)return this.version;var p=s(this.hex,0,[0,0]);if(p.substr(0,2)=="a0"){var g=s(p,0,[0]),x=A(g,0);if(x<0||2<x)throw new Error("malformed version field");return this.version=x+1,this.version}else return this.version=1,this.foffset=-1,1},this.getSerialNumberHex=function(){return o(this.hex,0,[0,0],"02")},this.getSignatureAlgorithmField=function(){var p=l(this.hex,0,[0,1]);return this.getAlgorithmIdentifierName(p)},this.getAlgorithmIdentifierName=function(p){for(var g in y)if(p===y[g])return g;return m(o(p,0,[0],"06"))},this.getIssuer=function(){return this.getX500Name(this.getIssuerHex())},this.getIssuerHex=function(){return s(this.hex,0,[0,3+this.foffset],"30")},this.getIssuerString=function(){var p=this.getIssuer();return p.str},this.getSubject=function(){return this.getX500Name(this.getSubjectHex())},this.getSubjectHex=function(){return s(this.hex,0,[0,5+this.foffset],"30")},this.getSubjectString=function(){var p=this.getSubject();return p.str},this.getNotBefore=function(){var p=a(this.hex,0,[0,4+this.foffset,0]);return p=p.replace(/(..)/g,"%$1"),p=decodeURIComponent(p),p},this.getNotAfter=function(){var p=a(this.hex,0,[0,4+this.foffset,1]);return p=p.replace(/(..)/g,"%$1"),p=decodeURIComponent(p),p},this.getPublicKeyHex=function(){return t.getTLVbyList(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyIdx=function(){return u(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyContentIdx=function(){var p=this.getPublicKeyIdx();return u(this.hex,p,[1,0],"30")},this.getPublicKey=function(){return en.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var p=s(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(p)},this.getSignatureValueHex=function(){return a(this.hex,0,[2],"03",!0)},this.verifySignature=function(p){var g=this.getSignatureAlgorithmField(),x=this.getSignatureValueHex(),b=s(this.hex,0,[0],"30"),w=new re.crypto.Signature({alg:g});return w.init(p),w.updateHex(b),w.verify(x)},this.parseExt=function(p){var g,x,b;if(p===void 0){if(b=this.hex,this.version!==3)return-1;g=u(b,0,[0,7,0],"30"),x=e(b,g)}else{b=rn(p);var w=u(b,0,[0,3,0,0],"06");if(r(b,w)!="2a864886f70d01090e"){this.aExtInfo=new Array;return}g=u(b,0,[0,3,0,1,0],"30"),x=e(b,g),this.hex=b}this.aExtInfo=new Array;for(var E=0;E<x.length;E++){var M={};M.critical=!1;var C=e(b,x[E]),P=0;C.length===3&&(M.critical=!0,P=1),M.oid=t.hextooidstr(a(b,x[E],[0],"06"));var S=u(b,x[E],[1+P]);M.vidx=f(b,S),this.aExtInfo.push(M)}},this.getExtInfo=function(p){var g=this.aExtInfo,x=p;if(p.match(/^[0-9.]+$/)||(x=re.asn1.x509.OID.name2oid(p)),x!==""){for(var b=0;b<g.length;b++)if(g[b].oid===x)return g[b]}},this.getExtBasicConstraints=function(p,g){if(p===void 0&&g===void 0){var x=this.getExtInfo("basicConstraints");if(x===void 0)return;p=i(this.hex,x.vidx),g=x.critical}var b={extname:"basicConstraints"};if(g&&(b.critical=!0),p==="3000")return b;if(p==="30030101ff")return b.cA=!0,b;if(p.substr(0,12)==="30060101ff02"){var w=r(p,10),E=parseInt(w,16);return b.cA=!0,b.pathLen=E,b}throw new Error("hExtV parse error: "+p)},this.getExtKeyUsage=function(p,g){if(p===void 0&&g===void 0){var x=this.getExtInfo("keyUsage");if(x===void 0)return;p=i(this.hex,x.vidx),g=x.critical}var b={extname:"keyUsage"};return g&&(b.critical=!0),b.names=this.getExtKeyUsageString(p).split(","),b},this.getExtKeyUsageBin=function(p){if(p===void 0){var g=this.getExtInfo("keyUsage");if(g===void 0)return"";p=i(this.hex,g.vidx)}if(p.length!=8&&p.length!=10)throw new Error("malformed key usage value: "+p);var x="000000000000000"+parseInt(p.substr(6),16).toString(2);return p.length==8&&(x=x.slice(-8)),p.length==10&&(x=x.slice(-16)),x=x.replace(/0+$/,""),x==""&&(x="0"),x},this.getExtKeyUsageString=function(p){for(var g=this.getExtKeyUsageBin(p),x=new Array,b=0;b<g.length;b++)g.substr(b,1)=="1"&&x.push(Ke.KEYUSAGE_NAME[b]);return x.join(",")},this.getExtSubjectKeyIdentifier=function(p,g){if(p===void 0&&g===void 0){var x=this.getExtInfo("subjectKeyIdentifier");if(x===void 0)return;p=i(this.hex,x.vidx),g=x.critical}var b={extname:"subjectKeyIdentifier"};g&&(b.critical=!0);var w=r(p,0);return b.kid={hex:w},b},this.getExtAuthorityKeyIdentifier=function(p,g){if(p===void 0&&g===void 0){var x=this.getExtInfo("authorityKeyIdentifier");if(x===void 0)return;p=i(this.hex,x.vidx),g=x.critical}var b={extname:"authorityKeyIdentifier"};g&&(b.critical=!0);for(var w=e(p,0),E=0;E<w.length;E++){var M=p.substr(w[E],2);if(M==="80"&&(b.kid={hex:r(p,w[E])}),M==="a1"){var C=i(p,w[E]),P=this.getGeneralNames(C);b.issuer=P[0].dn}M==="82"&&(b.sn={hex:r(p,w[E])})}return b},this.getExtExtKeyUsage=function(p,g){if(p===void 0&&g===void 0){var x=this.getExtInfo("extKeyUsage");if(x===void 0)return;p=i(this.hex,x.vidx),g=x.critical}var b={extname:"extKeyUsage",array:[]};g&&(b.critical=!0);for(var w=e(p,0),E=0;E<w.length;E++)b.array.push(m(r(p,w[E])));return b},this.getExtExtKeyUsageName=function(){var p=this.getExtInfo("extKeyUsage");if(p===void 0)return p;var g=new Array,x=i(this.hex,p.vidx);if(x==="")return g;for(var b=e(x,0),w=0;w<b.length;w++)g.push(m(r(x,b[w])));return g},this.getExtSubjectAltName=function(p,g){if(p===void 0&&g===void 0){var x=this.getExtInfo("subjectAltName");if(x===void 0)return;p=i(this.hex,x.vidx),g=x.critical}var b={extname:"subjectAltName",array:[]};return g&&(b.critical=!0),b.array=this.getGeneralNames(p),b},this.getExtIssuerAltName=function(p,g){if(p===void 0&&g===void 0){var x=this.getExtInfo("issuerAltName");if(x===void 0)return;p=i(this.hex,x.vidx),g=x.critical}var b={extname:"issuerAltName",array:[]};return g&&(b.critical=!0),b.array=this.getGeneralNames(p),b},this.getGeneralNames=function(p){for(var g=e(p,0),x=[],b=0;b<g.length;b++){var w=this.getGeneralName(i(p,g[b]));w!==void 0&&x.push(w)}return x},this.getGeneralName=function(p){var g=p.substr(0,2),x=r(p,0),b=xr(x);if(g=="81")return{rfc822:b};if(g=="82")return{dns:b};if(g=="86")return{uri:b};if(g=="87")return{ip:Po(x)};if(g=="a4")return{dn:this.getX500Name(x)}},this.getExtSubjectAltName2=function(){var p,g,x,b=this.getExtInfo("subjectAltName");if(b===void 0)return b;for(var w=new Array,E=i(this.hex,b.vidx),M=e(E,0),C=0;C<M.length;C++)x=E.substr(M[C],2),p=r(E,M[C]),x==="81"&&(g=or(p),w.push(["MAIL",g])),x==="82"&&(g=or(p),w.push(["DNS",g])),x==="84"&&(g=Ke.hex2dn(p,0),w.push(["DN",g])),x==="86"&&(g=or(p),w.push(["URI",g])),x==="87"&&(g=Po(p),w.push(["IP",g]));return w},this.getExtCRLDistributionPoints=function(p,g){if(p===void 0&&g===void 0){var x=this.getExtInfo("cRLDistributionPoints");if(x===void 0)return;p=i(this.hex,x.vidx),g=x.critical}var b={extname:"cRLDistributionPoints",array:[]};g&&(b.critical=!0);for(var w=e(p,0),E=0;E<w.length;E++){var M=i(p,w[E]);b.array.push(this.getDistributionPoint(M))}return b},this.getDistributionPoint=function(p){for(var g={},x=e(p,0),b=0;b<x.length;b++){var w=p.substr(x[b],2),E=i(p,x[b]);w=="a0"&&(g.dpname=this.getDistributionPointName(E))}return g},this.getDistributionPointName=function(p){for(var g={},x=e(p,0),b=0;b<x.length;b++){var w=p.substr(x[b],2),E=i(p,x[b]);w=="a0"&&(g.full=this.getGeneralNames(E))}return g},this.getExtCRLDistributionPointsURI=function(){var p=this.getExtInfo("cRLDistributionPoints");if(p===void 0)return p;for(var g=new Array,x=e(this.hex,p.vidx),b=0;b<x.length;b++)try{var w=a(this.hex,x[b],[0,0,0],"86"),E=or(w);g.push(E)}catch(M){}return g},this.getExtAIAInfo=function(){var p=this.getExtInfo("authorityInfoAccess");if(p===void 0)return p;for(var g={ocsp:[],caissuer:[]},x=e(this.hex,p.vidx),b=0;b<x.length;b++){var w=a(this.hex,x[b],[0],"06"),E=a(this.hex,x[b],[1],"86");w==="2b06010505073001"&&g.ocsp.push(or(E)),w==="2b06010505073002"&&g.caissuer.push(or(E))}return g},this.getExtAuthorityInfoAccess=function(p,g){if(p===void 0&&g===void 0){var x=this.getExtInfo("authorityInfoAccess");if(x===void 0)return;p=i(this.hex,x.vidx),g=x.critical}var b={extname:"authorityInfoAccess",array:[]};g&&(b.critical=!0);for(var w=e(p,0),E=0;E<w.length;E++){var M=o(p,w[E],[0],"06"),C=a(p,w[E],[1],"86"),P=or(C);if(M=="2b06010505073001")b.array.push({ocsp:P});else if(M=="2b06010505073002")b.array.push({caissuer:P});else throw new Error("unknown method: "+M)}return b},this.getExtCertificatePolicies=function(p,g){if(p===void 0&&g===void 0){var x=this.getExtInfo("certificatePolicies");if(x===void 0)return;p=i(this.hex,x.vidx),g=x.critical}var b={extname:"certificatePolicies",array:[]};g&&(b.critical=!0);for(var w=e(p,0),E=0;E<w.length;E++){var M=i(p,w[E]),C=this.getPolicyInformation(M);b.array.push(C)}return b},this.getPolicyInformation=function(p){var g={},x=a(p,0,[0],"06");g.policyoid=m(x);var b=d(p,0,[1],"30");if(b!=-1){g.array=[];for(var w=e(p,b),E=0;E<w.length;E++){var M=i(p,w[E]),C=this.getPolicyQualifierInfo(M);g.array.push(C)}}return g},this.getPolicyQualifierInfo=function(p){var g={},x=a(p,0,[0],"06");if(x==="2b06010505070201"){var b=o(p,0,[1],"16");g.cps=xr(b)}else if(x==="2b06010505070202"){var w=s(p,0,[1],"30");g.unotice=this.getUserNotice(w)}return g},this.getUserNotice=function(p){for(var g={},x=e(p,0),b=0;b<x.length;b++){var w=i(p,x[b]);w.substr(0,2)!="30"&&(g.exptext=this.getDisplayText(w))}return g},this.getDisplayText=function(p){var g={"0c":"utf8",16:"ia5","1a":"vis","1e":"bmp"},x={};return x.type=g[p.substr(0,2)],x.str=xr(r(p,0)),x},this.getExtCRLNumber=function(p,g){var x={extname:"cRLNumber"};if(g&&(x.critical=!0),p.substr(0,2)=="02")return x.num={hex:r(p,0)},x;throw new Error("hExtV parse error: "+p)},this.getExtCRLReason=function(p,g){var x={extname:"cRLReason"};if(g&&(x.critical=!0),p.substr(0,2)=="0a")return x.code=parseInt(r(p,0),16),x;throw new Error("hExtV parse error: "+p)},this.getExtOcspNonce=function(p,g){var x={extname:"ocspNonce"};g&&(x.critical=!0);var b=r(p,0);return x.hex=b,x},this.getExtOcspNoCheck=function(p,g){var x={extname:"ocspNoCheck"};return g&&(x.critical=!0),x},this.getExtAdobeTimeStamp=function(p,g){if(p===void 0&&g===void 0){var x=this.getExtInfo("adobeTimeStamp");if(x===void 0)return;p=i(this.hex,x.vidx),g=x.critical}var b={extname:"adobeTimeStamp"};g&&(b.critical=!0);var w=e(p,0);if(w.length>1){var E=i(p,w[1]),M=this.getGeneralName(E);M.uri!=null&&(b.uri=M.uri)}if(w.length>2){var C=i(p,w[2]);C=="0101ff"&&(b.reqauth=!0),C=="010100"&&(b.reqauth=!1)}return b},this.getX500NameRule=function(p){for(var g=null,x=[],b=0;b<p.length;b++)for(var w=p[b],E=0;E<w.length;E++)x.push(w[E]);for(var b=0;b<x.length;b++){var M=x[b],C=M.ds,P=M.value,S=M.type;if(C!="prn"&&C!="utf8"&&C!="ia5")return"mixed";if(C=="ia5"){if(S!="CN")return"mixed";if(re.lang.String.isMail(P))continue;return"mixed"}if(S=="C"){if(C=="prn")continue;return"mixed"}if(g==null)g=C;else if(g!==C)return"mixed"}return g==null?"prn":g},this.getX500Name=function(p){var g=this.getX500NameArray(p),x=this.dnarraytostr(g);return{array:g,str:x}},this.getX500NameArray=function(p){for(var g=[],x=e(p,0),b=0;b<x.length;b++)g.push(this.getRDN(i(p,x[b])));return g},this.getRDN=function(p){for(var g=[],x=e(p,0),b=0;b<x.length;b++)g.push(this.getAttrTypeAndValue(i(p,x[b])));return g},this.getAttrTypeAndValue=function(p){var g={type:null,value:null,ds:null},x=e(p,0),b=a(p,x[0],[],"06"),w=a(p,x[1],[]),E=re.asn1.ASN1Util.oidHexToInt(b);return g.type=re.asn1.x509.OID.oid2atype(E),g.ds=this.HEX2STAG[p.substr(x[1],2)],g.ds!="bmp"?g.value=or(w):g.value=Jl(w),g},this.readCertPEM=function(p){this.readCertHex(v(p))},this.readCertHex=function(p){this.hex=p,this.getVersion();try{u(this.hex,0,[0,7],"a3"),this.parseExt()}catch(g){}},this.getParam=function(){var p={};return p.version=this.getVersion(),p.serial={hex:this.getSerialNumberHex()},p.sigalg=this.getSignatureAlgorithmField(),p.issuer=this.getIssuer(),p.notbefore=this.getNotBefore(),p.notafter=this.getNotAfter(),p.subject=this.getSubject(),p.sbjpubkey=Gl(this.getPublicKeyHex(),"PUBLIC KEY"),this.aExtInfo.length>0&&(p.ext=this.getExtParamArray()),p.sighex=this.getSignatureValueHex(),p},this.getExtParamArray=function(p){if(p==null){var g=d(this.hex,0,[0,"[3]"]);g!=-1&&(p=l(this.hex,0,[0,"[3]",0],"30"))}for(var x=[],b=e(p,0),w=0;w<b.length;w++){var E=i(p,b[w]),M=this.getExtParam(E);M!=null&&x.push(M)}return x},this.getExtParam=function(p){var g=e(p,0),x=g.length;if(x!=2&&x!=3)throw new Error("wrong number elements in Extension: "+x+" "+p);var b=h(a(p,0,[0],"06")),w=!1;x==3&&s(p,0,[1])=="0101ff"&&(w=!0);var E=s(p,0,[x-1,0]),M=void 0;if(b=="2.5.29.14"?M=this.getExtSubjectKeyIdentifier(E,w):b=="2.5.29.15"?M=this.getExtKeyUsage(E,w):b=="2.5.29.17"?M=this.getExtSubjectAltName(E,w):b=="2.5.29.18"?M=this.getExtIssuerAltName(E,w):b=="2.5.29.19"?M=this.getExtBasicConstraints(E,w):b=="2.5.29.31"?M=this.getExtCRLDistributionPoints(E,w):b=="2.5.29.32"?M=this.getExtCertificatePolicies(E,w):b=="2.5.29.35"?M=this.getExtAuthorityKeyIdentifier(E,w):b=="2.5.29.37"?M=this.getExtExtKeyUsage(E,w):b=="1.3.6.1.5.5.7.1.1"?M=this.getExtAuthorityInfoAccess(E,w):b=="2.5.29.20"?M=this.getExtCRLNumber(E,w):b=="2.5.29.21"?M=this.getExtCRLReason(E,w):b=="1.3.6.1.5.5.7.48.1.2"?M=this.getExtOcspNonce(E,w):b=="1.3.6.1.5.5.7.48.1.5"?M=this.getExtOcspNoCheck(E,w):b=="1.2.840.113583.1.1.9.1"&&(M=this.getExtAdobeTimeStamp(E,w)),M!=null)return M;var C={extname:b,extn:E};return w&&(C.critical=!0),C},this.findExt=function(p,g){for(var x=0;x<p.length;x++)if(p[x].extname==g)return p[x];return null},this.dnarraytostr=function(p){function g(b){return b.map(function(w){return x(w).replace(/\+/,"\\+")}).join("+")}function x(b){return b.type+"="+b.value}return"/"+p.map(function(b){return g(b).replace(/\//,"\\/")}).join("/")},this.getInfo=function(){var p=function(X){var K=JSON.stringify(X.array).replace(/[\[\]\{\}\"]/g,"");return K},g=function(X){for(var K="",Q=X.array,G=0;G<Q.length;G++){var J=Q[G];if(K+=" policy oid: "+J.policyoid+`
|
|
362
|
+
`,P},parseHexOfEncryptedPKCS8:function(h){var v=se,y=v.getChildIdx,p=v.getV,g={},x=y(h,0);if(x.length!=2)throw"malformed format: SEQUENCE(0).items != 2: "+x.length;g.ciphertext=p(h,x[1]);var b=y(h,x[0]);if(b.length!=2)throw"malformed format: SEQUENCE(0.0).items != 2: "+b.length;if(p(h,b[0])!="2a864886f70d01050d")throw"this only supports pkcs5PBES2";var w=y(h,b[1]);if(b.length!=2)throw"malformed format: SEQUENCE(0.0.1).items != 2: "+w.length;var E=y(h,w[1]);if(E.length!=2)throw"malformed format: SEQUENCE(0.0.1.1).items != 2: "+E.length;if(p(h,E[0])!="2a864886f70d0307")throw"this only supports TripleDES";g.encryptionSchemeAlg="TripleDES",g.encryptionSchemeIV=p(h,E[1]);var M=y(h,w[0]);if(M.length!=2)throw"malformed format: SEQUENCE(0.0.1.0).items != 2: "+M.length;if(p(h,M[0])!="2a864886f70d01050c")throw"this only supports pkcs5PBKDF2";var C=y(h,M[1]);if(C.length<2)throw"malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+C.length;g.pbkdf2Salt=p(h,C[0]);var P=p(h,C[1]);try{g.pbkdf2Iter=parseInt(P,16)}catch(S){throw"malformed format pbkdf2Iter: "+P}return g},getPBKDF2KeyHexFromParam:function(h,v){var y=we.enc.Hex.parse(h.pbkdf2Salt),p=h.pbkdf2Iter,g=we.PBKDF2(v,y,{keySize:192/32,iterations:p}),x=we.enc.Hex.stringify(g);return x},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(h,v){var y=rn(h,"ENCRYPTED PRIVATE KEY"),p=this.parseHexOfEncryptedPKCS8(y),g=en.getPBKDF2KeyHexFromParam(p,v),x={};x.ciphertext=we.enc.Hex.parse(p.ciphertext);var b=we.enc.Hex.parse(g),w=we.enc.Hex.parse(p.encryptionSchemeIV),E=we.TripleDES.decrypt(x,b,{iv:w}),M=we.enc.Hex.stringify(E);return M},getKeyFromEncryptedPKCS8PEM:function(h,v){var y=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(h,v),p=this.getKeyFromPlainPrivatePKCS8Hex(y);return p},parsePlainPrivatePKCS8Hex:function(h){var v=se,y=v.getChildIdx,p=v.getV,g={};if(g.algparam=null,h.substr(0,2)!="30")throw new Error("malformed plain PKCS8 private key(code:001)");var x=y(h,0);if(x.length<3)throw new Error("malformed plain PKCS8 private key(code:002)");if(h.substr(x[1],2)!="30")throw new Error("malformed PKCS8 private key(code:003)");var b=y(h,x[1]);if(b.length!=2)throw new Error("malformed PKCS8 private key(code:004)");if(h.substr(b[0],2)!="06")throw new Error("malformed PKCS8 private key(code:005)");if(g.algoid=p(h,b[0]),h.substr(b[1],2)=="06"&&(g.algparam=p(h,b[1])),h.substr(x[2],2)!="04")throw new Error("malformed PKCS8 private key(code:006)");return g.keyidx=v.getVidx(h,x[2]),g},getKeyFromPlainPrivatePKCS8PEM:function(h){var v=rn(h,"PRIVATE KEY"),y=this.getKeyFromPlainPrivatePKCS8Hex(v);return y},getKeyFromPlainPrivatePKCS8Hex:function(h){var v=this.parsePlainPrivatePKCS8Hex(h),y;if(v.algoid=="2a864886f70d010101")y=new ke;else if(re.crypto.DSA&&v.algoid=="2a8648ce380401")y=new re.crypto.DSA;else if(re.crypto.ECDSA&&v.algoid=="2a8648ce3d0201")y=new re.crypto.ECDSA;else throw"unsupported private key algorithm";return y.readPKCS8PrvKeyHex(h),y},_getKeyFromPublicPKCS8Hex:function(h){var v,y=se.getVbyList(h,0,[0,0],"06");if(y==="2a864886f70d010101")v=new ke;else if(re.crypto.DSA&&y==="2a8648ce380401")v=new re.crypto.DSA;else if(re.crypto.ECDSA&&y==="2a8648ce3d0201")v=new re.crypto.ECDSA;else throw"unsupported PKCS#8 public key hex";return v.readPKCS8PubKeyHex(h),v},parsePublicRawRSAKeyHex:function(h){var v=se,y=v.getChildIdx,p=v.getV,g={};if(h.substr(0,2)!="30")throw"malformed RSA key(code:001)";var x=y(h,0);if(x.length!=2)throw"malformed RSA key(code:002)";if(h.substr(x[0],2)!="02")throw"malformed RSA key(code:003)";if(g.n=p(h,x[0]),h.substr(x[1],2)!="02")throw"malformed RSA key(code:004)";return g.e=p(h,x[1]),g},parsePublicPKCS8Hex:function(h){var v=se,y=v.getChildIdx,p=v.getV,g={};g.algparam=null;var x=y(h,0);if(x.length!=2)throw"outer DERSequence shall have 2 elements: "+x.length;var b=x[0];if(h.substr(b,2)!="30")throw"malformed PKCS8 public key(code:001)";var w=y(h,b);if(w.length!=2)throw"malformed PKCS8 public key(code:002)";if(h.substr(w[0],2)!="06")throw"malformed PKCS8 public key(code:003)";if(g.algoid=p(h,w[0]),h.substr(w[1],2)=="06"?g.algparam=p(h,w[1]):h.substr(w[1],2)=="30"&&(g.algparam={},g.algparam.p=v.getVbyList(h,w[1],[0],"02"),g.algparam.q=v.getVbyList(h,w[1],[1],"02"),g.algparam.g=v.getVbyList(h,w[1],[2],"02")),h.substr(x[1],2)!="03")throw"malformed PKCS8 public key(code:004)";return g.key=p(h,x[1]).substr(2),g}}}();en.getKey=function(n,t,e){var r=se,i=r.getChildIdx;r.getV;var a=r.getVbyList,o=re.crypto,s=o.ECDSA,l=o.DSA,u=ke,d=rn,f=en;if(typeof u!="undefined"&&n instanceof u||typeof s!="undefined"&&n instanceof s||typeof l!="undefined"&&n instanceof l)return n;if(n.curve!==void 0&&n.xy!==void 0&&n.d===void 0)return new s({pub:n.xy,curve:n.curve});if(n.curve!==void 0&&n.d!==void 0)return new s({prv:n.d,curve:n.curve});if(n.kty===void 0&&n.n!==void 0&&n.e!==void 0&&n.d===void 0){var A=new u;return A.setPublic(n.n,n.e),A}if(n.kty===void 0&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0&&n.p!==void 0&&n.q!==void 0&&n.dp!==void 0&&n.dq!==void 0&&n.co!==void 0&&n.qi===void 0){var A=new u;return A.setPrivateEx(n.n,n.e,n.d,n.p,n.q,n.dp,n.dq,n.co),A}if(n.kty===void 0&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0&&n.p===void 0){var A=new u;return A.setPrivate(n.n,n.e,n.d),A}if(n.p!==void 0&&n.q!==void 0&&n.g!==void 0&&n.y!==void 0&&n.x===void 0){var A=new l;return A.setPublic(n.p,n.q,n.g,n.y),A}if(n.p!==void 0&&n.q!==void 0&&n.g!==void 0&&n.y!==void 0&&n.x!==void 0){var A=new l;return A.setPrivate(n.p,n.q,n.g,n.y,n.x),A}if(n.kty==="RSA"&&n.n!==void 0&&n.e!==void 0&&n.d===void 0){var A=new u;return A.setPublic(tt(n.n),tt(n.e)),A}if(n.kty==="RSA"&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0&&n.p!==void 0&&n.q!==void 0&&n.dp!==void 0&&n.dq!==void 0&&n.qi!==void 0){var A=new u;return A.setPrivateEx(tt(n.n),tt(n.e),tt(n.d),tt(n.p),tt(n.q),tt(n.dp),tt(n.dq),tt(n.qi)),A}if(n.kty==="RSA"&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0){var A=new u;return A.setPrivate(tt(n.n),tt(n.e),tt(n.d)),A}if(n.kty==="EC"&&n.crv!==void 0&&n.x!==void 0&&n.y!==void 0&&n.d===void 0){var m=new s({curve:n.crv}),h=m.ecparams.keylen/4,v=("0000000000"+tt(n.x)).slice(-h),y=("0000000000"+tt(n.y)).slice(-h),p="04"+v+y;return m.setPublicKeyHex(p),m}if(n.kty==="EC"&&n.crv!==void 0&&n.x!==void 0&&n.y!==void 0&&n.d!==void 0){var m=new s({curve:n.crv}),h=m.ecparams.keylen/4,v=("0000000000"+tt(n.x)).slice(-h),y=("0000000000"+tt(n.y)).slice(-h),p="04"+v+y,g=("0000000000"+tt(n.d)).slice(-h);return m.setPublicKeyHex(p),m.setPrivateKeyHex(g),m}if(e==="pkcs5prv"){var x=n,r=se,b,A;if(b=i(x,0),b.length===9)A=new u,A.readPKCS5PrvKeyHex(x);else if(b.length===6)A=new l,A.readPKCS5PrvKeyHex(x);else if(b.length>2&&x.substr(b[1],2)==="04")A=new s,A.readPKCS5PrvKeyHex(x);else throw"unsupported PKCS#1/5 hexadecimal key";return A}if(e==="pkcs8prv"){var A=f.getKeyFromPlainPrivatePKCS8Hex(n);return A}if(e==="pkcs8pub")return f._getKeyFromPublicPKCS8Hex(n);if(e==="x509pub")return Ke.getPublicKeyFromCertHex(n);if(n.indexOf("-END CERTIFICATE-",0)!=-1||n.indexOf("-END X509 CERTIFICATE-",0)!=-1||n.indexOf("-END TRUSTED CERTIFICATE-",0)!=-1)return Ke.getPublicKeyFromCertPEM(n);if(n.indexOf("-END PUBLIC KEY-")!=-1){var w=rn(n,"PUBLIC KEY");return f._getKeyFromPublicPKCS8Hex(w)}if(n.indexOf("-END RSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var E=d(n,"RSA PRIVATE KEY");return f.getKey(E,null,"pkcs5prv")}if(n.indexOf("-END DSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var M=d(n,"DSA PRIVATE KEY"),C=a(M,0,[1],"02"),P=a(M,0,[2],"02"),S=a(M,0,[3],"02"),T=a(M,0,[4],"02"),B=a(M,0,[5],"02"),A=new l;return A.setPrivate(new fe(C,16),new fe(P,16),new fe(S,16),new fe(T,16),new fe(B,16)),A}if(n.indexOf("-END EC PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var E=d(n,"EC PRIVATE KEY");return f.getKey(E,null,"pkcs5prv")}if(n.indexOf("-END PRIVATE KEY-")!=-1)return f.getKeyFromPlainPrivatePKCS8PEM(n);if(n.indexOf("-END RSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")!=-1){var L=f.getDecryptedKeyHex(n,t),k=new ke;return k.readPKCS5PrvKeyHex(L),k}if(n.indexOf("-END EC PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")!=-1){var M=f.getDecryptedKeyHex(n,t),A=a(M,0,[1],"04"),O=a(M,0,[2,0],"06"),D=a(M,0,[3,0],"03").substr(2),N="";if(re.crypto.OID.oidhex2name[O]!==void 0)N=re.crypto.OID.oidhex2name[O];else throw"undefined OID(hex) in KJUR.crypto.OID: "+O;var m=new s({curve:N});return m.setPublicKeyHex(D),m.setPrivateKeyHex(A),m.isPublic=!1,m}if(n.indexOf("-END DSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")!=-1){var M=f.getDecryptedKeyHex(n,t),C=a(M,0,[1],"02"),P=a(M,0,[2],"02"),S=a(M,0,[3],"02"),T=a(M,0,[4],"02"),B=a(M,0,[5],"02"),A=new l;return A.setPrivate(new fe(C,16),new fe(P,16),new fe(S,16),new fe(T,16),new fe(B,16)),A}if(n.indexOf("-END ENCRYPTED PRIVATE KEY-")!=-1)return f.getKeyFromEncryptedPKCS8PEM(n,t);throw new Error("not supported argument")};(typeof re.asn1=="undefined"||!re.asn1)&&(re.asn1={});re.asn1.ASN1Util={};re.asn1.ASN1Util.oidHexToInt=function(n){for(var i="",t=parseInt(n.substr(0,2),16),e=Math.floor(t/40),r=t%40,i=e+"."+r,a="",o=2;o<n.length;o+=2){var s=parseInt(n.substr(o,2),16),l=("00000000"+s.toString(2)).slice(-8);if(a=a+l.substr(1,7),l.substr(0,1)=="0"){var u=new fe(a,2);i=i+"."+u.toString(10),a=""}}return i};var se=new function(){};se.getLblen=function(n,t){if(n.substr(t+2,1)!="8")return 1;var e=parseInt(n.substr(t+3,1));return e==0?-1:0<e&&e<10?e+1:-2};se.getL=function(n,t){var e=se.getLblen(n,t);return e<1?"":n.substr(t+2,e*2)};se.getVblen=function(n,t){var e,r;return e=se.getL(n,t),e==""?-1:(e.substr(0,1)==="8"?r=new fe(e.substr(2),16):r=new fe(e,16),r.intValue())};se.getVidx=function(n,t){var e=se.getLblen(n,t);return e<0?e:t+(e+1)*2};se.getV=function(n,t){var e=se.getVidx(n,t),r=se.getVblen(n,t);return n.substr(e,r*2)};se.getTLV=function(n,t){return n.substr(t,2)+se.getL(n,t)+se.getV(n,t)};se.getTLVblen=function(n,t){return 2+se.getLblen(n,t)*2+se.getVblen(n,t)*2};se.getNextSiblingIdx=function(n,t){var e=se.getVidx(n,t),r=se.getVblen(n,t);return e+r*2};se.getChildIdx=function(n,t){var e=se,r=[],i,a,o;i=e.getVidx(n,t),a=e.getVblen(n,t)*2,n.substr(t,2)=="03"&&(i+=2,a-=2),o=0;for(var s=i;o<=a;){var l=e.getTLVblen(n,s);if(o+=l,o<=a&&r.push(s),s+=l,o>=a)break}return r};se.getNthChildIdx=function(n,t,e){var r=se.getChildIdx(n,t);return r[e]};se.getIdxbyList=function(n,t,e,r){var i=se,a,o;return e.length==0?r!==void 0&&n.substr(t,2)!==r?-1:t:(a=e.shift(),o=i.getChildIdx(n,t),a>=o.length?-1:i.getIdxbyList(n,o[a],e,r))};se.getIdxbyListEx=function(n,t,e,r){var i=se,a,o;if(e.length==0)return r!==void 0&&n.substr(t,2)!==r?-1:t;a=e.shift(),o=i.getChildIdx(n,t);for(var s=0,l=0;l<o.length;l++){var u=n.substr(o[l],2);if(typeof a=="number"&&!i.isContextTag(u)&&s==a||typeof a=="string"&&i.isContextTag(u,a))return i.getIdxbyListEx(n,o[l],e,r);i.isContextTag(u)||s++}return-1};se.getTLVbyList=function(n,t,e,r){var i=se,a=i.getIdxbyList(n,t,e,r);return a==-1||a>=n.length?null:i.getTLV(n,a)};se.getTLVbyListEx=function(n,t,e,r){var i=se,a=i.getIdxbyListEx(n,t,e,r);return a==-1?null:i.getTLV(n,a)};se.getVbyList=function(n,t,e,r,i){var a=se,o,s;return o=a.getIdxbyList(n,t,e,r),o==-1||o>=n.length?null:(s=a.getV(n,o),i===!0&&(s=s.substr(2)),s)};se.getVbyListEx=function(n,t,e,r,i){var a=se,o,s;return o=a.getIdxbyListEx(n,t,e,r),o==-1?null:(s=a.getV(n,o),n.substr(o,2)=="03"&&i!==!1&&(s=s.substr(2)),s)};se.getInt=function(n,t,e){e==null&&(e=-1);try{var r=n.substr(t,2);if(r!="02"&&r!="03")return e;var i=se.getV(n,t);return r=="02"?parseInt(i,16):_l(i)}catch(a){return e}};se.getOID=function(n,t,e){e==null&&(e=null);try{if(n.substr(t,2)!="06")return e;var r=se.getV(n,t);return Xl(r)}catch(i){return e}};se.getOIDName=function(n,t,e){e==null&&(e=null);try{var r=se.getOID(n,t,e);if(r==e)return e;var i=re.asn1.x509.OID.oid2name(r);return i==""?r:i}catch(a){return e}};se.getString=function(n,t,e){e==null&&(e=null);try{var r=se.getV(n,t);return xr(r)}catch(i){return e}};se.hextooidstr=function(n){var t=function(f,A){return f.length>=A?f:new Array(A-f.length+1).join("0")+f},e=[],r=n.substr(0,2),i=parseInt(r,16);e[0]=new String(Math.floor(i/40)),e[1]=new String(i%40);for(var a=n.substr(2),o=[],s=0;s<a.length/2;s++)o.push(parseInt(a.substr(s*2,2),16));for(var l=[],u="",s=0;s<o.length;s++)o[s]&128?u=u+t((o[s]&127).toString(2),7):(u=u+t((o[s]&127).toString(2),7),l.push(new String(parseInt(u,2))),u="");var d=e.join(".");return l.length>0&&(d=d+"."+l.join(".")),d};se.isContextTag=function(n,t){n=n.toLowerCase();var e,r;try{e=parseInt(n,16)}catch(a){return-1}if(t===void 0)return(e&192)==128;try{var i=t.match(/^\[[0-9]+\]$/);return i==null||(r=parseInt(t.substr(1,t.length-1),10),r>31)?!1:(e&192)==128&&(e&31)==r}catch(a){return!1}};se.isASN1HEX=function(n){var t=se;if(n.length%2==1)return!1;var e=t.getVblen(n,0),r=n.substr(0,2),i=t.getL(n,0),a=n.length-r.length-i.length;return a==e*2};se.checkStrictDER=function(n,t,e,r,i){var a=se;if(e===void 0){if(typeof n!="string")throw new Error("not hex string");if(n=n.toLowerCase(),!re.lang.String.isHex(n))throw new Error("not hex string");e=n.length,r=n.length/2,r<128?i=1:i=Math.ceil(r.toString(16))+1}var o=a.getL(n,t);if(o.length>i*2)throw new Error("L of TLV too long: idx="+t);var s=a.getVblen(n,t);if(s>r)throw new Error("value of L too long than hex: idx="+t);var l=a.getTLV(n,t),u=l.length-2-a.getL(n,t).length;if(u!==s*2)throw new Error("V string length and L's value not the same:"+u+"/"+s*2);if(t===0&&n.length!=l.length)throw new Error("total length and TLV length unmatch:"+n.length+"!="+l.length);var d=n.substr(t,2);if(d==="02"){var f=a.getVidx(n,t);if(n.substr(f,2)=="00"&&n.charCodeAt(f+2)<56)throw new Error("not least zeros for DER INTEGER")}if(parseInt(d,16)&32){for(var A=a.getVblen(n,t),m=0,h=a.getChildIdx(n,t),v=0;v<h.length;v++){var y=a.getTLV(n,h[v]);m+=y.length,a.checkStrictDER(n,h[v],e,r,i)}if(A*2!=m)throw new Error("sum of children's TLV length and L unmatch: "+A*2+"!="+m)}};se.oidname=function(n){var t=re.asn1;re.lang.String.isHex(n)&&(n=t.ASN1Util.oidHexToInt(n));var e=t.x509.OID.oid2name(n);return e===""&&(e=n),e};(typeof re.asn1=="undefined"||!re.asn1)&&(re.asn1={});(typeof re.asn1.x509=="undefined"||!re.asn1.x509)&&(re.asn1.x509={});re.asn1.x509.AlgorithmIdentifier={};re.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"};re.asn1.x509.OID=new function(n){this.atype2oidList={CN:"2.5.4.3",L:"2.5.4.7",ST:"2.5.4.8",O:"2.5.4.10",OU:"2.5.4.11",C:"2.5.4.6",STREET:"2.5.4.9",DC:"0.9.2342.19200300.100.1.25",UID:"0.9.2342.19200300.100.1.1",SN:"2.5.4.4",T:"2.5.4.12",DN:"2.5.4.49",E:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",serialNumber:"2.5.4.5",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3"},this.name2oidList={sha1:"1.3.14.3.2.26",sha256:"2.16.840.1.101.3.4.2.1",sha384:"2.16.840.1.101.3.4.2.2",sha512:"2.16.840.1.101.3.4.2.3",sha224:"2.16.840.1.101.3.4.2.4",md5:"1.2.840.113549.2.5",md2:"1.3.14.7.2.2.1",ripemd160:"1.3.36.3.2.1",MD2withRSA:"1.2.840.113549.1.1.2",MD4withRSA:"1.2.840.113549.1.1.3",MD5withRSA:"1.2.840.113549.1.1.4",SHA1withRSA:"1.2.840.113549.1.1.5","pkcs1-MGF":"1.2.840.113549.1.1.8",rsaPSS:"1.2.840.113549.1.1.10",SHA224withRSA:"1.2.840.113549.1.1.14",SHA256withRSA:"1.2.840.113549.1.1.11",SHA384withRSA:"1.2.840.113549.1.1.12",SHA512withRSA:"1.2.840.113549.1.1.13",SHA1withECDSA:"1.2.840.10045.4.1",SHA224withECDSA:"1.2.840.10045.4.3.1",SHA256withECDSA:"1.2.840.10045.4.3.2",SHA384withECDSA:"1.2.840.10045.4.3.3",SHA512withECDSA:"1.2.840.10045.4.3.4",dsa:"1.2.840.10040.4.1",SHA1withDSA:"1.2.840.10040.4.3",SHA224withDSA:"2.16.840.1.101.3.4.3.1",SHA256withDSA:"2.16.840.1.101.3.4.3.2",rsaEncryption:"1.2.840.113549.1.1.1",commonName:"2.5.4.3",countryName:"2.5.4.6",localityName:"2.5.4.7",stateOrProvinceName:"2.5.4.8",streetAddress:"2.5.4.9",organizationName:"2.5.4.10",organizationalUnitName:"2.5.4.11",domainComponent:"0.9.2342.19200300.100.1.25",userId:"0.9.2342.19200300.100.1.1",surname:"2.5.4.4",givenName:"2.5.4.42",title:"2.5.4.12",distinguishedName:"2.5.4.49",emailAddress:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3",subjectDirectoryAttributes:"2.5.29.9",subjectKeyIdentifier:"2.5.29.14",keyUsage:"2.5.29.15",subjectAltName:"2.5.29.17",issuerAltName:"2.5.29.18",basicConstraints:"2.5.29.19",cRLNumber:"2.5.29.20",cRLReason:"2.5.29.21",nameConstraints:"2.5.29.30",cRLDistributionPoints:"2.5.29.31",certificatePolicies:"2.5.29.32",anyPolicy:"2.5.29.32.0",authorityKeyIdentifier:"2.5.29.35",policyConstraints:"2.5.29.36",extKeyUsage:"2.5.29.37",authorityInfoAccess:"1.3.6.1.5.5.7.1.1",ocsp:"1.3.6.1.5.5.7.48.1",ocspBasic:"1.3.6.1.5.5.7.48.1.1",ocspNonce:"1.3.6.1.5.5.7.48.1.2",ocspNoCheck:"1.3.6.1.5.5.7.48.1.5",caIssuers:"1.3.6.1.5.5.7.48.2",anyExtendedKeyUsage:"2.5.29.37.0",serverAuth:"1.3.6.1.5.5.7.3.1",clientAuth:"1.3.6.1.5.5.7.3.2",codeSigning:"1.3.6.1.5.5.7.3.3",emailProtection:"1.3.6.1.5.5.7.3.4",timeStamping:"1.3.6.1.5.5.7.3.8",ocspSigning:"1.3.6.1.5.5.7.3.9",dateOfBirth:"1.3.6.1.5.5.7.9.1",placeOfBirth:"1.3.6.1.5.5.7.9.2",gender:"1.3.6.1.5.5.7.9.3",countryOfCitizenship:"1.3.6.1.5.5.7.9.4",countryOfResidence:"1.3.6.1.5.5.7.9.5",ecPublicKey:"1.2.840.10045.2.1","P-256":"1.2.840.10045.3.1.7",secp256r1:"1.2.840.10045.3.1.7",secp256k1:"1.3.132.0.10",secp384r1:"1.3.132.0.34",pkcs5PBES2:"1.2.840.113549.1.5.13",pkcs5PBKDF2:"1.2.840.113549.1.5.12","des-EDE3-CBC":"1.2.840.113549.3.7",data:"1.2.840.113549.1.7.1","signed-data":"1.2.840.113549.1.7.2","enveloped-data":"1.2.840.113549.1.7.3","digested-data":"1.2.840.113549.1.7.5","encrypted-data":"1.2.840.113549.1.7.6","authenticated-data":"1.2.840.113549.1.9.16.1.2",tstinfo:"1.2.840.113549.1.9.16.1.4",signingCertificate:"1.2.840.113549.1.9.16.2.12",timeStampToken:"1.2.840.113549.1.9.16.2.14",signaturePolicyIdentifier:"1.2.840.113549.1.9.16.2.15",etsArchiveTimeStamp:"1.2.840.113549.1.9.16.2.27",signingCertificateV2:"1.2.840.113549.1.9.16.2.47",etsArchiveTimeStampV2:"1.2.840.113549.1.9.16.2.48",extensionRequest:"1.2.840.113549.1.9.14",contentType:"1.2.840.113549.1.9.3",messageDigest:"1.2.840.113549.1.9.4",signingTime:"1.2.840.113549.1.9.5",counterSignature:"1.2.840.113549.1.9.6",archiveTimeStampV3:"0.4.0.1733.2.4",pdfRevocationInfoArchival:"1.2.840.113583.1.1.8",adobeTimeStamp:"1.2.840.113583.1.1.9.1"},this.objCache={},this.name2obj=function(t){if(typeof this.objCache[t]!="undefined")return this.objCache[t];if(typeof this.name2oidList[t]=="undefined")throw"Name of ObjectIdentifier not defined: "+t;var e=this.name2oidList[t],r=new re.asn1.DERObjectIdentifier({oid:e});return this.objCache[t]=r,r},this.atype2obj=function(t){if(this.objCache[t]!==void 0)return this.objCache[t];var e;if(t.match(/^\d+\.\d+\.[0-9.]+$/))e=t;else if(this.atype2oidList[t]!==void 0)e=this.atype2oidList[t];else if(this.name2oidList[t]!==void 0)e=this.name2oidList[t];else throw"AttributeType name undefined: "+t;var r=new re.asn1.DERObjectIdentifier({oid:e});return this.objCache[t]=r,r}};re.asn1.x509.OID.oid2name=function(n){var t=re.asn1.x509.OID.name2oidList;for(var e in t)if(t[e]==n)return e;return""};re.asn1.x509.OID.oid2atype=function(n){var t=re.asn1.x509.OID.atype2oidList;for(var e in t)if(t[e]==n)return e;return n};re.asn1.x509.OID.name2oid=function(n){if(n.match(/^[0-9.]+$/))return n;var t=re.asn1.x509.OID.name2oidList;return t[n]===void 0?"":t[n]};ke.getPosArrayOfChildrenFromHex=function(n){return se.getChildIdx(n,0)};ke.getHexValueArrayOfChildrenFromHex=function(n){var t=se,e=t.getV,A=ke.getPosArrayOfChildrenFromHex(n),r=e(n,A[0]),i=e(n,A[1]),a=e(n,A[2]),o=e(n,A[3]),s=e(n,A[4]),l=e(n,A[5]),u=e(n,A[6]),d=e(n,A[7]),f=e(n,A[8]),A=new Array;return A.push(r,i,a,o,s,l,u,d,f),A};ke.prototype.readPrivateKeyFromPEMString=function(n){var t=rn(n),e=ke.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])};ke.prototype.readPKCS5PrvKeyHex=function(n){var t=ke.getHexValueArrayOfChildrenFromHex(n);this.setPrivateEx(t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])};ke.prototype.readPKCS8PrvKeyHex=function(n){var t,e,r,i,a,o,s,l,u=se,d=u.getVbyListEx;if(u.isASN1HEX(n)===!1)throw new Error("not ASN.1 hex string");try{t=d(n,0,[2,0,1],"02"),e=d(n,0,[2,0,2],"02"),r=d(n,0,[2,0,3],"02"),i=d(n,0,[2,0,4],"02"),a=d(n,0,[2,0,5],"02"),o=d(n,0,[2,0,6],"02"),s=d(n,0,[2,0,7],"02"),l=d(n,0,[2,0,8],"02")}catch(f){throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(t,e,r,i,a,o,s,l)};ke.prototype.readPKCS5PubKeyHex=function(n){var t=se,e=t.getV;if(t.isASN1HEX(n)===!1)throw new Error("keyHex is not ASN.1 hex string");var r=t.getChildIdx(n,0);if(r.length!==2||n.substr(r[0],2)!=="02"||n.substr(r[1],2)!=="02")throw new Error("wrong hex for PKCS#5 public key");var i=e(n,r[0]),a=e(n,r[1]);this.setPublic(i,a)};ke.prototype.readPKCS8PubKeyHex=function(n){var t=se;if(t.isASN1HEX(n)===!1)throw new Error("not ASN.1 hex string");if(t.getTLVbyListEx(n,0,[0,0])!=="06092a864886f70d010101")throw new Error("not PKCS8 RSA public key");var e=t.getTLVbyListEx(n,0,[1,0]);this.readPKCS5PubKeyHex(e)};ke.prototype.readCertPubKeyHex=function(n,t){var e,r;e=new Ke,e.readCertHex(n),r=e.getPublicKeyHex(),this.readPKCS8PubKeyHex(r)};function i0(n){for(var t in re.crypto.Util.DIGESTINFOHEAD){var e=re.crypto.Util.DIGESTINFOHEAD[t],r=e.length;if(n.substring(0,r)==e){var i=[t,n.substring(r)];return i}}return[]}ke.prototype.verify=function(n,t){if(t=t.toLowerCase(),t.match(/^[0-9a-f]+$/)==null)return!1;var e=yt(t,16),r=this.n.bitLength();if(e.bitLength()>r)return!1;var i=this.doPublic(e),a=i.toString(16);if(a.length+3!=r/4)return!1;var o=a.replace(/^1f+00/,""),s=i0(o);if(s.length==0)return!1;var l=s[0],u=s[1],d=function(A){return re.crypto.Util.hashString(A,l)},f=d(n);return u==f};ke.prototype.verifyWithMessageHash=function(n,t){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var e=yt(t,16);if(e.bitLength()>this.n.bitLength())return 0;var r=this.doPublic(e),i=r.toString(16).replace(/^1f+00/,""),a=i0(i);if(a.length==0)return!1;a[0];var o=a[1];return o==n};ke.prototype.verifyPSS=function(n,t,e,r){var i=function(o){return re.crypto.Util.hashHex(o,e)},a=i(Pi(n));return r===void 0&&(r=-1),this.verifyWithMessageHashPSS(a,t,e,r)};ke.prototype.verifyWithMessageHashPSS=function(n,t,e,r){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var i=new fe(t,16),a=function(g){return re.crypto.Util.hashHex(g,e)},o=xr(n),s=o.length,l=this.n.bitLength()-1,u=Math.ceil(l/8),d;if(r===-1||r===void 0)r=s;else if(r===-2)r=u-s-2;else if(r<-2)throw new Error("invalid salt length");if(u<s+r+2)throw new Error("data too long");var f=this.doPublic(i).toByteArray();for(d=0;d<f.length;d+=1)f[d]&=255;for(;f.length<u;)f.unshift(0);if(f[u-1]!==188)throw new Error("encoded message does not end in 0xbc");f=String.fromCharCode.apply(String,f);var A=f.substr(0,u-s-1),m=f.substr(A.length,s),h=65280>>8*u-l&255;if(A.charCodeAt(0)&h)throw new Error("bits beyond keysize not zero");var v=pss_mgf1_str(m,A.length,a),y=[];for(d=0;d<A.length;d+=1)y[d]=A.charCodeAt(d)^v.charCodeAt(d);y[0]&=~h;var p=u-s-r-2;for(d=0;d<p;d+=1)if(y[d]!==0)throw new Error("leftmost octets not zero");if(y[p]!==1)throw new Error("0x01 marker not found");return m===xr(a(Pi("\0\0\0\0\0\0\0\0"+o+String.fromCharCode.apply(String,y.slice(-r)))))};ke.SALT_LEN_HLEN=-1;ke.SALT_LEN_MAX=-2;ke.SALT_LEN_RECOVER=-2;function Ke(n){var t=se,e=t.getChildIdx,r=t.getV,i=t.getTLV,a=t.getVbyList,o=t.getVbyListEx,s=t.getTLVbyList,l=t.getTLVbyListEx,u=t.getIdxbyList,d=t.getIdxbyListEx,f=t.getVidx,A=t.getInt,m=t.oidname,h=t.hextooidstr,v=rn,y;try{y=re.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch(p){}this.HEX2STAG={"0c":"utf8",13:"prn",16:"ia5","1a":"vis","1e":"bmp"},this.hex=null,this.version=0,this.foffset=0,this.aExtInfo=null,this.getVersion=function(){if(this.hex===null||this.version!==0)return this.version;var p=s(this.hex,0,[0,0]);if(p.substr(0,2)=="a0"){var g=s(p,0,[0]),x=A(g,0);if(x<0||2<x)throw new Error("malformed version field");return this.version=x+1,this.version}else return this.version=1,this.foffset=-1,1},this.getSerialNumberHex=function(){return o(this.hex,0,[0,0],"02")},this.getSignatureAlgorithmField=function(){var p=l(this.hex,0,[0,1]);return this.getAlgorithmIdentifierName(p)},this.getAlgorithmIdentifierName=function(p){for(var g in y)if(p===y[g])return g;return m(o(p,0,[0],"06"))},this.getIssuer=function(){return this.getX500Name(this.getIssuerHex())},this.getIssuerHex=function(){return s(this.hex,0,[0,3+this.foffset],"30")},this.getIssuerString=function(){var p=this.getIssuer();return p.str},this.getSubject=function(){return this.getX500Name(this.getSubjectHex())},this.getSubjectHex=function(){return s(this.hex,0,[0,5+this.foffset],"30")},this.getSubjectString=function(){var p=this.getSubject();return p.str},this.getNotBefore=function(){var p=a(this.hex,0,[0,4+this.foffset,0]);return p=p.replace(/(..)/g,"%$1"),p=decodeURIComponent(p),p},this.getNotAfter=function(){var p=a(this.hex,0,[0,4+this.foffset,1]);return p=p.replace(/(..)/g,"%$1"),p=decodeURIComponent(p),p},this.getPublicKeyHex=function(){return t.getTLVbyList(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyIdx=function(){return u(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyContentIdx=function(){var p=this.getPublicKeyIdx();return u(this.hex,p,[1,0],"30")},this.getPublicKey=function(){return en.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var p=s(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(p)},this.getSignatureValueHex=function(){return a(this.hex,0,[2],"03",!0)},this.verifySignature=function(p){var g=this.getSignatureAlgorithmField(),x=this.getSignatureValueHex(),b=s(this.hex,0,[0],"30"),w=new re.crypto.Signature({alg:g});return w.init(p),w.updateHex(b),w.verify(x)},this.parseExt=function(p){var g,x,b;if(p===void 0){if(b=this.hex,this.version!==3)return-1;g=u(b,0,[0,7,0],"30"),x=e(b,g)}else{b=rn(p);var w=u(b,0,[0,3,0,0],"06");if(r(b,w)!="2a864886f70d01090e"){this.aExtInfo=new Array;return}g=u(b,0,[0,3,0,1,0],"30"),x=e(b,g),this.hex=b}this.aExtInfo=new Array;for(var E=0;E<x.length;E++){var M={};M.critical=!1;var C=e(b,x[E]),P=0;C.length===3&&(M.critical=!0,P=1),M.oid=t.hextooidstr(a(b,x[E],[0],"06"));var S=u(b,x[E],[1+P]);M.vidx=f(b,S),this.aExtInfo.push(M)}},this.getExtInfo=function(p){var g=this.aExtInfo,x=p;if(p.match(/^[0-9.]+$/)||(x=re.asn1.x509.OID.name2oid(p)),x!==""){for(var b=0;b<g.length;b++)if(g[b].oid===x)return g[b]}},this.getExtBasicConstraints=function(p,g){if(p===void 0&&g===void 0){var x=this.getExtInfo("basicConstraints");if(x===void 0)return;p=i(this.hex,x.vidx),g=x.critical}var b={extname:"basicConstraints"};if(g&&(b.critical=!0),p==="3000")return b;if(p==="30030101ff")return b.cA=!0,b;if(p.substr(0,12)==="30060101ff02"){var w=r(p,10),E=parseInt(w,16);return b.cA=!0,b.pathLen=E,b}throw new Error("hExtV parse error: "+p)},this.getExtKeyUsage=function(p,g){if(p===void 0&&g===void 0){var x=this.getExtInfo("keyUsage");if(x===void 0)return;p=i(this.hex,x.vidx),g=x.critical}var b={extname:"keyUsage"};return g&&(b.critical=!0),b.names=this.getExtKeyUsageString(p).split(","),b},this.getExtKeyUsageBin=function(p){if(p===void 0){var g=this.getExtInfo("keyUsage");if(g===void 0)return"";p=i(this.hex,g.vidx)}if(p.length!=8&&p.length!=10)throw new Error("malformed key usage value: "+p);var x="000000000000000"+parseInt(p.substr(6),16).toString(2);return p.length==8&&(x=x.slice(-8)),p.length==10&&(x=x.slice(-16)),x=x.replace(/0+$/,""),x==""&&(x="0"),x},this.getExtKeyUsageString=function(p){for(var g=this.getExtKeyUsageBin(p),x=new Array,b=0;b<g.length;b++)g.substr(b,1)=="1"&&x.push(Ke.KEYUSAGE_NAME[b]);return x.join(",")},this.getExtSubjectKeyIdentifier=function(p,g){if(p===void 0&&g===void 0){var x=this.getExtInfo("subjectKeyIdentifier");if(x===void 0)return;p=i(this.hex,x.vidx),g=x.critical}var b={extname:"subjectKeyIdentifier"};g&&(b.critical=!0);var w=r(p,0);return b.kid={hex:w},b},this.getExtAuthorityKeyIdentifier=function(p,g){if(p===void 0&&g===void 0){var x=this.getExtInfo("authorityKeyIdentifier");if(x===void 0)return;p=i(this.hex,x.vidx),g=x.critical}var b={extname:"authorityKeyIdentifier"};g&&(b.critical=!0);for(var w=e(p,0),E=0;E<w.length;E++){var M=p.substr(w[E],2);if(M==="80"&&(b.kid={hex:r(p,w[E])}),M==="a1"){var C=i(p,w[E]),P=this.getGeneralNames(C);b.issuer=P[0].dn}M==="82"&&(b.sn={hex:r(p,w[E])})}return b},this.getExtExtKeyUsage=function(p,g){if(p===void 0&&g===void 0){var x=this.getExtInfo("extKeyUsage");if(x===void 0)return;p=i(this.hex,x.vidx),g=x.critical}var b={extname:"extKeyUsage",array:[]};g&&(b.critical=!0);for(var w=e(p,0),E=0;E<w.length;E++)b.array.push(m(r(p,w[E])));return b},this.getExtExtKeyUsageName=function(){var p=this.getExtInfo("extKeyUsage");if(p===void 0)return p;var g=new Array,x=i(this.hex,p.vidx);if(x==="")return g;for(var b=e(x,0),w=0;w<b.length;w++)g.push(m(r(x,b[w])));return g},this.getExtSubjectAltName=function(p,g){if(p===void 0&&g===void 0){var x=this.getExtInfo("subjectAltName");if(x===void 0)return;p=i(this.hex,x.vidx),g=x.critical}var b={extname:"subjectAltName",array:[]};return g&&(b.critical=!0),b.array=this.getGeneralNames(p),b},this.getExtIssuerAltName=function(p,g){if(p===void 0&&g===void 0){var x=this.getExtInfo("issuerAltName");if(x===void 0)return;p=i(this.hex,x.vidx),g=x.critical}var b={extname:"issuerAltName",array:[]};return g&&(b.critical=!0),b.array=this.getGeneralNames(p),b},this.getGeneralNames=function(p){for(var g=e(p,0),x=[],b=0;b<g.length;b++){var w=this.getGeneralName(i(p,g[b]));w!==void 0&&x.push(w)}return x},this.getGeneralName=function(p){var g=p.substr(0,2),x=r(p,0),b=xr(x);if(g=="81")return{rfc822:b};if(g=="82")return{dns:b};if(g=="86")return{uri:b};if(g=="87")return{ip:Bo(x)};if(g=="a4")return{dn:this.getX500Name(x)}},this.getExtSubjectAltName2=function(){var p,g,x,b=this.getExtInfo("subjectAltName");if(b===void 0)return b;for(var w=new Array,E=i(this.hex,b.vidx),M=e(E,0),C=0;C<M.length;C++)x=E.substr(M[C],2),p=r(E,M[C]),x==="81"&&(g=or(p),w.push(["MAIL",g])),x==="82"&&(g=or(p),w.push(["DNS",g])),x==="84"&&(g=Ke.hex2dn(p,0),w.push(["DN",g])),x==="86"&&(g=or(p),w.push(["URI",g])),x==="87"&&(g=Bo(p),w.push(["IP",g]));return w},this.getExtCRLDistributionPoints=function(p,g){if(p===void 0&&g===void 0){var x=this.getExtInfo("cRLDistributionPoints");if(x===void 0)return;p=i(this.hex,x.vidx),g=x.critical}var b={extname:"cRLDistributionPoints",array:[]};g&&(b.critical=!0);for(var w=e(p,0),E=0;E<w.length;E++){var M=i(p,w[E]);b.array.push(this.getDistributionPoint(M))}return b},this.getDistributionPoint=function(p){for(var g={},x=e(p,0),b=0;b<x.length;b++){var w=p.substr(x[b],2),E=i(p,x[b]);w=="a0"&&(g.dpname=this.getDistributionPointName(E))}return g},this.getDistributionPointName=function(p){for(var g={},x=e(p,0),b=0;b<x.length;b++){var w=p.substr(x[b],2),E=i(p,x[b]);w=="a0"&&(g.full=this.getGeneralNames(E))}return g},this.getExtCRLDistributionPointsURI=function(){var p=this.getExtInfo("cRLDistributionPoints");if(p===void 0)return p;for(var g=new Array,x=e(this.hex,p.vidx),b=0;b<x.length;b++)try{var w=a(this.hex,x[b],[0,0,0],"86"),E=or(w);g.push(E)}catch(M){}return g},this.getExtAIAInfo=function(){var p=this.getExtInfo("authorityInfoAccess");if(p===void 0)return p;for(var g={ocsp:[],caissuer:[]},x=e(this.hex,p.vidx),b=0;b<x.length;b++){var w=a(this.hex,x[b],[0],"06"),E=a(this.hex,x[b],[1],"86");w==="2b06010505073001"&&g.ocsp.push(or(E)),w==="2b06010505073002"&&g.caissuer.push(or(E))}return g},this.getExtAuthorityInfoAccess=function(p,g){if(p===void 0&&g===void 0){var x=this.getExtInfo("authorityInfoAccess");if(x===void 0)return;p=i(this.hex,x.vidx),g=x.critical}var b={extname:"authorityInfoAccess",array:[]};g&&(b.critical=!0);for(var w=e(p,0),E=0;E<w.length;E++){var M=o(p,w[E],[0],"06"),C=a(p,w[E],[1],"86"),P=or(C);if(M=="2b06010505073001")b.array.push({ocsp:P});else if(M=="2b06010505073002")b.array.push({caissuer:P});else throw new Error("unknown method: "+M)}return b},this.getExtCertificatePolicies=function(p,g){if(p===void 0&&g===void 0){var x=this.getExtInfo("certificatePolicies");if(x===void 0)return;p=i(this.hex,x.vidx),g=x.critical}var b={extname:"certificatePolicies",array:[]};g&&(b.critical=!0);for(var w=e(p,0),E=0;E<w.length;E++){var M=i(p,w[E]),C=this.getPolicyInformation(M);b.array.push(C)}return b},this.getPolicyInformation=function(p){var g={},x=a(p,0,[0],"06");g.policyoid=m(x);var b=d(p,0,[1],"30");if(b!=-1){g.array=[];for(var w=e(p,b),E=0;E<w.length;E++){var M=i(p,w[E]),C=this.getPolicyQualifierInfo(M);g.array.push(C)}}return g},this.getPolicyQualifierInfo=function(p){var g={},x=a(p,0,[0],"06");if(x==="2b06010505070201"){var b=o(p,0,[1],"16");g.cps=xr(b)}else if(x==="2b06010505070202"){var w=s(p,0,[1],"30");g.unotice=this.getUserNotice(w)}return g},this.getUserNotice=function(p){for(var g={},x=e(p,0),b=0;b<x.length;b++){var w=i(p,x[b]);w.substr(0,2)!="30"&&(g.exptext=this.getDisplayText(w))}return g},this.getDisplayText=function(p){var g={"0c":"utf8",16:"ia5","1a":"vis","1e":"bmp"},x={};return x.type=g[p.substr(0,2)],x.str=xr(r(p,0)),x},this.getExtCRLNumber=function(p,g){var x={extname:"cRLNumber"};if(g&&(x.critical=!0),p.substr(0,2)=="02")return x.num={hex:r(p,0)},x;throw new Error("hExtV parse error: "+p)},this.getExtCRLReason=function(p,g){var x={extname:"cRLReason"};if(g&&(x.critical=!0),p.substr(0,2)=="0a")return x.code=parseInt(r(p,0),16),x;throw new Error("hExtV parse error: "+p)},this.getExtOcspNonce=function(p,g){var x={extname:"ocspNonce"};g&&(x.critical=!0);var b=r(p,0);return x.hex=b,x},this.getExtOcspNoCheck=function(p,g){var x={extname:"ocspNoCheck"};return g&&(x.critical=!0),x},this.getExtAdobeTimeStamp=function(p,g){if(p===void 0&&g===void 0){var x=this.getExtInfo("adobeTimeStamp");if(x===void 0)return;p=i(this.hex,x.vidx),g=x.critical}var b={extname:"adobeTimeStamp"};g&&(b.critical=!0);var w=e(p,0);if(w.length>1){var E=i(p,w[1]),M=this.getGeneralName(E);M.uri!=null&&(b.uri=M.uri)}if(w.length>2){var C=i(p,w[2]);C=="0101ff"&&(b.reqauth=!0),C=="010100"&&(b.reqauth=!1)}return b},this.getX500NameRule=function(p){for(var g=null,x=[],b=0;b<p.length;b++)for(var w=p[b],E=0;E<w.length;E++)x.push(w[E]);for(var b=0;b<x.length;b++){var M=x[b],C=M.ds,P=M.value,S=M.type;if(C!="prn"&&C!="utf8"&&C!="ia5")return"mixed";if(C=="ia5"){if(S!="CN")return"mixed";if(re.lang.String.isMail(P))continue;return"mixed"}if(S=="C"){if(C=="prn")continue;return"mixed"}if(g==null)g=C;else if(g!==C)return"mixed"}return g==null?"prn":g},this.getX500Name=function(p){var g=this.getX500NameArray(p),x=this.dnarraytostr(g);return{array:g,str:x}},this.getX500NameArray=function(p){for(var g=[],x=e(p,0),b=0;b<x.length;b++)g.push(this.getRDN(i(p,x[b])));return g},this.getRDN=function(p){for(var g=[],x=e(p,0),b=0;b<x.length;b++)g.push(this.getAttrTypeAndValue(i(p,x[b])));return g},this.getAttrTypeAndValue=function(p){var g={type:null,value:null,ds:null},x=e(p,0),b=a(p,x[0],[],"06"),w=a(p,x[1],[]),E=re.asn1.ASN1Util.oidHexToInt(b);return g.type=re.asn1.x509.OID.oid2atype(E),g.ds=this.HEX2STAG[p.substr(x[1],2)],g.ds!="bmp"?g.value=or(w):g.value=Wl(w),g},this.readCertPEM=function(p){this.readCertHex(v(p))},this.readCertHex=function(p){this.hex=p,this.getVersion();try{u(this.hex,0,[0,7],"a3"),this.parseExt()}catch(g){}},this.getParam=function(){var p={};return p.version=this.getVersion(),p.serial={hex:this.getSerialNumberHex()},p.sigalg=this.getSignatureAlgorithmField(),p.issuer=this.getIssuer(),p.notbefore=this.getNotBefore(),p.notafter=this.getNotAfter(),p.subject=this.getSubject(),p.sbjpubkey=Kl(this.getPublicKeyHex(),"PUBLIC KEY"),this.aExtInfo.length>0&&(p.ext=this.getExtParamArray()),p.sighex=this.getSignatureValueHex(),p},this.getExtParamArray=function(p){if(p==null){var g=d(this.hex,0,[0,"[3]"]);g!=-1&&(p=l(this.hex,0,[0,"[3]",0],"30"))}for(var x=[],b=e(p,0),w=0;w<b.length;w++){var E=i(p,b[w]),M=this.getExtParam(E);M!=null&&x.push(M)}return x},this.getExtParam=function(p){var g=e(p,0),x=g.length;if(x!=2&&x!=3)throw new Error("wrong number elements in Extension: "+x+" "+p);var b=h(a(p,0,[0],"06")),w=!1;x==3&&s(p,0,[1])=="0101ff"&&(w=!0);var E=s(p,0,[x-1,0]),M=void 0;if(b=="2.5.29.14"?M=this.getExtSubjectKeyIdentifier(E,w):b=="2.5.29.15"?M=this.getExtKeyUsage(E,w):b=="2.5.29.17"?M=this.getExtSubjectAltName(E,w):b=="2.5.29.18"?M=this.getExtIssuerAltName(E,w):b=="2.5.29.19"?M=this.getExtBasicConstraints(E,w):b=="2.5.29.31"?M=this.getExtCRLDistributionPoints(E,w):b=="2.5.29.32"?M=this.getExtCertificatePolicies(E,w):b=="2.5.29.35"?M=this.getExtAuthorityKeyIdentifier(E,w):b=="2.5.29.37"?M=this.getExtExtKeyUsage(E,w):b=="1.3.6.1.5.5.7.1.1"?M=this.getExtAuthorityInfoAccess(E,w):b=="2.5.29.20"?M=this.getExtCRLNumber(E,w):b=="2.5.29.21"?M=this.getExtCRLReason(E,w):b=="1.3.6.1.5.5.7.48.1.2"?M=this.getExtOcspNonce(E,w):b=="1.3.6.1.5.5.7.48.1.5"?M=this.getExtOcspNoCheck(E,w):b=="1.2.840.113583.1.1.9.1"&&(M=this.getExtAdobeTimeStamp(E,w)),M!=null)return M;var C={extname:b,extn:E};return w&&(C.critical=!0),C},this.findExt=function(p,g){for(var x=0;x<p.length;x++)if(p[x].extname==g)return p[x];return null},this.dnarraytostr=function(p){function g(b){return b.map(function(w){return x(w).replace(/\+/,"\\+")}).join("+")}function x(b){return b.type+"="+b.value}return"/"+p.map(function(b){return g(b).replace(/\//,"\\/")}).join("/")},this.getInfo=function(){var p=function(X){var K=JSON.stringify(X.array).replace(/[\[\]\{\}\"]/g,"");return K},g=function(X){for(var K="",Q=X.array,G=0;G<Q.length;G++){var J=Q[G];if(K+=" policy oid: "+J.policyoid+`
|
|
363
363
|
`,J.array!==void 0)for(var H=0;H<J.array.length;H++){var j=J.array[H];j.cps!==void 0&&(K+=" cps: "+j.cps+`
|
|
364
364
|
`)}}return K},x=function(X){for(var K="",Q=X.array,G=0;G<Q.length;G++){var J=Q[G];try{J.dpname.full[0].uri!==void 0&&(K+=" "+J.dpname.full[0].uri+`
|
|
365
365
|
`)}catch(H){}try{J.dname.full[0].dn.hex!==void 0&&(K+=" "+Ke.hex2dn(J.dpname.full[0].dn.hex)+`
|
|
@@ -374,8 +374,8 @@
|
|
|
374
374
|
`,w+=" subject: "+this.getSubjectString()+`
|
|
375
375
|
`,w+=` subject public key info:
|
|
376
376
|
`,E=this.getPublicKey(),w+=" key algorithm: "+E.type+`
|
|
377
|
-
`,E.type==="RSA"&&(w+=" n="+
|
|
378
|
-
`,w+=" e="+
|
|
377
|
+
`,E.type==="RSA"&&(w+=" n="+Ro(E.n.toString(16)).substr(0,16)+`...
|
|
378
|
+
`,w+=" e="+Ro(E.e.toString(16))+`
|
|
379
379
|
`),M=this.aExtInfo,M!=null){w+=`X509v3 Extensions:
|
|
380
380
|
`;for(var C=0;C<M.length;C++){var P=M[C],S=re.asn1.x509.OID.oid2name(P.oid);S===""&&(S=P.oid);var T="";if(P.critical===!0&&(T="CRITICAL"),w+=" "+S+" "+T+`:
|
|
381
381
|
`,S==="basicConstraints"){var B=this.getExtBasicConstraints();B.cA===void 0?w+=` {}
|
|
@@ -387,36 +387,36 @@
|
|
|
387
387
|
`}else if(S==="subjectAltName"){var O=p(this.getExtSubjectAltName());w+=" "+O+`
|
|
388
388
|
`}else if(S==="cRLDistributionPoints"){var D=this.getExtCRLDistributionPoints();w+=x(D)}else if(S==="authorityInfoAccess"){var N=this.getExtAuthorityInfoAccess();w+=b(N)}else S==="certificatePolicies"&&(w+=g(this.getExtCertificatePolicies()))}}return w+="signature algorithm: "+this.getSignatureAlgorithmName()+`
|
|
389
389
|
`,w+="signature: "+this.getSignatureValueHex().substr(0,16)+`...
|
|
390
|
-
`,w},typeof n=="string"&&(n.indexOf("-----BEGIN")!=-1?this.readCertPEM(n):re.lang.String.isHex(n)&&this.readCertHex(n))}Ke.hex2dn=function(n,t){t===void 0&&(t=0);var e=new Ke;se.getTLV(n,t);var r=e.getX500Name(n);return r.str};Ke.hex2rdn=function(n,t){if(t===void 0&&(t=0),n.substr(t,2)!=="31")throw new Error("malformed RDN");for(var e=new Array,r=se.getChildIdx(n,t),i=0;i<r.length;i++)e.push(Ke.hex2attrTypeValue(n,r[i]));return e=e.map(function(a){return a.replace("+","\\+")}),e.join("+")};Ke.hex2attrTypeValue=function(n,t){var e=se,r=e.getV;if(t===void 0&&(t=0),n.substr(t,2)!=="30")throw new Error("malformed attribute type and value");var i=e.getChildIdx(n,t);i.length!==2||n.substr(i[0],2);var a=r(n,i[0]),o=re.asn1.ASN1Util.oidHexToInt(a),s=re.asn1.x509.OID.oid2atype(o),l=r(n,i[1]),u=xr(l);return s+"="+u};Ke.getPublicKeyFromCertHex=function(n){var t=new Ke;return t.readCertHex(n),t.getPublicKey()};Ke.getPublicKeyFromCertPEM=function(n){var t=new Ke;return t.readCertPEM(n),t.getPublicKey()};Ke.getPublicKeyInfoPropOfCertPEM=function(n){var t=se,e=t.getVbyList,r={},i,a;return r.algparam=null,i=new Ke,i.readCertPEM(n),a=i.getPublicKeyHex(),r.keyhex=e(a,0,[1],"03").substr(2),r.algoid=e(a,0,[0,0],"06"),r.algoid==="2a8648ce3d0201"&&(r.algparam=e(a,0,[0,1],"06")),r};Ke.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"];function ko(n){return we.SHA256(n).toString()}var i0=[function(){var n=new Ke;return n.readCertPEM(function(){var t=113,e=126,r=0,i="";return arguments[r].split(i).map(function(a){return a.charCodeAt(r)>e?a:String.fromCharCode((a.charCodeAt(r)+t)%e)}).join(i)}(":::::ORTV[-PR_aVSVPNaR:::::ZVVS@ PPNErtNVON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ature(n.getPublicKey());var r=_l(e,t);return!r||n.verifySignature(r.getPublicKey())===!1?!1:a0(r,t)}function o0(n){var t=n.getIssuerHex();return t===n.getSubjectHex()?!1:a0(n,i0)}function Zl(n){var t=new Ke;typeof n=="string"?t.readCertPEM(n):t.readCertHex(n.hex);var e=o0(t);return i0.push(t),e}function Yl(n,t,e){var r=new Ke;if(typeof e=="string"?r.readCertPEM(e):r.readCertHex(e.hex),o0(r)===!1)return!1;var i=new ke;return i.readCertPubKeyHex(r.hex,6),!!i.verify(n,Ja(t))}Zl(function(){var t=113,e=126,r=0,i="";return arguments[r].split(i).map(function(a){return a.charCodeAt(r)>e?a:String.fromCharCode((a.charCodeAt(r)+t)%e)}).join(i)}(":::::ORTV[-PR_aVSVPNaR:::::ZVVTU PPONrtNVONtVWNW=_SVw VE=ZN=TP`\0T`Vo@Q^ROPbNZVTSZ^P^fQc^^TRWQawR^ZNATN>bRPNU^zc}nzyg R^ZNATN>bROU^zc}nzyg R]ZN=TN>bRPtTn?bf?FZ_NQtfQc^^YQNq`gdSp?cyZ^P^fQc^^QQNWQ^aRvZPNTP`\0T`Vo@Q^RWN_fapzFqSFwfbOndSnzyuYz[oaNrS=\bZQNAZaN\\aZ [QSnS=\b[aNBZQZ\\aZ [QSnZVTaZ^P^fQc^^TRWQawR^ZNATN>bRPNU^zc}nzyg R^ZNATN>bROU^zc}nzyg RbZOVTN>bRPtYoTyuoz}}f`Bwo?=\x07RQN\\Ot[cONZO>Wyfd\x07 gdb\x07RaN]Ot[cONZZPRuupz_@feWyZ`bVfWX|gVup[N^xOSugnec|fdy\x07ndB{^T\x07}fdB\0ndRf?FZVVPVwN[Otx\0uxvTF=ON^RSNN\\PNtENZVVPPtXPNtRN?=?]q[VD|{\\oyo`oOu}F SA\x07e`tn[t u\b8^a]qx\bE_^\x07ZN?[QC\0yuOpybY8r\\RPAS=8rUq\0E8>xean^e\bf]Y`XO}{C[Ur^?\0x[SRXvVQ\\CFr}QnAPRQ\x07FO=Yw\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VBbnTqEE[QzDyqF`bF}R=Q?VeDo<Vzb\0w}D}NZ\0t}^?OyFP\bVaVNrTNYqe?[NRYTSQby@yzWvT`wQo}y]c_WgxBYCy RNRg@\x07NZCaaq8?` ^`?ryD =obzw?E]Ou\x07]n@>bVzqAQT?@_zo@}CxWVTUsAYdNd?{APQr8{P]]AZ>aR\0[D<z?Tr@`u@X|YDwd_<p<>zWE>]\0=X`\b@uucp|^_Qb@uZouTX^o\0\\{PCq{ug\x078^f[YQAWad8FNqxFQE?ZOo }RnO\bsQc xyccn=nxvs>bDBf\b\bW\\TuTnvAO^U\0QXC>xx8FxRFf<tJ:::::R[Q-PR_aVSVPNaR:::::"));var xa=function(n,t){return xa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])},xa(n,t)};function ue(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");xa(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var F=function(){return F=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])}return t},F.apply(this,arguments)};function Ct(n,t,e,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(n,t,e,r);else for(var s=n.length-1;s>=0;s--)(o=n[s])&&(a=(i<3?o(a):i>3?o(t,e,a):o(t,e))||a);return i>3&&a&&Object.defineProperty(t,e,a),a}function Mt(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)}function Bi(n,t,e,r){function i(a){return a instanceof e?a:new e(function(o){o(a)})}return new(e||(e=Promise))(function(a,o){function s(d){try{u(r.next(d))}catch(f){o(f)}}function l(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):i(d.value).then(s,l)}u((r=r.apply(n,t||[])).next())})}function Ri(n,t){var e={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(u){return function(d){return l([u,d])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(e=0)),e;)try{if(r=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return e.label++,{value:u[1],done:!1};case 5:e.label++,i=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(a=e.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){e.label=u[1];break}if(u[0]===6&&e.label<a[1]){e.label=a[1],a=u;break}if(a&&e.label<a[2]){e.label=a[2],e.ops.push(u);break}a[2]&&e.ops.pop(),e.trys.pop();continue}u=t.call(n,e)}catch(d){u=[6,d],i=0}finally{r=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function bt(n,t,e){if(e||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return n.concat(a||Array.prototype.slice.call(t))}function $l(n){return typeof Symbol=="undefined"?"$Symbol<".concat(n,">$"):Symbol(n)}var zn=$l("$$FIVE_EVENT$$");function Bn(n){return n[zn]||(n[zn]={}),n[zn]}function ec(n){n[zn]&&delete n[zn]}var ki=function(){function n(){}return n.prototype.hasListener=function(t){var e=Bn(this);return e&&e[t]&&e[t].callbacks.length>0},n.prototype.on=function(t,e,r){var i=this,a=Bn(this);return a[t]||(a[t]={called:[!1],callbacks:[]}),a[t].callbacks.push([e,r||!1]),function(){return i.off(t,e)}},n.prototype.once=function(t,e){return this.on(t,e,!0)},n.prototype.off=function(t,e){if(t===void 0){ec(this);return}var r=Bn(this);if(r[t]||(r[t]={called:[!1],callbacks:[]}),e===void 0){r[t].callbacks.length=0;return}for(var i=0;i<r[t].callbacks.length&&r[t].callbacks[i][0]!==e;i++);i<r[t].callbacks.length&&r[t].callbacks.splice(i,1)},n.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var i=!1,a=Bn(this);a[t]||(a[t]={called:[!1],callbacks:[]}),a[t].called=[!0,e];for(var o=a[t].callbacks.slice(),s=0,l=o;s<l.length;s++){var u=l[s],d=u[0],f=u[1],A=f===void 0?!1:f,m=d.apply(void 0,e);A&&this.off(t,d),m===!1&&(i=!0)}return i},n.prototype.waitUnitl=function(t){var e=this,r=Bn(this);r[t]||(r[t]={called:[!1],callbacks:[]});var i=r[t].called,a=i[0],o=i[1];return a?Promise.resolve(o):new Promise(function(s){e.once(t,function(){for(var l=[],u=0;u<arguments.length;u++)l[u]=arguments[u];return s(l),!0})})},n}();function z(){}var tc=typeof performance!="undefined"&&typeof performance.timing!="undefined"?performance.timing.navigationStart:Date.now(),Me=typeof performance!="undefined"?function(){return tc+performance.now()}:function(){return Date.now()};function gn(n){Object.freeze(n);var t=typeof n=="function",e=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(n).forEach(function(r){e.call(n,r)&&(!t||r!=="caller"&&r!=="callee"&&r!=="arguments")&&n[r]!==null&&(typeof n[r]=="object"||typeof n[r]=="function")&&!Object.isFrozen(n[r])&&gn(n[r])}),n}var Fo=/^([^.]+)(\.([^.]+))*$/;function rc(n,t){if(n==="*")return!0;var e=n.split(".").reverse(),r=t.split(".").reverse();if(e.length<=1)return n===t;for(var i=0;i<e.length;i++)if(e[i]!==r[i])return!1;return!0}function nn(n){return/^(([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])(\.(?!$)|$)){4}$/.test(n)}function Hr(n,t){return Fo.test(n)&&Fo.test(t)&&rc(n,t)}var nc=[/\.([0-9a-z]+)\.jsonp([\?\#].*)?$/i,/jsonp_([0-9a-z]+)([\?\#].*)?$/i],sr=gn(JSON.parse(function(){var t=113,e=126,r=0,i="";return arguments[r].split(i).map(function(a){return a.charCodeAt(r)>e?a:String.fromCharCode((a.charCodeAt(r)+t)%e)}).join(i)}("h/y|pnyu|/9/xr;p|z/9/yvn{wvn;p|z/9/rnyrr;p|z/9/rnyrr;p{/9/rnyrr;w}/9/uv;p|z/9/uv;p{/9/rnyrr;p{/9/rnyrr;p|z/9/ywpq{;p|z/9/rnyrr:pq{;p|z/9/rnyrr:pq{;p{/9/rnyrr;nv/9/;p{/9/pq{;p{/9/pnyp{|qr;vr/j"))),Wa=function(n){ue(t,n);function t(e,r,i){return n.call(this,"[NETWORK]: request proxy error(type: ".concat(r,", reason: ").concat(i,"): ").concat(e))||this}return t}(Error),gi=function(n){ue(t,n);function t(e,r,i){var a=n.call(this,"[NETWORK]: response error(type: ".concat(r,", status: ").concat(i,"): ").concat(e))||this;return a.httpStatus=i,a}return t}(Error);(function(n){ue(t,n);function t(e,r){return n.call(this,"[NETWORK]: request abort(type: ".concat(r,"): ").concat(e))||this}return t})(Error);var wa=function(n){ue(t,n);function t(e,r,i){return n.call(this,"[NETWORK]: request timeout(type: ".concat(r,", timeout: ").concat(i,"ms): ").concat(e))||this}return t}(Error),Xa=function(n){ue(t,n);function t(e,r,i){return n.call(this,"[NETWORK]: request forbidden(type: ".concat(r,", reason: ").concat(i,"): ").concat(e))||this}return t}(Error);function ic(n){if(!n)return{};for(var t={},e=n.trim().split(`
|
|
391
|
-
`),r=0;r<e.length;r++){var i=e[r],a=i.indexOf(":"),o=i.slice(0,a).trim().toLowerCase(),s=i.slice(a+1).trim();s&&(t[o]?t[o]+=", "+s:t[o]=s)}return t}function Ea(n){for(var t=0,e=nc;t<e.length;t++){var r=e[t],i=n.match(r);if(i)return"jsonp_"+i[1]}return null}function Lo(n){return Ea(n)!==null}function Oo(n){var t=n.match(/^([0-9a-z]+\:)\/\/(([^:/?#]*)(?::[0-9]+)?)/);return t?t[1]:location.protocol}function _a(n){if(/^blob\:/i.test(n))return"blob:";if(/^data\:/i.test(n))return"data:";var t=n.match(/^[0-9a-z]+\:\/\/(([^:/?#]*)(?::[0-9]+)?)/i);return t?t[2]:location.hostname}var s0=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(ki);function xn(n,t,e,r,i){t===void 0&&(t={}),e===void 0&&(e=z),r===void 0&&(r=z),i===void 0&&(i=z);var a=Me(),o=n;return Promise.resolve().then(function(){return t.requestProxy?t.requestProxy(n):n}).then(function(s){return/^https\:/.test(location.href)&&/^http\:/.test(s)?(console.warn("The page at '".concat(location.href,"' was loaded over HTTPS, but requested an insecure element '").concat(s,"'. This request was automatically upgraded to HTTPS")),s.replace(/^http\:/,"https:")):s}).catch(function(s){var l,u=Ea(n),d=u?"Script":"XMLHttpRequest",f=new Wa(o,d,s&&s.message?String(s.message):String(s));return(l=t.networkSubscribe)===null||l===void 0||l.emit("network",n,d,"proxy-error",f.message),Promise.reject(f)}).then(function(s){return new Promise(function(l,u){var d,f=t.allowHosts?sr.concat(t.allowHosts):sr.slice(),A=_a(s),m=Ea(s);if(location.hostname.length!==0&&!nn(location.hostname)&&sr.filter(function(L){return Hr(L,location.hostname)}).length===0&&!nn(A)&&f.filter(function(L){return Hr(L,A)}).length===0){var h=m?"Script":"XMLHttpRequest",v=new Xa(s,h,"request host(".concat(A,") is not allowed"));r(v),u(v),(d=t.networkSubscribe)===null||d===void 0||d.emit("network",s,h,"forbidden",v.message);return}if(m){var y=window,p=null,g=!1,x=document.createElement("script"),b=function(){var L;if(p=null,g!==!0){g=!0;var k=new wa(s,"Script",t.timeout||NaN);r(k),u(k),(L=t.networkSubscribe)===null||L===void 0||L.emit("network",s,"Script","timeout",k.message)}},w=function(L){var k,O,D=Me(),N=D-a;if(delete y[m],x.parentNode&&x.parentNode.removeChild(x),p!==null&&(window.clearTimeout(p),p=null),g!==!0){if(L.indexOf("data:")!==0){var X=new gi(s,"Script",500);r(X),u(X),(k=t.networkSubscribe)===null||k===void 0||k.emit("network",s,"Script","error",X.message);return}var K=L.split(","),Q=(K[0].match(/:(.*?);/)||[])[1],G=K[1];if(t.responseType==="arraybuffer"||t.responseType==="blob"){for(var J=atob(K[1]),H=J.length,j=new Uint8Array(H),Z=0;Z<H;Z++)j[Z]=J.charCodeAt(Z);t.responseType==="arraybuffer"?G=j.buffer:G=new Blob([j],{type:Q})}var Y={},pe={body:G,meta:{origin:o,source:s,requestTime:a,responseTime:D,costs:N,headers:Y}};e(pe),l(pe),(O=t.networkSubscribe)===null||O===void 0||O.emit("network",s,"Script","ok",JSON.stringify(pe.meta)),g=!0}};y[m]=w,x.src=s,document.body.appendChild(x),typeof t.timeout=="number"&&(p=window.setTimeout(b,t.timeout))}else{var E=!1,M=new XMLHttpRequest,C=function(){M&&(M.removeEventListener("timeout",P,!1),M.removeEventListener("progress",S,!1),M.removeEventListener("load",T,!1),M.removeEventListener("error",B,!1)),M=null,C=z},P=function(){var L;if(E!==!0){E=!0,C();var k=new wa(s,"XMLHttpRequest",t.timeout||NaN);r(k),u(k),(L=t.networkSubscribe)===null||L===void 0||L.emit("network",s,"XMLHttpRequest","timeout",k.message)}},S=function(L){E!==!0&&L.lengthComputable&&(L.total<=0||i(L.loaded/L.total))},T=function(L){var k;if(E!==!0){var O=this.status;if(O===0||O>=200&&O<400){E=!0,C();var D=Me(),N=D-a,X=ic(this.getAllResponseHeaders()),K=L.total,Q={body:this.response,meta:{origin:o,source:s,requestTime:a,responseTime:D,costs:N,headers:X,size:K}};e(Q),l(Q),(k=t.networkSubscribe)===null||k===void 0||k.emit("network",s,"XMLHttpRequest","ok",JSON.stringify(Q.meta))}else B.call(this)}},B=function(){var L;if(E!==!0){E=!0,C();var k=new gi(s,"XMLHttpRequest",this.status);r(k),u(k),(L=t.networkSubscribe)===null||L===void 0||L.emit("network",s,"XMLHttpRequest","error",k.message)}};M.addEventListener("timeout",P,!1),M.addEventListener("progress",S,!1),M.addEventListener("load",T,!1),M.addEventListener("error",B,!1),t.responseType&&(M.responseType=t.responseType),typeof t.timeout=="number"&&(M.timeout=t.timeout),M.open("GET",s,!0),M.send(null)}})})}var Hi={};function ac(n,t){t===void 0&&(t={});var e=Me(),r=n;return Promise.resolve().then(function(){return t.requestProxy?t.requestProxy(n):n}).then(function(i){return/^https\:/.test(location.href)&&/^http\:/.test(i)?(console.warn("The page at '".concat(location.href,"' was loaded over HTTPS, but requested an insecure element '").concat(i,"'. This request was automatically upgraded to HTTPS")),i.replace(/^http\:/,"https:")):i}).catch(function(i){var a,o=new Wa(r,"Link",i&&i.message?String(i.message):String(i));return(a=t.networkSubscribe)===null||a===void 0||a.emit("network",n,"Link","proxy-error",o.message),Promise.reject(o)}).then(function(i){return i in Hi?Hi[i]:Hi[i]=new Promise(function(a,o){var s,l=t.allowHosts?sr.concat(t.allowHosts):sr.slice(),u=_a(i);if(location.hostname.length!==0&&!nn(location.hostname)&&sr.filter(function(h){return Hr(h,location.hostname)}).length===0&&!nn(u)&&l.filter(function(h){return Hr(h,u)}).length===0){var d=new Xa(i,"Link","request host(".concat(u,") is not allowed"));o(d),(s=t.networkSubscribe)===null||s===void 0||s.emit("network",i,"Link","forbidden",d.message);return}var f=document.createElement("link");f.href=i,f.rel=f.relList&&f.relList.supports("prefetch")?"prefetch":"preload",f.as="fetch",f.crossOrigin="";var A=document.head||document.getElementsByTagName("head")[0];A&&A.appendChild(f);var m=!1;f.onload=function(){var h;if(m!==!0){m=!0,a();var v=Me(),y=v-e,p={},g={origin:r,source:i,requestTime:e,responseTime:v,costs:y,headers:p};(h=t.networkSubscribe)===null||h===void 0||h.emit("network",i,"Link","preload",JSON.stringify(g))}},f.onerror=function(h){var v;if(m!==!0){m=!0;var y=new gi(i,"Link",0);o(y),(v=t.networkSubscribe)===null||v===void 0||v.emit("network",i,"Link","error",y.message)}}})})}function oc(n,t,e,r,i,a){t===void 0&&(t={}),e===void 0&&(e=z),r===void 0&&(r=z),i===void 0&&(i=z);var o=Me(),s=n;return Promise.resolve().then(function(){return t.requestProxy?t.requestProxy(n):n}).then(function(l){return/^https\:/.test(location.href)&&/^http\:/.test(l)?(console.warn("The page at '".concat(location.href,"' was loaded over HTTPS, but requested an insecure element '").concat(l,"'. This request was automatically upgraded to HTTPS")),l.replace(/^http\:/,"https:")):l}).catch(function(l){var u,d=new Wa(s,"Image",l&&l.message?String(l.message):String(l));return(u=t.networkSubscribe)===null||u===void 0||u.emit("network",n,"Image","proxy-error",d.message),Promise.reject(d)}).then(function(l){return new Promise(function(u,d){var f,A=t.allowHosts?sr.concat(t.allowHosts):sr.slice(),m=_a(l);if(location.hostname.length!==0&&!nn(location.hostname)&&sr.filter(function(b){return Hr(b,location.hostname)}).length===0&&!nn(m)&&A.filter(function(b){return Hr(b,m)}).length===0){var h=new Xa(l,"Image","request host(".concat(m,") is not allowed"));r(h),d(h),(f=t.networkSubscribe)===null||f===void 0||f.emit("network",l,"Image","forbidden",h.message);return}var v=a!=null?a:new Image,y=!1,p=null,g=function(){var b;if(v.onload=z,v.onerror=z,p!==null&&(clearTimeout(p),p=null),y!==!0){var w=Me(),E={headers:{},origin:s,source:l,requestTime:o,responseTime:w,costs:w-o};y=!0;var M={body:v,meta:E};i(1),e(M),u(M),(b=t.networkSubscribe)===null||b===void 0||b.emit("network",l,"Image","ok",JSON.stringify(M.meta))}},x=function(){var b;if(v.onload=z,v.onerror=z,p!==null&&(clearTimeout(p),p=null),y!==!0){y=!0;var w=new gi(l,"Image",0);r(w),d(w),(b=t.networkSubscribe)===null||b===void 0||b.emit("network",l,"Image","ok",w.message)}};typeof t.timeout=="number"&&(p=window.setTimeout(function(){var b;if(v.onload=z,v.onerror=z,p=null,y!==!0){y=!0;var w=new wa(l,"Image",t.timeout);r(w),d(w),(b=t.networkSubscribe)===null||b===void 0||b.emit("network",l,"Image","timeout",w.message)}},t.timeout)),v.onload=g,v.onerror=x,i(0),v.src=l})})}var Za=function(){function n(t){t===void 0&&(t={}),this.options=Object.freeze(t),this.options.allowHosts&&Object.freeze(this.options.allowHosts)}return n.prototype.ajax=function(t,e,r,i,a){var o;e===void 0&&(e={}),r===void 0&&(r=z),i===void 0&&(i=z),a===void 0&&(a=z);var s=this.options,l={responseType:e.responseType,timeout:(o=e.timeout)!==null&&o!==void 0?o:s.timeout,get allowHosts(){var u;return(u=e.allowHosts)!==null&&u!==void 0?u:s.allowHosts},get requestProxy(){var u;return(u=e.requestProxy)!==null&&u!==void 0?u:s.requestProxy},get networkSubscribe(){var u;return(u=e.networkSubscribe)!==null&&u!==void 0?u:s.networkSubscribe}};return xn(t,l,r,i,a)},n.prototype.loadImage=function(t,e,r,i,a,o){var s;e===void 0&&(e={}),r===void 0&&(r=z),i===void 0&&(i=z),a===void 0&&(a=z);var l=this.options,u={timeout:(s=e.timeout)!==null&&s!==void 0?s:l.timeout,get allowHosts(){var d;return(d=e.allowHosts)!==null&&d!==void 0?d:l.allowHosts},get requestProxy(){var d;return(d=e.requestProxy)!==null&&d!==void 0?d:l.requestProxy},get networkSubscribe(){var d;return(d=e.networkSubscribe)!==null&&d!==void 0?d:l.networkSubscribe}};return oc(t,u,r,i,a,o)},n.prototype.preload=function(t,e){var r;e===void 0&&(e={});var i=this.options,a={timeout:(r=e.timeout)!==null&&r!==void 0?r:i.timeout,get allowHosts(){var o;return(o=e.allowHosts)!==null&&o!==void 0?o:i.allowHosts},get requestProxy(){var o;return(o=e.requestProxy)!==null&&o!==void 0?o:i.requestProxy},get networkSubscribe(){var o;return(o=e.networkSubscribe)!==null&&o!==void 0?o:i.networkSubscribe}};return ac(t,a)},n}(),yi=new Za,sc=function(){if(typeof window!="undefined"){var n=window;return n.requestAnimationFrame||n.mozRequestAnimationFrame||n.webkitRequestAnimationFrame||n.msRequestAnimationFrame||function(t){return setTimeout(t,16)}}else return function(t){return setTimeout(t,16)}}(),uc=function(n){var t;if(typeof window!="undefined"){var e=window;t=e.cancelAnimationFrame||e.mozCancelAnimationFrame||e.webkitCancelAnimationFrame||e.msCancelAnimationFrame||function(r){return window.clearTimeout(r)}}else t=function(r){return window.clearTimeout(r)};t(n)},lc=5,Vo=16,vt=function(){function n(){this.frames=[],this.stoped=!1,this.time=Me(),this.context=null,this.loop=this.loop.bind(this),this.loop()}return Object.defineProperty(n,"shared",{get:function(){return this.sharedInstance||(this.sharedInstance=new n),this.sharedInstance},enumerable:!1,configurable:!0}),n.getFrameTime=function(){return Vo},n.prototype.loop=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(!this.stoped){var r=Me(),i=r-this.time;this.time=r;var a=[];Vo=i;for(var o=0,s=this.frames;o<s.length;o++){var l=s[o];if(l.delay>0){l.delay=l.delay-1;continue}try{l.callback.apply(l,bt([r,i],t,!1))}catch(u){console.error(u)}l.once&&a.push(l)}a.length>0&&(this.frames=this.frames.filter(function(u){return a.indexOf(u)===-1})),this.requestAnimationFrame(this.loop)}},n.prototype.setContext=function(t){this.cancelAnimationFrame(this.requestId),this.context=t,this.requestId=this.requestAnimationFrame(this.loop)},n.prototype.getContext=function(){return this.context},n.prototype.requestAnimationFrame=function(t){return this.context?this.context.requestAnimationFrame(t):sc(t)},n.prototype.cancelAnimationFrame=function(t){this.context?this.context.cancelAnimationFrame(t):uc(this.loop),this.requestId=null},n.prototype.remove=function(t){var e=this.frames.indexOf(t);e>=0&&this.frames.splice(e,1)},n.prototype.add=function(t,e,r,i){var a=this;e===void 0&&(e=!1),r===void 0&&(r=0),i===void 0&&(i=lc);var o={callback:t,once:e,delay:r,order:i};return this.frames.push(o),this.frames.sort(function(s,l){return s.order-l.order}),function(){return a.remove(o)}},n.prototype.disponse=function(){this.stoped=!0,this.frames.length=0},n}();function he(n,t,e){return n<t?t:n>e?e:n}var cc={"vrlab-public.ljcdn.com":{type:"tencentCloud",pano:["vrlab-image1.ljcdn.com","vrlab-image2.ljcdn.com"],texture:["vrlab-image3.ljcdn.com"],tile:["vr-tile-1.realsee-cdn.cn","vr-tile-2.realsee-cdn.cn"],model:["vr-model-1.realsee-cdn.cn","vr-model-2.realsee-cdn.cn"],default:["vrlab-image4.ljcdn.com"]},"vr-public.realsee-cdn.cn":{type:"tencentCloud",pano:["vr-image-1.realsee-cdn.cn","vr-image-2.realsee-cdn.cn"],texture:["vr-image-3.realsee-cdn.cn"],tile:["vr-tile-1.realsee-cdn.cn","vr-tile-2.realsee-cdn.cn"],model:["vr-model-1.realsee-cdn.cn","vr-model-2.realsee-cdn.cn"],default:["vr-image-4.realsee-cdn.cn"]},"vr-public.rscdn.cn":{type:"tencentCloud",pano:["vr-image-1.rscdn.cn","vr-image-2.rscdn.cn"],texture:["vr-image-3.rscdn.cn"],tile:["vr-tile-1.rscdn.cn","vr-tile-2.rscdn.cn"],model:["vr-model-1.rscdn.cn","vr-model-2.rscdn.cn"],default:["vr-image-4.rscdn.cn"]},"mars-public.realsee-cdn.cn":{type:"aliyun",pano:["mars-image-1.realsee-cdn.cn","mars-image-2.realsee-cdn.cn"],texture:["mars-image-3.realsee-cdn.cn"],tile:["mars-tile-1.realsee-cdn.cn","mars-tile-2.realsee-cdn.cn"],model:["mars-model-1.realsee-cdn.cn","mars-model-2.realsee-cdn.cn"],default:["mars-image-4.realsee-cdn.cn"]},"global-public.realsee-cdn.com":{type:"tencentCloud",pano:["global-image-1.realsee-cdn.com","global-image-2.realsee-cdn.com"],texture:["global-image-3.realsee-cdn.com"],tile:["global-tile-1.realsee-cdn.com","global-tile-2.realsee-cdn.com"],model:["global-model-1.realsee-cdn.com","global-model-2.realsee-cdn.com"],default:["global-image-4.realsee-cdn.com"]},"earth-ga-public.realsee-cdn.cn":{type:"tencentCloud",pano:["earth-ga-image-1.realsee-cdn.cn","earth-ga-image-2.realsee-cdn.cn"],texture:["earth-ga-image-3.realsee-cdn.cn"],tile:["earth-ga-tile-1.realsee-cdn.cn","earth-ga-tile-2.realsee-cdn.cn"],model:["earth-ga-model-1.realsee-cdn.cn","earth-ga-model-2.realsee-cdn.cn"],default:["earth-ga-image-4.realsee-cdn.cn"]},"test-vr-public.realsee-cdn.com":{type:"tencentCloud",pano:["test-vr-image.realsee-cdn.com","test-vr-image.realsee-cdn.com"],texture:["test-vr-image.realsee-cdn.com"],tile:["test-vr-image.realsee-cdn.com","test-vr-image.realsee-cdn.com"],model:["test-vr-image.realsee-cdn.com","test-vr-image.realsee-cdn.com"],default:["test-vr-image.realsee-cdn.com"]},"test-vr-public.realsee-cdn.cn":{type:"tencentCloud",pano:["test-vr-image.realsee-cdn.cn","test-vr-image.realsee-cdn.cn"],texture:["test-vr-image.realsee-cdn.cn"],tile:["test-vr-image.realsee-cdn.cn","test-vr-image.realsee-cdn.cn"],model:["test-vr-image.realsee-cdn.cn","test-vr-image.realsee-cdn.cn"],default:["test-vr-image.realsee-cdn.cn"]}},u0=/^https?\:\/\/?([^\/]+)/;function dc(n){var t=n.match(u0);return t===null?null:t[1]}function cn(n,t){return n.replace(u0,function(e,r){return e.slice(0,e.length-r.length)+t})}function fc(n,t,e){var r=t.split("."),i=r[0],a=r.slice(1);if(i==="texture")return cn(n,e.texture[0]);if(i==="pano"||i==="pano_luminance"){a[0];var o=a[1];switch(o){case"front":case"left":case"up":return cn(n,e.pano[0]);case"down":case"right":case"back":return cn(n,e.pano[1])}}else if(i==="pano_tile"||i==="pano_tile_luminance"){a[0],a[1];var s=a[2],l=a[3],u=a[4],d=Math.pow(2,Number(s))*Number(l)+Number(u);if(!isNaN(d))return cn(n,e.tile[d%2])}else if(i==="model"){var f=a[0],d=Number(f);if(!isNaN(d))return cn(n,e.model[d%2])}return cn(n,e.default[0])}var hc=function(n,t){var e,r=n.split("?")[0],i=r.split(".").pop();if(i==="jpeg"&&(i="jpg"),i!=="png"&&i!=="jpg")return n;var a="";if(t.format!==void 0&&t.format!==i&&(a+="/format/".concat(t.format)),t.cut!==void 0&&(a+="/cut/".concat(t.cut[2],"x").concat(t.cut[3],"x").concat(t.cut[0],"x").concat(t.cut[1])),t.quality!==void 0){var o=(e=t.format)!==null&&e!==void 0?e:i;o&&["jpg","webp","tpg","heif","avif"].indexOf(o)>=0&&(a+="/quality/".concat(t.quality))}if(t.size!==void 0){var s=n.match(/\/cube_(\d+)\//),l=s?Number(s[1]):NaN;l!==Number(t.size)&&(a+="/thumbnail/".concat(t.size,"x"))}return t.sharpen!==void 0&&(a+="/sharpen/".concat(t.sharpen)),a.length&&(a="?imageMogr2"+a),r+a},pc=function(n,t){var e,r=n.split("?")[0],i=r.split(".").pop();if(i==="jpeg"&&(i="jpg"),i!=="png"&&i!=="jpg")return n;var a="",o=[],s=t.format,l=t.quality,u=t.size;if(s!==void 0&&s!==i&&o.push("format,".concat(s==="heif"?"heic":s)),t.cut!==void 0){var d=t.cut,f=d[0],A=d[1],m=d[2],h=d[3];o.push("crop,x_".concat(f,",y_").concat(A,",w_").concat(m,",h_").concat(h,",g_nw"))}if(l!==void 0&&l!==100){var v=(e=t.format)!==null&&e!==void 0?e:i;v&&["jpg","webp"].indexOf(v)>=0&&o.push("quality,Q_".concat(l))}return u&&u!==2048&&o.push("resize,w_".concat(u)),t.sharpen!==void 0&&o.push("sharpen,".concat(t.sharpen)),o.length&&(a="?x-oss-process=image/"+o.join("/")),r+a},dn=9007199254740991;function Xr(n){var t=Math.round(n);return Math.abs(t-n)<.001?t:Math.floor(n)}function vc(n){return n=Object.assign({},n),n.size!==void 0&&(n.size=Xr(he(n.size,0,dn))),n.quality!==void 0&&(n.quality=Xr(he(n.quality,0,100))),n.cut!==void 0&&(n.cut=[Xr(he(n.cut[0],0,dn)),Xr(he(n.cut[1],0,dn)),Xr(he(n.cut[2],0,dn)),Xr(he(n.cut[3],0,dn))]),n.sharpen!==void 0&&(n.sharpen=Xr(he(n.sharpen,0,dn))),n}function jt(n,t){var e=F(F({},cc),t.mappings),r=dc(n);if(r===null)return n;t=vc(t);var i=e[r];return i?(n=fc(n,t.key,i),/\.basis(\?|$)/.test(n)&&(n=n.replace(/\.basis(\?|$)/,".jpg$1")),i.type==="tencentCloud"?hc(n,t):i.type==="aliyun"?pc(n,t):n):n}function bi(n,t,e){t===void 0&&(t=jt);var r=t(n,e);if(r===n&&e.cut)throw new Error("ImageURL: cut option not applied.");return r}var l0=/\/cube_(\d+)\//;function Kn(n){var t=n.match(l0);return t?Number(t[1]):null}function Rt(n,t){return n.replace(l0,"/cube_".concat(t,"/"))}var Ac="data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoCAAIAAUAmJaQAA3AA/vz0AAA=",mc="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAAGhbWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAsaWxvYwAAAABEAAACAAEAAAABAAAB3gAAABkAAgAAAAEAAAHJAAAAFQAAAEJpaW5mAAAAAAACAAAAGmluZmUCAAAAAAEAAGF2MDFDb2xvcgAAAAAaaW5mZQIAAAAAAgAAYXYwMUFscGhhAAAAABppcmVmAAAAAAAAAA5hdXhsAAIAAQABAAAA12lwcnAAAACxaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIAAoAAAAAUaXNwZQAAAAAAAAACAAAAAgAAAA5waXhpAAAAAAEIAAAADGF2MUOBABwAAAAAOGF1eEMAAAAAdXJuOm1wZWc6bXBlZ0I6Y2ljcDpzeXN0ZW1zOmF1eGlsaWFyeTphbHBoYQAAAAAeaXBtYQAAAAAAAAACAAEEAQKDBAACBAUGhwgAAAA2bWRhdBIACgQYADLVMgsWQBhhIAQqrNj/+BIACgUYADLEoDIOFkADDDDCQAACDaqCCb4=",gc="data:image/heif;base64,AAAAGGZ0eXBoZWljAAAAAG1pZjFoZWljAAABL21ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAHBpY3QAAAAAAAAAAAAAAAAAAAAADnBpdG0AAAAAAAEAAAAjaWluZgAAAAAAAQAAABVpbmZlAgAAAAABAABodmMxAAAAAK9pcHJwAAAAkmlwY28AAAB2aHZjQwEBYAAAAAAAAAAAAADwAPz9+PgAACcDoAABAB5AAQwG//8BYAAAAwAAAwAAAwAAAwAAAwAAreTLgSChAAEAI0IBBwFgAAADAAADAAADAAADAAADAAChInJJlreTLySZNdggogABAAdEAcA98DMkAAAAFGlzcGUAAAAAAAAAAgAAAAIAAAAVaXBtYQAAAAAAAAABAAECgQIAAAAiaWxvYwAAAABEQAABAAEAAAAAAU8AAQAAAAAAAAAOAAAAFm1kYXQAAAAKJgGvLvkQwuWM4A==";function Gi(n){return new Promise(function(t){var e=new Image,r=setTimeout(function(){e.onload=e.onerror=function(){},clearTimeout(r),t(!1)},100);e.onload=e.onerror=function(){e.onload=e.onerror=function(){},clearTimeout(r),t(e.height===2)},e.src=n})}var Ki=null;function c0(){return Ki||(Ki=Promise.all([Gi(Ac),Gi(mc),Gi(gc)]).then(function(n){return{webp:n[0],avif:n[1],heif:n[2]}}))}var d0=/^(.*)\[(\d+)\]$/;function Ue(n){if(!isNaN(n.panoIndex)&&isFinite(n.panoIndex))return"".concat(n.workCode,"[").concat(n.panoIndex,"]");throw new Error("Invalid Pano")}function pt(n){var t=n.match(d0);if(t){t[0];var e=t[1],r=t[2],i=Math.floor(Number(r));if(!isNaN(i)&&isFinite(i))return{workCode:e,panoIndex:i}}throw new Error("Invalid PanoId")}function _t(n,t){return Ue(n)===Ue(t)}function f0(n){return typeof n=="string"&&d0.test(n)}var yc=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(c.Group),Vt=function(n){ue(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.onBeforeRender=bc,i}return t}(c.Mesh);function bc(n,t,e){for(var r=0,i=this.material;r<i.length;r++){var a=i[r];this.model&&a.syncModel(this.model),a.update(n,e)}}var Wn=function(){return typeof document!="undefined"?new c.TextureLoader().load("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAABCAYAAACouxZ2AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAACAKADAAQAAAABAAAAAQAAAAB7UD0+AAACA0lEQVRIDXWUW3YjIQxEwdnV/GT/q8kO3FO3pAJst3PSAaR6Cbszf//9XeMxxpjXmI+pVXudp2s6PC4dqHff9e6D7/PZLy46xQvG+sZvrfK8xgXUeq85yINe9bdmtOK1+kun5vjgq58a+eZPna9jvmjiserqG/+Whathvo3L3WhV89L9sXI/m18z2uene9ap/ftsuT9WZxoHXzW56/fpj8l7+tTw7P011NdpqnY19sRsfuHMA9u8oZWfDz4+fra/dfG1V60ydZ7qba1g7UNAeK0JP7ydD7/OqH6wO2f7HTq+B/lbL9qsB3/N1/UzR81XfPzw4tp5OPvRneacteq8Xo0xR3vuv/kPz0KtX0Nhg0eHuaNXdWI3X/ld427h++vzyp99V6VPrzWFhbv4ayay4oFecm198MmUXN/mL+x7npq/uJXBGb/MTw4+t+SvbLoTZnUW5uHhz7nWcTxT73OwXV7cxT9wbBf/0LnDBgcnHmtPLYba32Hp808sMy1u88yhr58n70/v4xX92GSN19l/2UsqGmiH94Hpxjcs+DO/ccpIVNVp62PUWXu//ur1GQy1Cf+GZ13rtNYN1po3/NI79fGXibHkq4z25xvV2pW3szpneXsW8SsreTe/NIPrtXMnH7wPf+LEN6tqhUVHj3XKD/72p9eafCeYB3zuonnbv7yqP8d/o4K6gRb1wbYAAAAASUVORK5CYII="):new c.Texture}();Wn.minFilter=c.NearestFilter;Wn.magFilter=c.NearestFilter;Wn.wrapS=c.RepeatWrapping;Wn.wrapT=c.RepeatWrapping;var Ee={pano0:null,pano1:null,shownFloorIndex:-1,modelAlpha:1,opacity:1,progress:0,transition:"FADE",clippers:null,brightness:1,constantColor:null,useEDL:!1,useHQWeight:!1,useHQDepth:!1,pointColor:"RGB",pointSize:"ATTENUATION",pointBack:"DARK",pointShape:"SQUARE",pointScale:.03,pointMaxPixel:40,pointMinPixel:.5,gradientTexture:Wn};function xc(n,t){var e=n!=null?n:[],r=t!=null?t:[];if(r.length!==e.length)return!1;for(var i=0;i<r.length;i++)if(!e[i].clippingBoxMatrix.equals(r[i].clippingBoxMatrix)||e[i].floorIndex!==r[i].floorIndex)return!1;return!0}function wc(n,t){return n&&t?n.luminanceMap===t.luminanceMap&&n.map===t.map&&n.zoom===t.zoom&&n.matrix.equals(t.matrix):!n&&!t}function h0(n,t){var e=!1;for(var r in t)switch(r){case"clippers":xc(n[r],t[r])||(n[r]=t[r],e=!0);break;case"pano0":case"pano1":wc(n[r],t[r])||(n[r]=t[r],e=!0);break;default:n[r]!==t[r]&&(n[r]=t[r],e=!0);break}return e}var wr=function(n){ue(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.onBeforeRender=Ec,i}return t}(c.Points);function Ec(n,t,e){this.model&&this.material.syncModel(this.model),this.material.update(n,e)}var fn=new Set,p0=function(n){ue(t,n);function t(){var e=n.call(this)||this;return e.needsRender=!0,e.pbmMaterialParametersVersion=0,e.materialParameters=F({},Ee),e}return t.prototype.getMaterial=function(){return F({},this.materialParameters)},t.prototype.setMaterial=function(e){var r=this;Object.assign(this.materialParameters,e),fn.clear(),this.traverse(function(i){if(i instanceof Vt)for(var a=0,o=i.material;a<o.length;a++){var s=o[a];fn.has(s)||(Object.assign(s,r.materialParameters),fn.add(s))}i instanceof wr&&(fn.has(i.material)||(Object.assign(i.material,r.materialParameters),fn.add(i.material)))}),fn.clear(),this.needsRender=!0},t}(c.Group),Cc=["right","left","up","down","front","back"];function v0(n,t,e,r){var i=new c.Box3;switch(n){case"up":i.min.y=.5,i.max.y=.5,i.min.x=+t-.5,i.max.x=+t-.5+r,i.min.z=-e+.5-r,i.max.z=-e+.5;break;case"down":i.min.y=-.5,i.max.y=-.5,i.min.x=+t-.5,i.max.x=+t-.5+r,i.min.z=+e-.5,i.max.z=+e-.5+r;break;case"left":i.min.x=-.5,i.max.x=-.5,i.min.z=-t+.5-r,i.max.z=-t+.5,i.min.y=-e+.5-r,i.max.y=-e+.5;break;case"right":i.min.x=.5,i.max.x=.5,i.min.z=+t-.5,i.max.z=+t-.5+r,i.min.y=-e+.5-r,i.max.y=-e+.5;break;case"front":i.min.z=-.5,i.max.z=-.5,i.min.x=+t-.5,i.max.x=+t-.5+r,i.min.y=-e+.5-r,i.max.y=-e+.5;break;case"back":i.min.z=.5,i.max.z=.5,i.min.x=-t+.5-r,i.max.x=-t+.5,i.min.y=-e+.5-r,i.max.y=-e+.5;break}return i.applyMatrix4(new c.Matrix4().makeRotationY(Math.PI))}var A0=function(n,t){if(!(n.level>=t))for(var e=n.level+1,r=n.size/2,i=[new c.Vector2(n.position.x,n.position.y),new c.Vector2(n.position.x+r,n.position.y),new c.Vector2(n.position.x,n.position.y+r),new c.Vector2(n.position.x+r,n.position.y+r)],a=0,o=i;a<o.length;a++){var s=o[a],l={face:n.face,level:e,size:r,position:s,box:v0(n.face,s.x,s.y,r),children:[]};n.children.push(l),A0(l,t)}};function Mc(n,t){var e={level:0,face:n,position:new c.Vector2(0,0),size:1,box:v0(n,0,0,1),children:[]};return A0(e,t),e}function Ca(n){var t=Cc.map(function(e){return Mc(e,n)});return{children:t}}function Ya(n,t){for(var e=0,r=n.children;e<r.length;e++){var i=r[e],a=t(i);a!==!1&&Ya(i,t)}}var Xn=new c.BoxBufferGeometry(1,1,1,1,1);Xn.deleteAttribute("uv");Xn.deleteAttribute("normal");Xn.groups=[];Xn.scale(-1,1,1);var Sc=`
|
|
390
|
+
`,w},typeof n=="string"&&(n.indexOf("-----BEGIN")!=-1?this.readCertPEM(n):re.lang.String.isHex(n)&&this.readCertHex(n))}Ke.hex2dn=function(n,t){t===void 0&&(t=0);var e=new Ke;se.getTLV(n,t);var r=e.getX500Name(n);return r.str};Ke.hex2rdn=function(n,t){if(t===void 0&&(t=0),n.substr(t,2)!=="31")throw new Error("malformed RDN");for(var e=new Array,r=se.getChildIdx(n,t),i=0;i<r.length;i++)e.push(Ke.hex2attrTypeValue(n,r[i]));return e=e.map(function(a){return a.replace("+","\\+")}),e.join("+")};Ke.hex2attrTypeValue=function(n,t){var e=se,r=e.getV;if(t===void 0&&(t=0),n.substr(t,2)!=="30")throw new Error("malformed attribute type and value");var i=e.getChildIdx(n,t);i.length!==2||n.substr(i[0],2);var a=r(n,i[0]),o=re.asn1.ASN1Util.oidHexToInt(a),s=re.asn1.x509.OID.oid2atype(o),l=r(n,i[1]),u=xr(l);return s+"="+u};Ke.getPublicKeyFromCertHex=function(n){var t=new Ke;return t.readCertHex(n),t.getPublicKey()};Ke.getPublicKeyFromCertPEM=function(n){var t=new Ke;return t.readCertPEM(n),t.getPublicKey()};Ke.getPublicKeyInfoPropOfCertPEM=function(n){var t=se,e=t.getVbyList,r={},i,a;return r.algparam=null,i=new Ke,i.readCertPEM(n),a=i.getPublicKeyHex(),r.keyhex=e(a,0,[1],"03").substr(2),r.algoid=e(a,0,[0,0],"06"),r.algoid==="2a8648ce3d0201"&&(r.algparam=e(a,0,[0,1],"06")),r};Ke.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"];function Fo(n){return we.SHA256(n).toString()}var a0=[function(){var n=new Ke;return n.readCertPEM(function(){var t=113,e=126,r=0,i="";return arguments[r].split(i).map(function(a){return a.charCodeAt(r)>e?a:String.fromCharCode((a.charCodeAt(r)+t)%e)}).join(i)}(":::::ORTV[-PR_aVSVPNaR:::::ZVVS@ PPNErtNVONtVWNZR}@]nU\0ZaZN=TP`\0T`Vo@Q^ROPbNZVTSZ^P^fQc^^TRWQawR^ZNATN>bRPNU^zc}nzyg R^ZNATN>bROU^zc}nz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rFNtZONNTwbQO\\ZO=TN>bqQt^dOOaAFXw= PCVxsv?{`a\bvS8YQ[aNsOt[cU`ZRTQNdtOaAFXw= PCVxsv?{`a\bvS8YQ[aNZOt[cU_ZROaNQN^U<ZN=TP`\0T`Vo@Q^ROPbNNAVPN^P\0{y\0Bs\\8\0R[z]w??qZP?NpgdenSuvv?>|f_?UpYPcQ\\gCb8zxtSvsOQNg>[\\\0\bx\b_o@8\0g`Z<PyUE`8yu}\\g{@`s`zUgErRtve{YdCvoO@>WFDtABNp\0feUWszpQaEYNAc]^xB[@]BDAN8\b}XA=E\x07nO}Pud8TA ?yPrVv{\\>E]o`BO^RE^X[W[rEU?x\bf>V OUwY=>X[\\E`tW[8}VwpF\x07BQcnrPF}yUtd8<Doe_\b[oOVU\x07ep@pYY\0cegY{r ?\bAbq?ff8}UaXoN_D]_X_8yozYFT`N{`\\{zvu?\bDWT}=_<\x07StX Nx\x07\0\b \0aT=c@ucnWfR[vf>RFxAFV}{N`dN^\\<eawBPxx}quT=|{T_R@Fp^Y<ZevRsWaZ]V CVrRVtAAc[ Qp|d|tqoQ=T|XX =u\\N8XNCx\\aU>wz X<e@Vc?dy\\|^FEq|=p`pBdF@bs^d<]vp\\^TZ P\bZ\b\\YNNSZ_\\w^|TsD8db _ Y\\o^Cw>Z\0x\\^aN]wWf\bA} C^d_{\x07ZC@\by]gY@E BFY?OsaqbDcVgQbZeFc ovtucxnq|<TnuyXRveYFOegCpAs{YTe|>bE<OXsSqCBWD_SVepfvCCUg]z ZvQ[\0s|U>pFz\b=OwT``fNJJ:::::R[Q-PR_aVSVPNaR:::::")),n}()];function Zl(n,t){for(var e=0,r=t;e<r.length;e++){var i=r[e];if(i.getSubjectHex()===n)return i}}function o0(n,t){var e=n.getIssuerHex();if(e===n.getSubjectHex())return n.verifySignature(n.getPublicKey());var r=Zl(e,t);return!r||n.verifySignature(r.getPublicKey())===!1?!1:o0(r,t)}function s0(n){var t=n.getIssuerHex();return t===n.getSubjectHex()?!1:o0(n,a0)}function Yl(n){var t=new Ke;typeof n=="string"?t.readCertPEM(n):t.readCertHex(n.hex);var e=s0(t);return a0.push(t),e}function $l(n,t,e){var r=new Ke;if(typeof e=="string"?r.readCertPEM(e):r.readCertHex(e.hex),s0(r)===!1)return!1;var i=new ke;return i.readCertPubKeyHex(r.hex,6),!!i.verify(n,Wa(t))}Yl(function(){var t=113,e=126,r=0,i="";return arguments[r].split(i).map(function(a){return a.charCodeAt(r)>e?a:String.fromCharCode((a.charCodeAt(r)+t)%e)}).join(i)}(":::::ORTV[-PR_aVSVPNaR:::::ZVVTU PPONrtNVONtVWNW=_SVw VE=ZN=TP`\0T`Vo@Q^ROPbNZVTSZ^P^fQc^^TRWQawR^ZNATN>bRPNU^zc}nzyg R^ZNATN>bROU^zc}nzyg R]ZN=TN>bRPtTn?bf?FZ_NQtfQc^^YQNq`gdSp?cyZ^P^fQc^^QQNWQ^aRvZPNTP`\0T`Vo@Q^RWN_fapzFqSFwfbOndSnzyuYz[oaNrS=\bZQNAZaN\\aZ [QSnS=\b[aNBZQZ\\aZ [QSnZVTaZ^P^fQc^^TRWQawR^ZNATN>bRPNU^zc}nzyg R^ZNATN>bROU^zc}nzyg RbZOVTN>bRPtYoTyuoz}}f`Bwo?=\x07RQN\\Ot[cONZO>Wyfd\x07 gdb\x07RaN]Ot[cONZZPRuupz_@feWyZ`bVfWX|gVup[N^xOSugnec|fdy\x07ndB{^T\x07}fdB\0ndRf?FZVVPVwN[Otx\0uxvTF=ON^RSNN\\PNtENZVVPPtXPNtRN?=?]q[VD|{\\oyo`oOu}F SA\x07e`tn[t u\b8^a]qx\bE_^\x07ZN?[QC\0yuOpybY8r\\RPAS=8rUq\0E8>xean^e\bf]Y`XO}{C[Ur^?\0x[SRXvVQ\\CFr}QnAPRQ\x07FO=Yw\0_TePCOFV@|\x07N>ROXcDrT<>bW<ssO?NOT{^s]uU\0gS\bBffsfE\0AfDyQEZR`]XBo|Qw}yYdwwTvOFcBndUz^\\{] b=^y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y RNRg@\x07NZCaaq8?` ^`?ryD =obzw?E]Ou\x07]n@>bVzqAQT?@_zo@}CxWVTUsAYdNd?{APQr8{P]]AZ>aR\0[D<z?Tr@`u@X|YDwd_<p<>zWE>]\0=X`\b@uucp|^_Qb@uZouTX^o\0\\{PCq{ug\x078^f[YQAWad8FNqxFQE?ZOo }RnO\bsQc xyccn=nxvs>bDBf\b\bW\\TuTnvAO^U\0QXC>xx8FxRFf<tJ:::::R[Q-PR_aVSVPNaR:::::"));var xa=function(n,t){return xa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])},xa(n,t)};function ue(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");xa(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var F=function(){return F=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])}return t},F.apply(this,arguments)};function Ct(n,t,e,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(n,t,e,r);else for(var s=n.length-1;s>=0;s--)(o=n[s])&&(a=(i<3?o(a):i>3?o(t,e,a):o(t,e))||a);return i>3&&a&&Object.defineProperty(t,e,a),a}function Mt(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)}function Bi(n,t,e,r){function i(a){return a instanceof e?a:new e(function(o){o(a)})}return new(e||(e=Promise))(function(a,o){function s(d){try{u(r.next(d))}catch(f){o(f)}}function l(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):i(d.value).then(s,l)}u((r=r.apply(n,t||[])).next())})}function Ri(n,t){var e={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(u){return function(d){return l([u,d])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(e=0)),e;)try{if(r=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return e.label++,{value:u[1],done:!1};case 5:e.label++,i=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(a=e.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){e.label=u[1];break}if(u[0]===6&&e.label<a[1]){e.label=a[1],a=u;break}if(a&&e.label<a[2]){e.label=a[2],e.ops.push(u);break}a[2]&&e.ops.pop(),e.trys.pop();continue}u=t.call(n,e)}catch(d){u=[6,d],i=0}finally{r=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function bt(n,t,e){if(e||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return n.concat(a||Array.prototype.slice.call(t))}function ec(n){return typeof Symbol=="undefined"?"$Symbol<".concat(n,">$"):Symbol(n)}var zn=ec("$$FIVE_EVENT$$");function Bn(n){return n[zn]||(n[zn]={}),n[zn]}function tc(n){n[zn]&&delete n[zn]}var ki=function(){function n(){}return n.prototype.hasListener=function(t){var e=Bn(this);return e&&e[t]&&e[t].callbacks.length>0},n.prototype.on=function(t,e,r){var i=this,a=Bn(this);return a[t]||(a[t]={called:[!1],callbacks:[]}),a[t].callbacks.push([e,r||!1]),function(){return i.off(t,e)}},n.prototype.once=function(t,e){return this.on(t,e,!0)},n.prototype.off=function(t,e){if(t===void 0){tc(this);return}var r=Bn(this);if(r[t]||(r[t]={called:[!1],callbacks:[]}),e===void 0){r[t].callbacks.length=0;return}for(var i=0;i<r[t].callbacks.length&&r[t].callbacks[i][0]!==e;i++);i<r[t].callbacks.length&&r[t].callbacks.splice(i,1)},n.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var i=!1,a=Bn(this);a[t]||(a[t]={called:[!1],callbacks:[]}),a[t].called=[!0,e];for(var o=a[t].callbacks.slice(),s=0,l=o;s<l.length;s++){var u=l[s],d=u[0],f=u[1],A=f===void 0?!1:f,m=d.apply(void 0,e);A&&this.off(t,d),m===!1&&(i=!0)}return i},n.prototype.waitUnitl=function(t){var e=this,r=Bn(this);r[t]||(r[t]={called:[!1],callbacks:[]});var i=r[t].called,a=i[0],o=i[1];return a?Promise.resolve(o):new Promise(function(s){e.once(t,function(){for(var l=[],u=0;u<arguments.length;u++)l[u]=arguments[u];return s(l),!0})})},n}();function z(){}var rc=typeof performance!="undefined"&&typeof performance.timing!="undefined"?performance.timing.navigationStart:Date.now(),Me=typeof performance!="undefined"?function(){return rc+performance.now()}:function(){return Date.now()};function gn(n){Object.freeze(n);var t=typeof n=="function",e=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(n).forEach(function(r){e.call(n,r)&&(!t||r!=="caller"&&r!=="callee"&&r!=="arguments")&&n[r]!==null&&(typeof n[r]=="object"||typeof n[r]=="function")&&!Object.isFrozen(n[r])&&gn(n[r])}),n}var Lo=/^([^.]+)(\.([^.]+))*$/;function nc(n,t){if(n==="*")return!0;var e=n.split(".").reverse(),r=t.split(".").reverse();if(e.length<=1)return n===t;for(var i=0;i<e.length;i++)if(e[i]!==r[i])return!1;return!0}function nn(n){return/^(([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])(\.(?!$)|$)){4}$/.test(n)}function Hr(n,t){return Lo.test(n)&&Lo.test(t)&&nc(n,t)}var ic=[/\.([0-9a-z]+)\.jsonp([\?\#].*)?$/i,/jsonp_([0-9a-z]+)([\?\#].*)?$/i],sr=gn(JSON.parse(function(){var t=113,e=126,r=0,i="";return arguments[r].split(i).map(function(a){return a.charCodeAt(r)>e?a:String.fromCharCode((a.charCodeAt(r)+t)%e)}).join(i)}("h/y|pnyu|/9/xr;p|z/9/yvn{wvn;p|z/9/rnyrr;p|z/9/rnyrr;p{/9/rnyrr;w}/9/uv;p|z/9/uv;p{/9/rnyrr;p{/9/rnyrr;p|z/9/ywpq{;p|z/9/rnyrr:pq{;p|z/9/rnyrr:pq{;p{/9/rnyrr;nv/9/;p{/9/pq{;p{/9/pnyp{|qr;vr/j"))),Xa=function(n){ue(t,n);function t(e,r,i){return n.call(this,"[NETWORK]: request proxy error(type: ".concat(r,", reason: ").concat(i,"): ").concat(e))||this}return t}(Error),gi=function(n){ue(t,n);function t(e,r,i){var a=n.call(this,"[NETWORK]: response error(type: ".concat(r,", status: ").concat(i,"): ").concat(e))||this;return a.httpStatus=i,a}return t}(Error);(function(n){ue(t,n);function t(e,r){return n.call(this,"[NETWORK]: request abort(type: ".concat(r,"): ").concat(e))||this}return t})(Error);var wa=function(n){ue(t,n);function t(e,r,i){return n.call(this,"[NETWORK]: request timeout(type: ".concat(r,", timeout: ").concat(i,"ms): ").concat(e))||this}return t}(Error),_a=function(n){ue(t,n);function t(e,r,i){return n.call(this,"[NETWORK]: request forbidden(type: ".concat(r,", reason: ").concat(i,"): ").concat(e))||this}return t}(Error);function ac(n){if(!n)return{};for(var t={},e=n.trim().split(`
|
|
391
|
+
`),r=0;r<e.length;r++){var i=e[r],a=i.indexOf(":"),o=i.slice(0,a).trim().toLowerCase(),s=i.slice(a+1).trim();s&&(t[o]?t[o]+=", "+s:t[o]=s)}return t}function Ea(n){for(var t=0,e=ic;t<e.length;t++){var r=e[t],i=n.match(r);if(i)return"jsonp_"+i[1]}return null}function Oo(n){return Ea(n)!==null}function Vo(n){var t=n.match(/^([0-9a-z]+\:)\/\/(([^:/?#]*)(?::[0-9]+)?)/);return t?t[1]:location.protocol}function Za(n){if(/^blob\:/i.test(n))return"blob:";if(/^data\:/i.test(n))return"data:";var t=n.match(/^[0-9a-z]+\:\/\/(([^:/?#]*)(?::[0-9]+)?)/i);return t?t[2]:location.hostname}var u0=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(ki);function xn(n,t,e,r,i){t===void 0&&(t={}),e===void 0&&(e=z),r===void 0&&(r=z),i===void 0&&(i=z);var a=Me(),o=n;return Promise.resolve().then(function(){return t.requestProxy?t.requestProxy(n):n}).then(function(s){return/^https\:/.test(location.href)&&/^http\:/.test(s)?(console.warn("The page at '".concat(location.href,"' was loaded over HTTPS, but requested an insecure element '").concat(s,"'. This request was automatically upgraded to HTTPS")),s.replace(/^http\:/,"https:")):s}).catch(function(s){var l,u=Ea(n),d=u?"Script":"XMLHttpRequest",f=new Xa(o,d,s&&s.message?String(s.message):String(s));return(l=t.networkSubscribe)===null||l===void 0||l.emit("network",n,d,"proxy-error",f.message),Promise.reject(f)}).then(function(s){return new Promise(function(l,u){var d,f=t.allowHosts?sr.concat(t.allowHosts):sr.slice(),A=Za(s),m=Ea(s);if(location.hostname.length!==0&&!nn(location.hostname)&&sr.filter(function(L){return Hr(L,location.hostname)}).length===0&&!nn(A)&&f.filter(function(L){return Hr(L,A)}).length===0){var h=m?"Script":"XMLHttpRequest",v=new _a(s,h,"request host(".concat(A,") is not allowed"));r(v),u(v),(d=t.networkSubscribe)===null||d===void 0||d.emit("network",s,h,"forbidden",v.message);return}if(m){var y=window,p=null,g=!1,x=document.createElement("script"),b=function(){var L;if(p=null,g!==!0){g=!0;var k=new wa(s,"Script",t.timeout||NaN);r(k),u(k),(L=t.networkSubscribe)===null||L===void 0||L.emit("network",s,"Script","timeout",k.message)}},w=function(L){var k,O,D=Me(),N=D-a;if(delete y[m],x.parentNode&&x.parentNode.removeChild(x),p!==null&&(window.clearTimeout(p),p=null),g!==!0){if(L.indexOf("data:")!==0){var X=new gi(s,"Script",500);r(X),u(X),(k=t.networkSubscribe)===null||k===void 0||k.emit("network",s,"Script","error",X.message);return}var K=L.split(","),Q=(K[0].match(/:(.*?);/)||[])[1],G=K[1];if(t.responseType==="arraybuffer"||t.responseType==="blob"){for(var J=atob(K[1]),H=J.length,j=new Uint8Array(H),Z=0;Z<H;Z++)j[Z]=J.charCodeAt(Z);t.responseType==="arraybuffer"?G=j.buffer:G=new Blob([j],{type:Q})}var Y={},pe={body:G,meta:{origin:o,source:s,requestTime:a,responseTime:D,costs:N,headers:Y}};e(pe),l(pe),(O=t.networkSubscribe)===null||O===void 0||O.emit("network",s,"Script","ok",JSON.stringify(pe.meta)),g=!0}};y[m]=w,x.src=s,document.body.appendChild(x),typeof t.timeout=="number"&&(p=window.setTimeout(b,t.timeout))}else{var E=!1,M=new XMLHttpRequest,C=function(){M&&(M.removeEventListener("timeout",P,!1),M.removeEventListener("progress",S,!1),M.removeEventListener("load",T,!1),M.removeEventListener("error",B,!1)),M=null,C=z},P=function(){var L;if(E!==!0){E=!0,C();var k=new wa(s,"XMLHttpRequest",t.timeout||NaN);r(k),u(k),(L=t.networkSubscribe)===null||L===void 0||L.emit("network",s,"XMLHttpRequest","timeout",k.message)}},S=function(L){E!==!0&&L.lengthComputable&&(L.total<=0||i(L.loaded/L.total))},T=function(L){var k;if(E!==!0){var O=this.status;if(O===0||O>=200&&O<400){E=!0,C();var D=Me(),N=D-a,X=ac(this.getAllResponseHeaders()),K=L.total,Q={body:this.response,meta:{origin:o,source:s,requestTime:a,responseTime:D,costs:N,headers:X,size:K}};e(Q),l(Q),(k=t.networkSubscribe)===null||k===void 0||k.emit("network",s,"XMLHttpRequest","ok",JSON.stringify(Q.meta))}else B.call(this)}},B=function(){var L;if(E!==!0){E=!0,C();var k=new gi(s,"XMLHttpRequest",this.status);r(k),u(k),(L=t.networkSubscribe)===null||L===void 0||L.emit("network",s,"XMLHttpRequest","error",k.message)}};M.addEventListener("timeout",P,!1),M.addEventListener("progress",S,!1),M.addEventListener("load",T,!1),M.addEventListener("error",B,!1),t.responseType&&(M.responseType=t.responseType),typeof t.timeout=="number"&&(M.timeout=t.timeout),M.open("GET",s,!0),M.send(null)}})})}var Hi={};function oc(n,t){t===void 0&&(t={});var e=Me(),r=n;return Promise.resolve().then(function(){return t.requestProxy?t.requestProxy(n):n}).then(function(i){return/^https\:/.test(location.href)&&/^http\:/.test(i)?(console.warn("The page at '".concat(location.href,"' was loaded over HTTPS, but requested an insecure element '").concat(i,"'. This request was automatically upgraded to HTTPS")),i.replace(/^http\:/,"https:")):i}).catch(function(i){var a,o=new Xa(r,"Link",i&&i.message?String(i.message):String(i));return(a=t.networkSubscribe)===null||a===void 0||a.emit("network",n,"Link","proxy-error",o.message),Promise.reject(o)}).then(function(i){return i in Hi?Hi[i]:Hi[i]=new Promise(function(a,o){var s,l=t.allowHosts?sr.concat(t.allowHosts):sr.slice(),u=Za(i);if(location.hostname.length!==0&&!nn(location.hostname)&&sr.filter(function(h){return Hr(h,location.hostname)}).length===0&&!nn(u)&&l.filter(function(h){return Hr(h,u)}).length===0){var d=new _a(i,"Link","request host(".concat(u,") is not allowed"));o(d),(s=t.networkSubscribe)===null||s===void 0||s.emit("network",i,"Link","forbidden",d.message);return}var f=document.createElement("link");f.href=i,f.rel=f.relList&&f.relList.supports("prefetch")?"prefetch":"preload",f.as="fetch",f.crossOrigin="";var A=document.head||document.getElementsByTagName("head")[0];A&&A.appendChild(f);var m=!1;f.onload=function(){var h;if(m!==!0){m=!0,a();var v=Me(),y=v-e,p={},g={origin:r,source:i,requestTime:e,responseTime:v,costs:y,headers:p};(h=t.networkSubscribe)===null||h===void 0||h.emit("network",i,"Link","preload",JSON.stringify(g))}},f.onerror=function(h){var v;if(m!==!0){m=!0;var y=new gi(i,"Link",0);o(y),(v=t.networkSubscribe)===null||v===void 0||v.emit("network",i,"Link","error",y.message)}}})})}function sc(n,t,e,r,i,a){t===void 0&&(t={}),e===void 0&&(e=z),r===void 0&&(r=z),i===void 0&&(i=z);var o=Me(),s=n;return Promise.resolve().then(function(){return t.requestProxy?t.requestProxy(n):n}).then(function(l){return/^https\:/.test(location.href)&&/^http\:/.test(l)?(console.warn("The page at '".concat(location.href,"' was loaded over HTTPS, but requested an insecure element '").concat(l,"'. This request was automatically upgraded to HTTPS")),l.replace(/^http\:/,"https:")):l}).catch(function(l){var u,d=new Xa(s,"Image",l&&l.message?String(l.message):String(l));return(u=t.networkSubscribe)===null||u===void 0||u.emit("network",n,"Image","proxy-error",d.message),Promise.reject(d)}).then(function(l){return new Promise(function(u,d){var f,A=t.allowHosts?sr.concat(t.allowHosts):sr.slice(),m=Za(l);if(location.hostname.length!==0&&!nn(location.hostname)&&sr.filter(function(b){return Hr(b,location.hostname)}).length===0&&!nn(m)&&A.filter(function(b){return Hr(b,m)}).length===0){var h=new _a(l,"Image","request host(".concat(m,") is not allowed"));r(h),d(h),(f=t.networkSubscribe)===null||f===void 0||f.emit("network",l,"Image","forbidden",h.message);return}var v=a!=null?a:new Image,y=!1,p=null,g=function(){var b;if(v.onload=z,v.onerror=z,p!==null&&(clearTimeout(p),p=null),y!==!0){var w=Me(),E={headers:{},origin:s,source:l,requestTime:o,responseTime:w,costs:w-o};y=!0;var M={body:v,meta:E};i(1),e(M),u(M),(b=t.networkSubscribe)===null||b===void 0||b.emit("network",l,"Image","ok",JSON.stringify(M.meta))}},x=function(){var b;if(v.onload=z,v.onerror=z,p!==null&&(clearTimeout(p),p=null),y!==!0){y=!0;var w=new gi(l,"Image",0);r(w),d(w),(b=t.networkSubscribe)===null||b===void 0||b.emit("network",l,"Image","ok",w.message)}};typeof t.timeout=="number"&&(p=window.setTimeout(function(){var b;if(v.onload=z,v.onerror=z,p=null,y!==!0){y=!0;var w=new wa(l,"Image",t.timeout);r(w),d(w),(b=t.networkSubscribe)===null||b===void 0||b.emit("network",l,"Image","timeout",w.message)}},t.timeout)),v.onload=g,v.onerror=x,i(0),v.src=l})})}var Ya=function(){function n(t){t===void 0&&(t={}),this.options=Object.freeze(t),this.options.allowHosts&&Object.freeze(this.options.allowHosts)}return n.prototype.ajax=function(t,e,r,i,a){var o;e===void 0&&(e={}),r===void 0&&(r=z),i===void 0&&(i=z),a===void 0&&(a=z);var s=this.options,l={responseType:e.responseType,timeout:(o=e.timeout)!==null&&o!==void 0?o:s.timeout,get allowHosts(){var u;return(u=e.allowHosts)!==null&&u!==void 0?u:s.allowHosts},get requestProxy(){var u;return(u=e.requestProxy)!==null&&u!==void 0?u:s.requestProxy},get networkSubscribe(){var u;return(u=e.networkSubscribe)!==null&&u!==void 0?u:s.networkSubscribe}};return xn(t,l,r,i,a)},n.prototype.loadImage=function(t,e,r,i,a,o){var s;e===void 0&&(e={}),r===void 0&&(r=z),i===void 0&&(i=z),a===void 0&&(a=z);var l=this.options,u={timeout:(s=e.timeout)!==null&&s!==void 0?s:l.timeout,get allowHosts(){var d;return(d=e.allowHosts)!==null&&d!==void 0?d:l.allowHosts},get requestProxy(){var d;return(d=e.requestProxy)!==null&&d!==void 0?d:l.requestProxy},get networkSubscribe(){var d;return(d=e.networkSubscribe)!==null&&d!==void 0?d:l.networkSubscribe}};return sc(t,u,r,i,a,o)},n.prototype.preload=function(t,e){var r;e===void 0&&(e={});var i=this.options,a={timeout:(r=e.timeout)!==null&&r!==void 0?r:i.timeout,get allowHosts(){var o;return(o=e.allowHosts)!==null&&o!==void 0?o:i.allowHosts},get requestProxy(){var o;return(o=e.requestProxy)!==null&&o!==void 0?o:i.requestProxy},get networkSubscribe(){var o;return(o=e.networkSubscribe)!==null&&o!==void 0?o:i.networkSubscribe}};return oc(t,a)},n}(),yi=new Ya,uc=function(){if(typeof window!="undefined"){var n=window;return n.requestAnimationFrame||n.mozRequestAnimationFrame||n.webkitRequestAnimationFrame||n.msRequestAnimationFrame||function(t){return setTimeout(t,16)}}else return function(t){return setTimeout(t,16)}}(),lc=function(n){var t;if(typeof window!="undefined"){var e=window;t=e.cancelAnimationFrame||e.mozCancelAnimationFrame||e.webkitCancelAnimationFrame||e.msCancelAnimationFrame||function(r){return window.clearTimeout(r)}}else t=function(r){return window.clearTimeout(r)};t(n)},cc=5,No=16,vt=function(){function n(){this.frames=[],this.stoped=!1,this.time=Me(),this.context=null,this.loop=this.loop.bind(this),this.loop()}return Object.defineProperty(n,"shared",{get:function(){return this.sharedInstance||(this.sharedInstance=new n),this.sharedInstance},enumerable:!1,configurable:!0}),n.getFrameTime=function(){return No},n.prototype.loop=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(!this.stoped){var r=Me(),i=r-this.time;this.time=r;var a=[];No=i;for(var o=0,s=this.frames;o<s.length;o++){var l=s[o];if(l.delay>0){l.delay=l.delay-1;continue}try{l.callback.apply(l,bt([r,i],t,!1))}catch(u){console.error(u)}l.once&&a.push(l)}a.length>0&&(this.frames=this.frames.filter(function(u){return a.indexOf(u)===-1})),this.requestAnimationFrame(this.loop)}},n.prototype.setContext=function(t){this.cancelAnimationFrame(this.requestId),this.context=t,this.requestId=this.requestAnimationFrame(this.loop)},n.prototype.getContext=function(){return this.context},n.prototype.requestAnimationFrame=function(t){return this.context?this.context.requestAnimationFrame(t):uc(t)},n.prototype.cancelAnimationFrame=function(t){this.context?this.context.cancelAnimationFrame(t):lc(this.loop),this.requestId=null},n.prototype.remove=function(t){var e=this.frames.indexOf(t);e>=0&&this.frames.splice(e,1)},n.prototype.add=function(t,e,r,i){var a=this;e===void 0&&(e=!1),r===void 0&&(r=0),i===void 0&&(i=cc);var o={callback:t,once:e,delay:r,order:i};return this.frames.push(o),this.frames.sort(function(s,l){return s.order-l.order}),function(){return a.remove(o)}},n.prototype.disponse=function(){this.stoped=!0,this.frames.length=0},n}();function he(n,t,e){return n<t?t:n>e?e:n}var dc={"vrlab-public.ljcdn.com":{type:"tencentCloud",pano:["vrlab-image1.ljcdn.com","vrlab-image2.ljcdn.com"],texture:["vrlab-image3.ljcdn.com"],tile:["vr-tile-1.realsee-cdn.cn","vr-tile-2.realsee-cdn.cn"],model:["vr-model-1.realsee-cdn.cn","vr-model-2.realsee-cdn.cn"],default:["vrlab-image4.ljcdn.com"]},"vr-public.realsee-cdn.cn":{type:"tencentCloud",pano:["vr-image-1.realsee-cdn.cn","vr-image-2.realsee-cdn.cn"],texture:["vr-image-3.realsee-cdn.cn"],tile:["vr-tile-1.realsee-cdn.cn","vr-tile-2.realsee-cdn.cn"],model:["vr-model-1.realsee-cdn.cn","vr-model-2.realsee-cdn.cn"],default:["vr-image-4.realsee-cdn.cn"]},"vr-public.rscdn.cn":{type:"tencentCloud",pano:["vr-image-1.rscdn.cn","vr-image-2.rscdn.cn"],texture:["vr-image-3.rscdn.cn"],tile:["vr-tile-1.rscdn.cn","vr-tile-2.rscdn.cn"],model:["vr-model-1.rscdn.cn","vr-model-2.rscdn.cn"],default:["vr-image-4.rscdn.cn"]},"mars-public.realsee-cdn.cn":{type:"aliyun",pano:["mars-image-1.realsee-cdn.cn","mars-image-2.realsee-cdn.cn"],texture:["mars-image-3.realsee-cdn.cn"],tile:["mars-tile-1.realsee-cdn.cn","mars-tile-2.realsee-cdn.cn"],model:["mars-model-1.realsee-cdn.cn","mars-model-2.realsee-cdn.cn"],default:["mars-image-4.realsee-cdn.cn"]},"global-public.realsee-cdn.com":{type:"tencentCloud",pano:["global-image-1.realsee-cdn.com","global-image-2.realsee-cdn.com"],texture:["global-image-3.realsee-cdn.com"],tile:["global-tile-1.realsee-cdn.com","global-tile-2.realsee-cdn.com"],model:["global-model-1.realsee-cdn.com","global-model-2.realsee-cdn.com"],default:["global-image-4.realsee-cdn.com"]},"earth-ga-public.realsee-cdn.cn":{type:"tencentCloud",pano:["earth-ga-image-1.realsee-cdn.cn","earth-ga-image-2.realsee-cdn.cn"],texture:["earth-ga-image-3.realsee-cdn.cn"],tile:["earth-ga-tile-1.realsee-cdn.cn","earth-ga-tile-2.realsee-cdn.cn"],model:["earth-ga-model-1.realsee-cdn.cn","earth-ga-model-2.realsee-cdn.cn"],default:["earth-ga-image-4.realsee-cdn.cn"]},"test-vr-public.realsee-cdn.com":{type:"tencentCloud",pano:["test-vr-image.realsee-cdn.com","test-vr-image.realsee-cdn.com"],texture:["test-vr-image.realsee-cdn.com"],tile:["test-vr-image.realsee-cdn.com","test-vr-image.realsee-cdn.com"],model:["test-vr-image.realsee-cdn.com","test-vr-image.realsee-cdn.com"],default:["test-vr-image.realsee-cdn.com"]},"test-vr-public.realsee-cdn.cn":{type:"tencentCloud",pano:["test-vr-image.realsee-cdn.cn","test-vr-image.realsee-cdn.cn"],texture:["test-vr-image.realsee-cdn.cn"],tile:["test-vr-image.realsee-cdn.cn","test-vr-image.realsee-cdn.cn"],model:["test-vr-image.realsee-cdn.cn","test-vr-image.realsee-cdn.cn"],default:["test-vr-image.realsee-cdn.cn"]}},l0=/^https?\:\/\/?([^\/]+)/;function fc(n){var t=n.match(l0);return t===null?null:t[1]}function cn(n,t){return n.replace(l0,function(e,r){return e.slice(0,e.length-r.length)+t})}function hc(n,t,e){var r=t.split("."),i=r[0],a=r.slice(1);if(i==="texture")return cn(n,e.texture[0]);if(i==="pano"||i==="pano_luminance"){a[0];var o=a[1];switch(o){case"front":case"left":case"up":return cn(n,e.pano[0]);case"down":case"right":case"back":return cn(n,e.pano[1])}}else if(i==="pano_tile"||i==="pano_tile_luminance"){a[0],a[1];var s=a[2],l=a[3],u=a[4],d=Math.pow(2,Number(s))*Number(l)+Number(u);if(!isNaN(d))return cn(n,e.tile[d%2])}else if(i==="model"){var f=a[0],d=Number(f);if(!isNaN(d))return cn(n,e.model[d%2])}return cn(n,e.default[0])}var pc=function(n,t){var e,r=n.split("?")[0],i=r.split(".").pop();if(i==="jpeg"&&(i="jpg"),i!=="png"&&i!=="jpg")return n;var a="";if(t.format!==void 0&&t.format!==i&&(a+="/format/".concat(t.format)),t.cut!==void 0&&(a+="/cut/".concat(t.cut[2],"x").concat(t.cut[3],"x").concat(t.cut[0],"x").concat(t.cut[1])),t.quality!==void 0){var o=(e=t.format)!==null&&e!==void 0?e:i;o&&["jpg","webp","tpg","heif","avif"].indexOf(o)>=0&&(a+="/quality/".concat(t.quality))}if(t.size!==void 0){var s=n.match(/\/cube_(\d+)\//),l=s?Number(s[1]):NaN;l!==Number(t.size)&&(a+="/thumbnail/".concat(t.size,"x"))}return t.sharpen!==void 0&&(a+="/sharpen/".concat(t.sharpen)),a.length&&(a="?imageMogr2"+a),r+a},vc=function(n,t){var e,r=n.split("?")[0],i=r.split(".").pop();if(i==="jpeg"&&(i="jpg"),i!=="png"&&i!=="jpg")return n;var a="",o=[],s=t.format,l=t.quality,u=t.size;if(s!==void 0&&s!==i&&o.push("format,".concat(s==="heif"?"heic":s)),t.cut!==void 0){var d=t.cut,f=d[0],A=d[1],m=d[2],h=d[3];o.push("crop,x_".concat(f,",y_").concat(A,",w_").concat(m,",h_").concat(h,",g_nw"))}if(l!==void 0&&l!==100){var v=(e=t.format)!==null&&e!==void 0?e:i;v&&["jpg","webp"].indexOf(v)>=0&&o.push("quality,Q_".concat(l))}return u&&u!==2048&&o.push("resize,w_".concat(u)),t.sharpen!==void 0&&o.push("sharpen,".concat(t.sharpen)),o.length&&(a="?x-oss-process=image/"+o.join("/")),r+a},dn=9007199254740991;function Xr(n){var t=Math.round(n);return Math.abs(t-n)<.001?t:Math.floor(n)}function Ac(n){return n=Object.assign({},n),n.size!==void 0&&(n.size=Xr(he(n.size,0,dn))),n.quality!==void 0&&(n.quality=Xr(he(n.quality,0,100))),n.cut!==void 0&&(n.cut=[Xr(he(n.cut[0],0,dn)),Xr(he(n.cut[1],0,dn)),Xr(he(n.cut[2],0,dn)),Xr(he(n.cut[3],0,dn))]),n.sharpen!==void 0&&(n.sharpen=Xr(he(n.sharpen,0,dn))),n}function jt(n,t){var e=F(F({},dc),t.mappings),r=fc(n);if(r===null)return n;t=Ac(t);var i=e[r];return i?(n=hc(n,t.key,i),/\.basis(\?|$)/.test(n)&&(n=n.replace(/\.basis(\?|$)/,".jpg$1")),i.type==="tencentCloud"?pc(n,t):i.type==="aliyun"?vc(n,t):n):n}function bi(n,t,e){t===void 0&&(t=jt);var r=t(n,e);if(r===n&&e.cut)throw new Error("ImageURL: cut option not applied.");return r}var c0=/\/cube_(\d+)\//;function Kn(n){var t=n.match(c0);return t?Number(t[1]):null}function Rt(n,t){return n.replace(c0,"/cube_".concat(t,"/"))}var mc="data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoCAAIAAUAmJaQAA3AA/vz0AAA=",gc="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAAGhbWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAsaWxvYwAAAABEAAACAAEAAAABAAAB3gAAABkAAgAAAAEAAAHJAAAAFQAAAEJpaW5mAAAAAAACAAAAGmluZmUCAAAAAAEAAGF2MDFDb2xvcgAAAAAaaW5mZQIAAAAAAgAAYXYwMUFscGhhAAAAABppcmVmAAAAAAAAAA5hdXhsAAIAAQABAAAA12lwcnAAAACxaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIAAoAAAAAUaXNwZQAAAAAAAAACAAAAAgAAAA5waXhpAAAAAAEIAAAADGF2MUOBABwAAAAAOGF1eEMAAAAAdXJuOm1wZWc6bXBlZ0I6Y2ljcDpzeXN0ZW1zOmF1eGlsaWFyeTphbHBoYQAAAAAeaXBtYQAAAAAAAAACAAEEAQKDBAACBAUGhwgAAAA2bWRhdBIACgQYADLVMgsWQBhhIAQqrNj/+BIACgUYADLEoDIOFkADDDDCQAACDaqCCb4=",yc="data:image/heif;base64,AAAAGGZ0eXBoZWljAAAAAG1pZjFoZWljAAABL21ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAHBpY3QAAAAAAAAAAAAAAAAAAAAADnBpdG0AAAAAAAEAAAAjaWluZgAAAAAAAQAAABVpbmZlAgAAAAABAABodmMxAAAAAK9pcHJwAAAAkmlwY28AAAB2aHZjQwEBYAAAAAAAAAAAAADwAPz9+PgAACcDoAABAB5AAQwG//8BYAAAAwAAAwAAAwAAAwAAAwAAreTLgSChAAEAI0IBBwFgAAADAAADAAADAAADAAADAAChInJJlreTLySZNdggogABAAdEAcA98DMkAAAAFGlzcGUAAAAAAAAAAgAAAAIAAAAVaXBtYQAAAAAAAAABAAECgQIAAAAiaWxvYwAAAABEQAABAAEAAAAAAU8AAQAAAAAAAAAOAAAAFm1kYXQAAAAKJgGvLvkQwuWM4A==";function Gi(n){return new Promise(function(t){var e=new Image,r=setTimeout(function(){e.onload=e.onerror=function(){},clearTimeout(r),t(!1)},100);e.onload=e.onerror=function(){e.onload=e.onerror=function(){},clearTimeout(r),t(e.height===2)},e.src=n})}var Ki=null;function d0(){return Ki||(Ki=Promise.all([Gi(mc),Gi(gc),Gi(yc)]).then(function(n){return{webp:n[0],avif:n[1],heif:n[2]}}))}var f0=/^(.*)\[(\d+)\]$/;function Ue(n){if(!isNaN(n.panoIndex)&&isFinite(n.panoIndex))return"".concat(n.workCode,"[").concat(n.panoIndex,"]");throw new Error("Invalid Pano")}function pt(n){var t=n.match(f0);if(t){t[0];var e=t[1],r=t[2],i=Math.floor(Number(r));if(!isNaN(i)&&isFinite(i))return{workCode:e,panoIndex:i}}throw new Error("Invalid PanoId")}function _t(n,t){return Ue(n)===Ue(t)}function h0(n){return typeof n=="string"&&f0.test(n)}var bc=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(c.Group),Vt=function(n){ue(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.onBeforeRender=xc,i}return t}(c.Mesh);function xc(n,t,e){for(var r=0,i=this.material;r<i.length;r++){var a=i[r];this.model&&a.syncModel(this.model),a.update(n,e)}}var Wn=function(){return typeof document!="undefined"?new c.TextureLoader().load("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAABCAYAAACouxZ2AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAACAKADAAQAAAABAAAAAQAAAAB7UD0+AAACA0lEQVRIDXWUW3YjIQxEwdnV/GT/q8kO3FO3pAJst3PSAaR6Cbszf//9XeMxxpjXmI+pVXudp2s6PC4dqHff9e6D7/PZLy46xQvG+sZvrfK8xgXUeq85yINe9bdmtOK1+kun5vjgq58a+eZPna9jvmjiserqG/+Whathvo3L3WhV89L9sXI/m18z2uene9ap/ftsuT9WZxoHXzW56/fpj8l7+tTw7P011NdpqnY19sRsfuHMA9u8oZWfDz4+fra/dfG1V60ydZ7qba1g7UNAeK0JP7ydD7/OqH6wO2f7HTq+B/lbL9qsB3/N1/UzR81XfPzw4tp5OPvRneacteq8Xo0xR3vuv/kPz0KtX0Nhg0eHuaNXdWI3X/ld427h++vzyp99V6VPrzWFhbv4ayay4oFecm198MmUXN/mL+x7npq/uJXBGb/MTw4+t+SvbLoTZnUW5uHhz7nWcTxT73OwXV7cxT9wbBf/0LnDBgcnHmtPLYba32Hp808sMy1u88yhr58n70/v4xX92GSN19l/2UsqGmiH94Hpxjcs+DO/ccpIVNVp62PUWXu//ur1GQy1Cf+GZ13rtNYN1po3/NI79fGXibHkq4z25xvV2pW3szpneXsW8SsreTe/NIPrtXMnH7wPf+LEN6tqhUVHj3XKD/72p9eafCeYB3zuonnbv7yqP8d/o4K6gRb1wbYAAAAASUVORK5CYII="):new c.Texture}();Wn.minFilter=c.NearestFilter;Wn.magFilter=c.NearestFilter;Wn.wrapS=c.RepeatWrapping;Wn.wrapT=c.RepeatWrapping;var Ee={pano0:null,pano1:null,shownFloorIndex:-1,modelAlpha:1,opacity:1,progress:0,transition:"FADE",clippers:null,brightness:1,constantColor:null,useEDL:!1,useHQWeight:!1,useHQDepth:!1,pointColor:"RGB",pointSize:"ATTENUATION",pointBack:"DARK",pointShape:"SQUARE",pointScale:.03,pointMaxPixel:40,pointMinPixel:.5,gradientTexture:Wn};function wc(n,t){var e=n!=null?n:[],r=t!=null?t:[];if(r.length!==e.length)return!1;for(var i=0;i<r.length;i++)if(!e[i].clippingBoxMatrix.equals(r[i].clippingBoxMatrix)||e[i].floorIndex!==r[i].floorIndex)return!1;return!0}function Ec(n,t){return n&&t?n.luminanceMap===t.luminanceMap&&n.map===t.map&&n.zoom===t.zoom&&n.matrix.equals(t.matrix):!n&&!t}function p0(n,t){var e=!1;for(var r in t)switch(r){case"clippers":wc(n[r],t[r])||(n[r]=t[r],e=!0);break;case"pano0":case"pano1":Ec(n[r],t[r])||(n[r]=t[r],e=!0);break;default:n[r]!==t[r]&&(n[r]=t[r],e=!0);break}return e}var wr=function(n){ue(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.onBeforeRender=Cc,i}return t}(c.Points);function Cc(n,t,e){this.model&&this.material.syncModel(this.model),this.material.update(n,e)}var fn=new Set,v0=function(n){ue(t,n);function t(){var e=n.call(this)||this;return e.needsRender=!0,e.pbmMaterialParametersVersion=0,e.materialParameters=F({},Ee),e}return t.prototype.getMaterial=function(){return F({},this.materialParameters)},t.prototype.setMaterial=function(e){var r=this;Object.assign(this.materialParameters,e),fn.clear(),this.traverse(function(i){if(i instanceof Vt)for(var a=0,o=i.material;a<o.length;a++){var s=o[a];fn.has(s)||(Object.assign(s,r.materialParameters),fn.add(s))}i instanceof wr&&(fn.has(i.material)||(Object.assign(i.material,r.materialParameters),fn.add(i.material)))}),fn.clear(),this.needsRender=!0},t}(c.Group),Mc=["right","left","up","down","front","back"];function A0(n,t,e,r){var i=new c.Box3;switch(n){case"up":i.min.y=.5,i.max.y=.5,i.min.x=+t-.5,i.max.x=+t-.5+r,i.min.z=-e+.5-r,i.max.z=-e+.5;break;case"down":i.min.y=-.5,i.max.y=-.5,i.min.x=+t-.5,i.max.x=+t-.5+r,i.min.z=+e-.5,i.max.z=+e-.5+r;break;case"left":i.min.x=-.5,i.max.x=-.5,i.min.z=-t+.5-r,i.max.z=-t+.5,i.min.y=-e+.5-r,i.max.y=-e+.5;break;case"right":i.min.x=.5,i.max.x=.5,i.min.z=+t-.5,i.max.z=+t-.5+r,i.min.y=-e+.5-r,i.max.y=-e+.5;break;case"front":i.min.z=-.5,i.max.z=-.5,i.min.x=+t-.5,i.max.x=+t-.5+r,i.min.y=-e+.5-r,i.max.y=-e+.5;break;case"back":i.min.z=.5,i.max.z=.5,i.min.x=-t+.5-r,i.max.x=-t+.5,i.min.y=-e+.5-r,i.max.y=-e+.5;break}return i.applyMatrix4(new c.Matrix4().makeRotationY(Math.PI))}var m0=function(n,t){if(!(n.level>=t))for(var e=n.level+1,r=n.size/2,i=[new c.Vector2(n.position.x,n.position.y),new c.Vector2(n.position.x+r,n.position.y),new c.Vector2(n.position.x,n.position.y+r),new c.Vector2(n.position.x+r,n.position.y+r)],a=0,o=i;a<o.length;a++){var s=o[a],l={face:n.face,level:e,size:r,position:s,box:A0(n.face,s.x,s.y,r),children:[]};n.children.push(l),m0(l,t)}};function Sc(n,t){var e={level:0,face:n,position:new c.Vector2(0,0),size:1,box:A0(n,0,0,1),children:[]};return m0(e,t),e}function Ca(n){var t=Mc.map(function(e){return Sc(e,n)});return{children:t}}function $a(n,t){for(var e=0,r=n.children;e<r.length;e++){var i=r[e],a=t(i);a!==!1&&$a(i,t)}}var Xn=new c.BoxBufferGeometry(1,1,1,1,1);Xn.deleteAttribute("uv");Xn.deleteAttribute("normal");Xn.groups=[];Xn.scale(-1,1,1);var Ic=`
|
|
392
392
|
varying vec3 worldPosition;
|
|
393
393
|
void main() {
|
|
394
394
|
vec4 transform = vec4(position, 1.0);
|
|
395
395
|
worldPosition = (modelMatrix * transform).xyz;
|
|
396
396
|
gl_Position = projectionMatrix * modelViewMatrix * transform;
|
|
397
397
|
}
|
|
398
|
-
`,
|
|
398
|
+
`,Tc=`
|
|
399
399
|
uniform samplerCube map;
|
|
400
400
|
varying vec3 worldPosition;
|
|
401
401
|
void main() {
|
|
402
402
|
gl_FragColor = textureCube(map, worldPosition);
|
|
403
403
|
}
|
|
404
|
-
`,Ma=new c.ShaderMaterial({uniforms:{map:{value:null}},vertexShader:
|
|
404
|
+
`,Ma=new c.ShaderMaterial({uniforms:{map:{value:null}},vertexShader:Ic,fragmentShader:Tc,depthTest:!1,depthWrite:!1,stencilWrite:!1,blending:c.NoBlending,lights:!1,toneMapped:!1,fog:!1}),eo=new c.Scene;eo.matrixAutoUpdate=!1;var g0=new c.Mesh(Xn,Ma);g0.matrixAutoUpdate=!1;eo.add(g0);function Sa(n,t,e){Ma.uniforms.map.value=n;var r=e.autoClear;e.autoClear=!1;var i=new c.CubeCamera(.1,2,t);i.matrixAutoUpdate=!1,i.update(e,eo),e.autoClear=r,Ma.uniforms.map.value=null}var ji,Pr=(ji=Math.SQRT1_2)!==null&&ji!==void 0?ji:Math.sqrt(2),Pc={up:new c.Quaternion(Pr,0,0,Pr),down:new c.Quaternion(-Pr,0,0,Pr),left:new c.Quaternion(0,Pr,0,Pr),right:new c.Quaternion(0,-Pr,0,Pr),front:new c.Quaternion(0,0,0,1),back:new c.Quaternion(0,1,0,0)},Bc=function(){var n=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),t=new Float32Array([0,0,1,0,0,1,1,1]),e=new Uint8Array([0,1,2,1,3,2]),r=new c.BufferGeometry;return r.setAttribute("position",new c.BufferAttribute(n,3)),r.setAttribute("uv",new c.BufferAttribute(t,2)),r.setIndex(new c.BufferAttribute(e,1)),r}(),Rc=`
|
|
405
405
|
varying vec2 vUv;
|
|
406
406
|
uniform float flipY;
|
|
407
407
|
void main() {
|
|
408
408
|
vUv = vec2(uv.x, mix(uv.y, (1.0 - uv.y), flipY));
|
|
409
409
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
410
410
|
}
|
|
411
|
-
`,
|
|
411
|
+
`,kc=`
|
|
412
412
|
uniform sampler2D map;
|
|
413
413
|
varying vec2 vUv;
|
|
414
414
|
void main() {
|
|
415
415
|
gl_FragColor = texture2D(map, vUv);
|
|
416
416
|
}
|
|
417
|
-
`,g0=[];function kc(){var n=g0.pop();return n||new c.ShaderMaterial({uniforms:{map:{value:null},flipY:{value:0}},vertexShader:Bc,fragmentShader:Rc,depthTest:!1,depthWrite:!1,stencilWrite:!1,blending:c.NoBlending,lights:!1,toneMapped:!1,fog:!1})}function Fc(n){n.uniforms.map.value=null,g0.push(n)}function Lc(n,t,e){var r=new c.Scene;r.matrixAutoUpdate=!1;var i=new c.Group;i.scale.set(1,1,-1),r.add(i);for(var a=[],o=0,s=n;o<s.length;o++){var l=s[o],u=kc();a.push(u),u.uniforms.map.value=l.texture,u.uniforms.flipY.value=l.flipY?1:0;var d=new c.Group,f=new c.Mesh(Pc,u);f.position.set(l.position.x+l.size.x/2-.5,1-(l.position.y+l.size.y/2)-.5,-.5),f.scale.set(l.size.x,l.size.y,1),d.quaternion.copy(Tc[l.face]),d.add(f),i.add(d)}var A=e.autoClear;e.autoClear=!1;var m=new c.CubeCamera(.1,2,t);m.matrixAutoUpdate=!1,m.update(e,r),e.autoClear=A;for(var h=0,v=a;h<v.length;h++){var u=v[h];Fc(u)}}var Oc=function(){return!1}();function xi(){var n=Object.assign(document.createElementNS("http://www.w3.org/1999/xhtml","img"),{crossOrigin:"",close:function(){n.onerror=n.onload=n.close=z,n.decoding="async";var t=n.src;n.removeAttribute("src"),/^blob\:/.test(t)&&URL.revokeObjectURL(t)}});return n}function Ia(n){return new Promise(function(t,e){var r=xi();r.onload=function(){/^blob\:/.test(r.src)&&URL.revokeObjectURL(r.src),r.onload=r.onerror=z,setTimeout(function(){t(r)},10)},r.onerror=function(){var i=r.src;r.onload=r.onerror=z,r.close(),e(new Error("image load error: ".concat(i)))},r.src=URL.createObjectURL(n)})}var No=[];function Vc(n,t){var e=No.shift();if(e)return e.width=n,e.height=t,e;var r=Object.assign(document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),{close:function(){r.close=z,No.push(r)}});return r}function Do(n,t){if(t&&(n.width>t.width||n.height>t.height)){var e=Vc(Math.min(n.width,t.width),Math.min(n.height,t.height)),r=e.getContext("2d");r.clearRect(0,0,e.width,e.height),r.drawImage(n,0,0,e.width,e.height),n.close();var i=new c.Texture(e);i.needsUpdate=!0,i.flipY=!0;var a=i.dispose;return i.dispose=function(){e.close(),a.call(i),i.dispose=a},i}else{var o=new c.Texture(n);o.needsUpdate=!0,typeof ImageBitmap!="undefined"&&n instanceof ImageBitmap?o.flipY=!1:o.flipY=!0;var s=o.dispose;return o.dispose=function(){n.close(),s.call(o),o.dispose=s},o}}function Nc(n){var t=new c.CubeTexture(n);t.needsUpdate=!0,t.flipY=!1;var e=t.dispose;return t.dispose=function(){for(var r=0,i=n;r<i.length;r++){var a=i[r];a.close()}e.call(t),t.dispose=e},t}var _r=["right","left","up","down","front","back"],De=function(){function n(t,e,r,i,a){this.tileTree=e,this.tileSources=r,this.options=i,this.renderer=a,this.name="",this.needsRender=!1,this.maxRequest=n.DEFAULT_MAX_REQUEST,this.disposed=!1,this.loadedCubeNodes=new Set,this.loadingCubeNodes=new Set,this.baseCubeTexture=null,this._cubeRenderTarget=null,this.textures=[],this.baseCubeTexture=t}return Object.defineProperty(n.prototype,"cubeRenderTarget",{get:function(){return this._cubeRenderTarget},set:function(t){var e,r,i,a,o,s;if(t===null)throw new Error("cannot set cubeRenderTarget to null.");t.width!==this.options.textureSize&&t.setSize(this.options.textureSize,this.options.textureSize),t.texture.format=(e=this.options.format)!==null&&e!==void 0?e:c.RGBAFormat,t.texture.minFilter=(r=this.options.minFilter)!==null&&r!==void 0?r:c.LinearFilter,t.texture.magFilter=(i=this.options.magFilter)!==null&&i!==void 0?i:c.LinearFilter,t.texture.wrapS=(a=this.options.wrapS)!==null&&a!==void 0?a:c.ClampToEdgeWrapping,t.texture.wrapT=(o=this.options.wrapT)!==null&&o!==void 0?o:c.ClampToEdgeWrapping,t.texture.generateMipmaps=(s=this.options.generateMipmaps)!==null&&s!==void 0?s:!0,this.baseCubeTexture&&(Sa(this.baseCubeTexture,t,this.renderer),this.baseCubeTexture.dispose(),this.baseCubeTexture=null),this._cubeRenderTarget&&Sa(this._cubeRenderTarget.texture,t,this.renderer),this._cubeRenderTarget=t},enumerable:!1,configurable:!0}),n.prototype.requestTile=function(t){var e=this,r,i,a,o,s,l,u=this.tileSources.filter(function(v){return v.level===t.level})[0];if(!u){this.loadedCubeNodes.add(t);return}var d=u.size,f=Math.pow(2,t.level)*t.position.y,A=Math.pow(2,t.level)*t.position.x,m="".concat(((a=(i=(r=this.options.imageURL)===null||r===void 0?void 0:r.options)===null||i===void 0?void 0:i.key)!==null&&a!==void 0?a:"pano.0").replace(/^pano/,"pano_tile"),".").concat(t.face,".").concat(t.level,".").concat(f,".").concat(A),h=F(F({},(s=(o=this.options.imageURL)===null||o===void 0?void 0:o.options)!==null&&s!==void 0?s:{key:"unknown"}),{key:m,size:u.scale>=1?void 0:d*t.size*u.scale,quality:void 0,cut:[d*t.position.x,d*t.position.y,d*t.size,d*t.size]});this.loadingCubeNodes.add(t),this.options.textureLoader.loadTexture(u[t.face],{imageURL:{transform:(l=this.options.imageURL)===null||l===void 0?void 0:l.transform,options:F({},h)},format:c.RGBAFormat,timeout:this.options.timeout,magFilter:this.options.magFilter,minFilter:this.options.minFilter,fetcher:this.options.fetcher}).then(function(v){if(e.disposed){v.body.dispose();return}e.textures.push({face:t.face,level:t.level,position:t.position,size:new c.Vector2(t.size,t.size),texture:v.body,flipY:!v.body.flipY}),e.loadedCubeNodes.add(t)}).catch(z).then(function(){e.disposed||e.loadingCubeNodes.delete(t)})},n.prototype.update=function(t,e){var r=this;if(!this.disposed){var i=[];Ya(this.tileTree,function(f){if(!(i.length>r.maxRequest-r.loadingCubeNodes.size)){if(r.loadingCubeNodes.has(f)||f.level>e||!t.intersectsBox(f.box))return!1;if(!r.loadedCubeNodes.has(f))return i.push(f),!1}});for(var a=0,o=i;a<o.length;a++){var s=o[a];this.requestTile(s)}if(this.cubeRenderTarget&&this.textures.length){Lc(this.textures,this.cubeRenderTarget,this.renderer);for(var l=0,u=this.textures;l<u.length;l++){var d=u[l];d.texture.dispose()}this.textures.length=0,this.needsRender=!0}}},Object.defineProperty(n.prototype,"tilePending",{get:function(){return this.loadingCubeNodes.size},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"texture",{get:function(){if(!this._cubeRenderTarget)throw new Error("cubeRenderTarget never set.");return this._cubeRenderTarget.texture},enumerable:!1,configurable:!0}),n.prototype.dispose=function(){if(!this.disposed){this.disposed=!0,this.baseCubeTexture&&(this.baseCubeTexture.dispose(),this.baseCubeTexture=null),this.loadingCubeNodes.clear(),this.loadedCubeNodes.clear();for(var t=0,e=this.textures;t<e.length;t++){var r=e[t];r.texture.dispose()}this.textures.length=0}},n.DEFAULT_MAX_REQUEST=3,n}(),_n=function(){function n(){}return n.prototype.loadTexture=function(t,e,r,i,a,o){var s,l,u,d,f,A;r===void 0&&(r=z),i===void 0&&(i=z),a===void 0&&(a=z);var m={};typeof e.flipY!="undefined"&&(m.flipY=e.flipY),typeof e.format!="undefined"&&(m.format=e.format),typeof e.encoding!="undefined"&&(m.encoding=e.encoding),typeof e.generateMipmaps!="undefined"&&(m.generateMipmaps=e.generateMipmaps),m.minFilter=(s=e.minFilter)!==null&&s!==void 0?s:c.LinearFilter,m.magFilter=(l=e.magFilter)!==null&&l!==void 0?l:c.LinearFilter;var h=(d=(u=e.imageURL)===null||u===void 0?void 0:u.options)!==null&&d!==void 0?d:{key:"unknown"};t=bi(t,(f=e.imageURL)===null||f===void 0?void 0:f.transform,h);var v=Oo(t),y=(A=e.viaAjax)!==null&&A!==void 0?A:Oc,p=Lo(t),g=/^https?:/.test(v);if(p?y=!0:g||(y=!1),y){var x=null,b="blob";return e.fetcher.ajax(t,{timeout:e.timeout,responseType:b},void 0,void 0,a).then(function(M){return Ia(M.body)}).then(function(M){return Do(M,e.maxSize)}).then(function(M){return Object.assign(M,m),M}).then(function(M){var C={meta:x,body:M};return r(C),C}).catch(function(M){return i(M),Promise.reject(M)})}else{var w=null,E;return Promise.resolve().then(function(){return xi()}).then(function(M){return E=M,e.fetcher.loadImage(t,{timeout:e.timeout},void 0,void 0,a,M)}).then(function(M){return w=M.meta,Do(M.body,e.maxSize)}).then(function(M){return Object.assign(M,m),M}).then(function(M){var C={meta:w,body:M};return r(C),C}).catch(function(M){return E&&E.close(),i(M),Promise.reject(M)})}},n.prototype.loadCubeTexture=function(t,e,r,i,a,o){var s,l,u,d,f,A;r===void 0&&(r=z),i===void 0&&(i=z),a===void 0&&(a=z);var m={};typeof e.format!="undefined"&&(m.format=e.format),typeof e.generateMipmaps!="undefined"&&(m.generateMipmaps=e.generateMipmaps),m.minFilter=(s=e.minFilter)!==null&&s!==void 0?s:c.LinearFilter,m.magFilter=(l=e.magFilter)!==null&&l!==void 0?l:c.LinearFilter;for(var h=[t[_r[0]],t[_r[1]],t[_r[2]],t[_r[3]],t[_r[4]],t[_r[5]]],v=[],y=[0,0,0,0,0,0],p=[],g=function(b){var w=(d=(u=e.imageURL)===null||u===void 0?void 0:u.options)!==null&&d!==void 0?d:{key:"unknown"},E=bi(h[b],(f=e.imageURL)===null||f===void 0?void 0:f.transform,F(F({},w),{key:w.key+"."+_r[b]})),M=Oo(E),C=function(O){y[b]=O,a(y.reduce(function(D,N){return D+N},0)/6)},P=(A=e.viaAjax)!==null&&A!==void 0?A:!1,S=/^https?:$/.test(M),T=Lo(E);if(T?P=!0:S||(P=!1),P){var B="blob",L=e.fetcher.ajax(E,{timeout:e.timeout,responseType:B},void 0,void 0,C).then(function(O){return p[b]=O.meta,Ia(O.body)});v.push(L)}else{var k,L=Promise.resolve().then(function(){return xi()}).then(function(D){return k=D,e.fetcher.loadImage(E,{timeout:e.timeout},void 0,void 0,C,D)}).then(function(D){return p[b]=D.meta,D.body}).catch(function(D){return k&&k.close(),Promise.reject(D)});v.push(L)}},x=0;x<6;x++)g(x);return Promise.all(v).then(function(b){return Nc(b)}).then(function(b){return Object.assign(b,F({encoding:c.sRGBEncoding},m)),b}).then(function(b){var w={body:b,meta:p};return r(w),w}).catch(function(b){for(var w=0,E=v;w<E.length;w++){var M=E[w];M.then(function(C){return C.close()}).catch(z)}return i(b),Promise.reject(b)})},n.prototype.loadTiledCubeTexture=function(t,e,r,i,a,o,s){var l=this;return i===void 0&&(i=z),a===void 0&&(a=z),o===void 0&&(o=z),new Promise(function(u,d){var f,A;l.loadCubeTexture(t,{imageURL:{transform:(f=r.imageURL)===null||f===void 0?void 0:f.transform,options:(A=r.imageURL)===null||A===void 0?void 0:A.options},format:c.RGBAFormat,viaAjax:r.viaAjax,timeout:r.timeout,fetcher:r.fetcher,magFilter:r.magFilter,minFilter:r.minFilter,generateMipmaps:r.generateMipmaps},function(m){var h,v=m.meta,y=m.body,p=(h=r.tileMaxLevel)!==null&&h!==void 0?h:2,g=Math.max(1024*p,512),x=Ca(p),b=new De(y,x,e,{textureSize:g,textureLoader:l,imageURL:r.imageURL,magFilter:r.magFilter,minFilter:r.minFilter,generateMipmaps:r.generateMipmaps,timeout:r.timeout,fetcher:r.fetcher},s),w={meta:v,body:b};i(w),u(w)},function(m){a(m),d(m)},o,s).catch(z)})},n}();const Dc=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("n\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{H0v{pyqr-Ip|zz|{K0v{pyqr-Iz|}untrl}nlrr\x07K0v{pyqr-Ixv{{v{tl}nlrr\x07K0v{pyqr-Iy|tqr}uosl}nlrr\x07K0v{pyqr-Ipyv}}v{tl}yn{rl}nlrr\x07K|vq-znv{56-\n--0v{pyqr-Ixv{onrlrr\x07K--0v{pyqr-Iortv{lrr\x07K--0v{pyqr-Iz|}untrlrr\x07K--0v{pyqr-Ixv{{v{tlrr\x07K--0v{pyqr-I}|wrplrr\x07K--0v{pyqr-Iy|tqr}uoslrr\x07K--0v{pyqr-Ipyv}}v{tl}yn{rlrr\x07K--d|yq]|vv|{-J-rpA5n{s|zrq9->;=6H--0vsqrs-b`RlV[`aN[PV[T----d|yq]|vv|{-J-v{n{prZnv\x07-7-d|yq]|vv|{H--0r{qvs--d|yq]|vv|{-J-z|qryZnv\x07-7-d|yq]|vv|{H--zn@-pnzrn_|nv|{Znv\x07-J-zn@5vrZnv\x07h=jh=j9-vrZnv\x07h>jh=j9-vrZnv\x07h?jh=j9-vrZnv\x07h=jh>j9-vrZnv\x07h>jh>j9-vrZnv\x07h?jh>j9-vrZnv\x07h=jh?j9-vrZnv\x07h>jh?j9-vrZnv\x07h?jh?j6H--PnzrnQvrpv|{-J-{|znyv r5pnzrn_|nv|{Znv\x07-7-rp@5=;=9-=;=9-:>;=66H--0v{pyqr-I|yq}|lrr\x07K--0v{pyqr-Is|tlrr\x07K\f"),zc=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0qrsv{r-OYNPXlP\\Y\\_-rpA5=;=EC9-=;>=C9-=;>AF9->;=6{vs|z-nz}yrPor-}n{|=lzn}H{vs|z-znA-}n{|=lznv\x07H{vs|z-sy|n-}n{|=l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|=lyzv{n{prZn}H0r{qvs{vs|z-nz}yrPor-}n{|>lzn}H{vs|z-znA-}n{|>lznv\x07H{vs|z-sy|n-}n{|>l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|>lyzv{n{prZn}H0r{qvs{vs|z-sy|n-z|qryNy}unH{vs|z-sy|n-}|trH0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6--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p|5PnzrnQvrpv|{9-}n{|>a|crr\x079-}n{|>l ||z6H--}n{|>a|crr\x07-J-}n{|>a|crr\x07-7-zn@5}n{|>lznv\x076H--rpA-}n{|P|y|H--rpA-}n{|=P|y|-J-r\x07rPor5}n{|=lzn}9-}n{|=a|crr\x076H--rpA-}n{|>P|y|-J-r\x07rPor5}n{|>lzn}9-}n{|>a|crr\x076H--0vs-qrsv{rq5b`RlYbZV[N[PR6----}n{|=P|y|;n-J->;=-:-r\x07rPor5}n{|=lyzv{n{prZn}9-}n{|=a|crr\x076;H----}n{|>P|y|;n-J->;=-:-r\x07rPor5}n{|>lyzv{n{prZn}9-}n{|>a|crr\x076;H--0r{qvs--0vs-qrsv{rq5b`RlOYNPXla_N[`VaV\\[6----sy|n-oynpx]|tr-J-np|5:?;=-7-}|tr-8->;=6H----}n{|P|y|-J-zv\x075}n{|=P|y|9-OYNPXlP\\Y\\_9-zv{5>;=9-oynpx]|tr66H----}n{|P|y|-J-zv\x075}n{|P|y|9-}n{|>P|y|9-zn\x075=;=9-oynpx]|tr-:-?;=66H--0ryvs-qrsv{rq5b`Rl`]_RNQla_N[`VaV\\[6----rp?-prr{Pr{rP||q-J-r|yv|{-7-}v\x07ry_nv|-<-?;=H----sy|n-n{vv|{_nqv-J-qvn{pr5rp?5=;=9-=;=69-prr{Pr{rP||q6-7->;?H----sy|n-n{vv|{]|tr-J--qvn{pr5tylSntP||q;\x07\b9-prr{Pr{rP||q6-<-n{vv|{_nqvH----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-z||ur}5=;=9-=;?9-}|tr-:-n{vv|{]|tr66H--0ryr----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-}|tr6H--0r{qvs--tylSntP|y|-J-zv\x075}n{|P|y|9-tylSntP|y|9-z|qryNy}un6H--tylSntP|y|;n-J-|}npv\b-7-ovtu{rH--<<-JJJJJJJJJJJJJJJJ--0v{pyqr-Is|tlsntzr{K--0v{pyqr-I}rzyv}yvrqlny}unlsntzr{K--0v{pyqr-Iqvurv{tlsntzr{K\f"),Qc=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0vs-qrsv{rq5b`RlcR_aRelSY\\\\_6--nvor-sy|n-sy||H0ryr--{vs|z-sy|n-sy||H0r{qvsn\bv{t-sy|n-Sy||H0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvsnvor-sy|n-v_||sZnxHn\bv{t-sy|n-V_||sZnxHn\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{Hn\bv{t-rp@-cvr]|vv|{H0v{pyqr-Ip|zz|{K0v{pyqr-Il}nlrr\x07K0v{pyqr-I?l}nlrr\x07K0v{pyqr-Ir{zn}l}nlrr\x07K0v{pyqr-Ip|y|l}nlrr\x07K0v{pyqr-Is|tl}nlrr\x07K0v{pyqr-Iz|}untrl}nlrr\x07K0v{pyqr-Ixv{{v{tl}nlrr\x07K0v{pyqr-Iy|tqr}uosl}nlrr\x07K0v{pyqr-Ipyv}}v{tl}yn{rl}nlrr\x07K|vq-znv{56-\n--0v{pyqr-Ilrr\x07K--0v{pyqr-I?lrr\x07K--0v{pyqr-Ip|y|lrr\x07K--0v{pyqr-Ixv{onrlrr\x07K--0vsqrs-b`RlR[cZN]--0v{pyqr-Iortv{{|znylrr\x07K--0v{pyqr-Iz|}u{|znylrr\x07K--0v{pyqr-Ixv{{|znylrr\x07K--0v{pyqr-Iqrsny{|znylrr\x07K--0r{qvs--0v{pyqr-Iortv{lrr\x07K--0v{pyqr-Iz|}untrlrr\x07K--0v{pyqr-Ixv{{v{tlrr\x07K--0v{pyqr-I}|wrplrr\x07K--0v{pyqr-Iy|tqr}uoslrr\x07K--0v{pyqr-Ipyv}}v{tl}yn{rlrr\x07K--cvr]|vv|{-J-:z]|vv|{;\x07\b H--Sy||-J-sy||H--d|yq]|vv|{-J-rpA5n{s|zrq9->;=6H--0vsqrs-b`RlV[`aN[PV[T----d|yq]|vv|{-J-v{n{prZnv\x07-7-d|yq]|vv|{H--0r{qvs--d|yq]|vv|{-J-z|qryZnv\x07-7-d|yq]|vv|{H--zn@-pnzrn_|nv|{Znv\x07-J-zn@5vrZnv\x07h=jh=j9-vrZnv\x07h>jh=j9-vrZnv\x07h?jh=j9-vrZnv\x07h=jh>j9-vrZnv\x07h>jh>j9-vrZnv\x07h?jh>j9-vrZnv\x07h=jh?j9-vrZnv\x07h>jh?j9-vrZnv\x07h?jh?j6H--PnzrnQvrpv|{-J-{|znyv r5pnzrn_|nv|{Znv\x07-7-rp@5=;=9-=;=9-:>;=66H--0vs-qrsv{rq5b`RlRQY6----Y|tQr}u-J-y|t?5:z]|vv|{; 6H--0r{qvs--V_||sZnx-J-v_||sZnxH--0v{pyqr-I|yq}|lrr\x07K--0v{pyqr-Ir{zn}lrr\x07K--0v{pyqr-Is|tlrr\x07K\f"),Uc=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0qrsv{r-OYNPXlP\\Y\\_-rpA5=;=EC9-=;>=C9-=;>AF9->;=6{vs|z-nz}yrPor-}n{|=lzn}H{vs|z-znA-}n{|=lznv\x07H{vs|z-sy|n-}n{|=l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|=lyzv{n{prZn}H0r{qvs{vs|z-nz}yrPor-}n{|>lzn}H{vs|z-znA-}n{|>lznv\x07H{vs|z-sy|n-}n{|>l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|>lyzv{n{prZn}H0r{qvs{vs|z-sy|n-z|qryNy}unH{vs|z-sy|n-}|trH0vs-qrsv{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J-}-7- ||zH--r{-{|znyv r5q-8-\x006H\f|vq-znv{56-\n--<<-JJJ-顶部裁切-JJJ--sy|n-||sP]|tr-J-}|5pynz}5:PnzrnQvrpv|{;\b9-=;=9->;=69-@;=6H--vs-5----no5V_||sZnx-:->;=6-I-=;>-33----d|yq]|vv|{;\b-K-z|qryO|{qv{tZn\x07;\b-:-||sP]|tr-7-5z|qryO|{qv{tZn\x07;\b-:-z|qryO|{qv{tZv{;\b6--6-\n----qvpnqH--\f--<<-JJJJJJJJJJJJJJ--<<-JJJ-前置裁切计算-JJJ--0vs-[bZlPYV]]R_`-K-=----o||y-pyv}}rqH----rpA-pyv}}r]|vv|{H----0}ntzn-{|yyly||}ln----s|-5-v{-v-J-=H-v-I-[bZlPYV]]R_`H-v-88-6-\n------pyv}}r]|vv|{-J-pyv}}rh-v-j;znv\x07V{rr-7-d|yq]|vv|{H------pyv}}rq-J-5pyv}}rh-v-j;sy||V{qr\x07-I-=;=-\v\v-no5Sy||-:-pyv}}rh-v-j;sy||V{qr\x076-I->;=6H------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\x07-K-:=;B-33-pyv}}r]|vv|{;\x07-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\b-K-:=;B-33-pyv}}r]|vv|{;\b-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{; -K-:=;B-33-pyv}}r]|vv|{; -I-=;BH------vs-5pyv}}rq6-\n--------qvpnqH------\f----\f----0}ntzn-{|yyly||}lr{q--0r{qvs--<<-JJJJJJJJJJJJJJJJJJ--0v{pyqr-Ipyv}}v{tl}yn{rlsntzr{K--rpA-qvssrP|y|-J-rpA5-qvssr9-|}npv\b-6H--0v{pyqr-Iy|tqr}uoslsntzr{K--0v{pyqr-Izn}lsntzr{K--0v{pyqr-Ip|y|lsntzr{K--0v{pyqr-Iny}unzn}lsntzr{K--0v{pyqr-Iny}unrlsntzr{K--0v{pyqr-I}rpynzn}lsntzr{K--_rsyrprqYvtu-rsyrprqYvtu-J-_rsyrprqYvtu5-rp@5-=;=-69-rp@5-=;=-69-rp@5-=;=-69-rp@5-=;=-6-6H--<<-nppzynv|{-5onxrq-v{qvrp-yvtuv{t-|{y\b6--0vsqrs-b`RlYVTUaZN]----rpA-yvtuZn}ar\x07ryJ-r\x07r?Q5-yvtuZn}9-b?-6H----rsyrprqYvtu;v{qvrpQvssr-8J-yvtuZn}ar\x07rya|Yv{rn5-yvtuZn}ar\x07ry-6;to-7-yvtuZn}V{r{v\bH--0ryr----rsyrprqYvtu;v{qvrpQvssr-8J-rp@5->;=-6H--0r{qvs--<<-z|qynv|{--0v{pyqr-In|zn}lsntzr{K--rsyrprqYvtu;v{qvrpQvssr-7J-qvssrP|y|;toH--rp@-|t|v{tYvtu-J-rsyrprqYvtu;v{qvrpQvssrH--0v{pyqr-Ir{zn}lsntzr{K--tylSntP|y|-J-rpA5-|t|v{tYvtu9-qvssrP|y|;n-6H--<<-JJJ-纯色-JJJ--0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6----tylSntP|y|-J-rpA5p|{n{P|y|;9-p|{n{P|y|;t9-p|{n{P|y|;o9-|}npv\b6H--0r{qvs--<<-JJJJJJJJJJJ--<<-JJJ-楼层显示-JJJ--sy|n-sy||\\}npv\b-J->;=H--vs-5u|{Sy||V{qr\x07-KJ-=;=-33-no5Sy||-:-u|{Sy||V{qr\x076-KJ->;=6-\n----sy||\\}npv\b-J-=;>-7-zv{55>;=-8-PnzrnQvrpv|{;\b69->;=6H--\f--tylSntP|y|;n-J-tylSntP|y|;n-7-sy||\\}npv\b-7-ovtu{rH--<<-JJJJJJJJJJJJJJ--0v{pyqr-I|{rzn}}v{tlsntzr{K--0v{pyqr-Ir{p|qv{tlsntzr{K--<<-JJJ-全景图-JJJ--rp@-}n{|=a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|=lznv\x07h@j;\x07\b 6H--}n{|=a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|=a|crr\x079-}n{|=l ||z6H--}n{|=a|crr\x07-J-}n{|=a|crr\x07-7-zn@5}n{|=lznv\x076H--rp@-}n{|>a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|>lznv\x07h@j;\x07\b 6H--}n{|>a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|>a|crr\x079-}n{|>l ||z6H--}n{|>a|crr\x07-J-}n{|>a|crr\x07-7-zn@5}n{|>lznv\x076H--rpA-}n{|P|y|H--rpA-}n{|=P|y|-J-r\x07rPor5}n{|=lzn}9-}n{|=a|crr\x076H--rpA-}n{|>P|y|-J-r\x07rPor5}n{|>lzn}9-}n{|>a|crr\x076H--0vs-qrsv{rq5b`RlYbZV[N[PR6----}n{|=P|y|;n-J->;=-:-r\x07rPor5}n{|=lyzv{n{prZn}9-}n{|=a|crr\x076;H----}n{|>P|y|;n-J->;=-:-r\x07rPor5}n{|>lyzv{n{prZn}9-}n{|>a|crr\x076;H--0r{qvs--0vs-qrsv{rq5b`RlOYNPXla_N[`VaV\\[6----sy|n-oynpx]|tr-J-np|5:?;=-7-}|tr-8->;=6H----}n{|P|y|-J-zv\x075}n{|=P|y|9-OYNPXlP\\Y\\_9-zv{5>;=9-oynpx]|tr66H----}n{|P|y|-J-zv\x075}n{|P|y|9-}n{|>P|y|9-zn\x075=;=9-oynpx]|tr-:-?;=66H--0ryvs-qrsv{rq5b`Rl`]_RNQla_N[`VaV\\[6----rp?-prr{Pr{rP||q-J-r|yv|{-7-}v\x07ry_nv|-<-?;=H----sy|n-n{vv|{_nqv-J-qvn{pr5rp?5=;=9-=;=69-prr{Pr{rP||q6-7->;?H----sy|n-n{vv|{]|tr-J-qvn{pr5tylSntP||q;\x07\b9-prr{Pr{rP||q6-<-n{vv|{_nqvH----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-z||ur}5=;=9-=;?9-}|tr-:-n{vv|{]|tr66H--0ryr----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-}|tr6H--0r{qvs--tylSntP|y|-J-zv\x075}n{|P|y|9-tylSntP|y|9-z|qryNy}un6H--<<-JJJJJJJJJJJJJ--0v{pyqr-Is|tlsntzr{K--0v{pyqr-I}rzyv}yvrqlny}unlsntzr{K--0v{pyqr-Iqvurv{tlsntzr{K--0vs-qrsv{rq5b`RlRQY6----tylSntP|y|;n-J-Y|tQr}uH--0r{qvs\f"),qc=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0qrsv{r-]U\\[T0vs-qrsv{rq5b`RlcR_aRelSY\\\\_6--nvor-sy|n-sy||H0ryr--{vs|z-sy|n-sy||H0r{qvsn\bv{t-sy|n-Sy||H0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvsnvor-sy|n-v_||sZnxHn\bv{t-sy|n-V_||sZnxHn\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{Hn\bv{t-rp@-cvr]|vv|{H0vs{qrs-SYNal`UNQRQ--n\bv{t-rp@-[|znyH0r{qvs0v{pyqr-Ip|zz|{K0v{pyqr-Il}nlrr\x07K0v{pyqr-I?l}nlrr\x07K0v{pyqr-Iqv}ynprzr{zn}l}nlrr\x07K0v{pyqr-Ir{zn}l}nlrr\x07K0v{pyqr-Ip|y|l}nlrr\x07K0v{pyqr-Is|tl}nlrr\x07K0v{pyqr-Iz|}untrl}nlrr\x07K0v{pyqr-Ixv{{v{tl}nlrr\x07K0v{pyqr-Iunq|zn}l}nlrr\x07K0v{pyqr-Iy|tqr}uosl}nlrr\x07K0v{pyqr-Ipyv}}v{tl}yn{rl}nlrr\x07K|vq-znv{56-\n--0v{pyqr-Ilrr\x07K--0v{pyqr-I?lrr\x07K--0v{pyqr-Ip|y|lrr\x07K--0v{pyqr-Iortv{{|znylrr\x07K--0v{pyqr-Iz|}u{|znylrr\x07K--0v{pyqr-Ixv{onrlrr\x07K--0v{pyqr-Ixv{{|znylrr\x07K--0v{pyqr-Iqrsny{|znylrr\x07K0vs{qrs-SYNal`UNQRQ-<<-[|zny-p|z}rq-vu-qrvnvr-ur{-SYNal`UNQRQ--[|zny-J-{|znyv r5-n{s|zrq[|zny-6H0r{qvs--0v{pyqr-Iortv{lrr\x07K--0v{pyqr-Iz|}untrlrr\x07K--0v{pyqr-Ixv{{v{tlrr\x07K--0v{pyqr-Iqv}ynprzr{zn}lrr\x07K--0v{pyqr-I}|wrplrr\x07K--0v{pyqr-Iy|tqr}uoslrr\x07K--0v{pyqr-Ipyv}}v{tl}yn{rlrr\x07K--cvr]|vv|{-J-:-z]|vv|{;\x07\b H--Sy||-J-sy||H--d|yq]|vv|{-J-rpA5n{s|zrq9->;=6H--0vsqrs-b`RlV[`aN[PV[T----d|yq]|vv|{-J-v{n{prZnv\x07-7-d|yq]|vv|{H--0r{qvs--d|yq]|vv|{-J-z|qryZnv\x07-7-d|yq]|vv|{H--zn@-pnzrn_|nv|{Znv\x07-J-zn@5vrZnv\x07h=jh=j9-vrZnv\x07h>jh=j9-vrZnv\x07h?jh=j9-vrZnv\x07h=jh>j9-vrZnv\x07h>jh>j9-vrZnv\x07h?jh>j9-vrZnv\x07h=jh?j9-vrZnv\x07h>jh?j9-vrZnv\x07h?jh?j6H--PnzrnQvrpv|{-J-{|znyv r5pnzrn_|nv|{Znv\x07-7-rp@5=;=9-=;=9-:>;=66H--0vs-qrsv{rq5b`RlRQY6----Y|tQr}u-J-y|t?5:z]|vv|{; 6H--0r{qvs--V_||sZnx-J-v_||sZnxH--0v{pyqr-I|yq}|lrr\x07K--0v{pyqr-Ir{zn}lrr\x07K--0v{pyqr-Iunq|zn}lrr\x07K--0v{pyqr-Is|tlrr\x07K\f"),Hc=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i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]]R_`H-v-88-6-\n------pyv}}r]|vv|{-J-pyv}}rh-v-j;znv\x07V{rr-7-d|yq]|vv|{H------pyv}}rq-J-5pyv}}rh-v-j;sy||V{qr\x07-I-=;=-\v\v-no5Sy||-:-pyv}}rh-v-j;sy||V{qr\x076-I->;=6H------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\x07-K-:=;B-33-pyv}}r]|vv|{;\x07-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\b-K-:=;B-33-pyv}}r]|vv|{;\b-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{; -K-:=;B-33-pyv}}r]|vv|{; -I-=;BH------vs-5pyv}}rq6-\n--------qvpnqH------\f----\f----0}ntzn-{|yyly||}lr{q--0r{qvs--<<-JJJJJJJJJJJJJJJJ--0v{pyqr-Ipyv}}v{tl}yn{rlsntzr{K--rpA-qvssrP|y|-J-rpA5-qvssr9-|}npv\b-6H--_rsyrprqYvtu-rsyrprqYvtu-J-_rsyrprqYvtu5-rp@5-=;=-69-rp@5-=;=-69-rp@5-=;=-69-rp@5-=;=-6-6H--rp@-|nyRzvvr_nqvn{pr-J-rzvvrH--0v{pyqr-Iy|tqr}uoslsntzr{K--0v{pyqr-Izn}lsntzr{K--0v{pyqr-Ip|y|lsntzr{K--0v{pyqr-Iny}unzn}lsntzr{K--0v{pyqr-Iny}unrlsntzr{K--0v{pyqr-I}rpynzn}lsntzr{K--0v{pyqr-I{|znylsntzr{lortv{K--0v{pyqr-I{|znylsntzr{lzn}K--0v{pyqr-Irzvvrzn}lsntzr{K--<<-nppzynv|{--0v{pyqr-Iyvtul}u|{tlsntzr{K--0v{pyqr-Iyvtulsntzr{lortv{K--0v{pyqr-Iyvtulsntzr{lzn}K--0v{pyqr-Iyvtulsntzr{lr{qK--<<-z|qynv|{--0v{pyqr-In|zn}lsntzr{K--rp@-|t|v{tYvtu-J-rsyrprqYvtu;qvrpQvssr-8-rsyrprqYvtu;v{qvrpQvssr-8-rsyrprqYvtu;qvrp`}rpyn-8-rsyrprqYvtu;v{qvrp`}rpyn-8-|nyRzvvr_nqvn{prH--0v{pyqr-Ir{zn}lsntzr{K--tylSntP|y|-J-rpA5-|t|v{tYvtu9-qvssrP|y|;n-6H--<<-JJJ-纯色-JJJ--0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6----tylSntP|y|-J-rpA5p|{n{P|y|;9-p|{n{P|y|;t9-p|{n{P|y|;o9-|}npv\b6H--0r{qvs--<<-JJJJJJJJJJJ--<<-JJJ-楼层显示-JJJ--sy|n-sy||\\}npv\b-J->;=H--vs-5u|{Sy||V{qr\x07-KJ-=;=-33-no5Sy||-:-u|{Sy||V{qr\x076-KJ->;=6-\n----sy||\\}npv\b-J-=;>-7-zv{55>;=-8-PnzrnQvrpv|{;\b69->;=6H--\f--tylSntP|y|;n-J-tylSntP|y|;n-7-sy||\\}npv\b-7-ovtu{rH--<<-JJJJJJJJJJJJJJ--0v{pyqr-I|{rzn}}v{tlsntzr{K--0v{pyqr-Ir{p|qv{tlsntzr{K--<<-JJJ-全景图-JJJ--rp@-}n{|=a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|=lznv\x07h@j;\x07\b 6H--}n{|=a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|=a|crr\x079-}n{|=l ||z6H--}n{|=a|crr\x07-J-}n{|=a|crr\x07-7-zn@5}n{|=lznv\x076H--rp@-}n{|>a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|>lznv\x07h@j;\x07\b 6H--}n{|>a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|>a|crr\x079-}n{|>l ||z6H--}n{|>a|crr\x07-J-}n{|>a|crr\x07-7-zn@5}n{|>lznv\x076H--rpA-}n{|P|y|H--rpA-}n{|=P|y|-J-r\x07rPor5}n{|=lzn}9-}n{|=a|crr\x076H--rpA-}n{|>P|y|-J-r\x07rPor5}n{|>lzn}9-}n{|>a|crr\x076H--0vs-qrsv{rq5b`RlYbZV[N[PR6----}n{|=P|y|;n-J->;=-:-r\x07rPor5}n{|=lyzv{n{prZn}9-}n{|=a|crr\x076;H----}n{|>P|y|;n-J->;=-:-r\x07rPor5}n{|>lyzv{n{prZn}9-}n{|>a|crr\x076;H--0r{qvs--0vs-qrsv{rq5b`RlOYNPXla_N[`VaV\\[6----sy|n-oynpx]|tr-J-np|5:?;=-7-}|tr-8->;=6H----}n{|P|y|-J-zv\x075}n{|=P|y|9-OYNPXlP\\Y\\_9-zv{5>;=9-oynpx]|tr66H----}n{|P|y|-J-zv\x075}n{|P|y|9-}n{|>P|y|9-zn\x075=;=9-oynpx]|tr-:-?;=66H--0ryvs-qrsv{rq5b`Rl`]_RNQla_N[`VaV\\[6----rp?-prr{Pr{rP||q-J-r|yv|{-7-}v\x07ry_nv|-<-?;=H----sy|n-n{vv|{_nqv-J-qvn{pr5rp?5=;=9-=;=69-prr{Pr{rP||q6-7->;?H----sy|n-n{vv|{]|tr-J-qvn{pr5tylSntP||q;\x07\b9-prr{Pr{rP||q6-<-n{vv|{_nqvH----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-z||ur}5=;=9-=;?9-}|tr-:-n{vv|{]|tr66H--0ryr----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-}|tr6H--0r{qvs--tylSntP|y|-J-zv\x075}n{|P|y|9-tylSntP|y|9-z|qryNy}un6H--<<-JJJJJJJJJJJJJJ--0v{pyqr-Is|tlsntzr{K--0v{pyqr-I}rzyv}yvrqlny}unlsntzr{K--0v{pyqr-Iqvurv{tlsntzr{K--0vs-qrsv{rq5b`RlRQY6----tylSntP|y|;n-J-Y|tQr}uH--0r{qvs\f");function Ft(n,t){var e=Math.abs(Math.cos(n.latitude)),r=-Math.sin(n.longitude)*e,i=-Math.sin(n.latitude),a=-Math.cos(n.longitude)*e;return t?t.set(r,i,a):new c.Vector3(r,i,a)}var Gc=1,Kc=.1,jc=2e3,ni=Math.PI*2,zo=Math.PI/2;function Qo(n){return n>0&&n<=ni?n:(n%ni+ni)%ni}function Jc(n,t,e,r){e=Math.pow(e,4);for(var i=0;i<16;i++)r.elements[i]=n.elements[i]+(t.elements[i]-n.elements[i])*e;return r}var Fi=function(n){ue(t,n);function t(e,r,i,a,o,s,l){r===void 0&&(r=Gc),i===void 0&&(i=Kc),a===void 0&&(a=jc),o===void 0&&(o=new c.Vector2),s===void 0&&(s=new c.Vector2(512,512)),l===void 0&&(l=1);var u=n.call(this)||this;u.fov=e,u.aspect=r,u.near=i,u.far=a,u.perspToOrtho=o,u.resolution=s,u.pixelRatio=l,u.needsRender=!0,u.refineModel=!0,u.pose={longitude:0,latitude:0,fov:e,distance:0,offset:new c.Vector3},u.computePose(),u.perspectiveCamera=new c.PerspectiveCamera(u.fov,u.aspect,.001,u.far);var d=Math.max(u.orthoDistance,.01)*Math.tan(.5*u.fov/180*Math.PI),f=-.5*u.aspect*2*d;return u.orthographicCamera=new c.OrthographicCamera(f,-f,d,-d,.001,u.far),u.computeProjectionMatrix(),u.lastValues={position:u.position.clone(),quaternion:u.quaternion.clone(),scale:u.scale.clone(),fov:u.fov,aspect:u.aspect,near:u.near,far:u.far,orthoDistance:u.orthoDistance,perspToOrtho:u.perspToOrtho.clone()},u.type=u.perspToOrtho.x<1?"PerspectiveCamera":"OrthographicCamera",u}return Object.defineProperty(t.prototype,"orthoDistance",{get:function(){return this.pose.distance>1?this.pose.distance:1+(this.pose.distance-1)*this.perspToOrtho.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"zoom",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.zoom:this.type==="PerspectiveCamera"?this.perspectiveCamera.zoom:1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.top:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.bottom:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.left:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.right:0},enumerable:!1,configurable:!0}),t.prototype.getDirection=function(e){return Ft(this.pose,e)},t.prototype.computePose=function(e){e===void 0&&(e=0),this.updateMatrix();var r=this.matrix.elements,i=new c.Vector3().set(-r[8],-r[9],-r[10]).normalize();this.pose.longitude=Qo(-Math.atan2(i.x,-i.z)),this.pose.latitude=-Math.asin(i.y/1),this.pose.fov=this.fov,this.pose.distance=e;var a=new c.Vector3().add(this.position).add(i.clone().setLength(this.pose.distance));return this.pose.offset.copy(a),this},t.prototype.setFromPose=function(e){var r,i,a,o,s,l=Qo((r=e.longitude)!==null&&r!==void 0?r:this.pose.longitude),u=Math.max(-zo+1e-4,Math.min(zo-1e-4,(i=e.latitude)!==null&&i!==void 0?i:this.pose.latitude)),d=(a=e.fov)!==null&&a!==void 0?a:this.pose.fov,f=(o=e.distance)!==null&&o!==void 0?o:this.pose.distance,A=(s=e.offset)!==null&&s!==void 0?s:this.pose.offset,m=Ft({longitude:l,latitude:u}).normalize();return this.position.set(0,0,0),this.lookAt(m),this.position.add(A).sub(m.clone().setLength(f)),this.fov!==d&&(this.fov=d,this.updateProjectionMatrix()),this.updateMatrixWorld(),this.pose.longitude=l,this.pose.latitude=u,this.pose.fov=d,this.pose.distance=f,this.pose.offset.copy(A),this.needsRender=!0,this},t.prototype.copyPose=function(){return{longitude:this.pose.longitude,latitude:this.pose.latitude,fov:this.pose.fov,distance:this.pose.distance,offset:this.pose.offset.clone()}},t.prototype.computeProjectionMatrix=function(){Jc(this.orthographicCamera.projectionMatrix,this.perspectiveCamera.projectionMatrix,1-this.perspToOrtho.x,this.projectionMatrix),this.projectionMatrixInverse.getInverse(this.projectionMatrix),this.needsRender=!0},t.prototype.setViewOffset=function(e,r,i,a,o,s){this.perspectiveCamera.setViewOffset(e,r,i,a,o,s),this.orthographicCamera.setViewOffset(e,r,i,a,o,s),this.computeProjectionMatrix()},t.prototype.clearViewOffset=function(){this.perspectiveCamera.clearViewOffset(),this.orthographicCamera.clearViewOffset(),this.computeProjectionMatrix()},t.prototype.updateProjectionMatrix=function(){this.perspectiveCamera.updateProjectionMatrix(),this.orthographicCamera.updateProjectionMatrix(),this.computeProjectionMatrix()},Object.defineProperty(t.prototype,"perspectiveProjectionMatrix",{get:function(){return this.perspectiveCamera.projectionMatrix},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"perspectiveProjectionMatrixInverse",{get:function(){return this.perspectiveCamera.projectionMatrixInverse},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"orthographicProjectionMatrix",{get:function(){return this.orthographicCamera.projectionMatrix},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"orthographicProjectionMatrixInverse",{get:function(){return this.orthographicCamera.projectionMatrixInverse},enumerable:!1,configurable:!0}),t.prototype.updateTime=function(e,r){var i=!1;if((this.lastValues.fov!==this.fov||this.lastValues.near!==this.near||this.lastValues.far!==this.far||this.lastValues.aspect!==this.aspect)&&(this.perspectiveCamera.fov=this.fov,this.perspectiveCamera.near=this.near,this.perspectiveCamera.far=this.far,this.perspectiveCamera.aspect=this.aspect,this.perspectiveCamera.updateProjectionMatrix(),i=!0),!this.lastValues.position.equals(this.position)||!this.lastValues.quaternion.equals(this.quaternion)||!this.lastValues.scale.equals(this.scale)||!this.lastValues.perspToOrtho.equals(this.perspToOrtho)||this.lastValues.fov!==this.fov||this.lastValues.near!==this.near||this.lastValues.far!==this.far||this.lastValues.orthoDistance!==this.orthoDistance||this.lastValues.aspect!==this.aspect){var a=Math.max(this.orthoDistance,.01)*Math.tan(.5*this.fov/180*Math.PI),o=-.5*this.aspect*2*a;this.orthographicCamera.left=o,this.orthographicCamera.right=-o,this.orthographicCamera.top=a,this.orthographicCamera.bottom=-a,this.orthographicCamera.near=this.near,this.orthographicCamera.far=this.far,this.orthographicCamera.updateProjectionMatrix(),i=!0}i&&this.computeProjectionMatrix(),this.lastValues.position.copy(this.position),this.lastValues.quaternion.copy(this.quaternion),this.lastValues.scale.copy(this.scale),this.lastValues.fov=this.fov,this.lastValues.aspect=this.aspect,this.lastValues.near=this.near,this.lastValues.far=this.far,this.lastValues.orthoDistance=this.orthoDistance,this.lastValues.perspToOrtho.copy(this.perspToOrtho),this.type=this.perspToOrtho.x<1?"PerspectiveCamera":"OrthographicCamera"},Object.defineProperty(t.prototype,"isPerspectiveCamera",{get:function(){return this.perspToOrtho.x<1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isOrthographicCamera",{get:function(){return this.perspToOrtho.x>=1},enumerable:!1,configurable:!0}),t.prototype.copy=function(e,r){return n.prototype.copy.call(this,e,r),this.fov=e.fov,this.aspect=e.aspect,this.near=e.near,this.far=e.far,this.perspToOrtho.copy(e.perspToOrtho),this.updateTime(Me(),0),this},t}(c.Camera),Wc=new c.Vector4,jn=new c.WebGLCubeRenderTarget(1).texture;jn.name="EMPTY_TEXTURE";var Ji={modelAlpha:new c.Uniform(0),progress:new c.Uniform(0),pano0_map:new c.Uniform(jn),pano0_luminanceMap:new c.Uniform(null),pano0_matrix:new c.Uniform(new c.Matrix4),pano0_zoom:new c.Uniform(1),pano1_map:new c.Uniform(jn),pano1_luminanceMap:new c.Uniform(null),pano1_matrix:new c.Uniform(new c.Matrix4),pano1_zoom:new c.Uniform(1),clippers:new c.Uniform([]),shownFloorIndex:new c.Uniform(-1),constantColor:new c.Uniform(null),geometricError:new c.Uniform(0),pixelRatio:new c.Uniform(1),resolution:new c.Uniform(new c.Vector2(512,512)),floor:new c.Uniform(0),brightness:new c.Uniform(1),modelBoundingMin:new c.Uniform(new c.Vector3),modelBoundingMax:new c.Uniform(new c.Vector3)},Xc={none:{vertexShader:Dc,fragmentShader:zc,uniforms:c.UniformsUtils.merge([Ji,{opacity:{value:1}},c.UniformsLib.fog]),lights:!1},basic:{vertexShader:Qc,fragmentShader:Uc,uniforms:c.UniformsUtils.merge([Ji,c.ShaderLib.basic.uniforms]),lights:!1},phong:{vertexShader:qc,fragmentShader:Hc,uniforms:c.UniformsUtils.merge([Ji,c.ShaderLib.phong.uniforms]),lights:!0}},Tn=function(n){ue(t,n);function t(e,r){e===void 0&&(e="basic"),r===void 0&&(r={});var i=this,a,o,s,l,u,d,f,A,m,h,v,y,p,g,x,b,w,E,M,C,P,S=Xc[e];i=n.call(this,{vertexShader:S.vertexShader,fragmentShader:S.fragmentShader,uniforms:c.UniformsUtils.clone(S.uniforms),lights:S.lights,defines:{USE_CONSTANT_COLOR:!1,USE_EDL:!1,USE_HQ_WEIGHT:!1,USE_HQ_DEPTH:!1,NUM_CLIPPING_BOX:!1,USE_CLIPFLOOR:!1,USE_VERTEX_FLOOR:!1,USE_LUMINANCE:!1,USE_PANO_OPACITY:!1,USE_BLACK_TRANSITION:!1,USE_SPREAD_TRANSITION:!1,USE_POINT_NORMAL:!1,USE_POINT_CIRCLE:!1,USE_POINT_ADAPTIVE_SIZE:!1,USE_POINT_COLOR_ALTITUDE:!1}})||this,i.shaderType=e,i.color=new c.Color(16777215),i.map=null,i.lightMap=null,i.lightMapIntensity=1,i.aoMap=null,i.aoMapIntensity=1,i.specularMap=null,i.specular=new c.Color(1118481),i.alphaMap=null,i.envMap=null,i.reflectivity=1,i.refractionRatio=.98,i.emissiveMap=null,i.emissive=new c.Color(0),i.emissiveIntensity=1,i.bumpMap=null,i.bumpScale=1,i.normalMap=null,i.normalMapType=c.TangentSpaceNormalMap,i.normalScale=new c.Vector2(1,1),i.displacementMap=null,i.displacementScale=1,i.displacementBias=0,i.shininess=30;var T,B=null,L=null;return Object.defineProperties(i,{pano0:{get:function(){return B},set:function(k){if(B!==k){B=k,k===null?(this.uniforms.pano0_map.value=jn,this.uniforms.pano0_luminanceMap.value=null,this.uniforms.pano0_matrix.value.identity(),this.uniforms.pano0_zoom.value=1):(this.uniforms.pano0_map.value=k.map instanceof De?k.map.texture:k.map,this.uniforms.pano0_luminanceMap.value=k.luminanceMap instanceof De?k.luminanceMap.texture:k.luminanceMap,this.uniforms.pano0_matrix.value.copy(k.matrix),this.uniforms.pano0_zoom.value=k.zoom);var O=this.uniforms.pano0_luminanceMap.value!==null&&this.uniforms.pano1_luminanceMap.value!==null,D=this.defines.USE_LUMINANCE;D!==O&&(this.defines.USE_LUMINANCE=O,this.needsUpdate=!0)}}},pano1:{get:function(){return L},set:function(k){if(L!==k){L=k,k===null?(this.uniforms.pano1_map.value=jn,this.uniforms.pano1_luminanceMap.value=null,this.uniforms.pano1_matrix.value.identity(),this.uniforms.pano1_zoom.value=1):(this.uniforms.pano1_map.value=k.map instanceof De?k.map.texture:k.map,this.uniforms.pano1_luminanceMap.value=k.luminanceMap instanceof De?k.luminanceMap.texture:k.luminanceMap,this.uniforms.pano1_matrix.value.copy(k.matrix),this.uniforms.pano1_zoom.value=k.zoom);var O=this.uniforms.pano0_luminanceMap.value!==null&&this.uniforms.pano1_luminanceMap.value!==null,D=this.defines.USE_LUMINANCE;D!==O&&(this.defines.USE_LUMINANCE=O,this.needsUpdate=!0)}}},modelAlpha:{get:function(){return this.uniforms.modelAlpha.value},set:function(k){this.uniforms.modelAlpha.value=k}},progress:{get:function(){return this.uniforms.progress.value},set:function(k){this.uniforms.progress.value=k}},transition:{get:function(){return this.defines.USE_BLACK_TRANSITION?"BLACK":this.defines.USE_SPREAD_TRANSITION?"SPREAD":"FADE"},set:function(k){var O=this.defines.USE_BLACK_TRANSITION,D=this.defines.USE_SPREAD_TRANSITION;this.defines.USE_BLACK_TRANSITION=!1,this.defines.USE_SPREAD_TRANSITION=!1,this.defines["USE_".concat(k,"_TRANSITION")]=!0;var N=!1;O!==this.defines.USE_BLACK_TRANSITION&&(N=!0),D!==this.defines.USE_SPREAD_TRANSITION&&(N=!0),N&&(this.needsUpdate=!0)}},constantColor:{get:function(){return this.uniforms.constantColor.value},set:function(k){this.uniforms.constantColor.value=k;var O=this.defines.USE_CONSTANT_COLOR,D=k!==null;O!==D&&(this.defines.USE_CONSTANT_COLOR=D,this.needsUpdate=!0)}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(k){this.uniforms.opacity.value=k}},shownFloorIndex:{get:function(){return this.uniforms.shownFloorIndex.value},set:function(k){this.uniforms.shownFloorIndex.value=k}},brightness:{get:function(){return this.uniforms.brightness.value},set:function(k){this.uniforms.brightness.value=k}},clippers:{get:function(){return T},set:function(k){T!==k&&(T=k,this.uniforms.clippers.value=(T||[]).map(function(O){var D=typeof O.floorIndex=="number"?O.floorIndex:-1,N=new c.Matrix4().getInverse(O.clippingBoxMatrix);return{matrixInverse:N,floorIndex:D}}),this.needsUpdate=!0)}},useEDL:{get:function(){return this.defines.USE_EDL},set:function(k){k!==this.defines.USE_EDL&&(this.defines.USE_EDL=k,this.needsUpdate=!0)}},useHQWeight:{get:function(){return this.defines.USE_HQ_WEIGHT},set:function(k){k!==this.defines.USE_HQ_WEIGHT&&(this.defines.USE_HQ_WEIGHT=k,this.needsUpdate=!0)}},useHQDepth:{get:function(){return this.defines.USE_HQ_DEPTH},set:function(k){k!==this.defines.USE_HQ_DEPTH&&(this.defines.USE_HQ_DEPTH=k,this.needsUpdate=!0)}},floor:{get:function(){return this.uniforms.floor.value},set:function(k){this.uniforms.floor.value=k}}}),i.pano0=(a=r.pano0)!==null&&a!==void 0?a:Ee.pano0,i.pano1=(o=r.pano1)!==null&&o!==void 0?o:Ee.pano1,i.modelAlpha=(s=r.modelAlpha)!==null&&s!==void 0?s:Ee.modelAlpha,i.progress=(l=r.progress)!==null&&l!==void 0?l:Ee.progress,i.transition=(u=r.transition)!==null&&u!==void 0?u:Ee.transition,i.constantColor=(d=r.constantColor)!==null&&d!==void 0?d:Ee.constantColor,i.opacity=(f=r.opacity)!==null&&f!==void 0?f:Ee.opacity,i.shownFloorIndex=(A=r.shownFloorIndex)!==null&&A!==void 0?A:Ee.shownFloorIndex,i.clippers=(m=r.clippers)!==null&&m!==void 0?m:Ee.clippers,i.useEDL=(h=r.useEDL)!==null&&h!==void 0?h:Ee.useEDL,i.useHQWeight=(v=r.useHQWeight)!==null&&v!==void 0?v:Ee.useHQWeight,i.useHQDepth=(y=r.useHQDepth)!==null&&y!==void 0?y:Ee.useHQDepth,i.pointSize=(p=r.pointSize)!==null&&p!==void 0?p:Ee.pointSize,i.pointColor=(g=r.pointColor)!==null&&g!==void 0?g:Ee.pointColor,i.pointShape=(x=r.pointShape)!==null&&x!==void 0?x:Ee.pointShape,i.pointScale=(b=r.pointScale)!==null&&b!==void 0?b:Ee.pointScale,i.pointBack=(w=r.pointBack)!==null&&w!==void 0?w:Ee.pointBack,i.pointMinPixel=(E=r.pointMinPixel)!==null&&E!==void 0?E:Ee.pointMinPixel,i.pointMaxPixel=(M=r.pointMaxPixel)!==null&&M!==void 0?M:Ee.pointMaxPixel,i.gradientTexture=(C=r.gradientTexture)!==null&&C!==void 0?C:Ee.gradientTexture,i.brightness=(P=r.brightness)!==null&&P!==void 0?P:Ee.brightness,i.floor=0,i}return t.prototype.onBeforeCompile=function(e,r){var i,a,o=String((a=(i=this.clippers)===null||i===void 0?void 0:i.length)!==null&&a!==void 0?a:0);e.vertexShader=e.vertexShader.replace(/NUM_CLIPPERS/g,o),e.fragmentShader=e.fragmentShader.replace(/NUM_CLIPPERS/g,o)},t.prototype.refreshUniforms=function(e){var r,i,a=this.uniforms;a.diffuse&&a.diffuse.value.copy(this.color),a.opacity&&(a.opacity.value=this.opacity),a.color&&a.diffuse.value.copy(this.color),a.emissive&&a.emissive.value.copy(this.emissive).multiplyScalar(this.emissiveIntensity),a.map&&(a.map.value=this.map),a.alphaMap&&(a.alphaMap.value=this.alphaMap),a.specularMap&&(a.specularMap.value=this.specularMap),a.envMap&&(a.envMap.value=this.envMap,a.flipEnvMap.value=!((r=this.envMap)===null||r===void 0)&&r.isCubeTexture?-1:1,a.reflectivity.value=this.reflectivity,a.refractionRatio.value=this.refractionRatio,a.maxMipLevel.value=this.envMap&&(i=e.properties.get(this.envMap).__maxMipLevel)!==null&&i!==void 0?i:0),a.lightMap&&(a.lightMap.value=this.lightMap,a.lightMapIntensity.value=this.lightMapIntensity),a.aoMap&&(a.aoMap.value=this.aoMap,a.aoMapIntensity.value=this.aoMapIntensity),a.specular&&a.specular.value.copy(this.specular),a.shininess&&(a.shininess.value=Math.max(this.shininess,1e-4)),a.emissiveMap&&(a.emissiveMap.value=this.emissiveMap),a.bumpMap&&(a.bumpMap.value=this.bumpMap,a.bumpScale.value=this.bumpScale,this.side===c.BackSide&&(a.bumpScale.value*=-1)),a.normalMap&&(a.normalMap.value=this.normalMap,a.normalScale.value.copy(this.normalScale),this.side===c.BackSide&&a.normalScale.value.negate()),a.displacementMap&&(a.displacementMap.value=this.displacementMap,a.displacementScale.value=this.displacementScale,a.displacementBias.value=this.displacementBias);var o;this.map?o=this.map:this.specularMap?o=this.specularMap:this.displacementMap?o=this.displacementMap:this.normalMap?o=this.normalMap:this.bumpMap?o=this.bumpMap:this.alphaMap?o=this.alphaMap:this.emissiveMap&&(o=this.emissiveMap),o!==void 0&&(o.matrixAutoUpdate===!0&&o.updateMatrix(),a.uvTransform.value.copy(o.matrix));var s;this.aoMap?s=this.aoMap:this.lightMap&&(s=this.lightMap),s!==void 0&&(s.matrixAutoUpdate===!0&&s.updateMatrix(),a.uv2Transform.value.copy(s.matrix))},t.prototype.update=function(e,r){if(this.refreshUniforms(e),this.transparent=!1,this.shownFloorIndex>-1&&(this.defines.USE_VERTEX_FLOOR?this.transparent=!0:this.transparent=this.shownFloorIndex!==this.floor),this.opacity<1&&(this.transparent=!0),this.alphaMap&&(this.transparent=!0),this.brightness<1&&(this.transparent=!0),this.blending=this.transparent?c.NormalBlending:c.NoBlending,r instanceof Fi)this.uniforms.pixelRatio.value=r.pixelRatio,this.uniforms.resolution.value.copy(r.resolution);else{this.uniforms.pixelRatio.value=e.getPixelRatio();var i=e.getViewport(Wc);this.uniforms.resolution.value.set(i.z,i.w)}},t.prototype.syncModel=function(e){var r="".concat(e.id,":").concat(e.materialVersion);r!==this.syncModelVersion&&(Object.assign(this,e.getMaterial()),this.uniforms.modelBoundingMax.value.copy(e.bounding.max),this.uniforms.modelBoundingMin.value.copy(e.bounding.min),this.syncModelVersion=r)},t.prototype.copy=function(e){return n.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.specular.copy(e.specular),this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.emissiveMap=e.emissiveMap,this.emissive.copy(e.emissive),this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.shininess=e.shininess,this.pano0=e.pano0,this.pano1=e.pano1,this.modelAlpha=e.modelAlpha,this.progress=e.progress,this.transition=e.transition,this.opacity=e.opacity,this.constantColor=e.constantColor,this.shownFloorIndex=e.shownFloorIndex,this.brightness=e.brightness,this.clippers=e.clippers,this.useEDL=e.useEDL,this.useHQWeight=e.useHQWeight,this.useHQDepth=e.useHQDepth,this.pointColor=e.pointColor,this.pointSize=e.pointSize,this.pointShape=e.pointShape,this.pointScale=e.pointScale,this.pointBack=e.pointBack,this.pointMinPixel=e.pointMinPixel,this.pointMaxPixel=e.pointMaxPixel,this.gradientTexture=e.gradientTexture,this.floor=e.floor,this},t}(c.ShaderMaterial),Yr=function(n){ue(t,n);function t(e){var r=e.preserveDrawingBuffer,i=r===void 0?!0:r,a=e.premultipliedAlpha,o=a===void 0?!0:a,s=e.stencil,l=s===void 0?!0:s,u=e.backgroundColor,d=u===void 0?1579548:u,f=e.backgroundAlpha,A=f===void 0?1:f,m=e.pixelRatio,h=m===void 0?1:m,v=e.antialias,y=e.webgl2,p=e.logarithmicDepthBuffer,g=e.precision,x=this,b={antialias:v,alpha:!0,depth:!0,preserveDrawingBuffer:i,stencil:l,premultipliedAlpha:o,powerPreference:"high-performance"},w={logarithmicDepthBuffer:p,precision:g};if(y){var E=document.createElement("canvas"),M=E.getContext("webgl2",b);M?x=n.call(this,F(F(F({},b),w),{antialias:!0,canvas:E,context:M}))||this:(console.error("error occurred when getting webgl2 canvas context, mybe webgl2 not support, fallback to webgl."),x=n.call(this,F(F({},b),w))||this)}else x=n.call(this,F(F({},b),w))||this;return x.setPixelRatio(h),x.setClearColor(d,A),x.outputEncoding=c.sRGBEncoding,x.autoClear=!0,x}return t}(c.WebGLRenderer),y0=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.add=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return n.prototype.add.apply(this,e)},t.prototype.remove=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return n.prototype.remove.apply(this,e)},t}(c.Scene),ht;(function(n){n[n.Outside=-1]="Outside",n[n.Intersecting=0]="Intersecting",n[n.Inside=1]="Inside"})(ht||(ht={}));var b0=1e-6,qe=new c.Vector3,Qr=new c.Matrix4,Br=new c.Vector3,Rr=new c.Vector3,kr=new c.Vector3,Ta=new c.Vector3,Wi=new c.Box3,Xi=new c.Sphere,Uo=new c.Matrix4,_i=new c.Ray,dt=new c.Object3D,qo=new c.Frustum;function x0(n,t){var e=n.elements;return t.setFromRotationMatrix(Qr.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1)),t}var Qn=function(){function n(t){t===void 0&&(t=[]),this.planes=t}return Object.defineProperty(n,"MASK_OUTSIDE",{get:function(){return 4294967295},enumerable:!1,configurable:!0}),Object.defineProperty(n,"MASK_INSIDE",{get:function(){return 0},enumerable:!1,configurable:!0}),Object.defineProperty(n,"MASK_INDETERMINATE",{get:function(){return 2147483647},enumerable:!1,configurable:!0}),n.prototype.setFromFrustum=function(t){return this.planes=t.planes.map(function(e){return e.clone()}),this},n.prototype.setFromCamera=function(t){return Qr.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),qo.setFromProjectionMatrix(Qr),this.setFromFrustum(qo),this},n.prototype.applyMatrix4=function(t){for(var e=0,r=this.planes;e<r.length;e++){var i=r[e];i.applyMatrix4(t)}},n.prototype.copy=function(t){return this.planes=t.planes.map(function(e){return e.clone()}),this},n.prototype.clone=function(){return new n().copy(this)},n.prototype.computeVisibility=function(t){for(var e=ht.Inside,r=0,i=this.planes;r<i.length;r++){var a=i[r],o=t.intersectPlane(a);switch(o){case ht.Outside:return ht.Outside;case ht.Intersecting:e=ht.Intersecting;break}}return e},n.prototype.computeVisibilityWithPlaneMask=function(t,e){if(e===n.MASK_OUTSIDE||e===n.MASK_INSIDE)return e;for(var r=n.MASK_INSIDE,i=Math.min(32,this.planes.length),a=0;a<i;++a){var o=1<<a;if(e&o){var s=this.planes[a],l=t.intersectPlane(s);if(l===ht.Outside)return n.MASK_OUTSIDE;l===ht.Intersecting&&(r|=o)}}return r},n}(),w0=function(){function n(){this.type="box",this.center=new c.Vector3,this.halfSize=new c.Vector3,this.rotation=new c.Matrix3}return n.prototype.fromJson=function(t){var e=t.box;this.center.set(e[0],e[1],e[2]);var r=e[3],i=e[4],a=e[5],o=e[6],s=e[7],l=e[8],u=e[9],d=e[10],f=e[11],A=Math.sqrt(r*r+i*i+a*a),m=Math.sqrt(o*o+s*s+l*l),h=Math.sqrt(u*u+d*d+f*f);this.halfSize.set(A,m,h);var v=this.halfSize.toArray().reduce(function(y,p){return y+p},0);return(isNaN(v)||v<=0)&&this.halfSize.setScalar(b0),this.rotation.fromArray([r/A,i/A,a/A,o/m,s/m,l/m,u/h,d/h,f/h]),isNaN(this.rotation.toArray().reduce(function(y,p){return y+p},0))&&this.rotation.identity(),this},n.prototype.toJson=function(){return this.rotation.extractBasis(Br,Rr,kr),{box:bt(bt(bt(bt([],this.center.toArray(),!0),Br.multiplyScalar(this.halfSize.x).toArray(),!0),Rr.multiplyScalar(this.halfSize.y).toArray(),!0),kr.multiplyScalar(this.halfSize.z).toArray(),!0)}},n.prototype.copy=function(t){return this.center.copy(t.center),this.halfSize.copy(t.halfSize),this.rotation.copy(t.rotation),this},n.prototype.clone=function(){return new n().copy(this)},n.prototype.applyMatrix4=function(t){return dt.position.copy(this.center),x0(this.rotation,dt.quaternion),dt.scale.copy(this.halfSize),dt.matrix.compose(dt.position,dt.quaternion,dt.scale),dt.matrix.premultiply(t),dt.matrix.decompose(dt.position,dt.quaternion,dt.scale),this.center.copy(dt.position),this.rotation.setFromMatrix4(Qr.makeRotationFromQuaternion(dt.quaternion)),this.halfSize.copy(dt.scale),this},n.prototype.getCenter=function(t){return t.copy(this.center)},n.prototype.distanceSquaredToPoint=function(t){var e=this.rotation.elements,r=t.x-this.center.x,i=t.y-this.center.y,a=t.z-this.center.z,o=0,s;return s=r*e[0]+i*e[1]+a*e[2],s<0&&(s=-s),s-=this.halfSize.x,s>0&&(o+=s*s),s=r*e[3]+i*e[4]+a*e[5],s<0&&(s=-s),s-=this.halfSize.y,s>0&&(o+=s*s),s=r*e[6]+i*e[7]+a*e[8],s<0&&(s=-s),s-=this.halfSize.z,s>0&&(o+=s*s),o},n.prototype.distanceToPoint=function(t){return Math.sqrt(this.distanceSquaredToPoint(t))},n.prototype.distanceToPlane=function(t){var e=t.projectPoint(this.center,new c.Vector3);return this.distanceToPoint(e)},n.prototype.getBoundingBox=function(t){return t.makeEmpty(),this.rotation.extractBasis(Br,Rr,kr),Br.setLength(this.halfSize.x),Rr.setLength(this.halfSize.y),kr.setLength(this.halfSize.z),t.expandByPoint(qe.copy(this.center).add(Br)),t.expandByPoint(qe.copy(this.center).sub(Br)),t.expandByPoint(qe.copy(this.center).add(Rr)),t.expandByPoint(qe.copy(this.center).sub(Rr)),t.expandByPoint(qe.copy(this.center).add(kr)),t.expandByPoint(qe.copy(this.center).sub(kr)),t},n.prototype.toGeometry=function(){var t=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),e=new Float32Array(8*3);qe.set(this.halfSize.x,this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,0),qe.set(-this.halfSize.x,this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,3),qe.set(-this.halfSize.x,-this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,6),qe.set(this.halfSize.x,-this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,9),qe.set(this.halfSize.x,this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,12),qe.set(-this.halfSize.x,this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,15),qe.set(-this.halfSize.x,-this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,18),qe.set(this.halfSize.x,-this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,21);var r=new c.BufferGeometry;return r.setIndex(new c.BufferAttribute(t,1)),r.setAttribute("position",new c.BufferAttribute(e,3)),r.computeBoundingBox(),r.computeBoundingSphere(),r},n.prototype.intersectPlane=function(t){var e=this.center,r=t.normal,i=this.rotation.elements,a=this.halfSize,o=r.x,s=r.y,l=r.z,u=Math.abs(o*i[0]*a.x+s*i[1]*a.x+l*i[2]*a.x)+Math.abs(o*i[3]*a.y+s*i[4]*a.y+l*i[5]*a.y)+Math.abs(o*i[6]*a.z+s*i[7]*a.z+l*i[8]*a.z),d=r.dot(e)+t.constant;return d<=-u?ht.Outside:d>=u?ht.Inside:ht.Intersecting},n.prototype.intersectRay=function(t,e){if(Ta.copy(this.halfSize).multiplyScalar(2),Wi.setFromCenterAndSize(qe.set(0,0,0),Ta),this.rotation.extractBasis(Br,Rr,kr),Qr.makeBasis(Br,Rr,kr),Qr.setPosition(this.center),Uo.getInverse(Qr),_i.copy(t).applyMatrix4(Uo),Wi.containsPoint(_i.origin))return!0;var r=_i.intersectBox(Wi,qe);return r?e!==void 0?r.applyMatrix4(Qr).distanceTo(t.origin)<e:!0:!1},n}(),E0=function(){function n(){this.type="sphere",this.center=new c.Vector3,this.radius=-1}return n.prototype.fromJson=function(t){var e=t.sphere;return this.center.set(e[0],e[1],e[2]),this.radius=Math.max(e[3],b0),this},n.prototype.toJson=function(){return{sphere:bt(bt([],this.center.toArray(),!0),[this.radius],!1)}},n.prototype.copy=function(t){return this.center.copy(t.center),this.radius=t.radius,this},n.prototype.clone=function(){return new n().copy(this)},n.prototype.getBoundingBox=function(t){return t.setFromCenterAndSize(this.center,Ta.set(1,1,1).multiplyScalar(this.radius*2)),t},n.prototype.toGeometry=function(){for(var t=32,e=new Float32Array(t*3*2*2),r=0;r<=t;r++){var i=0;i=r/t*Math.PI*2,e[r*6+0]=this.center.x+Math.cos(i)*this.radius,e[r*6+1]=this.center.y+Math.sin(i)*this.radius,e[r*6+2]=this.center.z+0,i=(r+1)/t*Math.PI*2,e[r*6+3]=this.center.x+Math.cos(i)*this.radius,e[r*6+4]=this.center.y+Math.sin(i)*this.radius,e[r*6+5]=this.center.z+0}for(var r=t;r<=t*2;r++){var i=0;i=r/t*Math.PI*2,e[r*6+0]=this.center.x+Math.cos(i)*this.radius,e[r*6+1]=this.center.y+0,e[r*6+2]=this.center.z+Math.sin(i)*this.radius,i=(r+1)/t*Math.PI*2,e[r*6+3]=this.center.x+Math.cos(i)*this.radius,e[r*6+4]=this.center.y+0,e[r*6+5]=this.center.z+Math.sin(i)*this.radius}var a=new c.BufferGeometry;return a.setAttribute("position",new c.BufferAttribute(e,3)),a.computeBoundingBox(),a.computeBoundingSphere(),a},n.prototype.applyMatrix4=function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},n.prototype.getCenter=function(t){return t.copy(this.center)},n.prototype.distanceSquaredToPoint=function(t){var e=this.distanceToPoint(t);return e*e},n.prototype.distanceToPoint=function(t){var e=this.center.distanceTo(t)-this.radius;return e<=0?0:e},n.prototype.distanceToPlane=function(t){var e=Math.abs(t.distanceToPoint(this.center));return Math.max(0,e-this.radius)},n.prototype.intersectPlane=function(t){var e=this.center,r=this.radius,i=t.normal,a=i.dot(e)+t.constant;return a<-r?ht.Outside:a<r?ht.Intersecting:ht.Inside},n.prototype.intersectRay=function(t,e){if(Xi.set(this.center,this.radius),Xi.containsPoint(t.origin))return!0;var r=t.intersectSphere(Xi,qe);return r?e!==void 0?t.origin.distanceTo(r)<e:!0:!1},n}(),_c=function(){function n(){throw this.type="regin",this.west=0,this.south=0,this.east=0,this.north=0,this.minHeight=0,this.maxHeight=0,new Error("Region bounding volume not supported.")}return n.prototype.fromJson=function(t){var e=t.region;return this.west=e[0],this.south=e[1],this.east=e[2],this.north=e[3],this.minHeight=e[4],this.maxHeight=e[5],this},n.prototype.toJson=function(){return{region:[this.west,this.south,this.east,this.north,this.minHeight,this.maxHeight]}},n.prototype.copy=function(t){return this.west=t.west,this.south=t.south,this.east=t.east,this.north=t.north,this.minHeight=t.minHeight,this.maxHeight=t.maxHeight,this},n.prototype.clone=function(){return new n().copy(this)},n.prototype.getBoundingBox=function(t){throw new Error("not implemented")},n.prototype.toGeometry=function(){throw new Error("not implemented")},n.prototype.applyMatrix4=function(t){throw new Error("not implemented")},n.prototype.getCenter=function(t){throw new Error("not implemented")},n.prototype.distanceToPoint=function(t){throw new Error("not implemented")},n.prototype.distanceSquaredToPoint=function(t){throw new Error("not implemented")},n.prototype.distanceToPlane=function(t){throw new Error("not implemented")},n.prototype.intersectPlane=function(t){throw new Error("not implemented")},n.prototype.intersectRay=function(t){throw new Error("not implemented")},n}();function di(n){if("box"in n)return new w0().fromJson(n);if("sphere"in n)return new E0().fromJson(n);if("region"in n)return new _c().fromJson(n);throw new Error("BoundingVolume ".concat(JSON.stringify(n)," never suppored."))}var ii=[4821759,8191922,16637280,16739958,5822969,376977,16747077,9259235,14514687].map(function(n){return new c.LineBasicMaterial({color:n,depthWrite:!1,depthTest:!1,transparent:!0})}),Zc=function(){var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),t=new Float32Array(8*3);qe.set(1,1,1).toArray(t,0),qe.set(-1,1,1).toArray(t,3),qe.set(-1,-1,1).toArray(t,6),qe.set(1,-1,1).toArray(t,9),qe.set(1,1,-1).toArray(t,12),qe.set(-1,1,-1).toArray(t,15),qe.set(-1,-1,-1).toArray(t,18),qe.set(1,-1,-1).toArray(t,21);var e=new c.BufferGeometry;return e.setIndex(new c.BufferAttribute(n,1)),e.setAttribute("position",new c.BufferAttribute(t,3)),e.computeBoundingBox(),e.computeBoundingSphere(),e}(),Yc=function(){for(var n=32,t=new Float32Array(n*3*2*2),e=0;e<=n;e++){var r=0;r=e/n*Math.PI*2,t[e*6+0]=Math.cos(r),t[e*6+1]=Math.sin(r),t[e*6+2]=0,r=(e+1)/n*Math.PI*2,t[e*6+3]=Math.cos(r),t[e*6+4]=Math.sin(r),t[e*6+5]=0}for(var e=n;e<=n*2;e++){var r=0;r=e/n*Math.PI*2,t[e*6+0]=Math.cos(r),t[e*6+1]=0,t[e*6+2]=Math.sin(r),r=(e+1)/n*Math.PI*2,t[e*6+3]=Math.cos(r),t[e*6+4]=0,t[e*6+5]=Math.sin(r)}var i=new c.BufferGeometry;return i.setAttribute("position",new c.BufferAttribute(t,3)),i.computeBoundingBox(),i.computeBoundingSphere(),i}();function $c(n,t){if(n instanceof w0){var e=new c.LineSegments(Zc,ii[Math.min(t,ii.length-1)]);return e.position.copy(n.center),x0(n.rotation,e.quaternion),e.scale.set(n.halfSize.x,n.halfSize.y,n.halfSize.z),e.matrix.compose(e.position,e.quaternion,e.scale),e}else if(n instanceof E0){var e=new c.LineSegments(Yc,ii[Math.min(t,ii.length-1)]);return e.position.copy(n.center),e.scale.set(n.radius,n.radius,n.radius),e.matrix.compose(e.position,e.quaternion,e.scale),e}throw new Error("never")}var ed=new c.Vector3,eo=function(){function n(t,e,r,i){var a=this,o,s,l;this.parent=null,this.floor=0,this.id=t,this.state={visible:!1,frameNumber:0,selectedFrameNumber:0,requestedFrameNumber:0,touchedFrameNumber:0,distanceToCamera:0,centerZDepth:0,screenSpaceError:0,visibilityPlaneMask:0,inRequestVolume:!1,shouldRefine:!1,stackLength:0,finalResolution:!0,selectionDepth:0,shouldSelect:!1,lastSelect:!1,ancestorWithContent:null,ancestorWithContentAvailable:null},this.parent=i!=null?i:null,this.level=this.parent?this.parent.level+1:0,this.tileset=r,this.refine=(o=e.refine)!==null&&o!==void 0?o:this.parent?this.parent.refine:"REPLACE",this.transform=new c.Matrix4,e.transform&&this.transform.fromArray(e.transform),this.parent&&this.transform.premultiply(this.parent.transform),typeof e.geometricError=="number"?this.geometricError=e.geometricError*this.transform.getMaxScaleOnAxis():this.geometricError=(l=(s=this.parent)===null||s===void 0?void 0:s.geometricError)!==null&&l!==void 0?l:0,e.content&&e.content.uri?(this.content={uri:e.content.uri,loadState:"UNLOADED",byteLength:0},e.content.group!==void 0&&(this.content.group=e.content.group),e.content.boundingVolume&&(this.content.boundingVolume=di(e.content.boundingVolume).applyMatrix4(this.transform)),/\.json$/.test(this.content.uri)?this.type="TILESET":this.type="SCENEGRAPH"):(this.content=null,this.type="EMPTY"),this.levelOfContent=this.parent?this.parent.levelOfContent:-1,this.type==="SCENEGRAPH"&&(this.levelOfContent=this.levelOfContent+1),e.boundingVolume&&(this.boundingVolume=di(e.boundingVolume).applyMatrix4(this.transform)),e.viewerRequestVolume&&(this.viewerRequestVolume=di(e.viewerRequestVolume).applyMatrix4(this.transform)),this.extras=e.extras||{},typeof this.extras.floor=="number"&&(this.floor=this.extras.floor),this.boundingVolume&&(this.boundingVolumeDebugObject=$c(this.boundingVolume,this.levelOfContent)),e.children?this.children=e.children.map(function(u,d){return new n("".concat(a.id,".").concat(d),u,r,a)}):this.children=[]}return n.prototype.traverse=function(t){t(this);for(var e=0,r=this.children;e<r.length;e++){var i=r[e];i.traverse(t)}},n.prototype.updateState=function(t){this.state.frameNumber=t.frameNumber;var e=this.tileset.transformIsIdentity?null:this.tileset.transform;if(this.boundingVolume){var r=e?this.boundingVolume.clone().applyMatrix4(e):this.boundingVolume;if(t.camera.type==="OrthographicCamera"){var i=new c.Plane().setFromNormalAndCoplanarPoint(t.camera.direction,t.camera.position);this.state.distanceToCamera=r.distanceToPlane(i)}else this.state.distanceToCamera=r.distanceToPoint(t.camera.position);var a=r.getCenter(ed).sub(t.camera.position);this.state.centerZDepth=t.camera.direction.dot(a);var o=this.parent?this.parent.state.visibilityPlaneMask:Qn.MASK_INDETERMINATE;this.state.visibilityPlaneMask=t.cullingVolume.computeVisibilityWithPlaneMask(r,o),this.state.visible=this.state.visibilityPlaneMask!==Qn.MASK_OUTSIDE}else this.state.distanceToCamera=0,this.state.centerZDepth=0,this.state.visibilityPlaneMask=Qn.MASK_INDETERMINATE,this.state.visible=!0;if(this.levelOfContent>t.maxLevelOfDetail&&(this.state.visible=!1),this.levelOfContent<=t.minLevelOfDetail&&(this.state.visible=!0),this.viewerRequestVolume){var s=e?this.viewerRequestVolume.clone().applyMatrix4(e):this.viewerRequestVolume;this.state.inRequestVolume=s.distanceSquaredToPoint(t.camera.position)<=0}else this.state.inRequestVolume=!0;this.state.screenSpaceError=this.getScreenSpaceError(t,this.state.distanceToCamera,!1)},Object.defineProperty(n.prototype,"selected",{get:function(){return this.state.selectedFrameNumber===this.tileset.frameNumber},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasChildren",{get:function(){return this.children.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"siblingIndex",{get:function(){var t,e;return(e=(t=this.parent)===null||t===void 0?void 0:t.children.indexOf(this))!==null&&e!==void 0?e:0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasTilesetContent",{get:function(){return this.children.length>0&&this.type==="TILESET"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasRenderContent",{get:function(){return this.type==="SCENEGRAPH"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"contentAvailable",{get:function(){var t;return this.hasRenderContent&&((t=this.content)===null||t===void 0?void 0:t.loadState)==="READY"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasUnloadedContent",{get:function(){var t;return((t=this.content)===null||t===void 0?void 0:t.loadState)==="UNLOADED"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasEmptyContent",{get:function(){return this.type==="EMPTY"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"contentReady",{get:function(){var t;return((t=this.content)===null||t===void 0?void 0:t.loadState)==="READY"||this.hasEmptyContent},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"contentByteLength",{get:function(){return this.content?this.content.byteLength:0},enumerable:!1,configurable:!0}),n.prototype.loadContent=function(){var t=this,e;if(this.hasEmptyContent||!(!((e=this.content)===null||e===void 0)&&e.uri))return Promise.resolve(!1);var r=this.content;return r.data?Promise.resolve(!0):(r.loadState="LOADING",this.tileset.requestScheduler.scheduleRequest(this.id,function(){return t.getPriority()}).then(function(i){return i?t.tileset.options.contentLoader(t).then(function(a){return i.done(),r.loadState=a?"READY":"UNLOADED",a}).catch(function(a){return r.loadState="FAILED",i.done(),Promise.reject(a)}):(r.loadState="UNLOADED",Promise.resolve(!1))}))},n.prototype.unloadContent=function(){return this.content&&(this.content.loadState="UNLOADED",this.content.byteLength=0),!0},n.prototype.getScreenSpaceError=function(t,e,r){var i=this.tileset.transformIsIdentity?1:this.tileset.transform.getMaxScaleOnAxis(),a=this.parent?this.parent.geometricError:this.tileset.geometricError,o=i*(r?a:this.geometricError);if(o===0)return 0;var s=Math.max(e,.001),l=o*t.height/(s*t.sseDenominator);return l},n.prototype.getPriority=function(){var t=this.refine==="ADD"||this.tileset.skipLevelOfDetail;if(t&&!this.state.visible||this.tileset.frameNumber-this.state.touchedFrameNumber>=1||this.content.loadState==="UNLOADED")return-1;var e=this.parent,r=e&&(!t||this.state.screenSpaceError===0),i=r?e.state.screenSpaceError:this.state.screenSpaceError,a=this.tileset.root?this.tileset.root.state.screenSpaceError:0,o=Math.max(a-i,0);return o},n}(),C0=function(){function n(t){this.tileset=t,this.activeRequests=0,this.requestQueue=[],this.requestMap=new Map,this.deferred=null}return n.prototype.scheduleRequest=function(t,e){var r=this.requestMap.get(t);if(r)return r;var i={identiy:t,priority:0,getPriority:e,resolve:function(){}},a=new Promise(function(o){return i.resolve=o});return this.requestQueue.push(i),this.requestMap.set(t,a),this.issueNewRequests(),a},n.prototype.reset=function(){for(var t=0,e=this.requestQueue;t<e.length;t++){var r=e[t];r.resolve(null)}this.requestQueue.length=0,this.requestMap.clear(),this.activeRequests=0},n.prototype.issueRequest=function(t){var e=this,r=t.identiy,i=t.resolve,a=!1,o=function(){a||(a=!0,e.requestMap.delete(r),e.activeRequests--,e.issueNewRequests())};this.activeRequests++,i({done:o})},n.prototype.issueNewRequests=function(){var t=this;this.deferred||(this.deferred=setTimeout(function(){return t.issueNewRequestsAsync()},0))},n.prototype.issueNewRequestsAsync=function(){this.deferred=null;var t=Math.max(this.tileset.maxRequests-this.activeRequests,0);if(t!==0){this.updateAllRequests();for(var e=0;e<t;e++){var r=this.requestQueue.shift();if(r)this.issueRequest(r);else break}}},n.prototype.updateAllRequests=function(){for(var t=this.requestQueue,e=0;e<t.length;e++){var r=t[e];this.updateRequest(r)===!1&&(t.splice(e,1),this.requestMap.delete(r.identiy),e--)}t.sort(function(i,a){return i.priority-a.priority})},n.prototype.updateRequest=function(t){return t.priority=t.getPriority(t.identiy),t.priority<0?(t.resolve(null),!1):!0},n}(),td=function(){function n(t,e,r){this.item=t,this.previous=e,this.next=r}return n}(),rd=function(){function n(){this.head=null,this.tail=null,this._length=0}return Object.defineProperty(n.prototype,"length",{get:function(){return this._length},enumerable:!1,configurable:!0}),n.prototype.add=function(t){var e=new td(t,this.tail,null);return this.tail?(this.tail.next=e,this.tail=e):(this.head=e,this.tail=e),this._length++,e},n.prototype.remove=function(t){t.previous&&t.next?(t.previous.next=t.next,t.next.previous=t.previous):t.previous?(t.previous.next=null,this.tail=t.previous):t.next?(t.next.previous=null,this.head=t.next):(this.head=null,this.tail=null),t.next=null,t.previous=null,this._length--},n.prototype.splice=function(t,e){t!==e&&(this.remove(e),this.insert(t,e))},n.prototype.insert=function(t,e){var r=t.next;t.next=e,this.tail===t?this.tail=e:r.previous=e,e.next=r,e.previous=t,this._length++},n.prototype.toArray=function(){for(var t=[],e=this.head;e;)t.push(e),e=e.next;return t},n}(),M0=function(){function n(){this.cacheNodeMap=new Map,this.list=new rd,this.sentinel=this.list.add("sentinel")}return n.prototype.reset=function(){this.list.tail&&this.list.splice(this.list.tail,this.sentinel)},n.prototype.touch=function(t){var e=this.cacheNodeMap.get(t);e&&this.list.splice(this.sentinel,e)},n.prototype.add=function(t,e){if(!this.cacheNodeMap.has(t)){var r=this.list.add(t);this.cacheNodeMap.set(t,r),e&&e(t)}},n.prototype.unloadTile=function(t,e){var r=this.cacheNodeMap.get(t);r&&(this.list.remove(r),this.cacheNodeMap.delete(t),e&&e(t))},n.prototype.unloadTiles=function(t,e){for(var r=this.list.head;r!==this.sentinel&&t();){var i=r.item;r=r.next,this.unloadTile(i,e)}},n.prototype.toArray=function(){for(var t=[],e=0,r=this.list.toArray();e<r.length;e++){var i=r[e];i.item!=="sentinel"&&t.push(i.item)}return t},n}(),yn=function(){function n(){this.map=new Map,this.array=[],this._length=0}return Object.defineProperty(n.prototype,"length",{get:function(){return this._length},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return this.array[t]},n.prototype.set=function(t,e){t>=this.length&&(this._length=t+1),this.map.has(this.array[t])&&this.map.delete(this.array[t]),this.array[t]=e,this.map.set(e,t)},n.prototype.delete=function(t){var e=this.map.get(t);e!==void 0&&e>=0&&(this.array.splice(e,1),this.map.delete(t),this._length--)},n.prototype.push=function(t){if(!this.map.has(t)){var e=this._length++;this.array[e]=t,this.map.set(t,e)}},n.prototype.pop=function(){var t=this.array[--this._length];return this.map.delete(t),this.array[this._length]=void 0,t},n.prototype.reset=function(){this.array=[],this.map=new Map,this._length=0},n.prototype.find=function(t){return this.map.has(t)},n.prototype.peek=function(){return this.array[this._length-1]},n}(),S0=function(){function n(t){this.tileset=t,this._canSelectTile=!0,this.root=null}return n.prototype.traverse=function(t,e,r){this.root=t,this.reset()},n.prototype.reset=function(){this.tileset.hasMixedContent=!1,this.tileset.needsRefinedTiles.clear(),this.tileset.requestedTiles.length=0,this.tileset.selectedTiles.length=0},n.prototype.updateTile=function(t,e){this.updateTileVisibility(t,e),t.state.shouldSelect=!1,t.state.finalResolution=!0},n.prototype.selectTile=function(t,e){var r=t.contentAvailable&&this._canSelectTile;r&&(t.state.selectedFrameNumber=e.frameNumber,this.tileset.selectedTiles.push(t),this.tileset.needsRefinedTiles.add(t))},n.prototype.loadTile=function(t,e){t.hasUnloadedContent&&(t.state.requestedFrameNumber=e.frameNumber,this.tileset.requestedTiles.push(t)),t.hasRenderContent&&this.tileset.needsRefinedTiles.add(t)},n.prototype.touchTile=function(t,e){this.tileset.cache.touch(t),t.state.touchedFrameNumber=e.frameNumber},n.prototype.canTraverse=function(t,e,r){return t.hasEmptyContent||t.hasTilesetContent||t.levelOfContent<=e.minLevelOfDetail?!0:!r&&!t.state.visible?!1:t.state.screenSpaceError>this.tileset.maxScreenSpaceError},n.prototype.updateTileVisibility=function(t,e){if(t.updateState(e),!(!t.state.visible||!t.state.inRequestVolume)){var r=t.children.length>0;if(t.hasTilesetContent&&r){var i=t.children[0];this.updateTileVisibility(i,e),t.state.visible=i.state.visible;return}if(this.meetsScreenSpaceErrorEarly(t,e)){t.state.visible=!1;return}var a=t.refine==="REPLACE";if(a&&r&&t.levelOfContent>e.minLevelOfDetail&&!this.anyChildrenVisible(t,e)){t.state.visible=!1;return}}},n.prototype.anyChildrenVisible=function(t,e){for(var r=!1,i=t.children,a=0,o=i;a<o.length;a++){var s=o[a];s.updateState(e),r=r||s.state.visible}return r},n.prototype.meetsScreenSpaceErrorEarly=function(t,e){var r=t.parent;return!r||r.refine!=="ADD"||r.levelOfContent<=e.minLevelOfDetail?!1:t.getScreenSpaceError(e,t.state.distanceToCamera,!0)<this.tileset.maxScreenSpaceError},n.prototype.sortTilesByDistanceToCamera=function(t){t.sort(function(e,r){return r.state.distanceToCamera===0&&e.state.distanceToCamera===0?r.state.centerZDepth-e.state.centerZDepth:r.state.distanceToCamera-e.state.distanceToCamera})},n}(),nd=function(n){ue(t,n);function t(e){var r=n.call(this,e)||this;return r.tileset=e,r._traversalStack=new yn,r._emptyTraversalStack=new yn,r}return t.prototype.traverse=function(e,r,i){i===void 0&&(i=[]),n.prototype.traverse.call(this,e,r,i);for(var a=0,o=i;a<o.length;a++){var s=o[a];this._traversalStack.reset(),this._emptyTraversalStack.reset(),s.camera.refine&&(this._canSelectTile=s.camera.visible,this.updateTile(e,s),this.executeTraversal(e,s))}this._traversalStack.reset(),this._emptyTraversalStack.reset(),r.camera.refine&&(this._canSelectTile=r.camera.visible,this.updateTile(e,r),this.executeTraversal(e,r))},t.prototype.reset=function(){n.prototype.reset.call(this),this._traversalStack.reset(),this._emptyTraversalStack.reset()},t.prototype.executeTraversal=function(e,r){var i=this._traversalStack;if(r.maxLevelOfDetail>=0)for(e.state.visible&&e.state.inRequestVolume&&i.push(e);i.length>0;){var a=i.pop(),o=a.parent,s=!o||o.state.shouldRefine,l=!1;this.canTraverse(a,r,!1)&&(l=this.updateAndPushChildren(a,r,i)&&s);var u=!l&&s;a.hasRenderContent?a.refine==="ADD"?(this.loadTile(a,r),this.selectDesiredTile(a,r)):a.refine==="REPLACE"&&(this.loadTile(a,r),u&&this.selectDesiredTile(a,r)):(this.loadTile(a,r),u&&this.selectDesiredTile(a,r)),this.touchTile(a,r),a.state.shouldRefine=l}},t.prototype.updateAndPushChildren=function(e,r,i){for(var a=e.children,o=0,s=a;o<s.length;o++){var l=s[o];this.updateTile(l,r)}this.sortTilesByDistanceToCamera(a);for(var u=e.refine==="REPLACE"&&e.hasRenderContent,d=!1,f=!0,A=0,m=a;A<m.length;A++){var l=m[A];if(l.state.visible&&l.state.inRequestVolume?(i.find(l)&&i.delete(l),i.push(l),d=!0):(u||this.tileset.loadSiblings)&&(this.loadTile(l,r),this.touchTile(l,r)),u){var h=void 0;l.state.inRequestVolume?l.hasRenderContent?h=l.contentAvailable:h=this.executeEmptyTraversal(l,r):h=!1,f=f&&h}}return d||(f=!1),f},t.prototype.selectDesiredTile=function(e,r){e.contentAvailable&&n.prototype.selectTile.call(this,e,r)},t.prototype.executeEmptyTraversal=function(e,r){var i=!0,a=this._emptyTraversalStack;for(a.push(e);a.length>0&&i;){var o=a.pop(),s=!o.hasRenderContent&&this.canTraverse(o,r,!0);if(!s&&!o.contentAvailable&&(i=!1),this.updateTile(o,r),o.state.visible||(this.loadTile(o,r),this.touchTile(o,r)),s)for(var l=o.children,u=0,d=l;u<d.length;u++){var f=d[u];a.find(f)&&a.delete(f),a.push(f)}}return i},t}(S0),id=function(n){ue(t,n);function t(e){var r=n.call(this,e)||this;return r.tileset=e,r.baseScreenSpaceError=1024,r.skipScreenSpaceErrorFactor=16,r.skipLevels=1,r._traversalStack=new yn,r._descendantTraversalStack=new yn,r._selectionTraversalStack=new yn,r._selectionTraversalancestorStack=new yn,r}return t.prototype.traverse=function(e,r,i){i===void 0&&(i=[]),n.prototype.traverse.call(this,e,r,i);for(var a=0,o=i;a<o.length;a++){var s=o[a];this._traversalStack.reset(),s.camera.refine&&(this._canSelectTile=s.camera.visible,this.updateTile(e,s),this.executeTraversal(e,s),this.traverseAndSelect(e,s))}this.tileset.hasMixedContent=!1,this._traversalStack.reset(),this._descendantTraversalStack.reset(),this._selectionTraversalStack.reset(),this._selectionTraversalancestorStack.reset(),r.camera.refine&&(this._canSelectTile=r.camera.visible,this.updateTile(e,r),this.executeTraversal(e,r),this.traverseAndSelect(e,r))},t.prototype.reset=function(){n.prototype.reset.call(this),this._traversalStack.reset(),this._descendantTraversalStack.reset(),this._selectionTraversalStack.reset(),this._selectionTraversalancestorStack.reset()},t.prototype.executeTraversal=function(e,r){var i=this._traversalStack;if(r.maxLevelOfDetail>=0)for(e.state.visible&&e.state.inRequestVolume&&i.push(e);i.length>0;){var a=i.pop();this.updateTileAncestorContentLinks(a,r);var o=a.parent,s=!o||o.state.shouldRefine,l=!1;this.canTraverse(a,r,!1)&&(l=this.updateAndPushChildren(a,r,i)&&s);var u=!l&&s;a.hasRenderContent?a.refine==="ADD"?(this.loadTile(a,r),this.selectDesiredTile(a,r)):a.refine==="REPLACE"&&(this.inBaseTraversal(a,this.baseScreenSpaceError)?(this.loadTile(a,r),u&&this.selectDesiredTile(a,r)):u?(this.loadTile(a,r),this.selectDesiredTile(a,r)):this.reachedSkippingThreshold(a)&&this.loadTile(a,r)):(this.loadTile(a,r),u&&this.selectDesiredTile(a,r)),this.touchTile(a,r),a.state.shouldRefine=l}},t.prototype.updateAndPushChildren=function(e,r,i){for(var a=e.children,o=0,s=a;o<s.length;o++){var l=s[o];this.updateTile(l,r)}this.sortTilesByDistanceToCamera(a);for(var u=!1,d=0,f=a;d<f.length;d++){var l=f[d];l.state.visible&&l.state.inRequestVolume?(i.push(l),u=!0):this.tileset.loadSiblings&&(this.loadTile(l,r),this.touchTile(l,r))}return u},t.prototype.selectDesiredTile=function(e,r){var i=e.contentAvailable?e:e.state.ancestorWithContentAvailable;i&&(i.state.shouldSelect=!0),e.contentAvailable||this.selectDescendants(e,r)},t.prototype.selectDescendants=function(e,r){var i=this._descendantTraversalStack;for(i.push(e);i.length>0;)for(var a=i.pop(),o=a.children,s=0,l=o;s<l.length;s++){var u=l[s];u.state.visible&&(u.contentAvailable?(this.updateTile(u,r),this.touchTile(u,r),this.selectTile(u,r)):i.push(u))}},t.prototype.reachedSkippingThreshold=function(e){var r=e.state.ancestorWithContent,i=r!==null&&e.state.screenSpaceError<r.state.screenSpaceError/this.skipScreenSpaceErrorFactor&&e.levelOfContent>r.levelOfContent+this.skipLevels;return i},t.prototype.updateTileAncestorContentLinks=function(e,r){e.state.ancestorWithContent=null,e.state.ancestorWithContentAvailable=null;var i=e.parent;if(i){var a=!(i.hasRenderContent&&i.hasUnloadedContent)||i.state.requestedFrameNumber===r.frameNumber;e.state.ancestorWithContent=a?i:i.state.ancestorWithContent,e.state.ancestorWithContentAvailable=i.contentAvailable?i:i.state.ancestorWithContentAvailable}},t.prototype.inBaseTraversal=function(e,r){return e.state.ancestorWithContent?e.parent&&e.state.screenSpaceError===0?e.parent.state.screenSpaceError>r:e.state.screenSpaceError>r:!0},t.prototype.traverseAndSelect=function(e,r){var i=this._selectionTraversalStack,a=this._selectionTraversalancestorStack,o;for(i.push(e);i.length>0||a.length>0;){if(a.length>0){var s=a.peek();if(s.state.stackLength===i.length){a.pop(),s!==o&&(s.state.finalResolution=!1),this.selectTile(s,r);continue}}var l=i.pop();if(l){var u=this.canTraverse(l,r,!1);if(l.state.shouldSelect)if(l.refine==="ADD")this.selectTile(l,r);else{if(l.state.selectionDepth=a.length,l.state.selectionDepth>0&&(l.tileset.hasMixedContent=!0),o=l,!u){this.selectTile(l,r);continue}a.push(l),l.state.stackLength=i.length}if(u)for(var d=0,f=l.children;d<f.length;d++){var A=f[d];A.state.visible&&i.push(A)}}}},t}(S0),ad=new c.Matrix4,mn=function(){function n(t,e,r){var i,a,o,s;this.id=t,this.transform=new c.Matrix4,this.transformIsIdentity=!0,this.hasMixedContent=!1,this.referer=(i=r.referer)!==null&&i!==void 0?i:"",this.asset={version:e.asset.version,tilesetVersion:e.asset.tilesetVersion||"",gltfUpAxis:(a=e.asset.gltfUpAxis)!==null&&a!==void 0?a:"Y",overview:e.asset.overview},this.rootMeta=(o=e.rootMeta)!==null&&o!==void 0?o:{},this.properties=(s=e.properties)!==null&&s!==void 0?s:{},this.options=r,this.maxMemoryUsage=n.DEFAULT_MAX_MEMORY_USAGE,this.maxScreenSpaceError=n.DEFAULT_MAX_SCREEN_SPACE_ERROR,this.skipLevelOfDetail=n.DEFAULT_SKIP_LEVEL_OF_DETAIL,this.loadSiblings=n.DEFAULT_LOAD_SIBLINGS,this.maxRequests=n.DEFAULT_MAX_REQUESTS,this.requestedTiles=[],this.selectedTiles=[],this.needsRefinedTiles=new Set,this.cache=new M0,this.normalTraverser=new nd(this),this.skipTraverser=new id(this),this.requestScheduler=new C0(this),this.frameNumber=0,this.pendingCount=0,this.loadedTiles=new Set,this.memoryUsageInBytes=0,this.root=new eo("".concat(this.id,".0"),e.root,this),this.geometricError=e.geometricError}return Object.defineProperty(n.prototype,"traverser",{get:function(){return this.skipLevelOfDetail?this.skipTraverser:this.normalTraverser},enumerable:!1,configurable:!0}),n.prototype.reset=function(){for(var t=this,e=[this.root],r;r=e.pop();){for(var i=0,a=r.children.length;i<a;i++)e.push(r.children[i]);this.cache.unloadTile(r,function(o){return t.unloadTile(o)})}this.cache.reset(),this.traverser.reset(),this.requestScheduler.reset(),this.loadedTiles.clear()},n.prototype.isLoaded=function(){return this.pendingCount===0&&this.frameNumber!==0},n.prototype.traverse=function(t,e){var r=this;e===void 0&&(e=[]),this.transformIsIdentity=this.transform.equals(ad),this.traverser.traverse(this.root,t,e),this.requestedTiles.forEach(function(i){i.hasUnloadedContent&&r.loadTile(i)}),this.cache.unloadTiles(function(){var i=r.memoryUsageInBytes>r.maxMemoryUsage*1024*1024;return i},function(i){r.unloadTile(i),r.loadedTiles.delete(i)})},n.prototype.loadTile=function(t){var e=this;this.pendingCount++,t.loadContent().catch(function(r){return e.options.onTileError(t,r),!1}).then(function(r){var i;e.pendingCount--,r&&(!((i=t.content)===null||i===void 0)&&i.data&&(e.loadedTiles.add(t),e.cache.add(t,function(){e.memoryUsageInBytes+=t.contentByteLength})),e.options.onTileLoad(t))})},n.prototype.unloadTile=function(t){this.memoryUsageInBytes-=t.contentByteLength,this.options.onTileUnload(t),t.unloadContent()},n.DEFAULT_MAX_MEMORY_USAGE=16,n.DEFAULT_MAX_SCREEN_SPACE_ERROR=4,n.DEFAULT_SKIP_LEVEL_OF_DETAIL=!1,n.DEFAULT_LOAD_SIBLINGS=!1,n.DEFAULT_MAX_REQUESTS=6,n}();function xt(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=[];n=n.map(function(s){return(s!=null?s:"").trim()}).filter(function(s){return s.length>0&&!/^\/+$/.test(s)});for(var r=0;r<n.length;r++){var i=r===0,a=r===n.length-1,o=n[r];i||(o=o.replace(/^\.\//,"").replace(/^\/+/,"")),a||(o=o.replace(/\/+$/,"")),e.push(o)}return e.join("/")}function Pa(n){var t,e=/^(http\:|https\:|file\:)?\/\/[^/]/.exec(n);if(!e)return n;var r=e[1]||"",i=n.slice(r.length+2),a=i.indexOf("#");a>=0&&(n.slice(a),i=n.slice(0,a));var o=i.indexOf("?");o>=0&&(n.slice(o),i=n.slice(0,o));for(var s=i.split("/"),l=s.shift(),u=(t=s.pop())!==null&&t!==void 0?t:"",d=[],f=0,A=s;f<A.length;f++){var m=A[f];if(!(m===""||m===".")){if(m===".."){d.pop();continue}d.push(m)}}return r+"//"+l+"/"+d.join("/")+"/"+u}function Er(n){return n.indexOf("//")===0||/^[0-9a-z]+\:/i.test(n)}function I0(n,t){if(n.content&&n.content.uri&&(Er(n.content.uri)||(n.content.uri=Pa(xt(t,n.content.uri)))),n.children)for(var e=0,r=n.children;e<r.length;e++){var i=r[e];I0(i,t)}return n}function T0(n,t){return n.asset||(n.asset={}),n.rootMeta||(n.rootMeta={}),n.asset.overview&&(Er(n.asset.overview.imageFile)||(n.asset.overview.imageFile=Pa(xt(t,n.asset.overview.imageFile))),Er(n.asset.overview.worldFile)||(n.asset.overview.worldFile=Pa(xt(t,n.asset.overview.worldFile)))),I0(n.root,t),n}var P0=function(){function n(t,e){this.position=t,this.indices=e}return n.prototype.getPositionCount=function(){var t,e,r=this.indices,i=this.position;return r?r.array.length/((t=r.stride)!==null&&t!==void 0?t:1):i.array.length/((e=i.stride)!==null&&e!==void 0?e:3)},n.prototype.getPositionByIndex=function(t,e){var r,i,a,o,s=this.indices,l=this.position,u=t;if(s){var d=s.array,f=(r=s.stride)!==null&&r!==void 0?r:1,A=(i=s.offset)!==null&&i!==void 0?i:0;u=d[t*f+A]}var m=l.array,h=(a=l.stride)!==null&&a!==void 0?a:3,v=(o=l.offset)!==null&&o!==void 0?o:0;return u=u*h+v,e.x=m[u],e.y=m[u+1],e.z=m[u+2],e},n.prototype.createTree=function(t,e,r){throw new Error("not implemented")},n.prototype.trianglesInSphere=function(t,e){throw new Error("not implemented")},n.prototype.intersectRay=function(t,e,r,i){throw new Error("not implemented")},n}(),wn=function(){function n(t,e,r,i,a){this.id=t,this.extents=e,this.startIndex=r,this.endIndex=i,this.deepth=a}return n}(),br=6*4+4+4+2+2;function B0(n,t){for(var e=new ArrayBuffer(t*br),r=new Float32Array(e),i=new Uint32Array(e),a=new Uint16Array(e),o=[n],s,l;s=o.pop();)l=s.id*br/4,r[l]=s.extents[0],r[l+1]=s.extents[1],r[l+2]=s.extents[2],r[l+3]=s.extents[3],r[l+4]=s.extents[4],r[l+5]=s.extents[5],i[l+6]=s.startIndex,i[l+7]=s.endIndex,l=s.id*br/2,s.node0&&(a[l+16]=s.node0.id,o.push(s.node0)),s.node1&&(a[l+17]=s.node1.id,o.push(s.node1));return e}function R0(n,t,e,r,i,a,o,s,l){l===void 0&&(l=0),e=e-l,r=r-l,i=i-l,a=a+l,o=o+l,s=s+l;var u=0,d=0,f=0,A=0,m=0,h=0;return t.x>=0?(u=(e-n.x)*t.x,d=(a-n.x)*t.x):(u=(a-n.x)*t.x,d=(e-n.x)*t.x),t.y>=0?(f=(r-n.y)*t.y,A=(o-n.y)*t.y):(f=(o-n.y)*t.y,A=(r-n.y)*t.y),!(u>A||f>d||(f>u&&(u=f),A<d&&(d=A),t.z>=0?(m=(i-n.z)*t.z,h=(s-n.z)*t.z):(m=(s-n.z)*t.z,h=(i-n.z)*t.z),u>h||m>d)||(m>u&&(u=m),h<d&&(d=h),d<0))}var an=function(){function n(t,e,r){this.x=t,this.y=e,this.z=r}return n.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},n.prototype.set=function(t,e,r){return this.x=t,this.y=e,this.z=r,this},n.prototype.fromArray=function(t,e){return e===void 0&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},n.prototype.toArray=function(t,e){return t===void 0&&(t=[]),e===void 0&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},n.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this},n.prototype.multiplyScalar=function(t){return this.x*=t,this.y*=t,this.z*=t,this},n.prototype.subVectors=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},n.prototype.addScaledVector=function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},n.prototype.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z},n.prototype.cross=function(t){var e=this.x,r=this.y,i=this.z;return this.x=r*t.z-i*t.y,this.y=i*t.x-e*t.z,this.z=e*t.y-r*t.x,this},n.prototype.crossVectors=function(t,e){var r=t.x,i=t.y,a=t.z,o=e.x,s=e.y,l=e.z;return this.x=i*l-a*s,this.y=a*o-r*l,this.z=r*s-i*o,this},n.prototype.distanceTo=function(t){return Math.sqrt(this.distanceToSquared(t))},n.prototype.distanceToSquared=function(t){var e=this.x-t.x,r=this.y-t.y,i=this.z-t.z;return e*e+r*r+i*i},n.prototype.clone=function(){return new n(this.x,this.y,this.z)},n}(),k0=function(){function n(t,e,r){this.triangle=t,this.intersectionPoint=e,this.index=r}return n}(),Ho=1e-6,He=new an(0,0,0),Fr=new an(0,0,0),Lr=new an(0,0,0),Or=new an(0,0,0),od=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.createTree=function(e,r,i){r=Math.min(r,16);var a=this.getPositionCount()/3,o=a>65535?new Uint32Array(a):new Uint16Array(a),s=new Float32Array(a*6),l=[],u=0,d=-1;if(i)for(var f=0,A=0,m=0,h=void 0,v=void 0,y=void 0,p=void 0,g=void 0,x=void 0,b=void 0;f<a;f+=1,A+=3,m+=6)o[f]=f,this.getPositionByIndex(A,Fr),this.getPositionByIndex(A+1,Lr),this.getPositionByIndex(A+2,Or),h=p=Fr.x,b=Lr.x,b<h&&(h=b),b>p&&(p=b),b=Or.x,b<h&&(h=b),b>p&&(p=b),v=g=Fr.y,b=Lr.y,b<v&&(v=b),b>g&&(g=b),b=Or.y,b<v&&(v=b),b>g&&(g=b),y=x=Fr.z,b=Lr.z,b<y&&(y=b),b>x&&(x=b),b=Or.z,b<y&&(y=b),b>x&&(x=b),s[m]=h,s[m+1]=v,s[m+2]=y,s[m+3]=p,s[m+4]=g,s[m+5]=x;else{for(var w=1/0,E=1/0,M=1/0,C=-1/0,P=-1/0,S=-1/0,f=0,A=0,m=0,h=void 0,v=void 0,y=void 0,p=void 0,g=void 0,x=void 0,b=void 0;f<a;f+=1,A+=3,m+=6)o[f]=f,this.getPositionByIndex(A,Fr),this.getPositionByIndex(A+1,Lr),this.getPositionByIndex(A+2,Or),h=p=Fr.x,b=Lr.x,b<h&&(h=b),b>p&&(p=b),b=Or.x,b<h&&(h=b),b>p&&(p=b),v=g=Fr.y,b=Lr.y,b<v&&(v=b),b>g&&(g=b),b=Or.y,b<v&&(v=b),b>g&&(g=b),y=x=Fr.z,b=Lr.z,b<y&&(y=b),b>x&&(x=b),b=Or.z,b<y&&(y=b),b>x&&(x=b),s[m]=h,s[m+1]=v,s[m+2]=y,s[m+3]=p,s[m+4]=g,s[m+5]=x,h<w&&(w=h),p>C&&(C=p),v<E&&(E=v),g>P&&(P=g),y<M&&(M=y),x>S&&(S=x);i=[w,E,M,C,P,S]}var T=new wn(++d,i,0,a,0);l[u++]=T;var B=[],L=[0,1,2],k=function(D,N){return B[N]-B[D]};function O(D){var N=D.startIndex,X=D.endIndex,K=D.extents;B[0]=K[3]-K[0],B[1]=K[4]-K[1],B[2]=K[5]-K[2],L.sort(k);for(var Q=0;Q<3;Q++){for(var G=L[Q],J=K[G]+K[G+3],H=N,j=X-1,Z=-1,Y=void 0;H<=j;)Z===-1?(Y=o[H],s[Y*6+G]+s[Y*6+G+3]<J?H++:Z=Y):(Y=o[j],s[Y*6+G]+s[Y*6+G+3]>=J||(o[H]=Y,o[j]=Z,Z=-1,H++),j--);if(H>N&&H<X){var pe=new wn(++d,Go(o,s,N,H,Ho),N,H,D.deepth+1);pe.deepth<r&&pe.endIndex-pe.startIndex>e&&(l[u++]=pe);var ee=new wn(++d,Go(o,s,H,X,Ho),H,X,D.deepth+1);ee.deepth<r&&ee.endIndex-ee.startIndex>e&&(l[u++]=ee),D.node0=pe,D.node1=ee,D.startIndex=0,D.endIndex=0;break}}}for(;u;)O(l[--u]);return this.offsetArray=o,this.rootNodePacked=B0(T,d+1),l.length=0,this},t.prototype.trianglesInSphere=function(e,r){for(var i=this.offsetArray,a=this.rootNodePacked,o=new Float32Array(a),s=new Uint32Array(a),l=new Uint16Array(a),u=[0],d=[],f,A,m,h;(f=u.pop())!==void 0;){h=f*br/4;var v=Zi(e.x,o[h],o[h+3])-e.x,y=Zi(e.y,o[h+1],o[h+4])-e.y,p=Zi(e.z,o[h+2],o[h+5])-e.z;if(v*v+y*y+p*p<=r*r){for(var g=s[h+6];g<s[h+7];g++)d.push(i[g]);h=f*br/2,A=l[h+16],m=l[h+17],A&&u.push(A),m&&u.push(m)}}for(var x=d.length,b=new Float32Array(x*9),g=0;g<x;g++){var w=d[g];this.getPositionByIndex(w,He),b[g*9]=He.x,b[g*9+1]=He.y,b[g*9+2]=He.z,this.getPositionByIndex(w+1,He),b[g*9+3]=He.x,b[g*9+4]=He.y,b[g*9+5]=He.z,this.getPositionByIndex(w+2,He),b[g*9+6]=He.x,b[g*9+7]=He.y,b[g*9+8]=He.z}return b},t.prototype.intersectRay=function(e,r,i,a){for(var o=this.offsetArray,s=this.rootNodePacked,l=new Float32Array(s),u=new Uint32Array(s),d=new Uint16Array(s),f=new an(1/r.x,1/r.y,1/r.z),A=[0],m,h,v,y;(m=A.pop())!==void 0;)if(y=m*br/4,R0(e,f,l[y],l[y+1],l[y+2],l[y+3],l[y+4],l[y+5])){for(var p=u[y+6],g=u[y+7],x=void 0,b=void 0,w=void 0,E=e.x,M=e.y,C=e.z,P=r.x,S=r.y,T=r.z,B=void 0,L=void 0,k=void 0,O=void 0,D=void 0,N=void 0,X=void 0,K=void 0,Q=void 0,G=void 0,J=void 0,H=void 0,j=void 0,Z=void 0,Y=void 0,pe=void 0,ee=void 0,oe=void 0,ie=void 0,ce=void 0,ne=void 0,ae=void 0,de=void 0,ve=void 0,xe=void 0,Ce=void 0,Be=void 0;p<g;p++){if(x=o[p],b=x*3,this.getPositionByIndex(b,He),B=He.x,L=He.y,k=He.z,this.getPositionByIndex(b+1,He),O=He.x,D=He.y,N=He.z,this.getPositionByIndex(b+2,He),X=He.x,K=He.y,Q=He.z,G=O-B,J=D-L,H=N-k,j=X-B,Z=K-L,Y=Q-k,pe=J*Y-H*Z,ee=H*j-G*Y,oe=G*Z-J*j,de=P*pe+S*ee+T*oe,de>0)ae=1;else if(de<0)ae=-1,de=-de;else continue;ie=E-B,ce=M-L,ne=C-k,ve=ae*(P*(ce*Y-ne*Z)+S*(ne*j-ie*Y)+T*(ie*Z-ce*j)),!(ve<0)&&(xe=ae*(P*(J*ne-H*ce)+S*(H*ie-G*ne)+T*(G*ce-J*ie)),!(xe<0)&&(ve+xe>de||(Ce=-ae*(ie*pe+ce*ee+ne*oe),!(Ce<0)&&(Be=Ce/de,a.push(new k0([B,L,k,O,D,N,X,K,Q],[E+P*Be,M+S*Be,C+T*Be],x))))))}y=m*br/2,h=d[y+16],v=d[y+17],h&&A.push(h),v&&A.push(v)}return a},t}(P0);function Zi(n,t,e){return n<t?t:n>e?e:n}function Go(n,t,e,r,i){if(e>=r)return[0,0,0,0,0,0];for(var a=1/0,o=1/0,s=1/0,l=-1/0,u=-1/0,d=-1/0,f=e,A=void 0,m=void 0;f<r;f++)A=n[f]*6,m=t[A],m<a&&(a=m),m=t[A+1],m<o&&(o=m),m=t[A+2],m<s&&(s=m),m=t[A+3],m>l&&(l=m),m=t[A+4],m>u&&(u=m),m=t[A+5],m>d&&(d=m);return[a-i,o-i,s-i,l+i,u+i,d+i]}var Ko=1e-6,sd=["x","y","z"],st=new an(0,0,0),ud=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.createTree=function(e,r,i){r=Math.min(r,16);var a=this.getPositionByIndex.bind(this),o=this.getPositionCount(),s=o>65535?new Uint32Array(o):new Uint16Array(o),l=[],u=0,d=-1;if(i)for(var f=0;f<o;f+=1)s[f]=f;else{a(0,st);for(var A=st.x,m=st.y,h=st.z,v=A,y=m,p=h,f=0,g=void 0,x=void 0,b=void 0;f<o;f+=1)s[f]=f,a(f,st),g=st.x,x=st.y,b=st.z,g<A?A=g:g>v&&(v=g),x<m?m=x:x>y&&(y=x),b<h?h=b:b>p&&(p=b);i=[A,m,h,v,y,p]}var w=new wn(++d,i,0,o,0);l[u++]=w;var E=[],M=[0,1,2],C=function(S,T){return E[T]-E[S]};function P(S){var T=S.startIndex,B=S.endIndex,L=S.extents;E[0]=L[3]-L[0],E[1]=L[4]-L[1],E[2]=L[5]-L[2];for(var k=M.sort(C)[0],O=sd[k],D=(L[k]+L[k+3])/2,N=T,X=B-1,K=-1,Q;N<=X;)K===-1?(Q=s[N],a(Q,st),st[O]<D?N++:K=Q):(Q=s[X],a(Q,st),st[O]>=D||(s[N]=Q,s[X]=K,K=-1,N++),X--);if(N>T){var G=L.slice();G[k+3]=D+Ko;var J=new wn(++d,G,T,N,S.deepth+1);J.deepth<r&&J.endIndex-J.startIndex>e&&(l[u++]=J),S.node0=J}if(B>N){var H=L.slice();H[k]=D-Ko;var j=new wn(++d,H,N,B,S.deepth+1);j.deepth<r&&j.endIndex-j.startIndex>e&&(l[u++]=j),S.node1=j}S.startIndex=0,S.endIndex=0}for(;u;)P(l[--u]);return this.offsetArray=s,this.rootNodePacked=B0(w,d+1),l.length=0,this},t.prototype.intersectRay=function(e,r,i,a){for(var o=this.offsetArray,s=this.rootNodePacked,l=new Float32Array(s),u=new Uint32Array(s),d=new Uint16Array(s),f=i*i,A=new an(1/r.x,1/r.y,1/r.z),m=[0],h,v,y,p;(h=m.pop())!==void 0;)if(p=h*br/4,R0(e,A,l[p],l[p+1],l[p+2],l[p+3],l[p+4],l[p+5],i)){for(var g=u[p+6],x=u[p+7],b=void 0,w=void 0,E=void 0,M=void 0,C=void 0,P=void 0,S=void 0,T=void 0,B=void 0,L=void 0,k=void 0,O=void 0;g<x;g++)b=o[g],this.getPositionByIndex(b,st),w=st.x,E=st.y,M=st.z,C=e.x,P=e.y,S=e.z,T=r.x,B=r.y,L=r.z,k=T*(w-C)+B*(E-P)+L*(M-S),k>0&&(C+=T*k,P+=B*k,S+=L*k),T=w-C,B=E-P,L=M-S,k=T*T+B*B+L*L,k<=f&&a.push(new k0([w,E,M,w,E,M,w,E,M],[C,P,S],b));p=h*br/2,v=d[p+16],y=d[p+17],v&&m.push(v),y&&m.push(y)}return a},t}(P0);const F0="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3ZhciBlcj1mdW5jdGlvbihlLHIpe3JldHVybiBlcj1PYmplY3Quc2V0UHJvdG90eXBlT2Z8fHtfX3Byb3RvX186W119aW5zdGFuY2VvZiBBcnJheSYmZnVuY3Rpb24odCxvKXt0Ll9fcHJvdG9fXz1vfXx8ZnVuY3Rpb24odCxvKXtmb3IodmFyIGYgaW4gbylPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwobyxmKSYmKHRbZl09b1tmXSl9LGVyKGUscil9O2Z1bmN0aW9uIGhyKGUscil7aWYodHlwZW9mIHIhPSJmdW5jdGlvbiImJnIhPT1udWxsKXRocm93IG5ldyBUeXBlRXJyb3IoIkNsYXNzIGV4dGVuZHMgdmFsdWUgIitTdHJpbmcoc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nVmZmVyIGluc3RhbmNlb2YgQXJyYXlCdWZmZXImJm8uYWRkKHUuYnVmZmVyKSx1PXMub2Zmc2V0QXJyYXksdSYmdS5idWZmZXIgaW5zdGFuY2VvZiBBcnJheUJ1ZmZlciYmby5hZGQodS5idWZmZXIpLG8uYWRkKHMucm9vdE5vZGVQYWNrZWQpfXJldHVybntvdXRwdXQ6dCx0cmFuc2ZlcjpBcnJheS5mcm9tKG8pfX0pfSl9KSgpOwo=",ld=n=>Uint8Array.from(atob(n),t=>t.charCodeAt(0)),jo=typeof self!="undefined"&&self.Blob&&new Blob([ld(F0)],{type:"text/javascript;charset=utf-8"});function cd(n){let t;try{if(t=jo&&(self.URL||self.webkitURL).createObjectURL(jo),!t)throw"";const e=new Worker(t,{name:n==null?void 0:n.name});return e.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),e}catch(e){return new Worker("data:text/javascript;base64,"+F0,{name:n==null?void 0:n.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var L0=function(){function n(t,e){this.pool=e,this.workerCreator=t,this.queue=[],this.workers=[],this.workersResolver=[],this.workerStatus=0}return n.prototype.initWorker=function(t){if(this.workerCreator&&!this.workers[t]){var e=this.workerCreator();e.addEventListener("message",this.onMessage.bind(this,t)),this.workers[t]=e}},n.prototype.getIdleWorker=function(){for(var t=0;t<this.pool;t++)if(!(this.workerStatus&1<<t))return t;return-1},n.prototype.onMessage=function(t,e){var r=this.workersResolver[t],i=r.resolve,a=r.reject;if(e.data&&"$$error"in e.data?a(e.data.$$error):i(e.data),this.queue.length){var o=this.queue.shift(),s=o.resolve,l=o.reject,u=o.input,d=o.transfer;this.workersResolver[t]={resolve:s,reject:l},this.workers[t].postMessage(u,d)}else this.workerStatus^=1<<t},n.prototype.postMessage=function(t,e){var r=this;return e===void 0&&(e=[]),new Promise(function(i,a){var o=r.getIdleWorker();o!==-1?(r.initWorker(o),r.workerStatus|=1<<o,r.workersResolver[o]={resolve:i,reject:a},r.workers[o].postMessage(t,e)):r.queue.push({resolve:i,reject:a,input:t,transfer:e})})},n.prototype.dispose=function(){this.workers.forEach(function(t){return t.terminate()}),this.workersResolver.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0},n}(),dd=new L0(function(){return new cd},4),fi=new Map,Yi=new Map,En=new c.Ray,Jo=new c.Matrix3,Un=new c.Matrix4,O0=new c.Vector3,fd=new c.Vector3,hd=new c.Vector3,pd=new c.Triangle;function vd(n,t,e,r){var i,a=n.matrixWorld;Un.getInverse(a),En.copy(e.ray).applyMatrix4(Un);for(var o=t.intersectRay(En.origin,En.direction,0,[]),s=n.geometry,l=n.material,u=s.groups,d=s.index,f=0,A=o.length;f<A;f++){var m=o[f],h=m.triangle,v=m.index,y=m.intersectionPoint,p=new c.Vector3(y[0],y[1],y[2]).applyMatrix4(a),g=e.ray.origin.distanceTo(p);if(!(g<e.near||g>e.far)){var x=void 0;if(Array.isArray(l)){if(u)for(var b=v*3,w=0,E=u;w<E.length;w++){var M=E[w];if(b>=M.start&&b-M.start<M.count){x=l[(i=M.materialIndex)!==null&&i!==void 0?i:0];break}}}else x=l;if(x){var C=pd.set(O0.set(h[0],h[1],h[2]).applyMatrix4(a),fd.set(h[3],h[4],h[5]).applyMatrix4(a),hd.set(h[6],h[7],h[8]).applyMatrix4(a)).getNormal(new c.Vector3),P=v*3,S=new c.Face3(d?d.array[P]:P,d?d.array[P+1]:P+1,d?d.array[P+2]:P+2,C),T=e.ray.direction.dot(C);x.side===c.FrontSide&&T>=0||x.side===c.BackSide&&T<=0||r.push({distance:g,object:n,face:S,point:p,distanceToRay:0,faceIndex:v})}}}}function Ad(n,t,e,r){var i,a,o=n.matrixWorld;Jo.getNormalMatrix(o),Un.getInverse(o);var s=((a=(i=e.params.Points)===null||i===void 0?void 0:i.threshold)!==null&&a!==void 0?a:1)*Un.getMaxScaleOnAxis();En.copy(e.ray).applyMatrix4(Un);for(var l=t.intersectRay(En.origin,En.direction,s,[]),u=n.geometry,d=u.index,f=u.getAttribute("normal"),A=0,m=l.length;A<m;A++){var h=l[A],v=h.triangle,y=h.index,p=h.intersectionPoint,g=new c.Vector3(p[0],p[1],p[2]).applyMatrix4(o),x=e.ray.origin.distanceTo(g);if(!(x<e.near||x>e.far)){var b=O0.set(v[0],v[1],v[2]).applyMatrix4(o),w=d?d.array[y]:y,E=void 0;f instanceof c.BufferAttribute&&(E=new c.Vector3().fromBufferAttribute(f,w).applyNormalMatrix(Jo));var M=new c.Face3(w,w,w,E);r.push({distance:x,object:n,face:M,point:g,distanceToRay:g.distanceTo(b),index:y})}}}function md(n,t){var e=n.raycast,r=function(i,a){var o=fi.get(this);o?vd(this,o,i,a):e.call(this,i,a)};return n.raycast=r,fi.set(n,t),function(){fi.delete(n),n.raycast===r&&(n.raycast=e)}}function gd(n,t){var e=n.raycast,r=function(i,a){var o=Yi.get(this);o?Ad(this,o,i,a):e.call(this,i,a)};return n.raycast=r,Yi.set(n,t),function(){Yi.delete(n),n.raycast===r&&(n.raycast=e)}}function yd(n,t,e,r){var i=[];return n.traverse(function(a){(a instanceof c.Mesh||a instanceof c.Points)&&a.geometry instanceof c.BufferGeometry&&i.push(a)}),Promise.resolve().then(function(){for(var a=[],o=new Set,s=null,l=0;l<i.length;l++){var u=i[l],d=u.geometry;if(d instanceof c.BufferGeometry){var f=void 0;if(u instanceof c.Mesh?f="mesh":u instanceof c.Points&&(f="points"),!!f){var A=d.boundingBox,m=A?[A.min.x,A.min.y,A.min.z,A.max.x,A.max.y,A.max.z]:void 0,h={};for(var v in d.attributes){var y=d.attributes[v];y instanceof c.InterleavedBufferAttribute?(h[v]={array:y.data.array,stride:y.data.stride,offset:y.offset},s=y.data.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer)):(h[v]={array:y.array},s=y.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer))}var p=void 0,g=d.getIndex();g&&(g instanceof c.InterleavedBufferAttribute?(p={array:g.data.array,stride:g.data.stride,offset:g.offset},s=g.data.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer)):(p={array:g.array},s=g.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer)));var x={type:f,attributes:h,indices:p,maxItemPerNode:e,maxTreeDepth:r,extents:m};a.push(x)}}}return dd.postMessage(a,Array.from(o))}).then(function(a){for(var o=[],s=0;s<i.length;s++){var l=i[s],u=l.geometry,d=a[s];if(u instanceof c.BufferGeometry){for(var f in d.attributes){var A=d.attributes[f].array,m=u.attributes[f];m instanceof c.InterleavedBufferAttribute?m.data.array=A:m.array=A}var h=u.getIndex();if(h&&d.indices){var A=d.indices.array;h instanceof c.InterleavedBufferAttribute?h.data.array=A:h.array=A}if(l instanceof c.Mesh){var v=new od(d.attributes.position,d.indices);v.offsetArray=d.offsetArray,v.rootNodePacked=d.rootNodePacked;var y=md(l,v);o.push(y)}else if(l instanceof c.Points){var v=new ud(d.attributes.position,d.indices);v.offsetArray=d.offsetArray,v.rootNodePacked=d.rootNodePacked;var y=gd(l,v);o.push(y)}}}return function(){for(var p=0,g=o;p<g.length;p++){var x=g[p];x()}o.length=0}})}var bd=new c.Vector3,xd=new c.Vector3,wd=new c.Vector3,V0=function(n){ue(t,n);function t(e,r){var i=n.call(this)||this;return i.obj=e,i.objDisposer=r,i.disposers=[r],i.add(e),i}return t.prototype.generateBvhTree=function(){var e=this;return yd(this,!0,200,10).then(function(r){e.disposers.push(r)})},t.prototype.intersectRaycaster=function(e,r,i){var a=this;r===void 0&&(r=!0),i===void 0&&(i=[]);for(var o=this.children.slice(),s,l=[];s=o.pop();)if(s.visible){s.raycast(e,l);for(var u=0,d=s.children.length;u<d;u++)o.push(s.children[u])}return l.forEach(function(f){var A,m,h=0;if((f.object instanceof Vt||f.object instanceof wr)&&f.face){var v=Array.isArray(f.object.material)?f.object.material[f.face.materialIndex]:f.object.material;if(v)if(v.defines.USE_VERTEX_FLOOR){var y=(A=f.object.geometry.attributes.position)===null||A===void 0?void 0:A.array,p=(m=f.object.geometry.attributes.floor)===null||m===void 0?void 0:m.array;if(y&&p){var g=bd.set(y[f.face.a*3],y[f.face.a*3+1],y[f.face.a*3+2]).applyMatrix4(a.matrixWorld),x=xd.set(y[f.face.b*3],y[f.face.b*3+1],y[f.face.b*3+2]).applyMatrix4(a.matrixWorld),b=wd.set(y[f.face.c*3],y[f.face.c*3+1],y[f.face.c*3+2]).applyMatrix4(a.matrixWorld),w=f.point.distanceTo(g),E=f.point.distanceTo(x),M=f.point.distanceTo(b);h=Math.round((w*p[f.face.a]+E*p[f.face.b]+M*p[f.face.c])/(w+E+M))}}else h=v.floor}f.floor=h}),r&&l.sort(function(f,A){return f.distance-A.distance}),i.push.apply(i,l),i},t.prototype.dispose=function(){for(var e=0,r=this.disposers;e<r.length;e++){var i=r[e];i()}this.disposers.length=0},t.prototype.clone=function(){return new t(this.obj,this.objDisposer)},t}(c.Group);function N0(n,t){if(t===void 0&&(t=""),(t[0]==="?"||t[0]==="&")&&(t=t.slice(1)),!t)return n;var e=n.indexOf("#"),r="";return e>=0&&(r=n.slice(e),n=n.slice(0,e)),(n[n.length-1]==="?"||n[n.length-1]==="&")&&(n=n.slice(0,-1)),n.indexOf("?")>=0?"".concat(n,"&").concat(t).concat(r):"".concat(n,"?").concat(t).concat(r)}const Ed=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6--{vs|z-rp@-p|{n{P|y|H0r{qvs0vs-qrsv{rq5b`Rl]\\V[al[\\_ZNY6--n\bv{t-rp@-[|znyH0r{qvs0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvsp-Pyv}}r-\n--znA-znv\x07V{rrH--sy|n-sy||V{qr\x07H\fH0vs-[bZlPYV]]R_`-K-=--{vs|z-Pyv}}r-pyv}}rh[bZlPYV]]R_`jH0r{qvsn\bv{t-rpA-d|yq]|vv|{Hn\bv{t-sy|n-Sy||Hn\bv{t-rp@-P|y|Hn\bv{t-sy|n-]|v{`v rH{vs|z-sy|n-|}npv\bH{vs|z-sy|n-z|qryNy}unH{vs|z-sy|n-u|{Sy||V{qr\x07H0v{pyqr-Ip|zz|{K0v{pyqr-Is|tl}nlsntzr{K0v{pyqr-Iy|tqr}uosl}nlsntzr{K0v{pyqr-Ipyv}}v{tl}yn{rl}nlsntzr{K|vq-znv{56-\n--<<-JJJ-前置裁切计算-JJJ--0vs-[bZlPYV]]R_`-K-=----o||y-pyv}}rqH----rpA-pyv}}r]|vv|{H----0}ntzn-{|yyly||}ln----s|-5-v{-v-J-=H-v-I-[bZlPYV]]R_`H-v-88-6-\n------pyv}}r]|vv|{-J-pyv}}rh-v-j;znv\x07V{rr-7-d|yq]|vv|{H------pyv}}rq-J-5pyv}}rh-v-j;sy||V{qr\x07-I-=;=-\v\v-no5Sy||-:-pyv}}rh-v-j;sy||V{qr\x076-I->;=6H------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\x07-K-:=;B-33-pyv}}r]|vv|{;\x07-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\b-K-:=;B-33-pyv}}r]|vv|{;\b-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{; -K-:=;B-33-pyv}}r]|vv|{; -I-=;BH------vs-5pyv}}rq6-\n--------qvpnqH------\f----\f----0}ntzn-{|yyly||}lr{q--0r{qvs--<<-JJJJJJJJJJJJJJJJ--<<-JJJ-形状裁切-JJJ--0vs-qrsv{rq5b`Rl]\\V[al`UN]RlPV_PYR6----sy|n--J-?;=-7-tyl]|v{P||q;\x07-:->;=H----sy|n--J-?;=-7-tyl]|v{P||q;\b-:->;=H----sy|n-pp-J-7-8-7H----vs-5]|v{`v r-K-E;=-33-pp-K->;=6-\n------qvpnqH----\f--0r{qvs--<<-JJJJJJJJJJJJJ--0v{pyqr-Iy|tqr}uoslsntzr{K--<<-JJJ-颜色-JJJ--rpA-sv{nyP|y|-J-_TOa|Yv{rn5rpA5P|y|9-|}npv\b66H--0vs-qrsv{rq5b`Rl]\\V[al[\\_ZNY6----0vs-qrsv{rq5b`Rl]\\V[alONPXlUVQQR[6------rp@-pnzrnQvrpv|{-J-{|znyv r5pnzrn]|vv|{-:-d|yq]|vv|{;\x07\b 6H------vs-5q|5pnzrnQvrpv|{9-[|zny6-I-=;=6-\n--------qvpnqH------\f----0ryvs-qrsv{rq5b`Rl]\\V[alONPXlQN_X6------rp@-pnzrnQvrpv|{-J-{|znyv r5pnzrn]|vv|{-:-d|yq]|vv|{;\x07\b 6H------vs-5q|5pnzrnQvrpv|{9-[|zny6-I-=;=6-\n--------sv{nyP|y|;\x07\b -J-sv{nyP|y|;\x07\b -7-=;EH------\f----0r{qvs--0r{qvs--tylSntP|y|-J-sv{nyP|y|H--<<-JJJJJJJJJJJ--<<-JJJ-纯色-JJJ--0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6----tylSntP|y|-J-rpA5p|{n{P|y|;9-p|{n{P|y|;t9-p|{n{P|y|;o9-|}npv\b6H--0r{qvs--<<-JJJJJJJJJJJ--<<-JJJ-楼层显示-JJJ--sy|n-sy||\\}npv\b-J->;=H--vs-5u|{Sy||V{qr\x07-KJ-=;=-33-no5Sy||-:-u|{Sy||V{qr\x076-KJ->;=6-\n----sy||\\}npv\b-J-=;>H--\f--tylSntP|y|;n-J-tylSntP|y|;n-7-sy||\\}npv\bH--<<-JJJJJJJJJJJJJJ--tylSntP|y|;n-J-tylSntP|y|;n-7-z|qryNy}unH--0v{pyqr-I|{rzn}}v{tlsntzr{K--0v{pyqr-Ir{p|qv{tlsntzr{K--0v{pyqr-Is|tlsntzr{K--0v{pyqr-I}rzyv}yvrqlny}unlsntzr{K--0vs-qrsv{rq5b`RlRQY6----tylSntP|y|;n-J-Y|tQr}uH--0r{qvs--0vs-qrsv{rq5b`RlU^ldRVTUa6----sy|n-qvn{pr-J-?;=-7-yr{tu5tyl]|v{P||q;\x07\b-:-=;B6H----sy|n-rvtu-J-zn\x075=;=9->;=-:-qvn{pr6H----rvtu-J-}|5rvtu9->;B6H----tylSntP|y|;n-J-rvtuH----tylSntP|y|;\x07\b -J-tylSntP|y|;\x07\b -7-rvtuH--0r{qvs\f"),Cd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("nvor-rp@-p|y|H0vs-qrsv{rq5b`Rl]\\V[alP\\Y\\_lNYaVabQR6--{vs|z-nz}yr?Q-tnqvr{ar\x07rH0r{qvs0vs-qrsv{rq5b`RlcR_aRelSY\\\\_6--nvor-sy|n-sy||H0ryr--{vs|z-sy|n-sy||H0r{qvsn\bv{t-sy|n-Sy||H0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvs{vs|z-rp?-r|yv|{H{vs|z-sy|n-}v\x07ry_nv|H{vs|z-sy|n-}|v{`pnyrH{vs|z-sy|n-}|v{Zv{]v\x07ryH{vs|z-sy|n-}|v{Zn\x07]v\x07ryH{vs|z-sy|n-|}npv\bH{vs|z-sy|n-tr|zrvpR|H{vs|z-rp@-z|qryO|{qv{tZn\x07H{vs|z-rp@-z|qryO|{qv{tZv{Hn\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-P|y|Hn\bv{t-sy|n-]|v{`v rH0vs-qrsv{rq5b`Rl]\\V[al[\\_ZNY6--n\bv{t-rp@-[|znyH0r{qvs0v{pyqr-Is|tl}nlrr\x07K0v{pyqr-Iz|}untrl}nlrr\x07K0v{pyqr-Iy|tqr}uosl}nlrr\x07K0v{pyqr-Ipyv}}v{tl}yn{rl}nlrr\x07Krp@-trP|y|O\bUrvtu5nz}yr?Q-tnqvr{ar\x07r9-rpA-d|yq]|vv|{6-\n--<<-sy|n--J-5d|yq]|vv|{;\b-:-z|qryO|{qv{tZv{;\b6-<-5z|qryO|{qv{tZn\x07;\b-:-z|qryO|{qv{tZv{;\b6H--sy|n--J-d|yq]|vv|{;\b-<->=;=H--r{-r\x07r?Q5tnqvr{ar\x07r9-rp?59-=;B66;toH\f|vq-znv{56-\n--0v{pyqr-Iortv{lrr\x07K--0v{pyqr-I}|wrplrr\x07K--0v{pyqr-Iy|tqr}uoslrr\x07K--0v{pyqr-Ipyv}}v{tl}yn{rlrr\x07K--Sy||-J-sy||H--d|yq]|vv|{-J-rpA5n{s|zrq9->;=6H--0vsqrs-b`RlV[`aN[PV[T----d|yq]|vv|{-J-v{n{prZnv\x07-7-d|yq]|vv|{H--0r{qvs--d|yq]|vv|{-J-z|qryZnv\x07-7-d|yq]|vv|{H--<<传递nvor的p|y|到s里使用--<<动态调整}|v{`v r--sy|n-rny]|v{`v r-J-}|v{`pnyr-7-}v\x07ry_nv|H--0vs-qrsv{rq5b`Rl]\\V[al`VgRlTR\\ZRa_VP6----rny]|v{`v r-7J-tr|zrvpR|H----sy|n-urvtu-J->;=-<-}|wrpv|{Znv\x07h>jh>j-7-zv\x075>;=9-:z]|vv|{; 9-:}|wrpv|{Znv\x07h?jh@j6-7-?;=H----rny]|v{`v r-J-r|yv|{;\b-7-rny]|v{`v r-<-urvtuH--0ryvs-qrsv{rq5b`Rl]\\V[al`VgRlNaaR[bNaV\\[6----sy|n-urvtu-J->;=-<-}|wrpv|{Znv\x07h>jh>j-7-zv\x075>;=9-:z]|vv|{; 9-:}|wrpv|{Znv\x07h?jh@j6-7-?;=H----rny]|v{`v r-J-r|yv|{;\b-7-rny]|v{`v r-<-urvtuH--0r{qvs--tyl]|v{`v r-J-pynz}5rny]|v{`v r9-}|v{Zv{]v\x07ry-7-}v\x07ry_nv|9-}|v{Zn\x07]v\x07ry-7-}v\x07ry_nv|6H--]|v{`v r-J-tyl]|v{`v rH--0vs-qrsv{rq5b`Rl]\\V[alP\\Y\\_lNYaVabQR6----P|y|-J-trP|y|O\bUrvtu5tnqvr{ar\x07r9-d|yq]|vv|{6H--0ryr----P|y|-J-p|y|H--0r{qvs--0vs-qrsv{rq5b`Rl]\\V[al[\\_ZNY6----[|zny-J-{|znyv r5zn@5z|qryZnv\x076-7-{|zny6H--0r{qvs--0vs-qrsv{rq5b`RlRQY6----Y|tQr}u-J-y|t?5:z]|vv|{; 6H--0r{qvs--0vs-qrsv{rq5b`RlU^lQR]aU6----<<-sy|n-}|wSnp|-J-:=;B-7-r|yv|{;\b-<-5n{5s|-<-?;=6-7-z]|vv|{; 6H----<<-sy|n-_nqv-J-rny]|v{`v r-<-}|wSnp|H----sy|n-|vtv{nyQr}u-J-tyl]|vv|{;H----sy|n-nqwrqQr}u-J-|vtv{nyQr}u-8-=;>H----sy|n-nqw-J-nqwrqQr}u-<-|vtv{nyQr}uH----z]|vv|{;\x07\b -J-z]|vv|{;\x07\b -7-nqwH----tyl]|vv|{-J-}|wrpv|{Znv\x07-7-z]|vv|{H--0r{qvs--0v{pyqr-I|yq}|lrr\x07K--0v{pyqr-Is|tlrr\x07K\f");var Md=new c.Vector4,Sd=Object.assign({pointScale:new c.Uniform(1),pointMinPixel:new c.Uniform(1),pointMaxPixel:new c.Uniform(1),opacity:new c.Uniform(1),gradientTexture:new c.Uniform(null),modelAlpha:new c.Uniform(0),clippers:new c.Uniform([]),shownFloorIndex:new c.Uniform(-1),constantColor:new c.Uniform(null),geometricError:new c.Uniform(0),pixelRatio:new c.Uniform(1),resolution:new c.Uniform(new c.Vector2(512,512)),floor:new c.Uniform(0),brightness:new c.Uniform(1),modelBoundingMin:new c.Uniform(new c.Vector3),modelBoundingMax:new c.Uniform(new c.Vector3)},c.UniformsUtils.clone(c.UniformsLib.fog)),to=function(n){ue(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,l,u,d,f,A,m,h,v,y,p,g,x,b,w,E,M,C=n.call(this,{vertexShader:Cd,fragmentShader:Ed,uniforms:c.UniformsUtils.clone(Sd),lights:!1,defines:{USE_CONSTANT_COLOR:!1,USE_EDL:!1,USE_HQ_WEIGHT:!1,USE_HQ_DEPTH:!1,NUM_CLIPPING_BOX:!1,USE_CLIPFLOOR:!1,USE_VERTEX_FLOOR:!1,USE_MAP:!0,USE_UV:!0,USE_LUMINANCE:!1,USE_PANO_OPACITY:!1,USE_BLACK_TRANSITION:!1,USE_POINT_NORMAL:!1,USE_POINT_SHAPE_CIRCLE:!1,USE_POINT_SIZE_ATTENUATION:!1,USE_POINT_SIZE_GEOMETRIC:!1,USE_POINT_BACK_HIDDEN:!1,USE_POINT_BACK_DARK:!1}})||this,P;return Object.defineProperties(C,{constantColor:{get:function(){return this.uniforms.constantColor.value},set:function(S){this.uniforms.constantColor.value=S;var T=this.defines.USE_CONSTANT_COLOR,B=S!==null;T!==B&&(this.defines.USE_CONSTANT_COLOR=B,this.needsUpdate=!0)}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(S){this.uniforms.opacity.value=S}},modelAlpha:{get:function(){return this.uniforms.modelAlpha.value},set:function(S){this.uniforms.modelAlpha.value=S}},shownFloorIndex:{get:function(){return this.uniforms.shownFloorIndex.value},set:function(S){this.uniforms.shownFloorIndex.value=S}},clippers:{get:function(){return P},set:function(S){P!==S&&(P=S,this.uniforms.clippers.value=(P||[]).map(function(T){var B=typeof T.floorIndex=="number"?T.floorIndex:-1,L=new c.Matrix4().getInverse(T.clippingBoxMatrix);return{matrixInverse:L,floorIndex:B}}),this.needsUpdate=!0)}},pointColor:{get:function(){return this.defines.USE_POINT_COLOR_ALTITUDE===!0?"ALTITUDE":"RGB"},set:function(S){var T=S==="ALTITUDE";this.defines.USE_POINT_COLOR_ALTITUDE!==T&&(this.defines.USE_POINT_COLOR_ALTITUDE=T,this.needsUpdate=!0)}},pointSize:{get:function(){return this.defines.USE_POINT_SIZE_GEOMETRIC===!0?"GEOMETRIC":this.defines.USE_POINT_SIZE_ATTENUATION===!0?"ATTENUATION":"FIXED"},set:function(S){var T=S==="ATTENUATION",B=S==="GEOMETRIC";this.defines.USE_POINT_SIZE_GEOMETRIC!==B&&(this.defines.USE_POINT_SIZE_GEOMETRIC=B,this.needsUpdate=!0),this.defines.USE_POINT_SIZE_ATTENUATION!==T&&(this.defines.USE_POINT_SIZE_ATTENUATION=T,this.needsUpdate=!0)}},pointShape:{get:function(){return this.defines.USE_POINT_SHAPE_CIRCLE===!0?"CIRCLE":"SQUARE"},set:function(S){var T=S==="CIRCLE";this.defines.USE_POINT_SHAPE_CIRCLE!==T&&(this.defines.USE_POINT_SHAPE_CIRCLE=T,this.needsUpdate=!0)}},pointScale:{get:function(){return this.uniforms.pointScale.value},set:function(S){this.uniforms.pointScale.value=S}},pointBack:{get:function(){return this.defines.USE_POINT_BACK_HIDDEN===!0?"HIDDEN":this.defines.USE_POINT_BACK_DARK===!0?"DARK":"VISIBLE"},set:function(S){var T=S==="HIDDEN",B=S==="DARK";this.defines.USE_POINT_BACK_HIDDEN!==T&&(this.defines.USE_POINT_BACK_HIDDEN=T,this.needsUpdate=!0),this.defines.USE_POINT_BACK_DARK!==B&&(this.defines.USE_POINT_BACK_DARK=B,this.needsUpdate=!0)}},pointMinPixel:{get:function(){return this.uniforms.pointMinPixel.value},set:function(S){this.uniforms.pointMinPixel.value=S}},pointMaxPixel:{get:function(){return this.uniforms.pointMaxPixel.value},set:function(S){this.uniforms.pointMaxPixel.value=S}},useEDL:{get:function(){return this.defines.USE_EDL},set:function(S){S!==this.defines.USE_EDL&&(this.defines.USE_EDL=S,this.needsUpdate=!0)}},useHQWeight:{get:function(){return this.defines.USE_HQ_WEIGHT},set:function(S){S!==this.defines.USE_HQ_WEIGHT&&(this.defines.USE_HQ_WEIGHT=S,this.needsUpdate=!0)}},useHQDepth:{get:function(){return this.defines.USE_HQ_DEPTH},set:function(S){S!==this.defines.USE_HQ_DEPTH&&(this.defines.USE_HQ_DEPTH=S,this.needsUpdate=!0)}},gradientTexture:{get:function(){return this.uniforms.gradientTexture.value},set:function(S){this.uniforms.gradientTexture.value=S}},floor:{get:function(){return this.uniforms.floor.value},set:function(S){this.uniforms.floor.value=S}},brightness:{get:function(){return this.uniforms.brightness.value},set:function(S){this.uniforms.brightness.value=S}}}),C.pano0=(r=e.pano0)!==null&&r!==void 0?r:Ee.pano0,C.pano1=(i=e.pano1)!==null&&i!==void 0?i:Ee.pano1,C.modelAlpha=(a=e.modelAlpha)!==null&&a!==void 0?a:Ee.modelAlpha,C.progress=(o=e.progress)!==null&&o!==void 0?o:Ee.progress,C.transition=(s=e.transition)!==null&&s!==void 0?s:Ee.transition,C.constantColor=(l=e.constantColor)!==null&&l!==void 0?l:Ee.constantColor,C.opacity=(u=e.opacity)!==null&&u!==void 0?u:Ee.opacity,C.shownFloorIndex=(d=e.shownFloorIndex)!==null&&d!==void 0?d:Ee.shownFloorIndex,C.clippers=(f=e.clippers)!==null&&f!==void 0?f:Ee.clippers,C.useEDL=(A=e.useEDL)!==null&&A!==void 0?A:Ee.useEDL,C.useHQWeight=(m=e.useHQWeight)!==null&&m!==void 0?m:Ee.useHQWeight,C.useHQDepth=(h=e.useHQDepth)!==null&&h!==void 0?h:Ee.useHQDepth,C.pointColor=(v=e.pointColor)!==null&&v!==void 0?v:Ee.pointColor,C.pointShape=(y=e.pointShape)!==null&&y!==void 0?y:Ee.pointShape,C.pointSize=(p=e.pointSize)!==null&&p!==void 0?p:Ee.pointSize,C.pointScale=(g=e.pointScale)!==null&&g!==void 0?g:Ee.pointScale,C.pointBack=(x=e.pointBack)!==null&&x!==void 0?x:Ee.pointBack,C.pointMinPixel=(b=e.pointMinPixel)!==null&&b!==void 0?b:Ee.pointMinPixel,C.pointMaxPixel=(w=e.pointMaxPixel)!==null&&w!==void 0?w:Ee.pointMaxPixel,C.gradientTexture=(E=e.gradientTexture)!==null&&E!==void 0?E:Ee.gradientTexture,C.brightness=(M=e.brightness)!==null&&M!==void 0?M:Ee.brightness,C.floor=0,C.transparent=!1,C}return t.prototype.onBeforeCompile=function(e,r){var i,a,o=String((a=(i=this.clippers)===null||i===void 0?void 0:i.length)!==null&&a!==void 0?a:0);e.vertexShader=e.vertexShader.replace(/NUM_CLIPPERS/g,o),e.fragmentShader=e.fragmentShader.replace(/NUM_CLIPPERS/g,o)},t.prototype.update=function(e,r){if(r instanceof Fi)this.uniforms.pixelRatio.value=r.pixelRatio,this.uniforms.resolution.value.copy(r.resolution);else{this.uniforms.pixelRatio.value=e.getPixelRatio();var i=e.getViewport(Md);this.uniforms.resolution.value.set(i.z,i.w)}this.transparent=this.shownFloorIndex>-1||this.opacity<1||this.modelAlpha<1||this.brightness<1,this.useEDL&&(this.transparent=!1),this.useHQDepth&&(this.depthTest=!0,this.depthWrite=!0),this.useHQWeight?(this.depthWrite=!1,this.blending=c.CustomBlending,this.blendSrc=c.SrcAlphaFactor,this.blendSrcAlpha=c.SrcAlphaFactor,this.blendDst=c.OneFactor,this.blendDstAlpha=c.OneFactor):(this.depthWrite=!0,this.blendDst=c.OneMinusSrcAlphaFactor,this.blendEquation=c.AddEquation,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.opacity<1?(this.blending=c.AdditiveBlending,this.depthTest=!1):(this.blending=c.NormalBlending,this.depthTest=!0))},t.prototype.syncModel=function(e){var r="".concat(e.id,":").concat(e.materialVersion);r!==this.syncModelVersion&&(Object.assign(this,e.getMaterial()),this.uniforms.modelBoundingMax.value.copy(e.bounding.max),this.uniforms.modelBoundingMin.value.copy(e.bounding.min),this.syncModelVersion=r)},t.prototype.copy=function(e){return n.prototype.copy.call(this,this),this.pano0=e.pano0,this.pano1=e.pano1,this.progress=e.progress,this.transition=e.transition,this.shownFloorIndex=e.shownFloorIndex,this.brightness=e.brightness,this.clippers=e.clippers,this.constantColor=e.constantColor,this.modelAlpha=e.modelAlpha,this.useEDL=e.useEDL,this.useHQWeight=e.useHQWeight,this.useHQDepth=e.useHQDepth,this.pointColor=e.pointColor,this.pointSize=e.pointSize,this.pointShape=e.pointShape,this.pointScale=e.pointScale,this.pointBack=e.pointBack,this.pointMinPixel=e.pointMinPixel,this.pointMaxPixel=e.pointMaxPixel,this.gradientTexture=e.gradientTexture,this},t}(c.ShaderMaterial),$i=4;function D0(n,t,e){var r=new DataView(t);if(n.magic=r.getUint32(e,!0),e+=$i,n.version=r.getUint32(e,!0),e+=$i,n.byteLength=r.getUint32(e,!0),e+=$i,n.version!==1)throw new Error("3D Tile Version ".concat(n.version," not supported"));return e}var ir,Ze;(function(n){n[n.BYTE=5120]="BYTE",n[n.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",n[n.SHORT=5122]="SHORT",n[n.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",n[n.INT=5124]="INT",n[n.UNSIGNED_INT=5125]="UNSIGNED_INT",n[n.FLOAT=5126]="FLOAT",n[n.DOUBLE=5130]="DOUBLE"})(Ze||(Ze={}));var Id=(ir={},ir[Ze.DOUBLE]=Float64Array,ir[Ze.FLOAT]=Float32Array,ir[Ze.UNSIGNED_SHORT]=Uint16Array,ir[Ze.UNSIGNED_INT]=Uint32Array,ir[Ze.UNSIGNED_BYTE]=Uint8Array,ir[Ze.BYTE]=Int8Array,ir[Ze.SHORT]=Int16Array,ir[Ze.INT]=Int32Array,ir),Td={DOUBLE:Ze.DOUBLE,FLOAT:Ze.FLOAT,UNSIGNED_SHORT:Ze.UNSIGNED_SHORT,UNSIGNED_INT:Ze.UNSIGNED_INT,UNSIGNED_BYTE:Ze.UNSIGNED_BYTE,BYTE:Ze.BYTE,SHORT:Ze.SHORT,INT:Ze.INT};function wi(n){var t=Id[n];if(!t)throw new Error("Failed to convert GL type");return t}function ea(n){var t=wi(n);return t.BYTES_PER_ELEMENT}function Wo(n,t,e,r){e===void 0&&(e=0);var i=wi(n);if(e%ea(n)!==0){var a=r?t.slice(e,e+r*ea(n)):t.slice(e);return new i(a)}else return new i(t,e,r!=null?r:(t.byteLength-e)/ea(n))}function Pd(n){var t=Td[n];if(!t)throw new Error("Failed to convert GL type");return t}var z0=function(){function n(t,e){this.featuresLength=0,this.cachedTypedArrays={},this.json=t,this.buffer=e;var r=this.getGlobalProperty("POINTS_LENGTH",Ze.UNSIGNED_INT,1);r&&r.length&&(this.featuresLength=r[0])}return n.prototype.getExtension=function(t){return this.json.extensions&&this.json.extensions[t]},n.prototype.hasProperty=function(t){return!!this.json[t]},n.prototype.getGlobalProperty=function(t,e,r){var i=this.json[t];if(typeof i=="number"){var a=wi(e);return new a([i])}else if(Array.isArray(i)){var a=wi(e);return new a(i)}else if(i&&Number.isFinite(i.byteOffset))return this.getTypedArrayFromBinary(t,e,r,1,i.byteOffset);return null},n.prototype.getPropertyArray=function(t,e,r){var i=this.json[t];return i&&Number.isFinite(i.byteOffset)?("componentType"in i&&(e=Pd(i.componentType)),this.getTypedArrayFromBinary(t,e,r,this.featuresLength,i.byteOffset)):this.getTypedArrayFromArray(t,e,i)},n.prototype.getProperty=function(t,e,r,i,a){var o=this.json[t];if(!o)return null;var s=this.getPropertyArray(t,e,r);if(r===1)return a[0]=s[i],a;for(var l=0;l<r;++l)a[l]=s[r*i+l];return a},n.prototype.getTypedArrayFromBinary=function(t,e,r,i,a){var o=this.cachedTypedArrays,s=o[t];return s||(s=Wo(e,this.buffer.buffer,this.buffer.byteOffset+a,i*r),o[t]=s),s},n.prototype.getTypedArrayFromArray=function(t,e,r){var i=this.cachedTypedArrays,a=i[t];return a||(a=Wo(e,r),i[t]=a),a},n}(),hn=4,Xo="b3dm tile in legacy format.";function Q0(n,t,e){var r=new TextDecoder("utf8"),i=new Uint8Array(n,t,e),a=r.decode(i);return a}function U0(n,t,e){return e=Bd(n,t,e),e=Rd(n,t,e),e=kd(n,t,e),e}function Bd(n,t,e){var r=new DataView(t),i=0;n.header=n.header||{};var a=r.getUint32(e,!0);e+=hn;var o=r.getUint32(e,!0);e+=hn;var s=r.getUint32(e,!0);e+=hn;var l=r.getUint32(e,!0);return e+=hn,s>=570425344?(e-=hn*2,i=a,s=o,l=0,a=0,o=0,console.warn(Xo)):l>=570425344&&(e-=hn,i=s,s=a,l=o,a=0,o=0,console.warn(Xo)),n.header.featureTableJsonByteLength=a,n.header.featureTableBinaryByteLength=o,n.header.batchTableJsonByteLength=s,n.header.batchTableBinaryByteLength=l,n.header.batchLength=i,e}function Rd(n,t,e){var r=n.header||{},i=r.featureTableJsonByteLength,a=r.featureTableBinaryByteLength,o=r.batchLength;if(n.featureTableJson={BATCH_LENGTH:o||0},i&&i>0){var s=Q0(t,e,i);n.featureTableJson=JSON.parse(s)}e+=i||0,n.featureTableBinary=new Uint8Array(t,e,a),e+=a||0,n.rtcCenter=[0,0,0];var l=new z0(n.featureTableJson,n.featureTableBinary);if(Array.isArray(l.json.RTC_CENTER)){var u=l.json.RTC_CENTER;n.rtcCenter[0]=u[0],n.rtcCenter[1]=u[1],n.rtcCenter[2]=u[2]}else{var u=l.getGlobalProperty("RTC_CENTER",Ze.FLOAT,3);u&&(n.rtcCenter[0]=u[0],n.rtcCenter[1]=u[1],n.rtcCenter[2]=u[2])}return e}function kd(n,t,e){var r=n.header||{},i=r.batchTableJsonByteLength,a=r.batchTableBinaryByteLength;if(i&&i>0){var o=Q0(t,e,i);n.batchTableJson=JSON.parse(o),e+=i,a&&a>0&&(n.batchTableBinary=new Uint8Array(t,e,a),n.batchTableBinary=new Uint8Array(n.batchTableBinary),e+=a)}return e}function Fd(n,t,e){var r=e!==void 0?new Uint8Array(n).subarray(t,t+e):new Uint8Array(n).subarray(t),i=new Uint8Array(r);return i.buffer}function Ld(n,t,e){var r=n.byteLength-e;if(r===0)throw new Error("glTF byte length must be greater than 0.");return e%4!==0&&console.warn("".concat(n.type,": embedded glb is not aligned to a 4-byte boundary.")),n.gltfArrayBuffer=Fd(t,e,r),n.byteLength}function Ba(n){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(n);for(var t="",e=0,r=n.length;e<r;e++)t+=String.fromCharCode(n[e]);try{return decodeURIComponent(escape(t))}catch(i){return t}}var Ve={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},kn={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Ei={9728:c.NearestFilter,9729:c.LinearFilter,9984:c.NearestMipmapNearestFilter,9985:c.LinearMipmapNearestFilter,9986:c.NearestMipmapLinearFilter,9987:c.LinearMipmapLinearFilter},Ci={33071:c.ClampToEdgeWrapping,33648:c.MirroredRepeatWrapping,10497:c.RepeatWrapping},_o={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Bt={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Vr={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},Od={CUBICSPLINE:void 0,LINEAR:c.InterpolateLinear,STEP:c.InterpolateDiscrete},mr={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function ft(n){var t=[];for(var e in n)t.push(n[e]);return t}var Vd=function(){function n(t,e,r){this.json=t,this.extensions=e,this.options=r,this.cache=new Map,this.disposeSet=new Set,this.nodeNamesUsed={}}return n.prototype.dispose=function(){this.cache.clear(),this.disposeSet.forEach(function(t){typeof t.dispose=="function"&&t.dispose(),typeof t.close=="function"&&t.close()}),this.disposeSet.clear(),delete this.cache,delete this.disposeSet,delete this.json,delete this.extensions,delete this.options},n.prototype.markDefs=function(){for(var t=this.json.nodes||[],e=this.json.skins||[],r=this.json.meshes||[],i=0,a=e.length;i<a;i++)for(var o=e[i].joints,s=0,l=o.length;s<l;s++)t[o[s]].isBone=!0;for(var u=0,d=t.length;u<d;u++){var f=t[u];f.mesh!==void 0&&f.skin!==void 0&&(r[f.mesh].isSkinnedMesh=!0)}},n.prototype.parse=function(){var t=this,e=this.json,r=this.extensions;this.markDefs();for(var i=0,a=ft(r);i<a.length;i++){var o=a[i];o.markDefs(this)}return Promise.all(ft(r).map(function(s){return s.prepare(t)})).then(function(){var s,l,u;return Promise.all([Promise.all(((s=e.scenes)!==null&&s!==void 0?s:[]).map(function(d,f){return t.loadScene(f)})),Promise.all(((l=e.animations)!==null&&l!==void 0?l:[]).map(function(d,f){return t.loadAnimation(f)})),Promise.all(((u=e.cameras)!==null&&u!==void 0?u:[]).map(function(d,f){return t.loadCamera(f)}))])}).then(function(s){var l=s[0],u=s[1],d=s[2],f={json:t.json,scene:l[e.scene||0],scenes:l,animations:u,cameras:d,dispose:function(){return t.dispose()}};return Promise.all(ft(r).map(function(A){return A.emitResult(f,t)})).then(function(){return f})})},n.prototype.loadCamera=function(t){var e="camera:"+t,r=this.cache.get(e);if(r)return r;for(var i=null,a=0,o=ft(this.extensions);a<o.length;a++){var s=o[a];if(i=s.loadCamera(t,this),i)break}if(!i){var l=void 0,u=this.json.cameras[t],d=u[u.type];d?u.type==="perspective"?l=new c.PerspectiveCamera(c.MathUtils.radToDeg(d.yfov),d.aspectRatio||1,d.znear||1,d.zfar||2e6):u.type==="orthographic"?l=new c.OrthographicCamera(-d.xmag,d.xmag,d.ymag,-d.ymag,d.znear,d.zfar):(console.warn("glTF: Invalid camera type ".concat(u.type,".")),l=new c.Camera):(console.warn("glTF: Missing camera parameters."),l=new c.Camera),u.name&&(l.name=this.createUniqueName(u.name)),i=Promise.resolve(l)}return this.cache.set(e,i),i},n.prototype.loadSkin=function(t){var e="animation:"+t,r=this.cache.get(e);if(r)return r;var i,a=this.json.skins[t],o={joints:a.joints};return a.inverseBindMatrices===void 0?i=Promise.resolve(o):i=this.loadAccessor(a.inverseBindMatrices).then(function(s){return s&&(o.inverseBindMatrices=s),o}),this.cache.set(e,i),i},n.prototype.loadAnimation=function(t){var e="animation:"+t,r=this.cache.get(e);if(r)return r;for(var i=null,a=0,o=ft(this.extensions);a<o.length;a++){var s=o[a];if(i=s.loadAnimation(t,this),i)break}if(!i){for(var l=this.json,u=l.animations[t],d=[],f=[],A=[],m=[],h=[],v=0,y=u.channels.length;v<y;v++){var p=u.channels[v],g=u.samplers[p.sampler],x=p.target,b=x.node!==void 0?x.node:x.id,w=u.parameters!==void 0?u.parameters[g.input]:g.input,E=u.parameters!==void 0?u.parameters[g.output]:g.output;d.push(this.loadNode(b)),f.push(this.loadAccessor(w)),A.push(this.loadAccessor(E)),m.push(g),h.push(x)}i=Promise.all([Promise.all(d),Promise.all(f),Promise.all(A),Promise.all(m),Promise.all(h)]).then(function(M){for(var C=M[0],P=M[1],S=M[2],T=M[3],B=M[4],L=[],k=function(X,K){var Q=C[X],G=P[X],J=S[X],H=T[X],j=B[X];if(Q===void 0)return"continue";Q.updateMatrix(),Q.matrixAutoUpdate=!0;var Z=void 0;switch(Vr[j.path]){case Vr.weights:Z=c.NumberKeyframeTrack;break;case Vr.rotation:Z=c.QuaternionKeyframeTrack;break;case Vr.position:case Vr.scale:default:Z=c.VectorKeyframeTrack;break}var Y=Q.name?Q.name:Q.uuid,pe=H.interpolation!==void 0?Od[H.interpolation]:c.InterpolateLinear,ee=[];Vr[j.path]===Vr.weights?Q.traverse(function(ve){ve.morphTargetInfluences&&ee.push(ve.name?ve.name:ve.uuid)}):ee.push(Y);var oe=J.array;if(J.normalized){for(var ie=ta(oe.constructor),ce=new Float32Array(oe.length),ne=0,ae=oe.length;ne<ae;ne++)ce[ne]=oe[ne]*ie;oe=ce}for(var ne=0,ae=ee.length;ne<ae;ne++){var de=new Z(ee[ne]+"."+Vr[j.path],G.array,oe,pe);L.push(de)}},O=0,D=C.length;O<D;O++)k(O);var N=u.name?u.name:"animation_"+t;return new c.AnimationClip(N,void 0,L)})}return this.cache.set(e,i),i},n.prototype.loadBuffer=function(t){var e=this.json.buffers[t];if(e.type&&e.type!=="arraybuffer")throw new Error("glTF: "+e.type+" buffer type is not supported.");var r="buffer:"+t,i=this.cache.get(r);if(i)return i;for(var a=null,o=0,s=ft(this.extensions);o<s.length;o++){var l=s[o];if(a=l.loadBuffer(t,this),a)break}if(!a){var u=this.json.buffers[t];a=this.options.fetcher.ajax(this.resolveResouce(u.uri),{responseType:"arraybuffer"}).then(function(d){return d.body})}return this.cache.set(r,a),a},n.prototype.loadBufferView=function(t){var e="bufferView:"+t,r=this.cache.get(e);if(r)return r;for(var i=null,a=0,o=ft(this.extensions);a<o.length;a++){var s=o[a];if(i=s.loadBufferView(t,this),i)break}if(!i){var l=this.json.bufferViews[t];i=this.loadBuffer(l.buffer).then(function(u){var d=l.byteLength||0,f=l.byteOffset||0;return u.slice(f,f+d)})}return this.cache.set(e,i),i},n.prototype.loadAccessor=function(t){var e=this,r="accessor:"+t,i=this.cache.get(r);if(i)return i;var a=null;if(!a){var o=this.json.accessors[t];if(o.bufferView===void 0&&o.sparse===void 0)a=Promise.resolve(null);else{var s=[];o.bufferView!==void 0?s.push(this.loadBufferView(o.bufferView)):s.push(Promise.resolve(null)),o.sparse!==void 0&&(s.push(this.loadBufferView(o.sparse.indices.bufferView)),s.push(this.loadBufferView(o.sparse.values.bufferView))),a=Promise.all(s).then(function(l){var u=l[0],d=_o[o.type],f=kn[o.componentType],A=f.BYTES_PER_ELEMENT,m=A*d,h=o.byteOffset||0,v=o.bufferView!==void 0?e.json.bufferViews[o.bufferView].byteStride:void 0,y=o.normalized===!0,p,g;if(v&&v!==m){var x=Math.floor(h/v),b="InterleavedBuffer:"+o.bufferView+":"+o.componentType+":"+x+":"+o.count,w=e.cache.get(b);w||(p=new f(u,x*v,o.count*v/A),w=new c.InterleavedBuffer(p,v/A),e.cache.set(b,w)),g=new c.InterleavedBufferAttribute(w,d,h%v/A,y)}else u===null?p=new f(o.count*d):p=new f(u,h,o.count*d),g=new c.BufferAttribute(p,d,y);if(o.sparse!==void 0){var E=_o.SCALAR,M=kn[o.sparse.indices.componentType],C=o.sparse.indices.byteOffset||0,P=o.sparse.values.byteOffset||0,S=new M(l[1],C,o.sparse.count*E),T=new f(l[2],P,o.sparse.count*d);u!==null&&(g=new c.BufferAttribute(g.array.slice(),g.itemSize,g.normalized));for(var B=0,L=S.length;B<L;B++){var k=S[B];if(g.setX(k,T[B*d]),d>=2&&g.setY(k,T[B*d+1]),d>=3&&g.setZ(k,T[B*d+2]),d>=4&&g.setW(k,T[B*d+3]),d>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return g})}}return this.cache.set(r,a),a},n.prototype.createPrimitiveKey=function(t){for(var e=0,r=ft(this.extensions);e<r.length;e++){var i=r[e],a=i.createPrimitiveKey(t,this);if(a)return a}for(var o="",s=Object.keys(t.attributes).sort(),l=0,u=s.length;l<u;l++)o+=s[l]+":"+t.attributes[s[l]]+";";return t.indices+":"+o+":"+t.mode},n.prototype.loadGeometry=function(t){for(var e=this,r=null,i=0,a=ft(this.extensions);i<a.length;i++){var o=a[i];if(r=o.loadGeometry(t,this),r)break}return r||(r=this.addGeometryPrimitiveAttributes(new c.BufferGeometry,t)),r=r.then(function(s){return e.disposeSet.add(s),s}),r},n.prototype.loadImage=function(t){for(var e=this,r=null,i=0,a=ft(this.extensions);i<a.length;i++){var o=a[i];if(r=o.loadImage(t,this),r)break}if(!r){var s=this.json.images[t];if(s.bufferView!==void 0){var l=this.json.bufferViews[s.bufferView];r=this.loadBuffer(l.buffer).then(function(d){var f=l.byteOffset||0,A=l.byteLength||0,m=new Uint8Array(d,f,A),h=new Blob([m],{type:s.mimeType});return Ia(h)})}else if(s.uri){var u=this.resolveResouce(s.uri);r=this.options.fetcher.loadImage(u,{},void 0,void 0,void 0,xi()).then(function(d){return d.body})}else throw new Error("glTF: Invalid image defs.")}return r=r.then(function(d){return e.disposeSet.add(d),d}),r},n.prototype.loadMaterialAsMeshStandardMaterial=function(t){var e=this,r=[],i=new c.MeshStandardMaterial;if(i.color=new c.Color(1,1,1),i.opacity=1,Object.keys(t.attributes).filter(function(d){return Bt[d]==="color"}).length>0&&(i.vertexColors=!0),Object.keys(t.attributes).filter(function(d){return Bt[d]==="normal"}).length===0&&(i.flatShading=!0),Object.keys(t.attributes).filter(function(d){return Bt[d]==="tangent"}).length===0&&(i.normalScale&&(i.normalScale.y*=-1),i.clearcoatNormalScale&&(i.clearcoatNormalScale.y*=-1)),t.material!==void 0){var a=this.json.materials[t.material];a.name&&(i.name=a.name);var o=a.pbrMetallicRoughness||{};if(Array.isArray(o.baseColorFactor)){var s=o.baseColorFactor;i.color.fromArray(s),i.opacity=s[3]}o.baseColorTexture!==void 0&&r.push(this.createMaterialTexture(o.baseColorTexture).then(function(d){d.encoding=c.sRGBEncoding,i.map=d,e.disposeSet.add(d)})),i.metalness=o.metallicFactor!==void 0?o.metallicFactor:1,i.roughness=o.roughnessFactor!==void 0?o.roughnessFactor:1,o.metallicRoughnessTexture!==void 0&&r.push(this.createMaterialTexture(o.metallicRoughnessTexture).then(function(d){d.encoding=c.sRGBEncoding,i.metalnessMap=d,i.roughnessMap=d,e.disposeSet.add(d)})),a.doubleSided===!0&&(i.side=c.DoubleSide);var l=a.alphaMode||mr.OPAQUE;if(l===mr.BLEND?(i.transparent=!0,i.depthWrite=!1):(i.transparent=!1,l===mr.MASK&&(i.alphaTest=a.alphaCutoff!==void 0?a.alphaCutoff:.5)),a.normalTexture!==void 0&&(r.push(this.createMaterialTexture(a.normalTexture).then(function(d){i.normalMap=d,e.disposeSet.add(d)})),i.normalScale=new c.Vector2(1,1),a.normalTexture.scale!==void 0)){var u=a.normalTexture.scale;i.normalScale.set(u,u)}a.occlusionTexture!==void 0&&(r.push(this.createMaterialTexture(a.occlusionTexture).then(function(d){i.aoMap=d,e.disposeSet.add(d)})),a.occlusionTexture.strength!==void 0&&(i.aoMapIntensity=a.occlusionTexture.strength)),a.emissiveFactor!==void 0&&(i.emissive=new c.Color().fromArray(a.emissiveFactor)),a.emissiveTexture!==void 0&&r.push(this.createMaterialTexture(a.emissiveTexture).then(function(d){i.emissiveMap=d,e.disposeSet.add(d)}))}return this.disposeSet.add(i),Promise.all(r).then(function(){return i})},n.prototype.loadMaterialAsLineBasicMaterial=function(t){var e=[],r=new c.LineBasicMaterial;if(r.color=new c.Color(1,1,1),r.opacity=1,Object.keys(t.attributes).filter(function(l){return Bt[l]==="color"}).length>0&&(r.vertexColors=!0),Object.keys(t.attributes).filter(function(l){return Bt[l]==="tangent"}).length===0&&(r.normalScale&&(r.normalScale.y*=-1),r.clearcoatNormalScale&&(r.clearcoatNormalScale.y*=-1)),t.material!==void 0){var i=this.json.materials[t.material];i.name&&(r.name=i.name);var a=i.pbrMetallicRoughness||{};if(Array.isArray(a.baseColorFactor)){var o=a.baseColorFactor;r.color.fromArray(o),r.opacity=o[3]}i.doubleSided===!0&&(r.side=c.DoubleSide);var s=i.alphaMode||mr.OPAQUE;s===mr.BLEND?(r.transparent=!0,r.depthWrite=!1):(r.transparent=!1,s===mr.MASK&&(r.alphaTest=i.alphaCutoff!==void 0?i.alphaCutoff:.5))}return this.disposeSet.add(r),Promise.all(e).then(function(){return r})},n.prototype.loadMaterialAsPointsMaterial=function(t){var e=this,r=[],i=new c.PointsMaterial;if(i.color=new c.Color(1,1,1),i.opacity=1,i.sizeAttenuation=!1,Object.keys(t.attributes).filter(function(u){return Bt[u]==="color"}).length>0&&(i.vertexColors=!0),Object.keys(t.attributes).filter(function(u){return Bt[u]==="tangent"}).length===0&&(i.normalScale&&(i.normalScale.y*=-1),i.clearcoatNormalScale&&(i.clearcoatNormalScale.y*=-1)),t.material!==void 0){var a=this.json.materials[t.material];a.name&&(i.name=a.name);var o=a.pbrMetallicRoughness||{};if(Array.isArray(o.baseColorFactor)){var s=o.baseColorFactor;i.color.fromArray(s),i.opacity=s[3]}o.baseColorTexture!==void 0&&r.push(this.createMaterialTexture(o.baseColorTexture).then(function(u){u.encoding=c.sRGBEncoding,i.map=u,e.disposeSet.add(u)})),a.doubleSided===!0&&(i.side=c.DoubleSide);var l=a.alphaMode||mr.OPAQUE;l===mr.BLEND?(i.transparent=!0,i.depthWrite=!1):(i.transparent=!1,l===mr.MASK&&(i.alphaTest=a.alphaCutoff!==void 0?a.alphaCutoff:.5))}return this.disposeSet.add(i),Promise.all(r).then(function(){return i})},n.prototype.loadMaterial=function(t){var e,r=(e=t.mode)!==null&&e!==void 0?e:Ve.TRIANGLES,i="material:"+this.createPrimitiveKey(t),a=this.cache.get(i);if(a)return a;for(var o=null,s=0,l=ft(this.extensions);s<l.length;s++){var u=l[s];if(o=u.loadMaterial(t,this),o)break}if(r===Ve.TRIANGLES||r===Ve.TRIANGLE_STRIP||r===Ve.TRIANGLE_FAN)o=this.loadMaterialAsMeshStandardMaterial(t);else if(r===Ve.LINES||r===Ve.LINE_STRIP||r===Ve.LINE_LOOP)o=this.loadMaterialAsLineBasicMaterial(t);else if(r===Ve.POINTS)o=this.loadMaterialAsPointsMaterial(t);else throw new Error("glTF: Primitive mode unsupported: "+r);return this.cache.set(i,o),o},n.prototype.loadTexture=function(t){var e=this,r="texture:"+t,i=this.cache.get(r);if(i)return i;for(var a=null,o=0,s=ft(this.extensions);o<s.length;o++){var l=s[o];if(a=l.loadTexture(t,this),a)break}if(!a){var u=this.json.textures[t];a=this.loadImage(u.source).then(function(d){var f=new c.Texture(d);f.needsUpdate=!0,f.flipY=!1,u.name&&(f.name=u.name);var A=e.json.samplers||{},m=A[u.sampler]||{};return f.magFilter=Ei[m.magFilter]||c.LinearFilter,f.minFilter=Ei[m.minFilter]||c.LinearMipmapLinearFilter,f.wrapS=Ci[m.wrapS]||c.RepeatWrapping,f.wrapT=Ci[m.wrapT]||c.RepeatWrapping,f.onUpdate=function(){d.close()},f})}return a=a.then(function(d){return e.disposeSet.add(d),d}),this.cache.set(r,a),a},n.prototype.loadMesh=function(t){for(var e=this,r=null,i=0,a=ft(this.extensions);i<a.length;i++){var o=a[i];if(r=o.loadMesh(t,this),r)break}if(!r){var s=this.json.meshes[t],l=s.primitives,u=Promise.all(l.map(function(f){return e.loadGeometry(f)})),d=Promise.all(l.map(function(f){return e.loadMaterial(f)}));r=Promise.all([u,d]).then(function(f){for(var A=f[0],m=f[1],h=[],v=0;v<l.length;v++){var y=l[v],p=A[v],g=m[v],x=y.mode||Ve.TRIANGLES,b=void 0;if(x===Ve.TRIANGLES||x===Ve.TRIANGLE_STRIP||x===Ve.TRIANGLE_FAN)if(x===Ve.TRIANGLE_STRIP?p=e.toGeometryTrianglesDrawMode(p,c.TriangleStripDrawMode):x===Ve.TRIANGLE_FAN&&(p=e.toGeometryTrianglesDrawMode(p,c.TriangleFanDrawMode)),e.disposeSet.add(p),s.isSkinnedMesh){var w=new c.SkinnedMesh(p,g);p.attributes.skinWeight.normalized||w.normalizeSkinWeights(),b=w}else b=new c.Mesh(p,g);else if(x===Ve.POINTS)b=new c.Points(p,g);else if(x===Ve.LINES)b=new c.LineSegments(p,g);else if(x===Ve.LINE_STRIP)b=new c.Line(p,g);else if(x===Ve.LINE_LOOP)b=new c.LineLoop(p,g);else throw new Error("glTF: Primitive mode unsupported: "+x);if(Object.keys(p.morphAttributes).length>0){if(s.weights!==void 0)for(var E=0,M=s.weights.length;E<M;E++)b.morphTargetInfluences[E]=s.weights[E];if(s.extras&&Array.isArray(s.extras.targetNames)){var C=s.extras.targetNames;if(b.morphTargetInfluences.length===C.length){b.morphTargetDictionary={};for(var E=0,M=C.length;E<M;E++)b.morphTargetDictionary[C[E]]=E}else console.warn("glTF: Invalid extras.targetNames length. Ignoring names.")}}b.name=e.createUniqueName(s.name||"mesh_"+t),h.push(b)}if(h.length===1)return h[0];for(var P=new c.Group,S=0,T=h;S<T.length;S++){var b=T[S];P.add(b)}return P})}return r},n.prototype.loadNodeAttachments=function(t){for(var e=[],r=0,i=ft(this.extensions);r<i.length;r++){var a=i[r],o=a.loadNodeAttachments(t,this);o&&e.push(o)}return e},n.prototype.loadNode=function(t){var e="node:"+t,r=this.cache.get(e);if(r)return r;var i=this.json,a=i.nodes[t],o=a.name?this.createUniqueName(a.name):"",s=[];a.mesh!==void 0&&s.push(this.loadMesh(a.mesh).then(function(A){if(a.weights!==void 0){var m=a.weights;A.traverse(function(h){if(h instanceof c.Mesh||h instanceof c.Line||h instanceof c.Points)for(var v=0,y=m.length;v<y;v++)h.morphTargetInfluences[v]=m[v]})}return A})),a.camera!==void 0&&s.push(this.loadCamera(a.camera));for(var l=this.loadNodeAttachments(t),u=0,d=l;u<d.length;u++){var f=d[u];s.push(f)}return Promise.all(s).then(function(A){var m;if(a.isBone===!0?m=new c.Bone:A.length>1?m=new c.Group:A.length===1?m=A[0]:m=new c.Object3D,m!==A[0])for(var h=0,v=A.length;h<v;h++)m.add(A[h]);if(a.name&&(m.name=o),a.matrix!==void 0){var y=new c.Matrix4;y.fromArray(a.matrix),m.applyMatrix4(y)}else a.translation!==void 0&&m.position.fromArray(a.translation),a.rotation!==void 0&&m.quaternion.fromArray(a.rotation),a.scale!==void 0&&m.scale.fromArray(a.scale);return m})},n.prototype.loadScene=function(t){var e=this.json,r=e.scenes[t],i=new c.Group;r.name&&(i.name=this.createUniqueName(r.name));for(var a=r.nodes||[],o=[],s=0,l=a.length;s<l;s++)o.push(this.buildNodeHierarchy(a[s],i));return Promise.all(o).then(function(){return i})},n.prototype.createMaterialTexture=function(t){var e=this;return this.loadTexture(t.index).then(function(r){for(var i=0,a=ft(e.extensions);i<a.length;i++){var o=a[i],s=o.extendTexture(r,t,e);s&&(r=s,e.disposeSet.add(r))}return r})},n.prototype.addGeometryPrimitiveAttributes=function(t,e){var r=this,i=e.attributes,a=[],o=function(w){var E=Bt[w]||w.toLowerCase();if(E in t.attributes)return"continue";a.push(s.loadAccessor(i[w]).then(function(M){M&&t.setAttribute(E,M)}))},s=this;for(var l in i)o(l);e.indices!==void 0&&!t.index&&a.push(this.loadAccessor(e.indices).then(function(w){w&&t.setIndex(w)}));var u=new c.Box3;if(i.POSITION!==void 0){var d=this.json.accessors[i.POSITION],f=d.min,A=d.max;if(f!==void 0&&A!==void 0){if(u.set(new c.Vector3(f[0],f[1],f[2]),new c.Vector3(A[0],A[1],A[2])),d.normalized){var m=ta(kn[d.componentType]);u.min.multiplyScalar(m),u.max.multiplyScalar(m)}}else console.warn("glTF: Missing min/max properties for accessor POSITION.")}var h=e.targets;if(h!==void 0){for(var v=new c.Vector3,y=new c.Vector3,p=0,g=h.length;p<g;p++){var x=h[p];if(x.POSITION!==void 0){var d=this.json.accessors[x.POSITION],f=d.min,A=d.max;if(f!==void 0&&A!==void 0){if(y.setX(Math.max(Math.abs(f[0]),Math.abs(A[0]))),y.setY(Math.max(Math.abs(f[1]),Math.abs(A[1]))),y.setZ(Math.max(Math.abs(f[2]),Math.abs(A[2]))),d.normalized){var m=ta(kn[d.componentType]);y.multiplyScalar(m)}v.max(y)}else console.warn("glTF: Missing min/max properties for accessor POSITION.")}}u.expandByVector(v)}t.boundingBox=u;var b=new c.Sphere;return u.getCenter(b.center),b.radius=u.min.distanceTo(u.max)/2,t.boundingSphere=b,Promise.all(a).then(function(){if(t.attributes.uv&&!t.attributes.uv2&&r.options.copyUV2&&t.setAttribute("uv2",t.attributes.uv),e.targets){for(var w=!1,E=!1,M=0,C=e.targets.length;M<C;M++){var P=e.targets[M];if(P.POSITION!==void 0&&(w=!0),P.NORMAL!==void 0&&(E=!0),w&&E)break}if(!w&&!E)return t;var S=[];t.morphTargetsRelative=!0;for(var T=function(B,L){var k=e.targets[B];w?S.push(r.loadAccessor(k.POSITION).then(function(O){O&&(t.morphAttributes.position[B]=O)})):t.morphAttributes.position[B]=t.attributes.position,E?S.push(r.loadAccessor(k.NORMAL).then(function(O){O&&(t.morphAttributes.normal[B]=O)})):t.morphAttributes.normal[B]=t.attributes.normal},M=0,C=e.targets.length;M<C;M++)T(M,C);return Promise.all(S).then(function(){return t})}else return t})},n.prototype.buildNodeHierarchy=function(t,e){var r=this,i=this.json.nodes[t];return this.loadNode(t).then(function(a){if(i.skin===void 0)return a;var o;return r.loadSkin(i.skin).then(function(s){o=s;for(var l=[],u=0,d=o.joints.length;u<d;u++)l.push(r.loadNode(o.joints[u]));return Promise.all(l)}).then(function(s){return a.traverse(function(l){if(l instanceof c.SkinnedMesh){for(var u=[],d=[],f=0,A=s.length;f<A;f++){var m=s[f];if(m instanceof c.Bone){u.push(m);var h=new c.Matrix4;o.inverseBindMatrices!==void 0&&h.fromArray(o.inverseBindMatrices.array,f*16),d.push(h)}else console.warn('glTF: Joint "%s" could not be found.',o.joints[f])}l.bind(new c.Skeleton(u,d),l.matrixWorld)}}),a})}).then(function(a){e.add(a);var o=[];if(i.children)for(var s=i.children,l=0,u=s.length;l<u;l++){var d=s[l];o.push(r.buildNodeHierarchy(d,a))}return Promise.all(o).then(function(){return a})})},n.prototype.createUniqueName=function(t){for(var e=c.PropertyBinding.sanitizeNodeName(t||""),r=e,i=1;this.nodeNamesUsed[r];++i)r=e+"_"+i;return this.nodeNamesUsed[r]=!0,r},n.prototype.resolveResouce=function(t){return xt(this.options.resourcePath,N0(t,this.options.search))},n.prototype.toGeometryTrianglesDrawMode=function(t,e){var r=t.getIndex();if(r===null){var i=[],a=t.getAttribute("position");if(a!==void 0){for(var o=0;o<a.count;o++)i.push(o);t.setIndex(i),r=t.getIndex()}}if(r===null)return console.error("glTF: Undefined position attribute. Processing not possible."),t;var s=r.count-2,l=[];if(e===c.TriangleFanDrawMode)for(var o=1;o<=s;o++)l.push(r.getX(0)),l.push(r.getX(o)),l.push(r.getX(o+1));else for(var o=0;o<s;o++)o%2===0?(l.push(r.getX(o)),l.push(r.getX(o+1)),l.push(r.getX(o+2))):(l.push(r.getX(o+2)),l.push(r.getX(o+1)),l.push(r.getX(o)));l.length/3!==s&&console.error("glTF: Unable to generate correct amount of triangles.");var u=t.clone();return u.setIndex(l),this.disposeSet.add(u),u},n}();function ta(n){switch(n){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("glTF: Unsupported normalized accessor component type.")}}var lr=function(){function n(){}return n.prototype.markDefs=function(t){},n.prototype.prepare=function(t){},n.prototype.emitResult=function(t,e){},n.prototype.createPrimitiveKey=function(t,e){},n.prototype.extendTexture=function(t,e,r){return null},n.prototype.loadBuffer=function(t,e){return null},n.prototype.loadBufferView=function(t,e){return null},n.prototype.loadImage=function(t,e){return null},n.prototype.loadTexture=function(t,e){return null},n.prototype.loadGeometry=function(t,e){return null},n.prototype.loadMaterial=function(t,e){return null},n.prototype.loadMesh=function(t,e){return null},n.prototype.loadNodeAttachments=function(t,e){return null},n.prototype.loadCamera=function(t,e){return null},n.prototype.loadAnimation=function(t,e){return null},n}(),Nd=function(n){ue(t,n);function t(){var e=n.call(this)||this;return e.header={magic:"",version:0,length:0},e.content="",e.body=null,e}return t.getMagic=function(e){return Ba(new Uint8Array(e.slice(0,4)))},t.prototype.loadGlbBinary=function(e){var r=new DataView(e,0,t.HEADER_LENGTH);if(this.header={magic:t.getMagic(e),version:r.getUint32(4,!0),length:r.getUint32(8,!0)},this.header.magic!==t.HEADER_MAGIC)throw new Error("glTF:KHR_binary_glTF: Unsupported.");if(this.header.version<2)throw new Error("glTF:KHR_binary_glTF: Legacy binary file detected.");for(var i=new DataView(e,t.HEADER_LENGTH),a=0,o=null,s=null;a<i.byteLength;){var l=i.getUint32(a,!0);if(a+=4,l!==0){var u=i.getUint32(a,!0);if(a+=4,u===t.CHUNK_TYPES.JSON){var d=new Uint8Array(e,t.HEADER_LENGTH+a,l);o=Ba(d)}else if(u===t.CHUNK_TYPES.BIN){var f=t.HEADER_LENGTH+a;s=e.slice(f,f+l)}a+=l}}if(o===null)throw new Error("glTF:KHR_binary_glTF: JSON content not found.");this.content=o,this.body=s},t.prototype.loadBuffer=function(e,r){var i=r.json.buffers[e];return i.uri===void 0&&e===0&&this.body?Promise.resolve(this.body):null},t.prototype.clear=function(){this.body=null,this.content=""},t.HEADER_MAGIC="glTF",t.HEADER_LENGTH=12,t.CHUNK_TYPES={JSON:1313821514,BIN:5130562},t}(lr),Dd="https://vr-public.realsee-cdn.cn/release/static/image/release/five/resource/draco/1.5.6/",Zo={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},Yo={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"},zd=function(){function n(){this.decoderPath=Dd,this.decoderConfig={},this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL=""}return n.prototype.setDecoderPath=function(t){this.decoderPath=t},n.prototype.setDecoderConfig=function(t){return this.decoderConfig=t,this},n.prototype.setWorkerLimit=function(t){return this.workerLimit=t,this},n.prototype.decodeDracoFile=function(t,e,r,i){var a={attributeIDs:r||Zo,attributeTypes:i||Yo,useUniqueIDs:!!r};this.decodeGeometry(t,a).then(e)},n.prototype.decodeGeometry=function(t,e){var r=this;e===void 0&&(e={attributeIDs:Zo,attributeTypes:Yo,useUniqueIDs:!1});for(var i in e.attributeTypes){var a=e.attributeTypes[i];a.BYTES_PER_ELEMENT!==void 0&&(e.attributeTypes[i]=a.name)}var o,s=this.workerNextTaskID++,l=t.byteLength,u=this._getWorker(s,l).then(function(d){return o=d,new Promise(function(f,A){o._callbacks[s]={resolve:f,reject:A},o.postMessage({type:"decode",id:s,taskConfig:e,buffer:t},[t])})}).then(function(d){return r._createGeometry(d.geometry)});return u.catch(function(){return!0}).then(function(){o&&s&&r._releaseTask(o,s)}),u},n.prototype._createGeometry=function(t){var e=new c.BufferGeometry;t.index&&e.setIndex(new c.BufferAttribute(t.index.array,1));for(var r=0;r<t.attributes.length;r++){var i=t.attributes[r],a=i.name,o=i.array,s=i.itemSize;e.setAttribute(a,new c.BufferAttribute(o,s))}return e},n.prototype._initDecoder=function(){var t=this;if(this.decoderPending)return this.decoderPending;var e=typeof WebAssembly!="object"||this.decoderConfig.type==="js";if(e){var r=xn(this.decoderPath+"draco_decoder.js",{responseType:"text"}).then(function(a){return a.body});this.decoderPending=r.then(function(a){var o=["/* draco decoder */",a,"","/* worker */",$o].join(`
|
|
418
|
-
`);t.workerSourceURL=URL.createObjectURL(new Blob([o]))})}else{var r=xn(this.decoderPath+"draco_wasm_wrapper.js",{responseType:"text"}).then(function(o){return o.body}),i=xn(this.decoderPath+"draco_decoder.wasm",{responseType:"arraybuffer"}).then(function(o){return o.body});this.decoderPending=Promise.all([r,i]).then(function(o){var s=o[0],l=o[1];t.decoderConfig.wasmBinary=l;var u=["/* draco decoder */",s,"","/* worker */"
|
|
419
|
-
`);t.workerSourceURL=URL.createObjectURL(new Blob([u]))})}return this.decoderPending},n.prototype._getWorker=function(t,e){var r=this;return this._initDecoder().then(function(){if(r.workerPool.length<r.workerLimit){var i=new Worker(r.workerSourceURL);i._callbacks={},i._taskCosts={},i._taskLoad=0,i.postMessage({type:"init",decoderConfig:r.decoderConfig}),i.onmessage=function(o){var s=o.data;switch(s.type){case"decode":i._callbacks[s.id].resolve(s);break;case"error":i._callbacks[s.id].reject(s);break;default:console.error('DRACO: Unexpected message, "'+s.type+'"')}},r.workerPool.push(i)}else r.workerPool.sort(function(o,s){return o._taskLoad>s._taskLoad?-1:1});var a=r.workerPool[r.workerPool.length-1];return a._taskCosts[t]=e,a._taskLoad+=e,a})},n.prototype._releaseTask=function(t,e){t._taskLoad-=t._taskCosts[e],delete t._callbacks[e],delete t._taskCosts[e]},n.prototype.dispose=function(){for(var t=0;t<this.workerPool.length;++t)this.workerPool[t].terminate();return this.workerPool.length=0,this},n}(),Mi=new
|
|
417
|
+
`,y0=[];function Fc(){var n=y0.pop();return n||new c.ShaderMaterial({uniforms:{map:{value:null},flipY:{value:0}},vertexShader:Rc,fragmentShader:kc,depthTest:!1,depthWrite:!1,stencilWrite:!1,blending:c.NoBlending,lights:!1,toneMapped:!1,fog:!1})}function Lc(n){n.uniforms.map.value=null,y0.push(n)}function Oc(n,t,e){var r=new c.Scene;r.matrixAutoUpdate=!1;var i=new c.Group;i.scale.set(1,1,-1),r.add(i);for(var a=[],o=0,s=n;o<s.length;o++){var l=s[o],u=Fc();a.push(u),u.uniforms.map.value=l.texture,u.uniforms.flipY.value=l.flipY?1:0;var d=new c.Group,f=new c.Mesh(Bc,u);f.position.set(l.position.x+l.size.x/2-.5,1-(l.position.y+l.size.y/2)-.5,-.5),f.scale.set(l.size.x,l.size.y,1),d.quaternion.copy(Pc[l.face]),d.add(f),i.add(d)}var A=e.autoClear;e.autoClear=!1;var m=new c.CubeCamera(.1,2,t);m.matrixAutoUpdate=!1,m.update(e,r),e.autoClear=A;for(var h=0,v=a;h<v.length;h++){var u=v[h];Lc(u)}}var Vc=function(){return!1}();function xi(){var n=Object.assign(document.createElementNS("http://www.w3.org/1999/xhtml","img"),{crossOrigin:"",close:function(){n.onerror=n.onload=n.close=z,n.decoding="async";var t=n.src;n.removeAttribute("src"),/^blob\:/.test(t)&&URL.revokeObjectURL(t)}});return n}function Ia(n){return new Promise(function(t,e){var r=xi();r.onload=function(){/^blob\:/.test(r.src)&&URL.revokeObjectURL(r.src),r.onload=r.onerror=z,setTimeout(function(){t(r)},10)},r.onerror=function(){var i=r.src;r.onload=r.onerror=z,r.close(),e(new Error("image load error: ".concat(i)))},r.src=URL.createObjectURL(n)})}var Do=[];function Nc(n,t){var e=Do.shift();if(e)return e.width=n,e.height=t,e;var r=Object.assign(document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),{close:function(){r.close=z,Do.push(r)}});return r}function zo(n,t){if(t&&(n.width>t.width||n.height>t.height)){var e=Nc(Math.min(n.width,t.width),Math.min(n.height,t.height)),r=e.getContext("2d");r.clearRect(0,0,e.width,e.height),r.drawImage(n,0,0,e.width,e.height),n.close();var i=new c.Texture(e);i.needsUpdate=!0,i.flipY=!0;var a=i.dispose;return i.dispose=function(){e.close(),a.call(i),i.dispose=a},i}else{var o=new c.Texture(n);o.needsUpdate=!0,typeof ImageBitmap!="undefined"&&n instanceof ImageBitmap?o.flipY=!1:o.flipY=!0;var s=o.dispose;return o.dispose=function(){n.close(),s.call(o),o.dispose=s},o}}function Dc(n){var t=new c.CubeTexture(n);t.needsUpdate=!0,t.flipY=!1;var e=t.dispose;return t.dispose=function(){for(var r=0,i=n;r<i.length;r++){var a=i[r];a.close()}e.call(t),t.dispose=e},t}var _r=["right","left","up","down","front","back"],De=function(){function n(t,e,r,i,a){this.tileTree=e,this.tileSources=r,this.options=i,this.renderer=a,this.name="",this.needsRender=!1,this.maxRequest=n.DEFAULT_MAX_REQUEST,this.disposed=!1,this.loadedCubeNodes=new Set,this.loadingCubeNodes=new Set,this.baseCubeTexture=null,this._cubeRenderTarget=null,this.textures=[],this.baseCubeTexture=t}return Object.defineProperty(n.prototype,"cubeRenderTarget",{get:function(){return this._cubeRenderTarget},set:function(t){var e,r,i,a,o,s;if(t===null)throw new Error("cannot set cubeRenderTarget to null.");t.width!==this.options.textureSize&&t.setSize(this.options.textureSize,this.options.textureSize),t.texture.format=(e=this.options.format)!==null&&e!==void 0?e:c.RGBAFormat,t.texture.minFilter=(r=this.options.minFilter)!==null&&r!==void 0?r:c.LinearFilter,t.texture.magFilter=(i=this.options.magFilter)!==null&&i!==void 0?i:c.LinearFilter,t.texture.wrapS=(a=this.options.wrapS)!==null&&a!==void 0?a:c.ClampToEdgeWrapping,t.texture.wrapT=(o=this.options.wrapT)!==null&&o!==void 0?o:c.ClampToEdgeWrapping,t.texture.generateMipmaps=(s=this.options.generateMipmaps)!==null&&s!==void 0?s:!0,this.baseCubeTexture&&(Sa(this.baseCubeTexture,t,this.renderer),this.baseCubeTexture.dispose(),this.baseCubeTexture=null),this._cubeRenderTarget&&Sa(this._cubeRenderTarget.texture,t,this.renderer),this._cubeRenderTarget=t},enumerable:!1,configurable:!0}),n.prototype.requestTile=function(t){var e=this,r,i,a,o,s,l,u=this.tileSources.filter(function(v){return v.level===t.level})[0];if(!u){this.loadedCubeNodes.add(t);return}var d=u.size,f=Math.pow(2,t.level)*t.position.y,A=Math.pow(2,t.level)*t.position.x,m="".concat(((a=(i=(r=this.options.imageURL)===null||r===void 0?void 0:r.options)===null||i===void 0?void 0:i.key)!==null&&a!==void 0?a:"pano.0").replace(/^pano/,"pano_tile"),".").concat(t.face,".").concat(t.level,".").concat(f,".").concat(A),h=F(F({},(s=(o=this.options.imageURL)===null||o===void 0?void 0:o.options)!==null&&s!==void 0?s:{key:"unknown"}),{key:m,size:u.scale>=1?void 0:d*t.size*u.scale,quality:void 0,cut:[d*t.position.x,d*t.position.y,d*t.size,d*t.size]});this.loadingCubeNodes.add(t),this.options.textureLoader.loadTexture(u[t.face],{imageURL:{transform:(l=this.options.imageURL)===null||l===void 0?void 0:l.transform,options:F({},h)},format:c.RGBAFormat,timeout:this.options.timeout,magFilter:this.options.magFilter,minFilter:this.options.minFilter,fetcher:this.options.fetcher}).then(function(v){if(e.disposed){v.body.dispose();return}e.textures.push({face:t.face,level:t.level,position:t.position,size:new c.Vector2(t.size,t.size),texture:v.body,flipY:!v.body.flipY}),e.loadedCubeNodes.add(t)}).catch(z).then(function(){e.disposed||e.loadingCubeNodes.delete(t)})},n.prototype.update=function(t,e){var r=this;if(!this.disposed){var i=[];$a(this.tileTree,function(f){if(!(i.length>r.maxRequest-r.loadingCubeNodes.size)){if(r.loadingCubeNodes.has(f)||f.level>e||!t.intersectsBox(f.box))return!1;if(!r.loadedCubeNodes.has(f))return i.push(f),!1}});for(var a=0,o=i;a<o.length;a++){var s=o[a];this.requestTile(s)}if(this.cubeRenderTarget&&this.textures.length){Oc(this.textures,this.cubeRenderTarget,this.renderer);for(var l=0,u=this.textures;l<u.length;l++){var d=u[l];d.texture.dispose()}this.textures.length=0,this.needsRender=!0}}},Object.defineProperty(n.prototype,"tilePending",{get:function(){return this.loadingCubeNodes.size},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"texture",{get:function(){if(!this._cubeRenderTarget)throw new Error("cubeRenderTarget never set.");return this._cubeRenderTarget.texture},enumerable:!1,configurable:!0}),n.prototype.dispose=function(){if(!this.disposed){this.disposed=!0,this.baseCubeTexture&&(this.baseCubeTexture.dispose(),this.baseCubeTexture=null),this.loadingCubeNodes.clear(),this.loadedCubeNodes.clear();for(var t=0,e=this.textures;t<e.length;t++){var r=e[t];r.texture.dispose()}this.textures.length=0}},n.DEFAULT_MAX_REQUEST=3,n}(),_n=function(){function n(){}return n.prototype.loadTexture=function(t,e,r,i,a,o){var s,l,u,d,f,A;r===void 0&&(r=z),i===void 0&&(i=z),a===void 0&&(a=z);var m={};typeof e.flipY!="undefined"&&(m.flipY=e.flipY),typeof e.format!="undefined"&&(m.format=e.format),typeof e.encoding!="undefined"&&(m.encoding=e.encoding),typeof e.generateMipmaps!="undefined"&&(m.generateMipmaps=e.generateMipmaps),m.minFilter=(s=e.minFilter)!==null&&s!==void 0?s:c.LinearFilter,m.magFilter=(l=e.magFilter)!==null&&l!==void 0?l:c.LinearFilter;var h=(d=(u=e.imageURL)===null||u===void 0?void 0:u.options)!==null&&d!==void 0?d:{key:"unknown"};t=bi(t,(f=e.imageURL)===null||f===void 0?void 0:f.transform,h);var v=Vo(t),y=(A=e.viaAjax)!==null&&A!==void 0?A:Vc,p=Oo(t),g=/^https?:/.test(v);if(p?y=!0:g||(y=!1),y){var x=null,b="blob";return e.fetcher.ajax(t,{timeout:e.timeout,responseType:b},void 0,void 0,a).then(function(M){return Ia(M.body)}).then(function(M){return zo(M,e.maxSize)}).then(function(M){return Object.assign(M,m),M}).then(function(M){var C={meta:x,body:M};return r(C),C}).catch(function(M){return i(M),Promise.reject(M)})}else{var w=null,E;return Promise.resolve().then(function(){return xi()}).then(function(M){return E=M,e.fetcher.loadImage(t,{timeout:e.timeout},void 0,void 0,a,M)}).then(function(M){return w=M.meta,zo(M.body,e.maxSize)}).then(function(M){return Object.assign(M,m),M}).then(function(M){var C={meta:w,body:M};return r(C),C}).catch(function(M){return E&&E.close(),i(M),Promise.reject(M)})}},n.prototype.loadCubeTexture=function(t,e,r,i,a,o){var s,l,u,d,f,A;r===void 0&&(r=z),i===void 0&&(i=z),a===void 0&&(a=z);var m={};typeof e.format!="undefined"&&(m.format=e.format),typeof e.generateMipmaps!="undefined"&&(m.generateMipmaps=e.generateMipmaps),m.minFilter=(s=e.minFilter)!==null&&s!==void 0?s:c.LinearFilter,m.magFilter=(l=e.magFilter)!==null&&l!==void 0?l:c.LinearFilter;for(var h=[t[_r[0]],t[_r[1]],t[_r[2]],t[_r[3]],t[_r[4]],t[_r[5]]],v=[],y=[0,0,0,0,0,0],p=[],g=function(b){var w=(d=(u=e.imageURL)===null||u===void 0?void 0:u.options)!==null&&d!==void 0?d:{key:"unknown"},E=bi(h[b],(f=e.imageURL)===null||f===void 0?void 0:f.transform,F(F({},w),{key:w.key+"."+_r[b]})),M=Vo(E),C=function(O){y[b]=O,a(y.reduce(function(D,N){return D+N},0)/6)},P=(A=e.viaAjax)!==null&&A!==void 0?A:!1,S=/^https?:$/.test(M),T=Oo(E);if(T?P=!0:S||(P=!1),P){var B="blob",L=e.fetcher.ajax(E,{timeout:e.timeout,responseType:B},void 0,void 0,C).then(function(O){return p[b]=O.meta,Ia(O.body)});v.push(L)}else{var k,L=Promise.resolve().then(function(){return xi()}).then(function(D){return k=D,e.fetcher.loadImage(E,{timeout:e.timeout},void 0,void 0,C,D)}).then(function(D){return p[b]=D.meta,D.body}).catch(function(D){return k&&k.close(),Promise.reject(D)});v.push(L)}},x=0;x<6;x++)g(x);return Promise.all(v).then(function(b){return Dc(b)}).then(function(b){return Object.assign(b,F({encoding:c.sRGBEncoding},m)),b}).then(function(b){var w={body:b,meta:p};return r(w),w}).catch(function(b){for(var w=0,E=v;w<E.length;w++){var M=E[w];M.then(function(C){return C.close()}).catch(z)}return i(b),Promise.reject(b)})},n.prototype.loadTiledCubeTexture=function(t,e,r,i,a,o,s){var l=this;return i===void 0&&(i=z),a===void 0&&(a=z),o===void 0&&(o=z),new Promise(function(u,d){var f,A;l.loadCubeTexture(t,{imageURL:{transform:(f=r.imageURL)===null||f===void 0?void 0:f.transform,options:(A=r.imageURL)===null||A===void 0?void 0:A.options},format:c.RGBAFormat,viaAjax:r.viaAjax,timeout:r.timeout,fetcher:r.fetcher,magFilter:r.magFilter,minFilter:r.minFilter,generateMipmaps:r.generateMipmaps},function(m){var h,v=m.meta,y=m.body,p=(h=r.tileMaxLevel)!==null&&h!==void 0?h:2,g=Math.max(1024*p,512),x=Ca(p),b=new De(y,x,e,{textureSize:g,textureLoader:l,imageURL:r.imageURL,magFilter:r.magFilter,minFilter:r.minFilter,generateMipmaps:r.generateMipmaps,timeout:r.timeout,fetcher:r.fetcher},s),w={meta:v,body:b};i(w),u(w)},function(m){a(m),d(m)},o,s).catch(z)})},n}();const zc=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("n\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{H0v{pyqr-Ip|zz|{K0v{pyqr-Iz|}untrl}nlrr\x07K0v{pyqr-Ixv{{v{tl}nlrr\x07K0v{pyqr-Iy|tqr}uosl}nlrr\x07K0v{pyqr-Ipyv}}v{tl}yn{rl}nlrr\x07K|vq-znv{56-\n--0v{pyqr-Ixv{onrlrr\x07K--0v{pyqr-Iortv{lrr\x07K--0v{pyqr-Iz|}untrlrr\x07K--0v{pyqr-Ixv{{v{tlrr\x07K--0v{pyqr-I}|wrplrr\x07K--0v{pyqr-Iy|tqr}uoslrr\x07K--0v{pyqr-Ipyv}}v{tl}yn{rlrr\x07K--d|yq]|vv|{-J-rpA5n{s|zrq9->;=6H--0vsqrs-b`RlV[`aN[PV[T----d|yq]|vv|{-J-v{n{prZnv\x07-7-d|yq]|vv|{H--0r{qvs--d|yq]|vv|{-J-z|qryZnv\x07-7-d|yq]|vv|{H--zn@-pnzrn_|nv|{Znv\x07-J-zn@5vrZnv\x07h=jh=j9-vrZnv\x07h>jh=j9-vrZnv\x07h?jh=j9-vrZnv\x07h=jh>j9-vrZnv\x07h>jh>j9-vrZnv\x07h?jh>j9-vrZnv\x07h=jh?j9-vrZnv\x07h>jh?j9-vrZnv\x07h?jh?j6H--PnzrnQvrpv|{-J-{|znyv r5pnzrn_|nv|{Znv\x07-7-rp@5=;=9-=;=9-:>;=66H--0v{pyqr-I|yq}|lrr\x07K--0v{pyqr-Is|tlrr\x07K\f"),Qc=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0qrsv{r-OYNPXlP\\Y\\_-rpA5=;=EC9-=;>=C9-=;>AF9->;=6{vs|z-nz}yrPor-}n{|=lzn}H{vs|z-znA-}n{|=lznv\x07H{vs|z-sy|n-}n{|=l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|=lyzv{n{prZn}H0r{qvs{vs|z-nz}yrPor-}n{|>lzn}H{vs|z-znA-}n{|>lznv\x07H{vs|z-sy|n-}n{|>l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|>lyzv{n{prZn}H0r{qvs{vs|z-sy|n-z|qryNy}unH{vs|z-sy|n-}|trH0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6--{vs|z-rp@-p|{n{P|y|H0r{qvsn\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{H{vs|z-sy|n-u|{Sy||V{qr\x07H{vs|z-rp?-r|yv|{H{vs|z-sy|n-}v\x07ry_nv|H{vs|z-sy|n-|}npv\bH{vs|z-sy|n-ovtu{rH0vs{qrs-SYNal`UNQRQ--n\bv{t-rp@-[|znyH0r{qvs0v{pyqr-Ip|zz|{K0v{pyqr-Iqvurv{tl}nlsntzr{K0v{pyqr-Is|tl}nlsntzr{K0v{pyqr-I}rpynzn}l}nlsntzr{K0v{pyqr-Iy|tqr}uosl}nlsntzr{K0v{pyqr-Ipyv}}v{tl}yn{rl}nlsntzr{Krp@- ||zcrp|5rp@-qvrpv|{9-rp@-rp|9-sy|n- ||z6-\n--sy|n-urn-J-q|5qvrpv|{9-rp|6H--rp@-q-J-qvrpv|{-7-urnH--rp@-}-J-rp|-:-qH--rp@-\0-J-}-7- ||zH--r{-{|znyv r5q-8-\x006H\f|vq-znv{56-\n--0v{pyqr-Ipyv}}v{tl}yn{rlsntzr{K--tylSntP|y|-J-rpA5>;=9->;=9->;=9-|}npv\b6H--<<-JJJ-纯色-JJJ--0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6----tylSntP|y|-J-rpA5p|{n{P|y|;9-p|{n{P|y|;t9-p|{n{P|y|;o9-|}npv\b6H--0r{qvs--<<-JJJJJJJJJJJ--<<-JJJ-全景图-JJJ--rp@-}n{|=a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|=lznv\x07h@j;\x07\b 6H--}n{|=a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|=a|crr\x079-}n{|=l ||z6H--}n{|=a|crr\x07-J-}n{|=a|crr\x07-7-zn@5}n{|=lznv\x076H--rp@-}n{|>a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|>lznv\x07h@j;\x07\b 6H--}n{|>a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|>a|crr\x079-}n{|>l ||z6H--}n{|>a|crr\x07-J-}n{|>a|crr\x07-7-zn@5}n{|>lznv\x076H--rpA-}n{|P|y|H--rpA-}n{|=P|y|-J-r\x07rPor5}n{|=lzn}9-}n{|=a|crr\x076H--rpA-}n{|>P|y|-J-r\x07rPor5}n{|>lzn}9-}n{|>a|crr\x076H--0vs-qrsv{rq5b`RlYbZV[N[PR6----}n{|=P|y|;n-J->;=-:-r\x07rPor5}n{|=lyzv{n{prZn}9-}n{|=a|crr\x076;H----}n{|>P|y|;n-J->;=-:-r\x07rPor5}n{|>lyzv{n{prZn}9-}n{|>a|crr\x076;H--0r{qvs--0vs-qrsv{rq5b`RlOYNPXla_N[`VaV\\[6----sy|n-oynpx]|tr-J-np|5:?;=-7-}|tr-8->;=6H----}n{|P|y|-J-zv\x075}n{|=P|y|9-OYNPXlP\\Y\\_9-zv{5>;=9-oynpx]|tr66H----}n{|P|y|-J-zv\x075}n{|P|y|9-}n{|>P|y|9-zn\x075=;=9-oynpx]|tr-:-?;=66H--0ryvs-qrsv{rq5b`Rl`]_RNQla_N[`VaV\\[6----rp?-prr{Pr{rP||q-J-r|yv|{-7-}v\x07ry_nv|-<-?;=H----sy|n-n{vv|{_nqv-J-qvn{pr5rp?5=;=9-=;=69-prr{Pr{rP||q6-7->;?H----sy|n-n{vv|{]|tr-J--qvn{pr5tylSntP||q;\x07\b9-prr{Pr{rP||q6-<-n{vv|{_nqvH----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-z||ur}5=;=9-=;?9-}|tr-:-n{vv|{]|tr66H--0ryr----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-}|tr6H--0r{qvs--tylSntP|y|-J-zv\x075}n{|P|y|9-tylSntP|y|9-z|qryNy}un6H--tylSntP|y|;n-J-|}npv\b-7-ovtu{rH--<<-JJJJJJJJJJJJJJJJ--0v{pyqr-Is|tlsntzr{K--0v{pyqr-I}rzyv}yvrqlny}unlsntzr{K--0v{pyqr-Iqvurv{tlsntzr{K\f"),Uc=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0vs-qrsv{rq5b`RlcR_aRelSY\\\\_6--nvor-sy|n-sy||H0ryr--{vs|z-sy|n-sy||H0r{qvsn\bv{t-sy|n-Sy||H0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvsnvor-sy|n-v_||sZnxHn\bv{t-sy|n-V_||sZnx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--PnzrnQvrpv|{-J-{|znyv r5pnzrn_|nv|{Znv\x07-7-rp@5=;=9-=;=9-:>;=66H--0vs-qrsv{rq5b`RlRQY6----Y|tQr}u-J-y|t?5:z]|vv|{; 6H--0r{qvs--V_||sZnx-J-v_||sZnxH--0v{pyqr-I|yq}|lrr\x07K--0v{pyqr-Ir{zn}lrr\x07K--0v{pyqr-Is|tlrr\x07K\f"),qc=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0qrsv{r-OYNPXlP\\Y\\_-rpA5=;=EC9-=;>=C9-=;>AF9->;=6{vs|z-nz}yrPor-}n{|=lzn}H{vs|z-znA-}n{|=lznv\x07H{vs|z-sy|n-}n{|=l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|=lyzv{n{prZn}H0r{qvs{vs|z-nz}yrPor-}n{|>lzn}H{vs|z-znA-}n{|>lznv\x07H{vs|z-sy|n-}n{|>l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|>lyzv{n{prZn}H0r{qvs{vs|z-sy|n-z|qryNy}unH{vs|z-sy|n-}|trH0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6--{vs|z-rp@-p|{n{P|y|H0r{qvsp-Pyv}}r-\n--znA-znv\x07V{rrH--sy|n-sy||V{qr\x07H\fH0vs-[bZlPYV]]R_`-K-=--{vs|z-Pyv}}r-pyv}}rh[bZlPYV]]R_`jH0r{qvs0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvsn\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{Hn\bv{t-sy|n-Sy||Hn\bv{t-sy|n-V_||sZnxH{vs|z-sy|n-u|{Sy||V{qr\x07H{vs|z-rp?-r|yv|{H{vs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v|{H----0}ntzn-{|yyly||}ln----s|-5-v{-v-J-=H-v-I-[bZlPYV]]R_`H-v-88-6-\n------pyv}}r]|vv|{-J-pyv}}rh-v-j;znv\x07V{rr-7-d|yq]|vv|{H------pyv}}rq-J-5pyv}}rh-v-j;sy||V{qr\x07-I-=;=-\v\v-no5Sy||-:-pyv}}rh-v-j;sy||V{qr\x076-I->;=6H------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\x07-K-:=;B-33-pyv}}r]|vv|{;\x07-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\b-K-:=;B-33-pyv}}r]|vv|{;\b-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{; -K-:=;B-33-pyv}}r]|vv|{; -I-=;BH------vs-5pyv}}rq6-\n--------qvpnqH------\f----\f----0}ntzn-{|yyly||}lr{q--0r{qvs--<<-JJJJJJJJJJJJJJJJJJ--0v{pyqr-Ipyv}}v{tl}yn{rlsntzr{K--rpA-qvssrP|y|-J-rpA5-qvssr9-|}npv\b-6H--0v{pyqr-Iy|tqr}uoslsntzr{K--0v{pyqr-Izn}lsntzr{K--0v{pyqr-Ip|y|lsntzr{K--0v{pyqr-Iny}unzn}lsntzr{K--0v{pyqr-Iny}unrlsntzr{K--0v{pyqr-I}rpynzn}lsntzr{K--_rsyrprqYvtu-rsyrprqYvtu-J-_rsyrprqYvtu5-rp@5-=;=-69-rp@5-=;=-69-rp@5-=;=-69-rp@5-=;=-6-6H--<<-nppzynv|{-5onxrq-v{qvrp-yvtuv{t-|{y\b6--0vsqrs-b`RlYVTUaZN]----rpA-yvtuZn}ar\x07ryJ-r\x07r?Q5-yvtuZn}9-b?-6H----rsyrprqYvtu;v{qvrpQvssr-8J-yvtuZn}ar\x07rya|Yv{rn5-yvtuZn}ar\x07ry-6;to-7-yvtuZn}V{r{v\bH--0ryr----rsyrprqYvtu;v{qvrpQvssr-8J-rp@5->;=-6H--0r{qvs--<<-z|qynv|{--0v{pyqr-In|zn}lsntzr{K--rsyrprqYvtu;v{qvrpQvssr-7J-qvssrP|y|;toH--rp@-|t|v{tYvtu-J-rsyrprqYvtu;v{qvrpQvssrH--0v{pyqr-Ir{zn}lsntzr{K--tylSntP|y|-J-rpA5-|t|v{tYvtu9-qvssrP|y|;n-6H--<<-JJJ-纯色-JJJ--0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6----tylSntP|y|-J-rpA5p|{n{P|y|;9-p|{n{P|y|;t9-p|{n{P|y|;o9-|}npv\b6H--0r{qvs--<<-JJJJJJJJJJJ--<<-JJJ-楼层显示-JJJ--sy|n-sy||\\}npv\b-J->;=H--vs-5u|{Sy||V{qr\x07-KJ-=;=-33-no5Sy||-:-u|{Sy||V{qr\x076-KJ->;=6-\n----sy||\\}npv\b-J-=;>-7-zv{55>;=-8-PnzrnQvrpv|{;\b69->;=6H--\f--tylSntP|y|;n-J-tylSntP|y|;n-7-sy||\\}npv\b-7-ovtu{rH--<<-JJJJJJJJJJJJJJ--0v{pyqr-I|{rzn}}v{tlsntzr{K--0v{pyqr-Ir{p|qv{tlsntzr{K--<<-JJJ-全景图-JJJ--rp@-}n{|=a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|=lznv\x07h@j;\x07\b 6H--}n{|=a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|=a|crr\x079-}n{|=l ||z6H--}n{|=a|crr\x07-J-}n{|=a|crr\x07-7-zn@5}n{|=lznv\x076H--rp@-}n{|>a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|>lznv\x07h@j;\x07\b 6H--}n{|>a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|>a|crr\x079-}n{|>l ||z6H--}n{|>a|crr\x07-J-}n{|>a|crr\x07-7-zn@5}n{|>lznv\x076H--rpA-}n{|P|y|H--rpA-}n{|=P|y|-J-r\x07rPor5}n{|=lzn}9-}n{|=a|crr\x076H--rpA-}n{|>P|y|-J-r\x07rPor5}n{|>lzn}9-}n{|>a|crr\x076H--0vs-qrsv{rq5b`RlYbZV[N[PR6----}n{|=P|y|;n-J->;=-:-r\x07rPor5}n{|=lyzv{n{prZn}9-}n{|=a|crr\x076;H----}n{|>P|y|;n-J->;=-:-r\x07rPor5}n{|>lyzv{n{prZn}9-}n{|>a|crr\x076;H--0r{qvs--0vs-qrsv{rq5b`RlOYNPXla_N[`VaV\\[6----sy|n-oynpx]|tr-J-np|5:?;=-7-}|tr-8->;=6H----}n{|P|y|-J-zv\x075}n{|=P|y|9-OYNPXlP\\Y\\_9-zv{5>;=9-oynpx]|tr66H----}n{|P|y|-J-zv\x075}n{|P|y|9-}n{|>P|y|9-zn\x075=;=9-oynpx]|tr-:-?;=66H--0ryvs-qrsv{rq5b`Rl`]_RNQla_N[`VaV\\[6----rp?-prr{Pr{rP||q-J-r|yv|{-7-}v\x07ry_nv|-<-?;=H----sy|n-n{vv|{_nqv-J-qvn{pr5rp?5=;=9-=;=69-prr{Pr{rP||q6-7->;?H----sy|n-n{vv|{]|tr-J-qvn{pr5tylSntP||q;\x07\b9-prr{Pr{rP||q6-<-n{vv|{_nqvH----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-z||ur}5=;=9-=;?9-}|tr-:-n{vv|{]|tr66H--0ryr----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-}|tr6H--0r{qvs--tylSntP|y|-J-zv\x075}n{|P|y|9-tylSntP|y|9-z|qryNy}un6H--<<-JJJJJJJJJJJJJ--0v{pyqr-Is|tlsntzr{K--0v{pyqr-I}rzyv}yvrqlny}unlsntzr{K--0v{pyqr-Iqvurv{tlsntzr{K--0vs-qrsv{rq5b`RlRQY6----tylSntP|y|;n-J-Y|tQr}uH--0r{qvs\f"),Hc=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCod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v{pyqr-Iy|tqr}uoslrr\x07K--0v{pyqr-Ipyv}}v{tl}yn{rlrr\x07K--cvr]|vv|{-J-:-z]|vv|{;\x07\b H--Sy||-J-sy||H--d|yq]|vv|{-J-rpA5n{s|zrq9->;=6H--0vsqrs-b`RlV[`aN[PV[T----d|yq]|vv|{-J-v{n{prZnv\x07-7-d|yq]|vv|{H--0r{qvs--d|yq]|vv|{-J-z|qryZnv\x07-7-d|yq]|vv|{H--zn@-pnzrn_|nv|{Znv\x07-J-zn@5vrZnv\x07h=jh=j9-vrZnv\x07h>jh=j9-vrZnv\x07h?jh=j9-vrZnv\x07h=jh>j9-vrZnv\x07h>jh>j9-vrZnv\x07h?jh>j9-vrZnv\x07h=jh?j9-vrZnv\x07h>jh?j9-vrZnv\x07h?jh?j6H--PnzrnQvrpv|{-J-{|znyv r5pnzrn_|nv|{Znv\x07-7-rp@5=;=9-=;=9-:>;=66H--0vs-qrsv{rq5b`RlRQY6----Y|tQr}u-J-y|t?5:z]|vv|{; 6H--0r{qvs--V_||sZnx-J-v_||sZnxH--0v{pyqr-I|yq}|lrr\x07K--0v{pyqr-Ir{zn}lrr\x07K--0v{pyqr-Iunq|zn}lrr\x07K--0v{pyqr-Is|tlrr\x07K\f"),Gc=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0qrsv{r-]U\\[T0qrsv{r-OYNPXlP\\Y\\_-rpA5=;=EC9-=;>=C9-=;>AF9->;=6{vs|z-nz}yrPor-}n{|=lzn}H{vs|z-znA-}n{|=lznv\x07H{vs|z-sy|n-}n{|=l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|=lyzv{n{prZn}H0r{qvs{vs|z-nz}yrPor-}n{|>lzn}H{vs|z-znA-}n{|>lznv\x07H{vs|z-sy|n-}n{|>l ||zH0v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l}nlsntzr{K0v{pyqr-Iunq|zn}l}nlsntzr{K0v{pyqr-Ioz}zn}l}nlsntzr{K0v{pyqr-I{|znyzn}l}nlsntzr{K0v{pyqr-I}rpynzn}l}nlsntzr{K0v{pyqr-Iy|tqr}uosl}nlsntzr{K0v{pyqr-Ipyv}}v{tl}yn{rl}nlsntzr{Krp@- ||zcrp|5rp@-qvrpv|{9-rp@-rp|9-sy|n- ||z6-\n--sy|n-urn-J-q|5qvrpv|{9-rp|6H--rp@-q-J-qvrpv|{-7-urnH--rp@-}-J-rp|-:-qH--rp@-\0-J-}-7- ||zH--r{-{|znyv r5q-8-\x006H\f|vq-znv{56-\n--<<-JJJ-顶部裁切-JJJ--sy|n-||sP]|tr-J-}|5pynz}5:PnzrnQvrpv|{;\b9-=;=9->;=69-@;=6H--vs-5----no5V_||sZnx-:->;=6-I-=;>-33----d|yq]|vv|{;\b-K-z|qryO|{qv{tZn\x07;\b-:-||sP]|tr-7-5z|qryO|{qv{tZn\x07;\b-:-z|qryO|{qv{tZv{;\b6--6-\n----qvpnqH--\f--<<-JJJJJJJJJJJJJJ--<<-JJJ-前置裁切计算-JJJ--0vs-[bZlPYV]]R_`-K-=----o||y-pyv}}rqH----rpA-pyv}}r]|vv|{H----0}ntzn-{|yyly||}ln----s|-5-v{-v-J-=H-v-I-[bZlPYV]]R_`H-v-88-6-\n------pyv}}r]|vv|{-J-pyv}}rh-v-j;znv\x07V{rr-7-d|yq]|vv|{H------pyv}}rq-J-5pyv}}rh-v-j;sy||V{qr\x07-I-=;=-\v\v-no5Sy||-:-pyv}}rh-v-j;sy||V{qr\x076-I->;=6H------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\x07-K-:=;B-33-pyv}}r]|vv|{;\x07-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\b-K-:=;B-33-pyv}}r]|vv|{;\b-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{; -K-:=;B-33-pyv}}r]|vv|{; -I-=;BH------vs-5pyv}}rq6-\n--------qvpnqH------\f----\f----0}ntzn-{|yyly||}lr{q--0r{qvs--<<-JJJJJJJJJJJJJJJJ--0v{pyqr-Ipyv}}v{tl}yn{rlsntzr{K--rpA-qvssrP|y|-J-rpA5-qvssr9-|}npv\b-6H--_rsyrprqYvtu-rsyrprqYvtu-J-_rsyrprqYvtu5-rp@5-=;=-69-rp@5-=;=-69-rp@5-=;=-69-rp@5-=;=-6-6H--rp@-|nyRzvvr_nqvn{pr-J-rzvvrH--0v{pyqr-Iy|tqr}uoslsntzr{K--0v{pyqr-Izn}lsntzr{K--0v{pyqr-Ip|y|lsntzr{K--0v{pyqr-Iny}unzn}lsntzr{K--0v{pyqr-Iny}unrlsntzr{K--0v{pyqr-I}rpynzn}lsntzr{K--0v{pyqr-I{|znylsntzr{lortv{K--0v{pyqr-I{|znylsntzr{lzn}K--0v{pyqr-Irzvvrzn}lsntzr{K--<<-nppzynv|{--0v{pyqr-Iyvtul}u|{tlsntzr{K--0v{pyqr-Iyvtulsntzr{lortv{K--0v{pyqr-Iyvtulsntzr{lzn}K--0v{pyqr-Iyvtulsntzr{lr{qK--<<-z|qynv|{--0v{pyqr-In|zn}lsntzr{K--rp@-|t|v{tYvtu-J-rsyrprqYvtu;qvrpQvssr-8-rsyrprqYvtu;v{qvrpQvssr-8-rsyrprqYvtu;qvrp`}rpyn-8-rsyrprqYvtu;v{qvrp`}rpyn-8-|nyRzvvr_nqvn{prH--0v{pyqr-Ir{zn}lsntzr{K--tylSntP|y|-J-rpA5-|t|v{tYvtu9-qvssrP|y|;n-6H--<<-JJJ-纯色-JJJ--0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6----tylSntP|y|-J-rpA5p|{n{P|y|;9-p|{n{P|y|;t9-p|{n{P|y|;o9-|}npv\b6H--0r{qvs--<<-JJJJJJJJJJJ--<<-JJJ-楼层显示-JJJ--sy|n-sy||\\}npv\b-J->;=H--vs-5u|{Sy||V{qr\x07-KJ-=;=-33-no5Sy||-:-u|{Sy||V{qr\x076-KJ->;=6-\n----sy||\\}npv\b-J-=;>-7-zv{55>;=-8-PnzrnQvrpv|{;\b69->;=6H--\f--tylSntP|y|;n-J-tylSntP|y|;n-7-sy||\\}npv\b-7-ovtu{rH--<<-JJJJJJJJJJJJJJ--0v{pyqr-I|{rzn}}v{tlsntzr{K--0v{pyqr-Ir{p|qv{tlsntzr{K--<<-JJJ-全景图-JJJ--rp@-}n{|=a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|=lznv\x07h@j;\x07\b 6H--}n{|=a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|=a|crr\x079-}n{|=l ||z6H--}n{|=a|crr\x07-J-}n{|=a|crr\x07-7-zn@5}n{|=lznv\x076H--rp@-}n{|>a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|>lznv\x07h@j;\x07\b 6H--}n{|>a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|>a|crr\x079-}n{|>l ||z6H--}n{|>a|crr\x07-J-}n{|>a|crr\x07-7-zn@5}n{|>lznv\x076H--rpA-}n{|P|y|H--rpA-}n{|=P|y|-J-r\x07rPor5}n{|=lzn}9-}n{|=a|crr\x076H--rpA-}n{|>P|y|-J-r\x07rPor5}n{|>lzn}9-}n{|>a|crr\x076H--0vs-qrsv{rq5b`RlYbZV[N[PR6----}n{|=P|y|;n-J->;=-:-r\x07rPor5}n{|=lyzv{n{prZn}9-}n{|=a|crr\x076;H----}n{|>P|y|;n-J->;=-:-r\x07rPor5}n{|>lyzv{n{prZn}9-}n{|>a|crr\x076;H--0r{qvs--0vs-qrsv{rq5b`RlOYNPXla_N[`VaV\\[6----sy|n-oynpx]|tr-J-np|5:?;=-7-}|tr-8->;=6H----}n{|P|y|-J-zv\x075}n{|=P|y|9-OYNPXlP\\Y\\_9-zv{5>;=9-oynpx]|tr66H----}n{|P|y|-J-zv\x075}n{|P|y|9-}n{|>P|y|9-zn\x075=;=9-oynpx]|tr-:-?;=66H--0ryvs-qrsv{rq5b`Rl`]_RNQla_N[`VaV\\[6----rp?-prr{Pr{rP||q-J-r|yv|{-7-}v\x07ry_nv|-<-?;=H----sy|n-n{vv|{_nqv-J-qvn{pr5rp?5=;=9-=;=69-prr{Pr{rP||q6-7->;?H----sy|n-n{vv|{]|tr-J-qvn{pr5tylSntP||q;\x07\b9-prr{Pr{rP||q6-<-n{vv|{_nqvH----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-z||ur}5=;=9-=;?9-}|tr-:-n{vv|{]|tr66H--0ryr----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-}|tr6H--0r{qvs--tylSntP|y|-J-zv\x075}n{|P|y|9-tylSntP|y|9-z|qryNy}un6H--<<-JJJJJJJJJJJJJJ--0v{pyqr-Is|tlsntzr{K--0v{pyqr-I}rzyv}yvrqlny}unlsntzr{K--0v{pyqr-Iqvurv{tlsntzr{K--0vs-qrsv{rq5b`RlRQY6----tylSntP|y|;n-J-Y|tQr}uH--0r{qvs\f");function Ft(n,t){var e=Math.abs(Math.cos(n.latitude)),r=-Math.sin(n.longitude)*e,i=-Math.sin(n.latitude),a=-Math.cos(n.longitude)*e;return t?t.set(r,i,a):new c.Vector3(r,i,a)}var Kc=1,jc=.1,Jc=2e3,ni=Math.PI*2,Qo=Math.PI/2;function Uo(n){return n>0&&n<=ni?n:(n%ni+ni)%ni}function Wc(n,t,e,r){e=Math.pow(e,4);for(var i=0;i<16;i++)r.elements[i]=n.elements[i]+(t.elements[i]-n.elements[i])*e;return r}var Fi=function(n){ue(t,n);function t(e,r,i,a,o,s,l){r===void 0&&(r=Kc),i===void 0&&(i=jc),a===void 0&&(a=Jc),o===void 0&&(o=new c.Vector2),s===void 0&&(s=new c.Vector2(512,512)),l===void 0&&(l=1);var u=n.call(this)||this;u.fov=e,u.aspect=r,u.near=i,u.far=a,u.perspToOrtho=o,u.resolution=s,u.pixelRatio=l,u.needsRender=!0,u.refineModel=!0,u.pose={longitude:0,latitude:0,fov:e,distance:0,offset:new c.Vector3},u.computePose(),u.perspectiveCamera=new c.PerspectiveCamera(u.fov,u.aspect,.001,u.far);var d=Math.max(u.orthoDistance,.01)*Math.tan(.5*u.fov/180*Math.PI),f=-.5*u.aspect*2*d;return u.orthographicCamera=new c.OrthographicCamera(f,-f,d,-d,.001,u.far),u.computeProjectionMatrix(),u.lastValues={position:u.position.clone(),quaternion:u.quaternion.clone(),scale:u.scale.clone(),fov:u.fov,aspect:u.aspect,near:u.near,far:u.far,orthoDistance:u.orthoDistance,perspToOrtho:u.perspToOrtho.clone()},u.type=u.perspToOrtho.x<1?"PerspectiveCamera":"OrthographicCamera",u}return Object.defineProperty(t.prototype,"orthoDistance",{get:function(){return this.pose.distance>1?this.pose.distance:1+(this.pose.distance-1)*this.perspToOrtho.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"zoom",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.zoom:this.type==="PerspectiveCamera"?this.perspectiveCamera.zoom:1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.top:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.bottom:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.left:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.right:0},enumerable:!1,configurable:!0}),t.prototype.getDirection=function(e){return Ft(this.pose,e)},t.prototype.computePose=function(e){e===void 0&&(e=0),this.updateMatrix();var r=this.matrix.elements,i=new c.Vector3().set(-r[8],-r[9],-r[10]).normalize();this.pose.longitude=Uo(-Math.atan2(i.x,-i.z)),this.pose.latitude=-Math.asin(i.y/1),this.pose.fov=this.fov,this.pose.distance=e;var a=new c.Vector3().add(this.position).add(i.clone().setLength(this.pose.distance));return this.pose.offset.copy(a),this},t.prototype.setFromPose=function(e){var r,i,a,o,s,l=Uo((r=e.longitude)!==null&&r!==void 0?r:this.pose.longitude),u=Math.max(-Qo+1e-4,Math.min(Qo-1e-4,(i=e.latitude)!==null&&i!==void 0?i:this.pose.latitude)),d=(a=e.fov)!==null&&a!==void 0?a:this.pose.fov,f=(o=e.distance)!==null&&o!==void 0?o:this.pose.distance,A=(s=e.offset)!==null&&s!==void 0?s:this.pose.offset,m=Ft({longitude:l,latitude:u}).normalize();return this.position.set(0,0,0),this.lookAt(m),this.position.add(A).sub(m.clone().setLength(f)),this.fov!==d&&(this.fov=d,this.updateProjectionMatrix()),this.updateMatrixWorld(),this.pose.longitude=l,this.pose.latitude=u,this.pose.fov=d,this.pose.distance=f,this.pose.offset.copy(A),this.needsRender=!0,this},t.prototype.copyPose=function(){return{longitude:this.pose.longitude,latitude:this.pose.latitude,fov:this.pose.fov,distance:this.pose.distance,offset:this.pose.offset.clone()}},t.prototype.computeProjectionMatrix=function(){Wc(this.orthographicCamera.projectionMatrix,this.perspectiveCamera.projectionMatrix,1-this.perspToOrtho.x,this.projectionMatrix),this.projectionMatrixInverse.getInverse(this.projectionMatrix),this.needsRender=!0},t.prototype.setViewOffset=function(e,r,i,a,o,s){this.perspectiveCamera.setViewOffset(e,r,i,a,o,s),this.orthographicCamera.setViewOffset(e,r,i,a,o,s),this.computeProjectionMatrix()},t.prototype.clearViewOffset=function(){this.perspectiveCamera.clearViewOffset(),this.orthographicCamera.clearViewOffset(),this.computeProjectionMatrix()},t.prototype.updateProjectionMatrix=function(){this.perspectiveCamera.updateProjectionMatrix(),this.orthographicCamera.updateProjectionMatrix(),this.computeProjectionMatrix()},Object.defineProperty(t.prototype,"perspectiveProjectionMatrix",{get:function(){return this.perspectiveCamera.projectionMatrix},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"perspectiveProjectionMatrixInverse",{get:function(){return this.perspectiveCamera.projectionMatrixInverse},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"orthographicProjectionMatrix",{get:function(){return this.orthographicCamera.projectionMatrix},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"orthographicProjectionMatrixInverse",{get:function(){return this.orthographicCamera.projectionMatrixInverse},enumerable:!1,configurable:!0}),t.prototype.updateTime=function(e,r){var i=!1;if((this.lastValues.fov!==this.fov||this.lastValues.near!==this.near||this.lastValues.far!==this.far||this.lastValues.aspect!==this.aspect)&&(this.perspectiveCamera.fov=this.fov,this.perspectiveCamera.near=this.near,this.perspectiveCamera.far=this.far,this.perspectiveCamera.aspect=this.aspect,this.perspectiveCamera.updateProjectionMatrix(),i=!0),!this.lastValues.position.equals(this.position)||!this.lastValues.quaternion.equals(this.quaternion)||!this.lastValues.scale.equals(this.scale)||!this.lastValues.perspToOrtho.equals(this.perspToOrtho)||this.lastValues.fov!==this.fov||this.lastValues.near!==this.near||this.lastValues.far!==this.far||this.lastValues.orthoDistance!==this.orthoDistance||this.lastValues.aspect!==this.aspect){var a=Math.max(this.orthoDistance,.01)*Math.tan(.5*this.fov/180*Math.PI),o=-.5*this.aspect*2*a;this.orthographicCamera.left=o,this.orthographicCamera.right=-o,this.orthographicCamera.top=a,this.orthographicCamera.bottom=-a,this.orthographicCamera.near=this.near,this.orthographicCamera.far=this.far,this.orthographicCamera.updateProjectionMatrix(),i=!0}i&&this.computeProjectionMatrix(),this.lastValues.position.copy(this.position),this.lastValues.quaternion.copy(this.quaternion),this.lastValues.scale.copy(this.scale),this.lastValues.fov=this.fov,this.lastValues.aspect=this.aspect,this.lastValues.near=this.near,this.lastValues.far=this.far,this.lastValues.orthoDistance=this.orthoDistance,this.lastValues.perspToOrtho.copy(this.perspToOrtho),this.type=this.perspToOrtho.x<1?"PerspectiveCamera":"OrthographicCamera"},Object.defineProperty(t.prototype,"isPerspectiveCamera",{get:function(){return this.perspToOrtho.x<1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isOrthographicCamera",{get:function(){return this.perspToOrtho.x>=1},enumerable:!1,configurable:!0}),t.prototype.copy=function(e,r){return n.prototype.copy.call(this,e,r),this.fov=e.fov,this.aspect=e.aspect,this.near=e.near,this.far=e.far,this.perspToOrtho.copy(e.perspToOrtho),this.updateTime(Me(),0),this},t}(c.Camera),Xc=new c.Vector4,jn=new c.WebGLCubeRenderTarget(1).texture;jn.name="EMPTY_TEXTURE";var Ji={modelAlpha:new c.Uniform(0),progress:new c.Uniform(0),pano0_map:new c.Uniform(jn),pano0_luminanceMap:new c.Uniform(null),pano0_matrix:new c.Uniform(new c.Matrix4),pano0_zoom:new c.Uniform(1),pano1_map:new c.Uniform(jn),pano1_luminanceMap:new c.Uniform(null),pano1_matrix:new c.Uniform(new c.Matrix4),pano1_zoom:new c.Uniform(1),clippers:new c.Uniform([]),shownFloorIndex:new c.Uniform(-1),constantColor:new c.Uniform(null),geometricError:new c.Uniform(0),pixelRatio:new c.Uniform(1),resolution:new c.Uniform(new c.Vector2(512,512)),floor:new c.Uniform(0),brightness:new c.Uniform(1),modelBoundingMin:new c.Uniform(new c.Vector3),modelBoundingMax:new c.Uniform(new c.Vector3)},_c={none:{vertexShader:zc,fragmentShader:Qc,uniforms:c.UniformsUtils.merge([Ji,{opacity:{value:1}},c.UniformsLib.fog]),lights:!1},basic:{vertexShader:Uc,fragmentShader:qc,uniforms:c.UniformsUtils.merge([Ji,c.ShaderLib.basic.uniforms]),lights:!1},phong:{vertexShader:Hc,fragmentShader:Gc,uniforms:c.UniformsUtils.merge([Ji,c.ShaderLib.phong.uniforms]),lights:!0}},Tn=function(n){ue(t,n);function t(e,r){e===void 0&&(e="basic"),r===void 0&&(r={});var i=this,a,o,s,l,u,d,f,A,m,h,v,y,p,g,x,b,w,E,M,C,P,S=_c[e];i=n.call(this,{vertexShader:S.vertexShader,fragmentShader:S.fragmentShader,uniforms:c.UniformsUtils.clone(S.uniforms),lights:S.lights,defines:{USE_CONSTANT_COLOR:!1,USE_EDL:!1,USE_HQ_WEIGHT:!1,USE_HQ_DEPTH:!1,NUM_CLIPPING_BOX:!1,USE_CLIPFLOOR:!1,USE_VERTEX_FLOOR:!1,USE_LUMINANCE:!1,USE_PANO_OPACITY:!1,USE_BLACK_TRANSITION:!1,USE_SPREAD_TRANSITION:!1,USE_POINT_NORMAL:!1,USE_POINT_CIRCLE:!1,USE_POINT_ADAPTIVE_SIZE:!1,USE_POINT_COLOR_ALTITUDE:!1}})||this,i.shaderType=e,i.color=new c.Color(16777215),i.map=null,i.lightMap=null,i.lightMapIntensity=1,i.aoMap=null,i.aoMapIntensity=1,i.specularMap=null,i.specular=new c.Color(1118481),i.alphaMap=null,i.envMap=null,i.reflectivity=1,i.refractionRatio=.98,i.emissiveMap=null,i.emissive=new c.Color(0),i.emissiveIntensity=1,i.bumpMap=null,i.bumpScale=1,i.normalMap=null,i.normalMapType=c.TangentSpaceNormalMap,i.normalScale=new c.Vector2(1,1),i.displacementMap=null,i.displacementScale=1,i.displacementBias=0,i.shininess=30;var T,B=null,L=null;return Object.defineProperties(i,{pano0:{get:function(){return B},set:function(k){if(B!==k){B=k,k===null?(this.uniforms.pano0_map.value=jn,this.uniforms.pano0_luminanceMap.value=null,this.uniforms.pano0_matrix.value.identity(),this.uniforms.pano0_zoom.value=1):(this.uniforms.pano0_map.value=k.map instanceof De?k.map.texture:k.map,this.uniforms.pano0_luminanceMap.value=k.luminanceMap instanceof De?k.luminanceMap.texture:k.luminanceMap,this.uniforms.pano0_matrix.value.copy(k.matrix),this.uniforms.pano0_zoom.value=k.zoom);var O=this.uniforms.pano0_luminanceMap.value!==null&&this.uniforms.pano1_luminanceMap.value!==null,D=this.defines.USE_LUMINANCE;D!==O&&(this.defines.USE_LUMINANCE=O,this.needsUpdate=!0)}}},pano1:{get:function(){return L},set:function(k){if(L!==k){L=k,k===null?(this.uniforms.pano1_map.value=jn,this.uniforms.pano1_luminanceMap.value=null,this.uniforms.pano1_matrix.value.identity(),this.uniforms.pano1_zoom.value=1):(this.uniforms.pano1_map.value=k.map instanceof De?k.map.texture:k.map,this.uniforms.pano1_luminanceMap.value=k.luminanceMap instanceof De?k.luminanceMap.texture:k.luminanceMap,this.uniforms.pano1_matrix.value.copy(k.matrix),this.uniforms.pano1_zoom.value=k.zoom);var O=this.uniforms.pano0_luminanceMap.value!==null&&this.uniforms.pano1_luminanceMap.value!==null,D=this.defines.USE_LUMINANCE;D!==O&&(this.defines.USE_LUMINANCE=O,this.needsUpdate=!0)}}},modelAlpha:{get:function(){return this.uniforms.modelAlpha.value},set:function(k){this.uniforms.modelAlpha.value=k}},progress:{get:function(){return this.uniforms.progress.value},set:function(k){this.uniforms.progress.value=k}},transition:{get:function(){return this.defines.USE_BLACK_TRANSITION?"BLACK":this.defines.USE_SPREAD_TRANSITION?"SPREAD":"FADE"},set:function(k){var O=this.defines.USE_BLACK_TRANSITION,D=this.defines.USE_SPREAD_TRANSITION;this.defines.USE_BLACK_TRANSITION=!1,this.defines.USE_SPREAD_TRANSITION=!1,this.defines["USE_".concat(k,"_TRANSITION")]=!0;var N=!1;O!==this.defines.USE_BLACK_TRANSITION&&(N=!0),D!==this.defines.USE_SPREAD_TRANSITION&&(N=!0),N&&(this.needsUpdate=!0)}},constantColor:{get:function(){return this.uniforms.constantColor.value},set:function(k){this.uniforms.constantColor.value=k;var O=this.defines.USE_CONSTANT_COLOR,D=k!==null;O!==D&&(this.defines.USE_CONSTANT_COLOR=D,this.needsUpdate=!0)}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(k){this.uniforms.opacity.value=k}},shownFloorIndex:{get:function(){return this.uniforms.shownFloorIndex.value},set:function(k){this.uniforms.shownFloorIndex.value=k}},brightness:{get:function(){return this.uniforms.brightness.value},set:function(k){this.uniforms.brightness.value=k}},clippers:{get:function(){return T},set:function(k){T!==k&&(T=k,this.uniforms.clippers.value=(T||[]).map(function(O){var D=typeof O.floorIndex=="number"?O.floorIndex:-1,N=new c.Matrix4().getInverse(O.clippingBoxMatrix);return{matrixInverse:N,floorIndex:D}}),this.needsUpdate=!0)}},useEDL:{get:function(){return this.defines.USE_EDL},set:function(k){k!==this.defines.USE_EDL&&(this.defines.USE_EDL=k,this.needsUpdate=!0)}},useHQWeight:{get:function(){return this.defines.USE_HQ_WEIGHT},set:function(k){k!==this.defines.USE_HQ_WEIGHT&&(this.defines.USE_HQ_WEIGHT=k,this.needsUpdate=!0)}},useHQDepth:{get:function(){return this.defines.USE_HQ_DEPTH},set:function(k){k!==this.defines.USE_HQ_DEPTH&&(this.defines.USE_HQ_DEPTH=k,this.needsUpdate=!0)}},floor:{get:function(){return this.uniforms.floor.value},set:function(k){this.uniforms.floor.value=k}}}),i.pano0=(a=r.pano0)!==null&&a!==void 0?a:Ee.pano0,i.pano1=(o=r.pano1)!==null&&o!==void 0?o:Ee.pano1,i.modelAlpha=(s=r.modelAlpha)!==null&&s!==void 0?s:Ee.modelAlpha,i.progress=(l=r.progress)!==null&&l!==void 0?l:Ee.progress,i.transition=(u=r.transition)!==null&&u!==void 0?u:Ee.transition,i.constantColor=(d=r.constantColor)!==null&&d!==void 0?d:Ee.constantColor,i.opacity=(f=r.opacity)!==null&&f!==void 0?f:Ee.opacity,i.shownFloorIndex=(A=r.shownFloorIndex)!==null&&A!==void 0?A:Ee.shownFloorIndex,i.clippers=(m=r.clippers)!==null&&m!==void 0?m:Ee.clippers,i.useEDL=(h=r.useEDL)!==null&&h!==void 0?h:Ee.useEDL,i.useHQWeight=(v=r.useHQWeight)!==null&&v!==void 0?v:Ee.useHQWeight,i.useHQDepth=(y=r.useHQDepth)!==null&&y!==void 0?y:Ee.useHQDepth,i.pointSize=(p=r.pointSize)!==null&&p!==void 0?p:Ee.pointSize,i.pointColor=(g=r.pointColor)!==null&&g!==void 0?g:Ee.pointColor,i.pointShape=(x=r.pointShape)!==null&&x!==void 0?x:Ee.pointShape,i.pointScale=(b=r.pointScale)!==null&&b!==void 0?b:Ee.pointScale,i.pointBack=(w=r.pointBack)!==null&&w!==void 0?w:Ee.pointBack,i.pointMinPixel=(E=r.pointMinPixel)!==null&&E!==void 0?E:Ee.pointMinPixel,i.pointMaxPixel=(M=r.pointMaxPixel)!==null&&M!==void 0?M:Ee.pointMaxPixel,i.gradientTexture=(C=r.gradientTexture)!==null&&C!==void 0?C:Ee.gradientTexture,i.brightness=(P=r.brightness)!==null&&P!==void 0?P:Ee.brightness,i.floor=0,i}return t.prototype.onBeforeCompile=function(e,r){var i,a,o=String((a=(i=this.clippers)===null||i===void 0?void 0:i.length)!==null&&a!==void 0?a:0);e.vertexShader=e.vertexShader.replace(/NUM_CLIPPERS/g,o),e.fragmentShader=e.fragmentShader.replace(/NUM_CLIPPERS/g,o)},t.prototype.refreshUniforms=function(e){var r,i,a=this.uniforms;a.diffuse&&a.diffuse.value.copy(this.color),a.opacity&&(a.opacity.value=this.opacity),a.color&&a.diffuse.value.copy(this.color),a.emissive&&a.emissive.value.copy(this.emissive).multiplyScalar(this.emissiveIntensity),a.map&&(a.map.value=this.map),a.alphaMap&&(a.alphaMap.value=this.alphaMap),a.specularMap&&(a.specularMap.value=this.specularMap),a.envMap&&(a.envMap.value=this.envMap,a.flipEnvMap.value=!((r=this.envMap)===null||r===void 0)&&r.isCubeTexture?-1:1,a.reflectivity.value=this.reflectivity,a.refractionRatio.value=this.refractionRatio,a.maxMipLevel.value=this.envMap&&(i=e.properties.get(this.envMap).__maxMipLevel)!==null&&i!==void 0?i:0),a.lightMap&&(a.lightMap.value=this.lightMap,a.lightMapIntensity.value=this.lightMapIntensity),a.aoMap&&(a.aoMap.value=this.aoMap,a.aoMapIntensity.value=this.aoMapIntensity),a.specular&&a.specular.value.copy(this.specular),a.shininess&&(a.shininess.value=Math.max(this.shininess,1e-4)),a.emissiveMap&&(a.emissiveMap.value=this.emissiveMap),a.bumpMap&&(a.bumpMap.value=this.bumpMap,a.bumpScale.value=this.bumpScale,this.side===c.BackSide&&(a.bumpScale.value*=-1)),a.normalMap&&(a.normalMap.value=this.normalMap,a.normalScale.value.copy(this.normalScale),this.side===c.BackSide&&a.normalScale.value.negate()),a.displacementMap&&(a.displacementMap.value=this.displacementMap,a.displacementScale.value=this.displacementScale,a.displacementBias.value=this.displacementBias);var o;this.map?o=this.map:this.specularMap?o=this.specularMap:this.displacementMap?o=this.displacementMap:this.normalMap?o=this.normalMap:this.bumpMap?o=this.bumpMap:this.alphaMap?o=this.alphaMap:this.emissiveMap&&(o=this.emissiveMap),o!==void 0&&(o.matrixAutoUpdate===!0&&o.updateMatrix(),a.uvTransform.value.copy(o.matrix));var s;this.aoMap?s=this.aoMap:this.lightMap&&(s=this.lightMap),s!==void 0&&(s.matrixAutoUpdate===!0&&s.updateMatrix(),a.uv2Transform.value.copy(s.matrix))},t.prototype.update=function(e,r){if(this.refreshUniforms(e),this.transparent=!1,this.shownFloorIndex>-1&&(this.defines.USE_VERTEX_FLOOR?this.transparent=!0:this.transparent=this.shownFloorIndex!==this.floor),this.opacity<1&&(this.transparent=!0),this.alphaMap&&(this.transparent=!0),this.brightness<1&&(this.transparent=!0),this.blending=this.transparent?c.NormalBlending:c.NoBlending,r instanceof Fi)this.uniforms.pixelRatio.value=r.pixelRatio,this.uniforms.resolution.value.copy(r.resolution);else{this.uniforms.pixelRatio.value=e.getPixelRatio();var i=e.getViewport(Xc);this.uniforms.resolution.value.set(i.z,i.w)}},t.prototype.syncModel=function(e){var r="".concat(e.id,":").concat(e.materialVersion);r!==this.syncModelVersion&&(Object.assign(this,e.getMaterial()),this.uniforms.modelBoundingMax.value.copy(e.bounding.max),this.uniforms.modelBoundingMin.value.copy(e.bounding.min),this.syncModelVersion=r)},t.prototype.copy=function(e){return n.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.specular.copy(e.specular),this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.emissiveMap=e.emissiveMap,this.emissive.copy(e.emissive),this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.shininess=e.shininess,this.pano0=e.pano0,this.pano1=e.pano1,this.modelAlpha=e.modelAlpha,this.progress=e.progress,this.transition=e.transition,this.opacity=e.opacity,this.constantColor=e.constantColor,this.shownFloorIndex=e.shownFloorIndex,this.brightness=e.brightness,this.clippers=e.clippers,this.useEDL=e.useEDL,this.useHQWeight=e.useHQWeight,this.useHQDepth=e.useHQDepth,this.pointColor=e.pointColor,this.pointSize=e.pointSize,this.pointShape=e.pointShape,this.pointScale=e.pointScale,this.pointBack=e.pointBack,this.pointMinPixel=e.pointMinPixel,this.pointMaxPixel=e.pointMaxPixel,this.gradientTexture=e.gradientTexture,this.floor=e.floor,this},t}(c.ShaderMaterial),Yr=function(n){ue(t,n);function t(e){var r=e.preserveDrawingBuffer,i=r===void 0?!0:r,a=e.premultipliedAlpha,o=a===void 0?!0:a,s=e.stencil,l=s===void 0?!0:s,u=e.backgroundColor,d=u===void 0?1579548:u,f=e.backgroundAlpha,A=f===void 0?1:f,m=e.pixelRatio,h=m===void 0?1:m,v=e.antialias,y=e.webgl2,p=e.logarithmicDepthBuffer,g=e.precision,x=this,b={antialias:v,alpha:!0,depth:!0,preserveDrawingBuffer:i,stencil:l,premultipliedAlpha:o,powerPreference:"high-performance"},w={logarithmicDepthBuffer:p,precision:g};if(y){var E=document.createElement("canvas"),M=E.getContext("webgl2",b);M?x=n.call(this,F(F(F({},b),w),{antialias:!0,canvas:E,context:M}))||this:(console.error("error occurred when getting webgl2 canvas context, mybe webgl2 not support, fallback to webgl."),x=n.call(this,F(F({},b),w))||this)}else x=n.call(this,F(F({},b),w))||this;return x.setPixelRatio(h),x.setClearColor(d,A),x.outputEncoding=c.sRGBEncoding,x.autoClear=!0,x}return t}(c.WebGLRenderer),b0=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.add=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return n.prototype.add.apply(this,e)},t.prototype.remove=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return n.prototype.remove.apply(this,e)},t}(c.Scene),ht;(function(n){n[n.Outside=-1]="Outside",n[n.Intersecting=0]="Intersecting",n[n.Inside=1]="Inside"})(ht||(ht={}));var x0=1e-6,qe=new c.Vector3,Qr=new c.Matrix4,Br=new c.Vector3,Rr=new c.Vector3,kr=new c.Vector3,Ta=new c.Vector3,Wi=new c.Box3,Xi=new c.Sphere,qo=new c.Matrix4,_i=new c.Ray,dt=new c.Object3D,Ho=new c.Frustum;function w0(n,t){var e=n.elements;return t.setFromRotationMatrix(Qr.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1)),t}var Qn=function(){function n(t){t===void 0&&(t=[]),this.planes=t}return Object.defineProperty(n,"MASK_OUTSIDE",{get:function(){return 4294967295},enumerable:!1,configurable:!0}),Object.defineProperty(n,"MASK_INSIDE",{get:function(){return 0},enumerable:!1,configurable:!0}),Object.defineProperty(n,"MASK_INDETERMINATE",{get:function(){return 2147483647},enumerable:!1,configurable:!0}),n.prototype.setFromFrustum=function(t){return this.planes=t.planes.map(function(e){return e.clone()}),this},n.prototype.setFromCamera=function(t){return Qr.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),Ho.setFromProjectionMatrix(Qr),this.setFromFrustum(Ho),this},n.prototype.applyMatrix4=function(t){for(var e=0,r=this.planes;e<r.length;e++){var i=r[e];i.applyMatrix4(t)}},n.prototype.copy=function(t){return this.planes=t.planes.map(function(e){return e.clone()}),this},n.prototype.clone=function(){return new n().copy(this)},n.prototype.computeVisibility=function(t){for(var e=ht.Inside,r=0,i=this.planes;r<i.length;r++){var a=i[r],o=t.intersectPlane(a);switch(o){case ht.Outside:return ht.Outside;case ht.Intersecting:e=ht.Intersecting;break}}return e},n.prototype.computeVisibilityWithPlaneMask=function(t,e){if(e===n.MASK_OUTSIDE||e===n.MASK_INSIDE)return e;for(var r=n.MASK_INSIDE,i=Math.min(32,this.planes.length),a=0;a<i;++a){var o=1<<a;if(e&o){var s=this.planes[a],l=t.intersectPlane(s);if(l===ht.Outside)return n.MASK_OUTSIDE;l===ht.Intersecting&&(r|=o)}}return r},n}(),E0=function(){function n(){this.type="box",this.center=new c.Vector3,this.halfSize=new c.Vector3,this.rotation=new c.Matrix3}return n.prototype.fromJson=function(t){var e=t.box;this.center.set(e[0],e[1],e[2]);var r=e[3],i=e[4],a=e[5],o=e[6],s=e[7],l=e[8],u=e[9],d=e[10],f=e[11],A=Math.sqrt(r*r+i*i+a*a),m=Math.sqrt(o*o+s*s+l*l),h=Math.sqrt(u*u+d*d+f*f);this.halfSize.set(A,m,h);var v=this.halfSize.toArray().reduce(function(y,p){return y+p},0);return(isNaN(v)||v<=0)&&this.halfSize.setScalar(x0),this.rotation.fromArray([r/A,i/A,a/A,o/m,s/m,l/m,u/h,d/h,f/h]),isNaN(this.rotation.toArray().reduce(function(y,p){return y+p},0))&&this.rotation.identity(),this},n.prototype.toJson=function(){return this.rotation.extractBasis(Br,Rr,kr),{box:bt(bt(bt(bt([],this.center.toArray(),!0),Br.multiplyScalar(this.halfSize.x).toArray(),!0),Rr.multiplyScalar(this.halfSize.y).toArray(),!0),kr.multiplyScalar(this.halfSize.z).toArray(),!0)}},n.prototype.copy=function(t){return this.center.copy(t.center),this.halfSize.copy(t.halfSize),this.rotation.copy(t.rotation),this},n.prototype.clone=function(){return new n().copy(this)},n.prototype.applyMatrix4=function(t){return dt.position.copy(this.center),w0(this.rotation,dt.quaternion),dt.scale.copy(this.halfSize),dt.matrix.compose(dt.position,dt.quaternion,dt.scale),dt.matrix.premultiply(t),dt.matrix.decompose(dt.position,dt.quaternion,dt.scale),this.center.copy(dt.position),this.rotation.setFromMatrix4(Qr.makeRotationFromQuaternion(dt.quaternion)),this.halfSize.copy(dt.scale),this},n.prototype.getCenter=function(t){return t.copy(this.center)},n.prototype.distanceSquaredToPoint=function(t){var e=this.rotation.elements,r=t.x-this.center.x,i=t.y-this.center.y,a=t.z-this.center.z,o=0,s;return s=r*e[0]+i*e[1]+a*e[2],s<0&&(s=-s),s-=this.halfSize.x,s>0&&(o+=s*s),s=r*e[3]+i*e[4]+a*e[5],s<0&&(s=-s),s-=this.halfSize.y,s>0&&(o+=s*s),s=r*e[6]+i*e[7]+a*e[8],s<0&&(s=-s),s-=this.halfSize.z,s>0&&(o+=s*s),o},n.prototype.distanceToPoint=function(t){return Math.sqrt(this.distanceSquaredToPoint(t))},n.prototype.distanceToPlane=function(t){var e=t.projectPoint(this.center,new c.Vector3);return this.distanceToPoint(e)},n.prototype.getBoundingBox=function(t){return t.makeEmpty(),this.rotation.extractBasis(Br,Rr,kr),Br.setLength(this.halfSize.x),Rr.setLength(this.halfSize.y),kr.setLength(this.halfSize.z),t.expandByPoint(qe.copy(this.center).add(Br)),t.expandByPoint(qe.copy(this.center).sub(Br)),t.expandByPoint(qe.copy(this.center).add(Rr)),t.expandByPoint(qe.copy(this.center).sub(Rr)),t.expandByPoint(qe.copy(this.center).add(kr)),t.expandByPoint(qe.copy(this.center).sub(kr)),t},n.prototype.toGeometry=function(){var t=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),e=new Float32Array(8*3);qe.set(this.halfSize.x,this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,0),qe.set(-this.halfSize.x,this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,3),qe.set(-this.halfSize.x,-this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,6),qe.set(this.halfSize.x,-this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,9),qe.set(this.halfSize.x,this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,12),qe.set(-this.halfSize.x,this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,15),qe.set(-this.halfSize.x,-this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,18),qe.set(this.halfSize.x,-this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,21);var r=new c.BufferGeometry;return r.setIndex(new c.BufferAttribute(t,1)),r.setAttribute("position",new c.BufferAttribute(e,3)),r.computeBoundingBox(),r.computeBoundingSphere(),r},n.prototype.intersectPlane=function(t){var e=this.center,r=t.normal,i=this.rotation.elements,a=this.halfSize,o=r.x,s=r.y,l=r.z,u=Math.abs(o*i[0]*a.x+s*i[1]*a.x+l*i[2]*a.x)+Math.abs(o*i[3]*a.y+s*i[4]*a.y+l*i[5]*a.y)+Math.abs(o*i[6]*a.z+s*i[7]*a.z+l*i[8]*a.z),d=r.dot(e)+t.constant;return d<=-u?ht.Outside:d>=u?ht.Inside:ht.Intersecting},n.prototype.intersectRay=function(t,e){if(Ta.copy(this.halfSize).multiplyScalar(2),Wi.setFromCenterAndSize(qe.set(0,0,0),Ta),this.rotation.extractBasis(Br,Rr,kr),Qr.makeBasis(Br,Rr,kr),Qr.setPosition(this.center),qo.getInverse(Qr),_i.copy(t).applyMatrix4(qo),Wi.containsPoint(_i.origin))return!0;var r=_i.intersectBox(Wi,qe);return r?e!==void 0?r.applyMatrix4(Qr).distanceTo(t.origin)<e:!0:!1},n}(),C0=function(){function n(){this.type="sphere",this.center=new c.Vector3,this.radius=-1}return n.prototype.fromJson=function(t){var e=t.sphere;return this.center.set(e[0],e[1],e[2]),this.radius=Math.max(e[3],x0),this},n.prototype.toJson=function(){return{sphere:bt(bt([],this.center.toArray(),!0),[this.radius],!1)}},n.prototype.copy=function(t){return this.center.copy(t.center),this.radius=t.radius,this},n.prototype.clone=function(){return new n().copy(this)},n.prototype.getBoundingBox=function(t){return t.setFromCenterAndSize(this.center,Ta.set(1,1,1).multiplyScalar(this.radius*2)),t},n.prototype.toGeometry=function(){for(var t=32,e=new Float32Array(t*3*2*2),r=0;r<=t;r++){var i=0;i=r/t*Math.PI*2,e[r*6+0]=this.center.x+Math.cos(i)*this.radius,e[r*6+1]=this.center.y+Math.sin(i)*this.radius,e[r*6+2]=this.center.z+0,i=(r+1)/t*Math.PI*2,e[r*6+3]=this.center.x+Math.cos(i)*this.radius,e[r*6+4]=this.center.y+Math.sin(i)*this.radius,e[r*6+5]=this.center.z+0}for(var r=t;r<=t*2;r++){var i=0;i=r/t*Math.PI*2,e[r*6+0]=this.center.x+Math.cos(i)*this.radius,e[r*6+1]=this.center.y+0,e[r*6+2]=this.center.z+Math.sin(i)*this.radius,i=(r+1)/t*Math.PI*2,e[r*6+3]=this.center.x+Math.cos(i)*this.radius,e[r*6+4]=this.center.y+0,e[r*6+5]=this.center.z+Math.sin(i)*this.radius}var a=new c.BufferGeometry;return a.setAttribute("position",new c.BufferAttribute(e,3)),a.computeBoundingBox(),a.computeBoundingSphere(),a},n.prototype.applyMatrix4=function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},n.prototype.getCenter=function(t){return t.copy(this.center)},n.prototype.distanceSquaredToPoint=function(t){var e=this.distanceToPoint(t);return e*e},n.prototype.distanceToPoint=function(t){var e=this.center.distanceTo(t)-this.radius;return e<=0?0:e},n.prototype.distanceToPlane=function(t){var e=Math.abs(t.distanceToPoint(this.center));return Math.max(0,e-this.radius)},n.prototype.intersectPlane=function(t){var e=this.center,r=this.radius,i=t.normal,a=i.dot(e)+t.constant;return a<-r?ht.Outside:a<r?ht.Intersecting:ht.Inside},n.prototype.intersectRay=function(t,e){if(Xi.set(this.center,this.radius),Xi.containsPoint(t.origin))return!0;var r=t.intersectSphere(Xi,qe);return r?e!==void 0?t.origin.distanceTo(r)<e:!0:!1},n}(),Zc=function(){function n(){throw this.type="regin",this.west=0,this.south=0,this.east=0,this.north=0,this.minHeight=0,this.maxHeight=0,new Error("Region bounding volume not supported.")}return n.prototype.fromJson=function(t){var e=t.region;return this.west=e[0],this.south=e[1],this.east=e[2],this.north=e[3],this.minHeight=e[4],this.maxHeight=e[5],this},n.prototype.toJson=function(){return{region:[this.west,this.south,this.east,this.north,this.minHeight,this.maxHeight]}},n.prototype.copy=function(t){return this.west=t.west,this.south=t.south,this.east=t.east,this.north=t.north,this.minHeight=t.minHeight,this.maxHeight=t.maxHeight,this},n.prototype.clone=function(){return new n().copy(this)},n.prototype.getBoundingBox=function(t){throw new Error("not implemented")},n.prototype.toGeometry=function(){throw new Error("not implemented")},n.prototype.applyMatrix4=function(t){throw new Error("not implemented")},n.prototype.getCenter=function(t){throw new Error("not implemented")},n.prototype.distanceToPoint=function(t){throw new Error("not implemented")},n.prototype.distanceSquaredToPoint=function(t){throw new Error("not implemented")},n.prototype.distanceToPlane=function(t){throw new Error("not implemented")},n.prototype.intersectPlane=function(t){throw new Error("not implemented")},n.prototype.intersectRay=function(t){throw new Error("not implemented")},n}();function di(n){if("box"in n)return new E0().fromJson(n);if("sphere"in n)return new C0().fromJson(n);if("region"in n)return new Zc().fromJson(n);throw new Error("BoundingVolume ".concat(JSON.stringify(n)," never suppored."))}var ii=[4821759,8191922,16637280,16739958,5822969,376977,16747077,9259235,14514687].map(function(n){return new c.LineBasicMaterial({color:n,depthWrite:!1,depthTest:!1,transparent:!0})}),Yc=function(){var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),t=new Float32Array(8*3);qe.set(1,1,1).toArray(t,0),qe.set(-1,1,1).toArray(t,3),qe.set(-1,-1,1).toArray(t,6),qe.set(1,-1,1).toArray(t,9),qe.set(1,1,-1).toArray(t,12),qe.set(-1,1,-1).toArray(t,15),qe.set(-1,-1,-1).toArray(t,18),qe.set(1,-1,-1).toArray(t,21);var e=new c.BufferGeometry;return e.setIndex(new c.BufferAttribute(n,1)),e.setAttribute("position",new c.BufferAttribute(t,3)),e.computeBoundingBox(),e.computeBoundingSphere(),e}(),$c=function(){for(var n=32,t=new Float32Array(n*3*2*2),e=0;e<=n;e++){var r=0;r=e/n*Math.PI*2,t[e*6+0]=Math.cos(r),t[e*6+1]=Math.sin(r),t[e*6+2]=0,r=(e+1)/n*Math.PI*2,t[e*6+3]=Math.cos(r),t[e*6+4]=Math.sin(r),t[e*6+5]=0}for(var e=n;e<=n*2;e++){var r=0;r=e/n*Math.PI*2,t[e*6+0]=Math.cos(r),t[e*6+1]=0,t[e*6+2]=Math.sin(r),r=(e+1)/n*Math.PI*2,t[e*6+3]=Math.cos(r),t[e*6+4]=0,t[e*6+5]=Math.sin(r)}var i=new c.BufferGeometry;return i.setAttribute("position",new c.BufferAttribute(t,3)),i.computeBoundingBox(),i.computeBoundingSphere(),i}();function ed(n,t){if(n instanceof E0){var e=new c.LineSegments(Yc,ii[Math.min(t,ii.length-1)]);return e.position.copy(n.center),w0(n.rotation,e.quaternion),e.scale.set(n.halfSize.x,n.halfSize.y,n.halfSize.z),e.matrix.compose(e.position,e.quaternion,e.scale),e}else if(n instanceof C0){var e=new c.LineSegments($c,ii[Math.min(t,ii.length-1)]);return e.position.copy(n.center),e.scale.set(n.radius,n.radius,n.radius),e.matrix.compose(e.position,e.quaternion,e.scale),e}throw new Error("never")}var td=new c.Vector3,to=function(){function n(t,e,r,i){var a=this,o,s,l;this.parent=null,this.floor=0,this.id=t,this.state={visible:!1,frameNumber:0,selectedFrameNumber:0,requestedFrameNumber:0,touchedFrameNumber:0,distanceToCamera:0,centerZDepth:0,screenSpaceError:0,visibilityPlaneMask:0,inRequestVolume:!1,shouldRefine:!1,stackLength:0,finalResolution:!0,selectionDepth:0,shouldSelect:!1,lastSelect:!1,ancestorWithContent:null,ancestorWithContentAvailable:null},this.parent=i!=null?i:null,this.level=this.parent?this.parent.level+1:0,this.tileset=r,this.refine=(o=e.refine)!==null&&o!==void 0?o:this.parent?this.parent.refine:"REPLACE",this.transform=new c.Matrix4,e.transform&&this.transform.fromArray(e.transform),this.parent&&this.transform.premultiply(this.parent.transform),typeof e.geometricError=="number"?this.geometricError=e.geometricError*this.transform.getMaxScaleOnAxis():this.geometricError=(l=(s=this.parent)===null||s===void 0?void 0:s.geometricError)!==null&&l!==void 0?l:0,e.content&&e.content.uri?(this.content={uri:e.content.uri,loadState:"UNLOADED",byteLength:0},e.content.group!==void 0&&(this.content.group=e.content.group),e.content.boundingVolume&&(this.content.boundingVolume=di(e.content.boundingVolume).applyMatrix4(this.transform)),/\.json$/.test(this.content.uri)?this.type="TILESET":this.type="SCENEGRAPH"):(this.content=null,this.type="EMPTY"),this.levelOfContent=this.parent?this.parent.levelOfContent:-1,this.type==="SCENEGRAPH"&&(this.levelOfContent=this.levelOfContent+1),e.boundingVolume&&(this.boundingVolume=di(e.boundingVolume).applyMatrix4(this.transform)),e.viewerRequestVolume&&(this.viewerRequestVolume=di(e.viewerRequestVolume).applyMatrix4(this.transform)),this.extras=e.extras||{},typeof this.extras.floor=="number"&&(this.floor=this.extras.floor),this.boundingVolume&&(this.boundingVolumeDebugObject=ed(this.boundingVolume,this.levelOfContent)),e.children?this.children=e.children.map(function(u,d){return new n("".concat(a.id,".").concat(d),u,r,a)}):this.children=[]}return n.prototype.traverse=function(t){t(this);for(var e=0,r=this.children;e<r.length;e++){var i=r[e];i.traverse(t)}},n.prototype.updateState=function(t){this.state.frameNumber=t.frameNumber;var e=this.tileset.transformIsIdentity?null:this.tileset.transform;if(this.boundingVolume){var r=e?this.boundingVolume.clone().applyMatrix4(e):this.boundingVolume;if(t.camera.type==="OrthographicCamera"){var i=new c.Plane().setFromNormalAndCoplanarPoint(t.camera.direction,t.camera.position);this.state.distanceToCamera=r.distanceToPlane(i)}else this.state.distanceToCamera=r.distanceToPoint(t.camera.position);var a=r.getCenter(td).sub(t.camera.position);this.state.centerZDepth=t.camera.direction.dot(a);var o=this.parent?this.parent.state.visibilityPlaneMask:Qn.MASK_INDETERMINATE;this.state.visibilityPlaneMask=t.cullingVolume.computeVisibilityWithPlaneMask(r,o),this.state.visible=this.state.visibilityPlaneMask!==Qn.MASK_OUTSIDE}else this.state.distanceToCamera=0,this.state.centerZDepth=0,this.state.visibilityPlaneMask=Qn.MASK_INDETERMINATE,this.state.visible=!0;if(this.levelOfContent>t.maxLevelOfDetail&&(this.state.visible=!1),this.levelOfContent<=t.minLevelOfDetail&&(this.state.visible=!0),this.viewerRequestVolume){var s=e?this.viewerRequestVolume.clone().applyMatrix4(e):this.viewerRequestVolume;this.state.inRequestVolume=s.distanceSquaredToPoint(t.camera.position)<=0}else this.state.inRequestVolume=!0;this.state.screenSpaceError=this.getScreenSpaceError(t,this.state.distanceToCamera,!1)},Object.defineProperty(n.prototype,"selected",{get:function(){return this.state.selectedFrameNumber===this.tileset.frameNumber},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasChildren",{get:function(){return this.children.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"siblingIndex",{get:function(){var t,e;return(e=(t=this.parent)===null||t===void 0?void 0:t.children.indexOf(this))!==null&&e!==void 0?e:0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasTilesetContent",{get:function(){return this.children.length>0&&this.type==="TILESET"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasRenderContent",{get:function(){return this.type==="SCENEGRAPH"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"contentAvailable",{get:function(){var t;return this.hasRenderContent&&((t=this.content)===null||t===void 0?void 0:t.loadState)==="READY"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasUnloadedContent",{get:function(){var t;return((t=this.content)===null||t===void 0?void 0:t.loadState)==="UNLOADED"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasEmptyContent",{get:function(){return this.type==="EMPTY"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"contentReady",{get:function(){var t;return((t=this.content)===null||t===void 0?void 0:t.loadState)==="READY"||this.hasEmptyContent},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"contentByteLength",{get:function(){return this.content?this.content.byteLength:0},enumerable:!1,configurable:!0}),n.prototype.loadContent=function(){var t=this,e;if(this.hasEmptyContent||!(!((e=this.content)===null||e===void 0)&&e.uri))return Promise.resolve(!1);var r=this.content;return r.data?Promise.resolve(!0):(r.loadState="LOADING",this.tileset.requestScheduler.scheduleRequest(this.id,function(){return t.getPriority()}).then(function(i){return i?t.tileset.options.contentLoader(t).then(function(a){return i.done(),r.loadState=a?"READY":"UNLOADED",a}).catch(function(a){return r.loadState="FAILED",i.done(),Promise.reject(a)}):(r.loadState="UNLOADED",Promise.resolve(!1))}))},n.prototype.unloadContent=function(){return this.content&&(this.content.loadState="UNLOADED",this.content.byteLength=0),!0},n.prototype.getScreenSpaceError=function(t,e,r){var i=this.tileset.transformIsIdentity?1:this.tileset.transform.getMaxScaleOnAxis(),a=this.parent?this.parent.geometricError:this.tileset.geometricError,o=i*(r?a:this.geometricError);if(o===0)return 0;var s=Math.max(e,.001),l=o*t.height/(s*t.sseDenominator);return l},n.prototype.getPriority=function(){var t=this.refine==="ADD"||this.tileset.skipLevelOfDetail;if(t&&!this.state.visible||this.tileset.frameNumber-this.state.touchedFrameNumber>=1||this.content.loadState==="UNLOADED")return-1;var e=this.parent,r=e&&(!t||this.state.screenSpaceError===0),i=r?e.state.screenSpaceError:this.state.screenSpaceError,a=this.tileset.root?this.tileset.root.state.screenSpaceError:0,o=Math.max(a-i,0);return o},n}(),M0=function(){function n(t){this.tileset=t,this.activeRequests=0,this.requestQueue=[],this.requestMap=new Map,this.deferred=null}return n.prototype.scheduleRequest=function(t,e){var r=this.requestMap.get(t);if(r)return r;var i={identiy:t,priority:0,getPriority:e,resolve:function(){}},a=new Promise(function(o){return i.resolve=o});return this.requestQueue.push(i),this.requestMap.set(t,a),this.issueNewRequests(),a},n.prototype.reset=function(){for(var t=0,e=this.requestQueue;t<e.length;t++){var r=e[t];r.resolve(null)}this.requestQueue.length=0,this.requestMap.clear(),this.activeRequests=0},n.prototype.issueRequest=function(t){var e=this,r=t.identiy,i=t.resolve,a=!1,o=function(){a||(a=!0,e.requestMap.delete(r),e.activeRequests--,e.issueNewRequests())};this.activeRequests++,i({done:o})},n.prototype.issueNewRequests=function(){var t=this;this.deferred||(this.deferred=setTimeout(function(){return t.issueNewRequestsAsync()},0))},n.prototype.issueNewRequestsAsync=function(){this.deferred=null;var t=Math.max(this.tileset.maxRequests-this.activeRequests,0);if(t!==0){this.updateAllRequests();for(var e=0;e<t;e++){var r=this.requestQueue.shift();if(r)this.issueRequest(r);else break}}},n.prototype.updateAllRequests=function(){for(var t=this.requestQueue,e=0;e<t.length;e++){var r=t[e];this.updateRequest(r)===!1&&(t.splice(e,1),this.requestMap.delete(r.identiy),e--)}t.sort(function(i,a){return i.priority-a.priority})},n.prototype.updateRequest=function(t){return t.priority=t.getPriority(t.identiy),t.priority<0?(t.resolve(null),!1):!0},n}(),rd=function(){function n(t,e,r){this.item=t,this.previous=e,this.next=r}return n}(),nd=function(){function n(){this.head=null,this.tail=null,this._length=0}return Object.defineProperty(n.prototype,"length",{get:function(){return this._length},enumerable:!1,configurable:!0}),n.prototype.add=function(t){var e=new rd(t,this.tail,null);return this.tail?(this.tail.next=e,this.tail=e):(this.head=e,this.tail=e),this._length++,e},n.prototype.remove=function(t){t.previous&&t.next?(t.previous.next=t.next,t.next.previous=t.previous):t.previous?(t.previous.next=null,this.tail=t.previous):t.next?(t.next.previous=null,this.head=t.next):(this.head=null,this.tail=null),t.next=null,t.previous=null,this._length--},n.prototype.splice=function(t,e){t!==e&&(this.remove(e),this.insert(t,e))},n.prototype.insert=function(t,e){var r=t.next;t.next=e,this.tail===t?this.tail=e:r.previous=e,e.next=r,e.previous=t,this._length++},n.prototype.toArray=function(){for(var t=[],e=this.head;e;)t.push(e),e=e.next;return t},n}(),S0=function(){function n(){this.cacheNodeMap=new Map,this.list=new nd,this.sentinel=this.list.add("sentinel")}return n.prototype.reset=function(){this.list.tail&&this.list.splice(this.list.tail,this.sentinel)},n.prototype.touch=function(t){var e=this.cacheNodeMap.get(t);e&&this.list.splice(this.sentinel,e)},n.prototype.add=function(t,e){if(!this.cacheNodeMap.has(t)){var r=this.list.add(t);this.cacheNodeMap.set(t,r),e&&e(t)}},n.prototype.unloadTile=function(t,e){var r=this.cacheNodeMap.get(t);r&&(this.list.remove(r),this.cacheNodeMap.delete(t),e&&e(t))},n.prototype.unloadTiles=function(t,e){for(var r=this.list.head;r!==this.sentinel&&t();){var i=r.item;r=r.next,this.unloadTile(i,e)}},n.prototype.toArray=function(){for(var t=[],e=0,r=this.list.toArray();e<r.length;e++){var i=r[e];i.item!=="sentinel"&&t.push(i.item)}return t},n}(),yn=function(){function n(){this.map=new Map,this.array=[],this._length=0}return Object.defineProperty(n.prototype,"length",{get:function(){return this._length},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return this.array[t]},n.prototype.set=function(t,e){t>=this.length&&(this._length=t+1),this.map.has(this.array[t])&&this.map.delete(this.array[t]),this.array[t]=e,this.map.set(e,t)},n.prototype.delete=function(t){var e=this.map.get(t);e!==void 0&&e>=0&&(this.array.splice(e,1),this.map.delete(t),this._length--)},n.prototype.push=function(t){if(!this.map.has(t)){var e=this._length++;this.array[e]=t,this.map.set(t,e)}},n.prototype.pop=function(){var t=this.array[--this._length];return this.map.delete(t),this.array[this._length]=void 0,t},n.prototype.reset=function(){this.array=[],this.map=new Map,this._length=0},n.prototype.find=function(t){return this.map.has(t)},n.prototype.peek=function(){return this.array[this._length-1]},n}(),I0=function(){function n(t){this.tileset=t,this._canSelectTile=!0,this.root=null}return n.prototype.traverse=function(t,e,r){this.root=t,this.reset()},n.prototype.reset=function(){this.tileset.hasMixedContent=!1,this.tileset.needsRefinedTiles.clear(),this.tileset.requestedTiles.length=0,this.tileset.selectedTiles.length=0},n.prototype.updateTile=function(t,e){this.updateTileVisibility(t,e),t.state.shouldSelect=!1,t.state.finalResolution=!0},n.prototype.selectTile=function(t,e){var r=t.contentAvailable&&this._canSelectTile;r&&(t.state.selectedFrameNumber=e.frameNumber,this.tileset.selectedTiles.push(t),this.tileset.needsRefinedTiles.add(t))},n.prototype.loadTile=function(t,e){t.hasUnloadedContent&&(t.state.requestedFrameNumber=e.frameNumber,this.tileset.requestedTiles.push(t)),t.hasRenderContent&&this.tileset.needsRefinedTiles.add(t)},n.prototype.touchTile=function(t,e){this.tileset.cache.touch(t),t.state.touchedFrameNumber=e.frameNumber},n.prototype.canTraverse=function(t,e,r){return t.hasEmptyContent||t.hasTilesetContent||t.levelOfContent<=e.minLevelOfDetail?!0:!r&&!t.state.visible?!1:t.state.screenSpaceError>this.tileset.maxScreenSpaceError},n.prototype.updateTileVisibility=function(t,e){if(t.updateState(e),!(!t.state.visible||!t.state.inRequestVolume)){var r=t.children.length>0;if(t.hasTilesetContent&&r){var i=t.children[0];this.updateTileVisibility(i,e),t.state.visible=i.state.visible;return}if(this.meetsScreenSpaceErrorEarly(t,e)){t.state.visible=!1;return}var a=t.refine==="REPLACE";if(a&&r&&t.levelOfContent>e.minLevelOfDetail&&!this.anyChildrenVisible(t,e)){t.state.visible=!1;return}}},n.prototype.anyChildrenVisible=function(t,e){for(var r=!1,i=t.children,a=0,o=i;a<o.length;a++){var s=o[a];s.updateState(e),r=r||s.state.visible}return r},n.prototype.meetsScreenSpaceErrorEarly=function(t,e){var r=t.parent;return!r||r.refine!=="ADD"||r.levelOfContent<=e.minLevelOfDetail?!1:t.getScreenSpaceError(e,t.state.distanceToCamera,!0)<this.tileset.maxScreenSpaceError},n.prototype.sortTilesByDistanceToCamera=function(t){t.sort(function(e,r){return r.state.distanceToCamera===0&&e.state.distanceToCamera===0?r.state.centerZDepth-e.state.centerZDepth:r.state.distanceToCamera-e.state.distanceToCamera})},n}(),id=function(n){ue(t,n);function t(e){var r=n.call(this,e)||this;return r.tileset=e,r._traversalStack=new yn,r._emptyTraversalStack=new yn,r}return t.prototype.traverse=function(e,r,i){i===void 0&&(i=[]),n.prototype.traverse.call(this,e,r,i);for(var a=0,o=i;a<o.length;a++){var s=o[a];this._traversalStack.reset(),this._emptyTraversalStack.reset(),s.camera.refine&&(this._canSelectTile=s.camera.visible,this.updateTile(e,s),this.executeTraversal(e,s))}this._traversalStack.reset(),this._emptyTraversalStack.reset(),r.camera.refine&&(this._canSelectTile=r.camera.visible,this.updateTile(e,r),this.executeTraversal(e,r))},t.prototype.reset=function(){n.prototype.reset.call(this),this._traversalStack.reset(),this._emptyTraversalStack.reset()},t.prototype.executeTraversal=function(e,r){var i=this._traversalStack;if(r.maxLevelOfDetail>=0)for(e.state.visible&&e.state.inRequestVolume&&i.push(e);i.length>0;){var a=i.pop(),o=a.parent,s=!o||o.state.shouldRefine,l=!1;this.canTraverse(a,r,!1)&&(l=this.updateAndPushChildren(a,r,i)&&s);var u=!l&&s;a.hasRenderContent?a.refine==="ADD"?(this.loadTile(a,r),this.selectDesiredTile(a,r)):a.refine==="REPLACE"&&(this.loadTile(a,r),u&&this.selectDesiredTile(a,r)):(this.loadTile(a,r),u&&this.selectDesiredTile(a,r)),this.touchTile(a,r),a.state.shouldRefine=l}},t.prototype.updateAndPushChildren=function(e,r,i){for(var a=e.children,o=0,s=a;o<s.length;o++){var l=s[o];this.updateTile(l,r)}this.sortTilesByDistanceToCamera(a);for(var u=e.refine==="REPLACE"&&e.hasRenderContent,d=!1,f=!0,A=0,m=a;A<m.length;A++){var l=m[A];if(l.state.visible&&l.state.inRequestVolume?(i.find(l)&&i.delete(l),i.push(l),d=!0):(u||this.tileset.loadSiblings)&&(this.loadTile(l,r),this.touchTile(l,r)),u){var h=void 0;l.state.inRequestVolume?l.hasRenderContent?h=l.contentAvailable:h=this.executeEmptyTraversal(l,r):h=!1,f=f&&h}}return d||(f=!1),f},t.prototype.selectDesiredTile=function(e,r){e.contentAvailable&&n.prototype.selectTile.call(this,e,r)},t.prototype.executeEmptyTraversal=function(e,r){var i=!0,a=this._emptyTraversalStack;for(a.push(e);a.length>0&&i;){var o=a.pop(),s=!o.hasRenderContent&&this.canTraverse(o,r,!0);if(!s&&!o.contentAvailable&&(i=!1),this.updateTile(o,r),o.state.visible||(this.loadTile(o,r),this.touchTile(o,r)),s)for(var l=o.children,u=0,d=l;u<d.length;u++){var f=d[u];a.find(f)&&a.delete(f),a.push(f)}}return i},t}(I0),ad=function(n){ue(t,n);function t(e){var r=n.call(this,e)||this;return r.tileset=e,r.baseScreenSpaceError=1024,r.skipScreenSpaceErrorFactor=16,r.skipLevels=1,r._traversalStack=new yn,r._descendantTraversalStack=new yn,r._selectionTraversalStack=new yn,r._selectionTraversalancestorStack=new yn,r}return t.prototype.traverse=function(e,r,i){i===void 0&&(i=[]),n.prototype.traverse.call(this,e,r,i);for(var a=0,o=i;a<o.length;a++){var s=o[a];this._traversalStack.reset(),s.camera.refine&&(this._canSelectTile=s.camera.visible,this.updateTile(e,s),this.executeTraversal(e,s),this.traverseAndSelect(e,s))}this.tileset.hasMixedContent=!1,this._traversalStack.reset(),this._descendantTraversalStack.reset(),this._selectionTraversalStack.reset(),this._selectionTraversalancestorStack.reset(),r.camera.refine&&(this._canSelectTile=r.camera.visible,this.updateTile(e,r),this.executeTraversal(e,r),this.traverseAndSelect(e,r))},t.prototype.reset=function(){n.prototype.reset.call(this),this._traversalStack.reset(),this._descendantTraversalStack.reset(),this._selectionTraversalStack.reset(),this._selectionTraversalancestorStack.reset()},t.prototype.executeTraversal=function(e,r){var i=this._traversalStack;if(r.maxLevelOfDetail>=0)for(e.state.visible&&e.state.inRequestVolume&&i.push(e);i.length>0;){var a=i.pop();this.updateTileAncestorContentLinks(a,r);var o=a.parent,s=!o||o.state.shouldRefine,l=!1;this.canTraverse(a,r,!1)&&(l=this.updateAndPushChildren(a,r,i)&&s);var u=!l&&s;a.hasRenderContent?a.refine==="ADD"?(this.loadTile(a,r),this.selectDesiredTile(a,r)):a.refine==="REPLACE"&&(this.inBaseTraversal(a,this.baseScreenSpaceError)?(this.loadTile(a,r),u&&this.selectDesiredTile(a,r)):u?(this.loadTile(a,r),this.selectDesiredTile(a,r)):this.reachedSkippingThreshold(a)&&this.loadTile(a,r)):(this.loadTile(a,r),u&&this.selectDesiredTile(a,r)),this.touchTile(a,r),a.state.shouldRefine=l}},t.prototype.updateAndPushChildren=function(e,r,i){for(var a=e.children,o=0,s=a;o<s.length;o++){var l=s[o];this.updateTile(l,r)}this.sortTilesByDistanceToCamera(a);for(var u=!1,d=0,f=a;d<f.length;d++){var l=f[d];l.state.visible&&l.state.inRequestVolume?(i.push(l),u=!0):this.tileset.loadSiblings&&(this.loadTile(l,r),this.touchTile(l,r))}return u},t.prototype.selectDesiredTile=function(e,r){var i=e.contentAvailable?e:e.state.ancestorWithContentAvailable;i&&(i.state.shouldSelect=!0),e.contentAvailable||this.selectDescendants(e,r)},t.prototype.selectDescendants=function(e,r){var i=this._descendantTraversalStack;for(i.push(e);i.length>0;)for(var a=i.pop(),o=a.children,s=0,l=o;s<l.length;s++){var u=l[s];u.state.visible&&(u.contentAvailable?(this.updateTile(u,r),this.touchTile(u,r),this.selectTile(u,r)):i.push(u))}},t.prototype.reachedSkippingThreshold=function(e){var r=e.state.ancestorWithContent,i=r!==null&&e.state.screenSpaceError<r.state.screenSpaceError/this.skipScreenSpaceErrorFactor&&e.levelOfContent>r.levelOfContent+this.skipLevels;return i},t.prototype.updateTileAncestorContentLinks=function(e,r){e.state.ancestorWithContent=null,e.state.ancestorWithContentAvailable=null;var i=e.parent;if(i){var a=!(i.hasRenderContent&&i.hasUnloadedContent)||i.state.requestedFrameNumber===r.frameNumber;e.state.ancestorWithContent=a?i:i.state.ancestorWithContent,e.state.ancestorWithContentAvailable=i.contentAvailable?i:i.state.ancestorWithContentAvailable}},t.prototype.inBaseTraversal=function(e,r){return e.state.ancestorWithContent?e.parent&&e.state.screenSpaceError===0?e.parent.state.screenSpaceError>r:e.state.screenSpaceError>r:!0},t.prototype.traverseAndSelect=function(e,r){var i=this._selectionTraversalStack,a=this._selectionTraversalancestorStack,o;for(i.push(e);i.length>0||a.length>0;){if(a.length>0){var s=a.peek();if(s.state.stackLength===i.length){a.pop(),s!==o&&(s.state.finalResolution=!1),this.selectTile(s,r);continue}}var l=i.pop();if(l){var u=this.canTraverse(l,r,!1);if(l.state.shouldSelect)if(l.refine==="ADD")this.selectTile(l,r);else{if(l.state.selectionDepth=a.length,l.state.selectionDepth>0&&(l.tileset.hasMixedContent=!0),o=l,!u){this.selectTile(l,r);continue}a.push(l),l.state.stackLength=i.length}if(u)for(var d=0,f=l.children;d<f.length;d++){var A=f[d];A.state.visible&&i.push(A)}}}},t}(I0),od=new c.Matrix4,mn=function(){function n(t,e,r){var i,a,o,s;this.id=t,this.transform=new c.Matrix4,this.transformIsIdentity=!0,this.hasMixedContent=!1,this.referer=(i=r.referer)!==null&&i!==void 0?i:"",this.asset={version:e.asset.version,tilesetVersion:e.asset.tilesetVersion||"",gltfUpAxis:(a=e.asset.gltfUpAxis)!==null&&a!==void 0?a:"Y",overview:e.asset.overview},this.rootMeta=(o=e.rootMeta)!==null&&o!==void 0?o:{},this.properties=(s=e.properties)!==null&&s!==void 0?s:{},this.options=r,this.maxMemoryUsage=n.DEFAULT_MAX_MEMORY_USAGE,this.maxScreenSpaceError=n.DEFAULT_MAX_SCREEN_SPACE_ERROR,this.skipLevelOfDetail=n.DEFAULT_SKIP_LEVEL_OF_DETAIL,this.loadSiblings=n.DEFAULT_LOAD_SIBLINGS,this.maxRequests=n.DEFAULT_MAX_REQUESTS,this.requestedTiles=[],this.selectedTiles=[],this.needsRefinedTiles=new Set,this.cache=new S0,this.normalTraverser=new id(this),this.skipTraverser=new ad(this),this.requestScheduler=new M0(this),this.frameNumber=0,this.pendingCount=0,this.loadedTiles=new Set,this.memoryUsageInBytes=0,this.root=new to("".concat(this.id,".0"),e.root,this),this.geometricError=e.geometricError}return Object.defineProperty(n.prototype,"traverser",{get:function(){return this.skipLevelOfDetail?this.skipTraverser:this.normalTraverser},enumerable:!1,configurable:!0}),n.prototype.reset=function(){for(var t=this,e=[this.root],r;r=e.pop();){for(var i=0,a=r.children.length;i<a;i++)e.push(r.children[i]);this.cache.unloadTile(r,function(o){return t.unloadTile(o)})}this.cache.reset(),this.traverser.reset(),this.requestScheduler.reset(),this.loadedTiles.clear()},n.prototype.isLoaded=function(){return this.pendingCount===0&&this.frameNumber!==0},n.prototype.traverse=function(t,e){var r=this;e===void 0&&(e=[]),this.transformIsIdentity=this.transform.equals(od),this.traverser.traverse(this.root,t,e),this.requestedTiles.forEach(function(i){i.hasUnloadedContent&&r.loadTile(i)}),this.cache.unloadTiles(function(){var i=r.memoryUsageInBytes>r.maxMemoryUsage*1024*1024;return i},function(i){r.unloadTile(i),r.loadedTiles.delete(i)})},n.prototype.loadTile=function(t){var e=this;this.pendingCount++,t.loadContent().catch(function(r){return e.options.onTileError(t,r),!1}).then(function(r){var i;e.pendingCount--,r&&(!((i=t.content)===null||i===void 0)&&i.data&&(e.loadedTiles.add(t),e.cache.add(t,function(){e.memoryUsageInBytes+=t.contentByteLength})),e.options.onTileLoad(t))})},n.prototype.unloadTile=function(t){this.memoryUsageInBytes-=t.contentByteLength,this.options.onTileUnload(t),t.unloadContent()},n.DEFAULT_MAX_MEMORY_USAGE=16,n.DEFAULT_MAX_SCREEN_SPACE_ERROR=4,n.DEFAULT_SKIP_LEVEL_OF_DETAIL=!1,n.DEFAULT_LOAD_SIBLINGS=!1,n.DEFAULT_MAX_REQUESTS=6,n}();function xt(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=[];n=n.map(function(s){return(s!=null?s:"").trim()}).filter(function(s){return s.length>0&&!/^\/+$/.test(s)});for(var r=0;r<n.length;r++){var i=r===0,a=r===n.length-1,o=n[r];i||(o=o.replace(/^\.\//,"").replace(/^\/+/,"")),a||(o=o.replace(/\/+$/,"")),e.push(o)}return e.join("/")}function Pa(n){var t,e=/^(http\:|https\:|file\:)?\/\/[^/]/.exec(n);if(!e)return n;var r=e[1]||"",i=n.slice(r.length+2),a=i.indexOf("#");a>=0&&(n.slice(a),i=n.slice(0,a));var o=i.indexOf("?");o>=0&&(n.slice(o),i=n.slice(0,o));for(var s=i.split("/"),l=s.shift(),u=(t=s.pop())!==null&&t!==void 0?t:"",d=[],f=0,A=s;f<A.length;f++){var m=A[f];if(!(m===""||m===".")){if(m===".."){d.pop();continue}d.push(m)}}return r+"//"+l+"/"+d.join("/")+"/"+u}function Er(n){return n.indexOf("//")===0||/^[0-9a-z]+\:/i.test(n)}function T0(n,t){if(n.content&&n.content.uri&&(Er(n.content.uri)||(n.content.uri=Pa(xt(t,n.content.uri)))),n.children)for(var e=0,r=n.children;e<r.length;e++){var i=r[e];T0(i,t)}return n}function P0(n,t){return n.asset||(n.asset={}),n.rootMeta||(n.rootMeta={}),n.asset.overview&&(Er(n.asset.overview.imageFile)||(n.asset.overview.imageFile=Pa(xt(t,n.asset.overview.imageFile))),Er(n.asset.overview.worldFile)||(n.asset.overview.worldFile=Pa(xt(t,n.asset.overview.worldFile)))),T0(n.root,t),n}var B0=function(){function n(t,e){this.position=t,this.indices=e}return n.prototype.getPositionCount=function(){var t,e,r=this.indices,i=this.position;return r?r.array.length/((t=r.stride)!==null&&t!==void 0?t:1):i.array.length/((e=i.stride)!==null&&e!==void 0?e:3)},n.prototype.getPositionByIndex=function(t,e){var r,i,a,o,s=this.indices,l=this.position,u=t;if(s){var d=s.array,f=(r=s.stride)!==null&&r!==void 0?r:1,A=(i=s.offset)!==null&&i!==void 0?i:0;u=d[t*f+A]}var m=l.array,h=(a=l.stride)!==null&&a!==void 0?a:3,v=(o=l.offset)!==null&&o!==void 0?o:0;return u=u*h+v,e.x=m[u],e.y=m[u+1],e.z=m[u+2],e},n.prototype.createTree=function(t,e,r){throw new Error("not implemented")},n.prototype.trianglesInSphere=function(t,e){throw new Error("not implemented")},n.prototype.intersectRay=function(t,e,r,i){throw new Error("not implemented")},n}(),wn=function(){function n(t,e,r,i,a){this.id=t,this.extents=e,this.startIndex=r,this.endIndex=i,this.deepth=a}return n}(),br=6*4+4+4+2+2;function R0(n,t){for(var e=new ArrayBuffer(t*br),r=new Float32Array(e),i=new Uint32Array(e),a=new Uint16Array(e),o=[n],s,l;s=o.pop();)l=s.id*br/4,r[l]=s.extents[0],r[l+1]=s.extents[1],r[l+2]=s.extents[2],r[l+3]=s.extents[3],r[l+4]=s.extents[4],r[l+5]=s.extents[5],i[l+6]=s.startIndex,i[l+7]=s.endIndex,l=s.id*br/2,s.node0&&(a[l+16]=s.node0.id,o.push(s.node0)),s.node1&&(a[l+17]=s.node1.id,o.push(s.node1));return e}function k0(n,t,e,r,i,a,o,s,l){l===void 0&&(l=0),e=e-l,r=r-l,i=i-l,a=a+l,o=o+l,s=s+l;var u=0,d=0,f=0,A=0,m=0,h=0;return t.x>=0?(u=(e-n.x)*t.x,d=(a-n.x)*t.x):(u=(a-n.x)*t.x,d=(e-n.x)*t.x),t.y>=0?(f=(r-n.y)*t.y,A=(o-n.y)*t.y):(f=(o-n.y)*t.y,A=(r-n.y)*t.y),!(u>A||f>d||(f>u&&(u=f),A<d&&(d=A),t.z>=0?(m=(i-n.z)*t.z,h=(s-n.z)*t.z):(m=(s-n.z)*t.z,h=(i-n.z)*t.z),u>h||m>d)||(m>u&&(u=m),h<d&&(d=h),d<0))}var an=function(){function n(t,e,r){this.x=t,this.y=e,this.z=r}return n.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},n.prototype.set=function(t,e,r){return this.x=t,this.y=e,this.z=r,this},n.prototype.fromArray=function(t,e){return e===void 0&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},n.prototype.toArray=function(t,e){return t===void 0&&(t=[]),e===void 0&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},n.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this},n.prototype.multiplyScalar=function(t){return this.x*=t,this.y*=t,this.z*=t,this},n.prototype.subVectors=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},n.prototype.addScaledVector=function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},n.prototype.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z},n.prototype.cross=function(t){var e=this.x,r=this.y,i=this.z;return this.x=r*t.z-i*t.y,this.y=i*t.x-e*t.z,this.z=e*t.y-r*t.x,this},n.prototype.crossVectors=function(t,e){var r=t.x,i=t.y,a=t.z,o=e.x,s=e.y,l=e.z;return this.x=i*l-a*s,this.y=a*o-r*l,this.z=r*s-i*o,this},n.prototype.distanceTo=function(t){return Math.sqrt(this.distanceToSquared(t))},n.prototype.distanceToSquared=function(t){var e=this.x-t.x,r=this.y-t.y,i=this.z-t.z;return e*e+r*r+i*i},n.prototype.clone=function(){return new n(this.x,this.y,this.z)},n}(),F0=function(){function n(t,e,r){this.triangle=t,this.intersectionPoint=e,this.index=r}return n}(),Go=1e-6,He=new an(0,0,0),Fr=new an(0,0,0),Lr=new an(0,0,0),Or=new an(0,0,0),sd=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.createTree=function(e,r,i){r=Math.min(r,16);var a=this.getPositionCount()/3,o=a>65535?new Uint32Array(a):new Uint16Array(a),s=new Float32Array(a*6),l=[],u=0,d=-1;if(i)for(var f=0,A=0,m=0,h=void 0,v=void 0,y=void 0,p=void 0,g=void 0,x=void 0,b=void 0;f<a;f+=1,A+=3,m+=6)o[f]=f,this.getPositionByIndex(A,Fr),this.getPositionByIndex(A+1,Lr),this.getPositionByIndex(A+2,Or),h=p=Fr.x,b=Lr.x,b<h&&(h=b),b>p&&(p=b),b=Or.x,b<h&&(h=b),b>p&&(p=b),v=g=Fr.y,b=Lr.y,b<v&&(v=b),b>g&&(g=b),b=Or.y,b<v&&(v=b),b>g&&(g=b),y=x=Fr.z,b=Lr.z,b<y&&(y=b),b>x&&(x=b),b=Or.z,b<y&&(y=b),b>x&&(x=b),s[m]=h,s[m+1]=v,s[m+2]=y,s[m+3]=p,s[m+4]=g,s[m+5]=x;else{for(var w=1/0,E=1/0,M=1/0,C=-1/0,P=-1/0,S=-1/0,f=0,A=0,m=0,h=void 0,v=void 0,y=void 0,p=void 0,g=void 0,x=void 0,b=void 0;f<a;f+=1,A+=3,m+=6)o[f]=f,this.getPositionByIndex(A,Fr),this.getPositionByIndex(A+1,Lr),this.getPositionByIndex(A+2,Or),h=p=Fr.x,b=Lr.x,b<h&&(h=b),b>p&&(p=b),b=Or.x,b<h&&(h=b),b>p&&(p=b),v=g=Fr.y,b=Lr.y,b<v&&(v=b),b>g&&(g=b),b=Or.y,b<v&&(v=b),b>g&&(g=b),y=x=Fr.z,b=Lr.z,b<y&&(y=b),b>x&&(x=b),b=Or.z,b<y&&(y=b),b>x&&(x=b),s[m]=h,s[m+1]=v,s[m+2]=y,s[m+3]=p,s[m+4]=g,s[m+5]=x,h<w&&(w=h),p>C&&(C=p),v<E&&(E=v),g>P&&(P=g),y<M&&(M=y),x>S&&(S=x);i=[w,E,M,C,P,S]}var T=new wn(++d,i,0,a,0);l[u++]=T;var B=[],L=[0,1,2],k=function(D,N){return B[N]-B[D]};function O(D){var N=D.startIndex,X=D.endIndex,K=D.extents;B[0]=K[3]-K[0],B[1]=K[4]-K[1],B[2]=K[5]-K[2],L.sort(k);for(var Q=0;Q<3;Q++){for(var G=L[Q],J=K[G]+K[G+3],H=N,j=X-1,Z=-1,Y=void 0;H<=j;)Z===-1?(Y=o[H],s[Y*6+G]+s[Y*6+G+3]<J?H++:Z=Y):(Y=o[j],s[Y*6+G]+s[Y*6+G+3]>=J||(o[H]=Y,o[j]=Z,Z=-1,H++),j--);if(H>N&&H<X){var pe=new wn(++d,Ko(o,s,N,H,Go),N,H,D.deepth+1);pe.deepth<r&&pe.endIndex-pe.startIndex>e&&(l[u++]=pe);var ee=new wn(++d,Ko(o,s,H,X,Go),H,X,D.deepth+1);ee.deepth<r&&ee.endIndex-ee.startIndex>e&&(l[u++]=ee),D.node0=pe,D.node1=ee,D.startIndex=0,D.endIndex=0;break}}}for(;u;)O(l[--u]);return this.offsetArray=o,this.rootNodePacked=R0(T,d+1),l.length=0,this},t.prototype.trianglesInSphere=function(e,r){for(var i=this.offsetArray,a=this.rootNodePacked,o=new Float32Array(a),s=new Uint32Array(a),l=new Uint16Array(a),u=[0],d=[],f,A,m,h;(f=u.pop())!==void 0;){h=f*br/4;var v=Zi(e.x,o[h],o[h+3])-e.x,y=Zi(e.y,o[h+1],o[h+4])-e.y,p=Zi(e.z,o[h+2],o[h+5])-e.z;if(v*v+y*y+p*p<=r*r){for(var g=s[h+6];g<s[h+7];g++)d.push(i[g]);h=f*br/2,A=l[h+16],m=l[h+17],A&&u.push(A),m&&u.push(m)}}for(var x=d.length,b=new Float32Array(x*9),g=0;g<x;g++){var w=d[g];this.getPositionByIndex(w,He),b[g*9]=He.x,b[g*9+1]=He.y,b[g*9+2]=He.z,this.getPositionByIndex(w+1,He),b[g*9+3]=He.x,b[g*9+4]=He.y,b[g*9+5]=He.z,this.getPositionByIndex(w+2,He),b[g*9+6]=He.x,b[g*9+7]=He.y,b[g*9+8]=He.z}return b},t.prototype.intersectRay=function(e,r,i,a){for(var o=this.offsetArray,s=this.rootNodePacked,l=new Float32Array(s),u=new Uint32Array(s),d=new Uint16Array(s),f=new an(1/r.x,1/r.y,1/r.z),A=[0],m,h,v,y;(m=A.pop())!==void 0;)if(y=m*br/4,k0(e,f,l[y],l[y+1],l[y+2],l[y+3],l[y+4],l[y+5])){for(var p=u[y+6],g=u[y+7],x=void 0,b=void 0,w=void 0,E=e.x,M=e.y,C=e.z,P=r.x,S=r.y,T=r.z,B=void 0,L=void 0,k=void 0,O=void 0,D=void 0,N=void 0,X=void 0,K=void 0,Q=void 0,G=void 0,J=void 0,H=void 0,j=void 0,Z=void 0,Y=void 0,pe=void 0,ee=void 0,oe=void 0,ie=void 0,ce=void 0,ne=void 0,ae=void 0,de=void 0,ve=void 0,xe=void 0,Ce=void 0,Be=void 0;p<g;p++){if(x=o[p],b=x*3,this.getPositionByIndex(b,He),B=He.x,L=He.y,k=He.z,this.getPositionByIndex(b+1,He),O=He.x,D=He.y,N=He.z,this.getPositionByIndex(b+2,He),X=He.x,K=He.y,Q=He.z,G=O-B,J=D-L,H=N-k,j=X-B,Z=K-L,Y=Q-k,pe=J*Y-H*Z,ee=H*j-G*Y,oe=G*Z-J*j,de=P*pe+S*ee+T*oe,de>0)ae=1;else if(de<0)ae=-1,de=-de;else continue;ie=E-B,ce=M-L,ne=C-k,ve=ae*(P*(ce*Y-ne*Z)+S*(ne*j-ie*Y)+T*(ie*Z-ce*j)),!(ve<0)&&(xe=ae*(P*(J*ne-H*ce)+S*(H*ie-G*ne)+T*(G*ce-J*ie)),!(xe<0)&&(ve+xe>de||(Ce=-ae*(ie*pe+ce*ee+ne*oe),!(Ce<0)&&(Be=Ce/de,a.push(new F0([B,L,k,O,D,N,X,K,Q],[E+P*Be,M+S*Be,C+T*Be],x))))))}y=m*br/2,h=d[y+16],v=d[y+17],h&&A.push(h),v&&A.push(v)}return a},t}(B0);function Zi(n,t,e){return n<t?t:n>e?e:n}function Ko(n,t,e,r,i){if(e>=r)return[0,0,0,0,0,0];for(var a=1/0,o=1/0,s=1/0,l=-1/0,u=-1/0,d=-1/0,f=e,A=void 0,m=void 0;f<r;f++)A=n[f]*6,m=t[A],m<a&&(a=m),m=t[A+1],m<o&&(o=m),m=t[A+2],m<s&&(s=m),m=t[A+3],m>l&&(l=m),m=t[A+4],m>u&&(u=m),m=t[A+5],m>d&&(d=m);return[a-i,o-i,s-i,l+i,u+i,d+i]}var jo=1e-6,ud=["x","y","z"],st=new an(0,0,0),ld=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.createTree=function(e,r,i){r=Math.min(r,16);var a=this.getPositionByIndex.bind(this),o=this.getPositionCount(),s=o>65535?new Uint32Array(o):new Uint16Array(o),l=[],u=0,d=-1;if(i)for(var f=0;f<o;f+=1)s[f]=f;else{a(0,st);for(var A=st.x,m=st.y,h=st.z,v=A,y=m,p=h,f=0,g=void 0,x=void 0,b=void 0;f<o;f+=1)s[f]=f,a(f,st),g=st.x,x=st.y,b=st.z,g<A?A=g:g>v&&(v=g),x<m?m=x:x>y&&(y=x),b<h?h=b:b>p&&(p=b);i=[A,m,h,v,y,p]}var w=new wn(++d,i,0,o,0);l[u++]=w;var E=[],M=[0,1,2],C=function(S,T){return E[T]-E[S]};function P(S){var T=S.startIndex,B=S.endIndex,L=S.extents;E[0]=L[3]-L[0],E[1]=L[4]-L[1],E[2]=L[5]-L[2];for(var k=M.sort(C)[0],O=ud[k],D=(L[k]+L[k+3])/2,N=T,X=B-1,K=-1,Q;N<=X;)K===-1?(Q=s[N],a(Q,st),st[O]<D?N++:K=Q):(Q=s[X],a(Q,st),st[O]>=D||(s[N]=Q,s[X]=K,K=-1,N++),X--);if(N>T){var G=L.slice();G[k+3]=D+jo;var J=new wn(++d,G,T,N,S.deepth+1);J.deepth<r&&J.endIndex-J.startIndex>e&&(l[u++]=J),S.node0=J}if(B>N){var H=L.slice();H[k]=D-jo;var j=new wn(++d,H,N,B,S.deepth+1);j.deepth<r&&j.endIndex-j.startIndex>e&&(l[u++]=j),S.node1=j}S.startIndex=0,S.endIndex=0}for(;u;)P(l[--u]);return this.offsetArray=s,this.rootNodePacked=R0(w,d+1),l.length=0,this},t.prototype.intersectRay=function(e,r,i,a){for(var o=this.offsetArray,s=this.rootNodePacked,l=new Float32Array(s),u=new Uint32Array(s),d=new Uint16Array(s),f=i*i,A=new an(1/r.x,1/r.y,1/r.z),m=[0],h,v,y,p;(h=m.pop())!==void 0;)if(p=h*br/4,k0(e,A,l[p],l[p+1],l[p+2],l[p+3],l[p+4],l[p+5],i)){for(var g=u[p+6],x=u[p+7],b=void 0,w=void 0,E=void 0,M=void 0,C=void 0,P=void 0,S=void 0,T=void 0,B=void 0,L=void 0,k=void 0,O=void 0;g<x;g++)b=o[g],this.getPositionByIndex(b,st),w=st.x,E=st.y,M=st.z,C=e.x,P=e.y,S=e.z,T=r.x,B=r.y,L=r.z,k=T*(w-C)+B*(E-P)+L*(M-S),k>0&&(C+=T*k,P+=B*k,S+=L*k),T=w-C,B=E-P,L=M-S,k=T*T+B*B+L*L,k<=f&&a.push(new F0([w,E,M,w,E,M,w,E,M],[C,P,S],b));p=h*br/2,v=d[p+16],y=d[p+17],v&&m.push(v),y&&m.push(y)}return a},t}(B0);const L0="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3ZhciBlcj1mdW5jdGlvbihlLHIpe3JldHVybiBlcj1PYmplY3Quc2V0UHJvdG90eXBlT2Z8fHtfX3Byb3RvX186W119aW5zdGFuY2VvZiBBcnJheSYmZnVuY3Rpb24odCxvKXt0Ll9fcHJvdG9fXz1vfXx8ZnVuY3Rpb24odCxvKXtmb3IodmFyIGYgaW4gbylPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwobyxmKSYmKHRbZl09b1tmXSl9LGVyKGUscil9O2Z1bmN0aW9uIGhyKGUscil7aWYodHlwZW9mIHIhPSJmdW5jdGlvbiImJnIhPT1udWxsKXRocm93IG5ldyBUeXBlRXJyb3IoIkNsYXNzIGV4dGVuZHMgdmFsdWUgIitTdHJpbmcocikrIiBpcyBub3QgYSBjb25zdHJ1Y3RvciBvciBudWxsIik7ZXIoZSxyKTtmdW5jdGlvbiB0KCl7dGhpcy5jb25zdHJ1Y3Rvcj1lfWUucHJvdG90eXBlPXI9PT1udWxsP09iamVjdC5jcmVhdGUocik6KHQucHJvdG90eXBlPXIucHJvdG90eXBlLG5ldyB0KX10eXBlb2YgU3VwcHJlc3NlZEVycm9yPT0iZnVuY3Rpb24iJiZTdXBwcmVzc2VkRXJyb3I7dmFyIGRyPWZ1bmN0aW9uKCl7ZnVuY3Rpb24gZShyLHQpe3RoaXMucG9zaXRpb249cix0aGlzLmluZGljZXM9dH1yZXR1cm4gZS5wcm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V0LGY9MCxkPXI7ZjxkLmxlbmd0aDtmKyspe3ZhciB2PWRbZl0sbj12b2lkIDA7aWYodi50eXBlPT09Im1lc2giKW49bmV3IEFyKHYuYXR0cmlidXRlcy5wb3NpdGlvbix2LmluZGljZXMpO2Vsc2UgaWYodi50eXBlPT09InBvaW50cyIpbj1uZXcgUHIodi5hdHRyaWJ1dGVzLnBvc2l0aW9uLHYuaW5kaWNlcyk7ZWxzZSB0aHJvdyBuZXcgRXJyb3IoIkludmFsaWQgVHlwZSIpO24uY3JlYXRlVHJlZSh2Lm1heEl0ZW1QZXJOb2RlLHYubWF4VHJlZURlcHRoLHYuZXh0ZW50cyk7dmFyIHM9e3R5cGU6di50eXBlLGF0dHJpYnV0ZXM6di5hdHRyaWJ1dGVzLGluZGljZXM6di5pbmRpY2VzLG9mZnNldEFycmF5Om4ub2Zmc2V0QXJyYXkscm9vdE5vZGVQYWNrZWQ6bi5yb290Tm9kZVBhY2tlZH07dC5wdXNoKHMpO3ZhciB1PXZvaWQgMDtmb3IodmFyIHcgaW4gcy5hdHRyaWJ1dGVzKXt2YXIgeT1zLmF0dHJpYnV0ZXNbd107eSYmeS5idWZmZXIgaW5zdGFuY2VvZiBBcnJheUJ1ZmZlciYmby5hZGQoeS5idWZmZXIpfXU9cy5pbmRpY2VzLHUmJnUuYnVmZmVyIGluc3RhbmNlb2YgQXJyYXlCdWZmZXImJm8uYWRkKHUuYnVmZmVyKSx1PXMub2Zmc2V0QXJyYXksdSYmdS5idWZmZXIgaW5zdGFuY2VvZiBBcnJheUJ1ZmZlciYmby5hZGQodS5idWZmZXIpLG8uYWRkKHMucm9vdE5vZGVQYWNrZWQpfXJldHVybntvdXRwdXQ6dCx0cmFuc2ZlcjpBcnJheS5mcm9tKG8pfX0pfSl9KSgpOwo=",cd=n=>Uint8Array.from(atob(n),t=>t.charCodeAt(0)),Jo=typeof self!="undefined"&&self.Blob&&new Blob([cd(L0)],{type:"text/javascript;charset=utf-8"});function dd(n){let t;try{if(t=Jo&&(self.URL||self.webkitURL).createObjectURL(Jo),!t)throw"";const e=new Worker(t,{name:n==null?void 0:n.name});return e.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),e}catch(e){return new Worker("data:text/javascript;base64,"+L0,{name:n==null?void 0:n.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var O0=function(){function n(t,e){this.pool=e,this.workerCreator=t,this.queue=[],this.workers=[],this.workersResolver=[],this.workerStatus=0}return n.prototype.initWorker=function(t){if(this.workerCreator&&!this.workers[t]){var e=this.workerCreator();e.addEventListener("message",this.onMessage.bind(this,t)),this.workers[t]=e}},n.prototype.getIdleWorker=function(){for(var t=0;t<this.pool;t++)if(!(this.workerStatus&1<<t))return t;return-1},n.prototype.onMessage=function(t,e){var r=this.workersResolver[t],i=r.resolve,a=r.reject;if(e.data&&"$$error"in e.data?a(e.data.$$error):i(e.data),this.queue.length){var o=this.queue.shift(),s=o.resolve,l=o.reject,u=o.input,d=o.transfer;this.workersResolver[t]={resolve:s,reject:l},this.workers[t].postMessage(u,d)}else this.workerStatus^=1<<t},n.prototype.postMessage=function(t,e){var r=this;return e===void 0&&(e=[]),new Promise(function(i,a){var o=r.getIdleWorker();o!==-1?(r.initWorker(o),r.workerStatus|=1<<o,r.workersResolver[o]={resolve:i,reject:a},r.workers[o].postMessage(t,e)):r.queue.push({resolve:i,reject:a,input:t,transfer:e})})},n.prototype.dispose=function(){this.workers.forEach(function(t){return t.terminate()}),this.workersResolver.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0},n}(),fd=new O0(function(){return new dd},4),fi=new Map,Yi=new Map,En=new c.Ray,Wo=new c.Matrix3,Un=new c.Matrix4,V0=new c.Vector3,hd=new c.Vector3,pd=new c.Vector3,vd=new c.Triangle;function Ad(n,t,e,r){var i,a=n.matrixWorld;Un.getInverse(a),En.copy(e.ray).applyMatrix4(Un);for(var o=t.intersectRay(En.origin,En.direction,0,[]),s=n.geometry,l=n.material,u=s.groups,d=s.index,f=0,A=o.length;f<A;f++){var m=o[f],h=m.triangle,v=m.index,y=m.intersectionPoint,p=new c.Vector3(y[0],y[1],y[2]).applyMatrix4(a),g=e.ray.origin.distanceTo(p);if(!(g<e.near||g>e.far)){var x=void 0;if(Array.isArray(l)){if(u)for(var b=v*3,w=0,E=u;w<E.length;w++){var M=E[w];if(b>=M.start&&b-M.start<M.count){x=l[(i=M.materialIndex)!==null&&i!==void 0?i:0];break}}}else x=l;if(x){var C=vd.set(V0.set(h[0],h[1],h[2]).applyMatrix4(a),hd.set(h[3],h[4],h[5]).applyMatrix4(a),pd.set(h[6],h[7],h[8]).applyMatrix4(a)).getNormal(new c.Vector3),P=v*3,S=new c.Face3(d?d.array[P]:P,d?d.array[P+1]:P+1,d?d.array[P+2]:P+2,C),T=e.ray.direction.dot(C);x.side===c.FrontSide&&T>=0||x.side===c.BackSide&&T<=0||r.push({distance:g,object:n,face:S,point:p,distanceToRay:0,faceIndex:v})}}}}function md(n,t,e,r){var i,a,o=n.matrixWorld;Wo.getNormalMatrix(o),Un.getInverse(o);var s=((a=(i=e.params.Points)===null||i===void 0?void 0:i.threshold)!==null&&a!==void 0?a:1)*Un.getMaxScaleOnAxis();En.copy(e.ray).applyMatrix4(Un);for(var l=t.intersectRay(En.origin,En.direction,s,[]),u=n.geometry,d=u.index,f=u.getAttribute("normal"),A=0,m=l.length;A<m;A++){var h=l[A],v=h.triangle,y=h.index,p=h.intersectionPoint,g=new c.Vector3(p[0],p[1],p[2]).applyMatrix4(o),x=e.ray.origin.distanceTo(g);if(!(x<e.near||x>e.far)){var b=V0.set(v[0],v[1],v[2]).applyMatrix4(o),w=d?d.array[y]:y,E=void 0;f instanceof c.BufferAttribute&&(E=new c.Vector3().fromBufferAttribute(f,w).applyNormalMatrix(Wo));var M=new c.Face3(w,w,w,E);r.push({distance:x,object:n,face:M,point:g,distanceToRay:g.distanceTo(b),index:y})}}}function gd(n,t){var e=n.raycast,r=function(i,a){var o=fi.get(this);o?Ad(this,o,i,a):e.call(this,i,a)};return n.raycast=r,fi.set(n,t),function(){fi.delete(n),n.raycast===r&&(n.raycast=e)}}function yd(n,t){var e=n.raycast,r=function(i,a){var o=Yi.get(this);o?md(this,o,i,a):e.call(this,i,a)};return n.raycast=r,Yi.set(n,t),function(){Yi.delete(n),n.raycast===r&&(n.raycast=e)}}function bd(n,t,e,r){var i=[];return n.traverse(function(a){(a instanceof c.Mesh||a instanceof c.Points)&&a.geometry instanceof c.BufferGeometry&&i.push(a)}),Promise.resolve().then(function(){for(var a=[],o=new Set,s=null,l=0;l<i.length;l++){var u=i[l],d=u.geometry;if(d instanceof c.BufferGeometry){var f=void 0;if(u instanceof c.Mesh?f="mesh":u instanceof c.Points&&(f="points"),!!f){var A=d.boundingBox,m=A?[A.min.x,A.min.y,A.min.z,A.max.x,A.max.y,A.max.z]:void 0,h={};for(var v in d.attributes){var y=d.attributes[v];y instanceof c.InterleavedBufferAttribute?(h[v]={array:y.data.array,stride:y.data.stride,offset:y.offset},s=y.data.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer)):(h[v]={array:y.array},s=y.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer))}var p=void 0,g=d.getIndex();g&&(g instanceof c.InterleavedBufferAttribute?(p={array:g.data.array,stride:g.data.stride,offset:g.offset},s=g.data.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer)):(p={array:g.array},s=g.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer)));var x={type:f,attributes:h,indices:p,maxItemPerNode:e,maxTreeDepth:r,extents:m};a.push(x)}}}return fd.postMessage(a,Array.from(o))}).then(function(a){for(var o=[],s=0;s<i.length;s++){var l=i[s],u=l.geometry,d=a[s];if(u instanceof c.BufferGeometry){for(var f in d.attributes){var A=d.attributes[f].array,m=u.attributes[f];m instanceof c.InterleavedBufferAttribute?m.data.array=A:m.array=A}var h=u.getIndex();if(h&&d.indices){var A=d.indices.array;h instanceof c.InterleavedBufferAttribute?h.data.array=A:h.array=A}if(l instanceof c.Mesh){var v=new sd(d.attributes.position,d.indices);v.offsetArray=d.offsetArray,v.rootNodePacked=d.rootNodePacked;var y=gd(l,v);o.push(y)}else if(l instanceof c.Points){var v=new ld(d.attributes.position,d.indices);v.offsetArray=d.offsetArray,v.rootNodePacked=d.rootNodePacked;var y=yd(l,v);o.push(y)}}}return function(){for(var p=0,g=o;p<g.length;p++){var x=g[p];x()}o.length=0}})}var xd=new c.Vector3,wd=new c.Vector3,Ed=new c.Vector3,N0=function(n){ue(t,n);function t(e,r){var i=n.call(this)||this;return i.obj=e,i.objDisposer=r,i.disposers=[r],i.add(e),i}return t.prototype.generateBvhTree=function(){var e=this;return bd(this,!0,200,10).then(function(r){e.disposers.push(r)})},t.prototype.intersectRaycaster=function(e,r,i){var a=this;r===void 0&&(r=!0),i===void 0&&(i=[]);for(var o=this.children.slice(),s,l=[];s=o.pop();)if(s.visible){s.raycast(e,l);for(var u=0,d=s.children.length;u<d;u++)o.push(s.children[u])}return l.forEach(function(f){var A,m,h=0;if((f.object instanceof Vt||f.object instanceof wr)&&f.face){var v=Array.isArray(f.object.material)?f.object.material[f.face.materialIndex]:f.object.material;if(v)if(v.defines.USE_VERTEX_FLOOR){var y=(A=f.object.geometry.attributes.position)===null||A===void 0?void 0:A.array,p=(m=f.object.geometry.attributes.floor)===null||m===void 0?void 0:m.array;if(y&&p){var g=xd.set(y[f.face.a*3],y[f.face.a*3+1],y[f.face.a*3+2]).applyMatrix4(a.matrixWorld),x=wd.set(y[f.face.b*3],y[f.face.b*3+1],y[f.face.b*3+2]).applyMatrix4(a.matrixWorld),b=Ed.set(y[f.face.c*3],y[f.face.c*3+1],y[f.face.c*3+2]).applyMatrix4(a.matrixWorld),w=f.point.distanceTo(g),E=f.point.distanceTo(x),M=f.point.distanceTo(b);h=Math.round((w*p[f.face.a]+E*p[f.face.b]+M*p[f.face.c])/(w+E+M))}}else h=v.floor}f.floor=h}),r&&l.sort(function(f,A){return f.distance-A.distance}),i.push.apply(i,l),i},t.prototype.dispose=function(){for(var e=0,r=this.disposers;e<r.length;e++){var i=r[e];i()}this.disposers.length=0},t.prototype.clone=function(){return new t(this.obj,this.objDisposer)},t}(c.Group);function D0(n,t){if(t===void 0&&(t=""),(t[0]==="?"||t[0]==="&")&&(t=t.slice(1)),!t)return n;var e=n.indexOf("#"),r="";return e>=0&&(r=n.slice(e),n=n.slice(0,e)),(n[n.length-1]==="?"||n[n.length-1]==="&")&&(n=n.slice(0,-1)),n.indexOf("?")>=0?"".concat(n,"&").concat(t).concat(r):"".concat(n,"?").concat(t).concat(r)}const Cd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6--{vs|z-rp@-p|{n{P|y|H0r{qvs0vs-qrsv{rq5b`Rl]\\V[al[\\_ZNY6--n\bv{t-rp@-[|znyH0r{qvs0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvsp-Pyv}}r-\n--znA-znv\x07V{rrH--sy|n-sy||V{qr\x07H\fH0vs-[bZlPYV]]R_`-K-=--{vs|z-Pyv}}r-pyv}}rh[bZlPYV]]R_`jH0r{qvsn\bv{t-rpA-d|yq]|vv|{Hn\bv{t-sy|n-Sy||Hn\bv{t-rp@-P|y|Hn\bv{t-sy|n-]|v{`v rH{vs|z-sy|n-|}npv\bH{vs|z-sy|n-z|qryNy}unH{vs|z-sy|n-u|{Sy||V{qr\x07H0v{pyqr-Ip|zz|{K0v{pyqr-Is|tl}nlsntzr{K0v{pyqr-Iy|tqr}uosl}nlsntzr{K0v{pyqr-Ipyv}}v{tl}yn{rl}nlsntzr{K|vq-znv{56-\n--<<-JJJ-前置裁切计算-JJJ--0vs-[bZlPYV]]R_`-K-=----o||y-pyv}}rqH----rpA-pyv}}r]|vv|{H----0}ntzn-{|yyly||}ln----s|-5-v{-v-J-=H-v-I-[bZlPYV]]R_`H-v-88-6-\n------pyv}}r]|vv|{-J-pyv}}rh-v-j;znv\x07V{rr-7-d|yq]|vv|{H------pyv}}rq-J-5pyv}}rh-v-j;sy||V{qr\x07-I-=;=-\v\v-no5Sy||-:-pyv}}rh-v-j;sy||V{qr\x076-I->;=6H------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\x07-K-:=;B-33-pyv}}r]|vv|{;\x07-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\b-K-:=;B-33-pyv}}r]|vv|{;\b-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{; -K-:=;B-33-pyv}}r]|vv|{; -I-=;BH------vs-5pyv}}rq6-\n--------qvpnqH------\f----\f----0}ntzn-{|yyly||}lr{q--0r{qvs--<<-JJJJJJJJJJJJJJJJ--<<-JJJ-形状裁切-JJJ--0vs-qrsv{rq5b`Rl]\\V[al`UN]RlPV_PYR6----sy|n--J-?;=-7-tyl]|v{P||q;\x07-:->;=H----sy|n--J-?;=-7-tyl]|v{P||q;\b-:->;=H----sy|n-pp-J-7-8-7H----vs-5]|v{`v r-K-E;=-33-pp-K->;=6-\n------qvpnqH----\f--0r{qvs--<<-JJJJJJJJJJJJJ--0v{pyqr-Iy|tqr}uoslsntzr{K--<<-JJJ-颜色-JJJ--rpA-sv{nyP|y|-J-_TOa|Yv{rn5rpA5P|y|9-|}npv\b66H--0vs-qrsv{rq5b`Rl]\\V[al[\\_ZNY6----0vs-qrsv{rq5b`Rl]\\V[alONPXlUVQQR[6------rp@-pnzrnQvrpv|{-J-{|znyv r5pnzrn]|vv|{-:-d|yq]|vv|{;\x07\b 6H------vs-5q|5pnzrnQvrpv|{9-[|zny6-I-=;=6-\n--------qvpnqH------\f----0ryvs-qrsv{rq5b`Rl]\\V[alONPXlQN_X6------rp@-pnzrnQvrpv|{-J-{|znyv r5pnzrn]|vv|{-:-d|yq]|vv|{;\x07\b 6H------vs-5q|5pnzrnQvrpv|{9-[|zny6-I-=;=6-\n--------sv{nyP|y|;\x07\b -J-sv{nyP|y|;\x07\b -7-=;EH------\f----0r{qvs--0r{qvs--tylSntP|y|-J-sv{nyP|y|H--<<-JJJJJJJJJJJ--<<-JJJ-纯色-JJJ--0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6----tylSntP|y|-J-rpA5p|{n{P|y|;9-p|{n{P|y|;t9-p|{n{P|y|;o9-|}npv\b6H--0r{qvs--<<-JJJJJJJJJJJ--<<-JJJ-楼层显示-JJJ--sy|n-sy||\\}npv\b-J->;=H--vs-5u|{Sy||V{qr\x07-KJ-=;=-33-no5Sy||-:-u|{Sy||V{qr\x076-KJ->;=6-\n----sy||\\}npv\b-J-=;>H--\f--tylSntP|y|;n-J-tylSntP|y|;n-7-sy||\\}npv\bH--<<-JJJJJJJJJJJJJJ--tylSntP|y|;n-J-tylSntP|y|;n-7-z|qryNy}unH--0v{pyqr-I|{rzn}}v{tlsntzr{K--0v{pyqr-Ir{p|qv{tlsntzr{K--0v{pyqr-Is|tlsntzr{K--0v{pyqr-I}rzyv}yvrqlny}unlsntzr{K--0vs-qrsv{rq5b`RlRQY6----tylSntP|y|;n-J-Y|tQr}uH--0r{qvs--0vs-qrsv{rq5b`RlU^ldRVTUa6----sy|n-qvn{pr-J-?;=-7-yr{tu5tyl]|v{P||q;\x07\b-:-=;B6H----sy|n-rvtu-J-zn\x075=;=9->;=-:-qvn{pr6H----rvtu-J-}|5rvtu9->;B6H----tylSntP|y|;n-J-rvtuH----tylSntP|y|;\x07\b -J-tylSntP|y|;\x07\b -7-rvtuH--0r{qvs\f"),Md=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("nvor-rp@-p|y|H0vs-qrsv{rq5b`R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|yq]|vv|{-J-v{n{prZnv\x07-7-d|yq]|vv|{H--0r{qvs--d|yq]|vv|{-J-z|qryZnv\x07-7-d|yq]|vv|{H--<<传递nvor的p|y|到s里使用--<<动态调整}|v{`v r--sy|n-rny]|v{`v r-J-}|v{`pnyr-7-}v\x07ry_nv|H--0vs-qrsv{rq5b`Rl]\\V[al`VgRlTR\\ZRa_VP6----rny]|v{`v r-7J-tr|zrvpR|H----sy|n-urvtu-J->;=-<-}|wrpv|{Znv\x07h>jh>j-7-zv\x075>;=9-:z]|vv|{; 9-:}|wrpv|{Znv\x07h?jh@j6-7-?;=H----rny]|v{`v r-J-r|yv|{;\b-7-rny]|v{`v r-<-urvtuH--0ryvs-qrsv{rq5b`Rl]\\V[al`VgRlNaaR[bNaV\\[6----sy|n-urvtu-J->;=-<-}|wrpv|{Znv\x07h>jh>j-7-zv\x075>;=9-:z]|vv|{; 9-:}|wrpv|{Znv\x07h?jh@j6-7-?;=H----rny]|v{`v r-J-r|yv|{;\b-7-rny]|v{`v r-<-urvtuH--0r{qvs--tyl]|v{`v r-J-pynz}5rny]|v{`v r9-}|v{Zv{]v\x07ry-7-}v\x07ry_nv|9-}|v{Zn\x07]v\x07ry-7-}v\x07ry_nv|6H--]|v{`v r-J-tyl]|v{`v rH--0vs-qrsv{rq5b`Rl]\\V[alP\\Y\\_lNYaVabQR6----P|y|-J-trP|y|O\bUrvtu5tnqvr{ar\x07r9-d|yq]|vv|{6H--0ryr----P|y|-J-p|y|H--0r{qvs--0vs-qrsv{rq5b`Rl]\\V[al[\\_ZNY6----[|zny-J-{|znyv r5zn@5z|qryZnv\x076-7-{|zny6H--0r{qvs--0vs-qrsv{rq5b`RlRQY6----Y|tQr}u-J-y|t?5:z]|vv|{; 6H--0r{qvs--0vs-qrsv{rq5b`RlU^lQR]aU6----<<-sy|n-}|wSnp|-J-:=;B-7-r|yv|{;\b-<-5n{5s|-<-?;=6-7-z]|vv|{; 6H----<<-sy|n-_nqv-J-rny]|v{`v r-<-}|wSnp|H----sy|n-|vtv{nyQr}u-J-tyl]|vv|{;H----sy|n-nqwrqQr}u-J-|vtv{nyQr}u-8-=;>H----sy|n-nqw-J-nqwrqQr}u-<-|vtv{nyQr}uH----z]|vv|{;\x07\b -J-z]|vv|{;\x07\b -7-nqwH----tyl]|vv|{-J-}|wrpv|{Znv\x07-7-z]|vv|{H--0r{qvs--0v{pyqr-I|yq}|lrr\x07K--0v{pyqr-Is|tlrr\x07K\f");var Sd=new c.Vector4,Id=Object.assign({pointScale:new c.Uniform(1),pointMinPixel:new c.Uniform(1),pointMaxPixel:new c.Uniform(1),opacity:new c.Uniform(1),gradientTexture:new c.Uniform(null),modelAlpha:new c.Uniform(0),clippers:new c.Uniform([]),shownFloorIndex:new c.Uniform(-1),constantColor:new c.Uniform(null),geometricError:new c.Uniform(0),pixelRatio:new c.Uniform(1),resolution:new c.Uniform(new c.Vector2(512,512)),floor:new c.Uniform(0),brightness:new c.Uniform(1),modelBoundingMin:new c.Uniform(new c.Vector3),modelBoundingMax:new c.Uniform(new c.Vector3)},c.UniformsUtils.clone(c.UniformsLib.fog)),ro=function(n){ue(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,l,u,d,f,A,m,h,v,y,p,g,x,b,w,E,M,C=n.call(this,{vertexShader:Md,fragmentShader:Cd,uniforms:c.UniformsUtils.clone(Id),lights:!1,defines:{USE_CONSTANT_COLOR:!1,USE_EDL:!1,USE_HQ_WEIGHT:!1,USE_HQ_DEPTH:!1,NUM_CLIPPING_BOX:!1,USE_CLIPFLOOR:!1,USE_VERTEX_FLOOR:!1,USE_MAP:!0,USE_UV:!0,USE_LUMINANCE:!1,USE_PANO_OPACITY:!1,USE_BLACK_TRANSITION:!1,USE_POINT_NORMAL:!1,USE_POINT_SHAPE_CIRCLE:!1,USE_POINT_SIZE_ATTENUATION:!1,USE_POINT_SIZE_GEOMETRIC:!1,USE_POINT_BACK_HIDDEN:!1,USE_POINT_BACK_DARK:!1}})||this,P;return Object.defineProperties(C,{constantColor:{get:function(){return this.uniforms.constantColor.value},set:function(S){this.uniforms.constantColor.value=S;var T=this.defines.USE_CONSTANT_COLOR,B=S!==null;T!==B&&(this.defines.USE_CONSTANT_COLOR=B,this.needsUpdate=!0)}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(S){this.uniforms.opacity.value=S}},modelAlpha:{get:function(){return this.uniforms.modelAlpha.value},set:function(S){this.uniforms.modelAlpha.value=S}},shownFloorIndex:{get:function(){return this.uniforms.shownFloorIndex.value},set:function(S){this.uniforms.shownFloorIndex.value=S}},clippers:{get:function(){return P},set:function(S){P!==S&&(P=S,this.uniforms.clippers.value=(P||[]).map(function(T){var B=typeof T.floorIndex=="number"?T.floorIndex:-1,L=new c.Matrix4().getInverse(T.clippingBoxMatrix);return{matrixInverse:L,floorIndex:B}}),this.needsUpdate=!0)}},pointColor:{get:function(){return this.defines.USE_POINT_COLOR_ALTITUDE===!0?"ALTITUDE":"RGB"},set:function(S){var T=S==="ALTITUDE";this.defines.USE_POINT_COLOR_ALTITUDE!==T&&(this.defines.USE_POINT_COLOR_ALTITUDE=T,this.needsUpdate=!0)}},pointSize:{get:function(){return this.defines.USE_POINT_SIZE_GEOMETRIC===!0?"GEOMETRIC":this.defines.USE_POINT_SIZE_ATTENUATION===!0?"ATTENUATION":"FIXED"},set:function(S){var T=S==="ATTENUATION",B=S==="GEOMETRIC";this.defines.USE_POINT_SIZE_GEOMETRIC!==B&&(this.defines.USE_POINT_SIZE_GEOMETRIC=B,this.needsUpdate=!0),this.defines.USE_POINT_SIZE_ATTENUATION!==T&&(this.defines.USE_POINT_SIZE_ATTENUATION=T,this.needsUpdate=!0)}},pointShape:{get:function(){return this.defines.USE_POINT_SHAPE_CIRCLE===!0?"CIRCLE":"SQUARE"},set:function(S){var T=S==="CIRCLE";this.defines.USE_POINT_SHAPE_CIRCLE!==T&&(this.defines.USE_POINT_SHAPE_CIRCLE=T,this.needsUpdate=!0)}},pointScale:{get:function(){return this.uniforms.pointScale.value},set:function(S){this.uniforms.pointScale.value=S}},pointBack:{get:function(){return this.defines.USE_POINT_BACK_HIDDEN===!0?"HIDDEN":this.defines.USE_POINT_BACK_DARK===!0?"DARK":"VISIBLE"},set:function(S){var T=S==="HIDDEN",B=S==="DARK";this.defines.USE_POINT_BACK_HIDDEN!==T&&(this.defines.USE_POINT_BACK_HIDDEN=T,this.needsUpdate=!0),this.defines.USE_POINT_BACK_DARK!==B&&(this.defines.USE_POINT_BACK_DARK=B,this.needsUpdate=!0)}},pointMinPixel:{get:function(){return this.uniforms.pointMinPixel.value},set:function(S){this.uniforms.pointMinPixel.value=S}},pointMaxPixel:{get:function(){return this.uniforms.pointMaxPixel.value},set:function(S){this.uniforms.pointMaxPixel.value=S}},useEDL:{get:function(){return this.defines.USE_EDL},set:function(S){S!==this.defines.USE_EDL&&(this.defines.USE_EDL=S,this.needsUpdate=!0)}},useHQWeight:{get:function(){return this.defines.USE_HQ_WEIGHT},set:function(S){S!==this.defines.USE_HQ_WEIGHT&&(this.defines.USE_HQ_WEIGHT=S,this.needsUpdate=!0)}},useHQDepth:{get:function(){return this.defines.USE_HQ_DEPTH},set:function(S){S!==this.defines.USE_HQ_DEPTH&&(this.defines.USE_HQ_DEPTH=S,this.needsUpdate=!0)}},gradientTexture:{get:function(){return this.uniforms.gradientTexture.value},set:function(S){this.uniforms.gradientTexture.value=S}},floor:{get:function(){return this.uniforms.floor.value},set:function(S){this.uniforms.floor.value=S}},brightness:{get:function(){return this.uniforms.brightness.value},set:function(S){this.uniforms.brightness.value=S}}}),C.pano0=(r=e.pano0)!==null&&r!==void 0?r:Ee.pano0,C.pano1=(i=e.pano1)!==null&&i!==void 0?i:Ee.pano1,C.modelAlpha=(a=e.modelAlpha)!==null&&a!==void 0?a:Ee.modelAlpha,C.progress=(o=e.progress)!==null&&o!==void 0?o:Ee.progress,C.transition=(s=e.transition)!==null&&s!==void 0?s:Ee.transition,C.constantColor=(l=e.constantColor)!==null&&l!==void 0?l:Ee.constantColor,C.opacity=(u=e.opacity)!==null&&u!==void 0?u:Ee.opacity,C.shownFloorIndex=(d=e.shownFloorIndex)!==null&&d!==void 0?d:Ee.shownFloorIndex,C.clippers=(f=e.clippers)!==null&&f!==void 0?f:Ee.clippers,C.useEDL=(A=e.useEDL)!==null&&A!==void 0?A:Ee.useEDL,C.useHQWeight=(m=e.useHQWeight)!==null&&m!==void 0?m:Ee.useHQWeight,C.useHQDepth=(h=e.useHQDepth)!==null&&h!==void 0?h:Ee.useHQDepth,C.pointColor=(v=e.pointColor)!==null&&v!==void 0?v:Ee.pointColor,C.pointShape=(y=e.pointShape)!==null&&y!==void 0?y:Ee.pointShape,C.pointSize=(p=e.pointSize)!==null&&p!==void 0?p:Ee.pointSize,C.pointScale=(g=e.pointScale)!==null&&g!==void 0?g:Ee.pointScale,C.pointBack=(x=e.pointBack)!==null&&x!==void 0?x:Ee.pointBack,C.pointMinPixel=(b=e.pointMinPixel)!==null&&b!==void 0?b:Ee.pointMinPixel,C.pointMaxPixel=(w=e.pointMaxPixel)!==null&&w!==void 0?w:Ee.pointMaxPixel,C.gradientTexture=(E=e.gradientTexture)!==null&&E!==void 0?E:Ee.gradientTexture,C.brightness=(M=e.brightness)!==null&&M!==void 0?M:Ee.brightness,C.floor=0,C.transparent=!1,C}return t.prototype.onBeforeCompile=function(e,r){var i,a,o=String((a=(i=this.clippers)===null||i===void 0?void 0:i.length)!==null&&a!==void 0?a:0);e.vertexShader=e.vertexShader.replace(/NUM_CLIPPERS/g,o),e.fragmentShader=e.fragmentShader.replace(/NUM_CLIPPERS/g,o)},t.prototype.update=function(e,r){if(r instanceof Fi)this.uniforms.pixelRatio.value=r.pixelRatio,this.uniforms.resolution.value.copy(r.resolution);else{this.uniforms.pixelRatio.value=e.getPixelRatio();var i=e.getViewport(Sd);this.uniforms.resolution.value.set(i.z,i.w)}this.transparent=this.shownFloorIndex>-1||this.opacity<1||this.modelAlpha<1||this.brightness<1,this.useEDL&&(this.transparent=!1),this.useHQDepth&&(this.depthTest=!0,this.depthWrite=!0),this.useHQWeight?(this.depthWrite=!1,this.blending=c.CustomBlending,this.blendSrc=c.SrcAlphaFactor,this.blendSrcAlpha=c.SrcAlphaFactor,this.blendDst=c.OneFactor,this.blendDstAlpha=c.OneFactor):(this.depthWrite=!0,this.blendDst=c.OneMinusSrcAlphaFactor,this.blendEquation=c.AddEquation,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.opacity<1?(this.blending=c.AdditiveBlending,this.depthTest=!1):(this.blending=c.NormalBlending,this.depthTest=!0))},t.prototype.syncModel=function(e){var r="".concat(e.id,":").concat(e.materialVersion);r!==this.syncModelVersion&&(Object.assign(this,e.getMaterial()),this.uniforms.modelBoundingMax.value.copy(e.bounding.max),this.uniforms.modelBoundingMin.value.copy(e.bounding.min),this.syncModelVersion=r)},t.prototype.copy=function(e){return n.prototype.copy.call(this,this),this.pano0=e.pano0,this.pano1=e.pano1,this.progress=e.progress,this.transition=e.transition,this.shownFloorIndex=e.shownFloorIndex,this.brightness=e.brightness,this.clippers=e.clippers,this.constantColor=e.constantColor,this.modelAlpha=e.modelAlpha,this.useEDL=e.useEDL,this.useHQWeight=e.useHQWeight,this.useHQDepth=e.useHQDepth,this.pointColor=e.pointColor,this.pointSize=e.pointSize,this.pointShape=e.pointShape,this.pointScale=e.pointScale,this.pointBack=e.pointBack,this.pointMinPixel=e.pointMinPixel,this.pointMaxPixel=e.pointMaxPixel,this.gradientTexture=e.gradientTexture,this},t}(c.ShaderMaterial),$i=4;function z0(n,t,e){var r=new DataView(t);if(n.magic=r.getUint32(e,!0),e+=$i,n.version=r.getUint32(e,!0),e+=$i,n.byteLength=r.getUint32(e,!0),e+=$i,n.version!==1)throw new Error("3D Tile Version ".concat(n.version," not supported"));return e}var ir,Ze;(function(n){n[n.BYTE=5120]="BYTE",n[n.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",n[n.SHORT=5122]="SHORT",n[n.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",n[n.INT=5124]="INT",n[n.UNSIGNED_INT=5125]="UNSIGNED_INT",n[n.FLOAT=5126]="FLOAT",n[n.DOUBLE=5130]="DOUBLE"})(Ze||(Ze={}));var Td=(ir={},ir[Ze.DOUBLE]=Float64Array,ir[Ze.FLOAT]=Float32Array,ir[Ze.UNSIGNED_SHORT]=Uint16Array,ir[Ze.UNSIGNED_INT]=Uint32Array,ir[Ze.UNSIGNED_BYTE]=Uint8Array,ir[Ze.BYTE]=Int8Array,ir[Ze.SHORT]=Int16Array,ir[Ze.INT]=Int32Array,ir),Pd={DOUBLE:Ze.DOUBLE,FLOAT:Ze.FLOAT,UNSIGNED_SHORT:Ze.UNSIGNED_SHORT,UNSIGNED_INT:Ze.UNSIGNED_INT,UNSIGNED_BYTE:Ze.UNSIGNED_BYTE,BYTE:Ze.BYTE,SHORT:Ze.SHORT,INT:Ze.INT};function wi(n){var t=Td[n];if(!t)throw new Error("Failed to convert GL type");return t}function ea(n){var t=wi(n);return t.BYTES_PER_ELEMENT}function Xo(n,t,e,r){e===void 0&&(e=0);var i=wi(n);if(e%ea(n)!==0){var a=r?t.slice(e,e+r*ea(n)):t.slice(e);return new i(a)}else return new i(t,e,r!=null?r:(t.byteLength-e)/ea(n))}function Bd(n){var t=Pd[n];if(!t)throw new Error("Failed to convert GL type");return t}var Q0=function(){function n(t,e){this.featuresLength=0,this.cachedTypedArrays={},this.json=t,this.buffer=e;var r=this.getGlobalProperty("POINTS_LENGTH",Ze.UNSIGNED_INT,1);r&&r.length&&(this.featuresLength=r[0])}return n.prototype.getExtension=function(t){return this.json.extensions&&this.json.extensions[t]},n.prototype.hasProperty=function(t){return!!this.json[t]},n.prototype.getGlobalProperty=function(t,e,r){var i=this.json[t];if(typeof i=="number"){var a=wi(e);return new a([i])}else if(Array.isArray(i)){var a=wi(e);return new a(i)}else if(i&&Number.isFinite(i.byteOffset))return this.getTypedArrayFromBinary(t,e,r,1,i.byteOffset);return null},n.prototype.getPropertyArray=function(t,e,r){var i=this.json[t];return i&&Number.isFinite(i.byteOffset)?("componentType"in i&&(e=Bd(i.componentType)),this.getTypedArrayFromBinary(t,e,r,this.featuresLength,i.byteOffset)):this.getTypedArrayFromArray(t,e,i)},n.prototype.getProperty=function(t,e,r,i,a){var o=this.json[t];if(!o)return null;var s=this.getPropertyArray(t,e,r);if(r===1)return a[0]=s[i],a;for(var l=0;l<r;++l)a[l]=s[r*i+l];return a},n.prototype.getTypedArrayFromBinary=function(t,e,r,i,a){var o=this.cachedTypedArrays,s=o[t];return s||(s=Xo(e,this.buffer.buffer,this.buffer.byteOffset+a,i*r),o[t]=s),s},n.prototype.getTypedArrayFromArray=function(t,e,r){var i=this.cachedTypedArrays,a=i[t];return a||(a=Xo(e,r),i[t]=a),a},n}(),hn=4,_o="b3dm tile in legacy format.";function U0(n,t,e){var r=new TextDecoder("utf8"),i=new Uint8Array(n,t,e),a=r.decode(i);return a}function q0(n,t,e){return e=Rd(n,t,e),e=kd(n,t,e),e=Fd(n,t,e),e}function Rd(n,t,e){var r=new DataView(t),i=0;n.header=n.header||{};var a=r.getUint32(e,!0);e+=hn;var o=r.getUint32(e,!0);e+=hn;var s=r.getUint32(e,!0);e+=hn;var l=r.getUint32(e,!0);return e+=hn,s>=570425344?(e-=hn*2,i=a,s=o,l=0,a=0,o=0,console.warn(_o)):l>=570425344&&(e-=hn,i=s,s=a,l=o,a=0,o=0,console.warn(_o)),n.header.featureTableJsonByteLength=a,n.header.featureTableBinaryByteLength=o,n.header.batchTableJsonByteLength=s,n.header.batchTableBinaryByteLength=l,n.header.batchLength=i,e}function kd(n,t,e){var r=n.header||{},i=r.featureTableJsonByteLength,a=r.featureTableBinaryByteLength,o=r.batchLength;if(n.featureTableJson={BATCH_LENGTH:o||0},i&&i>0){var s=U0(t,e,i);n.featureTableJson=JSON.parse(s)}e+=i||0,n.featureTableBinary=new Uint8Array(t,e,a),e+=a||0,n.rtcCenter=[0,0,0];var l=new Q0(n.featureTableJson,n.featureTableBinary);if(Array.isArray(l.json.RTC_CENTER)){var u=l.json.RTC_CENTER;n.rtcCenter[0]=u[0],n.rtcCenter[1]=u[1],n.rtcCenter[2]=u[2]}else{var u=l.getGlobalProperty("RTC_CENTER",Ze.FLOAT,3);u&&(n.rtcCenter[0]=u[0],n.rtcCenter[1]=u[1],n.rtcCenter[2]=u[2])}return e}function Fd(n,t,e){var r=n.header||{},i=r.batchTableJsonByteLength,a=r.batchTableBinaryByteLength;if(i&&i>0){var o=U0(t,e,i);n.batchTableJson=JSON.parse(o),e+=i,a&&a>0&&(n.batchTableBinary=new Uint8Array(t,e,a),n.batchTableBinary=new Uint8Array(n.batchTableBinary),e+=a)}return e}function Ld(n,t,e){var r=e!==void 0?new Uint8Array(n).subarray(t,t+e):new Uint8Array(n).subarray(t),i=new Uint8Array(r);return i.buffer}function Od(n,t,e){var r=n.byteLength-e;if(r===0)throw new Error("glTF byte length must be greater than 0.");return e%4!==0&&console.warn("".concat(n.type,": embedded glb is not aligned to a 4-byte boundary.")),n.gltfArrayBuffer=Ld(t,e,r),n.byteLength}function Ba(n){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(n);for(var t="",e=0,r=n.length;e<r;e++)t+=String.fromCharCode(n[e]);try{return decodeURIComponent(escape(t))}catch(i){return t}}var Ve={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},kn={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Ei={9728:c.NearestFilter,9729:c.LinearFilter,9984:c.NearestMipmapNearestFilter,9985:c.LinearMipmapNearestFilter,9986:c.NearestMipmapLinearFilter,9987:c.LinearMipmapLinearFilter},Ci={33071:c.ClampToEdgeWrapping,33648:c.MirroredRepeatWrapping,10497:c.RepeatWrapping},Zo={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Bt={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Vr={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},Vd={CUBICSPLINE:void 0,LINEAR:c.InterpolateLinear,STEP:c.InterpolateDiscrete},mr={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function ft(n){var t=[];for(var e in n)t.push(n[e]);return t}var Nd=function(){function n(t,e,r){this.json=t,this.extensions=e,this.options=r,this.cache=new Map,this.disposeSet=new Set,this.nodeNamesUsed={}}return n.prototype.dispose=function(){this.cache.clear(),this.disposeSet.forEach(function(t){typeof t.dispose=="function"&&t.dispose(),typeof t.close=="function"&&t.close()}),this.disposeSet.clear(),delete this.cache,delete this.disposeSet,delete this.json,delete this.extensions,delete this.options},n.prototype.markDefs=function(){for(var t=this.json.nodes||[],e=this.json.skins||[],r=this.json.meshes||[],i=0,a=e.length;i<a;i++)for(var o=e[i].joints,s=0,l=o.length;s<l;s++)t[o[s]].isBone=!0;for(var u=0,d=t.length;u<d;u++){var f=t[u];f.mesh!==void 0&&f.skin!==void 0&&(r[f.mesh].isSkinnedMesh=!0)}},n.prototype.parse=function(){var t=this,e=this.json,r=this.extensions;this.markDefs();for(var i=0,a=ft(r);i<a.length;i++){var o=a[i];o.markDefs(this)}return Promise.all(ft(r).map(function(s){return s.prepare(t)})).then(function(){var s,l,u;return Promise.all([Promise.all(((s=e.scenes)!==null&&s!==void 0?s:[]).map(function(d,f){return t.loadScene(f)})),Promise.all(((l=e.animations)!==null&&l!==void 0?l:[]).map(function(d,f){return t.loadAnimation(f)})),Promise.all(((u=e.cameras)!==null&&u!==void 0?u:[]).map(function(d,f){return t.loadCamera(f)}))])}).then(function(s){var l=s[0],u=s[1],d=s[2],f={json:t.json,scene:l[e.scene||0],scenes:l,animations:u,cameras:d,dispose:function(){return t.dispose()}};return Promise.all(ft(r).map(function(A){return A.emitResult(f,t)})).then(function(){return f})})},n.prototype.loadCamera=function(t){var e="camera:"+t,r=this.cache.get(e);if(r)return r;for(var i=null,a=0,o=ft(this.extensions);a<o.length;a++){var s=o[a];if(i=s.loadCamera(t,this),i)break}if(!i){var l=void 0,u=this.json.cameras[t],d=u[u.type];d?u.type==="perspective"?l=new c.PerspectiveCamera(c.MathUtils.radToDeg(d.yfov),d.aspectRatio||1,d.znear||1,d.zfar||2e6):u.type==="orthographic"?l=new c.OrthographicCamera(-d.xmag,d.xmag,d.ymag,-d.ymag,d.znear,d.zfar):(console.warn("glTF: Invalid camera type ".concat(u.type,".")),l=new c.Camera):(console.warn("glTF: Missing camera parameters."),l=new c.Camera),u.name&&(l.name=this.createUniqueName(u.name)),i=Promise.resolve(l)}return this.cache.set(e,i),i},n.prototype.loadSkin=function(t){var e="animation:"+t,r=this.cache.get(e);if(r)return r;var i,a=this.json.skins[t],o={joints:a.joints};return a.inverseBindMatrices===void 0?i=Promise.resolve(o):i=this.loadAccessor(a.inverseBindMatrices).then(function(s){return s&&(o.inverseBindMatrices=s),o}),this.cache.set(e,i),i},n.prototype.loadAnimation=function(t){var e="animation:"+t,r=this.cache.get(e);if(r)return r;for(var i=null,a=0,o=ft(this.extensions);a<o.length;a++){var s=o[a];if(i=s.loadAnimation(t,this),i)break}if(!i){for(var l=this.json,u=l.animations[t],d=[],f=[],A=[],m=[],h=[],v=0,y=u.channels.length;v<y;v++){var p=u.channels[v],g=u.samplers[p.sampler],x=p.target,b=x.node!==void 0?x.node:x.id,w=u.parameters!==void 0?u.parameters[g.input]:g.input,E=u.parameters!==void 0?u.parameters[g.output]:g.output;d.push(this.loadNode(b)),f.push(this.loadAccessor(w)),A.push(this.loadAccessor(E)),m.push(g),h.push(x)}i=Promise.all([Promise.all(d),Promise.all(f),Promise.all(A),Promise.all(m),Promise.all(h)]).then(function(M){for(var C=M[0],P=M[1],S=M[2],T=M[3],B=M[4],L=[],k=function(X,K){var Q=C[X],G=P[X],J=S[X],H=T[X],j=B[X];if(Q===void 0)return"continue";Q.updateMatrix(),Q.matrixAutoUpdate=!0;var Z=void 0;switch(Vr[j.path]){case Vr.weights:Z=c.NumberKeyframeTrack;break;case Vr.rotation:Z=c.QuaternionKeyframeTrack;break;case Vr.position:case Vr.scale:default:Z=c.VectorKeyframeTrack;break}var Y=Q.name?Q.name:Q.uuid,pe=H.interpolation!==void 0?Vd[H.interpolation]:c.InterpolateLinear,ee=[];Vr[j.path]===Vr.weights?Q.traverse(function(ve){ve.morphTargetInfluences&&ee.push(ve.name?ve.name:ve.uuid)}):ee.push(Y);var oe=J.array;if(J.normalized){for(var ie=ta(oe.constructor),ce=new Float32Array(oe.length),ne=0,ae=oe.length;ne<ae;ne++)ce[ne]=oe[ne]*ie;oe=ce}for(var ne=0,ae=ee.length;ne<ae;ne++){var de=new Z(ee[ne]+"."+Vr[j.path],G.array,oe,pe);L.push(de)}},O=0,D=C.length;O<D;O++)k(O);var N=u.name?u.name:"animation_"+t;return new c.AnimationClip(N,void 0,L)})}return this.cache.set(e,i),i},n.prototype.loadBuffer=function(t){var e=this.json.buffers[t];if(e.type&&e.type!=="arraybuffer")throw new Error("glTF: "+e.type+" buffer type is not supported.");var r="buffer:"+t,i=this.cache.get(r);if(i)return i;for(var a=null,o=0,s=ft(this.extensions);o<s.length;o++){var l=s[o];if(a=l.loadBuffer(t,this),a)break}if(!a){var u=this.json.buffers[t];a=this.options.fetcher.ajax(this.resolveResouce(u.uri),{responseType:"arraybuffer"}).then(function(d){return d.body})}return this.cache.set(r,a),a},n.prototype.loadBufferView=function(t){var e="bufferView:"+t,r=this.cache.get(e);if(r)return r;for(var i=null,a=0,o=ft(this.extensions);a<o.length;a++){var s=o[a];if(i=s.loadBufferView(t,this),i)break}if(!i){var l=this.json.bufferViews[t];i=this.loadBuffer(l.buffer).then(function(u){var d=l.byteLength||0,f=l.byteOffset||0;return u.slice(f,f+d)})}return this.cache.set(e,i),i},n.prototype.loadAccessor=function(t){var e=this,r="accessor:"+t,i=this.cache.get(r);if(i)return i;var a=null;if(!a){var o=this.json.accessors[t];if(o.bufferView===void 0&&o.sparse===void 0)a=Promise.resolve(null);else{var s=[];o.bufferView!==void 0?s.push(this.loadBufferView(o.bufferView)):s.push(Promise.resolve(null)),o.sparse!==void 0&&(s.push(this.loadBufferView(o.sparse.indices.bufferView)),s.push(this.loadBufferView(o.sparse.values.bufferView))),a=Promise.all(s).then(function(l){var u=l[0],d=Zo[o.type],f=kn[o.componentType],A=f.BYTES_PER_ELEMENT,m=A*d,h=o.byteOffset||0,v=o.bufferView!==void 0?e.json.bufferViews[o.bufferView].byteStride:void 0,y=o.normalized===!0,p,g;if(v&&v!==m){var x=Math.floor(h/v),b="InterleavedBuffer:"+o.bufferView+":"+o.componentType+":"+x+":"+o.count,w=e.cache.get(b);w||(p=new f(u,x*v,o.count*v/A),w=new c.InterleavedBuffer(p,v/A),e.cache.set(b,w)),g=new c.InterleavedBufferAttribute(w,d,h%v/A,y)}else u===null?p=new f(o.count*d):p=new f(u,h,o.count*d),g=new c.BufferAttribute(p,d,y);if(o.sparse!==void 0){var E=Zo.SCALAR,M=kn[o.sparse.indices.componentType],C=o.sparse.indices.byteOffset||0,P=o.sparse.values.byteOffset||0,S=new M(l[1],C,o.sparse.count*E),T=new f(l[2],P,o.sparse.count*d);u!==null&&(g=new c.BufferAttribute(g.array.slice(),g.itemSize,g.normalized));for(var B=0,L=S.length;B<L;B++){var k=S[B];if(g.setX(k,T[B*d]),d>=2&&g.setY(k,T[B*d+1]),d>=3&&g.setZ(k,T[B*d+2]),d>=4&&g.setW(k,T[B*d+3]),d>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return g})}}return this.cache.set(r,a),a},n.prototype.createPrimitiveKey=function(t){for(var e=0,r=ft(this.extensions);e<r.length;e++){var i=r[e],a=i.createPrimitiveKey(t,this);if(a)return a}for(var o="",s=Object.keys(t.attributes).sort(),l=0,u=s.length;l<u;l++)o+=s[l]+":"+t.attributes[s[l]]+";";return t.indices+":"+o+":"+t.mode},n.prototype.loadGeometry=function(t){for(var e=this,r=null,i=0,a=ft(this.extensions);i<a.length;i++){var o=a[i];if(r=o.loadGeometry(t,this),r)break}return r||(r=this.addGeometryPrimitiveAttributes(new c.BufferGeometry,t)),r=r.then(function(s){return e.disposeSet.add(s),s}),r},n.prototype.loadImage=function(t){for(var e=this,r=null,i=0,a=ft(this.extensions);i<a.length;i++){var o=a[i];if(r=o.loadImage(t,this),r)break}if(!r){var s=this.json.images[t];if(s.bufferView!==void 0){var l=this.json.bufferViews[s.bufferView];r=this.loadBuffer(l.buffer).then(function(d){var f=l.byteOffset||0,A=l.byteLength||0,m=new Uint8Array(d,f,A),h=new Blob([m],{type:s.mimeType});return Ia(h)})}else if(s.uri){var u=this.resolveResouce(s.uri);r=this.options.fetcher.loadImage(u,{},void 0,void 0,void 0,xi()).then(function(d){return d.body})}else throw new Error("glTF: Invalid image defs.")}return r=r.then(function(d){return e.disposeSet.add(d),d}),r},n.prototype.loadMaterialAsMeshStandardMaterial=function(t){var e=this,r=[],i=new c.MeshStandardMaterial;if(i.color=new c.Color(1,1,1),i.opacity=1,Object.keys(t.attributes).filter(function(d){return Bt[d]==="color"}).length>0&&(i.vertexColors=!0),Object.keys(t.attributes).filter(function(d){return Bt[d]==="normal"}).length===0&&(i.flatShading=!0),Object.keys(t.attributes).filter(function(d){return Bt[d]==="tangent"}).length===0&&(i.normalScale&&(i.normalScale.y*=-1),i.clearcoatNormalScale&&(i.clearcoatNormalScale.y*=-1)),t.material!==void 0){var a=this.json.materials[t.material];a.name&&(i.name=a.name);var o=a.pbrMetallicRoughness||{};if(Array.isArray(o.baseColorFactor)){var s=o.baseColorFactor;i.color.fromArray(s),i.opacity=s[3]}o.baseColorTexture!==void 0&&r.push(this.createMaterialTexture(o.baseColorTexture).then(function(d){d.encoding=c.sRGBEncoding,i.map=d,e.disposeSet.add(d)})),i.metalness=o.metallicFactor!==void 0?o.metallicFactor:1,i.roughness=o.roughnessFactor!==void 0?o.roughnessFactor:1,o.metallicRoughnessTexture!==void 0&&r.push(this.createMaterialTexture(o.metallicRoughnessTexture).then(function(d){d.encoding=c.sRGBEncoding,i.metalnessMap=d,i.roughnessMap=d,e.disposeSet.add(d)})),a.doubleSided===!0&&(i.side=c.DoubleSide);var l=a.alphaMode||mr.OPAQUE;if(l===mr.BLEND?(i.transparent=!0,i.depthWrite=!1):(i.transparent=!1,l===mr.MASK&&(i.alphaTest=a.alphaCutoff!==void 0?a.alphaCutoff:.5)),a.normalTexture!==void 0&&(r.push(this.createMaterialTexture(a.normalTexture).then(function(d){i.normalMap=d,e.disposeSet.add(d)})),i.normalScale=new c.Vector2(1,1),a.normalTexture.scale!==void 0)){var u=a.normalTexture.scale;i.normalScale.set(u,u)}a.occlusionTexture!==void 0&&(r.push(this.createMaterialTexture(a.occlusionTexture).then(function(d){i.aoMap=d,e.disposeSet.add(d)})),a.occlusionTexture.strength!==void 0&&(i.aoMapIntensity=a.occlusionTexture.strength)),a.emissiveFactor!==void 0&&(i.emissive=new c.Color().fromArray(a.emissiveFactor)),a.emissiveTexture!==void 0&&r.push(this.createMaterialTexture(a.emissiveTexture).then(function(d){i.emissiveMap=d,e.disposeSet.add(d)}))}return this.disposeSet.add(i),Promise.all(r).then(function(){return i})},n.prototype.loadMaterialAsLineBasicMaterial=function(t){var e=[],r=new c.LineBasicMaterial;if(r.color=new c.Color(1,1,1),r.opacity=1,Object.keys(t.attributes).filter(function(l){return Bt[l]==="color"}).length>0&&(r.vertexColors=!0),Object.keys(t.attributes).filter(function(l){return Bt[l]==="tangent"}).length===0&&(r.normalScale&&(r.normalScale.y*=-1),r.clearcoatNormalScale&&(r.clearcoatNormalScale.y*=-1)),t.material!==void 0){var i=this.json.materials[t.material];i.name&&(r.name=i.name);var a=i.pbrMetallicRoughness||{};if(Array.isArray(a.baseColorFactor)){var o=a.baseColorFactor;r.color.fromArray(o),r.opacity=o[3]}i.doubleSided===!0&&(r.side=c.DoubleSide);var s=i.alphaMode||mr.OPAQUE;s===mr.BLEND?(r.transparent=!0,r.depthWrite=!1):(r.transparent=!1,s===mr.MASK&&(r.alphaTest=i.alphaCutoff!==void 0?i.alphaCutoff:.5))}return this.disposeSet.add(r),Promise.all(e).then(function(){return r})},n.prototype.loadMaterialAsPointsMaterial=function(t){var e=this,r=[],i=new c.PointsMaterial;if(i.color=new c.Color(1,1,1),i.opacity=1,i.sizeAttenuation=!1,Object.keys(t.attributes).filter(function(u){return Bt[u]==="color"}).length>0&&(i.vertexColors=!0),Object.keys(t.attributes).filter(function(u){return Bt[u]==="tangent"}).length===0&&(i.normalScale&&(i.normalScale.y*=-1),i.clearcoatNormalScale&&(i.clearcoatNormalScale.y*=-1)),t.material!==void 0){var a=this.json.materials[t.material];a.name&&(i.name=a.name);var o=a.pbrMetallicRoughness||{};if(Array.isArray(o.baseColorFactor)){var s=o.baseColorFactor;i.color.fromArray(s),i.opacity=s[3]}o.baseColorTexture!==void 0&&r.push(this.createMaterialTexture(o.baseColorTexture).then(function(u){u.encoding=c.sRGBEncoding,i.map=u,e.disposeSet.add(u)})),a.doubleSided===!0&&(i.side=c.DoubleSide);var l=a.alphaMode||mr.OPAQUE;l===mr.BLEND?(i.transparent=!0,i.depthWrite=!1):(i.transparent=!1,l===mr.MASK&&(i.alphaTest=a.alphaCutoff!==void 0?a.alphaCutoff:.5))}return this.disposeSet.add(i),Promise.all(r).then(function(){return i})},n.prototype.loadMaterial=function(t){var e,r=(e=t.mode)!==null&&e!==void 0?e:Ve.TRIANGLES,i="material:"+this.createPrimitiveKey(t),a=this.cache.get(i);if(a)return a;for(var o=null,s=0,l=ft(this.extensions);s<l.length;s++){var u=l[s];if(o=u.loadMaterial(t,this),o)break}if(r===Ve.TRIANGLES||r===Ve.TRIANGLE_STRIP||r===Ve.TRIANGLE_FAN)o=this.loadMaterialAsMeshStandardMaterial(t);else if(r===Ve.LINES||r===Ve.LINE_STRIP||r===Ve.LINE_LOOP)o=this.loadMaterialAsLineBasicMaterial(t);else if(r===Ve.POINTS)o=this.loadMaterialAsPointsMaterial(t);else throw new Error("glTF: Primitive mode unsupported: "+r);return this.cache.set(i,o),o},n.prototype.loadTexture=function(t){var e=this,r="texture:"+t,i=this.cache.get(r);if(i)return i;for(var a=null,o=0,s=ft(this.extensions);o<s.length;o++){var l=s[o];if(a=l.loadTexture(t,this),a)break}if(!a){var u=this.json.textures[t];a=this.loadImage(u.source).then(function(d){var f=new c.Texture(d);f.needsUpdate=!0,f.flipY=!1,u.name&&(f.name=u.name);var A=e.json.samplers||{},m=A[u.sampler]||{};return f.magFilter=Ei[m.magFilter]||c.LinearFilter,f.minFilter=Ei[m.minFilter]||c.LinearMipmapLinearFilter,f.wrapS=Ci[m.wrapS]||c.RepeatWrapping,f.wrapT=Ci[m.wrapT]||c.RepeatWrapping,f.onUpdate=function(){d.close()},f})}return a=a.then(function(d){return e.disposeSet.add(d),d}),this.cache.set(r,a),a},n.prototype.loadMesh=function(t){for(var e=this,r=null,i=0,a=ft(this.extensions);i<a.length;i++){var o=a[i];if(r=o.loadMesh(t,this),r)break}if(!r){var s=this.json.meshes[t],l=s.primitives,u=Promise.all(l.map(function(f){return e.loadGeometry(f)})),d=Promise.all(l.map(function(f){return e.loadMaterial(f)}));r=Promise.all([u,d]).then(function(f){for(var A=f[0],m=f[1],h=[],v=0;v<l.length;v++){var y=l[v],p=A[v],g=m[v],x=y.mode||Ve.TRIANGLES,b=void 0;if(x===Ve.TRIANGLES||x===Ve.TRIANGLE_STRIP||x===Ve.TRIANGLE_FAN)if(x===Ve.TRIANGLE_STRIP?p=e.toGeometryTrianglesDrawMode(p,c.TriangleStripDrawMode):x===Ve.TRIANGLE_FAN&&(p=e.toGeometryTrianglesDrawMode(p,c.TriangleFanDrawMode)),e.disposeSet.add(p),s.isSkinnedMesh){var w=new c.SkinnedMesh(p,g);p.attributes.skinWeight.normalized||w.normalizeSkinWeights(),b=w}else b=new c.Mesh(p,g);else if(x===Ve.POINTS)b=new c.Points(p,g);else if(x===Ve.LINES)b=new c.LineSegments(p,g);else if(x===Ve.LINE_STRIP)b=new c.Line(p,g);else if(x===Ve.LINE_LOOP)b=new c.LineLoop(p,g);else throw new Error("glTF: Primitive mode unsupported: "+x);if(Object.keys(p.morphAttributes).length>0){if(s.weights!==void 0)for(var E=0,M=s.weights.length;E<M;E++)b.morphTargetInfluences[E]=s.weights[E];if(s.extras&&Array.isArray(s.extras.targetNames)){var C=s.extras.targetNames;if(b.morphTargetInfluences.length===C.length){b.morphTargetDictionary={};for(var E=0,M=C.length;E<M;E++)b.morphTargetDictionary[C[E]]=E}else console.warn("glTF: Invalid extras.targetNames length. Ignoring names.")}}b.name=e.createUniqueName(s.name||"mesh_"+t),h.push(b)}if(h.length===1)return h[0];for(var P=new c.Group,S=0,T=h;S<T.length;S++){var b=T[S];P.add(b)}return P})}return r},n.prototype.loadNodeAttachments=function(t){for(var e=[],r=0,i=ft(this.extensions);r<i.length;r++){var a=i[r],o=a.loadNodeAttachments(t,this);o&&e.push(o)}return e},n.prototype.loadNode=function(t){var e="node:"+t,r=this.cache.get(e);if(r)return r;var i=this.json,a=i.nodes[t],o=a.name?this.createUniqueName(a.name):"",s=[];a.mesh!==void 0&&s.push(this.loadMesh(a.mesh).then(function(A){if(a.weights!==void 0){var m=a.weights;A.traverse(function(h){if(h instanceof c.Mesh||h instanceof c.Line||h instanceof c.Points)for(var v=0,y=m.length;v<y;v++)h.morphTargetInfluences[v]=m[v]})}return A})),a.camera!==void 0&&s.push(this.loadCamera(a.camera));for(var l=this.loadNodeAttachments(t),u=0,d=l;u<d.length;u++){var f=d[u];s.push(f)}return Promise.all(s).then(function(A){var m;if(a.isBone===!0?m=new c.Bone:A.length>1?m=new c.Group:A.length===1?m=A[0]:m=new c.Object3D,m!==A[0])for(var h=0,v=A.length;h<v;h++)m.add(A[h]);if(a.name&&(m.name=o),a.matrix!==void 0){var y=new c.Matrix4;y.fromArray(a.matrix),m.applyMatrix4(y)}else a.translation!==void 0&&m.position.fromArray(a.translation),a.rotation!==void 0&&m.quaternion.fromArray(a.rotation),a.scale!==void 0&&m.scale.fromArray(a.scale);return m})},n.prototype.loadScene=function(t){var e=this.json,r=e.scenes[t],i=new c.Group;r.name&&(i.name=this.createUniqueName(r.name));for(var a=r.nodes||[],o=[],s=0,l=a.length;s<l;s++)o.push(this.buildNodeHierarchy(a[s],i));return Promise.all(o).then(function(){return i})},n.prototype.createMaterialTexture=function(t){var e=this;return this.loadTexture(t.index).then(function(r){for(var i=0,a=ft(e.extensions);i<a.length;i++){var o=a[i],s=o.extendTexture(r,t,e);s&&(r=s,e.disposeSet.add(r))}return r})},n.prototype.addGeometryPrimitiveAttributes=function(t,e){var r=this,i=e.attributes,a=[],o=function(w){var E=Bt[w]||w.toLowerCase();if(E in t.attributes)return"continue";a.push(s.loadAccessor(i[w]).then(function(M){M&&t.setAttribute(E,M)}))},s=this;for(var l in i)o(l);e.indices!==void 0&&!t.index&&a.push(this.loadAccessor(e.indices).then(function(w){w&&t.setIndex(w)}));var u=new c.Box3;if(i.POSITION!==void 0){var d=this.json.accessors[i.POSITION],f=d.min,A=d.max;if(f!==void 0&&A!==void 0){if(u.set(new c.Vector3(f[0],f[1],f[2]),new c.Vector3(A[0],A[1],A[2])),d.normalized){var m=ta(kn[d.componentType]);u.min.multiplyScalar(m),u.max.multiplyScalar(m)}}else console.warn("glTF: Missing min/max properties for accessor POSITION.")}var h=e.targets;if(h!==void 0){for(var v=new c.Vector3,y=new c.Vector3,p=0,g=h.length;p<g;p++){var x=h[p];if(x.POSITION!==void 0){var d=this.json.accessors[x.POSITION],f=d.min,A=d.max;if(f!==void 0&&A!==void 0){if(y.setX(Math.max(Math.abs(f[0]),Math.abs(A[0]))),y.setY(Math.max(Math.abs(f[1]),Math.abs(A[1]))),y.setZ(Math.max(Math.abs(f[2]),Math.abs(A[2]))),d.normalized){var m=ta(kn[d.componentType]);y.multiplyScalar(m)}v.max(y)}else console.warn("glTF: Missing min/max properties for accessor POSITION.")}}u.expandByVector(v)}t.boundingBox=u;var b=new c.Sphere;return u.getCenter(b.center),b.radius=u.min.distanceTo(u.max)/2,t.boundingSphere=b,Promise.all(a).then(function(){if(t.attributes.uv&&!t.attributes.uv2&&r.options.copyUV2&&t.setAttribute("uv2",t.attributes.uv),e.targets){for(var w=!1,E=!1,M=0,C=e.targets.length;M<C;M++){var P=e.targets[M];if(P.POSITION!==void 0&&(w=!0),P.NORMAL!==void 0&&(E=!0),w&&E)break}if(!w&&!E)return t;var S=[];t.morphTargetsRelative=!0;for(var T=function(B,L){var k=e.targets[B];w?S.push(r.loadAccessor(k.POSITION).then(function(O){O&&(t.morphAttributes.position[B]=O)})):t.morphAttributes.position[B]=t.attributes.position,E?S.push(r.loadAccessor(k.NORMAL).then(function(O){O&&(t.morphAttributes.normal[B]=O)})):t.morphAttributes.normal[B]=t.attributes.normal},M=0,C=e.targets.length;M<C;M++)T(M,C);return Promise.all(S).then(function(){return t})}else return t})},n.prototype.buildNodeHierarchy=function(t,e){var r=this,i=this.json.nodes[t];return this.loadNode(t).then(function(a){if(i.skin===void 0)return a;var o;return r.loadSkin(i.skin).then(function(s){o=s;for(var l=[],u=0,d=o.joints.length;u<d;u++)l.push(r.loadNode(o.joints[u]));return Promise.all(l)}).then(function(s){return a.traverse(function(l){if(l instanceof c.SkinnedMesh){for(var u=[],d=[],f=0,A=s.length;f<A;f++){var m=s[f];if(m instanceof c.Bone){u.push(m);var h=new c.Matrix4;o.inverseBindMatrices!==void 0&&h.fromArray(o.inverseBindMatrices.array,f*16),d.push(h)}else console.warn('glTF: Joint "%s" could not be found.',o.joints[f])}l.bind(new c.Skeleton(u,d),l.matrixWorld)}}),a})}).then(function(a){e.add(a);var o=[];if(i.children)for(var s=i.children,l=0,u=s.length;l<u;l++){var d=s[l];o.push(r.buildNodeHierarchy(d,a))}return Promise.all(o).then(function(){return a})})},n.prototype.createUniqueName=function(t){for(var e=c.PropertyBinding.sanitizeNodeName(t||""),r=e,i=1;this.nodeNamesUsed[r];++i)r=e+"_"+i;return this.nodeNamesUsed[r]=!0,r},n.prototype.resolveResouce=function(t){return xt(this.options.resourcePath,D0(t,this.options.search))},n.prototype.toGeometryTrianglesDrawMode=function(t,e){var r=t.getIndex();if(r===null){var i=[],a=t.getAttribute("position");if(a!==void 0){for(var o=0;o<a.count;o++)i.push(o);t.setIndex(i),r=t.getIndex()}}if(r===null)return console.error("glTF: Undefined position attribute. Processing not possible."),t;var s=r.count-2,l=[];if(e===c.TriangleFanDrawMode)for(var o=1;o<=s;o++)l.push(r.getX(0)),l.push(r.getX(o)),l.push(r.getX(o+1));else for(var o=0;o<s;o++)o%2===0?(l.push(r.getX(o)),l.push(r.getX(o+1)),l.push(r.getX(o+2))):(l.push(r.getX(o+2)),l.push(r.getX(o+1)),l.push(r.getX(o)));l.length/3!==s&&console.error("glTF: Unable to generate correct amount of triangles.");var u=t.clone();return u.setIndex(l),this.disposeSet.add(u),u},n}();function ta(n){switch(n){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("glTF: Unsupported normalized accessor component type.")}}var lr=function(){function n(){}return n.prototype.markDefs=function(t){},n.prototype.prepare=function(t){},n.prototype.emitResult=function(t,e){},n.prototype.createPrimitiveKey=function(t,e){},n.prototype.extendTexture=function(t,e,r){return null},n.prototype.loadBuffer=function(t,e){return null},n.prototype.loadBufferView=function(t,e){return null},n.prototype.loadImage=function(t,e){return null},n.prototype.loadTexture=function(t,e){return null},n.prototype.loadGeometry=function(t,e){return null},n.prototype.loadMaterial=function(t,e){return null},n.prototype.loadMesh=function(t,e){return null},n.prototype.loadNodeAttachments=function(t,e){return null},n.prototype.loadCamera=function(t,e){return null},n.prototype.loadAnimation=function(t,e){return null},n}(),Dd=function(n){ue(t,n);function t(){var e=n.call(this)||this;return e.header={magic:"",version:0,length:0},e.content="",e.body=null,e}return t.getMagic=function(e){return Ba(new Uint8Array(e.slice(0,4)))},t.prototype.loadGlbBinary=function(e){var r=new DataView(e,0,t.HEADER_LENGTH);if(this.header={magic:t.getMagic(e),version:r.getUint32(4,!0),length:r.getUint32(8,!0)},this.header.magic!==t.HEADER_MAGIC)throw new Error("glTF:KHR_binary_glTF: Unsupported.");if(this.header.version<2)throw new Error("glTF:KHR_binary_glTF: Legacy binary file detected.");for(var i=new DataView(e,t.HEADER_LENGTH),a=0,o=null,s=null;a<i.byteLength;){var l=i.getUint32(a,!0);if(a+=4,l!==0){var u=i.getUint32(a,!0);if(a+=4,u===t.CHUNK_TYPES.JSON){var d=new Uint8Array(e,t.HEADER_LENGTH+a,l);o=Ba(d)}else if(u===t.CHUNK_TYPES.BIN){var f=t.HEADER_LENGTH+a;s=e.slice(f,f+l)}a+=l}}if(o===null)throw new Error("glTF:KHR_binary_glTF: JSON content not found.");this.content=o,this.body=s},t.prototype.loadBuffer=function(e,r){var i=r.json.buffers[e];return i.uri===void 0&&e===0&&this.body?Promise.resolve(this.body):null},t.prototype.clear=function(){this.body=null,this.content=""},t.HEADER_MAGIC="glTF",t.HEADER_LENGTH=12,t.CHUNK_TYPES={JSON:1313821514,BIN:5130562},t}(lr),zd="https://vr-public.realsee-cdn.cn/release/static/image/release/five/resource/draco/1.5.6/",Yo={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},$o={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"},Qd=function(){function n(){this.decoderPath=zd,this.decoderConfig={},this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL=""}return n.prototype.setDecoderPath=function(t){this.decoderPath=t},n.prototype.setDecoderConfig=function(t){return this.decoderConfig=t,this},n.prototype.setWorkerLimit=function(t){return this.workerLimit=t,this},n.prototype.decodeDracoFile=function(t,e,r,i){var a={attributeIDs:r||Yo,attributeTypes:i||$o,useUniqueIDs:!!r};this.decodeGeometry(t,a).then(e)},n.prototype.decodeGeometry=function(t,e){var r=this;e===void 0&&(e={attributeIDs:Yo,attributeTypes:$o,useUniqueIDs:!1});for(var i in e.attributeTypes){var a=e.attributeTypes[i];a.BYTES_PER_ELEMENT!==void 0&&(e.attributeTypes[i]=a.name)}var o,s=this.workerNextTaskID++,l=t.byteLength,u=this._getWorker(s,l).then(function(d){return o=d,new Promise(function(f,A){o._callbacks[s]={resolve:f,reject:A},o.postMessage({type:"decode",id:s,taskConfig:e,buffer:t},[t])})}).then(function(d){return r._createGeometry(d.geometry)});return u.catch(function(){return!0}).then(function(){o&&s&&r._releaseTask(o,s)}),u},n.prototype._createGeometry=function(t){var e=new c.BufferGeometry;t.index&&e.setIndex(new c.BufferAttribute(t.index.array,1));for(var r=0;r<t.attributes.length;r++){var i=t.attributes[r],a=i.name,o=i.array,s=i.itemSize;e.setAttribute(a,new c.BufferAttribute(o,s))}return e},n.prototype._initDecoder=function(){var t=this;if(this.decoderPending)return this.decoderPending;var e=typeof WebAssembly!="object"||this.decoderConfig.type==="js";if(e){var r=xn(this.decoderPath+"draco_decoder.js",{responseType:"text"}).then(function(a){return a.body});this.decoderPending=r.then(function(a){var o=["/* draco decoder */",a,"","/* worker */",es].join(`
|
|
418
|
+
`);t.workerSourceURL=URL.createObjectURL(new Blob([o]))})}else{var r=xn(this.decoderPath+"draco_wasm_wrapper.js",{responseType:"text"}).then(function(o){return o.body}),i=xn(this.decoderPath+"draco_decoder.wasm",{responseType:"arraybuffer"}).then(function(o){return o.body});this.decoderPending=Promise.all([r,i]).then(function(o){var s=o[0],l=o[1];t.decoderConfig.wasmBinary=l;var u=["/* draco decoder */",s,"","/* worker */",es].join(`
|
|
419
|
+
`);t.workerSourceURL=URL.createObjectURL(new Blob([u]))})}return this.decoderPending},n.prototype._getWorker=function(t,e){var r=this;return this._initDecoder().then(function(){if(r.workerPool.length<r.workerLimit){var i=new Worker(r.workerSourceURL);i._callbacks={},i._taskCosts={},i._taskLoad=0,i.postMessage({type:"init",decoderConfig:r.decoderConfig}),i.onmessage=function(o){var s=o.data;switch(s.type){case"decode":i._callbacks[s.id].resolve(s);break;case"error":i._callbacks[s.id].reject(s);break;default:console.error('DRACO: Unexpected message, "'+s.type+'"')}},r.workerPool.push(i)}else r.workerPool.sort(function(o,s){return o._taskLoad>s._taskLoad?-1:1});var a=r.workerPool[r.workerPool.length-1];return a._taskCosts[t]=e,a._taskLoad+=e,a})},n.prototype._releaseTask=function(t,e){t._taskLoad-=t._taskCosts[e],delete t._callbacks[e],delete t._taskCosts[e]},n.prototype.dispose=function(){for(var t=0;t<this.workerPool.length;++t)this.workerPool[t].terminate();return this.workerPool.length=0,this},n}(),Mi=new Qd,es=`
|
|
420
420
|
let decoderConfig;
|
|
421
421
|
let decoderPending;
|
|
422
422
|
|
|
@@ -611,8 +611,8 @@ void main() {
|
|
|
611
611
|
}
|
|
612
612
|
|
|
613
613
|
}
|
|
614
|
-
`,ra="KHR_draco_mesh_compression",
|
|
615
|
-
`);t.workerSourceURL=URL.createObjectURL(new Blob([s])),t.transcoderBinary=o,t.workerPool.setWorkerCreator(function(){var l=new Worker(t.workerSourceURL),u=t.transcoderBinary.slice(0);return l.postMessage({type:"init",config:t.workerConfig,transcoderBinary:u},[u]),l})})}return this.transcoderPending},n.prototype.parse=function(t){return this._createTexture([t])},n.prototype._createTextureFrom=function(t){var e=t.mipmaps,r=t.width,i=t.height,a=t.format,o=t.type,s=t.error,l=t.dfdTransferFn,u=t.dfdFlags;if(o==="error")return Promise.reject(s);var d=new c.CompressedTexture(e,r,i,a,c.UnsignedByteType);return d.minFilter=e.length===1?c.LinearFilter:c.LinearMipmapLinearFilter,d.magFilter=c.LinearFilter,d.generateMipmaps=!1,d.needsUpdate=!0,d.encoding=l===
|
|
614
|
+
`,ra="KHR_draco_mesh_compression",Ud=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadGeometry=function(e,r){return e.extensions&&e.extensions[ra]?this.decodePrimitive(e,r).then(function(i){return r.addGeometryPrimitiveAttributes(i,e)}):null},t.prototype.decodePrimitive=function(e,r){var i=r.json,a=e.extensions[ra].bufferView,o=e.extensions[ra].attributes,s={},l={},u={};for(var d in o){var f=Bt[d]||d.toLowerCase();s[f]=o[d]}for(var d in e.attributes){var f=Bt[d]||d.toLowerCase();if(o[d]!==void 0){var A=i.accessors[e.attributes[d]],m=kn[A.componentType];u[f]=m,l[f]=A.normalized===!0}}return r.loadBufferView(a).then(function(h){return new Promise(function(v){Mi.decodeDracoFile(h,function(y){for(var p in y.attributes){var g=y.attributes[p],x=l[p];x!==void 0&&(g.normalized=x)}v(y)},s,u)})})},t}(lr),qd=function(){function n(t){this.pool=t,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0,this.workerCreator=null}return n.prototype._initWorker=function(t){if(this.workerCreator&&!this.workers[t]){var e=this.workerCreator();e.addEventListener("message",this._onMessage.bind(this,t)),this.workers[t]=e}},n.prototype._getIdleWorker=function(){for(var t=0;t<this.pool;t++)if(!(this.workerStatus&1<<t))return t;return-1},n.prototype._onMessage=function(t,e){var r=this.workersResolve[t];if(r&&r(e),this.queue.length){var i=this.queue.shift(),a=i.resolve,o=i.msg,s=i.transfer;this.workersResolve[t]=a,this.workers[t].postMessage(o,s)}else this.workerStatus^=1<<t},n.prototype.setWorkerCreator=function(t){this.workerCreator=t},n.prototype.setWorkerLimit=function(t){this.pool=t},n.prototype.postMessage=function(t,e){var r=this;return new Promise(function(i){var a=r._getIdleWorker();a!==-1?(r._initWorker(a),r.workerStatus|=1<<a,r.workersResolve[a]=i,r.workers[a].postMessage(t,e)):r.queue.push({resolve:i,msg:t,transfer:e})})},n.prototype.dispose=function(){this.workers.forEach(function(t){return t.terminate()}),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0},n}(),Hd="https://vr-public.realsee-cdn.cn/release/static/image/release/five/resource/basis/1.16/",Gd=2,Kd=1,jd=function(){function n(){this.transcoderPath=Hd,this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new qd(4),this.workerSourceURL="",this.workerConfig=null}return n.prototype.setTranscoderPath=function(t){this.transcoderPath=t},n.prototype.detectSupport=function(t){if(!this.workerConfig){var e=console.warn;console.warn=function(){},this.workerConfig={astcSupported:!!t.extensions.get("WEBGL_compressed_texture_astc"),etc1Supported:!!t.extensions.get("WEBGL_compressed_texture_etc1"),etc2Supported:!!t.extensions.get("WEBGL_compressed_texture_etc"),dxtSupported:!!t.extensions.get("WEBGL_compressed_texture_s3tc"),bptcSupported:!!t.extensions.get("EXT_texture_compression_bptc"),pvrtcSupported:!!t.extensions.get("WEBGL_compressed_texture_pvrtc")||!!t.extensions.get("WEBKIT_WEBGL_compressed_texture_pvrtc")},console.warn=e}return this},n.prototype.init=function(){var t=this;if(!this.transcoderPending){var e=xn(this.transcoderPath+"basis_transcoder.js",{responseType:"text"}).then(function(i){return i.body}),r=xn(this.transcoderPath+"basis_transcoder.wasm",{responseType:"arraybuffer"}).then(function(i){return i.body});this.transcoderPending=Promise.all([e,r]).then(function(i){var a=i[0],o=i[1],s=["/* constants */","let _EngineFormat = "+JSON.stringify(Xd),"let _TranscoderFormat = "+JSON.stringify(Wd),"let _BasisFormat = "+JSON.stringify(Jd),"/* basis_transcoder.js */",a,"/* worker */",_d].join(`
|
|
615
|
+
`);t.workerSourceURL=URL.createObjectURL(new Blob([s])),t.transcoderBinary=o,t.workerPool.setWorkerCreator(function(){var l=new Worker(t.workerSourceURL),u=t.transcoderBinary.slice(0);return l.postMessage({type:"init",config:t.workerConfig,transcoderBinary:u},[u]),l})})}return this.transcoderPending},n.prototype.parse=function(t){return this._createTexture([t])},n.prototype._createTextureFrom=function(t){var e=t.mipmaps,r=t.width,i=t.height,a=t.format,o=t.type,s=t.error,l=t.dfdTransferFn,u=t.dfdFlags;if(o==="error")return Promise.reject(s);var d=new c.CompressedTexture(e,r,i,a,c.UnsignedByteType);return d.minFilter=e.length===1?c.LinearFilter:c.LinearMipmapLinearFilter,d.magFilter=c.LinearFilter,d.generateMipmaps=!1,d.needsUpdate=!0,d.encoding=l===Gd?c.sRGBEncoding:c.LinearEncoding,d.premultiplyAlpha=!!(u&Kd),Promise.resolve(d)},n.prototype._createTexture=function(t){var e=this,r=this.init().then(function(){return e.workerPool.postMessage({type:"transcode",buffers:t},t)}).then(function(i){return e._createTextureFrom(i.data)});return r},n.prototype.dispose=function(){return URL.revokeObjectURL(this.workerSourceURL),this.workerPool.dispose(),this},n}(),qn=new jd,Jd={ETC1S:0,UASTC_4x4:1},Wd={ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16},Xd={RGBAFormat:c.RGBAFormat,RGBA_ASTC_4x4_Format:c.RGBA_ASTC_4x4_Format,RGBA_BPTC_Format:c.RGBA_BPTC_Format,RGBA_ETC2_EAC_Format:c.RGBA_ETC2_EAC_Format,RGBA_PVRTC_4BPPV1_Format:c.RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT5_Format:c.RGBA_S3TC_DXT5_Format,RGB_ETC1_Format:c.RGB_ETC1_Format,RGB_ETC2_Format:c.RGB_ETC2_Format,RGB_PVRTC_4BPPV1_Format:c.RGB_PVRTC_4BPPV1_Format,RGB_S3TC_DXT1_Format:c.RGB_S3TC_DXT1_Format},_d=`
|
|
616
616
|
|
|
617
617
|
let config;
|
|
618
618
|
let transcoderPending;
|
|
@@ -880,18 +880,18 @@ void main() {
|
|
|
880
880
|
return ( value & ( value - 1 ) ) === 0 && value !== 0;
|
|
881
881
|
|
|
882
882
|
}
|
|
883
|
-
`,es="KHR_texture_basisu",_d=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadTexture=function(e,r){var i=r.json.textures[e];if(!i.extensions||!i.extensions[es])return null;var a=i.extensions[es],o=r.json.images[a.source],s=null;if(o.bufferView!==void 0)s=r.loadBufferView(o.bufferView).then(function(l){return qn.parse(l)});else if(o.uri)s=r.options.fetcher.ajax(r.resolveResouce(o.uri),{responseType:"arraybuffer"}).then(function(l){return qn.parse(l.body)});else throw new Error("glTF: Invalid image defs.");return s},t}(lr),ts="KHR_texture_transform",Zd=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.extendTexture=function(e,r,i){var a=r.extensions!==void 0?r.extensions[ts]:void 0;return a?(a.texCoord!==void 0&&console.warn('glTF: Custom UV sets in "'+ts+'" extension not yet supported.'),a.offset===void 0&&a.rotation===void 0&&a.scale===void 0||(e=e.clone(),e.needsUpdate=!0,a.offset!==void 0&&e.offset.fromArray(a.offset),a.rotation!==void 0&&(e.rotation=a.rotation),a.scale!==void 0&&e.repeat.fromArray(a.scale)),e):null},t}(lr),Yd=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(lr),$d=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(lr),na=function(){var n="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q;iekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq:78Yqdbk:qzezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9UhlaicefhodnadTmbalc;WFbGglcjdalcjd6EhDcbhqinaqae9pmeaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxdndndndnalc9WGgmTmbcbhPcehsawcjdfhzaohHinaraH9Rax6midnaraHaxfgo9RcK6mbczhlinalgic9Wfglawcj;cbffhOdndndndndnaHalco4fRbbalci4coG4ciGPlbedibkaO9cb83ibaOcwf9cb83ibxikaOaoRblaoRbbgAco4glalciSgCE86bbawcj;cbfaifglcGfaoclfaCfgORbbaAcl4ciGgCaCciSgCE86bbalcVfaOaCfgORbbaAcd4ciGgCaCciSgCE86bbalc7faOaCfgORbbaAciGgAaAciSgAE86bbalctfaOaAfgARbbaoRbegOco4gCaCciSgCE86bbalc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc93faAaCfgARbbaOciGgOaOciSgOE86bbalc94faAaOfgARbbaoRbdgOco4gCaCciSgCE86bbalc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc97faAaCfgARbbaOciGgOaOciSgOE86bbalc98faAaOfgORbbaoRbigoco4gAaAciSgAE86bbalc99faOaAfgORbbaocl4ciGgAaAciSgAE86bbalc9:faOaAfgORbbaocd4ciGgAaAciSgAE86bbalcufaOaAfglRbbaociGgoaociSgoE86bbalaofhoxdkaOaoRbwaoRbbgAcl4glalcsSgCE86bbawcj;cbfaifglcGfaocwfaCfgORbbaAcsGgAaAcsSgAE86bbalcVfaOaAfgORbbaoRbegAcl4gCaCcsSgCE86bbalc7faOaCfgORbbaAcsGgAaAcsSgAE86bbalctfaOaAfgORbbaoRbdgAcl4gCaCcsSgCE86bbalc91faOaCfgORbbaAcsGgAaAcsSgAE86bbalc4faOaAfgORbbaoRbigAcl4gCaCcsSgCE86bbalc93faOaCfgORbbaAcsGgAaAcsSgAE86bbalc94faOaAfgORbbaoRblgAcl4gCaCcsSgCE86bbalc95faOaCfgORbbaAcsGgAaAcsSgAE86bbalc96faOaAfgORbbaoRbvgAcl4gCaCcsSgCE86bbalc97faOaCfgORbbaAcsGgAaAcsSgAE86bbalc98faOaAfgORbbaoRbogAcl4gCaCcsSgCE86bbalc99faOaCfgORbbaAcsGgAaAcsSgAE86bbalc9:faOaAfgORbbaoRbrgocl4gAaAcsSgAE86bbalcufaOaAfglRbbaocsGgoaocsSgoE86bbalaofhoxekaOao8Pbb83bbaOcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaiczfhlarao9RcL0mekkaiam6miaoTmidnakTmbawaPfRbbhOawcj;cbfhlazhiakhHinaialRbbgAce4cbaAceG9R7aOfgO86bbaiadfhialcefhlaHcufgHmbkkazcefhzaPcefgPad6hsaohHaPad9hmexvkkcbhoasceGmdxikaoaxad2fhPdnakTmbcbhmcehsawcjdfhCinarao9Rax6miaoTmdaoaxfhoawamfRbbhOawcj;cbfhlaChiakhHinaialRbbgAce4cbaAceG9R7aOfgO86bbaiadfhialcefhlaHcufgHmbkaCcefhCamcefgmad6hsamad9hmbkaPhoxikcbhlcehsinarao9Rax6mdaoTmeaoaxfhoalcefglad6hsadal9hmbkaPhoxdkcbhoasceGTmekc9:hoxikabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekcbc99arao9Radcaadca0ESEhokavcj;ebf8Kjjjjbaok;xzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfalaDcu7gPcl4fcsGcitfgsydlhzasydbhHdnaDcsGgDak9pmbavaiaPfcsGcdtfydbaxaDEhsaDThDdndnadcd9hmbabarcetfgPaH87ebaPcdfaz87ebaPclfas87ebxekabarcdtfgPaHBdbaPclfazBdbaPcwfasBdbkaxaDfhxavc;abfalcitfgPasBdbaPazBdlavaicdtfasBdbavc;abfalcefcsGglcitfgPaHBdbaPasBdlaiaDfhialcefhlxdkdndnaDcsSmbamaDfaDc987fcefhmxekaocefhDao8SbbgscFeGhPdndnascu9mmbaDhoxekaocvfhoaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhokaPce4cbaPceG9R7amfhmkdndnadcd9hmbabarcetfgDaH87ebaDcdfaz87ebaDclfam87ebxekabarcdtfgDaHBdbaDclfazBdbaDcwfamBdbkavc;abfalcitfgDamBdbaDazBdlavaicdtfamBdbavc;abfalcefcsGglcitfgDaHBdbaDamBdlaicefhialcefhlxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHcdfaD87ebaHclfas87ebxekabarcdtfgHaxBdbaHclfaDBdbaHcwfasBdbkavaicdtfaxBdbavc;abfalcitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfalcefcsGcitfgHasBdbaHaDBdlavaiaPfcsGgicdtfasBdbavc;abfalcdfcsGglcitfgDaxBdbaDasBdlalcefhlaiaOfhiazaOfhxxekaxcbaoRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbaocefhDxekaocdfhDao8SbegPcFeGhsdnaPcu9kmbaocofhAascFbGhscrhodninaD8SbbgPcFbGaotasVhsaPcu9kmeaDcefhDaocrfgoc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbgocFeGhPdnaocu9kmbaDcvfhzaPcFbGhPcrhodninas8SbbgDcFbGaotaPVhPaDcu9kmeascefhsaocrfgoc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashoxekascefhoas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninao8SbbgscFbGaDtaPVhPascu9kmeaocefhoaDcrfgDc8J9hmbkaOhoxekaocefhokaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDcdfaz87ebaDclfaO87ebxekabarcdtfgDaABdbaDclfazBdbaDcwfaOBdbkavc;abfalcitfgDazBdbaDaABdlavaicdtfaABdbavc;abfalcefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfalcdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiarcifgrae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;siliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabavcefciGaiVcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:Ohkxekcjjjj94hkkabavcdfciGaiVcetfak87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:Ohqxekcjjjj94hqkabavcufciGaiVcetfaq87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohqxekcjjjj94hqkabavciGaiVcetfaq87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj;8ifcjjj98G::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklz9Kbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q;Aekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq;a9tqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk;d8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhwcbhDinaDae9pmeawaeaD9RaDawfae6Egqcsfgoc9WGgkci2hxakcethmaocl4cifcd4hPabaDad2fhscbhzdnincehHalhOcbhAdninaraO9RaP6miavcj;cbfaAak2fhCaOaPfhlcbhidnakc;ab6mbaral9Rc;Gb6mbcbhoinaCaofhidndndndndnaOaoco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklbalczfhlkdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklzalczfhlkdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklaalczfhlkdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalclfaYpQbfaXc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalcwfaYpQbfaXc:q:yjjbfRbbfhlxekaialpbbbpkl8Walczfhlkaoc;abfhiaocjefak0meaihoaral9Rc;Fb0mbkkdndnaiak9pmbaici4hoinaral9RcK6mdaCaifhXdndndndndnaOaico4fRbbaocoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpklbxikaXalpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaXalpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaXalpbbbpklbalczfhlkaocdfhoaiczfgiak6mbkkalTmbaAci6hHalhOaAcefgAclSmdxekkcbhlaHceGmdkdnakTmbavcjdfazfhiavazfpbdbhYcbhXinaiavcj;cbfaXfgopblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLaoakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEaoamfpblbg3cep9Ta3aQp9op9Hp9rg3aoaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfhiaXczfgXak6mbkkazclfgzad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfhDc9:hoalmexikkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk;tzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfalaDcu7gPcl4fcsGcitfgsydlhzasydbhHdnaDcsGgDak9pmbavaiaPfcsGcdtfydbaxaDEhsaDThDdndnadcd9hmbabarcetfgPaH87ebaPcdfaz87ebaPclfas87ebxekabarcdtfgPaHBdbaPclfazBdbaPcwfasBdbkaxaDfhxavc;abfalcitfgPasBdbaPazBdlavaicdtfasBdbavc;abfalcefcsGglcitfgPaHBdbaPasBdlaiaDfhialcefhlxdkdndnaDcsSmbamaDfaDc987fcefhmxekaocefhDao8SbbgscFeGhPdndnascu9mmbaDhoxekaocvfhoaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhokaPce4cbaPceG9R7amfhmkdndnadcd9hmbabarcetfgDaH87ebaDcdfaz87ebaDclfam87ebxekabarcdtfgDaHBdbaDclfazBdbaDcwfamBdbkavc;abfalcitfgDamBdbaDazBdlavaicdtfamBdbavc;abfalcefcsGglcitfgDaHBdbaDamBdlaicefhialcefhlxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHcdfaD87ebaHclfas87ebxekabarcdtfgHaxBdbaHclfaDBdbaHcwfasBdbkavaicdtfaxBdbavc;abfalcitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfalcefcsGcitfgHasBdbaHaDBdlavaiaPfcsGgicdtfasBdbavc;abfalcdfcsGglcitfgDaxBdbaDasBdlalcefhlaiaOfhiazaOfhxxekaxcbaoRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbaocefhDxekaocdfhDao8SbegPcFeGhsdnaPcu9kmbaocofhAascFbGhscrhodninaD8SbbgPcFbGaotasVhsaPcu9kmeaDcefhDaocrfgoc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbgocFeGhPdnaocu9kmbaDcvfhzaPcFbGhPcrhodninas8SbbgDcFbGaotaPVhPaDcu9kmeascefhsaocrfgoc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashoxekascefhoas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninao8SbbgscFbGaDtaPVhPascu9kmeaocefhoaDcrfgDc8J9hmbkaOhoxekaocefhokaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDcdfaz87ebaDclfaO87ebxekabarcdtfgDaABdbaDclfazBdbaDcwfaOBdbkavc;abfalcitfgDazBdbaDaABdlavaicdtfaABdbavc;abfalcefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfalcdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiarcifgrae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:wPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalae9pmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oawaopmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalae9pmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oawaopmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalae9pmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepkbbadczfhdaeclfgeav6mbkkdnaval9pmbaialciGgecdtgdVcbc;abad9R;8kbaiabavcdtfgvad;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepklbkavaiad;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz9Tbb",e=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]),r=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var i=WebAssembly.validate(e)?t:n,a,o=WebAssembly.instantiate(s(i),{}).then(function(p){a=p.instance,a.exports.__wasm_call_ctors()});function s(p){for(var g=new Uint8Array(p.length),x=0;x<p.length;++x){var b=p.charCodeAt(x);g[x]=b>96?b-97:b>64?b-39:b+4}for(var w=0,x=0;x<p.length;++x)g[w++]=g[x]<60?r[g[x]]:(g[x]-60)*64+g[++x];return g.buffer.slice(0,w)}function l(p,g,x,b,w,E){var M=a.exports.sbrk,C=x+3&-4,P=M(C*b),S=M(w.length),T=new Uint8Array(a.exports.memory.buffer);T.set(w,S);var B=p(P,x,b,S,w.length);if(B==0&&E&&E(P,C,b),g.set(T.subarray(P,P+x*b)),M(P-M(0)),B!=0)throw new Error("Malformed buffer data: "+B)}var u={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},d={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},f=[],A=0;function m(p){var g={object:new Worker(p),pending:0,requests:{}};return g.object.onmessage=function(x){var b=x.data;g.pending-=b.count,g.requests[b.id][b.action](b.value),delete g.requests[b.id]},g}function h(p){for(var g="var instance; var ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(s(i))+"]), {}).then(function(result) { instance = result.instance; instance.exports.__wasm_call_ctors(); });self.onmessage = workerProcess;"+l.toString()+y.toString(),x=new Blob([g],{type:"text/javascript"}),b=URL.createObjectURL(x),w=0;w<p;++w)f[w]=m(b);URL.revokeObjectURL(b)}function v(p,g,x,b,w){for(var E=f[0],M=1;M<f.length;++M)f[M].pending<E.pending&&(E=f[M]);return new Promise(function(C,P){var S=new Uint8Array(x),T=A++;E.pending+=p,E.requests[T]={resolve:C,reject:P},E.object.postMessage({id:T,count:p,size:g,source:S,mode:b,filter:w},[S.buffer])})}function y(p){o.then(function(){var g=p.data;try{var x=new Uint8Array(g.count*g.size);l(a.exports[g.mode],x,g.count,g.size,g.source,a.exports[g.filter]),self.postMessage({id:g.id,count:g.count,action:"resolve",value:x},[x.buffer])}catch(b){self.postMessage({id:g.id,count:g.count,action:"reject",value:b})}})}return{ready:o,supported:!0,useWorkers:function(p){h(p)},decodeVertexBuffer:function(p,g,x,b,w){l(a.exports.meshopt_decodeVertexBuffer,p,g,x,b,a.exports[u[w]])},decodeIndexBuffer:function(p,g,x,b){l(a.exports.meshopt_decodeIndexBuffer,p,g,x,b)},decodeIndexSequence:function(p,g,x,b){l(a.exports.meshopt_decodeIndexSequence,p,g,x,b)},decodeGltfBuffer:function(p,g,x,b,w,E){l(a.exports[d[w]],p,g,x,b,a.exports[u[E]])},decodeGltfBufferAsync:function(p,g,x,b,w){return f.length>0?v(p,g,x,d[b],u[w]):o.then(function(){var E=new Uint8Array(p*g);return l(a.exports[d[b]],E,p,g,x,a.exports[u[w]]),E})}}}(),ia="EXT_meshopt_compression",ef=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadBufferView=function(e,r){var i=r.json,a=i.bufferViews[e];if(a.extensions&&a.extensions[ia]){var o=a.extensions[ia],s=r.loadBuffer(o.buffer);if(!na.supported){if(i.extensionsRequired&&i.extensionsRequired.indexOf(ia)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([s,na.ready]).then(function(l){var u=l[0],d=o.byteOffset||0,f=o.byteLength||0,A=o.count,m=o.byteStride,h=new ArrayBuffer(A*m),v=new Uint8Array(u,d,f);return na.decodeGltfBuffer(new Uint8Array(h),A,m,v,o.mode,o.filter),h})}else return null},t}(lr),rs="EXT_texture_webp",tf=function(n){ue(t,n);function t(){var e=n!==null&&n.apply(this,arguments)||this;return e.supportsWep=!1,e}return t.prototype.prepare=function(e){var r=this;return c0().then(function(i){r.supportsWep=i.webp})},t.prototype.loadTexture=function(e,r){var i=r.json,a=i.textures[e];if(!a.extensions||!a.extensions[rs]||!this.supportsWep)return null;var o=a.extensions[rs];return r.loadImage(o.source).then(function(s){var l=new c.Texture(s);l.needsUpdate=!0,l.flipY=!1,a.name&&(l.name=a.name);var u=r.json.samplers||{},d=u[a.sampler]||{};return l.magFilter=Ei[d.magFilter]||c.LinearFilter,l.minFilter=Ei[d.minFilter]||c.LinearMipmapLinearFilter,l.wrapS=Ci[d.wrapS]||c.RepeatWrapping,l.wrapT=Ci[d.wrapT]||c.RepeatWrapping,l.onUpdate=function(){s.close()},l})},t}(lr),aa="CESIUM_RTC",rf=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.emitResult=function(e,r){if(r.json.extensions[aa]&&r.json.extensions[aa].center){var i=r.json.extensions[aa].center;e.CESIUM_RTC={center:new c.Vector3().fromArray(i)}}},t}(lr),nf=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadMesh=function(e,r){var i=this,a=r.json.meshes[e],o=a.primitives,s=Promise.all(o.map(function(d){return r.loadGeometry(d)})),l=Promise.all(o.map(function(d){return i.loadPBMMaterial(d,r)})),u=Promise.all([s,l]).then(function(d){for(var f=d[0],A=d[1],m=[],h=0;h<o.length;h++){var v=o[h],y=f[h],p=A[h];y.attributes.normal===void 0&&(p.flatShading=!0),y.attributes.tangent===void 0&&p.normalScale&&(p.normalScale.y*=-1);var g=v.mode||Ve.TRIANGLES,x=void 0;if(g===Ve.TRIANGLES||g===Ve.TRIANGLE_STRIP||g===Ve.TRIANGLE_FAN)g===Ve.TRIANGLE_STRIP?y=r.toGeometryTrianglesDrawMode(y,c.TriangleStripDrawMode):g===Ve.TRIANGLE_FAN&&(y=r.toGeometryTrianglesDrawMode(y,c.TriangleFanDrawMode)),y.clearGroups(),y.addGroup(0,y.index?y.index.count:y.attributes.position.count,0),y.attributes.normal||y.computeVertexNormals(),r.disposeSet.add(y),x=new Vt(y,[p]);else if(g===Ve.POINTS)x=new wr(y,p);else throw new Error("glTF: Primitive mode unsupported: "+g);x.name=r.createUniqueName(a.name||"mesh_"+e),m.push(x)}if(m.length===1)return m[0];for(var b=new c.Group,w=0,E=m;w<E.length;w++){var x=E[w];b.add(x)}return b});return u},t.prototype.loadPBMMaterial=function(e,r){var i,a=(i=e.mode)!==null&&i!==void 0?i:Ve.TRIANGLES,o=null;if(a===Ve.TRIANGLES||a===Ve.TRIANGLE_STRIP||a===Ve.TRIANGLE_FAN)o=this.loadPBMMeshMaterial(e,r);else if(a===Ve.POINTS)o=this.loadPBMPointCloudMaterial(e,r);else throw new Error("glTF: Primitive mode unsupported: "+a);return o},t.prototype.extendTexture=function(e,r,i){return e.minFilter=c.LinearFilter,e.magFilter=c.LinearFilter,e.generateMipmaps=!1,e},t.prototype.loadPBMPointCloudMaterial=function(e,r){var i=new to;return Object.keys(e.attributes).filter(function(a){return Bt[a]==="normal"}).length>0&&(i.defines.USE_POINT_NORMAL=!0),r.disposeSet.add(i),Promise.resolve(i)},t.prototype.loadPBMMeshMaterial=function(e,r){var i=[],a=new Tn("basic");if(a.color=new c.Color(1,1,1),Object.keys(e.attributes).filter(function(d){return Bt[d]==="color"}).length>0&&(a.vertexColors=!0),e.material!==void 0){var o=r.json.materials[e.material];o.name&&(a.name=o.name);var s=o.pbrMetallicRoughness||{};if(Array.isArray(s.baseColorFactor)){var l=s.baseColorFactor;a.color=new c.Color().fromArray(l)}if(s.baseColorTexture!==void 0&&i.push(r.createMaterialTexture(s.baseColorTexture).then(function(d){r.disposeSet.add(d),d.encoding=c.sRGBEncoding,a.map=d})),o.doubleSided===!0&&(a.side=c.DoubleSide),o.normalTexture!==void 0&&(i.push(r.createMaterialTexture(o.normalTexture).then(function(d){r.disposeSet.add(d),a.normalMap=d})),a.normalScale=new c.Vector2(1,1),o.normalTexture.scale!==void 0)){var u=o.normalTexture.scale;a.normalScale.set(u,u)}}return r.disposeSet.add(a),Promise.all(i).then(function(){return a})},t}(lr),Zr={KHR_binary_glTF:Nd,KHR_draco_mesh_compression:Qd,KHR_texture_basisu:_d,KHR_texture_transform:Zd,KHR_mesh_quantization:Yd,KHR_materials_unlit:$d,EXT_meshopt_compression:ef,EXT_texture_webp:tf,CESIUM_RTC:rf,PBM_mesh:nf};function ro(n,t){var e,r,i,a={};if(t.addonExtensions)for(var o=0,s=t.addonExtensions;o<s.length;o++){var l=s[o];l in Zr&&(a[l]=new Zr[l])}var u,d;if(typeof n=="string")d=n;else{var f=Zr.KHR_binary_glTF.getMagic(n);if(f===Zr.KHR_binary_glTF.HEADER_MAGIC){u=new Zr.KHR_binary_glTF;try{u.loadGlbBinary(n)}catch(p){return Promise.reject(p)}a.KHR_binary_glTF=u,d=u.content}else d=Ba(new Uint8Array(n))}var A=JSON.parse(d);if(A.asset===void 0||Number(A.asset.version[0])<2)return Promise.reject(new Error("glTF: Unsupported asset. glTF versions >=2.0 are supported."));if(A.extensionsUsed)for(var m=A.extensionsRequired||[],h=0;h<A.extensionsUsed.length;h++){var v=A.extensionsUsed[h];a[v]||(Zr[v]?a[v]=new Zr[v]:m.indexOf(v)>=0&&console.warn('glTF: Unknown extension "'+v+'".'))}var y=new Vd(A,a,{copyUV2:(e=t.copyUV2)!==null&&e!==void 0?e:!0,resourcePath:(r=t.resourcePath)!==null&&r!==void 0?r:"",search:(i=t.search)!==null&&i!==void 0?i:"",fetcher:t.fetcher});return y.parse().then(function(p){return u&&u.clear(),p})}var af=new c.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function q0(n,t){var e={uri:n,gltfUpAxis:t.upAxis};return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"}).then(function(r){return r.body})}).then(function(r){return Promise.resolve(0).then(function(i){return D0(e,r,i)}).then(function(i){return U0(e,r,i)}).then(function(i){return Ld(e,r,i)})}).then(function(){var r;return ro(e.gltfArrayBuffer,{copyUV2:!1,addonExtensions:["PBM_mesh"],resourcePath:n.slice(0,n.lastIndexOf("/")+1),search:(r=n.split("?")[1])!==null&&r!==void 0?r:"",fetcher:t.fetcher}).then(function(i){var a=new c.Matrix4;t.upAxis!=="Z"&&a.premultiply(af);var o=new c.Matrix4().setPosition(e.rtcCenter[0],e.rtcCenter[1],e.rtcCenter[2]);if(a.premultiply(o),i.CESIUM_RTC){var s=new c.Matrix4().setPosition(i.CESIUM_RTC.center);a.premultiply(s)}var l=i.scene;return l.applyMatrix4(a),{type:"b3dm",uri:e.uri,byteLength:e.byteLength,object:l,dispose:function(){return i.dispose()}}})})}const H0="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2Z1bmN0aW9uIEIoYSl7b25tZXNzYWdlPWZ1bmN0aW9uKHIpe1Byb21pc2UucmVzb2x2ZShyLmRhdGEpLnRoZW4oZnVuY3Rpb24obil7cmV0dXJuIGEobil9KS50aGVuKGZ1bmN0aW9uKG4pe3ZhciBlPW4ub3V0cHV0LHQ9bi50cmFuc2ZlcjtyZXR1cm4gcG9zdE1lc3NhZ2UoZSx0KX0pLmNhdGNoKGZ1bmN0aW9uKG4pe3JldHVybiBwb3N0TWVzc2FnZSh7JCRlcnJvcjpufSl9KX19dmFyIHUseTsoZnVuY3Rpb24oYSl7YVthLkJZVEU9NTEyMF09IkJZVEUiLGFbYS5VTlNJR05FRF9CWVRFPTUxMjFdPSJVTlNJR05FRF9CWVRFIixhW2EuU0hPUlQ9NTEyMl09IlNIT1JUIixhW2EuVU5TSUdORURfU0hPUlQ9NTEyM109IlVOU0lHTkVEX1NIT1JUIixhW2EuSU5UPTUxMjRdPSJJTlQiLGFbYS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z10KjQsaT10KjMsZVtvXT1yW2ldKmgsZVsrK29dPXJbKytpXSpoLGVbKytvXT1yWysraV0qaDtyZXR1cm57YXJyYXk6ZSxpdGVtU2l6ZTo0LG5vcm1hbGl6ZWQ6ITB9fWVsc2UgaWYoYS5oYXNQcm9wZXJ0eSgiTk9STUFMX09DVDE2UCIpKXtmb3IodmFyIHI9YS5nZXRQcm9wZXJ0eUFycmF5KCJOT1JNQUxfT0NUMTZQIix5LlVOU0lHTkVEX0JZVEUsMiksbj1yLmxlbmd0aC8yLGU9bmV3IEludDhBcnJheShuKjQpLHQ9MCx2PXZvaWQgMCxBPXZvaWQgMCxOPXZvaWQgMCxFPXZvaWQgMCxTPXZvaWQgMCxzPXZvaWQgMCxUPXZvaWQgMDt0PG47dCsrKXY9dCoyLEE9clt2XSpELTEsTj1yWysrdl0qRC0xLFM9QTwwPy1BOkEscz1OPDA/LU46TixFPTEtKFMrcyksRTwwJiYoQT0oMS1zKSooQTwwPy0xOjEpLE49KDEtUykqKE48MD8tMToxKSksVD1NYXRoLnNxcnQoQSpBK04qTitFKkUpLHY9dCo0LGVbdl09QS9UKmgsZVsrK3ZdPU4vVCpoLGVbKyt2XT1FL1QqaDtyZXR1cm57YXJyYXk6ZSxpdGVtU2l6ZTo0LG5vcm1hbGl6ZWQ6ITB9fXJldHVybiBudWxsfX0pKCk7Cg==",of=n=>Uint8Array.from(atob(n),t=>t.charCodeAt(0)),ns=typeof self!="undefined"&&self.Blob&&new Blob([of(H0)],{type:"text/javascript;charset=utf-8"});function sf(n){let t;try{if(t=ns&&(self.URL||self.webkitURL).createObjectURL(ns),!t)throw"";const e=new Worker(t,{name:n==null?void 0:n.name});return e.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),e}catch(e){return new Worker("data:text/javascript;base64,"+H0,{name:n==null?void 0:n.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var uf=new L0(function(){return new sf},2);function lf(n,t,e){var r=new z0(n.featureTableJson,n.featureTableBinary);return Promise.resolve().then(function(){var i=r.getExtension("3DTILES_draco_point_compression");return i?cf(i,r):uf.postMessage({featureTableBinary:r.buffer,featureTableJson:r.json},[r.buffer.buffer])}).then(function(i){return n.attributes=i,e})}function cf(n,t){return Bi(this,void 0,void 0,function(){var e,r,i,a,o,s;return Ri(this,function(l){if(e=n.properties||{},r=n.byteOffset,i=n.byteLength,!e||!Number.isFinite(r)||!i)throw new Error("Draco properties, byteOffset, and byteLength must be defined");return a=t.buffer.slice(r,r+i),o=n.properties,s={POSITION:"Float32Array",NORMAL:"Float32Array",RGB:"Uint8Array",RGBA:"Uint8Array"},[2,Mi.decodeGeometry(a.buffer,{attributeIDs:o,attributeTypes:s,useUniqueIDs:!0}).then(function(u){var d=u.getAttribute("POSITION"),f=u.getAttribute("RGB"),A=u.getAttribute("RGBA"),m=u.getAttribute("NORMAL"),h;if(A)h=A;else if(f){for(var v=f.count,y=f.array,p=new Uint8Array(v*4),g=0,x=void 0,b=void 0;g<v;g++)b=g*4,x=g*3,p[b]=y[x],p[++b]=y[++x],p[++b]=y[++x];h=new c.BufferAttribute(p,4,f.normalized)}return{position:d?{array:d.array,itemSize:d.itemSize,normalized:d.normalized}:null,color:h?{array:h.array,itemSize:h.itemSize,normalized:h.normalized}:null,normal:m?{array:m.array,itemSize:m.itemSize,normalized:m.normalized}:null}})]})})}function G0(n,t){var e={uri:n};return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"}).then(function(r){return r.body})}).then(function(r){return Promise.resolve(0).then(function(i){return D0(e,r,i)}).then(function(i){return U0(e,r,i)}).then(function(i){return lf(e,r,i)})}).then(function(){var r;return df(e.attributes,{computeBoundingBox:(r=t.computeBoundingBox)!==null&&r!==void 0?r:!0})}).then(function(r){var i=new c.Matrix4,a=new c.Matrix4().setPosition(e.rtcCenter[0],e.rtcCenter[1],e.rtcCenter[2]);return i.premultiply(a),r.object.applyMatrix4(i),{type:"pnts",uri:e.uri,byteLength:e.byteLength,object:r.object,dispose:function(){return r.dispose()}}})}function df(n,t){var e=new Set,r=new c.BufferGeometry;e.add(r);var i=new to;e.add(i),n.position&&r.setAttribute("position",new c.BufferAttribute(n.position.array,n.position.itemSize,n.position.normalized)),n.color&&r.setAttribute("color",new c.BufferAttribute(n.color.array,n.color.itemSize,n.color.normalized)),n.normal&&(r.setAttribute("normal",new c.BufferAttribute(n.normal.array,n.normal.itemSize,n.normal.normalized)),i.defines.USE_POINT_NORMAL=!0),t.computeBoundingBox&&r.computeBoundingBox();var a=new wr(r,i);return a.matrix.compose(a.position,a.quaternion,a.scale),a.matrixAutoUpdate=!1,a.frustumCulled=!1,Promise.resolve({object:a,dispose:function(){e.forEach(function(o){o.dispose()}),e.clear()}})}function K0(){var n={};return n.OutWindow=function(){this._windowSize=0},n.OutWindow.prototype.create=function(t){(!this._buffer||this._windowSize!==t)&&(this._buffer=[]),this._windowSize=t,this._pos=0,this._streamPos=0},n.OutWindow.prototype.flush=function(){var t=this._pos-this._streamPos;if(t!==0){for(;t--;)this._stream.writeByte(this._buffer[this._streamPos++]);this._pos>=this._windowSize&&(this._pos=0),this._streamPos=this._pos}},n.OutWindow.prototype.releaseStream=function(){this.flush(),this._stream=null},n.OutWindow.prototype.setStream=function(t){this.releaseStream(),this._stream=t},n.OutWindow.prototype.init=function(t){t||(this._streamPos=0,this._pos=0)},n.OutWindow.prototype.copyBlock=function(t,e){var r=this._pos-t-1;for(r<0&&(r+=this._windowSize);e--;)r>=this._windowSize&&(r=0),this._buffer[this._pos++]=this._buffer[r++],this._pos>=this._windowSize&&this.flush()},n.OutWindow.prototype.putByte=function(t){this._buffer[this._pos++]=t,this._pos>=this._windowSize&&this.flush()},n.OutWindow.prototype.getByte=function(t){var e=this._pos-t-1;return e<0&&(e+=this._windowSize),this._buffer[e]},n.RangeDecoder=function(){},n.RangeDecoder.prototype.setStream=function(t){this._stream=t},n.RangeDecoder.prototype.releaseStream=function(){this._stream=null},n.RangeDecoder.prototype.init=function(){var t=5;for(this._code=0,this._range=-1;t--;)this._code=this._code<<8|this._stream.readByte()},n.RangeDecoder.prototype.decodeDirectBits=function(t){for(var e=0,r=t,i;r--;)this._range>>>=1,i=this._code-this._range>>>31,this._code-=this._range&i-1,e=e<<1|1-i,this._range&4278190080||(this._code=this._code<<8|this._stream.readByte(),this._range<<=8);return e},n.RangeDecoder.prototype.decodeBit=function(t,e){var r=t[e],i=(this._range>>>11)*r;return(this._code^2147483648)<(i^2147483648)?(this._range=i,t[e]+=2048-r>>>5,this._range&4278190080||(this._code=this._code<<8|this._stream.readByte(),this._range<<=8),0):(this._range-=i,this._code-=i,t[e]-=r>>>5,this._range&4278190080||(this._code=this._code<<8|this._stream.readByte(),this._range<<=8),1)},n.initBitModels=function(t,e){for(;e--;)t[e]=1024},n.BitTreeDecoder=function(t){this._models=[],this._numBitLevels=t},n.BitTreeDecoder.prototype.init=function(){n.initBitModels(this._models,1<<this._numBitLevels)},n.BitTreeDecoder.prototype.decode=function(t){for(var e=1,r=this._numBitLevels;r--;)e=e<<1|t.decodeBit(this._models,e);return e-(1<<this._numBitLevels)},n.BitTreeDecoder.prototype.reverseDecode=function(t){for(var e=1,r=0,i=0,a;i<this._numBitLevels;++i)a=t.decodeBit(this._models,e),e=e<<1|a,r|=a<<i;return r},n.reverseDecode2=function(t,e,r,i){for(var a=1,o=0,s=0,l;s<i;++s)l=r.decodeBit(t,e+a),a=a<<1|l,o|=l<<s;return o},n.LenDecoder=function(){this._choice=[],this._lowCoder=[],this._midCoder=[],this._highCoder=new n.BitTreeDecoder(8),this._numPosStates=0},n.LenDecoder.prototype.create=function(t){for(;this._numPosStates<t;++this._numPosStates)this._lowCoder[this._numPosStates]=new n.BitTreeDecoder(3),this._midCoder[this._numPosStates]=new n.BitTreeDecoder(3)},n.LenDecoder.prototype.init=function(){var t=this._numPosStates;for(n.initBitModels(this._choice,2);t--;)this._lowCoder[t].init(),this._midCoder[t].init();this._highCoder.init()},n.LenDecoder.prototype.decode=function(t,e){return t.decodeBit(this._choice,0)===0?this._lowCoder[e].decode(t):t.decodeBit(this._choice,1)===0?8+this._midCoder[e].decode(t):16+this._highCoder.decode(t)},n.Decoder2=function(){this._decoders=[]},n.Decoder2.prototype.init=function(){n.initBitModels(this._decoders,768)},n.Decoder2.prototype.decodeNormal=function(t){var e=1;do e=e<<1|t.decodeBit(this._decoders,e);while(e<256);return e&255},n.Decoder2.prototype.decodeWithMatchByte=function(t,e){var r=1,i,a;do if(i=e>>7&1,e<<=1,a=t.decodeBit(this._decoders,(1+i<<8)+r),r=r<<1|a,i!==a){for(;r<256;)r=r<<1|t.decodeBit(this._decoders,r);break}while(r<256);return r&255},n.LiteralDecoder=function(){},n.LiteralDecoder.prototype.create=function(t,e){var r;if(!(this._coders&&this._numPrevBits===e&&this._numPosBits===t))for(this._numPosBits=t,this._posMask=(1<<t)-1,this._numPrevBits=e,this._coders=[],r=1<<this._numPrevBits+this._numPosBits;r--;)this._coders[r]=new n.Decoder2},n.LiteralDecoder.prototype.init=function(){for(var t=1<<this._numPrevBits+this._numPosBits;t--;)this._coders[t].init()},n.LiteralDecoder.prototype.getDecoder=function(t,e){return this._coders[((t&this._posMask)<<this._numPrevBits)+((e&255)>>>8-this._numPrevBits)]},n.Decoder=function(){this._outWindow=new n.OutWindow,this._rangeDecoder=new n.RangeDecoder,this._isMatchDecoders=[],this._isRepDecoders=[],this._isRepG0Decoders=[],this._isRepG1Decoders=[],this._isRepG2Decoders=[],this._isRep0LongDecoders=[],this._posSlotDecoder=[],this._posDecoders=[],this._posAlignDecoder=new n.BitTreeDecoder(4),this._lenDecoder=new n.LenDecoder,this._repLenDecoder=new n.LenDecoder,this._literalDecoder=new n.LiteralDecoder,this._dictionarySize=-1,this._dictionarySizeCheck=-1,this._posSlotDecoder[0]=new n.BitTreeDecoder(6),this._posSlotDecoder[1]=new n.BitTreeDecoder(6),this._posSlotDecoder[2]=new n.BitTreeDecoder(6),this._posSlotDecoder[3]=new n.BitTreeDecoder(6)},n.Decoder.prototype.setDictionarySize=function(t){return t<0?!1:(this._dictionarySize!==t&&(this._dictionarySize=t,this._dictionarySizeCheck=Math.max(this._dictionarySize,1),this._outWindow.create(Math.max(this._dictionarySizeCheck,4096))),!0)},n.Decoder.prototype.setLcLpPb=function(t,e,r){var i=1<<r;return t>8||e>4||r>4?!1:(this._literalDecoder.create(e,t),this._lenDecoder.create(i),this._repLenDecoder.create(i),this._posStateMask=i-1,!0)},n.Decoder.prototype.init=function(){var t=4;for(this._outWindow.init(!1),n.initBitModels(this._isMatchDecoders,192),n.initBitModels(this._isRep0LongDecoders,192),n.initBitModels(this._isRepDecoders,12),n.initBitModels(this._isRepG0Decoders,12),n.initBitModels(this._isRepG1Decoders,12),n.initBitModels(this._isRepG2Decoders,12),n.initBitModels(this._posDecoders,114),this._literalDecoder.init();t--;)this._posSlotDecoder[t].init();this._lenDecoder.init(),this._repLenDecoder.init(),this._posAlignDecoder.init(),this._rangeDecoder.init()},n.Decoder.prototype.decode=function(t,e,r){var i=0,a=0,o=0,s=0,l=0,u=0,d=0,f,A,m,h,v,y;for(this._rangeDecoder.setStream(t),this._outWindow.setStream(e),this.init();r<0||u<r;)if(f=u&this._posStateMask,this._rangeDecoder.decodeBit(this._isMatchDecoders,(i<<4)+f)===0)A=this._literalDecoder.getDecoder(u++,d),i>=7?d=A.decodeWithMatchByte(this._rangeDecoder,this._outWindow.getByte(a)):d=A.decodeNormal(this._rangeDecoder),this._outWindow.putByte(d),i=i<4?0:i-(i<10?3:6);else{if(this._rangeDecoder.decodeBit(this._isRepDecoders,i)===1)m=0,this._rangeDecoder.decodeBit(this._isRepG0Decoders,i)===0?this._rangeDecoder.decodeBit(this._isRep0LongDecoders,(i<<4)+f)===0&&(i=i<7?9:11,m=1):(this._rangeDecoder.decodeBit(this._isRepG1Decoders,i)===0?h=o:(this._rangeDecoder.decodeBit(this._isRepG2Decoders,i)===0?h=s:(h=l,l=s),s=o),o=a,a=h),m===0&&(m=2+this._repLenDecoder.decode(this._rangeDecoder,f),i=i<7?8:11);else if(l=s,s=o,o=a,m=2+this._lenDecoder.decode(this._rangeDecoder,f),i=i<7?7:10,v=this._posSlotDecoder[m<=5?m-2:3].decode(this._rangeDecoder),v>=4){if(y=(v>>1)-1,a=(2|v&1)<<y,v<14)a+=n.reverseDecode2(this._posDecoders,a-v-1,this._rangeDecoder,y);else if(a+=this._rangeDecoder.decodeDirectBits(y-4)<<4,a+=this._posAlignDecoder.reverseDecode(this._rangeDecoder),a<0){if(a===-1)break;return!1}}else a=v;if(a>=u||a>=this._dictionarySizeCheck)return!1;this._outWindow.copyBlock(a,m),u+=m,d=this._outWindow.getByte(0)}return this._outWindow.flush(),this._outWindow.releaseStream(),this._rangeDecoder.releaseStream(),!0},n.Decoder.prototype.setDecoderProperties=function(t){var e,r,i,a,o;return t.size<5||(e=t.readByte(),r=e%9,e=~~(e/9),i=e%5,a=~~(e/5),!this.setLcLpPb(r,i,a))?!1:(o=t.readByte(),o|=t.readByte()<<8,o|=t.readByte()<<16,o+=t.readByte()*16777216,this.setDictionarySize(o))},n.decompress=function(t,e,r,i){var a=new n.Decoder;if(!a.setDecoderProperties(t))throw"Incorrect stream properties";if(!a.decode(e,r,i))throw"Error in data stream";return!0},n.decompressFile=function(t,e){var r=new n.Decoder,i;if(!r.setDecoderProperties(t))throw"Incorrect stream properties";if(i=t.readByte(),i|=t.readByte()<<8,i|=t.readByte()<<16,i+=t.readByte()*16777216,t.readByte(),t.readByte(),t.readByte(),t.readByte(),!r.decode(t,e,i))throw"Error in data stream";return!0},n}var ff=K0();function hf(){function n(e){for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(256),a=0;a<r.length;a++)i[r.charCodeAt(a)]=a;var o=e.length*.75,s=e.length,l,u=0,d,f,A,m;e[e.length-1]==="="&&(o--,e[e.length-2]==="="&&o--);var h=new ArrayBuffer(o),v=new Uint8Array(h);for(l=0;l<s;l+=4)d=i[e.charCodeAt(l)],f=i[e.charCodeAt(l+1)],A=i[e.charCodeAt(l+2)],m=i[e.charCodeAt(l+3)],v[u++]=d<<2|f>>4,v[u++]=(f&15)<<4|A>>2,v[u++]=(A&3)<<6|m&63;return h}var t="AGFzbQEAAAABSg1gAABgAX8Bf2ACf38Bf2AEf39/fwBgA39/fwBgAX8AYAJ/fwBgA39/fwF/YAR/f39/AX9gAn9/AGABfwF/YAABf2AEf39/fwF/AhsCA2VudgVhYm9ydAADA2VudgZtZW1vcnkCAAEDJiUBAQkKAgoKCwsLCwsAAgoBAgQKAQYFCAoFBQQEBwgCBwwCAQAABAQBcAABBhoFfwFBAAt/AUEAC38BQQALfwFBAAt/AUEACwc9BgZtZW1vcnkCAAV0YWJsZQEABXJlc2V0AA0KbmV3VThBcnJheQAQCnVucGFja1NpemUAFAZkZWNvZGUAIwgBJAkHAQBBAAsBJQqAViVoAQN/IABBgICAgARLBEAACyMBIgEgAEEBIABBAUsbakEHakF4cSICPwAiA0EQdEsEQCADIAIgAWtB//8DakGAgHxxQRB2IgAgAyAAShtAAEEASARAIABAAEEASARAAAsLCyACJAEgAQsbAQF/QQFBICAAQQdqZ2t0EAEiASAANgIAIAELkQMBAX8gAUUEQA8LIABBADoAACAAIAFqQQFrQQA6AAAgAUECTQRADwsgAEEBakEAOgAAIABBAmpBADoAACAAIAFqIgJBAmtBADoAACACQQNrQQA6AAAgAUEGTQRADwsgAEEDakEAOgAAIAAgAWpBBGtBADoAACABQQhNBEAPC0EAIABrQQNxIgIgAGoiAEEANgIAIAEgAmtBfHEiASAAakEEa0EANgIAIAFBCE0EQA8LIABBBGpBADYCACAAQQhqQQA2AgAgACABaiICQQxrQQA2AgAgAkEIa0EANgIAIAFBGE0EQA8LIABBDGpBADYCACAAQRBqQQA2AgAgAEEUakEANgIAIABBGGpBADYCACAAIAFqIgJBHGtBADYCACACQRhrQQA2AgAgAkEUa0EANgIAIAJBEGtBADYCACAAQQRxQRhqIgIgAGohACABIAJrIQEDQCABQSBPBEAgAEIANwMAIABBCGpCADcDACAAQRBqQgA3AwAgAEEYakIANwMAIAFBIGshASAAQSBqIQAMAQsLC1EBA38gAEH+////AEsEQEEAQSBBLUEnEAAACyAAQQJ0IgMQAiECQQgQASIBQQA2AgAgAUEANgIEIAEgAjYCACABIAA2AgQgAkEIaiADEAMgAQtmAQF/IAFB/P///wFLBEBBAEHAAEEXQSIQAAALIAFBAXQiARACIgJBCGogARADIABFBEBBDBABIQALIABBADYCACAAQQA2AgQgAEEANgIIIAAgAjYCACAAQQA2AgQgACABNgIIIAALCgBBDBABIAAQBQsuAQF/QQgQASIBQQA2AgAgAUEANgIEIAEgADYCBCABQQEgASgCBHQQBjYCACABC6EBAQR/QRAQASIBQQA2AgAgAUEANgIEIAFBADYCCCABQQA2AgxBEBAEIQIDQCAAQRBIBEBBAxAHIQMgAigCACAAQQJ0aiADNgIIIABBAWohAAwBCwsgASACNgIEQRAQBCECQQAhAANAIABBEEgEQEEDEAchAyACKAIAIABBAnRqIAM2AgggAEEBaiEADAELCyABIAI2AgggAUEIEAc2AgwgAQs0AQF/QRQQASIAQQA2AgAgAEEAOgAEIABBADYCCCAAQQA2AgwgAEEANgIQIABBDTYCCCAAC0IBAX9BGRABIgBBADYCACAAQQA2AgQgAEEANgIIIABBADYCDCAAQQA2AhAgAEEANgIUIABBADoAGCAAQQA2AhAgAAu1AgEEf0HQABABIgBBADoAACAAQQA2AgQgAEEANgIIIABBADYCDCAAQQA2AhAgAEEAOgAUIABBADYCGCAAQQA2AhwgAEEANgIgIABBADYCJCAAQQA2AiggAEEANgIsIABBADYCMCAAQQA2AjQgAEEANgI4IABBADYCPCAAQQA2AkAgAEEANgJEIABBADYCSCAAQQA2AkxBBBAEIQIDQCABQQRIBEBBBhAHIQMgAigCACABQQJ0aiADNgIIIAFBAWohAQwBCwsgACACNgIkIABBBBAHNgIoIABB8wAQBjYCLCAAQcABEAY2AjAgAEEMEAY2AjQgAEEMEAY2AjggAEEMEAY2AjwgAEEMEAY2AkAgAEHAARAGNgJEIAAQCDYCSCAAEAg2AkwgABAJNgIEIAAQCjYCCCAACx8BAX9BCBABIgBBADYCACAAQQA2AgQgABALNgIAIAALCgAjACQBEAwkAwthAQF/IAFB+P///wNLBEBBAEHAAEEXQSIQAAALIAEQAiICQQhqIAEQAyAARQRAQQwQASEACyAAQQA2AgAgAEEANgIEIABBADYCCCAAIAI2AgAgAEEANgIEIAAgATYCCCAACwoAQQwQASAAEA4LBgAgABAPCyoAIAEgACgCCE8EQEEAQcAAQSdBPxAAAAsgACgCBCABIAAoAgBqai0ACAssACABIAAoAghPBEBBAEHAAEEyQT8QAAALIAAoAgQgASAAKAIAamogAjoACAtkAQJ/QQ0QDyECA0AgAUENSARAIAIgASAAIAEQEUH/AXEQEiABQQFqIQEMAQsLQQAhAEEAIQEDQCABQQhIBEAgAiABQQVqEBFB/wFxIAFBA3R0IAByIQAgAUEBaiEBDAELCyAACwYAIAAQEwsnACAAIAEQDzYCCCAAQQA2AgwgACABNgIUIABBADoAGCAAQQA2AgALJAAgACgCCCAAKAIYEBUgAEGABiAAKAIMIAAtABRqdBAGNgIgC5UBAQR/IAEhBSAAIgYoAgAhASAAKAIEIQcgACgCCEEBdiEEIAJBAEgEfyACIARqIgBBACAAQQBKGwUgAiIAIAQgACAESBsLIQIgA0EASAR/IAMgBGoiAEEAIABBAEobBSADIgAgBCAAIARIGwshAwNAIAIgA05FBEAgAkEBdCABaiAHaiAFOwEIIAJBAWohAgwBCwsgBgssAQF/AkACQAJAIwRBAWsOAwEBAgALAAtB/////wchAQsgAEGACEEAIAEQFwvBAQECfyAAQQIQBjYCACAAKAIAIgEoAgAgASgCBGpBgAg7AQggACgCACICKAIAIQEgAigCBCABQQJqakGACDsBCCAAKAIMKAIAQQEkBBAYGkEAIQIDQCACQRBIBEAgAiAAKAIEKAIAIgEoAgBBAnZJBH8gAkECdCABaigCCAUACygCAEEBJAQQGBogAiAAKAIIKAIAIgEoAgBBAnZJBH8gAkECdCABaigCCAUACygCAEEBJA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AIAIgAyABIAMQEUH/AXEQEiADQQFqIQMMAQsLIAAoAgAhBCACIQZBBBAPIgIoAgQgAigCAGogBigCBCAGKAIAai0ACCIDOgAIIANB/wFxQeEBTwRAQQBBgAFBoQFBDBAAAAsgAigCBCACKAIAQQFqaiADQf8BcUEJcCIHOgAIIAIoAgQgAigCAGogA0H/AXFBCW4iAzoACCADQQVwIQUgAigCBCACKAIAQQJqaiADQQVuIgM6AAggAigCBCACKAIAQQNqaiAFOgAIIAQgBzYCDCAEIAM2AhAgBCAFOgAUIARBADYCHEEAIQIDQAJAIAJBBE8NACAEIAQoAhwgBigCBCAGKAIAIAJBAWpqai0ACCACQQN0dHI2AhwgAkEBaiECDAELCyAEIAQoAhw2AhggBCgCGEGAIEkEQCAEQYAgNgIYC0EAIQJBACEFQQAhAwNAAkAgA0EITg0AIAYgA0EFahARQf8BcSIEQf8BRwRAQQEhBQsgBCADQQN0dCACciECIANBAWohAwwBCwsgACgCACAFRToAACAAKAIAKAIEIAE2AgAgACgCABAWAkAgACgCACAFIAIQICIBQQFGDQAgAUEDRwRAIAFBAkYEQCAFBEAgACgCACgCCCgCECACRw0DCwUMAgsLIAAoAgAoAgQtAAQaQQFBACAAKAIAKAIIKAIQIAAoAgAoAggoAgQQIQ8LQQBBAUEAQQAQIQsIACMDIAAQIgsWAEG4ASQAIwAkAUGAgIAIJAIQDCQDCwMAAQsLtwEEAEEICxcKAAAAdQBzAGUAIABzAHQAcgBpAGMAdABBIAsdDQAAAH4AbABpAGIALwBhAHIAcgBhAHkALgB0AHMAQcAACzkbAAAAfgBsAGkAYgAvAGkAbgB0AGUAcgBuAGEAbAAvAHQAeQBwAGUAZABhAHIAcgBhAHkALgB0AHMAQYABCzMYAAAAcwByAGMALwBsAHoAbQBhAC8AbAB6AG0AYQAtAGQAZQBjAG8AZABlAHIALgB0AHM=";return n(t)}function pf(n,t,e){try{var r={data:t,offset:0,readByte:function(){return this.data[this.offset++]}},i=r.data.length,a={data:[],offset:0,writeByte:function(l){var u=Math.floor(this.offset/i);this.data[u]||(this.data[u]=new Uint8Array(i)),this.data[u][this.offset%i]=l,this.offset++}};n.decompressFile(r,a);for(var o=new Uint8Array(a.offset),s=0;s<a.offset;s++)o[s]=a.data[Math.floor(s/i)][s%i];e(null,o)}catch(l){e(l)}}function vf(n,t,e){var r=24;try{var i=new WebAssembly.Memory({initial:16}),a=new WebAssembly.Module(n),o=new WebAssembly.Instance(a,{env:{memory:i,abort:function(){e(new Error("webAssembly abort"))}}}),s=o.exports,l=s.newU8Array(t.length),u=new Uint8Array(i.buffer,l+r,t.length);u.set(t);var d=s.decode(l),f=new Uint32Array(i.buffer,d,4),A=f[0],m=f[2],h=f[3];A?e(null,new Uint8Array(i.buffer,h+r,m).slice(0,m)):e(new Error("lzma deocder error"))}catch(v){e(v)}}var Af=`
|
|
883
|
+
`,ts="KHR_texture_basisu",Zd=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadTexture=function(e,r){var i=r.json.textures[e];if(!i.extensions||!i.extensions[ts])return null;var a=i.extensions[ts],o=r.json.images[a.source],s=null;if(o.bufferView!==void 0)s=r.loadBufferView(o.bufferView).then(function(l){return qn.parse(l)});else if(o.uri)s=r.options.fetcher.ajax(r.resolveResouce(o.uri),{responseType:"arraybuffer"}).then(function(l){return qn.parse(l.body)});else throw new Error("glTF: Invalid image defs.");return s},t}(lr),rs="KHR_texture_transform",Yd=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.extendTexture=function(e,r,i){var a=r.extensions!==void 0?r.extensions[rs]:void 0;return a?(a.texCoord!==void 0&&console.warn('glTF: Custom UV sets in "'+rs+'" extension not yet supported.'),a.offset===void 0&&a.rotation===void 0&&a.scale===void 0||(e=e.clone(),e.needsUpdate=!0,a.offset!==void 0&&e.offset.fromArray(a.offset),a.rotation!==void 0&&(e.rotation=a.rotation),a.scale!==void 0&&e.repeat.fromArray(a.scale)),e):null},t}(lr),$d=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(lr),ef=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(lr),na=function(){var n="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q;iekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq:78Yqdbk:qzezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9UhlaicefhodnadTmbalc;WFbGglcjdalcjd6EhDcbhqinaqae9pmeaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxdndndndnalc9WGgmTmbcbhPcehsawcjdfhzaohHinaraH9Rax6midnaraHaxfgo9RcK6mbczhlinalgic9Wfglawcj;cbffhOdndndndndnaHalco4fRbbalci4coG4ciGPlbedibkaO9cb83ibaOcwf9cb83ibxikaOaoRblaoRbbgAco4glalciSgCE86bbawcj;cbfaifglcGfaoclfaCfgORbbaAcl4ciGgCaCciSgCE86bbalcVfaOaCfgORbbaAcd4ciGgCaCciSgCE86bbalc7faOaCfgORbbaAciGgAaAciSgAE86bbalctfaOaAfgARbbaoRbegOco4gCaCciSgCE86bbalc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc93faAaCfgARbbaOciGgOaOciSgOE86bbalc94faAaOfgARbbaoRbdgOco4gCaCciSgCE86bbalc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc97faAaCfgARbbaOciGgOaOciSgOE86bbalc98faAaOfgORbbaoRbigoco4gAaAciSgAE86bbalc99faOaAfgORbbaocl4ciGgAaAciSgAE86bbalc9:faOaAfgORbbaocd4ciGgAaAciSgAE86bbalcufaOaAfglRbbaociGgoaociSgoE86bbalaofhoxdkaOaoRbwaoRbbgAcl4glalcsSgCE86bbawcj;cbfaifglcGfaocwfaCfgORbbaAcsGgAaAcsSgAE86bbalcVfaOaAfgORbbaoRbegAcl4gCaCcsSgCE86bbalc7faOaCfgORbbaAcsGgAaAcsSgAE86bbalctfaOaAfgORbbaoRbdgAcl4gCaCcsSgCE86bbalc91faOaCfgORbbaAcsGgAaAcsSgAE86bbalc4faOaAfgORbbaoRbigAcl4gCaCcsSgCE86bbalc93faOaCfgORbbaAcsGgAaAcsSgAE86bbalc94faOaAfgORbbaoRblgAcl4gCaCcsSgCE86bbalc95faOaCfgORbbaAcsGgAaAcsSgAE86bbalc96faOaAfgORbbaoRbvgAcl4gCaCcsSgCE86bbalc97faOaCfgORbbaAcsGgAaAcsSgAE86bbalc98faOaAfgORbbaoRbogAcl4gCaCcsSgCE86bbalc99faOaCfgORbbaAcsGgAaAcsSgAE86bbalc9:faOaAfgORbbaoRbrgocl4gAaAcsSgAE86bbalcufaOaAfglRbbaocsGgoaocsSgoE86bbalaofhoxekaOao8Pbb83bbaOcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaiczfhlarao9RcL0mekkaiam6miaoTmidnakTmbawaPfRbbhOawcj;cbfhlazhiakhHinaialRbbgAce4cbaAceG9R7aOfgO86bbaiadfhialcefhlaHcufgHmbkkazcefhzaPcefgPad6hsaohHaPad9hmexvkkcbhoasceGmdxikaoaxad2fhPdnakTmbcbhmcehsawcjdfhCinarao9Rax6miaoTmdaoaxfhoawamfRbbhOawcj;cbfhlaChiakhHinaialRbbgAce4cbaAceG9R7aOfgO86bbaiadfhialcefhlaHcufgHmbkaCcefhCamcefgmad6hsamad9hmbkaPhoxikcbhlcehsinarao9Rax6mdaoTmeaoaxfhoalcefglad6hsadal9hmbkaPhoxdkcbhoasceGTmekc9:hoxikabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekcbc99arao9Radcaadca0ESEhokavcj;ebf8Kjjjjbaok;xzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfalaDcu7gPcl4fcsGcitfgsydlhzasydbhHdnaDcsGgDak9pmbavaiaPfcsGcdtfydbaxaDEhsaDThDdndnadcd9hmbabarcetfgPaH87ebaPcdfaz87ebaPclfas87ebxekabarcdtfgPaHBdbaPclfazBdbaPcwfasBdbkaxaDfhxavc;abfalcitfgPasBdbaPazBdlavaicdtfasBdbavc;abfalcefcsGglcitfgPaHBdbaPasBdlaiaDfhialcefhlxdkdndnaDcsSmbamaDfaDc987fcefhmxekaocefhDao8SbbgscFeGhPdndnascu9mmbaDhoxekaocvfhoaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhokaPce4cbaPceG9R7amfhmkdndnadcd9hmbabarcetfgDaH87ebaDcdfaz87ebaDclfam87ebxekabarcdtfgDaHBdbaDclfazBdbaDcwfamBdbkavc;abfalcitfgDamBdbaDazBdlavaicdtfamBdbavc;abfalcefcsGglcitfgDaHBdbaDamBdlaicefhialcefhlxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHcdfaD87ebaHclfas87ebxekabarcdtfgHaxBdbaHclfaDBdbaHcwfasBdbkavaicdtfaxBdbavc;abfalcitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfalcefcsGcitfgHasBdbaHaDBdlavaiaPfcsGgicdtfasBdbavc;abfalcdfcsGglcitfgDaxBdbaDasBdlalcefhlaiaOfhiazaOfhxxekaxcbaoRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbaocefhDxekaocdfhDao8SbegPcFeGhsdnaPcu9kmbaocofhAascFbGhscrhodninaD8SbbgPcFbGaotasVhsaPcu9kmeaDcefhDaocrfgoc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbgocFeGhPdnaocu9kmbaDcvfhzaPcFbGhPcrhodninas8SbbgDcFbGaotaPVhPaDcu9kmeascefhsaocrfgoc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashoxekascefhoas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninao8SbbgscFbGaDtaPVhPascu9kmeaocefhoaDcrfgDc8J9hmbkaOhoxekaocefhokaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDcdfaz87ebaDclfaO87ebxekabarcdtfgDaABdbaDclfazBdbaDcwfaOBdbkavc;abfalcitfgDazBdbaDaABdlavaicdtfaABdbavc;abfalcefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfalcdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiarcifgrae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;siliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabavcefciGaiVcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:Ohkxekcjjjj94hkkabavcdfciGaiVcetfak87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:Ohqxekcjjjj94hqkabavcufciGaiVcetfaq87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohqxekcjjjj94hqkabavciGaiVcetfaq87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj;8ifcjjj98G::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklz9Kbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q;Aekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq;a9tqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk;d8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhwcbhDinaDae9pmeawaeaD9RaDawfae6Egqcsfgoc9WGgkci2hxakcethmaocl4cifcd4hPabaDad2fhscbhzdnincehHalhOcbhAdninaraO9RaP6miavcj;cbfaAak2fhCaOaPfhlcbhidnakc;ab6mbaral9Rc;Gb6mbcbhoinaCaofhidndndndndnaOaoco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklbalczfhlkdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklzalczfhlkdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklaalczfhlkdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalclfaYpQbfaXc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalcwfaYpQbfaXc:q:yjjbfRbbfhlxekaialpbbbpkl8Walczfhlkaoc;abfhiaocjefak0meaihoaral9Rc;Fb0mbkkdndnaiak9pmbaici4hoinaral9RcK6mdaCaifhXdndndndndnaOaico4fRbbaocoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpklbxikaXalpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaXalpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaXalpbbbpklbalczfhlkaocdfhoaiczfgiak6mbkkalTmbaAci6hHalhOaAcefgAclSmdxekkcbhlaHceGmdkdnakTmbavcjdfazfhiavazfpbdbhYcbhXinaiavcj;cbfaXfgopblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLaoakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEaoamfpblbg3cep9Ta3aQp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fcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfalaDcu7gPcl4fcsGcitfgsydlhzasydbhHdnaDcsGgDak9pmbavaiaPfcsGcdtfydbaxaDEhsaDThDdndnadcd9hmbabarcetfgPaH87ebaPcdfaz87ebaPclfas87ebxekabarcdtfgPaHBdbaPclfazBdbaPcwfasBdbkaxaDfhxavc;abfalcitfgPasBdbaPazBdlavaicdtfasBdbavc;abfalcefcsGglcitfgPaHBdbaPasBdlaiaDfhialcefhlxdkdndnaDcsSmbamaDfaDc987fcefhmxekaocefhDao8SbbgscFeGhPdndnascu9mmbaDhoxekaocvfhoaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhokaPce4cbaPceG9R7amfhmkdndnadcd9hmbabarcetfgDaH87ebaDcdfaz87ebaDclfam87ebxekabarcdtfgDaHBdbaDclfazBdbaDcwfamBdbkavc;abfalcitfgDamBdbaDazBdlavaicdtfamBdbavc;abfalcefcsGglcitfgDaHBdbaDamBdlaicefhialcefhlxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHcdfaD87ebaHclfas87ebxekabarcdtfgHaxBdbaHclfaDBdbaHcwfasBdbkavaicdtfaxBdbavc;abfalcitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfalcefcsGcitfgHasBdbaHaDBdlavaiaPfcsGgicdtfasBdbavc;abfalcdfcsGglcitfgDaxBdbaDasBdlalcefhlaiaOfhiazaOfhxxekaxcbaoRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbaocefhDxekaocdfhDao8SbegPcFeGhsdnaPcu9kmbaocofhAascFbGhscrhodninaD8SbbgPcFbGaotasVhsaPcu9kmeaDcefhDaocrfgoc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbgocFeGhPdnaocu9kmbaDcvfhzaPcFbGhPcrhodninas8SbbgDcFbGaotaPVhPaDcu9kmeascefhsaocrfgoc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashoxekascefhoas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninao8SbbgscFbGaDtaPVhPascu9kmeaocefhoaDcrfgDc8J9hmbkaOhoxekaocefhokaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDcdfaz87ebaDclfaO87ebxekabarcdtfgDaABdbaDclfazBdbaDcwfaOBdbkavc;abfalcitfgDazBdbaDaABdlavaicdtfaABdbavc;abfalcefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfalcdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiarcifgrae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:wPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalae9pmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oawaopmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalae9pmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oawaopmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalae9pmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepkbbadczfhdaeclfgeav6mbkkdnaval9pmbaialciGgecdtgdVcbc;abad9R;8kbaiabavcdtfgvad;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepklbkavaiad;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz9Tbb",e=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]),r=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var i=WebAssembly.validate(e)?t:n,a,o=WebAssembly.instantiate(s(i),{}).then(function(p){a=p.instance,a.exports.__wasm_call_ctors()});function s(p){for(var g=new Uint8Array(p.length),x=0;x<p.length;++x){var b=p.charCodeAt(x);g[x]=b>96?b-97:b>64?b-39:b+4}for(var w=0,x=0;x<p.length;++x)g[w++]=g[x]<60?r[g[x]]:(g[x]-60)*64+g[++x];return g.buffer.slice(0,w)}function l(p,g,x,b,w,E){var M=a.exports.sbrk,C=x+3&-4,P=M(C*b),S=M(w.length),T=new Uint8Array(a.exports.memory.buffer);T.set(w,S);var B=p(P,x,b,S,w.length);if(B==0&&E&&E(P,C,b),g.set(T.subarray(P,P+x*b)),M(P-M(0)),B!=0)throw new Error("Malformed buffer data: "+B)}var u={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},d={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},f=[],A=0;function m(p){var g={object:new Worker(p),pending:0,requests:{}};return g.object.onmessage=function(x){var b=x.data;g.pending-=b.count,g.requests[b.id][b.action](b.value),delete g.requests[b.id]},g}function h(p){for(var g="var instance; var ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(s(i))+"]), {}).then(function(result) { instance = result.instance; instance.exports.__wasm_call_ctors(); });self.onmessage = workerProcess;"+l.toString()+y.toString(),x=new Blob([g],{type:"text/javascript"}),b=URL.createObjectURL(x),w=0;w<p;++w)f[w]=m(b);URL.revokeObjectURL(b)}function v(p,g,x,b,w){for(var E=f[0],M=1;M<f.length;++M)f[M].pending<E.pending&&(E=f[M]);return new Promise(function(C,P){var S=new Uint8Array(x),T=A++;E.pending+=p,E.requests[T]={resolve:C,reject:P},E.object.postMessage({id:T,count:p,size:g,source:S,mode:b,filter:w},[S.buffer])})}function y(p){o.then(function(){var g=p.data;try{var x=new Uint8Array(g.count*g.size);l(a.exports[g.mode],x,g.count,g.size,g.source,a.exports[g.filter]),self.postMessage({id:g.id,count:g.count,action:"resolve",value:x},[x.buffer])}catch(b){self.postMessage({id:g.id,count:g.count,action:"reject",value:b})}})}return{ready:o,supported:!0,useWorkers:function(p){h(p)},decodeVertexBuffer:function(p,g,x,b,w){l(a.exports.meshopt_decodeVertexBuffer,p,g,x,b,a.exports[u[w]])},decodeIndexBuffer:function(p,g,x,b){l(a.exports.meshopt_decodeIndexBuffer,p,g,x,b)},decodeIndexSequence:function(p,g,x,b){l(a.exports.meshopt_decodeIndexSequence,p,g,x,b)},decodeGltfBuffer:function(p,g,x,b,w,E){l(a.exports[d[w]],p,g,x,b,a.exports[u[E]])},decodeGltfBufferAsync:function(p,g,x,b,w){return f.length>0?v(p,g,x,d[b],u[w]):o.then(function(){var E=new Uint8Array(p*g);return l(a.exports[d[b]],E,p,g,x,a.exports[u[w]]),E})}}}(),ia="EXT_meshopt_compression",tf=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadBufferView=function(e,r){var i=r.json,a=i.bufferViews[e];if(a.extensions&&a.extensions[ia]){var o=a.extensions[ia],s=r.loadBuffer(o.buffer);if(!na.supported){if(i.extensionsRequired&&i.extensionsRequired.indexOf(ia)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([s,na.ready]).then(function(l){var u=l[0],d=o.byteOffset||0,f=o.byteLength||0,A=o.count,m=o.byteStride,h=new ArrayBuffer(A*m),v=new Uint8Array(u,d,f);return na.decodeGltfBuffer(new Uint8Array(h),A,m,v,o.mode,o.filter),h})}else return null},t}(lr),ns="EXT_texture_webp",rf=function(n){ue(t,n);function t(){var e=n!==null&&n.apply(this,arguments)||this;return e.supportsWep=!1,e}return t.prototype.prepare=function(e){var r=this;return d0().then(function(i){r.supportsWep=i.webp})},t.prototype.loadTexture=function(e,r){var i=r.json,a=i.textures[e];if(!a.extensions||!a.extensions[ns]||!this.supportsWep)return null;var o=a.extensions[ns];return r.loadImage(o.source).then(function(s){var l=new c.Texture(s);l.needsUpdate=!0,l.flipY=!1,a.name&&(l.name=a.name);var u=r.json.samplers||{},d=u[a.sampler]||{};return l.magFilter=Ei[d.magFilter]||c.LinearFilter,l.minFilter=Ei[d.minFilter]||c.LinearMipmapLinearFilter,l.wrapS=Ci[d.wrapS]||c.RepeatWrapping,l.wrapT=Ci[d.wrapT]||c.RepeatWrapping,l.onUpdate=function(){s.close()},l})},t}(lr),aa="CESIUM_RTC",nf=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.emitResult=function(e,r){if(r.json.extensions[aa]&&r.json.extensions[aa].center){var i=r.json.extensions[aa].center;e.CESIUM_RTC={center:new c.Vector3().fromArray(i)}}},t}(lr),af=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadMesh=function(e,r){var i=this,a=r.json.meshes[e],o=a.primitives,s=Promise.all(o.map(function(d){return r.loadGeometry(d)})),l=Promise.all(o.map(function(d){return i.loadPBMMaterial(d,r)})),u=Promise.all([s,l]).then(function(d){for(var f=d[0],A=d[1],m=[],h=0;h<o.length;h++){var v=o[h],y=f[h],p=A[h];y.attributes.normal===void 0&&(p.flatShading=!0),y.attributes.tangent===void 0&&p.normalScale&&(p.normalScale.y*=-1);var g=v.mode||Ve.TRIANGLES,x=void 0;if(g===Ve.TRIANGLES||g===Ve.TRIANGLE_STRIP||g===Ve.TRIANGLE_FAN)g===Ve.TRIANGLE_STRIP?y=r.toGeometryTrianglesDrawMode(y,c.TriangleStripDrawMode):g===Ve.TRIANGLE_FAN&&(y=r.toGeometryTrianglesDrawMode(y,c.TriangleFanDrawMode)),y.clearGroups(),y.addGroup(0,y.index?y.index.count:y.attributes.position.count,0),y.attributes.normal||y.computeVertexNormals(),r.disposeSet.add(y),x=new Vt(y,[p]);else if(g===Ve.POINTS)x=new wr(y,p);else throw new Error("glTF: Primitive mode unsupported: "+g);x.name=r.createUniqueName(a.name||"mesh_"+e),m.push(x)}if(m.length===1)return m[0];for(var b=new c.Group,w=0,E=m;w<E.length;w++){var x=E[w];b.add(x)}return b});return u},t.prototype.loadPBMMaterial=function(e,r){var i,a=(i=e.mode)!==null&&i!==void 0?i:Ve.TRIANGLES,o=null;if(a===Ve.TRIANGLES||a===Ve.TRIANGLE_STRIP||a===Ve.TRIANGLE_FAN)o=this.loadPBMMeshMaterial(e,r);else if(a===Ve.POINTS)o=this.loadPBMPointCloudMaterial(e,r);else throw new Error("glTF: Primitive mode unsupported: "+a);return o},t.prototype.extendTexture=function(e,r,i){return e.minFilter=c.LinearFilter,e.magFilter=c.LinearFilter,e.generateMipmaps=!1,e},t.prototype.loadPBMPointCloudMaterial=function(e,r){var i=new ro;return Object.keys(e.attributes).filter(function(a){return Bt[a]==="normal"}).length>0&&(i.defines.USE_POINT_NORMAL=!0),r.disposeSet.add(i),Promise.resolve(i)},t.prototype.loadPBMMeshMaterial=function(e,r){var i=[],a=new Tn("basic");if(a.color=new c.Color(1,1,1),Object.keys(e.attributes).filter(function(d){return Bt[d]==="color"}).length>0&&(a.vertexColors=!0),e.material!==void 0){var o=r.json.materials[e.material];o.name&&(a.name=o.name);var s=o.pbrMetallicRoughness||{};if(Array.isArray(s.baseColorFactor)){var l=s.baseColorFactor;a.color=new c.Color().fromArray(l)}if(s.baseColorTexture!==void 0&&i.push(r.createMaterialTexture(s.baseColorTexture).then(function(d){r.disposeSet.add(d),d.encoding=c.sRGBEncoding,a.map=d})),o.doubleSided===!0&&(a.side=c.DoubleSide),o.normalTexture!==void 0&&(i.push(r.createMaterialTexture(o.normalTexture).then(function(d){r.disposeSet.add(d),a.normalMap=d})),a.normalScale=new c.Vector2(1,1),o.normalTexture.scale!==void 0)){var u=o.normalTexture.scale;a.normalScale.set(u,u)}}return r.disposeSet.add(a),Promise.all(i).then(function(){return a})},t}(lr),Zr={KHR_binary_glTF:Dd,KHR_draco_mesh_compression:Ud,KHR_texture_basisu:Zd,KHR_texture_transform:Yd,KHR_mesh_quantization:$d,KHR_materials_unlit:ef,EXT_meshopt_compression:tf,EXT_texture_webp:rf,CESIUM_RTC:nf,PBM_mesh:af};function no(n,t){var e,r,i,a={};if(t.addonExtensions)for(var o=0,s=t.addonExtensions;o<s.length;o++){var l=s[o];l in Zr&&(a[l]=new Zr[l])}var u,d;if(typeof n=="string")d=n;else{var f=Zr.KHR_binary_glTF.getMagic(n);if(f===Zr.KHR_binary_glTF.HEADER_MAGIC){u=new Zr.KHR_binary_glTF;try{u.loadGlbBinary(n)}catch(p){return Promise.reject(p)}a.KHR_binary_glTF=u,d=u.content}else d=Ba(new Uint8Array(n))}var A=JSON.parse(d);if(A.asset===void 0||Number(A.asset.version[0])<2)return Promise.reject(new Error("glTF: Unsupported asset. glTF versions >=2.0 are supported."));if(A.extensionsUsed)for(var m=A.extensionsRequired||[],h=0;h<A.extensionsUsed.length;h++){var v=A.extensionsUsed[h];a[v]||(Zr[v]?a[v]=new Zr[v]:m.indexOf(v)>=0&&console.warn('glTF: Unknown extension "'+v+'".'))}var y=new Nd(A,a,{copyUV2:(e=t.copyUV2)!==null&&e!==void 0?e:!0,resourcePath:(r=t.resourcePath)!==null&&r!==void 0?r:"",search:(i=t.search)!==null&&i!==void 0?i:"",fetcher:t.fetcher});return y.parse().then(function(p){return u&&u.clear(),p})}var of=new c.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function H0(n,t){var e={uri:n,gltfUpAxis:t.upAxis};return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"}).then(function(r){return r.body})}).then(function(r){return Promise.resolve(0).then(function(i){return z0(e,r,i)}).then(function(i){return q0(e,r,i)}).then(function(i){return Od(e,r,i)})}).then(function(){var r;return no(e.gltfArrayBuffer,{copyUV2:!1,addonExtensions:["PBM_mesh"],resourcePath:n.slice(0,n.lastIndexOf("/")+1),search:(r=n.split("?")[1])!==null&&r!==void 0?r:"",fetcher:t.fetcher}).then(function(i){var a=new c.Matrix4;t.upAxis!=="Z"&&a.premultiply(of);var o=new c.Matrix4().setPosition(e.rtcCenter[0],e.rtcCenter[1],e.rtcCenter[2]);if(a.premultiply(o),i.CESIUM_RTC){var s=new c.Matrix4().setPosition(i.CESIUM_RTC.center);a.premultiply(s)}var l=i.scene;return l.applyMatrix4(a),{type:"b3dm",uri:e.uri,byteLength:e.byteLength,object:l,dispose:function(){return i.dispose()}}})})}const G0="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2Z1bmN0aW9uIEIoYSl7b25tZXNzYWdlPWZ1bmN0aW9uKH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Vbdl09QS9UKmgsZVsrK3ZdPU4vVCpoLGVbKyt2XT1FL1QqaDtyZXR1cm57YXJyYXk6ZSxpdGVtU2l6ZTo0LG5vcm1hbGl6ZWQ6ITB9fXJldHVybiBudWxsfX0pKCk7Cg==",sf=n=>Uint8Array.from(atob(n),t=>t.charCodeAt(0)),is=typeof self!="undefined"&&self.Blob&&new Blob([sf(G0)],{type:"text/javascript;charset=utf-8"});function uf(n){let t;try{if(t=is&&(self.URL||self.webkitURL).createObjectURL(is),!t)throw"";const e=new Worker(t,{name:n==null?void 0:n.name});return e.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),e}catch(e){return new Worker("data:text/javascript;base64,"+G0,{name:n==null?void 0:n.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var lf=new O0(function(){return new uf},2);function cf(n,t,e){var r=new Q0(n.featureTableJson,n.featureTableBinary);return Promise.resolve().then(function(){var i=r.getExtension("3DTILES_draco_point_compression");return i?df(i,r):lf.postMessage({featureTableBinary:r.buffer,featureTableJson:r.json},[r.buffer.buffer])}).then(function(i){return n.attributes=i,e})}function df(n,t){return Bi(this,void 0,void 0,function(){var e,r,i,a,o,s;return Ri(this,function(l){if(e=n.properties||{},r=n.byteOffset,i=n.byteLength,!e||!Number.isFinite(r)||!i)throw new Error("Draco properties, byteOffset, and byteLength must be defined");return a=t.buffer.slice(r,r+i),o=n.properties,s={POSITION:"Float32Array",NORMAL:"Float32Array",RGB:"Uint8Array",RGBA:"Uint8Array"},[2,Mi.decodeGeometry(a.buffer,{attributeIDs:o,attributeTypes:s,useUniqueIDs:!0}).then(function(u){var d=u.getAttribute("POSITION"),f=u.getAttribute("RGB"),A=u.getAttribute("RGBA"),m=u.getAttribute("NORMAL"),h;if(A)h=A;else if(f){for(var v=f.count,y=f.array,p=new Uint8Array(v*4),g=0,x=void 0,b=void 0;g<v;g++)b=g*4,x=g*3,p[b]=y[x],p[++b]=y[++x],p[++b]=y[++x];h=new c.BufferAttribute(p,4,f.normalized)}return{position:d?{array:d.array,itemSize:d.itemSize,normalized:d.normalized}:null,color:h?{array:h.array,itemSize:h.itemSize,normalized:h.normalized}:null,normal:m?{array:m.array,itemSize:m.itemSize,normalized:m.normalized}:null}})]})})}function K0(n,t){var e={uri:n};return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"}).then(function(r){return r.body})}).then(function(r){return Promise.resolve(0).then(function(i){return z0(e,r,i)}).then(function(i){return q0(e,r,i)}).then(function(i){return cf(e,r,i)})}).then(function(){var r;return ff(e.attributes,{computeBoundingBox:(r=t.computeBoundingBox)!==null&&r!==void 0?r:!0})}).then(function(r){var i=new c.Matrix4,a=new c.Matrix4().setPosition(e.rtcCenter[0],e.rtcCenter[1],e.rtcCenter[2]);return i.premultiply(a),r.object.applyMatrix4(i),{type:"pnts",uri:e.uri,byteLength:e.byteLength,object:r.object,dispose:function(){return r.dispose()}}})}function ff(n,t){var e=new Set,r=new c.BufferGeometry;e.add(r);var i=new ro;e.add(i),n.position&&r.setAttribute("position",new c.BufferAttribute(n.position.array,n.position.itemSize,n.position.normalized)),n.color&&r.setAttribute("color",new c.BufferAttribute(n.color.array,n.color.itemSize,n.color.normalized)),n.normal&&(r.setAttribute("normal",new c.BufferAttribute(n.normal.array,n.normal.itemSize,n.normal.normalized)),i.defines.USE_POINT_NORMAL=!0),t.computeBoundingBox&&r.computeBoundingBox();var a=new wr(r,i);return a.matrix.compose(a.position,a.quaternion,a.scale),a.matrixAutoUpdate=!1,a.frustumCulled=!1,Promise.resolve({object:a,dispose:function(){e.forEach(function(o){o.dispose()}),e.clear()}})}function j0(){var n={};return n.OutWindow=function(){this._windowSize=0},n.OutWindow.prototype.create=function(t){(!this._buffer||this._windowSize!==t)&&(this._buffer=[]),this._windowSize=t,this._pos=0,this._streamPos=0},n.OutWindow.prototype.flush=function(){var t=this._pos-this._streamPos;if(t!==0){for(;t--;)this._stream.writeByte(this._buffer[this._streamPos++]);this._pos>=this._windowSize&&(this._pos=0),this._streamPos=this._pos}},n.OutWindow.prototype.releaseStream=function(){this.flush(),this._stream=null},n.OutWindow.prototype.setStream=function(t){this.releaseStream(),this._stream=t},n.OutWindow.prototype.init=function(t){t||(this._streamPos=0,this._pos=0)},n.OutWindow.prototype.copyBlock=function(t,e){var r=this._pos-t-1;for(r<0&&(r+=this._windowSize);e--;)r>=this._windowSize&&(r=0),this._buffer[this._pos++]=this._buffer[r++],this._pos>=this._windowSize&&this.flush()},n.OutWindow.prototype.putByte=function(t){this._buffer[this._pos++]=t,this._pos>=this._windowSize&&this.flush()},n.OutWindow.prototype.getByte=function(t){var e=this._pos-t-1;return e<0&&(e+=this._windowSize),this._buffer[e]},n.RangeDecoder=function(){},n.RangeDecoder.prototype.setStream=function(t){this._stream=t},n.RangeDecoder.prototype.releaseStream=function(){this._stream=null},n.RangeDecoder.prototype.init=function(){var t=5;for(this._code=0,this._range=-1;t--;)this._code=this._code<<8|this._stream.readByte()},n.RangeDecoder.prototype.decodeDirectBits=function(t){for(var e=0,r=t,i;r--;)this._range>>>=1,i=this._code-this._range>>>31,this._code-=this._range&i-1,e=e<<1|1-i,this._range&4278190080||(this._code=this._code<<8|this._stream.readByte(),this._range<<=8);return e},n.RangeDecoder.prototype.decodeBit=function(t,e){var r=t[e],i=(this._range>>>11)*r;return(this._code^2147483648)<(i^2147483648)?(this._range=i,t[e]+=2048-r>>>5,this._range&4278190080||(this._code=this._code<<8|this._stream.readByte(),this._range<<=8),0):(this._range-=i,this._code-=i,t[e]-=r>>>5,this._range&4278190080||(this._code=this._code<<8|this._stream.readByte(),this._range<<=8),1)},n.initBitModels=function(t,e){for(;e--;)t[e]=1024},n.BitTreeDecoder=function(t){this._models=[],this._numBitLevels=t},n.BitTreeDecoder.prototype.init=function(){n.initBitModels(this._models,1<<this._numBitLevels)},n.BitTreeDecoder.prototype.decode=function(t){for(var e=1,r=this._numBitLevels;r--;)e=e<<1|t.decodeBit(this._models,e);return e-(1<<this._numBitLevels)},n.BitTreeDecoder.prototype.reverseDecode=function(t){for(var e=1,r=0,i=0,a;i<this._numBitLevels;++i)a=t.decodeBit(this._models,e),e=e<<1|a,r|=a<<i;return r},n.reverseDecode2=function(t,e,r,i){for(var a=1,o=0,s=0,l;s<i;++s)l=r.decodeBit(t,e+a),a=a<<1|l,o|=l<<s;return o},n.LenDecoder=function(){this._choice=[],this._lowCoder=[],this._midCoder=[],this._highCoder=new n.BitTreeDecoder(8),this._numPosStates=0},n.LenDecoder.prototype.create=function(t){for(;this._numPosStates<t;++this._numPosStates)this._lowCoder[this._numPosStates]=new n.BitTreeDecoder(3),this._midCoder[this._numPosStates]=new n.BitTreeDecoder(3)},n.LenDecoder.prototype.init=function(){var t=this._numPosStates;for(n.initBitModels(this._choice,2);t--;)this._lowCoder[t].init(),this._midCoder[t].init();this._highCoder.init()},n.LenDecoder.prototype.decode=function(t,e){return t.decodeBit(this._choice,0)===0?this._lowCoder[e].decode(t):t.decodeBit(this._choice,1)===0?8+this._midCoder[e].decode(t):16+this._highCoder.decode(t)},n.Decoder2=function(){this._decoders=[]},n.Decoder2.prototype.init=function(){n.initBitModels(this._decoders,768)},n.Decoder2.prototype.decodeNormal=function(t){var e=1;do e=e<<1|t.decodeBit(this._decoders,e);while(e<256);return e&255},n.Decoder2.prototype.decodeWithMatchByte=function(t,e){var r=1,i,a;do if(i=e>>7&1,e<<=1,a=t.decodeBit(this._decoders,(1+i<<8)+r),r=r<<1|a,i!==a){for(;r<256;)r=r<<1|t.decodeBit(this._decoders,r);break}while(r<256);return r&255},n.LiteralDecoder=function(){},n.LiteralDecoder.prototype.create=function(t,e){var r;if(!(this._coders&&this._numPrevBits===e&&this._numPosBits===t))for(this._numPosBits=t,this._posMask=(1<<t)-1,this._numPrevBits=e,this._coders=[],r=1<<this._numPrevBits+this._numPosBits;r--;)this._coders[r]=new n.Decoder2},n.LiteralDecoder.prototype.init=function(){for(var t=1<<this._numPrevBits+this._numPosBits;t--;)this._coders[t].init()},n.LiteralDecoder.prototype.getDecoder=function(t,e){return this._coders[((t&this._posMask)<<this._numPrevBits)+((e&255)>>>8-this._numPrevBits)]},n.Decoder=function(){this._outWindow=new n.OutWindow,this._rangeDecoder=new n.RangeDecoder,this._isMatchDecoders=[],this._isRepDecoders=[],this._isRepG0Decoders=[],this._isRepG1Decoders=[],this._isRepG2Decoders=[],this._isRep0LongDecoders=[],this._posSlotDecoder=[],this._posDecoders=[],this._posAlignDecoder=new n.BitTreeDecoder(4),this._lenDecoder=new n.LenDecoder,this._repLenDecoder=new n.LenDecoder,this._literalDecoder=new n.LiteralDecoder,this._dictionarySize=-1,this._dictionarySizeCheck=-1,this._posSlotDecoder[0]=new n.BitTreeDecoder(6),this._posSlotDecoder[1]=new n.BitTreeDecoder(6),this._posSlotDecoder[2]=new n.BitTreeDecoder(6),this._posSlotDecoder[3]=new n.BitTreeDecoder(6)},n.Decoder.prototype.setDictionarySize=function(t){return t<0?!1:(this._dictionarySize!==t&&(this._dictionarySize=t,this._dictionarySizeCheck=Math.max(this._dictionarySize,1),this._outWindow.create(Math.max(this._dictionarySizeCheck,4096))),!0)},n.Decoder.prototype.setLcLpPb=function(t,e,r){var i=1<<r;return t>8||e>4||r>4?!1:(this._literalDecoder.create(e,t),this._lenDecoder.create(i),this._repLenDecoder.create(i),this._posStateMask=i-1,!0)},n.Decoder.prototype.init=function(){var t=4;for(this._outWindow.init(!1),n.initBitModels(this._isMatchDecoders,192),n.initBitModels(this._isRep0LongDecoders,192),n.initBitModels(this._isRepDecoders,12),n.initBitModels(this._isRepG0Decoders,12),n.initBitModels(this._isRepG1Decoders,12),n.initBitModels(this._isRepG2Decoders,12),n.initBitModels(this._posDecoders,114),this._literalDecoder.init();t--;)this._posSlotDecoder[t].init();this._lenDecoder.init(),this._repLenDecoder.init(),this._posAlignDecoder.init(),this._rangeDecoder.init()},n.Decoder.prototype.decode=function(t,e,r){var i=0,a=0,o=0,s=0,l=0,u=0,d=0,f,A,m,h,v,y;for(this._rangeDecoder.setStream(t),this._outWindow.setStream(e),this.init();r<0||u<r;)if(f=u&this._posStateMask,this._rangeDecoder.decodeBit(this._isMatchDecoders,(i<<4)+f)===0)A=this._literalDecoder.getDecoder(u++,d),i>=7?d=A.decodeWithMatchByte(this._rangeDecoder,this._outWindow.getByte(a)):d=A.decodeNormal(this._rangeDecoder),this._outWindow.putByte(d),i=i<4?0:i-(i<10?3:6);else{if(this._rangeDecoder.decodeBit(this._isRepDecoders,i)===1)m=0,this._rangeDecoder.decodeBit(this._isRepG0Decoders,i)===0?this._rangeDecoder.decodeBit(this._isRep0LongDecoders,(i<<4)+f)===0&&(i=i<7?9:11,m=1):(this._rangeDecoder.decodeBit(this._isRepG1Decoders,i)===0?h=o:(this._rangeDecoder.decodeBit(this._isRepG2Decoders,i)===0?h=s:(h=l,l=s),s=o),o=a,a=h),m===0&&(m=2+this._repLenDecoder.decode(this._rangeDecoder,f),i=i<7?8:11);else if(l=s,s=o,o=a,m=2+this._lenDecoder.decode(this._rangeDecoder,f),i=i<7?7:10,v=this._posSlotDecoder[m<=5?m-2:3].decode(this._rangeDecoder),v>=4){if(y=(v>>1)-1,a=(2|v&1)<<y,v<14)a+=n.reverseDecode2(this._posDecoders,a-v-1,this._rangeDecoder,y);else if(a+=this._rangeDecoder.decodeDirectBits(y-4)<<4,a+=this._posAlignDecoder.reverseDecode(this._rangeDecoder),a<0){if(a===-1)break;return!1}}else a=v;if(a>=u||a>=this._dictionarySizeCheck)return!1;this._outWindow.copyBlock(a,m),u+=m,d=this._outWindow.getByte(0)}return this._outWindow.flush(),this._outWindow.releaseStream(),this._rangeDecoder.releaseStream(),!0},n.Decoder.prototype.setDecoderProperties=function(t){var e,r,i,a,o;return t.size<5||(e=t.readByte(),r=e%9,e=~~(e/9),i=e%5,a=~~(e/5),!this.setLcLpPb(r,i,a))?!1:(o=t.readByte(),o|=t.readByte()<<8,o|=t.readByte()<<16,o+=t.readByte()*16777216,this.setDictionarySize(o))},n.decompress=function(t,e,r,i){var a=new n.Decoder;if(!a.setDecoderProperties(t))throw"Incorrect stream properties";if(!a.decode(e,r,i))throw"Error in data stream";return!0},n.decompressFile=function(t,e){var r=new n.Decoder,i;if(!r.setDecoderProperties(t))throw"Incorrect stream properties";if(i=t.readByte(),i|=t.readByte()<<8,i|=t.readByte()<<16,i+=t.readByte()*16777216,t.readByte(),t.readByte(),t.readByte(),t.readByte(),!r.decode(t,e,i))throw"Error in data stream";return!0},n}var hf=j0();function pf(){function n(e){for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(256),a=0;a<r.length;a++)i[r.charCodeAt(a)]=a;var o=e.length*.75,s=e.length,l,u=0,d,f,A,m;e[e.length-1]==="="&&(o--,e[e.length-2]==="="&&o--);var h=new ArrayBuffer(o),v=new Uint8Array(h);for(l=0;l<s;l+=4)d=i[e.charCodeAt(l)],f=i[e.charCodeAt(l+1)],A=i[e.charCodeAt(l+2)],m=i[e.charCodeAt(l+3)],v[u++]=d<<2|f>>4,v[u++]=(f&15)<<4|A>>2,v[u++]=(A&3)<<6|m&63;return h}var t="AGFzbQEAAAABSg1gAABgAX8Bf2ACf38Bf2AEf39/fwBgA39/fwBgAX8AYAJ/fwBgA39/fwF/YAR/f39/AX9gAn9/AGABfwF/YAABf2AEf39/fwF/AhsCA2VudgVhYm9ydAADA2VudgZtZW1vcnkCAAEDJiUBAQkKAgoKCwsLCwsAAgoBAgQKAQYFCAoFBQQEBwgCBwwCAQAABAQBcAABBhoFfwFBAAt/AUEAC38BQQALfwFBAAt/AUEACwc9BgZtZW1vcnkCAAV0YWJsZQEABXJlc2V0AA0KbmV3VThBcnJheQAQCnVucGFja1NpemUAFAZkZWNvZGUAIwgBJAkHAQBBAAsBJQqAViVoAQN/IABBgICAgARLBEAACyMBIgEgAEEBIABBAUsbakEHakF4cSICPwAiA0EQdEsEQCADIAIgAWtB//8DakGAgHxxQRB2IgAgAyAAShtAAEEASARAIABAAEEASARAAAsLCyACJAEgAQsbAQF/QQFBICAAQQdqZ2t0EAEiASAANgIAIAELkQMBAX8gAUUEQA8LIABBADoAACAAIAFqQQFrQQA6AAAgAUECTQRADwsgAEEBakEAOgAAIABBAmpBADoAACAAIAFqIgJBAmtBADoAACACQQNrQQA6AAAgAUEGTQRADwsgAEEDakEAOgAAIAAgAWpBBGtBADoAACABQQhNBEAPC0EAIABrQQNxIgIgAGoiAEEANgIAIAEgAmtBfHEiASAAakEEa0EANgIAIAFBCE0EQA8LIABBBGpBADYCACAAQQhqQQA2AgAgACABaiICQQxrQQA2AgAgAkEIa0EANgIAIAFBGE0EQA8LIABBDGpBADYCACAAQRBqQQA2AgAgAEEUakEANgIAIABBGGpBADYCACAAIAFqIgJBHGtBADYCACACQRhrQQA2AgAgAkEUa0EANgIAIAJBEGtBADYCACAAQQRxQRhqIgIgAGohACABIAJrIQEDQCABQSBPBEAgAEIANwMAIABBCGpCADcDACAAQRBqQgA3AwAgAEEYakIANwMAIAFBIGshASAAQSBqIQAMAQsLC1EBA38gAEH+////AEsEQEEAQSBBLUEnEAAACyAAQQJ0IgMQAiECQQgQASIBQQA2AgAgAUEANgIEIAEgAjYCACABIAA2AgQgAkEIaiADEAMgAQtmAQF/IAFB/P///wFLBEBBAEHAAEEXQSIQAAALIAFBAXQiARACIgJBCGogARADIABFBEBBDBABIQALIABBADYCACAAQQA2AgQgAEEANgIIIAAgAjYCACAAQQA2AgQgACABNgIIIAALCgBBDBABIAAQBQsuAQF/QQgQASIBQQA2AgAgAUEANgIEIAEgADYCBCABQQEgASgCBHQQBjYCACABC6EBAQR/QRAQASIBQQA2AgAgAUEANgIEIAFBADYCCCABQQA2AgxBEBAEIQIDQCAAQRBIBEBBAxAHIQMgAigCACAAQQJ0aiADNgIIIABBAWohAAwBCwsgASACNgIEQRAQBCECQQAhAANAIABBEEgEQEEDEAchAyACKAIAIABBAnRqIAM2AgggAEEBaiEADAELCyABIAI2AgggAUEIEAc2AgwgAQs0AQF/QRQQASIAQQA2AgAgAE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EAgACgCACgCCCgCECACRw0DCwUMAgsLIAAoAgAoAgQtAAQaQQFBACAAKAIAKAIIKAIQIAAoAgAoAggoAgQQIQ8LQQBBAUEAQQAQIQsIACMDIAAQIgsWAEG4ASQAIwAkAUGAgIAIJAIQDCQDCwMAAQsLtwEEAEEICxcKAAAAdQBzAGUAIABzAHQAcgBpAGMAdABBIAsdDQAAAH4AbABpAGIALwBhAHIAcgBhAHkALgB0AHMAQcAACzkbAAAAfgBsAGkAYgAvAGkAbgB0AGUAcgBuAGEAbAAvAHQAeQBwAGUAZABhAHIAcgBhAHkALgB0AHMAQYABCzMYAAAAcwByAGMALwBsAHoAbQBhAC8AbAB6AG0AYQAtAGQAZQBjAG8AZABlAHIALgB0AHM=";return n(t)}function vf(n,t,e){try{var r={data:t,offset:0,readByte:function(){return this.data[this.offset++]}},i=r.data.length,a={data:[],offset:0,writeByte:function(l){var u=Math.floor(this.offset/i);this.data[u]||(this.data[u]=new Uint8Array(i)),this.data[u][this.offset%i]=l,this.offset++}};n.decompressFile(r,a);for(var o=new Uint8Array(a.offset),s=0;s<a.offset;s++)o[s]=a.data[Math.floor(s/i)][s%i];e(null,o)}catch(l){e(l)}}function Af(n,t,e){var r=24;try{var i=new WebAssembly.Memory({initial:16}),a=new WebAssembly.Module(n),o=new WebAssembly.Instance(a,{env:{memory:i,abort:function(){e(new Error("webAssembly abort"))}}}),s=o.exports,l=s.newU8Array(t.length),u=new Uint8Array(i.buffer,l+r,t.length);u.set(t);var d=s.decode(l),f=new Uint32Array(i.buffer,d,4),A=f[0],m=f[2],h=f[3];A?e(null,new Uint8Array(i.buffer,h+r,m).slice(0,m)):e(new Error("lzma deocder error"))}catch(v){e(v)}}var mf=`
|
|
884
884
|
var decodeLZMA = (function() {
|
|
885
|
-
var LZMA = (`.concat(
|
|
885
|
+
var LZMA = (`.concat(j0.toString(),`)();
|
|
886
886
|
return function(data, callback) {
|
|
887
|
-
return (`).concat(
|
|
887
|
+
return (`).concat(vf.toString(),`)(LZMA, data, callback);
|
|
888
888
|
}
|
|
889
889
|
})();
|
|
890
890
|
|
|
891
891
|
var decodeLZMAWithWASM = (function() {
|
|
892
|
-
var LZMA_WASM = (`).concat(
|
|
892
|
+
var LZMA_WASM = (`).concat(pf.toString(),`)();
|
|
893
893
|
return function(data, callback) {
|
|
894
|
-
return (`).concat(
|
|
894
|
+
return (`).concat(Af.toString(),`)(LZMA_WASM, data, callback);
|
|
895
895
|
}
|
|
896
896
|
})();
|
|
897
897
|
|
|
@@ -925,11 +925,11 @@ self.onmessage = function(event) {
|
|
|
925
925
|
}
|
|
926
926
|
postMessage({ id: packet.id, error: "type never matched." });
|
|
927
927
|
};
|
|
928
|
-
`),Ra=typeof Worker!="undefined"&&typeof Blob!="undefined",j0="";if(Ra)try{var mf=new Blob([Af],{type:"text/javascript"});j0=URL.createObjectURL(mf)}catch(n){}var J0=function(){function n(){var t=this;if(!Ra)throw new Error("LZMAWorker cannot work in this broswer.");this.callCounter=0,this.requests={};var e=this.worker=new Worker(j0);e.onmessage=function(r){var i=r.data,a=i.id,o=i.result,s=i.error,l=t.getKey(a);t.requests[l]&&(s?t.requests[l](new Error(s)):t.requests[l](null,o),delete t.requests[l])},e.onerror=function(r){return console.error(r)}}return n.prototype.getKey=function(t){return"key_"+String(t)},n.prototype.decompress=function(t,e){var r=++this.callCounter;this.requests[this.getKey(r)]=e,this.worker.postMessage({type:"decompress",id:r,data:t},[t.buffer])},n.prototype.terminate=function(){this.worker.terminate()},n.support=Ra,n}();function is(n){return Array.prototype.reduce.call(n,function(t,e,r){return t|e<<r*8},0)}function gf(n){for(var t=[],e=n.length,r=function(o){var s={data:n[o],offset:0,readByte:function(){return this.data[this.offset++]}},l=s.data.length,u={data:[],offset:0,writeByte:function(f){var A=Math.floor(this.offset/l);this.data[A]||(this.data[A]=new Uint8Array(l)),this.data[A][this.offset%l]=f,this.offset++}};ff.decompressFile(s,u),i=new Uint8Array(u.offset);for(var d=0;d<u.offset;d++)i[d]=u.data[Math.floor(d/l)][d%l];t.push(i)},i,a=0;a<e;a++)r(a);return t}function yf(n){for(var t=[],e=n.length,r=function(a){t.push(new Promise(function(o,s){var l=new J0;l.decompress(n[a],function(u,d){if(l.terminate(),u)return s(u);o(d)})}))},i=0;i<e;i++)r(i);return Promise.all(t)}function W0(n){var t=new Uint8Array(n),e=is(t.slice(0,4));if(e>10)return Promise.reject(new Error("LZMA got too many sub chunks."));for(var r=[],i=[],a=4+e*4,o=0;o<e;o++)i[o]=is(t.slice(4+o*4,8+o*4)),o===e-1?r[o]=t.subarray(a,a+i[o]):r[o]=t.slice(a,a+i[o]),a+=i[o];return J0.support?yf(r):Promise.resolve(gf(r))}var oa=!1,X0=[];function _0(n){if(n===void 0&&(n=!1),!(!n&&oa)){oa=!0;var t=X0.shift();if(t){try{t()}catch(e){}vt.shared.add(function(){return _0(!0)},!0,2,-100)}else oa=!1}}function Si(n){return new Promise(function(t,e){var r=function(){try{t(n())}catch(i){e(i)}};X0.push(r),vt.shared.add(function(){return _0()},!0,2,-100)})}function Cr(n,t){for(var e={},r=0,i=t;r<i.length;r++){var a=i[r];a in n&&(e[a]=n[a])}return e}function bf(n,t){for(var e=F({},n),r=0,i=t;r<i.length;r++){var a=i[r];a in e&&delete e[a]}return e}function Fn(n,t){t===void 0&&(t=!1);var e=typeof n;if(e==="string")return JSON.stringify(n);if(n===!0)return"true";if(n===!1)return"false";if(n===null)return"null";if(n instanceof Array){for(var r="[",i=n.length-1,a=0;a<i;a++)r+=Fn(n[a],!1)+",";return i>-1&&(r+=Fn(n[a],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return Fn(n.toJSON(),t);for(var o=Object.keys(n).sort(),s=o.length,r="",a=0;a<s;){var l=o[a],u=Fn(n[l],!0);u!==void 0&&(a&&r!==""&&(r+=","),r+=JSON.stringify(l)+":"+u),a++}return"{"+r+"}"}switch(e){case"function":return JSON.stringify(n.toString());case"undefined":return t?void 0:null;case"number":return n;default:return isFinite(n)?n:null}}function Cn(n){return"hash::".concat(Fn(n,!1))}const Gr=qr.Reader,Zt=qr.util,Lt=qr.roots["@REALSEE/FIVE:five/loaders/model/proto/pbm.proto"]||(qr.roots["@REALSEE/FIVE:five/loaders/model/proto/pbm.proto"]={}),Z0=Lt.Model=(()=>{function n(t){if(this.chunks=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.chunks=Zt.emptyArray,n.prototype.createAt=Zt.Long?Zt.Long.fromBits(0,0,!0):0,n.prototype.description="",n.decode=function(e,r){e instanceof Gr||(e=Gr.create(e));let i=r===void 0?e.len:e.pos+r,a=new Lt.Model;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.chunks&&a.chunks.length||(a.chunks=[]),a.chunks.push(Lt.Chunk.decode(e,e.uint32()));break}case 2:{a.createAt=e.uint64();break}case 3:{a.description=e.string();break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Model"},n})();Lt.Chunk=(()=>{function n(t){if(t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.vertices=null,n.prototype.faces=null,n.prototype.name="",n.prototype.texture="",n.decode=function(e,r){e instanceof Gr||(e=Gr.create(e));let i=r===void 0?e.len:e.pos+r,a=new Lt.Chunk;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.vertices=Lt.Vertices.decode(e,e.uint32());break}case 2:{a.faces=Lt.Faces.decode(e,e.uint32());break}case 3:{a.name=e.string();break}case 4:{a.texture=e.string();break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("vertices"))throw Zt.ProtocolError("missing required 'vertices'",{instance:a});if(!a.hasOwnProperty("faces"))throw Zt.ProtocolError("missing required 'faces'",{instance:a});if(!a.hasOwnProperty("name"))throw Zt.ProtocolError("missing required 'name'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Chunk"},n})();Lt.Vertices=(()=>{function n(t){if(this.xyz=[],this.uvs=[],this.marks=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.xyz=Zt.emptyArray,n.prototype.uvs=Zt.emptyArray,n.prototype.marks=Zt.emptyArray,n.decode=function(e,r){e instanceof Gr||(e=Gr.create(e));let i=r===void 0?e.len:e.pos+r,a=new Lt.Vertices;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.xyz&&a.xyz.length||(a.xyz=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.xyz.push(e.float())}else a.xyz.push(e.float());break}case 2:{if(a.uvs&&a.uvs.length||(a.uvs=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.uvs.push(e.float())}else a.uvs.push(e.float());break}case 3:{if(a.marks&&a.marks.length||(a.marks=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.marks.push(e.int32())}else a.marks.push(e.int32());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Vertices"},n})();Lt.Faces=(()=>{function n(t){if(this.indices=[],this.normals=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.indices=Zt.emptyArray,n.prototype.normals=Zt.emptyArray,n.decode=function(e,r){e instanceof Gr||(e=Gr.create(e));let i=r===void 0?e.len:e.pos+r,a=new Lt.Faces;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.indices&&a.indices.length||(a.indices=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.indices.push(e.uint32())}else a.indices.push(e.uint32());break}case 2:{if(a.normals&&a.normals.length||(a.normals=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.normals.push(e.float())}else a.normals.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Faces"},n})();Lt.VertexMark=(()=>{const n={},t=Object.create(n);return t[n[0]="VERTEX_MARK_UNSPECIFIED"]=0,t[n[1]="VERTEX_MARK_ROOF"]=1,t})();function Y0(n,t){var e,r,i,a={byteLength:0},o=io((e=t.textureOptions)!==null&&e!==void 0?e:{},(i=(r=t.textureArray)===null||r===void 0?void 0:r.length)!==null&&i!==void 0?i:0),s={};if(t.textureArray)for(var l=0,u=t.textureArray;l<u.length;l++){var d=u[l];s[d]=no(d,o,t.fetcher)}return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"})}).then(function(f){return a.byteLength=f.body.byteLength,Si(function(){var A=new Uint8Array(f.body);return Z0.decode(A)})}).then(function(f){return Si(function(){var A,m;return eu(f,(A=t.textureBaseUri)!==null&&A!==void 0?A:function(){var h=n.lastIndexOf("/");if(h>=0){var v=n.slice(0,h)+"/";return/\/model\/$/.test(v)&&(v=v.replace(/\/model\/$/,"/materials/")),v}return""}(),((m=t.textureArray)!==null&&m!==void 0?m:[]).slice(),o,s,t.fetcher)})}).then(function(f){var A=new c.Group;A.matrixAutoUpdate=!1,A.matrix.compose(A.position,A.quaternion,A.scale),A.name=n;for(var m=0,h=f.objects;m<h.length;m++){var v=h[m];A.add(v)}return f.texturePromise.then(function(){return{type:"pbm",uri:n,byteLength:a.byteLength,object:A,dispose:function(){return f.dispose()}}})})}function $0(n){var t=n.match(/(group|floor)-?(\d+)/);return t?parseInt(t[2],10):0}function ka(n){var t=n.match(/(chunk)-?(\d+)/);return t?parseInt(t[2],10):0}function xf(n){var t=n.match(/(sub)-?(\d+)/);return t?parseInt(t[2],10):0}function as(n){var t=$0(n.name),e=ka(n.name),r=xf(n.name);return t*1e6+e*1e3+r}function wf(n){for(var t,e,r,i=typeof n.createAt=="number"?n.createAt:0,a=(t=n.description)!==null&&t!==void 0?t:"",o=[],s=!0,l=!0,u=0,d=n.chunks;u<d.length;u++){var f=d[u];if(!f.vertices.marks||f.vertices.marks.length===0){l=!1;break}}for(var A=0,m=n.chunks;A<m.length;A++){var f=m[A];if(!f.faces.normals||f.faces.normals.length===0){s=!1;break}}for(var h=n.chunks.sort(function(cr,Fe){return as(cr)-as(Fe)}),v=[],y=0,p=h;y<p.length;y++){var f=p[y],g=$0(f.name);v[g]||(v[g]=[]),v[g].push(f)}for(var x=0;x<v.length;x++){var b=v[x];if(b)if(s){for(var w=0,E=0;E<b.length;E++){var f=b[E];w+=f.faces.indices.length}for(var M=new Float32Array(w*3),C=new Float32Array(w),P=new Float32Array(w*2),S=new Float32Array(w*3),T=[],B=[1/0,1/0,1/0,-1/0,-1/0,-1/0],L=0,k=0;k<b.length;k++){for(var O=[1/0,1/0,1/0,-1/0,-1/0,-1/0],f=b[k],D=f.vertices.xyz,N=f.vertices.uvs,X=f.faces.indices,K=f.faces.normals,Q=f.vertices.marks,G=X.length,E=0;E<G;E++){var J=X[E],H=M[L*3+E*3]=D[J*3],j=M[L*3+E*3+1]=D[J*3+1],Z=M[L*3+E*3+2]=D[J*3+2];C[L+E]=l?Q[J]:0,P[L*2+E*2]=N[J*2],P[L*2+E*2+1]=N[J*2+1];var Y=Math.floor(E/3)*3;S[L*3+E*3]=K[Y],S[L*3+E*3+1]=K[Y+1],S[L*3+E*3+2]=K[Y+2],H<O[0]&&(O[0]=H),j<O[1]&&(O[1]=j),Z<O[2]&&(O[2]=Z),H>O[3]&&(O[3]=H),j>O[4]&&(O[4]=j),Z>O[5]&&(O[5]=Z)}O[0]<B[0]&&(B[0]=O[0]),O[1]<B[1]&&(B[1]=O[1]),O[2]<B[2]&&(B[2]=O[2]),O[3]>B[3]&&(B[3]=O[3]),O[4]>B[4]&&(B[4]=O[4]),O[5]>B[5]&&(B[5]=O[5]),T.push({materialIndex:k,name:f.name,chunkName:ka(f.name),start:L,count:f.faces.indices.length,texture:(e=f.texture)!==null&&e!==void 0?e:void 0}),L+=G}var pe={createAt:i,description:a,vertices:M,uvs:P,normals:S,indices:null,floorIndex:x,groups:T,extents:B,vertexMarks:C};o.push(pe)}else{for(var w=0,ee=0,E=0;E<b.length;E++){var f=b[E];ee+=f.vertices.xyz.length/3,w+=f.faces.indices.length}for(var M=new Float32Array(ee*3),P=new Float32Array(ee*2),S=new Float32Array(ee*3),oe=new Float32Array(ee),ie=new Uint32Array(w),C=new Float32Array(w),T=[],B=[1/0,1/0,1/0,-1/0,-1/0,-1/0],ce=0,L=0,k=0;k<b.length;k++){for(var O=[1/0,1/0,1/0,-1/0,-1/0,-1/0],f=b[k],D=f.vertices.xyz,Q=f.vertices.marks,N=f.vertices.uvs,X=f.faces.indices,ne=D.length/3,G=X.length,E=0;E<ne;E++){var H=M[L*3+E*3]=D[E*3],j=M[L*3+E*3+1]=D[E*3+1],Z=M[L*3+E*3+2]=D[E*3+2];C[L+E]=l?Q[E]:0,P[L*2+E*2]=N[E*2],P[L*2+E*2+1]=N[E*2+1],oe[L+E]=x,H<O[0]&&(O[0]=H),j<O[1]&&(O[1]=j),Z<O[2]&&(O[2]=Z),H>O[3]&&(O[3]=H),j>O[4]&&(O[4]=j),Z>O[5]&&(O[5]=Z)}O[0]<B[0]&&(B[0]=O[0]),O[1]<B[1]&&(B[1]=O[1]),O[2]<B[2]&&(B[2]=O[2]),O[3]>B[3]&&(B[3]=O[3]),O[4]>B[4]&&(B[4]=O[4]),O[5]>B[5]&&(B[5]=O[5]);for(var E=0;E<G;E++)ie[ce+E]=L+X[E];T.push({materialIndex:k,name:f.name,chunkName:ka(f.name),start:ce,count:f.faces.indices.length,texture:(r=f.texture)!==null&&r!==void 0?r:void 0}),L+=ne,ce+=G}for(var E=0;E<w;E+=3){var ae=void 0,de=void 0,ve=void 0,xe=void 0,Ce=void 0,Be=void 0,$=void 0,te=void 0,U=void 0,Le=void 0,Pe=void 0,Ie=void 0,Qe=void 0,be=void 0,ye=void 0,ge=void 0,me=void 0,Ae=void 0,Ne=void 0,ze=void 0,je=void 0;ae=ie[E]*3,de=ie[E+1]*3,ve=ie[E+2]*3,xe=M[ae],Ce=M[ae+1],Be=M[ae+2],$=M[de],te=M[de+1],U=M[de+2],Le=M[ve],Pe=M[ve+1],Ie=M[ve+2],Qe=Le-$,be=Pe-te,ye=Ie-U,ge=xe-$,me=Ce-te,Ae=Be-U,Ne=be*Ae-ye*me,ze=ye*ge-Qe*Ae,je=Qe*me-be*ge,S[ae]+=Ne,S[ae+1]+=ze,S[ae+2]+=je,S[de]+=Ne,S[de+1]+=ze,S[de+2]+=je,S[ve]+=Ne,S[ve+1]+=ze,S[ve+2]+=je}var pe={createAt:i,description:a,vertices:M,uvs:P,normals:S,indices:ie,floorIndex:x,groups:T,extents:B,vertexMarks:C};o.push(pe)}}return o}function no(n,t,e,r){var i=F({key:"texture.pbm"},Cr(t,["format","quality","size","sharpen","mappings"])),a=new _n,o=a.loadTexture(n,{imageURL:{transform:t.transform,options:i},encoding:c.sRGBEncoding,wrapS:c.ClampToEdgeWrapping,wrapT:c.ClampToEdgeWrapping,minFilter:c.LinearFilter,maxSize:typeof i.size=="number"?new c.Vector2(i.size,i.size):void 0,fetcher:e}).then(function(s){var l=s.body;return l.needsUpdate=!0,l});return Object.assign(o,{url:n,textureOptions:t})}function eu(n,t,e,r,i,a,o){i===void 0&&(i={});for(var s=wf(n),l=0,u="",d=[],f={},A=new Set,m=0,h=s;m<h.length;m++){var v=h[m],y=v.createAt,p=v.description,g=v.vertices,x=v.vertexMarks,b=v.uvs,w=v.normals,E=v.indices,M=v.floorIndex,C=v.groups,P=v.extents,S=new c.Box3;S.min.x=P[0],S.min.y=P[1],S.min.z=P[2],S.max.x=P[3],S.max.y=P[4],S.max.z=P[5];var T=new c.BufferGeometry;T.setAttribute("position",new c.BufferAttribute(g,3)),T.setAttribute("uv",new c.BufferAttribute(b,2)),T.setAttribute("normal",new c.BufferAttribute(w,3)),T.setAttribute("isRoofMark",new c.BufferAttribute(x,1)),E&&T.setIndex(new c.BufferAttribute(E,1)),T.boundingBox=S,T.boundingSphere=S.getBoundingSphere(new c.Sphere);for(var B=0,L=C;B<L.length;B++){var k=L[B];T.addGroup(k.start,k.count,k.materialIndex)}A.add(T);for(var O=[],D=0,N=C;D<N.length;D++){var k=N[D],X=e[k.chunkName]||(k.texture?xt(t||"",k.texture):void 0),K=new Tn("basic");K.defines.USE_VERTEX_FLOOR=!1,K.floor=M,O.push(K),X?f[X]?f[X].push(K):f[X]=[K]:K.color=new c.Color(16777215),A.add(K)}var Q=new Vt(T,O);Q.name="model_floor_"+M,Q.userData.createAt=y,Q.userData.description=p,Q.matrix.compose(Q.position,Q.quaternion,Q.scale),Q.matrixAutoUpdate=!1,Q.frustumCulled=!1,l=y,u=p,d.push(Q)}var G="",J=function(j){j=io(j,e.length);var Z=[],Y=Cn(j);if(G===Y)return Promise.resolve();G=Y;for(var pe=function(ce){var ne=null;ce in i&&(Cn(i[ce].textureOptions)===Cn(j)?ne=i[ce]:i[ce].then(function(ae){return ae.dispose()})),ne||(ne=no(ce,j,a)),Z.push(ne.then(function(ae){if(G!==Y){ae.dispose();return}for(var de=0,ve=f[ce];de<ve.length;de++){var xe=ve[de];xe.map&&(A.delete(xe.map),xe.map.dispose()),xe.map=ae,A.add(ae)}}).catch(function(){if(G===Y)for(var ae=0,de=f[ce];ae<de.length;ae++){var ve=de[ae];ve.map&&(A.delete(ve.map),ve.map.dispose()),ve.map=null,ve.color=new c.Color(16777215)}}))},ee=0,oe=Object.keys(f);ee<oe.length;ee++){var ie=oe[ee];pe(ie)}for(var ie in i)delete i[ie];return Promise.all(Z).then(function(){})},H=J(r);return{createAt:l,description:u,objects:d,texturePromise:H,updateTexture:J,dispose:function(){A.forEach(function(j){j.dispose()}),A.clear()}}}function io(n,t){return n=Object.assign({},n),n.autoResize!==!1&&(t>96?n.size=Math.min(n.size||1/0,100):t>48?n.size=Math.min(n.size||1/0,200):t>24?n.size=Math.min(n.size||1/0,400):t>22?n.size=Math.min(n.size||1/0,800):t>5&&(n.size=Math.min(n.size||1/0,1024))),n}function tu(n,t){var e,r,i,a={byteLength:0},o=io((e=t.textureOptions)!==null&&e!==void 0?e:{},(i=(r=t.textureArray)===null||r===void 0?void 0:r.length)!==null&&i!==void 0?i:0),s={};if(t.textureArray)for(var l=0,u=t.textureArray;l<u.length;l++){var d=u[l];s[d]=no(d,o,t.fetcher)}return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"})}).then(function(f){return W0(f.body)}).then(function(f){return Si(function(){for(var A,m={chunks:[],createAt:void 0,description:void 0},h=0,v=f;h<v.length;h++){var y=v[h],p=Z0.decode(y);p.chunks.length&&((A=m.chunks).push.apply(A,p.chunks),m.createAt=p.createAt,m.description=p.description)}return m})}).then(function(f){return Si(function(){var A,m,h;return eu(f,(A=t.textureBaseUri)!==null&&A!==void 0?A:function(){var v=n.lastIndexOf("/");if(v>=0){var y=n.slice(0,v)+"/";return/\/model\/$/.test(y)&&(y=y.replace(/\/model\/$/,"/materials/")),y}return""}(),((m=t.textureArray)!==null&&m!==void 0?m:[]).slice(),(h=t.textureOptions)!==null&&h!==void 0?h:{},s,t.fetcher)})}).then(function(f){var A=new c.Group;A.name=n;for(var m=0,h=f.objects;m<h.length;m++){var v=h[m];A.add(v)}return f.texturePromise.then(function(){return{type:"at3d",uri:n,byteLength:a.byteLength,object:A,dispose:function(){return f.dispose()}}})})}const Xe=qr.Reader,at=qr.util,Re=qr.roots["@REALSEE/FIVE:five/loaders/model/proto/dome.proto"]||(qr.roots["@REALSEE/FIVE:five/loaders/model/proto/dome.proto"]={}),Ef=Re.Model=(()=>{function n(t){if(this.meshes=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.meshes=at.emptyArray,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Re.Model;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.meshes&&a.meshes.length||(a.meshes=[]),a.meshes.push(Re.Mesh.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Model"},n})();Re.Mesh=(()=>{function n(t){if(this.chunks=[],this.matrix=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.name="",n.prototype.chunks=at.emptyArray,n.prototype.matrix=at.emptyArray,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Re.Mesh;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.name=e.string();break}case 2:{a.chunks&&a.chunks.length||(a.chunks=[]),a.chunks.push(Re.Chunk.decode(e,e.uint32()));break}case 3:{a.matrix&&a.matrix.length||(a.matrix=[]),a.matrix.push(Re.Matrix.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("name"))throw at.ProtocolError("missing required 'name'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Mesh"},n})();Re.Matrix=(()=>{function n(t){if(this.elements=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.elements=at.emptyArray,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Re.Matrix;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.elements&&a.elements.length||(a.elements=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.elements.push(e.float())}else a.elements.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Matrix"},n})();Re.Chunk=(()=>{function n(t){if(this.material=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.geometry=null,n.prototype.material=at.emptyArray,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Re.Chunk;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 2:{a.geometry=Re.Geometry.decode(e,e.uint32());break}case 3:{a.material&&a.material.length||(a.material=[]),a.material.push(Re.Material.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("geometry"))throw at.ProtocolError("missing required 'geometry'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Chunk"},n})();Re.Geometry=(()=>{function n(t){if(this.groups=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.position=null,n.prototype.uv=null,n.prototype.uv2=null,n.prototype.normal=null,n.prototype.groups=at.emptyArray,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Re.Geometry;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.position=Re.Position.decode(e,e.uint32());break}case 2:{a.uv=Re.UV.decode(e,e.uint32());break}case 3:{a.uv2=Re.UV.decode(e,e.uint32());break}case 4:{a.normal=Re.Normal.decode(e,e.uint32());break}case 5:{a.groups&&a.groups.length||(a.groups=[]),a.groups.push(Re.Group.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("position"))throw at.ProtocolError("missing required 'position'",{instance:a});if(!a.hasOwnProperty("normal"))throw at.ProtocolError("missing required 'normal'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Geometry"},n})();Re.Position=(()=>{function n(t){if(this.array=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.array=at.emptyArray,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Re.Position;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.array&&a.array.length||(a.array=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.array.push(e.float())}else a.array.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Position"},n})();Re.UV=(()=>{function n(t){if(this.array=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.array=at.emptyArray,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Re.UV;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.array&&a.array.length||(a.array=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.array.push(e.float())}else a.array.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/UV"},n})();Re.Normal=(()=>{function n(t){if(this.array=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.array=at.emptyArray,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Re.Normal;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.array&&a.array.length||(a.array=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.array.push(e.float())}else a.array.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Normal"},n})();Re.Group=(()=>{function n(t){if(t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.start=0,n.prototype.count=0,n.prototype.materialIndex=0,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Re.Group;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.start=e.uint32();break}case 2:{a.count=e.uint32();break}case 3:{a.materialIndex=e.uint32();break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("start"))throw at.ProtocolError("missing required 'start'",{instance:a});if(!a.hasOwnProperty("count"))throw at.ProtocolError("missing required 'count'",{instance:a});if(!a.hasOwnProperty("materialIndex"))throw at.ProtocolError("missing required 'materialIndex'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Group"},n})();Re.Material=(()=>{function n(t){if(t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.kd=null,n.prototype.ks=null,n.prototype.ke=null,n.prototype.mapkd="",n.prototype.mapks="",n.prototype.mapke="",n.prototype.norm="",n.prototype.mapbump="",n.prototype.bump="",n.prototype.mapd="",n.prototype.ns=0,n.prototype.d=0,n.prototype.tr=0,n.prototype.mapkdrepeat="",n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Re.Material;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.kd=Re.Color.decode(e,e.uint32());break}case 2:{a.ks=Re.Color.decode(e,e.uint32());break}case 3:{a.ke=Re.Color.decode(e,e.uint32());break}case 4:{a.mapkd=e.string();break}case 5:{a.mapks=e.string();break}case 6:{a.mapke=e.string();break}case 7:{a.norm=e.string();break}case 8:{a.mapbump=e.string();break}case 9:{a.bump=e.string();break}case 10:{a.mapd=e.string();break}case 11:{a.ns=e.float();break}case 12:{a.d=e.float();break}case 13:{a.tr=e.float();break}case 14:{a.mapkdrepeat=e.string();break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Material"},n})();Re.Color=(()=>{function n(t){if(this.rgb=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.rgb=at.emptyArray,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Re.Color;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.rgb&&a.rgb.length||(a.rgb=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.rgb.push(e.float())}else a.rgb.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Color"},n})();function ru(n,t){var e={byteLength:0};return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"})}).then(function(r){return e.byteLength=r.body.byteLength,nu(new Uint8Array(r.body),t.textureBaseUri||"",t.textureOptions,t.fetcher)}).then(function(r){var i=new c.Group;i.matrixAutoUpdate=!1,i.matrix.compose(i.position,i.quaternion,i.scale),i.name=n;for(var a=0,o=r.objects;a<o.length;a++){var s=o[a];i.add(s)}return r.texturePromise.then(function(){return{type:"dome",uri:n,byteLength:e.byteLength,object:i,dispose:function(){return r.dispose()}}})})}function Cf(n){for(var t=[0,0,0],e=0;e<n.attributes.normal.array.length/9;e++)t[0]=n.attributes.normal.array[e*9],t[1]=n.attributes.normal.array[e*9+1],t[2]=n.attributes.normal.array[e*9+2],n.attributes.normal.array[e*9]=n.attributes.normal.array[e*9+6],n.attributes.normal.array[e*9+1]=n.attributes.normal.array[e*9+7],n.attributes.normal.array[e*9+2]=n.attributes.normal.array[e*9+8],n.attributes.normal.array[e*9+6]=t[0],n.attributes.normal.array[e*9+7]=t[1],n.attributes.normal.array[e*9+8]=t[2];for(var e=0;e<n.attributes.position.array.length/9;e++)t[0]=n.attributes.position.array[e*9],t[1]=n.attributes.position.array[e*9+1],t[2]=n.attributes.position.array[e*9+2],n.attributes.position.array[e*9]=n.attributes.position.array[e*9+6],n.attributes.position.array[e*9+1]=n.attributes.position.array[e*9+7],n.attributes.position.array[e*9+2]=n.attributes.position.array[e*9+8],n.attributes.position.array[e*9+6]=t[0],n.attributes.position.array[e*9+7]=t[1],n.attributes.position.array[e*9+8]=t[2];for(var e=0;e<n.attributes.uv.array.length/6;e++)t[0]=n.attributes.uv.array[e*6],t[1]=n.attributes.uv.array[e*6+1],n.attributes.uv.array[e*6]=n.attributes.uv.array[e*6+4],n.attributes.uv.array[e*6+1]=n.attributes.uv.array[e*6+5],n.attributes.uv.array[e*6+4]=t[0],n.attributes.uv.array[e*6+5]=t[1];n.attributes.normal.needsUpdate=!0,n.attributes.position.needsUpdate=!0,n.attributes.uv.needsUpdate=!0}function Mf(n){var t=n.position,e=n.normal,r=n.uv,i=n.uv2,a=n.groups,o=new c.BufferGeometry;o.setAttribute("position",new c.BufferAttribute(new Float32Array(t.array),3)),e&&o.setAttribute("normal",new c.BufferAttribute(new Float32Array(e.array),3)),r&&o.setAttribute("uv",new c.BufferAttribute(new Float32Array(r.array),2)),i&&o.setAttribute("uv2",new c.BufferAttribute(new Float32Array(i.array),2));for(var s=0,l=a;s<l.length;s++){var u=l[s];o.addGroup(u.start,u.count,u.materialIndex)}return o}function pn(n,t,e,r,i,a,o){if(o.hasOwnProperty(n))return o[n];n=n.split("?")[0],Er(n)||(n=xt(t,n)),n=n.replace(/\/\/vrlab-image\d*.ljcdn.com\//,"//vrlab-public.ljcdn.com/"),n.indexOf("//")===0&&(n="https:"+n);var s=F({key:"texture.dome",size:64},Cr(e,["quality","format","sharpen","mappings"])),l=o[n]=i.loadTexture(n,{imageURL:{transform:e.transform,options:s},wrapS:c.RepeatWrapping,wrapT:c.RepeatWrapping,fetcher:a}).then(function(u){var d=u.body;return r&&d.repeat.copy(r),d.needsUpdate=!0,d.updateMatrix(),d});return l}function Sf(n,t,e,r,i,a,o){var s=[],l=new Tn("phong");if(o.add(l),n.kd&&(l.color=new c.Color().fromArray(n.kd.rgb).convertLinearToSRGB()),n.mapkd){var u=null;if(n.mapkdrepeat){var d=n.mapkdrepeat.split(/\s+/).map(function(h){return Number(h)}),f=d[0],A=d[1];u=new c.Vector2(f,A)}s.push(pn(n.mapkd,t,e,u,r,i,a).then(function(h){h.encoding=c.sRGBEncoding,l.map=h,o.add(h),l.needsUpdate=!0}).catch(z))}if(n.ks&&(l.specular=new c.Color().fromArray(n.ks.rgb).convertLinearToSRGB()),n.mapks&&s.push(pn(n.mapks,t,e,null,r,i,a).then(function(h){l.specularMap=h,o.add(h)}).catch(z)),n.ke&&(l.emissive=new c.Color().fromArray(n.ke.rgb).convertLinearToSRGB()),n.mapke&&s.push(pn(n.mapke,t,e,null,r,i,a).then(function(h){h.encoding=c.sRGBEncoding,l.emissiveMap=h,o.add(h)}).catch(z)),n.norm&&s.push(pn(n.norm,t,e,null,r,i,a).then(function(h){l.normalMap=h,o.add(h)}).catch(z)),n.mapbump&&s.push(pn(n.mapbump,t,e,null,r,i,a).then(function(h){l.bumpMap=h,o.add(h)}).catch(z)),n.bump&&s.push(pn(n.bump,t,e,null,r,i,a).then(function(h){l.bumpMap=h,o.add(h)}).catch(z)),typeof n.ns=="number"&&(l.shininess=n.ns),typeof n.d=="number"){var m=n.d;m>0&&m<1&&(l.opacity=m)}return l.floor=0,l.defines.USE_VERTEX_FLOOR=!1,{material:l,textureReady:Promise.all(s).then(z)}}function If(n){return Ef.decode(n).meshes}function nu(n,t,e,r){for(var i=[],a=[],o=new Set,s=If(n),l=new _n,u=new c.Matrix4,d=new c.Vector3,f=new c.Quaternion,A=new c.Vector3,m={},h=0,v=s;h<v.length;h++){var y=v[h],p=y.name,g=y.chunks,x=y.matrix;if(!(p==="Ceiling"||p==="CeilingDrop"))for(var b=0,w=x;b<w.length;b++){var E=w[b];u.elements=E.elements;for(var M=new c.Group,C=0;C<g.length;C++){var P=Mf(g[C].geometry);P.applyMatrix4(u),u.decompose(d,f,A),A.x*A.y*A.z<0&&P.attributes.normal&&P.attributes.position&&P.attributes.uv&&Cf(P),o.add(P);for(var S=[],T=0,B=g[C].material;T<B.length;T++){var L=B[T],k=Sf(L,t||"",e,l,r,m,o),O=k.material,D=k.textureReady;a.push(D),S.push(O)}var N=new Vt(P,S);N.name="chunk_"+C,N.matrix.compose(N.position,N.quaternion,N.scale),N.matrixAutoUpdate=!1,N.frustumCulled=!1,M.add(N)}M.name=p,i.push(M)}}var X=Promise.all(a).catch(z),K=function(Q){return Promise.resolve()};return{createAt:0,description:"",objects:i,texturePromise:X,updateTexture:K,dispose:function(){o.forEach(function(Q){Q.dispose()}),o.clear()}}}function iu(n,t){var e={byteLength:0};return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"})}).then(function(r){return e.byteLength=r.body.byteLength,W0(r.body)}).then(function(r){var i=r.reduce(function(s,l){return s+l.length},0),a=new Uint8Array(i),o=0;return r.forEach(function(s){a.set(s,o),o+=s.length}),a}).then(function(r){return nu(r,t.textureBaseUri||"",t.textureOptions,t.fetcher)}).then(function(r){var i=new c.Group;i.name=n;for(var a=0,o=r.objects;a<o.length;a++){var s=o[a];i.add(s)}return r.texturePromise.then(function(){return{type:"domez",uri:n,byteLength:e.byteLength,object:i,dispose:function(){return r.dispose()}}})})}var Tf=new c.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function au(n,t){var e=0;return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"}).then(function(r){return e=r.body.byteLength,r.body})}).then(function(r){var i;return ro(r,{copyUV2:!1,addonExtensions:["PBM_mesh"],resourcePath:n.slice(0,n.lastIndexOf("/")+1),search:(i=n.split("?")[1])!==null&&i!==void 0?i:"",fetcher:t.fetcher})}).then(function(r){var i=new c.Matrix4;if(t.upAxis!=="Z"&&i.premultiply(Tf),r.CESIUM_RTC){var a=new c.Matrix4().setPosition(r.CESIUM_RTC.center);i.premultiply(a)}var o=r.scene;return o.applyMatrix4(i),{type:"glb",uri:n,byteLength:e,object:o,dispose:function(){return r.dispose()}}})}var vn=new c.Vector3,os=new c.Matrix4;function ss(n,t){n.name=t.id;var e=t.tileset.properties.floorInfo;n.traverse(function(r){if("floor"in t.extras){if(r instanceof c.Mesh||r instanceof c.Points)for(var i=Array.isArray(r.material)?r.material:r.material?[r.material]:[],a=0,o=i;a<o.length;a++){var s=o[a];(s instanceof Tn||s instanceof to)&&(s.floor=t.extras.floor)}}else if((r instanceof Vt||r instanceof wr)&&e){var l=r.geometry.index,u=r.geometry.getAttribute("position"),d=0,f=new Float32Array(u.count);if(e)if(l){for(var A=0,m=l.count,h=0;h<m;h++){var b=l.array[h];vn.set(u.array[b*3+0],u.array[b*3+1],u.array[b*3+2]),vn.applyMatrix4(r.matrixWorld);var v=vn.y;f[b]=0;for(var y=0;y<e.length;y++){var w=e[y],g=w.ground,x=w.height;if(v<g+x){f[b]=y;break}}A+=f[b]}d=A/m}else{for(var A=0,m=u.count,h=0;h<m;h++){vn.set(u.array[h*3+0],u.array[h*3+1],u.array[h*3+2]),vn.applyMatrix4(r.matrixWorld);var v=vn.y;f[h]=0;for(var y=0;y<e.length;y++){var p=e[y],g=p.ground,x=p.height;if(v<g+x){f[h]=y;break}}A+=f[h]}d=A/m}t.floor=d,r.geometry.setAttribute("floor",new c.BufferAttribute(f,1)),Array.isArray(r.material)?r.material.forEach(function(E){E.defines.USE_VERTEX_FLOOR=!0,E.needsUpdate=!0}):(r.material.defines.USE_VERTEX_FLOOR=!0,r.material.needsUpdate=!0)}})}function Pf(n,t){if(!n.content)return Promise.resolve(null);var e=n.content,r=N0(e.uri,t.search);if(n.type==="TILESET"){var i=jt(r,{key:"model.".concat(n.siblingIndex)});return t.fetcher.ajax(i,{responseType:"text"}).then(function(a){return a.body}).then(function(a){var o=r.slice(0,r.lastIndexOf("/")+1);return T0(JSON.parse(a),o)}).then(function(a){n.children.length===0&&(n.children=[new eo("".concat(n.id,".0"),a.root,n.tileset,n)])}).then(function(){return null})}return n.type==="SCENEGRAPH"?Promise.resolve().then(function(){var a,o,s,l,u,d,f,A,m,h,v="",y=r.split("#"),p=y[0],g=y[1],x=(g||p).split("?")[0].match(/\.([0-9a-zA-Z]+)$/);if(x&&(v=x[1]),v==="b3dm"){var b=jt(r,{key:"model.".concat(n.siblingIndex)});return q0(b,{upAxis:n.tileset.asset.gltfUpAxis,fetcher:t.fetcher}).then(function(w){return w.object.applyMatrix4(n.transform),w.object.updateWorldMatrix(!1,!0),w.object.matrixAutoUpdate=!1,ss(w.object,n),w})}if(v==="pnts"){var b=jt(r,{key:"model.".concat(n.siblingIndex)});return G0(b,{fetcher:t.fetcher,computeBoundingBox:!1}).then(function(E){if(E.object.applyMatrix4(n.transform),E.object.updateWorldMatrix(!1,!0),E.object.matrixAutoUpdate=!1,n.boundingVolume){var M=n.boundingVolume;E.object.traverse(function(C){if(C instanceof wr){os.getInverse(C.matrixWorld);var P=new c.Box3;M.getBoundingBox(P),P.applyMatrix4(os),C.geometry.boundingBox=P}})}return E})}if(v==="glb"){var b=jt(r,{key:"model.".concat(n.siblingIndex)});return au(b,{upAxis:n.tileset.asset.gltfUpAxis,fetcher:t.fetcher}).then(function(E){return E.object.applyMatrix4(n.transform),E.object.updateWorldMatrix(!1,!0),E.object.matrixAutoUpdate=!1,ss(E.object,n),E})}if(v==="at3d"){var b=n.extras.at3d?r:jt(r,{key:"model.".concat(n.siblingIndex)});return tu(b,{textureBaseUri:(a=n.extras.at3d)===null||a===void 0?void 0:a.textureBaseUri,textureArray:(o=n.extras.at3d)===null||o===void 0?void 0:o.textureArray,textureOptions:(s=n.extras.at3d)===null||s===void 0?void 0:s.textureOptions,fetcher:t.fetcher}).then(function(E){return E.object.applyMatrix4(n.transform),E.object.updateWorldMatrix(!1,!0),E.object.matrixAutoUpdate=!1,E})}if(v==="pbm"){var b=n.extras.pbm?r:jt(r,{key:"model.".concat(n.siblingIndex)});return Y0(b,{textureBaseUri:(l=n.extras.pbm)===null||l===void 0?void 0:l.textureBaseUri,textureArray:(u=n.extras.pbm)===null||u===void 0?void 0:u.textureArray,textureOptions:(d=n.extras.pbm)===null||d===void 0?void 0:d.textureOptions,fetcher:t.fetcher}).then(function(E){return E.object.applyMatrix4(n.transform),E.object.updateWorldMatrix(!1,!0),E.object.matrixAutoUpdate=!1,E})}if(v==="dome"){var b=n.extras.dome?r:jt(r,{key:"model.".concat(n.siblingIndex)});return ru(b,{textureBaseUri:(f=n.extras.dome)===null||f===void 0?void 0:f.textureBaseUri,textureOptions:(A=n.extras.dome)===null||A===void 0?void 0:A.textureOptions,fetcher:t.fetcher}).then(function(E){return E.object.applyMatrix4(n.transform),E.object.updateWorldMatrix(!1,!0),E.object.matrixAutoUpdate=!1,E})}if(v==="domez"){var b=n.extras.domez?r:jt(r,{key:"model.".concat(n.siblingIndex)});return iu(b,{textureBaseUri:(m=n.extras.domez)===null||m===void 0?void 0:m.textureBaseUri,textureOptions:(h=n.extras.domez)===null||h===void 0?void 0:h.textureOptions,fetcher:t.fetcher}).then(function(E){return E.object.applyMatrix4(n.transform),E.object.updateWorldMatrix(!1,!0),E.object.matrixAutoUpdate=!1,E})}return null}).then(function(a){if(!a)return Promise.resolve(null);a.object.traverse(function(s){if(s instanceof wr)s.material.uniforms.geometricError.value=n.geometricError;else if(s instanceof Vt)for(var l=0,u=s.material;l<u.length;l++){var d=u[l];d.uniforms.geometricError.value=n.geometricError}});var o={type:a.type,uri:a.uri,byteLength:a.byteLength,object:new V0(a.object,a.dispose)};return o.object.name=n.id,Promise.resolve().then(function(){return o.object.generateBvhTree()}).then(function(){return o}).catch(function(s){return Fa(o),Promise.reject(s)})}):Promise.resolve(null)}function Fa(n){n&&n.object.dispose()}var us=new c.Vector3,Bf=new c.Matrix3,Rf=new c.Matrix4,ut=6378137,ou=298.257223563;function su(n){for(var t=ut-ut/ou,e=(ut*ut-t*t)/(ut*ut),r=Math.sqrt(n.x*n.x+n.y*n.y),i=1e-12,a=1e3,o=0,s=Math.atan2(n.z,r),l=0;o++<a;){var u=Math.sin(s),d=ut/Math.sqrt(1-e*u*u);l=r/Math.cos(s)-d;var f=Math.atan2(n.z/(d*(1-e)+l),r/(d+l));if(isNaN(f))break;var A=Math.abs(f-s);if(A<i)break;s=f}return n.set(s,Math.atan2(n.y,n.x),l)}function kf(n){var t=n.x,e=n.y,r=n.z,i=ut-ut/ou,a=(ut*ut-i*i)/(ut*ut),o=Math.sin(t),s=Math.cos(t),l=Math.sin(e),u=Math.cos(e),d=ut/Math.sqrt(1-a*o*o),f=(d+r)*s*u,A=(d+r)*s*l,m=(i*i/(ut*ut)*d+r)*o;return n.set(f,A,m)}function Ff(n,t){var e=su(us.copy(n)),r=e.x,i=e.y,a=e.z,o=Math.sin(r),s=Math.sin(i),l=Math.cos(r),u=Math.cos(i);t.fromArray([-s,-o*u,l*u,0,+u,-o*s,l*s,0,0,l,o,0,0,0,0,1]);var d=Bf.setFromMatrix4(t),f=us.copy(n).applyMatrix3(d).multiplyScalar(-1);t.setPosition(f);var A=Rf.fromArray([1,0,0,0,0,1,0,0,0,0,1,0,0,0,a,1]);return t.premultiply(A),t}var Jt={TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15},ls=function(){var n=new c.MeshBasicMaterial;return n.side=c.BackSide,n.color.setHex(16711935),n.colorWrite=!1,n.stencilWrite=!0,n.polygonOffset=!0,n.polygonOffsetFactor=2,n.polygonOffsetUnits=2,n.stencilRef=Jt.TILE_MASK,n.stencilFunc=c.AlwaysStencilFunc,n.stencilFuncMask=Jt.TILE_MASK,n.stencilZPass=c.ReplaceStencilOp,n.stencilWriteMask=Jt.TILE_MASK,n}(),cs=function(){var n=new c.MeshBasicMaterial;return n.visible=!1,n}(),Lf=new c.BufferGeometry,Of=new c.MeshBasicMaterial,$r=function(n){ue(t,n);function t(e,r,i){var a,o,s,l,u=n.call(this)||this;u.modelIndex=0,u.debug=!1,u.name=i.name,u.type=i.type,u.upAxis=i.upAxis,u.model=e,u.fetcher=i.fetcher,u.search=(a=i.search)!==null&&a!==void 0?a:"",u.groundHeight=i.groundHeight,u.coordinateTransform=i.coordinateTransform,u.unloadTileQueue=[],u.boundingBox=new c.Box3,u.idle=!1,u.minLevelOfDetail=t.DEFAULT_MIN_LEVEL_OF_DETAIL,u.maxLevelOfDetail=t.DEFAULT_MAX_LEVEL_OF_DETAIL,u.needsRefined=!0,u.refined=!1,u.refineProgress=[0,0],u.loaded=!1,u.disposed=!1,u.needsRender=!0,u.lastRenderHash="",u.matrixAutoUpdate=!1,u.cacheCameras=[],u.clearStencilObject=new c.Mesh(Lf,Of),u.clearStencilObject.frustumCulled=!1,u.clearStencilObject.onAfterRender=function(f){return f.clearStencil()};var d=T0(r,(o=i.resourcePath)!==null&&o!==void 0?o:"");return u.tileset=new mn((l=(s=u.model.work)===null||s===void 0?void 0:s.workCode)!==null&&l!==void 0?l:"",d,{referer:i.referer,contentLoader:function(f){return u.loadContent(f)},onTileLoad:function(){},onTileUnload:function(f){u.unloadTileQueue.push(f)},onTileError:function(f,A){i.onError&&i.onError(Object.assign(A,{error:A})),console.error("Tile error",f.id,A)}}),u.tileset.root.boundingVolume&&u.tileset.root.boundingVolume.getBoundingBox(u.boundingBox),u}return t.prototype.getRenderHash=function(){return Cn([this.tileset.id,this.tileset.skipLevelOfDetail,this.tileset.selectedTiles.map(function(e){return e.id}),this.debug])},Object.defineProperty(t.prototype,"maxMemoryUsage",{get:function(){return this.tileset.maxMemoryUsage},set:function(e){this.tileset.maxMemoryUsage=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxRequests",{get:function(){return this.tileset.maxRequests},set:function(e){this.tileset.maxRequests=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"skipLevelOfDetail",{get:function(){return this.tileset.skipLevelOfDetail},set:function(e){this.tileset.skipLevelOfDetail=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"loadSiblings",{get:function(){return this.tileset.loadSiblings},set:function(e){this.tileset.loadSiblings=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxScreenSpaceError",{get:function(){return this.tileset.maxScreenSpaceError},set:function(e){this.tileset.maxScreenSpaceError=e},enumerable:!1,configurable:!0}),t.prototype.localToEnu=function(e){return e.applyMatrix4(this.coordinateTransform.localToEnuMatrix)},t.prototype.enuToLocal=function(e){return e.applyMatrix4(this.coordinateTransform.enuToLocalMatrix)},t.prototype.localToEcef=function(e){return e.applyMatrix4(this.coordinateTransform.localToEcefMatrix)},t.prototype.ecefToLocal=function(e){return e.applyMatrix4(this.coordinateTransform.ecefToLocalMatrix)},t.prototype.localToLla=function(e){return su(this.localToEcef(e))},t.prototype.llaToLocal=function(e){return this.ecefToLocal(kf(e))},t.prototype.worldToEnu=function(e){return this.localToEnu(this.worldToLocal(e))},t.prototype.enuToWorld=function(e){return this.localToWorld(this.enuToLocal(e))},t.prototype.worldToEcef=function(e){return this.localToEcef(this.worldToLocal(e))},t.prototype.ecefToWorld=function(e){return this.localToWorld(this.ecefToLocal(e))},t.prototype.worldToLla=function(e){return this.localToLla(this.worldToLocal(e))},t.prototype.llaToWorld=function(e){return this.localToWorld(this.llaToLocal(e))},t.prototype.loadContent=function(e){var r=this;return Pf(e,{fetcher:this.fetcher,search:this.search}).then(function(i){return e.type==="TILESET"?!0:i&&e.type==="SCENEGRAPH"?r.disposed||!e.content?(Fa(i),!1):(e.content.data=i,e.content.byteLength=i.byteLength,e.content.data&&(e.content.data.object.traverse(function(a){(a instanceof wr||a instanceof Vt)&&(a.model=r.model)}),r.boundingBox.expandByObject(e.content.data.object)),!0):!1})},t.prototype.unloadContent=function(e){e.content&&(e.content.byteLength=0,Fa(e.content.data),e.content.data=void 0)},t.prototype.loadAllTilesets=function(){var e=this,r=function(i){var a=[];return e.tileset.root.traverse(function(o){var s;o.type==="TILESET"&&((s=o.content)===null||s===void 0?void 0:s.loadState)!=="READY"&&a.push(o)}),Promise.all(a.map(function(o){return e.loadContent(o).then(function(){return r()})})).then(function(){})};return r(this.tileset.root)},t.prototype.intersectRaycaster=function(e,r,i){var a=this;r===void 0&&(r=!0),i===void 0&&(i=[]);for(var o=[this.tileset.root],s=this.tileset.transform,l=this.tileset.transformIsIdentity,u,d=[];u=o.pop();){var f=void 0;if(u.boundingVolume){var A=l?u.boundingVolume:u.boundingVolume.clone().applyMatrix4(s);f=A.intersectRay(e.ray,e.far)}else f=!0;if(f){for(var m=0,h=u.children.length;m<h;m++)o.push(u.children[m]);u.selected&&u.content&&u.content.data&&u.content.data.object.visible&&u.content.data.object.intersectRaycaster(e,!1,d)}}return this.model.shownFloorIndex>=0&&(d=d.filter(function(v){return v.floor===a.model.shownFloorIndex})),r&&d.sort(function(v,y){return v.distance-y.distance}),d.map(function(v){v.model=a.model,v.viewLayer=a.viewLayer}),i.push.apply(i,d),i},t.prototype.cloneSkipBackfaceObject=function(e){var r;e instanceof c.Mesh?r=new c.Mesh(e.geometry,Array.isArray(e.material)?e.material.map(function(s){return s.transparent?cs:ls}):e.material&&e.material.transparent?cs:ls):e instanceof c.Group?r=new c.Group:r=new c.Object3D,r.copy(e,!1);for(var i=0,a=e.children;i<a.length;i++){var o=a[i];r.add(this.cloneSkipBackfaceObject(o))}return r},t.prototype.update=function(e,r){var i=this,a,o;this.tileset.transform.equals(this.matrixWorld)||this.tileset.transform.copy(this.matrixWorld),this.tileset.cache.reset(),this.tileset.frameNumber++;var s=this.visible&&(this.parent?this.parent.visible:!0),l={camera:{position:new c.Vector3().copy(r.position),direction:r.getDirection(new c.Vector3),up:new c.Vector3().copy(r.up),visible:r.visible,type:r.type,refine:r.refineModel},minLevelOfDetail:s?Math.min(this.minLevelOfDetail,this.maxLevelOfDetail):-1,maxLevelOfDetail:s?this.idle?0:this.maxLevelOfDetail:-1,height:r.resolution.height,pixelRatio:r.pixelRatio,frameNumber:this.tileset.frameNumber,sseDenominator:2*Math.tan(.5*r.fov/180*Math.PI),cullingVolume:new Qn().setFromCamera(r)},u=this.cacheCameras.map(function(S){return F(F({},l),{camera:{position:new c.Vector3().copy(S.position),direction:S.getWorldDirection(new c.Vector3),type:r.type,up:new c.Vector3().copy(S.up),visible:S.visible,refine:!0},cullingVolume:new Qn().setFromCamera(S)})});this.tileset.traverse(l,u),this.refined=!0,this.refineProgress[0]=0,this.refineProgress[1]=0;var d=1/0;this.tileset.needsRefinedTiles.forEach(function(S){if(S.levelOfContent<d&&(d=S.levelOfContent),i.refineProgress[1]++,S.content&&S.state.visible){var T=S.content.loadState;if(T==="UNLOADED"||T==="LOADING"){i.refined=!1;return}}i.refineProgress[0]++}),this.loaded===!1&&this.refineProgress[1]>0&&(this.loaded=!0,this.tileset.needsRefinedTiles.forEach(function(S){if(i.loaded!==!1&&S.content&&S.levelOfContent===d&&S.state.visible){var T=S.content.loadState;(T==="UNLOADED"||T==="LOADING")&&(i.loaded=!1)}}));for(var f;f=this.unloadTileQueue.pop();)this.unloadContent(f);this.remove.apply(this,this.children);var A=[],m=[],h=[];this.tileset.skipLevelOfDetail||this.tileset.selectedTiles.sort(function(S,T){return S.floor-T.floor});for(var v=function(S){y.debug&&S.boundingVolumeDebugObject&&m.push(S.boundingVolumeDebugObject);var T=(o=(a=S.content)===null||a===void 0?void 0:a.data)===null||o===void 0?void 0:o.object;if(!T)return"continue";if(y.tileset.skipLevelOfDetail&&y.tileset.hasMixedContent&&!S.state.finalResolution){var B=y.cloneSkipBackfaceObject(T);A.push(B)}var L=S.state.selectionDepth,k=Jt.TILE_MASK|L<<Jt.SKIP_LOD_BIT_SHIFT,O=c.GreaterEqualStencilFunc,D=Jt.SKIP_LOD_MASK,N=c.ReplaceStencilOp,X=Jt.TILE_MASK|Jt.SKIP_LOD_MASK;T.traverse(function(K){if(K instanceof c.Mesh)for(var Q=Array.isArray(K.material)?K.material:K.material?[K.material]:[],G=0,J=Q;G<J.length;G++){var H=J[G];i.tileset.hasMixedContent&&i.tileset.skipLevelOfDetail?(H.stencilWrite=!0,H.stencilRef=k,H.stencilFunc=O,H.stencilFuncMask=D,H.stencilZPass=N,H.stencilWriteMask=X):(H.stencilWrite=!1,H.stencilRef=Jt.TILE_MASK,H.stencilFunc=c.AlwaysStencilFunc,H.stencilFuncMask=Jt.TILE_MASK,H.stencilZPass=c.ReplaceStencilOp,H.stencilWriteMask=Jt.TILE_MASK)}}),h.push(T)},y=this,p=0,g=this.tileset.selectedTiles;p<g.length;p++){var x=g[p];v(x)}var b=[];this.skipLevelOfDetail&&b.push.apply(b,A),b.push.apply(b,h),this.skipLevelOfDetail&&b.push(this.clearStencilObject),this.debug&&b.push.apply(b,m);for(var w=this.modelIndex*1e4,E=function(S){var T=b[S],B=S+w;T.traverse(function(L){(L instanceof c.Mesh||L instanceof c.Line||L instanceof c.Points)&&(L.renderOrder=B)}),M.add(T)},M=this,C=0;C<b.length;C++)E(C);var P=this.getRenderHash();this.lastRenderHash!==P&&(this.needsRender=!0,this.lastRenderHash=P)},t.prototype.dispose=function(){this.disposed=!0,this.viewLayer=void 0,this.tileset.reset();for(var e;e=this.unloadTileQueue.pop();)this.unloadContent(e)},t.DEFAULT_MIN_LEVEL_OF_DETAIL=0,t.DEFAULT_MAX_LEVEL_OF_DETAIL=20,t.DEFAULT_MAX_MEMORY_USAGE=16,t.DEFAULT_MAX_SCREEN_SPACE_ERROR=mn.DEFAULT_MAX_SCREEN_SPACE_ERROR,t.DEFAULT_SKIP_LEVEL_OF_DETAIL=mn.DEFAULT_SKIP_LEVEL_OF_DETAIL,t.DEFAULT_LOAD_SIBLINGS=mn.DEFAULT_LOAD_SIBLINGS,t.DEFAULT_MAX_REQUESTS=mn.DEFAULT_MAX_REQUESTS,t}(c.Object3D);function Vf(n){return-((n-.25)*360+90)/180*Math.PI}function La(n,t){if(n===t)return!0;if(n&&t&&typeof n=="object"&&typeof t=="object"){if(n.constructor!==t.constructor)return!1;var e,r,i;if(Array.isArray(n)){if(e=n.length,e!=t.length)return!1;for(r=e;r--!==0;)if(!La(n[r],t[r]))return!1;return!0}if(n.constructor===RegExp)return n.source===t.source&&n.flags===t.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===t.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===t.toString();if(i=Object.keys(n),e=i.length,e!==Object.keys(t).length)return!1;for(r=e;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=e;r--!==0;){var a=i[r];if(!La(n[a],t[a]))return!1}return!0}return n!==n&&t!==t}function Gt(n){return typeof n=="number"}var ds=function(){return new Error("Invalid input.")},fs=function(){return new Error("Invalid certificate.")},hs=function(){return new Error("Invalid signature.")},Nf=function(n){return new Error("date(".concat(n.toString(),") expired."))},Df=function(n){return new Error("host(".concat(JSON.stringify(n),") is not allowed."))};function zf(n,t){for(var e={},r=0,i=Object.keys(n);r<i.length;r++){var a=i[r];t.indexOf(a)===-1&&(e[a]=n[a])}return e}function Ln(n,t){t===void 0&&(t=!1);var e=typeof n;if(e==="string")return JSON.stringify(n);if(n===!0)return"true";if(n===!1)return"false";if(n===null)return"null";if(n instanceof Array){for(var r="[",i=n.length-1,a=0;a<i;a++)r+=Ln(n[a],!1)+",";return i>-1&&(r+=Ln(n[a],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return Ln(n.toJSON(),t);for(var o=Object.keys(n).sort(),s=o.length,r="",a=0;a<s;){var l=o[a],u=Ln(n[l],!0);u!==void 0&&(a&&r!==""&&(r+=","),r+=JSON.stringify(l)+":"+u),a++}return"{"+r+"}"}switch(e){case"function":case"undefined":return t?void 0:null;case"number":return 0;default:return isFinite(n)?n:null}}function Qf(n){return String(Ln(n,!1))}function uu(n){var t,e,r;if(Array.isArray(n)){var i=void 0,a,o;if(n.length<=0)return ds();for(var s=function(w){var E=uu(n[w]);if(E instanceof Error)return{value:E};if(!i)i=E.issuer;else if(i!==E.issuer)return{value:fs()};a?E.expire.getTime()<a.getTime()&&(a=E.expire):a=E.expire,o?o=o.filter(function(M){return E.allowHosts.indexOf(M)!==-1}):o=E.allowHosts},l=0;l<n.length;l++){var u=s(l);if(typeof u=="object")return u.value}return gn({issuer:i,expire:a,allowHosts:o})}var d=JSON.parse(n),f=typeof location!="undefined"?location.hostname:"",A=Date.now();if(typeof d!="object")return ds();var m=new Date(typeof d.expire_at=="string"&&/^\d+$/.test(d.expire_at)?Number(d.expire_at):d.expire_at),h=Array.isArray(d.allow_hosts)?d.allow_hosts:[];if(f.length===0||nn(f)||sr.filter(function(w){return Hr(w,f)}).length>0){var v=String((t=d.certificate)!==null&&t!==void 0?t:"");if(v){var y=new Ke;return y.readCertPEM(v),gn({issuer:y.getSubjectString(),expire:m,allowHosts:h})}return gn({issuer:"none",expire:m,allowHosts:h})}var p=String((e=d.certificate)!==null&&e!==void 0?e:"");if(!p)return fs();var g=new Ke;g.readCertPEM(p);var x=String((r=d._signature)!==null&&r!==void 0?r:"");if(!x)return hs();var b=Qf(zf(d,["_signature"]));return Yl(b,x,g)===!1?hs():A<m.getTime()?h.filter(function(w){return Hr(w,f)}).length===0?Df(f):gn({issuer:g.getSubjectString(),expire:m,allowHosts:h}):Nf(m)}var ps=new c.Matrix4,ao=new WeakMap,oo=function(){function n(t,e){this.name="",this.workCode="",this.expire=new Date,this.allowHosts=[],this.initial={work:this},this.observers=[],this.issuer="none",this.raw={works:[""],options:""},this.transform=new c.Matrix4;{var r=this;this.options={get transform(){return r.transform},set transform(a){r.transform.copy(a)}}}var i=qf(t,e,this);if(i instanceof Error)throw new Error("[PARSE FAILED]: "+i.message+`
|
|
928
|
+
`),Ra=typeof Worker!="undefined"&&typeof Blob!="undefined",J0="";if(Ra)try{var gf=new Blob([mf],{type:"text/javascript"});J0=URL.createObjectURL(gf)}catch(n){}var W0=function(){function n(){var t=this;if(!Ra)throw new Error("LZMAWorker cannot work in this broswer.");this.callCounter=0,this.requests={};var e=this.worker=new Worker(J0);e.onmessage=function(r){var i=r.data,a=i.id,o=i.result,s=i.error,l=t.getKey(a);t.requests[l]&&(s?t.requests[l](new Error(s)):t.requests[l](null,o),delete t.requests[l])},e.onerror=function(r){return console.error(r)}}return n.prototype.getKey=function(t){return"key_"+String(t)},n.prototype.decompress=function(t,e){var r=++this.callCounter;this.requests[this.getKey(r)]=e,this.worker.postMessage({type:"decompress",id:r,data:t},[t.buffer])},n.prototype.terminate=function(){this.worker.terminate()},n.support=Ra,n}();function as(n){return Array.prototype.reduce.call(n,function(t,e,r){return t|e<<r*8},0)}function yf(n){for(var t=[],e=n.length,r=function(o){var s={data:n[o],offset:0,readByte:function(){return this.data[this.offset++]}},l=s.data.length,u={data:[],offset:0,writeByte:function(f){var A=Math.floor(this.offset/l);this.data[A]||(this.data[A]=new Uint8Array(l)),this.data[A][this.offset%l]=f,this.offset++}};hf.decompressFile(s,u),i=new Uint8Array(u.offset);for(var d=0;d<u.offset;d++)i[d]=u.data[Math.floor(d/l)][d%l];t.push(i)},i,a=0;a<e;a++)r(a);return t}function bf(n){for(var t=[],e=n.length,r=function(a){t.push(new Promise(function(o,s){var l=new W0;l.decompress(n[a],function(u,d){if(l.terminate(),u)return s(u);o(d)})}))},i=0;i<e;i++)r(i);return Promise.all(t)}function X0(n){var t=new Uint8Array(n),e=as(t.slice(0,4));if(e>10)return Promise.reject(new Error("LZMA got too many sub chunks."));for(var r=[],i=[],a=4+e*4,o=0;o<e;o++)i[o]=as(t.slice(4+o*4,8+o*4)),o===e-1?r[o]=t.subarray(a,a+i[o]):r[o]=t.slice(a,a+i[o]),a+=i[o];return W0.support?bf(r):Promise.resolve(yf(r))}var oa=!1,_0=[];function Z0(n){if(n===void 0&&(n=!1),!(!n&&oa)){oa=!0;var t=_0.shift();if(t){try{t()}catch(e){}vt.shared.add(function(){return Z0(!0)},!0,2,-100)}else oa=!1}}function Si(n){return new Promise(function(t,e){var r=function(){try{t(n())}catch(i){e(i)}};_0.push(r),vt.shared.add(function(){return Z0()},!0,2,-100)})}function Cr(n,t){for(var e={},r=0,i=t;r<i.length;r++){var a=i[r];a in n&&(e[a]=n[a])}return e}function xf(n,t){for(var e=F({},n),r=0,i=t;r<i.length;r++){var a=i[r];a in e&&delete e[a]}return e}function Fn(n,t){t===void 0&&(t=!1);var e=typeof n;if(e==="string")return JSON.stringify(n);if(n===!0)return"true";if(n===!1)return"false";if(n===null)return"null";if(n instanceof Array){for(var r="[",i=n.length-1,a=0;a<i;a++)r+=Fn(n[a],!1)+",";return i>-1&&(r+=Fn(n[a],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return Fn(n.toJSON(),t);for(var o=Object.keys(n).sort(),s=o.length,r="",a=0;a<s;){var l=o[a],u=Fn(n[l],!0);u!==void 0&&(a&&r!==""&&(r+=","),r+=JSON.stringify(l)+":"+u),a++}return"{"+r+"}"}switch(e){case"function":return JSON.stringify(n.toString());case"undefined":return t?void 0:null;case"number":return n;default:return isFinite(n)?n:null}}function Cn(n){return"hash::".concat(Fn(n,!1))}const Gr=qr.Reader,Zt=qr.util,Lt=qr.roots["@REALSEE/FIVE:five/loaders/model/proto/pbm.proto"]||(qr.roots["@REALSEE/FIVE:five/loaders/model/proto/pbm.proto"]={}),Y0=Lt.Model=(()=>{function n(t){if(this.chunks=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.chunks=Zt.emptyArray,n.prototype.createAt=Zt.Long?Zt.Long.fromBits(0,0,!0):0,n.prototype.description="",n.decode=function(e,r){e instanceof Gr||(e=Gr.create(e));let i=r===void 0?e.len:e.pos+r,a=new Lt.Model;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.chunks&&a.chunks.length||(a.chunks=[]),a.chunks.push(Lt.Chunk.decode(e,e.uint32()));break}case 2:{a.createAt=e.uint64();break}case 3:{a.description=e.string();break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Model"},n})();Lt.Chunk=(()=>{function n(t){if(t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.vertices=null,n.prototype.faces=null,n.prototype.name="",n.prototype.texture="",n.decode=function(e,r){e instanceof Gr||(e=Gr.create(e));let i=r===void 0?e.len:e.pos+r,a=new Lt.Chunk;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.vertices=Lt.Vertices.decode(e,e.uint32());break}case 2:{a.faces=Lt.Faces.decode(e,e.uint32());break}case 3:{a.name=e.string();break}case 4:{a.texture=e.string();break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("vertices"))throw Zt.ProtocolError("missing required 'vertices'",{instance:a});if(!a.hasOwnProperty("faces"))throw Zt.ProtocolError("missing required 'faces'",{instance:a});if(!a.hasOwnProperty("name"))throw Zt.ProtocolError("missing required 'name'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Chunk"},n})();Lt.Vertices=(()=>{function n(t){if(this.xyz=[],this.uvs=[],this.marks=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.xyz=Zt.emptyArray,n.prototype.uvs=Zt.emptyArray,n.prototype.marks=Zt.emptyArray,n.decode=function(e,r){e instanceof Gr||(e=Gr.create(e));let i=r===void 0?e.len:e.pos+r,a=new Lt.Vertices;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.xyz&&a.xyz.length||(a.xyz=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.xyz.push(e.float())}else a.xyz.push(e.float());break}case 2:{if(a.uvs&&a.uvs.length||(a.uvs=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.uvs.push(e.float())}else a.uvs.push(e.float());break}case 3:{if(a.marks&&a.marks.length||(a.marks=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.marks.push(e.int32())}else a.marks.push(e.int32());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Vertices"},n})();Lt.Faces=(()=>{function n(t){if(this.indices=[],this.normals=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.indices=Zt.emptyArray,n.prototype.normals=Zt.emptyArray,n.decode=function(e,r){e instanceof Gr||(e=Gr.create(e));let i=r===void 0?e.len:e.pos+r,a=new Lt.Faces;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.indices&&a.indices.length||(a.indices=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.indices.push(e.uint32())}else a.indices.push(e.uint32());break}case 2:{if(a.normals&&a.normals.length||(a.normals=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.normals.push(e.float())}else a.normals.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Faces"},n})();Lt.VertexMark=(()=>{const n={},t=Object.create(n);return t[n[0]="VERTEX_MARK_UNSPECIFIED"]=0,t[n[1]="VERTEX_MARK_ROOF"]=1,t})();function $0(n,t){var e,r,i,a={byteLength:0},o=ao((e=t.textureOptions)!==null&&e!==void 0?e:{},(i=(r=t.textureArray)===null||r===void 0?void 0:r.length)!==null&&i!==void 0?i:0),s={};if(t.textureArray)for(var l=0,u=t.textureArray;l<u.length;l++){var d=u[l];s[d]=io(d,o,t.fetcher)}return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"})}).then(function(f){return a.byteLength=f.body.byteLength,Si(function(){var A=new Uint8Array(f.body);return Y0.decode(A)})}).then(function(f){return Si(function(){var A,m;return tu(f,(A=t.textureBaseUri)!==null&&A!==void 0?A:function(){var h=n.lastIndexOf("/");if(h>=0){var v=n.slice(0,h)+"/";return/\/model\/$/.test(v)&&(v=v.replace(/\/model\/$/,"/materials/")),v}return""}(),((m=t.textureArray)!==null&&m!==void 0?m:[]).slice(),o,s,t.fetcher)})}).then(function(f){var A=new c.Group;A.matrixAutoUpdate=!1,A.matrix.compose(A.position,A.quaternion,A.scale),A.name=n;for(var m=0,h=f.objects;m<h.length;m++){var v=h[m];A.add(v)}return f.texturePromise.then(function(){return{type:"pbm",uri:n,byteLength:a.byteLength,object:A,dispose:function(){return f.dispose()}}})})}function eu(n){var t=n.match(/(group|floor)-?(\d+)/);return t?parseInt(t[2],10):0}function ka(n){var t=n.match(/(chunk)-?(\d+)/);return t?parseInt(t[2],10):0}function wf(n){var t=n.match(/(sub)-?(\d+)/);return t?parseInt(t[2],10):0}function os(n){var t=eu(n.name),e=ka(n.name),r=wf(n.name);return t*1e6+e*1e3+r}function Ef(n){for(var t,e,r,i=typeof n.createAt=="number"?n.createAt:0,a=(t=n.description)!==null&&t!==void 0?t:"",o=[],s=!0,l=!0,u=0,d=n.chunks;u<d.length;u++){var f=d[u];if(!f.vertices.marks||f.vertices.marks.length===0){l=!1;break}}for(var A=0,m=n.chunks;A<m.length;A++){var f=m[A];if(!f.faces.normals||f.faces.normals.length===0){s=!1;break}}for(var h=n.chunks.sort(function(cr,Fe){return os(cr)-os(Fe)}),v=[],y=0,p=h;y<p.length;y++){var f=p[y],g=eu(f.name);v[g]||(v[g]=[]),v[g].push(f)}for(var x=0;x<v.length;x++){var b=v[x];if(b)if(s){for(var w=0,E=0;E<b.length;E++){var f=b[E];w+=f.faces.indices.length}for(var M=new Float32Array(w*3),C=new Float32Array(w),P=new Float32Array(w*2),S=new Float32Array(w*3),T=[],B=[1/0,1/0,1/0,-1/0,-1/0,-1/0],L=0,k=0;k<b.length;k++){for(var O=[1/0,1/0,1/0,-1/0,-1/0,-1/0],f=b[k],D=f.vertices.xyz,N=f.vertices.uvs,X=f.faces.indices,K=f.faces.normals,Q=f.vertices.marks,G=X.length,E=0;E<G;E++){var J=X[E],H=M[L*3+E*3]=D[J*3],j=M[L*3+E*3+1]=D[J*3+1],Z=M[L*3+E*3+2]=D[J*3+2];C[L+E]=l?Q[J]:0,P[L*2+E*2]=N[J*2],P[L*2+E*2+1]=N[J*2+1];var Y=Math.floor(E/3)*3;S[L*3+E*3]=K[Y],S[L*3+E*3+1]=K[Y+1],S[L*3+E*3+2]=K[Y+2],H<O[0]&&(O[0]=H),j<O[1]&&(O[1]=j),Z<O[2]&&(O[2]=Z),H>O[3]&&(O[3]=H),j>O[4]&&(O[4]=j),Z>O[5]&&(O[5]=Z)}O[0]<B[0]&&(B[0]=O[0]),O[1]<B[1]&&(B[1]=O[1]),O[2]<B[2]&&(B[2]=O[2]),O[3]>B[3]&&(B[3]=O[3]),O[4]>B[4]&&(B[4]=O[4]),O[5]>B[5]&&(B[5]=O[5]),T.push({materialIndex:k,name:f.name,chunkName:ka(f.name),start:L,count:f.faces.indices.length,texture:(e=f.texture)!==null&&e!==void 0?e:void 0}),L+=G}var pe={createAt:i,description:a,vertices:M,uvs:P,normals:S,indices:null,floorIndex:x,groups:T,extents:B,vertexMarks:C};o.push(pe)}else{for(var w=0,ee=0,E=0;E<b.length;E++){var f=b[E];ee+=f.vertices.xyz.length/3,w+=f.faces.indices.length}for(var M=new Float32Array(ee*3),P=new Float32Array(ee*2),S=new Float32Array(ee*3),oe=new Float32Array(ee),ie=new Uint32Array(w),C=new Float32Array(w),T=[],B=[1/0,1/0,1/0,-1/0,-1/0,-1/0],ce=0,L=0,k=0;k<b.length;k++){for(var O=[1/0,1/0,1/0,-1/0,-1/0,-1/0],f=b[k],D=f.vertices.xyz,Q=f.vertices.marks,N=f.vertices.uvs,X=f.faces.indices,ne=D.length/3,G=X.length,E=0;E<ne;E++){var H=M[L*3+E*3]=D[E*3],j=M[L*3+E*3+1]=D[E*3+1],Z=M[L*3+E*3+2]=D[E*3+2];C[L+E]=l?Q[E]:0,P[L*2+E*2]=N[E*2],P[L*2+E*2+1]=N[E*2+1],oe[L+E]=x,H<O[0]&&(O[0]=H),j<O[1]&&(O[1]=j),Z<O[2]&&(O[2]=Z),H>O[3]&&(O[3]=H),j>O[4]&&(O[4]=j),Z>O[5]&&(O[5]=Z)}O[0]<B[0]&&(B[0]=O[0]),O[1]<B[1]&&(B[1]=O[1]),O[2]<B[2]&&(B[2]=O[2]),O[3]>B[3]&&(B[3]=O[3]),O[4]>B[4]&&(B[4]=O[4]),O[5]>B[5]&&(B[5]=O[5]);for(var E=0;E<G;E++)ie[ce+E]=L+X[E];T.push({materialIndex:k,name:f.name,chunkName:ka(f.name),start:ce,count:f.faces.indices.length,texture:(r=f.texture)!==null&&r!==void 0?r:void 0}),L+=ne,ce+=G}for(var E=0;E<w;E+=3){var ae=void 0,de=void 0,ve=void 0,xe=void 0,Ce=void 0,Be=void 0,$=void 0,te=void 0,U=void 0,Le=void 0,Pe=void 0,Ie=void 0,Qe=void 0,be=void 0,ye=void 0,ge=void 0,me=void 0,Ae=void 0,Ne=void 0,ze=void 0,je=void 0;ae=ie[E]*3,de=ie[E+1]*3,ve=ie[E+2]*3,xe=M[ae],Ce=M[ae+1],Be=M[ae+2],$=M[de],te=M[de+1],U=M[de+2],Le=M[ve],Pe=M[ve+1],Ie=M[ve+2],Qe=Le-$,be=Pe-te,ye=Ie-U,ge=xe-$,me=Ce-te,Ae=Be-U,Ne=be*Ae-ye*me,ze=ye*ge-Qe*Ae,je=Qe*me-be*ge,S[ae]+=Ne,S[ae+1]+=ze,S[ae+2]+=je,S[de]+=Ne,S[de+1]+=ze,S[de+2]+=je,S[ve]+=Ne,S[ve+1]+=ze,S[ve+2]+=je}var pe={createAt:i,description:a,vertices:M,uvs:P,normals:S,indices:ie,floorIndex:x,groups:T,extents:B,vertexMarks:C};o.push(pe)}}return o}function io(n,t,e,r){var i=F({key:"texture.pbm"},Cr(t,["format","quality","size","sharpen","mappings"])),a=new _n,o=a.loadTexture(n,{imageURL:{transform:t.transform,options:i},encoding:c.sRGBEncoding,wrapS:c.ClampToEdgeWrapping,wrapT:c.ClampToEdgeWrapping,minFilter:c.LinearFilter,maxSize:typeof i.size=="number"?new c.Vector2(i.size,i.size):void 0,fetcher:e}).then(function(s){var l=s.body;return l.needsUpdate=!0,l});return Object.assign(o,{url:n,textureOptions:t})}function tu(n,t,e,r,i,a,o){i===void 0&&(i={});for(var s=Ef(n),l=0,u="",d=[],f={},A=new Set,m=0,h=s;m<h.length;m++){var v=h[m],y=v.createAt,p=v.description,g=v.vertices,x=v.vertexMarks,b=v.uvs,w=v.normals,E=v.indices,M=v.floorIndex,C=v.groups,P=v.extents,S=new c.Box3;S.min.x=P[0],S.min.y=P[1],S.min.z=P[2],S.max.x=P[3],S.max.y=P[4],S.max.z=P[5];var T=new c.BufferGeometry;T.setAttribute("position",new c.BufferAttribute(g,3)),T.setAttribute("uv",new c.BufferAttribute(b,2)),T.setAttribute("normal",new c.BufferAttribute(w,3)),T.setAttribute("isRoofMark",new c.BufferAttribute(x,1)),E&&T.setIndex(new c.BufferAttribute(E,1)),T.boundingBox=S,T.boundingSphere=S.getBoundingSphere(new c.Sphere);for(var B=0,L=C;B<L.length;B++){var k=L[B];T.addGroup(k.start,k.count,k.materialIndex)}A.add(T);for(var O=[],D=0,N=C;D<N.length;D++){var k=N[D],X=e[k.chunkName]||(k.texture?xt(t||"",k.texture):void 0),K=new Tn("basic");K.defines.USE_VERTEX_FLOOR=!1,K.floor=M,O.push(K),X?f[X]?f[X].push(K):f[X]=[K]:K.color=new c.Color(16777215),A.add(K)}var Q=new Vt(T,O);Q.name="model_floor_"+M,Q.userData.createAt=y,Q.userData.description=p,Q.matrix.compose(Q.position,Q.quaternion,Q.scale),Q.matrixAutoUpdate=!1,Q.frustumCulled=!1,l=y,u=p,d.push(Q)}var G="",J=function(j){j=ao(j,e.length);var Z=[],Y=Cn(j);if(G===Y)return Promise.resolve();G=Y;for(var pe=function(ce){var ne=null;ce in i&&(Cn(i[ce].textureOptions)===Cn(j)?ne=i[ce]:i[ce].then(function(ae){return ae.dispose()})),ne||(ne=io(ce,j,a)),Z.push(ne.then(function(ae){if(G!==Y){ae.dispose();return}for(var de=0,ve=f[ce];de<ve.length;de++){var xe=ve[de];xe.map&&(A.delete(xe.map),xe.map.dispose()),xe.map=ae,A.add(ae)}}).catch(function(){if(G===Y)for(var ae=0,de=f[ce];ae<de.length;ae++){var ve=de[ae];ve.map&&(A.delete(ve.map),ve.map.dispose()),ve.map=null,ve.color=new c.Color(16777215)}}))},ee=0,oe=Object.keys(f);ee<oe.length;ee++){var ie=oe[ee];pe(ie)}for(var ie in i)delete i[ie];return Promise.all(Z).then(function(){})},H=J(r);return{createAt:l,description:u,objects:d,texturePromise:H,updateTexture:J,dispose:function(){A.forEach(function(j){j.dispose()}),A.clear()}}}function ao(n,t){return n=Object.assign({},n),n.autoResize!==!1&&(t>96?n.size=Math.min(n.size||1/0,100):t>48?n.size=Math.min(n.size||1/0,200):t>24?n.size=Math.min(n.size||1/0,400):t>22?n.size=Math.min(n.size||1/0,800):t>5&&(n.size=Math.min(n.size||1/0,1024))),n}function ru(n,t){var e,r,i,a={byteLength:0},o=ao((e=t.textureOptions)!==null&&e!==void 0?e:{},(i=(r=t.textureArray)===null||r===void 0?void 0:r.length)!==null&&i!==void 0?i:0),s={};if(t.textureArray)for(var l=0,u=t.textureArray;l<u.length;l++){var d=u[l];s[d]=io(d,o,t.fetcher)}return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"})}).then(function(f){return X0(f.body)}).then(function(f){return Si(function(){for(var A,m={chunks:[],createAt:void 0,description:void 0},h=0,v=f;h<v.length;h++){var y=v[h],p=Y0.decode(y);p.chunks.length&&((A=m.chunks).push.apply(A,p.chunks),m.createAt=p.createAt,m.description=p.description)}return m})}).then(function(f){return Si(function(){var A,m,h;return tu(f,(A=t.textureBaseUri)!==null&&A!==void 0?A:function(){var v=n.lastIndexOf("/");if(v>=0){var y=n.slice(0,v)+"/";return/\/model\/$/.test(y)&&(y=y.replace(/\/model\/$/,"/materials/")),y}return""}(),((m=t.textureArray)!==null&&m!==void 0?m:[]).slice(),(h=t.textureOptions)!==null&&h!==void 0?h:{},s,t.fetcher)})}).then(function(f){var A=new c.Group;A.name=n;for(var m=0,h=f.objects;m<h.length;m++){var v=h[m];A.add(v)}return f.texturePromise.then(function(){return{type:"at3d",uri:n,byteLength:a.byteLength,object:A,dispose:function(){return f.dispose()}}})})}const Xe=qr.Reader,at=qr.util,Re=qr.roots["@REALSEE/FIVE:five/loaders/model/proto/dome.proto"]||(qr.roots["@REALSEE/FIVE:five/loaders/model/proto/dome.proto"]={}),Cf=Re.Model=(()=>{function n(t){if(this.meshes=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.meshes=at.emptyArray,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Re.Model;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.meshes&&a.meshes.length||(a.meshes=[]),a.meshes.push(Re.Mesh.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Model"},n})();Re.Mesh=(()=>{function n(t){if(this.chunks=[],this.matrix=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.name="",n.prototype.chunks=at.emptyArray,n.prototype.matrix=at.emptyArray,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Re.Mesh;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.name=e.string();break}case 2:{a.chunks&&a.chunks.length||(a.chunks=[]),a.chunks.push(Re.Chunk.decode(e,e.uint32()));break}case 3:{a.matrix&&a.matrix.length||(a.matrix=[]),a.matrix.push(Re.Matrix.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("name"))throw at.ProtocolError("missing required 'name'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Mesh"},n})();Re.Matrix=(()=>{function n(t){if(this.elements=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.elements=at.emptyArray,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Re.Matrix;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.elements&&a.elements.length||(a.elements=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.elements.push(e.float())}else a.elements.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Matrix"},n})();Re.Chunk=(()=>{function n(t){if(this.material=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.geometry=null,n.prototype.material=at.emptyArray,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Re.Chunk;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 2:{a.geometry=Re.Geometry.decode(e,e.uint32());break}case 3:{a.material&&a.material.length||(a.material=[]),a.material.push(Re.Material.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("geometry"))throw at.ProtocolError("missing required 'geometry'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Chunk"},n})();Re.Geometry=(()=>{function n(t){if(this.groups=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.position=null,n.prototype.uv=null,n.prototype.uv2=null,n.prototype.normal=null,n.prototype.groups=at.emptyArray,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Re.Geometry;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.position=Re.Position.decode(e,e.uint32());break}case 2:{a.uv=Re.UV.decode(e,e.uint32());break}case 3:{a.uv2=Re.UV.decode(e,e.uint32());break}case 4:{a.normal=Re.Normal.decode(e,e.uint32());break}case 5:{a.groups&&a.groups.length||(a.groups=[]),a.groups.push(Re.Group.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("position"))throw at.ProtocolError("missing required 'position'",{instance:a});if(!a.hasOwnProperty("normal"))throw at.ProtocolError("missing required 'normal'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Geometry"},n})();Re.Position=(()=>{function n(t){if(this.array=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.array=at.emptyArray,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Re.Position;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.array&&a.array.length||(a.array=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.array.push(e.float())}else a.array.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Position"},n})();Re.UV=(()=>{function n(t){if(this.array=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.array=at.emptyArray,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Re.UV;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.array&&a.array.length||(a.array=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.array.push(e.float())}else a.array.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/UV"},n})();Re.Normal=(()=>{function n(t){if(this.array=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.array=at.emptyArray,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Re.Normal;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.array&&a.array.length||(a.array=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.array.push(e.float())}else a.array.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Normal"},n})();Re.Group=(()=>{function n(t){if(t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.start=0,n.prototype.count=0,n.prototype.materialIndex=0,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Re.Group;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.start=e.uint32();break}case 2:{a.count=e.uint32();break}case 3:{a.materialIndex=e.uint32();break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("start"))throw at.ProtocolError("missing required 'start'",{instance:a});if(!a.hasOwnProperty("count"))throw at.ProtocolError("missing required 'count'",{instance:a});if(!a.hasOwnProperty("materialIndex"))throw at.ProtocolError("missing required 'materialIndex'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Group"},n})();Re.Material=(()=>{function n(t){if(t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.kd=null,n.prototype.ks=null,n.prototype.ke=null,n.prototype.mapkd="",n.prototype.mapks="",n.prototype.mapke="",n.prototype.norm="",n.prototype.mapbump="",n.prototype.bump="",n.prototype.mapd="",n.prototype.ns=0,n.prototype.d=0,n.prototype.tr=0,n.prototype.mapkdrepeat="",n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Re.Material;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.kd=Re.Color.decode(e,e.uint32());break}case 2:{a.ks=Re.Color.decode(e,e.uint32());break}case 3:{a.ke=Re.Color.decode(e,e.uint32());break}case 4:{a.mapkd=e.string();break}case 5:{a.mapks=e.string();break}case 6:{a.mapke=e.string();break}case 7:{a.norm=e.string();break}case 8:{a.mapbump=e.string();break}case 9:{a.bump=e.string();break}case 10:{a.mapd=e.string();break}case 11:{a.ns=e.float();break}case 12:{a.d=e.float();break}case 13:{a.tr=e.float();break}case 14:{a.mapkdrepeat=e.string();break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Material"},n})();Re.Color=(()=>{function n(t){if(this.rgb=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.rgb=at.emptyArray,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Re.Color;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.rgb&&a.rgb.length||(a.rgb=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.rgb.push(e.float())}else a.rgb.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Color"},n})();function nu(n,t){var e={byteLength:0};return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"})}).then(function(r){return e.byteLength=r.body.byteLength,iu(new Uint8Array(r.body),t.textureBaseUri||"",t.textureOptions,t.fetcher)}).then(function(r){var i=new c.Group;i.matrixAutoUpdate=!1,i.matrix.compose(i.position,i.quaternion,i.scale),i.name=n;for(var a=0,o=r.objects;a<o.length;a++){var s=o[a];i.add(s)}return r.texturePromise.then(function(){return{type:"dome",uri:n,byteLength:e.byteLength,object:i,dispose:function(){return r.dispose()}}})})}function Mf(n){for(var t=[0,0,0],e=0;e<n.attributes.normal.array.length/9;e++)t[0]=n.attributes.normal.array[e*9],t[1]=n.attributes.normal.array[e*9+1],t[2]=n.attributes.normal.array[e*9+2],n.attributes.normal.array[e*9]=n.attributes.normal.array[e*9+6],n.attributes.normal.array[e*9+1]=n.attributes.normal.array[e*9+7],n.attributes.normal.array[e*9+2]=n.attributes.normal.array[e*9+8],n.attributes.normal.array[e*9+6]=t[0],n.attributes.normal.array[e*9+7]=t[1],n.attributes.normal.array[e*9+8]=t[2];for(var e=0;e<n.attributes.position.array.length/9;e++)t[0]=n.attributes.position.array[e*9],t[1]=n.attributes.position.array[e*9+1],t[2]=n.attributes.position.array[e*9+2],n.attributes.position.array[e*9]=n.attributes.position.array[e*9+6],n.attributes.position.array[e*9+1]=n.attributes.position.array[e*9+7],n.attributes.position.array[e*9+2]=n.attributes.position.array[e*9+8],n.attributes.position.array[e*9+6]=t[0],n.attributes.position.array[e*9+7]=t[1],n.attributes.position.array[e*9+8]=t[2];for(var e=0;e<n.attributes.uv.array.length/6;e++)t[0]=n.attributes.uv.array[e*6],t[1]=n.attributes.uv.array[e*6+1],n.attributes.uv.array[e*6]=n.attributes.uv.array[e*6+4],n.attributes.uv.array[e*6+1]=n.attributes.uv.array[e*6+5],n.attributes.uv.array[e*6+4]=t[0],n.attributes.uv.array[e*6+5]=t[1];n.attributes.normal.needsUpdate=!0,n.attributes.position.needsUpdate=!0,n.attributes.uv.needsUpdate=!0}function Sf(n){var t=n.position,e=n.normal,r=n.uv,i=n.uv2,a=n.groups,o=new c.BufferGeometry;o.setAttribute("position",new c.BufferAttribute(new Float32Array(t.array),3)),e&&o.setAttribute("normal",new c.BufferAttribute(new Float32Array(e.array),3)),r&&o.setAttribute("uv",new c.BufferAttribute(new Float32Array(r.array),2)),i&&o.setAttribute("uv2",new c.BufferAttribute(new Float32Array(i.array),2));for(var s=0,l=a;s<l.length;s++){var u=l[s];o.addGroup(u.start,u.count,u.materialIndex)}return o}function pn(n,t,e,r,i,a,o){if(o.hasOwnProperty(n))return o[n];n=n.split("?")[0],Er(n)||(n=xt(t,n)),n=n.replace(/\/\/vrlab-image\d*.ljcdn.com\//,"//vrlab-public.ljcdn.com/"),n.indexOf("//")===0&&(n="https:"+n);var s=F({key:"texture.dome",size:64},Cr(e,["quality","format","sharpen","mappings"])),l=o[n]=i.loadTexture(n,{imageURL:{transform:e.transform,options:s},wrapS:c.RepeatWrapping,wrapT:c.RepeatWrapping,fetcher:a}).then(function(u){var d=u.body;return r&&d.repeat.copy(r),d.needsUpdate=!0,d.updateMatrix(),d});return l}function If(n,t,e,r,i,a,o){var s=[],l=new Tn("phong");if(o.add(l),n.kd&&(l.color=new c.Color().fromArray(n.kd.rgb).convertLinearToSRGB()),n.mapkd){var u=null;if(n.mapkdrepeat){var d=n.mapkdrepeat.split(/\s+/).map(function(h){return Number(h)}),f=d[0],A=d[1];u=new c.Vector2(f,A)}s.push(pn(n.mapkd,t,e,u,r,i,a).then(function(h){h.encoding=c.sRGBEncoding,l.map=h,o.add(h),l.needsUpdate=!0}).catch(z))}if(n.ks&&(l.specular=new c.Color().fromArray(n.ks.rgb).convertLinearToSRGB()),n.mapks&&s.push(pn(n.mapks,t,e,null,r,i,a).then(function(h){l.specularMap=h,o.add(h)}).catch(z)),n.ke&&(l.emissive=new c.Color().fromArray(n.ke.rgb).convertLinearToSRGB()),n.mapke&&s.push(pn(n.mapke,t,e,null,r,i,a).then(function(h){h.encoding=c.sRGBEncoding,l.emissiveMap=h,o.add(h)}).catch(z)),n.norm&&s.push(pn(n.norm,t,e,null,r,i,a).then(function(h){l.normalMap=h,o.add(h)}).catch(z)),n.mapbump&&s.push(pn(n.mapbump,t,e,null,r,i,a).then(function(h){l.bumpMap=h,o.add(h)}).catch(z)),n.bump&&s.push(pn(n.bump,t,e,null,r,i,a).then(function(h){l.bumpMap=h,o.add(h)}).catch(z)),typeof n.ns=="number"&&(l.shininess=n.ns),typeof n.d=="number"){var m=n.d;m>0&&m<1&&(l.opacity=m)}return l.floor=0,l.defines.USE_VERTEX_FLOOR=!1,{material:l,textureReady:Promise.all(s).then(z)}}function Tf(n){return Cf.decode(n).meshes}function iu(n,t,e,r){for(var i=[],a=[],o=new Set,s=Tf(n),l=new _n,u=new c.Matrix4,d=new c.Vector3,f=new c.Quaternion,A=new c.Vector3,m={},h=0,v=s;h<v.length;h++){var y=v[h],p=y.name,g=y.chunks,x=y.matrix;if(!(p==="Ceiling"||p==="CeilingDrop"))for(var b=0,w=x;b<w.length;b++){var E=w[b];u.elements=E.elements;for(var M=new c.Group,C=0;C<g.length;C++){var P=Sf(g[C].geometry);P.applyMatrix4(u),u.decompose(d,f,A),A.x*A.y*A.z<0&&P.attributes.normal&&P.attributes.position&&P.attributes.uv&&Mf(P),o.add(P);for(var S=[],T=0,B=g[C].material;T<B.length;T++){var L=B[T],k=If(L,t||"",e,l,r,m,o),O=k.material,D=k.textureReady;a.push(D),S.push(O)}var N=new Vt(P,S);N.name="chunk_"+C,N.matrix.compose(N.position,N.quaternion,N.scale),N.matrixAutoUpdate=!1,N.frustumCulled=!1,M.add(N)}M.name=p,i.push(M)}}var X=Promise.all(a).catch(z),K=function(Q){return Promise.resolve()};return{createAt:0,description:"",objects:i,texturePromise:X,updateTexture:K,dispose:function(){o.forEach(function(Q){Q.dispose()}),o.clear()}}}function au(n,t){var e={byteLength:0};return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"})}).then(function(r){return e.byteLength=r.body.byteLength,X0(r.body)}).then(function(r){var i=r.reduce(function(s,l){return s+l.length},0),a=new Uint8Array(i),o=0;return r.forEach(function(s){a.set(s,o),o+=s.length}),a}).then(function(r){return iu(r,t.textureBaseUri||"",t.textureOptions,t.fetcher)}).then(function(r){var i=new c.Group;i.name=n;for(var a=0,o=r.objects;a<o.length;a++){var s=o[a];i.add(s)}return r.texturePromise.then(function(){return{type:"domez",uri:n,byteLength:e.byteLength,object:i,dispose:function(){return r.dispose()}}})})}var Pf=new c.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function ou(n,t){var e=0;return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"}).then(function(r){return e=r.body.byteLength,r.body})}).then(function(r){var i;return no(r,{copyUV2:!1,addonExtensions:["PBM_mesh"],resourcePath:n.slice(0,n.lastIndexOf("/")+1),search:(i=n.split("?")[1])!==null&&i!==void 0?i:"",fetcher:t.fetcher})}).then(function(r){var i=new c.Matrix4;if(t.upAxis!=="Z"&&i.premultiply(Pf),r.CESIUM_RTC){var a=new c.Matrix4().setPosition(r.CESIUM_RTC.center);i.premultiply(a)}var o=r.scene;return o.applyMatrix4(i),{type:"glb",uri:n,byteLength:e,object:o,dispose:function(){return r.dispose()}}})}var vn=new c.Vector3,ss=new c.Matrix4;function us(n,t){n.name=t.id;var e=t.tileset.properties.floorInfo;n.traverse(function(r){if("floor"in t.extras){if(r instanceof c.Mesh||r instanceof c.Points)for(var i=Array.isArray(r.material)?r.material:r.material?[r.material]:[],a=0,o=i;a<o.length;a++){var s=o[a];(s instanceof Tn||s instanceof ro)&&(s.floor=t.extras.floor)}}else if((r instanceof Vt||r instanceof wr)&&e){var l=r.geometry.index,u=r.geometry.getAttribute("position"),d=0,f=new Float32Array(u.count);if(e)if(l){for(var A=0,m=l.count,h=0;h<m;h++){var b=l.array[h];vn.set(u.array[b*3+0],u.array[b*3+1],u.array[b*3+2]),vn.applyMatrix4(r.matrixWorld);var v=vn.y;f[b]=0;for(var y=0;y<e.length;y++){var w=e[y],g=w.ground,x=w.height;if(v<g+x){f[b]=y;break}}A+=f[b]}d=A/m}else{for(var A=0,m=u.count,h=0;h<m;h++){vn.set(u.array[h*3+0],u.array[h*3+1],u.array[h*3+2]),vn.applyMatrix4(r.matrixWorld);var v=vn.y;f[h]=0;for(var y=0;y<e.length;y++){var p=e[y],g=p.ground,x=p.height;if(v<g+x){f[h]=y;break}}A+=f[h]}d=A/m}t.floor=d,r.geometry.setAttribute("floor",new c.BufferAttribute(f,1)),Array.isArray(r.material)?r.material.forEach(function(E){E.defines.USE_VERTEX_FLOOR=!0,E.needsUpdate=!0}):(r.material.defines.USE_VERTEX_FLOOR=!0,r.material.needsUpdate=!0)}})}function Bf(n,t){if(!n.content)return Promise.resolve(null);var e=n.content,r=D0(e.uri,t.search);if(n.type==="TILESET"){var i=jt(r,{key:"model.".concat(n.siblingIndex)});return t.fetcher.ajax(i,{responseType:"text"}).then(function(a){return a.body}).then(function(a){var o=r.slice(0,r.lastIndexOf("/")+1);return P0(JSON.parse(a),o)}).then(function(a){n.children.length===0&&(n.children=[new to("".concat(n.id,".0"),a.root,n.tileset,n)])}).then(function(){return null})}return n.type==="SCENEGRAPH"?Promise.resolve().then(function(){var a,o,s,l,u,d,f,A,m,h,v="",y=r.split("#"),p=y[0],g=y[1],x=(g||p).split("?")[0].match(/\.([0-9a-zA-Z]+)$/);if(x&&(v=x[1]),v==="b3dm"){var b=jt(r,{key:"model.".concat(n.siblingIndex)});return H0(b,{upAxis:n.tileset.asset.gltfUpAxis,fetcher:t.fetcher}).then(function(w){return w.object.applyMatrix4(n.transform),w.object.updateWorldMatrix(!1,!0),w.object.matrixAutoUpdate=!1,us(w.object,n),w})}if(v==="pnts"){var b=jt(r,{key:"model.".concat(n.siblingIndex)});return K0(b,{fetcher:t.fetcher,computeBoundingBox:!1}).then(function(E){if(E.object.applyMatrix4(n.transform),E.object.updateWorldMatrix(!1,!0),E.object.matrixAutoUpdate=!1,n.boundingVolume){var M=n.boundingVolume;E.object.traverse(function(C){if(C instanceof wr){ss.getInverse(C.matrixWorld);var P=new c.Box3;M.getBoundingBox(P),P.applyMatrix4(ss),C.geometry.boundingBox=P}})}return E})}if(v==="glb"){var b=jt(r,{key:"model.".concat(n.siblingIndex)});return ou(b,{upAxis:n.tileset.asset.gltfUpAxis,fetcher:t.fetcher}).then(function(E){return E.object.applyMatrix4(n.transform),E.object.updateWorldMatrix(!1,!0),E.object.matrixAutoUpdate=!1,us(E.object,n),E})}if(v==="at3d"){var b=n.extras.at3d?r:jt(r,{key:"model.".concat(n.siblingIndex)});return ru(b,{textureBaseUri:(a=n.extras.at3d)===null||a===void 0?void 0:a.textureBaseUri,textureArray:(o=n.extras.at3d)===null||o===void 0?void 0:o.textureArray,textureOptions:(s=n.extras.at3d)===null||s===void 0?void 0:s.textureOptions,fetcher:t.fetcher}).then(function(E){return E.object.applyMatrix4(n.transform),E.object.updateWorldMatrix(!1,!0),E.object.matrixAutoUpdate=!1,E})}if(v==="pbm"){var b=n.extras.pbm?r:jt(r,{key:"model.".concat(n.siblingIndex)});return $0(b,{textureBaseUri:(l=n.extras.pbm)===null||l===void 0?void 0:l.textureBaseUri,textureArray:(u=n.extras.pbm)===null||u===void 0?void 0:u.textureArray,textureOptions:(d=n.extras.pbm)===null||d===void 0?void 0:d.textureOptions,fetcher:t.fetcher}).then(function(E){return E.object.applyMatrix4(n.transform),E.object.updateWorldMatrix(!1,!0),E.object.matrixAutoUpdate=!1,E})}if(v==="dome"){var b=n.extras.dome?r:jt(r,{key:"model.".concat(n.siblingIndex)});return nu(b,{textureBaseUri:(f=n.extras.dome)===null||f===void 0?void 0:f.textureBaseUri,textureOptions:(A=n.extras.dome)===null||A===void 0?void 0:A.textureOptions,fetcher:t.fetcher}).then(function(E){return E.object.applyMatrix4(n.transform),E.object.updateWorldMatrix(!1,!0),E.object.matrixAutoUpdate=!1,E})}if(v==="domez"){var b=n.extras.domez?r:jt(r,{key:"model.".concat(n.siblingIndex)});return au(b,{textureBaseUri:(m=n.extras.domez)===null||m===void 0?void 0:m.textureBaseUri,textureOptions:(h=n.extras.domez)===null||h===void 0?void 0:h.textureOptions,fetcher:t.fetcher}).then(function(E){return E.object.applyMatrix4(n.transform),E.object.updateWorldMatrix(!1,!0),E.object.matrixAutoUpdate=!1,E})}return null}).then(function(a){if(!a)return Promise.resolve(null);a.object.traverse(function(s){if(s instanceof wr)s.material.uniforms.geometricError.value=n.geometricError;else if(s instanceof Vt)for(var l=0,u=s.material;l<u.length;l++){var d=u[l];d.uniforms.geometricError.value=n.geometricError}});var o={type:a.type,uri:a.uri,byteLength:a.byteLength,object:new N0(a.object,a.dispose)};return o.object.name=n.id,Promise.resolve().then(function(){return o.object.generateBvhTree()}).then(function(){return o}).catch(function(s){return Fa(o),Promise.reject(s)})}):Promise.resolve(null)}function Fa(n){n&&n.object.dispose()}var ls=new c.Vector3,Rf=new c.Matrix3,kf=new c.Matrix4,ut=6378137,su=298.257223563;function uu(n){for(var t=ut-ut/su,e=(ut*ut-t*t)/(ut*ut),r=Math.sqrt(n.x*n.x+n.y*n.y),i=1e-12,a=1e3,o=0,s=Math.atan2(n.z,r),l=0;o++<a;){var u=Math.sin(s),d=ut/Math.sqrt(1-e*u*u);l=r/Math.cos(s)-d;var f=Math.atan2(n.z/(d*(1-e)+l),r/(d+l));if(isNaN(f))break;var A=Math.abs(f-s);if(A<i)break;s=f}return n.set(s,Math.atan2(n.y,n.x),l)}function Ff(n){var t=n.x,e=n.y,r=n.z,i=ut-ut/su,a=(ut*ut-i*i)/(ut*ut),o=Math.sin(t),s=Math.cos(t),l=Math.sin(e),u=Math.cos(e),d=ut/Math.sqrt(1-a*o*o),f=(d+r)*s*u,A=(d+r)*s*l,m=(i*i/(ut*ut)*d+r)*o;return n.set(f,A,m)}function Lf(n,t){var e=uu(ls.copy(n)),r=e.x,i=e.y,a=e.z,o=Math.sin(r),s=Math.sin(i),l=Math.cos(r),u=Math.cos(i);t.fromArray([-s,-o*u,l*u,0,+u,-o*s,l*s,0,0,l,o,0,0,0,0,1]);var d=Rf.setFromMatrix4(t),f=ls.copy(n).applyMatrix3(d).multiplyScalar(-1);t.setPosition(f);var A=kf.fromArray([1,0,0,0,0,1,0,0,0,0,1,0,0,0,a,1]);return t.premultiply(A),t}var Jt={TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15},cs=function(){var n=new c.MeshBasicMaterial;return n.side=c.BackSide,n.color.setHex(16711935),n.colorWrite=!1,n.stencilWrite=!0,n.polygonOffset=!0,n.polygonOffsetFactor=2,n.polygonOffsetUnits=2,n.stencilRef=Jt.TILE_MASK,n.stencilFunc=c.AlwaysStencilFunc,n.stencilFuncMask=Jt.TILE_MASK,n.stencilZPass=c.ReplaceStencilOp,n.stencilWriteMask=Jt.TILE_MASK,n}(),ds=function(){var n=new c.MeshBasicMaterial;return n.visible=!1,n}(),Of=new c.BufferGeometry,Vf=new c.MeshBasicMaterial,$r=function(n){ue(t,n);function t(e,r,i){var a,o,s,l,u=n.call(this)||this;u.modelIndex=0,u.debug=!1,u.name=i.name,u.type=i.type,u.upAxis=i.upAxis,u.model=e,u.fetcher=i.fetcher,u.search=(a=i.search)!==null&&a!==void 0?a:"",u.groundHeight=i.groundHeight,u.coordinateTransform=i.coordinateTransform,u.unloadTileQueue=[],u.boundingBox=new c.Box3,u.idle=!1,u.minLevelOfDetail=t.DEFAULT_MIN_LEVEL_OF_DETAIL,u.maxLevelOfDetail=t.DEFAULT_MAX_LEVEL_OF_DETAIL,u.needsRefined=!0,u.refined=!1,u.refineProgress=[0,0],u.loaded=!1,u.disposed=!1,u.needsRender=!0,u.lastRenderHash="",u.matrixAutoUpdate=!1,u.cacheCameras=[],u.clearStencilObject=new c.Mesh(Of,Vf),u.clearStencilObject.frustumCulled=!1,u.clearStencilObject.onAfterRender=function(f){return f.clearStencil()};var d=P0(r,(o=i.resourcePath)!==null&&o!==void 0?o:"");return u.tileset=new mn((l=(s=u.model.work)===null||s===void 0?void 0:s.workCode)!==null&&l!==void 0?l:"",d,{referer:i.referer,contentLoader:function(f){return u.loadContent(f)},onTileLoad:function(){},onTileUnload:function(f){u.unloadTileQueue.push(f)},onTileError:function(f,A){i.onError&&i.onError(Object.assign(A,{error:A})),console.error("Tile error",f.id,A)}}),u.tileset.root.boundingVolume&&u.tileset.root.boundingVolume.getBoundingBox(u.boundingBox),u}return t.prototype.getRenderHash=function(){return Cn([this.tileset.id,this.tileset.skipLevelOfDetail,this.tileset.selectedTiles.map(function(e){return e.id}),this.debug])},Object.defineProperty(t.prototype,"maxMemoryUsage",{get:function(){return this.tileset.maxMemoryUsage},set:function(e){this.tileset.maxMemoryUsage=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxRequests",{get:function(){return this.tileset.maxRequests},set:function(e){this.tileset.maxRequests=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"skipLevelOfDetail",{get:function(){return this.tileset.skipLevelOfDetail},set:function(e){this.tileset.skipLevelOfDetail=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"loadSiblings",{get:function(){return this.tileset.loadSiblings},set:function(e){this.tileset.loadSiblings=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxScreenSpaceError",{get:function(){return this.tileset.maxScreenSpaceError},set:function(e){this.tileset.maxScreenSpaceError=e},enumerable:!1,configurable:!0}),t.prototype.localToEnu=function(e){return e.applyMatrix4(this.coordinateTransform.localToEnuMatrix)},t.prototype.enuToLocal=function(e){return e.applyMatrix4(this.coordinateTransform.enuToLocalMatrix)},t.prototype.localToEcef=function(e){return e.applyMatrix4(this.coordinateTransform.localToEcefMatrix)},t.prototype.ecefToLocal=function(e){return e.applyMatrix4(this.coordinateTransform.ecefToLocalMatrix)},t.prototype.localToLla=function(e){return uu(this.localToEcef(e))},t.prototype.llaToLocal=function(e){return this.ecefToLocal(Ff(e))},t.prototype.worldToEnu=function(e){return this.localToEnu(this.worldToLocal(e))},t.prototype.enuToWorld=function(e){return this.localToWorld(this.enuToLocal(e))},t.prototype.worldToEcef=function(e){return this.localToEcef(this.worldToLocal(e))},t.prototype.ecefToWorld=function(e){return this.localToWorld(this.ecefToLocal(e))},t.prototype.worldToLla=function(e){return this.localToLla(this.worldToLocal(e))},t.prototype.llaToWorld=function(e){return this.localToWorld(this.llaToLocal(e))},t.prototype.loadContent=function(e){var r=this;return Bf(e,{fetcher:this.fetcher,search:this.search}).then(function(i){return e.type==="TILESET"?!0:i&&e.type==="SCENEGRAPH"?r.disposed||!e.content?(Fa(i),!1):(e.content.data=i,e.content.byteLength=i.byteLength,e.content.data&&(e.content.data.object.traverse(function(a){(a instanceof wr||a instanceof Vt)&&(a.model=r.model)}),r.boundingBox.expandByObject(e.content.data.object)),!0):!1})},t.prototype.unloadContent=function(e){e.content&&(e.content.byteLength=0,Fa(e.content.data),e.content.data=void 0)},t.prototype.loadAllTilesets=function(){var e=this,r=function(i){var a=[];return e.tileset.root.traverse(function(o){var s;o.type==="TILESET"&&((s=o.content)===null||s===void 0?void 0:s.loadState)!=="READY"&&a.push(o)}),Promise.all(a.map(function(o){return e.loadContent(o).then(function(){return r()})})).then(function(){})};return r(this.tileset.root)},t.prototype.intersectRaycaster=function(e,r,i){var a=this;r===void 0&&(r=!0),i===void 0&&(i=[]);for(var o=[this.tileset.root],s=this.tileset.transform,l=this.tileset.transformIsIdentity,u,d=[];u=o.pop();){var f=void 0;if(u.boundingVolume){var A=l?u.boundingVolume:u.boundingVolume.clone().applyMatrix4(s);f=A.intersectRay(e.ray,e.far)}else f=!0;if(f){for(var m=0,h=u.children.length;m<h;m++)o.push(u.children[m]);u.selected&&u.content&&u.content.data&&u.content.data.object.visible&&u.content.data.object.intersectRaycaster(e,!1,d)}}return this.model.shownFloorIndex>=0&&(d=d.filter(function(v){return v.floor===a.model.shownFloorIndex})),r&&d.sort(function(v,y){return v.distance-y.distance}),d.map(function(v){v.model=a.model,v.viewLayer=a.viewLayer}),i.push.apply(i,d),i},t.prototype.cloneSkipBackfaceObject=function(e){var r;e instanceof c.Mesh?r=new c.Mesh(e.geometry,Array.isArray(e.material)?e.material.map(function(s){return s.transparent?ds:cs}):e.material&&e.material.transparent?ds:cs):e instanceof c.Group?r=new c.Group:r=new c.Object3D,r.copy(e,!1);for(var i=0,a=e.children;i<a.length;i++){var o=a[i];r.add(this.cloneSkipBackfaceObject(o))}return r},t.prototype.update=function(e,r){var i=this,a,o;this.tileset.transform.equals(this.matrixWorld)||this.tileset.transform.copy(this.matrixWorld),this.tileset.cache.reset(),this.tileset.frameNumber++;var s=this.visible&&(this.parent?this.parent.visible:!0),l={camera:{position:new c.Vector3().copy(r.position),direction:r.getDirection(new c.Vector3),up:new c.Vector3().copy(r.up),visible:r.visible,type:r.type,refine:r.refineModel},minLevelOfDetail:s?Math.min(this.minLevelOfDetail,this.maxLevelOfDetail):-1,maxLevelOfDetail:s?this.idle?0:this.maxLevelOfDetail:-1,height:r.resolution.height,pixelRatio:r.pixelRatio,frameNumber:this.tileset.frameNumber,sseDenominator:2*Math.tan(.5*r.fov/180*Math.PI),cullingVolume:new Qn().setFromCamera(r)},u=this.cacheCameras.map(function(S){return F(F({},l),{camera:{position:new c.Vector3().copy(S.position),direction:S.getWorldDirection(new c.Vector3),type:r.type,up:new c.Vector3().copy(S.up),visible:S.visible,refine:!0},cullingVolume:new Qn().setFromCamera(S)})});this.tileset.traverse(l,u),this.refined=!0,this.refineProgress[0]=0,this.refineProgress[1]=0;var d=1/0;this.tileset.needsRefinedTiles.forEach(function(S){if(S.levelOfContent<d&&(d=S.levelOfContent),i.refineProgress[1]++,S.content&&S.state.visible){var T=S.content.loadState;if(T==="UNLOADED"||T==="LOADING"){i.refined=!1;return}}i.refineProgress[0]++}),this.loaded===!1&&this.refineProgress[1]>0&&(this.loaded=!0,this.tileset.needsRefinedTiles.forEach(function(S){if(i.loaded!==!1&&S.content&&S.levelOfContent===d&&S.state.visible){var T=S.content.loadState;(T==="UNLOADED"||T==="LOADING")&&(i.loaded=!1)}}));for(var f;f=this.unloadTileQueue.pop();)this.unloadContent(f);this.remove.apply(this,this.children);var A=[],m=[],h=[];this.tileset.skipLevelOfDetail||this.tileset.selectedTiles.sort(function(S,T){return S.floor-T.floor});for(var v=function(S){y.debug&&S.boundingVolumeDebugObject&&m.push(S.boundingVolumeDebugObject);var T=(o=(a=S.content)===null||a===void 0?void 0:a.data)===null||o===void 0?void 0:o.object;if(!T)return"continue";if(y.tileset.skipLevelOfDetail&&y.tileset.hasMixedContent&&!S.state.finalResolution){var B=y.cloneSkipBackfaceObject(T);A.push(B)}var L=S.state.selectionDepth,k=Jt.TILE_MASK|L<<Jt.SKIP_LOD_BIT_SHIFT,O=c.GreaterEqualStencilFunc,D=Jt.SKIP_LOD_MASK,N=c.ReplaceStencilOp,X=Jt.TILE_MASK|Jt.SKIP_LOD_MASK;T.traverse(function(K){if(K instanceof c.Mesh)for(var Q=Array.isArray(K.material)?K.material:K.material?[K.material]:[],G=0,J=Q;G<J.length;G++){var H=J[G];i.tileset.hasMixedContent&&i.tileset.skipLevelOfDetail?(H.stencilWrite=!0,H.stencilRef=k,H.stencilFunc=O,H.stencilFuncMask=D,H.stencilZPass=N,H.stencilWriteMask=X):(H.stencilWrite=!1,H.stencilRef=Jt.TILE_MASK,H.stencilFunc=c.AlwaysStencilFunc,H.stencilFuncMask=Jt.TILE_MASK,H.stencilZPass=c.ReplaceStencilOp,H.stencilWriteMask=Jt.TILE_MASK)}}),h.push(T)},y=this,p=0,g=this.tileset.selectedTiles;p<g.length;p++){var x=g[p];v(x)}var b=[];this.skipLevelOfDetail&&b.push.apply(b,A),b.push.apply(b,h),this.skipLevelOfDetail&&b.push(this.clearStencilObject),this.debug&&b.push.apply(b,m);for(var w=this.modelIndex*1e4,E=function(S){var T=b[S],B=S+w;T.traverse(function(L){(L instanceof c.Mesh||L instanceof c.Line||L instanceof c.Points)&&(L.renderOrder=B)}),M.add(T)},M=this,C=0;C<b.length;C++)E(C);var P=this.getRenderHash();this.lastRenderHash!==P&&(this.needsRender=!0,this.lastRenderHash=P)},t.prototype.dispose=function(){this.disposed=!0,this.viewLayer=void 0,this.tileset.reset();for(var e;e=this.unloadTileQueue.pop();)this.unloadContent(e)},t.DEFAULT_MIN_LEVEL_OF_DETAIL=0,t.DEFAULT_MAX_LEVEL_OF_DETAIL=20,t.DEFAULT_MAX_MEMORY_USAGE=16,t.DEFAULT_MAX_SCREEN_SPACE_ERROR=mn.DEFAULT_MAX_SCREEN_SPACE_ERROR,t.DEFAULT_SKIP_LEVEL_OF_DETAIL=mn.DEFAULT_SKIP_LEVEL_OF_DETAIL,t.DEFAULT_LOAD_SIBLINGS=mn.DEFAULT_LOAD_SIBLINGS,t.DEFAULT_MAX_REQUESTS=mn.DEFAULT_MAX_REQUESTS,t}(c.Object3D);function Nf(n){return-((n-.25)*360+90)/180*Math.PI}function La(n,t){if(n===t)return!0;if(n&&t&&typeof n=="object"&&typeof t=="object"){if(n.constructor!==t.constructor)return!1;var e,r,i;if(Array.isArray(n)){if(e=n.length,e!=t.length)return!1;for(r=e;r--!==0;)if(!La(n[r],t[r]))return!1;return!0}if(n.constructor===RegExp)return n.source===t.source&&n.flags===t.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===t.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===t.toString();if(i=Object.keys(n),e=i.length,e!==Object.keys(t).length)return!1;for(r=e;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=e;r--!==0;){var a=i[r];if(!La(n[a],t[a]))return!1}return!0}return n!==n&&t!==t}function Gt(n){return typeof n=="number"}var fs=function(){return new Error("Invalid input.")},hs=function(){return new Error("Invalid certificate.")},ps=function(){return new Error("Invalid signature.")},Df=function(n){return new Error("date(".concat(n.toString(),") expired."))},zf=function(n){return new Error("host(".concat(JSON.stringify(n),") is not allowed."))};function Qf(n,t){for(var e={},r=0,i=Object.keys(n);r<i.length;r++){var a=i[r];t.indexOf(a)===-1&&(e[a]=n[a])}return e}function Ln(n,t){t===void 0&&(t=!1);var e=typeof n;if(e==="string")return JSON.stringify(n);if(n===!0)return"true";if(n===!1)return"false";if(n===null)return"null";if(n instanceof Array){for(var r="[",i=n.length-1,a=0;a<i;a++)r+=Ln(n[a],!1)+",";return i>-1&&(r+=Ln(n[a],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return Ln(n.toJSON(),t);for(var o=Object.keys(n).sort(),s=o.length,r="",a=0;a<s;){var l=o[a],u=Ln(n[l],!0);u!==void 0&&(a&&r!==""&&(r+=","),r+=JSON.stringify(l)+":"+u),a++}return"{"+r+"}"}switch(e){case"function":case"undefined":return t?void 0:null;case"number":return 0;default:return isFinite(n)?n:null}}function Uf(n){return String(Ln(n,!1))}function lu(n){var t,e,r;if(Array.isArray(n)){var i=void 0,a,o;if(n.length<=0)return fs();for(var s=function(w){var E=lu(n[w]);if(E instanceof Error)return{value:E};if(!i)i=E.issuer;else if(i!==E.issuer)return{value:hs()};a?E.expire.getTime()<a.getTime()&&(a=E.expire):a=E.expire,o?o=o.filter(function(M){return E.allowHosts.indexOf(M)!==-1}):o=E.allowHosts},l=0;l<n.length;l++){var u=s(l);if(typeof u=="object")return u.value}return gn({issuer:i,expire:a,allowHosts:o})}var d=JSON.parse(n),f=typeof location!="undefined"?location.hostname:"",A=Date.now();if(typeof d!="object")return fs();var m=new Date(typeof d.expire_at=="string"&&/^\d+$/.test(d.expire_at)?Number(d.expire_at):d.expire_at),h=Array.isArray(d.allow_hosts)?d.allow_hosts:[];if(f.length===0||nn(f)||sr.filter(function(w){return Hr(w,f)}).length>0){var v=String((t=d.certificate)!==null&&t!==void 0?t:"");if(v){var y=new Ke;return y.readCertPEM(v),gn({issuer:y.getSubjectString(),expire:m,allowHosts:h})}return gn({issuer:"none",expire:m,allowHosts:h})}var p=String((e=d.certificate)!==null&&e!==void 0?e:"");if(!p)return hs();var g=new Ke;g.readCertPEM(p);var x=String((r=d._signature)!==null&&r!==void 0?r:"");if(!x)return ps();var b=Uf(Qf(d,["_signature"]));return $l(b,x,g)===!1?ps():A<m.getTime()?h.filter(function(w){return Hr(w,f)}).length===0?zf(f):gn({issuer:g.getSubjectString(),expire:m,allowHosts:h}):Df(m)}var vs=new c.Matrix4,oo=new WeakMap,so=function(){function n(t,e){this.name="",this.workCode="",this.expire=new Date,this.allowHosts=[],this.initial={work:this},this.observers=[],this.issuer="none",this.raw={works:[""],options:""},this.transform=new c.Matrix4;{var r=this;this.options={get transform(){return r.transform},set transform(a){r.transform.copy(a)}}}var i=Hf(t,e,this);if(i instanceof Error)throw new Error("[PARSE FAILED]: "+i.message+`
|
|
929
929
|
Error work input:
|
|
930
|
-
`+JSON.stringify(t))}return n.prototype.toJSON=function(){return this.raw},n.parse=Hn,n}();function vs(n){return n==null?"null":Array.isArray(n)?"array":typeof n=="object"?"dict":"value"}function Oa(n,t){var e=vs(n),r=vs(t);if(r==="null")return n;if(r==="value")return t;if(r!==e)return JSON.parse(JSON.stringify(t));if(r==="array")for(var i=0;i<t.length;i++)n[i]=Oa(n[i],t[i]);else if(r==="dict")for(var a in t)n[a]=Oa(n[a],t[a]);return n}function so(n,t){return n.indexOf(t)===0}function uo(n,t,e,r){var i,a=t;if(r.jsonp===!0){a=t.replace(/([\?\#].*)?$/i,"");var o=ko("".concat(a)).slice(0,7);a="".concat(a,".").concat(o,".jsonp")}if(r.shortPath===!0){var s=a.replace(n,"").split("."),l=(i=s.shift())!==null&&i!==void 0?i:"",u=s.join(".");a=xt(n,ko(l))+(u?"."+u:"")}var d=a.replace(n,"");return r.baseURL&&(a=xt(r.baseURL,d)),r.traverseResource&&r.traverseResource({origin:t,absolute:a,relative:d,type:e}),a}function rt(n,t,e,r,i){var a=e;return Er(e)||(t&&(t=xt(t,String(r))),a=xt(t,a)),Er(a)||(a=xt(n,a)),so(a,n)||console.warn("".concat(a," is not start with base_url(").concat(n,").")),uo(n,a,"panorama",i)}function Rn(n,t,e){var r=t;return Er(r)||(r=xt(n,t)),so(r,n)||console.warn("".concat(r," is not start with base_url(").concat(n,").")),uo(n,r,"model",e)}function ai(n,t,e,r){var i=t;return Er(i)||(i=xt(e,i)),Er(i)||(i=xt(n,i)),so(i,n)||console.warn("".concat(i," is not start with base_url(").concat(n,").")),uo(n,i,"texture",r)}var As=function(n){for(var t=0;t<10;t++){var e=512*Math.pow(2,t);if(e>=n)return t}return null},Uf=function(n){n=n.slice().sort(function(o,s){return o.level-s.level});for(var t=[],e=0,r=n;e<r.length;e++){var i=r[e];if(t.length===0){t.push(i);continue}var a=t[t.length-1];if(i.level>a.level){t.push(i);continue}if(i.size>a.size){t[t.length-1]=i;continue}}return t};function qf(n,t,e){for(var r,i,a,o,s,l,u,d,f,A,m,h,v,y,p,g,x,b,w,E=JSON.stringify(t),M=[],C=0,P=[].concat(n);C<P.length;C++){var S=P[C];S instanceof oo?M.push.apply(M,S.raw.works):typeof S=="string"?M.push(S):M.push(JSON.stringify(S))}var T=uu(M);if(T instanceof Error)return T;Array.isArray(t.transform)?e.transform.fromArray(t.transform):t.transform&&e.transform.copy(t.transform),n=M.map(function($){return JSON.parse($)}).reduce(function($,te){return Oa($,te)}),Object.defineProperty(e,"raw",{configurable:!1,get:function(){return{works:M,options:E}}});{var B;if(t.workCode&&(typeof t.workCode=="string"?B=t.workCode:typeof t.workCode=="function"&&(B=t.workCode(n))),typeof B=="undefined"&&(B=String(n.resource_code||n.basic_code||n.vr_code||n.code||n.project_id||n.work_code||n.workCode)),typeof B=="undefined")return new Error("WorkCode never matched.");Object.defineProperty(e,"workCode",{configurable:!1,get:function(){return B}})}{var L=String(n.name);Object.defineProperty(e,"name",{configurable:!1,get:function(){return L}})}if(T instanceof Error)return T;Object.defineProperty(e,"issuer",{configurable:!1,get:function(){return T.issuer}}),Object.defineProperty(e,"expire",{configurable:!1,get:function(){return T.expire}}),Object.defineProperty(e,"allowHosts",{configurable:!1,get:function(){return T.allowHosts}});var k=(r=n.base_url)!==null&&r!==void 0?r:"";if(k&&k[k.length-1]!=="/"&&(k+="/"),T instanceof Error)return T;if(n.model){var O={work:e,layers:[]},D;n.model.file?D=Rn(k,n.model.file,t):n.model.file_url&&(D=Rn(k,n.model.file_url,t)),Object.defineProperty(O,"file",{configurable:!1,get:function(){return D}});var N;n.model.textureBase?N=ai(k,"",n.model.textureBase,t):n.model.material_base_url?N=ai(k,"",n.model.material_base_url,t):O.file&&(N=O.file.split("/").slice(0,-1).join("/").replace("/model/","/materials/")),Object.defineProperty(O,"textureBase",{configurable:!1,get:function(){return N}});var X;Array.isArray(n.model.textures)?(X=n.model.textures.map(function($){var te,U;return ai(k,$,(U=(te=n.model.textureBase)!==null&&te!==void 0?te:n.model.material_base_url)!==null&&U!==void 0?U:"",t)}),Object.freeze(X)):Array.isArray(n.model.material_textures)&&(X=n.model.material_textures.map(function($){var te,U;return ai(k,$,(U=(te=n.model.textureBase)!==null&&te!==void 0?te:n.model.material_base_url)!==null&&U!==void 0?U:"",t)}),Object.freeze(X)),Object.defineProperty(O,"textures",{configurable:!1,get:function(){return X}});var K=[];if(Array.isArray(n.model.tiles))for(var Q=0,G=n.model.tiles;Q<G.length;Q++){var J=G[Q];J&&(J.tileset||J.tileset_url)&&K.push(Object.freeze({type:(i=J.type)!==null&&i!==void 0?i:"mesh",name:(a=J.name)!==null&&a!==void 0?a:"",upAxis:(s=(o=J.upAxis)!==null&&o!==void 0?o:J.up_axis)!==null&&s!==void 0?s:"-Y",tileset:Rn(k,J.tileset||J.tileset_url,t)}))}else n.model.tiles&&(n.model.tiles.tileset||n.model.tiles.tileset_url)&&K.push(Object.freeze({type:(l=n.model.tiles.type)!==null&&l!==void 0?l:"mesh",name:(u=n.model.tiles.name)!==null&&u!==void 0?u:"lod",upAxis:(f=(d=n.model.tiles.upAxis)!==null&&d!==void 0?d:n.model.tiles.up_axis)!==null&&f!==void 0?f:"-Y",tileset:Rn(k,n.model.tiles.tileset||n.model.tiles.tileset_url,t)}));if(Array.isArray(n.model.layers))for(var H=0,j=n.model.layers;H<j.length;H++){var Z=j[H];Z&&(Z.tileset||Z.tileset_url)&&K.push(Object.freeze({type:(A=Z.type)!==null&&A!==void 0?A:"mesh",name:(m=Z.name)!==null&&m!==void 0?m:"",upAxis:(h=Z.upAxis)!==null&&h!==void 0?h:Z.up_axis,tileset:Rn(k,Z.tileset||Z.tileset_url,t)}))}Object.freeze(K),Object.defineProperty(O,"layers",{configurable:!1,get:function(){return K}}),Object.defineProperty(e,"model",{configurable:!1,get:function(){if(O.file||O.layers.length)return O}})}if(T instanceof Error)return T;var Y=new Set,pe=new Set;{var ee=[];if(n.observers&&Array.isArray(n.observers)){var oe=[];n.panorama&&(Array.isArray(n.panorama)?oe=n.panorama:Array.isArray(n.panorama.list)?oe=n.panorama.list:Array.isArray(n.panorama.info)&&(oe=n.panorama.info));for(var ie=function($){var te={},U=n.observers[$];if(!U)return"break";var Le=oe[$];if(!Le)return"break";U=Object.assign({},U,Le,{active:U.active!==!1&&Le.active!==!1}),Object.defineProperty(te,"work",{configurable:!1,get:function(){return e}}),Object.defineProperty(te,"index",{configurable:!1,get:function(){return $}}),pe.add($),Object.defineProperty(te,"panoIndex",{configurable:!1,get:function(){return $}});var Pe=Ue({workCode:e.workCode,panoIndex:$});Y.add(Pe),Object.defineProperty(te,"panoId",{configurable:!1,get:function(){return Pe}});var Ie=Object.freeze({workCode:e.workCode,panoIndex:$});Object.defineProperty(te,"pano",{configurable:!1,get:function(){return Ie}});var Qe=U.active!==!1;Object.defineProperty(te,"active",{configurable:!1,get:function(){return Qe}});var be=U.loadable===!0;Object.defineProperty(te,"loadable",{configurable:!1,get:function(){return be}});var ye=U.derived_id;Object.defineProperty(te,"derivedId",{configurable:!1,get:function(){return ye}});var ge=U.derived_id_str;Object.defineProperty(te,"derivedIdStr",{configurable:!1,get:function(){return ge}});var me=(b=(g=(y=(v=n.panorama)===null||v===void 0?void 0:v.pano_high_cube_base_url)!==null&&y!==void 0?y:(p=n.panorama)===null||p===void 0?void 0:p.pano_cube_base_url)!==null&&g!==void 0?g:(x=n.panorama)===null||x===void 0?void 0:x.base_url)!==null&&b!==void 0?b:"",Ae={up:rt(k,me,U.images?U.images.up:U.up,$,t),down:rt(k,me,U.images?U.images.down:U.down,$,t),right:rt(k,me,U.images?U.images.right:U.right,$,t),left:rt(k,me,U.images?U.images.left:U.left,$,t),front:rt(k,me,U.images?U.images.front:U.front,$,t),back:rt(k,me,U.images?U.images.back:U.back,$,t)};if(U.size_list)Ae.sizeList=U.size_list.slice();else{var Ne=Kn(Ae.up);if(Ne&&(Ae.sizeList=[Ne],U.tiles))for(var ze=U.tiles.slice().sort(function(Ge,nt){return Ge-nt}).map(function(Ge){return 512*Math.pow(2,Ge)}),je=0,cr=ze;je<cr.length;je++){var Fe=cr[je];Fe>Ne&&Ae.sizeList.push(Fe)}}var Ye=U.images?U.images.luminance:U.luminance;Ye&&(Ae.luminance=Object.freeze({up:rt(k,me,Ye.up,$,t),down:rt(k,me,Ye.down,$,t),right:rt(k,me,Ye.right,$,t),left:rt(k,me,Ye.left,$,t),front:rt(k,me,Ye.front,$,t),back:rt(k,me,Ye.back,$,t)}));var ot=void 0;if(U.images)ot=U.images.tiles;else if(Array.isArray(U.size_list)){var Yt=U.size_list.slice().sort(function(Ge,nt){return Ge-nt});if(Yt[0]){var on=As(Yt[0]);if(on)for(var $t=on-1;$t>=0;$t--)Yt.unshift(512*Math.pow(2,$t));ot=Yt}}else Array.isArray(U.tiles)&&(ot=U.tiles.slice(),typeof ot[0]=="number"&&(ot=ot.sort(function(Ge,nt){return Ge-nt}).map(function(Ge){return 512*Math.pow(2,Ge)})));if(ot){for(var St=[],er=0,Mr=ot;er<Mr.length;er++){var Fe=Mr[er];if(typeof Fe=="number"){var Dt=As(Fe);if(typeof Dt!="number")continue;var tr=Kn(Ae.front);if(!tr)continue;if(Fe>tr){var zt=Rt(Ae.up,Fe),lt=Rt(Ae.down,Fe),Oe=Rt(Ae.right,Fe),dr=Rt(Ae.left,Fe),At=Rt(Ae.front,Fe),fr=Rt(Ae.back,Fe);St.push(Object.freeze({level:Dt,size:Fe,scale:1,up:zt,down:lt,right:Oe,left:dr,front:At,back:fr}))}else{var zt=Ae.up,lt=Ae.down,Oe=Ae.right,dr=Ae.left,At=Ae.front,fr=Ae.back;St.push(Object.freeze({level:Dt,size:tr,scale:Fe/tr,up:zt,down:lt,right:Oe,left:dr,front:At,back:fr}))}}else{var Dt=Fe.level;if(typeof Dt!="number")continue;var Ne=Fe.size;if(typeof Ne!="number")continue;var zt=rt(k,me,Fe.up,$,t),lt=rt(k,me,Fe.down,$,t),Oe=rt(k,me,Fe.right,$,t),dr=rt(k,me,Fe.left,$,t),At=rt(k,me,Fe.front,$,t),fr=rt(k,me,Fe.back,$,t);St.push(Object.freeze({level:Dt,size:Ne,scale:(w=Fe.scale)!==null&&w!==void 0?w:1,up:zt,down:lt,right:Oe,left:dr,front:At,back:fr}))}}St=Uf(St),Object.freeze(St),Object.defineProperty(Ae,"tiles",{configurable:!1,get:function(){return St}})}Object.freeze(Ae),Object.defineProperty(te,"images",{configurable:!1,get:function(){return Ae}});var hr=new c.Vector3;if(U.position instanceof c.Vector3)hr.copy(U.position);else if(Array.isArray(U.position))hr.fromArray(U.position);else return"break";Object.freeze(hr),Object.defineProperty(te,"position",{configurable:!1,get:function(){return hr}});var Qt=new c.Vector3;if(U.standingPosition instanceof c.Vector3)Qt.copy(U.standingPosition);else if(Array.isArray(U.standingPosition))Qt.fromArray(U.standingPosition);else if(U.standing_position instanceof c.Vector3)Qt.copy(U.standing_position);else if(Array.isArray(U.standing_position))Qt.fromArray(U.standing_position);else return"break";Object.freeze(Qt),Object.defineProperty(te,"standingPosition",{configurable:!1,get:function(){return Qt}});var Et=new c.Quaternion;if(U.quaternion instanceof c.Quaternion)Et.copy(U.quaternion);else if(Array.isArray(U.quaternion))Et.fromArray(U.quaternion);else if(U.quaternion){var pr=U.quaternion,Sr=pr.x,sn=pr.y,jr=pr.z,Jr=pr.w;Et.set(Sr,sn,jr,Jr)}else return"break";Object.freeze(Et),Object.defineProperty(te,"quaternion",{configurable:!1,get:function(){return Et}});var Ut=0;Gt(U.floorIndex)?Ut=U.floorIndex:Gt(U.floor_index)?Ut=U.floor_index:Gt(U.floor)&&(Ut=U.floor),Object.defineProperty(te,"floorIndex",{configurable:!1,get:function(){return Ut}});var $e;U.video&&($e={},typeof U.video.source=="string"&&($e.source=U.video.source),U.video.matrix instanceof c.Matrix4?$e.matrix=U.video.matrix.clone():Array.isArray(U.video.matrix)&&($e.matrix=new c.Matrix4().fromArray(U.video.matrix)),U.video.size instanceof c.Vector2?$e.size=U.video.size.clone():Array.isArray(U.video.size)&&($e.size=new c.Vector2().fromArray(U.video.size)),$e.source&&$e.matrix&&$e.size&&(te.video=$e)),Object.freeze($e),Object.defineProperty(te,"video",{configurable:!1,get:function(){return $e}}),Array.isArray(U.accessibleNodes)?(te.accessibleNodes=U.accessibleNodes.slice(),te.accessibleIds=U.accessibleNodes.map(function(Ge){return Ue({workCode:e.workCode,panoIndex:Ge})})):Array.isArray(U.accessible_nodes)&&(te.accessibleNodes=U.accessible_nodes.slice(),te.accessibleIds=U.accessible_nodes.map(function(Ge){return Ue({workCode:e.workCode,panoIndex:Ge})})),Array.isArray(U.visibleNodes)?(te.visibleNodes=U.visibleNodes.slice(),te.visibleIds=U.visibleNodes.map(function(Ge){return Ue({workCode:e.workCode,panoIndex:Ge})})):Array.isArray(U.visible_nodes)&&(te.visibleNodes=U.visible_nodes.slice(),te.visibleIds=U.visible_nodes.map(function(Ge){return Ue({workCode:e.workCode,panoIndex:Ge})})),ee[$]=te},ce=0;ce<n.observers.length;ce++){var ne=ie(ce);if(ne==="break")break}}for(var ae=function($){if($.accessibleIds){var Le=$.accessibleIds.filter(function(me){return Y.has(me)});Object.freeze(Le),Object.defineProperty($,"accessibleIds",{configurable:!1,get:function(){return Le}})}else{for(var te=[],U=0;U<ee.length;U++)ee[U]!==$&&(Math.abs(ee[U].position.y-$.position.y)>3||ee[U].position.distanceTo($.position)>10||te.push(ee[U].panoId));Object.freeze(te),Object.defineProperty($,"accessibleIds",{configurable:!1,get:function(){return te}})}if($.accessibleNodes){var Ie=$.accessibleNodes.filter(function(me){return pe.has(me)});Object.freeze(Ie),Object.defineProperty($,"accessibleNodes",{configurable:!1,get:function(){return Ie}})}else{for(var Pe=[],U=0;U<ee.length;U++)ee[U]!==$&&(Math.abs(ee[U].position.y-$.position.y)>3||ee[U].position.distanceTo($.position)>10||Pe.push(ee[U].panoIndex));Object.freeze(Pe),Object.defineProperty($,"accessibleNodes",{configurable:!1,get:function(){return Pe}})}if($.visibleIds){var be=$.visibleIds.filter(function(me){return Y.has(me)});Object.freeze(be),Object.defineProperty($,"visibleIds",{configurable:!1,get:function(){return be}})}else{var Qe=$.accessibleIds.slice();Object.freeze(Qe),Object.defineProperty($,"visibleIds",{configurable:!1,get:function(){return Qe}})}if($.visibleNodes){var ge=$.visibleNodes.filter(function(me){return pe.has(me)});Object.freeze(ge),Object.defineProperty($,"visibleNodes",{configurable:!1,get:function(){return ge}})}else{var ye=$.accessibleNodes.slice();Object.freeze(ye),Object.defineProperty($,"visibleNodes",{configurable:!1,get:function(){return ye}})}},de=0,ve=ee;de<ve.length;de++){var xe=ve[de];ae(xe)}Object.freeze(ee),Object.defineProperty(e,"observers",{configurable:!1,get:function(){return ee}})}if(T instanceof Error)return T;if(n.initial){if((n.initial.mode==="Panorama"&&e.observers.length===0||n.initial.mode==="Floorplan"||n.initial.mode==="Topview"||n.initial.mode==="Model"||n.initial.mode==="Mapview"||n.initial.mode==="DepthPanorama")&&(e.initial.mode=n.initial.mode),Gt(n.initial.latitude)&&(e.initial.latitude=n.initial.latitude),Gt(n.initial.longitude)?e.initial.longitude=n.initial.longitude:Gt(n.initial.heading)&&(e.initial.longitude=Vf(n.initial.heading)),Gt(n.initial.fov)&&(e.initial.fov=n.initial.fov),e.observers.length>0){var Ce=void 0;Gt(n.initial.panoIndex)?Ce=n.initial.panoIndex:Gt(n.initial.pano_index)?Ce=n.initial.pano_index:Gt(n.initial.pano)&&(Ce=n.initial.pano),typeof Ce=="number"&&(Ce=he(Ce,0,e.observers.length-1),e.initial.panoIndex=Ce)}if(Gt(n.initial.distance)&&(e.initial.distance=n.initial.distance),Array.isArray(n.initial.offset)){var Be=[0,0,0].map(function($,te){var U=Number(n.initial.offset[te]);return isNaN(U)||!isFinite(U)?0:U});e.initial.offset=new c.Vector3().fromArray(Be)}!e.initial.mode&&typeof e.initial.panoIndex=="number"&&(e.initial.mode="Panorama")}return T instanceof Error?T:(ao.set(e,{works:M,options:E}),e)}function Hn(n,t){typeof n=="string"&&n.trim()[0]==="{"&&(n=JSON.parse(n));var e=ao.get(n);if(e){if(t&&!La(JSON.parse(e.options),t))throw new Error("[PARSE FAILED]: work is parsed with different options.");return n}else try{return new oo(n,t!=null?t:{})}catch(r){throw new Error("[PARSE FAILED]: "+r.message+`
|
|
930
|
+
`+JSON.stringify(t))}return n.prototype.toJSON=function(){return this.raw},n.parse=Hn,n}();function As(n){return n==null?"null":Array.isArray(n)?"array":typeof n=="object"?"dict":"value"}function Oa(n,t){var e=As(n),r=As(t);if(r==="null")return n;if(r==="value")return t;if(r!==e)return JSON.parse(JSON.stringify(t));if(r==="array")for(var i=0;i<t.length;i++)n[i]=Oa(n[i],t[i]);else if(r==="dict")for(var a in t)n[a]=Oa(n[a],t[a]);return n}function uo(n,t){return n.indexOf(t)===0}function lo(n,t,e,r){var i,a=t;if(r.jsonp===!0){a=t.replace(/([\?\#].*)?$/i,"");var o=Fo("".concat(a)).slice(0,7);a="".concat(a,".").concat(o,".jsonp")}if(r.shortPath===!0){var s=a.replace(n,"").split("."),l=(i=s.shift())!==null&&i!==void 0?i:"",u=s.join(".");a=xt(n,Fo(l))+(u?"."+u:"")}var d=a.replace(n,"");return r.baseURL&&(a=xt(r.baseURL,d)),r.traverseResource&&r.traverseResource({origin:t,absolute:a,relative:d,type:e}),a}function rt(n,t,e,r,i){var a=e;return Er(e)||(t&&(t=xt(t,String(r))),a=xt(t,a)),Er(a)||(a=xt(n,a)),uo(a,n)||console.warn("".concat(a," is not start with base_url(").concat(n,").")),lo(n,a,"panorama",i)}function Rn(n,t,e){var r=t;return Er(r)||(r=xt(n,t)),uo(r,n)||console.warn("".concat(r," is not start with base_url(").concat(n,").")),lo(n,r,"model",e)}function ai(n,t,e,r){var i=t;return Er(i)||(i=xt(e,i)),Er(i)||(i=xt(n,i)),uo(i,n)||console.warn("".concat(i," is not start with base_url(").concat(n,").")),lo(n,i,"texture",r)}var ms=function(n){for(var t=0;t<10;t++){var e=512*Math.pow(2,t);if(e>=n)return t}return null},qf=function(n){n=n.slice().sort(function(o,s){return o.level-s.level});for(var t=[],e=0,r=n;e<r.length;e++){var i=r[e];if(t.length===0){t.push(i);continue}var a=t[t.length-1];if(i.level>a.level){t.push(i);continue}if(i.size>a.size){t[t.length-1]=i;continue}}return t};function Hf(n,t,e){for(var r,i,a,o,s,l,u,d,f,A,m,h,v,y,p,g,x,b,w,E=JSON.stringify(t),M=[],C=0,P=[].concat(n);C<P.length;C++){var S=P[C];S instanceof so?M.push.apply(M,S.raw.works):typeof S=="string"?M.push(S):M.push(JSON.stringify(S))}var T=lu(M);if(T instanceof Error)return T;Array.isArray(t.transform)?e.transform.fromArray(t.transform):t.transform&&e.transform.copy(t.transform),n=M.map(function($){return JSON.parse($)}).reduce(function($,te){return Oa($,te)}),Object.defineProperty(e,"raw",{configurable:!1,get:function(){return{works:M,options:E}}});{var B;if(t.workCode&&(typeof t.workCode=="string"?B=t.workCode:typeof t.workCode=="function"&&(B=t.workCode(n))),typeof B=="undefined"&&(B=String(n.resource_code||n.basic_code||n.vr_code||n.code||n.project_id||n.work_code||n.workCode)),typeof B=="undefined")return new Error("WorkCode never matched.");Object.defineProperty(e,"workCode",{configurable:!1,get:function(){return B}})}{var L=String(n.name);Object.defineProperty(e,"name",{configurable:!1,get:function(){return L}})}if(T instanceof Error)return T;Object.defineProperty(e,"issuer",{configurable:!1,get:function(){return T.issuer}}),Object.defineProperty(e,"expire",{configurable:!1,get:function(){return T.expire}}),Object.defineProperty(e,"allowHosts",{configurable:!1,get:function(){return T.allowHosts}});var k=(r=n.base_url)!==null&&r!==void 0?r:"";if(k&&k[k.length-1]!=="/"&&(k+="/"),T instanceof Error)return T;if(n.model){var O={work:e,layers:[]},D;n.model.file?D=Rn(k,n.model.file,t):n.model.file_url&&(D=Rn(k,n.model.file_url,t)),Object.defineProperty(O,"file",{configurable:!1,get:function(){return D}});var N;n.model.textureBase?N=ai(k,"",n.model.textureBase,t):n.model.material_base_url?N=ai(k,"",n.model.material_base_url,t):O.file&&(N=O.file.split("/").slice(0,-1).join("/").replace("/model/","/materials/")),Object.defineProperty(O,"textureBase",{configurable:!1,get:function(){return N}});var X;Array.isArray(n.model.textures)?(X=n.model.textures.map(function($){var te,U;return ai(k,$,(U=(te=n.model.textureBase)!==null&&te!==void 0?te:n.model.material_base_url)!==null&&U!==void 0?U:"",t)}),Object.freeze(X)):Array.isArray(n.model.material_textures)&&(X=n.model.material_textures.map(function($){var te,U;return ai(k,$,(U=(te=n.model.textureBase)!==null&&te!==void 0?te:n.model.material_base_url)!==null&&U!==void 0?U:"",t)}),Object.freeze(X)),Object.defineProperty(O,"textures",{configurable:!1,get:function(){return X}});var K=[];if(Array.isArray(n.model.tiles))for(var Q=0,G=n.model.tiles;Q<G.length;Q++){var J=G[Q];J&&(J.tileset||J.tileset_url)&&K.push(Object.freeze({type:(i=J.type)!==null&&i!==void 0?i:"mesh",name:(a=J.name)!==null&&a!==void 0?a:"",upAxis:(s=(o=J.upAxis)!==null&&o!==void 0?o:J.up_axis)!==null&&s!==void 0?s:"-Y",tileset:Rn(k,J.tileset||J.tileset_url,t)}))}else n.model.tiles&&(n.model.tiles.tileset||n.model.tiles.tileset_url)&&K.push(Object.freeze({type:(l=n.model.tiles.type)!==null&&l!==void 0?l:"mesh",name:(u=n.model.tiles.name)!==null&&u!==void 0?u:"lod",upAxis:(f=(d=n.model.tiles.upAxis)!==null&&d!==void 0?d:n.model.tiles.up_axis)!==null&&f!==void 0?f:"-Y",tileset:Rn(k,n.model.tiles.tileset||n.model.tiles.tileset_url,t)}));if(Array.isArray(n.model.layers))for(var H=0,j=n.model.layers;H<j.length;H++){var Z=j[H];Z&&(Z.tileset||Z.tileset_url)&&K.push(Object.freeze({type:(A=Z.type)!==null&&A!==void 0?A:"mesh",name:(m=Z.name)!==null&&m!==void 0?m:"",upAxis:(h=Z.upAxis)!==null&&h!==void 0?h:Z.up_axis,tileset:Rn(k,Z.tileset||Z.tileset_url,t)}))}Object.freeze(K),Object.defineProperty(O,"layers",{configurable:!1,get:function(){return K}}),Object.defineProperty(e,"model",{configurable:!1,get:function(){if(O.file||O.layers.length)return O}})}if(T instanceof Error)return T;var Y=new Set,pe=new Set;{var ee=[];if(n.observers&&Array.isArray(n.observers)){var oe=[];n.panorama&&(Array.isArray(n.panorama)?oe=n.panorama:Array.isArray(n.panorama.list)?oe=n.panorama.list:Array.isArray(n.panorama.info)&&(oe=n.panorama.info));for(var ie=function($){var te={},U=n.observers[$];if(!U)return"break";var Le=oe[$];if(!Le)return"break";U=Object.assign({},U,Le,{active:U.active!==!1&&Le.active!==!1}),Object.defineProperty(te,"work",{configurable:!1,get:function(){return e}}),Object.defineProperty(te,"index",{configurable:!1,get:function(){return $}}),pe.add($),Object.defineProperty(te,"panoIndex",{configurable:!1,get:function(){return $}});var Pe=Ue({workCode:e.workCode,panoIndex:$});Y.add(Pe),Object.defineProperty(te,"panoId",{configurable:!1,get:function(){return Pe}});var Ie=Object.freeze({workCode:e.workCode,panoIndex:$});Object.defineProperty(te,"pano",{configurable:!1,get:function(){return Ie}});var Qe=U.active!==!1;Object.defineProperty(te,"active",{configurable:!1,get:function(){return Qe}});var be=U.loadable===!0;Object.defineProperty(te,"loadable",{configurable:!1,get:function(){return be}});var ye=U.derived_id;Object.defineProperty(te,"derivedId",{configurable:!1,get:function(){return ye}});var ge=U.derived_id_str;Object.defineProperty(te,"derivedIdStr",{configurable:!1,get:function(){return ge}});var me=(b=(g=(y=(v=n.panorama)===null||v===void 0?void 0:v.pano_high_cube_base_url)!==null&&y!==void 0?y:(p=n.panorama)===null||p===void 0?void 0:p.pano_cube_base_url)!==null&&g!==void 0?g:(x=n.panorama)===null||x===void 0?void 0:x.base_url)!==null&&b!==void 0?b:"",Ae={up:rt(k,me,U.images?U.images.up:U.up,$,t),down:rt(k,me,U.images?U.images.down:U.down,$,t),right:rt(k,me,U.images?U.images.right:U.right,$,t),left:rt(k,me,U.images?U.images.left:U.left,$,t),front:rt(k,me,U.images?U.images.front:U.front,$,t),back:rt(k,me,U.images?U.images.back:U.back,$,t)};if(U.size_list)Ae.sizeList=U.size_list.slice();else{var Ne=Kn(Ae.up);if(Ne&&(Ae.sizeList=[Ne],U.tiles))for(var ze=U.tiles.slice().sort(function(Ge,nt){return Ge-nt}).map(function(Ge){return 512*Math.pow(2,Ge)}),je=0,cr=ze;je<cr.length;je++){var Fe=cr[je];Fe>Ne&&Ae.sizeList.push(Fe)}}var Ye=U.images?U.images.luminance:U.luminance;Ye&&(Ae.luminance=Object.freeze({up:rt(k,me,Ye.up,$,t),down:rt(k,me,Ye.down,$,t),right:rt(k,me,Ye.right,$,t),left:rt(k,me,Ye.left,$,t),front:rt(k,me,Ye.front,$,t),back:rt(k,me,Ye.back,$,t)}));var ot=void 0;if(U.images)ot=U.images.tiles;else if(Array.isArray(U.size_list)){var Yt=U.size_list.slice().sort(function(Ge,nt){return Ge-nt});if(Yt[0]){var on=ms(Yt[0]);if(on)for(var $t=on-1;$t>=0;$t--)Yt.unshift(512*Math.pow(2,$t));ot=Yt}}else Array.isArray(U.tiles)&&(ot=U.tiles.slice(),typeof ot[0]=="number"&&(ot=ot.sort(function(Ge,nt){return Ge-nt}).map(function(Ge){return 512*Math.pow(2,Ge)})));if(ot){for(var St=[],er=0,Mr=ot;er<Mr.length;er++){var Fe=Mr[er];if(typeof Fe=="number"){var Dt=ms(Fe);if(typeof Dt!="number")continue;var tr=Kn(Ae.front);if(!tr)continue;if(Fe>tr){var zt=Rt(Ae.up,Fe),lt=Rt(Ae.down,Fe),Oe=Rt(Ae.right,Fe),dr=Rt(Ae.left,Fe),At=Rt(Ae.front,Fe),fr=Rt(Ae.back,Fe);St.push(Object.freeze({level:Dt,size:Fe,scale:1,up:zt,down:lt,right:Oe,left:dr,front:At,back:fr}))}else{var zt=Ae.up,lt=Ae.down,Oe=Ae.right,dr=Ae.left,At=Ae.front,fr=Ae.back;St.push(Object.freeze({level:Dt,size:tr,scale:Fe/tr,up:zt,down:lt,right:Oe,left:dr,front:At,back:fr}))}}else{var Dt=Fe.level;if(typeof Dt!="number")continue;var Ne=Fe.size;if(typeof Ne!="number")continue;var zt=rt(k,me,Fe.up,$,t),lt=rt(k,me,Fe.down,$,t),Oe=rt(k,me,Fe.right,$,t),dr=rt(k,me,Fe.left,$,t),At=rt(k,me,Fe.front,$,t),fr=rt(k,me,Fe.back,$,t);St.push(Object.freeze({level:Dt,size:Ne,scale:(w=Fe.scale)!==null&&w!==void 0?w:1,up:zt,down:lt,right:Oe,left:dr,front:At,back:fr}))}}St=qf(St),Object.freeze(St),Object.defineProperty(Ae,"tiles",{configurable:!1,get:function(){return St}})}Object.freeze(Ae),Object.defineProperty(te,"images",{configurable:!1,get:function(){return Ae}});var hr=new c.Vector3;if(U.position instanceof c.Vector3)hr.copy(U.position);else if(Array.isArray(U.position))hr.fromArray(U.position);else return"break";Object.freeze(hr),Object.defineProperty(te,"position",{configurable:!1,get:function(){return hr}});var Qt=new c.Vector3;if(U.standingPosition instanceof c.Vector3)Qt.copy(U.standingPosition);else if(Array.isArray(U.standingPosition))Qt.fromArray(U.standingPosition);else if(U.standing_position instanceof c.Vector3)Qt.copy(U.standing_position);else if(Array.isArray(U.standing_position))Qt.fromArray(U.standing_position);else return"break";Object.freeze(Qt),Object.defineProperty(te,"standingPosition",{configurable:!1,get:function(){return Qt}});var Et=new c.Quaternion;if(U.quaternion instanceof c.Quaternion)Et.copy(U.quaternion);else if(Array.isArray(U.quaternion))Et.fromArray(U.quaternion);else if(U.quaternion){var pr=U.quaternion,Sr=pr.x,sn=pr.y,jr=pr.z,Jr=pr.w;Et.set(Sr,sn,jr,Jr)}else return"break";Object.freeze(Et),Object.defineProperty(te,"quaternion",{configurable:!1,get:function(){return Et}});var Ut=0;Gt(U.floorIndex)?Ut=U.floorIndex:Gt(U.floor_index)?Ut=U.floor_index:Gt(U.floor)&&(Ut=U.floor),Object.defineProperty(te,"floorIndex",{configurable:!1,get:function(){return Ut}});var $e;U.video&&($e={},typeof U.video.source=="string"&&($e.source=U.video.source),U.video.matrix instanceof c.Matrix4?$e.matrix=U.video.matrix.clone():Array.isArray(U.video.matrix)&&($e.matrix=new c.Matrix4().fromArray(U.video.matrix)),U.video.size instanceof c.Vector2?$e.size=U.video.size.clone():Array.isArray(U.video.size)&&($e.size=new c.Vector2().fromArray(U.video.size)),$e.source&&$e.matrix&&$e.size&&(te.video=$e)),Object.freeze($e),Object.defineProperty(te,"video",{configurable:!1,get:function(){return $e}}),Array.isArray(U.accessibleNodes)?(te.accessibleNodes=U.accessibleNodes.slice(),te.accessibleIds=U.accessibleNodes.map(function(Ge){return Ue({workCode:e.workCode,panoIndex:Ge})})):Array.isArray(U.accessible_nodes)&&(te.accessibleNodes=U.accessible_nodes.slice(),te.accessibleIds=U.accessible_nodes.map(function(Ge){return Ue({workCode:e.workCode,panoIndex:Ge})})),Array.isArray(U.visibleNodes)?(te.visibleNodes=U.visibleNodes.slice(),te.visibleIds=U.visibleNodes.map(function(Ge){return Ue({workCode:e.workCode,panoIndex:Ge})})):Array.isArray(U.visible_nodes)&&(te.visibleNodes=U.visible_nodes.slice(),te.visibleIds=U.visible_nodes.map(function(Ge){return Ue({workCode:e.workCode,panoIndex:Ge})})),ee[$]=te},ce=0;ce<n.observers.length;ce++){var ne=ie(ce);if(ne==="break")break}}for(var ae=function($){if($.accessibleIds){var Le=$.accessibleIds.filter(function(me){return Y.has(me)});Object.freeze(Le),Object.defineProperty($,"accessibleIds",{configurable:!1,get:function(){return Le}})}else{for(var te=[],U=0;U<ee.length;U++)ee[U]!==$&&(Math.abs(ee[U].position.y-$.position.y)>3||ee[U].position.distanceTo($.position)>10||te.push(ee[U].panoId));Object.freeze(te),Object.defineProperty($,"accessibleIds",{configurable:!1,get:function(){return te}})}if($.accessibleNodes){var Ie=$.accessibleNodes.filter(function(me){return pe.has(me)});Object.freeze(Ie),Object.defineProperty($,"accessibleNodes",{configurable:!1,get:function(){return Ie}})}else{for(var Pe=[],U=0;U<ee.length;U++)ee[U]!==$&&(Math.abs(ee[U].position.y-$.position.y)>3||ee[U].position.distanceTo($.position)>10||Pe.push(ee[U].panoIndex));Object.freeze(Pe),Object.defineProperty($,"accessibleNodes",{configurable:!1,get:function(){return Pe}})}if($.visibleIds){var be=$.visibleIds.filter(function(me){return Y.has(me)});Object.freeze(be),Object.defineProperty($,"visibleIds",{configurable:!1,get:function(){return be}})}else{var Qe=$.accessibleIds.slice();Object.freeze(Qe),Object.defineProperty($,"visibleIds",{configurable:!1,get:function(){return Qe}})}if($.visibleNodes){var ge=$.visibleNodes.filter(function(me){return pe.has(me)});Object.freeze(ge),Object.defineProperty($,"visibleNodes",{configurable:!1,get:function(){return ge}})}else{var ye=$.accessibleNodes.slice();Object.freeze(ye),Object.defineProperty($,"visibleNodes",{configurable:!1,get:function(){return ye}})}},de=0,ve=ee;de<ve.length;de++){var xe=ve[de];ae(xe)}Object.freeze(ee),Object.defineProperty(e,"observers",{configurable:!1,get:function(){return ee}})}if(T instanceof Error)return T;if(n.initial){if((n.initial.mode==="Panorama"&&e.observers.length===0||n.initial.mode==="Floorplan"||n.initial.mode==="Topview"||n.initial.mode==="Model"||n.initial.mode==="Mapview"||n.initial.mode==="DepthPanorama")&&(e.initial.mode=n.initial.mode),Gt(n.initial.latitude)&&(e.initial.latitude=n.initial.latitude),Gt(n.initial.longitude)?e.initial.longitude=n.initial.longitude:Gt(n.initial.heading)&&(e.initial.longitude=Nf(n.initial.heading)),Gt(n.initial.fov)&&(e.initial.fov=n.initial.fov),e.observers.length>0){var Ce=void 0;Gt(n.initial.panoIndex)?Ce=n.initial.panoIndex:Gt(n.initial.pano_index)?Ce=n.initial.pano_index:Gt(n.initial.pano)&&(Ce=n.initial.pano),typeof Ce=="number"&&(Ce=he(Ce,0,e.observers.length-1),e.initial.panoIndex=Ce)}if(Gt(n.initial.distance)&&(e.initial.distance=n.initial.distance),Array.isArray(n.initial.offset)){var Be=[0,0,0].map(function($,te){var U=Number(n.initial.offset[te]);return isNaN(U)||!isFinite(U)?0:U});e.initial.offset=new c.Vector3().fromArray(Be)}!e.initial.mode&&typeof e.initial.panoIndex=="number"&&(e.initial.mode="Panorama")}return T instanceof Error?T:(oo.set(e,{works:M,options:E}),e)}function Hn(n,t){typeof n=="string"&&n.trim()[0]==="{"&&(n=JSON.parse(n));var e=oo.get(n);if(e){if(t&&!La(JSON.parse(e.options),t))throw new Error("[PARSE FAILED]: work is parsed with different options.");return n}else try{return new so(n,t!=null?t:{})}catch(r){throw new Error("[PARSE FAILED]: "+r.message+`
|
|
931
931
|
Error work input:
|
|
932
|
-
`+JSON.stringify(n))}}function Va(n){for(var t={},e=[],r={},i=0,a=n;i<a.length;i++){var o=a[i],s=t[o.workCode];s||(s=t[o.workCode]=new c.Matrix4().copy(o.options.transform));for(var l=0,u=o.observers;l<u.length;l++){var d=u[l],f={isResolved:!0,active:d.active,accessibleIds:d.accessibleIds,visibleIds:d.visibleIds,accessibleNodes:d.accessibleNodes,visibleNodes:d.visibleNodes,floorIndex:d.floorIndex,images:d.images,index:d.index,panoIndex:d.panoIndex,loadable:d.loadable,panoId:d.panoId,pano:d.pano,work:d.work,derivedId:d.derivedId,video:d.video,position:new c.Vector3().copy(d.position).applyMatrix4(s),standingPosition:new c.Vector3().copy(d.standingPosition).applyMatrix4(s),quaternion:new c.Quaternion().setFromRotationMatrix(ps.makeRotationFromQuaternion(d.quaternion).premultiply(s))};Object.freeze(f),e.push(f),r[f.panoId]=f}}Object.freeze(e);for(var A=n.slice(),m={},h=0,v=A;h<v.length;h++){var o=v[h];m[o.workCode]=o}return Object.freeze(Object.assign(A,{get initial(){return A.length>0?A[0].initial:{work:{}}},get resolvedObservers(){return e},getWork:function(y){return m[y]},getResolvedObserver:function(y){var p,g;return f0(y)?r[y]:typeof y=="number"?r[Ue({workCode:(g=(p=n[0])===null||p===void 0?void 0:p.workCode)!==null&&g!==void 0?g:"",panoIndex:y})]:r[Ue(y)]},update:function(){for(var y={},p=0,g=A;p<g.length;p++){var x=g[p],b=x.options.transform,w=t[x.workCode];w?w.equals(b)||(w.copy(b),y[x.workCode]=!0):(t[x.workCode]=new c.Matrix4().copy(b),y[x.workCode]=!0)}for(var E=0,M=e;E<M.length;E++){var C=M[E];if(y[C.work.workCode]===!0){var P=C.work.observers[C.index],S=C.work.options.transform;C.position.copy(P.position).applyMatrix4(S),C.standingPosition.copy(P.standingPosition).applyMatrix4(S),C.quaternion.setFromRotationMatrix(ps.makeRotationFromQuaternion(P.quaternion).premultiply(S))}}}}))}var lu=new Map;function it(n){var t=lu.get(n);if(t)return t;throw new Error("fetcher never registered.")}function Hf(n,t){return lu.set(n,t)}var ms={computeTangents:function(n){var t=n.index,e=n.attributes;if(t===null||e.position===void 0||e.normal===void 0||e.uv===void 0){console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");return}var r=t.array,i=e.position.array,a=e.normal.array,o=e.uv.array,s=i.length/3;e.tangent===void 0&&n.setAttribute("tangent",new c.BufferAttribute(new Float32Array(4*s),4));for(var l=e.tangent.array,u=[],d=[],f=0;f<s;f++)u[f]=new c.Vector3,d[f]=new c.Vector3;var A=new c.Vector3,m=new c.Vector3,h=new c.Vector3,v=new c.Vector2,y=new c.Vector2,p=new c.Vector2,g=new c.Vector3,x=new c.Vector3;function b(Q,G,J){A.fromArray(i,Q*3),m.fromArray(i,G*3),h.fromArray(i,J*3),v.fromArray(o,Q*2),y.fromArray(o,G*2),p.fromArray(o,J*2);var H=m.x-A.x,j=h.x-A.x,Z=m.y-A.y,Y=h.y-A.y,pe=m.z-A.z,ee=h.z-A.z,oe=y.x-v.x,ie=p.x-v.x,ce=y.y-v.y,ne=p.y-v.y,ae=1/(oe*ne-ie*ce);g.set((ne*H-ce*j)*ae,(ne*Z-ce*Y)*ae,(ne*pe-ce*ee)*ae),x.set((oe*j-ie*H)*ae,(oe*Y-ie*Z)*ae,(oe*ee-ie*pe)*ae),u[Q].add(g),u[G].add(g),u[J].add(g),d[Q].add(x),d[G].add(x),d[J].add(x)}var w=n.groups;w.length===0&&(w=[{start:0,count:r.length}]);for(var f=0,E=w.length;f<E;++f)for(var M=w[f],C=M.start,P=M.count,S=C,T=C+P;S<T;S+=3)b(r[S+0],r[S+1],r[S+2]);var B=new c.Vector3,L=new c.Vector3,k=new c.Vector3,O=new c.Vector3,D,N,X;function K(Q){k.fromArray(a,Q*3),O.copy(k),N=u[Q],B.copy(N),B.sub(k.multiplyScalar(k.dot(N))).normalize(),L.crossVectors(O,N),X=L.dot(d[Q]),D=X<0?-1:1,l[Q*4]=B.x,l[Q*4+1]=B.y,l[Q*4+2]=B.z,l[Q*4+3]=D}for(var f=0,E=w.length;f<E;++f)for(var M=w[f],C=M.start,P=M.count,S=C,T=C+P;S<T;S+=3)K(r[S+0]),K(r[S+1]),K(r[S+2])},mergeBufferGeometries:function(n,t){for(var e=n[0].index!==null,r=new Set(Object.keys(n[0].attributes)),i=new Set(Object.keys(n[0].morphAttributes)),a={},o={},s=new c.BufferGeometry,l=0,u=0;u<n.length;++u){var d=n[u];if(e!==(d.index!==null))return null;for(var f in d.attributes){if(!r.has(f))return null;a[f]===void 0&&(a[f]=[]),a[f].push(d.attributes[f])}for(var f in d.morphAttributes){if(!i.has(f))return null;o[f]===void 0&&(o[f]=[]),o[f].push(d.morphAttributes[f])}if(s.userData.mergedUserData=s.userData.mergedUserData||[],s.userData.mergedUserData.push(d.userData),t){var A;if(e)A=d.index.count;else if(d.attributes.position!==void 0)A=d.attributes.position.count;else return null;s.addGroup(l,A,u),l+=A}}if(e){for(var m=0,h=[],u=0;u<n.length;++u){for(var v=n[u].index,y=0;y<v.count;++y)h.push(v.getX(y)+m);m+=n[u].attributes.position.count}s.setIndex(h)}for(var f in a){var p=this.mergeBufferAttributes(a[f]);if(!p)return null;s.setAttribute(f,p)}for(var f in o){var g=o[f][0].length;if(g===0)break;s.morphAttributes=s.morphAttributes||{},s.morphAttributes[f]=[];for(var u=0;u<g;++u){for(var x=[],y=0;y<o[f].length;++y)x.push(o[f][y][u]);var b=this.mergeBufferAttributes(x);if(!b)return null;s.morphAttributes[f].push(b)}}return s},mergeBufferAttributes:function(n){for(var t,e,r,i=0,a=0;a<n.length;++a){var o=n[a];if(o.isInterleavedBufferAttribute||(t===void 0&&(t=o.array.constructor),t!==o.array.constructor)||(e===void 0&&(e=o.itemSize),e!==o.itemSize)||(r===void 0&&(r=o.normalized),r!==o.normalized))return null;i+=o.array.length}for(var s=new t(i),l=0,a=0;a<n.length;++a)s.set(n[a].array,l),l+=n[a].array.length;return new c.BufferAttribute(s,e,r)},interleaveAttributes:function(n){for(var t,e=0,r=0,i=0,a=n.length;i<a;++i){var o=n[i];if(t===void 0&&(t=o.array.constructor),t!==o.array.constructor)return console.warn("AttributeBuffers of different types cannot be interleaved"),null;e+=o.array.length,r+=o.itemSize}for(var s=new c.InterleavedBuffer(new t(e),r),l=0,u=[],d=["getX","getY","getZ","getW"],f=["setX","setY","setZ","setW"],A=0,a=n.length;A<a;A++){var o=n[A],m=o.itemSize,h=o.count,v=new c.InterleavedBufferAttribute(s,m,l,o.normalized);u.push(v),l+=m;for(var y=0;y<h;y++)for(var p=0;p<m;p++)v[f[p]](y,o[d[p]](y))}return u},estimateBytesUsed:function(n){var t=0;for(var e in n.attributes){var r=n.getAttribute(e);t+=r.count*r.itemSize*r.array.BYTES_PER_ELEMENT}var i=n.getIndex();return t+=i?i.count*i.itemSize*i.array.BYTES_PER_ELEMENT:0,t},mergeVertices:function(n,t){t===void 0&&(t=1e-4),t=Math.max(t,Number.EPSILON);for(var e={},r=n.getIndex(),i=n.getAttribute("position"),a=r?r.count:i.count,o=0,s=Object.keys(n.attributes),l={},u={},d=[],f=["getX","getY","getZ","getW"],A=0,m=s.length;A<m;A++){var h=s[A];l[h]=[];var v=n.morphAttributes[h];v&&(u[h]=new Array(v.length).fill().map(function(){return[]}))}for(var y=Math.log10(1/t),p=Math.pow(10,y),A=0;A<a;A++){for(var g=r?r.getX(A):A,x="",b=0,m=s.length;b<m;b++)for(var h=s[b],w=n.getAttribute(h),E=w.itemSize,M=0;M<E;M++)x+="".concat(~~(w[f[M]](g)*p),",");if(x in e)d.push(e[x]);else{for(var b=0,m=s.length;b<m;b++)for(var h=s[b],w=n.getAttribute(h),v=n.morphAttributes[h],E=w.itemSize,C=l[h],P=u[h],M=0;M<E;M++){var S=f[M];if(C.push(w[S](g)),v)for(var T=0,B=v.length;T<B;T++)P[T].push(v[T][S](g))}e[x]=o,d.push(o),o++}}for(var L=n.clone(),A=0,m=s.length;A<m;A++){var h=s[A],k=n.getAttribute(h),O=new k.array.constructor(l[h]),w=new c.BufferAttribute(O,k.itemSize,k.normalized);if(L.setAttribute(h,w),h in u)for(var b=0;b<u[h].length;b++){var D=n.morphAttributes[h][b],O=new D.array.constructor(u[h][b]),N=new c.BufferAttribute(O,D.itemSize,D.normalized);L.morphAttributes[h][b]=N}}return L.setIndex(d),L}};function Na(n){switch(n){case"Floorplan":return!0;case"Mapview":return!0;default:return!1}}function Jn(n){switch(n){case"Panorama":return!0;case"VRPanorama":return!0;case"XRPanorama":return!0;case"Model":return!0;default:return!1}}var Wt=new c.Vector3,sa=new c.Sphere,ua=new c.Matrix4,gs=new c.Matrix4,ys=new c.Box3,hi=new c.Matrix4().fromArray([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),pi=new c.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]),cu=new c.Box3(new c.Vector3(-.5,-.5,-.5),new c.Vector3(.5,.5,.5));function bs(n,t,e){switch(n){case"Z":break;case"Y":e.copy(pi);break;case"-Y":e.copy(hi);break;case"WGS84":case"GCJ02":case"BD09":Ff(t,e);break;default:e.identity();break}return e}function Gf(n){var t=/([0-9a-z\.\_\-]+)([\?\#].*)?$/i.exec(n);if(t){var e=String(t[1]).trim().split(".").slice(1).reverse()[0];if(e)return e}return""}var vi=function(){function n(t,e){this.scene=t,this.error=e,t.viewLayer=this}return Object.defineProperty(n.prototype,"name",{get:function(){return this.scene.name},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"type",{get:function(){return this.scene.type},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"upAxis",{get:function(){return this.scene.upAxis},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"groundHeight",{get:function(){return this.scene.groundHeight},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"model",{get:function(){return this.scene.model},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"coordinates",{get:function(){Wt.setScalar(0);var t=this.scene.localToLla(Wt),e=t.x,r=t.y;return[e,r].map(function(i){return(i/Math.PI*180).toFixed(6)}).join(",")},enumerable:!1,configurable:!0}),n.prototype.getTransformMatrix4=function(t){return t===void 0&&(t=new c.Matrix4),t.copy(this.scene.coordinateTransform.ecefToLocalMatrix),this.scene&&t.premultiply(this.scene.matrixWorld),t},n.prototype.coordinatesToWorldPoint=function(t){var e=new c.Vector3(t.latitude,t.longitude,t.altitude);return this.scene.llaToWorld(e)},n.prototype.worldPointToCoordinates=function(t){return Wt.copy(t),this.scene.worldToLla(Wt),{latitude:Wt.x,longitude:Wt.y,altitude:Wt.z}},n}(),Da=function(n){ue(t,n);function t(e){e===void 0&&(e={});var r,i,a,o=n.call(this)||this;return o.name="",o.onError=(r=e.onError)!==null&&r!==void 0?r:z,o.onShownFloorChange=(i=e.onShownFloorChange)!==null&&i!==void 0?i:z,o.onLoad=(a=e.onLoad)!==null&&a!==void 0?a:z,o.work=null,o.viewLayers=[],o.bounding=new c.Box3(new c.Vector3,new c.Vector3),o.floorLength=0,o.textureOptions={},o.refined=!1,o.refineProgress=[0,0],o.loaded=!1,o.matrixAutoUpdate=!1,o.needsRender=!0,o.autoRefine=!0,o.materialVersion=0,o.materialParameters=F({},Ee),o.cacheCameras=[],o.disposed=!1,o}return Object.defineProperty(t.prototype,"empty",{get:function(){return this.viewLayers.length===0},enumerable:!1,configurable:!0}),t.prototype.getMaterial=function(){return F({},this.materialParameters)},t.prototype.setMaterial=function(e){var r=this.materialParameters.shownFloorIndex,i=h0(this.materialParameters,e);if(i){var a=this.materialParameters.shownFloorIndex;r!==a&&this.onShownFloorChange(a),this.materialVersion++,this.needsRender=!0}},Object.defineProperty(t.prototype,"brightness",{get:function(){return this.materialParameters.brightness},set:function(e){this.setMaterial({brightness:typeof e=="number"?e:1})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shownFloorIndex",{get:function(){return this.materialParameters.shownFloorIndex},set:function(e){this.setMaterial({shownFloorIndex:e})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shownFloor",{get:function(){return this.shownFloorIndex===-1?null:this.shownFloorIndex},set:function(e){this.shownFloorIndex=e===null?-1:e},enumerable:!1,configurable:!0}),t.prototype.show=function(e){this.shownFloor=e!=null?e:null},Object.defineProperty(t.prototype,"clippers",{get:function(){return this.materialParameters.clippers},set:function(e){this.setMaterial({clippers:e})},enumerable:!1,configurable:!0}),t.prototype.getEdgesBySphere=function(e,r){r===void 0&&(r=30/180*Math.PI);for(var i=Math.cos(r),a=[],o=0,s=this.children;o<s.length;o++){var l=s[o];l instanceof $r&&l.tileset.selectedTiles.forEach(function(u){var d,f,A;if(!(u.boundingVolume&&u.boundingVolume.distanceToPoint(e.center)>e.radius)){var m=(f=(d=u.content)===null||d===void 0?void 0:d.data)===null||f===void 0?void 0:f.object;if(m&&m.visible){var h=[];if(m.traverseVisible(function(J){if(J instanceof c.Mesh){var H=fi.get(J);if(H){ua.copy(J.matrixWorld),gs.getInverse(ua),sa.copy(e).applyMatrix4(gs);var j=H.trianglesInSphere(sa.center,sa.radius),Z=new c.BufferGeometry;Z.setAttribute("position",new c.BufferAttribute(j,3)),Z.applyMatrix4(J.matrixWorld),Z=ms.mergeVertices(Z,.01),h.push(Z)}}}),h.length===0)return;for(var v=["a","b","c"],y=ms.mergeBufferGeometries(h,!1),p=y.getAttribute("position").array,g=((A=y.getIndex())===null||A===void 0?void 0:A.array)||[],x=[],b=[],w=0,E=p.length;w<E;w+=3){var M=new c.Vector3(p[w],p[w+1],p[w+2]);x.push(M)}for(var w=0,E=g.length;w<E;w+=3){var C=g[w],P=g[w+1],S=g[w+2],T=new c.Vector3().crossVectors(x[P].clone().sub(x[C]),x[S].clone().sub(x[C])).normalize();b.push({a:C,b:P,c:S,normal:T})}for(var B={},w=0,E=b.length;w<E;w++)for(var L=b[w],k=0;k<3;k++){var O=L[v[k]],D=L[v[(k+1)%3]],N=[Math.min(O,D),Math.max(O,D)],X=N[0]+"-"+N[1];B[X]===void 0?B[X]={index1:N[0],index2:N[1],face1:w}:B[X].face2=w}for(var X in B){var K=B[X];if(K.face2===void 0||b[K.face1].normal.dot(b[K.face2].normal)<=i){var Q=x[K.index1],G=x[K.index2];a.push(new c.Line3(Q,G))}}x.length=0,b.length=0}}})}return a},t.prototype.intersectRaycaster=function(e,r,i){r===void 0&&(r=null),i===void 0&&(i=!0);for(var a=[],o=0,s=this.children.length;o<s;o++){var l=this.children[o];l.visible&&l instanceof $r&&l.intersectRaycaster(e,!1,a)}return r!=null&&(a=a.filter(function(u){return u.floor===r})),this.getMaterial().pointBack==="HIDDEN"&&(a=a.filter(function(u){return!(u.object instanceof wr&&u.face&&u.face.normal.angleTo(e.ray.direction)<Math.PI/2)})),i&&a.sort(function(u,d){return u.distance-d.distance}),a},t.prototype.load=function(e,r){var i,a=this,o,s,l,u;if(r===void 0&&(r={}),this.work=e,this.name=this.work.workCode,!e.model)return Promise.resolve();for(var d=e.model,f=0,A=0,m=e.observers;A<m.length;A++){var h=m[A];f=Math.max(f,h.floorIndex)}this.floorLength=f+1;for(var v=!1,y=[],p=function(K){var Q=K.tileset,G=K.upAxis,J=K.name,H=K.type;H==="mesh"&&(v=!0);var j=Q.split("#"),Z=j[0],Y=j[1],pe=(o=(Y||Z).split("?")[1])!==null&&o!==void 0?o:"",ee=it(e).ajax(Q,{responseType:"text"}).then(function(oe){var ie,ce,ne,ae=JSON.parse(oe.body),de=ae.root,ve=ae.rootMeta,xe=ve===void 0?{}:ve;xe.upAxis&&xe.upAxis!==G&&(G=xe.upAxis),"lodVersion"in ae&&(G="-Y","floorInfo"in ae&&(ae.properties=ae.properties||{},ae.properties.floorInfo=ae.floorInfo.map(function(ge){return{ground:-ge.ground,height:ge.height}}),delete ae.floorInfo),ae.asset.tilesetVersion=String(ae.lodVersion),delete ae.lodVersion);var Ce=de.boundingVolume?di(de.boundingVolume):void 0;Ce&&de.transform&&Ce.applyMatrix4(ua.fromArray(de.transform));var Be=null,$=new c.Matrix4,te=new c.Matrix4;xe.coordinate?(Be=xe.coordinate.ground_height,$.fromArray(xe.coordinate.pose_ecef_to_enu),te.fromArray(xe.coordinate.pose_enu_to_ecef)):(Ce?Ce.getCenter(Wt):Wt.setScalar(0),bs(G,Wt,$),te.getInverse($));var U=new c.Matrix4().copy(hi),Le=new c.Matrix4().copy(pi),Pe=new c.Matrix4().premultiply($).premultiply(U),Ie=new c.Matrix4().getInverse(Pe);ae.root={refine:(ie=de.refine)!==null&&ie!==void 0?ie:"REPLACE",geometricError:de.geometricError,transform:Pe.toArray(),boundingVolume:Ce?Ce.toJson():void 0,viewerRequestVolume:!((ce=r["3d-tiles"])===null||ce===void 0)&&ce.viewerRequestVolume?(ne=r["3d-tiles"])===null||ne===void 0?void 0:ne.viewerRequestVolume.toJson():void 0,children:[de]};var Qe=Q?Q.slice(0,Q.lastIndexOf("/")+1):"",be=new $r(a,ae,{name:J,type:H,upAxis:G,referer:Q,resourcePath:Qe,search:pe,fetcher:it(e),groundHeight:Be,coordinateTransform:{localToEnuMatrix:Le,enuToLocalMatrix:U,enuToEcefMatrix:te,ecefToEnuMatrix:$,localToEcefMatrix:Ie,ecefToLocalMatrix:Pe}});if(be.matrix.copy(e.transform),be.matrix.decompose(be.position,be.quaternion,be.scale),be.matrixWorldNeedsUpdate=!0,r["3d-tiles"]){var ye=r["3d-tiles"];typeof ye.debug!="undefined"&&(be.debug=ye.debug),typeof ye.minLevelOfDetail!="undefined"&&(be.minLevelOfDetail=ye.minLevelOfDetail),typeof ye.maxLevelOfDetail!="undefined"&&(be.maxLevelOfDetail=ye.maxLevelOfDetail),typeof ye.skipLevelOfDetail!="undefined"&&(be.skipLevelOfDetail=ye.skipLevelOfDetail),typeof ye.loadSiblings!="undefined"&&(be.loadSiblings=ye.loadSiblings),typeof ye.maxMemoryUsage!="undefined"&&(be.maxMemoryUsage=ye.maxMemoryUsage),typeof ye.maxRequests!="undefined"&&(be.maxRequests=ye.maxRequests),typeof ye.maxScreenSpaceError!="undefined"&&(be.maxScreenSpaceError=ye.maxScreenSpaceError)}return new vi(be,null)});y.push(ee.catch(function(oe){a.onError(oe);var ie=new c.Matrix4,ce=new c.Matrix4,ne=new c.Matrix4().copy(hi),ae=new c.Matrix4().copy(pi),de=new c.Matrix4().premultiply(ie).premultiply(ne),ve=new c.Matrix4().getInverse(de),xe=Q?Q.slice(0,Q.lastIndexOf("/")+1):"",Ce={asset:{version:"0.0"},geometricError:0,root:{geometricError:0}},Be=new $r(a,Ce,{name:J,type:H,upAxis:G,referer:Q,resourcePath:xe,search:pe,fetcher:it(e),groundHeight:null,coordinateTransform:{localToEnuMatrix:ae,enuToLocalMatrix:ne,enuToEcefMatrix:ce,ecefToEnuMatrix:ie,localToEcefMatrix:ve,ecefToLocalMatrix:de},onError:a.onError});return new vi(Be,oe)}))},g=0,x=d.layers;g<x.length;g++){var b=x[g];p(b)}if(!v&&d.file){var w=d.file,E=d.textureBase,M=d.textures,C=Gf(w)||"at3d",P=C==="at3d"||C==="pbm"?"Z":"Y",S=new c.Matrix4,T=new c.Matrix4,B=new c.Matrix4().copy(hi),L=new c.Matrix4().copy(pi);bs(P,Wt.setScalar(0),S),T.getInverse(S);var k=new c.Matrix4().premultiply(S).premultiply(B),O=new c.Matrix4().getInverse(k),D={asset:{gltfUpAxis:"Z",version:"0.0"},geometricError:0,root:{refine:"REPLACE",geometricError:0,transform:k.toArray(),viewerRequestVolume:!((s=r["3d-tiles"])===null||s===void 0)&&s.viewerRequestVolume?(l=r["3d-tiles"])===null||l===void 0?void 0:l.viewerRequestVolume.toJson():void 0,content:{uri:w},extras:(i={},i[C]={textureBaseUri:E,textureArray:M,textureOptions:(u=r.textureOptions)!==null&&u!==void 0?u:{}},i)}},N=new $r(this,D,{name:"fallback",type:"mesh",upAxis:P,referer:w,resourcePath:"",fetcher:it(e),groundHeight:null,coordinateTransform:{localToEnuMatrix:L,enuToLocalMatrix:B,enuToEcefMatrix:T,ecefToEnuMatrix:S,localToEcefMatrix:O,ecefToLocalMatrix:k},onError:this.onError});N.matrix.copy(e.transform),N.matrix.decompose(N.position,N.quaternion,N.scale),N.matrixWorldNeedsUpdate=!0;var X=new vi(N,null);y.push(Promise.resolve(X))}return Promise.all(y).then(function(K){for(var Q,G=[],J=[],H=[],j=0,Z=K;j<Z.length;j++){var Y=Z[j];if(a.viewLayers.push(Y),a.disposed){Y.scene.dispose();continue}switch(a.add(Y.scene),Y.scene.visible=!1,Y.scene.type){case"mesh":G.push(Y.scene);break;case"point_cloud":J.push(Y.scene);break;default:H.push(Y.scene);break}}G.length?G[0].visible=!0:J.length?J[0].visible=!0:H.length&&(H[0].visible=!0);var pe=(Q=r["3d-tiles"])===null||Q===void 0?void 0:Q.showLayers;if(typeof pe=="boolean")for(var ee=0,oe=K;ee<oe.length;ee++){var Y=oe[ee];Y.scene&&(Y.scene.visible=pe)}else if(Array.isArray(pe))for(var ie=0,ce=K;ie<ce.length;ie++){var Y=ce[ie];Y.scene&&(Y.scene.visible=pe.indexOf(Y.scene.name)!==-1)}})},t.prototype.update=function(e,r,i){if(this.children.length){var a=this.loaded;this.refined=this.work!==null,this.refineProgress[0]=0,this.refineProgress[1]=0,this.loaded=this.work!==null,this.bounding.makeEmpty();for(var o=0,s=this.viewLayers;o<s.length;o++){var l=s[o],u=l.scene;u&&(this.work&&(u.idle=this.materialParameters.modelAlpha===0||!u.loaded,u.cacheCameras=this.cacheCameras,this.autoRefine===!1?u.needsRefined=!1:Jn(i)?u.needsRefined=this.materialParameters.modelAlpha===0||this.materialParameters.modelAlpha===1:u.needsRefined=!0,this.work.transform.equals(u.matrix)||(u.matrix.copy(this.work.transform),u.matrix.decompose(u.position,u.quaternion,u.scale),u.matrixWorldNeedsUpdate=!0)),u.update(e,r),u.boundingBox.isEmpty()||(ys.copy(u.boundingBox).applyMatrix4(u.matrix),this.bounding.union(ys)),u.needsRender===!0&&(u.needsRender=!1,this.needsRender=!0),u.refined===!1&&(this.refined=!1),this.refineProgress[0]+=u.refineProgress[0],this.refineProgress[1]+=u.refineProgress[1],u.loaded===!1&&(this.loaded=!1))}this.bounding.isEmpty()&&this.bounding.copy(cu),a===!1&&this.loaded===!0&&this.onLoad()}else this.work&&!this.work.model?(this.refined=!0,this.refineProgress[0]=0,this.refineProgress[1]=0,this.loaded=!0):(this.refined=!1,this.refineProgress[0]=0,this.refineProgress[1]=0,this.loaded=!1),this.bounding.set(new c.Vector3,new c.Vector3)},t.prototype.dispose=function(){this.disposed=!0;for(var e;e=this.children[0];)e instanceof $r&&e.dispose(),this.remove(e)},t}(c.Object3D);function xs(){var n=new c.Box3,t=bf(Ee,["clippers","shownFloorIndex","brightness"]),e=Object.assign([],{bounding:n,needsRender:!1,refined:!1,refineProgress:[0,0],loaded:!1,materialVersion:0,cacheCameras:[],autoUpdate:!0,intersectRaycaster:function(r,i,a){a===void 0&&(a=!0);var o;if(e.length===1)o=e[0].intersectRaycaster(r,i,a);else if(e.length===0)o=[];else{o=[];for(var s=0,l=e;s<l.length;s++){var u=l[s];if(u.visible){var d=u.intersectRaycaster(r,i,!1);d.length&&o.push.apply(o,d)}}a&&o.sort(function(f,A){return f.distance-A.distance})}return o},setMaterial:function(r){var i=h0(t,r);i&&(e.materialVersion++,e.needsRender=!0)},getMaterial:function(){return F({},t)},resetBrightness:function(){for(var r=0,i=e;r<i.length;r++){var a=i[r];a.setMaterial({brightness:1})}},update:function(r,i,a){if(e.autoUpdate!==!1){e.refined=e.length>0,e.loaded=e.length>0,e.refineProgress[0]=0,e.refineProgress[1]=0,n.makeEmpty();for(var o=0,s=e.cacheCameras;o<s.length;o++){var l=s[o];l.updateMatrixWorld(!0),l.updateProjectionMatrix()}for(var u=0,d=0,f=e;d<f.length;d++){for(var A=f[d],m=0,h=A.viewLayers;m<h.length;m++){var v=h[m];v.scene.modelIndex=u++}A.setMaterial(t),A.cacheCameras=e.cacheCameras,A.update(r,i,a),A.needsRender===!0&&(e.needsRender=!0,A.needsRender=!1),A.refined===!1&&(e.refined=!1),e.refineProgress[0]+=A.refineProgress[0],e.refineProgress[1]+=A.refineProgress[1],A.loaded===!1&&(e.loaded=!1),n.union(A.bounding)}n.isEmpty()&&n.copy(cu)}}});return e}function Ai(n,t,e){return n+(t-n)*e}function Kf(n,t,e,r){var i=(t*e+2*n)/Math.pow(e,3),a=-(2*t*e+3*n)/Math.pow(e,2),o=t,s=n;return i*Math.pow(r,3)+a*Math.pow(r,2)+o*r+s}function jf(n,t,e,r){var i=(t*e+2*n)/Math.pow(e,3),a=-(2*t*e+3*n)/Math.pow(e,2),o=t;return 3*i*Math.pow(r,2)+2*a*r+o}function Jf(n,t,e,r){var i=r[1]-r[0];return n=Ii(n,r),t=Ii(t,r),t-n>i/2?Ai(n+i,t,e):n-t>i/2?Ai(n-i,t,e):Ai(n,t,e)}function Ii(n,t){var e=t[1]-t[0];return n<t[0]?Ii(n+e,t):n>=t[1]?Ii(n-e,t):n}function Wf(n,t,e,r){return r?Jf(n,t,e,r):Ai(n,t,e)}var Se=function(){function n(t){this.config={},this.progress=1,this.ended=!0,this.value={},this.startTime=Me(),this.startVelocity=0,this.duration=0,this.keyframes=[];for(var e in t){var r=t[e];typeof r=="number"?(this.value[e]=r,this.config[e]={circle:!1}):(this.value[e]=r.value,this.config[e]={circle:r.circle})}this.keyframes=[{progress:0,value:F({},this.value)},{progress:1,value:F({},this.value)}]}return n.prototype.getProgress=function(t){var e=t-this.startTime;return e<0?0:e>=this.duration?1:1-Kf(1,this.startVelocity,this.duration,e)},n.prototype.getValue=function(t){for(var e=1;e<this.keyframes.length;e++)if(this.keyframes[e].progress>t){var r=this.keyframes[e-1],i=this.keyframes[e],a={};for(var o in this.config){var s=(t-r.progress)/(i.progress-r.progress);a[o]=Wf(r.value[o],i.value[o],s,this.config[o].circle)}return a}return F({},this.keyframes[this.keyframes.length-1].value)},n.prototype.getProgressVelocity=function(t){var e=t-this.startTime;return e>=this.duration?0:jf(1,this.startVelocity,this.duration,e)},n.prototype.update=function(t){return this.ended?!0:(this.progress=Math.min(1,Math.max(0,this.progress,this.getProgress(t))),this.value=this.getValue(this.progress),this.ended=this.progress>=1,this.ended&&this.callbacks&&(this.callbacks[0](),this.callbacks=void 0),this.ended)},n.prototype.getKeyFrameSegment=function(t){for(var e=this.getProgress(t),r=1;r<this.keyframes.length;r++)if(this.keyframes[r].progress>e)return[this.keyframes[r-1],this.keyframes[r]];return[this.keyframes[this.keyframes.length-2],this.keyframes[this.keyframes.length-1]]},n.prototype.getTargetKeyframe=function(){return this.keyframes[this.keyframes.length-1]},n.prototype.set=function(t,e,r,i){var a;r===void 0&&(r=0),isNaN(e)&&(e=0),isNaN(r)&&(r=0),i=i!=null?i:Me();var o=this.getProgress(i),s=this.getValue(o),l={};for(var u in this.config)l[u]=(a=t[u])!==null&&a!==void 0?a:s[u];var d=[{progress:0,value:s},{progress:1,value:l}];return this.setKeyframes(d,e,r,i)},n.prototype.setKeyframes=function(t,e,r,i){var a=this;if(r===void 0&&(r=0),t.length<2)throw new Error("keyframes invalid.");return isNaN(e)&&(e=0),isNaN(r)&&(r=0),this.callbacks&&(this.callbacks[1](new Error("motion aborted.")),this.callbacks=void 0),new Promise(function(o,s){i=i!=null?i:Me(),a.progress=0,a.ended=!1,a.startTime=i,a.startVelocity=r,a.keyframes=t,a.duration=e,e===0?(a.progress=1,a.value=F({},t[t.length-1].value)):a.value=F({},t[0].value),a.callbacks=[o,s]})},n.prototype.dispose=function(){this.callbacks&&(this.callbacks[1](new Error("motion dispose.")),this.callbacks=void 0)},n}(),ws=function(n){return n*(2-n)},Xf=function(){var n=new Float32Array([-.18,0,-.18,.18,0,-.18,-.18,0,.18,.18,0,.18]),t=new Float32Array([1,0,0,0,1,1,0,1]),e=new Uint8Array([0,2,1,2,3,1]),r=new c.BufferGeometry;return r.setAttribute("position",new c.BufferAttribute(n,3)),r.setAttribute("uv",new c.BufferAttribute(t,2)),r.setIndex(new c.BufferAttribute(e,1)),r}(),_f=`
|
|
932
|
+
`+JSON.stringify(n))}}function Va(n){for(var t={},e=[],r={},i=0,a=n;i<a.length;i++){var o=a[i],s=t[o.workCode];s||(s=t[o.workCode]=new c.Matrix4().copy(o.options.transform));for(var l=0,u=o.observers;l<u.length;l++){var d=u[l],f={isResolved:!0,active:d.active,accessibleIds:d.accessibleIds,visibleIds:d.visibleIds,accessibleNodes:d.accessibleNodes,visibleNodes:d.visibleNodes,floorIndex:d.floorIndex,images:d.images,index:d.index,panoIndex:d.panoIndex,loadable:d.loadable,panoId:d.panoId,pano:d.pano,work:d.work,derivedId:d.derivedId,video:d.video,position:new c.Vector3().copy(d.position).applyMatrix4(s),standingPosition:new c.Vector3().copy(d.standingPosition).applyMatrix4(s),quaternion:new c.Quaternion().setFromRotationMatrix(vs.makeRotationFromQuaternion(d.quaternion).premultiply(s))};Object.freeze(f),e.push(f),r[f.panoId]=f}}Object.freeze(e);for(var A=n.slice(),m={},h=0,v=A;h<v.length;h++){var o=v[h];m[o.workCode]=o}return Object.freeze(Object.assign(A,{get initial(){return A.length>0?A[0].initial:{work:{}}},get resolvedObservers(){return e},getWork:function(y){return m[y]},getResolvedObserver:function(y){var p,g;return h0(y)?r[y]:typeof y=="number"?r[Ue({workCode:(g=(p=n[0])===null||p===void 0?void 0:p.workCode)!==null&&g!==void 0?g:"",panoIndex:y})]:r[Ue(y)]},update:function(){for(var y={},p=0,g=A;p<g.length;p++){var x=g[p],b=x.options.transform,w=t[x.workCode];w?w.equals(b)||(w.copy(b),y[x.workCode]=!0):(t[x.workCode]=new c.Matrix4().copy(b),y[x.workCode]=!0)}for(var E=0,M=e;E<M.length;E++){var C=M[E];if(y[C.work.workCode]===!0){var P=C.work.observers[C.index],S=C.work.options.transform;C.position.copy(P.position).applyMatrix4(S),C.standingPosition.copy(P.standingPosition).applyMatrix4(S),C.quaternion.setFromRotationMatrix(vs.makeRotationFromQuaternion(P.quaternion).premultiply(S))}}}}))}var cu=new Map;function it(n){var t=cu.get(n);if(t)return t;throw new Error("fetcher never registered.")}function Gf(n,t){return cu.set(n,t)}var gs={computeTangents:function(n){var t=n.index,e=n.attributes;if(t===null||e.position===void 0||e.normal===void 0||e.uv===void 0){console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");return}var r=t.array,i=e.position.array,a=e.normal.array,o=e.uv.array,s=i.length/3;e.tangent===void 0&&n.setAttribute("tangent",new c.BufferAttribute(new Float32Array(4*s),4));for(var l=e.tangent.array,u=[],d=[],f=0;f<s;f++)u[f]=new c.Vector3,d[f]=new c.Vector3;var A=new c.Vector3,m=new c.Vector3,h=new c.Vector3,v=new c.Vector2,y=new c.Vector2,p=new c.Vector2,g=new c.Vector3,x=new c.Vector3;function b(Q,G,J){A.fromArray(i,Q*3),m.fromArray(i,G*3),h.fromArray(i,J*3),v.fromArray(o,Q*2),y.fromArray(o,G*2),p.fromArray(o,J*2);var H=m.x-A.x,j=h.x-A.x,Z=m.y-A.y,Y=h.y-A.y,pe=m.z-A.z,ee=h.z-A.z,oe=y.x-v.x,ie=p.x-v.x,ce=y.y-v.y,ne=p.y-v.y,ae=1/(oe*ne-ie*ce);g.set((ne*H-ce*j)*ae,(ne*Z-ce*Y)*ae,(ne*pe-ce*ee)*ae),x.set((oe*j-ie*H)*ae,(oe*Y-ie*Z)*ae,(oe*ee-ie*pe)*ae),u[Q].add(g),u[G].add(g),u[J].add(g),d[Q].add(x),d[G].add(x),d[J].add(x)}var w=n.groups;w.length===0&&(w=[{start:0,count:r.length}]);for(var f=0,E=w.length;f<E;++f)for(var M=w[f],C=M.start,P=M.count,S=C,T=C+P;S<T;S+=3)b(r[S+0],r[S+1],r[S+2]);var B=new c.Vector3,L=new c.Vector3,k=new c.Vector3,O=new c.Vector3,D,N,X;function K(Q){k.fromArray(a,Q*3),O.copy(k),N=u[Q],B.copy(N),B.sub(k.multiplyScalar(k.dot(N))).normalize(),L.crossVectors(O,N),X=L.dot(d[Q]),D=X<0?-1:1,l[Q*4]=B.x,l[Q*4+1]=B.y,l[Q*4+2]=B.z,l[Q*4+3]=D}for(var f=0,E=w.length;f<E;++f)for(var M=w[f],C=M.start,P=M.count,S=C,T=C+P;S<T;S+=3)K(r[S+0]),K(r[S+1]),K(r[S+2])},mergeBufferGeometries:function(n,t){for(var e=n[0].index!==null,r=new Set(Object.keys(n[0].attributes)),i=new Set(Object.keys(n[0].morphAttributes)),a={},o={},s=new c.BufferGeometry,l=0,u=0;u<n.length;++u){var d=n[u];if(e!==(d.index!==null))return null;for(var f in d.attributes){if(!r.has(f))return null;a[f]===void 0&&(a[f]=[]),a[f].push(d.attributes[f])}for(var f in d.morphAttributes){if(!i.has(f))return null;o[f]===void 0&&(o[f]=[]),o[f].push(d.morphAttributes[f])}if(s.userData.mergedUserData=s.userData.mergedUserData||[],s.userData.mergedUserData.push(d.userData),t){var A;if(e)A=d.index.count;else if(d.attributes.position!==void 0)A=d.attributes.position.count;else return null;s.addGroup(l,A,u),l+=A}}if(e){for(var m=0,h=[],u=0;u<n.length;++u){for(var v=n[u].index,y=0;y<v.count;++y)h.push(v.getX(y)+m);m+=n[u].attributes.position.count}s.setIndex(h)}for(var f in a){var p=this.mergeBufferAttributes(a[f]);if(!p)return null;s.setAttribute(f,p)}for(var f in o){var g=o[f][0].length;if(g===0)break;s.morphAttributes=s.morphAttributes||{},s.morphAttributes[f]=[];for(var u=0;u<g;++u){for(var x=[],y=0;y<o[f].length;++y)x.push(o[f][y][u]);var b=this.mergeBufferAttributes(x);if(!b)return null;s.morphAttributes[f].push(b)}}return s},mergeBufferAttributes:function(n){for(var t,e,r,i=0,a=0;a<n.length;++a){var o=n[a];if(o.isInterleavedBufferAttribute||(t===void 0&&(t=o.array.constructor),t!==o.array.constructor)||(e===void 0&&(e=o.itemSize),e!==o.itemSize)||(r===void 0&&(r=o.normalized),r!==o.normalized))return null;i+=o.array.length}for(var s=new t(i),l=0,a=0;a<n.length;++a)s.set(n[a].array,l),l+=n[a].array.length;return new c.BufferAttribute(s,e,r)},interleaveAttributes:function(n){for(var t,e=0,r=0,i=0,a=n.length;i<a;++i){var o=n[i];if(t===void 0&&(t=o.array.constructor),t!==o.array.constructor)return console.warn("AttributeBuffers of different types cannot be interleaved"),null;e+=o.array.length,r+=o.itemSize}for(var s=new c.InterleavedBuffer(new t(e),r),l=0,u=[],d=["getX","getY","getZ","getW"],f=["setX","setY","setZ","setW"],A=0,a=n.length;A<a;A++){var o=n[A],m=o.itemSize,h=o.count,v=new c.InterleavedBufferAttribute(s,m,l,o.normalized);u.push(v),l+=m;for(var y=0;y<h;y++)for(var p=0;p<m;p++)v[f[p]](y,o[d[p]](y))}return u},estimateBytesUsed:function(n){var t=0;for(var e in n.attributes){var r=n.getAttribute(e);t+=r.count*r.itemSize*r.array.BYTES_PER_ELEMENT}var i=n.getIndex();return t+=i?i.count*i.itemSize*i.array.BYTES_PER_ELEMENT:0,t},mergeVertices:function(n,t){t===void 0&&(t=1e-4),t=Math.max(t,Number.EPSILON);for(var e={},r=n.getIndex(),i=n.getAttribute("position"),a=r?r.count:i.count,o=0,s=Object.keys(n.attributes),l={},u={},d=[],f=["getX","getY","getZ","getW"],A=0,m=s.length;A<m;A++){var h=s[A];l[h]=[];var v=n.morphAttributes[h];v&&(u[h]=new Array(v.length).fill().map(function(){return[]}))}for(var y=Math.log10(1/t),p=Math.pow(10,y),A=0;A<a;A++){for(var g=r?r.getX(A):A,x="",b=0,m=s.length;b<m;b++)for(var h=s[b],w=n.getAttribute(h),E=w.itemSize,M=0;M<E;M++)x+="".concat(~~(w[f[M]](g)*p),",");if(x in e)d.push(e[x]);else{for(var b=0,m=s.length;b<m;b++)for(var h=s[b],w=n.getAttribute(h),v=n.morphAttributes[h],E=w.itemSize,C=l[h],P=u[h],M=0;M<E;M++){var S=f[M];if(C.push(w[S](g)),v)for(var T=0,B=v.length;T<B;T++)P[T].push(v[T][S](g))}e[x]=o,d.push(o),o++}}for(var L=n.clone(),A=0,m=s.length;A<m;A++){var h=s[A],k=n.getAttribute(h),O=new k.array.constructor(l[h]),w=new c.BufferAttribute(O,k.itemSize,k.normalized);if(L.setAttribute(h,w),h in u)for(var b=0;b<u[h].length;b++){var D=n.morphAttributes[h][b],O=new D.array.constructor(u[h][b]),N=new c.BufferAttribute(O,D.itemSize,D.normalized);L.morphAttributes[h][b]=N}}return L.setIndex(d),L}};function Na(n){switch(n){case"Floorplan":return!0;case"Mapview":return!0;default:return!1}}function Jn(n){switch(n){case"Panorama":return!0;case"VRPanorama":return!0;case"XRPanorama":return!0;case"Model":return!0;default:return!1}}var Wt=new c.Vector3,sa=new c.Sphere,ua=new c.Matrix4,ys=new c.Matrix4,bs=new c.Box3,hi=new c.Matrix4().fromArray([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),pi=new c.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]),du=new c.Box3(new c.Vector3(-.5,-.5,-.5),new c.Vector3(.5,.5,.5));function xs(n,t,e){switch(n){case"Z":break;case"Y":e.copy(pi);break;case"-Y":e.copy(hi);break;case"WGS84":case"GCJ02":case"BD09":Lf(t,e);break;default:e.identity();break}return e}function Kf(n){var t=/([0-9a-z\.\_\-]+)([\?\#].*)?$/i.exec(n);if(t){var e=String(t[1]).trim().split(".").slice(1).reverse()[0];if(e)return e}return""}var vi=function(){function n(t,e){this.scene=t,this.error=e,t.viewLayer=this}return Object.defineProperty(n.prototype,"name",{get:function(){return this.scene.name},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"type",{get:function(){return this.scene.type},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"upAxis",{get:function(){return this.scene.upAxis},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"groundHeight",{get:function(){return this.scene.groundHeight},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"model",{get:function(){return this.scene.model},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"coordinates",{get:function(){Wt.setScalar(0);var t=this.scene.localToLla(Wt),e=t.x,r=t.y;return[e,r].map(function(i){return(i/Math.PI*180).toFixed(6)}).join(",")},enumerable:!1,configurable:!0}),n.prototype.getTransformMatrix4=function(t){return t===void 0&&(t=new c.Matrix4),t.copy(this.scene.coordinateTransform.ecefToLocalMatrix),this.scene&&t.premultiply(this.scene.matrixWorld),t},n.prototype.coordinatesToWorldPoint=function(t){var e=new c.Vector3(t.latitude,t.longitude,t.altitude);return this.scene.llaToWorld(e)},n.prototype.worldPointToCoordinates=function(t){return Wt.copy(t),this.scene.worldToLla(Wt),{latitude:Wt.x,longitude:Wt.y,altitude:Wt.z}},n}(),Da=function(n){ue(t,n);function t(e){e===void 0&&(e={});var r,i,a,o=n.call(this)||this;return o.name="",o.onError=(r=e.onError)!==null&&r!==void 0?r:z,o.onShownFloorChange=(i=e.onShownFloorChange)!==null&&i!==void 0?i:z,o.onLoad=(a=e.onLoad)!==null&&a!==void 0?a:z,o.work=null,o.viewLayers=[],o.bounding=new c.Box3(new c.Vector3,new c.Vector3),o.floorLength=0,o.textureOptions={},o.refined=!1,o.refineProgress=[0,0],o.loaded=!1,o.matrixAutoUpdate=!1,o.needsRender=!0,o.autoRefine=!0,o.materialVersion=0,o.materialParameters=F({},Ee),o.cacheCameras=[],o.disposed=!1,o}return Object.defineProperty(t.prototype,"empty",{get:function(){return this.viewLayers.length===0},enumerable:!1,configurable:!0}),t.prototype.getMaterial=function(){return F({},this.materialParameters)},t.prototype.setMaterial=function(e){var r=this.materialParameters.shownFloorIndex,i=p0(this.materialParameters,e);if(i){var a=this.materialParameters.shownFloorIndex;r!==a&&this.onShownFloorChange(a),this.materialVersion++,this.needsRender=!0}},Object.defineProperty(t.prototype,"brightness",{get:function(){return this.materialParameters.brightness},set:function(e){this.setMaterial({brightness:typeof e=="number"?e:1})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shownFloorIndex",{get:function(){return this.materialParameters.shownFloorIndex},set:function(e){this.setMaterial({shownFloorIndex:e})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shownFloor",{get:function(){return this.shownFloorIndex===-1?null:this.shownFloorIndex},set:function(e){this.shownFloorIndex=e===null?-1:e},enumerable:!1,configurable:!0}),t.prototype.show=function(e){this.shownFloor=e!=null?e:null},Object.defineProperty(t.prototype,"clippers",{get:function(){return this.materialParameters.clippers},set:function(e){this.setMaterial({clippers:e})},enumerable:!1,configurable:!0}),t.prototype.getEdgesBySphere=function(e,r){r===void 0&&(r=30/180*Math.PI);for(var i=Math.cos(r),a=[],o=0,s=this.children;o<s.length;o++){var l=s[o];l instanceof $r&&l.tileset.selectedTiles.forEach(function(u){var d,f,A;if(!(u.boundingVolume&&u.boundingVolume.distanceToPoint(e.center)>e.radius)){var m=(f=(d=u.content)===null||d===void 0?void 0:d.data)===null||f===void 0?void 0:f.object;if(m&&m.visible){var h=[];if(m.traverseVisible(function(J){if(J instanceof c.Mesh){var H=fi.get(J);if(H){ua.copy(J.matrixWorld),ys.getInverse(ua),sa.copy(e).applyMatrix4(ys);var j=H.trianglesInSphere(sa.center,sa.radius),Z=new c.BufferGeometry;Z.setAttribute("position",new c.BufferAttribute(j,3)),Z.applyMatrix4(J.matrixWorld),Z=gs.mergeVertices(Z,.01),h.push(Z)}}}),h.length===0)return;for(var v=["a","b","c"],y=gs.mergeBufferGeometries(h,!1),p=y.getAttribute("position").array,g=((A=y.getIndex())===null||A===void 0?void 0:A.array)||[],x=[],b=[],w=0,E=p.length;w<E;w+=3){var M=new c.Vector3(p[w],p[w+1],p[w+2]);x.push(M)}for(var w=0,E=g.length;w<E;w+=3){var C=g[w],P=g[w+1],S=g[w+2],T=new c.Vector3().crossVectors(x[P].clone().sub(x[C]),x[S].clone().sub(x[C])).normalize();b.push({a:C,b:P,c:S,normal:T})}for(var B={},w=0,E=b.length;w<E;w++)for(var L=b[w],k=0;k<3;k++){var O=L[v[k]],D=L[v[(k+1)%3]],N=[Math.min(O,D),Math.max(O,D)],X=N[0]+"-"+N[1];B[X]===void 0?B[X]={index1:N[0],index2:N[1],face1:w}:B[X].face2=w}for(var X in B){var K=B[X];if(K.face2===void 0||b[K.face1].normal.dot(b[K.face2].normal)<=i){var Q=x[K.index1],G=x[K.index2];a.push(new c.Line3(Q,G))}}x.length=0,b.length=0}}})}return a},t.prototype.intersectRaycaster=function(e,r,i){r===void 0&&(r=null),i===void 0&&(i=!0);for(var a=[],o=0,s=this.children.length;o<s;o++){var l=this.children[o];l.visible&&l instanceof $r&&l.intersectRaycaster(e,!1,a)}return r!=null&&(a=a.filter(function(u){return u.floor===r})),this.getMaterial().pointBack==="HIDDEN"&&(a=a.filter(function(u){return!(u.object instanceof wr&&u.face&&u.face.normal.angleTo(e.ray.direction)<Math.PI/2)})),i&&a.sort(function(u,d){return u.distance-d.distance}),a},t.prototype.load=function(e,r){var i,a=this,o,s,l,u;if(r===void 0&&(r={}),this.work=e,this.name=this.work.workCode,!e.model)return Promise.resolve();for(var d=e.model,f=0,A=0,m=e.observers;A<m.length;A++){var h=m[A];f=Math.max(f,h.floorIndex)}this.floorLength=f+1;for(var v=!1,y=[],p=function(K){var Q=K.tileset,G=K.upAxis,J=K.name,H=K.type;H==="mesh"&&(v=!0);var j=Q.split("#"),Z=j[0],Y=j[1],pe=(o=(Y||Z).split("?")[1])!==null&&o!==void 0?o:"",ee=it(e).ajax(Q,{responseType:"text"}).then(function(oe){var ie,ce,ne,ae=JSON.parse(oe.body),de=ae.root,ve=ae.rootMeta,xe=ve===void 0?{}:ve;xe.upAxis&&xe.upAxis!==G&&(G=xe.upAxis),"lodVersion"in ae&&(G="-Y","floorInfo"in ae&&(ae.properties=ae.properties||{},ae.properties.floorInfo=ae.floorInfo.map(function(ge){return{ground:-ge.ground,height:ge.height}}),delete ae.floorInfo),ae.asset.tilesetVersion=String(ae.lodVersion),delete ae.lodVersion);var Ce=de.boundingVolume?di(de.boundingVolume):void 0;Ce&&de.transform&&Ce.applyMatrix4(ua.fromArray(de.transform));var Be=null,$=new c.Matrix4,te=new c.Matrix4;xe.coordinate?(Be=xe.coordinate.ground_height,$.fromArray(xe.coordinate.pose_ecef_to_enu),te.fromArray(xe.coordinate.pose_enu_to_ecef)):(Ce?Ce.getCenter(Wt):Wt.setScalar(0),xs(G,Wt,$),te.getInverse($));var U=new c.Matrix4().copy(hi),Le=new c.Matrix4().copy(pi),Pe=new c.Matrix4().premultiply($).premultiply(U),Ie=new c.Matrix4().getInverse(Pe);ae.root={refine:(ie=de.refine)!==null&&ie!==void 0?ie:"REPLACE",geometricError:de.geometricError,transform:Pe.toArray(),boundingVolume:Ce?Ce.toJson():void 0,viewerRequestVolume:!((ce=r["3d-tiles"])===null||ce===void 0)&&ce.viewerRequestVolume?(ne=r["3d-tiles"])===null||ne===void 0?void 0:ne.viewerRequestVolume.toJson():void 0,children:[de]};var Qe=Q?Q.slice(0,Q.lastIndexOf("/")+1):"",be=new $r(a,ae,{name:J,type:H,upAxis:G,referer:Q,resourcePath:Qe,search:pe,fetcher:it(e),groundHeight:Be,coordinateTransform:{localToEnuMatrix:Le,enuToLocalMatrix:U,enuToEcefMatrix:te,ecefToEnuMatrix:$,localToEcefMatrix:Ie,ecefToLocalMatrix:Pe}});if(be.matrix.copy(e.transform),be.matrix.decompose(be.position,be.quaternion,be.scale),be.matrixWorldNeedsUpdate=!0,r["3d-tiles"]){var ye=r["3d-tiles"];typeof ye.debug!="undefined"&&(be.debug=ye.debug),typeof ye.minLevelOfDetail!="undefined"&&(be.minLevelOfDetail=ye.minLevelOfDetail),typeof ye.maxLevelOfDetail!="undefined"&&(be.maxLevelOfDetail=ye.maxLevelOfDetail),typeof ye.skipLevelOfDetail!="undefined"&&(be.skipLevelOfDetail=ye.skipLevelOfDetail),typeof ye.loadSiblings!="undefined"&&(be.loadSiblings=ye.loadSiblings),typeof ye.maxMemoryUsage!="undefined"&&(be.maxMemoryUsage=ye.maxMemoryUsage),typeof ye.maxRequests!="undefined"&&(be.maxRequests=ye.maxRequests),typeof ye.maxScreenSpaceError!="undefined"&&(be.maxScreenSpaceError=ye.maxScreenSpaceError)}return new vi(be,null)});y.push(ee.catch(function(oe){a.onError(oe);var ie=new c.Matrix4,ce=new c.Matrix4,ne=new c.Matrix4().copy(hi),ae=new c.Matrix4().copy(pi),de=new c.Matrix4().premultiply(ie).premultiply(ne),ve=new c.Matrix4().getInverse(de),xe=Q?Q.slice(0,Q.lastIndexOf("/")+1):"",Ce={asset:{version:"0.0"},geometricError:0,root:{geometricError:0}},Be=new $r(a,Ce,{name:J,type:H,upAxis:G,referer:Q,resourcePath:xe,search:pe,fetcher:it(e),groundHeight:null,coordinateTransform:{localToEnuMatrix:ae,enuToLocalMatrix:ne,enuToEcefMatrix:ce,ecefToEnuMatrix:ie,localToEcefMatrix:ve,ecefToLocalMatrix:de},onError:a.onError});return new vi(Be,oe)}))},g=0,x=d.layers;g<x.length;g++){var b=x[g];p(b)}if(!v&&d.file){var w=d.file,E=d.textureBase,M=d.textures,C=Kf(w)||"at3d",P=C==="at3d"||C==="pbm"?"Z":"Y",S=new c.Matrix4,T=new c.Matrix4,B=new c.Matrix4().copy(hi),L=new c.Matrix4().copy(pi);xs(P,Wt.setScalar(0),S),T.getInverse(S);var k=new c.Matrix4().premultiply(S).premultiply(B),O=new c.Matrix4().getInverse(k),D={asset:{gltfUpAxis:"Z",version:"0.0"},geometricError:0,root:{refine:"REPLACE",geometricError:0,transform:k.toArray(),viewerRequestVolume:!((s=r["3d-tiles"])===null||s===void 0)&&s.viewerRequestVolume?(l=r["3d-tiles"])===null||l===void 0?void 0:l.viewerRequestVolume.toJson():void 0,content:{uri:w},extras:(i={},i[C]={textureBaseUri:E,textureArray:M,textureOptions:(u=r.textureOptions)!==null&&u!==void 0?u:{}},i)}},N=new $r(this,D,{name:"fallback",type:"mesh",upAxis:P,referer:w,resourcePath:"",fetcher:it(e),groundHeight:null,coordinateTransform:{localToEnuMatrix:L,enuToLocalMatrix:B,enuToEcefMatrix:T,ecefToEnuMatrix:S,localToEcefMatrix:O,ecefToLocalMatrix:k},onError:this.onError});N.matrix.copy(e.transform),N.matrix.decompose(N.position,N.quaternion,N.scale),N.matrixWorldNeedsUpdate=!0;var X=new vi(N,null);y.push(Promise.resolve(X))}return Promise.all(y).then(function(K){for(var Q,G=[],J=[],H=[],j=0,Z=K;j<Z.length;j++){var Y=Z[j];if(a.viewLayers.push(Y),a.disposed){Y.scene.dispose();continue}switch(a.add(Y.scene),Y.scene.visible=!1,Y.scene.type){case"mesh":G.push(Y.scene);break;case"point_cloud":J.push(Y.scene);break;default:H.push(Y.scene);break}}G.length?G[0].visible=!0:J.length?J[0].visible=!0:H.length&&(H[0].visible=!0);var pe=(Q=r["3d-tiles"])===null||Q===void 0?void 0:Q.showLayers;if(typeof pe=="boolean")for(var ee=0,oe=K;ee<oe.length;ee++){var Y=oe[ee];Y.scene&&(Y.scene.visible=pe)}else if(Array.isArray(pe))for(var ie=0,ce=K;ie<ce.length;ie++){var Y=ce[ie];Y.scene&&(Y.scene.visible=pe.indexOf(Y.scene.name)!==-1)}})},t.prototype.update=function(e,r,i){if(this.children.length){var a=this.loaded;this.refined=this.work!==null,this.refineProgress[0]=0,this.refineProgress[1]=0,this.loaded=this.work!==null,this.bounding.makeEmpty();for(var o=0,s=this.viewLayers;o<s.length;o++){var l=s[o],u=l.scene;u&&(this.work&&(u.idle=this.materialParameters.modelAlpha===0||!u.loaded,u.cacheCameras=this.cacheCameras,this.autoRefine===!1?u.needsRefined=!1:Jn(i)?u.needsRefined=this.materialParameters.modelAlpha===0||this.materialParameters.modelAlpha===1:u.needsRefined=!0,this.work.transform.equals(u.matrix)||(u.matrix.copy(this.work.transform),u.matrix.decompose(u.position,u.quaternion,u.scale),u.matrixWorldNeedsUpdate=!0)),u.update(e,r),u.boundingBox.isEmpty()||(bs.copy(u.boundingBox).applyMatrix4(u.matrix),this.bounding.union(bs)),u.needsRender===!0&&(u.needsRender=!1,this.needsRender=!0),u.refined===!1&&(this.refined=!1),this.refineProgress[0]+=u.refineProgress[0],this.refineProgress[1]+=u.refineProgress[1],u.loaded===!1&&(this.loaded=!1))}this.bounding.isEmpty()&&this.bounding.copy(du),a===!1&&this.loaded===!0&&this.onLoad()}else this.work&&!this.work.model?(this.refined=!0,this.refineProgress[0]=0,this.refineProgress[1]=0,this.loaded=!0):(this.refined=!1,this.refineProgress[0]=0,this.refineProgress[1]=0,this.loaded=!1),this.bounding.set(new c.Vector3,new c.Vector3)},t.prototype.dispose=function(){this.disposed=!0;for(var e;e=this.children[0];)e instanceof $r&&e.dispose(),this.remove(e)},t}(c.Object3D);function ws(){var n=new c.Box3,t=xf(Ee,["clippers","shownFloorIndex","brightness"]),e=Object.assign([],{bounding:n,needsRender:!1,refined:!1,refineProgress:[0,0],loaded:!1,materialVersion:0,cacheCameras:[],autoUpdate:!0,intersectRaycaster:function(r,i,a){a===void 0&&(a=!0);var o;if(e.length===1)o=e[0].intersectRaycaster(r,i,a);else if(e.length===0)o=[];else{o=[];for(var s=0,l=e;s<l.length;s++){var u=l[s];if(u.visible){var d=u.intersectRaycaster(r,i,!1);d.length&&o.push.apply(o,d)}}a&&o.sort(function(f,A){return f.distance-A.distance})}return o},setMaterial:function(r){var i=p0(t,r);i&&(e.materialVersion++,e.needsRender=!0)},getMaterial:function(){return F({},t)},resetBrightness:function(){for(var r=0,i=e;r<i.length;r++){var a=i[r];a.setMaterial({brightness:1})}},update:function(r,i,a){if(e.autoUpdate!==!1){e.refined=e.length>0,e.loaded=e.length>0,e.refineProgress[0]=0,e.refineProgress[1]=0,n.makeEmpty();for(var o=0,s=e.cacheCameras;o<s.length;o++){var l=s[o];l.updateMatrixWorld(!0),l.updateProjectionMatrix()}for(var u=0,d=0,f=e;d<f.length;d++){for(var A=f[d],m=0,h=A.viewLayers;m<h.length;m++){var v=h[m];v.scene.modelIndex=u++}A.setMaterial(t),A.cacheCameras=e.cacheCameras,A.update(r,i,a),A.needsRender===!0&&(e.needsRender=!0,A.needsRender=!1),A.refined===!1&&(e.refined=!1),e.refineProgress[0]+=A.refineProgress[0],e.refineProgress[1]+=A.refineProgress[1],A.loaded===!1&&(e.loaded=!1),n.union(A.bounding)}n.isEmpty()&&n.copy(du)}}});return e}function Ai(n,t,e){return n+(t-n)*e}function jf(n,t,e,r){var i=(t*e+2*n)/Math.pow(e,3),a=-(2*t*e+3*n)/Math.pow(e,2),o=t,s=n;return i*Math.pow(r,3)+a*Math.pow(r,2)+o*r+s}function Jf(n,t,e,r){var i=(t*e+2*n)/Math.pow(e,3),a=-(2*t*e+3*n)/Math.pow(e,2),o=t;return 3*i*Math.pow(r,2)+2*a*r+o}function Wf(n,t,e,r){var i=r[1]-r[0];return n=Ii(n,r),t=Ii(t,r),t-n>i/2?Ai(n+i,t,e):n-t>i/2?Ai(n-i,t,e):Ai(n,t,e)}function Ii(n,t){var e=t[1]-t[0];return n<t[0]?Ii(n+e,t):n>=t[1]?Ii(n-e,t):n}function Xf(n,t,e,r){return r?Wf(n,t,e,r):Ai(n,t,e)}var Se=function(){function n(t){this.config={},this.progress=1,this.ended=!0,this.value={},this.startTime=Me(),this.startVelocity=0,this.duration=0,this.keyframes=[];for(var e in t){var r=t[e];typeof r=="number"?(this.value[e]=r,this.config[e]={circle:!1}):(this.value[e]=r.value,this.config[e]={circle:r.circle})}this.keyframes=[{progress:0,value:F({},this.value)},{progress:1,value:F({},this.value)}]}return n.prototype.getProgress=function(t){var e=t-this.startTime;return e<0?0:e>=this.duration?1:1-jf(1,this.startVelocity,this.duration,e)},n.prototype.getValue=function(t){for(var e=1;e<this.keyframes.length;e++)if(this.keyframes[e].progress>t){var r=this.keyframes[e-1],i=this.keyframes[e],a={};for(var o in this.config){var s=(t-r.progress)/(i.progress-r.progress);a[o]=Xf(r.value[o],i.value[o],s,this.config[o].circle)}return a}return F({},this.keyframes[this.keyframes.length-1].value)},n.prototype.getProgressVelocity=function(t){var e=t-this.startTime;return e>=this.duration?0:Jf(1,this.startVelocity,this.duration,e)},n.prototype.update=function(t){return this.ended?!0:(this.progress=Math.min(1,Math.max(0,this.progress,this.getProgress(t))),this.value=this.getValue(this.progress),this.ended=this.progress>=1,this.ended&&this.callbacks&&(this.callbacks[0](),this.callbacks=void 0),this.ended)},n.prototype.getKeyFrameSegment=function(t){for(var e=this.getProgress(t),r=1;r<this.keyframes.length;r++)if(this.keyframes[r].progress>e)return[this.keyframes[r-1],this.keyframes[r]];return[this.keyframes[this.keyframes.length-2],this.keyframes[this.keyframes.length-1]]},n.prototype.getTargetKeyframe=function(){return this.keyframes[this.keyframes.length-1]},n.prototype.set=function(t,e,r,i){var a;r===void 0&&(r=0),isNaN(e)&&(e=0),isNaN(r)&&(r=0),i=i!=null?i:Me();var o=this.getProgress(i),s=this.getValue(o),l={};for(var u in this.config)l[u]=(a=t[u])!==null&&a!==void 0?a:s[u];var d=[{progress:0,value:s},{progress:1,value:l}];return this.setKeyframes(d,e,r,i)},n.prototype.setKeyframes=function(t,e,r,i){var a=this;if(r===void 0&&(r=0),t.length<2)throw new Error("keyframes invalid.");return isNaN(e)&&(e=0),isNaN(r)&&(r=0),this.callbacks&&(this.callbacks[1](new Error("motion aborted.")),this.callbacks=void 0),new Promise(function(o,s){i=i!=null?i:Me(),a.progress=0,a.ended=!1,a.startTime=i,a.startVelocity=r,a.keyframes=t,a.duration=e,e===0?(a.progress=1,a.value=F({},t[t.length-1].value)):a.value=F({},t[0].value),a.callbacks=[o,s]})},n.prototype.dispose=function(){this.callbacks&&(this.callbacks[1](new Error("motion dispose.")),this.callbacks=void 0)},n}(),Es=function(n){return n*(2-n)},_f=function(){var n=new Float32Array([-.18,0,-.18,.18,0,-.18,-.18,0,.18,.18,0,.18]),t=new Float32Array([1,0,0,0,1,1,0,1]),e=new Uint8Array([0,2,1,2,3,1]),r=new c.BufferGeometry;return r.setAttribute("position",new c.BufferAttribute(n,3)),r.setAttribute("uv",new c.BufferAttribute(t,2)),r.setIndex(new c.BufferAttribute(e,1)),r}(),Zf=`
|
|
933
933
|
varying vec2 vUv;
|
|
934
934
|
#include <common>
|
|
935
935
|
#include <logdepthbuf_pars_vertex>
|
|
@@ -938,7 +938,7 @@ void main() {
|
|
|
938
938
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
939
939
|
#include <logdepthbuf_vertex>
|
|
940
940
|
}
|
|
941
|
-
`,
|
|
941
|
+
`,Yf=`
|
|
942
942
|
uniform vec3 baseColor;
|
|
943
943
|
uniform float circleScale;
|
|
944
944
|
uniform float ringScale;
|
|
@@ -1041,7 +1041,7 @@ void main() {
|
|
|
1041
1041
|
|
|
1042
1042
|
gl_FragColor = vec4(gl_FragColor.rgb * baseColor, gl_FragColor.a * opacity * opacity);
|
|
1043
1043
|
}
|
|
1044
|
-
`,
|
|
1044
|
+
`,fu=function(n){ue(t,n);function t(e){e===void 0&&(e={});var r,i,a=n.call(this)||this,o=(r=e.color)!==null&&r!==void 0?r:16777215,s=(i=e.scale)!==null&&i!==void 0?i:1;return a.progress=0,a.opacity=0,a.loading=!1,a.current=!1,a.disabled=!1,a.currentMotion=new Se({progress:0}),a.ringMotion=new Se({scale:1,opacity:1}),a.tapMotion=new Se({scale:1,opacity:1}),a.loadingOpacityMotion=new Se({opacity:0}),a.progressMotion=new Se({progress:0}),a.progressOpacityMotion=new Se({opacity:0}),a.opacityMotion=new Se({opacity:0}),a.disableMotion=new Se({progress:0}),a.panoMesh=new c.Mesh(_f,new c.ShaderMaterial({blending:c.CustomBlending,blendSrc:c.SrcAlphaFactor,blendDst:c.OneMinusSrcAlphaFactor,blendSrcAlpha:c.OneFactor,blendDstAlpha:c.OneMinusSrcAlphaFactor,depthWrite:!1,vertexShader:Zf,fragmentShader:Yf,uniforms:{baseColor:{value:new c.Color(o)},circleScale:{value:1},ringScale:{value:1},ringOpacity:{value:1},loadingAngle:{value:0},loadingOpacity:{value:0},progress:{value:0},progressOpacity:{value:0},expand0:{value:0},expand1:{value:0},expandOpacity:{value:0},opacity:{value:0},tapScale:{value:1},tapOpacity:{value:1},disable:{value:0}}})),a.renderOrder=-2,a.panoMesh.renderOrder=-2,a.panoMesh.position.y=.004,a.panoMesh.scale.set(s,1,s),a.add(a.panoMesh),a.currentStartTime=Me(),a.needsRender=!0,a}return t.prototype.setProgress=function(e){var r=this;this.setDisabled(!1),this.setLoading(!1),this.progress!==e&&(e=he(e,0,1),this.tapMotion.ended&&(this.progress===0&&this.progressOpacityMotion.set({opacity:1},500).catch(z),e===0?this.progressOpacityMotion.set({opacity:0},500).catch(z).then(function(){r.progressMotion.set({progress:0},0).catch(z)}):this.progressMotion.set({progress:he(e*1.2,0,1)},100).catch(z)),this.progress=e)},t.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=he(e,0,1),this.opacityMotion.set({opacity:e},200).catch(z))},t.prototype.setCurrent=function(e){this.current!==e&&(this.currentMotion.set({progress:e?1:0},2e3).catch(z),this.current=e,this.current===!0&&(this.currentStartTime=Me()))},t.prototype.setLoading=function(e){this.loading!==e&&(this.loading=e,this.disabled===!0&&this.setDisabled(!1),this.loadingOpacityMotion.set({opacity:e?1:0},500).catch(z))},t.prototype.setDisabled=function(e){this.disabled!==e&&(this.disabled=e,this.loading===!0&&this.setLoading(!1),this.disableMotion.set({progress:e?1:0},500).catch(z))},t.prototype.tap=function(){var e=this;if(!this.tapMotion.ended)return Promise.resolve();var r=[{progress:0,value:{scale:1,opacity:1}},{progress:.3,value:{scale:.85,opacity:.5}},{progress:.8,value:{scale:1.05,opacity:.6}},{progress:1,value:{scale:1,opacity:1}}];return this.progressOpacityMotion.set({opacity:0},0).catch(z),this.progressMotion.set({progress:0},0).catch(z),this.tapMotion.setKeyframes(r,600).then(function(){e.progressOpacityMotion.set({opacity:e.progress>0?1:0},300).catch(z),e.progressMotion.set({progress:e.progress},120).catch(z)}).catch(z)},t.prototype.updateTime=function(e,r){if(!this.progressMotion.ended){this.progressMotion.update(e);var i=this.progressMotion.value.progress;this.panoMesh.material.uniforms.progress.value=i,this.needsRender=!0}if(!this.progressOpacityMotion.ended){this.progressOpacityMotion.update(e);var a=this.progressOpacityMotion.value.opacity;this.panoMesh.material.uniforms.progressOpacity.value=a,this.needsRender=!0}if(!this.opacityMotion.ended){this.opacityMotion.update(e);var a=this.opacityMotion.value.opacity;this.panoMesh.material.uniforms.opacity.value=a,this.needsRender=!0}if(this.visible=this.opacityMotion.value.opacity!==0,(!this.loadingOpacityMotion.ended||this.loadingOpacityMotion.value.opacity>0)&&(this.loadingOpacityMotion.update(e),this.panoMesh.material.uniforms.loadingOpacity.value=this.loadingOpacityMotion.value.opacity,this.panoMesh.material.uniforms.loadingAngle.value=e/120%(Math.PI*2),this.needsRender=!0),this.tapMotion.ended||(this.tapMotion.update(e),this.panoMesh.material.uniforms.tapOpacity.value=this.tapMotion.value.opacity,this.panoMesh.material.uniforms.tapScale.value=this.tapMotion.value.scale,this.needsRender=!0),this.current||!this.currentMotion.ended){this.currentMotion.update(e),this.panoMesh.material.uniforms.expandOpacity.value=this.currentMotion.value.progress;{var o=(e-this.currentStartTime-1500)/2e3;if(o%5<2){var s=1+Math.sin(Math.PI*o)/25*this.currentMotion.value.progress;this.panoMesh.material.uniforms.circleScale.value=s,this.needsRender=!0}}{var l=(e-this.currentStartTime-1500)/2e3;if(l%5<2){var u=l%1;this.panoMesh.material.uniforms.expand0.value=Es(u)*this.currentMotion.value.progress,this.needsRender=!0}}{var d=(e-this.currentStartTime-1e3)/2e3;if(d%5<2){var u=d%1;this.panoMesh.material.uniforms.expand1.value=Es(u)*this.currentMotion.value.progress,this.needsRender=!0}}}if(this.currentMotion.value.progress>.2&&this.progress===0&&this.loading===!1){var f=(e-this.currentStartTime-1e3)/2e3;f%5<2?this.ringMotion.getTargetKeyframe().value.scale!==.8&&this.ringMotion.set({scale:.8,opacity:0},600).catch(z):this.ringMotion.getTargetKeyframe().value.scale!==1&&this.ringMotion.set({scale:1,opacity:1},600).catch(z)}else this.ringMotion.getTargetKeyframe().value.scale!==1&&this.ringMotion.set({scale:1,opacity:1},600).catch(z);if(!this.ringMotion.ended){var A=this.ringMotion.value,s=A.scale,a=A.opacity;this.ringMotion.update(e),this.panoMesh.material.uniforms.ringScale.value=s,this.panoMesh.material.uniforms.ringOpacity.value=a,this.needsRender=!0}if(!this.disableMotion.ended){var i=this.disableMotion.value.progress;this.disableMotion.update(e),this.panoMesh.material.uniforms.disable.value=i,this.needsRender=!0}},t.prototype.dispose=function(){this.ringMotion.dispose(),this.tapMotion.dispose(),this.progressMotion.dispose(),this.progressOpacityMotion.dispose(),this.opacityMotion.dispose(),this.currentMotion.dispose(),this.panoMesh.material.dispose()},t}(c.Object3D),Cs=function(n){return n*(2-n)},$f=function(){var n=new Float32Array([-.18,0,-.18,.18,0,-.18,-.18,0,.18,.18,0,.18]),t=new Float32Array([1,0,0,0,1,1,0,1]),e=new Uint8Array([0,2,1,2,3,1]),r=new c.BufferGeometry;return r.setAttribute("position",new c.BufferAttribute(n,3)),r.setAttribute("uv",new c.BufferAttribute(t,2)),r.setIndex(new c.BufferAttribute(e,1)),r}(),eh=`
|
|
1045
1045
|
varying vec2 vUv;
|
|
1046
1046
|
#include <common>
|
|
1047
1047
|
#include <logdepthbuf_pars_vertex>
|
|
@@ -1050,7 +1050,7 @@ void main() {
|
|
|
1050
1050
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
1051
1051
|
#include <logdepthbuf_vertex>
|
|
1052
1052
|
}
|
|
1053
|
-
`,
|
|
1053
|
+
`,th=`
|
|
1054
1054
|
uniform vec3 baseColor;
|
|
1055
1055
|
uniform float circleScale;
|
|
1056
1056
|
uniform float circleOpacity;
|
|
@@ -1143,7 +1143,7 @@ void main() {
|
|
|
1143
1143
|
|
|
1144
1144
|
gl_FragColor = vec4(gl_FragColor.rgb * baseColor, gl_FragColor.a * opacity * opacity);
|
|
1145
1145
|
}
|
|
1146
|
-
`,
|
|
1146
|
+
`,rh=function(n){ue(t,n);function t(e){e===void 0&&(e={});var r,i,a=n.call(this)||this,o=(r=e.color)!==null&&r!==void 0?r:16777215,s=(i=e.scale)!==null&&i!==void 0?i:1;return a.progress=0,a.opacity=0,a.loading=!1,a.current=!1,a.disabled=!1,a.currentMotion=new Se({progress:0}),a.tapMotion=new Se({scale:1,opacity:1}),a.loadingOpacityMotion=new Se({opacity:0}),a.progressMotion=new Se({progress:0}),a.progressOpacityMotion=new Se({opacity:0}),a.opacityMotion=new Se({opacity:0}),a.disableMotion=new Se({progress:0}),a.panoMesh=new c.Mesh($f,new c.ShaderMaterial({blending:c.CustomBlending,blendSrc:c.SrcAlphaFactor,blendDst:c.OneMinusSrcAlphaFactor,blendSrcAlpha:c.OneFactor,blendDstAlpha:c.OneMinusSrcAlphaFactor,depthWrite:!1,vertexShader:eh,fragmentShader:th,uniforms:{baseColor:{value:new c.Color(o)},circleScale:{value:1},circleOpacity:{value:1},loadingAngle:{value:0},loadingOpacity:{value:0},progress:{value:0},progressOpacity:{value:0},expand0:{value:0},expand1:{value:0},expandOpacity:{value:0},opacity:{value:0},tapScale:{value:1},tapOpacity:{value:1},disable:{value:0}}})),a.renderOrder=-2,a.panoMesh.renderOrder=-2,a.panoMesh.position.y=.004,a.panoMesh.scale.set(s,1,s),a.add(a.panoMesh),a.currentStartTime=Me(),a.needsRender=!0,a}return t.prototype.setProgress=function(e){var r=this;this.setDisabled(!1),this.setLoading(!1),this.progress!==e&&(e=he(e,0,1),this.tapMotion.ended&&(this.progress===0&&this.progressOpacityMotion.set({opacity:1},500).catch(z),e===0?this.progressOpacityMotion.set({opacity:0},500).catch(z).then(function(){r.progressMotion.set({progress:0},0).catch(z)}):this.progressMotion.set({progress:he(e*1.2,0,1)},100).catch(z)),this.progress=e)},t.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=he(e,0,1),this.opacityMotion.set({opacity:e},200).catch(z))},t.prototype.setCurrent=function(e){this.current!==e&&(this.currentMotion.set({progress:e?1:0},2e3).catch(z),this.current=e,this.current===!0&&(this.currentStartTime=Me()))},t.prototype.setLoading=function(e){this.loading!==e&&(this.loading=e,this.disabled===!0&&this.setDisabled(!1),this.loadingOpacityMotion.set({opacity:e?1:0},500).catch(z))},t.prototype.setDisabled=function(e){this.disabled!==e&&(this.disabled=e,this.loading===!0&&this.setLoading(!1),this.disableMotion.set({progress:e?1:0},500).catch(z))},t.prototype.tap=function(){var e=this;if(!this.tapMotion.ended)return Promise.resolve();var r=[{progress:0,value:{scale:1,opacity:1}},{progress:.3,value:{scale:.85,opacity:.5}},{progress:.8,value:{scale:1.05,opacity:.6}},{progress:1,value:{scale:1,opacity:1}}];return this.progressOpacityMotion.set({opacity:0},0).catch(z),this.progressMotion.set({progress:0},0).catch(z),this.tapMotion.setKeyframes(r,600).then(function(){e.progressOpacityMotion.set({opacity:e.progress>0?1:0},300).catch(z),e.progressMotion.set({progress:e.progress},120).catch(z)}).catch(z)},t.prototype.updateTime=function(e,r){if(!this.progressMotion.ended){this.progressMotion.update(e);var i=this.progressMotion.value.progress;this.panoMesh.material.uniforms.progress.value=i,this.needsRender=!0}if(!this.progressOpacityMotion.ended){this.progressOpacityMotion.update(e);var a=this.progressOpacityMotion.value.opacity;this.panoMesh.material.uniforms.progressOpacity.value=a,this.needsRender=!0}if(!this.opacityMotion.ended){this.opacityMotion.update(e);var a=this.opacityMotion.value.opacity;this.panoMesh.material.uniforms.opacity.value=a,this.needsRender=!0}if(this.visible=this.opacityMotion.value.opacity!==0,(!this.loadingOpacityMotion.ended||this.loadingOpacityMotion.value.opacity>0)&&(this.loadingOpacityMotion.update(e),this.panoMesh.material.uniforms.loadingOpacity.value=this.loadingOpacityMotion.value.opacity,this.panoMesh.material.uniforms.loadingAngle.value=e/120%(Math.PI*2),this.needsRender=!0),this.tapMotion.ended||(this.tapMotion.update(e),this.panoMesh.material.uniforms.tapOpacity.value=this.tapMotion.value.opacity,this.panoMesh.material.uniforms.tapScale.value=this.tapMotion.value.scale,this.needsRender=!0),this.panoMesh.material.uniforms.circleOpacity.value=Math.max(.6,1-Math.max(this.loadingOpacityMotion.value.opacity,this.progressOpacityMotion.value.opacity)),this.current||!this.currentMotion.ended){this.currentMotion.update(e),this.panoMesh.material.uniforms.expandOpacity.value=this.currentMotion.value.progress;{var o=(e-this.currentStartTime-1500)/2e3;if(o%5<2){var s=1+Math.sin(Math.PI*o)/25*this.currentMotion.value.progress;this.panoMesh.material.uniforms.circleScale.value=s,this.needsRender=!0}}{var l=(e-this.currentStartTime-1500)/2e3;if(l%5<2){var u=l%1;this.panoMesh.material.uniforms.expand0.value=Cs(u)*this.currentMotion.value.progress,this.needsRender=!0}}{var d=(e-this.currentStartTime-1e3)/2e3;if(d%5<2){var u=d%1;this.panoMesh.material.uniforms.expand1.value=Cs(u)*this.currentMotion.value.progress,this.needsRender=!0}}}if(!this.disableMotion.ended){var i=this.disableMotion.value.progress;this.disableMotion.update(e),this.panoMesh.material.uniforms.disable.value=i,this.needsRender=!0}},t.prototype.dispose=function(){this.tapMotion.dispose(),this.progressMotion.dispose(),this.progressOpacityMotion.dispose(),this.opacityMotion.dispose(),this.currentMotion.dispose(),this.panoMesh.material.dispose()},t}(c.Object3D),Ms=function(n){return n*(2-n)},nh=function(){var n=new Float32Array([-.18,0,-.18,.18,0,-.18,-.18,0,.18,.18,0,.18]),t=new Float32Array([1,0,0,0,1,1,0,1]),e=new Uint8Array([0,2,1,2,3,1]),r=new c.BufferGeometry;return r.setAttribute("position",new c.BufferAttribute(n,3)),r.setAttribute("uv",new c.BufferAttribute(t,2)),r.setIndex(new c.BufferAttribute(e,1)),r}(),ih=`
|
|
1147
1147
|
varying vec2 vUv;
|
|
1148
1148
|
#include <common>
|
|
1149
1149
|
#include <logdepthbuf_pars_vertex>
|
|
@@ -1152,7 +1152,7 @@ void main() {
|
|
|
1152
1152
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
1153
1153
|
#include <logdepthbuf_vertex>
|
|
1154
1154
|
}
|
|
1155
|
-
`,
|
|
1155
|
+
`,ah=`
|
|
1156
1156
|
#if defined(USE_MAP)
|
|
1157
1157
|
uniform sampler2D map;
|
|
1158
1158
|
uniform float mapAlpha;
|
|
@@ -1286,7 +1286,7 @@ void main() {
|
|
|
1286
1286
|
|
|
1287
1287
|
gl_FragColor = vec4(gl_FragColor.rgb, gl_FragColor.a * opacity);
|
|
1288
1288
|
}
|
|
1289
|
-
`,
|
|
1289
|
+
`,oh=function(n){ue(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,l,u,d=n.call(this)||this,f=(r=e.color)!==null&&r!==void 0?r:16777215,A=(i=e.scale)!==null&&i!==void 0?i:1,m=e.map,h=(a=e.mapAlpha)!==null&&a!==void 0?a:1,v=(o=e.mapUseColor)!==null&&o!==void 0?o:!1,y=(s=e.mapUseReverse)!==null&&s!==void 0?s:!1,p=(l=e.borderWidth)!==null&&l!==void 0?l:.1,g=(u=e.borderColor)!==null&&u!==void 0?u:16777215;return d.progress=0,d.opacity=0,d.loading=!1,d.current=!1,d.disabled=!1,d.currentMotion=new Se({progress:0}),d.tapMotion=new Se({scale:1,opacity:1}),d.loadingOpacityMotion=new Se({opacity:0}),d.progressMotion=new Se({progress:0}),d.progressOpacityMotion=new Se({opacity:0}),d.opacityMotion=new Se({opacity:0}),d.disableMotion=new Se({progress:0}),d.panoMesh=new c.Mesh(nh,new c.ShaderMaterial({blending:c.CustomBlending,blendSrc:c.SrcAlphaFactor,blendDst:c.OneMinusSrcAlphaFactor,blendSrcAlpha:c.OneFactor,blendDstAlpha:c.OneMinusSrcAlphaFactor,depthWrite:!1,vertexShader:ih,fragmentShader:ah,defines:{USE_COLOR:v,USE_MAP:m!==void 0,USE_BORDER:p>0,USE_REVERSE:y},uniforms:{baseColor:{value:new c.Color(f)},circleScale:{value:1},circleOpacity:{value:1},loadingAngle:{value:0},loadingOpacity:{value:0},progress:{value:0},progressOpacity:{value:0},expand0:{value:0},expand1:{value:0},expandOpacity:{value:0},opacity:{value:0},tapScale:{value:1},tapOpacity:{value:1},disable:{value:0},map:{value:m},mapAlpha:{value:h},borderWidth:{value:p},borderColor:{value:new c.Color(g)}}})),d.renderOrder=-2,d.panoMesh.renderOrder=-2,d.panoMesh.position.y=.004,d.panoMesh.scale.set(A,1,A),d.add(d.panoMesh),d.currentStartTime=Me(),d.needsRender=!0,d}return t.prototype.setProgress=function(e){var r=this;this.setDisabled(!1),this.setLoading(!1),this.progress!==e&&(e=he(e,0,1),this.tapMotion.ended&&(this.progress===0&&this.progressOpacityMotion.set({opacity:1},500).catch(z),e===0?this.progressOpacityMotion.set({opacity:0},500).catch(z).then(function(){r.progressMotion.set({progress:0},0).catch(z)}):this.progressMotion.set({progress:he(e*1.2,0,1)},100).catch(z)),this.progress=e)},t.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=he(e,0,1),this.opacityMotion.set({opacity:e},200).catch(z))},t.prototype.setCurrent=function(e){this.current!==e&&(this.currentMotion.set({progress:e?1:0},2e3).catch(z),this.current=e,this.current===!0&&(this.currentStartTime=Me()))},t.prototype.setLoading=function(e){this.loading!==e&&(this.loading=e,this.disabled===!0&&this.setDisabled(!1),this.loadingOpacityMotion.set({opacity:e?1:0},500).catch(z))},t.prototype.setDisabled=function(e){this.disabled!==e&&(this.disabled=e,this.loading===!0&&this.setLoading(!1),this.disableMotion.set({progress:e?1:0},500).catch(z))},t.prototype.tap=function(){var e=this;if(!this.tapMotion.ended)return Promise.resolve();var r=[{progress:0,value:{scale:1,opacity:1}},{progress:.3,value:{scale:.85,opacity:.5}},{progress:.8,value:{scale:1.05,opacity:.6}},{progress:1,value:{scale:1,opacity:1}}];return this.progressOpacityMotion.set({opacity:0},0).catch(z),this.progressMotion.set({progress:0},0).catch(z),this.tapMotion.setKeyframes(r,600).then(function(){e.progressOpacityMotion.set({opacity:e.progress>0?1:0},300).catch(z),e.progressMotion.set({progress:e.progress},120).catch(z)}).catch(z)},t.prototype.updateTime=function(e,r){if(!this.progressMotion.ended){this.progressMotion.update(e);var i=this.progressMotion.value.progress;this.panoMesh.material.uniforms.progress.value=i,this.needsRender=!0}if(!this.progressOpacityMotion.ended){this.progressOpacityMotion.update(e);var a=this.progressOpacityMotion.value.opacity;this.panoMesh.material.uniforms.progressOpacity.value=a,this.needsRender=!0}if(!this.opacityMotion.ended){this.opacityMotion.update(e);var a=this.opacityMotion.value.opacity;this.panoMesh.material.uniforms.opacity.value=a,this.needsRender=!0}if(this.visible=this.opacityMotion.value.opacity!==0,(!this.loadingOpacityMotion.ended||this.loadingOpacityMotion.value.opacity>0)&&(this.loadingOpacityMotion.update(e),this.panoMesh.material.uniforms.loadingOpacity.value=this.loadingOpacityMotion.value.opacity,this.panoMesh.material.uniforms.loadingAngle.value=e/120%(Math.PI*2),this.needsRender=!0),this.tapMotion.ended||(this.tapMotion.update(e),this.panoMesh.material.uniforms.tapOpacity.value=this.tapMotion.value.opacity,this.panoMesh.material.uniforms.tapScale.value=this.tapMotion.value.scale,this.needsRender=!0),this.panoMesh.material.uniforms.circleOpacity.value=Math.max(.6,1-Math.max(this.loadingOpacityMotion.value.opacity,this.progressOpacityMotion.value.opacity)),this.current||!this.currentMotion.ended){this.currentMotion.update(e),this.panoMesh.material.uniforms.expandOpacity.value=this.currentMotion.value.progress;{var o=(e-this.currentStartTime-1500)/2e3;if(o%5<2){var s=o%1;this.panoMesh.material.uniforms.expand0.value=Ms(s)*this.currentMotion.value.progress,this.needsRender=!0}}{var l=(e-this.currentStartTime-1e3)/2e3;if(l%5<2){var s=l%1;this.panoMesh.material.uniforms.expand1.value=Ms(s)*this.currentMotion.value.progress,this.needsRender=!0}}}if(!this.disableMotion.ended){var i=this.disableMotion.value.progress;this.disableMotion.update(e),this.panoMesh.material.uniforms.disable.value=i,this.needsRender=!0}},t.prototype.dispose=function(){this.tapMotion.dispose(),this.progressMotion.dispose(),this.progressOpacityMotion.dispose(),this.opacityMotion.dispose(),this.currentMotion.dispose(),this.panoMesh.material.dispose()},t}(c.Object3D),sh=new c.CircleBufferGeometry(.1,16),uh=`
|
|
1290
1290
|
varying vec2 vUv;
|
|
1291
1291
|
#include <common>
|
|
1292
1292
|
#include <logdepthbuf_pars_vertex>
|
|
@@ -1295,7 +1295,7 @@ void main() {
|
|
|
1295
1295
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
1296
1296
|
#include <logdepthbuf_vertex>
|
|
1297
1297
|
}
|
|
1298
|
-
`,
|
|
1298
|
+
`,lh=`
|
|
1299
1299
|
varying vec2 vUv;
|
|
1300
1300
|
#include <common>
|
|
1301
1301
|
#include <logdepthbuf_pars_fragment>
|
|
@@ -1319,34 +1319,34 @@ void main() {
|
|
|
1319
1319
|
|
|
1320
1320
|
gl_FragColor = vec4(gl_FragColor.rgb, gl_FragColor.a * outside * inside);
|
|
1321
1321
|
}
|
|
1322
|
-
`,
|
|
1322
|
+
`,ch=new c.ShaderMaterial({vertexShader:uh,fragmentShader:lh,side:c.DoubleSide,blending:c.CustomBlending,blendSrc:c.SrcAlphaFactor,blendDst:c.OneMinusSrcAlphaFactor,blendSrcAlpha:c.OneFactor,blendDstAlpha:c.OneMinusSrcAlphaFactor,depthWrite:!1}),Li=function(n){ue(t,n);function t(){var e=n.call(this)||this;return e.ringMesh=new c.Mesh(sh,ch),e.ringMesh.position.z=.01,e.ringMesh.renderOrder=-2,e.add(e.ringMesh),e}return t.prototype.dispose=function(){this.remove(this.ringMesh)},t}(c.Object3D);function Nr(){return((1+Math.random())*65536|0).toString(16).substring(1)}function wt(){return(Nr()+Nr()+"-"+Nr()+"-4"+Nr().substr(0,3)+"-"+Nr()+"-"+Nr()+Nr()+Nr()).toLowerCase()}function On(n,t,e){var r=Math.abs(n-t);return r<.001||typeof e!="undefined"&&Math.abs(e-r)<.001}function Xt(n,t,e){return!On(n,t,e)}function Zn(n,t){return n.distanceTo(t)<.001}function za(n,t){return!Zn(n,t)}var hu=new c.Vector3(0,0,0),dh=function(n){ue(t,n);function t(e,r){r===void 0&&(r=hu);var i=n.call(this)||this,a=new c.BoxBufferGeometry(e.max.x-e.min.x+r.x*2,e.max.y-e.min.y+r.y*2,e.max.z-e.min.z+r.z*2,1,1);a.clearGroups(),a.addGroup(0,a.index?a.index.count:a.attributes.position.count,0),a.applyMatrix4(new c.Matrix4().makeScale(-1,1,1)),a.computeVertexNormals();var o=new Tn("none");o.depthWrite=!1;var s=new Vt(a,[o]);return s.position.copy(e.getCenter(new c.Vector3)),s.frustumCulled=!1,i.add(s),i.boundingBox=new c.Box3,i.boundingBox.setFromObject(i),i.renderOrder=s.renderOrder=-1001,i}return t}(v0);function fh(n,t){return t===void 0&&(t=hu),new dh(n,t)}function hh(n,t){var e=new c.Vector3(0,0,-1);e.applyQuaternion(n.quaternion);var r=t.quaternion.clone().inverse();e.applyQuaternion(r);var i=Math.atan2(e.x,-e.z),a=-Math.asin(e.y);return{theta:i,phi:a,lookAtVector:e}}var oi=Math.PI*2;function Kr(n){return n>=0&&n<oi?n:(n%oi+oi)%oi}var Qa=Math.PI,Ss=Qa*2;function la(n,t,e){if(n===t)return t;var r=t-n,i=Math.abs(r);if(i<=e)return t;var a=r>0?1:-1;return n+a*e}function ph(n,t,e){if(n.equals(t))return new c.Vector3().copy(t);var r=new c.Vector3().subVectors(t,n);return r.lengthSq()<e*e?r.copy(t):r.setLength(e).add(n)}function Is(n,t,e){if(n.longitude===t.longitude&&n.latitude===t.latitude)return{longitude:t.longitude,latitude:t.latitude};var r=Kr(n.longitude),i=n.latitude,a=Kr(t.longitude),o=t.latitude;a-r>Qa?r+=Ss:r-a>Qa&&(r-=Ss);var s=Math.sqrt(Math.pow(a-r,2)+Math.pow(o-i,2)),l=e/s;return l>=1?{longitude:t.longitude,latitude:t.latitude}:{longitude:r+(a-r)*l,latitude:i+(o-i)*l}}function vh(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}(function(){try{var n=document.createElement("canvas");return!!(window.WebGLRenderingContext&&(n.getContext("webgl")||n.getContext("experimental-webgl")))}catch(t){return!1}})();var Vn=function(){var n=typeof navigator!="undefined"?navigator.userAgent.toLowerCase():"node";return/android/i.test(n)||/webos/i.test(n)||/ipad|iphone|ipod/i.test(n)||/iemobile/i.test(n)||/opera mini/i.test(n)||/blackberry/i.test(n)||/windows phone/i.test(n)};function W(n,t){for(var e=!1,r={type:n,timeStamp:Me(),get defaultPrevented(){return e},preventDefault:function(){e=!0}},i=0,a=Object.keys(t);i<a.length;i++){var o=a[i];o in r||(r[o]=t[o])}return r}function Ah(){return typeof location=="undefined"||location.protocol!=="https:"?Promise.reject(new Error("Request DeviceOrientation Permission denied.")):typeof DeviceOrientationEvent!="undefined"&&typeof DeviceOrientationEvent.requestPermission=="function"?DeviceOrientationEvent.requestPermission().then(function(n){if(n=="granted")return Promise.resolve();var t=new Error("Request DeviceOrientation Permission denied.");return Promise.reject(t)}):Promise.resolve()}function mh(){if("xr"in navigator)return navigator.xr.isSessionSupported("immersive-vr").then(function(t){return t?Promise.resolve():Promise.reject()}).then(function(){var t={optionalFeatures:["local-floor"]};return navigator.xr.requestSession("immersive-vr",t).then(function(e){return Promise.resolve(e)})});var n=new Error("Request XR Permission denied.");return Promise.reject(n)}function ar(n,t){n.mode=t.mode,n.workCode=t.workCode,n.panoIndex=t.panoIndex,n.longitude=t.longitude,n.latitude=t.latitude,n.fov=t.fov,n.offset.copy(t.offset),n.distance=t.distance}function Dr(n,t){return n.workCode===t.workCode&&n.mode===t.mode&&n.panoIndex===t.panoIndex&&On(n.longitude,t.longitude,Math.PI*2)&&On(n.latitude,t.latitude)&&On(n.fov,t.fov)&&Zn(n.offset,t.offset)&&On(n.distance,t.distance)}var gh=function(n){return Number(n)};function ur(n,t,e){var r;t===void 0&&(t=gh),e===void 0&&(e=!1);for(var i,a=1/0,o=0,s=n;o<s.length;o++){var l=s[o],u=t(l);u<=a&&(r=[l,u],i=r[0],a=r[1])}return isFinite(a)||(a=0),e?[i,a]:i}function Nt(n){for(var t in n)return!1;return!0}function _e(n){return{longitude:n.longitude,latitude:n.latitude,fov:n.fov,offset:n.offset.clone(),distance:n.distance}}/*! Hammer.JS - v2.0.7 - 2016-04-22
|
|
1323
1323
|
* http://hammerjs.github.io/
|
|
1324
1324
|
*
|
|
1325
1325
|
* Copyright (c) 2016 Jorik Tangelder;
|
|
1326
1326
|
* Licensed under the MIT license */var Nn=function(n,t,e,r){var i=["","webkit","Moz","MS","ms","o"],a=t.createElement?t.createElement("div"):r,o="function",s=Math.round,l=Math.abs,u=Date.now;function d(I,R,V){return setTimeout(g(I,V),R)}function f(I,R,V){return Array.isArray(I)?(A(I,V[R],V),!0):!1}function A(I,R,V){var q;if(I)if(I.forEach)I.forEach(R,V);else if(I.length!==r)for(q=0;q<I.length;)R.call(V,I[q],q,I),q++;else for(q in I)I.hasOwnProperty(q)&&R.call(V,I[q],q,I)}function m(I,R,V){var q="DEPRECATED METHOD: "+R+`
|
|
1327
1327
|
`+V+` AT
|
|
1328
|
-
`;return function(){var _=new Error("get-stack-trace"),le=_&&_.stack?_.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",Te=n.console&&(n.console.warn||n.console.log);return Te&&Te.call(n.console,q,le),I.apply(this,arguments)}}var h;typeof Object.assign!="function"?h=function(R){if(R===r||R===null)throw new TypeError("Cannot convert undefined or null to object");for(var V=Object(R),q=1;q<arguments.length;q++){var _=arguments[q];if(_!==r&&_!==null)for(var le in _)_.hasOwnProperty(le)&&(V[le]=_[le])}return V}:h=Object.assign;var v=m(function(R,V,q){for(var _=Object.keys(V),le=0;le<_.length;)(!q||q&&R[_[le]]===r)&&(R[_[le]]=V[_[le]]),le++;return R},"extend","Use `assign`."),y=m(function(R,V){return v(R,V,!0)},"merge","Use `assign`.");function p(I,R,V){var q=R.prototype,_;_=I.prototype=Object.create(q),_.constructor=I,_._super=q,V&&h(_,V)}function g(I,R){return function(){return I.apply(R,arguments)}}function x(I,R){return typeof I==o?I.apply(R&&R[0]||r,R):I}function b(I,R){return I===r?R:I}function w(I,R,V){A(P(R),function(q){I.addEventListener(q,V,!1)})}function E(I,R,V){A(P(R),function(q){I.removeEventListener(q,V,!1)})}function M(I,R){for(;I;){if(I==R)return!0;I=I.parentNode}return!1}function C(I,R){return I.indexOf(R)>-1}function P(I){return I.trim().split(/\s+/g)}function S(I,R,V){if(I.indexOf&&!V)return I.indexOf(R);for(var q=0;q<I.length;){if(V&&I[q][V]==R||!V&&I[q]===R)return q;q++}return-1}function T(I){return Array.prototype.slice.call(I,0)}function B(I,R,V){for(var q=[],_=[],le=0;le<I.length;){var Te=I[le][R];S(_,Te)<0&&q.push(I[le]),_[le]=Te,le++}return q=q.sort(function(gt,Je){return gt[R]>Je[R]}),q}function L(I,R){for(var V,q,_=R[0].toUpperCase()+R.slice(1),le=0;le<i.length;){if(V=i[le],q=V?V+_:R,q in I)return q;le++}return r}var k=1;function O(){return k++}function D(I){var R=I.ownerDocument||I;return R.defaultView||R.parentWindow||n}var N=/mobile|tablet|ip(ad|hone|od)|android/i,X="ontouchstart"in n,K=L(n,"PointerEvent")!==r,Q=X&&N.test(navigator.userAgent),G="touch",J="pen",H="mouse",j="kinect",Z=25,Y=1,pe=2,ee=4,oe=8,ie=1,ce=2,ne=4,ae=8,de=16,ve=ce|ne,xe=ae|de,Ce=ve|xe,Be=["x","y"],$=["clientX","clientY"];function te(I,R){var V=this;this.manager=I,this.callback=R,this.element=I.element,this.target=I.options.inputTarget,this.domHandler=function(q){x(I.options.enable,[I])&&V.handler(q)},this.init()}te.prototype={handler:function(){},init:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(D(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(D(this.element),this.evWin,this.domHandler)}};function U(I){var R,V=I.options.inputClass;return V?R=V:K?R=er:Q?R=At:X?R=Et:R=ot,new R(I,Le)}function Le(I,R,V){var q=V.pointers.length,_=V.changedPointers.length,le=R&Y&&q-_===0,Te=R&(ee|oe)&&q-_===0;V.isFirst=!!le,V.isFinal=!!Te,le&&(I.session={}),V.eventType=R,Pe(I,V),I.emit("hammer.input",V),I.recognize(V),I.session.prevInput=V}function Pe(I,R){var V=I.session,q=R.pointers,_=q.length;V.firstInput||(V.firstInput=be(R)),_>1&&!V.firstMultiple?V.firstMultiple=be(R):_===1&&(V.firstMultiple=!1);var le=V.firstInput,Te=V.firstMultiple,et=Te?Te.center:le.center,gt=R.center=ye(q);R.timeStamp=u(),R.deltaTime=R.timeStamp-le.timeStamp,R.angle=Ne(et,gt),R.distance=Ae(et,gt),Ie(V,R),R.offsetDirection=me(R.deltaX,R.deltaY);var Je=ge(R.deltaTime,R.deltaX,R.deltaY);R.overallVelocityX=Je.x,R.overallVelocityY=Je.y,R.overallVelocity=l(Je.x)>l(Je.y)?Je.x:Je.y,R.scale=Te?je(Te.pointers,q):1,R.rotation=Te?ze(Te.pointers,q):0,R.maxPointers=V.prevInput?R.pointers.length>V.prevInput.maxPointers?R.pointers.length:V.prevInput.maxPointers:R.pointers.length,Qe(V,R);var nr=I.element;M(R.srcEvent.target,nr)&&(nr=R.srcEvent.target),R.target=nr}function Ie(I,R){var V=R.center,q=I.offsetDelta||{},_=I.prevDelta||{},le=I.prevInput||{};(R.eventType===Y||le.eventType===ee)&&(_=I.prevDelta={x:le.deltaX||0,y:le.deltaY||0},q=I.offsetDelta={x:V.x,y:V.y}),R.deltaX=_.x+(V.x-q.x),R.deltaY=_.y+(V.y-q.y)}function Qe(I,R){var V=I.lastInterval||R,q=R.timeStamp-V.timeStamp,_,le,Te,et;if(R.eventType!=oe&&(q>Z||V.velocity===r)){var gt=R.deltaX-V.deltaX,Je=R.deltaY-V.deltaY,nr=ge(q,gt,Je);le=nr.x,Te=nr.y,_=l(nr.x)>l(nr.y)?nr.x:nr.y,et=me(gt,Je),I.lastInterval=R}else _=V.velocity,le=V.velocityX,Te=V.velocityY,et=V.direction;R.velocity=_,R.velocityX=le,R.velocityY=Te,R.direction=et}function be(I){for(var R=[],V=0;V<I.pointers.length;)R[V]={clientX:s(I.pointers[V].clientX),clientY:s(I.pointers[V].clientY)},V++;return{timeStamp:u(),pointers:R,center:ye(R),deltaX:I.deltaX,deltaY:I.deltaY}}function ye(I){var R=I.length;if(R===1)return{x:s(I[0].clientX),y:s(I[0].clientY)};for(var V=0,q=0,_=0;_<R;)V+=I[_].clientX,q+=I[_].clientY,_++;return{x:s(V/R),y:s(q/R)}}function ge(I,R,V){return{x:R/I||0,y:V/I||0}}function me(I,R){return I===R?ie:l(I)>=l(R)?I<0?ce:ne:R<0?ae:de}function Ae(I,R,V){V||(V=Be);var q=R[V[0]]-I[V[0]],_=R[V[1]]-I[V[1]];return Math.sqrt(q*q+_*_)}function Ne(I,R,V){V||(V=Be);var q=R[V[0]]-I[V[0]],_=R[V[1]]-I[V[1]];return Math.atan2(_,q)*180/Math.PI}function ze(I,R){return Ne(R[1],R[0],$)+Ne(I[1],I[0],$)}function je(I,R){return Ae(R[0],R[1],$)/Ae(I[0],I[1],$)}var cr={mousedown:Y,mousemove:pe,mouseup:ee},Fe="mousedown",Ye="mousemove mouseup";function ot(){this.evEl=Fe,this.evWin=Ye,this.pressed=!1,te.apply(this,arguments)}p(ot,te,{handler:function(R){var V=cr[R.type];V&Y&&(R.button===0||R.button===2)&&(this.pressed=!0),V&pe&&R.which!==1&&(V=ee),this.pressed&&(V&ee&&(this.pressed=!1),this.callback(this.manager,V,{pointers:[R],changedPointers:[R],pointerType:H,srcEvent:R}))}});var Yt={pointerdown:Y,pointermove:pe,pointerup:ee,pointercancel:oe,pointerout:oe},on={2:G,3:J,4:H,5:j},$t="pointerdown",St="pointermove pointerup pointercancel";n.MSPointerEvent&&!n.PointerEvent&&($t="MSPointerDown",St="MSPointerMove MSPointerUp MSPointerCancel");function er(){this.evEl=$t,this.evWin=St,te.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}p(er,te,{handler:function(R){var V=this.store,q=!1,_=!1,le=R.type.toLowerCase().replace("ms",""),Te=Yt[le],et=on[R.pointerType]||R.pointerType,gt=et==G,Je=S(V,R.pointerId,"pointerId");Te&Y&&(R.button===0||R.button===2||gt)?Je<0&&(V.push(R),Je=V.length-1):Te&(ee|oe)?q=!0:!gt&&R.buttons===0&&(q=!0,_=!0,Te=Yt.pointerup),!(Je<0)&&(_||(V[Je]=R),this.callback(this.manager,Te,{pointers:V,changedPointers:[R],pointerType:et,srcEvent:V[Je]}),q&&V.splice(Je,1))}});var Mr={touchstart:Y,touchmove:pe,touchend:ee,touchcancel:oe},Dt="touchstart",tr="touchstart touchmove touchend touchcancel";function zt(){this.evTarget=Dt,this.evWin=tr,this.started=!1,te.apply(this,arguments)}p(zt,te,{handler:function(R){var V=Mr[R.type];if(V===Y&&(this.started=!0),!!this.started){var q=lt.call(this,R,V);V&(ee|oe)&&q[0].length-q[1].length===0&&(this.started=!1),this.callback(this.manager,V,{pointers:q[0],changedPointers:q[1],pointerType:G,srcEvent:R})}}});function lt(I,R){var V=T(I.touches),q=T(I.changedTouches);return R&(ee|oe)&&(V=B(V.concat(q),"identifier")),[V,q]}var Oe={touchstart:Y,touchmove:pe,touchend:ee,touchcancel:oe},dr="touchstart touchmove touchend touchcancel";function At(){this.evTarget=dr,this.targetIds={},te.apply(this,arguments)}p(At,te,{handler:function(R){var V=Oe[R.type],q=fr.call(this,R,V);q&&this.callback(this.manager,V,{pointers:q[0],changedPointers:q[1],pointerType:G,srcEvent:R})}});function fr(I,R){var V=T(I.touches),q=this.targetIds;if(R&(Y|pe)&&V.length===1)return q[V[0].identifier]=!0,[V,V];var _,le,Te=T(I.changedTouches),et=[],gt=this.target;if(le=V.filter(function(Je){return M(Je.target,gt)}),R===Y)for(_=0;_<le.length;)q[le[_].identifier]=!0,_++;for(_=0;_<Te.length;)q[Te[_].identifier]&&et.push(Te[_]),R&(ee|oe)&&delete q[Te[_].identifier],_++;if(et.length)return[B(le.concat(et),"identifier"),et]}var hr=2500,Qt=25;function Et(){te.apply(this,arguments);var I=g(this.handler,this);this.touch=new At(this.manager,I),this.mouse=new ot(this.manager,I),this.primaryTouch=null,this.lastTouches=[]}p(Et,te,{handler:function(R,V,q){var _=q.pointerType==G,le=q.pointerType==H;if(!(le&&q.sourceCapabilities&&q.sourceCapabilities.firesTouchEvents)){if(_)pr.call(this,V,q);else if(le&&sn.call(this,q))return;this.callback(R,V,q)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function pr(I,R){I&Y?(this.primaryTouch=R.changedPointers[0].identifier,Sr.call(this,R)):I&(ee|oe)&&Sr.call(this,R)}function Sr(I){var R=I.changedPointers[0];if(R.identifier===this.primaryTouch){var V={x:R.clientX,y:R.clientY};this.lastTouches.push(V);var q=this.lastTouches,_=function(){var le=q.indexOf(V);le>-1&&q.splice(le,1)};setTimeout(_,hr)}}function sn(I){for(var R=I.srcEvent.clientX,V=I.srcEvent.clientY,q=0;q<this.lastTouches.length;q++){var _=this.lastTouches[q],le=Math.abs(R-_.x),Te=Math.abs(V-_.y);if(le<=Qt&&Te<=Qt)return!0}return!1}var jr=a?L(a.style,"touchAction"):r,Jr=jr!==r,Ut="compute",$e="auto",Ge="manipulation",nt="none",mt="pan-x",ct="pan-y",qt=Ou();function Ir(I,R){this.manager=I,this.set(R)}Ir.prototype={set:function(I){I==Ut&&(I=this.compute()),Jr&&this.manager.element.style&&qt[I]&&(this.manager.element.style[jr]=I),this.actions=I.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var I=[];return A(this.manager.recognizers,function(R){x(R.options.enable,[R])&&(I=I.concat(R.getTouchAction()))}),Wr(I.join(" "))},preventDefaults:function(I){var R=I.srcEvent,V=I.offsetDirection;if(this.manager.session.prevented){R.preventDefault();return}var q=this.actions,_=C(q,nt)&&!qt[nt],le=C(q,ct)&&!qt[ct],Te=C(q,mt)&&!qt[mt];if(_){var et=I.pointers.length===1,gt=I.distance<2,Je=I.deltaTime<250;if(et&>&&Je)return}if(!(Te&&le)&&(_||le&&V&ve||Te&&V&xe))return this.preventSrc(R)},preventSrc:function(I){this.manager.session.prevented=!0,I.preventDefault()}};function Wr(I){if(C(I,nt))return nt;var R=C(I,mt),V=C(I,ct);return R&&V?nt:R||V?R?mt:ct:C(I,Ge)?Ge:$e}function Ou(){if(!Jr)return!1;var I={},R=n.CSS&&n.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(V){I[V]=R?n.CSS.supports("touch-action",V):!0}),I}var $n=1,It=2,un=4,Tr=8,vr=Tr,Pn=16,rr=32;function Ar(I){this.options=h({},this.defaults,I||{}),this.id=O(),this.manager=null,this.options.enable=b(this.options.enable,!0),this.state=$n,this.simultaneous={},this.requireFail=[]}Ar.prototype={defaults:{},set:function(I){return h(this.options,I),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(I){if(f(I,"recognizeWith",this))return this;var R=this.simultaneous;return I=ei(I,this),R[I.id]||(R[I.id]=I,I.recognizeWith(this)),this},dropRecognizeWith:function(I){return f(I,"dropRecognizeWith",this)?this:(I=ei(I,this),delete this.simultaneous[I.id],this)},requireFailure:function(I){if(f(I,"requireFailure",this))return this;var R=this.requireFail;return I=ei(I,this),S(R,I)===-1&&(R.push(I),I.requireFailure(this)),this},dropRequireFailure:function(I){if(f(I,"dropRequireFailure",this))return this;I=ei(I,this);var R=S(this.requireFail,I);return R>-1&&this.requireFail.splice(R,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(I){return!!this.simultaneous[I.id]},emit:function(I){var R=this,V=this.state;function q(_){R.manager.emit(_,I)}V<Tr&&q(R.options.event+wo(V)),q(R.options.event),I.additionalEvent&&q(I.additionalEvent),V>=Tr&&q(R.options.event+wo(V))},tryEmit:function(I){if(this.canEmit())return this.emit(I);this.state=rr},canEmit:function(){for(var I=0;I<this.requireFail.length;){if(!(this.requireFail[I].state&(rr|$n)))return!1;I++}return!0},recognize:function(I){var R=h({},I);if(!x(this.options.enable,[this,R])){this.reset(),this.state=rr;return}this.state&(vr|Pn|rr)&&(this.state=$n),this.state=this.process(R),this.state&(It|un|Tr|Pn)&&this.tryEmit(R)},process:function(I){},getTouchAction:function(){},reset:function(){}};function wo(I){return I&Pn?"cancel":I&Tr?"end":I&un?"move":I&It?"start":""}function Eo(I){return I==de?"down":I==ae?"up":I==ce?"left":I==ne?"right":""}function ei(I,R){var V=R.manager;return V?V.get(I):I}function Ht(){Ar.apply(this,arguments)}p(Ht,Ar,{defaults:{pointers:1},attrTest:function(I){var R=this.options.pointers;return R===0||I.pointers.length===R},process:function(I){var R=this.state,V=I.eventType,q=R&(It|un),_=this.attrTest(I);return q&&(V&oe||!_)?R|Pn:q||_?V&ee?R|Tr:R&It?R|un:It:rr}});function ti(){Ht.apply(this,arguments),this.pX=null,this.pY=null}p(ti,Ht,{defaults:{event:"pan",threshold:10,pointers:1,direction:Ce},getTouchAction:function(){var I=this.options.direction,R=[];return I&ve&&R.push(ct),I&xe&&R.push(mt),R},directionTest:function(I){var R=this.options,V=!0,q=I.distance,_=I.direction,le=I.deltaX,Te=I.deltaY;return _&R.direction||(R.direction&ve?(_=le===0?ie:le<0?ce:ne,V=le!=this.pX,q=Math.abs(I.deltaX)):(_=Te===0?ie:Te<0?ae:de,V=Te!=this.pY,q=Math.abs(I.deltaY))),I.direction=_,V&&q>R.threshold&&_&R.direction},attrTest:function(I){return Ht.prototype.attrTest.call(this,I)&&(this.state&It||!(this.state&It)&&this.directionTest(I))},emit:function(I){this.pX=I.deltaX,this.pY=I.deltaY;var R=Eo(I.direction);R&&(I.additionalEvent=this.options.event+R),this._super.emit.call(this,I)}});function Di(){Ht.apply(this,arguments)}p(Di,Ht,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[nt]},attrTest:function(I){return this._super.attrTest.call(this,I)&&(Math.abs(I.scale-1)>this.options.threshold||this.state&It)},emit:function(I){if(I.scale!==1){var R=I.scale<1?"in":"out";I.additionalEvent=this.options.event+R}this._super.emit.call(this,I)}});function zi(){Ar.apply(this,arguments),this._timer=null,this._input=null}p(zi,Ar,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[$e]},process:function(I){var R=this.options,V=I.pointers.length===R.pointers,q=I.distance<R.threshold,_=I.deltaTime>R.time;if(this._input=I,!q||!V||I.eventType&(ee|oe)&&!_)this.reset();else if(I.eventType&Y)this.reset(),this._timer=d(function(){this.state=vr,this.tryEmit()},R.time,this);else if(I.eventType&ee)return vr;return rr},reset:function(){clearTimeout(this._timer)},emit:function(I){this.state===vr&&(I&&I.eventType&ee?this.manager.emit(this.options.event+"up",I):(this._input.timeStamp=u(),this.manager.emit(this.options.event,this._input)))}});function Qi(){Ht.apply(this,arguments)}p(Qi,Ht,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[nt]},attrTest:function(I){return this._super.attrTest.call(this,I)&&(Math.abs(I.rotation)>this.options.threshold||this.state&It)}});function Ui(){Ht.apply(this,arguments)}p(Ui,Ht,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:ve|xe,pointers:1},getTouchAction:function(){return ti.prototype.getTouchAction.call(this)},attrTest:function(I){var R=this.options.direction,V;return R&(ve|xe)?V=I.overallVelocity:R&ve?V=I.overallVelocityX:R&xe&&(V=I.overallVelocityY),this._super.attrTest.call(this,I)&&R&I.offsetDirection&&I.distance>this.options.threshold&&I.maxPointers==this.options.pointers&&l(V)>this.options.velocity&&I.eventType&ee},emit:function(I){var R=Eo(I.offsetDirection);R&&this.manager.emit(this.options.event+R,I),this.manager.emit(this.options.event,I)}});function ri(){Ar.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}p(ri,Ar,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Ge]},process:function(I){var R=this.options,V=I.pointers.length===R.pointers,q=I.distance<R.threshold,_=I.deltaTime<R.time;if(this.reset(),I.eventType&Y&&this.count===0)return this.failTimeout();if(q&&_&&V){if(I.eventType!=ee)return this.failTimeout();var le=this.pTime?I.timeStamp-this.pTime<R.interval:!0,Te=!this.pCenter||Ae(this.pCenter,I.center)<R.posThreshold;this.pTime=I.timeStamp,this.pCenter=I.center,!Te||!le?this.count=1:this.count+=1,this._input=I;var et=this.count%R.taps;if(et===0)return this.hasRequireFailures()?(this._timer=d(function(){this.state=vr,this.tryEmit()},R.interval,this),It):vr}return rr},failTimeout:function(){return this._timer=d(function(){this.state=rr},this.options.interval,this),rr},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==vr&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function ln(I,R){return R=R||{},R.recognizers=b(R.recognizers,ln.defaults.preset),new qi(I,R)}ln.VERSION="2.0.7",ln.defaults={domEvents:!1,touchAction:Ut,enable:!0,inputTarget:null,inputClass:null,preset:[[Qi,{enable:!1}],[Di,{enable:!1},["rotate"]],[Ui,{direction:ve}],[ti,{direction:ve},["swipe"]],[ri],[ri,{event:"doubletap",taps:2},["tap"]],[zi]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Vu=1,Co=2;function qi(I,R){this.options=h({},ln.defaults,R||{}),this.options.inputTarget=this.options.inputTarget||I,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=I,this.input=U(this),this.touchAction=new Ir(this,this.options.touchAction),Mo(this,!0),A(this.options.recognizers,function(V){var q=this.add(new V[0](V[1]));V[2]&&q.recognizeWith(V[2]),V[3]&&q.requireFailure(V[3])},this)}qi.prototype={set:function(I){return h(this.options,I),I.touchAction&&this.touchAction.update(),I.inputTarget&&(this.input.destroy(),this.input.target=I.inputTarget,this.input.init()),this},stop:function(I){this.session.stopped=I?Co:Vu},recognize:function(I){var R=this.session;if(!R.stopped){this.touchAction.preventDefaults(I);var V,q=this.recognizers,_=R.curRecognizer;(!_||_&&_.state&vr)&&(_=R.curRecognizer=null);for(var le=0;le<q.length;)V=q[le],R.stopped!==Co&&(!_||V==_||V.canRecognizeWith(_))?V.recognize(I):V.reset(),!_&&V.state&(It|un|Tr)&&(_=R.curRecognizer=V),le++}},get:function(I){if(I instanceof Ar)return I;for(var R=this.recognizers,V=0;V<R.length;V++)if(R[V].options.event==I)return R[V];return null},add:function(I){if(f(I,"add",this))return this;var R=this.get(I.options.event);return R&&this.remove(R),this.recognizers.push(I),I.manager=this,this.touchAction.update(),I},remove:function(I){if(f(I,"remove",this))return this;if(I=this.get(I),I){var R=this.recognizers,V=S(R,I);V!==-1&&(R.splice(V,1),this.touchAction.update())}return this},on:function(I,R){if(I!==r&&R!==r){var V=this.handlers;return A(P(I),function(q){V[q]=V[q]||[],V[q].push(R)}),this}},off:function(I,R){if(I!==r){var V=this.handlers;return A(P(I),function(q){R?V[q]&&V[q].splice(S(V[q],R),1):delete V[q]}),this}},emit:function(I,R){this.options.domEvents&&Nu(I,R);var V=this.handlers[I]&&this.handlers[I].slice();if(!(!V||!V.length)){R.type=I,R.preventDefault=function(){R.srcEvent.preventDefault()};for(var q=0;q<V.length;)V[q](R),q++}},destroy:function(){this.element&&Mo(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function Mo(I,R){var V=I.element;if(V.style){var q;A(I.options.cssProps,function(_,le){q=L(V.style,le),R?(I.oldCssProps[q]=V.style[q],V.style[q]=_):V.style[q]=I.oldCssProps[q]||""}),R||(I.oldCssProps={})}}function Nu(I,R){var V=t.createEvent("Event");V.initEvent(I,!0,!0),V.gesture=R,R.target.dispatchEvent(V)}return h(ln,{INPUT_START:Y,INPUT_MOVE:pe,INPUT_END:ee,INPUT_CANCEL:oe,STATE_POSSIBLE:$n,STATE_BEGAN:It,STATE_CHANGED:un,STATE_ENDED:Tr,STATE_RECOGNIZED:vr,STATE_CANCELLED:Pn,STATE_FAILED:rr,DIRECTION_NONE:ie,DIRECTION_LEFT:ce,DIRECTION_RIGHT:ne,DIRECTION_UP:ae,DIRECTION_DOWN:de,DIRECTION_HORIZONTAL:ve,DIRECTION_VERTICAL:xe,DIRECTION_ALL:Ce,Manager:qi,Input:te,TouchAction:Ir,TouchInput:At,MouseInput:ot,PointerEventInput:er,TouchMouseInput:Et,SingleTouchInput:zt,Recognizer:Ar,AttrRecognizer:Ht,Tap:ri,Pan:ti,Swipe:Ui,Pinch:Di,Rotate:Qi,Press:zi,on:w,off:E,each:A,merge:y,extend:v,assign:h,inherit:p,bindFn:g,prefixed:L}),ln}(typeof window!="undefined"?window:{},typeof document!="undefined"?document:{});function Is(n,t,e){var r=t.getBoundingClientRect(),i=r.top,a=r.left,o=r.width,s=r.height;return e&&(a=a+o*e.left,i=i+s*(1-e.bottom-e.height),o=o*e.width,s=s*e.height),new c.Vector2((n.x-a)/o*2-1,-(n.y-i)/s*2+1)}var hu=new c.OrthographicCamera(-1,1,1,-1,0,1),lo=new c.BufferGeometry;lo.setAttribute("position",new c.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));lo.setAttribute("uv",new c.Float32BufferAttribute([0,2,0,0,2,0],2));var tn=new c.Mesh(lo),co=new c.Scene;co.add(tn);var gh=`
|
|
1328
|
+
`;return function(){var _=new Error("get-stack-trace"),le=_&&_.stack?_.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",Te=n.console&&(n.console.warn||n.console.log);return Te&&Te.call(n.console,q,le),I.apply(this,arguments)}}var h;typeof Object.assign!="function"?h=function(R){if(R===r||R===null)throw new TypeError("Cannot convert undefined or null to object");for(var V=Object(R),q=1;q<arguments.length;q++){var _=arguments[q];if(_!==r&&_!==null)for(var le in _)_.hasOwnProperty(le)&&(V[le]=_[le])}return V}:h=Object.assign;var v=m(function(R,V,q){for(var _=Object.keys(V),le=0;le<_.length;)(!q||q&&R[_[le]]===r)&&(R[_[le]]=V[_[le]]),le++;return R},"extend","Use `assign`."),y=m(function(R,V){return v(R,V,!0)},"merge","Use `assign`.");function p(I,R,V){var q=R.prototype,_;_=I.prototype=Object.create(q),_.constructor=I,_._super=q,V&&h(_,V)}function g(I,R){return function(){return I.apply(R,arguments)}}function x(I,R){return typeof I==o?I.apply(R&&R[0]||r,R):I}function b(I,R){return I===r?R:I}function w(I,R,V){A(P(R),function(q){I.addEventListener(q,V,!1)})}function E(I,R,V){A(P(R),function(q){I.removeEventListener(q,V,!1)})}function M(I,R){for(;I;){if(I==R)return!0;I=I.parentNode}return!1}function C(I,R){return I.indexOf(R)>-1}function P(I){return I.trim().split(/\s+/g)}function S(I,R,V){if(I.indexOf&&!V)return I.indexOf(R);for(var q=0;q<I.length;){if(V&&I[q][V]==R||!V&&I[q]===R)return q;q++}return-1}function T(I){return Array.prototype.slice.call(I,0)}function B(I,R,V){for(var q=[],_=[],le=0;le<I.length;){var Te=I[le][R];S(_,Te)<0&&q.push(I[le]),_[le]=Te,le++}return q=q.sort(function(gt,Je){return gt[R]>Je[R]}),q}function L(I,R){for(var V,q,_=R[0].toUpperCase()+R.slice(1),le=0;le<i.length;){if(V=i[le],q=V?V+_:R,q in I)return q;le++}return r}var k=1;function O(){return k++}function D(I){var R=I.ownerDocument||I;return R.defaultView||R.parentWindow||n}var N=/mobile|tablet|ip(ad|hone|od)|android/i,X="ontouchstart"in n,K=L(n,"PointerEvent")!==r,Q=X&&N.test(navigator.userAgent),G="touch",J="pen",H="mouse",j="kinect",Z=25,Y=1,pe=2,ee=4,oe=8,ie=1,ce=2,ne=4,ae=8,de=16,ve=ce|ne,xe=ae|de,Ce=ve|xe,Be=["x","y"],$=["clientX","clientY"];function te(I,R){var V=this;this.manager=I,this.callback=R,this.element=I.element,this.target=I.options.inputTarget,this.domHandler=function(q){x(I.options.enable,[I])&&V.handler(q)},this.init()}te.prototype={handler:function(){},init:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(D(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(D(this.element),this.evWin,this.domHandler)}};function U(I){var R,V=I.options.inputClass;return V?R=V:K?R=er:Q?R=At:X?R=Et:R=ot,new R(I,Le)}function Le(I,R,V){var q=V.pointers.length,_=V.changedPointers.length,le=R&Y&&q-_===0,Te=R&(ee|oe)&&q-_===0;V.isFirst=!!le,V.isFinal=!!Te,le&&(I.session={}),V.eventType=R,Pe(I,V),I.emit("hammer.input",V),I.recognize(V),I.session.prevInput=V}function Pe(I,R){var V=I.session,q=R.pointers,_=q.length;V.firstInput||(V.firstInput=be(R)),_>1&&!V.firstMultiple?V.firstMultiple=be(R):_===1&&(V.firstMultiple=!1);var le=V.firstInput,Te=V.firstMultiple,et=Te?Te.center:le.center,gt=R.center=ye(q);R.timeStamp=u(),R.deltaTime=R.timeStamp-le.timeStamp,R.angle=Ne(et,gt),R.distance=Ae(et,gt),Ie(V,R),R.offsetDirection=me(R.deltaX,R.deltaY);var Je=ge(R.deltaTime,R.deltaX,R.deltaY);R.overallVelocityX=Je.x,R.overallVelocityY=Je.y,R.overallVelocity=l(Je.x)>l(Je.y)?Je.x:Je.y,R.scale=Te?je(Te.pointers,q):1,R.rotation=Te?ze(Te.pointers,q):0,R.maxPointers=V.prevInput?R.pointers.length>V.prevInput.maxPointers?R.pointers.length:V.prevInput.maxPointers:R.pointers.length,Qe(V,R);var nr=I.element;M(R.srcEvent.target,nr)&&(nr=R.srcEvent.target),R.target=nr}function Ie(I,R){var V=R.center,q=I.offsetDelta||{},_=I.prevDelta||{},le=I.prevInput||{};(R.eventType===Y||le.eventType===ee)&&(_=I.prevDelta={x:le.deltaX||0,y:le.deltaY||0},q=I.offsetDelta={x:V.x,y:V.y}),R.deltaX=_.x+(V.x-q.x),R.deltaY=_.y+(V.y-q.y)}function Qe(I,R){var V=I.lastInterval||R,q=R.timeStamp-V.timeStamp,_,le,Te,et;if(R.eventType!=oe&&(q>Z||V.velocity===r)){var gt=R.deltaX-V.deltaX,Je=R.deltaY-V.deltaY,nr=ge(q,gt,Je);le=nr.x,Te=nr.y,_=l(nr.x)>l(nr.y)?nr.x:nr.y,et=me(gt,Je),I.lastInterval=R}else _=V.velocity,le=V.velocityX,Te=V.velocityY,et=V.direction;R.velocity=_,R.velocityX=le,R.velocityY=Te,R.direction=et}function be(I){for(var R=[],V=0;V<I.pointers.length;)R[V]={clientX:s(I.pointers[V].clientX),clientY:s(I.pointers[V].clientY)},V++;return{timeStamp:u(),pointers:R,center:ye(R),deltaX:I.deltaX,deltaY:I.deltaY}}function ye(I){var R=I.length;if(R===1)return{x:s(I[0].clientX),y:s(I[0].clientY)};for(var V=0,q=0,_=0;_<R;)V+=I[_].clientX,q+=I[_].clientY,_++;return{x:s(V/R),y:s(q/R)}}function ge(I,R,V){return{x:R/I||0,y:V/I||0}}function me(I,R){return I===R?ie:l(I)>=l(R)?I<0?ce:ne:R<0?ae:de}function Ae(I,R,V){V||(V=Be);var q=R[V[0]]-I[V[0]],_=R[V[1]]-I[V[1]];return Math.sqrt(q*q+_*_)}function Ne(I,R,V){V||(V=Be);var q=R[V[0]]-I[V[0]],_=R[V[1]]-I[V[1]];return Math.atan2(_,q)*180/Math.PI}function ze(I,R){return Ne(R[1],R[0],$)+Ne(I[1],I[0],$)}function je(I,R){return Ae(R[0],R[1],$)/Ae(I[0],I[1],$)}var cr={mousedown:Y,mousemove:pe,mouseup:ee},Fe="mousedown",Ye="mousemove mouseup";function ot(){this.evEl=Fe,this.evWin=Ye,this.pressed=!1,te.apply(this,arguments)}p(ot,te,{handler:function(R){var V=cr[R.type];V&Y&&(R.button===0||R.button===2)&&(this.pressed=!0),V&pe&&R.which!==1&&(V=ee),this.pressed&&(V&ee&&(this.pressed=!1),this.callback(this.manager,V,{pointers:[R],changedPointers:[R],pointerType:H,srcEvent:R}))}});var Yt={pointerdown:Y,pointermove:pe,pointerup:ee,pointercancel:oe,pointerout:oe},on={2:G,3:J,4:H,5:j},$t="pointerdown",St="pointermove pointerup pointercancel";n.MSPointerEvent&&!n.PointerEvent&&($t="MSPointerDown",St="MSPointerMove MSPointerUp MSPointerCancel");function er(){this.evEl=$t,this.evWin=St,te.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}p(er,te,{handler:function(R){var V=this.store,q=!1,_=!1,le=R.type.toLowerCase().replace("ms",""),Te=Yt[le],et=on[R.pointerType]||R.pointerType,gt=et==G,Je=S(V,R.pointerId,"pointerId");Te&Y&&(R.button===0||R.button===2||gt)?Je<0&&(V.push(R),Je=V.length-1):Te&(ee|oe)?q=!0:!gt&&R.buttons===0&&(q=!0,_=!0,Te=Yt.pointerup),!(Je<0)&&(_||(V[Je]=R),this.callback(this.manager,Te,{pointers:V,changedPointers:[R],pointerType:et,srcEvent:V[Je]}),q&&V.splice(Je,1))}});var Mr={touchstart:Y,touchmove:pe,touchend:ee,touchcancel:oe},Dt="touchstart",tr="touchstart touchmove touchend touchcancel";function zt(){this.evTarget=Dt,this.evWin=tr,this.started=!1,te.apply(this,arguments)}p(zt,te,{handler:function(R){var V=Mr[R.type];if(V===Y&&(this.started=!0),!!this.started){var q=lt.call(this,R,V);V&(ee|oe)&&q[0].length-q[1].length===0&&(this.started=!1),this.callback(this.manager,V,{pointers:q[0],changedPointers:q[1],pointerType:G,srcEvent:R})}}});function lt(I,R){var V=T(I.touches),q=T(I.changedTouches);return R&(ee|oe)&&(V=B(V.concat(q),"identifier")),[V,q]}var Oe={touchstart:Y,touchmove:pe,touchend:ee,touchcancel:oe},dr="touchstart touchmove touchend touchcancel";function At(){this.evTarget=dr,this.targetIds={},te.apply(this,arguments)}p(At,te,{handler:function(R){var V=Oe[R.type],q=fr.call(this,R,V);q&&this.callback(this.manager,V,{pointers:q[0],changedPointers:q[1],pointerType:G,srcEvent:R})}});function fr(I,R){var V=T(I.touches),q=this.targetIds;if(R&(Y|pe)&&V.length===1)return q[V[0].identifier]=!0,[V,V];var _,le,Te=T(I.changedTouches),et=[],gt=this.target;if(le=V.filter(function(Je){return M(Je.target,gt)}),R===Y)for(_=0;_<le.length;)q[le[_].identifier]=!0,_++;for(_=0;_<Te.length;)q[Te[_].identifier]&&et.push(Te[_]),R&(ee|oe)&&delete q[Te[_].identifier],_++;if(et.length)return[B(le.concat(et),"identifier"),et]}var hr=2500,Qt=25;function Et(){te.apply(this,arguments);var I=g(this.handler,this);this.touch=new At(this.manager,I),this.mouse=new ot(this.manager,I),this.primaryTouch=null,this.lastTouches=[]}p(Et,te,{handler:function(R,V,q){var _=q.pointerType==G,le=q.pointerType==H;if(!(le&&q.sourceCapabilities&&q.sourceCapabilities.firesTouchEvents)){if(_)pr.call(this,V,q);else if(le&&sn.call(this,q))return;this.callback(R,V,q)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function pr(I,R){I&Y?(this.primaryTouch=R.changedPointers[0].identifier,Sr.call(this,R)):I&(ee|oe)&&Sr.call(this,R)}function Sr(I){var R=I.changedPointers[0];if(R.identifier===this.primaryTouch){var V={x:R.clientX,y:R.clientY};this.lastTouches.push(V);var q=this.lastTouches,_=function(){var le=q.indexOf(V);le>-1&&q.splice(le,1)};setTimeout(_,hr)}}function sn(I){for(var R=I.srcEvent.clientX,V=I.srcEvent.clientY,q=0;q<this.lastTouches.length;q++){var _=this.lastTouches[q],le=Math.abs(R-_.x),Te=Math.abs(V-_.y);if(le<=Qt&&Te<=Qt)return!0}return!1}var jr=a?L(a.style,"touchAction"):r,Jr=jr!==r,Ut="compute",$e="auto",Ge="manipulation",nt="none",mt="pan-x",ct="pan-y",qt=Vu();function Ir(I,R){this.manager=I,this.set(R)}Ir.prototype={set:function(I){I==Ut&&(I=this.compute()),Jr&&this.manager.element.style&&qt[I]&&(this.manager.element.style[jr]=I),this.actions=I.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var I=[];return A(this.manager.recognizers,function(R){x(R.options.enable,[R])&&(I=I.concat(R.getTouchAction()))}),Wr(I.join(" "))},preventDefaults:function(I){var R=I.srcEvent,V=I.offsetDirection;if(this.manager.session.prevented){R.preventDefault();return}var q=this.actions,_=C(q,nt)&&!qt[nt],le=C(q,ct)&&!qt[ct],Te=C(q,mt)&&!qt[mt];if(_){var et=I.pointers.length===1,gt=I.distance<2,Je=I.deltaTime<250;if(et&>&&Je)return}if(!(Te&&le)&&(_||le&&V&ve||Te&&V&xe))return this.preventSrc(R)},preventSrc:function(I){this.manager.session.prevented=!0,I.preventDefault()}};function Wr(I){if(C(I,nt))return nt;var R=C(I,mt),V=C(I,ct);return R&&V?nt:R||V?R?mt:ct:C(I,Ge)?Ge:$e}function Vu(){if(!Jr)return!1;var I={},R=n.CSS&&n.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(V){I[V]=R?n.CSS.supports("touch-action",V):!0}),I}var $n=1,It=2,un=4,Tr=8,vr=Tr,Pn=16,rr=32;function Ar(I){this.options=h({},this.defaults,I||{}),this.id=O(),this.manager=null,this.options.enable=b(this.options.enable,!0),this.state=$n,this.simultaneous={},this.requireFail=[]}Ar.prototype={defaults:{},set:function(I){return h(this.options,I),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(I){if(f(I,"recognizeWith",this))return this;var R=this.simultaneous;return I=ei(I,this),R[I.id]||(R[I.id]=I,I.recognizeWith(this)),this},dropRecognizeWith:function(I){return f(I,"dropRecognizeWith",this)?this:(I=ei(I,this),delete this.simultaneous[I.id],this)},requireFailure:function(I){if(f(I,"requireFailure",this))return this;var R=this.requireFail;return I=ei(I,this),S(R,I)===-1&&(R.push(I),I.requireFailure(this)),this},dropRequireFailure:function(I){if(f(I,"dropRequireFailure",this))return this;I=ei(I,this);var R=S(this.requireFail,I);return R>-1&&this.requireFail.splice(R,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(I){return!!this.simultaneous[I.id]},emit:function(I){var R=this,V=this.state;function q(_){R.manager.emit(_,I)}V<Tr&&q(R.options.event+Eo(V)),q(R.options.event),I.additionalEvent&&q(I.additionalEvent),V>=Tr&&q(R.options.event+Eo(V))},tryEmit:function(I){if(this.canEmit())return this.emit(I);this.state=rr},canEmit:function(){for(var I=0;I<this.requireFail.length;){if(!(this.requireFail[I].state&(rr|$n)))return!1;I++}return!0},recognize:function(I){var R=h({},I);if(!x(this.options.enable,[this,R])){this.reset(),this.state=rr;return}this.state&(vr|Pn|rr)&&(this.state=$n),this.state=this.process(R),this.state&(It|un|Tr|Pn)&&this.tryEmit(R)},process:function(I){},getTouchAction:function(){},reset:function(){}};function Eo(I){return I&Pn?"cancel":I&Tr?"end":I&un?"move":I&It?"start":""}function Co(I){return I==de?"down":I==ae?"up":I==ce?"left":I==ne?"right":""}function ei(I,R){var V=R.manager;return V?V.get(I):I}function Ht(){Ar.apply(this,arguments)}p(Ht,Ar,{defaults:{pointers:1},attrTest:function(I){var R=this.options.pointers;return R===0||I.pointers.length===R},process:function(I){var R=this.state,V=I.eventType,q=R&(It|un),_=this.attrTest(I);return q&&(V&oe||!_)?R|Pn:q||_?V&ee?R|Tr:R&It?R|un:It:rr}});function ti(){Ht.apply(this,arguments),this.pX=null,this.pY=null}p(ti,Ht,{defaults:{event:"pan",threshold:10,pointers:1,direction:Ce},getTouchAction:function(){var I=this.options.direction,R=[];return I&ve&&R.push(ct),I&xe&&R.push(mt),R},directionTest:function(I){var R=this.options,V=!0,q=I.distance,_=I.direction,le=I.deltaX,Te=I.deltaY;return _&R.direction||(R.direction&ve?(_=le===0?ie:le<0?ce:ne,V=le!=this.pX,q=Math.abs(I.deltaX)):(_=Te===0?ie:Te<0?ae:de,V=Te!=this.pY,q=Math.abs(I.deltaY))),I.direction=_,V&&q>R.threshold&&_&R.direction},attrTest:function(I){return Ht.prototype.attrTest.call(this,I)&&(this.state&It||!(this.state&It)&&this.directionTest(I))},emit:function(I){this.pX=I.deltaX,this.pY=I.deltaY;var R=Co(I.direction);R&&(I.additionalEvent=this.options.event+R),this._super.emit.call(this,I)}});function Di(){Ht.apply(this,arguments)}p(Di,Ht,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[nt]},attrTest:function(I){return this._super.attrTest.call(this,I)&&(Math.abs(I.scale-1)>this.options.threshold||this.state&It)},emit:function(I){if(I.scale!==1){var R=I.scale<1?"in":"out";I.additionalEvent=this.options.event+R}this._super.emit.call(this,I)}});function zi(){Ar.apply(this,arguments),this._timer=null,this._input=null}p(zi,Ar,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[$e]},process:function(I){var R=this.options,V=I.pointers.length===R.pointers,q=I.distance<R.threshold,_=I.deltaTime>R.time;if(this._input=I,!q||!V||I.eventType&(ee|oe)&&!_)this.reset();else if(I.eventType&Y)this.reset(),this._timer=d(function(){this.state=vr,this.tryEmit()},R.time,this);else if(I.eventType&ee)return vr;return rr},reset:function(){clearTimeout(this._timer)},emit:function(I){this.state===vr&&(I&&I.eventType&ee?this.manager.emit(this.options.event+"up",I):(this._input.timeStamp=u(),this.manager.emit(this.options.event,this._input)))}});function Qi(){Ht.apply(this,arguments)}p(Qi,Ht,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[nt]},attrTest:function(I){return this._super.attrTest.call(this,I)&&(Math.abs(I.rotation)>this.options.threshold||this.state&It)}});function Ui(){Ht.apply(this,arguments)}p(Ui,Ht,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:ve|xe,pointers:1},getTouchAction:function(){return ti.prototype.getTouchAction.call(this)},attrTest:function(I){var R=this.options.direction,V;return R&(ve|xe)?V=I.overallVelocity:R&ve?V=I.overallVelocityX:R&xe&&(V=I.overallVelocityY),this._super.attrTest.call(this,I)&&R&I.offsetDirection&&I.distance>this.options.threshold&&I.maxPointers==this.options.pointers&&l(V)>this.options.velocity&&I.eventType&ee},emit:function(I){var R=Co(I.offsetDirection);R&&this.manager.emit(this.options.event+R,I),this.manager.emit(this.options.event,I)}});function ri(){Ar.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}p(ri,Ar,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Ge]},process:function(I){var R=this.options,V=I.pointers.length===R.pointers,q=I.distance<R.threshold,_=I.deltaTime<R.time;if(this.reset(),I.eventType&Y&&this.count===0)return this.failTimeout();if(q&&_&&V){if(I.eventType!=ee)return this.failTimeout();var le=this.pTime?I.timeStamp-this.pTime<R.interval:!0,Te=!this.pCenter||Ae(this.pCenter,I.center)<R.posThreshold;this.pTime=I.timeStamp,this.pCenter=I.center,!Te||!le?this.count=1:this.count+=1,this._input=I;var et=this.count%R.taps;if(et===0)return this.hasRequireFailures()?(this._timer=d(function(){this.state=vr,this.tryEmit()},R.interval,this),It):vr}return rr},failTimeout:function(){return this._timer=d(function(){this.state=rr},this.options.interval,this),rr},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==vr&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function ln(I,R){return R=R||{},R.recognizers=b(R.recognizers,ln.defaults.preset),new qi(I,R)}ln.VERSION="2.0.7",ln.defaults={domEvents:!1,touchAction:Ut,enable:!0,inputTarget:null,inputClass:null,preset:[[Qi,{enable:!1}],[Di,{enable:!1},["rotate"]],[Ui,{direction:ve}],[ti,{direction:ve},["swipe"]],[ri],[ri,{event:"doubletap",taps:2},["tap"]],[zi]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Nu=1,Mo=2;function qi(I,R){this.options=h({},ln.defaults,R||{}),this.options.inputTarget=this.options.inputTarget||I,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=I,this.input=U(this),this.touchAction=new Ir(this,this.options.touchAction),So(this,!0),A(this.options.recognizers,function(V){var q=this.add(new V[0](V[1]));V[2]&&q.recognizeWith(V[2]),V[3]&&q.requireFailure(V[3])},this)}qi.prototype={set:function(I){return h(this.options,I),I.touchAction&&this.touchAction.update(),I.inputTarget&&(this.input.destroy(),this.input.target=I.inputTarget,this.input.init()),this},stop:function(I){this.session.stopped=I?Mo:Nu},recognize:function(I){var R=this.session;if(!R.stopped){this.touchAction.preventDefaults(I);var V,q=this.recognizers,_=R.curRecognizer;(!_||_&&_.state&vr)&&(_=R.curRecognizer=null);for(var le=0;le<q.length;)V=q[le],R.stopped!==Mo&&(!_||V==_||V.canRecognizeWith(_))?V.recognize(I):V.reset(),!_&&V.state&(It|un|Tr)&&(_=R.curRecognizer=V),le++}},get:function(I){if(I instanceof Ar)return I;for(var R=this.recognizers,V=0;V<R.length;V++)if(R[V].options.event==I)return R[V];return null},add:function(I){if(f(I,"add",this))return this;var R=this.get(I.options.event);return R&&this.remove(R),this.recognizers.push(I),I.manager=this,this.touchAction.update(),I},remove:function(I){if(f(I,"remove",this))return this;if(I=this.get(I),I){var R=this.recognizers,V=S(R,I);V!==-1&&(R.splice(V,1),this.touchAction.update())}return this},on:function(I,R){if(I!==r&&R!==r){var V=this.handlers;return A(P(I),function(q){V[q]=V[q]||[],V[q].push(R)}),this}},off:function(I,R){if(I!==r){var V=this.handlers;return A(P(I),function(q){R?V[q]&&V[q].splice(S(V[q],R),1):delete V[q]}),this}},emit:function(I,R){this.options.domEvents&&Du(I,R);var V=this.handlers[I]&&this.handlers[I].slice();if(!(!V||!V.length)){R.type=I,R.preventDefault=function(){R.srcEvent.preventDefault()};for(var q=0;q<V.length;)V[q](R),q++}},destroy:function(){this.element&&So(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function So(I,R){var V=I.element;if(V.style){var q;A(I.options.cssProps,function(_,le){q=L(V.style,le),R?(I.oldCssProps[q]=V.style[q],V.style[q]=_):V.style[q]=I.oldCssProps[q]||""}),R||(I.oldCssProps={})}}function Du(I,R){var V=t.createEvent("Event");V.initEvent(I,!0,!0),V.gesture=R,R.target.dispatchEvent(V)}return h(ln,{INPUT_START:Y,INPUT_MOVE:pe,INPUT_END:ee,INPUT_CANCEL:oe,STATE_POSSIBLE:$n,STATE_BEGAN:It,STATE_CHANGED:un,STATE_ENDED:Tr,STATE_RECOGNIZED:vr,STATE_CANCELLED:Pn,STATE_FAILED:rr,DIRECTION_NONE:ie,DIRECTION_LEFT:ce,DIRECTION_RIGHT:ne,DIRECTION_UP:ae,DIRECTION_DOWN:de,DIRECTION_HORIZONTAL:ve,DIRECTION_VERTICAL:xe,DIRECTION_ALL:Ce,Manager:qi,Input:te,TouchAction:Ir,TouchInput:At,MouseInput:ot,PointerEventInput:er,TouchMouseInput:Et,SingleTouchInput:zt,Recognizer:Ar,AttrRecognizer:Ht,Tap:ri,Pan:ti,Swipe:Ui,Pinch:Di,Rotate:Qi,Press:zi,on:w,off:E,each:A,merge:y,extend:v,assign:h,inherit:p,bindFn:g,prefixed:L}),ln}(typeof window!="undefined"?window:{},typeof document!="undefined"?document:{});function Ts(n,t,e){var r=t.getBoundingClientRect(),i=r.top,a=r.left,o=r.width,s=r.height;return e&&(a=a+o*e.left,i=i+s*(1-e.bottom-e.height),o=o*e.width,s=s*e.height),new c.Vector2((n.x-a)/o*2-1,-(n.y-i)/s*2+1)}var pu=new c.OrthographicCamera(-1,1,1,-1,0,1),co=new c.BufferGeometry;co.setAttribute("position",new c.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));co.setAttribute("uv",new c.Float32BufferAttribute([0,2,0,0,2,0],2));var tn=new c.Mesh(co),fo=new c.Scene;fo.add(tn);var yh=`
|
|
1329
1329
|
varying vec2 vUv;
|
|
1330
1330
|
void main() {
|
|
1331
1331
|
vUv = uv;
|
|
1332
1332
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
1333
1333
|
}
|
|
1334
|
-
`,Oi=function(){function n(t,e){var r;this.renderer=t,this.material=new c.ShaderMaterial({vertexShader:(r=e.vertex)!==null&&r!==void 0?r:
|
|
1334
|
+
`,Oi=function(){function n(t,e){var r;this.renderer=t,this.material=new c.ShaderMaterial({vertexShader:(r=e.vertex)!==null&&r!==void 0?r:yh,fragmentShader:e.fragment,uniforms:Object.assign({inputBuffer:new c.Uniform(null)},e.uniforms),defines:Object.assign({},e.defines),blending:c.NoBlending,depthWrite:!1,depthTest:!1})}return n.prototype.render=function(t,e){var r=this.renderer.getRenderTarget(),i=tn.material;this.material.uniforms.inputBuffer.value=t.texture,tn.material=this.material,this.renderer.setRenderTarget(e||null),this.renderer.render(fo,pu),this.renderer.setRenderTarget(r),tn.material=i},n.prototype.dispose=function(){this.material.dispose()},n}(),bh=`
|
|
1335
1335
|
void main() {
|
|
1336
1336
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
1337
1337
|
}
|
|
1338
|
-
`,
|
|
1338
|
+
`,xh=`
|
|
1339
1339
|
uniform vec3 inputValue;
|
|
1340
1340
|
void main() {
|
|
1341
1341
|
gl_FragColor = vec4(inputValue, 1.0);
|
|
1342
1342
|
}
|
|
1343
|
-
`,
|
|
1343
|
+
`,wh=function(){function n(t){this.renderer=t,this.material=new c.ShaderMaterial({vertexShader:bh,fragmentShader:xh,uniforms:Object.assign({inputValue:new c.Uniform(new c.Vector3)}),blending:c.NoBlending,depthWrite:!1,depthTest:!1})}return n.prototype.render=function(t,e){var r=this.renderer.getRenderTarget(),i=tn.material;this.material.uniforms.inputValue.value.copy(t),tn.material=this.material,this.renderer.setRenderTarget(e||null),this.renderer.render(fo,pu),this.renderer.setRenderTarget(r),tn.material=i},n.prototype.dispose=function(){this.material.dispose()},n}(),Eh=`
|
|
1344
1344
|
uniform sampler2D inputBuffer;
|
|
1345
1345
|
varying vec2 vUv;
|
|
1346
1346
|
void main() {
|
|
1347
1347
|
gl_FragColor = texture2D(inputBuffer, vUv);
|
|
1348
1348
|
}
|
|
1349
|
-
`,
|
|
1349
|
+
`,vu=function(n){ue(t,n);function t(e){return n.call(this,e,{fragment:Eh})||this}return t}(Oi),Ch=`
|
|
1350
1350
|
precision mediump float;
|
|
1351
1351
|
precision mediump int;
|
|
1352
1352
|
uniform sampler2D depthBuffer;
|
|
@@ -1355,7 +1355,7 @@ void main() {
|
|
|
1355
1355
|
gl_FragColor = vec4(0.0,0.0,0.0,1.0);
|
|
1356
1356
|
gl_FragDepthEXT = texture2D(depthBuffer, vUv).r;
|
|
1357
1357
|
}
|
|
1358
|
-
`,
|
|
1358
|
+
`,Mh=`
|
|
1359
1359
|
|
|
1360
1360
|
varying vec2 vUv;
|
|
1361
1361
|
|
|
@@ -1366,7 +1366,7 @@ void main() {
|
|
|
1366
1366
|
|
|
1367
1367
|
gl_Position = projectionMatrix * mvPosition;
|
|
1368
1368
|
}
|
|
1369
|
-
`,Mh=new c.OrthographicCamera(-1,1,1,-1,0,1),fo=new c.BufferGeometry;fo.setAttribute("position",new c.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));fo.setAttribute("uv",new c.Float32BufferAttribute([0,2,0,0,2,0],2));var vu=new c.Mesh(fo),Au=new c.Scene;Au.add(vu);var Sh=function(){function n(t){this.renderer=t,this.material=new c.ShaderMaterial({vertexShader:Ch,fragmentShader:Eh,uniforms:Object.assign({depthBuffer:new c.Uniform(null)}),blending:c.NoBlending,depthWrite:!0,depthTest:!0}),vu.material=this.material,this.renderer.getContext()&&this.renderer.getContext()instanceof WebGLRenderingContext&&(this.material.extensions.fragDepth=!0)}return n.prototype.render=function(t,e){var r=this.renderer.getRenderTarget();this.material.uniforms.depthBuffer.value=t,this.renderer.setRenderTarget(e||null),this.renderer.render(Au,Mh),this.renderer.setRenderTarget(r)},n.prototype.dispose=function(){this.material.dispose()},n}(),ca=new c.Vector2,ho=function(n){ue(t,n);function t(e){var r,i,a,o,s,l,u=n.call(this)||this,d=t.parseArgs(e);u.mode="",u.pending=new Set,u.userAction=d.initial.userAction,u.destroyed=!1,u.ident=d.ident,u.scene=d.scene,u.xrCustomObjectsScene=d.xrCustomObjectsScene,u.helper=d.helper,u.boundingMesh=d.boundingMesh,u.camera=d.camera,u.renderer=d.renderer,u.scissor=d.scissor,u.element=d.element,u.models=d.models,u.enableWheel=d.enableWheel,u.enableIOSEDR=(r=d.enableIOSEDR)!==null&&r!==void 0?r:!1,u.enableEDL=(i=d.enableEDL)!==null&&i!==void 0?i:!0,u.enableHQ=(a=d.enableHQ)!==null&&a!==void 0?a:!0,u.works=d.works,u.imageOptions=d.imageOptions,u.videoTexture=d.videoTexture,u.extraElements=d.extraElements,u.initial=d.initial,u.currentPano=typeof u.initial.state.panoIndex=="number"?{workCode:(l=(o=u.initial.state.workCode)!==null&&o!==void 0?o:(s=d.works[0])===null||s===void 0?void 0:s.workCode)!==null&&l!==void 0?l:"",panoIndex:u.initial.state.panoIndex}:{workCode:u.initial.currentState.workCode,panoIndex:u.initial.currentState.panoIndex},u.needsRender=!0,u.modelSceneNeedsRender=!0,u.cameraMotion=new Se({longitude:{value:u.camera.pose.longitude,circle:[0,Math.PI*2]},latitude:u.camera.pose.latitude,fov:u.camera.pose.fov}),u.inMomentumMovement=null,u.eventUnbinds=[d.element].concat(d.extraElements||[]).map(function(A){return u.bindEvents(A)}),u.pending.add("init-animation"),u.initAnimationReady=new Promise(function(A){vt.shared.add(function(){u.initAnimation().then(function(){u.pending.delete("init-animation"),A()})},!0)}),u.initAnimationIsReady=!1,u.initAnimationReady.then(function(){return u.initAnimationIsReady=!0}),u.modelScene=d.modelScene;var f=new c.Vector2;return u.renderer.getDrawingBufferSize(f),u.modelRenderTarget=d.modelRenderTarget,u.copyPass=new pu(u.renderer),u.depthCopyPass=new Sh(u.renderer),u.screenBuffers=[],u.lastPostProcessingType=null,u}return t.parseArgs=function(e){return e instanceof t?e:F({},e)},t.initAnimationEndState=function(e){var r,i,a,o,s,l,u,d,f=this.parseArgs(e),A=f.initial,m=A.state,h=A.currentState,v=typeof m.panoIndex=="number"?{workCode:(a=(r=m.workCode)!==null&&r!==void 0?r:(i=f.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:m.panoIndex}:{workCode:h.workCode,panoIndex:h.panoIndex};return F(F({},v),{mode:"",longitude:(o=m.longitude)!==null&&o!==void 0?o:h.longitude,latitude:(s=m.latitude)!==null&&s!==void 0?s:h.latitude,fov:(l=m.fov)!==null&&l!==void 0?l:h.fov,offset:(u=m.offset)!==null&&u!==void 0?u:h.offset,distance:(d=m.distance)!==null&&d!==void 0?d:h.distance})},t.prototype.destroy=function(){var e;this.stopMomentumMovement(),this.destroyed=!0,this.off(),this.cameraMotion.dispose();for(var r=0,i=this.eventUnbinds;r<i.length;r++){var a=i[r];a()}this.copyEffect&&(this.copyEffect.dispose(),delete this.copyEffect),delete this.panState,(e=this.pressState)===null||e===void 0||e.stop(),delete this.pressState},t.prototype.isReady=function(){return this.inMomentumMovement===null&&this.pending.size===0&&this.cameraMotion.ended===!0},t.prototype.bindExtraElement=function(e){for(var r=0,i=this.eventUnbinds;r<i.length;r++){var a=i[r];if(a.element===e)return}this.eventUnbinds.push(this.bindEvents(e))},t.prototype.unbindExtraElement=function(e){for(var r=[],i=0,a=this.eventUnbinds;i<a.length;i++){var o=a[i];o.element===e?o():r.push(o)}this.eventUnbinds=r},t.prototype.updateRenderSize=function(e){this.needsRender=!0,this.modelSceneNeedsRender=!0,this.modelRenderTarget.setSize(e.x,e.y),this.screenBuffers.forEach(function(r){r.setSize(e.x,e.y)})},t.prototype.updateModel=function(e){this.needsRender=!0,this.modelSceneNeedsRender=!0},t.prototype.updateWork=function(e,r,i,a){return this.works=e,this.userAction=a,!1},t.prototype.updateTime=function(e,r){if(!this.destroyed){var i={};this.cameraMotion.ended&&(this.cameraMotion.update(e),i.longitude=this.cameraMotion.value.longitude,i.latitude=this.cameraMotion.value.latitude,i.fov=this.cameraMotion.value.fov),Nt(i)&&this.setCamera(i)}},t.prototype.render=function(e,r){var i=this.renderer.getRenderTarget();this.updateScreenBuffer(r),e&&(this.renderer.setRenderTarget(this.modelRenderTarget),this.renderer.render(this.modelScene,this.camera)),this.depthCopyPass.render(this.modelRenderTarget.depthTexture,i),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.copyPass.render(this.modelRenderTarget,i),this.renderer.setRenderTarget(i),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,this.camera),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0},t.prototype.postProcessing=function(e,r){this.destroyed},t.prototype.updateCamera=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();var o={};return e.longitude!==void 0&&(o.longitude=e.longitude),e.latitude!==void 0&&(o.latitude=e.latitude),e.fov!==void 0&&(o.fov=e.fov),a.cameraMotion.set(o,r).catch(z)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();for(var o=[],s=0,l=e;s<l.length;s++){var u=l[s];o.push({key:u.key,progress:u.progress,value:{longitude:u.value.longitude,latitude:u.value.latitude,fov:u.value.fov}})}return a.cameraMotion.setKeyframes(o,r)})},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(Me())[1];return F(F({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance})},t.prototype.initAnimation=function(){var e=this.initial;e.state,e.currentState,e.duration;var r=e.userAction,i=t.initAnimationEndState(this);return this.userAction=r,this.emit("initAnimation.start",W("initAnimation.start",{state:i,userAction:this.userAction})),this.emit("initAnimation.end",W("initAnimation.end",{state:i,userAction:this.userAction})),Promise.resolve()},t.prototype.setCamera=function(e){var r,i,a,o,s;e===void 0&&(e={});var l=(r=e.longitude)!==null&&r!==void 0?r:this.camera.pose.longitude,u=(i=e.latitude)!==null&&i!==void 0?i:this.camera.pose.latitude,d=(a=e.fov)!==null&&a!==void 0?a:this.camera.pose.fov,f=(o=e.distance)!==null&&o!==void 0?o:this.camera.pose.distance,A=(s=e.offset)!==null&&s!==void 0?s:this.camera.pose.offset,m=Xt(l,this.camera.pose.longitude,Math.PI*2)||Xt(u,this.camera.pose.latitude),h=Xt(d,this.camera.pose.fov),v=Xt(f,this.camera.pose.distance),y=za(A,this.camera.pose.offset);(h||m||y||v)&&(this.camera.setFromPose({longitude:l,latitude:u,fov:d,distance:f,offset:A}),this.emit("camera.update",W("camera.update",{userAction:this.userAction,state:F(F({},this.currentPano),{mode:this.mode,longitude:l,latitude:u,fov:d,offset:A,distance:f})})),this.needsRender=!0,this.modelSceneNeedsRender=!0)},t.prototype.stopMomentumMovement=function(){if(this.inMomentumMovement&&this.inMomentumMovement.event&&!this.inMomentumMovement.event.defaultPrevented&&!this.inMomentumMovement.event.isFinal){var e=W("gesture.momentum",F(F({},this.inMomentumMovement.event),{isFirst:!1,isFinal:!0}));this.emit("gesture.momentum",e)}this.inMomentumMovement=null},t.prototype.onPanGesture=function(e){this.stopMomentumMovement(),this.emit("gesture.pan",e)},t.prototype.onTapGesture=function(e){this.stopMomentumMovement(),this.emit("gesture.tap",e)},t.prototype.onPressGesture=function(e){this.stopMomentumMovement(),this.emit("gesture.press",e)},t.prototype.onPinchGesture=function(e){this.stopMomentumMovement(),this.emit("gesture.pinch",e)},t.prototype.onMouseWheel=function(e){this.stopMomentumMovement(),this.emit("gesture.mousewheel",e)},t.prototype.onMouseMove=function(e){this.stopMomentumMovement(),this.emit("gesture.mousemove",e)},t.prototype.relativeClientPosition=function(e){return Is(e,this.element,this.scissor)},t.prototype.bindEvents=function(e){var r=this,i=function(C){var P=Is(C,r.element,r.scissor);return!(Math.abs(P.x)>1||Math.abs(P.y)>1)},a=new Nn.Manager(e),o=function(C){var P=C.session;return P.firstInput||null};a.add(new Nn.Pan({threshold:10,pointers:0})),a.add(new Nn.Tap({interval:410})),a.add(new Nn.Pinch({threshold:0,pointers:2})),a.on("panstart pan",function(C){var P=o(a);if(!(P&&!i(P.center))){var S=W("gesture.pan",{target:C.target,pointerType:C.pointerType,srcEvent:C.srcEvent,pointers:C.pointers.map(function(T){var B=r.relativeClientPosition(T),L=new c.Raycaster;return L.params.Points={threshold:.1},L.setFromCamera(B,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:B,raycaster:L}}),isFirst:C.isFirst,isFinal:C.isFinal,scale:C.scale,center:function(T){var B=r.relativeClientPosition(T),L=new c.Raycaster;return L.params.Points={threshold:.1},L.setFromCamera(B,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:B,raycaster:L}}(C.center),velocityX:C.velocityX,velocityY:C.velocityY,overallVelocityX:C.overallVelocityX,overallVelocityY:C.overallVelocityY,userAction:!0,state:F(F({mode:r.mode},r.currentPano),_e(r.camera.pose))});r.onPanGesture(S),y()}}),a.on("tap",function(C){if(!(C.pointerType==="mouse"&&C.srcEvent.button!==0)){var P=o(a);if(!(P&&!i(P.center))){var S=W("gesture.tap",{target:C.target,pointerType:C.pointerType,srcEvent:C.srcEvent,pointers:C.pointers.map(function(T){var B=r.relativeClientPosition(T),L=new c.Raycaster;return L.params.Points={threshold:.1},L.setFromCamera(B,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:B,raycaster:L}}),isFirst:!0,isFinal:!0,scale:C.scale,center:function(T){var B=r.relativeClientPosition(T),L=new c.Raycaster;return L.params.Points={threshold:.1},L.setFromCamera(B,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:B,raycaster:L}}(C.center),velocityX:C.velocityX,velocityY:C.velocityY,overallVelocityX:C.overallVelocityX,overallVelocityY:C.overallVelocityY,userAction:!0,state:F(F({mode:r.mode},r.currentPano),_e(r.camera.pose))});r.onTapGesture(S),y()}}}),a.on("pinchstart pinch pinchend",function(C){var P=o(a);if(!(P&&!i(P.center))){var S=W("gesture.pinch",{target:C.target,pointerType:C.pointerType,srcEvent:C.srcEvent,pointers:C.pointers.map(function(T){var B,L=r.relativeClientPosition(T),k=new c.Raycaster;return k.params.Points={threshold:.1},k.setFromCamera(L,r.camera),{x:T.x,y:T.y,delta:(B=T.delta)!==null&&B!==void 0?B:0,buttons:0,coords:L,raycaster:k}}),isFirst:C.type==="pinchstart",isFinal:C.type==="pinchend",scale:C.scale,center:function(T){var B=r.relativeClientPosition(T),L=new c.Raycaster;return L.params.Points={threshold:.1},L.setFromCamera(B,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:B,raycaster:L}}(C.center),velocityX:C.velocityX,velocityY:C.velocityY,overallVelocityX:C.overallVelocityX,overallVelocityY:C.overallVelocityY,userAction:!0,state:F(F({mode:r.mode},r.currentPano),_e(r.camera.pose))});r.onPinchGesture(S),y()}});var s=null,l=null,u=function(C,P,S){var T={x:S.clientX,y:S.clientY},B=r.relativeClientPosition(T),L=new c.Raycaster;L.params.Points={threshold:.1},L.setFromCamera(B,r.camera);var k=F(F({},T),{coords:B,raycaster:L,buttons:S.buttons,delta:0}),O=C==="pinchend"?P:P-S.deltaY/280,D=W("gesture.pinch",{target:S.target,pointerType:"mouse",srcEvent:S,pointers:[F({},k)],isFirst:C==="pinchstart",isFinal:C==="pinchend",scale:he(O,.1,10),center:F({},k),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:F(F({mode:r.mode},r.currentPano),_e(r.camera.pose))});return D},d=function(C){var P,S={x:C.clientX,y:C.clientY};if(i(S)){if(C.preventDefault(),C.ctrlKey){var T=(P=s==null?void 0:s.prevEvent.scale)!==null&&P!==void 0?P:1,B=u(s?"pinch":"pinchstart",T,C);s===null?s={firstEvent:B,prevEvent:B}:s.prevEvent=B,r.onPinchGesture(B),l!==null&&window.clearTimeout(l),l=window.setTimeout(function(){var K;l=null;var Q=(K=s==null?void 0:s.prevEvent.scale)!==null&&K!==void 0?K:1,G=u("pinchend",Q,C);s=null,r.onPinchGesture(G)},200)}else{var L=(Math.abs(C.deltaY)>Math.abs(C.deltaX)?C.deltaY:C.deltaX)/-60,k=r.mouseWheelState!==void 0,O={x:C.clientX,y:C.clientY},D=r.relativeClientPosition(O),N=new c.Raycaster;N.params.Points={threshold:.1},N.setFromCamera(D,r.camera);var X=F(F({},O),{coords:D,raycaster:N,buttons:C.buttons,delta:L}),B=W("gesture.mousewheel",{target:C.target,pointerType:"mouse",srcEvent:C,pointers:[F({},X)],isFirst:k,isFinal:!1,scale:0,center:F({},X),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:F(F({mode:r.mode},r.currentPano),_e(r.camera.pose))});r.onMouseWheel(B),r.mouseWheelState&&clearTimeout(r.mouseWheelState.timer),r.mouseWheelState={timer:setTimeout(function(){delete r.mouseWheelState;var Q=W("gesture.mousewheel",{target:C.target,pointerType:"mouse",srcEvent:C,pointers:[F(F({},X),{delta:0})],isFirst:!1,isFinal:!0,scale:0,center:F(F({},X),{delta:0}),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:F(F({mode:r.mode},r.currentPano),_e(r.camera.pose))});r.onMouseWheel(Q)},100)}}y()}},f=function(C){if(!Vn()){if(!i({x:C.clientX,y:C.clientY})){A();return}var P=!1;r.mouseMoveState||(P=!0);var S={x:C.clientX,y:C.clientY},T=r.relativeClientPosition(S),B=new c.Raycaster;B.params.Points={threshold:.1},B.setFromCamera(T,r.camera);var L=F(F({},S),{coords:T,raycaster:B,buttons:C.buttons,delta:0}),k=W("gesture.mousemove",{target:C.target,pointerType:"mouse",srcEvent:C,pointers:[F({},L)],isFirst:P,isFinal:!1,scale:0,center:F({},L),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:F(F({mode:r.mode},r.currentPano),_e(r.camera.pose))});r.mouseMoveState={timeStamp:Me(),event:k},r.onMouseMove(k),r.pressState&&Math.abs(C.clientX-r.pressState.event.center.y)>10&&Math.abs(C.clientY-r.pressState.event.center.y)>10&&y()}},A=function(){if(r.mouseMoveState){var C=W(r.mouseMoveState.event.type,F(F({},r.mouseMoveState.event),{isFinal:!0}));delete r.mouseMoveState,r.onMouseMove(C)}y()},m=function(C){if(!i(C.center)){y();return}var P=!1;r.pressState||(P=!0,r.pressState={event:C,timeStamp:Me(),stop:z});var S=Me()-r.pressState.timeStamp,T=W(r.pressState.event.type,F(F({},r.pressState.event),{isFirst:P,isFinal:!1,center:F(F({},r.pressState.event.center),{delta:S}),pointers:r.pressState.event.pointers.map(function(B){return F(F({},B),{delta:S})})}));r.onPressGesture(T),r.pressState&&(r.pressState.stop=vt.shared.add(function(B){m(C)},!0,1))},h=function(C){if(y(),!(C.touches.length>1||C.changedTouches.length<=0)){var P={x:C.changedTouches[0].clientX,y:C.changedTouches[0].clientY},S=r.relativeClientPosition(P),T=new c.Raycaster;T.params.Points={threshold:.1},T.setFromCamera(S,r.camera);var B=F(F({},P),{coords:S,raycaster:T,buttons:0,delta:0}),L=W("gesture.press",{target:C.target,pointerType:"touch",srcEvent:C,pointers:[F({},B)],isFirst:!1,isFinal:!1,scale:0,center:B,velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:F(F({mode:r.mode},r.currentPano),_e(r.camera.pose))});m(L)}},v=function(C){y();var P={x:C.clientX,y:C.clientY},S=r.relativeClientPosition(P),T=new c.Raycaster;T.params.Points={threshold:.1},T.setFromCamera(S,r.camera);var B=F(F({},P),{coords:S,raycaster:T,buttons:C.buttons,delta:0}),L=W("gesture.press",{target:C.target,pointerType:"mouse",srcEvent:C,pointers:[F({},B)],isFirst:!1,isFinal:!1,scale:0,center:B,velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:F(F({mode:r.mode},r.currentPano),_e(r.camera.pose))});m(L)},y=function(){var C;if(r.pressState){var P=Me()-r.pressState.timeStamp,S=W(r.pressState.event.type,F(F({},r.pressState.event),{center:F(F({},r.pressState.event.center),{delta:P}),isFirst:!1,isFinal:!0,pointers:r.pressState.event.pointers.map(function(T){return F(F({},T),{delta:P})})}));r.onPressGesture(S),(C=r.pressState)===null||C===void 0||C.stop(),delete r.pressState}},p=null,g=function(C){var P,S=!1,T=!1;switch(C.type){case"gesturestart":S=!0;break;case"gestureend":T=!0;break}var B={x:C.clientX,y:C.clientY},L=r.relativeClientPosition(B),k=new c.Raycaster;k.params.Points={threshold:.1},k.setFromCamera(L,r.camera);var O=F(F({},B),{coords:L,raycaster:k,buttons:0,delta:0}),D=W("gesture.pinch",{target:C.target,pointerType:"mouse",srcEvent:C,pointers:[F({},O)],isFirst:S,isFinal:T,scale:(P=C.scale)!==null&&P!==void 0?P:1,center:F({},O),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:F(F({mode:r.mode},r.currentPano),_e(r.camera.pose))});return D},x=function(C){if(C.preventDefault(),!Vn()){var P=g(C);p={firstEvent:P};var S=p.firstEvent;S&&!i(S.center)||r.onPinchGesture(P)}},b=function(C){if(C.preventDefault(),!Vn()&&p){var P=g(C),S=p.firstEvent;S&&!i(S.center)||r.onPinchGesture(P)}},w=function(C){if(C.preventDefault(),!Vn()&&p){var P=g(C),S=p.firstEvent;p=null,!(S&&!i(S.center))&&r.onPinchGesture(P)}},E=function(C){if(C&&typeof C.preventDefault=="function"&&C.currentTarget===e&&C.preventDefault(),typeof getSelection=="function"){var P=getSelection();P&&P.focusNode&&(P.removeAllRanges&&P.removeAllRanges(),P.empty&&P.empty())}};this.enableWheel&&e.addEventListener("wheel",d,{passive:!1}),e.addEventListener("mousemove",f,!1),e.addEventListener("mouseout",A,!1),e.addEventListener("touchstart",h,{passive:!0}),e.addEventListener("touchend",y,!1),e.addEventListener("touchcancel",y,!1),e.addEventListener("mousedown",v,!1),e.addEventListener("mouseup",y,!1),e.addEventListener("gesturestart",x,{passive:!1}),e.addEventListener("gesturechange",b,{passive:!1}),e.addEventListener("gestureend",w,{passive:!1}),e.addEventListener("touchstart",E,{passive:!1}),e.addEventListener("contextmenu",E,!1);var M=function(){a.destroy(),e.removeEventListener("wheel",d,!1),e.removeEventListener("mousemove",f,!1),e.removeEventListener("mouseout",A,!1),e.removeEventListener("touchstart",h,!1),e.removeEventListener("touchend",y,!1),e.removeEventListener("touchcancel",y,!1),e.removeEventListener("mousedown",v,!1),e.removeEventListener("mouseup",y,!1),e.removeEventListener("gesturestart",x,!1),e.removeEventListener("gesturechange",b,!1),e.removeEventListener("gestureend",w,!1),e.removeEventListener("touchstart",E,!1),e.removeEventListener("contextmenu",E,!1)};return Object.assign(M,{element:e})},t.prototype.preloadPano=function(e,r){var i=this;r===void 0&&(r=z);var a=this.works.getResolvedObserver(e);if(!a)return Promise.resolve();var o=["right","left","up","down","front","back"];return Promise.all(o.map(function(s){var l=F({key:"pano.".concat(Ue(e),".").concat(s)},Cr(i.imageOptions,["size","format","quality","mappings"])),u=a.images[s],d=bi(u,i.imageOptions.transform,l);return it(a.work).preload(d)})).then(function(){return r(e),e})},t.prototype.updateScreenBuffer=function(e){var r,i,a,o,s,l;if(this.lastPostProcessingType!==e)if(this.lastPostProcessingType=e,e==="luminance"){if(this.screenBuffers.length===0){var u=this.renderer.getDrawingBufferSize(ca);this.screenBuffers=[new c.WebGLRenderTarget(u.x,u.y,{encoding:(i=(r=this.renderer)===null||r===void 0?void 0:r.outputEncoding)!==null&&i!==void 0?i:c.sRGBEncoding}),this.modelRenderTarget]}}else if(e==="edl"){if(this.screenBuffers.length===0){var u=this.renderer.getDrawingBufferSize(ca);this.screenBuffers=[new c.WebGLRenderTarget(u.x,u.y,{encoding:(o=(a=this.renderer)===null||a===void 0?void 0:a.outputEncoding)!==null&&o!==void 0?o:c.sRGBEncoding,minFilter:c.NearestFilter,magFilter:c.NearestFilter,format:c.RGBAFormat,type:c.FloatType}),this.modelRenderTarget]}this.models.setMaterial({useEDL:!0})}else if(e==="hq"){if(this.screenBuffers.length===0){var u=this.renderer.getDrawingBufferSize(ca),d=new c.WebGLRenderTarget(u.x,u.y,{minFilter:c.NearestFilter,magFilter:c.NearestFilter,format:c.RGBAFormat,type:c.FloatType,depthTexture:new c.DepthTexture(u.x,u.y,c.UnsignedIntType)});d.depthTexture.format=c.DepthFormat,d.depthBuffer=!0;var f=new c.WebGLRenderTarget(u.x,u.y,{encoding:(l=(s=this.renderer)===null||s===void 0?void 0:s.outputEncoding)!==null&&l!==void 0?l:c.sRGBEncoding,minFilter:c.NearestFilter,magFilter:c.NearestFilter,format:c.RGBAFormat,type:c.FloatType,depthTexture:d.depthTexture});this.screenBuffers=[d,f,this.modelRenderTarget]}this.models.setMaterial({useHQDepth:!0,useHQWeight:!1,pointShape:"CIRCLE"})}else this.screenBuffers&&(this.screenBuffers.forEach(function(A){A.dispose()}),this.screenBuffers=[]),this.models.setMaterial({useEDL:!1,useHQDepth:!1,useHQWeight:!1})},t}(ki),Ua=function(n){ue(t,n);function t(e){var r=this,i,a=t.parseArgs(e);return r=n.call(this,a)||this,r.mode="Floorplan",r.defaultLongitude=a.defaultLongitude,r.defaultLatitude=a.defaultLatitude,r.defaultFov=a.defaultFov,r.maxFov=a.maxFov,r.minFov=a.minFov,r.maxLatitude=a.maxLatitude,r.minLatitude=a.minLatitude,r.modelInScreen=a.modelInScreen,r.locationMotion=new Se({x:r.camera.pose.offset.x,y:r.camera.pose.offset.y,z:r.camera.pose.offset.z,distance:r.camera.pose.distance}),r.modelAlphaMotion=new Se({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new Se({perspToOrtho:r.camera.perspToOrtho.x}),r.currentTapId=null,r.intersectMeshCreator=a.intersectMeshCreator,r.intersectMesh=r.intersectMeshCreator(),r.intersectMesh.name="intersect",r.intersectMesh.visible=!1,r.helper.add(r.intersectMesh),r}return t.distanceFromModel=function(e,r,i){var a=e.bounding,o=Math.pow(Math.pow(a.max.x-a.min.x+1,2)+Math.pow(a.max.y-a.min.y+1,2)+Math.pow(a.max.z-a.min.z+1,2),1/2),s=o/2/Math.tan(Math.PI*r/360);return i<1&&(s=s/i),isNaN(s)?o:s},t.parseArgs=function(e){var r,i,a,o,s,l,u,d,f;if(e instanceof t)return e;var A=n.parseArgs.call(this,e);return F(F({},A),{defaultLongitude:(r=e.defaultLongitude)!==null&&r!==void 0?r:Math.PI/4,defaultLatitude:(i=e.defaultLatitude)!==null&&i!==void 0?i:Math.PI/4,defaultFov:(a=e.defaultFov)!==null&&a!==void 0?a:80,maxFov:(o=e.maxFov)!==null&&o!==void 0?o:120,minFov:(s=e.minFov)!==null&&s!==void 0?s:20,maxLatitude:(l=e.maxLatitude)!==null&&l!==void 0?l:+Math.PI/2,minLatitude:(u=e.minLatitude)!==null&&u!==void 0?u:-Math.PI/2,modelInScreen:(d=e.modelInScreen)!==null&&d!==void 0?d:"boundingbox-center",intersectMeshCreator:(f=e.intersectMeshCreator)!==null&&f!==void 0?f:function(){return new Li}})},t.initAnimationEndState=function(e){var r,i,a,o,s,l,u=this.parseArgs(e),d=e.initial,f=d.state,A=d.currentState,m=typeof f.panoIndex=="number"?{workCode:(a=(r=f.workCode)!==null&&r!==void 0?r:(i=u.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:f.panoIndex}:{workCode:A.workCode,panoIndex:A.panoIndex},h=F(F({},m),{mode:"Floorplan",longitude:(o=f.longitude)!==null&&o!==void 0?o:Na(A.mode)?A.longitude:u.defaultLongitude,latitude:he((s=f.latitude)!==null&&s!==void 0?s:A.mode==="Floorplan"?A.latitude:u.defaultLatitude,u.minLatitude,u.maxLatitude),fov:(l=f.fov)!==null&&l!==void 0?l:u.defaultFov,offset:e.models.bounding.getCenter(new c.Vector3),distance:t.distanceFromModel(u.models,u.defaultFov,u.camera.aspect)});return h},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.locationMotion.dispose(),delete this.panState,this.intersectMesh.dispose(),this.helper.remove(this.intersectMesh)},t.prototype.isReady=function(){return this.locationMotion.ended===!1?!1:n.prototype.isReady.call(this)},t.prototype.updateWork=function(e,r,i,a){var o;return this.works=e,this.updateCamera(r,(o=i.duration)!==null&&o!==void 0?o:0,a),!0},t.prototype.updateModel=function(e){n.prototype.updateModel.call(this,e);var r=e.bounding.getCenter(new c.Vector3),i=t.distanceFromModel(e,this.defaultFov,this.camera.aspect);this.locationMotion.set({x:r.x,y:r.y,z:r.z,distance:i},0).catch(z)},t.prototype.updateCamera=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();var o={},s={};return e.distance!==void 0&&(o.distance=e.distance),e.offset!==void 0&&(o.x=e.offset.x,o.y=e.offset.y,o.z=e.offset.z),e.longitude!==void 0&&(s.longitude=e.longitude),e.latitude!==void 0&&(s.latitude=e.latitude),e.fov!==void 0&&(s.fov=e.fov),a.locationMotion.set(o,r).catch(z),a.cameraMotion.set(s,r).catch(z)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();for(var o=[],s=[],l=0,u=e;l<u.length;l++){var d=u[l];o.push({key:d.key,progress:d.progress,value:{distance:d.value.distance,x:d.value.offset.x,y:d.value.offset.x,z:d.value.offset.x}}),s.push({key:d.key,progress:d.progress,value:{longitude:d.value.longitude,latitude:d.value.latitude,fov:d.value.fov}})}return a.locationMotion.setKeyframes(o,r).catch(z),a.cameraMotion.setKeyframes(e,r)})},t.prototype.updateTime=function(e,r){if(!this.destroyed){var i={},a={};this.modelAlphaMotion.ended||(this.modelAlphaMotion.update(e),i.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended||(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(he(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended||(this.locationMotion.update(e),a.distance=this.locationMotion.value.distance,a.offset=new c.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z)),this.cameraMotion.ended||(this.cameraMotion.update(e),a.longitude=this.cameraMotion.value.longitude,a.latitude=this.cameraMotion.value.latitude,a.fov=this.cameraMotion.value.fov),Nt(i)||this.models.setMaterial(i),Nt(a)||this.setCamera(a)}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(Me())[1],r=this.locationMotion.getKeyFrameSegment(Me())[1];return F(F({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:new c.Vector3(r.value.x,r.value.y,r.value.z),distance:r.value.distance})},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var i=e.initial;i.state,i.currentState;var a=i.duration,o=i.userAction;e.userAction=o;var s=t.initAnimationEndState(e),l=Cr(s,["longitude","latitude","fov"]),u={x:s.offset.x,y:s.offset.y,z:s.offset.z,distance:s.distance},d={modelAlpha:1},f={perspToOrtho:0};e.emit("initAnimation.start",W("initAnimation.start",{state:s,userAction:e.userAction})),e.modelAlphaMotion.set(d,a/3).catch(z),e.perspToOrthoMotion.set(f,a).catch(z),e.cameraMotion.set(l,a).catch(z),e.locationMotion.set(u,a).then(function(){e.emit("initAnimation.end",W("initAnimation.end",{state:s,userAction:e.userAction}))},function(A){var m=F(F(F({},e.currentPano),{mode:e.mode}),_e(e.camera.pose));e.emit("initAnimation.end",W("initAnimation.end",{state:m,userAction:e.userAction}))}).then(function(){r()})})},t.prototype.updateRenderSize=function(e){this.needsRender=!0,this.modelSceneNeedsRender=!0,this.screenBuffers.forEach(function(r){r.setSize(e.x,e.y)}),this.locationMotion.set({distance:t.distanceFromModel(this.models,this.defaultFov,this.camera.aspect)},0).catch(z)},t.prototype.getForwardObserverOrNot=function(e){var r=this.models.intersectRaycaster(e)[0];if(!r)return null;var i=this.works.resolvedObservers,a=ur(i,function(l){return l.standingPosition.distanceTo(r.point)},!0),o=a[0],s=a[1];return o&&s<10?o:null},t.prototype.coordinatesForOffset=function(e){var r=this.renderer.getSize(new c.Vector2);return{longitude:-2*e.x/(r.x*this.scissor.width),latitude:2*e.y/(r.y*this.scissor.height)}},t.prototype.requestMomentumMovement=function(e,r,i,a){var o=this;if(this.inMomentumMovement!==null){for(var s=F({},i),l={longitude:0,latitude:0},u=0;u<a;u++)s.longitude*=.996,s.latitude*=.996*.998,l.longitude+=s.longitude,l.latitude+=s.latitude;var d=Kr(this.cameraMotion.value.longitude+l.longitude),f=he(this.cameraMotion.value.latitude+l.latitude,this.minLatitude,this.maxLatitude),A=F(F({},this.currentPano),{mode:this.mode,longitude:d,latitude:f,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance}),m=!(s.longitude>1e-4||s.longitude<-1e-4||s.latitude>1e-4||s.latitude<-1e-4),h=W("gesture.momentum",F(F({},e),{isFirst:r,isFinal:m,state:A}));if(this.inMomentumMovement.event=h,this.emit("gesture.momentum",h),e.defaultPrevented){this.inMomentumMovement=null;return}this.inMomentumMovement&&(this.cameraMotion.set({longitude:d,latitude:f},0).catch(z),m?this.inMomentumMovement=null:vt.shared.add(function(v,y){o.requestMomentumMovement(e,!1,s,y|0)},!0,1))}},t.prototype.onPanGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var r=this.panState,i=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:i,x:e.center.x,y:e.center.y},!(typeof r=="undefined"||r.pointerLength!==i)){var a={x:e.center.x-r.x,y:e.center.y-r.y},o=this.relativeClientPosition(e.center),s=this.camera.pose.latitude<Math.PI/6||o.y<0?1:-1;a.x*=s;var l=this.coordinatesForOffset(a),u=Kr(this.cameraMotion.value.longitude+l.longitude),d=he(this.cameraMotion.value.latitude+l.latitude,this.minLatitude,this.maxLatitude);this.camera.aspect<1&&Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(d=this.cameraMotion.value.latitude);var f=F(F({},this.currentPano),{mode:this.mode,longitude:u,latitude:d,fov:this.camera.pose.fov,offset:this.camera.pose.offset,distance:this.camera.pose.distance});if(e.state=f,this.emit("gesture.pan",e),!e.defaultPrevented&&(this.cameraMotion.set({longitude:f.longitude,latitude:f.latitude},0).catch(z),e.isFinal)){var A=e.velocityX*s,m=e.velocityY;this.inMomentumMovement={uuid:wt()},this.requestMomentumMovement(e,!0,this.coordinatesForOffset({x:A,y:m}),0)}}},t.prototype.onPinchGesture=function(e){var r;if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement();var i=(r=this.pinchState)===null||r===void 0?void 0:r.fov;if(e.isFirst){this.pinchState={x:e.center.x,y:e.center.y,fov:this.cameraMotion.value.fov};return}if(e.isFinal&&(delete this.panState,delete this.pinchState),typeof i!="undefined"){var a=he(i/e.scale,this.minFov,this.maxFov);e.state.fov=a,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:a},0).catch(z),this.onPanGesture(e))}}},t.prototype.onMouseMove=function(e){var r,i;if(this.intersectMesh.parent&&!this.panState){if(this.emit("gesture.mousemove",e),e.defaultPrevented){this.hideIntersectMesh();return}var a=e.center.raycaster;if(e.isFinal&&this.intersectMesh.parent&&this.intersectMesh.visible===!0){this.hideIntersectMesh();return}var o=this.models.intersectRaycaster(a)[0],s=W("intersect.update",{raycaster:a,intersection:o!=null?o:null,object:this.intersectMesh});if(this.emit("intersect.update",s),s.defaultPrevented){this.hideIntersectMesh();return}if(o){var l=(i=(r=o.face)===null||r===void 0?void 0:r.normal)!==null&&i!==void 0?i:new c.Vector3().copy(a.ray.direction).multiplyScalar(-1),u=l.clone(),d=o.point.clone();this.intersectMesh.position.copy(d);var f=d.clone().add(u);if(this.intersectMesh.lookAt(f),Math.abs(l.y)>.99){var A=this.camera.position.clone().sub(d);this.intersectMesh.rotation.z=-Math.atan2(A.z,A.x)}this.intersectMesh.visible=!0,this.needsRender=!0}else this.hideIntersectMesh()}},t.prototype.onMouseWheel=function(e){if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement();var r=this,i=r.minFov,a=r.maxFov,o=he(this.camera.fov-e.center.delta,i,a);e.state.fov=o,this.emit("gesture.mousewheel",e),!e.defaultPrevented&&this.cameraMotion.set({fov:o},0).catch(z)}},t.prototype.onTapGesture=function(e){var r=this;this.userAction=!0,this.stopMomentumMovement();var i=e.center.raycaster,a=this.getForwardObserverOrNot(i);if(!a)this.emit("gesture.tap",e);else{var o={longitude:this.camera.pose.longitude,latitude:0},s=F(F({},e.state),{mode:"Panorama",workCode:a.pano.workCode,panoIndex:a.pano.panoIndex,longitude:o.longitude,latitude:o.latitude,offset:a?a.position.clone():new c.Vector3,distance:0});if(e.state=s,this.emit("gesture.tap",e),!e.defaultPrevented&&(this.emit("pano.select",W("pano.select",{prevPano:this.currentPano,state:s,userAction:e.userAction,options:o,progress:0,error:null})),a&&a.active)){var l=this.currentTapId=wt();this.preloadPano(a.pano).then(function(u){r.currentTapId===l&&r.emit("pano.request",W("pano.request",{userAction:!0,prevPano:r.currentPano,progress:0,state:s,options:o,error:null}))})}}},t.prototype.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.needsRender=!0},t}(ho),Ih=function(n){ue(t,n);function t(e){var r=this,i=t.parseArgs(e);return r=n.call(this,i)||this,r.mode="Topview",r}return t.parseArgs=function(e){if(e instanceof t)return e;var r=F(F({},e),{defaultLongitude:0,defaultLatitude:Math.PI/2});return n.parseArgs.call(this,r)},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return F(F({},i),{longitude:r.defaultLongitude,latitude:r.defaultLatitude,mode:"Topview"})},t.prototype.updateModel=function(e){this.needsRender=!0,this.modelSceneNeedsRender=!0;var r=this.models.bounding.getCenter(new c.Vector3);this.locationMotion.set({x:r.x,y:r.y,z:r.z,distance:Ua.distanceFromModel(this.models,this.defaultFov,this.camera.aspect)},0).catch(z)},t.prototype.updateCamera=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();var o={},s={};return e.distance!==void 0&&(o.distance=e.distance),e.offset!==void 0&&(o.x=e.offset.x,o.y=e.offset.y,o.z=e.offset.z),e.longitude!==void 0&&(s.longitude=e.longitude),e.latitude!==void 0&&(s.latitude=e.latitude),e.fov!==void 0&&(s.fov=e.fov),a.locationMotion.set(o,r).catch(z),a.cameraMotion.set(s,r).catch(z)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();for(var o=[],s=[],l=0,u=e;l<u.length;l++){var d=u[l];o.push({key:d.key,progress:d.progress,value:{distance:d.value.distance,x:d.value.offset.x,y:d.value.offset.y,z:d.value.offset.z}}),s.push({key:d.key,progress:d.progress,value:{longitude:d.value.longitude,latitude:d.value.latitude,fov:d.value.fov}})}return a.locationMotion.setKeyframes(o,r).catch(z),a.cameraMotion.setKeyframes(e,r)})},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var i=e.initial;i.state,i.currentState;var a=i.duration,o=i.userAction;e.userAction=o;var s=t.initAnimationEndState(e),l={longitude:s.longitude,latitude:s.latitude,fov:s.fov},u={x:s.offset.x,y:s.offset.y,z:s.offset.z,distance:s.distance},d={modelAlpha:1},f={perspToOrtho:1};e.emit("initAnimation.start",W("initAnimation.start",{state:s,userAction:e.userAction})),e.modelAlphaMotion.set(d,a/3).catch(z),e.perspToOrthoMotion.set(f,a).catch(z),e.cameraMotion.set(l,a).catch(z),e.locationMotion.set(u,a).then(function(){e.emit("initAnimation.end",W("initAnimation.end",{state:s,userAction:e.userAction}))},function(A){var m=F(F(F({},e.currentPano),{mode:e.mode}),_e(e.camera.pose));e.emit("initAnimation.end",W("initAnimation.end",{state:m,userAction:e.userAction}))}).then(function(){r()})})},t.prototype.requestMomentumMovement=function(){this.inMomentumMovement=null},t.prototype.onPanGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement();var r=this.panState,i=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:i,x:e.center.x,y:e.center.y},!(typeof r=="undefined"||r.pointerLength!==i)){var a={x:e.center.x-r.x,y:e.center.y-r.y},o=new c.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),s=this.locationMotion.value.distance;s*=Math.tan(this.cameraMotion.value.fov/2*Math.PI/180);var l=this.renderer.getSize(new c.Vector2),u=2*a.x*s/l.y,d=2*a.y*s/l.y,f=new c.Vector3;f.setFromMatrixColumn(this.camera.matrix,0),f.multiplyScalar(-u),o.add(f),f.setFromMatrixColumn(this.camera.matrix,0),f.crossVectors(this.camera.up,f),f.multiplyScalar(d),o.add(f),this.modelInScreen==="boundingbox-center"&&o.clamp(this.models.bounding.min,this.models.bounding.max);var A=F(F({},this.currentPano),{mode:this.mode,longitude:0,latitude:Math.PI/2,fov:this.cameraMotion.value.fov,offset:o,distance:this.locationMotion.value.distance});e.state=A,this.emit("gesture.pan",e),!e.defaultPrevented&&this.locationMotion.set({x:o.x,y:o.y,z:o.z},0).catch(z)}},t.prototype.onPinchGesture=function(e){var r;if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement();var i=(r=this.pinchState)===null||r===void 0?void 0:r.fov;if(e.isFirst){this.pinchState={x:e.center.x,y:e.center.y,fov:this.cameraMotion.value.fov};return}if(e.isFinal&&delete this.pinchState,typeof i!="undefined"){var a=he(i/e.scale,this.minFov,this.maxFov);e.state.fov=a,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:a},0).catch(z),e.type="gesture.pan",this.onPanGesture(e))}}},t.prototype.onMouseWheel=function(e){if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement();var r=he(this.cameraMotion.value.fov-e.center.delta,this.minFov,this.maxFov);e.state.fov=r,this.emit("gesture.mousewheel",e),!e.defaultPrevented&&this.cameraMotion.set({fov:r},0).catch(z)}},t}(Ua),mu=function(n){ue(t,n);function t(e){var r=this,i=t.parseArgs(e);return r=n.call(this,i)||this,r.mode="PanoramaLike",r.defaultLatitude=i.defaultLatitude,r.defaultFov=i.defaultFov,r.maxFov=i.maxFov,r.minFov=i.minFov,r.maxLatitude=i.maxLatitude,r.minLatitude=i.minLatitude,r.moveSpeed=i.moveSpeed,r.intersectMeshCreator=i.intersectMeshCreator,r.intersectMesh=r.intersectMeshCreator(),r.intersectMesh.name="intersect",r.intersectMesh.visible=!1,r.helper.add(r.intersectMesh),r}return t.parseArgs=function(e){var r,i,a,o,s,l,u,d;if(e instanceof t)return e;var f=n.parseArgs.call(this,e);return F(F({},f),{defaultLatitude:(r=e.defaultLatitude)!==null&&r!==void 0?r:0,defaultFov:(i=e.defaultFov)!==null&&i!==void 0?i:90,maxFov:(a=e.maxFov)!==null&&a!==void 0?a:120,minFov:(o=e.minFov)!==null&&o!==void 0?o:40,maxLatitude:(s=e.maxLatitude)!==null&&s!==void 0?s:+Math.PI/2,minLatitude:(l=e.minLatitude)!==null&&l!==void 0?l:-Math.PI/2,moveSpeed:(u=e.moveSpeed)!==null&&u!==void 0?u:3.4,intersectMeshCreator:(d=e.intersectMeshCreator)!==null&&d!==void 0?d:function(){return new Li}})},t.initAnimationEndState=function(e){var r,i,a,o,s,l,u=this.parseArgs(e),d=u.works,f=e.initial,A=f.state,m=f.currentState,h=typeof A.panoIndex=="number"?{workCode:(a=(r=A.workCode)!==null&&r!==void 0?r:(i=u.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:A.panoIndex}:{workCode:m.workCode,panoIndex:m.panoIndex},v=d.getResolvedObserver(h),y=(o=A.longitude)!==null&&o!==void 0?o:m.longitude,p=he((s=A.latitude)!==null&&s!==void 0?s:Jn(m.mode)?m.latitude:u.defaultLatitude,u.minLatitude,u.maxLatitude),g=he((l=A.fov)!==null&&l!==void 0?l:Jn(m.mode)?m.fov:u.defaultFov,u.minFov,u.maxFov),x=v?v.position.clone():new c.Vector3;return{workCode:h.workCode,panoIndex:h.panoIndex,mode:"PanoramaLike",longitude:y,latitude:p,fov:g,offset:x,distance:0}},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.intersectMesh&&(this.helper.remove(this.intersectMesh),this.intersectMesh.dispose()),delete this.panState},t.prototype.isReady=function(){return this.panState||this.pinchState?!1:n.prototype.isReady.call(this)},t.prototype.calculateMovingDuration=function(e,r){switch(typeof e){case"function":return e(r,this.moveSpeed);case"number":return e;case"string":return Number(e);default:return he(r,2,5)/this.moveSpeed*1e3}},t.prototype.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.needsRender=!0},t.prototype.coordinatesForOffset=function(e){var r=this.cameraMotion.value.fov,i=this.camera.aspect,a=this.renderer.getSize(new c.Vector2);return{longitude:2*e.x/(a.x*this.scissor.width)*r/95*i,latitude:-2*e.y/(a.y*this.scissor.height)*r/95}},t.prototype.cameraBounce=function(){var e=this.cameraMotion.value,r=e.longitude,i=e.latitude,a=e.fov,o=[{progress:0,value:{longitude:r,latitude:i,fov:a}},{progress:.5,value:{longitude:r,latitude:i,fov:a*.98}},{progress:1,value:{longitude:r,latitude:i,fov:a}}];this.cameraMotion.setKeyframes(o,500).catch(z)},t.prototype.requestMomentumMovement=function(e,r,i,a){var o=this;if(this.inMomentumMovement!==null){for(var s=F({},i),l={longitude:0,latitude:0},u=0;u<a;u++)s.longitude*=.996,s.latitude*=.996*.99,l.longitude+=s.longitude,l.latitude+=s.latitude;var d=Kr(this.cameraMotion.value.longitude+l.longitude),f=he(this.cameraMotion.value.latitude+l.latitude,this.minLatitude,this.maxLatitude),A=F(F({},this.currentPano),{mode:this.mode,longitude:d,latitude:f,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance}),m=!(s.longitude>1e-4||s.longitude<-1e-4||s.latitude>1e-4||s.latitude<-1e-4),h=W("gesture.momentum",F(F({},e),{isFirst:r,isFinal:m,state:A}));if(this.inMomentumMovement.event=h,this.emit("gesture.momentum",h),e.defaultPrevented){this.inMomentumMovement=null;return}this.inMomentumMovement&&(this.cameraMotion.set({longitude:d,latitude:f},0).catch(z),m?this.inMomentumMovement=null:vt.shared.add(function(v,y){o.requestMomentumMovement(e,!1,s,y|0)},!0,1))}},t.prototype.onPanGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var r=this.panState,i=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:i,x:e.center.x,y:e.center.y},!(typeof r=="undefined"||r.pointerLength!==i)){var a={x:e.center.x-r.x,y:e.center.y-r.y},o=this.coordinatesForOffset(a),s=Kr(this.cameraMotion.value.longitude+o.longitude),l=he(this.cameraMotion.value.latitude+o.latitude,this.minLatitude,this.maxLatitude);this.camera.aspect<1&&Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(l=this.cameraMotion.value.latitude);var u=F(F({},this.currentPano),{mode:this.mode,longitude:s,latitude:l,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance});if(e.state=u,this.emit("gesture.pan",e),!e.defaultPrevented){var d={longitude:u.longitude,latitude:u.latitude,fov:u.fov};if(this.cameraMotion.set(d,0).catch(z),e.isFinal){var f=e.velocityX,A=e.velocityY*.6;Math.abs(A)>.5&&Math.abs(f)<.5&&(f=0),this.inMomentumMovement={uuid:wt()},this.requestMomentumMovement(e,!0,this.coordinatesForOffset({x:f,y:A}),0)}}}},t.prototype.onPinchGesture=function(e){var r;this.userAction=e.userAction,this.stopMomentumMovement();var i=(r=this.pinchState)===null||r===void 0?void 0:r.fov,a=e.scale;if(e.isFirst){this.pinchState={x:e.center.x,y:e.center.y,fov:this.cameraMotion.value.fov};return}if(e.isFinal&&delete this.pinchState,typeof i!="undefined"){var o=he(i/a,this.minFov,this.maxFov);e.state.fov=o,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:o},0).catch(z),e.type="gesture.pan",this.onPanGesture(e))}},t.prototype.onMouseWheel=function(e){this.userAction=e.userAction,this.stopMomentumMovement();var r=he(this.cameraMotion.value.fov-e.center.delta,this.minFov,this.maxFov);e.state.fov=r,this.emit("gesture.mousewheel",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:r},0).catch(z),this.onMouseMove(e))},t.prototype.onMouseMove=function(e){var r,i;if(this.intersectMesh.parent&&!this.panState&&(this.emit("gesture.mousemove",e),!e.defaultPrevented)){var a=e.center.raycaster;if(e.isFinal&&this.intersectMesh.parent){this.hideIntersectMesh();return}var o=this.models.intersectRaycaster(a)[0],s=W("intersect.update",{raycaster:a,intersection:o!=null?o:null,object:this.intersectMesh});if(this.emit("intersect.update",s),s.defaultPrevented){this.hideIntersectMesh();return}if(o){var l=(i=(r=o.face)===null||r===void 0?void 0:r.normal)!==null&&i!==void 0?i:new c.Vector3().copy(a.ray.direction).multiplyScalar(-1),u=l.clone(),d=o.point.clone();this.intersectMesh.position.copy(d);var f=d.clone().add(u);if(this.intersectMesh.lookAt(f),Math.abs(l.y)>.99){var A=this.camera.position.clone().sub(d);this.intersectMesh.rotation.z=-Math.atan2(A.z,A.x)}this.intersectMesh.visible=!0,this.needsRender=!0}else this.hideIntersectMesh()}},t}(ho),Th="data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGBf//rdxF6b3m2Ui3lizYINkj7u94MjY0IC0gY29yZSAxNDIgcjIgOTU2YzhkOCAtIEguMjY0L01QRUctNCBBVkMgY29kZWMgLSBDb3B5bGVmdCAyMDAzLTIwMTQgLSBodHRwOi8vd3d3LnZpZGVvbGFuLm9yZy94MjY0Lmh0bWwgLSBvcHRpb25zOiBjYWJhYz0wIHJlZj0zIGRlYmxvY2s9MTowOjAgYW5hbHlzZT0weDE6MHgxMTEgbWU9aGV4IHN1Ym1lPTcgcHN5PTEgcHN5X3JkPTEuMDA6MC4wMCBtaXhlZF9yZWY9MSBtZV9yYW5nZT0xNiBjaHJvbWFfbWU9MSB0cmVsbGlzPTEgOHg4ZGN0PTAgY3FtPTAgZGVhZHpvbmU9MjEsMTEgZmFzdF9wc2tpcD0xIGNocm9tYV9xcF9vZmZzZXQ9LTIgdGhyZWFkcz02IGxvb2thaGVhZF90aHJlYWRzPTEgc2xpY2VkX3RocmVhZHM9MCBucj0wIGRlY2ltYXRlPTEgaW50ZXJsYWNlZD0wIGJ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AAAABMYXZmNTUuMzMuMTAw",da;function gu(){return da||(da=new Promise(function(n){var t,e=document.createElement("video");e.muted=!0,e.src=Th,e.addEventListener("timeupdate",function r(){e.removeEventListener("timeupdate",r,!1),clearTimeout(t);var i=document.createElement("canvas");i.width=i.height=1;var a=i.getContext("2d");if(!a){n(!1);return}a.drawImage(e,0,0,1,1);var o=a.getImageData(0,0,1,1).data;o[3]>10?n(!0):n(!1)},!1),e.addEventListener("canplay",function r(){e.removeEventListener("canplay",r,!1),e.play()},!1),t=window.setTimeout(function(){return n(!1)},1e3)}))}var Ph=`
|
|
1369
|
+
`,Sh=new c.OrthographicCamera(-1,1,1,-1,0,1),ho=new c.BufferGeometry;ho.setAttribute("position",new c.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));ho.setAttribute("uv",new c.Float32BufferAttribute([0,2,0,0,2,0],2));var Au=new c.MeshBasicMaterial,Ua=new c.Mesh(ho,Au),mu=new c.Scene;mu.add(Ua);var Ih=function(){function n(t){this.renderer=t,this.material=new c.ShaderMaterial({vertexShader:Mh,fragmentShader:Ch,uniforms:Object.assign({depthBuffer:new c.Uniform(null)}),blending:c.NoBlending,depthWrite:!0,depthTest:!0}),this.renderer.getContext()&&this.renderer.getContext()instanceof WebGLRenderingContext&&(this.material.extensions.fragDepth=!0)}return n.prototype.render=function(t,e){var r=this.renderer.getRenderTarget();this.material.uniforms.depthBuffer.value=t,Ua.material=this.material,this.renderer.setRenderTarget(e||null),this.renderer.render(mu,Sh),this.renderer.setRenderTarget(r),Ua.material=Au},n.prototype.dispose=function(){this.material.dispose()},n}(),ca=new c.Vector2,po=function(n){ue(t,n);function t(e){var r,i,a,o,s,l,u=n.call(this)||this,d=t.parseArgs(e);u.mode="",u.pending=new Set,u.userAction=d.initial.userAction,u.destroyed=!1,u.ident=d.ident,u.scene=d.scene,u.xrCustomObjectsScene=d.xrCustomObjectsScene,u.helper=d.helper,u.boundingMesh=d.boundingMesh,u.camera=d.camera,u.renderer=d.renderer,u.scissor=d.scissor,u.element=d.element,u.models=d.models,u.enableWheel=d.enableWheel,u.enableIOSEDR=(r=d.enableIOSEDR)!==null&&r!==void 0?r:!1,u.enableEDL=(i=d.enableEDL)!==null&&i!==void 0?i:!0,u.enableHQ=(a=d.enableHQ)!==null&&a!==void 0?a:!0,u.works=d.works,u.imageOptions=d.imageOptions,u.videoTexture=d.videoTexture,u.extraElements=d.extraElements,u.initial=d.initial,u.currentPano=typeof u.initial.state.panoIndex=="number"?{workCode:(l=(o=u.initial.state.workCode)!==null&&o!==void 0?o:(s=d.works[0])===null||s===void 0?void 0:s.workCode)!==null&&l!==void 0?l:"",panoIndex:u.initial.state.panoIndex}:{workCode:u.initial.currentState.workCode,panoIndex:u.initial.currentState.panoIndex},u.needsRender=!0,u.modelSceneNeedsRender=!0,u.cameraMotion=new Se({longitude:{value:u.camera.pose.longitude,circle:[0,Math.PI*2]},latitude:u.camera.pose.latitude,fov:u.camera.pose.fov}),u.inMomentumMovement=null,u.eventUnbinds=[d.element].concat(d.extraElements||[]).map(function(A){return u.bindEvents(A)}),u.pending.add("init-animation"),u.initAnimationReady=new Promise(function(A){vt.shared.add(function(){u.initAnimation().then(function(){u.pending.delete("init-animation"),A()})},!0)}),u.initAnimationIsReady=!1,u.initAnimationReady.then(function(){return u.initAnimationIsReady=!0}),u.modelScene=d.modelScene;var f=new c.Vector2;return u.renderer.getDrawingBufferSize(f),u.modelRenderTarget=d.modelRenderTarget,u.copyPass=new vu(u.renderer),u.depthCopyPass=new Ih(u.renderer),u.screenBuffers=[],u.lastPostProcessingType=null,u}return t.parseArgs=function(e){return e instanceof t?e:F({},e)},t.initAnimationEndState=function(e){var r,i,a,o,s,l,u,d,f=this.parseArgs(e),A=f.initial,m=A.state,h=A.currentState,v=typeof m.panoIndex=="number"?{workCode:(a=(r=m.workCode)!==null&&r!==void 0?r:(i=f.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:m.panoIndex}:{workCode:h.workCode,panoIndex:h.panoIndex};return F(F({},v),{mode:"",longitude:(o=m.longitude)!==null&&o!==void 0?o:h.longitude,latitude:(s=m.latitude)!==null&&s!==void 0?s:h.latitude,fov:(l=m.fov)!==null&&l!==void 0?l:h.fov,offset:(u=m.offset)!==null&&u!==void 0?u:h.offset,distance:(d=m.distance)!==null&&d!==void 0?d:h.distance})},t.prototype.destroy=function(){var e;this.stopMomentumMovement(),this.destroyed=!0,this.off(),this.cameraMotion.dispose();for(var r=0,i=this.eventUnbinds;r<i.length;r++){var a=i[r];a()}this.copyEffect&&(this.copyEffect.dispose(),delete this.copyEffect),delete this.panState,(e=this.pressState)===null||e===void 0||e.stop(),delete this.pressState},t.prototype.isReady=function(){return this.inMomentumMovement===null&&this.pending.size===0&&this.cameraMotion.ended===!0},t.prototype.bindExtraElement=function(e){for(var r=0,i=this.eventUnbinds;r<i.length;r++){var a=i[r];if(a.element===e)return}this.eventUnbinds.push(this.bindEvents(e))},t.prototype.unbindExtraElement=function(e){for(var r=[],i=0,a=this.eventUnbinds;i<a.length;i++){var o=a[i];o.element===e?o():r.push(o)}this.eventUnbinds=r},t.prototype.updateRenderSize=function(e){this.needsRender=!0,this.modelSceneNeedsRender=!0,this.modelRenderTarget.setSize(e.x,e.y),this.screenBuffers.forEach(function(r){r.setSize(e.x,e.y)})},t.prototype.updateModel=function(e){this.needsRender=!0,this.modelSceneNeedsRender=!0},t.prototype.updateWork=function(e,r,i,a){return this.works=e,this.userAction=a,!1},t.prototype.updateTime=function(e,r){if(!this.destroyed){var i={};this.cameraMotion.ended&&(this.cameraMotion.update(e),i.longitude=this.cameraMotion.value.longitude,i.latitude=this.cameraMotion.value.latitude,i.fov=this.cameraMotion.value.fov),Nt(i)&&this.setCamera(i)}},t.prototype.render=function(e,r){var i=this.renderer.getRenderTarget();this.updateScreenBuffer(r),e&&(this.renderer.setRenderTarget(this.modelRenderTarget),this.renderer.render(this.modelScene,this.camera)),this.depthCopyPass.render(this.modelRenderTarget.depthTexture,i),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.copyPass.render(this.modelRenderTarget,i),this.renderer.setRenderTarget(i),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,this.camera),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0},t.prototype.postProcessing=function(e,r){this.destroyed},t.prototype.updateCamera=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();var o={};return e.longitude!==void 0&&(o.longitude=e.longitude),e.latitude!==void 0&&(o.latitude=e.latitude),e.fov!==void 0&&(o.fov=e.fov),a.cameraMotion.set(o,r).catch(z)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();for(var o=[],s=0,l=e;s<l.length;s++){var u=l[s];o.push({key:u.key,progress:u.progress,value:{longitude:u.value.longitude,latitude:u.value.latitude,fov:u.value.fov}})}return a.cameraMotion.setKeyframes(o,r)})},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(Me())[1];return F(F({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance})},t.prototype.initAnimation=function(){var e=this.initial;e.state,e.currentState,e.duration;var r=e.userAction,i=t.initAnimationEndState(this);return this.userAction=r,this.emit("initAnimation.start",W("initAnimation.start",{state:i,userAction:this.userAction})),this.emit("initAnimation.end",W("initAnimation.end",{state:i,userAction:this.userAction})),Promise.resolve()},t.prototype.setCamera=function(e){var r,i,a,o,s;e===void 0&&(e={});var l=(r=e.longitude)!==null&&r!==void 0?r:this.camera.pose.longitude,u=(i=e.latitude)!==null&&i!==void 0?i:this.camera.pose.latitude,d=(a=e.fov)!==null&&a!==void 0?a:this.camera.pose.fov,f=(o=e.distance)!==null&&o!==void 0?o:this.camera.pose.distance,A=(s=e.offset)!==null&&s!==void 0?s:this.camera.pose.offset,m=Xt(l,this.camera.pose.longitude,Math.PI*2)||Xt(u,this.camera.pose.latitude),h=Xt(d,this.camera.pose.fov),v=Xt(f,this.camera.pose.distance),y=za(A,this.camera.pose.offset);(h||m||y||v)&&(this.camera.setFromPose({longitude:l,latitude:u,fov:d,distance:f,offset:A}),this.emit("camera.update",W("camera.update",{userAction:this.userAction,state:F(F({},this.currentPano),{mode:this.mode,longitude:l,latitude:u,fov:d,offset:A,distance:f})})),this.needsRender=!0,this.modelSceneNeedsRender=!0)},t.prototype.stopMomentumMovement=function(){if(this.inMomentumMovement&&this.inMomentumMovement.event&&!this.inMomentumMovement.event.defaultPrevented&&!this.inMomentumMovement.event.isFinal){var e=W("gesture.momentum",F(F({},this.inMomentumMovement.event),{isFirst:!1,isFinal:!0}));this.emit("gesture.momentum",e)}this.inMomentumMovement=null},t.prototype.onPanGesture=function(e){this.stopMomentumMovement(),this.emit("gesture.pan",e)},t.prototype.onTapGesture=function(e){this.stopMomentumMovement(),this.emit("gesture.tap",e)},t.prototype.onPressGesture=function(e){this.stopMomentumMovement(),this.emit("gesture.press",e)},t.prototype.onPinchGesture=function(e){this.stopMomentumMovement(),this.emit("gesture.pinch",e)},t.prototype.onMouseWheel=function(e){this.stopMomentumMovement(),this.emit("gesture.mousewheel",e)},t.prototype.onMouseMove=function(e){this.stopMomentumMovement(),this.emit("gesture.mousemove",e)},t.prototype.relativeClientPosition=function(e){return Ts(e,this.element,this.scissor)},t.prototype.bindEvents=function(e){var r=this,i=function(C){var P=Ts(C,r.element,r.scissor);return!(Math.abs(P.x)>1||Math.abs(P.y)>1)},a=new Nn.Manager(e),o=function(C){var P=C.session;return P.firstInput||null};a.add(new Nn.Pan({threshold:10,pointers:0})),a.add(new Nn.Tap({interval:410})),a.add(new Nn.Pinch({threshold:0,pointers:2})),a.on("panstart pan",function(C){var P=o(a);if(!(P&&!i(P.center))){var S=W("gesture.pan",{target:C.target,pointerType:C.pointerType,srcEvent:C.srcEvent,pointers:C.pointers.map(function(T){var B=r.relativeClientPosition(T),L=new c.Raycaster;return L.params.Points={threshold:.1},L.setFromCamera(B,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:B,raycaster:L}}),isFirst:C.isFirst,isFinal:C.isFinal,scale:C.scale,center:function(T){var B=r.relativeClientPosition(T),L=new c.Raycaster;return L.params.Points={threshold:.1},L.setFromCamera(B,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:B,raycaster:L}}(C.center),velocityX:C.velocityX,velocityY:C.velocityY,overallVelocityX:C.overallVelocityX,overallVelocityY:C.overallVelocityY,userAction:!0,state:F(F({mode:r.mode},r.currentPano),_e(r.camera.pose))});r.onPanGesture(S),y()}}),a.on("tap",function(C){if(!(C.pointerType==="mouse"&&C.srcEvent.button!==0)){var P=o(a);if(!(P&&!i(P.center))){var S=W("gesture.tap",{target:C.target,pointerType:C.pointerType,srcEvent:C.srcEvent,pointers:C.pointers.map(function(T){var B=r.relativeClientPosition(T),L=new c.Raycaster;return L.params.Points={threshold:.1},L.setFromCamera(B,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:B,raycaster:L}}),isFirst:!0,isFinal:!0,scale:C.scale,center:function(T){var B=r.relativeClientPosition(T),L=new c.Raycaster;return L.params.Points={threshold:.1},L.setFromCamera(B,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:B,raycaster:L}}(C.center),velocityX:C.velocityX,velocityY:C.velocityY,overallVelocityX:C.overallVelocityX,overallVelocityY:C.overallVelocityY,userAction:!0,state:F(F({mode:r.mode},r.currentPano),_e(r.camera.pose))});r.onTapGesture(S),y()}}}),a.on("pinchstart pinch pinchend",function(C){var P=o(a);if(!(P&&!i(P.center))){var S=W("gesture.pinch",{target:C.target,pointerType:C.pointerType,srcEvent:C.srcEvent,pointers:C.pointers.map(function(T){var B,L=r.relativeClientPosition(T),k=new c.Raycaster;return k.params.Points={threshold:.1},k.setFromCamera(L,r.camera),{x:T.x,y:T.y,delta:(B=T.delta)!==null&&B!==void 0?B:0,buttons:0,coords:L,raycaster:k}}),isFirst:C.type==="pinchstart",isFinal:C.type==="pinchend",scale:C.scale,center:function(T){var B=r.relativeClientPosition(T),L=new c.Raycaster;return L.params.Points={threshold:.1},L.setFromCamera(B,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:B,raycaster:L}}(C.center),velocityX:C.velocityX,velocityY:C.velocityY,overallVelocityX:C.overallVelocityX,overallVelocityY:C.overallVelocityY,userAction:!0,state:F(F({mode:r.mode},r.currentPano),_e(r.camera.pose))});r.onPinchGesture(S),y()}});var s=null,l=null,u=function(C,P,S){var T={x:S.clientX,y:S.clientY},B=r.relativeClientPosition(T),L=new c.Raycaster;L.params.Points={threshold:.1},L.setFromCamera(B,r.camera);var k=F(F({},T),{coords:B,raycaster:L,buttons:S.buttons,delta:0}),O=C==="pinchend"?P:P-S.deltaY/280,D=W("gesture.pinch",{target:S.target,pointerType:"mouse",srcEvent:S,pointers:[F({},k)],isFirst:C==="pinchstart",isFinal:C==="pinchend",scale:he(O,.1,10),center:F({},k),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:F(F({mode:r.mode},r.currentPano),_e(r.camera.pose))});return D},d=function(C){var P,S={x:C.clientX,y:C.clientY};if(i(S)){if(C.preventDefault(),C.ctrlKey){var T=(P=s==null?void 0:s.prevEvent.scale)!==null&&P!==void 0?P:1,B=u(s?"pinch":"pinchstart",T,C);s===null?s={firstEvent:B,prevEvent:B}:s.prevEvent=B,r.onPinchGesture(B),l!==null&&window.clearTimeout(l),l=window.setTimeout(function(){var K;l=null;var Q=(K=s==null?void 0:s.prevEvent.scale)!==null&&K!==void 0?K:1,G=u("pinchend",Q,C);s=null,r.onPinchGesture(G)},200)}else{var L=(Math.abs(C.deltaY)>Math.abs(C.deltaX)?C.deltaY:C.deltaX)/-60,k=r.mouseWheelState!==void 0,O={x:C.clientX,y:C.clientY},D=r.relativeClientPosition(O),N=new c.Raycaster;N.params.Points={threshold:.1},N.setFromCamera(D,r.camera);var X=F(F({},O),{coords:D,raycaster:N,buttons:C.buttons,delta:L}),B=W("gesture.mousewheel",{target:C.target,pointerType:"mouse",srcEvent:C,pointers:[F({},X)],isFirst:k,isFinal:!1,scale:0,center:F({},X),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:F(F({mode:r.mode},r.currentPano),_e(r.camera.pose))});r.onMouseWheel(B),r.mouseWheelState&&clearTimeout(r.mouseWheelState.timer),r.mouseWheelState={timer:setTimeout(function(){delete r.mouseWheelState;var Q=W("gesture.mousewheel",{target:C.target,pointerType:"mouse",srcEvent:C,pointers:[F(F({},X),{delta:0})],isFirst:!1,isFinal:!0,scale:0,center:F(F({},X),{delta:0}),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:F(F({mode:r.mode},r.currentPano),_e(r.camera.pose))});r.onMouseWheel(Q)},100)}}y()}},f=function(C){if(!Vn()){if(!i({x:C.clientX,y:C.clientY})){A();return}var P=!1;r.mouseMoveState||(P=!0);var S={x:C.clientX,y:C.clientY},T=r.relativeClientPosition(S),B=new c.Raycaster;B.params.Points={threshold:.1},B.setFromCamera(T,r.camera);var L=F(F({},S),{coords:T,raycaster:B,buttons:C.buttons,delta:0}),k=W("gesture.mousemove",{target:C.target,pointerType:"mouse",srcEvent:C,pointers:[F({},L)],isFirst:P,isFinal:!1,scale:0,center:F({},L),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:F(F({mode:r.mode},r.currentPano),_e(r.camera.pose))});r.mouseMoveState={timeStamp:Me(),event:k},r.onMouseMove(k),r.pressState&&Math.abs(C.clientX-r.pressState.event.center.y)>10&&Math.abs(C.clientY-r.pressState.event.center.y)>10&&y()}},A=function(){if(r.mouseMoveState){var C=W(r.mouseMoveState.event.type,F(F({},r.mouseMoveState.event),{isFinal:!0}));delete r.mouseMoveState,r.onMouseMove(C)}y()},m=function(C){if(!i(C.center)){y();return}var P=!1;r.pressState||(P=!0,r.pressState={event:C,timeStamp:Me(),stop:z});var S=Me()-r.pressState.timeStamp,T=W(r.pressState.event.type,F(F({},r.pressState.event),{isFirst:P,isFinal:!1,center:F(F({},r.pressState.event.center),{delta:S}),pointers:r.pressState.event.pointers.map(function(B){return F(F({},B),{delta:S})})}));r.onPressGesture(T),r.pressState&&(r.pressState.stop=vt.shared.add(function(B){m(C)},!0,1))},h=function(C){if(y(),!(C.touches.length>1||C.changedTouches.length<=0)){var P={x:C.changedTouches[0].clientX,y:C.changedTouches[0].clientY},S=r.relativeClientPosition(P),T=new c.Raycaster;T.params.Points={threshold:.1},T.setFromCamera(S,r.camera);var B=F(F({},P),{coords:S,raycaster:T,buttons:0,delta:0}),L=W("gesture.press",{target:C.target,pointerType:"touch",srcEvent:C,pointers:[F({},B)],isFirst:!1,isFinal:!1,scale:0,center:B,velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:F(F({mode:r.mode},r.currentPano),_e(r.camera.pose))});m(L)}},v=function(C){y();var P={x:C.clientX,y:C.clientY},S=r.relativeClientPosition(P),T=new c.Raycaster;T.params.Points={threshold:.1},T.setFromCamera(S,r.camera);var B=F(F({},P),{coords:S,raycaster:T,buttons:C.buttons,delta:0}),L=W("gesture.press",{target:C.target,pointerType:"mouse",srcEvent:C,pointers:[F({},B)],isFirst:!1,isFinal:!1,scale:0,center:B,velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:F(F({mode:r.mode},r.currentPano),_e(r.camera.pose))});m(L)},y=function(){var C;if(r.pressState){var P=Me()-r.pressState.timeStamp,S=W(r.pressState.event.type,F(F({},r.pressState.event),{center:F(F({},r.pressState.event.center),{delta:P}),isFirst:!1,isFinal:!0,pointers:r.pressState.event.pointers.map(function(T){return F(F({},T),{delta:P})})}));r.onPressGesture(S),(C=r.pressState)===null||C===void 0||C.stop(),delete r.pressState}},p=null,g=function(C){var P,S=!1,T=!1;switch(C.type){case"gesturestart":S=!0;break;case"gestureend":T=!0;break}var B={x:C.clientX,y:C.clientY},L=r.relativeClientPosition(B),k=new c.Raycaster;k.params.Points={threshold:.1},k.setFromCamera(L,r.camera);var O=F(F({},B),{coords:L,raycaster:k,buttons:0,delta:0}),D=W("gesture.pinch",{target:C.target,pointerType:"mouse",srcEvent:C,pointers:[F({},O)],isFirst:S,isFinal:T,scale:(P=C.scale)!==null&&P!==void 0?P:1,center:F({},O),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:F(F({mode:r.mode},r.currentPano),_e(r.camera.pose))});return D},x=function(C){if(C.preventDefault(),!Vn()){var P=g(C);p={firstEvent:P};var S=p.firstEvent;S&&!i(S.center)||r.onPinchGesture(P)}},b=function(C){if(C.preventDefault(),!Vn()&&p){var P=g(C),S=p.firstEvent;S&&!i(S.center)||r.onPinchGesture(P)}},w=function(C){if(C.preventDefault(),!Vn()&&p){var P=g(C),S=p.firstEvent;p=null,!(S&&!i(S.center))&&r.onPinchGesture(P)}},E=function(C){if(C&&typeof C.preventDefault=="function"&&C.currentTarget===e&&C.preventDefault(),typeof getSelection=="function"){var P=getSelection();P&&P.focusNode&&(P.removeAllRanges&&P.removeAllRanges(),P.empty&&P.empty())}};this.enableWheel&&e.addEventListener("wheel",d,{passive:!1}),e.addEventListener("mousemove",f,!1),e.addEventListener("mouseout",A,!1),e.addEventListener("touchstart",h,{passive:!0}),e.addEventListener("touchend",y,!1),e.addEventListener("touchcancel",y,!1),e.addEventListener("mousedown",v,!1),e.addEventListener("mouseup",y,!1),e.addEventListener("gesturestart",x,{passive:!1}),e.addEventListener("gesturechange",b,{passive:!1}),e.addEventListener("gestureend",w,{passive:!1}),e.addEventListener("touchstart",E,{passive:!1}),e.addEventListener("contextmenu",E,!1);var M=function(){a.destroy(),e.removeEventListener("wheel",d,!1),e.removeEventListener("mousemove",f,!1),e.removeEventListener("mouseout",A,!1),e.removeEventListener("touchstart",h,!1),e.removeEventListener("touchend",y,!1),e.removeEventListener("touchcancel",y,!1),e.removeEventListener("mousedown",v,!1),e.removeEventListener("mouseup",y,!1),e.removeEventListener("gesturestart",x,!1),e.removeEventListener("gesturechange",b,!1),e.removeEventListener("gestureend",w,!1),e.removeEventListener("touchstart",E,!1),e.removeEventListener("contextmenu",E,!1)};return Object.assign(M,{element:e})},t.prototype.preloadPano=function(e,r){var i=this;r===void 0&&(r=z);var a=this.works.getResolvedObserver(e);if(!a)return Promise.resolve();var o=["right","left","up","down","front","back"];return Promise.all(o.map(function(s){var l=F({key:"pano.".concat(Ue(e),".").concat(s)},Cr(i.imageOptions,["size","format","quality","mappings"])),u=a.images[s],d=bi(u,i.imageOptions.transform,l);return it(a.work).preload(d)})).then(function(){return r(e),e})},t.prototype.updateScreenBuffer=function(e){var r,i,a,o,s,l;if(this.lastPostProcessingType!==e)if(this.lastPostProcessingType=e,e==="luminance"){if(this.screenBuffers.length===0){var u=this.renderer.getDrawingBufferSize(ca);this.screenBuffers=[new c.WebGLRenderTarget(u.x,u.y,{encoding:(i=(r=this.renderer)===null||r===void 0?void 0:r.outputEncoding)!==null&&i!==void 0?i:c.sRGBEncoding}),this.modelRenderTarget]}}else if(e==="edl"){if(this.screenBuffers.length===0){var u=this.renderer.getDrawingBufferSize(ca);this.screenBuffers=[new c.WebGLRenderTarget(u.x,u.y,{encoding:(o=(a=this.renderer)===null||a===void 0?void 0:a.outputEncoding)!==null&&o!==void 0?o:c.sRGBEncoding,minFilter:c.NearestFilter,magFilter:c.NearestFilter,format:c.RGBAFormat,type:c.FloatType}),this.modelRenderTarget]}this.models.setMaterial({useEDL:!0})}else if(e==="hq"){if(this.screenBuffers.length===0){var u=this.renderer.getDrawingBufferSize(ca),d=new c.WebGLRenderTarget(u.x,u.y,{minFilter:c.NearestFilter,magFilter:c.NearestFilter,format:c.RGBAFormat,type:c.FloatType,depthTexture:new c.DepthTexture(u.x,u.y,c.UnsignedIntType)});d.depthTexture.format=c.DepthFormat,d.depthBuffer=!0;var f=new c.WebGLRenderTarget(u.x,u.y,{encoding:(l=(s=this.renderer)===null||s===void 0?void 0:s.outputEncoding)!==null&&l!==void 0?l:c.sRGBEncoding,minFilter:c.NearestFilter,magFilter:c.NearestFilter,format:c.RGBAFormat,type:c.FloatType,depthTexture:d.depthTexture});this.screenBuffers=[d,f,this.modelRenderTarget]}this.models.setMaterial({useHQDepth:!0,useHQWeight:!1,pointShape:"CIRCLE"})}else this.screenBuffers&&(this.screenBuffers.forEach(function(A){A.dispose()}),this.screenBuffers=[]),this.models.setMaterial({useEDL:!1,useHQDepth:!1,useHQWeight:!1})},t}(ki),qa=function(n){ue(t,n);function t(e){var r=this,i,a=t.parseArgs(e);return r=n.call(this,a)||this,r.mode="Floorplan",r.defaultLongitude=a.defaultLongitude,r.defaultLatitude=a.defaultLatitude,r.defaultFov=a.defaultFov,r.maxFov=a.maxFov,r.minFov=a.minFov,r.maxLatitude=a.maxLatitude,r.minLatitude=a.minLatitude,r.modelInScreen=a.modelInScreen,r.locationMotion=new Se({x:r.camera.pose.offset.x,y:r.camera.pose.offset.y,z:r.camera.pose.offset.z,distance:r.camera.pose.distance}),r.modelAlphaMotion=new Se({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new Se({perspToOrtho:r.camera.perspToOrtho.x}),r.currentTapId=null,r.intersectMeshCreator=a.intersectMeshCreator,r.intersectMesh=r.intersectMeshCreator(),r.intersectMesh.name="intersect",r.intersectMesh.visible=!1,r.helper.add(r.intersectMesh),r}return t.distanceFromModel=function(e,r,i){var a=e.bounding,o=Math.pow(Math.pow(a.max.x-a.min.x+1,2)+Math.pow(a.max.y-a.min.y+1,2)+Math.pow(a.max.z-a.min.z+1,2),1/2),s=o/2/Math.tan(Math.PI*r/360);return i<1&&(s=s/i),isNaN(s)?o:s},t.parseArgs=function(e){var r,i,a,o,s,l,u,d,f;if(e instanceof t)return e;var A=n.parseArgs.call(this,e);return F(F({},A),{defaultLongitude:(r=e.defaultLongitude)!==null&&r!==void 0?r:Math.PI/4,defaultLatitude:(i=e.defaultLatitude)!==null&&i!==void 0?i:Math.PI/4,defaultFov:(a=e.defaultFov)!==null&&a!==void 0?a:80,maxFov:(o=e.maxFov)!==null&&o!==void 0?o:120,minFov:(s=e.minFov)!==null&&s!==void 0?s:20,maxLatitude:(l=e.maxLatitude)!==null&&l!==void 0?l:+Math.PI/2,minLatitude:(u=e.minLatitude)!==null&&u!==void 0?u:-Math.PI/2,modelInScreen:(d=e.modelInScreen)!==null&&d!==void 0?d:"boundingbox-center",intersectMeshCreator:(f=e.intersectMeshCreator)!==null&&f!==void 0?f:function(){return new Li}})},t.initAnimationEndState=function(e){var r,i,a,o,s,l,u=this.parseArgs(e),d=e.initial,f=d.state,A=d.currentState,m=typeof f.panoIndex=="number"?{workCode:(a=(r=f.workCode)!==null&&r!==void 0?r:(i=u.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:f.panoIndex}:{workCode:A.workCode,panoIndex:A.panoIndex},h=F(F({},m),{mode:"Floorplan",longitude:(o=f.longitude)!==null&&o!==void 0?o:Na(A.mode)?A.longitude:u.defaultLongitude,latitude:he((s=f.latitude)!==null&&s!==void 0?s:A.mode==="Floorplan"?A.latitude:u.defaultLatitude,u.minLatitude,u.maxLatitude),fov:(l=f.fov)!==null&&l!==void 0?l:u.defaultFov,offset:e.models.bounding.getCenter(new c.Vector3),distance:t.distanceFromModel(u.models,u.defaultFov,u.camera.aspect)});return h},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.locationMotion.dispose(),delete this.panState,this.intersectMesh.dispose(),this.helper.remove(this.intersectMesh)},t.prototype.isReady=function(){return this.locationMotion.ended===!1?!1:n.prototype.isReady.call(this)},t.prototype.updateWork=function(e,r,i,a){var o;return this.works=e,this.updateCamera(r,(o=i.duration)!==null&&o!==void 0?o:0,a),!0},t.prototype.updateModel=function(e){n.prototype.updateModel.call(this,e);var r=e.bounding.getCenter(new c.Vector3),i=t.distanceFromModel(e,this.defaultFov,this.camera.aspect);this.locationMotion.set({x:r.x,y:r.y,z:r.z,distance:i},0).catch(z)},t.prototype.updateCamera=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();var o={},s={};return e.distance!==void 0&&(o.distance=e.distance),e.offset!==void 0&&(o.x=e.offset.x,o.y=e.offset.y,o.z=e.offset.z),e.longitude!==void 0&&(s.longitude=e.longitude),e.latitude!==void 0&&(s.latitude=e.latitude),e.fov!==void 0&&(s.fov=e.fov),a.locationMotion.set(o,r).catch(z),a.cameraMotion.set(s,r).catch(z)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();for(var o=[],s=[],l=0,u=e;l<u.length;l++){var d=u[l];o.push({key:d.key,progress:d.progress,value:{distance:d.value.distance,x:d.value.offset.x,y:d.value.offset.x,z:d.value.offset.x}}),s.push({key:d.key,progress:d.progress,value:{longitude:d.value.longitude,latitude:d.value.latitude,fov:d.value.fov}})}return a.locationMotion.setKeyframes(o,r).catch(z),a.cameraMotion.setKeyframes(e,r)})},t.prototype.updateTime=function(e,r){if(!this.destroyed){var i={},a={};this.modelAlphaMotion.ended||(this.modelAlphaMotion.update(e),i.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended||(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(he(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended||(this.locationMotion.update(e),a.distance=this.locationMotion.value.distance,a.offset=new c.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z)),this.cameraMotion.ended||(this.cameraMotion.update(e),a.longitude=this.cameraMotion.value.longitude,a.latitude=this.cameraMotion.value.latitude,a.fov=this.cameraMotion.value.fov),Nt(i)||this.models.setMaterial(i),Nt(a)||this.setCamera(a)}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(Me())[1],r=this.locationMotion.getKeyFrameSegment(Me())[1];return F(F({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:new c.Vector3(r.value.x,r.value.y,r.value.z),distance:r.value.distance})},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var i=e.initial;i.state,i.currentState;var a=i.duration,o=i.userAction;e.userAction=o;var s=t.initAnimationEndState(e),l=Cr(s,["longitude","latitude","fov"]),u={x:s.offset.x,y:s.offset.y,z:s.offset.z,distance:s.distance},d={modelAlpha:1},f={perspToOrtho:0};e.emit("initAnimation.start",W("initAnimation.start",{state:s,userAction:e.userAction})),e.modelAlphaMotion.set(d,a/3).catch(z),e.perspToOrthoMotion.set(f,a).catch(z),e.cameraMotion.set(l,a).catch(z),e.locationMotion.set(u,a).then(function(){e.emit("initAnimation.end",W("initAnimation.end",{state:s,userAction:e.userAction}))},function(A){var m=F(F(F({},e.currentPano),{mode:e.mode}),_e(e.camera.pose));e.emit("initAnimation.end",W("initAnimation.end",{state:m,userAction:e.userAction}))}).then(function(){r()})})},t.prototype.updateRenderSize=function(e){this.needsRender=!0,this.modelSceneNeedsRender=!0,this.screenBuffers.forEach(function(r){r.setSize(e.x,e.y)}),this.locationMotion.set({distance:t.distanceFromModel(this.models,this.defaultFov,this.camera.aspect)},0).catch(z)},t.prototype.getForwardObserverOrNot=function(e){var r=this.models.intersectRaycaster(e)[0];if(!r)return null;var i=this.works.resolvedObservers,a=ur(i,function(l){return l.standingPosition.distanceTo(r.point)},!0),o=a[0],s=a[1];return o&&s<10?o:null},t.prototype.coordinatesForOffset=function(e){var r=this.renderer.getSize(new c.Vector2);return{longitude:-2*e.x/(r.x*this.scissor.width),latitude:2*e.y/(r.y*this.scissor.height)}},t.prototype.requestMomentumMovement=function(e,r,i,a){var o=this;if(this.inMomentumMovement!==null){for(var s=F({},i),l={longitude:0,latitude:0},u=0;u<a;u++)s.longitude*=.996,s.latitude*=.996*.998,l.longitude+=s.longitude,l.latitude+=s.latitude;var d=Kr(this.cameraMotion.value.longitude+l.longitude),f=he(this.cameraMotion.value.latitude+l.latitude,this.minLatitude,this.maxLatitude),A=F(F({},this.currentPano),{mode:this.mode,longitude:d,latitude:f,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance}),m=!(s.longitude>1e-4||s.longitude<-1e-4||s.latitude>1e-4||s.latitude<-1e-4),h=W("gesture.momentum",F(F({},e),{isFirst:r,isFinal:m,state:A}));if(this.inMomentumMovement.event=h,this.emit("gesture.momentum",h),e.defaultPrevented){this.inMomentumMovement=null;return}this.inMomentumMovement&&(this.cameraMotion.set({longitude:d,latitude:f},0).catch(z),m?this.inMomentumMovement=null:vt.shared.add(function(v,y){o.requestMomentumMovement(e,!1,s,y|0)},!0,1))}},t.prototype.onPanGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var r=this.panState,i=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:i,x:e.center.x,y:e.center.y},!(typeof r=="undefined"||r.pointerLength!==i)){var a={x:e.center.x-r.x,y:e.center.y-r.y},o=this.relativeClientPosition(e.center),s=this.camera.pose.latitude<Math.PI/6||o.y<0?1:-1;a.x*=s;var l=this.coordinatesForOffset(a),u=Kr(this.cameraMotion.value.longitude+l.longitude),d=he(this.cameraMotion.value.latitude+l.latitude,this.minLatitude,this.maxLatitude);this.camera.aspect<1&&Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(d=this.cameraMotion.value.latitude);var f=F(F({},this.currentPano),{mode:this.mode,longitude:u,latitude:d,fov:this.camera.pose.fov,offset:this.camera.pose.offset,distance:this.camera.pose.distance});if(e.state=f,this.emit("gesture.pan",e),!e.defaultPrevented&&(this.cameraMotion.set({longitude:f.longitude,latitude:f.latitude},0).catch(z),e.isFinal)){var A=e.velocityX*s,m=e.velocityY;this.inMomentumMovement={uuid:wt()},this.requestMomentumMovement(e,!0,this.coordinatesForOffset({x:A,y:m}),0)}}},t.prototype.onPinchGesture=function(e){var r;if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement();var i=(r=this.pinchState)===null||r===void 0?void 0:r.fov;if(e.isFirst){this.pinchState={x:e.center.x,y:e.center.y,fov:this.cameraMotion.value.fov};return}if(e.isFinal&&(delete this.panState,delete this.pinchState),typeof i!="undefined"){var a=he(i/e.scale,this.minFov,this.maxFov);e.state.fov=a,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:a},0).catch(z),this.onPanGesture(e))}}},t.prototype.onMouseMove=function(e){var r,i;if(this.intersectMesh.parent&&!this.panState){if(this.emit("gesture.mousemove",e),e.defaultPrevented){this.hideIntersectMesh();return}var a=e.center.raycaster;if(e.isFinal&&this.intersectMesh.parent&&this.intersectMesh.visible===!0){this.hideIntersectMesh();return}var o=this.models.intersectRaycaster(a)[0],s=W("intersect.update",{raycaster:a,intersection:o!=null?o:null,object:this.intersectMesh});if(this.emit("intersect.update",s),s.defaultPrevented){this.hideIntersectMesh();return}if(o){var l=(i=(r=o.face)===null||r===void 0?void 0:r.normal)!==null&&i!==void 0?i:new c.Vector3().copy(a.ray.direction).multiplyScalar(-1),u=l.clone(),d=o.point.clone();this.intersectMesh.position.copy(d);var f=d.clone().add(u);if(this.intersectMesh.lookAt(f),Math.abs(l.y)>.99){var A=this.camera.position.clone().sub(d);this.intersectMesh.rotation.z=-Math.atan2(A.z,A.x)}this.intersectMesh.visible=!0,this.needsRender=!0}else this.hideIntersectMesh()}},t.prototype.onMouseWheel=function(e){if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement();var r=this,i=r.minFov,a=r.maxFov,o=he(this.camera.fov-e.center.delta,i,a);e.state.fov=o,this.emit("gesture.mousewheel",e),!e.defaultPrevented&&this.cameraMotion.set({fov:o},0).catch(z)}},t.prototype.onTapGesture=function(e){var r=this;this.userAction=!0,this.stopMomentumMovement();var i=e.center.raycaster,a=this.getForwardObserverOrNot(i);if(!a)this.emit("gesture.tap",e);else{var o={longitude:this.camera.pose.longitude,latitude:0},s=F(F({},e.state),{mode:"Panorama",workCode:a.pano.workCode,panoIndex:a.pano.panoIndex,longitude:o.longitude,latitude:o.latitude,offset:a?a.position.clone():new c.Vector3,distance:0});if(e.state=s,this.emit("gesture.tap",e),!e.defaultPrevented&&(this.emit("pano.select",W("pano.select",{prevPano:this.currentPano,state:s,userAction:e.userAction,options:o,progress:0,error:null})),a&&a.active)){var l=this.currentTapId=wt();this.preloadPano(a.pano).then(function(u){r.currentTapId===l&&r.emit("pano.request",W("pano.request",{userAction:!0,prevPano:r.currentPano,progress:0,state:s,options:o,error:null}))})}}},t.prototype.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.needsRender=!0},t}(po),Th=function(n){ue(t,n);function t(e){var r=this,i=t.parseArgs(e);return r=n.call(this,i)||this,r.mode="Topview",r}return t.parseArgs=function(e){if(e instanceof t)return e;var r=F(F({},e),{defaultLongitude:0,defaultLatitude:Math.PI/2});return n.parseArgs.call(this,r)},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return F(F({},i),{longitude:r.defaultLongitude,latitude:r.defaultLatitude,mode:"Topview"})},t.prototype.updateModel=function(e){this.needsRender=!0,this.modelSceneNeedsRender=!0;var r=this.models.bounding.getCenter(new c.Vector3);this.locationMotion.set({x:r.x,y:r.y,z:r.z,distance:qa.distanceFromModel(this.models,this.defaultFov,this.camera.aspect)},0).catch(z)},t.prototype.updateCamera=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();var o={},s={};return e.distance!==void 0&&(o.distance=e.distance),e.offset!==void 0&&(o.x=e.offset.x,o.y=e.offset.y,o.z=e.offset.z),e.longitude!==void 0&&(s.longitude=e.longitude),e.latitude!==void 0&&(s.latitude=e.latitude),e.fov!==void 0&&(s.fov=e.fov),a.locationMotion.set(o,r).catch(z),a.cameraMotion.set(s,r).catch(z)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();for(var o=[],s=[],l=0,u=e;l<u.length;l++){var d=u[l];o.push({key:d.key,progress:d.progress,value:{distance:d.value.distance,x:d.value.offset.x,y:d.value.offset.y,z:d.value.offset.z}}),s.push({key:d.key,progress:d.progress,value:{longitude:d.value.longitude,latitude:d.value.latitude,fov:d.value.fov}})}return a.locationMotion.setKeyframes(o,r).catch(z),a.cameraMotion.setKeyframes(e,r)})},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var i=e.initial;i.state,i.currentState;var a=i.duration,o=i.userAction;e.userAction=o;var s=t.initAnimationEndState(e),l={longitude:s.longitude,latitude:s.latitude,fov:s.fov},u={x:s.offset.x,y:s.offset.y,z:s.offset.z,distance:s.distance},d={modelAlpha:1},f={perspToOrtho:1};e.emit("initAnimation.start",W("initAnimation.start",{state:s,userAction:e.userAction})),e.modelAlphaMotion.set(d,a/3).catch(z),e.perspToOrthoMotion.set(f,a).catch(z),e.cameraMotion.set(l,a).catch(z),e.locationMotion.set(u,a).then(function(){e.emit("initAnimation.end",W("initAnimation.end",{state:s,userAction:e.userAction}))},function(A){var m=F(F(F({},e.currentPano),{mode:e.mode}),_e(e.camera.pose));e.emit("initAnimation.end",W("initAnimation.end",{state:m,userAction:e.userAction}))}).then(function(){r()})})},t.prototype.requestMomentumMovement=function(){this.inMomentumMovement=null},t.prototype.onPanGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement();var r=this.panState,i=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:i,x:e.center.x,y:e.center.y},!(typeof r=="undefined"||r.pointerLength!==i)){var a={x:e.center.x-r.x,y:e.center.y-r.y},o=new c.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),s=this.locationMotion.value.distance;s*=Math.tan(this.cameraMotion.value.fov/2*Math.PI/180);var l=this.renderer.getSize(new c.Vector2),u=2*a.x*s/l.y,d=2*a.y*s/l.y,f=new c.Vector3;f.setFromMatrixColumn(this.camera.matrix,0),f.multiplyScalar(-u),o.add(f),f.setFromMatrixColumn(this.camera.matrix,0),f.crossVectors(this.camera.up,f),f.multiplyScalar(d),o.add(f),this.modelInScreen==="boundingbox-center"&&o.clamp(this.models.bounding.min,this.models.bounding.max);var A=F(F({},this.currentPano),{mode:this.mode,longitude:0,latitude:Math.PI/2,fov:this.cameraMotion.value.fov,offset:o,distance:this.locationMotion.value.distance});e.state=A,this.emit("gesture.pan",e),!e.defaultPrevented&&this.locationMotion.set({x:o.x,y:o.y,z:o.z},0).catch(z)}},t.prototype.onPinchGesture=function(e){var r;if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement();var i=(r=this.pinchState)===null||r===void 0?void 0:r.fov;if(e.isFirst){this.pinchState={x:e.center.x,y:e.center.y,fov:this.cameraMotion.value.fov};return}if(e.isFinal&&delete this.pinchState,typeof i!="undefined"){var a=he(i/e.scale,this.minFov,this.maxFov);e.state.fov=a,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:a},0).catch(z),e.type="gesture.pan",this.onPanGesture(e))}}},t.prototype.onMouseWheel=function(e){if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement();var r=he(this.cameraMotion.value.fov-e.center.delta,this.minFov,this.maxFov);e.state.fov=r,this.emit("gesture.mousewheel",e),!e.defaultPrevented&&this.cameraMotion.set({fov:r},0).catch(z)}},t}(qa),gu=function(n){ue(t,n);function t(e){var r=this,i=t.parseArgs(e);return r=n.call(this,i)||this,r.mode="PanoramaLike",r.defaultLatitude=i.defaultLatitude,r.defaultFov=i.defaultFov,r.maxFov=i.maxFov,r.minFov=i.minFov,r.maxLatitude=i.maxLatitude,r.minLatitude=i.minLatitude,r.moveSpeed=i.moveSpeed,r.intersectMeshCreator=i.intersectMeshCreator,r.intersectMesh=r.intersectMeshCreator(),r.intersectMesh.name="intersect",r.intersectMesh.visible=!1,r.helper.add(r.intersectMesh),r}return t.parseArgs=function(e){var r,i,a,o,s,l,u,d;if(e instanceof t)return e;var f=n.parseArgs.call(this,e);return F(F({},f),{defaultLatitude:(r=e.defaultLatitude)!==null&&r!==void 0?r:0,defaultFov:(i=e.defaultFov)!==null&&i!==void 0?i:90,maxFov:(a=e.maxFov)!==null&&a!==void 0?a:120,minFov:(o=e.minFov)!==null&&o!==void 0?o:40,maxLatitude:(s=e.maxLatitude)!==null&&s!==void 0?s:+Math.PI/2,minLatitude:(l=e.minLatitude)!==null&&l!==void 0?l:-Math.PI/2,moveSpeed:(u=e.moveSpeed)!==null&&u!==void 0?u:3.4,intersectMeshCreator:(d=e.intersectMeshCreator)!==null&&d!==void 0?d:function(){return new Li}})},t.initAnimationEndState=function(e){var r,i,a,o,s,l,u=this.parseArgs(e),d=u.works,f=e.initial,A=f.state,m=f.currentState,h=typeof A.panoIndex=="number"?{workCode:(a=(r=A.workCode)!==null&&r!==void 0?r:(i=u.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:A.panoIndex}:{workCode:m.workCode,panoIndex:m.panoIndex},v=d.getResolvedObserver(h),y=(o=A.longitude)!==null&&o!==void 0?o:m.longitude,p=he((s=A.latitude)!==null&&s!==void 0?s:Jn(m.mode)?m.latitude:u.defaultLatitude,u.minLatitude,u.maxLatitude),g=he((l=A.fov)!==null&&l!==void 0?l:Jn(m.mode)?m.fov:u.defaultFov,u.minFov,u.maxFov),x=v?v.position.clone():new c.Vector3;return{workCode:h.workCode,panoIndex:h.panoIndex,mode:"PanoramaLike",longitude:y,latitude:p,fov:g,offset:x,distance:0}},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.intersectMesh&&(this.helper.remove(this.intersectMesh),this.intersectMesh.dispose()),delete this.panState},t.prototype.isReady=function(){return this.panState||this.pinchState?!1:n.prototype.isReady.call(this)},t.prototype.calculateMovingDuration=function(e,r){switch(typeof e){case"function":return e(r,this.moveSpeed);case"number":return e;case"string":return Number(e);default:return he(r,2,5)/this.moveSpeed*1e3}},t.prototype.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.needsRender=!0},t.prototype.coordinatesForOffset=function(e){var r=this.cameraMotion.value.fov,i=this.camera.aspect,a=this.renderer.getSize(new c.Vector2);return{longitude:2*e.x/(a.x*this.scissor.width)*r/95*i,latitude:-2*e.y/(a.y*this.scissor.height)*r/95}},t.prototype.cameraBounce=function(){var e=this.cameraMotion.value,r=e.longitude,i=e.latitude,a=e.fov,o=[{progress:0,value:{longitude:r,latitude:i,fov:a}},{progress:.5,value:{longitude:r,latitude:i,fov:a*.98}},{progress:1,value:{longitude:r,latitude:i,fov:a}}];this.cameraMotion.setKeyframes(o,500).catch(z)},t.prototype.requestMomentumMovement=function(e,r,i,a){var o=this;if(this.inMomentumMovement!==null){for(var s=F({},i),l={longitude:0,latitude:0},u=0;u<a;u++)s.longitude*=.996,s.latitude*=.996*.99,l.longitude+=s.longitude,l.latitude+=s.latitude;var d=Kr(this.cameraMotion.value.longitude+l.longitude),f=he(this.cameraMotion.value.latitude+l.latitude,this.minLatitude,this.maxLatitude),A=F(F({},this.currentPano),{mode:this.mode,longitude:d,latitude:f,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance}),m=!(s.longitude>1e-4||s.longitude<-1e-4||s.latitude>1e-4||s.latitude<-1e-4),h=W("gesture.momentum",F(F({},e),{isFirst:r,isFinal:m,state:A}));if(this.inMomentumMovement.event=h,this.emit("gesture.momentum",h),e.defaultPrevented){this.inMomentumMovement=null;return}this.inMomentumMovement&&(this.cameraMotion.set({longitude:d,latitude:f},0).catch(z),m?this.inMomentumMovement=null:vt.shared.add(function(v,y){o.requestMomentumMovement(e,!1,s,y|0)},!0,1))}},t.prototype.onPanGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var r=this.panState,i=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:i,x:e.center.x,y:e.center.y},!(typeof r=="undefined"||r.pointerLength!==i)){var a={x:e.center.x-r.x,y:e.center.y-r.y},o=this.coordinatesForOffset(a),s=Kr(this.cameraMotion.value.longitude+o.longitude),l=he(this.cameraMotion.value.latitude+o.latitude,this.minLatitude,this.maxLatitude);this.camera.aspect<1&&Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(l=this.cameraMotion.value.latitude);var u=F(F({},this.currentPano),{mode:this.mode,longitude:s,latitude:l,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance});if(e.state=u,this.emit("gesture.pan",e),!e.defaultPrevented){var d={longitude:u.longitude,latitude:u.latitude,fov:u.fov};if(this.cameraMotion.set(d,0).catch(z),e.isFinal){var f=e.velocityX,A=e.velocityY*.6;Math.abs(A)>.5&&Math.abs(f)<.5&&(f=0),this.inMomentumMovement={uuid:wt()},this.requestMomentumMovement(e,!0,this.coordinatesForOffset({x:f,y:A}),0)}}}},t.prototype.onPinchGesture=function(e){var r;this.userAction=e.userAction,this.stopMomentumMovement();var i=(r=this.pinchState)===null||r===void 0?void 0:r.fov,a=e.scale;if(e.isFirst){this.pinchState={x:e.center.x,y:e.center.y,fov:this.cameraMotion.value.fov};return}if(e.isFinal&&delete this.pinchState,typeof i!="undefined"){var o=he(i/a,this.minFov,this.maxFov);e.state.fov=o,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:o},0).catch(z),e.type="gesture.pan",this.onPanGesture(e))}},t.prototype.onMouseWheel=function(e){this.userAction=e.userAction,this.stopMomentumMovement();var r=he(this.cameraMotion.value.fov-e.center.delta,this.minFov,this.maxFov);e.state.fov=r,this.emit("gesture.mousewheel",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:r},0).catch(z),this.onMouseMove(e))},t.prototype.onMouseMove=function(e){var r,i;if(this.intersectMesh.parent&&!this.panState&&(this.emit("gesture.mousemove",e),!e.defaultPrevented)){var a=e.center.raycaster;if(e.isFinal&&this.intersectMesh.parent){this.hideIntersectMesh();return}var o=this.models.intersectRaycaster(a)[0],s=W("intersect.update",{raycaster:a,intersection:o!=null?o:null,object:this.intersectMesh});if(this.emit("intersect.update",s),s.defaultPrevented){this.hideIntersectMesh();return}if(o){var l=(i=(r=o.face)===null||r===void 0?void 0:r.normal)!==null&&i!==void 0?i:new c.Vector3().copy(a.ray.direction).multiplyScalar(-1),u=l.clone(),d=o.point.clone();this.intersectMesh.position.copy(d);var f=d.clone().add(u);if(this.intersectMesh.lookAt(f),Math.abs(l.y)>.99){var A=this.camera.position.clone().sub(d);this.intersectMesh.rotation.z=-Math.atan2(A.z,A.x)}this.intersectMesh.visible=!0,this.needsRender=!0}else this.hideIntersectMesh()}},t}(po),Ph="data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGBf//rdxF6b3m2Ui3lizYINkj7u94MjY0IC0gY29yZSAxNDIgcjIgOTU2YzhkOCAtIEguMjY0L01QRUctNCBBVkMgY29kZWMgLSBDb3B5bGVmdCAyMDAzLTIwMTQgLSBodHRwOi8vd3d3LnZpZGVvbGFuLm9yZy94MjY0Lmh0bWwgLSBvcHRpb25zOiBjYWJhYz0wIHJlZj0zIGRlYmxvY2s9MTowOjAgYW5hbHlzZT0weDE6MHgxMTEgbWU9aGV4IHN1Ym1lPTcgcHN5PTEgcHN5X3JkPTEuMDA6MC4wMCBtaXhlZF9yZWY9MSBtZV9yYW5nZT0xNiBjaHJvbWFfbWU9MSB0cmVsbGlzPTEgOHg4ZGN0PTAgY3FtPTAgZGVhZHpvbmU9MjEsMTEgZmFzdF9wc2tpcD0xIGNocm9tYV9xcF9vZmZzZXQ9LTIgdGhyZWFkcz02IGxvb2thaGVhZF90aHJlYWRzPTEgc2xpY2VkX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HBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw",da;function yu(){return da||(da=new Promise(function(n){var t,e=document.createElement("video");e.muted=!0,e.src=Ph,e.addEventListener("timeupdate",function r(){e.removeEventListener("timeupdate",r,!1),clearTimeout(t);var i=document.createElement("canvas");i.width=i.height=1;var a=i.getContext("2d");if(!a){n(!1);return}a.drawImage(e,0,0,1,1);var o=a.getImageData(0,0,1,1).data;o[3]>10?n(!0):n(!1)},!1),e.addEventListener("canplay",function r(){e.removeEventListener("canplay",r,!1),e.play()},!1),t=window.setTimeout(function(){return n(!1)},1e3)}))}var Bh=`
|
|
1370
1370
|
#include <common>
|
|
1371
1371
|
uniform sampler2D inputBuffer;
|
|
1372
1372
|
uniform float scale;
|
|
@@ -1379,7 +1379,7 @@ void main() {
|
|
|
1379
1379
|
float luminance = clamp(linearToRelativeLuminance(rgb), 0.1, 0.9);
|
|
1380
1380
|
gl_FragColor = vec4(luminance);
|
|
1381
1381
|
}
|
|
1382
|
-
`,
|
|
1382
|
+
`,Rh=function(n){ue(t,n);function t(e,r){return r===void 0&&(r=.5),n.call(this,e,{uniforms:{inputBuffer:new c.Uniform(null),scale:new c.Uniform(r)},fragment:Bh})||this}return t}(Oi),vo=function(){function n(t,e,r,i){this.enable=!0,this.renderer=t,this.camera=r,this.models=i,this.scene=e,this.copyPass=new vu(this.renderer)}return n.prototype.render=function(t,e){},n.prototype.dispose=function(){this.copyPass.dispose()},n}(),kh=function(n){ue(t,n);function t(e,r){r===void 0&&(r=.002);var i=n.call(this,e,{uniforms:{targetBuffer:new c.Uniform(null),inputBuffer:new c.Uniform(null),step:new c.Uniform(r)},fragment:`
|
|
1383
1383
|
uniform sampler2D targetBuffer;
|
|
1384
1384
|
uniform sampler2D inputBuffer;
|
|
1385
1385
|
uniform float step;
|
|
@@ -1407,7 +1407,7 @@ void main() {
|
|
|
1407
1407
|
}
|
|
1408
1408
|
gl_FragColor = vec4(result, result, result, 1.0);
|
|
1409
1409
|
}
|
|
1410
|
-
`})||this;return i.material.extensions.shaderTextureLOD=!0,i}return Object.defineProperty(t.prototype,"targetBuffer",{get:function(){return this.material.uniforms.targetBuffer.value},set:function(e){this.material.uniforms.targetBuffer.value=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"step",{get:function(){return this.material.uniforms.step.value},set:function(e){this.material.uniforms.step.value=e},enumerable:!1,configurable:!0}),t}(Oi),
|
|
1410
|
+
`})||this;return i.material.extensions.shaderTextureLOD=!0,i}return Object.defineProperty(t.prototype,"targetBuffer",{get:function(){return this.material.uniforms.targetBuffer.value},set:function(e){this.material.uniforms.targetBuffer.value=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"step",{get:function(){return this.material.uniforms.step.value},set:function(e){this.material.uniforms.step.value=e},enumerable:!1,configurable:!0}),t}(Oi),Fh=function(n){ue(t,n);function t(e){var r=n.call(this,e,{uniforms:{inputBuffer:new c.Uniform(null),luminanceAdaptiveBuffer:new c.Uniform(null),progress:new c.Uniform(0)},fragment:`
|
|
1411
1411
|
#include <common>
|
|
1412
1412
|
uniform sampler2D inputBuffer;
|
|
1413
1413
|
uniform sampler2D luminanceAdaptiveBuffer;
|
|
@@ -1429,14 +1429,14 @@ void main() {
|
|
|
1429
1429
|
rgb = clamp(lumCompressed * rgb, 0.0, 1.0);
|
|
1430
1430
|
gl_FragColor = mix(inputColor, vec4(rgb, alpha), progress * 0.9);
|
|
1431
1431
|
}
|
|
1432
|
-
`})||this;return r.material.transparent=!0,r}return Object.defineProperty(t.prototype,"luminanceAdaptiveBuffer",{get:function(){return this.material.uniforms.luminanceAdaptiveBuffer.value},set:function(e){this.material.uniforms.luminanceAdaptiveBuffer.value=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"progress",{get:function(){return this.material.uniforms.progress.value},set:function(e){this.material.uniforms.progress.value=e},enumerable:!1,configurable:!0}),t}(Oi),
|
|
1432
|
+
`})||this;return r.material.transparent=!0,r}return Object.defineProperty(t.prototype,"luminanceAdaptiveBuffer",{get:function(){return this.material.uniforms.luminanceAdaptiveBuffer.value},set:function(e){this.material.uniforms.luminanceAdaptiveBuffer.value=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"progress",{get:function(){return this.material.uniforms.progress.value},set:function(e){this.material.uniforms.progress.value=e},enumerable:!1,configurable:!0}),t}(Oi),Ps=function(n){ue(t,n);function t(e,r,i,a){var o=n.call(this,e,r,i,a)||this;return o.enableTime=Me(),o.renderer=e,o.valuePass=new wh(o.renderer),o.luminancePass=new Rh(o.renderer,Math.sqrt(1/3)),o.nextStepPass=new kh(o.renderer,.01),o.luminanceAdaptivePass=new Fh(o.renderer),o}return t.prototype.render=function(e){this.renderer.setRenderTarget(e[0]),this.renderer.render(this.scene,this.camera),this.enableTime===null&&(this.enableTime=Me()),this.luminanceTargetBuffer||(this.luminanceTargetBuffer=new c.WebGLRenderTarget(128,128,{minFilter:c.LinearMipmapLinearFilter,magFilter:c.LinearFilter,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1,format:c.RGBAFormat,generateMipmaps:!0}),this.nextStepPass.targetBuffer=this.luminanceTargetBuffer.texture),this.luminancePass.render(e[0],this.luminanceTargetBuffer),this.luminancePrevBuffer||(this.luminancePrevBuffer=new c.WebGLRenderTarget(1,1,{minFilter:c.NearestFilter,magFilter:c.NearestFilter,type:c.HalfFloatType,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1}),this.valuePass.render(new c.Vector3(.5,.5,.5),this.luminancePrevBuffer)),this.luminanceNextBuffer||(this.luminanceNextBuffer=new c.WebGLRenderTarget(1,1,{minFilter:c.NearestFilter,magFilter:c.NearestFilter,type:c.HalfFloatType,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1}),this.valuePass.render(new c.Vector3(.5,.5,.5),this.luminanceNextBuffer),this.luminanceAdaptivePass.luminanceAdaptiveBuffer=this.luminanceNextBuffer.texture),this.copyPass.render(this.luminanceNextBuffer,this.luminancePrevBuffer),this.nextStepPass.render(this.luminancePrevBuffer,this.luminanceNextBuffer),this.luminanceAdaptivePass.progress=Math.min((Me()-this.enableTime)/100,1),this.luminanceAdaptivePass.render(e[0],e[1])},t.prototype.dispose=function(){var e,r,i;(e=this.luminanceTargetBuffer)===null||e===void 0||e.dispose(),(r=this.luminancePrevBuffer)===null||r===void 0||r.dispose(),(i=this.luminanceNextBuffer)===null||i===void 0||i.dispose(),this.copyPass.dispose(),this.luminancePass.dispose(),this.nextStepPass.dispose(),this.luminanceAdaptivePass.dispose()},t}(vo),fa,Bs=new c.Vector3,Lh=64,zr=(fa=Math.SQRT1_2)!==null&&fa!==void 0?fa:Math.sqrt(2),Oh={up:new c.Quaternion(zr,0,0,zr),down:new c.Quaternion(-zr,0,0,zr),left:new c.Quaternion(0,zr,0,zr),right:new c.Quaternion(0,-zr,0,zr),front:new c.Quaternion(0,0,0,1),back:new c.Quaternion(0,1,0,0)},Vh=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),Nh=new Float32Array([0,0,1,0,0,1,1,1]),Dh=new Uint8Array([0,1,2,1,3,2]),Vi=new c.BufferGeometry;Vi.setAttribute("position",new c.BufferAttribute(Vh,3));Vi.setAttribute("uv",new c.BufferAttribute(Nh,2));Vi.setIndex(new c.BufferAttribute(Dh,1));var zh=`
|
|
1433
1433
|
uniform float flipY;
|
|
1434
1434
|
varying vec2 vUv;
|
|
1435
1435
|
void main() {
|
|
1436
1436
|
vUv = vec2(uv.x, mix((1.0 - uv.y), uv.y, flipY));
|
|
1437
1437
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
1438
1438
|
}
|
|
1439
|
-
`,
|
|
1439
|
+
`,Qh=`
|
|
1440
1440
|
#if defined(USE_LUMINANCE)
|
|
1441
1441
|
uniform sampler2D luminanceMap;
|
|
1442
1442
|
#endif
|
|
@@ -1450,7 +1450,7 @@ void main() {
|
|
|
1450
1450
|
gl_FragColor.a = 1.0 - texture2D(luminanceMap, vUv).r;
|
|
1451
1451
|
#endif
|
|
1452
1452
|
}
|
|
1453
|
-
`,
|
|
1453
|
+
`,Uh=function(n){ue(t,n);function t(){var e=n.call(this,{uniforms:{map:{value:null},luminanceMap:{value:null},flipY:{value:1},level:{value:0}},vertexShader:zh,fragmentShader:Qh})||this;return e.depthTest=!1,e.depthWrite=!1,e.blending=c.NoBlending,e.map=e.uniforms.map.value,e.luminanceMap=e.uniforms.luminanceMap.value,e.flipY=!!e.uniforms.flipY.value,e.level=e.uniforms.level.value,Object.defineProperties(e,{map:{get:function(){return this.uniforms.map.value},set:function(r){this.uniforms.map.value=r}},luminanceMap:{get:function(){return this.uniforms.luminanceMap.value},set:function(r){this.uniforms.luminanceMap.value=r,this.defines.USE_LUMINANCE=r!==null,this.needsUpdate=!0}},flipY:{get:function(){return this.uniforms.flipY.value===1},set:function(r){this.uniforms.flipY.value=r?1:0}},level:{get:function(){return this.uniforms.level.value},set:function(r){this.uniforms.level.value=r}}}),e}return t}(c.ShaderMaterial),qh=function(n){ue(t,n);function t(e,r){var i=n.call(this,Vi,new Uh)||this;return e.box.getCenter(i.position),i.quaternion.multiplyQuaternions(new c.Quaternion().setFromAxisAngle(new c.Vector3(0,1,0),-Math.PI),Oh[e.face]),i.scale.setScalar(e.size),i.node=e,i.name="tiling:tile",i.material.visible=!1,i.activeTime=-1,i.disposed=!1,i.needsRender=!1,i.frustumCulled=!1,r.then(function(a){var o=a[0],s=a[1];i.disposed?(o.dispose(),s==null||s.dispose()):(i.material.map=o,i.material.luminanceMap=s,i.material.flipY=!!o.flipY,i.material.level=e.level,i.material.needsUpdate=!0,i.material.visible=!0,i.needsRender=!0)}).catch(z),i}return t.prototype.updateTime=function(e){},t.prototype.dispose=function(){var e;this.disposed=!0,this.material.map&&(this.material.map.dispose(),(e=this.material.luminanceMap)===null||e===void 0||e.dispose()),this.material.dispose()},t}(c.Mesh),Hh=function(n){ue(t,n);function t(){var e=n.call(this)||this;return e.needsRender=!1,e.name="tiling",e}return t}(c.Group),Gh=function(){function n(t,e,r){this.disposed=!1,this.textureLoader=new _n,this.minLevel=e,this.level=0,this.panoId="[0]",this.maxRequest=n.DEFAULT_MAX_REQUEST,this.pedding=0,this.tileTree=Ca(this.minLevel),this.tileMeshes=new Map,this.resource=[],this.luminance=null,this.imageOptions=r,this.fetcher=t,this.object=new Hh,this.object.renderOrder=-3}return n.prototype.setFetcher=function(t){this.fetcher=t},n.prototype.cleanup=function(){var t=this;this.tileMeshes.forEach(function(e){e.dispose(),t.object.remove(e),t.object.needsRender=!0}),this.tileMeshes.clear()},n.prototype.setRotation=function(t){this.disposed||this.object.quaternion.equals(t)||(this.object.quaternion.copy(t),this.object.needsRender=!0)},n.prototype.setPosition=function(t){this.disposed||this.object.position.equals(t)||(this.object.position.copy(t),this.object.needsRender=!0)},n.prototype.setResource=function(t,e){var r,i;if(!this.disposed&&!(this.resource===t&&this.luminance===e)){this.cleanup(),this.resource=t;var a=(i=(r=t.slice().sort(function(o,s){return s.level-o.level})[0])===null||r===void 0?void 0:r.level)!==null&&i!==void 0?i:0;this.tileTree=Ca(a),this.luminance=e,this.object.needsRender=!0}},n.prototype.update=function(t,e,r){var i=this;if(!this.disposed){this.level=e;var a=t.planes[5].normal,o=[];e>=this.minLevel&&$a(this.tileTree,function(g){if(!(g.level<i.minLevel)){if(g.level>e||!t.intersectsBox(g.box))return!1;o.push(g)}}),o.sort(function(g,x){return g.level!==x.level?g.level-x.level:g.box.getCenter(Bs).angleTo(a)-x.box.getCenter(Bs).angleTo(a)});for(var s=new Set,l=function(g){var x=u.resource.filter(function(G){return G.level===g.level})[0];if(!x)return"continue";if(s.add(g),u.tileMeshes.has(g))return u.tileMeshes.get(g).activeTime=r,"continue";if(u.pedding>=u.maxRequest)return"continue";var b=x.size,w=u.imageOptions.transform,E=Math.pow(2,g.level)*g.position.y,M=Math.pow(2,g.level)*g.position.x,C="".concat(u.panoId,".").concat(g.face,".").concat(g.level,".").concat(E,".").concat(M),P=F(F({key:"pano_tile.".concat(C)},Cr(u.imageOptions,["format","size","quality","sharpen","mappings"])),{size:x.scale>=1?void 0:b*g.size*x.scale,cut:[b*g.position.x,b*g.position.y,b*g.size,b*g.size]}),S=u.textureLoader.loadTexture(x[g.face],{imageURL:{transform:w,options:P},minFilter:c.LinearFilter,magFilter:c.LinearFilter,generateMipmaps:!1,fetcher:u.fetcher}).then(function(G){return G.body}),T=null;if(u.luminance){var B=u.luminance[g.face],L=B.match(/\/cube_(\d+)\//),k=L?Number(L[1]):!1;if(k!==!1){var O=x.size*x.scale/2,D=O*g.size,N=k<O?B.replace(/\/cube_(\d+)\//,"cube_"+O):B,X=F(F({},P),{size:k*g.size===D?void 0:D,cut:[k*g.position.x,k*g.position.y,k*g.size,k*g.size],key:"pano_tile_luminance.".concat(C)});T=u.textureLoader.loadTexture(N,{imageURL:{transform:u.imageOptions.transform,options:X},minFilter:c.LinearFilter,magFilter:c.LinearFilter,fetcher:u.fetcher}).then(function(G){return G.body}).catch(function(){return null})}}u.pedding++;var K=Promise.all([S,T]).then(function(G){return i.pedding--,G},function(G){return i.pedding--,Promise.reject(G)}),Q=new qh(g,K);Q.name="tiling:tile-".concat(C),Q.activeTime=r,Q.renderOrder=g.level,u.tileMeshes.set(g,Q),u.object.needsRender=!0,u.object.add(Q)},u=this,d=0,f=o;d<f.length;d++){var A=f[d];l(A)}var m=[];this.tileMeshes.forEach(function(g,x){s.has(x)||m.push(x),g.visible=x.level<=e});for(var h=m.sort(function(g,x){var b,w,E,M;return((w=(b=i.tileMeshes.get(x))===null||b===void 0?void 0:b.activeTime)!==null&&w!==void 0?w:0)-((M=(E=i.tileMeshes.get(g))===null||E===void 0?void 0:E.activeTime)!==null&&M!==void 0?M:0)}).slice(Math.max(0,Lh-s.size)),v=0,y=h;v<y.length;v++){var A=y[v],p=this.tileMeshes.get(A);p&&(p.dispose(),this.object.remove(p),this.object.needsRender=!0),this.tileMeshes.delete(A)}}},n.prototype.dispose=function(){this.cleanup(),this.resource=[],this.disposed=!0},n.DEFAULT_MAX_REQUEST=3,n}(),Kh=new Float32Array([-1,1,1,-1,1,-1,-1,-1,1,-1,-1,-1,1,1,-1,1,1,1,1,-1,-1,1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,-1,1,-1,-1,1,1,-1,-1,-1,-1,-1,1,1,1,-1,1,1,1,-1,1,-1,-1,1,-1,1,-1,1,1,-1,-1,-1,-1,1,-1,-1]),jh=new Uint8Array([0,2,1,2,3,1,4,6,5,6,7,5,8,10,9,10,11,9,12,14,13,14,15,13,16,18,17,18,19,17,20,22,21,22,23,21]),Ao=new c.BufferGeometry;Ao.setAttribute("position",new c.BufferAttribute(Kh,3));Ao.setIndex(new c.BufferAttribute(jh,1));var Jh=`
|
|
1454
1454
|
#if defined(USE_PANO_VIDEO)
|
|
1455
1455
|
varying vec3 worldPosition;
|
|
1456
1456
|
#endif
|
|
@@ -1461,7 +1461,7 @@ void main() {
|
|
|
1461
1461
|
#endif
|
|
1462
1462
|
gl_Position = projectionMatrix * modelViewMatrix * transformed;
|
|
1463
1463
|
}
|
|
1464
|
-
`,
|
|
1464
|
+
`,Wh=`
|
|
1465
1465
|
uniform vec2 size;
|
|
1466
1466
|
uniform mat4 matrix;
|
|
1467
1467
|
uniform float alpha;
|
|
@@ -1485,7 +1485,7 @@ void main() {
|
|
|
1485
1485
|
gl_FragColor = vec4(videoColor.rgb, match * blendAlpha * alpha);
|
|
1486
1486
|
#endif
|
|
1487
1487
|
}
|
|
1488
|
-
`,Wh=function(){function n(){this.material=new c.ShaderMaterial({vertexShader:jh,fragmentShader:Jh,uniforms:{size:new c.Uniform(null),matrix:new c.Uniform(null),alpha:new c.Uniform(null),map:new c.Uniform(null)},depthTest:!1,depthWrite:!1,defines:{USE_PANO_VIDEO:!1},blending:c.CustomBlending,blendSrc:c.SrcAlphaFactor,blendDst:c.OneMinusSrcAlphaFactor,blendSrcAlpha:c.OneFactor,blendDstAlpha:c.OneMinusSrcAlphaFactor}),this.object=new c.Mesh(vo,this.material),this.object.visible=!1,this.object.renderOrder=-1,this.object.frustumCulled=!1,this.object.name="pano-video",this.alphaMotion=new Se({alpha:0})}return n.prototype.setMaterial=function(t){t?(this.material.uniforms.size.value=t.size,this.material.uniforms.matrix.value=t.matrix,this.material.uniforms.map.value=t.map,this.alphaMotion.set({alpha:t.alpha},500).catch(z),this.material.uniforms.alpha.value=t.alpha):(this.material.uniforms.size.value=null,this.material.uniforms.matrix.value=null,this.material.uniforms.map.value=null,this.alphaMotion.set({alpha:0},0).catch(z));var e=t!==null,r=this.material.defines.USE_PANO_VIDEO;e!==r&&(this.material.defines.USE_PANO_VIDEO=e,this.material.needsUpdate=!0,this.object.visible=t!==null)},n.prototype.updateTime=function(t){this.alphaMotion.ended||(this.alphaMotion.update(t),this.material.uniforms.alpha.value=this.alphaMotion.value.alpha)},n.prototype.dispose=function(){this.material.dispose()},n}(),Xh=new c.Matrix4().makeRotationAxis(new c.Vector3(0,1,0),Math.PI),Bs=new c.Vector3(-1,1,1),Rs=function(){function n(t){t===void 0&&(t=0),this.width=t,this.pool=[]}return Object.defineProperty(n.prototype,"size",{get:function(){return this.pool.length},enumerable:!1,configurable:!0}),n.prototype.create=function(){return new c.WebGLCubeRenderTarget(this.width,{stencilBuffer:!1,depthBuffer:!1})},n.prototype.pop=function(){var t=this.pool.pop();return t||this.create()},n.prototype.push=function(t){this.pool.indexOf(t)===-1&&this.pool.push(t)},n.prototype.clear=function(){for(var t=0,e=this.pool;t<e.length;t++){var r=e[t];r.dispose()}this.pool.length=0},n}(),Ao=function(n){ue(t,n);function t(e){var r=this,i,a,o,s,l=t.parseArgs(e);r=n.call(this,l)||this,r.TILED_CUBE_TEXTURE_LEVEL=2,r.mode="Panorama",r.tileLevel=0,r.initAnimationed=!1,r.maxAccessibleDistance=l.maxAccessibleDistance,r.panoTapTriggerRadius=l.panoTapTriggerRadius,r.panoCircleMeshCreator=l.panoCircleMeshCreator,r.tileLevelForFov=l.tileLevelForFov,r.tileMaxRequest=l.tileMaxRequest,r.luminanceAdaptiveEffectEnable=l.luminanceAdaptiveEffectEnable,r.luminanceAdaptiveEffect=new Ts(r.renderer,r.modelScene,r.camera,r.models),r.colorCubeRenderTargetPool=new Rs,r.luminanceCubeRenderTargetPool=new Rs;var u=r.models.getMaterial()||{},d=u.pano0,f=u.pano1;d&&(f==null?void 0:f.map)!==d.map&&(r.models.setMaterial({pano0:f}),d.map.dispose(),d.map instanceof De&&d.map.cubeRenderTarget&&r.colorCubeRenderTargetPool.push(d.map.cubeRenderTarget),d.luminanceMap&&(d.luminanceMap.dispose(),d.luminanceMap instanceof De&&d.luminanceMap.cubeRenderTarget&&r.luminanceCubeRenderTargetPool.push(d.luminanceMap.cubeRenderTarget)));for(var A=r.colorCubeRenderTargetPool.size;A<2;A++){var m=Math.max(1024*r.TILED_CUBE_TEXTURE_LEVEL,512),h=r.colorCubeRenderTargetPool.create();h.setSize(m,m),Sa(null,h,r.renderer),r.colorCubeRenderTargetPool.push(h)}r.panoMeshes={},r.updatePanoMeshes(),r.locationMotion=new Se({count:0,distance:r.camera.pose.distance}),r.modelAlphaMotion=new Se({modelAlpha:(a=(i=r.models.getMaterial())===null||i===void 0?void 0:i.modelAlpha)!==null&&a!==void 0?a:0}),r.perspToOrthoMotion=new Se({perspToOrtho:r.camera.perspToOrtho.x}),r.panoResources={},r.panoResources[r.locationMotion.keyframes[0].key=r.locationMotion.keyframes[1].key=wt()]={panoId:Ue(r.currentPano),panoPicture:(s=(o=r.models.getMaterial())===null||o===void 0?void 0:o.pano1)!==null&&s!==void 0?s:null,position:r.camera.pose.offset.clone(),effect:"fly",fixCameraTransform:new c.Matrix4};var v=r.works.getResolvedObserver(r.currentPano);return r.textureLoader=new _n,r.tiling=new Hh(v?it(v.work):yi,r.TILED_CUBE_TEXTURE_LEVEL+1,r.imageOptions),r.scene.add(r.tiling.object),r.panoVideo=new Wh,r.scene.add(r.panoVideo.object),r}return t.parseArgs=function(e){var r,i,a,o,s,l;if(e instanceof t)return e;var u=n.parseArgs.call(this,e);return F(F({},u),{maxAccessibleDistance:(r=e.maxAccessibleDistance)!==null&&r!==void 0?r:5,panoTapTriggerRadius:(i=e.panoTapTriggerRadius)!==null&&i!==void 0?i:.5,panoCircleMeshCreator:(a=e.panoCircleMeshCreator)!==null&&a!==void 0?a:function(d){return new du},tileLevelForFov:(o=e.tileLevelForFov)!==null&&o!==void 0?o:function(d,f){var A=function(p){return p/Math.PI*180},m=function(p){return p/180*Math.PI},h=f.height/2/Math.tan(m(d/2)),v=f.width>f.height?d:A(Math.atan(Math.tan(m(d/2))*(f.width/f.height))*2);v*=.9;var y=h*(Math.tan(m(v/2))-Math.tan(m(v/2-1)));return y>80?5:y>60?4:y>30?3:y>18?2:y>12?1:0},tileMaxRequest:(s=e.tileMaxRequest)!==null&&s!==void 0?s:3,luminanceAdaptiveEffectEnable:(l=e.luminanceAdaptiveEffectEnable)!==null&&l!==void 0?l:!0})},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return F(F({},i),{mode:"Panorama"})},t.prototype.destroy=function(){var e,r;if(n.prototype.destroy.call(this),this.scene.remove(this.tiling.object),this.tiling.dispose(),this.locationMotion.dispose(),this.colorCubeRenderTargetPool.clear(),this.luminanceCubeRenderTargetPool.clear(),delete this.pendingTextureTask,this.panoMeshes)for(var i=Object.keys(this.panoMeshes),a=0,o=i;a<o.length;a++){var s=o[a],l=this.panoMeshes[s];this.helper.remove(l),l.dispose(),delete this.panoMeshes[s]}var u=this.videoTexture.image;u.pause(),u.oncanplay=function(){},u.ontimeupdate=function(){},this.scene.remove(this.panoVideo.object),this.panoVideo.setMaterial(null),this.panoVideo.dispose();for(var d=(e=this.models.getMaterial())!==null&&e!==void 0?e:{},f=d.pano0,A=d.pano1,m=0,h=Object.keys(this.panoResources);m<h.length;m++){var v=h[m],y=this.panoResources[v];if(y.panoPicture){var p=y.panoPicture.map;p&&p!==(f==null?void 0:f.map)&&p!==(A==null?void 0:A.map)&&(p.dispose(),(r=y.panoPicture.luminanceMap)===null||r===void 0||r.dispose(),y.panoPicture=null)}delete this.panoResources[v]}this.luminanceAdaptiveEffect.dispose()},t.prototype.isReady=function(){return this.locationMotion.ended!==!0?!1:n.prototype.isReady.call(this)},t.prototype.isTileReady=function(){var e,r,i,a=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),o=((e=a.panoPicture)===null||e===void 0?void 0:e.map)instanceof De&&(i=(r=a.panoPicture)===null||r===void 0?void 0:r.map.tilePending)!==null&&i!==void 0?i:0,s=this.tiling.pedding;return this.initAnimationed&&o<=0&&s<=0},t.prototype.updateWork=function(e,r,i,a){var o=this;this.userAction=a,this.works=e;var s=t.initAnimationEndState(F(F({},this),{initial:{currentState:F(F({},this.currentPano),this.camera.pose),duration:i.duration,effect:i.effect,state:r,userAction:a}})),l={workCode:s.workCode,panoIndex:s.panoIndex},u=this.works.getWork(l.workCode);return this.tiling.setFetcher(u?it(u):yi),this.tiling.cleanup(),this.initAnimationed=!1,this.hideIntersectMesh(),this.updatePanoMeshes(),this.moveToPano(l,{effect:i.effect,duration:i.duration,longitude:r.longitude,latitude:r.latitude,fov:r.fov,moveEndCallback:function(){o.initAnimationed=!0},moveCancelCallback:function(){o.initAnimationed=!0}},a),!0},t.prototype.updateModel=function(e){this.models=e,this.updatePanoMeshes()},t.prototype.updateTime=function(e,r){var i=this,a,o,s,l,u,d,f,A,m,h;if(!this.destroyed){var v={},y={},p=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),g=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),x=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),y.longitude=this.cameraMotion.value.longitude,y.latitude=this.cameraMotion.value.latitude,y.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),v.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(he(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var b=this.locationMotion.getKeyFrameSegment(e),w=b[0],E=b[1],M=this.panoResourceFromLocationMotionKeyframe(w),C=this.panoResourceFromLocationMotionKeyframe(E),P=new c.Vector3().copy(M.position),S=new c.Vector3().copy(C.position),T=this.locationMotion.value.count-E.value.count+1;v.progress=T,C.panoPicture&&(T<1?M.panoPicture&&(v.pano0=M.panoPicture):v.pano0=C.panoPicture,v.pano1=C.panoPicture),C.effect==="montage"?v.transition="BLACK":C.effect==="spread"?v.transition="SPREAD":v.transition="FADE",(C.effect==="zoomin"||C.effect==="zoomout")&&(v.progress=Math.pow(T,3)),T<1&&C.effect!=="fly"&&(v.pano0&&M.panoPicture&&(v.pano0={map:v.pano0.map,zoom:v.pano0.zoom,luminanceMap:v.pano0.luminanceMap,matrix:M.panoPicture.matrix.clone().premultiply(M.fixCameraTransform).setPosition(C.position)}),P.copy(S),x=!0),y.distance=this.locationMotion.value.distance,y.offset=new c.Vector3(P.x+(S.x-P.x)*T,P.y+(S.y-P.y)*T,P.z+(S.z-P.z)*T);for(var B=[],L=[],k=0,O=this.locationMotion.keyframes;k<O.length;k++){var D=O[k],N=D.key,X=D.progress;N!==void 0&&(B.push(N),X>this.locationMotion.progress&&L.push(N))}for(var K=0,Q=Object.keys(this.panoResources);K<Q.length;K++){var G=Q[K];if(!(L.indexOf(G)>=0)){var J=this.panoResources[G];if(J.panoPicture){var H=J.panoPicture.map,j=J.panoPicture.luminanceMap;if(H){if(H===((a=v.pano0)===null||a===void 0?void 0:a.map)||H===((o=v.pano1)===null||o===void 0?void 0:o.map))continue;H instanceof De&&H.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(H.cubeRenderTarget),H.dispose(),j&&(j instanceof De&&j.cubeRenderTarget&&this.luminanceCubeRenderTargetPool.push(j.cubeRenderTarget),j.dispose()),J.panoPicture=null}}B.indexOf(G)>=0||delete this.panoResources[G]}}this.currentPano=pt(C.panoId),this.emit("pano.moving",W("pano.moving",{userAction:this.userAction,prevPano:pt(p.panoId),state:F(F(F(F({},pt(g.panoId)),{mode:this.mode}),_e(this.camera.pose)),y),options:{},progress:this.locationMotion.progress,error:null}))}Nt(v)===!1&&(!((s=v.pano0)===null||s===void 0)&&s.map&&v.pano0.map instanceof De&&!v.pano0.map.cubeRenderTarget&&(v.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((l=v.pano0)===null||l===void 0)&&l.luminanceMap&&v.pano0.luminanceMap instanceof De&&!v.pano0.luminanceMap.cubeRenderTarget&&(v.pano0.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),!((u=v.pano1)===null||u===void 0)&&u.map&&v.pano1.map instanceof De&&!v.pano1.map.cubeRenderTarget&&(v.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((d=v.pano1)===null||d===void 0)&&d.luminanceMap&&v.pano1.luminanceMap instanceof De&&!v.pano1.luminanceMap.cubeRenderTarget&&(v.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.models.setMaterial(v)),Nt(y)===!1&&this.setCamera(y);var Z=this.works.getResolvedObserver(this.currentPano),Y=this.locationMotion.ended?this.getForwardObserverOrNot():null;if(this.camera.pose.distance>.1||x)for(var pe=0,ee=Object.keys(this.panoMeshes);pe<ee.length;pe++){var oe=ee[pe],ie=this.panoMeshes[oe];ie.setOpacity(0),ie.setCurrent(!1),ie.updateTime&&ie.updateTime(e,r),ie.visible=!1}else if(Z){var ce=ur(Z.visibleIds,function(ye){var ge=i.works.getResolvedObserver(ye);return ge?Z.standingPosition.distanceTo(ge.standingPosition):1/0},!0),ne=ce[1];ne=he(ne,2.5,1/0);for(var ae=Z.visibleIds.concat(Ue(this.currentPano)),de=this.camera.getDirection(new c.Vector3),ve=0,xe=Object.keys(this.panoMeshes);ve<xe.length;ve++){var oe=xe[ve],ie=this.panoMeshes[oe],Ce=this.works.getResolvedObserver(oe);if(ae.indexOf(oe)===-1)ie.setCurrent(!1),ie.setOpacity(0);else if(!Ce)ie.setCurrent(!1),ie.setOpacity(0);else if(!Ce.loadable&&!Ce.active)ie.setCurrent(!1),ie.setOpacity(0);else{var Be=ie.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);ie.setCurrent(!ie.loading&&ie.progress===0&&Y!==null&&Y.panoId===oe),ie.setOpacity(Be<.01?0:he(ne/Be*1.2,.4,.85));var $=this.camera.position.clone().setY(ie.position.y),te=new c.Vector3().copy(ie.position).sub($).normalize();if(oe===Ue(this.currentPano)){var U=he((.5-$.distanceTo(ie.position))/.5,0,1);te.multiplyScalar(1-U).add(de.clone().multiplyScalar(U))}te.length()>0&&ie.quaternion.setFromEuler(new c.Euler(0,Math.atan2(te.x,te.z),0))}ie.updateTime&&ie.updateTime(e,r)}}var Le=this.tileLevel=function(){if(i.tileLevelForFov===!1)return 0;var ye=i.renderer.getDrawingBufferSize(new c.Vector2);ye.width*=i.scissor.width,ye.height*=i.scissor.height;var ge=g.panoId,me=i.works.getResolvedObserver(ge),Ae=i.imageOptions.size;if(typeof Ae=="undefined"&&me){var Ne=me.images.up.match(/\/cube_(\d+)\//);Ne&&(Ae=Number(Ne[1]))}typeof Ae=="undefined"&&(Ae=2048);var ze=0;Ae>=1024&&(ze=1),Ae>=2048&&(ze=2),Ae>=4096&&(ze=3),Ae>=8192&&(ze=4);var je=i.tileLevelForFov(i.camera.fov,ye);return je>ze?je:0}(),Pe=function(){var ye=i.camera.quaternion.clone(),ge=i.works.getResolvedObserver(g.panoId),me=ge!=null?ge:Z;me&&ye.premultiply(me.quaternion.clone().inverse());var Ae=new c.Matrix4().makeRotationFromQuaternion(ye),Ne=new c.Matrix4().getInverse(Ae),ze=new c.Frustum().setFromProjectionMatrix(new c.Matrix4().multiplyMatrices(i.camera.projectionMatrix,Ne));return ze}();g.panoId===Ue(this.currentPano)&&(((f=g.panoPicture)===null||f===void 0?void 0:f.map)instanceof De&&(g.panoPicture.map.maxRequest=this.tileMaxRequest,g.panoPicture.map.update(Pe,Le),g.panoPicture.map.needsRender===!0&&(g.panoPicture.map.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)),((A=g.panoPicture)===null||A===void 0?void 0:A.luminanceMap)instanceof De&&(g.panoPicture.luminanceMap.maxRequest=this.tileMaxRequest,g.panoPicture.luminanceMap.update(Pe,Le),g.panoPicture.luminanceMap.needsRender===!0&&(g.panoPicture.luminanceMap.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)));{var Ie=this.tiling.object.visible;if(this.initAnimationed){var Qe=g.panoId,be=this.works.getResolvedObserver(Qe);be?Zn(this.camera.position,be.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==Qe&&this.tiling.cleanup(),this.tiling.panoId=Qe,this.tiling.setResource((h=(m=be.images)===null||m===void 0?void 0:m.tiles)!==null&&h!==void 0?h:[],this.enableIOSEDR&&be.images.luminance?be.images.luminance:null),this.tiling.setFetcher(it(be.work)),this.tiling.setRotation(be.quaternion),this.tiling.setPosition(be.position),this.tiling.maxRequest=this.tileMaxRequest,Le>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update(Pe,Le,e):this.tiling.update(Pe,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;Ie!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0,this.modelSceneNeedsRender=!0)}this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e),this.intersectMesh.scale.setScalar(he(this.cameraMotion.value.fov/45,0,1))}},t.prototype.render=function(e,r){var i=this.renderer.getRenderTarget(),a=this.works.getResolvedObserver(this.currentPano);a&&a.video&&(this.needsRender=!0,this.modelSceneNeedsRender=!0),this.updateScreenBuffer(r),e&&(r==="luminance"?(this.luminanceAdaptiveEffect.enable=this.luminanceAdaptiveEffectEnable,this.luminanceAdaptiveEffect.render(this.screenBuffers)):(this.renderer.setRenderTarget(this.modelRenderTarget),this.renderer.render(this.modelScene,this.camera))),this.depthCopyPass.render(this.modelRenderTarget.depthTexture,i),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.copyPass.render(this.modelRenderTarget,i),this.renderer.setRenderTarget(i),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,this.camera),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0},t.prototype.postProcessing=function(e,r){if(!this.destroyed&&r==="luminance")return this.luminanceAdaptiveEffect||(this.luminanceAdaptiveEffect=new Ts(this.renderer,this.scene,this.camera,this.models),this.luminanceAdaptiveEffect.enable=this.luminanceAdaptiveEffectEnable),this.luminanceAdaptiveEffect.render(e)},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(Me())[1],r=this.locationMotion.getKeyFrameSegment(Me())[1],i=this.panoResourceFromLocationMotionKeyframe(r),a=this.works.getResolvedObserver(i.panoId);return{workCode:a?a.work.workCode:this.currentPano.workCode,panoIndex:a?a.panoIndex:this.currentPano.panoIndex,mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:a?a.position.clone():this.camera.position.clone(),distance:this.locationMotion.value.distance}},t.prototype.moveToPano=function(e,r,i){var a=this,o,s,l,u,d=(o=r.effect)!==null&&o!==void 0?o:"fly";this.userAction=i,this.stopMomentumMovement();var f=this.works.getResolvedObserver(e);if(!f)throw new Error("Invalid PanoId ".concat(JSON.stringify(e)));var A=Kn(f.images.up),m=this.imageOptions.size;typeof m=="undefined"&&f&&A&&(m=Number(A)),typeof m=="undefined"&&(m=2048);var h=this.imageOptions.transform,v=F({key:"pano.".concat(f.panoId)},Cr(this.imageOptions,["format","size","quality","sharpen","mappings"])),y=f.images,p=(l=(s=f.images.tiles)===null||s===void 0?void 0:s.filter(function(O){return O.size>m}))!==null&&l!==void 0?l:null,g=h,x={key:"pano_luminance.".concat(f.panoId),size:v.size?v.size/2:void 0},b=this.enableIOSEDR&&f.images.luminance?f.images.luminance:null,w=function(){if(!f.images.tiles||!b)return null;var O=Kn(b.up);return O?p==null?void 0:p.map(function(D){var N=D.size*D.scale/2;return O<N?{level:D.level,size:N,scale:1,back:Rt(b.back,N),front:Rt(b.front,N),left:Rt(b.left,N),right:Rt(b.right,N),up:Rt(b.up,N),down:Rt(b.down,N)}:{level:D.level,size:O,scale:N/O,back:b.back,front:b.front,left:b.left,right:b.right,up:b.up,down:b.down}}):null}(),E="pano:"+Cn([y,v,h]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===E)return;var M=this.pendingTextureTask.panoId;(u=this.panoMeshes[M])===null||u===void 0||u.setProgress(0),this.emit("pano.texture.abort",W("pano.texture.abort",{error:null,progress:0,meta:null,pano:f.pano})),this.pendingTextureTask.onError(new Error("texture aborted"))}var C="move-to-pano-"+f.panoId;this.pending.add(C);var P=this.models.getMaterial()||{},S=P.pano0,T=P.pano1,B;if(S&&S.map.name===E&&S.luminanceMap!==null===this.enableIOSEDR?B=S:(T==null?void 0:T.map.name)===E&&T.luminanceMap!==null===this.enableIOSEDR&&(B=T),B){var L={panoId:f.panoId,effect:d,panoPicture:{zoom:1,map:B.map,luminanceMap:B.luminanceMap,matrix:new c.Matrix4().compose(f.position,f.quaternion,Bs)},position:f.position.clone(),fixCameraTransform:new c.Matrix4};vt.shared.add(function(){a.pending.delete(C),a.doMoveToPano(f.pano,L,r)},!0,1);return}this.pendingTextureTask={panoId:f.panoId,hash:E,onLoad:function(O,D){var N;if(a.pending.delete(C),a.destroyed)O.body.dispose();else{O.body.name=E;var X={panoId:f.panoId,effect:d,panoPicture:{zoom:1,map:O.body,luminanceMap:(N=D==null?void 0:D.body)!==null&&N!==void 0?N:null,matrix:new c.Matrix4().compose(f.position,f.quaternion,Bs)},position:f.position.clone(),fixCameraTransform:new c.Matrix4};a.doMoveToPano(f.pano,X,r)}},onError:function(O){a.pending.delete(C);var D=F(F(F({},f.pano),{mode:a.mode}),_e(a.camera.pose));a.emit("pano.error",W("pano.error",{error:O,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:D})),a.emit("pano.cancel",W("pano.cancel",{error:O,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:D})),a.emit("error",O),r.moveCancelCallback&&r.moveCancelCallback()}};var k=this.panoMeshes[f.panoId];k&&k.tap&&k.tap(),Promise.all([this.tileLevelForFov&&p&&p.length?this.textureLoader.loadTiledCubeTexture(y,p,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:h,options:v},minFilter:c.LinearFilter,magFilter:c.LinearFilter,generateMipmaps:!1,format:c.RGBAFormat,viaAjax:!0,fetcher:it(f.work)},void 0,void 0,function(O){var D,N;a.emit("pano.texture.progress",W("pano.texture.progress",{error:null,progress:O,meta:null,pano:f.pano})),((D=a.pendingTextureTask)===null||D===void 0?void 0:D.hash)===E&&((N=a.panoMeshes[f.panoId])===null||N===void 0||N.setProgress(O))},this.renderer):this.textureLoader.loadCubeTexture(y,{imageURL:{transform:h,options:v},format:c.RGBAFormat,viaAjax:!0,fetcher:it(f.work)},void 0,void 0,function(O){var D,N;a.emit("pano.texture.progress",W("pano.texture.progress",{error:null,progress:O,meta:null,pano:f.pano})),((D=a.pendingTextureTask)===null||D===void 0?void 0:D.hash)===E&&((N=a.panoMeshes[f.panoId])===null||N===void 0||N.setProgress(O))},this.renderer),b?this.tileLevelForFov&&w&&w.length?this.textureLoader.loadTiledCubeTexture(b,w,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:g,options:x},minFilter:c.LinearFilter,magFilter:c.LinearFilter,generateMipmaps:!1,fetcher:it(f.work)},void 0,void 0,void 0,this.renderer).catch(function(){return null}):this.textureLoader.loadCubeTexture(b,{imageURL:{transform:g,options:x},fetcher:it(f.work)},void 0,void 0,void 0,this.renderer).catch(function(){return null}):Promise.resolve(null)]).then(function(O){var D,N,X=O[0],K=O[1];((D=a.pendingTextureTask)===null||D===void 0?void 0:D.hash)===E?(a.pendingTextureTask.onLoad(X,K),(N=a.panoMeshes[f.panoId])===null||N===void 0||N.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.success",W("pano.texture.success",{error:null,progress:1,meta:X.meta,pano:f.pano}))):(X.body.dispose(),K==null||K.body.dispose())}).catch(function(O){var D,N;((D=a.pendingTextureTask)===null||D===void 0?void 0:D.hash)===E&&(a.pendingTextureTask.onError(O),(N=a.panoMeshes[f.panoId])===null||N===void 0||N.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.error",W("pano.texture.error",{error:O,progress:0,meta:null,pano:f.pano})),a.emit("error",O))}),this.emit("pano.texture.load",W("pano.texture.load",{error:null,progress:0,meta:null,pano:f.pano}))},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var i=e.initial,a=i.duration,o=i.effect,s=i.userAction;e.userAction=s;var l=t.initAnimationEndState(e),u={workCode:l.workCode,panoIndex:l.panoIndex},d={modelAlpha:0},f={perspToOrtho:0},A=!1;e.moveToPano(u,{longitude:l.longitude,latitude:l.latitude,fov:l.fov,effect:o,duration:a,moveStartCallback:function(m){A=!0,e.perspToOrthoMotion.set(f,a).catch(z),e.modelAlphaMotion.setKeyframes([{progress:0,value:F({},e.modelAlphaMotion.value)},{progress:.6,value:F({},e.modelAlphaMotion.value)},{progress:1,value:d}],a).catch(z),e.emit("initAnimation.start",W("initAnimation.start",{state:m,userAction:e.userAction}))},moveEndCallback:function(m){e.emit("initAnimation.end",W("initAnimation.end",{state:m,userAction:e.userAction})),e.initAnimationed=!0,r()},moveCancelCallback:function(){var m=F(F(F({},u),{mode:e.mode}),_e(e.camera.pose));A===!1&&e.emit("initAnimation.start",W("initAnimation.start",{state:m,userAction:e.userAction})),e.emit("initAnimation.end",W("initAnimation.end",{state:m,userAction:e.userAction})),e.initAnimationed=!0,r()}},s)})},t.prototype.panoResourceFromLocationMotionKeyframe=function(e){return this.panoResources[e.key]},t.prototype.locationMotionKeyframesLength=function(e){for(var r=0,i=1;i<e.length;i++){var a=this.panoResourceFromLocationMotionKeyframe(e[i-1]).position,o=this.panoResourceFromLocationMotionKeyframe(e[i]).position,s=a.distanceTo(o)*(e[i].value.count-e[i-1].value.count);r+=s}return r},t.prototype.updatePanoMeshes=function(){for(var e=this,r={},i=Object.keys(this.panoMeshes),a=0,o=i;a<o.length;a++){var s=o[a],l=this.panoMeshes[s];r[s]=l,delete this.panoMeshes[s]}for(var u=1,d={},f=function(E){var M=ur(E.accessibleIds,function(P){var S=e.works.getResolvedObserver(P);if(!S)return 1/0;var T=S.standingPosition.distanceTo(E.standingPosition);return he(T,1,1/0)},!0),C=M[1];d[E.panoId]===void 0&&(d[E.panoId]=C)},A=0,m=this.works.resolvedObservers;A<m.length;A++){var h=m[A];f(h)}var v=Object.keys(d).map(function(E){return d[E]});if(v.length){var y=v.reduce(function(E,M){return E+M},0)/v.length;u=he(y*.6,1,3)}for(var p=0,g=this.works.resolvedObservers;p<g.length;p++){var h=g[p],l=void 0;r[h.panoId]?(l=r[h.panoId],l.loading===!0&&h.loadable===!1&&l.setLoading(!1),delete r[h.panoId]):(l=this.panoCircleMeshCreator(h.pano),l.name="PanoCircleMesh_"+h.panoId,this.helper.add(l)),l.scale.set(u,1,u),l.position.copy(h.standingPosition),this.panoMeshes[h.panoId]=l}for(var x=0,b=Object.keys(r);x<b.length;x++){var w=b[x];this.helper.remove(r[w]),r[w].dispose(),delete r[w]}},t.prototype.doMoveToPano=function(e,r,i){var a=this,o,s,l,u,d,f,A,m,h,v,y;i===void 0&&(i={});var p=Me(),g=wt();this.tiling.cleanup(),this.panoResources[g]=r;var x=1,b,w,E;if(this.locationMotion.ended){var M=this.locationMotion.getKeyFrameSegment(p);M[0];var C=M[1],P=this.locationMotion.value,S=((o=this.panoResourceFromLocationMotionKeyframe(C))!==null&&o!==void 0?o:this.camera).position,T=r.position;b=Math.max(S.distanceTo(T),x),w=[{key:C.key,progress:0,value:F(F({},P),{count:0})},{key:g,progress:1,value:{distance:0,count:1}}],E=0}else{var B=this.locationMotion.getKeyFrameSegment(p),L=B[0],C=B[1],P=this.locationMotion.value,k=this.panoResourceFromLocationMotionKeyframe(L).position,S=this.panoResourceFromLocationMotionKeyframe(C).position,T=r.position,O=C.value.count-P.count,D=Math.max(k.distanceTo(S),x)*O,N=Math.max(S.distanceTo(T),x);b=D+N,w=[{key:L.key,progress:0,value:F({},P)},{key:C.key,progress:D/b,value:C.value},{key:g,progress:1,value:{count:C.value.count+1,distance:0}}];var X=this.locationMotionKeyframesLength(this.locationMotion.keyframes),K=this.locationMotionKeyframesLength(w);X===0||X===0?E=0:E=this.locationMotion.getProgressVelocity(p)*X/K}var Q=r.effect==="instant"?0:this.calculateMovingDuration(i.duration,r.effect==="fly"?b:0),G={longitude:i.longitude,latitude:i.latitude,fov:i.fov},J=F(F({},e),{mode:this.mode,longitude:(s=G.longitude)!==null&&s!==void 0?s:this.camera.pose.longitude,latitude:(l=G.latitude)!==null&&l!==void 0?l:this.camera.pose.latitude,fov:(u=G.fov)!==null&&u!==void 0?u:this.camera.pose.fov,offset:r.position.clone(),distance:this.camera.pose.distance}),H=this.currentPano;if(this.emit("pano.moveTo",W("pano.moveTo",{options:i,prevPano:H,progress:0,state:J,userAction:this.userAction,error:null})),i.moveStartCallback&&i.moveStartCallback(J),this.videoTexture&&this.videoTexture.image instanceof HTMLVideoElement&&this.videoTexture.image.getAttribute("src")&&(this.videoTexture.image.pause(),this.videoTexture.image.removeAttribute("uuid"),this.videoTexture.image.removeAttribute("src"),this.videoTexture.image.oncanplay=z,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),r.effect==="fly")this.cameraMotion.set(G,Q).catch(z);else{var j=Ft({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),Z=Ft({longitude:(d=G.longitude)!==null&&d!==void 0?d:this.cameraMotion.value.longitude,latitude:(f=G.latitude)!==null&&f!==void 0?f:this.cameraMotion.value.latitude}),Y=new c.Object3D;Y.lookAt(j);var pe=new c.Matrix4().makeRotationFromQuaternion(Y.quaternion);Y.lookAt(Z);var ee=new c.Matrix4().makeRotationFromQuaternion(Y.quaternion),oe=new c.Matrix4().getInverse(pe).premultiply(ee),ie=this.cameraMotion.value.fov,ce=(A=G.fov)!==null&&A!==void 0?A:this.cameraMotion.value.fov,ne=1;r.effect==="zoomin"?ne=1.5:r.effect==="zoomout"&&(ne=.4);for(var ae=he(ce*ne,1,170),de=0;de<w.length-1;de++){var ve=w[de].key;if(ve){var xe=this.panoResources[ve];xe&&(xe.fixCameraTransform.copy(oe),xe.panoPicture&&(xe.panoPicture.zoom=Math.tan(ie/2/180*Math.PI)/Math.tan(ae/2/180*Math.PI)))}}this.cameraMotion.setKeyframes([{progress:0,value:{longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude,fov:this.cameraMotion.value.fov}},{progress:0,value:{longitude:(m=G.longitude)!==null&&m!==void 0?m:this.cameraMotion.value.longitude,latitude:(h=G.latitude)!==null&&h!==void 0?h:this.cameraMotion.value.latitude,fov:ae}},{progress:1,value:{longitude:(v=G.longitude)!==null&&v!==void 0?v:this.cameraMotion.value.longitude,latitude:(y=G.latitude)!==null&&y!==void 0?y:this.cameraMotion.value.latitude,fov:ce}}],Q).catch(z)}var Ce=this.locationMotion.setKeyframes(w,Q,E);Ce.then(function(){for(var Be,$,te=0,U=a.models;te<U.length;te++){var Le=U[te];Le.show()}var Pe=F(F({},e),{mode:a.mode,longitude:a.camera.pose.longitude,latitude:a.camera.pose.latitude,fov:a.camera.pose.fov,offset:a.camera.pose.offset.clone(),distance:a.camera.pose.distance});a.emit("pano.arrived",W("pano.arrived",{options:i,prevPano:H,progress:1,state:Pe,userAction:a.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(Pe);var Ie=a.works.getResolvedObserver(e);if(Ie&&Ie.video&&a.videoTexture&&a.videoTexture.image instanceof HTMLVideoElement){var Qe=Xh.clone().multiply(($=(Be=a.models.getMaterial().pano1)===null||Be===void 0?void 0:Be.matrix)!==null&&$!==void 0?$:new c.Matrix4).multiply(Ie.video.matrix),be={map:a.videoTexture,size:Ie.video.size,matrix:Qe,alpha:1},ye=wt(),ge=a.videoTexture.image;ge.setAttribute("uuid",ye),gu().then(function(me){me&&Ie.video&&ge.getAttribute("uuid")===ye&&(ge.oncanplay=function(){ge.oncanplay=z,ge.play()},ge.ontimeupdate=function(){ge.currentTime>.5&&(ge.ontimeupdate=z,a.panoVideo.setMaterial(be))},ge.src=Ie.video.source)}).catch(function(){ge.removeAttribute("uuid")})}},function(){a.emit("pano.cancel",W("pano.cancel",{options:i,prevPano:H,progress:0,state:J,userAction:a.userAction,error:null})),i.moveCancelCallback&&i.moveCancelCallback()})},t.prototype.getForwardObserverOrNot=function(e){var r=this,i=this.works.getResolvedObserver(this.currentPano);if(!i)return null;var a=e!=null?e:new c.Raycaster(this.camera.position.clone(),this.camera.getDirection(new c.Vector3));a.params.Points={threshold:.1};var o=i.standingPosition.clone();if(i.position.distanceTo(a.ray.origin)>1){var s=this.models.intersectRaycaster(new c.Raycaster(a.ray.origin,new c.Vector3(0,-1,0)))[0];s&&s.distance<=2?o.copy(s.point):o.copy(a.ray.origin).add(new c.Vector3(0,-1.5,0))}var l=this.models.intersectRaycaster(a)[0],u=l?l.point:a.ray.origin.clone().add(a.ray.direction.clone().normalize().multiplyScalar(3)),d=u.clone().sub(o).normalize();if(d.length()===0)return null;for(var f=i.accessibleIds.filter(function(w){if(w===Ue(r.currentPano))return!1;var E=r.works.getResolvedObserver(w);if(!E)return!1;var M=E.standingPosition.clone().project(r.camera);return Math.abs(M.z)>1||Math.abs(M.x)>1||Math.abs(M.y)>1?!1:E.loadable||E.active}),A=f.slice().sort(function(w,E){var M=r.works.getResolvedObserver(w).standingPosition.clone().distanceTo(o),C=r.works.getResolvedObserver(E).standingPosition.clone().distanceTo(o);return M-C}),m=0,h=[Math.PI/8,Math.PI/6,Math.PI/4,Math.PI/3];m<h.length;m++)for(var v=h[m],y=0,p=A;y<p.length;y++){var g=p[y],x=this.works.getResolvedObserver(g);if(x){var b=x.standingPosition.clone().sub(o);if(b&&b.length()!==0&&d.angleTo(b)<v)return x}}return null},t.prototype.onTapGesture=function(e){var r=this,i;if(this.userAction=e.userAction,this.stopMomentumMovement(),!!this.initAnimationed){if(!this.locationMotion.ended){var a=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]);if(a.panoId!==Ue(this.currentPano))return}var o=e.center.raycaster,s=this.camera.getDirection(new c.Vector3).setY(0),l=null,u=this.works.getResolvedObserver(this.currentPano);if(u){var d=u.accessibleIds.filter(function(K){if(K===Ue(r.currentPano))return!1;var Q=r.works.getResolvedObserver(K);return!Q||Q.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:Q.loadable||Q.active}),f=this.models.intersectRaycaster(o)[0];if(f){var A=ur(d,function(K){var Q=r.works.getResolvedObserver(K);if(!Q)return 1/0;var G=Q.standingPosition.clone();return G.distanceTo(f.point)},!0),m=A[0],h=A[1];m&&h<this.panoTapTriggerRadius&&(l=(i=this.works.getResolvedObserver(m))!==null&&i!==void 0?i:null)}l||(l=this.getForwardObserverOrNot(o));for(var v=0,y=this.locationMotion.keyframes;v<y.length;v++){var p=y[v],g=this.panoResourceFromLocationMotionKeyframe(p);if(!(p.progress<this.locationMotion.progress)&&l&&g.panoId===l.panoId){l=null;break}}if(!l)this.emit("gesture.tap",e),e.defaultPrevented||this.locationMotion.ended===!0&&this.cameraBounce();else{for(var x={},b=Math.PI/6,w=Math.PI/12,E=l.position.clone().setY(0).sub(u.position.clone().setY(0)).normalize(),M=[],C=[],P=[],S=0,T=l.accessibleIds;S<T.length;S++){var m=T[S],B=pt(m);if(!(_t(B,this.currentPano)||_t(B,l.pano))){var L=this.works.getResolvedObserver(m);if(L){var k=L.position.clone().sub(l.position).setY(0);E.angleTo(k)<b&&P.push(k)}}}var O=P.length>0?P:bt(bt([],M,!0),C,!0),D=O.slice().sort(function(K,Q){return K.angleTo(E)-Q.angleTo(E)})[0];D&&D.angleTo(s)>w&&(x.longitude=Math.atan2(-D.x,-D.z)),this.cameraMotion.value.latitude<-Math.PI/4&&(x.latitude=he(0,this.minLatitude,this.maxLatitude));var N=F({},e.state);if(N.workCode=l.pano.workCode,N.panoIndex=l.pano.panoIndex,x.longitude!==void 0&&(N.longitude=x.longitude),x.latitude!==void 0&&(N.latitude=x.latitude),x.fov!==void 0&&(N.fov=x.fov),N.distance=0,N.offset=l.position.clone(),e.state=N,this.emit("gesture.tap",e),!e.defaultPrevented){if(this.emit("pano.select",W("pano.select",{prevPano:this.currentPano,state:N,userAction:e.userAction,options:x,progress:0,error:null})),l&&!l.active){var X=l.panoId;this.panoMeshes[X]&&(this.panoMeshes[X].setDisabled(!1),this.panoMeshes[X].setLoading(!0))}l&&l.active&&this.emit("pano.request",W("pano.request",{userAction:e.userAction,prevPano:this.currentPano,progress:0,state:N,options:x,error:null}))}}}}},t}(mu),gr=Math.PI/180,bn=180/Math.PI,yu=.001,bu=1,Gn=function(){var n=typeof navigator!="undefined"&&/iPad|iPhone|iPod/.test(navigator.platform);return function(){return n}}(),_h=function(){var n=typeof navigator!="undefined"&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent);return function(){return n}}(),Zh=function(){var n=typeof navigator!="undefined"&&navigator.userAgent.indexOf("Firefox")!==-1&&navigator.userAgent.indexOf("Android")!==-1;return function(){return n}}(),xu=function(){var n=typeof navigator!="undefined"?navigator.userAgent.match(/.*Chrome\/([0-9]+)/):null,t=n?parseInt(n[1],10):null;return function(){return t}}(),Yh=function(){var n=!1;if(xu()===65){var t=typeof navigator!="undefined"?navigator.userAgent.match(/.*Chrome\/([0-9\.]*)/):null;if(t){var e=t[1].split(".");e[0],e[1];var r=e[2],i=e[3];n=parseInt(r,10)===3325&&parseInt(i,10)<148}}return function(){return n}}(),$h=function(){var n=Gn()&&_h()&&typeof navigator!="undefined"&&navigator.userAgent.indexOf("13_4")!==-1;return function(){return n}}(),wu=function(){var n=typeof navigator!="undefined"&&navigator.userAgent.indexOf("R7 Build")!==-1;return function(){return n}}();function ks(){var n=typeof window!="undefined"&&(window.orientation==90||window.orientation==-90);return wu()?!n:n}function ep(n){return!(isNaN(n)||n<=yu||n>bu)}function tp(n){if(n.w>1)return 0;var t=2*Math.acos(n.w);return t}var Fs=function(){var n={};return function(t,e){n[t]===void 0&&(console.warn("cardboard: "+e),n[t]=!0)}}();function Ls(n){var t,e=n.indexOf("://");e!==-1?t=e+3:t=0;var r=n.indexOf("/",t);return r===-1&&(r=n.length),n.substring(0,r)}function rp(){if(typeof window=="undefined"||typeof document=="undefined")return!1;var n=window.self!==window.top,t=Ls(document.referrer),e=Ls(window.location.href);return n&&t!==e}var Os=function(){function n(r,i,a){var o=i?i[0]:0,s=i?i[1]:0,l=i?i[2]:0,u=i?i[3]:1,d=o+o,f=s+s,A=l+l,m=o*d,h=o*f,v=o*A,y=s*f,p=s*A,g=l*A,x=u*d,b=u*f,w=u*A;return r[0]=1-(y+g),r[1]=h+w,r[2]=v-b,r[3]=0,r[4]=h-w,r[5]=1-(m+g),r[6]=p+x,r[7]=0,r[8]=v+b,r[9]=p-x,r[10]=1-(m+y),r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function t(r,i,a){var o=a[0],s=a[1],l=a[2],u,d,f,A,m,h,v,y,p,g,x,b;return i===r?(r[12]=i[0]*o+i[4]*s+i[8]*l+i[12],r[13]=i[1]*o+i[5]*s+i[9]*l+i[13],r[14]=i[2]*o+i[6]*s+i[10]*l+i[14],r[15]=i[3]*o+i[7]*s+i[11]*l+i[15]):(u=i[0],d=i[1],f=i[2],A=i[3],m=i[4],h=i[5],v=i[6],y=i[7],p=i[8],g=i[9],x=i[10],b=i[11],r[0]=u,r[1]=d,r[2]=f,r[3]=A,r[4]=m,r[5]=h,r[6]=v,r[7]=y,r[8]=p,r[9]=g,r[10]=x,r[11]=b,r[12]=u*o+m*s+p*l+i[12],r[13]=d*o+h*s+g*l+i[13],r[14]=f*o+v*s+x*l+i[14],r[15]=A*o+y*s+b*l+i[15]),r}function e(r,i){var a=i[0],o=i[1],s=i[2],l=i[3],u=i[4],d=i[5],f=i[6],A=i[7],m=i[8],h=i[9],v=i[10],y=i[11],p=i[12],g=i[13],x=i[14],b=i[15],w=a*d-o*u,E=a*f-s*u,M=a*A-l*u,C=o*f-s*d,P=o*A-l*d,S=s*A-l*f,T=m*g-h*p,B=m*x-v*p,L=m*b-y*p,k=h*x-v*g,O=h*b-y*g,D=v*b-y*x,N=w*D-E*O+M*k+C*L-P*B+S*T;return N?(N=1/N,r[0]=(d*D-f*O+A*k)*N,r[1]=(s*O-o*D-l*k)*N,r[2]=(g*S-x*P+b*C)*N,r[3]=(v*P-h*S-y*C)*N,r[4]=(f*L-u*D-A*B)*N,r[5]=(a*D-s*L+l*B)*N,r[6]=(x*M-p*S-b*E)*N,r[7]=(m*S-v*M+y*E)*N,r[8]=(u*O-d*L+A*T)*N,r[9]=(o*L-a*O-l*T)*N,r[10]=(p*P-g*M+b*w)*N,r[11]=(h*M-m*P-y*w)*N,r[12]=(d*B-u*k-f*T)*N,r[13]=(a*k-o*B+s*T)*N,r[14]=(g*E-p*C-x*w)*N,r[15]=(m*C-h*E+v*w)*N,r):null}return function(r,i,a){n(r,i),a&&t(r,r,a),e(r,r)}}(),ha=function(){function n(t,e){t===void 0&&(t=new c.Vector3),e===void 0&&(e=0),this.sample=t,this.timestampS=e}return n.prototype.set=function(t,e){this.sample=t,this.timestampS=e},n.prototype.copy=function(t){this.set(t.sample,t.timestampS)},n}(),np=function(){function n(t,e){this.kFilter=t,this.isDebug=e,this.currentAccelMeasurement=new ha,this.currentGyroMeasurement=new ha,this.previousGyroMeasurement=new ha,Gn()?this.filterQ=new c.Quaternion(-1,0,0,1):this.filterQ=new c.Quaternion(1,0,0,1),this.previousFilterQ=new c.Quaternion,this.previousFilterQ.copy(this.filterQ),this.accelQ=new c.Quaternion,this.isOrientationInitialized=!1,this.estimatedGravity=new c.Vector3,this.measuredGravity=new c.Vector3,this.gyroIntegralQ=new c.Quaternion}return n.prototype.addAccelMeasurement=function(t,e){this.currentAccelMeasurement.set(t,e)},n.prototype.addGyroMeasurement=function(t,e){this.currentGyroMeasurement.set(t,e);var r=e-this.previousGyroMeasurement.timestampS;ep(r)&&this.run_(),this.previousGyroMeasurement.copy(this.currentGyroMeasurement)},n.prototype.getOrientation=function(){return this.filterQ},n.prototype.run_=function(){if(!this.isOrientationInitialized){this.accelQ=this.accelToQuaternion_(this.currentAccelMeasurement.sample),this.previousFilterQ.copy(this.accelQ),this.isOrientationInitialized=!0;return}var t=this.currentGyroMeasurement.timestampS-this.previousGyroMeasurement.timestampS,e=this.gyroToQuaternionDelta_(this.currentGyroMeasurement.sample,t);this.gyroIntegralQ.multiply(e),this.filterQ.copy(this.previousFilterQ),this.filterQ.multiply(e);var r=new c.Quaternion;r.copy(this.filterQ),r.inverse(),this.estimatedGravity.set(0,0,-1),this.estimatedGravity.applyQuaternion(r),this.estimatedGravity.normalize(),this.measuredGravity.copy(this.currentAccelMeasurement.sample),this.measuredGravity.normalize();var i=new c.Quaternion;i.setFromUnitVectors(this.estimatedGravity,this.measuredGravity),i.inverse(),this.isDebug&&console.log("Delta: %d deg, G_est: (%s, %s, %s), G_meas: (%s, %s, %s)",bn*tp(i),this.estimatedGravity.x.toFixed(1),this.estimatedGravity.y.toFixed(1),this.estimatedGravity.z.toFixed(1),this.measuredGravity.x.toFixed(1),this.measuredGravity.y.toFixed(1),this.measuredGravity.z.toFixed(1));var a=new c.Quaternion;a.copy(this.filterQ),a.multiply(i),this.filterQ.slerp(a,1-this.kFilter),this.previousFilterQ.copy(this.filterQ)},n.prototype.accelToQuaternion_=function(t){var e=new c.Vector3;e.copy(t),e.normalize();var r=new c.Quaternion;return r.setFromUnitVectors(new c.Vector3(0,0,-1),e),r.inverse(),r},n.prototype.gyroToQuaternionDelta_=function(t,e){var r=new c.Quaternion,i=new c.Vector3;return i.copy(t),i.normalize(),r.setFromAxisAngle(i,t.length()*e),r},n}(),ip=function(){function n(t,e){this.predictionTimeS=t,this.isDebug=e,this.previousQ=new c.Quaternion,this.previousTimestampS=null,this.deltaQ=new c.Quaternion,this.outQ=new c.Quaternion}return n.prototype.getPrediction=function(t,e,r){if(!this.previousTimestampS)return this.previousQ.copy(t),this.previousTimestampS=r,t;var i=new c.Vector3;i.copy(e),i.normalize();var a=e.length();if(a<gr*20)return this.isDebug&&console.log("Moving slowly, at %s deg/s: no prediction",(bn*a).toFixed(1)),this.outQ.copy(t),this.previousQ.copy(t),this.outQ;var o=a*this.predictionTimeS;return this.deltaQ.setFromAxisAngle(i,o),this.outQ.copy(this.previousQ),this.outQ.multiply(this.deltaQ),this.previousQ.copy(t),this.previousTimestampS=r,this.outQ},n}(),ap=function(){function n(t){this.coefficients=t}return n.prototype.distortInverse=function(t){for(var e=0,r=1,i=t-this.distort(e);Math.abs(r-e)>1e-4;){var a=t-this.distort(r),o=r-a*((r-e)/(a-i));e=r,r=o,i=a}return r},n.prototype.distort=function(t){for(var e=t*t,r=0,i=0;i<this.coefficients.length;i++)r=e*(r+this.coefficients[i]);return(r+1)*t},n}(),op=function(){function n(){this.angularAcceleration=null,this.angularVelocity=null,this.linearAcceleration=null,this.linearVelocity=null,this.orientation=null,this.position=null}return n}(),Vs=function(){function n(){this.leftDegrees=0,this.rightDegrees=0,this.upDegrees=0,this.downDegrees=0}return n}(),sp=function(){function n(t,e,r,i){this.viewer={id:"CardboardV1",label:"Cardboard I/O 2014",fov:40,interLensDistance:.06,baselineLensDistance:.035,screenLensDistance:.042,distortionCoefficients:[.441,.156],inverseCoefficients:[-.4410035,.42756155,-.4804439,.5460139,-.58821183,.5733938,-.48303202,.33299083,-.17573841,.0651772,-.01488963,.001559834]},this.device={widthMeters:.11,heightMeters:.062,bevelMeters:.004},this.depthNear=.01,this.depthFar=1e4,this.yawOnly=r,this.accelerometer=new c.Vector3,this.gyroscope=new c.Vector3,this.filter=new np(t,i),this.posePredictor=new ip(e,i),this.isFirefoxAndroid=Zh(),this.isIOS=Gn();var a=xu();this.isDeviceMotionInRadians=!this.isIOS&&a!==null&&a<66,this.isWithoutDeviceMotion=Yh()||$h(),this.filterToWorldQ=new c.Quaternion,Gn()?this.filterToWorldQ.setFromAxisAngle(new c.Vector3(1,0,0),Math.PI/2):this.filterToWorldQ.setFromAxisAngle(new c.Vector3(1,0,0),-Math.PI/2),this.inverseWorldToScreenQ=new c.Quaternion,this.worldToScreenQ=new c.Quaternion,this.originalPoseAdjustQ=new c.Quaternion;var o=typeof window!="undefined"?-window.orientation*Math.PI/180:0;this.originalPoseAdjustQ.setFromAxisAngle(new c.Vector3(0,0,1),o),this.setScreenTransform_(),ks()&&this.filterToWorldQ.multiply(this.inverseWorldToScreenQ),this.resetQ=new c.Quaternion,this.orientationOut_=new Float32Array(4),this.previousTimestampS=Date.now()}return n.prototype.getPosition=function(){return null},n.prototype.getOrientation=function(){var t;if(this.isWithoutDeviceMotion&&this._deviceOrientationQ){this.deviceOrientationFixQ=this.deviceOrientationFixQ||function(){var a=new c.Quaternion().setFromAxisAngle(new c.Vector3(0,0,-1),0),o=new c.Quaternion;return typeof window!="undefined"&&window.orientation===-90?o.setFromAxisAngle(new c.Vector3(0,1,0),Math.PI/-2):o.setFromAxisAngle(new c.Vector3(0,1,0),Math.PI/2),a.multiply(o)}(),this.deviceOrientationFilterToWorldQ=this.deviceOrientationFilterToWorldQ||function(){var a=new c.Quaternion;return a.setFromAxisAngle(new c.Vector3(1,0,0),-Math.PI/2),a}(),t=this._deviceOrientationQ;var e=new c.Quaternion;return e.copy(t),e.multiply(this.deviceOrientationFilterToWorldQ),e.multiply(this.resetQ),e.multiply(this.worldToScreenQ),e.multiplyQuaternions(this.deviceOrientationFixQ,e),this.yawOnly&&(e.x=0,e.z=0,e.normalize()),this.orientationOut_[0]=e.x,this.orientationOut_[1]=e.y,this.orientationOut_[2]=e.z,this.orientationOut_[3]=e.w,this.orientationOut_}else{var r=this.filter.getOrientation();t=this.posePredictor.getPrediction(r,this.gyroscope,this.previousTimestampS)}var i=new c.Quaternion;return i.copy(this.filterToWorldQ),i.multiply(this.resetQ),i.multiply(t),i.multiply(this.worldToScreenQ),this.yawOnly&&(i.x=0,i.z=0,i.normalize()),this.orientationOut_[0]=i.x,this.orientationOut_[1]=i.y,this.orientationOut_[2]=i.z,this.orientationOut_[3]=i.w,this.orientationOut_},n.prototype.getPose=function(){var t=new op;return t.orientation=this.getOrientation(),t},n.prototype.resetPose=function(){this.resetQ.copy(this.filter.getOrientation()),this.resetQ.x=0,this.resetQ.y=0,this.resetQ.z*=-1,this.resetQ.normalize(),ks()&&this.resetQ.multiply(this.inverseWorldToScreenQ),this.resetQ.multiply(this.originalPoseAdjustQ)},n.prototype.getFrameData=function(t){var e=this.getOrientation(),r=this.getEyeOffset(),i=this.getEyeProjectionMatrix();return t.pose.angularAcceleration=null,t.pose.angularVelocity=null,t.pose.linearAcceleration=null,t.pose.linearVelocity=null,t.pose.orientation=e,t.pose.position=null,t.timestamp=this.previousTimestampS,t.leftProjectionMatrix.set(i.left),t.rightProjectionMatrix.set(i.right),Os(t.leftViewMatrix,e,r.left),Os(t.rightViewMatrix,e,r.right),t},n.prototype.start=function(){if(typeof window=="undefined")return function(){};var t=this.onDeviceMotion_.bind(this),e=this.onOrientationChange_.bind(this),r=this.onMessage_.bind(this),i=this.onDeviceOrientation_.bind(this);return Gn()&&rp()&&window.addEventListener("message",r),window.addEventListener("orientationchange",e),this.isWithoutDeviceMotion?window.addEventListener("deviceorientation",i):window.addEventListener("devicemotion",t),function(){window.removeEventListener("devicemotion",t),window.removeEventListener("deviceorientation",e),window.removeEventListener("orientationchange",e),window.removeEventListener("message",r)}},n.prototype.getEyeOffset=function(){return{left:[-this.viewer.interLensDistance*.5,0,0],right:[this.viewer.interLensDistance*.5,0,0]}},n.prototype.getEyeProjectionMatrix=function(){var t=this.getEyeFieldOfView(),e=this.depthNear,r=this.depthFar,i={left:[],right:[]};{var a=t.left.upDegrees*gr,o=t.left.downDegrees*gr,s=t.left.leftDegrees*gr,l=t.left.rightDegrees*gr,u=2/(s+l),d=2/(a+o);i.left[0]=u,i.left[1]=0,i.left[2]=0,i.left[3]=0,i.left[4]=0,i.left[5]=d,i.left[6]=0,i.left[7]=0,i.left[8]=-((s-l)*u*.5),i.left[9]=(a-o)*d*.5,i.left[10]=r/(e-r),i.left[11]=-1,i.left[12]=0,i.left[13]=0,i.left[14]=r*e/(e-r),i.left[15]=0}{var a=t.right.upDegrees*gr,o=t.right.downDegrees*gr,s=t.right.leftDegrees*gr,l=t.right.rightDegrees*gr,u=2/(s+l),d=2/(a+o);i.right[0]=u,i.right[1]=0,i.right[2]=0,i.right[3]=0,i.right[4]=0,i.right[5]=d,i.right[6]=0,i.right[7]=0,i.right[8]=-((s-l)*u*.5),i.right[9]=(a-o)*d*.5,i.right[10]=r/(e-r),i.right[11]=-1,i.right[12]=0,i.right[13]=0,i.right[14]=r*e/(e-r),i.right[15]=0}return i},n.prototype.getEyeFieldOfView=function(){var t=this.viewer,e=this.device,r=new ap(t.distortionCoefficients),i=t.screenLensDistance,a=(e.widthMeters-t.interLensDistance)/2,o=t.interLensDistance/2,s=t.baselineLensDistance-e.bevelMeters,l=e.heightMeters-s,u=bn*Math.atan(r.distort(a/i)),d=bn*Math.atan(r.distort(o/i)),f=bn*Math.atan(r.distort(s/i)),A=bn*Math.atan(r.distort(l/i)),m=new Vs,h=new Vs;return m.leftDegrees=Math.min(u,t.fov),m.rightDegrees=Math.min(d,t.fov),m.downDegrees=Math.min(f,t.fov),m.upDegrees=Math.min(A,t.fov),h.leftDegrees=m.rightDegrees,h.rightDegrees=m.leftDegrees,h.upDegrees=m.upDegrees,h.downDegrees=m.downDegrees,{left:m,right:h}},n.prototype.onDeviceOrientation_=function(t){this._deviceOrientationQ=this._deviceOrientationQ||new c.Quaternion;var e=t.alpha,r=t.beta,i=t.gamma;e=(e||0)*Math.PI/180,r=(r||0)*Math.PI/180,i=(i||0)*Math.PI/180,this._deviceOrientationQ.setFromEuler(new c.Euler(e,r,-i,"YXZ"))},n.prototype.onDeviceMotion_=function(t){this.updateDeviceMotion_(t)},n.prototype.updateDeviceMotion_=function(t){var e=t.accelerationIncludingGravity,r=t.rotationRate,i=t.timeStamp/1e3,a=i-this.previousTimestampS;if(a<0){Fs("fusion-pose-sensor:invalid:non-monotonic","Invalid timestamps detected: non-monotonic timestamp from devicemotion"),this.previousTimestampS=i;return}else if(a<=yu||a>bu){Fs("fusion-pose-sensor:invalid:outside-threshold","Invalid timestamps detected: Timestamp from devicemotion outside expected range."),this.previousTimestampS=i;return}e&&(this.accelerometer.set(-e.x,-e.y,-e.z),r&&(wu()?this.gyroscope.set(-r.beta,r.alpha,r.gamma):this.gyroscope.set(r.alpha,r.beta,r.gamma),this.isDeviceMotionInRadians||this.gyroscope.multiplyScalar(Math.PI/180),this.filter.addGyroMeasurement(this.gyroscope,i)),this.filter.addAccelMeasurement(this.accelerometer,i)),this.previousTimestampS=i},n.prototype.onOrientationChange_=function(){this.setScreenTransform_()},n.prototype.onMessage_=function(t){var e=t.data;if(!(!e||!e.type)){var r=e.type.toLowerCase();r==="devicemotion"&&this.updateDeviceMotion_(e.deviceMotionEvent)}},n.prototype.setScreenTransform_=function(){this.worldToScreenQ.set(0,0,0,1);var t=typeof window!="undefined"?window.orientation:0;switch(t){case 0:break;case 90:this.worldToScreenQ.setFromAxisAngle(new c.Vector3(0,0,1),-Math.PI/2);break;case-90:this.worldToScreenQ.setFromAxisAngle(new c.Vector3(0,0,1),Math.PI/2);break}this.inverseWorldToScreenQ.copy(this.worldToScreenQ),this.inverseWorldToScreenQ.inverse()},n}(),si=[0,0,.5,1],ui=[.5,0,.5,1],up=function(){function n(t){var e=this;this.renderer=t,this.sensor=new sp(.98,.04,!1,!1),this.scale=1,this.cameraL=new c.PerspectiveCamera,this.cameraR=new c.PerspectiveCamera;var r=this.sensor.start();this.dispose=function(){var i=e.renderer.getSize(new c.Vector2);e.renderer.setScissor(0,0,i.width,i.height),e.renderer.setViewport(0,0,i.width,i.height),e.renderer.setScissorTest(!1),r()}}return n.prototype.render=function(t,e){var r=this.renderer.getSize(new c.Vector2);if(r.width>r.height){var i=t.autoUpdate;i&&(t.updateMatrixWorld(),t.autoUpdate=!1);var a={x:Math.round(r.width*si[0]),y:Math.round(r.height*si[1]),width:Math.round(r.width*si[2]),height:Math.round(r.height*si[3])},o={x:Math.round(r.width*ui[0]),y:Math.round(r.height*ui[1]),width:Math.round(r.width*ui[2]),height:Math.round(r.height*ui[3])};this.renderer.setScissorTest(!0),this.renderer.autoClear&&this.renderer.clear(),e.parent===null&&e.updateMatrixWorld(),e.matrixWorld.decompose(this.cameraL.position,this.cameraL.quaternion,this.cameraL.scale),e.matrixWorld.decompose(this.cameraR.position,this.cameraR.quaternion,this.cameraR.scale);var s=this.sensor.getEyeOffset();this.cameraL.translateOnAxis(new c.Vector3().fromArray(s.left),this.scale),this.cameraR.translateOnAxis(new c.Vector3().fromArray(s.right),this.scale);var l=this.sensor.getEyeProjectionMatrix();this.cameraL.projectionMatrix.elements=l.left.slice(),this.cameraR.projectionMatrix.elements=l.right.slice(),this.renderer.setViewport(a.x,a.y,a.width,a.height),this.renderer.setScissor(a.x,a.y,a.width,a.height),this.renderer.render(t,this.cameraL),this.renderer.setViewport(o.x,o.y,o.width,o.height),this.renderer.setScissor(o.x,o.y,o.width,o.height),this.renderer.render(t,this.cameraR),this.renderer.setViewport(0,0,r.width,r.height),this.renderer.setScissor(0,0,r.width,r.height),this.renderer.setScissorTest(!1),i&&(t.autoUpdate=!0)}else this.renderer.render(t,e)},n.prototype.dispose=function(){},n}();const lp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAADqCAMAAAAvZYhaAAAC/VBMVEUAAAD///99fX37+/v5+fn29vbx8fHv7+/Nzc3o6Ojq6urh4eHU1NTR0dG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ytukQQND8FSlFIOreGM0/omiATVapVo12xd0jhExKW5294RAc40RVoftY47cd2LKtMOFwkajzuAeVOlIhfJeKahLyiWJRhLr3Ai2BVzQYKG4lLYXfg8HCSI33a2nTH5OaVWmzYHJGhsdLmDuN2exAonBTzZIuzEUS+ec0ZMBQn+Ea5KlXNI4C/UAO/k6hKwBptJgn8fgmVckgFXML9YEEFLUKMvlqAp0eWyDEAL65dLqyWo6RekTZ2XNCsD6rgpTK/4p3WcrrPH1ghWJGhONC3JoGAkRHH1JKjpNEcCxOV2I8MWyiUJqNVajSVodgiWcVMVLVeSS1ATCZoc88qjVKlSc3kSLJ5c5V6rTZQAcVkGbBeuOkgCgq2CBM3MoFwGr1tvim2aMpZZqyBBc3N1UF2GX90j9SQJKCBB83OfYAcNVjFcSrvzo95WOShB83Ody5V24fqzO0nAUSzB/89Nph38VqmuOa3gticJOP9fApuHTDt4nFJ7AXdPC0lg8/gq8y5XapSrgpUgbQ0JpF5u97hS1fOC26nlJJA8Yd41Sg3fU4dtRQkKeXSN3jo4Qqm0397OmyZOGatoDrScBIWM3DFn5kXi1ZyqRSUoZtKOa1vWKArztqgEnhIHty4f9/btuEstKwGkxf+XuCT5CbTFnFRuxktuAAAAAElFTkSuQmCC";var pa,va={zh:{TITLE:"眼镜模式",HIT:"请将手机横屏放入 VR 眼镜中"},en:{TITLE:"GLASSES MODE",HIT:"Please put the mobile phone horizontally into the VR glasses."},ja:{TITLE:"メガネモード",HIT:"携帯電話をVRメガネに水平に入れてください。"}},Ns=typeof navigator!="undefined"&&(pa=va[navigator.language.split("-")[0]])!==null&&pa!==void 0?pa:va.zh,dp=`
|
|
1488
|
+
`,Xh=function(){function n(){this.material=new c.ShaderMaterial({vertexShader:Jh,fragmentShader:Wh,uniforms:{size:new c.Uniform(null),matrix:new c.Uniform(null),alpha:new c.Uniform(null),map:new c.Uniform(null)},depthTest:!1,depthWrite:!1,defines:{USE_PANO_VIDEO:!1},blending:c.CustomBlending,blendSrc:c.SrcAlphaFactor,blendDst:c.OneMinusSrcAlphaFactor,blendSrcAlpha:c.OneFactor,blendDstAlpha:c.OneMinusSrcAlphaFactor}),this.object=new c.Mesh(Ao,this.material),this.object.visible=!1,this.object.renderOrder=-1,this.object.frustumCulled=!1,this.object.name="pano-video",this.alphaMotion=new Se({alpha:0})}return n.prototype.setMaterial=function(t){t?(this.material.uniforms.size.value=t.size,this.material.uniforms.matrix.value=t.matrix,this.material.uniforms.map.value=t.map,this.alphaMotion.set({alpha:t.alpha},500).catch(z),this.material.uniforms.alpha.value=t.alpha):(this.material.uniforms.size.value=null,this.material.uniforms.matrix.value=null,this.material.uniforms.map.value=null,this.alphaMotion.set({alpha:0},0).catch(z));var e=t!==null,r=this.material.defines.USE_PANO_VIDEO;e!==r&&(this.material.defines.USE_PANO_VIDEO=e,this.material.needsUpdate=!0,this.object.visible=t!==null)},n.prototype.updateTime=function(t){this.alphaMotion.ended||(this.alphaMotion.update(t),this.material.uniforms.alpha.value=this.alphaMotion.value.alpha)},n.prototype.dispose=function(){this.material.dispose()},n}(),_h=new c.Matrix4().makeRotationAxis(new c.Vector3(0,1,0),Math.PI),Rs=new c.Vector3(-1,1,1),ks=function(){function n(t){t===void 0&&(t=0),this.width=t,this.pool=[]}return Object.defineProperty(n.prototype,"size",{get:function(){return this.pool.length},enumerable:!1,configurable:!0}),n.prototype.create=function(){return new c.WebGLCubeRenderTarget(this.width,{stencilBuffer:!1,depthBuffer:!1})},n.prototype.pop=function(){var t=this.pool.pop();return t||this.create()},n.prototype.push=function(t){this.pool.indexOf(t)===-1&&this.pool.push(t)},n.prototype.clear=function(){for(var t=0,e=this.pool;t<e.length;t++){var r=e[t];r.dispose()}this.pool.length=0},n}(),mo=function(n){ue(t,n);function t(e){var r=this,i,a,o,s,l=t.parseArgs(e);r=n.call(this,l)||this,r.TILED_CUBE_TEXTURE_LEVEL=2,r.mode="Panorama",r.tileLevel=0,r.initAnimationed=!1,r.maxAccessibleDistance=l.maxAccessibleDistance,r.panoTapTriggerRadius=l.panoTapTriggerRadius,r.panoCircleMeshCreator=l.panoCircleMeshCreator,r.tileLevelForFov=l.tileLevelForFov,r.tileMaxRequest=l.tileMaxRequest,r.luminanceAdaptiveEffectEnable=l.luminanceAdaptiveEffectEnable,r.luminanceAdaptiveEffect=new Ps(r.renderer,r.modelScene,r.camera,r.models),r.colorCubeRenderTargetPool=new ks,r.luminanceCubeRenderTargetPool=new ks;var u=r.models.getMaterial()||{},d=u.pano0,f=u.pano1;d&&(f==null?void 0:f.map)!==d.map&&(r.models.setMaterial({pano0:f}),d.map.dispose(),d.map instanceof De&&d.map.cubeRenderTarget&&r.colorCubeRenderTargetPool.push(d.map.cubeRenderTarget),d.luminanceMap&&(d.luminanceMap.dispose(),d.luminanceMap instanceof De&&d.luminanceMap.cubeRenderTarget&&r.luminanceCubeRenderTargetPool.push(d.luminanceMap.cubeRenderTarget)));for(var A=r.colorCubeRenderTargetPool.size;A<2;A++){var m=Math.max(1024*r.TILED_CUBE_TEXTURE_LEVEL,512),h=r.colorCubeRenderTargetPool.create();h.setSize(m,m),Sa(null,h,r.renderer),r.colorCubeRenderTargetPool.push(h)}r.panoMeshes={},r.updatePanoMeshes(),r.locationMotion=new Se({count:0,distance:r.camera.pose.distance}),r.modelAlphaMotion=new Se({modelAlpha:(a=(i=r.models.getMaterial())===null||i===void 0?void 0:i.modelAlpha)!==null&&a!==void 0?a:0}),r.perspToOrthoMotion=new Se({perspToOrtho:r.camera.perspToOrtho.x}),r.panoResources={},r.panoResources[r.locationMotion.keyframes[0].key=r.locationMotion.keyframes[1].key=wt()]={panoId:Ue(r.currentPano),panoPicture:(s=(o=r.models.getMaterial())===null||o===void 0?void 0:o.pano1)!==null&&s!==void 0?s:null,position:r.camera.pose.offset.clone(),effect:"fly",fixCameraTransform:new c.Matrix4};var v=r.works.getResolvedObserver(r.currentPano);return r.textureLoader=new _n,r.tiling=new Gh(v?it(v.work):yi,r.TILED_CUBE_TEXTURE_LEVEL+1,r.imageOptions),r.scene.add(r.tiling.object),r.panoVideo=new Xh,r.scene.add(r.panoVideo.object),r}return t.parseArgs=function(e){var r,i,a,o,s,l;if(e instanceof t)return e;var u=n.parseArgs.call(this,e);return F(F({},u),{maxAccessibleDistance:(r=e.maxAccessibleDistance)!==null&&r!==void 0?r:5,panoTapTriggerRadius:(i=e.panoTapTriggerRadius)!==null&&i!==void 0?i:.5,panoCircleMeshCreator:(a=e.panoCircleMeshCreator)!==null&&a!==void 0?a:function(d){return new fu},tileLevelForFov:(o=e.tileLevelForFov)!==null&&o!==void 0?o:function(d,f){var A=function(p){return p/Math.PI*180},m=function(p){return p/180*Math.PI},h=f.height/2/Math.tan(m(d/2)),v=f.width>f.height?d:A(Math.atan(Math.tan(m(d/2))*(f.width/f.height))*2);v*=.9;var y=h*(Math.tan(m(v/2))-Math.tan(m(v/2-1)));return y>80?5:y>60?4:y>30?3:y>18?2:y>12?1:0},tileMaxRequest:(s=e.tileMaxRequest)!==null&&s!==void 0?s:3,luminanceAdaptiveEffectEnable:(l=e.luminanceAdaptiveEffectEnable)!==null&&l!==void 0?l:!0})},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return F(F({},i),{mode:"Panorama"})},t.prototype.destroy=function(){var e,r;if(n.prototype.destroy.call(this),this.scene.remove(this.tiling.object),this.tiling.dispose(),this.locationMotion.dispose(),this.colorCubeRenderTargetPool.clear(),this.luminanceCubeRenderTargetPool.clear(),delete this.pendingTextureTask,this.panoMeshes)for(var i=Object.keys(this.panoMeshes),a=0,o=i;a<o.length;a++){var s=o[a],l=this.panoMeshes[s];this.helper.remove(l),l.dispose(),delete this.panoMeshes[s]}var u=this.videoTexture.image;u.pause(),u.oncanplay=function(){},u.ontimeupdate=function(){},this.scene.remove(this.panoVideo.object),this.panoVideo.setMaterial(null),this.panoVideo.dispose();for(var d=(e=this.models.getMaterial())!==null&&e!==void 0?e:{},f=d.pano0,A=d.pano1,m=0,h=Object.keys(this.panoResources);m<h.length;m++){var v=h[m],y=this.panoResources[v];if(y.panoPicture){var p=y.panoPicture.map;p&&p!==(f==null?void 0:f.map)&&p!==(A==null?void 0:A.map)&&(p.dispose(),(r=y.panoPicture.luminanceMap)===null||r===void 0||r.dispose(),y.panoPicture=null)}delete this.panoResources[v]}this.luminanceAdaptiveEffect.dispose()},t.prototype.isReady=function(){return this.locationMotion.ended!==!0?!1:n.prototype.isReady.call(this)},t.prototype.isTileReady=function(){var e,r,i,a=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),o=((e=a.panoPicture)===null||e===void 0?void 0:e.map)instanceof De&&(i=(r=a.panoPicture)===null||r===void 0?void 0:r.map.tilePending)!==null&&i!==void 0?i:0,s=this.tiling.pedding;return this.initAnimationed&&o<=0&&s<=0},t.prototype.updateWork=function(e,r,i,a){var o=this;this.userAction=a,this.works=e;var s=t.initAnimationEndState(F(F({},this),{initial:{currentState:F(F({},this.currentPano),this.camera.pose),duration:i.duration,effect:i.effect,state:r,userAction:a}})),l={workCode:s.workCode,panoIndex:s.panoIndex},u=this.works.getWork(l.workCode);return this.tiling.setFetcher(u?it(u):yi),this.tiling.cleanup(),this.initAnimationed=!1,this.hideIntersectMesh(),this.updatePanoMeshes(),this.moveToPano(l,{effect:i.effect,duration:i.duration,longitude:r.longitude,latitude:r.latitude,fov:r.fov,moveEndCallback:function(){o.initAnimationed=!0},moveCancelCallback:function(){o.initAnimationed=!0}},a),!0},t.prototype.updateModel=function(e){this.models=e,this.updatePanoMeshes()},t.prototype.updateTime=function(e,r){var i=this,a,o,s,l,u,d,f,A,m,h;if(!this.destroyed){var v={},y={},p=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),g=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),x=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),y.longitude=this.cameraMotion.value.longitude,y.latitude=this.cameraMotion.value.latitude,y.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),v.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(he(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var b=this.locationMotion.getKeyFrameSegment(e),w=b[0],E=b[1],M=this.panoResourceFromLocationMotionKeyframe(w),C=this.panoResourceFromLocationMotionKeyframe(E),P=new c.Vector3().copy(M.position),S=new c.Vector3().copy(C.position),T=this.locationMotion.value.count-E.value.count+1;v.progress=T,C.panoPicture&&(T<1?M.panoPicture&&(v.pano0=M.panoPicture):v.pano0=C.panoPicture,v.pano1=C.panoPicture),C.effect==="montage"?v.transition="BLACK":C.effect==="spread"?v.transition="SPREAD":v.transition="FADE",(C.effect==="zoomin"||C.effect==="zoomout")&&(v.progress=Math.pow(T,3)),T<1&&C.effect!=="fly"&&(v.pano0&&M.panoPicture&&(v.pano0={map:v.pano0.map,zoom:v.pano0.zoom,luminanceMap:v.pano0.luminanceMap,matrix:M.panoPicture.matrix.clone().premultiply(M.fixCameraTransform).setPosition(C.position)}),P.copy(S),x=!0),y.distance=this.locationMotion.value.distance,y.offset=new c.Vector3(P.x+(S.x-P.x)*T,P.y+(S.y-P.y)*T,P.z+(S.z-P.z)*T);for(var B=[],L=[],k=0,O=this.locationMotion.keyframes;k<O.length;k++){var D=O[k],N=D.key,X=D.progress;N!==void 0&&(B.push(N),X>this.locationMotion.progress&&L.push(N))}for(var K=0,Q=Object.keys(this.panoResources);K<Q.length;K++){var G=Q[K];if(!(L.indexOf(G)>=0)){var J=this.panoResources[G];if(J.panoPicture){var H=J.panoPicture.map,j=J.panoPicture.luminanceMap;if(H){if(H===((a=v.pano0)===null||a===void 0?void 0:a.map)||H===((o=v.pano1)===null||o===void 0?void 0:o.map))continue;H instanceof De&&H.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(H.cubeRenderTarget),H.dispose(),j&&(j instanceof De&&j.cubeRenderTarget&&this.luminanceCubeRenderTargetPool.push(j.cubeRenderTarget),j.dispose()),J.panoPicture=null}}B.indexOf(G)>=0||delete this.panoResources[G]}}this.currentPano=pt(C.panoId),this.emit("pano.moving",W("pano.moving",{userAction:this.userAction,prevPano:pt(p.panoId),state:F(F(F(F({},pt(g.panoId)),{mode:this.mode}),_e(this.camera.pose)),y),options:{},progress:this.locationMotion.progress,error:null}))}Nt(v)===!1&&(!((s=v.pano0)===null||s===void 0)&&s.map&&v.pano0.map instanceof De&&!v.pano0.map.cubeRenderTarget&&(v.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((l=v.pano0)===null||l===void 0)&&l.luminanceMap&&v.pano0.luminanceMap instanceof De&&!v.pano0.luminanceMap.cubeRenderTarget&&(v.pano0.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),!((u=v.pano1)===null||u===void 0)&&u.map&&v.pano1.map instanceof De&&!v.pano1.map.cubeRenderTarget&&(v.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((d=v.pano1)===null||d===void 0)&&d.luminanceMap&&v.pano1.luminanceMap instanceof De&&!v.pano1.luminanceMap.cubeRenderTarget&&(v.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.models.setMaterial(v)),Nt(y)===!1&&this.setCamera(y);var Z=this.works.getResolvedObserver(this.currentPano),Y=this.locationMotion.ended?this.getForwardObserverOrNot():null;if(this.camera.pose.distance>.1||x)for(var pe=0,ee=Object.keys(this.panoMeshes);pe<ee.length;pe++){var oe=ee[pe],ie=this.panoMeshes[oe];ie.setOpacity(0),ie.setCurrent(!1),ie.updateTime&&ie.updateTime(e,r),ie.visible=!1}else if(Z){var ce=ur(Z.visibleIds,function(ye){var ge=i.works.getResolvedObserver(ye);return ge?Z.standingPosition.distanceTo(ge.standingPosition):1/0},!0),ne=ce[1];ne=he(ne,2.5,1/0);for(var ae=Z.visibleIds.concat(Ue(this.currentPano)),de=this.camera.getDirection(new c.Vector3),ve=0,xe=Object.keys(this.panoMeshes);ve<xe.length;ve++){var oe=xe[ve],ie=this.panoMeshes[oe],Ce=this.works.getResolvedObserver(oe);if(ae.indexOf(oe)===-1)ie.setCurrent(!1),ie.setOpacity(0);else if(!Ce)ie.setCurrent(!1),ie.setOpacity(0);else if(!Ce.loadable&&!Ce.active)ie.setCurrent(!1),ie.setOpacity(0);else{var Be=ie.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);ie.setCurrent(!ie.loading&&ie.progress===0&&Y!==null&&Y.panoId===oe),ie.setOpacity(Be<.01?0:he(ne/Be*1.2,.4,.85));var $=this.camera.position.clone().setY(ie.position.y),te=new c.Vector3().copy(ie.position).sub($).normalize();if(oe===Ue(this.currentPano)){var U=he((.5-$.distanceTo(ie.position))/.5,0,1);te.multiplyScalar(1-U).add(de.clone().multiplyScalar(U))}te.length()>0&&ie.quaternion.setFromEuler(new c.Euler(0,Math.atan2(te.x,te.z),0))}ie.updateTime&&ie.updateTime(e,r)}}var Le=this.tileLevel=function(){if(i.tileLevelForFov===!1)return 0;var ye=i.renderer.getDrawingBufferSize(new c.Vector2);ye.width*=i.scissor.width,ye.height*=i.scissor.height;var ge=g.panoId,me=i.works.getResolvedObserver(ge),Ae=i.imageOptions.size;if(typeof Ae=="undefined"&&me){var Ne=me.images.up.match(/\/cube_(\d+)\//);Ne&&(Ae=Number(Ne[1]))}typeof Ae=="undefined"&&(Ae=2048);var ze=0;Ae>=1024&&(ze=1),Ae>=2048&&(ze=2),Ae>=4096&&(ze=3),Ae>=8192&&(ze=4);var je=i.tileLevelForFov(i.camera.fov,ye);return je>ze?je:0}(),Pe=function(){var ye=i.camera.quaternion.clone(),ge=i.works.getResolvedObserver(g.panoId),me=ge!=null?ge:Z;me&&ye.premultiply(me.quaternion.clone().inverse());var Ae=new c.Matrix4().makeRotationFromQuaternion(ye),Ne=new c.Matrix4().getInverse(Ae),ze=new c.Frustum().setFromProjectionMatrix(new c.Matrix4().multiplyMatrices(i.camera.projectionMatrix,Ne));return ze}();g.panoId===Ue(this.currentPano)&&(((f=g.panoPicture)===null||f===void 0?void 0:f.map)instanceof De&&(g.panoPicture.map.maxRequest=this.tileMaxRequest,g.panoPicture.map.update(Pe,Le),g.panoPicture.map.needsRender===!0&&(g.panoPicture.map.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)),((A=g.panoPicture)===null||A===void 0?void 0:A.luminanceMap)instanceof De&&(g.panoPicture.luminanceMap.maxRequest=this.tileMaxRequest,g.panoPicture.luminanceMap.update(Pe,Le),g.panoPicture.luminanceMap.needsRender===!0&&(g.panoPicture.luminanceMap.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)));{var Ie=this.tiling.object.visible;if(this.initAnimationed){var Qe=g.panoId,be=this.works.getResolvedObserver(Qe);be?Zn(this.camera.position,be.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==Qe&&this.tiling.cleanup(),this.tiling.panoId=Qe,this.tiling.setResource((h=(m=be.images)===null||m===void 0?void 0:m.tiles)!==null&&h!==void 0?h:[],this.enableIOSEDR&&be.images.luminance?be.images.luminance:null),this.tiling.setFetcher(it(be.work)),this.tiling.setRotation(be.quaternion),this.tiling.setPosition(be.position),this.tiling.maxRequest=this.tileMaxRequest,Le>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update(Pe,Le,e):this.tiling.update(Pe,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;Ie!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0,this.modelSceneNeedsRender=!0)}this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e),this.intersectMesh.scale.setScalar(he(this.cameraMotion.value.fov/45,0,1))}},t.prototype.render=function(e,r){var i=this.renderer.getRenderTarget(),a=this.works.getResolvedObserver(this.currentPano);a&&a.video&&(this.needsRender=!0,this.modelSceneNeedsRender=!0),this.updateScreenBuffer(r),e&&(r==="luminance"?(this.luminanceAdaptiveEffect.enable=this.luminanceAdaptiveEffectEnable,this.luminanceAdaptiveEffect.render(this.screenBuffers)):(this.renderer.setRenderTarget(this.modelRenderTarget),this.renderer.render(this.modelScene,this.camera))),this.depthCopyPass.render(this.modelRenderTarget.depthTexture,i),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.copyPass.render(this.modelRenderTarget,i),this.renderer.setRenderTarget(i),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,this.camera),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0},t.prototype.postProcessing=function(e,r){if(!this.destroyed&&r==="luminance")return this.luminanceAdaptiveEffect||(this.luminanceAdaptiveEffect=new Ps(this.renderer,this.scene,this.camera,this.models),this.luminanceAdaptiveEffect.enable=this.luminanceAdaptiveEffectEnable),this.luminanceAdaptiveEffect.render(e)},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(Me())[1],r=this.locationMotion.getKeyFrameSegment(Me())[1],i=this.panoResourceFromLocationMotionKeyframe(r),a=this.works.getResolvedObserver(i.panoId);return{workCode:a?a.work.workCode:this.currentPano.workCode,panoIndex:a?a.panoIndex:this.currentPano.panoIndex,mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:a?a.position.clone():this.camera.position.clone(),distance:this.locationMotion.value.distance}},t.prototype.moveToPano=function(e,r,i){var a=this,o,s,l,u,d=(o=r.effect)!==null&&o!==void 0?o:"fly";this.userAction=i,this.stopMomentumMovement();var f=this.works.getResolvedObserver(e);if(!f)throw new Error("Invalid PanoId ".concat(JSON.stringify(e)));var A=Kn(f.images.up),m=this.imageOptions.size;typeof m=="undefined"&&f&&A&&(m=Number(A)),typeof m=="undefined"&&(m=2048);var h=this.imageOptions.transform,v=F({key:"pano.".concat(f.panoId)},Cr(this.imageOptions,["format","size","quality","sharpen","mappings"])),y=f.images,p=(l=(s=f.images.tiles)===null||s===void 0?void 0:s.filter(function(O){return O.size>m}))!==null&&l!==void 0?l:null,g=h,x={key:"pano_luminance.".concat(f.panoId),size:v.size?v.size/2:void 0},b=this.enableIOSEDR&&f.images.luminance?f.images.luminance:null,w=function(){if(!f.images.tiles||!b)return null;var O=Kn(b.up);return O?p==null?void 0:p.map(function(D){var N=D.size*D.scale/2;return O<N?{level:D.level,size:N,scale:1,back:Rt(b.back,N),front:Rt(b.front,N),left:Rt(b.left,N),right:Rt(b.right,N),up:Rt(b.up,N),down:Rt(b.down,N)}:{level:D.level,size:O,scale:N/O,back:b.back,front:b.front,left:b.left,right:b.right,up:b.up,down:b.down}}):null}(),E="pano:"+Cn([y,v,h]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===E)return;var M=this.pendingTextureTask.panoId;(u=this.panoMeshes[M])===null||u===void 0||u.setProgress(0),this.emit("pano.texture.abort",W("pano.texture.abort",{error:null,progress:0,meta:null,pano:f.pano})),this.pendingTextureTask.onError(new Error("texture aborted"))}var C="move-to-pano-"+f.panoId;this.pending.add(C);var P=this.models.getMaterial()||{},S=P.pano0,T=P.pano1,B;if(S&&S.map.name===E&&S.luminanceMap!==null===this.enableIOSEDR?B=S:(T==null?void 0:T.map.name)===E&&T.luminanceMap!==null===this.enableIOSEDR&&(B=T),B){var L={panoId:f.panoId,effect:d,panoPicture:{zoom:1,map:B.map,luminanceMap:B.luminanceMap,matrix:new c.Matrix4().compose(f.position,f.quaternion,Rs)},position:f.position.clone(),fixCameraTransform:new c.Matrix4};vt.shared.add(function(){a.pending.delete(C),a.doMoveToPano(f.pano,L,r)},!0,1);return}this.pendingTextureTask={panoId:f.panoId,hash:E,onLoad:function(O,D){var N;if(a.pending.delete(C),a.destroyed)O.body.dispose();else{O.body.name=E;var X={panoId:f.panoId,effect:d,panoPicture:{zoom:1,map:O.body,luminanceMap:(N=D==null?void 0:D.body)!==null&&N!==void 0?N:null,matrix:new c.Matrix4().compose(f.position,f.quaternion,Rs)},position:f.position.clone(),fixCameraTransform:new c.Matrix4};a.doMoveToPano(f.pano,X,r)}},onError:function(O){a.pending.delete(C);var D=F(F(F({},f.pano),{mode:a.mode}),_e(a.camera.pose));a.emit("pano.error",W("pano.error",{error:O,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:D})),a.emit("pano.cancel",W("pano.cancel",{error:O,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:D})),a.emit("error",O),r.moveCancelCallback&&r.moveCancelCallback()}};var k=this.panoMeshes[f.panoId];k&&k.tap&&k.tap(),Promise.all([this.tileLevelForFov&&p&&p.length?this.textureLoader.loadTiledCubeTexture(y,p,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:h,options:v},minFilter:c.LinearFilter,magFilter:c.LinearFilter,generateMipmaps:!1,format:c.RGBAFormat,viaAjax:!0,fetcher:it(f.work)},void 0,void 0,function(O){var D,N;a.emit("pano.texture.progress",W("pano.texture.progress",{error:null,progress:O,meta:null,pano:f.pano})),((D=a.pendingTextureTask)===null||D===void 0?void 0:D.hash)===E&&((N=a.panoMeshes[f.panoId])===null||N===void 0||N.setProgress(O))},this.renderer):this.textureLoader.loadCubeTexture(y,{imageURL:{transform:h,options:v},format:c.RGBAFormat,viaAjax:!0,fetcher:it(f.work)},void 0,void 0,function(O){var D,N;a.emit("pano.texture.progress",W("pano.texture.progress",{error:null,progress:O,meta:null,pano:f.pano})),((D=a.pendingTextureTask)===null||D===void 0?void 0:D.hash)===E&&((N=a.panoMeshes[f.panoId])===null||N===void 0||N.setProgress(O))},this.renderer),b?this.tileLevelForFov&&w&&w.length?this.textureLoader.loadTiledCubeTexture(b,w,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:g,options:x},minFilter:c.LinearFilter,magFilter:c.LinearFilter,generateMipmaps:!1,fetcher:it(f.work)},void 0,void 0,void 0,this.renderer).catch(function(){return null}):this.textureLoader.loadCubeTexture(b,{imageURL:{transform:g,options:x},fetcher:it(f.work)},void 0,void 0,void 0,this.renderer).catch(function(){return null}):Promise.resolve(null)]).then(function(O){var D,N,X=O[0],K=O[1];((D=a.pendingTextureTask)===null||D===void 0?void 0:D.hash)===E?(a.pendingTextureTask.onLoad(X,K),(N=a.panoMeshes[f.panoId])===null||N===void 0||N.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.success",W("pano.texture.success",{error:null,progress:1,meta:X.meta,pano:f.pano}))):(X.body.dispose(),K==null||K.body.dispose())}).catch(function(O){var D,N;((D=a.pendingTextureTask)===null||D===void 0?void 0:D.hash)===E&&(a.pendingTextureTask.onError(O),(N=a.panoMeshes[f.panoId])===null||N===void 0||N.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.error",W("pano.texture.error",{error:O,progress:0,meta:null,pano:f.pano})),a.emit("error",O))}),this.emit("pano.texture.load",W("pano.texture.load",{error:null,progress:0,meta:null,pano:f.pano}))},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var i=e.initial,a=i.duration,o=i.effect,s=i.userAction;e.userAction=s;var l=t.initAnimationEndState(e),u={workCode:l.workCode,panoIndex:l.panoIndex},d={modelAlpha:0},f={perspToOrtho:0},A=!1;e.moveToPano(u,{longitude:l.longitude,latitude:l.latitude,fov:l.fov,effect:o,duration:a,moveStartCallback:function(m){A=!0,e.perspToOrthoMotion.set(f,a).catch(z),e.modelAlphaMotion.setKeyframes([{progress:0,value:F({},e.modelAlphaMotion.value)},{progress:.6,value:F({},e.modelAlphaMotion.value)},{progress:1,value:d}],a).catch(z),e.emit("initAnimation.start",W("initAnimation.start",{state:m,userAction:e.userAction}))},moveEndCallback:function(m){e.emit("initAnimation.end",W("initAnimation.end",{state:m,userAction:e.userAction})),e.initAnimationed=!0,r()},moveCancelCallback:function(){var m=F(F(F({},u),{mode:e.mode}),_e(e.camera.pose));A===!1&&e.emit("initAnimation.start",W("initAnimation.start",{state:m,userAction:e.userAction})),e.emit("initAnimation.end",W("initAnimation.end",{state:m,userAction:e.userAction})),e.initAnimationed=!0,r()}},s)})},t.prototype.panoResourceFromLocationMotionKeyframe=function(e){return this.panoResources[e.key]},t.prototype.locationMotionKeyframesLength=function(e){for(var r=0,i=1;i<e.length;i++){var a=this.panoResourceFromLocationMotionKeyframe(e[i-1]).position,o=this.panoResourceFromLocationMotionKeyframe(e[i]).position,s=a.distanceTo(o)*(e[i].value.count-e[i-1].value.count);r+=s}return r},t.prototype.updatePanoMeshes=function(){for(var e=this,r={},i=Object.keys(this.panoMeshes),a=0,o=i;a<o.length;a++){var s=o[a],l=this.panoMeshes[s];r[s]=l,delete this.panoMeshes[s]}for(var u=1,d={},f=function(E){var M=ur(E.accessibleIds,function(P){var S=e.works.getResolvedObserver(P);if(!S)return 1/0;var T=S.standingPosition.distanceTo(E.standingPosition);return he(T,1,1/0)},!0),C=M[1];d[E.panoId]===void 0&&(d[E.panoId]=C)},A=0,m=this.works.resolvedObservers;A<m.length;A++){var h=m[A];f(h)}var v=Object.keys(d).map(function(E){return d[E]});if(v.length){var y=v.reduce(function(E,M){return E+M},0)/v.length;u=he(y*.6,1,3)}for(var p=0,g=this.works.resolvedObservers;p<g.length;p++){var h=g[p],l=void 0;r[h.panoId]?(l=r[h.panoId],l.loading===!0&&h.loadable===!1&&l.setLoading(!1),delete r[h.panoId]):(l=this.panoCircleMeshCreator(h.pano),l.name="PanoCircleMesh_"+h.panoId,this.helper.add(l)),l.scale.set(u,1,u),l.position.copy(h.standingPosition),this.panoMeshes[h.panoId]=l}for(var x=0,b=Object.keys(r);x<b.length;x++){var w=b[x];this.helper.remove(r[w]),r[w].dispose(),delete r[w]}},t.prototype.doMoveToPano=function(e,r,i){var a=this,o,s,l,u,d,f,A,m,h,v,y;i===void 0&&(i={});var p=Me(),g=wt();this.tiling.cleanup(),this.panoResources[g]=r;var x=1,b,w,E;if(this.locationMotion.ended){var M=this.locationMotion.getKeyFrameSegment(p);M[0];var C=M[1],P=this.locationMotion.value,S=((o=this.panoResourceFromLocationMotionKeyframe(C))!==null&&o!==void 0?o:this.camera).position,T=r.position;b=Math.max(S.distanceTo(T),x),w=[{key:C.key,progress:0,value:F(F({},P),{count:0})},{key:g,progress:1,value:{distance:0,count:1}}],E=0}else{var B=this.locationMotion.getKeyFrameSegment(p),L=B[0],C=B[1],P=this.locationMotion.value,k=this.panoResourceFromLocationMotionKeyframe(L).position,S=this.panoResourceFromLocationMotionKeyframe(C).position,T=r.position,O=C.value.count-P.count,D=Math.max(k.distanceTo(S),x)*O,N=Math.max(S.distanceTo(T),x);b=D+N,w=[{key:L.key,progress:0,value:F({},P)},{key:C.key,progress:D/b,value:C.value},{key:g,progress:1,value:{count:C.value.count+1,distance:0}}];var X=this.locationMotionKeyframesLength(this.locationMotion.keyframes),K=this.locationMotionKeyframesLength(w);X===0||X===0?E=0:E=this.locationMotion.getProgressVelocity(p)*X/K}var Q=r.effect==="instant"?0:this.calculateMovingDuration(i.duration,r.effect==="fly"?b:0),G={longitude:i.longitude,latitude:i.latitude,fov:i.fov},J=F(F({},e),{mode:this.mode,longitude:(s=G.longitude)!==null&&s!==void 0?s:this.camera.pose.longitude,latitude:(l=G.latitude)!==null&&l!==void 0?l:this.camera.pose.latitude,fov:(u=G.fov)!==null&&u!==void 0?u:this.camera.pose.fov,offset:r.position.clone(),distance:this.camera.pose.distance}),H=this.currentPano;if(this.emit("pano.moveTo",W("pano.moveTo",{options:i,prevPano:H,progress:0,state:J,userAction:this.userAction,error:null})),i.moveStartCallback&&i.moveStartCallback(J),this.videoTexture&&this.videoTexture.image instanceof HTMLVideoElement&&this.videoTexture.image.getAttribute("src")&&(this.videoTexture.image.pause(),this.videoTexture.image.removeAttribute("uuid"),this.videoTexture.image.removeAttribute("src"),this.videoTexture.image.oncanplay=z,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),r.effect==="fly")this.cameraMotion.set(G,Q).catch(z);else{var j=Ft({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),Z=Ft({longitude:(d=G.longitude)!==null&&d!==void 0?d:this.cameraMotion.value.longitude,latitude:(f=G.latitude)!==null&&f!==void 0?f:this.cameraMotion.value.latitude}),Y=new c.Object3D;Y.lookAt(j);var pe=new c.Matrix4().makeRotationFromQuaternion(Y.quaternion);Y.lookAt(Z);var ee=new c.Matrix4().makeRotationFromQuaternion(Y.quaternion),oe=new c.Matrix4().getInverse(pe).premultiply(ee),ie=this.cameraMotion.value.fov,ce=(A=G.fov)!==null&&A!==void 0?A:this.cameraMotion.value.fov,ne=1;r.effect==="zoomin"?ne=1.5:r.effect==="zoomout"&&(ne=.4);for(var ae=he(ce*ne,1,170),de=0;de<w.length-1;de++){var ve=w[de].key;if(ve){var xe=this.panoResources[ve];xe&&(xe.fixCameraTransform.copy(oe),xe.panoPicture&&(xe.panoPicture.zoom=Math.tan(ie/2/180*Math.PI)/Math.tan(ae/2/180*Math.PI)))}}this.cameraMotion.setKeyframes([{progress:0,value:{longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude,fov:this.cameraMotion.value.fov}},{progress:0,value:{longitude:(m=G.longitude)!==null&&m!==void 0?m:this.cameraMotion.value.longitude,latitude:(h=G.latitude)!==null&&h!==void 0?h:this.cameraMotion.value.latitude,fov:ae}},{progress:1,value:{longitude:(v=G.longitude)!==null&&v!==void 0?v:this.cameraMotion.value.longitude,latitude:(y=G.latitude)!==null&&y!==void 0?y:this.cameraMotion.value.latitude,fov:ce}}],Q).catch(z)}var Ce=this.locationMotion.setKeyframes(w,Q,E);Ce.then(function(){for(var Be,$,te=0,U=a.models;te<U.length;te++){var Le=U[te];Le.show()}var Pe=F(F({},e),{mode:a.mode,longitude:a.camera.pose.longitude,latitude:a.camera.pose.latitude,fov:a.camera.pose.fov,offset:a.camera.pose.offset.clone(),distance:a.camera.pose.distance});a.emit("pano.arrived",W("pano.arrived",{options:i,prevPano:H,progress:1,state:Pe,userAction:a.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(Pe);var Ie=a.works.getResolvedObserver(e);if(Ie&&Ie.video&&a.videoTexture&&a.videoTexture.image instanceof HTMLVideoElement){var Qe=_h.clone().multiply(($=(Be=a.models.getMaterial().pano1)===null||Be===void 0?void 0:Be.matrix)!==null&&$!==void 0?$:new c.Matrix4).multiply(Ie.video.matrix),be={map:a.videoTexture,size:Ie.video.size,matrix:Qe,alpha:1},ye=wt(),ge=a.videoTexture.image;ge.setAttribute("uuid",ye),yu().then(function(me){me&&Ie.video&&ge.getAttribute("uuid")===ye&&(ge.oncanplay=function(){ge.oncanplay=z,ge.play()},ge.ontimeupdate=function(){ge.currentTime>.5&&(ge.ontimeupdate=z,a.panoVideo.setMaterial(be))},ge.src=Ie.video.source)}).catch(function(){ge.removeAttribute("uuid")})}},function(){a.emit("pano.cancel",W("pano.cancel",{options:i,prevPano:H,progress:0,state:J,userAction:a.userAction,error:null})),i.moveCancelCallback&&i.moveCancelCallback()})},t.prototype.getForwardObserverOrNot=function(e){var r=this,i=this.works.getResolvedObserver(this.currentPano);if(!i)return null;var a=e!=null?e:new c.Raycaster(this.camera.position.clone(),this.camera.getDirection(new c.Vector3));a.params.Points={threshold:.1};var o=i.standingPosition.clone();if(i.position.distanceTo(a.ray.origin)>1){var s=this.models.intersectRaycaster(new c.Raycaster(a.ray.origin,new c.Vector3(0,-1,0)))[0];s&&s.distance<=2?o.copy(s.point):o.copy(a.ray.origin).add(new c.Vector3(0,-1.5,0))}var l=this.models.intersectRaycaster(a)[0],u=l?l.point:a.ray.origin.clone().add(a.ray.direction.clone().normalize().multiplyScalar(3)),d=u.clone().sub(o).normalize();if(d.length()===0)return null;for(var f=i.accessibleIds.filter(function(w){if(w===Ue(r.currentPano))return!1;var E=r.works.getResolvedObserver(w);if(!E)return!1;var M=E.standingPosition.clone().project(r.camera);return Math.abs(M.z)>1||Math.abs(M.x)>1||Math.abs(M.y)>1?!1:E.loadable||E.active}),A=f.slice().sort(function(w,E){var M=r.works.getResolvedObserver(w).standingPosition.clone().distanceTo(o),C=r.works.getResolvedObserver(E).standingPosition.clone().distanceTo(o);return M-C}),m=0,h=[Math.PI/8,Math.PI/6,Math.PI/4,Math.PI/3];m<h.length;m++)for(var v=h[m],y=0,p=A;y<p.length;y++){var g=p[y],x=this.works.getResolvedObserver(g);if(x){var b=x.standingPosition.clone().sub(o);if(b&&b.length()!==0&&d.angleTo(b)<v)return x}}return null},t.prototype.onTapGesture=function(e){var r=this,i;if(this.userAction=e.userAction,this.stopMomentumMovement(),!!this.initAnimationed){if(!this.locationMotion.ended){var a=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]);if(a.panoId!==Ue(this.currentPano))return}var o=e.center.raycaster,s=this.camera.getDirection(new c.Vector3).setY(0),l=null,u=this.works.getResolvedObserver(this.currentPano);if(u){var d=u.accessibleIds.filter(function(K){if(K===Ue(r.currentPano))return!1;var Q=r.works.getResolvedObserver(K);return!Q||Q.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:Q.loadable||Q.active}),f=this.models.intersectRaycaster(o)[0];if(f){var A=ur(d,function(K){var Q=r.works.getResolvedObserver(K);if(!Q)return 1/0;var G=Q.standingPosition.clone();return G.distanceTo(f.point)},!0),m=A[0],h=A[1];m&&h<this.panoTapTriggerRadius&&(l=(i=this.works.getResolvedObserver(m))!==null&&i!==void 0?i:null)}l||(l=this.getForwardObserverOrNot(o));for(var v=0,y=this.locationMotion.keyframes;v<y.length;v++){var p=y[v],g=this.panoResourceFromLocationMotionKeyframe(p);if(!(p.progress<this.locationMotion.progress)&&l&&g.panoId===l.panoId){l=null;break}}if(!l)this.emit("gesture.tap",e),e.defaultPrevented||this.locationMotion.ended===!0&&this.cameraBounce();else{for(var x={},b=Math.PI/6,w=Math.PI/12,E=l.position.clone().setY(0).sub(u.position.clone().setY(0)).normalize(),M=[],C=[],P=[],S=0,T=l.accessibleIds;S<T.length;S++){var m=T[S],B=pt(m);if(!(_t(B,this.currentPano)||_t(B,l.pano))){var L=this.works.getResolvedObserver(m);if(L){var k=L.position.clone().sub(l.position).setY(0);E.angleTo(k)<b&&P.push(k)}}}var O=P.length>0?P:bt(bt([],M,!0),C,!0),D=O.slice().sort(function(K,Q){return K.angleTo(E)-Q.angleTo(E)})[0];D&&D.angleTo(s)>w&&(x.longitude=Math.atan2(-D.x,-D.z)),this.cameraMotion.value.latitude<-Math.PI/4&&(x.latitude=he(0,this.minLatitude,this.maxLatitude));var N=F({},e.state);if(N.workCode=l.pano.workCode,N.panoIndex=l.pano.panoIndex,x.longitude!==void 0&&(N.longitude=x.longitude),x.latitude!==void 0&&(N.latitude=x.latitude),x.fov!==void 0&&(N.fov=x.fov),N.distance=0,N.offset=l.position.clone(),e.state=N,this.emit("gesture.tap",e),!e.defaultPrevented){if(this.emit("pano.select",W("pano.select",{prevPano:this.currentPano,state:N,userAction:e.userAction,options:x,progress:0,error:null})),l&&!l.active){var X=l.panoId;this.panoMeshes[X]&&(this.panoMeshes[X].setDisabled(!1),this.panoMeshes[X].setLoading(!0))}l&&l.active&&this.emit("pano.request",W("pano.request",{userAction:e.userAction,prevPano:this.currentPano,progress:0,state:N,options:x,error:null}))}}}}},t}(gu),gr=Math.PI/180,bn=180/Math.PI,bu=.001,xu=1,Gn=function(){var n=typeof navigator!="undefined"&&/iPad|iPhone|iPod/.test(navigator.platform);return function(){return n}}(),Zh=function(){var n=typeof navigator!="undefined"&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent);return function(){return n}}(),Yh=function(){var n=typeof navigator!="undefined"&&navigator.userAgent.indexOf("Firefox")!==-1&&navigator.userAgent.indexOf("Android")!==-1;return function(){return n}}(),wu=function(){var n=typeof navigator!="undefined"?navigator.userAgent.match(/.*Chrome\/([0-9]+)/):null,t=n?parseInt(n[1],10):null;return function(){return t}}(),$h=function(){var n=!1;if(wu()===65){var t=typeof navigator!="undefined"?navigator.userAgent.match(/.*Chrome\/([0-9\.]*)/):null;if(t){var e=t[1].split(".");e[0],e[1];var r=e[2],i=e[3];n=parseInt(r,10)===3325&&parseInt(i,10)<148}}return function(){return n}}(),ep=function(){var n=Gn()&&Zh()&&typeof navigator!="undefined"&&navigator.userAgent.indexOf("13_4")!==-1;return function(){return n}}(),Eu=function(){var n=typeof navigator!="undefined"&&navigator.userAgent.indexOf("R7 Build")!==-1;return function(){return n}}();function Fs(){var n=typeof window!="undefined"&&(window.orientation==90||window.orientation==-90);return Eu()?!n:n}function tp(n){return!(isNaN(n)||n<=bu||n>xu)}function rp(n){if(n.w>1)return 0;var t=2*Math.acos(n.w);return t}var Ls=function(){var n={};return function(t,e){n[t]===void 0&&(console.warn("cardboard: "+e),n[t]=!0)}}();function Os(n){var t,e=n.indexOf("://");e!==-1?t=e+3:t=0;var r=n.indexOf("/",t);return r===-1&&(r=n.length),n.substring(0,r)}function np(){if(typeof window=="undefined"||typeof document=="undefined")return!1;var n=window.self!==window.top,t=Os(document.referrer),e=Os(window.location.href);return n&&t!==e}var Vs=function(){function n(r,i,a){var o=i?i[0]:0,s=i?i[1]:0,l=i?i[2]:0,u=i?i[3]:1,d=o+o,f=s+s,A=l+l,m=o*d,h=o*f,v=o*A,y=s*f,p=s*A,g=l*A,x=u*d,b=u*f,w=u*A;return r[0]=1-(y+g),r[1]=h+w,r[2]=v-b,r[3]=0,r[4]=h-w,r[5]=1-(m+g),r[6]=p+x,r[7]=0,r[8]=v+b,r[9]=p-x,r[10]=1-(m+y),r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function t(r,i,a){var o=a[0],s=a[1],l=a[2],u,d,f,A,m,h,v,y,p,g,x,b;return i===r?(r[12]=i[0]*o+i[4]*s+i[8]*l+i[12],r[13]=i[1]*o+i[5]*s+i[9]*l+i[13],r[14]=i[2]*o+i[6]*s+i[10]*l+i[14],r[15]=i[3]*o+i[7]*s+i[11]*l+i[15]):(u=i[0],d=i[1],f=i[2],A=i[3],m=i[4],h=i[5],v=i[6],y=i[7],p=i[8],g=i[9],x=i[10],b=i[11],r[0]=u,r[1]=d,r[2]=f,r[3]=A,r[4]=m,r[5]=h,r[6]=v,r[7]=y,r[8]=p,r[9]=g,r[10]=x,r[11]=b,r[12]=u*o+m*s+p*l+i[12],r[13]=d*o+h*s+g*l+i[13],r[14]=f*o+v*s+x*l+i[14],r[15]=A*o+y*s+b*l+i[15]),r}function e(r,i){var a=i[0],o=i[1],s=i[2],l=i[3],u=i[4],d=i[5],f=i[6],A=i[7],m=i[8],h=i[9],v=i[10],y=i[11],p=i[12],g=i[13],x=i[14],b=i[15],w=a*d-o*u,E=a*f-s*u,M=a*A-l*u,C=o*f-s*d,P=o*A-l*d,S=s*A-l*f,T=m*g-h*p,B=m*x-v*p,L=m*b-y*p,k=h*x-v*g,O=h*b-y*g,D=v*b-y*x,N=w*D-E*O+M*k+C*L-P*B+S*T;return N?(N=1/N,r[0]=(d*D-f*O+A*k)*N,r[1]=(s*O-o*D-l*k)*N,r[2]=(g*S-x*P+b*C)*N,r[3]=(v*P-h*S-y*C)*N,r[4]=(f*L-u*D-A*B)*N,r[5]=(a*D-s*L+l*B)*N,r[6]=(x*M-p*S-b*E)*N,r[7]=(m*S-v*M+y*E)*N,r[8]=(u*O-d*L+A*T)*N,r[9]=(o*L-a*O-l*T)*N,r[10]=(p*P-g*M+b*w)*N,r[11]=(h*M-m*P-y*w)*N,r[12]=(d*B-u*k-f*T)*N,r[13]=(a*k-o*B+s*T)*N,r[14]=(g*E-p*C-x*w)*N,r[15]=(m*C-h*E+v*w)*N,r):null}return function(r,i,a){n(r,i),a&&t(r,r,a),e(r,r)}}(),ha=function(){function n(t,e){t===void 0&&(t=new c.Vector3),e===void 0&&(e=0),this.sample=t,this.timestampS=e}return n.prototype.set=function(t,e){this.sample=t,this.timestampS=e},n.prototype.copy=function(t){this.set(t.sample,t.timestampS)},n}(),ip=function(){function n(t,e){this.kFilter=t,this.isDebug=e,this.currentAccelMeasurement=new ha,this.currentGyroMeasurement=new ha,this.previousGyroMeasurement=new ha,Gn()?this.filterQ=new c.Quaternion(-1,0,0,1):this.filterQ=new c.Quaternion(1,0,0,1),this.previousFilterQ=new c.Quaternion,this.previousFilterQ.copy(this.filterQ),this.accelQ=new c.Quaternion,this.isOrientationInitialized=!1,this.estimatedGravity=new c.Vector3,this.measuredGravity=new c.Vector3,this.gyroIntegralQ=new c.Quaternion}return n.prototype.addAccelMeasurement=function(t,e){this.currentAccelMeasurement.set(t,e)},n.prototype.addGyroMeasurement=function(t,e){this.currentGyroMeasurement.set(t,e);var r=e-this.previousGyroMeasurement.timestampS;tp(r)&&this.run_(),this.previousGyroMeasurement.copy(this.currentGyroMeasurement)},n.prototype.getOrientation=function(){return this.filterQ},n.prototype.run_=function(){if(!this.isOrientationInitialized){this.accelQ=this.accelToQuaternion_(this.currentAccelMeasurement.sample),this.previousFilterQ.copy(this.accelQ),this.isOrientationInitialized=!0;return}var t=this.currentGyroMeasurement.timestampS-this.previousGyroMeasurement.timestampS,e=this.gyroToQuaternionDelta_(this.currentGyroMeasurement.sample,t);this.gyroIntegralQ.multiply(e),this.filterQ.copy(this.previousFilterQ),this.filterQ.multiply(e);var r=new c.Quaternion;r.copy(this.filterQ),r.inverse(),this.estimatedGravity.set(0,0,-1),this.estimatedGravity.applyQuaternion(r),this.estimatedGravity.normalize(),this.measuredGravity.copy(this.currentAccelMeasurement.sample),this.measuredGravity.normalize();var i=new c.Quaternion;i.setFromUnitVectors(this.estimatedGravity,this.measuredGravity),i.inverse(),this.isDebug&&console.log("Delta: %d deg, G_est: (%s, %s, %s), G_meas: (%s, %s, %s)",bn*rp(i),this.estimatedGravity.x.toFixed(1),this.estimatedGravity.y.toFixed(1),this.estimatedGravity.z.toFixed(1),this.measuredGravity.x.toFixed(1),this.measuredGravity.y.toFixed(1),this.measuredGravity.z.toFixed(1));var a=new c.Quaternion;a.copy(this.filterQ),a.multiply(i),this.filterQ.slerp(a,1-this.kFilter),this.previousFilterQ.copy(this.filterQ)},n.prototype.accelToQuaternion_=function(t){var e=new c.Vector3;e.copy(t),e.normalize();var r=new c.Quaternion;return r.setFromUnitVectors(new c.Vector3(0,0,-1),e),r.inverse(),r},n.prototype.gyroToQuaternionDelta_=function(t,e){var r=new c.Quaternion,i=new c.Vector3;return i.copy(t),i.normalize(),r.setFromAxisAngle(i,t.length()*e),r},n}(),ap=function(){function n(t,e){this.predictionTimeS=t,this.isDebug=e,this.previousQ=new c.Quaternion,this.previousTimestampS=null,this.deltaQ=new c.Quaternion,this.outQ=new c.Quaternion}return n.prototype.getPrediction=function(t,e,r){if(!this.previousTimestampS)return this.previousQ.copy(t),this.previousTimestampS=r,t;var i=new c.Vector3;i.copy(e),i.normalize();var a=e.length();if(a<gr*20)return this.isDebug&&console.log("Moving slowly, at %s deg/s: no prediction",(bn*a).toFixed(1)),this.outQ.copy(t),this.previousQ.copy(t),this.outQ;var o=a*this.predictionTimeS;return this.deltaQ.setFromAxisAngle(i,o),this.outQ.copy(this.previousQ),this.outQ.multiply(this.deltaQ),this.previousQ.copy(t),this.previousTimestampS=r,this.outQ},n}(),op=function(){function n(t){this.coefficients=t}return n.prototype.distortInverse=function(t){for(var e=0,r=1,i=t-this.distort(e);Math.abs(r-e)>1e-4;){var a=t-this.distort(r),o=r-a*((r-e)/(a-i));e=r,r=o,i=a}return r},n.prototype.distort=function(t){for(var e=t*t,r=0,i=0;i<this.coefficients.length;i++)r=e*(r+this.coefficients[i]);return(r+1)*t},n}(),sp=function(){function n(){this.angularAcceleration=null,this.angularVelocity=null,this.linearAcceleration=null,this.linearVelocity=null,this.orientation=null,this.position=null}return n}(),Ns=function(){function n(){this.leftDegrees=0,this.rightDegrees=0,this.upDegrees=0,this.downDegrees=0}return n}(),up=function(){function n(t,e,r,i){this.viewer={id:"CardboardV1",label:"Cardboard I/O 2014",fov:40,interLensDistance:.06,baselineLensDistance:.035,screenLensDistance:.042,distortionCoefficients:[.441,.156],inverseCoefficients:[-.4410035,.42756155,-.4804439,.5460139,-.58821183,.5733938,-.48303202,.33299083,-.17573841,.0651772,-.01488963,.001559834]},this.device={widthMeters:.11,heightMeters:.062,bevelMeters:.004},this.depthNear=.01,this.depthFar=1e4,this.yawOnly=r,this.accelerometer=new c.Vector3,this.gyroscope=new c.Vector3,this.filter=new ip(t,i),this.posePredictor=new ap(e,i),this.isFirefoxAndroid=Yh(),this.isIOS=Gn();var a=wu();this.isDeviceMotionInRadians=!this.isIOS&&a!==null&&a<66,this.isWithoutDeviceMotion=$h()||ep(),this.filterToWorldQ=new c.Quaternion,Gn()?this.filterToWorldQ.setFromAxisAngle(new c.Vector3(1,0,0),Math.PI/2):this.filterToWorldQ.setFromAxisAngle(new c.Vector3(1,0,0),-Math.PI/2),this.inverseWorldToScreenQ=new c.Quaternion,this.worldToScreenQ=new c.Quaternion,this.originalPoseAdjustQ=new c.Quaternion;var o=typeof window!="undefined"?-window.orientation*Math.PI/180:0;this.originalPoseAdjustQ.setFromAxisAngle(new c.Vector3(0,0,1),o),this.setScreenTransform_(),Fs()&&this.filterToWorldQ.multiply(this.inverseWorldToScreenQ),this.resetQ=new c.Quaternion,this.orientationOut_=new Float32Array(4),this.previousTimestampS=Date.now()}return n.prototype.getPosition=function(){return null},n.prototype.getOrientation=function(){var t;if(this.isWithoutDeviceMotion&&this._deviceOrientationQ){this.deviceOrientationFixQ=this.deviceOrientationFixQ||function(){var a=new c.Quaternion().setFromAxisAngle(new c.Vector3(0,0,-1),0),o=new c.Quaternion;return typeof window!="undefined"&&window.orientation===-90?o.setFromAxisAngle(new c.Vector3(0,1,0),Math.PI/-2):o.setFromAxisAngle(new c.Vector3(0,1,0),Math.PI/2),a.multiply(o)}(),this.deviceOrientationFilterToWorldQ=this.deviceOrientationFilterToWorldQ||function(){var a=new c.Quaternion;return a.setFromAxisAngle(new c.Vector3(1,0,0),-Math.PI/2),a}(),t=this._deviceOrientationQ;var e=new c.Quaternion;return e.copy(t),e.multiply(this.deviceOrientationFilterToWorldQ),e.multiply(this.resetQ),e.multiply(this.worldToScreenQ),e.multiplyQuaternions(this.deviceOrientationFixQ,e),this.yawOnly&&(e.x=0,e.z=0,e.normalize()),this.orientationOut_[0]=e.x,this.orientationOut_[1]=e.y,this.orientationOut_[2]=e.z,this.orientationOut_[3]=e.w,this.orientationOut_}else{var r=this.filter.getOrientation();t=this.posePredictor.getPrediction(r,this.gyroscope,this.previousTimestampS)}var i=new c.Quaternion;return i.copy(this.filterToWorldQ),i.multiply(this.resetQ),i.multiply(t),i.multiply(this.worldToScreenQ),this.yawOnly&&(i.x=0,i.z=0,i.normalize()),this.orientationOut_[0]=i.x,this.orientationOut_[1]=i.y,this.orientationOut_[2]=i.z,this.orientationOut_[3]=i.w,this.orientationOut_},n.prototype.getPose=function(){var t=new sp;return t.orientation=this.getOrientation(),t},n.prototype.resetPose=function(){this.resetQ.copy(this.filter.getOrientation()),this.resetQ.x=0,this.resetQ.y=0,this.resetQ.z*=-1,this.resetQ.normalize(),Fs()&&this.resetQ.multiply(this.inverseWorldToScreenQ),this.resetQ.multiply(this.originalPoseAdjustQ)},n.prototype.getFrameData=function(t){var e=this.getOrientation(),r=this.getEyeOffset(),i=this.getEyeProjectionMatrix();return t.pose.angularAcceleration=null,t.pose.angularVelocity=null,t.pose.linearAcceleration=null,t.pose.linearVelocity=null,t.pose.orientation=e,t.pose.position=null,t.timestamp=this.previousTimestampS,t.leftProjectionMatrix.set(i.left),t.rightProjectionMatrix.set(i.right),Vs(t.leftViewMatrix,e,r.left),Vs(t.rightViewMatrix,e,r.right),t},n.prototype.start=function(){if(typeof window=="undefined")return function(){};var t=this.onDeviceMotion_.bind(this),e=this.onOrientationChange_.bind(this),r=this.onMessage_.bind(this),i=this.onDeviceOrientation_.bind(this);return Gn()&&np()&&window.addEventListener("message",r),window.addEventListener("orientationchange",e),this.isWithoutDeviceMotion?window.addEventListener("deviceorientation",i):window.addEventListener("devicemotion",t),function(){window.removeEventListener("devicemotion",t),window.removeEventListener("deviceorientation",e),window.removeEventListener("orientationchange",e),window.removeEventListener("message",r)}},n.prototype.getEyeOffset=function(){return{left:[-this.viewer.interLensDistance*.5,0,0],right:[this.viewer.interLensDistance*.5,0,0]}},n.prototype.getEyeProjectionMatrix=function(){var t=this.getEyeFieldOfView(),e=this.depthNear,r=this.depthFar,i={left:[],right:[]};{var a=t.left.upDegrees*gr,o=t.left.downDegrees*gr,s=t.left.leftDegrees*gr,l=t.left.rightDegrees*gr,u=2/(s+l),d=2/(a+o);i.left[0]=u,i.left[1]=0,i.left[2]=0,i.left[3]=0,i.left[4]=0,i.left[5]=d,i.left[6]=0,i.left[7]=0,i.left[8]=-((s-l)*u*.5),i.left[9]=(a-o)*d*.5,i.left[10]=r/(e-r),i.left[11]=-1,i.left[12]=0,i.left[13]=0,i.left[14]=r*e/(e-r),i.left[15]=0}{var a=t.right.upDegrees*gr,o=t.right.downDegrees*gr,s=t.right.leftDegrees*gr,l=t.right.rightDegrees*gr,u=2/(s+l),d=2/(a+o);i.right[0]=u,i.right[1]=0,i.right[2]=0,i.right[3]=0,i.right[4]=0,i.right[5]=d,i.right[6]=0,i.right[7]=0,i.right[8]=-((s-l)*u*.5),i.right[9]=(a-o)*d*.5,i.right[10]=r/(e-r),i.right[11]=-1,i.right[12]=0,i.right[13]=0,i.right[14]=r*e/(e-r),i.right[15]=0}return i},n.prototype.getEyeFieldOfView=function(){var t=this.viewer,e=this.device,r=new op(t.distortionCoefficients),i=t.screenLensDistance,a=(e.widthMeters-t.interLensDistance)/2,o=t.interLensDistance/2,s=t.baselineLensDistance-e.bevelMeters,l=e.heightMeters-s,u=bn*Math.atan(r.distort(a/i)),d=bn*Math.atan(r.distort(o/i)),f=bn*Math.atan(r.distort(s/i)),A=bn*Math.atan(r.distort(l/i)),m=new Ns,h=new Ns;return m.leftDegrees=Math.min(u,t.fov),m.rightDegrees=Math.min(d,t.fov),m.downDegrees=Math.min(f,t.fov),m.upDegrees=Math.min(A,t.fov),h.leftDegrees=m.rightDegrees,h.rightDegrees=m.leftDegrees,h.upDegrees=m.upDegrees,h.downDegrees=m.downDegrees,{left:m,right:h}},n.prototype.onDeviceOrientation_=function(t){this._deviceOrientationQ=this._deviceOrientationQ||new c.Quaternion;var e=t.alpha,r=t.beta,i=t.gamma;e=(e||0)*Math.PI/180,r=(r||0)*Math.PI/180,i=(i||0)*Math.PI/180,this._deviceOrientationQ.setFromEuler(new c.Euler(e,r,-i,"YXZ"))},n.prototype.onDeviceMotion_=function(t){this.updateDeviceMotion_(t)},n.prototype.updateDeviceMotion_=function(t){var e=t.accelerationIncludingGravity,r=t.rotationRate,i=t.timeStamp/1e3,a=i-this.previousTimestampS;if(a<0){Ls("fusion-pose-sensor:invalid:non-monotonic","Invalid timestamps detected: non-monotonic timestamp from devicemotion"),this.previousTimestampS=i;return}else if(a<=bu||a>xu){Ls("fusion-pose-sensor:invalid:outside-threshold","Invalid timestamps detected: Timestamp from devicemotion outside expected range."),this.previousTimestampS=i;return}e&&(this.accelerometer.set(-e.x,-e.y,-e.z),r&&(Eu()?this.gyroscope.set(-r.beta,r.alpha,r.gamma):this.gyroscope.set(r.alpha,r.beta,r.gamma),this.isDeviceMotionInRadians||this.gyroscope.multiplyScalar(Math.PI/180),this.filter.addGyroMeasurement(this.gyroscope,i)),this.filter.addAccelMeasurement(this.accelerometer,i)),this.previousTimestampS=i},n.prototype.onOrientationChange_=function(){this.setScreenTransform_()},n.prototype.onMessage_=function(t){var e=t.data;if(!(!e||!e.type)){var r=e.type.toLowerCase();r==="devicemotion"&&this.updateDeviceMotion_(e.deviceMotionEvent)}},n.prototype.setScreenTransform_=function(){this.worldToScreenQ.set(0,0,0,1);var t=typeof window!="undefined"?window.orientation:0;switch(t){case 0:break;case 90:this.worldToScreenQ.setFromAxisAngle(new c.Vector3(0,0,1),-Math.PI/2);break;case-90:this.worldToScreenQ.setFromAxisAngle(new c.Vector3(0,0,1),Math.PI/2);break}this.inverseWorldToScreenQ.copy(this.worldToScreenQ),this.inverseWorldToScreenQ.inverse()},n}(),si=[0,0,.5,1],ui=[.5,0,.5,1],lp=function(){function n(t){var e=this;this.renderer=t,this.sensor=new up(.98,.04,!1,!1),this.scale=1,this.cameraL=new c.PerspectiveCamera,this.cameraR=new c.PerspectiveCamera;var r=this.sensor.start();this.dispose=function(){var i=e.renderer.getSize(new c.Vector2);e.renderer.setScissor(0,0,i.width,i.height),e.renderer.setViewport(0,0,i.width,i.height),e.renderer.setScissorTest(!1),r()}}return n.prototype.render=function(t,e){var r=this.renderer.getSize(new c.Vector2);if(r.width>r.height){var i=t.autoUpdate;i&&(t.updateMatrixWorld(),t.autoUpdate=!1);var a={x:Math.round(r.width*si[0]),y:Math.round(r.height*si[1]),width:Math.round(r.width*si[2]),height:Math.round(r.height*si[3])},o={x:Math.round(r.width*ui[0]),y:Math.round(r.height*ui[1]),width:Math.round(r.width*ui[2]),height:Math.round(r.height*ui[3])};this.renderer.setScissorTest(!0),this.renderer.autoClear&&this.renderer.clear(),e.parent===null&&e.updateMatrixWorld(),e.matrixWorld.decompose(this.cameraL.position,this.cameraL.quaternion,this.cameraL.scale),e.matrixWorld.decompose(this.cameraR.position,this.cameraR.quaternion,this.cameraR.scale);var s=this.sensor.getEyeOffset();this.cameraL.translateOnAxis(new c.Vector3().fromArray(s.left),this.scale),this.cameraR.translateOnAxis(new c.Vector3().fromArray(s.right),this.scale);var l=this.sensor.getEyeProjectionMatrix();this.cameraL.projectionMatrix.elements=l.left.slice(),this.cameraR.projectionMatrix.elements=l.right.slice(),this.renderer.setViewport(a.x,a.y,a.width,a.height),this.renderer.setScissor(a.x,a.y,a.width,a.height),this.renderer.render(t,this.cameraL),this.renderer.setViewport(o.x,o.y,o.width,o.height),this.renderer.setScissor(o.x,o.y,o.width,o.height),this.renderer.render(t,this.cameraR),this.renderer.setViewport(0,0,r.width,r.height),this.renderer.setScissor(0,0,r.width,r.height),this.renderer.setScissorTest(!1),i&&(t.autoUpdate=!0)}else this.renderer.render(t,e)},n.prototype.dispose=function(){},n}();const cp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAADqCAMAAAAvZYhaAAAC/VBMVEUAAAD///99fX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UBaHBwoQT9Prx4Szm3TyRodLupoMJHH5LyK+9es8+l/CKvDytukQQND8FSlFIOreGM0/omiATVapVo12xd0jhExKW5294RAc40RVoftY47cd2LKtMOFwkajzuAeVOlIhfJeKahLyiWJRhLr3Ai2BVzQYKG4lLYXfg8HCSI33a2nTH5OaVWmzYHJGhsdLmDuN2exAonBTzZIuzEUS+ec0ZMBQn+Ea5KlXNI4C/UAO/k6hKwBptJgn8fgmVckgFXML9YEEFLUKMvlqAp0eWyDEAL65dLqyWo6RekTZ2XNCsD6rgpTK/4p3WcrrPH1ghWJGhONC3JoGAkRHH1JKjpNEcCxOV2I8MWyiUJqNVajSVodgiWcVMVLVeSS1ATCZoc88qjVKlSc3kSLJ5c5V6rTZQAcVkGbBeuOkgCgq2CBM3MoFwGr1tvim2aMpZZqyBBc3N1UF2GX90j9SQJKCBB83OfYAcNVjFcSrvzo95WOShB83Ody5V24fqzO0nAUSzB/89Nph38VqmuOa3gticJOP9fApuHTDt4nFJ7AXdPC0lg8/gq8y5XapSrgpUgbQ0JpF5u97hS1fOC26nlJJA8Yd41Sg3fU4dtRQkKeXSN3jo4Qqm0397OmyZOGatoDrScBIWM3DFn5kXi1ZyqRSUoZtKOa1vWKArztqgEnhIHty4f9/btuEstKwGkxf+XuCT5CbTFnFRuxktuAAAAAElFTkSuQmCC";var pa,va={zh:{TITLE:"眼镜模式",HIT:"请将手机横屏放入 VR 眼镜中"},en:{TITLE:"GLASSES MODE",HIT:"Please put the mobile phone horizontally into the VR glasses."},ja:{TITLE:"メガネモード",HIT:"携帯電話をVRメガネに水平に入れてください。"}},Ds=typeof navigator!="undefined"&&(pa=va[navigator.language.split("-")[0]])!==null&&pa!==void 0?pa:va.zh,fp=`
|
|
1489
1489
|
<style>
|
|
1490
1490
|
.$id {
|
|
1491
1491
|
all: initial;
|
|
@@ -1568,7 +1568,7 @@ void main() {
|
|
|
1568
1568
|
.$id-modal-content-guide-cardboard-image {
|
|
1569
1569
|
width: 100px;
|
|
1570
1570
|
height: 82px;
|
|
1571
|
-
background-image: url(`.concat(
|
|
1571
|
+
background-image: url(`.concat(cp,`);
|
|
1572
1572
|
background-size: 100%;
|
|
1573
1573
|
background-repeat: no-repeat;
|
|
1574
1574
|
}
|
|
@@ -1610,7 +1610,7 @@ void main() {
|
|
|
1610
1610
|
.$id-modal-content-guide-phone-image {
|
|
1611
1611
|
width: 58px;
|
|
1612
1612
|
height: 56px;
|
|
1613
|
-
background-image: url(`).concat(
|
|
1613
|
+
background-image: url(`).concat(dp,`);
|
|
1614
1614
|
background-size: 100%;
|
|
1615
1615
|
background-repeat: no-repeat;
|
|
1616
1616
|
}
|
|
@@ -1687,8 +1687,8 @@ Z
|
|
|
1687
1687
|
</div>
|
|
1688
1688
|
</div>
|
|
1689
1689
|
<div class="$id-modal-content">
|
|
1690
|
-
<div class="$id-modal-content-title">`).concat(
|
|
1691
|
-
<div class="$id-modal-content-hit">`).concat(
|
|
1690
|
+
<div class="$id-modal-content-title">`).concat(Ds.TITLE,`</div>
|
|
1691
|
+
<div class="$id-modal-content-hit">`).concat(Ds.HIT,`</div>
|
|
1692
1692
|
<div class="$id-modal-content-guide">
|
|
1693
1693
|
<div class="$id-modal-content-guide-phone">
|
|
1694
1694
|
<div class="$id-modal-content-guide-phone-move-x">
|
|
@@ -1746,7 +1746,7 @@ Z
|
|
|
1746
1746
|
</svg>
|
|
1747
1747
|
</div>
|
|
1748
1748
|
</div>
|
|
1749
|
-
`);function
|
|
1749
|
+
`);function hp(n){for(var t=1,e=document.getElementsByTagName("meta"),r=0;r<e.length;r++){var i=e[r];if(i.getAttribute("name")==="viewport"){var a=i.getAttribute("content")||"",o=a.match(/initial\-scale\=([\d|\.]+)/);o&&(t=Number(o[1])),isNaN(t)&&(t=1)}}var s=function(l){return Math.floor(l*t)+"px"};return fp.replace(/\n/g," ").replace(/\ +/g," ").replace(/\$id/g,n).replace(/(\d+)px/g,function(l,u){return s(Number(u))})}function pp(){var n="five_vr_helper_"+wt(),t=hp(n),e=document.createElement("div");return e.className=n,e.innerHTML=t,e}var Aa=new c.CircleBufferGeometry(.12,16),vp=`
|
|
1750
1750
|
varying vec2 vUv;
|
|
1751
1751
|
#include <common>
|
|
1752
1752
|
#include <logdepthbuf_pars_vertex>
|
|
@@ -1755,7 +1755,7 @@ void main() {
|
|
|
1755
1755
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
1756
1756
|
#include <logdepthbuf_vertex>
|
|
1757
1757
|
}
|
|
1758
|
-
`,
|
|
1758
|
+
`,Ap=`
|
|
1759
1759
|
uniform float circleScale;
|
|
1760
1760
|
uniform float circleFade;
|
|
1761
1761
|
uniform float circleOpacity;
|
|
@@ -1812,7 +1812,7 @@ void main() {
|
|
|
1812
1812
|
|
|
1813
1813
|
gl_FragColor = vec4(gl_FragColor.rgb, gl_FragColor.a * opacity);
|
|
1814
1814
|
}
|
|
1815
|
-
`,
|
|
1815
|
+
`,mp=`
|
|
1816
1816
|
varying vec2 vUv;
|
|
1817
1817
|
#include <common>
|
|
1818
1818
|
#include <logdepthbuf_pars_vertex>
|
|
@@ -1821,7 +1821,7 @@ void main() {
|
|
|
1821
1821
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
1822
1822
|
#include <logdepthbuf_vertex>
|
|
1823
1823
|
}
|
|
1824
|
-
`,
|
|
1824
|
+
`,gp=`
|
|
1825
1825
|
varying vec2 vUv;
|
|
1826
1826
|
uniform float opacity;
|
|
1827
1827
|
#include <common>
|
|
@@ -1846,8 +1846,8 @@ void main() {
|
|
|
1846
1846
|
|
|
1847
1847
|
gl_FragColor = vec4(gl_FragColor.rgb, gl_FragColor.a * opacity * outside * inside);
|
|
1848
1848
|
}
|
|
1849
|
-
`,gp=function(n){ue(t,n);function t(){var e=n.call(this)||this;e.progress=0,e.opacity=0,e.loading=!1,e.current=!1,e.disabled=!1,e.currentMotion=new Se({ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}),e.opacityMotion=new Se({opacity:0}),e.loadingMotion=new Se({opacity:0}),e.disableMotion=new Se({opacity:0});var r={blending:c.CustomBlending,blendSrc:c.SrcAlphaFactor,blendDst:c.OneMinusSrcAlphaFactor,blendSrcAlpha:c.OneFactor,blendDstAlpha:c.OneMinusSrcAlphaFactor,depthWrite:!1,transparent:!0};return e.hitTestMesh=new c.Mesh(Aa,new c.MeshBasicMaterial(F(F({},r),{color:0,opacity:0}))),e.hitTestMesh.scale.set(1.5,1.5,1.5),e.ringMesh=new c.Mesh(Aa,new c.ShaderMaterial(F(F({},r),{vertexShader:Ap,fragmentShader:mp,uniforms:{opacity:{value:0}}}))),e.panoMesh=new c.Mesh(Aa,new c.ShaderMaterial(F(F({},r),{vertexShader:pp,fragmentShader:vp,uniforms:{circleScale:{value:1.1},circleFade:{value:0},circleOpacity:{value:.5},loadingAngle:{value:0},loadingOpacity:{value:0},opacity:{value:0},disable:{value:0}}}))),e.add(e.hitTestMesh),e.add(e.ringMesh),e.add(e.panoMesh),e.renderOrder=1e4,e.needsRender=!0,e}return t.prototype.setProgress=function(e){this.progress=e,this.setLoading(e>0)},t.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=he(e,0,1),this.opacityMotion.set({opacity:e},30).catch(z))},t.prototype.setCurrent=function(e){if(this.current!==e){if(e){var r=[{progress:0,value:{ringScale:2,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.05,value:{ringScale:1,ringOpacity:1,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.15,value:{ringScale:1.2,ringOpacity:1,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.25,value:{ringScale:1.1,ringOpacity:1,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.8,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.85,circleScale:1}},{progress:.9,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.65,circleScale:.8}},{progress:.92,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.65,circleScale:.8}},{progress:1,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.85,circleScale:1.1}}];this.currentMotion.setKeyframes(r,1500).catch(z)}else{var r=[{progress:0,value:F({},this.currentMotion.value)},{progress:1,value:{ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}}];this.currentMotion.setKeyframes(r,200).catch(z)}this.current=e}},t.prototype.setLoading=function(e){this.loading!==e&&(e?this.loadingMotion.setKeyframes([{progress:0,value:{opacity:0}},{progress:.3,value:{opacity:0}},{progress:1,value:{opacity:.8}}],500).catch(z):this.loadingMotion.set({opacity:0},0).catch(z),this.loading=e,this.disabled===!0&&this.setDisabled(!1),this.needsRender=!0)},t.prototype.setDisabled=function(e){this.disabled!==e&&(this.disabled=e,this.loading===!0&&this.setLoading(!1),this.disableMotion.set({opacity:e?1:0},300).catch(z),this.needsRender=!0)},t.prototype.tap=function(){return Promise.resolve()},t.prototype.updateTime=function(e,r){this.opacityMotion.update(e),this.currentMotion.update(e),this.loadingMotion.update(e);var i=this.opacityMotion.value.opacity;this.visible=i!==0;var a=this.currentMotion.value,o=a.ringScale,s=a.ringOpacity,l=a.circleFade,u=a.circleOpacity,d=a.circleScale;this.ringMesh.scale.set(o,1,o),this.ringMesh.material.uniforms.opacity.value=s*i,this.panoMesh.material.uniforms.opacity.value=i,this.panoMesh.material.uniforms.circleOpacity.value=u,this.panoMesh.material.uniforms.circleScale.value=d,this.panoMesh.material.uniforms.circleFade.value=l,this.panoMesh.material.uniforms.loadingOpacity.value=this.loadingMotion.value.opacity,this.panoMesh.material.uniforms.disable.value=this.disableMotion.value.opacity,this.panoMesh.material.uniforms.loadingAngle.value=e/120%(Math.PI*2),this.needsRender=!0},t.prototype.dispose=function(){this.hitTestMesh.material.dispose(),this.ringMesh.material.dispose(),this.panoMesh.material.dispose()},t}(c.Object3D),yp=1500,bp=function(n){ue(t,n);function t(e){var r=this,i=t.parseArgs(e);r=n.call(this,i)||this,r.mode="VRPanorama",r.cardboard=new up(r.renderer);var a=hp();r.helperElement=a;var o=new Nn(a);return r.element.parentNode&&(r.element.parentNode.insertBefore(a,r.element),r.setHelperElementSize(),o.on("tap",function(){return r.emit("vr.requestExit",W("vr.requestExit",{}))})),r.destroyHelper=function(){o.destroy(),a.parentNode&&a.parentNode.removeChild(a),delete r.helperElement},r}return t.parseArgs=function(e){if(e instanceof t)return e;var r=F(F({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return n.parseArgs.call(this,r)},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return F(F({},i),{mode:"VRPanorama"})},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.cardboard.dispose(),this.destroyHelper();for(var e=Object.keys(this.panoMeshes),r=0,i=e;r<i.length;r++){var a=i[r],o=this.panoMeshes[a];this.helper.remove(o),o.dispose(),delete this.panoMeshes[a]}},t.prototype.isReady=function(){return!1},t.prototype.updateRenderSize=function(){this.needsRender=!0,this.modelSceneNeedsRender=!0,this.setHelperElementSize()},t.prototype.updateCamera=function(e,r,i){return Promise.resolve()},t.prototype.updateCameraWithKeyframes=function(e,r,i){return Promise.resolve()},t.prototype.updatePanoMeshesVisible=function(){for(var e=this.works.getResolvedObserver(this.currentPano),r=(e?e.visibleIds:[]).concat(Ue(this.currentPano)),i=0,a=this.works.resolvedObservers;i<a.length;i++){var o=a[i],s=this.panoMeshes[o.panoId];s&&(r.indexOf(o.panoId)>=0?s.parent!==this.helper&&this.helper.add(s):s.parent===this.helper&&(this.helper.remove(s),s.setOpacity(0)))}},t.prototype.updatePanoMeshes=function(){for(var e=Object.keys(this.panoMeshes),r=0,i=e;r<i.length;r++){var a=i[r],o=this.panoMeshes[a];this.helper.remove(o),o.dispose(),delete this.panoMeshes[a]}for(var s=0,l=this.works.resolvedObservers;s<l.length;s++){var u=l[s],d=u.panoId,f=new gp;f.name="panoSphere_".concat(d),f.position.copy(u.position),f.needsRender=!0,this.panoMeshes[d]=f}this.updatePanoMeshesVisible()},t.prototype.updateTime=function(e,r){var i=this,a,o,s,l,u,d,f,A,m,h;if(!this.destroyed){var v=this.currentPano;this.userAction=!0,this.needsRender=!0,this.modelSceneNeedsRender=!0;var y={},p={},g=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),x=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),b=!1;if(this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),y.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(he(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var w=this.locationMotion.getKeyFrameSegment(e),E=w[0],M=w[1],C=this.panoResourceFromLocationMotionKeyframe(E),P=this.panoResourceFromLocationMotionKeyframe(M),S=C.position,T=P.position,B=this.locationMotion.value.count-M.value.count+1;y.progress=B,P.panoPicture&&(B<1?C.panoPicture&&(y.pano0=C.panoPicture):y.pano0=P.panoPicture,y.pano1=P.panoPicture),P.effect==="montage"?y.transition="BLACK":P.effect==="spread"?y.transition="SPREAD":y.transition="FADE",(P.effect==="zoomin"||P.effect==="zoomout")&&(y.progress=Math.pow(B,3)),B<1&&P.effect!=="fly"&&(y.pano0&&C.panoPicture&&(y.pano0={map:y.pano0.map,zoom:y.pano0.zoom,luminanceMap:y.pano0.luminanceMap,matrix:C.panoPicture.matrix.clone().premultiply(C.fixCameraTransform).setPosition(P.position)}),S.copy(T),b=!0),p.distance=this.locationMotion.value.distance,p.offset=new c.Vector3(S.x+(T.x-S.x)*B,S.y+(T.y-S.y)*B,S.z+(T.z-S.z)*B);for(var L=[],k=[],O=0,D=this.locationMotion.keyframes;O<D.length;O++){var N=D[O],X=N.key,K=N.progress;X!==void 0&&(L.push(X),K>this.locationMotion.progress&&k.push(X))}for(var Q=0,G=Object.keys(this.panoResources);Q<G.length;Q++){var J=G[Q];if(!(k.indexOf(J)>=0)){var H=this.panoResources[J];if(H.panoPicture){var j=H.panoPicture.map,Z=H.panoPicture.luminanceMap;if(j){if(j===((a=y.pano0)===null||a===void 0?void 0:a.map)||j===((o=y.pano1)===null||o===void 0?void 0:o.map))continue;j instanceof De&&j.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(j.cubeRenderTarget),j.dispose(),Z&&(Z instanceof De&&Z.cubeRenderTarget&&this.luminanceCubeRenderTargetPool.push(Z.cubeRenderTarget),Z.dispose()),H.panoPicture=null}}L.indexOf(J)>=0||delete this.panoResources[J]}}this.currentPano=pt(P.panoId),this.emit("pano.moving",W("pano.moving",{userAction:this.userAction,prevPano:pt(g.panoId),state:F(F(F(F({},pt(x.panoId)),{mode:this.mode}),_e(this.camera.pose)),p),options:{},progress:this.locationMotion.progress,error:null}))}Nt(y)===!1&&(!((s=y.pano0)===null||s===void 0)&&s.map&&y.pano0.map instanceof De&&!y.pano0.map.cubeRenderTarget&&(y.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((l=y.pano0)===null||l===void 0)&&l.luminanceMap&&y.pano0.luminanceMap instanceof De&&!y.pano0.luminanceMap.cubeRenderTarget&&(y.pano0.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),!((u=y.pano1)===null||u===void 0)&&u.map&&y.pano1.map instanceof De&&!y.pano1.map.cubeRenderTarget&&(y.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((d=y.pano1)===null||d===void 0)&&d.luminanceMap&&y.pano1.luminanceMap instanceof De&&!y.pano1.luminanceMap.cubeRenderTarget&&(y.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.models.setMaterial(y)),p.offset&&this.camera.position.copy(p.offset),_t(this.currentPano,v)&&this.updatePanoMeshesVisible();var Y=this.camera.pose.longitude,pe=this.camera.pose.latitude;this.camera.quaternion.fromArray(this.cardboard.sensor.getOrientation()),this.camera.computePose();var ee=this.works.getResolvedObserver(this.currentPano);if(this.camera.pose.distance>.1||b)for(var oe=0,ie=Object.keys(this.panoMeshes);oe<ie.length;oe++){var ce=ie[oe],ne=this.panoMeshes[ce];ne.setOpacity(0),ne.updateTime&&ne.updateTime(e,r),ne.visible=!1}else if(ee)for(var ae=ee.visibleIds.concat(Ue(this.currentPano)),de=0,ve=ae;de<ve.length;de++){var ce=ve[de],xe=pt(ce),Ce=this.works.getResolvedObserver(xe);if(Ce){var ne=this.panoMeshes[ce];if(!Ce.loadable&&!Ce.active){ne.setOpacity(0);continue}var Be=ne.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);Be<.05?ne.setOpacity(0):ne.setOpacity(he(1.5/Be,0,1)),_t(this.currentPano,xe)&&ne.setOpacity(0),ne.lookAt(this.camera.position)}}if(this.locationMotion.ended)for(var $=this.intersect(e),te=0,U=this.works.resolvedObservers;te<U.length;te++){var Ce=U[te],ne=this.panoMeshes[Ce.panoId];ne&&(ne.setCurrent(ne===$),ne.updateTime&&ne.updateTime(e,r))}(Y!==this.camera.pose.longitude||pe!==this.camera.pose.latitude)&&(this.cameraMotion.set(Cr(this.camera.pose,["longitude","latitude"]),0).catch(z),this.emit("camera.update",W("camera.update",{userAction:!0,state:F(F(F({},this.currentPano),{mode:this.mode}),_e(this.camera.pose))})));var Le=this.tileLevel=function(){if(i.tileLevelForFov===!1)return 0;var ye=i.renderer.getDrawingBufferSize(new c.Vector2);ye.width*=i.scissor.width,ye.height*=i.scissor.height;var ge=x.panoId,me=i.works.getResolvedObserver(ge),Ae=i.imageOptions.size;if(typeof Ae=="undefined"&&me){var Ne=me.images.up.match(/\/cube_(\d+)\//);Ne&&(Ae=Number(Ne[1]))}typeof Ae=="undefined"&&(Ae=2048);var ze=0;Ae>=1024&&(ze=1),Ae>=2048&&(ze=2),Ae>=4096&&(ze=3),Ae>=8192&&(ze=4);var je=i.tileLevelForFov(i.camera.fov,ye);return je>ze?je:0}(),Pe=function(){var ye=i.camera.quaternion.clone(),ge=i.works.getResolvedObserver(x.panoId),me=ge!=null?ge:ee;me&&ye.premultiply(me.quaternion.clone().inverse());var Ae=new c.Matrix4().makeRotationFromQuaternion(ye),Ne=new c.Matrix4().getInverse(Ae),ze=new c.Frustum().setFromProjectionMatrix(new c.Matrix4().multiplyMatrices(i.camera.projectionMatrix,Ne));return ze}();x.panoId===Ue(this.currentPano)&&(((f=x.panoPicture)===null||f===void 0?void 0:f.map)instanceof De&&(x.panoPicture.map.maxRequest=this.tileMaxRequest,x.panoPicture.map.update(Pe,Le),x.panoPicture.map.needsRender===!0&&(x.panoPicture.map.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)),((A=x.panoPicture)===null||A===void 0?void 0:A.luminanceMap)instanceof De&&(x.panoPicture.luminanceMap.maxRequest=this.tileMaxRequest,x.panoPicture.luminanceMap.update(Pe,Le),x.panoPicture.luminanceMap.needsRender===!0&&(x.panoPicture.luminanceMap.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)));{var Ie=this.tiling.object.visible;if(this.initAnimationed){var Qe=x.panoId,be=this.works.getResolvedObserver(Qe);be?Zn(this.camera.position,be.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==Qe&&this.tiling.cleanup(),this.tiling.panoId=Qe,this.tiling.setResource((h=(m=be.images)===null||m===void 0?void 0:m.tiles)!==null&&h!==void 0?h:[],this.enableIOSEDR&&be.images.luminance?be.images.luminance:null),this.tiling.setFetcher(it(be.work)),this.tiling.setRotation(be.quaternion),this.tiling.setPosition(be.position),this.tiling.maxRequest=this.tileMaxRequest,Le>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update(Pe,Le,e):this.tiling.update(Pe,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;Ie!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0,this.modelSceneNeedsRender=!0)}this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e)}},t.prototype.render=function(){this.cardboard.render(this.modelScene,this.camera),this.renderer.autoClear=!1,this.cardboard.render(this.scene,this.camera),this.renderer.autoClear=!0},t.prototype.setCamera=function(e){},t.prototype.destroyHelper=function(){},t.prototype.setHelperElementSize=function(){if(this.helperElement){var e=new c.Vector2(this.element.offsetWidth,this.element.offsetHeight),r=e.x*this.scissor.left,i=e.y*(1-this.scissor.bottom-this.scissor.height),a=e.x*this.scissor.width,o=e.y*this.scissor.height;this.helperElement.style.marginLeft=r+"px",this.helperElement.style.marginTop=i+"px",this.helperElement.style.width=a+"px",this.helperElement.style.height=o+"px"}},t.prototype.intersect=function(e){var r,i;if(this.locationMotion.ended===!1){this.intersectMesh.visible=!1,delete this.activePanoMesh,delete this.activeTime;return}if(this.activePanoMesh&&this.activeTime&&e-this.activeTime>yp){for(var a=this.activePanoMesh,o=Object.keys(this.panoMeshes),s=null,l=0,u=o;l<u.length;l++){var d=u[l];if(this.panoMeshes[d]===a){s=d;break}}return s!==null&&this.moveToPano(pt(s),{},!0),delete this.activePanoMesh,delete this.activeTime,a}var f=this.camera.getDirection(new c.Vector3),A=new c.Raycaster(this.camera.position,f);A.params.Points={threshold:.1};for(var m=void 0,h=[],v=this.works.getResolvedObserver(this.currentPano),y=v?v.visibleIds:[],p=0,g=y;p<g.length;p++){var s=g[p],x=this.panoMeshes[s],b=A.intersectObject((r=x.hitTestMesh)!==null&&r!==void 0?r:x,!0)[0];b&&h.push({panoMesh:x,intersection:F({floor:(i=v==null?void 0:v.floorIndex)!==null&&i!==void 0?i:0},b)})}var w=h.sort(function(S,T){return S.intersection.distance-T.intersection.distance})[0];w?(m=w.intersection,this.activePanoMesh!==w.panoMesh&&(this.activePanoMesh=w.panoMesh,this.activeTime=e),this.intersectMesh.position.copy(w.panoMesh.position),this.intersectMesh.lookAt(this.camera.position)):(this.activePanoMesh=void 0,this.activeTime=void 0),m||(m=this.models.intersectRaycaster(A)[0]);var E=W("intersect.update",{raycaster:A,intersection:m!=null?m:null,object:this.intersectMesh});if(this.emit("intersect.update",E),E.defaultPrevented){this.hideIntersectMesh();return}if(m&&m.face){var M=m.face.normal,C=new c.Quaternion;C.setFromUnitVectors(new c.Vector3(0,0,1),M),this.intersectMesh.quaternion.copy(C);var P=m.point.clone();this.intersectMesh.position.copy(P),w?this.intersectMesh.visible=!1:this.intersectMesh.visible=!0}else this.intersectMesh.visible=!1;return w==null?void 0:w.panoMesh},t.prototype.onPanGesture=function(){},t.prototype.onTapGesture=function(){},t.prototype.onPinchGesture=function(){},t.prototype.onMouseMove=function(){},t.prototype.onMouseOut=function(){},t}(Ao),xp=new c.Vector3(0,1.6,0),wp=function(n){ue(t,n);function t(e){var r=this,i,a=t.parseArgs(e);return r=n.call(this,a)||this,r.mode="Model",r.locationMotion=new Se({x:r.camera.pose.offset.x,y:r.camera.pose.offset.y,z:r.camera.pose.offset.z,distance:r.camera.pose.distance}),r.modelAlphaMotion=new Se({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new Se({perspToOrtho:r.camera.perspToOrtho.x}),r}return t.parseArgs=function(e){return e instanceof t?e:n.parseArgs.call(this,e)},t.initAnimationEndState=function(e){var r,i,a,o,s,l,u=this.parseArgs(e),d=u.works,f=e.initial,A=f.state,m=f.currentState,h=typeof A.panoIndex=="number"?{workCode:(a=(r=A.workCode)!==null&&r!==void 0?r:(i=u.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:A.panoIndex}:{workCode:m.workCode,panoIndex:m.panoIndex},v=d.getResolvedObserver(h),y=(o=A.longitude)!==null&&o!==void 0?o:m.longitude,p=he((s=A.latitude)!==null&&s!==void 0?s:!v||Jn(m.mode)?m.latitude:u.defaultLatitude,u.minLatitude,u.maxLatitude),g=he((l=A.fov)!==null&&l!==void 0?l:!v||Jn(m.mode)?m.fov:u.defaultFov,u.minFov,u.maxFov),x=new c.Vector3;if(u.initial.state.offset)x.copy(u.initial.state.offset);else if(v)x.copy(v.position);else{var b=Ft(m).setLength(m.distance);x.copy(u.initial.currentState.offset).sub(b)}return{workCode:h.workCode,panoIndex:h.panoIndex,mode:"Model",longitude:y,latitude:p,fov:g,offset:x,distance:0}},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.locationMotion.dispose()},t.prototype.isReady=function(){return this.locationMotion.ended!==!1},t.prototype.updateWork=function(e,r,i,a){this.works=e;var o=t.initAnimationEndState(F(F({},this),{initial:{currentState:F(F({},this.currentPano),this.camera.pose),duration:i.duration,effect:i.effect,state:r,userAction:a}}));return this.hideIntersectMesh(),this.moveToPosition(o.offset,{duration:0,longitude:o.longitude,latitude:o.latitude,fov:o.fov},a),!0},t.prototype.updateCamera=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();var o={},s={};return o.distance=0,e.offset!==void 0&&(o.x=e.offset.x,o.y=e.offset.y,o.z=e.offset.z),e.longitude!==void 0&&(s.longitude=e.longitude),e.latitude!==void 0&&(s.latitude=e.latitude),e.fov!==void 0&&(s.fov=e.fov),a.locationMotion.set(o,r).catch(z),a.cameraMotion.set(s,r).catch(z)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();for(var o=[],s=[],l=0,u=e;l<u.length;l++){var d=u[l];o.push({key:d.key,progress:d.progress,value:{distance:0,x:d.value.offset.x,y:d.value.offset.x,z:d.value.offset.x}}),s.push({key:d.key,progress:d.progress,value:{longitude:d.value.longitude,latitude:d.value.latitude,fov:d.value.fov}})}return a.locationMotion.setKeyframes(o,r).catch(z),a.cameraMotion.setKeyframes(e,r)})},t.prototype.updateTime=function(e,r){if(!this.destroyed){var i={},a={};if(this.modelAlphaMotion.ended||(this.modelAlphaMotion.update(e),i.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended||(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(he(this.perspToOrthoMotion.value.perspToOrtho,0,1))),!this.locationMotion.ended){this.locationMotion.update(e),a.distance=this.locationMotion.value.distance,a.offset=new c.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z);var o=new c.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),s=this.works.resolvedObservers,l=ur(s,function(u){return u.position.distanceTo(o)});this.currentPano=l?{workCode:l.work.workCode,panoIndex:l.panoIndex}:{workCode:"",panoIndex:0}}this.cameraMotion.ended||(this.cameraMotion.update(e),a.longitude=this.cameraMotion.value.longitude,a.latitude=this.cameraMotion.value.latitude,a.fov=this.cameraMotion.value.fov),Nt(i)||this.models.setMaterial(i),Nt(a)||this.setCamera(a)}},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var i=e.initial;i.state,i.currentState;var a=i.duration,o=i.userAction;e.userAction=o;var s=t.initAnimationEndState(e),l={modelAlpha:1},u={perspToOrtho:0},d={longitude:s.longitude,latitude:s.latitude,fov:s.fov,duration:a,moveStartCallback:function(f){e.perspToOrthoMotion.set(u,a).catch(z),e.modelAlphaMotion.set(l,a).catch(z),e.emit("initAnimation.start",W("initAnimation.start",{state:f,userAction:e.userAction}))},moveEndCallback:function(f){e.emit("initAnimation.end",W("initAnimation.end",{state:f,userAction:e.userAction})),r()},moveCancelCallback:function(){var f=e.currentPano,A=F(F({},f),{mode:e.mode,longitude:e.camera.pose.longitude,latitude:e.camera.pose.latitude,fov:e.camera.pose.fov,offset:e.camera.pose.offset.clone(),distance:e.camera.pose.distance});e.emit("initAnimation.end",W("initAnimation.end",{state:A,userAction:e.userAction})),r()}};e.moveToPosition(s.offset,d,o)})},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(Me())[1],r=this.locationMotion.getKeyFrameSegment(Me())[1];return F(F({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:new c.Vector3(r.value.x,r.value.y,r.value.z),distance:r.value.distance})},t.prototype.moveToPano=function(e,r,i){r===void 0&&(r={});var a=this.works.getResolvedObserver(e);a&&this.moveToPosition(a.position,r,i)},t.prototype.moveToPosition=function(e,r,i){var a=this,o,s,l;r===void 0&&(r={}),this.userAction=i,this.stopMomentumMovement();for(var u=Me(),d=new c.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),f=d.distanceTo(e),A=this.locationMotion.getProgressVelocity(u),m=0,h=1;h<this.locationMotion.keyframes.length;h++){var v=this.locationMotion.keyframes[h-1].value,y=v.x,p=v.y,g=v.z,x=this.locationMotion.keyframes[h].value,b=x.x,w=x.y,E=x.z;m+=Math.sqrt(Math.pow(b-y,2)+Math.pow(w-p,2)+Math.pow(E-g,2))}var M=f===0?0:A*m/f,C=this.calculateMovingDuration(r.duration,f),P={x:e.x,y:e.y,z:e.z,distance:0},S={longitude:r.longitude,latitude:r.latitude,fov:r.fov},T=this.works.resolvedObservers,B=ur(T,function(D){return D.position.distanceTo(d)}),L=B?{workCode:B.work.workCode,panoIndex:B.panoIndex}:{workCode:"",panoIndex:0},k=F(F({},L),{mode:this.mode,longitude:(o=S.longitude)!==null&&o!==void 0?o:this.camera.pose.longitude,latitude:(s=S.latitude)!==null&&s!==void 0?s:this.camera.pose.latitude,fov:(l=S.fov)!==null&&l!==void 0?l:this.camera.pose.fov,offset:e.clone(),distance:0}),O=this.currentPano;this.emit("pano.moveTo",W("pano.moveTo",{options:r,prevPano:O,progress:0,state:k,userAction:this.userAction,error:null})),r.moveStartCallback&&r.moveStartCallback(k),this.cameraMotion.set(S,C).catch(z),this.locationMotion.set(P,C,M).then(function(){for(var D=0,N=a.models;D<N.length;D++){var X=N[D];X.show()}var K=F(F(F({},L),{mode:a.mode}),_e(a.camera.pose));a.emit("pano.arrived",W("pano.arrived",{options:r,prevPano:O,progress:0,state:K,userAction:a.userAction,error:null})),r.moveEndCallback&&r.moveEndCallback(K)},function(){r.moveCancelCallback&&r.moveCancelCallback(),a.emit("pano.cancel",W("pano.cancel",{options:r,prevPano:O,progress:0,state:k,userAction:a.userAction,error:null}))})},t.prototype.onTapGesture=function(e){var r=e.center.raycaster;this.stopMomentumMovement();var i=this.models.intersectRaycaster(r)[0];if(i&&i.face){var a=i.face.normal,o=i.point;if(new c.Vector3(0,1,0).angleTo(a)>Math.PI/3){var s=a.clone().setLength(.3).add(o);r.set(s,new c.Vector3(0,-1,0)),i=this.models.intersectRaycaster(r)[0]}}if(i){var l=new c.Vector3().copy(i.point).add(xp),u=this.works.resolvedObservers,d=ur(u,function(m){return m.position.distanceTo(l)},!0),f=d[0],A=d[1];f&&A<5&&(l.y=f.position.y),e.state.offset.copy(l),e.state.distance=0,this.emit("gesture.tap",e),e.defaultPrevented||this.moveToPosition(l,{},!0)}else this.emit("gesture.tap",e),e.defaultPrevented||this.cameraBounce()},t}(mu);const Ep=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}(`}rpvv|{-zrqvz}-sy|nH}rpvv|{-zrqvz}-v{Hnvor-rp@-}|vv|{Hnvor-rp?-H{vs|z-znA-}|wrpv|{Znv\x07H{vs|z-znA-z|qrycvrZnv\x07Hn\bv{t-rp?-bH|vq-znv{56-
|
|
1850
|
-
b-J-HrpA-z]|vv|{-J-z|qrycvrZnv\x07-7-rpA5}|vv|{9>;=6Htyl]|vv|{-J-}|wrpv|{Znv\x07-7-z]|vv|{H\f`),
|
|
1849
|
+
`,yp=function(n){ue(t,n);function t(){var e=n.call(this)||this;e.progress=0,e.opacity=0,e.loading=!1,e.current=!1,e.disabled=!1,e.currentMotion=new Se({ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}),e.opacityMotion=new Se({opacity:0}),e.loadingMotion=new Se({opacity:0}),e.disableMotion=new Se({opacity:0});var r={blending:c.CustomBlending,blendSrc:c.SrcAlphaFactor,blendDst:c.OneMinusSrcAlphaFactor,blendSrcAlpha:c.OneFactor,blendDstAlpha:c.OneMinusSrcAlphaFactor,depthWrite:!1,transparent:!0};return e.hitTestMesh=new c.Mesh(Aa,new c.MeshBasicMaterial(F(F({},r),{color:0,opacity:0}))),e.hitTestMesh.scale.set(1.5,1.5,1.5),e.ringMesh=new c.Mesh(Aa,new c.ShaderMaterial(F(F({},r),{vertexShader:mp,fragmentShader:gp,uniforms:{opacity:{value:0}}}))),e.panoMesh=new c.Mesh(Aa,new c.ShaderMaterial(F(F({},r),{vertexShader:vp,fragmentShader:Ap,uniforms:{circleScale:{value:1.1},circleFade:{value:0},circleOpacity:{value:.5},loadingAngle:{value:0},loadingOpacity:{value:0},opacity:{value:0},disable:{value:0}}}))),e.add(e.hitTestMesh),e.add(e.ringMesh),e.add(e.panoMesh),e.renderOrder=1e4,e.needsRender=!0,e}return t.prototype.setProgress=function(e){this.progress=e,this.setLoading(e>0)},t.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=he(e,0,1),this.opacityMotion.set({opacity:e},30).catch(z))},t.prototype.setCurrent=function(e){if(this.current!==e){if(e){var r=[{progress:0,value:{ringScale:2,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.05,value:{ringScale:1,ringOpacity:1,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.15,value:{ringScale:1.2,ringOpacity:1,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.25,value:{ringScale:1.1,ringOpacity:1,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.8,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.85,circleScale:1}},{progress:.9,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.65,circleScale:.8}},{progress:.92,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.65,circleScale:.8}},{progress:1,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.85,circleScale:1.1}}];this.currentMotion.setKeyframes(r,1500).catch(z)}else{var r=[{progress:0,value:F({},this.currentMotion.value)},{progress:1,value:{ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}}];this.currentMotion.setKeyframes(r,200).catch(z)}this.current=e}},t.prototype.setLoading=function(e){this.loading!==e&&(e?this.loadingMotion.setKeyframes([{progress:0,value:{opacity:0}},{progress:.3,value:{opacity:0}},{progress:1,value:{opacity:.8}}],500).catch(z):this.loadingMotion.set({opacity:0},0).catch(z),this.loading=e,this.disabled===!0&&this.setDisabled(!1),this.needsRender=!0)},t.prototype.setDisabled=function(e){this.disabled!==e&&(this.disabled=e,this.loading===!0&&this.setLoading(!1),this.disableMotion.set({opacity:e?1:0},300).catch(z),this.needsRender=!0)},t.prototype.tap=function(){return Promise.resolve()},t.prototype.updateTime=function(e,r){this.opacityMotion.update(e),this.currentMotion.update(e),this.loadingMotion.update(e);var i=this.opacityMotion.value.opacity;this.visible=i!==0;var a=this.currentMotion.value,o=a.ringScale,s=a.ringOpacity,l=a.circleFade,u=a.circleOpacity,d=a.circleScale;this.ringMesh.scale.set(o,1,o),this.ringMesh.material.uniforms.opacity.value=s*i,this.panoMesh.material.uniforms.opacity.value=i,this.panoMesh.material.uniforms.circleOpacity.value=u,this.panoMesh.material.uniforms.circleScale.value=d,this.panoMesh.material.uniforms.circleFade.value=l,this.panoMesh.material.uniforms.loadingOpacity.value=this.loadingMotion.value.opacity,this.panoMesh.material.uniforms.disable.value=this.disableMotion.value.opacity,this.panoMesh.material.uniforms.loadingAngle.value=e/120%(Math.PI*2),this.needsRender=!0},t.prototype.dispose=function(){this.hitTestMesh.material.dispose(),this.ringMesh.material.dispose(),this.panoMesh.material.dispose()},t}(c.Object3D),bp=1500,xp=function(n){ue(t,n);function t(e){var r=this,i=t.parseArgs(e);r=n.call(this,i)||this,r.mode="VRPanorama",r.cardboard=new lp(r.renderer);var a=pp();r.helperElement=a;var o=new Nn(a);return r.element.parentNode&&(r.element.parentNode.insertBefore(a,r.element),r.setHelperElementSize(),o.on("tap",function(){return r.emit("vr.requestExit",W("vr.requestExit",{}))})),r.destroyHelper=function(){o.destroy(),a.parentNode&&a.parentNode.removeChild(a),delete r.helperElement},r}return t.parseArgs=function(e){if(e instanceof t)return e;var r=F(F({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return n.parseArgs.call(this,r)},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return F(F({},i),{mode:"VRPanorama"})},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.cardboard.dispose(),this.destroyHelper();for(var e=Object.keys(this.panoMeshes),r=0,i=e;r<i.length;r++){var a=i[r],o=this.panoMeshes[a];this.helper.remove(o),o.dispose(),delete this.panoMeshes[a]}},t.prototype.isReady=function(){return!1},t.prototype.updateRenderSize=function(){this.needsRender=!0,this.modelSceneNeedsRender=!0,this.setHelperElementSize()},t.prototype.updateCamera=function(e,r,i){return Promise.resolve()},t.prototype.updateCameraWithKeyframes=function(e,r,i){return Promise.resolve()},t.prototype.updatePanoMeshesVisible=function(){for(var e=this.works.getResolvedObserver(this.currentPano),r=(e?e.visibleIds:[]).concat(Ue(this.currentPano)),i=0,a=this.works.resolvedObservers;i<a.length;i++){var o=a[i],s=this.panoMeshes[o.panoId];s&&(r.indexOf(o.panoId)>=0?s.parent!==this.helper&&this.helper.add(s):s.parent===this.helper&&(this.helper.remove(s),s.setOpacity(0)))}},t.prototype.updatePanoMeshes=function(){for(var e=Object.keys(this.panoMeshes),r=0,i=e;r<i.length;r++){var a=i[r],o=this.panoMeshes[a];this.helper.remove(o),o.dispose(),delete this.panoMeshes[a]}for(var s=0,l=this.works.resolvedObservers;s<l.length;s++){var u=l[s],d=u.panoId,f=new yp;f.name="panoSphere_".concat(d),f.position.copy(u.position),f.needsRender=!0,this.panoMeshes[d]=f}this.updatePanoMeshesVisible()},t.prototype.updateTime=function(e,r){var i=this,a,o,s,l,u,d,f,A,m,h;if(!this.destroyed){var v=this.currentPano;this.userAction=!0,this.needsRender=!0,this.modelSceneNeedsRender=!0;var y={},p={},g=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),x=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),b=!1;if(this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),y.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(he(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var w=this.locationMotion.getKeyFrameSegment(e),E=w[0],M=w[1],C=this.panoResourceFromLocationMotionKeyframe(E),P=this.panoResourceFromLocationMotionKeyframe(M),S=C.position,T=P.position,B=this.locationMotion.value.count-M.value.count+1;y.progress=B,P.panoPicture&&(B<1?C.panoPicture&&(y.pano0=C.panoPicture):y.pano0=P.panoPicture,y.pano1=P.panoPicture),P.effect==="montage"?y.transition="BLACK":P.effect==="spread"?y.transition="SPREAD":y.transition="FADE",(P.effect==="zoomin"||P.effect==="zoomout")&&(y.progress=Math.pow(B,3)),B<1&&P.effect!=="fly"&&(y.pano0&&C.panoPicture&&(y.pano0={map:y.pano0.map,zoom:y.pano0.zoom,luminanceMap:y.pano0.luminanceMap,matrix:C.panoPicture.matrix.clone().premultiply(C.fixCameraTransform).setPosition(P.position)}),S.copy(T),b=!0),p.distance=this.locationMotion.value.distance,p.offset=new c.Vector3(S.x+(T.x-S.x)*B,S.y+(T.y-S.y)*B,S.z+(T.z-S.z)*B);for(var L=[],k=[],O=0,D=this.locationMotion.keyframes;O<D.length;O++){var N=D[O],X=N.key,K=N.progress;X!==void 0&&(L.push(X),K>this.locationMotion.progress&&k.push(X))}for(var Q=0,G=Object.keys(this.panoResources);Q<G.length;Q++){var J=G[Q];if(!(k.indexOf(J)>=0)){var H=this.panoResources[J];if(H.panoPicture){var j=H.panoPicture.map,Z=H.panoPicture.luminanceMap;if(j){if(j===((a=y.pano0)===null||a===void 0?void 0:a.map)||j===((o=y.pano1)===null||o===void 0?void 0:o.map))continue;j instanceof De&&j.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(j.cubeRenderTarget),j.dispose(),Z&&(Z instanceof De&&Z.cubeRenderTarget&&this.luminanceCubeRenderTargetPool.push(Z.cubeRenderTarget),Z.dispose()),H.panoPicture=null}}L.indexOf(J)>=0||delete this.panoResources[J]}}this.currentPano=pt(P.panoId),this.emit("pano.moving",W("pano.moving",{userAction:this.userAction,prevPano:pt(g.panoId),state:F(F(F(F({},pt(x.panoId)),{mode:this.mode}),_e(this.camera.pose)),p),options:{},progress:this.locationMotion.progress,error:null}))}Nt(y)===!1&&(!((s=y.pano0)===null||s===void 0)&&s.map&&y.pano0.map instanceof De&&!y.pano0.map.cubeRenderTarget&&(y.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((l=y.pano0)===null||l===void 0)&&l.luminanceMap&&y.pano0.luminanceMap instanceof De&&!y.pano0.luminanceMap.cubeRenderTarget&&(y.pano0.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),!((u=y.pano1)===null||u===void 0)&&u.map&&y.pano1.map instanceof De&&!y.pano1.map.cubeRenderTarget&&(y.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((d=y.pano1)===null||d===void 0)&&d.luminanceMap&&y.pano1.luminanceMap instanceof De&&!y.pano1.luminanceMap.cubeRenderTarget&&(y.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.models.setMaterial(y)),p.offset&&this.camera.position.copy(p.offset),_t(this.currentPano,v)&&this.updatePanoMeshesVisible();var Y=this.camera.pose.longitude,pe=this.camera.pose.latitude;this.camera.quaternion.fromArray(this.cardboard.sensor.getOrientation()),this.camera.computePose();var ee=this.works.getResolvedObserver(this.currentPano);if(this.camera.pose.distance>.1||b)for(var oe=0,ie=Object.keys(this.panoMeshes);oe<ie.length;oe++){var ce=ie[oe],ne=this.panoMeshes[ce];ne.setOpacity(0),ne.updateTime&&ne.updateTime(e,r),ne.visible=!1}else if(ee)for(var ae=ee.visibleIds.concat(Ue(this.currentPano)),de=0,ve=ae;de<ve.length;de++){var ce=ve[de],xe=pt(ce),Ce=this.works.getResolvedObserver(xe);if(Ce){var ne=this.panoMeshes[ce];if(!Ce.loadable&&!Ce.active){ne.setOpacity(0);continue}var Be=ne.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);Be<.05?ne.setOpacity(0):ne.setOpacity(he(1.5/Be,0,1)),_t(this.currentPano,xe)&&ne.setOpacity(0),ne.lookAt(this.camera.position)}}if(this.locationMotion.ended)for(var $=this.intersect(e),te=0,U=this.works.resolvedObservers;te<U.length;te++){var Ce=U[te],ne=this.panoMeshes[Ce.panoId];ne&&(ne.setCurrent(ne===$),ne.updateTime&&ne.updateTime(e,r))}(Y!==this.camera.pose.longitude||pe!==this.camera.pose.latitude)&&(this.cameraMotion.set(Cr(this.camera.pose,["longitude","latitude"]),0).catch(z),this.emit("camera.update",W("camera.update",{userAction:!0,state:F(F(F({},this.currentPano),{mode:this.mode}),_e(this.camera.pose))})));var Le=this.tileLevel=function(){if(i.tileLevelForFov===!1)return 0;var ye=i.renderer.getDrawingBufferSize(new c.Vector2);ye.width*=i.scissor.width,ye.height*=i.scissor.height;var ge=x.panoId,me=i.works.getResolvedObserver(ge),Ae=i.imageOptions.size;if(typeof Ae=="undefined"&&me){var Ne=me.images.up.match(/\/cube_(\d+)\//);Ne&&(Ae=Number(Ne[1]))}typeof Ae=="undefined"&&(Ae=2048);var ze=0;Ae>=1024&&(ze=1),Ae>=2048&&(ze=2),Ae>=4096&&(ze=3),Ae>=8192&&(ze=4);var je=i.tileLevelForFov(i.camera.fov,ye);return je>ze?je:0}(),Pe=function(){var ye=i.camera.quaternion.clone(),ge=i.works.getResolvedObserver(x.panoId),me=ge!=null?ge:ee;me&&ye.premultiply(me.quaternion.clone().inverse());var Ae=new c.Matrix4().makeRotationFromQuaternion(ye),Ne=new c.Matrix4().getInverse(Ae),ze=new c.Frustum().setFromProjectionMatrix(new c.Matrix4().multiplyMatrices(i.camera.projectionMatrix,Ne));return ze}();x.panoId===Ue(this.currentPano)&&(((f=x.panoPicture)===null||f===void 0?void 0:f.map)instanceof De&&(x.panoPicture.map.maxRequest=this.tileMaxRequest,x.panoPicture.map.update(Pe,Le),x.panoPicture.map.needsRender===!0&&(x.panoPicture.map.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)),((A=x.panoPicture)===null||A===void 0?void 0:A.luminanceMap)instanceof De&&(x.panoPicture.luminanceMap.maxRequest=this.tileMaxRequest,x.panoPicture.luminanceMap.update(Pe,Le),x.panoPicture.luminanceMap.needsRender===!0&&(x.panoPicture.luminanceMap.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)));{var Ie=this.tiling.object.visible;if(this.initAnimationed){var Qe=x.panoId,be=this.works.getResolvedObserver(Qe);be?Zn(this.camera.position,be.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==Qe&&this.tiling.cleanup(),this.tiling.panoId=Qe,this.tiling.setResource((h=(m=be.images)===null||m===void 0?void 0:m.tiles)!==null&&h!==void 0?h:[],this.enableIOSEDR&&be.images.luminance?be.images.luminance:null),this.tiling.setFetcher(it(be.work)),this.tiling.setRotation(be.quaternion),this.tiling.setPosition(be.position),this.tiling.maxRequest=this.tileMaxRequest,Le>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update(Pe,Le,e):this.tiling.update(Pe,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;Ie!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0,this.modelSceneNeedsRender=!0)}this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e)}},t.prototype.render=function(){this.cardboard.render(this.modelScene,this.camera),this.renderer.autoClear=!1,this.cardboard.render(this.scene,this.camera),this.renderer.autoClear=!0},t.prototype.setCamera=function(e){},t.prototype.destroyHelper=function(){},t.prototype.setHelperElementSize=function(){if(this.helperElement){var e=new c.Vector2(this.element.offsetWidth,this.element.offsetHeight),r=e.x*this.scissor.left,i=e.y*(1-this.scissor.bottom-this.scissor.height),a=e.x*this.scissor.width,o=e.y*this.scissor.height;this.helperElement.style.marginLeft=r+"px",this.helperElement.style.marginTop=i+"px",this.helperElement.style.width=a+"px",this.helperElement.style.height=o+"px"}},t.prototype.intersect=function(e){var r,i;if(this.locationMotion.ended===!1){this.intersectMesh.visible=!1,delete this.activePanoMesh,delete this.activeTime;return}if(this.activePanoMesh&&this.activeTime&&e-this.activeTime>bp){for(var a=this.activePanoMesh,o=Object.keys(this.panoMeshes),s=null,l=0,u=o;l<u.length;l++){var d=u[l];if(this.panoMeshes[d]===a){s=d;break}}return s!==null&&this.moveToPano(pt(s),{},!0),delete this.activePanoMesh,delete this.activeTime,a}var f=this.camera.getDirection(new c.Vector3),A=new c.Raycaster(this.camera.position,f);A.params.Points={threshold:.1};for(var m=void 0,h=[],v=this.works.getResolvedObserver(this.currentPano),y=v?v.visibleIds:[],p=0,g=y;p<g.length;p++){var s=g[p],x=this.panoMeshes[s],b=A.intersectObject((r=x.hitTestMesh)!==null&&r!==void 0?r:x,!0)[0];b&&h.push({panoMesh:x,intersection:F({floor:(i=v==null?void 0:v.floorIndex)!==null&&i!==void 0?i:0},b)})}var w=h.sort(function(S,T){return S.intersection.distance-T.intersection.distance})[0];w?(m=w.intersection,this.activePanoMesh!==w.panoMesh&&(this.activePanoMesh=w.panoMesh,this.activeTime=e),this.intersectMesh.position.copy(w.panoMesh.position),this.intersectMesh.lookAt(this.camera.position)):(this.activePanoMesh=void 0,this.activeTime=void 0),m||(m=this.models.intersectRaycaster(A)[0]);var E=W("intersect.update",{raycaster:A,intersection:m!=null?m:null,object:this.intersectMesh});if(this.emit("intersect.update",E),E.defaultPrevented){this.hideIntersectMesh();return}if(m&&m.face){var M=m.face.normal,C=new c.Quaternion;C.setFromUnitVectors(new c.Vector3(0,0,1),M),this.intersectMesh.quaternion.copy(C);var P=m.point.clone();this.intersectMesh.position.copy(P),w?this.intersectMesh.visible=!1:this.intersectMesh.visible=!0}else this.intersectMesh.visible=!1;return w==null?void 0:w.panoMesh},t.prototype.onPanGesture=function(){},t.prototype.onTapGesture=function(){},t.prototype.onPinchGesture=function(){},t.prototype.onMouseMove=function(){},t.prototype.onMouseOut=function(){},t}(mo),wp=new c.Vector3(0,1.6,0),Ep=function(n){ue(t,n);function t(e){var r=this,i,a=t.parseArgs(e);return r=n.call(this,a)||this,r.mode="Model",r.locationMotion=new Se({x:r.camera.pose.offset.x,y:r.camera.pose.offset.y,z:r.camera.pose.offset.z,distance:r.camera.pose.distance}),r.modelAlphaMotion=new Se({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new Se({perspToOrtho:r.camera.perspToOrtho.x}),r}return t.parseArgs=function(e){return e instanceof t?e:n.parseArgs.call(this,e)},t.initAnimationEndState=function(e){var r,i,a,o,s,l,u=this.parseArgs(e),d=u.works,f=e.initial,A=f.state,m=f.currentState,h=typeof A.panoIndex=="number"?{workCode:(a=(r=A.workCode)!==null&&r!==void 0?r:(i=u.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:A.panoIndex}:{workCode:m.workCode,panoIndex:m.panoIndex},v=d.getResolvedObserver(h),y=(o=A.longitude)!==null&&o!==void 0?o:m.longitude,p=he((s=A.latitude)!==null&&s!==void 0?s:!v||Jn(m.mode)?m.latitude:u.defaultLatitude,u.minLatitude,u.maxLatitude),g=he((l=A.fov)!==null&&l!==void 0?l:!v||Jn(m.mode)?m.fov:u.defaultFov,u.minFov,u.maxFov),x=new c.Vector3;if(u.initial.state.offset)x.copy(u.initial.state.offset);else if(v)x.copy(v.position);else{var b=Ft(m).setLength(m.distance);x.copy(u.initial.currentState.offset).sub(b)}return{workCode:h.workCode,panoIndex:h.panoIndex,mode:"Model",longitude:y,latitude:p,fov:g,offset:x,distance:0}},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.locationMotion.dispose()},t.prototype.isReady=function(){return this.locationMotion.ended!==!1},t.prototype.updateWork=function(e,r,i,a){this.works=e;var o=t.initAnimationEndState(F(F({},this),{initial:{currentState:F(F({},this.currentPano),this.camera.pose),duration:i.duration,effect:i.effect,state:r,userAction:a}}));return this.hideIntersectMesh(),this.moveToPosition(o.offset,{duration:0,longitude:o.longitude,latitude:o.latitude,fov:o.fov},a),!0},t.prototype.updateCamera=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();var o={},s={};return o.distance=0,e.offset!==void 0&&(o.x=e.offset.x,o.y=e.offset.y,o.z=e.offset.z),e.longitude!==void 0&&(s.longitude=e.longitude),e.latitude!==void 0&&(s.latitude=e.latitude),e.fov!==void 0&&(s.fov=e.fov),a.locationMotion.set(o,r).catch(z),a.cameraMotion.set(s,r).catch(z)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();for(var o=[],s=[],l=0,u=e;l<u.length;l++){var d=u[l];o.push({key:d.key,progress:d.progress,value:{distance:0,x:d.value.offset.x,y:d.value.offset.x,z:d.value.offset.x}}),s.push({key:d.key,progress:d.progress,value:{longitude:d.value.longitude,latitude:d.value.latitude,fov:d.value.fov}})}return a.locationMotion.setKeyframes(o,r).catch(z),a.cameraMotion.setKeyframes(e,r)})},t.prototype.updateTime=function(e,r){if(!this.destroyed){var i={},a={};if(this.modelAlphaMotion.ended||(this.modelAlphaMotion.update(e),i.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended||(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(he(this.perspToOrthoMotion.value.perspToOrtho,0,1))),!this.locationMotion.ended){this.locationMotion.update(e),a.distance=this.locationMotion.value.distance,a.offset=new c.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z);var o=new c.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),s=this.works.resolvedObservers,l=ur(s,function(u){return u.position.distanceTo(o)});this.currentPano=l?{workCode:l.work.workCode,panoIndex:l.panoIndex}:{workCode:"",panoIndex:0}}this.cameraMotion.ended||(this.cameraMotion.update(e),a.longitude=this.cameraMotion.value.longitude,a.latitude=this.cameraMotion.value.latitude,a.fov=this.cameraMotion.value.fov),Nt(i)||this.models.setMaterial(i),Nt(a)||this.setCamera(a)}},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var i=e.initial;i.state,i.currentState;var a=i.duration,o=i.userAction;e.userAction=o;var s=t.initAnimationEndState(e),l={modelAlpha:1},u={perspToOrtho:0},d={longitude:s.longitude,latitude:s.latitude,fov:s.fov,duration:a,moveStartCallback:function(f){e.perspToOrthoMotion.set(u,a).catch(z),e.modelAlphaMotion.set(l,a).catch(z),e.emit("initAnimation.start",W("initAnimation.start",{state:f,userAction:e.userAction}))},moveEndCallback:function(f){e.emit("initAnimation.end",W("initAnimation.end",{state:f,userAction:e.userAction})),r()},moveCancelCallback:function(){var f=e.currentPano,A=F(F({},f),{mode:e.mode,longitude:e.camera.pose.longitude,latitude:e.camera.pose.latitude,fov:e.camera.pose.fov,offset:e.camera.pose.offset.clone(),distance:e.camera.pose.distance});e.emit("initAnimation.end",W("initAnimation.end",{state:A,userAction:e.userAction})),r()}};e.moveToPosition(s.offset,d,o)})},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(Me())[1],r=this.locationMotion.getKeyFrameSegment(Me())[1];return F(F({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:new c.Vector3(r.value.x,r.value.y,r.value.z),distance:r.value.distance})},t.prototype.moveToPano=function(e,r,i){r===void 0&&(r={});var a=this.works.getResolvedObserver(e);a&&this.moveToPosition(a.position,r,i)},t.prototype.moveToPosition=function(e,r,i){var a=this,o,s,l;r===void 0&&(r={}),this.userAction=i,this.stopMomentumMovement();for(var u=Me(),d=new c.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),f=d.distanceTo(e),A=this.locationMotion.getProgressVelocity(u),m=0,h=1;h<this.locationMotion.keyframes.length;h++){var v=this.locationMotion.keyframes[h-1].value,y=v.x,p=v.y,g=v.z,x=this.locationMotion.keyframes[h].value,b=x.x,w=x.y,E=x.z;m+=Math.sqrt(Math.pow(b-y,2)+Math.pow(w-p,2)+Math.pow(E-g,2))}var M=f===0?0:A*m/f,C=this.calculateMovingDuration(r.duration,f),P={x:e.x,y:e.y,z:e.z,distance:0},S={longitude:r.longitude,latitude:r.latitude,fov:r.fov},T=this.works.resolvedObservers,B=ur(T,function(D){return D.position.distanceTo(d)}),L=B?{workCode:B.work.workCode,panoIndex:B.panoIndex}:{workCode:"",panoIndex:0},k=F(F({},L),{mode:this.mode,longitude:(o=S.longitude)!==null&&o!==void 0?o:this.camera.pose.longitude,latitude:(s=S.latitude)!==null&&s!==void 0?s:this.camera.pose.latitude,fov:(l=S.fov)!==null&&l!==void 0?l:this.camera.pose.fov,offset:e.clone(),distance:0}),O=this.currentPano;this.emit("pano.moveTo",W("pano.moveTo",{options:r,prevPano:O,progress:0,state:k,userAction:this.userAction,error:null})),r.moveStartCallback&&r.moveStartCallback(k),this.cameraMotion.set(S,C).catch(z),this.locationMotion.set(P,C,M).then(function(){for(var D=0,N=a.models;D<N.length;D++){var X=N[D];X.show()}var K=F(F(F({},L),{mode:a.mode}),_e(a.camera.pose));a.emit("pano.arrived",W("pano.arrived",{options:r,prevPano:O,progress:0,state:K,userAction:a.userAction,error:null})),r.moveEndCallback&&r.moveEndCallback(K)},function(){r.moveCancelCallback&&r.moveCancelCallback(),a.emit("pano.cancel",W("pano.cancel",{options:r,prevPano:O,progress:0,state:k,userAction:a.userAction,error:null}))})},t.prototype.onTapGesture=function(e){var r=e.center.raycaster;this.stopMomentumMovement();var i=this.models.intersectRaycaster(r)[0];if(i&&i.face){var a=i.face.normal,o=i.point;if(new c.Vector3(0,1,0).angleTo(a)>Math.PI/3){var s=a.clone().setLength(.3).add(o);r.set(s,new c.Vector3(0,-1,0)),i=this.models.intersectRaycaster(r)[0]}}if(i){var l=new c.Vector3().copy(i.point).add(wp),u=this.works.resolvedObservers,d=ur(u,function(m){return m.position.distanceTo(l)},!0),f=d[0],A=d[1];f&&A<5&&(l.y=f.position.y),e.state.offset.copy(l),e.state.distance=0,this.emit("gesture.tap",e),e.defaultPrevented||this.moveToPosition(l,{},!0)}else this.emit("gesture.tap",e),e.defaultPrevented||this.cameraBounce()},t}(gu);const Cp=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}(`}rpvv|{-zrqvz}-sy|nH}rpvv|{-zrqvz}-v{Hnvor-rp@-}|vv|{Hnvor-rp?-H{vs|z-znA-}|wrpv|{Znv\x07H{vs|z-znA-z|qrycvrZnv\x07Hn\bv{t-rp?-bH|vq-znv{56-
|
|
1850
|
+
b-J-HrpA-z]|vv|{-J-z|qrycvrZnv\x07-7-rpA5}|vv|{9>;=6Htyl]|vv|{-J-}|wrpv|{Znv\x07-7-z]|vv|{H\f`),Mp=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}(`0r\x07r{v|{-TYlRealsntlqr}u-G-r{noyr<<<<-nqn}rq-s|z-ur-RQY-unqr-p|qr-s|z-Puvvn{-O|pur{\b-v{-py|q-p|z}nrG<<-u}G<<tvuo;p|z<py|qp|z}nr<{x<rr<znr<}ytv{<\0RQY<unqr<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A5=;=9-=;=9-:qy9->;=6H----sy|n-} -J-q}; -<-q};H----sy|n-sntQr}u-J-5} -8->;=6-<-?;=H----<<-tylSntQr}uRea-J-sntQr}uH--\f--vs5qr}u-JJ-=;=6
|
|
1858
|
-
----qvpnqH--\f\f`);var
|
|
1859
|
-
`,e},t.prototype.updateShaderSource=function(){var e=this.getDefines()+
|
|
1858
|
+
----qvpnqH--\f\f`);var Sp=function(n){ue(t,n);function t(e){var r=n.call(this)||this;return r.uniforms={screenWidth:Tt("f",0),screenHeight:Tt("f",0),edlStrength:Tt("f",1),uNear:Tt("f",1),uFar:Tt("f",1),radius:Tt("f",1),neighbours:Tt("2fv",new Float32Array),depthMap:Tt("t",new c.Texture),uEDLColor:Tt("t",new c.Texture),uEDLDepth:Tt("t",new c.Texture),opacity:Tt("f",1),uProj:Tt("Matrix4fv",new Float32Array)},r.neighbourCount=8,r.updateShaderSource(),r.transparent=!0,r}return t.prototype.getUniform=function(e){return this.uniforms===void 0?void 0:this.uniforms[e].value},t.prototype.setUniform=function(e,r){if(this.uniforms!==void 0){var i=this.uniforms[e];i.value=r}},t.prototype.getDefines=function(){var e="";return e+="#define NEIGHBOUR_COUNT "+this.neighbourCount+`
|
|
1859
|
+
`,e},t.prototype.updateShaderSource=function(){var e=this.getDefines()+Cp,r=this.getDefines()+Mp;this.setValues({vertexShader:e,fragmentShader:r}),this.needsUpdate=!0},Ct([Kt("screenWidth"),Mt("design:type",Number)],t.prototype,"screenWidth",void 0),Ct([Kt("screenHeight"),Mt("design:type",Number)],t.prototype,"screenHeight",void 0),Ct([Kt("edlStrength"),Mt("design:type",Number)],t.prototype,"edlStrength",void 0),Ct([Kt("uNear"),Mt("design:type",Number)],t.prototype,"uNear",void 0),Ct([Kt("uFar"),Mt("design:type",Number)],t.prototype,"uFar",void 0),Ct([Kt("radius"),Mt("design:type",Number)],t.prototype,"radius",void 0),Ct([Kt("neighbours",!0),Mt("design:type",Float32Array)],t.prototype,"neighbours",void 0),Ct([Kt("depthMap"),Mt("design:type",c.Texture)],t.prototype,"depthMap",void 0),Ct([Kt("uEDLColor"),Mt("design:type",c.Texture)],t.prototype,"uEDLColor",void 0),Ct([Kt("uEDLDepth"),Mt("design:type",c.Texture)],t.prototype,"uEDLDepth",void 0),Ct([Kt("uProj"),Mt("design:type",Array)],t.prototype,"uProj",void 0),t}(c.RawShaderMaterial);function Tt(n,t){return{type:n,value:t}}function Kt(n,t){return t===void 0&&(t=!1),function(e,r){Object.defineProperty(e,r,{get:function(){return this.getUniform(n)},set:function(i){i!==this.getUniform(n)&&(this.setUniform(n,i),t&&this.updateShaderSource())}})}}var Ip=new c.OrthographicCamera(-1,1,1,-1,0,1),go=new c.BufferGeometry;go.setAttribute("position",new c.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));go.setAttribute("uv",new c.Float32BufferAttribute([0,2,0,0,2,0],2));var Cu=new c.Mesh(go),Mu=new c.Scene;Mu.add(Cu);var Tp=function(n){ue(t,n);function t(e,r,i,a){var o=n.call(this,e,r,i,a)||this;return o.sharedV2=new c.Vector2,o.renderer=e,o.material=new Sp,Cu.material=o.material,o.material.needsUpdate=!0,o}return t.prototype.render=function(e){this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0,this.renderer.setRenderTarget(e[0]),this.renderer.render(this.scene,this.camera);var r=this.camera,i=this.material.uniforms,a=this.renderer.getSize(this.sharedV2);i.screenWidth.value=a.x,i.screenHeight.value=a.y;var o=r.projectionMatrix,s=new Float32Array(16);s.set(o.elements);for(var l=new Float32Array(this.material.neighbourCount*2),u=0;u<this.material.neighbourCount;u++)l[2*u+0]=Math.cos(2*u*Math.PI/this.material.neighbourCount),l[2*u+1]=Math.sin(2*u*Math.PI/this.material.neighbourCount);i.neighbours.value=l,i.uNear.value=r.near,i.uFar.value=r.far,i.uEDLColor.value=e[0].texture,i.uProj.value=s,i.edlStrength.value=.25,i.radius.value=1,i.opacity.value=1,this.renderer.setRenderTarget(e[1]),this.renderer.render(Mu,Ip)},t.prototype.dispose=function(){this.copyPass.dispose()},t}(vo);const Pp=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}(`}rpvv|{-zrqvz}-sy|nH}rpvv|{-zrqvz}-v{H{vs|z-nz}yr?Q-drvtuZn}H{vs|z-nz}yr?Q-Qr}uZn}Hn\bv{t-rp?-bH|vq-znv{56-
|
|
1860
1860
|
sy|n-qr}u-J-r\x07r?Q5Qr}uZn}9-b6;Hvs5qr}u-KJ->;=6
|
|
1861
|
-
qvpnqH\frpA-p|y|-J-r\x07r?Q5drvtuZn}9-b6H-p|y|-J-p|y|-<-p|y|;HtylSntP|y|-J-rpA5p|y|;\x07\b 9->;=6H-\f`),
|
|
1862
|
-
b-J-Htyl]|vv|{-J-}|wrpv|{Znv\x07-7-z|qrycvrZnv\x07-7-rpA5}|vv|{9>;=6H\f`);var Bp=function(n){ue(t,n);function t(e){var r=n.call(this,{vertexShader:Pp,fragmentShader:Tp})||this;return r.uniforms={uDepthMap:Ds("t",null),uWeightMap:Ds("t",null)},r.depthTest=!0,r.depthWrite=!0,r.opacity=1,r}return t.prototype.getUniform=function(e){return this.uniforms===void 0?void 0:this.uniforms[e].value},t.prototype.setUniform=function(e,r){if(this.uniforms!==void 0){var i=this.uniforms[e];i.value=r}},Ct([zs("uDepthMap"),Mt("design:type",Number)],t.prototype,"uDepthMap",void 0),Ct([zs("uWeightMap"),Mt("design:type",Number)],t.prototype,"uWeightMap",void 0),t}(c.RawShaderMaterial);function Ds(n,t){return{type:n,value:t}}function zs(n,t){return t===void 0&&(t=!1),function(e,r){Object.defineProperty(e,r,{get:function(){return this.getUniform(n)},set:function(i){i!==this.getUniform(n)&&(this.setUniform(n,i),t&&this.updateShaderSource())}})}}var Rp=new c.OrthographicCamera(-1,1,1,-1,0,1),go=new c.BufferGeometry;go.setAttribute("position",new c.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));go.setAttribute("uv",new c.Float32BufferAttribute([0,2,0,0,2,0],2));var Mu=new c.Mesh(go),Su=new c.Scene;Su.add(Mu);var kp=function(n){ue(t,n);function t(e,r,i,a){var o=n.call(this,e,r,i,a)||this;return o.sharedV2=new c.Vector2,o.renderer=e,o.material=new Bp,o.camera=i,Mu.material=o.material,o}return t.prototype.render=function(e){this.models.setMaterial({useHQDepth:!0,useHQWeight:!1}),this.models.update(this.renderer,this.camera,"Mapview"),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0,this.renderer.setRenderTarget(e[0]),this.renderer.render(this.scene,this.camera),this.models.setMaterial({useHQWeight:!0,useHQDepth:!1}),this.models.update(this.renderer,this.camera,"Mapview"),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.renderer.setClearColor(new c.Color(0,0,0)),this.renderer.setClearAlpha(0),this.renderer.setRenderTarget(e[1]),this.renderer.render(this.scene,this.camera),this.material.uniforms.uWeightMap.value=e[1].texture,this.material.uniforms.uDepthMap.value=e[0].depthTexture,this.renderer.autoClearDepth=!0,this.renderer.autoClearColor=!0,this.renderer.setClearColor(new c.Color(0,0,0)),this.renderer.setClearAlpha(1),this.renderer.setRenderTarget(e[2]),this.renderer.render(Su,Rp)},t.prototype.dispose=function(){this.copyPass.dispose()},t}(po),ma=.5,ga=0,Qs=Math.PI/9,Fp=function(n){ue(t,n);function t(e){var r=this,i,a=t.parseArgs(e);return r=n.call(this,a)||this,r.mode="Mapview",r.defaultLongitude=a.defaultLongitude,r.defaultLatitude=a.defaultLatitude,r.defaultDistance=a.defaultDistance,r.maxLatitude=a.maxLatitude,r.minLatitude=a.minLatitude,r.cameraType=a.cameraType,r.modelInScreen=a.modelInScreen,r.locationMotion=new Se({x:r.camera.pose.offset.x,y:r.camera.pose.offset.y,z:r.camera.pose.offset.z,distance:r.camera.pose.distance}),r.modelAlphaMotion=new Se({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new Se({perspToOrtho:r.camera.perspToOrtho.x}),r.intersectMeshCreator=a.intersectMeshCreator,r.intersectMesh=r.intersectMeshCreator(),r.intersectMesh.name="intersect",r.intersectMesh.visible=!1,r.currentTapId=null,r.helper.add(r.intersectMesh),r.edlTarget=new c.WebGLRenderTarget(1024,1024,{minFilter:c.NearestFilter,magFilter:c.NearestFilter,format:c.RGBAFormat,type:c.FloatType,depthTexture:new c.DepthTexture(1024,1024,c.UnsignedIntType)}),r.edlEffect=new Ip(r.renderer,r.modelScene,r.camera,r.models),r.hqEffect=new kp(r.renderer,r.modelScene,r.camera,r.models),r}return t.parseArgs=function(e){var r,i,a,o,s,l,u,d;if(e instanceof t)return e;var f=n.parseArgs.call(this,e);return F(F({},f),{defaultLongitude:(r=e.defaultLongitude)!==null&&r!==void 0?r:Math.PI/4,defaultLatitude:(i=e.defaultLatitude)!==null&&i!==void 0?i:Math.PI/4,defaultDistance:(a=e.defaultDistance)!==null&&a!==void 0?a:150,maxLatitude:(o=e.maxLatitude)!==null&&o!==void 0?o:+Math.PI/2,minLatitude:(s=e.minLatitude)!==null&&s!==void 0?s:0,cameraType:(l=e.cameraType)!==null&&l!==void 0?l:"auto",modelInScreen:(u=e.modelInScreen)!==null&&u!==void 0?u:"boundingbox-center",intersectMeshCreator:(d=e.intersectMeshCreator)!==null&&d!==void 0?d:function(){return new Li}})},t.distanceFromModel=function(e,r,i){var a=e.bounding,o=Math.pow(Math.pow(a.max.x-a.min.x+1,2)+Math.pow(a.max.y-a.min.y+1,2)+Math.pow(a.max.z-a.min.z+1,2),1/2),s=o/2/Math.tan(Math.PI*r/360);return i<1&&(s=s/i),isNaN(s)?o:s},t.initAnimationEndState=function(e){var r,i,a,o,s,l,u,d=this.parseArgs(e),f=d.works,A=d.models,m=e.initial,h=m.state,v=m.currentState,y=typeof h.panoIndex=="number"?{workCode:(a=(r=h.workCode)!==null&&r!==void 0?r:(i=d.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:h.panoIndex}:{workCode:v.workCode,panoIndex:v.panoIndex},p=f.getResolvedObserver(y),g=(o=h.fov)!==null&&o!==void 0?o:60,x=he((s=h.latitude)!==null&&s!==void 0?s:Na(v.mode)?v.latitude:d.defaultLatitude,d.minLatitude,d.maxLatitude),b=t.distanceFromModel(d.models,g,d.camera.aspect),w=new c.Vector3,E=(l=h.distance)!==null&&l!==void 0?l:Math.min(d.defaultDistance,b),M=(u=h.longitude)!==null&&u!==void 0?u:Na(v.mode)?v.longitude:d.defaultLongitude;return h.offset?w.copy(h.offset):d.defaultDistance<b&&p?(w.copy(p.position),h.longitude===void 0&&(M=v.longitude)):w.copy(A.bounding.getCenter(w)),A.bounding.containsPoint(w)||A.bounding.getCenter(w),F(F({},y),{mode:"Mapview",longitude:M,latitude:x,fov:g,offset:w,distance:E})},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.locationMotion.dispose(),delete this.panState,this.intersectMesh.dispose(),this.helper.remove(this.intersectMesh)},t.prototype.isReady=function(){return this.locationMotion.ended===!1?!1:n.prototype.isReady.call(this)},t.prototype.updateWork=function(e,r,i,a){this.userAction=a,this.works=e;var o=t.initAnimationEndState(F(F({},this),{initial:{currentState:F(F({},this.currentPano),this.camera.pose),duration:i.duration,effect:i.effect,state:r,userAction:a}}));this.currentPano={workCode:o.workCode,panoIndex:o.panoIndex};var s={longitude:o.longitude,latitude:o.latitude,fov:o.fov},l={x:o.offset.x,y:o.offset.y,z:o.offset.z,distance:o.distance,orthoDistance:o.distance};return this.locationMotion.set(l,i.duration).catch(z),this.cameraMotion.set(s,i.duration).catch(z),!0},t.prototype.updateModel=function(e){n.prototype.updateModel.call(this,e)},t.prototype.updateCamera=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();var o={},s={};return e.distance!==void 0&&(o.distance=e.distance),e.offset!==void 0&&(o.x=e.offset.x,o.y=e.offset.y,o.z=e.offset.z),e.longitude!==void 0&&(s.longitude=e.longitude),e.latitude!==void 0&&(s.latitude=e.latitude),e.fov!==void 0&&(s.fov=e.fov),a.locationMotion.set(o,r).catch(z),a.cameraMotion.set(s,r).catch(z)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();for(var o=[],s=[],l=0,u=e;l<u.length;l++){var d=u[l];o.push({key:d.key,progress:d.progress,value:{distance:d.value.distance,x:d.value.offset.x,y:d.value.offset.x,z:d.value.offset.x}}),s.push({key:d.key,progress:d.progress,value:{longitude:d.value.longitude,latitude:d.value.latitude,fov:d.value.fov}})}return a.locationMotion.setKeyframes(o,r).catch(z),a.cameraMotion.setKeyframes(e,r)})},t.prototype.updateTime=function(e,r){if(!this.destroyed){var i={},a={};this.locationMotion.ended||(this.locationMotion.update(e),a.distance=this.locationMotion.value.distance,a.offset=new c.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z)),this.cameraMotion.ended||(this.cameraMotion.update(e),a.longitude=this.cameraMotion.value.longitude,a.latitude=this.cameraMotion.value.latitude,a.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended||(this.modelAlphaMotion.update(e),i.modelAlpha=this.modelAlphaMotion.value.modelAlpha);var o=0;this.cameraType==="auto"?o=Math.PI/2-this.cameraMotion.value.latitude<.02?1:0:this.cameraType==="perspective"?o=0:this.cameraType==="orthographic"&&(o=1),this.perspToOrthoMotion.getTargetKeyframe().value.perspToOrtho!==o&&this.perspToOrthoMotion.set({perspToOrtho:o},500).catch(z),this.perspToOrthoMotion.ended||(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(he(this.perspToOrthoMotion.value.perspToOrtho,0,1))),Nt(i)||this.models.setMaterial(i),Nt(a)||this.setCamera(a)}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(Me())[1],r=this.locationMotion.getKeyFrameSegment(Me())[1];return F(F({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,distance:r.value.distance,offset:new c.Vector3(r.value.x,r.value.y,r.value.z)})},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var i=e.initial;i.state,i.currentState;var a=i.duration,o=i.userAction;e.userAction=o;var s=t.initAnimationEndState(e),l={longitude:s.longitude,latitude:s.latitude,fov:s.fov},u={x:s.offset.x,y:s.offset.y,z:s.offset.z,distance:s.distance},d={modelAlpha:1},f={perspToOrtho:0};e.emit("initAnimation.start",W("initAnimation.start",{state:s,userAction:e.userAction})),e.perspToOrthoMotion.set(f,a).catch(z),e.modelAlphaMotion.set(d,a/3).catch(z),e.cameraMotion.set(l,a).catch(z),e.locationMotion.set(u,a).then(function(){e.emit("initAnimation.end",W("initAnimation.end",{state:s,userAction:e.userAction}))},function(A){var m=F(F(F({},e.currentPano),{mode:e.mode}),_e(e.camera.pose));e.emit("initAnimation.end",W("initAnimation.end",{state:m,userAction:e.userAction}))}).then(function(){r()})})},t.prototype.getForwardObserverOrNot=function(e){var r=this.models.intersectRaycaster(e)[0];if(!r)return null;var i=this.works.resolvedObservers,a=ur(i,function(l){return l.standingPosition.distanceTo(r.point)},!0),o=a[0],s=a[1];return o&&s<10?o:null},t.prototype.coordinatesForOffset=function(e){var r=this.renderer.getSize(new c.Vector2);return{longitude:-2*e.x/(r.x*this.scissor.width),latitude:2*e.y/(r.y*this.scissor.height)}},t.prototype.requestMomentumMovement=function(e,r,i,a){var o=this;if(this.inMomentumMovement!==null){for(var s=F({},i),l={longitude:0,latitude:0,x:0,y:0,z:0},u=0;u<a;u++)s.longitude*=.996,s.latitude*=.996*.998,s.x*=.99,s.y*=.99,s.z*=.99,l.longitude+=s.longitude,l.latitude+=s.latitude,l.x+=s.x,l.y+=s.y,l.z+=s.z;var d=Kr(this.cameraMotion.value.longitude+l.longitude),f=he(this.cameraMotion.value.latitude+l.latitude,this.minLatitude,this.maxLatitude),A=new c.Vector3(this.locationMotion.value.x+l.x,this.locationMotion.value.y+l.y,this.locationMotion.value.z+l.z);this.modelInScreen==="boundingbox-center"&&A.clamp(this.models.bounding.min,this.models.bounding.max);var m=F(F({},this.currentPano),{mode:this.mode,longitude:d,latitude:f,offset:A,fov:this.cameraMotion.value.fov,distance:this.camera.pose.distance}),h=!(Math.abs(s.longitude)>1e-4||Math.abs(s.latitude)>1e-4||Math.abs(s.x)>1e-4||Math.abs(s.y)>1e-4||Math.abs(s.z)>1e-4),v=W("gesture.momentum",F(F({},e),{isFirst:r,isFinal:h,state:m}));if(this.inMomentumMovement.event=v,this.emit("gesture.momentum",v),e.defaultPrevented){this.inMomentumMovement=null;return}this.inMomentumMovement&&(this.cameraMotion.set({longitude:d,latitude:f},0).catch(z),this.locationMotion.set({x:m.offset.x,y:m.offset.y,z:m.offset.z},0).catch(z),h?this.inMomentumMovement=null:vt.shared.add(function(y,p){o.requestMomentumMovement(e,!1,s,p|0)},!0,1))}},t.prototype.fixFinalState=function(e){if(this.perspToOrthoMotion.getTargetKeyframe().value.perspToOrtho!==1){var r=Ft(e,new c.Vector3),i=new c.Vector3().copy(e.offset).sub(r.clone().multiplyScalar(e.distance)),a=new c.Raycaster(i,r);a.params.Points={threshold:.1},a.near=ma;var o=this.models.intersectRaycaster(a)[0];if(!o&&a.ray.direction.y<-.3){var s=new c.Plane(new c.Vector3(0,1,0),-this.models.bounding.min.y),l=a.ray.intersectPlane(s,new c.Vector3);if(l){var u=l.distanceTo(a.ray.origin);u<1e4&&u>=a.near&&(o={distance:u,floor:0,point:l,object:this.scene,face:null})}}o&&(e.distance=he(o.distance,ga,1/0),e.offset.copy(i).add(r.clone().multiplyScalar(e.distance)))}},t.prototype.onPanGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var r=e.pointers.length,i=this.panState,a=0;e.pointerType==="mouse"&&(a=e.srcEvent.buttons),i&&a===0&&i.buttons!==0&&(a=i.buttons);var o=i==null?void 0:i.target;if(!o){var s=this.relativeClientPosition(e.center),l=new c.Raycaster;l.params.Points={threshold:.1},l.setFromCamera(s,this.camera),l.near=ma,o=new c.Vector3().copy(l.ray.direction).multiplyScalar(3).add(l.ray.origin);var u=this.models.intersectRaycaster(l)[0];if(!u&&l.ray.direction.y<-.3){var d=new c.Plane(new c.Vector3(0,1,0),0),f=l.ray.intersectPlane(d,new c.Vector3);if(f){var A=f.distanceTo(l.ray.origin);A<1e4&&A>=l.near&&(u={distance:A,floor:0,point:f,object:this.scene})}}if(u)o.copy(u.point);else{var m=new c.Vector3().copy(this.camera.pose.offset).sub(this.camera.position),d=new c.Plane().setFromNormalAndCoplanarPoint(m,this.camera.pose.offset);l.ray.intersectPlane(d,o)}}if(e.isFinal?delete this.panState:this.panState={target:o,buttons:a,pointerLength:r,x:e.center.x,y:e.center.y},!(typeof i=="undefined"||i.pointerLength!==r)){var h=r>1||a===2;if(h){var v={x:e.center.x-i.x,y:e.center.y-i.y},y=new c.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),p=Ft(this.cameraMotion.value).setLength(this.locationMotion.value.distance).add(y),g=new c.Vector3().copy(p).sub(i.target).length();g*=Math.tan(this.camera.pose.fov/2*Math.PI/180);var x=this.renderer.getSize(new c.Vector2),b=2*v.x*g/x.y,w=2*v.y*g/x.y,E=new c.Vector3;E.setFromMatrixColumn(this.camera.matrix,0),E.multiplyScalar(-b),y.add(E),this.camera.pose.latitude<Qs?E.setFromMatrixColumn(this.camera.matrix,1):(E.setFromMatrixColumn(this.camera.matrix,0),E.crossVectors(this.camera.up,E)),E.multiplyScalar(w),y.add(E),this.modelInScreen==="boundingbox-center"&&y.clamp(this.models.bounding.min,this.models.bounding.max);var M=F(F({},this.currentPano),{mode:this.mode,longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:y,distance:this.camera.pose.distance});if(e.state=M,this.emit("gesture.pan",e),e.defaultPrevented)return;if(this.locationMotion.set({x:M.offset.x,y:M.offset.y,z:M.offset.z},0).catch(z),e.isFinal&&(this.fixFinalState(M),this.locationMotion.set({distance:M.distance,x:M.offset.x,y:M.offset.y,z:M.offset.z},0).catch(z)),e.isFinal){var C=this.renderer.getSize(new c.Vector2),P=2*e.velocityX*g/C.y,S=2*e.velocityY*g/C.y,T=new c.Vector3,B=new c.Vector3;T.setFromMatrixColumn(this.camera.matrix,0),T.multiplyScalar(-P),B.add(T),this.camera.pose.latitude<Qs?T.setFromMatrixColumn(this.camera.matrix,1):(T.setFromMatrixColumn(this.camera.matrix,0),T.crossVectors(this.camera.up,T)),T.multiplyScalar(S),B.add(T),this.inMomentumMovement={uuid:wt()},this.requestMomentumMovement(e,!0,{longitude:0,latitude:0,x:B.x,y:B.y,z:B.z},0)}}else{var v={x:e.center.x-i.x,y:e.center.y-i.y},L=this.coordinatesForOffset(v),k=Kr(this.cameraMotion.value.longitude+L.longitude),O=he(this.cameraMotion.value.latitude+L.latitude,this.minLatitude,this.maxLatitude);this.camera.aspect<1&&Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(O=this.cameraMotion.value.latitude);var M=F(F({},this.currentPano),{mode:this.mode,longitude:k,latitude:O,fov:this.camera.pose.fov,offset:this.camera.pose.offset,distance:this.camera.pose.distance});if(e.isFinal&&this.fixFinalState(M),e.state=M,this.emit("gesture.pan",e),e.defaultPrevented)return;if(e.isFinal?this.locationMotion.set({distance:M.distance,x:M.offset.x,y:M.offset.y,z:M.offset.z},0).catch(z):this.cameraMotion.set({longitude:M.longitude,latitude:M.latitude},0).catch(z),e.isFinal){var D=e.velocityX,N=e.velocityY;this.inMomentumMovement={uuid:wt()},this.requestMomentumMovement(e,!0,F(F({},this.coordinatesForOffset({x:D,y:N})),{x:0,y:0,z:0}),0)}}}},t.prototype.onPinchGesture=function(e){var r;if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var i=(r=this.pinchState)===null||r===void 0?void 0:r.distance;if(e.isFirst){this.pinchState={x:e.center.x,y:e.center.y,scale:1,distance:this.locationMotion.value.distance};return}if(e.isFinal){delete this.panState,delete this.pinchState;return}if(typeof i!="undefined"){var a=this.models.bounding.getCenter(new c.Vector3),o=t.distanceFromModel(this.models,this.cameraMotion.value.fov,this.camera.aspect),s=he(i/e.scale,ga,1/0),l=e.state.offset.clone().sub(Ft(e.state).setLength(s)),u=this.models.bounding.containsPoint(l),d;!u&&this.pinchState&&this.pinchState.scale>e.scale&&a.distanceTo(l)>o?d=e.state.distance:(d=s,this.pinchState&&(this.pinchState.scale=e.scale)),e.state.distance=d,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.locationMotion.set({distance:e.state.distance},0).catch(z),e.pointerType!=="mouse"&&(e.type="gesture.pan",this.onPanGesture(e)))}}},t.prototype.onMouseMove=function(e){var r,i;if(this.intersectMesh.parent&&!this.panState&&!this.pinchState&&!this.mouseWheelState&&(this.emit("gesture.mousemove",e),!e.defaultPrevented)){var a=e.center.raycaster;if(a.near=ma,a.far=500,e.isFinal&&this.intersectMesh.parent&&this.intersectMesh.visible===!0){this.hideIntersectMesh();return}var o=this.models.intersectRaycaster(a)[0],s=W("intersect.update",{raycaster:a,intersection:o!=null?o:null,object:this.intersectMesh});if(this.emit("intersect.update",s),s.defaultPrevented){this.hideIntersectMesh();return}if(o){var l=(i=(r=o.face)===null||r===void 0?void 0:r.normal)!==null&&i!==void 0?i:new c.Vector3().copy(a.ray.direction).multiplyScalar(-1),u=l.clone(),d=o.point.clone();this.intersectMesh.position.copy(d);var f=d.clone().add(u);if(this.intersectMesh.lookAt(f),Math.abs(l.y)>.99){var A=this.camera.position.clone().sub(d);this.intersectMesh.rotation.z=-Math.atan2(A.z,A.x)}this.intersectMesh.visible=!0,this.needsRender=!0}else this.hideIntersectMesh()}},t.prototype.onMouseWheel=function(e){if(this.initAnimationIsReady)if(this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh(),e.isFinal){var r=e.state;if(this.fixFinalState(r),this.emit("gesture.mousewheel",e),e.defaultPrevented)return;var i={x:r.offset.x,y:r.offset.y,z:r.offset.z,distance:r.distance};this.locationMotion.set(i,0).catch(z)}else{var a=e.center.delta/2*Math.max(Math.log(this.locationMotion.value.distance),1),o=this.models.bounding.getCenter(new c.Vector3),s=t.distanceFromModel(this.models,this.cameraMotion.value.fov,this.camera.aspect),l=he(this.locationMotion.value.distance-a,ga,1/0),u=e.state.offset.clone().sub(Ft(e.state).setLength(l)),d=this.models.bounding.containsPoint(u);if(this.modelInScreen!=="none"&&(l=!d&&a<0&&o.distanceTo(u)>s?e.state.distance:l),e.state.distance=l,this.emit("gesture.mousewheel",e),e.defaultPrevented)return;this.locationMotion.set({distance:l},0).catch(z)}},t.prototype.onTapGesture=function(e){var r=this;this.userAction=e.userAction,this.stopMomentumMovement();var i=e.center.raycaster,a=this.getForwardObserverOrNot(i);if(!a)this.emit("gesture.tap",e);else{var o={longitude:this.camera.pose.longitude,latitude:0},s=F(F({},e.state),{mode:"Panorama",workCode:a.pano.workCode,panoIndex:a.pano.panoIndex,longitude:o.longitude,latitude:o.latitude,offset:a?a.position.clone():new c.Vector3,distance:0});if(e.state=s,this.emit("gesture.tap",e),!e.defaultPrevented&&(this.emit("pano.select",W("pano.select",{prevPano:this.currentPano,state:s,userAction:e.userAction,options:o,progress:0,error:null})),a&&a.active)){var l=this.currentTapId=wt();this.preloadPano(a.pano).then(function(u){r.currentTapId===l&&r.emit("pano.request",W("pano.request",{userAction:!0,prevPano:r.currentPano,progress:0,state:s,options:o,error:null}))})}}},t.prototype.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.needsRender=!0},t.prototype.render=function(e,r){var i=this.renderer.getRenderTarget();this.updateScreenBuffer(r),e&&(r==="edl"?this.edlEffect.render(this.screenBuffers):r==="hq"?this.hqEffect.render(this.screenBuffers):(this.renderer.setRenderTarget(this.modelRenderTarget),this.renderer.render(this.modelScene,this.camera))),this.depthCopyPass.render(this.modelRenderTarget.depthTexture,i),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.copyPass.render(this.modelRenderTarget,i),this.renderer.setRenderTarget(i),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,this.camera),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0},t}(ho);function Us(n){return n==null}var Lp={type:"move"},qs=function(){function n(){this._targetRay=null,this._grip=null,this._hand=null,this._axes=[0,0]}return n.prototype.getHandSpace=function(){return this._hand===null&&(this._hand=new c.Group,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand},n.prototype.getTargetRaySpace=function(){return this._targetRay===null&&(this._targetRay=new c.Group,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new c.Vector3,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new c.Vector3),this._targetRay},n.prototype.getGripSpace=function(){return this._grip===null&&(this._grip=new c.Group,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new c.Vector3,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new c.Vector3),this._grip},n.prototype.dispatchEvent=function(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this},n.prototype.disconnect=function(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this},n.prototype.getAxes=function(){return this._axes},n.prototype.update=function(t,e,r){var i=null,a=null,o=null,s=this._targetRay,l=this._grip,u=this._hand;if(t&&t.gamepad&&t.gamepad.axes&&(this._axes=[t.gamepad.axes[2],t.gamepad.axes[3]]),t&&e.session.visibilityState!=="visible-blurred")if(s!==null&&(i=e.getPose(t.targetRaySpace,r),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(Lp))),u&&t.hand){o=!0;for(var d=0,f=t.hand.values();d<f.length;d++){var A=f[d],m=e.getJointPose(A,r);if(u.joints[A.jointName]===void 0){var h=new c.Group;h.matrixAutoUpdate=!1,h.visible=!1,u.joints[A.jointName]=h,u.add(h)}var v=u.joints[A.jointName];m!==null&&(v.matrix.fromArray(m.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.jointRadius=m.radius),v.visible=m!==null}var y=u.joints["index-finger-tip"],p=u.joints["thumb-tip"],g=y.position.distanceTo(p.position),x=.02,b=.005;u.inputState.pinching&&g>x+b?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!u.inputState.pinching&&g<=x-b&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else l!==null&&t.gripSpace&&(a=e.getPose(t.gripSpace,r),a!==null&&(l.matrix.fromArray(a.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),a.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(a.linearVelocity)):l.hasLinearVelocity=!1,a.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(a.angularVelocity)):l.hasAngularVelocity=!1));return s!==null&&(s.visible=i!==null),l!==null&&(l.visible=a!==null),u!==null&&(u.visible=o!==null),this},n}(),Op=1,Vp=function(){function n(t,e,r){var i,a,o,s,l;this.isPanorama=(i=r==null?void 0:r.isPanorama)!==null&&i!==void 0?i:!0;var u=navigator.userAgent.toLowerCase(),d;u.includes("oculus")?d="Oculus":u.includes("pico")?d="Pico":d="VP",this.machineType=(a=r==null?void 0:r.machineType)!==null&&a!==void 0?a:d,this.renderer=t,this.gl=e,this.enabled=!1,this.session=null,this.referenceSpaceType=(o=r==null?void 0:r.referenceSpaceType)!==null&&o!==void 0?o:"local-floor",this.referenceSpace=null,this.onSessionStartCallback=(s=r==null?void 0:r.onSessionStart)!==null&&s!==void 0?s:z,this.onSessionEndCallback=(l=r==null?void 0:r.onSessionEnd)!==null&&l!==void 0?l:z,this.controllers=[new qs,new qs],this.inputSourcesMap=new Map,this.cameraVR=new c.ArrayCamera,this.cameraL=new c.PerspectiveCamera,this.cameraR=new c.PerspectiveCamera,this.cameraL.viewport=new c.Vector4,this.cameraR.viewport=new c.Vector4,this.cameraL.layers.enable(1),this.cameraR.layers.enable(2),this.cameraVR.layers.enable(1),this.cameraVR.layers.enable(2),this.isPresenting=!1,this.currentDepthNear=null,this.currentDepthFar=null,this.cameraLPos=new c.Vector3,this.cameraRPos=new c.Vector3}return n.prototype.getController=function(t){var e=this.controllers[t];return e||console.warn("no controller find"),e.getTargetRaySpace()},n.prototype.getRightController=function(){if(!this.session)return null;var t=this.session.inputSources[0].handedness==="right"?0:1,e=this.controllers[t];return e||console.warn("no controller find"),e.getTargetRaySpace()},n.prototype.getLeftController=function(){if(!this.session)return null;var t=this.session.inputSources[0].handedness==="left"?0:1,e=this.controllers[t];return e||console.warn("no controller find"),e.getTargetRaySpace()},n.prototype.getControllerGrip=function(t){var e=this.controllers[t];return e||console.warn("no controller find"),e.getGripSpace()},n.prototype.getCameras=function(){return{cameraL:this.cameraL,cameraR:this.cameraR,cameraVR:this.cameraVR}},n.prototype.updateCamera=function(t,e){e===null?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.getInverse(t.matrixWorld)},n.prototype.setProjectionFromUnion=function(t,e,r){this.cameraLPos.setFromMatrixPosition(e.matrixWorld),this.cameraRPos.setFromMatrixPosition(r.matrixWorld);var i=this.cameraLPos.distanceTo(this.cameraRPos),a=e.projectionMatrix.elements,o=r.projectionMatrix.elements,s=a[14]/(a[10]-1),l=a[14]/(a[10]+1),u=(a[9]+1)/a[5],d=(a[9]-1)/a[5],f=(a[8]-1)/a[0],A=(o[8]+1)/o[0],m=s*f,h=s*A,v=i/(-f+A),y=v*-f;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(y),t.translateZ(v),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);var p=s+v,g=l+v,x=m-y,b=h+(i-y),w=u*l/g*p,E=d*l/g*p;t.projectionMatrix.makePerspective(x,b,w,E,p,g)},n.prototype.getCamera=function(t){this.cameraVR.near=this.cameraR.near=this.cameraL.near=t.near,this.cameraVR.far=this.cameraR.far=this.cameraL.far=t.far,this.session&&(this.currentDepthNear!==this.cameraVR.near||this.currentDepthFar!==this.cameraVR.far)&&(this.session.updateRenderState({depthNear:this.cameraVR.near,depthFar:this.cameraVR.far}),this.currentDepthNear=this.cameraVR.near,this.currentDepthFar=this.cameraVR.far);var e=t.parent,r=this.cameraVR.cameras;this.updateCamera(this.cameraVR,e);for(var i=0;i<r.length;i++)this.updateCamera(r[i],e);t.matrixWorld.copy(this.cameraVR.matrixWorld);for(var a=t.children,i=0,o=a.length;i<o;i++)a[i].updateMatrixWorld(!0);return r.length===2?this.setProjectionFromUnion(this.cameraVR,this.cameraL,this.cameraR):this.cameraVR.projectionMatrix.copy(this.cameraL.projectionMatrix),this.cameraVR},n.prototype.updateInputSources=function(t){if(!this.session){console.warn("session is lose!");return}for(var e=this.session.inputSources,r=0;r<this.controllers.length;r++)this.inputSourcesMap.set(e[r],this.controllers[r]);for(var r=0;r<t.removed.length;r++){var i=t.removed[r],a=this.inputSourcesMap.get(i);a&&(a.dispatchEvent({type:"disconnected",data:i}),this.inputSourcesMap.delete(i))}for(var r=0;r<t.added.length;r++){var i=t.added[r],a=this.inputSourcesMap.get(i);a&&a.dispatchEvent({type:"connected",data:i})}},n.prototype.onSessionEvent=function(t){var e=this.inputSourcesMap.get(t.inputSource);e&&e.dispatchEvent({type:t.type})},n.prototype.onSessionEnd=function(){this.inputSourcesMap.forEach(function(t,e){t.disconnect(e)}),this.inputSourcesMap.clear(),this.renderer.setFramebuffer(null),this.renderer.setRenderTarget(this.renderer.getRenderTarget()),this.isPresenting=!1,this.session=null,vt.shared.setContext(null),this.onSessionEndCallback()},n.prototype.onRequestReferenceSpace=function(t){this.referenceSpace=t,this.isPresenting=!0,this.session&&this.onSessionStartCallback(this.session)},n.prototype.setSession=function(t){var e=this;if(this.session=t,this.session){this.session.addEventListener("select",function(i){e.onSessionEvent(i)}),this.session.addEventListener("selectstart",function(i){e.onSessionEvent(i)}),this.session.addEventListener("selectend",function(i){e.onSessionEvent(i)}),this.session.addEventListener("squeeze",function(i){e.onSessionEvent(i)}),this.session.addEventListener("squeezestart",function(i){e.onSessionEvent(i)}),this.session.addEventListener("squeezeend",function(i){e.onSessionEvent(i)}),this.session.addEventListener("end",function(i){e.onSessionEnd()});var r=this.gl.getContextAttributes();this.gl.makeXRCompatible().then(function(){var i={antialias:r==null?void 0:r.antialias,alpha:r==null?void 0:r.alpha,depth:r==null?void 0:r.depth,stencil:r==null?void 0:r.stencil,framebufferScaleFactor:Op};if(!e.session){console.error("session is lose while set session!");return}switch(e.machineType){case"Pico":case"VP":e.session.updateRenderState({baseLayer:new XRWebGLLayer(e.session,e.gl,i)});break;case"Oculus":e.session.updateRenderState({layers:[new XRWebGLLayer(e.session,e.gl,i)]});break;default:e.machineType;break}e.session.requestReferenceSpace(e.referenceSpaceType).then(function(a){e.onRequestReferenceSpace(a)}),e.session.addEventListener("inputsourceschange",function(a){e.updateInputSources(a)})})}},n}(),yo=function(n){ue(t,n);function t(){var e=n.call(this)||this;e.type="LineSegmentsGeometry";var r=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],i=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],a=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];return e.setIndex(a),e.setAttribute("position",new c.Float32BufferAttribute(r,3)),e.setAttribute("uv",new c.Float32BufferAttribute(i,2)),e}return t.prototype.applyMatrix4=function(e){var r=this.attributes.instanceStart,i=this.attributes.instanceEnd;return r!==void 0&&(r.applyMatrix4(e),i.applyMatrix4(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this},t.prototype.setPositions=function(e){var r;e instanceof Float32Array?r=e:Array.isArray(e)?r=new Float32Array(e):r=new Float32Array;var i=new c.InstancedInterleavedBuffer(r,6,1);return this.setAttribute("instanceStart",new c.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceEnd",new c.InterleavedBufferAttribute(i,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this},t.prototype.setColors=function(e){var r;e instanceof Float32Array?r=e:Array.isArray(e)?r=new Float32Array(e):r=new Float32Array;var i=new c.InstancedInterleavedBuffer(r,6,1);return this.setAttribute("instanceColorStart",new c.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceColorEnd",new c.InterleavedBufferAttribute(i,3,3)),this},t.prototype.fromWireframeGeometry=function(e){return this.setPositions(e.attributes.position.array),this},t.prototype.fromEdgesGeometry=function(e){return this.setPositions(e.attributes.position.array),this},t.prototype.fromMesh=function(e){return this.fromWireframeGeometry(new c.WireframeGeometry(e.geometry)),this},t.prototype.fromLineSegments=function(e){var r=e.geometry;if(r instanceof c.Geometry){var i=new c.BufferGeometry().fromGeometry(r);this.setPositions(i.attributes.position.array)}else r instanceof c.BufferGeometry&&this.setPositions(r.attributes.position.array);return this},t.prototype.computeBoundingBox=function(){this.boundingBox===null&&(this.boundingBox=new c.Box3);var e=this.attributes.instanceStart,r=this.attributes.instanceEnd;if(e!==void 0&&r!==void 0){var i=new c.Box3;this.boundingBox.setFromBufferAttribute(e),i.setFromBufferAttribute(r),this.boundingBox.union(i)}},t.prototype.computeBoundingSphere=function(){this.boundingSphere===null&&(this.boundingSphere=new c.Sphere),this.boundingBox===null&&this.computeBoundingBox();var e=this.attributes.instanceStart,r=this.attributes.instanceEnd;if(e!==void 0&&r!==void 0){var i=this.boundingSphere.center;this.boundingBox.getCenter(i);for(var a=0,o=new c.Vector3,s=0,l=e.count;s<l;s++)o.fromBufferAttribute(e,s),a=Math.max(a,i.distanceToSquared(o)),o.fromBufferAttribute(r,s),a=Math.max(a,i.distanceToSquared(o));this.boundingSphere.radius=Math.sqrt(a),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}},t.prototype.toJSON=function(){},t}(c.InstancedBufferGeometry);Object.assign(yo.prototype,{isLineSegmentsGeometry:!0});var ya={uniforms:c.UniformsUtils.merge([c.UniformsLib.common,c.UniformsLib.fog,{linewidth:{value:1},resolution:{value:new c.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1},opacity:{value:1}}]),vertexShader:`
|
|
1861
|
+
qvpnqH\frpA-p|y|-J-r\x07r?Q5drvtuZn}9-b6H-p|y|-J-p|y|-<-p|y|;HtylSntP|y|-J-rpA5p|y|;\x07\b 9->;=6H-\f`),Bp=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}(`}rpvv|{-zrqvz}-sy|nH}rpvv|{-zrqvz}-v{Hnvor-rp@-}|vv|{Hnvor-rp?-H{vs|z-znA-}|wrpv|{Znv\x07H{vs|z-znA-z|qrycvrZnv\x07Hn\bv{t-rp?-bH|vq-znv{56-
|
|
1862
|
+
b-J-Htyl]|vv|{-J-}|wrpv|{Znv\x07-7-z|qrycvrZnv\x07-7-rpA5}|vv|{9>;=6H\f`);var Rp=function(n){ue(t,n);function t(e){var r=n.call(this,{vertexShader:Bp,fragmentShader:Pp})||this;return r.uniforms={uDepthMap:zs("t",null),uWeightMap:zs("t",null)},r.depthTest=!0,r.depthWrite=!0,r.opacity=1,r}return t.prototype.getUniform=function(e){return this.uniforms===void 0?void 0:this.uniforms[e].value},t.prototype.setUniform=function(e,r){if(this.uniforms!==void 0){var i=this.uniforms[e];i.value=r}},Ct([Qs("uDepthMap"),Mt("design:type",Number)],t.prototype,"uDepthMap",void 0),Ct([Qs("uWeightMap"),Mt("design:type",Number)],t.prototype,"uWeightMap",void 0),t}(c.RawShaderMaterial);function zs(n,t){return{type:n,value:t}}function Qs(n,t){return t===void 0&&(t=!1),function(e,r){Object.defineProperty(e,r,{get:function(){return this.getUniform(n)},set:function(i){i!==this.getUniform(n)&&(this.setUniform(n,i),t&&this.updateShaderSource())}})}}var kp=new c.OrthographicCamera(-1,1,1,-1,0,1),yo=new c.BufferGeometry;yo.setAttribute("position",new c.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));yo.setAttribute("uv",new c.Float32BufferAttribute([0,2,0,0,2,0],2));var Su=new c.Mesh(yo),Iu=new c.Scene;Iu.add(Su);var Fp=function(n){ue(t,n);function t(e,r,i,a){var o=n.call(this,e,r,i,a)||this;return o.sharedV2=new c.Vector2,o.renderer=e,o.material=new Rp,o.camera=i,Su.material=o.material,o}return t.prototype.render=function(e){this.models.setMaterial({useHQDepth:!0,useHQWeight:!1}),this.models.update(this.renderer,this.camera,"Mapview"),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0,this.renderer.setRenderTarget(e[0]),this.renderer.render(this.scene,this.camera),this.models.setMaterial({useHQWeight:!0,useHQDepth:!1}),this.models.update(this.renderer,this.camera,"Mapview"),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.renderer.setClearColor(new c.Color(0,0,0)),this.renderer.setClearAlpha(0),this.renderer.setRenderTarget(e[1]),this.renderer.render(this.scene,this.camera),this.material.uniforms.uWeightMap.value=e[1].texture,this.material.uniforms.uDepthMap.value=e[0].depthTexture,this.renderer.autoClearDepth=!0,this.renderer.autoClearColor=!0,this.renderer.setClearColor(new c.Color(0,0,0)),this.renderer.setClearAlpha(1),this.renderer.setRenderTarget(e[2]),this.renderer.render(Iu,kp)},t.prototype.dispose=function(){this.copyPass.dispose()},t}(vo),ma=.5,ga=0,Us=Math.PI/9,Lp=function(n){ue(t,n);function t(e){var r=this,i,a=t.parseArgs(e);return r=n.call(this,a)||this,r.mode="Mapview",r.defaultLongitude=a.defaultLongitude,r.defaultLatitude=a.defaultLatitude,r.defaultDistance=a.defaultDistance,r.maxLatitude=a.maxLatitude,r.minLatitude=a.minLatitude,r.cameraType=a.cameraType,r.modelInScreen=a.modelInScreen,r.locationMotion=new Se({x:r.camera.pose.offset.x,y:r.camera.pose.offset.y,z:r.camera.pose.offset.z,distance:r.camera.pose.distance}),r.modelAlphaMotion=new Se({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new Se({perspToOrtho:r.camera.perspToOrtho.x}),r.intersectMeshCreator=a.intersectMeshCreator,r.intersectMesh=r.intersectMeshCreator(),r.intersectMesh.name="intersect",r.intersectMesh.visible=!1,r.currentTapId=null,r.helper.add(r.intersectMesh),r.edlTarget=new c.WebGLRenderTarget(1024,1024,{minFilter:c.NearestFilter,magFilter:c.NearestFilter,format:c.RGBAFormat,type:c.FloatType,depthTexture:new c.DepthTexture(1024,1024,c.UnsignedIntType)}),r.edlEffect=new Tp(r.renderer,r.modelScene,r.camera,r.models),r.hqEffect=new Fp(r.renderer,r.modelScene,r.camera,r.models),r}return t.parseArgs=function(e){var r,i,a,o,s,l,u,d;if(e instanceof t)return e;var f=n.parseArgs.call(this,e);return F(F({},f),{defaultLongitude:(r=e.defaultLongitude)!==null&&r!==void 0?r:Math.PI/4,defaultLatitude:(i=e.defaultLatitude)!==null&&i!==void 0?i:Math.PI/4,defaultDistance:(a=e.defaultDistance)!==null&&a!==void 0?a:150,maxLatitude:(o=e.maxLatitude)!==null&&o!==void 0?o:+Math.PI/2,minLatitude:(s=e.minLatitude)!==null&&s!==void 0?s:0,cameraType:(l=e.cameraType)!==null&&l!==void 0?l:"auto",modelInScreen:(u=e.modelInScreen)!==null&&u!==void 0?u:"boundingbox-center",intersectMeshCreator:(d=e.intersectMeshCreator)!==null&&d!==void 0?d:function(){return new Li}})},t.distanceFromModel=function(e,r,i){var a=e.bounding,o=Math.pow(Math.pow(a.max.x-a.min.x+1,2)+Math.pow(a.max.y-a.min.y+1,2)+Math.pow(a.max.z-a.min.z+1,2),1/2),s=o/2/Math.tan(Math.PI*r/360);return i<1&&(s=s/i),isNaN(s)?o:s},t.initAnimationEndState=function(e){var r,i,a,o,s,l,u,d=this.parseArgs(e),f=d.works,A=d.models,m=e.initial,h=m.state,v=m.currentState,y=typeof h.panoIndex=="number"?{workCode:(a=(r=h.workCode)!==null&&r!==void 0?r:(i=d.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:h.panoIndex}:{workCode:v.workCode,panoIndex:v.panoIndex},p=f.getResolvedObserver(y),g=(o=h.fov)!==null&&o!==void 0?o:60,x=he((s=h.latitude)!==null&&s!==void 0?s:Na(v.mode)?v.latitude:d.defaultLatitude,d.minLatitude,d.maxLatitude),b=t.distanceFromModel(d.models,g,d.camera.aspect),w=new c.Vector3,E=(l=h.distance)!==null&&l!==void 0?l:Math.min(d.defaultDistance,b),M=(u=h.longitude)!==null&&u!==void 0?u:Na(v.mode)?v.longitude:d.defaultLongitude;return h.offset?w.copy(h.offset):d.defaultDistance<b&&p?(w.copy(p.position),h.longitude===void 0&&(M=v.longitude)):w.copy(A.bounding.getCenter(w)),A.bounding.containsPoint(w)||A.bounding.getCenter(w),F(F({},y),{mode:"Mapview",longitude:M,latitude:x,fov:g,offset:w,distance:E})},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.locationMotion.dispose(),delete this.panState,this.intersectMesh.dispose(),this.helper.remove(this.intersectMesh)},t.prototype.isReady=function(){return this.locationMotion.ended===!1?!1:n.prototype.isReady.call(this)},t.prototype.updateWork=function(e,r,i,a){this.userAction=a,this.works=e;var o=t.initAnimationEndState(F(F({},this),{initial:{currentState:F(F({},this.currentPano),this.camera.pose),duration:i.duration,effect:i.effect,state:r,userAction:a}}));this.currentPano={workCode:o.workCode,panoIndex:o.panoIndex};var s={longitude:o.longitude,latitude:o.latitude,fov:o.fov},l={x:o.offset.x,y:o.offset.y,z:o.offset.z,distance:o.distance,orthoDistance:o.distance};return this.locationMotion.set(l,i.duration).catch(z),this.cameraMotion.set(s,i.duration).catch(z),!0},t.prototype.updateModel=function(e){n.prototype.updateModel.call(this,e)},t.prototype.updateCamera=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();var o={},s={};return e.distance!==void 0&&(o.distance=e.distance),e.offset!==void 0&&(o.x=e.offset.x,o.y=e.offset.y,o.z=e.offset.z),e.longitude!==void 0&&(s.longitude=e.longitude),e.latitude!==void 0&&(s.latitude=e.latitude),e.fov!==void 0&&(s.fov=e.fov),a.locationMotion.set(o,r).catch(z),a.cameraMotion.set(s,r).catch(z)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();for(var o=[],s=[],l=0,u=e;l<u.length;l++){var d=u[l];o.push({key:d.key,progress:d.progress,value:{distance:d.value.distance,x:d.value.offset.x,y:d.value.offset.x,z:d.value.offset.x}}),s.push({key:d.key,progress:d.progress,value:{longitude:d.value.longitude,latitude:d.value.latitude,fov:d.value.fov}})}return a.locationMotion.setKeyframes(o,r).catch(z),a.cameraMotion.setKeyframes(e,r)})},t.prototype.updateTime=function(e,r){if(!this.destroyed){var i={},a={};this.locationMotion.ended||(this.locationMotion.update(e),a.distance=this.locationMotion.value.distance,a.offset=new c.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z)),this.cameraMotion.ended||(this.cameraMotion.update(e),a.longitude=this.cameraMotion.value.longitude,a.latitude=this.cameraMotion.value.latitude,a.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended||(this.modelAlphaMotion.update(e),i.modelAlpha=this.modelAlphaMotion.value.modelAlpha);var o=0;this.cameraType==="auto"?o=Math.PI/2-this.cameraMotion.value.latitude<.02?1:0:this.cameraType==="perspective"?o=0:this.cameraType==="orthographic"&&(o=1),this.perspToOrthoMotion.getTargetKeyframe().value.perspToOrtho!==o&&this.perspToOrthoMotion.set({perspToOrtho:o},500).catch(z),this.perspToOrthoMotion.ended||(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(he(this.perspToOrthoMotion.value.perspToOrtho,0,1))),Nt(i)||this.models.setMaterial(i),Nt(a)||this.setCamera(a)}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(Me())[1],r=this.locationMotion.getKeyFrameSegment(Me())[1];return F(F({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,distance:r.value.distance,offset:new c.Vector3(r.value.x,r.value.y,r.value.z)})},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var i=e.initial;i.state,i.currentState;var a=i.duration,o=i.userAction;e.userAction=o;var s=t.initAnimationEndState(e),l={longitude:s.longitude,latitude:s.latitude,fov:s.fov},u={x:s.offset.x,y:s.offset.y,z:s.offset.z,distance:s.distance},d={modelAlpha:1},f={perspToOrtho:0};e.emit("initAnimation.start",W("initAnimation.start",{state:s,userAction:e.userAction})),e.perspToOrthoMotion.set(f,a).catch(z),e.modelAlphaMotion.set(d,a/3).catch(z),e.cameraMotion.set(l,a).catch(z),e.locationMotion.set(u,a).then(function(){e.emit("initAnimation.end",W("initAnimation.end",{state:s,userAction:e.userAction}))},function(A){var m=F(F(F({},e.currentPano),{mode:e.mode}),_e(e.camera.pose));e.emit("initAnimation.end",W("initAnimation.end",{state:m,userAction:e.userAction}))}).then(function(){r()})})},t.prototype.getForwardObserverOrNot=function(e){var r=this.models.intersectRaycaster(e)[0];if(!r)return null;var i=this.works.resolvedObservers,a=ur(i,function(l){return l.standingPosition.distanceTo(r.point)},!0),o=a[0],s=a[1];return o&&s<10?o:null},t.prototype.coordinatesForOffset=function(e){var r=this.renderer.getSize(new c.Vector2);return{longitude:-2*e.x/(r.x*this.scissor.width),latitude:2*e.y/(r.y*this.scissor.height)}},t.prototype.requestMomentumMovement=function(e,r,i,a){var o=this;if(this.inMomentumMovement!==null){for(var s=F({},i),l={longitude:0,latitude:0,x:0,y:0,z:0},u=0;u<a;u++)s.longitude*=.996,s.latitude*=.996*.998,s.x*=.99,s.y*=.99,s.z*=.99,l.longitude+=s.longitude,l.latitude+=s.latitude,l.x+=s.x,l.y+=s.y,l.z+=s.z;var d=Kr(this.cameraMotion.value.longitude+l.longitude),f=he(this.cameraMotion.value.latitude+l.latitude,this.minLatitude,this.maxLatitude),A=new c.Vector3(this.locationMotion.value.x+l.x,this.locationMotion.value.y+l.y,this.locationMotion.value.z+l.z);this.modelInScreen==="boundingbox-center"&&A.clamp(this.models.bounding.min,this.models.bounding.max);var m=F(F({},this.currentPano),{mode:this.mode,longitude:d,latitude:f,offset:A,fov:this.cameraMotion.value.fov,distance:this.camera.pose.distance}),h=!(Math.abs(s.longitude)>1e-4||Math.abs(s.latitude)>1e-4||Math.abs(s.x)>1e-4||Math.abs(s.y)>1e-4||Math.abs(s.z)>1e-4),v=W("gesture.momentum",F(F({},e),{isFirst:r,isFinal:h,state:m}));if(this.inMomentumMovement.event=v,this.emit("gesture.momentum",v),e.defaultPrevented){this.inMomentumMovement=null;return}this.inMomentumMovement&&(this.cameraMotion.set({longitude:d,latitude:f},0).catch(z),this.locationMotion.set({x:m.offset.x,y:m.offset.y,z:m.offset.z},0).catch(z),h?this.inMomentumMovement=null:vt.shared.add(function(y,p){o.requestMomentumMovement(e,!1,s,p|0)},!0,1))}},t.prototype.fixFinalState=function(e){if(this.perspToOrthoMotion.getTargetKeyframe().value.perspToOrtho!==1){var r=Ft(e,new c.Vector3),i=new c.Vector3().copy(e.offset).sub(r.clone().multiplyScalar(e.distance)),a=new c.Raycaster(i,r);a.params.Points={threshold:.1},a.near=ma;var o=this.models.intersectRaycaster(a)[0];if(!o&&a.ray.direction.y<-.3){var s=new c.Plane(new c.Vector3(0,1,0),-this.models.bounding.min.y),l=a.ray.intersectPlane(s,new c.Vector3);if(l){var u=l.distanceTo(a.ray.origin);u<1e4&&u>=a.near&&(o={distance:u,floor:0,point:l,object:this.scene,face:null})}}o&&(e.distance=he(o.distance,ga,1/0),e.offset.copy(i).add(r.clone().multiplyScalar(e.distance)))}},t.prototype.onPanGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var r=e.pointers.length,i=this.panState,a=0;e.pointerType==="mouse"&&(a=e.srcEvent.buttons),i&&a===0&&i.buttons!==0&&(a=i.buttons);var o=i==null?void 0:i.target;if(!o){var s=this.relativeClientPosition(e.center),l=new c.Raycaster;l.params.Points={threshold:.1},l.setFromCamera(s,this.camera),l.near=ma,o=new c.Vector3().copy(l.ray.direction).multiplyScalar(3).add(l.ray.origin);var u=this.models.intersectRaycaster(l)[0];if(!u&&l.ray.direction.y<-.3){var d=new c.Plane(new c.Vector3(0,1,0),0),f=l.ray.intersectPlane(d,new c.Vector3);if(f){var A=f.distanceTo(l.ray.origin);A<1e4&&A>=l.near&&(u={distance:A,floor:0,point:f,object:this.scene})}}if(u)o.copy(u.point);else{var m=new c.Vector3().copy(this.camera.pose.offset).sub(this.camera.position),d=new c.Plane().setFromNormalAndCoplanarPoint(m,this.camera.pose.offset);l.ray.intersectPlane(d,o)}}if(e.isFinal?delete this.panState:this.panState={target:o,buttons:a,pointerLength:r,x:e.center.x,y:e.center.y},!(typeof i=="undefined"||i.pointerLength!==r)){var h=r>1||a===2;if(h){var v={x:e.center.x-i.x,y:e.center.y-i.y},y=new c.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),p=Ft(this.cameraMotion.value).setLength(this.locationMotion.value.distance).add(y),g=new c.Vector3().copy(p).sub(i.target).length();g*=Math.tan(this.camera.pose.fov/2*Math.PI/180);var x=this.renderer.getSize(new c.Vector2),b=2*v.x*g/x.y,w=2*v.y*g/x.y,E=new c.Vector3;E.setFromMatrixColumn(this.camera.matrix,0),E.multiplyScalar(-b),y.add(E),this.camera.pose.latitude<Us?E.setFromMatrixColumn(this.camera.matrix,1):(E.setFromMatrixColumn(this.camera.matrix,0),E.crossVectors(this.camera.up,E)),E.multiplyScalar(w),y.add(E),this.modelInScreen==="boundingbox-center"&&y.clamp(this.models.bounding.min,this.models.bounding.max);var M=F(F({},this.currentPano),{mode:this.mode,longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:y,distance:this.camera.pose.distance});if(e.state=M,this.emit("gesture.pan",e),e.defaultPrevented)return;if(this.locationMotion.set({x:M.offset.x,y:M.offset.y,z:M.offset.z},0).catch(z),e.isFinal&&(this.fixFinalState(M),this.locationMotion.set({distance:M.distance,x:M.offset.x,y:M.offset.y,z:M.offset.z},0).catch(z)),e.isFinal){var C=this.renderer.getSize(new c.Vector2),P=2*e.velocityX*g/C.y,S=2*e.velocityY*g/C.y,T=new c.Vector3,B=new c.Vector3;T.setFromMatrixColumn(this.camera.matrix,0),T.multiplyScalar(-P),B.add(T),this.camera.pose.latitude<Us?T.setFromMatrixColumn(this.camera.matrix,1):(T.setFromMatrixColumn(this.camera.matrix,0),T.crossVectors(this.camera.up,T)),T.multiplyScalar(S),B.add(T),this.inMomentumMovement={uuid:wt()},this.requestMomentumMovement(e,!0,{longitude:0,latitude:0,x:B.x,y:B.y,z:B.z},0)}}else{var v={x:e.center.x-i.x,y:e.center.y-i.y},L=this.coordinatesForOffset(v),k=Kr(this.cameraMotion.value.longitude+L.longitude),O=he(this.cameraMotion.value.latitude+L.latitude,this.minLatitude,this.maxLatitude);this.camera.aspect<1&&Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(O=this.cameraMotion.value.latitude);var M=F(F({},this.currentPano),{mode:this.mode,longitude:k,latitude:O,fov:this.camera.pose.fov,offset:this.camera.pose.offset,distance:this.camera.pose.distance});if(e.isFinal&&this.fixFinalState(M),e.state=M,this.emit("gesture.pan",e),e.defaultPrevented)return;if(e.isFinal?this.locationMotion.set({distance:M.distance,x:M.offset.x,y:M.offset.y,z:M.offset.z},0).catch(z):this.cameraMotion.set({longitude:M.longitude,latitude:M.latitude},0).catch(z),e.isFinal){var D=e.velocityX,N=e.velocityY;this.inMomentumMovement={uuid:wt()},this.requestMomentumMovement(e,!0,F(F({},this.coordinatesForOffset({x:D,y:N})),{x:0,y:0,z:0}),0)}}}},t.prototype.onPinchGesture=function(e){var r;if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var i=(r=this.pinchState)===null||r===void 0?void 0:r.distance;if(e.isFirst){this.pinchState={x:e.center.x,y:e.center.y,scale:1,distance:this.locationMotion.value.distance};return}if(e.isFinal){delete this.panState,delete this.pinchState;return}if(typeof i!="undefined"){var a=this.models.bounding.getCenter(new c.Vector3),o=t.distanceFromModel(this.models,this.cameraMotion.value.fov,this.camera.aspect),s=he(i/e.scale,ga,1/0),l=e.state.offset.clone().sub(Ft(e.state).setLength(s)),u=this.models.bounding.containsPoint(l),d;!u&&this.pinchState&&this.pinchState.scale>e.scale&&a.distanceTo(l)>o?d=e.state.distance:(d=s,this.pinchState&&(this.pinchState.scale=e.scale)),e.state.distance=d,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.locationMotion.set({distance:e.state.distance},0).catch(z),e.pointerType!=="mouse"&&(e.type="gesture.pan",this.onPanGesture(e)))}}},t.prototype.onMouseMove=function(e){var r,i;if(this.intersectMesh.parent&&!this.panState&&!this.pinchState&&!this.mouseWheelState&&(this.emit("gesture.mousemove",e),!e.defaultPrevented)){var a=e.center.raycaster;if(a.near=ma,a.far=500,e.isFinal&&this.intersectMesh.parent&&this.intersectMesh.visible===!0){this.hideIntersectMesh();return}var o=this.models.intersectRaycaster(a)[0],s=W("intersect.update",{raycaster:a,intersection:o!=null?o:null,object:this.intersectMesh});if(this.emit("intersect.update",s),s.defaultPrevented){this.hideIntersectMesh();return}if(o){var l=(i=(r=o.face)===null||r===void 0?void 0:r.normal)!==null&&i!==void 0?i:new c.Vector3().copy(a.ray.direction).multiplyScalar(-1),u=l.clone(),d=o.point.clone();this.intersectMesh.position.copy(d);var f=d.clone().add(u);if(this.intersectMesh.lookAt(f),Math.abs(l.y)>.99){var A=this.camera.position.clone().sub(d);this.intersectMesh.rotation.z=-Math.atan2(A.z,A.x)}this.intersectMesh.visible=!0,this.needsRender=!0}else this.hideIntersectMesh()}},t.prototype.onMouseWheel=function(e){if(this.initAnimationIsReady)if(this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh(),e.isFinal){var r=e.state;if(this.fixFinalState(r),this.emit("gesture.mousewheel",e),e.defaultPrevented)return;var i={x:r.offset.x,y:r.offset.y,z:r.offset.z,distance:r.distance};this.locationMotion.set(i,0).catch(z)}else{var a=e.center.delta/2*Math.max(Math.log(this.locationMotion.value.distance),1),o=this.models.bounding.getCenter(new c.Vector3),s=t.distanceFromModel(this.models,this.cameraMotion.value.fov,this.camera.aspect),l=he(this.locationMotion.value.distance-a,ga,1/0),u=e.state.offset.clone().sub(Ft(e.state).setLength(l)),d=this.models.bounding.containsPoint(u);if(this.modelInScreen!=="none"&&(l=!d&&a<0&&o.distanceTo(u)>s?e.state.distance:l),e.state.distance=l,this.emit("gesture.mousewheel",e),e.defaultPrevented)return;this.locationMotion.set({distance:l},0).catch(z)}},t.prototype.onTapGesture=function(e){var r=this;this.userAction=e.userAction,this.stopMomentumMovement();var i=e.center.raycaster,a=this.getForwardObserverOrNot(i);if(!a)this.emit("gesture.tap",e);else{var o={longitude:this.camera.pose.longitude,latitude:0},s=F(F({},e.state),{mode:"Panorama",workCode:a.pano.workCode,panoIndex:a.pano.panoIndex,longitude:o.longitude,latitude:o.latitude,offset:a?a.position.clone():new c.Vector3,distance:0});if(e.state=s,this.emit("gesture.tap",e),!e.defaultPrevented&&(this.emit("pano.select",W("pano.select",{prevPano:this.currentPano,state:s,userAction:e.userAction,options:o,progress:0,error:null})),a&&a.active)){var l=this.currentTapId=wt();this.preloadPano(a.pano).then(function(u){r.currentTapId===l&&r.emit("pano.request",W("pano.request",{userAction:!0,prevPano:r.currentPano,progress:0,state:s,options:o,error:null}))})}}},t.prototype.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.needsRender=!0},t.prototype.render=function(e,r){var i=this.renderer.getRenderTarget();this.updateScreenBuffer(r),e&&(r==="edl"?this.edlEffect.render(this.screenBuffers):r==="hq"?this.hqEffect.render(this.screenBuffers):(this.renderer.setRenderTarget(this.modelRenderTarget),this.renderer.render(this.modelScene,this.camera))),this.depthCopyPass.render(this.modelRenderTarget.depthTexture,i),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.copyPass.render(this.modelRenderTarget,i),this.renderer.setRenderTarget(i),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,this.camera),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0},t}(po);function qs(n){return n==null}var Op={type:"move"},Hs=function(){function n(){this._targetRay=null,this._grip=null,this._hand=null,this._axes=[0,0]}return n.prototype.getHandSpace=function(){return this._hand===null&&(this._hand=new c.Group,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand},n.prototype.getTargetRaySpace=function(){return this._targetRay===null&&(this._targetRay=new c.Group,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new c.Vector3,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new c.Vector3),this._targetRay},n.prototype.getGripSpace=function(){return this._grip===null&&(this._grip=new c.Group,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new c.Vector3,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new c.Vector3),this._grip},n.prototype.dispatchEvent=function(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this},n.prototype.disconnect=function(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this},n.prototype.getAxes=function(){return this._axes},n.prototype.update=function(t,e,r){var i=null,a=null,o=null,s=this._targetRay,l=this._grip,u=this._hand;if(t&&t.gamepad&&t.gamepad.axes&&(this._axes=[t.gamepad.axes[2],t.gamepad.axes[3]]),t&&e.session.visibilityState!=="visible-blurred")if(s!==null&&(i=e.getPose(t.targetRaySpace,r),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(Op))),u&&t.hand){o=!0;for(var d=0,f=t.hand.values();d<f.length;d++){var A=f[d],m=e.getJointPose(A,r);if(u.joints[A.jointName]===void 0){var h=new c.Group;h.matrixAutoUpdate=!1,h.visible=!1,u.joints[A.jointName]=h,u.add(h)}var v=u.joints[A.jointName];m!==null&&(v.matrix.fromArray(m.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.jointRadius=m.radius),v.visible=m!==null}var y=u.joints["index-finger-tip"],p=u.joints["thumb-tip"],g=y.position.distanceTo(p.position),x=.02,b=.005;u.inputState.pinching&&g>x+b?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!u.inputState.pinching&&g<=x-b&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else l!==null&&t.gripSpace&&(a=e.getPose(t.gripSpace,r),a!==null&&(l.matrix.fromArray(a.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),a.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(a.linearVelocity)):l.hasLinearVelocity=!1,a.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(a.angularVelocity)):l.hasAngularVelocity=!1));return s!==null&&(s.visible=i!==null),l!==null&&(l.visible=a!==null),u!==null&&(u.visible=o!==null),this},n}(),Vp=1,Np=function(){function n(t,e,r){var i,a,o,s,l;this.isPanorama=(i=r==null?void 0:r.isPanorama)!==null&&i!==void 0?i:!0;var u=navigator.userAgent.toLowerCase(),d;u.includes("oculus")?d="Oculus":u.includes("pico")?d="Pico":d="VP",this.machineType=(a=r==null?void 0:r.machineType)!==null&&a!==void 0?a:d,this.renderer=t,this.gl=e,this.enabled=!1,this.session=null,this.referenceSpaceType=(o=r==null?void 0:r.referenceSpaceType)!==null&&o!==void 0?o:"local-floor",this.referenceSpace=null,this.onSessionStartCallback=(s=r==null?void 0:r.onSessionStart)!==null&&s!==void 0?s:z,this.onSessionEndCallback=(l=r==null?void 0:r.onSessionEnd)!==null&&l!==void 0?l:z,this.controllers=[new Hs,new Hs],this.inputSourcesMap=new Map,this.cameraVR=new c.ArrayCamera,this.cameraL=new c.PerspectiveCamera,this.cameraR=new c.PerspectiveCamera,this.cameraL.viewport=new c.Vector4,this.cameraR.viewport=new c.Vector4,this.cameraL.layers.enable(1),this.cameraR.layers.enable(2),this.cameraVR.layers.enable(1),this.cameraVR.layers.enable(2),this.isPresenting=!1,this.currentDepthNear=null,this.currentDepthFar=null,this.cameraLPos=new c.Vector3,this.cameraRPos=new c.Vector3}return n.prototype.getController=function(t){var e=this.controllers[t];return e||console.warn("no controller find"),e.getTargetRaySpace()},n.prototype.getRightController=function(){if(!this.session)return null;var t=this.session.inputSources[0].handedness==="right"?0:1,e=this.controllers[t];return e||console.warn("no controller find"),e.getTargetRaySpace()},n.prototype.getLeftController=function(){if(!this.session)return null;var t=this.session.inputSources[0].handedness==="left"?0:1,e=this.controllers[t];return e||console.warn("no controller find"),e.getTargetRaySpace()},n.prototype.getControllerGrip=function(t){var e=this.controllers[t];return e||console.warn("no controller find"),e.getGripSpace()},n.prototype.getCameras=function(){return{cameraL:this.cameraL,cameraR:this.cameraR,cameraVR:this.cameraVR}},n.prototype.updateCamera=function(t,e){e===null?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.getInverse(t.matrixWorld)},n.prototype.setProjectionFromUnion=function(t,e,r){this.cameraLPos.setFromMatrixPosition(e.matrixWorld),this.cameraRPos.setFromMatrixPosition(r.matrixWorld);var i=this.cameraLPos.distanceTo(this.cameraRPos),a=e.projectionMatrix.elements,o=r.projectionMatrix.elements,s=a[14]/(a[10]-1),l=a[14]/(a[10]+1),u=(a[9]+1)/a[5],d=(a[9]-1)/a[5],f=(a[8]-1)/a[0],A=(o[8]+1)/o[0],m=s*f,h=s*A,v=i/(-f+A),y=v*-f;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(y),t.translateZ(v),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);var p=s+v,g=l+v,x=m-y,b=h+(i-y),w=u*l/g*p,E=d*l/g*p;t.projectionMatrix.makePerspective(x,b,w,E,p,g)},n.prototype.getCamera=function(t){this.cameraVR.near=this.cameraR.near=this.cameraL.near=t.near,this.cameraVR.far=this.cameraR.far=this.cameraL.far=t.far,this.session&&(this.currentDepthNear!==this.cameraVR.near||this.currentDepthFar!==this.cameraVR.far)&&(this.session.updateRenderState({depthNear:this.cameraVR.near,depthFar:this.cameraVR.far}),this.currentDepthNear=this.cameraVR.near,this.currentDepthFar=this.cameraVR.far);var e=t.parent,r=this.cameraVR.cameras;this.updateCamera(this.cameraVR,e);for(var i=0;i<r.length;i++)this.updateCamera(r[i],e);t.matrixWorld.copy(this.cameraVR.matrixWorld);for(var a=t.children,i=0,o=a.length;i<o;i++)a[i].updateMatrixWorld(!0);return r.length===2?this.setProjectionFromUnion(this.cameraVR,this.cameraL,this.cameraR):this.cameraVR.projectionMatrix.copy(this.cameraL.projectionMatrix),this.cameraVR},n.prototype.updateInputSources=function(t){if(!this.session){console.warn("session is lose!");return}for(var e=this.session.inputSources,r=0;r<this.controllers.length;r++)this.inputSourcesMap.set(e[r],this.controllers[r]);for(var r=0;r<t.removed.length;r++){var i=t.removed[r],a=this.inputSourcesMap.get(i);a&&(a.dispatchEvent({type:"disconnected",data:i}),this.inputSourcesMap.delete(i))}for(var r=0;r<t.added.length;r++){var i=t.added[r],a=this.inputSourcesMap.get(i);a&&a.dispatchEvent({type:"connected",data:i})}},n.prototype.onSessionEvent=function(t){var e=this.inputSourcesMap.get(t.inputSource);e&&e.dispatchEvent({type:t.type})},n.prototype.onSessionEnd=function(){this.inputSourcesMap.forEach(function(t,e){t.disconnect(e)}),this.inputSourcesMap.clear(),this.renderer.setFramebuffer(null),this.renderer.setRenderTarget(this.renderer.getRenderTarget()),this.isPresenting=!1,this.session=null,vt.shared.setContext(null),this.onSessionEndCallback()},n.prototype.onRequestReferenceSpace=function(t){this.referenceSpace=t,this.isPresenting=!0,this.session&&this.onSessionStartCallback(this.session)},n.prototype.setSession=function(t){var e=this;if(this.session=t,this.session){this.session.addEventListener("select",function(i){e.onSessionEvent(i)}),this.session.addEventListener("selectstart",function(i){e.onSessionEvent(i)}),this.session.addEventListener("selectend",function(i){e.onSessionEvent(i)}),this.session.addEventListener("squeeze",function(i){e.onSessionEvent(i)}),this.session.addEventListener("squeezestart",function(i){e.onSessionEvent(i)}),this.session.addEventListener("squeezeend",function(i){e.onSessionEvent(i)}),this.session.addEventListener("end",function(i){e.onSessionEnd()});var r=this.gl.getContextAttributes();this.gl.makeXRCompatible().then(function(){var i={antialias:r==null?void 0:r.antialias,alpha:r==null?void 0:r.alpha,depth:r==null?void 0:r.depth,stencil:r==null?void 0:r.stencil,framebufferScaleFactor:Vp};if(!e.session){console.error("session is lose while set session!");return}switch(e.machineType){case"Pico":case"VP":e.session.updateRenderState({baseLayer:new XRWebGLLayer(e.session,e.gl,i)});break;case"Oculus":e.session.updateRenderState({layers:[new XRWebGLLayer(e.session,e.gl,i)]});break;default:e.machineType;break}e.session.requestReferenceSpace(e.referenceSpaceType).then(function(a){e.onRequestReferenceSpace(a)}),e.session.addEventListener("inputsourceschange",function(a){e.updateInputSources(a)})})}},n}(),bo=function(n){ue(t,n);function t(){var e=n.call(this)||this;e.type="LineSegmentsGeometry";var r=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],i=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],a=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];return e.setIndex(a),e.setAttribute("position",new c.Float32BufferAttribute(r,3)),e.setAttribute("uv",new c.Float32BufferAttribute(i,2)),e}return t.prototype.applyMatrix4=function(e){var r=this.attributes.instanceStart,i=this.attributes.instanceEnd;return r!==void 0&&(r.applyMatrix4(e),i.applyMatrix4(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this},t.prototype.setPositions=function(e){var r;e instanceof Float32Array?r=e:Array.isArray(e)?r=new Float32Array(e):r=new Float32Array;var i=new c.InstancedInterleavedBuffer(r,6,1);return this.setAttribute("instanceStart",new c.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceEnd",new c.InterleavedBufferAttribute(i,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this},t.prototype.setColors=function(e){var r;e instanceof Float32Array?r=e:Array.isArray(e)?r=new Float32Array(e):r=new Float32Array;var i=new c.InstancedInterleavedBuffer(r,6,1);return this.setAttribute("instanceColorStart",new c.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceColorEnd",new c.InterleavedBufferAttribute(i,3,3)),this},t.prototype.fromWireframeGeometry=function(e){return this.setPositions(e.attributes.position.array),this},t.prototype.fromEdgesGeometry=function(e){return this.setPositions(e.attributes.position.array),this},t.prototype.fromMesh=function(e){return this.fromWireframeGeometry(new c.WireframeGeometry(e.geometry)),this},t.prototype.fromLineSegments=function(e){var r=e.geometry;if(r instanceof c.Geometry){var i=new c.BufferGeometry().fromGeometry(r);this.setPositions(i.attributes.position.array)}else r instanceof c.BufferGeometry&&this.setPositions(r.attributes.position.array);return this},t.prototype.computeBoundingBox=function(){this.boundingBox===null&&(this.boundingBox=new c.Box3);var e=this.attributes.instanceStart,r=this.attributes.instanceEnd;if(e!==void 0&&r!==void 0){var i=new c.Box3;this.boundingBox.setFromBufferAttribute(e),i.setFromBufferAttribute(r),this.boundingBox.union(i)}},t.prototype.computeBoundingSphere=function(){this.boundingSphere===null&&(this.boundingSphere=new c.Sphere),this.boundingBox===null&&this.computeBoundingBox();var e=this.attributes.instanceStart,r=this.attributes.instanceEnd;if(e!==void 0&&r!==void 0){var i=this.boundingSphere.center;this.boundingBox.getCenter(i);for(var a=0,o=new c.Vector3,s=0,l=e.count;s<l;s++)o.fromBufferAttribute(e,s),a=Math.max(a,i.distanceToSquared(o)),o.fromBufferAttribute(r,s),a=Math.max(a,i.distanceToSquared(o));this.boundingSphere.radius=Math.sqrt(a),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}},t.prototype.toJSON=function(){},t}(c.InstancedBufferGeometry);Object.assign(bo.prototype,{isLineSegmentsGeometry:!0});var ya={uniforms:c.UniformsUtils.merge([c.UniformsLib.common,c.UniformsLib.fog,{linewidth:{value:1},resolution:{value:new c.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1},opacity:{value:1}}]),vertexShader:`
|
|
1863
1863
|
#include <common>
|
|
1864
1864
|
#include <color_pars_vertex>
|
|
1865
1865
|
#include <fog_pars_vertex>
|
|
@@ -2058,7 +2058,7 @@ void main() {
|
|
|
2058
2058
|
#include <premultiplied_alpha_fragment>
|
|
2059
2059
|
|
|
2060
2060
|
}
|
|
2061
|
-
`},bo=function(n){ue(t,n);function t(e){var r=n.call(this,{uniforms:c.UniformsUtils.clone(ya.uniforms),vertexShader:ya.vertexShader,fragmentShader:ya.fragmentShader,clipping:!0})||this;return r.type="LineMaterial",r.dashed=!1,Object.defineProperties(r,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(i){this.uniforms.diffuse.value=i}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(i){this.uniforms.linewidth.value=i}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(i){this.uniforms.dashScale.value=i}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(i){this.uniforms.dashSize.value=i}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(i){this.uniforms.gapSize.value=i}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(i){this.uniforms.opacity.value=i}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(i){this.uniforms.resolution.value.copy(i)}}}),r.setValues(e),r}return t}(c.ShaderMaterial);Object.assign(bo.prototype,{isLineMaterial:!0});var Iu=function(n){ue(t,n);function t(e,r){var i=n.call(this)||this;return i.type="LineSegments2",i.geometry=e!==void 0?e:new yo,i.material=r!==void 0?r:new bo({color:Math.random()*16777215}),i}return t.prototype.computeLineDistances=function(){for(var e=this.geometry,r=e.attributes.instanceStart,i=e.attributes.instanceEnd,a=new Float32Array(2*r.count),o=new c.Vector3,s=new c.Vector3,l=0,u=0,d=r.count;l<d;l++,u+=2)o.fromBufferAttribute(r,l),s.fromBufferAttribute(i,l),a[u]=u===0?0:a[u-1],a[u+1]=a[u]+o.distanceTo(s);var f=new c.InstancedInterleavedBuffer(a,2,1);return e.setAttribute("instanceDistanceStart",new c.InterleavedBufferAttribute(f,1,0)),e.setAttribute("instanceDistanceEnd",new c.InterleavedBufferAttribute(f,1,1)),this},t.prototype.raycast=function(e,r){e.camera===null&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var i=e.ray,a=e.camera,o=a.projectionMatrix,s=this.geometry,l=this.material,u=l.resolution,d=l.linewidth,f=s.attributes.instanceStart,A=s.attributes.instanceEnd,m=new c.Vector4,h=new c.Vector4,v=new c.Vector4,y=new c.Vector3,p=new c.Matrix4,g=new c.Line3,x=new c.Vector3;i.at(1,v),v.w=1,v.applyMatrix4(a.matrixWorldInverse),v.applyMatrix4(o),v.multiplyScalar(1/v.w),v.x*=u.x/2,v.y*=u.y/2,v.z=0,y.copy(v);var b=this.matrixWorld;p.multiplyMatrices(a.matrixWorldInverse,b);for(var w=0,E=f.count;w<E;w++){m.fromBufferAttribute(f,w),h.fromBufferAttribute(A,w),m.w=1,h.w=1,m.applyMatrix4(p),h.applyMatrix4(p),m.applyMatrix4(o),h.applyMatrix4(o),m.multiplyScalar(1/m.w),h.multiplyScalar(1/h.w);var M=m.z<-1&&h.z<-1,C=m.z>1&&h.z>1;if(!(M||C)){m.x*=u.x/2,m.y*=u.y/2,h.x*=u.x/2,h.y*=u.y/2,g.start.copy(m),g.start.z=0,g.end.copy(h),g.end.z=0;var P=g.closestPointToPointParameter(y,!0);g.at(P,x);var S=c.MathUtils.lerp(m.z,h.z,P),T=S>=-1&&S<=1,B=y.distanceTo(x)<d*.5;if(T&&B){g.start.fromBufferAttribute(f,w),g.end.fromBufferAttribute(A,w),g.start.applyMatrix4(b),g.end.applyMatrix4(b);var L=new c.Vector3,k=new c.Vector3;i.distanceSqToSegment(g.start,g.end,k,L),r.push({point:k,pointOnLine:L,distance:i.origin.distanceTo(k),object:this,faceIndex:w})}}}},t}(c.Mesh);Object.assign(Iu.prototype,{isLineSegments2:!0});var Tu=function(n){ue(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.type="Line2",i}return t}(Iu);Object.assign(Tu.prototype,{isLine2:!0});var Pu=function(n){ue(t,n);function t(){var e=n.call(this)||this;return e.type="LineGeometry",e}return t.prototype.setPositions=function(e){for(var r=e.length-3,i=new Float32Array(2*r),a=0;a<r;a+=3)i[2*a]=e[a],i[2*a+1]=e[a+1],i[2*a+2]=e[a+2],i[2*a+3]=e[a+3],i[2*a+4]=e[a+4],i[2*a+5]=e[a+5];return n.prototype.setPositions.call(this,i),this},t.prototype.setColors=function(e){for(var r=e.length-3,i=new Float32Array(2*r),a=0;a<r;a+=3)i[2*a]=e[a],i[2*a+1]=e[a+1],i[2*a+2]=e[a+2],i[2*a+3]=e[a+3],i[2*a+4]=e[a+4],i[2*a+5]=e[a+5];return n.prototype.setColors.call(this,i),this},t.prototype.fromLine=function(e){var r=e.geometry;if(r instanceof c.Geometry){var i=new c.BufferGeometry().fromGeometry(r);this.setPositions(i.attributes.position.array)}else r instanceof c.BufferGeometry&&this.setPositions(r.attributes.position.array);return this},t.prototype.copy=function(){return this},t}(yo);Object.assign(Pu.prototype,{isLineGeometry:!0});var Np="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuC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gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==",Hs=14467195,Dp=8,zp=2,Qp=20,Gs=null,qa=function(n){ue(t,n);function t(e,r){e===void 0&&(e=new c.Vector3),r===void 0&&(r=new c.Vector3);var i=n.call(this)||this;i.type="FiveLine",i.needsRender=!0;var a=new Pu,o=new bo({color:Hs,linewidth:zp,dashScale:Qp,dashed:!1});i.line=new Tu(a,o);var s=new c.BufferGeometry,l=new c.PointsMaterial({color:Hs,size:Dp,map:Gs||(Gs=new c.TextureLoader().load(Np)),sizeAttenuation:!1,transparent:!0});return i.points=new c.Points(s,l),i.points.renderOrder=11,i.points.frustumCulled=!1,i.setPoints(e,r),i.add(i.line,i.points),i}return Object.defineProperty(t,"version",{get:function(){return"6.2.0-alpha.3"},enumerable:!1,configurable:!0}),t.prototype.setPoints=function(e,r){var i=[].concat(e.toArray(),r.toArray());this.points.geometry.setAttribute("position",new c.BufferAttribute(new Float32Array(i),3)),this.line.geometry.setPositions(i),this.line.computeLineDistances(),this.needsRender=!0},t.prototype.getPoints=function(){var e=this.points.geometry.attributes.position.array;return[new c.Vector3(e[0],e[1],e[2]),new c.Vector3(e[3],e[4],e[5])]},t.prototype.setMaterial=function(e){var r=this.line.material;for(var i in e)if(e.hasOwnProperty(i)){var a=e[i];i==="dashed"?(r.dashed=a,a?r.defines.USE_DASH="":delete r.defines.USE_DASH,r.needsUpdate=!0):r[i]=e[i]}this.needsRender=!0},t.prototype.setResolution=function(e,r){var i=this.line.material.resolution;(i.x!==e||i.y!==r)&&(i.set(e,r),this.needsRender=!0)},t}(c.Object3D);Object.assign(qa.prototype,{isFiveLine:!0});var We={Handedness:Object.freeze({NONE:"none",LEFT:"left",RIGHT:"right"}),ComponentState:Object.freeze({DEFAULT:"default",TOUCHED:"touched",PRESSED:"pressed"}),ComponentProperty:Object.freeze({BUTTON:"button",X_AXIS:"xAxis",Y_AXIS:"yAxis",STATE:"state"}),ComponentType:Object.freeze({TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON:"button"}),ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:Object.freeze({TRANSFORM:"transform",VISIBILITY:"visibility"})};function Bu(n){return Bi(this,void 0,void 0,function(){var t;return Ri(this,function(e){switch(e.label){case 0:return[4,fetch(n)];case 1:if(t=e.sent(),t.ok)return[2,t.json()];throw new Error(t.statusText)}})})}function Up(n){return Bi(this,void 0,void 0,function(){var t,e;return Ri(this,function(r){switch(r.label){case 0:if(!n)throw new Error("No basePath supplied");return t="profilesList.json",[4,Bu("".concat(n,"/").concat(t))];case 1:return e=r.sent(),[2,e]}})})}function qp(n,t){return Bi(this,arguments,void 0,function(e,r,i,a){var o,s,l,u,d,f;return i===void 0&&(i=null),a===void 0&&(a=!0),Ri(this,function(A){switch(A.label){case 0:if(!e)throw new Error("No xrInputSource supplied");if(!r)throw new Error("No basePath supplied");return[4,Up(r)];case 1:if(o=A.sent(),e.profiles.some(function(m){var h=o[m];return h&&(s={profileId:m,profilePath:"".concat(r,"/").concat(h.path),deprecated:!!h.deprecated}),!!s}),!s){if(!i)throw new Error("No matching profile name found");if(l=o[i],!l)throw new Error('No matching profile name found and default profile "'.concat(i,'" missing.'));s={profileId:i,profilePath:"".concat(r,"/").concat(l.path),deprecated:!!l.deprecated}}return[4,Bu(s.profilePath)];case 2:if(u=A.sent(),a){if(f=void 0,f=u.layouts[e.handedness],!f)throw new Error("No matching handedness, ".concat(e.handedness,", in profile ").concat(s.profileId));f.assetPath&&(d=s.profilePath.replace("profile.json",f.assetPath))}return[2,{profile:u,assetPath:d}]}})})}var Hp={xAxis:0,yAxis:0,button:0,state:We.ComponentState.DEFAULT};function Gp(n,t){n===void 0&&(n=0),t===void 0&&(t=0);var e=n,r=t,i=Math.sqrt(n*n+t*t);if(i>1){var a=Math.atan2(t,n);e=Math.cos(a),r=Math.sin(a)}var o={normalizedXAxis:e*.5+.5,normalizedYAxis:r*.5+.5};return o}var Kp=function(){function n(t){this.componentProperty=t.componentProperty,this.states=t.states,this.valueNodeName=t.valueNodeName,this.valueNodeProperty=t.valueNodeProperty,this.valueNodeProperty===We.VisualResponseProperty.TRANSFORM&&(this.minNodeName=t.minNodeName,this.maxNodeName=t.maxNodeName),this.value=0,this.updateFromComponent(Hp)}return n.prototype.updateFromComponent=function(t){var e=t.xAxis,r=t.yAxis,i=t.button,a=t.state,o=Gp(e,r),s=o.normalizedXAxis,l=o.normalizedYAxis;switch(this.componentProperty){case We.ComponentProperty.X_AXIS:this.value=this.states.includes(a)?s:.5;break;case We.ComponentProperty.Y_AXIS:this.value=this.states.includes(a)?l:.5;break;case We.ComponentProperty.BUTTON:this.value=this.states.includes(a)?i:0;break;case We.ComponentProperty.STATE:this.valueNodeProperty===We.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(a):this.value=this.states.includes(a)?1:0;break;default:throw new Error("Unexpected visualResponse componentProperty ".concat(this.componentProperty))}},n}(),jp=function(){function n(t,e){var r=this;if(!t||!e||!e.visualResponses||!e.gamepadIndices||Object.keys(e.gamepadIndices).length===0)throw new Error("Invalid arguments supplied");this.id=t,this.type=e.type,this.rootNodeName=e.rootNodeName,this.touchPointNodeName=e.touchPointNodeName,this.visualResponses={},Object.keys(e.visualResponses).forEach(function(i){var a=new Kp(e.visualResponses[i]);r.visualResponses[i]=a}),this.gamepadIndices=Object.assign({},e.gamepadIndices),this.values={state:We.ComponentState.DEFAULT,button:this.gamepadIndices.button!==void 0?0:void 0,xAxis:this.gamepadIndices.xAxis!==void 0?0:void 0,yAxis:this.gamepadIndices.yAxis!==void 0?0:void 0}}return Object.defineProperty(n.prototype,"data",{get:function(){var t=F({id:this.id},this.values);return t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(t){var e=this;if(this.values.state=We.ComponentState.DEFAULT,this.gamepadIndices.button!==void 0&&t.buttons.length>this.gamepadIndices.button){var r=t.buttons[this.gamepadIndices.button];this.values.button=r.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,r.pressed||this.values.button===1?this.values.state=We.ComponentState.PRESSED:(r.touched||this.values.button>We.ButtonTouchThreshold)&&(this.values.state=We.ComponentState.TOUCHED)}this.gamepadIndices.xAxis!==void 0&&t.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=t.axes[this.gamepadIndices.xAxis],this.values.xAxis=this.values.xAxis<-1?-1:this.values.xAxis,this.values.xAxis=this.values.xAxis>1?1:this.values.xAxis,this.values.state===We.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>We.AxisTouchThreshold&&(this.values.state=We.ComponentState.TOUCHED)),this.gamepadIndices.yAxis!==void 0&&t.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=t.axes[this.gamepadIndices.yAxis],this.values.yAxis=this.values.yAxis<-1?-1:this.values.yAxis,this.values.yAxis=this.values.yAxis>1?1:this.values.yAxis,this.values.state===We.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>We.AxisTouchThreshold&&(this.values.state=We.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(function(i){i.updateFromComponent(e.values)})},n}(),Jp=function(){function n(t,e,r){var i=this;if(!t)throw new Error("No xrInputSource supplied");if(!e)throw new Error("No profile supplied");this.xrInputSource=t,this.assetUrl=r,this.id=e.profileId,this.layoutDescription=e.layouts[t.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach(function(a){var o=i.layoutDescription.components[a];i.components[a]=new jp(a,o)}),this.updateFromGamepad()}return Object.defineProperty(n.prototype,"gripSpace",{get:function(){return this.xrInputSource.gripSpace},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"targetRaySpace",{get:function(){return this.xrInputSource.targetRaySpace},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"data",{get:function(){var t=[];return Object.values(this.components).forEach(function(e){t.push(e.data)}),t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(){var t=this;Object.values(this.components).forEach(function(e){e.updateFromGamepad(t.xrInputSource.gamepad)})},n}(),Wp="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",Xp="generic-trigger",_p=function(n){ue(t,n);function t(){var e=n.call(this)||this;return e.motionController=null,e.envMap=null,e}return t.prototype.setEnvironmentMap=function(e){var r=this;return this.envMap==e?this:(this.envMap=e,this.traverse(function(i){i instanceof c.Mesh&&i.isMesh&&(i.material.envMap=r.envMap,i.material.needsUpdate=!0)}),this)},t.prototype.updateMatrixWorld=function(e){n.prototype.updateMatrixWorld.call(this,e),this.motionController&&(this.motionController.updateFromGamepad(),Object.values(this.motionController.components).forEach(function(r){Object.values(r.visualResponses).forEach(function(i){var a=i.valueNode,o=i.minNode,s=i.maxNode,l=i.value,u=i.valueNodeProperty;a&&(u===We.VisualResponseProperty.VISIBILITY?a.visible=l:u===We.VisualResponseProperty.TRANSFORM&&(a.quaternion.copy(o.quaternion).slerp(s.quaternion,l),a.position.lerpVectors(o.position,s.position,l)))})}))},t}(Dn.Object3D);function Zp(n,t){Object.values(n.components).forEach(function(e){var r=e.type,i=e.touchPointNodeName,a=e.visualResponses;if(r===We.ComponentType.TOUCHPAD)if(e.touchPointNode=t.getObjectByName(i),e.touchPointNode){var o=new Dn.SphereGeometry(.001),s=new Dn.MeshBasicMaterial({color:255}),l=new Dn.Mesh(o,s);e.touchPointNode.add(l)}else console.warn("Could not find touch dot, ".concat(e.touchPointNodeName,", in touchpad component ").concat(e.id));Object.values(a).forEach(function(u){var d=u.valueNodeName,f=u.minNodeName,A=u.maxNodeName,m=u.valueNodeProperty;if(m===We.VisualResponseProperty.TRANSFORM){if(u.minNode=t.getObjectByName(f),u.maxNode=t.getObjectByName(A),!u.minNode){console.warn("Could not find ".concat(f," in the model"));return}if(!u.maxNode){console.warn("Could not find ".concat(A," in the model"));return}}u.valueNode=t.getObjectByName(d),u.valueNode||console.warn("Could not find ".concat(d," in the model"))})})}function Ks(n,t){Zp(n.motionController,t),n.envMap&&t.traverse(function(e){e instanceof c.Mesh&&e.isMesh&&(e.material.envMap=n.envMap,e.material.needsUpdate=!0)}),n.add(t)}var Yp=function(){function n(t){t===void 0&&(t=null),this.gltfLoader=t,this.path=Wp,this._assetCache={}}return n.prototype.createControllerModel=function(t){var e=this,r=new _p,i=null;return t.addEventListener("connected",function(a){var o=a.data;o.targetRayMode!=="tracked-pointer"||!o.gamepad||qp(o,e.path,Xp).then(function(s){var l=s.profile,u=s.assetPath;r.motionController=new Jp(o,l,u);var d=e._assetCache[r.motionController.assetUrl];if(d)i=d.scene.clone(),Ks(r,i);else{if(!e.gltfLoader)throw new Error("GLTFLoader not set.");e.gltfLoader.load(r.motionController.assetUrl,function(f){e._assetCache[r.motionController.assetUrl]=f,i=f.scene.clone(),Ks(r,i)})}}).catch(function(s){console.warn(s)})}),t.addEventListener("disconnected",function(){r.motionController=null,r.remove(i),i=null}),r},n}();function $p(n,t){return n}var js=300,ev=new c.Matrix4().makeRotationAxis(new c.Vector3(0,1,0),Math.PI),Js=new c.Vector3(-1,1,1),tv=function(n){ue(t,n);function t(e){var r=n.call(this,e)||this;r.xrManager=new Vp(r.renderer,r.renderer.getContext(),{onSessionStart:function(l){r.emit("xr.session.start",W("xr.session.start",{session:l,machineType:r.xrManager.machineType}))},onSessionEnd:function(){r.emit("xr.session.end",W("xr.session.end",{session:null,machineType:r.xrManager.machineType}))}}),r.xrControllerRay={left:new c.Raycaster,right:new c.Raycaster},r.xrControllerRay.left.params.Points={threshold:.1},r.xrControllerRay.right.params.Points={threshold:.1},r.gazeRay=null,r.pointerLines={left:new qa,right:new qa},r.pointerLines.left.visible=!1,r.pointerLines.right.visible=!0,r.pointerLines.left.setMaterial({color:new c.Vector3(1,1,1)}),r.pointerLines.left.points.material.depthTest=!1,r.pointerLines.right.setMaterial({color:new c.Vector3(1,1,1)}),r.pointerLines.right.points.material.depthTest=!1,r.controllerWrappers=[new c.Group,new c.Group];var i=r.xrManager.getController(0);r.controllerWrappers[0].add(i);var a=r.xrManager.getController(1);r.controllerWrappers[1].add(a);var o=new Yp;o.gltfLoader={load:function(l,u){yi.ajax(l,{responseType:"arraybuffer"}).then(function(d){var f;return ro(d.body,{resourcePath:l.slice(0,l.lastIndexOf("/")+1),search:(f=l.split("?")[1])!==null&&f!==void 0?f:"",fetcher:yi})}).then(function(d){return u(d)})}},(r.xrManager.machineType==="Oculus"||r.xrManager.machineType==="Pico")&&r.scene.add(r.pointerLines.left,r.pointerLines.right,r.controllerWrappers[0],r.controllerWrappers[1]),r.panoResources={},r.panoResources[r.locationMotion.keyframes[0].key=r.locationMotion.keyframes[1].key=wt()]={panoId:Ue(r.currentPano),leftPanoPicture:null,position:r.camera.pose.offset.clone(),effect:"fade",fixCameraTransform:new c.Matrix4},r.parallaxCameraMatrixs=[];var s=vt.shared.getContext();return s?(r.on("xr.session.end",function(){r.scene.remove(r.pointerLines.left,r.pointerLines.right)}),r.xrManager.setSession(s),r.on("xr.session.start",function(){var l=r.xrManager.getControllerGrip(0);l.add(o.createControllerModel(l)),r.controllerWrappers[0].add(l);var u=r.xrManager.getControllerGrip(1);u.add(o.createControllerModel(u)),r.controllerWrappers[1].add(u)}),r.xrHandleState={LeftAxesUp:{touchStartTime:0,touchStart:!1},LeftAxesDown:{touchStartTime:0,touchStart:!1},LeftAxesLeft:{touchStartTime:0,touchStart:!1},LeftAxesRight:{touchStartTime:0,touchStart:!1},LeftTrigger:{touchStartTime:0,touchStart:!1},LeftPinch:{touchStartTime:0,touchStart:!1},RightAxesUp:{touchStartTime:0,touchStart:!1},RightAxesDown:{touchStartTime:0,touchStart:!1},RightAxesLeft:{touchStartTime:0,touchStart:!1},RightAxesRight:{touchStartTime:0,touchStart:!1},RightTrigger:{touchStartTime:0,touchStart:!1},RightPinch:{touchStartTime:0,touchStart:!1},Y:{touchStartTime:0,touchStart:!1},X:{touchStartTime:0,touchStart:!1},A:{touchStartTime:0,touchStart:!1},B:{touchStartTime:0,touchStart:!1}},r.xrManager.machineType==="VP"&&r.initHandEvent(),r):(console.error("获取session失败,请退出重试"),r)}return t.parseArgs=function(e){if(e instanceof t)return e;var r=F(F({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return n.parseArgs.call(this,r)},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return F(F({},i),{mode:"XRPanorama"})},t.prototype.moveToPano=function(e,r,i){var a=this,o,s,l,u,d=(o=r.effect)!==null&&o!==void 0?o:"fade";this.userAction=i,this.stopMomentumMovement();var f=this.works.getResolvedObserver(e);if(!f)throw new Error("Invalid PanoIndex");var A=Kn(f.images.up),m=this.imageOptions.size;typeof m=="undefined"&&f&&A&&(m=Number(A)),typeof m=="undefined"&&(m=2048);var h=this.imageOptions.transform,v=function(T,B){return $p(bi(T,h,B))},y=F({key:"pano.".concat(f.panoId)},Cr(this.imageOptions,["format","size","quality"])),p=f.images,g=(l=(s=f.images.tiles)===null||s===void 0?void 0:s.filter(function(T){return T.size>m}))!==null&&l!==void 0?l:null,x="pano:"+Cn([p,y,h]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===x)return;var b=this.pendingTextureTask.panoId;(u=this.panoMeshes[b])===null||u===void 0||u.setProgress(0),this.emit("pano.texture.abort",W("pano.texture.abort",{error:null,progress:0,meta:null,pano:f.pano})),this.pendingTextureTask.onError(new Error("texture aborted"))}var w=this.models.getMaterial()||{},E=w.pano0,M=w.pano1,C;if((E==null?void 0:E.map.name)===x?C=E:(M==null?void 0:M.map.name)===x&&(C=M),C){var P={panoId:f.panoId,effect:d,leftPanoPicture:{zoom:1,map:C.map,luminanceMap:C.luminanceMap,matrix:new c.Matrix4().compose(f.position,f.quaternion,Js)},position:f.position.clone(),fixCameraTransform:new c.Matrix4};this.doMoveToPano(f.pano,P,r);return}var S="move-to-pano-"+f.panoId;this.pending.add(S),this.pendingTextureTask={panoId:f.panoId,hash:x,onLoad:function(T){if(a.pending.delete(S),a.destroyed)T.body.dispose();else{T.body.name=x;var B={panoId:f.panoId,effect:d,leftPanoPicture:{zoom:1,map:T.body,luminanceMap:null,matrix:new c.Matrix4().compose(f.position,f.quaternion,Js)},position:f.position.clone(),fixCameraTransform:new c.Matrix4};a.doMoveToPano(f.pano,B,r)}},onError:function(T){a.pending.delete(S);var B=F(F(F({},f.pano),{mode:a.mode}),_e(a.camera.pose));a.emit("pano.error",W("pano.error",{error:T,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:B})),a.emit("pano.cancel",W("pano.cancel",{error:null,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:B})),r.moveCancelCallback&&r.moveCancelCallback()}},Promise.all([this.tileLevelForFov&&g&&g.length?this.textureLoader.loadTiledCubeTexture(p,g,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:v,options:y},format:c.RGBAFormat,minFilter:c.LinearFilter,magFilter:c.LinearFilter,generateMipmaps:!1,viaAjax:!0,fetcher:it(f.work)},void 0,void 0,function(T){var B,L;a.emit("pano.texture.progress",W("pano.texture.progress",{error:null,progress:T,meta:null,pano:f.pano})),((B=a.pendingTextureTask)===null||B===void 0?void 0:B.hash)===x&&((L=a.panoMeshes[f.panoId])===null||L===void 0||L.setProgress(T))},this.renderer):this.textureLoader.loadCubeTexture(p,{imageURL:{transform:v,options:y},format:c.RGBAFormat,fetcher:it(f.work)},void 0,void 0,function(T){var B,L;((B=a.pendingTextureTask)===null||B===void 0?void 0:B.hash)===x&&((L=a.panoMeshes[f.panoId])===null||L===void 0||L.setProgress(T)),a.emit("pano.texture.progress",W("pano.texture.progress",{error:null,progress:T,meta:null,pano:f.pano}))},this.renderer)]).then(function(T){var B,L,k=T[0];((B=a.pendingTextureTask)===null||B===void 0?void 0:B.hash)===x?(a.pendingTextureTask.onLoad(k),(L=a.panoMeshes[f.panoId])===null||L===void 0||L.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.success",W("pano.texture.success",{error:null,progress:1,meta:k.meta,pano:f.pano}))):k.body.dispose()}).catch(function(T){var B,L;((B=a.pendingTextureTask)===null||B===void 0?void 0:B.hash)===x&&(a.pendingTextureTask.onError(T),(L=a.panoMeshes[f.panoId])===null||L===void 0||L.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.error",W("pano.texture.error",{error:T,progress:0,meta:null,pano:f.pano})),a.emit("error",T))}),this.emit("pano.texture.load",W("pano.texture.load",{error:null,progress:0,meta:null,pano:f.pano}))},t.prototype.doMoveToPano=function(e,r,i){var a=this,o,s,l,u,d,f,A,m,h,v;i===void 0&&(i={});var y=Me(),p=wt();this.panoResources[p]=r;var g=1,x,b,w;if(this.locationMotion.ended){var E=this.locationMotion.getKeyFrameSegment(y);E[0];var M=E[1],C=this.locationMotion.value,P=this.panoResourceFromLocationMotionKeyframe(M).position,S=r.position;x=Math.max(P.distanceTo(S),g),b=[{key:M.key,progress:0,value:F(F({},C),{count:0})},{key:p,progress:1,value:{distance:0,count:1}}],w=0}else{var T=this.locationMotion.getKeyFrameSegment(y),B=T[0],M=T[1],C=this.locationMotion.value,L=this.panoResourceFromLocationMotionKeyframe(B).position,P=this.panoResourceFromLocationMotionKeyframe(M).position,S=r.position,k=M.value.count-C.count,O=Math.max(L.distanceTo(P),g)*k,D=Math.max(P.distanceTo(S),g);x=O+D,b=[{key:B.key,progress:0,value:F({},C)},{key:M.key,progress:O/x,value:M.value},{key:p,progress:1,value:{count:M.value.count+1,distance:0}}];var N=this.locationMotionKeyframesLength(this.locationMotion.keyframes),X=this.locationMotionKeyframesLength(b);w=this.locationMotion.getProgressVelocity(y)*N/X}var K=r.effect==="instant"?0:this.calculateMovingDuration(i.duration,r.effect==="fly"?x:0),Q={longitude:i.longitude,latitude:i.latitude,fov:i.fov},G=F(F({},e),{mode:this.mode,longitude:(o=Q.longitude)!==null&&o!==void 0?o:this.camera.pose.longitude,latitude:(s=Q.latitude)!==null&&s!==void 0?s:this.camera.pose.latitude,fov:(l=Q.fov)!==null&&l!==void 0?l:this.camera.pose.fov,offset:r.position.clone(),distance:0}),J=this.currentPano;if(this.emit("pano.moveTo",W("pano.moveTo",{options:i,prevPano:J,progress:0,state:G,userAction:this.userAction,error:null})),i.moveStartCallback&&i.moveStartCallback(G),this.videoTexture&&this.videoTexture.image instanceof HTMLVideoElement&&this.videoTexture.image.getAttribute("src")&&(this.videoTexture.image.pause(),this.videoTexture.image.removeAttribute("uuid"),this.videoTexture.image.removeAttribute("src"),this.videoTexture.image.oncanplay=z,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),r.effect==="fly")this.cameraMotion.set(Q,K).catch(z);else{var H=Ft({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),j=Ft({longitude:(u=Q.longitude)!==null&&u!==void 0?u:this.cameraMotion.value.longitude,latitude:(d=Q.latitude)!==null&&d!==void 0?d:this.cameraMotion.value.latitude}),Z=new c.Object3D;Z.lookAt(H);var Y=new c.Matrix4().makeRotationFromQuaternion(Z.quaternion);Z.lookAt(j);var pe=new c.Matrix4().makeRotationFromQuaternion(Z.quaternion),ee=new c.Matrix4().getInverse(Y).premultiply(pe),oe=this.cameraMotion.value.fov,ie=(f=Q.fov)!==null&&f!==void 0?f:this.cameraMotion.value.fov,ce=1;r.effect==="zoomin"?ce=1.5:r.effect==="zoomout"&&(ce=.4);for(var ne=ie*ce,ae=0;ae<b.length-1;ae++){var de=b[ae].key;if(de){var ve=this.panoResources[de];ve&&(ve.fixCameraTransform.copy(ee),ve.leftPanoPicture&&(ve.leftPanoPicture.zoom=Math.tan(oe/2/180*Math.PI)/Math.tan(ne/2/180*Math.PI)))}}this.cameraMotion.setKeyframes([{progress:0,value:{longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude,fov:this.cameraMotion.value.fov}},{progress:0,value:{longitude:(A=Q.longitude)!==null&&A!==void 0?A:this.cameraMotion.value.longitude,latitude:(m=Q.latitude)!==null&&m!==void 0?m:this.cameraMotion.value.latitude,fov:ne}},{progress:1,value:{longitude:(h=Q.longitude)!==null&&h!==void 0?h:this.cameraMotion.value.longitude,latitude:(v=Q.latitude)!==null&&v!==void 0?v:this.cameraMotion.value.latitude,fov:ie}}],K).catch(z)}var xe=this.locationMotion.setKeyframes(b,K,w);xe.then(function(){for(var Ce,Be,$,te=0,U=a.models;te<U.length;te++){var Le=U[te];Le.show()}var Pe=F(F({},e),{mode:a.mode,longitude:a.camera.pose.longitude,latitude:a.camera.pose.latitude,fov:a.camera.pose.fov,offset:a.camera.pose.offset.clone(),distance:0});a.emit("pano.arrived",W("pano.arrived",{options:i,prevPano:J,progress:1,state:Pe,userAction:a.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(Pe);var Ie=a.works.getResolvedObserver(a.currentPano);if(Ie&&Ie.video&&a.videoTexture&&a.videoTexture.image instanceof HTMLVideoElement){var Qe=ev.clone().multiply(($=(Be=(Ce=a.models.getMaterial())===null||Ce===void 0?void 0:Ce.pano1)===null||Be===void 0?void 0:Be.matrix)!==null&&$!==void 0?$:new c.Matrix4).multiply(Ie.video.matrix),be={map:a.videoTexture,size:Ie.video.size,matrix:Qe,alpha:1},ye=wt(),ge=a.videoTexture.image;ge.setAttribute("uuid",ye),gu().then(function(me){me&&Ie.video&&ge.getAttribute("uuid")===ye&&(ge.oncanplay=function(){ge.oncanplay=z,ge.play()},ge.ontimeupdate=function(){ge.currentTime>.5&&(ge.ontimeupdate=z,a.panoVideo.setMaterial(be))},ge.src=Ie.video.source)}).catch(function(){ge.removeAttribute("uuid")})}},function(){a.emit("pano.cancel",W("pano.cancel",{options:i,prevPano:J,progress:0,state:G,userAction:a.userAction,error:null})),i.moveCancelCallback&&i.moveCancelCallback()})},t.prototype.checkSelectedPano=function(e){var r=this,i,a,o,s;this.stopMomentumMovement();var l=this.camera.getDirection(new c.Vector3).setY(0),u=null,d=this.works.getResolvedObserver(this.currentPano);if(!d)return null;var f=d.accessibleIds.filter(function(j){var Z=pt(j);if(_t(Z,r.currentPano))return!1;var Y=r.works.getResolvedObserver(Z);return!Y||Y.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:Y.loadable||Y.active}),A=this.models.intersectRaycaster(e)[0];if(A){var m=ur(f,function(j){var Z=r.works.getResolvedObserver(j);if(!Z)return 1/0;var Y=Z.standingPosition.clone();return Y.distanceTo(A.point)},!0),h=m[0],v=m[1];h&&v<this.panoTapTriggerRadius&&(u=(i=this.works.getResolvedObserver(h))!==null&&i!==void 0?i:null)}if(Us(u)){var y=this.getForwardObserverOrNot(e);y&&(u=y)}for(var p=0,g=this.locationMotion.keyframes;p<g.length;p++){var x=g[p],b=this.panoResourceFromLocationMotionKeyframe(x);if(!(x.progress<this.locationMotion.progress)&&u&&b.panoId===u.panoId){u=null;break}}if(Us(u))return this.locationMotion.ended===!0&&this.cameraBounce(),null;if(u&&!u.active){var w=u.panoId;this.panoMeshes[w]&&(this.panoMeshes[w].setDisabled(!1),this.panoMeshes[w].setLoading(!0))}var E={};if(u){for(var M=Math.PI/6,C=Math.PI/12,P=new c.Vector3(0,1,0),S=u.position.clone().setY(0).sub(d.position.clone().setY(0)).normalize(),T=S.clone().applyAxisAngle(P,M),B=S.clone().applyAxisAngle(P,-M),L=[],k=[],O=[],D=0,N=u.accessibleIds;D<N.length;D++){var h=N[D],X=pt(h);if(!(_t(X,this.currentPano)||_t(X,u.pano))){var K=this.works.getResolvedObserver(h);if(K){var Q=K.position.clone().sub(u.position).setY(0);S.angleTo(Q)<M?O.push(Q):T.angleTo(Q)<M?L.push(Q):B.angleTo(Q)<M&&k.push(Q)}}}var G=O.length>0?O:bt(bt([],L,!0),k,!0),J=G.slice().sort(function(j,Z){return j.angleTo(S)-Z.angleTo(S)})[0];J&&J.angleTo(l)>C&&(E.longitude=Math.atan2(-J.x,-J.z))}this.cameraMotion.value.latitude<-Math.PI/4&&(E.latitude=he(0,this.minLatitude,this.maxLatitude)),this.cameraMotion.value.fov<60&&(E.fov=this.defaultFov);var H={workCode:u.pano.workCode,panoIndex:u.pano.panoIndex,mode:this.mode,longitude:(a=E.longitude)!==null&&a!==void 0?a:this.camera.pose.longitude,latitude:(o=E.latitude)!==null&&o!==void 0?o:this.camera.pose.latitude,fov:(s=E.fov)!==null&&s!==void 0?s:this.camera.pose.fov,distance:0,offset:u?u.position.clone():new c.Vector3};return this.emit("pano.select",W("pano.select",{prevPano:this.currentPano,state:H,userAction:!0,options:E,progress:0,error:null})),u&&u.active?(this.emit("pano.request",W("pano.request",{userAction:!0,prevPano:this.currentPano,progress:0,state:H,options:E,error:null})),u.pano):null},t.prototype.destroy=function(){n.prototype.destroy.call(this)},t.prototype.isReady=function(){return!1},t.prototype.updateCamera=function(e,r,i){return Promise.resolve()},t.prototype.updateCameraWithKeyframes=function(e,r,i){return Promise.resolve()},t.prototype.updateTime=function(e,r){for(var i=this,a,o,s,l,u,d,f,A,m=[],h=2;h<arguments.length;h++)m[h-2]=arguments[h];this.userAction=!0;var v={},y={},p=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),g=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),x=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),y.longitude=this.cameraMotion.value.longitude,y.latitude=this.cameraMotion.value.latitude,y.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),v.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(he(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var b=this.locationMotion.getKeyFrameSegment(e),w=b[0],E=b[1],M=this.panoResourceFromLocationMotionKeyframe(w),C=this.panoResourceFromLocationMotionKeyframe(E),P=new c.Vector3().copy(M.position),S=new c.Vector3().copy(C.position),T=this.locationMotion.value.count-E.value.count+1;v.progress=T,C.leftPanoPicture&&(T<1?M.leftPanoPicture&&(v.pano0=M.leftPanoPicture):v.pano0=C.leftPanoPicture,v.pano1=C.leftPanoPicture),C.effect==="montage"?v.transition="BLACK":C.effect==="spread"?v.transition="SPREAD":v.transition="FADE",(C.effect==="zoomin"||C.effect==="zoomout")&&(v.progress=Math.pow(T,3)),T<1&&C.effect!=="fly"&&(v.pano0&&M.leftPanoPicture&&(v.pano0={map:v.pano0.map,zoom:v.pano0.zoom,luminanceMap:v.pano0.luminanceMap,matrix:M.leftPanoPicture.matrix.clone().setPosition(C.position)}),P.copy(S),x=!0),y.distance=this.locationMotion.value.distance,y.offset=new c.Vector3(P.x+(S.x-P.x)*T,P.y+(S.y-P.y)*T,P.z+(S.z-P.z)*T);for(var B=[],L=[],k=0,O=this.locationMotion.keyframes;k<O.length;k++){var D=O[k],N=D.key,X=D.progress;N!==void 0&&(B.push(N),X>this.locationMotion.progress&&L.push(N))}for(var K=0,Q=Object.keys(this.panoResources);K<Q.length;K++){var G=Q[K];if(!(L.indexOf(G)>=0)){var J=this.panoResources[G];if(J.leftPanoPicture){var H=J.leftPanoPicture.map;if(H){if(H===((a=v.pano0)===null||a===void 0?void 0:a.map)||H===((o=v.pano1)===null||o===void 0?void 0:o.map))continue;H instanceof De&&H.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(H.cubeRenderTarget),H.dispose(),J.leftPanoPicture=null}}B.indexOf(G)>=0||delete this.panoResources[G]}}this.currentPano=pt(C.panoId),this.emit("pano.moving",W("pano.moving",{userAction:this.userAction,prevPano:pt(p.panoId),state:F(F(F(F({},pt(g.panoId)),{mode:this.mode}),_e(this.camera.pose)),y),options:{},progress:this.locationMotion.progress,error:null}))}Nt(v)===!1&&(!((s=v.pano0)===null||s===void 0)&&s.map&&v.pano0.map instanceof De&&!v.pano0.map.cubeRenderTarget&&(v.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((l=v.pano1)===null||l===void 0)&&l.map&&v.pano1.map instanceof De&&!v.pano1.map.cubeRenderTarget&&(v.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),this.models.setMaterial(v)),Nt(y)===!1&&this.setCamera(y);var j=this.works.getResolvedObserver(this.currentPano),Z=m[1];if(!Z){console.error("xrFrame丢失,请重试");return}if(!this.xrManager.session){console.error("session丢失,请重试");return}var Y=this.xrManager.referenceSpace;if(Y){var pe=this.xrManager.cameraVR,ee=this.xrManager.cameraL,oe=this.xrManager.cameraR,ie=[ee,oe],ce=Z.getViewerPose(Y),ne=new c.Vector3(0,0,0);if(ce){var ae;ae=this.xrManager.session.renderState.baseLayer;var de=ce.views;if(!ae){console.error("no layer found");return}this.renderer.setFramebuffer(ae.framebuffer);var ve=!1;de.length!==pe.cameras.length&&(pe.cameras.length=0,ve=!0),this.parallaxCameraMatrixs=[];var xe=new c.Vector3,Ce=new c.Vector3;new c.Matrix4().fromArray(de[0].transform.matrix).decompose(xe,new c.Quaternion,new c.Vector3),new c.Matrix4().fromArray(de[1].transform.matrix).decompose(Ce,new c.Quaternion,new c.Vector3),Ce.clone().sub(xe).normalize();var Be=new c.Vector3,$=new c.Quaternion,te=new c.Vector3;this.camera.matrix.decompose(Be,$,te);for(var U=0;U<de.length;U++){var Le=de[U],Pe=ae.getViewport(Le),Ie=ie[U];Ie.matrix.fromArray(Le.transform.matrix);var Qe=new c.Vector3,be=new c.Quaternion,ye=new c.Vector3;Ie.matrix.decompose(Qe,be,ye),ne.copy(Be),Ie.position.copy(Be),Ie.quaternion.copy(be),Ie.scale.copy(ye),Ie.updateMatrix(),Ie.projectionMatrix.fromArray(Le.projectionMatrix),Ie.viewport.set(Pe.x,Pe.y,Pe.width,Pe.height),ve===!0&&pe.cameras.push(Ie)}if(this.xrManager.session&&this.xrManager.session.inputSources){for(var U=0;U<this.xrManager.session.inputSources.length;U++)if(this.xrManager.session.inputSources[U]&&this.xrManager.session.inputSources[U].targetRayMode==="transient-pointer"){var ge=Z.getPose(this.xrManager.session.inputSources[U].targetRaySpace,Y);if(ge){var me=new c.Vector3(0,0,-1).applyQuaternion(ge.transform.orientation),Ae=new c.Raycaster(this.camera.position,me);this.gazeRay=Ae}}}if(this.xrManager.machineType==="Oculus"||this.xrManager.machineType==="Pico"){for(var Ne=this.xrManager.session.inputSources,U=0;U<Ne.length;U++){var ze=this.xrManager.controllers[U],je=Ne[U];if(je){ze&&ze.update(je,Z,Y);var Ae=this.xrManager.getController(U),cr=new c.Vector3(0,1.2,0),Fe=Ae.position.clone().add(ne).sub(cr);je.handedness==="left"?this.xrControllerRay.left.set(Fe,new c.Vector3(0,0,-1).applyEuler(Ae.rotation)):je.handedness==="right"&&this.xrControllerRay.right.set(Fe,new c.Vector3(0,0,-1).applyEuler(Ae.rotation)),this.controllerWrappers[U].position.copy(new c.Vector3(0,0,0).add(ne).sub(cr));var Ye=this.models.intersectRaycaster(this.xrControllerRay.right);if(Ye.length===0&&(Ye=this.xrControllerRay.right.intersectObject(this.boundingMesh,!0).map(function(Ir){var Wr;return F({floor:(Wr=j==null?void 0:j.floorIndex)!==null&&Wr!==void 0?Wr:0},Ir)})),Ye.length>=1&&Ye[0].face)if(je.handedness==="right"){var ot=this.xrControllerRay.right.intersectObject(this.xrCustomObjectsScene,!0),Yt=Ye[0].face.normal,on=Yt.clone(),$t=Ye[0].point.clone();this.intersectMesh.position.copy($t);var St=$t.clone().add(on);if(this.intersectMesh.lookAt(St),Math.abs(Yt.y)>.99){var er=this.camera.position.clone().sub($t);this.intersectMesh.rotation.z=-Math.atan2(er.z,er.x)}this.intersectMesh.visible=!0,this.needsRender=!0,ot.length>0?(this.pointerLines.right.setPoints(Fe,ot[0].point),this.pointerLines.right.points.visible=!0,this.intersectMesh.visible=!1):(this.pointerLines.right.points.visible=!1,this.pointerLines.right.setPoints(Fe,Ye[0].point));var Mr=Ye[0],Dt=W("intersect.update",{raycaster:(u=this.xrControllerRay.right)!==null&&u!==void 0?u:null,intersection:Mr!=null?Mr:null,object:this.intersectMesh});if(this.emit("intersect.update",Dt),Dt.defaultPrevented){this.hideIntersectMesh();return}}else this.pointerLines.left.setPoints(Fe,Ye[0].point)}}this.updateControllerHelper(Ne,e,r)}if(this.camera.pose.distance>.1||x)for(var tr=0,zt=Object.keys(this.panoMeshes);tr<zt.length;tr++){var lt=zt[tr],Oe=this.panoMeshes[lt];Oe.setOpacity(0),Oe.setCurrent(!1),Oe.updateTime&&Oe.updateTime(e,r),Oe.visible=!1}else if(j){var dr=ur(j.visibleIds,function(ct){var qt=i.works.getResolvedObserver(ct);return qt?j.standingPosition.distanceTo(qt.standingPosition):1/0},!0),At=dr[1];At=he(At,2.5,1/0);for(var fr=j.visibleIds.concat(Ue(this.currentPano)),hr=this.getForwardObserverOrNot(),Qt=this.camera.getDirection(new c.Vector3),Et=0,pr=Object.keys(this.panoMeshes);Et<pr.length;Et++){var lt=pr[Et],Oe=this.panoMeshes[lt],Sr=this.works.getResolvedObserver(lt);if(fr.indexOf(lt)===-1)Oe.setCurrent(!1),Oe.setOpacity(0);else if(!Sr)Oe.setCurrent(!1),Oe.setOpacity(0);else if(!Sr.loadable&&!Sr.active)Oe.setCurrent(!1),Oe.setOpacity(0);else{var sn=Oe.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);Oe.setCurrent(!Oe.loading&&Oe.progress===0&&hr!==null&&hr.panoId===lt),Oe.setOpacity(sn<.01?0:he(At/sn*1.2,.65,.98));var jr=this.camera.position.clone().setY(Oe.position.y),me=new c.Vector3().copy(Oe.position).sub(jr).normalize();if(lt===Ue(this.currentPano)){var Jr=he((.5-jr.distanceTo(Oe.position))/.5,0,1);me.multiplyScalar(1-Jr).add(Qt.clone().multiplyScalar(Jr))}me.length()>0&&Oe.quaternion.setFromEuler(new c.Euler(0,Math.atan2(me.x,me.z),0))}Oe.updateTime&&Oe.updateTime(e,r)}}var Ut=function(){return 4}(),$e=function(){var ct=new c.PerspectiveCamera;ct.applyMatrix4(pe.matrix),ct.position.set(0,0,0);var qt=i.works.getResolvedObserver(g.panoId),Ir=qt!=null?qt:j;Ir&&ct.quaternion.premultiply(Ir.quaternion.clone().inverse()),ct.updateProjectionMatrix(),ct.updateMatrixWorld(!0);var Wr=new c.Frustum().setFromProjectionMatrix(new c.Matrix4().multiplyMatrices(ct.projectionMatrix,ct.matrixWorldInverse));return Wr}();g.panoId===Ue(this.currentPano)&&((d=g.leftPanoPicture)===null||d===void 0?void 0:d.map)instanceof De&&(g.leftPanoPicture.map.maxRequest=this.tileMaxRequest,g.leftPanoPicture.map.update($e,Ut),g.leftPanoPicture.map.needsRender===!0&&(this.needsRender=!0,this.modelSceneNeedsRender=!0));{var Ge=this.tiling.object.visible;if(this.initAnimationed){var nt=g.panoId,mt=this.works.getResolvedObserver(nt);mt?Zn(this.camera.position,mt.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==nt&&this.tiling.cleanup(),this.tiling.panoId=nt,this.tiling.setResource((A=(f=mt.images)===null||f===void 0?void 0:f.tiles)!==null&&A!==void 0?A:[],this.enableIOSEDR&&mt.images.luminance?mt.images.luminance:null),this.tiling.setFetcher(it(mt.work)),this.tiling.setRotation(mt.quaternion),this.tiling.setPosition(mt.position),this.tiling.maxRequest=this.tileMaxRequest,Ut>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update($e,Ut,e):this.tiling.update($e,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;Ge!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0,this.modelSceneNeedsRender=!0)}this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e)}}},t.prototype.render=function(){var e=this.xrManager.getCamera(this.camera);this.renderer.render(this.modelScene,e),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,e),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0},t.prototype.onPanGesture=function(){},t.prototype.onTapGesture=function(){},t.prototype.onPinchGesture=function(){},t.prototype.onMouseMove=function(){},t.prototype.onMouseOut=function(){},t.prototype.panoResourceFromLocationMotionKeyframe=function(e){return this.panoResources[e.key]},t.prototype.updateControllerHelper=function(e,r,i){var a=this.xrControllerRay.left,o=this.xrControllerRay.right;if(!(!e||e.length===0)){for(var s={buttons:{X:!1,Y:!1,LeftTrigger:!1,LeftPinch:!1,A:!1,B:!1,RightTrigger:!1,RightPinch:!1}},l=0;l<e.length;l++){var u=e[l].handedness,d=e[l].gamepad;switch(u){case"left":d.axes&&(this.emitHandleEvent(d.axes[2]===-1,"LeftAxesLeft",r),this.emitHandleEvent(d.axes[2]===1,"LeftAxesRight",r),this.emitHandleEvent(d.axes[3]===-1,"LeftAxesUp",r),this.emitHandleEvent(d.axes[3]===1,"LeftAxesDown",r)),d!=null&&d.buttons&&(d.buttons[4]&&this.emitHandleEvent(d.buttons[4].pressed,"X",r),d.buttons[5]&&this.emitHandleEvent(d.buttons[5].pressed,"Y",r),d.buttons[0]&&this.emitHandleEvent(d.buttons[0].pressed,"LeftTrigger",r),d.buttons[1]&&this.emitHandleEvent(d.buttons[1].pressed,"LeftPinch",r));var f={raycaster:a,axes:{up:d.axes&&d.axes[3]<0?Math.abs(d.axes[3]):0,down:d.axes&&d.axes[3]<0?0:Math.abs(d.axes[3]),left:d.axes&&d.axes[2]<0?Math.abs(d.axes[2]):0,right:d.axes&&d.axes[2]<0?0:Math.abs(d.axes[2])},deltaTime:i};s.buttons.X=d.buttons&&d.buttons[4]?d.buttons[4].pressed:!1,s.buttons.Y=d.buttons&&d.buttons[5]?d==null?void 0:d.buttons[5].pressed:!1,s.buttons.LeftTrigger=d.buttons&&d.buttons[0]?d==null?void 0:d.buttons[0].pressed:!1,s.buttons.LeftPinch=d.buttons&&d.buttons[1]?d==null?void 0:d.buttons[1].pressed:!1,s.left=f;break;case"right":d.axes&&(this.emitHandleEvent(d.axes[2]===-1,"RightAxesLeft",r),this.emitHandleEvent(d.axes[2]===1,"RightAxesRight",r),this.emitHandleEvent(d.axes[3]===-1,"RightAxesUp",r),this.emitHandleEvent(d.axes[3]===1,"RightAxesDown",r)),d.buttons&&(d.buttons[4]&&this.emitHandleEvent(d.buttons[4].pressed,"A",r),d.buttons[5]&&this.emitHandleEvent(d.buttons[5].pressed,"B",r),d.buttons[0]&&this.emitHandleEvent(d.buttons[0].pressed,"RightTrigger",r),d.buttons[1]&&this.emitHandleEvent(d.buttons[1].pressed,"RightPinch",r));var A={raycaster:o,axes:{up:d.axes&&d.axes[3]<0?Math.abs(d.axes[3]):0,down:d.axes&&d.axes[3]<0?0:Math.abs(d.axes[3]),left:d.axes&&d.axes[2]<0?Math.abs(d.axes[2]):0,right:d.axes&&d.axes[2]<0?0:Math.abs(d.axes[2])},deltaTime:i};s.right=A,s.buttons.A=d.buttons&&d.buttons[4]?d==null?void 0:d.buttons[4].pressed:!1,s.buttons.B=d.buttons&&d.buttons[5]?d==null?void 0:d.buttons[5].pressed:!1,s.buttons.RightTrigger=d.buttons&&d.buttons[0]?d==null?void 0:d.buttons[0].pressed:!1,s.buttons.RightPinch=d.buttons&&d.buttons[1]?d==null?void 0:d.buttons[1].pressed:!1;break}}this.emit("xr.controller.update",W("xr.controller.update",s))}},t.prototype.emitHandleEvent=function(e,r,i){var a=this.xrControllerRay.left,o=this.xrControllerRay.right;if(e)if(this.xrHandleState[r].touchStart===!1)this.xrHandleState[r].touchStartTime=i,this.xrHandleState[r].touchStart=!0,this.emit("xr.gesture.buttonDown",W("xr.gesture.buttonDown",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!1,isFirst:!0,controllers:{raycaster:{leftRay:a,rightRay:o}}}));else{var s=i-this.xrHandleState[r].touchStartTime;s>js&&this.emit("xr.gesture.press",W("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!0,controllers:{raycaster:{leftRay:a,rightRay:o}}}))}else if(this.xrHandleState[r].touchStart===!0){this.emit("xr.gesture.buttonUp",W("xr.gesture.buttonUp",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:a,rightRay:o}}}));var s=i-this.xrHandleState[r].touchStartTime;if(s<=js){var l=W("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:a,rightRay:o}}}),u=this.emit("xr.gesture.tap",l);!u&&!l.defaultPrevented&&r==="RightTrigger"&&this.checkSelectedPano(this.xrControllerRay.right)}this.xrHandleState[r].touchStart=!1,this.xrHandleState[r].touchStartTime=0}},t.prototype.initHandEvent=function(){var e=this;if(!this.xrManager.session)throw new Error("初始化失败");this.xrManager.session.addEventListener("select",function(r){e.gazeRay&&e.checkSelectedPano(e.gazeRay)})},t}(Ao),Pt={Floorplan:Ua,Topview:Ih,Panorama:Ao,VRPanorama:bp,Model:wp,Mapview:Fp,XRPanorama:tv},Ru=["gesture.pan","gesture.tap","gesture.press","gesture.pinch","gesture.mousewheel","gesture.mousemove","gesture.momentum","initAnimation.start","initAnimation.end","camera.update","intersect.update","pano.select","pano.moveTo","pano.moving","pano.arrived","pano.cancel","pano.error","pano.texture.load","pano.texture.progress","pano.texture.success","pano.texture.error","pano.texture.abort","xr.session.start","xr.session.end","xr.gesture.tap","xr.gesture.press","xr.gesture.buttonUp","xr.gesture.buttonDown","xr.controller.update"];function rv(n){n.on("initAnimation.start",function(t){n.emit("initAnimationWillStart",t.state.panoIndex,t.state,t.userAction)}),n.on("initAnimation.end",function(t){n.emit("initAnimationEnded",t.state.panoIndex,t.state,t.userAction)}),n.on("gesture.pan",function(t){var e=!1;e=n.emit("wantsGesture","pan",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPanGesture",t.state,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","pan",t.pointers,t.isFinal),n.emit("panGesture",t.state,t.isFinal))}),n.on("gesture.tap",function(t){var e=!1;e=n.emit("wantsGesture","tap",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsTapGesture",t.center.raycaster,t.center.coords,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","tap",t.pointers,t.isFinal),n.emit("tapGesture",t.center.raycaster,t.center.coords,t.isFinal))}),n.on("gesture.press",function(t){var e=!1;e=n.emit("wantsGesture","press",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPressGesture",t.center.raycaster,t.center.coords,t.center.delta,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","press",t.pointers,t.isFinal),n.emit("pressGesture",t.center.raycaster,t.center.coords,t.center.delta,t.isFinal))}),n.on("gesture.pinch",function(t){var e=!1;e=n.emit("wantsGesture","pinch",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPinchGesture",t.scale,t.state.fov,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","pinch",t.pointers,t.isFinal),n.emit("pinchGesture",t.scale,t.state.fov,t.isFinal))}),n.on("gesture.mousewheel",function(t){var e=!1;e=n.emit("wantsGesture","mouseWheel",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsMouseWheel",t.center.delta,t.state.fov,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","mouseWheel",t.pointers,t.isFinal),n.emit("mouseWheel",t.center.delta,t.state.fov,t.isFinal))}),n.on("gesture.mousemove",function(t){var e=!1;e=n.emit("wantsGesture","mouseMove",t.pointers,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","mouseMove",t.pointers,t.isFinal),e=n.emit("wantsChangeCameraFov",t.state.fov),e&&t.preventDefault())}),n.on("gesture.momentum",function(t){var e=!1;e=n.emit("wantsInteriaPan",t.state),e&&t.preventDefault(),t.defaultPrevented||n.emit("interiaPan",t.state,t.isFinal)}),n.on("camera.update",function(t){n.emit("cameraFovUpdate",t.state.fov,t.userAction),n.emit("cameraDirectionUpdate",t.state,t.userAction);var e=Ft(t.state);e.setLength(t.state.distance);var r=t.state.offset.clone().sub(e);n.emit("cameraPositionUpdate",r,t.userAction),n.emit("cameraUpdate",t.state,t.userAction)}),n.on("intersect.update",function(t){if(t.intersection){var e=!1;e=n.emit("wantsShowIntersectionOnModel",t.raycaster),e&&t.preventDefault(),t.defaultPrevented||n.emit("intersectionOnModelUpdate",t.intersection,t.object)}else n.emit("intersectionHidden")}),n.on("pano.request",function(t){var e=n.emit("wantsMoveToPano",t.state.panoIndex,t.options,t.userAction);e||(e=n.emit("wantsToMoveToPano",t.state.panoIndex,t.options,t.userAction)),e&&t.preventDefault(),t.defaultPrevented||n.emit("panoWillLoad",t.state.panoIndex)}),n.on("pano.select",function(t){n.emit("panoSelected",t.state.panoIndex)}),n.on("pano.moveTo",function(t){n.emit("panoLoaded",t.state.panoIndex),n.emit("moveToPano",t.state.panoIndex,t.userAction),n.emit("panoWillArrive",t.state.panoIndex,t.state,t.userAction)}),n.on("pano.moving",function(t){n.emit("movingToPano",t.state.panoIndex,t.prevPano.panoIndex,t.progress)}),n.on("pano.arrived",function(t){n.emit("panoArrived",t.state.panoIndex,t.state,t.userAction)}),n.on("pano.cancel",function(t){n.emit("moveToPanoCanceled",t.state.panoIndex)}),n.on("pano.error",function(t){n.emit("panoLoadError",t.error,t.state.panoIndex)}),n.on("pano.texture.load",function(t){n.emit("textureStartLoad",t.pano.panoIndex)}),n.on("pano.texture.success",function(t){n.emit("textureLoaded",t.pano.panoIndex,t.meta)}),n.on("pano.texture.error",function(t){n.emit("textureError",t.error,t.pano.panoIndex)}),n.on("pano.texture.abort",function(t){n.emit("textureAbort",t.pano.panoIndex)}),n.on("pano.texture.progress",function(t){n.emit("textureLoading",t.progress,t.pano.panoIndex)}),n.on("xr.session.start",function(t){n.emit("webXRSessionStart")}),n.on("xr.session.end",function(t){n.emit("webXRSessionEnd")}),n.on("xr.gesture.tap",function(t){n.emit("webXRControllerEvent","tap",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.press",function(t){n.emit("webXRControllerEvent","press",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.buttonUp",function(t){n.emit("webXRControllerEvent","buttonUp",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.buttonDown",function(t){n.emit("webXRControllerEvent","buttonDown",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.controller.update",function(t){n.emit("webXRControllerRayUpdate",{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0}),t.left&&n.emit("webXRAxesUpdate","left",{raycaster:{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0},axesState:{up:t.left.axes.up,down:t.left.axes.down,left:t.left.axes.left,right:t.left.axes.right},deltaTime:t.left.deltaTime}),t.right&&n.emit("webXRAxesUpdate","right",{raycaster:{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0},axesState:{up:t.right.axes.up,down:t.right.axes.down,left:t.right.axes.left,right:t.right.axes.right},deltaTime:t.right.deltaTime})}),n.on("works.request",function(t){n.emit("willLoad",t.input,t.works[0],t.state)}),n.on("works.load",function(t){n.emit("load",t.input,t.works[0],t.state)}),n.on("works.ready",function(t){n.emit("loaded",t.input,t.works[0])}),n.on("state.change",function(t){n.emit("stateChange",t.state,t.userAction)}),n.on("currentState.change",function(t){n.emit("currentStateChange",t.state,t.userAction)}),n.on("state.set",function(t){n.emit("setState",t.state)}),n.on("state.synced",function(t){n.emit("stateSynced",t.state)}),n.on("model.request",function(t){n.emit("modelWillLoad",t.work.model)}),n.on("model.error",function(t){n.emit("modelLoadError",t.error,t.model)}),n.on("model.load",function(t){n.emit("modelLoaded",t.model)}),n.on("model.changeShownFloor",function(t){n.emit("modelShownFloorChange",t.model.shownFloor,t.model.floorLength)}),n.on("render",function(t){n.emit("renderFrame",t.needsRender)}),n.on("mode.change.request",function(t){n.emit("wantsChangeMode",t.mode,t.prevMode)}),n.on("mode.change",function(t){n.emit("modeChange",t.mode,t.prevMode,t.state.panoIndex,t.state,t.userAction)}),n.on("helpers.visible",function(t){n.emit("helpersVisibleChange",t.object.visible)}),n.on("network.resource",function(t){n.emit("network",t.source,t.requestType,t.requestState,t.detail)})}function nv(){if(typeof window!="undefined"){var n=document.createElement("video");n.loop=!0,n.autoplay=!0,n.playsInline=!0,n.muted=!0,n.crossOrigin="";var t=function(){document.removeEventListener("touchstart",t,!1),document.removeEventListener("mousedown",t,!1),n.muted=!1};return document.addEventListener("touchstart",t,!1),document.addEventListener("mousedown",t,!1),n}else return{}}function Ws(n){{var t=new c.DirectionalLight(16777215,.3);t.position.copy(new c.Vector3(1,1,1)),n.add(t)}{var t=new c.DirectionalLight(16777215,.1);t.position.copy(new c.Vector3(-1,-1,-1)),n.add(t)}{var t=new c.DirectionalLight(16777215,.1);n.add(t)}{var t=new c.AmbientLight(16777215,.6);n.add(t)}}function iv(n){for(var t,e,r={},i=n.split(/(\;|\,)/),a=0,o=i;a<o.length;a++){var s=o[a],l=s.split("="),u=(t=l[0])===null||t===void 0?void 0:t.trim(),d=(e=l[1])===null||e===void 0?void 0:e.trim();u&&d&&(r[u]=d)}return r}function ku(){var n;if(typeof document!="undefined")for(var t=document.getElementsByTagName("meta"),e=0;e<t.length;e++){var r=t[e];if(r.getAttribute("name")==="viewport"){var i=iv((n=r.getAttribute("content"))!==null&&n!==void 0?n:""),a=Number(i["initial-scale"]);if(!isNaN(a))return a}}return 1}const av="data:image/png;base64,iVBORw0KGgoAAAAN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FJKpSZqV7G1GTxcpmEthpnw5058c6GfwqpwzGOtGjXSJI3FLYhc+O+jSr9aGhPWQlRshS8AticLX7wnsgbXxt6gsWCpRBa0vRGQM8oB9dhmP3QAwFX4c079dJNq6Qi5xbuyTmpPSJ1Ur4UtF7GoTtmUL3zxaWqMU8P/k3cXSQ1EQRjHGdzdHTa4u7tzBs7CedhykNwF2/5jq56iU11db6Lv2yTj8hs3JoiU9sZZp5/62J5v1z9NjrDHaSbnbFMf52sHrDUVaidDxNG0o9+uLjfosfdb3jT5d5j757riJgst9NIZQ2Pn+ySZll80vjI6Wz/hQJG4vPG0L/H6poQch/dW3vL3B0u8jl0HvVj5PvHCElEF8DUAFikVYTcvmfBdDzQlvvMXSV5lP5zrXj/fJ54zuWaeeuoqkW8AwCIaqeTZKkmYrpPwR2eqN9X72W7EG57vU67OBeuMV8KXLUzv93UTTj42tvaFS++GVsc5JRyLSLJ8nzO555hFBmiSRCqMr4GwrcmGkib5xSvcwmzFK6e8s7DMa2xH4YZdZumSOwsVzFeBWdr37tpIhOpSwXqONNgZq/2KgvBt54znHN1HzlljTO4oVD5fb+prNIJXQNL1ofDKQisbPLJDv3jNSLq9OkYBEIihKIj3v7S1TRQCX5Kdl1ZQlol7LF+E++fwirfiq2sf4cTXxc6hzxffPuLEeqSWrPGWMF58TWr5viyJAP5/4EV4KePiaSE8eNRgjDy8/tyRW+FZjhS+2tlovNJovtJovNJ0uhK6Wo64SDdxEbM//KesjwAAAABJRU5ErkJggg==";var Xs=[351,63],_s=[20,20],ov=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),sv=new Float32Array([0,0,1,0,0,1,1,1]),uv=new Uint8Array([0,1,2,1,3,2]),Ni=new c.BufferGeometry;Ni.setAttribute("position",new c.BufferAttribute(ov,3));Ni.setAttribute("uv",new c.BufferAttribute(sv,2));Ni.setIndex(new c.BufferAttribute(uv,1));var mi=new c.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1,fog:!1}),Fu=new c.Mesh(Ni,mi);Fu.matrixAutoUpdate=!1;var xo=new c.Scene;xo.add(Fu);xo.matrixAutoUpdate=!1;var Yn=new c.OrthographicCamera(-.5,.5,.5,-.5,.1,1);Yn.position.set(0,0,.5);Yn.lookAt(0,0,0);Yn.updateMatrixWorld(!0);Yn.matrixAutoUpdate=!1;var lv=new c.Vector4,cv=new c.Vector4;function dv(n){if(mi.map){var r=n.getViewport(lv),i=n.getScissor(cv),a=n.getScissorTest(),o=n.autoClear,s=i.x+_s[0]/3,l=i.y+_s[1]/3,u=Xs[0]/3,d=Xs[1]/3;n.setViewport(s,l,u,d),n.setScissor(s,l,u,d),n.setScissorTest(!0),n.autoClear=!1,n.render(xo,Yn),n.setViewport(r),n.setScissor(i),n.setScissorTest(a),n.autoClear=o}else{var t=new c.Texture,e=new Image;e.onload=function(){t.image=e,t.wrapS=c.ClampToEdgeWrapping,t.wrapT=c.ClampToEdgeWrapping,t.minFilter=c.LinearFilter,t.needsUpdate=!0,t.generateMipmaps=!1,mi.needsUpdate=!0,e.onload=z},e.src=av,mi.map=t}}var fv=800,Zs=90,hv=function(n){return n.replace("//vrlab-public.ljcdn.com/","//vr-public.realsee-cdn.cn/").replace("//vrlab-image4.ljcdn.com/","//vr-image-4.realsee-cdn.cn/").replace("//vrlab-image3.ljcdn.com/","//vr-image-3.realsee-cdn.cn/").replace("//vrlab-image2.ljcdn.com/","//vr-image-2.realsee-cdn.cn/").replace("//vrlab-image1.ljcdn.com/","//vr-image-1.realsee-cdn.cn/")},pv=new c.Vector2,li=new c.Frustum,ci=new c.Matrix4,Ys=new WeakMap,ba=new WeakMap,$s=Va([]),Lu=function(n){ue(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,l,u,d,f,A,m,h=n.call(this)||this;if(h.ident=wt(),typeof window!="undefined"&&(Ha.instances[h.ident]=h),h.renderSwitch01=0,h.currentMode="Panorama",h.pano={workCode:"",panoIndex:0},h.needsRender=!1,h.modelSceneNeedsRender=!1,h.onlyRenderIfNeeds=(r=e.onlyRenderIfNeeds)!==null&&r!==void 0?r:!0,h.imageOptions=F({},(i=e.imageOptions)!==null&&i!==void 0?i:{}),h.textureOptions=F({},(a=e.textureOptions)!==null&&a!==void 0?a:{}),h.poweredByRealsee=(o=e.poweredByRealsee)!==null&&o!==void 0?o:!0,h.extraElements=[],h.controllerInits={Panorama:Object.assign({},e.panorama),Model:Object.assign({},e.model),Floorplan:Object.assign({},e.floorplan),Topview:Object.assign({},e.topview),Mapview:Object.assign({},e.mapview),VRPanorama:Object.assign({},e.vrPanorama),XRPanorama:Object.assign({},e.xrPanorama)},h.fps={testCount:0,testTime:Me()},h.info=null,h.modeChangeDuration=(s=e.modeChangeDuration)!==null&&s!==void 0?s:fv,h.enableWheel=(l=e.enableWheel)!==null&&l!==void 0?l:!0,typeof window!="undefined")if("renderer"in e)e.renderer instanceof Yr&&h.throwError(new Error("cannot render a internal renderer")),h.renderer=e.renderer;else try{h.renderer=new Yr({preserveDrawingBuffer:e.preserveDrawingBuffer,backgroundColor:e.backgroundColor,backgroundAlpha:e.backgroundAlpha,antialias:e.antialias,webgl2:e.webgl2,logarithmicDepthBuffer:e.logarithmicDepthBuffer,precision:e.precision});var v=ku();h.renderer.setPixelRatio(v===1?window.devicePixelRatio:1),h.renderer.setSize(512,512)}catch(S){S instanceof Error&&h.throwError(S)}h.getPixelsRenderTarget=new c.WebGLRenderTarget(1,1,{encoding:(d=(u=h.renderer)===null||u===void 0?void 0:u.outputEncoding)!==null&&d!==void 0?d:c.sRGBEncoding});var y=new c.DepthTexture(1,1);y.format=c.DepthStencilFormat,y.type=c.UnsignedInt248Type,h.modelRenderTarget=new c.WebGLRenderTarget(1,1,{encoding:(A=(f=h.renderer)===null||f===void 0?void 0:f.outputEncoding)!==null&&A!==void 0?A:c.sRGBEncoding,depthTexture:y,depthBuffer:!0,stencilBuffer:!0}),h.scissor=Object.assign({left:0,bottom:0,width:1,height:1},e.scissor),h.camera=new Fi(Zs),h.scene=new y0,h.xrCustomObjectsScene=new c.Scene,h.scene.add(h.xrCustomObjectsScene),h.scene.matrixAutoUpdate=!1,h.lastLoadWorkTask=Promise.resolve(),h.requestProxy=(m=e.requestProxy)!==null&&m!==void 0?m:hv,h.networkSubscribe=new s0,h.networkSubscribe.on("network",function(S,T,B,L){var k;h.emit("network.resource",W("network.resource",{source:S,requestType:T,requestState:B,detail:L})),(k=h.analysis)===null||k===void 0||k.network(h.works,S,T,B,L)}),h.boundingMesh=dh(new c.Box3(new c.Vector3(-.5,-.5,-.5),new c.Vector3(.5,.5,.5))),h.boundingMesh.name="bounding",h.models=xs(),h.models.push(new Da),h.lastModels=xs(),h.lastWorks=Va([]),h.readyCallbacks=[],h.syncingState=!1,h.helperGroup=new c.Group,h.helperGroup.name="helper",h.helperGroup.matrixAutoUpdate=!1,h.scene.add(h.helperGroup),h.modelGroup=new c.Group,h.modelGroup.visible=!1,h.modelGroup.name="model",h.modelGroup.matrixAutoUpdate=!1,h.modelScene=new c.Scene,h.modelScene.add(h.modelGroup),h.modelScene.add(h.boundingMesh),h.modelScene.matrixAutoUpdate=!1,h.videoTexture=new c.VideoTexture(e.videoInstance||nv()),Ws(h.scene),Ws(h.modelScene),h.state={mode:h.currentMode,workCode:h.pano.workCode,panoIndex:h.pano.panoIndex,longitude:h.camera.pose.longitude,latitude:h.camera.pose.latitude,fov:h.camera.pose.fov,offset:h.camera.pose.offset.clone(),distance:h.camera.pose.distance},h.stateSynced=!1,h._enablePostProcessing=!1,h._enableIOSEDR=!1,h._enableEDL=!1,h._enableHQ=!1,h.destroyed=!1,h.paused=!0,typeof window!="undefined"&&(e.play!==!1&&h.play(),h.stopAnimationLoop=vt.shared.add(function(S,T){for(var B=[],L=2;L<arguments.length;L++)B[L-2]=arguments[L];h.updateTime.apply(h,bt([S,T],B,!1))},!1,0,10));var p=function(){typeof document!="undefined"&&document.fullscreenElement===null&&h.currentMode==="VRPanorama"&&h.controller.emit("vr.requestExit",W("vr.requestExit",{}))},g=function(){h.needsRender=!0,h.modelSceneNeedsRender=!0};if(typeof document!="undefined"&&document.addEventListener("fullscreenchange",p,!1),h.renderer&&h.renderer.domElement.addEventListener("webglcontextrestored",g,!1),h.removeEventListeners=function(){typeof document!="undefined"&&document.removeEventListener("fullscreenchange",p,!1),h.renderer&&h.renderer.domElement.removeEventListener("webglcontextrestored",g,!1)},h.plugins={},e.plugins&&e.plugins.length)for(var x=0,b=e.plugins;x<b.length;x++){var w=b[x];if(typeof w=="function")w(h);else if(Array.isArray(w)){var E=w[0],M=w[1],C=w[2];if(typeof E=="function"){var P=E(h,C);typeof M=="string"&&(h.plugins[M]?h.throwError(new Error("plugin name ".concat(M," is exists."))):h.plugins[M]=P)}}}return h.gpuPickingRenderTarget=new c.WebGLRenderTarget(1,1),h.meshReplaceMaterialMap=new Map,h.meshOriginMaterialMap=new Map,rv(h),h}return Object.defineProperty(t,"version",{get:function(){return"6.2.0-alpha.3"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"dracoPath",{get:function(){return Mi.decoderPath},set:function(e){Mi.setDecoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t,"ktx2Path",{get:function(){return qn.transcoderPath},set:function(e){qn.setTranscoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panoIndex",{get:function(){return this.pano.panoIndex},enumerable:!1,configurable:!0}),t.prototype.getGPUPicking=function(e,r,i,a,o){var s=this;if(a===void 0&&(a=1),o===void 0&&(o=new c.Vector3(0,0,0)),!this.renderer)throw new Error("renderer is not initialized.");this.models.setMaterial({constantColor:o}),this.scene.traverse(function(f){if(!(!(f instanceof c.Mesh)||f instanceof Vt)){var A=Object.keys(i).filter(function(h){return h===f.uuid})[0];if(A)if(s.meshOriginMaterialMap.set(A,f.material),s.meshReplaceMaterialMap.get(A))f.material=s.meshReplaceMaterialMap.get(A);else{var m=new c.ShaderMaterial({uniforms:{color:{value:i[A]}},vertexShader:`
|
|
2061
|
+
`},xo=function(n){ue(t,n);function t(e){var r=n.call(this,{uniforms:c.UniformsUtils.clone(ya.uniforms),vertexShader:ya.vertexShader,fragmentShader:ya.fragmentShader,clipping:!0})||this;return r.type="LineMaterial",r.dashed=!1,Object.defineProperties(r,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(i){this.uniforms.diffuse.value=i}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(i){this.uniforms.linewidth.value=i}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(i){this.uniforms.dashScale.value=i}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(i){this.uniforms.dashSize.value=i}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(i){this.uniforms.gapSize.value=i}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(i){this.uniforms.opacity.value=i}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(i){this.uniforms.resolution.value.copy(i)}}}),r.setValues(e),r}return t}(c.ShaderMaterial);Object.assign(xo.prototype,{isLineMaterial:!0});var Tu=function(n){ue(t,n);function t(e,r){var i=n.call(this)||this;return i.type="LineSegments2",i.geometry=e!==void 0?e:new bo,i.material=r!==void 0?r:new xo({color:Math.random()*16777215}),i}return t.prototype.computeLineDistances=function(){for(var e=this.geometry,r=e.attributes.instanceStart,i=e.attributes.instanceEnd,a=new Float32Array(2*r.count),o=new c.Vector3,s=new c.Vector3,l=0,u=0,d=r.count;l<d;l++,u+=2)o.fromBufferAttribute(r,l),s.fromBufferAttribute(i,l),a[u]=u===0?0:a[u-1],a[u+1]=a[u]+o.distanceTo(s);var f=new c.InstancedInterleavedBuffer(a,2,1);return e.setAttribute("instanceDistanceStart",new c.InterleavedBufferAttribute(f,1,0)),e.setAttribute("instanceDistanceEnd",new c.InterleavedBufferAttribute(f,1,1)),this},t.prototype.raycast=function(e,r){e.camera===null&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var i=e.ray,a=e.camera,o=a.projectionMatrix,s=this.geometry,l=this.material,u=l.resolution,d=l.linewidth,f=s.attributes.instanceStart,A=s.attributes.instanceEnd,m=new c.Vector4,h=new c.Vector4,v=new c.Vector4,y=new c.Vector3,p=new c.Matrix4,g=new c.Line3,x=new c.Vector3;i.at(1,v),v.w=1,v.applyMatrix4(a.matrixWorldInverse),v.applyMatrix4(o),v.multiplyScalar(1/v.w),v.x*=u.x/2,v.y*=u.y/2,v.z=0,y.copy(v);var b=this.matrixWorld;p.multiplyMatrices(a.matrixWorldInverse,b);for(var w=0,E=f.count;w<E;w++){m.fromBufferAttribute(f,w),h.fromBufferAttribute(A,w),m.w=1,h.w=1,m.applyMatrix4(p),h.applyMatrix4(p),m.applyMatrix4(o),h.applyMatrix4(o),m.multiplyScalar(1/m.w),h.multiplyScalar(1/h.w);var M=m.z<-1&&h.z<-1,C=m.z>1&&h.z>1;if(!(M||C)){m.x*=u.x/2,m.y*=u.y/2,h.x*=u.x/2,h.y*=u.y/2,g.start.copy(m),g.start.z=0,g.end.copy(h),g.end.z=0;var P=g.closestPointToPointParameter(y,!0);g.at(P,x);var S=c.MathUtils.lerp(m.z,h.z,P),T=S>=-1&&S<=1,B=y.distanceTo(x)<d*.5;if(T&&B){g.start.fromBufferAttribute(f,w),g.end.fromBufferAttribute(A,w),g.start.applyMatrix4(b),g.end.applyMatrix4(b);var L=new c.Vector3,k=new c.Vector3;i.distanceSqToSegment(g.start,g.end,k,L),r.push({point:k,pointOnLine:L,distance:i.origin.distanceTo(k),object:this,faceIndex:w})}}}},t}(c.Mesh);Object.assign(Tu.prototype,{isLineSegments2:!0});var Pu=function(n){ue(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.type="Line2",i}return t}(Tu);Object.assign(Pu.prototype,{isLine2:!0});var Bu=function(n){ue(t,n);function t(){var e=n.call(this)||this;return e.type="LineGeometry",e}return t.prototype.setPositions=function(e){for(var r=e.length-3,i=new Float32Array(2*r),a=0;a<r;a+=3)i[2*a]=e[a],i[2*a+1]=e[a+1],i[2*a+2]=e[a+2],i[2*a+3]=e[a+3],i[2*a+4]=e[a+4],i[2*a+5]=e[a+5];return n.prototype.setPositions.call(this,i),this},t.prototype.setColors=function(e){for(var r=e.length-3,i=new Float32Array(2*r),a=0;a<r;a+=3)i[2*a]=e[a],i[2*a+1]=e[a+1],i[2*a+2]=e[a+2],i[2*a+3]=e[a+3],i[2*a+4]=e[a+4],i[2*a+5]=e[a+5];return n.prototype.setColors.call(this,i),this},t.prototype.fromLine=function(e){var r=e.geometry;if(r instanceof c.Geometry){var i=new c.BufferGeometry().fromGeometry(r);this.setPositions(i.attributes.position.array)}else r instanceof c.BufferGeometry&&this.setPositions(r.attributes.position.array);return this},t.prototype.copy=function(){return this},t}(bo);Object.assign(Bu.prototype,{isLineGeometry:!0});var Dp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaA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Ptq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==",Gs=14467195,zp=8,Qp=2,Up=20,Ks=null,Ha=function(n){ue(t,n);function t(e,r){e===void 0&&(e=new c.Vector3),r===void 0&&(r=new c.Vector3);var i=n.call(this)||this;i.type="FiveLine",i.needsRender=!0;var a=new Bu,o=new xo({color:Gs,linewidth:Qp,dashScale:Up,dashed:!1});i.line=new Pu(a,o);var s=new c.BufferGeometry,l=new c.PointsMaterial({color:Gs,size:zp,map:Ks||(Ks=new c.TextureLoader().load(Dp)),sizeAttenuation:!1,transparent:!0});return i.points=new c.Points(s,l),i.points.renderOrder=11,i.points.frustumCulled=!1,i.setPoints(e,r),i.add(i.line,i.points),i}return Object.defineProperty(t,"version",{get:function(){return"6.2.0-alpha.4"},enumerable:!1,configurable:!0}),t.prototype.setPoints=function(e,r){var i=[].concat(e.toArray(),r.toArray());this.points.geometry.setAttribute("position",new c.BufferAttribute(new Float32Array(i),3)),this.line.geometry.setPositions(i),this.line.computeLineDistances(),this.needsRender=!0},t.prototype.getPoints=function(){var e=this.points.geometry.attributes.position.array;return[new c.Vector3(e[0],e[1],e[2]),new c.Vector3(e[3],e[4],e[5])]},t.prototype.setMaterial=function(e){var r=this.line.material;for(var i in e)if(e.hasOwnProperty(i)){var a=e[i];i==="dashed"?(r.dashed=a,a?r.defines.USE_DASH="":delete r.defines.USE_DASH,r.needsUpdate=!0):r[i]=e[i]}this.needsRender=!0},t.prototype.setResolution=function(e,r){var i=this.line.material.resolution;(i.x!==e||i.y!==r)&&(i.set(e,r),this.needsRender=!0)},t}(c.Object3D);Object.assign(Ha.prototype,{isFiveLine:!0});var We={Handedness:Object.freeze({NONE:"none",LEFT:"left",RIGHT:"right"}),ComponentState:Object.freeze({DEFAULT:"default",TOUCHED:"touched",PRESSED:"pressed"}),ComponentProperty:Object.freeze({BUTTON:"button",X_AXIS:"xAxis",Y_AXIS:"yAxis",STATE:"state"}),ComponentType:Object.freeze({TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON:"button"}),ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:Object.freeze({TRANSFORM:"transform",VISIBILITY:"visibility"})};function Ru(n){return Bi(this,void 0,void 0,function(){var t;return Ri(this,function(e){switch(e.label){case 0:return[4,fetch(n)];case 1:if(t=e.sent(),t.ok)return[2,t.json()];throw new Error(t.statusText)}})})}function qp(n){return Bi(this,void 0,void 0,function(){var t,e;return Ri(this,function(r){switch(r.label){case 0:if(!n)throw new Error("No basePath supplied");return t="profilesList.json",[4,Ru("".concat(n,"/").concat(t))];case 1:return e=r.sent(),[2,e]}})})}function Hp(n,t){return Bi(this,arguments,void 0,function(e,r,i,a){var o,s,l,u,d,f;return i===void 0&&(i=null),a===void 0&&(a=!0),Ri(this,function(A){switch(A.label){case 0:if(!e)throw new Error("No xrInputSource supplied");if(!r)throw new Error("No basePath supplied");return[4,qp(r)];case 1:if(o=A.sent(),e.profiles.some(function(m){var h=o[m];return h&&(s={profileId:m,profilePath:"".concat(r,"/").concat(h.path),deprecated:!!h.deprecated}),!!s}),!s){if(!i)throw new Error("No matching profile name found");if(l=o[i],!l)throw new Error('No matching profile name found and default profile "'.concat(i,'" missing.'));s={profileId:i,profilePath:"".concat(r,"/").concat(l.path),deprecated:!!l.deprecated}}return[4,Ru(s.profilePath)];case 2:if(u=A.sent(),a){if(f=void 0,f=u.layouts[e.handedness],!f)throw new Error("No matching handedness, ".concat(e.handedness,", in profile ").concat(s.profileId));f.assetPath&&(d=s.profilePath.replace("profile.json",f.assetPath))}return[2,{profile:u,assetPath:d}]}})})}var Gp={xAxis:0,yAxis:0,button:0,state:We.ComponentState.DEFAULT};function Kp(n,t){n===void 0&&(n=0),t===void 0&&(t=0);var e=n,r=t,i=Math.sqrt(n*n+t*t);if(i>1){var a=Math.atan2(t,n);e=Math.cos(a),r=Math.sin(a)}var o={normalizedXAxis:e*.5+.5,normalizedYAxis:r*.5+.5};return o}var jp=function(){function n(t){this.componentProperty=t.componentProperty,this.states=t.states,this.valueNodeName=t.valueNodeName,this.valueNodeProperty=t.valueNodeProperty,this.valueNodeProperty===We.VisualResponseProperty.TRANSFORM&&(this.minNodeName=t.minNodeName,this.maxNodeName=t.maxNodeName),this.value=0,this.updateFromComponent(Gp)}return n.prototype.updateFromComponent=function(t){var e=t.xAxis,r=t.yAxis,i=t.button,a=t.state,o=Kp(e,r),s=o.normalizedXAxis,l=o.normalizedYAxis;switch(this.componentProperty){case We.ComponentProperty.X_AXIS:this.value=this.states.includes(a)?s:.5;break;case We.ComponentProperty.Y_AXIS:this.value=this.states.includes(a)?l:.5;break;case We.ComponentProperty.BUTTON:this.value=this.states.includes(a)?i:0;break;case We.ComponentProperty.STATE:this.valueNodeProperty===We.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(a):this.value=this.states.includes(a)?1:0;break;default:throw new Error("Unexpected visualResponse componentProperty ".concat(this.componentProperty))}},n}(),Jp=function(){function n(t,e){var r=this;if(!t||!e||!e.visualResponses||!e.gamepadIndices||Object.keys(e.gamepadIndices).length===0)throw new Error("Invalid arguments supplied");this.id=t,this.type=e.type,this.rootNodeName=e.rootNodeName,this.touchPointNodeName=e.touchPointNodeName,this.visualResponses={},Object.keys(e.visualResponses).forEach(function(i){var a=new jp(e.visualResponses[i]);r.visualResponses[i]=a}),this.gamepadIndices=Object.assign({},e.gamepadIndices),this.values={state:We.ComponentState.DEFAULT,button:this.gamepadIndices.button!==void 0?0:void 0,xAxis:this.gamepadIndices.xAxis!==void 0?0:void 0,yAxis:this.gamepadIndices.yAxis!==void 0?0:void 0}}return Object.defineProperty(n.prototype,"data",{get:function(){var t=F({id:this.id},this.values);return t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(t){var e=this;if(this.values.state=We.ComponentState.DEFAULT,this.gamepadIndices.button!==void 0&&t.buttons.length>this.gamepadIndices.button){var r=t.buttons[this.gamepadIndices.button];this.values.button=r.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,r.pressed||this.values.button===1?this.values.state=We.ComponentState.PRESSED:(r.touched||this.values.button>We.ButtonTouchThreshold)&&(this.values.state=We.ComponentState.TOUCHED)}this.gamepadIndices.xAxis!==void 0&&t.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=t.axes[this.gamepadIndices.xAxis],this.values.xAxis=this.values.xAxis<-1?-1:this.values.xAxis,this.values.xAxis=this.values.xAxis>1?1:this.values.xAxis,this.values.state===We.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>We.AxisTouchThreshold&&(this.values.state=We.ComponentState.TOUCHED)),this.gamepadIndices.yAxis!==void 0&&t.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=t.axes[this.gamepadIndices.yAxis],this.values.yAxis=this.values.yAxis<-1?-1:this.values.yAxis,this.values.yAxis=this.values.yAxis>1?1:this.values.yAxis,this.values.state===We.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>We.AxisTouchThreshold&&(this.values.state=We.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(function(i){i.updateFromComponent(e.values)})},n}(),Wp=function(){function n(t,e,r){var i=this;if(!t)throw new Error("No xrInputSource supplied");if(!e)throw new Error("No profile supplied");this.xrInputSource=t,this.assetUrl=r,this.id=e.profileId,this.layoutDescription=e.layouts[t.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach(function(a){var o=i.layoutDescription.components[a];i.components[a]=new Jp(a,o)}),this.updateFromGamepad()}return Object.defineProperty(n.prototype,"gripSpace",{get:function(){return this.xrInputSource.gripSpace},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"targetRaySpace",{get:function(){return this.xrInputSource.targetRaySpace},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"data",{get:function(){var t=[];return Object.values(this.components).forEach(function(e){t.push(e.data)}),t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(){var t=this;Object.values(this.components).forEach(function(e){e.updateFromGamepad(t.xrInputSource.gamepad)})},n}(),Xp="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",_p="generic-trigger",Zp=function(n){ue(t,n);function t(){var e=n.call(this)||this;return e.motionController=null,e.envMap=null,e}return t.prototype.setEnvironmentMap=function(e){var r=this;return this.envMap==e?this:(this.envMap=e,this.traverse(function(i){i instanceof c.Mesh&&i.isMesh&&(i.material.envMap=r.envMap,i.material.needsUpdate=!0)}),this)},t.prototype.updateMatrixWorld=function(e){n.prototype.updateMatrixWorld.call(this,e),this.motionController&&(this.motionController.updateFromGamepad(),Object.values(this.motionController.components).forEach(function(r){Object.values(r.visualResponses).forEach(function(i){var a=i.valueNode,o=i.minNode,s=i.maxNode,l=i.value,u=i.valueNodeProperty;a&&(u===We.VisualResponseProperty.VISIBILITY?a.visible=l:u===We.VisualResponseProperty.TRANSFORM&&(a.quaternion.copy(o.quaternion).slerp(s.quaternion,l),a.position.lerpVectors(o.position,s.position,l)))})}))},t}(Dn.Object3D);function Yp(n,t){Object.values(n.components).forEach(function(e){var r=e.type,i=e.touchPointNodeName,a=e.visualResponses;if(r===We.ComponentType.TOUCHPAD)if(e.touchPointNode=t.getObjectByName(i),e.touchPointNode){var o=new Dn.SphereGeometry(.001),s=new Dn.MeshBasicMaterial({color:255}),l=new Dn.Mesh(o,s);e.touchPointNode.add(l)}else console.warn("Could not find touch dot, ".concat(e.touchPointNodeName,", in touchpad component ").concat(e.id));Object.values(a).forEach(function(u){var d=u.valueNodeName,f=u.minNodeName,A=u.maxNodeName,m=u.valueNodeProperty;if(m===We.VisualResponseProperty.TRANSFORM){if(u.minNode=t.getObjectByName(f),u.maxNode=t.getObjectByName(A),!u.minNode){console.warn("Could not find ".concat(f," in the model"));return}if(!u.maxNode){console.warn("Could not find ".concat(A," in the model"));return}}u.valueNode=t.getObjectByName(d),u.valueNode||console.warn("Could not find ".concat(d," in the model"))})})}function js(n,t){Yp(n.motionController,t),n.envMap&&t.traverse(function(e){e instanceof c.Mesh&&e.isMesh&&(e.material.envMap=n.envMap,e.material.needsUpdate=!0)}),n.add(t)}var $p=function(){function n(t){t===void 0&&(t=null),this.gltfLoader=t,this.path=Xp,this._assetCache={}}return n.prototype.createControllerModel=function(t){var e=this,r=new Zp,i=null;return t.addEventListener("connected",function(a){var o=a.data;o.targetRayMode!=="tracked-pointer"||!o.gamepad||Hp(o,e.path,_p).then(function(s){var l=s.profile,u=s.assetPath;r.motionController=new Wp(o,l,u);var d=e._assetCache[r.motionController.assetUrl];if(d)i=d.scene.clone(),js(r,i);else{if(!e.gltfLoader)throw new Error("GLTFLoader not set.");e.gltfLoader.load(r.motionController.assetUrl,function(f){e._assetCache[r.motionController.assetUrl]=f,i=f.scene.clone(),js(r,i)})}}).catch(function(s){console.warn(s)})}),t.addEventListener("disconnected",function(){r.motionController=null,r.remove(i),i=null}),r},n}();function ev(n,t){return n}var Js=300,tv=new c.Matrix4().makeRotationAxis(new c.Vector3(0,1,0),Math.PI),Ws=new c.Vector3(-1,1,1),rv=function(n){ue(t,n);function t(e){var r=n.call(this,e)||this;r.xrManager=new Np(r.renderer,r.renderer.getContext(),{onSessionStart:function(l){r.emit("xr.session.start",W("xr.session.start",{session:l,machineType:r.xrManager.machineType}))},onSessionEnd:function(){r.emit("xr.session.end",W("xr.session.end",{session:null,machineType:r.xrManager.machineType}))}}),r.xrControllerRay={left:new c.Raycaster,right:new c.Raycaster},r.xrControllerRay.left.params.Points={threshold:.1},r.xrControllerRay.right.params.Points={threshold:.1},r.gazeRay=null,r.pointerLines={left:new Ha,right:new Ha},r.pointerLines.left.visible=!1,r.pointerLines.right.visible=!0,r.pointerLines.left.setMaterial({color:new c.Vector3(1,1,1)}),r.pointerLines.left.points.material.depthTest=!1,r.pointerLines.right.setMaterial({color:new c.Vector3(1,1,1)}),r.pointerLines.right.points.material.depthTest=!1,r.controllerWrappers=[new c.Group,new c.Group];var i=r.xrManager.getController(0);r.controllerWrappers[0].add(i);var a=r.xrManager.getController(1);r.controllerWrappers[1].add(a);var o=new $p;o.gltfLoader={load:function(l,u){yi.ajax(l,{responseType:"arraybuffer"}).then(function(d){var f;return no(d.body,{resourcePath:l.slice(0,l.lastIndexOf("/")+1),search:(f=l.split("?")[1])!==null&&f!==void 0?f:"",fetcher:yi})}).then(function(d){return u(d)})}},(r.xrManager.machineType==="Oculus"||r.xrManager.machineType==="Pico")&&r.scene.add(r.pointerLines.left,r.pointerLines.right,r.controllerWrappers[0],r.controllerWrappers[1]),r.panoResources={},r.panoResources[r.locationMotion.keyframes[0].key=r.locationMotion.keyframes[1].key=wt()]={panoId:Ue(r.currentPano),leftPanoPicture:null,position:r.camera.pose.offset.clone(),effect:"fade",fixCameraTransform:new c.Matrix4},r.parallaxCameraMatrixs=[];var s=vt.shared.getContext();return s?(r.on("xr.session.end",function(){r.scene.remove(r.pointerLines.left,r.pointerLines.right)}),r.xrManager.setSession(s),r.on("xr.session.start",function(){var l=r.xrManager.getControllerGrip(0);l.add(o.createControllerModel(l)),r.controllerWrappers[0].add(l);var u=r.xrManager.getControllerGrip(1);u.add(o.createControllerModel(u)),r.controllerWrappers[1].add(u)}),r.xrHandleState={LeftAxesUp:{touchStartTime:0,touchStart:!1},LeftAxesDown:{touchStartTime:0,touchStart:!1},LeftAxesLeft:{touchStartTime:0,touchStart:!1},LeftAxesRight:{touchStartTime:0,touchStart:!1},LeftTrigger:{touchStartTime:0,touchStart:!1},LeftPinch:{touchStartTime:0,touchStart:!1},RightAxesUp:{touchStartTime:0,touchStart:!1},RightAxesDown:{touchStartTime:0,touchStart:!1},RightAxesLeft:{touchStartTime:0,touchStart:!1},RightAxesRight:{touchStartTime:0,touchStart:!1},RightTrigger:{touchStartTime:0,touchStart:!1},RightPinch:{touchStartTime:0,touchStart:!1},Y:{touchStartTime:0,touchStart:!1},X:{touchStartTime:0,touchStart:!1},A:{touchStartTime:0,touchStart:!1},B:{touchStartTime:0,touchStart:!1}},r.xrManager.machineType==="VP"&&r.initHandEvent(),r):(console.error("获取session失败,请退出重试"),r)}return t.parseArgs=function(e){if(e instanceof t)return e;var r=F(F({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return n.parseArgs.call(this,r)},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return F(F({},i),{mode:"XRPanorama"})},t.prototype.moveToPano=function(e,r,i){var a=this,o,s,l,u,d=(o=r.effect)!==null&&o!==void 0?o:"fade";this.userAction=i,this.stopMomentumMovement();var f=this.works.getResolvedObserver(e);if(!f)throw new Error("Invalid PanoIndex");var A=Kn(f.images.up),m=this.imageOptions.size;typeof m=="undefined"&&f&&A&&(m=Number(A)),typeof m=="undefined"&&(m=2048);var h=this.imageOptions.transform,v=function(T,B){return ev(bi(T,h,B))},y=F({key:"pano.".concat(f.panoId)},Cr(this.imageOptions,["format","size","quality"])),p=f.images,g=(l=(s=f.images.tiles)===null||s===void 0?void 0:s.filter(function(T){return T.size>m}))!==null&&l!==void 0?l:null,x="pano:"+Cn([p,y,h]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===x)return;var b=this.pendingTextureTask.panoId;(u=this.panoMeshes[b])===null||u===void 0||u.setProgress(0),this.emit("pano.texture.abort",W("pano.texture.abort",{error:null,progress:0,meta:null,pano:f.pano})),this.pendingTextureTask.onError(new Error("texture aborted"))}var w=this.models.getMaterial()||{},E=w.pano0,M=w.pano1,C;if((E==null?void 0:E.map.name)===x?C=E:(M==null?void 0:M.map.name)===x&&(C=M),C){var P={panoId:f.panoId,effect:d,leftPanoPicture:{zoom:1,map:C.map,luminanceMap:C.luminanceMap,matrix:new c.Matrix4().compose(f.position,f.quaternion,Ws)},position:f.position.clone(),fixCameraTransform:new c.Matrix4};this.doMoveToPano(f.pano,P,r);return}var S="move-to-pano-"+f.panoId;this.pending.add(S),this.pendingTextureTask={panoId:f.panoId,hash:x,onLoad:function(T){if(a.pending.delete(S),a.destroyed)T.body.dispose();else{T.body.name=x;var B={panoId:f.panoId,effect:d,leftPanoPicture:{zoom:1,map:T.body,luminanceMap:null,matrix:new c.Matrix4().compose(f.position,f.quaternion,Ws)},position:f.position.clone(),fixCameraTransform:new c.Matrix4};a.doMoveToPano(f.pano,B,r)}},onError:function(T){a.pending.delete(S);var B=F(F(F({},f.pano),{mode:a.mode}),_e(a.camera.pose));a.emit("pano.error",W("pano.error",{error:T,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:B})),a.emit("pano.cancel",W("pano.cancel",{error:null,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:B})),r.moveCancelCallback&&r.moveCancelCallback()}},Promise.all([this.tileLevelForFov&&g&&g.length?this.textureLoader.loadTiledCubeTexture(p,g,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:v,options:y},format:c.RGBAFormat,minFilter:c.LinearFilter,magFilter:c.LinearFilter,generateMipmaps:!1,viaAjax:!0,fetcher:it(f.work)},void 0,void 0,function(T){var B,L;a.emit("pano.texture.progress",W("pano.texture.progress",{error:null,progress:T,meta:null,pano:f.pano})),((B=a.pendingTextureTask)===null||B===void 0?void 0:B.hash)===x&&((L=a.panoMeshes[f.panoId])===null||L===void 0||L.setProgress(T))},this.renderer):this.textureLoader.loadCubeTexture(p,{imageURL:{transform:v,options:y},format:c.RGBAFormat,fetcher:it(f.work)},void 0,void 0,function(T){var B,L;((B=a.pendingTextureTask)===null||B===void 0?void 0:B.hash)===x&&((L=a.panoMeshes[f.panoId])===null||L===void 0||L.setProgress(T)),a.emit("pano.texture.progress",W("pano.texture.progress",{error:null,progress:T,meta:null,pano:f.pano}))},this.renderer)]).then(function(T){var B,L,k=T[0];((B=a.pendingTextureTask)===null||B===void 0?void 0:B.hash)===x?(a.pendingTextureTask.onLoad(k),(L=a.panoMeshes[f.panoId])===null||L===void 0||L.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.success",W("pano.texture.success",{error:null,progress:1,meta:k.meta,pano:f.pano}))):k.body.dispose()}).catch(function(T){var B,L;((B=a.pendingTextureTask)===null||B===void 0?void 0:B.hash)===x&&(a.pendingTextureTask.onError(T),(L=a.panoMeshes[f.panoId])===null||L===void 0||L.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.error",W("pano.texture.error",{error:T,progress:0,meta:null,pano:f.pano})),a.emit("error",T))}),this.emit("pano.texture.load",W("pano.texture.load",{error:null,progress:0,meta:null,pano:f.pano}))},t.prototype.doMoveToPano=function(e,r,i){var a=this,o,s,l,u,d,f,A,m,h,v;i===void 0&&(i={});var y=Me(),p=wt();this.panoResources[p]=r;var g=1,x,b,w;if(this.locationMotion.ended){var E=this.locationMotion.getKeyFrameSegment(y);E[0];var M=E[1],C=this.locationMotion.value,P=this.panoResourceFromLocationMotionKeyframe(M).position,S=r.position;x=Math.max(P.distanceTo(S),g),b=[{key:M.key,progress:0,value:F(F({},C),{count:0})},{key:p,progress:1,value:{distance:0,count:1}}],w=0}else{var T=this.locationMotion.getKeyFrameSegment(y),B=T[0],M=T[1],C=this.locationMotion.value,L=this.panoResourceFromLocationMotionKeyframe(B).position,P=this.panoResourceFromLocationMotionKeyframe(M).position,S=r.position,k=M.value.count-C.count,O=Math.max(L.distanceTo(P),g)*k,D=Math.max(P.distanceTo(S),g);x=O+D,b=[{key:B.key,progress:0,value:F({},C)},{key:M.key,progress:O/x,value:M.value},{key:p,progress:1,value:{count:M.value.count+1,distance:0}}];var N=this.locationMotionKeyframesLength(this.locationMotion.keyframes),X=this.locationMotionKeyframesLength(b);w=this.locationMotion.getProgressVelocity(y)*N/X}var K=r.effect==="instant"?0:this.calculateMovingDuration(i.duration,r.effect==="fly"?x:0),Q={longitude:i.longitude,latitude:i.latitude,fov:i.fov},G=F(F({},e),{mode:this.mode,longitude:(o=Q.longitude)!==null&&o!==void 0?o:this.camera.pose.longitude,latitude:(s=Q.latitude)!==null&&s!==void 0?s:this.camera.pose.latitude,fov:(l=Q.fov)!==null&&l!==void 0?l:this.camera.pose.fov,offset:r.position.clone(),distance:0}),J=this.currentPano;if(this.emit("pano.moveTo",W("pano.moveTo",{options:i,prevPano:J,progress:0,state:G,userAction:this.userAction,error:null})),i.moveStartCallback&&i.moveStartCallback(G),this.videoTexture&&this.videoTexture.image instanceof HTMLVideoElement&&this.videoTexture.image.getAttribute("src")&&(this.videoTexture.image.pause(),this.videoTexture.image.removeAttribute("uuid"),this.videoTexture.image.removeAttribute("src"),this.videoTexture.image.oncanplay=z,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),r.effect==="fly")this.cameraMotion.set(Q,K).catch(z);else{var H=Ft({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),j=Ft({longitude:(u=Q.longitude)!==null&&u!==void 0?u:this.cameraMotion.value.longitude,latitude:(d=Q.latitude)!==null&&d!==void 0?d:this.cameraMotion.value.latitude}),Z=new c.Object3D;Z.lookAt(H);var Y=new c.Matrix4().makeRotationFromQuaternion(Z.quaternion);Z.lookAt(j);var pe=new c.Matrix4().makeRotationFromQuaternion(Z.quaternion),ee=new c.Matrix4().getInverse(Y).premultiply(pe),oe=this.cameraMotion.value.fov,ie=(f=Q.fov)!==null&&f!==void 0?f:this.cameraMotion.value.fov,ce=1;r.effect==="zoomin"?ce=1.5:r.effect==="zoomout"&&(ce=.4);for(var ne=ie*ce,ae=0;ae<b.length-1;ae++){var de=b[ae].key;if(de){var ve=this.panoResources[de];ve&&(ve.fixCameraTransform.copy(ee),ve.leftPanoPicture&&(ve.leftPanoPicture.zoom=Math.tan(oe/2/180*Math.PI)/Math.tan(ne/2/180*Math.PI)))}}this.cameraMotion.setKeyframes([{progress:0,value:{longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude,fov:this.cameraMotion.value.fov}},{progress:0,value:{longitude:(A=Q.longitude)!==null&&A!==void 0?A:this.cameraMotion.value.longitude,latitude:(m=Q.latitude)!==null&&m!==void 0?m:this.cameraMotion.value.latitude,fov:ne}},{progress:1,value:{longitude:(h=Q.longitude)!==null&&h!==void 0?h:this.cameraMotion.value.longitude,latitude:(v=Q.latitude)!==null&&v!==void 0?v:this.cameraMotion.value.latitude,fov:ie}}],K).catch(z)}var xe=this.locationMotion.setKeyframes(b,K,w);xe.then(function(){for(var Ce,Be,$,te=0,U=a.models;te<U.length;te++){var Le=U[te];Le.show()}var Pe=F(F({},e),{mode:a.mode,longitude:a.camera.pose.longitude,latitude:a.camera.pose.latitude,fov:a.camera.pose.fov,offset:a.camera.pose.offset.clone(),distance:0});a.emit("pano.arrived",W("pano.arrived",{options:i,prevPano:J,progress:1,state:Pe,userAction:a.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(Pe);var Ie=a.works.getResolvedObserver(a.currentPano);if(Ie&&Ie.video&&a.videoTexture&&a.videoTexture.image instanceof HTMLVideoElement){var Qe=tv.clone().multiply(($=(Be=(Ce=a.models.getMaterial())===null||Ce===void 0?void 0:Ce.pano1)===null||Be===void 0?void 0:Be.matrix)!==null&&$!==void 0?$:new c.Matrix4).multiply(Ie.video.matrix),be={map:a.videoTexture,size:Ie.video.size,matrix:Qe,alpha:1},ye=wt(),ge=a.videoTexture.image;ge.setAttribute("uuid",ye),yu().then(function(me){me&&Ie.video&&ge.getAttribute("uuid")===ye&&(ge.oncanplay=function(){ge.oncanplay=z,ge.play()},ge.ontimeupdate=function(){ge.currentTime>.5&&(ge.ontimeupdate=z,a.panoVideo.setMaterial(be))},ge.src=Ie.video.source)}).catch(function(){ge.removeAttribute("uuid")})}},function(){a.emit("pano.cancel",W("pano.cancel",{options:i,prevPano:J,progress:0,state:G,userAction:a.userAction,error:null})),i.moveCancelCallback&&i.moveCancelCallback()})},t.prototype.checkSelectedPano=function(e){var r=this,i,a,o,s;this.stopMomentumMovement();var l=this.camera.getDirection(new c.Vector3).setY(0),u=null,d=this.works.getResolvedObserver(this.currentPano);if(!d)return null;var f=d.accessibleIds.filter(function(j){var Z=pt(j);if(_t(Z,r.currentPano))return!1;var Y=r.works.getResolvedObserver(Z);return!Y||Y.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:Y.loadable||Y.active}),A=this.models.intersectRaycaster(e)[0];if(A){var m=ur(f,function(j){var Z=r.works.getResolvedObserver(j);if(!Z)return 1/0;var Y=Z.standingPosition.clone();return Y.distanceTo(A.point)},!0),h=m[0],v=m[1];h&&v<this.panoTapTriggerRadius&&(u=(i=this.works.getResolvedObserver(h))!==null&&i!==void 0?i:null)}if(qs(u)){var y=this.getForwardObserverOrNot(e);y&&(u=y)}for(var p=0,g=this.locationMotion.keyframes;p<g.length;p++){var x=g[p],b=this.panoResourceFromLocationMotionKeyframe(x);if(!(x.progress<this.locationMotion.progress)&&u&&b.panoId===u.panoId){u=null;break}}if(qs(u))return this.locationMotion.ended===!0&&this.cameraBounce(),null;if(u&&!u.active){var w=u.panoId;this.panoMeshes[w]&&(this.panoMeshes[w].setDisabled(!1),this.panoMeshes[w].setLoading(!0))}var E={};if(u){for(var M=Math.PI/6,C=Math.PI/12,P=new c.Vector3(0,1,0),S=u.position.clone().setY(0).sub(d.position.clone().setY(0)).normalize(),T=S.clone().applyAxisAngle(P,M),B=S.clone().applyAxisAngle(P,-M),L=[],k=[],O=[],D=0,N=u.accessibleIds;D<N.length;D++){var h=N[D],X=pt(h);if(!(_t(X,this.currentPano)||_t(X,u.pano))){var K=this.works.getResolvedObserver(h);if(K){var Q=K.position.clone().sub(u.position).setY(0);S.angleTo(Q)<M?O.push(Q):T.angleTo(Q)<M?L.push(Q):B.angleTo(Q)<M&&k.push(Q)}}}var G=O.length>0?O:bt(bt([],L,!0),k,!0),J=G.slice().sort(function(j,Z){return j.angleTo(S)-Z.angleTo(S)})[0];J&&J.angleTo(l)>C&&(E.longitude=Math.atan2(-J.x,-J.z))}this.cameraMotion.value.latitude<-Math.PI/4&&(E.latitude=he(0,this.minLatitude,this.maxLatitude)),this.cameraMotion.value.fov<60&&(E.fov=this.defaultFov);var H={workCode:u.pano.workCode,panoIndex:u.pano.panoIndex,mode:this.mode,longitude:(a=E.longitude)!==null&&a!==void 0?a:this.camera.pose.longitude,latitude:(o=E.latitude)!==null&&o!==void 0?o:this.camera.pose.latitude,fov:(s=E.fov)!==null&&s!==void 0?s:this.camera.pose.fov,distance:0,offset:u?u.position.clone():new c.Vector3};return this.emit("pano.select",W("pano.select",{prevPano:this.currentPano,state:H,userAction:!0,options:E,progress:0,error:null})),u&&u.active?(this.emit("pano.request",W("pano.request",{userAction:!0,prevPano:this.currentPano,progress:0,state:H,options:E,error:null})),u.pano):null},t.prototype.destroy=function(){n.prototype.destroy.call(this)},t.prototype.isReady=function(){return!1},t.prototype.updateCamera=function(e,r,i){return Promise.resolve()},t.prototype.updateCameraWithKeyframes=function(e,r,i){return Promise.resolve()},t.prototype.updateTime=function(e,r){for(var i=this,a,o,s,l,u,d,f,A,m=[],h=2;h<arguments.length;h++)m[h-2]=arguments[h];this.userAction=!0;var v={},y={},p=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),g=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),x=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),y.longitude=this.cameraMotion.value.longitude,y.latitude=this.cameraMotion.value.latitude,y.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),v.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(he(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var b=this.locationMotion.getKeyFrameSegment(e),w=b[0],E=b[1],M=this.panoResourceFromLocationMotionKeyframe(w),C=this.panoResourceFromLocationMotionKeyframe(E),P=new c.Vector3().copy(M.position),S=new c.Vector3().copy(C.position),T=this.locationMotion.value.count-E.value.count+1;v.progress=T,C.leftPanoPicture&&(T<1?M.leftPanoPicture&&(v.pano0=M.leftPanoPicture):v.pano0=C.leftPanoPicture,v.pano1=C.leftPanoPicture),C.effect==="montage"?v.transition="BLACK":C.effect==="spread"?v.transition="SPREAD":v.transition="FADE",(C.effect==="zoomin"||C.effect==="zoomout")&&(v.progress=Math.pow(T,3)),T<1&&C.effect!=="fly"&&(v.pano0&&M.leftPanoPicture&&(v.pano0={map:v.pano0.map,zoom:v.pano0.zoom,luminanceMap:v.pano0.luminanceMap,matrix:M.leftPanoPicture.matrix.clone().setPosition(C.position)}),P.copy(S),x=!0),y.distance=this.locationMotion.value.distance,y.offset=new c.Vector3(P.x+(S.x-P.x)*T,P.y+(S.y-P.y)*T,P.z+(S.z-P.z)*T);for(var B=[],L=[],k=0,O=this.locationMotion.keyframes;k<O.length;k++){var D=O[k],N=D.key,X=D.progress;N!==void 0&&(B.push(N),X>this.locationMotion.progress&&L.push(N))}for(var K=0,Q=Object.keys(this.panoResources);K<Q.length;K++){var G=Q[K];if(!(L.indexOf(G)>=0)){var J=this.panoResources[G];if(J.leftPanoPicture){var H=J.leftPanoPicture.map;if(H){if(H===((a=v.pano0)===null||a===void 0?void 0:a.map)||H===((o=v.pano1)===null||o===void 0?void 0:o.map))continue;H instanceof De&&H.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(H.cubeRenderTarget),H.dispose(),J.leftPanoPicture=null}}B.indexOf(G)>=0||delete this.panoResources[G]}}this.currentPano=pt(C.panoId),this.emit("pano.moving",W("pano.moving",{userAction:this.userAction,prevPano:pt(p.panoId),state:F(F(F(F({},pt(g.panoId)),{mode:this.mode}),_e(this.camera.pose)),y),options:{},progress:this.locationMotion.progress,error:null}))}Nt(v)===!1&&(!((s=v.pano0)===null||s===void 0)&&s.map&&v.pano0.map instanceof De&&!v.pano0.map.cubeRenderTarget&&(v.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((l=v.pano1)===null||l===void 0)&&l.map&&v.pano1.map instanceof De&&!v.pano1.map.cubeRenderTarget&&(v.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),this.models.setMaterial(v)),Nt(y)===!1&&this.setCamera(y);var j=this.works.getResolvedObserver(this.currentPano),Z=m[1];if(!Z){console.error("xrFrame丢失,请重试");return}if(!this.xrManager.session){console.error("session丢失,请重试");return}var Y=this.xrManager.referenceSpace;if(Y){var pe=this.xrManager.cameraVR,ee=this.xrManager.cameraL,oe=this.xrManager.cameraR,ie=[ee,oe],ce=Z.getViewerPose(Y),ne=new c.Vector3(0,0,0);if(ce){var ae;ae=this.xrManager.session.renderState.baseLayer;var de=ce.views;if(!ae){console.error("no layer found");return}this.renderer.setFramebuffer(ae.framebuffer);var ve=!1;de.length!==pe.cameras.length&&(pe.cameras.length=0,ve=!0),this.parallaxCameraMatrixs=[];var xe=new c.Vector3,Ce=new c.Vector3;new c.Matrix4().fromArray(de[0].transform.matrix).decompose(xe,new c.Quaternion,new c.Vector3),new c.Matrix4().fromArray(de[1].transform.matrix).decompose(Ce,new c.Quaternion,new c.Vector3),Ce.clone().sub(xe).normalize();var Be=new c.Vector3,$=new c.Quaternion,te=new c.Vector3;this.camera.matrix.decompose(Be,$,te);for(var U=0;U<de.length;U++){var Le=de[U],Pe=ae.getViewport(Le),Ie=ie[U];Ie.matrix.fromArray(Le.transform.matrix);var Qe=new c.Vector3,be=new c.Quaternion,ye=new c.Vector3;Ie.matrix.decompose(Qe,be,ye),ne.copy(Be),Ie.position.copy(Be),Ie.quaternion.copy(be),Ie.scale.copy(ye),Ie.updateMatrix(),Ie.projectionMatrix.fromArray(Le.projectionMatrix),Ie.viewport.set(Pe.x,Pe.y,Pe.width,Pe.height),ve===!0&&pe.cameras.push(Ie)}if(this.xrManager.session&&this.xrManager.session.inputSources){for(var U=0;U<this.xrManager.session.inputSources.length;U++)if(this.xrManager.session.inputSources[U]&&this.xrManager.session.inputSources[U].targetRayMode==="transient-pointer"){var ge=Z.getPose(this.xrManager.session.inputSources[U].targetRaySpace,Y);if(ge){var me=new c.Vector3(0,0,-1).applyQuaternion(ge.transform.orientation),Ae=new c.Raycaster(this.camera.position,me);this.gazeRay=Ae}}}if(this.xrManager.machineType==="Oculus"||this.xrManager.machineType==="Pico"){for(var Ne=this.xrManager.session.inputSources,U=0;U<Ne.length;U++){var ze=this.xrManager.controllers[U],je=Ne[U];if(je){ze&&ze.update(je,Z,Y);var Ae=this.xrManager.getController(U),cr=new c.Vector3(0,1.2,0),Fe=Ae.position.clone().add(ne).sub(cr);je.handedness==="left"?this.xrControllerRay.left.set(Fe,new c.Vector3(0,0,-1).applyEuler(Ae.rotation)):je.handedness==="right"&&this.xrControllerRay.right.set(Fe,new c.Vector3(0,0,-1).applyEuler(Ae.rotation)),this.controllerWrappers[U].position.copy(new c.Vector3(0,0,0).add(ne).sub(cr));var Ye=this.models.intersectRaycaster(this.xrControllerRay.right);if(Ye.length===0&&(Ye=this.xrControllerRay.right.intersectObject(this.boundingMesh,!0).map(function(Ir){var Wr;return F({floor:(Wr=j==null?void 0:j.floorIndex)!==null&&Wr!==void 0?Wr:0},Ir)})),Ye.length>=1&&Ye[0].face)if(je.handedness==="right"){var ot=this.xrControllerRay.right.intersectObject(this.xrCustomObjectsScene,!0),Yt=Ye[0].face.normal,on=Yt.clone(),$t=Ye[0].point.clone();this.intersectMesh.position.copy($t);var St=$t.clone().add(on);if(this.intersectMesh.lookAt(St),Math.abs(Yt.y)>.99){var er=this.camera.position.clone().sub($t);this.intersectMesh.rotation.z=-Math.atan2(er.z,er.x)}this.intersectMesh.visible=!0,this.needsRender=!0,ot.length>0?(this.pointerLines.right.setPoints(Fe,ot[0].point),this.pointerLines.right.points.visible=!0,this.intersectMesh.visible=!1):(this.pointerLines.right.points.visible=!1,this.pointerLines.right.setPoints(Fe,Ye[0].point));var Mr=Ye[0],Dt=W("intersect.update",{raycaster:(u=this.xrControllerRay.right)!==null&&u!==void 0?u:null,intersection:Mr!=null?Mr:null,object:this.intersectMesh});if(this.emit("intersect.update",Dt),Dt.defaultPrevented){this.hideIntersectMesh();return}}else this.pointerLines.left.setPoints(Fe,Ye[0].point)}}this.updateControllerHelper(Ne,e,r)}if(this.camera.pose.distance>.1||x)for(var tr=0,zt=Object.keys(this.panoMeshes);tr<zt.length;tr++){var lt=zt[tr],Oe=this.panoMeshes[lt];Oe.setOpacity(0),Oe.setCurrent(!1),Oe.updateTime&&Oe.updateTime(e,r),Oe.visible=!1}else if(j){var dr=ur(j.visibleIds,function(ct){var qt=i.works.getResolvedObserver(ct);return qt?j.standingPosition.distanceTo(qt.standingPosition):1/0},!0),At=dr[1];At=he(At,2.5,1/0);for(var fr=j.visibleIds.concat(Ue(this.currentPano)),hr=this.getForwardObserverOrNot(),Qt=this.camera.getDirection(new c.Vector3),Et=0,pr=Object.keys(this.panoMeshes);Et<pr.length;Et++){var lt=pr[Et],Oe=this.panoMeshes[lt],Sr=this.works.getResolvedObserver(lt);if(fr.indexOf(lt)===-1)Oe.setCurrent(!1),Oe.setOpacity(0);else if(!Sr)Oe.setCurrent(!1),Oe.setOpacity(0);else if(!Sr.loadable&&!Sr.active)Oe.setCurrent(!1),Oe.setOpacity(0);else{var sn=Oe.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);Oe.setCurrent(!Oe.loading&&Oe.progress===0&&hr!==null&&hr.panoId===lt),Oe.setOpacity(sn<.01?0:he(At/sn*1.2,.65,.98));var jr=this.camera.position.clone().setY(Oe.position.y),me=new c.Vector3().copy(Oe.position).sub(jr).normalize();if(lt===Ue(this.currentPano)){var Jr=he((.5-jr.distanceTo(Oe.position))/.5,0,1);me.multiplyScalar(1-Jr).add(Qt.clone().multiplyScalar(Jr))}me.length()>0&&Oe.quaternion.setFromEuler(new c.Euler(0,Math.atan2(me.x,me.z),0))}Oe.updateTime&&Oe.updateTime(e,r)}}var Ut=function(){return 4}(),$e=function(){var ct=new c.PerspectiveCamera;ct.applyMatrix4(pe.matrix),ct.position.set(0,0,0);var qt=i.works.getResolvedObserver(g.panoId),Ir=qt!=null?qt:j;Ir&&ct.quaternion.premultiply(Ir.quaternion.clone().inverse()),ct.updateProjectionMatrix(),ct.updateMatrixWorld(!0);var Wr=new c.Frustum().setFromProjectionMatrix(new c.Matrix4().multiplyMatrices(ct.projectionMatrix,ct.matrixWorldInverse));return Wr}();g.panoId===Ue(this.currentPano)&&((d=g.leftPanoPicture)===null||d===void 0?void 0:d.map)instanceof De&&(g.leftPanoPicture.map.maxRequest=this.tileMaxRequest,g.leftPanoPicture.map.update($e,Ut),g.leftPanoPicture.map.needsRender===!0&&(this.needsRender=!0,this.modelSceneNeedsRender=!0));{var Ge=this.tiling.object.visible;if(this.initAnimationed){var nt=g.panoId,mt=this.works.getResolvedObserver(nt);mt?Zn(this.camera.position,mt.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==nt&&this.tiling.cleanup(),this.tiling.panoId=nt,this.tiling.setResource((A=(f=mt.images)===null||f===void 0?void 0:f.tiles)!==null&&A!==void 0?A:[],this.enableIOSEDR&&mt.images.luminance?mt.images.luminance:null),this.tiling.setFetcher(it(mt.work)),this.tiling.setRotation(mt.quaternion),this.tiling.setPosition(mt.position),this.tiling.maxRequest=this.tileMaxRequest,Ut>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update($e,Ut,e):this.tiling.update($e,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;Ge!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0,this.modelSceneNeedsRender=!0)}this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e)}}},t.prototype.render=function(){var e=this.xrManager.getCamera(this.camera);this.renderer.render(this.modelScene,e),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,e),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0},t.prototype.onPanGesture=function(){},t.prototype.onTapGesture=function(){},t.prototype.onPinchGesture=function(){},t.prototype.onMouseMove=function(){},t.prototype.onMouseOut=function(){},t.prototype.panoResourceFromLocationMotionKeyframe=function(e){return this.panoResources[e.key]},t.prototype.updateControllerHelper=function(e,r,i){var a=this.xrControllerRay.left,o=this.xrControllerRay.right;if(!(!e||e.length===0)){for(var s={buttons:{X:!1,Y:!1,LeftTrigger:!1,LeftPinch:!1,A:!1,B:!1,RightTrigger:!1,RightPinch:!1}},l=0;l<e.length;l++){var u=e[l].handedness,d=e[l].gamepad;switch(u){case"left":d.axes&&(this.emitHandleEvent(d.axes[2]===-1,"LeftAxesLeft",r),this.emitHandleEvent(d.axes[2]===1,"LeftAxesRight",r),this.emitHandleEvent(d.axes[3]===-1,"LeftAxesUp",r),this.emitHandleEvent(d.axes[3]===1,"LeftAxesDown",r)),d!=null&&d.buttons&&(d.buttons[4]&&this.emitHandleEvent(d.buttons[4].pressed,"X",r),d.buttons[5]&&this.emitHandleEvent(d.buttons[5].pressed,"Y",r),d.buttons[0]&&this.emitHandleEvent(d.buttons[0].pressed,"LeftTrigger",r),d.buttons[1]&&this.emitHandleEvent(d.buttons[1].pressed,"LeftPinch",r));var f={raycaster:a,axes:{up:d.axes&&d.axes[3]<0?Math.abs(d.axes[3]):0,down:d.axes&&d.axes[3]<0?0:Math.abs(d.axes[3]),left:d.axes&&d.axes[2]<0?Math.abs(d.axes[2]):0,right:d.axes&&d.axes[2]<0?0:Math.abs(d.axes[2])},deltaTime:i};s.buttons.X=d.buttons&&d.buttons[4]?d.buttons[4].pressed:!1,s.buttons.Y=d.buttons&&d.buttons[5]?d==null?void 0:d.buttons[5].pressed:!1,s.buttons.LeftTrigger=d.buttons&&d.buttons[0]?d==null?void 0:d.buttons[0].pressed:!1,s.buttons.LeftPinch=d.buttons&&d.buttons[1]?d==null?void 0:d.buttons[1].pressed:!1,s.left=f;break;case"right":d.axes&&(this.emitHandleEvent(d.axes[2]===-1,"RightAxesLeft",r),this.emitHandleEvent(d.axes[2]===1,"RightAxesRight",r),this.emitHandleEvent(d.axes[3]===-1,"RightAxesUp",r),this.emitHandleEvent(d.axes[3]===1,"RightAxesDown",r)),d.buttons&&(d.buttons[4]&&this.emitHandleEvent(d.buttons[4].pressed,"A",r),d.buttons[5]&&this.emitHandleEvent(d.buttons[5].pressed,"B",r),d.buttons[0]&&this.emitHandleEvent(d.buttons[0].pressed,"RightTrigger",r),d.buttons[1]&&this.emitHandleEvent(d.buttons[1].pressed,"RightPinch",r));var A={raycaster:o,axes:{up:d.axes&&d.axes[3]<0?Math.abs(d.axes[3]):0,down:d.axes&&d.axes[3]<0?0:Math.abs(d.axes[3]),left:d.axes&&d.axes[2]<0?Math.abs(d.axes[2]):0,right:d.axes&&d.axes[2]<0?0:Math.abs(d.axes[2])},deltaTime:i};s.right=A,s.buttons.A=d.buttons&&d.buttons[4]?d==null?void 0:d.buttons[4].pressed:!1,s.buttons.B=d.buttons&&d.buttons[5]?d==null?void 0:d.buttons[5].pressed:!1,s.buttons.RightTrigger=d.buttons&&d.buttons[0]?d==null?void 0:d.buttons[0].pressed:!1,s.buttons.RightPinch=d.buttons&&d.buttons[1]?d==null?void 0:d.buttons[1].pressed:!1;break}}this.emit("xr.controller.update",W("xr.controller.update",s))}},t.prototype.emitHandleEvent=function(e,r,i){var a=this.xrControllerRay.left,o=this.xrControllerRay.right;if(e)if(this.xrHandleState[r].touchStart===!1)this.xrHandleState[r].touchStartTime=i,this.xrHandleState[r].touchStart=!0,this.emit("xr.gesture.buttonDown",W("xr.gesture.buttonDown",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!1,isFirst:!0,controllers:{raycaster:{leftRay:a,rightRay:o}}}));else{var s=i-this.xrHandleState[r].touchStartTime;s>Js&&this.emit("xr.gesture.press",W("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!0,controllers:{raycaster:{leftRay:a,rightRay:o}}}))}else if(this.xrHandleState[r].touchStart===!0){this.emit("xr.gesture.buttonUp",W("xr.gesture.buttonUp",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:a,rightRay:o}}}));var s=i-this.xrHandleState[r].touchStartTime;if(s<=Js){var l=W("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:a,rightRay:o}}}),u=this.emit("xr.gesture.tap",l);!u&&!l.defaultPrevented&&r==="RightTrigger"&&this.checkSelectedPano(this.xrControllerRay.right)}this.xrHandleState[r].touchStart=!1,this.xrHandleState[r].touchStartTime=0}},t.prototype.initHandEvent=function(){var e=this;if(!this.xrManager.session)throw new Error("初始化失败");this.xrManager.session.addEventListener("select",function(r){e.gazeRay&&e.checkSelectedPano(e.gazeRay)})},t}(mo),Pt={Floorplan:qa,Topview:Th,Panorama:mo,VRPanorama:xp,Model:Ep,Mapview:Lp,XRPanorama:rv},ku=["gesture.pan","gesture.tap","gesture.press","gesture.pinch","gesture.mousewheel","gesture.mousemove","gesture.momentum","initAnimation.start","initAnimation.end","camera.update","intersect.update","pano.select","pano.moveTo","pano.moving","pano.arrived","pano.cancel","pano.error","pano.texture.load","pano.texture.progress","pano.texture.success","pano.texture.error","pano.texture.abort","xr.session.start","xr.session.end","xr.gesture.tap","xr.gesture.press","xr.gesture.buttonUp","xr.gesture.buttonDown","xr.controller.update"];function nv(n){n.on("initAnimation.start",function(t){n.emit("initAnimationWillStart",t.state.panoIndex,t.state,t.userAction)}),n.on("initAnimation.end",function(t){n.emit("initAnimationEnded",t.state.panoIndex,t.state,t.userAction)}),n.on("gesture.pan",function(t){var e=!1;e=n.emit("wantsGesture","pan",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPanGesture",t.state,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","pan",t.pointers,t.isFinal),n.emit("panGesture",t.state,t.isFinal))}),n.on("gesture.tap",function(t){var e=!1;e=n.emit("wantsGesture","tap",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsTapGesture",t.center.raycaster,t.center.coords,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","tap",t.pointers,t.isFinal),n.emit("tapGesture",t.center.raycaster,t.center.coords,t.isFinal))}),n.on("gesture.press",function(t){var e=!1;e=n.emit("wantsGesture","press",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPressGesture",t.center.raycaster,t.center.coords,t.center.delta,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","press",t.pointers,t.isFinal),n.emit("pressGesture",t.center.raycaster,t.center.coords,t.center.delta,t.isFinal))}),n.on("gesture.pinch",function(t){var e=!1;e=n.emit("wantsGesture","pinch",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPinchGesture",t.scale,t.state.fov,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","pinch",t.pointers,t.isFinal),n.emit("pinchGesture",t.scale,t.state.fov,t.isFinal))}),n.on("gesture.mousewheel",function(t){var e=!1;e=n.emit("wantsGesture","mouseWheel",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsMouseWheel",t.center.delta,t.state.fov,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","mouseWheel",t.pointers,t.isFinal),n.emit("mouseWheel",t.center.delta,t.state.fov,t.isFinal))}),n.on("gesture.mousemove",function(t){var e=!1;e=n.emit("wantsGesture","mouseMove",t.pointers,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","mouseMove",t.pointers,t.isFinal),e=n.emit("wantsChangeCameraFov",t.state.fov),e&&t.preventDefault())}),n.on("gesture.momentum",function(t){var e=!1;e=n.emit("wantsInteriaPan",t.state),e&&t.preventDefault(),t.defaultPrevented||n.emit("interiaPan",t.state,t.isFinal)}),n.on("camera.update",function(t){n.emit("cameraFovUpdate",t.state.fov,t.userAction),n.emit("cameraDirectionUpdate",t.state,t.userAction);var e=Ft(t.state);e.setLength(t.state.distance);var r=t.state.offset.clone().sub(e);n.emit("cameraPositionUpdate",r,t.userAction),n.emit("cameraUpdate",t.state,t.userAction)}),n.on("intersect.update",function(t){if(t.intersection){var e=!1;e=n.emit("wantsShowIntersectionOnModel",t.raycaster),e&&t.preventDefault(),t.defaultPrevented||n.emit("intersectionOnModelUpdate",t.intersection,t.object)}else n.emit("intersectionHidden")}),n.on("pano.request",function(t){var e=n.emit("wantsMoveToPano",t.state.panoIndex,t.options,t.userAction);e||(e=n.emit("wantsToMoveToPano",t.state.panoIndex,t.options,t.userAction)),e&&t.preventDefault(),t.defaultPrevented||n.emit("panoWillLoad",t.state.panoIndex)}),n.on("pano.select",function(t){n.emit("panoSelected",t.state.panoIndex)}),n.on("pano.moveTo",function(t){n.emit("panoLoaded",t.state.panoIndex),n.emit("moveToPano",t.state.panoIndex,t.userAction),n.emit("panoWillArrive",t.state.panoIndex,t.state,t.userAction)}),n.on("pano.moving",function(t){n.emit("movingToPano",t.state.panoIndex,t.prevPano.panoIndex,t.progress)}),n.on("pano.arrived",function(t){n.emit("panoArrived",t.state.panoIndex,t.state,t.userAction)}),n.on("pano.cancel",function(t){n.emit("moveToPanoCanceled",t.state.panoIndex)}),n.on("pano.error",function(t){n.emit("panoLoadError",t.error,t.state.panoIndex)}),n.on("pano.texture.load",function(t){n.emit("textureStartLoad",t.pano.panoIndex)}),n.on("pano.texture.success",function(t){n.emit("textureLoaded",t.pano.panoIndex,t.meta)}),n.on("pano.texture.error",function(t){n.emit("textureError",t.error,t.pano.panoIndex)}),n.on("pano.texture.abort",function(t){n.emit("textureAbort",t.pano.panoIndex)}),n.on("pano.texture.progress",function(t){n.emit("textureLoading",t.progress,t.pano.panoIndex)}),n.on("xr.session.start",function(t){n.emit("webXRSessionStart")}),n.on("xr.session.end",function(t){n.emit("webXRSessionEnd")}),n.on("xr.gesture.tap",function(t){n.emit("webXRControllerEvent","tap",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.press",function(t){n.emit("webXRControllerEvent","press",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.buttonUp",function(t){n.emit("webXRControllerEvent","buttonUp",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.buttonDown",function(t){n.emit("webXRControllerEvent","buttonDown",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.controller.update",function(t){n.emit("webXRControllerRayUpdate",{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0}),t.left&&n.emit("webXRAxesUpdate","left",{raycaster:{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0},axesState:{up:t.left.axes.up,down:t.left.axes.down,left:t.left.axes.left,right:t.left.axes.right},deltaTime:t.left.deltaTime}),t.right&&n.emit("webXRAxesUpdate","right",{raycaster:{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0},axesState:{up:t.right.axes.up,down:t.right.axes.down,left:t.right.axes.left,right:t.right.axes.right},deltaTime:t.right.deltaTime})}),n.on("works.request",function(t){n.emit("willLoad",t.input,t.works[0],t.state)}),n.on("works.load",function(t){n.emit("load",t.input,t.works[0],t.state)}),n.on("works.ready",function(t){n.emit("loaded",t.input,t.works[0])}),n.on("state.change",function(t){n.emit("stateChange",t.state,t.userAction)}),n.on("currentState.change",function(t){n.emit("currentStateChange",t.state,t.userAction)}),n.on("state.set",function(t){n.emit("setState",t.state)}),n.on("state.synced",function(t){n.emit("stateSynced",t.state)}),n.on("model.request",function(t){n.emit("modelWillLoad",t.work.model)}),n.on("model.error",function(t){n.emit("modelLoadError",t.error,t.model)}),n.on("model.load",function(t){n.emit("modelLoaded",t.model)}),n.on("model.changeShownFloor",function(t){n.emit("modelShownFloorChange",t.model.shownFloor,t.model.floorLength)}),n.on("render",function(t){n.emit("renderFrame",t.needsRender)}),n.on("mode.change.request",function(t){n.emit("wantsChangeMode",t.mode,t.prevMode)}),n.on("mode.change",function(t){n.emit("modeChange",t.mode,t.prevMode,t.state.panoIndex,t.state,t.userAction)}),n.on("helpers.visible",function(t){n.emit("helpersVisibleChange",t.object.visible)}),n.on("network.resource",function(t){n.emit("network",t.source,t.requestType,t.requestState,t.detail)})}function iv(){if(typeof window!="undefined"){var n=document.createElement("video");n.loop=!0,n.autoplay=!0,n.playsInline=!0,n.muted=!0,n.crossOrigin="";var t=function(){document.removeEventListener("touchstart",t,!1),document.removeEventListener("mousedown",t,!1),n.muted=!1};return document.addEventListener("touchstart",t,!1),document.addEventListener("mousedown",t,!1),n}else return{}}function Xs(n){{var t=new c.DirectionalLight(16777215,.3);t.position.copy(new c.Vector3(1,1,1)),n.add(t)}{var t=new c.DirectionalLight(16777215,.1);t.position.copy(new c.Vector3(-1,-1,-1)),n.add(t)}{var t=new c.DirectionalLight(16777215,.1);n.add(t)}{var t=new c.AmbientLight(16777215,.6);n.add(t)}}function av(n){for(var t,e,r={},i=n.split(/(\;|\,)/),a=0,o=i;a<o.length;a++){var s=o[a],l=s.split("="),u=(t=l[0])===null||t===void 0?void 0:t.trim(),d=(e=l[1])===null||e===void 0?void 0:e.trim();u&&d&&(r[u]=d)}return r}function Fu(){var n;if(typeof document!="undefined")for(var t=document.getElementsByTagName("meta"),e=0;e<t.length;e++){var r=t[e];if(r.getAttribute("name")==="viewport"){var i=av((n=r.getAttribute("content"))!==null&&n!==void 0?n:""),a=Number(i["initial-scale"]);if(!isNaN(a))return a}}return 1}const ov="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV8AAAA/CAQAAADtPwPkAAAR+0lEQVR4AezYg3LEQACH8d1cbdu23Q5qG9G47z/TN/h6tn2b/H+TUTLc7yjcOXV46OUAnUs6EbUp022ZBXc1NhoZYYd7fjDRvdcHAwrlK2QBVJ4sgoqONmY45RUT23sZ6H42F2hK5CtkMbjhZlDmUUcvq1zyieUVyjbE4I1GBfItwxG56YaUZTQwyh4P6NgJ4YYYvCuQb5kOyI03p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1z9NjrDHaSbnbFMf52sHrDUVaidDxNG0o9+uLjfosfdb3jT5d5j757riJgst9NIZQ2Pn+ySZll80vjI6Wz/hQJG4vPG0L/H6poQch/dW3vL3B0u8jl0HvVj5PvHCElEF8DUAFikVYTcvmfBdDzQlvvMXSV5lP5zrXj/fJ54zuWaeeuoqkW8AwCIaqeTZKkmYrpPwR2eqN9X72W7EG57vU67OBeuMV8KXLUzv93UTTj42tvaFS++GVsc5JRyLSLJ8nzO555hFBmiSRCqMr4GwrcmGkib5xSvcwmzFK6e8s7DMa2xH4YZdZumSOwsVzFeBWdr37tpIhOpSwXqONNgZq/2KgvBt54znHN1HzlljTO4oVD5fb+prNIJXQNL1ofDKQisbPLJDv3jNSLq9OkYBEIihKIj3v7S1TRQCX5Kdl1ZQlol7LF+E++fwirfiq2sf4cTXxc6hzxffPuLEeqSWrPGWMF58TWr5viyJAP5/4EV4KePiaSE8eNRgjDy8/tyRW+FZjhS+2tlovNJovtJovNJ0uhK6Wo64SDdxEbM//KesjwAAAABJRU5ErkJggg==";var _s=[351,63],Zs=[20,20],sv=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),uv=new Float32Array([0,0,1,0,0,1,1,1]),lv=new Uint8Array([0,1,2,1,3,2]),Ni=new c.BufferGeometry;Ni.setAttribute("position",new c.BufferAttribute(sv,3));Ni.setAttribute("uv",new c.BufferAttribute(uv,2));Ni.setIndex(new c.BufferAttribute(lv,1));var mi=new c.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1,fog:!1}),Lu=new c.Mesh(Ni,mi);Lu.matrixAutoUpdate=!1;var wo=new c.Scene;wo.add(Lu);wo.matrixAutoUpdate=!1;var Yn=new c.OrthographicCamera(-.5,.5,.5,-.5,.1,1);Yn.position.set(0,0,.5);Yn.lookAt(0,0,0);Yn.updateMatrixWorld(!0);Yn.matrixAutoUpdate=!1;var cv=new c.Vector4,dv=new c.Vector4;function fv(n){if(mi.map){var r=n.getViewport(cv),i=n.getScissor(dv),a=n.getScissorTest(),o=n.autoClear,s=i.x+Zs[0]/3,l=i.y+Zs[1]/3,u=_s[0]/3,d=_s[1]/3;n.setViewport(s,l,u,d),n.setScissor(s,l,u,d),n.setScissorTest(!0),n.autoClear=!1,n.render(wo,Yn),n.setViewport(r),n.setScissor(i),n.setScissorTest(a),n.autoClear=o}else{var t=new c.Texture,e=new Image;e.onload=function(){t.image=e,t.wrapS=c.ClampToEdgeWrapping,t.wrapT=c.ClampToEdgeWrapping,t.minFilter=c.LinearFilter,t.needsUpdate=!0,t.generateMipmaps=!1,mi.needsUpdate=!0,e.onload=z},e.src=ov,mi.map=t}}var hv=800,Ys=90,pv=function(n){return n.replace("//vrlab-public.ljcdn.com/","//vr-public.realsee-cdn.cn/").replace("//vrlab-image4.ljcdn.com/","//vr-image-4.realsee-cdn.cn/").replace("//vrlab-image3.ljcdn.com/","//vr-image-3.realsee-cdn.cn/").replace("//vrlab-image2.ljcdn.com/","//vr-image-2.realsee-cdn.cn/").replace("//vrlab-image1.ljcdn.com/","//vr-image-1.realsee-cdn.cn/")},vv=new c.Vector2,li=new c.Frustum,ci=new c.Matrix4,$s=new WeakMap,ba=new WeakMap,e0=Va([]),Ou=function(n){ue(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,l,u,d,f,A,m,h=n.call(this)||this;if(h.ident=wt(),typeof window!="undefined"&&(Ga.instances[h.ident]=h),h.renderSwitch01=0,h.currentMode="Panorama",h.pano={workCode:"",panoIndex:0},h.needsRender=!1,h.modelSceneNeedsRender=!1,h.onlyRenderIfNeeds=(r=e.onlyRenderIfNeeds)!==null&&r!==void 0?r:!0,h.imageOptions=F({},(i=e.imageOptions)!==null&&i!==void 0?i:{}),h.textureOptions=F({},(a=e.textureOptions)!==null&&a!==void 0?a:{}),h.poweredByRealsee=(o=e.poweredByRealsee)!==null&&o!==void 0?o:!0,h.extraElements=[],h.controllerInits={Panorama:Object.assign({},e.panorama),Model:Object.assign({},e.model),Floorplan:Object.assign({},e.floorplan),Topview:Object.assign({},e.topview),Mapview:Object.assign({},e.mapview),VRPanorama:Object.assign({},e.vrPanorama),XRPanorama:Object.assign({},e.xrPanorama)},h.fps={testCount:0,testTime:Me()},h.info=null,h.modeChangeDuration=(s=e.modeChangeDuration)!==null&&s!==void 0?s:hv,h.enableWheel=(l=e.enableWheel)!==null&&l!==void 0?l:!0,typeof window!="undefined")if("renderer"in e)e.renderer instanceof Yr&&h.throwError(new Error("cannot render a internal renderer")),h.renderer=e.renderer;else try{h.renderer=new Yr({preserveDrawingBuffer:e.preserveDrawingBuffer,backgroundColor:e.backgroundColor,backgroundAlpha:e.backgroundAlpha,antialias:e.antialias,webgl2:e.webgl2,logarithmicDepthBuffer:e.logarithmicDepthBuffer,precision:e.precision});var v=Fu();h.renderer.setPixelRatio(v===1?window.devicePixelRatio:1),h.renderer.setSize(512,512)}catch(S){S instanceof Error&&h.throwError(S)}h.getPixelsRenderTarget=new c.WebGLRenderTarget(1,1,{encoding:(d=(u=h.renderer)===null||u===void 0?void 0:u.outputEncoding)!==null&&d!==void 0?d:c.sRGBEncoding});var y=new c.DepthTexture(1,1);y.format=c.DepthStencilFormat,y.type=c.UnsignedInt248Type,h.modelRenderTarget=new c.WebGLRenderTarget(1,1,{encoding:(A=(f=h.renderer)===null||f===void 0?void 0:f.outputEncoding)!==null&&A!==void 0?A:c.sRGBEncoding,depthTexture:y,depthBuffer:!0,stencilBuffer:!0}),h.scissor=Object.assign({left:0,bottom:0,width:1,height:1},e.scissor),h.camera=new Fi(Ys),h.scene=new b0,h.xrCustomObjectsScene=new c.Scene,h.scene.add(h.xrCustomObjectsScene),h.scene.matrixAutoUpdate=!1,h.lastLoadWorkTask=Promise.resolve(),h.requestProxy=(m=e.requestProxy)!==null&&m!==void 0?m:pv,h.networkSubscribe=new u0,h.networkSubscribe.on("network",function(S,T,B,L){var k;h.emit("network.resource",W("network.resource",{source:S,requestType:T,requestState:B,detail:L})),(k=h.analysis)===null||k===void 0||k.network(h.works,S,T,B,L)}),h.boundingMesh=fh(new c.Box3(new c.Vector3(-.5,-.5,-.5),new c.Vector3(.5,.5,.5))),h.boundingMesh.name="bounding",h.models=ws(),h.models.push(new Da),h.lastModels=ws(),h.lastWorks=Va([]),h.readyCallbacks=[],h.syncingState=!1,h.helperGroup=new c.Group,h.helperGroup.name="helper",h.helperGroup.matrixAutoUpdate=!1,h.scene.add(h.helperGroup),h.modelGroup=new c.Group,h.modelGroup.visible=!1,h.modelGroup.name="model",h.modelGroup.matrixAutoUpdate=!1,h.modelScene=new c.Scene,h.modelScene.add(h.modelGroup),h.modelScene.add(h.boundingMesh),h.modelScene.matrixAutoUpdate=!1,h.videoTexture=new c.VideoTexture(e.videoInstance||iv()),Xs(h.scene),Xs(h.modelScene),h.state={mode:h.currentMode,workCode:h.pano.workCode,panoIndex:h.pano.panoIndex,longitude:h.camera.pose.longitude,latitude:h.camera.pose.latitude,fov:h.camera.pose.fov,offset:h.camera.pose.offset.clone(),distance:h.camera.pose.distance},h.stateSynced=!1,h._enablePostProcessing=!1,h._enableIOSEDR=!1,h._enableEDL=!1,h._enableHQ=!1,h.destroyed=!1,h.paused=!0,typeof window!="undefined"&&(e.play!==!1&&h.play(),h.stopAnimationLoop=vt.shared.add(function(S,T){for(var B=[],L=2;L<arguments.length;L++)B[L-2]=arguments[L];h.updateTime.apply(h,bt([S,T],B,!1))},!1,0,10));var p=function(){typeof document!="undefined"&&document.fullscreenElement===null&&h.currentMode==="VRPanorama"&&h.controller.emit("vr.requestExit",W("vr.requestExit",{}))},g=function(){h.needsRender=!0,h.modelSceneNeedsRender=!0};if(typeof document!="undefined"&&document.addEventListener("fullscreenchange",p,!1),h.renderer&&h.renderer.domElement.addEventListener("webglcontextrestored",g,!1),h.removeEventListeners=function(){typeof document!="undefined"&&document.removeEventListener("fullscreenchange",p,!1),h.renderer&&h.renderer.domElement.removeEventListener("webglcontextrestored",g,!1)},h.plugins={},e.plugins&&e.plugins.length)for(var x=0,b=e.plugins;x<b.length;x++){var w=b[x];if(typeof w=="function")w(h);else if(Array.isArray(w)){var E=w[0],M=w[1],C=w[2];if(typeof E=="function"){var P=E(h,C);typeof M=="string"&&(h.plugins[M]?h.throwError(new Error("plugin name ".concat(M," is exists."))):h.plugins[M]=P)}}}return h.gpuPickingRenderTarget=new c.WebGLRenderTarget(1,1),h.meshReplaceMaterialMap=new Map,h.meshOriginMaterialMap=new Map,nv(h),h}return Object.defineProperty(t,"version",{get:function(){return"6.2.0-alpha.4"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"dracoPath",{get:function(){return Mi.decoderPath},set:function(e){Mi.setDecoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t,"ktx2Path",{get:function(){return qn.transcoderPath},set:function(e){qn.setTranscoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panoIndex",{get:function(){return this.pano.panoIndex},enumerable:!1,configurable:!0}),t.prototype.getGPUPicking=function(e,r,i,a,o){var s=this;if(a===void 0&&(a=1),o===void 0&&(o=new c.Vector3(0,0,0)),!this.renderer)throw new Error("renderer is not initialized.");this.models.setMaterial({constantColor:o}),this.scene.traverse(function(f){if(!(!(f instanceof c.Mesh)||f instanceof Vt)){var A=Object.keys(i).filter(function(h){return h===f.uuid})[0];if(A)if(s.meshOriginMaterialMap.set(A,f.material),s.meshReplaceMaterialMap.get(A))f.material=s.meshReplaceMaterialMap.get(A);else{var m=new c.ShaderMaterial({uniforms:{color:{value:i[A]}},vertexShader:`
|
|
2062
2062
|
void main() {
|
|
2063
2063
|
vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
|
|
2064
2064
|
gl_Position = projectionMatrix * mvPosition;
|
|
@@ -2068,4 +2068,4 @@ void main() {
|
|
|
2068
2068
|
void main() {
|
|
2069
2069
|
gl_FragColor = vec4( color, 1.0 );
|
|
2070
2070
|
}
|
|
2071
|
-
`});m.depthTest=f.material.depthTest,m.side=f.material.side,s.meshReplaceMaterialMap.set(A,m),f.material=m}}});var l=this.renderer.getSize(new c.Vector2);this.camera.setViewOffset(l.width,l.height,e*a,r*a,1,1),this.renderer.setRenderTarget(this.gpuPickingRenderTarget),this.render();var u=new Uint8Array(4);this.renderer.readRenderTargetPixels(this.gpuPickingRenderTarget,0,0,1,1,u),this.renderer.setRenderTarget(null),this.camera.clearViewOffset(),this.scene.traverse(function(f){!(f instanceof c.Mesh)||f instanceof Vt||s.meshOriginMaterialMap.get(f.uuid)&&(f.material=s.meshOriginMaterialMap.get(f.uuid))}),this.models.setMaterial({constantColor:null});var d=Object.keys(i).filter(function(f){return i[f].equals(new c.Color().setRGB(u[0]/255,u[1]/255,u[2]/255))})[0];return d||!1},t.prototype.dispose=function(){var e,r;if(this.destroyed!==!0){delete Ha.instances[this.ident],this.emit("dispose"),this.destroyed=!0,this.pause(),this.stopAnimationLoop&&(this.stopAnimationLoop(),delete this.stopAnimationLoop),(e=this.renderer)===null||e===void 0||e.setAnimationLoop(null),this.off(),this.networkSubscribe.off(),this.controller&&(this.controller.destroy(),this.controller=void 0);var i=this.getElement();i&&i.parentNode&&i.parentNode.removeChild(i);var a=this.models.getMaterial();a&&(a.pano0&&a.pano0.map.dispose(),a.pano1&&a.pano1.map!==((r=a.pano0)===null||r===void 0?void 0:r.map)&&a.pano1.map.dispose());for(var o=0,s=this.models;o<s.length;o++){var l=s[o];l.dispose()}this.models.length=0,this.models.setMaterial({pano0:null,pano1:null}),this.meshReplaceMaterialMap.forEach(function(u){u.dispose()}),this.meshOriginMaterialMap.forEach(function(u){u.dispose()}),this.renderer instanceof Yr&&this.renderer.forceContextLoss&&this.renderer.forceContextLoss()}},t.prototype.setScissor=function(e){var r;if(Object.assign(this.scissor,e),this.controller&&this.controller.updateRenderSize){var i=new c.Vector2;(r=this.renderer)===null||r===void 0||r.getDrawingBufferSize(i),this.controller.updateRenderSize(i)}},Object.defineProperty(t.prototype,"helperVisible",{get:function(){return this.helperGroup.visible},set:function(e){this.helperGroup.visible!==e&&(this.helperGroup.visible=e,this.emit("helpers.visible",W("helpers.visible",{object:this.helperGroup})),this.needsRender=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableIOSEDR",{get:function(){return this._enableIOSEDR},set:function(e){this._enableIOSEDR!==e&&(this._enableIOSEDR=e,this.currentMode&&this.currentMode==="Panorama"&&this.changeMode(this.currentMode,this.getCurrentState(),0,!1,!0))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"postProcessingType",{get:function(){return this.currentMode==="Panorama"&&this.enableIOSEDR&&this.enablePostProcessing?"luminance":this.currentMode==="Mapview"&&this.enableEDL?"edl":this.currentMode==="Mapview"&&this.enableHQ?"hq":null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableEDL",{get:function(){return this._enableEDL},set:function(e){if(e===!0&&this.currentMode!==t.Mode.Mapview)throw new Error("只支持Mapview下开启EDL");this._enableEDL!==e&&(this._enableEDL=e,this.boundingMesh.visible=!e,this.needsRender=!0,this.modelSceneNeedsRender=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableHQ",{get:function(){return this._enableHQ},set:function(e){if(e===!0&&this.currentMode!==t.Mode.Mapview)throw new Error("只支持Mapview下开启HQ");this._enableHQ!==e&&(this._enableHQ=e,this.boundingMesh.visible=!e,this.needsRender=!0,this.modelSceneNeedsRender=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enablePostProcessing",{get:function(){return this._enablePostProcessing},set:function(e){this._enablePostProcessing!==e&&(this._enablePostProcessing=e),this.needsRender=!0,this.modelSceneNeedsRender=!0},enumerable:!1,configurable:!0}),t.prototype.updateConfiguration=function(e,r){r===void 0&&(r=!0);var i=!1;e.panorama&&(Object.assign(this.controllerInits.Panorama,e.panorama),this.currentMode==="Panorama"&&(i=!0)),e.model&&(Object.assign(this.controllerInits.Model,e.model),this.currentMode==="Model"&&(i=!0)),e.floorplan&&(Object.assign(this.controllerInits.Floorplan,e.floorplan),this.currentMode==="Floorplan"&&(i=!0)),e.topview&&(Object.assign(this.controllerInits.Topview,e.topview),this.currentMode==="Topview"&&(i=!0)),e.mapview&&(Object.assign(this.controllerInits.Mapview,e.mapview),this.currentMode==="Mapview"&&(i=!0)),e.vrPanorama&&(Object.assign(this.controllerInits.VRPanorama,e.vrPanorama),this.currentMode==="VRPanorama"&&(i=!0)),e.imageOptions&&(Object.assign(this.imageOptions,e.imageOptions),(this.currentMode==="Panorama"||this.currentMode==="VRPanorama")&&(i=!0)),e.textureOptions&&Object.assign(this.textureOptions,e.textureOptions),r&&i&&this.controller&&this.currentMode&&this.changeMode(this.currentMode,this.getCurrentState(),0,!1,!0)},t.prototype.appendTo=function(e,r){if(r===void 0&&(r={}),!!this.renderer){if(!(this.renderer instanceof Yr)){this.throwError(new Error("cannot call appendTo method when render a external renderer"));return}var i=this.getElement();if(i){e.appendChild(i),this.refresh(r);var a=window.getComputedStyle(e).position;a!=="relative"&&a!=="absolute"&&a!=="fixed"&&a!=="sticky"&&(e.style.position="relative")}}},t.prototype.refresh=function(e,r){if(e===void 0&&(e={}),!!this.renderer){var i=this.getElement();if(i){var a=i.parentNode;if(a&&a.nodeName){var o=e.width,s=o===void 0?a.offsetWidth:o,l=e.height,u=l===void 0?a.offsetHeight:l;this.renderer instanceof Yr&&(r&&this.renderer.setPixelRatio(r),this.renderer.setSize(s,u))}var d=new c.Vector2;this.renderer.getDrawingBufferSize(d),this.controller&&this.controller.updateRenderSize&&this.controller.updateRenderSize(d),this.modelRenderTarget.setSize(d.x,d.y),this.modelRenderTarget.depthTexture.dispose();var f=new c.DepthTexture(d.x,d.y);f.format=c.DepthStencilFormat,f.type=c.UnsignedInt248Type,this.modelRenderTarget.depthTexture=f,this.modelRenderTarget.depthTexture.needsUpdate=!0,this.needsRender=!0,this.modelSceneNeedsRender=!0,this.render(z,!0)}}},t.prototype.addExtraElement=function(e){var r=this;return this.extraElements.indexOf(e)===-1&&(this.extraElements.push(e),this.controller&&this.controller.bindExtraElement(e)),function(){return r.removeExtraElement(e)}},t.prototype.removeExtraElement=function(e){var r=this.extraElements.indexOf(e);r!==-1&&(this.extraElements.splice(r,1),this.controller&&this.controller.unbindExtraElement(e))},t.prototype.getPose=function(){var e=this.camera.copyPose(),r=e.longitude,i=e.latitude,a=e.fov,o=e.offset,s=e.distance;return{longitude:r,latitude:i,fov:a,offset:o.clone(),distance:s}},t.prototype.getSize=function(e){if(!this.renderer)throw new Error("renderer is not initialized");return this.renderer.getSize(e),e.x*=this.scissor.width,e.y*=this.scissor.height,e},t.prototype.getDrawingBufferSize=function(e){if(!this.renderer)throw new Error("renderer is not initialized");return this.renderer.getDrawingBufferSize(e),e.x*=this.scissor.width,e.y*=this.scissor.height,e},t.prototype.updateCamera=function(e,r,i){return i===void 0&&(i=!0),this.controller?this.controller.updateCamera(e,r,i):Promise.reject(new Error("controller is not initialized."))},t.prototype.updateCameraWithKeyframes=function(e,r,i){return i===void 0&&(i=!0),this.controller?this.controller.updateCameraWithKeyframes(e,r,i):Promise.reject(new Error("controller is not initialized."))},t.prototype.getLongitudeAndLatitude=function(){var e=this.getPose(),r=e.longitude,i=e.latitude;return{longitude:r,latitude:i}},t.prototype.getOffset=function(){return this.getPose().offset},t.prototype.getCameraLocal=function(){if(this.pano.workCode&&this.controller&&this.works){var e=this.works.getResolvedObserver(this.pano);if(e){var r=new c.Object3D;return r.position.copy(e.position),r.quaternion.copy(e.quaternion),r.scale.set(1,1,1),r.matrix.compose(r.position,r.quaternion,r.scale),r.matrixAutoUpdate=!1,fh(this.camera,r)}}return null},Object.defineProperty(t.prototype,"works",{get:function(){var e=ba.get(this);if(!e)return $s;for(var r=0,i=e;r<i.length;r++){var a=i[r];if(!ao.has(a))return $s}return e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"work",{get:function(){return this.works[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"model",{get:function(){return this.models[0]},enumerable:!1,configurable:!0}),t.prototype.load=function(e,r,i,a){var o=this;if(a===void 0&&(a=!0),!this.renderer)throw new Error("renderer is not initialized");var s=this.lastLoadWorkTask.then(function(){return ph(e)?e.then(function(l){return o.load_(l,r,i,a)}):o.load_(e,r,i,a)});return this.lastLoadWorkTask=s.catch(function(l){o.throwError(l)}),s},t.prototype.load_=function(e,r,i,a){var o=this,s,l,u,d,f,A,m,h;a===void 0&&(a=!0);var v={};typeof i=="number"?v.duration=i:typeof i=="object"&&Object.assign(v,i),this.controller||(v.duration=0,v.effect="instant");var y=[];if(Array.isArray(e))for(var p=0,g=e;p<g.length;p++){var x=g[p];typeof x!="string"&&"work"in x?y.push(Hn(x.work,x)):y.push(Hn(x))}else y.push(Hn(e));for(var b=Va(y),w=function(j){var Z=E,Y=new Za({allowHosts:j.allowHosts,get requestProxy(){return Z.requestProxy},get networkSubscribe(){return Z.networkSubscribe}});Hf(j,Y)},E=this,M=0,C=b;M<C.length;M++){var P=C[M];w(P)}this.lastWorks=this.works,r===void 0&&(r="inherit"),r==="inherit"&&this.lastWorks.length===0&&(r="initial");var S=b.initial,T=S.work.observers[0],B=T?{workCode:T.work.workCode,panoIndex:T.panoIndex}:{workCode:S.work.workCode,panoIndex:0},L=(s=S.mode)!==null&&s!==void 0?s:T?"Panorama":"Mapview",k={};if(r==="inherit"){L=this.currentMode;var O=b.resolvedObservers[this.panoIndex];O?B={workCode:O.work.workCode,panoIndex:O.panoIndex}:typeof b.initial.panoIndex=="number"?B={workCode:b.initial.work.workCode,panoIndex:b.initial.panoIndex}:(L==="Panorama"||L==="VRPanorama"||L==="XRPanorama")&&(L="Mapview"),k={longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,distance:this.camera.pose.distance,offset:this.camera.pose.offset.clone()}}else if(r==="initial")typeof S.panoIndex=="number"&&(B={workCode:S.work.workCode,panoIndex:S.panoIndex}),S.mode&&(L=S.mode),k={longitude:S.longitude,latitude:S.latitude,fov:S.fov,distance:S.distance,offset:(l=S.offset)===null||l===void 0?void 0:l.clone()};else{if(L=(u=r.mode)!==null&&u!==void 0?u:this.currentMode,typeof r.panoIndex=="number"){var O=b.getResolvedObserver({workCode:(f=(d=r.workCode)!==null&&d!==void 0?d:S.work.workCode)!==null&&f!==void 0?f:"",panoIndex:r.panoIndex});O&&(B={workCode:O.work.workCode,panoIndex:O.panoIndex})}k={longitude:r.longitude,latitude:r.latitude,fov:r.fov,distance:r.distance,offset:r.offset}}var D=F(F(F({},B),{mode:L}),k);this.emit("works.request",W("works.request",{input:e,works:b,state:D,userAction:a}));var N=function(){var j,Z;o.pano=B;var Y=(j=v.duration)!==null&&j!==void 0?j:o.modeChangeDuration,pe=(Z=v.effect)!==null&&Z!==void 0?Z:"fade",ee=F(F({initial:{state:D,currentState:o.getCurrentState(),duration:Y,effect:pe,userAction:a}},o.commonParams()),o.controllerInits[L]);if(o.controller&&o.currentMode===L)o.controller.updateWork(b,D,{effect:pe,duration:Y},a)===!1&&(o.controller.destroy(),o.controller=o.applyController(L,ee));else{var oe=o.currentMode,ie=Pt[L].initAnimationEndState(ee);if(o.controller)o.controller.destroy();else{var ce=Pt[L].initAnimationEndState(ee);o.camera.setFromPose(ce),o.modelGroup.visible=!0,o.emit("camera.update",W("camera.update",{state:o.getCurrentState(),userAction:a}))}o.controller=o.applyController(L,ee);var ne=W("mode.change",{prevMode:oe,mode:L,state:ie,userAction:a});o.emit("mode.change",ne)}};if(ba.set(this,b),!this.controller){var X=F(F({initial:{state:D,currentState:this.getCurrentState(),duration:(A=v.duration)!==null&&A!==void 0?A:this.modeChangeDuration,effect:(m=v.effect)!==null&&m!==void 0?m:"fade",userAction:a}},this.commonParams()),this.controllerInits[L]),K=Pt[L].initAnimationEndState(X);this.camera.setFromPose(K),this.emit("camera.update",W("camera.update",{state:this.getCurrentState(),userAction:a}))}if(this.updateConfiguration(v,!1),L===t.Mode.Floorplan||L===t.Mode.Topview||L===t.Mode.Mapview||L===t.Mode.Model)this.loadModel(b,v).then(function(){o.needsRender=!0,o.modelSceneNeedsRender=!0,N(),o.emit("camera.update",W("camera.update",{state:o.getCurrentState(),userAction:a}))});else{if(!this.controller){var Q=new c.Vector3,G=b.getResolvedObserver(B);G&&Q.copy(G.position),this.camera.setFromPose({fov:k.fov,longitude:k.longitude,latitude:k.latitude,distance:k.distance,offset:(h=k.offset)!==null&&h!==void 0?h:Q}),this.needsRender=!0,this.modelSceneNeedsRender=!0}N();var J=!1,H=function(){var j;o.needsRender=!0,o.modelSceneNeedsRender=!0,o.emit("camera.update",W("camera.update",{state:o.getCurrentState(),userAction:a})),setTimeout(function(){o.works===b&&J===!1&&(o.loadModel(b,v),J=!0)},(j=v.duration)!==null&&j!==void 0?j:o.modeChangeDuration)};this.controller.once("pano.moveTo",H),this.controller.once("pano.cancel",H)}return this.emit("works.load",W("works.load",{input:e,state:this.getCurrentState(),userAction:a,works:b})),this.ready().then(function(){var j;o.emit("works.ready",W("works.ready",{input:e,state:o.getCurrentState(),userAction:a,works:b})),(j=o.analysis)===null||j===void 0||j.work(b)})},t.prototype.reset=function(){var e=this,r=this.lastLoadWorkTask.then(function(){return e.reset_()});return this.lastLoadWorkTask=r.catch(function(i){e.throwError(i)}),r},t.prototype.reset_=function(){var e=this;return new Promise(function(r){var i;e.controller&&(e.controller.destroy(),e.controller=void 0);var a=e.models.getMaterial();a&&(a.pano0&&a.pano0.map.dispose(),a.pano1&&a.pano1.map!==((i=a.pano0)===null||i===void 0?void 0:i.map)&&a.pano1.map.dispose()),e.models.setMaterial({pano0:null,pano1:null});for(var o=0,s=e.models;o<s.length;o++){var l=s[o];e.lastModels.push(l)}if(e.models.length=0,e.lastModels.length>0){for(var u=0,d=e.lastModels;u<d.length;u++){var l=d[u];e.modelGroup.remove(l),l.dispose(),e.needsRender=!0,e.modelSceneNeedsRender=!0}e.lastModels.length=0}e.lastWorks&&delete e.lastWorks,ba.delete(e),e.currentMode="Panorama",e.pano={workCode:"",panoIndex:0},e.camera.setFromPose({distance:0,fov:Zs,longitude:0,latitude:0,offset:new c.Vector3(0,0,0)}),e.state={mode:e.currentMode,workCode:e.pano.workCode,panoIndex:e.pano.panoIndex,longitude:e.camera.pose.longitude,latitude:e.camera.pose.latitude,fov:e.camera.pose.fov,offset:e.camera.pose.offset.clone(),distance:e.camera.pose.distance},e.models.needsRender=!1,e.camera.needsRender=!1,e.needsRender=!1,e.modelSceneNeedsRender=!1,r()})},t.prototype.changeMode=function(e,r,i,a,o){var s=this;return r===void 0&&(r={}),a===void 0&&(a=!0),o===void 0&&(o=!1),new Promise(function(l,u){var d,f,A,m;if(!s.renderer)throw new Error("renderer is not initialized.");r=F({},r);var h=0;s.controller&&(typeof i=="number"?h=i:h=(d=i==null?void 0:i.duration)!==null&&d!==void 0?d:s.modeChangeDuration);var v="fly";s.controller&&typeof i=="object"&&i.effect&&(v=i.effect);var y=typeof r.panoIndex=="number"?{workCode:(m=(f=r.workCode)!==null&&f!==void 0?f:(A=s.work)===null||A===void 0?void 0:A.workCode)!==null&&m!==void 0?m:"",panoIndex:r.panoIndex}:s.pano;if(!t.Mode.hasOwnProperty(e)){var p=new Error('mode "'.concat(e,'" is not existed'));s.throwError(p),u(p);return}if((e===t.Mode.Floorplan||e===t.Mode.Topview||e===t.Mode.Mapview||e===t.Mode.Model)&&!s.models.loaded){var p=new Error("model is not ready.");s.throwError(p),u(p);return}if((e===t.Mode.Panorama||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama)&&!s.works.getResolvedObserver(y)){var p=new Error("PanoId ".concat(Ue(y)," not existed."));s.throwError(p),u(p);return}var g=s.controller,x=s.currentMode,b=function(){if(s.controller&&s.controller.stopMomentumMovement(),s.controller&&o===!1&&x===e)e===t.Mode.Panorama||e===t.Mode.Model||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama?_t(s.pano,y)&&"moveToPano"in s.controller&&typeof s.controller.moveToPano=="function"?s.controller.moveToPano(y,F({duration:h},r),a):s.controller.updateCamera(r,h,a).catch(z):(_t(s.pano,y)||(s.pano=y),s.controller.updateCamera(r,h,a).catch(z));else{var E=F(F({},r),y),M=F(F({initial:{state:E,currentState:s.getCurrentState(),duration:h,effect:v,userAction:a}},s.commonParams()),s.controllerInits[e]),C=Pt[e].initAnimationEndState(M),P=W("mode.change.request",{prevMode:s.currentMode,mode:e,state:C,userAction:a});if(s.emit("mode.change.request",P),!P.defaultPrevented){g&&g.destroy(),s.controller=s.applyController(e,M);var S=W("mode.change",{prevMode:s.currentMode,mode:e,state:C,userAction:a});s.emit("mode.change",S)}}l()};if(e===t.Mode.VRPanorama)s.requestFullscreen(),vh().then(function(){return b()}).catch(function(E){E instanceof Error&&(s.exitFullscreen(),s.throwError(E),u(E))});else if(e===t.Mode.XRPanorama){var w=vt.shared.getContext();w?w.end():Ah().then(function(E){vt.shared.setContext(E),b()}).catch(function(E){E instanceof Error&&(s.throwError(E),u(E))})}else b()})},t.prototype.getPixels=function(e,r,i,a,o){if(o===void 0&&(o=1),!this.renderer)throw new Error("renderer is not initialized.");for(var s=0,l=this.scene.children;s<l.length;s++){var u=l[s];u instanceof c.Object3D&&u.traverseVisible(function(g){g.setResolution&&g.setResolution(i*o,a*o)})}var d=this.getPixelsRenderTarget,f=this.renderer.getSize(new c.Vector2);if(e=he(e,Math.floor(i/2),Math.floor(f.x-i)),r=he(r,Math.floor(a/2),Math.floor(f.y-a)),d.setSize(i*o,a*o),this.renderer.setRenderTarget(d),this.camera.setViewOffset(f.width,f.height,e,f.height-r-a,i,a),this.controller){this.controller.updateRenderSize(new c.Vector2(i*o,a*o)),this.controller.render(!0,this.postProcessingType);var A=this.getElement();if(!A)throw new Error("element is not initialized.");var m=A.parentNode;if(m&&m.nodeName){var h=m.offsetWidth,v=m.offsetHeight;this.renderer.setSize(h,v)}if(this.controller.updateRenderSize){var y=new c.Vector2;this.renderer.getDrawingBufferSize(y),this.controller.updateRenderSize(y)}}else this.renderer.render(this.scene,this.camera),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!1,this.renderer.render(this.modelScene,this.camera),this.renderer.autoClearDepth=!0,this.renderer.autoClearColor=!0;var p=new Uint8Array(i*o*a*o*4);return this.renderer.readRenderTargetPixels(d,0,0,i*o,a*o,p),this.renderer.setRenderTarget(null),this.camera.clearViewOffset(),p},t.prototype.getElement=function(){var e;return(e=this.renderer)===null||e===void 0?void 0:e.domElement},Object.defineProperty(t.prototype,"observers",{get:function(){return this.works.resolvedObservers},enumerable:!1,configurable:!0}),t.prototype.render=function(e,r){var i=this;if(r===void 0&&(r=!1),!this.renderer)return null;if(r){var a=this.renderer.getSize(pv);this.scene.traverseVisible(function(o){o.setResolution&&o.setResolution(a.x,a.y)})}return this.aroundScissor(function(){i.renderer&&(i.controller?(i.controller.render(i.onlyRenderIfNeeds?i.modelSceneNeedsRender:!0,i.postProcessingType),i.info={memory:F({},i.controller.renderer.info.memory),render:F({},i.controller.renderer.info.render)}):(i.renderer.render(i.scene,i.camera),i.info={memory:F({},i.renderer.info.memory),render:F({},i.renderer.info.render)}),i.poweredByRealsee&&i.currentMode!=="VRPanorama"&&i.currentMode!=="XRPanorama"&&i.renderer.getRenderTarget()!==i.getPixelsRenderTarget&&dv(i.renderer)),e&&vt.shared.add(e,!0)}),null},t.prototype.updateTime=function(e,r){for(var i,a=this,o,s,l=[],u=2;u<arguments.length;u++)l[u-2]=arguments[u];if(!this.destroyed){if(this.works.update(),this.syncingState=this.syncState(e,r),this.controller&&(i=this.controller).updateTime.apply(i,bt([e,r],l,!1)),this.renderer&&(this.camera.pixelRatio=this.renderer.getPixelRatio(),this.getSize(this.camera.resolution),this.camera.aspect=this.camera.resolution.width/this.camera.resolution.height),this.camera.updateTime(e,r),this.renderer){qn.detectSupport(this.renderer);var d=this.models.loaded,f=this.models.refined;if(this.models.update(this.renderer,this.camera,this.currentMode),d===!1&&this.models.loaded===!0&&this.emit("models.load",W("models.load",{models:this.models})),f===!1&&this.models.refined===!0&&this.emit("models.refined",W("models.refined",{models:this.models})),this.models.loaded){for(var A=0,m=this.models;A<m.length;A++){var h=m[A];h.parent!==this.modelGroup&&(this.modelGroup.add(h),this.needsRender=!0,this.modelSceneNeedsRender=!0)}if(this.lastModels.length>0){for(var v=0,y=this.lastModels;v<y.length;v++){var h=y[v];this.modelGroup.remove(h),h.dispose(),this.needsRender=!0,this.modelSceneNeedsRender=!0}this.lastModels.length=0}this.lastWorks&&delete this.lastWorks}this.lastModels.setMaterial(this.models.getMaterial()),this.lastModels.materialVersion=this.models.materialVersion,this.lastModels.update(this.renderer,this.camera,this.currentMode)}this.syncingState=!1;var p=new c.Vector2(512,512),g=new c.Vector2(512,512);this.renderer&&(this.renderer.getSize(p),p.x*=this.scissor.width,p.y*=this.scissor.height,this.renderer.getDrawingBufferSize(g),g.x*=this.scissor.width,g.y*=this.scissor.height);{for(var x=new c.Box3,b=new c.Box3,w=new c.Vector3(4,4,4),E=0,M=this.works.resolvedObservers;E<M.length;E++){var C=M[E];b.setFromCenterAndSize(C.position,w),x.union(b)}if(x.union(this.models.bounding),this.lastWorks)for(var P=0,S=this.lastWorks.resolvedObservers;P<S.length;P++){var C=S[P];b.setFromCenterAndSize(C.position,w),x.union(b)}x.union(this.lastModels.bounding),x.getCenter(this.boundingMesh.position),x.getSize(this.boundingMesh.scale),this.boundingMesh.boundingBox.copy(x);var T=(o=this.models.getMaterial())!==null&&o!==void 0?o:{},B=1-((s=T.modelAlpha)!==null&&s!==void 0?s:0);T.opacity=he(B*4-3,0,1),T.clippers=null,T.shownFloorIndex=-2,this.boundingMesh.setMaterial(T),this.boundingMesh.needsRender=!1}var L=W("render.prepare",{needsRender:!0,info:null});if(this.emit("render.prepare",L),!L.defaultPrevented){var k=[];ci.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),li.setFromProjectionMatrix(ci);for(var O=0,D=this.scene.children;O<D.length;O++){var N=D[O];N!==this.modelGroup&&N!==this.boundingMesh&&N instanceof c.Object3D&&N.traverseVisible(function(H){if(H.setResolution&&H.setResolution(p.x,p.y),H.setTime&&H.setTime(e),H.mixer instanceof c.AnimationMixer){var j=Ys.get(H.mixer);j||(j=new c.Clock,Ys.set(H.mixer,j)),H.mixer.update(j.getDelta())}(H instanceof c.Mesh||H instanceof c.Line||H instanceof c.Points)&&(H instanceof c.ImmediateRenderObject||!H.frustumCulled||li.intersectsObject(H))&&k.push(H)})}if(g.width*g.height>4096*2048?this.renderSwitch01=this.renderSwitch01^1:this.renderSwitch01=0,this.renderer&&this.paused===!1&&this.renderSwitch01===0){var X=void 0;if(this.onlyRenderIfNeeds!==!0)X=this.render();else{if(this.controller&&(this.controller.needsRender===!0&&(this.controller.needsRender=!1,this.needsRender=!0),this.controller.modelSceneNeedsRender===!0&&(this.controller.modelSceneNeedsRender=!1,this.modelSceneNeedsRender=!0)),this.camera.needsRender===!0&&(this.camera.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0),this.models.needsRender===!0&&(this.models.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0),this.needsRender!==!0)for(var K=0,Q=k;K<Q.length;K++){var G=Q[K],J=function(H){H.needsRender===!0?(H.needsRender=!1,a.needsRender=!0):H.mixer&&H.mixer.stats.actions.inUse>0&&(a.needsRender=!0)};J(G),G.traverseAncestors(J)}(this.needsRender!==!1||this.modelSceneNeedsRender!==!1)&&(X=this.render())}this.needsRender=!1,this.modelSceneNeedsRender=!1,this.hasListener("render")&&this.emit("render",W("render",{needsRender:X!==void 0,info:this.info}))}this.needsRender=!1,this.modelSceneNeedsRender=!1}this.fps.testTime&&e-this.fps.testTime<1e3?this.fps.testCount++:(this.emit("fps",this.fps.testCount),this.fps.testTime=e,this.fps.testCount=0)}},t.prototype.pause=function(){this.paused=!0,this.renderer&&this.renderer instanceof Yr&&this.renderer.clear(!0,!0,!0)},t.prototype.play=function(){this.needsRender=!0,this.modelSceneNeedsRender=!0,this.paused=!1},t.prototype.moveToPano=function(e,r,i){r===void 0&&(r={}),i===void 0&&(i=!0);var a=this,o=a.controller,s=a.renderer;if(!o)return this.throwError(new Error("controller is not initialized.")),Promise.resolve();if(!s)return this.throwError(new Error("renderer is not initialized.")),Promise.resolve();var l=this.works.getResolvedObserver(e);if(!l)return this.throwError(new Error("pano ".concat(JSON.stringify(e)," not existed."))),Promise.resolve();var u={workCode:l.work.workCode,panoIndex:l.panoIndex};return"moveToPano"in o&&typeof o.moveToPano=="function"?o.moveToPano(u,r,i):l&&(this.pano=u,this.once("initAnimation.start",function(d){r.moveStartCallback&&r.moveStartCallback(d.state)}),this.once("initAnimation.end",function(d){r.moveEndCallback&&r.moveEndCallback(d.state)}),this.changeMode(t.Mode.Panorama,r,{effect:r.effect},i)),this.ready()},t.prototype.preloadPano=function(e,r){var i=this;r===void 0&&(r=z);var a=this.works.getResolvedObserver(e);if(!a)return Promise.reject(new Error("Pano ".concat(JSON.stringify(e)," never found")));var o=["right","left","up","down","front","back"],s=Me();return Promise.all(o.map(function(l){var u=F({key:"pano.".concat(a.panoId,".").concat(l)},Cr(i.imageOptions,["size","format","quality","mappings"])),d=a.images[l],f=i.imageOptions.transform?i.imageOptions.transform(d,u):jt(d,u);return it(a.work).preload(f)})).then(function(){var l=Me()-s;return r(l),l})},t.prototype.project2d=function(e,r){if(r===void 0&&(r=!1),!this.renderer)return null;if(this.models.length>0&&r){var i=this.camera.position,a=e.clone().sub(i),o=new c.Raycaster(i,a.clone().normalize());o.params.Points={threshold:.1};var s=this.models.intersectRaycaster(o)[0];if(s&&s.distance+.01<a.length())return null}var l=e.clone().project(this.camera);if(Math.abs(l.z)>1)return null;var u=this.renderer.getSize(new c.Vector2),d=u.x*this.scissor.width,f=u.y*this.scissor.height,A=u.x*this.scissor.left+(l.x+1)/2*d,m=u.y*(1-this.scissor.bottom-this.scissor.height)+(-l.y+1)/2*f;return new c.Vector2(A,m)},t.prototype.getRenderObjects=function(e){ci.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),li.setFromProjectionMatrix(ci),e||(e=this.scene);var r=[];return e.traverseVisible(function(i){(i instanceof c.Mesh||i instanceof c.Line||i instanceof c.Points)&&(i instanceof c.ImmediateRenderObject||!i.frustumCulled||li.intersectsObject(i))&&r.push(i)}),r},t.prototype.getCurrentState=function(){return F(F({},this.getPose()),{mode:this.currentMode,workCode:this.pano.workCode,panoIndex:this.pano.panoIndex})},t.prototype.setState=function(e,r,i){var a,o,s,l,u,d,f,A,m,h;r===void 0&&(r=!1),i===void 0&&(i=!0),e=Object.assign({},e),e.offset&&!(e instanceof c.Vector3)&&(e.offset=new c.Vector3(e.offset.x,e.offset.y,e.offset.z));var v;typeof e.panoIndex=="number"&&(e.workCode?v={workCode:e.workCode,panoIndex:e.panoIndex}:v={workCode:(o=(a=this.work)===null||a===void 0?void 0:a.workCode)!==null&&o!==void 0?o:"",panoIndex:e.panoIndex});var y=(s=e.mode)!==null&&s!==void 0?s:this.state.mode,p,g,x,b,w;if((e.mode===t.Mode.Floorplan||e.mode===t.Mode.Topview||e.mode===t.Mode.Mapview||e.mode===t.Mode.Model)&&!this.models.loaded){this.throwError(new Error("model is not ready."));return}if(this.controller&&this.controller.stopMomentumMovement(),this.state.mode!==y){if(y==="VRPanorama"){this.changeMode("VRPanorama",void 0,void 0,!0);return}var E={workCode:v==null?void 0:v.workCode,panoIndex:v==null?void 0:v.panoIndex};typeof e.longitude=="number"&&(E.longitude=e.longitude),typeof e.latitude=="number"&&(E.latitude=e.latitude),typeof e.fov=="number"&&(E.fov=e.fov),typeof e.distance=="number"&&(E.distance=e.distance),e.offset instanceof c.Vector3&&(E.offset=e.offset);var M=F(F({initial:{state:E,currentState:this.getCurrentState(),duration:this.modeChangeDuration,effect:"fly",userAction:!1}},this.commonParams()),this.controllerInits[y]),C=Pt[y].initAnimationEndState(M);p=C.longitude,g=C.latitude,x=C.fov,b=C.offset,w=C.distance}else p=(l=e.longitude)!==null&&l!==void 0?l:this.state.longitude,g=(u=e.latitude)!==null&&u!==void 0?u:this.state.latitude,x=(d=e.fov)!==null&&d!==void 0?d:this.state.fov,b=(f=e.offset)!==null&&f!==void 0?f:this.state.offset,w=(A=e.distance)!==null&&A!==void 0?A:this.state.distance;var P={workCode:(v!=null?v:this.pano).workCode,panoIndex:(v!=null?v:this.pano).panoIndex,mode:y,longitude:p,latitude:g,fov:x,offset:b,distance:w};this.emit("state.set",W("state.set",{userAction:i,state:P})),Dr(this.state,P)||(this.controller&&P.mode==="VRPanorama"&&P.mode!==this.state.mode?(ar(this.state,P),this.changeMode("VRPanorama")):this.controller&&P.mode==="XRPanorama"&&P.mode!==this.state.mode?(ar(this.state,P),this.changeMode("XRPanorama")):(ar(this.state,P),this.controller&&i&&(this.controller.userAction=!1),r&&this.state.mode===P.mode&&(this.syncingState=this.syncState(Me(),0,r),this.syncingState&&((m=this.controller)===null||m===void 0||m.updateTime(Me(),0),this.syncingState=!1)),this.emit("state.change",W("state.change",{userAction:i,state:this.state})),(h=this.analysis)===null||h===void 0||h.state(this.works,this.state)))},t.prototype.aroundScissor=function(e){if(this.renderer){if(this.state.mode==="XRPanorama"){e();return}var r=new c.Vector2,i=this.scissor.left!==0||this.scissor.bottom!==0||this.scissor.width!==1||this.scissor.height!==1;if(i){this.renderer.getSize(r);var a=Math.floor(r.x*this.scissor.left),o=Math.floor(r.y*this.scissor.bottom),s=Math.floor(r.x*this.scissor.width),l=Math.floor(r.y*this.scissor.height);this.renderer.setViewport(a,o,s,l),this.renderer.setScissor(a,o,s,l),this.renderer.setScissorTest(!0)}e(),i&&(this.renderer.setViewport(0,0,r.x,r.y),this.renderer.setScissor(0,0,r.x,r.y),this.renderer.setScissorTest(!1))}},t.prototype.syncState=function(e,r,i){i===void 0&&(i=!1);var a=this.stateSynced;if(this.stateSynced=!1,this.works.length===0||!this.controller)return!1;if(this.state.mode!==this.currentMode){var o={mode:this.state.mode,workCode:this.state.workCode,panoIndex:this.state.panoIndex,longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.changeMode(this.state.mode,o,this.modeChangeDuration,this.controller.userAction),!0}if(!this.controller.isReady())return!1;if(this.controller instanceof Pt.Model){if(za(this.camera.pose.offset,this.state.offset)){var s={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset};return this.controller.moveToPosition(this.state.offset,F(F({},s),{duration:i?0:void 0}),!1),!0}}else{var l={workCode:this.state.workCode,panoIndex:this.state.panoIndex};if(!_t(l,this.pano)&&"moveToPano"in this.controller&&typeof this.controller.moveToPano=="function"){var s={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.controller.moveToPano(l,s,!1),!0}}if(this.controller instanceof Pt.Floorplan||this.controller instanceof Pt.Topview||this.controller instanceof Pt.Mapview){var u=1,d=.2,f=.2,A=Math.PI/45,m=i?this.state.fov:la(this.camera.pose.fov,this.state.fov,u),h=Math.abs(this.camera.pose.distance-this.state.distance),v=h>f*15?h/15:d,y=i?this.state.distance:la(this.camera.pose.distance,this.state.distance,v),p=this.camera.pose.offset.distanceTo(this.state.offset),g=p>f*15?p/15:f,x=i?new c.Vector3().copy(this.state.offset):hh(this.camera.pose.offset,this.state.offset,g),b=i?{longitude:this.state.longitude,latitude:this.state.latitude}:Ss({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},A),w=b.longitude,E=b.latitude;if(Xt(m,this.camera.pose.fov)||za(x,this.camera.pose.offset)||Xt(y,this.camera.pose.distance)||Xt(w,this.camera.pose.longitude,Math.PI*2)||Xt(E,this.camera.pose.latitude)){var M={x:x.x,y:x.y,z:x.z},C={fov:m};return Object.assign(M,{distance:y}),Object.assign(C,{longitude:w,latitude:E}),this.controller.stopMomentumMovement(),this.controller.cameraMotion.set(C,0).catch(z),this.controller.locationMotion.set(M,0).catch(z),!0}}else{var P=1,S=Math.PI/45,m=i?this.state.fov:la(this.camera.pose.fov,this.state.fov,P),T=i?{longitude:this.state.longitude,latitude:this.state.latitude}:Ss({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},S),w=T.longitude,E=T.latitude;if(Xt(w,this.camera.pose.longitude,Math.PI*2)||Xt(E,this.camera.pose.latitude)||Xt(m,this.camera.pose.fov))return this.controller.stopMomentumMovement(),this.controller.cameraMotion.set({longitude:w,latitude:E,fov:m},0).catch(z),!0}if(this.stateSynced=!0,a===!1&&this.emit("state.synced",W("state.synced",{userAction:!1,state:this.state})),this.readyCallbacks.length&&this.stateSynced){var B=this.currentMode,L=B===t.Mode.Floorplan||B===t.Mode.Topview||B===t.Mode.Mapview||B===t.Mode.Model;if(!L||this.models.loaded){var k=this.readyCallbacks.slice();this.readyCallbacks.length=0;for(var O=0,D=k;O<D.length;O++){var N=D[O];this.controller instanceof Pt.Panorama&&N.tile===!0&&!this.controller.isTileReady()?this.readyCallbacks.push(N):N()}}}return!1},t.prototype.ready=function(e){var r=this;return e===void 0&&(e={}),new Promise(function(i){var a;r.readyCallbacks.push(Object.assign(i,{tile:(a=e.tile)!==null&&a!==void 0?a:!1}))})},t.prototype.requestFullscreen=function(){var e;if(Vn()){var r=(e=this.getElement())===null||e===void 0?void 0:e.parentNode;r&&"requestFullscreen"in r&&typeof document!="undefined"&&document.fullscreenElement===null&&r.requestFullscreen()}},t.prototype.exitFullscreen=function(){typeof document!="undefined"&&document.fullscreenElement&&"exitFullscreen"in document&&document.exitFullscreen()},t.prototype.throwError=function(e){this.hasListener("error")?this.emit("error",e):console.error(e)},t.prototype.loadModel=function(e,r){for(var i=this,a=[],o=function(y){var p=s.models.filter(function(x){var b;return((b=x.work)===null||b===void 0?void 0:b.workCode)===y.workCode})[0];if(p)p.work=y,a.push(p);else{var g=new Da({onError:function(x){i.emit("model.error",W("model.error",{work:y,model:g,error:x})),i.throwError(x)},onShownFloorChange:function(x){i.emit("model.changeShownFloor",W("model.changeShownFloor",{work:y,model:g,error:null}))},onLoad:function(){i.emit("model.load",W("model.load",{work:y,model:g,error:null}))}});a.push(g),s.emit("model.request",W("model.request",{work:y,model:g,error:null})),g.load(y,{textureOptions:s.textureOptions,"3d-tiles":r["3d-tiles"]})}},s=this,l=0,u=e;l<u.length;l++){var d=u[l];o(d)}if(this.models.length>0){for(var f=0,A=this.models;f<A.length;f++){var m=A[f];a.indexOf(m)===-1&&this.lastModels.push(m)}this.models.length=0}for(var h=0,v=a;h<v.length;h++){var m=v[h];this.models.push(m)}return this.renderer&&(this.models.loaded=!1),new Promise(function(y){i.on("models.load",function(){y()})})},t.prototype.commonParams=function(){return{ident:this.ident,scene:this.scene,xrCustomObjectsScene:this.xrCustomObjectsScene,helper:this.helperGroup,boundingMesh:this.boundingMesh,camera:this.camera,renderer:this.renderer,scissor:this.scissor,element:this.getElement(),models:this.models,works:this.works,imageOptions:this.imageOptions,enableWheel:this.enableWheel,enableIOSEDR:this._enableIOSEDR,enableEDL:this.enableEDL,enableHQ:this.enableHQ,extraElements:this.extraElements,videoTexture:this.videoTexture,modelScene:this.modelScene,modelRenderTarget:this.modelRenderTarget}},t.prototype.applyController=function(e,r){var i=this;if(!this.renderer)throw new Error("renderer is not initialized.");e!==t.Mode.Mapview&&(this.enableEDL=!1,this.enableHQ=!1);var a=Pt[e];this.currentMode=e;for(var o=new a(r),s=function(m){o.on(m,function(){for(var h=[],v=0;v<arguments.length;v++)h[v]=arguments[v];var y=i.emit.apply(i,bt([m],h,!1));if(y)return!1})},l=0,u=Ru;l<u.length;l++){var d=u[l];s(d)}{var f=Pt[e].initAnimationEndState(r),A=r.initial.userAction;Dr(this.state,f)||(ar(this.state,f),this.emit("state.change",W("state.change",{userAction:A,state:this.state}))),this.emit("currentState.change",W("currentState.change",{userAction:A,state:this.getCurrentState()}))}return o.on("camera.update",function(m){var h;if(i.controller){var v=i.controller.getTargetState();m.userAction&&i.syncingState===!1&&i.state.mode===v.mode&&!Dr(i.state,v)&&(ar(i.state,v),i.emit("state.change",W("state.change",{userAction:m.userAction,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}i.emit("currentState.change",W("currentState.change",{userAction:m.userAction,state:i.getCurrentState()}))}),o.on("initAnimation.start",function(m){var h,v=m.state,y=m.userAction;y&&i.state.mode===v.mode&&!Dr(i.state,v)&&(ar(i.state,v),i.emit("state.change",W("state.change",{userAction:y,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("initAnimation.end",function(m){var h,v=m.state,y=m.userAction;y&&i.state.mode===v.mode&&!Dr(i.state,v)&&(ar(i.state,v),i.emit("state.change",W("state.change",{userAction:y,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.moveTo",function(m){var h,v=m.state,y=m.userAction;i.pano={workCode:v.workCode,panoIndex:v.panoIndex},y&&i.state.mode===v.mode&&!Dr(i.state,v)&&(ar(i.state,v),i.emit("state.change",W("state.change",{userAction:y,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.arrived",function(m){var h,v=m.state,y=m.userAction;y&&i.state.mode===v.mode&&!Dr(i.state,v)&&(ar(i.state,v),i.emit("state.change",W("state.change",{userAction:y,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.cancel",function(m){var h,v=m.state,y=m.userAction;y&&i.state.mode===v.mode&&!Dr(i.state,v)&&(ar(i.state,v),i.emit("state.change",W("state.change",{userAction:y,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.moveTo",function(m){var h=m.userAction;i.emit("currentState.change",W("currentState.change",{userAction:h,state:i.getCurrentState()}))}),o.on("pano.request",function(m){i.emit("pano.request",m),m.defaultPrevented||i.moveToPano(m.state,m.options,m.userAction)}),o.on("vr.requestExit",function(){i.currentMode===t.Mode.VRPanorama&&(i.exitFullscreen(),i.changeMode(t.Mode.Panorama))}),o.on("error",function(m){return i.throwError(m)}),o},t.prototype.removeEventListeners=function(){},t.Mode={Panorama:"Panorama",Model:"Model",Floorplan:"Floorplan",Topview:"Topview",Mapview:"Mapview",VRPanorama:"VRPanorama",XRPanorama:"XRPanorama"},t.Line=null,t}(ki),Ha={instances:{},constructor:Lu};typeof window!="undefined"&&Object.assign(window,{__FIVE_DEBUG__:Ha});var vv=function(){function n(){}return n.createButton=function(t){var e=document.createElement("button");function r(){e.style.display="",e.style.cursor="pointer",e.style.left="calc(50% - 50px)",e.style.width="100px",e.textContent="ENTER VR",e.onmouseenter=function(){e.style.opacity="1.0"},e.onmouseleave=function(){e.style.opacity="0.5"},e.onclick=function(){t&&t()}}function i(){e.style.display="",e.style.cursor="auto",e.style.left="calc(50% - 75px)",e.style.width="150px",e.onmouseenter=null,e.onmouseleave=null,e.onclick=null}function a(){i(),e.textContent="VR NOT SUPPORTED"}function o(l){l.style.position="absolute",l.style.bottom="20px",l.style.padding="12px 6px",l.style.border="1px solid #fff",l.style.borderRadius="4px",l.style.background="rgba(0,0,0,0.1)",l.style.color="#fff",l.style.font="normal 13px sans-serif",l.style.textAlign="center",l.style.opacity="0.5",l.style.outline="none",l.style.zIndex="999"}if("xr"in navigator)return e.id="VRButton",e.style.display="none",o(e),navigator.xr.isSessionSupported("immersive-vr").then(function(l){l?r():a()}),e;var s=document.createElement("a");return window.isSecureContext===!1?(s.href=document.location.href.replace(/^http:/,"https:"),s.innerHTML="WEBXR NEEDS HTTPS"):(s.href="https://immersiveweb.dev/",s.innerHTML="WEBXR NOT AVAILABLE"),s.style.left="calc(50% - 90px)",s.style.width="180px",s.style.textDecoration="none",o(s),s},n}();exports.AnimationFrameLoop=vt;exports.Camera=Fi;exports.Fetcher=Za;exports.Five=Lu;exports.InternalWebGLRenderer=Yr;exports.IntersectMesh=Li;exports.Model=Da;exports.ModelViewLayer=vi;exports.NetworkSubscribe=s0;exports.PBMContainer=p0;exports.PBMGroup=yc;exports.PBMMesh=Vt;exports.PBMMeshMaterial=Tn;exports.PROXY_CONTROLLER_EVENT_NAMES=Ru;exports.PanoCircleMesh=du;exports.PanoCircleMeshCustom=ah;exports.PanoCircleMeshSolid=th;exports.Scene=y0;exports.Subscribe=ki;exports.TextureLoader=_n;exports.Tile=eo;exports.Tile3DModel=$r;exports.TileCache=M0;exports.TileCubeTextureTarget=De;exports.TileNode=V0;exports.TileRequestScheduler=C0;exports.Tileset=mn;exports.Work=oo;exports.XRButton=vv;exports.defaultImageURLTransform=jt;exports.defaultPbmParameters=Ee;exports.getViewportScale=ku;exports.imageSupport=c0;exports.isPanoId=f0;exports.loadAt3d=tu;exports.loadB3dm=q0;exports.loadDome=ru;exports.loadDomez=iu;exports.loadGlb=au;exports.loadPbm=Y0;exports.loadPnts=G0;exports.panoEqual=_t;exports.panoParse=pt;exports.panoStringify=Ue;exports.parseWork=Hn;
|
|
2071
|
+
`});m.depthTest=f.material.depthTest,m.side=f.material.side,s.meshReplaceMaterialMap.set(A,m),f.material=m}}});var l=this.renderer.getSize(new c.Vector2);this.camera.setViewOffset(l.width,l.height,e*a,r*a,1,1),this.renderer.setRenderTarget(this.gpuPickingRenderTarget),this.render();var u=new Uint8Array(4);this.renderer.readRenderTargetPixels(this.gpuPickingRenderTarget,0,0,1,1,u),this.renderer.setRenderTarget(null),this.camera.clearViewOffset(),this.scene.traverse(function(f){!(f instanceof c.Mesh)||f instanceof Vt||s.meshOriginMaterialMap.get(f.uuid)&&(f.material=s.meshOriginMaterialMap.get(f.uuid))}),this.models.setMaterial({constantColor:null});var d=Object.keys(i).filter(function(f){return i[f].equals(new c.Color().setRGB(u[0]/255,u[1]/255,u[2]/255))})[0];return d||!1},t.prototype.dispose=function(){var e,r;if(this.destroyed!==!0){delete Ga.instances[this.ident],this.emit("dispose"),this.destroyed=!0,this.pause(),this.stopAnimationLoop&&(this.stopAnimationLoop(),delete this.stopAnimationLoop),(e=this.renderer)===null||e===void 0||e.setAnimationLoop(null),this.off(),this.networkSubscribe.off(),this.controller&&(this.controller.destroy(),this.controller=void 0);var i=this.getElement();i&&i.parentNode&&i.parentNode.removeChild(i);var a=this.models.getMaterial();a&&(a.pano0&&a.pano0.map.dispose(),a.pano1&&a.pano1.map!==((r=a.pano0)===null||r===void 0?void 0:r.map)&&a.pano1.map.dispose());for(var o=0,s=this.models;o<s.length;o++){var l=s[o];l.dispose()}this.models.length=0,this.models.setMaterial({pano0:null,pano1:null}),this.meshReplaceMaterialMap.forEach(function(u){u.dispose()}),this.meshOriginMaterialMap.forEach(function(u){u.dispose()}),this.renderer instanceof Yr&&this.renderer.forceContextLoss&&this.renderer.forceContextLoss()}},t.prototype.setScissor=function(e){var r;if(Object.assign(this.scissor,e),this.controller&&this.controller.updateRenderSize){var i=new c.Vector2;(r=this.renderer)===null||r===void 0||r.getDrawingBufferSize(i),this.controller.updateRenderSize(i)}},Object.defineProperty(t.prototype,"helperVisible",{get:function(){return this.helperGroup.visible},set:function(e){this.helperGroup.visible!==e&&(this.helperGroup.visible=e,this.emit("helpers.visible",W("helpers.visible",{object:this.helperGroup})),this.needsRender=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableIOSEDR",{get:function(){return this._enableIOSEDR},set:function(e){this._enableIOSEDR!==e&&(this._enableIOSEDR=e,this.currentMode&&this.currentMode==="Panorama"&&this.changeMode(this.currentMode,this.getCurrentState(),0,!1,!0))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"postProcessingType",{get:function(){return this.currentMode==="Panorama"&&this.enableIOSEDR&&this.enablePostProcessing?"luminance":this.currentMode==="Mapview"&&this.enableEDL?"edl":this.currentMode==="Mapview"&&this.enableHQ?"hq":null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableEDL",{get:function(){return this._enableEDL},set:function(e){if(e===!0&&this.currentMode!==t.Mode.Mapview)throw new Error("只支持Mapview下开启EDL");this._enableEDL!==e&&(this._enableEDL=e,this.boundingMesh.visible=!e,this.needsRender=!0,this.modelSceneNeedsRender=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableHQ",{get:function(){return this._enableHQ},set:function(e){if(e===!0&&this.currentMode!==t.Mode.Mapview)throw new Error("只支持Mapview下开启HQ");this._enableHQ!==e&&(this._enableHQ=e,this.boundingMesh.visible=!e,this.needsRender=!0,this.modelSceneNeedsRender=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enablePostProcessing",{get:function(){return this._enablePostProcessing},set:function(e){this._enablePostProcessing!==e&&(this._enablePostProcessing=e),this.needsRender=!0,this.modelSceneNeedsRender=!0},enumerable:!1,configurable:!0}),t.prototype.updateConfiguration=function(e,r){r===void 0&&(r=!0);var i=!1;e.panorama&&(Object.assign(this.controllerInits.Panorama,e.panorama),this.currentMode==="Panorama"&&(i=!0)),e.model&&(Object.assign(this.controllerInits.Model,e.model),this.currentMode==="Model"&&(i=!0)),e.floorplan&&(Object.assign(this.controllerInits.Floorplan,e.floorplan),this.currentMode==="Floorplan"&&(i=!0)),e.topview&&(Object.assign(this.controllerInits.Topview,e.topview),this.currentMode==="Topview"&&(i=!0)),e.mapview&&(Object.assign(this.controllerInits.Mapview,e.mapview),this.currentMode==="Mapview"&&(i=!0)),e.vrPanorama&&(Object.assign(this.controllerInits.VRPanorama,e.vrPanorama),this.currentMode==="VRPanorama"&&(i=!0)),e.imageOptions&&(Object.assign(this.imageOptions,e.imageOptions),(this.currentMode==="Panorama"||this.currentMode==="VRPanorama")&&(i=!0)),e.textureOptions&&Object.assign(this.textureOptions,e.textureOptions),r&&i&&this.controller&&this.currentMode&&this.changeMode(this.currentMode,this.getCurrentState(),0,!1,!0)},t.prototype.appendTo=function(e,r){if(r===void 0&&(r={}),!!this.renderer){if(!(this.renderer instanceof Yr)){this.throwError(new Error("cannot call appendTo method when render a external renderer"));return}var i=this.getElement();if(i){e.appendChild(i),this.refresh(r);var a=window.getComputedStyle(e).position;a!=="relative"&&a!=="absolute"&&a!=="fixed"&&a!=="sticky"&&(e.style.position="relative")}}},t.prototype.refresh=function(e,r){if(e===void 0&&(e={}),!!this.renderer){var i=this.getElement();if(i){var a=i.parentNode;if(a&&a.nodeName){var o=e.width,s=o===void 0?a.offsetWidth:o,l=e.height,u=l===void 0?a.offsetHeight:l;this.renderer instanceof Yr&&(r&&this.renderer.setPixelRatio(r),this.renderer.setSize(s,u))}var d=new c.Vector2;this.renderer.getDrawingBufferSize(d),this.controller&&this.controller.updateRenderSize&&this.controller.updateRenderSize(d),this.modelRenderTarget.setSize(d.x,d.y),this.modelRenderTarget.depthTexture.dispose();var f=new c.DepthTexture(d.x,d.y);f.format=c.DepthStencilFormat,f.type=c.UnsignedInt248Type,this.modelRenderTarget.depthTexture=f,this.modelRenderTarget.depthTexture.needsUpdate=!0,this.needsRender=!0,this.modelSceneNeedsRender=!0,this.render(z,!0)}}},t.prototype.addExtraElement=function(e){var r=this;return this.extraElements.indexOf(e)===-1&&(this.extraElements.push(e),this.controller&&this.controller.bindExtraElement(e)),function(){return r.removeExtraElement(e)}},t.prototype.removeExtraElement=function(e){var r=this.extraElements.indexOf(e);r!==-1&&(this.extraElements.splice(r,1),this.controller&&this.controller.unbindExtraElement(e))},t.prototype.getPose=function(){var e=this.camera.copyPose(),r=e.longitude,i=e.latitude,a=e.fov,o=e.offset,s=e.distance;return{longitude:r,latitude:i,fov:a,offset:o.clone(),distance:s}},t.prototype.getSize=function(e){if(!this.renderer)throw new Error("renderer is not initialized");return this.renderer.getSize(e),e.x*=this.scissor.width,e.y*=this.scissor.height,e},t.prototype.getDrawingBufferSize=function(e){if(!this.renderer)throw new Error("renderer is not initialized");return this.renderer.getDrawingBufferSize(e),e.x*=this.scissor.width,e.y*=this.scissor.height,e},t.prototype.updateCamera=function(e,r,i){return i===void 0&&(i=!0),this.controller?this.controller.updateCamera(e,r,i):Promise.reject(new Error("controller is not initialized."))},t.prototype.updateCameraWithKeyframes=function(e,r,i){return i===void 0&&(i=!0),this.controller?this.controller.updateCameraWithKeyframes(e,r,i):Promise.reject(new Error("controller is not initialized."))},t.prototype.getLongitudeAndLatitude=function(){var e=this.getPose(),r=e.longitude,i=e.latitude;return{longitude:r,latitude:i}},t.prototype.getOffset=function(){return this.getPose().offset},t.prototype.getCameraLocal=function(){if(this.pano.workCode&&this.controller&&this.works){var e=this.works.getResolvedObserver(this.pano);if(e){var r=new c.Object3D;return r.position.copy(e.position),r.quaternion.copy(e.quaternion),r.scale.set(1,1,1),r.matrix.compose(r.position,r.quaternion,r.scale),r.matrixAutoUpdate=!1,hh(this.camera,r)}}return null},Object.defineProperty(t.prototype,"works",{get:function(){var e=ba.get(this);if(!e)return e0;for(var r=0,i=e;r<i.length;r++){var a=i[r];if(!oo.has(a))return e0}return e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"work",{get:function(){return this.works[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"model",{get:function(){return this.models[0]},enumerable:!1,configurable:!0}),t.prototype.load=function(e,r,i,a){var o=this;if(a===void 0&&(a=!0),!this.renderer)throw new Error("renderer is not initialized");var s=this.lastLoadWorkTask.then(function(){return vh(e)?e.then(function(l){return o.load_(l,r,i,a)}):o.load_(e,r,i,a)});return this.lastLoadWorkTask=s.catch(function(l){o.throwError(l)}),s},t.prototype.load_=function(e,r,i,a){var o=this,s,l,u,d,f,A,m,h;a===void 0&&(a=!0);var v={};typeof i=="number"?v.duration=i:typeof i=="object"&&Object.assign(v,i),this.controller||(v.duration=0,v.effect="instant");var y=[];if(Array.isArray(e))for(var p=0,g=e;p<g.length;p++){var x=g[p];typeof x!="string"&&"work"in x?y.push(Hn(x.work,x)):y.push(Hn(x))}else y.push(Hn(e));for(var b=Va(y),w=function(j){var Z=E,Y=new Ya({allowHosts:j.allowHosts,get requestProxy(){return Z.requestProxy},get networkSubscribe(){return Z.networkSubscribe}});Gf(j,Y)},E=this,M=0,C=b;M<C.length;M++){var P=C[M];w(P)}this.lastWorks=this.works,r===void 0&&(r="inherit"),r==="inherit"&&this.lastWorks.length===0&&(r="initial");var S=b.initial,T=S.work.observers[0],B=T?{workCode:T.work.workCode,panoIndex:T.panoIndex}:{workCode:S.work.workCode,panoIndex:0},L=(s=S.mode)!==null&&s!==void 0?s:T?"Panorama":"Mapview",k={};if(r==="inherit"){L=this.currentMode;var O=b.resolvedObservers[this.panoIndex];O?B={workCode:O.work.workCode,panoIndex:O.panoIndex}:typeof b.initial.panoIndex=="number"?B={workCode:b.initial.work.workCode,panoIndex:b.initial.panoIndex}:(L==="Panorama"||L==="VRPanorama"||L==="XRPanorama")&&(L="Mapview"),k={longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,distance:this.camera.pose.distance,offset:this.camera.pose.offset.clone()}}else if(r==="initial")typeof S.panoIndex=="number"&&(B={workCode:S.work.workCode,panoIndex:S.panoIndex}),S.mode&&(L=S.mode),k={longitude:S.longitude,latitude:S.latitude,fov:S.fov,distance:S.distance,offset:(l=S.offset)===null||l===void 0?void 0:l.clone()};else{if(L=(u=r.mode)!==null&&u!==void 0?u:this.currentMode,typeof r.panoIndex=="number"){var O=b.getResolvedObserver({workCode:(f=(d=r.workCode)!==null&&d!==void 0?d:S.work.workCode)!==null&&f!==void 0?f:"",panoIndex:r.panoIndex});O&&(B={workCode:O.work.workCode,panoIndex:O.panoIndex})}k={longitude:r.longitude,latitude:r.latitude,fov:r.fov,distance:r.distance,offset:r.offset}}var D=F(F(F({},B),{mode:L}),k);this.emit("works.request",W("works.request",{input:e,works:b,state:D,userAction:a}));var N=function(){var j,Z;o.pano=B;var Y=(j=v.duration)!==null&&j!==void 0?j:o.modeChangeDuration,pe=(Z=v.effect)!==null&&Z!==void 0?Z:"fade",ee=F(F({initial:{state:D,currentState:o.getCurrentState(),duration:Y,effect:pe,userAction:a}},o.commonParams()),o.controllerInits[L]);if(o.controller&&o.currentMode===L)o.controller.updateWork(b,D,{effect:pe,duration:Y},a)===!1&&(o.controller.destroy(),o.controller=o.applyController(L,ee));else{var oe=o.currentMode,ie=Pt[L].initAnimationEndState(ee);if(o.controller)o.controller.destroy();else{var ce=Pt[L].initAnimationEndState(ee);o.camera.setFromPose(ce),o.modelGroup.visible=!0,o.emit("camera.update",W("camera.update",{state:o.getCurrentState(),userAction:a}))}o.controller=o.applyController(L,ee);var ne=W("mode.change",{prevMode:oe,mode:L,state:ie,userAction:a});o.emit("mode.change",ne)}};if(ba.set(this,b),!this.controller){var X=F(F({initial:{state:D,currentState:this.getCurrentState(),duration:(A=v.duration)!==null&&A!==void 0?A:this.modeChangeDuration,effect:(m=v.effect)!==null&&m!==void 0?m:"fade",userAction:a}},this.commonParams()),this.controllerInits[L]),K=Pt[L].initAnimationEndState(X);this.camera.setFromPose(K),this.emit("camera.update",W("camera.update",{state:this.getCurrentState(),userAction:a}))}if(this.updateConfiguration(v,!1),L===t.Mode.Floorplan||L===t.Mode.Topview||L===t.Mode.Mapview||L===t.Mode.Model)this.loadModel(b,v).then(function(){o.needsRender=!0,o.modelSceneNeedsRender=!0,N(),o.emit("camera.update",W("camera.update",{state:o.getCurrentState(),userAction:a}))});else{if(!this.controller){var Q=new c.Vector3,G=b.getResolvedObserver(B);G&&Q.copy(G.position),this.camera.setFromPose({fov:k.fov,longitude:k.longitude,latitude:k.latitude,distance:k.distance,offset:(h=k.offset)!==null&&h!==void 0?h:Q}),this.needsRender=!0,this.modelSceneNeedsRender=!0}N();var J=!1,H=function(){var j;o.needsRender=!0,o.modelSceneNeedsRender=!0,o.emit("camera.update",W("camera.update",{state:o.getCurrentState(),userAction:a})),setTimeout(function(){o.works===b&&J===!1&&(o.loadModel(b,v),J=!0)},(j=v.duration)!==null&&j!==void 0?j:o.modeChangeDuration)};this.controller.once("pano.moveTo",H),this.controller.once("pano.cancel",H)}return this.emit("works.load",W("works.load",{input:e,state:this.getCurrentState(),userAction:a,works:b})),this.ready().then(function(){var j;o.emit("works.ready",W("works.ready",{input:e,state:o.getCurrentState(),userAction:a,works:b})),(j=o.analysis)===null||j===void 0||j.work(b)})},t.prototype.reset=function(){var e=this,r=this.lastLoadWorkTask.then(function(){return e.reset_()});return this.lastLoadWorkTask=r.catch(function(i){e.throwError(i)}),r},t.prototype.reset_=function(){var e=this;return new Promise(function(r){var i;e.controller&&(e.controller.destroy(),e.controller=void 0);var a=e.models.getMaterial();a&&(a.pano0&&a.pano0.map.dispose(),a.pano1&&a.pano1.map!==((i=a.pano0)===null||i===void 0?void 0:i.map)&&a.pano1.map.dispose()),e.models.setMaterial({pano0:null,pano1:null});for(var o=0,s=e.models;o<s.length;o++){var l=s[o];e.lastModels.push(l)}if(e.models.length=0,e.lastModels.length>0){for(var u=0,d=e.lastModels;u<d.length;u++){var l=d[u];e.modelGroup.remove(l),l.dispose(),e.needsRender=!0,e.modelSceneNeedsRender=!0}e.lastModels.length=0}e.lastWorks&&delete e.lastWorks,ba.delete(e),e.currentMode="Panorama",e.pano={workCode:"",panoIndex:0},e.camera.setFromPose({distance:0,fov:Ys,longitude:0,latitude:0,offset:new c.Vector3(0,0,0)}),e.state={mode:e.currentMode,workCode:e.pano.workCode,panoIndex:e.pano.panoIndex,longitude:e.camera.pose.longitude,latitude:e.camera.pose.latitude,fov:e.camera.pose.fov,offset:e.camera.pose.offset.clone(),distance:e.camera.pose.distance},e.models.needsRender=!1,e.camera.needsRender=!1,e.needsRender=!1,e.modelSceneNeedsRender=!1,r()})},t.prototype.changeMode=function(e,r,i,a,o){var s=this;return r===void 0&&(r={}),a===void 0&&(a=!0),o===void 0&&(o=!1),new Promise(function(l,u){var d,f,A,m;if(!s.renderer)throw new Error("renderer is not initialized.");r=F({},r);var h=0;s.controller&&(typeof i=="number"?h=i:h=(d=i==null?void 0:i.duration)!==null&&d!==void 0?d:s.modeChangeDuration);var v="fly";s.controller&&typeof i=="object"&&i.effect&&(v=i.effect);var y=typeof r.panoIndex=="number"?{workCode:(m=(f=r.workCode)!==null&&f!==void 0?f:(A=s.work)===null||A===void 0?void 0:A.workCode)!==null&&m!==void 0?m:"",panoIndex:r.panoIndex}:s.pano;if(!t.Mode.hasOwnProperty(e)){var p=new Error('mode "'.concat(e,'" is not existed'));s.throwError(p),u(p);return}if((e===t.Mode.Floorplan||e===t.Mode.Topview||e===t.Mode.Mapview||e===t.Mode.Model)&&!s.models.loaded){var p=new Error("model is not ready.");s.throwError(p),u(p);return}if((e===t.Mode.Panorama||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama)&&!s.works.getResolvedObserver(y)){var p=new Error("PanoId ".concat(Ue(y)," not existed."));s.throwError(p),u(p);return}var g=s.controller,x=s.currentMode,b=function(){if(s.controller&&s.controller.stopMomentumMovement(),s.controller&&o===!1&&x===e)e===t.Mode.Panorama||e===t.Mode.Model||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama?_t(s.pano,y)&&"moveToPano"in s.controller&&typeof s.controller.moveToPano=="function"?s.controller.moveToPano(y,F({duration:h},r),a):s.controller.updateCamera(r,h,a).catch(z):(_t(s.pano,y)||(s.pano=y),s.controller.updateCamera(r,h,a).catch(z));else{var E=F(F({},r),y),M=F(F({initial:{state:E,currentState:s.getCurrentState(),duration:h,effect:v,userAction:a}},s.commonParams()),s.controllerInits[e]),C=Pt[e].initAnimationEndState(M),P=W("mode.change.request",{prevMode:s.currentMode,mode:e,state:C,userAction:a});if(s.emit("mode.change.request",P),!P.defaultPrevented){g&&g.destroy(),s.controller=s.applyController(e,M);var S=W("mode.change",{prevMode:s.currentMode,mode:e,state:C,userAction:a});s.emit("mode.change",S)}}l()};if(e===t.Mode.VRPanorama)s.requestFullscreen(),Ah().then(function(){return b()}).catch(function(E){E instanceof Error&&(s.exitFullscreen(),s.throwError(E),u(E))});else if(e===t.Mode.XRPanorama){var w=vt.shared.getContext();w?w.end():mh().then(function(E){vt.shared.setContext(E),b()}).catch(function(E){E instanceof Error&&(s.throwError(E),u(E))})}else b()})},t.prototype.getPixels=function(e,r,i,a,o){if(o===void 0&&(o=1),!this.renderer)throw new Error("renderer is not initialized.");for(var s=0,l=this.scene.children;s<l.length;s++){var u=l[s];u instanceof c.Object3D&&u.traverseVisible(function(g){g.setResolution&&g.setResolution(i*o,a*o)})}var d=this.getPixelsRenderTarget,f=this.renderer.getSize(new c.Vector2);if(e=he(e,Math.floor(i/2),Math.floor(f.x-i)),r=he(r,Math.floor(a/2),Math.floor(f.y-a)),d.setSize(i*o,a*o),this.renderer.setRenderTarget(d),this.camera.setViewOffset(f.width,f.height,e,f.height-r-a,i,a),this.controller){this.controller.updateRenderSize(new c.Vector2(i*o,a*o)),this.controller.render(!0,this.postProcessingType);var A=this.getElement();if(!A)throw new Error("element is not initialized.");var m=A.parentNode;if(m&&m.nodeName){var h=m.offsetWidth,v=m.offsetHeight;this.renderer.setSize(h,v)}if(this.controller.updateRenderSize){var y=new c.Vector2;this.renderer.getDrawingBufferSize(y),this.controller.updateRenderSize(y)}}else this.renderer.render(this.scene,this.camera),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!1,this.renderer.render(this.modelScene,this.camera),this.renderer.autoClearDepth=!0,this.renderer.autoClearColor=!0;var p=new Uint8Array(i*o*a*o*4);return this.renderer.readRenderTargetPixels(d,0,0,i*o,a*o,p),this.renderer.setRenderTarget(null),this.camera.clearViewOffset(),p},t.prototype.getElement=function(){var e;return(e=this.renderer)===null||e===void 0?void 0:e.domElement},Object.defineProperty(t.prototype,"observers",{get:function(){return this.works.resolvedObservers},enumerable:!1,configurable:!0}),t.prototype.render=function(e,r){var i=this;if(r===void 0&&(r=!1),!this.renderer)return null;if(r){var a=this.renderer.getSize(vv);this.scene.traverseVisible(function(o){o.setResolution&&o.setResolution(a.x,a.y)})}return this.aroundScissor(function(){i.renderer&&(i.controller?(i.controller.render(i.onlyRenderIfNeeds?i.modelSceneNeedsRender:!0,i.postProcessingType),i.info={memory:F({},i.controller.renderer.info.memory),render:F({},i.controller.renderer.info.render)}):(i.renderer.render(i.scene,i.camera),i.info={memory:F({},i.renderer.info.memory),render:F({},i.renderer.info.render)}),i.poweredByRealsee&&i.currentMode!=="VRPanorama"&&i.currentMode!=="XRPanorama"&&i.renderer.getRenderTarget()!==i.getPixelsRenderTarget&&fv(i.renderer)),e&&vt.shared.add(e,!0)}),null},t.prototype.updateTime=function(e,r){for(var i,a=this,o,s,l=[],u=2;u<arguments.length;u++)l[u-2]=arguments[u];if(!this.destroyed){if(this.works.update(),this.syncingState=this.syncState(e,r),this.controller&&(i=this.controller).updateTime.apply(i,bt([e,r],l,!1)),this.renderer&&(this.camera.pixelRatio=this.renderer.getPixelRatio(),this.getSize(this.camera.resolution),this.camera.aspect=this.camera.resolution.width/this.camera.resolution.height),this.camera.updateTime(e,r),this.renderer){qn.detectSupport(this.renderer);var d=this.models.loaded,f=this.models.refined;if(this.models.update(this.renderer,this.camera,this.currentMode),d===!1&&this.models.loaded===!0&&this.emit("models.load",W("models.load",{models:this.models})),f===!1&&this.models.refined===!0&&this.emit("models.refined",W("models.refined",{models:this.models})),this.models.loaded){for(var A=0,m=this.models;A<m.length;A++){var h=m[A];h.parent!==this.modelGroup&&(this.modelGroup.add(h),this.needsRender=!0,this.modelSceneNeedsRender=!0)}if(this.lastModels.length>0){for(var v=0,y=this.lastModels;v<y.length;v++){var h=y[v];this.modelGroup.remove(h),h.dispose(),this.needsRender=!0,this.modelSceneNeedsRender=!0}this.lastModels.length=0}this.lastWorks&&delete this.lastWorks}this.lastModels.setMaterial(this.models.getMaterial()),this.lastModels.materialVersion=this.models.materialVersion,this.lastModels.update(this.renderer,this.camera,this.currentMode)}this.syncingState=!1;var p=new c.Vector2(512,512),g=new c.Vector2(512,512);this.renderer&&(this.renderer.getSize(p),p.x*=this.scissor.width,p.y*=this.scissor.height,this.renderer.getDrawingBufferSize(g),g.x*=this.scissor.width,g.y*=this.scissor.height);{for(var x=new c.Box3,b=new c.Box3,w=new c.Vector3(4,4,4),E=0,M=this.works.resolvedObservers;E<M.length;E++){var C=M[E];b.setFromCenterAndSize(C.position,w),x.union(b)}if(x.union(this.models.bounding),this.lastWorks)for(var P=0,S=this.lastWorks.resolvedObservers;P<S.length;P++){var C=S[P];b.setFromCenterAndSize(C.position,w),x.union(b)}x.union(this.lastModels.bounding),x.getCenter(this.boundingMesh.position),x.getSize(this.boundingMesh.scale),this.boundingMesh.boundingBox.copy(x);var T=(o=this.models.getMaterial())!==null&&o!==void 0?o:{},B=1-((s=T.modelAlpha)!==null&&s!==void 0?s:0);T.opacity=he(B*4-3,0,1),T.clippers=null,T.shownFloorIndex=-2,this.boundingMesh.setMaterial(T),this.boundingMesh.needsRender=!1}var L=W("render.prepare",{needsRender:!0,info:null});if(this.emit("render.prepare",L),!L.defaultPrevented){var k=[];ci.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),li.setFromProjectionMatrix(ci);for(var O=0,D=this.scene.children;O<D.length;O++){var N=D[O];N!==this.modelGroup&&N!==this.boundingMesh&&N instanceof c.Object3D&&N.traverseVisible(function(H){if(H.setResolution&&H.setResolution(p.x,p.y),H.setTime&&H.setTime(e),H.mixer instanceof c.AnimationMixer){var j=$s.get(H.mixer);j||(j=new c.Clock,$s.set(H.mixer,j)),H.mixer.update(j.getDelta())}(H instanceof c.Mesh||H instanceof c.Line||H instanceof c.Points)&&(H instanceof c.ImmediateRenderObject||!H.frustumCulled||li.intersectsObject(H))&&k.push(H)})}if(g.width*g.height>4096*2048?this.renderSwitch01=this.renderSwitch01^1:this.renderSwitch01=0,this.renderer&&this.paused===!1&&this.renderSwitch01===0){var X=void 0;if(this.onlyRenderIfNeeds!==!0)X=this.render();else{if(this.controller&&(this.controller.needsRender===!0&&(this.controller.needsRender=!1,this.needsRender=!0),this.controller.modelSceneNeedsRender===!0&&(this.controller.modelSceneNeedsRender=!1,this.modelSceneNeedsRender=!0)),this.camera.needsRender===!0&&(this.camera.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0),this.models.needsRender===!0&&(this.models.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0),this.needsRender!==!0)for(var K=0,Q=k;K<Q.length;K++){var G=Q[K],J=function(H){H.needsRender===!0?(H.needsRender=!1,a.needsRender=!0):H.mixer&&H.mixer.stats.actions.inUse>0&&(a.needsRender=!0)};J(G),G.traverseAncestors(J)}(this.needsRender!==!1||this.modelSceneNeedsRender!==!1)&&(X=this.render())}this.needsRender=!1,this.modelSceneNeedsRender=!1,this.hasListener("render")&&this.emit("render",W("render",{needsRender:X!==void 0,info:this.info}))}this.needsRender=!1,this.modelSceneNeedsRender=!1}this.fps.testTime&&e-this.fps.testTime<1e3?this.fps.testCount++:(this.emit("fps",this.fps.testCount),this.fps.testTime=e,this.fps.testCount=0)}},t.prototype.pause=function(){this.paused=!0,this.renderer&&this.renderer instanceof Yr&&this.renderer.clear(!0,!0,!0)},t.prototype.play=function(){this.needsRender=!0,this.modelSceneNeedsRender=!0,this.paused=!1},t.prototype.moveToPano=function(e,r,i){r===void 0&&(r={}),i===void 0&&(i=!0);var a=this,o=a.controller,s=a.renderer;if(!o)return this.throwError(new Error("controller is not initialized.")),Promise.resolve();if(!s)return this.throwError(new Error("renderer is not initialized.")),Promise.resolve();var l=this.works.getResolvedObserver(e);if(!l)return this.throwError(new Error("pano ".concat(JSON.stringify(e)," not existed."))),Promise.resolve();var u={workCode:l.work.workCode,panoIndex:l.panoIndex};return"moveToPano"in o&&typeof o.moveToPano=="function"?o.moveToPano(u,r,i):l&&(this.pano=u,this.once("initAnimation.start",function(d){r.moveStartCallback&&r.moveStartCallback(d.state)}),this.once("initAnimation.end",function(d){r.moveEndCallback&&r.moveEndCallback(d.state)}),this.changeMode(t.Mode.Panorama,r,{effect:r.effect},i)),this.ready()},t.prototype.preloadPano=function(e,r){var i=this;r===void 0&&(r=z);var a=this.works.getResolvedObserver(e);if(!a)return Promise.reject(new Error("Pano ".concat(JSON.stringify(e)," never found")));var o=["right","left","up","down","front","back"],s=Me();return Promise.all(o.map(function(l){var u=F({key:"pano.".concat(a.panoId,".").concat(l)},Cr(i.imageOptions,["size","format","quality","mappings"])),d=a.images[l],f=i.imageOptions.transform?i.imageOptions.transform(d,u):jt(d,u);return it(a.work).preload(f)})).then(function(){var l=Me()-s;return r(l),l})},t.prototype.project2d=function(e,r){if(r===void 0&&(r=!1),!this.renderer)return null;if(this.models.length>0&&r){var i=this.camera.position,a=e.clone().sub(i),o=new c.Raycaster(i,a.clone().normalize());o.params.Points={threshold:.1};var s=this.models.intersectRaycaster(o)[0];if(s&&s.distance+.01<a.length())return null}var l=e.clone().project(this.camera);if(Math.abs(l.z)>1)return null;var u=this.renderer.getSize(new c.Vector2),d=u.x*this.scissor.width,f=u.y*this.scissor.height,A=u.x*this.scissor.left+(l.x+1)/2*d,m=u.y*(1-this.scissor.bottom-this.scissor.height)+(-l.y+1)/2*f;return new c.Vector2(A,m)},t.prototype.getRenderObjects=function(e){ci.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),li.setFromProjectionMatrix(ci),e||(e=this.scene);var r=[];return e.traverseVisible(function(i){(i instanceof c.Mesh||i instanceof c.Line||i instanceof c.Points)&&(i instanceof c.ImmediateRenderObject||!i.frustumCulled||li.intersectsObject(i))&&r.push(i)}),r},t.prototype.getCurrentState=function(){return F(F({},this.getPose()),{mode:this.currentMode,workCode:this.pano.workCode,panoIndex:this.pano.panoIndex})},t.prototype.setState=function(e,r,i){var a,o,s,l,u,d,f,A,m,h;r===void 0&&(r=!1),i===void 0&&(i=!0),e=Object.assign({},e),e.offset&&!(e instanceof c.Vector3)&&(e.offset=new c.Vector3(e.offset.x,e.offset.y,e.offset.z));var v;typeof e.panoIndex=="number"&&(e.workCode?v={workCode:e.workCode,panoIndex:e.panoIndex}:v={workCode:(o=(a=this.work)===null||a===void 0?void 0:a.workCode)!==null&&o!==void 0?o:"",panoIndex:e.panoIndex});var y=(s=e.mode)!==null&&s!==void 0?s:this.state.mode,p,g,x,b,w;if((e.mode===t.Mode.Floorplan||e.mode===t.Mode.Topview||e.mode===t.Mode.Mapview||e.mode===t.Mode.Model)&&!this.models.loaded){this.throwError(new Error("model is not ready."));return}if(this.controller&&this.controller.stopMomentumMovement(),this.state.mode!==y){if(y==="VRPanorama"){this.changeMode("VRPanorama",void 0,void 0,!0);return}var E={workCode:v==null?void 0:v.workCode,panoIndex:v==null?void 0:v.panoIndex};typeof e.longitude=="number"&&(E.longitude=e.longitude),typeof e.latitude=="number"&&(E.latitude=e.latitude),typeof e.fov=="number"&&(E.fov=e.fov),typeof e.distance=="number"&&(E.distance=e.distance),e.offset instanceof c.Vector3&&(E.offset=e.offset);var M=F(F({initial:{state:E,currentState:this.getCurrentState(),duration:this.modeChangeDuration,effect:"fly",userAction:!1}},this.commonParams()),this.controllerInits[y]),C=Pt[y].initAnimationEndState(M);p=C.longitude,g=C.latitude,x=C.fov,b=C.offset,w=C.distance}else p=(l=e.longitude)!==null&&l!==void 0?l:this.state.longitude,g=(u=e.latitude)!==null&&u!==void 0?u:this.state.latitude,x=(d=e.fov)!==null&&d!==void 0?d:this.state.fov,b=(f=e.offset)!==null&&f!==void 0?f:this.state.offset,w=(A=e.distance)!==null&&A!==void 0?A:this.state.distance;var P={workCode:(v!=null?v:this.pano).workCode,panoIndex:(v!=null?v:this.pano).panoIndex,mode:y,longitude:p,latitude:g,fov:x,offset:b,distance:w};this.emit("state.set",W("state.set",{userAction:i,state:P})),Dr(this.state,P)||(this.controller&&P.mode==="VRPanorama"&&P.mode!==this.state.mode?(ar(this.state,P),this.changeMode("VRPanorama")):this.controller&&P.mode==="XRPanorama"&&P.mode!==this.state.mode?(ar(this.state,P),this.changeMode("XRPanorama")):(ar(this.state,P),this.controller&&i&&(this.controller.userAction=!1),r&&this.state.mode===P.mode&&(this.syncingState=this.syncState(Me(),0,r),this.syncingState&&((m=this.controller)===null||m===void 0||m.updateTime(Me(),0),this.syncingState=!1)),this.emit("state.change",W("state.change",{userAction:i,state:this.state})),(h=this.analysis)===null||h===void 0||h.state(this.works,this.state)))},t.prototype.aroundScissor=function(e){if(this.renderer){if(this.state.mode==="XRPanorama"){e();return}var r=new c.Vector2,i=this.scissor.left!==0||this.scissor.bottom!==0||this.scissor.width!==1||this.scissor.height!==1;if(i){this.renderer.getSize(r);var a=Math.floor(r.x*this.scissor.left),o=Math.floor(r.y*this.scissor.bottom),s=Math.floor(r.x*this.scissor.width),l=Math.floor(r.y*this.scissor.height);this.renderer.setViewport(a,o,s,l),this.renderer.setScissor(a,o,s,l),this.renderer.setScissorTest(!0)}e(),i&&(this.renderer.setViewport(0,0,r.x,r.y),this.renderer.setScissor(0,0,r.x,r.y),this.renderer.setScissorTest(!1))}},t.prototype.syncState=function(e,r,i){i===void 0&&(i=!1);var a=this.stateSynced;if(this.stateSynced=!1,this.works.length===0||!this.controller)return!1;if(this.state.mode!==this.currentMode){var o={mode:this.state.mode,workCode:this.state.workCode,panoIndex:this.state.panoIndex,longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.changeMode(this.state.mode,o,this.modeChangeDuration,this.controller.userAction),!0}if(!this.controller.isReady())return!1;if(this.controller instanceof Pt.Model){if(za(this.camera.pose.offset,this.state.offset)){var s={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset};return this.controller.moveToPosition(this.state.offset,F(F({},s),{duration:i?0:void 0}),!1),!0}}else{var l={workCode:this.state.workCode,panoIndex:this.state.panoIndex};if(!_t(l,this.pano)&&"moveToPano"in this.controller&&typeof this.controller.moveToPano=="function"){var s={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.controller.moveToPano(l,s,!1),!0}}if(this.controller instanceof Pt.Floorplan||this.controller instanceof Pt.Topview||this.controller instanceof Pt.Mapview){var u=1,d=.2,f=.2,A=Math.PI/45,m=i?this.state.fov:la(this.camera.pose.fov,this.state.fov,u),h=Math.abs(this.camera.pose.distance-this.state.distance),v=h>f*15?h/15:d,y=i?this.state.distance:la(this.camera.pose.distance,this.state.distance,v),p=this.camera.pose.offset.distanceTo(this.state.offset),g=p>f*15?p/15:f,x=i?new c.Vector3().copy(this.state.offset):ph(this.camera.pose.offset,this.state.offset,g),b=i?{longitude:this.state.longitude,latitude:this.state.latitude}:Is({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},A),w=b.longitude,E=b.latitude;if(Xt(m,this.camera.pose.fov)||za(x,this.camera.pose.offset)||Xt(y,this.camera.pose.distance)||Xt(w,this.camera.pose.longitude,Math.PI*2)||Xt(E,this.camera.pose.latitude)){var M={x:x.x,y:x.y,z:x.z},C={fov:m};return Object.assign(M,{distance:y}),Object.assign(C,{longitude:w,latitude:E}),this.controller.stopMomentumMovement(),this.controller.cameraMotion.set(C,0).catch(z),this.controller.locationMotion.set(M,0).catch(z),!0}}else{var P=1,S=Math.PI/45,m=i?this.state.fov:la(this.camera.pose.fov,this.state.fov,P),T=i?{longitude:this.state.longitude,latitude:this.state.latitude}:Is({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},S),w=T.longitude,E=T.latitude;if(Xt(w,this.camera.pose.longitude,Math.PI*2)||Xt(E,this.camera.pose.latitude)||Xt(m,this.camera.pose.fov))return this.controller.stopMomentumMovement(),this.controller.cameraMotion.set({longitude:w,latitude:E,fov:m},0).catch(z),!0}if(this.stateSynced=!0,a===!1&&this.emit("state.synced",W("state.synced",{userAction:!1,state:this.state})),this.readyCallbacks.length&&this.stateSynced){var B=this.currentMode,L=B===t.Mode.Floorplan||B===t.Mode.Topview||B===t.Mode.Mapview||B===t.Mode.Model;if(!L||this.models.loaded){var k=this.readyCallbacks.slice();this.readyCallbacks.length=0;for(var O=0,D=k;O<D.length;O++){var N=D[O];this.controller instanceof Pt.Panorama&&N.tile===!0&&!this.controller.isTileReady()?this.readyCallbacks.push(N):N()}}}return!1},t.prototype.ready=function(e){var r=this;return e===void 0&&(e={}),new Promise(function(i){var a;r.readyCallbacks.push(Object.assign(i,{tile:(a=e.tile)!==null&&a!==void 0?a:!1}))})},t.prototype.requestFullscreen=function(){var e;if(Vn()){var r=(e=this.getElement())===null||e===void 0?void 0:e.parentNode;r&&"requestFullscreen"in r&&typeof document!="undefined"&&document.fullscreenElement===null&&r.requestFullscreen()}},t.prototype.exitFullscreen=function(){typeof document!="undefined"&&document.fullscreenElement&&"exitFullscreen"in document&&document.exitFullscreen()},t.prototype.throwError=function(e){this.hasListener("error")?this.emit("error",e):console.error(e)},t.prototype.loadModel=function(e,r){for(var i=this,a=[],o=function(y){var p=s.models.filter(function(x){var b;return((b=x.work)===null||b===void 0?void 0:b.workCode)===y.workCode})[0];if(p)p.work=y,a.push(p);else{var g=new Da({onError:function(x){i.emit("model.error",W("model.error",{work:y,model:g,error:x})),i.throwError(x)},onShownFloorChange:function(x){i.emit("model.changeShownFloor",W("model.changeShownFloor",{work:y,model:g,error:null}))},onLoad:function(){i.emit("model.load",W("model.load",{work:y,model:g,error:null}))}});a.push(g),s.emit("model.request",W("model.request",{work:y,model:g,error:null})),g.load(y,{textureOptions:s.textureOptions,"3d-tiles":r["3d-tiles"]})}},s=this,l=0,u=e;l<u.length;l++){var d=u[l];o(d)}if(this.models.length>0){for(var f=0,A=this.models;f<A.length;f++){var m=A[f];a.indexOf(m)===-1&&this.lastModels.push(m)}this.models.length=0}for(var h=0,v=a;h<v.length;h++){var m=v[h];this.models.push(m)}return this.renderer&&(this.models.loaded=!1),new Promise(function(y){i.on("models.load",function(){y()})})},t.prototype.commonParams=function(){return{ident:this.ident,scene:this.scene,xrCustomObjectsScene:this.xrCustomObjectsScene,helper:this.helperGroup,boundingMesh:this.boundingMesh,camera:this.camera,renderer:this.renderer,scissor:this.scissor,element:this.getElement(),models:this.models,works:this.works,imageOptions:this.imageOptions,enableWheel:this.enableWheel,enableIOSEDR:this._enableIOSEDR,enableEDL:this.enableEDL,enableHQ:this.enableHQ,extraElements:this.extraElements,videoTexture:this.videoTexture,modelScene:this.modelScene,modelRenderTarget:this.modelRenderTarget}},t.prototype.applyController=function(e,r){var i=this;if(!this.renderer)throw new Error("renderer is not initialized.");e!==t.Mode.Mapview&&(this.enableEDL=!1,this.enableHQ=!1);var a=Pt[e];this.currentMode=e;for(var o=new a(r),s=function(m){o.on(m,function(){for(var h=[],v=0;v<arguments.length;v++)h[v]=arguments[v];var y=i.emit.apply(i,bt([m],h,!1));if(y)return!1})},l=0,u=ku;l<u.length;l++){var d=u[l];s(d)}{var f=Pt[e].initAnimationEndState(r),A=r.initial.userAction;Dr(this.state,f)||(ar(this.state,f),this.emit("state.change",W("state.change",{userAction:A,state:this.state}))),this.emit("currentState.change",W("currentState.change",{userAction:A,state:this.getCurrentState()}))}return o.on("camera.update",function(m){var h;if(i.controller){var v=i.controller.getTargetState();m.userAction&&i.syncingState===!1&&i.state.mode===v.mode&&!Dr(i.state,v)&&(ar(i.state,v),i.emit("state.change",W("state.change",{userAction:m.userAction,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}i.emit("currentState.change",W("currentState.change",{userAction:m.userAction,state:i.getCurrentState()}))}),o.on("initAnimation.start",function(m){var h,v=m.state,y=m.userAction;y&&i.state.mode===v.mode&&!Dr(i.state,v)&&(ar(i.state,v),i.emit("state.change",W("state.change",{userAction:y,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("initAnimation.end",function(m){var h,v=m.state,y=m.userAction;y&&i.state.mode===v.mode&&!Dr(i.state,v)&&(ar(i.state,v),i.emit("state.change",W("state.change",{userAction:y,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.moveTo",function(m){var h,v=m.state,y=m.userAction;i.pano={workCode:v.workCode,panoIndex:v.panoIndex},y&&i.state.mode===v.mode&&!Dr(i.state,v)&&(ar(i.state,v),i.emit("state.change",W("state.change",{userAction:y,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.arrived",function(m){var h,v=m.state,y=m.userAction;y&&i.state.mode===v.mode&&!Dr(i.state,v)&&(ar(i.state,v),i.emit("state.change",W("state.change",{userAction:y,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.cancel",function(m){var h,v=m.state,y=m.userAction;y&&i.state.mode===v.mode&&!Dr(i.state,v)&&(ar(i.state,v),i.emit("state.change",W("state.change",{userAction:y,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.moveTo",function(m){var h=m.userAction;i.emit("currentState.change",W("currentState.change",{userAction:h,state:i.getCurrentState()}))}),o.on("pano.request",function(m){i.emit("pano.request",m),m.defaultPrevented||i.moveToPano(m.state,m.options,m.userAction)}),o.on("vr.requestExit",function(){i.currentMode===t.Mode.VRPanorama&&(i.exitFullscreen(),i.changeMode(t.Mode.Panorama))}),o.on("error",function(m){return i.throwError(m)}),o},t.prototype.removeEventListeners=function(){},t.Mode={Panorama:"Panorama",Model:"Model",Floorplan:"Floorplan",Topview:"Topview",Mapview:"Mapview",VRPanorama:"VRPanorama",XRPanorama:"XRPanorama"},t.Line=null,t}(ki),Ga={instances:{},constructor:Ou};typeof window!="undefined"&&Object.assign(window,{__FIVE_DEBUG__:Ga});var Av=function(){function n(){}return n.createButton=function(t){var e=document.createElement("button");function r(){e.style.display="",e.style.cursor="pointer",e.style.left="calc(50% - 50px)",e.style.width="100px",e.textContent="ENTER VR",e.onmouseenter=function(){e.style.opacity="1.0"},e.onmouseleave=function(){e.style.opacity="0.5"},e.onclick=function(){t&&t()}}function i(){e.style.display="",e.style.cursor="auto",e.style.left="calc(50% - 75px)",e.style.width="150px",e.onmouseenter=null,e.onmouseleave=null,e.onclick=null}function a(){i(),e.textContent="VR NOT SUPPORTED"}function o(l){l.style.position="absolute",l.style.bottom="20px",l.style.padding="12px 6px",l.style.border="1px solid #fff",l.style.borderRadius="4px",l.style.background="rgba(0,0,0,0.1)",l.style.color="#fff",l.style.font="normal 13px sans-serif",l.style.textAlign="center",l.style.opacity="0.5",l.style.outline="none",l.style.zIndex="999"}if("xr"in navigator)return e.id="VRButton",e.style.display="none",o(e),navigator.xr.isSessionSupported("immersive-vr").then(function(l){l?r():a()}),e;var s=document.createElement("a");return window.isSecureContext===!1?(s.href=document.location.href.replace(/^http:/,"https:"),s.innerHTML="WEBXR NEEDS HTTPS"):(s.href="https://immersiveweb.dev/",s.innerHTML="WEBXR NOT AVAILABLE"),s.style.left="calc(50% - 90px)",s.style.width="180px",s.style.textDecoration="none",o(s),s},n}();exports.AnimationFrameLoop=vt;exports.Camera=Fi;exports.Fetcher=Ya;exports.Five=Ou;exports.InternalWebGLRenderer=Yr;exports.IntersectMesh=Li;exports.Model=Da;exports.ModelViewLayer=vi;exports.NetworkSubscribe=u0;exports.PBMContainer=v0;exports.PBMGroup=bc;exports.PBMMesh=Vt;exports.PBMMeshMaterial=Tn;exports.PROXY_CONTROLLER_EVENT_NAMES=ku;exports.PanoCircleMesh=fu;exports.PanoCircleMeshCustom=oh;exports.PanoCircleMeshSolid=rh;exports.Scene=b0;exports.Subscribe=ki;exports.TextureLoader=_n;exports.Tile=to;exports.Tile3DModel=$r;exports.TileCache=S0;exports.TileCubeTextureTarget=De;exports.TileNode=N0;exports.TileRequestScheduler=M0;exports.Tileset=mn;exports.Work=so;exports.XRButton=Av;exports.defaultImageURLTransform=jt;exports.defaultPbmParameters=Ee;exports.getViewportScale=Fu;exports.imageSupport=d0;exports.isPanoId=h0;exports.loadAt3d=ru;exports.loadB3dm=H0;exports.loadDome=nu;exports.loadDomez=au;exports.loadGlb=ou;exports.loadPbm=$0;exports.loadPnts=K0;exports.panoEqual=_t;exports.panoParse=pt;exports.panoStringify=Ue;exports.parseWork=Hn;
|