@realsee/five 6.2.0-alpha.8 → 6.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/docs/assets/navigation.js +1 -1
  2. package/docs/assets/search.js +1 -1
  3. package/docs/classes/five.Camera.html +6 -6
  4. package/docs/classes/five.Five.html +34 -34
  5. package/docs/classes/five.Model.html +1 -1
  6. package/docs/classes/five.PBMContainer.html +6 -6
  7. package/docs/classes/five.PBMGroup.html +4 -3
  8. package/docs/classes/five.PBMMeshMaterial.html +28 -28
  9. package/docs/classes/five.TextureLoader.html +2 -2
  10. package/docs/classes/five.Tile.html +1 -1
  11. package/docs/classes/five.Tile3DModel.html +2 -1
  12. package/docs/classes/five.TileCubeTextureTarget.html +2 -2
  13. package/docs/classes/five.TileNode.html +2 -2
  14. package/docs/interfaces/five.CameraPose.html +2 -2
  15. package/docs/interfaces/five.EventCallback.html +117 -104
  16. package/docs/interfaces/five.MapviewControllerCustomInitArgs.html +9 -9
  17. package/docs/interfaces/five.PBMParameters.html +2 -2
  18. package/docs/interfaces/five.TileCubeNode.html +3 -2
  19. package/docs/interfaces/react.FiveInjectionTypes.html +3 -3
  20. package/docs/modules/five.html +1 -1
  21. package/docs/types/five.ControllerEventTypes.html +31 -30
  22. package/docs/types/five.EventTypes.html +24 -24
  23. package/docs/types/five.GestureTypes.html +1 -1
  24. package/docs/types/five.LegacyEventType.html +63 -54
  25. package/docs/types/five.ParsedResultType.html +1 -1
  26. package/docs/types/five.TilesetFrameState.html +1 -1
  27. package/docs/variables/five.PROXY_CONTROLLER_EVENT_NAMES.html +1 -1
  28. package/five/index.d.ts +39 -11
  29. package/five/index.js +96 -96
  30. package/five/index.mjs +6733 -6541
  31. package/gltf-loader/index.js +3 -3
  32. package/gltf-loader/index.mjs +3 -3
  33. package/line/index.js +3 -3
  34. package/line/index.mjs +10 -10
  35. package/package.json +1 -1
  36. package/plugins/index.js +2 -2
  37. package/plugins/index.mjs +2 -2
  38. package/react/index.js +2 -2
  39. package/react/index.mjs +2 -2
  40. package/sticker/index.js +3 -3
  41. package/sticker/index.mjs +7 -7
  42. package/umd/five-gltf-loader.js +3 -3
  43. package/umd/five-line.js +3 -3
  44. package/umd/five-plugins.js +2 -2
  45. package/umd/five-react.js +2 -2
  46. package/umd/five-sticker.js +3 -3
  47. package/umd/five-vfx.js +2 -2
  48. package/umd/five-vue.js +2 -2
  49. package/umd/five.js +56 -56
  50. package/vfx/index.js +2 -2
  51. package/vfx/index.mjs +2 -2
  52. package/vue/index.js +2 -2
  53. package/vue/index.mjs +2 -2
package/umd/five.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 9/9/2024
5
- * Version: 6.2.0-alpha.8
4
+ * Generated: 10/30/2024
5
+ * Version: 6.2.0
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -339,12 +339,12 @@
339
339
  *
340
340
  * https://code.google.com/p/crypto-js/wiki/License
341
341
  * PART: ext/cryptojs
342
- */var KJUR={},CryptoJS=CryptoJS||function(n,t){var e={},r=e.lib={},i=r.Base=function(){function m(){}return{extend:function(A){m.prototype=this;var h=new m;return A&&h.mixIn(A),h.hasOwnProperty("init")||(h.init=function(){h.$super.init.apply(this,arguments)}),h.init.prototype=h,h.$super=this,h},create:function(){var A=this.extend();return A.init.apply(A,arguments),A},init:function(){},mixIn:function(A){for(var h in A)A.hasOwnProperty(h)&&(this[h]=A[h]);A.hasOwnProperty("toString")&&(this.toString=A.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),o=r.WordArray=i.extend({init:function(m,A){m=this.words=m||[],A!=t?this.sigBytes=A:this.sigBytes=m.length*4},toString:function(m){return(m||u).stringify(this)},concat:function(m){var A=this.words,h=m.words,p=this.sigBytes,y=m.sigBytes;if(this.clamp(),p%4)for(var v=0;v<y;v++){var g=h[v>>>2]>>>24-v%4*8&255;A[p+v>>>2]|=g<<24-(p+v)%4*8}else for(var v=0;v<y;v+=4)A[p+v>>>2]=h[v>>>2];return this.sigBytes+=y,this},clamp:function(){var m=this.words,A=this.sigBytes;m[A>>>2]&=4294967295<<32-A%4*8,m.length=n.ceil(A/4)},clone:function(){var m=i.clone.call(this);return m.words=this.words.slice(0),m},random:function(m){for(var A=[],h=0;h<m;h+=4)A.push(n.random()*4294967296|0);return new o.init(A,m)}}),s=e.enc={},u=s.Hex={stringify:function(m){for(var A=m.words,h=m.sigBytes,p=[],y=0;y<h;y++){var v=A[y>>>2]>>>24-y%4*8&255;p.push((v>>>4).toString(16)),p.push((v&15).toString(16))}return p.join("")},parse:function(m){for(var A=m.length,h=[],p=0;p<A;p+=2)h[p>>>3]|=parseInt(m.substr(p,2),16)<<24-p%8*4;return new o.init(h,A/2)}},l=s.Latin1={stringify:function(m){for(var A=m.words,h=m.sigBytes,p=[],y=0;y<h;y++){var v=A[y>>>2]>>>24-y%4*8&255;p.push(String.fromCharCode(v))}return p.join("")},parse:function(m){for(var A=m.length,h=[],p=0;p<A;p++)h[p>>>2]|=(m.charCodeAt(p)&255)<<24-p%4*8;return new o.init(h,A)}},c=s.Utf8={stringify:function(m){try{return decodeURIComponent(escape(l.stringify(m)))}catch(A){throw new Error("Malformed UTF-8 data")}},parse:function(m){return l.parse(unescape(encodeURIComponent(m)))}},d=r.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(m){typeof m=="string"&&(m=c.parse(m)),this._data.concat(m),this._nDataBytes+=m.sigBytes},_process:function(m){var A=this._data,h=A.words,p=A.sigBytes,y=this.blockSize,v=y*4,g=p/v;m?g=n.ceil(g):g=n.max((g|0)-this._minBufferSize,0);var E=g*y,b=n.min(E*4,p);if(E){for(var T=0;T<E;T+=y)this._doProcessBlock(h,T);var _=h.splice(0,E);A.sigBytes-=b}return new o.init(_,b)},clone:function(){var m=i.clone.call(this);return m._data=this._data.clone(),m},_minBufferSize:0});r.Hasher=d.extend({cfg:i.extend(),init:function(m){this.cfg=this.cfg.extend(m),this.reset()},reset:function(){d.reset.call(this),this._doReset()},update:function(m){return this._append(m),this._process(),this},finalize:function(m){m&&this._append(m);var A=this._doFinalize();return A},blockSize:512/32,_createHelper:function(m){return function(A,h){return new m.init(h).finalize(A)}},_createHmacHelper:function(m){return function(A,h){return new f.HMAC.init(m,h).finalize(A)}}});var f=e.algo={};return e}(Math);(function(n){for(var t=CryptoJS,A=t.lib,e=A.WordArray,r=A.Hasher,A=t.algo,i=[],o=[],s=function(p){return 4294967296*(p-(p|0))|0},u=2,l=0;64>l;){var c;e:{c=u;for(var d=n.sqrt(c),f=2;f<=d;f++)if(!(c%f)){c=!1;break e}c=!0}c&&(8>l&&(i[l]=s(n.pow(u,.5))),o[l]=s(n.pow(u,1/3)),l++),u++}var m=[],A=A.SHA256=r.extend({_doReset:function(){this._hash=new e.init(i.slice(0))},_doProcessBlock:function(h,p){for(var y=this._hash.words,v=y[0],g=y[1],E=y[2],b=y[3],T=y[4],_=y[5],x=y[6],R=y[7],w=0;64>w;w++){if(16>w)m[w]=h[p+w]|0;else{var S=m[w-15],C=m[w-2];m[w]=((S<<25|S>>>7)^(S<<14|S>>>18)^S>>>3)+m[w-7]+((C<<15|C>>>17)^(C<<13|C>>>19)^C>>>10)+m[w-16]}S=R+((T<<26|T>>>6)^(T<<21|T>>>11)^(T<<7|T>>>25))+(T&_^~T&x)+o[w]+m[w],C=((v<<30|v>>>2)^(v<<19|v>>>13)^(v<<10|v>>>22))+(v&g^v&E^g&E),R=x,x=_,_=T,T=b+S|0,b=E,E=g,g=v,v=S+C|0}y[0]=y[0]+v|0,y[1]=y[1]+g|0,y[2]=y[2]+E|0,y[3]=y[3]+b|0,y[4]=y[4]+T|0,y[5]=y[5]+_|0,y[6]=y[6]+x|0,y[7]=y[7]+R|0},_doFinalize:function(){var h=this._data,p=h.words,y=8*this._nDataBytes,v=8*h.sigBytes;return p[v>>>5]|=128<<24-v%32,p[(v+64>>>9<<4)+14]=n.floor(y/4294967296),p[(v+64>>>9<<4)+15]=y,h.sigBytes=4*p.length,this._process(),this._hash},clone:function(){var h=r.clone.call(this);return h._hash=this._hash.clone(),h}});t.SHA256=r._createHelper(A),t.HmacSHA256=r._createHmacHelper(A)})(Math),CryptoJS.lib.Cipher||function(n){var A=CryptoJS,t=A.lib,e=t.Base,r=t.WordArray,i=t.BufferedBlockAlgorithm,o=A.enc.Base64,s=A.algo.EvpKDF,u=t.Cipher=i.extend({cfg:e.extend(),createEncryptor:function(p,y){return this.create(this._ENC_XFORM_MODE,p,y)},createDecryptor:function(p,y){return this.create(this._DEC_XFORM_MODE,p,y)},init:function(p,y,v){this.cfg=this.cfg.extend(v),this._xformMode=p,this._key=y,this.reset()},reset:function(){i.reset.call(this),this._doReset()},process:function(p){return this._append(p),this._process()},finalize:function(p){return p&&this._append(p),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(p){return{encrypt:function(y,v,g){return(typeof v=="string"?h:m).encrypt(p,y,v,g)},decrypt:function(y,v,g){return(typeof v=="string"?h:m).decrypt(p,y,v,g)}}}});t.StreamCipher=u.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var f=A.mode={},l=function(p,y,v){var g=this._iv;g?this._iv=n:g=this._prevBlock;for(var E=0;E<v;E++)p[y+E]^=g[E]},c=(t.BlockCipherMode=e.extend({createEncryptor:function(p,y){return this.Encryptor.create(p,y)},createDecryptor:function(p,y){return this.Decryptor.create(p,y)},init:function(p,y){this._cipher=p,this._iv=y}})).extend();c.Encryptor=c.extend({processBlock:function(p,y){var v=this._cipher,g=v.blockSize;l.call(this,p,y,g),v.encryptBlock(p,y),this._prevBlock=p.slice(y,y+g)}}),c.Decryptor=c.extend({processBlock:function(p,y){var v=this._cipher,g=v.blockSize,E=p.slice(y,y+g);v.decryptBlock(p,y),l.call(this,p,y,g),this._prevBlock=E}}),f=f.CBC=c,c=(A.pad={}).Pkcs7={pad:function(p,y){for(var v=4*y,v=v-p.sigBytes%v,g=v<<24|v<<16|v<<8|v,E=[],b=0;b<v;b+=4)E.push(g);v=r.create(E,v),p.concat(v)},unpad:function(p){p.sigBytes-=p.words[p.sigBytes-1>>>2]&255}},t.BlockCipher=u.extend({cfg:u.cfg.extend({mode:f,padding:c}),reset:function(){u.reset.call(this);var y=this.cfg,p=y.iv,y=y.mode;if(this._xformMode==this._ENC_XFORM_MODE)var v=y.createEncryptor;else v=y.createDecryptor,this._minBufferSize=1;this._mode=v.call(y,this,p&&p.words)},_doProcessBlock:function(p,y){this._mode.processBlock(p,y)},_doFinalize:function(){var p=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){p.pad(this._data,this.blockSize);var y=this._process(!0)}else y=this._process(!0),p.unpad(y);return y},blockSize:4});var d=t.CipherParams=e.extend({init:function(p){this.mixIn(p)},toString:function(p){return(p||this.formatter).stringify(this)}}),f=(A.format={}).OpenSSL={stringify:function(p){var y=p.ciphertext;return p=p.salt,(p?r.create([1398893684,1701076831]).concat(p).concat(y):y).toString(o)},parse:function(p){p=o.parse(p);var y=p.words;if(y[0]==1398893684&&y[1]==1701076831){var v=r.create(y.slice(2,4));y.splice(0,4),p.sigBytes-=16}return d.create({ciphertext:p,salt:v})}},m=t.SerializableCipher=e.extend({cfg:e.extend({format:f}),encrypt:function(p,y,v,g){g=this.cfg.extend(g);var E=p.createEncryptor(v,g);return y=E.finalize(y),E=E.cfg,d.create({ciphertext:y,key:v,iv:E.iv,algorithm:p,mode:E.mode,padding:E.padding,blockSize:p.blockSize,formatter:g.format})},decrypt:function(p,y,v,g){return g=this.cfg.extend(g),y=this._parse(y,g.format),p.createDecryptor(v,g).finalize(y.ciphertext)},_parse:function(p,y){return typeof p=="string"?y.parse(p,this):p}}),A=(A.kdf={}).OpenSSL={execute:function(p,y,v,g){return g||(g=r.random(8)),p=s.create({keySize:y+v}).compute(p,g),v=r.create(p.words.slice(y),4*v),p.sigBytes=4*y,d.create({key:p,iv:v,salt:g})}},h=t.PasswordBasedCipher=m.extend({cfg:m.cfg.extend({kdf:A}),encrypt:function(p,y,v,g){return g=this.cfg.extend(g),v=g.kdf.execute(v,p.keySize,p.ivSize),g.iv=v.iv,p=m.encrypt.call(this,p,y,v.key,g),p.mixIn(v),p},decrypt:function(p,y,v,g){return g=this.cfg.extend(g),y=this._parse(y,g.format),v=g.kdf.execute(v,p.keySize,p.ivSize,y.salt),g.iv=v.iv,m.decrypt.call(this,p,y,v.key,g)}})}(),function(){for(var n=CryptoJS,t=n.lib.BlockCipher,_=n.algo,e=[],r=[],i=[],o=[],s=[],u=[],l=[],c=[],d=[],f=[],m=[],A=0;256>A;A++)m[A]=128>A?A<<1:A<<1^283;for(var h=0,p=0,A=0;256>A;A++){var y=p^p<<1^p<<2^p<<3^p<<4,y=y>>>8^y&255^99;e[h]=y,r[y]=h;var v=m[h],g=m[v],E=m[g],b=257*m[y]^16843008*y;i[h]=b<<24|b>>>8,o[h]=b<<16|b>>>16,s[h]=b<<8|b>>>24,u[h]=b,b=16843009*E^65537*g^257*v^16843008*h,l[y]=b<<24|b>>>8,c[y]=b<<16|b>>>16,d[y]=b<<8|b>>>24,f[y]=b,h?(h=v^m[m[m[E^v]]],p^=m[m[p]]):h=p=1}var T=[0,1,2,4,8,16,32,64,128,27,54],_=_.AES=t.extend({_doReset:function(){for(var w=this._key,x=w.words,R=w.sigBytes/4,w=4*((this._nRounds=R+6)+1),S=this._keySchedule=[],C=0;C<w;C++)if(C<R)S[C]=x[C];else{var I=S[C-1];C%R?6<R&&C%R==4&&(I=e[I>>>24]<<24|e[I>>>16&255]<<16|e[I>>>8&255]<<8|e[I&255]):(I=I<<8|I>>>24,I=e[I>>>24]<<24|e[I>>>16&255]<<16|e[I>>>8&255]<<8|e[I&255],I^=T[C/R|0]<<24),S[C]=S[C-R]^I}for(x=this._invKeySchedule=[],R=0;R<w;R++)C=w-R,I=R%4?S[C]:S[C-4],x[R]=4>R||4>=C?I:l[e[I>>>24]]^c[e[I>>>16&255]]^d[e[I>>>8&255]]^f[e[I&255]]},encryptBlock:function(x,R){this._doCryptBlock(x,R,this._keySchedule,i,o,s,u,e)},decryptBlock:function(x,R){var w=x[R+1];x[R+1]=x[R+3],x[R+3]=w,this._doCryptBlock(x,R,this._invKeySchedule,l,c,d,f,r),w=x[R+1],x[R+1]=x[R+3],x[R+3]=w},_doCryptBlock:function(x,R,w,S,C,I,H,B){for(var L=this._nRounds,Q=x[R]^w[0],G=x[R+1]^w[1],q=x[R+2]^w[2],U=x[R+3]^w[3],O=4,k=1;k<L;k++)var K=S[Q>>>24]^C[G>>>16&255]^I[q>>>8&255]^H[U&255]^w[O++],z=S[G>>>24]^C[q>>>16&255]^I[U>>>8&255]^H[Q&255]^w[O++],N=S[q>>>24]^C[U>>>16&255]^I[Q>>>8&255]^H[G&255]^w[O++],U=S[U>>>24]^C[Q>>>16&255]^I[G>>>8&255]^H[q&255]^w[O++],Q=K,G=z,q=N;K=(B[Q>>>24]<<24|B[G>>>16&255]<<16|B[q>>>8&255]<<8|B[U&255])^w[O++],z=(B[G>>>24]<<24|B[q>>>16&255]<<16|B[U>>>8&255]<<8|B[Q&255])^w[O++],N=(B[q>>>24]<<24|B[U>>>16&255]<<16|B[Q>>>8&255]<<8|B[G&255])^w[O++],U=(B[U>>>24]<<24|B[Q>>>16&255]<<16|B[G>>>8&255]<<8|B[q&255])^w[O++],x[R]=K,x[R+1]=z,x[R+2]=N,x[R+3]=U},keySize:8});n.AES=t._createHelper(_)}();/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
343
- */var dbits;function BigInteger(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 nbi(){return new BigInteger(null)}function am1(n,t,e,r,i,o){for(;--o>=0;){var s=t*this[n++]+e[r]+i;i=Math.floor(s/67108864),e[r++]=s&67108863}return i}function am2(n,t,e,r,i,o){for(var s=t&32767,u=t>>15;--o>=0;){var l=this[n]&32767,c=this[n++]>>15,d=u*l+c*s;l=s*l+((d&32767)<<15)+e[r]+(i&1073741823),i=(l>>>30)+(d>>>15)+u*c+(i>>>30),e[r++]=l&1073741823}return i}function am3(n,t,e,r,i,o){for(var s=t&16383,u=t>>14;--o>=0;){var l=this[n]&16383,c=this[n++]>>14,d=u*l+c*s;l=s*l+((d&16383)<<14)+e[r]+i,i=(l>>28)+(d>>14)+u*c,e[r++]=l&268435455}return i}typeof navigator!="undefined"&&navigator.appName=="Microsoft Internet Explorer"?(BigInteger.prototype.am=am2,dbits=30):typeof navigator!="undefined"&&navigator.appName!="Netscape"?(BigInteger.prototype.am=am1,dbits=26):(BigInteger.prototype.am=am3,dbits=28),BigInteger.prototype.DB=dbits,BigInteger.prototype.DM=(1<<dbits)-1,BigInteger.prototype.DV=1<<dbits;var BI_FP=52;BigInteger.prototype.FV=Math.pow(2,BI_FP),BigInteger.prototype.F1=BI_FP-dbits,BigInteger.prototype.F2=2*dbits-BI_FP;var BI_RM="0123456789abcdefghijklmnopqrstuvwxyz",BI_RC=new Array,rr,vv;for(rr=48,vv=0;vv<=9;++vv)BI_RC[rr++]=vv;for(rr=97,vv=10;vv<36;++vv)BI_RC[rr++]=vv;for(rr=65,vv=10;vv<36;++vv)BI_RC[rr++]=vv;function int2char(n){return BI_RM.charAt(n)}function intAt(n,t){var e=BI_RC[n.charCodeAt(t)];return e==null?-1:e}function bnpCopyTo(n){for(var t=this.t-1;t>=0;--t)n[t]=this[t];n.t=this.t,n.s=this.s}function bnpFromInt(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 nbv(n){var t=nbi();return t.fromInt(n),t}function bnpFromString(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,o=0;--r>=0;){var s=e==8?n[r]&255:intAt(n,r);if(s<0){n.charAt(r)=="-"&&(i=!0);continue}i=!1,o==0?this[this.t++]=s:o+e>this.DB?(this[this.t-1]|=(s&(1<<this.DB-o)-1)<<o,this[this.t++]=s>>this.DB-o):this[this.t-1]|=s<<o,o+=e,o>=this.DB&&(o-=this.DB)}e==8&&n[0]&128&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),i&&BigInteger.ZERO.subTo(this,this)}function bnpClamp(){for(var n=this.s&this.DM;this.t>0&&this[this.t-1]==n;)--this.t}function bnToString(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,o="",s=this.t,u=this.DB-s*this.DB%t;if(s-- >0)for(u<this.DB&&(r=this[s]>>u)>0&&(i=!0,o=int2char(r));s>=0;)u<t?(r=(this[s]&(1<<u)-1)<<t-u,r|=this[--s]>>(u+=this.DB-t)):(r=this[s]>>(u-=t)&e,u<=0&&(u+=this.DB,--s)),r>0&&(i=!0),i&&(o+=int2char(r));return i?o:"0"}function bnNegate(){var n=nbi();return BigInteger.ZERO.subTo(this,n),n}function bnAbs(){return this.s<0?this.negate():this}function bnCompareTo(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 nbits(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 bnBitLength(){return this.t<=0?0:this.DB*(this.t-1)+nbits(this[this.t-1]^this.s&this.DM)}function bnpDLShiftTo(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 bnpDRShiftTo(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 bnpLShiftTo(n,t){var e=n%this.DB,r=this.DB-e,i=(1<<r)-1,o=Math.floor(n/this.DB),s=this.s<<e&this.DM,u;for(u=this.t-1;u>=0;--u)t[u+o+1]=this[u]>>r|s,s=(this[u]&i)<<e;for(u=o-1;u>=0;--u)t[u]=0;t[o]=s,t.t=this.t+o+1,t.s=this.s,t.clamp()}function bnpRShiftTo(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,o=(1<<r)-1;t[0]=this[e]>>r;for(var s=e+1;s<this.t;++s)t[s-e-1]|=(this[s]&o)<<i,t[s-e]=this[s]>>r;r>0&&(t[this.t-e-1]|=(this.s&o)<<i),t.t=this.t-e,t.clamp()}function bnpSubTo(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 bnpMultiplyTo(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&&BigInteger.ZERO.subTo(t,t)}function bnpSquareTo(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 bnpDivRemTo(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=nbi());var o=nbi(),s=this.s,u=n.s,l=this.DB-nbits(r[r.t-1]);l>0?(r.lShiftTo(l,o),i.lShiftTo(l,e)):(r.copyTo(o),i.copyTo(e));var c=o.t,d=o[c-1];if(d!=0){var f=d*(1<<this.F1)+(c>1?o[c-2]>>this.F2:0),m=this.FV/f,A=(1<<this.F1)/f,h=1<<this.F2,p=e.t,y=p-c,v=t==null?nbi():t;for(o.dlShiftTo(y,v),e.compareTo(v)>=0&&(e[e.t++]=1,e.subTo(v,e)),BigInteger.ONE.dlShiftTo(c,v),v.subTo(o,o);o.t<c;)o[o.t++]=0;for(;--y>=0;){var g=e[--p]==d?this.DM:Math.floor(e[p]*m+(e[p-1]+h)*A);if((e[p]+=o.am(0,g,e,y,0,c))<g)for(o.dlShiftTo(y,v),e.subTo(v,e);e[p]<--g;)e.subTo(v,e)}t!=null&&(e.drShiftTo(c,t),s!=u&&BigInteger.ZERO.subTo(t,t)),e.t=c,e.clamp(),l>0&&e.rShiftTo(l,e),s<0&&BigInteger.ZERO.subTo(e,e)}}}function bnMod(n){var t=nbi();return this.abs().divRemTo(n,null,t),this.s<0&&t.compareTo(BigInteger.ZERO)>0&&n.subTo(t,t),t}function Classic(n){this.m=n}function cConvert(n){return n.s<0||n.compareTo(this.m)>=0?n.mod(this.m):n}function cRevert(n){return n}function cReduce(n){n.divRemTo(this.m,null,n)}function cMulTo(n,t,e){n.multiplyTo(t,e),this.reduce(e)}function cSqrTo(n,t){n.squareTo(t),this.reduce(t)}Classic.prototype.convert=cConvert,Classic.prototype.revert=cRevert,Classic.prototype.reduce=cReduce,Classic.prototype.mulTo=cMulTo,Classic.prototype.sqrTo=cSqrTo;function bnpInvDigit(){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 Montgomery(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 montConvert(n){var t=nbi();return n.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),n.s<0&&t.compareTo(BigInteger.ZERO)>0&&this.m.subTo(t,t),t}function montRevert(n){var t=nbi();return n.copyTo(t),this.reduce(t),t}function montReduce(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 montSqrTo(n,t){n.squareTo(t),this.reduce(t)}function montMulTo(n,t,e){n.multiplyTo(t,e),this.reduce(e)}Montgomery.prototype.convert=montConvert,Montgomery.prototype.revert=montRevert,Montgomery.prototype.reduce=montReduce,Montgomery.prototype.mulTo=montMulTo,Montgomery.prototype.sqrTo=montSqrTo;function bnpIsEven(){return(this.t>0?this[0]&1:this.s)==0}function bnpExp(n,t){if(n>4294967295||n<1)return BigInteger.ONE;var e=nbi(),r=nbi(),i=t.convert(this),o=nbits(n)-1;for(i.copyTo(e);--o>=0;)if(t.sqrTo(e,r),(n&1<<o)>0)t.mulTo(r,i,e);else{var s=e;e=r,r=s}return t.revert(e)}function bnModPowInt(n,t){var e;return n<256||t.isEven()?e=new Classic(t):e=new Montgomery(t),this.exp(n,e)}BigInteger.prototype.copyTo=bnpCopyTo,BigInteger.prototype.fromInt=bnpFromInt,BigInteger.prototype.fromString=bnpFromString,BigInteger.prototype.clamp=bnpClamp,BigInteger.prototype.dlShiftTo=bnpDLShiftTo,BigInteger.prototype.drShiftTo=bnpDRShiftTo,BigInteger.prototype.lShiftTo=bnpLShiftTo,BigInteger.prototype.rShiftTo=bnpRShiftTo,BigInteger.prototype.subTo=bnpSubTo,BigInteger.prototype.multiplyTo=bnpMultiplyTo,BigInteger.prototype.squareTo=bnpSquareTo,BigInteger.prototype.divRemTo=bnpDivRemTo,BigInteger.prototype.invDigit=bnpInvDigit,BigInteger.prototype.isEven=bnpIsEven,BigInteger.prototype.exp=bnpExp,BigInteger.prototype.toString=bnToString,BigInteger.prototype.negate=bnNegate,BigInteger.prototype.abs=bnAbs,BigInteger.prototype.compareTo=bnCompareTo,BigInteger.prototype.bitLength=bnBitLength,BigInteger.prototype.mod=bnMod,BigInteger.prototype.modPowInt=bnModPowInt,BigInteger.ZERO=nbv(0),BigInteger.ONE=nbv(1);/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function bnIntValue(){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 bnpChunkSize(n){return Math.floor(Math.LN2*this.DB/Math.log(n))}function bnSigNum(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function bnpToRadix(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=nbv(e),i=nbi(),o=nbi(),s="";for(this.divRemTo(r,i,o);i.signum()>0;)s=(e+o.intValue()).toString(n).substr(1)+s,i.divRemTo(r,i,o);return o.intValue().toString(n)+s}BigInteger.prototype.chunkSize=bnpChunkSize,BigInteger.prototype.toRadix=bnpToRadix,BigInteger.prototype.intValue=bnIntValue,BigInteger.prototype.signum=bnSigNum;/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */var b64map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",b64pad="=";function hex2b64(n){var t,e,r="";for(t=0;t+3<=n.length;t+=3)e=parseInt(n.substring(t,t+3),16),r+=b64map.charAt(e>>6)+b64map.charAt(e&63);for(t+1==n.length?(e=parseInt(n.substring(t,t+1),16),r+=b64map.charAt(e<<2)):t+2==n.length&&(e=parseInt(n.substring(t,t+2),16),r+=b64map.charAt(e>>2)+b64map.charAt((e&3)<<4));(r.length&3)>0;)r+=b64pad;return r}function b64tohex(n){var t="",e,r=0,i,o;for(e=0;e<n.length&&n.charAt(e)!=b64pad;++e)o=b64map.indexOf(n.charAt(e)),!(o<0)&&(r==0?(t+=int2char(o>>2),i=o&3,r=1):r==1?(t+=int2char(i<<2|o>>4),i=o&15,r=2):r==2?(t+=int2char(i),t+=int2char(o>>2),i=o&3,r=3):(t+=int2char(i<<2|o>>4),t+=int2char(o&15),r=0));return r==1&&(t+=int2char(i<<2)),t}/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function parseBigInt(n,t){return new BigInteger(n,t)}function pkcs1pad2(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 o=new SecureRandom,s=new Array;t>2;){for(s[0]=0;s[0]==0;)o.nextBytes(s);e[--t]=s[0]}return e[--t]=2,e[--t]=0,new BigInteger(e)}function oaep_mgf1_arr(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 oaep_pad(n,t,e,r){var i=KJUR.crypto.MessageDigest,o=KJUR.crypto.Util,s=null;if(e||(e="sha1"),typeof e=="string"&&(s=i.getCanonicalAlgName(e),r=i.getHashLength(s),e=function(p){return hextorstr(o.hashHex(rstrtohex(p),s))}),n.length+2*r+2>t)throw"Message too long for RSA";var u="",l;for(l=0;l<t-n.length-2*r-2;l+=1)u+="\0";var c=e("")+u+""+n,d=new Array(r);new SecureRandom().nextBytes(d);var f=oaep_mgf1_arr(d,c.length,e),m=[];for(l=0;l<c.length;l+=1)m[l]=c.charCodeAt(l)^f.charCodeAt(l);var A=oaep_mgf1_arr(m,d.length,e),h=[0];for(l=0;l<d.length;l+=1)h[l+1]=d[l]^A.charCodeAt(l);return new BigInteger(h.concat(m))}function RSAKey(){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 RSASetPublic(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=parseBigInt(n,16),this.e=parseInt(t,16);else throw"Invalid RSA public key"}function RSADoPublic(n){return n.modPowInt(this.e,this.n)}function RSAEncrypt(n){var t=pkcs1pad2(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 RSAEncryptOAEP(n,t,e){var r=oaep_pad(n,this.n.bitLength()+7>>3,t,e);if(r==null)return null;var i=this.doPublic(r);if(i==null)return null;var o=i.toString(16);return o.length&1?"0"+o:o}RSAKey.prototype.doPublic=RSADoPublic,RSAKey.prototype.setPublic=RSASetPublic,RSAKey.prototype.encrypt=RSAEncrypt,RSAKey.prototype.encryptOAEP=RSAEncryptOAEP,RSAKey.prototype.type="RSA";/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function pkcs1unpad2(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 o=e[r]&255;o<128?i+=String.fromCharCode(o):o>191&&o<224?(i+=String.fromCharCode((o&31)<<6|e[r+1]&63),++r):(i+=String.fromCharCode((o&15)<<12|(e[r+1]&63)<<6|e[r+2]&63),r+=2)}return i}function oaep_mgf1_str(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 oaep_unpad(n,t,e,r){var i=KJUR.crypto.MessageDigest,o=KJUR.crypto.Util,s=null;e||(e="sha1"),typeof e=="string"&&(s=i.getCanonicalAlgName(e),r=i.getHashLength(s),e=function(y){return hextorstr(o.hashHex(rstrtohex(y),s))}),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 u=n.substr(1,r),l=n.substr(r+1),c=oaep_mgf1_str(l,r,e),d=[],f;for(f=0;f<u.length;f+=1)d[f]=u.charCodeAt(f)^c.charCodeAt(f);var m=oaep_mgf1_str(String.fromCharCode.apply(String,d),n.length-r,e),A=[];for(f=0;f<l.length;f+=1)A[f]=l.charCodeAt(f)^m.charCodeAt(f);if(A=String.fromCharCode.apply(String,A),A.substr(0,r)!==e(""))throw"Hash mismatch";A=A.substr(r);var h=A.indexOf(""),p=h!=-1?A.substr(0,h).lastIndexOf("\0"):-1;if(p+1!=h)throw"Malformed data";return A.substr(h+1)}function RSASetPrivate(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=parseBigInt(n,16),this.e=parseInt(t,16),this.d=parseBigInt(e,16);else throw"Invalid RSA private key"}function RSASetPrivateEx(n,t,e,r,i,o,s,u){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=parseBigInt(n,16),this.e=parseInt(t,16),this.d=parseBigInt(e,16),this.p=parseBigInt(r,16),this.q=parseBigInt(i,16),this.dmp1=parseBigInt(o,16),this.dmq1=parseBigInt(s,16),this.coeff=parseBigInt(u,16);else throw"Invalid RSA private key in RSASetPrivateEx"}function RSADoPrivate(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 RSADecrypt(n){if(n.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var t=parseBigInt(n,16),e=this.doPrivate(t);return e==null?null:pkcs1unpad2(e,this.n.bitLength()+7>>3)}function RSADecryptOAEP(n,t,e){if(n.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var r=parseBigInt(n,16),i=this.doPrivate(r);return i==null?null:oaep_unpad(i,this.n.bitLength()+7>>3,t,e)}RSAKey.prototype.doPrivate=RSADoPrivate,RSAKey.prototype.setPrivate=RSASetPrivate,RSAKey.prototype.setPrivateEx=RSASetPrivateEx,RSAKey.prototype.decrypt=RSADecrypt,RSAKey.prototype.decryptOAEP=RSADecryptOAEP,(typeof KJUR.lang=="undefined"||!KJUR.lang)&&(KJUR.lang={}),KJUR.lang.String=function(){};function b64utob64(n){return n.length%4==2?n=n+"==":n.length%4==3&&(n=n+"="),n=n.replace(/-/g,"+"),n=n.replace(/_/g,"/"),n}function b64utohex(n){return b64tohex(b64utob64(n))}function hextoutf8(n){return decodeURIComponent(hextouricmp(n))}function hextorstr(n){for(var t="",e=0;e<n.length-1;e+=2)t+=String.fromCharCode(parseInt(n.substr(e,2),16));return t}function rstrtohex(n){for(var t="",e=0;e<n.length;e++)t+=("0"+n.charCodeAt(e).toString(16)).slice(-2);return t}function hextob64(n){return hex2b64(n)}function hextob64nl(n){var t=hextob64(n),e=t.replace(/(.{64})/g,`$1\r
342
+ */var KJUR={},CryptoJS=CryptoJS||function(n,t){var e={},r=e.lib={},i=r.Base=function(){function v(){}return{extend:function(A){v.prototype=this;var h=new v;return A&&h.mixIn(A),h.hasOwnProperty("init")||(h.init=function(){h.$super.init.apply(this,arguments)}),h.init.prototype=h,h.$super=this,h},create:function(){var A=this.extend();return A.init.apply(A,arguments),A},init:function(){},mixIn:function(A){for(var h in A)A.hasOwnProperty(h)&&(this[h]=A[h]);A.hasOwnProperty("toString")&&(this.toString=A.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),o=r.WordArray=i.extend({init:function(v,A){v=this.words=v||[],A!=t?this.sigBytes=A:this.sigBytes=v.length*4},toString:function(v){return(v||u).stringify(this)},concat:function(v){var A=this.words,h=v.words,p=this.sigBytes,y=v.sigBytes;if(this.clamp(),p%4)for(var m=0;m<y;m++){var g=h[m>>>2]>>>24-m%4*8&255;A[p+m>>>2]|=g<<24-(p+m)%4*8}else for(var m=0;m<y;m+=4)A[p+m>>>2]=h[m>>>2];return this.sigBytes+=y,this},clamp:function(){var v=this.words,A=this.sigBytes;v[A>>>2]&=4294967295<<32-A%4*8,v.length=n.ceil(A/4)},clone:function(){var v=i.clone.call(this);return v.words=this.words.slice(0),v},random:function(v){for(var A=[],h=0;h<v;h+=4)A.push(n.random()*4294967296|0);return new o.init(A,v)}}),s=e.enc={},u=s.Hex={stringify:function(v){for(var A=v.words,h=v.sigBytes,p=[],y=0;y<h;y++){var m=A[y>>>2]>>>24-y%4*8&255;p.push((m>>>4).toString(16)),p.push((m&15).toString(16))}return p.join("")},parse:function(v){for(var A=v.length,h=[],p=0;p<A;p+=2)h[p>>>3]|=parseInt(v.substr(p,2),16)<<24-p%8*4;return new o.init(h,A/2)}},c=s.Latin1={stringify:function(v){for(var A=v.words,h=v.sigBytes,p=[],y=0;y<h;y++){var m=A[y>>>2]>>>24-y%4*8&255;p.push(String.fromCharCode(m))}return p.join("")},parse:function(v){for(var A=v.length,h=[],p=0;p<A;p++)h[p>>>2]|=(v.charCodeAt(p)&255)<<24-p%4*8;return new o.init(h,A)}},l=s.Utf8={stringify:function(v){try{return decodeURIComponent(escape(c.stringify(v)))}catch(A){throw new Error("Malformed UTF-8 data")}},parse:function(v){return c.parse(unescape(encodeURIComponent(v)))}},d=r.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(v){typeof v=="string"&&(v=l.parse(v)),this._data.concat(v),this._nDataBytes+=v.sigBytes},_process:function(v){var A=this._data,h=A.words,p=A.sigBytes,y=this.blockSize,m=y*4,g=p/m;v?g=n.ceil(g):g=n.max((g|0)-this._minBufferSize,0);var E=g*y,b=n.min(E*4,p);if(E){for(var T=0;T<E;T+=y)this._doProcessBlock(h,T);var _=h.splice(0,E);A.sigBytes-=b}return new o.init(_,b)},clone:function(){var v=i.clone.call(this);return v._data=this._data.clone(),v},_minBufferSize:0});r.Hasher=d.extend({cfg:i.extend(),init:function(v){this.cfg=this.cfg.extend(v),this.reset()},reset:function(){d.reset.call(this),this._doReset()},update:function(v){return this._append(v),this._process(),this},finalize:function(v){v&&this._append(v);var A=this._doFinalize();return A},blockSize:512/32,_createHelper:function(v){return function(A,h){return new v.init(h).finalize(A)}},_createHmacHelper:function(v){return function(A,h){return new f.HMAC.init(v,h).finalize(A)}}});var f=e.algo={};return e}(Math);(function(n){for(var t=CryptoJS,A=t.lib,e=A.WordArray,r=A.Hasher,A=t.algo,i=[],o=[],s=function(p){return 4294967296*(p-(p|0))|0},u=2,c=0;64>c;){var l;e:{l=u;for(var d=n.sqrt(l),f=2;f<=d;f++)if(!(l%f)){l=!1;break e}l=!0}l&&(8>c&&(i[c]=s(n.pow(u,.5))),o[c]=s(n.pow(u,1/3)),c++),u++}var v=[],A=A.SHA256=r.extend({_doReset:function(){this._hash=new e.init(i.slice(0))},_doProcessBlock:function(h,p){for(var y=this._hash.words,m=y[0],g=y[1],E=y[2],b=y[3],T=y[4],_=y[5],S=y[6],R=y[7],B=0;64>B;B++){if(16>B)v[B]=h[p+B]|0;else{var I=v[B-15],x=v[B-2];v[B]=((I<<25|I>>>7)^(I<<14|I>>>18)^I>>>3)+v[B-7]+((x<<15|x>>>17)^(x<<13|x>>>19)^x>>>10)+v[B-16]}I=R+((T<<26|T>>>6)^(T<<21|T>>>11)^(T<<7|T>>>25))+(T&_^~T&S)+o[B]+v[B],x=((m<<30|m>>>2)^(m<<19|m>>>13)^(m<<10|m>>>22))+(m&g^m&E^g&E),R=S,S=_,_=T,T=b+I|0,b=E,E=g,g=m,m=I+x|0}y[0]=y[0]+m|0,y[1]=y[1]+g|0,y[2]=y[2]+E|0,y[3]=y[3]+b|0,y[4]=y[4]+T|0,y[5]=y[5]+_|0,y[6]=y[6]+S|0,y[7]=y[7]+R|0},_doFinalize:function(){var h=this._data,p=h.words,y=8*this._nDataBytes,m=8*h.sigBytes;return p[m>>>5]|=128<<24-m%32,p[(m+64>>>9<<4)+14]=n.floor(y/4294967296),p[(m+64>>>9<<4)+15]=y,h.sigBytes=4*p.length,this._process(),this._hash},clone:function(){var h=r.clone.call(this);return h._hash=this._hash.clone(),h}});t.SHA256=r._createHelper(A),t.HmacSHA256=r._createHmacHelper(A)})(Math),CryptoJS.lib.Cipher||function(n){var A=CryptoJS,t=A.lib,e=t.Base,r=t.WordArray,i=t.BufferedBlockAlgorithm,o=A.enc.Base64,s=A.algo.EvpKDF,u=t.Cipher=i.extend({cfg:e.extend(),createEncryptor:function(p,y){return this.create(this._ENC_XFORM_MODE,p,y)},createDecryptor:function(p,y){return this.create(this._DEC_XFORM_MODE,p,y)},init:function(p,y,m){this.cfg=this.cfg.extend(m),this._xformMode=p,this._key=y,this.reset()},reset:function(){i.reset.call(this),this._doReset()},process:function(p){return this._append(p),this._process()},finalize:function(p){return p&&this._append(p),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(p){return{encrypt:function(y,m,g){return(typeof m=="string"?h:v).encrypt(p,y,m,g)},decrypt:function(y,m,g){return(typeof m=="string"?h:v).decrypt(p,y,m,g)}}}});t.StreamCipher=u.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var f=A.mode={},c=function(p,y,m){var g=this._iv;g?this._iv=n:g=this._prevBlock;for(var E=0;E<m;E++)p[y+E]^=g[E]},l=(t.BlockCipherMode=e.extend({createEncryptor:function(p,y){return this.Encryptor.create(p,y)},createDecryptor:function(p,y){return this.Decryptor.create(p,y)},init:function(p,y){this._cipher=p,this._iv=y}})).extend();l.Encryptor=l.extend({processBlock:function(p,y){var m=this._cipher,g=m.blockSize;c.call(this,p,y,g),m.encryptBlock(p,y),this._prevBlock=p.slice(y,y+g)}}),l.Decryptor=l.extend({processBlock:function(p,y){var m=this._cipher,g=m.blockSize,E=p.slice(y,y+g);m.decryptBlock(p,y),c.call(this,p,y,g),this._prevBlock=E}}),f=f.CBC=l,l=(A.pad={}).Pkcs7={pad:function(p,y){for(var m=4*y,m=m-p.sigBytes%m,g=m<<24|m<<16|m<<8|m,E=[],b=0;b<m;b+=4)E.push(g);m=r.create(E,m),p.concat(m)},unpad:function(p){p.sigBytes-=p.words[p.sigBytes-1>>>2]&255}},t.BlockCipher=u.extend({cfg:u.cfg.extend({mode:f,padding:l}),reset:function(){u.reset.call(this);var y=this.cfg,p=y.iv,y=y.mode;if(this._xformMode==this._ENC_XFORM_MODE)var m=y.createEncryptor;else m=y.createDecryptor,this._minBufferSize=1;this._mode=m.call(y,this,p&&p.words)},_doProcessBlock:function(p,y){this._mode.processBlock(p,y)},_doFinalize:function(){var p=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){p.pad(this._data,this.blockSize);var y=this._process(!0)}else y=this._process(!0),p.unpad(y);return y},blockSize:4});var d=t.CipherParams=e.extend({init:function(p){this.mixIn(p)},toString:function(p){return(p||this.formatter).stringify(this)}}),f=(A.format={}).OpenSSL={stringify:function(p){var y=p.ciphertext;return p=p.salt,(p?r.create([1398893684,1701076831]).concat(p).concat(y):y).toString(o)},parse:function(p){p=o.parse(p);var y=p.words;if(y[0]==1398893684&&y[1]==1701076831){var m=r.create(y.slice(2,4));y.splice(0,4),p.sigBytes-=16}return d.create({ciphertext:p,salt:m})}},v=t.SerializableCipher=e.extend({cfg:e.extend({format:f}),encrypt:function(p,y,m,g){g=this.cfg.extend(g);var E=p.createEncryptor(m,g);return y=E.finalize(y),E=E.cfg,d.create({ciphertext:y,key:m,iv:E.iv,algorithm:p,mode:E.mode,padding:E.padding,blockSize:p.blockSize,formatter:g.format})},decrypt:function(p,y,m,g){return g=this.cfg.extend(g),y=this._parse(y,g.format),p.createDecryptor(m,g).finalize(y.ciphertext)},_parse:function(p,y){return typeof p=="string"?y.parse(p,this):p}}),A=(A.kdf={}).OpenSSL={execute:function(p,y,m,g){return g||(g=r.random(8)),p=s.create({keySize:y+m}).compute(p,g),m=r.create(p.words.slice(y),4*m),p.sigBytes=4*y,d.create({key:p,iv:m,salt:g})}},h=t.PasswordBasedCipher=v.extend({cfg:v.cfg.extend({kdf:A}),encrypt:function(p,y,m,g){return g=this.cfg.extend(g),m=g.kdf.execute(m,p.keySize,p.ivSize),g.iv=m.iv,p=v.encrypt.call(this,p,y,m.key,g),p.mixIn(m),p},decrypt:function(p,y,m,g){return g=this.cfg.extend(g),y=this._parse(y,g.format),m=g.kdf.execute(m,p.keySize,p.ivSize,y.salt),g.iv=m.iv,v.decrypt.call(this,p,y,m.key,g)}})}(),function(){for(var n=CryptoJS,t=n.lib.BlockCipher,_=n.algo,e=[],r=[],i=[],o=[],s=[],u=[],c=[],l=[],d=[],f=[],v=[],A=0;256>A;A++)v[A]=128>A?A<<1:A<<1^283;for(var h=0,p=0,A=0;256>A;A++){var y=p^p<<1^p<<2^p<<3^p<<4,y=y>>>8^y&255^99;e[h]=y,r[y]=h;var m=v[h],g=v[m],E=v[g],b=257*v[y]^16843008*y;i[h]=b<<24|b>>>8,o[h]=b<<16|b>>>16,s[h]=b<<8|b>>>24,u[h]=b,b=16843009*E^65537*g^257*m^16843008*h,c[y]=b<<24|b>>>8,l[y]=b<<16|b>>>16,d[y]=b<<8|b>>>24,f[y]=b,h?(h=m^v[v[v[E^m]]],p^=v[v[p]]):h=p=1}var T=[0,1,2,4,8,16,32,64,128,27,54],_=_.AES=t.extend({_doReset:function(){for(var B=this._key,S=B.words,R=B.sigBytes/4,B=4*((this._nRounds=R+6)+1),I=this._keySchedule=[],x=0;x<B;x++)if(x<R)I[x]=S[x];else{var M=I[x-1];x%R?6<R&&x%R==4&&(M=e[M>>>24]<<24|e[M>>>16&255]<<16|e[M>>>8&255]<<8|e[M&255]):(M=M<<8|M>>>24,M=e[M>>>24]<<24|e[M>>>16&255]<<16|e[M>>>8&255]<<8|e[M&255],M^=T[x/R|0]<<24),I[x]=I[x-R]^M}for(S=this._invKeySchedule=[],R=0;R<B;R++)x=B-R,M=R%4?I[x]:I[x-4],S[R]=4>R||4>=x?M:c[e[M>>>24]]^l[e[M>>>16&255]]^d[e[M>>>8&255]]^f[e[M&255]]},encryptBlock:function(S,R){this._doCryptBlock(S,R,this._keySchedule,i,o,s,u,e)},decryptBlock:function(S,R){var B=S[R+1];S[R+1]=S[R+3],S[R+3]=B,this._doCryptBlock(S,R,this._invKeySchedule,c,l,d,f,r),B=S[R+1],S[R+1]=S[R+3],S[R+3]=B},_doCryptBlock:function(S,R,B,I,x,M,L,C){for(var H=this._nRounds,q=S[R]^B[0],z=S[R+1]^B[1],K=S[R+2]^B[2],D=S[R+3]^B[3],F=4,O=1;O<H;O++)var G=I[q>>>24]^x[z>>>16&255]^M[K>>>8&255]^L[D&255]^B[F++],Q=I[z>>>24]^x[K>>>16&255]^M[D>>>8&255]^L[q&255]^B[F++],U=I[K>>>24]^x[D>>>16&255]^M[q>>>8&255]^L[z&255]^B[F++],D=I[D>>>24]^x[q>>>16&255]^M[z>>>8&255]^L[K&255]^B[F++],q=G,z=Q,K=U;G=(C[q>>>24]<<24|C[z>>>16&255]<<16|C[K>>>8&255]<<8|C[D&255])^B[F++],Q=(C[z>>>24]<<24|C[K>>>16&255]<<16|C[D>>>8&255]<<8|C[q&255])^B[F++],U=(C[K>>>24]<<24|C[D>>>16&255]<<16|C[q>>>8&255]<<8|C[z&255])^B[F++],D=(C[D>>>24]<<24|C[q>>>16&255]<<16|C[z>>>8&255]<<8|C[K&255])^B[F++],S[R]=G,S[R+1]=Q,S[R+2]=U,S[R+3]=D},keySize:8});n.AES=t._createHelper(_)}();/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
343
+ */var dbits;function BigInteger(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 nbi(){return new BigInteger(null)}function am1(n,t,e,r,i,o){for(;--o>=0;){var s=t*this[n++]+e[r]+i;i=Math.floor(s/67108864),e[r++]=s&67108863}return i}function am2(n,t,e,r,i,o){for(var s=t&32767,u=t>>15;--o>=0;){var c=this[n]&32767,l=this[n++]>>15,d=u*c+l*s;c=s*c+((d&32767)<<15)+e[r]+(i&1073741823),i=(c>>>30)+(d>>>15)+u*l+(i>>>30),e[r++]=c&1073741823}return i}function am3(n,t,e,r,i,o){for(var s=t&16383,u=t>>14;--o>=0;){var c=this[n]&16383,l=this[n++]>>14,d=u*c+l*s;c=s*c+((d&16383)<<14)+e[r]+i,i=(c>>28)+(d>>14)+u*l,e[r++]=c&268435455}return i}typeof navigator!="undefined"&&navigator.appName=="Microsoft Internet Explorer"?(BigInteger.prototype.am=am2,dbits=30):typeof navigator!="undefined"&&navigator.appName!="Netscape"?(BigInteger.prototype.am=am1,dbits=26):(BigInteger.prototype.am=am3,dbits=28),BigInteger.prototype.DB=dbits,BigInteger.prototype.DM=(1<<dbits)-1,BigInteger.prototype.DV=1<<dbits;var BI_FP=52;BigInteger.prototype.FV=Math.pow(2,BI_FP),BigInteger.prototype.F1=BI_FP-dbits,BigInteger.prototype.F2=2*dbits-BI_FP;var BI_RM="0123456789abcdefghijklmnopqrstuvwxyz",BI_RC=new Array,rr,vv;for(rr=48,vv=0;vv<=9;++vv)BI_RC[rr++]=vv;for(rr=97,vv=10;vv<36;++vv)BI_RC[rr++]=vv;for(rr=65,vv=10;vv<36;++vv)BI_RC[rr++]=vv;function int2char(n){return BI_RM.charAt(n)}function intAt(n,t){var e=BI_RC[n.charCodeAt(t)];return e==null?-1:e}function bnpCopyTo(n){for(var t=this.t-1;t>=0;--t)n[t]=this[t];n.t=this.t,n.s=this.s}function bnpFromInt(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 nbv(n){var t=nbi();return t.fromInt(n),t}function bnpFromString(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,o=0;--r>=0;){var s=e==8?n[r]&255:intAt(n,r);if(s<0){n.charAt(r)=="-"&&(i=!0);continue}i=!1,o==0?this[this.t++]=s:o+e>this.DB?(this[this.t-1]|=(s&(1<<this.DB-o)-1)<<o,this[this.t++]=s>>this.DB-o):this[this.t-1]|=s<<o,o+=e,o>=this.DB&&(o-=this.DB)}e==8&&n[0]&128&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),i&&BigInteger.ZERO.subTo(this,this)}function bnpClamp(){for(var n=this.s&this.DM;this.t>0&&this[this.t-1]==n;)--this.t}function bnToString(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,o="",s=this.t,u=this.DB-s*this.DB%t;if(s-- >0)for(u<this.DB&&(r=this[s]>>u)>0&&(i=!0,o=int2char(r));s>=0;)u<t?(r=(this[s]&(1<<u)-1)<<t-u,r|=this[--s]>>(u+=this.DB-t)):(r=this[s]>>(u-=t)&e,u<=0&&(u+=this.DB,--s)),r>0&&(i=!0),i&&(o+=int2char(r));return i?o:"0"}function bnNegate(){var n=nbi();return BigInteger.ZERO.subTo(this,n),n}function bnAbs(){return this.s<0?this.negate():this}function bnCompareTo(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 nbits(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 bnBitLength(){return this.t<=0?0:this.DB*(this.t-1)+nbits(this[this.t-1]^this.s&this.DM)}function bnpDLShiftTo(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 bnpDRShiftTo(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 bnpLShiftTo(n,t){var e=n%this.DB,r=this.DB-e,i=(1<<r)-1,o=Math.floor(n/this.DB),s=this.s<<e&this.DM,u;for(u=this.t-1;u>=0;--u)t[u+o+1]=this[u]>>r|s,s=(this[u]&i)<<e;for(u=o-1;u>=0;--u)t[u]=0;t[o]=s,t.t=this.t+o+1,t.s=this.s,t.clamp()}function bnpRShiftTo(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,o=(1<<r)-1;t[0]=this[e]>>r;for(var s=e+1;s<this.t;++s)t[s-e-1]|=(this[s]&o)<<i,t[s-e]=this[s]>>r;r>0&&(t[this.t-e-1]|=(this.s&o)<<i),t.t=this.t-e,t.clamp()}function bnpSubTo(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 bnpMultiplyTo(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&&BigInteger.ZERO.subTo(t,t)}function bnpSquareTo(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 bnpDivRemTo(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=nbi());var o=nbi(),s=this.s,u=n.s,c=this.DB-nbits(r[r.t-1]);c>0?(r.lShiftTo(c,o),i.lShiftTo(c,e)):(r.copyTo(o),i.copyTo(e));var l=o.t,d=o[l-1];if(d!=0){var f=d*(1<<this.F1)+(l>1?o[l-2]>>this.F2:0),v=this.FV/f,A=(1<<this.F1)/f,h=1<<this.F2,p=e.t,y=p-l,m=t==null?nbi():t;for(o.dlShiftTo(y,m),e.compareTo(m)>=0&&(e[e.t++]=1,e.subTo(m,e)),BigInteger.ONE.dlShiftTo(l,m),m.subTo(o,o);o.t<l;)o[o.t++]=0;for(;--y>=0;){var g=e[--p]==d?this.DM:Math.floor(e[p]*v+(e[p-1]+h)*A);if((e[p]+=o.am(0,g,e,y,0,l))<g)for(o.dlShiftTo(y,m),e.subTo(m,e);e[p]<--g;)e.subTo(m,e)}t!=null&&(e.drShiftTo(l,t),s!=u&&BigInteger.ZERO.subTo(t,t)),e.t=l,e.clamp(),c>0&&e.rShiftTo(c,e),s<0&&BigInteger.ZERO.subTo(e,e)}}}function bnMod(n){var t=nbi();return this.abs().divRemTo(n,null,t),this.s<0&&t.compareTo(BigInteger.ZERO)>0&&n.subTo(t,t),t}function Classic(n){this.m=n}function cConvert(n){return n.s<0||n.compareTo(this.m)>=0?n.mod(this.m):n}function cRevert(n){return n}function cReduce(n){n.divRemTo(this.m,null,n)}function cMulTo(n,t,e){n.multiplyTo(t,e),this.reduce(e)}function cSqrTo(n,t){n.squareTo(t),this.reduce(t)}Classic.prototype.convert=cConvert,Classic.prototype.revert=cRevert,Classic.prototype.reduce=cReduce,Classic.prototype.mulTo=cMulTo,Classic.prototype.sqrTo=cSqrTo;function bnpInvDigit(){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 Montgomery(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 montConvert(n){var t=nbi();return n.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),n.s<0&&t.compareTo(BigInteger.ZERO)>0&&this.m.subTo(t,t),t}function montRevert(n){var t=nbi();return n.copyTo(t),this.reduce(t),t}function montReduce(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 montSqrTo(n,t){n.squareTo(t),this.reduce(t)}function montMulTo(n,t,e){n.multiplyTo(t,e),this.reduce(e)}Montgomery.prototype.convert=montConvert,Montgomery.prototype.revert=montRevert,Montgomery.prototype.reduce=montReduce,Montgomery.prototype.mulTo=montMulTo,Montgomery.prototype.sqrTo=montSqrTo;function bnpIsEven(){return(this.t>0?this[0]&1:this.s)==0}function bnpExp(n,t){if(n>4294967295||n<1)return BigInteger.ONE;var e=nbi(),r=nbi(),i=t.convert(this),o=nbits(n)-1;for(i.copyTo(e);--o>=0;)if(t.sqrTo(e,r),(n&1<<o)>0)t.mulTo(r,i,e);else{var s=e;e=r,r=s}return t.revert(e)}function bnModPowInt(n,t){var e;return n<256||t.isEven()?e=new Classic(t):e=new Montgomery(t),this.exp(n,e)}BigInteger.prototype.copyTo=bnpCopyTo,BigInteger.prototype.fromInt=bnpFromInt,BigInteger.prototype.fromString=bnpFromString,BigInteger.prototype.clamp=bnpClamp,BigInteger.prototype.dlShiftTo=bnpDLShiftTo,BigInteger.prototype.drShiftTo=bnpDRShiftTo,BigInteger.prototype.lShiftTo=bnpLShiftTo,BigInteger.prototype.rShiftTo=bnpRShiftTo,BigInteger.prototype.subTo=bnpSubTo,BigInteger.prototype.multiplyTo=bnpMultiplyTo,BigInteger.prototype.squareTo=bnpSquareTo,BigInteger.prototype.divRemTo=bnpDivRemTo,BigInteger.prototype.invDigit=bnpInvDigit,BigInteger.prototype.isEven=bnpIsEven,BigInteger.prototype.exp=bnpExp,BigInteger.prototype.toString=bnToString,BigInteger.prototype.negate=bnNegate,BigInteger.prototype.abs=bnAbs,BigInteger.prototype.compareTo=bnCompareTo,BigInteger.prototype.bitLength=bnBitLength,BigInteger.prototype.mod=bnMod,BigInteger.prototype.modPowInt=bnModPowInt,BigInteger.ZERO=nbv(0),BigInteger.ONE=nbv(1);/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function bnIntValue(){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 bnpChunkSize(n){return Math.floor(Math.LN2*this.DB/Math.log(n))}function bnSigNum(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function bnpToRadix(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=nbv(e),i=nbi(),o=nbi(),s="";for(this.divRemTo(r,i,o);i.signum()>0;)s=(e+o.intValue()).toString(n).substr(1)+s,i.divRemTo(r,i,o);return o.intValue().toString(n)+s}BigInteger.prototype.chunkSize=bnpChunkSize,BigInteger.prototype.toRadix=bnpToRadix,BigInteger.prototype.intValue=bnIntValue,BigInteger.prototype.signum=bnSigNum;/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */var b64map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",b64pad="=";function hex2b64(n){var t,e,r="";for(t=0;t+3<=n.length;t+=3)e=parseInt(n.substring(t,t+3),16),r+=b64map.charAt(e>>6)+b64map.charAt(e&63);for(t+1==n.length?(e=parseInt(n.substring(t,t+1),16),r+=b64map.charAt(e<<2)):t+2==n.length&&(e=parseInt(n.substring(t,t+2),16),r+=b64map.charAt(e>>2)+b64map.charAt((e&3)<<4));(r.length&3)>0;)r+=b64pad;return r}function b64tohex(n){var t="",e,r=0,i,o;for(e=0;e<n.length&&n.charAt(e)!=b64pad;++e)o=b64map.indexOf(n.charAt(e)),!(o<0)&&(r==0?(t+=int2char(o>>2),i=o&3,r=1):r==1?(t+=int2char(i<<2|o>>4),i=o&15,r=2):r==2?(t+=int2char(i),t+=int2char(o>>2),i=o&3,r=3):(t+=int2char(i<<2|o>>4),t+=int2char(o&15),r=0));return r==1&&(t+=int2char(i<<2)),t}/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function parseBigInt(n,t){return new BigInteger(n,t)}function pkcs1pad2(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 o=new SecureRandom,s=new Array;t>2;){for(s[0]=0;s[0]==0;)o.nextBytes(s);e[--t]=s[0]}return e[--t]=2,e[--t]=0,new BigInteger(e)}function oaep_mgf1_arr(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 oaep_pad(n,t,e,r){var i=KJUR.crypto.MessageDigest,o=KJUR.crypto.Util,s=null;if(e||(e="sha1"),typeof e=="string"&&(s=i.getCanonicalAlgName(e),r=i.getHashLength(s),e=function(p){return hextorstr(o.hashHex(rstrtohex(p),s))}),n.length+2*r+2>t)throw"Message too long for RSA";var u="",c;for(c=0;c<t-n.length-2*r-2;c+=1)u+="\0";var l=e("")+u+""+n,d=new Array(r);new SecureRandom().nextBytes(d);var f=oaep_mgf1_arr(d,l.length,e),v=[];for(c=0;c<l.length;c+=1)v[c]=l.charCodeAt(c)^f.charCodeAt(c);var A=oaep_mgf1_arr(v,d.length,e),h=[0];for(c=0;c<d.length;c+=1)h[c+1]=d[c]^A.charCodeAt(c);return new BigInteger(h.concat(v))}function RSAKey(){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 RSASetPublic(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=parseBigInt(n,16),this.e=parseInt(t,16);else throw"Invalid RSA public key"}function RSADoPublic(n){return n.modPowInt(this.e,this.n)}function RSAEncrypt(n){var t=pkcs1pad2(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 RSAEncryptOAEP(n,t,e){var r=oaep_pad(n,this.n.bitLength()+7>>3,t,e);if(r==null)return null;var i=this.doPublic(r);if(i==null)return null;var o=i.toString(16);return o.length&1?"0"+o:o}RSAKey.prototype.doPublic=RSADoPublic,RSAKey.prototype.setPublic=RSASetPublic,RSAKey.prototype.encrypt=RSAEncrypt,RSAKey.prototype.encryptOAEP=RSAEncryptOAEP,RSAKey.prototype.type="RSA";/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function pkcs1unpad2(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 o=e[r]&255;o<128?i+=String.fromCharCode(o):o>191&&o<224?(i+=String.fromCharCode((o&31)<<6|e[r+1]&63),++r):(i+=String.fromCharCode((o&15)<<12|(e[r+1]&63)<<6|e[r+2]&63),r+=2)}return i}function oaep_mgf1_str(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 oaep_unpad(n,t,e,r){var i=KJUR.crypto.MessageDigest,o=KJUR.crypto.Util,s=null;e||(e="sha1"),typeof e=="string"&&(s=i.getCanonicalAlgName(e),r=i.getHashLength(s),e=function(y){return hextorstr(o.hashHex(rstrtohex(y),s))}),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 u=n.substr(1,r),c=n.substr(r+1),l=oaep_mgf1_str(c,r,e),d=[],f;for(f=0;f<u.length;f+=1)d[f]=u.charCodeAt(f)^l.charCodeAt(f);var v=oaep_mgf1_str(String.fromCharCode.apply(String,d),n.length-r,e),A=[];for(f=0;f<c.length;f+=1)A[f]=c.charCodeAt(f)^v.charCodeAt(f);if(A=String.fromCharCode.apply(String,A),A.substr(0,r)!==e(""))throw"Hash mismatch";A=A.substr(r);var h=A.indexOf(""),p=h!=-1?A.substr(0,h).lastIndexOf("\0"):-1;if(p+1!=h)throw"Malformed data";return A.substr(h+1)}function RSASetPrivate(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=parseBigInt(n,16),this.e=parseInt(t,16),this.d=parseBigInt(e,16);else throw"Invalid RSA private key"}function RSASetPrivateEx(n,t,e,r,i,o,s,u){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=parseBigInt(n,16),this.e=parseInt(t,16),this.d=parseBigInt(e,16),this.p=parseBigInt(r,16),this.q=parseBigInt(i,16),this.dmp1=parseBigInt(o,16),this.dmq1=parseBigInt(s,16),this.coeff=parseBigInt(u,16);else throw"Invalid RSA private key in RSASetPrivateEx"}function RSADoPrivate(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 RSADecrypt(n){if(n.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var t=parseBigInt(n,16),e=this.doPrivate(t);return e==null?null:pkcs1unpad2(e,this.n.bitLength()+7>>3)}function RSADecryptOAEP(n,t,e){if(n.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var r=parseBigInt(n,16),i=this.doPrivate(r);return i==null?null:oaep_unpad(i,this.n.bitLength()+7>>3,t,e)}RSAKey.prototype.doPrivate=RSADoPrivate,RSAKey.prototype.setPrivate=RSASetPrivate,RSAKey.prototype.setPrivateEx=RSASetPrivateEx,RSAKey.prototype.decrypt=RSADecrypt,RSAKey.prototype.decryptOAEP=RSADecryptOAEP,(typeof KJUR.lang=="undefined"||!KJUR.lang)&&(KJUR.lang={}),KJUR.lang.String=function(){};function b64utob64(n){return n.length%4==2?n=n+"==":n.length%4==3&&(n=n+"="),n=n.replace(/-/g,"+"),n=n.replace(/_/g,"/"),n}function b64utohex(n){return b64tohex(b64utob64(n))}function hextoutf8(n){return decodeURIComponent(hextouricmp(n))}function hextorstr(n){for(var t="",e=0;e<n.length-1;e+=2)t+=String.fromCharCode(parseInt(n.substr(e,2),16));return t}function rstrtohex(n){for(var t="",e=0;e<n.length;e++)t+=("0"+n.charCodeAt(e).toString(16)).slice(-2);return t}function hextob64(n){return hex2b64(n)}function hextob64nl(n){var t=hextob64(n),e=t.replace(/(.{64})/g,`$1\r
344
344
  `);return e=e.replace(/\r\n$/,""),e}function b64nltohex(n){var t=n.replace(/[^0-9A-Za-z\/+=]*/g,""),e=b64tohex(t);return e}function hextopem(n,t){var e=hextob64nl(n);return"-----BEGIN "+t+`-----\r
345
345
  `+e+`\r
346
346
  -----END `+t+`-----\r
347
- `}function pemtohex(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 [^-]+-----[^]*$/,"")),b64nltohex(n)}function hextouricmp(n){return n.replace(/(..)/g,"%$1")}function hextoipv6(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 hextoip(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?hextoipv6(n):n}function ucs2hextoutf8(n){function t(i){var o=parseInt(i.substr(0,2),16),s=parseInt(i.substr(2),16);if(o==0&s<128)return String.fromCharCode(s);if(o<8){var u=192|(o&7)<<3|(s&192)>>6,l=128|s&63;return hextoutf8(u.toString(16)+l.toString(16))}var u=224|(o&240)>>4,l=128|(o&15)<<2|(s&192)>>6,c=128|s&63;return hextoutf8(u.toString(16)+l.toString(16)+c.toString(16))}var e=n.match(/.{4}/g),r=e.map(t);return r.join("")}KJUR.lang.String.isHex=function(n){return ishex(n)};function ishex(n){return!!(n.length%2==0&&(n.match(/^[0-9a-f]+$/)||n.match(/^[0-9A-F]+$/)))}KJUR.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 hextoposhex(n){return n.length%2==1?"0"+n:n.substr(0,1)>"7"?"00"+n:n}function hextooid(n){if(!ishex(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),o=[],s=0;s<i.length/2;s++)o.push(parseInt(i.substr(s*2,2),16));for(var u=[],l="",s=0;s<o.length;s++)o[s]&128?l=l+strpad((o[s]&127).toString(2),7):(l=l+strpad((o[s]&127).toString(2),7),u.push(new String(parseInt(l,2))),l="");var c=t.join(".");return u.length>0&&(c=c+"."+u.join(".")),c}catch(d){return null}}var strpad=function(n,t,e){return e==null&&(e="0"),n.length>=t?n:new Array(t-n.length+1).join(e)+n};function bitstrtoint(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(o){return-1}}(typeof KJUR.crypto=="undefined"||!KJUR.crypto)&&(KJUR.crypto={}),KJUR.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:CryptoJS.algo.MD5,sha1:CryptoJS.algo.SHA1,sha224:CryptoJS.algo.SHA224,sha256:CryptoJS.algo.SHA256,sha384:CryptoJS.algo.SHA384,sha512:CryptoJS.algo.SHA512,ripemd160:CryptoJS.algo.RIPEMD160},this.hashString=function(n,t){var e=new KJUR.crypto.MessageDigest({alg:t});return e.digestString(n)},this.hashHex=function(n,t){var e=new KJUR.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")}},KJUR.crypto.MessageDigest=function(n){this.setAlgAndProvider=function(t,e){if(t=KJUR.crypto.MessageDigest.getCanonicalAlgName(t),t!==null&&e===void 0&&(e=KJUR.crypto.Util.DEFAULTPROVIDER[t]),":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(t)!=-1&&e=="cryptojs"){try{this.md=KJUR.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=CryptoJS.enc.Hex.parse(r);this.md.update(i)},this.digest=function(){var r=this.md.finalize();return r.toString(CryptoJS.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=KJUR.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))},KJUR.crypto.MessageDigest.getCanonicalAlgName=function(n){return typeof n=="string"&&(n=n.toLowerCase(),n=n.replace(/-/,"")),n},KJUR.crypto.MessageDigest.getHashLength=function(n){var t=KJUR.crypto.MessageDigest,e=t.getCanonicalAlgName(n);if(t.HASHLENGTH[e]===void 0)throw"not supported algorithm: "+n;return t.HASHLENGTH[e]},KJUR.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20},KJUR.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="",o=r/4-e.length,s=0;s<o;s++)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 KJUR.crypto.MessageDigest({alg:this.mdAlgName})}catch(i){throw new Error("setAlgAndProvider hash alg set fail alg="+this.mdAlgName+"/"+i)}this.init=function(i,o){var s=null;try{o===void 0?s=KEYUTIL.getKey(i):s=KEYUTIL.getKey(i,o)}catch(u){throw"init failed:"+u}if(s.isPrivate===!0)this.prvKey=s,this.state="SIGN";else if(s.isPublic===!0)this.pubKey=s,this.state="VERIFY";else throw"init failed.:"+s},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 RSAKey&&this.pubkeyAlgName==="rsaandmgf1")return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,i,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof RSAKey&&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=KJUR.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=KEYUTIL.getKey(n.prvkeypem);this.init(t)}catch(e){throw"fatal error to load pem private key: "+e}}},KJUR.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 KEYUTIL=function(){var n=function(h,p,y){return r(CryptoJS.AES,h,p,y)},t=function(h,p,y){return r(CryptoJS.TripleDES,h,p,y)},e=function(h,p,y){return r(CryptoJS.DES,h,p,y)},r=function(h,p,y,v){var g=CryptoJS.enc.Hex.parse(p),E=CryptoJS.enc.Hex.parse(y),b=CryptoJS.enc.Hex.parse(v),T={};T.key=E,T.iv=b,T.ciphertext=g;var _=h.decrypt(T,E,{iv:b});return CryptoJS.enc.Hex.stringify(_)},i=function(h,p,y){return u(CryptoJS.AES,h,p,y)},o=function(h,p,y){return u(CryptoJS.TripleDES,h,p,y)},s=function(h,p,y){return u(CryptoJS.DES,h,p,y)},u=function(h,p,y,v){var g=CryptoJS.enc.Hex.parse(p),E=CryptoJS.enc.Hex.parse(y),b=CryptoJS.enc.Hex.parse(v),T=h.encrypt(g,E,{iv:b}),_=CryptoJS.enc.Hex.parse(T.toString()),x=CryptoJS.enc.Base64.stringify(_);return x},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:o,keylen:24,ivlen:8},"DES-CBC":{proc:e,eproc:s,keylen:8,ivlen:8}},c=function(h){var p=CryptoJS.lib.WordArray.random(h),y=CryptoJS.enc.Hex.stringify(p);return y},d=function(h){var p={},y=h.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));y&&(p.cipher=y[1],p.ivsalt=y[2]);var v=h.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));v&&(p.type=v[1]);var g=-1,E=0;h.indexOf(`\r
347
+ `}function pemtohex(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 [^-]+-----[^]*$/,"")),b64nltohex(n)}function hextouricmp(n){return n.replace(/(..)/g,"%$1")}function hextoipv6(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 hextoip(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?hextoipv6(n):n}function ucs2hextoutf8(n){function t(i){var o=parseInt(i.substr(0,2),16),s=parseInt(i.substr(2),16);if(o==0&s<128)return String.fromCharCode(s);if(o<8){var u=192|(o&7)<<3|(s&192)>>6,c=128|s&63;return hextoutf8(u.toString(16)+c.toString(16))}var u=224|(o&240)>>4,c=128|(o&15)<<2|(s&192)>>6,l=128|s&63;return hextoutf8(u.toString(16)+c.toString(16)+l.toString(16))}var e=n.match(/.{4}/g),r=e.map(t);return r.join("")}KJUR.lang.String.isHex=function(n){return ishex(n)};function ishex(n){return!!(n.length%2==0&&(n.match(/^[0-9a-f]+$/)||n.match(/^[0-9A-F]+$/)))}KJUR.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 hextoposhex(n){return n.length%2==1?"0"+n:n.substr(0,1)>"7"?"00"+n:n}function hextooid(n){if(!ishex(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),o=[],s=0;s<i.length/2;s++)o.push(parseInt(i.substr(s*2,2),16));for(var u=[],c="",s=0;s<o.length;s++)o[s]&128?c=c+strpad((o[s]&127).toString(2),7):(c=c+strpad((o[s]&127).toString(2),7),u.push(new String(parseInt(c,2))),c="");var l=t.join(".");return u.length>0&&(l=l+"."+u.join(".")),l}catch(d){return null}}var strpad=function(n,t,e){return e==null&&(e="0"),n.length>=t?n:new Array(t-n.length+1).join(e)+n};function bitstrtoint(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(o){return-1}}(typeof KJUR.crypto=="undefined"||!KJUR.crypto)&&(KJUR.crypto={}),KJUR.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:CryptoJS.algo.MD5,sha1:CryptoJS.algo.SHA1,sha224:CryptoJS.algo.SHA224,sha256:CryptoJS.algo.SHA256,sha384:CryptoJS.algo.SHA384,sha512:CryptoJS.algo.SHA512,ripemd160:CryptoJS.algo.RIPEMD160},this.hashString=function(n,t){var e=new KJUR.crypto.MessageDigest({alg:t});return e.digestString(n)},this.hashHex=function(n,t){var e=new KJUR.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")}},KJUR.crypto.MessageDigest=function(n){this.setAlgAndProvider=function(t,e){if(t=KJUR.crypto.MessageDigest.getCanonicalAlgName(t),t!==null&&e===void 0&&(e=KJUR.crypto.Util.DEFAULTPROVIDER[t]),":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(t)!=-1&&e=="cryptojs"){try{this.md=KJUR.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=CryptoJS.enc.Hex.parse(r);this.md.update(i)},this.digest=function(){var r=this.md.finalize();return r.toString(CryptoJS.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=KJUR.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))},KJUR.crypto.MessageDigest.getCanonicalAlgName=function(n){return typeof n=="string"&&(n=n.toLowerCase(),n=n.replace(/-/,"")),n},KJUR.crypto.MessageDigest.getHashLength=function(n){var t=KJUR.crypto.MessageDigest,e=t.getCanonicalAlgName(n);if(t.HASHLENGTH[e]===void 0)throw"not supported algorithm: "+n;return t.HASHLENGTH[e]},KJUR.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20},KJUR.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="",o=r/4-e.length,s=0;s<o;s++)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 KJUR.crypto.MessageDigest({alg:this.mdAlgName})}catch(i){throw new Error("setAlgAndProvider hash alg set fail alg="+this.mdAlgName+"/"+i)}this.init=function(i,o){var s=null;try{o===void 0?s=KEYUTIL.getKey(i):s=KEYUTIL.getKey(i,o)}catch(u){throw"init failed:"+u}if(s.isPrivate===!0)this.prvKey=s,this.state="SIGN";else if(s.isPublic===!0)this.pubKey=s,this.state="VERIFY";else throw"init failed.:"+s},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 RSAKey&&this.pubkeyAlgName==="rsaandmgf1")return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,i,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof RSAKey&&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=KJUR.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=KEYUTIL.getKey(n.prvkeypem);this.init(t)}catch(e){throw"fatal error to load pem private key: "+e}}},KJUR.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 KEYUTIL=function(){var n=function(h,p,y){return r(CryptoJS.AES,h,p,y)},t=function(h,p,y){return r(CryptoJS.TripleDES,h,p,y)},e=function(h,p,y){return r(CryptoJS.DES,h,p,y)},r=function(h,p,y,m){var g=CryptoJS.enc.Hex.parse(p),E=CryptoJS.enc.Hex.parse(y),b=CryptoJS.enc.Hex.parse(m),T={};T.key=E,T.iv=b,T.ciphertext=g;var _=h.decrypt(T,E,{iv:b});return CryptoJS.enc.Hex.stringify(_)},i=function(h,p,y){return u(CryptoJS.AES,h,p,y)},o=function(h,p,y){return u(CryptoJS.TripleDES,h,p,y)},s=function(h,p,y){return u(CryptoJS.DES,h,p,y)},u=function(h,p,y,m){var g=CryptoJS.enc.Hex.parse(p),E=CryptoJS.enc.Hex.parse(y),b=CryptoJS.enc.Hex.parse(m),T=h.encrypt(g,E,{iv:b}),_=CryptoJS.enc.Hex.parse(T.toString()),S=CryptoJS.enc.Base64.stringify(_);return S},c={"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:o,keylen:24,ivlen:8},"DES-CBC":{proc:e,eproc:s,keylen:8,ivlen:8}},l=function(h){var p=CryptoJS.lib.WordArray.random(h),y=CryptoJS.enc.Hex.stringify(p);return y},d=function(h){var p={},y=h.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));y&&(p.cipher=y[1],p.ivsalt=y[2]);var m=h.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));m&&(p.type=m[1]);var g=-1,E=0;h.indexOf(`\r
348
348
  \r
349
349
  `)!=-1&&(g=h.indexOf(`\r
350
350
  \r
@@ -352,20 +352,20 @@
352
352
 
353
353
  `)!=-1&&(g=h.indexOf(`
354
354
 
355
- `),E=1);var b=h.indexOf("-----END");if(g!=-1&&b!=-1){var T=h.substring(g+E*2,b-E);T=T.replace(/\s+/g,""),p.data=T}return p},f=function(h,p,y){for(var v=y.substring(0,16),g=CryptoJS.enc.Hex.parse(v),E=CryptoJS.enc.Utf8.parse(p),b=l[h].keylen+l[h].ivlen,T="",_=null;;){var x=CryptoJS.algo.MD5.create();if(_!=null&&x.update(_),x.update(E),x.update(g),_=x.finalize(),T=T+CryptoJS.enc.Hex.stringify(_),T.length>=b*2)break}var R={};return R.keyhex=T.substr(0,l[h].keylen*2),R.ivhex=T.substr(l[h].keylen*2,l[h].ivlen*2),R},m=function(h,p,y,v){var g=CryptoJS.enc.Base64.parse(h),E=CryptoJS.enc.Hex.stringify(g),b=l[p].proc,T=b(E,y,v);return T},A=function(h,p,y,v){var g=l[p].eproc,E=g(h,y,v);return E};return{version:"1.0.0",parsePKCS5PEM:function(h){return d(h)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(h,p,y){return f(h,p,y)},decryptKeyB64:function(h,p,y,v){return m(h,p,y,v)},getDecryptedKeyHex:function(h,p){var y=d(h),v=y.cipher,g=y.ivsalt,E=y.data,b=f(v,p,g),T=b.keyhex,_=m(E,v,T,g);return _},getEncryptedPKCS5PEMFromPrvKeyHex:function(h,p,y,v,g){var w="";if((typeof v=="undefined"||v==null)&&(v="AES-256-CBC"),typeof l[v]=="undefined")throw"KEYUTIL unsupported algorithm: "+v;if(typeof g=="undefined"||g==null){var E=l[v].ivlen,b=c(E);g=b.toUpperCase()}var T=f(v,y,g),_=T.keyhex,x=A(p,v,_,g),R=x.replace(/(.{64})/g,`$1\r
356
- `),w="-----BEGIN "+h+` PRIVATE KEY-----\r
357
- `;return w+=`Proc-Type: 4,ENCRYPTED\r
358
- `,w+="DEK-Info: "+v+","+g+`\r
359
- `,w+=`\r
360
- `,w+=R,w+=`\r
355
+ `),E=1);var b=h.indexOf("-----END");if(g!=-1&&b!=-1){var T=h.substring(g+E*2,b-E);T=T.replace(/\s+/g,""),p.data=T}return p},f=function(h,p,y){for(var m=y.substring(0,16),g=CryptoJS.enc.Hex.parse(m),E=CryptoJS.enc.Utf8.parse(p),b=c[h].keylen+c[h].ivlen,T="",_=null;;){var S=CryptoJS.algo.MD5.create();if(_!=null&&S.update(_),S.update(E),S.update(g),_=S.finalize(),T=T+CryptoJS.enc.Hex.stringify(_),T.length>=b*2)break}var R={};return R.keyhex=T.substr(0,c[h].keylen*2),R.ivhex=T.substr(c[h].keylen*2,c[h].ivlen*2),R},v=function(h,p,y,m){var g=CryptoJS.enc.Base64.parse(h),E=CryptoJS.enc.Hex.stringify(g),b=c[p].proc,T=b(E,y,m);return T},A=function(h,p,y,m){var g=c[p].eproc,E=g(h,y,m);return E};return{version:"1.0.0",parsePKCS5PEM:function(h){return d(h)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(h,p,y){return f(h,p,y)},decryptKeyB64:function(h,p,y,m){return v(h,p,y,m)},getDecryptedKeyHex:function(h,p){var y=d(h),m=y.cipher,g=y.ivsalt,E=y.data,b=f(m,p,g),T=b.keyhex,_=v(E,m,T,g);return _},getEncryptedPKCS5PEMFromPrvKeyHex:function(h,p,y,m,g){var B="";if((typeof m=="undefined"||m==null)&&(m="AES-256-CBC"),typeof c[m]=="undefined")throw"KEYUTIL unsupported algorithm: "+m;if(typeof g=="undefined"||g==null){var E=c[m].ivlen,b=l(E);g=b.toUpperCase()}var T=f(m,y,g),_=T.keyhex,S=A(p,m,_,g),R=S.replace(/(.{64})/g,`$1\r
356
+ `),B="-----BEGIN "+h+` PRIVATE KEY-----\r
357
+ `;return B+=`Proc-Type: 4,ENCRYPTED\r
358
+ `,B+="DEK-Info: "+m+","+g+`\r
359
+ `,B+=`\r
360
+ `,B+=R,B+=`\r
361
361
  -----END `+h+` PRIVATE KEY-----\r
362
- `,w},parseHexOfEncryptedPKCS8:function(h){var p=ASN1HEX,y=p.getChildIdx,v=p.getV,g={},E=y(h,0);if(E.length!=2)throw"malformed format: SEQUENCE(0).items != 2: "+E.length;g.ciphertext=v(h,E[1]);var b=y(h,E[0]);if(b.length!=2)throw"malformed format: SEQUENCE(0.0).items != 2: "+b.length;if(v(h,b[0])!="2a864886f70d01050d")throw"this only supports pkcs5PBES2";var T=y(h,b[1]);if(b.length!=2)throw"malformed format: SEQUENCE(0.0.1).items != 2: "+T.length;var _=y(h,T[1]);if(_.length!=2)throw"malformed format: SEQUENCE(0.0.1.1).items != 2: "+_.length;if(v(h,_[0])!="2a864886f70d0307")throw"this only supports TripleDES";g.encryptionSchemeAlg="TripleDES",g.encryptionSchemeIV=v(h,_[1]);var x=y(h,T[0]);if(x.length!=2)throw"malformed format: SEQUENCE(0.0.1.0).items != 2: "+x.length;if(v(h,x[0])!="2a864886f70d01050c")throw"this only supports pkcs5PBKDF2";var R=y(h,x[1]);if(R.length<2)throw"malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+R.length;g.pbkdf2Salt=v(h,R[0]);var w=v(h,R[1]);try{g.pbkdf2Iter=parseInt(w,16)}catch(S){throw"malformed format pbkdf2Iter: "+w}return g},getPBKDF2KeyHexFromParam:function(h,p){var y=CryptoJS.enc.Hex.parse(h.pbkdf2Salt),v=h.pbkdf2Iter,g=CryptoJS.PBKDF2(p,y,{keySize:192/32,iterations:v}),E=CryptoJS.enc.Hex.stringify(g);return E},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(h,p){var y=pemtohex(h,"ENCRYPTED PRIVATE KEY"),v=this.parseHexOfEncryptedPKCS8(y),g=KEYUTIL.getPBKDF2KeyHexFromParam(v,p),E={};E.ciphertext=CryptoJS.enc.Hex.parse(v.ciphertext);var b=CryptoJS.enc.Hex.parse(g),T=CryptoJS.enc.Hex.parse(v.encryptionSchemeIV),_=CryptoJS.TripleDES.decrypt(E,b,{iv:T}),x=CryptoJS.enc.Hex.stringify(_);return x},getKeyFromEncryptedPKCS8PEM:function(h,p){var y=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(h,p),v=this.getKeyFromPlainPrivatePKCS8Hex(y);return v},parsePlainPrivatePKCS8Hex:function(h){var p=ASN1HEX,y=p.getChildIdx,v=p.getV,g={};if(g.algparam=null,h.substr(0,2)!="30")throw new Error("malformed plain PKCS8 private key(code:001)");var E=y(h,0);if(E.length<3)throw new Error("malformed plain PKCS8 private key(code:002)");if(h.substr(E[1],2)!="30")throw new Error("malformed PKCS8 private key(code:003)");var b=y(h,E[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=v(h,b[0]),h.substr(b[1],2)=="06"&&(g.algparam=v(h,b[1])),h.substr(E[2],2)!="04")throw new Error("malformed PKCS8 private key(code:006)");return g.keyidx=p.getVidx(h,E[2]),g},getKeyFromPlainPrivatePKCS8PEM:function(h){var p=pemtohex(h,"PRIVATE KEY"),y=this.getKeyFromPlainPrivatePKCS8Hex(p);return y},getKeyFromPlainPrivatePKCS8Hex:function(h){var p=this.parsePlainPrivatePKCS8Hex(h),y;if(p.algoid=="2a864886f70d010101")y=new RSAKey;else if(KJUR.crypto.DSA&&p.algoid=="2a8648ce380401")y=new KJUR.crypto.DSA;else if(KJUR.crypto.ECDSA&&p.algoid=="2a8648ce3d0201")y=new KJUR.crypto.ECDSA;else throw"unsupported private key algorithm";return y.readPKCS8PrvKeyHex(h),y},_getKeyFromPublicPKCS8Hex:function(h){var p,y=ASN1HEX.getVbyList(h,0,[0,0],"06");if(y==="2a864886f70d010101")p=new RSAKey;else if(KJUR.crypto.DSA&&y==="2a8648ce380401")p=new KJUR.crypto.DSA;else if(KJUR.crypto.ECDSA&&y==="2a8648ce3d0201")p=new KJUR.crypto.ECDSA;else throw"unsupported PKCS#8 public key hex";return p.readPKCS8PubKeyHex(h),p},parsePublicRawRSAKeyHex:function(h){var p=ASN1HEX,y=p.getChildIdx,v=p.getV,g={};if(h.substr(0,2)!="30")throw"malformed RSA key(code:001)";var E=y(h,0);if(E.length!=2)throw"malformed RSA key(code:002)";if(h.substr(E[0],2)!="02")throw"malformed RSA key(code:003)";if(g.n=v(h,E[0]),h.substr(E[1],2)!="02")throw"malformed RSA key(code:004)";return g.e=v(h,E[1]),g},parsePublicPKCS8Hex:function(h){var p=ASN1HEX,y=p.getChildIdx,v=p.getV,g={};g.algparam=null;var E=y(h,0);if(E.length!=2)throw"outer DERSequence shall have 2 elements: "+E.length;var b=E[0];if(h.substr(b,2)!="30")throw"malformed PKCS8 public key(code:001)";var T=y(h,b);if(T.length!=2)throw"malformed PKCS8 public key(code:002)";if(h.substr(T[0],2)!="06")throw"malformed PKCS8 public key(code:003)";if(g.algoid=v(h,T[0]),h.substr(T[1],2)=="06"?g.algparam=v(h,T[1]):h.substr(T[1],2)=="30"&&(g.algparam={},g.algparam.p=p.getVbyList(h,T[1],[0],"02"),g.algparam.q=p.getVbyList(h,T[1],[1],"02"),g.algparam.g=p.getVbyList(h,T[1],[2],"02")),h.substr(E[1],2)!="03")throw"malformed PKCS8 public key(code:004)";return g.key=v(h,E[1]).substr(2),g}}}();KEYUTIL.getKey=function(n,t,e){var r=ASN1HEX,i=r.getChildIdx;r.getV;var o=r.getVbyList,s=KJUR.crypto,u=s.ECDSA,l=s.DSA,c=RSAKey,d=pemtohex,f=KEYUTIL;if(typeof c!="undefined"&&n instanceof c||typeof u!="undefined"&&n instanceof u||typeof l!="undefined"&&n instanceof l)return n;if(n.curve!==void 0&&n.xy!==void 0&&n.d===void 0)return new u({pub:n.xy,curve:n.curve});if(n.curve!==void 0&&n.d!==void 0)return new u({prv:n.d,curve:n.curve});if(n.kty===void 0&&n.n!==void 0&&n.e!==void 0&&n.d===void 0){var m=new c;return m.setPublic(n.n,n.e),m}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 m=new c;return m.setPrivateEx(n.n,n.e,n.d,n.p,n.q,n.dp,n.dq,n.co),m}if(n.kty===void 0&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0&&n.p===void 0){var m=new c;return m.setPrivate(n.n,n.e,n.d),m}if(n.p!==void 0&&n.q!==void 0&&n.g!==void 0&&n.y!==void 0&&n.x===void 0){var m=new l;return m.setPublic(n.p,n.q,n.g,n.y),m}if(n.p!==void 0&&n.q!==void 0&&n.g!==void 0&&n.y!==void 0&&n.x!==void 0){var m=new l;return m.setPrivate(n.p,n.q,n.g,n.y,n.x),m}if(n.kty==="RSA"&&n.n!==void 0&&n.e!==void 0&&n.d===void 0){var m=new c;return m.setPublic(b64utohex(n.n),b64utohex(n.e)),m}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 m=new c;return m.setPrivateEx(b64utohex(n.n),b64utohex(n.e),b64utohex(n.d),b64utohex(n.p),b64utohex(n.q),b64utohex(n.dp),b64utohex(n.dq),b64utohex(n.qi)),m}if(n.kty==="RSA"&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0){var m=new c;return m.setPrivate(b64utohex(n.n),b64utohex(n.e),b64utohex(n.d)),m}if(n.kty==="EC"&&n.crv!==void 0&&n.x!==void 0&&n.y!==void 0&&n.d===void 0){var A=new u({curve:n.crv}),h=A.ecparams.keylen/4,p=("0000000000"+b64utohex(n.x)).slice(-h),y=("0000000000"+b64utohex(n.y)).slice(-h),v="04"+p+y;return A.setPublicKeyHex(v),A}if(n.kty==="EC"&&n.crv!==void 0&&n.x!==void 0&&n.y!==void 0&&n.d!==void 0){var A=new u({curve:n.crv}),h=A.ecparams.keylen/4,p=("0000000000"+b64utohex(n.x)).slice(-h),y=("0000000000"+b64utohex(n.y)).slice(-h),v="04"+p+y,g=("0000000000"+b64utohex(n.d)).slice(-h);return A.setPublicKeyHex(v),A.setPrivateKeyHex(g),A}if(e==="pkcs5prv"){var E=n,r=ASN1HEX,b,m;if(b=i(E,0),b.length===9)m=new c,m.readPKCS5PrvKeyHex(E);else if(b.length===6)m=new l,m.readPKCS5PrvKeyHex(E);else if(b.length>2&&E.substr(b[1],2)==="04")m=new u,m.readPKCS5PrvKeyHex(E);else throw"unsupported PKCS#1/5 hexadecimal key";return m}if(e==="pkcs8prv"){var m=f.getKeyFromPlainPrivatePKCS8Hex(n);return m}if(e==="pkcs8pub")return f._getKeyFromPublicPKCS8Hex(n);if(e==="x509pub")return X509.getPublicKeyFromCertHex(n);if(n.indexOf("-END CERTIFICATE-",0)!=-1||n.indexOf("-END X509 CERTIFICATE-",0)!=-1||n.indexOf("-END TRUSTED CERTIFICATE-",0)!=-1)return X509.getPublicKeyFromCertPEM(n);if(n.indexOf("-END PUBLIC KEY-")!=-1){var T=pemtohex(n,"PUBLIC KEY");return f._getKeyFromPublicPKCS8Hex(T)}if(n.indexOf("-END RSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var _=d(n,"RSA PRIVATE KEY");return f.getKey(_,null,"pkcs5prv")}if(n.indexOf("-END DSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var x=d(n,"DSA PRIVATE KEY"),R=o(x,0,[1],"02"),w=o(x,0,[2],"02"),S=o(x,0,[3],"02"),C=o(x,0,[4],"02"),I=o(x,0,[5],"02"),m=new l;return m.setPrivate(new BigInteger(R,16),new BigInteger(w,16),new BigInteger(S,16),new BigInteger(C,16),new BigInteger(I,16)),m}if(n.indexOf("-END EC PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var _=d(n,"EC PRIVATE KEY");return f.getKey(_,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 H=f.getDecryptedKeyHex(n,t),B=new RSAKey;return B.readPKCS5PrvKeyHex(H),B}if(n.indexOf("-END EC PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")!=-1){var x=f.getDecryptedKeyHex(n,t),m=o(x,0,[1],"04"),L=o(x,0,[2,0],"06"),O=o(x,0,[3,0],"03").substr(2),k="";if(KJUR.crypto.OID.oidhex2name[L]!==void 0)k=KJUR.crypto.OID.oidhex2name[L];else throw"undefined OID(hex) in KJUR.crypto.OID: "+L;var A=new u({curve:k});return A.setPublicKeyHex(O),A.setPrivateKeyHex(m),A.isPublic=!1,A}if(n.indexOf("-END DSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")!=-1){var x=f.getDecryptedKeyHex(n,t),R=o(x,0,[1],"02"),w=o(x,0,[2],"02"),S=o(x,0,[3],"02"),C=o(x,0,[4],"02"),I=o(x,0,[5],"02"),m=new l;return m.setPrivate(new BigInteger(R,16),new BigInteger(w,16),new BigInteger(S,16),new BigInteger(C,16),new BigInteger(I,16)),m}if(n.indexOf("-END ENCRYPTED PRIVATE KEY-")!=-1)return f.getKeyFromEncryptedPKCS8PEM(n,t);throw new Error("not supported argument")},(typeof KJUR.asn1=="undefined"||!KJUR.asn1)&&(KJUR.asn1={}),KJUR.asn1.ASN1Util={},KJUR.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,o="",s=2;s<n.length;s+=2){var u=parseInt(n.substr(s,2),16),l=("00000000"+u.toString(2)).slice(-8);if(o=o+l.substr(1,7),l.substr(0,1)=="0"){var c=new BigInteger(o,2);i=i+"."+c.toString(10),o=""}}return i};var ASN1HEX=new function(){};ASN1HEX.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},ASN1HEX.getL=function(n,t){var e=ASN1HEX.getLblen(n,t);return e<1?"":n.substr(t+2,e*2)},ASN1HEX.getVblen=function(n,t){var e,r;return e=ASN1HEX.getL(n,t),e==""?-1:(e.substr(0,1)==="8"?r=new BigInteger(e.substr(2),16):r=new BigInteger(e,16),r.intValue())},ASN1HEX.getVidx=function(n,t){var e=ASN1HEX.getLblen(n,t);return e<0?e:t+(e+1)*2},ASN1HEX.getV=function(n,t){var e=ASN1HEX.getVidx(n,t),r=ASN1HEX.getVblen(n,t);return n.substr(e,r*2)},ASN1HEX.getTLV=function(n,t){return n.substr(t,2)+ASN1HEX.getL(n,t)+ASN1HEX.getV(n,t)},ASN1HEX.getTLVblen=function(n,t){return 2+ASN1HEX.getLblen(n,t)*2+ASN1HEX.getVblen(n,t)*2},ASN1HEX.getNextSiblingIdx=function(n,t){var e=ASN1HEX.getVidx(n,t),r=ASN1HEX.getVblen(n,t);return e+r*2},ASN1HEX.getChildIdx=function(n,t){var e=ASN1HEX,r=[],i,o,s;i=e.getVidx(n,t),o=e.getVblen(n,t)*2,n.substr(t,2)=="03"&&(i+=2,o-=2),s=0;for(var u=i;s<=o;){var l=e.getTLVblen(n,u);if(s+=l,s<=o&&r.push(u),u+=l,s>=o)break}return r},ASN1HEX.getNthChildIdx=function(n,t,e){var r=ASN1HEX.getChildIdx(n,t);return r[e]},ASN1HEX.getIdxbyList=function(n,t,e,r){var i=ASN1HEX,o,s;return e.length==0?r!==void 0&&n.substr(t,2)!==r?-1:t:(o=e.shift(),s=i.getChildIdx(n,t),o>=s.length?-1:i.getIdxbyList(n,s[o],e,r))},ASN1HEX.getIdxbyListEx=function(n,t,e,r){var i=ASN1HEX,o,s;if(e.length==0)return r!==void 0&&n.substr(t,2)!==r?-1:t;o=e.shift(),s=i.getChildIdx(n,t);for(var u=0,l=0;l<s.length;l++){var c=n.substr(s[l],2);if(typeof o=="number"&&!i.isContextTag(c)&&u==o||typeof o=="string"&&i.isContextTag(c,o))return i.getIdxbyListEx(n,s[l],e,r);i.isContextTag(c)||u++}return-1},ASN1HEX.getTLVbyList=function(n,t,e,r){var i=ASN1HEX,o=i.getIdxbyList(n,t,e,r);return o==-1||o>=n.length?null:i.getTLV(n,o)},ASN1HEX.getTLVbyListEx=function(n,t,e,r){var i=ASN1HEX,o=i.getIdxbyListEx(n,t,e,r);return o==-1?null:i.getTLV(n,o)},ASN1HEX.getVbyList=function(n,t,e,r,i){var o=ASN1HEX,s,u;return s=o.getIdxbyList(n,t,e,r),s==-1||s>=n.length?null:(u=o.getV(n,s),i===!0&&(u=u.substr(2)),u)},ASN1HEX.getVbyListEx=function(n,t,e,r,i){var o=ASN1HEX,s,u;return s=o.getIdxbyListEx(n,t,e,r),s==-1?null:(u=o.getV(n,s),n.substr(s,2)=="03"&&i!==!1&&(u=u.substr(2)),u)},ASN1HEX.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=ASN1HEX.getV(n,t);return r=="02"?parseInt(i,16):bitstrtoint(i)}catch(o){return e}},ASN1HEX.getOID=function(n,t,e){e==null&&(e=null);try{if(n.substr(t,2)!="06")return e;var r=ASN1HEX.getV(n,t);return hextooid(r)}catch(i){return e}},ASN1HEX.getOIDName=function(n,t,e){e==null&&(e=null);try{var r=ASN1HEX.getOID(n,t,e);if(r==e)return e;var i=KJUR.asn1.x509.OID.oid2name(r);return i==""?r:i}catch(o){return e}},ASN1HEX.getString=function(n,t,e){e==null&&(e=null);try{var r=ASN1HEX.getV(n,t);return hextorstr(r)}catch(i){return e}},ASN1HEX.hextooidstr=function(n){var t=function(f,m){return f.length>=m?f:new Array(m-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 o=n.substr(2),s=[],u=0;u<o.length/2;u++)s.push(parseInt(o.substr(u*2,2),16));for(var l=[],c="",u=0;u<s.length;u++)s[u]&128?c=c+t((s[u]&127).toString(2),7):(c=c+t((s[u]&127).toString(2),7),l.push(new String(parseInt(c,2))),c="");var d=e.join(".");return l.length>0&&(d=d+"."+l.join(".")),d},ASN1HEX.isContextTag=function(n,t){n=n.toLowerCase();var e,r;try{e=parseInt(n,16)}catch(o){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(o){return!1}},ASN1HEX.isASN1HEX=function(n){var t=ASN1HEX;if(n.length%2==1)return!1;var e=t.getVblen(n,0),r=n.substr(0,2),i=t.getL(n,0),o=n.length-r.length-i.length;return o==e*2},ASN1HEX.checkStrictDER=function(n,t,e,r,i){var o=ASN1HEX;if(e===void 0){if(typeof n!="string")throw new Error("not hex string");if(n=n.toLowerCase(),!KJUR.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 s=o.getL(n,t);if(s.length>i*2)throw new Error("L of TLV too long: idx="+t);var u=o.getVblen(n,t);if(u>r)throw new Error("value of L too long than hex: idx="+t);var l=o.getTLV(n,t),c=l.length-2-o.getL(n,t).length;if(c!==u*2)throw new Error("V string length and L's value not the same:"+c+"/"+u*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=o.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 m=o.getVblen(n,t),A=0,h=o.getChildIdx(n,t),p=0;p<h.length;p++){var y=o.getTLV(n,h[p]);A+=y.length,o.checkStrictDER(n,h[p],e,r,i)}if(m*2!=A)throw new Error("sum of children's TLV length and L unmatch: "+m*2+"!="+A)}},ASN1HEX.oidname=function(n){var t=KJUR.asn1;KJUR.lang.String.isHex(n)&&(n=t.ASN1Util.oidHexToInt(n));var e=t.x509.OID.oid2name(n);return e===""&&(e=n),e},(typeof KJUR.asn1=="undefined"||!KJUR.asn1)&&(KJUR.asn1={}),(typeof KJUR.asn1.x509=="undefined"||!KJUR.asn1.x509)&&(KJUR.asn1.x509={}),KJUR.asn1.x509.AlgorithmIdentifier={},KJUR.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"},KJUR.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 KJUR.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 KJUR.asn1.DERObjectIdentifier({oid:e});return this.objCache[t]=r,r}},KJUR.asn1.x509.OID.oid2name=function(n){var t=KJUR.asn1.x509.OID.name2oidList;for(var e in t)if(t[e]==n)return e;return""},KJUR.asn1.x509.OID.oid2atype=function(n){var t=KJUR.asn1.x509.OID.atype2oidList;for(var e in t)if(t[e]==n)return e;return n},KJUR.asn1.x509.OID.name2oid=function(n){if(n.match(/^[0-9.]+$/))return n;var t=KJUR.asn1.x509.OID.name2oidList;return t[n]===void 0?"":t[n]},RSAKey.getPosArrayOfChildrenFromHex=function(n){return ASN1HEX.getChildIdx(n,0)},RSAKey.getHexValueArrayOfChildrenFromHex=function(n){var t=ASN1HEX,e=t.getV,m=RSAKey.getPosArrayOfChildrenFromHex(n),r=e(n,m[0]),i=e(n,m[1]),o=e(n,m[2]),s=e(n,m[3]),u=e(n,m[4]),l=e(n,m[5]),c=e(n,m[6]),d=e(n,m[7]),f=e(n,m[8]),m=new Array;return m.push(r,i,o,s,u,l,c,d,f),m},RSAKey.prototype.readPrivateKeyFromPEMString=function(n){var t=pemtohex(n),e=RSAKey.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},RSAKey.prototype.readPKCS5PrvKeyHex=function(n){var t=RSAKey.getHexValueArrayOfChildrenFromHex(n);this.setPrivateEx(t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},RSAKey.prototype.readPKCS8PrvKeyHex=function(n){var t,e,r,i,o,s,u,l,c=ASN1HEX,d=c.getVbyListEx;if(c.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"),o=d(n,0,[2,0,5],"02"),s=d(n,0,[2,0,6],"02"),u=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,o,s,u,l)},RSAKey.prototype.readPKCS5PubKeyHex=function(n){var t=ASN1HEX,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]),o=e(n,r[1]);this.setPublic(i,o)},RSAKey.prototype.readPKCS8PubKeyHex=function(n){var t=ASN1HEX;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)},RSAKey.prototype.readCertPubKeyHex=function(n,t){var e,r;e=new X509,e.readCertHex(n),r=e.getPublicKeyHex(),this.readPKCS8PubKeyHex(r)};function _rsasign_getAlgNameAndHashFromHexDisgestInfo(n){for(var t in KJUR.crypto.Util.DIGESTINFOHEAD){var e=KJUR.crypto.Util.DIGESTINFOHEAD[t],r=e.length;if(n.substring(0,r)==e){var i=[t,n.substring(r)];return i}}return[]}RSAKey.prototype.verify=function(n,t){if(t=t.toLowerCase(),t.match(/^[0-9a-f]+$/)==null)return!1;var e=parseBigInt(t,16),r=this.n.bitLength();if(e.bitLength()>r)return!1;var i=this.doPublic(e),o=i.toString(16);if(o.length+3!=r/4)return!1;var s=o.replace(/^1f+00/,""),u=_rsasign_getAlgNameAndHashFromHexDisgestInfo(s);if(u.length==0)return!1;var l=u[0],c=u[1],d=function(m){return KJUR.crypto.Util.hashString(m,l)},f=d(n);return c==f},RSAKey.prototype.verifyWithMessageHash=function(n,t){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var e=parseBigInt(t,16);if(e.bitLength()>this.n.bitLength())return 0;var r=this.doPublic(e),i=r.toString(16).replace(/^1f+00/,""),o=_rsasign_getAlgNameAndHashFromHexDisgestInfo(i);if(o.length==0)return!1;o[0];var s=o[1];return s==n},RSAKey.prototype.verifyPSS=function(n,t,e,r){var i=function(s){return KJUR.crypto.Util.hashHex(s,e)},o=i(rstrtohex(n));return r===void 0&&(r=-1),this.verifyWithMessageHashPSS(o,t,e,r)},RSAKey.prototype.verifyWithMessageHashPSS=function(n,t,e,r){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var i=new BigInteger(t,16),o=function(g){return KJUR.crypto.Util.hashHex(g,e)},s=hextorstr(n),u=s.length,l=this.n.bitLength()-1,c=Math.ceil(l/8),d;if(r===-1||r===void 0)r=u;else if(r===-2)r=c-u-2;else if(r<-2)throw new Error("invalid salt length");if(c<u+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<c;)f.unshift(0);if(f[c-1]!==188)throw new Error("encoded message does not end in 0xbc");f=String.fromCharCode.apply(String,f);var m=f.substr(0,c-u-1),A=f.substr(m.length,u),h=65280>>8*c-l&255;if(m.charCodeAt(0)&h)throw new Error("bits beyond keysize not zero");var p=pss_mgf1_str(A,m.length,o),y=[];for(d=0;d<m.length;d+=1)y[d]=m.charCodeAt(d)^p.charCodeAt(d);y[0]&=~h;var v=c-u-r-2;for(d=0;d<v;d+=1)if(y[d]!==0)throw new Error("leftmost octets not zero");if(y[v]!==1)throw new Error("0x01 marker not found");return A===hextorstr(o(rstrtohex("\0\0\0\0\0\0\0\0"+s+String.fromCharCode.apply(String,y.slice(-r)))))},RSAKey.SALT_LEN_HLEN=-1,RSAKey.SALT_LEN_MAX=-2,RSAKey.SALT_LEN_RECOVER=-2;function X509(n){var t=ASN1HEX,e=t.getChildIdx,r=t.getV,i=t.getTLV,o=t.getVbyList,s=t.getVbyListEx,u=t.getTLVbyList,l=t.getTLVbyListEx,c=t.getIdxbyList,d=t.getIdxbyListEx,f=t.getVidx,m=t.getInt,A=t.oidname,h=t.hextooidstr,p=pemtohex,y;try{y=KJUR.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch(v){}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 v=u(this.hex,0,[0,0]);if(v.substr(0,2)=="a0"){var g=u(v,0,[0]),E=m(g,0);if(E<0||2<E)throw new Error("malformed version field");return this.version=E+1,this.version}else return this.version=1,this.foffset=-1,1},this.getSerialNumberHex=function(){return s(this.hex,0,[0,0],"02")},this.getSignatureAlgorithmField=function(){var v=l(this.hex,0,[0,1]);return this.getAlgorithmIdentifierName(v)},this.getAlgorithmIdentifierName=function(v){for(var g in y)if(v===y[g])return g;return A(s(v,0,[0],"06"))},this.getIssuer=function(){return this.getX500Name(this.getIssuerHex())},this.getIssuerHex=function(){return u(this.hex,0,[0,3+this.foffset],"30")},this.getIssuerString=function(){var v=this.getIssuer();return v.str},this.getSubject=function(){return this.getX500Name(this.getSubjectHex())},this.getSubjectHex=function(){return u(this.hex,0,[0,5+this.foffset],"30")},this.getSubjectString=function(){var v=this.getSubject();return v.str},this.getNotBefore=function(){var v=o(this.hex,0,[0,4+this.foffset,0]);return v=v.replace(/(..)/g,"%$1"),v=decodeURIComponent(v),v},this.getNotAfter=function(){var v=o(this.hex,0,[0,4+this.foffset,1]);return v=v.replace(/(..)/g,"%$1"),v=decodeURIComponent(v),v},this.getPublicKeyHex=function(){return t.getTLVbyList(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyIdx=function(){return c(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyContentIdx=function(){var v=this.getPublicKeyIdx();return c(this.hex,v,[1,0],"30")},this.getPublicKey=function(){return KEYUTIL.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var v=u(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(v)},this.getSignatureValueHex=function(){return o(this.hex,0,[2],"03",!0)},this.verifySignature=function(v){var g=this.getSignatureAlgorithmField(),E=this.getSignatureValueHex(),b=u(this.hex,0,[0],"30"),T=new KJUR.crypto.Signature({alg:g});return T.init(v),T.updateHex(b),T.verify(E)},this.parseExt=function(v){var g,E,b;if(v===void 0){if(b=this.hex,this.version!==3)return-1;g=c(b,0,[0,7,0],"30"),E=e(b,g)}else{b=pemtohex(v);var T=c(b,0,[0,3,0,0],"06");if(r(b,T)!="2a864886f70d01090e"){this.aExtInfo=new Array;return}g=c(b,0,[0,3,0,1,0],"30"),E=e(b,g),this.hex=b}this.aExtInfo=new Array;for(var _=0;_<E.length;_++){var x={};x.critical=!1;var R=e(b,E[_]),w=0;R.length===3&&(x.critical=!0,w=1),x.oid=t.hextooidstr(o(b,E[_],[0],"06"));var S=c(b,E[_],[1+w]);x.vidx=f(b,S),this.aExtInfo.push(x)}},this.getExtInfo=function(v){var g=this.aExtInfo,E=v;if(v.match(/^[0-9.]+$/)||(E=KJUR.asn1.x509.OID.name2oid(v)),E!==""){for(var b=0;b<g.length;b++)if(g[b].oid===E)return g[b]}},this.getExtBasicConstraints=function(v,g){if(v===void 0&&g===void 0){var E=this.getExtInfo("basicConstraints");if(E===void 0)return;v=i(this.hex,E.vidx),g=E.critical}var b={extname:"basicConstraints"};if(g&&(b.critical=!0),v==="3000")return b;if(v==="30030101ff")return b.cA=!0,b;if(v.substr(0,12)==="30060101ff02"){var T=r(v,10),_=parseInt(T,16);return b.cA=!0,b.pathLen=_,b}throw new Error("hExtV parse error: "+v)},this.getExtKeyUsage=function(v,g){if(v===void 0&&g===void 0){var E=this.getExtInfo("keyUsage");if(E===void 0)return;v=i(this.hex,E.vidx),g=E.critical}var b={extname:"keyUsage"};return g&&(b.critical=!0),b.names=this.getExtKeyUsageString(v).split(","),b},this.getExtKeyUsageBin=function(v){if(v===void 0){var g=this.getExtInfo("keyUsage");if(g===void 0)return"";v=i(this.hex,g.vidx)}if(v.length!=8&&v.length!=10)throw new Error("malformed key usage value: "+v);var E="000000000000000"+parseInt(v.substr(6),16).toString(2);return v.length==8&&(E=E.slice(-8)),v.length==10&&(E=E.slice(-16)),E=E.replace(/0+$/,""),E==""&&(E="0"),E},this.getExtKeyUsageString=function(v){for(var g=this.getExtKeyUsageBin(v),E=new Array,b=0;b<g.length;b++)g.substr(b,1)=="1"&&E.push(X509.KEYUSAGE_NAME[b]);return E.join(",")},this.getExtSubjectKeyIdentifier=function(v,g){if(v===void 0&&g===void 0){var E=this.getExtInfo("subjectKeyIdentifier");if(E===void 0)return;v=i(this.hex,E.vidx),g=E.critical}var b={extname:"subjectKeyIdentifier"};g&&(b.critical=!0);var T=r(v,0);return b.kid={hex:T},b},this.getExtAuthorityKeyIdentifier=function(v,g){if(v===void 0&&g===void 0){var E=this.getExtInfo("authorityKeyIdentifier");if(E===void 0)return;v=i(this.hex,E.vidx),g=E.critical}var b={extname:"authorityKeyIdentifier"};g&&(b.critical=!0);for(var T=e(v,0),_=0;_<T.length;_++){var x=v.substr(T[_],2);if(x==="80"&&(b.kid={hex:r(v,T[_])}),x==="a1"){var R=i(v,T[_]),w=this.getGeneralNames(R);b.issuer=w[0].dn}x==="82"&&(b.sn={hex:r(v,T[_])})}return b},this.getExtExtKeyUsage=function(v,g){if(v===void 0&&g===void 0){var E=this.getExtInfo("extKeyUsage");if(E===void 0)return;v=i(this.hex,E.vidx),g=E.critical}var b={extname:"extKeyUsage",array:[]};g&&(b.critical=!0);for(var T=e(v,0),_=0;_<T.length;_++)b.array.push(A(r(v,T[_])));return b},this.getExtExtKeyUsageName=function(){var v=this.getExtInfo("extKeyUsage");if(v===void 0)return v;var g=new Array,E=i(this.hex,v.vidx);if(E==="")return g;for(var b=e(E,0),T=0;T<b.length;T++)g.push(A(r(E,b[T])));return g},this.getExtSubjectAltName=function(v,g){if(v===void 0&&g===void 0){var E=this.getExtInfo("subjectAltName");if(E===void 0)return;v=i(this.hex,E.vidx),g=E.critical}var b={extname:"subjectAltName",array:[]};return g&&(b.critical=!0),b.array=this.getGeneralNames(v),b},this.getExtIssuerAltName=function(v,g){if(v===void 0&&g===void 0){var E=this.getExtInfo("issuerAltName");if(E===void 0)return;v=i(this.hex,E.vidx),g=E.critical}var b={extname:"issuerAltName",array:[]};return g&&(b.critical=!0),b.array=this.getGeneralNames(v),b},this.getGeneralNames=function(v){for(var g=e(v,0),E=[],b=0;b<g.length;b++){var T=this.getGeneralName(i(v,g[b]));T!==void 0&&E.push(T)}return E},this.getGeneralName=function(v){var g=v.substr(0,2),E=r(v,0),b=hextorstr(E);if(g=="81")return{rfc822:b};if(g=="82")return{dns:b};if(g=="86")return{uri:b};if(g=="87")return{ip:hextoip(E)};if(g=="a4")return{dn:this.getX500Name(E)}},this.getExtSubjectAltName2=function(){var v,g,E,b=this.getExtInfo("subjectAltName");if(b===void 0)return b;for(var T=new Array,_=i(this.hex,b.vidx),x=e(_,0),R=0;R<x.length;R++)E=_.substr(x[R],2),v=r(_,x[R]),E==="81"&&(g=hextoutf8(v),T.push(["MAIL",g])),E==="82"&&(g=hextoutf8(v),T.push(["DNS",g])),E==="84"&&(g=X509.hex2dn(v,0),T.push(["DN",g])),E==="86"&&(g=hextoutf8(v),T.push(["URI",g])),E==="87"&&(g=hextoip(v),T.push(["IP",g]));return T},this.getExtCRLDistributionPoints=function(v,g){if(v===void 0&&g===void 0){var E=this.getExtInfo("cRLDistributionPoints");if(E===void 0)return;v=i(this.hex,E.vidx),g=E.critical}var b={extname:"cRLDistributionPoints",array:[]};g&&(b.critical=!0);for(var T=e(v,0),_=0;_<T.length;_++){var x=i(v,T[_]);b.array.push(this.getDistributionPoint(x))}return b},this.getDistributionPoint=function(v){for(var g={},E=e(v,0),b=0;b<E.length;b++){var T=v.substr(E[b],2),_=i(v,E[b]);T=="a0"&&(g.dpname=this.getDistributionPointName(_))}return g},this.getDistributionPointName=function(v){for(var g={},E=e(v,0),b=0;b<E.length;b++){var T=v.substr(E[b],2),_=i(v,E[b]);T=="a0"&&(g.full=this.getGeneralNames(_))}return g},this.getExtCRLDistributionPointsURI=function(){var v=this.getExtInfo("cRLDistributionPoints");if(v===void 0)return v;for(var g=new Array,E=e(this.hex,v.vidx),b=0;b<E.length;b++)try{var T=o(this.hex,E[b],[0,0,0],"86"),_=hextoutf8(T);g.push(_)}catch(x){}return g},this.getExtAIAInfo=function(){var v=this.getExtInfo("authorityInfoAccess");if(v===void 0)return v;for(var g={ocsp:[],caissuer:[]},E=e(this.hex,v.vidx),b=0;b<E.length;b++){var T=o(this.hex,E[b],[0],"06"),_=o(this.hex,E[b],[1],"86");T==="2b06010505073001"&&g.ocsp.push(hextoutf8(_)),T==="2b06010505073002"&&g.caissuer.push(hextoutf8(_))}return g},this.getExtAuthorityInfoAccess=function(v,g){if(v===void 0&&g===void 0){var E=this.getExtInfo("authorityInfoAccess");if(E===void 0)return;v=i(this.hex,E.vidx),g=E.critical}var b={extname:"authorityInfoAccess",array:[]};g&&(b.critical=!0);for(var T=e(v,0),_=0;_<T.length;_++){var x=s(v,T[_],[0],"06"),R=o(v,T[_],[1],"86"),w=hextoutf8(R);if(x=="2b06010505073001")b.array.push({ocsp:w});else if(x=="2b06010505073002")b.array.push({caissuer:w});else throw new Error("unknown method: "+x)}return b},this.getExtCertificatePolicies=function(v,g){if(v===void 0&&g===void 0){var E=this.getExtInfo("certificatePolicies");if(E===void 0)return;v=i(this.hex,E.vidx),g=E.critical}var b={extname:"certificatePolicies",array:[]};g&&(b.critical=!0);for(var T=e(v,0),_=0;_<T.length;_++){var x=i(v,T[_]),R=this.getPolicyInformation(x);b.array.push(R)}return b},this.getPolicyInformation=function(v){var g={},E=o(v,0,[0],"06");g.policyoid=A(E);var b=d(v,0,[1],"30");if(b!=-1){g.array=[];for(var T=e(v,b),_=0;_<T.length;_++){var x=i(v,T[_]),R=this.getPolicyQualifierInfo(x);g.array.push(R)}}return g},this.getPolicyQualifierInfo=function(v){var g={},E=o(v,0,[0],"06");if(E==="2b06010505070201"){var b=s(v,0,[1],"16");g.cps=hextorstr(b)}else if(E==="2b06010505070202"){var T=u(v,0,[1],"30");g.unotice=this.getUserNotice(T)}return g},this.getUserNotice=function(v){for(var g={},E=e(v,0),b=0;b<E.length;b++){var T=i(v,E[b]);T.substr(0,2)!="30"&&(g.exptext=this.getDisplayText(T))}return g},this.getDisplayText=function(v){var g={"0c":"utf8",16:"ia5","1a":"vis","1e":"bmp"},E={};return E.type=g[v.substr(0,2)],E.str=hextorstr(r(v,0)),E},this.getExtCRLNumber=function(v,g){var E={extname:"cRLNumber"};if(g&&(E.critical=!0),v.substr(0,2)=="02")return E.num={hex:r(v,0)},E;throw new Error("hExtV parse error: "+v)},this.getExtCRLReason=function(v,g){var E={extname:"cRLReason"};if(g&&(E.critical=!0),v.substr(0,2)=="0a")return E.code=parseInt(r(v,0),16),E;throw new Error("hExtV parse error: "+v)},this.getExtOcspNonce=function(v,g){var E={extname:"ocspNonce"};g&&(E.critical=!0);var b=r(v,0);return E.hex=b,E},this.getExtOcspNoCheck=function(v,g){var E={extname:"ocspNoCheck"};return g&&(E.critical=!0),E},this.getExtAdobeTimeStamp=function(v,g){if(v===void 0&&g===void 0){var E=this.getExtInfo("adobeTimeStamp");if(E===void 0)return;v=i(this.hex,E.vidx),g=E.critical}var b={extname:"adobeTimeStamp"};g&&(b.critical=!0);var T=e(v,0);if(T.length>1){var _=i(v,T[1]),x=this.getGeneralName(_);x.uri!=null&&(b.uri=x.uri)}if(T.length>2){var R=i(v,T[2]);R=="0101ff"&&(b.reqauth=!0),R=="010100"&&(b.reqauth=!1)}return b},this.getX500NameRule=function(v){for(var g=null,E=[],b=0;b<v.length;b++)for(var T=v[b],_=0;_<T.length;_++)E.push(T[_]);for(var b=0;b<E.length;b++){var x=E[b],R=x.ds,w=x.value,S=x.type;if(R!="prn"&&R!="utf8"&&R!="ia5")return"mixed";if(R=="ia5"){if(S!="CN")return"mixed";if(KJUR.lang.String.isMail(w))continue;return"mixed"}if(S=="C"){if(R=="prn")continue;return"mixed"}if(g==null)g=R;else if(g!==R)return"mixed"}return g==null?"prn":g},this.getX500Name=function(v){var g=this.getX500NameArray(v),E=this.dnarraytostr(g);return{array:g,str:E}},this.getX500NameArray=function(v){for(var g=[],E=e(v,0),b=0;b<E.length;b++)g.push(this.getRDN(i(v,E[b])));return g},this.getRDN=function(v){for(var g=[],E=e(v,0),b=0;b<E.length;b++)g.push(this.getAttrTypeAndValue(i(v,E[b])));return g},this.getAttrTypeAndValue=function(v){var g={type:null,value:null,ds:null},E=e(v,0),b=o(v,E[0],[],"06"),T=o(v,E[1],[]),_=KJUR.asn1.ASN1Util.oidHexToInt(b);return g.type=KJUR.asn1.x509.OID.oid2atype(_),g.ds=this.HEX2STAG[v.substr(E[1],2)],g.ds!="bmp"?g.value=hextoutf8(T):g.value=ucs2hextoutf8(T),g},this.readCertPEM=function(v){this.readCertHex(p(v))},this.readCertHex=function(v){this.hex=v,this.getVersion();try{c(this.hex,0,[0,7],"a3"),this.parseExt()}catch(g){}},this.getParam=function(){var v={};return v.version=this.getVersion(),v.serial={hex:this.getSerialNumberHex()},v.sigalg=this.getSignatureAlgorithmField(),v.issuer=this.getIssuer(),v.notbefore=this.getNotBefore(),v.notafter=this.getNotAfter(),v.subject=this.getSubject(),v.sbjpubkey=hextopem(this.getPublicKeyHex(),"PUBLIC KEY"),this.aExtInfo.length>0&&(v.ext=this.getExtParamArray()),v.sighex=this.getSignatureValueHex(),v},this.getExtParamArray=function(v){if(v==null){var g=d(this.hex,0,[0,"[3]"]);g!=-1&&(v=l(this.hex,0,[0,"[3]",0],"30"))}for(var E=[],b=e(v,0),T=0;T<b.length;T++){var _=i(v,b[T]),x=this.getExtParam(_);x!=null&&E.push(x)}return E},this.getExtParam=function(v){var g=e(v,0),E=g.length;if(E!=2&&E!=3)throw new Error("wrong number elements in Extension: "+E+" "+v);var b=h(o(v,0,[0],"06")),T=!1;E==3&&u(v,0,[1])=="0101ff"&&(T=!0);var _=u(v,0,[E-1,0]),x=void 0;if(b=="2.5.29.14"?x=this.getExtSubjectKeyIdentifier(_,T):b=="2.5.29.15"?x=this.getExtKeyUsage(_,T):b=="2.5.29.17"?x=this.getExtSubjectAltName(_,T):b=="2.5.29.18"?x=this.getExtIssuerAltName(_,T):b=="2.5.29.19"?x=this.getExtBasicConstraints(_,T):b=="2.5.29.31"?x=this.getExtCRLDistributionPoints(_,T):b=="2.5.29.32"?x=this.getExtCertificatePolicies(_,T):b=="2.5.29.35"?x=this.getExtAuthorityKeyIdentifier(_,T):b=="2.5.29.37"?x=this.getExtExtKeyUsage(_,T):b=="1.3.6.1.5.5.7.1.1"?x=this.getExtAuthorityInfoAccess(_,T):b=="2.5.29.20"?x=this.getExtCRLNumber(_,T):b=="2.5.29.21"?x=this.getExtCRLReason(_,T):b=="1.3.6.1.5.5.7.48.1.2"?x=this.getExtOcspNonce(_,T):b=="1.3.6.1.5.5.7.48.1.5"?x=this.getExtOcspNoCheck(_,T):b=="1.2.840.113583.1.1.9.1"&&(x=this.getExtAdobeTimeStamp(_,T)),x!=null)return x;var R={extname:b,extn:_};return T&&(R.critical=!0),R},this.findExt=function(v,g){for(var E=0;E<v.length;E++)if(v[E].extname==g)return v[E];return null},this.dnarraytostr=function(v){function g(b){return b.map(function(T){return E(T).replace(/\+/,"\\+")}).join("+")}function E(b){return b.type+"="+b.value}return"/"+v.map(function(b){return g(b).replace(/\//,"\\/")}).join("/")},this.getInfo=function(){var v=function(K){var z=JSON.stringify(K.array).replace(/[\[\]\{\}\"]/g,"");return z},g=function(K){for(var z="",N=K.array,U=0;U<N.length;U++){var Q=N[U];if(z+=" policy oid: "+Q.policyoid+`
363
- `,Q.array!==void 0)for(var G=0;G<Q.array.length;G++){var q=Q.array[G];q.cps!==void 0&&(z+=" cps: "+q.cps+`
364
- `)}}return z},E=function(K){for(var z="",N=K.array,U=0;U<N.length;U++){var Q=N[U];try{Q.dpname.full[0].uri!==void 0&&(z+=" "+Q.dpname.full[0].uri+`
365
- `)}catch(G){}try{Q.dname.full[0].dn.hex!==void 0&&(z+=" "+X509.hex2dn(Q.dpname.full[0].dn.hex)+`
366
- `)}catch(G){}}return z},b=function(K){for(var z="",N=K.array,U=0;U<N.length;U++){var Q=N[U];Q.caissuer!==void 0&&(z+=" caissuer: "+Q.caissuer+`
367
- `),Q.ocsp!==void 0&&(z+=" ocsp: "+Q.ocsp+`
368
- `)}return z},T,_,x;if(T=`Basic Fields
362
+ `,B},parseHexOfEncryptedPKCS8:function(h){var p=ASN1HEX,y=p.getChildIdx,m=p.getV,g={},E=y(h,0);if(E.length!=2)throw"malformed format: SEQUENCE(0).items != 2: "+E.length;g.ciphertext=m(h,E[1]);var b=y(h,E[0]);if(b.length!=2)throw"malformed format: SEQUENCE(0.0).items != 2: "+b.length;if(m(h,b[0])!="2a864886f70d01050d")throw"this only supports pkcs5PBES2";var T=y(h,b[1]);if(b.length!=2)throw"malformed format: SEQUENCE(0.0.1).items != 2: "+T.length;var _=y(h,T[1]);if(_.length!=2)throw"malformed format: SEQUENCE(0.0.1.1).items != 2: "+_.length;if(m(h,_[0])!="2a864886f70d0307")throw"this only supports TripleDES";g.encryptionSchemeAlg="TripleDES",g.encryptionSchemeIV=m(h,_[1]);var S=y(h,T[0]);if(S.length!=2)throw"malformed format: SEQUENCE(0.0.1.0).items != 2: "+S.length;if(m(h,S[0])!="2a864886f70d01050c")throw"this only supports pkcs5PBKDF2";var R=y(h,S[1]);if(R.length<2)throw"malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+R.length;g.pbkdf2Salt=m(h,R[0]);var B=m(h,R[1]);try{g.pbkdf2Iter=parseInt(B,16)}catch(I){throw"malformed format pbkdf2Iter: "+B}return g},getPBKDF2KeyHexFromParam:function(h,p){var y=CryptoJS.enc.Hex.parse(h.pbkdf2Salt),m=h.pbkdf2Iter,g=CryptoJS.PBKDF2(p,y,{keySize:192/32,iterations:m}),E=CryptoJS.enc.Hex.stringify(g);return E},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(h,p){var y=pemtohex(h,"ENCRYPTED PRIVATE KEY"),m=this.parseHexOfEncryptedPKCS8(y),g=KEYUTIL.getPBKDF2KeyHexFromParam(m,p),E={};E.ciphertext=CryptoJS.enc.Hex.parse(m.ciphertext);var b=CryptoJS.enc.Hex.parse(g),T=CryptoJS.enc.Hex.parse(m.encryptionSchemeIV),_=CryptoJS.TripleDES.decrypt(E,b,{iv:T}),S=CryptoJS.enc.Hex.stringify(_);return S},getKeyFromEncryptedPKCS8PEM:function(h,p){var y=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(h,p),m=this.getKeyFromPlainPrivatePKCS8Hex(y);return m},parsePlainPrivatePKCS8Hex:function(h){var p=ASN1HEX,y=p.getChildIdx,m=p.getV,g={};if(g.algparam=null,h.substr(0,2)!="30")throw new Error("malformed plain PKCS8 private key(code:001)");var E=y(h,0);if(E.length<3)throw new Error("malformed plain PKCS8 private key(code:002)");if(h.substr(E[1],2)!="30")throw new Error("malformed PKCS8 private key(code:003)");var b=y(h,E[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=m(h,b[0]),h.substr(b[1],2)=="06"&&(g.algparam=m(h,b[1])),h.substr(E[2],2)!="04")throw new Error("malformed PKCS8 private key(code:006)");return g.keyidx=p.getVidx(h,E[2]),g},getKeyFromPlainPrivatePKCS8PEM:function(h){var p=pemtohex(h,"PRIVATE KEY"),y=this.getKeyFromPlainPrivatePKCS8Hex(p);return y},getKeyFromPlainPrivatePKCS8Hex:function(h){var p=this.parsePlainPrivatePKCS8Hex(h),y;if(p.algoid=="2a864886f70d010101")y=new RSAKey;else if(KJUR.crypto.DSA&&p.algoid=="2a8648ce380401")y=new KJUR.crypto.DSA;else if(KJUR.crypto.ECDSA&&p.algoid=="2a8648ce3d0201")y=new KJUR.crypto.ECDSA;else throw"unsupported private key algorithm";return y.readPKCS8PrvKeyHex(h),y},_getKeyFromPublicPKCS8Hex:function(h){var p,y=ASN1HEX.getVbyList(h,0,[0,0],"06");if(y==="2a864886f70d010101")p=new RSAKey;else if(KJUR.crypto.DSA&&y==="2a8648ce380401")p=new KJUR.crypto.DSA;else if(KJUR.crypto.ECDSA&&y==="2a8648ce3d0201")p=new KJUR.crypto.ECDSA;else throw"unsupported PKCS#8 public key hex";return p.readPKCS8PubKeyHex(h),p},parsePublicRawRSAKeyHex:function(h){var p=ASN1HEX,y=p.getChildIdx,m=p.getV,g={};if(h.substr(0,2)!="30")throw"malformed RSA key(code:001)";var E=y(h,0);if(E.length!=2)throw"malformed RSA key(code:002)";if(h.substr(E[0],2)!="02")throw"malformed RSA key(code:003)";if(g.n=m(h,E[0]),h.substr(E[1],2)!="02")throw"malformed RSA key(code:004)";return g.e=m(h,E[1]),g},parsePublicPKCS8Hex:function(h){var p=ASN1HEX,y=p.getChildIdx,m=p.getV,g={};g.algparam=null;var E=y(h,0);if(E.length!=2)throw"outer DERSequence shall have 2 elements: "+E.length;var b=E[0];if(h.substr(b,2)!="30")throw"malformed PKCS8 public key(code:001)";var T=y(h,b);if(T.length!=2)throw"malformed PKCS8 public key(code:002)";if(h.substr(T[0],2)!="06")throw"malformed PKCS8 public key(code:003)";if(g.algoid=m(h,T[0]),h.substr(T[1],2)=="06"?g.algparam=m(h,T[1]):h.substr(T[1],2)=="30"&&(g.algparam={},g.algparam.p=p.getVbyList(h,T[1],[0],"02"),g.algparam.q=p.getVbyList(h,T[1],[1],"02"),g.algparam.g=p.getVbyList(h,T[1],[2],"02")),h.substr(E[1],2)!="03")throw"malformed PKCS8 public key(code:004)";return g.key=m(h,E[1]).substr(2),g}}}();KEYUTIL.getKey=function(n,t,e){var r=ASN1HEX,i=r.getChildIdx;r.getV;var o=r.getVbyList,s=KJUR.crypto,u=s.ECDSA,c=s.DSA,l=RSAKey,d=pemtohex,f=KEYUTIL;if(typeof l!="undefined"&&n instanceof l||typeof u!="undefined"&&n instanceof u||typeof c!="undefined"&&n instanceof c)return n;if(n.curve!==void 0&&n.xy!==void 0&&n.d===void 0)return new u({pub:n.xy,curve:n.curve});if(n.curve!==void 0&&n.d!==void 0)return new u({prv:n.d,curve:n.curve});if(n.kty===void 0&&n.n!==void 0&&n.e!==void 0&&n.d===void 0){var v=new l;return v.setPublic(n.n,n.e),v}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 v=new l;return v.setPrivateEx(n.n,n.e,n.d,n.p,n.q,n.dp,n.dq,n.co),v}if(n.kty===void 0&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0&&n.p===void 0){var v=new l;return v.setPrivate(n.n,n.e,n.d),v}if(n.p!==void 0&&n.q!==void 0&&n.g!==void 0&&n.y!==void 0&&n.x===void 0){var v=new c;return v.setPublic(n.p,n.q,n.g,n.y),v}if(n.p!==void 0&&n.q!==void 0&&n.g!==void 0&&n.y!==void 0&&n.x!==void 0){var v=new c;return v.setPrivate(n.p,n.q,n.g,n.y,n.x),v}if(n.kty==="RSA"&&n.n!==void 0&&n.e!==void 0&&n.d===void 0){var v=new l;return v.setPublic(b64utohex(n.n),b64utohex(n.e)),v}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 v=new l;return v.setPrivateEx(b64utohex(n.n),b64utohex(n.e),b64utohex(n.d),b64utohex(n.p),b64utohex(n.q),b64utohex(n.dp),b64utohex(n.dq),b64utohex(n.qi)),v}if(n.kty==="RSA"&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0){var v=new l;return v.setPrivate(b64utohex(n.n),b64utohex(n.e),b64utohex(n.d)),v}if(n.kty==="EC"&&n.crv!==void 0&&n.x!==void 0&&n.y!==void 0&&n.d===void 0){var A=new u({curve:n.crv}),h=A.ecparams.keylen/4,p=("0000000000"+b64utohex(n.x)).slice(-h),y=("0000000000"+b64utohex(n.y)).slice(-h),m="04"+p+y;return A.setPublicKeyHex(m),A}if(n.kty==="EC"&&n.crv!==void 0&&n.x!==void 0&&n.y!==void 0&&n.d!==void 0){var A=new u({curve:n.crv}),h=A.ecparams.keylen/4,p=("0000000000"+b64utohex(n.x)).slice(-h),y=("0000000000"+b64utohex(n.y)).slice(-h),m="04"+p+y,g=("0000000000"+b64utohex(n.d)).slice(-h);return A.setPublicKeyHex(m),A.setPrivateKeyHex(g),A}if(e==="pkcs5prv"){var E=n,r=ASN1HEX,b,v;if(b=i(E,0),b.length===9)v=new l,v.readPKCS5PrvKeyHex(E);else if(b.length===6)v=new c,v.readPKCS5PrvKeyHex(E);else if(b.length>2&&E.substr(b[1],2)==="04")v=new u,v.readPKCS5PrvKeyHex(E);else throw"unsupported PKCS#1/5 hexadecimal key";return v}if(e==="pkcs8prv"){var v=f.getKeyFromPlainPrivatePKCS8Hex(n);return v}if(e==="pkcs8pub")return f._getKeyFromPublicPKCS8Hex(n);if(e==="x509pub")return X509.getPublicKeyFromCertHex(n);if(n.indexOf("-END CERTIFICATE-",0)!=-1||n.indexOf("-END X509 CERTIFICATE-",0)!=-1||n.indexOf("-END TRUSTED CERTIFICATE-",0)!=-1)return X509.getPublicKeyFromCertPEM(n);if(n.indexOf("-END PUBLIC KEY-")!=-1){var T=pemtohex(n,"PUBLIC KEY");return f._getKeyFromPublicPKCS8Hex(T)}if(n.indexOf("-END RSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var _=d(n,"RSA PRIVATE KEY");return f.getKey(_,null,"pkcs5prv")}if(n.indexOf("-END DSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var S=d(n,"DSA PRIVATE KEY"),R=o(S,0,[1],"02"),B=o(S,0,[2],"02"),I=o(S,0,[3],"02"),x=o(S,0,[4],"02"),M=o(S,0,[5],"02"),v=new c;return v.setPrivate(new BigInteger(R,16),new BigInteger(B,16),new BigInteger(I,16),new BigInteger(x,16),new BigInteger(M,16)),v}if(n.indexOf("-END EC PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var _=d(n,"EC PRIVATE KEY");return f.getKey(_,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),C=new RSAKey;return C.readPKCS5PrvKeyHex(L),C}if(n.indexOf("-END EC PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")!=-1){var S=f.getDecryptedKeyHex(n,t),v=o(S,0,[1],"04"),H=o(S,0,[2,0],"06"),F=o(S,0,[3,0],"03").substr(2),O="";if(KJUR.crypto.OID.oidhex2name[H]!==void 0)O=KJUR.crypto.OID.oidhex2name[H];else throw"undefined OID(hex) in KJUR.crypto.OID: "+H;var A=new u({curve:O});return A.setPublicKeyHex(F),A.setPrivateKeyHex(v),A.isPublic=!1,A}if(n.indexOf("-END DSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")!=-1){var S=f.getDecryptedKeyHex(n,t),R=o(S,0,[1],"02"),B=o(S,0,[2],"02"),I=o(S,0,[3],"02"),x=o(S,0,[4],"02"),M=o(S,0,[5],"02"),v=new c;return v.setPrivate(new BigInteger(R,16),new BigInteger(B,16),new BigInteger(I,16),new BigInteger(x,16),new BigInteger(M,16)),v}if(n.indexOf("-END ENCRYPTED PRIVATE KEY-")!=-1)return f.getKeyFromEncryptedPKCS8PEM(n,t);throw new Error("not supported argument")},(typeof KJUR.asn1=="undefined"||!KJUR.asn1)&&(KJUR.asn1={}),KJUR.asn1.ASN1Util={},KJUR.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,o="",s=2;s<n.length;s+=2){var u=parseInt(n.substr(s,2),16),c=("00000000"+u.toString(2)).slice(-8);if(o=o+c.substr(1,7),c.substr(0,1)=="0"){var l=new BigInteger(o,2);i=i+"."+l.toString(10),o=""}}return i};var ASN1HEX=new function(){};ASN1HEX.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},ASN1HEX.getL=function(n,t){var e=ASN1HEX.getLblen(n,t);return e<1?"":n.substr(t+2,e*2)},ASN1HEX.getVblen=function(n,t){var e,r;return e=ASN1HEX.getL(n,t),e==""?-1:(e.substr(0,1)==="8"?r=new BigInteger(e.substr(2),16):r=new BigInteger(e,16),r.intValue())},ASN1HEX.getVidx=function(n,t){var e=ASN1HEX.getLblen(n,t);return e<0?e:t+(e+1)*2},ASN1HEX.getV=function(n,t){var e=ASN1HEX.getVidx(n,t),r=ASN1HEX.getVblen(n,t);return n.substr(e,r*2)},ASN1HEX.getTLV=function(n,t){return n.substr(t,2)+ASN1HEX.getL(n,t)+ASN1HEX.getV(n,t)},ASN1HEX.getTLVblen=function(n,t){return 2+ASN1HEX.getLblen(n,t)*2+ASN1HEX.getVblen(n,t)*2},ASN1HEX.getNextSiblingIdx=function(n,t){var e=ASN1HEX.getVidx(n,t),r=ASN1HEX.getVblen(n,t);return e+r*2},ASN1HEX.getChildIdx=function(n,t){var e=ASN1HEX,r=[],i,o,s;i=e.getVidx(n,t),o=e.getVblen(n,t)*2,n.substr(t,2)=="03"&&(i+=2,o-=2),s=0;for(var u=i;s<=o;){var c=e.getTLVblen(n,u);if(s+=c,s<=o&&r.push(u),u+=c,s>=o)break}return r},ASN1HEX.getNthChildIdx=function(n,t,e){var r=ASN1HEX.getChildIdx(n,t);return r[e]},ASN1HEX.getIdxbyList=function(n,t,e,r){var i=ASN1HEX,o,s;return e.length==0?r!==void 0&&n.substr(t,2)!==r?-1:t:(o=e.shift(),s=i.getChildIdx(n,t),o>=s.length?-1:i.getIdxbyList(n,s[o],e,r))},ASN1HEX.getIdxbyListEx=function(n,t,e,r){var i=ASN1HEX,o,s;if(e.length==0)return r!==void 0&&n.substr(t,2)!==r?-1:t;o=e.shift(),s=i.getChildIdx(n,t);for(var u=0,c=0;c<s.length;c++){var l=n.substr(s[c],2);if(typeof o=="number"&&!i.isContextTag(l)&&u==o||typeof o=="string"&&i.isContextTag(l,o))return i.getIdxbyListEx(n,s[c],e,r);i.isContextTag(l)||u++}return-1},ASN1HEX.getTLVbyList=function(n,t,e,r){var i=ASN1HEX,o=i.getIdxbyList(n,t,e,r);return o==-1||o>=n.length?null:i.getTLV(n,o)},ASN1HEX.getTLVbyListEx=function(n,t,e,r){var i=ASN1HEX,o=i.getIdxbyListEx(n,t,e,r);return o==-1?null:i.getTLV(n,o)},ASN1HEX.getVbyList=function(n,t,e,r,i){var o=ASN1HEX,s,u;return s=o.getIdxbyList(n,t,e,r),s==-1||s>=n.length?null:(u=o.getV(n,s),i===!0&&(u=u.substr(2)),u)},ASN1HEX.getVbyListEx=function(n,t,e,r,i){var o=ASN1HEX,s,u;return s=o.getIdxbyListEx(n,t,e,r),s==-1?null:(u=o.getV(n,s),n.substr(s,2)=="03"&&i!==!1&&(u=u.substr(2)),u)},ASN1HEX.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=ASN1HEX.getV(n,t);return r=="02"?parseInt(i,16):bitstrtoint(i)}catch(o){return e}},ASN1HEX.getOID=function(n,t,e){e==null&&(e=null);try{if(n.substr(t,2)!="06")return e;var r=ASN1HEX.getV(n,t);return hextooid(r)}catch(i){return e}},ASN1HEX.getOIDName=function(n,t,e){e==null&&(e=null);try{var r=ASN1HEX.getOID(n,t,e);if(r==e)return e;var i=KJUR.asn1.x509.OID.oid2name(r);return i==""?r:i}catch(o){return e}},ASN1HEX.getString=function(n,t,e){e==null&&(e=null);try{var r=ASN1HEX.getV(n,t);return hextorstr(r)}catch(i){return e}},ASN1HEX.hextooidstr=function(n){var t=function(f,v){return f.length>=v?f:new Array(v-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 o=n.substr(2),s=[],u=0;u<o.length/2;u++)s.push(parseInt(o.substr(u*2,2),16));for(var c=[],l="",u=0;u<s.length;u++)s[u]&128?l=l+t((s[u]&127).toString(2),7):(l=l+t((s[u]&127).toString(2),7),c.push(new String(parseInt(l,2))),l="");var d=e.join(".");return c.length>0&&(d=d+"."+c.join(".")),d},ASN1HEX.isContextTag=function(n,t){n=n.toLowerCase();var e,r;try{e=parseInt(n,16)}catch(o){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(o){return!1}},ASN1HEX.isASN1HEX=function(n){var t=ASN1HEX;if(n.length%2==1)return!1;var e=t.getVblen(n,0),r=n.substr(0,2),i=t.getL(n,0),o=n.length-r.length-i.length;return o==e*2},ASN1HEX.checkStrictDER=function(n,t,e,r,i){var o=ASN1HEX;if(e===void 0){if(typeof n!="string")throw new Error("not hex string");if(n=n.toLowerCase(),!KJUR.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 s=o.getL(n,t);if(s.length>i*2)throw new Error("L of TLV too long: idx="+t);var u=o.getVblen(n,t);if(u>r)throw new Error("value of L too long than hex: idx="+t);var c=o.getTLV(n,t),l=c.length-2-o.getL(n,t).length;if(l!==u*2)throw new Error("V string length and L's value not the same:"+l+"/"+u*2);if(t===0&&n.length!=c.length)throw new Error("total length and TLV length unmatch:"+n.length+"!="+c.length);var d=n.substr(t,2);if(d==="02"){var f=o.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 v=o.getVblen(n,t),A=0,h=o.getChildIdx(n,t),p=0;p<h.length;p++){var y=o.getTLV(n,h[p]);A+=y.length,o.checkStrictDER(n,h[p],e,r,i)}if(v*2!=A)throw new Error("sum of children's TLV length and L unmatch: "+v*2+"!="+A)}},ASN1HEX.oidname=function(n){var t=KJUR.asn1;KJUR.lang.String.isHex(n)&&(n=t.ASN1Util.oidHexToInt(n));var e=t.x509.OID.oid2name(n);return e===""&&(e=n),e},(typeof KJUR.asn1=="undefined"||!KJUR.asn1)&&(KJUR.asn1={}),(typeof KJUR.asn1.x509=="undefined"||!KJUR.asn1.x509)&&(KJUR.asn1.x509={}),KJUR.asn1.x509.AlgorithmIdentifier={},KJUR.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"},KJUR.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 KJUR.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 KJUR.asn1.DERObjectIdentifier({oid:e});return this.objCache[t]=r,r}},KJUR.asn1.x509.OID.oid2name=function(n){var t=KJUR.asn1.x509.OID.name2oidList;for(var e in t)if(t[e]==n)return e;return""},KJUR.asn1.x509.OID.oid2atype=function(n){var t=KJUR.asn1.x509.OID.atype2oidList;for(var e in t)if(t[e]==n)return e;return n},KJUR.asn1.x509.OID.name2oid=function(n){if(n.match(/^[0-9.]+$/))return n;var t=KJUR.asn1.x509.OID.name2oidList;return t[n]===void 0?"":t[n]},RSAKey.getPosArrayOfChildrenFromHex=function(n){return ASN1HEX.getChildIdx(n,0)},RSAKey.getHexValueArrayOfChildrenFromHex=function(n){var t=ASN1HEX,e=t.getV,v=RSAKey.getPosArrayOfChildrenFromHex(n),r=e(n,v[0]),i=e(n,v[1]),o=e(n,v[2]),s=e(n,v[3]),u=e(n,v[4]),c=e(n,v[5]),l=e(n,v[6]),d=e(n,v[7]),f=e(n,v[8]),v=new Array;return v.push(r,i,o,s,u,c,l,d,f),v},RSAKey.prototype.readPrivateKeyFromPEMString=function(n){var t=pemtohex(n),e=RSAKey.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},RSAKey.prototype.readPKCS5PrvKeyHex=function(n){var t=RSAKey.getHexValueArrayOfChildrenFromHex(n);this.setPrivateEx(t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},RSAKey.prototype.readPKCS8PrvKeyHex=function(n){var t,e,r,i,o,s,u,c,l=ASN1HEX,d=l.getVbyListEx;if(l.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"),o=d(n,0,[2,0,5],"02"),s=d(n,0,[2,0,6],"02"),u=d(n,0,[2,0,7],"02"),c=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,o,s,u,c)},RSAKey.prototype.readPKCS5PubKeyHex=function(n){var t=ASN1HEX,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]),o=e(n,r[1]);this.setPublic(i,o)},RSAKey.prototype.readPKCS8PubKeyHex=function(n){var t=ASN1HEX;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)},RSAKey.prototype.readCertPubKeyHex=function(n,t){var e,r;e=new X509,e.readCertHex(n),r=e.getPublicKeyHex(),this.readPKCS8PubKeyHex(r)};function _rsasign_getAlgNameAndHashFromHexDisgestInfo(n){for(var t in KJUR.crypto.Util.DIGESTINFOHEAD){var e=KJUR.crypto.Util.DIGESTINFOHEAD[t],r=e.length;if(n.substring(0,r)==e){var i=[t,n.substring(r)];return i}}return[]}RSAKey.prototype.verify=function(n,t){if(t=t.toLowerCase(),t.match(/^[0-9a-f]+$/)==null)return!1;var e=parseBigInt(t,16),r=this.n.bitLength();if(e.bitLength()>r)return!1;var i=this.doPublic(e),o=i.toString(16);if(o.length+3!=r/4)return!1;var s=o.replace(/^1f+00/,""),u=_rsasign_getAlgNameAndHashFromHexDisgestInfo(s);if(u.length==0)return!1;var c=u[0],l=u[1],d=function(v){return KJUR.crypto.Util.hashString(v,c)},f=d(n);return l==f},RSAKey.prototype.verifyWithMessageHash=function(n,t){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var e=parseBigInt(t,16);if(e.bitLength()>this.n.bitLength())return 0;var r=this.doPublic(e),i=r.toString(16).replace(/^1f+00/,""),o=_rsasign_getAlgNameAndHashFromHexDisgestInfo(i);if(o.length==0)return!1;o[0];var s=o[1];return s==n},RSAKey.prototype.verifyPSS=function(n,t,e,r){var i=function(s){return KJUR.crypto.Util.hashHex(s,e)},o=i(rstrtohex(n));return r===void 0&&(r=-1),this.verifyWithMessageHashPSS(o,t,e,r)},RSAKey.prototype.verifyWithMessageHashPSS=function(n,t,e,r){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var i=new BigInteger(t,16),o=function(g){return KJUR.crypto.Util.hashHex(g,e)},s=hextorstr(n),u=s.length,c=this.n.bitLength()-1,l=Math.ceil(c/8),d;if(r===-1||r===void 0)r=u;else if(r===-2)r=l-u-2;else if(r<-2)throw new Error("invalid salt length");if(l<u+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<l;)f.unshift(0);if(f[l-1]!==188)throw new Error("encoded message does not end in 0xbc");f=String.fromCharCode.apply(String,f);var v=f.substr(0,l-u-1),A=f.substr(v.length,u),h=65280>>8*l-c&255;if(v.charCodeAt(0)&h)throw new Error("bits beyond keysize not zero");var p=pss_mgf1_str(A,v.length,o),y=[];for(d=0;d<v.length;d+=1)y[d]=v.charCodeAt(d)^p.charCodeAt(d);y[0]&=~h;var m=l-u-r-2;for(d=0;d<m;d+=1)if(y[d]!==0)throw new Error("leftmost octets not zero");if(y[m]!==1)throw new Error("0x01 marker not found");return A===hextorstr(o(rstrtohex("\0\0\0\0\0\0\0\0"+s+String.fromCharCode.apply(String,y.slice(-r)))))},RSAKey.SALT_LEN_HLEN=-1,RSAKey.SALT_LEN_MAX=-2,RSAKey.SALT_LEN_RECOVER=-2;function X509(n){var t=ASN1HEX,e=t.getChildIdx,r=t.getV,i=t.getTLV,o=t.getVbyList,s=t.getVbyListEx,u=t.getTLVbyList,c=t.getTLVbyListEx,l=t.getIdxbyList,d=t.getIdxbyListEx,f=t.getVidx,v=t.getInt,A=t.oidname,h=t.hextooidstr,p=pemtohex,y;try{y=KJUR.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch(m){}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 m=u(this.hex,0,[0,0]);if(m.substr(0,2)=="a0"){var g=u(m,0,[0]),E=v(g,0);if(E<0||2<E)throw new Error("malformed version field");return this.version=E+1,this.version}else return this.version=1,this.foffset=-1,1},this.getSerialNumberHex=function(){return s(this.hex,0,[0,0],"02")},this.getSignatureAlgorithmField=function(){var m=c(this.hex,0,[0,1]);return this.getAlgorithmIdentifierName(m)},this.getAlgorithmIdentifierName=function(m){for(var g in y)if(m===y[g])return g;return A(s(m,0,[0],"06"))},this.getIssuer=function(){return this.getX500Name(this.getIssuerHex())},this.getIssuerHex=function(){return u(this.hex,0,[0,3+this.foffset],"30")},this.getIssuerString=function(){var m=this.getIssuer();return m.str},this.getSubject=function(){return this.getX500Name(this.getSubjectHex())},this.getSubjectHex=function(){return u(this.hex,0,[0,5+this.foffset],"30")},this.getSubjectString=function(){var m=this.getSubject();return m.str},this.getNotBefore=function(){var m=o(this.hex,0,[0,4+this.foffset,0]);return m=m.replace(/(..)/g,"%$1"),m=decodeURIComponent(m),m},this.getNotAfter=function(){var m=o(this.hex,0,[0,4+this.foffset,1]);return m=m.replace(/(..)/g,"%$1"),m=decodeURIComponent(m),m},this.getPublicKeyHex=function(){return t.getTLVbyList(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyIdx=function(){return l(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyContentIdx=function(){var m=this.getPublicKeyIdx();return l(this.hex,m,[1,0],"30")},this.getPublicKey=function(){return KEYUTIL.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var m=u(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(m)},this.getSignatureValueHex=function(){return o(this.hex,0,[2],"03",!0)},this.verifySignature=function(m){var g=this.getSignatureAlgorithmField(),E=this.getSignatureValueHex(),b=u(this.hex,0,[0],"30"),T=new KJUR.crypto.Signature({alg:g});return T.init(m),T.updateHex(b),T.verify(E)},this.parseExt=function(m){var g,E,b;if(m===void 0){if(b=this.hex,this.version!==3)return-1;g=l(b,0,[0,7,0],"30"),E=e(b,g)}else{b=pemtohex(m);var T=l(b,0,[0,3,0,0],"06");if(r(b,T)!="2a864886f70d01090e"){this.aExtInfo=new Array;return}g=l(b,0,[0,3,0,1,0],"30"),E=e(b,g),this.hex=b}this.aExtInfo=new Array;for(var _=0;_<E.length;_++){var S={};S.critical=!1;var R=e(b,E[_]),B=0;R.length===3&&(S.critical=!0,B=1),S.oid=t.hextooidstr(o(b,E[_],[0],"06"));var I=l(b,E[_],[1+B]);S.vidx=f(b,I),this.aExtInfo.push(S)}},this.getExtInfo=function(m){var g=this.aExtInfo,E=m;if(m.match(/^[0-9.]+$/)||(E=KJUR.asn1.x509.OID.name2oid(m)),E!==""){for(var b=0;b<g.length;b++)if(g[b].oid===E)return g[b]}},this.getExtBasicConstraints=function(m,g){if(m===void 0&&g===void 0){var E=this.getExtInfo("basicConstraints");if(E===void 0)return;m=i(this.hex,E.vidx),g=E.critical}var b={extname:"basicConstraints"};if(g&&(b.critical=!0),m==="3000")return b;if(m==="30030101ff")return b.cA=!0,b;if(m.substr(0,12)==="30060101ff02"){var T=r(m,10),_=parseInt(T,16);return b.cA=!0,b.pathLen=_,b}throw new Error("hExtV parse error: "+m)},this.getExtKeyUsage=function(m,g){if(m===void 0&&g===void 0){var E=this.getExtInfo("keyUsage");if(E===void 0)return;m=i(this.hex,E.vidx),g=E.critical}var b={extname:"keyUsage"};return g&&(b.critical=!0),b.names=this.getExtKeyUsageString(m).split(","),b},this.getExtKeyUsageBin=function(m){if(m===void 0){var g=this.getExtInfo("keyUsage");if(g===void 0)return"";m=i(this.hex,g.vidx)}if(m.length!=8&&m.length!=10)throw new Error("malformed key usage value: "+m);var E="000000000000000"+parseInt(m.substr(6),16).toString(2);return m.length==8&&(E=E.slice(-8)),m.length==10&&(E=E.slice(-16)),E=E.replace(/0+$/,""),E==""&&(E="0"),E},this.getExtKeyUsageString=function(m){for(var g=this.getExtKeyUsageBin(m),E=new Array,b=0;b<g.length;b++)g.substr(b,1)=="1"&&E.push(X509.KEYUSAGE_NAME[b]);return E.join(",")},this.getExtSubjectKeyIdentifier=function(m,g){if(m===void 0&&g===void 0){var E=this.getExtInfo("subjectKeyIdentifier");if(E===void 0)return;m=i(this.hex,E.vidx),g=E.critical}var b={extname:"subjectKeyIdentifier"};g&&(b.critical=!0);var T=r(m,0);return b.kid={hex:T},b},this.getExtAuthorityKeyIdentifier=function(m,g){if(m===void 0&&g===void 0){var E=this.getExtInfo("authorityKeyIdentifier");if(E===void 0)return;m=i(this.hex,E.vidx),g=E.critical}var b={extname:"authorityKeyIdentifier"};g&&(b.critical=!0);for(var T=e(m,0),_=0;_<T.length;_++){var S=m.substr(T[_],2);if(S==="80"&&(b.kid={hex:r(m,T[_])}),S==="a1"){var R=i(m,T[_]),B=this.getGeneralNames(R);b.issuer=B[0].dn}S==="82"&&(b.sn={hex:r(m,T[_])})}return b},this.getExtExtKeyUsage=function(m,g){if(m===void 0&&g===void 0){var E=this.getExtInfo("extKeyUsage");if(E===void 0)return;m=i(this.hex,E.vidx),g=E.critical}var b={extname:"extKeyUsage",array:[]};g&&(b.critical=!0);for(var T=e(m,0),_=0;_<T.length;_++)b.array.push(A(r(m,T[_])));return b},this.getExtExtKeyUsageName=function(){var m=this.getExtInfo("extKeyUsage");if(m===void 0)return m;var g=new Array,E=i(this.hex,m.vidx);if(E==="")return g;for(var b=e(E,0),T=0;T<b.length;T++)g.push(A(r(E,b[T])));return g},this.getExtSubjectAltName=function(m,g){if(m===void 0&&g===void 0){var E=this.getExtInfo("subjectAltName");if(E===void 0)return;m=i(this.hex,E.vidx),g=E.critical}var b={extname:"subjectAltName",array:[]};return g&&(b.critical=!0),b.array=this.getGeneralNames(m),b},this.getExtIssuerAltName=function(m,g){if(m===void 0&&g===void 0){var E=this.getExtInfo("issuerAltName");if(E===void 0)return;m=i(this.hex,E.vidx),g=E.critical}var b={extname:"issuerAltName",array:[]};return g&&(b.critical=!0),b.array=this.getGeneralNames(m),b},this.getGeneralNames=function(m){for(var g=e(m,0),E=[],b=0;b<g.length;b++){var T=this.getGeneralName(i(m,g[b]));T!==void 0&&E.push(T)}return E},this.getGeneralName=function(m){var g=m.substr(0,2),E=r(m,0),b=hextorstr(E);if(g=="81")return{rfc822:b};if(g=="82")return{dns:b};if(g=="86")return{uri:b};if(g=="87")return{ip:hextoip(E)};if(g=="a4")return{dn:this.getX500Name(E)}},this.getExtSubjectAltName2=function(){var m,g,E,b=this.getExtInfo("subjectAltName");if(b===void 0)return b;for(var T=new Array,_=i(this.hex,b.vidx),S=e(_,0),R=0;R<S.length;R++)E=_.substr(S[R],2),m=r(_,S[R]),E==="81"&&(g=hextoutf8(m),T.push(["MAIL",g])),E==="82"&&(g=hextoutf8(m),T.push(["DNS",g])),E==="84"&&(g=X509.hex2dn(m,0),T.push(["DN",g])),E==="86"&&(g=hextoutf8(m),T.push(["URI",g])),E==="87"&&(g=hextoip(m),T.push(["IP",g]));return T},this.getExtCRLDistributionPoints=function(m,g){if(m===void 0&&g===void 0){var E=this.getExtInfo("cRLDistributionPoints");if(E===void 0)return;m=i(this.hex,E.vidx),g=E.critical}var b={extname:"cRLDistributionPoints",array:[]};g&&(b.critical=!0);for(var T=e(m,0),_=0;_<T.length;_++){var S=i(m,T[_]);b.array.push(this.getDistributionPoint(S))}return b},this.getDistributionPoint=function(m){for(var g={},E=e(m,0),b=0;b<E.length;b++){var T=m.substr(E[b],2),_=i(m,E[b]);T=="a0"&&(g.dpname=this.getDistributionPointName(_))}return g},this.getDistributionPointName=function(m){for(var g={},E=e(m,0),b=0;b<E.length;b++){var T=m.substr(E[b],2),_=i(m,E[b]);T=="a0"&&(g.full=this.getGeneralNames(_))}return g},this.getExtCRLDistributionPointsURI=function(){var m=this.getExtInfo("cRLDistributionPoints");if(m===void 0)return m;for(var g=new Array,E=e(this.hex,m.vidx),b=0;b<E.length;b++)try{var T=o(this.hex,E[b],[0,0,0],"86"),_=hextoutf8(T);g.push(_)}catch(S){}return g},this.getExtAIAInfo=function(){var m=this.getExtInfo("authorityInfoAccess");if(m===void 0)return m;for(var g={ocsp:[],caissuer:[]},E=e(this.hex,m.vidx),b=0;b<E.length;b++){var T=o(this.hex,E[b],[0],"06"),_=o(this.hex,E[b],[1],"86");T==="2b06010505073001"&&g.ocsp.push(hextoutf8(_)),T==="2b06010505073002"&&g.caissuer.push(hextoutf8(_))}return g},this.getExtAuthorityInfoAccess=function(m,g){if(m===void 0&&g===void 0){var E=this.getExtInfo("authorityInfoAccess");if(E===void 0)return;m=i(this.hex,E.vidx),g=E.critical}var b={extname:"authorityInfoAccess",array:[]};g&&(b.critical=!0);for(var T=e(m,0),_=0;_<T.length;_++){var S=s(m,T[_],[0],"06"),R=o(m,T[_],[1],"86"),B=hextoutf8(R);if(S=="2b06010505073001")b.array.push({ocsp:B});else if(S=="2b06010505073002")b.array.push({caissuer:B});else throw new Error("unknown method: "+S)}return b},this.getExtCertificatePolicies=function(m,g){if(m===void 0&&g===void 0){var E=this.getExtInfo("certificatePolicies");if(E===void 0)return;m=i(this.hex,E.vidx),g=E.critical}var b={extname:"certificatePolicies",array:[]};g&&(b.critical=!0);for(var T=e(m,0),_=0;_<T.length;_++){var S=i(m,T[_]),R=this.getPolicyInformation(S);b.array.push(R)}return b},this.getPolicyInformation=function(m){var g={},E=o(m,0,[0],"06");g.policyoid=A(E);var b=d(m,0,[1],"30");if(b!=-1){g.array=[];for(var T=e(m,b),_=0;_<T.length;_++){var S=i(m,T[_]),R=this.getPolicyQualifierInfo(S);g.array.push(R)}}return g},this.getPolicyQualifierInfo=function(m){var g={},E=o(m,0,[0],"06");if(E==="2b06010505070201"){var b=s(m,0,[1],"16");g.cps=hextorstr(b)}else if(E==="2b06010505070202"){var T=u(m,0,[1],"30");g.unotice=this.getUserNotice(T)}return g},this.getUserNotice=function(m){for(var g={},E=e(m,0),b=0;b<E.length;b++){var T=i(m,E[b]);T.substr(0,2)!="30"&&(g.exptext=this.getDisplayText(T))}return g},this.getDisplayText=function(m){var g={"0c":"utf8",16:"ia5","1a":"vis","1e":"bmp"},E={};return E.type=g[m.substr(0,2)],E.str=hextorstr(r(m,0)),E},this.getExtCRLNumber=function(m,g){var E={extname:"cRLNumber"};if(g&&(E.critical=!0),m.substr(0,2)=="02")return E.num={hex:r(m,0)},E;throw new Error("hExtV parse error: "+m)},this.getExtCRLReason=function(m,g){var E={extname:"cRLReason"};if(g&&(E.critical=!0),m.substr(0,2)=="0a")return E.code=parseInt(r(m,0),16),E;throw new Error("hExtV parse error: "+m)},this.getExtOcspNonce=function(m,g){var E={extname:"ocspNonce"};g&&(E.critical=!0);var b=r(m,0);return E.hex=b,E},this.getExtOcspNoCheck=function(m,g){var E={extname:"ocspNoCheck"};return g&&(E.critical=!0),E},this.getExtAdobeTimeStamp=function(m,g){if(m===void 0&&g===void 0){var E=this.getExtInfo("adobeTimeStamp");if(E===void 0)return;m=i(this.hex,E.vidx),g=E.critical}var b={extname:"adobeTimeStamp"};g&&(b.critical=!0);var T=e(m,0);if(T.length>1){var _=i(m,T[1]),S=this.getGeneralName(_);S.uri!=null&&(b.uri=S.uri)}if(T.length>2){var R=i(m,T[2]);R=="0101ff"&&(b.reqauth=!0),R=="010100"&&(b.reqauth=!1)}return b},this.getX500NameRule=function(m){for(var g=null,E=[],b=0;b<m.length;b++)for(var T=m[b],_=0;_<T.length;_++)E.push(T[_]);for(var b=0;b<E.length;b++){var S=E[b],R=S.ds,B=S.value,I=S.type;if(R!="prn"&&R!="utf8"&&R!="ia5")return"mixed";if(R=="ia5"){if(I!="CN")return"mixed";if(KJUR.lang.String.isMail(B))continue;return"mixed"}if(I=="C"){if(R=="prn")continue;return"mixed"}if(g==null)g=R;else if(g!==R)return"mixed"}return g==null?"prn":g},this.getX500Name=function(m){var g=this.getX500NameArray(m),E=this.dnarraytostr(g);return{array:g,str:E}},this.getX500NameArray=function(m){for(var g=[],E=e(m,0),b=0;b<E.length;b++)g.push(this.getRDN(i(m,E[b])));return g},this.getRDN=function(m){for(var g=[],E=e(m,0),b=0;b<E.length;b++)g.push(this.getAttrTypeAndValue(i(m,E[b])));return g},this.getAttrTypeAndValue=function(m){var g={type:null,value:null,ds:null},E=e(m,0),b=o(m,E[0],[],"06"),T=o(m,E[1],[]),_=KJUR.asn1.ASN1Util.oidHexToInt(b);return g.type=KJUR.asn1.x509.OID.oid2atype(_),g.ds=this.HEX2STAG[m.substr(E[1],2)],g.ds!="bmp"?g.value=hextoutf8(T):g.value=ucs2hextoutf8(T),g},this.readCertPEM=function(m){this.readCertHex(p(m))},this.readCertHex=function(m){this.hex=m,this.getVersion();try{l(this.hex,0,[0,7],"a3"),this.parseExt()}catch(g){}},this.getParam=function(){var m={};return m.version=this.getVersion(),m.serial={hex:this.getSerialNumberHex()},m.sigalg=this.getSignatureAlgorithmField(),m.issuer=this.getIssuer(),m.notbefore=this.getNotBefore(),m.notafter=this.getNotAfter(),m.subject=this.getSubject(),m.sbjpubkey=hextopem(this.getPublicKeyHex(),"PUBLIC KEY"),this.aExtInfo.length>0&&(m.ext=this.getExtParamArray()),m.sighex=this.getSignatureValueHex(),m},this.getExtParamArray=function(m){if(m==null){var g=d(this.hex,0,[0,"[3]"]);g!=-1&&(m=c(this.hex,0,[0,"[3]",0],"30"))}for(var E=[],b=e(m,0),T=0;T<b.length;T++){var _=i(m,b[T]),S=this.getExtParam(_);S!=null&&E.push(S)}return E},this.getExtParam=function(m){var g=e(m,0),E=g.length;if(E!=2&&E!=3)throw new Error("wrong number elements in Extension: "+E+" "+m);var b=h(o(m,0,[0],"06")),T=!1;E==3&&u(m,0,[1])=="0101ff"&&(T=!0);var _=u(m,0,[E-1,0]),S=void 0;if(b=="2.5.29.14"?S=this.getExtSubjectKeyIdentifier(_,T):b=="2.5.29.15"?S=this.getExtKeyUsage(_,T):b=="2.5.29.17"?S=this.getExtSubjectAltName(_,T):b=="2.5.29.18"?S=this.getExtIssuerAltName(_,T):b=="2.5.29.19"?S=this.getExtBasicConstraints(_,T):b=="2.5.29.31"?S=this.getExtCRLDistributionPoints(_,T):b=="2.5.29.32"?S=this.getExtCertificatePolicies(_,T):b=="2.5.29.35"?S=this.getExtAuthorityKeyIdentifier(_,T):b=="2.5.29.37"?S=this.getExtExtKeyUsage(_,T):b=="1.3.6.1.5.5.7.1.1"?S=this.getExtAuthorityInfoAccess(_,T):b=="2.5.29.20"?S=this.getExtCRLNumber(_,T):b=="2.5.29.21"?S=this.getExtCRLReason(_,T):b=="1.3.6.1.5.5.7.48.1.2"?S=this.getExtOcspNonce(_,T):b=="1.3.6.1.5.5.7.48.1.5"?S=this.getExtOcspNoCheck(_,T):b=="1.2.840.113583.1.1.9.1"&&(S=this.getExtAdobeTimeStamp(_,T)),S!=null)return S;var R={extname:b,extn:_};return T&&(R.critical=!0),R},this.findExt=function(m,g){for(var E=0;E<m.length;E++)if(m[E].extname==g)return m[E];return null},this.dnarraytostr=function(m){function g(b){return b.map(function(T){return E(T).replace(/\+/,"\\+")}).join("+")}function E(b){return b.type+"="+b.value}return"/"+m.map(function(b){return g(b).replace(/\//,"\\/")}).join("/")},this.getInfo=function(){var m=function(G){var Q=JSON.stringify(G.array).replace(/[\[\]\{\}\"]/g,"");return Q},g=function(G){for(var Q="",U=G.array,D=0;D<U.length;D++){var q=U[D];if(Q+=" policy oid: "+q.policyoid+`
363
+ `,q.array!==void 0)for(var z=0;z<q.array.length;z++){var K=q.array[z];K.cps!==void 0&&(Q+=" cps: "+K.cps+`
364
+ `)}}return Q},E=function(G){for(var Q="",U=G.array,D=0;D<U.length;D++){var q=U[D];try{q.dpname.full[0].uri!==void 0&&(Q+=" "+q.dpname.full[0].uri+`
365
+ `)}catch(z){}try{q.dname.full[0].dn.hex!==void 0&&(Q+=" "+X509.hex2dn(q.dpname.full[0].dn.hex)+`
366
+ `)}catch(z){}}return Q},b=function(G){for(var Q="",U=G.array,D=0;D<U.length;D++){var q=U[D];q.caissuer!==void 0&&(Q+=" caissuer: "+q.caissuer+`
367
+ `),q.ocsp!==void 0&&(Q+=" ocsp: "+q.ocsp+`
368
+ `)}return Q},T,_,S;if(T=`Basic Fields
369
369
  `,T+=" serial number: "+this.getSerialNumberHex()+`
370
370
  `,T+=" signature algorithm: "+this.getSignatureAlgorithmField()+`
371
371
  `,T+=" issuer: "+this.getIssuerString()+`
@@ -376,19 +376,19 @@
376
376
  `,_=this.getPublicKey(),T+=" key algorithm: "+_.type+`
377
377
  `,_.type==="RSA"&&(T+=" n="+hextoposhex(_.n.toString(16)).substr(0,16)+`...
378
378
  `,T+=" e="+hextoposhex(_.e.toString(16))+`
379
- `),x=this.aExtInfo,x!=null){T+=`X509v3 Extensions:
380
- `;for(var R=0;R<x.length;R++){var w=x[R],S=KJUR.asn1.x509.OID.oid2name(w.oid);S===""&&(S=w.oid);var C="";if(w.critical===!0&&(C="CRITICAL"),T+=" "+S+" "+C+`:
381
- `,S==="basicConstraints"){var I=this.getExtBasicConstraints();I.cA===void 0?T+=` {}
382
- `:(T+=" cA=true",I.pathLen!==void 0&&(T+=", pathLen="+I.pathLen),T+=`
383
- `)}else if(S==="keyUsage")T+=" "+this.getExtKeyUsageString()+`
384
- `;else if(S==="subjectKeyIdentifier")T+=" "+this.getExtSubjectKeyIdentifier().kid.hex+`
385
- `;else if(S==="authorityKeyIdentifier"){var H=this.getExtAuthorityKeyIdentifier();H.kid!==void 0&&(T+=" kid="+H.kid.hex+`
386
- `)}else if(S==="extKeyUsage"){var B=this.getExtExtKeyUsage().array;T+=" "+B.join(", ")+`
387
- `}else if(S==="subjectAltName"){var L=v(this.getExtSubjectAltName());T+=" "+L+`
388
- `}else if(S==="cRLDistributionPoints"){var O=this.getExtCRLDistributionPoints();T+=E(O)}else if(S==="authorityInfoAccess"){var k=this.getExtAuthorityInfoAccess();T+=b(k)}else S==="certificatePolicies"&&(T+=g(this.getExtCertificatePolicies()))}}return T+="signature algorithm: "+this.getSignatureAlgorithmName()+`
379
+ `),S=this.aExtInfo,S!=null){T+=`X509v3 Extensions:
380
+ `;for(var R=0;R<S.length;R++){var B=S[R],I=KJUR.asn1.x509.OID.oid2name(B.oid);I===""&&(I=B.oid);var x="";if(B.critical===!0&&(x="CRITICAL"),T+=" "+I+" "+x+`:
381
+ `,I==="basicConstraints"){var M=this.getExtBasicConstraints();M.cA===void 0?T+=` {}
382
+ `:(T+=" cA=true",M.pathLen!==void 0&&(T+=", pathLen="+M.pathLen),T+=`
383
+ `)}else if(I==="keyUsage")T+=" "+this.getExtKeyUsageString()+`
384
+ `;else if(I==="subjectKeyIdentifier")T+=" "+this.getExtSubjectKeyIdentifier().kid.hex+`
385
+ `;else if(I==="authorityKeyIdentifier"){var L=this.getExtAuthorityKeyIdentifier();L.kid!==void 0&&(T+=" kid="+L.kid.hex+`
386
+ `)}else if(I==="extKeyUsage"){var C=this.getExtExtKeyUsage().array;T+=" "+C.join(", ")+`
387
+ `}else if(I==="subjectAltName"){var H=m(this.getExtSubjectAltName());T+=" "+H+`
388
+ `}else if(I==="cRLDistributionPoints"){var F=this.getExtCRLDistributionPoints();T+=E(F)}else if(I==="authorityInfoAccess"){var O=this.getExtAuthorityInfoAccess();T+=b(O)}else I==="certificatePolicies"&&(T+=g(this.getExtCertificatePolicies()))}}return T+="signature algorithm: "+this.getSignatureAlgorithmName()+`
389
389
  `,T+="signature: "+this.getSignatureValueHex().substr(0,16)+`...
390
- `,T},typeof n=="string"&&(n.indexOf("-----BEGIN")!=-1?this.readCertPEM(n):KJUR.lang.String.isHex(n)&&this.readCertHex(n))}X509.hex2dn=function(n,t){t===void 0&&(t=0);var e=new X509;ASN1HEX.getTLV(n,t);var r=e.getX500Name(n);return r.str},X509.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=ASN1HEX.getChildIdx(n,t),i=0;i<r.length;i++)e.push(X509.hex2attrTypeValue(n,r[i]));return e=e.map(function(o){return o.replace("+","\\+")}),e.join("+")},X509.hex2attrTypeValue=function(n,t){var e=ASN1HEX,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 o=r(n,i[0]),s=KJUR.asn1.ASN1Util.oidHexToInt(o),u=KJUR.asn1.x509.OID.oid2atype(s),l=r(n,i[1]),c=hextorstr(l);return u+"="+c},X509.getPublicKeyFromCertHex=function(n){var t=new X509;return t.readCertHex(n),t.getPublicKey()},X509.getPublicKeyFromCertPEM=function(n){var t=new X509;return t.readCertPEM(n),t.getPublicKey()},X509.getPublicKeyInfoPropOfCertPEM=function(n){var t=ASN1HEX,e=t.getVbyList,r={},i,o;return r.algparam=null,i=new X509,i.readCertPEM(n),o=i.getPublicKeyHex(),r.keyhex=e(o,0,[1],"03").substr(2),r.algoid=e(o,0,[0,0],"06"),r.algoid==="2a8648ce3d0201"&&(r.algparam=e(o,0,[0,1],"06")),r},X509.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"];function sha256(n){return CryptoJS.SHA256(n).toString()}var certificates=[function(){var n=new X509;return n.readCertPEM(function(){var t=113,e=126,r=0,i="";return arguments[r].split(i).map(function(o){return o.charCodeAt(r)>e?o:String.fromCharCode((o.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}nzyg R]ZN=TN>bRPtTn?bf?FZ_NQtfQc^^YQNq`gdSp?cyZ^P^fQc^^QQNWQ^aRvZPNTP`\0T`Vo@Q^RWN_fapzFqSFwfbOndSnzyuYz[oaNrS=\x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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 getCertificateBySubjectHex(n,t){for(var e=0,r=t;e<r.length;e++){var i=r[e];if(i.getSubjectHex()===n)return i}}function verifyCertificate_(n,t){var e=n.getIssuerHex();if(e===n.getSubjectHex())return n.verifySignature(n.getPublicKey());var r=getCertificateBySubjectHex(e,t);return!r||n.verifySignature(r.getPublicKey())===!1?!1:verifyCertificate_(r,t)}function verifyCertificate(n){var t=n.getIssuerHex();return t===n.getSubjectHex()?!1:verifyCertificate_(n,certificates)}function addCertificate(n){var t=new X509;typeof n=="string"?t.readCertPEM(n):t.readCertHex(n.hex);var e=verifyCertificate(t);return certificates.push(t),e}function verifyMessage(n,t,e){var r=new X509;if(typeof e=="string"?r.readCertPEM(e):r.readCertHex(e.hex),verifyCertificate(r)===!1)return!1;var i=new RSAKey;return i.readCertPubKeyHex(r.hex,6),!!i.verify(n,b64tohex(t))}addCertificate(function(){var t=113,e=126,r=0,i="";return arguments[r].split(i).map(function(o){return o.charCodeAt(r)>e?o:String.fromCharCode((o.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=^yQYSTQ`]\0?tR{WRUun\\\0bVe_E|VWWV|r Ao\0 F`fdzCnRtq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@_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 extendStatics=function(n,t){return extendStatics=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])},extendStatics(n,t)};function __extends(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");extendStatics(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var __assign=function(){return __assign=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},__assign.apply(this,arguments)};function __decorate(n,t,e,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,t,e,r);else for(var u=n.length-1;u>=0;u--)(s=n[u])&&(o=(i<3?s(o):i>3?s(t,e,o):s(t,e))||o);return i>3&&o&&Object.defineProperty(t,e,o),o}function __metadata(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)}function __awaiter(n,t,e,r){function i(o){return o instanceof e?o:new e(function(s){s(o)})}return new(e||(e=Promise))(function(o,s){function u(d){try{c(r.next(d))}catch(f){s(f)}}function l(d){try{c(r.throw(d))}catch(f){s(f)}}function c(d){d.done?o(d.value):i(d.value).then(u,l)}c((r=r.apply(n,t||[])).next())})}function __generator(n,t){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=u(0),s.throw=u(1),s.return=u(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(c){return function(d){return l([c,d])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(e=0)),e;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return e.label++,{value:c[1],done:!1};case 5:e.label++,i=c[1],c=[0];continue;case 7:c=e.ops.pop(),e.trys.pop();continue;default:if(o=e.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){e=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){e.label=c[1];break}if(c[0]===6&&e.label<o[1]){e.label=o[1],o=c;break}if(o&&e.label<o[2]){e.label=o[2],e.ops.push(c);break}o[2]&&e.ops.pop(),e.trys.pop();continue}c=t.call(n,e)}catch(d){c=[6,d],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function __spreadArray(n,t,e){if(e||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return n.concat(o||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;function createSymbol(n){return typeof Symbol=="undefined"?"$Symbol<".concat(n,">$"):Symbol(n)}var EVENT_SYMBOL=createSymbol("$$FIVE_EVENT$$");function __generateEventIfNotExisted(n){return n[EVENT_SYMBOL]||(n[EVENT_SYMBOL]={}),n[EVENT_SYMBOL]}function __removeEvents(n){n[EVENT_SYMBOL]&&delete n[EVENT_SYMBOL]}var Subscribe=function(){function n(){}return n.prototype.hasListener=function(t){var e=__generateEventIfNotExisted(this);return e&&e[t]&&e[t].callbacks.length>0},n.prototype.on=function(t,e,r){var i=this,o=__generateEventIfNotExisted(this);return o[t]||(o[t]={called:[!1],callbacks:[]}),o[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){__removeEvents(this);return}var r=__generateEventIfNotExisted(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,o=__generateEventIfNotExisted(this);o[t]||(o[t]={called:[!1],callbacks:[]}),o[t].called=[!0,e];for(var s=o[t].callbacks.slice(),u=0,l=s;u<l.length;u++){var c=l[u],d=c[0],f=c[1],m=f===void 0?!1:f,A=d.apply(void 0,e);m&&this.off(t,d),A===!1&&(i=!0)}return i},n.prototype.waitUnitl=function(t){var e=this,r=__generateEventIfNotExisted(this);r[t]||(r[t]={called:[!1],callbacks:[]});var i=r[t].called,o=i[0],s=i[1];return o?Promise.resolve(s):new Promise(function(u){e.once(t,function(){for(var l=[],c=0;c<arguments.length;c++)l[c]=arguments[c];return u(l),!0})})},n}();function noop$1(){}var start=typeof performance!="undefined"&&typeof performance.timing!="undefined"?performance.timing.navigationStart:Date.now(),now=typeof performance!="undefined"?function(){return start+performance.now()}:function(){return Date.now()};function deepFreeze(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])&&deepFreeze(n[r])}),n}var domainRegex=/^([^.]+)(\.([^.]+))*$/;function match(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 isIPDomain(n){return/^(([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])(\.(?!$)|$)){4}$/.test(n)}function matchDomain(n,t){return domainRegex.test(n)&&domainRegex.test(t)&&match(n,t)}var JSONP_REGEXPS=[/\.([0-9a-z]+)\.jsonp([\?\#].*)?$/i,/jsonp_([0-9a-z]+)([\?\#].*)?$/i],BUILDIN_ALLOW_HOST=deepFreeze(JSON.parse(function(){var t=113,e=126,r=0,i="";return arguments[r].split(i).map(function(o){return o.charCodeAt(r)>e?o:String.fromCharCode((o.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"))),NetworkProxyError=function(n){__extends(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),NetworkResponseError=function(n){__extends(t,n);function t(e,r,i){var o=n.call(this,"[NETWORK]: response error(type: ".concat(r,", status: ").concat(i,"): ").concat(e))||this;return o.httpStatus=i,o}return t}(Error);(function(n){__extends(t,n);function t(e,r){return n.call(this,"[NETWORK]: request abort(type: ".concat(r,"): ").concat(e))||this}return t})(Error);var NetworkTimeoutError=function(n){__extends(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),NetworkFirbiddenError=function(n){__extends(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 parseHeaders(n){if(!n)return{};for(var t={},e=n.trim().split(`
391
- `),r=0;r<e.length;r++){var i=e[r],o=i.indexOf(":"),s=i.slice(0,o).trim().toLowerCase(),u=i.slice(o+1).trim();u&&(t[s]?t[s]+=", "+u:t[s]=u)}return t}function matchJsonpFunctionName(n){for(var t=0,e=JSONP_REGEXPS;t<e.length;t++){var r=e[t],i=n.match(r);if(i)return"jsonp_"+i[1]}return null}function isJsonpSource(n){return matchJsonpFunctionName(n)!==null}function getProtocol(n){var t=n.match(/^([0-9a-z]+\:)\/\/(([^:/?#]*)(?::[0-9]+)?)/);return t?t[1]:location.protocol}function hostnameFromURL(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 NetworkSubscribe=function(n){__extends(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(Subscribe);function ajax(n,t,e,r,i){t===void 0&&(t={}),e===void 0&&(e=noop$1),r===void 0&&(r=noop$1),i===void 0&&(i=noop$1);var o=now(),s=n;return Promise.resolve().then(function(){return t.requestProxy?t.requestProxy(n):n}).then(function(u){return/^https\:/.test(location.href)&&/^http\:/.test(u)?(console.warn("The page at '".concat(location.href,"' was loaded over HTTPS, but requested an insecure element '").concat(u,"'. This request was automatically upgraded to HTTPS")),u.replace(/^http\:/,"https:")):u}).catch(function(u){var l,c=matchJsonpFunctionName(n),d=c?"Script":"XMLHttpRequest",f=new NetworkProxyError(s,d,u&&u.message?String(u.message):String(u));return(l=t.networkSubscribe)===null||l===void 0||l.emit("network",n,d,"proxy-error",f.message),Promise.reject(f)}).then(function(u){return new Promise(function(l,c){var d,f=t.allowHosts?BUILDIN_ALLOW_HOST.concat(t.allowHosts):BUILDIN_ALLOW_HOST.slice(),m=hostnameFromURL(u),A=matchJsonpFunctionName(u);if(location.hostname.length!==0&&!isIPDomain(location.hostname)&&BUILDIN_ALLOW_HOST.filter(function(H){return matchDomain(H,location.hostname)}).length===0&&!isIPDomain(m)&&f.filter(function(H){return matchDomain(H,m)}).length===0){var h=A?"Script":"XMLHttpRequest",p=new NetworkFirbiddenError(u,h,"request host(".concat(m,") is not allowed"));r(p),c(p),(d=t.networkSubscribe)===null||d===void 0||d.emit("network",u,h,"forbidden",p.message);return}if(A){var y=window,v=null,g=!1,E=document.createElement("script"),b=function(){var H;if(v=null,g!==!0){g=!0;var B=new NetworkTimeoutError(u,"Script",t.timeout||NaN);r(B),c(B),(H=t.networkSubscribe)===null||H===void 0||H.emit("network",u,"Script","timeout",B.message)}},T=function(H){var B,L,O=now(),k=O-o;if(delete y[A],E.parentNode&&E.parentNode.removeChild(E),v!==null&&(window.clearTimeout(v),v=null),g!==!0){if(H.indexOf("data:")!==0){var K=new NetworkResponseError(u,"Script",500);r(K),c(K),(B=t.networkSubscribe)===null||B===void 0||B.emit("network",u,"Script","error",K.message);return}var z=H.split(","),N=(z[0].match(/:(.*?);/)||[])[1],U=z[1];if(t.responseType==="arraybuffer"||t.responseType==="blob"){for(var Q=atob(z[1]),G=Q.length,q=new Uint8Array(G),j=0;j<G;j++)q[j]=Q.charCodeAt(j);t.responseType==="arraybuffer"?U=q.buffer:U=new Blob([q],{type:N})}var X={},ae={body:U,meta:{origin:s,source:u,requestTime:o,responseTime:O,costs:k,headers:X}};e(ae),l(ae),(L=t.networkSubscribe)===null||L===void 0||L.emit("network",u,"Script","ok",JSON.stringify(ae.meta)),g=!0}};y[A]=T,E.src=u,document.body.appendChild(E),typeof t.timeout=="number"&&(v=window.setTimeout(b,t.timeout))}else{var _=!1,x=new XMLHttpRequest,R=function(){x&&(x.removeEventListener("timeout",w,!1),x.removeEventListener("progress",S,!1),x.removeEventListener("load",C,!1),x.removeEventListener("error",I,!1)),x=null,R=noop$1},w=function(){var H;if(_!==!0){_=!0,R();var B=new NetworkTimeoutError(u,"XMLHttpRequest",t.timeout||NaN);r(B),c(B),(H=t.networkSubscribe)===null||H===void 0||H.emit("network",u,"XMLHttpRequest","timeout",B.message)}},S=function(H){_!==!0&&H.lengthComputable&&(H.total<=0||i(H.loaded/H.total))},C=function(H){var B;if(_!==!0){var L=this.status;if(L===0||L>=200&&L<400){_=!0,R();var O=now(),k=O-o,K=parseHeaders(this.getAllResponseHeaders()),z=H.total,N={body:this.response,meta:{origin:s,source:u,requestTime:o,responseTime:O,costs:k,headers:K,size:z}};e(N),l(N),(B=t.networkSubscribe)===null||B===void 0||B.emit("network",u,"XMLHttpRequest","ok",JSON.stringify(N.meta))}else I.call(this)}},I=function(){var H;if(_!==!0){_=!0,R();var B=new NetworkResponseError(u,"XMLHttpRequest",this.status);r(B),c(B),(H=t.networkSubscribe)===null||H===void 0||H.emit("network",u,"XMLHttpRequest","error",B.message)}};x.addEventListener("timeout",w,!1),x.addEventListener("progress",S,!1),x.addEventListener("load",C,!1),x.addEventListener("error",I,!1),t.responseType&&(x.responseType=t.responseType),typeof t.timeout=="number"&&(x.timeout=t.timeout),x.open("GET",u,!0),x.send(null)}})})}var preloadCache={};function preload(n,t){t===void 0&&(t={});var e=now(),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 o,s=new NetworkProxyError(r,"Link",i&&i.message?String(i.message):String(i));return(o=t.networkSubscribe)===null||o===void 0||o.emit("network",n,"Link","proxy-error",s.message),Promise.reject(s)}).then(function(i){return i in preloadCache?preloadCache[i]:preloadCache[i]=new Promise(function(o,s){var u,l=t.allowHosts?BUILDIN_ALLOW_HOST.concat(t.allowHosts):BUILDIN_ALLOW_HOST.slice(),c=hostnameFromURL(i);if(location.hostname.length!==0&&!isIPDomain(location.hostname)&&BUILDIN_ALLOW_HOST.filter(function(h){return matchDomain(h,location.hostname)}).length===0&&!isIPDomain(c)&&l.filter(function(h){return matchDomain(h,c)}).length===0){var d=new NetworkFirbiddenError(i,"Link","request host(".concat(c,") is not allowed"));s(d),(u=t.networkSubscribe)===null||u===void 0||u.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 m=document.head||document.getElementsByTagName("head")[0];m&&m.appendChild(f);var A=!1;f.onload=function(){var h;if(A!==!0){A=!0,o();var p=now(),y=p-e,v={},g={origin:r,source:i,requestTime:e,responseTime:p,costs:y,headers:v};(h=t.networkSubscribe)===null||h===void 0||h.emit("network",i,"Link","preload",JSON.stringify(g))}},f.onerror=function(h){var p;if(A!==!0){A=!0;var y=new NetworkResponseError(i,"Link",0);s(y),(p=t.networkSubscribe)===null||p===void 0||p.emit("network",i,"Link","error",y.message)}}})})}function loadImage(n,t,e,r,i,o){t===void 0&&(t={}),e===void 0&&(e=noop$1),r===void 0&&(r=noop$1),i===void 0&&(i=noop$1);var s=now(),u=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 c,d=new NetworkProxyError(u,"Image",l&&l.message?String(l.message):String(l));return(c=t.networkSubscribe)===null||c===void 0||c.emit("network",n,"Image","proxy-error",d.message),Promise.reject(d)}).then(function(l){return new Promise(function(c,d){var f,m=t.allowHosts?BUILDIN_ALLOW_HOST.concat(t.allowHosts):BUILDIN_ALLOW_HOST.slice(),A=hostnameFromURL(l);if(location.hostname.length!==0&&!isIPDomain(location.hostname)&&BUILDIN_ALLOW_HOST.filter(function(b){return matchDomain(b,location.hostname)}).length===0&&!isIPDomain(A)&&m.filter(function(b){return matchDomain(b,A)}).length===0){var h=new NetworkFirbiddenError(l,"Image","request host(".concat(A,") is not allowed"));r(h),d(h),(f=t.networkSubscribe)===null||f===void 0||f.emit("network",l,"Image","forbidden",h.message);return}var p=o!=null?o:new Image,y=!1,v=null,g=function(){var b;if(p.onload=noop$1,p.onerror=noop$1,v!==null&&(clearTimeout(v),v=null),y!==!0){var T=now(),_={headers:{},origin:u,source:l,requestTime:s,responseTime:T,costs:T-s};y=!0;var x={body:p,meta:_};i(1),e(x),c(x),(b=t.networkSubscribe)===null||b===void 0||b.emit("network",l,"Image","ok",JSON.stringify(x.meta))}},E=function(){var b;if(p.onload=noop$1,p.onerror=noop$1,v!==null&&(clearTimeout(v),v=null),y!==!0){y=!0;var T=new NetworkResponseError(l,"Image",0);r(T),d(T),(b=t.networkSubscribe)===null||b===void 0||b.emit("network",l,"Image","ok",T.message)}};typeof t.timeout=="number"&&(v=window.setTimeout(function(){var b;if(p.onload=noop$1,p.onerror=noop$1,v=null,y!==!0){y=!0;var T=new NetworkTimeoutError(l,"Image",t.timeout);r(T),d(T),(b=t.networkSubscribe)===null||b===void 0||b.emit("network",l,"Image","timeout",T.message)}},t.timeout)),p.onload=g,p.onerror=E,i(0),p.src=l})})}var Fetcher=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,o){var s;e===void 0&&(e={}),r===void 0&&(r=noop$1),i===void 0&&(i=noop$1),o===void 0&&(o=noop$1);var u=this.options,l={responseType:e.responseType,timeout:(s=e.timeout)!==null&&s!==void 0?s:u.timeout,get allowHosts(){var c;return(c=e.allowHosts)!==null&&c!==void 0?c:u.allowHosts},get requestProxy(){var c;return(c=e.requestProxy)!==null&&c!==void 0?c:u.requestProxy},get networkSubscribe(){var c;return(c=e.networkSubscribe)!==null&&c!==void 0?c:u.networkSubscribe}};return ajax(t,l,r,i,o)},n.prototype.loadImage=function(t,e,r,i,o,s){var u;e===void 0&&(e={}),r===void 0&&(r=noop$1),i===void 0&&(i=noop$1),o===void 0&&(o=noop$1);var l=this.options,c={timeout:(u=e.timeout)!==null&&u!==void 0?u: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 loadImage(t,c,r,i,o,s)},n.prototype.preload=function(t,e){var r;e===void 0&&(e={});var i=this.options,o={timeout:(r=e.timeout)!==null&&r!==void 0?r:i.timeout,get allowHosts(){var s;return(s=e.allowHosts)!==null&&s!==void 0?s:i.allowHosts},get requestProxy(){var s;return(s=e.requestProxy)!==null&&s!==void 0?s:i.requestProxy},get networkSubscribe(){var s;return(s=e.networkSubscribe)!==null&&s!==void 0?s:i.networkSubscribe}};return preload(t,o)},n}(),internalFetcher=new Fetcher,_requestAnimationFrame=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)}}(),_cancelAnimationFrame=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)},DEFAULT_ORDER=5,deviceFrameTime=16,AnimationFrameLoop=function(){function n(){this.frames=[],this.stoped=!1,this.time=now(),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 deviceFrameTime},n.prototype.loop=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(!this.stoped){var r=now(),i=r-this.time;this.time=r;var o=[];deviceFrameTime=i;for(var s=0,u=this.frames;s<u.length;s++){var l=u[s];if(l.delay>0){l.delay=l.delay-1;continue}try{l.callback.apply(l,__spreadArray([r,i],t,!1))}catch(c){console.error(c)}l.once&&o.push(l)}o.length>0&&(this.frames=this.frames.filter(function(c){return o.indexOf(c)===-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):_requestAnimationFrame(t)},n.prototype.cancelAnimationFrame=function(t){this.context?this.context.cancelAnimationFrame(t):_cancelAnimationFrame(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 o=this;e===void 0&&(e=!1),r===void 0&&(r=0),i===void 0&&(i=DEFAULT_ORDER);var s={callback:t,once:e,delay:r,order:i};return this.frames.push(s),this.frames.sort(function(u,l){return u.order-l.order}),function(){return o.remove(s)}},n.prototype.disponse=function(){this.stoped=!0,this.frames.length=0},n}();function clamp$1(n,t,e){return n<t?t:n>e?e:n}var DEFAULT_IMAGE_URL_MAPPINGS={"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"]}},URL_DOMAIN_REGEX=/^https?\:\/\/?([^\/]+)/;function getDomain(n){var t=n.match(URL_DOMAIN_REGEX);return t===null?null:t[1]}function replaceDomain(n,t){return n.replace(URL_DOMAIN_REGEX,function(e,r){return e.slice(0,e.length-r.length)+t})}function route(n,t,e){var r=t.split("."),i=r[0],o=r.slice(1);if(i==="texture")return replaceDomain(n,e.texture[0]);if(i==="pano"||i==="pano_luminance"){o[0];var s=o[1];switch(s){case"front":case"left":case"up":return replaceDomain(n,e.pano[0]);case"down":case"right":case"back":return replaceDomain(n,e.pano[1])}}else if(i==="pano_tile"||i==="pano_tile_luminance"){o[0],o[1];var u=o[2],l=o[3],c=o[4],d=Math.pow(2,Number(u))*Number(l)+Number(c);if(!isNaN(d))return replaceDomain(n,e.tile[d%2])}else if(i==="model"){var f=o[0],d=Number(f);if(!isNaN(d))return replaceDomain(n,e.model[d%2])}return replaceDomain(n,e.default[0])}var tencentCloudImageProcesser=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 o="";if(t.format!==void 0&&t.format!==i&&(o+="/format/".concat(t.format)),t.cut!==void 0&&(o+="/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 s=(e=t.format)!==null&&e!==void 0?e:i;s&&["jpg","webp","tpg","heif","avif"].indexOf(s)>=0&&(o+="/quality/".concat(t.quality))}if(t.size!==void 0){var u=n.match(/\/cube_(\d+)\//),l=u?Number(u[1]):NaN;l!==Number(t.size)&&(o+="/thumbnail/".concat(t.size,"x"))}return t.sharpen!==void 0&&(o+="/sharpen/".concat(t.sharpen)),o.length&&(o="?imageMogr2"+o),r+o},aliyunOOSImageProcesser=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 o="",s=[],u=t.format,l=t.quality,c=t.size;if(u!==void 0&&u!==i&&s.push("format,".concat(u==="heif"?"heic":u)),t.cut!==void 0){var d=t.cut,f=d[0],m=d[1],A=d[2],h=d[3];s.push("crop,x_".concat(f,",y_").concat(m,",w_").concat(A,",h_").concat(h,",g_nw"))}if(l!==void 0&&l!==100){var p=(e=t.format)!==null&&e!==void 0?e:i;p&&["jpg","webp"].indexOf(p)>=0&&s.push("quality,Q_".concat(l))}return c&&c!==2048&&s.push("resize,w_".concat(c)),t.sharpen!==void 0&&s.push("sharpen,".concat(t.sharpen)),s.length&&(o="?x-oss-process=image/"+s.join("/")),r+o},MAX_SAFE_INTEGER=9007199254740991;function formatNumber(n){var t=Math.round(n);return Math.abs(t-n)<.001?t:Math.floor(n)}function formatOptions(n){return n=Object.assign({},n),n.size!==void 0&&(n.size=formatNumber(clamp$1(n.size,0,MAX_SAFE_INTEGER))),n.quality!==void 0&&(n.quality=formatNumber(clamp$1(n.quality,0,100))),n.cut!==void 0&&(n.cut=[formatNumber(clamp$1(n.cut[0],0,MAX_SAFE_INTEGER)),formatNumber(clamp$1(n.cut[1],0,MAX_SAFE_INTEGER)),formatNumber(clamp$1(n.cut[2],0,MAX_SAFE_INTEGER)),formatNumber(clamp$1(n.cut[3],0,MAX_SAFE_INTEGER))]),n.sharpen!==void 0&&(n.sharpen=formatNumber(clamp$1(n.sharpen,0,MAX_SAFE_INTEGER))),n}function imageURL(n,t){var e=__assign(__assign({},DEFAULT_IMAGE_URL_MAPPINGS),t.mappings),r=getDomain(n);if(r===null)return n;t=formatOptions(t);var i=e[r];return i?(n=route(n,t.key,i),/\.basis(\?|$)/.test(n)&&(n=n.replace(/\.basis(\?|$)/,".jpg$1")),i.type==="tencentCloud"?tencentCloudImageProcesser(n,t):i.type==="aliyun"?aliyunOOSImageProcesser(n,t):n):n}function applyImageURLOptions(n,t,e){t===void 0&&(t=imageURL);var r=t(n,e);if(r===n&&e.cut)throw new Error("ImageURL: cut option not applied.");return r}var IMAGE_SIZE_REG=/\/cube_(\d+)\//;function getImageSizeFromURL(n){var t=n.match(IMAGE_SIZE_REG);return t?Number(t[1]):null}function replaceImageSize(n,t){return n.replace(IMAGE_SIZE_REG,"/cube_".concat(t,"/"))}var webp="data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoCAAIAAUAmJaQAA3AA/vz0AAA=",avif="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAAGhbWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAsaWxvYwAAAABEAAACAAEAAAABAAAB3gAAABkAAgAAAAEAAAHJAAAAFQAAAEJpaW5mAAAAAAACAAAAGmluZmUCAAAAAAEAAGF2MDFDb2xvcgAAAAAaaW5mZQIAAAAAAgAAYXYwMUFscGhhAAAAABppcmVmAAAAAAAAAA5hdXhsAAIAAQABAAAA12lwcnAAAACxaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIAAoAAAAAUaXNwZQAAAAAAAAACAAAAAgAAAA5waXhpAAAAAAEIAAAADGF2MUOBABwAAAAAOGF1eEMAAAAAdXJuOm1wZWc6bXBlZ0I6Y2ljcDpzeXN0ZW1zOmF1eGlsaWFyeTphbHBoYQAAAAAeaXBtYQAAAAAAAAACAAEEAQKDBAACBAUGhwgAAAA2bWRhdBIACgQYADLVMgsWQBhhIAQqrNj/+BIACgUYADLEoDIOFkADDDDCQAACDaqCCb4=",heif="data:image/heif;base64,AAAAGGZ0eXBoZWljAAAAAG1pZjFoZWljAAABL21ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAHBpY3QAAAAAAAAAAAAAAAAAAAAADnBpdG0AAAAAAAEAAAAjaWluZgAAAAAAAQAAABVpbmZlAgAAAAABAABodmMxAAAAAK9pcHJwAAAAkmlwY28AAAB2aHZjQwEBYAAAAAAAAAAAAADwAPz9+PgAACcDoAABAB5AAQwG//8BYAAAAwAAAwAAAwAAAwAAAwAAreTLgSChAAEAI0IBBwFgAAADAAADAAADAAADAAADAAChInJJlreTLySZNdggogABAAdEAcA98DMkAAAAFGlzcGUAAAAAAAAAAgAAAAIAAAAVaXBtYQAAAAAAAAABAAECgQIAAAAiaWxvYwAAAABEQAABAAEAAAAAAU8AAQAAAAAAAAAOAAAAFm1kYXQAAAAKJgGvLvkQwuWM4A==";function checkImage(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 imageSupportCache=null;function imageSupport(){return imageSupportCache||(imageSupportCache=Promise.all([checkImage(webp),checkImage(avif),checkImage(heif)]).then(function(n){return{webp:n[0],avif:n[1],heif:n[2]}}))}var PANO_ID_REG=/^(.*)\[(\d+)\]$/;function panoStringify(n){if(!isNaN(n.panoIndex)&&isFinite(n.panoIndex))return"".concat(n.workCode,"[").concat(n.panoIndex,"]");throw new Error("Invalid Pano")}function panoParse(n){var t=n.match(PANO_ID_REG);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 panoEqual(n,t){return panoStringify(n)===panoStringify(t)}function isPanoId(n){return typeof n=="string"&&PANO_ID_REG.test(n)}var PBMGroup=function(n){__extends(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(THREE__namespace.Group),PBMMesh=function(n){__extends(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.onBeforeRender=onBeforeRender$1,i}return t}(THREE__namespace.Mesh);function onBeforeRender$1(n,t,e){for(var r=0,i=this.material;r<i.length;r++){var o=i[r];this.model&&o.syncModel(this.model),o.update(n,e)}}var gradientTexture=function(){return typeof document!="undefined"?new THREE__namespace.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 THREE__namespace.Texture}();gradientTexture.minFilter=THREE__namespace.NearestFilter,gradientTexture.magFilter=THREE__namespace.NearestFilter,gradientTexture.wrapS=THREE__namespace.RepeatWrapping,gradientTexture.wrapT=THREE__namespace.RepeatWrapping;var defaultPbmParameters={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};function isEqualClipperParameters(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 isEqualPBMPanoPicture(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 updatePBMParameters(n,t){var e=!1;for(var r in t)switch(r){case"clippers":isEqualClipperParameters(n[r],t[r])||(n[r]=t[r],e=!0);break;case"pano0":case"pano1":isEqualPBMPanoPicture(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 PBMPointCloud=function(n){__extends(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.onBeforeRender=onBeforeRender,i}return t}(THREE__namespace.Points);function onBeforeRender(n,t,e){this.model&&this.material.syncModel(this.model),this.material.update(n,e)}var scratchMaterialSet=new Set,PBMContainer=function(n){__extends(t,n);function t(){var e=n.call(this)||this;return e.needsRender=!0,e.pbmMaterialParametersVersion=0,e.materialParameters=__assign({},defaultPbmParameters),e}return t.prototype.getMaterial=function(){return __assign({},this.materialParameters)},t.prototype.setMaterial=function(e){var r=this;Object.assign(this.materialParameters,e),scratchMaterialSet.clear(),this.traverse(function(i){if(i instanceof PBMMesh)for(var o=0,s=i.material;o<s.length;o++){var u=s[o];scratchMaterialSet.has(u)||(Object.assign(u,r.materialParameters),scratchMaterialSet.add(u))}i instanceof PBMPointCloud&&(scratchMaterialSet.has(i.material)||(Object.assign(i.material,r.materialParameters),scratchMaterialSet.add(i.material)))}),scratchMaterialSet.clear(),this.needsRender=!0},t}(THREE__namespace.Group),FACE_ORDER$1=["right","left","up","down","front","back"];function getBox(n,t,e,r){var i=new THREE__namespace.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 THREE__namespace.Matrix4().makeRotationY(Math.PI))}var createChildren=function(n,t){if(!(n.level>=t))for(var e=n.level+1,r=n.size/2,i=[new THREE__namespace.Vector2(n.position.x,n.position.y),new THREE__namespace.Vector2(n.position.x+r,n.position.y),new THREE__namespace.Vector2(n.position.x,n.position.y+r),new THREE__namespace.Vector2(n.position.x+r,n.position.y+r)],o=0,s=i;o<s.length;o++){var u=s[o],l={face:n.face,level:e,size:r,position:u,box:getBox(n.face,u.x,u.y,r),children:[]};n.children.push(l),createChildren(l,t)}};function createTileCubeNode(n,t){var e={level:0,face:n,position:new THREE__namespace.Vector2(0,0),size:1,box:getBox(n,0,0,1),children:[]};return createChildren(e,t),e}function createTileCubeTree(n){var t=FACE_ORDER$1.map(function(e){return createTileCubeNode(e,n)});return{children:t}}function traverseTileCubeNode(n,t){for(var e=0,r=n.children;e<r.length;e++){var i=r[e],o=t(i);o!==!1&&traverseTileCubeNode(i,t)}}var CUBE_GEOMETRY=new THREE__namespace.BoxBufferGeometry(1,1,1,1,1);CUBE_GEOMETRY.deleteAttribute("uv"),CUBE_GEOMETRY.deleteAttribute("normal"),CUBE_GEOMETRY.groups=[],CUBE_GEOMETRY.scale(-1,1,1);var CUBE_VERTEX_SHADER=`
390
+ `,T},typeof n=="string"&&(n.indexOf("-----BEGIN")!=-1?this.readCertPEM(n):KJUR.lang.String.isHex(n)&&this.readCertHex(n))}X509.hex2dn=function(n,t){t===void 0&&(t=0);var e=new X509;ASN1HEX.getTLV(n,t);var r=e.getX500Name(n);return r.str},X509.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=ASN1HEX.getChildIdx(n,t),i=0;i<r.length;i++)e.push(X509.hex2attrTypeValue(n,r[i]));return e=e.map(function(o){return o.replace("+","\\+")}),e.join("+")},X509.hex2attrTypeValue=function(n,t){var e=ASN1HEX,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 o=r(n,i[0]),s=KJUR.asn1.ASN1Util.oidHexToInt(o),u=KJUR.asn1.x509.OID.oid2atype(s),c=r(n,i[1]),l=hextorstr(c);return u+"="+l},X509.getPublicKeyFromCertHex=function(n){var t=new X509;return t.readCertHex(n),t.getPublicKey()},X509.getPublicKeyFromCertPEM=function(n){var t=new X509;return t.readCertPEM(n),t.getPublicKey()},X509.getPublicKeyInfoPropOfCertPEM=function(n){var t=ASN1HEX,e=t.getVbyList,r={},i,o;return r.algparam=null,i=new X509,i.readCertPEM(n),o=i.getPublicKeyHex(),r.keyhex=e(o,0,[1],"03").substr(2),r.algoid=e(o,0,[0,0],"06"),r.algoid==="2a8648ce3d0201"&&(r.algparam=e(o,0,[0,1],"06")),r},X509.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"];function sha256(n){return CryptoJS.SHA256(n).toString()}var certificates=[function(){var n=new X509;return n.readCertPEM(function(){var t=113,e=126,r=0,i="";return arguments[r].split(i).map(function(o){return o.charCodeAt(r)>e?o:String.fromCharCode((o.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}nzyg R]ZN=TN>bRPtTn?bf?FZ_NQtfQc^^YQNq`gdSp?cyZ^P^fQc^^QQNWQ^aRvZPNTP`\0T`Vo@Q^RWN_fapzFqSFwfbOndSnzyuYz[oaNrS=\x07\\QN>Z N\\Q^B[QqnS=\b\\QN>Zwp\\Q^B[QqnZVTSZ^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[oaPPNvVQ^fWX|gVup[N^ROO^NQttV]NQPPNt|PttVONZU|C\b\\@@e^Xv{[vTtd8`nyO@\x07ebN[bqx=ng? S^w@|XAz|qUTwfzn]Bu<qs_ae\\y<}u`eRAoE`_\\s\0r|b{rp_o<oC@o=x\bw_cUUZPApQevD\\FxFo\x07FgE=<sq[p<coqyn>TEpP@aSC_YDU8\0|8TB?c>r\\=rp`pcwP}c\0PP_\\RS\\EPVSy8x`\0?R|NP P>}A^VP}Ex\bU\x07Za=syDw}>Ya\x078wPp[pRnn\brU^dE8U?a\bcW|<FEbbupn^`ZNr sof[wA}e{\\z}w[YDQ|dt=wC Nv\x07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db _ 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 getCertificateBySubjectHex(n,t){for(var e=0,r=t;e<r.length;e++){var i=r[e];if(i.getSubjectHex()===n)return i}}function verifyCertificate_(n,t){var e=n.getIssuerHex();if(e===n.getSubjectHex())return n.verifySignature(n.getPublicKey());var r=getCertificateBySubjectHex(e,t);return!r||n.verifySignature(r.getPublicKey())===!1?!1:verifyCertificate_(r,t)}function verifyCertificate(n){var t=n.getIssuerHex();return t===n.getSubjectHex()?!1:verifyCertificate_(n,certificates)}function addCertificate(n){var t=new X509;typeof n=="string"?t.readCertPEM(n):t.readCertHex(n.hex);var e=verifyCertificate(t);return certificates.push(t),e}function verifyMessage(n,t,e){var r=new X509;if(typeof e=="string"?r.readCertPEM(e):r.readCertHex(e.hex),verifyCertificate(r)===!1)return!1;var i=new RSAKey;return i.readCertPubKeyHex(r.hex,6),!!i.verify(n,b64tohex(t))}addCertificate(function(){var t=113,e=126,r=0,i="";return arguments[r].split(i).map(function(o){return o.charCodeAt(r)>e?o:String.fromCharCode((o.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^z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^RNVOOwN[Otx\0uxvTF=ON^SNN\\PNtRNrx a[}tP_g8FbD\0^\0qt<f88ufuN]^}]gp\bqYudF88Fas_Ef` ?^x>X}esa{>\\r?eE]CC_cZ[vQs >gX[szONg=^pn=<e]nbSz\bZvac\b[w^nA_`vP|@8w[}nQobe=??oRYf{vpRxcC}yCd>8[NDx{Ne\\t8oou=guC\x07>>g\x07vb}ACd ``Ntq\0yC[Q{|ynpNQqSqzxF<_PFDw<]Bnnu>F<XgU_Zf\\\\A=gu\\codOwQ]oQ<f>gv_pwozwC}xX>C`c]suEdfW?cbeo\b`BbyR@eFTUwSud=t]sS\\onc XSq {\0\x07DvAVBbnTqEE[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 extendStatics=function(n,t){return extendStatics=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])},extendStatics(n,t)};function __extends(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");extendStatics(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var __assign=function(){return __assign=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},__assign.apply(this,arguments)};function __decorate(n,t,e,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,t,e,r);else for(var u=n.length-1;u>=0;u--)(s=n[u])&&(o=(i<3?s(o):i>3?s(t,e,o):s(t,e))||o);return i>3&&o&&Object.defineProperty(t,e,o),o}function __metadata(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)}function __awaiter(n,t,e,r){function i(o){return o instanceof e?o:new e(function(s){s(o)})}return new(e||(e=Promise))(function(o,s){function u(d){try{l(r.next(d))}catch(f){s(f)}}function c(d){try{l(r.throw(d))}catch(f){s(f)}}function l(d){d.done?o(d.value):i(d.value).then(u,c)}l((r=r.apply(n,t||[])).next())})}function __generator(n,t){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=u(0),s.throw=u(1),s.return=u(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(l){return function(d){return c([l,d])}}function c(l){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,l[0]&&(e=0)),e;)try{if(r=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return e.label++,{value:l[1],done:!1};case 5:e.label++,i=l[1],l=[0];continue;case 7:l=e.ops.pop(),e.trys.pop();continue;default:if(o=e.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){e=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){e.label=l[1];break}if(l[0]===6&&e.label<o[1]){e.label=o[1],o=l;break}if(o&&e.label<o[2]){e.label=o[2],e.ops.push(l);break}o[2]&&e.ops.pop(),e.trys.pop();continue}l=t.call(n,e)}catch(d){l=[6,d],i=0}finally{r=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function __spreadArray(n,t,e){if(e||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return n.concat(o||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;function createSymbol(n){return typeof Symbol=="undefined"?"$Symbol<".concat(n,">$"):Symbol(n)}var EVENT_SYMBOL=createSymbol("$$FIVE_EVENT$$");function __generateEventIfNotExisted(n){return n[EVENT_SYMBOL]||(n[EVENT_SYMBOL]={}),n[EVENT_SYMBOL]}function __removeEvents(n){n[EVENT_SYMBOL]&&delete n[EVENT_SYMBOL]}var Subscribe=function(){function n(){}return n.prototype.hasListener=function(t){var e=__generateEventIfNotExisted(this);return e&&e[t]&&e[t].callbacks.length>0},n.prototype.on=function(t,e,r){var i=this,o=__generateEventIfNotExisted(this);return o[t]||(o[t]={called:[!1],callbacks:[]}),o[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){__removeEvents(this);return}var r=__generateEventIfNotExisted(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,o=__generateEventIfNotExisted(this);o[t]||(o[t]={called:[!1],callbacks:[]}),o[t].called=[!0,e];for(var s=o[t].callbacks.slice(),u=0,c=s;u<c.length;u++){var l=c[u],d=l[0],f=l[1],v=f===void 0?!1:f,A=d.apply(void 0,e);v&&this.off(t,d),A===!1&&(i=!0)}return i},n.prototype.waitUnitl=function(t){var e=this,r=__generateEventIfNotExisted(this);r[t]||(r[t]={called:[!1],callbacks:[]});var i=r[t].called,o=i[0],s=i[1];return o?Promise.resolve(s):new Promise(function(u){e.once(t,function(){for(var c=[],l=0;l<arguments.length;l++)c[l]=arguments[l];return u(c),!0})})},n}();function noop$1(){}var start=typeof performance!="undefined"&&typeof performance.timing!="undefined"?performance.timing.navigationStart:Date.now(),now=typeof performance!="undefined"?function(){return start+performance.now()}:function(){return Date.now()};function deepFreeze(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])&&deepFreeze(n[r])}),n}var domainRegex=/^([^.]+)(\.([^.]+))*$/;function match(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 isIPDomain(n){return/^(([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])(\.(?!$)|$)){4}$/.test(n)}function matchDomain(n,t){return domainRegex.test(n)&&domainRegex.test(t)&&match(n,t)}var JSONP_REGEXPS=[/\.([0-9a-z]+)\.jsonp([\?\#].*)?$/i,/jsonp_([0-9a-z]+)([\?\#].*)?$/i],BUILDIN_ALLOW_HOST=deepFreeze(JSON.parse(function(){var t=113,e=126,r=0,i="";return arguments[r].split(i).map(function(o){return o.charCodeAt(r)>e?o:String.fromCharCode((o.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"))),NetworkProxyError=function(n){__extends(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),NetworkResponseError=function(n){__extends(t,n);function t(e,r,i){var o=n.call(this,"[NETWORK]: response error(type: ".concat(r,", status: ").concat(i,"): ").concat(e))||this;return o.httpStatus=i,o}return t}(Error);(function(n){__extends(t,n);function t(e,r){return n.call(this,"[NETWORK]: request abort(type: ".concat(r,"): ").concat(e))||this}return t})(Error);var NetworkTimeoutError=function(n){__extends(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),NetworkFirbiddenError=function(n){__extends(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 parseHeaders(n){if(!n)return{};for(var t={},e=n.trim().split(`
391
+ `),r=0;r<e.length;r++){var i=e[r],o=i.indexOf(":"),s=i.slice(0,o).trim().toLowerCase(),u=i.slice(o+1).trim();u&&(t[s]?t[s]+=", "+u:t[s]=u)}return t}function matchJsonpFunctionName(n){for(var t=0,e=JSONP_REGEXPS;t<e.length;t++){var r=e[t],i=n.match(r);if(i)return"jsonp_"+i[1]}return null}function isJsonpSource(n){return matchJsonpFunctionName(n)!==null}function getProtocol(n){var t=n.match(/^([0-9a-z]+\:)\/\/(([^:/?#]*)(?::[0-9]+)?)/);return t?t[1]:location.protocol}function hostnameFromURL(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 NetworkSubscribe=function(n){__extends(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(Subscribe);function ajax(n,t,e,r,i){t===void 0&&(t={}),e===void 0&&(e=noop$1),r===void 0&&(r=noop$1),i===void 0&&(i=noop$1);var o=now(),s=n;return Promise.resolve().then(function(){return t.requestProxy?t.requestProxy(n):n}).then(function(u){return/^https\:/.test(location.href)&&/^http\:/.test(u)?(console.warn("The page at '".concat(location.href,"' was loaded over HTTPS, but requested an insecure element '").concat(u,"'. This request was automatically upgraded to HTTPS")),u.replace(/^http\:/,"https:")):u}).catch(function(u){var c,l=matchJsonpFunctionName(n),d=l?"Script":"XMLHttpRequest",f=new NetworkProxyError(s,d,u&&u.message?String(u.message):String(u));return(c=t.networkSubscribe)===null||c===void 0||c.emit("network",n,d,"proxy-error",f.message),Promise.reject(f)}).then(function(u){return new Promise(function(c,l){var d,f=t.allowHosts?BUILDIN_ALLOW_HOST.concat(t.allowHosts):BUILDIN_ALLOW_HOST.slice(),v=hostnameFromURL(u),A=matchJsonpFunctionName(u);if(location.hostname.length!==0&&!isIPDomain(location.hostname)&&BUILDIN_ALLOW_HOST.filter(function(L){return matchDomain(L,location.hostname)}).length===0&&!isIPDomain(v)&&f.filter(function(L){return matchDomain(L,v)}).length===0){var h=A?"Script":"XMLHttpRequest",p=new NetworkFirbiddenError(u,h,"request host(".concat(v,") is not allowed"));r(p),l(p),(d=t.networkSubscribe)===null||d===void 0||d.emit("network",u,h,"forbidden",p.message);return}if(A){var y=window,m=null,g=!1,E=document.createElement("script"),b=function(){var L;if(m=null,g!==!0){g=!0;var C=new NetworkTimeoutError(u,"Script",t.timeout||NaN);r(C),l(C),(L=t.networkSubscribe)===null||L===void 0||L.emit("network",u,"Script","timeout",C.message)}},T=function(L){var C,H,F=now(),O=F-o;if(delete y[A],E.parentNode&&E.parentNode.removeChild(E),m!==null&&(window.clearTimeout(m),m=null),g!==!0){if(L.indexOf("data:")!==0){var G=new NetworkResponseError(u,"Script",500);r(G),l(G),(C=t.networkSubscribe)===null||C===void 0||C.emit("network",u,"Script","error",G.message);return}var Q=L.split(","),U=(Q[0].match(/:(.*?);/)||[])[1],D=Q[1];if(t.responseType==="arraybuffer"||t.responseType==="blob"){for(var q=atob(Q[1]),z=q.length,K=new Uint8Array(z),J=0;J<z;J++)K[J]=q.charCodeAt(J);t.responseType==="arraybuffer"?D=K.buffer:D=new Blob([K],{type:U})}var j={},re={body:D,meta:{origin:s,source:u,requestTime:o,responseTime:F,costs:O,headers:j}};e(re),c(re),(H=t.networkSubscribe)===null||H===void 0||H.emit("network",u,"Script","ok",JSON.stringify(re.meta)),g=!0}};y[A]=T,E.src=u,document.body.appendChild(E),typeof t.timeout=="number"&&(m=window.setTimeout(b,t.timeout))}else{var _=!1,S=new XMLHttpRequest,R=function(){S&&(S.removeEventListener("timeout",B,!1),S.removeEventListener("progress",I,!1),S.removeEventListener("load",x,!1),S.removeEventListener("error",M,!1)),S=null,R=noop$1},B=function(){var L;if(_!==!0){_=!0,R();var C=new NetworkTimeoutError(u,"XMLHttpRequest",t.timeout||NaN);r(C),l(C),(L=t.networkSubscribe)===null||L===void 0||L.emit("network",u,"XMLHttpRequest","timeout",C.message)}},I=function(L){_!==!0&&L.lengthComputable&&(L.total<=0||i(L.loaded/L.total))},x=function(L){var C;if(_!==!0){var H=this.status;if(H===0||H>=200&&H<400){_=!0,R();var F=now(),O=F-o,G=parseHeaders(this.getAllResponseHeaders()),Q=L.total,U={body:this.response,meta:{origin:s,source:u,requestTime:o,responseTime:F,costs:O,headers:G,size:Q}};e(U),c(U),(C=t.networkSubscribe)===null||C===void 0||C.emit("network",u,"XMLHttpRequest","ok",JSON.stringify(U.meta))}else M.call(this)}},M=function(){var L;if(_!==!0){_=!0,R();var C=new NetworkResponseError(u,"XMLHttpRequest",this.status);r(C),l(C),(L=t.networkSubscribe)===null||L===void 0||L.emit("network",u,"XMLHttpRequest","error",C.message)}};S.addEventListener("timeout",B,!1),S.addEventListener("progress",I,!1),S.addEventListener("load",x,!1),S.addEventListener("error",M,!1),t.responseType&&(S.responseType=t.responseType),typeof t.timeout=="number"&&(S.timeout=t.timeout),S.open("GET",u,!0),S.send(null)}})})}var preloadCache={};function preload(n,t){t===void 0&&(t={});var e=now(),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 o,s=new NetworkProxyError(r,"Link",i&&i.message?String(i.message):String(i));return(o=t.networkSubscribe)===null||o===void 0||o.emit("network",n,"Link","proxy-error",s.message),Promise.reject(s)}).then(function(i){return i in preloadCache?preloadCache[i]:preloadCache[i]=new Promise(function(o,s){var u,c=t.allowHosts?BUILDIN_ALLOW_HOST.concat(t.allowHosts):BUILDIN_ALLOW_HOST.slice(),l=hostnameFromURL(i);if(location.hostname.length!==0&&!isIPDomain(location.hostname)&&BUILDIN_ALLOW_HOST.filter(function(h){return matchDomain(h,location.hostname)}).length===0&&!isIPDomain(l)&&c.filter(function(h){return matchDomain(h,l)}).length===0){var d=new NetworkFirbiddenError(i,"Link","request host(".concat(l,") is not allowed"));s(d),(u=t.networkSubscribe)===null||u===void 0||u.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 v=document.head||document.getElementsByTagName("head")[0];v&&v.appendChild(f);var A=!1;f.onload=function(){var h;if(A!==!0){A=!0,o();var p=now(),y=p-e,m={},g={origin:r,source:i,requestTime:e,responseTime:p,costs:y,headers:m};(h=t.networkSubscribe)===null||h===void 0||h.emit("network",i,"Link","preload",JSON.stringify(g))}},f.onerror=function(h){var p;if(A!==!0){A=!0;var y=new NetworkResponseError(i,"Link",0);s(y),(p=t.networkSubscribe)===null||p===void 0||p.emit("network",i,"Link","error",y.message)}}})})}function loadImage(n,t,e,r,i,o){t===void 0&&(t={}),e===void 0&&(e=noop$1),r===void 0&&(r=noop$1),i===void 0&&(i=noop$1);var s=now(),u=n;return Promise.resolve().then(function(){return t.requestProxy?t.requestProxy(n):n}).then(function(c){return/^https\:/.test(location.href)&&/^http\:/.test(c)?(console.warn("The page at '".concat(location.href,"' was loaded over HTTPS, but requested an insecure element '").concat(c,"'. This request was automatically upgraded to HTTPS")),c.replace(/^http\:/,"https:")):c}).catch(function(c){var l,d=new NetworkProxyError(u,"Image",c&&c.message?String(c.message):String(c));return(l=t.networkSubscribe)===null||l===void 0||l.emit("network",n,"Image","proxy-error",d.message),Promise.reject(d)}).then(function(c){return new Promise(function(l,d){var f,v=t.allowHosts?BUILDIN_ALLOW_HOST.concat(t.allowHosts):BUILDIN_ALLOW_HOST.slice(),A=hostnameFromURL(c);if(location.hostname.length!==0&&!isIPDomain(location.hostname)&&BUILDIN_ALLOW_HOST.filter(function(b){return matchDomain(b,location.hostname)}).length===0&&!isIPDomain(A)&&v.filter(function(b){return matchDomain(b,A)}).length===0){var h=new NetworkFirbiddenError(c,"Image","request host(".concat(A,") is not allowed"));r(h),d(h),(f=t.networkSubscribe)===null||f===void 0||f.emit("network",c,"Image","forbidden",h.message);return}var p=o!=null?o:new Image,y=!1,m=null,g=function(){var b;if(p.onload=noop$1,p.onerror=noop$1,m!==null&&(clearTimeout(m),m=null),y!==!0){var T=now(),_={headers:{},origin:u,source:c,requestTime:s,responseTime:T,costs:T-s};y=!0;var S={body:p,meta:_};i(1),e(S),l(S),(b=t.networkSubscribe)===null||b===void 0||b.emit("network",c,"Image","ok",JSON.stringify(S.meta))}},E=function(){var b;if(p.onload=noop$1,p.onerror=noop$1,m!==null&&(clearTimeout(m),m=null),y!==!0){y=!0;var T=new NetworkResponseError(c,"Image",0);r(T),d(T),(b=t.networkSubscribe)===null||b===void 0||b.emit("network",c,"Image","ok",T.message)}};typeof t.timeout=="number"&&(m=window.setTimeout(function(){var b;if(p.onload=noop$1,p.onerror=noop$1,m=null,y!==!0){y=!0;var T=new NetworkTimeoutError(c,"Image",t.timeout);r(T),d(T),(b=t.networkSubscribe)===null||b===void 0||b.emit("network",c,"Image","timeout",T.message)}},t.timeout)),p.onload=g,p.onerror=E,i(0),p.src=c})})}var Fetcher=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,o){var s;e===void 0&&(e={}),r===void 0&&(r=noop$1),i===void 0&&(i=noop$1),o===void 0&&(o=noop$1);var u=this.options,c={responseType:e.responseType,timeout:(s=e.timeout)!==null&&s!==void 0?s:u.timeout,get allowHosts(){var l;return(l=e.allowHosts)!==null&&l!==void 0?l:u.allowHosts},get requestProxy(){var l;return(l=e.requestProxy)!==null&&l!==void 0?l:u.requestProxy},get networkSubscribe(){var l;return(l=e.networkSubscribe)!==null&&l!==void 0?l:u.networkSubscribe}};return ajax(t,c,r,i,o)},n.prototype.loadImage=function(t,e,r,i,o,s){var u;e===void 0&&(e={}),r===void 0&&(r=noop$1),i===void 0&&(i=noop$1),o===void 0&&(o=noop$1);var c=this.options,l={timeout:(u=e.timeout)!==null&&u!==void 0?u:c.timeout,get allowHosts(){var d;return(d=e.allowHosts)!==null&&d!==void 0?d:c.allowHosts},get requestProxy(){var d;return(d=e.requestProxy)!==null&&d!==void 0?d:c.requestProxy},get networkSubscribe(){var d;return(d=e.networkSubscribe)!==null&&d!==void 0?d:c.networkSubscribe}};return loadImage(t,l,r,i,o,s)},n.prototype.preload=function(t,e){var r;e===void 0&&(e={});var i=this.options,o={timeout:(r=e.timeout)!==null&&r!==void 0?r:i.timeout,get allowHosts(){var s;return(s=e.allowHosts)!==null&&s!==void 0?s:i.allowHosts},get requestProxy(){var s;return(s=e.requestProxy)!==null&&s!==void 0?s:i.requestProxy},get networkSubscribe(){var s;return(s=e.networkSubscribe)!==null&&s!==void 0?s:i.networkSubscribe}};return preload(t,o)},n}(),internalFetcher=new Fetcher,_requestAnimationFrame=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)}}(),_cancelAnimationFrame=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)},DEFAULT_ORDER=5,deviceFrameTime=16,AnimationFrameLoop=function(){function n(){this.frames=[],this.stoped=!1,this.time=now(),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 deviceFrameTime},n.prototype.loop=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(!this.stoped){var r=now(),i=r-this.time;this.time=r;var o=[];deviceFrameTime=i;for(var s=0,u=this.frames;s<u.length;s++){var c=u[s];if(c.delay>0){c.delay=c.delay-1;continue}try{c.callback.apply(c,__spreadArray([r,i],t,!1))}catch(l){console.error(l)}c.once&&o.push(c)}o.length>0&&(this.frames=this.frames.filter(function(l){return o.indexOf(l)===-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):_requestAnimationFrame(t)},n.prototype.cancelAnimationFrame=function(t){this.context?this.context.cancelAnimationFrame(t):_cancelAnimationFrame(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 o=this;e===void 0&&(e=!1),r===void 0&&(r=0),i===void 0&&(i=DEFAULT_ORDER);var s={callback:t,once:e,delay:r,order:i};return this.frames.push(s),this.frames.sort(function(u,c){return u.order-c.order}),function(){return o.remove(s)}},n.prototype.disponse=function(){this.stoped=!0,this.frames.length=0},n}();function clamp$1(n,t,e){return n<t?t:n>e?e:n}var DEFAULT_IMAGE_URL_MAPPINGS={"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"]}},URL_DOMAIN_REGEX=/^https?\:\/\/?([^\/]+)/;function getDomain(n){var t=n.match(URL_DOMAIN_REGEX);return t===null?null:t[1]}function replaceDomain(n,t){return n.replace(URL_DOMAIN_REGEX,function(e,r){return e.slice(0,e.length-r.length)+t})}function route(n,t,e){var r=t.split("."),i=r[0],o=r.slice(1);if(i==="texture")return replaceDomain(n,e.texture[0]);if(i==="pano"||i==="pano_luminance"){o[0];var s=o[1];switch(s){case"front":case"left":case"up":return replaceDomain(n,e.pano[0]);case"down":case"right":case"back":return replaceDomain(n,e.pano[1])}}else if(i==="pano_tile"||i==="pano_tile_luminance"){o[0],o[1];var u=o[2],c=o[3],l=o[4],d=Math.pow(2,Number(u))*Number(c)+Number(l);if(!isNaN(d))return replaceDomain(n,e.tile[d%2])}else if(i==="model"){var f=o[0],d=Number(f);if(!isNaN(d))return replaceDomain(n,e.model[d%2])}return replaceDomain(n,e.default[0])}var tencentCloudImageProcesser=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 o="";if(t.format!==void 0&&t.format!==i&&(o+="/format/".concat(t.format)),t.cut!==void 0&&(o+="/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 s=(e=t.format)!==null&&e!==void 0?e:i;s&&["jpg","webp","tpg","heif","avif"].indexOf(s)>=0&&(o+="/quality/".concat(t.quality))}if(t.size!==void 0){var u=n.match(/\/cube_(\d+)\//),c=u?Number(u[1]):NaN;c!==Number(t.size)&&(o+="/thumbnail/".concat(t.size,"x"))}return t.sharpen!==void 0&&(o+="/sharpen/".concat(t.sharpen)),o.length&&(o="?imageMogr2"+o),r+o},aliyunOOSImageProcesser=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 o="",s=[],u=t.format,c=t.quality,l=t.size;if(u!==void 0&&u!==i&&s.push("format,".concat(u==="heif"?"heic":u)),t.cut!==void 0){var d=t.cut,f=d[0],v=d[1],A=d[2],h=d[3];s.push("crop,x_".concat(f,",y_").concat(v,",w_").concat(A,",h_").concat(h,",g_nw"))}if(c!==void 0&&c!==100){var p=(e=t.format)!==null&&e!==void 0?e:i;p&&["jpg","webp"].indexOf(p)>=0&&s.push("quality,Q_".concat(c))}return l&&l!==2048&&s.push("resize,w_".concat(l)),t.sharpen!==void 0&&s.push("sharpen,".concat(t.sharpen)),s.length&&(o="?x-oss-process=image/"+s.join("/")),r+o},MAX_SAFE_INTEGER=9007199254740991;function formatNumber(n){var t=Math.round(n);return Math.abs(t-n)<.001?t:Math.floor(n)}function formatOptions(n){return n=Object.assign({},n),n.size!==void 0&&(n.size=formatNumber(clamp$1(n.size,0,MAX_SAFE_INTEGER))),n.quality!==void 0&&(n.quality=formatNumber(clamp$1(n.quality,0,100))),n.cut!==void 0&&(n.cut=[formatNumber(clamp$1(n.cut[0],0,MAX_SAFE_INTEGER)),formatNumber(clamp$1(n.cut[1],0,MAX_SAFE_INTEGER)),formatNumber(clamp$1(n.cut[2],0,MAX_SAFE_INTEGER)),formatNumber(clamp$1(n.cut[3],0,MAX_SAFE_INTEGER))]),n.sharpen!==void 0&&(n.sharpen=formatNumber(clamp$1(n.sharpen,0,MAX_SAFE_INTEGER))),n}function imageURL(n,t){var e=__assign(__assign({},DEFAULT_IMAGE_URL_MAPPINGS),t.mappings),r=getDomain(n);if(r===null)return n;t=formatOptions(t);var i=e[r];return i?(n=route(n,t.key,i),/\.basis(\?|$)/.test(n)&&(n=n.replace(/\.basis(\?|$)/,".jpg$1")),i.type==="tencentCloud"?tencentCloudImageProcesser(n,t):i.type==="aliyun"?aliyunOOSImageProcesser(n,t):n):n}function applyImageURLOptions(n,t,e){t===void 0&&(t=imageURL);var r=t(n,e);if(r===n&&e.cut)throw new Error("ImageURL: cut option not applied.");return r}var IMAGE_SIZE_REG=/\/cube_(\d+)\//;function getImageSizeFromURL(n){var t=n.match(IMAGE_SIZE_REG);return t?Number(t[1]):null}function replaceImageSize(n,t){return n.replace(IMAGE_SIZE_REG,"/cube_".concat(t,"/"))}var webp="data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoCAAIAAUAmJaQAA3AA/vz0AAA=",avif="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAAGhbWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAsaWxvYwAAAABEAAACAAEAAAABAAAB3gAAABkAAgAAAAEAAAHJAAAAFQAAAEJpaW5mAAAAAAACAAAAGmluZmUCAAAAAAEAAGF2MDFDb2xvcgAAAAAaaW5mZQIAAAAAAgAAYXYwMUFscGhhAAAAABppcmVmAAAAAAAAAA5hdXhsAAIAAQABAAAA12lwcnAAAACxaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIAAoAAAAAUaXNwZQAAAAAAAAACAAAAAgAAAA5waXhpAAAAAAEIAAAADGF2MUOBABwAAAAAOGF1eEMAAAAAdXJuOm1wZWc6bXBlZ0I6Y2ljcDpzeXN0ZW1zOmF1eGlsaWFyeTphbHBoYQAAAAAeaXBtYQAAAAAAAAACAAEEAQKDBAACBAUGhwgAAAA2bWRhdBIACgQYADLVMgsWQBhhIAQqrNj/+BIACgUYADLEoDIOFkADDDDCQAACDaqCCb4=",heif="data:image/heif;base64,AAAAGGZ0eXBoZWljAAAAAG1pZjFoZWljAAABL21ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAHBpY3QAAAAAAAAAAAAAAAAAAAAADnBpdG0AAAAAAAEAAAAjaWluZgAAAAAAAQAAABVpbmZlAgAAAAABAABodmMxAAAAAK9pcHJwAAAAkmlwY28AAAB2aHZjQwEBYAAAAAAAAAAAAADwAPz9+PgAACcDoAABAB5AAQwG//8BYAAAAwAAAwAAAwAAAwAAAwAAreTLgSChAAEAI0IBBwFgAAADAAADAAADAAADAAADAAChInJJlreTLySZNdggogABAAdEAcA98DMkAAAAFGlzcGUAAAAAAAAAAgAAAAIAAAAVaXBtYQAAAAAAAAABAAECgQIAAAAiaWxvYwAAAABEQAABAAEAAAAAAU8AAQAAAAAAAAAOAAAAFm1kYXQAAAAKJgGvLvkQwuWM4A==";function checkImage(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 imageSupportCache=null;function imageSupport(){return imageSupportCache||(imageSupportCache=Promise.all([checkImage(webp),checkImage(avif),checkImage(heif)]).then(function(n){return{webp:n[0],avif:n[1],heif:n[2]}}))}var PANO_ID_REG=/^(.*)\[(\d+)\]$/;function panoStringify(n){if(!isNaN(n.panoIndex)&&isFinite(n.panoIndex))return"".concat(n.workCode,"[").concat(n.panoIndex,"]");throw new Error("Invalid Pano")}function panoParse(n){var t=n.match(PANO_ID_REG);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 panoEqual(n,t){return panoStringify(n)===panoStringify(t)}function isPanoId(n){return typeof n=="string"&&PANO_ID_REG.test(n)}var PBMGroup=function(n){__extends(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(THREE__namespace.Group),PBMMesh=function(n){__extends(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.onBeforeRender=onBeforeRender$1,i}return t}(THREE__namespace.Mesh);function onBeforeRender$1(n,t,e){for(var r=0,i=this.material;r<i.length;r++){var o=i[r];this.model&&o.syncModel(this.model),o.update(n,e)}}var gradientTexture=function(){return typeof document!="undefined"?new THREE__namespace.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 THREE__namespace.Texture}();gradientTexture.minFilter=THREE__namespace.NearestFilter,gradientTexture.magFilter=THREE__namespace.NearestFilter,gradientTexture.wrapS=THREE__namespace.RepeatWrapping,gradientTexture.wrapT=THREE__namespace.RepeatWrapping;var defaultPbmParameters={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};function isEqualClipperParameters(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 isEqualPBMPanoPicture(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 updatePBMParameters(n,t){var e=!1;for(var r in t)switch(r){case"clippers":isEqualClipperParameters(n[r],t[r])||(n[r]=t[r],e=!0);break;case"pano0":case"pano1":isEqualPBMPanoPicture(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 PBMPointCloud=function(n){__extends(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.onBeforeRender=onBeforeRender,i}return t}(THREE__namespace.Points);function onBeforeRender(n,t,e){this.model&&this.material.syncModel(this.model),this.material.update(n,e)}var scratchMaterialSet=new Set,PBMContainer=function(n){__extends(t,n);function t(){var e=n.call(this)||this;return e.needsRender=!0,e.pbmMaterialParametersVersion=0,e.materialParameters=__assign({},defaultPbmParameters),e}return t.prototype.getMaterial=function(){return __assign({},this.materialParameters)},t.prototype.setMaterial=function(e){var r=this;Object.assign(this.materialParameters,e),scratchMaterialSet.clear(),this.traverse(function(i){if(i instanceof PBMMesh)for(var o=0,s=i.material;o<s.length;o++){var u=s[o];scratchMaterialSet.has(u)||(Object.assign(u,r.materialParameters),scratchMaterialSet.add(u))}i instanceof PBMPointCloud&&(scratchMaterialSet.has(i.material)||(Object.assign(i.material,r.materialParameters),scratchMaterialSet.add(i.material)))}),scratchMaterialSet.clear(),this.needsRender=!0},t}(THREE__namespace.Group),FACE_ORDER$1=["right","left","up","down","front","back"];function getBox(n,t,e,r){var i=new THREE__namespace.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 THREE__namespace.Matrix4().makeRotationY(Math.PI))}var createChildren=function(n,t){if(!(n.level>=t))for(var e=n.level+1,r=n.size/2,i=[new THREE__namespace.Vector2(n.position.x,n.position.y),new THREE__namespace.Vector2(n.position.x+r,n.position.y),new THREE__namespace.Vector2(n.position.x,n.position.y+r),new THREE__namespace.Vector2(n.position.x+r,n.position.y+r)],o=0,s=i;o<s.length;o++){var u=s[o],c={face:n.face,level:e,size:r,position:u,box:getBox(n.face,u.x,u.y,r),parent:n,children:[]};n.children.push(c),createChildren(c,t)}};function createTileCubeNode(n,t){var e={level:0,face:n,position:new THREE__namespace.Vector2(0,0),size:1,box:getBox(n,0,0,1),parent:null,children:[]};return createChildren(e,t),e}function createTileCubeTree(n){var t=FACE_ORDER$1.map(function(e){return createTileCubeNode(e,n)});return{children:t}}function traverseTileCubeNode(n,t){for(var e=0,r=n.children;e<r.length;e++){var i=r[e],o=t(i);o!==!1&&traverseTileCubeNode(i,t)}}var CUBE_GEOMETRY=new THREE__namespace.BoxBufferGeometry(1,1,1,1,1);CUBE_GEOMETRY.deleteAttribute("uv"),CUBE_GEOMETRY.deleteAttribute("normal"),CUBE_GEOMETRY.groups=[],CUBE_GEOMETRY.scale(-1,1,1);var CUBE_VERTEX_SHADER=`
392
392
  varying vec3 worldPosition;
393
393
  void main() {
394
394
  vec4 transform = vec4(position, 1.0);
@@ -401,7 +401,7 @@ varying vec3 worldPosition;
401
401
  void main() {
402
402
  gl_FragColor = textureCube(map, worldPosition);
403
403
  }
404
- `,CUBE_MATERIAL=new THREE__namespace.ShaderMaterial({uniforms:{map:{value:null}},vertexShader:CUBE_VERTEX_SHADER,fragmentShader:CUBE_RAGMENT_SHADER,depthTest:!1,depthWrite:!1,stencilWrite:!1,blending:THREE__namespace.NoBlending,lights:!1,toneMapped:!1,fog:!1}),scene$3=new THREE__namespace.Scene;scene$3.matrixAutoUpdate=!1;var mesh$5=new THREE__namespace.Mesh(CUBE_GEOMETRY,CUBE_MATERIAL);mesh$5.matrixAutoUpdate=!1,scene$3.add(mesh$5);function renderCubeTextureToCubeRenderTarget(n,t,e){CUBE_MATERIAL.uniforms.map.value=n;var r=e.autoClear;e.autoClear=!1;var i=new THREE__namespace.CubeCamera(.1,2,t);i.matrixAutoUpdate=!1,i.update(e,scene$3),e.autoClear=r,CUBE_MATERIAL.uniforms.map.value=null}var _a$3,SQRT1_2$1=(_a$3=Math.SQRT1_2)!==null&&_a$3!==void 0?_a$3:Math.sqrt(2),QUATERNION={up:new THREE__namespace.Quaternion(SQRT1_2$1,0,0,SQRT1_2$1),down:new THREE__namespace.Quaternion(-SQRT1_2$1,0,0,SQRT1_2$1),left:new THREE__namespace.Quaternion(0,SQRT1_2$1,0,SQRT1_2$1),right:new THREE__namespace.Quaternion(0,-SQRT1_2$1,0,SQRT1_2$1),front:new THREE__namespace.Quaternion(0,0,0,1),back:new THREE__namespace.Quaternion(0,1,0,0)},PLAME_GEOMETRY=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 THREE__namespace.BufferGeometry;return r.setAttribute("position",new THREE__namespace.BufferAttribute(n,3)),r.setAttribute("uv",new THREE__namespace.BufferAttribute(t,2)),r.setIndex(new THREE__namespace.BufferAttribute(e,1)),r}(),PLANE_VERTEX_SHADER=`
404
+ `,CUBE_MATERIAL=new THREE__namespace.ShaderMaterial({uniforms:{map:{value:null}},vertexShader:CUBE_VERTEX_SHADER,fragmentShader:CUBE_RAGMENT_SHADER,depthTest:!1,depthWrite:!1,stencilWrite:!1,blending:THREE__namespace.NoBlending,lights:!1,toneMapped:!1,fog:!1}),scene$3=new THREE__namespace.Scene;scene$3.matrixAutoUpdate=!1;var mesh$5=new THREE__namespace.Mesh(CUBE_GEOMETRY,CUBE_MATERIAL);mesh$5.matrixAutoUpdate=!1,scene$3.add(mesh$5);function renderCubeTextureToCubeRenderTarget(n,t,e){CUBE_MATERIAL.uniforms.map.value=n;var r=e.autoClear;e.autoClear=!1;var i=new THREE__namespace.CubeCamera(.1,2,t);i.matrixAutoUpdate=!1,i.update(e,scene$3),e.autoClear=r,CUBE_MATERIAL.uniforms.map.value=null}var _a$4,SQRT1_2$1=(_a$4=Math.SQRT1_2)!==null&&_a$4!==void 0?_a$4:Math.sqrt(2),QUATERNION={up:new THREE__namespace.Quaternion(SQRT1_2$1,0,0,SQRT1_2$1),down:new THREE__namespace.Quaternion(-SQRT1_2$1,0,0,SQRT1_2$1),left:new THREE__namespace.Quaternion(0,SQRT1_2$1,0,SQRT1_2$1),right:new THREE__namespace.Quaternion(0,-SQRT1_2$1,0,SQRT1_2$1),front:new THREE__namespace.Quaternion(0,0,0,1),back:new THREE__namespace.Quaternion(0,1,0,0)},PLAME_GEOMETRY=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 THREE__namespace.BufferGeometry;return r.setAttribute("position",new THREE__namespace.BufferAttribute(n,3)),r.setAttribute("uv",new THREE__namespace.BufferAttribute(t,2)),r.setIndex(new THREE__namespace.BufferAttribute(e,1)),r}(),PLANE_VERTEX_SHADER=`
405
405
  varying vec2 vUv;
406
406
  uniform float flipY;
407
407
  void main() {
@@ -414,9 +414,9 @@ varying vec2 vUv;
414
414
  void main() {
415
415
  gl_FragColor = texture2D(map, vUv);
416
416
  }
417
- `,cacheMaterials=[];function getMaterial(){var n=cacheMaterials.pop();return n||new THREE__namespace.ShaderMaterial({uniforms:{map:{value:null},flipY:{value:0}},vertexShader:PLANE_VERTEX_SHADER,fragmentShader:PLANE_FRAGMENT_SHADER,depthTest:!1,depthWrite:!1,stencilWrite:!1,blending:THREE__namespace.NoBlending,lights:!1,toneMapped:!1,fog:!1})}function releaseMaterial(n){n.uniforms.map.value=null,cacheMaterials.push(n)}function renderTexturesToCubeRenderTarget(n,t,e){var r=new THREE__namespace.Scene;r.matrixAutoUpdate=!1;var i=new THREE__namespace.Group;i.scale.set(1,1,-1),r.add(i);for(var o=[],s=0,u=n;s<u.length;s++){var l=u[s],c=getMaterial();o.push(c),c.uniforms.map.value=l.texture,c.uniforms.flipY.value=l.flipY?1:0;var d=new THREE__namespace.Group,f=new THREE__namespace.Mesh(PLAME_GEOMETRY,c);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(QUATERNION[l.face]),d.add(f),i.add(d)}var m=e.autoClear;e.autoClear=!1;var A=new THREE__namespace.CubeCamera(.1,2,t);A.matrixAutoUpdate=!1,A.update(e,r),e.autoClear=m;for(var h=0,p=o;h<p.length;h++){var c=p[h];releaseMaterial(c)}}var canUseNativeImageBitmap=function(){return!1}();function createImageBitmapLikeImage(){var n=Object.assign(document.createElementNS("http://www.w3.org/1999/xhtml","img"),{crossOrigin:"",close:function(){n.onerror=n.onload=n.close=noop$1,n.decoding="async";var t=n.src;n.removeAttribute("src"),/^blob\:/.test(t)&&URL.revokeObjectURL(t)}});return n}function createImageBitmapLike(n){return new Promise(function(t,e){var r=createImageBitmapLikeImage();r.onload=function(){/^blob\:/.test(r.src)&&URL.revokeObjectURL(r.src),r.onload=r.onerror=noop$1,setTimeout(function(){t(r)},10)},r.onerror=function(){var i=r.src;r.onload=r.onerror=noop$1,r.close(),e(new Error("image load error: ".concat(i)))},r.src=URL.createObjectURL(n)})}var canvasPool=[];function createCanvas(n,t){var e=canvasPool.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=noop$1,canvasPool.push(r)}});return r}function poolImageToTexture(n,t){if(t&&(n.width>t.width||n.height>t.height)){var e=createCanvas(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 THREE__namespace.Texture(e);i.needsUpdate=!0,i.flipY=!0;var o=i.dispose;return i.dispose=function(){e.close(),o.call(i),i.dispose=o},i}else{var s=new THREE__namespace.Texture(n);s.needsUpdate=!0,typeof ImageBitmap!="undefined"&&n instanceof ImageBitmap?s.flipY=!1:s.flipY=!0;var u=s.dispose;return s.dispose=function(){n.close(),u.call(s),s.dispose=u},s}}function poolImagesToCubeTexture(n){var t=new THREE__namespace.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 o=i[r];o.close()}e.call(t),t.dispose=e},t}var FACE_ORDER=["right","left","up","down","front","back"],TileCubeTextureTarget=function(){function n(t,e,r,i,o){this.tileTree=e,this.tileSources=r,this.options=i,this.renderer=o,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,o,s,u;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:THREE__namespace.RGBAFormat,t.texture.minFilter=(r=this.options.minFilter)!==null&&r!==void 0?r:THREE__namespace.LinearFilter,t.texture.magFilter=(i=this.options.magFilter)!==null&&i!==void 0?i:THREE__namespace.LinearFilter,t.texture.wrapS=(o=this.options.wrapS)!==null&&o!==void 0?o:THREE__namespace.ClampToEdgeWrapping,t.texture.wrapT=(s=this.options.wrapT)!==null&&s!==void 0?s:THREE__namespace.ClampToEdgeWrapping,t.texture.generateMipmaps=(u=this.options.generateMipmaps)!==null&&u!==void 0?u:!1,this.baseCubeTexture&&(renderCubeTextureToCubeRenderTarget(this.baseCubeTexture,t,this.renderer),this.baseCubeTexture.dispose(),this.baseCubeTexture=null),this._cubeRenderTarget&&renderCubeTextureToCubeRenderTarget(this._cubeRenderTarget.texture,t,this.renderer),this._cubeRenderTarget=t},enumerable:!1,configurable:!0}),n.prototype.requestTile=function(t){var e=this,r,i,o,s,u,l,c=this.tileSources.filter(function(p){return p.level===t.level})[0];if(!c){this.loadedCubeNodes.add(t);return}var d=c.size,f=Math.pow(2,t.level)*t.position.y,m=Math.pow(2,t.level)*t.position.x,A="".concat(((o=(i=(r=this.options.imageURL)===null||r===void 0?void 0:r.options)===null||i===void 0?void 0:i.key)!==null&&o!==void 0?o:"pano.0").replace(/^pano/,"pano_tile"),".").concat(t.face,".").concat(t.level,".").concat(f,".").concat(m),h=__assign(__assign({},(u=(s=this.options.imageURL)===null||s===void 0?void 0:s.options)!==null&&u!==void 0?u:{key:"unknown"}),{key:A,size:c.scale>=1?void 0:d*t.size*c.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(c[t.face],{imageURL:{transform:(l=this.options.imageURL)===null||l===void 0?void 0:l.transform,options:__assign({},h)},format:THREE__namespace.RGBAFormat,timeout:this.options.timeout,magFilter:this.options.magFilter,minFilter:this.options.minFilter,fetcher:this.options.fetcher}).then(function(p){if(e.disposed){p.body.dispose();return}e.textures.push({face:t.face,level:t.level,position:t.position,size:new THREE__namespace.Vector2(t.size,t.size),texture:p.body,flipY:!p.body.flipY}),e.loadedCubeNodes.add(t)}).catch(noop$1).then(function(){e.disposed||e.loadingCubeNodes.delete(t)})},n.prototype.update=function(t,e){var r=this;if(!this.disposed){var i=[];traverseTileCubeNode(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 o=0,s=i;o<s.length;o++){var u=s[o];this.requestTile(u)}if(this.cubeRenderTarget&&this.textures.length){renderTexturesToCubeRenderTarget(this.textures,this.cubeRenderTarget,this.renderer);for(var l=0,c=this.textures;l<c.length;l++){var d=c[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}(),TextureLoader=function(){function n(){}return n.prototype.loadTexture=function(t,e,r,i,o,s){var u,l,c,d,f,m,A;r===void 0&&(r=noop$1),i===void 0&&(i=noop$1),o===void 0&&(o=noop$1);var h={};typeof e.flipY!="undefined"&&(h.flipY=e.flipY),typeof e.format!="undefined"&&(h.format=e.format),typeof e.encoding!="undefined"&&(h.encoding=e.encoding),h.generateMipmaps=(u=e.generateMipmaps)!==null&&u!==void 0?u:!1,h.minFilter=(l=e.minFilter)!==null&&l!==void 0?l:THREE__namespace.LinearFilter,h.magFilter=(c=e.magFilter)!==null&&c!==void 0?c:THREE__namespace.LinearFilter;var p=(f=(d=e.imageURL)===null||d===void 0?void 0:d.options)!==null&&f!==void 0?f:{key:"unknown"};t=applyImageURLOptions(t,(m=e.imageURL)===null||m===void 0?void 0:m.transform,p);var y=getProtocol(t),v=(A=e.viaAjax)!==null&&A!==void 0?A:canUseNativeImageBitmap,g=isJsonpSource(t),E=/^https?:/.test(y);if(g?v=!0:E||(v=!1),v){var b=null,T="blob";return e.fetcher.ajax(t,{timeout:e.timeout,responseType:T},void 0,void 0,o).then(function(R){return createImageBitmapLike(R.body)}).then(function(R){return poolImageToTexture(R,e.maxSize)}).then(function(R){return Object.assign(R,h),R}).then(function(R){var w={meta:b,body:R};return r(w),w}).catch(function(R){return i(R),Promise.reject(R)})}else{var _=null,x;return Promise.resolve().then(function(){return createImageBitmapLikeImage()}).then(function(R){return x=R,e.fetcher.loadImage(t,{timeout:e.timeout},void 0,void 0,o,R)}).then(function(R){return _=R.meta,poolImageToTexture(R.body,e.maxSize)}).then(function(R){return Object.assign(R,h),R}).then(function(R){var w={meta:_,body:R};return r(w),w}).catch(function(R){return x&&x.close(),i(R),Promise.reject(R)})}},n.prototype.loadCubeTexture=function(t,e,r,i,o,s){var u,l,c,d,f,m,A;r===void 0&&(r=noop$1),i===void 0&&(i=noop$1),o===void 0&&(o=noop$1);var h={};typeof e.format!="undefined"&&(h.format=e.format),h.generateMipmaps=(u=e.generateMipmaps)!==null&&u!==void 0?u:!1,h.minFilter=(l=e.minFilter)!==null&&l!==void 0?l:THREE__namespace.LinearFilter,h.magFilter=(c=e.magFilter)!==null&&c!==void 0?c:THREE__namespace.LinearFilter;for(var p=[t[FACE_ORDER[0]],t[FACE_ORDER[1]],t[FACE_ORDER[2]],t[FACE_ORDER[3]],t[FACE_ORDER[4]],t[FACE_ORDER[5]]],y=[],v=[0,0,0,0,0,0],g=[],E=function(T){var _=(f=(d=e.imageURL)===null||d===void 0?void 0:d.options)!==null&&f!==void 0?f:{key:"unknown"},x=applyImageURLOptions(p[T],(m=e.imageURL)===null||m===void 0?void 0:m.transform,__assign(__assign({},_),{key:_.key+"."+FACE_ORDER[T]})),R=getProtocol(x),w=function(O){v[T]=O,o(v.reduce(function(k,K){return k+K},0)/6)},S=(A=e.viaAjax)!==null&&A!==void 0?A:!1,C=/^https?:$/.test(R),I=isJsonpSource(x);if(I?S=!0:C||(S=!1),S){var H="blob",B=e.fetcher.ajax(x,{timeout:e.timeout,responseType:H},void 0,void 0,w).then(function(O){return g[T]=O.meta,createImageBitmapLike(O.body)});y.push(B)}else{var L,B=Promise.resolve().then(function(){return createImageBitmapLikeImage()}).then(function(k){return L=k,e.fetcher.loadImage(x,{timeout:e.timeout},void 0,void 0,w,k)}).then(function(k){return g[T]=k.meta,k.body}).catch(function(k){return L&&L.close(),Promise.reject(k)});y.push(B)}},b=0;b<6;b++)E(b);return Promise.all(y).then(function(T){return poolImagesToCubeTexture(T)}).then(function(T){return Object.assign(T,__assign({encoding:THREE__namespace.sRGBEncoding},h)),T}).then(function(T){var _={body:T,meta:g};return r(_),_}).catch(function(T){for(var _=0,x=y;_<x.length;_++){var R=x[_];R.then(function(w){return w.close()}).catch(noop$1)}return i(T),Promise.reject(T)})},n.prototype.loadTiledCubeTexture=function(t,e,r,i,o,s,u){var l=this;return i===void 0&&(i=noop$1),o===void 0&&(o=noop$1),s===void 0&&(s=noop$1),new Promise(function(c,d){var f,m;l.loadCubeTexture(t,{imageURL:{transform:(f=r.imageURL)===null||f===void 0?void 0:f.transform,options:(m=r.imageURL)===null||m===void 0?void 0:m.options},format:THREE__namespace.RGBAFormat,viaAjax:r.viaAjax,timeout:r.timeout,fetcher:r.fetcher,magFilter:r.magFilter,minFilter:r.minFilter,generateMipmaps:r.generateMipmaps},function(A){var h,p=A.meta,y=A.body,v=(h=r.tileMaxLevel)!==null&&h!==void 0?h:2,g=Math.max(1024*v,512),E=createTileCubeTree(v),b=new TileCubeTextureTarget(y,E,e,{textureSize:g,textureLoader:l,imageURL:r.imageURL,magFilter:r.magFilter,minFilter:r.minFilter,generateMipmaps:r.generateMipmaps,timeout:r.timeout,fetcher:r.fetcher},u),T={meta:p,body:b};i(T),c(T)},function(A){o(A),d(A)},s,u).catch(noop$1)})},n}();const meshNoneVertexShader=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,o=0,s="";return t[o].split(s).map(function(u){return u.charCodeAt(o)>i?u:String.fromCharCode((u.charCodeAt(o)+r)%i)}).join(s)}("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"),meshNoneFragmentShader=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,o=0,s="";return t[o].split(s).map(function(u){return u.charCodeAt(o)>i?u:String.fromCharCode((u.charCodeAt(o)+r)%i)}).join(s)}("0qrsv{r-OYNPXlP\\Y\\_-rpA5=;=EC9-=;>=C9-=;>AF9->;=6{vs|z-nz}yrPor-}n{|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\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"),meshBasicVertexShader=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,o=0,s="";return t[o].split(s).map(function(u){return u.charCodeAt(o)>i?u:String.fromCharCode((u.charCodeAt(o)+r)%i)}).join(s)}("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{qvs0vs-qrsv{rq5b`RlcR_aRelZN_X6--nvor-sy|n-znxH0r{qvsn\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-=;=H--0vs-qrsv{rq5b`RlcR_aRelZN_X6----V_||sZnx-J-r}5no5znx-:->;=69-=;>6H--0r{qvs--0v{pyqr-I|yq}|lrr\x07K--0v{pyqr-Ir{zn}lrr\x07K--0v{pyqr-Is|tlrr\x07K\f"),meshBasicFragmentShader=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,o=0,s="";return t[o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zr{K0v{pyqr-Izn}l}nlsntzr{K0v{pyqr-Iny}unzn}l}nlsntzr{K0v{pyqr-In|zn}l}nlsntzr{K0v{pyqr-Iyvtuzn}l}nlsntzr{K0v{pyqr-Ir{zn}lp|zz|{l}nlsntzr{K0v{pyqr-Ir{zn}l}nlsntzr{K0v{pyqr-Iporllrsyrpv|{lsntzr{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--<<-JJJ-顶部裁切-JJJ--sy|n-||sP]|tr-J-}|5pynz}5:PnzrnQvrpv|{;\b9-=;=9->;=69-@;=6H--vs-5----V_||sZnx-K-=;B-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"),meshPhongVertexShader=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,o=0,s="";return t[o].split(s).map(function(u){return u.charCodeAt(o)>i?u:String.fromCharCode((u.charCodeAt(o)+r)%i)}).join(s)}("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{qvs0vs-qrsv{rq5b`RlcR_aRelZN_X6--nvor-sy|n-znxH0r{qvsn\bv{t-sy|n-V_||sZnxHn\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@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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-=;=H--0vs-qrsv{rq5b`RlcR_aRelZN_X6----V_||sZnx-J-r}5no5znx-:->;=69-=;>6H--0r{qvs--0v{pyqr-I|yq}|lrr\x07K--0v{pyqr-Ir{zn}lrr\x07K--0v{pyqr-Iunq|zn}lrr\x07K--0v{pyqr-Is|tlrr\x07K\f"),meshPhongFragmentShader=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,o=0,s="";return t[o].split(s).map(function(u){return u.charCodeAt(o)>i?u:String.fromCharCode((u.charCodeAt(o)+r)%i)}).join(s)}("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 ||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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sntzr{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----V_||sZnx-K-=;B-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 coordinatesToVector(n,t){var e=Math.abs(Math.cos(n.latitude)),r=-Math.sin(n.longitude)*e,i=-Math.sin(n.latitude),o=-Math.cos(n.longitude)*e;return t?t.set(r,i,o):new THREE__namespace.Vector3(r,i,o)}var DEFAULT_ASPECT=1,DEFAULT_NEAR=.1,DEFAULT_FAR=2e3,TAU$2=Math.PI*2,PI_2=Math.PI/2;function formatRad$1(n){return n>0&&n<=TAU$2?n:(n%TAU$2+TAU$2)%TAU$2}function matrixLerp(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 Camera=function(n){__extends(t,n);function t(e,r,i,o,s,u,l){r===void 0&&(r=DEFAULT_ASPECT),i===void 0&&(i=DEFAULT_NEAR),o===void 0&&(o=DEFAULT_FAR),s===void 0&&(s=new THREE__namespace.Vector2),u===void 0&&(u=new THREE__namespace.Vector2(512,512)),l===void 0&&(l=1);var c=n.call(this)||this;c.fov=e,c.aspect=r,c.near=i,c.far=o,c.perspToOrtho=s,c.resolution=u,c.pixelRatio=l,c.needsRender=!0,c.refineModel=!0,c.pose={longitude:0,latitude:0,fov:e,distance:0,offset:new THREE__namespace.Vector3},c.computePose(),c.perspectiveCamera=new THREE__namespace.PerspectiveCamera(c.fov,c.aspect,.001,c.far);var d=Math.max(c.orthoDistance,.01)*Math.tan(.5*c.fov/180*Math.PI),f=-.5*c.aspect*2*d;return c.orthographicCamera=new THREE__namespace.OrthographicCamera(f,-f,d,-d,.001,c.far),c.computeProjectionMatrix(),c.lastValues={position:c.position.clone(),quaternion:c.quaternion.clone(),scale:c.scale.clone(),fov:c.fov,aspect:c.aspect,near:c.near,far:c.far,orthoDistance:c.orthoDistance,perspToOrtho:c.perspToOrtho.clone()},c.type=c.perspToOrtho.x<1?"PerspectiveCamera":"OrthographicCamera",c}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 coordinatesToVector(this.pose,e)},t.prototype.computePose=function(e){e===void 0&&(e=0),this.updateMatrix();var r=this.matrix.elements,i=new THREE__namespace.Vector3().set(-r[8],-r[9],-r[10]).normalize();this.pose.longitude=formatRad$1(-Math.atan2(i.x,-i.z)),this.pose.latitude=-Math.asin(i.y/1),this.pose.fov=this.fov,this.pose.distance=e;var o=new THREE__namespace.Vector3().add(this.position).add(i.clone().setLength(this.pose.distance));return this.pose.offset.copy(o),this},t.prototype.setFromPose=function(e){var r,i,o,s,u,l=formatRad$1((r=e.longitude)!==null&&r!==void 0?r:this.pose.longitude),c=Math.max(-PI_2+1e-4,Math.min(PI_2-1e-4,(i=e.latitude)!==null&&i!==void 0?i:this.pose.latitude)),d=(o=e.fov)!==null&&o!==void 0?o:this.pose.fov,f=(s=e.distance)!==null&&s!==void 0?s:this.pose.distance,m=(u=e.offset)!==null&&u!==void 0?u:this.pose.offset,A=coordinatesToVector({longitude:l,latitude:c}).normalize();return this.position.set(0,0,0),this.lookAt(A),this.position.add(m).sub(A.clone().setLength(f)),this.fov!==d&&(this.fov=d,this.updateProjectionMatrix()),this.updateMatrixWorld(),this.pose.longitude=l,this.pose.latitude=c,this.pose.fov=d,this.pose.distance=f,this.pose.offset.copy(m),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(){matrixLerp(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,o,s,u){this.perspectiveCamera.setViewOffset(e,r,i,o,s,u),this.orthographicCamera.setViewOffset(e,r,i,o,s,u),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 o=Math.max(this.orthoDistance,.01)*Math.tan(.5*this.fov/180*Math.PI),s=-.5*this.aspect*2*o;this.orthographicCamera.left=s,this.orthographicCamera.right=-s,this.orthographicCamera.top=o,this.orthographicCamera.bottom=-o,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(now(),0),this},t}(THREE__namespace.Camera),scratchVector4$1=new THREE__namespace.Vector4,EMPTY_CUBE_TEXTURE=new THREE__namespace.WebGLCubeRenderTarget(1).texture;EMPTY_CUBE_TEXTURE.name="EMPTY_TEXTURE";var pbmUniforms={modelAlpha:new THREE__namespace.Uniform(0),progress:new THREE__namespace.Uniform(0),pano0_map:new THREE__namespace.Uniform(EMPTY_CUBE_TEXTURE),pano0_luminanceMap:new THREE__namespace.Uniform(null),pano0_matrix:new THREE__namespace.Uniform(new THREE__namespace.Matrix4),pano0_zoom:new THREE__namespace.Uniform(1),pano1_map:new THREE__namespace.Uniform(EMPTY_CUBE_TEXTURE),pano1_luminanceMap:new THREE__namespace.Uniform(null),pano1_matrix:new THREE__namespace.Uniform(new THREE__namespace.Matrix4),pano1_zoom:new THREE__namespace.Uniform(1),clippers:new THREE__namespace.Uniform([]),shownFloorIndex:new THREE__namespace.Uniform(-1),constantColor:new THREE__namespace.Uniform(null),geometricError:new THREE__namespace.Uniform(0),pixelRatio:new THREE__namespace.Uniform(1),resolution:new THREE__namespace.Uniform(new THREE__namespace.Vector2(512,512)),floor:new THREE__namespace.Uniform(0),brightness:new THREE__namespace.Uniform(1),modelBoundingMin:new THREE__namespace.Uniform(new THREE__namespace.Vector3),modelBoundingMax:new THREE__namespace.Uniform(new THREE__namespace.Vector3)},shaderLib={none:{vertexShader:meshNoneVertexShader,fragmentShader:meshNoneFragmentShader,uniforms:THREE__namespace.UniformsUtils.merge([pbmUniforms,{opacity:{value:1}},THREE__namespace.UniformsLib.fog]),lights:!1},basic:{vertexShader:meshBasicVertexShader,fragmentShader:meshBasicFragmentShader,uniforms:THREE__namespace.UniformsUtils.merge([pbmUniforms,THREE__namespace.ShaderLib.basic.uniforms]),lights:!1},phong:{vertexShader:meshPhongVertexShader,fragmentShader:meshPhongFragmentShader,uniforms:THREE__namespace.UniformsUtils.merge([pbmUniforms,THREE__namespace.ShaderLib.phong.uniforms]),lights:!0}},PBMMeshMaterial=function(n){__extends(t,n);function t(e,r){e===void 0&&(e="basic"),r===void 0&&(r={});var i=this,o,s,u,l,c,d,f,m,A,h,p,y,v,g,E,b,T,_,x,R,w,S=shaderLib[e];i=n.call(this,{vertexShader:S.vertexShader,fragmentShader:S.fragmentShader,uniforms:THREE__namespace.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_VERTEX_MARK:!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 THREE__namespace.Color(16777215),i.map=null,i.lightMap=null,i.lightMapIntensity=1,i.aoMap=null,i.aoMapIntensity=1,i.specularMap=null,i.specular=new THREE__namespace.Color(1118481),i.alphaMap=null,i.envMap=null,i.reflectivity=1,i.refractionRatio=.98,i.emissiveMap=null,i.emissive=new THREE__namespace.Color(0),i.emissiveIntensity=1,i.bumpMap=null,i.bumpScale=1,i.normalMap=null,i.normalMapType=THREE__namespace.TangentSpaceNormalMap,i.normalScale=new THREE__namespace.Vector2(1,1),i.displacementMap=null,i.displacementScale=1,i.displacementBias=0,i.shininess=30;var C,I=null,H=null;return Object.defineProperties(i,{pano0:{get:function(){return I},set:function(B){if(I!==B){I=B,B===null?(this.uniforms.pano0_map.value=EMPTY_CUBE_TEXTURE,this.uniforms.pano0_luminanceMap.value=null,this.uniforms.pano0_matrix.value.identity(),this.uniforms.pano0_zoom.value=1):(this.uniforms.pano0_map.value=B.map instanceof TileCubeTextureTarget?B.map.texture:B.map,this.uniforms.pano0_luminanceMap.value=B.luminanceMap instanceof TileCubeTextureTarget?B.luminanceMap.texture:B.luminanceMap,this.uniforms.pano0_matrix.value.copy(B.matrix),this.uniforms.pano0_zoom.value=B.zoom);var L=this.uniforms.pano0_luminanceMap.value!==null&&this.uniforms.pano1_luminanceMap.value!==null,O=this.defines.USE_LUMINANCE;O!==L&&(this.defines.USE_LUMINANCE=L,this.needsUpdate=!0)}}},pano1:{get:function(){return H},set:function(B){if(H!==B){H=B,B===null?(this.uniforms.pano1_map.value=EMPTY_CUBE_TEXTURE,this.uniforms.pano1_luminanceMap.value=null,this.uniforms.pano1_matrix.value.identity(),this.uniforms.pano1_zoom.value=1):(this.uniforms.pano1_map.value=B.map instanceof TileCubeTextureTarget?B.map.texture:B.map,this.uniforms.pano1_luminanceMap.value=B.luminanceMap instanceof TileCubeTextureTarget?B.luminanceMap.texture:B.luminanceMap,this.uniforms.pano1_matrix.value.copy(B.matrix),this.uniforms.pano1_zoom.value=B.zoom);var L=this.uniforms.pano0_luminanceMap.value!==null&&this.uniforms.pano1_luminanceMap.value!==null,O=this.defines.USE_LUMINANCE;O!==L&&(this.defines.USE_LUMINANCE=L,this.needsUpdate=!0)}}},modelAlpha:{get:function(){return this.uniforms.modelAlpha.value},set:function(B){this.uniforms.modelAlpha.value=B}},progress:{get:function(){return this.uniforms.progress.value},set:function(B){this.uniforms.progress.value=B}},transition:{get:function(){return this.defines.USE_BLACK_TRANSITION?"BLACK":this.defines.USE_SPREAD_TRANSITION?"SPREAD":"FADE"},set:function(B){var L=this.defines.USE_BLACK_TRANSITION,O=this.defines.USE_SPREAD_TRANSITION;this.defines.USE_BLACK_TRANSITION=!1,this.defines.USE_SPREAD_TRANSITION=!1,this.defines["USE_".concat(B,"_TRANSITION")]=!0;var k=!1;L!==this.defines.USE_BLACK_TRANSITION&&(k=!0),O!==this.defines.USE_SPREAD_TRANSITION&&(k=!0),k&&(this.needsUpdate=!0)}},constantColor:{get:function(){return this.uniforms.constantColor.value},set:function(B){this.uniforms.constantColor.value=B;var L=this.defines.USE_CONSTANT_COLOR,O=B!==null;L!==O&&(this.defines.USE_CONSTANT_COLOR=O,this.needsUpdate=!0)}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(B){this.uniforms.opacity.value=B}},shownFloorIndex:{get:function(){return this.uniforms.shownFloorIndex.value},set:function(B){this.uniforms.shownFloorIndex.value=B}},brightness:{get:function(){return this.uniforms.brightness.value},set:function(B){this.uniforms.brightness.value=B}},clippers:{get:function(){return C},set:function(B){C!==B&&(C=B,this.uniforms.clippers.value=(C||[]).map(function(L){var O=typeof L.floorIndex=="number"?L.floorIndex:-1,k=new THREE__namespace.Matrix4().getInverse(L.clippingBoxMatrix);return{matrixInverse:k,floorIndex:O}}),this.needsUpdate=!0)}},useEDL:{get:function(){return this.defines.USE_EDL},set:function(B){B!==this.defines.USE_EDL&&(this.defines.USE_EDL=B,this.needsUpdate=!0)}},useHQWeight:{get:function(){return this.defines.USE_HQ_WEIGHT},set:function(B){B!==this.defines.USE_HQ_WEIGHT&&(this.defines.USE_HQ_WEIGHT=B,this.needsUpdate=!0)}},useHQDepth:{get:function(){return this.defines.USE_HQ_DEPTH},set:function(B){B!==this.defines.USE_HQ_DEPTH&&(this.defines.USE_HQ_DEPTH=B,this.needsUpdate=!0)}},floor:{get:function(){return this.uniforms.floor.value},set:function(B){this.uniforms.floor.value=B}}}),i.pano0=(o=r.pano0)!==null&&o!==void 0?o:defaultPbmParameters.pano0,i.pano1=(s=r.pano1)!==null&&s!==void 0?s:defaultPbmParameters.pano1,i.modelAlpha=(u=r.modelAlpha)!==null&&u!==void 0?u:defaultPbmParameters.modelAlpha,i.progress=(l=r.progress)!==null&&l!==void 0?l:defaultPbmParameters.progress,i.transition=(c=r.transition)!==null&&c!==void 0?c:defaultPbmParameters.transition,i.constantColor=(d=r.constantColor)!==null&&d!==void 0?d:defaultPbmParameters.constantColor,i.opacity=(f=r.opacity)!==null&&f!==void 0?f:defaultPbmParameters.opacity,i.shownFloorIndex=(m=r.shownFloorIndex)!==null&&m!==void 0?m:defaultPbmParameters.shownFloorIndex,i.clippers=(A=r.clippers)!==null&&A!==void 0?A:defaultPbmParameters.clippers,i.useEDL=(h=r.useEDL)!==null&&h!==void 0?h:defaultPbmParameters.useEDL,i.useHQWeight=(p=r.useHQWeight)!==null&&p!==void 0?p:defaultPbmParameters.useHQWeight,i.useHQDepth=(y=r.useHQDepth)!==null&&y!==void 0?y:defaultPbmParameters.useHQDepth,i.pointSize=(v=r.pointSize)!==null&&v!==void 0?v:defaultPbmParameters.pointSize,i.pointColor=(g=r.pointColor)!==null&&g!==void 0?g:defaultPbmParameters.pointColor,i.pointShape=(E=r.pointShape)!==null&&E!==void 0?E:defaultPbmParameters.pointShape,i.pointScale=(b=r.pointScale)!==null&&b!==void 0?b:defaultPbmParameters.pointScale,i.pointBack=(T=r.pointBack)!==null&&T!==void 0?T:defaultPbmParameters.pointBack,i.pointMinPixel=(_=r.pointMinPixel)!==null&&_!==void 0?_:defaultPbmParameters.pointMinPixel,i.pointMaxPixel=(x=r.pointMaxPixel)!==null&&x!==void 0?x:defaultPbmParameters.pointMaxPixel,i.gradientTexture=(R=r.gradientTexture)!==null&&R!==void 0?R:defaultPbmParameters.gradientTexture,i.brightness=(w=r.brightness)!==null&&w!==void 0?w:defaultPbmParameters.brightness,i.floor=0,i}return t.prototype.onBeforeCompile=function(e,r){var i,o,s=String((o=(i=this.clippers)===null||i===void 0?void 0:i.length)!==null&&o!==void 0?o:0);e.vertexShader=e.vertexShader.replace(/NUM_CLIPPERS/g,s),e.fragmentShader=e.fragmentShader.replace(/NUM_CLIPPERS/g,s)},t.prototype.refreshUniforms=function(e){var r,i,o=this.uniforms;o.diffuse&&o.diffuse.value.copy(this.color),o.opacity&&(o.opacity.value=this.opacity),o.color&&o.diffuse.value.copy(this.color),o.emissive&&o.emissive.value.copy(this.emissive).multiplyScalar(this.emissiveIntensity),o.map&&(o.map.value=this.map),o.alphaMap&&(o.alphaMap.value=this.alphaMap),o.specularMap&&(o.specularMap.value=this.specularMap),o.envMap&&(o.envMap.value=this.envMap,o.flipEnvMap.value=!((r=this.envMap)===null||r===void 0)&&r.isCubeTexture?-1:1,o.reflectivity.value=this.reflectivity,o.refractionRatio.value=this.refractionRatio,o.maxMipLevel.value=this.envMap&&(i=e.properties.get(this.envMap).__maxMipLevel)!==null&&i!==void 0?i:0),o.lightMap&&(o.lightMap.value=this.lightMap,o.lightMapIntensity.value=this.lightMapIntensity),o.aoMap&&(o.aoMap.value=this.aoMap,o.aoMapIntensity.value=this.aoMapIntensity),o.specular&&o.specular.value.copy(this.specular),o.shininess&&(o.shininess.value=Math.max(this.shininess,1e-4)),o.emissiveMap&&(o.emissiveMap.value=this.emissiveMap),o.bumpMap&&(o.bumpMap.value=this.bumpMap,o.bumpScale.value=this.bumpScale,this.side===THREE__namespace.BackSide&&(o.bumpScale.value*=-1)),o.normalMap&&(o.normalMap.value=this.normalMap,o.normalScale.value.copy(this.normalScale),this.side===THREE__namespace.BackSide&&o.normalScale.value.negate()),o.displacementMap&&(o.displacementMap.value=this.displacementMap,o.displacementScale.value=this.displacementScale,o.displacementBias.value=this.displacementBias);var s;this.map?s=this.map:this.specularMap?s=this.specularMap:this.displacementMap?s=this.displacementMap:this.normalMap?s=this.normalMap:this.bumpMap?s=this.bumpMap:this.alphaMap?s=this.alphaMap:this.emissiveMap&&(s=this.emissiveMap),s!==void 0&&(s.matrixAutoUpdate===!0&&s.updateMatrix(),o.uvTransform.value.copy(s.matrix));var u;this.aoMap?u=this.aoMap:this.lightMap&&(u=this.lightMap),u!==void 0&&(u.matrixAutoUpdate===!0&&u.updateMatrix(),o.uv2Transform.value.copy(u.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?THREE__namespace.NormalBlending:THREE__namespace.NoBlending,r instanceof Camera)this.uniforms.pixelRatio.value=r.pixelRatio,this.uniforms.resolution.value.copy(r.resolution);else{this.uniforms.pixelRatio.value=e.getPixelRatio();var i=e.getViewport(scratchVector4$1);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}(THREE__namespace.ShaderMaterial),InternalWebGLRenderer=function(n){__extends(t,n);function t(e){var r=e.preserveDrawingBuffer,i=r===void 0?!0:r,o=e.premultipliedAlpha,s=o===void 0?!0:o,u=e.stencil,l=u===void 0?!0:u,c=e.backgroundColor,d=c===void 0?1579548:c,f=e.backgroundAlpha,m=f===void 0?1:f,A=e.pixelRatio,h=A===void 0?1:A,p=e.antialias,y=e.webgl2,v=e.logarithmicDepthBuffer,g=e.precision,E=this,b={antialias:p,alpha:!0,depth:!0,preserveDrawingBuffer:i,stencil:l,premultipliedAlpha:s,powerPreference:"high-performance"},T={logarithmicDepthBuffer:v,precision:g};if(y){var _=document.createElement("canvas"),x=_.getContext("webgl2",b);x?E=n.call(this,__assign(__assign(__assign({},b),T),{antialias:!0,canvas:_,context:x}))||this:(console.error("error occurred when getting webgl2 canvas context, mybe webgl2 not support, fallback to webgl."),E=n.call(this,__assign(__assign({},b),T))||this)}else E=n.call(this,__assign(__assign({},b),T))||this;return E.setPixelRatio(h),E.setClearColor(d,m),E.outputEncoding=THREE__namespace.sRGBEncoding,E.autoClear=!0,E}return t}(THREE__namespace.WebGLRenderer),Scene=function(n){__extends(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}(THREE__namespace.Scene),VolumePlaneIntersect;(function(n){n[n.Outside=-1]="Outside",n[n.Intersecting=0]="Intersecting",n[n.Inside=1]="Inside"})(VolumePlaneIntersect||(VolumePlaneIntersect={}));var EPSILON$2=1e-6,scratchVector=new THREE__namespace.Vector3,scratchMatrix4$4=new THREE__namespace.Matrix4,scratchXAxis=new THREE__namespace.Vector3,scratchYAxis=new THREE__namespace.Vector3,scratchZAxis=new THREE__namespace.Vector3,scratchSize=new THREE__namespace.Vector3,scratchBox3=new THREE__namespace.Box3,scratchSphere$1=new THREE__namespace.Sphere,scratchMatrix4Inverse$1=new THREE__namespace.Matrix4,scratchRay$1=new THREE__namespace.Ray,scratchObject3D=new THREE__namespace.Object3D,scratchFrustum=new THREE__namespace.Frustum;function quaternionFromMatrix3(n,t){var e=n.elements;return t.setFromRotationMatrix(scratchMatrix4$4.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 CullingVolume=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 scratchMatrix4$4.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),scratchFrustum.setFromProjectionMatrix(scratchMatrix4$4),this.setFromFrustum(scratchFrustum),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=VolumePlaneIntersect.Inside,r=0,i=this.planes;r<i.length;r++){var o=i[r],s=t.intersectPlane(o);switch(s){case VolumePlaneIntersect.Outside:return VolumePlaneIntersect.Outside;case VolumePlaneIntersect.Intersecting:e=VolumePlaneIntersect.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),o=0;o<i;++o){var s=1<<o;if(e&s){var u=this.planes[o],l=t.intersectPlane(u);if(l===VolumePlaneIntersect.Outside)return n.MASK_OUTSIDE;l===VolumePlaneIntersect.Intersecting&&(r|=s)}}return r},n}(),BoxBoundingVolume=function(){function n(){this.type="box",this.center=new THREE__namespace.Vector3,this.halfSize=new THREE__namespace.Vector3,this.rotation=new THREE__namespace.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],o=e[5],s=e[6],u=e[7],l=e[8],c=e[9],d=e[10],f=e[11],m=Math.sqrt(r*r+i*i+o*o),A=Math.sqrt(s*s+u*u+l*l),h=Math.sqrt(c*c+d*d+f*f);this.halfSize.set(m,A,h);var p=this.halfSize.toArray().reduce(function(y,v){return y+v},0);return(isNaN(p)||p<=0)&&this.halfSize.setScalar(EPSILON$2),this.rotation.fromArray([r/m,i/m,o/m,s/A,u/A,l/A,c/h,d/h,f/h]),isNaN(this.rotation.toArray().reduce(function(y,v){return y+v},0))&&this.rotation.identity(),this},n.prototype.toJson=function(){return this.rotation.extractBasis(scratchXAxis,scratchYAxis,scratchZAxis),{box:__spreadArray(__spreadArray(__spreadArray(__spreadArray([],this.center.toArray(),!0),scratchXAxis.multiplyScalar(this.halfSize.x).toArray(),!0),scratchYAxis.multiplyScalar(this.halfSize.y).toArray(),!0),scratchZAxis.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 scratchObject3D.position.copy(this.center),quaternionFromMatrix3(this.rotation,scratchObject3D.quaternion),scratchObject3D.scale.copy(this.halfSize),scratchObject3D.matrix.compose(scratchObject3D.position,scratchObject3D.quaternion,scratchObject3D.scale),scratchObject3D.matrix.premultiply(t),scratchObject3D.matrix.decompose(scratchObject3D.position,scratchObject3D.quaternion,scratchObject3D.scale),this.center.copy(scratchObject3D.position),this.rotation.setFromMatrix4(scratchMatrix4$4.makeRotationFromQuaternion(scratchObject3D.quaternion)),this.halfSize.copy(scratchObject3D.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,o=t.z-this.center.z,s=0,u;return u=r*e[0]+i*e[1]+o*e[2],u<0&&(u=-u),u-=this.halfSize.x,u>0&&(s+=u*u),u=r*e[3]+i*e[4]+o*e[5],u<0&&(u=-u),u-=this.halfSize.y,u>0&&(s+=u*u),u=r*e[6]+i*e[7]+o*e[8],u<0&&(u=-u),u-=this.halfSize.z,u>0&&(s+=u*u),s},n.prototype.distanceToPoint=function(t){return Math.sqrt(this.distanceSquaredToPoint(t))},n.prototype.distanceToPlane=function(t){var e=t.projectPoint(this.center,new THREE__namespace.Vector3);return this.distanceToPoint(e)},n.prototype.getBoundingBox=function(t){return t.makeEmpty(),this.rotation.extractBasis(scratchXAxis,scratchYAxis,scratchZAxis),scratchXAxis.setLength(this.halfSize.x),scratchYAxis.setLength(this.halfSize.y),scratchZAxis.setLength(this.halfSize.z),t.expandByPoint(scratchVector.copy(this.center).add(scratchXAxis)),t.expandByPoint(scratchVector.copy(this.center).sub(scratchXAxis)),t.expandByPoint(scratchVector.copy(this.center).add(scratchYAxis)),t.expandByPoint(scratchVector.copy(this.center).sub(scratchYAxis)),t.expandByPoint(scratchVector.copy(this.center).add(scratchZAxis)),t.expandByPoint(scratchVector.copy(this.center).sub(scratchZAxis)),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);scratchVector.set(this.halfSize.x,this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,0),scratchVector.set(-this.halfSize.x,this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,3),scratchVector.set(-this.halfSize.x,-this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,6),scratchVector.set(this.halfSize.x,-this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,9),scratchVector.set(this.halfSize.x,this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,12),scratchVector.set(-this.halfSize.x,this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,15),scratchVector.set(-this.halfSize.x,-this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,18),scratchVector.set(this.halfSize.x,-this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,21);var r=new THREE__namespace.BufferGeometry;return r.setIndex(new THREE__namespace.BufferAttribute(t,1)),r.setAttribute("position",new THREE__namespace.BufferAttribute(e,3)),r.computeBoundingBox(),r.computeBoundingSphere(),r},n.prototype.intersectPlane=function(t){var e=this.center,r=t.normal,i=this.rotation.elements,o=this.halfSize,s=r.x,u=r.y,l=r.z,c=Math.abs(s*i[0]*o.x+u*i[1]*o.x+l*i[2]*o.x)+Math.abs(s*i[3]*o.y+u*i[4]*o.y+l*i[5]*o.y)+Math.abs(s*i[6]*o.z+u*i[7]*o.z+l*i[8]*o.z),d=r.dot(e)+t.constant;return d<=-c?VolumePlaneIntersect.Outside:d>=c?VolumePlaneIntersect.Inside:VolumePlaneIntersect.Intersecting},n.prototype.intersectRay=function(t,e){if(scratchSize.copy(this.halfSize).multiplyScalar(2),scratchBox3.setFromCenterAndSize(scratchVector.set(0,0,0),scratchSize),this.rotation.extractBasis(scratchXAxis,scratchYAxis,scratchZAxis),scratchMatrix4$4.makeBasis(scratchXAxis,scratchYAxis,scratchZAxis),scratchMatrix4$4.setPosition(this.center),scratchMatrix4Inverse$1.getInverse(scratchMatrix4$4),scratchRay$1.copy(t).applyMatrix4(scratchMatrix4Inverse$1),scratchBox3.containsPoint(scratchRay$1.origin))return!0;var r=scratchRay$1.intersectBox(scratchBox3,scratchVector);return r?e!==void 0?r.applyMatrix4(scratchMatrix4$4).distanceTo(t.origin)<e:!0:!1},n}(),SphereBoundingVolume=function(){function n(){this.type="sphere",this.center=new THREE__namespace.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],EPSILON$2),this},n.prototype.toJson=function(){return{sphere:__spreadArray(__spreadArray([],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,scratchSize.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 o=new THREE__namespace.BufferGeometry;return o.setAttribute("position",new THREE__namespace.BufferAttribute(e,3)),o.computeBoundingBox(),o.computeBoundingSphere(),o},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,o=i.dot(e)+t.constant;return o<-r?VolumePlaneIntersect.Outside:o<r?VolumePlaneIntersect.Intersecting:VolumePlaneIntersect.Inside},n.prototype.intersectRay=function(t,e){if(scratchSphere$1.set(this.center,this.radius),scratchSphere$1.containsPoint(t.origin))return!0;var r=t.intersectSphere(scratchSphere$1,scratchVector);return r?e!==void 0?t.origin.distanceTo(r)<e:!0:!1},n}(),RegionBoundingVolume=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 makeBoundingVolume(n){if("box"in n)return new BoxBoundingVolume().fromJson(n);if("sphere"in n)return new SphereBoundingVolume().fromJson(n);if("region"in n)return new RegionBoundingVolume().fromJson(n);throw new Error("BoundingVolume ".concat(JSON.stringify(n)," never suppored."))}var debugMaterials=[4821759,8191922,16637280,16739958,5822969,376977,16747077,9259235,14514687].map(function(n){return new THREE__namespace.LineBasicMaterial({color:n,depthWrite:!1,depthTest:!1,transparent:!0})}),debugBoxGeometry=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);scratchVector.set(1,1,1).toArray(t,0),scratchVector.set(-1,1,1).toArray(t,3),scratchVector.set(-1,-1,1).toArray(t,6),scratchVector.set(1,-1,1).toArray(t,9),scratchVector.set(1,1,-1).toArray(t,12),scratchVector.set(-1,1,-1).toArray(t,15),scratchVector.set(-1,-1,-1).toArray(t,18),scratchVector.set(1,-1,-1).toArray(t,21);var e=new THREE__namespace.BufferGeometry;return e.setIndex(new THREE__namespace.BufferAttribute(n,1)),e.setAttribute("position",new THREE__namespace.BufferAttribute(t,3)),e.computeBoundingBox(),e.computeBoundingSphere(),e}(),debugSphereGeometry=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 THREE__namespace.BufferGeometry;return i.setAttribute("position",new THREE__namespace.BufferAttribute(t,3)),i.computeBoundingBox(),i.computeBoundingSphere(),i}();function createDebugBoundingMesh(n,t){if(n instanceof BoxBoundingVolume){var e=new THREE__namespace.LineSegments(debugBoxGeometry,debugMaterials[Math.min(t,debugMaterials.length-1)]);return e.position.copy(n.center),quaternionFromMatrix3(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 SphereBoundingVolume){var e=new THREE__namespace.LineSegments(debugSphereGeometry,debugMaterials[Math.min(t,debugMaterials.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 scratchVector3$5=new THREE__namespace.Vector3,Tile=function(){function n(t,e,r,i){var o=this,s,u,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=(s=e.refine)!==null&&s!==void 0?s:this.parent?this.parent.refine:"REPLACE",this.transform=new THREE__namespace.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=(u=this.parent)===null||u===void 0?void 0:u.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=makeBoundingVolume(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=makeBoundingVolume(e.boundingVolume).applyMatrix4(this.transform)),e.viewerRequestVolume&&(this.viewerRequestVolume=makeBoundingVolume(e.viewerRequestVolume).applyMatrix4(this.transform)),this.extras=e.extras||{},typeof this.extras.floor=="number"&&(this.floor=this.extras.floor),this.boundingVolume&&(this.boundingVolumeDebugObject=createDebugBoundingMesh(this.boundingVolume,this.levelOfContent)),e.children?this.children=e.children.map(function(c,d){return new n("".concat(o.id,".").concat(d),c,r,o)}):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 THREE__namespace.Plane().setFromNormalAndCoplanarPoint(t.camera.direction,t.camera.position);this.state.distanceToCamera=r.distanceToPlane(i)}else this.state.distanceToCamera=r.distanceToPoint(t.camera.position);var o=r.getCenter(scratchVector3$5).sub(t.camera.position);this.state.centerZDepth=t.camera.direction.dot(o);var s=this.parent?this.parent.state.visibilityPlaneMask:CullingVolume.MASK_INDETERMINATE;this.state.visibilityPlaneMask=t.cullingVolume.computeVisibilityWithPlaneMask(r,s),this.state.visible=this.state.visibilityPlaneMask!==CullingVolume.MASK_OUTSIDE}else this.state.distanceToCamera=0,this.state.centerZDepth=0,this.state.visibilityPlaneMask=CullingVolume.MASK_INDETERMINATE,this.state.visible=!0;if(this.levelOfContent<=0&&(this.state.visible=!0),this.viewerRequestVolume){var u=e?this.viewerRequestVolume.clone().applyMatrix4(e):this.viewerRequestVolume;this.state.inRequestVolume=u.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(o){return i.done(),r.loadState=o?"READY":"UNLOADED",o}).catch(function(o){return r.loadState="FAILED",i.done(),Promise.reject(o)}):(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(),o=this.parent?this.parent.geometricError:this.tileset.geometricError,s=i*(r?o:this.geometricError);if(s===0)return 0;var u=Math.max(e,.001),l=s*t.height/(u*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,o=this.tileset.root?this.tileset.root.state.screenSpaceError:0,s=Math.max(o-i,0);return s},n}(),TileRequestScheduler=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(){}},o=new Promise(function(s){return i.resolve=s});return this.requestQueue.push(i),this.requestMap.set(t,o),this.issueNewRequests(),o},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,o=!1,s=function(){o||(o=!0,e.requestMap.delete(r),e.activeRequests--,e.issueNewRequests())};this.activeRequests++,i({done:s})},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,o){return i.priority-o.priority})},n.prototype.updateRequest=function(t){return t.priority=t.getPriority(t.identiy),t.priority<0?(t.resolve(null),!1):!0},n}(),CacheNode=function(){function n(t,e,r){this.item=t,this.previous=e,this.next=r}return n}(),CacheNodeList=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 CacheNode(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}(),TileCache=function(){function n(){this.cacheNodeMap=new Map,this.list=new CacheNodeList,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}(),ManagedArray=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}(),TilesetBaseTraverser=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)),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){return t.levelOfContent>=e.maxLevelOfDetail||t.children.length===0?!1:t.levelOfContent<=e.minLevelOfDetail||t.hasTilesetContent?!0: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 o=t.refine==="REPLACE";if(o&&r&&!this.anyChildrenVisible(t,e)){t.state.visible=!1;return}}},n.prototype.anyChildrenVisible=function(t,e){for(var r=!1,i=t.children,o=0,s=i;o<s.length;o++){var u=s[o];u.updateState(e),r=r||u.state.visible}return r},n.prototype.meetsScreenSpaceErrorEarly=function(t,e){var r=t.parent;return!r||r.refine!=="ADD"||r.levelOfContent<e.minLevelOfDetail?!1:r.levelOfContent>e.maxLevelOfDetail?!0: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}(),TilesetNormalTraverser=function(n){__extends(t,n);function t(e){var r=n.call(this,e)||this;return r.tileset=e,r._traversalStack=new ManagedArray,r._emptyTraversalStack=new ManagedArray,r}return t.prototype.traverse=function(e,r,i){i===void 0&&(i=[]),n.prototype.traverse.call(this,e,r,i);for(var o=0,s=i;o<s.length;o++){var u=s[o];this._traversalStack.reset(),this._emptyTraversalStack.reset(),u.camera.refine&&(this._canSelectTile=u.camera.visible,this.updateTile(e,u),this.executeTraversal(e,u))}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;for(e.state.visible&&e.state.inRequestVolume&&i.push(e);i.length>0;){var o=i.pop(),s=o.parent,u=!s||s.state.shouldRefine,l=!1;this.canTraverse(o,r)&&(l=this.updateAndPushChildren(o,r,i)&&u);var c=!l&&u;o.hasRenderContent?o.refine==="ADD"?(this.loadTile(o,r),this.selectDesiredTile(o,r)):o.refine==="REPLACE"&&(this.loadTile(o,r),c&&this.selectDesiredTile(o,r)):(this.loadTile(o,r),c&&this.selectDesiredTile(o,r)),this.touchTile(o,r),o.state.shouldRefine=l}},t.prototype.updateAndPushChildren=function(e,r,i){for(var o=e.children,s=0,u=o;s<u.length;s++){var l=u[s];this.updateTile(l,r)}this.sortTilesByDistanceToCamera(o);for(var c=e.refine==="REPLACE"&&e.hasRenderContent,d=!1,f=!0,m=0,A=o;m<A.length;m++){var l=A[m];if(l.state.visible&&l.state.inRequestVolume?(i.find(l)&&i.delete(l),i.push(l),d===!1&&(d=!0)):(c||this.tileset.loadSiblings)&&(this.loadTile(l,r),this.touchTile(l,r)),c){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,o=this._emptyTraversalStack;for(o.push(e);o.length>0&&i;){var s=o.pop(),u=!s.hasRenderContent&&this.canTraverse(s,r);if(!u&&!s.contentAvailable&&(i=!1),this.updateTile(s,r),s.state.visible||(this.loadTile(s,r),this.touchTile(s,r)),u)for(var l=s.children,c=0,d=l;c<d.length;c++){var f=d[c];o.find(f)&&o.delete(f),o.push(f)}}return i},t}(TilesetBaseTraverser),TilesetSkipTraverser=function(n){__extends(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 ManagedArray,r._descendantTraversalStack=new ManagedArray,r._selectionTraversalStack=new ManagedArray,r._selectionTraversalancestorStack=new ManagedArray,r}return t.prototype.traverse=function(e,r,i){i===void 0&&(i=[]),n.prototype.traverse.call(this,e,r,i);for(var o=0,s=i;o<s.length;o++){var u=s[o];this._traversalStack.reset(),u.camera.refine&&(this._canSelectTile=u.camera.visible,this.updateTile(e,u),this.executeTraversal(e,u),this.traverseAndSelect(e,u))}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;for(e.state.visible&&e.state.inRequestVolume&&i.push(e);i.length>0;){var o=i.pop();this.updateTileAncestorContentLinks(o,r);var s=o.parent,u=!s||s.state.shouldRefine,l=!1;this.canTraverse(o,r)&&(l=this.updateAndPushChildren(o,r,i)&&u);var c=!l&&u;o.hasRenderContent?o.refine==="ADD"?(this.loadTile(o,r),this.selectDesiredTile(o,r)):o.refine==="REPLACE"&&(this.inBaseTraversal(o,this.baseScreenSpaceError)?(this.loadTile(o,r),c&&this.selectDesiredTile(o,r)):c?(this.loadTile(o,r),this.selectDesiredTile(o,r)):this.reachedSkippingThreshold(o)&&this.loadTile(o,r)):(this.loadTile(o,r),c&&this.selectDesiredTile(o,r)),this.touchTile(o,r),o.state.shouldRefine=l}},t.prototype.updateAndPushChildren=function(e,r,i){for(var o=e.children,s=0,u=o;s<u.length;s++){var l=u[s];this.updateTile(l,r)}this.sortTilesByDistanceToCamera(o);for(var c=!1,d=0,f=o;d<f.length;d++){var l=f[d];l.state.visible&&l.state.inRequestVolume?(i.push(l),c===!1&&(c=!0)):this.tileset.loadSiblings&&(this.loadTile(l,r),this.touchTile(l,r))}return c},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 o=i.pop(),s=o.children,u=0,l=s;u<l.length;u++){var c=l[u];c.state.visible&&(c.contentAvailable?(this.updateTile(c,r),this.touchTile(c,r),this.selectTile(c,r)):i.push(c))}},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 o=!(i.hasRenderContent&&i.hasUnloadedContent)||i.state.requestedFrameNumber===r.frameNumber;e.state.ancestorWithContent=o?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,o=this._selectionTraversalancestorStack,s;for(i.push(e);i.length>0||o.length>0;){if(o.length>0){var u=o.peek();if(u.state.stackLength===i.length){o.pop(),u!==s&&(u.state.finalResolution=!1),this.selectTile(u,r);continue}}var l=i.pop();if(l){var c=this.canTraverse(l,r);if(l.state.shouldSelect)if(l.refine==="ADD")this.selectTile(l,r);else{if(l.state.selectionDepth=o.length,l.state.selectionDepth>0&&(l.tileset.hasMixedContent=!0),s=l,!c){this.selectTile(l,r);continue}o.push(l),l.state.stackLength=i.length}if(c)for(var d=0,f=l.children;d<f.length;d++){var m=f[d];m.state.visible&&i.push(m)}}}},t}(TilesetBaseTraverser),identityMatrix4=new THREE__namespace.Matrix4,Tileset=function(){function n(t,e,r){var i,o,s,u,l;this.id=t,this.transform=new THREE__namespace.Matrix4,this.transformIsIdentity=!0,this.hasMixedContent=!1,this.url=(i=r.url)!==null&&i!==void 0?i:"",this.referer=(o=r.referer)!==null&&o!==void 0?o:"",this.asset={version:e.asset.version,tilesetVersion:e.asset.tilesetVersion||"",gltfUpAxis:(s=e.asset.gltfUpAxis)!==null&&s!==void 0?s:"Y",overview:e.asset.overview},this.rootMeta=(u=e.rootMeta)!==null&&u!==void 0?u:{},this.properties=(l=e.properties)!==null&&l!==void 0?l:{},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 TileCache,this.normalTraverser=new TilesetNormalTraverser(this),this.skipTraverser=new TilesetSkipTraverser(this),this.requestScheduler=new TileRequestScheduler(this),this.frameNumber=0,this.pendingCount=0,this.loadedTiles=new Set,this.memoryUsageInBytes=0,this.root=new Tile("".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,o=r.children.length;i<o;i++)e.push(r.children[i]);this.cache.unloadTile(r,function(s){return t.unloadTile(s)})}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(identityMatrix4),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}(),BVHObject=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,o,s,u=this.indices,l=this.position,c=t;if(u){var d=u.array,f=(r=u.stride)!==null&&r!==void 0?r:1,m=(i=u.offset)!==null&&i!==void 0?i:0;c=d[t*f+m]}var A=l.array,h=(o=l.stride)!==null&&o!==void 0?o:3,p=(s=l.offset)!==null&&s!==void 0?s:0;return c=c*h+p,e.x=A[c],e.y=A[c+1],e.z=A[c+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}(),BVHNode=function(){function n(t,e,r,i,o){this.id=t,this.extents=e,this.startIndex=r,this.endIndex=i,this.deepth=o}return n}(),BYTES_PER_NODE=6*4+4+4+2+2;function packBVHNode(n,t){for(var e=new ArrayBuffer(t*BYTES_PER_NODE),r=new Float32Array(e),i=new Uint32Array(e),o=new Uint16Array(e),s=[n],u,l;u=s.pop();)l=u.id*BYTES_PER_NODE/4,r[l]=u.extents[0],r[l+1]=u.extents[1],r[l+2]=u.extents[2],r[l+3]=u.extents[3],r[l+4]=u.extents[4],r[l+5]=u.extents[5],i[l+6]=u.startIndex,i[l+7]=u.endIndex,l=u.id*BYTES_PER_NODE/2,u.node0&&(o[l+16]=u.node0.id,s.push(u.node0)),u.node1&&(o[l+17]=u.node1.id,s.push(u.node1));return e}function intersectNodeBox(n,t,e,r,i,o,s,u,l){l===void 0&&(l=0),e=e-l,r=r-l,i=i-l,o=o+l,s=s+l,u=u+l;var c=0,d=0,f=0,m=0,A=0,h=0;return t.x>=0?(c=(e-n.x)*t.x,d=(o-n.x)*t.x):(c=(o-n.x)*t.x,d=(e-n.x)*t.x),t.y>=0?(f=(r-n.y)*t.y,m=(s-n.y)*t.y):(f=(s-n.y)*t.y,m=(r-n.y)*t.y),!(c>m||f>d||(f>c&&(c=f),m<d&&(d=m),t.z>=0?(A=(i-n.z)*t.z,h=(u-n.z)*t.z):(A=(u-n.z)*t.z,h=(i-n.z)*t.z),c>h||A>d)||(A>c&&(c=A),h<d&&(d=h),d<0))}var BVHVector3=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,o=t.z,s=e.x,u=e.y,l=e.z;return this.x=i*l-o*u,this.y=o*s-r*l,this.z=r*u-i*s,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}(),BVHIntersect=function(){function n(t,e,r){this.triangle=t,this.intersectionPoint=e,this.index=r}return n}(),EPSILON$1=1e-6,scratchVector3$4=new BVHVector3(0,0,0),scratchVector3A=new BVHVector3(0,0,0),scratchVector3B=new BVHVector3(0,0,0),scratchVector3C=new BVHVector3(0,0,0),BVHMesh=function(n){__extends(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 o=this.getPositionCount()/3,s=o>65535?new Uint32Array(o):new Uint16Array(o),u=new Float32Array(o*6),l=[],c=0,d=-1;if(i)for(var f=0,m=0,A=0,h=void 0,p=void 0,y=void 0,v=void 0,g=void 0,E=void 0,b=void 0;f<o;f+=1,m+=3,A+=6)s[f]=f,this.getPositionByIndex(m,scratchVector3A),this.getPositionByIndex(m+1,scratchVector3B),this.getPositionByIndex(m+2,scratchVector3C),h=v=scratchVector3A.x,b=scratchVector3B.x,b<h&&(h=b),b>v&&(v=b),b=scratchVector3C.x,b<h&&(h=b),b>v&&(v=b),p=g=scratchVector3A.y,b=scratchVector3B.y,b<p&&(p=b),b>g&&(g=b),b=scratchVector3C.y,b<p&&(p=b),b>g&&(g=b),y=E=scratchVector3A.z,b=scratchVector3B.z,b<y&&(y=b),b>E&&(E=b),b=scratchVector3C.z,b<y&&(y=b),b>E&&(E=b),u[A]=h,u[A+1]=p,u[A+2]=y,u[A+3]=v,u[A+4]=g,u[A+5]=E;else{for(var T=1/0,_=1/0,x=1/0,R=-1/0,w=-1/0,S=-1/0,f=0,m=0,A=0,h=void 0,p=void 0,y=void 0,v=void 0,g=void 0,E=void 0,b=void 0;f<o;f+=1,m+=3,A+=6)s[f]=f,this.getPositionByIndex(m,scratchVector3A),this.getPositionByIndex(m+1,scratchVector3B),this.getPositionByIndex(m+2,scratchVector3C),h=v=scratchVector3A.x,b=scratchVector3B.x,b<h&&(h=b),b>v&&(v=b),b=scratchVector3C.x,b<h&&(h=b),b>v&&(v=b),p=g=scratchVector3A.y,b=scratchVector3B.y,b<p&&(p=b),b>g&&(g=b),b=scratchVector3C.y,b<p&&(p=b),b>g&&(g=b),y=E=scratchVector3A.z,b=scratchVector3B.z,b<y&&(y=b),b>E&&(E=b),b=scratchVector3C.z,b<y&&(y=b),b>E&&(E=b),u[A]=h,u[A+1]=p,u[A+2]=y,u[A+3]=v,u[A+4]=g,u[A+5]=E,h<T&&(T=h),v>R&&(R=v),p<_&&(_=p),g>w&&(w=g),y<x&&(x=y),E>S&&(S=E);i=[T,_,x,R,w,S]}var C=new BVHNode(++d,i,0,o,0);l[c++]=C;var I=[],H=[0,1,2],B=function(O,k){return I[k]-I[O]};function L(O){var k=O.startIndex,K=O.endIndex,z=O.extents;I[0]=z[3]-z[0],I[1]=z[4]-z[1],I[2]=z[5]-z[2],H.sort(B);for(var N=0;N<3;N++){for(var U=H[N],Q=z[U]+z[U+3],G=k,q=K-1,j=-1,X=void 0;G<=q;)j===-1?(X=s[G],u[X*6+U]+u[X*6+U+3]<Q?G++:j=X):(X=s[q],u[X*6+U]+u[X*6+U+3]>=Q||(s[G]=X,s[q]=j,j=-1,G++),q--);if(G>k&&G<K){var ae=new BVHNode(++d,calcExtents(s,u,k,G,EPSILON$1),k,G,O.deepth+1);ae.deepth<r&&ae.endIndex-ae.startIndex>e&&(l[c++]=ae);var W=new BVHNode(++d,calcExtents(s,u,G,K,EPSILON$1),G,K,O.deepth+1);W.deepth<r&&W.endIndex-W.startIndex>e&&(l[c++]=W),O.node0=ae,O.node1=W,O.startIndex=0,O.endIndex=0;break}}}for(;c;)L(l[--c]);return this.offsetArray=s,this.rootNodePacked=packBVHNode(C,d+1),l.length=0,this},t.prototype.trianglesInSphere=function(e,r){for(var i=this.offsetArray,o=this.rootNodePacked,s=new Float32Array(o),u=new Uint32Array(o),l=new Uint16Array(o),c=[0],d=[],f,m,A,h;(f=c.pop())!==void 0;){h=f*BYTES_PER_NODE/4;var p=clamp(e.x,s[h],s[h+3])-e.x,y=clamp(e.y,s[h+1],s[h+4])-e.y,v=clamp(e.z,s[h+2],s[h+5])-e.z;if(p*p+y*y+v*v<=r*r){for(var g=u[h+6];g<u[h+7];g++)d.push(i[g]);h=f*BYTES_PER_NODE/2,m=l[h+16],A=l[h+17],m&&c.push(m),A&&c.push(A)}}for(var E=d.length,b=new Float32Array(E*9),g=0;g<E;g++){var T=d[g];this.getPositionByIndex(T,scratchVector3$4),b[g*9]=scratchVector3$4.x,b[g*9+1]=scratchVector3$4.y,b[g*9+2]=scratchVector3$4.z,this.getPositionByIndex(T+1,scratchVector3$4),b[g*9+3]=scratchVector3$4.x,b[g*9+4]=scratchVector3$4.y,b[g*9+5]=scratchVector3$4.z,this.getPositionByIndex(T+2,scratchVector3$4),b[g*9+6]=scratchVector3$4.x,b[g*9+7]=scratchVector3$4.y,b[g*9+8]=scratchVector3$4.z}return b},t.prototype.intersectRay=function(e,r,i,o){for(var s=this.offsetArray,u=this.rootNodePacked,l=new Float32Array(u),c=new Uint32Array(u),d=new Uint16Array(u),f=new BVHVector3(1/r.x,1/r.y,1/r.z),m=[0],A,h,p,y;(A=m.pop())!==void 0;)if(y=A*BYTES_PER_NODE/4,intersectNodeBox(e,f,l[y],l[y+1],l[y+2],l[y+3],l[y+4],l[y+5])){for(var v=c[y+6],g=c[y+7],E=void 0,b=void 0,T=void 0,_=e.x,x=e.y,R=e.z,w=r.x,S=r.y,C=r.z,I=void 0,H=void 0,B=void 0,L=void 0,O=void 0,k=void 0,K=void 0,z=void 0,N=void 0,U=void 0,Q=void 0,G=void 0,q=void 0,j=void 0,X=void 0,ae=void 0,W=void 0,te=void 0,ee=void 0,ie=void 0,$=void 0,se=void 0,re=void 0,oe=void 0,pe=void 0,he=void 0,Ae=void 0;v<g;v++){if(E=s[v],b=E*3,this.getPositionByIndex(b,scratchVector3$4),I=scratchVector3$4.x,H=scratchVector3$4.y,B=scratchVector3$4.z,this.getPositionByIndex(b+1,scratchVector3$4),L=scratchVector3$4.x,O=scratchVector3$4.y,k=scratchVector3$4.z,this.getPositionByIndex(b+2,scratchVector3$4),K=scratchVector3$4.x,z=scratchVector3$4.y,N=scratchVector3$4.z,U=L-I,Q=O-H,G=k-B,q=K-I,j=z-H,X=N-B,ae=Q*X-G*j,W=G*q-U*X,te=U*j-Q*q,re=w*ae+S*W+C*te,re>0)se=1;else if(re<0)se=-1,re=-re;else continue;ee=_-I,ie=x-H,$=R-B,oe=se*(w*(ie*X-$*j)+S*($*q-ee*X)+C*(ee*j-ie*q)),!(oe<0)&&(pe=se*(w*(Q*$-G*ie)+S*(G*ee-U*$)+C*(U*ie-Q*ee)),!(pe<0)&&(oe+pe>re||(he=-se*(ee*ae+ie*W+$*te),!(he<0)&&(Ae=he/re,o.push(new BVHIntersect([I,H,B,L,O,k,K,z,N],[_+w*Ae,x+S*Ae,R+C*Ae],E))))))}y=A*BYTES_PER_NODE/2,h=d[y+16],p=d[y+17],h&&m.push(h),p&&m.push(p)}return o},t}(BVHObject);function clamp(n,t,e){return n<t?t:n>e?e:n}function calcExtents(n,t,e,r,i){if(e>=r)return[0,0,0,0,0,0];for(var o=1/0,s=1/0,u=1/0,l=-1/0,c=-1/0,d=-1/0,f=e,m=void 0,A=void 0;f<r;f++)m=n[f]*6,A=t[m],A<o&&(o=A),A=t[m+1],A<s&&(s=A),A=t[m+2],A<u&&(u=A),A=t[m+3],A>l&&(l=A),A=t[m+4],A>c&&(c=A),A=t[m+5],A>d&&(d=A);return[o-i,s-i,u-i,l+i,c+i,d+i]}var EPSILON=1e-6,ORDER_AXISES=["x","y","z"],scratchVector3$3=new BVHVector3(0,0,0),BVHPoints=function(n){__extends(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 o=this.getPositionByIndex.bind(this),s=this.getPositionCount(),u=s>65535?new Uint32Array(s):new Uint16Array(s),l=[],c=0,d=-1;if(i)for(var f=0;f<s;f+=1)u[f]=f;else{o(0,scratchVector3$3);for(var m=scratchVector3$3.x,A=scratchVector3$3.y,h=scratchVector3$3.z,p=m,y=A,v=h,f=0,g=void 0,E=void 0,b=void 0;f<s;f+=1)u[f]=f,o(f,scratchVector3$3),g=scratchVector3$3.x,E=scratchVector3$3.y,b=scratchVector3$3.z,g<m?m=g:g>p&&(p=g),E<A?A=E:E>y&&(y=E),b<h?h=b:b>v&&(v=b);i=[m,A,h,p,y,v]}var T=new BVHNode(++d,i,0,s,0);l[c++]=T;var _=[],x=[0,1,2],R=function(S,C){return _[C]-_[S]};function w(S){var C=S.startIndex,I=S.endIndex,H=S.extents;_[0]=H[3]-H[0],_[1]=H[4]-H[1],_[2]=H[5]-H[2];for(var B=x.sort(R)[0],L=ORDER_AXISES[B],O=(H[B]+H[B+3])/2,k=C,K=I-1,z=-1,N;k<=K;)z===-1?(N=u[k],o(N,scratchVector3$3),scratchVector3$3[L]<O?k++:z=N):(N=u[K],o(N,scratchVector3$3),scratchVector3$3[L]>=O||(u[k]=N,u[K]=z,z=-1,k++),K--);if(k>C){var U=H.slice();U[B+3]=O+EPSILON;var Q=new BVHNode(++d,U,C,k,S.deepth+1);Q.deepth<r&&Q.endIndex-Q.startIndex>e&&(l[c++]=Q),S.node0=Q}if(I>k){var G=H.slice();G[B]=O-EPSILON;var q=new BVHNode(++d,G,k,I,S.deepth+1);q.deepth<r&&q.endIndex-q.startIndex>e&&(l[c++]=q),S.node1=q}S.startIndex=0,S.endIndex=0}for(;c;)w(l[--c]);return this.offsetArray=u,this.rootNodePacked=packBVHNode(T,d+1),l.length=0,this},t.prototype.intersectRay=function(e,r,i,o){for(var s=this.offsetArray,u=this.rootNodePacked,l=new Float32Array(u),c=new Uint32Array(u),d=new Uint16Array(u),f=i*i,m=new BVHVector3(1/r.x,1/r.y,1/r.z),A=[0],h,p,y,v;(h=A.pop())!==void 0;)if(v=h*BYTES_PER_NODE/4,intersectNodeBox(e,m,l[v],l[v+1],l[v+2],l[v+3],l[v+4],l[v+5],i)){for(var g=c[v+6],E=c[v+7],b=void 0,T=void 0,_=void 0,x=void 0,R=void 0,w=void 0,S=void 0,C=void 0,I=void 0,H=void 0,B=void 0,L=void 0;g<E;g++)b=s[g],this.getPositionByIndex(b,scratchVector3$3),T=scratchVector3$3.x,_=scratchVector3$3.y,x=scratchVector3$3.z,R=e.x,w=e.y,S=e.z,C=r.x,I=r.y,H=r.z,B=C*(T-R)+I*(_-w)+H*(x-S),B>0&&(R+=C*B,w+=I*B,S+=H*B),C=T-R,I=_-w,H=x-S,B=C*C+I*I+H*H,B<=f&&o.push(new BVHIntersect([T,_,x,T,_,x,T,_,x],[R,w,S],b));v=h*BYTES_PER_NODE/2,p=d[v+16],y=d[v+17],p&&A.push(p),y&&A.push(y)}return o},t}(BVHObject);const encodedJs$1="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3ZhciBlcj1mdW5jdGlvbihlLHIpe3JldHVybiBlcj1PYmplY3Quc2V0UHJvdG90eXBlT2Z8fHtfX3Byb3RvX186W119aW5zdGFuY2VvZiBBcnJheSYmZnVuY3Rpb24odCxvKXt0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mZnNldEFycmF5Om4ub2Zmc2V0QXJyYXkscm9vdE5vZGVQYWNrZWQ6bi5yb290Tm9kZVBhY2tlZH07dC5wdXNoKHMpO3ZhciB1PXZvaWQgMDtmb3IodmFyIHcgaW4gcy5hdHRyaWJ1dGVzKXt2YXIgeT1zLmF0dHJpYnV0ZXNbd107eSYmeS5idWZmZXIgaW5zdGFuY2VvZiBBcnJheUJ1ZmZlciYmby5hZGQoeS5idWZmZXIpfXU9cy5pbmRpY2VzLHUmJnUuYnVmZmVyIGluc3RhbmNlb2YgQXJyYXlCdWZmZXImJm8uYWRkKHUuYnVmZmVyKSx1PXMub2Zmc2V0QXJyYXksdSYmdS5idWZmZXIgaW5zdGFuY2VvZiBBcnJheUJ1ZmZlciYmby5hZGQodS5idWZmZXIpLG8uYWRkKHMucm9vdE5vZGVQYWNrZWQpfXJldHVybntvdXRwdXQ6dCx0cmFuc2ZlcjpBcnJheS5mcm9tKG8pfX0pfSl9KSgpOwo=",decodeBase64$1=n=>Uint8Array.from(atob(n),t=>t.charCodeAt(0)),blob$2=typeof self!="undefined"&&self.Blob&&new Blob([decodeBase64$1(encodedJs$1)],{type:"text/javascript;charset=utf-8"});function WorkerWrapper$1(n){let t;try{if(t=blob$2&&(self.URL||self.webkitURL).createObjectURL(blob$2),!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,"+encodedJs$1,{name:n==null?void 0:n.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var WorkerPool$1=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,o=r.reject;if(e.data&&"$$error"in e.data?o(e.data.$$error):i(e.data),this.queue.length){var s=this.queue.shift(),u=s.resolve,l=s.reject,c=s.input,d=s.transfer;this.workersResolver[t]={resolve:u,reject:l},this.workers[t].postMessage(c,d)}else this.workerStatus^=1<<t},n.prototype.postMessage=function(t,e){var r=this;return e===void 0&&(e=[]),new Promise(function(i,o){var s=r.getIdleWorker();s!==-1?(r.initWorker(s),r.workerStatus|=1<<s,r.workersResolver[s]={resolve:i,reject:o},r.workers[s].postMessage(t,e)):r.queue.push({resolve:i,reject:o,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}(),bvhWorkerPool=new WorkerPool$1(function(){return new WorkerWrapper$1},4),bvhMeshMap=new Map,bvhPointsMap=new Map,scratchRay=new THREE__namespace.Ray,scratchNormalMatrix=new THREE__namespace.Matrix3,scratchInverseMatrix=new THREE__namespace.Matrix4,scratchIntersectionFaceA$1=new THREE__namespace.Vector3,scratchIntersectionFaceB$1=new THREE__namespace.Vector3,scratchIntersectionFaceC$1=new THREE__namespace.Vector3,scratchIntersectionTriangle=new THREE__namespace.Triangle;function raycastMesh(n,t,e,r){var i,o=n.matrixWorld;scratchInverseMatrix.getInverse(o),scratchRay.copy(e.ray).applyMatrix4(scratchInverseMatrix);for(var s=t.intersectRay(scratchRay.origin,scratchRay.direction,0,[]),u=n.geometry,l=n.material,c=u.groups,d=u.index,f=0,m=s.length;f<m;f++){var A=s[f],h=A.triangle,p=A.index,y=A.intersectionPoint,v=new THREE__namespace.Vector3(y[0],y[1],y[2]).applyMatrix4(o),g=e.ray.origin.distanceTo(v);if(!(g<e.near||g>e.far)){var E=void 0;if(Array.isArray(l)){if(c)for(var b=p*3,T=0,_=c;T<_.length;T++){var x=_[T];if(b>=x.start&&b-x.start<x.count){E=l[(i=x.materialIndex)!==null&&i!==void 0?i:0];break}}}else E=l;if(E){var R=scratchIntersectionTriangle.set(scratchIntersectionFaceA$1.set(h[0],h[1],h[2]).applyMatrix4(o),scratchIntersectionFaceB$1.set(h[3],h[4],h[5]).applyMatrix4(o),scratchIntersectionFaceC$1.set(h[6],h[7],h[8]).applyMatrix4(o)).getNormal(new THREE__namespace.Vector3),w=p*3,S=new THREE__namespace.Face3(d?d.array[w]:w,d?d.array[w+1]:w+1,d?d.array[w+2]:w+2,R),C=e.ray.direction.dot(R);E.side===THREE__namespace.FrontSide&&C>=0||E.side===THREE__namespace.BackSide&&C<=0||r.push({distance:g,object:n,face:S,point:v,distanceToRay:0,faceIndex:p})}}}}function raycastPoints(n,t,e,r){var i,o,s=n.matrixWorld;scratchNormalMatrix.getNormalMatrix(s),scratchInverseMatrix.getInverse(s);var u=((o=(i=e.params.Points)===null||i===void 0?void 0:i.threshold)!==null&&o!==void 0?o:1)*scratchInverseMatrix.getMaxScaleOnAxis();scratchRay.copy(e.ray).applyMatrix4(scratchInverseMatrix);for(var l=t.intersectRay(scratchRay.origin,scratchRay.direction,u,[]),c=n.geometry,d=c.index,f=c.getAttribute("normal"),m=0,A=l.length;m<A;m++){var h=l[m],p=h.triangle,y=h.index,v=h.intersectionPoint,g=new THREE__namespace.Vector3(v[0],v[1],v[2]).applyMatrix4(s),E=e.ray.origin.distanceTo(g);if(!(E<e.near||E>e.far)){var b=scratchIntersectionFaceA$1.set(p[0],p[1],p[2]).applyMatrix4(s),T=d?d.array[y]:y,_=void 0;f instanceof THREE__namespace.BufferAttribute&&(_=new THREE__namespace.Vector3().fromBufferAttribute(f,T).applyNormalMatrix(scratchNormalMatrix));var x=new THREE__namespace.Face3(T,T,T,_);r.push({distance:E,object:n,face:x,point:g,distanceToRay:g.distanceTo(b),index:y})}}}function bindBvhTreeForMesh(n,t){var e=n.raycast,r=function(i,o){var s=bvhMeshMap.get(this);s?raycastMesh(this,s,i,o):e.call(this,i,o)};return n.raycast=r,bvhMeshMap.set(n,t),function(){bvhMeshMap.delete(n),n.raycast===r&&(n.raycast=e)}}function bindBvhTreeForPoints(n,t){var e=n.raycast,r=function(i,o){var s=bvhPointsMap.get(this);s?raycastPoints(this,s,i,o):e.call(this,i,o)};return n.raycast=r,bvhPointsMap.set(n,t),function(){bvhPointsMap.delete(n),n.raycast===r&&(n.raycast=e)}}function generateBvhTree(n,t,e,r){var i=[];return n.traverse(function(o){(o instanceof THREE__namespace.Mesh||o instanceof THREE__namespace.Points)&&o.geometry instanceof THREE__namespace.BufferGeometry&&i.push(o)}),Promise.resolve().then(function(){for(var o=[],s=new Set,u=null,l=0;l<i.length;l++){var c=i[l],d=c.geometry;if(d instanceof THREE__namespace.BufferGeometry){var f=void 0;if(c instanceof THREE__namespace.Mesh?f="mesh":c instanceof THREE__namespace.Points&&(f="points"),!!f){var m=d.boundingBox,A=m?[m.min.x,m.min.y,m.min.z,m.max.x,m.max.y,m.max.z]:void 0,h={};for(var p in d.attributes){var y=d.attributes[p];y instanceof THREE__namespace.InterleavedBufferAttribute?(h[p]={array:y.data.array,stride:y.data.stride,offset:y.offset},u=y.data.array,u&&u.buffer instanceof ArrayBuffer&&s.add(u.buffer)):(h[p]={array:y.array},u=y.array,u&&u.buffer instanceof ArrayBuffer&&s.add(u.buffer))}var v=void 0,g=d.getIndex();g&&(g instanceof THREE__namespace.InterleavedBufferAttribute?(v={array:g.data.array,stride:g.data.stride,offset:g.offset},u=g.data.array,u&&u.buffer instanceof ArrayBuffer&&s.add(u.buffer)):(v={array:g.array},u=g.array,u&&u.buffer instanceof ArrayBuffer&&s.add(u.buffer)));var E={type:f,attributes:h,indices:v,maxItemPerNode:e,maxTreeDepth:r,extents:A};o.push(E)}}}return bvhWorkerPool.postMessage(o,Array.from(s))}).then(function(o){for(var s=[],u=0;u<i.length;u++){var l=i[u],c=l.geometry,d=o[u];if(c instanceof THREE__namespace.BufferGeometry){for(var f in d.attributes){var m=d.attributes[f].array,A=c.attributes[f];A instanceof THREE__namespace.InterleavedBufferAttribute?A.data.array=m:A.array=m}var h=c.getIndex();if(h&&d.indices){var m=d.indices.array;h instanceof THREE__namespace.InterleavedBufferAttribute?h.data.array=m:h.array=m}if(l instanceof THREE__namespace.Mesh){var p=new BVHMesh(d.attributes.position,d.indices);p.offsetArray=d.offsetArray,p.rootNodePacked=d.rootNodePacked;var y=bindBvhTreeForMesh(l,p);s.push(y)}else if(l instanceof THREE__namespace.Points){var p=new BVHPoints(d.attributes.position,d.indices);p.offsetArray=d.offsetArray,p.rootNodePacked=d.rootNodePacked;var y=bindBvhTreeForPoints(l,p);s.push(y)}}}return function(){for(var v=0,g=s;v<g.length;v++){var E=g[v];E()}s.length=0}})}var scratchIntersectionFaceA=new THREE__namespace.Vector3,scratchIntersectionFaceB=new THREE__namespace.Vector3,scratchIntersectionFaceC=new THREE__namespace.Vector3,TileNode=function(n){__extends(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 generateBvhTree(this,!0,200,10).then(function(r){e.disposers.push(r)})},t.prototype.intersectRaycaster=function(e,r,i){var o=this;r===void 0&&(r=!0),i===void 0&&(i=[]);for(var s=this.children.slice(),u,l=[];u=s.pop();)if(u.visible){u.raycast(e,l);for(var c=0,d=u.children.length;c<d;c++)s.push(u.children[c])}return l.forEach(function(f){var m,A,h=0;if((f.object instanceof PBMMesh||f.object instanceof PBMPointCloud)&&f.face){var p=Array.isArray(f.object.material)?f.object.material[f.face.materialIndex]:f.object.material;if(p)if(p.defines.USE_VERTEX_FLOOR){var y=(m=f.object.geometry.attributes.position)===null||m===void 0?void 0:m.array,v=(A=f.object.geometry.attributes.floor)===null||A===void 0?void 0:A.array;if(y&&v){var g=scratchIntersectionFaceA.set(y[f.face.a*3],y[f.face.a*3+1],y[f.face.a*3+2]).applyMatrix4(o.matrixWorld),E=scratchIntersectionFaceB.set(y[f.face.b*3],y[f.face.b*3+1],y[f.face.b*3+2]).applyMatrix4(o.matrixWorld),b=scratchIntersectionFaceC.set(y[f.face.c*3],y[f.face.c*3+1],y[f.face.c*3+2]).applyMatrix4(o.matrixWorld),T=f.point.distanceTo(g),_=f.point.distanceTo(E),x=f.point.distanceTo(b);h=Math.round((T*v[f.face.a]+_*v[f.face.b]+x*v[f.face.c])/(T+_+x))}}else h=p.floor}f.floor=h}),r&&l.sort(function(f,m){return f.distance-m.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}(THREE__namespace.Group);function pathJoin(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=[];n=n.map(function(u){return(u!=null?u:"").trim()}).filter(function(u){return u.length>0&&!/^\/+$/.test(u)});for(var r=0;r<n.length;r++){var i=r===0,o=r===n.length-1,s=n[r];i||(s=s.replace(/^\.\//,"").replace(/^\/+/,"")),o||(s=s.replace(/\/+$/,"")),e.push(s)}return e.join("/")}function normalizeURL(n){var t,e=/^(http\:|https\:|file\:)?\/\/[^/]/.exec(n);if(!e)return n;var r=e[1]||"",i=n.slice(r.length+2),o=i.indexOf("#");o>=0&&(n.slice(o),i=n.slice(0,o));var s=i.indexOf("?");s>=0&&(n.slice(s),i=n.slice(0,s));for(var u=i.split("/"),l=u.shift(),c=(t=u.pop())!==null&&t!==void 0?t:"",d=[],f=0,m=u;f<m.length;f++){var A=m[f];if(!(A===""||A===".")){if(A===".."){d.pop();continue}d.push(A)}}return r+"//"+l+"/"+d.join("/")+"/"+c}function isAbsoluteURL(n){return n.indexOf("//")===0||/^[0-9a-z]+\:/i.test(n)}function normalizeTileHeader(n,t){if(n.content&&n.content.uri&&(isAbsoluteURL(n.content.uri)||(n.content.uri=normalizeURL(pathJoin(t,n.content.uri)))),n.transform){for(var e=!1,r=0;r<16;r++){var i=n.transform[r];if(typeof i!="number"||isNaN(i)||!isFinite(i)){e=!0;break}}if(n.transform[15]===0&&(e=!0),e)throw new Error("Invalid Tile Transform: "+JSON.stringify(n.transform))}if(n.children)for(var o=0,s=n.children;o<s.length;o++){var u=s[o];normalizeTileHeader(u,t)}return n}function normalizeTilesetHeader(n,t){return n.asset||(n.asset={}),n.rootMeta||(n.rootMeta={}),n.asset.overview&&(isAbsoluteURL(n.asset.overview.imageFile)||(n.asset.overview.imageFile=normalizeURL(pathJoin(t,n.asset.overview.imageFile))),isAbsoluteURL(n.asset.overview.worldFile)||(n.asset.overview.worldFile=normalizeURL(pathJoin(t,n.asset.overview.worldFile)))),normalizeTileHeader(n.root,t),n}function appendSearch(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 pointCloudFragmentShader=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,o=0,s="";return t[o].split(s).map(function(u){return u.charCodeAt(o)>i?u:String.fromCharCode((u.charCodeAt(o)+r)%i)}).join(s)}("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"),pointCloudVertexShader=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,o=0,s="";return t[o].split(s).map(function(u){return u.charCodeAt(o)>i?u:String.fromCharCode((u.charCodeAt(o)+r)%i)}).join(s)}("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 scratchVector4=new THREE__namespace.Vector4,shaderUniforms=Object.assign({pointScale:new THREE__namespace.Uniform(1),pointMinPixel:new THREE__namespace.Uniform(1),pointMaxPixel:new THREE__namespace.Uniform(1),opacity:new THREE__namespace.Uniform(1),gradientTexture:new THREE__namespace.Uniform(null),modelAlpha:new THREE__namespace.Uniform(0),clippers:new THREE__namespace.Uniform([]),shownFloorIndex:new THREE__namespace.Uniform(-1),constantColor:new THREE__namespace.Uniform(null),geometricError:new THREE__namespace.Uniform(0),pixelRatio:new THREE__namespace.Uniform(1),resolution:new THREE__namespace.Uniform(new THREE__namespace.Vector2(512,512)),floor:new THREE__namespace.Uniform(0),brightness:new THREE__namespace.Uniform(1),modelBoundingMin:new THREE__namespace.Uniform(new THREE__namespace.Vector3),modelBoundingMax:new THREE__namespace.Uniform(new THREE__namespace.Vector3)},THREE__namespace.UniformsUtils.clone(THREE__namespace.UniformsLib.fog)),PBMPointCloudMaterial=function(n){__extends(t,n);function t(e){e===void 0&&(e={});var r,i,o,s,u,l,c,d,f,m,A,h,p,y,v,g,E,b,T,_,x,R=n.call(this,{vertexShader:pointCloudVertexShader,fragmentShader:pointCloudFragmentShader,uniforms:THREE__namespace.UniformsUtils.clone(shaderUniforms),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_VERTEX_MARK:!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,w;return Object.defineProperties(R,{constantColor:{get:function(){return this.uniforms.constantColor.value},set:function(S){this.uniforms.constantColor.value=S;var C=this.defines.USE_CONSTANT_COLOR,I=S!==null;C!==I&&(this.defines.USE_CONSTANT_COLOR=I,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 w},set:function(S){w!==S&&(w=S,this.uniforms.clippers.value=(w||[]).map(function(C){var I=typeof C.floorIndex=="number"?C.floorIndex:-1,H=new THREE__namespace.Matrix4().getInverse(C.clippingBoxMatrix);return{matrixInverse:H,floorIndex:I}}),this.needsUpdate=!0)}},pointColor:{get:function(){return this.defines.USE_POINT_COLOR_ALTITUDE===!0?"ALTITUDE":"RGB"},set:function(S){var C=S==="ALTITUDE";this.defines.USE_POINT_COLOR_ALTITUDE!==C&&(this.defines.USE_POINT_COLOR_ALTITUDE=C,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 C=S==="ATTENUATION",I=S==="GEOMETRIC";this.defines.USE_POINT_SIZE_GEOMETRIC!==I&&(this.defines.USE_POINT_SIZE_GEOMETRIC=I,this.needsUpdate=!0),this.defines.USE_POINT_SIZE_ATTENUATION!==C&&(this.defines.USE_POINT_SIZE_ATTENUATION=C,this.needsUpdate=!0)}},pointShape:{get:function(){return this.defines.USE_POINT_SHAPE_CIRCLE===!0?"CIRCLE":"SQUARE"},set:function(S){var C=S==="CIRCLE";this.defines.USE_POINT_SHAPE_CIRCLE!==C&&(this.defines.USE_POINT_SHAPE_CIRCLE=C,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 C=S==="HIDDEN",I=S==="DARK";this.defines.USE_POINT_BACK_HIDDEN!==C&&(this.defines.USE_POINT_BACK_HIDDEN=C,this.needsUpdate=!0),this.defines.USE_POINT_BACK_DARK!==I&&(this.defines.USE_POINT_BACK_DARK=I,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}}}),R.pano0=(r=e.pano0)!==null&&r!==void 0?r:defaultPbmParameters.pano0,R.pano1=(i=e.pano1)!==null&&i!==void 0?i:defaultPbmParameters.pano1,R.modelAlpha=(o=e.modelAlpha)!==null&&o!==void 0?o:defaultPbmParameters.modelAlpha,R.progress=(s=e.progress)!==null&&s!==void 0?s:defaultPbmParameters.progress,R.transition=(u=e.transition)!==null&&u!==void 0?u:defaultPbmParameters.transition,R.constantColor=(l=e.constantColor)!==null&&l!==void 0?l:defaultPbmParameters.constantColor,R.opacity=(c=e.opacity)!==null&&c!==void 0?c:defaultPbmParameters.opacity,R.shownFloorIndex=(d=e.shownFloorIndex)!==null&&d!==void 0?d:defaultPbmParameters.shownFloorIndex,R.clippers=(f=e.clippers)!==null&&f!==void 0?f:defaultPbmParameters.clippers,R.useEDL=(m=e.useEDL)!==null&&m!==void 0?m:defaultPbmParameters.useEDL,R.useHQWeight=(A=e.useHQWeight)!==null&&A!==void 0?A:defaultPbmParameters.useHQWeight,R.useHQDepth=(h=e.useHQDepth)!==null&&h!==void 0?h:defaultPbmParameters.useHQDepth,R.pointColor=(p=e.pointColor)!==null&&p!==void 0?p:defaultPbmParameters.pointColor,R.pointShape=(y=e.pointShape)!==null&&y!==void 0?y:defaultPbmParameters.pointShape,R.pointSize=(v=e.pointSize)!==null&&v!==void 0?v:defaultPbmParameters.pointSize,R.pointScale=(g=e.pointScale)!==null&&g!==void 0?g:defaultPbmParameters.pointScale,R.pointBack=(E=e.pointBack)!==null&&E!==void 0?E:defaultPbmParameters.pointBack,R.pointMinPixel=(b=e.pointMinPixel)!==null&&b!==void 0?b:defaultPbmParameters.pointMinPixel,R.pointMaxPixel=(T=e.pointMaxPixel)!==null&&T!==void 0?T:defaultPbmParameters.pointMaxPixel,R.gradientTexture=(_=e.gradientTexture)!==null&&_!==void 0?_:defaultPbmParameters.gradientTexture,R.brightness=(x=e.brightness)!==null&&x!==void 0?x:defaultPbmParameters.brightness,R.floor=0,R.transparent=!1,R}return t.prototype.onBeforeCompile=function(e,r){var i,o,s=String((o=(i=this.clippers)===null||i===void 0?void 0:i.length)!==null&&o!==void 0?o:0);e.vertexShader=e.vertexShader.replace(/NUM_CLIPPERS/g,s),e.fragmentShader=e.fragmentShader.replace(/NUM_CLIPPERS/g,s)},t.prototype.update=function(e,r){if(r instanceof Camera)this.uniforms.pixelRatio.value=r.pixelRatio,this.uniforms.resolution.value.copy(r.resolution);else{this.uniforms.pixelRatio.value=e.getPixelRatio();var i=e.getViewport(scratchVector4);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=THREE__namespace.CustomBlending,this.blendSrc=THREE__namespace.SrcAlphaFactor,this.blendSrcAlpha=THREE__namespace.SrcAlphaFactor,this.blendDst=THREE__namespace.OneFactor,this.blendDstAlpha=THREE__namespace.OneFactor):(this.depthWrite=!0,this.blendDst=THREE__namespace.OneMinusSrcAlphaFactor,this.blendEquation=THREE__namespace.AddEquation,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.opacity<1?(this.blending=THREE__namespace.AdditiveBlending,this.depthTest=!1):(this.blending=THREE__namespace.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}(THREE__namespace.ShaderMaterial),SIZEOF_UINT32$1=4;function parseHeader(n,t,e){var r=new DataView(t);if(n.magic=r.getUint32(e,!0),e+=SIZEOF_UINT32$1,n.version=r.getUint32(e,!0),e+=SIZEOF_UINT32$1,n.byteLength=r.getUint32(e,!0),e+=SIZEOF_UINT32$1,n.version!==1)throw new Error("3D Tile Version ".concat(n.version," not supported"));return e}var _a$2,GL_TYPE;(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"})(GL_TYPE||(GL_TYPE={}));var GL_TYPE_TO_ARRAY_TYPE=(_a$2={},_a$2[GL_TYPE.DOUBLE]=Float64Array,_a$2[GL_TYPE.FLOAT]=Float32Array,_a$2[GL_TYPE.UNSIGNED_SHORT]=Uint16Array,_a$2[GL_TYPE.UNSIGNED_INT]=Uint32Array,_a$2[GL_TYPE.UNSIGNED_BYTE]=Uint8Array,_a$2[GL_TYPE.BYTE]=Int8Array,_a$2[GL_TYPE.SHORT]=Int16Array,_a$2[GL_TYPE.INT]=Int32Array,_a$2),NAME_TO_GL_TYPE={DOUBLE:GL_TYPE.DOUBLE,FLOAT:GL_TYPE.FLOAT,UNSIGNED_SHORT:GL_TYPE.UNSIGNED_SHORT,UNSIGNED_INT:GL_TYPE.UNSIGNED_INT,UNSIGNED_BYTE:GL_TYPE.UNSIGNED_BYTE,BYTE:GL_TYPE.BYTE,SHORT:GL_TYPE.SHORT,INT:GL_TYPE.INT};function getArrayType(n){var t=GL_TYPE_TO_ARRAY_TYPE[n];if(!t)throw new Error("Failed to convert GL type");return t}function getByteSize(n){var t=getArrayType(n);return t.BYTES_PER_ELEMENT}function createTypedArray(n,t,e,r){e===void 0&&(e=0);var i=getArrayType(n);if(e%getByteSize(n)!==0){var o=r?t.slice(e,e+r*getByteSize(n)):t.slice(e);return new i(o)}else return new i(t,e,r!=null?r:(t.byteLength-e)/getByteSize(n))}function glTypeFromName(n){var t=NAME_TO_GL_TYPE[n];if(!t)throw new Error("Failed to convert GL type");return t}var FeatureTable=function(){function n(t,e){this.featuresLength=0,this.cachedTypedArrays={},this.json=t,this.buffer=e;var r=this.getGlobalProperty("POINTS_LENGTH",GL_TYPE.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 o=getArrayType(e);return new o([i])}else if(Array.isArray(i)){var o=getArrayType(e);return new o(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=glTypeFromName(i.componentType)),this.getTypedArrayFromBinary(t,e,r,this.featuresLength,i.byteOffset)):this.getTypedArrayFromArray(t,e,i)},n.prototype.getProperty=function(t,e,r,i,o){var s=this.json[t];if(!s)return null;var u=this.getPropertyArray(t,e,r);if(r===1)return o[0]=u[i],o;for(var l=0;l<r;++l)o[l]=u[r*i+l];return o},n.prototype.getTypedArrayFromBinary=function(t,e,r,i,o){var s=this.cachedTypedArrays,u=s[t];return u||(u=createTypedArray(e,this.buffer.buffer,this.buffer.byteOffset+o,i*r),s[t]=u),u},n.prototype.getTypedArrayFromArray=function(t,e,r){var i=this.cachedTypedArrays,o=i[t];return o||(o=createTypedArray(e,r),i[t]=o),o},n}(),SIZEOF_UINT32=4,DEPRECATION_WARNING="b3dm tile in legacy format.";function getStringFromArrayBuffer(n,t,e){var r=new TextDecoder("utf8"),i=new Uint8Array(n,t,e),o=r.decode(i);return o}function parseTable(n,t,e){return e=parseTablesHeader(n,t,e),e=parseFeatureTable(n,t,e),e=parseBatchTable(n,t,e),e}function parseTablesHeader(n,t,e){var r=new DataView(t),i=0;n.header=n.header||{};var o=r.getUint32(e,!0);e+=SIZEOF_UINT32;var s=r.getUint32(e,!0);e+=SIZEOF_UINT32;var u=r.getUint32(e,!0);e+=SIZEOF_UINT32;var l=r.getUint32(e,!0);return e+=SIZEOF_UINT32,u>=570425344?(e-=SIZEOF_UINT32*2,i=o,u=s,l=0,o=0,s=0,console.warn(DEPRECATION_WARNING)):l>=570425344&&(e-=SIZEOF_UINT32,i=u,u=o,l=s,o=0,s=0,console.warn(DEPRECATION_WARNING)),n.header.featureTableJsonByteLength=o,n.header.featureTableBinaryByteLength=s,n.header.batchTableJsonByteLength=u,n.header.batchTableBinaryByteLength=l,n.header.batchLength=i,e}function parseFeatureTable(n,t,e){var r=n.header||{},i=r.featureTableJsonByteLength,o=r.featureTableBinaryByteLength,s=r.batchLength;if(n.featureTableJson={BATCH_LENGTH:s||0},i&&i>0){var u=getStringFromArrayBuffer(t,e,i);n.featureTableJson=JSON.parse(u)}e+=i||0,n.featureTableBinary=new Uint8Array(t,e,o),e+=o||0,n.rtcCenter=[0,0,0];var l=new FeatureTable(n.featureTableJson,n.featureTableBinary);if(Array.isArray(l.json.RTC_CENTER)){var c=l.json.RTC_CENTER;n.rtcCenter[0]=c[0],n.rtcCenter[1]=c[1],n.rtcCenter[2]=c[2]}else{var c=l.getGlobalProperty("RTC_CENTER",GL_TYPE.FLOAT,3);c&&(n.rtcCenter[0]=c[0],n.rtcCenter[1]=c[1],n.rtcCenter[2]=c[2])}return e}function parseBatchTable(n,t,e){var r=n.header||{},i=r.batchTableJsonByteLength,o=r.batchTableBinaryByteLength;if(i&&i>0){var s=getStringFromArrayBuffer(t,e,i);n.batchTableJson=JSON.parse(s),e+=i,o&&o>0&&(n.batchTableBinary=new Uint8Array(t,e,o),n.batchTableBinary=new Uint8Array(n.batchTableBinary),e+=o)}return e}function sliceArrayBuffer(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 parseGlTFArrayBuffer(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=sliceArrayBuffer(t,e,r),n.byteLength}function decodeText(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 WEBGL_CONSTANTS={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},WEBGL_COMPONENT_TYPES={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},WEBGL_FILTERS={9728:THREE__namespace.NearestFilter,9729:THREE__namespace.LinearFilter,9984:THREE__namespace.NearestMipmapNearestFilter,9985:THREE__namespace.LinearMipmapNearestFilter,9986:THREE__namespace.NearestMipmapLinearFilter,9987:THREE__namespace.LinearMipmapLinearFilter},WEBGL_WRAPPINGS={33071:THREE__namespace.ClampToEdgeWrapping,33648:THREE__namespace.MirroredRepeatWrapping,10497:THREE__namespace.RepeatWrapping},WEBGL_TYPE_SIZES={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},ATTRIBUTES={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},PATH_PROPERTIES={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},INTERPOLATION={CUBICSPLINE:void 0,LINEAR:THREE__namespace.InterpolateLinear,STEP:THREE__namespace.InterpolateDiscrete},ALPHA_MODES={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function values(n){var t=[];for(var e in n)t.push(n[e]);return t}var Parser=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,o=e.length;i<o;i++)for(var s=e[i].joints,u=0,l=s.length;u<l;u++)t[s[u]].isBone=!0;for(var c=0,d=t.length;c<d;c++){var f=t[c];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,o=values(r);i<o.length;i++){var s=o[i];s.markDefs(this)}return Promise.all(values(r).map(function(u){return u.prepare(t)})).then(function(){var u,l,c;return Promise.all([Promise.all(((u=e.scenes)!==null&&u!==void 0?u:[]).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(((c=e.cameras)!==null&&c!==void 0?c:[]).map(function(d,f){return t.loadCamera(f)}))])}).then(function(u){var l=u[0],c=u[1],d=u[2],f={json:t.json,scene:l[e.scene||0],scenes:l,animations:c,cameras:d,dispose:function(){return t.dispose()}};return Promise.all(values(r).map(function(m){return m.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,o=0,s=values(this.extensions);o<s.length;o++){var u=s[o];if(i=u.loadCamera(t,this),i)break}if(!i){var l=void 0,c=this.json.cameras[t],d=c[c.type];d?c.type==="perspective"?l=new THREE__namespace.PerspectiveCamera(THREE__namespace.MathUtils.radToDeg(d.yfov),d.aspectRatio||1,d.znear||1,d.zfar||2e6):c.type==="orthographic"?l=new THREE__namespace.OrthographicCamera(-d.xmag,d.xmag,d.ymag,-d.ymag,d.znear,d.zfar):(console.warn("glTF: Invalid camera type ".concat(c.type,".")),l=new THREE__namespace.Camera):(console.warn("glTF: Missing camera parameters."),l=new THREE__namespace.Camera),c.name&&(l.name=this.createUniqueName(c.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,o=this.json.skins[t],s={joints:o.joints};return o.inverseBindMatrices===void 0?i=Promise.resolve(s):i=this.loadAccessor(o.inverseBindMatrices).then(function(u){return u&&(s.inverseBindMatrices=u),s}),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,o=0,s=values(this.extensions);o<s.length;o++){var u=s[o];if(i=u.loadAnimation(t,this),i)break}if(!i){for(var l=this.json,c=l.animations[t],d=[],f=[],m=[],A=[],h=[],p=0,y=c.channels.length;p<y;p++){var v=c.channels[p],g=c.samplers[v.sampler],E=v.target,b=E.node!==void 0?E.node:E.id,T=c.parameters!==void 0?c.parameters[g.input]:g.input,_=c.parameters!==void 0?c.parameters[g.output]:g.output;d.push(this.loadNode(b)),f.push(this.loadAccessor(T)),m.push(this.loadAccessor(_)),A.push(g),h.push(E)}i=Promise.all([Promise.all(d),Promise.all(f),Promise.all(m),Promise.all(A),Promise.all(h)]).then(function(x){for(var R=x[0],w=x[1],S=x[2],C=x[3],I=x[4],H=[],B=function(K,z){var N=R[K],U=w[K],Q=S[K],G=C[K],q=I[K];if(N===void 0)return"continue";N.updateMatrix(),N.matrixAutoUpdate=!0;var j=void 0;switch(PATH_PROPERTIES[q.path]){case PATH_PROPERTIES.weights:j=THREE__namespace.NumberKeyframeTrack;break;case PATH_PROPERTIES.rotation:j=THREE__namespace.QuaternionKeyframeTrack;break;case PATH_PROPERTIES.position:case PATH_PROPERTIES.scale:default:j=THREE__namespace.VectorKeyframeTrack;break}var X=N.name?N.name:N.uuid,ae=G.interpolation!==void 0?INTERPOLATION[G.interpolation]:THREE__namespace.InterpolateLinear,W=[];PATH_PROPERTIES[q.path]===PATH_PROPERTIES.weights?N.traverse(function(oe){oe.morphTargetInfluences&&W.push(oe.name?oe.name:oe.uuid)}):W.push(X);var te=Q.array;if(Q.normalized){for(var ee=getNormalizedComponentScale(te.constructor),ie=new Float32Array(te.length),$=0,se=te.length;$<se;$++)ie[$]=te[$]*ee;te=ie}for(var $=0,se=W.length;$<se;$++){var re=new j(W[$]+"."+PATH_PROPERTIES[q.path],U.array,te,ae);H.push(re)}},L=0,O=R.length;L<O;L++)B(L);var k=c.name?c.name:"animation_"+t;return new THREE__namespace.AnimationClip(k,void 0,H)})}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 o=null,s=0,u=values(this.extensions);s<u.length;s++){var l=u[s];if(o=l.loadBuffer(t,this),o)break}if(!o){var c=this.json.buffers[t];o=this.options.fetcher.ajax(this.resolveResouce(c.uri),{responseType:"arraybuffer"}).then(function(d){return d.body})}return this.cache.set(r,o),o},n.prototype.loadBufferView=function(t){var e="bufferView:"+t,r=this.cache.get(e);if(r)return r;for(var i=null,o=0,s=values(this.extensions);o<s.length;o++){var u=s[o];if(i=u.loadBufferView(t,this),i)break}if(!i){var l=this.json.bufferViews[t];i=this.loadBuffer(l.buffer).then(function(c){var d=l.byteLength||0,f=l.byteOffset||0;return c.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 o=null;if(!o){var s=this.json.accessors[t];if(s.bufferView===void 0&&s.sparse===void 0)o=Promise.resolve(null);else{var u=[];s.bufferView!==void 0?u.push(this.loadBufferView(s.bufferView)):u.push(Promise.resolve(null)),s.sparse!==void 0&&(u.push(this.loadBufferView(s.sparse.indices.bufferView)),u.push(this.loadBufferView(s.sparse.values.bufferView))),o=Promise.all(u).then(function(l){var c=l[0],d=WEBGL_TYPE_SIZES[s.type],f=WEBGL_COMPONENT_TYPES[s.componentType],m=f.BYTES_PER_ELEMENT,A=m*d,h=s.byteOffset||0,p=s.bufferView!==void 0?e.json.bufferViews[s.bufferView].byteStride:void 0,y=s.normalized===!0,v,g;if(p&&p!==A){var E=Math.floor(h/p),b="InterleavedBuffer:"+s.bufferView+":"+s.componentType+":"+E+":"+s.count,T=e.cache.get(b);T||(v=new f(c,E*p,s.count*p/m),T=new THREE__namespace.InterleavedBuffer(v,p/m),e.cache.set(b,T)),g=new THREE__namespace.InterleavedBufferAttribute(T,d,h%p/m,y)}else c===null?v=new f(s.count*d):v=new f(c,h,s.count*d),g=new THREE__namespace.BufferAttribute(v,d,y);if(s.sparse!==void 0){var _=WEBGL_TYPE_SIZES.SCALAR,x=WEBGL_COMPONENT_TYPES[s.sparse.indices.componentType],R=s.sparse.indices.byteOffset||0,w=s.sparse.values.byteOffset||0,S=new x(l[1],R,s.sparse.count*_),C=new f(l[2],w,s.sparse.count*d);c!==null&&(g=new THREE__namespace.BufferAttribute(g.array.slice(),g.itemSize,g.normalized));for(var I=0,H=S.length;I<H;I++){var B=S[I];if(g.setX(B,C[I*d]),d>=2&&g.setY(B,C[I*d+1]),d>=3&&g.setZ(B,C[I*d+2]),d>=4&&g.setW(B,C[I*d+3]),d>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return g})}}return this.cache.set(r,o),o},n.prototype.createPrimitiveKey=function(t){for(var e=0,r=values(this.extensions);e<r.length;e++){var i=r[e],o=i.createPrimitiveKey(t,this);if(o)return o}for(var s="",u=Object.keys(t.attributes).sort(),l=0,c=u.length;l<c;l++)s+=u[l]+":"+t.attributes[u[l]]+";";return t.indices+":"+s+":"+t.mode},n.prototype.loadGeometry=function(t){for(var e=this,r=null,i=0,o=values(this.extensions);i<o.length;i++){var s=o[i];if(r=s.loadGeometry(t,this),r)break}return r||(r=this.addGeometryPrimitiveAttributes(new THREE__namespace.BufferGeometry,t)),r=r.then(function(u){return e.disposeSet.add(u),u}),r},n.prototype.loadImage=function(t){for(var e=this,r=null,i=0,o=values(this.extensions);i<o.length;i++){var s=o[i];if(r=s.loadImage(t,this),r)break}if(!r){var u=this.json.images[t];if(u.bufferView!==void 0){var l=this.json.bufferViews[u.bufferView];r=this.loadBuffer(l.buffer).then(function(d){var f=l.byteOffset||0,m=l.byteLength||0,A=new Uint8Array(d,f,m),h=new Blob([A],{type:u.mimeType});return createImageBitmapLike(h)})}else if(u.uri){var c=this.resolveResouce(u.uri);r=this.options.fetcher.loadImage(c,{},void 0,void 0,void 0,createImageBitmapLikeImage()).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 THREE__namespace.MeshStandardMaterial;if(i.color=new THREE__namespace.Color(1,1,1),i.opacity=1,Object.keys(t.attributes).filter(function(d){return ATTRIBUTES[d]==="color"}).length>0&&(i.vertexColors=!0),Object.keys(t.attributes).filter(function(d){return ATTRIBUTES[d]==="normal"}).length===0&&(i.flatShading=!0),Object.keys(t.attributes).filter(function(d){return ATTRIBUTES[d]==="tangent"}).length===0&&(i.normalScale&&(i.normalScale.y*=-1),i.clearcoatNormalScale&&(i.clearcoatNormalScale.y*=-1)),t.material!==void 0){var o=this.json.materials[t.material];o.name&&(i.name=o.name);var s=o.pbrMetallicRoughness||{};if(Array.isArray(s.baseColorFactor)){var u=s.baseColorFactor;i.color.fromArray(u),i.opacity=u[3]}s.baseColorTexture!==void 0&&r.push(this.createMaterialTexture(s.baseColorTexture).then(function(d){d.encoding=THREE__namespace.sRGBEncoding,i.map=d,e.disposeSet.add(d)})),i.metalness=s.metallicFactor!==void 0?s.metallicFactor:1,i.roughness=s.roughnessFactor!==void 0?s.roughnessFactor:1,s.metallicRoughnessTexture!==void 0&&r.push(this.createMaterialTexture(s.metallicRoughnessTexture).then(function(d){d.encoding=THREE__namespace.sRGBEncoding,i.metalnessMap=d,i.roughnessMap=d,e.disposeSet.add(d)})),o.doubleSided===!0&&(i.side=THREE__namespace.DoubleSide);var l=o.alphaMode||ALPHA_MODES.OPAQUE;if(l===ALPHA_MODES.BLEND?(i.transparent=!0,i.depthWrite=!1):(i.transparent=!1,l===ALPHA_MODES.MASK&&(i.alphaTest=o.alphaCutoff!==void 0?o.alphaCutoff:.5)),o.normalTexture!==void 0&&(r.push(this.createMaterialTexture(o.normalTexture).then(function(d){i.normalMap=d,e.disposeSet.add(d)})),i.normalScale=new THREE__namespace.Vector2(1,1),o.normalTexture.scale!==void 0)){var c=o.normalTexture.scale;i.normalScale.set(c,c)}o.occlusionTexture!==void 0&&(r.push(this.createMaterialTexture(o.occlusionTexture).then(function(d){i.aoMap=d,e.disposeSet.add(d)})),o.occlusionTexture.strength!==void 0&&(i.aoMapIntensity=o.occlusionTexture.strength)),o.emissiveFactor!==void 0&&(i.emissive=new THREE__namespace.Color().fromArray(o.emissiveFactor)),o.emissiveTexture!==void 0&&r.push(this.createMaterialTexture(o.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 THREE__namespace.LineBasicMaterial;if(r.color=new THREE__namespace.Color(1,1,1),r.opacity=1,Object.keys(t.attributes).filter(function(l){return ATTRIBUTES[l]==="color"}).length>0&&(r.vertexColors=!0),Object.keys(t.attributes).filter(function(l){return ATTRIBUTES[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 o=i.pbrMetallicRoughness||{};if(Array.isArray(o.baseColorFactor)){var s=o.baseColorFactor;r.color.fromArray(s),r.opacity=s[3]}i.doubleSided===!0&&(r.side=THREE__namespace.DoubleSide);var u=i.alphaMode||ALPHA_MODES.OPAQUE;u===ALPHA_MODES.BLEND?(r.transparent=!0,r.depthWrite=!1):(r.transparent=!1,u===ALPHA_MODES.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 THREE__namespace.PointsMaterial;if(i.color=new THREE__namespace.Color(1,1,1),i.opacity=1,i.sizeAttenuation=!1,Object.keys(t.attributes).filter(function(c){return ATTRIBUTES[c]==="color"}).length>0&&(i.vertexColors=!0),Object.keys(t.attributes).filter(function(c){return ATTRIBUTES[c]==="tangent"}).length===0&&(i.normalScale&&(i.normalScale.y*=-1),i.clearcoatNormalScale&&(i.clearcoatNormalScale.y*=-1)),t.material!==void 0){var o=this.json.materials[t.material];o.name&&(i.name=o.name);var s=o.pbrMetallicRoughness||{};if(Array.isArray(s.baseColorFactor)){var u=s.baseColorFactor;i.color.fromArray(u),i.opacity=u[3]}s.baseColorTexture!==void 0&&r.push(this.createMaterialTexture(s.baseColorTexture).then(function(c){c.encoding=THREE__namespace.sRGBEncoding,i.map=c,e.disposeSet.add(c)})),o.doubleSided===!0&&(i.side=THREE__namespace.DoubleSide);var l=o.alphaMode||ALPHA_MODES.OPAQUE;l===ALPHA_MODES.BLEND?(i.transparent=!0,i.depthWrite=!1):(i.transparent=!1,l===ALPHA_MODES.MASK&&(i.alphaTest=o.alphaCutoff!==void 0?o.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:WEBGL_CONSTANTS.TRIANGLES,i="material:"+this.createPrimitiveKey(t),o=this.cache.get(i);if(o)return o;for(var s=null,u=0,l=values(this.extensions);u<l.length;u++){var c=l[u];if(s=c.loadMaterial(t,this),s)break}if(r===WEBGL_CONSTANTS.TRIANGLES||r===WEBGL_CONSTANTS.TRIANGLE_STRIP||r===WEBGL_CONSTANTS.TRIANGLE_FAN)s=this.loadMaterialAsMeshStandardMaterial(t);else if(r===WEBGL_CONSTANTS.LINES||r===WEBGL_CONSTANTS.LINE_STRIP||r===WEBGL_CONSTANTS.LINE_LOOP)s=this.loadMaterialAsLineBasicMaterial(t);else if(r===WEBGL_CONSTANTS.POINTS)s=this.loadMaterialAsPointsMaterial(t);else throw new Error("glTF: Primitive mode unsupported: "+r);return this.cache.set(i,s),s},n.prototype.loadTexture=function(t){var e=this,r="texture:"+t,i=this.cache.get(r);if(i)return i;for(var o=null,s=0,u=values(this.extensions);s<u.length;s++){var l=u[s];if(o=l.loadTexture(t,this),o)break}if(!o){var c=this.json.textures[t];o=this.loadImage(c.source).then(function(d){var f=new THREE__namespace.Texture(d);f.needsUpdate=!0,f.flipY=!1,c.name&&(f.name=c.name);var m=e.json.samplers||{},A=m[c.sampler]||{};return f.magFilter=WEBGL_FILTERS[A.magFilter]||THREE__namespace.LinearFilter,f.minFilter=WEBGL_FILTERS[A.minFilter]||THREE__namespace.LinearMipmapLinearFilter,f.wrapS=WEBGL_WRAPPINGS[A.wrapS]||THREE__namespace.RepeatWrapping,f.wrapT=WEBGL_WRAPPINGS[A.wrapT]||THREE__namespace.RepeatWrapping,f.onUpdate=function(){d.close()},f})}return o=o.then(function(d){return e.disposeSet.add(d),d}),this.cache.set(r,o),o},n.prototype.loadMesh=function(t){for(var e=this,r=null,i=0,o=values(this.extensions);i<o.length;i++){var s=o[i];if(r=s.loadMesh(t,this),r)break}if(!r){var u=this.json.meshes[t],l=u.primitives,c=Promise.all(l.map(function(f){return e.loadGeometry(f)})),d=Promise.all(l.map(function(f){return e.loadMaterial(f)}));r=Promise.all([c,d]).then(function(f){for(var m=f[0],A=f[1],h=[],p=0;p<l.length;p++){var y=l[p],v=m[p],g=A[p],E=y.mode||WEBGL_CONSTANTS.TRIANGLES,b=void 0;if(E===WEBGL_CONSTANTS.TRIANGLES||E===WEBGL_CONSTANTS.TRIANGLE_STRIP||E===WEBGL_CONSTANTS.TRIANGLE_FAN)if(E===WEBGL_CONSTANTS.TRIANGLE_STRIP?v=e.toGeometryTrianglesDrawMode(v,THREE__namespace.TriangleStripDrawMode):E===WEBGL_CONSTANTS.TRIANGLE_FAN&&(v=e.toGeometryTrianglesDrawMode(v,THREE__namespace.TriangleFanDrawMode)),e.disposeSet.add(v),u.isSkinnedMesh){var T=new THREE__namespace.SkinnedMesh(v,g);v.attributes.skinWeight.normalized||T.normalizeSkinWeights(),b=T}else b=new THREE__namespace.Mesh(v,g);else if(E===WEBGL_CONSTANTS.POINTS)b=new THREE__namespace.Points(v,g);else if(E===WEBGL_CONSTANTS.LINES)b=new THREE__namespace.LineSegments(v,g);else if(E===WEBGL_CONSTANTS.LINE_STRIP)b=new THREE__namespace.Line(v,g);else if(E===WEBGL_CONSTANTS.LINE_LOOP)b=new THREE__namespace.LineLoop(v,g);else throw new Error("glTF: Primitive mode unsupported: "+E);if(Object.keys(v.morphAttributes).length>0){if(u.weights!==void 0)for(var _=0,x=u.weights.length;_<x;_++)b.morphTargetInfluences[_]=u.weights[_];if(u.extras&&Array.isArray(u.extras.targetNames)){var R=u.extras.targetNames;if(b.morphTargetInfluences.length===R.length){b.morphTargetDictionary={};for(var _=0,x=R.length;_<x;_++)b.morphTargetDictionary[R[_]]=_}else console.warn("glTF: Invalid extras.targetNames length. Ignoring names.")}}b.name=e.createUniqueName(u.name||"mesh_"+t),h.push(b)}if(h.length===1)return h[0];for(var w=new THREE__namespace.Group,S=0,C=h;S<C.length;S++){var b=C[S];w.add(b)}return w})}return r},n.prototype.loadNodeAttachments=function(t){for(var e=[],r=0,i=values(this.extensions);r<i.length;r++){var o=i[r],s=o.loadNodeAttachments(t,this);s&&e.push(s)}return e},n.prototype.loadNode=function(t){var e="node:"+t,r=this.cache.get(e);if(r)return r;var i=this.json,o=i.nodes[t],s=o.name?this.createUniqueName(o.name):"",u=[];o.mesh!==void 0&&u.push(this.loadMesh(o.mesh).then(function(m){if(o.weights!==void 0){var A=o.weights;m.traverse(function(h){if(h instanceof THREE__namespace.Mesh||h instanceof THREE__namespace.Line||h instanceof THREE__namespace.Points)for(var p=0,y=A.length;p<y;p++)h.morphTargetInfluences[p]=A[p]})}return m})),o.camera!==void 0&&u.push(this.loadCamera(o.camera));for(var l=this.loadNodeAttachments(t),c=0,d=l;c<d.length;c++){var f=d[c];u.push(f)}return Promise.all(u).then(function(m){var A;if(o.isBone===!0?A=new THREE__namespace.Bone:m.length>1?A=new THREE__namespace.Group:m.length===1?A=m[0]:A=new THREE__namespace.Object3D,A!==m[0])for(var h=0,p=m.length;h<p;h++)A.add(m[h]);if(o.name&&(A.name=s),o.matrix!==void 0){var y=new THREE__namespace.Matrix4;y.fromArray(o.matrix),A.applyMatrix4(y)}else o.translation!==void 0&&A.position.fromArray(o.translation),o.rotation!==void 0&&A.quaternion.fromArray(o.rotation),o.scale!==void 0&&A.scale.fromArray(o.scale);return A})},n.prototype.loadScene=function(t){var e=this.json,r=e.scenes[t],i=new THREE__namespace.Group;r.name&&(i.name=this.createUniqueName(r.name));for(var o=r.nodes||[],s=[],u=0,l=o.length;u<l;u++)s.push(this.buildNodeHierarchy(o[u],i));return Promise.all(s).then(function(){return i})},n.prototype.createMaterialTexture=function(t){var e=this;return this.loadTexture(t.index).then(function(r){for(var i=0,o=values(e.extensions);i<o.length;i++){var s=o[i],u=s.extendTexture(r,t,e);u&&(r=u,e.disposeSet.add(r))}return r})},n.prototype.addGeometryPrimitiveAttributes=function(t,e){var r=this,i=e.attributes,o=[],s=function(T){var _=ATTRIBUTES[T]||T.toLowerCase();if(_ in t.attributes)return"continue";o.push(u.loadAccessor(i[T]).then(function(x){x&&t.setAttribute(_,x)}))},u=this;for(var l in i)s(l);e.indices!==void 0&&!t.index&&o.push(this.loadAccessor(e.indices).then(function(T){T&&t.setIndex(T)}));var c=new THREE__namespace.Box3;if(i.POSITION!==void 0){var d=this.json.accessors[i.POSITION],f=d.min,m=d.max;if(f!==void 0&&m!==void 0){if(c.set(new THREE__namespace.Vector3(f[0],f[1],f[2]),new THREE__namespace.Vector3(m[0],m[1],m[2])),d.normalized){var A=getNormalizedComponentScale(WEBGL_COMPONENT_TYPES[d.componentType]);c.min.multiplyScalar(A),c.max.multiplyScalar(A)}}else console.warn("glTF: Missing min/max properties for accessor POSITION.")}var h=e.targets;if(h!==void 0){for(var p=new THREE__namespace.Vector3,y=new THREE__namespace.Vector3,v=0,g=h.length;v<g;v++){var E=h[v];if(E.POSITION!==void 0){var d=this.json.accessors[E.POSITION],f=d.min,m=d.max;if(f!==void 0&&m!==void 0){if(y.setX(Math.max(Math.abs(f[0]),Math.abs(m[0]))),y.setY(Math.max(Math.abs(f[1]),Math.abs(m[1]))),y.setZ(Math.max(Math.abs(f[2]),Math.abs(m[2]))),d.normalized){var A=getNormalizedComponentScale(WEBGL_COMPONENT_TYPES[d.componentType]);y.multiplyScalar(A)}p.max(y)}else console.warn("glTF: Missing min/max properties for accessor POSITION.")}}c.expandByVector(p)}t.boundingBox=c;var b=new THREE__namespace.Sphere;return c.getCenter(b.center),b.radius=c.min.distanceTo(c.max)/2,t.boundingSphere=b,Promise.all(o).then(function(){if(t.attributes.uv&&!t.attributes.uv2&&r.options.copyUV2&&t.setAttribute("uv2",t.attributes.uv),e.targets){for(var T=!1,_=!1,x=0,R=e.targets.length;x<R;x++){var w=e.targets[x];if(w.POSITION!==void 0&&(T=!0),w.NORMAL!==void 0&&(_=!0),T&&_)break}if(!T&&!_)return t;var S=[];t.morphTargetsRelative=!0;for(var C=function(I,H){var B=e.targets[I];T?S.push(r.loadAccessor(B.POSITION).then(function(L){L&&(t.morphAttributes.position[I]=L)})):t.morphAttributes.position[I]=t.attributes.position,_?S.push(r.loadAccessor(B.NORMAL).then(function(L){L&&(t.morphAttributes.normal[I]=L)})):t.morphAttributes.normal[I]=t.attributes.normal},x=0,R=e.targets.length;x<R;x++)C(x,R);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(o){if(i.skin===void 0)return o;var s;return r.loadSkin(i.skin).then(function(u){s=u;for(var l=[],c=0,d=s.joints.length;c<d;c++)l.push(r.loadNode(s.joints[c]));return Promise.all(l)}).then(function(u){return o.traverse(function(l){if(l instanceof THREE__namespace.SkinnedMesh){for(var c=[],d=[],f=0,m=u.length;f<m;f++){var A=u[f];if(A instanceof THREE__namespace.Bone){c.push(A);var h=new THREE__namespace.Matrix4;s.inverseBindMatrices!==void 0&&h.fromArray(s.inverseBindMatrices.array,f*16),d.push(h)}else console.warn('glTF: Joint "%s" could not be found.',s.joints[f])}l.bind(new THREE__namespace.Skeleton(c,d),l.matrixWorld)}}),o})}).then(function(o){e.add(o);var s=[];if(i.children)for(var u=i.children,l=0,c=u.length;l<c;l++){var d=u[l];s.push(r.buildNodeHierarchy(d,o))}return Promise.all(s).then(function(){return o})})},n.prototype.createUniqueName=function(t){for(var e=THREE__namespace.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 pathJoin(this.options.resourcePath,appendSearch(t,this.options.search))},n.prototype.toGeometryTrianglesDrawMode=function(t,e){var r=t.getIndex();if(r===null){var i=[],o=t.getAttribute("position");if(o!==void 0){for(var s=0;s<o.count;s++)i.push(s);t.setIndex(i),r=t.getIndex()}}if(r===null)return console.error("glTF: Undefined position attribute. Processing not possible."),t;var u=r.count-2,l=[];if(e===THREE__namespace.TriangleFanDrawMode)for(var s=1;s<=u;s++)l.push(r.getX(0)),l.push(r.getX(s)),l.push(r.getX(s+1));else for(var s=0;s<u;s++)s%2===0?(l.push(r.getX(s)),l.push(r.getX(s+1)),l.push(r.getX(s+2))):(l.push(r.getX(s+2)),l.push(r.getX(s+1)),l.push(r.getX(s)));l.length/3!==u&&console.error("glTF: Unable to generate correct amount of triangles.");var c=t.clone();return c.setIndex(l),this.disposeSet.add(c),c},n}();function getNormalizedComponentScale(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 BaseExtension=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}(),KHR_binary_glTF=function(n){__extends(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 decodeText(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),o=0,s=null,u=null;o<i.byteLength;){var l=i.getUint32(o,!0);if(o+=4,l!==0){var c=i.getUint32(o,!0);if(o+=4,c===t.CHUNK_TYPES.JSON){var d=new Uint8Array(e,t.HEADER_LENGTH+o,l);s=decodeText(d)}else if(c===t.CHUNK_TYPES.BIN){var f=t.HEADER_LENGTH+o;u=e.slice(f,f+l)}o+=l}}if(s===null)throw new Error("glTF:KHR_binary_glTF: JSON content not found.");this.content=s,this.body=u},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}(BaseExtension),defaultDecoderPath="https://vr-public.realsee-cdn.cn/release/static/image/release/five/resource/draco/1.5.6/",defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"},Draco=function(){function n(){this.decoderPath=defaultDecoderPath,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 o={attributeIDs:r||defaultAttributeIDs,attributeTypes:i||defaultAttributeTypes,useUniqueIDs:!!r};this.decodeGeometry(t,o).then(e)},n.prototype.decodeGeometry=function(t,e){var r=this;e===void 0&&(e={attributeIDs:defaultAttributeIDs,attributeTypes:defaultAttributeTypes,useUniqueIDs:!1});for(var i in e.attributeTypes){var o=e.attributeTypes[i];o.BYTES_PER_ELEMENT!==void 0&&(e.attributeTypes[i]=o.name)}var s,u=this.workerNextTaskID++,l=t.byteLength,c=this._getWorker(u,l).then(function(d){return s=d,new Promise(function(f,m){s._callbacks[u]={resolve:f,reject:m},s.postMessage({type:"decode",id:u,taskConfig:e,buffer:t},[t])})}).then(function(d){return r._createGeometry(d.geometry)});return c.catch(function(){return!0}).then(function(){s&&u&&r._releaseTask(s,u)}),c},n.prototype._createGeometry=function(t){var e=new THREE__namespace.BufferGeometry;t.index&&e.setIndex(new THREE__namespace.BufferAttribute(t.index.array,1));for(var r=0;r<t.attributes.length;r++){var i=t.attributes[r],o=i.name,s=i.array,u=i.itemSize;e.setAttribute(o,new THREE__namespace.BufferAttribute(s,u))}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=ajax(this.decoderPath+"draco_decoder.js",{responseType:"text"}).then(function(o){return o.body});this.decoderPending=r.then(function(o){var s=["/* draco decoder */",o,"","/* worker */",DRACOWorker].join(`
418
- `);t.workerSourceURL=URL.createObjectURL(new Blob([s]))})}else{var r=ajax(this.decoderPath+"draco_wasm_wrapper.js",{responseType:"text"}).then(function(s){return s.body}),i=ajax(this.decoderPath+"draco_decoder.wasm",{responseType:"arraybuffer"}).then(function(s){return s.body});this.decoderPending=Promise.all([r,i]).then(function(s){var u=s[0],l=s[1];t.decoderConfig.wasmBinary=l;var c=["/* draco decoder */",u,"","/* worker */",DRACOWorker].join(`
419
- `);t.workerSourceURL=URL.createObjectURL(new Blob([c]))})}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(s){var u=s.data;switch(u.type){case"decode":i._callbacks[u.id].resolve(u);break;case"error":i._callbacks[u.id].reject(u);break;default:console.error('DRACO: Unexpected message, "'+u.type+'"')}},r.workerPool.push(i)}else r.workerPool.sort(function(s,u){return s._taskLoad>u._taskLoad?-1:1});var o=r.workerPool[r.workerPool.length-1];return o._taskCosts[t]=e,o._taskLoad+=e,o})},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}(),draco=new Draco,DRACOWorker=`
417
+ `,cacheMaterials=[],cameraPX=new THREE__namespace.PerspectiveCamera(90,1,.1,2);cameraPX.up.set(0,-1,0),cameraPX.lookAt(new THREE__namespace.Vector3(1,0,0)),cameraPX.updateMatrix(),cameraPX.matrixAutoUpdate=!1;var cameraNX=new THREE__namespace.PerspectiveCamera(90,1,.1,2);cameraNX.up.set(0,-1,0),cameraNX.lookAt(new THREE__namespace.Vector3(-1,0,0)),cameraNX.updateMatrix(),cameraNX.matrixAutoUpdate=!1;var cameraPY=new THREE__namespace.PerspectiveCamera(90,1,.1,2);cameraPY.up.set(0,0,1),cameraPY.lookAt(new THREE__namespace.Vector3(0,1,0)),cameraPY.updateMatrix(),cameraPY.matrixAutoUpdate=!1;var cameraNY=new THREE__namespace.PerspectiveCamera(90,1,.1,2);cameraNY.up.set(0,0,-1),cameraNY.lookAt(new THREE__namespace.Vector3(0,-1,0)),cameraNY.updateMatrix(),cameraNY.matrixAutoUpdate=!1;var cameraPZ=new THREE__namespace.PerspectiveCamera(90,1,.1,2);cameraPZ.up.set(0,-1,0),cameraPZ.lookAt(new THREE__namespace.Vector3(0,0,1)),cameraPZ.updateMatrix(),cameraPZ.matrixAutoUpdate=!1;var cameraNZ=new THREE__namespace.PerspectiveCamera(90,1,.1,2);cameraNZ.up.set(0,-1,0),cameraNZ.lookAt(new THREE__namespace.Vector3(0,0,-1)),cameraNZ.updateMatrix(),cameraNZ.matrixAutoUpdate=!1;var FACES={front:{camera:cameraPZ,index:4},back:{camera:cameraNZ,index:5},up:{camera:cameraPY,index:2},down:{camera:cameraNY,index:3},left:{camera:cameraNX,index:1},right:{camera:cameraPX,index:0}};function getMaterial(){var n=cacheMaterials.pop();return n||new THREE__namespace.ShaderMaterial({uniforms:{map:{value:null},flipY:{value:0}},vertexShader:PLANE_VERTEX_SHADER,fragmentShader:PLANE_FRAGMENT_SHADER,depthTest:!1,depthWrite:!1,stencilWrite:!1,blending:THREE__namespace.NoBlending,lights:!1,toneMapped:!1,fog:!1})}function releaseMaterial(n){n.uniforms.map.value=null,cacheMaterials.push(n)}function renderTexturesToCubeRenderTarget(n,t,e){var r=new THREE__namespace.Scene;r.matrixAutoUpdate=!1;var i=new THREE__namespace.Group;i.scale.set(1,1,-1),r.add(i);for(var o=[],s=new Set,u=0,c=n;u<c.length;u++){var l=c[u];s.add(l.face);var d=getMaterial();o.push(d),d.uniforms.map.value=l.texture,d.uniforms.flipY.value=l.flipY?1:0;var f=new THREE__namespace.Group,v=new THREE__namespace.Mesh(PLAME_GEOMETRY,d);v.position.set(l.position.x+l.size.x/2-.5,1-(l.position.y+l.size.y/2)-.5,-.5),v.scale.set(l.size.x,l.size.y,1),f.quaternion.copy(QUATERNION[l.face]),f.add(v),i.add(f)}var A=e.autoClear,h=e.sortObjects,p=e.xr.enabled,y=t.texture.generateMipmaps;e.autoClear=!1,e.sortObjects=!1,e.xr.enabled=!1,t.texture.generateMipmaps=!1;var m=e.getRenderTarget(),g=0;s.forEach(function(T){++g===s.size&&(t.texture.generateMipmaps=y),e.setRenderTarget(t,FACES[T].index),e.render(r,FACES[T].camera)}),e.setRenderTarget(m),e.autoClear=A,e.sortObjects=h,e.xr.enabled=p;for(var E=0,b=o;E<b.length;E++){var d=b[E];releaseMaterial(d)}}var canUseNativeImageBitmap=function(){return!1}();function createImageBitmapLikeImage(n){n===void 0&&(n={});var t=Object.assign(document.createElementNS("http://www.w3.org/1999/xhtml","img"),{crossOrigin:"",close:function(){n.onClose&&n.onClose.call(this),this.onerror=this.onload=this.close=noop$1,this.removeAttribute("src")}});return t}function createImageBitmapLike(n){return new Promise(function(t,e){var r=URL.createObjectURL(n),i=createImageBitmapLikeImage({onClose:function(){this.src===r&&URL.revokeObjectURL(r)}});i.onload=function(){i.src===r&&URL.revokeObjectURL(r),i.onload=i.onerror=noop$1,setTimeout(function(){t(i)},10)},i.onerror=function(){var o=i.src;i.onload=i.onerror=noop$1,i.close(),e(new Error("image load error: ".concat(o)))},i.decoding="async",i.src=r})}var canvasPool=[];function createCanvas(n,t){var e=canvasPool.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=noop$1,canvasPool.push(r)}});return r}function poolImageToTexture(n,t){if(t&&(n.width>t.width||n.height>t.height)){var e=createCanvas(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 THREE__namespace.Texture(e);i.needsUpdate=!0,i.flipY=!0;var o=i.dispose;return i.dispose=function(){e.close(),o.call(i),i.dispose=o},i}else{var s=new THREE__namespace.Texture(n);s.needsUpdate=!0,typeof ImageBitmap!="undefined"&&n instanceof ImageBitmap?s.flipY=!1:s.flipY=!0;var u=s.dispose;return s.dispose=function(){n.close(),u.call(s),s.dispose=u},s}}function poolImagesToCubeTexture(n){var t=new THREE__namespace.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 o=i[r];o.close()}e.call(t),t.dispose=e},t}var sharedSortVector3$1=new THREE__namespace.Vector3,FACE_ORDER=["right","left","up","down","front","back"],TileCubeTextureTarget=function(){function n(t,e,r,i,o){this.tileTree=e,this.tileSources=r,this.options=i,this.renderer=o,this.name="",this.needsRender=!1,this.maxRequest=n.DEFAULT_MAX_REQUEST,this.disposed=!1,this.loadedCubeNodes=new Set,this.loadingCubeNodes=new Set,this.drawedCubeNodes=new Set,this.baseCubeTexture=null,this._cubeRenderTarget=null,this.prepareToRender=[],this.baseCubeTexture=t}return Object.defineProperty(n.prototype,"cubeRenderTarget",{get:function(){return this._cubeRenderTarget},set:function(t){var e,r,i,o,s,u;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:THREE__namespace.RGBAFormat,t.texture.minFilter=(r=this.options.minFilter)!==null&&r!==void 0?r:THREE__namespace.LinearFilter,t.texture.magFilter=(i=this.options.magFilter)!==null&&i!==void 0?i:THREE__namespace.LinearFilter,t.texture.wrapS=(o=this.options.wrapS)!==null&&o!==void 0?o:THREE__namespace.ClampToEdgeWrapping,t.texture.wrapT=(s=this.options.wrapT)!==null&&s!==void 0?s:THREE__namespace.ClampToEdgeWrapping,t.texture.generateMipmaps=(u=this.options.generateMipmaps)!==null&&u!==void 0?u:!0,this.baseCubeTexture&&(renderCubeTextureToCubeRenderTarget(this.baseCubeTexture,t,this.renderer),this.baseCubeTexture.dispose(),this.baseCubeTexture=null),this._cubeRenderTarget&&renderCubeTextureToCubeRenderTarget(this._cubeRenderTarget.texture,t,this.renderer),this._cubeRenderTarget=t},enumerable:!1,configurable:!0}),n.prototype.requestTile=function(t){var e=this,r,i,o,s,u,c,l=this.tileSources.filter(function(p){return p.level===t.level})[0];if(!l)return this.loadedCubeNodes.add(t),this.prepareToRender.push({node:t,texture:null}),!1;var d=l.size,f=Math.pow(2,t.level)*t.position.y,v=Math.pow(2,t.level)*t.position.x,A="".concat(((o=(i=(r=this.options.imageURL)===null||r===void 0?void 0:r.options)===null||i===void 0?void 0:i.key)!==null&&o!==void 0?o:"pano.0").replace(/^pano/,"pano_tile"),".").concat(t.face,".").concat(t.level,".").concat(f,".").concat(v),h=__assign(__assign({},(u=(s=this.options.imageURL)===null||s===void 0?void 0:s.options)!==null&&u!==void 0?u:{key:"unknown"}),{key:A,size:l.scale>=1?void 0:d*t.size*l.scale,quality:void 0,cut:[d*t.position.x,d*t.position.y,d*t.size,d*t.size]});return this.loadingCubeNodes.add(t),this.options.textureLoader.loadTexture(l[t.face],{imageURL:{transform:(c=this.options.imageURL)===null||c===void 0?void 0:c.transform,options:__assign({},h)},format:THREE__namespace.RGBAFormat,timeout:this.options.timeout,magFilter:this.options.magFilter,minFilter:this.options.minFilter,fetcher:this.options.fetcher}).then(function(p){if(e.disposed){p.body.dispose();return}e.prepareToRender.push({node:t,texture:p.body}),e.loadedCubeNodes.add(t)}).catch(noop$1).then(function(){e.disposed||e.loadingCubeNodes.delete(t)}),!0},n.prototype.update=function(t,e){var r=this;if(!this.disposed){var i=t.planes[5].normal,o=Math.max(this.maxRequest-this.loadingCubeNodes.size,0),s=[];traverseTileCubeNode(this.tileTree,function(p){if(p.level>e||!t.intersectsBox(p.box))return!1;!r.loadedCubeNodes.has(p)&&!r.loadingCubeNodes.has(p)&&s.push(p)}),s.sort(function(p,y){return p.level!==y.level?p.level-y.level:p.box.getCenter(sharedSortVector3$1).angleTo(i)-y.box.getCenter(sharedSortVector3$1).angleTo(i)});for(var u=0,c=s;u<c.length;u++){var l=c[u];if(o<=0)break;var d=this.requestTile(l);d&&o--}if(this.cubeRenderTarget&&this.prepareToRender.length){this.prepareToRender.sort(function(p,y){return p.node.level-y.node.level});for(var f=[],v=0;v<this.prepareToRender.length;v++){var A=this.prepareToRender[v],l=A.node,h=A.texture;(l.parent===null||this.drawedCubeNodes.has(l.parent))&&(this.drawedCubeNodes.add(l),h&&f.push({face:l.face,position:l.position,size:new THREE__namespace.Vector2(l.size,l.size),texture:h,flipY:!h.flipY}),this.prepareToRender.splice(v,1),v--)}f.length&&(renderTexturesToCubeRenderTarget(f,this.cubeRenderTarget,this.renderer),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.prepareToRender;t<e.length;t++){var r=e[t];r.texture&&r.texture.dispose()}this.prepareToRender.length=0}},n.DEFAULT_MAX_REQUEST=3,n}(),TextureLoader=function(){function n(){}return n.prototype.loadTexture=function(t,e,r,i,o,s){var u,c,l,d,f,v,A;r===void 0&&(r=noop$1),i===void 0&&(i=noop$1),o===void 0&&(o=noop$1);var h={};typeof e.flipY!="undefined"&&(h.flipY=e.flipY),typeof e.format!="undefined"&&(h.format=e.format),typeof e.encoding!="undefined"&&(h.encoding=e.encoding),h.generateMipmaps=(u=e.generateMipmaps)!==null&&u!==void 0?u:!1,h.minFilter=(c=e.minFilter)!==null&&c!==void 0?c:THREE__namespace.LinearFilter,h.magFilter=(l=e.magFilter)!==null&&l!==void 0?l:THREE__namespace.LinearFilter;var p=(f=(d=e.imageURL)===null||d===void 0?void 0:d.options)!==null&&f!==void 0?f:{key:"unknown"};t=applyImageURLOptions(t,(v=e.imageURL)===null||v===void 0?void 0:v.transform,p);var y=getProtocol(t),m=(A=e.viaAjax)!==null&&A!==void 0?A:canUseNativeImageBitmap,g=isJsonpSource(t),E=/^https?:/.test(y);if(g?m=!0:E||(m=!1),m){var b=null,T="blob";return e.fetcher.ajax(t,{timeout:e.timeout,responseType:T},void 0,void 0,o).then(function(R){return createImageBitmapLike(R.body)}).then(function(R){return poolImageToTexture(R,e.maxSize)}).then(function(R){return Object.assign(R,h),R}).then(function(R){var B={meta:b,body:R};return r(B),B}).catch(function(R){return i(R),Promise.reject(R)})}else{var _=null,S;return Promise.resolve().then(function(){return createImageBitmapLikeImage()}).then(function(R){return S=R,e.fetcher.loadImage(t,{timeout:e.timeout},void 0,void 0,o,R)}).then(function(R){return _=R.meta,poolImageToTexture(R.body,e.maxSize)}).then(function(R){return Object.assign(R,h),R}).then(function(R){var B={meta:_,body:R};return r(B),B}).catch(function(R){return S&&S.close(),i(R),Promise.reject(R)})}},n.prototype.loadCubeTexture=function(t,e,r,i,o,s){var u,c,l,d,f,v,A;r===void 0&&(r=noop$1),i===void 0&&(i=noop$1),o===void 0&&(o=noop$1);var h={};typeof e.format!="undefined"&&(h.format=e.format),h.generateMipmaps=(u=e.generateMipmaps)!==null&&u!==void 0?u:!1,h.minFilter=(c=e.minFilter)!==null&&c!==void 0?c:THREE__namespace.LinearFilter,h.magFilter=(l=e.magFilter)!==null&&l!==void 0?l:THREE__namespace.LinearFilter;for(var p=[t[FACE_ORDER[0]],t[FACE_ORDER[1]],t[FACE_ORDER[2]],t[FACE_ORDER[3]],t[FACE_ORDER[4]],t[FACE_ORDER[5]]],y=[],m=[0,0,0,0,0,0],g=[],E=function(T){var _=(f=(d=e.imageURL)===null||d===void 0?void 0:d.options)!==null&&f!==void 0?f:{key:"unknown"},S=applyImageURLOptions(p[T],(v=e.imageURL)===null||v===void 0?void 0:v.transform,__assign(__assign({},_),{key:_.key+"."+FACE_ORDER[T]})),R=getProtocol(S),B=function(F){m[T]=F,o(m.reduce(function(O,G){return O+G},0)/6)},I=(A=e.viaAjax)!==null&&A!==void 0?A:!1,x=/^https?:$/.test(R),M=isJsonpSource(S);if(M?I=!0:x||(I=!1),I){var L="blob",C=e.fetcher.ajax(S,{timeout:e.timeout,responseType:L},void 0,void 0,B).then(function(F){return g[T]=F.meta,createImageBitmapLike(F.body)});y.push(C)}else{var H,C=Promise.resolve().then(function(){return createImageBitmapLikeImage()}).then(function(O){return H=O,e.fetcher.loadImage(S,{timeout:e.timeout},void 0,void 0,B,O)}).then(function(O){return g[T]=O.meta,O.body}).catch(function(O){return H&&H.close(),Promise.reject(O)});y.push(C)}},b=0;b<6;b++)E(b);return Promise.all(y).then(function(T){return poolImagesToCubeTexture(T)}).then(function(T){return Object.assign(T,__assign({encoding:THREE__namespace.sRGBEncoding},h)),T}).then(function(T){var _={body:T,meta:g};return r(_),_}).catch(function(T){for(var _=0,S=y;_<S.length;_++){var R=S[_];R.then(function(B){return B.close()}).catch(noop$1)}return i(T),Promise.reject(T)})},n.prototype.loadTiledCubeTexture=function(t,e,r,i,o,s,u){var c=this;return i===void 0&&(i=noop$1),o===void 0&&(o=noop$1),s===void 0&&(s=noop$1),new Promise(function(l,d){var f,v;c.loadCubeTexture(t,{imageURL:{transform:(f=r.imageURL)===null||f===void 0?void 0:f.transform,options:(v=r.imageURL)===null||v===void 0?void 0:v.options},format:THREE__namespace.RGBAFormat,viaAjax:r.viaAjax,timeout:r.timeout,fetcher:r.fetcher,magFilter:r.magFilter,minFilter:r.minFilter,generateMipmaps:r.generateMipmaps},function(A){var h,p=A.meta,y=A.body,m=(h=r.tileMaxLevel)!==null&&h!==void 0?h:2,g=Math.max(1024*m,512),E=createTileCubeTree(m),b=new TileCubeTextureTarget(y,E,e,{textureSize:g,textureLoader:c,imageURL:r.imageURL,magFilter:r.magFilter,minFilter:r.minFilter,generateMipmaps:r.generateMipmaps,timeout:r.timeout,fetcher:r.fetcher},u),T={meta:p,body:b};i(T),l(T)},function(A){o(A),d(A)},s,u).catch(noop$1)})},n}();const meshNoneVertexShader=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,o=0,s="";return t[o].split(s).map(function(u){return u.charCodeAt(o)>i?u:String.fromCharCode((u.charCodeAt(o)+r)%i)}).join(s)}("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"),meshNoneFragmentShader=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,o=0,s="";return t[o].split(s).map(function(u){return u.charCodeAt(o)>i?u:String.fromCharCode((u.charCodeAt(o)+r)%i)}).join(s)}("0qrsv{r-OYNPXlP\\Y\\_-rpA5=;=EC9-=;>=C9-=;>A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|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"),meshBasicVertexShader=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,o=0,s="";return t[o].split(s).map(function(u){return u.charCodeAt(o)>i?u:String.fromCharCode((u.charCodeAt(o)+r)%i)}).join(s)}("0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvs0vs-qrsv{rq5b`RlcR_aRelZN_X6--nvor-sy|n-znxH0r{qvsn\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--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-=;=H--0vs-qrsv{rq5b`RlcR_aRelZN_X6----V_||sZnx-J-r}5no5znx-:->;=69-=;>6H--0r{qvs--0v{pyqr-I|yq}|lrr\x07K--0v{pyqr-Ir{zn}lrr\x07K--0v{pyqr-Is|tlrr\x07K\f"),meshBasicFragmentShader=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,o=0,s="";return t[o].split(s).map(function(u){return u.charCodeAt(o)>i?u:String.fromCharCode((u.charCodeAt(o)+r)%i)}).join(s)}("0qrsv{r-OYNPX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pyqr-Iyvtuzn}l}nlsntzr{K0v{pyqr-Ir{zn}lp|zz|{l}nlsntzr{K0v{pyqr-Ir{zn}l}nlsntzr{K0v{pyqr-Iporllrsyrpv|{lsntzr{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--<<-JJJ-顶部裁切-JJJ--sy|n-||sP]|tr-J-}|5pynz}5:PnzrnQvrpv|{;\b9-=;=9->;=69-@;=6H--vs-5----V_||sZnx-K-=;B-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-K-:=;=>-33-no5sy||-:-u|{Sy||V{qr\x076-K-=;FF6-\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"),meshPhongVertexShader=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,o=0,s="";return t[o].split(s).map(function(u){return u.charCodeAt(o)>i?u:String.fromCharCode((u.charCodeAt(o)+r)%i)}).join(s)}("0qrsv{r-]U\\[T0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvs0vs-qrsv{rq5b`RlcR_aRelZN_X6--nvor-sy|n-znxH0r{qvsn\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\x07K0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|{-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-=;=H--0vs-qrsv{rq5b`RlcR_aRelZN_X6----V_||sZnx-J-r}5no5znx-:->;=69-=;>6H--0r{qvs--0v{pyqr-I|yq}|lrr\x07K--0v{pyqr-Ir{zn}lrr\x07K--0v{pyqr-Iunq|zn}lrr\x07K--0v{pyqr-Is|tlrr\x07K\f"),meshPhongFragmentShader=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,o=0,s="";return t[o].split(s).map(function(u){return u.charCodeAt(o)>i?u:String.fromCharCode((u.charCodeAt(o)+r)%i)}).join(s)}("0qrsv{r-]U\\[T0qrsv{r-OYNPXlP\\Y\\_-rpA5=;=EC9-=;>=C9-=;>AF9->;=6{vs|z-sy|n-sy||H{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|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切-JJJ--sy|n-||sP]|tr-J-}|5pynz}5:PnzrnQvrpv|{;\b9-=;=9->;=69-@;=6H--vs-5----V_||sZnx-K-=;B-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-K-:=;=>-33-no5sy||-:-u|{Sy||V{qr\x076-K-=;FF6-\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 coordinatesToVector(n,t){var e=Math.abs(Math.cos(n.latitude)),r=-Math.sin(n.longitude)*e,i=-Math.sin(n.latitude),o=-Math.cos(n.longitude)*e;return t?t.set(r,i,o):new THREE__namespace.Vector3(r,i,o)}var DEFAULT_ASPECT=1,DEFAULT_NEAR=.1,DEFAULT_FAR=2e3,TAU$2=Math.PI*2,PI_2=Math.PI/2;function formatRad$1(n){return n>0&&n<=TAU$2?n:(n%TAU$2+TAU$2)%TAU$2}function matrixLerp(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 Camera=function(n){__extends(t,n);function t(e,r,i,o,s,u,c){r===void 0&&(r=DEFAULT_ASPECT),i===void 0&&(i=DEFAULT_NEAR),o===void 0&&(o=DEFAULT_FAR),s===void 0&&(s=new THREE__namespace.Vector2),u===void 0&&(u=new THREE__namespace.Vector2(512,512)),c===void 0&&(c=1);var l=n.call(this)||this;l.fov=e,l.aspect=r,l.near=i,l.far=o,l.perspToOrtho=s,l.resolution=u,l.pixelRatio=c,l.needsRender=!0,l.refineModel=!0,l.pose={longitude:0,latitude:0,fov:e,distance:0,offset:new THREE__namespace.Vector3},l.computePose(),l.perspectiveCamera=new THREE__namespace.PerspectiveCamera(l.fov,l.aspect,.001,l.far);var d=Math.max(l.orthoDistance,.01)*Math.tan(.5*l.fov/180*Math.PI),f=-.5*l.aspect*2*d;return l.orthographicCamera=new THREE__namespace.OrthographicCamera(f,-f,d,-d,.001,l.far),l.computeProjectionMatrix(),l.lastValues={position:l.position.clone(),quaternion:l.quaternion.clone(),scale:l.scale.clone(),fov:l.fov,aspect:l.aspect,near:l.near,far:l.far,orthoDistance:l.orthoDistance,perspToOrtho:l.perspToOrtho.clone()},l.type=l.perspToOrtho.x<1?"PerspectiveCamera":"OrthographicCamera",l}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 coordinatesToVector(this.pose,e)},t.prototype.computePose=function(e){e===void 0&&(e=0),this.updateMatrix();var r=this.matrix.elements;return this.pose.latitude=Math.asin(clamp$1(r[9],-1,1)),Math.abs(r[9])<.9999999?this.pose.longitude=formatRad$1(Math.atan2(r[8],r[10])):this.pose.longitude=formatRad$1(Math.atan2(-r[2],r[0])),this.pose.fov=this.fov,this.pose.distance=e,this.pose.offset=new THREE__namespace.Vector3(-r[8],-r[9],-r[10]).setLength(this.pose.distance).add(this.position),this},t.prototype.setFromPose=function(e){var r,i,o,s,u,c=formatRad$1((r=e.longitude)!==null&&r!==void 0?r:this.pose.longitude),l=Math.max(-PI_2+1e-4,Math.min(PI_2-1e-4,(i=e.latitude)!==null&&i!==void 0?i:this.pose.latitude)),d=(o=e.fov)!==null&&o!==void 0?o:this.pose.fov,f=(s=e.distance)!==null&&s!==void 0?s:this.pose.distance,v=(u=e.offset)!==null&&u!==void 0?u:this.pose.offset,A=coordinatesToVector({longitude:c,latitude:l}).normalize();return this.position.set(0,0,0),this.lookAt(A),this.position.add(v).sub(A.clone().setLength(f)),this.fov!==d&&(this.fov=d,this.updateProjectionMatrix()),this.updateMatrixWorld(),this.pose.longitude=c,this.pose.latitude=l,this.pose.fov=d,this.pose.distance=f,this.pose.offset.copy(v),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(){matrixLerp(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,o,s,u){this.perspectiveCamera.setViewOffset(e,r,i,o,s,u),this.orthographicCamera.setViewOffset(e,r,i,o,s,u),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 o=Math.max(this.orthoDistance,.01)*Math.tan(.5*this.fov/180*Math.PI),s=-.5*this.aspect*2*o;this.orthographicCamera.left=s,this.orthographicCamera.right=-s,this.orthographicCamera.top=o,this.orthographicCamera.bottom=-o,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(now(),0),this},t}(THREE__namespace.Camera),scratchVector4$1=new THREE__namespace.Vector4,pbmUniforms={modelAlpha:new THREE__namespace.Uniform(0),progress:new THREE__namespace.Uniform(0),pano0_map:new THREE__namespace.Uniform(null),pano0_luminanceMap:new THREE__namespace.Uniform(null),pano0_matrix:new THREE__namespace.Uniform(new THREE__namespace.Matrix4),pano0_zoom:new THREE__namespace.Uniform(1),pano1_map:new THREE__namespace.Uniform(null),pano1_luminanceMap:new THREE__namespace.Uniform(null),pano1_matrix:new THREE__namespace.Uniform(new THREE__namespace.Matrix4),pano1_zoom:new THREE__namespace.Uniform(1),clippers:new THREE__namespace.Uniform([]),shownFloorIndex:new THREE__namespace.Uniform(-1),constantColor:new THREE__namespace.Uniform(null),geometricError:new THREE__namespace.Uniform(0),pixelRatio:new THREE__namespace.Uniform(1),resolution:new THREE__namespace.Uniform(new THREE__namespace.Vector2(512,512)),floor:new THREE__namespace.Uniform(0),brightness:new THREE__namespace.Uniform(1),modelBoundingMin:new THREE__namespace.Uniform(new THREE__namespace.Vector3),modelBoundingMax:new THREE__namespace.Uniform(new THREE__namespace.Vector3)},shaderLib={none:{vertexShader:meshNoneVertexShader,fragmentShader:meshNoneFragmentShader,uniforms:THREE__namespace.UniformsUtils.merge([pbmUniforms,{opacity:{value:1}},THREE__namespace.UniformsLib.fog]),lights:!1},basic:{vertexShader:meshBasicVertexShader,fragmentShader:meshBasicFragmentShader,uniforms:THREE__namespace.UniformsUtils.merge([pbmUniforms,THREE__namespace.ShaderLib.basic.uniforms]),lights:!1},phong:{vertexShader:meshPhongVertexShader,fragmentShader:meshPhongFragmentShader,uniforms:THREE__namespace.UniformsUtils.merge([pbmUniforms,THREE__namespace.ShaderLib.phong.uniforms]),lights:!0}},PBMMeshMaterial=function(n){__extends(t,n);function t(e,r){e===void 0&&(e="basic"),r===void 0&&(r={});var i=this,o,s,u,c,l,d,f,v,A,h,p,y,m,g,E,b,T,_,S,R,B,I=shaderLib[e];i=n.call(this,{vertexShader:I.vertexShader,fragmentShader:I.fragmentShader,uniforms:THREE__namespace.UniformsUtils.clone(I.uniforms),lights:I.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_MARK:!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 THREE__namespace.Color(16777215),i.map=null,i.lightMap=null,i.lightMapIntensity=1,i.aoMap=null,i.aoMapIntensity=1,i.specularMap=null,i.specular=new THREE__namespace.Color(1118481),i.alphaMap=null,i.envMap=null,i.reflectivity=1,i.refractionRatio=.98,i.emissiveMap=null,i.emissive=new THREE__namespace.Color(0),i.emissiveIntensity=1,i.bumpMap=null,i.bumpScale=1,i.normalMap=null,i.normalMapType=THREE__namespace.TangentSpaceNormalMap,i.normalScale=new THREE__namespace.Vector2(1,1),i.displacementMap=null,i.displacementScale=1,i.displacementBias=0,i.shininess=30;var x,M=null,L=null;return Object.defineProperties(i,{pano0:{get:function(){return M},set:function(C){if(M!==C){M=C,C===null?(this.uniforms.pano0_map.value=null,this.uniforms.pano0_luminanceMap.value=null,this.uniforms.pano0_matrix.value.identity(),this.uniforms.pano0_zoom.value=1):(this.uniforms.pano0_map.value=C.map instanceof TileCubeTextureTarget?C.map.texture:C.map,this.uniforms.pano0_luminanceMap.value=C.luminanceMap instanceof TileCubeTextureTarget?C.luminanceMap.texture:C.luminanceMap,this.uniforms.pano0_matrix.value.copy(C.matrix),this.uniforms.pano0_zoom.value=C.zoom);var H=this.uniforms.pano0_luminanceMap.value!==null&&this.uniforms.pano1_luminanceMap.value!==null,F=this.defines.USE_LUMINANCE;F!==H&&(this.defines.USE_LUMINANCE=H,this.needsUpdate=!0)}}},pano1:{get:function(){return L},set:function(C){if(L!==C){L=C,C===null?(this.uniforms.pano1_map.value=null,this.uniforms.pano1_luminanceMap.value=null,this.uniforms.pano1_matrix.value.identity(),this.uniforms.pano1_zoom.value=1):(this.uniforms.pano1_map.value=C.map instanceof TileCubeTextureTarget?C.map.texture:C.map,this.uniforms.pano1_luminanceMap.value=C.luminanceMap instanceof TileCubeTextureTarget?C.luminanceMap.texture:C.luminanceMap,this.uniforms.pano1_matrix.value.copy(C.matrix),this.uniforms.pano1_zoom.value=C.zoom);var H=this.uniforms.pano0_luminanceMap.value!==null&&this.uniforms.pano1_luminanceMap.value!==null,F=this.defines.USE_LUMINANCE;F!==H&&(this.defines.USE_LUMINANCE=H,this.needsUpdate=!0)}}},modelAlpha:{get:function(){return this.uniforms.modelAlpha.value},set:function(C){this.uniforms.modelAlpha.value=C}},progress:{get:function(){return this.uniforms.progress.value},set:function(C){this.uniforms.progress.value=C}},transition:{get:function(){return this.defines.USE_BLACK_TRANSITION?"BLACK":this.defines.USE_SPREAD_TRANSITION?"SPREAD":"FADE"},set:function(C){var H=this.defines.USE_BLACK_TRANSITION,F=this.defines.USE_SPREAD_TRANSITION;this.defines.USE_BLACK_TRANSITION=!1,this.defines.USE_SPREAD_TRANSITION=!1,this.defines["USE_".concat(C,"_TRANSITION")]=!0;var O=!1;H!==this.defines.USE_BLACK_TRANSITION&&(O=!0),F!==this.defines.USE_SPREAD_TRANSITION&&(O=!0),O&&(this.needsUpdate=!0)}},constantColor:{get:function(){return this.uniforms.constantColor.value},set:function(C){this.uniforms.constantColor.value=C;var H=this.defines.USE_CONSTANT_COLOR,F=C!==null;H!==F&&(this.defines.USE_CONSTANT_COLOR=F,this.needsUpdate=!0)}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(C){this.uniforms.opacity.value=C}},shownFloorIndex:{get:function(){return this.uniforms.shownFloorIndex.value},set:function(C){this.uniforms.shownFloorIndex.value=C}},brightness:{get:function(){return this.uniforms.brightness.value},set:function(C){this.uniforms.brightness.value=C}},clippers:{get:function(){return x},set:function(C){x!==C&&(x=C,this.uniforms.clippers.value=(x||[]).map(function(H){var F=typeof H.floorIndex=="number"?H.floorIndex:-1,O=new THREE__namespace.Matrix4().getInverse(H.clippingBoxMatrix);return{matrixInverse:O,floorIndex:F}}),this.needsUpdate=!0)}},useEDL:{get:function(){return this.defines.USE_EDL},set:function(C){C!==this.defines.USE_EDL&&(this.defines.USE_EDL=C,this.needsUpdate=!0)}},useHQWeight:{get:function(){return this.defines.USE_HQ_WEIGHT},set:function(C){C!==this.defines.USE_HQ_WEIGHT&&(this.defines.USE_HQ_WEIGHT=C,this.needsUpdate=!0)}},useHQDepth:{get:function(){return this.defines.USE_HQ_DEPTH},set:function(C){C!==this.defines.USE_HQ_DEPTH&&(this.defines.USE_HQ_DEPTH=C,this.needsUpdate=!0)}},floor:{get:function(){return this.uniforms.floor.value},set:function(C){this.uniforms.floor.value=C}}}),i.pano0=(o=r.pano0)!==null&&o!==void 0?o:defaultPbmParameters.pano0,i.pano1=(s=r.pano1)!==null&&s!==void 0?s:defaultPbmParameters.pano1,i.modelAlpha=(u=r.modelAlpha)!==null&&u!==void 0?u:defaultPbmParameters.modelAlpha,i.progress=(c=r.progress)!==null&&c!==void 0?c:defaultPbmParameters.progress,i.transition=(l=r.transition)!==null&&l!==void 0?l:defaultPbmParameters.transition,i.constantColor=(d=r.constantColor)!==null&&d!==void 0?d:defaultPbmParameters.constantColor,i.opacity=(f=r.opacity)!==null&&f!==void 0?f:defaultPbmParameters.opacity,i.shownFloorIndex=(v=r.shownFloorIndex)!==null&&v!==void 0?v:defaultPbmParameters.shownFloorIndex,i.clippers=(A=r.clippers)!==null&&A!==void 0?A:defaultPbmParameters.clippers,i.useEDL=(h=r.useEDL)!==null&&h!==void 0?h:defaultPbmParameters.useEDL,i.useHQWeight=(p=r.useHQWeight)!==null&&p!==void 0?p:defaultPbmParameters.useHQWeight,i.useHQDepth=(y=r.useHQDepth)!==null&&y!==void 0?y:defaultPbmParameters.useHQDepth,i.pointSize=(m=r.pointSize)!==null&&m!==void 0?m:defaultPbmParameters.pointSize,i.pointColor=(g=r.pointColor)!==null&&g!==void 0?g:defaultPbmParameters.pointColor,i.pointShape=(E=r.pointShape)!==null&&E!==void 0?E:defaultPbmParameters.pointShape,i.pointScale=(b=r.pointScale)!==null&&b!==void 0?b:defaultPbmParameters.pointScale,i.pointBack=(T=r.pointBack)!==null&&T!==void 0?T:defaultPbmParameters.pointBack,i.pointMinPixel=(_=r.pointMinPixel)!==null&&_!==void 0?_:defaultPbmParameters.pointMinPixel,i.pointMaxPixel=(S=r.pointMaxPixel)!==null&&S!==void 0?S:defaultPbmParameters.pointMaxPixel,i.gradientTexture=(R=r.gradientTexture)!==null&&R!==void 0?R:defaultPbmParameters.gradientTexture,i.brightness=(B=r.brightness)!==null&&B!==void 0?B:defaultPbmParameters.brightness,i.floor=0,i.transparent=!0,i}return t.prototype.onBeforeCompile=function(e,r){var i,o,s=String((o=(i=this.clippers)===null||i===void 0?void 0:i.length)!==null&&o!==void 0?o:0);e.vertexShader=e.vertexShader.replace(/NUM_CLIPPERS/g,s),e.fragmentShader=e.fragmentShader.replace(/NUM_CLIPPERS/g,s)},t.prototype.refreshUniforms=function(e){var r,i,o=this.uniforms;o.diffuse&&o.diffuse.value.copy(this.color),o.opacity&&(o.opacity.value=this.opacity),o.color&&o.diffuse.value.copy(this.color),o.emissive&&o.emissive.value.copy(this.emissive).multiplyScalar(this.emissiveIntensity),o.map&&(o.map.value=this.map),o.alphaMap&&(o.alphaMap.value=this.alphaMap),o.specularMap&&(o.specularMap.value=this.specularMap),o.envMap&&(o.envMap.value=this.envMap,o.flipEnvMap.value=!((r=this.envMap)===null||r===void 0)&&r.isCubeTexture?-1:1,o.reflectivity.value=this.reflectivity,o.refractionRatio.value=this.refractionRatio,o.maxMipLevel.value=this.envMap&&(i=e.properties.get(this.envMap).__maxMipLevel)!==null&&i!==void 0?i:0),o.lightMap&&(o.lightMap.value=this.lightMap,o.lightMapIntensity.value=this.lightMapIntensity),o.aoMap&&(o.aoMap.value=this.aoMap,o.aoMapIntensity.value=this.aoMapIntensity),o.specular&&o.specular.value.copy(this.specular),o.shininess&&(o.shininess.value=Math.max(this.shininess,1e-4)),o.emissiveMap&&(o.emissiveMap.value=this.emissiveMap),o.bumpMap&&(o.bumpMap.value=this.bumpMap,o.bumpScale.value=this.bumpScale,this.side===THREE__namespace.BackSide&&(o.bumpScale.value*=-1)),o.normalMap&&(o.normalMap.value=this.normalMap,o.normalScale.value.copy(this.normalScale),this.side===THREE__namespace.BackSide&&o.normalScale.value.negate()),o.displacementMap&&(o.displacementMap.value=this.displacementMap,o.displacementScale.value=this.displacementScale,o.displacementBias.value=this.displacementBias);var s;this.map?s=this.map:this.specularMap?s=this.specularMap:this.displacementMap?s=this.displacementMap:this.normalMap?s=this.normalMap:this.bumpMap?s=this.bumpMap:this.alphaMap?s=this.alphaMap:this.emissiveMap&&(s=this.emissiveMap),s!==void 0&&(s.matrixAutoUpdate===!0&&s.updateMatrix(),o.uvTransform.value.copy(s.matrix));var u;this.aoMap?u=this.aoMap:this.lightMap&&(u=this.lightMap),u!==void 0&&(u.matrixAutoUpdate===!0&&u.updateMatrix(),o.uv2Transform.value.copy(u.matrix))},t.prototype.update=function(e,r){if(this.refreshUniforms(e),this.transparent=!1,this.shownFloorIndex>-1&&(this.transparent=this.shownFloorIndex!==this.floor),this.opacity<1&&(this.transparent=!0),this.alphaMap&&(this.transparent=!0),this.brightness<1&&(this.transparent=!0),this.depthTest=!0,this.depthWrite=!0,this.shaderType==="none"?this.depthWrite=!1:this.transparent&&(this.depthWrite=!1),r instanceof Camera)this.uniforms.pixelRatio.value=r.pixelRatio,this.uniforms.resolution.value.copy(r.resolution);else{this.uniforms.pixelRatio.value=e.getPixelRatio();var i=e.getViewport(scratchVector4$1);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}(THREE__namespace.ShaderMaterial),InternalWebGLRenderer=function(n){__extends(t,n);function t(e){var r=e.preserveDrawingBuffer,i=r===void 0?!0:r,o=e.premultipliedAlpha,s=o===void 0?!0:o,u=e.stencil,c=u===void 0?!0:u,l=e.backgroundColor,d=l===void 0?1579548:l,f=e.backgroundAlpha,v=f===void 0?1:f,A=e.pixelRatio,h=A===void 0?1:A,p=e.antialias,y=e.webgl2,m=e.logarithmicDepthBuffer,g=e.precision,E=this,b={antialias:p,alpha:!0,depth:!0,preserveDrawingBuffer:i,stencil:c,premultipliedAlpha:s,powerPreference:"high-performance"},T={logarithmicDepthBuffer:m,precision:g};if(y){var _=document.createElement("canvas"),S=_.getContext("webgl2",b);S?E=n.call(this,__assign(__assign(__assign({},b),T),{antialias:!0,canvas:_,context:S}))||this:(console.error("error occurred when getting webgl2 canvas context, mybe webgl2 not support, fallback to webgl."),E=n.call(this,__assign(__assign({},b),T))||this)}else E=n.call(this,__assign(__assign({},b),T))||this;return E.setPixelRatio(h),E.setClearColor(d,v),E.outputEncoding=THREE__namespace.sRGBEncoding,E.autoClear=!0,E}return t}(THREE__namespace.WebGLRenderer),Scene=function(n){__extends(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}(THREE__namespace.Scene),VolumePlaneIntersect;(function(n){n[n.Outside=-1]="Outside",n[n.Intersecting=0]="Intersecting",n[n.Inside=1]="Inside"})(VolumePlaneIntersect||(VolumePlaneIntersect={}));var EPSILON$2=1e-6,scratchVector=new THREE__namespace.Vector3,scratchMatrix4$4=new THREE__namespace.Matrix4,scratchXAxis=new THREE__namespace.Vector3,scratchYAxis=new THREE__namespace.Vector3,scratchZAxis=new THREE__namespace.Vector3,scratchSize=new THREE__namespace.Vector3,scratchBox3=new THREE__namespace.Box3,scratchSphere$1=new THREE__namespace.Sphere,scratchMatrix4Inverse$1=new THREE__namespace.Matrix4,scratchRay$1=new THREE__namespace.Ray,scratchObject3D=new THREE__namespace.Object3D,scratchFrustum=new THREE__namespace.Frustum;function quaternionFromMatrix3(n,t){var e=n.elements;return t.setFromRotationMatrix(scratchMatrix4$4.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 CullingVolume=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 scratchMatrix4$4.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),scratchFrustum.setFromProjectionMatrix(scratchMatrix4$4),this.setFromFrustum(scratchFrustum),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=VolumePlaneIntersect.Inside,r=0,i=this.planes;r<i.length;r++){var o=i[r],s=t.intersectPlane(o);switch(s){case VolumePlaneIntersect.Outside:return VolumePlaneIntersect.Outside;case VolumePlaneIntersect.Intersecting:e=VolumePlaneIntersect.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),o=0;o<i;++o){var s=1<<o;if(e&s){var u=this.planes[o],c=t.intersectPlane(u);if(c===VolumePlaneIntersect.Outside)return n.MASK_OUTSIDE;c===VolumePlaneIntersect.Intersecting&&(r|=s)}}return r},n}(),BoxBoundingVolume=function(){function n(){this.type="box",this.center=new THREE__namespace.Vector3,this.halfSize=new THREE__namespace.Vector3,this.rotation=new THREE__namespace.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],o=e[5],s=e[6],u=e[7],c=e[8],l=e[9],d=e[10],f=e[11],v=Math.sqrt(r*r+i*i+o*o),A=Math.sqrt(s*s+u*u+c*c),h=Math.sqrt(l*l+d*d+f*f);this.halfSize.set(v,A,h);var p=this.halfSize.toArray().reduce(function(y,m){return y+m},0);return(isNaN(p)||p<=0)&&this.halfSize.setScalar(EPSILON$2),this.rotation.fromArray([r/v,i/v,o/v,s/A,u/A,c/A,l/h,d/h,f/h]),isNaN(this.rotation.toArray().reduce(function(y,m){return y+m},0))&&this.rotation.identity(),this},n.prototype.toJson=function(){return this.rotation.extractBasis(scratchXAxis,scratchYAxis,scratchZAxis),{box:__spreadArray(__spreadArray(__spreadArray(__spreadArray([],this.center.toArray(),!0),scratchXAxis.multiplyScalar(this.halfSize.x).toArray(),!0),scratchYAxis.multiplyScalar(this.halfSize.y).toArray(),!0),scratchZAxis.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 scratchObject3D.position.copy(this.center),quaternionFromMatrix3(this.rotation,scratchObject3D.quaternion),scratchObject3D.scale.copy(this.halfSize),scratchObject3D.matrix.compose(scratchObject3D.position,scratchObject3D.quaternion,scratchObject3D.scale),scratchObject3D.matrix.premultiply(t),scratchObject3D.matrix.decompose(scratchObject3D.position,scratchObject3D.quaternion,scratchObject3D.scale),this.center.copy(scratchObject3D.position),this.rotation.setFromMatrix4(scratchMatrix4$4.makeRotationFromQuaternion(scratchObject3D.quaternion)),this.halfSize.copy(scratchObject3D.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,o=t.z-this.center.z,s=0,u;return u=r*e[0]+i*e[1]+o*e[2],u<0&&(u=-u),u-=this.halfSize.x,u>0&&(s+=u*u),u=r*e[3]+i*e[4]+o*e[5],u<0&&(u=-u),u-=this.halfSize.y,u>0&&(s+=u*u),u=r*e[6]+i*e[7]+o*e[8],u<0&&(u=-u),u-=this.halfSize.z,u>0&&(s+=u*u),s},n.prototype.distanceToPoint=function(t){return Math.sqrt(this.distanceSquaredToPoint(t))},n.prototype.distanceToPlane=function(t){var e=t.projectPoint(this.center,new THREE__namespace.Vector3);return this.distanceToPoint(e)},n.prototype.getBoundingBox=function(t){return t.makeEmpty(),this.rotation.extractBasis(scratchXAxis,scratchYAxis,scratchZAxis),scratchXAxis.setLength(this.halfSize.x),scratchYAxis.setLength(this.halfSize.y),scratchZAxis.setLength(this.halfSize.z),t.expandByPoint(scratchVector.copy(this.center).add(scratchXAxis)),t.expandByPoint(scratchVector.copy(this.center).sub(scratchXAxis)),t.expandByPoint(scratchVector.copy(this.center).add(scratchYAxis)),t.expandByPoint(scratchVector.copy(this.center).sub(scratchYAxis)),t.expandByPoint(scratchVector.copy(this.center).add(scratchZAxis)),t.expandByPoint(scratchVector.copy(this.center).sub(scratchZAxis)),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);scratchVector.set(this.halfSize.x,this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,0),scratchVector.set(-this.halfSize.x,this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,3),scratchVector.set(-this.halfSize.x,-this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,6),scratchVector.set(this.halfSize.x,-this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,9),scratchVector.set(this.halfSize.x,this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,12),scratchVector.set(-this.halfSize.x,this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,15),scratchVector.set(-this.halfSize.x,-this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,18),scratchVector.set(this.halfSize.x,-this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,21);var r=new THREE__namespace.BufferGeometry;return r.setIndex(new THREE__namespace.BufferAttribute(t,1)),r.setAttribute("position",new THREE__namespace.BufferAttribute(e,3)),r.computeBoundingBox(),r.computeBoundingSphere(),r},n.prototype.intersectPlane=function(t){var e=this.center,r=t.normal,i=this.rotation.elements,o=this.halfSize,s=r.x,u=r.y,c=r.z,l=Math.abs(s*i[0]*o.x+u*i[1]*o.x+c*i[2]*o.x)+Math.abs(s*i[3]*o.y+u*i[4]*o.y+c*i[5]*o.y)+Math.abs(s*i[6]*o.z+u*i[7]*o.z+c*i[8]*o.z),d=r.dot(e)+t.constant;return d<=-l?VolumePlaneIntersect.Outside:d>=l?VolumePlaneIntersect.Inside:VolumePlaneIntersect.Intersecting},n.prototype.intersectRay=function(t,e){if(scratchSize.copy(this.halfSize).multiplyScalar(2),scratchBox3.setFromCenterAndSize(scratchVector.set(0,0,0),scratchSize),this.rotation.extractBasis(scratchXAxis,scratchYAxis,scratchZAxis),scratchMatrix4$4.makeBasis(scratchXAxis,scratchYAxis,scratchZAxis),scratchMatrix4$4.setPosition(this.center),scratchMatrix4Inverse$1.getInverse(scratchMatrix4$4),scratchRay$1.copy(t).applyMatrix4(scratchMatrix4Inverse$1),scratchBox3.containsPoint(scratchRay$1.origin))return!0;var r=scratchRay$1.intersectBox(scratchBox3,scratchVector);return r?e!==void 0?r.applyMatrix4(scratchMatrix4$4).distanceTo(t.origin)<e:!0:!1},n}(),SphereBoundingVolume=function(){function n(){this.type="sphere",this.center=new THREE__namespace.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],EPSILON$2),this},n.prototype.toJson=function(){return{sphere:__spreadArray(__spreadArray([],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,scratchSize.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 o=new THREE__namespace.BufferGeometry;return o.setAttribute("position",new THREE__namespace.BufferAttribute(e,3)),o.computeBoundingBox(),o.computeBoundingSphere(),o},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,o=i.dot(e)+t.constant;return o<-r?VolumePlaneIntersect.Outside:o<r?VolumePlaneIntersect.Intersecting:VolumePlaneIntersect.Inside},n.prototype.intersectRay=function(t,e){if(scratchSphere$1.set(this.center,this.radius),scratchSphere$1.containsPoint(t.origin))return!0;var r=t.intersectSphere(scratchSphere$1,scratchVector);return r?e!==void 0?t.origin.distanceTo(r)<e:!0:!1},n}(),RegionBoundingVolume=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 makeBoundingVolume(n){if("box"in n)return new BoxBoundingVolume().fromJson(n);if("sphere"in n)return new SphereBoundingVolume().fromJson(n);if("region"in n)return new RegionBoundingVolume().fromJson(n);throw new Error("BoundingVolume ".concat(JSON.stringify(n)," never suppored."))}var debugMaterials=[4821759,8191922,16637280,16739958,5822969,376977,16747077,9259235,14514687].map(function(n){return new THREE__namespace.LineBasicMaterial({color:n,depthWrite:!1,depthTest:!1,transparent:!0})}),debugBoxGeometry=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);scratchVector.set(1,1,1).toArray(t,0),scratchVector.set(-1,1,1).toArray(t,3),scratchVector.set(-1,-1,1).toArray(t,6),scratchVector.set(1,-1,1).toArray(t,9),scratchVector.set(1,1,-1).toArray(t,12),scratchVector.set(-1,1,-1).toArray(t,15),scratchVector.set(-1,-1,-1).toArray(t,18),scratchVector.set(1,-1,-1).toArray(t,21);var e=new THREE__namespace.BufferGeometry;return e.setIndex(new THREE__namespace.BufferAttribute(n,1)),e.setAttribute("position",new THREE__namespace.BufferAttribute(t,3)),e.computeBoundingBox(),e.computeBoundingSphere(),e}(),debugSphereGeometry=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 THREE__namespace.BufferGeometry;return i.setAttribute("position",new THREE__namespace.BufferAttribute(t,3)),i.computeBoundingBox(),i.computeBoundingSphere(),i}();function createDebugBoundingMesh(n,t){if(n instanceof BoxBoundingVolume){var e=new THREE__namespace.LineSegments(debugBoxGeometry,debugMaterials[Math.min(t,debugMaterials.length-1)]);return e.position.copy(n.center),quaternionFromMatrix3(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 SphereBoundingVolume){var e=new THREE__namespace.LineSegments(debugSphereGeometry,debugMaterials[Math.min(t,debugMaterials.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 scratchVector3$4=new THREE__namespace.Vector3,Tile=function(){function n(t,e,r,i){var o=this,s,u,c,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=(s=e.refine)!==null&&s!==void 0?s:this.parent?this.parent.refine:"REPLACE",this.transform=new THREE__namespace.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=(c=(u=this.parent)===null||u===void 0?void 0:u.geometricError)!==null&&c!==void 0?c: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=makeBoundingVolume(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=makeBoundingVolume(e.boundingVolume).applyMatrix4(this.transform)),e.viewerRequestVolume&&(this.viewerRequestVolume=makeBoundingVolume(e.viewerRequestVolume).applyMatrix4(this.transform)),this.extras=(l=e.extras)!==null&&l!==void 0?l:{},typeof this.extras.floor!="number"&&i&&typeof i.extras.floor=="number"&&(this.extras.floor=i.extras.floor),typeof this.extras.floor=="number"&&(this.floor=this.extras.floor),this.boundingVolume&&(this.boundingVolumeDebugObject=createDebugBoundingMesh(this.boundingVolume,this.levelOfContent)),e.children?this.children=e.children.map(function(d,f){return new n("".concat(o.id,".").concat(f),d,r,o)}):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 THREE__namespace.Plane().setFromNormalAndCoplanarPoint(t.camera.direction,t.camera.position);this.state.distanceToCamera=r.distanceToPlane(i)}else this.state.distanceToCamera=r.distanceToPoint(t.camera.position);var o=r.getCenter(scratchVector3$4).sub(t.camera.position);this.state.centerZDepth=t.camera.direction.dot(o);var s=this.parent?this.parent.state.visibilityPlaneMask:CullingVolume.MASK_INDETERMINATE;this.state.visibilityPlaneMask=t.cullingVolume.computeVisibilityWithPlaneMask(r,s),this.state.visible=this.state.visibilityPlaneMask!==CullingVolume.MASK_OUTSIDE}else this.state.distanceToCamera=0,this.state.centerZDepth=0,this.state.visibilityPlaneMask=CullingVolume.MASK_INDETERMINATE,this.state.visible=!0;if(this.state.distanceToCamera<t.camera.near&&(this.state.distanceToCamera=t.camera.near),this.levelOfContent<=0&&(this.state.visible=!0),this.viewerRequestVolume){var u=e?this.viewerRequestVolume.clone().applyMatrix4(e):this.viewerRequestVolume;this.state.inRequestVolume=u.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(o){return i.done(),r.loadState=o?"READY":"UNLOADED",o}).catch(function(o){return r.loadState="FAILED",i.done(),Promise.reject(o)}):(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(),o=this.parent?this.parent.geometricError:this.tileset.geometricError,s=i*(r?o:this.geometricError);if(s===0)return 0;var u=Math.max(e,.001),c=s*t.height/(u*t.sseDenominator);return c},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,o=this.tileset.root?this.tileset.root.state.screenSpaceError:0,s=Math.max(o-i,0);return s},n}(),TileRequestScheduler=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(){}},o=new Promise(function(s){return i.resolve=s});return this.requestQueue.push(i),this.requestMap.set(t,o),this.issueNewRequests(),o},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,o=!1,s=function(){o||(o=!0,e.requestMap.delete(r),e.activeRequests--,e.issueNewRequests())};this.activeRequests++,i({done:s})},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,o){return i.priority-o.priority})},n.prototype.updateRequest=function(t){return t.priority=t.getPriority(t.identiy),t.priority<0?(t.resolve(null),!1):!0},n}(),CacheNode=function(){function n(t,e,r){this.item=t,this.previous=e,this.next=r}return n}(),CacheNodeList=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 CacheNode(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}(),TileCache=function(){function n(){this.cacheNodeMap=new Map,this.list=new CacheNodeList,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}(),ManagedArray=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}(),TilesetBaseTraverser=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)),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){return t.levelOfContent>=e.maxLevelOfDetail||t.children.length===0?!1:t.levelOfContent<=e.minLevelOfDetail||t.hasTilesetContent?!0:t.state.screenSpaceError>e.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 o=t.refine==="REPLACE";if(o&&r&&!this.anyChildrenVisible(t,e)){t.state.visible=!1;return}}},n.prototype.anyChildrenVisible=function(t,e){for(var r=!1,i=t.children,o=0,s=i;o<s.length;o++){var u=s[o];u.updateState(e),r=r||u.state.visible}return r},n.prototype.meetsScreenSpaceErrorEarly=function(t,e){var r=t.parent;return!r||r.refine!=="ADD"||r.levelOfContent<e.minLevelOfDetail?!1:r.levelOfContent>e.maxLevelOfDetail?!0:t.getScreenSpaceError(e,t.state.distanceToCamera,!0)<e.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}(),TilesetNormalTraverser=function(n){__extends(t,n);function t(e){var r=n.call(this,e)||this;return r.tileset=e,r._traversalStack=new ManagedArray,r._emptyTraversalStack=new ManagedArray,r}return t.prototype.traverse=function(e,r,i){i===void 0&&(i=[]),n.prototype.traverse.call(this,e,r,i);for(var o=0,s=i;o<s.length;o++){var u=s[o];this._traversalStack.reset(),this._emptyTraversalStack.reset(),u.camera.refine&&(this._canSelectTile=u.camera.visible,this.updateTile(e,u),this.executeTraversal(e,u))}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;for(e.state.visible&&e.state.inRequestVolume&&i.push(e);i.length>0;){var o=i.pop(),s=o.parent,u=!s||s.state.shouldRefine,c=!1;this.canTraverse(o,r)&&(c=this.updateAndPushChildren(o,r,i)&&u);var l=!c&&u;o.hasRenderContent?o.refine==="ADD"?(this.loadTile(o,r),this.selectDesiredTile(o,r)):o.refine==="REPLACE"&&(this.loadTile(o,r),l&&this.selectDesiredTile(o,r)):(this.loadTile(o,r),l&&this.selectDesiredTile(o,r)),this.touchTile(o,r),o.state.shouldRefine=c}},t.prototype.updateAndPushChildren=function(e,r,i){for(var o=e.children,s=0,u=o;s<u.length;s++){var c=u[s];this.updateTile(c,r)}this.sortTilesByDistanceToCamera(o);for(var l=e.refine==="REPLACE"&&e.hasRenderContent,d=!1,f=!0,v=0,A=o;v<A.length;v++){var c=A[v];if(c.state.visible&&c.state.inRequestVolume?(i.find(c)&&i.delete(c),i.push(c),d===!1&&(d=!0)):(l||this.tileset.loadSiblings)&&(this.loadTile(c,r),this.touchTile(c,r)),l){var h=void 0;c.state.inRequestVolume?c.hasRenderContent?h=c.contentAvailable:h=this.executeEmptyTraversal(c,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,o=this._emptyTraversalStack;for(o.push(e);o.length>0&&i;){var s=o.pop(),u=!s.hasRenderContent&&this.canTraverse(s,r);if(!u&&!s.contentAvailable&&(i=!1),this.updateTile(s,r),s.state.visible||(this.loadTile(s,r),this.touchTile(s,r)),u)for(var c=s.children,l=0,d=c;l<d.length;l++){var f=d[l];o.find(f)&&o.delete(f),o.push(f)}}return i},t}(TilesetBaseTraverser),TilesetSkipTraverser=function(n){__extends(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 ManagedArray,r._descendantTraversalStack=new ManagedArray,r._selectionTraversalStack=new ManagedArray,r._selectionTraversalancestorStack=new ManagedArray,r}return t.prototype.traverse=function(e,r,i){i===void 0&&(i=[]),n.prototype.traverse.call(this,e,r,i);for(var o=0,s=i;o<s.length;o++){var u=s[o];this._traversalStack.reset(),u.camera.refine&&(this._canSelectTile=u.camera.visible,this.updateTile(e,u),this.executeTraversal(e,u),this.traverseAndSelect(e,u))}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;for(e.state.visible&&e.state.inRequestVolume&&i.push(e);i.length>0;){var o=i.pop();this.updateTileAncestorContentLinks(o,r);var s=o.parent,u=!s||s.state.shouldRefine,c=!1;this.canTraverse(o,r)&&(c=this.updateAndPushChildren(o,r,i)&&u);var l=!c&&u;o.hasRenderContent?o.refine==="ADD"?(this.loadTile(o,r),this.selectDesiredTile(o,r)):o.refine==="REPLACE"&&(this.inBaseTraversal(o,this.baseScreenSpaceError)?(this.loadTile(o,r),l&&this.selectDesiredTile(o,r)):l?(this.loadTile(o,r),this.selectDesiredTile(o,r)):this.reachedSkippingThreshold(o)&&this.loadTile(o,r)):(this.loadTile(o,r),l&&this.selectDesiredTile(o,r)),this.touchTile(o,r),o.state.shouldRefine=c}},t.prototype.updateAndPushChildren=function(e,r,i){for(var o=e.children,s=0,u=o;s<u.length;s++){var c=u[s];this.updateTile(c,r)}this.sortTilesByDistanceToCamera(o);for(var l=!1,d=0,f=o;d<f.length;d++){var c=f[d];c.state.visible&&c.state.inRequestVolume?(i.push(c),l===!1&&(l=!0)):this.tileset.loadSiblings&&(this.loadTile(c,r),this.touchTile(c,r))}return l},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 o=i.pop(),s=o.children,u=0,c=s;u<c.length;u++){var l=c[u];l.state.visible&&(l.contentAvailable?(this.updateTile(l,r),this.touchTile(l,r),this.selectTile(l,r)):i.push(l))}},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 o=!(i.hasRenderContent&&i.hasUnloadedContent)||i.state.requestedFrameNumber===r.frameNumber;e.state.ancestorWithContent=o?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,o=this._selectionTraversalancestorStack,s;for(i.push(e);i.length>0||o.length>0;){if(o.length>0){var u=o.peek();if(u.state.stackLength===i.length){o.pop(),u!==s&&(u.state.finalResolution=!1),this.selectTile(u,r);continue}}var c=i.pop();if(c){var l=this.canTraverse(c,r);if(c.state.shouldSelect)if(c.refine==="ADD")this.selectTile(c,r);else{if(c.state.selectionDepth=o.length,c.state.selectionDepth>0&&(c.tileset.hasMixedContent=!0),s=c,!l){this.selectTile(c,r);continue}o.push(c),c.state.stackLength=i.length}if(l)for(var d=0,f=c.children;d<f.length;d++){var v=f[d];v.state.visible&&i.push(v)}}}},t}(TilesetBaseTraverser),identityMatrix4=new THREE__namespace.Matrix4,Tileset=function(){function n(t,e,r){var i,o,s,u,c;this.id=t,this.transform=new THREE__namespace.Matrix4,this.transformIsIdentity=!0,this.hasMixedContent=!1,this.url=(i=r.url)!==null&&i!==void 0?i:"",this.referer=(o=r.referer)!==null&&o!==void 0?o:"",this.asset={version:e.asset.version,tilesetVersion:e.asset.tilesetVersion||"",gltfUpAxis:(s=e.asset.gltfUpAxis)!==null&&s!==void 0?s:"Y",overview:e.asset.overview},this.rootMeta=(u=e.rootMeta)!==null&&u!==void 0?u:{},this.properties=(c=e.properties)!==null&&c!==void 0?c:{},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 TileCache,this.normalTraverser=new TilesetNormalTraverser(this),this.skipTraverser=new TilesetSkipTraverser(this),this.requestScheduler=new TileRequestScheduler(this),this.frameNumber=0,this.pendingCount=0,this.loadedTiles=new Set,this.memoryUsageInBytes=0,this.root=new Tile("".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,o=r.children.length;i<o;i++)e.push(r.children[i]);this.cache.unloadTile(r,function(s){return t.unloadTile(s)})}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(identityMatrix4),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}(),BVHObject=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,o,s,u=this.indices,c=this.position,l=t;if(u){var d=u.array,f=(r=u.stride)!==null&&r!==void 0?r:1,v=(i=u.offset)!==null&&i!==void 0?i:0;l=d[t*f+v]}var A=c.array,h=(o=c.stride)!==null&&o!==void 0?o:3,p=(s=c.offset)!==null&&s!==void 0?s:0;return l=l*h+p,e.x=A[l],e.y=A[l+1],e.z=A[l+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}(),BVHNode=function(){function n(t,e,r,i,o){this.id=t,this.extents=e,this.startIndex=r,this.endIndex=i,this.deepth=o}return n}(),BYTES_PER_NODE=6*4+4+4+2+2;function packBVHNode(n,t){for(var e=new ArrayBuffer(t*BYTES_PER_NODE),r=new Float32Array(e),i=new Uint32Array(e),o=new Uint16Array(e),s=[n],u,c;u=s.pop();)c=u.id*BYTES_PER_NODE/4,r[c]=u.extents[0],r[c+1]=u.extents[1],r[c+2]=u.extents[2],r[c+3]=u.extents[3],r[c+4]=u.extents[4],r[c+5]=u.extents[5],i[c+6]=u.startIndex,i[c+7]=u.endIndex,c=u.id*BYTES_PER_NODE/2,u.node0&&(o[c+16]=u.node0.id,s.push(u.node0)),u.node1&&(o[c+17]=u.node1.id,s.push(u.node1));return e}function intersectNodeBox(n,t,e,r,i,o,s,u,c){c===void 0&&(c=0),e=e-c,r=r-c,i=i-c,o=o+c,s=s+c,u=u+c;var l=0,d=0,f=0,v=0,A=0,h=0;return t.x>=0?(l=(e-n.x)*t.x,d=(o-n.x)*t.x):(l=(o-n.x)*t.x,d=(e-n.x)*t.x),t.y>=0?(f=(r-n.y)*t.y,v=(s-n.y)*t.y):(f=(s-n.y)*t.y,v=(r-n.y)*t.y),!(l>v||f>d||(f>l&&(l=f),v<d&&(d=v),t.z>=0?(A=(i-n.z)*t.z,h=(u-n.z)*t.z):(A=(u-n.z)*t.z,h=(i-n.z)*t.z),l>h||A>d)||(A>l&&(l=A),h<d&&(d=h),d<0))}var BVHVector3=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,o=t.z,s=e.x,u=e.y,c=e.z;return this.x=i*c-o*u,this.y=o*s-r*c,this.z=r*u-i*s,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}(),BVHIntersect=function(){function n(t,e,r){this.triangle=t,this.intersectionPoint=e,this.index=r}return n}(),EPSILON$1=1e-6,scratchVector3$3=new BVHVector3(0,0,0),scratchVector3A=new BVHVector3(0,0,0),scratchVector3B=new BVHVector3(0,0,0),scratchVector3C=new BVHVector3(0,0,0),BVHMesh=function(n){__extends(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 o=this.getPositionCount()/3,s=o>65535?new Uint32Array(o):new Uint16Array(o),u=new Float32Array(o*6),c=[],l=0,d=-1;if(i)for(var f=0,v=0,A=0,h=void 0,p=void 0,y=void 0,m=void 0,g=void 0,E=void 0,b=void 0;f<o;f+=1,v+=3,A+=6)s[f]=f,this.getPositionByIndex(v,scratchVector3A),this.getPositionByIndex(v+1,scratchVector3B),this.getPositionByIndex(v+2,scratchVector3C),h=m=scratchVector3A.x,b=scratchVector3B.x,b<h&&(h=b),b>m&&(m=b),b=scratchVector3C.x,b<h&&(h=b),b>m&&(m=b),p=g=scratchVector3A.y,b=scratchVector3B.y,b<p&&(p=b),b>g&&(g=b),b=scratchVector3C.y,b<p&&(p=b),b>g&&(g=b),y=E=scratchVector3A.z,b=scratchVector3B.z,b<y&&(y=b),b>E&&(E=b),b=scratchVector3C.z,b<y&&(y=b),b>E&&(E=b),u[A]=h,u[A+1]=p,u[A+2]=y,u[A+3]=m,u[A+4]=g,u[A+5]=E;else{for(var T=1/0,_=1/0,S=1/0,R=-1/0,B=-1/0,I=-1/0,f=0,v=0,A=0,h=void 0,p=void 0,y=void 0,m=void 0,g=void 0,E=void 0,b=void 0;f<o;f+=1,v+=3,A+=6)s[f]=f,this.getPositionByIndex(v,scratchVector3A),this.getPositionByIndex(v+1,scratchVector3B),this.getPositionByIndex(v+2,scratchVector3C),h=m=scratchVector3A.x,b=scratchVector3B.x,b<h&&(h=b),b>m&&(m=b),b=scratchVector3C.x,b<h&&(h=b),b>m&&(m=b),p=g=scratchVector3A.y,b=scratchVector3B.y,b<p&&(p=b),b>g&&(g=b),b=scratchVector3C.y,b<p&&(p=b),b>g&&(g=b),y=E=scratchVector3A.z,b=scratchVector3B.z,b<y&&(y=b),b>E&&(E=b),b=scratchVector3C.z,b<y&&(y=b),b>E&&(E=b),u[A]=h,u[A+1]=p,u[A+2]=y,u[A+3]=m,u[A+4]=g,u[A+5]=E,h<T&&(T=h),m>R&&(R=m),p<_&&(_=p),g>B&&(B=g),y<S&&(S=y),E>I&&(I=E);i=[T,_,S,R,B,I]}var x=new BVHNode(++d,i,0,o,0);c[l++]=x;var M=[],L=[0,1,2],C=function(F,O){return M[O]-M[F]};function H(F){var O=F.startIndex,G=F.endIndex,Q=F.extents;M[0]=Q[3]-Q[0],M[1]=Q[4]-Q[1],M[2]=Q[5]-Q[2],L.sort(C);for(var U=0;U<3;U++){for(var D=L[U],q=Q[D]+Q[D+3],z=O,K=G-1,J=-1,j=void 0;z<=K;)J===-1?(j=s[z],u[j*6+D]+u[j*6+D+3]<q?z++:J=j):(j=s[K],u[j*6+D]+u[j*6+D+3]>=q||(s[z]=j,s[K]=J,J=-1,z++),K--);if(z>O&&z<G){var re=new BVHNode(++d,calcExtents(s,u,O,z,EPSILON$1),O,z,F.deepth+1);re.deepth<r&&re.endIndex-re.startIndex>e&&(c[l++]=re);var W=new BVHNode(++d,calcExtents(s,u,z,G,EPSILON$1),z,G,F.deepth+1);W.deepth<r&&W.endIndex-W.startIndex>e&&(c[l++]=W),F.node0=re,F.node1=W,F.startIndex=0,F.endIndex=0;break}}}for(;l;)H(c[--l]);return this.offsetArray=s,this.rootNodePacked=packBVHNode(x,d+1),c.length=0,this},t.prototype.trianglesInSphere=function(e,r){for(var i=this.offsetArray,o=this.rootNodePacked,s=new Float32Array(o),u=new Uint32Array(o),c=new Uint16Array(o),l=[0],d=[],f,v,A,h;(f=l.pop())!==void 0;){h=f*BYTES_PER_NODE/4;var p=clamp(e.x,s[h],s[h+3])-e.x,y=clamp(e.y,s[h+1],s[h+4])-e.y,m=clamp(e.z,s[h+2],s[h+5])-e.z;if(p*p+y*y+m*m<=r*r){for(var g=u[h+6];g<u[h+7];g++)d.push(i[g]);h=f*BYTES_PER_NODE/2,v=c[h+16],A=c[h+17],v&&l.push(v),A&&l.push(A)}}for(var E=d.length,b=new Float32Array(E*9),g=0;g<E;g++){var T=d[g];this.getPositionByIndex(T,scratchVector3$3),b[g*9]=scratchVector3$3.x,b[g*9+1]=scratchVector3$3.y,b[g*9+2]=scratchVector3$3.z,this.getPositionByIndex(T+1,scratchVector3$3),b[g*9+3]=scratchVector3$3.x,b[g*9+4]=scratchVector3$3.y,b[g*9+5]=scratchVector3$3.z,this.getPositionByIndex(T+2,scratchVector3$3),b[g*9+6]=scratchVector3$3.x,b[g*9+7]=scratchVector3$3.y,b[g*9+8]=scratchVector3$3.z}return b},t.prototype.intersectRay=function(e,r,i,o){for(var s=this.offsetArray,u=this.rootNodePacked,c=new Float32Array(u),l=new Uint32Array(u),d=new Uint16Array(u),f=new BVHVector3(1/r.x,1/r.y,1/r.z),v=[0],A,h,p,y;(A=v.pop())!==void 0;)if(y=A*BYTES_PER_NODE/4,intersectNodeBox(e,f,c[y],c[y+1],c[y+2],c[y+3],c[y+4],c[y+5])){for(var m=l[y+6],g=l[y+7],E=void 0,b=void 0,T=void 0,_=e.x,S=e.y,R=e.z,B=r.x,I=r.y,x=r.z,M=void 0,L=void 0,C=void 0,H=void 0,F=void 0,O=void 0,G=void 0,Q=void 0,U=void 0,D=void 0,q=void 0,z=void 0,K=void 0,J=void 0,j=void 0,re=void 0,W=void 0,te=void 0,$=void 0,ne=void 0,ee=void 0,ce=void 0,ae=void 0,se=void 0,Ae=void 0,he=void 0,me=void 0;m<g;m++){if(E=s[m],b=E*3,this.getPositionByIndex(b,scratchVector3$3),M=scratchVector3$3.x,L=scratchVector3$3.y,C=scratchVector3$3.z,this.getPositionByIndex(b+1,scratchVector3$3),H=scratchVector3$3.x,F=scratchVector3$3.y,O=scratchVector3$3.z,this.getPositionByIndex(b+2,scratchVector3$3),G=scratchVector3$3.x,Q=scratchVector3$3.y,U=scratchVector3$3.z,D=H-M,q=F-L,z=O-C,K=G-M,J=Q-L,j=U-C,re=q*j-z*J,W=z*K-D*j,te=D*J-q*K,ae=B*re+I*W+x*te,ae>0)ce=1;else if(ae<0)ce=-1,ae=-ae;else continue;$=_-M,ne=S-L,ee=R-C,se=ce*(B*(ne*j-ee*J)+I*(ee*K-$*j)+x*($*J-ne*K)),!(se<0)&&(Ae=ce*(B*(q*ee-z*ne)+I*(z*$-D*ee)+x*(D*ne-q*$)),!(Ae<0)&&(se+Ae>ae||(he=-ce*($*re+ne*W+ee*te),!(he<0)&&(me=he/ae,o.push(new BVHIntersect([M,L,C,H,F,O,G,Q,U],[_+B*me,S+I*me,R+x*me],E))))))}y=A*BYTES_PER_NODE/2,h=d[y+16],p=d[y+17],h&&v.push(h),p&&v.push(p)}return o},t}(BVHObject);function clamp(n,t,e){return n<t?t:n>e?e:n}function calcExtents(n,t,e,r,i){if(e>=r)return[0,0,0,0,0,0];for(var o=1/0,s=1/0,u=1/0,c=-1/0,l=-1/0,d=-1/0,f=e,v=void 0,A=void 0;f<r;f++)v=n[f]*6,A=t[v],A<o&&(o=A),A=t[v+1],A<s&&(s=A),A=t[v+2],A<u&&(u=A),A=t[v+3],A>c&&(c=A),A=t[v+4],A>l&&(l=A),A=t[v+5],A>d&&(d=A);return[o-i,s-i,u-i,c+i,l+i,d+i]}var EPSILON=1e-6,ORDER_AXISES=["x","y","z"],scratchVector3$2=new BVHVector3(0,0,0),BVHPoints=function(n){__extends(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 o=this.getPositionByIndex.bind(this),s=this.getPositionCount(),u=s>65535?new Uint32Array(s):new Uint16Array(s),c=[],l=0,d=-1;if(i)for(var f=0;f<s;f+=1)u[f]=f;else{o(0,scratchVector3$2);for(var v=scratchVector3$2.x,A=scratchVector3$2.y,h=scratchVector3$2.z,p=v,y=A,m=h,f=0,g=void 0,E=void 0,b=void 0;f<s;f+=1)u[f]=f,o(f,scratchVector3$2),g=scratchVector3$2.x,E=scratchVector3$2.y,b=scratchVector3$2.z,g<v?v=g:g>p&&(p=g),E<A?A=E:E>y&&(y=E),b<h?h=b:b>m&&(m=b);i=[v,A,h,p,y,m]}var T=new BVHNode(++d,i,0,s,0);c[l++]=T;var _=[],S=[0,1,2],R=function(I,x){return _[x]-_[I]};function B(I){var x=I.startIndex,M=I.endIndex,L=I.extents;_[0]=L[3]-L[0],_[1]=L[4]-L[1],_[2]=L[5]-L[2];for(var C=S.sort(R)[0],H=ORDER_AXISES[C],F=(L[C]+L[C+3])/2,O=x,G=M-1,Q=-1,U;O<=G;)Q===-1?(U=u[O],o(U,scratchVector3$2),scratchVector3$2[H]<F?O++:Q=U):(U=u[G],o(U,scratchVector3$2),scratchVector3$2[H]>=F||(u[O]=U,u[G]=Q,Q=-1,O++),G--);if(O>x){var D=L.slice();D[C+3]=F+EPSILON;var q=new BVHNode(++d,D,x,O,I.deepth+1);q.deepth<r&&q.endIndex-q.startIndex>e&&(c[l++]=q),I.node0=q}if(M>O){var z=L.slice();z[C]=F-EPSILON;var K=new BVHNode(++d,z,O,M,I.deepth+1);K.deepth<r&&K.endIndex-K.startIndex>e&&(c[l++]=K),I.node1=K}I.startIndex=0,I.endIndex=0}for(;l;)B(c[--l]);return this.offsetArray=u,this.rootNodePacked=packBVHNode(T,d+1),c.length=0,this},t.prototype.intersectRay=function(e,r,i,o){for(var s=this.offsetArray,u=this.rootNodePacked,c=new Float32Array(u),l=new Uint32Array(u),d=new Uint16Array(u),f=i*i,v=new BVHVector3(1/r.x,1/r.y,1/r.z),A=[0],h,p,y,m;(h=A.pop())!==void 0;)if(m=h*BYTES_PER_NODE/4,intersectNodeBox(e,v,c[m],c[m+1],c[m+2],c[m+3],c[m+4],c[m+5],i)){for(var g=l[m+6],E=l[m+7],b=void 0,T=void 0,_=void 0,S=void 0,R=void 0,B=void 0,I=void 0,x=void 0,M=void 0,L=void 0,C=void 0,H=void 0;g<E;g++)b=s[g],this.getPositionByIndex(b,scratchVector3$2),T=scratchVector3$2.x,_=scratchVector3$2.y,S=scratchVector3$2.z,R=e.x,B=e.y,I=e.z,x=r.x,M=r.y,L=r.z,C=x*(T-R)+M*(_-B)+L*(S-I),C>0&&(R+=x*C,B+=M*C,I+=L*C),x=T-R,M=_-B,L=S-I,C=x*x+M*M+L*L,C<=f&&o.push(new BVHIntersect([T,_,S,T,_,S,T,_,S],[R,B,I],b));m=h*BYTES_PER_NODE/2,p=d[m+16],y=d[m+17],p&&A.push(p),y&&A.push(y)}return o},t}(BVHObject);const encodedJs$1="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3ZhciBlcj1mdW5jdGlvbihlLHIpe3JldHVybiBlcj1PYmplY3Quc2V0UHJvdG90eXBlT2Z8fHtfX3Byb3RvX186W119aW5zdGFuY2VvZiBBcnJheSYmZnVuY3Rpb24odCxvKXt0Ll9fcHJvdG9fXz1vfXx8ZnVuY3Rpb24odCxvKXtmb3IodmFyIGYgaW4gbylPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwobyxmKSYmKHRbZl09b1tmXSl9LGVyKGUscil9O2Z1bmN0aW9uIGhyKGUscil7aWYodHlwZW9mIHIhPSJmdW5jdGlvbiImJnIhPT1udWxsKXRocm93IG5ldyBUeXBlRXJyb3IoIkNsYX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GNyKGUscix0LG8sZixkLHYsbixzKXtzPT09dm9pZCAwJiYocz0wKSx0PXQtcyxvPW8tcyxmPWYtcyxkPWQrcyx2PXYrcyxuPW4rczt2YXIgdT0wLHc9MCx5PTAscD0wLGE9MCxoPTA7cmV0dXJuIHIueD49MD8odT0odC1lLngpKnIueCx3PShkLWUueCkqci54KToodT0oZC1lLngpKnIueCx3PSh0LWUueCkqci54KSxyLnk+PTA/KHk9KG8tZS55KSpyLnkscD0odi1lLnkpKnIueSk6KHk9KHYtZS55KSpyLnkscD0oby1lLnkpKnIueSksISh1PnB8fHk+d3x8KHk+dSYmKHU9eSkscDx3JiYodz1wKSxyLno+PTA/KGE9KGYtZS56KSpyLnosaD0obi1lLnopKnIueik6KGE9KG4tZS56KSpyLnosaD0oZi1lLnopKnIueiksdT5ofHxhPncpfHwoYT51JiYodT1hKSxoPHcmJih3PWgpLHc8MCkpfXZhciBZPWZ1bmN0aW9uKCl7ZnVuY3Rpb24gZShyLHQsbyl7dGhpcy54PXIsdGhpcy55PXQsdGhpcy56PW99cmV0dXJuIGUucHJvdG90eXBlLmNvcHk9ZnVuY3Rpb24ocil7cmV0dXJuIHRoaXMueD1yLngsdGhpcy55PXIueSx0aGlzLno9ci56LHRoaXN9LGUucHJvdG90eXBlLnNldD1mdW5jdGlvbihyLHQsbyl7cmV0dXJuIHRoaXMueD1yLHRoaXMueT10LHRoaXMuej1vLHRoaXN9LGUucHJvdG90eXBlLmZyb21BcnJheT1mdW5jdGlvbihyLHQpe3JldHVybiB0PT09dm9pZCAwJiYodD0wKSx0aGlzLng9clt0XSx0aGlzLnk9clt0KzFdLHRoaXMuej1yW3QrMl0sdGhpc30sZS5wcm90b3R5cGUudG9BcnJheT1mdW5jdGlvbihyLHQpe3JldHVybiByPT09dm9pZCAwJiYocj1bXSksdD09PXZvaWQgMCYmKHQ9MCksclt0XT10aGlzLngsclt0KzFdPXRoaXMueSxyW3QrMl09dGhpcy56LHJ9LGUucHJvdG90eXBlLmFkZD1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idWZmZXIpfXU9cy5pbmRpY2VzLHUmJnUuYnVmZmVyIGluc3RhbmNlb2YgQXJyYXlCdWZmZXImJm8uYWRkKHUuYnVmZmVyKSx1PXMub2Zmc2V0QXJyYXksdSYmdS5idWZmZXIgaW5zdGFuY2VvZiBBcnJheUJ1ZmZlciYmby5hZGQodS5idWZmZXIpLG8uYWRkKHMucm9vdE5vZGVQYWNrZWQpfXJldHVybntvdXRwdXQ6dCx0cmFuc2ZlcjpBcnJheS5mcm9tKG8pfX0pfSl9KSgpOwo=",decodeBase64$1=n=>Uint8Array.from(atob(n),t=>t.charCodeAt(0)),blob$2=typeof self!="undefined"&&self.Blob&&new Blob([decodeBase64$1(encodedJs$1)],{type:"text/javascript;charset=utf-8"});function WorkerWrapper$1(n){let t;try{if(t=blob$2&&(self.URL||self.webkitURL).createObjectURL(blob$2),!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,"+encodedJs$1,{name:n==null?void 0:n.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var WorkerPool$1=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,o=r.reject;if(e.data&&"$$error"in e.data?o(e.data.$$error):i(e.data),this.queue.length){var s=this.queue.shift(),u=s.resolve,c=s.reject,l=s.input,d=s.transfer;this.workersResolver[t]={resolve:u,reject:c},this.workers[t].postMessage(l,d)}else this.workerStatus^=1<<t},n.prototype.postMessage=function(t,e){var r=this;return e===void 0&&(e=[]),new Promise(function(i,o){var s=r.getIdleWorker();s!==-1?(r.initWorker(s),r.workerStatus|=1<<s,r.workersResolver[s]={resolve:i,reject:o},r.workers[s].postMessage(t,e)):r.queue.push({resolve:i,reject:o,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}(),bvhWorkerPool=new WorkerPool$1(function(){return new WorkerWrapper$1},4),bvhMeshMap=new Map,scratchRay=new THREE__namespace.Ray,scratchNormalMatrix=new THREE__namespace.Matrix3,scratchInverseMatrix=new THREE__namespace.Matrix4,scratchIntersectionFaceA=new THREE__namespace.Vector3,scratchIntersectionFaceB=new THREE__namespace.Vector3,scratchIntersectionFaceC=new THREE__namespace.Vector3,scratchIntersectionTriangle=new THREE__namespace.Triangle;function raycastMesh(n,t,e,r){var i,o=n.matrixWorld;scratchInverseMatrix.getInverse(o),scratchRay.copy(e.ray).applyMatrix4(scratchInverseMatrix);for(var s=t.intersectRay(scratchRay.origin,scratchRay.direction,0,[]),u=n.geometry,c=n.material,l=u.groups,d=u.index,f=0,v=s.length;f<v;f++){var A=s[f],h=A.triangle,p=A.index,y=A.intersectionPoint,m=new THREE__namespace.Vector3(y[0],y[1],y[2]).applyMatrix4(o),g=e.ray.origin.distanceTo(m);if(!(g<e.near||g>e.far)){var E=void 0;if(Array.isArray(c)){if(l)for(var b=p*3,T=0,_=l;T<_.length;T++){var S=_[T];if(b>=S.start&&b-S.start<S.count){E=c[(i=S.materialIndex)!==null&&i!==void 0?i:0];break}}}else E=c;if(E){var R=scratchIntersectionTriangle.set(scratchIntersectionFaceA.set(h[0],h[1],h[2]).applyMatrix4(o),scratchIntersectionFaceB.set(h[3],h[4],h[5]).applyMatrix4(o),scratchIntersectionFaceC.set(h[6],h[7],h[8]).applyMatrix4(o)).getNormal(new THREE__namespace.Vector3),B=p*3,I=new THREE__namespace.Face3(d?d.array[B]:B,d?d.array[B+1]:B+1,d?d.array[B+2]:B+2,R),x=e.ray.direction.dot(R);E.side===THREE__namespace.FrontSide&&x>=0||E.side===THREE__namespace.BackSide&&x<=0||r.push({distance:g,object:n,face:I,point:m,distanceToRay:0,faceIndex:p})}}}}function raycastPoints(n,t,e,r){var i,o,s=n.matrixWorld;scratchNormalMatrix.getNormalMatrix(s),scratchInverseMatrix.getInverse(s);var u=((o=(i=e.params.Points)===null||i===void 0?void 0:i.threshold)!==null&&o!==void 0?o:1)*scratchInverseMatrix.getMaxScaleOnAxis();scratchRay.copy(e.ray).applyMatrix4(scratchInverseMatrix);for(var c=t.intersectRay(scratchRay.origin,scratchRay.direction,u,[]),l=n.geometry,d=l.index,f=l.getAttribute("normal"),v=0,A=c.length;v<A;v++){var h=c[v],p=h.triangle,y=h.index,m=h.intersectionPoint,g=new THREE__namespace.Vector3(m[0],m[1],m[2]).applyMatrix4(s),E=e.ray.origin.distanceTo(g);if(!(E<e.near||E>e.far)){var b=scratchIntersectionFaceA.set(p[0],p[1],p[2]).applyMatrix4(s),T=d?d.array[y]:y,_=void 0;f instanceof THREE__namespace.BufferAttribute&&(_=new THREE__namespace.Vector3().fromBufferAttribute(f,T).applyNormalMatrix(scratchNormalMatrix));var S=new THREE__namespace.Face3(T,T,T,_);r.push({distance:E,object:n,face:S,point:g,distanceToRay:g.distanceTo(b),index:y})}}}var BVH_MESH_PROP="__bvh_mesh__",originMeshRaycast=THREE__namespace.Mesh.prototype.raycast;function overrideMeshRaycast(n,t){var e=getBvhTreeForMesh(this);e?raycastMesh(this,e,n,t):originMeshRaycast.call(this,n,t)}function getBvhTreeForMesh(n){var t=n[BVH_MESH_PROP];return t instanceof BVHMesh,t}function bindBvhTreeForMesh(n,t){var e;Object.assign(n,(e={},e[BVH_MESH_PROP]=t,e.raycast=overrideMeshRaycast,e))}var BVH_POINTS_PROP="__bvh_points__",originPointsRaycast=THREE__namespace.Points.prototype.raycast;function overridePointsRaycast(n,t){var e=getBvhTreeForPoints(this);e?raycastPoints(this,e,n,t):originPointsRaycast.call(this,n,t)}function getBvhTreeForPoints(n){var t=n[BVH_POINTS_PROP];return t instanceof BVHPoints,t}function bindBvhTreeForPoints(n,t){var e;Object.assign(n,(e={},e[BVH_POINTS_PROP]=t,e.raycast=overridePointsRaycast,e))}function generateBvhTree(n,t,e,r){var i=[];return n.traverse(function(o){(o instanceof THREE__namespace.Mesh||o instanceof THREE__namespace.Points)&&o.geometry instanceof THREE__namespace.BufferGeometry&&i.push(o)}),Promise.resolve().then(function(){for(var o=[],s=new Set,u=null,c=0;c<i.length;c++){var l=i[c],d=l.geometry;if(d instanceof THREE__namespace.BufferGeometry){var f=void 0;if(l instanceof THREE__namespace.Mesh?f="mesh":l instanceof THREE__namespace.Points&&(f="points"),!!f){var v=d.boundingBox,A=v?[v.min.x,v.min.y,v.min.z,v.max.x,v.max.y,v.max.z]:void 0,h={};for(var p in d.attributes){var y=d.attributes[p];y instanceof THREE__namespace.InterleavedBufferAttribute?(h[p]={array:y.data.array,stride:y.data.stride,offset:y.offset},u=y.data.array,u&&u.buffer instanceof ArrayBuffer&&s.add(u.buffer)):(h[p]={array:y.array},u=y.array,u&&u.buffer instanceof ArrayBuffer&&s.add(u.buffer))}var m=void 0,g=d.getIndex();g&&(g instanceof THREE__namespace.InterleavedBufferAttribute?(m={array:g.data.array,stride:g.data.stride,offset:g.offset},u=g.data.array,u&&u.buffer instanceof ArrayBuffer&&s.add(u.buffer)):(m={array:g.array},u=g.array,u&&u.buffer instanceof ArrayBuffer&&s.add(u.buffer)));var E={type:f,attributes:h,indices:m,maxItemPerNode:e,maxTreeDepth:r,extents:A};o.push(E)}}}return bvhWorkerPool.postMessage(o,Array.from(s))}).then(function(o){for(var s=0;s<i.length;s++){var u=i[s],c=u.geometry,l=o[s];if(c instanceof THREE__namespace.BufferGeometry){for(var d in l.attributes){var f=l.attributes[d].array,v=c.attributes[d];v instanceof THREE__namespace.InterleavedBufferAttribute?v.data.array=f:v.array=f}var A=c.getIndex();if(A&&l.indices){var f=l.indices.array;A instanceof THREE__namespace.InterleavedBufferAttribute?A.data.array=f:A.array=f}if(u instanceof THREE__namespace.Mesh){var h=new BVHMesh(l.attributes.position,l.indices);h.offsetArray=l.offsetArray,h.rootNodePacked=l.rootNodePacked,bindBvhTreeForMesh(u,h)}else if(u instanceof THREE__namespace.Points){var h=new BVHPoints(l.attributes.position,l.indices);h.offsetArray=l.offsetArray,h.rootNodePacked=l.rootNodePacked,bindBvhTreeForPoints(u,h)}}}return n})}new THREE__namespace.Vector3,new THREE__namespace.Vector3,new THREE__namespace.Vector3;var TileNode=function(n){__extends(t,n);function t(e,r){r===void 0&&(r=noop$1);var i=n.call(this)||this;return i.contentObject=e,i.disposer=r,i.disposers=[r],i.add(e),i}return t.prototype.generateBvhTree=function(){return generateBvhTree(this,!0,200,10)},t.prototype.intersectRaycaster=function(e,r,i){r===void 0&&(r=!0),i===void 0&&(i=[]);for(var o=this.children.slice(),s,u=[];s=o.pop();)if(s.visible){s.raycast(e,u);for(var c=0,l=s.children.length;c<l;c++)o.push(s.children[c])}return u.forEach(function(d){var f=0;if((d.object instanceof PBMMesh||d.object instanceof PBMPointCloud)&&d.face){var v=Array.isArray(d.object.material)?d.object.material[d.face.materialIndex]:d.object.material;v&&(f=v.floor)}d.floor=f}),r&&u.sort(function(d,f){return d.distance-f.distance}),i.push.apply(i,u),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.contentObject,this.disposer)},t}(THREE__namespace.Group);function pathJoin(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=[];n=n.map(function(u){return(u!=null?u:"").trim()}).filter(function(u){return u.length>0&&!/^\/+$/.test(u)});for(var r=0;r<n.length;r++){var i=r===0,o=r===n.length-1,s=n[r];i||(s=s.replace(/^\.\//,"").replace(/^\/+/,"")),o||(s=s.replace(/\/+$/,"")),e.push(s)}return e.join("/")}function normalizeURL(n){var t,e=/^(http\:|https\:|file\:)?\/\/[^/]/.exec(n);if(!e)return n;var r=e[1]||"",i=n.slice(r.length+2),o=i.indexOf("#");o>=0&&(n.slice(o),i=n.slice(0,o));var s=i.indexOf("?");s>=0&&(n.slice(s),i=n.slice(0,s));for(var u=i.split("/"),c=u.shift(),l=(t=u.pop())!==null&&t!==void 0?t:"",d=[],f=0,v=u;f<v.length;f++){var A=v[f];if(!(A===""||A===".")){if(A===".."){d.pop();continue}d.push(A)}}return r+"//"+c+"/"+d.join("/")+"/"+l}function isAbsoluteURL(n){return n.indexOf("//")===0||/^[0-9a-z]+\:/i.test(n)}function normalizeTileHeader(n,t,e){if(n.content&&n.content.uri&&(isAbsoluteURL(n.content.uri)||(n.content.uri=normalizeURL(pathJoin(t,n.content.uri)))),n.transform){for(var r=!1,i=0;i<16;i++){var o=n.transform[i];if(typeof o!="number"||isNaN(o)||!isFinite(o)){r=!0;break}}if(n.transform[15]===0&&(r=!0),r)throw new Error("Invalid Tile Transform: "+JSON.stringify(n.transform))}if(n.children)for(var s=0,u=n.children;s<u.length;s++){var c=u[s];normalizeTileHeader(c,t)}return n}function normalizeTilesetHeader(n,t){return n.asset||(n.asset={}),n.rootMeta||(n.rootMeta={}),n.asset.overview&&(isAbsoluteURL(n.asset.overview.imageFile)||(n.asset.overview.imageFile=normalizeURL(pathJoin(t,n.asset.overview.imageFile))),isAbsoluteURL(n.asset.overview.worldFile)||(n.asset.overview.worldFile=normalizeURL(pathJoin(t,n.asset.overview.worldFile)))),normalizeTileHeader(n.root,t),n}function initTextures(n,t,e){for(var r,i,o=Promise.resolve(),s=n.slice(),u=function(){for(var c=[],l=0,d=void 0;d=s.shift();){c.push(d);var f=((r=d.image)===null||r===void 0?void 0:r.width)*((i=d.image)===null||i===void 0?void 0:i.height);if(!isNaN(f)&&isFinite(f)&&(l+=f),l>=e)break}o=o.then(function(){return new Promise(function(v){AnimationFrameLoop.shared.add(function(){for(var A=0,h=c;A<h.length;A++){var p=h[A];t.initTexture(p)}v()},!0)})}).catch(function(){})};s.length>0;)u();return o}function appendSearch(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 pointCloudFragmentShader=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,o=0,s="";return t[o].split(s).map(function(u){return u.charCodeAt(o)>i?u:String.fromCharCode((u.charCodeAt(o)+r)%i)}).join(s)}("{vs|z-sy|n-sy||H0vs-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-rp@-PnzrnQvrpv|{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-K-:=;=>-33-no5sy||-:-u|{Sy||V{qr\x076-K-=;FF6-\n----sy||\\}npv\b-J-=;>-7-zv{55>;=-8-PnzrnQvrpv|{;\b69->;=6H--\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"),pointCloudVertexShader=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,o=0,s="";return t[o].split(s).map(function(u){return u.charCodeAt(o)>i?u:String.fromCharCode((u.charCodeAt(o)+r)%i)}).join(s)}("nvor-rp@-p|y|H0vs-qrsv{rq5b`Rl]\\V[alP\\Y\\_lNY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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--<<传递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 scratchVector4=new THREE__namespace.Vector4,shaderUniforms=Object.assign({pointScale:new THREE__namespace.Uniform(1),pointMinPixel:new THREE__namespace.Uniform(1),pointMaxPixel:new THREE__namespace.Uniform(1),opacity:new THREE__namespace.Uniform(1),gradientTexture:new THREE__namespace.Uniform(null),modelAlpha:new THREE__namespace.Uniform(0),clippers:new THREE__namespace.Uniform([]),shownFloorIndex:new THREE__namespace.Uniform(-1),constantColor:new THREE__namespace.Uniform(null),geometricError:new THREE__namespace.Uniform(0),pixelRatio:new THREE__namespace.Uniform(1),resolution:new THREE__namespace.Uniform(new THREE__namespace.Vector2(512,512)),floor:new THREE__namespace.Uniform(0),brightness:new THREE__namespace.Uniform(1),modelBoundingMin:new THREE__namespace.Uniform(new THREE__namespace.Vector3),modelBoundingMax:new THREE__namespace.Uniform(new THREE__namespace.Vector3)},THREE__namespace.UniformsUtils.clone(THREE__namespace.UniformsLib.fog)),PBMPointCloudMaterial=function(n){__extends(t,n);function t(e){e===void 0&&(e={});var r,i,o,s,u,c,l,d,f,v,A,h,p,y,m,g,E,b,T,_,S,R=n.call(this,{vertexShader:pointCloudVertexShader,fragmentShader:pointCloudFragmentShader,uniforms:THREE__namespace.UniformsUtils.clone(shaderUniforms),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_MARK:!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,B;return Object.defineProperties(R,{constantColor:{get:function(){return this.uniforms.constantColor.value},set:function(I){this.uniforms.constantColor.value=I;var x=this.defines.USE_CONSTANT_COLOR,M=I!==null;x!==M&&(this.defines.USE_CONSTANT_COLOR=M,this.needsUpdate=!0)}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(I){this.uniforms.opacity.value=I}},modelAlpha:{get:function(){return this.uniforms.modelAlpha.value},set:function(I){this.uniforms.modelAlpha.value=I}},shownFloorIndex:{get:function(){return this.uniforms.shownFloorIndex.value},set:function(I){this.uniforms.shownFloorIndex.value=I}},clippers:{get:function(){return B},set:function(I){B!==I&&(B=I,this.uniforms.clippers.value=(B||[]).map(function(x){var M=typeof x.floorIndex=="number"?x.floorIndex:-1,L=new THREE__namespace.Matrix4().getInverse(x.clippingBoxMatrix);return{matrixInverse:L,floorIndex:M}}),this.needsUpdate=!0)}},pointColor:{get:function(){return this.defines.USE_POINT_COLOR_ALTITUDE===!0?"ALTITUDE":"RGB"},set:function(I){var x=I==="ALTITUDE";this.defines.USE_POINT_COLOR_ALTITUDE!==x&&(this.defines.USE_POINT_COLOR_ALTITUDE=x,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(I){var x=I==="ATTENUATION",M=I==="GEOMETRIC";this.defines.USE_POINT_SIZE_GEOMETRIC!==M&&(this.defines.USE_POINT_SIZE_GEOMETRIC=M,this.needsUpdate=!0),this.defines.USE_POINT_SIZE_ATTENUATION!==x&&(this.defines.USE_POINT_SIZE_ATTENUATION=x,this.needsUpdate=!0)}},pointShape:{get:function(){return this.defines.USE_POINT_SHAPE_CIRCLE===!0?"CIRCLE":"SQUARE"},set:function(I){var x=I==="CIRCLE";this.defines.USE_POINT_SHAPE_CIRCLE!==x&&(this.defines.USE_POINT_SHAPE_CIRCLE=x,this.needsUpdate=!0)}},pointScale:{get:function(){return this.uniforms.pointScale.value},set:function(I){this.uniforms.pointScale.value=I}},pointBack:{get:function(){return this.defines.USE_POINT_BACK_HIDDEN===!0?"HIDDEN":this.defines.USE_POINT_BACK_DARK===!0?"DARK":"VISIBLE"},set:function(I){var x=I==="HIDDEN",M=I==="DARK";this.defines.USE_POINT_BACK_HIDDEN!==x&&(this.defines.USE_POINT_BACK_HIDDEN=x,this.needsUpdate=!0),this.defines.USE_POINT_BACK_DARK!==M&&(this.defines.USE_POINT_BACK_DARK=M,this.needsUpdate=!0)}},pointMinPixel:{get:function(){return this.uniforms.pointMinPixel.value},set:function(I){this.uniforms.pointMinPixel.value=I}},pointMaxPixel:{get:function(){return this.uniforms.pointMaxPixel.value},set:function(I){this.uniforms.pointMaxPixel.value=I}},useEDL:{get:function(){return this.defines.USE_EDL},set:function(I){I!==this.defines.USE_EDL&&(this.defines.USE_EDL=I,this.needsUpdate=!0)}},useHQWeight:{get:function(){return this.defines.USE_HQ_WEIGHT},set:function(I){I!==this.defines.USE_HQ_WEIGHT&&(this.defines.USE_HQ_WEIGHT=I,this.needsUpdate=!0)}},useHQDepth:{get:function(){return this.defines.USE_HQ_DEPTH},set:function(I){I!==this.defines.USE_HQ_DEPTH&&(this.defines.USE_HQ_DEPTH=I,this.needsUpdate=!0)}},gradientTexture:{get:function(){return this.uniforms.gradientTexture.value},set:function(I){this.uniforms.gradientTexture.value=I}},floor:{get:function(){return this.uniforms.floor.value},set:function(I){this.uniforms.floor.value=I}},brightness:{get:function(){return this.uniforms.brightness.value},set:function(I){this.uniforms.brightness.value=I}}}),R.pano0=(r=e.pano0)!==null&&r!==void 0?r:defaultPbmParameters.pano0,R.pano1=(i=e.pano1)!==null&&i!==void 0?i:defaultPbmParameters.pano1,R.modelAlpha=(o=e.modelAlpha)!==null&&o!==void 0?o:defaultPbmParameters.modelAlpha,R.progress=(s=e.progress)!==null&&s!==void 0?s:defaultPbmParameters.progress,R.transition=(u=e.transition)!==null&&u!==void 0?u:defaultPbmParameters.transition,R.constantColor=(c=e.constantColor)!==null&&c!==void 0?c:defaultPbmParameters.constantColor,R.opacity=(l=e.opacity)!==null&&l!==void 0?l:defaultPbmParameters.opacity,R.shownFloorIndex=(d=e.shownFloorIndex)!==null&&d!==void 0?d:defaultPbmParameters.shownFloorIndex,R.clippers=(f=e.clippers)!==null&&f!==void 0?f:defaultPbmParameters.clippers,R.useEDL=(v=e.useEDL)!==null&&v!==void 0?v:defaultPbmParameters.useEDL,R.useHQWeight=(A=e.useHQWeight)!==null&&A!==void 0?A:defaultPbmParameters.useHQWeight,R.useHQDepth=(h=e.useHQDepth)!==null&&h!==void 0?h:defaultPbmParameters.useHQDepth,R.pointColor=(p=e.pointColor)!==null&&p!==void 0?p:defaultPbmParameters.pointColor,R.pointShape=(y=e.pointShape)!==null&&y!==void 0?y:defaultPbmParameters.pointShape,R.pointSize=(m=e.pointSize)!==null&&m!==void 0?m:defaultPbmParameters.pointSize,R.pointScale=(g=e.pointScale)!==null&&g!==void 0?g:defaultPbmParameters.pointScale,R.pointBack=(E=e.pointBack)!==null&&E!==void 0?E:defaultPbmParameters.pointBack,R.pointMinPixel=(b=e.pointMinPixel)!==null&&b!==void 0?b:defaultPbmParameters.pointMinPixel,R.pointMaxPixel=(T=e.pointMaxPixel)!==null&&T!==void 0?T:defaultPbmParameters.pointMaxPixel,R.gradientTexture=(_=e.gradientTexture)!==null&&_!==void 0?_:defaultPbmParameters.gradientTexture,R.brightness=(S=e.brightness)!==null&&S!==void 0?S:defaultPbmParameters.brightness,R.floor=0,R.transparent=!0,R}return t.prototype.onBeforeCompile=function(e,r){var i,o,s=String((o=(i=this.clippers)===null||i===void 0?void 0:i.length)!==null&&o!==void 0?o:0);e.vertexShader=e.vertexShader.replace(/NUM_CLIPPERS/g,s),e.fragmentShader=e.fragmentShader.replace(/NUM_CLIPPERS/g,s)},t.prototype.update=function(e,r){if(r instanceof Camera)this.uniforms.pixelRatio.value=r.pixelRatio,this.uniforms.resolution.value.copy(r.resolution);else{this.uniforms.pixelRatio.value=e.getPixelRatio();var i=e.getViewport(scratchVector4);this.uniforms.resolution.value.set(i.z,i.w)}this.transparent=!1,this.shownFloorIndex>-1&&(this.transparent=this.shownFloorIndex!==this.floor),this.modelAlpha<1&&(this.transparent=!0),this.opacity<1&&(this.transparent=!0),this.brightness<1&&(this.transparent=!0),this.depthWrite=!0,this.depthTest=!0,this.useEDL&&(this.transparent=!1),this.useHQWeight?(this.depthWrite=!1,this.blending=THREE__namespace.CustomBlending,this.blendSrc=THREE__namespace.SrcAlphaFactor,this.blendSrcAlpha=THREE__namespace.SrcAlphaFactor,this.blendDst=THREE__namespace.OneFactor,this.blendDstAlpha=THREE__namespace.OneFactor):(this.blending=THREE__namespace.NormalBlending,this.blendDst=THREE__namespace.OneMinusSrcAlphaFactor,this.blendEquation=THREE__namespace.AddEquation,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null)},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}(THREE__namespace.ShaderMaterial),SIZEOF_UINT32$1=4;function parseHeader(n,t,e){var r=new DataView(t);if(n.magic=r.getUint32(e,!0),e+=SIZEOF_UINT32$1,n.version=r.getUint32(e,!0),e+=SIZEOF_UINT32$1,n.byteLength=r.getUint32(e,!0),e+=SIZEOF_UINT32$1,n.version!==1)throw new Error("3D Tile Version ".concat(n.version," not supported"));return e}var _a$3,GL_TYPE;(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"})(GL_TYPE||(GL_TYPE={}));var GL_TYPE_TO_ARRAY_TYPE=(_a$3={},_a$3[GL_TYPE.DOUBLE]=Float64Array,_a$3[GL_TYPE.FLOAT]=Float32Array,_a$3[GL_TYPE.UNSIGNED_SHORT]=Uint16Array,_a$3[GL_TYPE.UNSIGNED_INT]=Uint32Array,_a$3[GL_TYPE.UNSIGNED_BYTE]=Uint8Array,_a$3[GL_TYPE.BYTE]=Int8Array,_a$3[GL_TYPE.SHORT]=Int16Array,_a$3[GL_TYPE.INT]=Int32Array,_a$3),NAME_TO_GL_TYPE={DOUBLE:GL_TYPE.DOUBLE,FLOAT:GL_TYPE.FLOAT,UNSIGNED_SHORT:GL_TYPE.UNSIGNED_SHORT,UNSIGNED_INT:GL_TYPE.UNSIGNED_INT,UNSIGNED_BYTE:GL_TYPE.UNSIGNED_BYTE,BYTE:GL_TYPE.BYTE,SHORT:GL_TYPE.SHORT,INT:GL_TYPE.INT};function getArrayType(n){var t=GL_TYPE_TO_ARRAY_TYPE[n];if(!t)throw new Error("Failed to convert GL type");return t}function getByteSize(n){var t=getArrayType(n);return t.BYTES_PER_ELEMENT}function createTypedArray(n,t,e,r){e===void 0&&(e=0);var i=getArrayType(n);if(e%getByteSize(n)!==0){var o=r?t.slice(e,e+r*getByteSize(n)):t.slice(e);return new i(o)}else return new i(t,e,r!=null?r:(t.byteLength-e)/getByteSize(n))}function glTypeFromName(n){var t=NAME_TO_GL_TYPE[n];if(!t)throw new Error("Failed to convert GL type");return t}var FeatureTable=function(){function n(t,e){this.featuresLength=0,this.cachedTypedArrays={},this.json=t,this.buffer=e;var r=this.getGlobalProperty("POINTS_LENGTH",GL_TYPE.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 o=getArrayType(e);return new o([i])}else if(Array.isArray(i)){var o=getArrayType(e);return new o(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=glTypeFromName(i.componentType)),this.getTypedArrayFromBinary(t,e,r,this.featuresLength,i.byteOffset)):this.getTypedArrayFromArray(t,e,i)},n.prototype.getProperty=function(t,e,r,i,o){var s=this.json[t];if(!s)return null;var u=this.getPropertyArray(t,e,r);if(r===1)return o[0]=u[i],o;for(var c=0;c<r;++c)o[c]=u[r*i+c];return o},n.prototype.getTypedArrayFromBinary=function(t,e,r,i,o){var s=this.cachedTypedArrays,u=s[t];return u||(u=createTypedArray(e,this.buffer.buffer,this.buffer.byteOffset+o,i*r),s[t]=u),u},n.prototype.getTypedArrayFromArray=function(t,e,r){var i=this.cachedTypedArrays,o=i[t];return o||(o=createTypedArray(e,r),i[t]=o),o},n}(),SIZEOF_UINT32=4,DEPRECATION_WARNING="b3dm tile in legacy format.";function getStringFromArrayBuffer(n,t,e){var r=new TextDecoder("utf8"),i=new Uint8Array(n,t,e),o=r.decode(i);return o}function parseTable(n,t,e){return e=parseTablesHeader(n,t,e),e=parseFeatureTable(n,t,e),e=parseBatchTable(n,t,e),e}function parseTablesHeader(n,t,e){var r=new DataView(t),i=0;n.header=n.header||{};var o=r.getUint32(e,!0);e+=SIZEOF_UINT32;var s=r.getUint32(e,!0);e+=SIZEOF_UINT32;var u=r.getUint32(e,!0);e+=SIZEOF_UINT32;var c=r.getUint32(e,!0);return e+=SIZEOF_UINT32,u>=570425344?(e-=SIZEOF_UINT32*2,i=o,u=s,c=0,o=0,s=0,console.warn(DEPRECATION_WARNING)):c>=570425344&&(e-=SIZEOF_UINT32,i=u,u=o,c=s,o=0,s=0,console.warn(DEPRECATION_WARNING)),n.header.featureTableJsonByteLength=o,n.header.featureTableBinaryByteLength=s,n.header.batchTableJsonByteLength=u,n.header.batchTableBinaryByteLength=c,n.header.batchLength=i,e}function parseFeatureTable(n,t,e){var r=n.header||{},i=r.featureTableJsonByteLength,o=r.featureTableBinaryByteLength,s=r.batchLength;if(n.featureTableJson={BATCH_LENGTH:s||0},i&&i>0){var u=getStringFromArrayBuffer(t,e,i);n.featureTableJson=JSON.parse(u)}e+=i||0,n.featureTableBinary=new Uint8Array(t,e,o),e+=o||0,n.rtcCenter=[0,0,0];var c=new FeatureTable(n.featureTableJson,n.featureTableBinary);if(Array.isArray(c.json.RTC_CENTER)){var l=c.json.RTC_CENTER;n.rtcCenter[0]=l[0],n.rtcCenter[1]=l[1],n.rtcCenter[2]=l[2]}else{var l=c.getGlobalProperty("RTC_CENTER",GL_TYPE.FLOAT,3);l&&(n.rtcCenter[0]=l[0],n.rtcCenter[1]=l[1],n.rtcCenter[2]=l[2])}return e}function parseBatchTable(n,t,e){var r=n.header||{},i=r.batchTableJsonByteLength,o=r.batchTableBinaryByteLength;if(i&&i>0){var s=getStringFromArrayBuffer(t,e,i);n.batchTableJson=JSON.parse(s),e+=i,o&&o>0&&(n.batchTableBinary=new Uint8Array(t,e,o),n.batchTableBinary=new Uint8Array(n.batchTableBinary),e+=o)}return e}function sliceArrayBuffer(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 parseGlTFArrayBuffer(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=sliceArrayBuffer(t,e,r),n.byteLength}function decodeText(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 WEBGL_CONSTANTS={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},WEBGL_COMPONENT_TYPES={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},WEBGL_FILTERS={9728:THREE__namespace.NearestFilter,9729:THREE__namespace.LinearFilter,9984:THREE__namespace.NearestMipmapNearestFilter,9985:THREE__namespace.LinearMipmapNearestFilter,9986:THREE__namespace.NearestMipmapLinearFilter,9987:THREE__namespace.LinearMipmapLinearFilter},WEBGL_WRAPPINGS={33071:THREE__namespace.ClampToEdgeWrapping,33648:THREE__namespace.MirroredRepeatWrapping,10497:THREE__namespace.RepeatWrapping},WEBGL_TYPE_SIZES={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},ATTRIBUTES={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},PATH_PROPERTIES={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},INTERPOLATION={CUBICSPLINE:void 0,LINEAR:THREE__namespace.InterpolateLinear,STEP:THREE__namespace.InterpolateDiscrete},ALPHA_MODES={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function values(n){var t=[];for(var e in n)t.push(n[e]);return t}function composeDsiposeSet(n){var t=Array.from(n);return function(){for(var e=0,r=t;e<r.length;e++){var i=r[e];typeof i.dispose=="function"&&i.dispose(),typeof i.close=="function"&&i.close()}}}var Parser=function(){function n(t,e,r){this.json=t,this.extensions=e,this.options=r,this.cache=new Map,this.disposeSet=new Set,this.textureSet=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(),this.textureSet.clear(),this.extensions={},this.json={asset:{version:"unknown"}}},n.prototype.markDefs=function(){for(var t=this.json.nodes||[],e=this.json.skins||[],r=this.json.meshes||[],i=0,o=e.length;i<o;i++)for(var s=e[i].joints,u=0,c=s.length;u<c;u++)t[s[u]].isBone=!0;for(var l=0,d=t.length;l<d;l++){var f=t[l];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,o=values(r);i<o.length;i++){var s=o[i];s.markDefs(this)}return Promise.all(values(r).map(function(u){return u.prepare(t)})).then(function(){var u,c,l;return Promise.all([Promise.all(((u=e.scenes)!==null&&u!==void 0?u:[]).map(function(d,f){return t.loadScene(f)})),Promise.all(((c=e.animations)!==null&&c!==void 0?c:[]).map(function(d,f){return t.loadAnimation(f)})),Promise.all(((l=e.cameras)!==null&&l!==void 0?l:[]).map(function(d,f){return t.loadCamera(f)}))])}).then(function(u){var c=u[0],l=u[1],d=u[2],f={json:e,scene:c[e.scene||0],scenes:c,animations:l,cameras:d,textures:[],dispose:noop$1};return f}).then(function(u){return Promise.all(values(r).map(function(c){return c.emitResult(u,t)})).then(function(){return u})}).then(function(u){var c=Array.from(t.textureSet),l=composeDsiposeSet(t.disposeSet);return Object.assign(u,{textures:c,dispose:l}),t.textureSet.clear(),t.disposeSet.clear(),t.dispose(),u})},n.prototype.loadCamera=function(t){var e="camera:"+t,r=this.cache.get(e);if(r)return r;for(var i=null,o=0,s=values(this.extensions);o<s.length;o++){var u=s[o];if(i=u.loadCamera(t,this),i)break}if(!i){var c=void 0,l=this.json.cameras[t],d=l[l.type];d?l.type==="perspective"?c=new THREE__namespace.PerspectiveCamera(THREE__namespace.MathUtils.radToDeg(d.yfov),d.aspectRatio||1,d.znear||1,d.zfar||2e6):l.type==="orthographic"?c=new THREE__namespace.OrthographicCamera(-d.xmag,d.xmag,d.ymag,-d.ymag,d.znear,d.zfar):(console.warn("glTF: Invalid camera type ".concat(l.type,".")),c=new THREE__namespace.Camera):(console.warn("glTF: Missing camera parameters."),c=new THREE__namespace.Camera),l.name&&(c.name=this.createUniqueName(l.name)),i=Promise.resolve(c)}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,o=this.json.skins[t],s={joints:o.joints};return o.inverseBindMatrices===void 0?i=Promise.resolve(s):i=this.loadAccessor(o.inverseBindMatrices).then(function(u){return u&&(s.inverseBindMatrices=u),s}),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,o=0,s=values(this.extensions);o<s.length;o++){var u=s[o];if(i=u.loadAnimation(t,this),i)break}if(!i){for(var c=this.json,l=c.animations[t],d=[],f=[],v=[],A=[],h=[],p=0,y=l.channels.length;p<y;p++){var m=l.channels[p],g=l.samplers[m.sampler],E=m.target,b=E.node!==void 0?E.node:E.id,T=l.parameters!==void 0?l.parameters[g.input]:g.input,_=l.parameters!==void 0?l.parameters[g.output]:g.output;d.push(this.loadNode(b)),f.push(this.loadAccessor(T)),v.push(this.loadAccessor(_)),A.push(g),h.push(E)}i=Promise.all([Promise.all(d),Promise.all(f),Promise.all(v),Promise.all(A),Promise.all(h)]).then(function(S){for(var R=S[0],B=S[1],I=S[2],x=S[3],M=S[4],L=[],C=function(G,Q){var U=R[G],D=B[G],q=I[G],z=x[G],K=M[G];if(U===void 0)return"continue";U.updateMatrix(),U.matrixAutoUpdate=!0;var J=void 0;switch(PATH_PROPERTIES[K.path]){case PATH_PROPERTIES.weights:J=THREE__namespace.NumberKeyframeTrack;break;case PATH_PROPERTIES.rotation:J=THREE__namespace.QuaternionKeyframeTrack;break;case PATH_PROPERTIES.position:case PATH_PROPERTIES.scale:default:J=THREE__namespace.VectorKeyframeTrack;break}var j=U.name?U.name:U.uuid,re=z.interpolation!==void 0?INTERPOLATION[z.interpolation]:THREE__namespace.InterpolateLinear,W=[];PATH_PROPERTIES[K.path]===PATH_PROPERTIES.weights?U.traverse(function(se){se.morphTargetInfluences&&W.push(se.name?se.name:se.uuid)}):W.push(j);var te=q.array;if(q.normalized){for(var $=getNormalizedComponentScale(te.constructor),ne=new Float32Array(te.length),ee=0,ce=te.length;ee<ce;ee++)ne[ee]=te[ee]*$;te=ne}for(var ee=0,ce=W.length;ee<ce;ee++){var ae=new J(W[ee]+"."+PATH_PROPERTIES[K.path],D.array,te,re);L.push(ae)}},H=0,F=R.length;H<F;H++)C(H);var O=l.name?l.name:"animation_"+t;return new THREE__namespace.AnimationClip(O,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 o=null,s=0,u=values(this.extensions);s<u.length;s++){var c=u[s];if(o=c.loadBuffer(t,this),o)break}if(!o){var l=this.json.buffers[t];o=this.options.fetcher.ajax(this.resolveResouce(l.uri),{responseType:"arraybuffer"}).then(function(d){return d.body})}return this.cache.set(r,o),o},n.prototype.loadBufferView=function(t){var e="bufferView:"+t,r=this.cache.get(e);if(r)return r;for(var i=null,o=0,s=values(this.extensions);o<s.length;o++){var u=s[o];if(i=u.loadBufferView(t,this),i)break}if(!i){var c=this.json.bufferViews[t];i=this.loadBuffer(c.buffer).then(function(l){var d=c.byteLength||0,f=c.byteOffset||0;return l.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 o=null;if(!o){var s=this.json.accessors[t];if(s.bufferView===void 0&&s.sparse===void 0)o=Promise.resolve(null);else{var u=[];s.bufferView!==void 0?u.push(this.loadBufferView(s.bufferView)):u.push(Promise.resolve(null)),s.sparse!==void 0&&(u.push(this.loadBufferView(s.sparse.indices.bufferView)),u.push(this.loadBufferView(s.sparse.values.bufferView))),o=Promise.all(u).then(function(c){var l=c[0],d=WEBGL_TYPE_SIZES[s.type],f=WEBGL_COMPONENT_TYPES[s.componentType],v=f.BYTES_PER_ELEMENT,A=v*d,h=s.byteOffset||0,p=s.bufferView!==void 0?e.json.bufferViews[s.bufferView].byteStride:void 0,y=s.normalized===!0,m,g;if(p&&p!==A){var E=Math.floor(h/p),b="InterleavedBuffer:"+s.bufferView+":"+s.componentType+":"+E+":"+s.count,T=e.cache.get(b);T||(m=new f(l,E*p,s.count*p/v),T=new THREE__namespace.InterleavedBuffer(m,p/v),e.cache.set(b,T)),g=new THREE__namespace.InterleavedBufferAttribute(T,d,h%p/v,y)}else l===null?m=new f(s.count*d):m=new f(l,h,s.count*d),g=new THREE__namespace.BufferAttribute(m,d,y);if(s.sparse!==void 0){var _=WEBGL_TYPE_SIZES.SCALAR,S=WEBGL_COMPONENT_TYPES[s.sparse.indices.componentType],R=s.sparse.indices.byteOffset||0,B=s.sparse.values.byteOffset||0,I=new S(c[1],R,s.sparse.count*_),x=new f(c[2],B,s.sparse.count*d);l!==null&&(g=new THREE__namespace.BufferAttribute(g.array.slice(),g.itemSize,g.normalized));for(var M=0,L=I.length;M<L;M++){var C=I[M];if(g.setX(C,x[M*d]),d>=2&&g.setY(C,x[M*d+1]),d>=3&&g.setZ(C,x[M*d+2]),d>=4&&g.setW(C,x[M*d+3]),d>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return g})}}return this.cache.set(r,o),o},n.prototype.createPrimitiveKey=function(t){for(var e=0,r=values(this.extensions);e<r.length;e++){var i=r[e],o=i.createPrimitiveKey(t,this);if(o)return o}for(var s="",u=Object.keys(t.attributes).sort(),c=0,l=u.length;c<l;c++)s+=u[c]+":"+t.attributes[u[c]]+";";return t.indices+":"+s+":"+t.mode},n.prototype.loadGeometry=function(t){for(var e=this,r=null,i=0,o=values(this.extensions);i<o.length;i++){var s=o[i];if(r=s.loadGeometry(t,this),r)break}return r||(r=this.addGeometryPrimitiveAttributes(new THREE__namespace.BufferGeometry,t)),r=r.then(function(u){return e.disposeSet.add(u),u}),r},n.prototype.loadImage=function(t){for(var e=this,r=null,i=0,o=values(this.extensions);i<o.length;i++){var s=o[i];if(r=s.loadImage(t,this),r)break}if(!r){var u=this.json.images[t];if(u.bufferView!==void 0){var c=this.json.bufferViews[u.bufferView];r=this.loadBuffer(c.buffer).then(function(d){var f=c.byteOffset||0,v=c.byteLength||0,A=new Uint8Array(d,f,v),h=new Blob([A],{type:u.mimeType});return createImageBitmapLike(h)})}else if(u.uri){var l=this.resolveResouce(u.uri);r=this.options.fetcher.loadImage(l,{},void 0,void 0,void 0,createImageBitmapLikeImage()).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 THREE__namespace.MeshStandardMaterial;if(i.color=new THREE__namespace.Color(1,1,1),i.opacity=1,Object.keys(t.attributes).filter(function(d){return ATTRIBUTES[d]==="color"}).length>0&&(i.vertexColors=!0),Object.keys(t.attributes).filter(function(d){return ATTRIBUTES[d]==="normal"}).length===0&&(i.flatShading=!0),Object.keys(t.attributes).filter(function(d){return ATTRIBUTES[d]==="tangent"}).length===0&&(i.normalScale&&(i.normalScale.y*=-1),i.clearcoatNormalScale&&(i.clearcoatNormalScale.y*=-1)),t.material!==void 0){var o=this.json.materials[t.material];o.name&&(i.name=o.name);var s=o.pbrMetallicRoughness||{};if(Array.isArray(s.baseColorFactor)){var u=s.baseColorFactor;i.color.fromArray(u),i.opacity=u[3]}s.baseColorTexture!==void 0&&r.push(this.createMaterialTexture(s.baseColorTexture).then(function(d){d.encoding=THREE__namespace.sRGBEncoding,i.map=d,e.disposeSet.add(d)})),i.metalness=s.metallicFactor!==void 0?s.metallicFactor:1,i.roughness=s.roughnessFactor!==void 0?s.roughnessFactor:1,s.metallicRoughnessTexture!==void 0&&r.push(this.createMaterialTexture(s.metallicRoughnessTexture).then(function(d){d.encoding=THREE__namespace.sRGBEncoding,i.metalnessMap=d,i.roughnessMap=d,e.disposeSet.add(d)})),o.doubleSided===!0&&(i.side=THREE__namespace.DoubleSide);var c=o.alphaMode||ALPHA_MODES.OPAQUE;if(c===ALPHA_MODES.BLEND?(i.transparent=!0,i.depthWrite=!1):(i.transparent=!1,c===ALPHA_MODES.MASK&&(i.alphaTest=o.alphaCutoff!==void 0?o.alphaCutoff:.5)),o.normalTexture!==void 0&&(r.push(this.createMaterialTexture(o.normalTexture).then(function(d){i.normalMap=d,e.disposeSet.add(d)})),i.normalScale=new THREE__namespace.Vector2(1,1),o.normalTexture.scale!==void 0)){var l=o.normalTexture.scale;i.normalScale.set(l,l)}o.occlusionTexture!==void 0&&(r.push(this.createMaterialTexture(o.occlusionTexture).then(function(d){i.aoMap=d,e.disposeSet.add(d)})),o.occlusionTexture.strength!==void 0&&(i.aoMapIntensity=o.occlusionTexture.strength)),o.emissiveFactor!==void 0&&(i.emissive=new THREE__namespace.Color().fromArray(o.emissiveFactor)),o.emissiveTexture!==void 0&&r.push(this.createMaterialTexture(o.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 THREE__namespace.LineBasicMaterial;if(r.color=new THREE__namespace.Color(1,1,1),r.opacity=1,Object.keys(t.attributes).filter(function(c){return ATTRIBUTES[c]==="color"}).length>0&&(r.vertexColors=!0),Object.keys(t.attributes).filter(function(c){return ATTRIBUTES[c]==="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 o=i.pbrMetallicRoughness||{};if(Array.isArray(o.baseColorFactor)){var s=o.baseColorFactor;r.color.fromArray(s),r.opacity=s[3]}i.doubleSided===!0&&(r.side=THREE__namespace.DoubleSide);var u=i.alphaMode||ALPHA_MODES.OPAQUE;u===ALPHA_MODES.BLEND?(r.transparent=!0,r.depthWrite=!1):(r.transparent=!1,u===ALPHA_MODES.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 THREE__namespace.PointsMaterial;if(i.color=new THREE__namespace.Color(1,1,1),i.opacity=1,i.sizeAttenuation=!1,Object.keys(t.attributes).filter(function(l){return ATTRIBUTES[l]==="color"}).length>0&&(i.vertexColors=!0),Object.keys(t.attributes).filter(function(l){return ATTRIBUTES[l]==="tangent"}).length===0&&(i.normalScale&&(i.normalScale.y*=-1),i.clearcoatNormalScale&&(i.clearcoatNormalScale.y*=-1)),t.material!==void 0){var o=this.json.materials[t.material];o.name&&(i.name=o.name);var s=o.pbrMetallicRoughness||{};if(Array.isArray(s.baseColorFactor)){var u=s.baseColorFactor;i.color.fromArray(u),i.opacity=u[3]}s.baseColorTexture!==void 0&&r.push(this.createMaterialTexture(s.baseColorTexture).then(function(l){l.encoding=THREE__namespace.sRGBEncoding,i.map=l,e.disposeSet.add(l)})),o.doubleSided===!0&&(i.side=THREE__namespace.DoubleSide);var c=o.alphaMode||ALPHA_MODES.OPAQUE;c===ALPHA_MODES.BLEND?(i.transparent=!0,i.depthWrite=!1):(i.transparent=!1,c===ALPHA_MODES.MASK&&(i.alphaTest=o.alphaCutoff!==void 0?o.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:WEBGL_CONSTANTS.TRIANGLES,i="material:"+this.createPrimitiveKey(t),o=this.cache.get(i);if(o)return o;for(var s=null,u=0,c=values(this.extensions);u<c.length;u++){var l=c[u];if(s=l.loadMaterial(t,this),s)break}if(r===WEBGL_CONSTANTS.TRIANGLES||r===WEBGL_CONSTANTS.TRIANGLE_STRIP||r===WEBGL_CONSTANTS.TRIANGLE_FAN)s=this.loadMaterialAsMeshStandardMaterial(t);else if(r===WEBGL_CONSTANTS.LINES||r===WEBGL_CONSTANTS.LINE_STRIP||r===WEBGL_CONSTANTS.LINE_LOOP)s=this.loadMaterialAsLineBasicMaterial(t);else if(r===WEBGL_CONSTANTS.POINTS)s=this.loadMaterialAsPointsMaterial(t);else throw new Error("glTF: Primitive mode unsupported: "+r);return this.cache.set(i,s),s},n.prototype.loadTexture=function(t){var e=this,r="texture:"+t,i=this.cache.get(r);if(i)return i;for(var o=null,s=0,u=values(this.extensions);s<u.length;s++){var c=u[s];if(o=c.loadTexture(t,this),o)break}if(!o){var l=this.json.textures[t];o=this.loadImage(l.source).then(function(d){var f=new THREE__namespace.Texture(d);f.needsUpdate=!0,f.flipY=!1,l.name&&(f.name=l.name);var v=e.json.samplers||{},A=v[l.sampler]||{};return f.magFilter=WEBGL_FILTERS[A.magFilter]||THREE__namespace.LinearFilter,f.minFilter=WEBGL_FILTERS[A.minFilter]||THREE__namespace.LinearMipmapLinearFilter,f.wrapS=WEBGL_WRAPPINGS[A.wrapS]||THREE__namespace.RepeatWrapping,f.wrapT=WEBGL_WRAPPINGS[A.wrapT]||THREE__namespace.RepeatWrapping,f.onUpdate=function(){d.close()},f})}return o=o.then(function(d){return e.disposeSet.add(d),d}),this.cache.set(r,o),o},n.prototype.loadMesh=function(t){for(var e=this,r=null,i=0,o=values(this.extensions);i<o.length;i++){var s=o[i];if(r=s.loadMesh(t,this),r)break}if(!r){var u=this.json.meshes[t],c=u.primitives,l=Promise.all(c.map(function(f){return e.loadGeometry(f)})),d=Promise.all(c.map(function(f){return e.loadMaterial(f)}));r=Promise.all([l,d]).then(function(f){for(var v=f[0],A=f[1],h=[],p=0;p<c.length;p++){var y=c[p],m=v[p],g=A[p],E=y.mode||WEBGL_CONSTANTS.TRIANGLES,b=void 0;if(E===WEBGL_CONSTANTS.TRIANGLES||E===WEBGL_CONSTANTS.TRIANGLE_STRIP||E===WEBGL_CONSTANTS.TRIANGLE_FAN)if(E===WEBGL_CONSTANTS.TRIANGLE_STRIP?m=e.toGeometryTrianglesDrawMode(m,THREE__namespace.TriangleStripDrawMode):E===WEBGL_CONSTANTS.TRIANGLE_FAN&&(m=e.toGeometryTrianglesDrawMode(m,THREE__namespace.TriangleFanDrawMode)),e.disposeSet.add(m),u.isSkinnedMesh){var T=new THREE__namespace.SkinnedMesh(m,g);m.attributes.skinWeight.normalized||T.normalizeSkinWeights(),b=T}else b=new THREE__namespace.Mesh(m,g);else if(E===WEBGL_CONSTANTS.POINTS)b=new THREE__namespace.Points(m,g);else if(E===WEBGL_CONSTANTS.LINES)b=new THREE__namespace.LineSegments(m,g);else if(E===WEBGL_CONSTANTS.LINE_STRIP)b=new THREE__namespace.Line(m,g);else if(E===WEBGL_CONSTANTS.LINE_LOOP)b=new THREE__namespace.LineLoop(m,g);else throw new Error("glTF: Primitive mode unsupported: "+E);if(Object.keys(m.morphAttributes).length>0){if(u.weights!==void 0)for(var _=0,S=u.weights.length;_<S;_++)b.morphTargetInfluences[_]=u.weights[_];if(u.extras&&Array.isArray(u.extras.targetNames)){var R=u.extras.targetNames;if(b.morphTargetInfluences.length===R.length){b.morphTargetDictionary={};for(var _=0,S=R.length;_<S;_++)b.morphTargetDictionary[R[_]]=_}else console.warn("glTF: Invalid extras.targetNames length. Ignoring names.")}}b.name=e.createUniqueName(u.name||"mesh_"+t),h.push(b)}if(h.length===1)return h[0];for(var B=new THREE__namespace.Group,I=0,x=h;I<x.length;I++){var b=x[I];B.add(b)}return B})}return r},n.prototype.loadNodeAttachments=function(t){for(var e=[],r=0,i=values(this.extensions);r<i.length;r++){var o=i[r],s=o.loadNodeAttachments(t,this);s&&e.push(s)}return e},n.prototype.loadNode=function(t){var e="node:"+t,r=this.cache.get(e);if(r)return r;var i=this.json,o=i.nodes[t],s=o.name?this.createUniqueName(o.name):"",u=[];o.mesh!==void 0&&u.push(this.loadMesh(o.mesh).then(function(v){if(o.weights!==void 0){var A=o.weights;v.traverse(function(h){if(h instanceof THREE__namespace.Mesh||h instanceof THREE__namespace.Line||h instanceof THREE__namespace.Points)for(var p=0,y=A.length;p<y;p++)h.morphTargetInfluences[p]=A[p]})}return v})),o.camera!==void 0&&u.push(this.loadCamera(o.camera));for(var c=this.loadNodeAttachments(t),l=0,d=c;l<d.length;l++){var f=d[l];u.push(f)}return Promise.all(u).then(function(v){var A;if(o.isBone===!0?A=new THREE__namespace.Bone:v.length>1?A=new THREE__namespace.Group:v.length===1?A=v[0]:A=new THREE__namespace.Object3D,A!==v[0])for(var h=0,p=v.length;h<p;h++)A.add(v[h]);if(o.name&&(A.name=s),o.matrix!==void 0){var y=new THREE__namespace.Matrix4;y.fromArray(o.matrix),A.applyMatrix4(y)}else o.translation!==void 0&&A.position.fromArray(o.translation),o.rotation!==void 0&&A.quaternion.fromArray(o.rotation),o.scale!==void 0&&A.scale.fromArray(o.scale);return A})},n.prototype.loadScene=function(t){var e=this.json,r=e.scenes[t],i=new THREE__namespace.Group;r.name&&(i.name=this.createUniqueName(r.name));for(var o=r.nodes||[],s=[],u=0,c=o.length;u<c;u++)s.push(this.buildNodeHierarchy(o[u],i));return Promise.all(s).then(function(){return i})},n.prototype.createMaterialTexture=function(t){var e=this;return this.loadTexture(t.index).then(function(r){for(var i=0,o=values(e.extensions);i<o.length;i++){var s=o[i],u=s.extendTexture(r,t,e);u&&(r=u,e.disposeSet.add(r))}return e.textureSet.add(r),r})},n.prototype.addGeometryPrimitiveAttributes=function(t,e){var r=this,i=e.attributes,o=[],s=function(T){var _=ATTRIBUTES[T]||T.toLowerCase();if(_ in t.attributes)return"continue";o.push(u.loadAccessor(i[T]).then(function(S){S&&t.setAttribute(_,S)}))},u=this;for(var c in i)s(c);e.indices!==void 0&&!t.index&&o.push(this.loadAccessor(e.indices).then(function(T){T&&t.setIndex(T)}));var l=new THREE__namespace.Box3;if(i.POSITION!==void 0){var d=this.json.accessors[i.POSITION],f=d.min,v=d.max;if(f!==void 0&&v!==void 0){if(l.set(new THREE__namespace.Vector3(f[0],f[1],f[2]),new THREE__namespace.Vector3(v[0],v[1],v[2])),d.normalized){var A=getNormalizedComponentScale(WEBGL_COMPONENT_TYPES[d.componentType]);l.min.multiplyScalar(A),l.max.multiplyScalar(A)}}else console.warn("glTF: Missing min/max properties for accessor POSITION.")}var h=e.targets;if(h!==void 0){for(var p=new THREE__namespace.Vector3,y=new THREE__namespace.Vector3,m=0,g=h.length;m<g;m++){var E=h[m];if(E.POSITION!==void 0){var d=this.json.accessors[E.POSITION],f=d.min,v=d.max;if(f!==void 0&&v!==void 0){if(y.setX(Math.max(Math.abs(f[0]),Math.abs(v[0]))),y.setY(Math.max(Math.abs(f[1]),Math.abs(v[1]))),y.setZ(Math.max(Math.abs(f[2]),Math.abs(v[2]))),d.normalized){var A=getNormalizedComponentScale(WEBGL_COMPONENT_TYPES[d.componentType]);y.multiplyScalar(A)}p.max(y)}else console.warn("glTF: Missing min/max properties for accessor POSITION.")}}l.expandByVector(p)}t.boundingBox=l;var b=new THREE__namespace.Sphere;return l.getCenter(b.center),b.radius=l.min.distanceTo(l.max)/2,t.boundingSphere=b,Promise.all(o).then(function(){if(t.attributes.uv&&!t.attributes.uv2&&r.options.copyUV2&&t.setAttribute("uv2",t.attributes.uv),e.targets){for(var T=!1,_=!1,S=0,R=e.targets.length;S<R;S++){var B=e.targets[S];if(B.POSITION!==void 0&&(T=!0),B.NORMAL!==void 0&&(_=!0),T&&_)break}if(!T&&!_)return t;var I=[];t.morphTargetsRelative=!0;for(var x=function(M,L){var C=e.targets[M];T?I.push(r.loadAccessor(C.POSITION).then(function(H){H&&(t.morphAttributes.position[M]=H)})):t.morphAttributes.position[M]=t.attributes.position,_?I.push(r.loadAccessor(C.NORMAL).then(function(H){H&&(t.morphAttributes.normal[M]=H)})):t.morphAttributes.normal[M]=t.attributes.normal},S=0,R=e.targets.length;S<R;S++)x(S,R);return Promise.all(I).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(o){if(i.skin===void 0)return o;var s;return r.loadSkin(i.skin).then(function(u){s=u;for(var c=[],l=0,d=s.joints.length;l<d;l++)c.push(r.loadNode(s.joints[l]));return Promise.all(c)}).then(function(u){return o.traverse(function(c){if(c instanceof THREE__namespace.SkinnedMesh){for(var l=[],d=[],f=0,v=u.length;f<v;f++){var A=u[f];if(A instanceof THREE__namespace.Bone){l.push(A);var h=new THREE__namespace.Matrix4;s.inverseBindMatrices!==void 0&&h.fromArray(s.inverseBindMatrices.array,f*16),d.push(h)}else console.warn('glTF: Joint "%s" could not be found.',s.joints[f])}c.bind(new THREE__namespace.Skeleton(l,d),c.matrixWorld)}}),o})}).then(function(o){e.add(o);var s=[];if(i.children)for(var u=i.children,c=0,l=u.length;c<l;c++){var d=u[c];s.push(r.buildNodeHierarchy(d,o))}return Promise.all(s).then(function(){return o})})},n.prototype.createUniqueName=function(t){for(var e=THREE__namespace.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 pathJoin(this.options.resourcePath,appendSearch(t,this.options.search))},n.prototype.toGeometryTrianglesDrawMode=function(t,e){var r=t.getIndex();if(r===null){var i=[],o=t.getAttribute("position");if(o!==void 0){for(var s=0;s<o.count;s++)i.push(s);t.setIndex(i),r=t.getIndex()}}if(r===null)return console.error("glTF: Undefined position attribute. Processing not possible."),t;var u=r.count-2,c=[];if(e===THREE__namespace.TriangleFanDrawMode)for(var s=1;s<=u;s++)c.push(r.getX(0)),c.push(r.getX(s)),c.push(r.getX(s+1));else for(var s=0;s<u;s++)s%2===0?(c.push(r.getX(s)),c.push(r.getX(s+1)),c.push(r.getX(s+2))):(c.push(r.getX(s+2)),c.push(r.getX(s+1)),c.push(r.getX(s)));c.length/3!==u&&console.error("glTF: Unable to generate correct amount of triangles.");var l=t.clone();return l.setIndex(c),this.disposeSet.add(l),l},n}();function getNormalizedComponentScale(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 BaseExtension=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}(),KHR_binary_glTF=function(n){__extends(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 decodeText(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),o=0,s=null,u=null;o<i.byteLength;){var c=i.getUint32(o,!0);if(o+=4,c!==0){var l=i.getUint32(o,!0);if(o+=4,l===t.CHUNK_TYPES.JSON){var d=new Uint8Array(e,t.HEADER_LENGTH+o,c);s=decodeText(d)}else if(l===t.CHUNK_TYPES.BIN){var f=t.HEADER_LENGTH+o;u=e.slice(f,f+c)}o+=c}}if(s===null)throw new Error("glTF:KHR_binary_glTF: JSON content not found.");this.content=s,this.body=u},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}(BaseExtension),defaultDecoderPath="https://vr-public.realsee-cdn.cn/release/static/image/release/five/resource/draco/1.5.6/",defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"},Draco=function(){function n(){this.decoderPath=defaultDecoderPath,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 o={attributeIDs:r||defaultAttributeIDs,attributeTypes:i||defaultAttributeTypes,useUniqueIDs:!!r};this.decodeGeometry(t,o).then(e)},n.prototype.decodeGeometry=function(t,e){var r=this;e===void 0&&(e={attributeIDs:defaultAttributeIDs,attributeTypes:defaultAttributeTypes,useUniqueIDs:!1});for(var i in e.attributeTypes){var o=e.attributeTypes[i];o.BYTES_PER_ELEMENT!==void 0&&(e.attributeTypes[i]=o.name)}var s,u=this.workerNextTaskID++,c=t.byteLength,l=this._getWorker(u,c).then(function(d){return s=d,new Promise(function(f,v){s._callbacks[u]={resolve:f,reject:v},s.postMessage({type:"decode",id:u,taskConfig:e,buffer:t},[t])})}).then(function(d){return r._createGeometry(d.geometry)});return l.catch(function(){return!0}).then(function(){s&&u&&r._releaseTask(s,u)}),l},n.prototype._createGeometry=function(t){var e=new THREE__namespace.BufferGeometry;t.index&&e.setIndex(new THREE__namespace.BufferAttribute(t.index.array,1));for(var r=0;r<t.attributes.length;r++){var i=t.attributes[r],o=i.name,s=i.array,u=i.itemSize;e.setAttribute(o,new THREE__namespace.BufferAttribute(s,u))}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=ajax(this.decoderPath+"draco_decoder.js",{responseType:"text"}).then(function(o){return o.body});this.decoderPending=r.then(function(o){var s=["/* draco decoder */",o,"","/* worker */",DRACOWorker].join(`
418
+ `);t.workerSourceURL=URL.createObjectURL(new Blob([s]))})}else{var r=ajax(this.decoderPath+"draco_wasm_wrapper.js",{responseType:"text"}).then(function(s){return s.body}),i=ajax(this.decoderPath+"draco_decoder.wasm",{responseType:"arraybuffer"}).then(function(s){return s.body});this.decoderPending=Promise.all([r,i]).then(function(s){var u=s[0],c=s[1];t.decoderConfig.wasmBinary=c;var l=["/* draco decoder */",u,"","/* worker */",DRACOWorker].join(`
419
+ `);t.workerSourceURL=URL.createObjectURL(new Blob([l]))})}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(s){var u=s.data;switch(u.type){case"decode":i._callbacks[u.id].resolve(u);break;case"error":i._callbacks[u.id].reject(u);break;default:console.error('DRACO: Unexpected message, "'+u.type+'"')}},r.workerPool.push(i)}else r.workerPool.sort(function(s,u){return s._taskLoad>u._taskLoad?-1:1});var o=r.workerPool[r.workerPool.length-1];return o._taskCosts[t]=e,o._taskLoad+=e,o})},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}(),draco=new Draco,DRACOWorker=`
420
420
  let decoderConfig;
421
421
  let decoderPending;
422
422
 
@@ -611,8 +611,8 @@ void main() {
611
611
  }
612
612
 
613
613
  }
614
- `,EXTENSION_NAME$5="KHR_draco_mesh_compression",KHR_draco_mesh_compression=function(n){__extends(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadGeometry=function(e,r){return e.extensions&&e.extensions[EXTENSION_NAME$5]?this.decodePrimitive(e,r).then(function(i){return r.addGeometryPrimitiveAttributes(i,e)}):null},t.prototype.decodePrimitive=function(e,r){var i=r.json,o=e.extensions[EXTENSION_NAME$5].bufferView,s=e.extensions[EXTENSION_NAME$5].attributes,u={},l={},c={};for(var d in s){var f=ATTRIBUTES[d]||d.toLowerCase();u[f]=s[d]}for(var d in e.attributes){var f=ATTRIBUTES[d]||d.toLowerCase();if(s[d]!==void 0){var m=i.accessors[e.attributes[d]],A=WEBGL_COMPONENT_TYPES[m.componentType];c[f]=A,l[f]=m.normalized===!0}}return r.loadBufferView(o).then(function(h){return new Promise(function(p){draco.decodeDracoFile(h,function(y){for(var v in y.attributes){var g=y.attributes[v],E=l[v];E!==void 0&&(g.normalized=E)}p(y)},u,c)})})},t}(BaseExtension),WorkerPool=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(),o=i.resolve,s=i.msg,u=i.transfer;this.workersResolve[t]=o,this.workers[t].postMessage(s,u)}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 o=r._getIdleWorker();o!==-1?(r._initWorker(o),r.workerStatus|=1<<o,r.workersResolve[o]=i,r.workers[o].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}(),defaultTranscoderPath="https://vr-public.realsee-cdn.cn/release/static/image/release/five/resource/basis/1.16/",KTX2TransferSRGB=2,KTX2_ALPHA_PREMULTIPLIED=1,KTX2=function(){function n(){this.transcoderPath=defaultTranscoderPath,this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new WorkerPool(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=ajax(this.transcoderPath+"basis_transcoder.js",{responseType:"text"}).then(function(i){return i.body}),r=ajax(this.transcoderPath+"basis_transcoder.wasm",{responseType:"arraybuffer"}).then(function(i){return i.body});this.transcoderPending=Promise.all([e,r]).then(function(i){var o=i[0],s=i[1],u=["/* constants */","let _EngineFormat = "+JSON.stringify(EngineFormat),"let _TranscoderFormat = "+JSON.stringify(TranscoderFormat),"let _BasisFormat = "+JSON.stringify(BasisFormat),"/* basis_transcoder.js */",o,"/* worker */",BasisWorker].join(`
615
- `);t.workerSourceURL=URL.createObjectURL(new Blob([u])),t.transcoderBinary=s,t.workerPool.setWorkerCreator(function(){var l=new Worker(t.workerSourceURL),c=t.transcoderBinary.slice(0);return l.postMessage({type:"init",config:t.workerConfig,transcoderBinary:c},[c]),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,o=t.format,s=t.type,u=t.error,l=t.dfdTransferFn,c=t.dfdFlags;if(s==="error")return Promise.reject(u);var d=new THREE__namespace.CompressedTexture(e,r,i,o,THREE__namespace.UnsignedByteType);return d.minFilter=e.length===1?THREE__namespace.LinearFilter:THREE__namespace.LinearMipmapLinearFilter,d.magFilter=THREE__namespace.LinearFilter,d.generateMipmaps=!1,d.needsUpdate=!0,d.encoding=l===KTX2TransferSRGB?THREE__namespace.sRGBEncoding:THREE__namespace.LinearEncoding,d.premultiplyAlpha=!!(c&KTX2_ALPHA_PREMULTIPLIED),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}(),ktx2=new KTX2,BasisFormat={ETC1S:0,UASTC_4x4:1},TranscoderFormat={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},EngineFormat={RGBAFormat:THREE__namespace.RGBAFormat,RGBA_ASTC_4x4_Format:THREE__namespace.RGBA_ASTC_4x4_Format,RGBA_BPTC_Format:THREE__namespace.RGBA_BPTC_Format,RGBA_ETC2_EAC_Format:THREE__namespace.RGBA_ETC2_EAC_Format,RGBA_PVRTC_4BPPV1_Format:THREE__namespace.RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT5_Format:THREE__namespace.RGBA_S3TC_DXT5_Format,RGB_ETC1_Format:THREE__namespace.RGB_ETC1_Format,RGB_ETC2_Format:THREE__namespace.RGB_ETC2_Format,RGB_PVRTC_4BPPV1_Format:THREE__namespace.RGB_PVRTC_4BPPV1_Format,RGB_S3TC_DXT1_Format:THREE__namespace.RGB_S3TC_DXT1_Format},BasisWorker=`
614
+ `,EXTENSION_NAME$5="KHR_draco_mesh_compression",KHR_draco_mesh_compression=function(n){__extends(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadGeometry=function(e,r){return e.extensions&&e.extensions[EXTENSION_NAME$5]?this.decodePrimitive(e,r).then(function(i){return r.addGeometryPrimitiveAttributes(i,e)}):null},t.prototype.decodePrimitive=function(e,r){var i=r.json,o=e.extensions[EXTENSION_NAME$5].bufferView,s=e.extensions[EXTENSION_NAME$5].attributes,u={},c={},l={};for(var d in s){var f=ATTRIBUTES[d]||d.toLowerCase();u[f]=s[d]}for(var d in e.attributes){var f=ATTRIBUTES[d]||d.toLowerCase();if(s[d]!==void 0){var v=i.accessors[e.attributes[d]],A=WEBGL_COMPONENT_TYPES[v.componentType];l[f]=A,c[f]=v.normalized===!0}}return r.loadBufferView(o).then(function(h){return new Promise(function(p){draco.decodeDracoFile(h,function(y){for(var m in y.attributes){var g=y.attributes[m],E=c[m];E!==void 0&&(g.normalized=E)}p(y)},u,l)})})},t}(BaseExtension),WorkerPool=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(),o=i.resolve,s=i.msg,u=i.transfer;this.workersResolve[t]=o,this.workers[t].postMessage(s,u)}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 o=r._getIdleWorker();o!==-1?(r._initWorker(o),r.workerStatus|=1<<o,r.workersResolve[o]=i,r.workers[o].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}(),defaultTranscoderPath="https://vr-public.realsee-cdn.cn/release/static/image/release/five/resource/basis/1.16/",KTX2TransferSRGB=2,KTX2_ALPHA_PREMULTIPLIED=1,KTX2=function(){function n(){this.transcoderPath=defaultTranscoderPath,this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new WorkerPool(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=ajax(this.transcoderPath+"basis_transcoder.js",{responseType:"text"}).then(function(i){return i.body}),r=ajax(this.transcoderPath+"basis_transcoder.wasm",{responseType:"arraybuffer"}).then(function(i){return i.body});this.transcoderPending=Promise.all([e,r]).then(function(i){var o=i[0],s=i[1],u=["/* constants */","let _EngineFormat = "+JSON.stringify(EngineFormat),"let _TranscoderFormat = "+JSON.stringify(TranscoderFormat),"let _BasisFormat = "+JSON.stringify(BasisFormat),"/* basis_transcoder.js */",o,"/* worker */",BasisWorker].join(`
615
+ `);t.workerSourceURL=URL.createObjectURL(new Blob([u])),t.transcoderBinary=s,t.workerPool.setWorkerCreator(function(){var c=new Worker(t.workerSourceURL),l=t.transcoderBinary.slice(0);return c.postMessage({type:"init",config:t.workerConfig,transcoderBinary:l},[l]),c})})}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,o=t.format,s=t.type,u=t.error,c=t.dfdTransferFn,l=t.dfdFlags;if(s==="error")return Promise.reject(u);var d=new THREE__namespace.CompressedTexture(e,r,i,o,THREE__namespace.UnsignedByteType);return d.minFilter=e.length===1?THREE__namespace.LinearFilter:THREE__namespace.LinearMipmapLinearFilter,d.magFilter=THREE__namespace.LinearFilter,d.generateMipmaps=!1,d.needsUpdate=!0,d.encoding=c===KTX2TransferSRGB?THREE__namespace.sRGBEncoding:THREE__namespace.LinearEncoding,d.premultiplyAlpha=!!(l&KTX2_ALPHA_PREMULTIPLIED),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}(),ktx2=new KTX2,BasisFormat={ETC1S:0,UASTC_4x4:1},TranscoderFormat={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},EngineFormat={RGBAFormat:THREE__namespace.RGBAFormat,RGBA_ASTC_4x4_Format:THREE__namespace.RGBA_ASTC_4x4_Format,RGBA_BPTC_Format:THREE__namespace.RGBA_BPTC_Format,RGBA_ETC2_EAC_Format:THREE__namespace.RGBA_ETC2_EAC_Format,RGBA_PVRTC_4BPPV1_Format:THREE__namespace.RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT5_Format:THREE__namespace.RGBA_S3TC_DXT5_Format,RGB_ETC1_Format:THREE__namespace.RGB_ETC1_Format,RGB_ETC2_Format:THREE__namespace.RGB_ETC2_Format,RGB_PVRTC_4BPPV1_Format:THREE__namespace.RGB_PVRTC_4BPPV1_Format,RGB_S3TC_DXT1_Format:THREE__namespace.RGB_S3TC_DXT1_Format},BasisWorker=`
616
616
 
617
617
  let config;
618
618
  let transcoderPending;
@@ -880,7 +880,7 @@ void main() {
880
880
  return ( value & ( value - 1 ) ) === 0 && value !== 0;
881
881
 
882
882
  }
883
- `,EXTENSION_NAME$4="KHR_texture_basisu",KHR_texture_basisu=function(n){__extends(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[EXTENSION_NAME$4])return null;var o=i.extensions[EXTENSION_NAME$4],s=r.json.images[o.source],u=null;if(s.bufferView!==void 0)u=r.loadBufferView(s.bufferView).then(function(l){return ktx2.parse(l)});else if(s.uri)u=r.options.fetcher.ajax(r.resolveResouce(s.uri),{responseType:"arraybuffer"}).then(function(l){return ktx2.parse(l.body)});else throw new Error("glTF: Invalid image defs.");return u},t}(BaseExtension),EXTENSION_NAME$3="KHR_texture_transform",KHR_texture_transform=function(n){__extends(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.extendTexture=function(e,r,i){var o=r.extensions!==void 0?r.extensions[EXTENSION_NAME$3]:void 0;return o?(o.texCoord!==void 0&&console.warn('glTF: Custom UV sets in "'+EXTENSION_NAME$3+'" extension not yet supported.'),o.offset===void 0&&o.rotation===void 0&&o.scale===void 0||(e=e.clone(),e.needsUpdate=!0,o.offset!==void 0&&e.offset.fromArray(o.offset),o.rotation!==void 0&&(e.rotation=o.rotation),o.scale!==void 0&&e.repeat.fromArray(o.scale)),e):null},t}(BaseExtension),KHR_mesh_quantization=function(n){__extends(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(BaseExtension),KHR_materials_unlit=function(n){__extends(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(BaseExtension),meshoptDecoder=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,o,s=WebAssembly.instantiate(u(i),{}).then(function(v){o=v.instance,o.exports.__wasm_call_ctors()});function u(v){for(var g=new Uint8Array(v.length),E=0;E<v.length;++E){var b=v.charCodeAt(E);g[E]=b>96?b-97:b>64?b-39:b+4}for(var T=0,E=0;E<v.length;++E)g[T++]=g[E]<60?r[g[E]]:(g[E]-60)*64+g[++E];return g.buffer.slice(0,T)}function l(v,g,E,b,T,_){var x=o.exports.sbrk,R=E+3&-4,w=x(R*b),S=x(T.length),C=new Uint8Array(o.exports.memory.buffer);C.set(T,S);var I=v(w,E,b,S,T.length);if(I==0&&_&&_(w,R,b),g.set(C.subarray(w,w+E*b)),x(w-x(0)),I!=0)throw new Error("Malformed buffer data: "+I)}var c={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},d={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},f=[],m=0;function A(v){var g={object:new Worker(v),pending:0,requests:{}};return g.object.onmessage=function(E){var b=E.data;g.pending-=b.count,g.requests[b.id][b.action](b.value),delete g.requests[b.id]},g}function h(v){for(var g="var instance; var ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(u(i))+"]), {}).then(function(result) { instance = result.instance; instance.exports.__wasm_call_ctors(); });self.onmessage = workerProcess;"+l.toString()+y.toString(),E=new Blob([g],{type:"text/javascript"}),b=URL.createObjectURL(E),T=0;T<v;++T)f[T]=A(b);URL.revokeObjectURL(b)}function p(v,g,E,b,T){for(var _=f[0],x=1;x<f.length;++x)f[x].pending<_.pending&&(_=f[x]);return new Promise(function(R,w){var S=new Uint8Array(E),C=m++;_.pending+=v,_.requests[C]={resolve:R,reject:w},_.object.postMessage({id:C,count:v,size:g,source:S,mode:b,filter:T},[S.buffer])})}function y(v){s.then(function(){var g=v.data;try{var E=new Uint8Array(g.count*g.size);l(o.exports[g.mode],E,g.count,g.size,g.source,o.exports[g.filter]),self.postMessage({id:g.id,count:g.count,action:"resolve",value:E},[E.buffer])}catch(b){self.postMessage({id:g.id,count:g.count,action:"reject",value:b})}})}return{ready:s,supported:!0,useWorkers:function(v){h(v)},decodeVertexBuffer:function(v,g,E,b,T){l(o.exports.meshopt_decodeVertexBuffer,v,g,E,b,o.exports[c[T]])},decodeIndexBuffer:function(v,g,E,b){l(o.exports.meshopt_decodeIndexBuffer,v,g,E,b)},decodeIndexSequence:function(v,g,E,b){l(o.exports.meshopt_decodeIndexSequence,v,g,E,b)},decodeGltfBuffer:function(v,g,E,b,T,_){l(o.exports[d[T]],v,g,E,b,o.exports[c[_]])},decodeGltfBufferAsync:function(v,g,E,b,T){return f.length>0?p(v,g,E,d[b],c[T]):s.then(function(){var _=new Uint8Array(v*g);return l(o.exports[d[b]],_,v,g,E,o.exports[c[T]]),_})}}}(),EXTENSION_NAME$2="EXT_meshopt_compression",EXT_meshopt_compression=function(n){__extends(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadBufferView=function(e,r){var i=r.json,o=i.bufferViews[e];if(o.extensions&&o.extensions[EXTENSION_NAME$2]){var s=o.extensions[EXTENSION_NAME$2],u=r.loadBuffer(s.buffer);if(!meshoptDecoder.supported){if(i.extensionsRequired&&i.extensionsRequired.indexOf(EXTENSION_NAME$2)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([u,meshoptDecoder.ready]).then(function(l){var c=l[0],d=s.byteOffset||0,f=s.byteLength||0,m=s.count,A=s.byteStride,h=new ArrayBuffer(m*A),p=new Uint8Array(c,d,f);return meshoptDecoder.decodeGltfBuffer(new Uint8Array(h),m,A,p,s.mode,s.filter),h})}else return null},t}(BaseExtension),EXTENSION_NAME$1="EXT_texture_webp",EXT_texture_webp=function(n){__extends(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 imageSupport().then(function(i){r.supportsWep=i.webp})},t.prototype.loadTexture=function(e,r){var i=r.json,o=i.textures[e];if(!o.extensions||!o.extensions[EXTENSION_NAME$1]||!this.supportsWep)return null;var s=o.extensions[EXTENSION_NAME$1];return r.loadImage(s.source).then(function(u){var l=new THREE__namespace.Texture(u);l.needsUpdate=!0,l.flipY=!1,o.name&&(l.name=o.name);var c=r.json.samplers||{},d=c[o.sampler]||{};return l.magFilter=WEBGL_FILTERS[d.magFilter]||THREE__namespace.LinearFilter,l.minFilter=WEBGL_FILTERS[d.minFilter]||THREE__namespace.LinearMipmapLinearFilter,l.wrapS=WEBGL_WRAPPINGS[d.wrapS]||THREE__namespace.RepeatWrapping,l.wrapT=WEBGL_WRAPPINGS[d.wrapT]||THREE__namespace.RepeatWrapping,l.onUpdate=function(){u.close()},l})},t}(BaseExtension),EXTENSION_NAME="CESIUM_RTC",CESIUM_RTC=function(n){__extends(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.emitResult=function(e,r){if(r.json.extensions[EXTENSION_NAME]&&r.json.extensions[EXTENSION_NAME].center){var i=r.json.extensions[EXTENSION_NAME].center;e.CESIUM_RTC={center:new THREE__namespace.Vector3().fromArray(i)}}},t}(BaseExtension),PBM_mesh=function(n){__extends(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadMesh=function(e,r){var i=this,o=r.json.meshes[e],s=o.primitives,u=Promise.all(s.map(function(d){return r.loadGeometry(d)})),l=Promise.all(s.map(function(d){return i.loadPBMMaterial(d,r)})),c=Promise.all([u,l]).then(function(d){for(var f=d[0],m=d[1],A=[],h=0;h<s.length;h++){var p=s[h],y=f[h],v=m[h];y.attributes.normal===void 0&&(v.flatShading=!0),y.attributes.tangent===void 0&&v.normalScale&&(v.normalScale.y*=-1);var g=p.mode||WEBGL_CONSTANTS.TRIANGLES,E=void 0;if(g===WEBGL_CONSTANTS.TRIANGLES||g===WEBGL_CONSTANTS.TRIANGLE_STRIP||g===WEBGL_CONSTANTS.TRIANGLE_FAN)g===WEBGL_CONSTANTS.TRIANGLE_STRIP?y=r.toGeometryTrianglesDrawMode(y,THREE__namespace.TriangleStripDrawMode):g===WEBGL_CONSTANTS.TRIANGLE_FAN&&(y=r.toGeometryTrianglesDrawMode(y,THREE__namespace.TriangleFanDrawMode)),y.clearGroups(),y.addGroup(0,y.index?y.index.count:y.attributes.position.count,0),r.disposeSet.add(y),E=new PBMMesh(y,[v]);else if(g===WEBGL_CONSTANTS.POINTS)E=new PBMPointCloud(y,v);else throw new Error("glTF: Primitive mode unsupported: "+g);E.name=r.createUniqueName(o.name||"mesh_"+e),A.push(E)}if(A.length===1)return A[0];for(var b=new THREE__namespace.Group,T=0,_=A;T<_.length;T++){var E=_[T];b.add(E)}return b});return c},t.prototype.loadPBMMaterial=function(e,r){var i,o=(i=e.mode)!==null&&i!==void 0?i:WEBGL_CONSTANTS.TRIANGLES,s=null;if(o===WEBGL_CONSTANTS.TRIANGLES||o===WEBGL_CONSTANTS.TRIANGLE_STRIP||o===WEBGL_CONSTANTS.TRIANGLE_FAN)s=this.loadPBMMeshMaterial(e,r);else if(o===WEBGL_CONSTANTS.POINTS)s=this.loadPBMPointCloudMaterial(e,r);else throw new Error("glTF: Primitive mode unsupported: "+o);return s},t.prototype.extendTexture=function(e,r,i){return e.minFilter=THREE__namespace.LinearFilter,e.magFilter=THREE__namespace.LinearFilter,e.generateMipmaps=!1,e},t.prototype.loadPBMPointCloudMaterial=function(e,r){var i=new PBMPointCloudMaterial;return Object.keys(e.attributes).filter(function(o){return ATTRIBUTES[o]==="normal"}).length>0&&(i.defines.USE_POINT_NORMAL=!0),r.disposeSet.add(i),Promise.resolve(i)},t.prototype.loadPBMMeshMaterial=function(e,r){var i=[],o=new PBMMeshMaterial("basic");if(o.color=new THREE__namespace.Color(1,1,1),Object.keys(e.attributes).filter(function(d){return ATTRIBUTES[d]==="color"}).length>0&&(o.vertexColors=!0),e.material!==void 0){var s=r.json.materials[e.material];s.name&&(o.name=s.name);var u=s.pbrMetallicRoughness||{};if(Array.isArray(u.baseColorFactor)){var l=u.baseColorFactor;o.color=new THREE__namespace.Color().fromArray(l)}if(u.baseColorTexture!==void 0&&i.push(r.createMaterialTexture(u.baseColorTexture).then(function(d){r.disposeSet.add(d),d.encoding=THREE__namespace.sRGBEncoding,o.map=d})),s.doubleSided===!0&&(o.side=THREE__namespace.DoubleSide),s.normalTexture!==void 0&&(i.push(r.createMaterialTexture(s.normalTexture).then(function(d){r.disposeSet.add(d),o.normalMap=d})),o.normalScale=new THREE__namespace.Vector2(1,1),s.normalTexture.scale!==void 0)){var c=s.normalTexture.scale;o.normalScale.set(c,c)}}return r.disposeSet.add(o),Promise.all(i).then(function(){return o})},t}(BaseExtension),EXTENSIONS={KHR_binary_glTF,KHR_draco_mesh_compression,KHR_texture_basisu,KHR_texture_transform,KHR_mesh_quantization,KHR_materials_unlit,EXT_meshopt_compression,EXT_texture_webp,CESIUM_RTC,PBM_mesh};function parseGltf(n,t){var e,r,i,o={};if(t.addonExtensions)for(var s=0,u=t.addonExtensions;s<u.length;s++){var l=u[s];l in EXTENSIONS&&(o[l]=new EXTENSIONS[l])}var c,d;if(typeof n=="string")d=n;else{var f=EXTENSIONS.KHR_binary_glTF.getMagic(n);if(f===EXTENSIONS.KHR_binary_glTF.HEADER_MAGIC){c=new EXTENSIONS.KHR_binary_glTF;try{c.loadGlbBinary(n)}catch(v){return Promise.reject(v)}o.KHR_binary_glTF=c,d=c.content}else d=decodeText(new Uint8Array(n))}var m=JSON.parse(d);if(m.asset===void 0||Number(m.asset.version[0])<2)return Promise.reject(new Error("glTF: Unsupported asset. glTF versions >=2.0 are supported."));if(m.extensionsUsed)for(var A=m.extensionsRequired||[],h=0;h<m.extensionsUsed.length;h++){var p=m.extensionsUsed[h];o[p]||(EXTENSIONS[p]?o[p]=new EXTENSIONS[p]:A.indexOf(p)>=0&&console.warn('glTF: Unknown extension "'+p+'".'))}var y=new Parser(m,o,{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(v){return c&&c.clear(),v})}var ROTATE_X_MATRIX$1=new THREE__namespace.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function loadB3dm(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 parseHeader(e,r,i)}).then(function(i){return parseTable(e,r,i)}).then(function(i){return parseGlTFArrayBuffer(e,r,i)})}).then(function(){var r;return parseGltf(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 o=new THREE__namespace.Matrix4;t.upAxis!=="Z"&&o.premultiply(ROTATE_X_MATRIX$1);var s=new THREE__namespace.Matrix4().setPosition(e.rtcCenter[0],e.rtcCenter[1],e.rtcCenter[2]);if(o.premultiply(s),i.CESIUM_RTC){var u=new THREE__namespace.Matrix4().setPosition(i.CESIUM_RTC.center);o.premultiply(u)}var l=i.scene;return l.applyMatrix4(o),delete e.gltfArrayBuffer,delete e.featureTableBinary,delete e.batchTableBinary,{type:"b3dm",uri:e.uri,byteLength:e.byteLength,object:l,dispose:function(){return i.dispose()}}})})}const encodedJs="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2Z1bmN0aW9uIEIoYSl7b25tZXNzYWdlPWZ1bmN0aW9uKHIpe1Byb21pc2UucmVzb2x2ZShyLmRhdGEpLnRoZW4oZnVuY3Rpb24obil7cmV0dXJuIGEobil9KS50aGVuKGZ1bmN0aW9uKG4pe3ZhciBlPW4ub3V0cHV0LHQ9bi50cmFuc2ZlcjtyZXR1cm4gcG9zdE1lc3NhZ2UoZSx0KX0pLmNhdGNoKGZ1bmN0aW9uKG4pe3JldHVybiBwb3N0TWVzc2FnZSh7JCRlcnJvcjpufSl9KX19dmFyIHUseTsoZnVuY3Rpb24oYSl7YVthLkJZVEU9NTEyMF09IkJZVEUiLGFbYS5VTlNJR05FRF9CWVRFPTUxMjFdPSJVTlNJR05FRF9CWVRFIixhW2EuU0hPUlQ9NTEyMl09IlNIT1JUIixhW2EuVU5TSUdORURfU0hPUlQ9NTEyM109IlVOU0lHTkVEX1NIT1JUIixhW2EuSU5UPTUxMjRdPSJJTlQiLGFbYS5VTlNJR05FRF9JTlQ9NTEyNV09IlVOU0lHTkVEX0lOVCIsYVthLkZMT0FUPTUxMjZdPSJGTE9BVCIsYVthLkRPVUJMRT01MTMwXT0iRE9VQkxFIn0pKHl8fCh5PXt9KSk7dmFyIGM9K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YS5oYXNQcm9wZXJ0eSgiTk9STUFMX09DVDE2UCIpKXtmb3IodmFyIHI9YS5nZXRQcm9wZXJ0eUFycmF5KCJOT1JNQUxfT0NUMTZQIix5LlVOU0lHTkVEX0JZVEUsMiksbj1yLmxlbmd0aC8yLGU9bmV3IEludDhBcnJheShuKjQpLHQ9MCx2PXZvaWQgMCxBPXZvaWQgMCxOPXZvaWQgMCxFPXZvaWQgMCxTPXZvaWQgMCxzPXZvaWQgMCxUPXZvaWQgMDt0PG47dCsrKXY9dCoyLEE9clt2XSpELTEsTj1yWysrdl0qRC0xLFM9QTwwPy1BOkEscz1OPDA/LU46TixFPTEtKFMrcyksRTwwJiYoQT0oMS1zKSooQTwwPy0xOjEpLE49KDEtUykqKE48MD8tMToxKSksVD1NYXRoLnNxcnQoQSpBK04qTitFKkUpLHY9dCo0LGVbdl09QS9UKmgsZVsrK3ZdPU4vVCpoLGVbKyt2XT1FL1QqaDtyZXR1cm57YXJyYXk6ZSxpdGVtU2l6ZTo0LG5vcm1hbGl6ZWQ6ITB9fXJldHVybiBudWxsfX0pKCk7Cg==",decodeBase64=n=>Uint8Array.from(atob(n),t=>t.charCodeAt(0)),blob$1=typeof self!="undefined"&&self.Blob&&new Blob([decodeBase64(encodedJs)],{type:"text/javascript;charset=utf-8"});function WorkerWrapper(n){let t;try{if(t=blob$1&&(self.URL||self.webkitURL).createObjectURL(blob$1),!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,"+encodedJs,{name:n==null?void 0:n.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var attributeWorkerPool=new WorkerPool$1(function(){return new WorkerWrapper},2);function parsePointCloud(n,t,e){var r=new FeatureTable(n.featureTableJson,n.featureTableBinary);return Promise.resolve().then(function(){var i=r.getExtension("3DTILES_draco_point_compression");return i?parseDraco(i,r):attributeWorkerPool.postMessage({featureTableBinary:r.buffer,featureTableJson:r.json},[r.buffer.buffer])}).then(function(i){return n.attributes=i,e})}function parseDraco(n,t){return __awaiter(this,void 0,void 0,function(){var e,r,i,o,s,u;return __generator(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 o=t.buffer.slice(r,r+i),s=n.properties,u={POSITION:"Float32Array",NORMAL:"Float32Array",RGB:"Uint8Array",RGBA:"Uint8Array"},[2,draco.decodeGeometry(o.buffer,{attributeIDs:s,attributeTypes:u,useUniqueIDs:!0}).then(function(c){var d=c.getAttribute("POSITION"),f=c.getAttribute("RGB"),m=c.getAttribute("RGBA"),A=c.getAttribute("NORMAL"),h;if(m)h=m;else if(f){for(var p=f.count,y=f.array,v=new Uint8Array(p*4),g=0,E=void 0,b=void 0;g<p;g++)b=g*4,E=g*3,v[b]=y[E],v[++b]=y[++E],v[++b]=y[++E];h=new THREE__namespace.BufferAttribute(v,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:A?{array:A.array,itemSize:A.itemSize,normalized:A.normalized}:null}})]})})}function loadPnts(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 parseHeader(e,r,i)}).then(function(i){return parseTable(e,r,i)}).then(function(i){return parsePointCloud(e,r,i)})}).then(function(){var r;return createPoints(e.attributes,{computeBoundingBox:(r=t.computeBoundingBox)!==null&&r!==void 0?r:!0})}).then(function(r){var i=new THREE__namespace.Matrix4,o=new THREE__namespace.Matrix4().setPosition(e.rtcCenter[0],e.rtcCenter[1],e.rtcCenter[2]);return i.premultiply(o),r.object.applyMatrix4(i),delete e.gltfArrayBuffer,delete e.featureTableBinary,delete e.batchTableBinary,{type:"pnts",uri:e.uri,byteLength:e.byteLength,object:r.object,dispose:function(){return r.dispose()}}})}function createPoints(n,t){var e=new Set,r=new THREE__namespace.BufferGeometry;e.add(r);var i=new PBMPointCloudMaterial;e.add(i),n.position&&r.setAttribute("position",new THREE__namespace.BufferAttribute(n.position.array,n.position.itemSize,n.position.normalized)),n.color&&r.setAttribute("color",new THREE__namespace.BufferAttribute(n.color.array,n.color.itemSize,n.color.normalized)),n.normal&&(r.setAttribute("normal",new THREE__namespace.BufferAttribute(n.normal.array,n.normal.itemSize,n.normal.normalized)),i.defines.USE_POINT_NORMAL=!0),t.computeBoundingBox&&r.computeBoundingBox();var o=new PBMPointCloud(r,i);return o.matrix.compose(o.position,o.quaternion,o.scale),o.matrixAutoUpdate=!1,o.frustumCulled=!1,Promise.resolve({object:o,dispose:function(){e.forEach(function(s){s.dispose()}),e.clear()}})}function createLZMA(){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,o;i<this._numBitLevels;++i)o=t.decodeBit(this._models,e),e=e<<1|o,r|=o<<i;return r},n.reverseDecode2=function(t,e,r,i){for(var o=1,s=0,u=0,l;u<i;++u)l=r.decodeBit(t,e+o),o=o<<1|l,s|=l<<u;return s},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,o;do if(i=e>>7&1,e<<=1,o=t.decodeBit(this._decoders,(1+i<<8)+r),r=r<<1|o,i!==o){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,o=0,s=0,u=0,l=0,c=0,d=0,f,m,A,h,p,y;for(this._rangeDecoder.setStream(t),this._outWindow.setStream(e),this.init();r<0||c<r;)if(f=c&this._posStateMask,this._rangeDecoder.decodeBit(this._isMatchDecoders,(i<<4)+f)===0)m=this._literalDecoder.getDecoder(c++,d),i>=7?d=m.decodeWithMatchByte(this._rangeDecoder,this._outWindow.getByte(o)):d=m.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)A=0,this._rangeDecoder.decodeBit(this._isRepG0Decoders,i)===0?this._rangeDecoder.decodeBit(this._isRep0LongDecoders,(i<<4)+f)===0&&(i=i<7?9:11,A=1):(this._rangeDecoder.decodeBit(this._isRepG1Decoders,i)===0?h=s:(this._rangeDecoder.decodeBit(this._isRepG2Decoders,i)===0?h=u:(h=l,l=u),u=s),s=o,o=h),A===0&&(A=2+this._repLenDecoder.decode(this._rangeDecoder,f),i=i<7?8:11);else if(l=u,u=s,s=o,A=2+this._lenDecoder.decode(this._rangeDecoder,f),i=i<7?7:10,p=this._posSlotDecoder[A<=5?A-2:3].decode(this._rangeDecoder),p>=4){if(y=(p>>1)-1,o=(2|p&1)<<y,p<14)o+=n.reverseDecode2(this._posDecoders,o-p-1,this._rangeDecoder,y);else if(o+=this._rangeDecoder.decodeDirectBits(y-4)<<4,o+=this._posAlignDecoder.reverseDecode(this._rangeDecoder),o<0){if(o===-1)break;return!1}}else o=p;if(o>=c||o>=this._dictionarySizeCheck)return!1;this._outWindow.copyBlock(o,A),c+=A,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,o,s;return t.size<5||(e=t.readByte(),r=e%9,e=~~(e/9),i=e%5,o=~~(e/5),!this.setLcLpPb(r,i,o))?!1:(s=t.readByte(),s|=t.readByte()<<8,s|=t.readByte()<<16,s+=t.readByte()*16777216,this.setDictionarySize(s))},n.decompress=function(t,e,r,i){var o=new n.Decoder;if(!o.setDecoderProperties(t))throw"Incorrect stream properties";if(!o.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 LZMA=createLZMA();function createWASM(){function n(e){for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(256),o=0;o<r.length;o++)i[r.charCodeAt(o)]=o;var s=e.length*.75,u=e.length,l,c=0,d,f,m,A;e[e.length-1]==="="&&(s--,e[e.length-2]==="="&&s--);var h=new ArrayBuffer(s),p=new Uint8Array(h);for(l=0;l<u;l+=4)d=i[e.charCodeAt(l)],f=i[e.charCodeAt(l+1)],m=i[e.charCodeAt(l+2)],A=i[e.charCodeAt(l+3)],p[c++]=d<<2|f>>4,p[c++]=(f&15)<<4|m>>2,p[c++]=(m&3)<<6|A&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/QRQQASIAQQA2AgAgAEEAOgAEIABBADYCCCAAQQA2AgwgAEEANgIQIABBDTYCCCAAC0IBAX9BGRABIgBBADYCACAAQQA2AgQgAEEANgIIIABBADYCDCAAQQA2AhAgAEEANgIUIABBADoAGCAAQQA2AhAgAAu1AgEEf0HQABABIgBBADoAACAAQQA2AgQgAEEANgIIIABBADYCDCAAQQA2AhAgAEEAOgAUIABBADYCGCAAQQA2AhwgAEEANgIgIABBADYCJCAAQQA2AiggAEEANgIsIABBADYCMCAAQQA2AjQgAEEANgI4IABBADYCPCAAQQA2AkAgAEEANgJEIABBADYCSCAAQQA2AkxBBBAEIQIDQCABQQRIBEBBBhAHIQMgAigCACABQQJ0aiADNgIIIAFBAWohAQwBCwsgACACNgIkIABBBBAHNgIoIABB8wAQBjYCLCA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A(n,t,e){try{var r={data:t,offset:0,readByte:function(){return this.data[this.offset++]}},i=r.data.length,o={data:[],offset:0,writeByte:function(l){var c=Math.floor(this.offset/i);this.data[c]||(this.data[c]=new Uint8Array(i)),this.data[c][this.offset%i]=l,this.offset++}};n.decompressFile(r,o);for(var s=new Uint8Array(o.offset),u=0;u<o.offset;u++)s[u]=o.data[Math.floor(u/i)][u%i];e(null,s)}catch(l){e(l)}}function decodeLZMAWithWASM(n,t,e){var r=24;try{var i=new WebAssembly.Memory({initial:16}),o=new WebAssembly.Module(n),s=new WebAssembly.Instance(o,{env:{memory:i,abort:function(){e(new Error("webAssembly abort"))}}}),u=s.exports,l=u.newU8Array(t.length),c=new Uint8Array(i.buffer,l+r,t.length);c.set(t);var d=u.decode(l),f=new Uint32Array(i.buffer,d,4),m=f[0],A=f[2],h=f[3];m?e(null,new Uint8Array(i.buffer,h+r,A).slice(0,A)):e(new Error("lzma deocder error"))}catch(p){e(p)}}var lzmaWorkerSource=`
883
+ `,EXTENSION_NAME$4="KHR_texture_basisu",KHR_texture_basisu=function(n){__extends(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[EXTENSION_NAME$4])return null;var o=i.extensions[EXTENSION_NAME$4],s=r.json.images[o.source],u=null;if(s.bufferView!==void 0)u=r.loadBufferView(s.bufferView).then(function(c){return ktx2.parse(c)});else if(s.uri)u=r.options.fetcher.ajax(r.resolveResouce(s.uri),{responseType:"arraybuffer"}).then(function(c){return ktx2.parse(c.body)});else throw new Error("glTF: Invalid image defs.");return u},t}(BaseExtension),EXTENSION_NAME$3="KHR_texture_transform",KHR_texture_transform=function(n){__extends(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.extendTexture=function(e,r,i){var o=r.extensions!==void 0?r.extensions[EXTENSION_NAME$3]:void 0;return o?(o.texCoord!==void 0&&console.warn('glTF: Custom UV sets in "'+EXTENSION_NAME$3+'" extension not yet supported.'),o.offset===void 0&&o.rotation===void 0&&o.scale===void 0||(e=e.clone(),e.needsUpdate=!0,o.offset!==void 0&&e.offset.fromArray(o.offset),o.rotation!==void 0&&(e.rotation=o.rotation),o.scale!==void 0&&e.repeat.fromArray(o.scale)),e):null},t}(BaseExtension),KHR_mesh_quantization=function(n){__extends(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(BaseExtension),KHR_materials_unlit=function(n){__extends(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(BaseExtension),meshoptDecoder=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:yjjbfRbbfhlxekaXalpbbbpklbalczfhlkaocdfhoaicz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zad6mbkasavcjdfaqad2;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,o,s=WebAssembly.instantiate(u(i),{}).then(function(m){o=m.instance,o.exports.__wasm_call_ctors()});function u(m){for(var g=new Uint8Array(m.length),E=0;E<m.length;++E){var b=m.charCodeAt(E);g[E]=b>96?b-97:b>64?b-39:b+4}for(var T=0,E=0;E<m.length;++E)g[T++]=g[E]<60?r[g[E]]:(g[E]-60)*64+g[++E];return g.buffer.slice(0,T)}function c(m,g,E,b,T,_){var S=o.exports.sbrk,R=E+3&-4,B=S(R*b),I=S(T.length),x=new Uint8Array(o.exports.memory.buffer);x.set(T,I);var M=m(B,E,b,I,T.length);if(M==0&&_&&_(B,R,b),g.set(x.subarray(B,B+E*b)),S(B-S(0)),M!=0)throw new Error("Malformed buffer data: "+M)}var l={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},d={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},f=[],v=0;function A(m){var g={object:new Worker(m),pending:0,requests:{}};return g.object.onmessage=function(E){var b=E.data;g.pending-=b.count,g.requests[b.id][b.action](b.value),delete g.requests[b.id]},g}function h(m){for(var g="var instance; var ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(u(i))+"]), {}).then(function(result) { instance = result.instance; instance.exports.__wasm_call_ctors(); });self.onmessage = workerProcess;"+c.toString()+y.toString(),E=new Blob([g],{type:"text/javascript"}),b=URL.createObjectURL(E),T=0;T<m;++T)f[T]=A(b);URL.revokeObjectURL(b)}function p(m,g,E,b,T){for(var _=f[0],S=1;S<f.length;++S)f[S].pending<_.pending&&(_=f[S]);return new Promise(function(R,B){var I=new Uint8Array(E),x=v++;_.pending+=m,_.requests[x]={resolve:R,reject:B},_.object.postMessage({id:x,count:m,size:g,source:I,mode:b,filter:T},[I.buffer])})}function y(m){s.then(function(){var g=m.data;try{var E=new Uint8Array(g.count*g.size);c(o.exports[g.mode],E,g.count,g.size,g.source,o.exports[g.filter]),self.postMessage({id:g.id,count:g.count,action:"resolve",value:E},[E.buffer])}catch(b){self.postMessage({id:g.id,count:g.count,action:"reject",value:b})}})}return{ready:s,supported:!0,useWorkers:function(m){h(m)},decodeVertexBuffer:function(m,g,E,b,T){c(o.exports.meshopt_decodeVertexBuffer,m,g,E,b,o.exports[l[T]])},decodeIndexBuffer:function(m,g,E,b){c(o.exports.meshopt_decodeIndexBuffer,m,g,E,b)},decodeIndexSequence:function(m,g,E,b){c(o.exports.meshopt_decodeIndexSequence,m,g,E,b)},decodeGltfBuffer:function(m,g,E,b,T,_){c(o.exports[d[T]],m,g,E,b,o.exports[l[_]])},decodeGltfBufferAsync:function(m,g,E,b,T){return f.length>0?p(m,g,E,d[b],l[T]):s.then(function(){var _=new Uint8Array(m*g);return c(o.exports[d[b]],_,m,g,E,o.exports[l[T]]),_})}}}(),EXTENSION_NAME$2="EXT_meshopt_compression",EXT_meshopt_compression=function(n){__extends(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadBufferView=function(e,r){var i=r.json,o=i.bufferViews[e];if(o.extensions&&o.extensions[EXTENSION_NAME$2]){var s=o.extensions[EXTENSION_NAME$2],u=r.loadBuffer(s.buffer);if(!meshoptDecoder.supported){if(i.extensionsRequired&&i.extensionsRequired.indexOf(EXTENSION_NAME$2)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([u,meshoptDecoder.ready]).then(function(c){var l=c[0],d=s.byteOffset||0,f=s.byteLength||0,v=s.count,A=s.byteStride,h=new ArrayBuffer(v*A),p=new Uint8Array(l,d,f);return meshoptDecoder.decodeGltfBuffer(new Uint8Array(h),v,A,p,s.mode,s.filter),h})}else return null},t}(BaseExtension),EXTENSION_NAME$1="EXT_texture_webp",EXT_texture_webp=function(n){__extends(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 imageSupport().then(function(i){r.supportsWep=i.webp})},t.prototype.loadTexture=function(e,r){var i=r.json,o=i.textures[e];if(!o.extensions||!o.extensions[EXTENSION_NAME$1]||!this.supportsWep)return null;var s=o.extensions[EXTENSION_NAME$1];return r.loadImage(s.source).then(function(u){var c=new THREE__namespace.Texture(u);c.needsUpdate=!0,c.flipY=!1,o.name&&(c.name=o.name);var l=r.json.samplers||{},d=l[o.sampler]||{};return c.magFilter=WEBGL_FILTERS[d.magFilter]||THREE__namespace.LinearFilter,c.minFilter=WEBGL_FILTERS[d.minFilter]||THREE__namespace.LinearMipmapLinearFilter,c.wrapS=WEBGL_WRAPPINGS[d.wrapS]||THREE__namespace.RepeatWrapping,c.wrapT=WEBGL_WRAPPINGS[d.wrapT]||THREE__namespace.RepeatWrapping,c.onUpdate=function(){u.close()},c})},t}(BaseExtension),EXTENSION_NAME="CESIUM_RTC",CESIUM_RTC=function(n){__extends(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.emitResult=function(e,r){if(r.json.extensions[EXTENSION_NAME]&&r.json.extensions[EXTENSION_NAME].center){var i=r.json.extensions[EXTENSION_NAME].center;e.CESIUM_RTC={center:new THREE__namespace.Vector3().fromArray(i)}}},t}(BaseExtension),PBM_mesh=function(n){__extends(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadMesh=function(e,r){var i=this,o=r.json.meshes[e],s=o.primitives,u=Promise.all(s.map(function(d){return r.loadGeometry(d)})),c=Promise.all(s.map(function(d){return i.loadPBMMaterial(d,r)})),l=Promise.all([u,c]).then(function(d){for(var f=d[0],v=d[1],A=[],h=0;h<s.length;h++){var p=s[h],y=f[h],m=v[h];y.attributes.normal===void 0&&(m.flatShading=!0),y.attributes.tangent===void 0&&m.normalScale&&(m.normalScale.y*=-1);var g=p.mode||WEBGL_CONSTANTS.TRIANGLES,E=void 0;if(g===WEBGL_CONSTANTS.TRIANGLES||g===WEBGL_CONSTANTS.TRIANGLE_STRIP||g===WEBGL_CONSTANTS.TRIANGLE_FAN)g===WEBGL_CONSTANTS.TRIANGLE_STRIP?y=r.toGeometryTrianglesDrawMode(y,THREE__namespace.TriangleStripDrawMode):g===WEBGL_CONSTANTS.TRIANGLE_FAN&&(y=r.toGeometryTrianglesDrawMode(y,THREE__namespace.TriangleFanDrawMode)),y.clearGroups(),y.addGroup(0,y.index?y.index.count:y.attributes.position.count,0),r.disposeSet.add(y),E=new PBMMesh(y,[m]);else if(g===WEBGL_CONSTANTS.POINTS)E=new PBMPointCloud(y,m);else throw new Error("glTF: Primitive mode unsupported: "+g);E.name=r.createUniqueName(o.name||"mesh_"+e),A.push(E)}if(A.length===1)return A[0];for(var b=new THREE__namespace.Group,T=0,_=A;T<_.length;T++){var E=_[T];b.add(E)}return b});return l},t.prototype.loadPBMMaterial=function(e,r){var i,o=(i=e.mode)!==null&&i!==void 0?i:WEBGL_CONSTANTS.TRIANGLES,s=null;if(o===WEBGL_CONSTANTS.TRIANGLES||o===WEBGL_CONSTANTS.TRIANGLE_STRIP||o===WEBGL_CONSTANTS.TRIANGLE_FAN)s=this.loadPBMMeshMaterial(e,r);else if(o===WEBGL_CONSTANTS.POINTS)s=this.loadPBMPointCloudMaterial(e,r);else throw new Error("glTF: Primitive mode unsupported: "+o);return s},t.prototype.extendTexture=function(e,r,i){return e.minFilter=THREE__namespace.LinearFilter,e.magFilter=THREE__namespace.LinearFilter,e.generateMipmaps=!1,e},t.prototype.loadPBMPointCloudMaterial=function(e,r){var i=new PBMPointCloudMaterial;return Object.keys(e.attributes).filter(function(o){return ATTRIBUTES[o]==="normal"}).length>0&&(i.defines.USE_POINT_NORMAL=!0),r.disposeSet.add(i),Promise.resolve(i)},t.prototype.loadPBMMeshMaterial=function(e,r){var i=[],o=new PBMMeshMaterial("basic");if(o.color=new THREE__namespace.Color(1,1,1),Object.keys(e.attributes).filter(function(d){return ATTRIBUTES[d]==="color"}).length>0&&(o.vertexColors=!0),e.material!==void 0){var s=r.json.materials[e.material];s.name&&(o.name=s.name);var u=s.pbrMetallicRoughness||{};if(Array.isArray(u.baseColorFactor)){var c=u.baseColorFactor;o.color=new THREE__namespace.Color().fromArray(c)}if(u.baseColorTexture!==void 0&&i.push(r.createMaterialTexture(u.baseColorTexture).then(function(d){r.disposeSet.add(d),d.encoding=THREE__namespace.sRGBEncoding,o.map=d})),s.doubleSided===!0&&(o.side=THREE__namespace.DoubleSide),s.normalTexture!==void 0&&(i.push(r.createMaterialTexture(s.normalTexture).then(function(d){r.disposeSet.add(d),o.normalMap=d})),o.normalScale=new THREE__namespace.Vector2(1,1),s.normalTexture.scale!==void 0)){var l=s.normalTexture.scale;o.normalScale.set(l,l)}}return r.disposeSet.add(o),Promise.all(i).then(function(){return o})},t}(BaseExtension),EXTENSIONS={KHR_binary_glTF,KHR_draco_mesh_compression,KHR_texture_basisu,KHR_texture_transform,KHR_mesh_quantization,KHR_materials_unlit,EXT_meshopt_compression,EXT_texture_webp,CESIUM_RTC,PBM_mesh};function parseGltf(n,t){var e,r,i,o={};if(t.addonExtensions)for(var s=0,u=t.addonExtensions;s<u.length;s++){var c=u[s];c in EXTENSIONS&&(o[c]=new EXTENSIONS[c])}var l,d;if(typeof n=="string")d=n;else{var f=EXTENSIONS.KHR_binary_glTF.getMagic(n);if(f===EXTENSIONS.KHR_binary_glTF.HEADER_MAGIC){l=new EXTENSIONS.KHR_binary_glTF;try{l.loadGlbBinary(n)}catch(m){return Promise.reject(m)}o.KHR_binary_glTF=l,d=l.content}else d=decodeText(new Uint8Array(n))}var v=JSON.parse(d);if(v.asset===void 0||Number(v.asset.version[0])<2)return Promise.reject(new Error("glTF: Unsupported asset. glTF versions >=2.0 are supported."));if(v.extensionsUsed)for(var A=v.extensionsRequired||[],h=0;h<v.extensionsUsed.length;h++){var p=v.extensionsUsed[h];o[p]||(EXTENSIONS[p]?o[p]=new EXTENSIONS[p]:A.indexOf(p)>=0&&console.warn('glTF: Unknown extension "'+p+'".'))}var y=new Parser(v,o,{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(m){return l&&l.clear(),m})}var ROTATE_X_MATRIX$1=new THREE__namespace.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function loadB3dm(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 parseHeader(e,r,i)}).then(function(i){return parseTable(e,r,i)}).then(function(i){return parseGlTFArrayBuffer(e,r,i)})}).then(function(){var r;return parseGltf(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 o=new THREE__namespace.Matrix4;t.upAxis!=="Z"&&o.premultiply(ROTATE_X_MATRIX$1);var s=new THREE__namespace.Matrix4().setPosition(e.rtcCenter[0],e.rtcCenter[1],e.rtcCenter[2]);if(o.premultiply(s),i.CESIUM_RTC){var u=new THREE__namespace.Matrix4().setPosition(i.CESIUM_RTC.center);o.premultiply(u)}var c=i.scene;return c.applyMatrix4(o),delete e.featureTableBinary,delete e.batchTableBinary,delete e.gltfArrayBuffer,{type:"b3dm",uri:e.uri,byteLength:e.byteLength,scene:c,textures:i.textures,dispose:function(){return i.dispose()}}})})}const encodedJs="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2Z1bmN0aW9uIEIoYSl7b25tZXNzYWdlPWZ1bmN0aW9uKHIpe1Byb21pc2UucmVzb2x2ZShyLmRhdGEpLnRoZW4oZnVuY3Rpb24obil7cmV0dXJuIGEobil9KS50aGVuKGZ1bmN0aW9uKG4pe3ZhciBlPW4ub3V0cHV0LHQ9bi50cmFuc2ZlcjtyZXR1cm4gcG9zdE1lc3NhZ2UoZSx0KX0pLmNhdGNoKGZ1bmN0aW9uKG4pe3JldHVybiBwb3N0TWVzc2FnZSh7JCRlcnJvcjpufSl9KX19dmFy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I3LEQ9Mi9HO2Z1bmN0aW9uIFAoYSl7aWYoYS5oYXNQcm9wZXJ0eSgiTk9STUFMIikpe2Zvcih2YXIgcj1hLmdldFByb3BlcnR5QXJyYXkoIk5PUk1BTCIseS5GTE9BVCwzKSxuPXIubGVuZ3RoLzMsZT1uZXcgSW50OEFycmF5KG4qNCksdD0wLGk9dm9pZCAwLG89dm9pZCAwO3Q8bjt0Kyspbz10KjQsaT10KjMsZVtvXT1yW2ldKmgsZVsrK29dPXJbKytpXSpoLGVbKytvXT1yWysraV0qaDtyZXR1cm57YXJyYXk6ZSxpdGVtU2l6ZTo0LG5vcm1hbGl6ZWQ6ITB9fWVsc2UgaWYoYS5oYXNQcm9wZXJ0eSgiTk9STUFMX09DVDE2UCIpKXtmb3IodmFyIHI9YS5nZXRQcm9wZXJ0eUFycmF5KCJOT1JNQUxfT0NUMTZQIix5LlVOU0lHTkVEX0JZVEUsMiksbj1yLmxlbmd0aC8yLGU9bmV3IEludDhBcnJheShuKjQpLHQ9MCx2PXZvaWQgMCxBPXZvaWQgMCxOPXZvaWQgMCxFPXZvaWQgMCxTPXZvaWQgMCxzPXZvaWQgMCxUPXZvaWQgMDt0PG47dCsrKXY9dCoyLEE9clt2XSpELTEsTj1yWysrdl0qRC0xLFM9QTwwPy1BOkEscz1OPDA/LU46TixFPTEtKFMrcyksRTwwJiYoQT0oMS1zKSooQTwwPy0xOjEpLE49KDEtUykqKE48MD8tMToxKSksVD1NYXRoLnNxcnQoQSpBK04qTitFKkUpLHY9dCo0LGVbdl09QS9UKmgsZVsrK3ZdPU4vVCpoLGVbKyt2XT1FL1QqaDtyZXR1cm57YXJyYXk6ZSxpdGVtU2l6ZTo0LG5vcm1hbGl6ZWQ6ITB9fXJldHVybiBudWxsfX0pKCk7Cg==",decodeBase64=n=>Uint8Array.from(atob(n),t=>t.charCodeAt(0)),blob$1=typeof self!="undefined"&&self.Blob&&new Blob([decodeBase64(encodedJs)],{type:"text/javascript;charset=utf-8"});function WorkerWrapper(n){let t;try{if(t=blob$1&&(self.URL||self.webkitURL).createObjectURL(blob$1),!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,"+encodedJs,{name:n==null?void 0:n.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var attributeWorkerPool=new WorkerPool$1(function(){return new WorkerWrapper},2);function parsePointCloud(n,t,e){var r=new FeatureTable(n.featureTableJson,n.featureTableBinary);return Promise.resolve().then(function(){var i=r.getExtension("3DTILES_draco_point_compression");return i?parseDraco(i,r):attributeWorkerPool.postMessage({featureTableBinary:r.buffer,featureTableJson:r.json},[r.buffer.buffer])}).then(function(i){return n.attributes=i,e})}function parseDraco(n,t){return __awaiter(this,void 0,void 0,function(){var e,r,i,o,s,u;return __generator(this,function(c){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 o=t.buffer.slice(r,r+i),s=n.properties,u={POSITION:"Float32Array",NORMAL:"Float32Array",RGB:"Uint8Array",RGBA:"Uint8Array"},[2,draco.decodeGeometry(o.buffer,{attributeIDs:s,attributeTypes:u,useUniqueIDs:!0}).then(function(l){var d=l.getAttribute("POSITION"),f=l.getAttribute("RGB"),v=l.getAttribute("RGBA"),A=l.getAttribute("NORMAL"),h;if(v)h=v;else if(f){for(var p=f.count,y=f.array,m=new Uint8Array(p*4),g=0,E=void 0,b=void 0;g<p;g++)b=g*4,E=g*3,m[b]=y[E],m[++b]=y[++E],m[++b]=y[++E];h=new THREE__namespace.BufferAttribute(m,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:A?{array:A.array,itemSize:A.itemSize,normalized:A.normalized}:null}})]})})}function loadPnts(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 parseHeader(e,r,i)}).then(function(i){return parseTable(e,r,i)}).then(function(i){return parsePointCloud(e,r,i)})}).then(function(){var r;return createPoints(e.attributes,{computeBoundingBox:(r=t.computeBoundingBox)!==null&&r!==void 0?r:!0})}).then(function(r){var i=new THREE__namespace.Matrix4,o=new THREE__namespace.Matrix4().setPosition(e.rtcCenter[0],e.rtcCenter[1],e.rtcCenter[2]);return i.premultiply(o),r.object.applyMatrix4(i),delete e.gltfArrayBuffer,delete e.featureTableBinary,delete e.batchTableBinary,{type:"pnts",uri:e.uri,byteLength:e.byteLength,scene:r.object,textures:[],dispose:function(){return r.dispose()}}})}function createPoints(n,t){var e=new Set,r=new THREE__namespace.BufferGeometry;e.add(r);var i=new PBMPointCloudMaterial;e.add(i),n.position&&r.setAttribute("position",new THREE__namespace.BufferAttribute(n.position.array,n.position.itemSize,n.position.normalized)),n.color&&r.setAttribute("color",new THREE__namespace.BufferAttribute(n.color.array,n.color.itemSize,n.color.normalized)),n.normal&&(r.setAttribute("normal",new THREE__namespace.BufferAttribute(n.normal.array,n.normal.itemSize,n.normal.normalized)),i.defines.USE_POINT_NORMAL=!0),t.computeBoundingBox&&r.computeBoundingBox();var o=new PBMPointCloud(r,i);return o.matrix.compose(o.position,o.quaternion,o.scale),o.matrixAutoUpdate=!1,o.frustumCulled=!1,Promise.resolve({object:o,dispose:function(){e.forEach(function(s){s.dispose()}),e.clear()}})}function createLZMA(){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,o;i<this._numBitLevels;++i)o=t.decodeBit(this._models,e),e=e<<1|o,r|=o<<i;return r},n.reverseDecode2=function(t,e,r,i){for(var o=1,s=0,u=0,c;u<i;++u)c=r.decodeBit(t,e+o),o=o<<1|c,s|=c<<u;return s},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,o;do if(i=e>>7&1,e<<=1,o=t.decodeBit(this._decoders,(1+i<<8)+r),r=r<<1|o,i!==o){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,o=0,s=0,u=0,c=0,l=0,d=0,f,v,A,h,p,y;for(this._rangeDecoder.setStream(t),this._outWindow.setStream(e),this.init();r<0||l<r;)if(f=l&this._posStateMask,this._rangeDecoder.decodeBit(this._isMatchDecoders,(i<<4)+f)===0)v=this._literalDecoder.getDecoder(l++,d),i>=7?d=v.decodeWithMatchByte(this._rangeDecoder,this._outWindow.getByte(o)):d=v.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)A=0,this._rangeDecoder.decodeBit(this._isRepG0Decoders,i)===0?this._rangeDecoder.decodeBit(this._isRep0LongDecoders,(i<<4)+f)===0&&(i=i<7?9:11,A=1):(this._rangeDecoder.decodeBit(this._isRepG1Decoders,i)===0?h=s:(this._rangeDecoder.decodeBit(this._isRepG2Decoders,i)===0?h=u:(h=c,c=u),u=s),s=o,o=h),A===0&&(A=2+this._repLenDecoder.decode(this._rangeDecoder,f),i=i<7?8:11);else if(c=u,u=s,s=o,A=2+this._lenDecoder.decode(this._rangeDecoder,f),i=i<7?7:10,p=this._posSlotDecoder[A<=5?A-2:3].decode(this._rangeDecoder),p>=4){if(y=(p>>1)-1,o=(2|p&1)<<y,p<14)o+=n.reverseDecode2(this._posDecoders,o-p-1,this._rangeDecoder,y);else if(o+=this._rangeDecoder.decodeDirectBits(y-4)<<4,o+=this._posAlignDecoder.reverseDecode(this._rangeDecoder),o<0){if(o===-1)break;return!1}}else o=p;if(o>=l||o>=this._dictionarySizeCheck)return!1;this._outWindow.copyBlock(o,A),l+=A,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,o,s;return t.size<5||(e=t.readByte(),r=e%9,e=~~(e/9),i=e%5,o=~~(e/5),!this.setLcLpPb(r,i,o))?!1:(s=t.readByte(),s|=t.readByte()<<8,s|=t.readByte()<<16,s+=t.readByte()*16777216,this.setDictionarySize(s))},n.decompress=function(t,e,r,i){var o=new n.Decoder;if(!o.setDecoderProperties(t))throw"Incorrect stream properties";if(!o.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 LZMA=createLZMA();function createWASM(){function n(e){for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(256),o=0;o<r.length;o++)i[r.charCodeAt(o)]=o;var s=e.length*.75,u=e.length,c,l=0,d,f,v,A;e[e.length-1]==="="&&(s--,e[e.length-2]==="="&&s--);var h=new ArrayBuffer(s),p=new Uint8Array(h);for(c=0;c<u;c+=4)d=i[e.charCodeAt(c)],f=i[e.charCodeAt(c+1)],v=i[e.charCodeAt(c+2)],A=i[e.charCodeAt(c+3)],p[l++]=d<<2|f>>4,p[l++]=(f&15)<<4|v>>2,p[l++]=(v&3)<<6|A&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/QRQQASIAQQA2AgAgAEEAOgAEIABBADYCCCAAQQA2AgwgAEEANgIQIABBDTY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QtAAQaQQFBACAAKAIAKAIIKAIQIAAoAgAoAggoAgQQIQ8LQQBBAUEAQQAQIQsIACMDIAAQIgsWAEG4ASQAIwAkAUGAgIAIJAIQDCQDCwMAAQsLtwEEAEEICxcKAAAAdQBzAGUAIABzAHQAcgBpAGMAdABBIAsdDQAAAH4AbABpAGIALwBhAHIAcgBhAHkALgB0AHMAQcAACzkbAAAAfgBsAGkAYgAvAGkAbgB0AGUAcgBuAGEAbAAvAHQAeQBwAGUAZABhAHIAcgBhAHkALgB0AHMAQYABCzMYAAAAcwByAGMALwBsAHoAbQBhAC8AbAB6AG0AYQAtAGQAZQBjAG8AZABlAHIALgB0AHM=";return n(t)}function decodeLZMA(n,t,e){try{var r={data:t,offset:0,readByte:function(){return this.data[this.offset++]}},i=r.data.length,o={data:[],offset:0,writeByte:function(c){var l=Math.floor(this.offset/i);this.data[l]||(this.data[l]=new Uint8Array(i)),this.data[l][this.offset%i]=c,this.offset++}};n.decompressFile(r,o);for(var s=new Uint8Array(o.offset),u=0;u<o.offset;u++)s[u]=o.data[Math.floor(u/i)][u%i];e(null,s)}catch(c){e(c)}}function decodeLZMAWithWASM(n,t,e){var r=24;try{var i=new WebAssembly.Memory({initial:16}),o=new WebAssembly.Module(n),s=new WebAssembly.Instance(o,{env:{memory:i,abort:function(){e(new Error("webAssembly abort"))}}}),u=s.exports,c=u.newU8Array(t.length),l=new Uint8Array(i.buffer,c+r,t.length);l.set(t);var d=u.decode(c),f=new Uint32Array(i.buffer,d,4),v=f[0],A=f[2],h=f[3];v?e(null,new Uint8Array(i.buffer,h+r,A).slice(0,A)):e(new Error("lzma deocder error"))}catch(p){e(p)}}var lzmaWorkerSource=`
884
884
  var decodeLZMA = (function() {
885
885
  var LZMA = (`.concat(createLZMA.toString(),`)();
886
886
  return function(data, callback) {
@@ -925,11 +925,11 @@ self.onmessage = function(event) {
925
925
  }
926
926
  postMessage({ id: packet.id, error: "type never matched." });
927
927
  };
928
- `),support=typeof Worker!="undefined"&&typeof Blob!="undefined",lzmaWorkerURL="";if(support)try{var blob=new Blob([lzmaWorkerSource],{type:"text/javascript"});lzmaWorkerURL=URL.createObjectURL(blob)}catch(n){}var LZMAWorker=function(){function n(){var t=this;if(!support)throw new Error("LZMAWorker cannot work in this broswer.");this.callCounter=0,this.requests={};var e=this.worker=new Worker(lzmaWorkerURL);e.onmessage=function(r){var i=r.data,o=i.id,s=i.result,u=i.error,l=t.getKey(o);t.requests[l]&&(u?t.requests[l](new Error(u)):t.requests[l](null,s),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=support,n}();function readUint32(n){return Array.prototype.reduce.call(n,function(t,e,r){return t|e<<r*8},0)}function binaryArrays(n){for(var t=[],e=n.length,r=function(s){var u={data:n[s],offset:0,readByte:function(){return this.data[this.offset++]}},l=u.data.length,c={data:[],offset:0,writeByte:function(f){var m=Math.floor(this.offset/l);this.data[m]||(this.data[m]=new Uint8Array(l)),this.data[m][this.offset%l]=f,this.offset++}};LZMA.decompressFile(u,c),i=new Uint8Array(c.offset);for(var d=0;d<c.offset;d++)i[d]=c.data[Math.floor(d/l)][d%l];t.push(i)},i,o=0;o<e;o++)r(o);return t}function binaryArraysWithWorker(n){for(var t=[],e=n.length,r=function(o){t.push(new Promise(function(s,u){var l=new LZMAWorker;l.decompress(n[o],function(c,d){if(l.terminate(),c)return u(c);s(d)})}))},i=0;i<e;i++)r(i);return Promise.all(t)}function lzma(n){var t=new Uint8Array(n),e=readUint32(t.slice(0,4));if(e>10)return Promise.reject(new Error("LZMA got too many sub chunks."));for(var r=[],i=[],o=4+e*4,s=0;s<e;s++)i[s]=readUint32(t.slice(4+s*4,8+s*4)),s===e-1?r[s]=t.subarray(o,o+i[s]):r[s]=t.slice(o,o+i[s]),o+=i[s];return LZMAWorker.support?binaryArraysWithWorker(r):Promise.resolve(binaryArrays(r))}var dequeuing=!1,queue=[];function dequeue(n){if(n===void 0&&(n=!1),!(!n&&dequeuing)){dequeuing=!0;var t=queue.shift();if(t){try{t()}catch(e){}AnimationFrameLoop.shared.add(function(){return dequeue(!0)},!0,2,-100)}else dequeuing=!1}}function delay(n){return new Promise(function(t,e){var r=function(){try{t(n())}catch(i){e(i)}};queue.push(r),AnimationFrameLoop.shared.add(function(){return dequeue()},!0,2,-100)})}function pick(n,t){for(var e={},r=0,i=t;r<i.length;r++){var o=i[r];o in n&&(e[o]=n[o])}return e}function omit(n,t){for(var e=__assign({},n),r=0,i=t;r<i.length;r++){var o=i[r];o in e&&delete e[o]}return e}function jsonStableStrinfiy_(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,o=0;o<i;o++)r+=jsonStableStrinfiy_(n[o],!1)+",";return i>-1&&(r+=jsonStableStrinfiy_(n[o],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return jsonStableStrinfiy_(n.toJSON(),t);for(var s=Object.keys(n).sort(),u=s.length,r="",o=0;o<u;){var l=s[o],c=jsonStableStrinfiy_(n[l],!0);c!==void 0&&(o&&r!==""&&(r+=","),r+=JSON.stringify(l)+":"+c),o++}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 jsonHash(n){return"hash::".concat(jsonStableStrinfiy_(n,!1))}var commonjsGlobal=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},indexMinimal={},minimal$1={},aspromise=asPromise;function asPromise(n,t){for(var e=new Array(arguments.length-1),r=0,i=2,o=!0;i<arguments.length;)e[r++]=arguments[i++];return new Promise(function(u,l){e[r]=function(d){if(o)if(o=!1,d)l(d);else{for(var f=new Array(arguments.length-1),m=0;m<f.length;)f[m++]=arguments[m];u.apply(null,f)}};try{n.apply(t||null,e)}catch(c){o&&(o=!1,l(c))}})}var base64$1={};(function(n){var t=n;t.length=function(u){var l=u.length;if(!l)return 0;for(var c=0;--l%4>1&&u.charAt(l)==="=";)++c;return Math.ceil(u.length*3)/4-c};for(var e=new Array(64),r=new Array(123),i=0;i<64;)r[e[i]=i<26?i+65:i<52?i+71:i<62?i-4:i-59|43]=i++;t.encode=function(u,l,c){for(var d=null,f=[],m=0,A=0,h;l<c;){var p=u[l++];switch(A){case 0:f[m++]=e[p>>2],h=(p&3)<<4,A=1;break;case 1:f[m++]=e[h|p>>4],h=(p&15)<<2,A=2;break;case 2:f[m++]=e[h|p>>6],f[m++]=e[p&63],A=0;break}m>8191&&((d||(d=[])).push(String.fromCharCode.apply(String,f)),m=0)}return A&&(f[m++]=e[h],f[m++]=61,A===1&&(f[m++]=61)),d?(m&&d.push(String.fromCharCode.apply(String,f.slice(0,m))),d.join("")):String.fromCharCode.apply(String,f.slice(0,m))};var o="invalid encoding";t.decode=function(u,l,c){for(var d=c,f=0,m,A=0;A<u.length;){var h=u.charCodeAt(A++);if(h===61&&f>1)break;if((h=r[h])===void 0)throw Error(o);switch(f){case 0:m=h,f=1;break;case 1:l[c++]=m<<2|(h&48)>>4,m=h,f=2;break;case 2:l[c++]=(m&15)<<4|(h&60)>>2,m=h,f=3;break;case 3:l[c++]=(m&3)<<6|h,f=0;break}}if(f===1)throw Error(o);return c-d},t.test=function(u){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(u)}})(base64$1);var eventemitter=EventEmitter;function EventEmitter(){this._listeners={}}EventEmitter.prototype.on=function(t,e,r){return(this._listeners[t]||(this._listeners[t]=[])).push({fn:e,ctx:r||this}),this},EventEmitter.prototype.off=function(t,e){if(t===void 0)this._listeners={};else if(e===void 0)this._listeners[t]=[];else for(var r=this._listeners[t],i=0;i<r.length;)r[i].fn===e?r.splice(i,1):++i;return this},EventEmitter.prototype.emit=function(t){var e=this._listeners[t];if(e){for(var r=[],i=1;i<arguments.length;)r.push(arguments[i++]);for(i=0;i<e.length;)e[i].fn.apply(e[i++].ctx,r)}return this};var float=factory(factory);function factory(n){return typeof Float32Array!="undefined"?function(){var t=new Float32Array([-0]),e=new Uint8Array(t.buffer),r=e[3]===128;function i(l,c,d){t[0]=l,c[d]=e[0],c[d+1]=e[1],c[d+2]=e[2],c[d+3]=e[3]}function o(l,c,d){t[0]=l,c[d]=e[3],c[d+1]=e[2],c[d+2]=e[1],c[d+3]=e[0]}n.writeFloatLE=r?i:o,n.writeFloatBE=r?o:i;function s(l,c){return e[0]=l[c],e[1]=l[c+1],e[2]=l[c+2],e[3]=l[c+3],t[0]}function u(l,c){return e[3]=l[c],e[2]=l[c+1],e[1]=l[c+2],e[0]=l[c+3],t[0]}n.readFloatLE=r?s:u,n.readFloatBE=r?u:s}():function(){function t(r,i,o,s){var u=i<0?1:0;if(u&&(i=-i),i===0)r(1/i>0?0:2147483648,o,s);else if(isNaN(i))r(2143289344,o,s);else if(i>34028234663852886e22)r((u<<31|2139095040)>>>0,o,s);else if(i<11754943508222875e-54)r((u<<31|Math.round(i/1401298464324817e-60))>>>0,o,s);else{var l=Math.floor(Math.log(i)/Math.LN2),c=Math.round(i*Math.pow(2,-l)*8388608)&8388607;r((u<<31|l+127<<23|c)>>>0,o,s)}}n.writeFloatLE=t.bind(null,writeUintLE),n.writeFloatBE=t.bind(null,writeUintBE);function e(r,i,o){var s=r(i,o),u=(s>>31)*2+1,l=s>>>23&255,c=s&8388607;return l===255?c?NaN:u*(1/0):l===0?u*1401298464324817e-60*c:u*Math.pow(2,l-150)*(c+8388608)}n.readFloatLE=e.bind(null,readUintLE),n.readFloatBE=e.bind(null,readUintBE)}(),typeof Float64Array!="undefined"?function(){var t=new Float64Array([-0]),e=new Uint8Array(t.buffer),r=e[7]===128;function i(l,c,d){t[0]=l,c[d]=e[0],c[d+1]=e[1],c[d+2]=e[2],c[d+3]=e[3],c[d+4]=e[4],c[d+5]=e[5],c[d+6]=e[6],c[d+7]=e[7]}function o(l,c,d){t[0]=l,c[d]=e[7],c[d+1]=e[6],c[d+2]=e[5],c[d+3]=e[4],c[d+4]=e[3],c[d+5]=e[2],c[d+6]=e[1],c[d+7]=e[0]}n.writeDoubleLE=r?i:o,n.writeDoubleBE=r?o:i;function s(l,c){return e[0]=l[c],e[1]=l[c+1],e[2]=l[c+2],e[3]=l[c+3],e[4]=l[c+4],e[5]=l[c+5],e[6]=l[c+6],e[7]=l[c+7],t[0]}function u(l,c){return e[7]=l[c],e[6]=l[c+1],e[5]=l[c+2],e[4]=l[c+3],e[3]=l[c+4],e[2]=l[c+5],e[1]=l[c+6],e[0]=l[c+7],t[0]}n.readDoubleLE=r?s:u,n.readDoubleBE=r?u:s}():function(){function t(r,i,o,s,u,l){var c=s<0?1:0;if(c&&(s=-s),s===0)r(0,u,l+i),r(1/s>0?0:2147483648,u,l+o);else if(isNaN(s))r(0,u,l+i),r(2146959360,u,l+o);else if(s>17976931348623157e292)r(0,u,l+i),r((c<<31|2146435072)>>>0,u,l+o);else{var d;if(s<22250738585072014e-324)d=s/5e-324,r(d>>>0,u,l+i),r((c<<31|d/4294967296)>>>0,u,l+o);else{var f=Math.floor(Math.log(s)/Math.LN2);f===1024&&(f=1023),d=s*Math.pow(2,-f),r(d*4503599627370496>>>0,u,l+i),r((c<<31|f+1023<<20|d*1048576&1048575)>>>0,u,l+o)}}}n.writeDoubleLE=t.bind(null,writeUintLE,0,4),n.writeDoubleBE=t.bind(null,writeUintBE,4,0);function e(r,i,o,s,u){var l=r(s,u+i),c=r(s,u+o),d=(c>>31)*2+1,f=c>>>20&2047,m=4294967296*(c&1048575)+l;return f===2047?m?NaN:d*(1/0):f===0?d*5e-324*m:d*Math.pow(2,f-1075)*(m+4503599627370496)}n.readDoubleLE=e.bind(null,readUintLE,0,4),n.readDoubleBE=e.bind(null,readUintBE,4,0)}(),n}function writeUintLE(n,t,e){t[e]=n&255,t[e+1]=n>>>8&255,t[e+2]=n>>>16&255,t[e+3]=n>>>24}function writeUintBE(n,t,e){t[e]=n>>>24,t[e+1]=n>>>16&255,t[e+2]=n>>>8&255,t[e+3]=n&255}function readUintLE(n,t){return(n[t]|n[t+1]<<8|n[t+2]<<16|n[t+3]<<24)>>>0}function readUintBE(n,t){return(n[t]<<24|n[t+1]<<16|n[t+2]<<8|n[t+3])>>>0}var inquire_1=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(n){}return null}var utf8$2={};(function(n){var t=n;t.length=function(r){for(var i=0,o=0,s=0;s<r.length;++s)o=r.charCodeAt(s),o<128?i+=1:o<2048?i+=2:(o&64512)===55296&&(r.charCodeAt(s+1)&64512)===56320?(++s,i+=4):i+=3;return i},t.read=function(r,i,o){var s=o-i;if(s<1)return"";for(var u=null,l=[],c=0,d;i<o;)d=r[i++],d<128?l[c++]=d:d>191&&d<224?l[c++]=(d&31)<<6|r[i++]&63:d>239&&d<365?(d=((d&7)<<18|(r[i++]&63)<<12|(r[i++]&63)<<6|r[i++]&63)-65536,l[c++]=55296+(d>>10),l[c++]=56320+(d&1023)):l[c++]=(d&15)<<12|(r[i++]&63)<<6|r[i++]&63,c>8191&&((u||(u=[])).push(String.fromCharCode.apply(String,l)),c=0);return u?(c&&u.push(String.fromCharCode.apply(String,l.slice(0,c))),u.join("")):String.fromCharCode.apply(String,l.slice(0,c))},t.write=function(r,i,o){for(var s=o,u,l,c=0;c<r.length;++c)u=r.charCodeAt(c),u<128?i[o++]=u:u<2048?(i[o++]=u>>6|192,i[o++]=u&63|128):(u&64512)===55296&&((l=r.charCodeAt(c+1))&64512)===56320?(u=65536+((u&1023)<<10)+(l&1023),++c,i[o++]=u>>18|240,i[o++]=u>>12&63|128,i[o++]=u>>6&63|128,i[o++]=u&63|128):(i[o++]=u>>12|224,i[o++]=u>>6&63|128,i[o++]=u&63|128);return o-s}})(utf8$2);var pool_1=pool;function pool(n,t,e){var r=e||8192,i=r>>>1,o=null,s=r;return function(l){if(l<1||l>i)return n(l);s+l>r&&(o=n(r),s=0);var c=t.call(o,s,s+=l);return s&7&&(s=(s|7)+1),c}}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=t;var n=requireMinimal();function t(o,s){this.lo=o>>>0,this.hi=s>>>0}var e=t.zero=new t(0,0);e.toNumber=function(){return 0},e.zzEncode=e.zzDecode=function(){return this},e.length=function(){return 1};var r=t.zeroHash="\0\0\0\0\0\0\0\0";t.fromNumber=function(s){if(s===0)return e;var u=s<0;u&&(s=-s);var l=s>>>0,c=(s-l)/4294967296>>>0;return u&&(c=~c>>>0,l=~l>>>0,++l>4294967295&&(l=0,++c>4294967295&&(c=0))),new t(l,c)},t.from=function(s){if(typeof s=="number")return t.fromNumber(s);if(n.isString(s))if(n.Long)s=n.Long.fromString(s);else return t.fromNumber(parseInt(s,10));return s.low||s.high?new t(s.low>>>0,s.high>>>0):e},t.prototype.toNumber=function(s){if(!s&&this.hi>>>31){var u=~this.lo+1>>>0,l=~this.hi>>>0;return u||(l=l+1>>>0),-(u+l*4294967296)}return this.lo+this.hi*4294967296},t.prototype.toLong=function(s){return n.Long?new n.Long(this.lo|0,this.hi|0,!!s):{low:this.lo|0,high:this.hi|0,unsigned:!!s}};var i=String.prototype.charCodeAt;return t.fromHash=function(s){return s===r?e:new t((i.call(s,0)|i.call(s,1)<<8|i.call(s,2)<<16|i.call(s,3)<<24)>>>0,(i.call(s,4)|i.call(s,5)<<8|i.call(s,6)<<16|i.call(s,7)<<24)>>>0)},t.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},t.prototype.zzEncode=function(){var s=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^s)>>>0,this.lo=(this.lo<<1^s)>>>0,this},t.prototype.zzDecode=function(){var s=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^s)>>>0,this.hi=(this.hi>>>1^s)>>>0,this},t.prototype.length=function(){var s=this.lo,u=(this.lo>>>28|this.hi<<4)>>>0,l=this.hi>>>24;return l===0?u===0?s<16384?s<128?1:2:s<2097152?3:4:u<16384?u<128?5:6:u<2097152?7:8:l<128?9:10},longbits}var hasRequiredMinimal;function requireMinimal(){return hasRequiredMinimal||(hasRequiredMinimal=1,function(n){var t=n;t.asPromise=aspromise,t.base64=base64$1,t.EventEmitter=eventemitter,t.float=float,t.inquire=inquire_1,t.utf8=utf8$2,t.pool=pool_1,t.LongBits=requireLongbits(),t.isNode=!!(typeof commonjsGlobal!="undefined"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),t.global=t.isNode&&commonjsGlobal||typeof window!="undefined"&&window||typeof self!="undefined"&&self||commonjsGlobal,t.emptyArray=Object.freeze?Object.freeze([]):[],t.emptyObject=Object.freeze?Object.freeze({}):{},t.isInteger=Number.isInteger||function(o){return typeof o=="number"&&isFinite(o)&&Math.floor(o)===o},t.isString=function(o){return typeof o=="string"||o instanceof String},t.isObject=function(o){return o&&typeof o=="object"},t.isset=t.isSet=function(o,s){var u=o[s];return u!=null&&o.hasOwnProperty(s)?typeof u!="object"||(Array.isArray(u)?u.length:Object.keys(u).length)>0:!1},t.Buffer=function(){try{var i=t.inquire("buffer").Buffer;return i.prototype.utf8Write?i:null}catch(o){return null}}(),t._Buffer_from=null,t._Buffer_allocUnsafe=null,t.newBuffer=function(o){return typeof o=="number"?t.Buffer?t._Buffer_allocUnsafe(o):new t.Array(o):t.Buffer?t._Buffer_from(o):typeof Uint8Array=="undefined"?o:new Uint8Array(o)},t.Array=typeof Uint8Array!="undefined"?Uint8Array:Array,t.Long=t.global.dcodeIO&&t.global.dcodeIO.Long||t.global.Long||t.inquire("long"),t.key2Re=/^true|false|0|1$/,t.key32Re=/^-?(?:0|[1-9][0-9]*)$/,t.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,t.longToHash=function(o){return o?t.LongBits.from(o).toHash():t.LongBits.zeroHash},t.longFromHash=function(o,s){var u=t.LongBits.fromHash(o);return t.Long?t.Long.fromBits(u.lo,u.hi,s):u.toNumber(!!s)};function e(i,o,s){for(var u=Object.keys(o),l=0;l<u.length;++l)(i[u[l]]===void 0||!s)&&(i[u[l]]=o[u[l]]);return i}t.merge=e,t.lcFirst=function(o){return o.charAt(0).toLowerCase()+o.substring(1)};function r(i){function o(s,u){if(!(this instanceof o))return new o(s,u);Object.defineProperty(this,"message",{get:function(){return s}}),Error.captureStackTrace?Error.captureStackTrace(this,o):Object.defineProperty(this,"stack",{value:new Error().stack||""}),u&&e(this,u)}return o.prototype=Object.create(Error.prototype,{constructor:{value:o,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return i},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),o}t.newError=r,t.ProtocolError=r("ProtocolError"),t.oneOfGetter=function(o){for(var s={},u=0;u<o.length;++u)s[o[u]]=1;return function(){for(var l=Object.keys(this),c=l.length-1;c>-1;--c)if(s[l[c]]===1&&this[l[c]]!==void 0&&this[l[c]]!==null)return l[c]}},t.oneOfSetter=function(o){return function(s){for(var u=0;u<o.length;++u)o[u]!==s&&delete this[o[u]]}},t.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},t._configure=function(){var i=t.Buffer;if(!i){t._Buffer_from=t._Buffer_allocUnsafe=null;return}t._Buffer_from=i.from!==Uint8Array.from&&i.from||function(s,u){return new i(s,u)},t._Buffer_allocUnsafe=i.allocUnsafe||function(s){return new i(s)}}}(minimal$1)),minimal$1}var writer=Writer$1,util$4=requireMinimal(),BufferWriter$1,LongBits$1=util$4.LongBits,base64=util$4.base64,utf8$1=util$4.utf8;function Op(n,t,e){this.fn=n,this.len=t,this.next=void 0,this.val=e}function noop(){}function State(n){this.head=n.head,this.tail=n.tail,this.len=n.len,this.next=n.states}function Writer$1(){this.len=0,this.head=new Op(noop,0,0),this.tail=this.head,this.states=null}var create$1=function n(){return util$4.Buffer?function(){return(Writer$1.create=function(){return new BufferWriter$1})()}:function(){return new Writer$1}};Writer$1.create=create$1(),Writer$1.alloc=function n(t){return new util$4.Array(t)},util$4.Array!==Array&&(Writer$1.alloc=util$4.pool(Writer$1.alloc,util$4.Array.prototype.subarray)),Writer$1.prototype._push=function n(t,e,r){return this.tail=this.tail.next=new Op(t,e,r),this.len+=e,this};function writeByte(n,t,e){t[e]=n&255}function writeVarint32(n,t,e){for(;n>127;)t[e++]=n&127|128,n>>>=7;t[e]=n}function VarintOp(n,t){this.len=n,this.next=void 0,this.val=t}VarintOp.prototype=Object.create(Op.prototype),VarintOp.prototype.fn=writeVarint32,Writer$1.prototype.uint32=function n(t){return this.len+=(this.tail=this.tail.next=new VarintOp((t=t>>>0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this},Writer$1.prototype.int32=function n(t){return t<0?this._push(writeVarint64,10,LongBits$1.fromNumber(t)):this.uint32(t)},Writer$1.prototype.sint32=function n(t){return this.uint32((t<<1^t>>31)>>>0)};function writeVarint64(n,t,e){for(;n.hi;)t[e++]=n.lo&127|128,n.lo=(n.lo>>>7|n.hi<<25)>>>0,n.hi>>>=7;for(;n.lo>127;)t[e++]=n.lo&127|128,n.lo=n.lo>>>7;t[e++]=n.lo}Writer$1.prototype.uint64=function n(t){var e=LongBits$1.from(t);return this._push(writeVarint64,e.length(),e)},Writer$1.prototype.int64=Writer$1.prototype.uint64,Writer$1.prototype.sint64=function n(t){var e=LongBits$1.from(t).zzEncode();return this._push(writeVarint64,e.length(),e)},Writer$1.prototype.bool=function n(t){return this._push(writeByte,1,t?1:0)};function writeFixed32(n,t,e){t[e]=n&255,t[e+1]=n>>>8&255,t[e+2]=n>>>16&255,t[e+3]=n>>>24}Writer$1.prototype.fixed32=function n(t){return this._push(writeFixed32,4,t>>>0)},Writer$1.prototype.sfixed32=Writer$1.prototype.fixed32,Writer$1.prototype.fixed64=function n(t){var e=LongBits$1.from(t);return this._push(writeFixed32,4,e.lo)._push(writeFixed32,4,e.hi)},Writer$1.prototype.sfixed64=Writer$1.prototype.fixed64,Writer$1.prototype.float=function n(t){return this._push(util$4.float.writeFloatLE,4,t)},Writer$1.prototype.double=function n(t){return this._push(util$4.float.writeDoubleLE,8,t)};var writeBytes=util$4.Array.prototype.set?function n(t,e,r){e.set(t,r)}:function n(t,e,r){for(var i=0;i<t.length;++i)e[r+i]=t[i]};Writer$1.prototype.bytes=function n(t){var e=t.length>>>0;if(!e)return this._push(writeByte,1,0);if(util$4.isString(t)){var r=Writer$1.alloc(e=base64.length(t));base64.decode(t,r,0),t=r}return this.uint32(e)._push(writeBytes,e,t)},Writer$1.prototype.string=function n(t){var e=utf8$1.length(t);return e?this.uint32(e)._push(utf8$1.write,e,t):this._push(writeByte,1,0)},Writer$1.prototype.fork=function n(){return this.states=new State(this),this.head=this.tail=new Op(noop,0,0),this.len=0,this},Writer$1.prototype.reset=function n(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Op(noop,0,0),this.len=0),this},Writer$1.prototype.ldelim=function n(){var t=this.head,e=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=t.next,this.tail=e,this.len+=r),this},Writer$1.prototype.finish=function n(){for(var t=this.head.next,e=this.constructor.alloc(this.len),r=0;t;)t.fn(t.val,e,r),r+=t.len,t=t.next;return e},Writer$1._configure=function(n){BufferWriter$1=n,Writer$1.create=create$1(),BufferWriter$1._configure()};var writer_buffer=BufferWriter,Writer=writer;(BufferWriter.prototype=Object.create(Writer.prototype)).constructor=BufferWriter;var util$3=requireMinimal();function BufferWriter(){Writer.call(this)}BufferWriter._configure=function(){BufferWriter.alloc=util$3._Buffer_allocUnsafe,BufferWriter.writeBytesBuffer=util$3.Buffer&&util$3.Buffer.prototype instanceof Uint8Array&&util$3.Buffer.prototype.set.name==="set"?function(t,e,r){e.set(t,r)}:function(t,e,r){if(t.copy)t.copy(e,r,0,t.length);else for(var i=0;i<t.length;)e[r++]=t[i++]}},BufferWriter.prototype.bytes=function n(t){util$3.isString(t)&&(t=util$3._Buffer_from(t,"base64"));var e=t.length>>>0;return this.uint32(e),e&&this._push(BufferWriter.writeBytesBuffer,e,t),this};function writeStringBuffer(n,t,e){n.length<40?util$3.utf8.write(n,t,e):t.utf8Write?t.utf8Write(n,e):t.write(n,e)}BufferWriter.prototype.string=function n(t){var e=util$3.Buffer.byteLength(t);return this.uint32(e),e&&this._push(writeStringBuffer,e,t),this},BufferWriter._configure();var reader=Reader$1,util$2=requireMinimal(),BufferReader$1,LongBits=util$2.LongBits,utf8=util$2.utf8;function indexOutOfRange(n,t){return RangeError("index out of range: "+n.pos+" + "+(t||1)+" > "+n.len)}function Reader$1(n){this.buf=n,this.pos=0,this.len=n.length}var create_array=typeof Uint8Array!="undefined"?function n(t){if(t instanceof Uint8Array||Array.isArray(t))return new Reader$1(t);throw Error("illegal buffer")}:function n(t){if(Array.isArray(t))return new Reader$1(t);throw Error("illegal buffer")},create=function n(){return util$2.Buffer?function(e){return(Reader$1.create=function(i){return util$2.Buffer.isBuffer(i)?new BufferReader$1(i):create_array(i)})(e)}:create_array};Reader$1.create=create(),Reader$1.prototype._slice=util$2.Array.prototype.subarray||util$2.Array.prototype.slice,Reader$1.prototype.uint32=function n(){var t=4294967295;return function(){if(t=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(t=(t|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return t;if((this.pos+=5)>this.len)throw this.pos=this.len,indexOutOfRange(this,10);return t}}(),Reader$1.prototype.int32=function n(){return this.uint32()|0},Reader$1.prototype.sint32=function n(){var t=this.uint32();return t>>>1^-(t&1)|0};function readLongVarint(){var n=new LongBits(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(n.lo=(n.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return n;if(n.lo=(n.lo|(this.buf[this.pos]&127)<<28)>>>0,n.hi=(n.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return n;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw indexOutOfRange(this);if(n.lo=(n.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return n}return n.lo=(n.lo|(this.buf[this.pos++]&127)<<t*7)>>>0,n}if(this.len-this.pos>4){for(;t<5;++t)if(n.hi=(n.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return n}else for(;t<5;++t){if(this.pos>=this.len)throw indexOutOfRange(this);if(n.hi=(n.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return n}throw Error("invalid varint encoding")}Reader$1.prototype.bool=function n(){return this.uint32()!==0};function readFixed32_end(n,t){return(n[t-4]|n[t-3]<<8|n[t-2]<<16|n[t-1]<<24)>>>0}Reader$1.prototype.fixed32=function n(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)},Reader$1.prototype.sfixed32=function n(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)|0};function readFixed64(){if(this.pos+8>this.len)throw indexOutOfRange(this,8);return new LongBits(readFixed32_end(this.buf,this.pos+=4),readFixed32_end(this.buf,this.pos+=4))}Reader$1.prototype.float=function n(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);var t=util$2.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},Reader$1.prototype.double=function n(){if(this.pos+8>this.len)throw indexOutOfRange(this,4);var t=util$2.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},Reader$1.prototype.bytes=function n(){var t=this.uint32(),e=this.pos,r=this.pos+t;if(r>this.len)throw indexOutOfRange(this,t);if(this.pos+=t,Array.isArray(this.buf))return this.buf.slice(e,r);if(e===r){var i=util$2.Buffer;return i?i.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,e,r)},Reader$1.prototype.string=function n(){var t=this.bytes();return utf8.read(t,0,t.length)},Reader$1.prototype.skip=function n(t){if(typeof t=="number"){if(this.pos+t>this.len)throw indexOutOfRange(this,t);this.pos+=t}else do if(this.pos>=this.len)throw indexOutOfRange(this);while(this.buf[this.pos++]&128);return this},Reader$1.prototype.skipType=function(n){switch(n){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(n=this.uint32()&7)!==4;)this.skipType(n);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+n+" at offset "+this.pos)}return this},Reader$1._configure=function(n){BufferReader$1=n,Reader$1.create=create(),BufferReader$1._configure();var t=util$2.Long?"toLong":"toNumber";util$2.merge(Reader$1.prototype,{int64:function(){return readLongVarint.call(this)[t](!1)},uint64:function(){return readLongVarint.call(this)[t](!0)},sint64:function(){return readLongVarint.call(this).zzDecode()[t](!1)},fixed64:function(){return readFixed64.call(this)[t](!0)},sfixed64:function(){return readFixed64.call(this)[t](!1)}})};var reader_buffer=BufferReader,Reader=reader;(BufferReader.prototype=Object.create(Reader.prototype)).constructor=BufferReader;var util$1=requireMinimal();function BufferReader(n){Reader.call(this,n)}BufferReader._configure=function(){util$1.Buffer&&(BufferReader.prototype._slice=util$1.Buffer.prototype.slice)},BufferReader.prototype.string=function n(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))},BufferReader._configure();var rpc={},service=Service,util=requireMinimal();(Service.prototype=Object.create(util.EventEmitter.prototype)).constructor=Service;function Service(n,t,e){if(typeof n!="function")throw TypeError("rpcImpl must be a function");util.EventEmitter.call(this),this.rpcImpl=n,this.requestDelimited=!!t,this.responseDelimited=!!e}Service.prototype.rpcCall=function n(t,e,r,i,o){if(!i)throw TypeError("request must be specified");var s=this;if(!o)return util.asPromise(n,s,t,e,r,i);if(!s.rpcImpl){setTimeout(function(){o(Error("already ended"))},0);return}try{return s.rpcImpl(t,e[s.requestDelimited?"encodeDelimited":"encode"](i).finish(),function(l,c){if(l)return s.emit("error",l,t),o(l);if(c===null){s.end(!0);return}if(!(c instanceof r))try{c=r[s.responseDelimited?"decodeDelimited":"decode"](c)}catch(d){return s.emit("error",d,t),o(d)}return s.emit("data",c,t),o(null,c)})}catch(u){s.emit("error",u,t),setTimeout(function(){o(u)},0);return}},Service.prototype.end=function n(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},function(n){var t=n;t.Service=service}(rpc);var roots={};(function(n){var t=n;t.build="minimal",t.Writer=writer,t.BufferWriter=writer_buffer,t.Reader=reader,t.BufferReader=reader_buffer,t.util=requireMinimal(),t.rpc=rpc,t.roots=roots,t.configure=e;function e(){t.util._configure(),t.Writer._configure(t.BufferWriter),t.Reader._configure(t.BufferReader)}e()})(indexMinimal);var minimal=indexMinimal;const $Reader$1=minimal.Reader,$util$1=minimal.util,$root$1=minimal.roots["@REALSEE/FIVE:five/loaders/model/proto/pbm.proto"]||(minimal.roots["@REALSEE/FIVE:five/loaders/model/proto/pbm.proto"]={}),Model$2=$root$1.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=$util$1.emptyArray,n.prototype.createAt=$util$1.Long?$util$1.Long.fromBits(0,0,!0):0,n.prototype.description="",n.decode=function(e,r){e instanceof $Reader$1||(e=$Reader$1.create(e));let i=r===void 0?e.len:e.pos+r,o=new $root$1.Model;for(;e.pos<i;){let s=e.uint32();switch(s>>>3){case 1:{o.chunks&&o.chunks.length||(o.chunks=[]),o.chunks.push($root$1.Chunk.decode(e,e.uint32()));break}case 2:{o.createAt=e.uint64();break}case 3:{o.description=e.string();break}default:e.skipType(s&7);break}}return o},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Model"},n})();$root$1.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 $Reader$1||(e=$Reader$1.create(e));let i=r===void 0?e.len:e.pos+r,o=new $root$1.Chunk;for(;e.pos<i;){let s=e.uint32();switch(s>>>3){case 1:{o.vertices=$root$1.Vertices.decode(e,e.uint32());break}case 2:{o.faces=$root$1.Faces.decode(e,e.uint32());break}case 3:{o.name=e.string();break}case 4:{o.texture=e.string();break}default:e.skipType(s&7);break}}if(!o.hasOwnProperty("vertices"))throw $util$1.ProtocolError("missing required 'vertices'",{instance:o});if(!o.hasOwnProperty("faces"))throw $util$1.ProtocolError("missing required 'faces'",{instance:o});if(!o.hasOwnProperty("name"))throw $util$1.ProtocolError("missing required 'name'",{instance:o});return o},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Chunk"},n})(),$root$1.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=$util$1.emptyArray,n.prototype.uvs=$util$1.emptyArray,n.prototype.marks=$util$1.emptyArray,n.decode=function(e,r){e instanceof $Reader$1||(e=$Reader$1.create(e));let i=r===void 0?e.len:e.pos+r,o=new $root$1.Vertices;for(;e.pos<i;){let s=e.uint32();switch(s>>>3){case 1:{if(o.xyz&&o.xyz.length||(o.xyz=[]),(s&7)===2){let u=e.uint32()+e.pos;for(;e.pos<u;)o.xyz.push(e.float())}else o.xyz.push(e.float());break}case 2:{if(o.uvs&&o.uvs.length||(o.uvs=[]),(s&7)===2){let u=e.uint32()+e.pos;for(;e.pos<u;)o.uvs.push(e.float())}else o.uvs.push(e.float());break}case 3:{if(o.marks&&o.marks.length||(o.marks=[]),(s&7)===2){let u=e.uint32()+e.pos;for(;e.pos<u;)o.marks.push(e.int32())}else o.marks.push(e.int32());break}default:e.skipType(s&7);break}}return o},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Vertices"},n})(),$root$1.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=$util$1.emptyArray,n.prototype.normals=$util$1.emptyArray,n.decode=function(e,r){e instanceof $Reader$1||(e=$Reader$1.create(e));let i=r===void 0?e.len:e.pos+r,o=new $root$1.Faces;for(;e.pos<i;){let s=e.uint32();switch(s>>>3){case 1:{if(o.indices&&o.indices.length||(o.indices=[]),(s&7)===2){let u=e.uint32()+e.pos;for(;e.pos<u;)o.indices.push(e.uint32())}else o.indices.push(e.uint32());break}case 2:{if(o.normals&&o.normals.length||(o.normals=[]),(s&7)===2){let u=e.uint32()+e.pos;for(;e.pos<u;)o.normals.push(e.float())}else o.normals.push(e.float());break}default:e.skipType(s&7);break}}return o},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Faces"},n})(),$root$1.VertexMark=(()=>{const n={},t=Object.create(n);return t[n[0]="VERTEX_MARK_UNSPECIFIED"]=0,t[n[1]="VERTEX_MARK_ROOF"]=1,t})();function loadPbm(n,t){var e,r,i,o={byteLength:0},s=autoRestImageOptionsByTextureLength((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),u={};if(t.textureArray)for(var l=0,c=t.textureArray;l<c.length;l++){var d=c[l];u[d]=loadTexture$1(d,s,t.fetcher)}return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"})}).then(function(f){return o.byteLength=f.body.byteLength,delay(function(){var m=new Uint8Array(f.body);return Model$2.decode(m)})}).then(function(f){return delay(function(){var m,A;return parse$2(f,(m=t.textureBaseUri)!==null&&m!==void 0?m:function(){var h=n.lastIndexOf("/");if(h>=0){var p=n.slice(0,h)+"/";return/\/model\/$/.test(p)&&(p=p.replace(/\/model\/$/,"/materials/")),p}return""}(),((A=t.textureArray)!==null&&A!==void 0?A:[]).slice(),s,u,t.fetcher)})}).then(function(f){var m=new THREE__namespace.Group;m.matrixAutoUpdate=!1,m.matrix.compose(m.position,m.quaternion,m.scale),m.name=n;for(var A=0,h=f.objects;A<h.length;A++){var p=h[A];m.add(p)}return f.texturePromise.then(function(){return{type:"pbm",uri:n,byteLength:o.byteLength,object:m,dispose:function(){return f.dispose()}}})})}function parseFloorName(n){var t=n.match(/(group|floor)-?(\d+)/);return t?parseInt(t[2],10):0}function parseChunkName(n){var t=n.match(/(chunk)-?(\d+)/);return t?parseInt(t[2],10):0}function parseSubName(n){var t=n.match(/(sub)-?(\d+)/);return t?parseInt(t[2],10):0}function chunkOrder(n){var t=parseFloorName(n.name),e=parseChunkName(n.name),r=parseSubName(n.name);return t*1e6+e*1e3+r}function parsePBMModel(n){for(var t,e,r,i=typeof n.createAt=="number"?n.createAt:0,o=(t=n.description)!==null&&t!==void 0?t:"",s=[],u=!0,l=!0,c=0,d=n.chunks;c<d.length;c++){var f=d[c];if(!f.vertices.marks||f.vertices.marks.length===0){l=!1;break}}for(var m=0,A=n.chunks;m<A.length;m++){var f=A[m];if(!f.faces.normals||f.faces.normals.length===0){u=!1;break}}for(var h=n.chunks.sort(function(re,oe){return chunkOrder(re)-chunkOrder(oe)}),p=[],y=0,v=h;y<v.length;y++){var f=v[y],g=parseFloorName(f.name);p[g]||(p[g]=[]),p[g].push(f)}for(var E=0;E<p.length;E++){var b=p[E];if(b)if(u){for(var T=0,_=0;_<b.length;_++){var f=b[_];T+=f.faces.indices.length}for(var x=new Float32Array(T*3),R=new Float32Array(T*2),w=new Float32Array(T*3),S=l?new Float32Array(T):void 0,C=[],I=[1/0,1/0,1/0,-1/0,-1/0,-1/0],H=0,B=0;B<b.length;B++){for(var L=[1/0,1/0,1/0,-1/0,-1/0,-1/0],f=b[B],O=f.vertices.xyz,k=f.vertices.uvs,K=f.faces.indices,z=f.faces.normals,N=f.vertices.marks,U=K.length,_=0;_<U;_++){var Q=K[_],G=x[H*3+_*3]=O[Q*3],q=x[H*3+_*3+1]=O[Q*3+1],j=x[H*3+_*3+2]=O[Q*3+2];S&&(S[H+_]=N[Q]),R[H*2+_*2]=k[Q*2],R[H*2+_*2+1]=k[Q*2+1];var X=Math.floor(_/3)*3;w[H*3+_*3]=z[X],w[H*3+_*3+1]=z[X+1],w[H*3+_*3+2]=z[X+2],G<L[0]&&(L[0]=G),q<L[1]&&(L[1]=q),j<L[2]&&(L[2]=j),G>L[3]&&(L[3]=G),q>L[4]&&(L[4]=q),j>L[5]&&(L[5]=j)}L[0]<I[0]&&(I[0]=L[0]),L[1]<I[1]&&(I[1]=L[1]),L[2]<I[2]&&(I[2]=L[2]),L[3]>I[3]&&(I[3]=L[3]),L[4]>I[4]&&(I[4]=L[4]),L[5]>I[5]&&(I[5]=L[5]),C.push({materialIndex:B,name:f.name,chunkName:parseChunkName(f.name),start:H,count:f.faces.indices.length,texture:(e=f.texture)!==null&&e!==void 0?e:void 0}),H+=U}var ae={createAt:i,description:o,vertices:x,uvs:R,normals:w,masks:S,indices:null,floorIndex:E,groups:C,extents:I};s.push(ae)}else{for(var T=0,W=0,_=0;_<b.length;_++){var f=b[_];W+=f.vertices.xyz.length/3,T+=f.faces.indices.length}for(var x=new Float32Array(W*3),R=new Float32Array(W*2),w=void 0,te=new Float32Array(W),ee=new Uint32Array(T),S=l?new Float32Array(T):void 0,C=[],I=[1/0,1/0,1/0,-1/0,-1/0,-1/0],ie=0,H=0,B=0;B<b.length;B++){for(var L=[1/0,1/0,1/0,-1/0,-1/0,-1/0],f=b[B],O=f.vertices.xyz,$=f.vertices.marks,k=f.vertices.uvs,K=f.faces.indices,se=O.length/3,U=K.length,_=0;_<se;_++){var G=x[H*3+_*3]=O[_*3],q=x[H*3+_*3+1]=O[_*3+1],j=x[H*3+_*3+2]=O[_*3+2];S&&(S[H+_]=$[_]),R[H*2+_*2]=k[_*2],R[H*2+_*2+1]=k[_*2+1],te[H+_]=E,G<L[0]&&(L[0]=G),q<L[1]&&(L[1]=q),j<L[2]&&(L[2]=j),G>L[3]&&(L[3]=G),q>L[4]&&(L[4]=q),j>L[5]&&(L[5]=j)}L[0]<I[0]&&(I[0]=L[0]),L[1]<I[1]&&(I[1]=L[1]),L[2]<I[2]&&(I[2]=L[2]),L[3]>I[3]&&(I[3]=L[3]),L[4]>I[4]&&(I[4]=L[4]),L[5]>I[5]&&(I[5]=L[5]);for(var _=0;_<U;_++)ee[ie+_]=H+K[_];C.push({materialIndex:B,name:f.name,chunkName:parseChunkName(f.name),start:ie,count:f.faces.indices.length,texture:(r=f.texture)!==null&&r!==void 0?r:void 0}),H+=se,ie+=U}var ae={createAt:i,description:o,vertices:x,uvs:R,normals:w,masks:S,indices:ee,floorIndex:E,groups:C,extents:I};s.push(ae)}}return s}function loadTexture$1(n,t,e,r){var i=__assign({key:"texture.pbm"},pick(t,["format","quality","size","sharpen","mappings"])),o=new TextureLoader,s=o.loadTexture(n,{imageURL:{transform:t.transform,options:i},encoding:THREE__namespace.sRGBEncoding,wrapS:THREE__namespace.ClampToEdgeWrapping,wrapT:THREE__namespace.ClampToEdgeWrapping,minFilter:THREE__namespace.LinearFilter,maxSize:typeof i.size=="number"?new THREE__namespace.Vector2(i.size,i.size):void 0,fetcher:e}).then(function(u){var l=u.body;return l.needsUpdate=!0,l});return Object.assign(s,{url:n,textureOptions:t})}function parse$2(n,t,e,r,i,o,s){i===void 0&&(i={});for(var u=parsePBMModel(n),l=0,c="",d=[],f={},m=new Set,A=0,h=u;A<h.length;A++){var p=h[A],y=p.createAt,v=p.description,g=p.vertices,E=p.masks,b=p.uvs,T=p.normals,_=p.indices,x=p.floorIndex,R=p.groups,w=p.extents,S=new THREE__namespace.Box3;S.min.x=w[0],S.min.y=w[1],S.min.z=w[2],S.max.x=w[3],S.max.y=w[4],S.max.z=w[5];var C=new THREE__namespace.BufferGeometry;C.setAttribute("position",new THREE__namespace.BufferAttribute(g,3)),C.setAttribute("uv",new THREE__namespace.BufferAttribute(b,2)),T&&C.setAttribute("normal",new THREE__namespace.BufferAttribute(T,3)),E&&C.setAttribute("mask",new THREE__namespace.BufferAttribute(E,1)),_&&C.setIndex(new THREE__namespace.BufferAttribute(_,1)),C.boundingBox=S,C.boundingSphere=S.getBoundingSphere(new THREE__namespace.Sphere);for(var I=0,H=R;I<H.length;I++){var B=H[I];C.addGroup(B.start,B.count,B.materialIndex)}m.add(C);for(var L=[],O=0,k=R;O<k.length;O++){var B=k[O],K=e[B.chunkName]||(B.texture?pathJoin(t||"",B.texture):void 0),z=new PBMMeshMaterial("basic");z.defines.USE_VERTEX_FLOOR=!1,z.floor=x,C.attributes.normal===void 0&&(z.flatShading=!0),C.attributes.mask&&(z.defines.USE_VERTEX_MARK=!0),L.push(z),K?f[K]?f[K].push(z):f[K]=[z]:z.color=new THREE__namespace.Color(16777215),m.add(z)}var N=new PBMMesh(C,L);N.name="model_floor_"+x,N.userData.createAt=y,N.userData.description=v,N.matrix.compose(N.position,N.quaternion,N.scale),N.matrixAutoUpdate=!1,N.frustumCulled=!1,l=y,c=v,d.push(N)}var U="",Q=function(q){q=autoRestImageOptionsByTextureLength(q,e.length);var j=[],X=jsonHash(q);if(U===X)return Promise.resolve();U=X;for(var ae=function(ie){var $=null;ie in i&&(jsonHash(i[ie].textureOptions)===jsonHash(q)?$=i[ie]:i[ie].then(function(se){return se.dispose()})),$||($=loadTexture$1(ie,q,o)),j.push($.then(function(se){if(U!==X){se.dispose();return}for(var re=0,oe=f[ie];re<oe.length;re++){var pe=oe[re];pe.map&&(m.delete(pe.map),pe.map.dispose()),pe.map=se,m.add(se)}}).catch(function(){if(U===X)for(var se=0,re=f[ie];se<re.length;se++){var oe=re[se];oe.map&&(m.delete(oe.map),oe.map.dispose()),oe.map=null,oe.color=new THREE__namespace.Color(16777215)}}))},W=0,te=Object.keys(f);W<te.length;W++){var ee=te[W];ae(ee)}for(var ee in i)delete i[ee];return Promise.all(j).then(function(){})},G=Q(r);return{createAt:l,description:c,objects:d,texturePromise:G,updateTexture:Q,dispose:function(){m.forEach(function(q){q.dispose()}),m.clear()}}}function autoRestImageOptionsByTextureLength(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 loadAt3d(n,t){var e,r,i,o={byteLength:0},s=autoRestImageOptionsByTextureLength((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),u={};if(t.textureArray)for(var l=0,c=t.textureArray;l<c.length;l++){var d=c[l];u[d]=loadTexture$1(d,s,t.fetcher)}return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"})}).then(function(f){return lzma(f.body)}).then(function(f){return delay(function(){for(var m,A={chunks:[],createAt:void 0,description:void 0},h=0,p=f;h<p.length;h++){var y=p[h],v=Model$2.decode(y);v.chunks.length&&((m=A.chunks).push.apply(m,v.chunks),A.createAt=v.createAt,A.description=v.description)}return A})}).then(function(f){return delay(function(){var m,A,h;return parse$2(f,(m=t.textureBaseUri)!==null&&m!==void 0?m:function(){var p=n.lastIndexOf("/");if(p>=0){var y=n.slice(0,p)+"/";return/\/model\/$/.test(y)&&(y=y.replace(/\/model\/$/,"/materials/")),y}return""}(),((A=t.textureArray)!==null&&A!==void 0?A:[]).slice(),(h=t.textureOptions)!==null&&h!==void 0?h:{},u,t.fetcher)})}).then(function(f){var m=new THREE__namespace.Group;m.name=n;for(var A=0,h=f.objects;A<h.length;A++){var p=h[A];m.add(p)}return f.texturePromise.then(function(){return{type:"at3d",uri:n,byteLength:o.byteLength,object:m,dispose:function(){return f.dispose()}}})})}const $Reader=minimal.Reader,$util=minimal.util,$root=minimal.roots["@REALSEE/FIVE:five/loaders/model/proto/dome.proto"]||(minimal.roots["@REALSEE/FIVE:five/loaders/model/proto/dome.proto"]={}),Model$1=$root.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=$util.emptyArray,n.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));let i=r===void 0?e.len:e.pos+r,o=new $root.Model;for(;e.pos<i;){let s=e.uint32();switch(s>>>3){case 1:{o.meshes&&o.meshes.length||(o.meshes=[]),o.meshes.push($root.Mesh.decode(e,e.uint32()));break}default:e.skipType(s&7);break}}return o},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Model"},n})();$root.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=$util.emptyArray,n.prototype.matrix=$util.emptyArray,n.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));let i=r===void 0?e.len:e.pos+r,o=new $root.Mesh;for(;e.pos<i;){let s=e.uint32();switch(s>>>3){case 1:{o.name=e.string();break}case 2:{o.chunks&&o.chunks.length||(o.chunks=[]),o.chunks.push($root.Chunk.decode(e,e.uint32()));break}case 3:{o.matrix&&o.matrix.length||(o.matrix=[]),o.matrix.push($root.Matrix.decode(e,e.uint32()));break}default:e.skipType(s&7);break}}if(!o.hasOwnProperty("name"))throw $util.ProtocolError("missing required 'name'",{instance:o});return o},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Mesh"},n})(),$root.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=$util.emptyArray,n.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));let i=r===void 0?e.len:e.pos+r,o=new $root.Matrix;for(;e.pos<i;){let s=e.uint32();switch(s>>>3){case 1:{if(o.elements&&o.elements.length||(o.elements=[]),(s&7)===2){let u=e.uint32()+e.pos;for(;e.pos<u;)o.elements.push(e.float())}else o.elements.push(e.float());break}default:e.skipType(s&7);break}}return o},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Matrix"},n})(),$root.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=$util.emptyArray,n.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));let i=r===void 0?e.len:e.pos+r,o=new $root.Chunk;for(;e.pos<i;){let s=e.uint32();switch(s>>>3){case 2:{o.geometry=$root.Geometry.decode(e,e.uint32());break}case 3:{o.material&&o.material.length||(o.material=[]),o.material.push($root.Material.decode(e,e.uint32()));break}default:e.skipType(s&7);break}}if(!o.hasOwnProperty("geometry"))throw $util.ProtocolError("missing required 'geometry'",{instance:o});return o},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Chunk"},n})(),$root.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=$util.emptyArray,n.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));let i=r===void 0?e.len:e.pos+r,o=new $root.Geometry;for(;e.pos<i;){let s=e.uint32();switch(s>>>3){case 1:{o.position=$root.Position.decode(e,e.uint32());break}case 2:{o.uv=$root.UV.decode(e,e.uint32());break}case 3:{o.uv2=$root.UV.decode(e,e.uint32());break}case 4:{o.normal=$root.Normal.decode(e,e.uint32());break}case 5:{o.groups&&o.groups.length||(o.groups=[]),o.groups.push($root.Group.decode(e,e.uint32()));break}default:e.skipType(s&7);break}}if(!o.hasOwnProperty("position"))throw $util.ProtocolError("missing required 'position'",{instance:o});if(!o.hasOwnProperty("normal"))throw $util.ProtocolError("missing required 'normal'",{instance:o});return o},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Geometry"},n})(),$root.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=$util.emptyArray,n.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));let i=r===void 0?e.len:e.pos+r,o=new $root.Position;for(;e.pos<i;){let s=e.uint32();switch(s>>>3){case 1:{if(o.array&&o.array.length||(o.array=[]),(s&7)===2){let u=e.uint32()+e.pos;for(;e.pos<u;)o.array.push(e.float())}else o.array.push(e.float());break}default:e.skipType(s&7);break}}return o},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Position"},n})(),$root.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=$util.emptyArray,n.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));let i=r===void 0?e.len:e.pos+r,o=new $root.UV;for(;e.pos<i;){let s=e.uint32();switch(s>>>3){case 1:{if(o.array&&o.array.length||(o.array=[]),(s&7)===2){let u=e.uint32()+e.pos;for(;e.pos<u;)o.array.push(e.float())}else o.array.push(e.float());break}default:e.skipType(s&7);break}}return o},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/UV"},n})(),$root.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=$util.emptyArray,n.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));let i=r===void 0?e.len:e.pos+r,o=new $root.Normal;for(;e.pos<i;){let s=e.uint32();switch(s>>>3){case 1:{if(o.array&&o.array.length||(o.array=[]),(s&7)===2){let u=e.uint32()+e.pos;for(;e.pos<u;)o.array.push(e.float())}else o.array.push(e.float());break}default:e.skipType(s&7);break}}return o},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Normal"},n})(),$root.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 $Reader||(e=$Reader.create(e));let i=r===void 0?e.len:e.pos+r,o=new $root.Group;for(;e.pos<i;){let s=e.uint32();switch(s>>>3){case 1:{o.start=e.uint32();break}case 2:{o.count=e.uint32();break}case 3:{o.materialIndex=e.uint32();break}default:e.skipType(s&7);break}}if(!o.hasOwnProperty("start"))throw $util.ProtocolError("missing required 'start'",{instance:o});if(!o.hasOwnProperty("count"))throw $util.ProtocolError("missing required 'count'",{instance:o});if(!o.hasOwnProperty("materialIndex"))throw $util.ProtocolError("missing required 'materialIndex'",{instance:o});return o},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Group"},n})(),$root.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 $Reader||(e=$Reader.create(e));let i=r===void 0?e.len:e.pos+r,o=new $root.Material;for(;e.pos<i;){let s=e.uint32();switch(s>>>3){case 1:{o.kd=$root.Color.decode(e,e.uint32());break}case 2:{o.ks=$root.Color.decode(e,e.uint32());break}case 3:{o.ke=$root.Color.decode(e,e.uint32());break}case 4:{o.mapkd=e.string();break}case 5:{o.mapks=e.string();break}case 6:{o.mapke=e.string();break}case 7:{o.norm=e.string();break}case 8:{o.mapbump=e.string();break}case 9:{o.bump=e.string();break}case 10:{o.mapd=e.string();break}case 11:{o.ns=e.float();break}case 12:{o.d=e.float();break}case 13:{o.tr=e.float();break}case 14:{o.mapkdrepeat=e.string();break}default:e.skipType(s&7);break}}return o},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Material"},n})(),$root.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=$util.emptyArray,n.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));let i=r===void 0?e.len:e.pos+r,o=new $root.Color;for(;e.pos<i;){let s=e.uint32();switch(s>>>3){case 1:{if(o.rgb&&o.rgb.length||(o.rgb=[]),(s&7)===2){let u=e.uint32()+e.pos;for(;e.pos<u;)o.rgb.push(e.float())}else o.rgb.push(e.float());break}default:e.skipType(s&7);break}}return o},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Color"},n})();function loadDome(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,parse$1(new Uint8Array(r.body),t.textureBaseUri||"",t.textureOptions,t.fetcher)}).then(function(r){var i=new THREE__namespace.Group;i.matrixAutoUpdate=!1,i.matrix.compose(i.position,i.quaternion,i.scale),i.name=n;for(var o=0,s=r.objects;o<s.length;o++){var u=s[o];i.add(u)}return r.texturePromise.then(function(){return{type:"dome",uri:n,byteLength:e.byteLength,object:i,dispose:function(){return r.dispose()}}})})}function flipBufferGeometryNormals(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 parseGeometry(n){var t=n.position,e=n.normal,r=n.uv,i=n.uv2,o=n.groups,s=new THREE__namespace.BufferGeometry;s.setAttribute("position",new THREE__namespace.BufferAttribute(new Float32Array(t.array),3)),e&&s.setAttribute("normal",new THREE__namespace.BufferAttribute(new Float32Array(e.array),3)),r&&s.setAttribute("uv",new THREE__namespace.BufferAttribute(new Float32Array(r.array),2)),i&&s.setAttribute("uv2",new THREE__namespace.BufferAttribute(new Float32Array(i.array),2));for(var u=0,l=o;u<l.length;u++){var c=l[u];s.addGroup(c.start,c.count,c.materialIndex)}return s}function loadTexture(n,t,e,r,i,o,s){if(s.hasOwnProperty(n))return s[n];n=n.split("?")[0],isAbsoluteURL(n)||(n=pathJoin(t,n)),n=n.replace(/\/\/vrlab-image\d*.ljcdn.com\//,"//vrlab-public.ljcdn.com/"),n.indexOf("//")===0&&(n="https:"+n);var u=__assign({key:"texture.dome",size:64},pick(e,["quality","format","sharpen","mappings"])),l=s[n]=i.loadTexture(n,{imageURL:{transform:e.transform,options:u},wrapS:THREE__namespace.RepeatWrapping,wrapT:THREE__namespace.RepeatWrapping,fetcher:o}).then(function(c){var d=c.body;return r&&d.repeat.copy(r),d.needsUpdate=!0,d.updateMatrix(),d});return l}function parseMaterial(n,t,e,r,i,o,s){var u=[],l=new PBMMeshMaterial("phong");if(s.add(l),n.kd&&(l.color=new THREE__namespace.Color().fromArray(n.kd.rgb).convertLinearToSRGB()),n.mapkd){var c=null;if(n.mapkdrepeat){var d=n.mapkdrepeat.split(/\s+/).map(function(h){return Number(h)}),f=d[0],m=d[1];c=new THREE__namespace.Vector2(f,m)}u.push(loadTexture(n.mapkd,t,e,c,r,i,o).then(function(h){h.encoding=THREE__namespace.sRGBEncoding,l.map=h,s.add(h),l.needsUpdate=!0}).catch(noop$1))}if(n.ks&&(l.specular=new THREE__namespace.Color().fromArray(n.ks.rgb).convertLinearToSRGB()),n.mapks&&u.push(loadTexture(n.mapks,t,e,null,r,i,o).then(function(h){l.specularMap=h,s.add(h)}).catch(noop$1)),n.ke&&(l.emissive=new THREE__namespace.Color().fromArray(n.ke.rgb).convertLinearToSRGB()),n.mapke&&u.push(loadTexture(n.mapke,t,e,null,r,i,o).then(function(h){h.encoding=THREE__namespace.sRGBEncoding,l.emissiveMap=h,s.add(h)}).catch(noop$1)),n.norm&&u.push(loadTexture(n.norm,t,e,null,r,i,o).then(function(h){l.normalMap=h,s.add(h)}).catch(noop$1)),n.mapbump&&u.push(loadTexture(n.mapbump,t,e,null,r,i,o).then(function(h){l.bumpMap=h,s.add(h)}).catch(noop$1)),n.bump&&u.push(loadTexture(n.bump,t,e,null,r,i,o).then(function(h){l.bumpMap=h,s.add(h)}).catch(noop$1)),typeof n.ns=="number"&&(l.shininess=n.ns),typeof n.d=="number"){var A=n.d;A>0&&A<1&&(l.opacity=A)}return l.floor=0,l.defines.USE_VERTEX_FLOOR=!1,{material:l,textureReady:Promise.all(u).then(noop$1)}}function fromProtoBuf(n){return Model$1.decode(n).meshes}function parse$1(n,t,e,r){for(var i=[],o=[],s=new Set,u=fromProtoBuf(n),l=new TextureLoader,c=new THREE__namespace.Matrix4,d=new THREE__namespace.Vector3,f=new THREE__namespace.Quaternion,m=new THREE__namespace.Vector3,A={},h=0,p=u;h<p.length;h++){var y=p[h],v=y.name,g=y.chunks,E=y.matrix;if(!(v==="Ceiling"||v==="CeilingDrop"))for(var b=0,T=E;b<T.length;b++){var _=T[b];c.elements=_.elements;for(var x=new THREE__namespace.Group,R=0;R<g.length;R++){var w=parseGeometry(g[R].geometry);w.applyMatrix4(c),c.decompose(d,f,m),m.x*m.y*m.z<0&&w.attributes.normal&&w.attributes.position&&w.attributes.uv&&flipBufferGeometryNormals(w),s.add(w);for(var S=[],C=0,I=g[R].material;C<I.length;C++){var H=I[C],B=parseMaterial(H,t||"",e,l,r,A,s),L=B.material,O=B.textureReady;o.push(O),S.push(L)}var k=new PBMMesh(w,S);k.name="chunk_"+R,k.matrix.compose(k.position,k.quaternion,k.scale),k.matrixAutoUpdate=!1,k.frustumCulled=!1,x.add(k)}x.name=v,i.push(x)}}var K=Promise.all(o).catch(noop$1),z=function(N){return Promise.resolve()};return{createAt:0,description:"",objects:i,texturePromise:K,updateTexture:z,dispose:function(){s.forEach(function(N){N.dispose()}),s.clear()}}}function loadDomez(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,lzma(r.body)}).then(function(r){var i=r.reduce(function(u,l){return u+l.length},0),o=new Uint8Array(i),s=0;return r.forEach(function(u){o.set(u,s),s+=u.length}),o}).then(function(r){return parse$1(r,t.textureBaseUri||"",t.textureOptions,t.fetcher)}).then(function(r){var i=new THREE__namespace.Group;i.name=n;for(var o=0,s=r.objects;o<s.length;o++){var u=s[o];i.add(u)}return r.texturePromise.then(function(){return{type:"domez",uri:n,byteLength:e.byteLength,object:i,dispose:function(){return r.dispose()}}})})}var ROTATE_X_MATRIX=new THREE__namespace.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function loadGlb(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 parseGltf(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 THREE__namespace.Matrix4;if(t.upAxis!=="Z"&&i.premultiply(ROTATE_X_MATRIX),r.CESIUM_RTC){var o=new THREE__namespace.Matrix4().setPosition(r.CESIUM_RTC.center);i.premultiply(o)}var s=r.scene;return s.applyMatrix4(i),{type:"glb",uri:n,byteLength:e,object:s,dispose:function(){return r.dispose()}}})}var scratchVector3$2=new THREE__namespace.Vector3,scratchMatrix4$3=new THREE__namespace.Matrix4;function attachTileAttributes(n,t){n.name=t.id;var e=t.tileset.properties.floorInfo;n.traverse(function(r){if("floor"in t.extras){if(r instanceof THREE__namespace.Mesh||r instanceof THREE__namespace.Points)for(var i=Array.isArray(r.material)?r.material:r.material?[r.material]:[],o=0,s=i;o<s.length;o++){var u=s[o];(u instanceof PBMMeshMaterial||u instanceof PBMPointCloudMaterial)&&(u.floor=t.extras.floor)}}else if((r instanceof PBMMesh||r instanceof PBMPointCloud)&&e){var l=r.geometry.index,c=r.geometry.getAttribute("position"),d=0,f=new Float32Array(c.count);if(e)if(l){for(var m=0,A=l.count,h=0;h<A;h++){var b=l.array[h];scratchVector3$2.set(c.array[b*3+0],c.array[b*3+1],c.array[b*3+2]),scratchVector3$2.applyMatrix4(r.matrixWorld);var p=scratchVector3$2.y;f[b]=0;for(var y=0;y<e.length;y++){var T=e[y],g=T.ground,E=T.height;if(p<g+E){f[b]=y;break}}m+=f[b]}d=m/A}else{for(var m=0,A=c.count,h=0;h<A;h++){scratchVector3$2.set(c.array[h*3+0],c.array[h*3+1],c.array[h*3+2]),scratchVector3$2.applyMatrix4(r.matrixWorld);var p=scratchVector3$2.y;f[h]=0;for(var y=0;y<e.length;y++){var v=e[y],g=v.ground,E=v.height;if(p<g+E){f[h]=y;break}}m+=f[h]}d=m/A}t.floor=d,r.geometry.setAttribute("floor",new THREE__namespace.BufferAttribute(f,1)),Array.isArray(r.material)?r.material.forEach(function(_){_.defines.USE_VERTEX_FLOOR=!0,_.needsUpdate=!0}):(r.material.defines.USE_VERTEX_FLOOR=!0,r.material.needsUpdate=!0)}})}function loadTileContentData(n,t){if(!n.content)return Promise.resolve(null);var e=n.content,r=appendSearch(e.uri,t.search);if(n.type==="TILESET"){var i=imageURL(r,{key:"model.".concat(n.siblingIndex)});return t.fetcher.ajax(i,{responseType:"text"}).then(function(o){return o.body}).then(function(o){var s=r.slice(0,r.lastIndexOf("/")+1);return normalizeTilesetHeader(JSON.parse(o),s)}).then(function(o){n.children.length===0&&(n.children=[new Tile("".concat(n.id,".0"),o.root,n.tileset,n)])}).then(function(){return null})}return n.type==="SCENEGRAPH"?Promise.resolve().then(function(){var o,s,u,l,c,d,f,m,A,h,p="",y=r.split("#"),v=y[0],g=y[1],E=(g||v).split("?")[0].match(/\.([0-9a-zA-Z]+)$/);if(E&&(p=E[1]),p==="b3dm"){var b=imageURL(r,{key:"model.".concat(n.siblingIndex)});return loadB3dm(b,{upAxis:n.tileset.asset.gltfUpAxis,fetcher:t.fetcher}).then(function(T){return T.object.applyMatrix4(n.transform),T.object.updateWorldMatrix(!1,!0),T.object.matrixAutoUpdate=!1,attachTileAttributes(T.object,n),T})}if(p==="pnts"){var b=imageURL(r,{key:"model.".concat(n.siblingIndex)});return loadPnts(b,{fetcher:t.fetcher,computeBoundingBox:!1}).then(function(_){if(_.object.applyMatrix4(n.transform),_.object.updateWorldMatrix(!1,!0),_.object.matrixAutoUpdate=!1,n.boundingVolume){var x=n.boundingVolume;_.object.traverse(function(R){if(R instanceof PBMPointCloud){scratchMatrix4$3.getInverse(R.matrixWorld);var w=new THREE__namespace.Box3;x.getBoundingBox(w),w.applyMatrix4(scratchMatrix4$3),R.geometry.boundingBox=w}})}return _})}if(p==="glb"){var b=imageURL(r,{key:"model.".concat(n.siblingIndex)});return loadGlb(b,{upAxis:n.tileset.asset.gltfUpAxis,fetcher:t.fetcher}).then(function(_){return _.object.applyMatrix4(n.transform),_.object.updateWorldMatrix(!1,!0),_.object.matrixAutoUpdate=!1,attachTileAttributes(_.object,n),_})}if(p==="at3d"){var b=n.extras.at3d?r:imageURL(r,{key:"model.".concat(n.siblingIndex)});return loadAt3d(b,{textureBaseUri:(o=n.extras.at3d)===null||o===void 0?void 0:o.textureBaseUri,textureArray:(s=n.extras.at3d)===null||s===void 0?void 0:s.textureArray,textureOptions:(u=n.extras.at3d)===null||u===void 0?void 0:u.textureOptions,fetcher:t.fetcher}).then(function(_){return _.object.applyMatrix4(n.transform),_.object.updateWorldMatrix(!1,!0),_.object.matrixAutoUpdate=!1,_})}if(p==="pbm"){var b=n.extras.pbm?r:imageURL(r,{key:"model.".concat(n.siblingIndex)});return loadPbm(b,{textureBaseUri:(l=n.extras.pbm)===null||l===void 0?void 0:l.textureBaseUri,textureArray:(c=n.extras.pbm)===null||c===void 0?void 0:c.textureArray,textureOptions:(d=n.extras.pbm)===null||d===void 0?void 0:d.textureOptions,fetcher:t.fetcher}).then(function(_){return _.object.applyMatrix4(n.transform),_.object.updateWorldMatrix(!1,!0),_.object.matrixAutoUpdate=!1,_})}if(p==="dome"){var b=n.extras.dome?r:imageURL(r,{key:"model.".concat(n.siblingIndex)});return loadDome(b,{textureBaseUri:(f=n.extras.dome)===null||f===void 0?void 0:f.textureBaseUri,textureOptions:(m=n.extras.dome)===null||m===void 0?void 0:m.textureOptions,fetcher:t.fetcher}).then(function(_){return _.object.applyMatrix4(n.transform),_.object.updateWorldMatrix(!1,!0),_.object.matrixAutoUpdate=!1,_})}if(p==="domez"){var b=n.extras.domez?r:imageURL(r,{key:"model.".concat(n.siblingIndex)});return loadDomez(b,{textureBaseUri:(A=n.extras.domez)===null||A===void 0?void 0:A.textureBaseUri,textureOptions:(h=n.extras.domez)===null||h===void 0?void 0:h.textureOptions,fetcher:t.fetcher}).then(function(_){return _.object.applyMatrix4(n.transform),_.object.updateWorldMatrix(!1,!0),_.object.matrixAutoUpdate=!1,_})}return null}).then(function(o){if(!o)return Promise.resolve(null);o.object.traverse(function(u){if(u instanceof PBMPointCloud)u.material.uniforms.geometricError.value=n.geometricError;else if(u instanceof PBMMesh)for(var l=0,c=u.material;l<c.length;l++){var d=c[l];d.uniforms.geometricError.value=n.geometricError}});var s={type:o.type,uri:o.uri,byteLength:o.byteLength,object:new TileNode(o.object,o.dispose)};return s.object.name=n.id,Promise.resolve().then(function(){return s.object.generateBvhTree()}).then(function(){return s}).catch(function(u){return unloadTileContentData(s),Promise.reject(u)})}):Promise.resolve(null)}function unloadTileContentData(n){n&&n.object.dispose()}var scratchVector3$1=new THREE__namespace.Vector3,scratchMatrix3=new THREE__namespace.Matrix3,scratchMatrix4$2=new THREE__namespace.Matrix4,a=6378137,invF=298.257223563;function ecefToLla(n){for(var t=a-a/invF,e=(a*a-t*t)/(a*a),r=Math.sqrt(n.x*n.x+n.y*n.y),i=1e-12,o=1e3,s=0,u=Math.atan2(n.z,r),l=0;s++<o;){var c=Math.sin(u),d=a/Math.sqrt(1-e*c*c);l=r/Math.cos(u)-d;var f=Math.atan2(n.z/(d*(1-e)+l),r/(d+l));if(isNaN(f))break;var m=Math.abs(f-u);if(m<i)break;u=f}return n.set(u,Math.atan2(n.y,n.x),l)}function llaToEcef(n){var t=n.x,e=n.y,r=n.z,i=a-a/invF,o=(a*a-i*i)/(a*a),s=Math.sin(t),u=Math.cos(t),l=Math.sin(e),c=Math.cos(e),d=a/Math.sqrt(1-o*s*s),f=(d+r)*u*c,m=(d+r)*u*l,A=(i*i/(a*a)*d+r)*s;return n.set(f,m,A)}function getEcefToEnuMatrix(n,t){var e=ecefToLla(scratchVector3$1.copy(n)),r=e.x,i=e.y,o=e.z,s=Math.sin(r),u=Math.sin(i),l=Math.cos(r),c=Math.cos(i);t.fromArray([-u,-s*c,l*c,0,+c,-s*u,l*u,0,0,l,s,0,0,0,0,1]);var d=scratchMatrix3.setFromMatrix4(t),f=scratchVector3$1.copy(n).applyMatrix3(d).multiplyScalar(-1);t.setPosition(f);var m=scratchMatrix4$2.fromArray([1,0,0,0,0,1,0,0,0,0,1,0,0,0,o,1]);return t.premultiply(m),t}var StencilConstants={TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15},SKIP_BACKFACE_MATERIAL=function(){var n=new THREE__namespace.MeshBasicMaterial;return n.side=THREE__namespace.BackSide,n.color.setHex(16711935),n.colorWrite=!1,n.stencilWrite=!0,n.polygonOffset=!0,n.polygonOffsetFactor=2,n.polygonOffsetUnits=2,n.stencilRef=StencilConstants.TILE_MASK,n.stencilFunc=THREE__namespace.AlwaysStencilFunc,n.stencilFuncMask=StencilConstants.TILE_MASK,n.stencilZPass=THREE__namespace.ReplaceStencilOp,n.stencilWriteMask=StencilConstants.TILE_MASK,n}(),SKIP_BACKFACE_TRANSPARENT_MATERIAL=function(){var n=new THREE__namespace.MeshBasicMaterial;return n.visible=!1,n}(),CLEAR_STENCIL_GEOMETRY=new THREE__namespace.BufferGeometry,CLEAR_STENCIL_MATERIAL=new THREE__namespace.MeshBasicMaterial,Tile3DModel=function(n){__extends(t,n);function t(e,r,i){var o,s,u,l=n.call(this)||this;return l.modelIndex=0,l.debug=!1,l.name=i.name,l.type=i.type,l.upAxis=i.upAxis,l.model=e,l.fetcher=i.fetcher,l.search=(o=i.search)!==null&&o!==void 0?o:"",l.groundHeight=i.groundHeight,l.coordinateTransform=i.coordinateTransform,l.unloadTileQueue=[],l.boundingBox=new THREE__namespace.Box3,l.idle=!1,l.minLevelOfDetail=t.DEFAULT_MIN_LEVEL_OF_DETAIL,l.maxLevelOfDetail=t.DEFAULT_MAX_LEVEL_OF_DETAIL,l.needsRefined=!0,l.refined=!1,l.refineProgress=[0,0],l.loaded=!1,l.disposed=!1,l.needsRender=!0,l.lastRenderHash="",l.matrixAutoUpdate=!1,l.cacheCameras=[],l.clearStencilObject=new THREE__namespace.Mesh(CLEAR_STENCIL_GEOMETRY,CLEAR_STENCIL_MATERIAL),l.clearStencilObject.frustumCulled=!1,l.clearStencilObject.onAfterRender=function(c){return c.clearStencil()},l.tileset=new Tileset((u=(s=l.model.work)===null||s===void 0?void 0:s.workCode)!==null&&u!==void 0?u:"",r,{referer:i.referer,contentLoader:function(c){return l.loadContent(c)},onTileLoad:function(){},onTileUnload:function(c){l.unloadTileQueue.push(c)},onTileError:function(c,d){i.onError&&i.onError(Object.assign(d,{error:d})),console.error("Tile error",c.id,d)}}),l.tileset.root.boundingVolume&&l.tileset.root.boundingVolume.getBoundingBox(l.boundingBox),l}return t.prototype.getRenderHash=function(){return jsonHash([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 ecefToLla(this.localToEcef(e))},t.prototype.llaToLocal=function(e){return this.ecefToLocal(llaToEcef(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 loadTileContentData(e,{fetcher:this.fetcher,search:this.search}).then(function(i){return e.type==="TILESET"?!0:i&&e.type==="SCENEGRAPH"?r.disposed||!e.content?(unloadTileContentData(i),!1):(e.content.data=i,e.content.byteLength=i.byteLength,e.content.data&&(e.content.data.object.traverse(function(o){(o instanceof PBMPointCloud||o instanceof PBMMesh)&&(o.model=r.model)}),r.boundingBox.expandByObject(e.content.data.object)),!0):!1})},t.prototype.unloadContent=function(e){e.content&&(e.content.byteLength=0,unloadTileContentData(e.content.data),e.content.data=void 0)},t.prototype.loadAllTilesets=function(){var e=this,r=function(i){var o=[];return e.tileset.root.traverse(function(s){var u;s.type==="TILESET"&&((u=s.content)===null||u===void 0?void 0:u.loadState)!=="READY"&&o.push(s)}),Promise.all(o.map(function(s){return e.loadContent(s).then(function(){return r()})})).then(function(){})};return r(this.tileset.root)},t.prototype.intersectRaycaster=function(e,r,i){var o=this;r===void 0&&(r=!0),i===void 0&&(i=[]);for(var s=[this.tileset.root],u=this.tileset.transform,l=this.tileset.transformIsIdentity,c,d=[];c=s.pop();){var f=void 0;if(c.boundingVolume){var m=l?c.boundingVolume:c.boundingVolume.clone().applyMatrix4(u);f=m.intersectRay(e.ray,e.far)}else f=!0;if(f){for(var A=0,h=c.children.length;A<h;A++)s.push(c.children[A]);c.selected&&c.content&&c.content.data&&c.content.data.object.visible&&c.content.data.object.intersectRaycaster(e,!1,d)}}return this.model.shownFloorIndex>=0&&(d=d.filter(function(p){return p.floor===o.model.shownFloorIndex})),r&&d.sort(function(p,y){return p.distance-y.distance}),d.map(function(p){p.model=o.model,p.viewLayer=o.viewLayer}),i.push.apply(i,d),i},t.prototype.cloneSkipBackfaceObject=function(e){var r;e instanceof THREE__namespace.Mesh?r=new THREE__namespace.Mesh(e.geometry,Array.isArray(e.material)?e.material.map(function(u){return u.transparent?SKIP_BACKFACE_TRANSPARENT_MATERIAL:SKIP_BACKFACE_MATERIAL}):e.material&&e.material.transparent?SKIP_BACKFACE_TRANSPARENT_MATERIAL:SKIP_BACKFACE_MATERIAL):e instanceof THREE__namespace.Group?r=new THREE__namespace.Group:r=new THREE__namespace.Object3D,r.copy(e,!1);for(var i=0,o=e.children;i<o.length;i++){var s=o[i];r.add(this.cloneSkipBackfaceObject(s))}return r},t.prototype.update=function(e,r){var i=this,o,s;this.tileset.transform.equals(this.matrixWorld)||this.tileset.transform.copy(this.matrixWorld),this.tileset.cache.reset(),this.tileset.frameNumber++;var u=this.visible&&(this.parent?this.parent.visible:!0),l={camera:{position:new THREE__namespace.Vector3().copy(r.position),direction:r.getDirection(new THREE__namespace.Vector3),up:new THREE__namespace.Vector3().copy(r.up),visible:r.visible,type:r.type,refine:r.refineModel},minLevelOfDetail:u?Math.min(this.minLevelOfDetail,this.maxLevelOfDetail):-1,maxLevelOfDetail:u?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 CullingVolume().setFromCamera(r)},c=this.cacheCameras.map(function(w){return __assign(__assign({},l),{camera:{position:new THREE__namespace.Vector3().copy(w.position),direction:w.getWorldDirection(new THREE__namespace.Vector3),type:r.type,up:new THREE__namespace.Vector3().copy(w.up),visible:w.visible,refine:!0},cullingVolume:new CullingVolume().setFromCamera(w)})});this.tileset.traverse(l,c),this.refined=!0,this.refineProgress[0]=0,this.refineProgress[1]=0,this.tileset.needsRefinedTiles.forEach(function(w){if(i.refineProgress[1]++,w.content&&w.state.visible){var S=w.content.loadState;if(S==="UNLOADED"||S==="LOADING"){i.refined=!1;return}}i.refineProgress[0]++}),this.loaded===!1&&this.tileset.needsRefinedTiles.size>0&&(this.loaded=!0,this.tileset.needsRefinedTiles.forEach(function(w){if(i.loaded!==!1){if(i.tileset.skipLevelOfDetail){if(w.state.finalResolution&&w.content){var S=w.state.ancestorWithContentAvailable,C=S&&S.content?S.content:w.content,I=C.loadState;(I==="UNLOADED"||I==="LOADING")&&(i.loaded=!1)}}else if(w.state.visible&&w.content&&w.levelOfContent<=0){var I=w.content.loadState;(I==="UNLOADED"||I==="LOADING")&&(i.loaded=!1)}}}));for(var d;d=this.unloadTileQueue.pop();)this.unloadContent(d);this.remove.apply(this,this.children);var f=[],m=[],A=[];this.tileset.skipLevelOfDetail||this.tileset.selectedTiles.sort(function(w,S){return w.floor-S.floor});for(var h=function(w){p.debug&&w.boundingVolumeDebugObject&&m.push(w.boundingVolumeDebugObject);var S=(s=(o=w.content)===null||o===void 0?void 0:o.data)===null||s===void 0?void 0:s.object;if(!S)return"continue";if(p.tileset.skipLevelOfDetail&&p.tileset.hasMixedContent&&!w.state.finalResolution){var C=p.cloneSkipBackfaceObject(S);f.push(C)}var I=w.state.selectionDepth,H=StencilConstants.TILE_MASK|I<<StencilConstants.SKIP_LOD_BIT_SHIFT,B=THREE__namespace.GreaterEqualStencilFunc,L=StencilConstants.SKIP_LOD_MASK,O=THREE__namespace.ReplaceStencilOp,k=StencilConstants.TILE_MASK|StencilConstants.SKIP_LOD_MASK;S.traverse(function(K){if(K instanceof THREE__namespace.Mesh)for(var z=Array.isArray(K.material)?K.material:K.material?[K.material]:[],N=0,U=z;N<U.length;N++){var Q=U[N];i.tileset.hasMixedContent&&i.tileset.skipLevelOfDetail?(Q.stencilWrite=!0,Q.stencilRef=H,Q.stencilFunc=B,Q.stencilFuncMask=L,Q.stencilZPass=O,Q.stencilWriteMask=k):(Q.stencilWrite=!1,Q.stencilRef=StencilConstants.TILE_MASK,Q.stencilFunc=THREE__namespace.AlwaysStencilFunc,Q.stencilFuncMask=StencilConstants.TILE_MASK,Q.stencilZPass=THREE__namespace.ReplaceStencilOp,Q.stencilWriteMask=StencilConstants.TILE_MASK)}}),A.push(S)},p=this,y=0,v=this.tileset.selectedTiles;y<v.length;y++){var g=v[y];h(g)}var E=[];this.tileset.skipLevelOfDetail&&E.push.apply(E,f),E.push.apply(E,A),this.tileset.skipLevelOfDetail&&E.push(this.clearStencilObject),this.debug&&E.push.apply(E,m);for(var b=this.modelIndex*1e4,T=function(w){var S=E[w],C=w+b;S.traverse(function(I){(I instanceof THREE__namespace.Mesh||I instanceof THREE__namespace.Line||I instanceof THREE__namespace.Points)&&(I.renderOrder=C)}),_.add(S)},_=this,x=0;x<E.length;x++)T(x);var R=this.getRenderHash();this.lastRenderHash!==R&&(this.needsRender=!0,this.lastRenderHash=R)},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=Tileset.DEFAULT_MAX_SCREEN_SPACE_ERROR,t.DEFAULT_SKIP_LEVEL_OF_DETAIL=Tileset.DEFAULT_SKIP_LEVEL_OF_DETAIL,t.DEFAULT_LOAD_SIBLINGS=Tileset.DEFAULT_LOAD_SIBLINGS,t.DEFAULT_MAX_REQUESTS=Tileset.DEFAULT_MAX_REQUESTS,t}(THREE__namespace.Object3D);function headingToLongitude(n){return-((n-.25)*360+90)/180*Math.PI}function equal(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(!equal(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 o=i[r];if(!equal(n[o],t[o]))return!1}return!0}return n!==n&&t!==t}function isNumber(n){return typeof n=="number"}var error_invalid_input=function(){return new Error("Invalid input.")},error_invalid_certificate=function(){return new Error("Invalid certificate.")},error_invalid_signature=function(){return new Error("Invalid signature.")},error_date_expired=function(n){return new Error("date(".concat(n.toString(),") expired."))},error_host_not_allowed=function(n){return new Error("host(".concat(JSON.stringify(n),") is not allowed."))};function ObjectOmit(n,t){for(var e={},r=0,i=Object.keys(n);r<i.length;r++){var o=i[r];t.indexOf(o)===-1&&(e[o]=n[o])}return e}function jsonStableNoneNumberStrinfiy_(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,o=0;o<i;o++)r+=jsonStableNoneNumberStrinfiy_(n[o],!1)+",";return i>-1&&(r+=jsonStableNoneNumberStrinfiy_(n[o],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return jsonStableNoneNumberStrinfiy_(n.toJSON(),t);for(var s=Object.keys(n).sort(),u=s.length,r="",o=0;o<u;){var l=s[o],c=jsonStableNoneNumberStrinfiy_(n[l],!0);c!==void 0&&(o&&r!==""&&(r+=","),r+=JSON.stringify(l)+":"+c),o++}return"{"+r+"}"}switch(e){case"function":case"undefined":return t?void 0:null;case"number":return 0;default:return isFinite(n)?n:null}}function jsonStableNoneNumberStrinfiy(n){return String(jsonStableNoneNumberStrinfiy_(n,!1))}function verify(n){var t,e,r;if(Array.isArray(n)){var i=void 0,o,s;if(n.length<=0)return error_invalid_input();for(var u=function(T){var _=verify(n[T]);if(_ instanceof Error)return{value:_};if(!i)i=_.issuer;else if(i!==_.issuer)return{value:error_invalid_certificate()};o?_.expire.getTime()<o.getTime()&&(o=_.expire):o=_.expire,s?s=s.filter(function(x){return _.allowHosts.indexOf(x)!==-1}):s=_.allowHosts},l=0;l<n.length;l++){var c=u(l);if(typeof c=="object")return c.value}return deepFreeze({issuer:i,expire:o,allowHosts:s})}var d=JSON.parse(n),f=typeof location!="undefined"?location.hostname:"",m=Date.now();if(typeof d!="object")return error_invalid_input();var A=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||isIPDomain(f)||BUILDIN_ALLOW_HOST.filter(function(T){return matchDomain(T,f)}).length>0){var p=String((t=d.certificate)!==null&&t!==void 0?t:"");if(p){var y=new X509;return y.readCertPEM(p),deepFreeze({issuer:y.getSubjectString(),expire:A,allowHosts:h})}return deepFreeze({issuer:"none",expire:A,allowHosts:h})}var v=String((e=d.certificate)!==null&&e!==void 0?e:"");if(!v)return error_invalid_certificate();var g=new X509;g.readCertPEM(v);var E=String((r=d._signature)!==null&&r!==void 0?r:"");if(!E)return error_invalid_signature();var b=jsonStableNoneNumberStrinfiy(ObjectOmit(d,["_signature"]));return verifyMessage(b,E,g)===!1?error_invalid_signature():m<A.getTime()?h.filter(function(T){return matchDomain(T,f)}).length===0?error_host_not_allowed(f):deepFreeze({issuer:g.getSubjectString(),expire:A,allowHosts:h}):error_date_expired(A)}var scratchMatrix4$1=new THREE__namespace.Matrix4,workRawMapping=new WeakMap,Work=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 THREE__namespace.Matrix4;{var r=this;this.options={get transform(){return r.transform},set transform(o){r.transform.copy(o)}}}var i=parse(t,e,this);if(i instanceof Error)throw new Error("[PARSE FAILED]: "+i.message+`
928
+ `),support=typeof Worker!="undefined"&&typeof Blob!="undefined",lzmaWorkerURL="";if(support)try{var blob=new Blob([lzmaWorkerSource],{type:"text/javascript"});lzmaWorkerURL=URL.createObjectURL(blob)}catch(n){}var LZMAWorker=function(){function n(){var t=this;if(!support)throw new Error("LZMAWorker cannot work in this broswer.");this.callCounter=0,this.requests={};var e=this.worker=new Worker(lzmaWorkerURL);e.onmessage=function(r){var i=r.data,o=i.id,s=i.result,u=i.error,c=t.getKey(o);t.requests[c]&&(u?t.requests[c](new Error(u)):t.requests[c](null,s),delete t.requests[c])},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=support,n}();function readUint32(n){return Array.prototype.reduce.call(n,function(t,e,r){return t|e<<r*8},0)}function binaryArrays(n){for(var t=[],e=n.length,r=function(s){var u={data:n[s],offset:0,readByte:function(){return this.data[this.offset++]}},c=u.data.length,l={data:[],offset:0,writeByte:function(f){var v=Math.floor(this.offset/c);this.data[v]||(this.data[v]=new Uint8Array(c)),this.data[v][this.offset%c]=f,this.offset++}};LZMA.decompressFile(u,l),i=new Uint8Array(l.offset);for(var d=0;d<l.offset;d++)i[d]=l.data[Math.floor(d/c)][d%c];t.push(i)},i,o=0;o<e;o++)r(o);return t}function binaryArraysWithWorker(n){for(var t=[],e=n.length,r=function(o){t.push(new Promise(function(s,u){var c=new LZMAWorker;c.decompress(n[o],function(l,d){if(c.terminate(),l)return u(l);s(d)})}))},i=0;i<e;i++)r(i);return Promise.all(t)}function lzma(n){var t=new Uint8Array(n),e=readUint32(t.slice(0,4));if(e>10)return Promise.reject(new Error("LZMA got too many sub chunks."));for(var r=[],i=[],o=4+e*4,s=0;s<e;s++)i[s]=readUint32(t.slice(4+s*4,8+s*4)),s===e-1?r[s]=t.subarray(o,o+i[s]):r[s]=t.slice(o,o+i[s]),o+=i[s];return LZMAWorker.support?binaryArraysWithWorker(r):Promise.resolve(binaryArrays(r))}var dequeuing=!1,queue=[];function dequeue(n){if(n===void 0&&(n=!1),!(!n&&dequeuing)){dequeuing=!0;var t=queue.shift();if(t){try{t()}catch(e){}AnimationFrameLoop.shared.add(function(){return dequeue(!0)},!0,2,-100)}else dequeuing=!1}}function delay(n){return new Promise(function(t,e){var r=function(){try{t(n())}catch(i){e(i)}};queue.push(r),AnimationFrameLoop.shared.add(function(){return dequeue()},!0,2,-100)})}function pick(n,t){for(var e={},r=0,i=t;r<i.length;r++){var o=i[r];o in n&&(e[o]=n[o])}return e}function omit(n,t){for(var e=__assign({},n),r=0,i=t;r<i.length;r++){var o=i[r];o in e&&delete e[o]}return e}var commonjsGlobal=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},indexMinimal={},minimal$1={},aspromise=asPromise;function asPromise(n,t){for(var e=new Array(arguments.length-1),r=0,i=2,o=!0;i<arguments.length;)e[r++]=arguments[i++];return new Promise(function(u,c){e[r]=function(d){if(o)if(o=!1,d)c(d);else{for(var f=new Array(arguments.length-1),v=0;v<f.length;)f[v++]=arguments[v];u.apply(null,f)}};try{n.apply(t||null,e)}catch(l){o&&(o=!1,c(l))}})}var base64$1={};(function(n){var t=n;t.length=function(u){var c=u.length;if(!c)return 0;for(var l=0;--c%4>1&&u.charAt(c)==="=";)++l;return Math.ceil(u.length*3)/4-l};for(var e=new Array(64),r=new Array(123),i=0;i<64;)r[e[i]=i<26?i+65:i<52?i+71:i<62?i-4:i-59|43]=i++;t.encode=function(u,c,l){for(var d=null,f=[],v=0,A=0,h;c<l;){var p=u[c++];switch(A){case 0:f[v++]=e[p>>2],h=(p&3)<<4,A=1;break;case 1:f[v++]=e[h|p>>4],h=(p&15)<<2,A=2;break;case 2:f[v++]=e[h|p>>6],f[v++]=e[p&63],A=0;break}v>8191&&((d||(d=[])).push(String.fromCharCode.apply(String,f)),v=0)}return A&&(f[v++]=e[h],f[v++]=61,A===1&&(f[v++]=61)),d?(v&&d.push(String.fromCharCode.apply(String,f.slice(0,v))),d.join("")):String.fromCharCode.apply(String,f.slice(0,v))};var o="invalid encoding";t.decode=function(u,c,l){for(var d=l,f=0,v,A=0;A<u.length;){var h=u.charCodeAt(A++);if(h===61&&f>1)break;if((h=r[h])===void 0)throw Error(o);switch(f){case 0:v=h,f=1;break;case 1:c[l++]=v<<2|(h&48)>>4,v=h,f=2;break;case 2:c[l++]=(v&15)<<4|(h&60)>>2,v=h,f=3;break;case 3:c[l++]=(v&3)<<6|h,f=0;break}}if(f===1)throw Error(o);return l-d},t.test=function(u){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(u)}})(base64$1);var eventemitter=EventEmitter;function EventEmitter(){this._listeners={}}EventEmitter.prototype.on=function(t,e,r){return(this._listeners[t]||(this._listeners[t]=[])).push({fn:e,ctx:r||this}),this},EventEmitter.prototype.off=function(t,e){if(t===void 0)this._listeners={};else if(e===void 0)this._listeners[t]=[];else for(var r=this._listeners[t],i=0;i<r.length;)r[i].fn===e?r.splice(i,1):++i;return this},EventEmitter.prototype.emit=function(t){var e=this._listeners[t];if(e){for(var r=[],i=1;i<arguments.length;)r.push(arguments[i++]);for(i=0;i<e.length;)e[i].fn.apply(e[i++].ctx,r)}return this};var float=factory(factory);function factory(n){return typeof Float32Array!="undefined"?function(){var t=new Float32Array([-0]),e=new Uint8Array(t.buffer),r=e[3]===128;function i(c,l,d){t[0]=c,l[d]=e[0],l[d+1]=e[1],l[d+2]=e[2],l[d+3]=e[3]}function o(c,l,d){t[0]=c,l[d]=e[3],l[d+1]=e[2],l[d+2]=e[1],l[d+3]=e[0]}n.writeFloatLE=r?i:o,n.writeFloatBE=r?o:i;function s(c,l){return e[0]=c[l],e[1]=c[l+1],e[2]=c[l+2],e[3]=c[l+3],t[0]}function u(c,l){return e[3]=c[l],e[2]=c[l+1],e[1]=c[l+2],e[0]=c[l+3],t[0]}n.readFloatLE=r?s:u,n.readFloatBE=r?u:s}():function(){function t(r,i,o,s){var u=i<0?1:0;if(u&&(i=-i),i===0)r(1/i>0?0:2147483648,o,s);else if(isNaN(i))r(2143289344,o,s);else if(i>34028234663852886e22)r((u<<31|2139095040)>>>0,o,s);else if(i<11754943508222875e-54)r((u<<31|Math.round(i/1401298464324817e-60))>>>0,o,s);else{var c=Math.floor(Math.log(i)/Math.LN2),l=Math.round(i*Math.pow(2,-c)*8388608)&8388607;r((u<<31|c+127<<23|l)>>>0,o,s)}}n.writeFloatLE=t.bind(null,writeUintLE),n.writeFloatBE=t.bind(null,writeUintBE);function e(r,i,o){var s=r(i,o),u=(s>>31)*2+1,c=s>>>23&255,l=s&8388607;return c===255?l?NaN:u*(1/0):c===0?u*1401298464324817e-60*l:u*Math.pow(2,c-150)*(l+8388608)}n.readFloatLE=e.bind(null,readUintLE),n.readFloatBE=e.bind(null,readUintBE)}(),typeof Float64Array!="undefined"?function(){var t=new Float64Array([-0]),e=new Uint8Array(t.buffer),r=e[7]===128;function i(c,l,d){t[0]=c,l[d]=e[0],l[d+1]=e[1],l[d+2]=e[2],l[d+3]=e[3],l[d+4]=e[4],l[d+5]=e[5],l[d+6]=e[6],l[d+7]=e[7]}function o(c,l,d){t[0]=c,l[d]=e[7],l[d+1]=e[6],l[d+2]=e[5],l[d+3]=e[4],l[d+4]=e[3],l[d+5]=e[2],l[d+6]=e[1],l[d+7]=e[0]}n.writeDoubleLE=r?i:o,n.writeDoubleBE=r?o:i;function s(c,l){return e[0]=c[l],e[1]=c[l+1],e[2]=c[l+2],e[3]=c[l+3],e[4]=c[l+4],e[5]=c[l+5],e[6]=c[l+6],e[7]=c[l+7],t[0]}function u(c,l){return e[7]=c[l],e[6]=c[l+1],e[5]=c[l+2],e[4]=c[l+3],e[3]=c[l+4],e[2]=c[l+5],e[1]=c[l+6],e[0]=c[l+7],t[0]}n.readDoubleLE=r?s:u,n.readDoubleBE=r?u:s}():function(){function t(r,i,o,s,u,c){var l=s<0?1:0;if(l&&(s=-s),s===0)r(0,u,c+i),r(1/s>0?0:2147483648,u,c+o);else if(isNaN(s))r(0,u,c+i),r(2146959360,u,c+o);else if(s>17976931348623157e292)r(0,u,c+i),r((l<<31|2146435072)>>>0,u,c+o);else{var d;if(s<22250738585072014e-324)d=s/5e-324,r(d>>>0,u,c+i),r((l<<31|d/4294967296)>>>0,u,c+o);else{var f=Math.floor(Math.log(s)/Math.LN2);f===1024&&(f=1023),d=s*Math.pow(2,-f),r(d*4503599627370496>>>0,u,c+i),r((l<<31|f+1023<<20|d*1048576&1048575)>>>0,u,c+o)}}}n.writeDoubleLE=t.bind(null,writeUintLE,0,4),n.writeDoubleBE=t.bind(null,writeUintBE,4,0);function e(r,i,o,s,u){var c=r(s,u+i),l=r(s,u+o),d=(l>>31)*2+1,f=l>>>20&2047,v=4294967296*(l&1048575)+c;return f===2047?v?NaN:d*(1/0):f===0?d*5e-324*v:d*Math.pow(2,f-1075)*(v+4503599627370496)}n.readDoubleLE=e.bind(null,readUintLE,0,4),n.readDoubleBE=e.bind(null,readUintBE,4,0)}(),n}function writeUintLE(n,t,e){t[e]=n&255,t[e+1]=n>>>8&255,t[e+2]=n>>>16&255,t[e+3]=n>>>24}function writeUintBE(n,t,e){t[e]=n>>>24,t[e+1]=n>>>16&255,t[e+2]=n>>>8&255,t[e+3]=n&255}function readUintLE(n,t){return(n[t]|n[t+1]<<8|n[t+2]<<16|n[t+3]<<24)>>>0}function readUintBE(n,t){return(n[t]<<24|n[t+1]<<16|n[t+2]<<8|n[t+3])>>>0}var inquire_1=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(n){}return null}var utf8$2={};(function(n){var t=n;t.length=function(r){for(var i=0,o=0,s=0;s<r.length;++s)o=r.charCodeAt(s),o<128?i+=1:o<2048?i+=2:(o&64512)===55296&&(r.charCodeAt(s+1)&64512)===56320?(++s,i+=4):i+=3;return i},t.read=function(r,i,o){var s=o-i;if(s<1)return"";for(var u=null,c=[],l=0,d;i<o;)d=r[i++],d<128?c[l++]=d:d>191&&d<224?c[l++]=(d&31)<<6|r[i++]&63:d>239&&d<365?(d=((d&7)<<18|(r[i++]&63)<<12|(r[i++]&63)<<6|r[i++]&63)-65536,c[l++]=55296+(d>>10),c[l++]=56320+(d&1023)):c[l++]=(d&15)<<12|(r[i++]&63)<<6|r[i++]&63,l>8191&&((u||(u=[])).push(String.fromCharCode.apply(String,c)),l=0);return u?(l&&u.push(String.fromCharCode.apply(String,c.slice(0,l))),u.join("")):String.fromCharCode.apply(String,c.slice(0,l))},t.write=function(r,i,o){for(var s=o,u,c,l=0;l<r.length;++l)u=r.charCodeAt(l),u<128?i[o++]=u:u<2048?(i[o++]=u>>6|192,i[o++]=u&63|128):(u&64512)===55296&&((c=r.charCodeAt(l+1))&64512)===56320?(u=65536+((u&1023)<<10)+(c&1023),++l,i[o++]=u>>18|240,i[o++]=u>>12&63|128,i[o++]=u>>6&63|128,i[o++]=u&63|128):(i[o++]=u>>12|224,i[o++]=u>>6&63|128,i[o++]=u&63|128);return o-s}})(utf8$2);var pool_1=pool;function pool(n,t,e){var r=e||8192,i=r>>>1,o=null,s=r;return function(c){if(c<1||c>i)return n(c);s+c>r&&(o=n(r),s=0);var l=t.call(o,s,s+=c);return s&7&&(s=(s|7)+1),l}}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=t;var n=requireMinimal();function t(o,s){this.lo=o>>>0,this.hi=s>>>0}var e=t.zero=new t(0,0);e.toNumber=function(){return 0},e.zzEncode=e.zzDecode=function(){return this},e.length=function(){return 1};var r=t.zeroHash="\0\0\0\0\0\0\0\0";t.fromNumber=function(s){if(s===0)return e;var u=s<0;u&&(s=-s);var c=s>>>0,l=(s-c)/4294967296>>>0;return u&&(l=~l>>>0,c=~c>>>0,++c>4294967295&&(c=0,++l>4294967295&&(l=0))),new t(c,l)},t.from=function(s){if(typeof s=="number")return t.fromNumber(s);if(n.isString(s))if(n.Long)s=n.Long.fromString(s);else return t.fromNumber(parseInt(s,10));return s.low||s.high?new t(s.low>>>0,s.high>>>0):e},t.prototype.toNumber=function(s){if(!s&&this.hi>>>31){var u=~this.lo+1>>>0,c=~this.hi>>>0;return u||(c=c+1>>>0),-(u+c*4294967296)}return this.lo+this.hi*4294967296},t.prototype.toLong=function(s){return n.Long?new n.Long(this.lo|0,this.hi|0,!!s):{low:this.lo|0,high:this.hi|0,unsigned:!!s}};var i=String.prototype.charCodeAt;return t.fromHash=function(s){return s===r?e:new t((i.call(s,0)|i.call(s,1)<<8|i.call(s,2)<<16|i.call(s,3)<<24)>>>0,(i.call(s,4)|i.call(s,5)<<8|i.call(s,6)<<16|i.call(s,7)<<24)>>>0)},t.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},t.prototype.zzEncode=function(){var s=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^s)>>>0,this.lo=(this.lo<<1^s)>>>0,this},t.prototype.zzDecode=function(){var s=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^s)>>>0,this.hi=(this.hi>>>1^s)>>>0,this},t.prototype.length=function(){var s=this.lo,u=(this.lo>>>28|this.hi<<4)>>>0,c=this.hi>>>24;return c===0?u===0?s<16384?s<128?1:2:s<2097152?3:4:u<16384?u<128?5:6:u<2097152?7:8:c<128?9:10},longbits}var hasRequiredMinimal;function requireMinimal(){return hasRequiredMinimal||(hasRequiredMinimal=1,function(n){var t=n;t.asPromise=aspromise,t.base64=base64$1,t.EventEmitter=eventemitter,t.float=float,t.inquire=inquire_1,t.utf8=utf8$2,t.pool=pool_1,t.LongBits=requireLongbits(),t.isNode=!!(typeof commonjsGlobal!="undefined"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),t.global=t.isNode&&commonjsGlobal||typeof window!="undefined"&&window||typeof self!="undefined"&&self||commonjsGlobal,t.emptyArray=Object.freeze?Object.freeze([]):[],t.emptyObject=Object.freeze?Object.freeze({}):{},t.isInteger=Number.isInteger||function(o){return typeof o=="number"&&isFinite(o)&&Math.floor(o)===o},t.isString=function(o){return typeof o=="string"||o instanceof String},t.isObject=function(o){return o&&typeof o=="object"},t.isset=t.isSet=function(o,s){var u=o[s];return u!=null&&o.hasOwnProperty(s)?typeof u!="object"||(Array.isArray(u)?u.length:Object.keys(u).length)>0:!1},t.Buffer=function(){try{var i=t.inquire("buffer").Buffer;return i.prototype.utf8Write?i:null}catch(o){return null}}(),t._Buffer_from=null,t._Buffer_allocUnsafe=null,t.newBuffer=function(o){return typeof o=="number"?t.Buffer?t._Buffer_allocUnsafe(o):new t.Array(o):t.Buffer?t._Buffer_from(o):typeof Uint8Array=="undefined"?o:new Uint8Array(o)},t.Array=typeof Uint8Array!="undefined"?Uint8Array:Array,t.Long=t.global.dcodeIO&&t.global.dcodeIO.Long||t.global.Long||t.inquire("long"),t.key2Re=/^true|false|0|1$/,t.key32Re=/^-?(?:0|[1-9][0-9]*)$/,t.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,t.longToHash=function(o){return o?t.LongBits.from(o).toHash():t.LongBits.zeroHash},t.longFromHash=function(o,s){var u=t.LongBits.fromHash(o);return t.Long?t.Long.fromBits(u.lo,u.hi,s):u.toNumber(!!s)};function e(i,o,s){for(var u=Object.keys(o),c=0;c<u.length;++c)(i[u[c]]===void 0||!s)&&(i[u[c]]=o[u[c]]);return i}t.merge=e,t.lcFirst=function(o){return o.charAt(0).toLowerCase()+o.substring(1)};function r(i){function o(s,u){if(!(this instanceof o))return new o(s,u);Object.defineProperty(this,"message",{get:function(){return s}}),Error.captureStackTrace?Error.captureStackTrace(this,o):Object.defineProperty(this,"stack",{value:new Error().stack||""}),u&&e(this,u)}return o.prototype=Object.create(Error.prototype,{constructor:{value:o,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return i},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),o}t.newError=r,t.ProtocolError=r("ProtocolError"),t.oneOfGetter=function(o){for(var s={},u=0;u<o.length;++u)s[o[u]]=1;return function(){for(var c=Object.keys(this),l=c.length-1;l>-1;--l)if(s[c[l]]===1&&this[c[l]]!==void 0&&this[c[l]]!==null)return c[l]}},t.oneOfSetter=function(o){return function(s){for(var u=0;u<o.length;++u)o[u]!==s&&delete this[o[u]]}},t.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},t._configure=function(){var i=t.Buffer;if(!i){t._Buffer_from=t._Buffer_allocUnsafe=null;return}t._Buffer_from=i.from!==Uint8Array.from&&i.from||function(s,u){return new i(s,u)},t._Buffer_allocUnsafe=i.allocUnsafe||function(s){return new i(s)}}}(minimal$1)),minimal$1}var writer=Writer$1,util$4=requireMinimal(),BufferWriter$1,LongBits$1=util$4.LongBits,base64=util$4.base64,utf8$1=util$4.utf8;function Op(n,t,e){this.fn=n,this.len=t,this.next=void 0,this.val=e}function noop(){}function State(n){this.head=n.head,this.tail=n.tail,this.len=n.len,this.next=n.states}function Writer$1(){this.len=0,this.head=new Op(noop,0,0),this.tail=this.head,this.states=null}var create$1=function n(){return util$4.Buffer?function(){return(Writer$1.create=function(){return new BufferWriter$1})()}:function(){return new Writer$1}};Writer$1.create=create$1(),Writer$1.alloc=function n(t){return new util$4.Array(t)},util$4.Array!==Array&&(Writer$1.alloc=util$4.pool(Writer$1.alloc,util$4.Array.prototype.subarray)),Writer$1.prototype._push=function n(t,e,r){return this.tail=this.tail.next=new Op(t,e,r),this.len+=e,this};function writeByte(n,t,e){t[e]=n&255}function writeVarint32(n,t,e){for(;n>127;)t[e++]=n&127|128,n>>>=7;t[e]=n}function VarintOp(n,t){this.len=n,this.next=void 0,this.val=t}VarintOp.prototype=Object.create(Op.prototype),VarintOp.prototype.fn=writeVarint32,Writer$1.prototype.uint32=function n(t){return this.len+=(this.tail=this.tail.next=new VarintOp((t=t>>>0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this},Writer$1.prototype.int32=function n(t){return t<0?this._push(writeVarint64,10,LongBits$1.fromNumber(t)):this.uint32(t)},Writer$1.prototype.sint32=function n(t){return this.uint32((t<<1^t>>31)>>>0)};function writeVarint64(n,t,e){for(;n.hi;)t[e++]=n.lo&127|128,n.lo=(n.lo>>>7|n.hi<<25)>>>0,n.hi>>>=7;for(;n.lo>127;)t[e++]=n.lo&127|128,n.lo=n.lo>>>7;t[e++]=n.lo}Writer$1.prototype.uint64=function n(t){var e=LongBits$1.from(t);return this._push(writeVarint64,e.length(),e)},Writer$1.prototype.int64=Writer$1.prototype.uint64,Writer$1.prototype.sint64=function n(t){var e=LongBits$1.from(t).zzEncode();return this._push(writeVarint64,e.length(),e)},Writer$1.prototype.bool=function n(t){return this._push(writeByte,1,t?1:0)};function writeFixed32(n,t,e){t[e]=n&255,t[e+1]=n>>>8&255,t[e+2]=n>>>16&255,t[e+3]=n>>>24}Writer$1.prototype.fixed32=function n(t){return this._push(writeFixed32,4,t>>>0)},Writer$1.prototype.sfixed32=Writer$1.prototype.fixed32,Writer$1.prototype.fixed64=function n(t){var e=LongBits$1.from(t);return this._push(writeFixed32,4,e.lo)._push(writeFixed32,4,e.hi)},Writer$1.prototype.sfixed64=Writer$1.prototype.fixed64,Writer$1.prototype.float=function n(t){return this._push(util$4.float.writeFloatLE,4,t)},Writer$1.prototype.double=function n(t){return this._push(util$4.float.writeDoubleLE,8,t)};var writeBytes=util$4.Array.prototype.set?function n(t,e,r){e.set(t,r)}:function n(t,e,r){for(var i=0;i<t.length;++i)e[r+i]=t[i]};Writer$1.prototype.bytes=function n(t){var e=t.length>>>0;if(!e)return this._push(writeByte,1,0);if(util$4.isString(t)){var r=Writer$1.alloc(e=base64.length(t));base64.decode(t,r,0),t=r}return this.uint32(e)._push(writeBytes,e,t)},Writer$1.prototype.string=function n(t){var e=utf8$1.length(t);return e?this.uint32(e)._push(utf8$1.write,e,t):this._push(writeByte,1,0)},Writer$1.prototype.fork=function n(){return this.states=new State(this),this.head=this.tail=new Op(noop,0,0),this.len=0,this},Writer$1.prototype.reset=function n(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Op(noop,0,0),this.len=0),this},Writer$1.prototype.ldelim=function n(){var t=this.head,e=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=t.next,this.tail=e,this.len+=r),this},Writer$1.prototype.finish=function n(){for(var t=this.head.next,e=this.constructor.alloc(this.len),r=0;t;)t.fn(t.val,e,r),r+=t.len,t=t.next;return e},Writer$1._configure=function(n){BufferWriter$1=n,Writer$1.create=create$1(),BufferWriter$1._configure()};var writer_buffer=BufferWriter,Writer=writer;(BufferWriter.prototype=Object.create(Writer.prototype)).constructor=BufferWriter;var util$3=requireMinimal();function BufferWriter(){Writer.call(this)}BufferWriter._configure=function(){BufferWriter.alloc=util$3._Buffer_allocUnsafe,BufferWriter.writeBytesBuffer=util$3.Buffer&&util$3.Buffer.prototype instanceof Uint8Array&&util$3.Buffer.prototype.set.name==="set"?function(t,e,r){e.set(t,r)}:function(t,e,r){if(t.copy)t.copy(e,r,0,t.length);else for(var i=0;i<t.length;)e[r++]=t[i++]}},BufferWriter.prototype.bytes=function n(t){util$3.isString(t)&&(t=util$3._Buffer_from(t,"base64"));var e=t.length>>>0;return this.uint32(e),e&&this._push(BufferWriter.writeBytesBuffer,e,t),this};function writeStringBuffer(n,t,e){n.length<40?util$3.utf8.write(n,t,e):t.utf8Write?t.utf8Write(n,e):t.write(n,e)}BufferWriter.prototype.string=function n(t){var e=util$3.Buffer.byteLength(t);return this.uint32(e),e&&this._push(writeStringBuffer,e,t),this},BufferWriter._configure();var reader=Reader$1,util$2=requireMinimal(),BufferReader$1,LongBits=util$2.LongBits,utf8=util$2.utf8;function indexOutOfRange(n,t){return RangeError("index out of range: "+n.pos+" + "+(t||1)+" > "+n.len)}function Reader$1(n){this.buf=n,this.pos=0,this.len=n.length}var create_array=typeof Uint8Array!="undefined"?function n(t){if(t instanceof Uint8Array||Array.isArray(t))return new Reader$1(t);throw Error("illegal buffer")}:function n(t){if(Array.isArray(t))return new Reader$1(t);throw Error("illegal buffer")},create=function n(){return util$2.Buffer?function(e){return(Reader$1.create=function(i){return util$2.Buffer.isBuffer(i)?new BufferReader$1(i):create_array(i)})(e)}:create_array};Reader$1.create=create(),Reader$1.prototype._slice=util$2.Array.prototype.subarray||util$2.Array.prototype.slice,Reader$1.prototype.uint32=function n(){var t=4294967295;return function(){if(t=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(t=(t|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return t;if((this.pos+=5)>this.len)throw this.pos=this.len,indexOutOfRange(this,10);return t}}(),Reader$1.prototype.int32=function n(){return this.uint32()|0},Reader$1.prototype.sint32=function n(){var t=this.uint32();return t>>>1^-(t&1)|0};function readLongVarint(){var n=new LongBits(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(n.lo=(n.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return n;if(n.lo=(n.lo|(this.buf[this.pos]&127)<<28)>>>0,n.hi=(n.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return n;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw indexOutOfRange(this);if(n.lo=(n.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return n}return n.lo=(n.lo|(this.buf[this.pos++]&127)<<t*7)>>>0,n}if(this.len-this.pos>4){for(;t<5;++t)if(n.hi=(n.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return n}else for(;t<5;++t){if(this.pos>=this.len)throw indexOutOfRange(this);if(n.hi=(n.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return n}throw Error("invalid varint encoding")}Reader$1.prototype.bool=function n(){return this.uint32()!==0};function readFixed32_end(n,t){return(n[t-4]|n[t-3]<<8|n[t-2]<<16|n[t-1]<<24)>>>0}Reader$1.prototype.fixed32=function n(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)},Reader$1.prototype.sfixed32=function n(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)|0};function readFixed64(){if(this.pos+8>this.len)throw indexOutOfRange(this,8);return new LongBits(readFixed32_end(this.buf,this.pos+=4),readFixed32_end(this.buf,this.pos+=4))}Reader$1.prototype.float=function n(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);var t=util$2.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},Reader$1.prototype.double=function n(){if(this.pos+8>this.len)throw indexOutOfRange(this,4);var t=util$2.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},Reader$1.prototype.bytes=function n(){var t=this.uint32(),e=this.pos,r=this.pos+t;if(r>this.len)throw indexOutOfRange(this,t);if(this.pos+=t,Array.isArray(this.buf))return this.buf.slice(e,r);if(e===r){var i=util$2.Buffer;return i?i.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,e,r)},Reader$1.prototype.string=function n(){var t=this.bytes();return utf8.read(t,0,t.length)},Reader$1.prototype.skip=function n(t){if(typeof t=="number"){if(this.pos+t>this.len)throw indexOutOfRange(this,t);this.pos+=t}else do if(this.pos>=this.len)throw indexOutOfRange(this);while(this.buf[this.pos++]&128);return this},Reader$1.prototype.skipType=function(n){switch(n){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(n=this.uint32()&7)!==4;)this.skipType(n);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+n+" at offset "+this.pos)}return this},Reader$1._configure=function(n){BufferReader$1=n,Reader$1.create=create(),BufferReader$1._configure();var t=util$2.Long?"toLong":"toNumber";util$2.merge(Reader$1.prototype,{int64:function(){return readLongVarint.call(this)[t](!1)},uint64:function(){return readLongVarint.call(this)[t](!0)},sint64:function(){return readLongVarint.call(this).zzDecode()[t](!1)},fixed64:function(){return readFixed64.call(this)[t](!0)},sfixed64:function(){return readFixed64.call(this)[t](!1)}})};var reader_buffer=BufferReader,Reader=reader;(BufferReader.prototype=Object.create(Reader.prototype)).constructor=BufferReader;var util$1=requireMinimal();function BufferReader(n){Reader.call(this,n)}BufferReader._configure=function(){util$1.Buffer&&(BufferReader.prototype._slice=util$1.Buffer.prototype.slice)},BufferReader.prototype.string=function n(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))},BufferReader._configure();var rpc={},service=Service,util=requireMinimal();(Service.prototype=Object.create(util.EventEmitter.prototype)).constructor=Service;function Service(n,t,e){if(typeof n!="function")throw TypeError("rpcImpl must be a function");util.EventEmitter.call(this),this.rpcImpl=n,this.requestDelimited=!!t,this.responseDelimited=!!e}Service.prototype.rpcCall=function n(t,e,r,i,o){if(!i)throw TypeError("request must be specified");var s=this;if(!o)return util.asPromise(n,s,t,e,r,i);if(!s.rpcImpl){setTimeout(function(){o(Error("already ended"))},0);return}try{return s.rpcImpl(t,e[s.requestDelimited?"encodeDelimited":"encode"](i).finish(),function(c,l){if(c)return s.emit("error",c,t),o(c);if(l===null){s.end(!0);return}if(!(l instanceof r))try{l=r[s.responseDelimited?"decodeDelimited":"decode"](l)}catch(d){return s.emit("error",d,t),o(d)}return s.emit("data",l,t),o(null,l)})}catch(u){s.emit("error",u,t),setTimeout(function(){o(u)},0);return}},Service.prototype.end=function n(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},function(n){var t=n;t.Service=service}(rpc);var roots={};(function(n){var t=n;t.build="minimal",t.Writer=writer,t.BufferWriter=writer_buffer,t.Reader=reader,t.BufferReader=reader_buffer,t.util=requireMinimal(),t.rpc=rpc,t.roots=roots,t.configure=e;function e(){t.util._configure(),t.Writer._configure(t.BufferWriter),t.Reader._configure(t.BufferReader)}e()})(indexMinimal);var minimal=indexMinimal;const $Reader$1=minimal.Reader,$util$1=minimal.util,$root$1=minimal.roots["@REALSEE/FIVE:five/loaders/model/proto/pbm.proto"]||(minimal.roots["@REALSEE/FIVE:five/loaders/model/proto/pbm.proto"]={}),Model$2=$root$1.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=$util$1.emptyArray,n.prototype.createAt=$util$1.Long?$util$1.Long.fromBits(0,0,!0):0,n.prototype.description="",n.decode=function(e,r){e instanceof $Reader$1||(e=$Reader$1.create(e));let i=r===void 0?e.len:e.pos+r,o=new $root$1.Model;for(;e.pos<i;){let s=e.uint32();switch(s>>>3){case 1:{o.chunks&&o.chunks.length||(o.chunks=[]),o.chunks.push($root$1.Chunk.decode(e,e.uint32()));break}case 2:{o.createAt=e.uint64();break}case 3:{o.description=e.string();break}default:e.skipType(s&7);break}}return o},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Model"},n})();$root$1.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 $Reader$1||(e=$Reader$1.create(e));let i=r===void 0?e.len:e.pos+r,o=new $root$1.Chunk;for(;e.pos<i;){let s=e.uint32();switch(s>>>3){case 1:{o.vertices=$root$1.Vertices.decode(e,e.uint32());break}case 2:{o.faces=$root$1.Faces.decode(e,e.uint32());break}case 3:{o.name=e.string();break}case 4:{o.texture=e.string();break}default:e.skipType(s&7);break}}if(!o.hasOwnProperty("vertices"))throw $util$1.ProtocolError("missing required 'vertices'",{instance:o});if(!o.hasOwnProperty("faces"))throw $util$1.ProtocolError("missing required 'faces'",{instance:o});if(!o.hasOwnProperty("name"))throw $util$1.ProtocolError("missing required 'name'",{instance:o});return o},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Chunk"},n})(),$root$1.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=$util$1.emptyArray,n.prototype.uvs=$util$1.emptyArray,n.prototype.marks=$util$1.emptyArray,n.decode=function(e,r){e instanceof $Reader$1||(e=$Reader$1.create(e));let i=r===void 0?e.len:e.pos+r,o=new $root$1.Vertices;for(;e.pos<i;){let s=e.uint32();switch(s>>>3){case 1:{if(o.xyz&&o.xyz.length||(o.xyz=[]),(s&7)===2){let u=e.uint32()+e.pos;for(;e.pos<u;)o.xyz.push(e.float())}else o.xyz.push(e.float());break}case 2:{if(o.uvs&&o.uvs.length||(o.uvs=[]),(s&7)===2){let u=e.uint32()+e.pos;for(;e.pos<u;)o.uvs.push(e.float())}else o.uvs.push(e.float());break}case 3:{if(o.marks&&o.marks.length||(o.marks=[]),(s&7)===2){let u=e.uint32()+e.pos;for(;e.pos<u;)o.marks.push(e.int32())}else o.marks.push(e.int32());break}default:e.skipType(s&7);break}}return o},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Vertices"},n})(),$root$1.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=$util$1.emptyArray,n.prototype.normals=$util$1.emptyArray,n.decode=function(e,r){e instanceof $Reader$1||(e=$Reader$1.create(e));let i=r===void 0?e.len:e.pos+r,o=new $root$1.Faces;for(;e.pos<i;){let s=e.uint32();switch(s>>>3){case 1:{if(o.indices&&o.indices.length||(o.indices=[]),(s&7)===2){let u=e.uint32()+e.pos;for(;e.pos<u;)o.indices.push(e.uint32())}else o.indices.push(e.uint32());break}case 2:{if(o.normals&&o.normals.length||(o.normals=[]),(s&7)===2){let u=e.uint32()+e.pos;for(;e.pos<u;)o.normals.push(e.float())}else o.normals.push(e.float());break}default:e.skipType(s&7);break}}return o},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Faces"},n})(),$root$1.VertexMark=(()=>{const n={},t=Object.create(n);return t[n[0]="VERTEX_MARK_UNSPECIFIED"]=0,t[n[1]="VERTEX_MARK_ROOF"]=1,t})();function loadPbm(n,t){var e,r,i,o={byteLength:0},s=autoRestImageOptionsByTextureLength((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),u={};if(t.textureArray)for(var c=0,l=t.textureArray;c<l.length;c++){var d=l[c];u[d]=loadTexture$1(d,s,t.fetcher)}return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"})}).then(function(f){return o.byteLength=f.body.byteLength,delay(function(){var v=new Uint8Array(f.body);return Model$2.decode(v)})}).then(function(f){return delay(function(){var v,A;return parse$2(f,(v=t.textureBaseUri)!==null&&v!==void 0?v:function(){var h=n.lastIndexOf("/");if(h>=0){var p=n.slice(0,h)+"/";return/\/model\/$/.test(p)&&(p=p.replace(/\/model\/$/,"/materials/")),p}return""}(),((A=t.textureArray)!==null&&A!==void 0?A:[]).slice(),s,u,t.fetcher)})}).then(function(f){var v=new THREE__namespace.Group;v.matrixAutoUpdate=!1,v.matrix.compose(v.position,v.quaternion,v.scale),v.name=n;for(var A=0,h=f.objects;A<h.length;A++){var p=h[A];v.add(p)}return{type:"pbm",uri:n,byteLength:o.byteLength,scene:v,textures:f.textures,dispose:function(){return f.dispose()}}})}function parseFloorName(n){var t=n.match(/(group|floor)-?(\d+)/);return t?parseInt(t[2],10):0}function parseChunkName(n){var t=n.match(/(chunk)-?(\d+)/);return t?parseInt(t[2],10):0}function parseSubName(n){var t=n.match(/(sub)-?(\d+)/);return t?parseInt(t[2],10):0}function chunkOrder(n){var t=parseFloorName(n.name),e=parseChunkName(n.name),r=parseSubName(n.name);return t*1e6+e*1e3+r}function parsePBMModel(n){for(var t,e,r,i=typeof n.createAt=="number"?n.createAt:0,o=(t=n.description)!==null&&t!==void 0?t:"",s=[],u=!0,c=!0,l=0,d=n.chunks;l<d.length;l++){var f=d[l];if(!f.vertices.marks||f.vertices.marks.length===0){c=!1;break}}for(var v=0,A=n.chunks;v<A.length;v++){var f=A[v];if(!f.faces.normals||f.faces.normals.length===0){u=!1;break}}for(var h=n.chunks.sort(function(ae,se){return chunkOrder(ae)-chunkOrder(se)}),p=[],y=0,m=h;y<m.length;y++){var f=m[y],g=parseFloorName(f.name);p[g]||(p[g]=[]),p[g].push(f)}for(var E=0;E<p.length;E++){var b=p[E];if(b)if(u){for(var T=0,_=0;_<b.length;_++){var f=b[_];T+=f.faces.indices.length}for(var S=new Float32Array(T*3),R=new Float32Array(T*2),B=new Float32Array(T*3),I=c?new Float32Array(T):void 0,x=[],M=[1/0,1/0,1/0,-1/0,-1/0,-1/0],L=0,C=0;C<b.length;C++){for(var H=[1/0,1/0,1/0,-1/0,-1/0,-1/0],f=b[C],F=f.vertices.xyz,O=f.vertices.uvs,G=f.faces.indices,Q=f.faces.normals,U=f.vertices.marks,D=G.length,_=0;_<D;_++){var q=G[_],z=S[L*3+_*3]=F[q*3],K=S[L*3+_*3+1]=F[q*3+1],J=S[L*3+_*3+2]=F[q*3+2];I&&(I[L+_]=U[q]),R[L*2+_*2]=O[q*2],R[L*2+_*2+1]=O[q*2+1];var j=Math.floor(_/3)*3;B[L*3+_*3]=Q[j],B[L*3+_*3+1]=Q[j+1],B[L*3+_*3+2]=Q[j+2],z<H[0]&&(H[0]=z),K<H[1]&&(H[1]=K),J<H[2]&&(H[2]=J),z>H[3]&&(H[3]=z),K>H[4]&&(H[4]=K),J>H[5]&&(H[5]=J)}H[0]<M[0]&&(M[0]=H[0]),H[1]<M[1]&&(M[1]=H[1]),H[2]<M[2]&&(M[2]=H[2]),H[3]>M[3]&&(M[3]=H[3]),H[4]>M[4]&&(M[4]=H[4]),H[5]>M[5]&&(M[5]=H[5]),x.push({materialIndex:C,name:f.name,chunkName:parseChunkName(f.name),start:L,count:f.faces.indices.length,texture:(e=f.texture)!==null&&e!==void 0?e:void 0}),L+=D}var re={createAt:i,description:o,vertices:S,uvs:R,normals:B,masks:I,indices:null,floorIndex:E,groups:x,extents:M};s.push(re)}else{for(var T=0,W=0,_=0;_<b.length;_++){var f=b[_];W+=f.vertices.xyz.length/3,T+=f.faces.indices.length}for(var S=new Float32Array(W*3),R=new Float32Array(W*2),B=void 0,te=new Float32Array(W),$=new Uint32Array(T),I=c?new Float32Array(T):void 0,x=[],M=[1/0,1/0,1/0,-1/0,-1/0,-1/0],ne=0,L=0,C=0;C<b.length;C++){for(var H=[1/0,1/0,1/0,-1/0,-1/0,-1/0],f=b[C],F=f.vertices.xyz,ee=f.vertices.marks,O=f.vertices.uvs,G=f.faces.indices,ce=F.length/3,D=G.length,_=0;_<ce;_++){var z=S[L*3+_*3]=F[_*3],K=S[L*3+_*3+1]=F[_*3+1],J=S[L*3+_*3+2]=F[_*3+2];I&&(I[L+_]=ee[_]),R[L*2+_*2]=O[_*2],R[L*2+_*2+1]=O[_*2+1],te[L+_]=E,z<H[0]&&(H[0]=z),K<H[1]&&(H[1]=K),J<H[2]&&(H[2]=J),z>H[3]&&(H[3]=z),K>H[4]&&(H[4]=K),J>H[5]&&(H[5]=J)}H[0]<M[0]&&(M[0]=H[0]),H[1]<M[1]&&(M[1]=H[1]),H[2]<M[2]&&(M[2]=H[2]),H[3]>M[3]&&(M[3]=H[3]),H[4]>M[4]&&(M[4]=H[4]),H[5]>M[5]&&(M[5]=H[5]);for(var _=0;_<D;_++)$[ne+_]=L+G[_];x.push({materialIndex:C,name:f.name,chunkName:parseChunkName(f.name),start:ne,count:f.faces.indices.length,texture:(r=f.texture)!==null&&r!==void 0?r:void 0}),L+=ce,ne+=D}var re={createAt:i,description:o,vertices:S,uvs:R,normals:B,masks:I,indices:$,floorIndex:E,groups:x,extents:M};s.push(re)}}return s}function loadTexture$1(n,t,e){var r=__assign({key:"texture.pbm"},pick(t,["format","quality","size","sharpen","mappings"])),i=new TextureLoader,o=i.loadTexture(n,{imageURL:{transform:t.transform,options:r},encoding:THREE__namespace.sRGBEncoding,wrapS:THREE__namespace.ClampToEdgeWrapping,wrapT:THREE__namespace.ClampToEdgeWrapping,minFilter:THREE__namespace.LinearFilter,maxSize:typeof r.size=="number"?new THREE__namespace.Vector2(r.size,r.size):void 0,fetcher:e}).then(function(s){var u=s.body;return u.needsUpdate=!0,u});return Object.assign(o,{url:n,textureOptions:t})}function parse$2(n,t,e,r,i,o){i===void 0&&(i={});for(var s=parsePBMModel(n),u=0,c="",l=[],d={},f=new Set,v=0,A=s;v<A.length;v++){var h=A[v],p=h.createAt,y=h.description,m=h.vertices,g=h.masks,E=h.uvs,b=h.normals,T=h.indices,_=h.floorIndex,S=h.groups,R=h.extents,B=new THREE__namespace.Box3;B.min.x=R[0],B.min.y=R[1],B.min.z=R[2],B.max.x=R[3],B.max.y=R[4],B.max.z=R[5];var I=new THREE__namespace.BufferGeometry;I.setAttribute("position",new THREE__namespace.BufferAttribute(m,3)),I.setAttribute("uv",new THREE__namespace.BufferAttribute(E,2)),b&&I.setAttribute("normal",new THREE__namespace.BufferAttribute(b,3)),g&&I.setAttribute("mask",new THREE__namespace.BufferAttribute(g,1)),T&&I.setIndex(new THREE__namespace.BufferAttribute(T,1)),I.boundingBox=B,I.boundingSphere=B.getBoundingSphere(new THREE__namespace.Sphere);for(var x=0,M=S;x<M.length;x++){var L=M[x];I.addGroup(L.start,L.count,L.materialIndex)}f.add(I);for(var C=[],H=0,F=S;H<F.length;H++){var L=F[H],O=e[L.chunkName]||(L.texture?pathJoin(t||"",L.texture):void 0),G=new PBMMeshMaterial("basic");G.floor=_,I.attributes.normal===void 0&&(G.flatShading=!0),I.attributes.mask&&(G.defines.USE_VERTEX_MARK=!0),C.push(G),O?d[O]?d[O].push(G):d[O]=[G]:G.color=new THREE__namespace.Color(16777215),f.add(G)}var Q=new PBMMesh(I,C);Q.name="model_floor_"+_,Q.userData.createAt=p,Q.userData.description=y,Q.matrix.compose(Q.position,Q.quaternion,Q.scale),Q.matrixAutoUpdate=!1,Q.frustumCulled=!1,u=p,c=y,l.push(Q)}var U=function(D){D=autoRestImageOptionsByTextureLength(D,e.length);for(var q=[],z=function(re){var W=null;re in i&&(W=i[re]),W||(W=loadTexture$1(re,D,o)),q.push(W.then(function(te){for(var $=0,ne=d[re];$<ne.length;$++){var ee=ne[$];ee.map&&(f.delete(ee.map),ee.map.dispose()),ee.map=te,f.add(te)}return te}).catch(function(){for(var te=0,$=d[re];te<$.length;te++){var ne=$[te];ne.map&&(f.delete(ne.map),ne.map.dispose()),ne.map=null,ne.color=new THREE__namespace.Color(16777215)}return null}))},K=0,J=Object.keys(d);K<J.length;K++){var j=J[K];z(j)}for(var j in i)delete i[j];return Promise.all(q).then(function(re){return re.filter(function(W){return W})})};return U(r).then(function(D){return{createAt:u,description:c,objects:l,textures:D,dispose:function(){f.forEach(function(q){q.dispose()}),f.clear()}}})}function autoRestImageOptionsByTextureLength(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 loadAt3d(n,t){var e,r,i,o={byteLength:0},s=autoRestImageOptionsByTextureLength((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),u={};if(t.textureArray)for(var c=0,l=t.textureArray;c<l.length;c++){var d=l[c];u[d]=loadTexture$1(d,s,t.fetcher)}return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"})}).then(function(f){return lzma(f.body)}).then(function(f){return delay(function(){for(var v,A={chunks:[],createAt:void 0,description:void 0},h=0,p=f;h<p.length;h++){var y=p[h],m=Model$2.decode(y);m.chunks.length&&((v=A.chunks).push.apply(v,m.chunks),A.createAt=m.createAt,A.description=m.description)}return A})}).then(function(f){return delay(function(){var v,A,h;return parse$2(f,(v=t.textureBaseUri)!==null&&v!==void 0?v:function(){var p=n.lastIndexOf("/");if(p>=0){var y=n.slice(0,p)+"/";return/\/model\/$/.test(y)&&(y=y.replace(/\/model\/$/,"/materials/")),y}return""}(),((A=t.textureArray)!==null&&A!==void 0?A:[]).slice(),(h=t.textureOptions)!==null&&h!==void 0?h:{},u,t.fetcher)})}).then(function(f){var v=new THREE__namespace.Group;v.name=n;for(var A=0,h=f.objects;A<h.length;A++){var p=h[A];v.add(p)}return{type:"at3d",uri:n,byteLength:o.byteLength,scene:v,textures:f.textures,dispose:function(){return f.dispose()}}})}const $Reader=minimal.Reader,$util=minimal.util,$root=minimal.roots["@REALSEE/FIVE:five/loaders/model/proto/dome.proto"]||(minimal.roots["@REALSEE/FIVE:five/loaders/model/proto/dome.proto"]={}),Model$1=$root.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=$util.emptyArray,n.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));let i=r===void 0?e.len:e.pos+r,o=new $root.Model;for(;e.pos<i;){let s=e.uint32();switch(s>>>3){case 1:{o.meshes&&o.meshes.length||(o.meshes=[]),o.meshes.push($root.Mesh.decode(e,e.uint32()));break}default:e.skipType(s&7);break}}return o},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Model"},n})();$root.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=$util.emptyArray,n.prototype.matrix=$util.emptyArray,n.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));let i=r===void 0?e.len:e.pos+r,o=new $root.Mesh;for(;e.pos<i;){let s=e.uint32();switch(s>>>3){case 1:{o.name=e.string();break}case 2:{o.chunks&&o.chunks.length||(o.chunks=[]),o.chunks.push($root.Chunk.decode(e,e.uint32()));break}case 3:{o.matrix&&o.matrix.length||(o.matrix=[]),o.matrix.push($root.Matrix.decode(e,e.uint32()));break}default:e.skipType(s&7);break}}if(!o.hasOwnProperty("name"))throw $util.ProtocolError("missing required 'name'",{instance:o});return o},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Mesh"},n})(),$root.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=$util.emptyArray,n.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));let i=r===void 0?e.len:e.pos+r,o=new $root.Matrix;for(;e.pos<i;){let s=e.uint32();switch(s>>>3){case 1:{if(o.elements&&o.elements.length||(o.elements=[]),(s&7)===2){let u=e.uint32()+e.pos;for(;e.pos<u;)o.elements.push(e.float())}else o.elements.push(e.float());break}default:e.skipType(s&7);break}}return o},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Matrix"},n})(),$root.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=$util.emptyArray,n.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));let i=r===void 0?e.len:e.pos+r,o=new $root.Chunk;for(;e.pos<i;){let s=e.uint32();switch(s>>>3){case 2:{o.geometry=$root.Geometry.decode(e,e.uint32());break}case 3:{o.material&&o.material.length||(o.material=[]),o.material.push($root.Material.decode(e,e.uint32()));break}default:e.skipType(s&7);break}}if(!o.hasOwnProperty("geometry"))throw $util.ProtocolError("missing required 'geometry'",{instance:o});return o},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Chunk"},n})(),$root.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=$util.emptyArray,n.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));let i=r===void 0?e.len:e.pos+r,o=new $root.Geometry;for(;e.pos<i;){let s=e.uint32();switch(s>>>3){case 1:{o.position=$root.Position.decode(e,e.uint32());break}case 2:{o.uv=$root.UV.decode(e,e.uint32());break}case 3:{o.uv2=$root.UV.decode(e,e.uint32());break}case 4:{o.normal=$root.Normal.decode(e,e.uint32());break}case 5:{o.groups&&o.groups.length||(o.groups=[]),o.groups.push($root.Group.decode(e,e.uint32()));break}default:e.skipType(s&7);break}}if(!o.hasOwnProperty("position"))throw $util.ProtocolError("missing required 'position'",{instance:o});if(!o.hasOwnProperty("normal"))throw $util.ProtocolError("missing required 'normal'",{instance:o});return o},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Geometry"},n})(),$root.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=$util.emptyArray,n.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));let i=r===void 0?e.len:e.pos+r,o=new $root.Position;for(;e.pos<i;){let s=e.uint32();switch(s>>>3){case 1:{if(o.array&&o.array.length||(o.array=[]),(s&7)===2){let u=e.uint32()+e.pos;for(;e.pos<u;)o.array.push(e.float())}else o.array.push(e.float());break}default:e.skipType(s&7);break}}return o},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Position"},n})(),$root.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=$util.emptyArray,n.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));let i=r===void 0?e.len:e.pos+r,o=new $root.UV;for(;e.pos<i;){let s=e.uint32();switch(s>>>3){case 1:{if(o.array&&o.array.length||(o.array=[]),(s&7)===2){let u=e.uint32()+e.pos;for(;e.pos<u;)o.array.push(e.float())}else o.array.push(e.float());break}default:e.skipType(s&7);break}}return o},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/UV"},n})(),$root.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=$util.emptyArray,n.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));let i=r===void 0?e.len:e.pos+r,o=new $root.Normal;for(;e.pos<i;){let s=e.uint32();switch(s>>>3){case 1:{if(o.array&&o.array.length||(o.array=[]),(s&7)===2){let u=e.uint32()+e.pos;for(;e.pos<u;)o.array.push(e.float())}else o.array.push(e.float());break}default:e.skipType(s&7);break}}return o},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Normal"},n})(),$root.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 $Reader||(e=$Reader.create(e));let i=r===void 0?e.len:e.pos+r,o=new $root.Group;for(;e.pos<i;){let s=e.uint32();switch(s>>>3){case 1:{o.start=e.uint32();break}case 2:{o.count=e.uint32();break}case 3:{o.materialIndex=e.uint32();break}default:e.skipType(s&7);break}}if(!o.hasOwnProperty("start"))throw $util.ProtocolError("missing required 'start'",{instance:o});if(!o.hasOwnProperty("count"))throw $util.ProtocolError("missing required 'count'",{instance:o});if(!o.hasOwnProperty("materialIndex"))throw $util.ProtocolError("missing required 'materialIndex'",{instance:o});return o},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Group"},n})(),$root.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 $Reader||(e=$Reader.create(e));let i=r===void 0?e.len:e.pos+r,o=new $root.Material;for(;e.pos<i;){let s=e.uint32();switch(s>>>3){case 1:{o.kd=$root.Color.decode(e,e.uint32());break}case 2:{o.ks=$root.Color.decode(e,e.uint32());break}case 3:{o.ke=$root.Color.decode(e,e.uint32());break}case 4:{o.mapkd=e.string();break}case 5:{o.mapks=e.string();break}case 6:{o.mapke=e.string();break}case 7:{o.norm=e.string();break}case 8:{o.mapbump=e.string();break}case 9:{o.bump=e.string();break}case 10:{o.mapd=e.string();break}case 11:{o.ns=e.float();break}case 12:{o.d=e.float();break}case 13:{o.tr=e.float();break}case 14:{o.mapkdrepeat=e.string();break}default:e.skipType(s&7);break}}return o},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Material"},n})(),$root.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=$util.emptyArray,n.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));let i=r===void 0?e.len:e.pos+r,o=new $root.Color;for(;e.pos<i;){let s=e.uint32();switch(s>>>3){case 1:{if(o.rgb&&o.rgb.length||(o.rgb=[]),(s&7)===2){let u=e.uint32()+e.pos;for(;e.pos<u;)o.rgb.push(e.float())}else o.rgb.push(e.float());break}default:e.skipType(s&7);break}}return o},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Color"},n})();function loadDome(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,parse$1(new Uint8Array(r.body),t.textureBaseUri||"",t.textureOptions,t.fetcher)}).then(function(r){var i=new THREE__namespace.Group;i.matrixAutoUpdate=!1,i.matrix.compose(i.position,i.quaternion,i.scale),i.name=n;for(var o=0,s=r.objects;o<s.length;o++){var u=s[o];i.add(u)}return{type:"dome",uri:n,byteLength:e.byteLength,scene:i,textures:r.textures,dispose:function(){return r.dispose()}}})}function flipBufferGeometryNormals(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 parseGeometry(n){var t=n.position,e=n.normal,r=n.uv,i=n.uv2,o=n.groups,s=new THREE__namespace.BufferGeometry;s.setAttribute("position",new THREE__namespace.BufferAttribute(new Float32Array(t.array),3)),e&&s.setAttribute("normal",new THREE__namespace.BufferAttribute(new Float32Array(e.array),3)),r&&s.setAttribute("uv",new THREE__namespace.BufferAttribute(new Float32Array(r.array),2)),i&&s.setAttribute("uv2",new THREE__namespace.BufferAttribute(new Float32Array(i.array),2));for(var u=0,c=o;u<c.length;u++){var l=c[u];s.addGroup(l.start,l.count,l.materialIndex)}return s}function loadTexture(n,t,e,r,i,o,s){if(s.hasOwnProperty(n))return s[n];n=n.split("?")[0],isAbsoluteURL(n)||(n=pathJoin(t,n)),n=n.replace(/\/\/vrlab-image\d*.ljcdn.com\//,"//vrlab-public.ljcdn.com/"),n.indexOf("//")===0&&(n="https:"+n);var u=__assign({key:"texture.dome",size:64},pick(e,["quality","format","sharpen","mappings"])),c=s[n]=i.loadTexture(n,{imageURL:{transform:e.transform,options:u},wrapS:THREE__namespace.RepeatWrapping,wrapT:THREE__namespace.RepeatWrapping,fetcher:o}).then(function(l){var d=l.body;return r&&d.repeat.copy(r),d.needsUpdate=!0,d.updateMatrix(),d});return c}function parseMaterial(n,t,e,r,i,o,s,u){var c=[],l=new PBMMeshMaterial("phong");if(s.add(l),n.kd&&(l.color=new THREE__namespace.Color().fromArray(n.kd.rgb).convertLinearToSRGB()),n.mapkd){var d=null;if(n.mapkdrepeat){var f=n.mapkdrepeat.split(/\s+/).map(function(p){return Number(p)}),v=f[0],A=f[1];d=new THREE__namespace.Vector2(v,A)}c.push(loadTexture(n.mapkd,t,e,d,r,i,o).then(function(p){p.encoding=THREE__namespace.sRGBEncoding,l.map=p,s.add(p),u.add(p),l.needsUpdate=!0}).catch(noop$1))}if(n.ks&&(l.specular=new THREE__namespace.Color().fromArray(n.ks.rgb).convertLinearToSRGB()),n.mapks&&c.push(loadTexture(n.mapks,t,e,null,r,i,o).then(function(p){l.specularMap=p,s.add(p),u.add(p)}).catch(noop$1)),n.ke&&(l.emissive=new THREE__namespace.Color().fromArray(n.ke.rgb).convertLinearToSRGB()),n.mapke&&c.push(loadTexture(n.mapke,t,e,null,r,i,o).then(function(p){p.encoding=THREE__namespace.sRGBEncoding,l.emissiveMap=p,s.add(p),u.add(p)}).catch(noop$1)),n.norm&&c.push(loadTexture(n.norm,t,e,null,r,i,o).then(function(p){l.normalMap=p,s.add(p),u.add(p)}).catch(noop$1)),n.mapbump&&c.push(loadTexture(n.mapbump,t,e,null,r,i,o).then(function(p){l.bumpMap=p,s.add(p),u.add(p)}).catch(noop$1)),n.bump&&c.push(loadTexture(n.bump,t,e,null,r,i,o).then(function(p){l.bumpMap=p,s.add(p),u.add(p)}).catch(noop$1)),typeof n.ns=="number"&&(l.shininess=n.ns),typeof n.d=="number"){var h=n.d;h>0&&h<1&&(l.opacity=h)}return l.floor=0,{material:l,textureReady:Promise.all(c).then(noop$1)}}function fromProtoBuf(n){return Model$1.decode(n).meshes}function parse$1(n,t,e,r){for(var i=[],o=[],s=new Set,u=fromProtoBuf(n),c=new TextureLoader,l=new THREE__namespace.Matrix4,d=new THREE__namespace.Vector3,f=new THREE__namespace.Quaternion,v=new THREE__namespace.Vector3,A={},h=new Set,p=0,y=u;p<y.length;p++){var m=y[p],g=m.name,E=m.chunks,b=m.matrix;if(!(g==="Ceiling"||g==="CeilingDrop"))for(var T=0,_=b;T<_.length;T++){var S=_[T];l.elements=S.elements;for(var R=new THREE__namespace.Group,B=0;B<E.length;B++){var I=parseGeometry(E[B].geometry);I.applyMatrix4(l),l.decompose(d,f,v),v.x*v.y*v.z<0&&I.attributes.normal&&I.attributes.position&&I.attributes.uv&&flipBufferGeometryNormals(I),s.add(I);for(var x=[],M=0,L=E[B].material;M<L.length;M++){var C=L[M],H=parseMaterial(C,t||"",e,c,r,A,s,h),F=H.material,O=H.textureReady;o.push(O),x.push(F)}var G=new PBMMesh(I,x);G.name="chunk_"+B,G.matrix.compose(G.position,G.quaternion,G.scale),G.matrixAutoUpdate=!1,G.frustumCulled=!1,R.add(G)}R.name=g,i.push(R)}}return Promise.all(o).catch(noop$1).then(function(){return{createAt:0,description:"",objects:i,textures:Array.from(h),dispose:function(){s.forEach(function(Q){Q.dispose()}),s.clear()}}})}function loadDomez(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,lzma(r.body)}).then(function(r){var i=r.reduce(function(u,c){return u+c.length},0),o=new Uint8Array(i),s=0;return r.forEach(function(u){o.set(u,s),s+=u.length}),o}).then(function(r){return parse$1(r,t.textureBaseUri||"",t.textureOptions,t.fetcher)}).then(function(r){var i=new THREE__namespace.Group;i.name=n;for(var o=0,s=r.objects;o<s.length;o++){var u=s[o];i.add(u)}return{type:"domez",uri:n,byteLength:e.byteLength,scene:i,textures:r.textures,dispose:function(){return r.dispose()}}})}var ROTATE_X_MATRIX=new THREE__namespace.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function loadGlb(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 parseGltf(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 THREE__namespace.Matrix4;if(t.upAxis!=="Z"&&i.premultiply(ROTATE_X_MATRIX),r.CESIUM_RTC){var o=new THREE__namespace.Matrix4().setPosition(r.CESIUM_RTC.center);i.premultiply(o)}var s=r.scene;return s.applyMatrix4(i),{type:"glb",uri:n,byteLength:e,scene:s,textures:r.textures,dispose:function(){return r.dispose()}}})}new THREE__namespace.Vector3;var scratchMatrix4$3=new THREE__namespace.Matrix4;function attachTileAttributes(n,t){n.name=t.id;var e=t.tileset.properties.floorInfo;n.traverse(function(r){if("floor"in t.extras){if(r instanceof THREE__namespace.Mesh||r instanceof THREE__namespace.Points)for(var i=Array.isArray(r.material)?r.material:r.material?[r.material]:[],o=0,s=i;o<s.length;o++){var u=s[o];(u instanceof PBMMeshMaterial||u instanceof PBMPointCloudMaterial)&&(u.floor=t.extras.floor)}}else if(!(r instanceof PBMPointCloud)){if(r instanceof PBMMesh&&e){for(var c=new THREE__namespace.Box3().expandByObject(r),l=c.getCenter(new THREE__namespace.Vector3),d=0,f=0;f<e.length;f++){var v=e[f],A=v.ground,h=v.height;if(l.y<A+h){d=f;break}}t.floor=d,r.material.forEach(function(p){return p.floor=d})}}})}function loadTileContentData(n,t){if(!n.content)return Promise.resolve(null);var e=n.content,r=appendSearch(e.uri,t.search);if(n.type==="TILESET"){var i=imageURL(r,{key:"model.".concat(n.siblingIndex)});return t.fetcher.ajax(i,{responseType:"text"}).then(function(o){return o.body}).then(function(o){var s=r.slice(0,r.lastIndexOf("/")+1);return normalizeTilesetHeader(JSON.parse(o),s)}).then(function(o){n.children.length===0&&(n.children=[new Tile("".concat(n.id,".0"),o.root,n.tileset,n)])}).then(function(){return null})}return n.type==="SCENEGRAPH"?Promise.resolve().then(function(){var o,s,u,c,l,d,f,v,A,h,p="",y=r.split("#"),m=y[0],g=y[1],E=(g||m).split("?")[0].match(/\.([0-9a-zA-Z]+)$/);if(E&&(p=E[1]),p==="b3dm"){var b=imageURL(r,{key:"model.".concat(n.siblingIndex)});return loadB3dm(b,{upAxis:n.tileset.asset.gltfUpAxis,fetcher:t.fetcher}).then(function(T){return T.scene.applyMatrix4(n.transform),T.scene.updateWorldMatrix(!1,!0),T.scene.matrixAutoUpdate=!1,attachTileAttributes(T.scene,n),T})}if(p==="pnts"){var b=imageURL(r,{key:"model.".concat(n.siblingIndex)});return loadPnts(b,{fetcher:t.fetcher,computeBoundingBox:!1}).then(function(_){if(_.scene.applyMatrix4(n.transform),_.scene.updateWorldMatrix(!1,!0),_.scene.matrixAutoUpdate=!1,n.boundingVolume){var S=n.boundingVolume;_.scene.traverse(function(R){if(R instanceof PBMPointCloud){scratchMatrix4$3.getInverse(R.matrixWorld);var B=new THREE__namespace.Box3;S.getBoundingBox(B),B.applyMatrix4(scratchMatrix4$3),R.geometry.boundingBox=B}})}return attachTileAttributes(_.scene,n),_})}if(p==="glb"){var b=imageURL(r,{key:"model.".concat(n.siblingIndex)});return loadGlb(b,{upAxis:n.tileset.asset.gltfUpAxis,fetcher:t.fetcher}).then(function(_){return _.scene.applyMatrix4(n.transform),_.scene.updateWorldMatrix(!1,!0),_.scene.matrixAutoUpdate=!1,attachTileAttributes(_.scene,n),_})}if(p==="at3d"){var b=n.extras.at3d?r:imageURL(r,{key:"model.".concat(n.siblingIndex)});return loadAt3d(b,{textureBaseUri:(o=n.extras.at3d)===null||o===void 0?void 0:o.textureBaseUri,textureArray:(s=n.extras.at3d)===null||s===void 0?void 0:s.textureArray,textureOptions:(u=n.extras.at3d)===null||u===void 0?void 0:u.textureOptions,fetcher:t.fetcher}).then(function(_){return _.scene.applyMatrix4(n.transform),_.scene.updateWorldMatrix(!1,!0),_.scene.matrixAutoUpdate=!1,_})}if(p==="pbm"){var b=n.extras.pbm?r:imageURL(r,{key:"model.".concat(n.siblingIndex)});return loadPbm(b,{textureBaseUri:(c=n.extras.pbm)===null||c===void 0?void 0:c.textureBaseUri,textureArray:(l=n.extras.pbm)===null||l===void 0?void 0:l.textureArray,textureOptions:(d=n.extras.pbm)===null||d===void 0?void 0:d.textureOptions,fetcher:t.fetcher}).then(function(_){return _.scene.applyMatrix4(n.transform),_.scene.updateWorldMatrix(!1,!0),_.scene.matrixAutoUpdate=!1,_})}if(p==="dome"){var b=n.extras.dome?r:imageURL(r,{key:"model.".concat(n.siblingIndex)});return loadDome(b,{textureBaseUri:(f=n.extras.dome)===null||f===void 0?void 0:f.textureBaseUri,textureOptions:(v=n.extras.dome)===null||v===void 0?void 0:v.textureOptions,fetcher:t.fetcher}).then(function(_){return _.scene.applyMatrix4(n.transform),_.scene.updateWorldMatrix(!1,!0),_.scene.matrixAutoUpdate=!1,_})}if(p==="domez"){var b=n.extras.domez?r:imageURL(r,{key:"model.".concat(n.siblingIndex)});return loadDomez(b,{textureBaseUri:(A=n.extras.domez)===null||A===void 0?void 0:A.textureBaseUri,textureOptions:(h=n.extras.domez)===null||h===void 0?void 0:h.textureOptions,fetcher:t.fetcher}).then(function(_){return _.scene.applyMatrix4(n.transform),_.scene.updateWorldMatrix(!1,!0),_.scene.matrixAutoUpdate=!1,_})}return null}).then(function(o){if(!o)return Promise.resolve(null);o.scene.traverse(function(u){if(u instanceof PBMPointCloud)u.material.uniforms.geometricError.value=n.geometricError;else if(u instanceof PBMMesh)for(var c=0,l=u.material;c<l.length;c++){var d=l[c];d.uniforms.geometricError.value=n.geometricError}});var s={type:o.type,uri:o.uri,byteLength:o.byteLength,object:new TileNode(o.scene,o.dispose)};return s.object.name=n.id,Promise.resolve().then(function(){return Promise.all([s.object.generateBvhTree(),t.renderer&&o.textures.length<16?initTextures(o.textures,t.renderer,1024*1024):null])}).then(function(){return s}).catch(function(u){return unloadTileContentData(s),Promise.reject(u)})}):Promise.resolve(null)}function unloadTileContentData(n){n&&n.object.dispose()}function jsonStableStrinfiy_(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,o=0;o<i;o++)r+=jsonStableStrinfiy_(n[o],!1)+",";return i>-1&&(r+=jsonStableStrinfiy_(n[o],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return jsonStableStrinfiy_(n.toJSON(),t);for(var s=Object.keys(n).sort(),u=s.length,r="",o=0;o<u;){var c=s[o],l=jsonStableStrinfiy_(n[c],!0);l!==void 0&&(o&&r!==""&&(r+=","),r+=JSON.stringify(c)+":"+l),o++}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 jsonHash(n){return"hash::".concat(jsonStableStrinfiy_(n,!1))}var scratchVector3$1=new THREE__namespace.Vector3,scratchMatrix3=new THREE__namespace.Matrix3,scratchMatrix4$2=new THREE__namespace.Matrix4,a=6378137,invF=298.257223563;function ecefToLla(n){for(var t=a-a/invF,e=(a*a-t*t)/(a*a),r=Math.sqrt(n.x*n.x+n.y*n.y),i=1e-12,o=1e3,s=0,u=Math.atan2(n.z,r),c=0;s++<o;){var l=Math.sin(u),d=a/Math.sqrt(1-e*l*l);c=r/Math.cos(u)-d;var f=Math.atan2(n.z/(d*(1-e)+c),r/(d+c));if(isNaN(f))break;var v=Math.abs(f-u);if(v<i)break;u=f}return n.set(u,Math.atan2(n.y,n.x),c)}function llaToEcef(n){var t=n.x,e=n.y,r=n.z,i=a-a/invF,o=(a*a-i*i)/(a*a),s=Math.sin(t),u=Math.cos(t),c=Math.sin(e),l=Math.cos(e),d=a/Math.sqrt(1-o*s*s),f=(d+r)*u*l,v=(d+r)*u*c,A=(i*i/(a*a)*d+r)*s;return n.set(f,v,A)}function getEcefToEnuMatrix(n,t){var e=ecefToLla(scratchVector3$1.copy(n)),r=e.x,i=e.y,o=e.z,s=Math.sin(r),u=Math.sin(i),c=Math.cos(r),l=Math.cos(i);t.fromArray([-u,-s*l,c*l,0,+l,-s*u,c*u,0,0,c,s,0,0,0,0,1]);var d=scratchMatrix3.setFromMatrix4(t),f=scratchVector3$1.copy(n).applyMatrix3(d).multiplyScalar(-1);t.setPosition(f);var v=scratchMatrix4$2.fromArray([1,0,0,0,0,1,0,0,0,0,1,0,0,0,o,1]);return t.premultiply(v),t}var StencilConstants={TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15},SKIP_BACKFACE_MATERIAL=function(){var n=new THREE__namespace.MeshBasicMaterial;return n.side=THREE__namespace.BackSide,n.color.setHex(16711935),n.colorWrite=!1,n.stencilWrite=!0,n.polygonOffset=!0,n.polygonOffsetFactor=2,n.polygonOffsetUnits=2,n.stencilRef=StencilConstants.TILE_MASK,n.stencilFunc=THREE__namespace.AlwaysStencilFunc,n.stencilFuncMask=StencilConstants.TILE_MASK,n.stencilZPass=THREE__namespace.ReplaceStencilOp,n.stencilWriteMask=StencilConstants.TILE_MASK,n}(),SKIP_BACKFACE_TRANSPARENT_MATERIAL=function(){var n=new THREE__namespace.MeshBasicMaterial;return n.visible=!1,n}(),CLEAR_STENCIL_GEOMETRY=new THREE__namespace.BufferGeometry,CLEAR_STENCIL_MATERIAL=new THREE__namespace.MeshBasicMaterial,Tile3DModel=function(n){__extends(t,n);function t(e,r,i){var o,s,u,c=n.call(this)||this;return c.modelIndex=0,c.debug=!1,c.name=i.name,c.type=i.type,c.upAxis=i.upAxis,c.model=e,c.fetcher=i.fetcher,c.search=(o=i.search)!==null&&o!==void 0?o:"",c.groundHeight=i.groundHeight,c.coordinateTransform=i.coordinateTransform,c.unloadTileQueue=[],c.boundingBox=new THREE__namespace.Box3,c.idle=!1,c.minLevelOfDetail=t.DEFAULT_MIN_LEVEL_OF_DETAIL,c.maxLevelOfDetail=t.DEFAULT_MAX_LEVEL_OF_DETAIL,c.needsRefined=!0,c.refined=!1,c.refineProgress=[0,0],c.loaded=!1,c.disposed=!1,c.needsRender=!0,c.lastRenderHash="",c.matrixAutoUpdate=!1,c.cacheCameras=[],c.clearStencilObject=new THREE__namespace.Mesh(CLEAR_STENCIL_GEOMETRY,CLEAR_STENCIL_MATERIAL),c.clearStencilObject.frustumCulled=!1,c.clearStencilObject.onAfterRender=function(l){return l.clearStencil()},c.tileset=new Tileset((u=(s=c.model.work)===null||s===void 0?void 0:s.workCode)!==null&&u!==void 0?u:"",r,{referer:i.referer,contentLoader:function(l){return c.loadContent(l)},onTileLoad:function(){},onTileUnload:function(l){c.unloadTileQueue.push(l)},onTileError:function(l,d){i.onError&&i.onError(Object.assign(d,{error:d})),console.error("Tile error",l.id,d)}}),c.tileset.root.boundingVolume&&c.tileset.root.boundingVolume.getBoundingBox(c.boundingBox),c}return t.prototype.getRenderHash=function(){return jsonHash([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 ecefToLla(this.localToEcef(e))},t.prototype.llaToLocal=function(e){return this.ecefToLocal(llaToEcef(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 loadTileContentData(e,{fetcher:this.fetcher,search:this.search,renderer:this.renderer}).then(function(i){return e.type==="TILESET"?!0:i&&e.type==="SCENEGRAPH"?r.disposed||!e.content?(unloadTileContentData(i),!1):(e.content.data=i,e.content.byteLength=i.byteLength,e.content.data&&(e.content.data.object.traverse(function(o){(o instanceof PBMPointCloud||o instanceof PBMMesh)&&(o.model=r.model)}),r.boundingBox.expandByObject(e.content.data.object)),!0):!1})},t.prototype.unloadContent=function(e){e.content&&(e.content.byteLength=0,unloadTileContentData(e.content.data),e.content.data=void 0)},t.prototype.loadAllTilesets=function(){var e=this,r=function(i){var o=[];return e.tileset.root.traverse(function(s){var u;s.type==="TILESET"&&((u=s.content)===null||u===void 0?void 0:u.loadState)!=="READY"&&o.push(s)}),Promise.all(o.map(function(s){return e.loadContent(s).then(function(){return r()})})).then(function(){})};return r(this.tileset.root)},t.prototype.intersectRaycaster=function(e,r,i){var o=this;r===void 0&&(r=!0),i===void 0&&(i=[]);for(var s=[this.tileset.root],u=this.tileset.transform,c=this.tileset.transformIsIdentity,l,d=[];l=s.pop();){var f=void 0;if(l.boundingVolume){var v=c?l.boundingVolume:l.boundingVolume.clone().applyMatrix4(u);f=v.intersectRay(e.ray,e.far)}else f=!0;if(f){for(var A=0,h=l.children.length;A<h;A++)s.push(l.children[A]);l.selected&&l.content&&l.content.data&&l.content.data.object.visible&&l.content.data.object.intersectRaycaster(e,!1,d)}}return this.model.shownFloorIndex>=0&&(d=d.filter(function(p){return p.floor===o.model.shownFloorIndex})),r&&d.sort(function(p,y){return p.distance-y.distance}),d.map(function(p){p.model=o.model,p.viewLayer=o.viewLayer}),i.push.apply(i,d),i},t.prototype.cloneSkipBackfaceObject=function(e){var r;e instanceof THREE__namespace.Mesh?r=new THREE__namespace.Mesh(e.geometry,Array.isArray(e.material)?e.material.map(function(u){return u.transparent?SKIP_BACKFACE_TRANSPARENT_MATERIAL:SKIP_BACKFACE_MATERIAL}):e.material&&e.material.transparent?SKIP_BACKFACE_TRANSPARENT_MATERIAL:SKIP_BACKFACE_MATERIAL):e instanceof THREE__namespace.Group?r=new THREE__namespace.Group:r=new THREE__namespace.Object3D,r.copy(e,!1);for(var i=0,o=e.children;i<o.length;i++){var s=o[i];r.add(this.cloneSkipBackfaceObject(s))}return r},t.prototype.update=function(e,r){var i=this,o,s;this.renderer=e,this.tileset.transform.equals(this.matrixWorld)||this.tileset.transform.copy(this.matrixWorld),this.tileset.cache.reset(),this.tileset.frameNumber++;var u=this.visible,c=Math.max(this.maxLevelOfDetail,0),l=Math.min(this.minLevelOfDetail,c),d=Math.max(l,0),f={camera:{type:r.type,position:new THREE__namespace.Vector3().copy(r.position),direction:r.getDirection(new THREE__namespace.Vector3),near:r.near,far:r.far,up:new THREE__namespace.Vector3().copy(r.up),visible:r.visible,refine:r.refineModel},minLevelOfDetail:l,maxLevelOfDetail:u&&!this.idle&&this.loaded?c:d,maxScreenSpaceError:this.maxScreenSpaceError,height:r.resolution.height,pixelRatio:r.pixelRatio,frameNumber:this.tileset.frameNumber,sseDenominator:2*Math.tan(.5*r.fov/180*Math.PI),cullingVolume:new CullingVolume().setFromCamera(r)},v=this.cacheCameras.map(function(M){return __assign(__assign({},f),{camera:{type:r.type,position:new THREE__namespace.Vector3().copy(M.position),direction:M.getWorldDirection(new THREE__namespace.Vector3),near:r.near,far:r.far,up:new THREE__namespace.Vector3().copy(M.up),visible:M.visible,refine:!0},cullingVolume:new CullingVolume().setFromCamera(M)})});this.tileset.traverse(f,v),this.refined=!0,this.refineProgress[0]=0,this.refineProgress[1]=0,this.tileset.needsRefinedTiles.forEach(function(M){if(i.refineProgress[1]++,M.content&&M.state.visible){var L=M.content.loadState;if(L==="UNLOADED"||L==="LOADING"){i.refined=!1;return}}i.refineProgress[0]++}),this.loaded===!1&&this.tileset.needsRefinedTiles.size>0&&(this.loaded=!0,this.tileset.needsRefinedTiles.forEach(function(M){if(i.loaded!==!1){if(i.tileset.skipLevelOfDetail){if(M.state.finalResolution&&M.content){var L=M.state.ancestorWithContentAvailable,C=L&&L.content?L.content:M.content,H=C.loadState;(H==="UNLOADED"||H==="LOADING")&&(i.loaded=!1)}}else if(M.state.visible&&M.content&&M.levelOfContent<=0){var H=M.content.loadState;(H==="UNLOADED"||H==="LOADING")&&(i.loaded=!1)}}}),this.loaded===!0&&(this.refined=!1,this.refineProgress[1]++));for(var A;A=this.unloadTileQueue.pop();)this.unloadContent(A);this.remove.apply(this,this.children);var h=[],p=[],y=[];this.tileset.skipLevelOfDetail||this.tileset.selectedTiles.sort(function(M,L){return M.floor-L.floor});for(var m=function(M){g.debug&&M.boundingVolumeDebugObject&&p.push(M.boundingVolumeDebugObject);var L=(s=(o=M.content)===null||o===void 0?void 0:o.data)===null||s===void 0?void 0:s.object;if(!L)return"continue";if(g.tileset.skipLevelOfDetail&&g.tileset.hasMixedContent&&!M.state.finalResolution){var C=g.cloneSkipBackfaceObject(L);h.push(C)}var H=M.state.selectionDepth,F=StencilConstants.TILE_MASK|H<<StencilConstants.SKIP_LOD_BIT_SHIFT,O=THREE__namespace.GreaterEqualStencilFunc,G=StencilConstants.SKIP_LOD_MASK,Q=THREE__namespace.ReplaceStencilOp,U=StencilConstants.TILE_MASK|StencilConstants.SKIP_LOD_MASK;L.traverse(function(D){if(D instanceof THREE__namespace.Mesh)for(var q=Array.isArray(D.material)?D.material:D.material?[D.material]:[],z=0,K=q;z<K.length;z++){var J=K[z];i.tileset.hasMixedContent&&i.tileset.skipLevelOfDetail?(J.stencilWrite=!0,J.stencilRef=F,J.stencilFunc=O,J.stencilFuncMask=G,J.stencilZPass=Q,J.stencilWriteMask=U):(J.stencilWrite=!1,J.stencilRef=StencilConstants.TILE_MASK,J.stencilFunc=THREE__namespace.AlwaysStencilFunc,J.stencilFuncMask=StencilConstants.TILE_MASK,J.stencilZPass=THREE__namespace.ReplaceStencilOp,J.stencilWriteMask=StencilConstants.TILE_MASK)}}),y.push(L)},g=this,E=0,b=this.tileset.selectedTiles;E<b.length;E++){var T=b[E];m(T)}var _=[];this.tileset.skipLevelOfDetail&&_.push.apply(_,h),_.push.apply(_,y),this.tileset.skipLevelOfDetail&&_.push(this.clearStencilObject),this.debug&&_.push.apply(_,p);for(var S=this.modelIndex*1e4,R=function(M){var L=_[M],C=M+S;L.traverse(function(H){(H instanceof THREE__namespace.Mesh||H instanceof THREE__namespace.Line||H instanceof THREE__namespace.Points)&&(H.renderOrder=C)}),B.add(L)},B=this,I=0;I<_.length;I++)R(I);var x=this.getRenderHash();this.lastRenderHash!==x&&(this.needsRender=!0,this.lastRenderHash=x)},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=Tileset.DEFAULT_MAX_SCREEN_SPACE_ERROR,t.DEFAULT_SKIP_LEVEL_OF_DETAIL=Tileset.DEFAULT_SKIP_LEVEL_OF_DETAIL,t.DEFAULT_LOAD_SIBLINGS=Tileset.DEFAULT_LOAD_SIBLINGS,t.DEFAULT_MAX_REQUESTS=Tileset.DEFAULT_MAX_REQUESTS,t}(THREE__namespace.Object3D);function headingToLongitude(n){return-((n-.25)*360+90)/180*Math.PI}function equal(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(!equal(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 o=i[r];if(!equal(n[o],t[o]))return!1}return!0}return n!==n&&t!==t}function isNumber(n){return typeof n=="number"}var error_invalid_input=function(){return new Error("Invalid input.")},error_invalid_certificate=function(){return new Error("Invalid certificate.")},error_invalid_signature=function(){return new Error("Invalid signature.")},error_date_expired=function(n){return new Error("date(".concat(n.toString(),") expired."))},error_host_not_allowed=function(n){return new Error("host(".concat(JSON.stringify(n),") is not allowed."))};function ObjectOmit(n,t){for(var e={},r=0,i=Object.keys(n);r<i.length;r++){var o=i[r];t.indexOf(o)===-1&&(e[o]=n[o])}return e}function jsonStableNoneNumberStrinfiy_(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,o=0;o<i;o++)r+=jsonStableNoneNumberStrinfiy_(n[o],!1)+",";return i>-1&&(r+=jsonStableNoneNumberStrinfiy_(n[o],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return jsonStableNoneNumberStrinfiy_(n.toJSON(),t);for(var s=Object.keys(n).sort(),u=s.length,r="",o=0;o<u;){var c=s[o],l=jsonStableNoneNumberStrinfiy_(n[c],!0);l!==void 0&&(o&&r!==""&&(r+=","),r+=JSON.stringify(c)+":"+l),o++}return"{"+r+"}"}switch(e){case"function":case"undefined":return t?void 0:null;case"number":return 0;default:return isFinite(n)?n:null}}function jsonStableNoneNumberStrinfiy(n){return String(jsonStableNoneNumberStrinfiy_(n,!1))}function verify(n){var t,e,r;if(Array.isArray(n)){var i=void 0,o,s;if(n.length<=0)return error_invalid_input();for(var u=function(T){var _=verify(n[T]);if(_ instanceof Error)return{value:_};if(!i)i=_.issuer;else if(i!==_.issuer)return{value:error_invalid_certificate()};o?_.expire.getTime()<o.getTime()&&(o=_.expire):o=_.expire,s?s=s.filter(function(S){return _.allowHosts.indexOf(S)!==-1}):s=_.allowHosts},c=0;c<n.length;c++){var l=u(c);if(typeof l=="object")return l.value}return deepFreeze({issuer:i,expire:o,allowHosts:s})}var d=JSON.parse(n),f=typeof location!="undefined"?location.hostname:"",v=Date.now();if(typeof d!="object")return error_invalid_input();var A=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||isIPDomain(f)||BUILDIN_ALLOW_HOST.filter(function(T){return matchDomain(T,f)}).length>0){var p=String((t=d.certificate)!==null&&t!==void 0?t:"");if(p){var y=new X509;return y.readCertPEM(p),deepFreeze({issuer:y.getSubjectString(),expire:A,allowHosts:h})}return deepFreeze({issuer:"none",expire:A,allowHosts:h})}var m=String((e=d.certificate)!==null&&e!==void 0?e:"");if(!m)return error_invalid_certificate();var g=new X509;g.readCertPEM(m);var E=String((r=d._signature)!==null&&r!==void 0?r:"");if(!E)return error_invalid_signature();var b=jsonStableNoneNumberStrinfiy(ObjectOmit(d,["_signature"]));return verifyMessage(b,E,g)===!1?error_invalid_signature():v<A.getTime()?h.filter(function(T){return matchDomain(T,f)}).length===0?error_host_not_allowed(f):deepFreeze({issuer:g.getSubjectString(),expire:A,allowHosts:h}):error_date_expired(A)}var scratchMatrix4$1=new THREE__namespace.Matrix4,workRawMapping=new WeakMap,Work=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 THREE__namespace.Matrix4;{var r=this;this.options={get transform(){return r.transform},set transform(o){r.transform.copy(o)}}}var i=parse(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=parseWork,n}();function getType(n){return n==null?"null":Array.isArray(n)?"array":typeof n=="object"?"dict":"value"}function deepMerge(n,t){var e=getType(n),r=getType(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]=deepMerge(n[i],t[i]);else if(r==="dict")for(var o in t)n[o]=deepMerge(n[o],t[o]);return n}function startWithString(n,t){return n.indexOf(t)===0}function urlWithParseOptions(n,t,e,r){var i,o=t;if(r.jsonp===!0){o=t.replace(/([\?\#].*)?$/i,"");var s=sha256("".concat(o)).slice(0,7);o="".concat(o,".").concat(s,".jsonp")}if(r.shortPath===!0){var u=o.replace(n,"").split("."),l=(i=u.shift())!==null&&i!==void 0?i:"",c=u.join(".");o=pathJoin(n,sha256(l))+(c?"."+c:"")}var d=o.replace(n,"");return r.baseURL&&(o=pathJoin(r.baseURL,d)),r.traverseResource&&r.traverseResource({origin:t,absolute:o,relative:d,type:e}),o}function panoURL(n,t,e,r,i){var o=e;return isAbsoluteURL(e)||(t&&(t=pathJoin(t,String(r))),o=pathJoin(t,o)),isAbsoluteURL(o)||(o=pathJoin(n,o)),startWithString(o,n)||console.warn("".concat(o," is not start with base_url(").concat(n,").")),urlWithParseOptions(n,o,"panorama",i)}function fileURL(n,t,e){var r=t;return isAbsoluteURL(r)||(r=pathJoin(n,t)),startWithString(r,n)||console.warn("".concat(r," is not start with base_url(").concat(n,").")),urlWithParseOptions(n,r,"model",e)}function textureURL$1(n,t,e,r){var i=t;return isAbsoluteURL(i)||(i=pathJoin(e,i)),isAbsoluteURL(i)||(i=pathJoin(n,i)),startWithString(i,n)||console.warn("".concat(i," is not start with base_url(").concat(n,").")),urlWithParseOptions(n,i,"texture",r)}var getTileLevel=function(n){for(var t=0;t<10;t++){var e=512*Math.pow(2,t);if(e>=n)return t}return null},sortTile=function(n){n=n.slice().sort(function(s,u){return s.level-u.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 o=t[t.length-1];if(i.level>o.level){t.push(i);continue}if(i.size>o.size){t[t.length-1]=i;continue}}return t};function parse(n,t,e){for(var r,i,o,s,u,l,c,d,f,m,A,h,p,y,v,g,E,b,T,_=JSON.stringify(t),x=[],R=0,w=[].concat(n);R<w.length;R++){var S=w[R];S instanceof Work?x.push.apply(x,S.raw.works):typeof S=="string"?x.push(S):x.push(JSON.stringify(S))}var C=verify(x);if(C instanceof Error)return C;Array.isArray(t.transform)?e.transform.fromArray(t.transform):t.transform&&e.transform.copy(t.transform),n=x.map(function(Z){return JSON.parse(Z)}).reduce(function(Z,Y){return deepMerge(Z,Y)}),Object.defineProperty(e,"raw",{configurable:!1,get:function(){return{works:x,options:_}}});{var I;if(t.workCode&&(typeof t.workCode=="string"?I=t.workCode:typeof t.workCode=="function"&&(I=t.workCode(n))),typeof I=="undefined"&&(I=String(n.resource_code||n.basic_code||n.vr_code||n.code||n.project_id||n.work_code||n.workCode)),typeof I=="undefined")return new Error("WorkCode never matched.");Object.defineProperty(e,"workCode",{configurable:!1,get:function(){return I}})}{var H=String(n.name);Object.defineProperty(e,"name",{configurable:!1,get:function(){return H}})}if(C instanceof Error)return C;Object.defineProperty(e,"issuer",{configurable:!1,get:function(){return C.issuer}}),Object.defineProperty(e,"expire",{configurable:!1,get:function(){return C.expire}}),Object.defineProperty(e,"allowHosts",{configurable:!1,get:function(){return C.allowHosts}});var B=(r=n.base_url)!==null&&r!==void 0?r:"";if(B&&B[B.length-1]!=="/"&&(B+="/"),C instanceof Error)return C;if(n.model){var L={work:e,layers:[]},O;n.model.file?O=fileURL(B,n.model.file,t):n.model.file_url&&(O=fileURL(B,n.model.file_url,t)),Object.defineProperty(L,"file",{configurable:!1,get:function(){return O}});var k;n.model.textureBase?k=textureURL$1(B,"",n.model.textureBase,t):n.model.material_base_url?k=textureURL$1(B,"",n.model.material_base_url,t):L.file&&(k=L.file.split("/").slice(0,-1).join("/").replace("/model/","/materials/")),Object.defineProperty(L,"textureBase",{configurable:!1,get:function(){return k}});var K;Array.isArray(n.model.textures)?(K=n.model.textures.map(function(Z){var Y,V;return textureURL$1(B,Z,(V=(Y=n.model.textureBase)!==null&&Y!==void 0?Y:n.model.material_base_url)!==null&&V!==void 0?V:"",t)}),Object.freeze(K)):Array.isArray(n.model.material_textures)&&(K=n.model.material_textures.map(function(Z){var Y,V;return textureURL$1(B,Z,(V=(Y=n.model.textureBase)!==null&&Y!==void 0?Y:n.model.material_base_url)!==null&&V!==void 0?V:"",t)}),Object.freeze(K)),Object.defineProperty(L,"textures",{configurable:!1,get:function(){return K}});var z=[];if(Array.isArray(n.model.tiles))for(var N=0,U=n.model.tiles;N<U.length;N++){var Q=U[N];Q&&(Q.tileset||Q.tileset_url)&&z.push(Object.freeze({type:(i=Q.type)!==null&&i!==void 0?i:"mesh",name:(o=Q.name)!==null&&o!==void 0?o:"",upAxis:(u=(s=Q.upAxis)!==null&&s!==void 0?s:Q.up_axis)!==null&&u!==void 0?u:"-Y",tileset:fileURL(B,Q.tileset||Q.tileset_url,t)}))}else n.model.tiles&&(n.model.tiles.tileset||n.model.tiles.tileset_url)&&z.push(Object.freeze({type:(l=n.model.tiles.type)!==null&&l!==void 0?l:"mesh",name:(c=n.model.tiles.name)!==null&&c!==void 0?c:"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:fileURL(B,n.model.tiles.tileset||n.model.tiles.tileset_url,t)}));if(Array.isArray(n.model.layers))for(var G=0,q=n.model.layers;G<q.length;G++){var j=q[G];j&&(j.tileset||j.tileset_url)&&z.push(Object.freeze({type:(m=j.type)!==null&&m!==void 0?m:"mesh",name:(A=j.name)!==null&&A!==void 0?A:"",upAxis:(h=j.upAxis)!==null&&h!==void 0?h:j.up_axis,tileset:fileURL(B,j.tileset||j.tileset_url,t)}))}Object.freeze(z),Object.defineProperty(L,"layers",{configurable:!1,get:function(){return z}}),Object.defineProperty(e,"model",{configurable:!1,get:function(){if(L.file||L.layers.length)return L}})}if(C instanceof Error)return C;var X=new Set,ae=new Set;{var W=[];if(n.observers&&Array.isArray(n.observers)){var te=[];n.panorama&&(Array.isArray(n.panorama)?te=n.panorama:Array.isArray(n.panorama.list)?te=n.panorama.list:Array.isArray(n.panorama.info)&&(te=n.panorama.info));for(var ee=function(Z){var Y={},V=n.observers[Z];if(!V)return"break";var Ee=te[Z];if(!Ee)return"break";V=Object.assign({},V,Ee,{active:V.active!==!1&&Ee.active!==!1}),Object.defineProperty(Y,"work",{configurable:!1,get:function(){return e}}),Object.defineProperty(Y,"index",{configurable:!1,get:function(){return Z}}),ae.add(Z),Object.defineProperty(Y,"panoIndex",{configurable:!1,get:function(){return Z}});var ge=panoStringify({workCode:e.workCode,panoIndex:Z});X.add(ge),Object.defineProperty(Y,"panoId",{configurable:!1,get:function(){return ge}});var me=Object.freeze({workCode:e.workCode,panoIndex:Z});Object.defineProperty(Y,"pano",{configurable:!1,get:function(){return me}});var Re=V.active!==!1;Object.defineProperty(Y,"active",{configurable:!1,get:function(){return Re}});var fe=V.loadable===!0;Object.defineProperty(Y,"loadable",{configurable:!1,get:function(){return fe}});var de=V.derived_id;Object.defineProperty(Y,"derivedId",{configurable:!1,get:function(){return de}});var ce=V.derived_id_str;Object.defineProperty(Y,"derivedIdStr",{configurable:!1,get:function(){return ce}});var le=(b=(g=(y=(p=n.panorama)===null||p===void 0?void 0:p.pano_high_cube_base_url)!==null&&y!==void 0?y:(v=n.panorama)===null||v===void 0?void 0:v.pano_cube_base_url)!==null&&g!==void 0?g:(E=n.panorama)===null||E===void 0?void 0:E.base_url)!==null&&b!==void 0?b:"",ue={up:panoURL(B,le,V.images?V.images.up:V.up,Z,t),down:panoURL(B,le,V.images?V.images.down:V.down,Z,t),right:panoURL(B,le,V.images?V.images.right:V.right,Z,t),left:panoURL(B,le,V.images?V.images.left:V.left,Z,t),front:panoURL(B,le,V.images?V.images.front:V.front,Z,t),back:panoURL(B,le,V.images?V.images.back:V.back,Z,t)};if(V.size_list)ue.sizeList=V.size_list.slice();else{var Te=getImageSizeFromURL(ue.up);if(Te&&(ue.sizeList=[Te],V.tiles))for(var xe=V.tiles.slice().sort(function(_e,Pe){return _e-Pe}).map(function(_e){return 512*Math.pow(2,_e)}),Ie=0,lt=xe;Ie<lt.length;Ie++){var ye=lt[Ie];ye>Te&&ue.sizeList.push(ye)}}var we=V.images?V.images.luminance:V.luminance;we&&(ue.luminance=Object.freeze({up:panoURL(B,le,we.up,Z,t),down:panoURL(B,le,we.down,Z,t),right:panoURL(B,le,we.right,Z,t),left:panoURL(B,le,we.left,Z,t),front:panoURL(B,le,we.front,Z,t),back:panoURL(B,le,we.back,Z,t)}));var Be=void 0;if(V.images)Be=V.images.tiles;else if(Array.isArray(V.size_list)){var Je=V.size_list.slice().sort(function(_e,Pe){return _e-Pe});if(Je[0]){var ht=getTileLevel(Je[0]);if(ht)for(var je=ht-1;je>=0;je--)Je.unshift(512*Math.pow(2,je));Be=Je}}else Array.isArray(V.tiles)&&(Be=V.tiles.slice(),typeof Be[0]=="number"&&(Be=Be.sort(function(_e,Pe){return _e-Pe}).map(function(_e){return 512*Math.pow(2,_e)})));if(Be){for(var Ve=[],Xe=0,at=Be;Xe<at.length;Xe++){var ye=at[Xe];if(typeof ye=="number"){var Ue=getTileLevel(ye);if(typeof Ue!="number")continue;var We=getImageSizeFromURL(ue.front);if(!We)continue;if(ye>We){var ze=replaceImageSize(ue.up,ye),He=replaceImageSize(ue.down,ye),be=replaceImageSize(ue.right,ye),$e=replaceImageSize(ue.left,ye),Fe=replaceImageSize(ue.front,ye),et=replaceImageSize(ue.back,ye);Ve.push(Object.freeze({level:Ue,size:ye,scale:1,up:ze,down:He,right:be,left:$e,front:Fe,back:et}))}else{var ze=ue.up,He=ue.down,be=ue.right,$e=ue.left,Fe=ue.front,et=ue.back;Ve.push(Object.freeze({level:Ue,size:We,scale:ye/We,up:ze,down:He,right:be,left:$e,front:Fe,back:et}))}}else{var Ue=ye.level;if(typeof Ue!="number")continue;var Te=ye.size;if(typeof Te!="number")continue;var ze=panoURL(B,le,ye.up,Z,t),He=panoURL(B,le,ye.down,Z,t),be=panoURL(B,le,ye.right,Z,t),$e=panoURL(B,le,ye.left,Z,t),Fe=panoURL(B,le,ye.front,Z,t),et=panoURL(B,le,ye.back,Z,t);Ve.push(Object.freeze({level:Ue,size:Te,scale:(T=ye.scale)!==null&&T!==void 0?T:1,up:ze,down:He,right:be,left:$e,front:Fe,back:et}))}}Ve=sortTile(Ve),Object.freeze(Ve),Object.defineProperty(ue,"tiles",{configurable:!1,get:function(){return Ve}})}Object.freeze(ue),Object.defineProperty(Y,"images",{configurable:!1,get:function(){return ue}});var tt=new THREE__namespace.Vector3;if(V.position instanceof THREE__namespace.Vector3)tt.copy(V.position);else if(Array.isArray(V.position))tt.fromArray(V.position);else return"break";Object.freeze(tt),Object.defineProperty(Y,"position",{configurable:!1,get:function(){return tt}});var Qe=new THREE__namespace.Vector3;if(V.standingPosition instanceof THREE__namespace.Vector3)Qe.copy(V.standingPosition);else if(Array.isArray(V.standingPosition))Qe.fromArray(V.standingPosition);else if(V.standing_position instanceof THREE__namespace.Vector3)Qe.copy(V.standing_position);else if(Array.isArray(V.standing_position))Qe.fromArray(V.standing_position);else return"break";Object.freeze(Qe),Object.defineProperty(Y,"standingPosition",{configurable:!1,get:function(){return Qe}});var Ne=new THREE__namespace.Quaternion;if(V.quaternion instanceof THREE__namespace.Quaternion)Ne.copy(V.quaternion);else if(Array.isArray(V.quaternion))Ne.fromArray(V.quaternion);else if(V.quaternion){var rt=V.quaternion,ot=rt.x,pt=rt.y,ct=rt.z,dt=rt.w;Ne.set(ot,pt,ct,dt)}else return"break";Object.freeze(Ne),Object.defineProperty(Y,"quaternion",{configurable:!1,get:function(){return Ne}});var Ge=0;isNumber(V.floorIndex)?Ge=V.floorIndex:isNumber(V.floor_index)?Ge=V.floor_index:isNumber(V.floor)&&(Ge=V.floor),Object.defineProperty(Y,"floorIndex",{configurable:!1,get:function(){return Ge}});var Me;V.video&&(Me={},typeof V.video.source=="string"&&(Me.source=V.video.source),V.video.matrix instanceof THREE__namespace.Matrix4?Me.matrix=V.video.matrix.clone():Array.isArray(V.video.matrix)&&(Me.matrix=new THREE__namespace.Matrix4().fromArray(V.video.matrix)),V.video.size instanceof THREE__namespace.Vector2?Me.size=V.video.size.clone():Array.isArray(V.video.size)&&(Me.size=new THREE__namespace.Vector2().fromArray(V.video.size)),Me.source&&Me.matrix&&Me.size&&(Y.video=Me)),Object.freeze(Me),Object.defineProperty(Y,"video",{configurable:!1,get:function(){return Me}}),Array.isArray(V.accessibleNodes)?(Y.accessibleNodes=V.accessibleNodes.slice(),Y.accessibleIds=V.accessibleNodes.map(function(_e){return panoStringify({workCode:e.workCode,panoIndex:_e})})):Array.isArray(V.accessible_nodes)&&(Y.accessibleNodes=V.accessible_nodes.slice(),Y.accessibleIds=V.accessible_nodes.map(function(_e){return panoStringify({workCode:e.workCode,panoIndex:_e})})),Array.isArray(V.visibleNodes)?(Y.visibleNodes=V.visibleNodes.slice(),Y.visibleIds=V.visibleNodes.map(function(_e){return panoStringify({workCode:e.workCode,panoIndex:_e})})):Array.isArray(V.visible_nodes)&&(Y.visibleNodes=V.visible_nodes.slice(),Y.visibleIds=V.visible_nodes.map(function(_e){return panoStringify({workCode:e.workCode,panoIndex:_e})})),W[Z]=Y},ie=0;ie<n.observers.length;ie++){var $=ee(ie);if($==="break")break}}for(var se=function(Z){if(Z.accessibleIds){var Ee=Z.accessibleIds.filter(function(le){return X.has(le)});Object.freeze(Ee),Object.defineProperty(Z,"accessibleIds",{configurable:!1,get:function(){return Ee}})}else{for(var Y=[],V=0;V<W.length;V++)W[V]!==Z&&(Math.abs(W[V].position.y-Z.position.y)>3||W[V].position.distanceTo(Z.position)>10||Y.push(W[V].panoId));Object.freeze(Y),Object.defineProperty(Z,"accessibleIds",{configurable:!1,get:function(){return Y}})}if(Z.accessibleNodes){var me=Z.accessibleNodes.filter(function(le){return ae.has(le)});Object.freeze(me),Object.defineProperty(Z,"accessibleNodes",{configurable:!1,get:function(){return me}})}else{for(var ge=[],V=0;V<W.length;V++)W[V]!==Z&&(Math.abs(W[V].position.y-Z.position.y)>3||W[V].position.distanceTo(Z.position)>10||ge.push(W[V].panoIndex));Object.freeze(ge),Object.defineProperty(Z,"accessibleNodes",{configurable:!1,get:function(){return ge}})}if(Z.visibleIds){var fe=Z.visibleIds.filter(function(le){return X.has(le)});Object.freeze(fe),Object.defineProperty(Z,"visibleIds",{configurable:!1,get:function(){return fe}})}else{var Re=Z.accessibleIds.slice();Object.freeze(Re),Object.defineProperty(Z,"visibleIds",{configurable:!1,get:function(){return Re}})}if(Z.visibleNodes){var ce=Z.visibleNodes.filter(function(le){return ae.has(le)});Object.freeze(ce),Object.defineProperty(Z,"visibleNodes",{configurable:!1,get:function(){return ce}})}else{var de=Z.accessibleNodes.slice();Object.freeze(de),Object.defineProperty(Z,"visibleNodes",{configurable:!1,get:function(){return de}})}},re=0,oe=W;re<oe.length;re++){var pe=oe[re];se(pe)}Object.freeze(W),Object.defineProperty(e,"observers",{configurable:!1,get:function(){return W}})}if(C instanceof Error)return C;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),isNumber(n.initial.latitude)&&(e.initial.latitude=n.initial.latitude),isNumber(n.initial.longitude)?e.initial.longitude=n.initial.longitude:isNumber(n.initial.heading)&&(e.initial.longitude=headingToLongitude(n.initial.heading)),isNumber(n.initial.fov)&&(e.initial.fov=n.initial.fov),e.observers.length>0){var he=void 0;isNumber(n.initial.panoIndex)?he=n.initial.panoIndex:isNumber(n.initial.pano_index)?he=n.initial.pano_index:isNumber(n.initial.pano)&&(he=n.initial.pano),typeof he=="number"&&(he=clamp$1(he,0,e.observers.length-1),e.initial.panoIndex=he)}if(isNumber(n.initial.distance)&&(e.initial.distance=n.initial.distance),Array.isArray(n.initial.offset)){var Ae=[0,0,0].map(function(Z,Y){var V=Number(n.initial.offset[Y]);return isNaN(V)||!isFinite(V)?0:V});e.initial.offset=new THREE__namespace.Vector3().fromArray(Ae)}!e.initial.mode&&typeof e.initial.panoIndex=="number"&&(e.initial.mode="Panorama")}return C instanceof Error?C:(workRawMapping.set(e,{works:x,options:_}),e)}function parseWork(n,t){typeof n=="string"&&n.trim()[0]==="{"&&(n=JSON.parse(n));var e=workRawMapping.get(n);if(e){if(t&&!equal(JSON.parse(e.options),t))throw new Error("[PARSE FAILED]: work is parsed with different options.");return n}else try{return new Work(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=parseWork,n}();function getType(n){return n==null?"null":Array.isArray(n)?"array":typeof n=="object"?"dict":"value"}function deepMerge(n,t){var e=getType(n),r=getType(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]=deepMerge(n[i],t[i]);else if(r==="dict")for(var o in t)n[o]=deepMerge(n[o],t[o]);return n}function startWithString(n,t){return n.indexOf(t)===0}function urlWithParseOptions(n,t,e,r){var i,o=t;if(r.jsonp===!0){o=t.replace(/([\?\#].*)?$/i,"");var s=sha256("".concat(o)).slice(0,7);o="".concat(o,".").concat(s,".jsonp")}if(r.shortPath===!0){var u=o.replace(n,"").split("."),c=(i=u.shift())!==null&&i!==void 0?i:"",l=u.join(".");o=pathJoin(n,sha256(c))+(l?"."+l:"")}var d=o.replace(n,"");return r.baseURL&&(o=pathJoin(r.baseURL,d)),r.traverseResource&&r.traverseResource({origin:t,absolute:o,relative:d,type:e}),o}function panoURL(n,t,e,r,i){var o=e;return isAbsoluteURL(e)||(t&&(t=pathJoin(t,String(r))),o=pathJoin(t,o)),isAbsoluteURL(o)||(o=pathJoin(n,o)),startWithString(o,n)||console.warn("".concat(o," is not start with base_url(").concat(n,").")),urlWithParseOptions(n,o,"panorama",i)}function fileURL(n,t,e){var r=t;return isAbsoluteURL(r)||(r=pathJoin(n,t)),startWithString(r,n)||console.warn("".concat(r," is not start with base_url(").concat(n,").")),urlWithParseOptions(n,r,"model",e)}function textureURL$1(n,t,e,r){var i=t;return isAbsoluteURL(i)||(i=pathJoin(e,i)),isAbsoluteURL(i)||(i=pathJoin(n,i)),startWithString(i,n)||console.warn("".concat(i," is not start with base_url(").concat(n,").")),urlWithParseOptions(n,i,"texture",r)}var getTileLevel=function(n){for(var t=10;t>=0;t--){var e=512*Math.pow(2,t);if(e<=n)return t}return null},sortTile=function(n){n=n.slice().sort(function(s,u){return s.level-u.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 o=t[t.length-1];if(i.level>o.level){t.push(i);continue}if(i.size>o.size){t[t.length-1]=i;continue}}return t};function parse(n,t,e){for(var r,i,o,s,u,c,l,d,f,v,A,h,p,y,m,g,E,b,T,_=JSON.stringify(t),S=[],R=0,B=[].concat(n);R<B.length;R++){var I=B[R];I instanceof Work?S.push.apply(S,I.raw.works):typeof I=="string"?S.push(I):S.push(JSON.stringify(I))}var x=verify(S);if(x instanceof Error)return x;Array.isArray(t.transform)?e.transform.fromArray(t.transform):t.transform&&e.transform.copy(t.transform),n=S.map(function(Z){return JSON.parse(Z)}).reduce(function(Z,Y){return deepMerge(Z,Y)}),Object.defineProperty(e,"raw",{configurable:!1,get:function(){return{works:S,options:_}}});{var M;if(t.workCode&&(typeof t.workCode=="string"?M=t.workCode:typeof t.workCode=="function"&&(M=t.workCode(n))),typeof M=="undefined"&&(M=String(n.resource_code||n.basic_code||n.vr_code||n.code||n.project_id||n.work_code||n.workCode)),typeof M=="undefined")return new Error("WorkCode never matched.");Object.defineProperty(e,"workCode",{configurable:!1,get:function(){return M}})}{var L=String(n.name);Object.defineProperty(e,"name",{configurable:!1,get:function(){return L}})}if(x instanceof Error)return x;Object.defineProperty(e,"issuer",{configurable:!1,get:function(){return x.issuer}}),Object.defineProperty(e,"expire",{configurable:!1,get:function(){return x.expire}}),Object.defineProperty(e,"allowHosts",{configurable:!1,get:function(){return x.allowHosts}});var C=(r=n.base_url)!==null&&r!==void 0?r:"";if(C&&C[C.length-1]!=="/"&&(C+="/"),x instanceof Error)return x;if(n.model){var H={work:e,layers:[]},F;n.model.file?F=fileURL(C,n.model.file,t):n.model.file_url&&(F=fileURL(C,n.model.file_url,t)),Object.defineProperty(H,"file",{configurable:!1,get:function(){return F}});var O;n.model.textureBase?O=textureURL$1(C,"",n.model.textureBase,t):n.model.material_base_url?O=textureURL$1(C,"",n.model.material_base_url,t):H.file&&(O=H.file.split("/").slice(0,-1).join("/").replace("/model/","/materials/")),Object.defineProperty(H,"textureBase",{configurable:!1,get:function(){return O}});var G;Array.isArray(n.model.textures)?(G=n.model.textures.map(function(Z){var Y,N;return textureURL$1(C,Z,(N=(Y=n.model.textureBase)!==null&&Y!==void 0?Y:n.model.material_base_url)!==null&&N!==void 0?N:"",t)}),Object.freeze(G)):Array.isArray(n.model.material_textures)&&(G=n.model.material_textures.map(function(Z){var Y,N;return textureURL$1(C,Z,(N=(Y=n.model.textureBase)!==null&&Y!==void 0?Y:n.model.material_base_url)!==null&&N!==void 0?N:"",t)}),Object.freeze(G)),Object.defineProperty(H,"textures",{configurable:!1,get:function(){return G}});var Q=[];if(Array.isArray(n.model.tiles))for(var U=0,D=n.model.tiles;U<D.length;U++){var q=D[U];q&&(q.tileset||q.tileset_url)&&Q.push(Object.freeze({type:(i=q.type)!==null&&i!==void 0?i:"mesh",name:(o=q.name)!==null&&o!==void 0?o:"",upAxis:(u=(s=q.upAxis)!==null&&s!==void 0?s:q.up_axis)!==null&&u!==void 0?u:"-Y",tileset:fileURL(C,q.tileset||q.tileset_url,t)}))}else n.model.tiles&&(n.model.tiles.tileset||n.model.tiles.tileset_url)&&Q.push(Object.freeze({type:(c=n.model.tiles.type)!==null&&c!==void 0?c:"mesh",name:(l=n.model.tiles.name)!==null&&l!==void 0?l:"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:fileURL(C,n.model.tiles.tileset||n.model.tiles.tileset_url,t)}));if(Array.isArray(n.model.layers))for(var z=0,K=n.model.layers;z<K.length;z++){var J=K[z];J&&(J.tileset||J.tileset_url)&&Q.push(Object.freeze({type:(v=J.type)!==null&&v!==void 0?v:"mesh",name:(A=J.name)!==null&&A!==void 0?A:"",upAxis:(h=J.upAxis)!==null&&h!==void 0?h:J.up_axis,tileset:fileURL(C,J.tileset||J.tileset_url,t)}))}Object.freeze(Q),Object.defineProperty(H,"layers",{configurable:!1,get:function(){return Q}}),Object.defineProperty(e,"model",{configurable:!1,get:function(){if(H.file||H.layers.length)return H}})}if(x instanceof Error)return x;var j=new Set,re=new Set;{var W=[];if(n.observers&&Array.isArray(n.observers)){var te=[];n.panorama&&(Array.isArray(n.panorama)?te=n.panorama:Array.isArray(n.panorama.list)?te=n.panorama.list:Array.isArray(n.panorama.info)&&(te=n.panorama.info));for(var $=function(Z){var Y={},N=n.observers[Z];if(!N)return"break";var Ee=te[Z];if(!Ee)return"break";N=Object.assign({},N,Ee,{active:N.active!==!1&&Ee.active!==!1}),Object.defineProperty(Y,"work",{configurable:!1,get:function(){return e}}),Object.defineProperty(Y,"index",{configurable:!1,get:function(){return Z}}),re.add(Z),Object.defineProperty(Y,"panoIndex",{configurable:!1,get:function(){return Z}});var ge=panoStringify({workCode:e.workCode,panoIndex:Z});j.add(ge),Object.defineProperty(Y,"panoId",{configurable:!1,get:function(){return ge}});var ve=Object.freeze({workCode:e.workCode,panoIndex:Z});Object.defineProperty(Y,"pano",{configurable:!1,get:function(){return ve}});var xe=N.active!==!1;Object.defineProperty(Y,"active",{configurable:!1,get:function(){return xe}});var fe=N.loadable===!0;Object.defineProperty(Y,"loadable",{configurable:!1,get:function(){return fe}});var de=N.derived_id;Object.defineProperty(Y,"derivedId",{configurable:!1,get:function(){return de}});var le=N.derived_id_str;Object.defineProperty(Y,"derivedIdStr",{configurable:!1,get:function(){return le}});var ue=(b=(g=(y=(p=n.panorama)===null||p===void 0?void 0:p.pano_high_cube_base_url)!==null&&y!==void 0?y:(m=n.panorama)===null||m===void 0?void 0:m.pano_cube_base_url)!==null&&g!==void 0?g:(E=n.panorama)===null||E===void 0?void 0:E.base_url)!==null&&b!==void 0?b:"",oe={up:panoURL(C,ue,N.images?N.images.up:N.up,Z,t),down:panoURL(C,ue,N.images?N.images.down:N.down,Z,t),right:panoURL(C,ue,N.images?N.images.right:N.right,Z,t),left:panoURL(C,ue,N.images?N.images.left:N.left,Z,t),front:panoURL(C,ue,N.images?N.images.front:N.front,Z,t),back:panoURL(C,ue,N.images?N.images.back:N.back,Z,t)};if(N.size_list)oe.sizeList=N.size_list.slice();else{var Te=getImageSizeFromURL(oe.up);if(Te&&(oe.sizeList=[Te],N.tiles))for(var Re=N.tiles.slice().sort(function(_e,Pe){return _e-Pe}).map(function(_e){return 512*Math.pow(2,_e)}),Ie=0,lt=Re;Ie<lt.length;Ie++){var ye=lt[Ie];ye>Te&&oe.sizeList.push(ye)}}var we=N.images?N.images.luminance:N.luminance;we&&(oe.luminance=Object.freeze({up:panoURL(C,ue,we.up,Z,t),down:panoURL(C,ue,we.down,Z,t),right:panoURL(C,ue,we.right,Z,t),left:panoURL(C,ue,we.left,Z,t),front:panoURL(C,ue,we.front,Z,t),back:panoURL(C,ue,we.back,Z,t)}));var Be=void 0;if(N.images)Be=N.images.tiles;else if(Array.isArray(N.size_list)){var Je=N.size_list.slice().sort(function(_e,Pe){return _e-Pe});if(Je[0]){var ht=getTileLevel(Je[0]);if(ht)for(var Xe=ht-1;Xe>=0;Xe--)Je.unshift(512*Math.pow(2,Xe));Be=Je}}else Array.isArray(N.tiles)&&(Be=N.tiles.slice(),typeof Be[0]=="number"&&(Be=Be.sort(function(_e,Pe){return _e-Pe}).map(function(_e){return 512*Math.pow(2,_e)})));if(Be){for(var Ve=[],je=0,at=Be;je<at.length;je++){var ye=at[je];if(typeof ye=="number"){var Ue=getTileLevel(ye);if(typeof Ue!="number")continue;var We=getImageSizeFromURL(oe.front);if(!We)continue;if(ye>We){var ze=replaceImageSize(oe.up,ye),He=replaceImageSize(oe.down,ye),be=replaceImageSize(oe.right,ye),$e=replaceImageSize(oe.left,ye),Fe=replaceImageSize(oe.front,ye),et=replaceImageSize(oe.back,ye);Ve.push(Object.freeze({level:Ue,size:ye,scale:1,up:ze,down:He,right:be,left:$e,front:Fe,back:et}))}else{var ze=oe.up,He=oe.down,be=oe.right,$e=oe.left,Fe=oe.front,et=oe.back;Ve.push(Object.freeze({level:Ue,size:We,scale:ye/We,up:ze,down:He,right:be,left:$e,front:Fe,back:et}))}}else{var Ue=ye.level;if(typeof Ue!="number")continue;var Te=ye.size;if(typeof Te!="number")continue;var ze=panoURL(C,ue,ye.up,Z,t),He=panoURL(C,ue,ye.down,Z,t),be=panoURL(C,ue,ye.right,Z,t),$e=panoURL(C,ue,ye.left,Z,t),Fe=panoURL(C,ue,ye.front,Z,t),et=panoURL(C,ue,ye.back,Z,t);Ve.push(Object.freeze({level:Ue,size:Te,scale:(T=ye.scale)!==null&&T!==void 0?T:1,up:ze,down:He,right:be,left:$e,front:Fe,back:et}))}}Ve=sortTile(Ve),Object.freeze(Ve),Object.defineProperty(oe,"tiles",{configurable:!1,get:function(){return Ve}})}Object.freeze(oe),Object.defineProperty(Y,"images",{configurable:!1,get:function(){return oe}});var tt=new THREE__namespace.Vector3;if(N.position instanceof THREE__namespace.Vector3)tt.copy(N.position);else if(Array.isArray(N.position))tt.fromArray(N.position);else return"break";Object.freeze(tt),Object.defineProperty(Y,"position",{configurable:!1,get:function(){return tt}});var Qe=new THREE__namespace.Vector3;if(N.standingPosition instanceof THREE__namespace.Vector3)Qe.copy(N.standingPosition);else if(Array.isArray(N.standingPosition))Qe.fromArray(N.standingPosition);else if(N.standing_position instanceof THREE__namespace.Vector3)Qe.copy(N.standing_position);else if(Array.isArray(N.standing_position))Qe.fromArray(N.standing_position);else return"break";Object.freeze(Qe),Object.defineProperty(Y,"standingPosition",{configurable:!1,get:function(){return Qe}});var Ne=new THREE__namespace.Quaternion;if(N.quaternion instanceof THREE__namespace.Quaternion)Ne.copy(N.quaternion);else if(Array.isArray(N.quaternion))Ne.fromArray(N.quaternion);else if(N.quaternion){var rt=N.quaternion,ot=rt.x,pt=rt.y,ct=rt.z,dt=rt.w;Ne.set(ot,pt,ct,dt)}else return"break";Object.freeze(Ne),Object.defineProperty(Y,"quaternion",{configurable:!1,get:function(){return Ne}});var Ge=0;isNumber(N.floorIndex)?Ge=N.floorIndex:isNumber(N.floor_index)?Ge=N.floor_index:isNumber(N.floor)&&(Ge=N.floor),Object.defineProperty(Y,"floorIndex",{configurable:!1,get:function(){return Ge}});var Me;N.video&&(Me={},typeof N.video.source=="string"&&(Me.source=N.video.source),N.video.matrix instanceof THREE__namespace.Matrix4?Me.matrix=N.video.matrix.clone():Array.isArray(N.video.matrix)&&(Me.matrix=new THREE__namespace.Matrix4().fromArray(N.video.matrix)),N.video.size instanceof THREE__namespace.Vector2?Me.size=N.video.size.clone():Array.isArray(N.video.size)&&(Me.size=new THREE__namespace.Vector2().fromArray(N.video.size)),Me.source&&Me.matrix&&Me.size&&(Y.video=Me)),Object.freeze(Me),Object.defineProperty(Y,"video",{configurable:!1,get:function(){return Me}}),Array.isArray(N.accessibleNodes)?(Y.accessibleNodes=N.accessibleNodes.slice(),Y.accessibleIds=N.accessibleNodes.map(function(_e){return panoStringify({workCode:e.workCode,panoIndex:_e})})):Array.isArray(N.accessible_nodes)&&(Y.accessibleNodes=N.accessible_nodes.slice(),Y.accessibleIds=N.accessible_nodes.map(function(_e){return panoStringify({workCode:e.workCode,panoIndex:_e})})),Array.isArray(N.visibleNodes)?(Y.visibleNodes=N.visibleNodes.slice(),Y.visibleIds=N.visibleNodes.map(function(_e){return panoStringify({workCode:e.workCode,panoIndex:_e})})):Array.isArray(N.visible_nodes)&&(Y.visibleNodes=N.visible_nodes.slice(),Y.visibleIds=N.visible_nodes.map(function(_e){return panoStringify({workCode:e.workCode,panoIndex:_e})})),W[Z]=Y},ne=0;ne<n.observers.length;ne++){var ee=$(ne);if(ee==="break")break}}for(var ce=function(Z){if(Z.accessibleIds){var Ee=Z.accessibleIds.filter(function(ue){return j.has(ue)});Object.freeze(Ee),Object.defineProperty(Z,"accessibleIds",{configurable:!1,get:function(){return Ee}})}else{for(var Y=[],N=0;N<W.length;N++)W[N]!==Z&&(Math.abs(W[N].position.y-Z.position.y)>3||W[N].position.distanceTo(Z.position)>10||Y.push(W[N].panoId));Object.freeze(Y),Object.defineProperty(Z,"accessibleIds",{configurable:!1,get:function(){return Y}})}if(Z.accessibleNodes){var ve=Z.accessibleNodes.filter(function(ue){return re.has(ue)});Object.freeze(ve),Object.defineProperty(Z,"accessibleNodes",{configurable:!1,get:function(){return ve}})}else{for(var ge=[],N=0;N<W.length;N++)W[N]!==Z&&(Math.abs(W[N].position.y-Z.position.y)>3||W[N].position.distanceTo(Z.position)>10||ge.push(W[N].panoIndex));Object.freeze(ge),Object.defineProperty(Z,"accessibleNodes",{configurable:!1,get:function(){return ge}})}if(Z.visibleIds){var fe=Z.visibleIds.filter(function(ue){return j.has(ue)});Object.freeze(fe),Object.defineProperty(Z,"visibleIds",{configurable:!1,get:function(){return fe}})}else{var xe=Z.accessibleIds.slice();Object.freeze(xe),Object.defineProperty(Z,"visibleIds",{configurable:!1,get:function(){return xe}})}if(Z.visibleNodes){var le=Z.visibleNodes.filter(function(ue){return re.has(ue)});Object.freeze(le),Object.defineProperty(Z,"visibleNodes",{configurable:!1,get:function(){return le}})}else{var de=Z.accessibleNodes.slice();Object.freeze(de),Object.defineProperty(Z,"visibleNodes",{configurable:!1,get:function(){return de}})}},ae=0,se=W;ae<se.length;ae++){var Ae=se[ae];ce(Ae)}Object.freeze(W),Object.defineProperty(e,"observers",{configurable:!1,get:function(){return W}})}if(x instanceof Error)return x;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),isNumber(n.initial.latitude)&&(e.initial.latitude=n.initial.latitude),isNumber(n.initial.longitude)?e.initial.longitude=n.initial.longitude:isNumber(n.initial.heading)&&(e.initial.longitude=headingToLongitude(n.initial.heading)),isNumber(n.initial.fov)&&(e.initial.fov=n.initial.fov),e.observers.length>0){var he=void 0;isNumber(n.initial.panoIndex)?he=n.initial.panoIndex:isNumber(n.initial.pano_index)?he=n.initial.pano_index:isNumber(n.initial.pano)&&(he=n.initial.pano),typeof he=="number"&&(he=clamp$1(he,0,e.observers.length-1),e.initial.panoIndex=he)}if(isNumber(n.initial.distance)&&(e.initial.distance=n.initial.distance),Array.isArray(n.initial.offset)){var me=[0,0,0].map(function(Z,Y){var N=Number(n.initial.offset[Y]);return isNaN(N)||!isFinite(N)?0:N});e.initial.offset=new THREE__namespace.Vector3().fromArray(me)}!e.initial.mode&&typeof e.initial.panoIndex=="number"&&(e.initial.mode="Panorama")}return x instanceof Error?x:(workRawMapping.set(e,{works:S,options:_}),e)}function parseWork(n,t){typeof n=="string"&&n.trim()[0]==="{"&&(n=JSON.parse(n));var e=workRawMapping.get(n);if(e){if(t&&!equal(JSON.parse(e.options),t))throw new Error("[PARSE FAILED]: work is parsed with different options.");return n}else try{return new Work(n,t!=null?t:{})}catch(r){throw new Error("[PARSE FAILED]: "+r.message+`
931
931
  Error work input:
932
- `+JSON.stringify(n))}}function createWorks(n){for(var t={},e=[],r={},i=0,o=n;i<o.length;i++){var s=o[i],u=t[s.workCode];u||(u=t[s.workCode]=new THREE__namespace.Matrix4().copy(s.options.transform));for(var l=0,c=s.observers;l<c.length;l++){var d=c[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 THREE__namespace.Vector3().copy(d.position).applyMatrix4(u),standingPosition:new THREE__namespace.Vector3().copy(d.standingPosition).applyMatrix4(u),quaternion:new THREE__namespace.Quaternion().setFromRotationMatrix(scratchMatrix4$1.makeRotationFromQuaternion(d.quaternion).premultiply(u))};Object.freeze(f),e.push(f),r[f.panoId]=f}}Object.freeze(e);for(var m=n.slice(),A={},h=0,p=m;h<p.length;h++){var s=p[h];A[s.workCode]=s}return Object.freeze(Object.assign(m,{get initial(){return m.length>0?m[0].initial:{work:{}}},get resolvedObservers(){return e},getWork:function(y){return A[y]},getResolvedObserver:function(y){var v,g;return isPanoId(y)?r[y]:typeof y=="number"?r[panoStringify({workCode:(g=(v=n[0])===null||v===void 0?void 0:v.workCode)!==null&&g!==void 0?g:"",panoIndex:y})]:r[panoStringify(y)]},update:function(){for(var y={},v=0,g=m;v<g.length;v++){var E=g[v],b=E.options.transform,T=t[E.workCode];T?T.equals(b)||(T.copy(b),y[E.workCode]=!0):(t[E.workCode]=new THREE__namespace.Matrix4().copy(b),y[E.workCode]=!0)}for(var _=0,x=e;_<x.length;_++){var R=x[_];if(y[R.work.workCode]===!0){var w=R.work.observers[R.index],S=R.work.options.transform;R.position.copy(w.position).applyMatrix4(S),R.standingPosition.copy(w.standingPosition).applyMatrix4(S),R.quaternion.setFromRotationMatrix(scratchMatrix4$1.makeRotationFromQuaternion(w.quaternion).premultiply(S))}}}}))}var fetcherMap=new Map;function getFetcher(n){var t=fetcherMap.get(n);if(t)return t;throw new Error("fetcher never registered.")}function registerFetcher(n,t){return fetcherMap.set(n,t)}var BufferGeometryUtils={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,o=e.normal.array,s=e.uv.array,u=i.length/3;e.tangent===void 0&&n.setAttribute("tangent",new THREE__namespace.BufferAttribute(new Float32Array(4*u),4));for(var l=e.tangent.array,c=[],d=[],f=0;f<u;f++)c[f]=new THREE__namespace.Vector3,d[f]=new THREE__namespace.Vector3;var m=new THREE__namespace.Vector3,A=new THREE__namespace.Vector3,h=new THREE__namespace.Vector3,p=new THREE__namespace.Vector2,y=new THREE__namespace.Vector2,v=new THREE__namespace.Vector2,g=new THREE__namespace.Vector3,E=new THREE__namespace.Vector3;function b(N,U,Q){m.fromArray(i,N*3),A.fromArray(i,U*3),h.fromArray(i,Q*3),p.fromArray(s,N*2),y.fromArray(s,U*2),v.fromArray(s,Q*2);var G=A.x-m.x,q=h.x-m.x,j=A.y-m.y,X=h.y-m.y,ae=A.z-m.z,W=h.z-m.z,te=y.x-p.x,ee=v.x-p.x,ie=y.y-p.y,$=v.y-p.y,se=1/(te*$-ee*ie);g.set(($*G-ie*q)*se,($*j-ie*X)*se,($*ae-ie*W)*se),E.set((te*q-ee*G)*se,(te*X-ee*j)*se,(te*W-ee*ae)*se),c[N].add(g),c[U].add(g),c[Q].add(g),d[N].add(E),d[U].add(E),d[Q].add(E)}var T=n.groups;T.length===0&&(T=[{start:0,count:r.length}]);for(var f=0,_=T.length;f<_;++f)for(var x=T[f],R=x.start,w=x.count,S=R,C=R+w;S<C;S+=3)b(r[S+0],r[S+1],r[S+2]);var I=new THREE__namespace.Vector3,H=new THREE__namespace.Vector3,B=new THREE__namespace.Vector3,L=new THREE__namespace.Vector3,O,k,K;function z(N){B.fromArray(o,N*3),L.copy(B),k=c[N],I.copy(k),I.sub(B.multiplyScalar(B.dot(k))).normalize(),H.crossVectors(L,k),K=H.dot(d[N]),O=K<0?-1:1,l[N*4]=I.x,l[N*4+1]=I.y,l[N*4+2]=I.z,l[N*4+3]=O}for(var f=0,_=T.length;f<_;++f)for(var x=T[f],R=x.start,w=x.count,S=R,C=R+w;S<C;S+=3)z(r[S+0]),z(r[S+1]),z(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)),o={},s={},u=new THREE__namespace.BufferGeometry,l=0,c=0;c<n.length;++c){var d=n[c];if(e!==(d.index!==null))return null;for(var f in d.attributes){if(!r.has(f))return null;o[f]===void 0&&(o[f]=[]),o[f].push(d.attributes[f])}for(var f in d.morphAttributes){if(!i.has(f))return null;s[f]===void 0&&(s[f]=[]),s[f].push(d.morphAttributes[f])}if(u.userData.mergedUserData=u.userData.mergedUserData||[],u.userData.mergedUserData.push(d.userData),t){var m;if(e)m=d.index.count;else if(d.attributes.position!==void 0)m=d.attributes.position.count;else return null;u.addGroup(l,m,c),l+=m}}if(e){for(var A=0,h=[],c=0;c<n.length;++c){for(var p=n[c].index,y=0;y<p.count;++y)h.push(p.getX(y)+A);A+=n[c].attributes.position.count}u.setIndex(h)}for(var f in o){var v=this.mergeBufferAttributes(o[f]);if(!v)return null;u.setAttribute(f,v)}for(var f in s){var g=s[f][0].length;if(g===0)break;u.morphAttributes=u.morphAttributes||{},u.morphAttributes[f]=[];for(var c=0;c<g;++c){for(var E=[],y=0;y<s[f].length;++y)E.push(s[f][y][c]);var b=this.mergeBufferAttributes(E);if(!b)return null;u.morphAttributes[f].push(b)}}return u},mergeBufferAttributes:function(n){for(var t,e,r,i=0,o=0;o<n.length;++o){var s=n[o];if(s.isInterleavedBufferAttribute||(t===void 0&&(t=s.array.constructor),t!==s.array.constructor)||(e===void 0&&(e=s.itemSize),e!==s.itemSize)||(r===void 0&&(r=s.normalized),r!==s.normalized))return null;i+=s.array.length}for(var u=new t(i),l=0,o=0;o<n.length;++o)u.set(n[o].array,l),l+=n[o].array.length;return new THREE__namespace.BufferAttribute(u,e,r)},interleaveAttributes:function(n){for(var t,e=0,r=0,i=0,o=n.length;i<o;++i){var s=n[i];if(t===void 0&&(t=s.array.constructor),t!==s.array.constructor)return console.warn("AttributeBuffers of different types cannot be interleaved"),null;e+=s.array.length,r+=s.itemSize}for(var u=new THREE__namespace.InterleavedBuffer(new t(e),r),l=0,c=[],d=["getX","getY","getZ","getW"],f=["setX","setY","setZ","setW"],m=0,o=n.length;m<o;m++){var s=n[m],A=s.itemSize,h=s.count,p=new THREE__namespace.InterleavedBufferAttribute(u,A,l,s.normalized);c.push(p),l+=A;for(var y=0;y<h;y++)for(var v=0;v<A;v++)p[f[v]](y,s[d[v]](y))}return c},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"),o=r?r.count:i.count,s=0,u=Object.keys(n.attributes),l={},c={},d=[],f=["getX","getY","getZ","getW"],m=0,A=u.length;m<A;m++){var h=u[m];l[h]=[];var p=n.morphAttributes[h];p&&(c[h]=new Array(p.length).fill().map(function(){return[]}))}for(var y=Math.log10(1/t),v=Math.pow(10,y),m=0;m<o;m++){for(var g=r?r.getX(m):m,E="",b=0,A=u.length;b<A;b++)for(var h=u[b],T=n.getAttribute(h),_=T.itemSize,x=0;x<_;x++)E+="".concat(~~(T[f[x]](g)*v),",");if(E in e)d.push(e[E]);else{for(var b=0,A=u.length;b<A;b++)for(var h=u[b],T=n.getAttribute(h),p=n.morphAttributes[h],_=T.itemSize,R=l[h],w=c[h],x=0;x<_;x++){var S=f[x];if(R.push(T[S](g)),p)for(var C=0,I=p.length;C<I;C++)w[C].push(p[C][S](g))}e[E]=s,d.push(s),s++}}for(var H=n.clone(),m=0,A=u.length;m<A;m++){var h=u[m],B=n.getAttribute(h),L=new B.array.constructor(l[h]),T=new THREE__namespace.BufferAttribute(L,B.itemSize,B.normalized);if(H.setAttribute(h,T),h in c)for(var b=0;b<c[h].length;b++){var O=n.morphAttributes[h][b],L=new O.array.constructor(c[h][b]),k=new THREE__namespace.BufferAttribute(L,O.itemSize,O.normalized);H.morphAttributes[h][b]=k}}return H.setIndex(d),H}};function isThirdPersonMode(n){switch(n){case"Floorplan":return!0;case"Mapview":return!0;default:return!1}}function isFristPersonMode(n){switch(n){case"Panorama":return!0;case"VRPanorama":return!0;case"XRPanorama":return!0;case"Model":return!0;default:return!1}}var scratchVector3=new THREE__namespace.Vector3,scratchSphere=new THREE__namespace.Sphere,scratchMatrix4=new THREE__namespace.Matrix4,scratchMatrix4Inverse=new THREE__namespace.Matrix4,scratchBoundingBox=new THREE__namespace.Box3,ROTATE_X_90_MATRIX=new THREE__namespace.Matrix4().fromArray([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),ROTATE_X_90_MATRIX_INVERSE=new THREE__namespace.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]),DEFAULT_BOUNDING=new THREE__namespace.Box3(new THREE__namespace.Vector3(-.5,-.5,-.5),new THREE__namespace.Vector3(.5,.5,.5));function getEcefToEnuMatrixFromUpAxis(n,t,e){switch(n){case"Z":break;case"Y":e.copy(ROTATE_X_90_MATRIX_INVERSE);break;case"-Y":e.copy(ROTATE_X_90_MATRIX);break;case"WGS84":case"GCJ02":case"BD09":getEcefToEnuMatrix(t,e);break;default:e.identity();break}return e}function getExt(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 ModelViewLayer=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(){scratchVector3.setScalar(0);var t=this.scene.localToLla(scratchVector3),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 THREE__namespace.Matrix4),t.copy(this.scene.coordinateTransform.ecefToLocalMatrix),this.scene&&t.premultiply(this.scene.matrixWorld),t},n.prototype.coordinatesToWorldPoint=function(t){var e=new THREE__namespace.Vector3(t.latitude,t.longitude,t.altitude);return this.scene.llaToWorld(e)},n.prototype.worldPointToCoordinates=function(t){return scratchVector3.copy(t),this.scene.worldToLla(scratchVector3),{latitude:scratchVector3.x,longitude:scratchVector3.y,altitude:scratchVector3.z}},n}(),Model=function(n){__extends(t,n);function t(e){e===void 0&&(e={});var r,i,o,s=n.call(this)||this;return s.name="",s.onError=(r=e.onError)!==null&&r!==void 0?r:noop$1,s.onShownFloorChange=(i=e.onShownFloorChange)!==null&&i!==void 0?i:noop$1,s.onLoad=(o=e.onLoad)!==null&&o!==void 0?o:noop$1,s.work=null,s.viewLayers=[],s.bounding=new THREE__namespace.Box3(new THREE__namespace.Vector3,new THREE__namespace.Vector3),s.floorLength=0,s.textureOptions={},s.refined=!1,s.refineProgress=[0,0],s.loaded=!1,s.matrixAutoUpdate=!1,s.needsRender=!0,s.autoRefine=!0,s.materialVersion=0,s.materialParameters=__assign({},defaultPbmParameters),s.cacheCameras=[],s.disposed=!1,s}return Object.defineProperty(t.prototype,"empty",{get:function(){return this.viewLayers.length===0},enumerable:!1,configurable:!0}),t.prototype.getMaterial=function(){return __assign({},this.materialParameters)},t.prototype.setMaterial=function(e){var r=this.materialParameters.shownFloorIndex,i=updatePBMParameters(this.materialParameters,e);if(i){var o=this.materialParameters.shownFloorIndex;r!==o&&this.onShownFloorChange(o),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),o=[],s=0,u=this.children;s<u.length;s++){var l=u[s];l instanceof Tile3DModel&&l.tileset.selectedTiles.forEach(function(c){var d,f,m;if(!(c.boundingVolume&&c.boundingVolume.distanceToPoint(e.center)>e.radius)){var A=(f=(d=c.content)===null||d===void 0?void 0:d.data)===null||f===void 0?void 0:f.object;if(A&&A.visible){var h=[];if(A.traverseVisible(function(Q){if(Q instanceof THREE__namespace.Mesh){var G=bvhMeshMap.get(Q);if(G){scratchMatrix4.copy(Q.matrixWorld),scratchMatrix4Inverse.getInverse(scratchMatrix4),scratchSphere.copy(e).applyMatrix4(scratchMatrix4Inverse);var q=G.trianglesInSphere(scratchSphere.center,scratchSphere.radius),j=new THREE__namespace.BufferGeometry;j.setAttribute("position",new THREE__namespace.BufferAttribute(q,3)),j.applyMatrix4(Q.matrixWorld),j=BufferGeometryUtils.mergeVertices(j,.01),h.push(j)}}}),h.length===0)return;for(var p=["a","b","c"],y=BufferGeometryUtils.mergeBufferGeometries(h,!1),v=y.getAttribute("position").array,g=((m=y.getIndex())===null||m===void 0?void 0:m.array)||[],E=[],b=[],T=0,_=v.length;T<_;T+=3){var x=new THREE__namespace.Vector3(v[T],v[T+1],v[T+2]);E.push(x)}for(var T=0,_=g.length;T<_;T+=3){var R=g[T],w=g[T+1],S=g[T+2],C=new THREE__namespace.Vector3().crossVectors(E[w].clone().sub(E[R]),E[S].clone().sub(E[R])).normalize();b.push({a:R,b:w,c:S,normal:C})}for(var I={},T=0,_=b.length;T<_;T++)for(var H=b[T],B=0;B<3;B++){var L=H[p[B]],O=H[p[(B+1)%3]],k=[Math.min(L,O),Math.max(L,O)],K=k[0]+"-"+k[1];I[K]===void 0?I[K]={index1:k[0],index2:k[1],face1:T}:I[K].face2=T}for(var K in I){var z=I[K];if(z.face2===void 0||b[z.face1].normal.dot(b[z.face2].normal)<=i){var N=E[z.index1],U=E[z.index2];o.push(new THREE__namespace.Line3(N,U))}}E.length=0,b.length=0}}})}return o},t.prototype.intersectRaycaster=function(e,r,i){r===void 0&&(r=null),i===void 0&&(i=!0);for(var o=[],s=0,u=this.children.length;s<u;s++){var l=this.children[s];l.visible&&l instanceof Tile3DModel&&l.intersectRaycaster(e,!1,o)}return r!=null&&(o=o.filter(function(c){return c.floor===r})),this.getMaterial().pointBack==="HIDDEN"&&(o=o.filter(function(c){return!(c.object instanceof PBMPointCloud&&c.face&&c.face.normal.angleTo(e.ray.direction)<Math.PI/2)})),i&&o.sort(function(c,d){return c.distance-d.distance}),o},t.prototype.load=function(e,r){var i,o=this,s,u,l,c;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,m=0,A=e.observers;m<A.length;m++){var h=A[m];f=Math.max(f,h.floorIndex)}this.floorLength=f+1;for(var p=!1,y=[],v=function(z){var N=z.tileset,U=z.upAxis,Q=z.name,G=z.type;G==="mesh"&&(p=!0);var q=N.split("#"),j=q[0],X=q[1],ae=(s=(X||j).split("?")[1])!==null&&s!==void 0?s:"",W=getFetcher(e).ajax(N,{responseType:"text"}).then(function(te){var ee,ie,$,se=N?N.slice(0,N.lastIndexOf("/")+1):"",re=normalizeTilesetHeader(JSON.parse(te.body),se),oe=re.root,pe=re.rootMeta,he=pe===void 0?{}:pe;he.upAxis&&he.upAxis!==U&&(U=he.upAxis),"lodVersion"in re&&(U="-Y","floorInfo"in re&&(re.properties=re.properties||{},re.properties.floorInfo=re.floorInfo.map(function(ce){return{ground:-ce.ground,height:ce.height}}),delete re.floorInfo),re.asset.tilesetVersion=String(re.lodVersion),delete re.lodVersion);var Ae=oe.boundingVolume?makeBoundingVolume(oe.boundingVolume):void 0;Ae&&oe.transform&&Ae.applyMatrix4(scratchMatrix4.fromArray(oe.transform));var Z=null,Y=new THREE__namespace.Matrix4,V=new THREE__namespace.Matrix4;he.coordinate?(Z=he.coordinate.ground_height,Y.fromArray(he.coordinate.pose_ecef_to_enu),V.fromArray(he.coordinate.pose_enu_to_ecef)):(Ae?Ae.getCenter(scratchVector3):scratchVector3.setScalar(0),getEcefToEnuMatrixFromUpAxis(U,scratchVector3,Y),V.getInverse(Y));var Ee=new THREE__namespace.Matrix4().copy(ROTATE_X_90_MATRIX),ge=new THREE__namespace.Matrix4().copy(ROTATE_X_90_MATRIX_INVERSE),me=new THREE__namespace.Matrix4().premultiply(Y).premultiply(Ee),Re=new THREE__namespace.Matrix4().getInverse(me);re.root={refine:(ee=oe.refine)!==null&&ee!==void 0?ee:"REPLACE",geometricError:oe.geometricError,transform:me.toArray(),boundingVolume:Ae?Ae.toJson():void 0,viewerRequestVolume:!((ie=r["3d-tiles"])===null||ie===void 0)&&ie.viewerRequestVolume?($=r["3d-tiles"])===null||$===void 0?void 0:$.viewerRequestVolume.toJson():void 0,children:[oe]};var fe=new Tile3DModel(o,re,{name:Q,type:G,upAxis:U,url:N,referer:N,search:ae,fetcher:getFetcher(e),groundHeight:Z,coordinateTransform:{localToEnuMatrix:ge,enuToLocalMatrix:Ee,enuToEcefMatrix:V,ecefToEnuMatrix:Y,localToEcefMatrix:Re,ecefToLocalMatrix:me}});if(fe.matrix.copy(e.transform),fe.matrix.decompose(fe.position,fe.quaternion,fe.scale),fe.matrixWorldNeedsUpdate=!0,r["3d-tiles"]){var de=r["3d-tiles"];typeof de.debug!="undefined"&&(fe.debug=de.debug),typeof de.minLevelOfDetail!="undefined"&&(fe.minLevelOfDetail=de.minLevelOfDetail),typeof de.maxLevelOfDetail!="undefined"&&(fe.maxLevelOfDetail=de.maxLevelOfDetail),typeof de.skipLevelOfDetail!="undefined"&&(fe.skipLevelOfDetail=de.skipLevelOfDetail),typeof de.loadSiblings!="undefined"&&(fe.loadSiblings=de.loadSiblings),typeof de.maxMemoryUsage!="undefined"&&(fe.maxMemoryUsage=de.maxMemoryUsage),typeof de.maxRequests!="undefined"&&(fe.maxRequests=de.maxRequests),typeof de.maxScreenSpaceError!="undefined"&&(fe.maxScreenSpaceError=de.maxScreenSpaceError)}return new ModelViewLayer(fe,null)});y.push(W.catch(function(te){o.onError(te);var ee=new THREE__namespace.Matrix4,ie=new THREE__namespace.Matrix4,$=new THREE__namespace.Matrix4().copy(ROTATE_X_90_MATRIX),se=new THREE__namespace.Matrix4().copy(ROTATE_X_90_MATRIX_INVERSE),re=new THREE__namespace.Matrix4().premultiply(ee).premultiply($),oe=new THREE__namespace.Matrix4().getInverse(re),pe=N?N.slice(0,N.lastIndexOf("/")+1):"",he=normalizeTilesetHeader({asset:{version:"0.0"},geometricError:0,root:{geometricError:0}},pe),Ae=new Tile3DModel(o,he,{name:Q,type:G,upAxis:U,url:N,referer:N,search:ae,fetcher:getFetcher(e),groundHeight:null,coordinateTransform:{localToEnuMatrix:se,enuToLocalMatrix:$,enuToEcefMatrix:ie,ecefToEnuMatrix:ee,localToEcefMatrix:oe,ecefToLocalMatrix:re},onError:o.onError});return new ModelViewLayer(Ae,te)}))},g=0,E=d.layers;g<E.length;g++){var b=E[g];v(b)}if(!p&&d.file){var T=d.file,_=d.textureBase,x=d.textures,R=getExt(T)||"at3d",w=R==="at3d"||R==="pbm"?"Z":"Y",S=new THREE__namespace.Matrix4,C=new THREE__namespace.Matrix4,I=new THREE__namespace.Matrix4().copy(ROTATE_X_90_MATRIX),H=new THREE__namespace.Matrix4().copy(ROTATE_X_90_MATRIX_INVERSE);getEcefToEnuMatrixFromUpAxis(w,scratchVector3.setScalar(0),S),C.getInverse(S);var B=new THREE__namespace.Matrix4().premultiply(S).premultiply(I),L=new THREE__namespace.Matrix4().getInverse(B),O=normalizeTilesetHeader({asset:{gltfUpAxis:"Z",version:"0.0"},geometricError:0,root:{refine:"REPLACE",geometricError:0,transform:B.toArray(),viewerRequestVolume:!((u=r["3d-tiles"])===null||u===void 0)&&u.viewerRequestVolume?(l=r["3d-tiles"])===null||l===void 0?void 0:l.viewerRequestVolume.toJson():void 0,content:{uri:T},extras:(i={},i[R]={textureBaseUri:_,textureArray:x,textureOptions:(c=r.textureOptions)!==null&&c!==void 0?c:{}},i)}},""),k=new Tile3DModel(this,O,{name:"fallback",type:"mesh",upAxis:w,url:"",referer:T,fetcher:getFetcher(e),groundHeight:null,coordinateTransform:{localToEnuMatrix:H,enuToLocalMatrix:I,enuToEcefMatrix:C,ecefToEnuMatrix:S,localToEcefMatrix:L,ecefToLocalMatrix:B},onError:this.onError});k.matrix.copy(e.transform),k.matrix.decompose(k.position,k.quaternion,k.scale),k.matrixWorldNeedsUpdate=!0;var K=new ModelViewLayer(k,null);y.push(Promise.resolve(K))}return Promise.all(y).then(function(z){for(var N,U=[],Q=[],G=[],q=0,j=z;q<j.length;q++){var X=j[q];if(o.viewLayers.push(X),o.disposed){X.scene.dispose();continue}switch(o.add(X.scene),X.scene.visible=!1,X.scene.type){case"mesh":U.push(X.scene);break;case"point_cloud":Q.push(X.scene);break;default:G.push(X.scene);break}}U.length?U[0].visible=!0:Q.length?Q[0].visible=!0:G.length&&(G[0].visible=!0);var ae=(N=r["3d-tiles"])===null||N===void 0?void 0:N.showLayers;if(typeof ae=="boolean")for(var W=0,te=z;W<te.length;W++){var X=te[W];X.scene&&(X.scene.visible=ae)}else if(Array.isArray(ae))for(var ee=0,ie=z;ee<ie.length;ee++){var X=ie[ee];X.scene&&(X.scene.visible=ae.indexOf(X.scene.name)!==-1)}})},t.prototype.update=function(e,r,i){if(this.children.length){var o=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 s=0,u=this.viewLayers;s<u.length;s++){var l=u[s],c=l.scene;c&&(this.work&&(c.idle=this.materialParameters.modelAlpha===0||!c.loaded,c.cacheCameras=this.cacheCameras,this.autoRefine===!1?c.needsRefined=!1:isFristPersonMode(i)?c.needsRefined=this.materialParameters.modelAlpha===0||this.materialParameters.modelAlpha===1:c.needsRefined=!0,this.work.transform.equals(c.matrix)||(c.matrix.copy(this.work.transform),c.matrix.decompose(c.position,c.quaternion,c.scale),c.matrixWorldNeedsUpdate=!0)),c.update(e,r),c.boundingBox.isEmpty()||(scratchBoundingBox.copy(c.boundingBox).applyMatrix4(c.matrix),this.bounding.union(scratchBoundingBox)),c.needsRender===!0&&(c.needsRender=!1,this.needsRender=!0),c.refined===!1&&(this.refined=!1),this.refineProgress[0]+=c.refineProgress[0],this.refineProgress[1]+=c.refineProgress[1],c.loaded===!1&&(this.loaded=!1))}this.bounding.isEmpty()&&this.bounding.copy(DEFAULT_BOUNDING),o===!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 THREE__namespace.Vector3,new THREE__namespace.Vector3)},t.prototype.dispose=function(){this.disposed=!0;for(var e;e=this.children[0];)e instanceof Tile3DModel&&e.dispose(),this.remove(e)},t}(THREE__namespace.Object3D);function createModels(){var n=new THREE__namespace.Box3,t=omit(defaultPbmParameters,["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,o){o===void 0&&(o=!0);var s;if(e.length===1)s=e[0].intersectRaycaster(r,i,o);else if(e.length===0)s=[];else{s=[];for(var u=0,l=e;u<l.length;u++){var c=l[u];if(c.visible){var d=c.intersectRaycaster(r,i,!1);d.length&&s.push.apply(s,d)}}o&&s.sort(function(f,m){return f.distance-m.distance})}return s},setMaterial:function(r){var i=updatePBMParameters(t,r);i&&(e.materialVersion++,e.needsRender=!0)},getMaterial:function(){return __assign({},t)},resetBrightness:function(){for(var r=0,i=e;r<i.length;r++){var o=i[r];o.setMaterial({brightness:1})}},update:function(r,i,o){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 s=0,u=e.cacheCameras;s<u.length;s++){var l=u[s];l.updateMatrixWorld(!0),l.updateProjectionMatrix()}for(var c=0,d=0,f=e;d<f.length;d++){for(var m=f[d],A=0,h=m.viewLayers;A<h.length;A++){var p=h[A];p.scene.modelIndex=c++}m.setMaterial(t),m.cacheCameras=e.cacheCameras,m.update(r,i,o),m.needsRender===!0&&(e.needsRender=!0,m.needsRender=!1),m.refined===!1&&(e.refined=!1),e.refineProgress[0]+=m.refineProgress[0],e.refineProgress[1]+=m.refineProgress[1],m.loaded===!1&&(e.loaded=!1),n.union(m.bounding)}n.isEmpty()&&n.copy(DEFAULT_BOUNDING)}}});return e}function mixNumber(n,t,e){return n+(t-n)*e}function value(n,t,e,r){var i=(t*e+2*n)/Math.pow(e,3),o=-(2*t*e+3*n)/Math.pow(e,2),s=t,u=n;return i*Math.pow(r,3)+o*Math.pow(r,2)+s*r+u}function velocity(n,t,e,r){var i=(t*e+2*n)/Math.pow(e,3),o=-(2*t*e+3*n)/Math.pow(e,2),s=t;return 3*i*Math.pow(r,2)+2*o*r+s}function mixCircle(n,t,e,r){var i=r[1]-r[0];return n=circleValue(n,r),t=circleValue(t,r),t-n>i/2?mixNumber(n+i,t,e):n-t>i/2?mixNumber(n-i,t,e):mixNumber(n,t,e)}function circleValue(n,t){var e=t[1]-t[0];return n<t[0]?circleValue(n+e,t):n>=t[1]?circleValue(n-e,t):n}function mixValue(n,t,e,r){return r?mixCircle(n,t,e,r):mixNumber(n,t,e)}var Motion=function(){function n(t){this.config={},this.progress=1,this.ended=!0,this.value={},this.startTime=now(),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:__assign({},this.value)},{progress:1,value:__assign({},this.value)}]}return n.prototype.getProgress=function(t){var e=t-this.startTime;return e<0?0:e>=this.duration?1:1-value(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],o={};for(var s in this.config){var u=(t-r.progress)/(i.progress-r.progress);o[s]=mixValue(r.value[s],i.value[s],u,this.config[s].circle)}return o}return __assign({},this.keyframes[this.keyframes.length-1].value)},n.prototype.getProgressVelocity=function(t){var e=t-this.startTime;return e>=this.duration?0:velocity(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 o;r===void 0&&(r=0),isNaN(e)&&(e=0),isNaN(r)&&(r=0),i=i!=null?i:now();var s=this.getProgress(i),u=this.getValue(s),l={};for(var c in this.config)l[c]=(o=t[c])!==null&&o!==void 0?o:u[c];var d=[{progress:0,value:u},{progress:1,value:l}];return this.setKeyframes(d,e,r,i)},n.prototype.setKeyframes=function(t,e,r,i){var o=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(s,u){i=i!=null?i:now(),o.progress=0,o.ended=!1,o.startTime=i,o.startVelocity=r,o.keyframes=t,o.duration=e,e===0?(o.progress=1,o.value=__assign({},t[t.length-1].value)):o.value=__assign({},t[0].value),o.callbacks=[s,u]})},n.prototype.dispose=function(){this.callbacks&&(this.callbacks[1](new Error("motion dispose.")),this.callbacks=void 0)},n}(),easeOut$2=function(n){return n*(2-n)},sharedGeometry2$2=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 THREE__namespace.BufferGeometry;return r.setAttribute("position",new THREE__namespace.BufferAttribute(n,3)),r.setAttribute("uv",new THREE__namespace.BufferAttribute(t,2)),r.setIndex(new THREE__namespace.BufferAttribute(e,1)),r}(),vertexShader$4=`
932
+ `+JSON.stringify(n))}}function createWorks(n){for(var t={},e=[],r={},i=0,o=n;i<o.length;i++){var s=o[i],u=t[s.workCode];u||(u=t[s.workCode]=new THREE__namespace.Matrix4().copy(s.options.transform));for(var c=0,l=s.observers;c<l.length;c++){var d=l[c],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 THREE__namespace.Vector3().copy(d.position).applyMatrix4(u),standingPosition:new THREE__namespace.Vector3().copy(d.standingPosition).applyMatrix4(u),quaternion:new THREE__namespace.Quaternion().setFromRotationMatrix(scratchMatrix4$1.makeRotationFromQuaternion(d.quaternion).premultiply(u))};Object.freeze(f),e.push(f),r[f.panoId]=f}}Object.freeze(e);for(var v=n.slice(),A={},h=0,p=v;h<p.length;h++){var s=p[h];A[s.workCode]=s}return Object.freeze(Object.assign(v,{get initial(){return v.length>0?v[0].initial:{work:{}}},get resolvedObservers(){return e},getWork:function(y){return A[y]},getResolvedObserver:function(y){var m,g;return isPanoId(y)?r[y]:typeof y=="number"?r[panoStringify({workCode:(g=(m=n[0])===null||m===void 0?void 0:m.workCode)!==null&&g!==void 0?g:"",panoIndex:y})]:r[panoStringify(y)]},update:function(){for(var y={},m=0,g=v;m<g.length;m++){var E=g[m],b=E.options.transform,T=t[E.workCode];T?T.equals(b)||(T.copy(b),y[E.workCode]=!0):(t[E.workCode]=new THREE__namespace.Matrix4().copy(b),y[E.workCode]=!0)}for(var _=0,S=e;_<S.length;_++){var R=S[_];if(y[R.work.workCode]===!0){var B=R.work.observers[R.index],I=R.work.options.transform;R.position.copy(B.position).applyMatrix4(I),R.standingPosition.copy(B.standingPosition).applyMatrix4(I),R.quaternion.setFromRotationMatrix(scratchMatrix4$1.makeRotationFromQuaternion(B.quaternion).premultiply(I))}}}}))}var fetcherMap=new Map;function getFetcher(n){var t=fetcherMap.get(n);if(t)return t;throw new Error("fetcher never registered.")}function registerFetcher(n,t){return fetcherMap.set(n,t)}var BufferGeometryUtils={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,o=e.normal.array,s=e.uv.array,u=i.length/3;e.tangent===void 0&&n.setAttribute("tangent",new THREE__namespace.BufferAttribute(new Float32Array(4*u),4));for(var c=e.tangent.array,l=[],d=[],f=0;f<u;f++)l[f]=new THREE__namespace.Vector3,d[f]=new THREE__namespace.Vector3;var v=new THREE__namespace.Vector3,A=new THREE__namespace.Vector3,h=new THREE__namespace.Vector3,p=new THREE__namespace.Vector2,y=new THREE__namespace.Vector2,m=new THREE__namespace.Vector2,g=new THREE__namespace.Vector3,E=new THREE__namespace.Vector3;function b(U,D,q){v.fromArray(i,U*3),A.fromArray(i,D*3),h.fromArray(i,q*3),p.fromArray(s,U*2),y.fromArray(s,D*2),m.fromArray(s,q*2);var z=A.x-v.x,K=h.x-v.x,J=A.y-v.y,j=h.y-v.y,re=A.z-v.z,W=h.z-v.z,te=y.x-p.x,$=m.x-p.x,ne=y.y-p.y,ee=m.y-p.y,ce=1/(te*ee-$*ne);g.set((ee*z-ne*K)*ce,(ee*J-ne*j)*ce,(ee*re-ne*W)*ce),E.set((te*K-$*z)*ce,(te*j-$*J)*ce,(te*W-$*re)*ce),l[U].add(g),l[D].add(g),l[q].add(g),d[U].add(E),d[D].add(E),d[q].add(E)}var T=n.groups;T.length===0&&(T=[{start:0,count:r.length}]);for(var f=0,_=T.length;f<_;++f)for(var S=T[f],R=S.start,B=S.count,I=R,x=R+B;I<x;I+=3)b(r[I+0],r[I+1],r[I+2]);var M=new THREE__namespace.Vector3,L=new THREE__namespace.Vector3,C=new THREE__namespace.Vector3,H=new THREE__namespace.Vector3,F,O,G;function Q(U){C.fromArray(o,U*3),H.copy(C),O=l[U],M.copy(O),M.sub(C.multiplyScalar(C.dot(O))).normalize(),L.crossVectors(H,O),G=L.dot(d[U]),F=G<0?-1:1,c[U*4]=M.x,c[U*4+1]=M.y,c[U*4+2]=M.z,c[U*4+3]=F}for(var f=0,_=T.length;f<_;++f)for(var S=T[f],R=S.start,B=S.count,I=R,x=R+B;I<x;I+=3)Q(r[I+0]),Q(r[I+1]),Q(r[I+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)),o={},s={},u=new THREE__namespace.BufferGeometry,c=0,l=0;l<n.length;++l){var d=n[l];if(e!==(d.index!==null))return null;for(var f in d.attributes){if(!r.has(f))return null;o[f]===void 0&&(o[f]=[]),o[f].push(d.attributes[f])}for(var f in d.morphAttributes){if(!i.has(f))return null;s[f]===void 0&&(s[f]=[]),s[f].push(d.morphAttributes[f])}if(u.userData.mergedUserData=u.userData.mergedUserData||[],u.userData.mergedUserData.push(d.userData),t){var v;if(e)v=d.index.count;else if(d.attributes.position!==void 0)v=d.attributes.position.count;else return null;u.addGroup(c,v,l),c+=v}}if(e){for(var A=0,h=[],l=0;l<n.length;++l){for(var p=n[l].index,y=0;y<p.count;++y)h.push(p.getX(y)+A);A+=n[l].attributes.position.count}u.setIndex(h)}for(var f in o){var m=this.mergeBufferAttributes(o[f]);if(!m)return null;u.setAttribute(f,m)}for(var f in s){var g=s[f][0].length;if(g===0)break;u.morphAttributes=u.morphAttributes||{},u.morphAttributes[f]=[];for(var l=0;l<g;++l){for(var E=[],y=0;y<s[f].length;++y)E.push(s[f][y][l]);var b=this.mergeBufferAttributes(E);if(!b)return null;u.morphAttributes[f].push(b)}}return u},mergeBufferAttributes:function(n){for(var t,e,r,i=0,o=0;o<n.length;++o){var s=n[o];if(s.isInterleavedBufferAttribute||(t===void 0&&(t=s.array.constructor),t!==s.array.constructor)||(e===void 0&&(e=s.itemSize),e!==s.itemSize)||(r===void 0&&(r=s.normalized),r!==s.normalized))return null;i+=s.array.length}for(var u=new t(i),c=0,o=0;o<n.length;++o)u.set(n[o].array,c),c+=n[o].array.length;return new THREE__namespace.BufferAttribute(u,e,r)},interleaveAttributes:function(n){for(var t,e=0,r=0,i=0,o=n.length;i<o;++i){var s=n[i];if(t===void 0&&(t=s.array.constructor),t!==s.array.constructor)return console.warn("AttributeBuffers of different types cannot be interleaved"),null;e+=s.array.length,r+=s.itemSize}for(var u=new THREE__namespace.InterleavedBuffer(new t(e),r),c=0,l=[],d=["getX","getY","getZ","getW"],f=["setX","setY","setZ","setW"],v=0,o=n.length;v<o;v++){var s=n[v],A=s.itemSize,h=s.count,p=new THREE__namespace.InterleavedBufferAttribute(u,A,c,s.normalized);l.push(p),c+=A;for(var y=0;y<h;y++)for(var m=0;m<A;m++)p[f[m]](y,s[d[m]](y))}return l},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"),o=r?r.count:i.count,s=0,u=Object.keys(n.attributes),c={},l={},d=[],f=["getX","getY","getZ","getW"],v=0,A=u.length;v<A;v++){var h=u[v];c[h]=[];var p=n.morphAttributes[h];p&&(l[h]=new Array(p.length).fill().map(function(){return[]}))}for(var y=Math.log10(1/t),m=Math.pow(10,y),v=0;v<o;v++){for(var g=r?r.getX(v):v,E="",b=0,A=u.length;b<A;b++)for(var h=u[b],T=n.getAttribute(h),_=T.itemSize,S=0;S<_;S++)E+="".concat(~~(T[f[S]](g)*m),",");if(E in e)d.push(e[E]);else{for(var b=0,A=u.length;b<A;b++)for(var h=u[b],T=n.getAttribute(h),p=n.morphAttributes[h],_=T.itemSize,R=c[h],B=l[h],S=0;S<_;S++){var I=f[S];if(R.push(T[I](g)),p)for(var x=0,M=p.length;x<M;x++)B[x].push(p[x][I](g))}e[E]=s,d.push(s),s++}}for(var L=n.clone(),v=0,A=u.length;v<A;v++){var h=u[v],C=n.getAttribute(h),H=new C.array.constructor(c[h]),T=new THREE__namespace.BufferAttribute(H,C.itemSize,C.normalized);if(L.setAttribute(h,T),h in l)for(var b=0;b<l[h].length;b++){var F=n.morphAttributes[h][b],H=new F.array.constructor(l[h][b]),O=new THREE__namespace.BufferAttribute(H,F.itemSize,F.normalized);L.morphAttributes[h][b]=O}}return L.setIndex(d),L}};function isThirdPersonMode(n){switch(n){case"Floorplan":return!0;case"Mapview":return!0;default:return!1}}function isFristPersonMode(n){switch(n){case"Panorama":return!0;case"VRPanorama":return!0;case"XRPanorama":return!0;case"Model":return!0;default:return!1}}var scratchVector3=new THREE__namespace.Vector3,scratchSphere=new THREE__namespace.Sphere,scratchMatrix4=new THREE__namespace.Matrix4,scratchMatrix4Inverse=new THREE__namespace.Matrix4,scratchBoundingBox=new THREE__namespace.Box3,ROTATE_X_90_MATRIX=new THREE__namespace.Matrix4().fromArray([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),ROTATE_X_90_MATRIX_INVERSE=new THREE__namespace.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]),DEFAULT_BOUNDING=new THREE__namespace.Box3(new THREE__namespace.Vector3(-.5,-.5,-.5),new THREE__namespace.Vector3(.5,.5,.5));function getEcefToEnuMatrixFromUpAxis(n,t,e){switch(n){case"Z":break;case"Y":e.copy(ROTATE_X_90_MATRIX_INVERSE);break;case"-Y":e.copy(ROTATE_X_90_MATRIX);break;case"WGS84":case"GCJ02":case"BD09":getEcefToEnuMatrix(t,e);break;default:e.identity();break}return e}function getExt(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 ModelViewLayer=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(){scratchVector3.setScalar(0);var t=this.scene.localToLla(scratchVector3),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 THREE__namespace.Matrix4),t.copy(this.scene.coordinateTransform.ecefToLocalMatrix),this.scene&&t.premultiply(this.scene.matrixWorld),t},n.prototype.coordinatesToWorldPoint=function(t){var e=new THREE__namespace.Vector3(t.latitude,t.longitude,t.altitude);return this.scene.llaToWorld(e)},n.prototype.worldPointToCoordinates=function(t){return scratchVector3.copy(t),this.scene.worldToLla(scratchVector3),{latitude:scratchVector3.x,longitude:scratchVector3.y,altitude:scratchVector3.z}},n}(),Model=function(n){__extends(t,n);function t(e){e===void 0&&(e={});var r,i,o,s=n.call(this)||this;return s.name="",s.onError=(r=e.onError)!==null&&r!==void 0?r:noop$1,s.onShownFloorChange=(i=e.onShownFloorChange)!==null&&i!==void 0?i:noop$1,s.onLoad=(o=e.onLoad)!==null&&o!==void 0?o:noop$1,s.work=null,s.viewLayers=[],s.bounding=new THREE__namespace.Box3(new THREE__namespace.Vector3,new THREE__namespace.Vector3),s.floorLength=0,s.textureOptions={},s.refined=!1,s.refineProgress=[0,0],s.loaded=!1,s.matrixAutoUpdate=!1,s.needsRender=!0,s.autoRefine=!0,s.materialVersion=0,s.materialParameters=__assign({},defaultPbmParameters),s.cacheCameras=[],s.disposed=!1,s}return Object.defineProperty(t.prototype,"empty",{get:function(){return this.viewLayers.length===0},enumerable:!1,configurable:!0}),t.prototype.getMaterial=function(){return __assign({},this.materialParameters)},t.prototype.setMaterial=function(e){var r=this.materialParameters.shownFloorIndex,i=updatePBMParameters(this.materialParameters,e);if(i){var o=this.materialParameters.shownFloorIndex;r!==o&&this.onShownFloorChange(o),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),o=[],s=0,u=this.children;s<u.length;s++){var c=u[s];c instanceof Tile3DModel&&c.tileset.selectedTiles.forEach(function(l){var d,f,v;if(!(l.boundingVolume&&l.boundingVolume.distanceToPoint(e.center)>e.radius)){var A=(f=(d=l.content)===null||d===void 0?void 0:d.data)===null||f===void 0?void 0:f.object;if(A&&A.visible){var h=[];if(A.traverseVisible(function(q){if(q instanceof THREE__namespace.Mesh){var z=bvhMeshMap.get(q);if(z){scratchMatrix4.copy(q.matrixWorld),scratchMatrix4Inverse.getInverse(scratchMatrix4),scratchSphere.copy(e).applyMatrix4(scratchMatrix4Inverse);var K=z.trianglesInSphere(scratchSphere.center,scratchSphere.radius),J=new THREE__namespace.BufferGeometry;J.setAttribute("position",new THREE__namespace.BufferAttribute(K,3)),J.applyMatrix4(q.matrixWorld),J=BufferGeometryUtils.mergeVertices(J,.01),h.push(J)}}}),h.length===0)return;for(var p=["a","b","c"],y=BufferGeometryUtils.mergeBufferGeometries(h,!1),m=y.getAttribute("position").array,g=((v=y.getIndex())===null||v===void 0?void 0:v.array)||[],E=[],b=[],T=0,_=m.length;T<_;T+=3){var S=new THREE__namespace.Vector3(m[T],m[T+1],m[T+2]);E.push(S)}for(var T=0,_=g.length;T<_;T+=3){var R=g[T],B=g[T+1],I=g[T+2],x=new THREE__namespace.Vector3().crossVectors(E[B].clone().sub(E[R]),E[I].clone().sub(E[R])).normalize();b.push({a:R,b:B,c:I,normal:x})}for(var M={},T=0,_=b.length;T<_;T++)for(var L=b[T],C=0;C<3;C++){var H=L[p[C]],F=L[p[(C+1)%3]],O=[Math.min(H,F),Math.max(H,F)],G=O[0]+"-"+O[1];M[G]===void 0?M[G]={index1:O[0],index2:O[1],face1:T}:M[G].face2=T}for(var G in M){var Q=M[G];if(Q.face2===void 0||b[Q.face1].normal.dot(b[Q.face2].normal)<=i){var U=E[Q.index1],D=E[Q.index2];o.push(new THREE__namespace.Line3(U,D))}}E.length=0,b.length=0}}})}return o},t.prototype.intersectRaycaster=function(e,r,i){r===void 0&&(r=null),i===void 0&&(i=!0);for(var o=[],s=0,u=this.children.length;s<u;s++){var c=this.children[s];c.visible&&c instanceof Tile3DModel&&c.intersectRaycaster(e,!1,o)}return r!=null&&(o=o.filter(function(l){return l.floor===r})),this.getMaterial().pointBack==="HIDDEN"&&(o=o.filter(function(l){return!(l.object instanceof PBMPointCloud&&l.face&&l.face.normal.angleTo(e.ray.direction)<Math.PI/2)})),i&&o.sort(function(l,d){return l.distance-d.distance}),o},t.prototype.load=function(e,r){var i,o=this,s,u,c,l;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,v=0,A=e.observers;v<A.length;v++){var h=A[v];f=Math.max(f,h.floorIndex)}this.floorLength=f+1;for(var p=!1,y=[],m=function(Q){var U=Q.tileset,D=Q.upAxis,q=Q.name,z=Q.type;z==="mesh"&&(p=!0);var K=U.split("#"),J=K[0],j=K[1],re=(s=(j||J).split("?")[1])!==null&&s!==void 0?s:"",W=getFetcher(e).ajax(U,{responseType:"text"}).then(function(te){var $,ne,ee,ce=U?U.slice(0,U.lastIndexOf("/")+1):"",ae=normalizeTilesetHeader(JSON.parse(te.body),ce),se=ae.root,Ae=ae.rootMeta,he=Ae===void 0?{}:Ae;he.upAxis&&he.upAxis!==D&&(D=he.upAxis),"lodVersion"in ae&&(D="-Y","floorInfo"in ae&&(ae.properties=ae.properties||{},ae.properties.floorInfo=ae.floorInfo.map(function(le){return{ground:-le.ground,height:le.height}}),delete ae.floorInfo),ae.asset.tilesetVersion=String(ae.lodVersion),delete ae.lodVersion);var me=se.boundingVolume?makeBoundingVolume(se.boundingVolume):void 0;me&&se.transform&&me.applyMatrix4(scratchMatrix4.fromArray(se.transform));var Z=null,Y=new THREE__namespace.Matrix4,N=new THREE__namespace.Matrix4;he.coordinate?(Z=he.coordinate.ground_height,Y.fromArray(he.coordinate.pose_ecef_to_enu),N.fromArray(he.coordinate.pose_enu_to_ecef)):(me?me.getCenter(scratchVector3):scratchVector3.setScalar(0),getEcefToEnuMatrixFromUpAxis(D,scratchVector3,Y),N.getInverse(Y));var Ee=new THREE__namespace.Matrix4().copy(ROTATE_X_90_MATRIX),ge=new THREE__namespace.Matrix4().copy(ROTATE_X_90_MATRIX_INVERSE),ve=new THREE__namespace.Matrix4().premultiply(Y).premultiply(Ee),xe=new THREE__namespace.Matrix4().getInverse(ve);ae.root={refine:($=se.refine)!==null&&$!==void 0?$:"REPLACE",geometricError:se.geometricError,transform:ve.toArray(),boundingVolume:me?me.toJson():void 0,viewerRequestVolume:!((ne=r["3d-tiles"])===null||ne===void 0)&&ne.viewerRequestVolume?(ee=r["3d-tiles"])===null||ee===void 0?void 0:ee.viewerRequestVolume.toJson():void 0,children:[se]};var fe=new Tile3DModel(o,ae,{name:q,type:z,upAxis:D,url:U,referer:U,search:re,fetcher:getFetcher(e),groundHeight:Z,coordinateTransform:{localToEnuMatrix:ge,enuToLocalMatrix:Ee,enuToEcefMatrix:N,ecefToEnuMatrix:Y,localToEcefMatrix:xe,ecefToLocalMatrix:ve}});if(fe.matrix.copy(e.transform),fe.matrix.decompose(fe.position,fe.quaternion,fe.scale),fe.matrixWorldNeedsUpdate=!0,r["3d-tiles"]){var de=r["3d-tiles"];typeof de.debug!="undefined"&&(fe.debug=de.debug),typeof de.minLevelOfDetail!="undefined"&&(fe.minLevelOfDetail=de.minLevelOfDetail),typeof de.maxLevelOfDetail!="undefined"&&(fe.maxLevelOfDetail=de.maxLevelOfDetail),typeof de.skipLevelOfDetail!="undefined"&&(fe.skipLevelOfDetail=de.skipLevelOfDetail),typeof de.loadSiblings!="undefined"&&(fe.loadSiblings=de.loadSiblings),typeof de.maxMemoryUsage!="undefined"&&(fe.maxMemoryUsage=de.maxMemoryUsage),typeof de.maxRequests!="undefined"&&(fe.maxRequests=de.maxRequests),typeof de.maxScreenSpaceError!="undefined"&&(fe.maxScreenSpaceError=de.maxScreenSpaceError)}return new ModelViewLayer(fe,null)});y.push(W.catch(function(te){o.onError(te);var $=new THREE__namespace.Matrix4,ne=new THREE__namespace.Matrix4,ee=new THREE__namespace.Matrix4().copy(ROTATE_X_90_MATRIX),ce=new THREE__namespace.Matrix4().copy(ROTATE_X_90_MATRIX_INVERSE),ae=new THREE__namespace.Matrix4().premultiply($).premultiply(ee),se=new THREE__namespace.Matrix4().getInverse(ae),Ae=U?U.slice(0,U.lastIndexOf("/")+1):"",he=normalizeTilesetHeader({asset:{version:"0.0"},geometricError:0,root:{geometricError:0}},Ae),me=new Tile3DModel(o,he,{name:q,type:z,upAxis:D,url:U,referer:U,search:re,fetcher:getFetcher(e),groundHeight:null,coordinateTransform:{localToEnuMatrix:ce,enuToLocalMatrix:ee,enuToEcefMatrix:ne,ecefToEnuMatrix:$,localToEcefMatrix:se,ecefToLocalMatrix:ae},onError:o.onError});return new ModelViewLayer(me,te)}))},g=0,E=d.layers;g<E.length;g++){var b=E[g];m(b)}if(!p&&d.file){var T=d.file,_=d.textureBase,S=d.textures,R=getExt(T)||"at3d",B=R==="at3d"||R==="pbm"?"Z":"Y",I=new THREE__namespace.Matrix4,x=new THREE__namespace.Matrix4,M=new THREE__namespace.Matrix4().copy(ROTATE_X_90_MATRIX),L=new THREE__namespace.Matrix4().copy(ROTATE_X_90_MATRIX_INVERSE);getEcefToEnuMatrixFromUpAxis(B,scratchVector3.setScalar(0),I),x.getInverse(I);var C=new THREE__namespace.Matrix4().premultiply(I).premultiply(M),H=new THREE__namespace.Matrix4().getInverse(C),F=normalizeTilesetHeader({asset:{gltfUpAxis:"Z",version:"0.0"},geometricError:0,root:{refine:"REPLACE",geometricError:0,transform:C.toArray(),viewerRequestVolume:!((u=r["3d-tiles"])===null||u===void 0)&&u.viewerRequestVolume?(c=r["3d-tiles"])===null||c===void 0?void 0:c.viewerRequestVolume.toJson():void 0,content:{uri:T},extras:(i={},i[R]={textureBaseUri:_,textureArray:S,textureOptions:(l=r.textureOptions)!==null&&l!==void 0?l:{}},i)}},""),O=new Tile3DModel(this,F,{name:"fallback",type:"mesh",upAxis:B,url:"",referer:T,fetcher:getFetcher(e),groundHeight:null,coordinateTransform:{localToEnuMatrix:L,enuToLocalMatrix:M,enuToEcefMatrix:x,ecefToEnuMatrix:I,localToEcefMatrix:H,ecefToLocalMatrix:C},onError:this.onError});O.matrix.copy(e.transform),O.matrix.decompose(O.position,O.quaternion,O.scale),O.matrixWorldNeedsUpdate=!0;var G=new ModelViewLayer(O,null);y.push(Promise.resolve(G))}return Promise.all(y).then(function(Q){for(var U,D=[],q=[],z=[],K=0,J=Q;K<J.length;K++){var j=J[K];if(o.viewLayers.push(j),o.disposed){j.scene.dispose();continue}switch(o.add(j.scene),j.scene.visible=!1,j.scene.type){case"mesh":D.push(j.scene);break;case"point_cloud":q.push(j.scene);break;default:z.push(j.scene);break}}D.length?D[0].visible=!0:q.length?q[0].visible=!0:z.length&&(z[0].visible=!0);var re=(U=r["3d-tiles"])===null||U===void 0?void 0:U.showLayers;if(typeof re=="boolean")for(var W=0,te=Q;W<te.length;W++){var j=te[W];j.scene&&(j.scene.visible=re)}else if(Array.isArray(re))for(var $=0,ne=Q;$<ne.length;$++){var j=ne[$];j.scene&&(j.scene.visible=re.indexOf(j.scene.name)!==-1)}})},t.prototype.update=function(e,r,i){if(this.children.length){var o=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 s=0,u=this.viewLayers;s<u.length;s++){var c=u[s],l=c.scene;l&&(this.work&&(l.idle=this.materialParameters.modelAlpha<=0,l.cacheCameras=this.cacheCameras,this.autoRefine===!1?l.needsRefined=!1:isFristPersonMode(i)?l.needsRefined=this.materialParameters.modelAlpha===0||this.materialParameters.modelAlpha===1:l.needsRefined=!0,this.work.transform.equals(l.matrix)||(l.matrix.copy(this.work.transform),l.matrix.decompose(l.position,l.quaternion,l.scale),l.matrixWorldNeedsUpdate=!0)),l.update(e,r),l.boundingBox.isEmpty()||(scratchBoundingBox.copy(l.boundingBox).applyMatrix4(l.matrix),this.bounding.union(scratchBoundingBox)),l.needsRender===!0&&(l.needsRender=!1,this.needsRender=!0),l.refined===!1&&(this.refined=!1),this.refineProgress[0]+=l.refineProgress[0],this.refineProgress[1]+=l.refineProgress[1],l.loaded===!1&&(this.loaded=!1))}this.bounding.isEmpty()&&this.bounding.copy(DEFAULT_BOUNDING),o===!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 THREE__namespace.Vector3,new THREE__namespace.Vector3)},t.prototype.dispose=function(){this.disposed=!0;for(var e;e=this.children[0];)e instanceof Tile3DModel&&e.dispose(),this.remove(e)},t}(THREE__namespace.Object3D);function createModels(){var n=new THREE__namespace.Box3,t=omit(defaultPbmParameters,["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,o){o===void 0&&(o=!0);var s;if(e.length===1)s=e[0].intersectRaycaster(r,i,o);else if(e.length===0)s=[];else{s=[];for(var u=0,c=e;u<c.length;u++){var l=c[u];if(l.visible){var d=l.intersectRaycaster(r,i,!1);d.length&&s.push.apply(s,d)}}o&&s.sort(function(f,v){return f.distance-v.distance})}return s},setMaterial:function(r){var i=updatePBMParameters(t,r);i&&(e.materialVersion++,e.needsRender=!0)},getMaterial:function(){return __assign({},t)},resetBrightness:function(){for(var r=0,i=e;r<i.length;r++){var o=i[r];o.setMaterial({brightness:1})}},update:function(r,i,o){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 s=0,u=e.cacheCameras;s<u.length;s++){var c=u[s];c.updateMatrixWorld(!0),c.updateProjectionMatrix()}for(var l=0,d=0,f=e;d<f.length;d++){for(var v=f[d],A=0,h=v.viewLayers;A<h.length;A++){var p=h[A];p.scene.modelIndex=l++}v.setMaterial(t),v.cacheCameras=e.cacheCameras,v.update(r,i,o),v.needsRender===!0&&(e.needsRender=!0,v.needsRender=!1),v.refined===!1&&(e.refined=!1),e.refineProgress[0]+=v.refineProgress[0],e.refineProgress[1]+=v.refineProgress[1],v.loaded===!1&&(e.loaded=!1),n.union(v.bounding)}n.isEmpty()&&n.copy(DEFAULT_BOUNDING)}}});return e}function mixNumber(n,t,e){return n+(t-n)*e}function value(n,t,e,r){var i=(t*e+2*n)/Math.pow(e,3),o=-(2*t*e+3*n)/Math.pow(e,2),s=t,u=n;return i*Math.pow(r,3)+o*Math.pow(r,2)+s*r+u}function velocity(n,t,e,r){var i=(t*e+2*n)/Math.pow(e,3),o=-(2*t*e+3*n)/Math.pow(e,2),s=t;return 3*i*Math.pow(r,2)+2*o*r+s}function mixCircle(n,t,e,r){var i=r[1]-r[0];return n=circleValue(n,r),t=circleValue(t,r),t-n>i/2?mixNumber(n+i,t,e):n-t>i/2?mixNumber(n-i,t,e):mixNumber(n,t,e)}function circleValue(n,t){var e=t[1]-t[0];return n<t[0]?circleValue(n+e,t):n>=t[1]?circleValue(n-e,t):n}function mixValue(n,t,e,r){return r?mixCircle(n,t,e,r):mixNumber(n,t,e)}var Motion=function(){function n(t){this.config={},this.progress=1,this.ended=!0,this.value={},this.startTime=now(),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:__assign({},this.value)},{progress:1,value:__assign({},this.value)}]}return n.prototype.getProgress=function(t){var e=t-this.startTime;return e<0?0:e>=this.duration?1:1-value(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],o={};for(var s in this.config){var u=(t-r.progress)/(i.progress-r.progress);o[s]=mixValue(r.value[s],i.value[s],u,this.config[s].circle)}return o}return __assign({},this.keyframes[this.keyframes.length-1].value)},n.prototype.getProgressVelocity=function(t){var e=t-this.startTime;return e>=this.duration?0:velocity(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 o;r===void 0&&(r=0),isNaN(e)&&(e=0),isNaN(r)&&(r=0),i=i!=null?i:now();var s=this.getProgress(i),u=this.getValue(s),c={};for(var l in this.config)c[l]=(o=t[l])!==null&&o!==void 0?o:u[l];var d=[{progress:0,value:u},{progress:1,value:c}];return this.setKeyframes(d,e,r,i)},n.prototype.setKeyframes=function(t,e,r,i){var o=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(s,u){i=i!=null?i:now(),o.progress=0,o.ended=!1,o.startTime=i,o.startVelocity=r,o.keyframes=t,o.duration=e,e===0?(o.progress=1,o.value=__assign({},t[t.length-1].value)):o.value=__assign({},t[0].value),o.callbacks=[s,u]})},n.prototype.dispose=function(){this.callbacks&&(this.callbacks[1](new Error("motion dispose.")),this.callbacks=void 0)},n}(),easeOut$2=function(n){return n*(2-n)},sharedGeometry2$2=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 THREE__namespace.BufferGeometry;return r.setAttribute("position",new THREE__namespace.BufferAttribute(n,3)),r.setAttribute("uv",new THREE__namespace.BufferAttribute(t,2)),r.setIndex(new THREE__namespace.BufferAttribute(e,1)),r}(),vertexShader$4=`
933
933
  varying vec2 vUv;
934
934
  #include <common>
935
935
  #include <logdepthbuf_pars_vertex>
@@ -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
- `,PanoCircleMesh=function(n){__extends(t,n);function t(e){e===void 0&&(e={});var r,i,o=n.call(this)||this,s=(r=e.color)!==null&&r!==void 0?r:16777215,u=(i=e.scale)!==null&&i!==void 0?i:1;return o.progress=0,o.opacity=0,o.loading=!1,o.current=!1,o.disabled=!1,o.currentMotion=new Motion({progress:0}),o.ringMotion=new Motion({scale:1,opacity:1}),o.tapMotion=new Motion({scale:1,opacity:1}),o.loadingOpacityMotion=new Motion({opacity:0}),o.progressMotion=new Motion({progress:0}),o.progressOpacityMotion=new Motion({opacity:0}),o.opacityMotion=new Motion({opacity:0}),o.disableMotion=new Motion({progress:0}),o.panoMesh=new THREE__namespace.Mesh(sharedGeometry2$2,new THREE__namespace.ShaderMaterial({blending:THREE__namespace.CustomBlending,blendSrc:THREE__namespace.SrcAlphaFactor,blendDst:THREE__namespace.OneMinusSrcAlphaFactor,blendSrcAlpha:THREE__namespace.OneFactor,blendDstAlpha:THREE__namespace.OneMinusSrcAlphaFactor,depthWrite:!1,vertexShader:vertexShader$4,fragmentShader:fragmentShader$4,uniforms:{baseColor:{value:new THREE__namespace.Color(s)},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}}})),o.renderOrder=-2,o.panoMesh.renderOrder=-2,o.panoMesh.position.y=.004,o.panoMesh.scale.set(u,1,u),o.add(o.panoMesh),o.currentStartTime=now(),o.needsRender=!0,o}return t.prototype.setProgress=function(e){var r=this;this.setDisabled(!1),this.setLoading(!1),this.progress!==e&&(e=clamp$1(e,0,1),this.tapMotion.ended&&(this.progress===0&&this.progressOpacityMotion.set({opacity:1},500).catch(noop$1),e===0?this.progressOpacityMotion.set({opacity:0},500).catch(noop$1).then(function(){r.progressMotion.set({progress:0},0).catch(noop$1)}):this.progressMotion.set({progress:clamp$1(e*1.2,0,1)},100).catch(noop$1)),this.progress=e)},t.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=clamp$1(e,0,1),this.opacityMotion.set({opacity:e},200).catch(noop$1))},t.prototype.setCurrent=function(e){this.current!==e&&(this.currentMotion.set({progress:e?1:0},2e3).catch(noop$1),this.current=e,this.current===!0&&(this.currentStartTime=now()))},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(noop$1))},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(noop$1))},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(noop$1),this.progressMotion.set({progress:0},0).catch(noop$1),this.tapMotion.setKeyframes(r,600).then(function(){e.progressOpacityMotion.set({opacity:e.progress>0?1:0},300).catch(noop$1),e.progressMotion.set({progress:e.progress},120).catch(noop$1)}).catch(noop$1)},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 o=this.progressOpacityMotion.value.opacity;this.panoMesh.material.uniforms.progressOpacity.value=o,this.needsRender=!0}if(!this.opacityMotion.ended){this.opacityMotion.update(e);var o=this.opacityMotion.value.opacity;this.panoMesh.material.uniforms.opacity.value=o,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 s=(e-this.currentStartTime-1500)/2e3;if(s%5<2){var u=1+Math.sin(Math.PI*s)/25*this.currentMotion.value.progress;this.panoMesh.material.uniforms.circleScale.value=u,this.needsRender=!0}}{var l=(e-this.currentStartTime-1500)/2e3;if(l%5<2){var c=l%1;this.panoMesh.material.uniforms.expand0.value=easeOut$2(c)*this.currentMotion.value.progress,this.needsRender=!0}}{var d=(e-this.currentStartTime-1e3)/2e3;if(d%5<2){var c=d%1;this.panoMesh.material.uniforms.expand1.value=easeOut$2(c)*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(noop$1):this.ringMotion.getTargetKeyframe().value.scale!==1&&this.ringMotion.set({scale:1,opacity:1},600).catch(noop$1)}else this.ringMotion.getTargetKeyframe().value.scale!==1&&this.ringMotion.set({scale:1,opacity:1},600).catch(noop$1);if(!this.ringMotion.ended){var m=this.ringMotion.value,u=m.scale,o=m.opacity;this.ringMotion.update(e),this.panoMesh.material.uniforms.ringScale.value=u,this.panoMesh.material.uniforms.ringOpacity.value=o,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}(THREE__namespace.Object3D),easeOut$1=function(n){return n*(2-n)},sharedGeometry2$1=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 THREE__namespace.BufferGeometry;return r.setAttribute("position",new THREE__namespace.BufferAttribute(n,3)),r.setAttribute("uv",new THREE__namespace.BufferAttribute(t,2)),r.setIndex(new THREE__namespace.BufferAttribute(e,1)),r}(),vertexShader$3=`
1044
+ `,PanoCircleMesh=function(n){__extends(t,n);function t(e){e===void 0&&(e={});var r,i,o=n.call(this)||this,s=(r=e.color)!==null&&r!==void 0?r:16777215,u=(i=e.scale)!==null&&i!==void 0?i:1;return o.progress=0,o.opacity=0,o.loading=!1,o.current=!1,o.disabled=!1,o.currentMotion=new Motion({progress:0}),o.ringMotion=new Motion({scale:1,opacity:1}),o.tapMotion=new Motion({scale:1,opacity:1}),o.loadingOpacityMotion=new Motion({opacity:0}),o.progressMotion=new Motion({progress:0}),o.progressOpacityMotion=new Motion({opacity:0}),o.opacityMotion=new Motion({opacity:0}),o.disableMotion=new Motion({progress:0}),o.panoMesh=new THREE__namespace.Mesh(sharedGeometry2$2,new THREE__namespace.ShaderMaterial({blending:THREE__namespace.CustomBlending,blendSrc:THREE__namespace.SrcAlphaFactor,blendDst:THREE__namespace.OneMinusSrcAlphaFactor,blendSrcAlpha:THREE__namespace.OneFactor,blendDstAlpha:THREE__namespace.OneMinusSrcAlphaFactor,depthWrite:!1,vertexShader:vertexShader$4,fragmentShader:fragmentShader$4,uniforms:{baseColor:{value:new THREE__namespace.Color(s)},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}}})),o.renderOrder=-2,o.panoMesh.renderOrder=-2,o.panoMesh.position.y=.004,o.panoMesh.scale.set(u,1,u),o.add(o.panoMesh),o.currentStartTime=now(),o.needsRender=!0,o}return t.prototype.setProgress=function(e){var r=this;this.setDisabled(!1),this.setLoading(!1),this.progress!==e&&(e=clamp$1(e,0,1),this.tapMotion.ended&&(this.progress===0&&this.progressOpacityMotion.set({opacity:1},500).catch(noop$1),e===0?this.progressOpacityMotion.set({opacity:0},500).catch(noop$1).then(function(){r.progressMotion.set({progress:0},0).catch(noop$1)}):this.progressMotion.set({progress:clamp$1(e*1.2,0,1)},100).catch(noop$1)),this.progress=e)},t.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=clamp$1(e,0,1),this.opacityMotion.set({opacity:e},200).catch(noop$1))},t.prototype.setCurrent=function(e){this.current!==e&&(this.currentMotion.set({progress:e?1:0},2e3).catch(noop$1),this.current=e,this.current===!0&&(this.currentStartTime=now()))},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(noop$1))},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(noop$1))},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(noop$1),this.progressMotion.set({progress:0},0).catch(noop$1),this.tapMotion.setKeyframes(r,600).then(function(){e.progressOpacityMotion.set({opacity:e.progress>0?1:0},300).catch(noop$1),e.progressMotion.set({progress:e.progress},120).catch(noop$1)}).catch(noop$1)},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 o=this.progressOpacityMotion.value.opacity;this.panoMesh.material.uniforms.progressOpacity.value=o,this.needsRender=!0}if(!this.opacityMotion.ended){this.opacityMotion.update(e);var o=this.opacityMotion.value.opacity;this.panoMesh.material.uniforms.opacity.value=o,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 s=(e-this.currentStartTime-1500)/2e3;if(s%5<2){var u=1+Math.sin(Math.PI*s)/25*this.currentMotion.value.progress;this.panoMesh.material.uniforms.circleScale.value=u,this.needsRender=!0}}{var c=(e-this.currentStartTime-1500)/2e3;if(c%5<2){var l=c%1;this.panoMesh.material.uniforms.expand0.value=easeOut$2(l)*this.currentMotion.value.progress,this.needsRender=!0}}{var d=(e-this.currentStartTime-1e3)/2e3;if(d%5<2){var l=d%1;this.panoMesh.material.uniforms.expand1.value=easeOut$2(l)*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(noop$1):this.ringMotion.getTargetKeyframe().value.scale!==1&&this.ringMotion.set({scale:1,opacity:1},600).catch(noop$1)}else this.ringMotion.getTargetKeyframe().value.scale!==1&&this.ringMotion.set({scale:1,opacity:1},600).catch(noop$1);if(!this.ringMotion.ended){var v=this.ringMotion.value,u=v.scale,o=v.opacity;this.ringMotion.update(e),this.panoMesh.material.uniforms.ringScale.value=u,this.panoMesh.material.uniforms.ringOpacity.value=o,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}(THREE__namespace.Object3D),easeOut$1=function(n){return n*(2-n)},sharedGeometry2$1=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 THREE__namespace.BufferGeometry;return r.setAttribute("position",new THREE__namespace.BufferAttribute(n,3)),r.setAttribute("uv",new THREE__namespace.BufferAttribute(t,2)),r.setIndex(new THREE__namespace.BufferAttribute(e,1)),r}(),vertexShader$3=`
1045
1045
  varying vec2 vUv;
1046
1046
  #include <common>
1047
1047
  #include <logdepthbuf_pars_vertex>
@@ -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
- `,PanoCircleMeshSolid=function(n){__extends(t,n);function t(e){e===void 0&&(e={});var r,i,o=n.call(this)||this,s=(r=e.color)!==null&&r!==void 0?r:16777215,u=(i=e.scale)!==null&&i!==void 0?i:1;return o.progress=0,o.opacity=0,o.loading=!1,o.current=!1,o.disabled=!1,o.currentMotion=new Motion({progress:0}),o.tapMotion=new Motion({scale:1,opacity:1}),o.loadingOpacityMotion=new Motion({opacity:0}),o.progressMotion=new Motion({progress:0}),o.progressOpacityMotion=new Motion({opacity:0}),o.opacityMotion=new Motion({opacity:0}),o.disableMotion=new Motion({progress:0}),o.panoMesh=new THREE__namespace.Mesh(sharedGeometry2$1,new THREE__namespace.ShaderMaterial({blending:THREE__namespace.CustomBlending,blendSrc:THREE__namespace.SrcAlphaFactor,blendDst:THREE__namespace.OneMinusSrcAlphaFactor,blendSrcAlpha:THREE__namespace.OneFactor,blendDstAlpha:THREE__namespace.OneMinusSrcAlphaFactor,depthWrite:!1,vertexShader:vertexShader$3,fragmentShader:fragmentShader$3,uniforms:{baseColor:{value:new THREE__namespace.Color(s)},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}}})),o.renderOrder=-2,o.panoMesh.renderOrder=-2,o.panoMesh.position.y=.004,o.panoMesh.scale.set(u,1,u),o.add(o.panoMesh),o.currentStartTime=now(),o.needsRender=!0,o}return t.prototype.setProgress=function(e){var r=this;this.setDisabled(!1),this.setLoading(!1),this.progress!==e&&(e=clamp$1(e,0,1),this.tapMotion.ended&&(this.progress===0&&this.progressOpacityMotion.set({opacity:1},500).catch(noop$1),e===0?this.progressOpacityMotion.set({opacity:0},500).catch(noop$1).then(function(){r.progressMotion.set({progress:0},0).catch(noop$1)}):this.progressMotion.set({progress:clamp$1(e*1.2,0,1)},100).catch(noop$1)),this.progress=e)},t.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=clamp$1(e,0,1),this.opacityMotion.set({opacity:e},200).catch(noop$1))},t.prototype.setCurrent=function(e){this.current!==e&&(this.currentMotion.set({progress:e?1:0},2e3).catch(noop$1),this.current=e,this.current===!0&&(this.currentStartTime=now()))},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(noop$1))},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(noop$1))},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(noop$1),this.progressMotion.set({progress:0},0).catch(noop$1),this.tapMotion.setKeyframes(r,600).then(function(){e.progressOpacityMotion.set({opacity:e.progress>0?1:0},300).catch(noop$1),e.progressMotion.set({progress:e.progress},120).catch(noop$1)}).catch(noop$1)},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 o=this.progressOpacityMotion.value.opacity;this.panoMesh.material.uniforms.progressOpacity.value=o,this.needsRender=!0}if(!this.opacityMotion.ended){this.opacityMotion.update(e);var o=this.opacityMotion.value.opacity;this.panoMesh.material.uniforms.opacity.value=o,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 s=(e-this.currentStartTime-1500)/2e3;if(s%5<2){var u=1+Math.sin(Math.PI*s)/25*this.currentMotion.value.progress;this.panoMesh.material.uniforms.circleScale.value=u,this.needsRender=!0}}{var l=(e-this.currentStartTime-1500)/2e3;if(l%5<2){var c=l%1;this.panoMesh.material.uniforms.expand0.value=easeOut$1(c)*this.currentMotion.value.progress,this.needsRender=!0}}{var d=(e-this.currentStartTime-1e3)/2e3;if(d%5<2){var c=d%1;this.panoMesh.material.uniforms.expand1.value=easeOut$1(c)*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}(THREE__namespace.Object3D),easeOut=function(n){return n*(2-n)},sharedGeometry2=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 THREE__namespace.BufferGeometry;return r.setAttribute("position",new THREE__namespace.BufferAttribute(n,3)),r.setAttribute("uv",new THREE__namespace.BufferAttribute(t,2)),r.setIndex(new THREE__namespace.BufferAttribute(e,1)),r}(),vertexShader$2=`
1146
+ `,PanoCircleMeshSolid=function(n){__extends(t,n);function t(e){e===void 0&&(e={});var r,i,o=n.call(this)||this,s=(r=e.color)!==null&&r!==void 0?r:16777215,u=(i=e.scale)!==null&&i!==void 0?i:1;return o.progress=0,o.opacity=0,o.loading=!1,o.current=!1,o.disabled=!1,o.currentMotion=new Motion({progress:0}),o.tapMotion=new Motion({scale:1,opacity:1}),o.loadingOpacityMotion=new Motion({opacity:0}),o.progressMotion=new Motion({progress:0}),o.progressOpacityMotion=new Motion({opacity:0}),o.opacityMotion=new Motion({opacity:0}),o.disableMotion=new Motion({progress:0}),o.panoMesh=new THREE__namespace.Mesh(sharedGeometry2$1,new THREE__namespace.ShaderMaterial({blending:THREE__namespace.CustomBlending,blendSrc:THREE__namespace.SrcAlphaFactor,blendDst:THREE__namespace.OneMinusSrcAlphaFactor,blendSrcAlpha:THREE__namespace.OneFactor,blendDstAlpha:THREE__namespace.OneMinusSrcAlphaFactor,depthWrite:!1,vertexShader:vertexShader$3,fragmentShader:fragmentShader$3,uniforms:{baseColor:{value:new THREE__namespace.Color(s)},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}}})),o.renderOrder=-2,o.panoMesh.renderOrder=-2,o.panoMesh.position.y=.004,o.panoMesh.scale.set(u,1,u),o.add(o.panoMesh),o.currentStartTime=now(),o.needsRender=!0,o}return t.prototype.setProgress=function(e){var r=this;this.setDisabled(!1),this.setLoading(!1),this.progress!==e&&(e=clamp$1(e,0,1),this.tapMotion.ended&&(this.progress===0&&this.progressOpacityMotion.set({opacity:1},500).catch(noop$1),e===0?this.progressOpacityMotion.set({opacity:0},500).catch(noop$1).then(function(){r.progressMotion.set({progress:0},0).catch(noop$1)}):this.progressMotion.set({progress:clamp$1(e*1.2,0,1)},100).catch(noop$1)),this.progress=e)},t.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=clamp$1(e,0,1),this.opacityMotion.set({opacity:e},200).catch(noop$1))},t.prototype.setCurrent=function(e){this.current!==e&&(this.currentMotion.set({progress:e?1:0},2e3).catch(noop$1),this.current=e,this.current===!0&&(this.currentStartTime=now()))},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(noop$1))},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(noop$1))},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(noop$1),this.progressMotion.set({progress:0},0).catch(noop$1),this.tapMotion.setKeyframes(r,600).then(function(){e.progressOpacityMotion.set({opacity:e.progress>0?1:0},300).catch(noop$1),e.progressMotion.set({progress:e.progress},120).catch(noop$1)}).catch(noop$1)},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 o=this.progressOpacityMotion.value.opacity;this.panoMesh.material.uniforms.progressOpacity.value=o,this.needsRender=!0}if(!this.opacityMotion.ended){this.opacityMotion.update(e);var o=this.opacityMotion.value.opacity;this.panoMesh.material.uniforms.opacity.value=o,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 s=(e-this.currentStartTime-1500)/2e3;if(s%5<2){var u=1+Math.sin(Math.PI*s)/25*this.currentMotion.value.progress;this.panoMesh.material.uniforms.circleScale.value=u,this.needsRender=!0}}{var c=(e-this.currentStartTime-1500)/2e3;if(c%5<2){var l=c%1;this.panoMesh.material.uniforms.expand0.value=easeOut$1(l)*this.currentMotion.value.progress,this.needsRender=!0}}{var d=(e-this.currentStartTime-1e3)/2e3;if(d%5<2){var l=d%1;this.panoMesh.material.uniforms.expand1.value=easeOut$1(l)*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}(THREE__namespace.Object3D),easeOut=function(n){return n*(2-n)},sharedGeometry2=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 THREE__namespace.BufferGeometry;return r.setAttribute("position",new THREE__namespace.BufferAttribute(n,3)),r.setAttribute("uv",new THREE__namespace.BufferAttribute(t,2)),r.setIndex(new THREE__namespace.BufferAttribute(e,1)),r}(),vertexShader$2=`
1147
1147
  varying vec2 vUv;
1148
1148
  #include <common>
1149
1149
  #include <logdepthbuf_pars_vertex>
@@ -1286,7 +1286,7 @@ void main() {
1286
1286
 
1287
1287
  gl_FragColor = vec4(gl_FragColor.rgb, gl_FragColor.a * opacity);
1288
1288
  }
1289
- `,PanoCircleMeshCustom=function(n){__extends(t,n);function t(e){e===void 0&&(e={});var r,i,o,s,u,l,c,d=n.call(this)||this,f=(r=e.color)!==null&&r!==void 0?r:16777215,m=(i=e.scale)!==null&&i!==void 0?i:1,A=e.map,h=(o=e.mapAlpha)!==null&&o!==void 0?o:1,p=(s=e.mapUseColor)!==null&&s!==void 0?s:!1,y=(u=e.mapUseReverse)!==null&&u!==void 0?u:!1,v=(l=e.borderWidth)!==null&&l!==void 0?l:.1,g=(c=e.borderColor)!==null&&c!==void 0?c:16777215;return d.progress=0,d.opacity=0,d.loading=!1,d.current=!1,d.disabled=!1,d.currentMotion=new Motion({progress:0}),d.tapMotion=new Motion({scale:1,opacity:1}),d.loadingOpacityMotion=new Motion({opacity:0}),d.progressMotion=new Motion({progress:0}),d.progressOpacityMotion=new Motion({opacity:0}),d.opacityMotion=new Motion({opacity:0}),d.disableMotion=new Motion({progress:0}),d.panoMesh=new THREE__namespace.Mesh(sharedGeometry2,new THREE__namespace.ShaderMaterial({blending:THREE__namespace.CustomBlending,blendSrc:THREE__namespace.SrcAlphaFactor,blendDst:THREE__namespace.OneMinusSrcAlphaFactor,blendSrcAlpha:THREE__namespace.OneFactor,blendDstAlpha:THREE__namespace.OneMinusSrcAlphaFactor,depthWrite:!1,vertexShader:vertexShader$2,fragmentShader:fragmentShader$2,defines:{USE_COLOR:p,USE_MAP:A!==void 0,USE_BORDER:v>0,USE_REVERSE:y},uniforms:{baseColor:{value:new THREE__namespace.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:A},mapAlpha:{value:h},borderWidth:{value:v},borderColor:{value:new THREE__namespace.Color(g)}}})),d.renderOrder=-2,d.panoMesh.renderOrder=-2,d.panoMesh.position.y=.004,d.panoMesh.scale.set(m,1,m),d.add(d.panoMesh),d.currentStartTime=now(),d.needsRender=!0,d}return t.prototype.setProgress=function(e){var r=this;this.setDisabled(!1),this.setLoading(!1),this.progress!==e&&(e=clamp$1(e,0,1),this.tapMotion.ended&&(this.progress===0&&this.progressOpacityMotion.set({opacity:1},500).catch(noop$1),e===0?this.progressOpacityMotion.set({opacity:0},500).catch(noop$1).then(function(){r.progressMotion.set({progress:0},0).catch(noop$1)}):this.progressMotion.set({progress:clamp$1(e*1.2,0,1)},100).catch(noop$1)),this.progress=e)},t.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=clamp$1(e,0,1),this.opacityMotion.set({opacity:e},200).catch(noop$1))},t.prototype.setCurrent=function(e){this.current!==e&&(this.currentMotion.set({progress:e?1:0},2e3).catch(noop$1),this.current=e,this.current===!0&&(this.currentStartTime=now()))},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(noop$1))},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(noop$1))},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(noop$1),this.progressMotion.set({progress:0},0).catch(noop$1),this.tapMotion.setKeyframes(r,600).then(function(){e.progressOpacityMotion.set({opacity:e.progress>0?1:0},300).catch(noop$1),e.progressMotion.set({progress:e.progress},120).catch(noop$1)}).catch(noop$1)},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 o=this.progressOpacityMotion.value.opacity;this.panoMesh.material.uniforms.progressOpacity.value=o,this.needsRender=!0}if(!this.opacityMotion.ended){this.opacityMotion.update(e);var o=this.opacityMotion.value.opacity;this.panoMesh.material.uniforms.opacity.value=o,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 s=(e-this.currentStartTime-1500)/2e3;if(s%5<2){var u=s%1;this.panoMesh.material.uniforms.expand0.value=easeOut(u)*this.currentMotion.value.progress,this.needsRender=!0}}{var l=(e-this.currentStartTime-1e3)/2e3;if(l%5<2){var u=l%1;this.panoMesh.material.uniforms.expand1.value=easeOut(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}(THREE__namespace.Object3D),sharedGeometry$2=new THREE__namespace.CircleBufferGeometry(.1,16),vertexShader$1=`
1289
+ `,PanoCircleMeshCustom=function(n){__extends(t,n);function t(e){e===void 0&&(e={});var r,i,o,s,u,c,l,d=n.call(this)||this,f=(r=e.color)!==null&&r!==void 0?r:16777215,v=(i=e.scale)!==null&&i!==void 0?i:1,A=e.map,h=(o=e.mapAlpha)!==null&&o!==void 0?o:1,p=(s=e.mapUseColor)!==null&&s!==void 0?s:!1,y=(u=e.mapUseReverse)!==null&&u!==void 0?u:!1,m=(c=e.borderWidth)!==null&&c!==void 0?c:.1,g=(l=e.borderColor)!==null&&l!==void 0?l:16777215;return d.progress=0,d.opacity=0,d.loading=!1,d.current=!1,d.disabled=!1,d.currentMotion=new Motion({progress:0}),d.tapMotion=new Motion({scale:1,opacity:1}),d.loadingOpacityMotion=new Motion({opacity:0}),d.progressMotion=new Motion({progress:0}),d.progressOpacityMotion=new Motion({opacity:0}),d.opacityMotion=new Motion({opacity:0}),d.disableMotion=new Motion({progress:0}),d.panoMesh=new THREE__namespace.Mesh(sharedGeometry2,new THREE__namespace.ShaderMaterial({blending:THREE__namespace.CustomBlending,blendSrc:THREE__namespace.SrcAlphaFactor,blendDst:THREE__namespace.OneMinusSrcAlphaFactor,blendSrcAlpha:THREE__namespace.OneFactor,blendDstAlpha:THREE__namespace.OneMinusSrcAlphaFactor,depthWrite:!1,vertexShader:vertexShader$2,fragmentShader:fragmentShader$2,defines:{USE_COLOR:p,USE_MAP:A!==void 0,USE_BORDER:m>0,USE_REVERSE:y},uniforms:{baseColor:{value:new THREE__namespace.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:A},mapAlpha:{value:h},borderWidth:{value:m},borderColor:{value:new THREE__namespace.Color(g)}}})),d.renderOrder=-2,d.panoMesh.renderOrder=-2,d.panoMesh.position.y=.004,d.panoMesh.scale.set(v,1,v),d.add(d.panoMesh),d.currentStartTime=now(),d.needsRender=!0,d}return t.prototype.setProgress=function(e){var r=this;this.setDisabled(!1),this.setLoading(!1),this.progress!==e&&(e=clamp$1(e,0,1),this.tapMotion.ended&&(this.progress===0&&this.progressOpacityMotion.set({opacity:1},500).catch(noop$1),e===0?this.progressOpacityMotion.set({opacity:0},500).catch(noop$1).then(function(){r.progressMotion.set({progress:0},0).catch(noop$1)}):this.progressMotion.set({progress:clamp$1(e*1.2,0,1)},100).catch(noop$1)),this.progress=e)},t.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=clamp$1(e,0,1),this.opacityMotion.set({opacity:e},200).catch(noop$1))},t.prototype.setCurrent=function(e){this.current!==e&&(this.currentMotion.set({progress:e?1:0},2e3).catch(noop$1),this.current=e,this.current===!0&&(this.currentStartTime=now()))},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(noop$1))},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(noop$1))},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(noop$1),this.progressMotion.set({progress:0},0).catch(noop$1),this.tapMotion.setKeyframes(r,600).then(function(){e.progressOpacityMotion.set({opacity:e.progress>0?1:0},300).catch(noop$1),e.progressMotion.set({progress:e.progress},120).catch(noop$1)}).catch(noop$1)},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 o=this.progressOpacityMotion.value.opacity;this.panoMesh.material.uniforms.progressOpacity.value=o,this.needsRender=!0}if(!this.opacityMotion.ended){this.opacityMotion.update(e);var o=this.opacityMotion.value.opacity;this.panoMesh.material.uniforms.opacity.value=o,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 s=(e-this.currentStartTime-1500)/2e3;if(s%5<2){var u=s%1;this.panoMesh.material.uniforms.expand0.value=easeOut(u)*this.currentMotion.value.progress,this.needsRender=!0}}{var c=(e-this.currentStartTime-1e3)/2e3;if(c%5<2){var u=c%1;this.panoMesh.material.uniforms.expand1.value=easeOut(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}(THREE__namespace.Object3D),sharedGeometry$2=new THREE__namespace.CircleBufferGeometry(.1,16),vertexShader$1=`
1290
1290
  varying vec2 vUv;
1291
1291
  #include <common>
1292
1292
  #include <logdepthbuf_pars_vertex>
@@ -1319,13 +1319,13 @@ void main() {
1319
1319
 
1320
1320
  gl_FragColor = vec4(gl_FragColor.rgb, gl_FragColor.a * outside * inside);
1321
1321
  }
1322
- `,sharedMaterial=new THREE__namespace.ShaderMaterial({vertexShader:vertexShader$1,fragmentShader:fragmentShader$1,side:THREE__namespace.DoubleSide,blending:THREE__namespace.CustomBlending,blendSrc:THREE__namespace.SrcAlphaFactor,blendDst:THREE__namespace.OneMinusSrcAlphaFactor,blendSrcAlpha:THREE__namespace.OneFactor,blendDstAlpha:THREE__namespace.OneMinusSrcAlphaFactor,depthWrite:!1}),IntersectMesh=function(n){__extends(t,n);function t(){var e=n.call(this)||this;return e.ringMesh=new THREE__namespace.Mesh(sharedGeometry$2,sharedMaterial),e.ringMesh.position.z=.01,e.ringMesh.renderOrder=-2,e.add(e.ringMesh),e}return t.prototype.dispose=function(){this.remove(this.ringMesh)},t}(THREE__namespace.Object3D);function S4(){return((1+Math.random())*65536|0).toString(16).substring(1)}function createUuid(){return(S4()+S4()+"-"+S4()+"-4"+S4().substr(0,3)+"-"+S4()+"-"+S4()+S4()+S4()).toLowerCase()}function isSimilarValue(n,t,e){var r=Math.abs(n-t);return r<.001||typeof e!="undefined"&&Math.abs(e-r)<.001}function notSimilarValue(n,t,e){return!isSimilarValue(n,t,e)}function isSimilarVector3(n,t){return n.distanceTo(t)<.001}function notSimilarVector3(n,t){return!isSimilarVector3(n,t)}var DEFAULT_OFFSET_VECTOR=new THREE__namespace.Vector3(0,0,0),BoundingMesh=function(n){__extends(t,n);function t(e,r){r===void 0&&(r=DEFAULT_OFFSET_VECTOR);var i=n.call(this)||this,o=new THREE__namespace.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);o.clearGroups(),o.addGroup(0,o.index?o.index.count:o.attributes.position.count,0),o.applyMatrix4(new THREE__namespace.Matrix4().makeScale(-1,1,1)),o.computeVertexNormals();var s=new PBMMeshMaterial("none");s.depthWrite=!1;var u=new PBMMesh(o,[s]);return u.position.copy(e.getCenter(new THREE__namespace.Vector3)),u.frustumCulled=!1,i.add(u),i.boundingBox=new THREE__namespace.Box3,i.boundingBox.setFromObject(i),i.renderOrder=u.renderOrder=-1001,i}return t}(PBMContainer);function generateBoundingMesh(n,t){return t===void 0&&(t=DEFAULT_OFFSET_VECTOR),new BoundingMesh(n,t)}function cameraWorldToLocal(n,t){var e=new THREE__namespace.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),o=-Math.asin(e.y);return{theta:i,phi:o,lookAtVector:e}}var TAU$1=Math.PI*2;function formatRad(n){return n>=0&&n<TAU$1?n:(n%TAU$1+TAU$1)%TAU$1}var PI=Math.PI,TAU=PI*2;function stepNumber(n,t,e){if(n===t)return t;var r=t-n,i=Math.abs(r);if(i<=e)return t;var o=r>0?1:-1;return n+o*e}function stepVector(n,t,e){if(n.equals(t))return new THREE__namespace.Vector3().copy(t);var r=new THREE__namespace.Vector3().subVectors(t,n);return r.lengthSq()<e*e?r.copy(t):r.setLength(e).add(n)}function stepCoordinates(n,t,e){if(n.longitude===t.longitude&&n.latitude===t.latitude)return{longitude:t.longitude,latitude:t.latitude};var r=formatRad(n.longitude),i=n.latitude,o=formatRad(t.longitude),s=t.latitude;o-r>PI?r+=TAU:r-o>PI&&(r-=TAU);var u=Math.sqrt(Math.pow(o-r,2)+Math.pow(s-i,2)),l=e/u;return l>=1?{longitude:t.longitude,latitude:t.latitude}:{longitude:r+(o-r)*l,latitude:i+(s-i)*l}}function isPromise(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 isMobile=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 createEvent(n,t){for(var e=!1,r={type:n,timeStamp:now(),get defaultPrevented(){return e},preventDefault:function(){e=!0}},i=0,o=Object.keys(t);i<o.length;i++){var s=o[i];s in r||(r[s]=t[s])}return r}function requestDeviceOrientationPermission(){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 requestXRSessionPermission(){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 assignState(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 stateEqual(n,t){return n.workCode===t.workCode&&n.mode===t.mode&&n.panoIndex===t.panoIndex&&isSimilarValue(n.longitude,t.longitude,Math.PI*2)&&isSimilarValue(n.latitude,t.latitude)&&isSimilarValue(n.fov,t.fov)&&isSimilarVector3(n.offset,t.offset)&&isSimilarValue(n.distance,t.distance)}var defaultIterator=function(n){return Number(n)};function arrayMin(n,t,e){var r;t===void 0&&(t=defaultIterator),e===void 0&&(e=!1);for(var i,o=1/0,s=0,u=n;s<u.length;s++){var l=u[s],c=t(l);c<=o&&(r=[l,c],i=r[0],o=r[1])}return isFinite(o)||(o=0),e?[i,o]:i}function isEmptyObject(n){for(var t in n)return!1;return!0}function clonePose(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
1322
+ `,sharedMaterial=new THREE__namespace.ShaderMaterial({vertexShader:vertexShader$1,fragmentShader:fragmentShader$1,side:THREE__namespace.DoubleSide,blending:THREE__namespace.CustomBlending,blendSrc:THREE__namespace.SrcAlphaFactor,blendDst:THREE__namespace.OneMinusSrcAlphaFactor,blendSrcAlpha:THREE__namespace.OneFactor,blendDstAlpha:THREE__namespace.OneMinusSrcAlphaFactor,depthWrite:!1}),IntersectMesh=function(n){__extends(t,n);function t(){var e=n.call(this)||this;return e.ringMesh=new THREE__namespace.Mesh(sharedGeometry$2,sharedMaterial),e.ringMesh.position.z=.01,e.ringMesh.renderOrder=-2,e.add(e.ringMesh),e}return t.prototype.dispose=function(){this.remove(this.ringMesh)},t}(THREE__namespace.Object3D);function S4(){return((1+Math.random())*65536|0).toString(16).substring(1)}function createUuid(){return(S4()+S4()+"-"+S4()+"-4"+S4().substr(0,3)+"-"+S4()+"-"+S4()+S4()+S4()).toLowerCase()}function isSimilarValue(n,t,e){var r=Math.abs(n-t);return r<.001||typeof e!="undefined"&&Math.abs(e-r)<.001}function notSimilarValue(n,t,e){return!isSimilarValue(n,t,e)}function isSimilarVector3(n,t){return n.distanceTo(t)<.001}function notSimilarVector3(n,t){return!isSimilarVector3(n,t)}var DEFAULT_OFFSET_VECTOR=new THREE__namespace.Vector3(0,0,0),BoundingMesh=function(n){__extends(t,n);function t(e,r){r===void 0&&(r=DEFAULT_OFFSET_VECTOR);var i=n.call(this)||this,o=new THREE__namespace.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);o.clearGroups(),o.addGroup(0,o.index?o.index.count:o.attributes.position.count,0),o.applyMatrix4(new THREE__namespace.Matrix4().makeScale(-1,1,1)),o.computeVertexNormals();var s=new PBMMeshMaterial("none"),u=new PBMMesh(o,[s]);return u.position.copy(e.getCenter(new THREE__namespace.Vector3)),u.frustumCulled=!1,i.add(u),i.boundingBox=new THREE__namespace.Box3,i.boundingBox.setFromObject(i),i.renderOrder=u.renderOrder=-1001,i}return t}(PBMContainer);function generateBoundingMesh(n,t){return t===void 0&&(t=DEFAULT_OFFSET_VECTOR),new BoundingMesh(n,t)}function cameraWorldToLocal(n,t){var e=new THREE__namespace.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),o=-Math.asin(e.y);return{theta:i,phi:o,lookAtVector:e}}var TAU$1=Math.PI*2;function formatRad(n){return n>=0&&n<TAU$1?n:(n%TAU$1+TAU$1)%TAU$1}var PI=Math.PI,TAU=PI*2;function stepNumber(n,t,e){if(n===t)return t;var r=t-n,i=Math.abs(r);if(i<=e)return t;var o=r>0?1:-1;return n+o*e}function stepVector(n,t,e){if(n.equals(t))return new THREE__namespace.Vector3().copy(t);var r=new THREE__namespace.Vector3().subVectors(t,n);return r.lengthSq()<e*e?r.copy(t):r.setLength(e).add(n)}function stepCoordinates(n,t,e){if(n.longitude===t.longitude&&n.latitude===t.latitude)return{longitude:t.longitude,latitude:t.latitude};var r=formatRad(n.longitude),i=n.latitude,o=formatRad(t.longitude),s=t.latitude;o-r>PI?r+=TAU:r-o>PI&&(r-=TAU);var u=Math.sqrt(Math.pow(o-r,2)+Math.pow(s-i,2)),c=e/u;return c>=1?{longitude:t.longitude,latitude:t.latitude}:{longitude:r+(o-r)*c,latitude:i+(s-i)*c}}function isPromise(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}var _a$2,userAgent=typeof navigator!="undefined"?((_a$2=navigator==null?void 0:navigator.userAgent)!==null&&_a$2!==void 0?_a$2:"").toLowerCase():"node";(function(){try{var n=document.createElement("canvas");return!!(window.WebGLRenderingContext&&(n.getContext("webgl")||n.getContext("experimental-webgl")))}catch(t){return!1}})();var isMobile=/android/i.test(userAgent)||/webos/i.test(userAgent)||/ipad|iphone|ipod/i.test(userAgent)||/iemobile/i.test(userAgent)||/opera mini/i.test(userAgent)||/blackberry/i.test(userAgent)||/windows phone/i.test(userAgent);function createEvent(n,t){for(var e=!1,r={type:n,timeStamp:now(),get defaultPrevented(){return e},preventDefault:function(){e=!0}},i=0,o=Object.keys(t);i<o.length;i++){var s=o[i];s in r||(r[s]=t[s])}return r}function requestDeviceOrientationPermission(){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 requestXRSessionPermission(){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 assignState(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 stateEqual(n,t){return n.workCode===t.workCode&&n.mode===t.mode&&n.panoIndex===t.panoIndex&&isSimilarValue(n.longitude,t.longitude,Math.PI*2)&&isSimilarValue(n.latitude,t.latitude)&&isSimilarValue(n.fov,t.fov)&&isSimilarVector3(n.offset,t.offset)&&isSimilarValue(n.distance,t.distance)}var defaultIterator=function(n){return Number(n)};function arrayMin(n,t,e){var r;t===void 0&&(t=defaultIterator),e===void 0&&(e=!1);for(var i,o=1/0,s=0,u=n;s<u.length;s++){var c=u[s],l=t(c);l<=o&&(r=[c,l],i=r[0],o=r[1])}return isFinite(o)||(o=0),e?[i,o]:i}function isEmptyObject(n){for(var t in n)return!1;return!0}function clonePose(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
- * Licensed under the MIT license */var Hammer=function(n,t,e,r){var i=["","webkit","Moz","MS","ms","o"],o=t.createElement?t.createElement("div"):r,s="function",u=Math.round,l=Math.abs,c=Date.now;function d(M,P,F){return setTimeout(g(M,F),P)}function f(M,P,F){return Array.isArray(M)?(m(M,F[P],F),!0):!1}function m(M,P,F){var D;if(M)if(M.forEach)M.forEach(P,F);else if(M.length!==r)for(D=0;D<M.length;)P.call(F,M[D],D,M),D++;else for(D in M)M.hasOwnProperty(D)&&P.call(F,M[D],D,M)}function A(M,P,F){var D="DEPRECATED METHOD: "+P+`
1327
- `+F+` AT
1328
- `;return function(){var J=new Error("get-stack-trace"),ne=J&&J.stack?J.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",ve=n.console&&(n.console.warn||n.console.log);return ve&&ve.call(n.console,D,ne),M.apply(this,arguments)}}var h;typeof Object.assign!="function"?h=function(P){if(P===r||P===null)throw new TypeError("Cannot convert undefined or null to object");for(var F=Object(P),D=1;D<arguments.length;D++){var J=arguments[D];if(J!==r&&J!==null)for(var ne in J)J.hasOwnProperty(ne)&&(F[ne]=J[ne])}return F}:h=Object.assign;var p=A(function(P,F,D){for(var J=Object.keys(F),ne=0;ne<J.length;)(!D||D&&P[J[ne]]===r)&&(P[J[ne]]=F[J[ne]]),ne++;return P},"extend","Use `assign`."),y=A(function(P,F){return p(P,F,!0)},"merge","Use `assign`.");function v(M,P,F){var D=P.prototype,J;J=M.prototype=Object.create(D),J.constructor=M,J._super=D,F&&h(J,F)}function g(M,P){return function(){return M.apply(P,arguments)}}function E(M,P){return typeof M==s?M.apply(P&&P[0]||r,P):M}function b(M,P){return M===r?P:M}function T(M,P,F){m(w(P),function(D){M.addEventListener(D,F,!1)})}function _(M,P,F){m(w(P),function(D){M.removeEventListener(D,F,!1)})}function x(M,P){for(;M;){if(M==P)return!0;M=M.parentNode}return!1}function R(M,P){return M.indexOf(P)>-1}function w(M){return M.trim().split(/\s+/g)}function S(M,P,F){if(M.indexOf&&!F)return M.indexOf(P);for(var D=0;D<M.length;){if(F&&M[D][F]==P||!F&&M[D]===P)return D;D++}return-1}function C(M){return Array.prototype.slice.call(M,0)}function I(M,P,F){for(var D=[],J=[],ne=0;ne<M.length;){var ve=M[ne][P];S(J,ve)<0&&D.push(M[ne]),J[ne]=ve,ne++}return D=D.sort(function(Oe,Se){return Oe[P]>Se[P]}),D}function H(M,P){for(var F,D,J=P[0].toUpperCase()+P.slice(1),ne=0;ne<i.length;){if(F=i[ne],D=F?F+J:P,D in M)return D;ne++}return r}var B=1;function L(){return B++}function O(M){var P=M.ownerDocument||M;return P.defaultView||P.parentWindow||n}var k=/mobile|tablet|ip(ad|hone|od)|android/i,K="ontouchstart"in n,z=H(n,"PointerEvent")!==r,N=K&&k.test(navigator.userAgent),U="touch",Q="pen",G="mouse",q="kinect",j=25,X=1,ae=2,W=4,te=8,ee=1,ie=2,$=4,se=8,re=16,oe=ie|$,pe=se|re,he=oe|pe,Ae=["x","y"],Z=["clientX","clientY"];function Y(M,P){var F=this;this.manager=M,this.callback=P,this.element=M.element,this.target=M.options.inputTarget,this.domHandler=function(D){E(M.options.enable,[M])&&F.handler(D)},this.init()}Y.prototype={handler:function(){},init:function(){this.evEl&&T(this.element,this.evEl,this.domHandler),this.evTarget&&T(this.target,this.evTarget,this.domHandler),this.evWin&&T(O(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&_(this.element,this.evEl,this.domHandler),this.evTarget&&_(this.target,this.evTarget,this.domHandler),this.evWin&&_(O(this.element),this.evWin,this.domHandler)}};function V(M){var P,F=M.options.inputClass;return F?P=F:z?P=Xe:N?P=Fe:K?P=Ne:P=Be,new P(M,Ee)}function Ee(M,P,F){var D=F.pointers.length,J=F.changedPointers.length,ne=P&X&&D-J===0,ve=P&(W|te)&&D-J===0;F.isFirst=!!ne,F.isFinal=!!ve,ne&&(M.session={}),F.eventType=P,ge(M,F),M.emit("hammer.input",F),M.recognize(F),M.session.prevInput=F}function ge(M,P){var F=M.session,D=P.pointers,J=D.length;F.firstInput||(F.firstInput=fe(P)),J>1&&!F.firstMultiple?F.firstMultiple=fe(P):J===1&&(F.firstMultiple=!1);var ne=F.firstInput,ve=F.firstMultiple,Ce=ve?ve.center:ne.center,Oe=P.center=de(D);P.timeStamp=c(),P.deltaTime=P.timeStamp-ne.timeStamp,P.angle=Te(Ce,Oe),P.distance=ue(Ce,Oe),me(F,P),P.offsetDirection=le(P.deltaX,P.deltaY);var Se=ce(P.deltaTime,P.deltaX,P.deltaY);P.overallVelocityX=Se.x,P.overallVelocityY=Se.y,P.overallVelocity=l(Se.x)>l(Se.y)?Se.x:Se.y,P.scale=ve?Ie(ve.pointers,D):1,P.rotation=ve?xe(ve.pointers,D):0,P.maxPointers=F.prevInput?P.pointers.length>F.prevInput.maxPointers?P.pointers.length:F.prevInput.maxPointers:P.pointers.length,Re(F,P);var Ye=M.element;x(P.srcEvent.target,Ye)&&(Ye=P.srcEvent.target),P.target=Ye}function me(M,P){var F=P.center,D=M.offsetDelta||{},J=M.prevDelta||{},ne=M.prevInput||{};(P.eventType===X||ne.eventType===W)&&(J=M.prevDelta={x:ne.deltaX||0,y:ne.deltaY||0},D=M.offsetDelta={x:F.x,y:F.y}),P.deltaX=J.x+(F.x-D.x),P.deltaY=J.y+(F.y-D.y)}function Re(M,P){var F=M.lastInterval||P,D=P.timeStamp-F.timeStamp,J,ne,ve,Ce;if(P.eventType!=te&&(D>j||F.velocity===r)){var Oe=P.deltaX-F.deltaX,Se=P.deltaY-F.deltaY,Ye=ce(D,Oe,Se);ne=Ye.x,ve=Ye.y,J=l(Ye.x)>l(Ye.y)?Ye.x:Ye.y,Ce=le(Oe,Se),M.lastInterval=P}else J=F.velocity,ne=F.velocityX,ve=F.velocityY,Ce=F.direction;P.velocity=J,P.velocityX=ne,P.velocityY=ve,P.direction=Ce}function fe(M){for(var P=[],F=0;F<M.pointers.length;)P[F]={clientX:u(M.pointers[F].clientX),clientY:u(M.pointers[F].clientY)},F++;return{timeStamp:c(),pointers:P,center:de(P),deltaX:M.deltaX,deltaY:M.deltaY}}function de(M){var P=M.length;if(P===1)return{x:u(M[0].clientX),y:u(M[0].clientY)};for(var F=0,D=0,J=0;J<P;)F+=M[J].clientX,D+=M[J].clientY,J++;return{x:u(F/P),y:u(D/P)}}function ce(M,P,F){return{x:P/M||0,y:F/M||0}}function le(M,P){return M===P?ee:l(M)>=l(P)?M<0?ie:$:P<0?se:re}function ue(M,P,F){F||(F=Ae);var D=P[F[0]]-M[F[0]],J=P[F[1]]-M[F[1]];return Math.sqrt(D*D+J*J)}function Te(M,P,F){F||(F=Ae);var D=P[F[0]]-M[F[0]],J=P[F[1]]-M[F[1]];return Math.atan2(J,D)*180/Math.PI}function xe(M,P){return Te(P[1],P[0],Z)+Te(M[1],M[0],Z)}function Ie(M,P){return ue(P[0],P[1],Z)/ue(M[0],M[1],Z)}var lt={mousedown:X,mousemove:ae,mouseup:W},ye="mousedown",we="mousemove mouseup";function Be(){this.evEl=ye,this.evWin=we,this.pressed=!1,Y.apply(this,arguments)}v(Be,Y,{handler:function(P){var F=lt[P.type];F&X&&(P.button===0||P.button===2)&&(this.pressed=!0),F&ae&&P.which!==1&&(F=W),this.pressed&&(F&W&&(this.pressed=!1),this.callback(this.manager,F,{pointers:[P],changedPointers:[P],pointerType:G,srcEvent:P}))}});var Je={pointerdown:X,pointermove:ae,pointerup:W,pointercancel:te,pointerout:te},ht={2:U,3:Q,4:G,5:q},je="pointerdown",Ve="pointermove pointerup pointercancel";n.MSPointerEvent&&!n.PointerEvent&&(je="MSPointerDown",Ve="MSPointerMove MSPointerUp MSPointerCancel");function Xe(){this.evEl=je,this.evWin=Ve,Y.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}v(Xe,Y,{handler:function(P){var F=this.store,D=!1,J=!1,ne=P.type.toLowerCase().replace("ms",""),ve=Je[ne],Ce=ht[P.pointerType]||P.pointerType,Oe=Ce==U,Se=S(F,P.pointerId,"pointerId");ve&X&&(P.button===0||P.button===2||Oe)?Se<0&&(F.push(P),Se=F.length-1):ve&(W|te)?D=!0:!Oe&&P.buttons===0&&(D=!0,J=!0,ve=Je.pointerup),!(Se<0)&&(J||(F[Se]=P),this.callback(this.manager,ve,{pointers:F,changedPointers:[P],pointerType:Ce,srcEvent:F[Se]}),D&&F.splice(Se,1))}});var at={touchstart:X,touchmove:ae,touchend:W,touchcancel:te},Ue="touchstart",We="touchstart touchmove touchend touchcancel";function ze(){this.evTarget=Ue,this.evWin=We,this.started=!1,Y.apply(this,arguments)}v(ze,Y,{handler:function(P){var F=at[P.type];if(F===X&&(this.started=!0),!!this.started){var D=He.call(this,P,F);F&(W|te)&&D[0].length-D[1].length===0&&(this.started=!1),this.callback(this.manager,F,{pointers:D[0],changedPointers:D[1],pointerType:U,srcEvent:P})}}});function He(M,P){var F=C(M.touches),D=C(M.changedTouches);return P&(W|te)&&(F=I(F.concat(D),"identifier")),[F,D]}var be={touchstart:X,touchmove:ae,touchend:W,touchcancel:te},$e="touchstart touchmove touchend touchcancel";function Fe(){this.evTarget=$e,this.targetIds={},Y.apply(this,arguments)}v(Fe,Y,{handler:function(P){var F=be[P.type],D=et.call(this,P,F);D&&this.callback(this.manager,F,{pointers:D[0],changedPointers:D[1],pointerType:U,srcEvent:P})}});function et(M,P){var F=C(M.touches),D=this.targetIds;if(P&(X|ae)&&F.length===1)return D[F[0].identifier]=!0,[F,F];var J,ne,ve=C(M.changedTouches),Ce=[],Oe=this.target;if(ne=F.filter(function(Se){return x(Se.target,Oe)}),P===X)for(J=0;J<ne.length;)D[ne[J].identifier]=!0,J++;for(J=0;J<ve.length;)D[ve[J].identifier]&&Ce.push(ve[J]),P&(W|te)&&delete D[ve[J].identifier],J++;if(Ce.length)return[I(ne.concat(Ce),"identifier"),Ce]}var tt=2500,Qe=25;function Ne(){Y.apply(this,arguments);var M=g(this.handler,this);this.touch=new Fe(this.manager,M),this.mouse=new Be(this.manager,M),this.primaryTouch=null,this.lastTouches=[]}v(Ne,Y,{handler:function(P,F,D){var J=D.pointerType==U,ne=D.pointerType==G;if(!(ne&&D.sourceCapabilities&&D.sourceCapabilities.firesTouchEvents)){if(J)rt.call(this,F,D);else if(ne&&pt.call(this,D))return;this.callback(P,F,D)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function rt(M,P){M&X?(this.primaryTouch=P.changedPointers[0].identifier,ot.call(this,P)):M&(W|te)&&ot.call(this,P)}function ot(M){var P=M.changedPointers[0];if(P.identifier===this.primaryTouch){var F={x:P.clientX,y:P.clientY};this.lastTouches.push(F);var D=this.lastTouches,J=function(){var ne=D.indexOf(F);ne>-1&&D.splice(ne,1)};setTimeout(J,tt)}}function pt(M){for(var P=M.srcEvent.clientX,F=M.srcEvent.clientY,D=0;D<this.lastTouches.length;D++){var J=this.lastTouches[D],ne=Math.abs(P-J.x),ve=Math.abs(F-J.y);if(ne<=Qe&&ve<=Qe)return!0}return!1}var ct=o?H(o.style,"touchAction"):r,dt=ct!==r,Ge="compute",Me="auto",_e="manipulation",Pe="none",ke="pan-x",Le="pan-y",qe=Pt();function st(M,P){this.manager=M,this.set(P)}st.prototype={set:function(M){M==Ge&&(M=this.compute()),dt&&this.manager.element.style&&qe[M]&&(this.manager.element.style[ct]=M),this.actions=M.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var M=[];return m(this.manager.recognizers,function(P){E(P.options.enable,[P])&&(M=M.concat(P.getTouchAction()))}),ft(M.join(" "))},preventDefaults:function(M){var P=M.srcEvent,F=M.offsetDirection;if(this.manager.session.prevented){P.preventDefault();return}var D=this.actions,J=R(D,Pe)&&!qe[Pe],ne=R(D,Le)&&!qe[Le],ve=R(D,ke)&&!qe[ke];if(J){var Ce=M.pointers.length===1,Oe=M.distance<2,Se=M.deltaTime<250;if(Ce&&Oe&&Se)return}if(!(ve&&ne)&&(J||ne&&F&oe||ve&&F&pe))return this.preventSrc(P)},preventSrc:function(M){this.manager.session.prevented=!0,M.preventDefault()}};function ft(M){if(R(M,Pe))return Pe;var P=R(M,ke),F=R(M,Le);return P&&F?Pe:P||F?P?ke:Le:R(M,_e)?_e:Me}function Pt(){if(!dt)return!1;var M={},P=n.CSS&&n.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(F){M[F]=P?n.CSS.supports("touch-action",F):!0}),M}var gt=1,De=2,vt=4,ut=8,nt=ut,At=16,Ze=32;function it(M){this.options=h({},this.defaults,M||{}),this.id=L(),this.manager=null,this.options.enable=b(this.options.enable,!0),this.state=gt,this.simultaneous={},this.requireFail=[]}it.prototype={defaults:{},set:function(M){return h(this.options,M),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(M){if(f(M,"recognizeWith",this))return this;var P=this.simultaneous;return M=yt(M,this),P[M.id]||(P[M.id]=M,M.recognizeWith(this)),this},dropRecognizeWith:function(M){return f(M,"dropRecognizeWith",this)?this:(M=yt(M,this),delete this.simultaneous[M.id],this)},requireFailure:function(M){if(f(M,"requireFailure",this))return this;var P=this.requireFail;return M=yt(M,this),S(P,M)===-1&&(P.push(M),M.requireFailure(this)),this},dropRequireFailure:function(M){if(f(M,"dropRequireFailure",this))return this;M=yt(M,this);var P=S(this.requireFail,M);return P>-1&&this.requireFail.splice(P,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(M){return!!this.simultaneous[M.id]},emit:function(M){var P=this,F=this.state;function D(J){P.manager.emit(J,M)}F<ut&&D(P.options.event+wt(F)),D(P.options.event),M.additionalEvent&&D(M.additionalEvent),F>=ut&&D(P.options.event+wt(F))},tryEmit:function(M){if(this.canEmit())return this.emit(M);this.state=Ze},canEmit:function(){for(var M=0;M<this.requireFail.length;){if(!(this.requireFail[M].state&(Ze|gt)))return!1;M++}return!0},recognize:function(M){var P=h({},M);if(!E(this.options.enable,[this,P])){this.reset(),this.state=Ze;return}this.state&(nt|At|Ze)&&(this.state=gt),this.state=this.process(P),this.state&(De|vt|ut|At)&&this.tryEmit(P)},process:function(M){},getTouchAction:function(){},reset:function(){}};function wt(M){return M&At?"cancel":M&ut?"end":M&vt?"move":M&De?"start":""}function Mt(M){return M==re?"down":M==se?"up":M==ie?"left":M==$?"right":""}function yt(M,P){var F=P.manager;return F?F.get(M):M}function Ke(){it.apply(this,arguments)}v(Ke,it,{defaults:{pointers:1},attrTest:function(M){var P=this.options.pointers;return P===0||M.pointers.length===P},process:function(M){var P=this.state,F=M.eventType,D=P&(De|vt),J=this.attrTest(M);return D&&(F&te||!J)?P|At:D||J?F&W?P|ut:P&De?P|vt:De:Ze}});function bt(){Ke.apply(this,arguments),this.pX=null,this.pY=null}v(bt,Ke,{defaults:{event:"pan",threshold:10,pointers:1,direction:he},getTouchAction:function(){var M=this.options.direction,P=[];return M&oe&&P.push(Le),M&pe&&P.push(ke),P},directionTest:function(M){var P=this.options,F=!0,D=M.distance,J=M.direction,ne=M.deltaX,ve=M.deltaY;return J&P.direction||(P.direction&oe?(J=ne===0?ee:ne<0?ie:$,F=ne!=this.pX,D=Math.abs(M.deltaX)):(J=ve===0?ee:ve<0?se:re,F=ve!=this.pY,D=Math.abs(M.deltaY))),M.direction=J,F&&D>P.threshold&&J&P.direction},attrTest:function(M){return Ke.prototype.attrTest.call(this,M)&&(this.state&De||!(this.state&De)&&this.directionTest(M))},emit:function(M){this.pX=M.deltaX,this.pY=M.deltaY;var P=Mt(M.direction);P&&(M.additionalEvent=this.options.event+P),this._super.emit.call(this,M)}});function Tt(){Ke.apply(this,arguments)}v(Tt,Ke,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Pe]},attrTest:function(M){return this._super.attrTest.call(this,M)&&(Math.abs(M.scale-1)>this.options.threshold||this.state&De)},emit:function(M){if(M.scale!==1){var P=M.scale<1?"in":"out";M.additionalEvent=this.options.event+P}this._super.emit.call(this,M)}});function _t(){it.apply(this,arguments),this._timer=null,this._input=null}v(_t,it,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Me]},process:function(M){var P=this.options,F=M.pointers.length===P.pointers,D=M.distance<P.threshold,J=M.deltaTime>P.time;if(this._input=M,!D||!F||M.eventType&(W|te)&&!J)this.reset();else if(M.eventType&X)this.reset(),this._timer=d(function(){this.state=nt,this.tryEmit()},P.time,this);else if(M.eventType&W)return nt;return Ze},reset:function(){clearTimeout(this._timer)},emit:function(M){this.state===nt&&(M&&M.eventType&W?this.manager.emit(this.options.event+"up",M):(this._input.timeStamp=c(),this.manager.emit(this.options.event,this._input)))}});function Rt(){Ke.apply(this,arguments)}v(Rt,Ke,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Pe]},attrTest:function(M){return this._super.attrTest.call(this,M)&&(Math.abs(M.rotation)>this.options.threshold||this.state&De)}});function xt(){Ke.apply(this,arguments)}v(xt,Ke,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:oe|pe,pointers:1},getTouchAction:function(){return bt.prototype.getTouchAction.call(this)},attrTest:function(M){var P=this.options.direction,F;return P&(oe|pe)?F=M.overallVelocity:P&oe?F=M.overallVelocityX:P&pe&&(F=M.overallVelocityY),this._super.attrTest.call(this,M)&&P&M.offsetDirection&&M.distance>this.options.threshold&&M.maxPointers==this.options.pointers&&l(F)>this.options.velocity&&M.eventType&W},emit:function(M){var P=Mt(M.offsetDirection);P&&this.manager.emit(this.options.event+P,M),this.manager.emit(this.options.event,M)}});function Et(){it.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}v(Et,it,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[_e]},process:function(M){var P=this.options,F=M.pointers.length===P.pointers,D=M.distance<P.threshold,J=M.deltaTime<P.time;if(this.reset(),M.eventType&X&&this.count===0)return this.failTimeout();if(D&&J&&F){if(M.eventType!=W)return this.failTimeout();var ne=this.pTime?M.timeStamp-this.pTime<P.interval:!0,ve=!this.pCenter||ue(this.pCenter,M.center)<P.posThreshold;this.pTime=M.timeStamp,this.pCenter=M.center,!ve||!ne?this.count=1:this.count+=1,this._input=M;var Ce=this.count%P.taps;if(Ce===0)return this.hasRequireFailures()?(this._timer=d(function(){this.state=nt,this.tryEmit()},P.interval,this),De):nt}return Ze},failTimeout:function(){return this._timer=d(function(){this.state=Ze},this.options.interval,this),Ze},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==nt&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function mt(M,P){return P=P||{},P.recognizers=b(P.recognizers,mt.defaults.preset),new St(M,P)}mt.VERSION="2.0.7",mt.defaults={domEvents:!1,touchAction:Ge,enable:!0,inputTarget:null,inputClass:null,preset:[[Rt,{enable:!1}],[Tt,{enable:!1},["rotate"]],[xt,{direction:oe}],[bt,{direction:oe},["swipe"]],[Et],[Et,{event:"doubletap",taps:2},["tap"]],[_t]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Bt=1,Ct=2;function St(M,P){this.options=h({},mt.defaults,P||{}),this.options.inputTarget=this.options.inputTarget||M,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=M,this.input=V(this),this.touchAction=new st(this,this.options.touchAction),It(this,!0),m(this.options.recognizers,function(F){var D=this.add(new F[0](F[1]));F[2]&&D.recognizeWith(F[2]),F[3]&&D.requireFailure(F[3])},this)}St.prototype={set:function(M){return h(this.options,M),M.touchAction&&this.touchAction.update(),M.inputTarget&&(this.input.destroy(),this.input.target=M.inputTarget,this.input.init()),this},stop:function(M){this.session.stopped=M?Ct:Bt},recognize:function(M){var P=this.session;if(!P.stopped){this.touchAction.preventDefaults(M);var F,D=this.recognizers,J=P.curRecognizer;(!J||J&&J.state&nt)&&(J=P.curRecognizer=null);for(var ne=0;ne<D.length;)F=D[ne],P.stopped!==Ct&&(!J||F==J||F.canRecognizeWith(J))?F.recognize(M):F.reset(),!J&&F.state&(De|vt|ut)&&(J=P.curRecognizer=F),ne++}},get:function(M){if(M instanceof it)return M;for(var P=this.recognizers,F=0;F<P.length;F++)if(P[F].options.event==M)return P[F];return null},add:function(M){if(f(M,"add",this))return this;var P=this.get(M.options.event);return P&&this.remove(P),this.recognizers.push(M),M.manager=this,this.touchAction.update(),M},remove:function(M){if(f(M,"remove",this))return this;if(M=this.get(M),M){var P=this.recognizers,F=S(P,M);F!==-1&&(P.splice(F,1),this.touchAction.update())}return this},on:function(M,P){if(M!==r&&P!==r){var F=this.handlers;return m(w(M),function(D){F[D]=F[D]||[],F[D].push(P)}),this}},off:function(M,P){if(M!==r){var F=this.handlers;return m(w(M),function(D){P?F[D]&&F[D].splice(S(F[D],P),1):delete F[D]}),this}},emit:function(M,P){this.options.domEvents&&Ht(M,P);var F=this.handlers[M]&&this.handlers[M].slice();if(!(!F||!F.length)){P.type=M,P.preventDefault=function(){P.srcEvent.preventDefault()};for(var D=0;D<F.length;)F[D](P),D++}},destroy:function(){this.element&&It(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function It(M,P){var F=M.element;if(F.style){var D;m(M.options.cssProps,function(J,ne){D=H(F.style,ne),P?(M.oldCssProps[D]=F.style[D],F.style[D]=J):F.style[D]=M.oldCssProps[D]||""}),P||(M.oldCssProps={})}}function Ht(M,P){var F=t.createEvent("Event");F.initEvent(M,!0,!0),F.gesture=P,P.target.dispatchEvent(F)}return h(mt,{INPUT_START:X,INPUT_MOVE:ae,INPUT_END:W,INPUT_CANCEL:te,STATE_POSSIBLE:gt,STATE_BEGAN:De,STATE_CHANGED:vt,STATE_ENDED:ut,STATE_RECOGNIZED:nt,STATE_CANCELLED:At,STATE_FAILED:Ze,DIRECTION_NONE:ee,DIRECTION_LEFT:ie,DIRECTION_RIGHT:$,DIRECTION_UP:se,DIRECTION_DOWN:re,DIRECTION_HORIZONTAL:oe,DIRECTION_VERTICAL:pe,DIRECTION_ALL:he,Manager:St,Input:Y,TouchAction:st,TouchInput:Fe,MouseInput:Be,PointerEventInput:Xe,TouchMouseInput:Ne,SingleTouchInput:ze,Recognizer:it,AttrRecognizer:Ke,Tap:Et,Pan:bt,Swipe:xt,Pinch:Tt,Rotate:Rt,Press:_t,on:T,off:_,each:m,merge:y,extend:p,assign:h,inherit:v,bindFn:g,prefixed:H}),mt}(typeof window!="undefined"?window:{},typeof document!="undefined"?document:{});function calculateThreeMouse(n,t,e){var r=t.getBoundingClientRect(),i=r.top,o=r.left,s=r.width,u=r.height;return e&&(o=o+s*e.left,i=i+u*(1-e.bottom-e.height),s=s*e.width,u=u*e.height),new THREE__namespace.Vector2((n.x-o)/s*2-1,-(n.y-i)/u*2+1)}var camera$2=new THREE__namespace.OrthographicCamera(-1,1,1,-1,0,1),geometry$5=new THREE__namespace.BufferGeometry;geometry$5.setAttribute("position",new THREE__namespace.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),geometry$5.setAttribute("uv",new THREE__namespace.Float32BufferAttribute([0,2,0,0,2,0],2));var mesh$4=new THREE__namespace.Mesh(geometry$5),scene$2=new THREE__namespace.Scene;scene$2.add(mesh$4);var DEFAULT_VERTEX_SHADER=`
1326
+ * Licensed under the MIT license */var Hammer=function(n,t,e,r){var i=["","webkit","Moz","MS","ms","o"],o=t.createElement?t.createElement("div"):r,s="function",u=Math.round,c=Math.abs,l=Date.now;function d(w,P,k){return setTimeout(g(w,k),P)}function f(w,P,k){return Array.isArray(w)?(v(w,k[P],k),!0):!1}function v(w,P,k){var V;if(w)if(w.forEach)w.forEach(P,k);else if(w.length!==r)for(V=0;V<w.length;)P.call(k,w[V],V,w),V++;else for(V in w)w.hasOwnProperty(V)&&P.call(k,w[V],V,w)}function A(w,P,k){var V="DEPRECATED METHOD: "+P+`
1327
+ `+k+` AT
1328
+ `;return function(){var X=new Error("get-stack-trace"),ie=X&&X.stack?X.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",pe=n.console&&(n.console.warn||n.console.log);return pe&&pe.call(n.console,V,ie),w.apply(this,arguments)}}var h;typeof Object.assign!="function"?h=function(P){if(P===r||P===null)throw new TypeError("Cannot convert undefined or null to object");for(var k=Object(P),V=1;V<arguments.length;V++){var X=arguments[V];if(X!==r&&X!==null)for(var ie in X)X.hasOwnProperty(ie)&&(k[ie]=X[ie])}return k}:h=Object.assign;var p=A(function(P,k,V){for(var X=Object.keys(k),ie=0;ie<X.length;)(!V||V&&P[X[ie]]===r)&&(P[X[ie]]=k[X[ie]]),ie++;return P},"extend","Use `assign`."),y=A(function(P,k){return p(P,k,!0)},"merge","Use `assign`.");function m(w,P,k){var V=P.prototype,X;X=w.prototype=Object.create(V),X.constructor=w,X._super=V,k&&h(X,k)}function g(w,P){return function(){return w.apply(P,arguments)}}function E(w,P){return typeof w==s?w.apply(P&&P[0]||r,P):w}function b(w,P){return w===r?P:w}function T(w,P,k){v(B(P),function(V){w.addEventListener(V,k,!1)})}function _(w,P,k){v(B(P),function(V){w.removeEventListener(V,k,!1)})}function S(w,P){for(;w;){if(w==P)return!0;w=w.parentNode}return!1}function R(w,P){return w.indexOf(P)>-1}function B(w){return w.trim().split(/\s+/g)}function I(w,P,k){if(w.indexOf&&!k)return w.indexOf(P);for(var V=0;V<w.length;){if(k&&w[V][k]==P||!k&&w[V]===P)return V;V++}return-1}function x(w){return Array.prototype.slice.call(w,0)}function M(w,P,k){for(var V=[],X=[],ie=0;ie<w.length;){var pe=w[ie][P];I(X,pe)<0&&V.push(w[ie]),X[ie]=pe,ie++}return V=V.sort(function(Oe,Se){return Oe[P]>Se[P]}),V}function L(w,P){for(var k,V,X=P[0].toUpperCase()+P.slice(1),ie=0;ie<i.length;){if(k=i[ie],V=k?k+X:P,V in w)return V;ie++}return r}var C=1;function H(){return C++}function F(w){var P=w.ownerDocument||w;return P.defaultView||P.parentWindow||n}var O=/mobile|tablet|ip(ad|hone|od)|android/i,G="ontouchstart"in n,Q=L(n,"PointerEvent")!==r,U=G&&O.test(navigator.userAgent),D="touch",q="pen",z="mouse",K="kinect",J=25,j=1,re=2,W=4,te=8,$=1,ne=2,ee=4,ce=8,ae=16,se=ne|ee,Ae=ce|ae,he=se|Ae,me=["x","y"],Z=["clientX","clientY"];function Y(w,P){var k=this;this.manager=w,this.callback=P,this.element=w.element,this.target=w.options.inputTarget,this.domHandler=function(V){E(w.options.enable,[w])&&k.handler(V)},this.init()}Y.prototype={handler:function(){},init:function(){this.evEl&&T(this.element,this.evEl,this.domHandler),this.evTarget&&T(this.target,this.evTarget,this.domHandler),this.evWin&&T(F(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&_(this.element,this.evEl,this.domHandler),this.evTarget&&_(this.target,this.evTarget,this.domHandler),this.evWin&&_(F(this.element),this.evWin,this.domHandler)}};function N(w){var P,k=w.options.inputClass;return k?P=k:Q?P=je:U?P=Fe:G?P=Ne:P=Be,new P(w,Ee)}function Ee(w,P,k){var V=k.pointers.length,X=k.changedPointers.length,ie=P&j&&V-X===0,pe=P&(W|te)&&V-X===0;k.isFirst=!!ie,k.isFinal=!!pe,ie&&(w.session={}),k.eventType=P,ge(w,k),w.emit("hammer.input",k),w.recognize(k),w.session.prevInput=k}function ge(w,P){var k=w.session,V=P.pointers,X=V.length;k.firstInput||(k.firstInput=fe(P)),X>1&&!k.firstMultiple?k.firstMultiple=fe(P):X===1&&(k.firstMultiple=!1);var ie=k.firstInput,pe=k.firstMultiple,Ce=pe?pe.center:ie.center,Oe=P.center=de(V);P.timeStamp=l(),P.deltaTime=P.timeStamp-ie.timeStamp,P.angle=Te(Ce,Oe),P.distance=oe(Ce,Oe),ve(k,P),P.offsetDirection=ue(P.deltaX,P.deltaY);var Se=le(P.deltaTime,P.deltaX,P.deltaY);P.overallVelocityX=Se.x,P.overallVelocityY=Se.y,P.overallVelocity=c(Se.x)>c(Se.y)?Se.x:Se.y,P.scale=pe?Ie(pe.pointers,V):1,P.rotation=pe?Re(pe.pointers,V):0,P.maxPointers=k.prevInput?P.pointers.length>k.prevInput.maxPointers?P.pointers.length:k.prevInput.maxPointers:P.pointers.length,xe(k,P);var Ye=w.element;S(P.srcEvent.target,Ye)&&(Ye=P.srcEvent.target),P.target=Ye}function ve(w,P){var k=P.center,V=w.offsetDelta||{},X=w.prevDelta||{},ie=w.prevInput||{};(P.eventType===j||ie.eventType===W)&&(X=w.prevDelta={x:ie.deltaX||0,y:ie.deltaY||0},V=w.offsetDelta={x:k.x,y:k.y}),P.deltaX=X.x+(k.x-V.x),P.deltaY=X.y+(k.y-V.y)}function xe(w,P){var k=w.lastInterval||P,V=P.timeStamp-k.timeStamp,X,ie,pe,Ce;if(P.eventType!=te&&(V>J||k.velocity===r)){var Oe=P.deltaX-k.deltaX,Se=P.deltaY-k.deltaY,Ye=le(V,Oe,Se);ie=Ye.x,pe=Ye.y,X=c(Ye.x)>c(Ye.y)?Ye.x:Ye.y,Ce=ue(Oe,Se),w.lastInterval=P}else X=k.velocity,ie=k.velocityX,pe=k.velocityY,Ce=k.direction;P.velocity=X,P.velocityX=ie,P.velocityY=pe,P.direction=Ce}function fe(w){for(var P=[],k=0;k<w.pointers.length;)P[k]={clientX:u(w.pointers[k].clientX),clientY:u(w.pointers[k].clientY)},k++;return{timeStamp:l(),pointers:P,center:de(P),deltaX:w.deltaX,deltaY:w.deltaY}}function de(w){var P=w.length;if(P===1)return{x:u(w[0].clientX),y:u(w[0].clientY)};for(var k=0,V=0,X=0;X<P;)k+=w[X].clientX,V+=w[X].clientY,X++;return{x:u(k/P),y:u(V/P)}}function le(w,P,k){return{x:P/w||0,y:k/w||0}}function ue(w,P){return w===P?$:c(w)>=c(P)?w<0?ne:ee:P<0?ce:ae}function oe(w,P,k){k||(k=me);var V=P[k[0]]-w[k[0]],X=P[k[1]]-w[k[1]];return Math.sqrt(V*V+X*X)}function Te(w,P,k){k||(k=me);var V=P[k[0]]-w[k[0]],X=P[k[1]]-w[k[1]];return Math.atan2(X,V)*180/Math.PI}function Re(w,P){return Te(P[1],P[0],Z)+Te(w[1],w[0],Z)}function Ie(w,P){return oe(P[0],P[1],Z)/oe(w[0],w[1],Z)}var lt={mousedown:j,mousemove:re,mouseup:W},ye="mousedown",we="mousemove mouseup";function Be(){this.evEl=ye,this.evWin=we,this.pressed=!1,Y.apply(this,arguments)}m(Be,Y,{handler:function(P){var k=lt[P.type];k&j&&(P.button===0||P.button===2)&&(this.pressed=!0),k&re&&P.which!==1&&(k=W),this.pressed&&(k&W&&(this.pressed=!1),this.callback(this.manager,k,{pointers:[P],changedPointers:[P],pointerType:z,srcEvent:P}))}});var Je={pointerdown:j,pointermove:re,pointerup:W,pointercancel:te,pointerout:te},ht={2:D,3:q,4:z,5:K},Xe="pointerdown",Ve="pointermove pointerup pointercancel";n.MSPointerEvent&&!n.PointerEvent&&(Xe="MSPointerDown",Ve="MSPointerMove MSPointerUp MSPointerCancel");function je(){this.evEl=Xe,this.evWin=Ve,Y.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}m(je,Y,{handler:function(P){var k=this.store,V=!1,X=!1,ie=P.type.toLowerCase().replace("ms",""),pe=Je[ie],Ce=ht[P.pointerType]||P.pointerType,Oe=Ce==D,Se=I(k,P.pointerId,"pointerId");pe&j&&(P.button===0||P.button===2||Oe)?Se<0&&(k.push(P),Se=k.length-1):pe&(W|te)?V=!0:!Oe&&P.buttons===0&&(V=!0,X=!0,pe=Je.pointerup),!(Se<0)&&(X||(k[Se]=P),this.callback(this.manager,pe,{pointers:k,changedPointers:[P],pointerType:Ce,srcEvent:k[Se]}),V&&k.splice(Se,1))}});var at={touchstart:j,touchmove:re,touchend:W,touchcancel:te},Ue="touchstart",We="touchstart touchmove touchend touchcancel";function ze(){this.evTarget=Ue,this.evWin=We,this.started=!1,Y.apply(this,arguments)}m(ze,Y,{handler:function(P){var k=at[P.type];if(k===j&&(this.started=!0),!!this.started){var V=He.call(this,P,k);k&(W|te)&&V[0].length-V[1].length===0&&(this.started=!1),this.callback(this.manager,k,{pointers:V[0],changedPointers:V[1],pointerType:D,srcEvent:P})}}});function He(w,P){var k=x(w.touches),V=x(w.changedTouches);return P&(W|te)&&(k=M(k.concat(V),"identifier")),[k,V]}var be={touchstart:j,touchmove:re,touchend:W,touchcancel:te},$e="touchstart touchmove touchend touchcancel";function Fe(){this.evTarget=$e,this.targetIds={},Y.apply(this,arguments)}m(Fe,Y,{handler:function(P){var k=be[P.type],V=et.call(this,P,k);V&&this.callback(this.manager,k,{pointers:V[0],changedPointers:V[1],pointerType:D,srcEvent:P})}});function et(w,P){var k=x(w.touches),V=this.targetIds;if(P&(j|re)&&k.length===1)return V[k[0].identifier]=!0,[k,k];var X,ie,pe=x(w.changedTouches),Ce=[],Oe=this.target;if(ie=k.filter(function(Se){return S(Se.target,Oe)}),P===j)for(X=0;X<ie.length;)V[ie[X].identifier]=!0,X++;for(X=0;X<pe.length;)V[pe[X].identifier]&&Ce.push(pe[X]),P&(W|te)&&delete V[pe[X].identifier],X++;if(Ce.length)return[M(ie.concat(Ce),"identifier"),Ce]}var tt=2500,Qe=25;function Ne(){Y.apply(this,arguments);var w=g(this.handler,this);this.touch=new Fe(this.manager,w),this.mouse=new Be(this.manager,w),this.primaryTouch=null,this.lastTouches=[]}m(Ne,Y,{handler:function(P,k,V){var X=V.pointerType==D,ie=V.pointerType==z;if(!(ie&&V.sourceCapabilities&&V.sourceCapabilities.firesTouchEvents)){if(X)rt.call(this,k,V);else if(ie&&pt.call(this,V))return;this.callback(P,k,V)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function rt(w,P){w&j?(this.primaryTouch=P.changedPointers[0].identifier,ot.call(this,P)):w&(W|te)&&ot.call(this,P)}function ot(w){var P=w.changedPointers[0];if(P.identifier===this.primaryTouch){var k={x:P.clientX,y:P.clientY};this.lastTouches.push(k);var V=this.lastTouches,X=function(){var ie=V.indexOf(k);ie>-1&&V.splice(ie,1)};setTimeout(X,tt)}}function pt(w){for(var P=w.srcEvent.clientX,k=w.srcEvent.clientY,V=0;V<this.lastTouches.length;V++){var X=this.lastTouches[V],ie=Math.abs(P-X.x),pe=Math.abs(k-X.y);if(ie<=Qe&&pe<=Qe)return!0}return!1}var ct=o?L(o.style,"touchAction"):r,dt=ct!==r,Ge="compute",Me="auto",_e="manipulation",Pe="none",ke="pan-x",Le="pan-y",qe=Pt();function st(w,P){this.manager=w,this.set(P)}st.prototype={set:function(w){w==Ge&&(w=this.compute()),dt&&this.manager.element.style&&qe[w]&&(this.manager.element.style[ct]=w),this.actions=w.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var w=[];return v(this.manager.recognizers,function(P){E(P.options.enable,[P])&&(w=w.concat(P.getTouchAction()))}),ft(w.join(" "))},preventDefaults:function(w){var P=w.srcEvent,k=w.offsetDirection;if(this.manager.session.prevented){P.preventDefault();return}var V=this.actions,X=R(V,Pe)&&!qe[Pe],ie=R(V,Le)&&!qe[Le],pe=R(V,ke)&&!qe[ke];if(X){var Ce=w.pointers.length===1,Oe=w.distance<2,Se=w.deltaTime<250;if(Ce&&Oe&&Se)return}if(!(pe&&ie)&&(X||ie&&k&se||pe&&k&Ae))return this.preventSrc(P)},preventSrc:function(w){this.manager.session.prevented=!0,w.preventDefault()}};function ft(w){if(R(w,Pe))return Pe;var P=R(w,ke),k=R(w,Le);return P&&k?Pe:P||k?P?ke:Le:R(w,_e)?_e:Me}function Pt(){if(!dt)return!1;var w={},P=n.CSS&&n.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(k){w[k]=P?n.CSS.supports("touch-action",k):!0}),w}var gt=1,De=2,vt=4,ut=8,nt=ut,At=16,Ze=32;function it(w){this.options=h({},this.defaults,w||{}),this.id=H(),this.manager=null,this.options.enable=b(this.options.enable,!0),this.state=gt,this.simultaneous={},this.requireFail=[]}it.prototype={defaults:{},set:function(w){return h(this.options,w),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(w){if(f(w,"recognizeWith",this))return this;var P=this.simultaneous;return w=yt(w,this),P[w.id]||(P[w.id]=w,w.recognizeWith(this)),this},dropRecognizeWith:function(w){return f(w,"dropRecognizeWith",this)?this:(w=yt(w,this),delete this.simultaneous[w.id],this)},requireFailure:function(w){if(f(w,"requireFailure",this))return this;var P=this.requireFail;return w=yt(w,this),I(P,w)===-1&&(P.push(w),w.requireFailure(this)),this},dropRequireFailure:function(w){if(f(w,"dropRequireFailure",this))return this;w=yt(w,this);var P=I(this.requireFail,w);return P>-1&&this.requireFail.splice(P,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(w){return!!this.simultaneous[w.id]},emit:function(w){var P=this,k=this.state;function V(X){P.manager.emit(X,w)}k<ut&&V(P.options.event+wt(k)),V(P.options.event),w.additionalEvent&&V(w.additionalEvent),k>=ut&&V(P.options.event+wt(k))},tryEmit:function(w){if(this.canEmit())return this.emit(w);this.state=Ze},canEmit:function(){for(var w=0;w<this.requireFail.length;){if(!(this.requireFail[w].state&(Ze|gt)))return!1;w++}return!0},recognize:function(w){var P=h({},w);if(!E(this.options.enable,[this,P])){this.reset(),this.state=Ze;return}this.state&(nt|At|Ze)&&(this.state=gt),this.state=this.process(P),this.state&(De|vt|ut|At)&&this.tryEmit(P)},process:function(w){},getTouchAction:function(){},reset:function(){}};function wt(w){return w&At?"cancel":w&ut?"end":w&vt?"move":w&De?"start":""}function Mt(w){return w==ae?"down":w==ce?"up":w==ne?"left":w==ee?"right":""}function yt(w,P){var k=P.manager;return k?k.get(w):w}function Ke(){it.apply(this,arguments)}m(Ke,it,{defaults:{pointers:1},attrTest:function(w){var P=this.options.pointers;return P===0||w.pointers.length===P},process:function(w){var P=this.state,k=w.eventType,V=P&(De|vt),X=this.attrTest(w);return V&&(k&te||!X)?P|At:V||X?k&W?P|ut:P&De?P|vt:De:Ze}});function bt(){Ke.apply(this,arguments),this.pX=null,this.pY=null}m(bt,Ke,{defaults:{event:"pan",threshold:10,pointers:1,direction:he},getTouchAction:function(){var w=this.options.direction,P=[];return w&se&&P.push(Le),w&Ae&&P.push(ke),P},directionTest:function(w){var P=this.options,k=!0,V=w.distance,X=w.direction,ie=w.deltaX,pe=w.deltaY;return X&P.direction||(P.direction&se?(X=ie===0?$:ie<0?ne:ee,k=ie!=this.pX,V=Math.abs(w.deltaX)):(X=pe===0?$:pe<0?ce:ae,k=pe!=this.pY,V=Math.abs(w.deltaY))),w.direction=X,k&&V>P.threshold&&X&P.direction},attrTest:function(w){return Ke.prototype.attrTest.call(this,w)&&(this.state&De||!(this.state&De)&&this.directionTest(w))},emit:function(w){this.pX=w.deltaX,this.pY=w.deltaY;var P=Mt(w.direction);P&&(w.additionalEvent=this.options.event+P),this._super.emit.call(this,w)}});function Tt(){Ke.apply(this,arguments)}m(Tt,Ke,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Pe]},attrTest:function(w){return this._super.attrTest.call(this,w)&&(Math.abs(w.scale-1)>this.options.threshold||this.state&De)},emit:function(w){if(w.scale!==1){var P=w.scale<1?"in":"out";w.additionalEvent=this.options.event+P}this._super.emit.call(this,w)}});function _t(){it.apply(this,arguments),this._timer=null,this._input=null}m(_t,it,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Me]},process:function(w){var P=this.options,k=w.pointers.length===P.pointers,V=w.distance<P.threshold,X=w.deltaTime>P.time;if(this._input=w,!V||!k||w.eventType&(W|te)&&!X)this.reset();else if(w.eventType&j)this.reset(),this._timer=d(function(){this.state=nt,this.tryEmit()},P.time,this);else if(w.eventType&W)return nt;return Ze},reset:function(){clearTimeout(this._timer)},emit:function(w){this.state===nt&&(w&&w.eventType&W?this.manager.emit(this.options.event+"up",w):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}});function xt(){Ke.apply(this,arguments)}m(xt,Ke,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Pe]},attrTest:function(w){return this._super.attrTest.call(this,w)&&(Math.abs(w.rotation)>this.options.threshold||this.state&De)}});function Rt(){Ke.apply(this,arguments)}m(Rt,Ke,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:se|Ae,pointers:1},getTouchAction:function(){return bt.prototype.getTouchAction.call(this)},attrTest:function(w){var P=this.options.direction,k;return P&(se|Ae)?k=w.overallVelocity:P&se?k=w.overallVelocityX:P&Ae&&(k=w.overallVelocityY),this._super.attrTest.call(this,w)&&P&w.offsetDirection&&w.distance>this.options.threshold&&w.maxPointers==this.options.pointers&&c(k)>this.options.velocity&&w.eventType&W},emit:function(w){var P=Mt(w.offsetDirection);P&&this.manager.emit(this.options.event+P,w),this.manager.emit(this.options.event,w)}});function Et(){it.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}m(Et,it,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[_e]},process:function(w){var P=this.options,k=w.pointers.length===P.pointers,V=w.distance<P.threshold,X=w.deltaTime<P.time;if(this.reset(),w.eventType&j&&this.count===0)return this.failTimeout();if(V&&X&&k){if(w.eventType!=W)return this.failTimeout();var ie=this.pTime?w.timeStamp-this.pTime<P.interval:!0,pe=!this.pCenter||oe(this.pCenter,w.center)<P.posThreshold;this.pTime=w.timeStamp,this.pCenter=w.center,!pe||!ie?this.count=1:this.count+=1,this._input=w;var Ce=this.count%P.taps;if(Ce===0)return this.hasRequireFailures()?(this._timer=d(function(){this.state=nt,this.tryEmit()},P.interval,this),De):nt}return Ze},failTimeout:function(){return this._timer=d(function(){this.state=Ze},this.options.interval,this),Ze},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==nt&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function mt(w,P){return P=P||{},P.recognizers=b(P.recognizers,mt.defaults.preset),new St(w,P)}mt.VERSION="2.0.7",mt.defaults={domEvents:!1,touchAction:Ge,enable:!0,inputTarget:null,inputClass:null,preset:[[xt,{enable:!1}],[Tt,{enable:!1},["rotate"]],[Rt,{direction:se}],[bt,{direction:se},["swipe"]],[Et],[Et,{event:"doubletap",taps:2},["tap"]],[_t]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Bt=1,Ct=2;function St(w,P){this.options=h({},mt.defaults,P||{}),this.options.inputTarget=this.options.inputTarget||w,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=w,this.input=N(this),this.touchAction=new st(this,this.options.touchAction),It(this,!0),v(this.options.recognizers,function(k){var V=this.add(new k[0](k[1]));k[2]&&V.recognizeWith(k[2]),k[3]&&V.requireFailure(k[3])},this)}St.prototype={set:function(w){return h(this.options,w),w.touchAction&&this.touchAction.update(),w.inputTarget&&(this.input.destroy(),this.input.target=w.inputTarget,this.input.init()),this},stop:function(w){this.session.stopped=w?Ct:Bt},recognize:function(w){var P=this.session;if(!P.stopped){this.touchAction.preventDefaults(w);var k,V=this.recognizers,X=P.curRecognizer;(!X||X&&X.state&nt)&&(X=P.curRecognizer=null);for(var ie=0;ie<V.length;)k=V[ie],P.stopped!==Ct&&(!X||k==X||k.canRecognizeWith(X))?k.recognize(w):k.reset(),!X&&k.state&(De|vt|ut)&&(X=P.curRecognizer=k),ie++}},get:function(w){if(w instanceof it)return w;for(var P=this.recognizers,k=0;k<P.length;k++)if(P[k].options.event==w)return P[k];return null},add:function(w){if(f(w,"add",this))return this;var P=this.get(w.options.event);return P&&this.remove(P),this.recognizers.push(w),w.manager=this,this.touchAction.update(),w},remove:function(w){if(f(w,"remove",this))return this;if(w=this.get(w),w){var P=this.recognizers,k=I(P,w);k!==-1&&(P.splice(k,1),this.touchAction.update())}return this},on:function(w,P){if(w!==r&&P!==r){var k=this.handlers;return v(B(w),function(V){k[V]=k[V]||[],k[V].push(P)}),this}},off:function(w,P){if(w!==r){var k=this.handlers;return v(B(w),function(V){P?k[V]&&k[V].splice(I(k[V],P),1):delete k[V]}),this}},emit:function(w,P){this.options.domEvents&&Ht(w,P);var k=this.handlers[w]&&this.handlers[w].slice();if(!(!k||!k.length)){P.type=w,P.preventDefault=function(){P.srcEvent.preventDefault()};for(var V=0;V<k.length;)k[V](P),V++}},destroy:function(){this.element&&It(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function It(w,P){var k=w.element;if(k.style){var V;v(w.options.cssProps,function(X,ie){V=L(k.style,ie),P?(w.oldCssProps[V]=k.style[V],k.style[V]=X):k.style[V]=w.oldCssProps[V]||""}),P||(w.oldCssProps={})}}function Ht(w,P){var k=t.createEvent("Event");k.initEvent(w,!0,!0),k.gesture=P,P.target.dispatchEvent(k)}return h(mt,{INPUT_START:j,INPUT_MOVE:re,INPUT_END:W,INPUT_CANCEL:te,STATE_POSSIBLE:gt,STATE_BEGAN:De,STATE_CHANGED:vt,STATE_ENDED:ut,STATE_RECOGNIZED:nt,STATE_CANCELLED:At,STATE_FAILED:Ze,DIRECTION_NONE:$,DIRECTION_LEFT:ne,DIRECTION_RIGHT:ee,DIRECTION_UP:ce,DIRECTION_DOWN:ae,DIRECTION_HORIZONTAL:se,DIRECTION_VERTICAL:Ae,DIRECTION_ALL:he,Manager:St,Input:Y,TouchAction:st,TouchInput:Fe,MouseInput:Be,PointerEventInput:je,TouchMouseInput:Ne,SingleTouchInput:ze,Recognizer:it,AttrRecognizer:Ke,Tap:Et,Pan:bt,Swipe:Rt,Pinch:Tt,Rotate:xt,Press:_t,on:T,off:_,each:v,merge:y,extend:p,assign:h,inherit:m,bindFn:g,prefixed:L}),mt}(typeof window!="undefined"?window:{},typeof document!="undefined"?document:{});function calculateThreeMouse(n,t,e){var r=t.getBoundingClientRect(),i=r.top,o=r.left,s=r.width,u=r.height;return e&&(o=o+s*e.left,i=i+u*(1-e.bottom-e.height),s=s*e.width,u=u*e.height),new THREE__namespace.Vector2((n.x-o)/s*2-1,-(n.y-i)/u*2+1)}var camera$2=new THREE__namespace.OrthographicCamera(-1,1,1,-1,0,1),geometry$5=new THREE__namespace.BufferGeometry;geometry$5.setAttribute("position",new THREE__namespace.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),geometry$5.setAttribute("uv",new THREE__namespace.Float32BufferAttribute([0,2,0,0,2,0],2));var mesh$4=new THREE__namespace.Mesh(geometry$5),scene$2=new THREE__namespace.Scene;scene$2.add(mesh$4);var DEFAULT_VERTEX_SHADER=`
1329
1329
  varying vec2 vUv;
1330
1330
  void main() {
1331
1331
  vUv = uv;
@@ -1366,7 +1366,7 @@ void main() {
1366
1366
 
1367
1367
  gl_Position = projectionMatrix * mvPosition;
1368
1368
  }
1369
- `,camera$1=new THREE__namespace.OrthographicCamera(-1,1,1,-1,0,1),geometry$4=new THREE__namespace.BufferGeometry;geometry$4.setAttribute("position",new THREE__namespace.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),geometry$4.setAttribute("uv",new THREE__namespace.Float32BufferAttribute([0,2,0,0,2,0],2));var noneMaterial=new THREE__namespace.MeshBasicMaterial,mesh$3=new THREE__namespace.Mesh(geometry$4,noneMaterial),scene$1=new THREE__namespace.Scene;scene$1.add(mesh$3);var DepthCopyPass=function(){function n(t){this.renderer=t,this.material=new THREE__namespace.ShaderMaterial({vertexShader:VERTEX,fragmentShader:FRAGMENT$1,uniforms:Object.assign({depthBuffer:new THREE__namespace.Uniform(null)}),blending:THREE__namespace.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,mesh$3.material=this.material,this.renderer.setRenderTarget(e||null),this.renderer.render(scene$1,camera$1),this.renderer.setRenderTarget(r),mesh$3.material=noneMaterial},n.prototype.dispose=function(){this.material.dispose()},n}(),sharedVector2$1=new THREE__namespace.Vector2,BaseController=function(n){__extends(t,n);function t(e){var r,i,o,s,u,l,c=n.call(this)||this,d=t.parseArgs(e);c.mode="",c.pending=new Set,c.userAction=d.initial.userAction,c.destroyed=!1,c.ident=d.ident,c.scene=d.scene,c.xrCustomObjectsScene=d.xrCustomObjectsScene,c.helper=d.helper,c.boundingMesh=d.boundingMesh,c.camera=d.camera,c.renderer=d.renderer,c.scissor=d.scissor,c.element=d.element,c.models=d.models,c.enableWheel=d.enableWheel,c.enableIOSEDR=(r=d.enableIOSEDR)!==null&&r!==void 0?r:!1,c.enableEDL=(i=d.enableEDL)!==null&&i!==void 0?i:!0,c.enableHQ=(o=d.enableHQ)!==null&&o!==void 0?o:!0,c.works=d.works,c.imageOptions=d.imageOptions,c.videoTexture=d.videoTexture,c.extraElements=d.extraElements,c.initial=d.initial,c.currentPano=typeof c.initial.state.panoIndex=="number"?{workCode:(l=(s=c.initial.state.workCode)!==null&&s!==void 0?s:(u=d.works[0])===null||u===void 0?void 0:u.workCode)!==null&&l!==void 0?l:"",panoIndex:c.initial.state.panoIndex}:{workCode:c.initial.currentState.workCode,panoIndex:c.initial.currentState.panoIndex},c.needsRender=!0,c.modelSceneNeedsRender=!0,c.cameraMotion=new Motion({longitude:{value:c.camera.pose.longitude,circle:[0,Math.PI*2]},latitude:c.camera.pose.latitude,fov:c.camera.pose.fov}),c.inMomentumMovement=null,c.eventUnbinds=[d.element].concat(d.extraElements||[]).map(function(m){return c.bindEvents(m)}),c.pending.add("init-animation"),c.initAnimationReady=new Promise(function(m){AnimationFrameLoop.shared.add(function(){c.initAnimation().then(function(){c.pending.delete("init-animation"),m()})},!0)}),c.initAnimationIsReady=!1,c.initAnimationReady.then(function(){return c.initAnimationIsReady=!0}),c.modelScene=d.modelScene;var f=new THREE__namespace.Vector2;return c.renderer.getDrawingBufferSize(f),c.modelRenderTarget=d.modelRenderTarget,c.copyPass=new CopyPass(c.renderer),c.depthCopyPass=new DepthCopyPass(c.renderer),c.screenBuffers=[],c.lastPostProcessingType=null,c}return t.parseArgs=function(e){return e instanceof t?e:__assign({},e)},t.initAnimationEndState=function(e){var r,i,o,s,u,l,c,d,f=this.parseArgs(e),m=f.initial,A=m.state,h=m.currentState,p=typeof A.panoIndex=="number"?{workCode:(o=(r=A.workCode)!==null&&r!==void 0?r:(i=f.works[0])===null||i===void 0?void 0:i.workCode)!==null&&o!==void 0?o:"",panoIndex:A.panoIndex}:{workCode:h.workCode,panoIndex:h.panoIndex};return __assign(__assign({},p),{mode:"",longitude:(s=A.longitude)!==null&&s!==void 0?s:h.longitude,latitude:(u=A.latitude)!==null&&u!==void 0?u:h.latitude,fov:(l=A.fov)!==null&&l!==void 0?l:h.fov,offset:(c=A.offset)!==null&&c!==void 0?c:h.offset,distance:(d=A.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 o=i[r];o()}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 o=i[r];if(o.element===e)return}this.eventUnbinds.push(this.bindEvents(e))},t.prototype.unbindExtraElement=function(e){for(var r=[],i=0,o=this.eventUnbinds;i<o.length;i++){var s=o[i];s.element===e?s():r.push(s)}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,o){return this.works=e,this.userAction=o,!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),isEmptyObject(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 o=this;return this.initAnimationReady.then(function(){o.userAction=i,o.stopMomentumMovement();var s={};return e.longitude!==void 0&&(s.longitude=e.longitude),e.latitude!==void 0&&(s.latitude=e.latitude),e.fov!==void 0&&(s.fov=e.fov),o.cameraMotion.set(s,r).catch(noop$1)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var o=this;return this.initAnimationReady.then(function(){o.userAction=i,o.stopMomentumMovement();for(var s=[],u=0,l=e;u<l.length;u++){var c=l[u];s.push({key:c.key,progress:c.progress,value:{longitude:c.value.longitude,latitude:c.value.latitude,fov:c.value.fov}})}return o.cameraMotion.setKeyframes(s,r)})},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(now())[1];return __assign(__assign({},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",createEvent("initAnimation.start",{state:i,userAction:this.userAction})),this.emit("initAnimation.end",createEvent("initAnimation.end",{state:i,userAction:this.userAction})),Promise.resolve()},t.prototype.setCamera=function(e){var r,i,o,s,u;e===void 0&&(e={});var l=(r=e.longitude)!==null&&r!==void 0?r:this.camera.pose.longitude,c=(i=e.latitude)!==null&&i!==void 0?i:this.camera.pose.latitude,d=(o=e.fov)!==null&&o!==void 0?o:this.camera.pose.fov,f=(s=e.distance)!==null&&s!==void 0?s:this.camera.pose.distance,m=(u=e.offset)!==null&&u!==void 0?u:this.camera.pose.offset,A=notSimilarValue(l,this.camera.pose.longitude,Math.PI*2)||notSimilarValue(c,this.camera.pose.latitude),h=notSimilarValue(d,this.camera.pose.fov),p=notSimilarValue(f,this.camera.pose.distance),y=notSimilarVector3(m,this.camera.pose.offset);(h||A||y||p)&&(this.camera.setFromPose({longitude:l,latitude:c,fov:d,distance:f,offset:m}),this.emit("camera.update",createEvent("camera.update",{userAction:this.userAction,state:__assign(__assign({},this.currentPano),{mode:this.mode,longitude:l,latitude:c,fov:d,offset:m,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=createEvent("gesture.momentum",__assign(__assign({},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 calculateThreeMouse(e,this.element,this.scissor)},t.prototype.bindEvents=function(e){var r=this,i=function(R){var w=calculateThreeMouse(R,r.element,r.scissor);return!(Math.abs(w.x)>1||Math.abs(w.y)>1)},o=new Hammer.Manager(e),s=function(R){var w=R.session;return w.firstInput||null};o.add(new Hammer.Pan({threshold:10,pointers:0})),o.add(new Hammer.Tap({interval:410})),o.add(new Hammer.Pinch({threshold:0,pointers:2})),o.on("panstart pan",function(R){var w=s(o);if(!(w&&!i(w.center))){var S=createEvent("gesture.pan",{target:R.target,pointerType:R.pointerType,srcEvent:R.srcEvent,pointers:R.pointers.map(function(C){var I=r.relativeClientPosition(C),H=new THREE__namespace.Raycaster;return H.params.Points={threshold:.1},H.setFromCamera(I,r.camera),{x:C.x,y:C.y,delta:0,buttons:0,coords:I,raycaster:H}}),isFirst:R.isFirst,isFinal:R.isFinal,scale:R.scale,center:function(C){var I=r.relativeClientPosition(C),H=new THREE__namespace.Raycaster;return H.params.Points={threshold:.1},H.setFromCamera(I,r.camera),{x:C.x,y:C.y,delta:0,buttons:0,coords:I,raycaster:H}}(R.center),velocityX:R.velocityX,velocityY:R.velocityY,overallVelocityX:R.overallVelocityX,overallVelocityY:R.overallVelocityY,userAction:!0,state:__assign(__assign({mode:r.mode},r.currentPano),clonePose(r.camera.pose))});r.onPanGesture(S),y()}}),o.on("tap",function(R){if(!(R.pointerType==="mouse"&&R.srcEvent.button!==0)){var w=s(o);if(!(w&&!i(w.center))){var S=createEvent("gesture.tap",{target:R.target,pointerType:R.pointerType,srcEvent:R.srcEvent,pointers:R.pointers.map(function(C){var I=r.relativeClientPosition(C),H=new THREE__namespace.Raycaster;return H.params.Points={threshold:.1},H.setFromCamera(I,r.camera),{x:C.x,y:C.y,delta:0,buttons:0,coords:I,raycaster:H}}),isFirst:!0,isFinal:!0,scale:R.scale,center:function(C){var I=r.relativeClientPosition(C),H=new THREE__namespace.Raycaster;return H.params.Points={threshold:.1},H.setFromCamera(I,r.camera),{x:C.x,y:C.y,delta:0,buttons:0,coords:I,raycaster:H}}(R.center),velocityX:R.velocityX,velocityY:R.velocityY,overallVelocityX:R.overallVelocityX,overallVelocityY:R.overallVelocityY,userAction:!0,state:__assign(__assign({mode:r.mode},r.currentPano),clonePose(r.camera.pose))});r.onTapGesture(S),y()}}}),o.on("pinchstart pinch pinchend",function(R){var w=s(o);if(!(w&&!i(w.center))){var S=createEvent("gesture.pinch",{target:R.target,pointerType:R.pointerType,srcEvent:R.srcEvent,pointers:R.pointers.map(function(C){var I,H=r.relativeClientPosition(C),B=new THREE__namespace.Raycaster;return B.params.Points={threshold:.1},B.setFromCamera(H,r.camera),{x:C.x,y:C.y,delta:(I=C.delta)!==null&&I!==void 0?I:0,buttons:0,coords:H,raycaster:B}}),isFirst:R.type==="pinchstart",isFinal:R.type==="pinchend",scale:R.scale,center:function(C){var I=r.relativeClientPosition(C),H=new THREE__namespace.Raycaster;return H.params.Points={threshold:.1},H.setFromCamera(I,r.camera),{x:C.x,y:C.y,delta:0,buttons:0,coords:I,raycaster:H}}(R.center),velocityX:R.velocityX,velocityY:R.velocityY,overallVelocityX:R.overallVelocityX,overallVelocityY:R.overallVelocityY,userAction:!0,state:__assign(__assign({mode:r.mode},r.currentPano),clonePose(r.camera.pose))});r.onPinchGesture(S),y()}});var u=null,l=null,c=function(R,w,S){var C={x:S.clientX,y:S.clientY},I=r.relativeClientPosition(C),H=new THREE__namespace.Raycaster;H.params.Points={threshold:.1},H.setFromCamera(I,r.camera);var B=__assign(__assign({},C),{coords:I,raycaster:H,buttons:S.buttons,delta:0}),L=R==="pinchend"?w:w-S.deltaY/280,O=createEvent("gesture.pinch",{target:S.target,pointerType:"mouse",srcEvent:S,pointers:[__assign({},B)],isFirst:R==="pinchstart",isFinal:R==="pinchend",scale:clamp$1(L,.1,10),center:__assign({},B),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:__assign(__assign({mode:r.mode},r.currentPano),clonePose(r.camera.pose))});return O},d=function(R){var w,S={x:R.clientX,y:R.clientY};if(i(S)){if(R.preventDefault(),R.ctrlKey){var C=(w=u==null?void 0:u.prevEvent.scale)!==null&&w!==void 0?w:1,I=c(u?"pinch":"pinchstart",C,R);u===null?u={firstEvent:I,prevEvent:I}:u.prevEvent=I,r.onPinchGesture(I),l!==null&&window.clearTimeout(l),l=window.setTimeout(function(){var z;l=null;var N=(z=u==null?void 0:u.prevEvent.scale)!==null&&z!==void 0?z:1,U=c("pinchend",N,R);u=null,r.onPinchGesture(U)},200)}else{var H=(Math.abs(R.deltaY)>Math.abs(R.deltaX)?R.deltaY:R.deltaX)/-60,B=r.mouseWheelState!==void 0,L={x:R.clientX,y:R.clientY},O=r.relativeClientPosition(L),k=new THREE__namespace.Raycaster;k.params.Points={threshold:.1},k.setFromCamera(O,r.camera);var K=__assign(__assign({},L),{coords:O,raycaster:k,buttons:R.buttons,delta:H}),I=createEvent("gesture.mousewheel",{target:R.target,pointerType:"mouse",srcEvent:R,pointers:[__assign({},K)],isFirst:B,isFinal:!1,scale:0,center:__assign({},K),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:__assign(__assign({mode:r.mode},r.currentPano),clonePose(r.camera.pose))});r.onMouseWheel(I),r.mouseWheelState&&clearTimeout(r.mouseWheelState.timer),r.mouseWheelState={timer:setTimeout(function(){delete r.mouseWheelState;var N=createEvent("gesture.mousewheel",{target:R.target,pointerType:"mouse",srcEvent:R,pointers:[__assign(__assign({},K),{delta:0})],isFirst:!1,isFinal:!0,scale:0,center:__assign(__assign({},K),{delta:0}),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:__assign(__assign({mode:r.mode},r.currentPano),clonePose(r.camera.pose))});r.onMouseWheel(N)},100)}}y()}},f=function(R){if(!isMobile()){if(!i({x:R.clientX,y:R.clientY})){m();return}var w=!1;r.mouseMoveState||(w=!0);var S={x:R.clientX,y:R.clientY},C=r.relativeClientPosition(S),I=new THREE__namespace.Raycaster;I.params.Points={threshold:.1},I.setFromCamera(C,r.camera);var H=__assign(__assign({},S),{coords:C,raycaster:I,buttons:R.buttons,delta:0}),B=createEvent("gesture.mousemove",{target:R.target,pointerType:"mouse",srcEvent:R,pointers:[__assign({},H)],isFirst:w,isFinal:!1,scale:0,center:__assign({},H),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:__assign(__assign({mode:r.mode},r.currentPano),clonePose(r.camera.pose))});r.mouseMoveState={timeStamp:now(),event:B},r.onMouseMove(B),r.pressState&&Math.abs(R.clientX-r.pressState.event.center.y)>10&&Math.abs(R.clientY-r.pressState.event.center.y)>10&&y()}},m=function(){if(r.mouseMoveState){var R=createEvent(r.mouseMoveState.event.type,__assign(__assign({},r.mouseMoveState.event),{isFinal:!0}));delete r.mouseMoveState,r.onMouseMove(R)}y()},A=function(R){if(!i(R.center)){y();return}var w=!1;r.pressState||(w=!0,r.pressState={event:R,timeStamp:now(),stop:noop$1});var S=now()-r.pressState.timeStamp,C=createEvent(r.pressState.event.type,__assign(__assign({},r.pressState.event),{isFirst:w,isFinal:!1,center:__assign(__assign({},r.pressState.event.center),{delta:S}),pointers:r.pressState.event.pointers.map(function(I){return __assign(__assign({},I),{delta:S})})}));r.onPressGesture(C),r.pressState&&(r.pressState.stop=AnimationFrameLoop.shared.add(function(I){A(R)},!0,1))},h=function(R){if(y(),!(R.touches.length>1||R.changedTouches.length<=0)){var w={x:R.changedTouches[0].clientX,y:R.changedTouches[0].clientY},S=r.relativeClientPosition(w),C=new THREE__namespace.Raycaster;C.params.Points={threshold:.1},C.setFromCamera(S,r.camera);var I=__assign(__assign({},w),{coords:S,raycaster:C,buttons:0,delta:0}),H=createEvent("gesture.press",{target:R.target,pointerType:"touch",srcEvent:R,pointers:[__assign({},I)],isFirst:!1,isFinal:!1,scale:0,center:I,velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:__assign(__assign({mode:r.mode},r.currentPano),clonePose(r.camera.pose))});A(H)}},p=function(R){y();var w={x:R.clientX,y:R.clientY},S=r.relativeClientPosition(w),C=new THREE__namespace.Raycaster;C.params.Points={threshold:.1},C.setFromCamera(S,r.camera);var I=__assign(__assign({},w),{coords:S,raycaster:C,buttons:R.buttons,delta:0}),H=createEvent("gesture.press",{target:R.target,pointerType:"mouse",srcEvent:R,pointers:[__assign({},I)],isFirst:!1,isFinal:!1,scale:0,center:I,velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:__assign(__assign({mode:r.mode},r.currentPano),clonePose(r.camera.pose))});A(H)},y=function(){var R;if(r.pressState){var w=now()-r.pressState.timeStamp,S=createEvent(r.pressState.event.type,__assign(__assign({},r.pressState.event),{center:__assign(__assign({},r.pressState.event.center),{delta:w}),isFirst:!1,isFinal:!0,pointers:r.pressState.event.pointers.map(function(C){return __assign(__assign({},C),{delta:w})})}));r.onPressGesture(S),(R=r.pressState)===null||R===void 0||R.stop(),delete r.pressState}},v=null,g=function(R){var w,S=!1,C=!1;switch(R.type){case"gesturestart":S=!0;break;case"gestureend":C=!0;break}var I={x:R.clientX,y:R.clientY},H=r.relativeClientPosition(I),B=new THREE__namespace.Raycaster;B.params.Points={threshold:.1},B.setFromCamera(H,r.camera);var L=__assign(__assign({},I),{coords:H,raycaster:B,buttons:0,delta:0}),O=createEvent("gesture.pinch",{target:R.target,pointerType:"mouse",srcEvent:R,pointers:[__assign({},L)],isFirst:S,isFinal:C,scale:(w=R.scale)!==null&&w!==void 0?w:1,center:__assign({},L),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:__assign(__assign({mode:r.mode},r.currentPano),clonePose(r.camera.pose))});return O},E=function(R){if(R.preventDefault(),!isMobile()){var w=g(R);v={firstEvent:w};var S=v.firstEvent;S&&!i(S.center)||r.onPinchGesture(w)}},b=function(R){if(R.preventDefault(),!isMobile()&&v){var w=g(R),S=v.firstEvent;S&&!i(S.center)||r.onPinchGesture(w)}},T=function(R){if(R.preventDefault(),!isMobile()&&v){var w=g(R),S=v.firstEvent;v=null,!(S&&!i(S.center))&&r.onPinchGesture(w)}},_=function(R){if(R&&typeof R.preventDefault=="function"&&R.currentTarget===e&&R.preventDefault(),typeof getSelection=="function"){var w=getSelection();w&&w.focusNode&&(w.removeAllRanges&&w.removeAllRanges(),w.empty&&w.empty())}};this.enableWheel&&e.addEventListener("wheel",d,{passive:!1}),e.addEventListener("mousemove",f,!1),e.addEventListener("mouseout",m,!1),e.addEventListener("touchstart",h,{passive:!0}),e.addEventListener("touchend",y,!1),e.addEventListener("touchcancel",y,!1),e.addEventListener("mousedown",p,!1),e.addEventListener("mouseup",y,!1),e.addEventListener("gesturestart",E,{passive:!1}),e.addEventListener("gesturechange",b,{passive:!1}),e.addEventListener("gestureend",T,{passive:!1}),e.addEventListener("touchstart",_,{passive:!1}),e.addEventListener("contextmenu",_,!1);var x=function(){o.destroy(),e.removeEventListener("wheel",d,!1),e.removeEventListener("mousemove",f,!1),e.removeEventListener("mouseout",m,!1),e.removeEventListener("touchstart",h,!1),e.removeEventListener("touchend",y,!1),e.removeEventListener("touchcancel",y,!1),e.removeEventListener("mousedown",p,!1),e.removeEventListener("mouseup",y,!1),e.removeEventListener("gesturestart",E,!1),e.removeEventListener("gesturechange",b,!1),e.removeEventListener("gestureend",T,!1),e.removeEventListener("touchstart",_,!1),e.removeEventListener("contextmenu",_,!1)};return Object.assign(x,{element:e})},t.prototype.preloadPano=function(e,r){var i=this;r===void 0&&(r=noop$1);var o=this.works.getResolvedObserver(e);if(!o)return Promise.resolve();var s=["right","left","up","down","front","back"];return Promise.all(s.map(function(u){var l=__assign({key:"pano.".concat(panoStringify(e),".").concat(u)},pick(i.imageOptions,["size","format","quality","mappings"])),c=o.images[u],d=applyImageURLOptions(c,i.imageOptions.transform,l);return getFetcher(o.work).preload(d)})).then(function(){return r(e),e})},t.prototype.updateScreenBuffer=function(e){var r,i,o,s,u,l;if(this.lastPostProcessingType!==e)if(this.lastPostProcessingType=e,e==="luminance"){if(this.screenBuffers.length===0){var c=this.renderer.getDrawingBufferSize(sharedVector2$1);this.screenBuffers=[new THREE__namespace.WebGLRenderTarget(c.x,c.y,{generateMipmaps:!1,encoding:(i=(r=this.renderer)===null||r===void 0?void 0:r.outputEncoding)!==null&&i!==void 0?i:THREE__namespace.sRGBEncoding}),this.modelRenderTarget]}}else if(e==="edl"){if(this.screenBuffers.length===0){var c=this.renderer.getDrawingBufferSize(sharedVector2$1);this.screenBuffers=[new THREE__namespace.WebGLRenderTarget(c.x,c.y,{generateMipmaps:!1,encoding:(s=(o=this.renderer)===null||o===void 0?void 0:o.outputEncoding)!==null&&s!==void 0?s:THREE__namespace.sRGBEncoding,minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,format:THREE__namespace.RGBAFormat,type:THREE__namespace.FloatType}),this.modelRenderTarget]}this.models.setMaterial({useEDL:!0})}else if(e==="hq"){if(this.screenBuffers.length===0){var c=this.renderer.getDrawingBufferSize(sharedVector2$1),d=new THREE__namespace.WebGLRenderTarget(c.x,c.y,{generateMipmaps:!1,minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,format:THREE__namespace.RGBAFormat,type:THREE__namespace.FloatType,depthTexture:new THREE__namespace.DepthTexture(c.x,c.y,THREE__namespace.UnsignedIntType)});d.depthTexture.format=THREE__namespace.DepthFormat,d.depthBuffer=!0;var f=new THREE__namespace.WebGLRenderTarget(c.x,c.y,{generateMipmaps:!1,encoding:(l=(u=this.renderer)===null||u===void 0?void 0:u.outputEncoding)!==null&&l!==void 0?l:THREE__namespace.sRGBEncoding,minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,format:THREE__namespace.RGBAFormat,type:THREE__namespace.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(m){m.dispose()}),this.screenBuffers=[]),this.models.setMaterial({useEDL:!1,useHQDepth:!1,useHQWeight:!1})},t}(Subscribe),FloorplanController=function(n){__extends(t,n);function t(e){var r=this,i,o=t.parseArgs(e);return r=n.call(this,o)||this,r.mode="Floorplan",r.defaultLongitude=o.defaultLongitude,r.defaultLatitude=o.defaultLatitude,r.defaultFov=o.defaultFov,r.maxFov=o.maxFov,r.minFov=o.minFov,r.maxLatitude=o.maxLatitude,r.minLatitude=o.minLatitude,r.modelInScreen=o.modelInScreen,r.locationMotion=new Motion({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 Motion({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new Motion({perspToOrtho:r.camera.perspToOrtho.x}),r.currentTapId=null,r.intersectMeshCreator=o.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 o=e.bounding,s=Math.pow(Math.pow(o.max.x-o.min.x+1,2)+Math.pow(o.max.y-o.min.y+1,2)+Math.pow(o.max.z-o.min.z+1,2),1/2),u=s/2/Math.tan(Math.PI*r/360);return i<1&&(u=u/i),isNaN(u)?s:u},t.parseArgs=function(e){var r,i,o,s,u,l,c,d,f;if(e instanceof t)return e;var m=n.parseArgs.call(this,e);return __assign(__assign({},m),{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:(o=e.defaultFov)!==null&&o!==void 0?o:80,maxFov:(s=e.maxFov)!==null&&s!==void 0?s:120,minFov:(u=e.minFov)!==null&&u!==void 0?u:20,maxLatitude:(l=e.maxLatitude)!==null&&l!==void 0?l:+Math.PI/2,minLatitude:(c=e.minLatitude)!==null&&c!==void 0?c:-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 IntersectMesh}})},t.initAnimationEndState=function(e){var r,i,o,s,u,l,c,d=this.parseArgs(e),f=e.initial,m=f.state,A=f.currentState,h=typeof m.panoIndex=="number"?{workCode:(o=(r=m.workCode)!==null&&r!==void 0?r:(i=d.works[0])===null||i===void 0?void 0:i.workCode)!==null&&o!==void 0?o:"",panoIndex:m.panoIndex}:{workCode:A.workCode,panoIndex:A.panoIndex},p=__assign(__assign({},h),{mode:"Floorplan",longitude:(s=m.longitude)!==null&&s!==void 0?s:isThirdPersonMode(A.mode)?A.longitude:d.defaultLongitude,latitude:clamp$1((u=m.latitude)!==null&&u!==void 0?u:A.mode==="Floorplan"?A.latitude:d.defaultLatitude,d.minLatitude,d.maxLatitude),fov:(l=m.fov)!==null&&l!==void 0?l:d.defaultFov,offset:m.offset?m.offset.clone():e.models.bounding.getCenter(new THREE__namespace.Vector3),distance:(c=m.distance)!==null&&c!==void 0?c:t.distanceFromModel(d.models,d.defaultFov,d.camera.aspect)});return p},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,o){var s;return this.works=e,this.updateCamera(r,(s=i.duration)!==null&&s!==void 0?s:0,o),!0},t.prototype.updateModel=function(e){n.prototype.updateModel.call(this,e);var r=e.bounding.getCenter(new THREE__namespace.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(noop$1)},t.prototype.updateCamera=function(e,r,i){var o=this;return this.initAnimationReady.then(function(){o.userAction=i,o.stopMomentumMovement();var s={},u={};return e.distance!==void 0&&(s.distance=e.distance),e.offset!==void 0&&(s.x=e.offset.x,s.y=e.offset.y,s.z=e.offset.z),e.longitude!==void 0&&(u.longitude=e.longitude),e.latitude!==void 0&&(u.latitude=e.latitude),e.fov!==void 0&&(u.fov=e.fov),o.locationMotion.set(s,r).catch(noop$1),o.cameraMotion.set(u,r).catch(noop$1)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var o=this;return this.initAnimationReady.then(function(){o.userAction=i,o.stopMomentumMovement();for(var s=[],u=[],l=0,c=e;l<c.length;l++){var d=c[l];s.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}}),u.push({key:d.key,progress:d.progress,value:{longitude:d.value.longitude,latitude:d.value.latitude,fov:d.value.fov}})}return o.locationMotion.setKeyframes(s,r).catch(noop$1),o.cameraMotion.setKeyframes(e,r)})},t.prototype.updateTime=function(e,r){if(!this.destroyed){var i={},o={};this.modelAlphaMotion.ended||(this.modelAlphaMotion.update(e),i.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended||(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(clamp$1(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended||(this.locationMotion.update(e),o.distance=this.locationMotion.value.distance,o.offset=new THREE__namespace.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z)),this.cameraMotion.ended||(this.cameraMotion.update(e),o.longitude=this.cameraMotion.value.longitude,o.latitude=this.cameraMotion.value.latitude,o.fov=this.cameraMotion.value.fov),isEmptyObject(i)||this.models.setMaterial(i),isEmptyObject(o)||this.setCamera(o)}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(now())[1],r=this.locationMotion.getKeyFrameSegment(now())[1];return __assign(__assign({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:new THREE__namespace.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 o=i.duration,s=i.userAction;e.userAction=s;var u=t.initAnimationEndState(e),l=pick(u,["longitude","latitude","fov"]),c={x:u.offset.x,y:u.offset.y,z:u.offset.z,distance:u.distance},d={modelAlpha:1},f={perspToOrtho:0};e.emit("initAnimation.start",createEvent("initAnimation.start",{state:u,userAction:e.userAction})),e.modelAlphaMotion.set(d,o/3).catch(noop$1),e.perspToOrthoMotion.set(f,o).catch(noop$1),e.cameraMotion.set(l,o).catch(noop$1),e.locationMotion.set(c,o).then(function(){e.emit("initAnimation.end",createEvent("initAnimation.end",{state:u,userAction:e.userAction}))},function(m){var A=__assign(__assign(__assign({},e.currentPano),{mode:e.mode}),clonePose(e.camera.pose));e.emit("initAnimation.end",createEvent("initAnimation.end",{state:A,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)})},t.prototype.getForwardObserverOrNot=function(e){var r=this.models.intersectRaycaster(e)[0];if(!r)return null;var i=this.works.resolvedObservers,o=arrayMin(i,function(l){return l.standingPosition.distanceTo(r.point)},!0),s=o[0],u=o[1];return s&&u<10?s:null},t.prototype.coordinatesForOffset=function(e){var r=this.renderer.getSize(new THREE__namespace.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,o){var s=this;if(this.inMomentumMovement!==null){for(var u=__assign({},i),l={longitude:0,latitude:0},c=0;c<o;c++)u.longitude*=.996,u.latitude*=.996*.998,l.longitude+=u.longitude,l.latitude+=u.latitude;var d=formatRad(this.cameraMotion.value.longitude+l.longitude),f=clamp$1(this.cameraMotion.value.latitude+l.latitude,this.minLatitude,this.maxLatitude),m=__assign(__assign({},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}),A=!(u.longitude>1e-4||u.longitude<-1e-4||u.latitude>1e-4||u.latitude<-1e-4),h=createEvent("gesture.momentum",__assign(__assign({},e),{isFirst:r,isFinal:A,state:m}));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(noop$1),A?this.inMomentumMovement=null:AnimationFrameLoop.shared.add(function(p,y){s.requestMomentumMovement(e,!1,u,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 o={x:e.center.x-r.x,y:e.center.y-r.y},s=this.relativeClientPosition(e.center),u=this.camera.pose.latitude<Math.PI/6||s.y<0?1:-1;o.x*=u;var l=this.coordinatesForOffset(o),c=formatRad(this.cameraMotion.value.longitude+l.longitude),d=clamp$1(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=__assign(__assign({},this.currentPano),{mode:this.mode,longitude:c,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(noop$1),e.isFinal)){var m=e.velocityX*u,A=e.velocityY;this.inMomentumMovement={uuid:createUuid()},this.requestMomentumMovement(e,!0,this.coordinatesForOffset({x:m,y:A}),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 o=clamp$1(i/e.scale,this.minFov,this.maxFov);e.state.fov=o,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:o},0).catch(noop$1),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 o=e.center.raycaster;if(e.isFinal&&this.intersectMesh.parent&&this.intersectMesh.visible===!0){this.hideIntersectMesh();return}var s=this.models.intersectRaycaster(o)[0],u=createEvent("intersect.update",{raycaster:o,intersection:s!=null?s:null,object:this.intersectMesh});if(this.emit("intersect.update",u),u.defaultPrevented){this.hideIntersectMesh();return}if(s){var l=(i=(r=s.face)===null||r===void 0?void 0:r.normal)!==null&&i!==void 0?i:new THREE__namespace.Vector3().copy(o.ray.direction).multiplyScalar(-1),c=l.clone(),d=s.point.clone();this.intersectMesh.position.copy(d);var f=o.ray.origin.distanceTo(d),m=2*Math.tan(.5*this.camera.fov/180*Math.PI),A=Math.max(f*m/10,1);this.intersectMesh.scale.set(A,A,A);var h=d.clone().add(c);if(this.intersectMesh.lookAt(h),Math.abs(l.y)>.99){var p=this.camera.position.clone().sub(d);this.intersectMesh.rotation.z=-Math.atan2(p.z,p.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,o=r.maxFov,s=clamp$1(this.camera.fov-e.center.delta,i,o);e.state.fov=s,this.emit("gesture.mousewheel",e),!e.defaultPrevented&&this.cameraMotion.set({fov:s},0).catch(noop$1)}},t.prototype.onTapGesture=function(e){var r=this;this.userAction=!0,this.stopMomentumMovement();var i=e.center.raycaster,o=this.getForwardObserverOrNot(i);if(!o)this.emit("gesture.tap",e);else{var s={longitude:this.camera.pose.longitude,latitude:0},u=__assign(__assign({},e.state),{mode:"Panorama",workCode:o.pano.workCode,panoIndex:o.pano.panoIndex,longitude:s.longitude,latitude:s.latitude,offset:o?o.position.clone():new THREE__namespace.Vector3,distance:0});if(e.state=u,this.emit("gesture.tap",e),!e.defaultPrevented&&(this.emit("pano.select",createEvent("pano.select",{prevPano:this.currentPano,state:u,userAction:e.userAction,options:s,progress:0,error:null})),o&&o.active)){var l=this.currentTapId=createUuid();this.preloadPano(o.pano).then(function(c){r.currentTapId===l&&r.emit("pano.request",createEvent("pano.request",{userAction:!0,prevPano:r.currentPano,progress:0,state:u,options:s,error:null}))})}}},t.prototype.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.needsRender=!0},t}(BaseController),TopviewController=function(n){__extends(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=__assign(__assign({},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 __assign(__assign({},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 THREE__namespace.Vector3);this.locationMotion.set({x:r.x,y:r.y,z:r.z,distance:FloorplanController.distanceFromModel(this.models,this.defaultFov,this.camera.aspect)},0).catch(noop$1)},t.prototype.updateCamera=function(e,r,i){var o=this;return this.initAnimationReady.then(function(){o.userAction=i,o.stopMomentumMovement();var s={},u={};return e.distance!==void 0&&(s.distance=e.distance),e.offset!==void 0&&(s.x=e.offset.x,s.y=e.offset.y,s.z=e.offset.z),e.longitude!==void 0&&(u.longitude=e.longitude),e.latitude!==void 0&&(u.latitude=e.latitude),e.fov!==void 0&&(u.fov=e.fov),o.locationMotion.set(s,r).catch(noop$1),o.cameraMotion.set(u,r).catch(noop$1)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var o=this;return this.initAnimationReady.then(function(){o.userAction=i,o.stopMomentumMovement();for(var s=[],u=[],l=0,c=e;l<c.length;l++){var d=c[l];s.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}}),u.push({key:d.key,progress:d.progress,value:{longitude:d.value.longitude,latitude:d.value.latitude,fov:d.value.fov}})}return o.locationMotion.setKeyframes(s,r).catch(noop$1),o.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 o=i.duration,s=i.userAction;e.userAction=s;var u=t.initAnimationEndState(e),l={longitude:u.longitude,latitude:u.latitude,fov:u.fov},c={x:u.offset.x,y:u.offset.y,z:u.offset.z,distance:u.distance},d={modelAlpha:1},f={perspToOrtho:1};e.emit("initAnimation.start",createEvent("initAnimation.start",{state:u,userAction:e.userAction})),e.modelAlphaMotion.set(d,o/3).catch(noop$1),e.perspToOrthoMotion.set(f,o).catch(noop$1),e.cameraMotion.set(l,o).catch(noop$1),e.locationMotion.set(c,o).then(function(){e.emit("initAnimation.end",createEvent("initAnimation.end",{state:u,userAction:e.userAction}))},function(m){var A=__assign(__assign(__assign({},e.currentPano),{mode:e.mode}),clonePose(e.camera.pose));e.emit("initAnimation.end",createEvent("initAnimation.end",{state:A,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 o={x:e.center.x-r.x,y:e.center.y-r.y},s=new THREE__namespace.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),u=this.locationMotion.value.distance;u*=Math.tan(this.cameraMotion.value.fov/2*Math.PI/180);var l=this.renderer.getSize(new THREE__namespace.Vector2),c=2*o.x*u/l.y,d=2*o.y*u/l.y,f=new THREE__namespace.Vector3;f.setFromMatrixColumn(this.camera.matrix,0),f.multiplyScalar(-c),s.add(f),f.setFromMatrixColumn(this.camera.matrix,0),f.crossVectors(this.camera.up,f),f.multiplyScalar(d),s.add(f),this.modelInScreen==="boundingbox-center"&&s.clamp(this.models.bounding.min,this.models.bounding.max);var m=__assign(__assign({},this.currentPano),{mode:this.mode,longitude:0,latitude:Math.PI/2,fov:this.cameraMotion.value.fov,offset:s,distance:this.locationMotion.value.distance});e.state=m,this.emit("gesture.pan",e),!e.defaultPrevented&&this.locationMotion.set({x:s.x,y:s.y,z:s.z},0).catch(noop$1)}},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 o=clamp$1(i/e.scale,this.minFov,this.maxFov);e.state.fov=o,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:o},0).catch(noop$1),e.type="gesture.pan",this.onPanGesture(e))}}},t.prototype.onMouseWheel=function(e){if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement();var r=clamp$1(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(noop$1)}},t}(FloorplanController),PanoramaLikeController=function(n){__extends(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,o,s,u,l,c,d;if(e instanceof t)return e;var f=n.parseArgs.call(this,e);return __assign(__assign({},f),{defaultLatitude:(r=e.defaultLatitude)!==null&&r!==void 0?r:0,defaultFov:(i=e.defaultFov)!==null&&i!==void 0?i:90,maxFov:(o=e.maxFov)!==null&&o!==void 0?o:120,minFov:(s=e.minFov)!==null&&s!==void 0?s:40,maxLatitude:(u=e.maxLatitude)!==null&&u!==void 0?u:+Math.PI/2,minLatitude:(l=e.minLatitude)!==null&&l!==void 0?l:-Math.PI/2,moveSpeed:(c=e.moveSpeed)!==null&&c!==void 0?c:3.4,intersectMeshCreator:(d=e.intersectMeshCreator)!==null&&d!==void 0?d:function(){return new IntersectMesh}})},t.initAnimationEndState=function(e){var r,i,o,s,u,l,c=this.parseArgs(e),d=c.works,f=e.initial,m=f.state,A=f.currentState,h=typeof m.panoIndex=="number"?{workCode:(o=(r=m.workCode)!==null&&r!==void 0?r:(i=c.works[0])===null||i===void 0?void 0:i.workCode)!==null&&o!==void 0?o:"",panoIndex:m.panoIndex}:{workCode:A.workCode,panoIndex:A.panoIndex},p=d.getResolvedObserver(h),y=(s=m.longitude)!==null&&s!==void 0?s:A.longitude,v=clamp$1((u=m.latitude)!==null&&u!==void 0?u:isFristPersonMode(A.mode)?A.latitude:c.defaultLatitude,c.minLatitude,c.maxLatitude),g=clamp$1((l=m.fov)!==null&&l!==void 0?l:isFristPersonMode(A.mode)?A.fov:c.defaultFov,c.minFov,c.maxFov),E=p?p.position.clone():new THREE__namespace.Vector3;return{workCode:h.workCode,panoIndex:h.panoIndex,mode:"PanoramaLike",longitude:y,latitude:v,fov:g,offset:E,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 clamp$1(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,o=this.renderer.getSize(new THREE__namespace.Vector2);return{longitude:2*e.x/(o.x*this.scissor.width)*r/95*i,latitude:-2*e.y/(o.y*this.scissor.height)*r/95}},t.prototype.cameraBounce=function(){var e=this.cameraMotion.value,r=e.longitude,i=e.latitude,o=e.fov,s=[{progress:0,value:{longitude:r,latitude:i,fov:o}},{progress:.5,value:{longitude:r,latitude:i,fov:o*.98}},{progress:1,value:{longitude:r,latitude:i,fov:o}}];this.cameraMotion.setKeyframes(s,500).catch(noop$1)},t.prototype.requestMomentumMovement=function(e,r,i,o){var s=this;if(this.inMomentumMovement!==null){for(var u=__assign({},i),l={longitude:0,latitude:0},c=0;c<o;c++)u.longitude*=.996,u.latitude*=.996*.99,l.longitude+=u.longitude,l.latitude+=u.latitude;var d=formatRad(this.cameraMotion.value.longitude+l.longitude),f=clamp$1(this.cameraMotion.value.latitude+l.latitude,this.minLatitude,this.maxLatitude),m=__assign(__assign({},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}),A=!(u.longitude>1e-4||u.longitude<-1e-4||u.latitude>1e-4||u.latitude<-1e-4),h=createEvent("gesture.momentum",__assign(__assign({},e),{isFirst:r,isFinal:A,state:m}));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(noop$1),A?this.inMomentumMovement=null:AnimationFrameLoop.shared.add(function(p,y){s.requestMomentumMovement(e,!1,u,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 o={x:e.center.x-r.x,y:e.center.y-r.y},s=this.coordinatesForOffset(o),u=formatRad(this.cameraMotion.value.longitude+s.longitude),l=clamp$1(this.cameraMotion.value.latitude+s.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 c=__assign(__assign({},this.currentPano),{mode:this.mode,longitude:u,latitude:l,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance});if(e.state=c,this.emit("gesture.pan",e),!e.defaultPrevented){var d={longitude:c.longitude,latitude:c.latitude,fov:c.fov};if(this.cameraMotion.set(d,0).catch(noop$1),e.isFinal){var f=e.velocityX,m=e.velocityY*.6;Math.abs(m)>.5&&Math.abs(f)<.5&&(f=0),this.inMomentumMovement={uuid:createUuid()},this.requestMomentumMovement(e,!0,this.coordinatesForOffset({x:f,y:m}),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,o=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 s=clamp$1(i/o,this.minFov,this.maxFov);e.state.fov=s,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:s},0).catch(noop$1),e.type="gesture.pan",this.onPanGesture(e))}},t.prototype.onMouseWheel=function(e){this.userAction=e.userAction,this.stopMomentumMovement();var r=clamp$1(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(noop$1),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 o=e.center.raycaster;if(e.isFinal&&this.intersectMesh.parent){this.hideIntersectMesh();return}var s=this.models.intersectRaycaster(o)[0],u=createEvent("intersect.update",{raycaster:o,intersection:s!=null?s:null,object:this.intersectMesh});if(this.emit("intersect.update",u),u.defaultPrevented){this.hideIntersectMesh();return}if(s){var l=(i=(r=s.face)===null||r===void 0?void 0:r.normal)!==null&&i!==void 0?i:new THREE__namespace.Vector3().copy(o.ray.direction).multiplyScalar(-1),c=l.clone(),d=s.point.clone();this.intersectMesh.position.copy(d);var f=d.clone().add(c);if(this.intersectMesh.lookAt(f),Math.abs(l.y)>.99){var m=this.camera.position.clone().sub(d);this.intersectMesh.rotation.z=-Math.atan2(m.z,m.x)}this.intersectMesh.visible=!0,this.needsRender=!0}else this.hideIntersectMesh()}},t}(BaseController),blankVideo="data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGBf//rdxF6b3m2Ui3lizYINkj7u94MjY0IC0gY29yZSAxNDIgcjIgOTU2YzhkOCAtIEguMjY0L01QRUctNCBBVkMgY29kZWMgLSBDb3B5bGVmdCAyMDAzLTIwMTQgLSBodHRwOi8vd3d3LnZpZGVvbGFuLm9yZy94MjY0Lmh0bWwgLSBvcHRpb25zOiBjYWJhYz0wIHJlZj0zIGRlYmxvY2s9MTowOjAgYW5hbHlzZT0weDE6MHgxMTEgbWU9aGV4IHN1Ym1lPTcgcHN5PTEgcHN5X3JkPTEuMDA6MC4wMCBtaXhlZF9yZWY9MSBtZV9yYW5nZT0xNiBjaHJvbWFfbWU9MSB0cmVsbGlzPTEgOHg4ZGN0PTAgY3FtPTAgZGVhZHpvbmU9MjEsMTEgZmFzdF9wc2tpcD0xIGNocm9tYV9xcF9vZmZzZXQ9LTIgdGhyZWFkcz02IGxvb2thaGVhZF90aHJlYWRzPTEgc2xpY2VkX3RocmVhZHM9MCBucj0wIGRlY2ltYXRlPTEgaW50ZXJsYWNlZD0wIGJsdXJheV9jb21wYXQ9MCBjb25zdHJhaW5lZF9pbnRyYT0wIGJmcmFtZXM9MCB3ZWlnaHRwPTAga2V5aW50PTI1MCBrZXlpbnRfbWluPTI1IHNjZW5lY3V0PTQwIGludHJhX3JlZnJ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AAAAEAAAABAAAABwAAAAIAAAABAAAACAAAAAEAAAABAAAACQAAAAIAAAABAAAACgAAAAEAAAABAAAACwAAAAIAAAABAAAADQAAAAEAAAABAAAADgAAAAIAAAABAAAADwAAAAEAAAABAAAAEAAAAAIAAAABAAAAEQAAAAEAAAABAAAAEgAAAAIAAAABAAAAFAAAAAEAAAABAAAAFQAAAAIAAAABAAAAFgAAAAEAAAABAAAAFwAAAAIAAAABAAAAGAAAAAEAAAABAAAAGQAAAAIAAAABAAAAGgAAAAEAAAABAAAAGwAAAAIAAAABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw",result;function canplayVideo(){return result||(result=new Promise(function(n){var t,e=document.createElement("video");e.muted=!0,e.src=blankVideo,e.addEventListener("timeupdate",function r(){e.removeEventListener("timeupdate",r,!1),clearTimeout(t);var i=document.createElement("canvas");i.width=i.height=1;var o=i.getContext("2d");if(!o){n(!1);return}o.drawImage(e,0,0,1,1);var s=o.getImageData(0,0,1,1).data;s[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 FRAGMENT=`
1369
+ `,camera$1=new THREE__namespace.OrthographicCamera(-1,1,1,-1,0,1),geometry$4=new THREE__namespace.BufferGeometry;geometry$4.setAttribute("position",new THREE__namespace.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),geometry$4.setAttribute("uv",new THREE__namespace.Float32BufferAttribute([0,2,0,0,2,0],2));var noneMaterial=new THREE__namespace.MeshBasicMaterial,mesh$3=new THREE__namespace.Mesh(geometry$4,noneMaterial),scene$1=new THREE__namespace.Scene;scene$1.add(mesh$3);var DepthCopyPass=function(){function n(t){this.renderer=t,this.material=new THREE__namespace.ShaderMaterial({vertexShader:VERTEX,fragmentShader:FRAGMENT$1,uniforms:Object.assign({depthBuffer:new THREE__namespace.Uniform(null)}),blending:THREE__namespace.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,mesh$3.material=this.material,this.renderer.setRenderTarget(e||null),this.renderer.render(scene$1,camera$1),this.renderer.setRenderTarget(r),mesh$3.material=noneMaterial},n.prototype.dispose=function(){this.material.dispose()},n}(),sharedVector2$1=new THREE__namespace.Vector2,BaseController=function(n){__extends(t,n);function t(e){var r,i,o,s,u,c,l=n.call(this)||this,d=t.parseArgs(e);l.mode="",l.pending=new Set,l.userAction=d.initial.userAction,l.destroyed=!1,l.ident=d.ident,l.scene=d.scene,l.xrCustomObjectsScene=d.xrCustomObjectsScene,l.helper=d.helper,l.boundingMesh=d.boundingMesh,l.camera=d.camera,l.renderer=d.renderer,l.scissor=d.scissor,l.element=d.element,l.models=d.models,l.enableWheel=d.enableWheel,l.enableIOSEDR=(r=d.enableIOSEDR)!==null&&r!==void 0?r:!1,l.enableEDL=(i=d.enableEDL)!==null&&i!==void 0?i:!0,l.enableHQ=(o=d.enableHQ)!==null&&o!==void 0?o:!0,l.works=d.works,l.imageOptions=d.imageOptions,l.videoTexture=d.videoTexture,l.extraElements=d.extraElements,l.initial=d.initial,l.currentPano=typeof l.initial.state.panoIndex=="number"?{workCode:(c=(s=l.initial.state.workCode)!==null&&s!==void 0?s:(u=d.works[0])===null||u===void 0?void 0:u.workCode)!==null&&c!==void 0?c:"",panoIndex:l.initial.state.panoIndex}:{workCode:l.initial.currentState.workCode,panoIndex:l.initial.currentState.panoIndex},l.needsRender=!0,l.modelSceneNeedsRender=!0,l.cameraMotion=new Motion({longitude:{value:l.camera.pose.longitude,circle:[0,Math.PI*2]},latitude:l.camera.pose.latitude,fov:l.camera.pose.fov}),l.inMomentumMovement=null,l.eventUnbinds=[d.element].concat(d.extraElements||[]).map(function(v){return l.bindEvents(v)}),l.pending.add("init-animation"),l.initAnimationReady=new Promise(function(v){AnimationFrameLoop.shared.add(function(){l.initAnimation().then(function(){l.pending.delete("init-animation"),v()})},!0)}),l.initAnimationIsReady=!1,l.initAnimationReady.then(function(){return l.initAnimationIsReady=!0}),l.modelScene=d.modelScene;var f=new THREE__namespace.Vector2;return l.renderer.getDrawingBufferSize(f),l.modelRenderTarget=d.modelRenderTarget,l.copyPass=new CopyPass(l.renderer),l.depthCopyPass=new DepthCopyPass(l.renderer),l.screenBuffers=[],l.lastPostProcessingType=null,l}return t.parseArgs=function(e){return e instanceof t?e:__assign({},e)},t.initAnimationEndState=function(e){var r,i,o,s,u,c,l,d,f=this.parseArgs(e),v=f.initial,A=v.state,h=v.currentState,p=typeof A.panoIndex=="number"?{workCode:(o=(r=A.workCode)!==null&&r!==void 0?r:(i=f.works[0])===null||i===void 0?void 0:i.workCode)!==null&&o!==void 0?o:"",panoIndex:A.panoIndex}:{workCode:h.workCode,panoIndex:h.panoIndex};return __assign(__assign({},p),{mode:"",longitude:(s=A.longitude)!==null&&s!==void 0?s:h.longitude,latitude:(u=A.latitude)!==null&&u!==void 0?u:h.latitude,fov:(c=A.fov)!==null&&c!==void 0?c:h.fov,offset:(l=A.offset)!==null&&l!==void 0?l:h.offset,distance:(d=A.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 o=i[r];o()}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 o=i[r];if(o.element===e)return}this.eventUnbinds.push(this.bindEvents(e))},t.prototype.unbindExtraElement=function(e){for(var r=[],i=0,o=this.eventUnbinds;i<o.length;i++){var s=o[i];s.element===e?s():r.push(s)}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,o){return this.works=e,this.userAction=o,!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),isEmptyObject(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 o=this;return this.initAnimationReady.then(function(){o.userAction=i,o.stopMomentumMovement();var s={};return e.longitude!==void 0&&(s.longitude=e.longitude),e.latitude!==void 0&&(s.latitude=e.latitude),e.fov!==void 0&&(s.fov=e.fov),o.cameraMotion.set(s,r).catch(noop$1)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var o=this;return this.initAnimationReady.then(function(){o.userAction=i,o.stopMomentumMovement();for(var s=[],u=0,c=e;u<c.length;u++){var l=c[u];s.push({key:l.key,progress:l.progress,value:{longitude:l.value.longitude,latitude:l.value.latitude,fov:l.value.fov}})}return o.cameraMotion.setKeyframes(s,r)})},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(now())[1];return __assign(__assign({},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",createEvent("initAnimation.start",{state:i,userAction:this.userAction})),this.emit("initAnimation.end",createEvent("initAnimation.end",{state:i,userAction:this.userAction})),Promise.resolve()},t.prototype.setCamera=function(e){var r,i,o,s,u;e===void 0&&(e={});var c=(r=e.longitude)!==null&&r!==void 0?r:this.camera.pose.longitude,l=(i=e.latitude)!==null&&i!==void 0?i:this.camera.pose.latitude,d=(o=e.fov)!==null&&o!==void 0?o:this.camera.pose.fov,f=(s=e.distance)!==null&&s!==void 0?s:this.camera.pose.distance,v=(u=e.offset)!==null&&u!==void 0?u:this.camera.pose.offset,A=notSimilarValue(c,this.camera.pose.longitude,Math.PI*2)||notSimilarValue(l,this.camera.pose.latitude),h=notSimilarValue(d,this.camera.pose.fov),p=notSimilarValue(f,this.camera.pose.distance),y=notSimilarVector3(v,this.camera.pose.offset);(h||A||y||p)&&(this.camera.setFromPose({longitude:c,latitude:l,fov:d,distance:f,offset:v}),this.emit("camera.update",createEvent("camera.update",{userAction:this.userAction,state:__assign(__assign({},this.currentPano),{mode:this.mode,longitude:c,latitude:l,fov:d,offset:v,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=createEvent("gesture.momentum",__assign(__assign({},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.onDblTapGesture=function(e){this.stopMomentumMovement(),this.emit("gesture.dbltap",e),!e.defaultPrevented&&(e.type="gesture.tap",this.onTapGesture(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 calculateThreeMouse(e,this.element,this.scissor)},t.prototype.bindEvents=function(e){var r=this,i=function(x){var M=calculateThreeMouse(x,r.element,r.scissor);return!(Math.abs(M.x)>1||Math.abs(M.y)>1)},o=new Hammer.Manager(e),s=function(x){var M=x.session;return M.firstInput||null},u=new Hammer.Pan({threshold:10,pointers:0}),c=new Hammer.Tap({interval:410}),l=new Hammer.Pinch({threshold:0,pointers:2});o.add([u,c,l]),o.on("panstart pan",function(x){var M=s(o);if(!(M&&!i(M.center))){var L=createEvent("gesture.pan",{target:x.target,pointerType:x.pointerType,srcEvent:x.srcEvent,pointers:x.pointers.map(function(C){var H=r.relativeClientPosition(C),F=new THREE__namespace.Raycaster;return F.params.Points={threshold:.1},F.setFromCamera(H,r.camera),{x:C.x,y:C.y,delta:0,buttons:0,coords:H,raycaster:F}}),isFirst:x.isFirst,isFinal:x.isFinal,scale:x.scale,center:function(C){var H=r.relativeClientPosition(C),F=new THREE__namespace.Raycaster;return F.params.Points={threshold:.1},F.setFromCamera(H,r.camera),{x:C.x,y:C.y,delta:0,buttons:0,coords:H,raycaster:F}}(x.center),velocityX:x.velocityX,velocityY:x.velocityY,overallVelocityX:x.overallVelocityX,overallVelocityY:x.overallVelocityY,userAction:!0,state:__assign(__assign({mode:r.mode},r.currentPano),clonePose(r.camera.pose))});r.onPanGesture(L),E()}}),o.on("tap",function(x){if(!(x.pointerType==="mouse"&&x.srcEvent.button!==0)){var M=s(o);if(!(M&&!i(M.center))){var L=createEvent("gesture.tap",{target:x.target,pointerType:x.pointerType,srcEvent:x.srcEvent,pointers:x.pointers.map(function(C){var H=r.relativeClientPosition(C),F=new THREE__namespace.Raycaster;return F.params.Points={threshold:.1},F.setFromCamera(H,r.camera),{x:C.x,y:C.y,delta:0,buttons:0,coords:H,raycaster:F}}),isFirst:!0,isFinal:!0,scale:x.scale,center:function(C){var H=r.relativeClientPosition(C),F=new THREE__namespace.Raycaster;return F.params.Points={threshold:.1},F.setFromCamera(H,r.camera),{x:C.x,y:C.y,delta:0,buttons:0,coords:H,raycaster:F}}(x.center),velocityX:x.velocityX,velocityY:x.velocityY,overallVelocityX:x.overallVelocityX,overallVelocityY:x.overallVelocityY,userAction:!0,state:__assign(__assign({mode:r.mode},r.currentPano),clonePose(r.camera.pose))});r.onTapGesture(L),E()}}}),o.on("pinchstart pinch pinchend",function(x){var M=s(o);if(!(M&&!i(M.center))){var L=createEvent("gesture.pinch",{target:x.target,pointerType:x.pointerType,srcEvent:x.srcEvent,pointers:x.pointers.map(function(C){var H,F=r.relativeClientPosition(C),O=new THREE__namespace.Raycaster;return O.params.Points={threshold:.1},O.setFromCamera(F,r.camera),{x:C.x,y:C.y,delta:(H=C.delta)!==null&&H!==void 0?H:0,buttons:0,coords:F,raycaster:O}}),isFirst:x.type==="pinchstart",isFinal:x.type==="pinchend",scale:x.scale,center:function(C){var H=r.relativeClientPosition(C),F=new THREE__namespace.Raycaster;return F.params.Points={threshold:.1},F.setFromCamera(H,r.camera),{x:C.x,y:C.y,delta:0,buttons:0,coords:H,raycaster:F}}(x.center),velocityX:x.velocityX,velocityY:x.velocityY,overallVelocityX:x.overallVelocityX,overallVelocityY:x.overallVelocityY,userAction:!0,state:__assign(__assign({mode:r.mode},r.currentPano),clonePose(r.camera.pose))});r.onPinchGesture(L),E()}}),o.on("dbltap",function(x){if(!(x.pointerType==="mouse"&&x.srcEvent.button!==0)){var M=s(o);if(!(M&&!i(M.center))){var L=createEvent("gesture.dbltap",{target:x.target,pointerType:x.pointerType,srcEvent:x.srcEvent,pointers:x.pointers.map(function(C){var H=r.relativeClientPosition(C),F=new THREE__namespace.Raycaster;return F.params.Points={threshold:.1},F.setFromCamera(H,r.camera),{x:C.x,y:C.y,delta:0,buttons:0,coords:H,raycaster:F}}),isFirst:!0,isFinal:!0,scale:x.scale,center:function(C){var H=r.relativeClientPosition(C),F=new THREE__namespace.Raycaster;return F.params.Points={threshold:.1},F.setFromCamera(H,r.camera),{x:C.x,y:C.y,delta:0,buttons:0,coords:H,raycaster:F}}(x.center),velocityX:x.velocityX,velocityY:x.velocityY,overallVelocityX:x.overallVelocityX,overallVelocityY:x.overallVelocityY,userAction:!0,state:__assign(__assign({mode:r.mode},r.currentPano),clonePose(r.camera.pose))});r.onDblTapGesture(L),E()}}});var d=null,f=null,v=function(x,M,L){var C={x:L.clientX,y:L.clientY},H=r.relativeClientPosition(C),F=new THREE__namespace.Raycaster;F.params.Points={threshold:.1},F.setFromCamera(H,r.camera);var O=__assign(__assign({},C),{coords:H,raycaster:F,buttons:L.buttons,delta:0}),G=x==="pinchend"?M:M-L.deltaY/280,Q=createEvent("gesture.pinch",{target:L.target,pointerType:"mouse",srcEvent:L,pointers:[__assign({},O)],isFirst:x==="pinchstart",isFinal:x==="pinchend",scale:clamp$1(G,.1,10),center:__assign({},O),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:__assign(__assign({mode:r.mode},r.currentPano),clonePose(r.camera.pose))});return Q},A=function(x){var M,L={x:x.clientX,y:x.clientY};if(i(L)){if(x.preventDefault(),x.ctrlKey){var C=(M=d==null?void 0:d.prevEvent.scale)!==null&&M!==void 0?M:1,H=v(d?"pinch":"pinchstart",C,x);d===null?d={firstEvent:H,prevEvent:H}:d.prevEvent=H,r.onPinchGesture(H),f!==null&&window.clearTimeout(f),f=window.setTimeout(function(){var q;f=null;var z=(q=d==null?void 0:d.prevEvent.scale)!==null&&q!==void 0?q:1,K=v("pinchend",z,x);d=null,r.onPinchGesture(K)},200)}else{var F=(Math.abs(x.deltaY)>Math.abs(x.deltaX)?x.deltaY:x.deltaX)/-60,O=r.mouseWheelState!==void 0,G={x:x.clientX,y:x.clientY},Q=r.relativeClientPosition(G),U=new THREE__namespace.Raycaster;U.params.Points={threshold:.1},U.setFromCamera(Q,r.camera);var D=__assign(__assign({},G),{coords:Q,raycaster:U,buttons:x.buttons,delta:F}),H=createEvent("gesture.mousewheel",{target:x.target,pointerType:"mouse",srcEvent:x,pointers:[__assign({},D)],isFirst:O,isFinal:!1,scale:0,center:__assign({},D),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:__assign(__assign({mode:r.mode},r.currentPano),clonePose(r.camera.pose))});r.onMouseWheel(H),r.mouseWheelState&&clearTimeout(r.mouseWheelState.timer),r.mouseWheelState={timer:setTimeout(function(){delete r.mouseWheelState;var z=createEvent("gesture.mousewheel",{target:x.target,pointerType:"mouse",srcEvent:x,pointers:[__assign(__assign({},D),{delta:0})],isFirst:!1,isFinal:!0,scale:0,center:__assign(__assign({},D),{delta:0}),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:__assign(__assign({mode:r.mode},r.currentPano),clonePose(r.camera.pose))});r.onMouseWheel(z)},100)}}E()}},h=function(x){if(!isMobile){if(!i({x:x.clientX,y:x.clientY})){p();return}var M=!1;r.mouseMoveState||(M=!0);var L={x:x.clientX,y:x.clientY},C=r.relativeClientPosition(L),H=new THREE__namespace.Raycaster;H.params.Points={threshold:.1},H.setFromCamera(C,r.camera);var F=__assign(__assign({},L),{coords:C,raycaster:H,buttons:x.buttons,delta:0}),O=createEvent("gesture.mousemove",{target:x.target,pointerType:"mouse",srcEvent:x,pointers:[__assign({},F)],isFirst:M,isFinal:!1,scale:0,center:__assign({},F),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:__assign(__assign({mode:r.mode},r.currentPano),clonePose(r.camera.pose))});r.mouseMoveState={timeStamp:now(),event:O},r.onMouseMove(O),r.pressState&&Math.abs(x.clientX-r.pressState.event.center.y)>10&&Math.abs(x.clientY-r.pressState.event.center.y)>10&&E()}},p=function(){if(r.mouseMoveState){var x=createEvent(r.mouseMoveState.event.type,__assign(__assign({},r.mouseMoveState.event),{isFinal:!0}));delete r.mouseMoveState,r.onMouseMove(x)}E()},y=function(x){if(!i(x.center)){E();return}var M=!1;r.pressState||(M=!0,r.pressState={event:x,timeStamp:now(),stop:noop$1});var L=now()-r.pressState.timeStamp,C=createEvent(r.pressState.event.type,__assign(__assign({},r.pressState.event),{isFirst:M,isFinal:!1,center:__assign(__assign({},r.pressState.event.center),{delta:L}),pointers:r.pressState.event.pointers.map(function(H){return __assign(__assign({},H),{delta:L})})}));r.onPressGesture(C),r.pressState&&(r.pressState.stop=AnimationFrameLoop.shared.add(function(H){y(x)},!0,1))},m=function(x){if(E(),!(x.touches.length>1||x.changedTouches.length<=0)){var M={x:x.changedTouches[0].clientX,y:x.changedTouches[0].clientY},L=r.relativeClientPosition(M),C=new THREE__namespace.Raycaster;C.params.Points={threshold:.1},C.setFromCamera(L,r.camera);var H=__assign(__assign({},M),{coords:L,raycaster:C,buttons:0,delta:0}),F=createEvent("gesture.press",{target:x.target,pointerType:"touch",srcEvent:x,pointers:[__assign({},H)],isFirst:!1,isFinal:!1,scale:0,center:H,velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:__assign(__assign({mode:r.mode},r.currentPano),clonePose(r.camera.pose))});y(F)}},g=function(x){E();var M={x:x.clientX,y:x.clientY},L=r.relativeClientPosition(M),C=new THREE__namespace.Raycaster;C.params.Points={threshold:.1},C.setFromCamera(L,r.camera);var H=__assign(__assign({},M),{coords:L,raycaster:C,buttons:x.buttons,delta:0}),F=createEvent("gesture.press",{target:x.target,pointerType:"mouse",srcEvent:x,pointers:[__assign({},H)],isFirst:!1,isFinal:!1,scale:0,center:H,velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:__assign(__assign({mode:r.mode},r.currentPano),clonePose(r.camera.pose))});y(F)},E=function(){var x;if(r.pressState){var M=now()-r.pressState.timeStamp,L=createEvent(r.pressState.event.type,__assign(__assign({},r.pressState.event),{center:__assign(__assign({},r.pressState.event.center),{delta:M}),isFirst:!1,isFinal:!0,pointers:r.pressState.event.pointers.map(function(C){return __assign(__assign({},C),{delta:M})})}));r.onPressGesture(L),(x=r.pressState)===null||x===void 0||x.stop(),delete r.pressState}},b=null,T=function(x){var M,L=!1,C=!1;switch(x.type){case"gesturestart":L=!0;break;case"gestureend":C=!0;break}var H={x:x.clientX,y:x.clientY},F=r.relativeClientPosition(H),O=new THREE__namespace.Raycaster;O.params.Points={threshold:.1},O.setFromCamera(F,r.camera);var G=__assign(__assign({},H),{coords:F,raycaster:O,buttons:0,delta:0}),Q=createEvent("gesture.pinch",{target:x.target,pointerType:"mouse",srcEvent:x,pointers:[__assign({},G)],isFirst:L,isFinal:C,scale:(M=x.scale)!==null&&M!==void 0?M:1,center:__assign({},G),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:__assign(__assign({mode:r.mode},r.currentPano),clonePose(r.camera.pose))});return Q},_=function(x){if(x.preventDefault(),!isMobile){var M=T(x);b={firstEvent:M};var L=b.firstEvent;L&&!i(L.center)||r.onPinchGesture(M)}},S=function(x){if(x.preventDefault(),!isMobile&&b){var M=T(x),L=b.firstEvent;L&&!i(L.center)||r.onPinchGesture(M)}},R=function(x){if(x.preventDefault(),!isMobile&&b){var M=T(x),L=b.firstEvent;b=null,!(L&&!i(L.center))&&r.onPinchGesture(M)}},B=function(x){if(x&&typeof x.preventDefault=="function"&&x.currentTarget===e&&x.preventDefault(),typeof getSelection=="function"){var M=getSelection();M&&M.focusNode&&(M.removeAllRanges&&M.removeAllRanges(),M.empty&&M.empty())}};this.enableWheel&&e.addEventListener("wheel",A,{passive:!1}),e.addEventListener("mousemove",h,!1),e.addEventListener("mouseout",p,!1),e.addEventListener("touchstart",m,{passive:!0}),e.addEventListener("touchend",E,!1),e.addEventListener("touchcancel",E,!1),e.addEventListener("mousedown",g,!1),e.addEventListener("mouseup",E,!1),e.addEventListener("gesturestart",_,{passive:!1}),e.addEventListener("gesturechange",S,{passive:!1}),e.addEventListener("gestureend",R,{passive:!1}),e.addEventListener("touchstart",B,{passive:!1}),e.addEventListener("contextmenu",B,!1);var I=function(){o.destroy(),e.removeEventListener("wheel",A,!1),e.removeEventListener("mousemove",h,!1),e.removeEventListener("mouseout",p,!1),e.removeEventListener("touchstart",m,!1),e.removeEventListener("touchend",E,!1),e.removeEventListener("touchcancel",E,!1),e.removeEventListener("mousedown",g,!1),e.removeEventListener("mouseup",E,!1),e.removeEventListener("gesturestart",_,!1),e.removeEventListener("gesturechange",S,!1),e.removeEventListener("gestureend",R,!1),e.removeEventListener("touchstart",B,!1),e.removeEventListener("contextmenu",B,!1)};return Object.assign(I,{element:e})},t.prototype.preloadPano=function(e,r){var i=this;r===void 0&&(r=noop$1);var o=this.works.getResolvedObserver(e);if(!o)return Promise.resolve();var s=["right","left","up","down","front","back"];return Promise.all(s.map(function(u){var c=__assign({key:"pano.".concat(panoStringify(e),".").concat(u)},pick(i.imageOptions,["size","format","quality","mappings"])),l=o.images[u],d=applyImageURLOptions(l,i.imageOptions.transform,c);return getFetcher(o.work).preload(d)})).then(function(){return r(e),e})},t.prototype.updateScreenBuffer=function(e){var r,i,o,s,u,c;if(this.lastPostProcessingType!==e)if(this.lastPostProcessingType=e,e==="luminance"){if(this.screenBuffers.length===0){var l=this.renderer.getDrawingBufferSize(sharedVector2$1);this.screenBuffers=[new THREE__namespace.WebGLRenderTarget(l.x,l.y,{generateMipmaps:!1,encoding:(i=(r=this.renderer)===null||r===void 0?void 0:r.outputEncoding)!==null&&i!==void 0?i:THREE__namespace.sRGBEncoding}),this.modelRenderTarget]}}else if(e==="edl"){if(this.screenBuffers.length===0){var l=this.renderer.getDrawingBufferSize(sharedVector2$1);this.screenBuffers=[new THREE__namespace.WebGLRenderTarget(l.x,l.y,{generateMipmaps:!1,encoding:(s=(o=this.renderer)===null||o===void 0?void 0:o.outputEncoding)!==null&&s!==void 0?s:THREE__namespace.sRGBEncoding,minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,format:THREE__namespace.RGBAFormat,type:THREE__namespace.FloatType}),this.modelRenderTarget]}this.models.setMaterial({useEDL:!0})}else if(e==="hq"){if(this.screenBuffers.length===0){var l=this.renderer.getDrawingBufferSize(sharedVector2$1),d=new THREE__namespace.WebGLRenderTarget(l.x,l.y,{generateMipmaps:!1,minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,format:THREE__namespace.RGBAFormat,type:THREE__namespace.FloatType,depthTexture:new THREE__namespace.DepthTexture(l.x,l.y,THREE__namespace.UnsignedIntType)});d.depthTexture.format=THREE__namespace.DepthFormat,d.depthBuffer=!0;var f=new THREE__namespace.WebGLRenderTarget(l.x,l.y,{generateMipmaps:!1,encoding:(c=(u=this.renderer)===null||u===void 0?void 0:u.outputEncoding)!==null&&c!==void 0?c:THREE__namespace.sRGBEncoding,minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,format:THREE__namespace.RGBAFormat,type:THREE__namespace.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(v){v.dispose()}),this.screenBuffers=[]),this.models.setMaterial({useEDL:!1,useHQDepth:!1,useHQWeight:!1})},t}(Subscribe),FloorplanController=function(n){__extends(t,n);function t(e){var r=this,i,o=t.parseArgs(e);return r=n.call(this,o)||this,r.mode="Floorplan",r.defaultLongitude=o.defaultLongitude,r.defaultLatitude=o.defaultLatitude,r.defaultFov=o.defaultFov,r.maxFov=o.maxFov,r.minFov=o.minFov,r.maxLatitude=o.maxLatitude,r.minLatitude=o.minLatitude,r.modelInScreen=o.modelInScreen,r.locationMotion=new Motion({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 Motion({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new Motion({perspToOrtho:r.camera.perspToOrtho.x}),r.currentTapId=null,r.intersectMeshCreator=o.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 o=e.bounding,s=Math.pow(Math.pow(o.max.x-o.min.x+1,2)+Math.pow(o.max.y-o.min.y+1,2)+Math.pow(o.max.z-o.min.z+1,2),1/2),u=s/2/Math.tan(Math.PI*r/360);return i<1&&(u=u/i),isNaN(u)?s:u},t.parseArgs=function(e){var r,i,o,s,u,c,l,d,f;if(e instanceof t)return e;var v=n.parseArgs.call(this,e);return __assign(__assign({},v),{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:(o=e.defaultFov)!==null&&o!==void 0?o:80,maxFov:(s=e.maxFov)!==null&&s!==void 0?s:120,minFov:(u=e.minFov)!==null&&u!==void 0?u:20,maxLatitude:(c=e.maxLatitude)!==null&&c!==void 0?c:+Math.PI/2,minLatitude:(l=e.minLatitude)!==null&&l!==void 0?l:-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 IntersectMesh}})},t.initAnimationEndState=function(e){var r,i,o,s,u,c,l,d=this.parseArgs(e),f=e.initial,v=f.state,A=f.currentState,h=typeof v.panoIndex=="number"?{workCode:(o=(r=v.workCode)!==null&&r!==void 0?r:(i=d.works[0])===null||i===void 0?void 0:i.workCode)!==null&&o!==void 0?o:"",panoIndex:v.panoIndex}:{workCode:A.workCode,panoIndex:A.panoIndex},p=__assign(__assign({},h),{mode:"Floorplan",longitude:(s=v.longitude)!==null&&s!==void 0?s:isThirdPersonMode(A.mode)?A.longitude:d.defaultLongitude,latitude:clamp$1((u=v.latitude)!==null&&u!==void 0?u:A.mode==="Floorplan"?A.latitude:d.defaultLatitude,d.minLatitude,d.maxLatitude),fov:(c=v.fov)!==null&&c!==void 0?c:d.defaultFov,offset:v.offset?v.offset.clone():e.models.bounding.getCenter(new THREE__namespace.Vector3),distance:(l=v.distance)!==null&&l!==void 0?l:t.distanceFromModel(d.models,d.defaultFov,d.camera.aspect)});return p},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,o){var s;return this.works=e,this.updateCamera(r,(s=i.duration)!==null&&s!==void 0?s:0,o),!0},t.prototype.updateModel=function(e){n.prototype.updateModel.call(this,e);var r=e.bounding.getCenter(new THREE__namespace.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(noop$1)},t.prototype.updateCamera=function(e,r,i){var o=this;return this.initAnimationReady.then(function(){o.userAction=i,o.stopMomentumMovement();var s={},u={};return e.distance!==void 0&&(s.distance=e.distance),e.offset!==void 0&&(s.x=e.offset.x,s.y=e.offset.y,s.z=e.offset.z),e.longitude!==void 0&&(u.longitude=e.longitude),e.latitude!==void 0&&(u.latitude=e.latitude),e.fov!==void 0&&(u.fov=e.fov),o.locationMotion.set(s,r).catch(noop$1),o.cameraMotion.set(u,r).catch(noop$1)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var o=this;return this.initAnimationReady.then(function(){o.userAction=i,o.stopMomentumMovement();for(var s=[],u=[],c=0,l=e;c<l.length;c++){var d=l[c];s.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}}),u.push({key:d.key,progress:d.progress,value:{longitude:d.value.longitude,latitude:d.value.latitude,fov:d.value.fov}})}return o.locationMotion.setKeyframes(s,r).catch(noop$1),o.cameraMotion.setKeyframes(e,r)})},t.prototype.updateTime=function(e,r){if(!this.destroyed){var i={},o={};this.modelAlphaMotion.ended||(this.modelAlphaMotion.update(e),i.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended||(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(clamp$1(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended||(this.locationMotion.update(e),o.distance=this.locationMotion.value.distance,o.offset=new THREE__namespace.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z)),this.cameraMotion.ended||(this.cameraMotion.update(e),o.longitude=this.cameraMotion.value.longitude,o.latitude=this.cameraMotion.value.latitude,o.fov=this.cameraMotion.value.fov),isEmptyObject(i)||this.models.setMaterial(i),isEmptyObject(o)||this.setCamera(o)}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(now())[1],r=this.locationMotion.getKeyFrameSegment(now())[1];return __assign(__assign({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:new THREE__namespace.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 o=i.duration,s=i.userAction;e.userAction=s;var u=t.initAnimationEndState(e),c=pick(u,["longitude","latitude","fov"]),l={x:u.offset.x,y:u.offset.y,z:u.offset.z,distance:u.distance},d={modelAlpha:1},f={perspToOrtho:0};e.emit("initAnimation.start",createEvent("initAnimation.start",{state:u,userAction:e.userAction})),e.modelAlphaMotion.set(d,o/3).catch(noop$1),e.perspToOrthoMotion.set(f,o).catch(noop$1),e.cameraMotion.set(c,o).catch(noop$1),e.locationMotion.set(l,o).then(function(){e.emit("initAnimation.end",createEvent("initAnimation.end",{state:u,userAction:e.userAction}))},function(v){var A=__assign(__assign(__assign({},e.currentPano),{mode:e.mode}),clonePose(e.camera.pose));e.emit("initAnimation.end",createEvent("initAnimation.end",{state:A,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)})},t.prototype.getForwardObserverOrNot=function(e){var r=this,i=this.models.intersectRaycaster(e)[0];if(!i)return null;var o=this.works.resolvedObservers.filter(function(l){for(var d,f=0,v=r.models;f<v.length;f++){var A=v[f];if(A.visible&&((d=A.work)===null||d===void 0?void 0:d.workCode)===l.work.workCode)return!0}return!1}),s=arrayMin(o,function(l){return l.standingPosition.distanceTo(i.point)},!0),u=s[0],c=s[1];return u&&c<10?u:null},t.prototype.coordinatesForOffset=function(e){var r=this.renderer.getSize(new THREE__namespace.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,o){var s=this;if(this.inMomentumMovement!==null){for(var u=__assign({},i),c={longitude:0,latitude:0},l=0;l<o;l++)u.longitude*=.996,u.latitude*=.996*.998,c.longitude+=u.longitude,c.latitude+=u.latitude;var d=formatRad(this.cameraMotion.value.longitude+c.longitude),f=clamp$1(this.cameraMotion.value.latitude+c.latitude,this.minLatitude,this.maxLatitude),v=__assign(__assign({},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}),A=!(u.longitude>1e-4||u.longitude<-1e-4||u.latitude>1e-4||u.latitude<-1e-4),h=createEvent("gesture.momentum",__assign(__assign({},e),{isFirst:r,isFinal:A,state:v}));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(noop$1),A?this.inMomentumMovement=null:AnimationFrameLoop.shared.add(function(p,y){s.requestMomentumMovement(e,!1,u,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 o={x:e.center.x-r.x,y:e.center.y-r.y},s=this.relativeClientPosition(e.center),u=this.camera.pose.latitude<Math.PI/6||s.y<0?1:-1;o.x*=u;var c=this.coordinatesForOffset(o),l=formatRad(this.cameraMotion.value.longitude+c.longitude),d=clamp$1(this.cameraMotion.value.latitude+c.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=__assign(__assign({},this.currentPano),{mode:this.mode,longitude:l,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(noop$1),e.isFinal)){var v=e.velocityX*u,A=e.velocityY;this.inMomentumMovement={uuid:createUuid()},this.requestMomentumMovement(e,!0,this.coordinatesForOffset({x:v,y:A}),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 o=clamp$1(i/e.scale,this.minFov,this.maxFov);e.state.fov=o,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:o},0).catch(noop$1),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 o=e.center.raycaster;if(e.isFinal&&this.intersectMesh.parent&&this.intersectMesh.visible===!0){this.hideIntersectMesh();return}var s=this.models.intersectRaycaster(o)[0],u=createEvent("intersect.update",{raycaster:o,intersection:s!=null?s:null,object:this.intersectMesh});if(this.emit("intersect.update",u),u.defaultPrevented){this.hideIntersectMesh();return}if(s){var c=(i=(r=s.face)===null||r===void 0?void 0:r.normal)!==null&&i!==void 0?i:new THREE__namespace.Vector3().copy(o.ray.direction).multiplyScalar(-1),l=c.clone(),d=s.point.clone();this.intersectMesh.position.copy(d);var f=o.ray.origin.distanceTo(d),v=2*Math.tan(.5*this.camera.fov/180*Math.PI),A=Math.max(f*v/10,1);this.intersectMesh.scale.set(A,A,A);var h=d.clone().add(l);if(this.intersectMesh.lookAt(h),Math.abs(c.y)>.99){var p=this.camera.position.clone().sub(d);this.intersectMesh.rotation.z=-Math.atan2(p.z,p.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,o=r.maxFov,s=clamp$1(this.camera.fov-e.center.delta,i,o);e.state.fov=s,this.emit("gesture.mousewheel",e),!e.defaultPrevented&&this.cameraMotion.set({fov:s},0).catch(noop$1)}},t.prototype.onTapGesture=function(e){var r=this;this.userAction=!0,this.stopMomentumMovement();var i=e.center.raycaster,o=this.getForwardObserverOrNot(i);if(!o)this.emit("gesture.tap",e);else{var s={longitude:this.camera.pose.longitude,latitude:0},u=__assign(__assign({},e.state),{mode:"Panorama",workCode:o.pano.workCode,panoIndex:o.pano.panoIndex,longitude:s.longitude,latitude:s.latitude,offset:o?o.position.clone():new THREE__namespace.Vector3,distance:0});if(e.state=u,this.emit("gesture.tap",e),!e.defaultPrevented&&(this.emit("pano.select",createEvent("pano.select",{prevPano:this.currentPano,state:u,userAction:e.userAction,options:s,progress:0,error:null})),o&&o.active)){var c=this.currentTapId=createUuid();this.preloadPano(o.pano).then(function(l){r.currentTapId===c&&r.emit("pano.request",createEvent("pano.request",{userAction:!0,prevPano:r.currentPano,progress:0,state:u,options:s,error:null}))})}}},t.prototype.onDblTapGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement();var r=this.cameraMotion.value.fov,i=this.minFov-r<r-this.defaultFov?this.minFov:this.defaultFov;e.state.fov=i,this.emit("gesture.dbltap",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:i},360).catch(noop$1),this.hideIntersectMesh())},t.prototype.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.needsRender=!0},t}(BaseController),TopviewController=function(n){__extends(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=__assign(__assign({},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 __assign(__assign({},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 THREE__namespace.Vector3);this.locationMotion.set({x:r.x,y:r.y,z:r.z,distance:FloorplanController.distanceFromModel(this.models,this.defaultFov,this.camera.aspect)},0).catch(noop$1)},t.prototype.updateCamera=function(e,r,i){var o=this;return this.initAnimationReady.then(function(){o.userAction=i,o.stopMomentumMovement();var s={},u={};return e.distance!==void 0&&(s.distance=e.distance),e.offset!==void 0&&(s.x=e.offset.x,s.y=e.offset.y,s.z=e.offset.z),e.longitude!==void 0&&(u.longitude=e.longitude),e.latitude!==void 0&&(u.latitude=e.latitude),e.fov!==void 0&&(u.fov=e.fov),o.locationMotion.set(s,r).catch(noop$1),o.cameraMotion.set(u,r).catch(noop$1)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var o=this;return this.initAnimationReady.then(function(){o.userAction=i,o.stopMomentumMovement();for(var s=[],u=[],c=0,l=e;c<l.length;c++){var d=l[c];s.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}}),u.push({key:d.key,progress:d.progress,value:{longitude:d.value.longitude,latitude:d.value.latitude,fov:d.value.fov}})}return o.locationMotion.setKeyframes(s,r).catch(noop$1),o.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 o=i.duration,s=i.userAction;e.userAction=s;var u=t.initAnimationEndState(e),c={longitude:u.longitude,latitude:u.latitude,fov:u.fov},l={x:u.offset.x,y:u.offset.y,z:u.offset.z,distance:u.distance},d={modelAlpha:1},f={perspToOrtho:1};e.emit("initAnimation.start",createEvent("initAnimation.start",{state:u,userAction:e.userAction})),e.modelAlphaMotion.set(d,o/3).catch(noop$1),e.perspToOrthoMotion.set(f,o).catch(noop$1),e.cameraMotion.set(c,o).catch(noop$1),e.locationMotion.set(l,o).then(function(){e.emit("initAnimation.end",createEvent("initAnimation.end",{state:u,userAction:e.userAction}))},function(v){var A=__assign(__assign(__assign({},e.currentPano),{mode:e.mode}),clonePose(e.camera.pose));e.emit("initAnimation.end",createEvent("initAnimation.end",{state:A,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 o={x:e.center.x-r.x,y:e.center.y-r.y},s=new THREE__namespace.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),u=this.locationMotion.value.distance;u*=Math.tan(this.cameraMotion.value.fov/2*Math.PI/180);var c=this.renderer.getSize(new THREE__namespace.Vector2),l=2*o.x*u/c.y,d=2*o.y*u/c.y,f=new THREE__namespace.Vector3;f.setFromMatrixColumn(this.camera.matrix,0),f.multiplyScalar(-l),s.add(f),f.setFromMatrixColumn(this.camera.matrix,0),f.crossVectors(this.camera.up,f),f.multiplyScalar(d),s.add(f),this.modelInScreen==="boundingbox-center"&&s.clamp(this.models.bounding.min,this.models.bounding.max);var v=__assign(__assign({},this.currentPano),{mode:this.mode,longitude:0,latitude:Math.PI/2,fov:this.cameraMotion.value.fov,offset:s,distance:this.locationMotion.value.distance});e.state=v,this.emit("gesture.pan",e),!e.defaultPrevented&&this.locationMotion.set({x:s.x,y:s.y,z:s.z},0).catch(noop$1)}},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 o=clamp$1(i/e.scale,this.minFov,this.maxFov);e.state.fov=o,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:o},0).catch(noop$1),e.type="gesture.pan",this.onPanGesture(e))}}},t.prototype.onMouseWheel=function(e){if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement();var r=clamp$1(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(noop$1)}},t}(FloorplanController),PanoramaLikeController=function(n){__extends(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,o,s,u,c,l,d;if(e instanceof t)return e;var f=n.parseArgs.call(this,e);return __assign(__assign({},f),{defaultLatitude:(r=e.defaultLatitude)!==null&&r!==void 0?r:0,defaultFov:(i=e.defaultFov)!==null&&i!==void 0?i:90,maxFov:(o=e.maxFov)!==null&&o!==void 0?o:120,minFov:(s=e.minFov)!==null&&s!==void 0?s:20,maxLatitude:(u=e.maxLatitude)!==null&&u!==void 0?u:+Math.PI/2,minLatitude:(c=e.minLatitude)!==null&&c!==void 0?c:-Math.PI/2,moveSpeed:(l=e.moveSpeed)!==null&&l!==void 0?l:3.4,intersectMeshCreator:(d=e.intersectMeshCreator)!==null&&d!==void 0?d:function(){return new IntersectMesh}})},t.initAnimationEndState=function(e){var r,i,o,s,u,c,l=this.parseArgs(e),d=l.works,f=e.initial,v=f.state,A=f.currentState,h=typeof v.panoIndex=="number"?{workCode:(o=(r=v.workCode)!==null&&r!==void 0?r:(i=l.works[0])===null||i===void 0?void 0:i.workCode)!==null&&o!==void 0?o:"",panoIndex:v.panoIndex}:{workCode:A.workCode,panoIndex:A.panoIndex},p=d.getResolvedObserver(h),y=(s=v.longitude)!==null&&s!==void 0?s:A.longitude,m=clamp$1((u=v.latitude)!==null&&u!==void 0?u:isFristPersonMode(A.mode)?A.latitude:l.defaultLatitude,l.minLatitude,l.maxLatitude),g=clamp$1((c=v.fov)!==null&&c!==void 0?c:isFristPersonMode(A.mode)?A.fov:l.defaultFov,l.minFov,l.maxFov),E=p?p.position.clone():new THREE__namespace.Vector3;return{workCode:h.workCode,panoIndex:h.panoIndex,mode:"PanoramaLike",longitude:y,latitude:m,fov:g,offset:E,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 clamp$1(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,o=this.renderer.getSize(new THREE__namespace.Vector2);return{longitude:2*e.x/(o.x*this.scissor.width)*r/95*i,latitude:-2*e.y/(o.y*this.scissor.height)*r/95}},t.prototype.cameraBounce=function(){var e=this.cameraMotion.value,r=e.longitude,i=e.latitude,o=e.fov,s=[{progress:0,value:{longitude:r,latitude:i,fov:o}},{progress:.5,value:{longitude:r,latitude:i,fov:o*.98}},{progress:1,value:{longitude:r,latitude:i,fov:o}}];this.cameraMotion.setKeyframes(s,500).catch(noop$1)},t.prototype.requestMomentumMovement=function(e,r,i,o){var s=this;if(this.inMomentumMovement!==null){for(var u=__assign({},i),c={longitude:0,latitude:0},l=0;l<o;l++)u.longitude*=.996,u.latitude*=.996*.99,c.longitude+=u.longitude,c.latitude+=u.latitude;var d=formatRad(this.cameraMotion.value.longitude+c.longitude),f=clamp$1(this.cameraMotion.value.latitude+c.latitude,this.minLatitude,this.maxLatitude),v=__assign(__assign({},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}),A=!(u.longitude>1e-4||u.longitude<-1e-4||u.latitude>1e-4||u.latitude<-1e-4),h=createEvent("gesture.momentum",__assign(__assign({},e),{isFirst:r,isFinal:A,state:v}));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(noop$1),A?this.inMomentumMovement=null:AnimationFrameLoop.shared.add(function(p,y){s.requestMomentumMovement(e,!1,u,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 o={x:e.center.x-r.x,y:e.center.y-r.y},s=this.coordinatesForOffset(o),u=formatRad(this.cameraMotion.value.longitude+s.longitude),c=clamp$1(this.cameraMotion.value.latitude+s.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&&(c=this.cameraMotion.value.latitude);var l=__assign(__assign({},this.currentPano),{mode:this.mode,longitude:u,latitude:c,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance});if(e.state=l,this.emit("gesture.pan",e),!e.defaultPrevented){var d={longitude:l.longitude,latitude:l.latitude,fov:l.fov};if(this.cameraMotion.set(d,0).catch(noop$1),e.isFinal){var f=e.velocityX,v=e.velocityY*.6;Math.abs(v)>.5&&Math.abs(f)<.5&&(f=0),this.inMomentumMovement={uuid:createUuid()},this.requestMomentumMovement(e,!0,this.coordinatesForOffset({x:f,y:v}),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,o=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 s=clamp$1(i/o,this.minFov,this.maxFov);e.state.fov=s,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:s},0).catch(noop$1),e.type="gesture.pan",this.onPanGesture(e))}},t.prototype.onMouseWheel=function(e){this.userAction=e.userAction,this.stopMomentumMovement();var r=clamp$1(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(noop$1),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 o=e.center.raycaster;if(e.isFinal&&this.intersectMesh.parent){this.hideIntersectMesh();return}var s=this.models.intersectRaycaster(o)[0],u=createEvent("intersect.update",{raycaster:o,intersection:s!=null?s:null,object:this.intersectMesh});if(this.emit("intersect.update",u),u.defaultPrevented){this.hideIntersectMesh();return}if(s){var c=(i=(r=s.face)===null||r===void 0?void 0:r.normal)!==null&&i!==void 0?i:new THREE__namespace.Vector3().copy(o.ray.direction).multiplyScalar(-1),l=c.clone(),d=s.point.clone();this.intersectMesh.position.copy(d);var f=d.clone().add(l);if(this.intersectMesh.lookAt(f),Math.abs(c.y)>.99){var v=this.camera.position.clone().sub(d);this.intersectMesh.rotation.z=-Math.atan2(v.z,v.x)}this.intersectMesh.visible=!0,this.needsRender=!0}else this.hideIntersectMesh()}},t.prototype.onDblTapGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement();var r=this.cameraMotion.value.fov,i=2,o=this.works.getResolvedObserver(this.currentPano);if(o){var s=o.images.tiles;s&&s.length&&(i=Math.max.apply(Math,s.map(function(l){return l.level})))}var u=Math.max(40-i*5,this.minFov,5),c=u-r<r-this.defaultFov?u:this.defaultFov;e.state.fov=c,this.emit("gesture.dbltap",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:c},360).catch(noop$1),this.hideIntersectMesh())},t}(BaseController),blankVideo="data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGBf//rdxF6b3m2Ui3lizYINkj7u94MjY0IC0gY29yZSAxNDIgcjIgOTU2YzhkOCAtIEguMjY0L01QRUctNCBBVkMgY29kZWMgLSBDb3B5bGVmdCAyMDAzLTIwMTQgLSBodHRwOi8vd3d3LnZpZGVvbGFuLm9yZy94MjY0Lmh0bWwgLSBvcHRpb25zOiBjYWJhYz0wIHJlZj0zIGRlYmxvY2s9MTowOjAgYW5hbHlzZT0weDE6MHgxMTEgbWU9aGV4IHN1Ym1lPTcgcHN5PTEgcHN5X3JkPTEuMDA6MC4wMCBtaXhlZF9yZWY9MSBtZV9yYW5nZT0xNiBjaHJvbWFfbWU9MSB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ABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw",result;function canplayVideo(){return result||(result=new Promise(function(n){var t,e=document.createElement("video");e.muted=!0,e.src=blankVideo,e.addEventListener("timeupdate",function r(){e.removeEventListener("timeupdate",r,!1),clearTimeout(t);var i=document.createElement("canvas");i.width=i.height=1;var o=i.getContext("2d");if(!o){n(!1);return}o.drawImage(e,0,0,1,1);var s=o.getImageData(0,0,1,1).data;s[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 FRAGMENT=`
1370
1370
  #include <common>
1371
1371
  uniform sampler2D inputBuffer;
1372
1372
  uniform float scale;
@@ -1450,7 +1450,7 @@ void main() {
1450
1450
  gl_FragColor.a = 1.0 - texture2D(luminanceMap, vUv).r;
1451
1451
  #endif
1452
1452
  }
1453
- `,TileMaterial=function(n){__extends(t,n);function t(){var e=n.call(this,{uniforms:{map:{value:null},luminanceMap:{value:null},flipY:{value:1},level:{value:0}},vertexShader:TILE_MATERIAL_VERTEX_SHADER,fragmentShader:TILE_MATERIAL_FRAGMENT_SHADER})||this;return e.depthTest=!1,e.depthWrite=!1,e.blending=THREE__namespace.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}(THREE__namespace.ShaderMaterial),TileMesh=function(n){__extends(t,n);function t(e,r){var i=n.call(this,geometry$3,new TileMaterial)||this;return e.box.getCenter(i.position),i.quaternion.multiplyQuaternions(new THREE__namespace.Quaternion().setFromAxisAngle(new THREE__namespace.Vector3(0,1,0),-Math.PI),TILE_QUATERNION[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(o){var s=o[0],u=o[1];i.disposed?(s.dispose(),u==null||u.dispose()):(i.material.map=s,i.material.luminanceMap=u,i.material.flipY=!!s.flipY,i.material.level=e.level,i.material.needsUpdate=!0,i.material.visible=!0,i.needsRender=!0)}).catch(noop$1),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}(THREE__namespace.Mesh),TilingObject3D=function(n){__extends(t,n);function t(){var e=n.call(this)||this;return e.needsRender=!1,e.name="tiling",e}return t}(THREE__namespace.Group),Tiling=function(){function n(t,e,r){this.disposed=!1,this.textureLoader=new TextureLoader,this.minLevel=e,this.level=0,this.panoId="[0]",this.maxRequest=n.DEFAULT_MAX_REQUEST,this.pedding=0,this.tileTree=createTileCubeTree(this.minLevel),this.tileMeshes=new Map,this.resource=[],this.luminance=null,this.imageOptions=r,this.fetcher=t,this.object=new TilingObject3D,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 o=(i=(r=t.slice().sort(function(s,u){return u.level-s.level})[0])===null||r===void 0?void 0:r.level)!==null&&i!==void 0?i:0;this.tileTree=createTileCubeTree(o),this.luminance=e,this.object.needsRender=!0}},n.prototype.update=function(t,e,r){var i=this;if(!this.disposed){this.level=e;var o=t.planes[5].normal,s=[];e>=this.minLevel&&traverseTileCubeNode(this.tileTree,function(g){if(!(g.level<i.minLevel)){if(g.level>e||!t.intersectsBox(g.box))return!1;s.push(g)}}),s.sort(function(g,E){return g.level!==E.level?g.level-E.level:g.box.getCenter(sharedSortVector3).angleTo(o)-E.box.getCenter(sharedSortVector3).angleTo(o)});for(var u=new Set,l=function(g){var E=c.resource.filter(function(U){return U.level===g.level})[0];if(!E)return"continue";if(u.add(g),c.tileMeshes.has(g))return c.tileMeshes.get(g).activeTime=r,"continue";if(c.pedding>=c.maxRequest)return"continue";var b=E.size,T=c.imageOptions.transform,_=Math.pow(2,g.level)*g.position.y,x=Math.pow(2,g.level)*g.position.x,R="".concat(c.panoId,".").concat(g.face,".").concat(g.level,".").concat(_,".").concat(x),w=__assign(__assign({key:"pano_tile.".concat(R)},pick(c.imageOptions,["format","size","quality","sharpen","mappings"])),{size:E.scale>=1?void 0:b*g.size*E.scale,cut:[b*g.position.x,b*g.position.y,b*g.size,b*g.size]}),S=c.textureLoader.loadTexture(E[g.face],{imageURL:{transform:T,options:w},minFilter:THREE__namespace.LinearFilter,magFilter:THREE__namespace.LinearFilter,generateMipmaps:!1,fetcher:c.fetcher}).then(function(U){return U.body}),C=null;if(c.luminance){var I=c.luminance[g.face],H=I.match(/\/cube_(\d+)\//),B=H?Number(H[1]):!1;if(B!==!1){var L=E.size*E.scale/2,O=L*g.size,k=B<L?I.replace(/\/cube_(\d+)\//,"cube_"+L):I,K=__assign(__assign({},w),{size:B*g.size===O?void 0:O,cut:[B*g.position.x,B*g.position.y,B*g.size,B*g.size],key:"pano_tile_luminance.".concat(R)});C=c.textureLoader.loadTexture(k,{imageURL:{transform:c.imageOptions.transform,options:K},minFilter:THREE__namespace.LinearFilter,magFilter:THREE__namespace.LinearFilter,fetcher:c.fetcher}).then(function(U){return U.body}).catch(function(){return null})}}c.pedding++;var z=Promise.all([S,C]).then(function(U){return i.pedding--,U},function(U){return i.pedding--,Promise.reject(U)}),N=new TileMesh(g,z);N.name="tiling:tile-".concat(R),N.activeTime=r,N.renderOrder=g.level,c.tileMeshes.set(g,N),c.object.needsRender=!0,c.object.add(N)},c=this,d=0,f=s;d<f.length;d++){var m=f[d];l(m)}var A=[];this.tileMeshes.forEach(function(g,E){u.has(E)||A.push(E),g.visible=E.level<=e});for(var h=A.sort(function(g,E){var b,T,_,x;return((T=(b=i.tileMeshes.get(E))===null||b===void 0?void 0:b.activeTime)!==null&&T!==void 0?T:0)-((x=(_=i.tileMeshes.get(g))===null||_===void 0?void 0:_.activeTime)!==null&&x!==void 0?x:0)}).slice(Math.max(0,MAX_TILE_COUNT-u.size)),p=0,y=h;p<y.length;p++){var m=y[p],v=this.tileMeshes.get(m);v&&(v.dispose(),this.object.remove(v),this.object.needsRender=!0),this.tileMeshes.delete(m)}}},n.prototype.dispose=function(){this.cleanup(),this.resource=[],this.disposed=!0},n.DEFAULT_MAX_REQUEST=3,n}(),vertices$1=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]),index$1=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]),sharedGeometry$1=new THREE__namespace.BufferGeometry;sharedGeometry$1.setAttribute("position",new THREE__namespace.BufferAttribute(vertices$1,3)),sharedGeometry$1.setIndex(new THREE__namespace.BufferAttribute(index$1,1));var PANO_VIDEO_MATERIAL_VERTEX_SHADER=`
1453
+ `,TileMaterial=function(n){__extends(t,n);function t(){var e=n.call(this,{uniforms:{map:{value:null},luminanceMap:{value:null},flipY:{value:1},level:{value:0}},vertexShader:TILE_MATERIAL_VERTEX_SHADER,fragmentShader:TILE_MATERIAL_FRAGMENT_SHADER})||this;return e.depthTest=!1,e.depthWrite=!1,e.blending=THREE__namespace.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}(THREE__namespace.ShaderMaterial),TileMesh=function(n){__extends(t,n);function t(e,r){var i=n.call(this,geometry$3,new TileMaterial)||this;return e.box.getCenter(i.position),i.quaternion.multiplyQuaternions(new THREE__namespace.Quaternion().setFromAxisAngle(new THREE__namespace.Vector3(0,1,0),-Math.PI),TILE_QUATERNION[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(o){var s=o[0],u=o[1];i.disposed?(s.dispose(),u==null||u.dispose()):(i.material.map=s,i.material.luminanceMap=u,i.material.flipY=!!s.flipY,i.material.level=e.level,i.material.needsUpdate=!0,i.material.visible=!0,i.needsRender=!0)}).catch(noop$1),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}(THREE__namespace.Mesh),TilingObject3D=function(n){__extends(t,n);function t(){var e=n.call(this)||this;return e.needsRender=!1,e.name="tiling",e}return t}(THREE__namespace.Group),Tiling=function(){function n(t,e,r){this.disposed=!1,this.textureLoader=new TextureLoader,this.minLevel=e,this.level=0,this.panoId="[0]",this.maxRequest=n.DEFAULT_MAX_REQUEST,this.pedding=0,this.tileTree=createTileCubeTree(this.minLevel),this.tileMeshes=new Map,this.resource=[],this.luminance=null,this.imageOptions=r,this.fetcher=t,this.object=new TilingObject3D,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 o=(i=(r=t.slice().sort(function(s,u){return u.level-s.level})[0])===null||r===void 0?void 0:r.level)!==null&&i!==void 0?i:0;this.tileTree=createTileCubeTree(o),this.luminance=e,this.object.needsRender=!0}},n.prototype.update=function(t,e,r){var i=this;if(!this.disposed){this.level=e;var o=t.planes[5].normal,s=[];e>=this.minLevel&&traverseTileCubeNode(this.tileTree,function(g){if(!(g.level<i.minLevel)){if(g.level>e||!t.intersectsBox(g.box))return!1;s.push(g)}}),s.sort(function(g,E){return g.level!==E.level?g.level-E.level:g.box.getCenter(sharedSortVector3).angleTo(o)-E.box.getCenter(sharedSortVector3).angleTo(o)});for(var u=new Set,c=function(g){var E=l.resource.filter(function(D){return D.level===g.level})[0];if(!E)return"continue";if(u.add(g),l.tileMeshes.has(g))return l.tileMeshes.get(g).activeTime=r,"continue";if(l.pedding>=l.maxRequest)return"continue";var b=E.size,T=l.imageOptions.transform,_=Math.pow(2,g.level)*g.position.y,S=Math.pow(2,g.level)*g.position.x,R="".concat(l.panoId,".").concat(g.face,".").concat(g.level,".").concat(_,".").concat(S),B=__assign(__assign({key:"pano_tile.".concat(R)},pick(l.imageOptions,["format","size","quality","sharpen","mappings"])),{size:E.scale>=1?void 0:b*g.size*E.scale,cut:[b*g.position.x,b*g.position.y,b*g.size,b*g.size]}),I=l.textureLoader.loadTexture(E[g.face],{imageURL:{transform:T,options:B},minFilter:THREE__namespace.LinearFilter,magFilter:THREE__namespace.LinearFilter,generateMipmaps:!1,fetcher:l.fetcher}).then(function(D){return D.body}),x=null;if(l.luminance){var M=l.luminance[g.face],L=M.match(/\/cube_(\d+)\//),C=L?Number(L[1]):!1;if(C!==!1){var H=E.size*E.scale/2,F=H*g.size,O=C<H?M.replace(/\/cube_(\d+)\//,"cube_"+H):M,G=__assign(__assign({},B),{size:C*g.size===F?void 0:F,cut:[C*g.position.x,C*g.position.y,C*g.size,C*g.size],key:"pano_tile_luminance.".concat(R)});x=l.textureLoader.loadTexture(O,{imageURL:{transform:l.imageOptions.transform,options:G},minFilter:THREE__namespace.LinearFilter,magFilter:THREE__namespace.LinearFilter,fetcher:l.fetcher}).then(function(D){return D.body}).catch(function(){return null})}}l.pedding++;var Q=Promise.all([I,x]).then(function(D){return i.pedding--,D},function(D){return i.pedding--,Promise.reject(D)}),U=new TileMesh(g,Q);U.name="tiling:tile-".concat(R),U.activeTime=r,U.renderOrder=g.level,l.tileMeshes.set(g,U),l.object.needsRender=!0,l.object.add(U)},l=this,d=0,f=s;d<f.length;d++){var v=f[d];c(v)}var A=[];this.tileMeshes.forEach(function(g,E){u.has(E)||A.push(E),g.visible=E.level<=e});for(var h=A.sort(function(g,E){var b,T,_,S;return((T=(b=i.tileMeshes.get(E))===null||b===void 0?void 0:b.activeTime)!==null&&T!==void 0?T:0)-((S=(_=i.tileMeshes.get(g))===null||_===void 0?void 0:_.activeTime)!==null&&S!==void 0?S:0)}).slice(Math.max(0,MAX_TILE_COUNT-u.size)),p=0,y=h;p<y.length;p++){var v=y[p],m=this.tileMeshes.get(v);m&&(m.dispose(),this.object.remove(m),this.object.needsRender=!0),this.tileMeshes.delete(v)}}},n.prototype.dispose=function(){this.cleanup(),this.resource=[],this.disposed=!0},n.DEFAULT_MAX_REQUEST=3,n}(),vertices$1=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]),index$1=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]),sharedGeometry$1=new THREE__namespace.BufferGeometry;sharedGeometry$1.setAttribute("position",new THREE__namespace.BufferAttribute(vertices$1,3)),sharedGeometry$1.setIndex(new THREE__namespace.BufferAttribute(index$1,1));var PANO_VIDEO_MATERIAL_VERTEX_SHADER=`
1454
1454
  #if defined(USE_PANO_VIDEO)
1455
1455
  varying vec3 worldPosition;
1456
1456
  #endif
@@ -1485,7 +1485,7 @@ void main() {
1485
1485
  gl_FragColor = vec4(videoColor.rgb, match * blendAlpha * alpha);
1486
1486
  #endif
1487
1487
  }
1488
- `,PanoVideo=function(){function n(){this.material=new THREE__namespace.ShaderMaterial({vertexShader:PANO_VIDEO_MATERIAL_VERTEX_SHADER,fragmentShader:PANO_VIDEO_TILE_MATERIAL_FRAGMENT_SHADER,uniforms:{size:new THREE__namespace.Uniform(null),matrix:new THREE__namespace.Uniform(null),alpha:new THREE__namespace.Uniform(null),map:new THREE__namespace.Uniform(null)},depthTest:!1,depthWrite:!1,defines:{USE_PANO_VIDEO:!1},blending:THREE__namespace.CustomBlending,blendSrc:THREE__namespace.SrcAlphaFactor,blendDst:THREE__namespace.OneMinusSrcAlphaFactor,blendSrcAlpha:THREE__namespace.OneFactor,blendDstAlpha:THREE__namespace.OneMinusSrcAlphaFactor}),this.object=new THREE__namespace.Mesh(sharedGeometry$1,this.material),this.object.visible=!1,this.object.renderOrder=-1,this.object.frustumCulled=!1,this.object.name="pano-video",this.alphaMotion=new Motion({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(noop$1),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(noop$1));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}(),ROTATE_Y_PI_MATRIX$1=new THREE__namespace.Matrix4().makeRotationAxis(new THREE__namespace.Vector3(0,1,0),Math.PI),PANO_TEXTURE_SCALE$1=new THREE__namespace.Vector3(-1,1,1),CubeRenderTargetPool=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 THREE__namespace.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}(),PanoramaController=function(n){__extends(t,n);function t(e){var r=this,i,o,s,u,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 LuminanceAdaptiveEffect(r.renderer,r.modelScene,r.camera,r.models),r.colorCubeRenderTargetPool=new CubeRenderTargetPool,r.luminanceCubeRenderTargetPool=new CubeRenderTargetPool;var c=r.models.getMaterial()||{},d=c.pano0,f=c.pano1;d&&(f==null?void 0:f.map)!==d.map&&(r.models.setMaterial({pano0:f}),d.map.dispose(),d.map instanceof TileCubeTextureTarget&&d.map.cubeRenderTarget&&r.colorCubeRenderTargetPool.push(d.map.cubeRenderTarget),d.luminanceMap&&(d.luminanceMap.dispose(),d.luminanceMap instanceof TileCubeTextureTarget&&d.luminanceMap.cubeRenderTarget&&r.luminanceCubeRenderTargetPool.push(d.luminanceMap.cubeRenderTarget)));for(var m=r.colorCubeRenderTargetPool.size;m<2;m++){var A=Math.max(1024*r.TILED_CUBE_TEXTURE_LEVEL,512),h=r.colorCubeRenderTargetPool.create();h.setSize(A,A),renderCubeTextureToCubeRenderTarget(null,h,r.renderer),r.colorCubeRenderTargetPool.push(h)}r.panoMeshes={},r.updatePanoMeshes(),r.locationMotion=new Motion({count:0,distance:r.camera.pose.distance}),r.modelAlphaMotion=new Motion({modelAlpha:(o=(i=r.models.getMaterial())===null||i===void 0?void 0:i.modelAlpha)!==null&&o!==void 0?o:0}),r.perspToOrthoMotion=new Motion({perspToOrtho:r.camera.perspToOrtho.x}),r.panoResources={},r.panoResources[r.locationMotion.keyframes[0].key=r.locationMotion.keyframes[1].key=createUuid()]={panoId:panoStringify(r.currentPano),panoPicture:(u=(s=r.models.getMaterial())===null||s===void 0?void 0:s.pano1)!==null&&u!==void 0?u:null,position:r.camera.pose.offset.clone(),effect:"fly",fixCameraTransform:new THREE__namespace.Matrix4};var p=r.works.getResolvedObserver(r.currentPano);return r.textureLoader=new TextureLoader,r.tiling=new Tiling(p?getFetcher(p.work):internalFetcher,r.TILED_CUBE_TEXTURE_LEVEL+1,r.imageOptions),r.scene.add(r.tiling.object),r.panoVideo=new PanoVideo,r.scene.add(r.panoVideo.object),r}return t.parseArgs=function(e){var r,i,o,s,u,l;if(e instanceof t)return e;var c=n.parseArgs.call(this,e);return __assign(__assign({},c),{maxAccessibleDistance:(r=e.maxAccessibleDistance)!==null&&r!==void 0?r:5,panoTapTriggerRadius:(i=e.panoTapTriggerRadius)!==null&&i!==void 0?i:.5,panoCircleMeshCreator:(o=e.panoCircleMeshCreator)!==null&&o!==void 0?o:function(d){return new PanoCircleMesh},tileLevelForFov:(s=e.tileLevelForFov)!==null&&s!==void 0?s:function(d,f){var m=function(v){return v/Math.PI*180},A=function(v){return v/180*Math.PI},h=f.height/2/Math.tan(A(d/2)),p=f.width>f.height?d:m(Math.atan(Math.tan(A(d/2))*(f.width/f.height))*2);p*=.9;var y=h*(Math.tan(A(p/2))-Math.tan(A(p/2-1)));return y>80?5:y>60?4:y>30?3:y>18?2:y>12?1:0},tileMaxRequest:(u=e.tileMaxRequest)!==null&&u!==void 0?u: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 __assign(__assign({},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),o=0,s=i;o<s.length;o++){var u=s[o],l=this.panoMeshes[u];this.helper.remove(l),l.dispose(),delete this.panoMeshes[u]}var c=this.videoTexture.image;c.pause(),c.oncanplay=function(){},c.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,m=d.pano1,A=0,h=Object.keys(this.panoResources);A<h.length;A++){var p=h[A],y=this.panoResources[p];if(y.panoPicture){var v=y.panoPicture.map;v&&v!==(f==null?void 0:f.map)&&v!==(m==null?void 0:m.map)&&(v.dispose(),(r=y.panoPicture.luminanceMap)===null||r===void 0||r.dispose(),y.panoPicture=null)}delete this.panoResources[p]}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,o=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),s=((e=o.panoPicture)===null||e===void 0?void 0:e.map)instanceof TileCubeTextureTarget&&(i=(r=o.panoPicture)===null||r===void 0?void 0:r.map.tilePending)!==null&&i!==void 0?i:0,u=this.tiling.pedding;return this.initAnimationed&&s<=0&&u<=0},t.prototype.updateWork=function(e,r,i,o){var s=this;this.userAction=o,this.works=e;var u=t.initAnimationEndState(__assign(__assign({},this),{initial:{currentState:__assign(__assign({},this.currentPano),this.camera.pose),duration:i.duration,effect:i.effect,state:r,userAction:o}})),l={workCode:u.workCode,panoIndex:u.panoIndex},c=this.works.getWork(l.workCode);return this.tiling.setFetcher(c?getFetcher(c):internalFetcher),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(){s.initAnimationed=!0},moveCancelCallback:function(){s.initAnimationed=!0}},o),!0},t.prototype.updateModel=function(e){this.models=e,this.updatePanoMeshes()},t.prototype.updateTime=function(e,r){var i=this,o,s,u,l,c,d,f,m,A,h;if(!this.destroyed){var p={},y={},v=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),g=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),E=!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),p.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(clamp$1(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var b=this.locationMotion.getKeyFrameSegment(e),T=b[0],_=b[1],x=this.panoResourceFromLocationMotionKeyframe(T),R=this.panoResourceFromLocationMotionKeyframe(_),w=new THREE__namespace.Vector3().copy(x.position),S=new THREE__namespace.Vector3().copy(R.position),C=this.locationMotion.value.count-_.value.count+1;p.progress=C,R.panoPicture&&(C<1?x.panoPicture&&(p.pano0=x.panoPicture):p.pano0=R.panoPicture,p.pano1=R.panoPicture),R.effect==="montage"?p.transition="BLACK":R.effect==="spread"?p.transition="SPREAD":p.transition="FADE",(R.effect==="zoomin"||R.effect==="zoomout")&&(p.progress=Math.pow(C,3)),C<1&&R.effect!=="fly"&&(p.pano0&&x.panoPicture&&(p.pano0={map:p.pano0.map,zoom:p.pano0.zoom,luminanceMap:p.pano0.luminanceMap,matrix:x.panoPicture.matrix.clone().premultiply(x.fixCameraTransform).setPosition(R.position)}),w.copy(S),E=!0),y.distance=this.locationMotion.value.distance,y.offset=new THREE__namespace.Vector3(w.x+(S.x-w.x)*C,w.y+(S.y-w.y)*C,w.z+(S.z-w.z)*C);for(var I=[],H=[],B=0,L=this.locationMotion.keyframes;B<L.length;B++){var O=L[B],k=O.key,K=O.progress;k!==void 0&&(I.push(k),K>this.locationMotion.progress&&H.push(k))}for(var z=0,N=Object.keys(this.panoResources);z<N.length;z++){var U=N[z];if(!(H.indexOf(U)>=0)){var Q=this.panoResources[U];if(Q.panoPicture){var G=Q.panoPicture.map,q=Q.panoPicture.luminanceMap;if(G){if(G===((o=p.pano0)===null||o===void 0?void 0:o.map)||G===((s=p.pano1)===null||s===void 0?void 0:s.map))continue;G instanceof TileCubeTextureTarget&&G.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(G.cubeRenderTarget),G.dispose(),q&&(q instanceof TileCubeTextureTarget&&q.cubeRenderTarget&&this.luminanceCubeRenderTargetPool.push(q.cubeRenderTarget),q.dispose()),Q.panoPicture=null}}I.indexOf(U)>=0||delete this.panoResources[U]}}this.currentPano=panoParse(R.panoId),this.emit("pano.moving",createEvent("pano.moving",{userAction:this.userAction,prevPano:panoParse(v.panoId),state:__assign(__assign(__assign(__assign({},panoParse(g.panoId)),{mode:this.mode}),clonePose(this.camera.pose)),y),options:{},progress:this.locationMotion.progress,error:null}))}isEmptyObject(p)===!1&&(!((u=p.pano0)===null||u===void 0)&&u.map&&p.pano0.map instanceof TileCubeTextureTarget&&!p.pano0.map.cubeRenderTarget&&(p.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((l=p.pano0)===null||l===void 0)&&l.luminanceMap&&p.pano0.luminanceMap instanceof TileCubeTextureTarget&&!p.pano0.luminanceMap.cubeRenderTarget&&(p.pano0.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),!((c=p.pano1)===null||c===void 0)&&c.map&&p.pano1.map instanceof TileCubeTextureTarget&&!p.pano1.map.cubeRenderTarget&&(p.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((d=p.pano1)===null||d===void 0)&&d.luminanceMap&&p.pano1.luminanceMap instanceof TileCubeTextureTarget&&!p.pano1.luminanceMap.cubeRenderTarget&&(p.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.models.setMaterial(p)),isEmptyObject(y)===!1&&this.setCamera(y);var j=this.works.getResolvedObserver(this.currentPano),X=this.locationMotion.ended?this.getForwardObserverOrNot():null;if(this.camera.pose.distance>.1||E)for(var ae=0,W=Object.keys(this.panoMeshes);ae<W.length;ae++){var te=W[ae],ee=this.panoMeshes[te];ee.setOpacity(0),ee.setCurrent(!1),ee.updateTime&&ee.updateTime(e,r),ee.visible=!1}else if(j){var ie=arrayMin(j.visibleIds,function(de){var ce=i.works.getResolvedObserver(de);return ce?j.standingPosition.distanceTo(ce.standingPosition):1/0},!0),$=ie[1];$=clamp$1($,2.5,1/0);for(var se=j.visibleIds.concat(panoStringify(this.currentPano)),re=this.camera.getDirection(new THREE__namespace.Vector3),oe=0,pe=Object.keys(this.panoMeshes);oe<pe.length;oe++){var te=pe[oe],ee=this.panoMeshes[te],he=this.works.getResolvedObserver(te);if(se.indexOf(te)===-1)ee.setCurrent(!1),ee.setOpacity(0);else if(!he)ee.setCurrent(!1),ee.setOpacity(0);else if(!he.loadable&&!he.active)ee.setCurrent(!1),ee.setOpacity(0);else{var Ae=ee.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);ee.setCurrent(!ee.loading&&ee.progress===0&&X!==null&&X.panoId===te),ee.setOpacity(Ae<.01?0:clamp$1($/Ae*1.2,.4,.85));var Z=this.camera.position.clone().setY(ee.position.y),Y=new THREE__namespace.Vector3().copy(ee.position).sub(Z).normalize();if(te===panoStringify(this.currentPano)){var V=clamp$1((.5-Z.distanceTo(ee.position))/.5,0,1);Y.multiplyScalar(1-V).add(re.clone().multiplyScalar(V))}Y.length()>0&&ee.quaternion.setFromEuler(new THREE__namespace.Euler(0,Math.atan2(Y.x,Y.z),0))}ee.updateTime&&ee.updateTime(e,r)}}var Ee=this.tileLevel=function(){if(i.tileLevelForFov===!1)return 0;var de=i.renderer.getDrawingBufferSize(new THREE__namespace.Vector2);de.width*=i.scissor.width,de.height*=i.scissor.height;var ce=g.panoId,le=i.works.getResolvedObserver(ce),ue=i.imageOptions.size;if(typeof ue=="undefined"&&le){var Te=le.images.up.match(/\/cube_(\d+)\//);Te&&(ue=Number(Te[1]))}typeof ue=="undefined"&&(ue=2048);var xe=0;ue>=1024&&(xe=1),ue>=2048&&(xe=2),ue>=4096&&(xe=3),ue>=8192&&(xe=4);var Ie=i.tileLevelForFov(i.camera.fov,de);return Ie>xe?Ie:0}(),ge=function(){var de=i.camera.quaternion.clone(),ce=i.works.getResolvedObserver(g.panoId),le=ce!=null?ce:j;le&&de.premultiply(le.quaternion.clone().inverse());var ue=new THREE__namespace.Matrix4().makeRotationFromQuaternion(de),Te=new THREE__namespace.Matrix4().getInverse(ue),xe=new THREE__namespace.Frustum().setFromProjectionMatrix(new THREE__namespace.Matrix4().multiplyMatrices(i.camera.projectionMatrix,Te));return xe}();g.panoId===panoStringify(this.currentPano)&&(((f=g.panoPicture)===null||f===void 0?void 0:f.map)instanceof TileCubeTextureTarget&&(g.panoPicture.map.maxRequest=this.tileMaxRequest,g.panoPicture.map.update(ge,Ee),g.panoPicture.map.needsRender===!0&&(g.panoPicture.map.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)),((m=g.panoPicture)===null||m===void 0?void 0:m.luminanceMap)instanceof TileCubeTextureTarget&&(g.panoPicture.luminanceMap.maxRequest=this.tileMaxRequest,g.panoPicture.luminanceMap.update(ge,Ee),g.panoPicture.luminanceMap.needsRender===!0&&(g.panoPicture.luminanceMap.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)));{var me=this.tiling.object.visible;if(this.initAnimationed){var Re=g.panoId,fe=this.works.getResolvedObserver(Re);fe?isSimilarVector3(this.camera.position,fe.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==Re&&this.tiling.cleanup(),this.tiling.panoId=Re,this.tiling.setResource((h=(A=fe.images)===null||A===void 0?void 0:A.tiles)!==null&&h!==void 0?h:[],this.enableIOSEDR&&fe.images.luminance?fe.images.luminance:null),this.tiling.setFetcher(getFetcher(fe.work)),this.tiling.setRotation(fe.quaternion),this.tiling.setPosition(fe.position),this.tiling.maxRequest=this.tileMaxRequest,Ee>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update(ge,Ee,e):this.tiling.update(ge,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;me!==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(clamp$1(this.cameraMotion.value.fov/45,0,1))}},t.prototype.render=function(e,r){var i=this.renderer.getRenderTarget(),o=this.works.getResolvedObserver(this.currentPano);o&&o.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 LuminanceAdaptiveEffect(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(now())[1],r=this.locationMotion.getKeyFrameSegment(now())[1],i=this.panoResourceFromLocationMotionKeyframe(r),o=this.works.getResolvedObserver(i.panoId);return{workCode:o?o.work.workCode:this.currentPano.workCode,panoIndex:o?o.panoIndex:this.currentPano.panoIndex,mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:o?o.position.clone():this.camera.position.clone(),distance:this.locationMotion.value.distance}},t.prototype.moveToPano=function(e,r,i){var o=this,s,u,l,c,d=(s=r.effect)!==null&&s!==void 0?s:"fly";this.userAction=i,this.stopMomentumMovement();var f=this.works.getResolvedObserver(e);if(!f)throw new Error("Invalid PanoId ".concat(JSON.stringify(e)));var m=getImageSizeFromURL(f.images.up),A=this.imageOptions.size;typeof A=="undefined"&&f&&m&&(A=Number(m)),typeof A=="undefined"&&(A=2048);var h=this.imageOptions.transform,p=__assign({key:"pano.".concat(f.panoId)},pick(this.imageOptions,["format","size","quality","sharpen","mappings"])),y=f.images,v=(l=(u=f.images.tiles)===null||u===void 0?void 0:u.filter(function(L){return L.size>A}))!==null&&l!==void 0?l:null,g=h,E={key:"pano_luminance.".concat(f.panoId),size:p.size?p.size/2:void 0},b=this.enableIOSEDR&&f.images.luminance?f.images.luminance:null,T=function(){if(!f.images.tiles||!b)return null;var L=getImageSizeFromURL(b.up);return L?v==null?void 0:v.map(function(O){var k=O.size*O.scale/2;return L<k?{level:O.level,size:k,scale:1,back:replaceImageSize(b.back,k),front:replaceImageSize(b.front,k),left:replaceImageSize(b.left,k),right:replaceImageSize(b.right,k),up:replaceImageSize(b.up,k),down:replaceImageSize(b.down,k)}:{level:O.level,size:L,scale:k/L,back:b.back,front:b.front,left:b.left,right:b.right,up:b.up,down:b.down}}):null}(),_="pano:"+jsonHash([y,p,h]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===_)return;var x=this.pendingTextureTask.panoId;(c=this.panoMeshes[x])===null||c===void 0||c.setProgress(0),this.emit("pano.texture.abort",createEvent("pano.texture.abort",{error:null,progress:0,meta:null,pano:f.pano}))}var R="move-to-pano-"+f.panoId;this.pending.add(R);var w=this.models.getMaterial()||{},S=w.pano0,C=w.pano1,I;if(S&&S.map.name===_&&S.luminanceMap!==null===this.enableIOSEDR?I=S:(C==null?void 0:C.map.name)===_&&C.luminanceMap!==null===this.enableIOSEDR&&(I=C),I){var H={panoId:f.panoId,effect:d,panoPicture:{zoom:1,map:I.map,luminanceMap:I.luminanceMap,matrix:new THREE__namespace.Matrix4().compose(f.position,f.quaternion,PANO_TEXTURE_SCALE$1)},position:f.position.clone(),fixCameraTransform:new THREE__namespace.Matrix4};AnimationFrameLoop.shared.add(function(){o.pending.delete(R),o.doMoveToPano(f.pano,H,r)},!0,1);return}this.pendingTextureTask={panoId:f.panoId,hash:_,onLoad:function(L,O){var k;if(o.pending.delete(R),o.destroyed)L.body.dispose();else{L.body.name=_;var K={panoId:f.panoId,effect:d,panoPicture:{zoom:1,map:L.body,luminanceMap:(k=O==null?void 0:O.body)!==null&&k!==void 0?k:null,matrix:new THREE__namespace.Matrix4().compose(f.position,f.quaternion,PANO_TEXTURE_SCALE$1)},position:f.position.clone(),fixCameraTransform:new THREE__namespace.Matrix4};o.doMoveToPano(f.pano,K,r)}},onError:function(L){o.pending.delete(R);var O=__assign(__assign(__assign({},f.pano),{mode:o.mode}),clonePose(o.camera.pose));o.emit("pano.error",createEvent("pano.error",{error:L,userAction:o.userAction,options:r,prevPano:o.currentPano,progress:0,state:O})),o.emit("pano.cancel",createEvent("pano.cancel",{error:L,userAction:o.userAction,options:r,prevPano:o.currentPano,progress:0,state:O})),o.emit("error",L),r.moveCancelCallback&&r.moveCancelCallback()}};var B=this.panoMeshes[f.panoId];B&&B.tap&&B.tap(),Promise.all([this.tileLevelForFov&&v&&v.length?this.textureLoader.loadTiledCubeTexture(y,v,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:h,options:p},minFilter:THREE__namespace.LinearFilter,magFilter:THREE__namespace.LinearFilter,generateMipmaps:!1,format:THREE__namespace.RGBAFormat,viaAjax:!0,fetcher:getFetcher(f.work)},void 0,void 0,function(L){var O,k;o.emit("pano.texture.progress",createEvent("pano.texture.progress",{error:null,progress:L,meta:null,pano:f.pano})),((O=o.pendingTextureTask)===null||O===void 0?void 0:O.hash)===_&&((k=o.panoMeshes[f.panoId])===null||k===void 0||k.setProgress(L))},this.renderer):this.textureLoader.loadCubeTexture(y,{imageURL:{transform:h,options:p},format:THREE__namespace.RGBAFormat,viaAjax:!0,fetcher:getFetcher(f.work)},void 0,void 0,function(L){var O,k;o.emit("pano.texture.progress",createEvent("pano.texture.progress",{error:null,progress:L,meta:null,pano:f.pano})),((O=o.pendingTextureTask)===null||O===void 0?void 0:O.hash)===_&&((k=o.panoMeshes[f.panoId])===null||k===void 0||k.setProgress(L))},this.renderer),b?this.tileLevelForFov&&T&&T.length?this.textureLoader.loadTiledCubeTexture(b,T,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:g,options:E},minFilter:THREE__namespace.LinearFilter,magFilter:THREE__namespace.LinearFilter,generateMipmaps:!1,fetcher:getFetcher(f.work)},void 0,void 0,void 0,this.renderer).catch(function(){return null}):this.textureLoader.loadCubeTexture(b,{imageURL:{transform:g,options:E},fetcher:getFetcher(f.work)},void 0,void 0,void 0,this.renderer).catch(function(){return null}):Promise.resolve(null)]).then(function(L){var O,k,K=L[0],z=L[1];((O=o.pendingTextureTask)===null||O===void 0?void 0:O.hash)===_?(o.pendingTextureTask.onLoad(K,z),(k=o.panoMeshes[f.panoId])===null||k===void 0||k.setProgress(0),delete o.pendingTextureTask,o.emit("pano.texture.success",createEvent("pano.texture.success",{error:null,progress:1,meta:K.meta,pano:f.pano}))):(K.body.dispose(),z==null||z.body.dispose())}).catch(function(L){var O,k;((O=o.pendingTextureTask)===null||O===void 0?void 0:O.hash)===_&&(o.pendingTextureTask.onError(L),(k=o.panoMeshes[f.panoId])===null||k===void 0||k.setProgress(0),delete o.pendingTextureTask,o.emit("pano.texture.error",createEvent("pano.texture.error",{error:L,progress:0,meta:null,pano:f.pano})),o.emit("error",L))}),this.emit("pano.texture.load",createEvent("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,o=i.duration,s=i.effect,u=i.userAction;e.userAction=u;var l=t.initAnimationEndState(e),c={workCode:l.workCode,panoIndex:l.panoIndex},d={modelAlpha:0},f={perspToOrtho:0},m=!1;e.moveToPano(c,{longitude:l.longitude,latitude:l.latitude,fov:l.fov,effect:s,duration:o,moveStartCallback:function(A){m=!0,e.perspToOrthoMotion.set(f,o).catch(noop$1),e.modelAlphaMotion.setKeyframes([{progress:0,value:__assign({},e.modelAlphaMotion.value)},{progress:.6,value:__assign({},e.modelAlphaMotion.value)},{progress:1,value:d}],o).catch(noop$1),e.emit("initAnimation.start",createEvent("initAnimation.start",{state:A,userAction:e.userAction}))},moveEndCallback:function(A){e.emit("initAnimation.end",createEvent("initAnimation.end",{state:A,userAction:e.userAction})),e.initAnimationed=!0,r()},moveCancelCallback:function(){var A=__assign(__assign(__assign({},c),{mode:e.mode}),clonePose(e.camera.pose));m===!1&&e.emit("initAnimation.start",createEvent("initAnimation.start",{state:A,userAction:e.userAction})),e.emit("initAnimation.end",createEvent("initAnimation.end",{state:A,userAction:e.userAction})),e.initAnimationed=!0,r()}},u)})},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 o=this.panoResourceFromLocationMotionKeyframe(e[i-1]).position,s=this.panoResourceFromLocationMotionKeyframe(e[i]).position,u=o.distanceTo(s)*(e[i].value.count-e[i-1].value.count);r+=u}return r},t.prototype.updatePanoMeshes=function(){for(var e=this,r={},i=Object.keys(this.panoMeshes),o=0,s=i;o<s.length;o++){var u=s[o],l=this.panoMeshes[u];r[u]=l,delete this.panoMeshes[u]}for(var c=1,d={},f=function(_){var x=arrayMin(_.accessibleIds,function(w){var S=e.works.getResolvedObserver(w);if(!S)return 1/0;var C=S.standingPosition.distanceTo(_.standingPosition);return clamp$1(C,1,1/0)},!0),R=x[1];d[_.panoId]===void 0&&(d[_.panoId]=R)},m=0,A=this.works.resolvedObservers;m<A.length;m++){var h=A[m];f(h)}var p=Object.keys(d).map(function(_){return d[_]});if(p.length){var y=p.reduce(function(_,x){return _+x},0)/p.length;c=clamp$1(y*.6,1,3)}for(var v=0,g=this.works.resolvedObservers;v<g.length;v++){var h=g[v],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(c,1,c),l.position.copy(h.standingPosition),this.panoMeshes[h.panoId]=l}for(var E=0,b=Object.keys(r);E<b.length;E++){var T=b[E];this.helper.remove(r[T]),r[T].dispose(),delete r[T]}},t.prototype.doMoveToPano=function(e,r,i){var o=this,s,u,l,c,d,f,m,A,h,p,y;i===void 0&&(i={});var v=now(),g=createUuid();this.tiling.cleanup(),this.panoResources[g]=r;var E=1,b,T,_;if(this.locationMotion.ended){var x=this.locationMotion.getKeyFrameSegment(v);x[0];var R=x[1],w=this.locationMotion.value,S=((s=this.panoResourceFromLocationMotionKeyframe(R))!==null&&s!==void 0?s:this.camera).position,C=r.position;b=Math.max(S.distanceTo(C),E),T=[{key:R.key,progress:0,value:__assign(__assign({},w),{count:0})},{key:g,progress:1,value:{distance:0,count:1}}],_=0}else{var I=this.locationMotion.getKeyFrameSegment(v),H=I[0],R=I[1],w=this.locationMotion.value,B=this.panoResourceFromLocationMotionKeyframe(H).position,S=this.panoResourceFromLocationMotionKeyframe(R).position,C=r.position,L=R.value.count-w.count,O=Math.max(B.distanceTo(S),E)*L,k=Math.max(S.distanceTo(C),E);b=O+k,T=[{key:H.key,progress:0,value:__assign({},w)},{key:R.key,progress:O/b,value:R.value},{key:g,progress:1,value:{count:R.value.count+1,distance:0}}];var K=this.locationMotionKeyframesLength(this.locationMotion.keyframes),z=this.locationMotionKeyframesLength(T);K===0||K===0?_=0:_=this.locationMotion.getProgressVelocity(v)*K/z}var N=r.effect==="instant"?0:this.calculateMovingDuration(i.duration,r.effect==="fly"?b:0),U={longitude:i.longitude,latitude:i.latitude,fov:i.fov},Q=__assign(__assign({},e),{mode:this.mode,longitude:(u=U.longitude)!==null&&u!==void 0?u:this.camera.pose.longitude,latitude:(l=U.latitude)!==null&&l!==void 0?l:this.camera.pose.latitude,fov:(c=U.fov)!==null&&c!==void 0?c:this.camera.pose.fov,offset:r.position.clone(),distance:this.camera.pose.distance}),G=this.currentPano;if(this.emit("pano.moveTo",createEvent("pano.moveTo",{options:i,prevPano:G,progress:0,state:Q,userAction:this.userAction,error:null})),i.moveStartCallback&&i.moveStartCallback(Q),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=noop$1,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),r.effect==="fly")this.cameraMotion.set(U,N).catch(noop$1);else{var q=coordinatesToVector({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),j=coordinatesToVector({longitude:(d=U.longitude)!==null&&d!==void 0?d:this.cameraMotion.value.longitude,latitude:(f=U.latitude)!==null&&f!==void 0?f:this.cameraMotion.value.latitude}),X=new THREE__namespace.Object3D;X.lookAt(q);var ae=new THREE__namespace.Matrix4().makeRotationFromQuaternion(X.quaternion);X.lookAt(j);var W=new THREE__namespace.Matrix4().makeRotationFromQuaternion(X.quaternion),te=new THREE__namespace.Matrix4().getInverse(ae).premultiply(W),ee=this.cameraMotion.value.fov,ie=(m=U.fov)!==null&&m!==void 0?m:this.cameraMotion.value.fov,$=1;r.effect==="zoomin"?$=1.5:r.effect==="zoomout"&&($=.4);for(var se=clamp$1(ie*$,1,170),re=0;re<T.length-1;re++){var oe=T[re].key;if(oe){var pe=this.panoResources[oe];pe&&(pe.fixCameraTransform.copy(te),pe.panoPicture&&(pe.panoPicture.zoom=Math.tan(ee/2/180*Math.PI)/Math.tan(se/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=U.longitude)!==null&&A!==void 0?A:this.cameraMotion.value.longitude,latitude:(h=U.latitude)!==null&&h!==void 0?h:this.cameraMotion.value.latitude,fov:se}},{progress:1,value:{longitude:(p=U.longitude)!==null&&p!==void 0?p:this.cameraMotion.value.longitude,latitude:(y=U.latitude)!==null&&y!==void 0?y:this.cameraMotion.value.latitude,fov:ie}}],N).catch(noop$1)}var he=this.locationMotion.setKeyframes(T,N,_);he.then(function(){for(var Ae,Z,Y=0,V=o.models;Y<V.length;Y++){var Ee=V[Y];Ee.show()}var ge=__assign(__assign({},e),{mode:o.mode,longitude:o.camera.pose.longitude,latitude:o.camera.pose.latitude,fov:o.camera.pose.fov,offset:o.camera.pose.offset.clone(),distance:o.camera.pose.distance});o.emit("pano.arrived",createEvent("pano.arrived",{options:i,prevPano:G,progress:1,state:ge,userAction:o.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(ge);var me=o.works.getResolvedObserver(e);if(me&&me.video&&o.videoTexture&&o.videoTexture.image instanceof HTMLVideoElement){var Re=ROTATE_Y_PI_MATRIX$1.clone().multiply((Z=(Ae=o.models.getMaterial().pano1)===null||Ae===void 0?void 0:Ae.matrix)!==null&&Z!==void 0?Z:new THREE__namespace.Matrix4).multiply(me.video.matrix),fe={map:o.videoTexture,size:me.video.size,matrix:Re,alpha:1},de=createUuid(),ce=o.videoTexture.image;ce.setAttribute("uuid",de),canplayVideo().then(function(le){le&&me.video&&ce.getAttribute("uuid")===de&&(ce.oncanplay=function(){ce.oncanplay=noop$1,ce.play()},ce.ontimeupdate=function(){ce.currentTime>.5&&(ce.ontimeupdate=noop$1,o.panoVideo.setMaterial(fe))},ce.src=me.video.source)}).catch(function(){ce.removeAttribute("uuid")})}},function(){o.emit("pano.cancel",createEvent("pano.cancel",{options:i,prevPano:G,progress:0,state:Q,userAction:o.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 o=e!=null?e:new THREE__namespace.Raycaster(this.camera.position.clone(),this.camera.getDirection(new THREE__namespace.Vector3));o.params.Points={threshold:.1};var s=i.standingPosition.clone();if(i.position.distanceTo(o.ray.origin)>1){var u=this.models.intersectRaycaster(new THREE__namespace.Raycaster(o.ray.origin,new THREE__namespace.Vector3(0,-1,0)))[0];u&&u.distance<=2?s.copy(u.point):s.copy(o.ray.origin).add(new THREE__namespace.Vector3(0,-1.5,0))}var l=this.models.intersectRaycaster(o)[0],c=l?l.point:o.ray.origin.clone().add(o.ray.direction.clone().normalize().multiplyScalar(3)),d=c.clone().sub(s).normalize();if(d.length()===0)return null;for(var f=i.accessibleIds.filter(function(T){if(T===panoStringify(r.currentPano))return!1;var _=r.works.getResolvedObserver(T);if(!_)return!1;var x=_.standingPosition.clone().project(r.camera);return Math.abs(x.z)>1||Math.abs(x.x)>1||Math.abs(x.y)>1?!1:_.loadable||_.active}),m=f.slice().sort(function(T,_){var x=r.works.getResolvedObserver(T).standingPosition.clone().distanceTo(s),R=r.works.getResolvedObserver(_).standingPosition.clone().distanceTo(s);return x-R}),A=0,h=[Math.PI/8,Math.PI/6,Math.PI/4,Math.PI/3];A<h.length;A++)for(var p=h[A],y=0,v=m;y<v.length;y++){var g=v[y],E=this.works.getResolvedObserver(g);if(E){var b=E.standingPosition.clone().sub(s);if(b&&b.length()!==0&&d.angleTo(b)<p)return E}}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 o=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]);if(o.panoId!==panoStringify(this.currentPano))return}var s=e.center.raycaster,u=this.camera.getDirection(new THREE__namespace.Vector3).setY(0),l=null,c=this.works.getResolvedObserver(this.currentPano);if(c){var d=c.accessibleIds.filter(function(z){if(z===panoStringify(r.currentPano))return!1;var N=r.works.getResolvedObserver(z);return!N||N.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:N.loadable||N.active}),f=this.models.intersectRaycaster(s)[0];if(f){var m=arrayMin(d,function(z){var N=r.works.getResolvedObserver(z);if(!N)return 1/0;var U=N.standingPosition.clone();return U.distanceTo(f.point)},!0),A=m[0],h=m[1];A&&h<this.panoTapTriggerRadius&&(l=(i=this.works.getResolvedObserver(A))!==null&&i!==void 0?i:null)}l||(l=this.getForwardObserverOrNot(s));for(var p=0,y=this.locationMotion.keyframes;p<y.length;p++){var v=y[p],g=this.panoResourceFromLocationMotionKeyframe(v);if(!(v.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 E={},b=Math.PI/6,T=Math.PI/12,_=l.position.clone().setY(0).sub(c.position.clone().setY(0)).normalize(),x=[],R=[],w=[],S=0,C=l.accessibleIds;S<C.length;S++){var A=C[S],I=panoParse(A);if(!(panoEqual(I,this.currentPano)||panoEqual(I,l.pano))){var H=this.works.getResolvedObserver(A);if(H){var B=H.position.clone().sub(l.position).setY(0);_.angleTo(B)<b&&w.push(B)}}}var L=w.length>0?w:__spreadArray(__spreadArray([],x,!0),R,!0),O=L.slice().sort(function(z,N){return z.angleTo(_)-N.angleTo(_)})[0];O&&O.angleTo(u)>T&&(E.longitude=Math.atan2(-O.x,-O.z)),this.cameraMotion.value.latitude<-Math.PI/4&&(E.latitude=clamp$1(0,this.minLatitude,this.maxLatitude));var k=__assign({},e.state);if(k.workCode=l.pano.workCode,k.panoIndex=l.pano.panoIndex,E.longitude!==void 0&&(k.longitude=E.longitude),E.latitude!==void 0&&(k.latitude=E.latitude),E.fov!==void 0&&(k.fov=E.fov),k.distance=0,k.offset=l.position.clone(),e.state=k,this.emit("gesture.tap",e),!e.defaultPrevented){if(this.emit("pano.select",createEvent("pano.select",{prevPano:this.currentPano,state:k,userAction:e.userAction,options:E,progress:0,error:null})),l&&!l.active){var K=l.panoId;this.panoMeshes[K]&&(this.panoMeshes[K].setDisabled(!1),this.panoMeshes[K].setLoading(!0))}l&&l.active&&this.emit("pano.request",createEvent("pano.request",{userAction:e.userAction,prevPano:this.currentPano,progress:0,state:k,options:E,error:null}))}}}}},t}(PanoramaLikeController),DEG_TO_RAD=Math.PI/180,RAD_TO_DEG=180/Math.PI,MIN_TIMESTEP=.001,MAX_TIMESTEP=1,isIOS=function(){var n=typeof navigator!="undefined"&&/iPad|iPhone|iPod/.test(navigator.platform);return function(){return n}}(),isSafari=function(){var n=typeof navigator!="undefined"&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent);return function(){return n}}(),isFirefoxAndroid=function(){var n=typeof navigator!="undefined"&&navigator.userAgent.indexOf("Firefox")!==-1&&navigator.userAgent.indexOf("Android")!==-1;return function(){return n}}(),getChromeVersion=function(){var n=typeof navigator!="undefined"?navigator.userAgent.match(/.*Chrome\/([0-9]+)/):null,t=n?parseInt(n[1],10):null;return function(){return t}}(),isChromeWithoutDeviceMotion=function(){var n=!1;if(getChromeVersion()===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}}(),isSafariWithoutDeviceMotion=function(){var n=isIOS()&&isSafari()&&typeof navigator!="undefined"&&navigator.userAgent.indexOf("13_4")!==-1;return function(){return n}}(),isR7=function(){var n=typeof navigator!="undefined"&&navigator.userAgent.indexOf("R7 Build")!==-1;return function(){return n}}();function isLandscapeMode(){var n=typeof window!="undefined"&&(window.orientation==90||window.orientation==-90);return isR7()?!n:n}function isTimestampDeltaValid(n){return!(isNaN(n)||n<=MIN_TIMESTEP||n>MAX_TIMESTEP)}function getQuaternionAngle(n){if(n.w>1)return 0;var t=2*Math.acos(n.w);return t}var warnOnce=function(){var n={};return function(t,e){n[t]===void 0&&(console.warn("cardboard: "+e),n[t]=!0)}}();function getOriginFromUrl(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 isInsideCrossOriginIFrame(){if(typeof window=="undefined"||typeof document=="undefined")return!1;var n=window.self!==window.top,t=getOriginFromUrl(document.referrer),e=getOriginFromUrl(window.location.href);return n&&t!==e}var updateEyeViewMatrices=function(){function n(r,i,o){var s=i?i[0]:0,u=i?i[1]:0,l=i?i[2]:0,c=i?i[3]:1,d=s+s,f=u+u,m=l+l,A=s*d,h=s*f,p=s*m,y=u*f,v=u*m,g=l*m,E=c*d,b=c*f,T=c*m;return r[0]=1-(y+g),r[1]=h+T,r[2]=p-b,r[3]=0,r[4]=h-T,r[5]=1-(A+g),r[6]=v+E,r[7]=0,r[8]=p+b,r[9]=v-E,r[10]=1-(A+y),r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function t(r,i,o){var s=o[0],u=o[1],l=o[2],c,d,f,m,A,h,p,y,v,g,E,b;return i===r?(r[12]=i[0]*s+i[4]*u+i[8]*l+i[12],r[13]=i[1]*s+i[5]*u+i[9]*l+i[13],r[14]=i[2]*s+i[6]*u+i[10]*l+i[14],r[15]=i[3]*s+i[7]*u+i[11]*l+i[15]):(c=i[0],d=i[1],f=i[2],m=i[3],A=i[4],h=i[5],p=i[6],y=i[7],v=i[8],g=i[9],E=i[10],b=i[11],r[0]=c,r[1]=d,r[2]=f,r[3]=m,r[4]=A,r[5]=h,r[6]=p,r[7]=y,r[8]=v,r[9]=g,r[10]=E,r[11]=b,r[12]=c*s+A*u+v*l+i[12],r[13]=d*s+h*u+g*l+i[13],r[14]=f*s+p*u+E*l+i[14],r[15]=m*s+y*u+b*l+i[15]),r}function e(r,i){var o=i[0],s=i[1],u=i[2],l=i[3],c=i[4],d=i[5],f=i[6],m=i[7],A=i[8],h=i[9],p=i[10],y=i[11],v=i[12],g=i[13],E=i[14],b=i[15],T=o*d-s*c,_=o*f-u*c,x=o*m-l*c,R=s*f-u*d,w=s*m-l*d,S=u*m-l*f,C=A*g-h*v,I=A*E-p*v,H=A*b-y*v,B=h*E-p*g,L=h*b-y*g,O=p*b-y*E,k=T*O-_*L+x*B+R*H-w*I+S*C;return k?(k=1/k,r[0]=(d*O-f*L+m*B)*k,r[1]=(u*L-s*O-l*B)*k,r[2]=(g*S-E*w+b*R)*k,r[3]=(p*w-h*S-y*R)*k,r[4]=(f*H-c*O-m*I)*k,r[5]=(o*O-u*H+l*I)*k,r[6]=(E*x-v*S-b*_)*k,r[7]=(A*S-p*x+y*_)*k,r[8]=(c*L-d*H+m*C)*k,r[9]=(s*H-o*L-l*C)*k,r[10]=(v*w-g*x+b*T)*k,r[11]=(h*x-A*w-y*T)*k,r[12]=(d*I-c*B-f*C)*k,r[13]=(o*B-s*I+u*C)*k,r[14]=(g*_-v*R-E*T)*k,r[15]=(A*R-h*_+p*T)*k,r):null}return function(r,i,o){n(r,i),o&&t(r,r,o),e(r,r)}}(),SensorSample=function(){function n(t,e){t===void 0&&(t=new THREE__namespace.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}(),ComplementaryFilter=function(){function n(t,e){this.kFilter=t,this.isDebug=e,this.currentAccelMeasurement=new SensorSample,this.currentGyroMeasurement=new SensorSample,this.previousGyroMeasurement=new SensorSample,isIOS()?this.filterQ=new THREE__namespace.Quaternion(-1,0,0,1):this.filterQ=new THREE__namespace.Quaternion(1,0,0,1),this.previousFilterQ=new THREE__namespace.Quaternion,this.previousFilterQ.copy(this.filterQ),this.accelQ=new THREE__namespace.Quaternion,this.isOrientationInitialized=!1,this.estimatedGravity=new THREE__namespace.Vector3,this.measuredGravity=new THREE__namespace.Vector3,this.gyroIntegralQ=new THREE__namespace.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;isTimestampDeltaValid(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 THREE__namespace.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 THREE__namespace.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)",RAD_TO_DEG*getQuaternionAngle(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 o=new THREE__namespace.Quaternion;o.copy(this.filterQ),o.multiply(i),this.filterQ.slerp(o,1-this.kFilter),this.previousFilterQ.copy(this.filterQ)},n.prototype.accelToQuaternion_=function(t){var e=new THREE__namespace.Vector3;e.copy(t),e.normalize();var r=new THREE__namespace.Quaternion;return r.setFromUnitVectors(new THREE__namespace.Vector3(0,0,-1),e),r.inverse(),r},n.prototype.gyroToQuaternionDelta_=function(t,e){var r=new THREE__namespace.Quaternion,i=new THREE__namespace.Vector3;return i.copy(t),i.normalize(),r.setFromAxisAngle(i,t.length()*e),r},n}(),PosePredictor=function(){function n(t,e){this.predictionTimeS=t,this.isDebug=e,this.previousQ=new THREE__namespace.Quaternion,this.previousTimestampS=null,this.deltaQ=new THREE__namespace.Quaternion,this.outQ=new THREE__namespace.Quaternion}return n.prototype.getPrediction=function(t,e,r){if(!this.previousTimestampS)return this.previousQ.copy(t),this.previousTimestampS=r,t;var i=new THREE__namespace.Vector3;i.copy(e),i.normalize();var o=e.length();if(o<DEG_TO_RAD*20)return this.isDebug&&console.log("Moving slowly, at %s deg/s: no prediction",(RAD_TO_DEG*o).toFixed(1)),this.outQ.copy(t),this.previousQ.copy(t),this.outQ;var s=o*this.predictionTimeS;return this.deltaQ.setFromAxisAngle(i,s),this.outQ.copy(this.previousQ),this.outQ.multiply(this.deltaQ),this.previousQ.copy(t),this.previousTimestampS=r,this.outQ},n}(),Distortion=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 o=t-this.distort(r),s=r-o*((r-e)/(o-i));e=r,r=s,i=o}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}(),Pose=function(){function n(){this.angularAcceleration=null,this.angularVelocity=null,this.linearAcceleration=null,this.linearVelocity=null,this.orientation=null,this.position=null}return n}(),FieldOfView=function(){function n(){this.leftDegrees=0,this.rightDegrees=0,this.upDegrees=0,this.downDegrees=0}return n}(),Sensor=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 THREE__namespace.Vector3,this.gyroscope=new THREE__namespace.Vector3,this.filter=new ComplementaryFilter(t,i),this.posePredictor=new PosePredictor(e,i),this.isFirefoxAndroid=isFirefoxAndroid(),this.isIOS=isIOS();var o=getChromeVersion();this.isDeviceMotionInRadians=!this.isIOS&&o!==null&&o<66,this.isWithoutDeviceMotion=isChromeWithoutDeviceMotion()||isSafariWithoutDeviceMotion(),this.filterToWorldQ=new THREE__namespace.Quaternion,isIOS()?this.filterToWorldQ.setFromAxisAngle(new THREE__namespace.Vector3(1,0,0),Math.PI/2):this.filterToWorldQ.setFromAxisAngle(new THREE__namespace.Vector3(1,0,0),-Math.PI/2),this.inverseWorldToScreenQ=new THREE__namespace.Quaternion,this.worldToScreenQ=new THREE__namespace.Quaternion,this.originalPoseAdjustQ=new THREE__namespace.Quaternion;var s=typeof window!="undefined"?-window.orientation*Math.PI/180:0;this.originalPoseAdjustQ.setFromAxisAngle(new THREE__namespace.Vector3(0,0,1),s),this.setScreenTransform_(),isLandscapeMode()&&this.filterToWorldQ.multiply(this.inverseWorldToScreenQ),this.resetQ=new THREE__namespace.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 o=new THREE__namespace.Quaternion().setFromAxisAngle(new THREE__namespace.Vector3(0,0,-1),0),s=new THREE__namespace.Quaternion;return typeof window!="undefined"&&window.orientation===-90?s.setFromAxisAngle(new THREE__namespace.Vector3(0,1,0),Math.PI/-2):s.setFromAxisAngle(new THREE__namespace.Vector3(0,1,0),Math.PI/2),o.multiply(s)}(),this.deviceOrientationFilterToWorldQ=this.deviceOrientationFilterToWorldQ||function(){var o=new THREE__namespace.Quaternion;return o.setFromAxisAngle(new THREE__namespace.Vector3(1,0,0),-Math.PI/2),o}(),t=this._deviceOrientationQ;var e=new THREE__namespace.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 THREE__namespace.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 Pose;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(),isLandscapeMode()&&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),updateEyeViewMatrices(t.leftViewMatrix,e,r.left),updateEyeViewMatrices(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 isIOS()&&isInsideCrossOriginIFrame()&&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 o=t.left.upDegrees*DEG_TO_RAD,s=t.left.downDegrees*DEG_TO_RAD,u=t.left.leftDegrees*DEG_TO_RAD,l=t.left.rightDegrees*DEG_TO_RAD,c=2/(u+l),d=2/(o+s);i.left[0]=c,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]=-((u-l)*c*.5),i.left[9]=(o-s)*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 o=t.right.upDegrees*DEG_TO_RAD,s=t.right.downDegrees*DEG_TO_RAD,u=t.right.leftDegrees*DEG_TO_RAD,l=t.right.rightDegrees*DEG_TO_RAD,c=2/(u+l),d=2/(o+s);i.right[0]=c,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]=-((u-l)*c*.5),i.right[9]=(o-s)*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 Distortion(t.distortionCoefficients),i=t.screenLensDistance,o=(e.widthMeters-t.interLensDistance)/2,s=t.interLensDistance/2,u=t.baselineLensDistance-e.bevelMeters,l=e.heightMeters-u,c=RAD_TO_DEG*Math.atan(r.distort(o/i)),d=RAD_TO_DEG*Math.atan(r.distort(s/i)),f=RAD_TO_DEG*Math.atan(r.distort(u/i)),m=RAD_TO_DEG*Math.atan(r.distort(l/i)),A=new FieldOfView,h=new FieldOfView;return A.leftDegrees=Math.min(c,t.fov),A.rightDegrees=Math.min(d,t.fov),A.downDegrees=Math.min(f,t.fov),A.upDegrees=Math.min(m,t.fov),h.leftDegrees=A.rightDegrees,h.rightDegrees=A.leftDegrees,h.upDegrees=A.upDegrees,h.downDegrees=A.downDegrees,{left:A,right:h}},n.prototype.onDeviceOrientation_=function(t){this._deviceOrientationQ=this._deviceOrientationQ||new THREE__namespace.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 THREE__namespace.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,o=i-this.previousTimestampS;if(o<0){warnOnce("fusion-pose-sensor:invalid:non-monotonic","Invalid timestamps detected: non-monotonic timestamp from devicemotion"),this.previousTimestampS=i;return}else if(o<=MIN_TIMESTEP||o>MAX_TIMESTEP){warnOnce("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&&(isR7()?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 THREE__namespace.Vector3(0,0,1),-Math.PI/2);break;case-90:this.worldToScreenQ.setFromAxisAngle(new THREE__namespace.Vector3(0,0,1),Math.PI/2);break}this.inverseWorldToScreenQ.copy(this.worldToScreenQ),this.inverseWorldToScreenQ.inverse()},n}(),defaultLeftBounds=[0,0,.5,1],defaultRightBounds=[.5,0,.5,1],Cardboard=function(){function n(t){var e=this;this.renderer=t,this.sensor=new Sensor(.98,.04,!1,!1),this.scale=1,this.cameraL=new THREE__namespace.PerspectiveCamera,this.cameraR=new THREE__namespace.PerspectiveCamera;var r=this.sensor.start();this.dispose=function(){var i=e.renderer.getSize(new THREE__namespace.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 THREE__namespace.Vector2);if(r.width>r.height){var i=t.autoUpdate;i&&(t.updateMatrixWorld(),t.autoUpdate=!1);var o={x:Math.round(r.width*defaultLeftBounds[0]),y:Math.round(r.height*defaultLeftBounds[1]),width:Math.round(r.width*defaultLeftBounds[2]),height:Math.round(r.height*defaultLeftBounds[3])},s={x:Math.round(r.width*defaultRightBounds[0]),y:Math.round(r.height*defaultRightBounds[1]),width:Math.round(r.width*defaultRightBounds[2]),height:Math.round(r.height*defaultRightBounds[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 u=this.sensor.getEyeOffset();this.cameraL.translateOnAxis(new THREE__namespace.Vector3().fromArray(u.left),this.scale),this.cameraR.translateOnAxis(new THREE__namespace.Vector3().fromArray(u.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(o.x,o.y,o.width,o.height),this.renderer.setScissor(o.x,o.y,o.width,o.height),this.renderer.render(t,this.cameraL),this.renderer.setViewport(s.x,s.y,s.width,s.height),this.renderer.setScissor(s.x,s.y,s.width,s.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 cardboard="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAADqCAMAAAAvZYhaAAAC/VBMVEUAAAD///99fX37+/v5+fn29vbx8fHv7+/Nzc3o6Ojq6urh4eHU1NTR0dGDg4Pl5eWSkpLHx8fj4+Pe3t7X19fAwMDZ2dnCwsKrq6uioqLb29uNjY2enp67u7t5eXmAgIC2traWlpa5ubnKysqmpqZycnKHh4eurq6ysrKKioqDg4Pd3d12dnb9/f1vb2/s7OxlZWXz8/OoqKiZmZlpaWmbm5teXl7W1tbJycnExMRiYmJsbGywsLCPj49aWlq9vb1UVFRYWFhra2t+fn7t7e1RUVFOTk6Dg4OAgICCgoKKioqEhISIiIhqamqCgoKIiIiQkJCIiIiWlpaws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AkRHH1JKjpNEcCxOV2I8MWyiUJqNVajSVodgiWcVMVLVeSS1ATCZoc88qjVKlSc3kSLJ5c5V6rTZQAcVkGbBeuOkgCgq2CBM3MoFwGr1tvim2aMpZZqyBBc3N1UF2GX90j9SQJKCBB83OfYAcNVjFcSrvzo95WOShB83Ody5V24fqzO0nAUSzB/89Nph38VqmuOa3gticJOP9fApuHTDt4nFJ7AXdPC0lg8/gq8y5XapSrgpUgbQ0JpF5u97hS1fOC26nlJJA8Yd41Sg3fU4dtRQkKeXSN3jo4Qqm0397OmyZOGatoDrScBIWM3DFn5kXi1ZyqRSUoZtKOa1vWKArztqgEnhIHty4f9/btuEstKwGkxf+XuCT5CbTFnFRuxktuAAAAAElFTkSuQmCC";var _a,LOCALE={zh:{TITLE:"眼镜模式",HIT:"请将手机横屏放入 VR 眼镜中"},en:{TITLE:"GLASSES MODE",HIT:"Please put the mobile phone horizontally into the VR glasses."},ja:{TITLE:"メガネモード",HIT:"携帯電話をVRメガネに水平に入れてください。"}},TEXT=typeof navigator!="undefined"&&(_a=LOCALE[navigator.language.split("-")[0]])!==null&&_a!==void 0?_a:LOCALE.zh,CONTENTS=`
1488
+ `,PanoVideo=function(){function n(){this.material=new THREE__namespace.ShaderMaterial({vertexShader:PANO_VIDEO_MATERIAL_VERTEX_SHADER,fragmentShader:PANO_VIDEO_TILE_MATERIAL_FRAGMENT_SHADER,uniforms:{size:new THREE__namespace.Uniform(null),matrix:new THREE__namespace.Uniform(null),alpha:new THREE__namespace.Uniform(null),map:new THREE__namespace.Uniform(null)},depthTest:!1,depthWrite:!1,defines:{USE_PANO_VIDEO:!1},blending:THREE__namespace.CustomBlending,blendSrc:THREE__namespace.SrcAlphaFactor,blendDst:THREE__namespace.OneMinusSrcAlphaFactor,blendSrcAlpha:THREE__namespace.OneFactor,blendDstAlpha:THREE__namespace.OneMinusSrcAlphaFactor}),this.object=new THREE__namespace.Mesh(sharedGeometry$1,this.material),this.object.visible=!1,this.object.renderOrder=-1,this.object.frustumCulled=!1,this.object.name="pano-video",this.alphaMotion=new Motion({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(noop$1),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(noop$1));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}(),ROTATE_Y_PI_MATRIX$1=new THREE__namespace.Matrix4().makeRotationAxis(new THREE__namespace.Vector3(0,1,0),Math.PI),PANO_TEXTURE_SCALE$1=new THREE__namespace.Vector3(-1,1,1),CubeRenderTargetPool=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 THREE__namespace.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}(),PanoramaController=function(n){__extends(t,n);function t(e){var r=this,i,o,s,u,c=t.parseArgs(e);r=n.call(this,c)||this,r.TILED_CUBE_TEXTURE_LEVEL=2,r.mode="Panorama",r.tileLevel=0,r.initAnimationed=!1,r.maxAccessibleDistance=c.maxAccessibleDistance,r.panoTapTriggerRadius=c.panoTapTriggerRadius,r.panoCircleMeshCreator=c.panoCircleMeshCreator,r.tileLevelForFov=c.tileLevelForFov,r.tileMaxRequest=c.tileMaxRequest,r.luminanceAdaptiveEffectEnable=c.luminanceAdaptiveEffectEnable,r.luminanceAdaptiveEffect=new LuminanceAdaptiveEffect(r.renderer,r.modelScene,r.camera,r.models),r.colorCubeRenderTargetPool=new CubeRenderTargetPool,r.luminanceCubeRenderTargetPool=new CubeRenderTargetPool;var l=r.models.getMaterial()||{},d=l.pano0,f=l.pano1;d&&(f==null?void 0:f.map)!==d.map&&(r.models.setMaterial({pano0:f}),d.map.dispose(),d.map instanceof TileCubeTextureTarget&&d.map.cubeRenderTarget&&r.colorCubeRenderTargetPool.push(d.map.cubeRenderTarget),d.luminanceMap&&(d.luminanceMap.dispose(),d.luminanceMap instanceof TileCubeTextureTarget&&d.luminanceMap.cubeRenderTarget&&r.luminanceCubeRenderTargetPool.push(d.luminanceMap.cubeRenderTarget)));for(var v=r.colorCubeRenderTargetPool.size;v<2;v++){var A=Math.max(1024*r.TILED_CUBE_TEXTURE_LEVEL,512),h=r.colorCubeRenderTargetPool.create();h.setSize(A,A),renderCubeTextureToCubeRenderTarget(null,h,r.renderer),r.colorCubeRenderTargetPool.push(h)}r.panoMeshes={},r.updatePanoMeshes(),r.locationMotion=new Motion({count:0,distance:r.camera.pose.distance}),r.modelAlphaMotion=new Motion({modelAlpha:(o=(i=r.models.getMaterial())===null||i===void 0?void 0:i.modelAlpha)!==null&&o!==void 0?o:0}),r.perspToOrthoMotion=new Motion({perspToOrtho:r.camera.perspToOrtho.x}),r.panoResources={},r.panoResources[r.locationMotion.keyframes[0].key=r.locationMotion.keyframes[1].key=createUuid()]={panoId:panoStringify(r.currentPano),panoPicture:(u=(s=r.models.getMaterial())===null||s===void 0?void 0:s.pano1)!==null&&u!==void 0?u:null,position:r.camera.pose.offset.clone(),effect:"fly",fixCameraTransform:new THREE__namespace.Matrix4};var p=r.works.getResolvedObserver(r.currentPano);return r.textureLoader=new TextureLoader,r.tiling=new Tiling(p?getFetcher(p.work):internalFetcher,r.TILED_CUBE_TEXTURE_LEVEL+1,r.imageOptions),r.scene.add(r.tiling.object),r.panoVideo=new PanoVideo,r.scene.add(r.panoVideo.object),r}return t.parseArgs=function(e){var r,i,o,s,u,c;if(e instanceof t)return e;var l=n.parseArgs.call(this,e);return __assign(__assign({},l),{maxAccessibleDistance:(r=e.maxAccessibleDistance)!==null&&r!==void 0?r:5,panoTapTriggerRadius:(i=e.panoTapTriggerRadius)!==null&&i!==void 0?i:.5,panoCircleMeshCreator:(o=e.panoCircleMeshCreator)!==null&&o!==void 0?o:function(d){return new PanoCircleMesh},tileLevelForFov:(s=e.tileLevelForFov)!==null&&s!==void 0?s:function(d,f){var v=function(m){return m/Math.PI*180},A=function(m){return m/180*Math.PI},h=f.height/2/Math.tan(A(d/2)),p=f.width>f.height?d:v(Math.atan(Math.tan(A(d/2))*(f.width/f.height))*2);p*=.9;var y=h*(Math.tan(A(p/2))-Math.tan(A(p/2-1)));return y>80?5:y>60?4:y>40?3:y>18?2:y>12?1:0},tileMaxRequest:(u=e.tileMaxRequest)!==null&&u!==void 0?u:3,luminanceAdaptiveEffectEnable:(c=e.luminanceAdaptiveEffectEnable)!==null&&c!==void 0?c:!0})},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return __assign(__assign({},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),o=0,s=i;o<s.length;o++){var u=s[o],c=this.panoMeshes[u];this.helper.remove(c),c.dispose(),delete this.panoMeshes[u]}var l=this.videoTexture.image;l.pause(),l.oncanplay=function(){},l.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,v=d.pano1,A=0,h=Object.keys(this.panoResources);A<h.length;A++){var p=h[A],y=this.panoResources[p];if(y.panoPicture){var m=y.panoPicture.map;m&&m!==(f==null?void 0:f.map)&&m!==(v==null?void 0:v.map)&&(m.dispose(),(r=y.panoPicture.luminanceMap)===null||r===void 0||r.dispose(),y.panoPicture=null)}delete this.panoResources[p]}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,o=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),s=((e=o.panoPicture)===null||e===void 0?void 0:e.map)instanceof TileCubeTextureTarget&&(i=(r=o.panoPicture)===null||r===void 0?void 0:r.map.tilePending)!==null&&i!==void 0?i:0,u=this.tiling.pedding;return this.initAnimationed&&s<=0&&u<=0},t.prototype.updateWork=function(e,r,i,o){var s=this;this.userAction=o,this.works=e;var u=t.initAnimationEndState(__assign(__assign({},this),{initial:{currentState:__assign(__assign({},this.currentPano),this.camera.pose),duration:i.duration,effect:i.effect,state:r,userAction:o}})),c={workCode:u.workCode,panoIndex:u.panoIndex},l=this.works.getWork(c.workCode);return this.tiling.setFetcher(l?getFetcher(l):internalFetcher),this.tiling.cleanup(),this.initAnimationed=!1,this.hideIntersectMesh(),this.updatePanoMeshes(),this.moveToPano(c,{effect:i.effect,duration:i.duration,longitude:r.longitude,latitude:r.latitude,fov:r.fov,moveEndCallback:function(){s.initAnimationed=!0},moveCancelCallback:function(){s.initAnimationed=!0}},o),!0},t.prototype.updateModel=function(e){this.models=e,this.updatePanoMeshes()},t.prototype.updateTime=function(e,r){var i=this,o,s,u,c,l,d,f,v,A,h;if(!this.destroyed){var p={},y={},m=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),g=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),E=!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),p.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(clamp$1(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var b=this.locationMotion.getKeyFrameSegment(e),T=b[0],_=b[1],S=this.panoResourceFromLocationMotionKeyframe(T),R=this.panoResourceFromLocationMotionKeyframe(_),B=new THREE__namespace.Vector3().copy(S.position),I=new THREE__namespace.Vector3().copy(R.position),x=this.locationMotion.value.count-_.value.count+1;p.progress=x,R.panoPicture&&(x<1?S.panoPicture&&(p.pano0=S.panoPicture):p.pano0=R.panoPicture,p.pano1=R.panoPicture),R.effect==="montage"?p.transition="BLACK":R.effect==="spread"?p.transition="SPREAD":p.transition="FADE",(R.effect==="zoomin"||R.effect==="zoomout")&&(p.progress=Math.pow(x,3)),x<1&&R.effect!=="fly"&&(p.pano0&&S.panoPicture&&(p.pano0={map:p.pano0.map,zoom:p.pano0.zoom,luminanceMap:p.pano0.luminanceMap,matrix:S.panoPicture.matrix.clone().premultiply(S.fixCameraTransform).setPosition(R.position)}),B.copy(I),E=!0),y.distance=this.locationMotion.value.distance,y.offset=new THREE__namespace.Vector3(B.x+(I.x-B.x)*x,B.y+(I.y-B.y)*x,B.z+(I.z-B.z)*x);for(var M=[],L=[],C=0,H=this.locationMotion.keyframes;C<H.length;C++){var F=H[C],O=F.key,G=F.progress;O!==void 0&&(M.push(O),G>this.locationMotion.progress&&L.push(O))}for(var Q=0,U=Object.keys(this.panoResources);Q<U.length;Q++){var D=U[Q];if(!(L.indexOf(D)>=0)){var q=this.panoResources[D];if(q.panoPicture){var z=q.panoPicture.map,K=q.panoPicture.luminanceMap;if(z){if(z===((o=p.pano0)===null||o===void 0?void 0:o.map)||z===((s=p.pano1)===null||s===void 0?void 0:s.map))continue;z instanceof TileCubeTextureTarget&&z.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(z.cubeRenderTarget),z.dispose(),K&&(K instanceof TileCubeTextureTarget&&K.cubeRenderTarget&&this.luminanceCubeRenderTargetPool.push(K.cubeRenderTarget),K.dispose()),q.panoPicture=null}}M.indexOf(D)>=0||delete this.panoResources[D]}}this.currentPano=panoParse(R.panoId),this.emit("pano.moving",createEvent("pano.moving",{userAction:this.userAction,prevPano:panoParse(m.panoId),state:__assign(__assign(__assign(__assign({},panoParse(g.panoId)),{mode:this.mode}),clonePose(this.camera.pose)),y),options:{},progress:this.locationMotion.progress,error:null}))}isEmptyObject(p)===!1&&(!((u=p.pano0)===null||u===void 0)&&u.map&&p.pano0.map instanceof TileCubeTextureTarget&&!p.pano0.map.cubeRenderTarget&&(p.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((c=p.pano0)===null||c===void 0)&&c.luminanceMap&&p.pano0.luminanceMap instanceof TileCubeTextureTarget&&!p.pano0.luminanceMap.cubeRenderTarget&&(p.pano0.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),!((l=p.pano1)===null||l===void 0)&&l.map&&p.pano1.map instanceof TileCubeTextureTarget&&!p.pano1.map.cubeRenderTarget&&(p.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((d=p.pano1)===null||d===void 0)&&d.luminanceMap&&p.pano1.luminanceMap instanceof TileCubeTextureTarget&&!p.pano1.luminanceMap.cubeRenderTarget&&(p.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.models.setMaterial(p)),isEmptyObject(y)===!1&&this.setCamera(y);var J=this.works.getResolvedObserver(this.currentPano),j=this.locationMotion.ended?this.getForwardObserverOrNot():null;if(this.camera.pose.distance>.1||E)for(var re=0,W=Object.keys(this.panoMeshes);re<W.length;re++){var te=W[re],$=this.panoMeshes[te];$.setOpacity(0),$.setCurrent(!1),$.updateTime&&$.updateTime(e,r),$.visible=!1}else if(J){var ne=arrayMin(J.visibleIds,function(de){var le=i.works.getResolvedObserver(de);return le?J.standingPosition.distanceTo(le.standingPosition):1/0},!0),ee=ne[1];ee=clamp$1(ee,2.5,1/0);for(var ce=J.visibleIds.concat(panoStringify(this.currentPano)),ae=this.camera.getDirection(new THREE__namespace.Vector3),se=0,Ae=Object.keys(this.panoMeshes);se<Ae.length;se++){var te=Ae[se],$=this.panoMeshes[te],he=this.works.getResolvedObserver(te);if(ce.indexOf(te)===-1)$.setCurrent(!1),$.setOpacity(0);else if(!he)$.setCurrent(!1),$.setOpacity(0);else if(!he.loadable&&!he.active)$.setCurrent(!1),$.setOpacity(0);else{var me=$.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);$.setCurrent(!$.loading&&$.progress===0&&j!==null&&j.panoId===te),$.setOpacity(me<.01?0:clamp$1(ee/me*1.2,.4,.85));var Z=this.camera.position.clone().setY($.position.y),Y=new THREE__namespace.Vector3().copy($.position).sub(Z).normalize();if(te===panoStringify(this.currentPano)){var N=clamp$1((.5-Z.distanceTo($.position))/.5,0,1);Y.multiplyScalar(1-N).add(ae.clone().multiplyScalar(N))}Y.length()>0&&$.quaternion.setFromEuler(new THREE__namespace.Euler(0,Math.atan2(Y.x,Y.z),0))}$.updateTime&&$.updateTime(e,r)}}var Ee=this.tileLevel=function(){if(i.tileLevelForFov===!1)return 0;var de=i.renderer.getDrawingBufferSize(new THREE__namespace.Vector2);de.width*=i.scissor.width,de.height*=i.scissor.height;var le=g.panoId,ue=i.works.getResolvedObserver(le),oe=i.imageOptions.size;if(typeof oe=="undefined"&&ue){var Te=ue.images.up.match(/\/cube_(\d+)\//);Te&&(oe=Number(Te[1]))}typeof oe=="undefined"&&(oe=2048);var Re=0;oe>=1024&&(Re=1),oe>=2048&&(Re=2),oe>=4096&&(Re=3),oe>=8192&&(Re=4);var Ie=i.tileLevelForFov(i.camera.fov,de);return Ie>Re?Ie:0}(),ge=function(){var de=i.camera.quaternion.clone(),le=i.works.getResolvedObserver(g.panoId),ue=le!=null?le:J;ue&&de.premultiply(ue.quaternion.clone().inverse());var oe=new THREE__namespace.Matrix4().makeRotationFromQuaternion(de),Te=new THREE__namespace.Matrix4().getInverse(oe),Re=new THREE__namespace.Frustum().setFromProjectionMatrix(new THREE__namespace.Matrix4().multiplyMatrices(i.camera.projectionMatrix,Te));return Re}();g.panoId===panoStringify(this.currentPano)&&(((f=g.panoPicture)===null||f===void 0?void 0:f.map)instanceof TileCubeTextureTarget&&(g.panoPicture.map.maxRequest=this.tileMaxRequest,g.panoPicture.map.update(ge,Ee),g.panoPicture.map.needsRender===!0&&(g.panoPicture.map.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)),((v=g.panoPicture)===null||v===void 0?void 0:v.luminanceMap)instanceof TileCubeTextureTarget&&(g.panoPicture.luminanceMap.maxRequest=this.tileMaxRequest,g.panoPicture.luminanceMap.update(ge,Ee),g.panoPicture.luminanceMap.needsRender===!0&&(g.panoPicture.luminanceMap.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)));{var ve=this.tiling.object.visible;if(this.initAnimationed){var xe=g.panoId,fe=this.works.getResolvedObserver(xe);fe?isSimilarVector3(this.camera.position,fe.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==xe&&this.tiling.cleanup(),this.tiling.panoId=xe,this.tiling.setResource((h=(A=fe.images)===null||A===void 0?void 0:A.tiles)!==null&&h!==void 0?h:[],this.enableIOSEDR&&fe.images.luminance?fe.images.luminance:null),this.tiling.setFetcher(getFetcher(fe.work)),this.tiling.setRotation(fe.quaternion),this.tiling.setPosition(fe.position),this.tiling.maxRequest=this.tileMaxRequest,Ee>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update(ge,Ee,e):this.tiling.update(ge,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;ve!==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(clamp$1(this.cameraMotion.value.fov/45,0,1))}},t.prototype.render=function(e,r){var i=this.renderer.getRenderTarget(),o=this.works.getResolvedObserver(this.currentPano);o&&o.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 LuminanceAdaptiveEffect(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(now())[1],r=this.locationMotion.getKeyFrameSegment(now())[1],i=this.panoResourceFromLocationMotionKeyframe(r),o=this.works.getResolvedObserver(i.panoId);return{workCode:o?o.work.workCode:this.currentPano.workCode,panoIndex:o?o.panoIndex:this.currentPano.panoIndex,mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:o?o.position.clone():this.camera.position.clone(),distance:this.locationMotion.value.distance}},t.prototype.moveToPano=function(e,r,i){var o=this,s,u,c,l,d=(s=r.effect)!==null&&s!==void 0?s:"fly";this.userAction=i,this.stopMomentumMovement();var f=this.works.getResolvedObserver(e);if(!f)throw new Error("Invalid PanoId ".concat(JSON.stringify(e)));var v=getImageSizeFromURL(f.images.up),A=this.imageOptions.size;typeof A=="undefined"&&f&&v&&(A=Number(v)),typeof A=="undefined"&&(A=2048);var h=this.imageOptions.transform,p=__assign({key:"pano.".concat(f.panoId)},pick(this.imageOptions,["format","size","quality","sharpen","mappings"])),y=f.images,m=(c=(u=f.images.tiles)===null||u===void 0?void 0:u.filter(function(H){return H.size>A}))!==null&&c!==void 0?c:null,g=h,E={key:"pano_luminance.".concat(f.panoId),size:p.size?p.size/2:void 0},b=this.enableIOSEDR&&f.images.luminance?f.images.luminance:null,T=function(){if(!f.images.tiles||!b)return null;var H=getImageSizeFromURL(b.up);return H?m==null?void 0:m.map(function(F){var O=F.size*F.scale/2;return H<O?{level:F.level,size:O,scale:1,back:replaceImageSize(b.back,O),front:replaceImageSize(b.front,O),left:replaceImageSize(b.left,O),right:replaceImageSize(b.right,O),up:replaceImageSize(b.up,O),down:replaceImageSize(b.down,O)}:{level:F.level,size:H,scale:O/H,back:b.back,front:b.front,left:b.left,right:b.right,up:b.up,down:b.down}}):null}(),_="pano:"+jsonHash([y,p,h]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===_)return;var S=this.pendingTextureTask.panoId;(l=this.panoMeshes[S])===null||l===void 0||l.setProgress(0),this.emit("pano.texture.abort",createEvent("pano.texture.abort",{error:null,progress:0,meta:null,pano:f.pano}))}var R="move-to-pano-"+f.panoId;this.pending.add(R);var B=this.models.getMaterial()||{},I=B.pano0,x=B.pano1,M;if(I&&I.map.name===_&&I.luminanceMap!==null===this.enableIOSEDR?M=I:(x==null?void 0:x.map.name)===_&&x.luminanceMap!==null===this.enableIOSEDR&&(M=x),M){var L={panoId:f.panoId,effect:d,panoPicture:{zoom:1,map:M.map,luminanceMap:M.luminanceMap,matrix:new THREE__namespace.Matrix4().compose(f.position,f.quaternion,PANO_TEXTURE_SCALE$1)},position:f.position.clone(),fixCameraTransform:new THREE__namespace.Matrix4};AnimationFrameLoop.shared.add(function(){o.pending.delete(R),o.doMoveToPano(f.pano,L,r)},!0,1);return}this.pendingTextureTask={panoId:f.panoId,hash:_,onLoad:function(H,F){var O;if(o.pending.delete(R),o.destroyed)H.body.dispose();else{H.body.name=_;var G={panoId:f.panoId,effect:d,panoPicture:{zoom:1,map:H.body,luminanceMap:(O=F==null?void 0:F.body)!==null&&O!==void 0?O:null,matrix:new THREE__namespace.Matrix4().compose(f.position,f.quaternion,PANO_TEXTURE_SCALE$1)},position:f.position.clone(),fixCameraTransform:new THREE__namespace.Matrix4};o.doMoveToPano(f.pano,G,r)}},onError:function(H){o.pending.delete(R);var F=__assign(__assign(__assign({},f.pano),{mode:o.mode}),clonePose(o.camera.pose));o.emit("pano.error",createEvent("pano.error",{error:H,userAction:o.userAction,options:r,prevPano:o.currentPano,progress:0,state:F})),o.emit("pano.cancel",createEvent("pano.cancel",{error:H,userAction:o.userAction,options:r,prevPano:o.currentPano,progress:0,state:F})),o.emit("error",H),r.moveCancelCallback&&r.moveCancelCallback()}};var C=this.panoMeshes[f.panoId];C&&C.tap&&C.tap(),Promise.all([this.tileLevelForFov&&m&&m.length?this.textureLoader.loadTiledCubeTexture(y,m,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:h,options:p},minFilter:THREE__namespace.LinearFilter,magFilter:THREE__namespace.LinearFilter,generateMipmaps:!1,format:THREE__namespace.RGBAFormat,viaAjax:!0,fetcher:getFetcher(f.work)},void 0,void 0,function(H){var F,O;o.emit("pano.texture.progress",createEvent("pano.texture.progress",{error:null,progress:H,meta:null,pano:f.pano})),((F=o.pendingTextureTask)===null||F===void 0?void 0:F.hash)===_&&((O=o.panoMeshes[f.panoId])===null||O===void 0||O.setProgress(H))},this.renderer):this.textureLoader.loadCubeTexture(y,{imageURL:{transform:h,options:p},format:THREE__namespace.RGBAFormat,viaAjax:!0,fetcher:getFetcher(f.work)},void 0,void 0,function(H){var F,O;o.emit("pano.texture.progress",createEvent("pano.texture.progress",{error:null,progress:H,meta:null,pano:f.pano})),((F=o.pendingTextureTask)===null||F===void 0?void 0:F.hash)===_&&((O=o.panoMeshes[f.panoId])===null||O===void 0||O.setProgress(H))},this.renderer),b?this.tileLevelForFov&&T&&T.length?this.textureLoader.loadTiledCubeTexture(b,T,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:g,options:E},minFilter:THREE__namespace.LinearFilter,magFilter:THREE__namespace.LinearFilter,generateMipmaps:!1,fetcher:getFetcher(f.work)},void 0,void 0,void 0,this.renderer).catch(function(){return null}):this.textureLoader.loadCubeTexture(b,{imageURL:{transform:g,options:E},fetcher:getFetcher(f.work)},void 0,void 0,void 0,this.renderer).catch(function(){return null}):Promise.resolve(null)]).then(function(H){var F,O,G=H[0],Q=H[1];((F=o.pendingTextureTask)===null||F===void 0?void 0:F.hash)===_?(o.pendingTextureTask.onLoad(G,Q),(O=o.panoMeshes[f.panoId])===null||O===void 0||O.setProgress(0),delete o.pendingTextureTask,o.emit("pano.texture.success",createEvent("pano.texture.success",{error:null,progress:1,meta:G.meta,pano:f.pano}))):(G.body.dispose(),Q==null||Q.body.dispose())}).catch(function(H){var F,O;((F=o.pendingTextureTask)===null||F===void 0?void 0:F.hash)===_&&(o.pendingTextureTask.onError(H),(O=o.panoMeshes[f.panoId])===null||O===void 0||O.setProgress(0),delete o.pendingTextureTask,o.emit("pano.texture.error",createEvent("pano.texture.error",{error:H,progress:0,meta:null,pano:f.pano})),o.emit("error",H))}),this.emit("pano.texture.load",createEvent("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,o=i.duration,s=i.effect,u=i.userAction;e.userAction=u;var c=t.initAnimationEndState(e),l={workCode:c.workCode,panoIndex:c.panoIndex},d={modelAlpha:0},f={perspToOrtho:0},v=!1;e.moveToPano(l,{longitude:c.longitude,latitude:c.latitude,fov:c.fov,effect:s,duration:o,moveStartCallback:function(A){v=!0,e.perspToOrthoMotion.set(f,o).catch(noop$1),e.modelAlphaMotion.setKeyframes([{progress:0,value:__assign({},e.modelAlphaMotion.value)},{progress:.6,value:__assign({},e.modelAlphaMotion.value)},{progress:1,value:d}],o).catch(noop$1),e.emit("initAnimation.start",createEvent("initAnimation.start",{state:A,userAction:e.userAction}))},moveEndCallback:function(A){e.emit("initAnimation.end",createEvent("initAnimation.end",{state:A,userAction:e.userAction})),e.initAnimationed=!0,r()},moveCancelCallback:function(){var A=__assign(__assign(__assign({},l),{mode:e.mode}),clonePose(e.camera.pose));v===!1&&e.emit("initAnimation.start",createEvent("initAnimation.start",{state:A,userAction:e.userAction})),e.emit("initAnimation.end",createEvent("initAnimation.end",{state:A,userAction:e.userAction})),e.initAnimationed=!0,r()}},u)})},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 o=this.panoResourceFromLocationMotionKeyframe(e[i-1]).position,s=this.panoResourceFromLocationMotionKeyframe(e[i]).position,u=o.distanceTo(s)*(e[i].value.count-e[i-1].value.count);r+=u}return r},t.prototype.updatePanoMeshes=function(){for(var e=this,r={},i=Object.keys(this.panoMeshes),o=0,s=i;o<s.length;o++){var u=s[o],c=this.panoMeshes[u];r[u]=c,delete this.panoMeshes[u]}for(var l=1,d={},f=function(_){var S=arrayMin(_.accessibleIds,function(B){var I=e.works.getResolvedObserver(B);if(!I)return 1/0;var x=I.standingPosition.distanceTo(_.standingPosition);return clamp$1(x,1,1/0)},!0),R=S[1];d[_.panoId]===void 0&&(d[_.panoId]=R)},v=0,A=this.works.resolvedObservers;v<A.length;v++){var h=A[v];f(h)}var p=Object.keys(d).map(function(_){return d[_]});if(p.length){var y=p.reduce(function(_,S){return _+S},0)/p.length;l=clamp$1(y*.6,1,3)}for(var m=0,g=this.works.resolvedObservers;m<g.length;m++){var h=g[m],c=void 0;r[h.panoId]?(c=r[h.panoId],c.loading===!0&&h.loadable===!1&&c.setLoading(!1),delete r[h.panoId]):(c=this.panoCircleMeshCreator(h.pano),c.name="PanoCircleMesh_"+h.panoId,this.helper.add(c)),c.scale.set(l,1,l),c.position.copy(h.standingPosition),this.panoMeshes[h.panoId]=c}for(var E=0,b=Object.keys(r);E<b.length;E++){var T=b[E];this.helper.remove(r[T]),r[T].dispose(),delete r[T]}},t.prototype.doMoveToPano=function(e,r,i){var o=this,s,u,c,l,d,f,v,A,h,p,y;i===void 0&&(i={});var m=now(),g=createUuid();this.tiling.cleanup(),this.panoResources[g]=r;var E=1,b,T,_;if(this.locationMotion.ended){var S=this.locationMotion.getKeyFrameSegment(m);S[0];var R=S[1],B=this.locationMotion.value,I=((s=this.panoResourceFromLocationMotionKeyframe(R))!==null&&s!==void 0?s:this.camera).position,x=r.position;b=Math.max(I.distanceTo(x),E),T=[{key:R.key,progress:0,value:__assign(__assign({},B),{count:0})},{key:g,progress:1,value:{distance:0,count:1}}],_=0}else{var M=this.locationMotion.getKeyFrameSegment(m),L=M[0],R=M[1],B=this.locationMotion.value,C=this.panoResourceFromLocationMotionKeyframe(L).position,I=this.panoResourceFromLocationMotionKeyframe(R).position,x=r.position,H=R.value.count-B.count,F=Math.max(C.distanceTo(I),E)*H,O=Math.max(I.distanceTo(x),E);b=F+O,T=[{key:L.key,progress:0,value:__assign({},B)},{key:R.key,progress:F/b,value:R.value},{key:g,progress:1,value:{count:R.value.count+1,distance:0}}];var G=this.locationMotionKeyframesLength(this.locationMotion.keyframes),Q=this.locationMotionKeyframesLength(T);G===0||G===0?_=0:_=this.locationMotion.getProgressVelocity(m)*G/Q}var U=r.effect==="instant"?0:this.calculateMovingDuration(i.duration,r.effect==="fly"?b:0),D={longitude:i.longitude,latitude:i.latitude,fov:i.fov},q=__assign(__assign({},e),{mode:this.mode,longitude:(u=D.longitude)!==null&&u!==void 0?u:this.camera.pose.longitude,latitude:(c=D.latitude)!==null&&c!==void 0?c:this.camera.pose.latitude,fov:(l=D.fov)!==null&&l!==void 0?l:this.camera.pose.fov,offset:r.position.clone(),distance:this.camera.pose.distance}),z=this.currentPano;if(this.emit("pano.moveTo",createEvent("pano.moveTo",{options:i,prevPano:z,progress:0,state:q,userAction:this.userAction,error:null})),i.moveStartCallback&&i.moveStartCallback(q),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=noop$1,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),r.effect==="fly")this.cameraMotion.set(D,U).catch(noop$1);else{var K=coordinatesToVector({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),J=coordinatesToVector({longitude:(d=D.longitude)!==null&&d!==void 0?d:this.cameraMotion.value.longitude,latitude:(f=D.latitude)!==null&&f!==void 0?f:this.cameraMotion.value.latitude}),j=new THREE__namespace.Object3D;j.lookAt(K);var re=new THREE__namespace.Matrix4().makeRotationFromQuaternion(j.quaternion);j.lookAt(J);var W=new THREE__namespace.Matrix4().makeRotationFromQuaternion(j.quaternion),te=new THREE__namespace.Matrix4().getInverse(re).premultiply(W),$=this.cameraMotion.value.fov,ne=(v=D.fov)!==null&&v!==void 0?v:this.cameraMotion.value.fov,ee=1;r.effect==="zoomin"?ee=1.5:r.effect==="zoomout"&&(ee=.4);for(var ce=clamp$1(ne*ee,1,170),ae=0;ae<T.length-1;ae++){var se=T[ae].key;if(se){var Ae=this.panoResources[se];Ae&&(Ae.fixCameraTransform.copy(te),Ae.panoPicture&&(Ae.panoPicture.zoom=Math.tan($/2/180*Math.PI)/Math.tan(ce/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=D.longitude)!==null&&A!==void 0?A:this.cameraMotion.value.longitude,latitude:(h=D.latitude)!==null&&h!==void 0?h:this.cameraMotion.value.latitude,fov:ce}},{progress:1,value:{longitude:(p=D.longitude)!==null&&p!==void 0?p:this.cameraMotion.value.longitude,latitude:(y=D.latitude)!==null&&y!==void 0?y:this.cameraMotion.value.latitude,fov:ne}}],U).catch(noop$1)}var he=this.locationMotion.setKeyframes(T,U,_);he.then(function(){for(var me,Z,Y=0,N=o.models;Y<N.length;Y++){var Ee=N[Y];Ee.show()}var ge=__assign(__assign({},e),{mode:o.mode,longitude:o.camera.pose.longitude,latitude:o.camera.pose.latitude,fov:o.camera.pose.fov,offset:o.camera.pose.offset.clone(),distance:o.camera.pose.distance});o.emit("pano.arrived",createEvent("pano.arrived",{options:i,prevPano:z,progress:1,state:ge,userAction:o.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(ge);var ve=o.works.getResolvedObserver(e);if(ve&&ve.video&&o.videoTexture&&o.videoTexture.image instanceof HTMLVideoElement){var xe=ROTATE_Y_PI_MATRIX$1.clone().multiply((Z=(me=o.models.getMaterial().pano1)===null||me===void 0?void 0:me.matrix)!==null&&Z!==void 0?Z:new THREE__namespace.Matrix4).multiply(ve.video.matrix),fe={map:o.videoTexture,size:ve.video.size,matrix:xe,alpha:1},de=createUuid(),le=o.videoTexture.image;le.setAttribute("uuid",de),canplayVideo().then(function(ue){ue&&ve.video&&le.getAttribute("uuid")===de&&(le.oncanplay=function(){le.oncanplay=noop$1,le.play()},le.ontimeupdate=function(){le.currentTime>.5&&(le.ontimeupdate=noop$1,o.panoVideo.setMaterial(fe))},le.src=ve.video.source)}).catch(function(){le.removeAttribute("uuid")})}},function(){o.emit("pano.cancel",createEvent("pano.cancel",{options:i,prevPano:z,progress:0,state:q,userAction:o.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 o=e!=null?e:new THREE__namespace.Raycaster(this.camera.position.clone(),this.camera.getDirection(new THREE__namespace.Vector3));o.params.Points={threshold:.1};var s=i.standingPosition.clone();if(i.position.distanceTo(o.ray.origin)>1){var u=this.models.intersectRaycaster(new THREE__namespace.Raycaster(o.ray.origin,new THREE__namespace.Vector3(0,-1,0)))[0];u&&u.distance<=2?s.copy(u.point):s.copy(o.ray.origin).add(new THREE__namespace.Vector3(0,-1.5,0))}var c=this.models.intersectRaycaster(o)[0],l=c?c.point:o.ray.origin.clone().add(o.ray.direction.clone().normalize().multiplyScalar(3)),d=l.clone().sub(s).normalize();if(d.length()===0)return null;for(var f=i.accessibleIds.filter(function(T){if(T===panoStringify(r.currentPano))return!1;var _=r.works.getResolvedObserver(T);if(!_)return!1;var S=_.standingPosition.clone().project(r.camera);return Math.abs(S.z)>1||Math.abs(S.x)>1||Math.abs(S.y)>1?!1:_.loadable||_.active}),v=f.slice().sort(function(T,_){var S=r.works.getResolvedObserver(T).standingPosition.clone().distanceTo(s),R=r.works.getResolvedObserver(_).standingPosition.clone().distanceTo(s);return S-R}),A=0,h=[Math.PI/8,Math.PI/6,Math.PI/4,Math.PI/3];A<h.length;A++)for(var p=h[A],y=0,m=v;y<m.length;y++){var g=m[y],E=this.works.getResolvedObserver(g);if(E){var b=E.standingPosition.clone().sub(s);if(b&&b.length()!==0&&d.angleTo(b)<p)return E}}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 o=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]);if(o.panoId!==panoStringify(this.currentPano))return}var s=e.center.raycaster,u=this.camera.getDirection(new THREE__namespace.Vector3).setY(0),c=null,l=this.works.getResolvedObserver(this.currentPano);if(l){var d=l.accessibleIds.filter(function(Q){if(Q===panoStringify(r.currentPano))return!1;var U=r.works.getResolvedObserver(Q);return!U||U.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:U.loadable||U.active}),f=this.models.intersectRaycaster(s)[0];if(f){var v=arrayMin(d,function(Q){var U=r.works.getResolvedObserver(Q);if(!U)return 1/0;var D=U.standingPosition.clone();return D.distanceTo(f.point)},!0),A=v[0],h=v[1];A&&h<this.panoTapTriggerRadius&&(c=(i=this.works.getResolvedObserver(A))!==null&&i!==void 0?i:null)}c||(c=this.getForwardObserverOrNot(s));for(var p=0,y=this.locationMotion.keyframes;p<y.length;p++){var m=y[p],g=this.panoResourceFromLocationMotionKeyframe(m);if(!(m.progress<this.locationMotion.progress)&&c&&g.panoId===c.panoId){c=null;break}}if(!c)this.emit("gesture.tap",e),e.defaultPrevented||this.locationMotion.ended===!0&&this.cameraBounce();else{for(var E={},b=Math.PI/6,T=Math.PI/12,_=c.position.clone().setY(0).sub(l.position.clone().setY(0)).normalize(),S=[],R=[],B=[],I=0,x=c.accessibleIds;I<x.length;I++){var A=x[I],M=panoParse(A);if(!(panoEqual(M,this.currentPano)||panoEqual(M,c.pano))){var L=this.works.getResolvedObserver(A);if(L){var C=L.position.clone().sub(c.position).setY(0);_.angleTo(C)<b&&B.push(C)}}}var H=B.length>0?B:__spreadArray(__spreadArray([],S,!0),R,!0),F=H.slice().sort(function(Q,U){return Q.angleTo(_)-U.angleTo(_)})[0];F&&F.angleTo(u)>T&&(E.longitude=Math.atan2(-F.x,-F.z)),this.cameraMotion.value.latitude<-Math.PI/4&&(E.latitude=clamp$1(0,this.minLatitude,this.maxLatitude));var O=__assign({},e.state);if(O.workCode=c.pano.workCode,O.panoIndex=c.pano.panoIndex,E.longitude!==void 0&&(O.longitude=E.longitude),E.latitude!==void 0&&(O.latitude=E.latitude),E.fov!==void 0&&(O.fov=E.fov),O.distance=0,O.offset=c.position.clone(),e.state=O,this.emit("gesture.tap",e),!e.defaultPrevented){if(this.emit("pano.select",createEvent("pano.select",{prevPano:this.currentPano,state:O,userAction:e.userAction,options:E,progress:0,error:null})),c&&!c.active){var G=c.panoId;this.panoMeshes[G]&&(this.panoMeshes[G].setDisabled(!1),this.panoMeshes[G].setLoading(!0))}c&&c.active&&this.emit("pano.request",createEvent("pano.request",{userAction:e.userAction,prevPano:this.currentPano,progress:0,state:O,options:E,error:null}))}}}}},t}(PanoramaLikeController),DEG_TO_RAD=Math.PI/180,RAD_TO_DEG=180/Math.PI,MIN_TIMESTEP=.001,MAX_TIMESTEP=1,isIOS=function(){var n=typeof navigator!="undefined"&&/iPad|iPhone|iPod/.test(navigator.platform);return function(){return n}}(),isSafari=function(){var n=typeof navigator!="undefined"&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent);return function(){return n}}(),isFirefoxAndroid=function(){var n=typeof navigator!="undefined"&&navigator.userAgent.indexOf("Firefox")!==-1&&navigator.userAgent.indexOf("Android")!==-1;return function(){return n}}(),getChromeVersion=function(){var n=typeof navigator!="undefined"?navigator.userAgent.match(/.*Chrome\/([0-9]+)/):null,t=n?parseInt(n[1],10):null;return function(){return t}}(),isChromeWithoutDeviceMotion=function(){var n=!1;if(getChromeVersion()===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}}(),isSafariWithoutDeviceMotion=function(){var n=isIOS()&&isSafari()&&typeof navigator!="undefined"&&navigator.userAgent.indexOf("13_4")!==-1;return function(){return n}}(),isR7=function(){var n=typeof navigator!="undefined"&&navigator.userAgent.indexOf("R7 Build")!==-1;return function(){return n}}();function isLandscapeMode(){var n=typeof window!="undefined"&&(window.orientation==90||window.orientation==-90);return isR7()?!n:n}function isTimestampDeltaValid(n){return!(isNaN(n)||n<=MIN_TIMESTEP||n>MAX_TIMESTEP)}function getQuaternionAngle(n){if(n.w>1)return 0;var t=2*Math.acos(n.w);return t}var warnOnce=function(){var n={};return function(t,e){n[t]===void 0&&(console.warn("cardboard: "+e),n[t]=!0)}}();function getOriginFromUrl(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 isInsideCrossOriginIFrame(){if(typeof window=="undefined"||typeof document=="undefined")return!1;var n=window.self!==window.top,t=getOriginFromUrl(document.referrer),e=getOriginFromUrl(window.location.href);return n&&t!==e}var updateEyeViewMatrices=function(){function n(r,i,o){var s=i?i[0]:0,u=i?i[1]:0,c=i?i[2]:0,l=i?i[3]:1,d=s+s,f=u+u,v=c+c,A=s*d,h=s*f,p=s*v,y=u*f,m=u*v,g=c*v,E=l*d,b=l*f,T=l*v;return r[0]=1-(y+g),r[1]=h+T,r[2]=p-b,r[3]=0,r[4]=h-T,r[5]=1-(A+g),r[6]=m+E,r[7]=0,r[8]=p+b,r[9]=m-E,r[10]=1-(A+y),r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function t(r,i,o){var s=o[0],u=o[1],c=o[2],l,d,f,v,A,h,p,y,m,g,E,b;return i===r?(r[12]=i[0]*s+i[4]*u+i[8]*c+i[12],r[13]=i[1]*s+i[5]*u+i[9]*c+i[13],r[14]=i[2]*s+i[6]*u+i[10]*c+i[14],r[15]=i[3]*s+i[7]*u+i[11]*c+i[15]):(l=i[0],d=i[1],f=i[2],v=i[3],A=i[4],h=i[5],p=i[6],y=i[7],m=i[8],g=i[9],E=i[10],b=i[11],r[0]=l,r[1]=d,r[2]=f,r[3]=v,r[4]=A,r[5]=h,r[6]=p,r[7]=y,r[8]=m,r[9]=g,r[10]=E,r[11]=b,r[12]=l*s+A*u+m*c+i[12],r[13]=d*s+h*u+g*c+i[13],r[14]=f*s+p*u+E*c+i[14],r[15]=v*s+y*u+b*c+i[15]),r}function e(r,i){var o=i[0],s=i[1],u=i[2],c=i[3],l=i[4],d=i[5],f=i[6],v=i[7],A=i[8],h=i[9],p=i[10],y=i[11],m=i[12],g=i[13],E=i[14],b=i[15],T=o*d-s*l,_=o*f-u*l,S=o*v-c*l,R=s*f-u*d,B=s*v-c*d,I=u*v-c*f,x=A*g-h*m,M=A*E-p*m,L=A*b-y*m,C=h*E-p*g,H=h*b-y*g,F=p*b-y*E,O=T*F-_*H+S*C+R*L-B*M+I*x;return O?(O=1/O,r[0]=(d*F-f*H+v*C)*O,r[1]=(u*H-s*F-c*C)*O,r[2]=(g*I-E*B+b*R)*O,r[3]=(p*B-h*I-y*R)*O,r[4]=(f*L-l*F-v*M)*O,r[5]=(o*F-u*L+c*M)*O,r[6]=(E*S-m*I-b*_)*O,r[7]=(A*I-p*S+y*_)*O,r[8]=(l*H-d*L+v*x)*O,r[9]=(s*L-o*H-c*x)*O,r[10]=(m*B-g*S+b*T)*O,r[11]=(h*S-A*B-y*T)*O,r[12]=(d*M-l*C-f*x)*O,r[13]=(o*C-s*M+u*x)*O,r[14]=(g*_-m*R-E*T)*O,r[15]=(A*R-h*_+p*T)*O,r):null}return function(r,i,o){n(r,i),o&&t(r,r,o),e(r,r)}}(),SensorSample=function(){function n(t,e){t===void 0&&(t=new THREE__namespace.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}(),ComplementaryFilter=function(){function n(t,e){this.kFilter=t,this.isDebug=e,this.currentAccelMeasurement=new SensorSample,this.currentGyroMeasurement=new SensorSample,this.previousGyroMeasurement=new SensorSample,isIOS()?this.filterQ=new THREE__namespace.Quaternion(-1,0,0,1):this.filterQ=new THREE__namespace.Quaternion(1,0,0,1),this.previousFilterQ=new THREE__namespace.Quaternion,this.previousFilterQ.copy(this.filterQ),this.accelQ=new THREE__namespace.Quaternion,this.isOrientationInitialized=!1,this.estimatedGravity=new THREE__namespace.Vector3,this.measuredGravity=new THREE__namespace.Vector3,this.gyroIntegralQ=new THREE__namespace.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;isTimestampDeltaValid(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 THREE__namespace.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 THREE__namespace.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)",RAD_TO_DEG*getQuaternionAngle(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 o=new THREE__namespace.Quaternion;o.copy(this.filterQ),o.multiply(i),this.filterQ.slerp(o,1-this.kFilter),this.previousFilterQ.copy(this.filterQ)},n.prototype.accelToQuaternion_=function(t){var e=new THREE__namespace.Vector3;e.copy(t),e.normalize();var r=new THREE__namespace.Quaternion;return r.setFromUnitVectors(new THREE__namespace.Vector3(0,0,-1),e),r.inverse(),r},n.prototype.gyroToQuaternionDelta_=function(t,e){var r=new THREE__namespace.Quaternion,i=new THREE__namespace.Vector3;return i.copy(t),i.normalize(),r.setFromAxisAngle(i,t.length()*e),r},n}(),PosePredictor=function(){function n(t,e){this.predictionTimeS=t,this.isDebug=e,this.previousQ=new THREE__namespace.Quaternion,this.previousTimestampS=null,this.deltaQ=new THREE__namespace.Quaternion,this.outQ=new THREE__namespace.Quaternion}return n.prototype.getPrediction=function(t,e,r){if(!this.previousTimestampS)return this.previousQ.copy(t),this.previousTimestampS=r,t;var i=new THREE__namespace.Vector3;i.copy(e),i.normalize();var o=e.length();if(o<DEG_TO_RAD*20)return this.isDebug&&console.log("Moving slowly, at %s deg/s: no prediction",(RAD_TO_DEG*o).toFixed(1)),this.outQ.copy(t),this.previousQ.copy(t),this.outQ;var s=o*this.predictionTimeS;return this.deltaQ.setFromAxisAngle(i,s),this.outQ.copy(this.previousQ),this.outQ.multiply(this.deltaQ),this.previousQ.copy(t),this.previousTimestampS=r,this.outQ},n}(),Distortion=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 o=t-this.distort(r),s=r-o*((r-e)/(o-i));e=r,r=s,i=o}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}(),Pose=function(){function n(){this.angularAcceleration=null,this.angularVelocity=null,this.linearAcceleration=null,this.linearVelocity=null,this.orientation=null,this.position=null}return n}(),FieldOfView=function(){function n(){this.leftDegrees=0,this.rightDegrees=0,this.upDegrees=0,this.downDegrees=0}return n}(),Sensor=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 THREE__namespace.Vector3,this.gyroscope=new THREE__namespace.Vector3,this.filter=new ComplementaryFilter(t,i),this.posePredictor=new PosePredictor(e,i),this.isFirefoxAndroid=isFirefoxAndroid(),this.isIOS=isIOS();var o=getChromeVersion();this.isDeviceMotionInRadians=!this.isIOS&&o!==null&&o<66,this.isWithoutDeviceMotion=isChromeWithoutDeviceMotion()||isSafariWithoutDeviceMotion(),this.filterToWorldQ=new THREE__namespace.Quaternion,isIOS()?this.filterToWorldQ.setFromAxisAngle(new THREE__namespace.Vector3(1,0,0),Math.PI/2):this.filterToWorldQ.setFromAxisAngle(new THREE__namespace.Vector3(1,0,0),-Math.PI/2),this.inverseWorldToScreenQ=new THREE__namespace.Quaternion,this.worldToScreenQ=new THREE__namespace.Quaternion,this.originalPoseAdjustQ=new THREE__namespace.Quaternion;var s=typeof window!="undefined"?-window.orientation*Math.PI/180:0;this.originalPoseAdjustQ.setFromAxisAngle(new THREE__namespace.Vector3(0,0,1),s),this.setScreenTransform_(),isLandscapeMode()&&this.filterToWorldQ.multiply(this.inverseWorldToScreenQ),this.resetQ=new THREE__namespace.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 o=new THREE__namespace.Quaternion().setFromAxisAngle(new THREE__namespace.Vector3(0,0,-1),0),s=new THREE__namespace.Quaternion;return typeof window!="undefined"&&window.orientation===-90?s.setFromAxisAngle(new THREE__namespace.Vector3(0,1,0),Math.PI/-2):s.setFromAxisAngle(new THREE__namespace.Vector3(0,1,0),Math.PI/2),o.multiply(s)}(),this.deviceOrientationFilterToWorldQ=this.deviceOrientationFilterToWorldQ||function(){var o=new THREE__namespace.Quaternion;return o.setFromAxisAngle(new THREE__namespace.Vector3(1,0,0),-Math.PI/2),o}(),t=this._deviceOrientationQ;var e=new THREE__namespace.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 THREE__namespace.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 Pose;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(),isLandscapeMode()&&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),updateEyeViewMatrices(t.leftViewMatrix,e,r.left),updateEyeViewMatrices(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 isIOS()&&isInsideCrossOriginIFrame()&&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 o=t.left.upDegrees*DEG_TO_RAD,s=t.left.downDegrees*DEG_TO_RAD,u=t.left.leftDegrees*DEG_TO_RAD,c=t.left.rightDegrees*DEG_TO_RAD,l=2/(u+c),d=2/(o+s);i.left[0]=l,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]=-((u-c)*l*.5),i.left[9]=(o-s)*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 o=t.right.upDegrees*DEG_TO_RAD,s=t.right.downDegrees*DEG_TO_RAD,u=t.right.leftDegrees*DEG_TO_RAD,c=t.right.rightDegrees*DEG_TO_RAD,l=2/(u+c),d=2/(o+s);i.right[0]=l,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]=-((u-c)*l*.5),i.right[9]=(o-s)*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 Distortion(t.distortionCoefficients),i=t.screenLensDistance,o=(e.widthMeters-t.interLensDistance)/2,s=t.interLensDistance/2,u=t.baselineLensDistance-e.bevelMeters,c=e.heightMeters-u,l=RAD_TO_DEG*Math.atan(r.distort(o/i)),d=RAD_TO_DEG*Math.atan(r.distort(s/i)),f=RAD_TO_DEG*Math.atan(r.distort(u/i)),v=RAD_TO_DEG*Math.atan(r.distort(c/i)),A=new FieldOfView,h=new FieldOfView;return A.leftDegrees=Math.min(l,t.fov),A.rightDegrees=Math.min(d,t.fov),A.downDegrees=Math.min(f,t.fov),A.upDegrees=Math.min(v,t.fov),h.leftDegrees=A.rightDegrees,h.rightDegrees=A.leftDegrees,h.upDegrees=A.upDegrees,h.downDegrees=A.downDegrees,{left:A,right:h}},n.prototype.onDeviceOrientation_=function(t){this._deviceOrientationQ=this._deviceOrientationQ||new THREE__namespace.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 THREE__namespace.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,o=i-this.previousTimestampS;if(o<0){warnOnce("fusion-pose-sensor:invalid:non-monotonic","Invalid timestamps detected: non-monotonic timestamp from devicemotion"),this.previousTimestampS=i;return}else if(o<=MIN_TIMESTEP||o>MAX_TIMESTEP){warnOnce("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&&(isR7()?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 THREE__namespace.Vector3(0,0,1),-Math.PI/2);break;case-90:this.worldToScreenQ.setFromAxisAngle(new THREE__namespace.Vector3(0,0,1),Math.PI/2);break}this.inverseWorldToScreenQ.copy(this.worldToScreenQ),this.inverseWorldToScreenQ.inverse()},n}(),defaultLeftBounds=[0,0,.5,1],defaultRightBounds=[.5,0,.5,1],Cardboard=function(){function n(t){var e=this;this.renderer=t,this.sensor=new Sensor(.98,.04,!1,!1),this.scale=1,this.cameraL=new THREE__namespace.PerspectiveCamera,this.cameraR=new THREE__namespace.PerspectiveCamera;var r=this.sensor.start();this.dispose=function(){var i=e.renderer.getSize(new THREE__namespace.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 THREE__namespace.Vector2);if(r.width>r.height){var i=t.autoUpdate;i&&(t.updateMatrixWorld(),t.autoUpdate=!1);var o={x:Math.round(r.width*defaultLeftBounds[0]),y:Math.round(r.height*defaultLeftBounds[1]),width:Math.round(r.width*defaultLeftBounds[2]),height:Math.round(r.height*defaultLeftBounds[3])},s={x:Math.round(r.width*defaultRightBounds[0]),y:Math.round(r.height*defaultRightBounds[1]),width:Math.round(r.width*defaultRightBounds[2]),height:Math.round(r.height*defaultRightBounds[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 u=this.sensor.getEyeOffset();this.cameraL.translateOnAxis(new THREE__namespace.Vector3().fromArray(u.left),this.scale),this.cameraR.translateOnAxis(new THREE__namespace.Vector3().fromArray(u.right),this.scale);var c=this.sensor.getEyeProjectionMatrix();this.cameraL.projectionMatrix.elements=c.left.slice(),this.cameraR.projectionMatrix.elements=c.right.slice(),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.cameraL),this.renderer.setViewport(s.x,s.y,s.width,s.height),this.renderer.setScissor(s.x,s.y,s.width,s.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 cardboard="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAADqCAMAAAAvZYhaAAAC/VBMVEUAAAD///99fX37+/v5+fn29vbx8fHv7+/Nzc3o6Ojq6urh4eHU1NTR0dGDg4Pl5eWSkpLHx8fj4+Pe3t7X19fAwMDZ2dnCwsKrq6uioqLb29uNjY2enp67u7t5eXmAgIC2traWlpa5ubnKysqmpqZycnKHh4eurq6ysrKKioqDg4Pd3d12dnb9/f1vb2/s7OxlZWXz8/OoqKiZmZlpaWmbm5teXl7W1tbJycnExMRiYmJsbGywsLCPj49aWlq9vb1UVFRYWFhra2t+fn7t7e1RUVFOTk6Dg4OAgICCgoKKioqEhISIiIhqamqCgoKIiIiQkJCIiIiWlpawsLBmZmaAgICenp6Li4uBgYGTk5OMjIyVlZWFhYWCgoKvr6+Ojo59fX2SkpKvr6+Ojo6QkJCurq6BgYGxsbF8fHx4eHitra2enp6srKyJiYmurq54eHj5+fl+fn57e3v////5+fnS0tLAwMCVlZWwsLCurq5QUFCtra2EhISUlJSwsLCUlJSUlJSlpaWVlZW3t7diYmLAwMCFhYV3d3f///+tra3///9XV1eampqnp6d8fHz///////9VVVVlZWVtbW3+/v5SUlKcnJytra28vLzGxsbR0dHX19doaGiWlpafn5/Hx8ezs7Nzc3Nubm7AwMCIiIjj4+NTU1P29vZbW1vl5eVkZGTM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a1vWKArztqgEnhIHty4f9/btuEstKwGkxf+XuCT5CbTFnFRuxktuAAAAAElFTkSuQmCC";var _a,LOCALE={zh:{TITLE:"眼镜模式",HIT:"请将手机横屏放入 VR 眼镜中"},en:{TITLE:"GLASSES MODE",HIT:"Please put the mobile phone horizontally into the VR glasses."},ja:{TITLE:"メガネモード",HIT:"携帯電話をVRメガネに水平に入れてください。"}},TEXT=typeof navigator!="undefined"&&(_a=LOCALE[navigator.language.split("-")[0]])!==null&&_a!==void 0?_a:LOCALE.zh,CONTENTS=`
1489
1489
  <style>
1490
1490
  .$id {
1491
1491
  all: initial;
@@ -1746,7 +1746,7 @@ Z
1746
1746
  </svg>
1747
1747
  </div>
1748
1748
  </div>
1749
- `);function createContents(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 o=i.getAttribute("content")||"",s=o.match(/initial\-scale\=([\d|\.]+)/);s&&(t=Number(s[1])),isNaN(t)&&(t=1)}}var u=function(l){return Math.floor(l*t)+"px"};return CONTENTS.replace(/\n/g," ").replace(/\ +/g," ").replace(/\$id/g,n).replace(/(\d+)px/g,function(l,c){return u(Number(c))})}function createHelper(){var n="five_vr_helper_"+createUuid(),t=createContents(n),e=document.createElement("div");return e.className=n,e.innerHTML=t,e}var sharedGeometry=new THREE__namespace.CircleBufferGeometry(.12,16),vertexShader=`
1749
+ `);function createContents(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 o=i.getAttribute("content")||"",s=o.match(/initial\-scale\=([\d|\.]+)/);s&&(t=Number(s[1])),isNaN(t)&&(t=1)}}var u=function(c){return Math.floor(c*t)+"px"};return CONTENTS.replace(/\n/g," ").replace(/\ +/g," ").replace(/\$id/g,n).replace(/(\d+)px/g,function(c,l){return u(Number(l))})}function createHelper(){var n="five_vr_helper_"+createUuid(),t=createContents(n),e=document.createElement("div");return e.className=n,e.innerHTML=t,e}var sharedGeometry=new THREE__namespace.CircleBufferGeometry(.12,16),vertexShader=`
1750
1750
  varying vec2 vUv;
1751
1751
  #include <common>
1752
1752
  #include <logdepthbuf_pars_vertex>
@@ -1846,7 +1846,7 @@ void main() {
1846
1846
 
1847
1847
  gl_FragColor = vec4(gl_FragColor.rgb, gl_FragColor.a * opacity * outside * inside);
1848
1848
  }
1849
- `,PanoSphereMesh=function(n){__extends(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 Motion({ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}),e.opacityMotion=new Motion({opacity:0}),e.loadingMotion=new Motion({opacity:0}),e.disableMotion=new Motion({opacity:0});var r={blending:THREE__namespace.CustomBlending,blendSrc:THREE__namespace.SrcAlphaFactor,blendDst:THREE__namespace.OneMinusSrcAlphaFactor,blendSrcAlpha:THREE__namespace.OneFactor,blendDstAlpha:THREE__namespace.OneMinusSrcAlphaFactor,depthWrite:!1,transparent:!0};return e.hitTestMesh=new THREE__namespace.Mesh(sharedGeometry,new THREE__namespace.MeshBasicMaterial(__assign(__assign({},r),{color:0,opacity:0}))),e.hitTestMesh.scale.set(1.5,1.5,1.5),e.ringMesh=new THREE__namespace.Mesh(sharedGeometry,new THREE__namespace.ShaderMaterial(__assign(__assign({},r),{vertexShader:ringVertexShader,fragmentShader:ringFragmentShader,uniforms:{opacity:{value:0}}}))),e.panoMesh=new THREE__namespace.Mesh(sharedGeometry,new THREE__namespace.ShaderMaterial(__assign(__assign({},r),{vertexShader,fragmentShader,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=clamp$1(e,0,1),this.opacityMotion.set({opacity:e},30).catch(noop$1))},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(noop$1)}else{var r=[{progress:0,value:__assign({},this.currentMotion.value)},{progress:1,value:{ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}}];this.currentMotion.setKeyframes(r,200).catch(noop$1)}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(noop$1):this.loadingMotion.set({opacity:0},0).catch(noop$1),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(noop$1),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 o=this.currentMotion.value,s=o.ringScale,u=o.ringOpacity,l=o.circleFade,c=o.circleOpacity,d=o.circleScale;this.ringMesh.scale.set(s,1,s),this.ringMesh.material.uniforms.opacity.value=u*i,this.panoMesh.material.uniforms.opacity.value=i,this.panoMesh.material.uniforms.circleOpacity.value=c,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}(THREE__namespace.Object3D),ACTIVE_TO_CURRENT_DELAY=1500,VRPanoramaController=function(n){__extends(t,n);function t(e){var r=this,i=t.parseArgs(e);r=n.call(this,i)||this,r.mode="VRPanorama",r.cardboard=new Cardboard(r.renderer);var o=createHelper();r.helperElement=o;var s=new Hammer(o);return r.element.parentNode&&(r.element.parentNode.insertBefore(o,r.element),r.setHelperElementSize(),s.on("tap",function(){return r.emit("vr.requestExit",createEvent("vr.requestExit",{}))})),r.destroyHelper=function(){s.destroy(),o.parentNode&&o.parentNode.removeChild(o),delete r.helperElement},r}return t.parseArgs=function(e){if(e instanceof t)return e;var r=__assign(__assign({},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 __assign(__assign({},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 o=i[r],s=this.panoMeshes[o];this.helper.remove(s),s.dispose(),delete this.panoMeshes[o]}},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(panoStringify(this.currentPano)),i=0,o=this.works.resolvedObservers;i<o.length;i++){var s=o[i],u=this.panoMeshes[s.panoId];u&&(r.indexOf(s.panoId)>=0?u.parent!==this.helper&&this.helper.add(u):u.parent===this.helper&&(this.helper.remove(u),u.setOpacity(0)))}},t.prototype.updatePanoMeshes=function(){for(var e=Object.keys(this.panoMeshes),r=0,i=e;r<i.length;r++){var o=i[r],s=this.panoMeshes[o];this.helper.remove(s),s.dispose(),delete this.panoMeshes[o]}for(var u=0,l=this.works.resolvedObservers;u<l.length;u++){var c=l[u],d=c.panoId,f=new PanoSphereMesh;f.name="panoSphere_".concat(d),f.position.copy(c.position),f.needsRender=!0,this.panoMeshes[d]=f}this.updatePanoMeshesVisible()},t.prototype.updateTime=function(e,r){var i=this,o,s,u,l,c,d,f,m,A,h;if(!this.destroyed){var p=this.currentPano;this.userAction=!0,this.needsRender=!0,this.modelSceneNeedsRender=!0;var y={},v={},g=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),E=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(clamp$1(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var T=this.locationMotion.getKeyFrameSegment(e),_=T[0],x=T[1],R=this.panoResourceFromLocationMotionKeyframe(_),w=this.panoResourceFromLocationMotionKeyframe(x),S=R.position,C=w.position,I=this.locationMotion.value.count-x.value.count+1;y.progress=I,w.panoPicture&&(I<1?R.panoPicture&&(y.pano0=R.panoPicture):y.pano0=w.panoPicture,y.pano1=w.panoPicture),w.effect==="montage"?y.transition="BLACK":w.effect==="spread"?y.transition="SPREAD":y.transition="FADE",(w.effect==="zoomin"||w.effect==="zoomout")&&(y.progress=Math.pow(I,3)),I<1&&w.effect!=="fly"&&(y.pano0&&R.panoPicture&&(y.pano0={map:y.pano0.map,zoom:y.pano0.zoom,luminanceMap:y.pano0.luminanceMap,matrix:R.panoPicture.matrix.clone().premultiply(R.fixCameraTransform).setPosition(w.position)}),S.copy(C),b=!0),v.distance=this.locationMotion.value.distance,v.offset=new THREE__namespace.Vector3(S.x+(C.x-S.x)*I,S.y+(C.y-S.y)*I,S.z+(C.z-S.z)*I);for(var H=[],B=[],L=0,O=this.locationMotion.keyframes;L<O.length;L++){var k=O[L],K=k.key,z=k.progress;K!==void 0&&(H.push(K),z>this.locationMotion.progress&&B.push(K))}for(var N=0,U=Object.keys(this.panoResources);N<U.length;N++){var Q=U[N];if(!(B.indexOf(Q)>=0)){var G=this.panoResources[Q];if(G.panoPicture){var q=G.panoPicture.map,j=G.panoPicture.luminanceMap;if(q){if(q===((o=y.pano0)===null||o===void 0?void 0:o.map)||q===((s=y.pano1)===null||s===void 0?void 0:s.map))continue;q instanceof TileCubeTextureTarget&&q.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(q.cubeRenderTarget),q.dispose(),j&&(j instanceof TileCubeTextureTarget&&j.cubeRenderTarget&&this.luminanceCubeRenderTargetPool.push(j.cubeRenderTarget),j.dispose()),G.panoPicture=null}}H.indexOf(Q)>=0||delete this.panoResources[Q]}}this.currentPano=panoParse(w.panoId),this.emit("pano.moving",createEvent("pano.moving",{userAction:this.userAction,prevPano:panoParse(g.panoId),state:__assign(__assign(__assign(__assign({},panoParse(E.panoId)),{mode:this.mode}),clonePose(this.camera.pose)),v),options:{},progress:this.locationMotion.progress,error:null}))}isEmptyObject(y)===!1&&(!((u=y.pano0)===null||u===void 0)&&u.map&&y.pano0.map instanceof TileCubeTextureTarget&&!y.pano0.map.cubeRenderTarget&&(y.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((l=y.pano0)===null||l===void 0)&&l.luminanceMap&&y.pano0.luminanceMap instanceof TileCubeTextureTarget&&!y.pano0.luminanceMap.cubeRenderTarget&&(y.pano0.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),!((c=y.pano1)===null||c===void 0)&&c.map&&y.pano1.map instanceof TileCubeTextureTarget&&!y.pano1.map.cubeRenderTarget&&(y.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((d=y.pano1)===null||d===void 0)&&d.luminanceMap&&y.pano1.luminanceMap instanceof TileCubeTextureTarget&&!y.pano1.luminanceMap.cubeRenderTarget&&(y.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.models.setMaterial(y)),v.offset&&this.camera.position.copy(v.offset),panoEqual(this.currentPano,p)&&this.updatePanoMeshesVisible();var X=this.camera.pose.longitude,ae=this.camera.pose.latitude;this.camera.quaternion.fromArray(this.cardboard.sensor.getOrientation()),this.camera.computePose();var W=this.works.getResolvedObserver(this.currentPano);if(this.camera.pose.distance>.1||b)for(var te=0,ee=Object.keys(this.panoMeshes);te<ee.length;te++){var ie=ee[te],$=this.panoMeshes[ie];$.setOpacity(0),$.updateTime&&$.updateTime(e,r),$.visible=!1}else if(W)for(var se=W.visibleIds.concat(panoStringify(this.currentPano)),re=0,oe=se;re<oe.length;re++){var ie=oe[re],pe=panoParse(ie),he=this.works.getResolvedObserver(pe);if(he){var $=this.panoMeshes[ie];if(!he.loadable&&!he.active){$.setOpacity(0);continue}var Ae=$.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);Ae<.05?$.setOpacity(0):$.setOpacity(clamp$1(1.5/Ae,0,1)),panoEqual(this.currentPano,pe)&&$.setOpacity(0),$.lookAt(this.camera.position)}}if(this.locationMotion.ended)for(var Z=this.intersect(e),Y=0,V=this.works.resolvedObservers;Y<V.length;Y++){var he=V[Y],$=this.panoMeshes[he.panoId];$&&($.setCurrent($===Z),$.updateTime&&$.updateTime(e,r))}(X!==this.camera.pose.longitude||ae!==this.camera.pose.latitude)&&(this.cameraMotion.set(pick(this.camera.pose,["longitude","latitude"]),0).catch(noop$1),this.emit("camera.update",createEvent("camera.update",{userAction:!0,state:__assign(__assign(__assign({},this.currentPano),{mode:this.mode}),clonePose(this.camera.pose))})));var Ee=this.tileLevel=function(){if(i.tileLevelForFov===!1)return 0;var de=i.renderer.getDrawingBufferSize(new THREE__namespace.Vector2);de.width*=i.scissor.width,de.height*=i.scissor.height;var ce=E.panoId,le=i.works.getResolvedObserver(ce),ue=i.imageOptions.size;if(typeof ue=="undefined"&&le){var Te=le.images.up.match(/\/cube_(\d+)\//);Te&&(ue=Number(Te[1]))}typeof ue=="undefined"&&(ue=2048);var xe=0;ue>=1024&&(xe=1),ue>=2048&&(xe=2),ue>=4096&&(xe=3),ue>=8192&&(xe=4);var Ie=i.tileLevelForFov(i.camera.fov,de);return Ie>xe?Ie:0}(),ge=function(){var de=i.camera.quaternion.clone(),ce=i.works.getResolvedObserver(E.panoId),le=ce!=null?ce:W;le&&de.premultiply(le.quaternion.clone().inverse());var ue=new THREE__namespace.Matrix4().makeRotationFromQuaternion(de),Te=new THREE__namespace.Matrix4().getInverse(ue),xe=new THREE__namespace.Frustum().setFromProjectionMatrix(new THREE__namespace.Matrix4().multiplyMatrices(i.camera.projectionMatrix,Te));return xe}();E.panoId===panoStringify(this.currentPano)&&(((f=E.panoPicture)===null||f===void 0?void 0:f.map)instanceof TileCubeTextureTarget&&(E.panoPicture.map.maxRequest=this.tileMaxRequest,E.panoPicture.map.update(ge,Ee),E.panoPicture.map.needsRender===!0&&(E.panoPicture.map.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)),((m=E.panoPicture)===null||m===void 0?void 0:m.luminanceMap)instanceof TileCubeTextureTarget&&(E.panoPicture.luminanceMap.maxRequest=this.tileMaxRequest,E.panoPicture.luminanceMap.update(ge,Ee),E.panoPicture.luminanceMap.needsRender===!0&&(E.panoPicture.luminanceMap.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)));{var me=this.tiling.object.visible;if(this.initAnimationed){var Re=E.panoId,fe=this.works.getResolvedObserver(Re);fe?isSimilarVector3(this.camera.position,fe.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==Re&&this.tiling.cleanup(),this.tiling.panoId=Re,this.tiling.setResource((h=(A=fe.images)===null||A===void 0?void 0:A.tiles)!==null&&h!==void 0?h:[],this.enableIOSEDR&&fe.images.luminance?fe.images.luminance:null),this.tiling.setFetcher(getFetcher(fe.work)),this.tiling.setRotation(fe.quaternion),this.tiling.setPosition(fe.position),this.tiling.maxRequest=this.tileMaxRequest,Ee>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update(ge,Ee,e):this.tiling.update(ge,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;me!==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 THREE__namespace.Vector2(this.element.offsetWidth,this.element.offsetHeight),r=e.x*this.scissor.left,i=e.y*(1-this.scissor.bottom-this.scissor.height),o=e.x*this.scissor.width,s=e.y*this.scissor.height;this.helperElement.style.marginLeft=r+"px",this.helperElement.style.marginTop=i+"px",this.helperElement.style.width=o+"px",this.helperElement.style.height=s+"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>ACTIVE_TO_CURRENT_DELAY){for(var o=this.activePanoMesh,s=Object.keys(this.panoMeshes),u=null,l=0,c=s;l<c.length;l++){var d=c[l];if(this.panoMeshes[d]===o){u=d;break}}return u!==null&&this.moveToPano(panoParse(u),{},!0),delete this.activePanoMesh,delete this.activeTime,o}var f=this.camera.getDirection(new THREE__namespace.Vector3),m=new THREE__namespace.Raycaster(this.camera.position,f);m.params.Points={threshold:.1};for(var A=void 0,h=[],p=this.works.getResolvedObserver(this.currentPano),y=p?p.visibleIds:[],v=0,g=y;v<g.length;v++){var u=g[v],E=this.panoMeshes[u],b=m.intersectObject((r=E.hitTestMesh)!==null&&r!==void 0?r:E,!0)[0];b&&h.push({panoMesh:E,intersection:__assign({floor:(i=p==null?void 0:p.floorIndex)!==null&&i!==void 0?i:0},b)})}var T=h.sort(function(S,C){return S.intersection.distance-C.intersection.distance})[0];T?(A=T.intersection,this.activePanoMesh!==T.panoMesh&&(this.activePanoMesh=T.panoMesh,this.activeTime=e),this.intersectMesh.position.copy(T.panoMesh.position),this.intersectMesh.lookAt(this.camera.position)):(this.activePanoMesh=void 0,this.activeTime=void 0),A||(A=this.models.intersectRaycaster(m)[0]);var _=createEvent("intersect.update",{raycaster:m,intersection:A!=null?A:null,object:this.intersectMesh});if(this.emit("intersect.update",_),_.defaultPrevented){this.hideIntersectMesh();return}if(A&&A.face){var x=A.face.normal,R=new THREE__namespace.Quaternion;R.setFromUnitVectors(new THREE__namespace.Vector3(0,0,1),x),this.intersectMesh.quaternion.copy(R);var w=A.point.clone();this.intersectMesh.position.copy(w),T?this.intersectMesh.visible=!1:this.intersectMesh.visible=!0}else this.intersectMesh.visible=!1;return T==null?void 0:T.panoMesh},t.prototype.onPanGesture=function(){},t.prototype.onTapGesture=function(){},t.prototype.onPinchGesture=function(){},t.prototype.onMouseMove=function(){},t.prototype.onMouseOut=function(){},t}(PanoramaController),HUMAN_EYE_POSITION=new THREE__namespace.Vector3(0,1.6,0),ModelController=function(n){__extends(t,n);function t(e){var r=this,i,o=t.parseArgs(e);return r=n.call(this,o)||this,r.mode="Model",r.locationMotion=new Motion({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 Motion({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new Motion({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,o,s,u,l,c=this.parseArgs(e),d=c.works,f=e.initial,m=f.state,A=f.currentState,h=typeof m.panoIndex=="number"?{workCode:(o=(r=m.workCode)!==null&&r!==void 0?r:(i=c.works[0])===null||i===void 0?void 0:i.workCode)!==null&&o!==void 0?o:"",panoIndex:m.panoIndex}:{workCode:A.workCode,panoIndex:A.panoIndex},p=d.getResolvedObserver(h),y=(s=m.longitude)!==null&&s!==void 0?s:A.longitude,v=clamp$1((u=m.latitude)!==null&&u!==void 0?u:!p||isFristPersonMode(A.mode)?A.latitude:c.defaultLatitude,c.minLatitude,c.maxLatitude),g=clamp$1((l=m.fov)!==null&&l!==void 0?l:!p||isFristPersonMode(A.mode)?A.fov:c.defaultFov,c.minFov,c.maxFov),E=new THREE__namespace.Vector3;if(c.initial.state.offset)E.copy(c.initial.state.offset);else if(p)E.copy(p.position);else{var b=coordinatesToVector(A).setLength(A.distance);E.copy(c.initial.currentState.offset).sub(b)}return{workCode:h.workCode,panoIndex:h.panoIndex,mode:"Model",longitude:y,latitude:v,fov:g,offset:E,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,o){this.works=e;var s=t.initAnimationEndState(__assign(__assign({},this),{initial:{currentState:__assign(__assign({},this.currentPano),this.camera.pose),duration:i.duration,effect:i.effect,state:r,userAction:o}}));return this.hideIntersectMesh(),this.moveToPosition(s.offset,{duration:0,longitude:s.longitude,latitude:s.latitude,fov:s.fov},o),!0},t.prototype.updateCamera=function(e,r,i){var o=this;return this.initAnimationReady.then(function(){o.userAction=i,o.stopMomentumMovement();var s={},u={};return s.distance=0,e.offset!==void 0&&(s.x=e.offset.x,s.y=e.offset.y,s.z=e.offset.z),e.longitude!==void 0&&(u.longitude=e.longitude),e.latitude!==void 0&&(u.latitude=e.latitude),e.fov!==void 0&&(u.fov=e.fov),o.locationMotion.set(s,r).catch(noop$1),o.cameraMotion.set(u,r).catch(noop$1)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var o=this;return this.initAnimationReady.then(function(){o.userAction=i,o.stopMomentumMovement();for(var s=[],u=[],l=0,c=e;l<c.length;l++){var d=c[l];s.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}}),u.push({key:d.key,progress:d.progress,value:{longitude:d.value.longitude,latitude:d.value.latitude,fov:d.value.fov}})}return o.locationMotion.setKeyframes(s,r).catch(noop$1),o.cameraMotion.setKeyframes(e,r)})},t.prototype.updateTime=function(e,r){if(!this.destroyed){var i={},o={};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(clamp$1(this.perspToOrthoMotion.value.perspToOrtho,0,1))),!this.locationMotion.ended){this.locationMotion.update(e),o.distance=this.locationMotion.value.distance,o.offset=new THREE__namespace.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z);var s=new THREE__namespace.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),u=this.works.resolvedObservers,l=arrayMin(u,function(c){return c.position.distanceTo(s)});this.currentPano=l?{workCode:l.work.workCode,panoIndex:l.panoIndex}:{workCode:"",panoIndex:0}}this.cameraMotion.ended||(this.cameraMotion.update(e),o.longitude=this.cameraMotion.value.longitude,o.latitude=this.cameraMotion.value.latitude,o.fov=this.cameraMotion.value.fov),isEmptyObject(i)||this.models.setMaterial(i),isEmptyObject(o)||this.setCamera(o)}},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 o=i.duration,s=i.userAction;e.userAction=s;var u=t.initAnimationEndState(e),l={modelAlpha:1},c={perspToOrtho:0},d={longitude:u.longitude,latitude:u.latitude,fov:u.fov,duration:o,moveStartCallback:function(f){e.perspToOrthoMotion.set(c,o).catch(noop$1),e.modelAlphaMotion.set(l,o).catch(noop$1),e.emit("initAnimation.start",createEvent("initAnimation.start",{state:f,userAction:e.userAction}))},moveEndCallback:function(f){e.emit("initAnimation.end",createEvent("initAnimation.end",{state:f,userAction:e.userAction})),r()},moveCancelCallback:function(){var f=e.currentPano,m=__assign(__assign({},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",createEvent("initAnimation.end",{state:m,userAction:e.userAction})),r()}};e.moveToPosition(u.offset,d,s)})},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(now())[1],r=this.locationMotion.getKeyFrameSegment(now())[1];return __assign(__assign({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:new THREE__namespace.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 o=this.works.getResolvedObserver(e);o&&this.moveToPosition(o.position,r,i)},t.prototype.moveToPosition=function(e,r,i){var o=this,s,u,l;r===void 0&&(r={}),this.userAction=i,this.stopMomentumMovement();for(var c=now(),d=new THREE__namespace.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),f=d.distanceTo(e),m=this.locationMotion.getProgressVelocity(c),A=0,h=1;h<this.locationMotion.keyframes.length;h++){var p=this.locationMotion.keyframes[h-1].value,y=p.x,v=p.y,g=p.z,E=this.locationMotion.keyframes[h].value,b=E.x,T=E.y,_=E.z;A+=Math.sqrt(Math.pow(b-y,2)+Math.pow(T-v,2)+Math.pow(_-g,2))}var x=f===0?0:m*A/f,R=this.calculateMovingDuration(r.duration,f),w={x:e.x,y:e.y,z:e.z,distance:0},S={longitude:r.longitude,latitude:r.latitude,fov:r.fov},C=this.works.resolvedObservers,I=arrayMin(C,function(O){return O.position.distanceTo(d)}),H=I?{workCode:I.work.workCode,panoIndex:I.panoIndex}:{workCode:"",panoIndex:0},B=__assign(__assign({},H),{mode:this.mode,longitude:(s=S.longitude)!==null&&s!==void 0?s:this.camera.pose.longitude,latitude:(u=S.latitude)!==null&&u!==void 0?u:this.camera.pose.latitude,fov:(l=S.fov)!==null&&l!==void 0?l:this.camera.pose.fov,offset:e.clone(),distance:0}),L=this.currentPano;this.emit("pano.moveTo",createEvent("pano.moveTo",{options:r,prevPano:L,progress:0,state:B,userAction:this.userAction,error:null})),r.moveStartCallback&&r.moveStartCallback(B),this.cameraMotion.set(S,R).catch(noop$1),this.locationMotion.set(w,R,x).then(function(){for(var O=0,k=o.models;O<k.length;O++){var K=k[O];K.show()}var z=__assign(__assign(__assign({},H),{mode:o.mode}),clonePose(o.camera.pose));o.emit("pano.arrived",createEvent("pano.arrived",{options:r,prevPano:L,progress:0,state:z,userAction:o.userAction,error:null})),r.moveEndCallback&&r.moveEndCallback(z)},function(){r.moveCancelCallback&&r.moveCancelCallback(),o.emit("pano.cancel",createEvent("pano.cancel",{options:r,prevPano:L,progress:0,state:B,userAction:o.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 o=i.face.normal,s=i.point;if(new THREE__namespace.Vector3(0,1,0).angleTo(o)>Math.PI/3){var u=o.clone().setLength(.3).add(s);r.set(u,new THREE__namespace.Vector3(0,-1,0)),i=this.models.intersectRaycaster(r)[0]}}if(i){var l=new THREE__namespace.Vector3().copy(i.point).add(HUMAN_EYE_POSITION),c=this.works.resolvedObservers,d=arrayMin(c,function(A){return A.position.distanceTo(l)},!0),f=d[0],m=d[1];f&&m<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}(PanoramaLikeController);const edlVertexShader=function n(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,o=0,s="";return t[o].split(s).map(function(u){return u.charCodeAt(o)>i?u:String.fromCharCode((u.charCodeAt(o)+r)%i)}).join(s)}(`}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-
1849
+ `,PanoSphereMesh=function(n){__extends(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 Motion({ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}),e.opacityMotion=new Motion({opacity:0}),e.loadingMotion=new Motion({opacity:0}),e.disableMotion=new Motion({opacity:0});var r={blending:THREE__namespace.CustomBlending,blendSrc:THREE__namespace.SrcAlphaFactor,blendDst:THREE__namespace.OneMinusSrcAlphaFactor,blendSrcAlpha:THREE__namespace.OneFactor,blendDstAlpha:THREE__namespace.OneMinusSrcAlphaFactor,depthWrite:!1,transparent:!0};return e.hitTestMesh=new THREE__namespace.Mesh(sharedGeometry,new THREE__namespace.MeshBasicMaterial(__assign(__assign({},r),{color:0,opacity:0}))),e.hitTestMesh.scale.set(1.5,1.5,1.5),e.ringMesh=new THREE__namespace.Mesh(sharedGeometry,new THREE__namespace.ShaderMaterial(__assign(__assign({},r),{vertexShader:ringVertexShader,fragmentShader:ringFragmentShader,uniforms:{opacity:{value:0}}}))),e.panoMesh=new THREE__namespace.Mesh(sharedGeometry,new THREE__namespace.ShaderMaterial(__assign(__assign({},r),{vertexShader,fragmentShader,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=clamp$1(e,0,1),this.opacityMotion.set({opacity:e},30).catch(noop$1))},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(noop$1)}else{var r=[{progress:0,value:__assign({},this.currentMotion.value)},{progress:1,value:{ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}}];this.currentMotion.setKeyframes(r,200).catch(noop$1)}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(noop$1):this.loadingMotion.set({opacity:0},0).catch(noop$1),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(noop$1),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 o=this.currentMotion.value,s=o.ringScale,u=o.ringOpacity,c=o.circleFade,l=o.circleOpacity,d=o.circleScale;this.ringMesh.scale.set(s,1,s),this.ringMesh.material.uniforms.opacity.value=u*i,this.panoMesh.material.uniforms.opacity.value=i,this.panoMesh.material.uniforms.circleOpacity.value=l,this.panoMesh.material.uniforms.circleScale.value=d,this.panoMesh.material.uniforms.circleFade.value=c,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}(THREE__namespace.Object3D),ACTIVE_TO_CURRENT_DELAY=1500,VRPanoramaController=function(n){__extends(t,n);function t(e){var r=this,i=t.parseArgs(e);r=n.call(this,i)||this,r.mode="VRPanorama",r.cardboard=new Cardboard(r.renderer);var o=createHelper();r.helperElement=o;var s=new Hammer(o);return r.element.parentNode&&(r.element.parentNode.insertBefore(o,r.element),r.setHelperElementSize(),s.on("tap",function(){return r.emit("vr.requestExit",createEvent("vr.requestExit",{}))})),r.destroyHelper=function(){s.destroy(),o.parentNode&&o.parentNode.removeChild(o),delete r.helperElement},r}return t.parseArgs=function(e){if(e instanceof t)return e;var r=__assign(__assign({},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 __assign(__assign({},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 o=i[r],s=this.panoMeshes[o];this.helper.remove(s),s.dispose(),delete this.panoMeshes[o]}},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(panoStringify(this.currentPano)),i=0,o=this.works.resolvedObservers;i<o.length;i++){var s=o[i],u=this.panoMeshes[s.panoId];u&&(r.indexOf(s.panoId)>=0?u.parent!==this.helper&&this.helper.add(u):u.parent===this.helper&&(this.helper.remove(u),u.setOpacity(0)))}},t.prototype.updatePanoMeshes=function(){for(var e=Object.keys(this.panoMeshes),r=0,i=e;r<i.length;r++){var o=i[r],s=this.panoMeshes[o];this.helper.remove(s),s.dispose(),delete this.panoMeshes[o]}for(var u=0,c=this.works.resolvedObservers;u<c.length;u++){var l=c[u],d=l.panoId,f=new PanoSphereMesh;f.name="panoSphere_".concat(d),f.position.copy(l.position),f.needsRender=!0,this.panoMeshes[d]=f}this.updatePanoMeshesVisible()},t.prototype.updateTime=function(e,r){var i=this,o,s,u,c,l,d,f,v,A,h;if(!this.destroyed){var p=this.currentPano;this.userAction=!0,this.needsRender=!0,this.modelSceneNeedsRender=!0;var y={},m={},g=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),E=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(clamp$1(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var T=this.locationMotion.getKeyFrameSegment(e),_=T[0],S=T[1],R=this.panoResourceFromLocationMotionKeyframe(_),B=this.panoResourceFromLocationMotionKeyframe(S),I=R.position,x=B.position,M=this.locationMotion.value.count-S.value.count+1;y.progress=M,B.panoPicture&&(M<1?R.panoPicture&&(y.pano0=R.panoPicture):y.pano0=B.panoPicture,y.pano1=B.panoPicture),B.effect==="montage"?y.transition="BLACK":B.effect==="spread"?y.transition="SPREAD":y.transition="FADE",(B.effect==="zoomin"||B.effect==="zoomout")&&(y.progress=Math.pow(M,3)),M<1&&B.effect!=="fly"&&(y.pano0&&R.panoPicture&&(y.pano0={map:y.pano0.map,zoom:y.pano0.zoom,luminanceMap:y.pano0.luminanceMap,matrix:R.panoPicture.matrix.clone().premultiply(R.fixCameraTransform).setPosition(B.position)}),I.copy(x),b=!0),m.distance=this.locationMotion.value.distance,m.offset=new THREE__namespace.Vector3(I.x+(x.x-I.x)*M,I.y+(x.y-I.y)*M,I.z+(x.z-I.z)*M);for(var L=[],C=[],H=0,F=this.locationMotion.keyframes;H<F.length;H++){var O=F[H],G=O.key,Q=O.progress;G!==void 0&&(L.push(G),Q>this.locationMotion.progress&&C.push(G))}for(var U=0,D=Object.keys(this.panoResources);U<D.length;U++){var q=D[U];if(!(C.indexOf(q)>=0)){var z=this.panoResources[q];if(z.panoPicture){var K=z.panoPicture.map,J=z.panoPicture.luminanceMap;if(K){if(K===((o=y.pano0)===null||o===void 0?void 0:o.map)||K===((s=y.pano1)===null||s===void 0?void 0:s.map))continue;K instanceof TileCubeTextureTarget&&K.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(K.cubeRenderTarget),K.dispose(),J&&(J instanceof TileCubeTextureTarget&&J.cubeRenderTarget&&this.luminanceCubeRenderTargetPool.push(J.cubeRenderTarget),J.dispose()),z.panoPicture=null}}L.indexOf(q)>=0||delete this.panoResources[q]}}this.currentPano=panoParse(B.panoId),this.emit("pano.moving",createEvent("pano.moving",{userAction:this.userAction,prevPano:panoParse(g.panoId),state:__assign(__assign(__assign(__assign({},panoParse(E.panoId)),{mode:this.mode}),clonePose(this.camera.pose)),m),options:{},progress:this.locationMotion.progress,error:null}))}isEmptyObject(y)===!1&&(!((u=y.pano0)===null||u===void 0)&&u.map&&y.pano0.map instanceof TileCubeTextureTarget&&!y.pano0.map.cubeRenderTarget&&(y.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((c=y.pano0)===null||c===void 0)&&c.luminanceMap&&y.pano0.luminanceMap instanceof TileCubeTextureTarget&&!y.pano0.luminanceMap.cubeRenderTarget&&(y.pano0.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),!((l=y.pano1)===null||l===void 0)&&l.map&&y.pano1.map instanceof TileCubeTextureTarget&&!y.pano1.map.cubeRenderTarget&&(y.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((d=y.pano1)===null||d===void 0)&&d.luminanceMap&&y.pano1.luminanceMap instanceof TileCubeTextureTarget&&!y.pano1.luminanceMap.cubeRenderTarget&&(y.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.models.setMaterial(y)),m.offset&&this.camera.position.copy(m.offset),panoEqual(this.currentPano,p)&&this.updatePanoMeshesVisible();var j=this.camera.pose.longitude,re=this.camera.pose.latitude;this.camera.quaternion.fromArray(this.cardboard.sensor.getOrientation()),this.camera.computePose();var W=this.works.getResolvedObserver(this.currentPano);if(this.camera.pose.distance>.1||b)for(var te=0,$=Object.keys(this.panoMeshes);te<$.length;te++){var ne=$[te],ee=this.panoMeshes[ne];ee.setOpacity(0),ee.updateTime&&ee.updateTime(e,r),ee.visible=!1}else if(W)for(var ce=W.visibleIds.concat(panoStringify(this.currentPano)),ae=0,se=ce;ae<se.length;ae++){var ne=se[ae],Ae=panoParse(ne),he=this.works.getResolvedObserver(Ae);if(he){var ee=this.panoMeshes[ne];if(!he.loadable&&!he.active){ee.setOpacity(0);continue}var me=ee.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);me<.05?ee.setOpacity(0):ee.setOpacity(clamp$1(1.5/me,0,1)),panoEqual(this.currentPano,Ae)&&ee.setOpacity(0),ee.lookAt(this.camera.position)}}if(this.locationMotion.ended)for(var Z=this.intersect(e),Y=0,N=this.works.resolvedObservers;Y<N.length;Y++){var he=N[Y],ee=this.panoMeshes[he.panoId];ee&&(ee.setCurrent(ee===Z),ee.updateTime&&ee.updateTime(e,r))}(j!==this.camera.pose.longitude||re!==this.camera.pose.latitude)&&(this.cameraMotion.set(pick(this.camera.pose,["longitude","latitude"]),0).catch(noop$1),this.emit("camera.update",createEvent("camera.update",{userAction:!0,state:__assign(__assign(__assign({},this.currentPano),{mode:this.mode}),clonePose(this.camera.pose))})));var Ee=this.tileLevel=function(){if(i.tileLevelForFov===!1)return 0;var de=i.renderer.getDrawingBufferSize(new THREE__namespace.Vector2);de.width*=i.scissor.width,de.height*=i.scissor.height;var le=E.panoId,ue=i.works.getResolvedObserver(le),oe=i.imageOptions.size;if(typeof oe=="undefined"&&ue){var Te=ue.images.up.match(/\/cube_(\d+)\//);Te&&(oe=Number(Te[1]))}typeof oe=="undefined"&&(oe=2048);var Re=0;oe>=1024&&(Re=1),oe>=2048&&(Re=2),oe>=4096&&(Re=3),oe>=8192&&(Re=4);var Ie=i.tileLevelForFov(i.camera.fov,de);return Ie>Re?Ie:0}(),ge=function(){var de=i.camera.quaternion.clone(),le=i.works.getResolvedObserver(E.panoId),ue=le!=null?le:W;ue&&de.premultiply(ue.quaternion.clone().inverse());var oe=new THREE__namespace.Matrix4().makeRotationFromQuaternion(de),Te=new THREE__namespace.Matrix4().getInverse(oe),Re=new THREE__namespace.Frustum().setFromProjectionMatrix(new THREE__namespace.Matrix4().multiplyMatrices(i.camera.projectionMatrix,Te));return Re}();E.panoId===panoStringify(this.currentPano)&&(((f=E.panoPicture)===null||f===void 0?void 0:f.map)instanceof TileCubeTextureTarget&&(E.panoPicture.map.maxRequest=this.tileMaxRequest,E.panoPicture.map.update(ge,Ee),E.panoPicture.map.needsRender===!0&&(E.panoPicture.map.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)),((v=E.panoPicture)===null||v===void 0?void 0:v.luminanceMap)instanceof TileCubeTextureTarget&&(E.panoPicture.luminanceMap.maxRequest=this.tileMaxRequest,E.panoPicture.luminanceMap.update(ge,Ee),E.panoPicture.luminanceMap.needsRender===!0&&(E.panoPicture.luminanceMap.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)));{var ve=this.tiling.object.visible;if(this.initAnimationed){var xe=E.panoId,fe=this.works.getResolvedObserver(xe);fe?isSimilarVector3(this.camera.position,fe.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==xe&&this.tiling.cleanup(),this.tiling.panoId=xe,this.tiling.setResource((h=(A=fe.images)===null||A===void 0?void 0:A.tiles)!==null&&h!==void 0?h:[],this.enableIOSEDR&&fe.images.luminance?fe.images.luminance:null),this.tiling.setFetcher(getFetcher(fe.work)),this.tiling.setRotation(fe.quaternion),this.tiling.setPosition(fe.position),this.tiling.maxRequest=this.tileMaxRequest,Ee>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update(ge,Ee,e):this.tiling.update(ge,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;ve!==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 THREE__namespace.Vector2(this.element.offsetWidth,this.element.offsetHeight),r=e.x*this.scissor.left,i=e.y*(1-this.scissor.bottom-this.scissor.height),o=e.x*this.scissor.width,s=e.y*this.scissor.height;this.helperElement.style.marginLeft=r+"px",this.helperElement.style.marginTop=i+"px",this.helperElement.style.width=o+"px",this.helperElement.style.height=s+"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>ACTIVE_TO_CURRENT_DELAY){for(var o=this.activePanoMesh,s=Object.keys(this.panoMeshes),u=null,c=0,l=s;c<l.length;c++){var d=l[c];if(this.panoMeshes[d]===o){u=d;break}}return u!==null&&this.moveToPano(panoParse(u),{},!0),delete this.activePanoMesh,delete this.activeTime,o}var f=this.camera.getDirection(new THREE__namespace.Vector3),v=new THREE__namespace.Raycaster(this.camera.position,f);v.params.Points={threshold:.1};for(var A=void 0,h=[],p=this.works.getResolvedObserver(this.currentPano),y=p?p.visibleIds:[],m=0,g=y;m<g.length;m++){var u=g[m],E=this.panoMeshes[u],b=v.intersectObject((r=E.hitTestMesh)!==null&&r!==void 0?r:E,!0)[0];b&&h.push({panoMesh:E,intersection:__assign({floor:(i=p==null?void 0:p.floorIndex)!==null&&i!==void 0?i:0},b)})}var T=h.sort(function(I,x){return I.intersection.distance-x.intersection.distance})[0];T?(A=T.intersection,this.activePanoMesh!==T.panoMesh&&(this.activePanoMesh=T.panoMesh,this.activeTime=e),this.intersectMesh.position.copy(T.panoMesh.position),this.intersectMesh.lookAt(this.camera.position)):(this.activePanoMesh=void 0,this.activeTime=void 0),A||(A=this.models.intersectRaycaster(v)[0]);var _=createEvent("intersect.update",{raycaster:v,intersection:A!=null?A:null,object:this.intersectMesh});if(this.emit("intersect.update",_),_.defaultPrevented){this.hideIntersectMesh();return}if(A&&A.face){var S=A.face.normal,R=new THREE__namespace.Quaternion;R.setFromUnitVectors(new THREE__namespace.Vector3(0,0,1),S),this.intersectMesh.quaternion.copy(R);var B=A.point.clone();this.intersectMesh.position.copy(B),T?this.intersectMesh.visible=!1:this.intersectMesh.visible=!0}else this.intersectMesh.visible=!1;return T==null?void 0:T.panoMesh},t.prototype.onPanGesture=function(){},t.prototype.onTapGesture=function(){},t.prototype.onPinchGesture=function(){},t.prototype.onMouseMove=function(){},t.prototype.onMouseOut=function(){},t}(PanoramaController),HUMAN_EYE_POSITION=new THREE__namespace.Vector3(0,1.6,0),ModelController=function(n){__extends(t,n);function t(e){var r=this,i,o=t.parseArgs(e);return r=n.call(this,o)||this,r.mode="Model",r.locationMotion=new Motion({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 Motion({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new Motion({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,o,s,u,c,l=this.parseArgs(e),d=l.works,f=e.initial,v=f.state,A=f.currentState,h=typeof v.panoIndex=="number"?{workCode:(o=(r=v.workCode)!==null&&r!==void 0?r:(i=l.works[0])===null||i===void 0?void 0:i.workCode)!==null&&o!==void 0?o:"",panoIndex:v.panoIndex}:{workCode:A.workCode,panoIndex:A.panoIndex},p=d.getResolvedObserver(h),y=(s=v.longitude)!==null&&s!==void 0?s:A.longitude,m=clamp$1((u=v.latitude)!==null&&u!==void 0?u:!p||isFristPersonMode(A.mode)?A.latitude:l.defaultLatitude,l.minLatitude,l.maxLatitude),g=clamp$1((c=v.fov)!==null&&c!==void 0?c:!p||isFristPersonMode(A.mode)?A.fov:l.defaultFov,l.minFov,l.maxFov),E=new THREE__namespace.Vector3;if(l.initial.state.offset)E.copy(l.initial.state.offset);else if(p)E.copy(p.position);else{var b=coordinatesToVector(A).setLength(A.distance);E.copy(l.initial.currentState.offset).sub(b)}return{workCode:h.workCode,panoIndex:h.panoIndex,mode:"Model",longitude:y,latitude:m,fov:g,offset:E,distance:0}},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.locationMotion.dispose()},t.prototype.isReady=function(){return this.locationMotion.ended===!1?!1:n.prototype.isReady.call(this)},t.prototype.updateWork=function(e,r,i,o){this.works=e;var s=t.initAnimationEndState(__assign(__assign({},this),{initial:{currentState:__assign(__assign({},this.currentPano),this.camera.pose),duration:i.duration,effect:i.effect,state:r,userAction:o}}));return this.hideIntersectMesh(),this.moveToPosition(s.offset,{duration:0,longitude:s.longitude,latitude:s.latitude,fov:s.fov},o),!0},t.prototype.updateCamera=function(e,r,i){var o=this;return this.initAnimationReady.then(function(){o.userAction=i,o.stopMomentumMovement();var s={},u={};return s.distance=0,e.offset!==void 0&&(s.x=e.offset.x,s.y=e.offset.y,s.z=e.offset.z),e.longitude!==void 0&&(u.longitude=e.longitude),e.latitude!==void 0&&(u.latitude=e.latitude),e.fov!==void 0&&(u.fov=e.fov),o.locationMotion.set(s,r).catch(noop$1),o.cameraMotion.set(u,r).catch(noop$1)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var o=this;return this.initAnimationReady.then(function(){o.userAction=i,o.stopMomentumMovement();for(var s=[],u=[],c=0,l=e;c<l.length;c++){var d=l[c];s.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}}),u.push({key:d.key,progress:d.progress,value:{longitude:d.value.longitude,latitude:d.value.latitude,fov:d.value.fov}})}return o.locationMotion.setKeyframes(s,r).catch(noop$1),o.cameraMotion.setKeyframes(e,r)})},t.prototype.updateTime=function(e,r){if(!this.destroyed){var i={},o={};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(clamp$1(this.perspToOrthoMotion.value.perspToOrtho,0,1))),!this.locationMotion.ended){this.locationMotion.update(e),o.distance=this.locationMotion.value.distance,o.offset=new THREE__namespace.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z);var s=new THREE__namespace.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),u=this.works.resolvedObservers,c=arrayMin(u,function(l){return l.position.distanceTo(s)});this.currentPano=c?{workCode:c.work.workCode,panoIndex:c.panoIndex}:{workCode:"",panoIndex:0}}this.cameraMotion.ended||(this.cameraMotion.update(e),o.longitude=this.cameraMotion.value.longitude,o.latitude=this.cameraMotion.value.latitude,o.fov=this.cameraMotion.value.fov),isEmptyObject(i)||this.models.setMaterial(i),isEmptyObject(o)||this.setCamera(o)}},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 o=i.duration,s=i.userAction;e.userAction=s;var u=t.initAnimationEndState(e),c={modelAlpha:1},l={perspToOrtho:0},d={longitude:u.longitude,latitude:u.latitude,fov:u.fov,duration:o,moveStartCallback:function(f){e.perspToOrthoMotion.set(l,o).catch(noop$1),e.modelAlphaMotion.set(c,o).catch(noop$1),e.emit("initAnimation.start",createEvent("initAnimation.start",{state:f,userAction:e.userAction}))},moveEndCallback:function(f){e.emit("initAnimation.end",createEvent("initAnimation.end",{state:f,userAction:e.userAction})),r()},moveCancelCallback:function(){var f=e.currentPano,v=__assign(__assign({},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",createEvent("initAnimation.end",{state:v,userAction:e.userAction})),r()}};e.moveToPosition(u.offset,d,s)})},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(now())[1],r=this.locationMotion.getKeyFrameSegment(now())[1];return __assign(__assign({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:new THREE__namespace.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 o=this.works.getResolvedObserver(e);o&&this.moveToPosition(o.position,r,i)},t.prototype.moveToPosition=function(e,r,i){var o=this,s,u,c;r===void 0&&(r={}),this.userAction=i,this.stopMomentumMovement();for(var l=now(),d=new THREE__namespace.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),f=d.distanceTo(e),v=this.locationMotion.getProgressVelocity(l),A=0,h=1;h<this.locationMotion.keyframes.length;h++){var p=this.locationMotion.keyframes[h-1].value,y=p.x,m=p.y,g=p.z,E=this.locationMotion.keyframes[h].value,b=E.x,T=E.y,_=E.z;A+=Math.sqrt(Math.pow(b-y,2)+Math.pow(T-m,2)+Math.pow(_-g,2))}var S=f===0?0:v*A/f,R=this.calculateMovingDuration(r.duration,f),B={x:e.x,y:e.y,z:e.z,distance:0},I={longitude:r.longitude,latitude:r.latitude,fov:r.fov},x=this.works.resolvedObservers,M=arrayMin(x,function(F){return F.position.distanceTo(d)}),L=M?{workCode:M.work.workCode,panoIndex:M.panoIndex}:{workCode:"",panoIndex:0},C=__assign(__assign({},L),{mode:this.mode,longitude:(s=I.longitude)!==null&&s!==void 0?s:this.camera.pose.longitude,latitude:(u=I.latitude)!==null&&u!==void 0?u:this.camera.pose.latitude,fov:(c=I.fov)!==null&&c!==void 0?c:this.camera.pose.fov,offset:e.clone(),distance:0}),H=this.currentPano;this.emit("pano.moveTo",createEvent("pano.moveTo",{options:r,prevPano:H,progress:0,state:C,userAction:this.userAction,error:null})),r.moveStartCallback&&r.moveStartCallback(C),this.cameraMotion.set(I,R).catch(noop$1),this.locationMotion.set(B,R,S).then(function(){for(var F=0,O=o.models;F<O.length;F++){var G=O[F];G.show()}var Q=__assign(__assign(__assign({},L),{mode:o.mode}),clonePose(o.camera.pose));o.emit("pano.arrived",createEvent("pano.arrived",{options:r,prevPano:H,progress:0,state:Q,userAction:o.userAction,error:null})),r.moveEndCallback&&r.moveEndCallback(Q)},function(){r.moveCancelCallback&&r.moveCancelCallback(),o.emit("pano.cancel",createEvent("pano.cancel",{options:r,prevPano:H,progress:0,state:C,userAction:o.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 o=i.face.normal,s=i.point;if(new THREE__namespace.Vector3(0,1,0).angleTo(o)>Math.PI/3){var u=o.clone().setLength(.3).add(s);r.set(u,new THREE__namespace.Vector3(0,-1,0)),i=this.models.intersectRaycaster(r)[0]}}if(i){var c=new THREE__namespace.Vector3().copy(i.point).add(HUMAN_EYE_POSITION),l=this.works.resolvedObservers,d=arrayMin(l,function(A){return A.position.distanceTo(c)},!0),f=d[0],v=d[1];f&&v<5&&(c.y=f.position.y),e.state.offset.copy(c),e.state.distance=0,this.emit("gesture.tap",e),e.defaultPrevented||this.moveToPosition(c,{},!0)}else this.emit("gesture.tap",e),e.defaultPrevented||this.cameraBounce()},t}(PanoramaLikeController);const edlVertexShader=function n(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,o=0,s="";return t[o].split(s).map(function(u){return u.charCodeAt(o)>i?u:String.fromCharCode((u.charCodeAt(o)+r)%i)}).join(s)}(`}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
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`),edlFragmentShader=function n(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,o=0,s="";return t[o].split(s).map(function(u){return u.charCodeAt(o)>i?u:String.fromCharCode((u.charCodeAt(o)+r)%i)}).join(s)}(`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<RQY<<}rpvv|{-zrqvz}-sy|nH}rpvv|{-zrqvz}-v{H{vs|z-sy|n-prr{dvquH{vs|z-sy|n-prr{UrvtuH{vs|z-rp?-{rvtuo|h[RVTUO\\b_lP\\b[ajH{vs|z-sy|n-rqy\`r{tuH{vs|z-sy|n-nqvH{vs|z-sy|n-|}npv\bH{vs|z-sy|n-[rnH{vs|z-sy|n-SnH{vs|z-znA-]|wH{vs|z-nz}yr?Q-RQYP|y|Hn\bv{t-rp?-bHsy|n-r}|{r5sy|n-qr}u6
1851
1851
  --rp?-_nqv-J-nqv-<-rp?5prr{dvqu9-prr{Urvtu6H--sy|n-z-J-=;=H--s|5v{-v-J-=H-v-I-[RVTUO\\b_lP\\b[aH-v886
1852
1852
  ----rp?-[rvtuo|-J-b-8-_nqv-7-{rvtuo|hvjH----sy|n-{rvtuo|Qr}u-J-r\x07r?Q5RQYP|y|9-[rvtuo|6;nH----{rvtuo|Qr}u-J-5{rvtuo|Qr}u-JJ->;=6-L-=;=-G-{rvtuo|Qr}uH----vs5{rvtuo|Qr}u-.J-=;=6
@@ -1856,10 +1856,10 @@ void main() {
1856
1856
  --rpA-pRQY-J-r\x07r?Q5RQYP|y|9-b6H--sy|n-qr}u-J-pRQY;nH--qr}u-J-5qr}u-JJ->;=6-L-=;=-G-qr}uH--sy|n-r-J-r}|{r5qr}u6H--sy|n-unqr-J-r\x07}5:r-7-@==;=-7-rqy\`r{tu6H--tylSntP|y|-J-rpA5pRQY;to-7-unqr9-|}npv\b6H--
1857
1857
  -<<-vr-rtyn-u\b}ro|yvp-qr}u-nyr-|-qr}u-ossr----sy|n-qy-J-}|5?;=9-qr}u6H----rpA-q}-J-]|w-7-rpA5=;=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
1858
  ----qvpnqH--\f\f`);var EDLMaterial=function(n){__extends(t,n);function t(e){var r=n.call(this)||this;return r.uniforms={screenWidth:makeUniform$1("f",0),screenHeight:makeUniform$1("f",0),edlStrength:makeUniform$1("f",1),uNear:makeUniform$1("f",1),uFar:makeUniform$1("f",1),radius:makeUniform$1("f",1),neighbours:makeUniform$1("2fv",new Float32Array),depthMap:makeUniform$1("t",new THREE__namespace.Texture),uEDLColor:makeUniform$1("t",new THREE__namespace.Texture),uEDLDepth:makeUniform$1("t",new THREE__namespace.Texture),opacity:makeUniform$1("f",1),uProj:makeUniform$1("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()+edlVertexShader,r=this.getDefines()+edlFragmentShader;this.setValues({vertexShader:e,fragmentShader:r}),this.needsUpdate=!0},__decorate([uniform$1("screenWidth"),__metadata("design:type",Number)],t.prototype,"screenWidth",void 0),__decorate([uniform$1("screenHeight"),__metadata("design:type",Number)],t.prototype,"screenHeight",void 0),__decorate([uniform$1("edlStrength"),__metadata("design:type",Number)],t.prototype,"edlStrength",void 0),__decorate([uniform$1("uNear"),__metadata("design:type",Number)],t.prototype,"uNear",void 0),__decorate([uniform$1("uFar"),__metadata("design:type",Number)],t.prototype,"uFar",void 0),__decorate([uniform$1("radius"),__metadata("design:type",Number)],t.prototype,"radius",void 0),__decorate([uniform$1("neighbours",!0),__metadata("design:type",Float32Array)],t.prototype,"neighbours",void 0),__decorate([uniform$1("depthMap"),__metadata("design:type",THREE__namespace.Texture)],t.prototype,"depthMap",void 0),__decorate([uniform$1("uEDLColor"),__metadata("design:type",THREE__namespace.Texture)],t.prototype,"uEDLColor",void 0),__decorate([uniform$1("uEDLDepth"),__metadata("design:type",THREE__namespace.Texture)],t.prototype,"uEDLDepth",void 0),__decorate([uniform$1("uProj"),__metadata("design:type",Array)],t.prototype,"uProj",void 0),t}(THREE__namespace.RawShaderMaterial);function makeUniform$1(n,t){return{type:n,value:t}}function uniform$1(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 passCamera$1=new THREE__namespace.OrthographicCamera(-1,1,1,-1,0,1),geometry$2=new THREE__namespace.BufferGeometry;geometry$2.setAttribute("position",new THREE__namespace.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),geometry$2.setAttribute("uv",new THREE__namespace.Float32BufferAttribute([0,2,0,0,2,0],2));var mesh$2=new THREE__namespace.Mesh(geometry$2),edlEffectScene=new THREE__namespace.Scene;edlEffectScene.add(mesh$2);var EDLEffect=function(n){__extends(t,n);function t(e,r,i,o){var s=n.call(this,e,r,i,o)||this;return s.sharedV2=new THREE__namespace.Vector2,s.renderer=e,s.material=new EDLMaterial,mesh$2.material=s.material,s.material.needsUpdate=!0,s}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,o=this.renderer.getSize(this.sharedV2);i.screenWidth.value=o.x,i.screenHeight.value=o.y;var s=r.projectionMatrix,u=new Float32Array(16);u.set(s.elements);for(var l=new Float32Array(this.material.neighbourCount*2),c=0;c<this.material.neighbourCount;c++)l[2*c+0]=Math.cos(2*c*Math.PI/this.material.neighbourCount),l[2*c+1]=Math.sin(2*c*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=u,i.edlStrength.value=.25,i.radius.value=1,i.opacity.value=1,this.renderer.setRenderTarget(e[1]),this.renderer.render(edlEffectScene,passCamera$1)},t.prototype.dispose=function(){this.copyPass.dispose()},t}(Effect);const fragment=function n(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,o=0,s="";return t[o].split(s).map(function(u){return u.charCodeAt(o)>i?u:String.fromCharCode((u.charCodeAt(o)+r)%i)}).join(s)}(`}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-
1859
+ `,e},t.prototype.updateShaderSource=function(){var e=this.getDefines()+edlVertexShader,r=this.getDefines()+edlFragmentShader;this.setValues({vertexShader:e,fragmentShader:r}),this.needsUpdate=!0},__decorate([uniform$1("screenWidth"),__metadata("design:type",Number)],t.prototype,"screenWidth",void 0),__decorate([uniform$1("screenHeight"),__metadata("design:type",Number)],t.prototype,"screenHeight",void 0),__decorate([uniform$1("edlStrength"),__metadata("design:type",Number)],t.prototype,"edlStrength",void 0),__decorate([uniform$1("uNear"),__metadata("design:type",Number)],t.prototype,"uNear",void 0),__decorate([uniform$1("uFar"),__metadata("design:type",Number)],t.prototype,"uFar",void 0),__decorate([uniform$1("radius"),__metadata("design:type",Number)],t.prototype,"radius",void 0),__decorate([uniform$1("neighbours",!0),__metadata("design:type",Float32Array)],t.prototype,"neighbours",void 0),__decorate([uniform$1("depthMap"),__metadata("design:type",THREE__namespace.Texture)],t.prototype,"depthMap",void 0),__decorate([uniform$1("uEDLColor"),__metadata("design:type",THREE__namespace.Texture)],t.prototype,"uEDLColor",void 0),__decorate([uniform$1("uEDLDepth"),__metadata("design:type",THREE__namespace.Texture)],t.prototype,"uEDLDepth",void 0),__decorate([uniform$1("uProj"),__metadata("design:type",Array)],t.prototype,"uProj",void 0),t}(THREE__namespace.RawShaderMaterial);function makeUniform$1(n,t){return{type:n,value:t}}function uniform$1(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 passCamera$1=new THREE__namespace.OrthographicCamera(-1,1,1,-1,0,1),geometry$2=new THREE__namespace.BufferGeometry;geometry$2.setAttribute("position",new THREE__namespace.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),geometry$2.setAttribute("uv",new THREE__namespace.Float32BufferAttribute([0,2,0,0,2,0],2));var mesh$2=new THREE__namespace.Mesh(geometry$2),edlEffectScene=new THREE__namespace.Scene;edlEffectScene.add(mesh$2);var EDLEffect=function(n){__extends(t,n);function t(e,r,i,o){var s=n.call(this,e,r,i,o)||this;return s.sharedV2=new THREE__namespace.Vector2,s.renderer=e,s.material=new EDLMaterial,mesh$2.material=s.material,s.material.needsUpdate=!0,s}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,o=this.renderer.getSize(this.sharedV2);i.screenWidth.value=o.x,i.screenHeight.value=o.y;var s=r.projectionMatrix,u=new Float32Array(16);u.set(s.elements);for(var c=new Float32Array(this.material.neighbourCount*2),l=0;l<this.material.neighbourCount;l++)c[2*l+0]=Math.cos(2*l*Math.PI/this.material.neighbourCount),c[2*l+1]=Math.sin(2*l*Math.PI/this.material.neighbourCount);i.neighbours.value=c,i.uNear.value=r.near,i.uFar.value=r.far,i.uEDLColor.value=e[0].texture,i.uProj.value=u,i.edlStrength.value=.25,i.radius.value=1,i.opacity.value=1,this.renderer.setRenderTarget(e[1]),this.renderer.render(edlEffectScene,passCamera$1)},t.prototype.dispose=function(){this.copyPass.dispose()},t}(Effect);const fragment=function n(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,o=0,s="";return t[o].split(s).map(function(u){return u.charCodeAt(o)>i?u:String.fromCharCode((u.charCodeAt(o)+r)%i)}).join(s)}(`}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
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`),vertex=function n(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,o=0,s="";return t[o].split(s).map(function(u){return u.charCodeAt(o)>i?u:String.fromCharCode((u.charCodeAt(o)+r)%i)}).join(s)}(`}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 HQMaterial=function(n){__extends(t,n);function t(e){var r=n.call(this,{vertexShader:vertex,fragmentShader:fragment})||this;return r.uniforms={uDepthMap:makeUniform("t",null),uWeightMap:makeUniform("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}},__decorate([uniform("uDepthMap"),__metadata("design:type",Number)],t.prototype,"uDepthMap",void 0),__decorate([uniform("uWeightMap"),__metadata("design:type",Number)],t.prototype,"uWeightMap",void 0),t}(THREE__namespace.RawShaderMaterial);function makeUniform(n,t){return{type:n,value:t}}function uniform(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 passCamera=new THREE__namespace.OrthographicCamera(-1,1,1,-1,0,1),geometry$1=new THREE__namespace.BufferGeometry;geometry$1.setAttribute("position",new THREE__namespace.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),geometry$1.setAttribute("uv",new THREE__namespace.Float32BufferAttribute([0,2,0,0,2,0],2));var mesh$1=new THREE__namespace.Mesh(geometry$1),hqScene=new THREE__namespace.Scene;hqScene.add(mesh$1);var HQEffect=function(n){__extends(t,n);function t(e,r,i,o){var s=n.call(this,e,r,i,o)||this;return s.sharedV2=new THREE__namespace.Vector2,s.renderer=e,s.material=new HQMaterial,s.camera=i,mesh$1.material=s.material,s}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 THREE__namespace.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 THREE__namespace.Color(0,0,0)),this.renderer.setClearAlpha(1),this.renderer.setRenderTarget(e[2]),this.renderer.render(hqScene,passCamera)},t.prototype.dispose=function(){this.copyPass.dispose()},t}(Effect),RAYCASTER_NEAR=.5,minDistance=0,PANGESTURE_FORWARD_ANGLE=Math.PI/9,MapviewController=function(n){__extends(t,n);function t(e){var r=this,i,o=t.parseArgs(e);return r=n.call(this,o)||this,r.mode="Mapview",r.defaultLongitude=o.defaultLongitude,r.defaultLatitude=o.defaultLatitude,r.defaultDistance=o.defaultDistance,r.maxLatitude=o.maxLatitude,r.minLatitude=o.minLatitude,r.cameraType=o.cameraType,r.modelInScreen=o.modelInScreen,r.locationMotion=new Motion({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 Motion({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new Motion({perspToOrtho:r.camera.perspToOrtho.x}),r.intersectMeshCreator=o.intersectMeshCreator,r.intersectMesh=r.intersectMeshCreator(),r.intersectMesh.name="intersect",r.intersectMesh.visible=!1,r.currentTapId=null,r.helper.add(r.intersectMesh),r.edlTarget=new THREE__namespace.WebGLRenderTarget(1024,1024,{generateMipmaps:!1,minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,format:THREE__namespace.RGBAFormat,type:THREE__namespace.FloatType,depthTexture:new THREE__namespace.DepthTexture(1024,1024,THREE__namespace.UnsignedIntType)}),r.edlEffect=new EDLEffect(r.renderer,r.modelScene,r.camera,r.models),r.hqEffect=new HQEffect(r.renderer,r.modelScene,r.camera,r.models),r}return t.parseArgs=function(e){var r,i,o,s,u,l,c,d;if(e instanceof t)return e;var f=n.parseArgs.call(this,e);return __assign(__assign({},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:(o=e.defaultDistance)!==null&&o!==void 0?o:150,maxLatitude:(s=e.maxLatitude)!==null&&s!==void 0?s:+Math.PI/2,minLatitude:(u=e.minLatitude)!==null&&u!==void 0?u:0,cameraType:(l=e.cameraType)!==null&&l!==void 0?l:"auto",modelInScreen:(c=e.modelInScreen)!==null&&c!==void 0?c:"boundingbox-center",intersectMeshCreator:(d=e.intersectMeshCreator)!==null&&d!==void 0?d:function(){return new IntersectMesh}})},t.distanceFromModel=function(e,r,i){var o=e.bounding,s=Math.pow(Math.pow(o.max.x-o.min.x+1,2)+Math.pow(o.max.y-o.min.y+1,2)+Math.pow(o.max.z-o.min.z+1,2),1/2),u=s/2/Math.tan(Math.PI*r/360);return i<1&&(u=u/i),isNaN(u)?s:u},t.initAnimationEndState=function(e){var r,i,o,s,u,l,c,d=this.parseArgs(e),f=d.works,m=d.models,A=e.initial,h=A.state,p=A.currentState,y=typeof h.panoIndex=="number"?{workCode:(o=(r=h.workCode)!==null&&r!==void 0?r:(i=d.works[0])===null||i===void 0?void 0:i.workCode)!==null&&o!==void 0?o:"",panoIndex:h.panoIndex}:{workCode:p.workCode,panoIndex:p.panoIndex},v=f.getResolvedObserver(y),g=(s=h.fov)!==null&&s!==void 0?s:60,E=clamp$1((u=h.latitude)!==null&&u!==void 0?u:isThirdPersonMode(p.mode)?p.latitude:d.defaultLatitude,d.minLatitude,d.maxLatitude),b=t.distanceFromModel(d.models,g,d.camera.aspect),T=new THREE__namespace.Vector3,_=(l=h.distance)!==null&&l!==void 0?l:Math.min(d.defaultDistance,b),x=(c=h.longitude)!==null&&c!==void 0?c:isThirdPersonMode(p.mode)?p.longitude:d.defaultLongitude;return h.offset?T.copy(h.offset):d.defaultDistance<b&&v?(T.copy(v.position),h.longitude===void 0&&(x=p.longitude)):T.copy(m.bounding.getCenter(T)),m.bounding.containsPoint(T)||m.bounding.getCenter(T),__assign(__assign({},y),{mode:"Mapview",longitude:x,latitude:E,fov:g,offset:T,distance:_})},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,o){this.userAction=o,this.works=e;var s=t.initAnimationEndState(__assign(__assign({},this),{initial:{currentState:__assign(__assign({},this.currentPano),this.camera.pose),duration:i.duration,effect:i.effect,state:r,userAction:o}}));this.currentPano={workCode:s.workCode,panoIndex:s.panoIndex};var u={longitude:s.longitude,latitude:s.latitude,fov:s.fov},l={x:s.offset.x,y:s.offset.y,z:s.offset.z,distance:s.distance,orthoDistance:s.distance};return this.locationMotion.set(l,i.duration).catch(noop$1),this.cameraMotion.set(u,i.duration).catch(noop$1),!0},t.prototype.updateModel=function(e){n.prototype.updateModel.call(this,e)},t.prototype.updateCamera=function(e,r,i){var o=this;return this.initAnimationReady.then(function(){o.userAction=i,o.stopMomentumMovement();var s={},u={};return e.distance!==void 0&&(s.distance=e.distance),e.offset!==void 0&&(s.x=e.offset.x,s.y=e.offset.y,s.z=e.offset.z),e.longitude!==void 0&&(u.longitude=e.longitude),e.latitude!==void 0&&(u.latitude=e.latitude),e.fov!==void 0&&(u.fov=e.fov),o.locationMotion.set(s,r).catch(noop$1),o.cameraMotion.set(u,r).catch(noop$1)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var o=this;return this.initAnimationReady.then(function(){o.userAction=i,o.stopMomentumMovement();for(var s=[],u=[],l=0,c=e;l<c.length;l++){var d=c[l];s.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}}),u.push({key:d.key,progress:d.progress,value:{longitude:d.value.longitude,latitude:d.value.latitude,fov:d.value.fov}})}return o.locationMotion.setKeyframes(s,r).catch(noop$1),o.cameraMotion.setKeyframes(e,r)})},t.prototype.updateTime=function(e,r){if(!this.destroyed){var i={},o={};this.locationMotion.ended||(this.locationMotion.update(e),o.distance=this.locationMotion.value.distance,o.offset=new THREE__namespace.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z)),this.cameraMotion.ended||(this.cameraMotion.update(e),o.longitude=this.cameraMotion.value.longitude,o.latitude=this.cameraMotion.value.latitude,o.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended||(this.modelAlphaMotion.update(e),i.modelAlpha=this.modelAlphaMotion.value.modelAlpha);var s=0;this.cameraType==="auto"?s=Math.PI/2-this.cameraMotion.value.latitude<.02?1:0:this.cameraType==="perspective"?s=0:this.cameraType==="orthographic"&&(s=1),this.perspToOrthoMotion.getTargetKeyframe().value.perspToOrtho!==s&&this.perspToOrthoMotion.set({perspToOrtho:s},500).catch(noop$1),this.perspToOrthoMotion.ended||(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(clamp$1(this.perspToOrthoMotion.value.perspToOrtho,0,1))),isEmptyObject(i)||this.models.setMaterial(i),isEmptyObject(o)||this.setCamera(o)}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(now())[1],r=this.locationMotion.getKeyFrameSegment(now())[1];return __assign(__assign({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,distance:r.value.distance,offset:new THREE__namespace.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 o=i.duration,s=i.userAction;e.userAction=s;var u=t.initAnimationEndState(e),l={longitude:u.longitude,latitude:u.latitude,fov:u.fov},c={x:u.offset.x,y:u.offset.y,z:u.offset.z,distance:u.distance},d={modelAlpha:1},f={perspToOrtho:0};e.emit("initAnimation.start",createEvent("initAnimation.start",{state:u,userAction:e.userAction})),e.perspToOrthoMotion.set(f,o).catch(noop$1),e.modelAlphaMotion.set(d,o/3).catch(noop$1),e.cameraMotion.set(l,o).catch(noop$1),e.locationMotion.set(c,o).then(function(){e.emit("initAnimation.end",createEvent("initAnimation.end",{state:u,userAction:e.userAction}))},function(m){var A=__assign(__assign(__assign({},e.currentPano),{mode:e.mode}),clonePose(e.camera.pose));e.emit("initAnimation.end",createEvent("initAnimation.end",{state:A,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,o=arrayMin(i,function(l){return l.standingPosition.distanceTo(r.point)},!0),s=o[0],u=o[1];return s&&u<10?s:null},t.prototype.coordinatesForOffset=function(e){var r=this.renderer.getSize(new THREE__namespace.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,o){var s=this;if(this.inMomentumMovement!==null){for(var u=__assign({},i),l={longitude:0,latitude:0,x:0,y:0,z:0},c=0;c<o;c++)u.longitude*=.996,u.latitude*=.996*.998,u.x*=.99,u.y*=.99,u.z*=.99,l.longitude+=u.longitude,l.latitude+=u.latitude,l.x+=u.x,l.y+=u.y,l.z+=u.z;var d=formatRad(this.cameraMotion.value.longitude+l.longitude),f=clamp$1(this.cameraMotion.value.latitude+l.latitude,this.minLatitude,this.maxLatitude),m=new THREE__namespace.Vector3(this.locationMotion.value.x+l.x,this.locationMotion.value.y+l.y,this.locationMotion.value.z+l.z);this.modelInScreen==="boundingbox-center"&&m.clamp(this.models.bounding.min,this.models.bounding.max);var A=__assign(__assign({},this.currentPano),{mode:this.mode,longitude:d,latitude:f,offset:m,fov:this.cameraMotion.value.fov,distance:this.camera.pose.distance}),h=!(Math.abs(u.longitude)>1e-4||Math.abs(u.latitude)>1e-4||Math.abs(u.x)>1e-4||Math.abs(u.y)>1e-4||Math.abs(u.z)>1e-4),p=createEvent("gesture.momentum",__assign(__assign({},e),{isFirst:r,isFinal:h,state:A}));if(this.inMomentumMovement.event=p,this.emit("gesture.momentum",p),e.defaultPrevented){this.inMomentumMovement=null;return}this.inMomentumMovement&&(this.cameraMotion.set({longitude:d,latitude:f},0).catch(noop$1),this.locationMotion.set({x:A.offset.x,y:A.offset.y,z:A.offset.z},0).catch(noop$1),h?this.inMomentumMovement=null:AnimationFrameLoop.shared.add(function(y,v){s.requestMomentumMovement(e,!1,u,v|0)},!0,1))}},t.prototype.fixFinalState=function(e){if(this.perspToOrthoMotion.getTargetKeyframe().value.perspToOrtho!==1){var r=coordinatesToVector(e,new THREE__namespace.Vector3),i=new THREE__namespace.Vector3().copy(e.offset).sub(r.clone().multiplyScalar(e.distance)),o=new THREE__namespace.Raycaster(i,r);o.params.Points={threshold:.1},o.near=RAYCASTER_NEAR;var s=this.models.intersectRaycaster(o)[0];if(!s&&o.ray.direction.y<-.3){var u=new THREE__namespace.Plane(new THREE__namespace.Vector3(0,1,0),-this.models.bounding.min.y),l=o.ray.intersectPlane(u,new THREE__namespace.Vector3);if(l){var c=l.distanceTo(o.ray.origin);c<1e4&&c>=o.near&&(s={distance:c,floor:0,point:l,object:this.scene,face:null})}}s&&(e.distance=clamp$1(s.distance,minDistance,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,o=0;e.pointerType==="mouse"&&(o=e.srcEvent.buttons),i&&o===0&&i.buttons!==0&&(o=i.buttons);var s=i==null?void 0:i.target;if(!s){var u=this.relativeClientPosition(e.center),l=new THREE__namespace.Raycaster;l.params.Points={threshold:.1},l.setFromCamera(u,this.camera),l.near=RAYCASTER_NEAR,s=new THREE__namespace.Vector3().copy(l.ray.direction).multiplyScalar(3).add(l.ray.origin);var c=this.models.intersectRaycaster(l)[0];if(!c&&l.ray.direction.y<-.3){var d=new THREE__namespace.Plane(new THREE__namespace.Vector3(0,1,0),0),f=l.ray.intersectPlane(d,new THREE__namespace.Vector3);if(f){var m=f.distanceTo(l.ray.origin);m<1e4&&m>=l.near&&(c={distance:m,floor:0,point:f,object:this.scene})}}if(c)s.copy(c.point);else{var A=new THREE__namespace.Vector3().copy(this.camera.pose.offset).sub(this.camera.position),d=new THREE__namespace.Plane().setFromNormalAndCoplanarPoint(A,this.camera.pose.offset);l.ray.intersectPlane(d,s)}}if(e.isFinal?delete this.panState:this.panState={target:s,buttons:o,pointerLength:r,x:e.center.x,y:e.center.y},!(typeof i=="undefined"||i.pointerLength!==r)){var h=r>1||o===2;if(h){var p={x:e.center.x-i.x,y:e.center.y-i.y},y=new THREE__namespace.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),v=coordinatesToVector(this.cameraMotion.value).setLength(this.locationMotion.value.distance).add(y),g=new THREE__namespace.Vector3().copy(v).sub(i.target).length();g*=Math.tan(this.camera.pose.fov/2*Math.PI/180);var E=this.renderer.getSize(new THREE__namespace.Vector2),b=2*p.x*g/E.y,T=2*p.y*g/E.y,_=new THREE__namespace.Vector3;_.setFromMatrixColumn(this.camera.matrix,0),_.multiplyScalar(-b),y.add(_),this.camera.pose.latitude<PANGESTURE_FORWARD_ANGLE?_.setFromMatrixColumn(this.camera.matrix,1):(_.setFromMatrixColumn(this.camera.matrix,0),_.crossVectors(this.camera.up,_)),_.multiplyScalar(T),y.add(_),this.modelInScreen==="boundingbox-center"&&y.clamp(this.models.bounding.min,this.models.bounding.max);var x=__assign(__assign({},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=x,this.emit("gesture.pan",e),e.defaultPrevented)return;if(this.locationMotion.set({x:x.offset.x,y:x.offset.y,z:x.offset.z},0).catch(noop$1),e.isFinal&&(this.fixFinalState(x),this.locationMotion.set({distance:x.distance,x:x.offset.x,y:x.offset.y,z:x.offset.z},0).catch(noop$1)),e.isFinal){var R=this.renderer.getSize(new THREE__namespace.Vector2),w=2*e.velocityX*g/R.y,S=2*e.velocityY*g/R.y,C=new THREE__namespace.Vector3,I=new THREE__namespace.Vector3;C.setFromMatrixColumn(this.camera.matrix,0),C.multiplyScalar(-w),I.add(C),this.camera.pose.latitude<PANGESTURE_FORWARD_ANGLE?C.setFromMatrixColumn(this.camera.matrix,1):(C.setFromMatrixColumn(this.camera.matrix,0),C.crossVectors(this.camera.up,C)),C.multiplyScalar(S),I.add(C),this.inMomentumMovement={uuid:createUuid()},this.requestMomentumMovement(e,!0,{longitude:0,latitude:0,x:I.x,y:I.y,z:I.z},0)}}else{var p={x:e.center.x-i.x,y:e.center.y-i.y},H=this.coordinatesForOffset(p),B=formatRad(this.cameraMotion.value.longitude+H.longitude),L=clamp$1(this.cameraMotion.value.latitude+H.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 x=__assign(__assign({},this.currentPano),{mode:this.mode,longitude:B,latitude:L,fov:this.camera.pose.fov,offset:this.camera.pose.offset,distance:this.camera.pose.distance});if(e.isFinal&&this.fixFinalState(x),e.state=x,this.emit("gesture.pan",e),e.defaultPrevented)return;if(e.isFinal?this.locationMotion.set({distance:x.distance,x:x.offset.x,y:x.offset.y,z:x.offset.z},0).catch(noop$1):this.cameraMotion.set({longitude:x.longitude,latitude:x.latitude},0).catch(noop$1),e.isFinal){var O=e.velocityX,k=e.velocityY;this.inMomentumMovement={uuid:createUuid()},this.requestMomentumMovement(e,!0,__assign(__assign({},this.coordinatesForOffset({x:O,y:k})),{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 o=this.models.bounding.getCenter(new THREE__namespace.Vector3),s=t.distanceFromModel(this.models,this.cameraMotion.value.fov,this.camera.aspect),u=clamp$1(i/e.scale,minDistance,1/0),l=e.state.offset.clone().sub(coordinatesToVector(e.state).setLength(u)),c=this.models.bounding.containsPoint(l),d;!c&&this.pinchState&&this.pinchState.scale>e.scale&&o.distanceTo(l)>s?d=e.state.distance:(d=u,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(noop$1),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 o=e.center.raycaster;if(o.near=RAYCASTER_NEAR,o.far=500,e.isFinal&&this.intersectMesh.parent&&this.intersectMesh.visible===!0){this.hideIntersectMesh();return}var s=this.models.intersectRaycaster(o)[0],u=createEvent("intersect.update",{raycaster:o,intersection:s!=null?s:null,object:this.intersectMesh});if(this.emit("intersect.update",u),u.defaultPrevented){this.hideIntersectMesh();return}if(s){var l=(i=(r=s.face)===null||r===void 0?void 0:r.normal)!==null&&i!==void 0?i:new THREE__namespace.Vector3().copy(o.ray.direction).multiplyScalar(-1),c=l.clone(),d=s.point.clone();this.intersectMesh.position.copy(d);var f=o.ray.origin.distanceTo(d),m=2*Math.tan(.5*this.camera.fov/180*Math.PI),A=Math.max(f*m/10,1);this.intersectMesh.scale.set(A,A,A);var h=d.clone().add(c);if(this.intersectMesh.lookAt(h),Math.abs(l.y)>.99){var p=this.camera.position.clone().sub(d);this.intersectMesh.rotation.z=-Math.atan2(p.z,p.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(noop$1)}else{var o=e.center.delta/2*Math.max(Math.log(this.locationMotion.value.distance),1),s=this.models.bounding.getCenter(new THREE__namespace.Vector3),u=t.distanceFromModel(this.models,this.cameraMotion.value.fov,this.camera.aspect),l=clamp$1(this.locationMotion.value.distance-o,minDistance,1/0),c=e.state.offset.clone().sub(coordinatesToVector(e.state).setLength(l)),d=this.models.bounding.containsPoint(c);if(this.modelInScreen!=="none"&&(l=!d&&o<0&&s.distanceTo(c)>u?e.state.distance:l),e.state.distance=l,this.emit("gesture.mousewheel",e),e.defaultPrevented)return;this.locationMotion.set({distance:l},0).catch(noop$1)}},t.prototype.onTapGesture=function(e){var r=this;this.userAction=e.userAction,this.stopMomentumMovement();var i=e.center.raycaster,o=this.getForwardObserverOrNot(i);if(!o)this.emit("gesture.tap",e);else{var s={longitude:this.camera.pose.longitude,latitude:0},u=__assign(__assign({},e.state),{mode:"Panorama",workCode:o.pano.workCode,panoIndex:o.pano.panoIndex,longitude:s.longitude,latitude:s.latitude,offset:o?o.position.clone():new THREE__namespace.Vector3,distance:0});if(e.state=u,this.emit("gesture.tap",e),!e.defaultPrevented&&(this.emit("pano.select",createEvent("pano.select",{prevPano:this.currentPano,state:u,userAction:e.userAction,options:s,progress:0,error:null})),o&&o.active)){var l=this.currentTapId=createUuid();this.preloadPano(o.pano).then(function(c){r.currentTapId===l&&r.emit("pano.request",createEvent("pano.request",{userAction:!0,prevPano:r.currentPano,progress:0,state:u,options:s,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}(BaseController);function isNil(n){return n==null}var _moveEvent={type:"move"},XRController=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 THREE__namespace.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 THREE__namespace.Group,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new THREE__namespace.Vector3,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new THREE__namespace.Vector3),this._targetRay},n.prototype.getGripSpace=function(){return this._grip===null&&(this._grip=new THREE__namespace.Group,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new THREE__namespace.Vector3,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new THREE__namespace.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,o=null,s=null,u=this._targetRay,l=this._grip,c=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(u!==null&&(i=e.getPose(t.targetRaySpace,r),i!==null&&(u.matrix.fromArray(i.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),i.linearVelocity?(u.hasLinearVelocity=!0,u.linearVelocity.copy(i.linearVelocity)):u.hasLinearVelocity=!1,i.angularVelocity?(u.hasAngularVelocity=!0,u.angularVelocity.copy(i.angularVelocity)):u.hasAngularVelocity=!1,this.dispatchEvent(_moveEvent))),c&&t.hand){s=!0;for(var d=0,f=t.hand.values();d<f.length;d++){var m=f[d],A=e.getJointPose(m,r);if(c.joints[m.jointName]===void 0){var h=new THREE__namespace.Group;h.matrixAutoUpdate=!1,h.visible=!1,c.joints[m.jointName]=h,c.add(h)}var p=c.joints[m.jointName];A!==null&&(p.matrix.fromArray(A.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.jointRadius=A.radius),p.visible=A!==null}var y=c.joints["index-finger-tip"],v=c.joints["thumb-tip"],g=y.position.distanceTo(v.position),E=.02,b=.005;c.inputState.pinching&&g>E+b?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!c.inputState.pinching&&g<=E-b&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else l!==null&&t.gripSpace&&(o=e.getPose(t.gripSpace,r),o!==null&&(l.matrix.fromArray(o.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),o.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(o.linearVelocity)):l.hasLinearVelocity=!1,o.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(o.angularVelocity)):l.hasAngularVelocity=!1));return u!==null&&(u.visible=i!==null),l!==null&&(l.visible=o!==null),c!==null&&(c.visible=s!==null),this},n}(),framebufferScaleFactor=1,XRManager=function(){function n(t,e,r){var i,o,s,u,l;this.isPanorama=(i=r==null?void 0:r.isPanorama)!==null&&i!==void 0?i:!0;var c=navigator.userAgent.toLowerCase(),d;c.includes("oculus")?d="Oculus":c.includes("pico")?d="Pico":d="VP",this.machineType=(o=r==null?void 0:r.machineType)!==null&&o!==void 0?o:d,this.renderer=t,this.gl=e,this.enabled=!1,this.session=null,this.referenceSpaceType=(s=r==null?void 0:r.referenceSpaceType)!==null&&s!==void 0?s:"local-floor",this.referenceSpace=null,this.onSessionStartCallback=(u=r==null?void 0:r.onSessionStart)!==null&&u!==void 0?u:noop$1,this.onSessionEndCallback=(l=r==null?void 0:r.onSessionEnd)!==null&&l!==void 0?l:noop$1,this.controllers=[new XRController,new XRController],this.inputSourcesMap=new Map,this.cameraVR=new THREE__namespace.ArrayCamera,this.cameraL=new THREE__namespace.PerspectiveCamera,this.cameraR=new THREE__namespace.PerspectiveCamera,this.cameraL.viewport=new THREE__namespace.Vector4,this.cameraR.viewport=new THREE__namespace.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 THREE__namespace.Vector3,this.cameraRPos=new THREE__namespace.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),o=e.projectionMatrix.elements,s=r.projectionMatrix.elements,u=o[14]/(o[10]-1),l=o[14]/(o[10]+1),c=(o[9]+1)/o[5],d=(o[9]-1)/o[5],f=(o[8]-1)/o[0],m=(s[8]+1)/s[0],A=u*f,h=u*m,p=i/(-f+m),y=p*-f;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(y),t.translateZ(p),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);var v=u+p,g=l+p,E=A-y,b=h+(i-y),T=c*l/g*v,_=d*l/g*v;t.projectionMatrix.makePerspective(E,b,T,_,v,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 o=t.children,i=0,s=o.length;i<s;i++)o[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],o=this.inputSourcesMap.get(i);o&&(o.dispatchEvent({type:"disconnected",data:i}),this.inputSourcesMap.delete(i))}for(var r=0;r<t.added.length;r++){var i=t.added[r],o=this.inputSourcesMap.get(i);o&&o.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,AnimationFrameLoop.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};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(o){e.onRequestReferenceSpace(o)}),e.session.addEventListener("inputsourceschange",function(o){e.updateInputSources(o)})})}},n}(),LineSegmentsGeometry=function(n){__extends(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],o=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];return e.setIndex(o),e.setAttribute("position",new THREE__namespace.Float32BufferAttribute(r,3)),e.setAttribute("uv",new THREE__namespace.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 THREE__namespace.InstancedInterleavedBuffer(r,6,1);return this.setAttribute("instanceStart",new THREE__namespace.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceEnd",new THREE__namespace.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 THREE__namespace.InstancedInterleavedBuffer(r,6,1);return this.setAttribute("instanceColorStart",new THREE__namespace.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceColorEnd",new THREE__namespace.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 THREE__namespace.WireframeGeometry(e.geometry)),this},t.prototype.fromLineSegments=function(e){var r=e.geometry;if(r instanceof THREE__namespace.Geometry){var i=new THREE__namespace.BufferGeometry().fromGeometry(r);this.setPositions(i.attributes.position.array)}else r instanceof THREE__namespace.BufferGeometry&&this.setPositions(r.attributes.position.array);return this},t.prototype.computeBoundingBox=function(){this.boundingBox===null&&(this.boundingBox=new THREE__namespace.Box3);var e=this.attributes.instanceStart,r=this.attributes.instanceEnd;if(e!==void 0&&r!==void 0){var i=new THREE__namespace.Box3;this.boundingBox.setFromBufferAttribute(e),i.setFromBufferAttribute(r),this.boundingBox.union(i)}},t.prototype.computeBoundingSphere=function(){this.boundingSphere===null&&(this.boundingSphere=new THREE__namespace.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 o=0,s=new THREE__namespace.Vector3,u=0,l=e.count;u<l;u++)s.fromBufferAttribute(e,u),o=Math.max(o,i.distanceToSquared(s)),s.fromBufferAttribute(r,u),o=Math.max(o,i.distanceToSquared(s));this.boundingSphere.radius=Math.sqrt(o),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}(THREE__namespace.InstancedBufferGeometry);Object.assign(LineSegmentsGeometry.prototype,{isLineSegmentsGeometry:!0});var lineShader={uniforms:THREE__namespace.UniformsUtils.merge([THREE__namespace.UniformsLib.common,THREE__namespace.UniformsLib.fog,{linewidth:{value:1},resolution:{value:new THREE__namespace.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1},opacity:{value:1}}]),vertexShader:`
1862
+ b-J-Htyl]|vv|{-J-}|wrpv|{Znv\x07-7-z|qrycvrZnv\x07-7-rpA5}|vv|{9>;=6H\f`);var HQMaterial=function(n){__extends(t,n);function t(e){var r=n.call(this,{vertexShader:vertex,fragmentShader:fragment})||this;return r.uniforms={uDepthMap:makeUniform("t",null),uWeightMap:makeUniform("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}},__decorate([uniform("uDepthMap"),__metadata("design:type",Number)],t.prototype,"uDepthMap",void 0),__decorate([uniform("uWeightMap"),__metadata("design:type",Number)],t.prototype,"uWeightMap",void 0),t}(THREE__namespace.RawShaderMaterial);function makeUniform(n,t){return{type:n,value:t}}function uniform(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 passCamera=new THREE__namespace.OrthographicCamera(-1,1,1,-1,0,1),geometry$1=new THREE__namespace.BufferGeometry;geometry$1.setAttribute("position",new THREE__namespace.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),geometry$1.setAttribute("uv",new THREE__namespace.Float32BufferAttribute([0,2,0,0,2,0],2));var mesh$1=new THREE__namespace.Mesh(geometry$1),hqScene=new THREE__namespace.Scene;hqScene.add(mesh$1);var HQEffect=function(n){__extends(t,n);function t(e,r,i,o){var s=n.call(this,e,r,i,o)||this;return s.sharedV2=new THREE__namespace.Vector2,s.renderer=e,s.material=new HQMaterial,s.camera=i,mesh$1.material=s.material,s}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 THREE__namespace.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 THREE__namespace.Color(0,0,0)),this.renderer.setClearAlpha(1),this.renderer.setRenderTarget(e[2]),this.renderer.render(hqScene,passCamera)},t.prototype.dispose=function(){this.copyPass.dispose()},t}(Effect),RAYCASTER_NEAR=.5,minDistance=.5,PANGESTURE_FORWARD_ANGLE=Math.PI/7,MapviewController=function(n){__extends(t,n);function t(e){var r=this,i,o=t.parseArgs(e);return r=n.call(this,o)||this,r.mode="Mapview",r.defaultLongitude=o.defaultLongitude,r.defaultLatitude=o.defaultLatitude,r.defaultDistance=o.defaultDistance,r.maxLatitude=o.maxLatitude,r.minLatitude=o.minLatitude,r.cameraType=o.cameraType,r.modelInScreen=o.modelInScreen,r.locationMotion=new Motion({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 Motion({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new Motion({perspToOrtho:r.camera.perspToOrtho.x}),r.intersectMeshCreator=o.intersectMeshCreator,r.intersectMesh=r.intersectMeshCreator(),r.intersectMesh.name="intersect",r.intersectMesh.visible=!1,r.currentTapId=null,r.helper.add(r.intersectMesh),r.edlTarget=new THREE__namespace.WebGLRenderTarget(1024,1024,{generateMipmaps:!1,minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,format:THREE__namespace.RGBAFormat,type:THREE__namespace.FloatType,depthTexture:new THREE__namespace.DepthTexture(1024,1024,THREE__namespace.UnsignedIntType)}),r.edlEffect=new EDLEffect(r.renderer,r.modelScene,r.camera,r.models),r.hqEffect=new HQEffect(r.renderer,r.modelScene,r.camera,r.models),r}return t.parseArgs=function(e){var r,i,o,s,u,c,l,d;if(e instanceof t)return e;var f=n.parseArgs.call(this,e);return __assign(__assign({},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:(o=e.defaultDistance)!==null&&o!==void 0?o:150,maxLatitude:(s=e.maxLatitude)!==null&&s!==void 0?s:+Math.PI/2,minLatitude:(u=e.minLatitude)!==null&&u!==void 0?u:0,cameraType:(c=e.cameraType)!==null&&c!==void 0?c:"auto",modelInScreen:(l=e.modelInScreen)!==null&&l!==void 0?l:"boundingbox-center",intersectMeshCreator:(d=e.intersectMeshCreator)!==null&&d!==void 0?d:function(){return new IntersectMesh}})},t.distanceFromModel=function(e,r,i){var o=e.bounding,s=Math.pow(Math.pow(o.max.x-o.min.x+1,2)+Math.pow(o.max.y-o.min.y+1,2)+Math.pow(o.max.z-o.min.z+1,2),1/2),u=s/2/Math.tan(Math.PI*r/360);return i<1&&(u=u/i),isNaN(u)?s:u},t.initAnimationEndState=function(e){var r,i,o,s,u,c,l,d=this.parseArgs(e),f=d.works,v=d.models,A=e.initial,h=A.state,p=A.currentState,y=typeof h.panoIndex=="number"?{workCode:(o=(r=h.workCode)!==null&&r!==void 0?r:(i=d.works[0])===null||i===void 0?void 0:i.workCode)!==null&&o!==void 0?o:"",panoIndex:h.panoIndex}:{workCode:p.workCode,panoIndex:p.panoIndex},m=f.getResolvedObserver(y),g=(s=h.fov)!==null&&s!==void 0?s:60,E=clamp$1((u=h.latitude)!==null&&u!==void 0?u:isThirdPersonMode(p.mode)?p.latitude:d.defaultLatitude,d.minLatitude,d.maxLatitude),b=t.distanceFromModel(d.models,g,d.camera.aspect),T=new THREE__namespace.Vector3,_=(c=h.distance)!==null&&c!==void 0?c:Math.min(d.defaultDistance,b),S=(l=h.longitude)!==null&&l!==void 0?l:isThirdPersonMode(p.mode)?p.longitude:d.defaultLongitude;return h.offset?T.copy(h.offset):d.defaultDistance<b&&m?(T.copy(m.position),h.longitude===void 0&&(S=p.longitude)):T.copy(v.bounding.getCenter(T)),v.bounding.containsPoint(T)||v.bounding.getCenter(T),__assign(__assign({},y),{mode:"Mapview",longitude:S,latitude:E,fov:g,offset:T,distance:_})},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,o){this.userAction=o,this.works=e;var s=t.initAnimationEndState(__assign(__assign({},this),{initial:{currentState:__assign(__assign({},this.currentPano),this.camera.pose),duration:i.duration,effect:i.effect,state:r,userAction:o}}));this.currentPano={workCode:s.workCode,panoIndex:s.panoIndex};var u={longitude:s.longitude,latitude:s.latitude,fov:s.fov},c={x:s.offset.x,y:s.offset.y,z:s.offset.z,distance:s.distance,orthoDistance:s.distance};return this.locationMotion.set(c,i.duration).catch(noop$1),this.cameraMotion.set(u,i.duration).catch(noop$1),!0},t.prototype.updateModel=function(e){n.prototype.updateModel.call(this,e)},t.prototype.updateCamera=function(e,r,i){var o=this;return this.initAnimationReady.then(function(){o.userAction=i,o.stopMomentumMovement();var s={},u={};return e.distance!==void 0&&(s.distance=e.distance),e.offset!==void 0&&(s.x=e.offset.x,s.y=e.offset.y,s.z=e.offset.z),e.longitude!==void 0&&(u.longitude=e.longitude),e.latitude!==void 0&&(u.latitude=e.latitude),e.fov!==void 0&&(u.fov=e.fov),o.locationMotion.set(s,r).catch(noop$1),o.cameraMotion.set(u,r).catch(noop$1)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var o=this;return this.initAnimationReady.then(function(){o.userAction=i,o.stopMomentumMovement();for(var s=[],u=[],c=0,l=e;c<l.length;c++){var d=l[c];s.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}}),u.push({key:d.key,progress:d.progress,value:{longitude:d.value.longitude,latitude:d.value.latitude,fov:d.value.fov}})}return o.locationMotion.setKeyframes(s,r).catch(noop$1),o.cameraMotion.setKeyframes(e,r)})},t.prototype.updateTime=function(e,r){if(!this.destroyed){var i={},o={};this.locationMotion.ended||(this.locationMotion.update(e),o.distance=this.locationMotion.value.distance,o.offset=new THREE__namespace.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z)),this.cameraMotion.ended||(this.cameraMotion.update(e),o.longitude=this.cameraMotion.value.longitude,o.latitude=this.cameraMotion.value.latitude,o.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended||(this.modelAlphaMotion.update(e),i.modelAlpha=this.modelAlphaMotion.value.modelAlpha);var s=0;this.cameraType==="auto"?s=Math.PI/2-this.cameraMotion.value.latitude<.02?1:0:this.cameraType==="perspective"?s=0:this.cameraType==="orthographic"&&(s=1),this.perspToOrthoMotion.getTargetKeyframe().value.perspToOrtho!==s&&this.perspToOrthoMotion.set({perspToOrtho:s},500).catch(noop$1),this.perspToOrthoMotion.ended||(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(clamp$1(this.perspToOrthoMotion.value.perspToOrtho,0,1))),isEmptyObject(i)||this.models.setMaterial(i),isEmptyObject(o)||this.setCamera(o)}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(now())[1],r=this.locationMotion.getKeyFrameSegment(now())[1];return __assign(__assign({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,distance:r.value.distance,offset:new THREE__namespace.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 o=i.duration,s=i.userAction;e.userAction=s;var u=t.initAnimationEndState(e),c={longitude:u.longitude,latitude:u.latitude,fov:u.fov},l={x:u.offset.x,y:u.offset.y,z:u.offset.z,distance:u.distance},d={modelAlpha:1},f={perspToOrtho:0};e.emit("initAnimation.start",createEvent("initAnimation.start",{state:u,userAction:e.userAction})),e.perspToOrthoMotion.set(f,o).catch(noop$1),e.modelAlphaMotion.set(d,o/3).catch(noop$1),e.cameraMotion.set(c,o).catch(noop$1),e.locationMotion.set(l,o).then(function(){e.emit("initAnimation.end",createEvent("initAnimation.end",{state:u,userAction:e.userAction}))},function(v){var A=__assign(__assign(__assign({},e.currentPano),{mode:e.mode}),clonePose(e.camera.pose));e.emit("initAnimation.end",createEvent("initAnimation.end",{state:A,userAction:e.userAction}))}).then(function(){r()})})},t.prototype.getForwardObserverOrNot=function(e){var r=this,i=this.models.intersectRaycaster(e)[0];if(!i)return null;var o=this.works.resolvedObservers.filter(function(l){for(var d,f=0,v=r.models;f<v.length;f++){var A=v[f];if(A.visible&&((d=A.work)===null||d===void 0?void 0:d.workCode)===l.work.workCode)return!0}return!1}),s=arrayMin(o,function(l){return l.standingPosition.distanceTo(i.point)},!0),u=s[0],c=s[1];return u&&c<10?u:null},t.prototype.coordinatesForOffset=function(e){var r=this.renderer.getSize(new THREE__namespace.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,o){var s=this;if(this.inMomentumMovement!==null){for(var u=__assign({},i),c={longitude:0,latitude:0,x:0,y:0,z:0},l=0;l<o;l++)u.longitude*=.996,u.latitude*=.996*.998,u.x*=.99,u.y*=.99,u.z*=.99,c.longitude+=u.longitude,c.latitude+=u.latitude,c.x+=u.x,c.y+=u.y,c.z+=u.z;var d=formatRad(this.cameraMotion.value.longitude+c.longitude),f=clamp$1(this.cameraMotion.value.latitude+c.latitude,this.minLatitude,this.maxLatitude),v=new THREE__namespace.Vector3(this.locationMotion.value.x+c.x,this.locationMotion.value.y+c.y,this.locationMotion.value.z+c.z),A=__assign(__assign({},this.currentPano),{mode:this.mode,longitude:d,latitude:f,offset:v,fov:this.cameraMotion.value.fov,distance:this.camera.pose.distance}),h=!(Math.abs(u.longitude)>1e-4||Math.abs(u.latitude)>1e-4||Math.abs(u.x)>1e-4||Math.abs(u.y)>1e-4||Math.abs(u.z)>1e-4),p=createEvent("gesture.momentum",__assign(__assign({},e),{isFirst:r,isFinal:h,state:A}));if(this.inMomentumMovement.event=p,this.emit("gesture.momentum",p),e.defaultPrevented){this.inMomentumMovement=null;return}this.inMomentumMovement&&(this.cameraMotion.set({longitude:d,latitude:f},0).catch(noop$1),this.locationMotion.set({x:A.offset.x,y:A.offset.y,z:A.offset.z},0).catch(noop$1),h?this.inMomentumMovement=null:AnimationFrameLoop.shared.add(function(y,m){s.requestMomentumMovement(e,!1,u,m|0)},!0,1))}},t.prototype.fixFinalState=function(e){if(this.perspToOrthoMotion.getTargetKeyframe().value.perspToOrtho!==1){var r=coordinatesToVector(e,new THREE__namespace.Vector3),i=new THREE__namespace.Vector3().copy(e.offset).sub(r.clone().multiplyScalar(e.distance)),o=new THREE__namespace.Raycaster(i,r);o.params.Points={threshold:.1},o.near=RAYCASTER_NEAR;var s;if(o.ray.direction.y<-.3&&(s=this.models.intersectRaycaster(o).filter(function(f){var v,A=(v=f.face)===null||v===void 0?void 0:v.normal;return A&&o.ray.direction.dot(A)>=0?!1:f.distance>minDistance+o.near})[0],!s)){var u=new THREE__namespace.Plane(new THREE__namespace.Vector3(0,1,0),-this.models.bounding.min.y),c=o.ray.intersectPlane(u,new THREE__namespace.Vector3);if(c){var l=c.distanceTo(o.ray.origin);l<1e4&&l>=o.near&&(s={distance:l,floor:0,point:c,object:this.scene,face:null})}}if(!s){var d=Math.max(e.distance,3);s={distance:d,floor:0,point:o.ray.direction.clone().setLength(d).add(o.ray.origin),object:this.scene,face:null}}s&&(e.distance=clamp$1(s.distance,0,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,o=0;e.pointerType==="mouse"&&(o=e.srcEvent.buttons),i&&o===0&&i.buttons!==0&&(o=i.buttons);var s=i==null?void 0:i.target;if(!s){var u=this.relativeClientPosition(e.center),c=new THREE__namespace.Raycaster;c.params.Points={threshold:.1},c.setFromCamera(u,this.camera),c.near=RAYCASTER_NEAR,s=new THREE__namespace.Vector3().copy(c.ray.direction).multiplyScalar(3).add(c.ray.origin);var l=this.models.intersectRaycaster(c)[0];if(!l&&c.ray.direction.y<-.3){var d=new THREE__namespace.Plane(new THREE__namespace.Vector3(0,1,0),0),f=c.ray.intersectPlane(d,new THREE__namespace.Vector3);if(f){var v=f.distanceTo(c.ray.origin);v<1e4&&v>=c.near&&(l={distance:v,floor:0,point:f,object:this.scene})}}if(l)s.copy(l.point);else{var A=new THREE__namespace.Vector3().copy(this.camera.pose.offset).sub(this.camera.position).normalize(),d=new THREE__namespace.Plane().setFromNormalAndCoplanarPoint(A,this.camera.pose.offset);c.ray.intersectPlane(d,s)}}if(e.isFinal?delete this.panState:this.panState={target:s,buttons:o,pointerLength:r,x:e.center.x,y:e.center.y},!(typeof i=="undefined"||i.pointerLength!==r)){var h=r>1||o===2;if(h){var p={x:e.center.x-i.x,y:e.center.y-i.y},y=new THREE__namespace.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),m=coordinatesToVector(this.cameraMotion.value).setLength(this.locationMotion.value.distance).add(y),g=new THREE__namespace.Vector3().copy(m).sub(i.target).length();g*=Math.tan(this.camera.pose.fov/2*Math.PI/180);var E=this.renderer.getSize(new THREE__namespace.Vector2),b=2*p.x*g/E.y,T=2*p.y*g/E.y,_=new THREE__namespace.Vector3;if(_.setFromMatrixColumn(this.camera.matrix,0),_.multiplyScalar(-b),y.add(_),this.camera.pose.latitude<PANGESTURE_FORWARD_ANGLE?_.setFromMatrixColumn(this.camera.matrix,1):(_.setFromMatrixColumn(this.camera.matrix,0),_.crossVectors(this.camera.up,_)),_.multiplyScalar(T),y.add(_),this.modelInScreen==="boundingbox-center"){var S=this.models.bounding.clone();S.expandByScalar(this.camera.pose.distance),y.clamp(S.min,S.max)}var R=__assign(__assign({},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=R,this.emit("gesture.pan",e),e.defaultPrevented)return;if(this.locationMotion.set({x:R.offset.x,y:R.offset.y,z:R.offset.z},0).catch(noop$1),e.isFinal&&(this.fixFinalState(R),Object.assign(e,{__fixFinalState:!0}),this.locationMotion.set({distance:R.distance,x:R.offset.x,y:R.offset.y,z:R.offset.z},0).catch(noop$1)),e.isFinal){var B=this.renderer.getSize(new THREE__namespace.Vector2),I=2*e.velocityX*g/B.y,x=2*e.velocityY*g/B.y,M=new THREE__namespace.Vector3,L=new THREE__namespace.Vector3;M.setFromMatrixColumn(this.camera.matrix,0),M.multiplyScalar(-I),L.add(M),this.camera.pose.latitude<PANGESTURE_FORWARD_ANGLE?M.setFromMatrixColumn(this.camera.matrix,1):(M.setFromMatrixColumn(this.camera.matrix,0),M.crossVectors(this.camera.up,M)),M.multiplyScalar(x),L.add(M),this.inMomentumMovement={uuid:createUuid()},this.requestMomentumMovement(e,!0,{longitude:0,latitude:0,x:L.x,y:L.y,z:L.z},0)}}else{var p={x:e.center.x-i.x,y:e.center.y-i.y},C=this.coordinatesForOffset(p),H=formatRad(this.cameraMotion.value.longitude+C.longitude),F=clamp$1(this.cameraMotion.value.latitude+C.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&&(F=this.cameraMotion.value.latitude);var R=__assign(__assign({},this.currentPano),{mode:this.mode,longitude:H,latitude:F,fov:this.camera.pose.fov,offset:this.camera.pose.offset,distance:this.camera.pose.distance});if(e.isFinal&&Object.assign(e,{__fixFinalState:!0}),e.state=R,this.emit("gesture.pan",e),e.defaultPrevented)return;if(e.isFinal?this.locationMotion.set({distance:R.distance,x:R.offset.x,y:R.offset.y,z:R.offset.z},0).catch(noop$1):this.cameraMotion.set({longitude:R.longitude,latitude:R.latitude},0).catch(noop$1),e.isFinal){var O=e.velocityX,G=e.velocityY;this.inMomentumMovement={uuid:createUuid()},this.requestMomentumMovement(e,!0,__assign(__assign({},this.coordinatesForOffset({x:O,y:G})),{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(typeof i!="undefined"){var o=this.models.bounding.getCenter(new THREE__namespace.Vector3),s=t.distanceFromModel(this.models,this.cameraMotion.value.fov,this.camera.aspect),u=clamp$1(i/e.scale,minDistance,1/0),c=e.state.offset.clone().sub(coordinatesToVector(e.state).setLength(u)),l=this.models.bounding.containsPoint(c),d;if(!l&&this.pinchState&&this.pinchState.scale>e.scale&&o.distanceTo(c)>s?d=e.state.distance:(d=u,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(noop$1),e.pointerType!=="mouse"&&(e.type="gesture.pan",this.onPanGesture(e)),e.isFinal)){if(!("__fixFinalState"in e)){var f=e.state;this.fixFinalState(e.state);var v={x:f.offset.x,y:f.offset.y,z:f.offset.z,distance:f.distance};this.locationMotion.set(v,0).catch(noop$1)}delete this.panState,delete this.pinchState}}}},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 o=e.center.raycaster;if(o.near=RAYCASTER_NEAR,o.far=500,e.isFinal&&this.intersectMesh.parent&&this.intersectMesh.visible===!0){this.hideIntersectMesh();return}var s=this.models.intersectRaycaster(o)[0],u=createEvent("intersect.update",{raycaster:o,intersection:s!=null?s:null,object:this.intersectMesh});if(this.emit("intersect.update",u),u.defaultPrevented){this.hideIntersectMesh();return}if(s){var c=(i=(r=s.face)===null||r===void 0?void 0:r.normal)!==null&&i!==void 0?i:new THREE__namespace.Vector3().copy(o.ray.direction).multiplyScalar(-1),l=c.clone(),d=s.point.clone();this.intersectMesh.position.copy(d);var f=o.ray.origin.distanceTo(d),v=2*Math.tan(.5*this.camera.fov/180*Math.PI),A=Math.max(f*v/10,1);this.intersectMesh.scale.set(A,A,A);var h=d.clone().add(l);if(this.intersectMesh.lookAt(h),Math.abs(c.y)>.99){var p=this.camera.position.clone().sub(d);this.intersectMesh.rotation.z=-Math.atan2(p.z,p.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(noop$1)}else{var o=e.center.delta/2*Math.max(Math.log(this.locationMotion.value.distance),1),s=this.models.bounding.getCenter(new THREE__namespace.Vector3),u=t.distanceFromModel(this.models,this.cameraMotion.value.fov,this.camera.aspect),c=clamp$1(this.locationMotion.value.distance-o,minDistance,1/0),l=e.state.offset.clone().sub(coordinatesToVector(e.state).setLength(c)),d=this.models.bounding.containsPoint(l);if(this.modelInScreen!=="none"&&(c=!d&&o<0&&s.distanceTo(l)>u?e.state.distance:c),e.state.distance=c,this.emit("gesture.mousewheel",e),e.defaultPrevented)return;this.locationMotion.set({distance:c},0).catch(noop$1)}},t.prototype.onTapGesture=function(e){var r=this;this.userAction=e.userAction,this.stopMomentumMovement();var i=e.center.raycaster,o=this.getForwardObserverOrNot(i);if(!o)this.emit("gesture.tap",e);else{var s={longitude:this.camera.pose.longitude,latitude:0},u=__assign(__assign({},e.state),{mode:"Panorama",workCode:o.pano.workCode,panoIndex:o.pano.panoIndex,longitude:s.longitude,latitude:s.latitude,offset:o?o.position.clone():new THREE__namespace.Vector3,distance:0});if(e.state=u,this.emit("gesture.tap",e),!e.defaultPrevented&&(this.emit("pano.select",createEvent("pano.select",{prevPano:this.currentPano,state:u,userAction:e.userAction,options:s,progress:0,error:null})),o&&o.active)){var c=this.currentTapId=createUuid();this.preloadPano(o.pano).then(function(l){r.currentTapId===c&&r.emit("pano.request",createEvent("pano.request",{userAction:!0,prevPano:r.currentPano,progress:0,state:u,options:s,error:null}))})}}},t.prototype.onDblTapGesture=function(e){if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var r=e.state,i=e.center.raycaster,o=i.ray.origin.clone().add(i.ray.direction.clone().setLength(3)),s=1,u=3,c=s,l=this.models.intersectRaycaster(i)[0];if(l&&(o=l.point.clone(),l.distance>(s+u)/2?c=s:c=u),e.state.distance=c,e.state.offset=o,this.emit("gesture.dbltap",e),!e.defaultPrevented){var d={x:r.offset.x,y:r.offset.y,z:r.offset.z,distance:r.distance};this.locationMotion.set(d,360).catch(noop$1),this.hideIntersectMesh()}}},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}(BaseController);function isNil(n){return n==null}var _moveEvent={type:"move"},XRController=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 THREE__namespace.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 THREE__namespace.Group,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new THREE__namespace.Vector3,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new THREE__namespace.Vector3),this._targetRay},n.prototype.getGripSpace=function(){return this._grip===null&&(this._grip=new THREE__namespace.Group,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new THREE__namespace.Vector3,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new THREE__namespace.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,o=null,s=null,u=this._targetRay,c=this._grip,l=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(u!==null&&(i=e.getPose(t.targetRaySpace,r),i!==null&&(u.matrix.fromArray(i.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),i.linearVelocity?(u.hasLinearVelocity=!0,u.linearVelocity.copy(i.linearVelocity)):u.hasLinearVelocity=!1,i.angularVelocity?(u.hasAngularVelocity=!0,u.angularVelocity.copy(i.angularVelocity)):u.hasAngularVelocity=!1,this.dispatchEvent(_moveEvent))),l&&t.hand){s=!0;for(var d=0,f=t.hand.values();d<f.length;d++){var v=f[d],A=e.getJointPose(v,r);if(l.joints[v.jointName]===void 0){var h=new THREE__namespace.Group;h.matrixAutoUpdate=!1,h.visible=!1,l.joints[v.jointName]=h,l.add(h)}var p=l.joints[v.jointName];A!==null&&(p.matrix.fromArray(A.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.jointRadius=A.radius),p.visible=A!==null}var y=l.joints["index-finger-tip"],m=l.joints["thumb-tip"],g=y.position.distanceTo(m.position),E=.02,b=.005;l.inputState.pinching&&g>E+b?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&g<=E-b&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else c!==null&&t.gripSpace&&(o=e.getPose(t.gripSpace,r),o!==null&&(c.matrix.fromArray(o.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),o.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(o.linearVelocity)):c.hasLinearVelocity=!1,o.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(o.angularVelocity)):c.hasAngularVelocity=!1));return u!==null&&(u.visible=i!==null),c!==null&&(c.visible=o!==null),l!==null&&(l.visible=s!==null),this},n}(),framebufferScaleFactor=1,XRManager=function(){function n(t,e,r){var i,o,s,u,c;this.isPanorama=(i=r==null?void 0:r.isPanorama)!==null&&i!==void 0?i:!0;var l=navigator.userAgent.toLowerCase(),d;l.includes("pico")?d="Pico":l.includes("oculus")?d="Oculus":d="VP",this.machineType=(o=r==null?void 0:r.machineType)!==null&&o!==void 0?o:d,this.renderer=t,this.gl=e,this.enabled=!1,this.session=null,this.referenceSpaceType=(s=r==null?void 0:r.referenceSpaceType)!==null&&s!==void 0?s:"local-floor",this.referenceSpace=null,this.onSessionStartCallback=(u=r==null?void 0:r.onSessionStart)!==null&&u!==void 0?u:noop$1,this.onSessionEndCallback=(c=r==null?void 0:r.onSessionEnd)!==null&&c!==void 0?c:noop$1,this.controllers=[new XRController,new XRController],this.inputSourcesMap=new Map,this.cameraVR=new THREE__namespace.ArrayCamera,this.cameraL=new THREE__namespace.PerspectiveCamera,this.cameraR=new THREE__namespace.PerspectiveCamera,this.cameraL.viewport=new THREE__namespace.Vector4,this.cameraR.viewport=new THREE__namespace.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 THREE__namespace.Vector3,this.cameraRPos=new THREE__namespace.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),o=e.projectionMatrix.elements,s=r.projectionMatrix.elements,u=o[14]/(o[10]-1),c=o[14]/(o[10]+1),l=(o[9]+1)/o[5],d=(o[9]-1)/o[5],f=(o[8]-1)/o[0],v=(s[8]+1)/s[0],A=u*f,h=u*v,p=i/(-f+v),y=p*-f;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(y),t.translateZ(p),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);var m=u+p,g=c+p,E=A-y,b=h+(i-y),T=l*c/g*m,_=d*c/g*m;t.projectionMatrix.makePerspective(E,b,T,_,m,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 o=t.children,i=0,s=o.length;i<s;i++)o[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],o=this.inputSourcesMap.get(i);o&&(o.dispatchEvent({type:"disconnected",data:i}),this.inputSourcesMap.delete(i))}for(var r=0;r<t.added.length;r++){var i=t.added[r],o=this.inputSourcesMap.get(i);o&&o.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,AnimationFrameLoop.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};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(o){e.onRequestReferenceSpace(o)}),e.session.addEventListener("inputsourceschange",function(o){e.updateInputSources(o)})})}},n}(),LineSegmentsGeometry=function(n){__extends(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],o=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];return e.setIndex(o),e.setAttribute("position",new THREE__namespace.Float32BufferAttribute(r,3)),e.setAttribute("uv",new THREE__namespace.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 THREE__namespace.InstancedInterleavedBuffer(r,6,1);return this.setAttribute("instanceStart",new THREE__namespace.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceEnd",new THREE__namespace.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 THREE__namespace.InstancedInterleavedBuffer(r,6,1);return this.setAttribute("instanceColorStart",new THREE__namespace.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceColorEnd",new THREE__namespace.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 THREE__namespace.WireframeGeometry(e.geometry)),this},t.prototype.fromLineSegments=function(e){var r=e.geometry;if(r instanceof THREE__namespace.Geometry){var i=new THREE__namespace.BufferGeometry().fromGeometry(r);this.setPositions(i.attributes.position.array)}else r instanceof THREE__namespace.BufferGeometry&&this.setPositions(r.attributes.position.array);return this},t.prototype.computeBoundingBox=function(){this.boundingBox===null&&(this.boundingBox=new THREE__namespace.Box3);var e=this.attributes.instanceStart,r=this.attributes.instanceEnd;if(e!==void 0&&r!==void 0){var i=new THREE__namespace.Box3;this.boundingBox.setFromBufferAttribute(e),i.setFromBufferAttribute(r),this.boundingBox.union(i)}},t.prototype.computeBoundingSphere=function(){this.boundingSphere===null&&(this.boundingSphere=new THREE__namespace.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 o=0,s=new THREE__namespace.Vector3,u=0,c=e.count;u<c;u++)s.fromBufferAttribute(e,u),o=Math.max(o,i.distanceToSquared(s)),s.fromBufferAttribute(r,u),o=Math.max(o,i.distanceToSquared(s));this.boundingSphere.radius=Math.sqrt(o),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}(THREE__namespace.InstancedBufferGeometry);Object.assign(LineSegmentsGeometry.prototype,{isLineSegmentsGeometry:!0});var lineShader={uniforms:THREE__namespace.UniformsUtils.merge([THREE__namespace.UniformsLib.common,THREE__namespace.UniformsLib.fog,{linewidth:{value:1},resolution:{value:new THREE__namespace.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
- `},LineMaterial=function(n){__extends(t,n);function t(e){var r=n.call(this,{uniforms:THREE__namespace.UniformsUtils.clone(lineShader.uniforms),vertexShader:lineShader.vertexShader,fragmentShader:lineShader.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}(THREE__namespace.ShaderMaterial);Object.assign(LineMaterial.prototype,{isLineMaterial:!0});var LineSegments2=function(n){__extends(t,n);function t(e,r){var i=n.call(this)||this;return i.type="LineSegments2",i.geometry=e!==void 0?e:new LineSegmentsGeometry,i.material=r!==void 0?r:new LineMaterial({color:Math.random()*16777215}),i}return t.prototype.computeLineDistances=function(){for(var e=this.geometry,r=e.attributes.instanceStart,i=e.attributes.instanceEnd,o=new Float32Array(2*r.count),s=new THREE__namespace.Vector3,u=new THREE__namespace.Vector3,l=0,c=0,d=r.count;l<d;l++,c+=2)s.fromBufferAttribute(r,l),u.fromBufferAttribute(i,l),o[c]=c===0?0:o[c-1],o[c+1]=o[c]+s.distanceTo(u);var f=new THREE__namespace.InstancedInterleavedBuffer(o,2,1);return e.setAttribute("instanceDistanceStart",new THREE__namespace.InterleavedBufferAttribute(f,1,0)),e.setAttribute("instanceDistanceEnd",new THREE__namespace.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,o=e.camera,s=o.projectionMatrix,u=this.geometry,l=this.material,c=l.resolution,d=l.linewidth,f=u.attributes.instanceStart,m=u.attributes.instanceEnd,A=new THREE__namespace.Vector4,h=new THREE__namespace.Vector4,p=new THREE__namespace.Vector4,y=new THREE__namespace.Vector3,v=new THREE__namespace.Matrix4,g=new THREE__namespace.Line3,E=new THREE__namespace.Vector3;i.at(1,p),p.w=1,p.applyMatrix4(o.matrixWorldInverse),p.applyMatrix4(s),p.multiplyScalar(1/p.w),p.x*=c.x/2,p.y*=c.y/2,p.z=0,y.copy(p);var b=this.matrixWorld;v.multiplyMatrices(o.matrixWorldInverse,b);for(var T=0,_=f.count;T<_;T++){A.fromBufferAttribute(f,T),h.fromBufferAttribute(m,T),A.w=1,h.w=1,A.applyMatrix4(v),h.applyMatrix4(v),A.applyMatrix4(s),h.applyMatrix4(s),A.multiplyScalar(1/A.w),h.multiplyScalar(1/h.w);var x=A.z<-1&&h.z<-1,R=A.z>1&&h.z>1;if(!(x||R)){A.x*=c.x/2,A.y*=c.y/2,h.x*=c.x/2,h.y*=c.y/2,g.start.copy(A),g.start.z=0,g.end.copy(h),g.end.z=0;var w=g.closestPointToPointParameter(y,!0);g.at(w,E);var S=THREE__namespace.MathUtils.lerp(A.z,h.z,w),C=S>=-1&&S<=1,I=y.distanceTo(E)<d*.5;if(C&&I){g.start.fromBufferAttribute(f,T),g.end.fromBufferAttribute(m,T),g.start.applyMatrix4(b),g.end.applyMatrix4(b);var H=new THREE__namespace.Vector3,B=new THREE__namespace.Vector3;i.distanceSqToSegment(g.start,g.end,B,H),r.push({point:B,pointOnLine:H,distance:i.origin.distanceTo(B),object:this,faceIndex:T})}}}},t}(THREE__namespace.Mesh);Object.assign(LineSegments2.prototype,{isLineSegments2:!0});var Line2=function(n){__extends(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.type="Line2",i}return t}(LineSegments2);Object.assign(Line2.prototype,{isLine2:!0});var LineGeometry=function(n){__extends(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),o=0;o<r;o+=3)i[2*o]=e[o],i[2*o+1]=e[o+1],i[2*o+2]=e[o+2],i[2*o+3]=e[o+3],i[2*o+4]=e[o+4],i[2*o+5]=e[o+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),o=0;o<r;o+=3)i[2*o]=e[o],i[2*o+1]=e[o+1],i[2*o+2]=e[o+2],i[2*o+3]=e[o+3],i[2*o+4]=e[o+4],i[2*o+5]=e[o+5];return n.prototype.setColors.call(this,i),this},t.prototype.fromLine=function(e){var r=e.geometry;if(r instanceof THREE__namespace.Geometry){var i=new THREE__namespace.BufferGeometry().fromGeometry(r);this.setPositions(i.attributes.position.array)}else r instanceof THREE__namespace.BufferGeometry&&this.setPositions(r.attributes.position.array);return this},t.prototype.copy=function(){return this},t}(LineSegmentsGeometry);Object.assign(LineGeometry.prototype,{isLineGeometry:!0});var circleImageURL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUO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ChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==",DEFAULT_COLOR=14467195,POINT_SIZE=8,DEFAULT_LINEWIDTH=2,DEFAULT_DASHSCALE=20,sharedCircleTexture=null,FiveLine=function(n){__extends(t,n);function t(e,r){e===void 0&&(e=new THREE__namespace.Vector3),r===void 0&&(r=new THREE__namespace.Vector3);var i=n.call(this)||this;i.type="FiveLine",i.needsRender=!0;var o=new LineGeometry,s=new LineMaterial({color:DEFAULT_COLOR,linewidth:DEFAULT_LINEWIDTH,dashScale:DEFAULT_DASHSCALE,dashed:!1});i.line=new Line2(o,s);var u=new THREE__namespace.BufferGeometry,l=new THREE__namespace.PointsMaterial({color:DEFAULT_COLOR,size:POINT_SIZE,map:sharedCircleTexture||(sharedCircleTexture=new THREE__namespace.TextureLoader().load(circleImageURL)),sizeAttenuation:!1,transparent:!0});return i.points=new THREE__namespace.Points(u,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.8"},enumerable:!1,configurable:!0}),t.prototype.setPoints=function(e,r){var i=[].concat(e.toArray(),r.toArray());this.points.geometry.setAttribute("position",new THREE__namespace.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 THREE__namespace.Vector3(e[0],e[1],e[2]),new THREE__namespace.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 o=e[i];i==="dashed"?(r.dashed=o,o?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}(THREE__namespace.Object3D);Object.assign(FiveLine.prototype,{isFiveLine:!0});var Constants={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 fetchJsonFile(n){return __awaiter(this,void 0,void 0,function(){var t;return __generator(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 fetchProfilesList(n){return __awaiter(this,void 0,void 0,function(){var t,e;return __generator(this,function(r){switch(r.label){case 0:if(!n)throw new Error("No basePath supplied");return t="profilesList.json",[4,fetchJsonFile("".concat(n,"/").concat(t))];case 1:return e=r.sent(),[2,e]}})})}function fetchProfile(n,t){return __awaiter(this,arguments,void 0,function(e,r,i,o){var s,u,l,c,d,f;return i===void 0&&(i=null),o===void 0&&(o=!0),__generator(this,function(m){switch(m.label){case 0:if(!e)throw new Error("No xrInputSource supplied");if(!r)throw new Error("No basePath supplied");return[4,fetchProfilesList(r)];case 1:if(s=m.sent(),e.profiles.some(function(A){var h=s[A];return h&&(u={profileId:A,profilePath:"".concat(r,"/").concat(h.path),deprecated:!!h.deprecated}),!!u}),!u){if(!i)throw new Error("No matching profile name found");if(l=s[i],!l)throw new Error('No matching profile name found and default profile "'.concat(i,'" missing.'));u={profileId:i,profilePath:"".concat(r,"/").concat(l.path),deprecated:!!l.deprecated}}return[4,fetchJsonFile(u.profilePath)];case 2:if(c=m.sent(),o){if(f=void 0,f=c.layouts[e.handedness],!f)throw new Error("No matching handedness, ".concat(e.handedness,", in profile ").concat(u.profileId));f.assetPath&&(d=u.profilePath.replace("profile.json",f.assetPath))}return[2,{profile:c,assetPath:d}]}})})}var defaultComponentValues={xAxis:0,yAxis:0,button:0,state:Constants.ComponentState.DEFAULT};function normalizeAxes(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 o=Math.atan2(t,n);e=Math.cos(o),r=Math.sin(o)}var s={normalizedXAxis:e*.5+.5,normalizedYAxis:r*.5+.5};return s}var VisualResponse=function(){function n(t){this.componentProperty=t.componentProperty,this.states=t.states,this.valueNodeName=t.valueNodeName,this.valueNodeProperty=t.valueNodeProperty,this.valueNodeProperty===Constants.VisualResponseProperty.TRANSFORM&&(this.minNodeName=t.minNodeName,this.maxNodeName=t.maxNodeName),this.value=0,this.updateFromComponent(defaultComponentValues)}return n.prototype.updateFromComponent=function(t){var e=t.xAxis,r=t.yAxis,i=t.button,o=t.state,s=normalizeAxes(e,r),u=s.normalizedXAxis,l=s.normalizedYAxis;switch(this.componentProperty){case Constants.ComponentProperty.X_AXIS:this.value=this.states.includes(o)?u:.5;break;case Constants.ComponentProperty.Y_AXIS:this.value=this.states.includes(o)?l:.5;break;case Constants.ComponentProperty.BUTTON:this.value=this.states.includes(o)?i:0;break;case Constants.ComponentProperty.STATE:this.valueNodeProperty===Constants.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(o):this.value=this.states.includes(o)?1:0;break;default:throw new Error("Unexpected visualResponse componentProperty ".concat(this.componentProperty))}},n}(),Component=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 o=new VisualResponse(e.visualResponses[i]);r.visualResponses[i]=o}),this.gamepadIndices=Object.assign({},e.gamepadIndices),this.values={state:Constants.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=__assign({id:this.id},this.values);return t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(t){var e=this;if(this.values.state=Constants.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=Constants.ComponentState.PRESSED:(r.touched||this.values.button>Constants.ButtonTouchThreshold)&&(this.values.state=Constants.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===Constants.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>Constants.AxisTouchThreshold&&(this.values.state=Constants.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===Constants.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>Constants.AxisTouchThreshold&&(this.values.state=Constants.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(function(i){i.updateFromComponent(e.values)})},n}(),MotionController=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(o){var s=i.layoutDescription.components[o];i.components[o]=new Component(o,s)}),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}(),DEFAULT_PROFILES_PATH="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",DEFAULT_PROFILE="generic-trigger",XRControllerModel=function(n){__extends(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 THREE__namespace.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 o=i.valueNode,s=i.minNode,u=i.maxNode,l=i.value,c=i.valueNodeProperty;o&&(c===Constants.VisualResponseProperty.VISIBILITY?o.visible=l:c===Constants.VisualResponseProperty.TRANSFORM&&(o.quaternion.copy(s.quaternion).slerp(u.quaternion,l),o.position.lerpVectors(s.position,u.position,l)))})}))},t}(THREE.Object3D);function findNodes(n,t){Object.values(n.components).forEach(function(e){var r=e.type,i=e.touchPointNodeName,o=e.visualResponses;if(r===Constants.ComponentType.TOUCHPAD)if(e.touchPointNode=t.getObjectByName(i),e.touchPointNode){var s=new THREE.SphereGeometry(.001),u=new THREE.MeshBasicMaterial({color:255}),l=new THREE.Mesh(s,u);e.touchPointNode.add(l)}else console.warn("Could not find touch dot, ".concat(e.touchPointNodeName,", in touchpad component ").concat(e.id));Object.values(o).forEach(function(c){var d=c.valueNodeName,f=c.minNodeName,m=c.maxNodeName,A=c.valueNodeProperty;if(A===Constants.VisualResponseProperty.TRANSFORM){if(c.minNode=t.getObjectByName(f),c.maxNode=t.getObjectByName(m),!c.minNode){console.warn("Could not find ".concat(f," in the model"));return}if(!c.maxNode){console.warn("Could not find ".concat(m," in the model"));return}}c.valueNode=t.getObjectByName(d),c.valueNode||console.warn("Could not find ".concat(d," in the model"))})})}function addAssetSceneToControllerModel(n,t){findNodes(n.motionController,t),n.envMap&&t.traverse(function(e){e instanceof THREE__namespace.Mesh&&e.isMesh&&(e.material.envMap=n.envMap,e.material.needsUpdate=!0)}),n.add(t)}var XRControllerModelFactory=function(){function n(t){t===void 0&&(t=null),this.gltfLoader=t,this.path=DEFAULT_PROFILES_PATH,this._assetCache={}}return n.prototype.createControllerModel=function(t){var e=this,r=new XRControllerModel,i=null;return t.addEventListener("connected",function(o){var s=o.data;s.targetRayMode!=="tracked-pointer"||!s.gamepad||fetchProfile(s,e.path,DEFAULT_PROFILE).then(function(u){var l=u.profile,c=u.assetPath;r.motionController=new MotionController(s,l,c);var d=e._assetCache[r.motionController.assetUrl];if(d)i=d.scene.clone(),addAssetSceneToControllerModel(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(),addAssetSceneToControllerModel(r,i)})}}).catch(function(u){console.warn(u)})}),t.addEventListener("disconnected",function(){r.motionController=null,r.remove(i),i=null}),r},n}();function mapPanoResource(n,t){return n}var CONTROLLER_EVNET_DELTA_TIME=300,ROTATE_Y_PI_MATRIX=new THREE__namespace.Matrix4().makeRotationAxis(new THREE__namespace.Vector3(0,1,0),Math.PI),PANO_TEXTURE_SCALE=new THREE__namespace.Vector3(-1,1,1),XRPanoramaController=function(n){__extends(t,n);function t(e){var r=n.call(this,e)||this;r.xrManager=new XRManager(r.renderer,r.renderer.getContext(),{onSessionStart:function(l){r.emit("xr.session.start",createEvent("xr.session.start",{session:l,machineType:r.xrManager.machineType}))},onSessionEnd:function(){r.emit("xr.session.end",createEvent("xr.session.end",{session:null,machineType:r.xrManager.machineType}))}}),r.xrControllerRay={left:new THREE__namespace.Raycaster,right:new THREE__namespace.Raycaster},r.xrControllerRay.left.params.Points={threshold:.1},r.xrControllerRay.right.params.Points={threshold:.1},r.gazeRay=null,r.pointerLines={left:new FiveLine,right:new FiveLine},r.pointerLines.left.visible=!1,r.pointerLines.right.visible=!0,r.pointerLines.left.setMaterial({color:new THREE__namespace.Vector3(1,1,1)}),r.pointerLines.left.points.material.depthTest=!1,r.pointerLines.right.setMaterial({color:new THREE__namespace.Vector3(1,1,1)}),r.pointerLines.right.points.material.depthTest=!1,r.controllerWrappers=[new THREE__namespace.Group,new THREE__namespace.Group];var i=r.xrManager.getController(0);r.controllerWrappers[0].add(i);var o=r.xrManager.getController(1);r.controllerWrappers[1].add(o);var s=new XRControllerModelFactory;s.gltfLoader={load:function(l,c){internalFetcher.ajax(l,{responseType:"arraybuffer"}).then(function(d){var f;return parseGltf(d.body,{resourcePath:l.slice(0,l.lastIndexOf("/")+1),search:(f=l.split("?")[1])!==null&&f!==void 0?f:"",fetcher:internalFetcher})}).then(function(d){return c(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=createUuid()]={panoId:panoStringify(r.currentPano),leftPanoPicture:null,position:r.camera.pose.offset.clone(),effect:"fade",fixCameraTransform:new THREE__namespace.Matrix4},r.parallaxCameraMatrixs=[];var u=AnimationFrameLoop.shared.getContext();return u?(r.on("xr.session.end",function(){r.scene.remove(r.pointerLines.left,r.pointerLines.right)}),r.xrManager.setSession(u),r.on("xr.session.start",function(){var l=r.xrManager.getControllerGrip(0);l.add(s.createControllerModel(l)),r.controllerWrappers[0].add(l);var c=r.xrManager.getControllerGrip(1);c.add(s.createControllerModel(c)),r.controllerWrappers[1].add(c)}),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=__assign(__assign({},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 __assign(__assign({},i),{mode:"XRPanorama"})},t.prototype.moveToPano=function(e,r,i){var o=this,s,u,l,c,d=(s=r.effect)!==null&&s!==void 0?s:"fade";this.userAction=i,this.stopMomentumMovement();var f=this.works.getResolvedObserver(e);if(!f)throw new Error("Invalid PanoIndex");var m=getImageSizeFromURL(f.images.up),A=this.imageOptions.size;typeof A=="undefined"&&f&&m&&(A=Number(m)),typeof A=="undefined"&&(A=2048);var h=this.imageOptions.transform,p=function(C,I){return mapPanoResource(applyImageURLOptions(C,h,I))},y=__assign({key:"pano.".concat(f.panoId)},pick(this.imageOptions,["format","size","quality"])),v=f.images,g=(l=(u=f.images.tiles)===null||u===void 0?void 0:u.filter(function(C){return C.size>A}))!==null&&l!==void 0?l:null,E="pano:"+jsonHash([v,y,h]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===E)return;var b=this.pendingTextureTask.panoId;(c=this.panoMeshes[b])===null||c===void 0||c.setProgress(0),this.emit("pano.texture.abort",createEvent("pano.texture.abort",{error:null,progress:0,meta:null,pano:f.pano}))}var T=this.models.getMaterial()||{},_=T.pano0,x=T.pano1,R;if((_==null?void 0:_.map.name)===E?R=_:(x==null?void 0:x.map.name)===E&&(R=x),R){var w={panoId:f.panoId,effect:d,leftPanoPicture:{zoom:1,map:R.map,luminanceMap:R.luminanceMap,matrix:new THREE__namespace.Matrix4().compose(f.position,f.quaternion,PANO_TEXTURE_SCALE)},position:f.position.clone(),fixCameraTransform:new THREE__namespace.Matrix4};this.doMoveToPano(f.pano,w,r);return}var S="move-to-pano-"+f.panoId;this.pending.add(S),this.pendingTextureTask={panoId:f.panoId,hash:E,onLoad:function(C){if(o.pending.delete(S),o.destroyed)C.body.dispose();else{C.body.name=E;var I={panoId:f.panoId,effect:d,leftPanoPicture:{zoom:1,map:C.body,luminanceMap:null,matrix:new THREE__namespace.Matrix4().compose(f.position,f.quaternion,PANO_TEXTURE_SCALE)},position:f.position.clone(),fixCameraTransform:new THREE__namespace.Matrix4};o.doMoveToPano(f.pano,I,r)}},onError:function(C){o.pending.delete(S);var I=__assign(__assign(__assign({},f.pano),{mode:o.mode}),clonePose(o.camera.pose));o.emit("pano.error",createEvent("pano.error",{error:C,userAction:o.userAction,options:r,prevPano:o.currentPano,progress:0,state:I})),o.emit("pano.cancel",createEvent("pano.cancel",{error:null,userAction:o.userAction,options:r,prevPano:o.currentPano,progress:0,state:I})),r.moveCancelCallback&&r.moveCancelCallback()}},Promise.all([this.tileLevelForFov&&g&&g.length?this.textureLoader.loadTiledCubeTexture(v,g,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:p,options:y},format:THREE__namespace.RGBAFormat,minFilter:THREE__namespace.LinearFilter,magFilter:THREE__namespace.LinearFilter,generateMipmaps:!1,viaAjax:!0,fetcher:getFetcher(f.work)},void 0,void 0,function(C){var I,H;o.emit("pano.texture.progress",createEvent("pano.texture.progress",{error:null,progress:C,meta:null,pano:f.pano})),((I=o.pendingTextureTask)===null||I===void 0?void 0:I.hash)===E&&((H=o.panoMeshes[f.panoId])===null||H===void 0||H.setProgress(C))},this.renderer):this.textureLoader.loadCubeTexture(v,{imageURL:{transform:p,options:y},format:THREE__namespace.RGBAFormat,fetcher:getFetcher(f.work)},void 0,void 0,function(C){var I,H;((I=o.pendingTextureTask)===null||I===void 0?void 0:I.hash)===E&&((H=o.panoMeshes[f.panoId])===null||H===void 0||H.setProgress(C)),o.emit("pano.texture.progress",createEvent("pano.texture.progress",{error:null,progress:C,meta:null,pano:f.pano}))},this.renderer)]).then(function(C){var I,H,B=C[0];((I=o.pendingTextureTask)===null||I===void 0?void 0:I.hash)===E?(o.pendingTextureTask.onLoad(B),(H=o.panoMeshes[f.panoId])===null||H===void 0||H.setProgress(0),delete o.pendingTextureTask,o.emit("pano.texture.success",createEvent("pano.texture.success",{error:null,progress:1,meta:B.meta,pano:f.pano}))):B.body.dispose()}).catch(function(C){var I,H;((I=o.pendingTextureTask)===null||I===void 0?void 0:I.hash)===E&&(o.pendingTextureTask.onError(C),(H=o.panoMeshes[f.panoId])===null||H===void 0||H.setProgress(0),delete o.pendingTextureTask,o.emit("pano.texture.error",createEvent("pano.texture.error",{error:C,progress:0,meta:null,pano:f.pano})),o.emit("error",C))}),this.emit("pano.texture.load",createEvent("pano.texture.load",{error:null,progress:0,meta:null,pano:f.pano}))},t.prototype.doMoveToPano=function(e,r,i){var o=this,s,u,l,c,d,f,m,A,h,p;i===void 0&&(i={});var y=now(),v=createUuid();this.panoResources[v]=r;var g=1,E,b,T;if(this.locationMotion.ended){var _=this.locationMotion.getKeyFrameSegment(y);_[0];var x=_[1],R=this.locationMotion.value,w=this.panoResourceFromLocationMotionKeyframe(x).position,S=r.position;E=Math.max(w.distanceTo(S),g),b=[{key:x.key,progress:0,value:__assign(__assign({},R),{count:0})},{key:v,progress:1,value:{distance:0,count:1}}],T=0}else{var C=this.locationMotion.getKeyFrameSegment(y),I=C[0],x=C[1],R=this.locationMotion.value,H=this.panoResourceFromLocationMotionKeyframe(I).position,w=this.panoResourceFromLocationMotionKeyframe(x).position,S=r.position,B=x.value.count-R.count,L=Math.max(H.distanceTo(w),g)*B,O=Math.max(w.distanceTo(S),g);E=L+O,b=[{key:I.key,progress:0,value:__assign({},R)},{key:x.key,progress:L/E,value:x.value},{key:v,progress:1,value:{count:x.value.count+1,distance:0}}];var k=this.locationMotionKeyframesLength(this.locationMotion.keyframes),K=this.locationMotionKeyframesLength(b);T=this.locationMotion.getProgressVelocity(y)*k/K}var z=r.effect==="instant"?0:this.calculateMovingDuration(i.duration,r.effect==="fly"?E:0),N={longitude:i.longitude,latitude:i.latitude,fov:i.fov},U=__assign(__assign({},e),{mode:this.mode,longitude:(s=N.longitude)!==null&&s!==void 0?s:this.camera.pose.longitude,latitude:(u=N.latitude)!==null&&u!==void 0?u:this.camera.pose.latitude,fov:(l=N.fov)!==null&&l!==void 0?l:this.camera.pose.fov,offset:r.position.clone(),distance:0}),Q=this.currentPano;if(this.emit("pano.moveTo",createEvent("pano.moveTo",{options:i,prevPano:Q,progress:0,state:U,userAction:this.userAction,error:null})),i.moveStartCallback&&i.moveStartCallback(U),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=noop$1,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),r.effect==="fly")this.cameraMotion.set(N,z).catch(noop$1);else{var G=coordinatesToVector({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),q=coordinatesToVector({longitude:(c=N.longitude)!==null&&c!==void 0?c:this.cameraMotion.value.longitude,latitude:(d=N.latitude)!==null&&d!==void 0?d:this.cameraMotion.value.latitude}),j=new THREE__namespace.Object3D;j.lookAt(G);var X=new THREE__namespace.Matrix4().makeRotationFromQuaternion(j.quaternion);j.lookAt(q);var ae=new THREE__namespace.Matrix4().makeRotationFromQuaternion(j.quaternion),W=new THREE__namespace.Matrix4().getInverse(X).premultiply(ae),te=this.cameraMotion.value.fov,ee=(f=N.fov)!==null&&f!==void 0?f:this.cameraMotion.value.fov,ie=1;r.effect==="zoomin"?ie=1.5:r.effect==="zoomout"&&(ie=.4);for(var $=ee*ie,se=0;se<b.length-1;se++){var re=b[se].key;if(re){var oe=this.panoResources[re];oe&&(oe.fixCameraTransform.copy(W),oe.leftPanoPicture&&(oe.leftPanoPicture.zoom=Math.tan(te/2/180*Math.PI)/Math.tan($/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=N.longitude)!==null&&m!==void 0?m:this.cameraMotion.value.longitude,latitude:(A=N.latitude)!==null&&A!==void 0?A:this.cameraMotion.value.latitude,fov:$}},{progress:1,value:{longitude:(h=N.longitude)!==null&&h!==void 0?h:this.cameraMotion.value.longitude,latitude:(p=N.latitude)!==null&&p!==void 0?p:this.cameraMotion.value.latitude,fov:ee}}],z).catch(noop$1)}var pe=this.locationMotion.setKeyframes(b,z,T);pe.then(function(){for(var he,Ae,Z,Y=0,V=o.models;Y<V.length;Y++){var Ee=V[Y];Ee.show()}var ge=__assign(__assign({},e),{mode:o.mode,longitude:o.camera.pose.longitude,latitude:o.camera.pose.latitude,fov:o.camera.pose.fov,offset:o.camera.pose.offset.clone(),distance:0});o.emit("pano.arrived",createEvent("pano.arrived",{options:i,prevPano:Q,progress:1,state:ge,userAction:o.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(ge);var me=o.works.getResolvedObserver(o.currentPano);if(me&&me.video&&o.videoTexture&&o.videoTexture.image instanceof HTMLVideoElement){var Re=ROTATE_Y_PI_MATRIX.clone().multiply((Z=(Ae=(he=o.models.getMaterial())===null||he===void 0?void 0:he.pano1)===null||Ae===void 0?void 0:Ae.matrix)!==null&&Z!==void 0?Z:new THREE__namespace.Matrix4).multiply(me.video.matrix),fe={map:o.videoTexture,size:me.video.size,matrix:Re,alpha:1},de=createUuid(),ce=o.videoTexture.image;ce.setAttribute("uuid",de),canplayVideo().then(function(le){le&&me.video&&ce.getAttribute("uuid")===de&&(ce.oncanplay=function(){ce.oncanplay=noop$1,ce.play()},ce.ontimeupdate=function(){ce.currentTime>.5&&(ce.ontimeupdate=noop$1,o.panoVideo.setMaterial(fe))},ce.src=me.video.source)}).catch(function(){ce.removeAttribute("uuid")})}},function(){o.emit("pano.cancel",createEvent("pano.cancel",{options:i,prevPano:Q,progress:0,state:U,userAction:o.userAction,error:null})),i.moveCancelCallback&&i.moveCancelCallback()})},t.prototype.checkSelectedPano=function(e){var r=this,i,o,s,u;this.stopMomentumMovement();var l=this.camera.getDirection(new THREE__namespace.Vector3).setY(0),c=null,d=this.works.getResolvedObserver(this.currentPano);if(!d)return null;var f=d.accessibleIds.filter(function(q){var j=panoParse(q);if(panoEqual(j,r.currentPano))return!1;var X=r.works.getResolvedObserver(j);return!X||X.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:X.loadable||X.active}),m=this.models.intersectRaycaster(e)[0];if(m){var A=arrayMin(f,function(q){var j=r.works.getResolvedObserver(q);if(!j)return 1/0;var X=j.standingPosition.clone();return X.distanceTo(m.point)},!0),h=A[0],p=A[1];h&&p<this.panoTapTriggerRadius&&(c=(i=this.works.getResolvedObserver(h))!==null&&i!==void 0?i:null)}if(isNil(c)){var y=this.getForwardObserverOrNot(e);y&&(c=y)}for(var v=0,g=this.locationMotion.keyframes;v<g.length;v++){var E=g[v],b=this.panoResourceFromLocationMotionKeyframe(E);if(!(E.progress<this.locationMotion.progress)&&c&&b.panoId===c.panoId){c=null;break}}if(isNil(c))return this.locationMotion.ended===!0&&this.cameraBounce(),null;if(c&&!c.active){var T=c.panoId;this.panoMeshes[T]&&(this.panoMeshes[T].setDisabled(!1),this.panoMeshes[T].setLoading(!0))}var _={};if(c){for(var x=Math.PI/6,R=Math.PI/12,w=new THREE__namespace.Vector3(0,1,0),S=c.position.clone().setY(0).sub(d.position.clone().setY(0)).normalize(),C=S.clone().applyAxisAngle(w,x),I=S.clone().applyAxisAngle(w,-x),H=[],B=[],L=[],O=0,k=c.accessibleIds;O<k.length;O++){var h=k[O],K=panoParse(h);if(!(panoEqual(K,this.currentPano)||panoEqual(K,c.pano))){var z=this.works.getResolvedObserver(h);if(z){var N=z.position.clone().sub(c.position).setY(0);S.angleTo(N)<x?L.push(N):C.angleTo(N)<x?H.push(N):I.angleTo(N)<x&&B.push(N)}}}var U=L.length>0?L:__spreadArray(__spreadArray([],H,!0),B,!0),Q=U.slice().sort(function(q,j){return q.angleTo(S)-j.angleTo(S)})[0];Q&&Q.angleTo(l)>R&&(_.longitude=Math.atan2(-Q.x,-Q.z))}this.cameraMotion.value.latitude<-Math.PI/4&&(_.latitude=clamp$1(0,this.minLatitude,this.maxLatitude)),this.cameraMotion.value.fov<60&&(_.fov=this.defaultFov);var G={workCode:c.pano.workCode,panoIndex:c.pano.panoIndex,mode:this.mode,longitude:(o=_.longitude)!==null&&o!==void 0?o:this.camera.pose.longitude,latitude:(s=_.latitude)!==null&&s!==void 0?s:this.camera.pose.latitude,fov:(u=_.fov)!==null&&u!==void 0?u:this.camera.pose.fov,distance:0,offset:c?c.position.clone():new THREE__namespace.Vector3};return this.emit("pano.select",createEvent("pano.select",{prevPano:this.currentPano,state:G,userAction:!0,options:_,progress:0,error:null})),c&&c.active?(this.emit("pano.request",createEvent("pano.request",{userAction:!0,prevPano:this.currentPano,progress:0,state:G,options:_,error:null})),c.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,o,s,u,l,c,d,f,m,A=[],h=2;h<arguments.length;h++)A[h-2]=arguments[h];this.userAction=!0;var p={},y={},v=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),g=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),E=!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),p.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(clamp$1(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var b=this.locationMotion.getKeyFrameSegment(e),T=b[0],_=b[1],x=this.panoResourceFromLocationMotionKeyframe(T),R=this.panoResourceFromLocationMotionKeyframe(_),w=new THREE__namespace.Vector3().copy(x.position),S=new THREE__namespace.Vector3().copy(R.position),C=this.locationMotion.value.count-_.value.count+1;p.progress=C,R.leftPanoPicture&&(C<1?x.leftPanoPicture&&(p.pano0=x.leftPanoPicture):p.pano0=R.leftPanoPicture,p.pano1=R.leftPanoPicture),R.effect==="montage"?p.transition="BLACK":R.effect==="spread"?p.transition="SPREAD":p.transition="FADE",(R.effect==="zoomin"||R.effect==="zoomout")&&(p.progress=Math.pow(C,3)),C<1&&R.effect!=="fly"&&(p.pano0&&x.leftPanoPicture&&(p.pano0={map:p.pano0.map,zoom:p.pano0.zoom,luminanceMap:p.pano0.luminanceMap,matrix:x.leftPanoPicture.matrix.clone().setPosition(R.position)}),w.copy(S),E=!0),y.distance=this.locationMotion.value.distance,y.offset=new THREE__namespace.Vector3(w.x+(S.x-w.x)*C,w.y+(S.y-w.y)*C,w.z+(S.z-w.z)*C);for(var I=[],H=[],B=0,L=this.locationMotion.keyframes;B<L.length;B++){var O=L[B],k=O.key,K=O.progress;k!==void 0&&(I.push(k),K>this.locationMotion.progress&&H.push(k))}for(var z=0,N=Object.keys(this.panoResources);z<N.length;z++){var U=N[z];if(!(H.indexOf(U)>=0)){var Q=this.panoResources[U];if(Q.leftPanoPicture){var G=Q.leftPanoPicture.map;if(G){if(G===((o=p.pano0)===null||o===void 0?void 0:o.map)||G===((s=p.pano1)===null||s===void 0?void 0:s.map))continue;G instanceof TileCubeTextureTarget&&G.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(G.cubeRenderTarget),G.dispose(),Q.leftPanoPicture=null}}I.indexOf(U)>=0||delete this.panoResources[U]}}this.currentPano=panoParse(R.panoId),this.emit("pano.moving",createEvent("pano.moving",{userAction:this.userAction,prevPano:panoParse(v.panoId),state:__assign(__assign(__assign(__assign({},panoParse(g.panoId)),{mode:this.mode}),clonePose(this.camera.pose)),y),options:{},progress:this.locationMotion.progress,error:null}))}isEmptyObject(p)===!1&&(!((u=p.pano0)===null||u===void 0)&&u.map&&p.pano0.map instanceof TileCubeTextureTarget&&!p.pano0.map.cubeRenderTarget&&(p.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((l=p.pano1)===null||l===void 0)&&l.map&&p.pano1.map instanceof TileCubeTextureTarget&&!p.pano1.map.cubeRenderTarget&&(p.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),this.models.setMaterial(p)),isEmptyObject(y)===!1&&this.setCamera(y);var q=this.works.getResolvedObserver(this.currentPano),j=A[1];if(!j){console.error("xrFrame丢失,请重试");return}if(!this.xrManager.session){console.error("session丢失,请重试");return}var X=this.xrManager.referenceSpace;if(X){var ae=this.xrManager.cameraVR,W=this.xrManager.cameraL,te=this.xrManager.cameraR,ee=[W,te],ie=j.getViewerPose(X),$=new THREE__namespace.Vector3(0,0,0);if(ie){var se;se=this.xrManager.session.renderState.baseLayer;var re=ie.views;if(!se){console.error("no layer found");return}this.renderer.setFramebuffer(se.framebuffer);var oe=!1;re.length!==ae.cameras.length&&(ae.cameras.length=0,oe=!0),this.parallaxCameraMatrixs=[];var pe=new THREE__namespace.Vector3,he=new THREE__namespace.Vector3;new THREE__namespace.Matrix4().fromArray(re[0].transform.matrix).decompose(pe,new THREE__namespace.Quaternion,new THREE__namespace.Vector3),new THREE__namespace.Matrix4().fromArray(re[1].transform.matrix).decompose(he,new THREE__namespace.Quaternion,new THREE__namespace.Vector3),he.clone().sub(pe).normalize();var Ae=new THREE__namespace.Vector3,Z=new THREE__namespace.Quaternion,Y=new THREE__namespace.Vector3;this.camera.matrix.decompose(Ae,Z,Y);for(var V=0;V<re.length;V++){var Ee=re[V],ge=se.getViewport(Ee),me=ee[V];me.matrix.fromArray(Ee.transform.matrix);var Re=new THREE__namespace.Vector3,fe=new THREE__namespace.Quaternion,de=new THREE__namespace.Vector3;me.matrix.decompose(Re,fe,de),$.copy(Ae),me.position.copy(Ae),me.quaternion.copy(fe),me.scale.copy(de),me.updateMatrix(),me.projectionMatrix.fromArray(Ee.projectionMatrix),me.viewport.set(ge.x,ge.y,ge.width,ge.height),oe===!0&&ae.cameras.push(me)}if(this.xrManager.session&&this.xrManager.session.inputSources){for(var V=0;V<this.xrManager.session.inputSources.length;V++)if(this.xrManager.session.inputSources[V]&&this.xrManager.session.inputSources[V].targetRayMode==="transient-pointer"){var ce=j.getPose(this.xrManager.session.inputSources[V].targetRaySpace,X);if(ce){var le=new THREE__namespace.Vector3(0,0,-1).applyQuaternion(ce.transform.orientation),ue=new THREE__namespace.Raycaster(this.camera.position,le);this.gazeRay=ue}}}if(this.xrManager.machineType==="Oculus"||this.xrManager.machineType==="Pico"){for(var Te=this.xrManager.session.inputSources,V=0;V<Te.length;V++){var xe=this.xrManager.controllers[V],Ie=Te[V];if(Ie){xe&&xe.update(Ie,j,X);var ue=this.xrManager.getController(V),lt=new THREE__namespace.Vector3(0,1.2,0),ye=ue.position.clone().add($).sub(lt);Ie.handedness==="left"?this.xrControllerRay.left.set(ye,new THREE__namespace.Vector3(0,0,-1).applyEuler(ue.rotation)):Ie.handedness==="right"&&this.xrControllerRay.right.set(ye,new THREE__namespace.Vector3(0,0,-1).applyEuler(ue.rotation)),this.controllerWrappers[V].position.copy(new THREE__namespace.Vector3(0,0,0).add($).sub(lt));var we=this.models.intersectRaycaster(this.xrControllerRay.right);if(we.length===0&&(we=this.xrControllerRay.right.intersectObject(this.boundingMesh,!0).map(function(st){var ft;return __assign({floor:(ft=q==null?void 0:q.floorIndex)!==null&&ft!==void 0?ft:0},st)})),we.length>=1&&we[0].face)if(Ie.handedness==="right"){var Be=this.xrControllerRay.right.intersectObject(this.xrCustomObjectsScene,!0),Je=we[0].face.normal,ht=Je.clone(),je=we[0].point.clone();this.intersectMesh.position.copy(je);var Ve=je.clone().add(ht);if(this.intersectMesh.lookAt(Ve),Math.abs(Je.y)>.99){var Xe=this.camera.position.clone().sub(je);this.intersectMesh.rotation.z=-Math.atan2(Xe.z,Xe.x)}this.intersectMesh.visible=!0,this.needsRender=!0,Be.length>0?(this.pointerLines.right.setPoints(ye,Be[0].point),this.pointerLines.right.points.visible=!0,this.intersectMesh.visible=!1):(this.pointerLines.right.points.visible=!1,this.pointerLines.right.setPoints(ye,we[0].point));var at=we[0],Ue=createEvent("intersect.update",{raycaster:(c=this.xrControllerRay.right)!==null&&c!==void 0?c:null,intersection:at!=null?at:null,object:this.intersectMesh});if(this.emit("intersect.update",Ue),Ue.defaultPrevented){this.hideIntersectMesh();return}}else this.pointerLines.left.setPoints(ye,we[0].point)}}this.updateControllerHelper(Te,e,r)}if(this.camera.pose.distance>.1||E)for(var We=0,ze=Object.keys(this.panoMeshes);We<ze.length;We++){var He=ze[We],be=this.panoMeshes[He];be.setOpacity(0),be.setCurrent(!1),be.updateTime&&be.updateTime(e,r),be.visible=!1}else if(q){var $e=arrayMin(q.visibleIds,function(Le){var qe=i.works.getResolvedObserver(Le);return qe?q.standingPosition.distanceTo(qe.standingPosition):1/0},!0),Fe=$e[1];Fe=clamp$1(Fe,2.5,1/0);for(var et=q.visibleIds.concat(panoStringify(this.currentPano)),tt=this.getForwardObserverOrNot(),Qe=this.camera.getDirection(new THREE__namespace.Vector3),Ne=0,rt=Object.keys(this.panoMeshes);Ne<rt.length;Ne++){var He=rt[Ne],be=this.panoMeshes[He],ot=this.works.getResolvedObserver(He);if(et.indexOf(He)===-1)be.setCurrent(!1),be.setOpacity(0);else if(!ot)be.setCurrent(!1),be.setOpacity(0);else if(!ot.loadable&&!ot.active)be.setCurrent(!1),be.setOpacity(0);else{var pt=be.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);be.setCurrent(!be.loading&&be.progress===0&&tt!==null&&tt.panoId===He),be.setOpacity(pt<.01?0:clamp$1(Fe/pt*1.2,.65,.98));var ct=this.camera.position.clone().setY(be.position.y),le=new THREE__namespace.Vector3().copy(be.position).sub(ct).normalize();if(He===panoStringify(this.currentPano)){var dt=clamp$1((.5-ct.distanceTo(be.position))/.5,0,1);le.multiplyScalar(1-dt).add(Qe.clone().multiplyScalar(dt))}le.length()>0&&be.quaternion.setFromEuler(new THREE__namespace.Euler(0,Math.atan2(le.x,le.z),0))}be.updateTime&&be.updateTime(e,r)}}var Ge=function(){return 4}(),Me=function(){var Le=new THREE__namespace.PerspectiveCamera;Le.applyMatrix4(ae.matrix),Le.position.set(0,0,0);var qe=i.works.getResolvedObserver(g.panoId),st=qe!=null?qe:q;st&&Le.quaternion.premultiply(st.quaternion.clone().inverse()),Le.updateProjectionMatrix(),Le.updateMatrixWorld(!0);var ft=new THREE__namespace.Frustum().setFromProjectionMatrix(new THREE__namespace.Matrix4().multiplyMatrices(Le.projectionMatrix,Le.matrixWorldInverse));return ft}();g.panoId===panoStringify(this.currentPano)&&((d=g.leftPanoPicture)===null||d===void 0?void 0:d.map)instanceof TileCubeTextureTarget&&(g.leftPanoPicture.map.maxRequest=this.tileMaxRequest,g.leftPanoPicture.map.update(Me,Ge),g.leftPanoPicture.map.needsRender===!0&&(this.needsRender=!0,this.modelSceneNeedsRender=!0));{var _e=this.tiling.object.visible;if(this.initAnimationed){var Pe=g.panoId,ke=this.works.getResolvedObserver(Pe);ke?isSimilarVector3(this.camera.position,ke.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==Pe&&this.tiling.cleanup(),this.tiling.panoId=Pe,this.tiling.setResource((m=(f=ke.images)===null||f===void 0?void 0:f.tiles)!==null&&m!==void 0?m:[],this.enableIOSEDR&&ke.images.luminance?ke.images.luminance:null),this.tiling.setFetcher(getFetcher(ke.work)),this.tiling.setRotation(ke.quaternion),this.tiling.setPosition(ke.position),this.tiling.maxRequest=this.tileMaxRequest,Ge>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update(Me,Ge,e):this.tiling.update(Me,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;_e!==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 o=this.xrControllerRay.left,s=this.xrControllerRay.right;if(!(!e||e.length===0)){for(var u={buttons:{X:!1,Y:!1,LeftTrigger:!1,LeftPinch:!1,A:!1,B:!1,RightTrigger:!1,RightPinch:!1}},l=0;l<e.length;l++){var c=e[l].handedness,d=e[l].gamepad;switch(c){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: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};u.buttons.X=d.buttons&&d.buttons[4]?d.buttons[4].pressed:!1,u.buttons.Y=d.buttons&&d.buttons[5]?d==null?void 0:d.buttons[5].pressed:!1,u.buttons.LeftTrigger=d.buttons&&d.buttons[0]?d==null?void 0:d.buttons[0].pressed:!1,u.buttons.LeftPinch=d.buttons&&d.buttons[1]?d==null?void 0:d.buttons[1].pressed:!1,u.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 m={raycaster:s,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};u.right=m,u.buttons.A=d.buttons&&d.buttons[4]?d==null?void 0:d.buttons[4].pressed:!1,u.buttons.B=d.buttons&&d.buttons[5]?d==null?void 0:d.buttons[5].pressed:!1,u.buttons.RightTrigger=d.buttons&&d.buttons[0]?d==null?void 0:d.buttons[0].pressed:!1,u.buttons.RightPinch=d.buttons&&d.buttons[1]?d==null?void 0:d.buttons[1].pressed:!1;break}}this.emit("xr.controller.update",createEvent("xr.controller.update",u))}},t.prototype.emitHandleEvent=function(e,r,i){var o=this.xrControllerRay.left,s=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",createEvent("xr.gesture.buttonDown",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!1,isFirst:!0,controllers:{raycaster:{leftRay:o,rightRay:s}}}));else{var u=i-this.xrHandleState[r].touchStartTime;u>CONTROLLER_EVNET_DELTA_TIME&&this.emit("xr.gesture.press",createEvent("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!0,controllers:{raycaster:{leftRay:o,rightRay:s}}}))}else if(this.xrHandleState[r].touchStart===!0){this.emit("xr.gesture.buttonUp",createEvent("xr.gesture.buttonUp",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:o,rightRay:s}}}));var u=i-this.xrHandleState[r].touchStartTime;if(u<=CONTROLLER_EVNET_DELTA_TIME){var l=createEvent("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:o,rightRay:s}}}),c=this.emit("xr.gesture.tap",l);!c&&!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}(PanoramaController),Controllers={Floorplan:FloorplanController,Topview:TopviewController,Panorama:PanoramaController,VRPanorama:VRPanoramaController,Model:ModelController,Mapview:MapviewController,XRPanorama:XRPanoramaController},PROXY_CONTROLLER_EVENT_NAMES=["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 initLegacyEvent(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=coordinatesToVector(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 generateDefaultVideoElement(){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 initLights(n){{var t=new THREE__namespace.DirectionalLight(16777215,.3);t.position.copy(new THREE__namespace.Vector3(1,1,1)),n.add(t)}{var t=new THREE__namespace.DirectionalLight(16777215,.1);t.position.copy(new THREE__namespace.Vector3(-1,-1,-1)),n.add(t)}{var t=new THREE__namespace.DirectionalLight(16777215,.1);n.add(t)}{var t=new THREE__namespace.AmbientLight(16777215,.6);n.add(t)}}function parseKeyValue(n){for(var t,e,r={},i=n.split(/(\;|\,)/),o=0,s=i;o<s.length;o++){var u=s[o],l=u.split("="),c=(t=l[0])===null||t===void 0?void 0:t.trim(),d=(e=l[1])===null||e===void 0?void 0:e.trim();c&&d&&(r[c]=d)}return r}function getViewportScale(){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=parseKeyValue((n=r.getAttribute("content"))!==null&&n!==void 0?n:""),o=Number(i["initial-scale"]);if(!isNaN(o))return o}}return 1}const textureURL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV8AAAA/CAQAAADtPwPkAAAR+0lEQVR4AezYg3LEQACH8d1cbdu23Q5qG9G47z/TN/h6tn2b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Xxt6gsWCpRBa0vRGQM8oB9dhmP3QAwFX4c079dJNq6Qi5xbuyTmpPSJ1Ur4UtF7GoTtmUL3zxaWqMU8P/k3cXSQ1EQRjHGdzdHTa4u7tzBs7CedhykNwF2/5jq56iU11db6Lv2yTj8hs3JoiU9sZZp5/62J5v1z9NjrDHaSbnbFMf52sHrDUVaidDxNG0o9+uLjfosfdb3jT5d5j757riJgst9NIZQ2Pn+ySZll80vjI6Wz/hQJG4vPG0L/H6poQch/dW3vL3B0u8jl0HvVj5PvHCElEF8DUAFikVYTcvmfBdDzQlvvMXSV5lP5zrXj/fJ54zuWaeeuoqkW8AwCIaqeTZKkmYrpPwR2eqN9X72W7EG57vU67OBeuMV8KXLUzv93UTTj42tvaFS++GVsc5JRyLSLJ8nzO555hFBmiSRCqMr4GwrcmGkib5xSvcwmzFK6e8s7DMa2xH4YZdZumSOwsVzFeBWdr37tpIhOpSwXqONNgZq/2KgvBt54znHN1HzlljTO4oVD5fb+prNIJXQNL1ofDKQisbPLJDv3jNSLq9OkYBEIihKIj3v7S1TRQCX5Kdl1ZQlol7LF+E++fwirfiq2sf4cTXxc6hzxffPuLEeqSWrPGWMF58TWr5viyJAP5/4EV4KePiaSE8eNRgjDy8/tyRW+FZjhS+2tlovNJovtJovNJ0uhK6Wo64SDdxEbM//KesjwAAAABJRU5ErkJggg==";var imageSize=[351,63],imageOffset=[20,20],vertices=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),uvs=new Float32Array([0,0,1,0,0,1,1,1]),index=new Uint8Array([0,1,2,1,3,2]),geometry=new THREE__namespace.BufferGeometry;geometry.setAttribute("position",new THREE__namespace.BufferAttribute(vertices,3)),geometry.setAttribute("uv",new THREE__namespace.BufferAttribute(uvs,2)),geometry.setIndex(new THREE__namespace.BufferAttribute(index,1));var material=new THREE__namespace.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1,fog:!1}),mesh=new THREE__namespace.Mesh(geometry,material);mesh.matrixAutoUpdate=!1;var scene=new THREE__namespace.Scene;scene.add(mesh),scene.matrixAutoUpdate=!1;var camera=new THREE__namespace.OrthographicCamera(-.5,.5,.5,-.5,.1,1);camera.position.set(0,0,.5),camera.lookAt(0,0,0),camera.updateMatrixWorld(!0),camera.matrixAutoUpdate=!1;var prevViewport=new THREE__namespace.Vector4,prevScissor=new THREE__namespace.Vector4;function renderPoweredByRealsee(n){if(material.map){var r=n.getViewport(prevViewport),i=n.getScissor(prevScissor),o=n.getScissorTest(),s=n.autoClear,u=i.x+imageOffset[0]/3,l=i.y+imageOffset[1]/3,c=imageSize[0]/3,d=imageSize[1]/3;n.setViewport(u,l,c,d),n.setScissor(u,l,c,d),n.setScissorTest(!0),n.autoClear=!1,n.render(scene,camera),n.setViewport(r),n.setScissor(i),n.setScissorTest(o),n.autoClear=s}else{var t=new THREE__namespace.Texture,e=new Image;e.onload=function(){t.image=e,t.wrapS=THREE__namespace.ClampToEdgeWrapping,t.wrapT=THREE__namespace.ClampToEdgeWrapping,t.minFilter=THREE__namespace.LinearFilter,t.needsUpdate=!0,t.generateMipmaps=!1,material.needsUpdate=!0,e.onload=noop$1},e.src=textureURL,material.map=t}}var DEFAULT_MODE_CHANGE_DURATION=800,DEFAULT_CAMERA_FOV=90,DEFAULT_REQUEST_PROXY=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/")},sharedVector2=new THREE__namespace.Vector2,sharedFrustum=new THREE__namespace.Frustum,sharedProjScreenMatrix=new THREE__namespace.Matrix4,clockForMixer=new WeakMap,worksMap=new WeakMap,emptyWorks=createWorks([]),Five=function(n){__extends(t,n);function t(e){e===void 0&&(e={});var r,i,o,s,u,l,c,d,f,m,A,h=n.call(this)||this;if(h.ident=createUuid(),typeof window!="undefined"&&(__FIVE_DEBUG__.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=__assign({},(i=e.imageOptions)!==null&&i!==void 0?i:{}),h.textureOptions=__assign({},(o=e.textureOptions)!==null&&o!==void 0?o:{}),h.poweredByRealsee=(s=e.poweredByRealsee)!==null&&s!==void 0?s:!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:now()},h.info=null,h.modeChangeDuration=(u=e.modeChangeDuration)!==null&&u!==void 0?u:DEFAULT_MODE_CHANGE_DURATION,h.enableWheel=(l=e.enableWheel)!==null&&l!==void 0?l:!0,typeof window!="undefined")if("renderer"in e)e.renderer instanceof InternalWebGLRenderer&&h.throwError(new Error("cannot render a internal renderer")),h.renderer=e.renderer;else try{h.renderer=new InternalWebGLRenderer({preserveDrawingBuffer:e.preserveDrawingBuffer,backgroundColor:e.backgroundColor,backgroundAlpha:e.backgroundAlpha,antialias:e.antialias,webgl2:e.webgl2,logarithmicDepthBuffer:e.logarithmicDepthBuffer,precision:e.precision});var p=getViewportScale();h.renderer.setPixelRatio(p===1?window.devicePixelRatio:1),h.renderer.setSize(512,512)}catch(S){S instanceof Error&&h.throwError(S)}h.getPixelsRenderTarget=new THREE__namespace.WebGLRenderTarget(1,1,{encoding:(d=(c=h.renderer)===null||c===void 0?void 0:c.outputEncoding)!==null&&d!==void 0?d:THREE__namespace.sRGBEncoding,generateMipmaps:!1});var y=new THREE__namespace.DepthTexture(1,1);y.generateMipmaps=!1,y.format=THREE__namespace.DepthStencilFormat,y.type=THREE__namespace.UnsignedInt248Type,h.modelRenderTarget=new THREE__namespace.WebGLRenderTarget(1,1,{encoding:(m=(f=h.renderer)===null||f===void 0?void 0:f.outputEncoding)!==null&&m!==void 0?m:THREE__namespace.sRGBEncoding,depthTexture:y,generateMipmaps:!1,depthBuffer:!0,stencilBuffer:!0}),h.scissor=Object.assign({left:0,bottom:0,width:1,height:1},e.scissor),h.camera=new Camera(DEFAULT_CAMERA_FOV),h.scene=new Scene,h.xrCustomObjectsScene=new THREE__namespace.Scene,h.scene.add(h.xrCustomObjectsScene),h.scene.matrixAutoUpdate=!1,h.lastLoadWorkTask=Promise.resolve(),h.requestProxy=(A=e.requestProxy)!==null&&A!==void 0?A:DEFAULT_REQUEST_PROXY,h.networkSubscribe=new NetworkSubscribe,h.networkSubscribe.on("network",function(S,C,I,H){var B;h.emit("network.resource",createEvent("network.resource",{source:S,requestType:C,requestState:I,detail:H})),(B=h.analysis)===null||B===void 0||B.network(h.works,S,C,I,H)}),h.boundingMesh=generateBoundingMesh(new THREE__namespace.Box3(new THREE__namespace.Vector3(-.5,-.5,-.5),new THREE__namespace.Vector3(.5,.5,.5))),h.boundingMesh.name="bounding",h.models=createModels(),h.models.push(new Model),h.lastModels=createModels(),h.lastWorks=createWorks([]),h.readyCallbacks=[],h.syncingState=!1,h.helperGroup=new THREE__namespace.Group,h.helperGroup.name="helper",h.helperGroup.matrixAutoUpdate=!1,h.scene.add(h.helperGroup),h.modelGroup=new THREE__namespace.Group,h.modelGroup.visible=!1,h.modelGroup.name="model",h.modelGroup.matrixAutoUpdate=!1,h.modelScene=new THREE__namespace.Scene,h.modelScene.add(h.modelGroup),h.modelScene.add(h.boundingMesh),h.modelScene.matrixAutoUpdate=!1,h.videoTexture=new THREE__namespace.VideoTexture(e.videoInstance||generateDefaultVideoElement()),initLights(h.scene),initLights(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=AnimationFrameLoop.shared.add(function(S,C){for(var I=[],H=2;H<arguments.length;H++)I[H-2]=arguments[H];h.updateTime.apply(h,__spreadArray([S,C],I,!1))},!1,0,10));var v=function(){typeof document!="undefined"&&document.fullscreenElement===null&&h.currentMode==="VRPanorama"&&h.controller.emit("vr.requestExit",createEvent("vr.requestExit",{}))},g=function(){h.needsRender=!0,h.modelSceneNeedsRender=!0};if(typeof document!="undefined"&&document.addEventListener("fullscreenchange",v,!1),h.renderer&&h.renderer.domElement.addEventListener("webglcontextrestored",g,!1),h.removeEventListeners=function(){typeof document!="undefined"&&document.removeEventListener("fullscreenchange",v,!1),h.renderer&&h.renderer.domElement.removeEventListener("webglcontextrestored",g,!1)},h.plugins={},e.plugins&&e.plugins.length)for(var E=0,b=e.plugins;E<b.length;E++){var T=b[E];if(typeof T=="function")T(h);else if(Array.isArray(T)){var _=T[0],x=T[1],R=T[2];if(typeof _=="function"){var w=_(h,R);typeof x=="string"&&(h.plugins[x]?h.throwError(new Error("plugin name ".concat(x," is exists."))):h.plugins[x]=w)}}}return h.gpuPickingRenderTarget=new THREE__namespace.WebGLRenderTarget(1,1,{generateMipmaps:!1}),h.meshReplaceMaterialMap=new Map,h.meshOriginMaterialMap=new Map,initLegacyEvent(h),h}return Object.defineProperty(t,"version",{get:function(){return"6.2.0-alpha.8"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"dracoPath",{get:function(){return draco.decoderPath},set:function(e){draco.setDecoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t,"ktx2Path",{get:function(){return ktx2.transcoderPath},set:function(e){ktx2.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,o,s){var u=this;if(o===void 0&&(o=1),s===void 0&&(s=new THREE__namespace.Vector3(0,0,0)),!this.renderer)throw new Error("renderer is not initialized.");this.models.setMaterial({constantColor:s}),this.scene.traverse(function(f){if(!(!(f instanceof THREE__namespace.Mesh)||f instanceof PBMMesh)){var m=Object.keys(i).filter(function(h){return h===f.uuid})[0];if(m)if(u.meshOriginMaterialMap.set(m,f.material),u.meshReplaceMaterialMap.get(m))f.material=u.meshReplaceMaterialMap.get(m);else{var A=new THREE__namespace.ShaderMaterial({uniforms:{color:{value:i[m]}},vertexShader:`
2061
+ `},LineMaterial=function(n){__extends(t,n);function t(e){var r=n.call(this,{uniforms:THREE__namespace.UniformsUtils.clone(lineShader.uniforms),vertexShader:lineShader.vertexShader,fragmentShader:lineShader.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}(THREE__namespace.ShaderMaterial);Object.assign(LineMaterial.prototype,{isLineMaterial:!0});var LineSegments2=function(n){__extends(t,n);function t(e,r){var i=n.call(this)||this;return i.type="LineSegments2",i.geometry=e!==void 0?e:new LineSegmentsGeometry,i.material=r!==void 0?r:new LineMaterial({color:Math.random()*16777215}),i}return t.prototype.computeLineDistances=function(){for(var e=this.geometry,r=e.attributes.instanceStart,i=e.attributes.instanceEnd,o=new Float32Array(2*r.count),s=new THREE__namespace.Vector3,u=new THREE__namespace.Vector3,c=0,l=0,d=r.count;c<d;c++,l+=2)s.fromBufferAttribute(r,c),u.fromBufferAttribute(i,c),o[l]=l===0?0:o[l-1],o[l+1]=o[l]+s.distanceTo(u);var f=new THREE__namespace.InstancedInterleavedBuffer(o,2,1);return e.setAttribute("instanceDistanceStart",new THREE__namespace.InterleavedBufferAttribute(f,1,0)),e.setAttribute("instanceDistanceEnd",new THREE__namespace.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,o=e.camera,s=o.projectionMatrix,u=this.geometry,c=this.material,l=c.resolution,d=c.linewidth,f=u.attributes.instanceStart,v=u.attributes.instanceEnd,A=new THREE__namespace.Vector4,h=new THREE__namespace.Vector4,p=new THREE__namespace.Vector4,y=new THREE__namespace.Vector3,m=new THREE__namespace.Matrix4,g=new THREE__namespace.Line3,E=new THREE__namespace.Vector3;i.at(1,p),p.w=1,p.applyMatrix4(o.matrixWorldInverse),p.applyMatrix4(s),p.multiplyScalar(1/p.w),p.x*=l.x/2,p.y*=l.y/2,p.z=0,y.copy(p);var b=this.matrixWorld;m.multiplyMatrices(o.matrixWorldInverse,b);for(var T=0,_=f.count;T<_;T++){A.fromBufferAttribute(f,T),h.fromBufferAttribute(v,T),A.w=1,h.w=1,A.applyMatrix4(m),h.applyMatrix4(m),A.applyMatrix4(s),h.applyMatrix4(s),A.multiplyScalar(1/A.w),h.multiplyScalar(1/h.w);var S=A.z<-1&&h.z<-1,R=A.z>1&&h.z>1;if(!(S||R)){A.x*=l.x/2,A.y*=l.y/2,h.x*=l.x/2,h.y*=l.y/2,g.start.copy(A),g.start.z=0,g.end.copy(h),g.end.z=0;var B=g.closestPointToPointParameter(y,!0);g.at(B,E);var I=THREE__namespace.MathUtils.lerp(A.z,h.z,B),x=I>=-1&&I<=1,M=y.distanceTo(E)<d*.5;if(x&&M){g.start.fromBufferAttribute(f,T),g.end.fromBufferAttribute(v,T),g.start.applyMatrix4(b),g.end.applyMatrix4(b);var L=new THREE__namespace.Vector3,C=new THREE__namespace.Vector3;i.distanceSqToSegment(g.start,g.end,C,L),r.push({point:C,pointOnLine:L,distance:i.origin.distanceTo(C),object:this,faceIndex:T})}}}},t}(THREE__namespace.Mesh);Object.assign(LineSegments2.prototype,{isLineSegments2:!0});var Line2=function(n){__extends(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.type="Line2",i}return t}(LineSegments2);Object.assign(Line2.prototype,{isLine2:!0});var LineGeometry=function(n){__extends(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),o=0;o<r;o+=3)i[2*o]=e[o],i[2*o+1]=e[o+1],i[2*o+2]=e[o+2],i[2*o+3]=e[o+3],i[2*o+4]=e[o+4],i[2*o+5]=e[o+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),o=0;o<r;o+=3)i[2*o]=e[o],i[2*o+1]=e[o+1],i[2*o+2]=e[o+2],i[2*o+3]=e[o+3],i[2*o+4]=e[o+4],i[2*o+5]=e[o+5];return n.prototype.setColors.call(this,i),this},t.prototype.fromLine=function(e){var r=e.geometry;if(r instanceof THREE__namespace.Geometry){var i=new THREE__namespace.BufferGeometry().fromGeometry(r);this.setPositions(i.attributes.position.array)}else r instanceof THREE__namespace.BufferGeometry&&this.setPositions(r.attributes.position.array);return this},t.prototype.copy=function(){return this},t}(LineSegmentsGeometry);Object.assign(L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CAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==",DEFAULT_COLOR=14467195,POINT_SIZE=8,DEFAULT_LINEWIDTH=2,DEFAULT_DASHSCALE=20,sharedCircleTexture=null,FiveLine=function(n){__extends(t,n);function t(e,r){e===void 0&&(e=new THREE__namespace.Vector3),r===void 0&&(r=new THREE__namespace.Vector3);var i=n.call(this)||this;i.type="FiveLine",i.needsRender=!0;var o=new LineGeometry,s=new LineMaterial({color:DEFAULT_COLOR,linewidth:DEFAULT_LINEWIDTH,dashScale:DEFAULT_DASHSCALE,dashed:!1});i.line=new Line2(o,s);var u=new THREE__namespace.BufferGeometry,c=new THREE__namespace.PointsMaterial({color:DEFAULT_COLOR,size:POINT_SIZE,map:sharedCircleTexture||(sharedCircleTexture=new THREE__namespace.TextureLoader().load(circleImageURL)),sizeAttenuation:!1,transparent:!0});return i.points=new THREE__namespace.Points(u,c),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"},enumerable:!1,configurable:!0}),t.prototype.setPoints=function(e,r){var i=[].concat(e.toArray(),r.toArray());this.points.geometry.setAttribute("position",new THREE__namespace.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 THREE__namespace.Vector3(e[0],e[1],e[2]),new THREE__namespace.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 o=e[i];i==="dashed"?(r.dashed=o,o?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}(THREE__namespace.Object3D);Object.assign(FiveLine.prototype,{isFiveLine:!0});var Constants={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 fetchJsonFile(n){return __awaiter(this,void 0,void 0,function(){var t;return __generator(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 fetchProfilesList(n){return __awaiter(this,void 0,void 0,function(){var t,e;return __generator(this,function(r){switch(r.label){case 0:if(!n)throw new Error("No basePath supplied");return t="profilesList.json",[4,fetchJsonFile("".concat(n,"/").concat(t))];case 1:return e=r.sent(),[2,e]}})})}function fetchProfile(n,t){return __awaiter(this,arguments,void 0,function(e,r,i,o){var s,u,c,l,d,f;return i===void 0&&(i=null),o===void 0&&(o=!0),__generator(this,function(v){switch(v.label){case 0:if(!e)throw new Error("No xrInputSource supplied");if(!r)throw new Error("No basePath supplied");return[4,fetchProfilesList(r)];case 1:if(s=v.sent(),e.profiles.some(function(A){var h=s[A];return h&&(u={profileId:A,profilePath:"".concat(r,"/").concat(h.path),deprecated:!!h.deprecated}),!!u}),!u){if(!i)throw new Error("No matching profile name found");if(c=s[i],!c)throw new Error('No matching profile name found and default profile "'.concat(i,'" missing.'));u={profileId:i,profilePath:"".concat(r,"/").concat(c.path),deprecated:!!c.deprecated}}return[4,fetchJsonFile(u.profilePath)];case 2:if(l=v.sent(),o){if(f=void 0,f=l.layouts[e.handedness],!f)throw new Error("No matching handedness, ".concat(e.handedness,", in profile ").concat(u.profileId));f.assetPath&&(d=u.profilePath.replace("profile.json",f.assetPath))}return[2,{profile:l,assetPath:d}]}})})}var defaultComponentValues={xAxis:0,yAxis:0,button:0,state:Constants.ComponentState.DEFAULT};function normalizeAxes(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 o=Math.atan2(t,n);e=Math.cos(o),r=Math.sin(o)}var s={normalizedXAxis:e*.5+.5,normalizedYAxis:r*.5+.5};return s}var VisualResponse=function(){function n(t){this.componentProperty=t.componentProperty,this.states=t.states,this.valueNodeName=t.valueNodeName,this.valueNodeProperty=t.valueNodeProperty,this.valueNodeProperty===Constants.VisualResponseProperty.TRANSFORM&&(this.minNodeName=t.minNodeName,this.maxNodeName=t.maxNodeName),this.value=0,this.updateFromComponent(defaultComponentValues)}return n.prototype.updateFromComponent=function(t){var e=t.xAxis,r=t.yAxis,i=t.button,o=t.state,s=normalizeAxes(e,r),u=s.normalizedXAxis,c=s.normalizedYAxis;switch(this.componentProperty){case Constants.ComponentProperty.X_AXIS:this.value=this.states.includes(o)?u:.5;break;case Constants.ComponentProperty.Y_AXIS:this.value=this.states.includes(o)?c:.5;break;case Constants.ComponentProperty.BUTTON:this.value=this.states.includes(o)?i:0;break;case Constants.ComponentProperty.STATE:this.valueNodeProperty===Constants.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(o):this.value=this.states.includes(o)?1:0;break;default:throw new Error("Unexpected visualResponse componentProperty ".concat(this.componentProperty))}},n}(),Component=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 o=new VisualResponse(e.visualResponses[i]);r.visualResponses[i]=o}),this.gamepadIndices=Object.assign({},e.gamepadIndices),this.values={state:Constants.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=__assign({id:this.id},this.values);return t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(t){var e=this;if(this.values.state=Constants.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=Constants.ComponentState.PRESSED:(r.touched||this.values.button>Constants.ButtonTouchThreshold)&&(this.values.state=Constants.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===Constants.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>Constants.AxisTouchThreshold&&(this.values.state=Constants.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===Constants.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>Constants.AxisTouchThreshold&&(this.values.state=Constants.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(function(i){i.updateFromComponent(e.values)})},n}(),MotionController=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(o){var s=i.layoutDescription.components[o];i.components[o]=new Component(o,s)}),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}(),DEFAULT_PROFILES_PATH="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",DEFAULT_PROFILE="generic-trigger",XRControllerModel=function(n){__extends(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 THREE__namespace.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 o=i.valueNode,s=i.minNode,u=i.maxNode,c=i.value,l=i.valueNodeProperty;o&&(l===Constants.VisualResponseProperty.VISIBILITY?o.visible=c:l===Constants.VisualResponseProperty.TRANSFORM&&(o.quaternion.copy(s.quaternion).slerp(u.quaternion,c),o.position.lerpVectors(s.position,u.position,c)))})}))},t}(THREE.Object3D);function findNodes(n,t){Object.values(n.components).forEach(function(e){var r=e.type,i=e.touchPointNodeName,o=e.visualResponses;if(r===Constants.ComponentType.TOUCHPAD)if(e.touchPointNode=t.getObjectByName(i),e.touchPointNode){var s=new THREE.SphereGeometry(.001),u=new THREE.MeshBasicMaterial({color:255}),c=new THREE.Mesh(s,u);e.touchPointNode.add(c)}else console.warn("Could not find touch dot, ".concat(e.touchPointNodeName,", in touchpad component ").concat(e.id));Object.values(o).forEach(function(l){var d=l.valueNodeName,f=l.minNodeName,v=l.maxNodeName,A=l.valueNodeProperty;if(A===Constants.VisualResponseProperty.TRANSFORM){if(l.minNode=t.getObjectByName(f),l.maxNode=t.getObjectByName(v),!l.minNode){console.warn("Could not find ".concat(f," in the model"));return}if(!l.maxNode){console.warn("Could not find ".concat(v," in the model"));return}}l.valueNode=t.getObjectByName(d),l.valueNode||console.warn("Could not find ".concat(d," in the model"))})})}function addAssetSceneToControllerModel(n,t){findNodes(n.motionController,t),n.envMap&&t.traverse(function(e){e instanceof THREE__namespace.Mesh&&e.isMesh&&(e.material.envMap=n.envMap,e.material.needsUpdate=!0)}),n.add(t)}var XRControllerModelFactory=function(){function n(t){t===void 0&&(t=null),this.gltfLoader=t,this.path=DEFAULT_PROFILES_PATH,this._assetCache={}}return n.prototype.createControllerModel=function(t){var e=this,r=new XRControllerModel,i=null;return t.addEventListener("connected",function(o){var s=o.data;s.targetRayMode!=="tracked-pointer"||!s.gamepad||fetchProfile(s,e.path,DEFAULT_PROFILE).then(function(u){var c=u.profile,l=u.assetPath;r.motionController=new MotionController(s,c,l);var d=e._assetCache[r.motionController.assetUrl];if(d)i=d.scene.clone(),addAssetSceneToControllerModel(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(),addAssetSceneToControllerModel(r,i)})}}).catch(function(u){console.warn(u)})}),t.addEventListener("disconnected",function(){r.motionController=null,r.remove(i),i=null}),r},n}();function mapPanoResource(n,t){return n}var CONTROLLER_EVNET_DELTA_TIME=300,ROTATE_Y_PI_MATRIX=new THREE__namespace.Matrix4().makeRotationAxis(new THREE__namespace.Vector3(0,1,0),Math.PI),PANO_TEXTURE_SCALE=new THREE__namespace.Vector3(-1,1,1),XRPanoramaController=function(n){__extends(t,n);function t(e){var r=n.call(this,e)||this;r.xrManager=new XRManager(r.renderer,r.renderer.getContext(),{onSessionStart:function(c){r.emit("xr.session.start",createEvent("xr.session.start",{session:c,machineType:r.xrManager.machineType}))},onSessionEnd:function(){r.emit("xr.session.end",createEvent("xr.session.end",{session:null,machineType:r.xrManager.machineType}))}}),r.xrControllerRay={left:new THREE__namespace.Raycaster,right:new THREE__namespace.Raycaster},r.xrControllerRay.left.params.Points={threshold:.1},r.xrControllerRay.right.params.Points={threshold:.1},r.gazeRay=null,r.pointerLines={left:new FiveLine,right:new FiveLine},r.pointerLines.left.visible=!1,r.pointerLines.right.visible=!0,r.pointerLines.left.setMaterial({color:new THREE__namespace.Vector3(1,1,1)}),r.pointerLines.left.points.material.depthTest=!1,r.pointerLines.right.setMaterial({color:new THREE__namespace.Vector3(1,1,1)}),r.pointerLines.right.points.material.depthTest=!1,r.controllerWrappers=[new THREE__namespace.Group,new THREE__namespace.Group];var i=r.xrManager.getController(0);r.controllerWrappers[0].add(i);var o=r.xrManager.getController(1);r.controllerWrappers[1].add(o);var s=new XRControllerModelFactory;s.gltfLoader={load:function(c,l){internalFetcher.ajax(c,{responseType:"arraybuffer"}).then(function(d){var f;return parseGltf(d.body,{resourcePath:c.slice(0,c.lastIndexOf("/")+1),search:(f=c.split("?")[1])!==null&&f!==void 0?f:"",fetcher:internalFetcher})}).then(function(d){return l(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=createUuid()]={panoId:panoStringify(r.currentPano),leftPanoPicture:null,position:r.camera.pose.offset.clone(),effect:"fade",fixCameraTransform:new THREE__namespace.Matrix4},r.parallaxCameraMatrixs=[];var u=AnimationFrameLoop.shared.getContext();return u?(r.on("xr.session.end",function(){r.scene.remove(r.pointerLines.left,r.pointerLines.right)}),r.xrManager.setSession(u),r.on("xr.session.start",function(){var c=r.xrManager.getControllerGrip(0);c.add(s.createControllerModel(c)),r.controllerWrappers[0].add(c);var l=r.xrManager.getControllerGrip(1);l.add(s.createControllerModel(l)),r.controllerWrappers[1].add(l)}),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=__assign(__assign({},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 __assign(__assign({},i),{mode:"XRPanorama"})},t.prototype.moveToPano=function(e,r,i){var o=this,s,u,c,l,d=(s=r.effect)!==null&&s!==void 0?s:"fade";this.userAction=i,this.stopMomentumMovement();var f=this.works.getResolvedObserver(e);if(!f)throw new Error("Invalid PanoIndex");var v=getImageSizeFromURL(f.images.up),A=this.imageOptions.size;typeof A=="undefined"&&f&&v&&(A=Number(v)),typeof A=="undefined"&&(A=2048);var h=this.imageOptions.transform,p=function(x,M){return mapPanoResource(applyImageURLOptions(x,h,M))},y=__assign({key:"pano.".concat(f.panoId)},pick(this.imageOptions,["format","size","quality"])),m=f.images,g=(c=(u=f.images.tiles)===null||u===void 0?void 0:u.filter(function(x){return x.size>A}))!==null&&c!==void 0?c:null,E="pano:"+jsonHash([m,y,h]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===E)return;var b=this.pendingTextureTask.panoId;(l=this.panoMeshes[b])===null||l===void 0||l.setProgress(0),this.emit("pano.texture.abort",createEvent("pano.texture.abort",{error:null,progress:0,meta:null,pano:f.pano}))}var T=this.models.getMaterial()||{},_=T.pano0,S=T.pano1,R;if((_==null?void 0:_.map.name)===E?R=_:(S==null?void 0:S.map.name)===E&&(R=S),R){var B={panoId:f.panoId,effect:d,leftPanoPicture:{zoom:1,map:R.map,luminanceMap:R.luminanceMap,matrix:new THREE__namespace.Matrix4().compose(f.position,f.quaternion,PANO_TEXTURE_SCALE)},position:f.position.clone(),fixCameraTransform:new THREE__namespace.Matrix4};this.doMoveToPano(f.pano,B,r);return}var I="move-to-pano-"+f.panoId;this.pending.add(I),this.pendingTextureTask={panoId:f.panoId,hash:E,onLoad:function(x){if(o.pending.delete(I),o.destroyed)x.body.dispose();else{x.body.name=E;var M={panoId:f.panoId,effect:d,leftPanoPicture:{zoom:1,map:x.body,luminanceMap:null,matrix:new THREE__namespace.Matrix4().compose(f.position,f.quaternion,PANO_TEXTURE_SCALE)},position:f.position.clone(),fixCameraTransform:new THREE__namespace.Matrix4};o.doMoveToPano(f.pano,M,r)}},onError:function(x){o.pending.delete(I);var M=__assign(__assign(__assign({},f.pano),{mode:o.mode}),clonePose(o.camera.pose));o.emit("pano.error",createEvent("pano.error",{error:x,userAction:o.userAction,options:r,prevPano:o.currentPano,progress:0,state:M})),o.emit("pano.cancel",createEvent("pano.cancel",{error:null,userAction:o.userAction,options:r,prevPano:o.currentPano,progress:0,state:M})),r.moveCancelCallback&&r.moveCancelCallback()}},Promise.all([this.tileLevelForFov&&g&&g.length?this.textureLoader.loadTiledCubeTexture(m,g,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:p,options:y},format:THREE__namespace.RGBAFormat,minFilter:THREE__namespace.LinearFilter,magFilter:THREE__namespace.LinearFilter,generateMipmaps:!1,viaAjax:!0,fetcher:getFetcher(f.work)},void 0,void 0,function(x){var M,L;o.emit("pano.texture.progress",createEvent("pano.texture.progress",{error:null,progress:x,meta:null,pano:f.pano})),((M=o.pendingTextureTask)===null||M===void 0?void 0:M.hash)===E&&((L=o.panoMeshes[f.panoId])===null||L===void 0||L.setProgress(x))},this.renderer):this.textureLoader.loadCubeTexture(m,{imageURL:{transform:p,options:y},format:THREE__namespace.RGBAFormat,fetcher:getFetcher(f.work)},void 0,void 0,function(x){var M,L;((M=o.pendingTextureTask)===null||M===void 0?void 0:M.hash)===E&&((L=o.panoMeshes[f.panoId])===null||L===void 0||L.setProgress(x)),o.emit("pano.texture.progress",createEvent("pano.texture.progress",{error:null,progress:x,meta:null,pano:f.pano}))},this.renderer)]).then(function(x){var M,L,C=x[0];((M=o.pendingTextureTask)===null||M===void 0?void 0:M.hash)===E?(o.pendingTextureTask.onLoad(C),(L=o.panoMeshes[f.panoId])===null||L===void 0||L.setProgress(0),delete o.pendingTextureTask,o.emit("pano.texture.success",createEvent("pano.texture.success",{error:null,progress:1,meta:C.meta,pano:f.pano}))):C.body.dispose()}).catch(function(x){var M,L;((M=o.pendingTextureTask)===null||M===void 0?void 0:M.hash)===E&&(o.pendingTextureTask.onError(x),(L=o.panoMeshes[f.panoId])===null||L===void 0||L.setProgress(0),delete o.pendingTextureTask,o.emit("pano.texture.error",createEvent("pano.texture.error",{error:x,progress:0,meta:null,pano:f.pano})),o.emit("error",x))}),this.emit("pano.texture.load",createEvent("pano.texture.load",{error:null,progress:0,meta:null,pano:f.pano}))},t.prototype.doMoveToPano=function(e,r,i){var o=this,s,u,c,l,d,f,v,A,h,p;i===void 0&&(i={});var y=now(),m=createUuid();this.panoResources[m]=r;var g=1,E,b,T;if(this.locationMotion.ended){var _=this.locationMotion.getKeyFrameSegment(y);_[0];var S=_[1],R=this.locationMotion.value,B=this.panoResourceFromLocationMotionKeyframe(S).position,I=r.position;E=Math.max(B.distanceTo(I),g),b=[{key:S.key,progress:0,value:__assign(__assign({},R),{count:0})},{key:m,progress:1,value:{distance:0,count:1}}],T=0}else{var x=this.locationMotion.getKeyFrameSegment(y),M=x[0],S=x[1],R=this.locationMotion.value,L=this.panoResourceFromLocationMotionKeyframe(M).position,B=this.panoResourceFromLocationMotionKeyframe(S).position,I=r.position,C=S.value.count-R.count,H=Math.max(L.distanceTo(B),g)*C,F=Math.max(B.distanceTo(I),g);E=H+F,b=[{key:M.key,progress:0,value:__assign({},R)},{key:S.key,progress:H/E,value:S.value},{key:m,progress:1,value:{count:S.value.count+1,distance:0}}];var O=this.locationMotionKeyframesLength(this.locationMotion.keyframes),G=this.locationMotionKeyframesLength(b);T=this.locationMotion.getProgressVelocity(y)*O/G}var Q=r.effect==="instant"?0:this.calculateMovingDuration(i.duration,r.effect==="fly"?E:0),U={longitude:i.longitude,latitude:i.latitude,fov:i.fov},D=__assign(__assign({},e),{mode:this.mode,longitude:(s=U.longitude)!==null&&s!==void 0?s:this.camera.pose.longitude,latitude:(u=U.latitude)!==null&&u!==void 0?u:this.camera.pose.latitude,fov:(c=U.fov)!==null&&c!==void 0?c:this.camera.pose.fov,offset:r.position.clone(),distance:0}),q=this.currentPano;if(this.emit("pano.moveTo",createEvent("pano.moveTo",{options:i,prevPano:q,progress:0,state:D,userAction:this.userAction,error:null})),i.moveStartCallback&&i.moveStartCallback(D),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=noop$1,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),r.effect==="fly")this.cameraMotion.set(U,Q).catch(noop$1);else{var z=coordinatesToVector({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),K=coordinatesToVector({longitude:(l=U.longitude)!==null&&l!==void 0?l:this.cameraMotion.value.longitude,latitude:(d=U.latitude)!==null&&d!==void 0?d:this.cameraMotion.value.latitude}),J=new THREE__namespace.Object3D;J.lookAt(z);var j=new THREE__namespace.Matrix4().makeRotationFromQuaternion(J.quaternion);J.lookAt(K);var re=new THREE__namespace.Matrix4().makeRotationFromQuaternion(J.quaternion),W=new THREE__namespace.Matrix4().getInverse(j).premultiply(re),te=this.cameraMotion.value.fov,$=(f=U.fov)!==null&&f!==void 0?f:this.cameraMotion.value.fov,ne=1;r.effect==="zoomin"?ne=1.5:r.effect==="zoomout"&&(ne=.4);for(var ee=$*ne,ce=0;ce<b.length-1;ce++){var ae=b[ce].key;if(ae){var se=this.panoResources[ae];se&&(se.fixCameraTransform.copy(W),se.leftPanoPicture&&(se.leftPanoPicture.zoom=Math.tan(te/2/180*Math.PI)/Math.tan(ee/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:(v=U.longitude)!==null&&v!==void 0?v:this.cameraMotion.value.longitude,latitude:(A=U.latitude)!==null&&A!==void 0?A:this.cameraMotion.value.latitude,fov:ee}},{progress:1,value:{longitude:(h=U.longitude)!==null&&h!==void 0?h:this.cameraMotion.value.longitude,latitude:(p=U.latitude)!==null&&p!==void 0?p:this.cameraMotion.value.latitude,fov:$}}],Q).catch(noop$1)}var Ae=this.locationMotion.setKeyframes(b,Q,T);Ae.then(function(){for(var he,me,Z,Y=0,N=o.models;Y<N.length;Y++){var Ee=N[Y];Ee.show()}var ge=__assign(__assign({},e),{mode:o.mode,longitude:o.camera.pose.longitude,latitude:o.camera.pose.latitude,fov:o.camera.pose.fov,offset:o.camera.pose.offset.clone(),distance:0});o.emit("pano.arrived",createEvent("pano.arrived",{options:i,prevPano:q,progress:1,state:ge,userAction:o.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(ge);var ve=o.works.getResolvedObserver(o.currentPano);if(ve&&ve.video&&o.videoTexture&&o.videoTexture.image instanceof HTMLVideoElement){var xe=ROTATE_Y_PI_MATRIX.clone().multiply((Z=(me=(he=o.models.getMaterial())===null||he===void 0?void 0:he.pano1)===null||me===void 0?void 0:me.matrix)!==null&&Z!==void 0?Z:new THREE__namespace.Matrix4).multiply(ve.video.matrix),fe={map:o.videoTexture,size:ve.video.size,matrix:xe,alpha:1},de=createUuid(),le=o.videoTexture.image;le.setAttribute("uuid",de),canplayVideo().then(function(ue){ue&&ve.video&&le.getAttribute("uuid")===de&&(le.oncanplay=function(){le.oncanplay=noop$1,le.play()},le.ontimeupdate=function(){le.currentTime>.5&&(le.ontimeupdate=noop$1,o.panoVideo.setMaterial(fe))},le.src=ve.video.source)}).catch(function(){le.removeAttribute("uuid")})}},function(){o.emit("pano.cancel",createEvent("pano.cancel",{options:i,prevPano:q,progress:0,state:D,userAction:o.userAction,error:null})),i.moveCancelCallback&&i.moveCancelCallback()})},t.prototype.checkSelectedPano=function(e){var r=this,i,o,s,u;this.stopMomentumMovement();var c=this.camera.getDirection(new THREE__namespace.Vector3).setY(0),l=null,d=this.works.getResolvedObserver(this.currentPano);if(!d)return null;var f=d.accessibleIds.filter(function(K){var J=panoParse(K);if(panoEqual(J,r.currentPano))return!1;var j=r.works.getResolvedObserver(J);return!j||j.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:j.loadable||j.active}),v=this.models.intersectRaycaster(e)[0];if(v){var A=arrayMin(f,function(K){var J=r.works.getResolvedObserver(K);if(!J)return 1/0;var j=J.standingPosition.clone();return j.distanceTo(v.point)},!0),h=A[0],p=A[1];h&&p<this.panoTapTriggerRadius&&(l=(i=this.works.getResolvedObserver(h))!==null&&i!==void 0?i:null)}if(isNil(l)){var y=this.getForwardObserverOrNot(e);y&&(l=y)}for(var m=0,g=this.locationMotion.keyframes;m<g.length;m++){var E=g[m],b=this.panoResourceFromLocationMotionKeyframe(E);if(!(E.progress<this.locationMotion.progress)&&l&&b.panoId===l.panoId){l=null;break}}if(isNil(l))return this.locationMotion.ended===!0&&this.cameraBounce(),null;if(l&&!l.active){var T=l.panoId;this.panoMeshes[T]&&(this.panoMeshes[T].setDisabled(!1),this.panoMeshes[T].setLoading(!0))}var _={};if(l){for(var S=Math.PI/6,R=Math.PI/12,B=new THREE__namespace.Vector3(0,1,0),I=l.position.clone().setY(0).sub(d.position.clone().setY(0)).normalize(),x=I.clone().applyAxisAngle(B,S),M=I.clone().applyAxisAngle(B,-S),L=[],C=[],H=[],F=0,O=l.accessibleIds;F<O.length;F++){var h=O[F],G=panoParse(h);if(!(panoEqual(G,this.currentPano)||panoEqual(G,l.pano))){var Q=this.works.getResolvedObserver(h);if(Q){var U=Q.position.clone().sub(l.position).setY(0);I.angleTo(U)<S?H.push(U):x.angleTo(U)<S?L.push(U):M.angleTo(U)<S&&C.push(U)}}}var D=H.length>0?H:__spreadArray(__spreadArray([],L,!0),C,!0),q=D.slice().sort(function(K,J){return K.angleTo(I)-J.angleTo(I)})[0];q&&q.angleTo(c)>R&&(_.longitude=Math.atan2(-q.x,-q.z))}this.cameraMotion.value.latitude<-Math.PI/4&&(_.latitude=clamp$1(0,this.minLatitude,this.maxLatitude)),this.cameraMotion.value.fov<60&&(_.fov=this.defaultFov);var z={workCode:l.pano.workCode,panoIndex:l.pano.panoIndex,mode:this.mode,longitude:(o=_.longitude)!==null&&o!==void 0?o:this.camera.pose.longitude,latitude:(s=_.latitude)!==null&&s!==void 0?s:this.camera.pose.latitude,fov:(u=_.fov)!==null&&u!==void 0?u:this.camera.pose.fov,distance:0,offset:l?l.position.clone():new THREE__namespace.Vector3};return this.emit("pano.select",createEvent("pano.select",{prevPano:this.currentPano,state:z,userAction:!0,options:_,progress:0,error:null})),l&&l.active?(this.emit("pano.request",createEvent("pano.request",{userAction:!0,prevPano:this.currentPano,progress:0,state:z,options:_,error:null})),l.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,o,s,u,c,l,d,f,v,A=[],h=2;h<arguments.length;h++)A[h-2]=arguments[h];this.userAction=!0;var p={},y={},m=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),g=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),E=!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),p.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(clamp$1(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var b=this.locationMotion.getKeyFrameSegment(e),T=b[0],_=b[1],S=this.panoResourceFromLocationMotionKeyframe(T),R=this.panoResourceFromLocationMotionKeyframe(_),B=new THREE__namespace.Vector3().copy(S.position),I=new THREE__namespace.Vector3().copy(R.position),x=this.locationMotion.value.count-_.value.count+1;p.progress=x,R.leftPanoPicture&&(x<1?S.leftPanoPicture&&(p.pano0=S.leftPanoPicture):p.pano0=R.leftPanoPicture,p.pano1=R.leftPanoPicture),R.effect==="montage"?p.transition="BLACK":R.effect==="spread"?p.transition="SPREAD":p.transition="FADE",(R.effect==="zoomin"||R.effect==="zoomout")&&(p.progress=Math.pow(x,3)),x<1&&R.effect!=="fly"&&(p.pano0&&S.leftPanoPicture&&(p.pano0={map:p.pano0.map,zoom:p.pano0.zoom,luminanceMap:p.pano0.luminanceMap,matrix:S.leftPanoPicture.matrix.clone().setPosition(R.position)}),B.copy(I),E=!0),y.distance=this.locationMotion.value.distance,y.offset=new THREE__namespace.Vector3(B.x+(I.x-B.x)*x,B.y+(I.y-B.y)*x,B.z+(I.z-B.z)*x);for(var M=[],L=[],C=0,H=this.locationMotion.keyframes;C<H.length;C++){var F=H[C],O=F.key,G=F.progress;O!==void 0&&(M.push(O),G>this.locationMotion.progress&&L.push(O))}for(var Q=0,U=Object.keys(this.panoResources);Q<U.length;Q++){var D=U[Q];if(!(L.indexOf(D)>=0)){var q=this.panoResources[D];if(q.leftPanoPicture){var z=q.leftPanoPicture.map;if(z){if(z===((o=p.pano0)===null||o===void 0?void 0:o.map)||z===((s=p.pano1)===null||s===void 0?void 0:s.map))continue;z instanceof TileCubeTextureTarget&&z.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(z.cubeRenderTarget),z.dispose(),q.leftPanoPicture=null}}M.indexOf(D)>=0||delete this.panoResources[D]}}this.currentPano=panoParse(R.panoId),this.emit("pano.moving",createEvent("pano.moving",{userAction:this.userAction,prevPano:panoParse(m.panoId),state:__assign(__assign(__assign(__assign({},panoParse(g.panoId)),{mode:this.mode}),clonePose(this.camera.pose)),y),options:{},progress:this.locationMotion.progress,error:null}))}isEmptyObject(p)===!1&&(!((u=p.pano0)===null||u===void 0)&&u.map&&p.pano0.map instanceof TileCubeTextureTarget&&!p.pano0.map.cubeRenderTarget&&(p.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((c=p.pano1)===null||c===void 0)&&c.map&&p.pano1.map instanceof TileCubeTextureTarget&&!p.pano1.map.cubeRenderTarget&&(p.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),this.models.setMaterial(p)),isEmptyObject(y)===!1&&this.setCamera(y);var K=this.works.getResolvedObserver(this.currentPano),J=A[1];if(!J){console.error("xrFrame丢失,请重试");return}if(!this.xrManager.session){console.error("session丢失,请重试");return}var j=this.xrManager.referenceSpace;if(j){var re=this.xrManager.cameraVR,W=this.xrManager.cameraL,te=this.xrManager.cameraR,$=[W,te],ne=J.getViewerPose(j),ee=new THREE__namespace.Vector3(0,0,0);if(ne){var ce;ce=this.xrManager.session.renderState.baseLayer;var ae=ne.views;if(!ce){console.error("no layer found");return}this.renderer.setFramebuffer(ce.framebuffer);var se=!1;ae.length!==re.cameras.length&&(re.cameras.length=0,se=!0),this.parallaxCameraMatrixs=[];var Ae=new THREE__namespace.Vector3,he=new THREE__namespace.Vector3;new THREE__namespace.Matrix4().fromArray(ae[0].transform.matrix).decompose(Ae,new THREE__namespace.Quaternion,new THREE__namespace.Vector3),new THREE__namespace.Matrix4().fromArray(ae[1].transform.matrix).decompose(he,new THREE__namespace.Quaternion,new THREE__namespace.Vector3),he.clone().sub(Ae).normalize();var me=new THREE__namespace.Vector3,Z=new THREE__namespace.Quaternion,Y=new THREE__namespace.Vector3;this.camera.matrix.decompose(me,Z,Y);for(var N=0;N<ae.length;N++){var Ee=ae[N],ge=ce.getViewport(Ee),ve=$[N];ve.matrix.fromArray(Ee.transform.matrix);var xe=new THREE__namespace.Vector3,fe=new THREE__namespace.Quaternion,de=new THREE__namespace.Vector3;ve.matrix.decompose(xe,fe,de),ee.copy(me),ve.position.copy(me),ve.quaternion.copy(fe),ve.scale.copy(de),ve.updateMatrix(),ve.projectionMatrix.fromArray(Ee.projectionMatrix),ve.viewport.set(ge.x,ge.y,ge.width,ge.height),se===!0&&re.cameras.push(ve)}if(this.xrManager.session&&this.xrManager.session.inputSources){for(var N=0;N<this.xrManager.session.inputSources.length;N++)if(this.xrManager.session.inputSources[N]&&this.xrManager.session.inputSources[N].targetRayMode==="transient-pointer"){var le=J.getPose(this.xrManager.session.inputSources[N].targetRaySpace,j);if(le){var ue=new THREE__namespace.Vector3(0,0,-1).applyQuaternion(le.transform.orientation),oe=new THREE__namespace.Raycaster(this.camera.position,ue);this.gazeRay=oe}}}if(this.xrManager.machineType==="Oculus"||this.xrManager.machineType==="Pico"){for(var Te=this.xrManager.session.inputSources,N=0;N<Te.length;N++){var Re=this.xrManager.controllers[N],Ie=Te[N];if(Ie){Re&&Re.update(Ie,J,j);var oe=this.xrManager.getController(N),lt=new THREE__namespace.Vector3(0,1.2,0),ye=oe.position.clone().add(ee).sub(lt);Ie.handedness==="left"?this.xrControllerRay.left.set(ye,new THREE__namespace.Vector3(0,0,-1).applyEuler(oe.rotation)):Ie.handedness==="right"&&this.xrControllerRay.right.set(ye,new THREE__namespace.Vector3(0,0,-1).applyEuler(oe.rotation)),this.controllerWrappers[N].position.copy(new THREE__namespace.Vector3(0,0,0).add(ee).sub(lt));var we=this.models.intersectRaycaster(this.xrControllerRay.right);if(we.length===0&&(we=this.xrControllerRay.right.intersectObject(this.boundingMesh,!0).map(function(st){var ft;return __assign({floor:(ft=K==null?void 0:K.floorIndex)!==null&&ft!==void 0?ft:0},st)})),we.length>=1&&we[0].face)if(Ie.handedness==="right"){var Be=this.xrControllerRay.right.intersectObject(this.xrCustomObjectsScene,!0),Je=we[0].face.normal,ht=Je.clone(),Xe=we[0].point.clone();this.intersectMesh.position.copy(Xe);var Ve=Xe.clone().add(ht);if(this.intersectMesh.lookAt(Ve),Math.abs(Je.y)>.99){var je=this.camera.position.clone().sub(Xe);this.intersectMesh.rotation.z=-Math.atan2(je.z,je.x)}this.intersectMesh.visible=!0,this.needsRender=!0,Be.length>0?(this.pointerLines.right.setPoints(ye,Be[0].point),this.pointerLines.right.points.visible=!0,this.intersectMesh.visible=!1):(this.pointerLines.right.points.visible=!1,this.pointerLines.right.setPoints(ye,we[0].point));var at=we[0],Ue=createEvent("intersect.update",{raycaster:(l=this.xrControllerRay.right)!==null&&l!==void 0?l:null,intersection:at!=null?at:null,object:this.intersectMesh});if(this.emit("intersect.update",Ue),Ue.defaultPrevented){this.hideIntersectMesh();return}}else this.pointerLines.left.setPoints(ye,we[0].point)}}this.updateControllerHelper(Te,e,r)}if(this.camera.pose.distance>.1||E)for(var We=0,ze=Object.keys(this.panoMeshes);We<ze.length;We++){var He=ze[We],be=this.panoMeshes[He];be.setOpacity(0),be.setCurrent(!1),be.updateTime&&be.updateTime(e,r),be.visible=!1}else if(K){var $e=arrayMin(K.visibleIds,function(Le){var qe=i.works.getResolvedObserver(Le);return qe?K.standingPosition.distanceTo(qe.standingPosition):1/0},!0),Fe=$e[1];Fe=clamp$1(Fe,2.5,1/0);for(var et=K.visibleIds.concat(panoStringify(this.currentPano)),tt=this.getForwardObserverOrNot(),Qe=this.camera.getDirection(new THREE__namespace.Vector3),Ne=0,rt=Object.keys(this.panoMeshes);Ne<rt.length;Ne++){var He=rt[Ne],be=this.panoMeshes[He],ot=this.works.getResolvedObserver(He);if(et.indexOf(He)===-1)be.setCurrent(!1),be.setOpacity(0);else if(!ot)be.setCurrent(!1),be.setOpacity(0);else if(!ot.loadable&&!ot.active)be.setCurrent(!1),be.setOpacity(0);else{var pt=be.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);be.setCurrent(!be.loading&&be.progress===0&&tt!==null&&tt.panoId===He),be.setOpacity(pt<.01?0:clamp$1(Fe/pt*1.2,.65,.98));var ct=this.camera.position.clone().setY(be.position.y),ue=new THREE__namespace.Vector3().copy(be.position).sub(ct).normalize();if(He===panoStringify(this.currentPano)){var dt=clamp$1((.5-ct.distanceTo(be.position))/.5,0,1);ue.multiplyScalar(1-dt).add(Qe.clone().multiplyScalar(dt))}ue.length()>0&&be.quaternion.setFromEuler(new THREE__namespace.Euler(0,Math.atan2(ue.x,ue.z),0))}be.updateTime&&be.updateTime(e,r)}}var Ge=function(){return 4}(),Me=function(){var Le=new THREE__namespace.PerspectiveCamera;Le.applyMatrix4(re.matrix),Le.position.set(0,0,0);var qe=i.works.getResolvedObserver(g.panoId),st=qe!=null?qe:K;st&&Le.quaternion.premultiply(st.quaternion.clone().inverse()),Le.updateProjectionMatrix(),Le.updateMatrixWorld(!0);var ft=new THREE__namespace.Frustum().setFromProjectionMatrix(new THREE__namespace.Matrix4().multiplyMatrices(Le.projectionMatrix,Le.matrixWorldInverse));return ft}();g.panoId===panoStringify(this.currentPano)&&((d=g.leftPanoPicture)===null||d===void 0?void 0:d.map)instanceof TileCubeTextureTarget&&(g.leftPanoPicture.map.maxRequest=this.tileMaxRequest,g.leftPanoPicture.map.update(Me,Ge),g.leftPanoPicture.map.needsRender===!0&&(this.needsRender=!0,this.modelSceneNeedsRender=!0));{var _e=this.tiling.object.visible;if(this.initAnimationed){var Pe=g.panoId,ke=this.works.getResolvedObserver(Pe);ke?isSimilarVector3(this.camera.position,ke.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==Pe&&this.tiling.cleanup(),this.tiling.panoId=Pe,this.tiling.setResource((v=(f=ke.images)===null||f===void 0?void 0:f.tiles)!==null&&v!==void 0?v:[],this.enableIOSEDR&&ke.images.luminance?ke.images.luminance:null),this.tiling.setFetcher(getFetcher(ke.work)),this.tiling.setRotation(ke.quaternion),this.tiling.setPosition(ke.position),this.tiling.maxRequest=this.tileMaxRequest,Ge>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update(Me,Ge,e):this.tiling.update(Me,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;_e!==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 o=this.xrControllerRay.left,s=this.xrControllerRay.right;if(!(!e||e.length===0)){for(var u={buttons:{X:!1,Y:!1,LeftTrigger:!1,LeftPinch:!1,A:!1,B:!1,RightTrigger:!1,RightPinch:!1}},c=0;c<e.length;c++){var l=e[c].handedness,d=e[c].gamepad;switch(l){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: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};u.buttons.X=d.buttons&&d.buttons[4]?d.buttons[4].pressed:!1,u.buttons.Y=d.buttons&&d.buttons[5]?d==null?void 0:d.buttons[5].pressed:!1,u.buttons.LeftTrigger=d.buttons&&d.buttons[0]?d==null?void 0:d.buttons[0].pressed:!1,u.buttons.LeftPinch=d.buttons&&d.buttons[1]?d==null?void 0:d.buttons[1].pressed:!1,u.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 v={raycaster:s,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};u.right=v,u.buttons.A=d.buttons&&d.buttons[4]?d==null?void 0:d.buttons[4].pressed:!1,u.buttons.B=d.buttons&&d.buttons[5]?d==null?void 0:d.buttons[5].pressed:!1,u.buttons.RightTrigger=d.buttons&&d.buttons[0]?d==null?void 0:d.buttons[0].pressed:!1,u.buttons.RightPinch=d.buttons&&d.buttons[1]?d==null?void 0:d.buttons[1].pressed:!1;break}}this.emit("xr.controller.update",createEvent("xr.controller.update",u))}},t.prototype.emitHandleEvent=function(e,r,i){var o=this.xrControllerRay.left,s=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",createEvent("xr.gesture.buttonDown",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!1,isFirst:!0,controllers:{raycaster:{leftRay:o,rightRay:s}}}));else{var u=i-this.xrHandleState[r].touchStartTime;u>CONTROLLER_EVNET_DELTA_TIME&&this.emit("xr.gesture.press",createEvent("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!0,controllers:{raycaster:{leftRay:o,rightRay:s}}}))}else if(this.xrHandleState[r].touchStart===!0){this.emit("xr.gesture.buttonUp",createEvent("xr.gesture.buttonUp",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:o,rightRay:s}}}));var u=i-this.xrHandleState[r].touchStartTime;if(u<=CONTROLLER_EVNET_DELTA_TIME){var c=createEvent("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:o,rightRay:s}}}),l=this.emit("xr.gesture.tap",c);!l&&!c.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}(PanoramaController),Controllers={Floorplan:FloorplanController,Topview:TopviewController,Panorama:PanoramaController,VRPanorama:VRPanoramaController,Model:ModelController,Mapview:MapviewController,XRPanorama:XRPanoramaController},PROXY_CONTROLLER_EVENT_NAMES=["gesture.pan","gesture.tap","gesture.dbltap","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 initLegacyEvent(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.dbltap",function(t){var e=!1;e=n.emit("wantsGesture","dbltap",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsDblTapGesture",t.center.raycaster,t.center.coords,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","dbltap",t.pointers,t.isFinal),n.emit("dblTapGesture",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=coordinatesToVector(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 generateDefaultVideoElement(){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 initLights(n){{var t=new THREE__namespace.DirectionalLight(16777215,.3);t.position.copy(new THREE__namespace.Vector3(1,1,1)),n.add(t)}{var t=new THREE__namespace.DirectionalLight(16777215,.1);t.position.copy(new THREE__namespace.Vector3(-1,-1,-1)),n.add(t)}{var t=new THREE__namespace.DirectionalLight(16777215,.1);n.add(t)}{var t=new THREE__namespace.AmbientLight(16777215,.6);n.add(t)}}function parseKeyValue(n){for(var t,e,r={},i=n.split(/(\;|\,)/),o=0,s=i;o<s.length;o++){var u=s[o],c=u.split("="),l=(t=c[0])===null||t===void 0?void 0:t.trim(),d=(e=c[1])===null||e===void 0?void 0:e.trim();l&&d&&(r[l]=d)}return r}function getViewportScale(){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=parseKeyValue((n=r.getAttribute("content"))!==null&&n!==void 0?n:""),o=Number(i["initial-scale"]);if(!isNaN(o))return o}}return 1}const textureURL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV8AAAA/CAQAAADtPwPkAAAR+0lEQVR4AezYg3LEQACH8d1cbdu23Q5qG9G47z/TN/h6tn2b/H+TUTLc7yjcOXV46OUAnUs6EbUp022ZBXc1NhoZYYd7fjDRvdcHAwrlK2QBVJ4sgoqONmY45RUT23sZ6H42F2hK5CtkMbjhZlDmUUcvq1zyieUVyjbE4I1GBfItwxG56YaUZTQwyh4P6NgJ4YYYvCuQb5kOyI03pORjiqe4Lwpq5pt1vJqfUwKWJVbSMYfppYconG+maNNQOWBZuwHTzicGel75NtFOkxr5apmV8cikcko0DrDQs863AeGl0cE0+1xy573m0/wf0cEKW6H7BWtggiMG8sy3oHRDpJMw4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UAFikVYTcvmfBdDzQlvvMXSV5lP5zrXj/fJ54zuWaeeuoqkW8AwCIaqeTZKkmYrpPwR2eqN9X72W7EG57vU67OBeuMV8KXLUzv93UTTj42tvaFS++GVsc5JRyLSLJ8nzO555hFBmiSRCqMr4GwrcmGkib5xSvcwmzFK6e8s7DMa2xH4YZdZumSOwsVzFeBWdr37tpIhOpSwXqONNgZq/2KgvBt54znHN1HzlljTO4oVD5fb+prNIJXQNL1ofDKQisbPLJDv3jNSLq9OkYBEIihKIj3v7S1TRQCX5Kdl1ZQlol7LF+E++fwirfiq2sf4cTXxc6hzxffPuLEeqSWrPGWMF58TWr5viyJAP5/4EV4KePiaSE8eNRgjDy8/tyRW+FZjhS+2tlovNJovtJovNJ0uhK6Wo64SDdxEbM//KesjwAAAABJRU5ErkJggg==";var imageSize=[351,63],imageOffset=[20,20],vertices=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),uvs=new Float32Array([0,0,1,0,0,1,1,1]),index=new Uint8Array([0,1,2,1,3,2]),geometry=new THREE__namespace.BufferGeometry;geometry.setAttribute("position",new THREE__namespace.BufferAttribute(vertices,3)),geometry.setAttribute("uv",new THREE__namespace.BufferAttribute(uvs,2)),geometry.setIndex(new THREE__namespace.BufferAttribute(index,1));var material=new THREE__namespace.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1,fog:!1}),mesh=new THREE__namespace.Mesh(geometry,material);mesh.matrixAutoUpdate=!1;var scene=new THREE__namespace.Scene;scene.add(mesh),scene.matrixAutoUpdate=!1;var camera=new THREE__namespace.OrthographicCamera(-.5,.5,.5,-.5,.1,1);camera.position.set(0,0,.5),camera.lookAt(0,0,0),camera.updateMatrixWorld(!0),camera.matrixAutoUpdate=!1;var prevViewport=new THREE__namespace.Vector4,prevScissor=new THREE__namespace.Vector4;function renderPoweredByRealsee(n){if(material.map){var r=n.getViewport(prevViewport),i=n.getScissor(prevScissor),o=n.getScissorTest(),s=n.autoClear,u=i.x+imageOffset[0]/3,c=i.y+imageOffset[1]/3,l=imageSize[0]/3,d=imageSize[1]/3;n.setViewport(u,c,l,d),n.setScissor(u,c,l,d),n.setScissorTest(!0),n.autoClear=!1,n.render(scene,camera),n.setViewport(r),n.setScissor(i),n.setScissorTest(o),n.autoClear=s}else{var t=new THREE__namespace.Texture,e=new Image;e.onload=function(){t.image=e,t.wrapS=THREE__namespace.ClampToEdgeWrapping,t.wrapT=THREE__namespace.ClampToEdgeWrapping,t.minFilter=THREE__namespace.LinearFilter,t.needsUpdate=!0,t.generateMipmaps=!1,material.needsUpdate=!0,e.onload=noop$1},e.src=textureURL,material.map=t}}var DEFAULT_MODE_CHANGE_DURATION=800,DEFAULT_CAMERA_FOV=90,DEFAULT_REQUEST_PROXY=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/")},sharedVector2=new THREE__namespace.Vector2,sharedFrustum=new THREE__namespace.Frustum,sharedProjScreenMatrix=new THREE__namespace.Matrix4,clockForMixer=new WeakMap,worksMap=new WeakMap,emptyWorks=createWorks([]),Five=function(n){__extends(t,n);function t(e){e===void 0&&(e={});var r,i,o,s,u,c,l,d,f,v,A,h=n.call(this)||this;if(h.ident=createUuid(),typeof window!="undefined"&&(__FIVE_DEBUG__.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=__assign({},(i=e.imageOptions)!==null&&i!==void 0?i:{}),h.textureOptions=__assign({},(o=e.textureOptions)!==null&&o!==void 0?o:{}),h.poweredByRealsee=(s=e.poweredByRealsee)!==null&&s!==void 0?s:!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:now()},h.info=null,h.modeChangeDuration=(u=e.modeChangeDuration)!==null&&u!==void 0?u:DEFAULT_MODE_CHANGE_DURATION,h.enableWheel=(c=e.enableWheel)!==null&&c!==void 0?c:!0,typeof window!="undefined")if("renderer"in e)e.renderer instanceof InternalWebGLRenderer&&h.throwError(new Error("cannot render a internal renderer")),h.renderer=e.renderer;else try{h.renderer=new InternalWebGLRenderer({preserveDrawingBuffer:e.preserveDrawingBuffer,backgroundColor:e.backgroundColor,backgroundAlpha:e.backgroundAlpha,antialias:e.antialias,webgl2:e.webgl2,logarithmicDepthBuffer:e.logarithmicDepthBuffer,precision:e.precision});var p=getViewportScale();h.renderer.setPixelRatio(p===1?window.devicePixelRatio:1),h.renderer.setSize(512,512)}catch(I){I instanceof Error&&h.throwError(I)}h.getPixelsRenderTarget=new THREE__namespace.WebGLRenderTarget(1,1,{encoding:(d=(l=h.renderer)===null||l===void 0?void 0:l.outputEncoding)!==null&&d!==void 0?d:THREE__namespace.sRGBEncoding,generateMipmaps:!1});var y=new THREE__namespace.DepthTexture(1,1);y.generateMipmaps=!1,y.format=THREE__namespace.DepthStencilFormat,y.type=THREE__namespace.UnsignedInt248Type,h.modelRenderTarget=new THREE__namespace.WebGLRenderTarget(1,1,{encoding:(v=(f=h.renderer)===null||f===void 0?void 0:f.outputEncoding)!==null&&v!==void 0?v:THREE__namespace.sRGBEncoding,depthTexture:y,generateMipmaps:!1,depthBuffer:!0,stencilBuffer:!0}),h.scissor=Object.assign({left:0,bottom:0,width:1,height:1},e.scissor),h.camera=new Camera(DEFAULT_CAMERA_FOV),h.scene=new Scene,h.xrCustomObjectsScene=new THREE__namespace.Scene,h.scene.add(h.xrCustomObjectsScene),h.scene.matrixAutoUpdate=!1,h.lastLoadWorkTask=Promise.resolve(),h.requestProxy=(A=e.requestProxy)!==null&&A!==void 0?A:DEFAULT_REQUEST_PROXY,h.networkSubscribe=new NetworkSubscribe,h.networkSubscribe.on("network",function(I,x,M,L){var C;h.emit("network.resource",createEvent("network.resource",{source:I,requestType:x,requestState:M,detail:L})),(C=h.analysis)===null||C===void 0||C.network(h.works,I,x,M,L)}),h.boundingMesh=generateBoundingMesh(new THREE__namespace.Box3(new THREE__namespace.Vector3(-.5,-.5,-.5),new THREE__namespace.Vector3(.5,.5,.5))),h.boundingMesh.name="bounding",h.models=createModels(),h.models.push(new Model),h.lastModels=createModels(),h.lastWorks=createWorks([]),h.readyCallbacks=[],h.syncingState=!1,h.helperGroup=new THREE__namespace.Group,h.helperGroup.name="helper",h.helperGroup.matrixAutoUpdate=!1,h.scene.add(h.helperGroup),h.modelGroup=new THREE__namespace.Group,h.modelGroup.visible=!1,h.modelGroup.name="model",h.modelGroup.matrixAutoUpdate=!1,h.modelScene=new THREE__namespace.Scene,h.modelScene.add(h.modelGroup),h.modelScene.add(h.boundingMesh),h.modelScene.matrixAutoUpdate=!1,h.videoTexture=new THREE__namespace.VideoTexture(e.videoInstance||generateDefaultVideoElement()),initLights(h.scene),initLights(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=AnimationFrameLoop.shared.add(function(I,x){for(var M=[],L=2;L<arguments.length;L++)M[L-2]=arguments[L];h.updateTime.apply(h,__spreadArray([I,x],M,!1))},!1,0,10));var m=function(){typeof document!="undefined"&&document.fullscreenElement===null&&h.currentMode==="VRPanorama"&&h.controller.emit("vr.requestExit",createEvent("vr.requestExit",{}))},g=function(){h.needsRender=!0,h.modelSceneNeedsRender=!0};if(typeof document!="undefined"&&document.addEventListener("fullscreenchange",m,!1),h.renderer&&h.renderer.domElement.addEventListener("webglcontextrestored",g,!1),h.removeEventListeners=function(){typeof document!="undefined"&&document.removeEventListener("fullscreenchange",m,!1),h.renderer&&h.renderer.domElement.removeEventListener("webglcontextrestored",g,!1)},h.plugins={},e.plugins&&e.plugins.length)for(var E=0,b=e.plugins;E<b.length;E++){var T=b[E];if(typeof T=="function")T(h);else if(Array.isArray(T)){var _=T[0],S=T[1],R=T[2];if(typeof _=="function"){var B=_(h,R);typeof S=="string"&&(h.plugins[S]?h.throwError(new Error("plugin name ".concat(S," is exists."))):h.plugins[S]=B)}}}return h.gpuPickingRenderTarget=new THREE__namespace.WebGLRenderTarget(1,1,{generateMipmaps:!1}),h.meshReplaceMaterialMap=new Map,h.meshOriginMaterialMap=new Map,initLegacyEvent(h),h}return Object.defineProperty(t,"version",{get:function(){return"6.2.0"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"dracoPath",{get:function(){return draco.decoderPath},set:function(e){draco.setDecoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t,"ktx2Path",{get:function(){return ktx2.transcoderPath},set:function(e){ktx2.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,o,s){var u=this;if(o===void 0&&(o=1),s===void 0&&(s=new THREE__namespace.Vector3(0,0,0)),!this.renderer)throw new Error("renderer is not initialized.");this.models.setMaterial({constantColor:s}),this.scene.traverse(function(f){if(!(!(f instanceof THREE__namespace.Mesh)||f instanceof PBMMesh)){var v=Object.keys(i).filter(function(h){return h===f.uuid})[0];if(v)if(u.meshOriginMaterialMap.set(v,f.material),u.meshReplaceMaterialMap.get(v))f.material=u.meshReplaceMaterialMap.get(v);else{var A=new THREE__namespace.ShaderMaterial({uniforms:{color:{value:i[v]}},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
- `});A.depthTest=f.material.depthTest,A.side=f.material.side,u.meshReplaceMaterialMap.set(m,A),f.material=A}}});var l=this.renderer.getSize(new THREE__namespace.Vector2);this.camera.setViewOffset(l.width,l.height,e*o,r*o,1,1),this.renderer.setRenderTarget(this.gpuPickingRenderTarget),this.render();var c=new Uint8Array(4);this.renderer.readRenderTargetPixels(this.gpuPickingRenderTarget,0,0,1,1,c),this.renderer.setRenderTarget(null),this.camera.clearViewOffset(),this.scene.traverse(function(f){!(f instanceof THREE__namespace.Mesh)||f instanceof PBMMesh||u.meshOriginMaterialMap.get(f.uuid)&&(f.material=u.meshOriginMaterialMap.get(f.uuid))}),this.models.setMaterial({constantColor:null});var d=Object.keys(i).filter(function(f){return i[f].equals(new THREE__namespace.Color().setRGB(c[0]/255,c[1]/255,c[2]/255))})[0];return d||!1},t.prototype.dispose=function(){var e,r;if(this.destroyed!==!0){delete __FIVE_DEBUG__.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 o=this.models.getMaterial();o&&(o.pano0&&o.pano0.map.dispose(),o.pano1&&o.pano1.map!==((r=o.pano0)===null||r===void 0?void 0:r.map)&&o.pano1.map.dispose());for(var s=0,u=this.models;s<u.length;s++){var l=u[s];l.dispose()}this.models.length=0,this.models.setMaterial({pano0:null,pano1:null}),this.meshReplaceMaterialMap.forEach(function(c){c.dispose()}),this.meshOriginMaterialMap.forEach(function(c){c.dispose()}),this.renderer instanceof InternalWebGLRenderer&&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 THREE__namespace.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",createEvent("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 InternalWebGLRenderer)){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 o=window.getComputedStyle(e).position;o!=="relative"&&o!=="absolute"&&o!=="fixed"&&o!=="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 o=i.parentNode;if(o&&o.nodeName){var s=e.width,u=s===void 0?o.offsetWidth:s,l=e.height,c=l===void 0?o.offsetHeight:l;this.renderer instanceof InternalWebGLRenderer&&(r&&this.renderer.setPixelRatio(r),this.renderer.setSize(u,c))}var d=new THREE__namespace.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 THREE__namespace.DepthTexture(d.x,d.y);f.generateMipmaps=!1,f.format=THREE__namespace.DepthStencilFormat,f.type=THREE__namespace.UnsignedInt248Type,this.modelRenderTarget.depthTexture=f,this.modelRenderTarget.depthTexture.needsUpdate=!0,this.needsRender=!0,this.modelSceneNeedsRender=!0,this.render(noop$1,!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,o=e.fov,s=e.offset,u=e.distance;return{longitude:r,latitude:i,fov:o,offset:s.clone(),distance:u}},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 THREE__namespace.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,cameraWorldToLocal(this.camera,r)}}return null},Object.defineProperty(t.prototype,"works",{get:function(){var e=worksMap.get(this);if(!e)return emptyWorks;for(var r=0,i=e;r<i.length;r++){var o=i[r];if(!workRawMapping.has(o))return emptyWorks}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,o){var s=this;if(o===void 0&&(o=!0),!this.renderer)throw new Error("renderer is not initialized");var u=this.lastLoadWorkTask.then(function(){return isPromise(e)?e.then(function(l){return s.load_(l,r,i,o)}):s.load_(e,r,i,o)});return this.lastLoadWorkTask=u.catch(function(l){s.throwError(l)}),u},t.prototype.load_=function(e,r,i,o){var s=this,u,l,c,d,f,m,A,h;o===void 0&&(o=!0);var p={};typeof i=="number"?p.duration=i:typeof i=="object"&&Object.assign(p,i),this.controller||(p.duration=0,p.effect="instant");var y=[];if(Array.isArray(e))for(var v=0,g=e;v<g.length;v++){var E=g[v];typeof E!="string"&&"work"in E?y.push(parseWork(E.work,E)):y.push(parseWork(E))}else y.push(parseWork(e));for(var b=createWorks(y),T=function(q){var j=_,X=new Fetcher({allowHosts:q.allowHosts,get requestProxy(){return j.requestProxy},get networkSubscribe(){return j.networkSubscribe}});registerFetcher(q,X)},_=this,x=0,R=b;x<R.length;x++){var w=R[x];T(w)}this.lastWorks=this.works,r===void 0&&(r="inherit"),r==="inherit"&&this.lastWorks.length===0&&(r="initial");var S=b.initial,C=S.work.observers[0],I=C?{workCode:C.work.workCode,panoIndex:C.panoIndex}:{workCode:S.work.workCode,panoIndex:0},H=(u=S.mode)!==null&&u!==void 0?u:C?"Panorama":"Mapview",B={};if(r==="inherit"){H=this.currentMode;var L=b.resolvedObservers[this.panoIndex];L?I={workCode:L.work.workCode,panoIndex:L.panoIndex}:typeof b.initial.panoIndex=="number"?I={workCode:b.initial.work.workCode,panoIndex:b.initial.panoIndex}:(H==="Panorama"||H==="VRPanorama"||H==="XRPanorama")&&(H="Mapview"),B={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"&&(I={workCode:S.work.workCode,panoIndex:S.panoIndex}),S.mode&&(H=S.mode),B={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(H=(c=r.mode)!==null&&c!==void 0?c:this.currentMode,typeof r.panoIndex=="number"){var L=b.getResolvedObserver({workCode:(f=(d=r.workCode)!==null&&d!==void 0?d:S.work.workCode)!==null&&f!==void 0?f:"",panoIndex:r.panoIndex});L&&(I={workCode:L.work.workCode,panoIndex:L.panoIndex})}B={longitude:r.longitude,latitude:r.latitude,fov:r.fov,distance:r.distance,offset:r.offset}}var O=__assign(__assign(__assign({},I),{mode:H}),B);this.emit("works.request",createEvent("works.request",{input:e,works:b,state:O,userAction:o}));var k=function(){var q,j;s.pano=I;var X=(q=p.duration)!==null&&q!==void 0?q:s.modeChangeDuration,ae=(j=p.effect)!==null&&j!==void 0?j:"fade",W=__assign(__assign({initial:{state:O,currentState:s.getCurrentState(),duration:X,effect:ae,userAction:o}},s.commonParams()),s.controllerInits[H]);if(s.controller&&s.currentMode===H)s.controller.updateWork(b,O,{effect:ae,duration:X},o)===!1&&(s.controller.destroy(),s.controller=s.applyController(H,W));else{var te=s.currentMode,ee=Controllers[H].initAnimationEndState(W);if(s.controller)s.controller.destroy();else{var ie=Controllers[H].initAnimationEndState(W);s.camera.setFromPose(ie),s.modelGroup.visible=!0,s.emit("camera.update",createEvent("camera.update",{state:s.getCurrentState(),userAction:o}))}s.controller=s.applyController(H,W);var $=createEvent("mode.change",{prevMode:te,mode:H,state:ee,userAction:o});s.emit("mode.change",$)}};if(worksMap.set(this,b),!this.controller){var K=__assign(__assign({initial:{state:O,currentState:this.getCurrentState(),duration:(m=p.duration)!==null&&m!==void 0?m:this.modeChangeDuration,effect:(A=p.effect)!==null&&A!==void 0?A:"fade",userAction:o}},this.commonParams()),this.controllerInits[H]),z=Controllers[H].initAnimationEndState(K);this.camera.setFromPose(z),this.emit("camera.update",createEvent("camera.update",{state:this.getCurrentState(),userAction:o}))}if(this.updateConfiguration(p,!1),H===t.Mode.Floorplan||H===t.Mode.Topview||H===t.Mode.Mapview||H===t.Mode.Model)this.loadModel(b,p).then(function(){s.needsRender=!0,s.modelSceneNeedsRender=!0,k(),s.emit("camera.update",createEvent("camera.update",{state:s.getCurrentState(),userAction:o}))});else{if(!this.controller){var N=new THREE__namespace.Vector3,U=b.getResolvedObserver(I);U&&N.copy(U.position),this.camera.setFromPose({fov:B.fov,longitude:B.longitude,latitude:B.latitude,distance:B.distance,offset:(h=B.offset)!==null&&h!==void 0?h:N}),this.needsRender=!0,this.modelSceneNeedsRender=!0}k();var Q=!1,G=function(){var q;s.needsRender=!0,s.modelSceneNeedsRender=!0,s.emit("camera.update",createEvent("camera.update",{state:s.getCurrentState(),userAction:o})),setTimeout(function(){s.works===b&&Q===!1&&(s.loadModel(b,p),Q=!0)},(q=p.duration)!==null&&q!==void 0?q:s.modeChangeDuration)};this.controller.once("pano.moveTo",G),this.controller.once("pano.cancel",G)}return this.emit("works.load",createEvent("works.load",{input:e,state:this.getCurrentState(),userAction:o,works:b})),this.ready().then(function(){var q;s.emit("works.ready",createEvent("works.ready",{input:e,state:s.getCurrentState(),userAction:o,works:b})),(q=s.analysis)===null||q===void 0||q.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 o=e.models.getMaterial();o&&(o.pano0&&o.pano0.map.dispose(),o.pano1&&o.pano1.map!==((i=o.pano0)===null||i===void 0?void 0:i.map)&&o.pano1.map.dispose()),e.models.setMaterial({pano0:null,pano1:null});for(var s=0,u=e.models;s<u.length;s++){var l=u[s];e.lastModels.push(l)}if(e.models.length=0,e.lastModels.length>0){for(var c=0,d=e.lastModels;c<d.length;c++){var l=d[c];e.modelGroup.remove(l),l.dispose(),e.needsRender=!0,e.modelSceneNeedsRender=!0}e.lastModels.length=0}e.lastWorks&&delete e.lastWorks,worksMap.delete(e),e.currentMode="Panorama",e.pano={workCode:"",panoIndex:0},e.camera.setFromPose({distance:0,fov:DEFAULT_CAMERA_FOV,longitude:0,latitude:0,offset:new THREE__namespace.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,o,s){var u=this;return r===void 0&&(r={}),o===void 0&&(o=!0),s===void 0&&(s=!1),new Promise(function(l,c){var d,f,m,A;if(!u.renderer)throw new Error("renderer is not initialized.");r=__assign({},r);var h=0;u.controller&&(typeof i=="number"?h=i:h=(d=i==null?void 0:i.duration)!==null&&d!==void 0?d:u.modeChangeDuration);var p="fly";u.controller&&typeof i=="object"&&i.effect&&(p=i.effect);var y=typeof r.panoIndex=="number"?{workCode:(A=(f=r.workCode)!==null&&f!==void 0?f:(m=u.work)===null||m===void 0?void 0:m.workCode)!==null&&A!==void 0?A:"",panoIndex:r.panoIndex}:u.pano;if(!t.Mode.hasOwnProperty(e)){var v=new Error('mode "'.concat(e,'" is not existed'));u.throwError(v),c(v);return}if((e===t.Mode.Floorplan||e===t.Mode.Topview||e===t.Mode.Mapview||e===t.Mode.Model)&&!u.models.loaded){var v=new Error("model is not ready.");u.throwError(v),c(v);return}if((e===t.Mode.Panorama||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama)&&!u.works.getResolvedObserver(y)){var v=new Error("PanoId ".concat(panoStringify(y)," not existed."));u.throwError(v),c(v);return}var g=u.controller,E=u.currentMode,b=function(){if(u.controller&&u.controller.stopMomentumMovement(),u.controller&&s===!1&&E===e)e===t.Mode.Panorama||e===t.Mode.Model||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama?panoEqual(u.pano,y)&&"moveToPano"in u.controller&&typeof u.controller.moveToPano=="function"?u.controller.moveToPano(y,__assign({duration:h},r),o):u.controller.updateCamera(r,h,o).catch(noop$1):(panoEqual(u.pano,y)||(u.pano=y),u.controller.updateCamera(r,h,o).catch(noop$1));else{var _=__assign(__assign({},r),y),x=__assign(__assign({initial:{state:_,currentState:u.getCurrentState(),duration:h,effect:p,userAction:o}},u.commonParams()),u.controllerInits[e]),R=Controllers[e].initAnimationEndState(x),w=createEvent("mode.change.request",{prevMode:u.currentMode,mode:e,state:R,userAction:o});if(u.emit("mode.change.request",w),!w.defaultPrevented){g&&g.destroy(),u.controller=u.applyController(e,x);var S=createEvent("mode.change",{prevMode:u.currentMode,mode:e,state:R,userAction:o});u.emit("mode.change",S)}}l()};if(e===t.Mode.VRPanorama)u.requestFullscreen(),requestDeviceOrientationPermission().then(function(){return b()}).catch(function(_){_ instanceof Error&&(u.exitFullscreen(),u.throwError(_),c(_))});else if(e===t.Mode.XRPanorama){var T=AnimationFrameLoop.shared.getContext();T?T.end():requestXRSessionPermission().then(function(_){AnimationFrameLoop.shared.setContext(_),b()}).catch(function(_){_ instanceof Error&&(u.throwError(_),c(_))})}else b()})},t.prototype.getPixels=function(e,r,i,o,s,u,l){if(!this.renderer)throw new Error("renderer is not initialized.");var c=this.renderer.getPixelRatio(),d=this.renderer.getRenderTarget(),f=this.renderer.getSize(new THREE__namespace.Vector2);e=Math.ceil(e),r=Math.ceil(r),i=Math.ceil(i),o=Math.ceil(o),s=Math.ceil(s!=null?s:c),u=u!=null?u:!1;var m=this.getPixelsRenderTarget;m.setSize(i*s,o*s),this.renderer.setRenderTarget(m),this.camera.setViewOffset(f.width,f.height,e,f.height-r-o,i,o),this.camera.pixelRatio=s,this.camera.resolution.set(i,o),this.camera.aspect=this.camera.resolution.width/this.camera.resolution.height;for(var A=0,h=this.scene.children;A<h.length;A++){var p=h[A];p instanceof THREE__namespace.Object3D&&p.traverseVisible(function(C){C.setResolution&&C.setResolution(i*s/c,o*s/c)})}this.controller?(this.controller.updateRenderSize(new THREE__namespace.Vector2(i*s,o*s)),this.controller.render(!0,this.postProcessingType)):(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 y=i*s,v=o*s,g=y*v,E=g*4,b;try{if(l){if(l.length!==E)throw new Error("buffer length is not equals pixels ".concat(E))}else l=new Uint8Array(E);if(this.renderer.readRenderTargetPixels(m,0,0,i*s,o*s,l),u)for(var T=g/2,_=0,x=0,R=0,w=0;x<T;x++)for(w=(v-Math.floor(x/y)-1)*y+x%y,R=0;R<4;R++)_=l[x*4+R],l[x*4+R]=l[w*4+R],l[w*4+R]=_}catch(C){b=C}if(this.renderer.setRenderTarget(d),this.controller&&this.controller.updateRenderSize){var S=new THREE__namespace.Vector2;this.renderer.getDrawingBufferSize(S),this.controller.updateRenderSize(S)}if(this.camera.clearViewOffset(),this.camera.pixelRatio=c,this.getSize(this.camera.resolution),this.camera.aspect=this.camera.resolution.width/this.camera.resolution.height,b)throw b;return l},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 o=this.renderer.getSize(sharedVector2);this.scene.traverseVisible(function(s){s.setResolution&&s.setResolution(o.x,o.y)})}return this.aroundScissor(function(){i.renderer&&(i.controller?(i.controller.render(i.onlyRenderIfNeeds?i.modelSceneNeedsRender:!0,i.postProcessingType),i.info={memory:__assign({},i.controller.renderer.info.memory),render:__assign({},i.controller.renderer.info.render)}):(i.renderer.render(i.scene,i.camera),i.info={memory:__assign({},i.renderer.info.memory),render:__assign({},i.renderer.info.render)}),i.poweredByRealsee&&i.currentMode!=="VRPanorama"&&i.currentMode!=="XRPanorama"&&i.renderer.getRenderTarget()!==i.getPixelsRenderTarget&&renderPoweredByRealsee(i.renderer)),e&&AnimationFrameLoop.shared.add(e,!0)}),null},t.prototype.updateTime=function(e,r){for(var i,o=this,s,u,l=[],c=2;c<arguments.length;c++)l[c-2]=arguments[c];if(!this.destroyed){if(this.works.update(),this.syncingState=this.syncState(e,r),this.controller&&(i=this.controller).updateTime.apply(i,__spreadArray([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){ktx2.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",createEvent("models.load",{models:this.models})),f===!1&&this.models.refined===!0&&this.emit("models.refined",createEvent("models.refined",{models:this.models})),this.models.loaded){for(var m=0,A=this.models;m<A.length;m++){var h=A[m];h.parent!==this.modelGroup&&(this.modelGroup.add(h),this.needsRender=!0,this.modelSceneNeedsRender=!0)}if(this.lastModels.length>0){for(var p=0,y=this.lastModels;p<y.length;p++){var h=y[p];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 v=new THREE__namespace.Vector2(512,512),g=new THREE__namespace.Vector2(512,512);this.renderer&&(this.renderer.getSize(v),v.x*=this.scissor.width,v.y*=this.scissor.height,this.renderer.getDrawingBufferSize(g),g.x*=this.scissor.width,g.y*=this.scissor.height);{for(var E=new THREE__namespace.Box3,b=new THREE__namespace.Box3,T=new THREE__namespace.Vector3(4,4,4),_=0,x=this.works.resolvedObservers;_<x.length;_++){var R=x[_];b.setFromCenterAndSize(R.position,T),E.union(b)}if(E.union(this.models.bounding),this.lastWorks)for(var w=0,S=this.lastWorks.resolvedObservers;w<S.length;w++){var R=S[w];b.setFromCenterAndSize(R.position,T),E.union(b)}E.union(this.lastModels.bounding),E.getCenter(this.boundingMesh.position),E.getSize(this.boundingMesh.scale),this.boundingMesh.boundingBox.copy(E);var C=(s=this.models.getMaterial())!==null&&s!==void 0?s:{},I=1-((u=C.modelAlpha)!==null&&u!==void 0?u:0);C.opacity=clamp$1(I*4-3,0,1),C.clippers=null,C.shownFloorIndex=-2,this.boundingMesh.setMaterial(C),this.boundingMesh.needsRender=!1}var H=createEvent("render.prepare",{needsRender:!0,info:null});if(this.emit("render.prepare",H),!H.defaultPrevented){var B=[];sharedProjScreenMatrix.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),sharedFrustum.setFromProjectionMatrix(sharedProjScreenMatrix);for(var L=0,O=this.scene.children;L<O.length;L++){var k=O[L];k!==this.modelGroup&&k!==this.boundingMesh&&k instanceof THREE__namespace.Object3D&&k.traverseVisible(function(G){if(G.setResolution&&G.setResolution(v.x,v.y),G.setTime&&G.setTime(e),G.mixer instanceof THREE__namespace.AnimationMixer){var q=clockForMixer.get(G.mixer);q||(q=new THREE__namespace.Clock,clockForMixer.set(G.mixer,q)),G.mixer.update(q.getDelta())}(G instanceof THREE__namespace.Mesh||G instanceof THREE__namespace.Line||G instanceof THREE__namespace.Points)&&(G instanceof THREE__namespace.ImmediateRenderObject||!G.frustumCulled||sharedFrustum.intersectsObject(G))&&B.push(G)})}if(g.width*g.height>4096*2048?this.renderSwitch01=this.renderSwitch01^1:this.renderSwitch01=0,this.renderer&&this.paused===!1&&this.renderSwitch01===0){var K=void 0;if(this.onlyRenderIfNeeds!==!0)K=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 z=0,N=B;z<N.length;z++){var U=N[z],Q=function(G){G.needsRender===!0?(G.needsRender=!1,o.needsRender=!0):G.mixer&&G.mixer.stats.actions.inUse>0&&(o.needsRender=!0)};Q(U),U.traverseAncestors(Q)}(this.needsRender!==!1||this.modelSceneNeedsRender!==!1)&&(K=this.render())}this.needsRender=!1,this.modelSceneNeedsRender=!1,this.hasListener("render")&&this.emit("render",createEvent("render",{needsRender:K!==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 InternalWebGLRenderer&&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 o=this,s=o.controller,u=o.renderer;if(!s)return this.throwError(new Error("controller is not initialized.")),Promise.resolve();if(!u)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 c={workCode:l.work.workCode,panoIndex:l.panoIndex};return"moveToPano"in s&&typeof s.moveToPano=="function"?s.moveToPano(c,r,i):l&&(this.pano=c,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=noop$1);var o=this.works.getResolvedObserver(e);if(!o)return Promise.reject(new Error("Pano ".concat(JSON.stringify(e)," never found")));var s=["right","left","up","down","front","back"],u=now();return Promise.all(s.map(function(l){var c=__assign({key:"pano.".concat(o.panoId,".").concat(l)},pick(i.imageOptions,["size","format","quality","mappings"])),d=o.images[l],f=i.imageOptions.transform?i.imageOptions.transform(d,c):imageURL(d,c);return getFetcher(o.work).preload(f)})).then(function(){var l=now()-u;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,o=e.clone().sub(i),s=new THREE__namespace.Raycaster(i,o.clone().normalize());s.params.Points={threshold:.1};var u=this.models.intersectRaycaster(s)[0];if(u&&u.distance+.01<o.length())return null}var l=e.clone().project(this.camera);if(Math.abs(l.z)>1)return null;var c=this.renderer.getSize(new THREE__namespace.Vector2),d=c.x*this.scissor.width,f=c.y*this.scissor.height,m=c.x*this.scissor.left+(l.x+1)/2*d,A=c.y*(1-this.scissor.bottom-this.scissor.height)+(-l.y+1)/2*f;return new THREE__namespace.Vector2(m,A)},t.prototype.getRenderObjects=function(e){sharedProjScreenMatrix.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),sharedFrustum.setFromProjectionMatrix(sharedProjScreenMatrix),e||(e=this.scene);var r=[];return e.traverseVisible(function(i){(i instanceof THREE__namespace.Mesh||i instanceof THREE__namespace.Line||i instanceof THREE__namespace.Points)&&(i instanceof THREE__namespace.ImmediateRenderObject||!i.frustumCulled||sharedFrustum.intersectsObject(i))&&r.push(i)}),r},t.prototype.getCurrentState=function(){return __assign(__assign({},this.getPose()),{mode:this.currentMode,workCode:this.pano.workCode,panoIndex:this.pano.panoIndex})},t.prototype.setState=function(e,r,i){var o,s,u,l,c,d,f,m,A,h;r===void 0&&(r=!1),i===void 0&&(i=!0),e=Object.assign({},e),e.offset&&!(e instanceof THREE__namespace.Vector3)&&(e.offset=new THREE__namespace.Vector3(e.offset.x,e.offset.y,e.offset.z));var p;typeof e.panoIndex=="number"&&(e.workCode?p={workCode:e.workCode,panoIndex:e.panoIndex}:p={workCode:(s=(o=this.work)===null||o===void 0?void 0:o.workCode)!==null&&s!==void 0?s:"",panoIndex:e.panoIndex});var y=(u=e.mode)!==null&&u!==void 0?u:this.state.mode,v,g,E,b,T;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 _={workCode:p==null?void 0:p.workCode,panoIndex:p==null?void 0:p.panoIndex};typeof e.longitude=="number"&&(_.longitude=e.longitude),typeof e.latitude=="number"&&(_.latitude=e.latitude),typeof e.fov=="number"&&(_.fov=e.fov),typeof e.distance=="number"&&(_.distance=e.distance),e.offset instanceof THREE__namespace.Vector3&&(_.offset=e.offset);var x=__assign(__assign({initial:{state:_,currentState:this.getCurrentState(),duration:this.modeChangeDuration,effect:"fly",userAction:!1}},this.commonParams()),this.controllerInits[y]),R=Controllers[y].initAnimationEndState(x);v=R.longitude,g=R.latitude,E=R.fov,b=R.offset,T=R.distance}else v=(l=e.longitude)!==null&&l!==void 0?l:this.state.longitude,g=(c=e.latitude)!==null&&c!==void 0?c:this.state.latitude,E=(d=e.fov)!==null&&d!==void 0?d:this.state.fov,b=(f=e.offset)!==null&&f!==void 0?f:this.state.offset,T=(m=e.distance)!==null&&m!==void 0?m:this.state.distance;var w={workCode:(p!=null?p:this.pano).workCode,panoIndex:(p!=null?p:this.pano).panoIndex,mode:y,longitude:v,latitude:g,fov:E,offset:b,distance:T};this.emit("state.set",createEvent("state.set",{userAction:i,state:w})),stateEqual(this.state,w)||(this.controller&&w.mode==="VRPanorama"&&w.mode!==this.state.mode?(assignState(this.state,w),this.changeMode("VRPanorama")):this.controller&&w.mode==="XRPanorama"&&w.mode!==this.state.mode?(assignState(this.state,w),this.changeMode("XRPanorama")):(assignState(this.state,w),this.controller&&i&&(this.controller.userAction=!1),r&&this.state.mode===w.mode&&(this.syncingState=this.syncState(now(),0,r),this.syncingState&&((A=this.controller)===null||A===void 0||A.updateTime(now(),0),this.syncingState=!1)),this.emit("state.change",createEvent("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 THREE__namespace.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 o=Math.floor(r.x*this.scissor.left),s=Math.floor(r.y*this.scissor.bottom),u=Math.floor(r.x*this.scissor.width),l=Math.floor(r.y*this.scissor.height);this.renderer.setViewport(o,s,u,l),this.renderer.setScissor(o,s,u,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 o=this.stateSynced;if(this.stateSynced=!1,this.works.length===0||!this.controller)return!1;if(this.state.mode!==this.currentMode){var s={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,s,this.modeChangeDuration,this.controller.userAction),!0}if(!this.controller.isReady())return!1;if(this.controller instanceof Controllers.Model){if(notSimilarVector3(this.camera.pose.offset,this.state.offset)){var u={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset};return this.controller.moveToPosition(this.state.offset,__assign(__assign({},u),{duration:i?0:void 0}),!1),!0}}else{var l={workCode:this.state.workCode,panoIndex:this.state.panoIndex};if(!panoEqual(l,this.pano)&&"moveToPano"in this.controller&&typeof this.controller.moveToPano=="function"){var u={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,u,!1),!0}}if(this.controller instanceof Controllers.Floorplan||this.controller instanceof Controllers.Topview||this.controller instanceof Controllers.Mapview){var c=1,d=.2,f=.2,m=Math.PI/45,A=i?this.state.fov:stepNumber(this.camera.pose.fov,this.state.fov,c),h=Math.abs(this.camera.pose.distance-this.state.distance),p=h>f*15?h/15:d,y=i?this.state.distance:stepNumber(this.camera.pose.distance,this.state.distance,p),v=this.camera.pose.offset.distanceTo(this.state.offset),g=v>f*15?v/15:f,E=i?new THREE__namespace.Vector3().copy(this.state.offset):stepVector(this.camera.pose.offset,this.state.offset,g),b=i?{longitude:this.state.longitude,latitude:this.state.latitude}:stepCoordinates({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},m),T=b.longitude,_=b.latitude;if(notSimilarValue(A,this.camera.pose.fov)||notSimilarVector3(E,this.camera.pose.offset)||notSimilarValue(y,this.camera.pose.distance)||notSimilarValue(T,this.camera.pose.longitude,Math.PI*2)||notSimilarValue(_,this.camera.pose.latitude)){var x={x:E.x,y:E.y,z:E.z},R={fov:A};return Object.assign(x,{distance:y}),Object.assign(R,{longitude:T,latitude:_}),this.controller.stopMomentumMovement(),this.controller.cameraMotion.set(R,0).catch(noop$1),this.controller.locationMotion.set(x,0).catch(noop$1),!0}}else{var w=1,S=Math.PI/45,A=i?this.state.fov:stepNumber(this.camera.pose.fov,this.state.fov,w),C=i?{longitude:this.state.longitude,latitude:this.state.latitude}:stepCoordinates({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},S),T=C.longitude,_=C.latitude,y=this.state.distance,E=new THREE__namespace.Vector3().copy(this.state.offset);if(notSimilarValue(y,this.camera.pose.distance)&&(this.state.distance=this.camera.pose.distance),notSimilarVector3(E,this.camera.pose.offset)&&(this.state.offset=this.camera.pose.offset.clone()),notSimilarValue(T,this.camera.pose.longitude,Math.PI*2)||notSimilarValue(_,this.camera.pose.latitude)||notSimilarValue(A,this.camera.pose.fov))return this.controller.stopMomentumMovement(),this.controller.cameraMotion.set({longitude:T,latitude:_,fov:A},0).catch(noop$1),!0}if(this.stateSynced=!0,o===!1&&this.emit("state.synced",createEvent("state.synced",{userAction:!1,state:this.state})),this.readyCallbacks.length&&this.stateSynced){var I=this.currentMode,H=I===t.Mode.Floorplan||I===t.Mode.Topview||I===t.Mode.Mapview||I===t.Mode.Model;if(!H||this.models.loaded){var B=this.readyCallbacks.slice();this.readyCallbacks.length=0;for(var L=0,O=B;L<O.length;L++){var k=O[L];this.controller instanceof Controllers.Panorama&&k.tile===!0&&!this.controller.isTileReady()?this.readyCallbacks.push(k):k()}}}return!1},t.prototype.ready=function(e){var r=this;return e===void 0&&(e={}),new Promise(function(i){var o;r.readyCallbacks.push(Object.assign(i,{tile:(o=e.tile)!==null&&o!==void 0?o:!1}))})},t.prototype.requestFullscreen=function(){var e;if(isMobile()){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,o=[],s=function(y){var v=u.models.filter(function(E){var b;return((b=E.work)===null||b===void 0?void 0:b.workCode)===y.workCode})[0];if(v)v.work=y,o.push(v);else{var g=new Model({onError:function(E){i.emit("model.error",createEvent("model.error",{work:y,model:g,error:E})),i.throwError(E)},onShownFloorChange:function(E){i.emit("model.changeShownFloor",createEvent("model.changeShownFloor",{work:y,model:g,error:null}))},onLoad:function(){i.emit("model.load",createEvent("model.load",{work:y,model:g,error:null}))}});o.push(g),u.emit("model.request",createEvent("model.request",{work:y,model:g,error:null})),g.load(y,{textureOptions:u.textureOptions,"3d-tiles":r["3d-tiles"]})}},u=this,l=0,c=e;l<c.length;l++){var d=c[l];s(d)}if(this.models.length>0){for(var f=0,m=this.models;f<m.length;f++){var A=m[f];o.indexOf(A)===-1&&this.lastModels.push(A)}this.models.length=0}for(var h=0,p=o;h<p.length;h++){var A=p[h];this.models.push(A)}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 o=Controllers[e];this.currentMode=e;for(var s=new o(r),u=function(A){s.on(A,function(){for(var h=[],p=0;p<arguments.length;p++)h[p]=arguments[p];var y=i.emit.apply(i,__spreadArray([A],h,!1));if(y)return!1})},l=0,c=PROXY_CONTROLLER_EVENT_NAMES;l<c.length;l++){var d=c[l];u(d)}{var f=Controllers[e].initAnimationEndState(r),m=r.initial.userAction;stateEqual(this.state,f)||(assignState(this.state,f),this.emit("state.change",createEvent("state.change",{userAction:m,state:this.state}))),this.emit("currentState.change",createEvent("currentState.change",{userAction:m,state:this.getCurrentState()}))}return s.on("camera.update",function(A){var h;if(i.controller){var p=i.controller.getTargetState();A.userAction&&i.syncingState===!1&&i.state.mode===p.mode&&!stateEqual(i.state,p)&&(assignState(i.state,p),i.emit("state.change",createEvent("state.change",{userAction:A.userAction,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}i.emit("currentState.change",createEvent("currentState.change",{userAction:A.userAction,state:i.getCurrentState()}))}),s.on("initAnimation.start",function(A){var h,p=A.state,y=A.userAction;y&&i.state.mode===p.mode&&!stateEqual(i.state,p)&&(assignState(i.state,p),i.emit("state.change",createEvent("state.change",{userAction:y,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),s.on("initAnimation.end",function(A){var h,p=A.state,y=A.userAction;y&&i.state.mode===p.mode&&!stateEqual(i.state,p)&&(assignState(i.state,p),i.emit("state.change",createEvent("state.change",{userAction:y,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),s.on("pano.moveTo",function(A){var h,p=A.state,y=A.userAction;i.pano={workCode:p.workCode,panoIndex:p.panoIndex},y&&i.state.mode===p.mode&&!stateEqual(i.state,p)&&(assignState(i.state,p),i.emit("state.change",createEvent("state.change",{userAction:y,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),s.on("pano.arrived",function(A){var h,p=A.state,y=A.userAction;y&&i.state.mode===p.mode&&!stateEqual(i.state,p)&&(assignState(i.state,p),i.emit("state.change",createEvent("state.change",{userAction:y,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),s.on("pano.cancel",function(A){var h,p=A.state,y=A.userAction;y&&i.state.mode===p.mode&&!stateEqual(i.state,p)&&(assignState(i.state,p),i.emit("state.change",createEvent("state.change",{userAction:y,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),s.on("pano.moveTo",function(A){var h=A.userAction;i.emit("currentState.change",createEvent("currentState.change",{userAction:h,state:i.getCurrentState()}))}),s.on("pano.request",function(A){i.emit("pano.request",A),A.defaultPrevented||i.moveToPano(A.state,A.options,A.userAction)}),s.on("vr.requestExit",function(){i.currentMode===t.Mode.VRPanorama&&(i.exitFullscreen(),i.changeMode(t.Mode.Panorama))}),s.on("error",function(A){return i.throwError(A)}),s},t.prototype.removeEventListeners=function(){},t.prototype.getWorkResources=function(e){var r=this,i,o=this.models.find(function(c){return c.work===e}),s=((i=o==null?void 0:o.viewLayers)!==null&&i!==void 0?i:[]).map(function(c){return c.scene});function u(c){var d=/([0-9a-z\.\_\-]+)([\?\#].*)?$/i.exec(c);if(d){var f=String(d[1]).trim().split(".").slice(1).reverse()[0];if(f)return f}return""}function l(c,d){d===void 0&&(d=0);var f=[];if(c.content&&c.content.uri){var m=u(c.content.uri);if(m==="json"){var A=imageURL(c.content.uri,{key:"model.".concat(d)});f.push({url:A,type:"tileset"})}else if(m==="at3d"&&c.extras[m]){var A=c.content.uri;f.push({url:A,type:"model"});for(var h=c.extras[m],p=h.textureArray,y=h.textureOptions,v=0,g=p;v<g.length;v++){var E=g[v],b=__assign({key:"texture.pbm"},pick(y,["format","quality","size","sharpen","mappings"])),T=applyImageURLOptions(E,y==null?void 0:y.transform,b);f.push({url:T,type:"texture"})}}else{var A=imageURL(c.content.uri,{key:"model.".concat(d)});f.push({url:A,type:"model"})}}if(c.children)for(var _=0;_<c.children.length;_++){var x=c.children[_];f.push.apply(f,l(x,_))}return f}return Promise.all(s.map(function(c){return c.loadAllTilesets()})).then(function(){for(var c=[],d=["right","left","up","down","front","back"],f=0,m=e.observers;f<m.length;f++){for(var A=m[f],h=0,p=d;h<p.length;h++){var y=p[h],v=__assign({key:"pano.".concat(panoStringify(A.pano),".").concat(y)},pick(r.imageOptions,["size","format","quality","mappings"])),g=A.images[y],E=applyImageURLOptions(g,r.imageOptions.transform,v);c.push({url:E,type:"pano"})}if(A.images.tiles)for(var b=0,T=A.images.tiles;b<T.length;b++)for(var _=T[b],x=0,R=d;x<R.length;x++)for(var y=R[x],w=_.size,S=Math.pow(2,_.level),C=1/S,I=0;I<S;I++)for(var H=0;H<S;H++){var B="".concat(A.panoId,".").concat(y,".").concat(_.level,".").concat(I,".").concat(H),v=__assign(__assign({key:"pano_tile.".concat(B)},pick(r.imageOptions,["format","size","quality","sharpen","mappings"])),{size:_.scale>=1?void 0:w*C*_.scale,cut:[w*C*H,w*C*I,w*C,w*C]}),E=applyImageURLOptions(_[y],r.imageOptions.transform,v);c.push({url:E,type:"pano_tile"})}}for(var L=0,O=s;L<O.length;L++){var k=O[L];k.tileset.url&&c.push({url:k.tileset.url,type:"model"}),c.push.apply(c,l(k.tileset.root))}return c})},t.Mode={Panorama:"Panorama",Model:"Model",Floorplan:"Floorplan",Topview:"Topview",Mapview:"Mapview",VRPanorama:"VRPanorama",XRPanorama:"XRPanorama"},t.Line=null,t}(Subscribe),__FIVE_DEBUG__={instances:{},constructor:Five};typeof window!="undefined"&&Object.assign(window,{__FIVE_DEBUG__});var XRButton=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 o(){i(),e.textContent="VR NOT SUPPORTED"}function s(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",s(e),navigator.xr.isSessionSupported("immersive-vr").then(function(l){l?r():o()}),e;var u=document.createElement("a");return window.isSecureContext===!1?(u.href=document.location.href.replace(/^http:/,"https:"),u.innerHTML="WEBXR NEEDS HTTPS"):(u.href="https://immersiveweb.dev/",u.innerHTML="WEBXR NOT AVAILABLE"),u.style.left="calc(50% - 90px)",u.style.width="180px",u.style.textDecoration="none",s(u),u},n}();exports.AnimationFrameLoop=AnimationFrameLoop,exports.Camera=Camera,exports.Fetcher=Fetcher,exports.Five=Five,exports.InternalWebGLRenderer=InternalWebGLRenderer,exports.IntersectMesh=IntersectMesh,exports.Model=Model,exports.ModelViewLayer=ModelViewLayer,exports.NetworkSubscribe=NetworkSubscribe,exports.PBMContainer=PBMContainer,exports.PBMGroup=PBMGroup,exports.PBMMesh=PBMMesh,exports.PBMMeshMaterial=PBMMeshMaterial,exports.PROXY_CONTROLLER_EVENT_NAMES=PROXY_CONTROLLER_EVENT_NAMES,exports.PanoCircleMesh=PanoCircleMesh,exports.PanoCircleMeshCustom=PanoCircleMeshCustom,exports.PanoCircleMeshSolid=PanoCircleMeshSolid,exports.Scene=Scene,exports.Subscribe=Subscribe,exports.TextureLoader=TextureLoader,exports.Tile=Tile,exports.Tile3DModel=Tile3DModel,exports.TileCache=TileCache,exports.TileCubeTextureTarget=TileCubeTextureTarget,exports.TileNode=TileNode,exports.TileRequestScheduler=TileRequestScheduler,exports.Tileset=Tileset,exports.Work=Work,exports.XRButton=XRButton,exports.defaultImageURLTransform=imageURL,exports.defaultPbmParameters=defaultPbmParameters,exports.getViewportScale=getViewportScale,exports.imageSupport=imageSupport,exports.isPanoId=isPanoId,exports.loadAt3d=loadAt3d,exports.loadB3dm=loadB3dm,exports.loadDome=loadDome,exports.loadDomez=loadDomez,exports.loadGlb=loadGlb,exports.loadPbm=loadPbm,exports.loadPnts=loadPnts,exports.panoEqual=panoEqual,exports.panoParse=panoParse,exports.panoStringify=panoStringify,exports.parseWork=parseWork,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});
2071
+ `});A.depthTest=f.material.depthTest,A.side=f.material.side,u.meshReplaceMaterialMap.set(v,A),f.material=A}}});var c=this.renderer.getSize(new THREE__namespace.Vector2);this.camera.setViewOffset(c.width,c.height,e*o,r*o,1,1),this.renderer.setRenderTarget(this.gpuPickingRenderTarget),this.render();var l=new Uint8Array(4);this.renderer.readRenderTargetPixels(this.gpuPickingRenderTarget,0,0,1,1,l),this.renderer.setRenderTarget(null),this.camera.clearViewOffset(),this.scene.traverse(function(f){!(f instanceof THREE__namespace.Mesh)||f instanceof PBMMesh||u.meshOriginMaterialMap.get(f.uuid)&&(f.material=u.meshOriginMaterialMap.get(f.uuid))}),this.models.setMaterial({constantColor:null});var d=Object.keys(i).filter(function(f){return i[f].equals(new THREE__namespace.Color().setRGB(l[0]/255,l[1]/255,l[2]/255))})[0];return d||!1},t.prototype.dispose=function(){var e,r;if(this.destroyed!==!0){delete __FIVE_DEBUG__.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 o=this.models.getMaterial();o&&(o.pano0&&o.pano0.map.dispose(),o.pano1&&o.pano1.map!==((r=o.pano0)===null||r===void 0?void 0:r.map)&&o.pano1.map.dispose());for(var s=0,u=this.models;s<u.length;s++){var c=u[s];c.dispose()}this.models.length=0,this.models.setMaterial({pano0:null,pano1:null}),this.meshReplaceMaterialMap.forEach(function(l){l.dispose()}),this.meshOriginMaterialMap.forEach(function(l){l.dispose()}),this.renderer instanceof InternalWebGLRenderer&&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 THREE__namespace.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",createEvent("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 InternalWebGLRenderer)){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 o=window.getComputedStyle(e).position;o!=="relative"&&o!=="absolute"&&o!=="fixed"&&o!=="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 o=i.parentNode;if(o&&o.nodeName){var s=e.width,u=s===void 0?o.offsetWidth:s,c=e.height,l=c===void 0?o.offsetHeight:c;this.renderer instanceof InternalWebGLRenderer&&(r&&this.renderer.setPixelRatio(r),this.renderer.setSize(u,l))}var d=new THREE__namespace.Vector2;if(this.renderer.getDrawingBufferSize(d),this.controller&&this.controller.updateRenderSize&&this.controller.updateRenderSize(d),this.modelRenderTarget.width!==d.x||this.modelRenderTarget.height!==d.y){this.modelRenderTarget.setSize(d.x,d.y),this.modelRenderTarget.depthTexture.dispose();var f=new THREE__namespace.DepthTexture(d.x,d.y);f.generateMipmaps=!1,f.format=THREE__namespace.DepthStencilFormat,f.type=THREE__namespace.UnsignedInt248Type,this.modelRenderTarget.depthTexture=f,this.modelRenderTarget.depthTexture.needsUpdate=!0}this.needsRender=!0,this.modelSceneNeedsRender=!0,this.render(noop$1,!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,o=e.fov,s=e.offset,u=e.distance;return{longitude:r,latitude:i,fov:o,offset:s.clone(),distance:u}},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 THREE__namespace.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,cameraWorldToLocal(this.camera,r)}}return null},Object.defineProperty(t.prototype,"works",{get:function(){var e=worksMap.get(this);if(!e)return emptyWorks;for(var r=0,i=e;r<i.length;r++){var o=i[r];if(!workRawMapping.has(o))return emptyWorks}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,o){var s=this;if(o===void 0&&(o=!0),!this.renderer)throw new Error("renderer is not initialized");var u=this.lastLoadWorkTask.then(function(){return isPromise(e)?e.then(function(c){return s.load_(c,r,i,o)}):s.load_(e,r,i,o)});return this.lastLoadWorkTask=u.catch(function(c){s.throwError(c)}),u},t.prototype.load_=function(e,r,i,o){var s=this,u,c,l,d,f,v,A,h,p;o===void 0&&(o=!0);var y={};typeof i=="number"?y.duration=i:typeof i=="object"&&Object.assign(y,i),this.controller||(y.duration=0,y.effect="instant");var m=[];if(Array.isArray(e))for(var g=0,E=e;g<E.length;g++){var b=E[g];typeof b!="string"&&"work"in b?m.push(parseWork(b.work,b)):m.push(parseWork(b))}else m.push(parseWork(e));for(var T=createWorks(m),_=function(J){var j=S,re=new Fetcher({allowHosts:J.allowHosts,get requestProxy(){return j.requestProxy},get networkSubscribe(){return j.networkSubscribe}});registerFetcher(J,re)},S=this,R=0,B=T;R<B.length;R++){var I=B[R];_(I)}this.lastWorks=this.works,r===void 0&&(r="inherit"),r==="inherit"&&this.lastWorks.length===0&&(r="initial");var x=T.initial,M=x.work.observers[0],L=M?{workCode:M.work.workCode,panoIndex:M.panoIndex}:{workCode:x.work.workCode,panoIndex:0},C=(u=x.mode)!==null&&u!==void 0?u:M?"Panorama":"Mapview",H={};if(r==="inherit"){C=this.currentMode;var F=T.resolvedObservers[this.panoIndex];F?L={workCode:F.work.workCode,panoIndex:F.panoIndex}:typeof T.initial.panoIndex=="number"?L={workCode:T.initial.work.workCode,panoIndex:T.initial.panoIndex}:(C==="Panorama"||C==="VRPanorama"||C==="XRPanorama")&&(C="Mapview"),H={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 x.panoIndex=="number"&&(L={workCode:x.work.workCode,panoIndex:x.panoIndex}),x.mode&&(C=x.mode),H={longitude:x.longitude,latitude:x.latitude,fov:x.fov,distance:x.distance,offset:(c=x.offset)===null||c===void 0?void 0:c.clone()};else{if(C=(l=r.mode)!==null&&l!==void 0?l:this.currentMode,typeof r.panoIndex=="number"){var F=T.getResolvedObserver({workCode:(f=(d=r.workCode)!==null&&d!==void 0?d:x.work.workCode)!==null&&f!==void 0?f:"",panoIndex:r.panoIndex});F&&(L={workCode:F.work.workCode,panoIndex:F.panoIndex})}H={longitude:r.longitude,latitude:r.latitude,fov:r.fov,distance:r.distance,offset:r.offset}}var O=__assign(__assign(__assign({},L),{mode:C}),H);this.emit("works.request",createEvent("works.request",{input:e,works:T,state:O,userAction:o}));var G=function(){var J,j;s.pano=L;var re=(J=y.duration)!==null&&J!==void 0?J:s.modeChangeDuration,W=(j=y.effect)!==null&&j!==void 0?j:"fade",te=__assign(__assign({initial:{state:O,currentState:s.getCurrentState(),duration:re,effect:W,userAction:o}},s.commonParams()),s.controllerInits[C]);if(s.controller&&s.currentMode===C)s.controller.updateWork(T,O,{effect:W,duration:re},o)===!1&&(s.controller.destroy(),s.controller=s.applyController(C,te));else{var $=s.currentMode,ne=Controllers[C].initAnimationEndState(te);if(s.controller)s.controller.destroy();else{var ee=Controllers[C].initAnimationEndState(te);s.camera.setFromPose(ee),s.modelGroup.visible=!0,s.emit("camera.update",createEvent("camera.update",{state:s.getCurrentState(),userAction:o}))}s.controller=s.applyController(C,te);var ce=createEvent("mode.change",{prevMode:$,mode:C,state:ne,userAction:o});s.emit("mode.change",ce)}};if(worksMap.set(this,T),!this.controller){var Q=__assign(__assign({initial:{state:O,currentState:this.getCurrentState(),duration:(v=y.duration)!==null&&v!==void 0?v:this.modeChangeDuration,effect:(A=y.effect)!==null&&A!==void 0?A:"fade",userAction:o}},this.commonParams()),this.controllerInits[C]),U=Controllers[C].initAnimationEndState(Q);this.camera.setFromPose(U),this.emit("camera.update",createEvent("camera.update",{state:this.getCurrentState(),userAction:o}))}if(this.updateConfiguration(y,!1),C===t.Mode.Floorplan||C===t.Mode.Topview||C===t.Mode.Mapview||C===t.Mode.Model)this.loadModel(T,y).then(function(){s.needsRender=!0,s.modelSceneNeedsRender=!0,G(),s.emit("camera.update",createEvent("camera.update",{state:s.getCurrentState(),userAction:o}))});else{if(!this.controller){var D=new THREE__namespace.Vector3,q=T.getResolvedObserver(L);q&&D.copy(q.position),this.camera.setFromPose({fov:H.fov,longitude:H.longitude,latitude:H.latitude,distance:H.distance,offset:(h=H.offset)!==null&&h!==void 0?h:D}),this.needsRender=!0,this.modelSceneNeedsRender=!0}G();var z=!1,K=function(){s.works===T&&z===!1&&(s.needsRender=!0,s.modelSceneNeedsRender=!0,s.emit("camera.update",createEvent("camera.update",{state:s.getCurrentState(),userAction:o})),s.loadModel(T,y),z=!0)};this.controller.once("pano.arrived",K),this.controller.once("pano.cancel",K),setTimeout(K,((p=y.duration)!==null&&p!==void 0?p:this.modeChangeDuration)+1e3)}return this.emit("works.load",createEvent("works.load",{input:e,state:this.getCurrentState(),userAction:o,works:T})),this.ready().then(function(){var J;s.emit("works.ready",createEvent("works.ready",{input:e,state:s.getCurrentState(),userAction:o,works:T})),(J=s.analysis)===null||J===void 0||J.work(T)})},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 o=e.models.getMaterial();o&&(o.pano0&&o.pano0.map.dispose(),o.pano1&&o.pano1.map!==((i=o.pano0)===null||i===void 0?void 0:i.map)&&o.pano1.map.dispose()),e.models.setMaterial({pano0:null,pano1:null});for(var s=0,u=e.models;s<u.length;s++){var c=u[s];e.lastModels.push(c)}if(e.models.length=0,e.lastModels.length>0){for(var l=0,d=e.lastModels;l<d.length;l++){var c=d[l];e.modelGroup.remove(c),c.dispose(),e.needsRender=!0,e.modelSceneNeedsRender=!0}e.lastModels.length=0}e.lastWorks&&delete e.lastWorks,worksMap.delete(e),e.currentMode="Panorama",e.pano={workCode:"",panoIndex:0},e.camera.setFromPose({distance:0,fov:DEFAULT_CAMERA_FOV,longitude:0,latitude:0,offset:new THREE__namespace.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,o,s){var u=this;return r===void 0&&(r={}),o===void 0&&(o=!0),s===void 0&&(s=!1),new Promise(function(c,l){var d,f,v,A;if(!u.renderer)throw new Error("renderer is not initialized.");r=__assign({},r);var h=0;u.controller&&(typeof i=="number"?h=i:h=(d=i==null?void 0:i.duration)!==null&&d!==void 0?d:u.modeChangeDuration);var p="fly";u.controller&&typeof i=="object"&&i.effect&&(p=i.effect);var y=typeof r.panoIndex=="number"?{workCode:(A=(f=r.workCode)!==null&&f!==void 0?f:(v=u.work)===null||v===void 0?void 0:v.workCode)!==null&&A!==void 0?A:"",panoIndex:r.panoIndex}:u.pano;if(!t.Mode.hasOwnProperty(e)){var m=new Error('mode "'.concat(e,'" is not existed'));u.throwError(m),l(m);return}if((e===t.Mode.Floorplan||e===t.Mode.Topview||e===t.Mode.Mapview||e===t.Mode.Model)&&!u.models.loaded){var m=new Error("model is not ready.");u.throwError(m),l(m);return}if((e===t.Mode.Panorama||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama)&&!u.works.getResolvedObserver(y)){var m=new Error("PanoId ".concat(panoStringify(y)," not existed."));u.throwError(m),l(m);return}var g=u.controller,E=u.currentMode,b=function(){if(u.controller&&u.controller.stopMomentumMovement(),u.controller&&s===!1&&E===e)e===t.Mode.Panorama||e===t.Mode.Model||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama?panoEqual(u.pano,y)&&"moveToPano"in u.controller&&typeof u.controller.moveToPano=="function"?u.controller.moveToPano(y,__assign({duration:h},r),o):u.controller.updateCamera(r,h,o).catch(noop$1):(panoEqual(u.pano,y)||(u.pano=y),u.controller.updateCamera(r,h,o).catch(noop$1));else{var _=__assign(__assign({},r),y),S=__assign(__assign({initial:{state:_,currentState:u.getCurrentState(),duration:h,effect:p,userAction:o}},u.commonParams()),u.controllerInits[e]),R=Controllers[e].initAnimationEndState(S),B=createEvent("mode.change.request",{prevMode:u.currentMode,mode:e,state:R,userAction:o});if(u.emit("mode.change.request",B),!B.defaultPrevented){g&&g.destroy(),u.controller=u.applyController(e,S);var I=createEvent("mode.change",{prevMode:u.currentMode,mode:e,state:R,userAction:o});u.emit("mode.change",I)}}c()};if(e===t.Mode.VRPanorama)u.requestFullscreen(),requestDeviceOrientationPermission().then(function(){return b()}).catch(function(_){_ instanceof Error&&(u.exitFullscreen(),u.throwError(_),l(_))});else if(e===t.Mode.XRPanorama){var T=AnimationFrameLoop.shared.getContext();T?T.end():requestXRSessionPermission().then(function(_){AnimationFrameLoop.shared.setContext(_),b()}).catch(function(_){_ instanceof Error&&(u.throwError(_),l(_))})}else b()})},t.prototype.getPixels=function(e,r,i,o,s,u,c){if(!this.renderer)throw new Error("renderer is not initialized.");var l=this.renderer.getPixelRatio(),d=this.renderer.getRenderTarget(),f=this.renderer.getSize(new THREE__namespace.Vector2);e=Math.ceil(e),r=Math.ceil(r),i=Math.ceil(i),o=Math.ceil(o),s=Math.ceil(s!=null?s:l),u=u!=null?u:!1;var v=this.getPixelsRenderTarget;v.setSize(i*s,o*s),this.renderer.setRenderTarget(v),this.camera.setViewOffset(f.width,f.height,e,f.height-r-o,i,o),this.camera.pixelRatio=s,this.camera.resolution.set(i,o),this.camera.aspect=this.camera.resolution.width/this.camera.resolution.height;for(var A=0,h=this.scene.children;A<h.length;A++){var p=h[A];p instanceof THREE__namespace.Object3D&&p.traverseVisible(function(x){x.setResolution&&x.setResolution(i*s/l,o*s/l)})}this.controller?(this.controller.updateRenderSize(new THREE__namespace.Vector2(i*s,o*s)),this.controller.render(!0,this.postProcessingType)):(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 y=i*s,m=o*s,g=y*m,E=g*4,b;try{if(c){if(c.length!==E)throw new Error("buffer length is not equals pixels ".concat(E))}else c=new Uint8Array(E);if(this.renderer.readRenderTargetPixels(v,0,0,i*s,o*s,c),u)for(var T=g/2,_=0,S=0,R=0,B=0;S<T;S++)for(B=(m-Math.floor(S/y)-1)*y+S%y,R=0;R<4;R++)_=c[S*4+R],c[S*4+R]=c[B*4+R],c[B*4+R]=_}catch(x){b=x}if(this.renderer.setRenderTarget(d),this.controller&&this.controller.updateRenderSize){var I=new THREE__namespace.Vector2;this.renderer.getDrawingBufferSize(I),this.controller.updateRenderSize(I)}if(this.camera.clearViewOffset(),this.camera.pixelRatio=l,this.getSize(this.camera.resolution),this.camera.aspect=this.camera.resolution.width/this.camera.resolution.height,b)throw b;return c},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 o=this.renderer.getSize(sharedVector2);this.scene.traverseVisible(function(s){s.setResolution&&s.setResolution(o.x,o.y)})}return this.aroundScissor(function(){i.renderer&&(i.controller?(i.controller.render(i.onlyRenderIfNeeds?i.modelSceneNeedsRender:!0,i.postProcessingType),i.info={memory:__assign({},i.controller.renderer.info.memory),render:__assign({},i.controller.renderer.info.render)}):(i.renderer.render(i.scene,i.camera),i.info={memory:__assign({},i.renderer.info.memory),render:__assign({},i.renderer.info.render)}),i.poweredByRealsee&&i.currentMode!=="VRPanorama"&&i.currentMode!=="XRPanorama"&&i.renderer.getRenderTarget()!==i.getPixelsRenderTarget&&renderPoweredByRealsee(i.renderer)),e&&AnimationFrameLoop.shared.add(e,!0)}),null},t.prototype.updateTime=function(e,r){for(var i,o=this,s,u,c=[],l=2;l<arguments.length;l++)c[l-2]=arguments[l];if(!this.destroyed){if(this.works.update(),this.syncingState=this.syncState(e,r),this.controller&&(i=this.controller).updateTime.apply(i,__spreadArray([e,r],c,!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){ktx2.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",createEvent("models.load",{models:this.models})),f===!1&&this.models.refined===!0&&this.emit("models.refined",createEvent("models.refined",{models:this.models})),this.models.loaded){for(var v=0,A=this.models;v<A.length;v++){var h=A[v];h.parent!==this.modelGroup&&(this.modelGroup.add(h),this.needsRender=!0,this.modelSceneNeedsRender=!0)}if(this.lastModels.length>0){for(var p=0,y=this.lastModels;p<y.length;p++){var h=y[p];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 m=new THREE__namespace.Vector2(512,512),g=new THREE__namespace.Vector2(512,512);this.renderer&&(this.renderer.getSize(m),m.x*=this.scissor.width,m.y*=this.scissor.height,this.renderer.getDrawingBufferSize(g),g.x*=this.scissor.width,g.y*=this.scissor.height);{for(var E=new THREE__namespace.Box3,b=new THREE__namespace.Box3,T=new THREE__namespace.Vector3(4,4,4),_=0,S=this.works.resolvedObservers;_<S.length;_++){var R=S[_];b.setFromCenterAndSize(R.position,T),E.union(b)}if(E.union(this.models.bounding),this.lastWorks)for(var B=0,I=this.lastWorks.resolvedObservers;B<I.length;B++){var R=I[B];b.setFromCenterAndSize(R.position,T),E.union(b)}E.union(this.lastModels.bounding),E.getCenter(this.boundingMesh.position),E.getSize(this.boundingMesh.scale),this.boundingMesh.boundingBox.copy(E);var x=(s=this.models.getMaterial())!==null&&s!==void 0?s:{},M=1-((u=x.modelAlpha)!==null&&u!==void 0?u:0);x.opacity=clamp$1(M*4-3,0,1),x.clippers=null,x.shownFloorIndex=-2,this.boundingMesh.setMaterial(x),this.boundingMesh.needsRender=!1}var L=createEvent("render.prepare",{needsRender:!0,info:null});if(this.emit("render.prepare",L),!L.defaultPrevented){var C=[];sharedProjScreenMatrix.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),sharedFrustum.setFromProjectionMatrix(sharedProjScreenMatrix);for(var H=0,F=this.scene.children;H<F.length;H++){var O=F[H];O!==this.modelGroup&&O!==this.boundingMesh&&O instanceof THREE__namespace.Object3D&&O.traverseVisible(function(z){if(z.setResolution&&z.setResolution(m.x,m.y),z.setTime&&z.setTime(e),z.mixer instanceof THREE__namespace.AnimationMixer){var K=clockForMixer.get(z.mixer);K||(K=new THREE__namespace.Clock,clockForMixer.set(z.mixer,K)),z.mixer.update(K.getDelta())}(z instanceof THREE__namespace.Mesh||z instanceof THREE__namespace.Line||z instanceof THREE__namespace.Points)&&(z instanceof THREE__namespace.ImmediateRenderObject||!z.frustumCulled||sharedFrustum.intersectsObject(z))&&C.push(z)})}if(g.width*g.height>4096*2048?this.renderSwitch01=this.renderSwitch01^1:this.renderSwitch01=0,this.renderer&&this.paused===!1&&this.renderSwitch01===0){var G=void 0;if(this.onlyRenderIfNeeds!==!0)G=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 Q=0,U=C;Q<U.length;Q++){var D=U[Q],q=function(z){z.needsRender===!0?(z.needsRender=!1,o.needsRender=!0):z.mixer&&z.mixer.stats.actions.inUse>0&&(o.needsRender=!0)};q(D),D.traverseAncestors(q)}(this.needsRender!==!1||this.modelSceneNeedsRender!==!1)&&(G=this.render())}this.needsRender=!1,this.modelSceneNeedsRender=!1,this.hasListener("render")&&this.emit("render",createEvent("render",{needsRender:G!==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 InternalWebGLRenderer&&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 o=this,s=o.controller,u=o.renderer;if(!s)return this.throwError(new Error("controller is not initialized.")),Promise.resolve();if(!u)return this.throwError(new Error("renderer is not initialized.")),Promise.resolve();var c=this.works.getResolvedObserver(e);if(!c)return this.throwError(new Error("pano ".concat(JSON.stringify(e)," not existed."))),Promise.resolve();var l={workCode:c.work.workCode,panoIndex:c.panoIndex};return"moveToPano"in s&&typeof s.moveToPano=="function"?s.moveToPano(l,r,i):c&&(this.pano=l,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=noop$1);var o=this.works.getResolvedObserver(e);if(!o)return Promise.reject(new Error("Pano ".concat(JSON.stringify(e)," never found")));var s=["right","left","up","down","front","back"],u=now();return Promise.all(s.map(function(c){var l=__assign({key:"pano.".concat(o.panoId,".").concat(c)},pick(i.imageOptions,["size","format","quality","mappings"])),d=o.images[c],f=i.imageOptions.transform?i.imageOptions.transform(d,l):imageURL(d,l);return getFetcher(o.work).preload(f)})).then(function(){var c=now()-u;return r(c),c})},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,o=e.clone().sub(i),s=new THREE__namespace.Raycaster(i,o.clone().normalize());s.params.Points={threshold:.1};var u=this.models.intersectRaycaster(s)[0];if(u&&u.distance+.01<o.length())return null}var c=e.clone().project(this.camera);if(Math.abs(c.z)>1)return null;var l=this.renderer.getSize(new THREE__namespace.Vector2),d=l.x*this.scissor.width,f=l.y*this.scissor.height,v=l.x*this.scissor.left+(c.x+1)/2*d,A=l.y*(1-this.scissor.bottom-this.scissor.height)+(-c.y+1)/2*f;return new THREE__namespace.Vector2(v,A)},t.prototype.getRenderObjects=function(e){sharedProjScreenMatrix.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),sharedFrustum.setFromProjectionMatrix(sharedProjScreenMatrix),e||(e=this.scene);var r=[];return e.traverseVisible(function(i){(i instanceof THREE__namespace.Mesh||i instanceof THREE__namespace.Line||i instanceof THREE__namespace.Points)&&(i instanceof THREE__namespace.ImmediateRenderObject||!i.frustumCulled||sharedFrustum.intersectsObject(i))&&r.push(i)}),r},t.prototype.getCurrentState=function(){return __assign(__assign({},this.getPose()),{mode:this.currentMode,workCode:this.pano.workCode,panoIndex:this.pano.panoIndex})},t.prototype.setState=function(e,r,i){var o,s,u,c,l,d,f,v,A,h;r===void 0&&(r=!1),i===void 0&&(i=!0),e=Object.assign({},e),e.offset&&!(e instanceof THREE__namespace.Vector3)&&(e.offset=new THREE__namespace.Vector3(e.offset.x,e.offset.y,e.offset.z));var p;typeof e.panoIndex=="number"&&(e.workCode?p={workCode:e.workCode,panoIndex:e.panoIndex}:p={workCode:(s=(o=this.work)===null||o===void 0?void 0:o.workCode)!==null&&s!==void 0?s:"",panoIndex:e.panoIndex});var y=(u=e.mode)!==null&&u!==void 0?u:this.state.mode,m,g,E,b,T;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 _={workCode:p==null?void 0:p.workCode,panoIndex:p==null?void 0:p.panoIndex};typeof e.longitude=="number"&&(_.longitude=e.longitude),typeof e.latitude=="number"&&(_.latitude=e.latitude),typeof e.fov=="number"&&(_.fov=e.fov),typeof e.distance=="number"&&(_.distance=e.distance),e.offset instanceof THREE__namespace.Vector3&&(_.offset=e.offset);var S=__assign(__assign({initial:{state:_,currentState:this.getCurrentState(),duration:this.modeChangeDuration,effect:"fly",userAction:!1}},this.commonParams()),this.controllerInits[y]),R=Controllers[y].initAnimationEndState(S);m=R.longitude,g=R.latitude,E=R.fov,b=R.offset,T=R.distance}else m=(c=e.longitude)!==null&&c!==void 0?c:this.state.longitude,g=(l=e.latitude)!==null&&l!==void 0?l:this.state.latitude,E=(d=e.fov)!==null&&d!==void 0?d:this.state.fov,b=(f=e.offset)!==null&&f!==void 0?f:this.state.offset,T=(v=e.distance)!==null&&v!==void 0?v:this.state.distance;var B={workCode:(p!=null?p:this.pano).workCode,panoIndex:(p!=null?p:this.pano).panoIndex,mode:y,longitude:m,latitude:g,fov:E,offset:b,distance:T};this.emit("state.set",createEvent("state.set",{userAction:i,state:B})),stateEqual(this.state,B)||(this.controller&&B.mode==="VRPanorama"&&B.mode!==this.state.mode?(assignState(this.state,B),this.changeMode("VRPanorama")):this.controller&&B.mode==="XRPanorama"&&B.mode!==this.state.mode?(assignState(this.state,B),this.changeMode("XRPanorama")):(assignState(this.state,B),this.controller&&i&&(this.controller.userAction=!1),r&&this.state.mode===B.mode&&(this.syncingState=this.syncState(now(),0,r),this.syncingState&&((A=this.controller)===null||A===void 0||A.updateTime(now(),0),this.syncingState=!1)),this.emit("state.change",createEvent("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 THREE__namespace.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 o=Math.floor(r.x*this.scissor.left),s=Math.floor(r.y*this.scissor.bottom),u=Math.floor(r.x*this.scissor.width),c=Math.floor(r.y*this.scissor.height);this.renderer.setViewport(o,s,u,c),this.renderer.setScissor(o,s,u,c),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 o=this.stateSynced;if(this.stateSynced=!1,this.works.length===0||!this.controller)return!1;if(this.state.mode!==this.currentMode){var s={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,s,this.modeChangeDuration,this.controller.userAction),!0}if(!this.controller.isReady())return!1;if(this.controller instanceof Controllers.Model){if(notSimilarVector3(this.camera.pose.offset,this.state.offset)){var u={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset};return this.controller.moveToPosition(this.state.offset,__assign(__assign({},u),{duration:i?0:void 0}),!1),!0}}else{var c={workCode:this.state.workCode,panoIndex:this.state.panoIndex};if(!panoEqual(c,this.pano)&&"moveToPano"in this.controller&&typeof this.controller.moveToPano=="function"){var u={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.controller.moveToPano(c,u,!1),!0}}if(this.controller instanceof Controllers.Floorplan||this.controller instanceof Controllers.Topview||this.controller instanceof Controllers.Mapview){var l=1,d=.2,f=.2,v=Math.PI/45,A=i?this.state.fov:stepNumber(this.camera.pose.fov,this.state.fov,l),h=Math.abs(this.camera.pose.distance-this.state.distance),p=h>f*15?h/15:d,y=i?this.state.distance:stepNumber(this.camera.pose.distance,this.state.distance,p),m=this.camera.pose.offset.distanceTo(this.state.offset),g=m>f*15?m/15:f,E=i?new THREE__namespace.Vector3().copy(this.state.offset):stepVector(this.camera.pose.offset,this.state.offset,g),b=i?{longitude:this.state.longitude,latitude:this.state.latitude}:stepCoordinates({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},v),T=b.longitude,_=b.latitude;if(notSimilarValue(A,this.camera.pose.fov)||notSimilarVector3(E,this.camera.pose.offset)||notSimilarValue(y,this.camera.pose.distance)||notSimilarValue(T,this.camera.pose.longitude,Math.PI*2)||notSimilarValue(_,this.camera.pose.latitude)){var S={x:E.x,y:E.y,z:E.z},R={fov:A};return Object.assign(S,{distance:y}),Object.assign(R,{longitude:T,latitude:_}),this.controller.stopMomentumMovement(),this.controller.cameraMotion.set(R,0).catch(noop$1),this.controller.locationMotion.set(S,0).catch(noop$1),!0}}else{var B=1,I=Math.PI/45,A=i?this.state.fov:stepNumber(this.camera.pose.fov,this.state.fov,B),x=i?{longitude:this.state.longitude,latitude:this.state.latitude}:stepCoordinates({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},I),T=x.longitude,_=x.latitude,y=this.state.distance,E=new THREE__namespace.Vector3().copy(this.state.offset);if(notSimilarValue(y,this.camera.pose.distance)&&(this.state.distance=this.camera.pose.distance),notSimilarVector3(E,this.camera.pose.offset)&&(this.state.offset=this.camera.pose.offset.clone()),notSimilarValue(T,this.camera.pose.longitude,Math.PI*2)||notSimilarValue(_,this.camera.pose.latitude)||notSimilarValue(A,this.camera.pose.fov))return this.controller.stopMomentumMovement(),this.controller.cameraMotion.set({longitude:T,latitude:_,fov:A},0).catch(noop$1),!0}if(this.stateSynced=!0,o===!1&&this.emit("state.synced",createEvent("state.synced",{userAction:!1,state:this.state})),this.readyCallbacks.length&&this.stateSynced){var M=this.currentMode,L=M===t.Mode.Floorplan||M===t.Mode.Topview||M===t.Mode.Mapview||M===t.Mode.Model;if(!L||this.models.loaded){var C=this.readyCallbacks.slice();this.readyCallbacks.length=0;for(var H=0,F=C;H<F.length;H++){var O=F[H];this.controller instanceof Controllers.Panorama&&O.tile===!0&&!this.controller.isTileReady()?this.readyCallbacks.push(O):O()}}}return!1},t.prototype.ready=function(e){var r=this;return e===void 0&&(e={}),new Promise(function(i){var o;r.readyCallbacks.push(Object.assign(i,{tile:(o=e.tile)!==null&&o!==void 0?o:!1}))})},t.prototype.requestFullscreen=function(){var e;if(isMobile){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,o=[],s=function(y){var m=u.models.filter(function(E){var b;return((b=E.work)===null||b===void 0?void 0:b.workCode)===y.workCode})[0];if(m)m.work=y,o.push(m);else{var g=new Model({onError:function(E){i.emit("model.error",createEvent("model.error",{work:y,model:g,error:E})),i.throwError(E)},onShownFloorChange:function(E){i.emit("model.changeShownFloor",createEvent("model.changeShownFloor",{work:y,model:g,error:null}))},onLoad:function(){i.emit("model.load",createEvent("model.load",{work:y,model:g,error:null}))}});o.push(g),u.emit("model.request",createEvent("model.request",{work:y,model:g,error:null})),g.load(y,{textureOptions:u.textureOptions,"3d-tiles":r["3d-tiles"]})}},u=this,c=0,l=e;c<l.length;c++){var d=l[c];s(d)}if(this.models.length>0){for(var f=0,v=this.models;f<v.length;f++){var A=v[f];o.indexOf(A)===-1&&this.lastModels.push(A)}this.models.length=0}for(var h=0,p=o;h<p.length;h++){var A=p[h];this.models.push(A)}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 o=Controllers[e];this.currentMode=e;for(var s=new o(r),u=function(A){s.on(A,function(){for(var h=[],p=0;p<arguments.length;p++)h[p]=arguments[p];var y=i.emit.apply(i,__spreadArray([A],h,!1));if(y)return!1})},c=0,l=PROXY_CONTROLLER_EVENT_NAMES;c<l.length;c++){var d=l[c];u(d)}{var f=Controllers[e].initAnimationEndState(r),v=r.initial.userAction;stateEqual(this.state,f)||(assignState(this.state,f),this.emit("state.change",createEvent("state.change",{userAction:v,state:this.state}))),this.emit("currentState.change",createEvent("currentState.change",{userAction:v,state:this.getCurrentState()}))}return s.on("camera.update",function(A){var h;if(i.controller){var p=i.controller.getTargetState();A.userAction&&i.syncingState===!1&&i.state.mode===p.mode&&!stateEqual(i.state,p)&&(assignState(i.state,p),i.emit("state.change",createEvent("state.change",{userAction:A.userAction,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}i.emit("currentState.change",createEvent("currentState.change",{userAction:A.userAction,state:i.getCurrentState()}))}),s.on("initAnimation.start",function(A){var h,p=A.state,y=A.userAction;y&&i.state.mode===p.mode&&!stateEqual(i.state,p)&&(assignState(i.state,p),i.emit("state.change",createEvent("state.change",{userAction:y,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),s.on("initAnimation.end",function(A){var h,p=A.state,y=A.userAction;y&&i.state.mode===p.mode&&!stateEqual(i.state,p)&&(assignState(i.state,p),i.emit("state.change",createEvent("state.change",{userAction:y,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),s.on("pano.moveTo",function(A){var h,p=A.state,y=A.userAction;i.pano={workCode:p.workCode,panoIndex:p.panoIndex},y&&i.state.mode===p.mode&&!stateEqual(i.state,p)&&(assignState(i.state,p),i.emit("state.change",createEvent("state.change",{userAction:y,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),s.on("pano.arrived",function(A){var h,p=A.state,y=A.userAction;y&&i.state.mode===p.mode&&!stateEqual(i.state,p)&&(assignState(i.state,p),i.emit("state.change",createEvent("state.change",{userAction:y,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),s.on("pano.cancel",function(A){var h,p=A.state,y=A.userAction;y&&i.state.mode===p.mode&&!stateEqual(i.state,p)&&(assignState(i.state,p),i.emit("state.change",createEvent("state.change",{userAction:y,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),s.on("pano.moveTo",function(A){var h=A.userAction;i.emit("currentState.change",createEvent("currentState.change",{userAction:h,state:i.getCurrentState()}))}),s.on("pano.request",function(A){i.emit("pano.request",A),A.defaultPrevented||i.moveToPano(A.state,A.options,A.userAction)}),s.on("vr.requestExit",function(){i.currentMode===t.Mode.VRPanorama&&(i.exitFullscreen(),i.changeMode(t.Mode.Panorama))}),s.on("error",function(A){return i.throwError(A)}),s},t.prototype.removeEventListeners=function(){},t.prototype.getWorkResources=function(e){var r=this,i,o=this.models.find(function(l){return l.work===e}),s=((i=o==null?void 0:o.viewLayers)!==null&&i!==void 0?i:[]).map(function(l){return l.scene});function u(l){var d=/([0-9a-z\.\_\-]+)([\?\#].*)?$/i.exec(l);if(d){var f=String(d[1]).trim().split(".").slice(1).reverse()[0];if(f)return f}return""}function c(l,d){d===void 0&&(d=0);var f=[];if(l.content&&l.content.uri){var v=u(l.content.uri);if(v==="json"){var A=imageURL(l.content.uri,{key:"model.".concat(d)});f.push({url:A,type:"tileset"})}else if(v==="at3d"&&l.extras[v]){var A=l.content.uri;f.push({url:A,type:"model"});for(var h=l.extras[v],p=h.textureArray,y=h.textureOptions,m=0,g=p;m<g.length;m++){var E=g[m],b=__assign({key:"texture.pbm"},pick(y,["format","quality","size","sharpen","mappings"])),T=applyImageURLOptions(E,y==null?void 0:y.transform,b);f.push({url:T,type:"texture"})}}else{var A=imageURL(l.content.uri,{key:"model.".concat(d)});f.push({url:A,type:"model"})}}if(l.children)for(var _=0;_<l.children.length;_++){var S=l.children[_];f.push.apply(f,c(S,_))}return f}return Promise.all(s.map(function(l){return l.loadAllTilesets()})).then(function(){for(var l=[],d=["right","left","up","down","front","back"],f=0,v=e.observers;f<v.length;f++){for(var A=v[f],h=0,p=d;h<p.length;h++){var y=p[h],m=__assign({key:"pano.".concat(panoStringify(A.pano),".").concat(y)},pick(r.imageOptions,["size","format","quality","mappings"])),g=A.images[y],E=applyImageURLOptions(g,r.imageOptions.transform,m);l.push({url:E,type:"pano"})}if(A.images.tiles)for(var b=0,T=A.images.tiles;b<T.length;b++)for(var _=T[b],S=0,R=d;S<R.length;S++)for(var y=R[S],B=_.size,I=Math.pow(2,_.level),x=1/I,M=0;M<I;M++)for(var L=0;L<I;L++){var C="".concat(A.panoId,".").concat(y,".").concat(_.level,".").concat(M,".").concat(L),m=__assign(__assign({key:"pano_tile.".concat(C)},pick(r.imageOptions,["format","size","quality","sharpen","mappings"])),{size:_.scale>=1?void 0:B*x*_.scale,cut:[B*x*L,B*x*M,B*x,B*x]}),E=applyImageURLOptions(_[y],r.imageOptions.transform,m);l.push({url:E,type:"pano_tile"})}}for(var H=0,F=s;H<F.length;H++){var O=F[H];O.tileset.url&&l.push({url:O.tileset.url,type:"model"}),l.push.apply(l,c(O.tileset.root))}return l})},t.Mode={Panorama:"Panorama",Model:"Model",Floorplan:"Floorplan",Topview:"Topview",Mapview:"Mapview",VRPanorama:"VRPanorama",XRPanorama:"XRPanorama"},t.Line=null,t}(Subscribe),__FIVE_DEBUG__={instances:{},constructor:Five};typeof window!="undefined"&&Object.assign(window,{__FIVE_DEBUG__});var XRButton=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 o(){i(),e.textContent="VR NOT SUPPORTED"}function s(c){c.style.position="absolute",c.style.bottom="20px",c.style.padding="12px 6px",c.style.border="1px solid #fff",c.style.borderRadius="4px",c.style.background="rgba(0,0,0,0.1)",c.style.color="#fff",c.style.font="normal 13px sans-serif",c.style.textAlign="center",c.style.opacity="0.5",c.style.outline="none",c.style.zIndex="999"}if("xr"in navigator)return e.id="VRButton",e.style.display="none",s(e),navigator.xr.isSessionSupported("immersive-vr").then(function(c){c?r():o()}),e;var u=document.createElement("a");return window.isSecureContext===!1?(u.href=document.location.href.replace(/^http:/,"https:"),u.innerHTML="WEBXR NEEDS HTTPS"):(u.href="https://immersiveweb.dev/",u.innerHTML="WEBXR NOT AVAILABLE"),u.style.left="calc(50% - 90px)",u.style.width="180px",u.style.textDecoration="none",s(u),u},n}();exports.AnimationFrameLoop=AnimationFrameLoop,exports.Camera=Camera,exports.Fetcher=Fetcher,exports.Five=Five,exports.InternalWebGLRenderer=InternalWebGLRenderer,exports.IntersectMesh=IntersectMesh,exports.Model=Model,exports.ModelViewLayer=ModelViewLayer,exports.NetworkSubscribe=NetworkSubscribe,exports.PBMContainer=PBMContainer,exports.PBMGroup=PBMGroup,exports.PBMMesh=PBMMesh,exports.PBMMeshMaterial=PBMMeshMaterial,exports.PROXY_CONTROLLER_EVENT_NAMES=PROXY_CONTROLLER_EVENT_NAMES,exports.PanoCircleMesh=PanoCircleMesh,exports.PanoCircleMeshCustom=PanoCircleMeshCustom,exports.PanoCircleMeshSolid=PanoCircleMeshSolid,exports.Scene=Scene,exports.Subscribe=Subscribe,exports.TextureLoader=TextureLoader,exports.Tile=Tile,exports.Tile3DModel=Tile3DModel,exports.TileCache=TileCache,exports.TileCubeTextureTarget=TileCubeTextureTarget,exports.TileNode=TileNode,exports.TileRequestScheduler=TileRequestScheduler,exports.Tileset=Tileset,exports.Work=Work,exports.XRButton=XRButton,exports.defaultImageURLTransform=imageURL,exports.defaultPbmParameters=defaultPbmParameters,exports.getViewportScale=getViewportScale,exports.imageSupport=imageSupport,exports.isPanoId=isPanoId,exports.loadAt3d=loadAt3d,exports.loadB3dm=loadB3dm,exports.loadDome=loadDome,exports.loadDomez=loadDomez,exports.loadGlb=loadGlb,exports.loadPbm=loadPbm,exports.loadPnts=loadPnts,exports.panoEqual=panoEqual,exports.panoParse=panoParse,exports.panoStringify=panoStringify,exports.parseWork=parseWork,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});