@realsee/five 6.4.0-alpha.13 → 6.4.0-alpha.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/five.Model.html +2 -2
- package/docs/functions/five.loadGltf.html +1 -0
- package/docs/modules/five.html +1 -1
- package/docs/types/five.ModelMaterialValues.html +1 -1
- package/docs/types/five.Models.html +5 -5
- package/docs/types/five.ParsedResultType.html +1 -1
- package/five/index.d.ts +2 -2
- package/five/index.js +15 -15
- package/five/index.mjs +123 -106
- package/gltf-loader/index.js +3 -3
- package/gltf-loader/index.mjs +3 -3
- package/line/index.js +3 -3
- package/line/index.mjs +3 -3
- package/package.json +1 -1
- package/plugins/index.js +2 -2
- package/plugins/index.mjs +2 -2
- package/react/index.js +2 -2
- package/react/index.mjs +2 -2
- package/shader-lib/index.js +2 -2
- package/shader-lib/index.mjs +2 -2
- package/sticker/index.js +3 -3
- package/sticker/index.mjs +3 -3
- package/umd/five-gltf-loader.js +3 -3
- package/umd/five-line.js +3 -3
- package/umd/five-plugins.js +2 -2
- package/umd/five-react.js +2 -2
- package/umd/five-shader-lib.js +2 -2
- package/umd/five-sticker.js +3 -3
- package/umd/five-vfx.js +2 -2
- package/umd/five-vue.js +2 -2
- package/umd/five.js +9 -9
- package/vfx/index.js +2 -2
- package/vfx/index.mjs +2 -2
- package/vue/index.js +2 -2
- package/vue/index.mjs +2 -2
- package/docs/functions/five.loadGlb.html +0 -1
package/five/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five
|
|
4
|
-
* Generated: 1/
|
|
5
|
-
* Version: 6.4.0-alpha.
|
|
4
|
+
* Generated: 1/16/2025
|
|
5
|
+
* Version: 6.4.0-alpha.15
|
|
6
6
|
* Terms:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
* Update: July 28, 2021
|
|
@@ -414,7 +414,7 @@ varying vec2 vUv;
|
|
|
414
414
|
void main() {
|
|
415
415
|
gl_FragColor = texture2D(map, vUv);
|
|
416
416
|
}
|
|
417
|
-
`,gu=[],yi=new f.PerspectiveCamera(90,1,.1,2);yi.up.set(0,-1,0);yi.lookAt(new f.Vector3(1,0,0));yi.updateMatrix();yi.matrixAutoUpdate=!1;var bi=new f.PerspectiveCamera(90,1,.1,2);bi.up.set(0,-1,0);bi.lookAt(new f.Vector3(-1,0,0));bi.updateMatrix();bi.matrixAutoUpdate=!1;var xi=new f.PerspectiveCamera(90,1,.1,2);xi.up.set(0,0,1);xi.lookAt(new f.Vector3(0,1,0));xi.updateMatrix();xi.matrixAutoUpdate=!1;var wi=new f.PerspectiveCamera(90,1,.1,2);wi.up.set(0,0,-1);wi.lookAt(new f.Vector3(0,-1,0));wi.updateMatrix();wi.matrixAutoUpdate=!1;var Ei=new f.PerspectiveCamera(90,1,.1,2);Ei.up.set(0,-1,0);Ei.lookAt(new f.Vector3(0,0,1));Ei.updateMatrix();Ei.matrixAutoUpdate=!1;var Si=new f.PerspectiveCamera(90,1,.1,2);Si.up.set(0,-1,0);Si.lookAt(new f.Vector3(0,0,-1));Si.updateMatrix();Si.matrixAutoUpdate=!1;var Bs={front:{camera:Ei,index:4},back:{camera:Si,index:5},up:{camera:xi,index:2},down:{camera:wi,index:3},left:{camera:bi,index:1},right:{camera:yi,index:0}};function rd(){var n=gu.pop();return n||new f.ShaderMaterial({uniforms:{map:{value:null},flipY:{value:0}},vertexShader:ed,fragmentShader:td,depthTest:!1,depthWrite:!1,stencilWrite:!1,blending:f.NoBlending,lights:!1,toneMapped:!1,fog:!1})}function nd(n){n.uniforms.map.value=null,gu.push(n)}function id(n,t,e){var r=new f.Scene;r.matrixAutoUpdate=!1;var i=new f.Group;i.scale.set(1,1,-1),r.add(i);for(var a=[],o=new Set,s=0,u=n;s<u.length;s++){var l=u[s];o.add(l.face);var c=rd();a.push(c),c.uniforms.map.value=l.texture,c.uniforms.flipY.value=l.flipY?1:0;var d=new f.Group,p=new f.Mesh($f,c);p.position.set(l.position.x+l.size.x/2-.5,1-(l.position.y+l.size.y/2)-.5,-.5),p.scale.set(l.size.x,l.size.y,1),d.quaternion.copy(Yf[l.face]),d.add(p),i.add(d)}var A=e.autoClear,h=e.sortObjects,v=e.xr.enabled,g=t.texture.generateMipmaps;e.autoClear=!1,e.sortObjects=!1,e.xr.enabled=!1,t.texture.generateMipmaps=!1;var m=e.getRenderTarget(),y=0;o.forEach(function(w){++y===o.size&&(t.texture.generateMipmaps=g),e.setRenderTarget(t,Bs[w].index),e.render(r,Bs[w].camera)}),e.setRenderTarget(m),e.autoClear=A,e.sortObjects=h,e.xr.enabled=v;for(var b=0,x=a;b<x.length;b++){var c=x[b];nd(c)}}var ad=function(){return!1}();function hi(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=U,this.removeAttribute("src")}});return t}function go(n){return new Promise(function(t,e){var r=URL.createObjectURL(n),i=hi({onClose:function(){this.src===r&&URL.revokeObjectURL(r)}});i.onload=function(){i.src===r&&URL.revokeObjectURL(r),i.onload=i.onerror=U,setTimeout(function(){t(i)},10)},i.onerror=function(){var a=i.src;i.onload=i.onerror=U,i.close(),e(new Error("image load error: ".concat(a)))},i.decoding="async",i.src=r})}var Fs=[];function od(n,t){var e=Fs.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=U,Fs.push(r)}});return r}function Ls(n,t){if(t&&(n.width>t.width||n.height>t.height)){var e=od(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 f.Texture(e);i.needsUpdate=!0,i.flipY=!0;var a=i.dispose;return i.dispose=function(){e.close(),a.call(i),i.dispose=a},i}else{var o=new f.Texture(n);o.needsUpdate=!0,typeof ImageBitmap!="undefined"&&n instanceof ImageBitmap?o.flipY=!1:o.flipY=!0;var s=o.dispose;return o.dispose=function(){n.close(),s.call(o),o.dispose=s},o}}function sd(n){var t=new f.CubeTexture(n);t.needsUpdate=!0,t.flipY=!1;var e=t.dispose;return t.dispose=function(){for(var r=0,i=n;r<i.length;r++){var a=i[r];a.close()}e.call(t),t.dispose=e},t}var ks=new f.Vector3,hn=["right","left","up","down","front","back"],qe=function(){function n(t,e,r,i,a){this.tileTree=e,this.tileSources=r,this.options=i,this.renderer=a,this.name="",this.needsRender=!1,this.maxRequest=n.DEFAULT_MAX_REQUEST,this.disposed=!1,this.loadedCubeNodes=new Set,this.loadingCubeNodes=new Set,this.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,a,o,s;if(t===null)throw new Error("cannot set cubeRenderTarget to null.");t.width!==this.options.textureSize&&t.setSize(this.options.textureSize,this.options.textureSize),t.texture.format=(e=this.options.format)!==null&&e!==void 0?e:f.RGBAFormat,t.texture.minFilter=(r=this.options.minFilter)!==null&&r!==void 0?r:f.LinearFilter,t.texture.magFilter=(i=this.options.magFilter)!==null&&i!==void 0?i:f.LinearFilter,t.texture.wrapS=(a=this.options.wrapS)!==null&&a!==void 0?a:f.ClampToEdgeWrapping,t.texture.wrapT=(o=this.options.wrapT)!==null&&o!==void 0?o:f.ClampToEdgeWrapping,t.texture.generateMipmaps=(s=this.options.generateMipmaps)!==null&&s!==void 0?s:!0,this.baseCubeTexture&&(Ao(this.baseCubeTexture,t,this.renderer),this.baseCubeTexture.dispose(),this.baseCubeTexture=null),this._cubeRenderTarget&&Ao(this._cubeRenderTarget.texture,t,this.renderer),this._cubeRenderTarget=t},enumerable:!1,configurable:!0}),n.prototype.requestTile=function(t){var e=this,r,i,a,o,s,u,l=this.tileSources.filter(function(v){return v.level===t.level})[0];if(!l)return this.loadedCubeNodes.add(t),this.prepareToRender.push({node:t,texture:null}),!1;var c=l.size,d=Math.pow(2,t.level)*t.position.y,p=Math.pow(2,t.level)*t.position.x,A="".concat(((a=(i=(r=this.options.imageURL)===null||r===void 0?void 0:r.options)===null||i===void 0?void 0:i.key)!==null&&a!==void 0?a:"pano.0").replace(/^pano/,"pano_tile"),".").concat(t.face,".").concat(t.level,".").concat(d,".").concat(p),h=O(O({},(s=(o=this.options.imageURL)===null||o===void 0?void 0:o.options)!==null&&s!==void 0?s:{key:"unknown"}),{key:A,size:l.scale>=1?void 0:c*t.size*l.scale,quality:void 0,cut:[c*t.position.x,c*t.position.y,c*t.size,c*t.size]});return this.loadingCubeNodes.add(t),this.options.textureLoader.loadTexture(l[t.face],{imageURL:{transform:(u=this.options.imageURL)===null||u===void 0?void 0:u.transform,options:O({},h)},format:f.RGBAFormat,timeout:this.options.timeout,magFilter:this.options.magFilter,minFilter:this.options.minFilter,fetcher:this.options.fetcher}).then(function(v){if(e.disposed){v.body.dispose();return}e.prepareToRender.push({node:t,texture:v.body}),e.loadedCubeNodes.add(t)}).catch(U).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,a=Math.max(this.maxRequest-this.loadingCubeNodes.size,0),o=[];qo(this.tileTree,function(v){if(v.level>e||!t.intersectsBox(v.box))return!1;!r.loadedCubeNodes.has(v)&&!r.loadingCubeNodes.has(v)&&o.push(v)}),o.sort(function(v,g){return v.level!==g.level?v.level-g.level:v.box.getCenter(ks).angleTo(i)-g.box.getCenter(ks).angleTo(i)});for(var s=0,u=o;s<u.length;s++){var l=u[s];if(a<=0)break;var c=this.requestTile(l);c&&a--}if(this.cubeRenderTarget&&this.prepareToRender.length){this.prepareToRender.sort(function(v,g){return v.node.level-g.node.level});for(var d=[],p=0;p<this.prepareToRender.length;p++){var A=this.prepareToRender[p],l=A.node,h=A.texture;(l.parent===null||this.drawedCubeNodes.has(l.parent))&&(this.drawedCubeNodes.add(l),h&&d.push({face:l.face,position:l.position,size:new f.Vector2(l.size,l.size),texture:h,flipY:!h.flipY}),this.prepareToRender.splice(p,1),p--)}d.length&&(id(d,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}(),Kn=function(){function n(){}return n.prototype.loadTexture=function(t,e,r,i,a,o){var s,u,l,c,d,p,A;r===void 0&&(r=U),i===void 0&&(i=U),a===void 0&&(a=U);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=(s=e.generateMipmaps)!==null&&s!==void 0?s:!1,h.minFilter=(u=e.minFilter)!==null&&u!==void 0?u:f.LinearFilter,h.magFilter=(l=e.magFilter)!==null&&l!==void 0?l:f.LinearFilter;var v=(d=(c=e.imageURL)===null||c===void 0?void 0:c.options)!==null&&d!==void 0?d:{key:"unknown"};t=xn(t,(p=e.imageURL)===null||p===void 0?void 0:p.transform,v);var g=Is(t),m=(A=e.viaAjax)!==null&&A!==void 0?A:ad,y=Cs(t),b=/^https?:/.test(g);if(y?m=!0:b||(m=!1),m){var x=null,w="blob";return e.fetcher.ajax(t,{timeout:e.timeout,responseType:w},void 0,void 0,a).then(function(C){return go(C.body)}).then(function(C){return Ls(C,e.maxSize)}).then(function(C){return Object.assign(C,h),C}).then(function(C){var R={meta:x,body:C};return r(R),R}).catch(function(C){return i(C),Promise.reject(C)})}else{var E=null,S;return Promise.resolve().then(function(){return hi()}).then(function(C){return S=C,e.fetcher.loadImage(t,{timeout:e.timeout},void 0,void 0,a,C)}).then(function(C){return E=C.meta,Ls(C.body,e.maxSize)}).then(function(C){return Object.assign(C,h),C}).then(function(C){var R={meta:E,body:C};return r(R),R}).catch(function(C){return S&&S.close(),i(C),Promise.reject(C)})}},n.prototype.loadCubeTexture=function(t,e,r,i,a,o){var s,u,l,c,d,p,A;r===void 0&&(r=U),i===void 0&&(i=U),a===void 0&&(a=U);var h={};typeof e.format!="undefined"&&(h.format=e.format),h.generateMipmaps=(s=e.generateMipmaps)!==null&&s!==void 0?s:!1,h.minFilter=(u=e.minFilter)!==null&&u!==void 0?u:f.LinearFilter,h.magFilter=(l=e.magFilter)!==null&&l!==void 0?l:f.LinearFilter;for(var v=[t[hn[0]],t[hn[1]],t[hn[2]],t[hn[3]],t[hn[4]],t[hn[5]]],g=[],m=[0,0,0,0,0,0],y=[],b=function(w){var E=(d=(c=e.imageURL)===null||c===void 0?void 0:c.options)!==null&&d!==void 0?d:{key:"unknown"},S=xn(v[w],(p=e.imageURL)===null||p===void 0?void 0:p.transform,O(O({},E),{key:E.key+"."+hn[w]})),C=Is(S),R=function(D){m[w]=D,a(m.reduce(function(V,z){return V+z},0)/6)},B=(A=e.viaAjax)!==null&&A!==void 0?A:!1,M=/^https?:$/.test(C),I=Cs(S);if(I?B=!0:M||(B=!1),B){var L="blob",T=e.fetcher.ajax(S,{timeout:e.timeout,responseType:L},void 0,void 0,R).then(function(D){return y[w]=D.meta,go(D.body)});g.push(T)}else{var F,T=Promise.resolve().then(function(){return hi()}).then(function(V){return F=V,e.fetcher.loadImage(S,{timeout:e.timeout},void 0,void 0,R,V)}).then(function(V){return y[w]=V.meta,V.body}).catch(function(V){return F&&F.close(),Promise.reject(V)});g.push(T)}},x=0;x<6;x++)b(x);return Promise.all(g).then(function(w){return sd(w)}).then(function(w){return Object.assign(w,O({encoding:f.sRGBEncoding},h)),w}).then(function(w){var E={body:w,meta:y};return r(E),E}).catch(function(w){for(var E=0,S=g;E<S.length;E++){var C=S[E];C.then(function(R){return R.close()}).catch(U)}return i(w),Promise.reject(w)})},n.prototype.loadTiledCubeTexture=function(t,e,r,i,a,o,s){var u=this;return i===void 0&&(i=U),a===void 0&&(a=U),o===void 0&&(o=U),new Promise(function(l,c){var d,p;u.loadCubeTexture(t,{imageURL:{transform:(d=r.imageURL)===null||d===void 0?void 0:d.transform,options:(p=r.imageURL)===null||p===void 0?void 0:p.options},format:f.RGBAFormat,viaAjax:r.viaAjax,timeout:r.timeout,fetcher:r.fetcher,magFilter:r.magFilter,minFilter:r.minFilter,generateMipmaps:r.generateMipmaps},function(A){var h,v=A.meta,g=A.body,m=(h=r.tileMaxLevel)!==null&&h!==void 0?h:2,y=Math.max(1024*m,512),b=vo(m),x=new qe(g,b,e,{textureSize:y,textureLoader:u,imageURL:r.imageURL,magFilter:r.magFilter,minFilter:r.minFilter,generateMipmaps:r.generateMipmaps,timeout:r.timeout,fetcher:r.fetcher},s),w={meta:v,body:x};i(w),l(w)},function(A){a(A),c(A)},o,s).catch(U)})},n}();const ud=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("n\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{H0v{pyqr-Ip|zz|{K0v{pyqr-Iz|}untrl}nlrr\x07K0v{pyqr-Ixv{{v{tl}nlrr\x07K0v{pyqr-Iy|tqr}uosl}nlrr\x07K0v{pyqr-Ipyv}}v{tl}yn{rl}nlrr\x07KZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--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--ZNV[lR[Q\f"),ld=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0qrsv{r-OYNPXlP\\Y\\_-rpA5=;=EC9-=;>=C9-=;>AF9->;=6{vs|z-nz}yrPor-}n{|=lzn}H{vs|z-znA-}n{|=lznv\x07H{vs|z-sy|n-}n{|=l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|=lyzv{n{prZn}H0r{qvs{vs|z-nz}yrPor-}n{|>lzn}H{vs|z-znA-}n{|>lznv\x07H{vs|z-sy|n-}n{|>l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR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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-:-]V-8->;=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-rpA5}n{|P|y|;to9-=;=69-pynz}5z|qryNy}un-7-@=;=9-=;=9->;=66H--<<-JJJJJJJJJJJJJJJJ--ZNV[lZ\\QRYlP\\Y\\_--0v{pyqr-Is|tlsntzr{K--0v{pyqr-I}rzyv}yvrqlny}unlsntzr{K--0v{pyqr-Iqvurv{tlsntzr{K--ZNV[lR[Q\f"),cd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("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\x07KZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--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--ZNV[lR[Q\f"),fd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0qrsv{r-OYNPXlP\\Y\\_-rpA5=;=EC9-=;>=C9-=;>AF9->;=6{vs|z-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\\Y\\_lP\\[`aN[a6--{vs|z-rp@-p|{n{P|y|H0r{qvs0vs-qrsv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J-qvrpv|{-7-urnH--rp@-}-J-rp|-:-qH--rp@-\0-J-}-7- ||zH--r{-{|znyv r5q-8-\x006H\frp@-to?u5rp@-p6-\n----rpA-X-J-rpA5=;=9-:>;=-<-@;=9-?;=-<-@;=9-:>;=6H----rpA-}-J-zv\x075rpA5p;ot9-X; 69-rpA5p;to9-X;\x07\b69-r}5p;o9-p;t66H----rpA-\0-J-zv\x075rpA5};\x07\b9-p;69-rpA5p;9-};\b \x0769-r}5};\x079-p;66H----sy|n-q-J-\0;\x07-:-zv{5\0;9-\0;\b6H----sy|n-r-J->;=r:>=H----r{-rp@5no5\0; -8-5\0;-:-\0;\b6-<-5C;=-7-q-8-r669-q-<-5\0;\x07-8-r69-\0;\x076H\frp@-u?to5rp@-p6-\n----rpA-X-J-rpA5>;=9-?;=-<-@;=9->;=-<-@;=9-@;=6H----rp@-}-J-no5snp5p;\x07\x07\x07-8-X;\x07\b 6-7-C;=-:-X;6H----r{-p; -7-zv\x075X;\x07\x07\x079-pynz}5}-:-X;\x07\x07\x079-=;=9->;=69-p;\b6H\frp@-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--r{-r\x07r?Q5tnqvr{ar\x07r9-rp?59-=;B66;toH\fZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--<<-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--<<-JJJ-高度色-JJJ--0vs-qrsv{rq5b`RlP\\Y\\_lNYaVabQR6----qvssrP|y|;to-J-trP|y|O\bUrvtu5tnqvr{ar\x07r9-d|yq]|vv|{6H--0r{qvs--<<-JJJJJJJJJJJ--<<-JJJ-纯色-JJJ--0vs-qrsv{rq5b`RlP\\Y\\_lP\\[`aN[a6----qvssrP|y|;to-J-p|{n{P|y|H--0r{qvs--<<-JJJJJJJJJJJ--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--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--ZNV[lZ\\QRYlP\\Y\\_--<<色调映射-色彩空间转换--0v{pyqr-I|{rzn}}v{tlsntzr{K--0v{pyqr-Ir{p|qv{tlsntzr{K--<<-JJJ-颜色增益调整-JJJ--rp@-toP|y|-J-tylSntP|y|;toH--rp@-uP|y|-J-to?u5toP|y|6H--uP|y|;\b-8J-p|y|`nnv|{H--uP|y|; -8J-p|y|Ovtu{rH--tylSntP|y|;to-J-u?to5uP|y|6H--<<-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-:-]V-8->;=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--ZNV[lR[Q\f"),dd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0qrsv{r-]U\\[T0vs-qrsv{rq5b`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\x07K0v{pyqr-Ir{zn}l}nlrr\x07K0v{pyqr-Ip|y|l}nlrr\x07K0v{pyqr-Is|tl}nlrr\x07K0v{pyqr-Iz|}untrl}nlrr\x07K0v{pyqr-Ixv{{v{tl}nlrr\x07K0v{pyqr-Iunq|zn}l}nlrr\x07K0v{pyqr-Iy|tqr}uosl}nlrr\x07K0v{pyqr-Ipyv}}v{tl}yn{rl}nlrr\x07KZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--0v{pyqr-Ilrr\x07K--0v{pyqr-I?lrr\x07K--0v{pyqr-Ip|y|lrr\x07K--0v{pyqr-Iortv{{|znylrr\x07K--0v{pyqr-Iz|}u{|znylrr\x07K--0v{pyqr-Ixv{onrlrr\x07K--0v{pyqr-Ixv{{|znylrr\x07K--0v{pyqr-Iqrsny{|znylrr\x07K0vs{qrs-SYNal`UNQRQ-<<-[|zny-p|z}rq-vu-qrvnvr-ur{-SYNal`UNQRQ--[|zny-J-{|znyv r5-n{s|zrq[|zny-6H0r{qvs--0v{pyqr-Iortv{lrr\x07K--0v{pyqr-Iz|}untrlrr\x07K--0v{pyqr-Ixv{{v{tlrr\x07K--0v{pyqr-Iqv}ynprzr{zn}lrr\x07K--0v{pyqr-I}|wrplrr\x07K--0v{pyqr-Iy|tqr}uoslrr\x07K--0v{pyqr-Ipyv}}v{tl}yn{rlrr\x07K--cvr]|vv|{-J-:-z]|vv|{;\x07\b H--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-Iunq|zn}lrr\x07K--0v{pyqr-Is|tlrr\x07K--ZNV[lR[Q\f"),hd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var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{-rp@5no5\0; -8-5\0;-:-\0;\b6-<-5C;=-7-q-8-r669-q-<-5\0;\x07-8-r69-\0;\x076H\frp@-u?to5rp@-p6-\n----rpA-X-J-rpA5>;=9-?;=-<-@;=9->;=-<-@;=9-@;=6H----rp@-}-J-no5snp5p;\x07\x07\x07-8-X;\x07\b 6-7-C;=-:-X;6H----r{-p; -7-zv\x075X;\x07\x07\x079-pynz}5}-:-X;\x07\x07\x079-=;=9->;=69-p;\b6H\frp@-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--r{-r\x07r?Q5tnqvr{ar\x07r9-rp?59-=;B66;toH\fZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--<<-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--<<-JJJ-高度色-JJJ--0vs-qrsv{rq5b`RlP\\Y\\_lNYaVabQR6----qvssrP|y|;to-J-trP|y|O\bUrvtu5tnqvr{ar\x07r9-d|yq]|vv|{6H--0r{qvs--<<-JJJJJJJJJJJ--<<-JJJ-纯色-JJJ--0vs-qrsv{rq5b`RlP\\Y\\_lP\\[`aN[a6----qvssrP|y|;to-J-p|{n{P|y|H--0r{qvs--<<-JJJJJJJJJJJ--_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--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--ZNV[lZ\\QRYlP\\Y\\_--<<色调映射-色彩空间转换--0v{pyqr-I|{rzn}}v{tlsntzr{K--0v{pyqr-Ir{p|qv{tlsntzr{K--<<-JJJ-颜色增益调整-JJJ--rp@-toP|y|-J-tylSntP|y|;toH--rp@-uP|y|-J-to?u5toP|y|6H--uP|y|;\b-8J-p|y|`nnv|{H--uP|y|; -8J-p|y|Ovtu{rH--tylSntP|y|;to-J-u?to5uP|y|6H--<<-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-:-]V-8->;=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--ZNV[lR[Q\f");var Ca={modelAlpha:new f.Uniform(0),progress:new f.Uniform(0),pano0_map:new f.Uniform(null),pano0_luminanceMap:new f.Uniform(null),pano0_matrix:new f.Uniform(new f.Matrix4),pano0_zoom:new f.Uniform(1),pano1_map:new f.Uniform(null),pano1_luminanceMap:new f.Uniform(null),pano1_matrix:new f.Uniform(new f.Matrix4),pano1_zoom:new f.Uniform(1),gradientTexture:new f.Uniform(null),clippers:new f.Uniform([]),shownFloorIndex:new f.Uniform(-1),constantColor:new f.Uniform(new f.Vector3),geometricError:new f.Uniform(0),pixelRatio:new f.Uniform(1),resolution:new f.Uniform(new f.Vector2(512,512)),floor:new f.Uniform(0),brightness:new f.Uniform(1),modelBoundingMin:new f.Uniform(new f.Vector3),modelBoundingMax:new f.Uniform(new f.Vector3),colorSaturation:new f.Uniform(0),colorBrightness:new f.Uniform(0)},pd={none:{vertexShader:ud,fragmentShader:ld,uniforms:f.UniformsUtils.merge([Ca,{opacity:{value:1}},f.UniformsLib.fog]),lights:!1,clipping:!1},basic:{vertexShader:cd,fragmentShader:fd,uniforms:f.UniformsUtils.merge([Ca,f.ShaderLib.basic.uniforms]),lights:!1,clipping:!0},phong:{vertexShader:dd,fragmentShader:hd,uniforms:f.UniformsUtils.merge([Ca,f.ShaderLib.phong.uniforms]),lights:!0,clipping:!0}},Ar=function(n){ue(t,n);function t(e,r){e===void 0&&(e="basic"),r===void 0&&(r={});var i=this,a,o,s,u,l,c,d,p,A,h,v,g,m,y,b,x,w,E,S,C,R,B,M,I,L,T=pd[e];i=n.call(this,{vertexShader:T.vertexShader,fragmentShader:T.fragmentShader,uniforms:f.UniformsUtils.clone(T.uniforms),lights:T.lights,clipping:T.clipping,defines:{USE_COLOR_CONSTANT:!1,USE_COLOR_ALTITUDE:!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_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 f.Color(16777215),i.map=null,i.lightMap=null,i.lightMapIntensity=1,i.aoMap=null,i.aoMapIntensity=1,i.specularMap=null,i.specular=new f.Color(1118481),i.alphaMap=null,i.envMap=null,i.reflectivity=1,i.refractionRatio=.98,i.emissiveMap=null,i.emissive=new f.Color(0),i.emissiveIntensity=1,i.bumpMap=null,i.bumpScale=1,i.normalMap=null,i.normalMapType=f.TangentSpaceNormalMap,i.normalScale=new f.Vector2(1,1),i.displacementMap=null,i.displacementScale=1,i.displacementBias=0,i.shininess=30;var F,D=null,V=null;return Object.defineProperties(i,{pano0:{get:function(){return D},set:function(z){if(D!==z){D=z,z===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=z.map instanceof qe?z.map.texture:z.map,this.uniforms.pano0_luminanceMap.value=z.luminanceMap instanceof qe?z.luminanceMap.texture:z.luminanceMap,this.uniforms.pano0_matrix.value.copy(z.matrix),this.uniforms.pano0_zoom.value=z.zoom);var Q=this.uniforms.pano0_luminanceMap.value!==null&&this.uniforms.pano1_luminanceMap.value!==null,q=this.defines.USE_LUMINANCE;q!==Q&&(this.defines.USE_LUMINANCE=Q,this.needsUpdate=!0)}}},pano1:{get:function(){return V},set:function(z){if(V!==z){V=z,z===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=z.map instanceof qe?z.map.texture:z.map,this.uniforms.pano1_luminanceMap.value=z.luminanceMap instanceof qe?z.luminanceMap.texture:z.luminanceMap,this.uniforms.pano1_matrix.value.copy(z.matrix),this.uniforms.pano1_zoom.value=z.zoom);var Q=this.uniforms.pano0_luminanceMap.value!==null&&this.uniforms.pano1_luminanceMap.value!==null,q=this.defines.USE_LUMINANCE;q!==Q&&(this.defines.USE_LUMINANCE=Q,this.needsUpdate=!0)}}},modelAlpha:{get:function(){return this.uniforms.modelAlpha.value},set:function(z){this.uniforms.modelAlpha.value=z}},progress:{get:function(){return this.uniforms.progress.value},set:function(z){this.uniforms.progress.value=z}},transition:{get:function(){return this.defines.USE_BLACK_TRANSITION?"BLACK":this.defines.USE_SPREAD_TRANSITION?"SPREAD":"FADE"},set:function(z){var Q=this.defines.USE_BLACK_TRANSITION,q=this.defines.USE_SPREAD_TRANSITION;this.defines.USE_BLACK_TRANSITION=!1,this.defines.USE_SPREAD_TRANSITION=!1,this.defines["USE_".concat(z,"_TRANSITION")]=!0;var G=!1;Q!==this.defines.USE_BLACK_TRANSITION&&(G=!0),q!==this.defines.USE_SPREAD_TRANSITION&&(G=!0),G&&(this.needsUpdate=!0)}},colorStyle:{get:function(){return this.defines.USE_COLOR_CONSTANT?"CONSTANT":this.defines.USE_COLOR_ALTITUDE?"ALTITUDE":"RGB"},set:function(z){var Q=z==="CONSTANT",q=z==="ALTITUDE";this.defines.USE_COLOR_CONSTANT!==Q&&(this.defines.USE_COLOR_CONSTANT=Q,this.needsUpdate=!0),this.defines.USE_COLOR_ALTITUDE!==q&&(this.defines.USE_COLOR_ALTITUDE=q,this.needsUpdate=!0)}},constantColor:{get:function(){return this.uniforms.constantColor.value},set:function(z){this.uniforms.constantColor.value=z}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(z){this.uniforms.opacity.value=z}},shownFloorIndex:{get:function(){return this.uniforms.shownFloorIndex.value},set:function(z){this.uniforms.shownFloorIndex.value=z}},gradientTexture:{get:function(){return this.uniforms.gradientTexture.value},set:function(z){this.uniforms.gradientTexture.value=z}},brightness:{get:function(){return this.uniforms.brightness.value},set:function(z){this.uniforms.brightness.value=z}},clippers:{get:function(){return F},set:function(z){F!==z&&(F=z,this.uniforms.clippers.value=(F||[]).map(function(Q){var q=typeof Q.floorIndex=="number"?Q.floorIndex:-1,G=new f.Matrix4().getInverse(Q.clippingBoxMatrix);return{matrixInverse:G,floorIndex:q}}),this.needsUpdate=!0)}},useEDL:{get:function(){return this.defines.USE_EDL},set:function(z){z!==this.defines.USE_EDL&&(this.defines.USE_EDL=z,this.needsUpdate=!0)}},useHQWeight:{get:function(){return this.defines.USE_HQ_WEIGHT},set:function(z){z!==this.defines.USE_HQ_WEIGHT&&(this.defines.USE_HQ_WEIGHT=z,this.needsUpdate=!0)}},useHQDepth:{get:function(){return this.defines.USE_HQ_DEPTH},set:function(z){z!==this.defines.USE_HQ_DEPTH&&(this.defines.USE_HQ_DEPTH=z,this.needsUpdate=!0)}},floor:{get:function(){return this.uniforms.floor.value},set:function(z){this.uniforms.floor.value=z}},colorSaturation:{get:function(){return this.uniforms.colorSaturation.value},set:function(z){this.uniforms.colorSaturation.value=z}},colorBrightness:{get:function(){return this.uniforms.colorBrightness.value},set:function(z){this.uniforms.colorBrightness.value=z}}}),i.pano0=(a=r.pano0)!==null&&a!==void 0?a:ge.pano0,i.pano1=(o=r.pano1)!==null&&o!==void 0?o:ge.pano1,i.modelAlpha=(s=r.modelAlpha)!==null&&s!==void 0?s:ge.modelAlpha,i.progress=(u=r.progress)!==null&&u!==void 0?u:ge.progress,i.transition=(l=r.transition)!==null&&l!==void 0?l:ge.transition,i.constantColor=(c=r.constantColor)!==null&&c!==void 0?c:ge.constantColor,i.opacity=(d=r.opacity)!==null&&d!==void 0?d:ge.opacity,i.floorStyle=(p=r.floorStyle)!==null&&p!==void 0?p:ge.floorStyle,i.shownFloorIndex=(A=r.shownFloorIndex)!==null&&A!==void 0?A:ge.shownFloorIndex,i.clippers=(h=r.clippers)!==null&&h!==void 0?h:ge.clippers,i.useEDL=(v=r.useEDL)!==null&&v!==void 0?v:ge.useEDL,i.useHQWeight=(g=r.useHQWeight)!==null&&g!==void 0?g:ge.useHQWeight,i.useHQDepth=(m=r.useHQDepth)!==null&&m!==void 0?m:ge.useHQDepth,i.pointSize=(y=r.pointSize)!==null&&y!==void 0?y:ge.pointSize,i.colorStyle=(b=r.colorStyle)!==null&&b!==void 0?b:ge.colorStyle,i.pointShape=(x=r.pointShape)!==null&&x!==void 0?x:ge.pointShape,i.pointScale=(w=r.pointScale)!==null&&w!==void 0?w:ge.pointScale,i.pointBack=(E=r.pointBack)!==null&&E!==void 0?E:ge.pointBack,i.pointMinPixel=(S=r.pointMinPixel)!==null&&S!==void 0?S:ge.pointMinPixel,i.pointMaxPixel=(C=r.pointMaxPixel)!==null&&C!==void 0?C:ge.pointMaxPixel,i.gradientTexture=(R=r.gradientTexture)!==null&&R!==void 0?R:ge.gradientTexture,i.brightness=(B=r.brightness)!==null&&B!==void 0?B:ge.brightness,i.colorSaturation=(M=r.colorSaturation)!==null&&M!==void 0?M:ge.colorSaturation,i.colorBrightness=(I=r.colorBrightness)!==null&&I!==void 0?I:ge.colorBrightness,i.customShaders=(L=r.customShaders)!==null&&L!==void 0?L:ge.customShaders,i.customShaderHash="",i.customShaderUniforms={},i.customShaderDefines={},i.floor=0,i.transparent=!1,i}return t.prototype.onBeforeCompile=function(e,r){var i=this,a,o,s=this.customShaders.filter(function(g){return g.type.includes(i.shaderType)}),u=s.reduce(function(g,m){return g+m.vertex.mainBefore},""),l=s.reduce(function(g,m){return g+m.vertex.mainStart},""),c=s.reduce(function(g,m){return g+m.vertex.mainEnd},""),d=s.reduce(function(g,m){return g+m.fragment.mainBefore},""),p=s.reduce(function(g,m){return g+m.fragment.mainStart},""),A=s.reduce(function(g,m){return g+m.fragment.mainModelColor},""),h=s.reduce(function(g,m){return g+m.fragment.mainEnd},"");e.vertexShader=e.vertexShader.replace(/MAIN_BEFORE/g,u),e.fragmentShader=e.fragmentShader.replace(/MAIN_BEFORE/g,d),e.vertexShader=e.vertexShader.replace(/MAIN_START/g,l),e.fragmentShader=e.fragmentShader.replace(/MAIN_START/g,p),e.vertexShader=e.vertexShader.replace(/MAIN_END/g,c),e.fragmentShader=e.fragmentShader.replace(/MAIN_END/g,h),e.fragmentShader=e.fragmentShader.replace(/MAIN_MODEL_COLOR/g,A);var v=String((o=(a=this.clippers)===null||a===void 0?void 0:a.length)!==null&&o!==void 0?o:0);e.vertexShader=e.vertexShader.replace(/NUM_CLIPPERS/g,v),e.fragmentShader=e.fragmentShader.replace(/NUM_CLIPPERS/g,v),s.forEach(function(g){g.onBeforeCompile(e,r)})},t.prototype.refreshUniforms=function(e){var r,i,a=this.uniforms;a.diffuse&&a.diffuse.value.copy(this.color),a.opacity&&(a.opacity.value=this.opacity),a.color&&a.diffuse.value.copy(this.color),a.emissive&&a.emissive.value.copy(this.emissive).multiplyScalar(this.emissiveIntensity),a.map&&(a.map.value=this.map),a.alphaMap&&(a.alphaMap.value=this.alphaMap),a.specularMap&&(a.specularMap.value=this.specularMap),a.envMap&&(a.envMap.value=this.envMap,a.flipEnvMap.value=!((r=this.envMap)===null||r===void 0)&&r.isCubeTexture?-1:1,a.reflectivity.value=this.reflectivity,a.refractionRatio.value=this.refractionRatio,a.maxMipLevel.value=this.envMap&&(i=e==null?void 0:e.properties.get(this.envMap).__maxMipLevel)!==null&&i!==void 0?i:0),a.lightMap&&(a.lightMap.value=this.lightMap,a.lightMapIntensity.value=this.lightMapIntensity),a.aoMap&&(a.aoMap.value=this.aoMap,a.aoMapIntensity.value=this.aoMapIntensity),a.specular&&a.specular.value.copy(this.specular),a.shininess&&(a.shininess.value=Math.max(this.shininess,1e-4)),a.emissiveMap&&(a.emissiveMap.value=this.emissiveMap),a.bumpMap&&(a.bumpMap.value=this.bumpMap,a.bumpScale.value=this.bumpScale,this.side===f.BackSide&&(a.bumpScale.value*=-1)),a.normalMap&&(a.normalMap.value=this.normalMap,a.normalScale.value.copy(this.normalScale),this.side===f.BackSide&&a.normalScale.value.negate()),a.displacementMap&&(a.displacementMap.value=this.displacementMap,a.displacementScale.value=this.displacementScale,a.displacementBias.value=this.displacementBias);var o;this.map?o=this.map:this.specularMap?o=this.specularMap:this.displacementMap?o=this.displacementMap:this.normalMap?o=this.normalMap:this.bumpMap?o=this.bumpMap:this.alphaMap?o=this.alphaMap:this.emissiveMap&&(o=this.emissiveMap),o!==void 0&&(o.matrixAutoUpdate===!0&&o.updateMatrix(),a.uvTransform.value.copy(o.matrix));var s;this.aoMap?s=this.aoMap:this.lightMap&&(s=this.lightMap),s!==void 0&&(s.matrixAutoUpdate===!0&&s.updateMatrix(),a.uv2Transform.value.copy(s.matrix))},t.prototype.update=function(e,r,i){var a="".concat(i.id,":").concat(i.materialVersion);a!==this.syncModelVersion&&(Object.assign(this,i.getMaterial()),this.syncModelVersion=a);var o=this.customShaders.map(function(m){return m.getHash()}).join("");this.customShaderHash!==o&&(this.customShaderHash=o,this.needsUpdate=!0);for(var s=this.customShaders.reduce(function(m,y){return Object.assign(m,y.defines)},{}),u=Object.keys(this.customShaderDefines),l=0,c=u;l<c.length;l++){var d=c[l];delete this.defines[d]}this.customShaderDefines=s,Object.assign(this.defines,this.customShaderDefines);for(var p=this.customShaders.reduce(function(m,y){return Object.assign(m,y.uniforms)},{}),A=Object.keys(this.customShaderUniforms),h=0,v=A;h<v.length;h++){var g=v[h];delete this.uniforms[g]}this.customShaderUniforms=p,Object.assign(this.uniforms,this.customShaderUniforms),this.visible=!0,this.refreshUniforms(e),this.shaderType==="none"?(this.depthWrite=!1,this.transparent=!0):(this.transparent=!1,this.depthWrite=!0,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.transparent&&(this.depthWrite=!1),this.floorStyle==="VISIBILITY"&&this.shownFloorIndex!==-1&&this.floor!==this.shownFloorIndex&&(this.visible=!1)),this.uniforms.pixelRatio.value=r.pixelRatio,this.uniforms.resolution.value.copy(r.resolution),this.uniforms.modelBoundingMax.value.copy(i.bounding.max),this.uniforms.modelBoundingMin.value.copy(i.bounding.min)},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.customShaders=e.customShaders,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.floorStyle=e.floorStyle,this.colorStyle=e.colorStyle,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.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.colorSaturation=e.colorSaturation,this.colorBrightness=e.colorBrightness,this.refreshUniforms(),this},t.prototype.clone=function(){return new this.constructor(this.shaderType).copy(this)},t}(f.ShaderMaterial);const vd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("{vs|z-sy|n-sy||H0vs-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\x07H<<u调整{vs|z-sy|n-p|y|`nnv|{H{vs|z-sy|n-p|y|Ovtu{rH0v{pyqr-Ip|zz|{K0v{pyqr-Is|tl}nlsntzr{K0v{pyqr-Iy|tqr}uosl}nlsntzr{K0v{pyqr-Ipyv}}v{tl}yn{rl}nlsntzr{Krp@-nqwP|y|arz}rnr5rp@-p|y|9-sy|n-rz}rnr6\n----<<-将色温范围从-:>;=-到->;=-映射到实际的色温范围----sy|n-rz}-J-5rz}rnr-8->;=6-7-B===;=H-<<-范围从-=-到->====----<<-计算色温系数----sy|n-lsnp|9-tlsnp|9-olsnp|H----vs-5rz}-IJ-CC==;=6-\n--------lsnp|-J->;=H--------tlsnp|-J-=;@F==E>BDEDCF=>FC=DEA-7-y|t5rz}-<->==;=6-:-=;C@>EA>AA@DEEC?DAB=FEH--------olsnp|-J-rz}-IJ->F==;=-L-=;=-G-=;BA@?=CDEF>>=>FC=DEA@-7-y|t5rz}-<->==;=-:->=;=6-:->;>FC?BA=EF>AH----\f-ryr-\n--------lsnp|-J->;?F?F@C>EC=C?DAB=FE=A-7-}|5rz}-<->==;=-:-C=;=9-:=;>@@?=ADBF?6H--------tlsnp|-J->;>?FEF=EC=EFB?FA>>DCB-7-}|5rz}-<->==;=-:-C=;=9-:=;=DBB>AEAF?6H--------olsnp|-J->;=H----\f----<<-调整颜色----rp@-nqwrqP|y|H----nqwrqP|y|;-J-pynz}5p|y|;-7-lsnp|9-=;=9->;=6H----nqwrqP|y|;t-J-pynz}5p|y|;t-7-tlsnp|9-=;=9->;=6H----nqwrqP|y|;o-J-pynz}5p|y|;o-7-olsnp|9-=;=9->;=6H----r{-nqwrqP|y|H\frp@-to?u5rp@-p6-\n----rpA-X-J-rpA5=;=9-:>;=-<-@;=9-?;=-<-@;=9-:>;=6H----rpA-}-J-zv\x075rpA5p;ot9-X; 69-rpA5p;to9-X;\x07\b69-r}5p;o9-p;t66H----rpA-\0-J-zv\x075rpA5};\x07\b9-p;69-rpA5p;9-};\b \x0769-r}5};\x079-p;66H----sy|n-q-J-\0;\x07-:-zv{5\0;9-\0;\b6H----sy|n-r-J->;=r:>=H----r{-rp@5no5\0; -8-5\0;-:-\0;\b6-<-5C;=-7-q-8-r669-q-<-5\0;\x07-8-r69-\0;\x076H\frp@-u?to5rp@-p6-\n----rpA-X-J-rpA5>;=9-?;=-<-@;=9->;=-<-@;=9-@;=6H----rp@-}-J-no5snp5p;\x07\x07\x07-8-X;\x07\b 6-7-C;=-:-X;6H----r{-p; -7-zv\x075X;\x07\x07\x079-pynz}5}-:-X;\x07\x07\x079-=;=9->;=69-p;\b6H\fZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--<<-JJJ-点大小剔除-JJJ--vs-5]|v{`v r-I-=;==>6-\n----qvpnqH--\f--<<-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-@;=-33-pp-K->;=6-\n------qvpnqH----\f--0r{qvs--<<-JJJJJJJJJJJJJ--0v{pyqr-Ipyv}}v{tl}yn{rlsntzr{K--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--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--ZNV[lZ\\QRYlP\\Y\\_--0v{pyqr-I|{rzn}}v{tlsntzr{K--0v{pyqr-Ir{p|qv{tlsntzr{K--<<-JJJ-颜色增益调整-JJJ--rp@-toP|y|-J-tylSntP|y|;toH--rp@-uP|y|-J-to?u5toP|y|6H--uP|y|;\b-8J-p|y|`nnv|{H--uP|y|; -8J-p|y|Ovtu{rH--tylSntP|y|;to-J-u?to5uP|y|6H--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--ZNV[lR[Q\f"),md=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("nvor-rp@-p|y|H0vs-qrsv{rq5b`RlP\\Y\\_lP\\[`aN[a6--{vs|z-rp@-p|{n{P|y|H0r{qvs0vs-qrsv{rq5b`RlP\\Y\\_lNYaVabQR6--{vs|z-nz}yr?Q-tnqvr{ar\x07rH0r{qvs0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvs{vs|z-rp?-r|yv|{H{vs|z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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--P|y|-J-p|y|H--<<-JJJ-高度色-JJJ--0vs-qrsv{rq5b`RlP\\Y\\_lNYaVabQR6----P|y|-J-trP|y|O\bUrvtu5tnqvr{ar\x07r9-d|yq]|vv|{6H--0r{qvs--<<-JJJJJJJJJJJ--<<-JJJ-纯色-JJJ--0vs-qrsv{rq5b`RlP\\Y\\_lP\\[`aN[a6----P|y|-J-p|{n{P|y|H--0r{qvs--<<-JJJJJJJJJJJ--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--ZNV[lR[Q\f");var Ad=Object.assign({pointScale:new f.Uniform(1),pointMinPixel:new f.Uniform(1),pointMaxPixel:new f.Uniform(1),opacity:new f.Uniform(1),gradientTexture:new f.Uniform(null),modelAlpha:new f.Uniform(0),clippers:new f.Uniform([]),shownFloorIndex:new f.Uniform(-1),constantColor:new f.Uniform(new f.Vector3),geometricError:new f.Uniform(0),pixelRatio:new f.Uniform(1),resolution:new f.Uniform(new f.Vector2(512,512)),floor:new f.Uniform(0),brightness:new f.Uniform(1),modelBoundingMin:new f.Uniform(new f.Vector3),modelBoundingMax:new f.Uniform(new f.Vector3),colorSaturation:new f.Uniform(0),colorBrightness:new f.Uniform(0)},f.UniformsUtils.clone(f.UniformsLib.fog)),Mi=function(n){ue(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,u,l,c,d,p,A,h,v,g,m,y,b,x,w,E,S,C,R,B,M,I=n.call(this,{vertexShader:md,fragmentShader:vd,uniforms:f.UniformsUtils.clone(Ad),lights:!1,clipping:!0,defines:{USE_COLOR_CONSTANT:!1,USE_COLOR_ALTITUDE:!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_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,L;return I.customShaderHash="",I.customShaderUniforms={},I.customShaderDefines={},Object.defineProperties(I,{constantColor:{get:function(){return this.uniforms.constantColor.value},set:function(T){this.uniforms.constantColor.value=T}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(T){this.uniforms.opacity.value=T}},modelAlpha:{get:function(){return this.uniforms.modelAlpha.value},set:function(T){this.uniforms.modelAlpha.value=T}},shownFloorIndex:{get:function(){return this.uniforms.shownFloorIndex.value},set:function(T){this.uniforms.shownFloorIndex.value=T}},clippers:{get:function(){return L},set:function(T){L!==T&&(L=T,this.uniforms.clippers.value=(L||[]).map(function(F){var D=typeof F.floorIndex=="number"?F.floorIndex:-1,V=new f.Matrix4().getInverse(F.clippingBoxMatrix);return{matrixInverse:V,floorIndex:D}}),this.needsUpdate=!0)}},colorStyle:{get:function(){return this.defines.USE_COLOR_CONSTANT?"CONSTANT":this.defines.USE_COLOR_ALTITUDE?"ALTITUDE":"RGB"},set:function(T){var F=T==="CONSTANT",D=T==="ALTITUDE";this.defines.USE_COLOR_CONSTANT!==F&&(this.defines.USE_COLOR_CONSTANT=F,this.needsUpdate=!0),this.defines.USE_COLOR_ALTITUDE!==D&&(this.defines.USE_COLOR_ALTITUDE=D,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(T){var F=T==="ATTENUATION",D=T==="GEOMETRIC";this.defines.USE_POINT_SIZE_GEOMETRIC!==D&&(this.defines.USE_POINT_SIZE_GEOMETRIC=D,this.needsUpdate=!0),this.defines.USE_POINT_SIZE_ATTENUATION!==F&&(this.defines.USE_POINT_SIZE_ATTENUATION=F,this.needsUpdate=!0)}},pointShape:{get:function(){return this.defines.USE_POINT_SHAPE_CIRCLE===!0?"CIRCLE":"SQUARE"},set:function(T){var F=T==="CIRCLE";this.defines.USE_POINT_SHAPE_CIRCLE!==F&&(this.defines.USE_POINT_SHAPE_CIRCLE=F,this.needsUpdate=!0)}},pointScale:{get:function(){return this.uniforms.pointScale.value},set:function(T){this.uniforms.pointScale.value=T}},pointBack:{get:function(){return this.defines.USE_POINT_BACK_HIDDEN===!0?"HIDDEN":this.defines.USE_POINT_BACK_DARK===!0?"DARK":"VISIBLE"},set:function(T){var F=T==="HIDDEN",D=T==="DARK";this.defines.USE_POINT_BACK_HIDDEN!==F&&(this.defines.USE_POINT_BACK_HIDDEN=F,this.needsUpdate=!0),this.defines.USE_POINT_BACK_DARK!==D&&(this.defines.USE_POINT_BACK_DARK=D,this.needsUpdate=!0)}},pointMinPixel:{get:function(){return this.uniforms.pointMinPixel.value},set:function(T){this.uniforms.pointMinPixel.value=T}},pointMaxPixel:{get:function(){return this.uniforms.pointMaxPixel.value},set:function(T){this.uniforms.pointMaxPixel.value=T}},useEDL:{get:function(){return this.defines.USE_EDL},set:function(T){T!==this.defines.USE_EDL&&(this.defines.USE_EDL=T,this.needsUpdate=!0)}},useHQWeight:{get:function(){return this.defines.USE_HQ_WEIGHT},set:function(T){T!==this.defines.USE_HQ_WEIGHT&&(this.defines.USE_HQ_WEIGHT=T,this.needsUpdate=!0)}},useHQDepth:{get:function(){return this.defines.USE_HQ_DEPTH},set:function(T){T!==this.defines.USE_HQ_DEPTH&&(this.defines.USE_HQ_DEPTH=T,this.needsUpdate=!0)}},gradientTexture:{get:function(){return this.uniforms.gradientTexture.value},set:function(T){this.uniforms.gradientTexture.value=T}},floor:{get:function(){return this.uniforms.floor.value},set:function(T){this.uniforms.floor.value=T}},brightness:{get:function(){return this.uniforms.brightness.value},set:function(T){this.uniforms.brightness.value=T}},colorSaturation:{get:function(){return this.uniforms.colorSaturation.value},set:function(T){this.uniforms.colorSaturation.value=T}},colorBrightness:{get:function(){return this.uniforms.colorBrightness.value},set:function(T){this.uniforms.colorBrightness.value=T}}}),I.pano0=(r=e.pano0)!==null&&r!==void 0?r:ge.pano0,I.pano1=(i=e.pano1)!==null&&i!==void 0?i:ge.pano1,I.modelAlpha=(a=e.modelAlpha)!==null&&a!==void 0?a:ge.modelAlpha,I.progress=(o=e.progress)!==null&&o!==void 0?o:ge.progress,I.transition=(s=e.transition)!==null&&s!==void 0?s:ge.transition,I.colorStyle=(u=e.colorStyle)!==null&&u!==void 0?u:ge.colorStyle,I.constantColor=(l=e.constantColor)!==null&&l!==void 0?l:ge.constantColor,I.opacity=(c=e.opacity)!==null&&c!==void 0?c:ge.opacity,I.floorStyle=(d=e.floorStyle)!==null&&d!==void 0?d:ge.floorStyle,I.shownFloorIndex=(p=e.shownFloorIndex)!==null&&p!==void 0?p:ge.shownFloorIndex,I.clippers=(A=e.clippers)!==null&&A!==void 0?A:ge.clippers,I.useEDL=(h=e.useEDL)!==null&&h!==void 0?h:ge.useEDL,I.useHQWeight=(v=e.useHQWeight)!==null&&v!==void 0?v:ge.useHQWeight,I.useHQDepth=(g=e.useHQDepth)!==null&&g!==void 0?g:ge.useHQDepth,I.pointShape=(m=e.pointShape)!==null&&m!==void 0?m:ge.pointShape,I.pointSize=(y=e.pointSize)!==null&&y!==void 0?y:ge.pointSize,I.pointScale=(b=e.pointScale)!==null&&b!==void 0?b:ge.pointScale,I.pointBack=(x=e.pointBack)!==null&&x!==void 0?x:ge.pointBack,I.pointMinPixel=(w=e.pointMinPixel)!==null&&w!==void 0?w:ge.pointMinPixel,I.pointMaxPixel=(E=e.pointMaxPixel)!==null&&E!==void 0?E:ge.pointMaxPixel,I.gradientTexture=(S=e.gradientTexture)!==null&&S!==void 0?S:ge.gradientTexture,I.brightness=(C=e.brightness)!==null&&C!==void 0?C:ge.brightness,I.colorSaturation=(R=e.colorSaturation)!==null&&R!==void 0?R:ge.colorSaturation,I.colorBrightness=(B=e.colorBrightness)!==null&&B!==void 0?B:ge.colorBrightness,I.customShaders=(M=e.customShaders)!==null&&M!==void 0?M:ge.customShaders,I.customShaderHash="",I.floor=0,I.transparent=!0,I}return t.prototype.onBeforeCompile=function(e,r){var i,a,o=this.customShaders.filter(function(v){return v.type.includes("pointcloud")}),s=o.reduce(function(v,g){return v+g.vertex.mainBefore},""),u=o.reduce(function(v,g){return v+g.vertex.mainStart},""),l=o.reduce(function(v,g){return v+g.vertex.mainEnd},""),c=o.reduce(function(v,g){return v+g.fragment.mainBefore},""),d=o.reduce(function(v,g){return v+g.fragment.mainStart},""),p=o.reduce(function(v,g){return v+g.fragment.mainModelColor},""),A=o.reduce(function(v,g){return v+g.fragment.mainEnd},"");e.vertexShader=e.vertexShader.replace(/MAIN_BEFORE/g,s),e.fragmentShader=e.fragmentShader.replace(/MAIN_BEFORE/g,c),e.vertexShader=e.vertexShader.replace(/MAIN_START/g,u),e.fragmentShader=e.fragmentShader.replace(/MAIN_START/g,d),e.vertexShader=e.vertexShader.replace(/MAIN_END/g,l),e.fragmentShader=e.fragmentShader.replace(/MAIN_END/g,A),e.fragmentShader=e.fragmentShader.replace(/MAIN_MODEL_COLOR/g,p);var h=String((a=(i=this.clippers)===null||i===void 0?void 0:i.length)!==null&&a!==void 0?a:0);e.vertexShader=e.vertexShader.replace(/NUM_CLIPPERS/g,h),e.fragmentShader=e.fragmentShader.replace(/NUM_CLIPPERS/g,h),o.forEach(function(v){v.onBeforeCompile(e,r)})},t.prototype.update=function(e,r,i){var a="".concat(i.id,":").concat(i.materialVersion);a!==this.syncModelVersion&&(Object.assign(this,i.getMaterial()),this.syncModelVersion=a);var o=this.customShaders.map(function(m){return m.getHash()}).join("");this.customShaderHash!==o&&(this.customShaderHash=o,this.needsUpdate=!0);for(var s=this.customShaders.reduce(function(m,y){return Object.assign(m,y.defines)},{}),u=Object.keys(this.customShaderDefines),l=0,c=u;l<c.length;l++){var d=c[l];delete this.defines[d]}this.customShaderDefines=s,Object.assign(this.defines,this.customShaderDefines);for(var p=this.customShaders.reduce(function(m,y){return Object.assign(m,y.uniforms)},{}),A=Object.keys(this.customShaderUniforms),h=0,v=A;h<v.length;h++){var g=v[h];delete this.uniforms[g]}this.customShaderUniforms=p,Object.assign(this.uniforms,this.customShaderUniforms),this.visible=!0,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=f.CustomBlending,this.blendSrc=f.SrcAlphaFactor,this.blendSrcAlpha=f.SrcAlphaFactor,this.blendDst=f.OneFactor,this.blendDstAlpha=f.OneFactor):(this.blending=f.NormalBlending,this.blendDst=f.OneMinusSrcAlphaFactor,this.blendEquation=f.AddEquation,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null),this.floorStyle==="VISIBILITY"&&this.shownFloorIndex!==-1&&this.floor!==this.shownFloorIndex&&(this.visible=!1),this.uniforms.pixelRatio.value=r.pixelRatio,this.uniforms.resolution.value.copy(r.resolution),this.uniforms.modelBoundingMax.value.copy(i.bounding.max),this.uniforms.modelBoundingMin.value.copy(i.bounding.min)},t.prototype.copy=function(e){return n.prototype.copy.call(this,this),this.customShaders=e.customShaders,this.pano0=e.pano0,this.pano1=e.pano1,this.progress=e.progress,this.transition=e.transition,this.floorStyle=e.floorStyle,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.colorStyle=e.colorStyle,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.colorSaturation=e.colorSaturation,this.colorBrightness=e.colorBrightness,this},t}(f.ShaderMaterial),mn=function(n){ue(t,n);function t(e){var r=e.preserveDrawingBuffer,i=r===void 0?!0:r,a=e.premultipliedAlpha,o=a===void 0?!0:a,s=e.stencil,u=s===void 0?!0:s,l=e.backgroundColor,c=l===void 0?1579548:l,d=e.backgroundAlpha,p=d===void 0?1:d,A=e.pixelRatio,h=A===void 0?1:A,v=e.antialias,g=v===void 0?!1:v,m=e.webgl2,y=e.logarithmicDepthBuffer,b=e.precision,x=e.powerPreference,w=this,E={antialias:g,alpha:!0,depth:!0,preserveDrawingBuffer:i,stencil:u,premultipliedAlpha:o,powerPreference:x},S={logarithmicDepthBuffer:y,precision:b};if(m){var C=document.createElement("canvas"),R=C.getContext("webgl2",E);R?w=n.call(this,O(O(O({},E),S),{antialias:!0,canvas:C,context:R}))||this:(console.error("error occurred when getting webgl2 canvas context, mybe webgl2 not support, fallback to webgl."),w=n.call(this,O(O({},E),S))||this)}else w=n.call(this,O(O({},E),S))||this;return w.setPixelRatio(h),w.setClearColor(c,p),w.outputEncoding=f.sRGBEncoding,w.autoClear=!0,w}return t}(f.WebGLRenderer),yu=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.add=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return n.prototype.add.apply(this,e)},t.prototype.remove=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return n.prototype.remove.apply(this,e)},t}(f.Scene);function tr(n,t){var e=Math.abs(Math.cos(n.latitude)),r=-Math.sin(n.longitude)*e,i=-Math.sin(n.latitude),a=-Math.cos(n.longitude)*e;return t?t.set(r,i,a):new f.Vector3(r,i,a)}var gd=1,yd=.1,bd=2e3,ki=Math.PI*2,Os=Math.PI/2;function Ia(n){return n>0&&n<=ki?n:(n%ki+ki)%ki}function xd(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 bu=function(n){ue(t,n);function t(e,r,i,a,o,s,u){r===void 0&&(r=gd),i===void 0&&(i=yd),a===void 0&&(a=bd),o===void 0&&(o=new f.Vector2),s===void 0&&(s=new f.Vector2(512,512)),u===void 0&&(u=1);var l=n.call(this)||this;l.fov=e,l.aspect=r,l.near=i,l.far=a,l.perspToOrtho=o,l.resolution=s,l.pixelRatio=u,l.time=0,l.needsRender=!0,l.refineModel=!0,l.pose={longitude:0,latitude:0,fov:e,distance:0,offset:new f.Vector3},l.computePose(),l.perspectiveCamera=new f.PerspectiveCamera(l.fov,l.aspect,.001,l.far);var c=Math.max(l.orthoDistance,.01)*Math.tan(.5*l.fov/180*Math.PI),d=-.5*l.aspect*2*c;return l.orthographicCamera=new f.OrthographicCamera(d,-d,c,-c,.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.autoNearFar=!0,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 tr(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(ce(r[9],-1,1)),Math.abs(r[9])<.9999999?this.pose.longitude=Ia(Math.atan2(r[8],r[10])):this.pose.longitude=Ia(Math.atan2(-r[2],r[0])),this.pose.fov=this.fov,this.pose.distance=e,this.pose.offset=new f.Vector3(-r[8],-r[9],-r[10]).setLength(this.pose.distance).add(this.position),this},t.prototype.setFromPose=function(e){var r,i,a,o,s,u=Ia((r=e.longitude)!==null&&r!==void 0?r:this.pose.longitude),l=Math.max(-Os+1e-4,Math.min(Os-1e-4,(i=e.latitude)!==null&&i!==void 0?i:this.pose.latitude)),c=(a=e.fov)!==null&&a!==void 0?a:this.pose.fov,d=(o=e.distance)!==null&&o!==void 0?o:this.pose.distance,p=(s=e.offset)!==null&&s!==void 0?s:this.pose.offset,A=tr({longitude:u,latitude:l}).normalize();return this.position.set(0,0,0),this.lookAt(A),this.position.add(p).sub(A.clone().setLength(d)),this.fov!==c&&(this.fov=c,this.updateProjectionMatrix()),this.updateMatrixWorld(!0),this.pose.longitude=u,this.pose.latitude=l,this.pose.fov=c,this.pose.distance=d,this.pose.offset.copy(p),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(){xd(this.orthographicCamera.projectionMatrix,this.perspectiveCamera.projectionMatrix,1-this.perspToOrtho.x,this.projectionMatrix),this.projectionMatrixInverse.getInverse(this.projectionMatrix),this.needsRender=!0},t.prototype.setViewOffset=function(e,r,i,a,o,s){this.perspectiveCamera.setViewOffset(e,r,i,a,o,s),this.orthographicCamera.setViewOffset(e,r,i,a,o,s),this.computeProjectionMatrix()},t.prototype.clearViewOffset=function(){this.perspectiveCamera.clearViewOffset(),this.orthographicCamera.clearViewOffset(),this.computeProjectionMatrix()},t.prototype.updateProjectionMatrix=function(){this.perspectiveCamera.updateProjectionMatrix(),this.orthographicCamera.updateProjectionMatrix(),this.computeProjectionMatrix()},Object.defineProperty(t.prototype,"perspectiveProjectionMatrix",{get:function(){return this.perspectiveCamera.projectionMatrix},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"perspectiveProjectionMatrixInverse",{get:function(){return this.perspectiveCamera.projectionMatrixInverse},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"orthographicProjectionMatrix",{get:function(){return this.orthographicCamera.projectionMatrix},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"orthographicProjectionMatrixInverse",{get:function(){return this.orthographicCamera.projectionMatrixInverse},enumerable:!1,configurable:!0}),t.prototype.updateTime=function(e){this.time=e;var r=!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(),r=!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 i=Math.max(this.orthoDistance,.01)*Math.tan(.5*this.fov/180*Math.PI),a=-.5*this.aspect*2*i;this.orthographicCamera.left=a,this.orthographicCamera.right=-a,this.orthographicCamera.top=i,this.orthographicCamera.bottom=-i,this.orthographicCamera.near=this.near,this.orthographicCamera.far=this.far,this.orthographicCamera.updateProjectionMatrix(),r=!0}r&&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(ve()),this},t}(f.Camera),Ft;(function(n){n[n.Outside=-1]="Outside",n[n.Intersecting=0]="Intersecting",n[n.Inside=1]="Inside"})(Ft||(Ft={}));var xu=1e-6,Ke=new f.Vector3,nn=new f.Matrix4,_r=new f.Vector3,jr=new f.Vector3,Jr=new f.Vector3,yo=new f.Vector3,Ta=new f.Box3,Pa=new f.Sphere,Ds=new f.Matrix4,Ra=new f.Ray,Rt=new f.Object3D,Vs=new f.Frustum;function wu(n,t){var e=n.elements;return t.setFromRotationMatrix(nn.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 ai=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 nn.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),Vs.setFromProjectionMatrix(nn),this.setFromFrustum(Vs),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=Ft.Inside,r=0,i=this.planes;r<i.length;r++){var a=i[r],o=t.intersectPlane(a);switch(o){case Ft.Outside:return Ft.Outside;case Ft.Intersecting:e=Ft.Intersecting;break}}return e},n.prototype.computeVisibilityWithPlaneMask=function(t,e){if(e===n.MASK_OUTSIDE||e===n.MASK_INSIDE)return e;for(var r=n.MASK_INSIDE,i=Math.min(32,this.planes.length),a=0;a<i;++a){var o=1<<a;if(e&o){var s=this.planes[a],u=t.intersectPlane(s);if(u===Ft.Outside)return n.MASK_OUTSIDE;u===Ft.Intersecting&&(r|=o)}}return r},n}(),Go=function(){function n(){this.type="box",this.center=new f.Vector3,this.halfSize=new f.Vector3,this.rotation=new f.Matrix3}return n.prototype.fromJson=function(t){var e=t.box;this.center.set(e[0],e[1],e[2]);var r=e[3],i=e[4],a=e[5],o=e[6],s=e[7],u=e[8],l=e[9],c=e[10],d=e[11],p=Math.max(Math.sqrt(r*r+i*i+a*a),.001),A=Math.max(Math.sqrt(o*o+s*s+u*u),.001),h=Math.max(Math.sqrt(l*l+c*c+d*d),.001);this.halfSize.set(p,A,h);var v=this.halfSize.toArray().reduce(function(g,m){return g+m},0);return(isNaN(v)||v<=0)&&this.halfSize.setScalar(xu),this.rotation.fromArray([r/p,i/p,a/p,o/A,s/A,u/A,l/h,c/h,d/h]),isNaN(this.rotation.toArray().reduce(function(g,m){return g+m},0))&&this.rotation.identity(),this},n.prototype.toJson=function(){return this.rotation.extractBasis(_r,jr,Jr),{box:vt(vt(vt(vt([],this.center.toArray(),!0),_r.multiplyScalar(this.halfSize.x).toArray(),!0),jr.multiplyScalar(this.halfSize.y).toArray(),!0),Jr.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 Rt.position.copy(this.center),wu(this.rotation,Rt.quaternion),Rt.scale.copy(this.halfSize),Rt.matrix.compose(Rt.position,Rt.quaternion,Rt.scale),Rt.matrix.premultiply(t),Rt.matrix.decompose(Rt.position,Rt.quaternion,Rt.scale),this.center.copy(Rt.position),this.rotation.setFromMatrix4(nn.makeRotationFromQuaternion(Rt.quaternion)),this.halfSize.copy(Rt.scale),this},n.prototype.getCenter=function(t){return t.copy(this.center)},n.prototype.distanceSquaredToPoint=function(t){var e=this.rotation.elements,r=t.x-this.center.x,i=t.y-this.center.y,a=t.z-this.center.z,o=0,s;return s=r*e[0]+i*e[1]+a*e[2],s<0&&(s=-s),s-=this.halfSize.x,s>0&&(o+=s*s),s=r*e[3]+i*e[4]+a*e[5],s<0&&(s=-s),s-=this.halfSize.y,s>0&&(o+=s*s),s=r*e[6]+i*e[7]+a*e[8],s<0&&(s=-s),s-=this.halfSize.z,s>0&&(o+=s*s),o},n.prototype.distanceToPoint=function(t){return Math.sqrt(this.distanceSquaredToPoint(t))},n.prototype.distanceToPlane=function(t){var e=t.projectPoint(this.center,new f.Vector3);return this.distanceToPoint(e)},n.prototype.getBoundingBox=function(t){return t.makeEmpty(),this.rotation.extractBasis(_r,jr,Jr),_r.setLength(this.halfSize.x),jr.setLength(this.halfSize.y),Jr.setLength(this.halfSize.z),t.expandByPoint(Ke.copy(this.center).add(_r)),t.expandByPoint(Ke.copy(this.center).sub(_r)),t.expandByPoint(Ke.copy(this.center).add(jr)),t.expandByPoint(Ke.copy(this.center).sub(jr)),t.expandByPoint(Ke.copy(this.center).add(Jr)),t.expandByPoint(Ke.copy(this.center).sub(Jr)),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);Ke.set(this.halfSize.x,this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,0),Ke.set(-this.halfSize.x,this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,3),Ke.set(-this.halfSize.x,-this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,6),Ke.set(this.halfSize.x,-this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,9),Ke.set(this.halfSize.x,this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,12),Ke.set(-this.halfSize.x,this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,15),Ke.set(-this.halfSize.x,-this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,18),Ke.set(this.halfSize.x,-this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,21);var r=new f.BufferGeometry;return r.setIndex(new f.BufferAttribute(t,1)),r.setAttribute("position",new f.BufferAttribute(e,3)),r.computeBoundingBox(),r.computeBoundingSphere(),r},n.prototype.intersectPlane=function(t){var e=this.center,r=t.normal,i=this.rotation.elements,a=this.halfSize,o=r.x,s=r.y,u=r.z,l=Math.abs(o*i[0]*a.x+s*i[1]*a.x+u*i[2]*a.x)+Math.abs(o*i[3]*a.y+s*i[4]*a.y+u*i[5]*a.y)+Math.abs(o*i[6]*a.z+s*i[7]*a.z+u*i[8]*a.z),c=r.dot(e)+t.constant;return c<=-l?Ft.Outside:c>=l?Ft.Inside:Ft.Intersecting},n.prototype.intersectRay=function(t,e){if(yo.copy(this.halfSize).multiplyScalar(2),Ta.setFromCenterAndSize(Ke.set(0,0,0),yo),this.rotation.extractBasis(_r,jr,Jr),nn.makeBasis(_r,jr,Jr),nn.setPosition(this.center),Ds.getInverse(nn),Ra.copy(t).applyMatrix4(Ds),Ta.containsPoint(Ra.origin))return!0;var r=Ra.intersectBox(Ta,Ke);return r?e!==void 0?r.applyMatrix4(nn).distanceTo(t.origin)<e:!0:!1},n}(),Ko=function(){function n(){this.type="sphere",this.center=new f.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],xu),this},n.prototype.toJson=function(){return{sphere:vt(vt([],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,yo.set(1,1,1).multiplyScalar(this.radius*2)),t},n.prototype.toGeometry=function(){for(var t=32,e=new Float32Array(t*3*2*2),r=0;r<=t;r++){var i=0;i=r/t*Math.PI*2,e[r*6+0]=this.center.x+Math.cos(i)*this.radius,e[r*6+1]=this.center.y+Math.sin(i)*this.radius,e[r*6+2]=this.center.z+0,i=(r+1)/t*Math.PI*2,e[r*6+3]=this.center.x+Math.cos(i)*this.radius,e[r*6+4]=this.center.y+Math.sin(i)*this.radius,e[r*6+5]=this.center.z+0}for(var r=t;r<=t*2;r++){var i=0;i=r/t*Math.PI*2,e[r*6+0]=this.center.x+Math.cos(i)*this.radius,e[r*6+1]=this.center.y+0,e[r*6+2]=this.center.z+Math.sin(i)*this.radius,i=(r+1)/t*Math.PI*2,e[r*6+3]=this.center.x+Math.cos(i)*this.radius,e[r*6+4]=this.center.y+0,e[r*6+5]=this.center.z+Math.sin(i)*this.radius}var a=new f.BufferGeometry;return a.setAttribute("position",new f.BufferAttribute(e,3)),a.computeBoundingBox(),a.computeBoundingSphere(),a},n.prototype.applyMatrix4=function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},n.prototype.getCenter=function(t){return t.copy(this.center)},n.prototype.distanceSquaredToPoint=function(t){var e=this.distanceToPoint(t);return e*e},n.prototype.distanceToPoint=function(t){var e=this.center.distanceTo(t)-this.radius;return e<=0?0:e},n.prototype.distanceToPlane=function(t){var e=Math.abs(t.distanceToPoint(this.center));return Math.max(0,e-this.radius)},n.prototype.intersectPlane=function(t){var e=this.center,r=this.radius,i=t.normal,a=i.dot(e)+t.constant;return a<-r?Ft.Outside:a<r?Ft.Intersecting:Ft.Inside},n.prototype.intersectRay=function(t,e){if(Pa.set(this.center,this.radius),Pa.containsPoint(t.origin))return!0;var r=t.intersectSphere(Pa,Ke);return r?e!==void 0?t.origin.distanceTo(r)<e:!0:!1},n}(),Eu=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 Ba(n){return n instanceof Go||n instanceof Ko||n instanceof Eu}function yn(n){if("box"in n)return new Go().fromJson(n);if("sphere"in n)return new Ko().fromJson(n);if("region"in n)return new Eu().fromJson(n);throw new Error("BoundingVolume ".concat(JSON.stringify(n)," never suppored."))}var Oi=[4821759,8191922,16637280,16739958,5822969,376977,16747077,9259235,14514687].map(function(n){return new f.LineBasicMaterial({color:n,depthWrite:!1,depthTest:!1,transparent:!0})}),wd=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);Ke.set(1,1,1).toArray(t,0),Ke.set(-1,1,1).toArray(t,3),Ke.set(-1,-1,1).toArray(t,6),Ke.set(1,-1,1).toArray(t,9),Ke.set(1,1,-1).toArray(t,12),Ke.set(-1,1,-1).toArray(t,15),Ke.set(-1,-1,-1).toArray(t,18),Ke.set(1,-1,-1).toArray(t,21);var e=new f.BufferGeometry;return e.setIndex(new f.BufferAttribute(n,1)),e.setAttribute("position",new f.BufferAttribute(t,3)),e.computeBoundingBox(),e.computeBoundingSphere(),e}(),Ed=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 f.BufferGeometry;return i.setAttribute("position",new f.BufferAttribute(t,3)),i.computeBoundingBox(),i.computeBoundingSphere(),i}();function Sd(n,t){if(n instanceof Go){var e=new f.LineSegments(wd,Oi[Math.min(t,Oi.length-1)]);return e.position.copy(n.center),wu(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 Ko){var e=new f.LineSegments(Ed,Oi[Math.min(t,Oi.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 Md=new f.Vector3,_o=function(){function n(t,e,r,i){var a=this,o,s,u,l;this.parent=null,this.contentParent=null,this.floor=0,this.id=t,this.state={visible:!1,frameNumber:0,selectedFrameNumber:0,requestedFrameNumber:0,touchedFrameNumber:0,distanceToCamera:0,centerZDepth:0,centerScreenY: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.contentParent=i?i.hasRenderContent?i:i.contentParent:null,this.level=this.parent?this.parent.level+1:0,this.tileset=r,this.refine=(o=e.refine)!==null&&o!==void 0?o:this.parent?this.parent.refine:"REPLACE",this.transform=new f.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=(u=(s=this.parent)===null||s===void 0?void 0:s.geometricError)!==null&&u!==void 0?u:0,e.content&&e.content.uri?(this.content={uri:e.content.uri,loadState:"UNLOADED",loadStateUpdateTime:ve(),loadfailRetryDelay:0,byteLength:0},e.content.group!==void 0&&(this.content.group=e.content.group),e.content.boundingVolume&&(this.content.boundingVolume=yn(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=yn(e.boundingVolume).applyMatrix4(this.transform)),e.viewerRequestVolume&&(this.viewerRequestVolume=yn(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.tileset.floorLength=Math.max(this.tileset.floorLength,this.floor+1)),this.boundingVolume&&(this.boundingVolumeDebugObject=Sd(this.boundingVolume,this.levelOfContent)),e.children?this.children=e.children.map(function(c,d){return new n("".concat(a.id,".").concat(d),c,r,a)}):this.children=[]}return n.prototype.traverse=function(t){t(this);for(var e=0,r=this.children;e<r.length;e++){var i=r[e];i.traverse(t)}},n.prototype.updateState=function(t){this.state.frameNumber=t.frameNumber;var e=this.tileset.transformIsIdentity?null:this.tileset.transform;if(this.boundingVolume){var r=e?this.boundingVolume.clone().applyMatrix4(e):this.boundingVolume;if(t.camera.type==="OrthographicCamera"){var i=new f.Plane().setFromNormalAndCoplanarPoint(t.camera.direction,t.camera.position);this.state.distanceToCamera=r.distanceToPlane(i)}else this.state.distanceToCamera=r.distanceToPoint(t.camera.position);var a=r.getCenter(Md).sub(t.camera.position);this.state.centerZDepth=t.camera.direction.dot(a),this.state.centerScreenY=t.camera.up.dot(a);var o=this.parent?this.parent.state.visibilityPlaneMask:ai.MASK_INDETERMINATE;this.state.visibilityPlaneMask=t.cullingVolume.computeVisibilityWithPlaneMask(r,o),this.state.visible=this.state.visibilityPlaneMask!==ai.MASK_OUTSIDE}else this.state.distanceToCamera=0,this.state.centerZDepth=0,this.state.visibilityPlaneMask=ai.MASK_INDETERMINATE,this.state.visible=!0;if(this.levelOfContent<=t.minLevelOfDetail&&(this.state.visible=!0),this.viewerRequestVolume){var s=e?this.viewerRequestVolume.clone().applyMatrix4(e):this.viewerRequestVolume;this.state.inRequestVolume=s.distanceSquaredToPoint(t.camera.position)<=0}else this.state.inRequestVolume=!0;this.state.screenSpaceError=this.getScreenSpaceError(t,this.state.distanceToCamera,!1)},Object.defineProperty(n.prototype,"selected",{get:function(){return this.state.selectedFrameNumber===this.tileset.frameNumber},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasChildren",{get:function(){return this.children.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"siblingIndex",{get:function(){var t,e;return(e=(t=this.parent)===null||t===void 0?void 0:t.children.indexOf(this))!==null&&e!==void 0?e:0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasTilesetContent",{get:function(){return this.children.length>0&&this.type==="TILESET"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasRenderContent",{get:function(){return this.type==="SCENEGRAPH"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"contentAvailable",{get:function(){var t;return this.hasRenderContent&&((t=this.content)===null||t===void 0?void 0:t.loadState)==="READY"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasUnloadedContent",{get:function(){var t;return((t=this.content)===null||t===void 0?void 0:t.loadState)==="UNLOADED"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasEmptyContent",{get:function(){return this.type==="EMPTY"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"contentReady",{get:function(){var t;return((t=this.content)===null||t===void 0?void 0:t.loadState)==="READY"||this.hasEmptyContent},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"contentByteLength",{get:function(){return this.content?this.content.byteLength:0},enumerable:!1,configurable:!0}),n.prototype.getScreenSpaceError=function(t,e,r){var i=this.tileset.transformIsIdentity?1:this.tileset.transform.getMaxScaleOnAxis(),a=this.parent?this.parent.geometricError:this.tileset.geometricError,o=i*(r?a:this.geometricError);if(o===0)return 0;var s=t.height,u=t.camera.type==="OrthographicCamera"?2:t.sseDenominator,l=Math.max(e,.001),c=o*s/(l*u);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)return-1;var e=this.parent,r=e&&(!t||this.state.screenSpaceError===0),i=r?e.state.screenSpaceError:this.state.screenSpaceError,a=this.tileset.root?this.tileset.root.state.screenSpaceError:0,o=Math.max(a-i,0);return o},n}(),Fa=new Map;function Ns(n,t){if(t&&t.has(n))return t.get(n);var e=n.refine==="ADD"||n.tileset.skipLevelOfDetail,r=n.parent,i=r&&(!e||n.state.screenSpaceError===0),a=i?r.state.screenSpaceError:n.state.screenSpaceError,o=n.tileset.root?n.tileset.root.state.screenSpaceError:0,s=Math.max(o-a,0);return t&&t.set(n,s),s}var Su=function(){function n(t,e){this.tileset=t,this.options=e,this.activeRequests=0,this.requestQueue=[]}return n.prototype.reset=function(){for(var t=0,e=this.requestQueue;t<e.length;t++){var r=e[t];this.options.onTileSkip&&this.options.onTileSkip(r.tile)}this.requestQueue.length=0},n.prototype.update=function(t,e,r){for(var i=this,a=r.time,o=this.requestQueue,s=new Set(t),u=0;u<o.length;u++){var l=o[u];if(s.has(l.tile)){s.delete(l.tile);continue}l.status==="WAITING"&&(o.splice(u,1),u--,this.options.onTileSkip&&this.options.onTileSkip(l.tile))}s.size>0&&(s.forEach(function(m){o.push({tile:m,status:"WAITING",time:a,error:null})}),s.clear());for(var c=this.tileset.maxRequests,u=0;u<o.length&&c>0;u++){var l=o[u];if(l.status==="DONE")l.error!==null?this.options.onTileError&&this.options.onTileError(l.tile,l.error):(c--,l.tile.content&&(l.tile.content.loadState="READY"),this.options.onTileLoad&&this.options.onTileLoad(l.tile)),o.splice(u,1),u--;else if(l.status==="PENDING"&&a-l.time<1e3)break}switch(Fa.clear(),e){case"SCREEN_SPACE_ERROR":{o.sort(function(m,y){if(m.tile.state.requestedFrameNumber!==y.tile.state.requestedFrameNumber)return y.tile.state.requestedFrameNumber-m.tile.state.requestedFrameNumber;if(m.tile.state.requestedFrameNumber===r.frameNumber){var b=Ns(m.tile,Fa),x=Ns(y.tile,Fa);return b-x}else return m.tile.level!==y.tile.level?m.tile.level-y.tile.level:m.tile.state.distanceToCamera-y.tile.state.distanceToCamera});break}case"SCREEN_VERTICAL":{o.sort(function(m,y){return m.tile.state.requestedFrameNumber!==y.tile.state.requestedFrameNumber?y.tile.state.requestedFrameNumber-m.tile.state.requestedFrameNumber:m.tile.state.requestedFrameNumber===r.frameNumber?m.tile.state.centerScreenY!==y.tile.state.centerScreenY?m.tile.state.centerScreenY-y.tile.state.centerScreenY:m.tile.state.centerZDepth!==y.tile.state.centerZDepth?m.tile.state.centerZDepth-y.tile.state.centerZDepth:m.tile.level!==y.tile.level?m.tile.level-y.tile.level:m.tile.state.distanceToCamera-y.tile.state.distanceToCamera:m.tile.level!==y.tile.level?m.tile.level-y.tile.level:m.tile.state.distanceToCamera-y.tile.state.distanceToCamera});break}case"SCREEN_LEVEL_VERTICAL":{o.sort(function(m,y){return m.tile.state.requestedFrameNumber!==y.tile.state.requestedFrameNumber?y.tile.state.requestedFrameNumber-m.tile.state.requestedFrameNumber:m.tile.state.requestedFrameNumber===r.frameNumber?m.tile.level!==y.tile.level?m.tile.level-y.tile.level:m.tile.state.centerScreenY!==y.tile.state.centerScreenY?m.tile.state.centerScreenY-y.tile.state.centerScreenY:m.tile.state.centerZDepth!==y.tile.state.centerZDepth?m.tile.state.centerZDepth-y.tile.state.centerZDepth:m.tile.state.distanceToCamera-y.tile.state.distanceToCamera:m.tile.level!==y.tile.level?m.tile.level-y.tile.level:m.tile.state.distanceToCamera-y.tile.state.distanceToCamera});break}}if(c=Math.max(this.tileset.maxRequests-this.activeRequests,0),!this.tileset.skipLevelOfDetail)for(var d=0,p=o.length,u=0;u<p;u++){var A=o[u].tile;if(A.hasTilesetContent||A.contentParent===null||A.contentParent.state.selectedFrameNumber===this.tileset.frameNumber){var h=o.splice(u,1);o.splice.apply(o,vt([d++,0],h,!1))}}for(var v=function(m){var y=o[m];y.status==="WAITING"&&(c--,y.status="PENDING",y.time=a,g.activeRequests++,g.tileset.options.tileLoader(y.tile).catch(function(b){y.error=b}).then(function(){y.status="DONE",y.tile.content&&y.tile.content.loadState==="READY"&&(y.tile.content.loadState="LOADING"),i.activeRequests--}))},g=this,u=0;u<o.length&&c>0;u++)v(u)},n}(),Cd=function(){function n(t,e,r){this.item=t,this.previous=e,this.next=r}return n}(),Id=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 Cd(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}(),Mu=function(){function n(t){t===void 0&&(t={}),this.options=t,this.cacheNodeMap=new Map,this.list=new Id,this.sentinel=this.list.add("sentinel")}return n.prototype.reset=function(){this.list.tail&&this.list.splice(this.list.tail,this.sentinel)},n.prototype.touchTile=function(t){var e=this.cacheNodeMap.get(t);e&&this.list.splice(this.sentinel,e)},n.prototype.loadTile=function(t){if(!this.cacheNodeMap.has(t)){var e=this.list.add(t);this.cacheNodeMap.set(t,e),this.options.onTileLoad&&this.options.onTileLoad(t)}},n.prototype.unloadTile=function(t){var e=this.cacheNodeMap.get(t);e&&(this.list.remove(e),this.cacheNodeMap.delete(t),this.options.onTileUnload&&this.options.onTileUnload(t))},n.prototype.unloadTiles=function(t){for(var e=this.list.head;e!==this.sentinel&&t();){var r=e.item;e=e.next,this.unloadTile(r)}},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}(),an=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}(),jo=function(){function n(t){this.tileset=t,this._canSelectTile=!0,this._loadAllTilesTraversalStack=new an,this.root=null}return n.prototype.traverse=function(t,e,r){this.root=t,this.reset()},n.prototype.reset=function(){this._loadAllTilesTraversalStack.reset(),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&&(t.state.selectedFrameNumber=e.frameNumber,this.tileset.selectedTiles.push(t),this.tileset.needsRefinedTiles.add(t))},n.prototype.loadTile=function(t,e){t.state.requestedFrameNumber<e.frameNumber&&(t.state.requestedFrameNumber=e.frameNumber,t.content&&(t.content.loadState==="FAILED"&&e.time-t.content.loadStateUpdateTime>t.content.loadfailRetryDelay&&(t.content.loadState="UNLOADED",t.content.loadStateUpdateTime=e.time),t.content.loadState==="UNLOADED"&&this.tileset.requestedTiles.push(t))),this.tileset.needsRefinedTiles.add(t)},n.prototype.touchTile=function(t,e){this.tileset.cache.touchTile(t),t.state.touchedFrameNumber=e.frameNumber},n.prototype.canTraverse=function(t,e){return!t.state.inRequestVolume||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 a=t.refine==="REPLACE";if(a&&r&&!this.anyChildrenVisible(t,e)){t.state.visible=!1;return}}},n.prototype.anyChildrenVisible=function(t,e){for(var r=!1,i=t.children,a=0,o=i;a<o.length;a++){var s=o[a];s.updateState(e),r=r||s.state.visible}return r},n.prototype.meetsScreenSpaceErrorEarly=function(t,e){var r=t.parent;return!r||r.refine!=="ADD"||r.levelOfContent<e.minLevelOfDetail?!1: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.prototype.loadAllTiles=function(t,e){var r=this._loadAllTilesTraversalStack;for(r.push(t);r.length>0;){var i=r.pop();i.content&&i.content.loadState==="UNLOADED"&&i.state.requestedFrameNumber<e.frameNumber&&this.tileset.requestedTiles.push(i),this.touchTile(i,e);for(var a=0,o=i.children;a<o.length;a++){var s=o[a];r.push(s)}}},n}(),Td=function(n){ue(t,n);function t(e){var r=n.call(this,e)||this;return r.tileset=e,r._traversalStack=new an,r._emptyTraversalStack=new an,r}return t.prototype.traverse=function(e,r,i){i===void 0&&(i=[]),n.prototype.traverse.call(this,e,r,i);for(var a=0,o=i;a<o.length;a++){var s=o[a];this._traversalStack.reset(),this._emptyTraversalStack.reset(),s.camera.refine&&(this._canSelectTile=s.camera.visible,this.updateTile(e,s),this.executeTraversal(e,s))}this._traversalStack.reset(),this._emptyTraversalStack.reset(),r.camera.refine&&(this._canSelectTile=r.camera.visible,this.updateTile(e,r),this.executeTraversal(e,r)),this.tileset.loadAll&&this.loadAllTiles(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 a=i.pop(),o=a.parent,s=!o||o.state.shouldRefine,u=!1;this.canTraverse(a,r)&&(u=this.updateAndPushChildren(a,r,i)&&s);var l=!u&&s;a.hasRenderContent?a.refine==="ADD"?(this.loadTile(a,r),this.selectDesiredTile(a,r)):a.refine==="REPLACE"&&(this.loadTile(a,r),l&&this.selectDesiredTile(a,r)):(this.loadTile(a,r),l&&this.selectDesiredTile(a,r)),this.touchTile(a,r),a.state.shouldRefine=u}},t.prototype.updateAndPushChildren=function(e,r,i){for(var a=e.children,o=0,s=a;o<s.length;o++){var u=s[o];this.updateTile(u,r)}this.sortTilesByDistanceToCamera(a);for(var l=e.refine==="REPLACE"&&!this.tileset.skipLevelOfDetail,c=!1,d=!0,p=0,A=a;p<A.length;p++){var u=A[p];if(u.levelOfContent<=r.minLevelOfDetail||u.state.visible&&u.state.inRequestVolume?(i.find(u)&&i.delete(u),i.push(u),c===!1&&(c=!0)):(l||this.tileset.loadSiblings)&&(this.loadTile(u,r),this.touchTile(u,r)),l){var h=void 0;u.state.inRequestVolume?u.hasRenderContent?h=u.contentAvailable:h=this.executeEmptyTraversal(u,r):h=!1,d=d&&h}}return c||(d=!1),d},t.prototype.selectDesiredTile=function(e,r){e.contentAvailable&&n.prototype.selectTile.call(this,e,r)},t.prototype.executeEmptyTraversal=function(e,r){var i=!0,a=this._emptyTraversalStack;for(a.push(e);a.length>0&&i;){var o=a.pop(),s=!o.hasRenderContent&&this.canTraverse(o,r);if(!s&&!o.contentAvailable&&(i=!1),this.updateTile(o,r),o.state.visible||(this.loadTile(o,r),this.touchTile(o,r)),s)for(var u=o.children,l=0,c=u;l<c.length;l++){var d=c[l];a.find(d)&&a.delete(d),a.push(d)}}return i},t}(jo),Pd=function(n){ue(t,n);function t(e){var r=n.call(this,e)||this;return r.tileset=e,r.baseScreenSpaceError=1024,r.skipScreenSpaceErrorFactor=16,r.skipLevels=1,r._traversalStack=new an,r._descendantTraversalStack=new an,r._selectionTraversalStack=new an,r._selectionTraversalancestorStack=new an,r}return t.prototype.traverse=function(e,r,i){i===void 0&&(i=[]),n.prototype.traverse.call(this,e,r,i);for(var a=0,o=i;a<o.length;a++){var s=o[a];this._traversalStack.reset(),s.camera.refine&&(this._canSelectTile=s.camera.visible,this.updateTile(e,s),this.executeTraversal(e,s),this.traverseAndSelect(e,s))}this.tileset.hasMixedContent=!1,this._traversalStack.reset(),this._descendantTraversalStack.reset(),this._selectionTraversalStack.reset(),this._selectionTraversalancestorStack.reset(),r.camera.refine&&(this._canSelectTile=r.camera.visible,this.updateTile(e,r),this.executeTraversal(e,r),this.traverseAndSelect(e,r)),this.tileset.loadAll&&this.loadAllTiles(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 a=i.pop();this.updateTileAncestorContentLinks(a,r);var o=a.parent,s=!o||o.state.shouldRefine,u=!1;this.canTraverse(a,r)&&(u=this.updateAndPushChildren(a,r,i)&&s);var l=!u&&s;a.hasRenderContent?a.refine==="ADD"?(this.loadTile(a,r),this.selectDesiredTile(a,r)):a.refine==="REPLACE"&&(this.inBaseTraversal(a,this.baseScreenSpaceError)?(this.loadTile(a,r),l&&this.selectDesiredTile(a,r)):l?(this.loadTile(a,r),this.selectDesiredTile(a,r)):this.reachedSkippingThreshold(a)&&this.loadTile(a,r)):(this.loadTile(a,r),l&&this.selectDesiredTile(a,r)),this.touchTile(a,r),a.state.shouldRefine=u}},t.prototype.updateAndPushChildren=function(e,r,i){for(var a=e.children,o=0,s=a;o<s.length;o++){var u=s[o];this.updateTile(u,r)}this.sortTilesByDistanceToCamera(a);for(var l=!1,c=0,d=a;c<d.length;c++){var u=d[c];u.levelOfContent<=r.minLevelOfDetail||u.state.visible&&u.state.inRequestVolume?(i.push(u),l===!1&&(l=!0)):this.tileset.loadSiblings&&(this.loadTile(u,r),this.touchTile(u,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 a=i.pop(),o=a.children,s=0,u=o;s<u.length;s++){var l=u[s];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 a=!(i.hasRenderContent&&i.hasUnloadedContent)||i.state.requestedFrameNumber===r.frameNumber;e.state.ancestorWithContent=a?i:i.state.ancestorWithContent,e.state.ancestorWithContentAvailable=i.contentAvailable?i:i.state.ancestorWithContentAvailable}},t.prototype.inBaseTraversal=function(e,r){return e.state.ancestorWithContent?e.parent&&e.state.screenSpaceError===0?e.parent.state.screenSpaceError>r:e.state.screenSpaceError>r:!0},t.prototype.traverseAndSelect=function(e,r){var i=this._selectionTraversalStack,a=this._selectionTraversalancestorStack,o;for(i.push(e);i.length>0||a.length>0;){if(a.length>0){var s=a.peek();if(s.state.stackLength===i.length){a.pop(),s!==o&&(s.state.finalResolution=!1),this.selectTile(s,r);continue}}var u=i.pop();if(u){var l=this.canTraverse(u,r);if(u.state.shouldSelect)if(u.refine==="ADD")this.selectTile(u,r);else{if(u.state.selectionDepth=a.length,u.state.selectionDepth>0&&(u.tileset.hasMixedContent=!0),o=u,!l){this.selectTile(u,r);continue}a.push(u),u.state.stackLength=i.length}if(l)for(var c=0,d=u.children;c<d.length;c++){var p=d[c];p.state.visible&&i.push(p)}}}},t}(jo),Rd=function(n){ue(t,n);function t(e){var r=n.call(this,e)||this;return r.tileset=e,r._traversalStack=new an,r}return t.prototype.canTraverse=function(e,r){return!(!e.state.inRequestVolume||e.levelOfContent>=r.maxLevelOfDetail||e.children.length===0)},t.prototype.traverse=function(e,r,i){n.prototype.traverse.call(this,e,r,[]),this._traversalStack.reset(),e.updateState(r);for(var a=0,o=i;a<o.length;a++){var s=o[a];this._traversalStack.reset(),s.camera.refine&&(this._canSelectTile=s.camera.visible,e.updateState(s),this.executeTraversal(e,s))}this._traversalStack.reset(),r.camera.refine&&(this._canSelectTile=r.camera.visible,e.updateState(r),this.executeTraversal(e,r)),this.tileset.loadAll&&this.loadAllTiles(e,r)},t.prototype.reset=function(){n.prototype.reset.call(this),this._traversalStack.reset()},t.prototype.executeTraversal=function(e,r){var i=this._traversalStack;for(i.push(e);i.length>0;){var a=i.pop(),o=a.refine==="ADD",s=a.refine==="REPLACE",u=this.canTraverse(a,r);u&&this.updateAndPushChildren(a,r,i),(o||s&&!u)&&(this.loadTile(a,r),this.touchTile(a,r),this.selectDesiredTile(a,r))}},t.prototype.updateAndPushChildren=function(e,r,i){for(var a=e.children,o=0;o<a.length;++o){var s=a[o];s.updateState(r),s.state.visible&&i.push(s)}},t.prototype.selectDesiredTile=function(e,r){e.contentAvailable&&n.prototype.selectTile.call(this,e,r)},t}(jo),Cu=function(){function n(t,e,r){this.index=t,this.name=e.name,this.visible=!1,this.tileset=r,this.transform=new f.Matrix4,e.transform&&this.transform.fromArray(e.transform),this.transform.premultiply(this.tileset.root.transform),this.content={uri:e.file,byteLength:0,loadState:"UNLOADED",loadStateUpdateTime:ve(),loadfailRetryDelay:0,data:void 0}}return n}(),Bd=new f.Matrix4,Or=function(){function n(t,e,r){var i=this,a,o,s,u,l,c,d,p,A;if(this.id=t,this.transform=new f.Matrix4,this.transformIsIdentity=!0,this.hasMixedContent=!1,this.url=(a=r.url)!==null&&a!==void 0?a:"",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,trajectories:(l=(u=e.asset.trajectories)===null||u===void 0?void 0:u.list)!==null&&l!==void 0?l:[],extras:e.asset.extras},this.rootMeta=(c=e.rootMeta)!==null&&c!==void 0?c:{},this.pointLength=(d=this.rootMeta.numTotalPoints)!==null&&d!==void 0?d:1/0,this.floorLength=(p=this.rootMeta.numFloors)!==null&&p!==void 0?p:1,this.properties=(A=e.properties)!==null&&A!==void 0?A:{},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.mostDetail=n.DEFAULT_MOST_DETAIL,this.loadSiblings=n.DEFAULT_LOAD_SIBLINGS,this.loadAll=n.DEFAULT_LOAD_ALL,this.maxRequests=n.DEFAULT_MAX_REQUESTS,this.tileRequestOrder=n.DEFAULT_REQUEST_ORDER,this.requestedTiles=[],this.selectedTiles=[],this.unloadTiles=[],this.needsRefinedTiles=new Set,this.selectedTrajectories=[],this.normalTraverser=new Td(this),this.skipTraverser=new Pd(this),this.mostDetailTraverser=new Rd(this),this.cache=new Mu({onTileLoad:function(g){i.memoryUsageInBytes+=g.contentByteLength},onTileUnload:function(g){i.memoryUsageInBytes-=g.contentByteLength,i.unloadTiles.push(g)}}),this.requestScheduler=new Su(this,{onTileSkip:function(g){},onTileLoad:function(g){var m;!((m=g.content)===null||m===void 0)&&m.data&&(i.loadedTiles.add(g),i.cache.loadTile(g)),i.options.onTileLoad(g)},onTileError:function(g,m){i.options.onTileError(g,m)}}),this.frameNumber=0,this.maxLevelOfDetail=0,this.minLevelOfDetail=0,this.loadedTiles=new Set,this.memoryUsageInBytes=0,this.root=new _o("".concat(this.id,".0"),e.root,this),this.geometricError=e.geometricError,this.trajectories=[],this.asset.trajectories)for(var h=0;h<this.asset.trajectories.length;h++){var v=new Cu(h,this.asset.trajectories[h],this);this.trajectories.push(v)}}return Object.defineProperty(n.prototype,"traverser",{get:function(){return this.mostDetail?this.mostDetailTraverser:this.skipLevelOfDetail?this.skipTraverser:this.normalTraverser},enumerable:!1,configurable:!0}),n.prototype.reset=function(){for(var t=this,e=[this.root],r;r=e.pop();){for(var i=0,a=r.children.length;i<a;i++)e.push(r.children[i]);this.cache.unloadTile(r)}for(var o=function(){var c=s.unloadTiles.pop();c&&(s.loadedTiles.delete(c),s.memoryUsageInBytes-=c.contentByteLength,s.options.tileUnloader(c).catch(function(){}).then(function(){t.options.onTileUnload&&t.options.onTileUnload(c)}))},s=this;this.unloadTiles.length;)o();this.cache.reset(),this.traverser.reset(),this.requestScheduler.reset(),this.loadedTiles.clear();for(var u=function(){var c=l.trajectories.pop();c&&l.options.trajectoryUnloader(c).catch(function(){}).then(function(){t.options.onTrajectoryUnload&&t.options.onTrajectoryUnload(c)})},l=this;this.trajectories.length;)u()},n.prototype.update=function(t,e){var r=this,i;e===void 0&&(e=[]),this.frameNumber=t.frameNumber,this.minLevelOfDetail=t.minLevelOfDetail,this.maxLevelOfDetail=t.maxLevelOfDetail,this.transformIsIdentity=this.transform.equals(Bd),this.traverser.traverse(this.root,t,e),this.cache.unloadTiles(function(){var p=r.memoryUsageInBytes>r.maxMemoryUsage*1024*1024;return p}),this.requestScheduler.update(this.requestedTiles,this.tileRequestOrder,t);for(var a=function(){var p=o.unloadTiles.pop();p&&(o.loadedTiles.delete(p),o.options.tileUnloader(p).catch(function(){}).then(function(){r.options.onTileUnload&&r.options.onTileUnload(p)}))},o=this;this.unloadTiles.length;)a();this.selectedTrajectories.length=0;for(var s=function(p){p.visible===!0&&p.content.loadState==="READY"&&(!((i=p.content.data)===null||i===void 0)&&i.object)?u.selectedTrajectories.push(p):p.visible===!0&&(p.content.loadState==="FAILED"&&t.time-p.content.loadStateUpdateTime>p.content.loadfailRetryDelay&&(p.content.loadState="UNLOADED",p.content.loadStateUpdateTime=t.time),p.content.loadState==="UNLOADED"&&u.options.trajectoryLoader(p).then(function(){r.options.onTrajectoryLoad(p)}).catch(function(A){r.options.onTrajectoryError(p,A)}))},u=this,l=0,c=this.trajectories;l<c.length;l++){var d=c[l];s(d)}},n.DEFAULT_MAX_MEMORY_USAGE=16,n.DEFAULT_MAX_SCREEN_SPACE_ERROR=4,n.DEFAULT_SKIP_LEVEL_OF_DETAIL=!1,n.DEFAULT_MOST_DETAIL=!1,n.DEFAULT_LOAD_SIBLINGS=!1,n.DEFAULT_LOAD_ALL=!1,n.DEFAULT_MAX_REQUESTS=6,n.DEFAULT_REQUEST_ORDER="SCREEN_SPACE_ERROR",n}(),Iu=function(){function n(t,e){this.position=t,this.indices=e}return n.prototype.getPositionCount=function(){var t,e,r=this.indices,i=this.position;return r?r.array.length/((t=r.stride)!==null&&t!==void 0?t:1):i.array.length/((e=i.stride)!==null&&e!==void 0?e:3)},n.prototype.getPositionByIndex=function(t,e){var r,i,a,o,s=this.indices,u=this.position,l=t;if(s){var c=s.array,d=(r=s.stride)!==null&&r!==void 0?r:1,p=(i=s.offset)!==null&&i!==void 0?i:0;l=c[t*d+p]}var A=u.array,h=(a=u.stride)!==null&&a!==void 0?a:3,v=(o=u.offset)!==null&&o!==void 0?o:0;return l=l*h+v,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}(),zn=function(){function n(t,e,r,i,a){this.id=t,this.extents=e,this.startIndex=r,this.endIndex=i,this.deepth=a}return n}(),Nr=6*4+4+4+2+2;function Tu(n,t){for(var e=new ArrayBuffer(t*Nr),r=new Float32Array(e),i=new Uint32Array(e),a=new Uint16Array(e),o=[n],s,u;s=o.pop();)u=s.id*Nr/4,r[u]=s.extents[0],r[u+1]=s.extents[1],r[u+2]=s.extents[2],r[u+3]=s.extents[3],r[u+4]=s.extents[4],r[u+5]=s.extents[5],i[u+6]=s.startIndex,i[u+7]=s.endIndex,u=s.id*Nr/2,s.node0&&(a[u+16]=s.node0.id,o.push(s.node0)),s.node1&&(a[u+17]=s.node1.id,o.push(s.node1));return e}function Pu(n,t,e,r,i,a,o,s,u){u===void 0&&(u=0),e=e-u,r=r-u,i=i-u,a=a+u,o=o+u,s=s+u;var l=0,c=0,d=0,p=0,A=0,h=0;return t.x>=0?(l=(e-n.x)*t.x,c=(a-n.x)*t.x):(l=(a-n.x)*t.x,c=(e-n.x)*t.x),t.y>=0?(d=(r-n.y)*t.y,p=(o-n.y)*t.y):(d=(o-n.y)*t.y,p=(r-n.y)*t.y),!(l>p||d>c||(d>l&&(l=d),p<c&&(c=p),t.z>=0?(A=(i-n.z)*t.z,h=(s-n.z)*t.z):(A=(s-n.z)*t.z,h=(i-n.z)*t.z),l>h||A>c)||(A>l&&(l=A),h<c&&(c=h),c<0))}var Mn=function(){function n(t,e,r){this.x=t,this.y=e,this.z=r}return n.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},n.prototype.set=function(t,e,r){return this.x=t,this.y=e,this.z=r,this},n.prototype.fromArray=function(t,e){return e===void 0&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},n.prototype.toArray=function(t,e){return t===void 0&&(t=[]),e===void 0&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},n.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this},n.prototype.multiplyScalar=function(t){return this.x*=t,this.y*=t,this.z*=t,this},n.prototype.subVectors=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},n.prototype.addScaledVector=function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},n.prototype.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z},n.prototype.cross=function(t){var e=this.x,r=this.y,i=this.z;return this.x=r*t.z-i*t.y,this.y=i*t.x-e*t.z,this.z=e*t.y-r*t.x,this},n.prototype.crossVectors=function(t,e){var r=t.x,i=t.y,a=t.z,o=e.x,s=e.y,u=e.z;return this.x=i*u-a*s,this.y=a*o-r*u,this.z=r*s-i*o,this},n.prototype.distanceTo=function(t){return Math.sqrt(this.distanceToSquared(t))},n.prototype.distanceToSquared=function(t){var e=this.x-t.x,r=this.y-t.y,i=this.z-t.z;return e*e+r*r+i*i},n.prototype.clone=function(){return new n(this.x,this.y,this.z)},n}(),Ru=function(){function n(t,e,r){this.triangle=t,this.intersectionPoint=e,this.index=r}return n}(),zs=1e-6,Je=new Mn(0,0,0),Xr=new Mn(0,0,0),Wr=new Mn(0,0,0),Zr=new Mn(0,0,0),Bu=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.createTree=function(e,r,i){r=Math.min(r,16);var a=this.getPositionCount()/3,o=a>65535?new Uint32Array(a):new Uint16Array(a),s=new Float32Array(a*6),u=[],l=0,c=-1;if(i)for(var d=0,p=0,A=0,h=void 0,v=void 0,g=void 0,m=void 0,y=void 0,b=void 0,x=void 0;d<a;d+=1,p+=3,A+=6)o[d]=d,this.getPositionByIndex(p,Xr),this.getPositionByIndex(p+1,Wr),this.getPositionByIndex(p+2,Zr),h=m=Xr.x,x=Wr.x,x<h&&(h=x),x>m&&(m=x),x=Zr.x,x<h&&(h=x),x>m&&(m=x),v=y=Xr.y,x=Wr.y,x<v&&(v=x),x>y&&(y=x),x=Zr.y,x<v&&(v=x),x>y&&(y=x),g=b=Xr.z,x=Wr.z,x<g&&(g=x),x>b&&(b=x),x=Zr.z,x<g&&(g=x),x>b&&(b=x),s[A]=h,s[A+1]=v,s[A+2]=g,s[A+3]=m,s[A+4]=y,s[A+5]=b;else{for(var w=1/0,E=1/0,S=1/0,C=-1/0,R=-1/0,B=-1/0,d=0,p=0,A=0,h=void 0,v=void 0,g=void 0,m=void 0,y=void 0,b=void 0,x=void 0;d<a;d+=1,p+=3,A+=6)o[d]=d,this.getPositionByIndex(p,Xr),this.getPositionByIndex(p+1,Wr),this.getPositionByIndex(p+2,Zr),h=m=Xr.x,x=Wr.x,x<h&&(h=x),x>m&&(m=x),x=Zr.x,x<h&&(h=x),x>m&&(m=x),v=y=Xr.y,x=Wr.y,x<v&&(v=x),x>y&&(y=x),x=Zr.y,x<v&&(v=x),x>y&&(y=x),g=b=Xr.z,x=Wr.z,x<g&&(g=x),x>b&&(b=x),x=Zr.z,x<g&&(g=x),x>b&&(b=x),s[A]=h,s[A+1]=v,s[A+2]=g,s[A+3]=m,s[A+4]=y,s[A+5]=b,h<w&&(w=h),m>C&&(C=m),v<E&&(E=v),y>R&&(R=y),g<S&&(S=g),b>B&&(B=b);i=[w,E,S,C,R,B]}var M=new zn(++c,i,0,a,0);u[l++]=M;var I=[],L=[0,1,2],T=function(D,V){return I[V]-I[D]};function F(D){var V=D.startIndex,z=D.endIndex,Q=D.extents;I[0]=Q[3]-Q[0],I[1]=Q[4]-Q[1],I[2]=Q[5]-Q[2],L.sort(T);for(var q=0;q<3;q++){for(var G=L[q],K=Q[G]+Q[G+3],j=V,J=z-1,W=-1,$=void 0;j<=J;)W===-1?($=o[j],s[$*6+G]+s[$*6+G+3]<K?j++:W=$):($=o[J],s[$*6+G]+s[$*6+G+3]>=K||(o[j]=$,o[J]=W,W=-1,j++),J--);if(j>V&&j<z){var Y=new zn(++c,Us(o,s,V,j,zs),V,j,D.deepth+1);Y.deepth<r&&Y.endIndex-Y.startIndex>e&&(u[l++]=Y);var Z=new zn(++c,Us(o,s,j,z,zs),j,z,D.deepth+1);Z.deepth<r&&Z.endIndex-Z.startIndex>e&&(u[l++]=Z),D.node0=Y,D.node1=Z,D.startIndex=0,D.endIndex=0;break}}}for(;l;)F(u[--l]);return this.offsetArray=o,this.rootNodePacked=Tu(M,c+1),u.length=0,this},t.prototype.trianglesInSphere=function(e,r){for(var i=this.offsetArray,a=this.rootNodePacked,o=new Float32Array(a),s=new Uint32Array(a),u=new Uint16Array(a),l=[0],c=[],d,p,A,h;(d=l.pop())!==void 0;){h=d*Nr/4;var v=La(e.x,o[h],o[h+3])-e.x,g=La(e.y,o[h+1],o[h+4])-e.y,m=La(e.z,o[h+2],o[h+5])-e.z;if(v*v+g*g+m*m<=r*r){for(var y=s[h+6];y<s[h+7];y++)c.push(i[y]);h=d*Nr/2,p=u[h+16],A=u[h+17],p&&l.push(p),A&&l.push(A)}}for(var b=c.length,x=new Float32Array(b*9),y=0;y<b;y++){var w=c[y];this.getPositionByIndex(w,Je),x[y*9]=Je.x,x[y*9+1]=Je.y,x[y*9+2]=Je.z,this.getPositionByIndex(w+1,Je),x[y*9+3]=Je.x,x[y*9+4]=Je.y,x[y*9+5]=Je.z,this.getPositionByIndex(w+2,Je),x[y*9+6]=Je.x,x[y*9+7]=Je.y,x[y*9+8]=Je.z}return x},t.prototype.intersectRay=function(e,r,i,a){for(var o=this.offsetArray,s=this.rootNodePacked,u=new Float32Array(s),l=new Uint32Array(s),c=new Uint16Array(s),d=new Mn(1/r.x,1/r.y,1/r.z),p=[0],A,h,v,g;(A=p.pop())!==void 0;)if(g=A*Nr/4,Pu(e,d,u[g],u[g+1],u[g+2],u[g+3],u[g+4],u[g+5])){for(var m=l[g+6],y=l[g+7],b=void 0,x=void 0,w=void 0,E=e.x,S=e.y,C=e.z,R=r.x,B=r.y,M=r.z,I=void 0,L=void 0,T=void 0,F=void 0,D=void 0,V=void 0,z=void 0,Q=void 0,q=void 0,G=void 0,K=void 0,j=void 0,J=void 0,W=void 0,$=void 0,Y=void 0,Z=void 0,oe=void 0,ne=void 0,de=void 0,se=void 0,ye=void 0,ie=void 0,xe=void 0,Le=void 0,Me=void 0,Oe=void 0;m<y;m++){if(b=o[m],x=b*3,this.getPositionByIndex(x,Je),I=Je.x,L=Je.y,T=Je.z,this.getPositionByIndex(x+1,Je),F=Je.x,D=Je.y,V=Je.z,this.getPositionByIndex(x+2,Je),z=Je.x,Q=Je.y,q=Je.z,G=F-I,K=D-L,j=V-T,J=z-I,W=Q-L,$=q-T,Y=K*$-j*W,Z=j*J-G*$,oe=G*W-K*J,ie=R*Y+B*Z+M*oe,ie>0)ye=1;else if(ie<0)ye=-1,ie=-ie;else continue;ne=E-I,de=S-L,se=C-T,xe=ye*(R*(de*$-se*W)+B*(se*J-ne*$)+M*(ne*W-de*J)),!(xe<0)&&(Le=ye*(R*(K*se-j*de)+B*(j*ne-G*se)+M*(G*de-K*ne)),!(Le<0)&&(xe+Le>ie||(Me=-ye*(ne*Y+de*Z+se*oe),!(Me<0)&&(Oe=Me/ie,a.push(new Ru([I,L,T,F,D,V,z,Q,q],[E+R*Oe,S+B*Oe,C+M*Oe],b))))))}g=A*Nr/2,h=c[g+16],v=c[g+17],h&&p.push(h),v&&p.push(v)}return a},t}(Iu);function La(n,t,e){return n<t?t:n>e?e:n}function Us(n,t,e,r,i){if(e>=r)return[0,0,0,0,0,0];for(var a=1/0,o=1/0,s=1/0,u=-1/0,l=-1/0,c=-1/0,d=e,p=void 0,A=void 0;d<r;d++)p=n[d]*6,A=t[p],A<a&&(a=A),A=t[p+1],A<o&&(o=A),A=t[p+2],A<s&&(s=A),A=t[p+3],A>u&&(u=A),A=t[p+4],A>l&&(l=A),A=t[p+5],A>c&&(c=A);return[a-i,o-i,s-i,u+i,l+i,c+i]}var Qs=1e-6,Fd=["x","y","z"],xt=new Mn(0,0,0),Fu=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.createTree=function(e,r,i){r=Math.min(r,16);var a=this.getPositionByIndex.bind(this),o=this.getPositionCount(),s=o>65535?new Uint32Array(o):new Uint16Array(o),u=[],l=0,c=-1;if(i)for(var d=0;d<o;d+=1)s[d]=d;else{a(0,xt);for(var p=xt.x,A=xt.y,h=xt.z,v=p,g=A,m=h,d=0,y=void 0,b=void 0,x=void 0;d<o;d+=1)s[d]=d,a(d,xt),y=xt.x,b=xt.y,x=xt.z,y<p?p=y:y>v&&(v=y),b<A?A=b:b>g&&(g=b),x<h?h=x:x>m&&(m=x);i=[p,A,h,v,g,m]}var w=new zn(++c,i,0,o,0);u[l++]=w;var E=[],S=[0,1,2],C=function(B,M){return E[M]-E[B]};function R(B){var M=B.startIndex,I=B.endIndex,L=B.extents;E[0]=L[3]-L[0],E[1]=L[4]-L[1],E[2]=L[5]-L[2];for(var T=S.sort(C)[0],F=Fd[T],D=(L[T]+L[T+3])/2,V=M,z=I-1,Q=-1,q;V<=z;)Q===-1?(q=s[V],a(q,xt),xt[F]<D?V++:Q=q):(q=s[z],a(q,xt),xt[F]>=D||(s[V]=q,s[z]=Q,Q=-1,V++),z--);if(V>M){var G=L.slice();G[T+3]=D+Qs;var K=new zn(++c,G,M,V,B.deepth+1);K.deepth<r&&K.endIndex-K.startIndex>e&&(u[l++]=K),B.node0=K}if(I>V){var j=L.slice();j[T]=D-Qs;var J=new zn(++c,j,V,I,B.deepth+1);J.deepth<r&&J.endIndex-J.startIndex>e&&(u[l++]=J),B.node1=J}B.startIndex=0,B.endIndex=0}for(;l;)R(u[--l]);return this.offsetArray=s,this.rootNodePacked=Tu(w,c+1),u.length=0,this},t.prototype.intersectRay=function(e,r,i,a){for(var o=this.offsetArray,s=this.rootNodePacked,u=new Float32Array(s),l=new Uint32Array(s),c=new Uint16Array(s),d=i*i,p=new Mn(1/r.x,1/r.y,1/r.z),A=[0],h,v,g,m;(h=A.pop())!==void 0;)if(m=h*Nr/4,Pu(e,p,u[m],u[m+1],u[m+2],u[m+3],u[m+4],u[m+5],i)){for(var y=l[m+6],b=l[m+7],x=void 0,w=void 0,E=void 0,S=void 0,C=void 0,R=void 0,B=void 0,M=void 0,I=void 0,L=void 0,T=void 0,F=void 0;y<b;y++)x=o[y],this.getPositionByIndex(x,xt),w=xt.x,E=xt.y,S=xt.z,C=e.x,R=e.y,B=e.z,M=r.x,I=r.y,L=r.z,T=M*(w-C)+I*(E-R)+L*(S-B),T>0&&(C+=M*T,R+=I*T,B+=L*T),M=w-C,I=E-R,L=S-B,T=M*M+I*I+L*L,T<=d&&a.push(new Ru([w,E,S,w,E,S,w,E,S],[C,R,B],x));m=h*Nr/2,v=c[m+16],g=c[m+17],v&&A.push(v),g&&A.push(g)}return a},t}(Iu);const Lu="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3ZhciBlcj1mdW5jdGlvbihlLHIpe3JldHVybiBlcj1PYmplY3Quc2V0UHJvdG90eXBlT2Z8fHtfX3Byb3RvX186W119aW5zdGFuY2VvZiBBcnJheSYmZnVuY3Rpb24odCxvKXt0Ll9fcHJvdG9fXz1vfXx8ZnVuY3Rpb24odCxvKXtmb3IodmFyIGYgaW4gbylPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwobyxmKSYmKHRbZl09b1tmXSl9LGVyKGUscil9O2Z1bmN0aW9uIGhyKGUscil7aWYodHlwZW9mIHIhPSJmdW5jdGlvbiImJnIhPT1udWxsKXRocm93IG5ldyBUeXBlRXJyb3IoIkNsYXNzIGV4dGVuZHMgdmFsdWUgIitTdHJpbmcocikrIiBpcyBub3QgYSBjb25zdHJ1Y3RvciBvciBudWxsIik7ZXIoZSxyKTtmdW5jdGlvbiB0KCl7dGh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9MCx5PTAscD0wLGE9MCxoPTA7cmV0dXJuIHIueD49MD8odT0odC1lLngpKnIueCx3PShkLWUueCkqci54KToodT0oZC1lLngpKnIueCx3PSh0LWUueCkqci54KSxyLnk+PTA/KHk9KG8tZS55KSpyLnkscD0odi1lLnkpKnIueSk6KHk9KHYtZS55KSpyLnkscD0oby1lLnkpKnIueSksISh1PnB8fHk+d3x8KHk+dSYmKHU9eSkscDx3JiYodz1wKSxyLno+PTA/KGE9KGYtZS56KSpyLnosaD0obi1lLnopKnIueik6KGE9KG4tZS56KSpyLnosaD0oZi1lLnopKnIueiksdT5ofHxhPncpfHwoYT51JiYodT1hKSxoPHcmJih3PWgpLHc8MCkpfXZhciBZPWZ1bmN0aW9uKCl7ZnVuY3Rpb24gZShyLHQsbyl7dGhpcy54PXIsdGhpcy55PXQsdGhpcy56PW99cmV0dXJuIGUucHJvdG90eXBlLmNvcHk9ZnVuY3Rpb24ocil7cmV0dXJuIHRoaXMueD1yLngsdGhpcy55PXIueSx0aGlzLno9ci56LHRoaXN9LGUucHJvdG90eXBlLnNldD1mdW5jdGlvbihyLHQsbyl7cmV0dXJuIHRoaXMueD1yLHRoaXMueT10LHRoaXMuej1vLHRoaXN9LGUucHJvdG90eXBlLmZyb21BcnJheT1mdW5jdGlvbihyLHQpe3JldHVybiB0PT09dm9pZCAwJiYodD0wKSx0aGlzLng9clt0XSx0aGlzLnk9clt0KzFdLHRoaXMuej1yW3QrMl0sdGhpc30sZS5wcm90b3R5cGUudG9BcnJheT1mdW5jdGlvbihyLHQpe3JldHVybiByPT09dm9pZCAwJiYocj1bXSksdD09PXZvaWQgMCYmKHQ9MCksclt0XT10aGlzLngsclt0KzFdPXRoaXMueSxyW3QrMl09dGhpcy56LHJ9LGUucHJvdG90eXBlLmFkZD1mdW5jdGlvbihyKXtyZXR1cm4gdGhpcy54Kz1yLngsdGhpcy55Kz1yLnksdGhpcy56Kz1yLnosdGhpc30sZS5wcm90b3R5cGUubXVsdGlwbHlTY2FsY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XJyYXksdSYmdS5idWZmZXIgaW5zdGFuY2VvZiBBcnJheUJ1ZmZlciYmby5hZGQodS5idWZmZXIpLG8uYWRkKHMucm9vdE5vZGVQYWNrZWQpfXJldHVybntvdXRwdXQ6dCx0cmFuc2ZlcjpBcnJheS5mcm9tKG8pfX0pfSl9KSgpOwo=",Ld=n=>Uint8Array.from(atob(n),t=>t.charCodeAt(0)),qs=typeof self!="undefined"&&self.Blob&&new Blob([Ld(Lu)],{type:"text/javascript;charset=utf-8"});function kd(n){let t;try{if(t=qs&&(self.URL||self.webkitURL).createObjectURL(qs),!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,"+Lu,{name:n==null?void 0:n.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var ku=function(){function n(t,e){this.pool=e,this.workerCreator=t,this.queue=[],this.workers=[],this.workersResolver=[],this.workerStatus=0}return n.prototype.initWorker=function(t){if(this.workerCreator&&!this.workers[t]){var e=this.workerCreator();e.addEventListener("message",this.onMessage.bind(this,t)),this.workers[t]=e}},n.prototype.getIdleWorker=function(){for(var t=0;t<this.pool;t++)if(!(this.workerStatus&1<<t))return t;return-1},n.prototype.onMessage=function(t,e){var r=this.workersResolver[t],i=r.resolve,a=r.reject;if(e.data&&"$$error"in e.data?a(e.data.$$error):i(e.data),this.queue.length){var o=this.queue.shift(),s=o.resolve,u=o.reject,l=o.input,c=o.transfer;this.workersResolver[t]={resolve:s,reject:u},this.workers[t].postMessage(l,c)}else this.workerStatus^=1<<t},n.prototype.postMessage=function(t,e){var r=this;return e===void 0&&(e=[]),new Promise(function(i,a){var o=r.getIdleWorker();o!==-1?(r.initWorker(o),r.workerStatus|=1<<o,r.workersResolver[o]={resolve:i,reject:a},r.workers[o].postMessage(t,e)):r.queue.push({resolve:i,reject:a,input:t,transfer:e})})},n.prototype.dispose=function(){this.workers.forEach(function(t){return t.terminate()}),this.workersResolver.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0},n}(),Od=new ku(function(){return new kd},4),Dd=new Map,Un=new f.Ray,Hs=new f.Matrix3,oi=new f.Matrix4,Ou=new f.Vector3,Vd=new f.Vector3,Nd=new f.Vector3,zd=new f.Triangle;function Ud(n,t,e,r){var i,a=n.matrixWorld;oi.getInverse(a),Un.copy(e.ray).applyMatrix4(oi);for(var o=t.intersectRay(Un.origin,Un.direction,0,[]),s=n.geometry,u=n.material,l=s.groups,c=s.index,d=0,p=o.length;d<p;d++){var A=o[d],h=A.triangle,v=A.index,g=A.intersectionPoint,m=new f.Vector3(g[0],g[1],g[2]).applyMatrix4(a),y=e.ray.origin.distanceTo(m);if(!(y<e.near||y>e.far)){var b=void 0;if(Array.isArray(u)){if(l)for(var x=v*3,w=0,E=l;w<E.length;w++){var S=E[w];if(x>=S.start&&x-S.start<S.count){b=u[(i=S.materialIndex)!==null&&i!==void 0?i:0];break}}}else b=u;if(b){var C=zd.set(Ou.set(h[0],h[1],h[2]).applyMatrix4(a),Vd.set(h[3],h[4],h[5]).applyMatrix4(a),Nd.set(h[6],h[7],h[8]).applyMatrix4(a)).getNormal(new f.Vector3),R=v*3,B=new f.Face3(c?c.array[R]:R,c?c.array[R+1]:R+1,c?c.array[R+2]:R+2,C),M=e.ray.direction.dot(C);b.side===f.FrontSide&&M>=0||b.side===f.BackSide&&M<=0||r.push({distance:y,object:n,face:B,point:m,distanceToRay:0,faceIndex:v})}}}}function Qd(n,t,e,r){var i,a,o=n.matrixWorld;Hs.getNormalMatrix(o),oi.getInverse(o);var s=((a=(i=e.params.Points)===null||i===void 0?void 0:i.threshold)!==null&&a!==void 0?a:1)*oi.getMaxScaleOnAxis();Un.copy(e.ray).applyMatrix4(oi);for(var u=t.intersectRay(Un.origin,Un.direction,s,[]),l=n.geometry,c=l.index,d=l.getAttribute("normal"),p=0,A=u.length;p<A;p++){var h=u[p],v=h.triangle,g=h.index,m=h.intersectionPoint,y=new f.Vector3(m[0],m[1],m[2]).applyMatrix4(o),b=e.ray.origin.distanceTo(y);if(!(b<e.near||b>e.far)){var x=Ou.set(v[0],v[1],v[2]).applyMatrix4(o),w=c?c.array[g]:g,E=void 0;if(d instanceof f.BufferAttribute){var S=new f.Vector3().fromBufferAttribute(d,w).applyNormalMatrix(Hs);E=new f.Face3(w,w,w,S)}r.push({distance:b,object:n,face:E,point:y,distanceToRay:y.distanceTo(x),index:g})}}}var Du="__bvh_mesh__",qd=f.Mesh.prototype.raycast;function Hd(n,t){var e=Gd(this);e?Ud(this,e,n,t):qd.call(this,n,t)}function Gd(n){var t=n[Du];return t instanceof Bu,t}function Kd(n,t){var e;Object.assign(n,(e={},e[Du]=t,e.raycast=Hd,e))}var Vu="__bvh_points__",_d=f.Points.prototype.raycast;function jd(n,t){var e=Jd(this);e?Qd(this,e,n,t):_d.call(this,n,t)}function Jd(n){var t=n[Vu];return t instanceof Fu,t}function Xd(n,t){var e;Object.assign(n,(e={},e[Vu]=t,e.raycast=jd,e))}function Wd(n,t,e,r){var i=[];return n.traverse(function(a){(a instanceof f.Mesh||a instanceof f.Points)&&a.geometry instanceof f.BufferGeometry&&i.push(a)}),Promise.resolve().then(function(){for(var a=[],o=new Set,s=null,u=0;u<i.length;u++){var l=i[u],c=l.geometry;if(c instanceof f.BufferGeometry){var d=void 0;if(l instanceof f.Mesh?d="mesh":l instanceof f.Points&&(d="points"),!!d){var p=c.boundingBox,A=p?[p.min.x,p.min.y,p.min.z,p.max.x,p.max.y,p.max.z]:void 0,h={};for(var v in c.attributes){var g=c.attributes[v];g instanceof f.InterleavedBufferAttribute?(h[v]={array:g.data.array,stride:g.data.stride,offset:g.offset},s=g.data.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer)):(h[v]={array:g.array},s=g.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer))}var m=void 0,y=c.getIndex();y&&(y instanceof f.InterleavedBufferAttribute?(m={array:y.data.array,stride:y.data.stride,offset:y.offset},s=y.data.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer)):(m={array:y.array},s=y.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer)));var b={type:d,attributes:h,indices:m,maxItemPerNode:e,maxTreeDepth:r,extents:A};a.push(b)}}}return Od.postMessage(a,Array.from(o))}).then(function(a){for(var o=0;o<i.length;o++){var s=i[o],u=s.geometry,l=a[o];if(u instanceof f.BufferGeometry){for(var c in l.attributes){var d=l.attributes[c].array,p=u.attributes[c];p instanceof f.InterleavedBufferAttribute?p.data.array=d:p.array=d}var A=u.getIndex();if(A&&l.indices){var d=l.indices.array;A instanceof f.InterleavedBufferAttribute?A.data.array=d:A.array=d}if(s instanceof f.Mesh){var h=new Bu(l.attributes.position,l.indices);h.offsetArray=l.offsetArray,h.rootNodePacked=l.rootNodePacked,Kd(s,h)}else if(s instanceof f.Points){var h=new Fu(l.attributes.position,l.indices);h.offsetArray=l.offsetArray,h.rootNodePacked=l.rootNodePacked,Xd(s,h)}}}return n})}var Nu=function(n){ue(t,n);function t(e,r,i){i===void 0&&(i=U);var a=n.call(this)||this;return a.contentObject=r,a.name=e,a.materials=[],a.pbmObjects=[],a.disposers=[i],a.add(r),r.traverse(function(o){var s;if(o instanceof f.Mesh||o instanceof f.Points){var u=o.material;Array.isArray(u)?(s=a.materials).push.apply(s,u):a.materials.push(u)}(o instanceof kt||o instanceof mr)&&a.pbmObjects.push(o)}),a}return t.prototype.generateBvhTree=function(){return Wd(this,!0,200,10)},t.prototype.intersectRaycaster=function(e,r,i){r===void 0&&(r=!0),i===void 0&&(i=[]);for(var a=this.children.slice(),o,s=[];o=a.pop();)if(o.visible){o.raycast(e,s);for(var u=0,l=o.children.length;u<l;u++)a.push(o.children[u])}return s.forEach(function(c){var d=0;if((c.object instanceof kt||c.object instanceof mr)&&c.face){var p=Array.isArray(c.object.material)?c.object.material[c.face.materialIndex]:c.object.material;p&&(d=p.floor)}c.floor=d}),r&&s.sort(function(c,d){return c.distance-d.distance}),i.push.apply(i,s),i},t.prototype.update=function(e,r,i,a){for(var o=0,s=this.pbmObjects;o<s.length;o++){var u=s[o];u.update(e,r,i,a)}},t.prototype.dispose=function(){for(var e=0,r=this.disposers;e<r.length;e++){var i=r[e];i()}this.disposers.length=0,this.pbmObjects.length=0},t.prototype.clone=function(){return new t(this.name,this.contentObject.clone())},t}(f.Object3D);function st(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=[];n=n.map(function(s){return(s!=null?s:"").trim()}).filter(function(s){return s.length>0&&!/^\/+$/.test(s)});for(var r=0;r<n.length;r++){var i=r===0,a=r===n.length-1,o=n[r];i||(o=o.replace(/^\.\//,"").replace(/^\/+/,"")),a||(o=o.replace(/\/+$/,"")),e.push(o)}return e.join("/")}function Gi(n){var t,e=/^(http\:|https\:|file\:)?\/\/[^/]/.exec(n);if(!e)return n;var r=e[1]||"",i=n.slice(r.length+2),a=i.indexOf("#");a>=0&&(n.slice(a),i=n.slice(0,a));var o=i.indexOf("?");o>=0&&(n.slice(o),i=n.slice(0,o));for(var s=i.split("/"),u=s.shift(),l=(t=s.pop())!==null&&t!==void 0?t:"",c=[],d=0,p=s;d<p.length;d++){var A=p[d];if(!(A===""||A===".")){if(A===".."){c.pop();continue}c.push(A)}}return r+"//"+u+"/"+c.join("/")+"/"+l}function Ur(n){return n.indexOf("//")===0||/^[0-9a-z]+\:/i.test(n)}function zu(n,t,e){var r;if(n.content){var i=(r=n.content.uri)!==null&&r!==void 0?r:n.content.url;typeof i=="string"&&!Ur(i)&&(n.content.uri=Gi(st(t,i)))}if(n.transform){for(var a=!1,o=0;o<16;o++){var s=n.transform[o];if(typeof s!="number"||isNaN(s)||!isFinite(s)){a=!0;break}}if(n.transform[15]===0&&(a=!0),a)throw new Error("Invalid Tile Transform: "+JSON.stringify(n.transform))}if(n.children)for(var u=0,l=n.children;u<l.length;u++){var c=l[u];zu(c,t)}return n}function Ki(n,t){if(n.asset||(n.asset={}),n.rootMeta||(n.rootMeta={}),n.rootMeta.taskParameters||(n.rootMeta.taskParameters={}),n.asset.overview){var e=n.asset.overview;Ur(e.imageFile)||(e.imageFile=Gi(st(t,e.imageFile))),Ur(e.worldFile)||(e.worldFile=Gi(st(t,e.worldFile)))}if(n.asset.trajectories)for(var r=0;r<n.asset.trajectories.list.length;r++){var i=n.asset.trajectories.list[r];i.file=Gi(st(t,i.file))}return zu(n.root,t),n}function Zd(n,t,e){for(var r,i,a=Promise.resolve(),o=n.slice(),s=function(){for(var u=[],l=0,c=void 0;c=o.shift();){u.push(c);var d=((r=c.image)===null||r===void 0?void 0:r.width)*((i=c.image)===null||i===void 0?void 0:i.height);if(!isNaN(d)&&isFinite(d)&&(l+=d),l>=e)break}a=a.then(function(){return new Promise(function(p){Et.shared.add(function(){for(var A=0,h=u;A<h.length;A++){var v=h[A];t.initTexture(v)}p()},!0)})}).catch(function(){})};o.length>0;)s();return a}function fa(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)}var ka=4;function Uu(n,t,e){var r=new DataView(t);if(n.magic=r.getUint32(e,!0),e+=ka,n.version=r.getUint32(e,!0),e+=ka,n.byteLength=r.getUint32(e,!0),e+=ka,n.version!==1)throw new Error("3D Tile Version ".concat(n.version," not supported"));return e}var wr,at;(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"})(at||(at={}));var Yd=(wr={},wr[at.DOUBLE]=Float64Array,wr[at.FLOAT]=Float32Array,wr[at.UNSIGNED_SHORT]=Uint16Array,wr[at.UNSIGNED_INT]=Uint32Array,wr[at.UNSIGNED_BYTE]=Uint8Array,wr[at.BYTE]=Int8Array,wr[at.SHORT]=Int16Array,wr[at.INT]=Int32Array,wr),$d={DOUBLE:at.DOUBLE,FLOAT:at.FLOAT,UNSIGNED_SHORT:at.UNSIGNED_SHORT,UNSIGNED_INT:at.UNSIGNED_INT,UNSIGNED_BYTE:at.UNSIGNED_BYTE,BYTE:at.BYTE,SHORT:at.SHORT,INT:at.INT};function $i(n){var t=Yd[n];if(!t)throw new Error("Failed to convert GL type");return t}function Oa(n){var t=$i(n);return t.BYTES_PER_ELEMENT}function Gs(n,t,e,r){e===void 0&&(e=0);var i=$i(n);if(e%Oa(n)!==0){var a=r?t.slice(e,e+r*Oa(n)):t.slice(e);return new i(a)}else return new i(t,e,r!=null?r:(t.byteLength-e)/Oa(n))}function eh(n){var t=$d[n];if(!t)throw new Error("Failed to convert GL type");return t}var Qu=function(){function n(t,e){this.featuresLength=0,this.cachedTypedArrays={},this.json=t,this.buffer=e;var r=this.getGlobalProperty("POINTS_LENGTH",at.UNSIGNED_INT,1);r&&r.length&&(this.featuresLength=r[0])}return n.prototype.getExtension=function(t){return this.json.extensions&&this.json.extensions[t]},n.prototype.hasProperty=function(t){return!!this.json[t]},n.prototype.getGlobalProperty=function(t,e,r){var i=this.json[t];if(typeof i=="number"){var a=$i(e);return new a([i])}else if(Array.isArray(i)){var a=$i(e);return new a(i)}else if(i&&Number.isFinite(i.byteOffset))return this.getTypedArrayFromBinary(t,e,r,1,i.byteOffset);return null},n.prototype.getPropertyArray=function(t,e,r){var i=this.json[t];return i&&Number.isFinite(i.byteOffset)?("componentType"in i&&(e=eh(i.componentType)),this.getTypedArrayFromBinary(t,e,r,this.featuresLength,i.byteOffset)):this.getTypedArrayFromArray(t,e,i)},n.prototype.getProperty=function(t,e,r,i,a){var o=this.json[t];if(!o)return null;var s=this.getPropertyArray(t,e,r);if(r===1)return a[0]=s[i],a;for(var u=0;u<r;++u)a[u]=s[r*i+u];return a},n.prototype.getTypedArrayFromBinary=function(t,e,r,i,a){var o=this.cachedTypedArrays,s=o[t];return s||(s=Gs(e,this.buffer.buffer,this.buffer.byteOffset+a,i*r),o[t]=s),s},n.prototype.getTypedArrayFromArray=function(t,e,r){var i=this.cachedTypedArrays,a=i[t];return a||(a=Gs(e,r),i[t]=a),a},n}(),Bn=4,Ks="b3dm tile in legacy format.";function qu(n,t,e){var r=new TextDecoder("utf8"),i=new Uint8Array(n,t,e),a=r.decode(i);return a}function Hu(n,t,e){return e=th(n,t,e),e=rh(n,t,e),e=nh(n,t,e),e}function th(n,t,e){var r=new DataView(t),i=0;n.header=n.header||{};var a=r.getUint32(e,!0);e+=Bn;var o=r.getUint32(e,!0);e+=Bn;var s=r.getUint32(e,!0);e+=Bn;var u=r.getUint32(e,!0);return e+=Bn,s>=570425344?(e-=Bn*2,i=a,s=o,u=0,a=0,o=0,console.warn(Ks)):u>=570425344&&(e-=Bn,i=s,s=a,u=o,a=0,o=0,console.warn(Ks)),n.header.featureTableJsonByteLength=a,n.header.featureTableBinaryByteLength=o,n.header.batchTableJsonByteLength=s,n.header.batchTableBinaryByteLength=u,n.header.batchLength=i,e}function rh(n,t,e){var r=n.header||{},i=r.featureTableJsonByteLength,a=r.featureTableBinaryByteLength,o=r.batchLength;if(n.featureTableJson={BATCH_LENGTH:o||0},i&&i>0){var s=qu(t,e,i);n.featureTableJson=JSON.parse(s)}e+=i||0,n.featureTableBinary=new Uint8Array(t,e,a),e+=a||0,n.rtcCenter=[0,0,0];var u=new Qu(n.featureTableJson,n.featureTableBinary);if(Array.isArray(u.json.RTC_CENTER)){var l=u.json.RTC_CENTER;n.rtcCenter[0]=l[0],n.rtcCenter[1]=l[1],n.rtcCenter[2]=l[2]}else{var l=u.getGlobalProperty("RTC_CENTER",at.FLOAT,3);l&&(n.rtcCenter[0]=l[0],n.rtcCenter[1]=l[1],n.rtcCenter[2]=l[2])}return e}function nh(n,t,e){var r=n.header||{},i=r.batchTableJsonByteLength,a=r.batchTableBinaryByteLength;if(i&&i>0){var o=qu(t,e,i);n.batchTableJson=JSON.parse(o),e+=i,a&&a>0&&(n.batchTableBinary=new Uint8Array(t,e,a),n.batchTableBinary=new Uint8Array(n.batchTableBinary),e+=a)}return e}function ih(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 ah(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=ih(t,e,r),n.byteLength}function ea(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 Qe={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},Yn={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},ta={9728:f.NearestFilter,9729:f.LinearFilter,9984:f.NearestMipmapNearestFilter,9985:f.LinearMipmapNearestFilter,9986:f.NearestMipmapLinearFilter,9987:f.LinearMipmapLinearFilter},ra={33071:f.ClampToEdgeWrapping,33648:f.MirroredRepeatWrapping,10497:f.RepeatWrapping},_s={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Zt={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Yr={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},oh={CUBICSPLINE:void 0,LINEAR:f.InterpolateLinear,STEP:f.InterpolateDiscrete},Fr={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function Bt(n){var t=[];for(var e in n)t.push(n[e]);return t}function sh(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 uh=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,a=e.length;i<a;i++)for(var o=e[i].joints,s=0,u=o.length;s<u;s++)t[o[s]].isBone=!0;for(var l=0,c=t.length;l<c;l++){var d=t[l];d.mesh!==void 0&&d.skin!==void 0&&(r[d.mesh].isSkinnedMesh=!0)}},n.prototype.parse=function(){var t=this,e=this.json,r=this.extensions;this.markDefs();for(var i=0,a=Bt(r);i<a.length;i++){var o=a[i];o.markDefs(this)}return Promise.all(Bt(r).map(function(s){return s.prepare(t)})).then(function(){var s,u,l;return Promise.all([Promise.all(((s=e.scenes)!==null&&s!==void 0?s:[]).map(function(c,d){return t.loadScene(d)})),Promise.all(((u=e.animations)!==null&&u!==void 0?u:[]).map(function(c,d){return t.loadAnimation(d)})),Promise.all(((l=e.cameras)!==null&&l!==void 0?l:[]).map(function(c,d){return t.loadCamera(d)}))])}).then(function(s){var u=s[0],l=s[1],c=s[2],d={json:e,scene:u[e.scene||0],scenes:u,animations:l,cameras:c,textures:[],dispose:U};return d}).then(function(s){return Promise.all(Bt(r).map(function(u){return u.emitResult(s,t)})).then(function(){return s})}).then(function(s){var u=Array.from(t.textureSet),l=sh(t.disposeSet);return Object.assign(s,{textures:u,dispose:l}),t.textureSet.clear(),t.disposeSet.clear(),t.dispose(),s})},n.prototype.loadCamera=function(t){var e="camera:"+t,r=this.cache.get(e);if(r)return r;for(var i=null,a=0,o=Bt(this.extensions);a<o.length;a++){var s=o[a];if(i=s.loadCamera(t,this),i)break}if(!i){var u=void 0,l=this.json.cameras[t],c=l[l.type];c?l.type==="perspective"?u=new f.PerspectiveCamera(f.MathUtils.radToDeg(c.yfov),c.aspectRatio||1,c.znear||1,c.zfar||2e6):l.type==="orthographic"?u=new f.OrthographicCamera(-c.xmag,c.xmag,c.ymag,-c.ymag,c.znear,c.zfar):(console.warn("glTF: Invalid camera type ".concat(l.type,".")),u=new f.Camera):(console.warn("glTF: Missing camera parameters."),u=new f.Camera),l.name&&(u.name=this.createUniqueName(l.name)),i=Promise.resolve(u)}return this.cache.set(e,i),i},n.prototype.loadSkin=function(t){var e="animation:"+t,r=this.cache.get(e);if(r)return r;var i,a=this.json.skins[t],o={joints:a.joints};return a.inverseBindMatrices===void 0?i=Promise.resolve(o):i=this.loadAccessor(a.inverseBindMatrices).then(function(s){return s&&(o.inverseBindMatrices=s),o}),this.cache.set(e,i),i},n.prototype.loadAnimation=function(t){var e="animation:"+t,r=this.cache.get(e);if(r)return r;for(var i=null,a=0,o=Bt(this.extensions);a<o.length;a++){var s=o[a];if(i=s.loadAnimation(t,this),i)break}if(!i){for(var u=this.json,l=u.animations[t],c=[],d=[],p=[],A=[],h=[],v=0,g=l.channels.length;v<g;v++){var m=l.channels[v],y=l.samplers[m.sampler],b=m.target,x=b.node!==void 0?b.node:b.id,w=l.parameters!==void 0?l.parameters[y.input]:y.input,E=l.parameters!==void 0?l.parameters[y.output]:y.output;c.push(this.loadNode(x)),d.push(this.loadAccessor(w)),p.push(this.loadAccessor(E)),A.push(y),h.push(b)}i=Promise.all([Promise.all(c),Promise.all(d),Promise.all(p),Promise.all(A),Promise.all(h)]).then(function(S){for(var C=S[0],R=S[1],B=S[2],M=S[3],I=S[4],L=[],T=function(z,Q){var q=C[z],G=R[z],K=B[z],j=M[z],J=I[z];if(q===void 0)return"continue";q.updateMatrix(),q.matrixAutoUpdate=!0;var W=void 0;switch(Yr[J.path]){case Yr.weights:W=f.NumberKeyframeTrack;break;case Yr.rotation:W=f.QuaternionKeyframeTrack;break;case Yr.position:case Yr.scale:default:W=f.VectorKeyframeTrack;break}var $=q.name?q.name:q.uuid,Y=j.interpolation!==void 0?oh[j.interpolation]:f.InterpolateLinear,Z=[];Yr[J.path]===Yr.weights?q.traverse(function(xe){xe.morphTargetInfluences&&Z.push(xe.name?xe.name:xe.uuid)}):Z.push($);var oe=K.array;if(K.normalized){for(var ne=Da(oe.constructor),de=new Float32Array(oe.length),se=0,ye=oe.length;se<ye;se++)de[se]=oe[se]*ne;oe=de}for(var se=0,ye=Z.length;se<ye;se++){var ie=new W(Z[se]+"."+Yr[J.path],G.array,oe,Y);L.push(ie)}},F=0,D=C.length;F<D;F++)T(F);var V=l.name?l.name:"animation_"+t;return new f.AnimationClip(V,void 0,L)})}return this.cache.set(e,i),i},n.prototype.loadBuffer=function(t){var e=this.json.buffers[t];if(e.type&&e.type!=="arraybuffer")throw new Error("glTF: "+e.type+" buffer type is not supported.");var r="buffer:"+t,i=this.cache.get(r);if(i)return i;for(var a=null,o=0,s=Bt(this.extensions);o<s.length;o++){var u=s[o];if(a=u.loadBuffer(t,this),a)break}if(!a){var l=this.json.buffers[t];a=this.options.fetcher.ajax(this.resolveResouce(l.uri),{responseType:"arraybuffer"}).then(function(c){return c.body})}return this.cache.set(r,a),a},n.prototype.loadBufferView=function(t){var e="bufferView:"+t,r=this.cache.get(e);if(r)return r;for(var i=null,a=0,o=Bt(this.extensions);a<o.length;a++){var s=o[a];if(i=s.loadBufferView(t,this),i)break}if(!i){var u=this.json.bufferViews[t];i=this.loadBuffer(u.buffer).then(function(l){var c=u.byteLength||0,d=u.byteOffset||0;return l.slice(d,d+c)})}return this.cache.set(e,i),i},n.prototype.loadAccessor=function(t){var e=this,r="accessor:"+t,i=this.cache.get(r);if(i)return i;var a=null;if(!a){var o=this.json.accessors[t];if(o.bufferView===void 0&&o.sparse===void 0)a=Promise.resolve(null);else{var s=[];o.bufferView!==void 0?s.push(this.loadBufferView(o.bufferView)):s.push(Promise.resolve(null)),o.sparse!==void 0&&(s.push(this.loadBufferView(o.sparse.indices.bufferView)),s.push(this.loadBufferView(o.sparse.values.bufferView))),a=Promise.all(s).then(function(u){var l=u[0],c=_s[o.type],d=Yn[o.componentType],p=d.BYTES_PER_ELEMENT,A=p*c,h=o.byteOffset||0,v=o.bufferView!==void 0?e.json.bufferViews[o.bufferView].byteStride:void 0,g=o.normalized===!0,m,y;if(v&&v!==A){var b=Math.floor(h/v),x="InterleavedBuffer:"+o.bufferView+":"+o.componentType+":"+b+":"+o.count,w=e.cache.get(x);w||(m=new d(l,b*v,o.count*v/p),w=new f.InterleavedBuffer(m,v/p),e.cache.set(x,w)),y=new f.InterleavedBufferAttribute(w,c,h%v/p,g)}else l===null?m=new d(o.count*c):m=new d(l,h,o.count*c),y=new f.BufferAttribute(m,c,g);if(o.sparse!==void 0){var E=_s.SCALAR,S=Yn[o.sparse.indices.componentType],C=o.sparse.indices.byteOffset||0,R=o.sparse.values.byteOffset||0,B=new S(u[1],C,o.sparse.count*E),M=new d(u[2],R,o.sparse.count*c);l!==null&&(y=new f.BufferAttribute(y.array.slice(),y.itemSize,y.normalized));for(var I=0,L=B.length;I<L;I++){var T=B[I];if(y.setX(T,M[I*c]),c>=2&&y.setY(T,M[I*c+1]),c>=3&&y.setZ(T,M[I*c+2]),c>=4&&y.setW(T,M[I*c+3]),c>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return y})}}return this.cache.set(r,a),a},n.prototype.createPrimitiveKey=function(t){for(var e=0,r=Bt(this.extensions);e<r.length;e++){var i=r[e],a=i.createPrimitiveKey(t,this);if(a)return a}for(var o="",s=Object.keys(t.attributes).sort(),u=0,l=s.length;u<l;u++)o+=s[u]+":"+t.attributes[s[u]]+";";return t.indices+":"+o+":"+t.mode},n.prototype.loadGeometry=function(t){for(var e=this,r=null,i=0,a=Bt(this.extensions);i<a.length;i++){var o=a[i];if(r=o.loadGeometry(t,this),r)break}return r||(r=this.addGeometryPrimitiveAttributes(new f.BufferGeometry,t)),r=r.then(function(s){return e.disposeSet.add(s),s}),r},n.prototype.loadImage=function(t){for(var e=this,r=null,i=0,a=Bt(this.extensions);i<a.length;i++){var o=a[i];if(r=o.loadImage(t,this),r)break}if(!r){var s=this.json.images[t];if(s.bufferView!==void 0){var u=this.json.bufferViews[s.bufferView];r=this.loadBuffer(u.buffer).then(function(c){var d=u.byteOffset||0,p=u.byteLength||0,A=new Uint8Array(c,d,p),h=new Blob([A],{type:s.mimeType});return go(h)})}else if(s.uri){var l=this.resolveResouce(s.uri);r=this.options.fetcher.loadImage(l,{},void 0,void 0,void 0,hi()).then(function(c){return c.body})}else throw new Error("glTF: Invalid image defs.")}return r=r.then(function(c){return e.disposeSet.add(c),c}),r},n.prototype.loadMaterialAsMeshStandardMaterial=function(t){var e=this,r=[],i=new f.MeshStandardMaterial;if(i.color=new f.Color(1,1,1),i.opacity=1,Object.keys(t.attributes).filter(function(c){return Zt[c]==="color"}).length>0&&(i.vertexColors=!0),Object.keys(t.attributes).filter(function(c){return Zt[c]==="normal"}).length===0&&(i.flatShading=!0),Object.keys(t.attributes).filter(function(c){return Zt[c]==="tangent"}).length===0&&(i.normalScale&&(i.normalScale.y*=-1),i.clearcoatNormalScale&&(i.clearcoatNormalScale.y*=-1)),t.material!==void 0){var a=this.json.materials[t.material];a.name&&(i.name=a.name);var o=a.pbrMetallicRoughness||{};if(Array.isArray(o.baseColorFactor)){var s=o.baseColorFactor;i.color.fromArray(s),i.opacity=s[3]}o.baseColorTexture!==void 0&&r.push(this.createMaterialTexture(o.baseColorTexture).then(function(c){c.encoding=f.sRGBEncoding,i.map=c,e.disposeSet.add(c)})),i.metalness=o.metallicFactor!==void 0?o.metallicFactor:1,i.roughness=o.roughnessFactor!==void 0?o.roughnessFactor:1,o.metallicRoughnessTexture!==void 0&&r.push(this.createMaterialTexture(o.metallicRoughnessTexture).then(function(c){c.encoding=f.sRGBEncoding,i.metalnessMap=c,i.roughnessMap=c,e.disposeSet.add(c)})),a.doubleSided===!0&&(i.side=f.DoubleSide);var u=a.alphaMode||Fr.OPAQUE;if(u===Fr.BLEND?(i.transparent=!0,i.depthWrite=!1):(i.transparent=!1,u===Fr.MASK&&(i.alphaTest=a.alphaCutoff!==void 0?a.alphaCutoff:.5)),a.normalTexture!==void 0&&(r.push(this.createMaterialTexture(a.normalTexture).then(function(c){i.normalMap=c,e.disposeSet.add(c)})),i.normalScale=new f.Vector2(1,1),a.normalTexture.scale!==void 0)){var l=a.normalTexture.scale;i.normalScale.set(l,l)}a.occlusionTexture!==void 0&&(r.push(this.createMaterialTexture(a.occlusionTexture).then(function(c){i.aoMap=c,e.disposeSet.add(c)})),a.occlusionTexture.strength!==void 0&&(i.aoMapIntensity=a.occlusionTexture.strength)),a.emissiveFactor!==void 0&&(i.emissive=new f.Color().fromArray(a.emissiveFactor)),a.emissiveTexture!==void 0&&r.push(this.createMaterialTexture(a.emissiveTexture).then(function(c){i.emissiveMap=c,e.disposeSet.add(c)}))}return this.disposeSet.add(i),Promise.all(r).then(function(){return i})},n.prototype.loadMaterialAsLineBasicMaterial=function(t){var e=[],r=new f.LineBasicMaterial;if(r.color=new f.Color(1,1,1),r.opacity=1,Object.keys(t.attributes).filter(function(u){return Zt[u]==="color"}).length>0&&(r.vertexColors=!0),Object.keys(t.attributes).filter(function(u){return Zt[u]==="tangent"}).length===0&&(r.normalScale&&(r.normalScale.y*=-1),r.clearcoatNormalScale&&(r.clearcoatNormalScale.y*=-1)),t.material!==void 0){var i=this.json.materials[t.material];i.name&&(r.name=i.name);var a=i.pbrMetallicRoughness||{};if(Array.isArray(a.baseColorFactor)){var o=a.baseColorFactor;r.color.fromArray(o),r.opacity=o[3]}i.doubleSided===!0&&(r.side=f.DoubleSide);var s=i.alphaMode||Fr.OPAQUE;s===Fr.BLEND?(r.transparent=!0,r.depthWrite=!1):(r.transparent=!1,s===Fr.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 f.PointsMaterial;if(i.color=new f.Color(1,1,1),i.opacity=1,i.sizeAttenuation=!1,Object.keys(t.attributes).filter(function(l){return Zt[l]==="color"}).length>0&&(i.vertexColors=!0),Object.keys(t.attributes).filter(function(l){return Zt[l]==="tangent"}).length===0&&(i.normalScale&&(i.normalScale.y*=-1),i.clearcoatNormalScale&&(i.clearcoatNormalScale.y*=-1)),t.material!==void 0){var a=this.json.materials[t.material];a.name&&(i.name=a.name);var o=a.pbrMetallicRoughness||{};if(Array.isArray(o.baseColorFactor)){var s=o.baseColorFactor;i.color.fromArray(s),i.opacity=s[3]}o.baseColorTexture!==void 0&&r.push(this.createMaterialTexture(o.baseColorTexture).then(function(l){l.encoding=f.sRGBEncoding,i.map=l,e.disposeSet.add(l)})),a.doubleSided===!0&&(i.side=f.DoubleSide);var u=a.alphaMode||Fr.OPAQUE;u===Fr.BLEND?(i.transparent=!0,i.depthWrite=!1):(i.transparent=!1,u===Fr.MASK&&(i.alphaTest=a.alphaCutoff!==void 0?a.alphaCutoff:.5))}return this.disposeSet.add(i),Promise.all(r).then(function(){return i})},n.prototype.loadMaterial=function(t){var e,r=(e=t.mode)!==null&&e!==void 0?e:Qe.TRIANGLES,i="material:"+this.createPrimitiveKey(t),a=this.cache.get(i);if(a)return a;for(var o=null,s=0,u=Bt(this.extensions);s<u.length;s++){var l=u[s];if(o=l.loadMaterial(t,this),o)break}if(r===Qe.TRIANGLES||r===Qe.TRIANGLE_STRIP||r===Qe.TRIANGLE_FAN)o=this.loadMaterialAsMeshStandardMaterial(t);else if(r===Qe.LINES||r===Qe.LINE_STRIP||r===Qe.LINE_LOOP)o=this.loadMaterialAsLineBasicMaterial(t);else if(r===Qe.POINTS)o=this.loadMaterialAsPointsMaterial(t);else throw new Error("glTF: Primitive mode unsupported: "+r);return this.cache.set(i,o),o},n.prototype.loadTexture=function(t){var e=this,r="texture:"+t,i=this.cache.get(r);if(i)return i;for(var a=null,o=0,s=Bt(this.extensions);o<s.length;o++){var u=s[o];if(a=u.loadTexture(t,this),a)break}if(!a){var l=this.json.textures[t];a=this.loadImage(l.source).then(function(c){var d=new f.Texture(c);d.needsUpdate=!0,d.flipY=!1,l.name&&(d.name=l.name);var p=e.json.samplers||{},A=p[l.sampler]||{};return d.magFilter=ta[A.magFilter]||f.LinearFilter,d.minFilter=ta[A.minFilter]||f.LinearMipmapLinearFilter,d.wrapS=ra[A.wrapS]||f.RepeatWrapping,d.wrapT=ra[A.wrapT]||f.RepeatWrapping,d.onUpdate=function(){c.close()},d})}return a=a.then(function(c){return e.disposeSet.add(c),c}),this.cache.set(r,a),a},n.prototype.loadMesh=function(t){for(var e=this,r=null,i=0,a=Bt(this.extensions);i<a.length;i++){var o=a[i];if(r=o.loadMesh(t,this),r)break}if(!r){var s=this.json.meshes[t],u=s.primitives,l=Promise.all(u.map(function(d){return e.loadGeometry(d)})),c=Promise.all(u.map(function(d){return e.loadMaterial(d)}));r=Promise.all([l,c]).then(function(d){for(var p=d[0],A=d[1],h=[],v=0;v<u.length;v++){var g=u[v],m=p[v],y=A[v],b=g.mode||Qe.TRIANGLES,x=void 0;if(b===Qe.TRIANGLES||b===Qe.TRIANGLE_STRIP||b===Qe.TRIANGLE_FAN)if(b===Qe.TRIANGLE_STRIP?m=e.toGeometryTrianglesDrawMode(m,f.TriangleStripDrawMode):b===Qe.TRIANGLE_FAN&&(m=e.toGeometryTrianglesDrawMode(m,f.TriangleFanDrawMode)),e.disposeSet.add(m),s.isSkinnedMesh){var w=new f.SkinnedMesh(m,y);m.attributes.skinWeight.normalized||w.normalizeSkinWeights(),x=w}else x=new f.Mesh(m,y);else if(b===Qe.POINTS)x=new f.Points(m,y);else if(b===Qe.LINES)x=new f.LineSegments(m,y);else if(b===Qe.LINE_STRIP)x=new f.Line(m,y);else if(b===Qe.LINE_LOOP)x=new f.LineLoop(m,y);else throw new Error("glTF: Primitive mode unsupported: "+b);if(Object.keys(m.morphAttributes).length>0){if(s.weights!==void 0)for(var E=0,S=s.weights.length;E<S;E++)x.morphTargetInfluences[E]=s.weights[E];if(s.extras&&Array.isArray(s.extras.targetNames)){var C=s.extras.targetNames;if(x.morphTargetInfluences.length===C.length){x.morphTargetDictionary={};for(var E=0,S=C.length;E<S;E++)x.morphTargetDictionary[C[E]]=E}else console.warn("glTF: Invalid extras.targetNames length. Ignoring names.")}}x.name=e.createUniqueName(s.name||"mesh_"+t),h.push(x)}if(h.length===1)return h[0];for(var R=new f.Group,B=0,M=h;B<M.length;B++){var x=M[B];R.add(x)}return R})}return r},n.prototype.loadNodeAttachments=function(t){for(var e=[],r=0,i=Bt(this.extensions);r<i.length;r++){var a=i[r],o=a.loadNodeAttachments(t,this);o&&e.push(o)}return e},n.prototype.loadNode=function(t){var e="node:"+t,r=this.cache.get(e);if(r)return r;var i=this.json,a=i.nodes[t],o=a.name?this.createUniqueName(a.name):"",s=[];a.mesh!==void 0&&s.push(this.loadMesh(a.mesh).then(function(p){if(a.weights!==void 0){var A=a.weights;p.traverse(function(h){if(h instanceof f.Mesh||h instanceof f.Line||h instanceof f.Points)for(var v=0,g=A.length;v<g;v++)h.morphTargetInfluences[v]=A[v]})}return p})),a.camera!==void 0&&s.push(this.loadCamera(a.camera));for(var u=this.loadNodeAttachments(t),l=0,c=u;l<c.length;l++){var d=c[l];s.push(d)}return Promise.all(s).then(function(p){var A;if(a.isBone===!0?A=new f.Bone:p.length>1?A=new f.Group:p.length===1?A=p[0]:A=new f.Object3D,A!==p[0])for(var h=0,v=p.length;h<v;h++)A.add(p[h]);if(a.name&&(A.name=o),a.matrix!==void 0){var g=new f.Matrix4;g.fromArray(a.matrix),A.applyMatrix4(g)}else a.translation!==void 0&&A.position.fromArray(a.translation),a.rotation!==void 0&&A.quaternion.fromArray(a.rotation),a.scale!==void 0&&A.scale.fromArray(a.scale);return A})},n.prototype.loadScene=function(t){var e=this.json,r=e.scenes[t],i=new f.Group;r.name&&(i.name=this.createUniqueName(r.name));for(var a=r.nodes||[],o=[],s=0,u=a.length;s<u;s++)o.push(this.buildNodeHierarchy(a[s],i));return Promise.all(o).then(function(){return i})},n.prototype.createMaterialTexture=function(t){var e=this;return this.loadTexture(t.index).then(function(r){for(var i=0,a=Bt(e.extensions);i<a.length;i++){var o=a[i],s=o.extendTexture(r,t,e);s&&(r=s,e.disposeSet.add(r))}return e.textureSet.add(r),r})},n.prototype.addGeometryPrimitiveAttributes=function(t,e){var r=this,i=e.attributes,a=[],o=function(w){var E=Zt[w]||w.toLowerCase();if(E in t.attributes)return"continue";a.push(s.loadAccessor(i[w]).then(function(S){S&&t.setAttribute(E,S)}))},s=this;for(var u in i)o(u);e.indices!==void 0&&!t.index&&a.push(this.loadAccessor(e.indices).then(function(w){w&&t.setIndex(w)}));var l=new f.Box3;if(i.POSITION!==void 0){var c=this.json.accessors[i.POSITION],d=c.min,p=c.max;if(d!==void 0&&p!==void 0){if(l.set(new f.Vector3(d[0],d[1],d[2]),new f.Vector3(p[0],p[1],p[2])),c.normalized){var A=Da(Yn[c.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 v=new f.Vector3,g=new f.Vector3,m=0,y=h.length;m<y;m++){var b=h[m];if(b.POSITION!==void 0){var c=this.json.accessors[b.POSITION],d=c.min,p=c.max;if(d!==void 0&&p!==void 0){if(g.setX(Math.max(Math.abs(d[0]),Math.abs(p[0]))),g.setY(Math.max(Math.abs(d[1]),Math.abs(p[1]))),g.setZ(Math.max(Math.abs(d[2]),Math.abs(p[2]))),c.normalized){var A=Da(Yn[c.componentType]);g.multiplyScalar(A)}v.max(g)}else console.warn("glTF: Missing min/max properties for accessor POSITION.")}}l.expandByVector(v)}t.boundingBox=l;var x=new f.Sphere;return l.getCenter(x.center),x.radius=l.min.distanceTo(l.max)/2,t.boundingSphere=x,Promise.all(a).then(function(){if(t.attributes.uv&&!t.attributes.uv2&&r.options.copyUV2&&t.setAttribute("uv2",t.attributes.uv),e.targets){for(var w=!1,E=!1,S=0,C=e.targets.length;S<C;S++){var R=e.targets[S];if(R.POSITION!==void 0&&(w=!0),R.NORMAL!==void 0&&(E=!0),w&&E)break}if(!w&&!E)return t;var B=[];t.morphTargetsRelative=!0;for(var M=function(I,L){var T=e.targets[I];w?B.push(r.loadAccessor(T.POSITION).then(function(F){F&&(t.morphAttributes.position[I]=F)})):t.morphAttributes.position[I]=t.attributes.position,E?B.push(r.loadAccessor(T.NORMAL).then(function(F){F&&(t.morphAttributes.normal[I]=F)})):t.morphAttributes.normal[I]=t.attributes.normal},S=0,C=e.targets.length;S<C;S++)M(S,C);return Promise.all(B).then(function(){return t})}else return t})},n.prototype.buildNodeHierarchy=function(t,e){var r=this,i=this.json.nodes[t];return this.loadNode(t).then(function(a){if(i.skin===void 0)return a;var o;return r.loadSkin(i.skin).then(function(s){o=s;for(var u=[],l=0,c=o.joints.length;l<c;l++)u.push(r.loadNode(o.joints[l]));return Promise.all(u)}).then(function(s){return a.traverse(function(u){if(u instanceof f.SkinnedMesh){for(var l=[],c=[],d=0,p=s.length;d<p;d++){var A=s[d];if(A instanceof f.Bone){l.push(A);var h=new f.Matrix4;o.inverseBindMatrices!==void 0&&h.fromArray(o.inverseBindMatrices.array,d*16),c.push(h)}else console.warn('glTF: Joint "%s" could not be found.',o.joints[d])}u.bind(new f.Skeleton(l,c),u.matrixWorld)}}),a})}).then(function(a){e.add(a);var o=[];if(i.children)for(var s=i.children,u=0,l=s.length;u<l;u++){var c=s[u];o.push(r.buildNodeHierarchy(c,a))}return Promise.all(o).then(function(){return a})})},n.prototype.createUniqueName=function(t){for(var e=f.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 st(this.options.resourcePath,fa(t,this.options.search))},n.prototype.toGeometryTrianglesDrawMode=function(t,e){var r=t.getIndex();if(r===null){var i=[],a=t.getAttribute("position");if(a!==void 0){for(var o=0;o<a.count;o++)i.push(o);t.setIndex(i),r=t.getIndex()}}if(r===null)return console.error("glTF: Undefined position attribute. Processing not possible."),t;var s=r.count-2,u=[];if(e===f.TriangleFanDrawMode)for(var o=1;o<=s;o++)u.push(r.getX(0)),u.push(r.getX(o)),u.push(r.getX(o+1));else for(var o=0;o<s;o++)o%2===0?(u.push(r.getX(o)),u.push(r.getX(o+1)),u.push(r.getX(o+2))):(u.push(r.getX(o+2)),u.push(r.getX(o+1)),u.push(r.getX(o)));u.length/3!==s&&console.error("glTF: Unable to generate correct amount of triangles.");var l=t.clone();return l.setIndex(u),this.disposeSet.add(l),l},n}();function Da(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 Tr=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}(),lh=function(n){ue(t,n);function t(){var e=n.call(this)||this;return e.header={magic:"",version:0,length:0},e.content="",e.body=null,e}return t.getMagic=function(e){return ea(new Uint8Array(e.slice(0,4)))},t.prototype.loadGlbBinary=function(e){var r=new DataView(e,0,t.HEADER_LENGTH);if(this.header={magic:t.getMagic(e),version:r.getUint32(4,!0),length:r.getUint32(8,!0)},this.header.magic!==t.HEADER_MAGIC)throw new Error("glTF:KHR_binary_glTF: Unsupported.");if(this.header.version<2)throw new Error("glTF:KHR_binary_glTF: Legacy binary file detected.");for(var i=new DataView(e,t.HEADER_LENGTH),a=0,o=null,s=null;a<i.byteLength;){var u=i.getUint32(a,!0);if(a+=4,u!==0){var l=i.getUint32(a,!0);if(a+=4,l===t.CHUNK_TYPES.JSON){var c=new Uint8Array(e,t.HEADER_LENGTH+a,u);o=ea(c)}else if(l===t.CHUNK_TYPES.BIN){var d=t.HEADER_LENGTH+a;s=e.slice(d,d+u)}a+=u}}if(o===null)throw new Error("glTF:KHR_binary_glTF: JSON content not found.");this.content=o,this.body=s},t.prototype.loadBuffer=function(e,r){var i=r.json.buffers[e];return i.uri===void 0&&e===0&&this.body?Promise.resolve(this.body):null},t.prototype.clear=function(){this.body=null,this.content=""},t.HEADER_MAGIC="glTF",t.HEADER_LENGTH=12,t.CHUNK_TYPES={JSON:1313821514,BIN:5130562},t}(Tr),ch="https://vr-public.realsee-cdn.cn/release/static/image/release/five/resource/draco/1.5.6/",js={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},Js={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"},fh=function(){function n(){this.decoderPath=ch,this.decoderConfig={},this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL=""}return n.prototype.setDecoderPath=function(t){this.decoderPath=t},n.prototype.setDecoderConfig=function(t){return this.decoderConfig=t,this},n.prototype.setWorkerLimit=function(t){return this.workerLimit=t,this},n.prototype.decodeDracoFile=function(t,e,r,i){var a={attributeIDs:r||js,attributeTypes:i||Js,useUniqueIDs:!!r};this.decodeGeometry(t,a).then(e)},n.prototype.decodeGeometry=function(t,e){var r=this;e===void 0&&(e={attributeIDs:js,attributeTypes:Js,useUniqueIDs:!1});for(var i in e.attributeTypes){var a=e.attributeTypes[i];a.BYTES_PER_ELEMENT!==void 0&&(e.attributeTypes[i]=a.name)}var o,s=this.workerNextTaskID++,u=t.byteLength,l=this._getWorker(s,u).then(function(c){return o=c,new Promise(function(d,p){o._callbacks[s]={resolve:d,reject:p},o.postMessage({type:"decode",id:s,taskConfig:e,buffer:t},[t])})}).then(function(c){return r._createGeometry(c.geometry)});return l.catch(function(){return!0}).then(function(){o&&s&&r._releaseTask(o,s)}),l},n.prototype._createGeometry=function(t){var e=new f.BufferGeometry;t.index&&e.setIndex(new f.BufferAttribute(t.index.array,1));for(var r=0;r<t.attributes.length;r++){var i=t.attributes[r],a=i.name,o=i.array,s=i.itemSize,u=!(o instanceof Float32Array||o instanceof Float64Array);e.setAttribute(a,new f.BufferAttribute(o,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=Nn(this.decoderPath+"draco_decoder.js",{responseType:"text"}).then(function(a){return a.body});this.decoderPending=r.then(function(a){var o=["/* draco decoder */",a,"","/* worker */",Xs].join(`
|
|
417
|
+
`,gu=[],yi=new f.PerspectiveCamera(90,1,.1,2);yi.up.set(0,-1,0);yi.lookAt(new f.Vector3(1,0,0));yi.updateMatrix();yi.matrixAutoUpdate=!1;var bi=new f.PerspectiveCamera(90,1,.1,2);bi.up.set(0,-1,0);bi.lookAt(new f.Vector3(-1,0,0));bi.updateMatrix();bi.matrixAutoUpdate=!1;var xi=new f.PerspectiveCamera(90,1,.1,2);xi.up.set(0,0,1);xi.lookAt(new f.Vector3(0,1,0));xi.updateMatrix();xi.matrixAutoUpdate=!1;var wi=new f.PerspectiveCamera(90,1,.1,2);wi.up.set(0,0,-1);wi.lookAt(new f.Vector3(0,-1,0));wi.updateMatrix();wi.matrixAutoUpdate=!1;var Ei=new f.PerspectiveCamera(90,1,.1,2);Ei.up.set(0,-1,0);Ei.lookAt(new f.Vector3(0,0,1));Ei.updateMatrix();Ei.matrixAutoUpdate=!1;var Si=new f.PerspectiveCamera(90,1,.1,2);Si.up.set(0,-1,0);Si.lookAt(new f.Vector3(0,0,-1));Si.updateMatrix();Si.matrixAutoUpdate=!1;var Bs={front:{camera:Ei,index:4},back:{camera:Si,index:5},up:{camera:xi,index:2},down:{camera:wi,index:3},left:{camera:bi,index:1},right:{camera:yi,index:0}};function rd(){var n=gu.pop();return n||new f.ShaderMaterial({uniforms:{map:{value:null},flipY:{value:0}},vertexShader:ed,fragmentShader:td,depthTest:!1,depthWrite:!1,stencilWrite:!1,blending:f.NoBlending,lights:!1,toneMapped:!1,fog:!1})}function nd(n){n.uniforms.map.value=null,gu.push(n)}function id(n,t,e){var r=new f.Scene;r.matrixAutoUpdate=!1;var i=new f.Group;i.scale.set(1,1,-1),r.add(i);for(var a=[],o=new Set,s=0,u=n;s<u.length;s++){var l=u[s];o.add(l.face);var c=rd();a.push(c),c.uniforms.map.value=l.texture,c.uniforms.flipY.value=l.flipY?1:0;var d=new f.Group,p=new f.Mesh($f,c);p.position.set(l.position.x+l.size.x/2-.5,1-(l.position.y+l.size.y/2)-.5,-.5),p.scale.set(l.size.x,l.size.y,1),d.quaternion.copy(Yf[l.face]),d.add(p),i.add(d)}var A=e.autoClear,h=e.sortObjects,v=e.xr.enabled,g=t.texture.generateMipmaps;e.autoClear=!1,e.sortObjects=!1,e.xr.enabled=!1,t.texture.generateMipmaps=!1;var m=e.getRenderTarget(),y=0;o.forEach(function(w){++y===o.size&&(t.texture.generateMipmaps=g),e.setRenderTarget(t,Bs[w].index),e.render(r,Bs[w].camera)}),e.setRenderTarget(m),e.autoClear=A,e.sortObjects=h,e.xr.enabled=v;for(var b=0,x=a;b<x.length;b++){var c=x[b];nd(c)}}var ad=function(){return!1}();function hi(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=U,this.removeAttribute("src")}});return t}function go(n){return new Promise(function(t,e){var r=URL.createObjectURL(n),i=hi({onClose:function(){this.src===r&&URL.revokeObjectURL(r)}});i.onload=function(){i.src===r&&URL.revokeObjectURL(r),i.onload=i.onerror=U,setTimeout(function(){t(i)},10)},i.onerror=function(){var a=i.src;i.onload=i.onerror=U,i.close(),e(new Error("image load error: ".concat(a)))},i.decoding="async",i.src=r})}var Fs=[];function od(n,t){var e=Fs.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=U,Fs.push(r)}});return r}function Ls(n,t){if(t&&(n.width>t.width||n.height>t.height)){var e=od(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 f.Texture(e);i.needsUpdate=!0,i.flipY=!0;var a=i.dispose;return i.dispose=function(){e.close(),a.call(i),i.dispose=a},i}else{var o=new f.Texture(n);o.needsUpdate=!0,typeof ImageBitmap!="undefined"&&n instanceof ImageBitmap?o.flipY=!1:o.flipY=!0;var s=o.dispose;return o.dispose=function(){n.close(),s.call(o),o.dispose=s},o}}function sd(n){var t=new f.CubeTexture(n);t.needsUpdate=!0,t.flipY=!1;var e=t.dispose;return t.dispose=function(){for(var r=0,i=n;r<i.length;r++){var a=i[r];a.close()}e.call(t),t.dispose=e},t}var ks=new f.Vector3,hn=["right","left","up","down","front","back"],qe=function(){function n(t,e,r,i,a){this.tileTree=e,this.tileSources=r,this.options=i,this.renderer=a,this.name="",this.needsRender=!1,this.maxRequest=n.DEFAULT_MAX_REQUEST,this.disposed=!1,this.loadedCubeNodes=new Set,this.loadingCubeNodes=new Set,this.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,a,o,s;if(t===null)throw new Error("cannot set cubeRenderTarget to null.");t.width!==this.options.textureSize&&t.setSize(this.options.textureSize,this.options.textureSize),t.texture.format=(e=this.options.format)!==null&&e!==void 0?e:f.RGBAFormat,t.texture.minFilter=(r=this.options.minFilter)!==null&&r!==void 0?r:f.LinearFilter,t.texture.magFilter=(i=this.options.magFilter)!==null&&i!==void 0?i:f.LinearFilter,t.texture.wrapS=(a=this.options.wrapS)!==null&&a!==void 0?a:f.ClampToEdgeWrapping,t.texture.wrapT=(o=this.options.wrapT)!==null&&o!==void 0?o:f.ClampToEdgeWrapping,t.texture.generateMipmaps=(s=this.options.generateMipmaps)!==null&&s!==void 0?s:!0,this.baseCubeTexture&&(Ao(this.baseCubeTexture,t,this.renderer),this.baseCubeTexture.dispose(),this.baseCubeTexture=null),this._cubeRenderTarget&&Ao(this._cubeRenderTarget.texture,t,this.renderer),this._cubeRenderTarget=t},enumerable:!1,configurable:!0}),n.prototype.requestTile=function(t){var e=this,r,i,a,o,s,u,l=this.tileSources.filter(function(v){return v.level===t.level})[0];if(!l)return this.loadedCubeNodes.add(t),this.prepareToRender.push({node:t,texture:null}),!1;var c=l.size,d=Math.pow(2,t.level)*t.position.y,p=Math.pow(2,t.level)*t.position.x,A="".concat(((a=(i=(r=this.options.imageURL)===null||r===void 0?void 0:r.options)===null||i===void 0?void 0:i.key)!==null&&a!==void 0?a:"pano.0").replace(/^pano/,"pano_tile"),".").concat(t.face,".").concat(t.level,".").concat(d,".").concat(p),h=O(O({},(s=(o=this.options.imageURL)===null||o===void 0?void 0:o.options)!==null&&s!==void 0?s:{key:"unknown"}),{key:A,size:l.scale>=1?void 0:c*t.size*l.scale,quality:void 0,cut:[c*t.position.x,c*t.position.y,c*t.size,c*t.size]});return this.loadingCubeNodes.add(t),this.options.textureLoader.loadTexture(l[t.face],{imageURL:{transform:(u=this.options.imageURL)===null||u===void 0?void 0:u.transform,options:O({},h)},format:f.RGBAFormat,timeout:this.options.timeout,magFilter:this.options.magFilter,minFilter:this.options.minFilter,fetcher:this.options.fetcher}).then(function(v){if(e.disposed){v.body.dispose();return}e.prepareToRender.push({node:t,texture:v.body}),e.loadedCubeNodes.add(t)}).catch(U).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,a=Math.max(this.maxRequest-this.loadingCubeNodes.size,0),o=[];qo(this.tileTree,function(v){if(v.level>e||!t.intersectsBox(v.box))return!1;!r.loadedCubeNodes.has(v)&&!r.loadingCubeNodes.has(v)&&o.push(v)}),o.sort(function(v,g){return v.level!==g.level?v.level-g.level:v.box.getCenter(ks).angleTo(i)-g.box.getCenter(ks).angleTo(i)});for(var s=0,u=o;s<u.length;s++){var l=u[s];if(a<=0)break;var c=this.requestTile(l);c&&a--}if(this.cubeRenderTarget&&this.prepareToRender.length){this.prepareToRender.sort(function(v,g){return v.node.level-g.node.level});for(var d=[],p=0;p<this.prepareToRender.length;p++){var A=this.prepareToRender[p],l=A.node,h=A.texture;(l.parent===null||this.drawedCubeNodes.has(l.parent))&&(this.drawedCubeNodes.add(l),h&&d.push({face:l.face,position:l.position,size:new f.Vector2(l.size,l.size),texture:h,flipY:!h.flipY}),this.prepareToRender.splice(p,1),p--)}d.length&&(id(d,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}(),Kn=function(){function n(){}return n.prototype.loadTexture=function(t,e,r,i,a,o){var s,u,l,c,d,p,A;r===void 0&&(r=U),i===void 0&&(i=U),a===void 0&&(a=U);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=(s=e.generateMipmaps)!==null&&s!==void 0?s:!1,h.minFilter=(u=e.minFilter)!==null&&u!==void 0?u:f.LinearFilter,h.magFilter=(l=e.magFilter)!==null&&l!==void 0?l:f.LinearFilter;var v=(d=(c=e.imageURL)===null||c===void 0?void 0:c.options)!==null&&d!==void 0?d:{key:"unknown"};t=xn(t,(p=e.imageURL)===null||p===void 0?void 0:p.transform,v);var g=Is(t),m=(A=e.viaAjax)!==null&&A!==void 0?A:ad,y=Cs(t),b=/^https?:/.test(g);if(y?m=!0:b||(m=!1),m){var x=null,w="blob";return e.fetcher.ajax(t,{timeout:e.timeout,responseType:w},void 0,void 0,a).then(function(C){return go(C.body)}).then(function(C){return Ls(C,e.maxSize)}).then(function(C){return Object.assign(C,h),C}).then(function(C){var R={meta:x,body:C};return r(R),R}).catch(function(C){return i(C),Promise.reject(C)})}else{var E=null,S;return Promise.resolve().then(function(){return hi()}).then(function(C){return S=C,e.fetcher.loadImage(t,{timeout:e.timeout},void 0,void 0,a,C)}).then(function(C){return E=C.meta,Ls(C.body,e.maxSize)}).then(function(C){return Object.assign(C,h),C}).then(function(C){var R={meta:E,body:C};return r(R),R}).catch(function(C){return S&&S.close(),i(C),Promise.reject(C)})}},n.prototype.loadCubeTexture=function(t,e,r,i,a,o){var s,u,l,c,d,p,A;r===void 0&&(r=U),i===void 0&&(i=U),a===void 0&&(a=U);var h={};typeof e.format!="undefined"&&(h.format=e.format),h.generateMipmaps=(s=e.generateMipmaps)!==null&&s!==void 0?s:!1,h.minFilter=(u=e.minFilter)!==null&&u!==void 0?u:f.LinearFilter,h.magFilter=(l=e.magFilter)!==null&&l!==void 0?l:f.LinearFilter;for(var v=[t[hn[0]],t[hn[1]],t[hn[2]],t[hn[3]],t[hn[4]],t[hn[5]]],g=[],m=[0,0,0,0,0,0],y=[],b=function(w){var E=(d=(c=e.imageURL)===null||c===void 0?void 0:c.options)!==null&&d!==void 0?d:{key:"unknown"},S=xn(v[w],(p=e.imageURL)===null||p===void 0?void 0:p.transform,O(O({},E),{key:E.key+"."+hn[w]})),C=Is(S),R=function(D){m[w]=D,a(m.reduce(function(V,z){return V+z},0)/6)},B=(A=e.viaAjax)!==null&&A!==void 0?A:!1,M=/^https?:$/.test(C),I=Cs(S);if(I?B=!0:M||(B=!1),B){var L="blob",T=e.fetcher.ajax(S,{timeout:e.timeout,responseType:L},void 0,void 0,R).then(function(D){return y[w]=D.meta,go(D.body)});g.push(T)}else{var F,T=Promise.resolve().then(function(){return hi()}).then(function(V){return F=V,e.fetcher.loadImage(S,{timeout:e.timeout},void 0,void 0,R,V)}).then(function(V){return y[w]=V.meta,V.body}).catch(function(V){return F&&F.close(),Promise.reject(V)});g.push(T)}},x=0;x<6;x++)b(x);return Promise.all(g).then(function(w){return sd(w)}).then(function(w){return Object.assign(w,O({encoding:f.sRGBEncoding},h)),w}).then(function(w){var E={body:w,meta:y};return r(E),E}).catch(function(w){for(var E=0,S=g;E<S.length;E++){var C=S[E];C.then(function(R){return R.close()}).catch(U)}return i(w),Promise.reject(w)})},n.prototype.loadTiledCubeTexture=function(t,e,r,i,a,o,s){var u=this;return i===void 0&&(i=U),a===void 0&&(a=U),o===void 0&&(o=U),new Promise(function(l,c){var d,p;u.loadCubeTexture(t,{imageURL:{transform:(d=r.imageURL)===null||d===void 0?void 0:d.transform,options:(p=r.imageURL)===null||p===void 0?void 0:p.options},format:f.RGBAFormat,viaAjax:r.viaAjax,timeout:r.timeout,fetcher:r.fetcher,magFilter:r.magFilter,minFilter:r.minFilter,generateMipmaps:r.generateMipmaps},function(A){var h,v=A.meta,g=A.body,m=(h=r.tileMaxLevel)!==null&&h!==void 0?h:2,y=Math.max(1024*m,512),b=vo(m),x=new qe(g,b,e,{textureSize:y,textureLoader:u,imageURL:r.imageURL,magFilter:r.magFilter,minFilter:r.minFilter,generateMipmaps:r.generateMipmaps,timeout:r.timeout,fetcher:r.fetcher},s),w={meta:v,body:x};i(w),l(w)},function(A){a(A),c(A)},o,s).catch(U)})},n}();const ud=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("n\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{H0v{pyqr-Ip|zz|{K0v{pyqr-Iz|}untrl}nlrr\x07K0v{pyqr-Ixv{{v{tl}nlrr\x07K0v{pyqr-Iy|tqr}uosl}nlrr\x07K0v{pyqr-Ipyv}}v{tl}yn{rl}nlrr\x07KZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--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--ZNV[lR[Q\f"),ld=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0qrsv{r-OYNPXlP\\Y\\_-rpA5=;=EC9-=;>=C9-=;>AF9->;=6{vs|z-nz}yrPor-}n{|=lzn}H{vs|z-znA-}n{|=lznv\x07H{vs|z-sy|n-}n{|=l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|=lyzv{n{prZn}H0r{qvs{vs|z-nz}yrPor-}n{|>lzn}H{vs|z-znA-}n{|>lznv\x07H{vs|z-sy|n-}n{|>l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|>lyzv{n{prZn}H0r{qvs{vs|z-sy|n-z|qryNy}unH{vs|z-sy|n-}|trHn\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{H{vs|z-sy|n-u|{Sy||V{qr\x07H{vs|z-rp?-r|yv|{H{vs|z-sy|n-}v\x07ry_nv|H0vs{qrs-SYNal`UNQRQ--n\bv{t-rp@-[|znyH0r{qvs0v{pyqr-Ip|zz|{K0v{pyqr-Iqvurv{tl}nlsntzr{K0v{pyqr-Is|tl}nlsntzr{K0v{pyqr-I}rpynzn}l}nlsntzr{K0v{pyqr-Iy|tqr}uosl}nlsntzr{K0v{pyqr-Ipyv}}v{tl}yn{rl}nlsntzr{Krp@- ||zcrp|5rp@-qvrpv|{9-rp@-rp|9-sy|n- ||z6-\n--sy|n-urn-J-q|5qvrpv|{9-rp|6H--rp@-q-J-qvrpv|{-7-urnH--rp@-}-J-rp|-:-qH--rp@-\0-J-}-7- ||zH--r{-{|znyv r5q-8-\x006H\fZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--0v{pyqr-Ipyv}}v{tl}yn{rlsntzr{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-:-]V-8->;=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-rpA5}n{|P|y|;to9-=;=69-pynz}5z|qryNy}un-7-@=;=9-=;=9->;=66H--<<-JJJJJJJJJJJJJJJJ--ZNV[lZ\\QRYlP\\Y\\_--0v{pyqr-Is|tlsntzr{K--0v{pyqr-I}rzyv}yvrqlny}unlsntzr{K--0v{pyqr-Iqvurv{tlsntzr{K--ZNV[lR[Q\f"),cd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("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-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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--ZNV[lR[Q\f"),fd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0qrsv{r-OYNPXlP\\Y\\_-rpA5=;=EC9-=;>=C9-=;>AF9->;=6{vs|z-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\\Y\\_lP\\[`aN[a6--{vs|z-rp@-p|{n{P|y|H0r{qvs0vs-qrsv{rq5b`RlP\\Y\\_lNYaVabQR6--{vs|z-nz}yr?Q-tnqvr{ar\x07rH0r{qvsp-Pyv}}r-\n--znA-znv\x07V{rrH--sy|n-sy||V{qr\x07H\fH0vs-[bZlPYV]]R_`-K-=--{vs|z-Pyv}}r-pyv}}rh[bZlPYV]]R_`jH0r{qvs0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvsn\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{Hn\bv{t-sy|n-V_||sZnxH{vs|z-sy|n-u|{Sy||V{qr\x07H{vs|z-rp?-r|yv|{H{vs|z-sy|n-}v\x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7-q-8-r669-q-<-5\0;\x07-8-r69-\0;\x076H\frp@-u?to5rp@-p6-\n----rpA-X-J-rpA5>;=9-?;=-<-@;=9->;=-<-@;=9-@;=6H----rp@-}-J-no5snp5p;\x07\x07\x07-8-X;\x07\b 6-7-C;=-:-X;6H----r{-p; -7-zv\x075X;\x07\x07\x079-pynz}5}-:-X;\x07\x07\x079-=;=9->;=69-p;\b6H\frp@-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--r{-r\x07r?Q5tnqvr{ar\x07r9-rp?59-=;B66;toH\fZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--<<-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--<<-JJJ-高度色-JJJ--0vs-qrsv{rq5b`RlP\\Y\\_lNYaVabQR6----qvssrP|y|;to-J-trP|y|O\bUrvtu5tnqvr{ar\x07r9-d|yq]|vv|{6H--0r{qvs--<<-JJJJJJJJJJJ--<<-JJJ-纯色-JJJ--0vs-qrsv{rq5b`RlP\\Y\\_lP\\[`aN[a6----qvssrP|y|;to-J-p|{n{P|y|H--0r{qvs--<<-JJJJJJJJJJJ--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--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--ZNV[lZ\\QRYlP\\Y\\_--<<色调映射-色彩空间转换--0v{pyqr-I|{rzn}}v{tlsntzr{K--0v{pyqr-Ir{p|qv{tlsntzr{K--<<-JJJ-颜色增益调整-JJJ--rp@-toP|y|-J-tylSntP|y|;toH--rp@-uP|y|-J-to?u5toP|y|6H--uP|y|;\b-8J-p|y|`nnv|{H--uP|y|; -8J-p|y|Ovtu{rH--tylSntP|y|;to-J-u?to5uP|y|6H--<<-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-:-]V-8->;=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--ZNV[lR[Q\f"),dd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0q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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-Iunq|zn}lrr\x07K--0v{pyqr-Is|tlrr\x07K--ZNV[lR[Q\f"),hd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0qrsv{r-]U\\[T0qrsv{r-OYNPXlP\\Y\\_-rpA5=;=EC9-=;>=C9-=;>AF9->;=6{vs|z-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-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ir{zn}l}nlsntzr{K0v{pyqr-Iporllrsyrpv|{lsntzr{K0v{pyqr-Is|tl}nlsntzr{K0v{pyqr-IoqsK0v{pyqr-Iyvtul}nlortv{K0v{pyqr-Iyvtul}u|{tl}nlsntzr{K0v{pyqr-Iunq|zn}l}nlsntzr{K0v{pyqr-Ioz}zn}l}nlsntzr{K0v{pyqr-I{|znyzn}l}nlsntzr{K0v{pyqr-I}rpynzn}l}nlsntzr{K0v{pyqr-Iy|tqr}uosl}nlsntzr{K0v{pyqr-Ipyv}}v{tl}yn{rl}nlsntzr{Krp@- ||zcrp|5rp@-qvrpv|{9-rp@-rp|9-sy|n- ||z6-\n--sy|n-urn-J-q|5qvrpv|{9-rp|6H--rp@-q-J-qvrpv|{-7-urnH--rp@-}-J-rp|-:-qH--rp@-\0-J-}-7- ||zH--r{-{|znyv r5q-8-\x006H\frp@-to?u5rp@-p6-\n----rpA-X-J-rpA5=;=9-:>;=-<-@;=9-?;=-<-@;=9-:>;=6H----rpA-}-J-zv\x075rpA5p;ot9-X; 69-rpA5p;to9-X;\x07\b69-r}5p;o9-p;t66H----rpA-\0-J-zv\x075rpA5};\x07\b9-p;69-rpA5p;9-};\b \x0769-r}5};\x079-p;66H----sy|n-q-J-\0;\x07-:-zv{5\0;9-\0;\b6H----sy|n-r-J->;=r:>=H----r{-rp@5no5\0; -8-5\0;-:-\0;\b6-<-5C;=-7-q-8-r669-q-<-5\0;\x07-8-r69-\0;\x076H\frp@-u?to5rp@-p6-\n----rpA-X-J-rpA5>;=9-?;=-<-@;=9->;=-<-@;=9-@;=6H----rp@-}-J-no5snp5p;\x07\x07\x07-8-X;\x07\b 6-7-C;=-:-X;6H----r{-p; -7-zv\x075X;\x07\x07\x079-pynz}5}-:-X;\x07\x07\x079-=;=9->;=69-p;\b6H\frp@-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--r{-r\x07r?Q5tnqvr{ar\x07r9-rp?59-=;B66;toH\fZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--<<-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--<<-JJJ-高度色-JJJ--0vs-qrsv{rq5b`RlP\\Y\\_lNYaVabQR6----qvssrP|y|;to-J-trP|y|O\bUrvtu5tnqvr{ar\x07r9-d|yq]|vv|{6H--0r{qvs--<<-JJJJJJJJJJJ--<<-JJJ-纯色-JJJ--0vs-qrsv{rq5b`RlP\\Y\\_lP\\[`aN[a6----qvssrP|y|;to-J-p|{n{P|y|H--0r{qvs--<<-JJJJJJJJJJJ--_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--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--ZNV[lZ\\QRYlP\\Y\\_--<<色调映射-色彩空间转换--0v{pyqr-I|{rzn}}v{tlsntzr{K--0v{pyqr-Ir{p|qv{tlsntzr{K--<<-JJJ-颜色增益调整-JJJ--rp@-toP|y|-J-tylSntP|y|;toH--rp@-uP|y|-J-to?u5toP|y|6H--uP|y|;\b-8J-p|y|`nnv|{H--uP|y|; -8J-p|y|Ovtu{rH--tylSntP|y|;to-J-u?to5uP|y|6H--<<-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-:-]V-8->;=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--ZNV[lR[Q\f");var Ca={modelAlpha:new f.Uniform(0),progress:new f.Uniform(0),pano0_map:new f.Uniform(null),pano0_luminanceMap:new f.Uniform(null),pano0_matrix:new f.Uniform(new f.Matrix4),pano0_zoom:new f.Uniform(1),pano1_map:new f.Uniform(null),pano1_luminanceMap:new f.Uniform(null),pano1_matrix:new f.Uniform(new f.Matrix4),pano1_zoom:new f.Uniform(1),gradientTexture:new f.Uniform(null),clippers:new f.Uniform([]),shownFloorIndex:new f.Uniform(-1),constantColor:new f.Uniform(new f.Vector3),geometricError:new f.Uniform(0),pixelRatio:new f.Uniform(1),resolution:new f.Uniform(new f.Vector2(512,512)),floor:new f.Uniform(0),brightness:new f.Uniform(1),modelBoundingMin:new f.Uniform(new f.Vector3),modelBoundingMax:new f.Uniform(new f.Vector3),colorSaturation:new f.Uniform(0),colorBrightness:new f.Uniform(0)},pd={none:{vertexShader:ud,fragmentShader:ld,uniforms:f.UniformsUtils.merge([Ca,{opacity:{value:1}},f.UniformsLib.fog]),lights:!1,clipping:!1},basic:{vertexShader:cd,fragmentShader:fd,uniforms:f.UniformsUtils.merge([Ca,f.ShaderLib.basic.uniforms]),lights:!1,clipping:!0},phong:{vertexShader:dd,fragmentShader:hd,uniforms:f.UniformsUtils.merge([Ca,f.ShaderLib.phong.uniforms]),lights:!0,clipping:!0}},Ar=function(n){ue(t,n);function t(e,r){e===void 0&&(e="basic"),r===void 0&&(r={});var i=this,a,o,s,u,l,c,d,p,A,h,v,g,m,y,b,x,w,E,S,C,R,B,M,I,L,T=pd[e];i=n.call(this,{vertexShader:T.vertexShader,fragmentShader:T.fragmentShader,uniforms:f.UniformsUtils.clone(T.uniforms),lights:T.lights,clipping:T.clipping,defines:{USE_COLOR_CONSTANT:!1,USE_COLOR_ALTITUDE:!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_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 f.Color(16777215),i.map=null,i.lightMap=null,i.lightMapIntensity=1,i.aoMap=null,i.aoMapIntensity=1,i.specularMap=null,i.specular=new f.Color(1118481),i.alphaMap=null,i.envMap=null,i.reflectivity=1,i.refractionRatio=.98,i.emissiveMap=null,i.emissive=new f.Color(0),i.emissiveIntensity=1,i.bumpMap=null,i.bumpScale=1,i.normalMap=null,i.normalMapType=f.TangentSpaceNormalMap,i.normalScale=new f.Vector2(1,1),i.displacementMap=null,i.displacementScale=1,i.displacementBias=0,i.shininess=30;var F,D=null,V=null;return Object.defineProperties(i,{pano0:{get:function(){return D},set:function(z){if(D!==z){D=z,z===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=z.map instanceof qe?z.map.texture:z.map,this.uniforms.pano0_luminanceMap.value=z.luminanceMap instanceof qe?z.luminanceMap.texture:z.luminanceMap,this.uniforms.pano0_matrix.value.copy(z.matrix),this.uniforms.pano0_zoom.value=z.zoom);var Q=this.uniforms.pano0_luminanceMap.value!==null&&this.uniforms.pano1_luminanceMap.value!==null,q=this.defines.USE_LUMINANCE;q!==Q&&(this.defines.USE_LUMINANCE=Q,this.needsUpdate=!0)}}},pano1:{get:function(){return V},set:function(z){if(V!==z){V=z,z===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=z.map instanceof qe?z.map.texture:z.map,this.uniforms.pano1_luminanceMap.value=z.luminanceMap instanceof qe?z.luminanceMap.texture:z.luminanceMap,this.uniforms.pano1_matrix.value.copy(z.matrix),this.uniforms.pano1_zoom.value=z.zoom);var Q=this.uniforms.pano0_luminanceMap.value!==null&&this.uniforms.pano1_luminanceMap.value!==null,q=this.defines.USE_LUMINANCE;q!==Q&&(this.defines.USE_LUMINANCE=Q,this.needsUpdate=!0)}}},modelAlpha:{get:function(){return this.uniforms.modelAlpha.value},set:function(z){this.uniforms.modelAlpha.value=z}},progress:{get:function(){return this.uniforms.progress.value},set:function(z){this.uniforms.progress.value=z}},transition:{get:function(){return this.defines.USE_BLACK_TRANSITION?"BLACK":this.defines.USE_SPREAD_TRANSITION?"SPREAD":"FADE"},set:function(z){var Q=this.defines.USE_BLACK_TRANSITION,q=this.defines.USE_SPREAD_TRANSITION;this.defines.USE_BLACK_TRANSITION=!1,this.defines.USE_SPREAD_TRANSITION=!1,this.defines["USE_".concat(z,"_TRANSITION")]=!0;var G=!1;Q!==this.defines.USE_BLACK_TRANSITION&&(G=!0),q!==this.defines.USE_SPREAD_TRANSITION&&(G=!0),G&&(this.needsUpdate=!0)}},colorStyle:{get:function(){return this.defines.USE_COLOR_CONSTANT?"CONSTANT":this.defines.USE_COLOR_ALTITUDE?"ALTITUDE":"RGB"},set:function(z){var Q=z==="CONSTANT",q=z==="ALTITUDE";this.defines.USE_COLOR_CONSTANT!==Q&&(this.defines.USE_COLOR_CONSTANT=Q,this.needsUpdate=!0),this.defines.USE_COLOR_ALTITUDE!==q&&(this.defines.USE_COLOR_ALTITUDE=q,this.needsUpdate=!0)}},constantColor:{get:function(){return this.uniforms.constantColor.value},set:function(z){this.uniforms.constantColor.value=z}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(z){this.uniforms.opacity.value=z}},shownFloorIndex:{get:function(){return this.uniforms.shownFloorIndex.value},set:function(z){this.uniforms.shownFloorIndex.value=z}},gradientTexture:{get:function(){return this.uniforms.gradientTexture.value},set:function(z){this.uniforms.gradientTexture.value=z}},brightness:{get:function(){return this.uniforms.brightness.value},set:function(z){this.uniforms.brightness.value=z}},clippers:{get:function(){return F},set:function(z){F!==z&&(F=z,this.uniforms.clippers.value=(F||[]).map(function(Q){var q=typeof Q.floorIndex=="number"?Q.floorIndex:-1,G=new f.Matrix4().getInverse(Q.clippingBoxMatrix);return{matrixInverse:G,floorIndex:q}}),this.needsUpdate=!0)}},useEDL:{get:function(){return this.defines.USE_EDL},set:function(z){z!==this.defines.USE_EDL&&(this.defines.USE_EDL=z,this.needsUpdate=!0)}},useHQWeight:{get:function(){return this.defines.USE_HQ_WEIGHT},set:function(z){z!==this.defines.USE_HQ_WEIGHT&&(this.defines.USE_HQ_WEIGHT=z,this.needsUpdate=!0)}},useHQDepth:{get:function(){return this.defines.USE_HQ_DEPTH},set:function(z){z!==this.defines.USE_HQ_DEPTH&&(this.defines.USE_HQ_DEPTH=z,this.needsUpdate=!0)}},floor:{get:function(){return this.uniforms.floor.value},set:function(z){this.uniforms.floor.value=z}},colorSaturation:{get:function(){return this.uniforms.colorSaturation.value},set:function(z){this.uniforms.colorSaturation.value=z}},colorBrightness:{get:function(){return this.uniforms.colorBrightness.value},set:function(z){this.uniforms.colorBrightness.value=z}}}),i.pano0=(a=r.pano0)!==null&&a!==void 0?a:ge.pano0,i.pano1=(o=r.pano1)!==null&&o!==void 0?o:ge.pano1,i.modelAlpha=(s=r.modelAlpha)!==null&&s!==void 0?s:ge.modelAlpha,i.progress=(u=r.progress)!==null&&u!==void 0?u:ge.progress,i.transition=(l=r.transition)!==null&&l!==void 0?l:ge.transition,i.constantColor=(c=r.constantColor)!==null&&c!==void 0?c:ge.constantColor,i.opacity=(d=r.opacity)!==null&&d!==void 0?d:ge.opacity,i.floorStyle=(p=r.floorStyle)!==null&&p!==void 0?p:ge.floorStyle,i.shownFloorIndex=(A=r.shownFloorIndex)!==null&&A!==void 0?A:ge.shownFloorIndex,i.clippers=(h=r.clippers)!==null&&h!==void 0?h:ge.clippers,i.useEDL=(v=r.useEDL)!==null&&v!==void 0?v:ge.useEDL,i.useHQWeight=(g=r.useHQWeight)!==null&&g!==void 0?g:ge.useHQWeight,i.useHQDepth=(m=r.useHQDepth)!==null&&m!==void 0?m:ge.useHQDepth,i.pointSize=(y=r.pointSize)!==null&&y!==void 0?y:ge.pointSize,i.colorStyle=(b=r.colorStyle)!==null&&b!==void 0?b:ge.colorStyle,i.pointShape=(x=r.pointShape)!==null&&x!==void 0?x:ge.pointShape,i.pointScale=(w=r.pointScale)!==null&&w!==void 0?w:ge.pointScale,i.pointBack=(E=r.pointBack)!==null&&E!==void 0?E:ge.pointBack,i.pointMinPixel=(S=r.pointMinPixel)!==null&&S!==void 0?S:ge.pointMinPixel,i.pointMaxPixel=(C=r.pointMaxPixel)!==null&&C!==void 0?C:ge.pointMaxPixel,i.gradientTexture=(R=r.gradientTexture)!==null&&R!==void 0?R:ge.gradientTexture,i.brightness=(B=r.brightness)!==null&&B!==void 0?B:ge.brightness,i.colorSaturation=(M=r.colorSaturation)!==null&&M!==void 0?M:ge.colorSaturation,i.colorBrightness=(I=r.colorBrightness)!==null&&I!==void 0?I:ge.colorBrightness,i.customShaders=(L=r.customShaders)!==null&&L!==void 0?L:ge.customShaders,i.customShaderHash="",i.customShaderUniforms={},i.customShaderDefines={},i.floor=0,i.transparent=!1,i}return t.prototype.onBeforeCompile=function(e,r){var i=this,a,o,s=this.customShaders.filter(function(g){return g.type.includes(i.shaderType)}),u=s.reduce(function(g,m){return g+m.vertex.mainBefore},""),l=s.reduce(function(g,m){return g+m.vertex.mainStart},""),c=s.reduce(function(g,m){return g+m.vertex.mainEnd},""),d=s.reduce(function(g,m){return g+m.fragment.mainBefore},""),p=s.reduce(function(g,m){return g+m.fragment.mainStart},""),A=s.reduce(function(g,m){return g+m.fragment.mainModelColor},""),h=s.reduce(function(g,m){return g+m.fragment.mainEnd},"");e.vertexShader=e.vertexShader.replace(/MAIN_BEFORE/g,u),e.fragmentShader=e.fragmentShader.replace(/MAIN_BEFORE/g,d),e.vertexShader=e.vertexShader.replace(/MAIN_START/g,l),e.fragmentShader=e.fragmentShader.replace(/MAIN_START/g,p),e.vertexShader=e.vertexShader.replace(/MAIN_END/g,c),e.fragmentShader=e.fragmentShader.replace(/MAIN_END/g,h),e.fragmentShader=e.fragmentShader.replace(/MAIN_MODEL_COLOR/g,A);var v=String((o=(a=this.clippers)===null||a===void 0?void 0:a.length)!==null&&o!==void 0?o:0);e.vertexShader=e.vertexShader.replace(/NUM_CLIPPERS/g,v),e.fragmentShader=e.fragmentShader.replace(/NUM_CLIPPERS/g,v),s.forEach(function(g){g.onBeforeCompile(e,r)})},t.prototype.refreshUniforms=function(e){var r,i,a=this.uniforms;a.diffuse&&a.diffuse.value.copy(this.color),a.opacity&&(a.opacity.value=this.opacity),a.color&&a.diffuse.value.copy(this.color),a.emissive&&a.emissive.value.copy(this.emissive).multiplyScalar(this.emissiveIntensity),a.map&&(a.map.value=this.map),a.alphaMap&&(a.alphaMap.value=this.alphaMap),a.specularMap&&(a.specularMap.value=this.specularMap),a.envMap&&(a.envMap.value=this.envMap,a.flipEnvMap.value=!((r=this.envMap)===null||r===void 0)&&r.isCubeTexture?-1:1,a.reflectivity.value=this.reflectivity,a.refractionRatio.value=this.refractionRatio,a.maxMipLevel.value=this.envMap&&(i=e==null?void 0:e.properties.get(this.envMap).__maxMipLevel)!==null&&i!==void 0?i:0),a.lightMap&&(a.lightMap.value=this.lightMap,a.lightMapIntensity.value=this.lightMapIntensity),a.aoMap&&(a.aoMap.value=this.aoMap,a.aoMapIntensity.value=this.aoMapIntensity),a.specular&&a.specular.value.copy(this.specular),a.shininess&&(a.shininess.value=Math.max(this.shininess,1e-4)),a.emissiveMap&&(a.emissiveMap.value=this.emissiveMap),a.bumpMap&&(a.bumpMap.value=this.bumpMap,a.bumpScale.value=this.bumpScale,this.side===f.BackSide&&(a.bumpScale.value*=-1)),a.normalMap&&(a.normalMap.value=this.normalMap,a.normalScale.value.copy(this.normalScale),this.side===f.BackSide&&a.normalScale.value.negate()),a.displacementMap&&(a.displacementMap.value=this.displacementMap,a.displacementScale.value=this.displacementScale,a.displacementBias.value=this.displacementBias);var o;this.map?o=this.map:this.specularMap?o=this.specularMap:this.displacementMap?o=this.displacementMap:this.normalMap?o=this.normalMap:this.bumpMap?o=this.bumpMap:this.alphaMap?o=this.alphaMap:this.emissiveMap&&(o=this.emissiveMap),o!==void 0&&(o.matrixAutoUpdate===!0&&o.updateMatrix(),a.uvTransform.value.copy(o.matrix));var s;this.aoMap?s=this.aoMap:this.lightMap&&(s=this.lightMap),s!==void 0&&(s.matrixAutoUpdate===!0&&s.updateMatrix(),a.uv2Transform.value.copy(s.matrix))},t.prototype.update=function(e,r,i){var a="".concat(i.id,":").concat(i.materialVersion);a!==this.syncModelVersion&&(Object.assign(this,i.getMaterial()),this.syncModelVersion=a);var o=this.customShaders.map(function(m){return m.getHash()}).join("");this.customShaderHash!==o&&(this.customShaderHash=o,this.needsUpdate=!0);for(var s=this.customShaders.reduce(function(m,y){return Object.assign(m,y.defines)},{}),u=Object.keys(this.customShaderDefines),l=0,c=u;l<c.length;l++){var d=c[l];delete this.defines[d]}this.customShaderDefines=s,Object.assign(this.defines,this.customShaderDefines);for(var p=this.customShaders.reduce(function(m,y){return Object.assign(m,y.uniforms)},{}),A=Object.keys(this.customShaderUniforms),h=0,v=A;h<v.length;h++){var g=v[h];delete this.uniforms[g]}this.customShaderUniforms=p,Object.assign(this.uniforms,this.customShaderUniforms),this.visible=!0,this.refreshUniforms(e),this.shaderType==="none"?(this.depthWrite=!1,this.transparent=!0):(this.transparent=!1,this.depthWrite=!0,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.transparent&&(this.depthWrite=!1),this.floorStyle==="VISIBILITY"&&this.shownFloorIndex!==-1&&this.floor!==this.shownFloorIndex&&(this.visible=!1)),this.uniforms.pixelRatio.value=r.pixelRatio,this.uniforms.resolution.value.copy(r.resolution),this.uniforms.modelBoundingMax.value.copy(i.bounding.max),this.uniforms.modelBoundingMin.value.copy(i.bounding.min)},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.customShaders=e.customShaders,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.floorStyle=e.floorStyle,this.colorStyle=e.colorStyle,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.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.colorSaturation=e.colorSaturation,this.colorBrightness=e.colorBrightness,this.refreshUniforms(),this},t.prototype.clone=function(){return new this.constructor(this.shaderType).copy(this)},t}(f.ShaderMaterial);const vd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("{vs|z-sy|n-sy||H0vs-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\x07H<<u调整{vs|z-sy|n-p|y|`nnv|{H{vs|z-sy|n-p|y|Ovtu{rH0v{pyqr-Ip|zz|{K0v{pyqr-Is|tl}nlsntzr{K0v{pyqr-Iy|tqr}uosl}nlsntzr{K0v{pyqr-Ipyv}}v{tl}yn{rl}nlsntzr{Krp@-nqwP|y|arz}rnr5rp@-p|y|9-sy|n-rz}rnr6\n----<<-将色温范围从-:>;=-到->;=-映射到实际的色温范围----sy|n-rz}-J-5rz}rnr-8->;=6-7-B===;=H-<<-范围从-=-到->====----<<-计算色温系数----sy|n-lsnp|9-tlsnp|9-olsnp|H----vs-5rz}-IJ-CC==;=6-\n--------lsnp|-J->;=H--------tlsnp|-J-=;@F==E>BDEDCF=>FC=DEA-7-y|t5rz}-<->==;=6-:-=;C@>EA>AA@DEEC?DAB=FEH--------olsnp|-J-rz}-IJ->F==;=-L-=;=-G-=;BA@?=CDEF>>=>FC=DEA@-7-y|t5rz}-<->==;=-:->=;=6-:->;>FC?BA=EF>AH----\f-ryr-\n--------lsnp|-J->;?F?F@C>EC=C?DAB=FE=A-7-}|5rz}-<->==;=-:-C=;=9-:=;>@@?=ADBF?6H--------tlsnp|-J->;>?FEF=EC=EFB?FA>>DCB-7-}|5rz}-<->==;=-:-C=;=9-:=;=DBB>AEAF?6H--------olsnp|-J->;=H----\f----<<-调整颜色----rp@-nqwrqP|y|H----nqwrqP|y|;-J-pynz}5p|y|;-7-lsnp|9-=;=9->;=6H----nqwrqP|y|;t-J-pynz}5p|y|;t-7-tlsnp|9-=;=9->;=6H----nqwrqP|y|;o-J-pynz}5p|y|;o-7-olsnp|9-=;=9->;=6H----r{-nqwrqP|y|H\frp@-to?u5rp@-p6-\n----rpA-X-J-rpA5=;=9-:>;=-<-@;=9-?;=-<-@;=9-:>;=6H----rpA-}-J-zv\x075rpA5p;ot9-X; 69-rpA5p;to9-X;\x07\b69-r}5p;o9-p;t66H----rpA-\0-J-zv\x075rpA5};\x07\b9-p;69-rpA5p;9-};\b \x0769-r}5};\x079-p;66H----sy|n-q-J-\0;\x07-:-zv{5\0;9-\0;\b6H----sy|n-r-J->;=r:>=H----r{-rp@5no5\0; -8-5\0;-:-\0;\b6-<-5C;=-7-q-8-r669-q-<-5\0;\x07-8-r69-\0;\x076H\frp@-u?to5rp@-p6-\n----rpA-X-J-rpA5>;=9-?;=-<-@;=9->;=-<-@;=9-@;=6H----rp@-}-J-no5snp5p;\x07\x07\x07-8-X;\x07\b 6-7-C;=-:-X;6H----r{-p; -7-zv\x075X;\x07\x07\x079-pynz}5}-:-X;\x07\x07\x079-=;=9->;=69-p;\b6H\fZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--<<-JJJ-点大小剔除-JJJ--vs-5]|v{`v r-I-=;==>6-\n----qvpnqH--\f--<<-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-@;=-33-pp-K->;=6-\n------qvpnqH----\f--0r{qvs--<<-JJJJJJJJJJJJJ--0v{pyqr-Ipyv}}v{tl}yn{rlsntzr{K--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--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--ZNV[lZ\\QRYlP\\Y\\_--0v{pyqr-I|{rzn}}v{tlsntzr{K--0v{pyqr-Ir{p|qv{tlsntzr{K--<<-JJJ-颜色增益调整-JJJ--rp@-toP|y|-J-tylSntP|y|;toH--rp@-uP|y|-J-to?u5toP|y|6H--uP|y|;\b-8J-p|y|`nnv|{H--uP|y|; -8J-p|y|Ovtu{rH--tylSntP|y|;to-J-u?to5uP|y|6H--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--ZNV[lR[Q\f"),md=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("nvor-rp@-p|y|H0vs-qrsv{rq5b`RlP\\Y\\_lP\\[`aN[a6--{vs|z-rp@-p|{n{P|y|H0r{qvs0vs-qrsv{rq5b`RlP\\Y\\_lNYaVabQR6--{vs|z-nz}yr?Q-tnqvr{ar\x07rH0r{qvs0vs-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@-PnzrnQvrpv|{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-Ip|zz|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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--ZNV[lR[Q\f");var Ad=Object.assign({pointScale:new f.Uniform(1),pointMinPixel:new f.Uniform(1),pointMaxPixel:new f.Uniform(1),opacity:new f.Uniform(1),gradientTexture:new f.Uniform(null),modelAlpha:new f.Uniform(0),clippers:new f.Uniform([]),shownFloorIndex:new f.Uniform(-1),constantColor:new f.Uniform(new f.Vector3),geometricError:new f.Uniform(0),pixelRatio:new f.Uniform(1),resolution:new f.Uniform(new f.Vector2(512,512)),floor:new f.Uniform(0),brightness:new f.Uniform(1),modelBoundingMin:new f.Uniform(new f.Vector3),modelBoundingMax:new f.Uniform(new f.Vector3),colorSaturation:new f.Uniform(0),colorBrightness:new f.Uniform(0)},f.UniformsUtils.clone(f.UniformsLib.fog)),Mi=function(n){ue(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,u,l,c,d,p,A,h,v,g,m,y,b,x,w,E,S,C,R,B,M,I=n.call(this,{vertexShader:md,fragmentShader:vd,uniforms:f.UniformsUtils.clone(Ad),lights:!1,clipping:!0,defines:{USE_COLOR_CONSTANT:!1,USE_COLOR_ALTITUDE:!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_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,L;return I.customShaderHash="",I.customShaderUniforms={},I.customShaderDefines={},Object.defineProperties(I,{constantColor:{get:function(){return this.uniforms.constantColor.value},set:function(T){this.uniforms.constantColor.value=T}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(T){this.uniforms.opacity.value=T}},modelAlpha:{get:function(){return this.uniforms.modelAlpha.value},set:function(T){this.uniforms.modelAlpha.value=T}},shownFloorIndex:{get:function(){return this.uniforms.shownFloorIndex.value},set:function(T){this.uniforms.shownFloorIndex.value=T}},clippers:{get:function(){return L},set:function(T){L!==T&&(L=T,this.uniforms.clippers.value=(L||[]).map(function(F){var D=typeof F.floorIndex=="number"?F.floorIndex:-1,V=new f.Matrix4().getInverse(F.clippingBoxMatrix);return{matrixInverse:V,floorIndex:D}}),this.needsUpdate=!0)}},colorStyle:{get:function(){return this.defines.USE_COLOR_CONSTANT?"CONSTANT":this.defines.USE_COLOR_ALTITUDE?"ALTITUDE":"RGB"},set:function(T){var F=T==="CONSTANT",D=T==="ALTITUDE";this.defines.USE_COLOR_CONSTANT!==F&&(this.defines.USE_COLOR_CONSTANT=F,this.needsUpdate=!0),this.defines.USE_COLOR_ALTITUDE!==D&&(this.defines.USE_COLOR_ALTITUDE=D,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(T){var F=T==="ATTENUATION",D=T==="GEOMETRIC";this.defines.USE_POINT_SIZE_GEOMETRIC!==D&&(this.defines.USE_POINT_SIZE_GEOMETRIC=D,this.needsUpdate=!0),this.defines.USE_POINT_SIZE_ATTENUATION!==F&&(this.defines.USE_POINT_SIZE_ATTENUATION=F,this.needsUpdate=!0)}},pointShape:{get:function(){return this.defines.USE_POINT_SHAPE_CIRCLE===!0?"CIRCLE":"SQUARE"},set:function(T){var F=T==="CIRCLE";this.defines.USE_POINT_SHAPE_CIRCLE!==F&&(this.defines.USE_POINT_SHAPE_CIRCLE=F,this.needsUpdate=!0)}},pointScale:{get:function(){return this.uniforms.pointScale.value},set:function(T){this.uniforms.pointScale.value=T}},pointBack:{get:function(){return this.defines.USE_POINT_BACK_HIDDEN===!0?"HIDDEN":this.defines.USE_POINT_BACK_DARK===!0?"DARK":"VISIBLE"},set:function(T){var F=T==="HIDDEN",D=T==="DARK";this.defines.USE_POINT_BACK_HIDDEN!==F&&(this.defines.USE_POINT_BACK_HIDDEN=F,this.needsUpdate=!0),this.defines.USE_POINT_BACK_DARK!==D&&(this.defines.USE_POINT_BACK_DARK=D,this.needsUpdate=!0)}},pointMinPixel:{get:function(){return this.uniforms.pointMinPixel.value},set:function(T){this.uniforms.pointMinPixel.value=T}},pointMaxPixel:{get:function(){return this.uniforms.pointMaxPixel.value},set:function(T){this.uniforms.pointMaxPixel.value=T}},useEDL:{get:function(){return this.defines.USE_EDL},set:function(T){T!==this.defines.USE_EDL&&(this.defines.USE_EDL=T,this.needsUpdate=!0)}},useHQWeight:{get:function(){return this.defines.USE_HQ_WEIGHT},set:function(T){T!==this.defines.USE_HQ_WEIGHT&&(this.defines.USE_HQ_WEIGHT=T,this.needsUpdate=!0)}},useHQDepth:{get:function(){return this.defines.USE_HQ_DEPTH},set:function(T){T!==this.defines.USE_HQ_DEPTH&&(this.defines.USE_HQ_DEPTH=T,this.needsUpdate=!0)}},gradientTexture:{get:function(){return this.uniforms.gradientTexture.value},set:function(T){this.uniforms.gradientTexture.value=T}},floor:{get:function(){return this.uniforms.floor.value},set:function(T){this.uniforms.floor.value=T}},brightness:{get:function(){return this.uniforms.brightness.value},set:function(T){this.uniforms.brightness.value=T}},colorSaturation:{get:function(){return this.uniforms.colorSaturation.value},set:function(T){this.uniforms.colorSaturation.value=T}},colorBrightness:{get:function(){return this.uniforms.colorBrightness.value},set:function(T){this.uniforms.colorBrightness.value=T}}}),I.pano0=(r=e.pano0)!==null&&r!==void 0?r:ge.pano0,I.pano1=(i=e.pano1)!==null&&i!==void 0?i:ge.pano1,I.modelAlpha=(a=e.modelAlpha)!==null&&a!==void 0?a:ge.modelAlpha,I.progress=(o=e.progress)!==null&&o!==void 0?o:ge.progress,I.transition=(s=e.transition)!==null&&s!==void 0?s:ge.transition,I.colorStyle=(u=e.colorStyle)!==null&&u!==void 0?u:ge.colorStyle,I.constantColor=(l=e.constantColor)!==null&&l!==void 0?l:ge.constantColor,I.opacity=(c=e.opacity)!==null&&c!==void 0?c:ge.opacity,I.floorStyle=(d=e.floorStyle)!==null&&d!==void 0?d:ge.floorStyle,I.shownFloorIndex=(p=e.shownFloorIndex)!==null&&p!==void 0?p:ge.shownFloorIndex,I.clippers=(A=e.clippers)!==null&&A!==void 0?A:ge.clippers,I.useEDL=(h=e.useEDL)!==null&&h!==void 0?h:ge.useEDL,I.useHQWeight=(v=e.useHQWeight)!==null&&v!==void 0?v:ge.useHQWeight,I.useHQDepth=(g=e.useHQDepth)!==null&&g!==void 0?g:ge.useHQDepth,I.pointShape=(m=e.pointShape)!==null&&m!==void 0?m:ge.pointShape,I.pointSize=(y=e.pointSize)!==null&&y!==void 0?y:ge.pointSize,I.pointScale=(b=e.pointScale)!==null&&b!==void 0?b:ge.pointScale,I.pointBack=(x=e.pointBack)!==null&&x!==void 0?x:ge.pointBack,I.pointMinPixel=(w=e.pointMinPixel)!==null&&w!==void 0?w:ge.pointMinPixel,I.pointMaxPixel=(E=e.pointMaxPixel)!==null&&E!==void 0?E:ge.pointMaxPixel,I.gradientTexture=(S=e.gradientTexture)!==null&&S!==void 0?S:ge.gradientTexture,I.brightness=(C=e.brightness)!==null&&C!==void 0?C:ge.brightness,I.colorSaturation=(R=e.colorSaturation)!==null&&R!==void 0?R:ge.colorSaturation,I.colorBrightness=(B=e.colorBrightness)!==null&&B!==void 0?B:ge.colorBrightness,I.customShaders=(M=e.customShaders)!==null&&M!==void 0?M:ge.customShaders,I.customShaderHash="",I.floor=0,I.transparent=!0,I}return t.prototype.onBeforeCompile=function(e,r){var i,a,o=this.customShaders.filter(function(v){return v.type.includes("pointcloud")}),s=o.reduce(function(v,g){return v+g.vertex.mainBefore},""),u=o.reduce(function(v,g){return v+g.vertex.mainStart},""),l=o.reduce(function(v,g){return v+g.vertex.mainEnd},""),c=o.reduce(function(v,g){return v+g.fragment.mainBefore},""),d=o.reduce(function(v,g){return v+g.fragment.mainStart},""),p=o.reduce(function(v,g){return v+g.fragment.mainModelColor},""),A=o.reduce(function(v,g){return v+g.fragment.mainEnd},"");e.vertexShader=e.vertexShader.replace(/MAIN_BEFORE/g,s),e.fragmentShader=e.fragmentShader.replace(/MAIN_BEFORE/g,c),e.vertexShader=e.vertexShader.replace(/MAIN_START/g,u),e.fragmentShader=e.fragmentShader.replace(/MAIN_START/g,d),e.vertexShader=e.vertexShader.replace(/MAIN_END/g,l),e.fragmentShader=e.fragmentShader.replace(/MAIN_END/g,A),e.fragmentShader=e.fragmentShader.replace(/MAIN_MODEL_COLOR/g,p);var h=String((a=(i=this.clippers)===null||i===void 0?void 0:i.length)!==null&&a!==void 0?a:0);e.vertexShader=e.vertexShader.replace(/NUM_CLIPPERS/g,h),e.fragmentShader=e.fragmentShader.replace(/NUM_CLIPPERS/g,h),o.forEach(function(v){v.onBeforeCompile(e,r)})},t.prototype.update=function(e,r,i){var a="".concat(i.id,":").concat(i.materialVersion);a!==this.syncModelVersion&&(Object.assign(this,i.getMaterial()),this.syncModelVersion=a);var o=this.customShaders.map(function(m){return m.getHash()}).join("");this.customShaderHash!==o&&(this.customShaderHash=o,this.needsUpdate=!0);for(var s=this.customShaders.reduce(function(m,y){return Object.assign(m,y.defines)},{}),u=Object.keys(this.customShaderDefines),l=0,c=u;l<c.length;l++){var d=c[l];delete this.defines[d]}this.customShaderDefines=s,Object.assign(this.defines,this.customShaderDefines);for(var p=this.customShaders.reduce(function(m,y){return Object.assign(m,y.uniforms)},{}),A=Object.keys(this.customShaderUniforms),h=0,v=A;h<v.length;h++){var g=v[h];delete this.uniforms[g]}this.customShaderUniforms=p,Object.assign(this.uniforms,this.customShaderUniforms),this.visible=!0,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=f.CustomBlending,this.blendSrc=f.SrcAlphaFactor,this.blendSrcAlpha=f.SrcAlphaFactor,this.blendDst=f.OneFactor,this.blendDstAlpha=f.OneFactor):(this.blending=f.NormalBlending,this.blendDst=f.OneMinusSrcAlphaFactor,this.blendEquation=f.AddEquation,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null),this.floorStyle==="VISIBILITY"&&this.shownFloorIndex!==-1&&this.floor!==this.shownFloorIndex&&(this.visible=!1),this.uniforms.pixelRatio.value=r.pixelRatio,this.uniforms.resolution.value.copy(r.resolution),this.uniforms.modelBoundingMax.value.copy(i.bounding.max),this.uniforms.modelBoundingMin.value.copy(i.bounding.min)},t.prototype.copy=function(e){return n.prototype.copy.call(this,this),this.customShaders=e.customShaders,this.pano0=e.pano0,this.pano1=e.pano1,this.progress=e.progress,this.transition=e.transition,this.floorStyle=e.floorStyle,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.colorStyle=e.colorStyle,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.colorSaturation=e.colorSaturation,this.colorBrightness=e.colorBrightness,this},t}(f.ShaderMaterial),mn=function(n){ue(t,n);function t(e){var r=e.preserveDrawingBuffer,i=r===void 0?!0:r,a=e.premultipliedAlpha,o=a===void 0?!0:a,s=e.stencil,u=s===void 0?!0:s,l=e.backgroundColor,c=l===void 0?1579548:l,d=e.backgroundAlpha,p=d===void 0?1:d,A=e.pixelRatio,h=A===void 0?1:A,v=e.antialias,g=v===void 0?!1:v,m=e.webgl2,y=e.logarithmicDepthBuffer,b=e.precision,x=e.powerPreference,w=this,E={antialias:g,alpha:!0,depth:!0,preserveDrawingBuffer:i,stencil:u,premultipliedAlpha:o,powerPreference:x},S={logarithmicDepthBuffer:y,precision:b};if(m){var C=document.createElement("canvas"),R=C.getContext("webgl2",E);R?w=n.call(this,O(O(O({},E),S),{antialias:!0,canvas:C,context:R}))||this:(console.error("error occurred when getting webgl2 canvas context, mybe webgl2 not support, fallback to webgl."),w=n.call(this,O(O({},E),S))||this)}else w=n.call(this,O(O({},E),S))||this;return w.setPixelRatio(h),w.setClearColor(c,p),w.outputEncoding=f.sRGBEncoding,w.autoClear=!0,w}return t}(f.WebGLRenderer),yu=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.add=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return n.prototype.add.apply(this,e)},t.prototype.remove=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return n.prototype.remove.apply(this,e)},t}(f.Scene);function tr(n,t){var e=Math.abs(Math.cos(n.latitude)),r=-Math.sin(n.longitude)*e,i=-Math.sin(n.latitude),a=-Math.cos(n.longitude)*e;return t?t.set(r,i,a):new f.Vector3(r,i,a)}var gd=1,yd=.1,bd=2e3,ki=Math.PI*2,Os=Math.PI/2;function Ia(n){return n>0&&n<=ki?n:(n%ki+ki)%ki}function xd(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 bu=function(n){ue(t,n);function t(e,r,i,a,o,s,u){r===void 0&&(r=gd),i===void 0&&(i=yd),a===void 0&&(a=bd),o===void 0&&(o=new f.Vector2),s===void 0&&(s=new f.Vector2(512,512)),u===void 0&&(u=1);var l=n.call(this)||this;l.fov=e,l.aspect=r,l.near=i,l.far=a,l.perspToOrtho=o,l.resolution=s,l.pixelRatio=u,l.time=0,l.needsRender=!0,l.refineModel=!0,l.pose={longitude:0,latitude:0,fov:e,distance:0,offset:new f.Vector3},l.computePose(),l.perspectiveCamera=new f.PerspectiveCamera(l.fov,l.aspect,.001,l.far);var c=Math.max(l.orthoDistance,.01)*Math.tan(.5*l.fov/180*Math.PI),d=-.5*l.aspect*2*c;return l.orthographicCamera=new f.OrthographicCamera(d,-d,c,-c,.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.autoNearFar=!0,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 tr(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(ce(r[9],-1,1)),Math.abs(r[9])<.9999999?this.pose.longitude=Ia(Math.atan2(r[8],r[10])):this.pose.longitude=Ia(Math.atan2(-r[2],r[0])),this.pose.fov=this.fov,this.pose.distance=e,this.pose.offset=new f.Vector3(-r[8],-r[9],-r[10]).setLength(this.pose.distance).add(this.position),this},t.prototype.setFromPose=function(e){var r,i,a,o,s,u=Ia((r=e.longitude)!==null&&r!==void 0?r:this.pose.longitude),l=Math.max(-Os+1e-4,Math.min(Os-1e-4,(i=e.latitude)!==null&&i!==void 0?i:this.pose.latitude)),c=(a=e.fov)!==null&&a!==void 0?a:this.pose.fov,d=(o=e.distance)!==null&&o!==void 0?o:this.pose.distance,p=(s=e.offset)!==null&&s!==void 0?s:this.pose.offset,A=tr({longitude:u,latitude:l}).normalize();return this.position.set(0,0,0),this.lookAt(A),this.position.add(p).sub(A.clone().setLength(d)),this.fov!==c&&(this.fov=c,this.updateProjectionMatrix()),this.updateMatrixWorld(!0),this.pose.longitude=u,this.pose.latitude=l,this.pose.fov=c,this.pose.distance=d,this.pose.offset.copy(p),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(){xd(this.orthographicCamera.projectionMatrix,this.perspectiveCamera.projectionMatrix,1-this.perspToOrtho.x,this.projectionMatrix),this.projectionMatrixInverse.getInverse(this.projectionMatrix),this.needsRender=!0},t.prototype.setViewOffset=function(e,r,i,a,o,s){this.perspectiveCamera.setViewOffset(e,r,i,a,o,s),this.orthographicCamera.setViewOffset(e,r,i,a,o,s),this.computeProjectionMatrix()},t.prototype.clearViewOffset=function(){this.perspectiveCamera.clearViewOffset(),this.orthographicCamera.clearViewOffset(),this.computeProjectionMatrix()},t.prototype.updateProjectionMatrix=function(){this.perspectiveCamera.updateProjectionMatrix(),this.orthographicCamera.updateProjectionMatrix(),this.computeProjectionMatrix()},Object.defineProperty(t.prototype,"perspectiveProjectionMatrix",{get:function(){return this.perspectiveCamera.projectionMatrix},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"perspectiveProjectionMatrixInverse",{get:function(){return this.perspectiveCamera.projectionMatrixInverse},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"orthographicProjectionMatrix",{get:function(){return this.orthographicCamera.projectionMatrix},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"orthographicProjectionMatrixInverse",{get:function(){return this.orthographicCamera.projectionMatrixInverse},enumerable:!1,configurable:!0}),t.prototype.updateTime=function(e){this.time=e;var r=!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(),r=!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 i=Math.max(this.orthoDistance,.01)*Math.tan(.5*this.fov/180*Math.PI),a=-.5*this.aspect*2*i;this.orthographicCamera.left=a,this.orthographicCamera.right=-a,this.orthographicCamera.top=i,this.orthographicCamera.bottom=-i,this.orthographicCamera.near=this.near,this.orthographicCamera.far=this.far,this.orthographicCamera.updateProjectionMatrix(),r=!0}r&&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(ve()),this},t}(f.Camera),Ft;(function(n){n[n.Outside=-1]="Outside",n[n.Intersecting=0]="Intersecting",n[n.Inside=1]="Inside"})(Ft||(Ft={}));var xu=1e-6,Ke=new f.Vector3,nn=new f.Matrix4,_r=new f.Vector3,jr=new f.Vector3,Jr=new f.Vector3,yo=new f.Vector3,Ta=new f.Box3,Pa=new f.Sphere,Ds=new f.Matrix4,Ra=new f.Ray,Rt=new f.Object3D,Vs=new f.Frustum;function wu(n,t){var e=n.elements;return t.setFromRotationMatrix(nn.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 ai=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 nn.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),Vs.setFromProjectionMatrix(nn),this.setFromFrustum(Vs),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=Ft.Inside,r=0,i=this.planes;r<i.length;r++){var a=i[r],o=t.intersectPlane(a);switch(o){case Ft.Outside:return Ft.Outside;case Ft.Intersecting:e=Ft.Intersecting;break}}return e},n.prototype.computeVisibilityWithPlaneMask=function(t,e){if(e===n.MASK_OUTSIDE||e===n.MASK_INSIDE)return e;for(var r=n.MASK_INSIDE,i=Math.min(32,this.planes.length),a=0;a<i;++a){var o=1<<a;if(e&o){var s=this.planes[a],u=t.intersectPlane(s);if(u===Ft.Outside)return n.MASK_OUTSIDE;u===Ft.Intersecting&&(r|=o)}}return r},n}(),Go=function(){function n(){this.type="box",this.center=new f.Vector3,this.halfSize=new f.Vector3,this.rotation=new f.Matrix3}return n.prototype.fromJson=function(t){var e=t.box;this.center.set(e[0],e[1],e[2]);var r=e[3],i=e[4],a=e[5],o=e[6],s=e[7],u=e[8],l=e[9],c=e[10],d=e[11],p=Math.max(Math.sqrt(r*r+i*i+a*a),.001),A=Math.max(Math.sqrt(o*o+s*s+u*u),.001),h=Math.max(Math.sqrt(l*l+c*c+d*d),.001);this.halfSize.set(p,A,h);var v=this.halfSize.toArray().reduce(function(g,m){return g+m},0);return(isNaN(v)||v<=0)&&this.halfSize.setScalar(xu),this.rotation.fromArray([r/p,i/p,a/p,o/A,s/A,u/A,l/h,c/h,d/h]),isNaN(this.rotation.toArray().reduce(function(g,m){return g+m},0))&&this.rotation.identity(),this},n.prototype.toJson=function(){return this.rotation.extractBasis(_r,jr,Jr),{box:vt(vt(vt(vt([],this.center.toArray(),!0),_r.multiplyScalar(this.halfSize.x).toArray(),!0),jr.multiplyScalar(this.halfSize.y).toArray(),!0),Jr.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 Rt.position.copy(this.center),wu(this.rotation,Rt.quaternion),Rt.scale.copy(this.halfSize),Rt.matrix.compose(Rt.position,Rt.quaternion,Rt.scale),Rt.matrix.premultiply(t),Rt.matrix.decompose(Rt.position,Rt.quaternion,Rt.scale),this.center.copy(Rt.position),this.rotation.setFromMatrix4(nn.makeRotationFromQuaternion(Rt.quaternion)),this.halfSize.copy(Rt.scale),this},n.prototype.getCenter=function(t){return t.copy(this.center)},n.prototype.distanceSquaredToPoint=function(t){var e=this.rotation.elements,r=t.x-this.center.x,i=t.y-this.center.y,a=t.z-this.center.z,o=0,s;return s=r*e[0]+i*e[1]+a*e[2],s<0&&(s=-s),s-=this.halfSize.x,s>0&&(o+=s*s),s=r*e[3]+i*e[4]+a*e[5],s<0&&(s=-s),s-=this.halfSize.y,s>0&&(o+=s*s),s=r*e[6]+i*e[7]+a*e[8],s<0&&(s=-s),s-=this.halfSize.z,s>0&&(o+=s*s),o},n.prototype.distanceToPoint=function(t){return Math.sqrt(this.distanceSquaredToPoint(t))},n.prototype.distanceToPlane=function(t){var e=t.projectPoint(this.center,new f.Vector3);return this.distanceToPoint(e)},n.prototype.getBoundingBox=function(t){return t.makeEmpty(),this.rotation.extractBasis(_r,jr,Jr),_r.setLength(this.halfSize.x),jr.setLength(this.halfSize.y),Jr.setLength(this.halfSize.z),t.expandByPoint(Ke.copy(this.center).add(_r)),t.expandByPoint(Ke.copy(this.center).sub(_r)),t.expandByPoint(Ke.copy(this.center).add(jr)),t.expandByPoint(Ke.copy(this.center).sub(jr)),t.expandByPoint(Ke.copy(this.center).add(Jr)),t.expandByPoint(Ke.copy(this.center).sub(Jr)),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);Ke.set(this.halfSize.x,this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,0),Ke.set(-this.halfSize.x,this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,3),Ke.set(-this.halfSize.x,-this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,6),Ke.set(this.halfSize.x,-this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,9),Ke.set(this.halfSize.x,this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,12),Ke.set(-this.halfSize.x,this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,15),Ke.set(-this.halfSize.x,-this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,18),Ke.set(this.halfSize.x,-this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,21);var r=new f.BufferGeometry;return r.setIndex(new f.BufferAttribute(t,1)),r.setAttribute("position",new f.BufferAttribute(e,3)),r.computeBoundingBox(),r.computeBoundingSphere(),r},n.prototype.intersectPlane=function(t){var e=this.center,r=t.normal,i=this.rotation.elements,a=this.halfSize,o=r.x,s=r.y,u=r.z,l=Math.abs(o*i[0]*a.x+s*i[1]*a.x+u*i[2]*a.x)+Math.abs(o*i[3]*a.y+s*i[4]*a.y+u*i[5]*a.y)+Math.abs(o*i[6]*a.z+s*i[7]*a.z+u*i[8]*a.z),c=r.dot(e)+t.constant;return c<=-l?Ft.Outside:c>=l?Ft.Inside:Ft.Intersecting},n.prototype.intersectRay=function(t,e){if(yo.copy(this.halfSize).multiplyScalar(2),Ta.setFromCenterAndSize(Ke.set(0,0,0),yo),this.rotation.extractBasis(_r,jr,Jr),nn.makeBasis(_r,jr,Jr),nn.setPosition(this.center),Ds.getInverse(nn),Ra.copy(t).applyMatrix4(Ds),Ta.containsPoint(Ra.origin))return!0;var r=Ra.intersectBox(Ta,Ke);return r?e!==void 0?r.applyMatrix4(nn).distanceTo(t.origin)<e:!0:!1},n}(),Ko=function(){function n(){this.type="sphere",this.center=new f.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],xu),this},n.prototype.toJson=function(){return{sphere:vt(vt([],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,yo.set(1,1,1).multiplyScalar(this.radius*2)),t},n.prototype.toGeometry=function(){for(var t=32,e=new Float32Array(t*3*2*2),r=0;r<=t;r++){var i=0;i=r/t*Math.PI*2,e[r*6+0]=this.center.x+Math.cos(i)*this.radius,e[r*6+1]=this.center.y+Math.sin(i)*this.radius,e[r*6+2]=this.center.z+0,i=(r+1)/t*Math.PI*2,e[r*6+3]=this.center.x+Math.cos(i)*this.radius,e[r*6+4]=this.center.y+Math.sin(i)*this.radius,e[r*6+5]=this.center.z+0}for(var r=t;r<=t*2;r++){var i=0;i=r/t*Math.PI*2,e[r*6+0]=this.center.x+Math.cos(i)*this.radius,e[r*6+1]=this.center.y+0,e[r*6+2]=this.center.z+Math.sin(i)*this.radius,i=(r+1)/t*Math.PI*2,e[r*6+3]=this.center.x+Math.cos(i)*this.radius,e[r*6+4]=this.center.y+0,e[r*6+5]=this.center.z+Math.sin(i)*this.radius}var a=new f.BufferGeometry;return a.setAttribute("position",new f.BufferAttribute(e,3)),a.computeBoundingBox(),a.computeBoundingSphere(),a},n.prototype.applyMatrix4=function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},n.prototype.getCenter=function(t){return t.copy(this.center)},n.prototype.distanceSquaredToPoint=function(t){var e=this.distanceToPoint(t);return e*e},n.prototype.distanceToPoint=function(t){var e=this.center.distanceTo(t)-this.radius;return e<=0?0:e},n.prototype.distanceToPlane=function(t){var e=Math.abs(t.distanceToPoint(this.center));return Math.max(0,e-this.radius)},n.prototype.intersectPlane=function(t){var e=this.center,r=this.radius,i=t.normal,a=i.dot(e)+t.constant;return a<-r?Ft.Outside:a<r?Ft.Intersecting:Ft.Inside},n.prototype.intersectRay=function(t,e){if(Pa.set(this.center,this.radius),Pa.containsPoint(t.origin))return!0;var r=t.intersectSphere(Pa,Ke);return r?e!==void 0?t.origin.distanceTo(r)<e:!0:!1},n}(),Eu=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 Ba(n){return n instanceof Go||n instanceof Ko||n instanceof Eu}function yn(n){if("box"in n)return new Go().fromJson(n);if("sphere"in n)return new Ko().fromJson(n);if("region"in n)return new Eu().fromJson(n);throw new Error("BoundingVolume ".concat(JSON.stringify(n)," never suppored."))}var Oi=[4821759,8191922,16637280,16739958,5822969,376977,16747077,9259235,14514687].map(function(n){return new f.LineBasicMaterial({color:n,depthWrite:!1,depthTest:!1,transparent:!0})}),wd=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);Ke.set(1,1,1).toArray(t,0),Ke.set(-1,1,1).toArray(t,3),Ke.set(-1,-1,1).toArray(t,6),Ke.set(1,-1,1).toArray(t,9),Ke.set(1,1,-1).toArray(t,12),Ke.set(-1,1,-1).toArray(t,15),Ke.set(-1,-1,-1).toArray(t,18),Ke.set(1,-1,-1).toArray(t,21);var e=new f.BufferGeometry;return e.setIndex(new f.BufferAttribute(n,1)),e.setAttribute("position",new f.BufferAttribute(t,3)),e.computeBoundingBox(),e.computeBoundingSphere(),e}(),Ed=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 f.BufferGeometry;return i.setAttribute("position",new f.BufferAttribute(t,3)),i.computeBoundingBox(),i.computeBoundingSphere(),i}();function Sd(n,t){if(n instanceof Go){var e=new f.LineSegments(wd,Oi[Math.min(t,Oi.length-1)]);return e.position.copy(n.center),wu(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 Ko){var e=new f.LineSegments(Ed,Oi[Math.min(t,Oi.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 Md=new f.Vector3,_o=function(){function n(t,e,r,i){var a=this,o,s,u,l;this.parent=null,this.contentParent=null,this.floor=0,this.id=t,this.state={visible:!1,frameNumber:0,selectedFrameNumber:0,requestedFrameNumber:0,touchedFrameNumber:0,distanceToCamera:0,centerZDepth:0,centerScreenY: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.contentParent=i?i.hasRenderContent?i:i.contentParent:null,this.level=this.parent?this.parent.level+1:0,this.tileset=r,this.refine=(o=e.refine)!==null&&o!==void 0?o:this.parent?this.parent.refine:"REPLACE",this.transform=new f.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=(u=(s=this.parent)===null||s===void 0?void 0:s.geometricError)!==null&&u!==void 0?u:0,e.content&&e.content.uri?(this.content={uri:e.content.uri,loadState:"UNLOADED",loadStateUpdateTime:ve(),loadfailRetryDelay:0,byteLength:0},e.content.group!==void 0&&(this.content.group=e.content.group),e.content.boundingVolume&&(this.content.boundingVolume=yn(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=yn(e.boundingVolume).applyMatrix4(this.transform)),e.viewerRequestVolume&&(this.viewerRequestVolume=yn(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.tileset.floorLength=Math.max(this.tileset.floorLength,this.floor+1)),this.boundingVolume&&(this.boundingVolumeDebugObject=Sd(this.boundingVolume,this.levelOfContent)),e.children?this.children=e.children.map(function(c,d){return new n("".concat(a.id,".").concat(d),c,r,a)}):this.children=[]}return n.prototype.traverse=function(t){t(this);for(var e=0,r=this.children;e<r.length;e++){var i=r[e];i.traverse(t)}},n.prototype.updateState=function(t){this.state.frameNumber=t.frameNumber;var e=this.tileset.transformIsIdentity?null:this.tileset.transform;if(this.boundingVolume){var r=e?this.boundingVolume.clone().applyMatrix4(e):this.boundingVolume;if(t.camera.type==="OrthographicCamera"){var i=new f.Plane().setFromNormalAndCoplanarPoint(t.camera.direction,t.camera.position);this.state.distanceToCamera=r.distanceToPlane(i)}else this.state.distanceToCamera=r.distanceToPoint(t.camera.position);var a=r.getCenter(Md).sub(t.camera.position);this.state.centerZDepth=t.camera.direction.dot(a),this.state.centerScreenY=t.camera.up.dot(a);var o=this.parent?this.parent.state.visibilityPlaneMask:ai.MASK_INDETERMINATE;this.state.visibilityPlaneMask=t.cullingVolume.computeVisibilityWithPlaneMask(r,o),this.state.visible=this.state.visibilityPlaneMask!==ai.MASK_OUTSIDE}else this.state.distanceToCamera=0,this.state.centerZDepth=0,this.state.visibilityPlaneMask=ai.MASK_INDETERMINATE,this.state.visible=!0;if(this.levelOfContent<=t.minLevelOfDetail&&(this.state.visible=!0),this.viewerRequestVolume){var s=e?this.viewerRequestVolume.clone().applyMatrix4(e):this.viewerRequestVolume;this.state.inRequestVolume=s.distanceSquaredToPoint(t.camera.position)<=0}else this.state.inRequestVolume=!0;this.state.screenSpaceError=this.getScreenSpaceError(t,this.state.distanceToCamera,!1)},Object.defineProperty(n.prototype,"selected",{get:function(){return this.state.selectedFrameNumber===this.tileset.frameNumber},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasChildren",{get:function(){return this.children.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"siblingIndex",{get:function(){var t,e;return(e=(t=this.parent)===null||t===void 0?void 0:t.children.indexOf(this))!==null&&e!==void 0?e:0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasTilesetContent",{get:function(){return this.children.length>0&&this.type==="TILESET"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasRenderContent",{get:function(){return this.type==="SCENEGRAPH"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"contentAvailable",{get:function(){var t;return this.hasRenderContent&&((t=this.content)===null||t===void 0?void 0:t.loadState)==="READY"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasUnloadedContent",{get:function(){var t;return((t=this.content)===null||t===void 0?void 0:t.loadState)==="UNLOADED"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasEmptyContent",{get:function(){return this.type==="EMPTY"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"contentReady",{get:function(){var t;return((t=this.content)===null||t===void 0?void 0:t.loadState)==="READY"||this.hasEmptyContent},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"contentByteLength",{get:function(){return this.content?this.content.byteLength:0},enumerable:!1,configurable:!0}),n.prototype.getScreenSpaceError=function(t,e,r){var i=this.tileset.transformIsIdentity?1:this.tileset.transform.getMaxScaleOnAxis(),a=this.parent?this.parent.geometricError:this.tileset.geometricError,o=i*(r?a:this.geometricError);if(o===0)return 0;var s=t.height,u=t.camera.type==="OrthographicCamera"?2:t.sseDenominator,l=Math.max(e,.001),c=o*s/(l*u);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)return-1;var e=this.parent,r=e&&(!t||this.state.screenSpaceError===0),i=r?e.state.screenSpaceError:this.state.screenSpaceError,a=this.tileset.root?this.tileset.root.state.screenSpaceError:0,o=Math.max(a-i,0);return o},n}(),Fa=new Map;function Ns(n,t){if(t&&t.has(n))return t.get(n);var e=n.refine==="ADD"||n.tileset.skipLevelOfDetail,r=n.parent,i=r&&(!e||n.state.screenSpaceError===0),a=i?r.state.screenSpaceError:n.state.screenSpaceError,o=n.tileset.root?n.tileset.root.state.screenSpaceError:0,s=Math.max(o-a,0);return t&&t.set(n,s),s}var Su=function(){function n(t,e){this.tileset=t,this.options=e,this.activeRequests=0,this.requestQueue=[]}return n.prototype.reset=function(){for(var t=0,e=this.requestQueue;t<e.length;t++){var r=e[t];this.options.onTileSkip&&this.options.onTileSkip(r.tile)}this.requestQueue.length=0},n.prototype.update=function(t,e,r){for(var i=this,a=r.time,o=this.requestQueue,s=new Set(t),u=0;u<o.length;u++){var l=o[u];if(s.has(l.tile)){s.delete(l.tile);continue}l.status==="WAITING"&&(o.splice(u,1),u--,this.options.onTileSkip&&this.options.onTileSkip(l.tile))}s.size>0&&(s.forEach(function(m){o.push({tile:m,status:"WAITING",time:a,error:null})}),s.clear());for(var c=this.tileset.maxRequests,u=0;u<o.length&&c>0;u++){var l=o[u];if(l.status==="DONE")l.error!==null?this.options.onTileError&&this.options.onTileError(l.tile,l.error):(c--,l.tile.content&&(l.tile.content.loadState="READY"),this.options.onTileLoad&&this.options.onTileLoad(l.tile)),o.splice(u,1),u--;else if(l.status==="PENDING"&&a-l.time<1e3)break}switch(Fa.clear(),e){case"SCREEN_SPACE_ERROR":{o.sort(function(m,y){if(m.tile.state.requestedFrameNumber!==y.tile.state.requestedFrameNumber)return y.tile.state.requestedFrameNumber-m.tile.state.requestedFrameNumber;if(m.tile.state.requestedFrameNumber===r.frameNumber){var b=Ns(m.tile,Fa),x=Ns(y.tile,Fa);return b-x}else return m.tile.level!==y.tile.level?m.tile.level-y.tile.level:m.tile.state.distanceToCamera-y.tile.state.distanceToCamera});break}case"SCREEN_VERTICAL":{o.sort(function(m,y){return m.tile.state.requestedFrameNumber!==y.tile.state.requestedFrameNumber?y.tile.state.requestedFrameNumber-m.tile.state.requestedFrameNumber:m.tile.state.requestedFrameNumber===r.frameNumber?m.tile.state.centerScreenY!==y.tile.state.centerScreenY?m.tile.state.centerScreenY-y.tile.state.centerScreenY:m.tile.state.centerZDepth!==y.tile.state.centerZDepth?m.tile.state.centerZDepth-y.tile.state.centerZDepth:m.tile.level!==y.tile.level?m.tile.level-y.tile.level:m.tile.state.distanceToCamera-y.tile.state.distanceToCamera:m.tile.level!==y.tile.level?m.tile.level-y.tile.level:m.tile.state.distanceToCamera-y.tile.state.distanceToCamera});break}case"SCREEN_LEVEL_VERTICAL":{o.sort(function(m,y){return m.tile.state.requestedFrameNumber!==y.tile.state.requestedFrameNumber?y.tile.state.requestedFrameNumber-m.tile.state.requestedFrameNumber:m.tile.state.requestedFrameNumber===r.frameNumber?m.tile.level!==y.tile.level?m.tile.level-y.tile.level:m.tile.state.centerScreenY!==y.tile.state.centerScreenY?m.tile.state.centerScreenY-y.tile.state.centerScreenY:m.tile.state.centerZDepth!==y.tile.state.centerZDepth?m.tile.state.centerZDepth-y.tile.state.centerZDepth:m.tile.state.distanceToCamera-y.tile.state.distanceToCamera:m.tile.level!==y.tile.level?m.tile.level-y.tile.level:m.tile.state.distanceToCamera-y.tile.state.distanceToCamera});break}}if(c=Math.max(this.tileset.maxRequests-this.activeRequests,0),!this.tileset.skipLevelOfDetail)for(var d=0,p=o.length,u=0;u<p;u++){var A=o[u].tile;if(A.hasTilesetContent||A.contentParent===null||A.contentParent.state.selectedFrameNumber===this.tileset.frameNumber){var h=o.splice(u,1);o.splice.apply(o,vt([d++,0],h,!1))}}for(var v=function(m){var y=o[m];y.status==="WAITING"&&(c--,y.status="PENDING",y.time=a,g.activeRequests++,g.tileset.options.tileLoader(y.tile).catch(function(b){y.error=b}).then(function(){y.status="DONE",y.tile.content&&y.tile.content.loadState==="READY"&&(y.tile.content.loadState="LOADING"),i.activeRequests--}))},g=this,u=0;u<o.length&&c>0;u++)v(u)},n}(),Cd=function(){function n(t,e,r){this.item=t,this.previous=e,this.next=r}return n}(),Id=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 Cd(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}(),Mu=function(){function n(t){t===void 0&&(t={}),this.options=t,this.cacheNodeMap=new Map,this.list=new Id,this.sentinel=this.list.add("sentinel")}return n.prototype.reset=function(){this.list.tail&&this.list.splice(this.list.tail,this.sentinel)},n.prototype.touchTile=function(t){var e=this.cacheNodeMap.get(t);e&&this.list.splice(this.sentinel,e)},n.prototype.loadTile=function(t){if(!this.cacheNodeMap.has(t)){var e=this.list.add(t);this.cacheNodeMap.set(t,e),this.options.onTileLoad&&this.options.onTileLoad(t)}},n.prototype.unloadTile=function(t){var e=this.cacheNodeMap.get(t);e&&(this.list.remove(e),this.cacheNodeMap.delete(t),this.options.onTileUnload&&this.options.onTileUnload(t))},n.prototype.unloadTiles=function(t){for(var e=this.list.head;e!==this.sentinel&&t();){var r=e.item;e=e.next,this.unloadTile(r)}},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}(),an=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}(),jo=function(){function n(t){this.tileset=t,this._canSelectTile=!0,this._loadAllTilesTraversalStack=new an,this.root=null}return n.prototype.traverse=function(t,e,r){this.root=t,this.reset()},n.prototype.reset=function(){this._loadAllTilesTraversalStack.reset(),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&&(t.state.selectedFrameNumber=e.frameNumber,this.tileset.selectedTiles.push(t),this.tileset.needsRefinedTiles.add(t))},n.prototype.loadTile=function(t,e){t.state.requestedFrameNumber<e.frameNumber&&(t.state.requestedFrameNumber=e.frameNumber,t.content&&(t.content.loadState==="FAILED"&&e.time-t.content.loadStateUpdateTime>t.content.loadfailRetryDelay&&(t.content.loadState="UNLOADED",t.content.loadStateUpdateTime=e.time),t.content.loadState==="UNLOADED"&&this.tileset.requestedTiles.push(t))),this.tileset.needsRefinedTiles.add(t)},n.prototype.touchTile=function(t,e){this.tileset.cache.touchTile(t),t.state.touchedFrameNumber=e.frameNumber},n.prototype.canTraverse=function(t,e){return!t.state.inRequestVolume||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 a=t.refine==="REPLACE";if(a&&r&&!this.anyChildrenVisible(t,e)){t.state.visible=!1;return}}},n.prototype.anyChildrenVisible=function(t,e){for(var r=!1,i=t.children,a=0,o=i;a<o.length;a++){var s=o[a];s.updateState(e),r=r||s.state.visible}return r},n.prototype.meetsScreenSpaceErrorEarly=function(t,e){var r=t.parent;return!r||r.refine!=="ADD"||r.levelOfContent<e.minLevelOfDetail?!1: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.prototype.loadAllTiles=function(t,e){var r=this._loadAllTilesTraversalStack;for(r.push(t);r.length>0;){var i=r.pop();i.content&&i.content.loadState==="UNLOADED"&&i.state.requestedFrameNumber<e.frameNumber&&this.tileset.requestedTiles.push(i),this.touchTile(i,e);for(var a=0,o=i.children;a<o.length;a++){var s=o[a];r.push(s)}}},n}(),Td=function(n){ue(t,n);function t(e){var r=n.call(this,e)||this;return r.tileset=e,r._traversalStack=new an,r._emptyTraversalStack=new an,r}return t.prototype.traverse=function(e,r,i){i===void 0&&(i=[]),n.prototype.traverse.call(this,e,r,i);for(var a=0,o=i;a<o.length;a++){var s=o[a];this._traversalStack.reset(),this._emptyTraversalStack.reset(),s.camera.refine&&(this._canSelectTile=s.camera.visible,this.updateTile(e,s),this.executeTraversal(e,s))}this._traversalStack.reset(),this._emptyTraversalStack.reset(),r.camera.refine&&(this._canSelectTile=r.camera.visible,this.updateTile(e,r),this.executeTraversal(e,r)),this.tileset.loadAll&&this.loadAllTiles(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 a=i.pop(),o=a.parent,s=!o||o.state.shouldRefine,u=!1;this.canTraverse(a,r)&&(u=this.updateAndPushChildren(a,r,i)&&s);var l=!u&&s;a.hasRenderContent?a.refine==="ADD"?(this.loadTile(a,r),this.selectDesiredTile(a,r)):a.refine==="REPLACE"&&(this.loadTile(a,r),l&&this.selectDesiredTile(a,r)):(this.loadTile(a,r),l&&this.selectDesiredTile(a,r)),this.touchTile(a,r),a.state.shouldRefine=u}},t.prototype.updateAndPushChildren=function(e,r,i){for(var a=e.children,o=0,s=a;o<s.length;o++){var u=s[o];this.updateTile(u,r)}this.sortTilesByDistanceToCamera(a);for(var l=e.refine==="REPLACE"&&!this.tileset.skipLevelOfDetail,c=!1,d=!0,p=0,A=a;p<A.length;p++){var u=A[p];if(u.levelOfContent<=r.minLevelOfDetail||u.state.visible&&u.state.inRequestVolume?(i.find(u)&&i.delete(u),i.push(u),c===!1&&(c=!0)):(l||this.tileset.loadSiblings)&&(this.loadTile(u,r),this.touchTile(u,r)),l){var h=void 0;u.state.inRequestVolume?u.hasRenderContent?h=u.contentAvailable:h=this.executeEmptyTraversal(u,r):h=!1,d=d&&h}}return c||(d=!1),d},t.prototype.selectDesiredTile=function(e,r){e.contentAvailable&&n.prototype.selectTile.call(this,e,r)},t.prototype.executeEmptyTraversal=function(e,r){var i=!0,a=this._emptyTraversalStack;for(a.push(e);a.length>0&&i;){var o=a.pop(),s=!o.hasRenderContent&&this.canTraverse(o,r);if(!s&&!o.contentAvailable&&(i=!1),this.updateTile(o,r),o.state.visible||(this.loadTile(o,r),this.touchTile(o,r)),s)for(var u=o.children,l=0,c=u;l<c.length;l++){var d=c[l];a.find(d)&&a.delete(d),a.push(d)}}return i},t}(jo),Pd=function(n){ue(t,n);function t(e){var r=n.call(this,e)||this;return r.tileset=e,r.baseScreenSpaceError=1024,r.skipScreenSpaceErrorFactor=16,r.skipLevels=1,r._traversalStack=new an,r._descendantTraversalStack=new an,r._selectionTraversalStack=new an,r._selectionTraversalancestorStack=new an,r}return t.prototype.traverse=function(e,r,i){i===void 0&&(i=[]),n.prototype.traverse.call(this,e,r,i);for(var a=0,o=i;a<o.length;a++){var s=o[a];this._traversalStack.reset(),s.camera.refine&&(this._canSelectTile=s.camera.visible,this.updateTile(e,s),this.executeTraversal(e,s),this.traverseAndSelect(e,s))}this.tileset.hasMixedContent=!1,this._traversalStack.reset(),this._descendantTraversalStack.reset(),this._selectionTraversalStack.reset(),this._selectionTraversalancestorStack.reset(),r.camera.refine&&(this._canSelectTile=r.camera.visible,this.updateTile(e,r),this.executeTraversal(e,r),this.traverseAndSelect(e,r)),this.tileset.loadAll&&this.loadAllTiles(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 a=i.pop();this.updateTileAncestorContentLinks(a,r);var o=a.parent,s=!o||o.state.shouldRefine,u=!1;this.canTraverse(a,r)&&(u=this.updateAndPushChildren(a,r,i)&&s);var l=!u&&s;a.hasRenderContent?a.refine==="ADD"?(this.loadTile(a,r),this.selectDesiredTile(a,r)):a.refine==="REPLACE"&&(this.inBaseTraversal(a,this.baseScreenSpaceError)?(this.loadTile(a,r),l&&this.selectDesiredTile(a,r)):l?(this.loadTile(a,r),this.selectDesiredTile(a,r)):this.reachedSkippingThreshold(a)&&this.loadTile(a,r)):(this.loadTile(a,r),l&&this.selectDesiredTile(a,r)),this.touchTile(a,r),a.state.shouldRefine=u}},t.prototype.updateAndPushChildren=function(e,r,i){for(var a=e.children,o=0,s=a;o<s.length;o++){var u=s[o];this.updateTile(u,r)}this.sortTilesByDistanceToCamera(a);for(var l=!1,c=0,d=a;c<d.length;c++){var u=d[c];u.levelOfContent<=r.minLevelOfDetail||u.state.visible&&u.state.inRequestVolume?(i.push(u),l===!1&&(l=!0)):this.tileset.loadSiblings&&(this.loadTile(u,r),this.touchTile(u,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 a=i.pop(),o=a.children,s=0,u=o;s<u.length;s++){var l=u[s];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 a=!(i.hasRenderContent&&i.hasUnloadedContent)||i.state.requestedFrameNumber===r.frameNumber;e.state.ancestorWithContent=a?i:i.state.ancestorWithContent,e.state.ancestorWithContentAvailable=i.contentAvailable?i:i.state.ancestorWithContentAvailable}},t.prototype.inBaseTraversal=function(e,r){return e.state.ancestorWithContent?e.parent&&e.state.screenSpaceError===0?e.parent.state.screenSpaceError>r:e.state.screenSpaceError>r:!0},t.prototype.traverseAndSelect=function(e,r){var i=this._selectionTraversalStack,a=this._selectionTraversalancestorStack,o;for(i.push(e);i.length>0||a.length>0;){if(a.length>0){var s=a.peek();if(s.state.stackLength===i.length){a.pop(),s!==o&&(s.state.finalResolution=!1),this.selectTile(s,r);continue}}var u=i.pop();if(u){var l=this.canTraverse(u,r);if(u.state.shouldSelect)if(u.refine==="ADD")this.selectTile(u,r);else{if(u.state.selectionDepth=a.length,u.state.selectionDepth>0&&(u.tileset.hasMixedContent=!0),o=u,!l){this.selectTile(u,r);continue}a.push(u),u.state.stackLength=i.length}if(l)for(var c=0,d=u.children;c<d.length;c++){var p=d[c];p.state.visible&&i.push(p)}}}},t}(jo),Rd=function(n){ue(t,n);function t(e){var r=n.call(this,e)||this;return r.tileset=e,r._traversalStack=new an,r}return t.prototype.canTraverse=function(e,r){return!(!e.state.inRequestVolume||e.levelOfContent>=r.maxLevelOfDetail||e.children.length===0)},t.prototype.traverse=function(e,r,i){n.prototype.traverse.call(this,e,r,[]),this._traversalStack.reset(),e.updateState(r);for(var a=0,o=i;a<o.length;a++){var s=o[a];this._traversalStack.reset(),s.camera.refine&&(this._canSelectTile=s.camera.visible,e.updateState(s),this.executeTraversal(e,s))}this._traversalStack.reset(),r.camera.refine&&(this._canSelectTile=r.camera.visible,e.updateState(r),this.executeTraversal(e,r)),this.tileset.loadAll&&this.loadAllTiles(e,r)},t.prototype.reset=function(){n.prototype.reset.call(this),this._traversalStack.reset()},t.prototype.executeTraversal=function(e,r){var i=this._traversalStack;for(i.push(e);i.length>0;){var a=i.pop(),o=a.refine==="ADD",s=a.refine==="REPLACE",u=this.canTraverse(a,r);u&&this.updateAndPushChildren(a,r,i),(o||s&&!u)&&(this.loadTile(a,r),this.touchTile(a,r),this.selectDesiredTile(a,r))}},t.prototype.updateAndPushChildren=function(e,r,i){for(var a=e.children,o=0;o<a.length;++o){var s=a[o];s.updateState(r),s.state.visible&&i.push(s)}},t.prototype.selectDesiredTile=function(e,r){e.contentAvailable&&n.prototype.selectTile.call(this,e,r)},t}(jo),Cu=function(){function n(t,e,r){this.index=t,this.name=e.name,this.visible=!1,this.tileset=r,this.transform=new f.Matrix4,e.transform&&this.transform.fromArray(e.transform),this.transform.premultiply(this.tileset.root.transform),this.content={uri:e.file,byteLength:0,loadState:"UNLOADED",loadStateUpdateTime:ve(),loadfailRetryDelay:0,data:void 0}}return n}(),Bd=new f.Matrix4,Or=function(){function n(t,e,r){var i=this,a,o,s,u,l,c,d,p,A;if(this.id=t,this.transform=new f.Matrix4,this.transformIsIdentity=!0,this.hasMixedContent=!1,this.url=(a=r.url)!==null&&a!==void 0?a:"",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,trajectories:(l=(u=e.asset.trajectories)===null||u===void 0?void 0:u.list)!==null&&l!==void 0?l:[],extras:e.asset.extras},this.rootMeta=(c=e.rootMeta)!==null&&c!==void 0?c:{},this.pointLength=(d=this.rootMeta.numTotalPoints)!==null&&d!==void 0?d:1/0,this.floorLength=(p=this.rootMeta.numFloors)!==null&&p!==void 0?p:1,this.properties=(A=e.properties)!==null&&A!==void 0?A:{},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.mostDetail=n.DEFAULT_MOST_DETAIL,this.loadSiblings=n.DEFAULT_LOAD_SIBLINGS,this.loadAll=n.DEFAULT_LOAD_ALL,this.maxRequests=n.DEFAULT_MAX_REQUESTS,this.tileRequestOrder=n.DEFAULT_REQUEST_ORDER,this.requestedTiles=[],this.selectedTiles=[],this.unloadTiles=[],this.needsRefinedTiles=new Set,this.selectedTrajectories=[],this.normalTraverser=new Td(this),this.skipTraverser=new Pd(this),this.mostDetailTraverser=new Rd(this),this.cache=new Mu({onTileLoad:function(g){i.memoryUsageInBytes+=g.contentByteLength},onTileUnload:function(g){i.memoryUsageInBytes-=g.contentByteLength,i.unloadTiles.push(g)}}),this.requestScheduler=new Su(this,{onTileSkip:function(g){},onTileLoad:function(g){var m;!((m=g.content)===null||m===void 0)&&m.data&&(i.loadedTiles.add(g),i.cache.loadTile(g)),i.options.onTileLoad(g)},onTileError:function(g,m){i.options.onTileError(g,m)}}),this.frameNumber=0,this.maxLevelOfDetail=0,this.minLevelOfDetail=0,this.loadedTiles=new Set,this.memoryUsageInBytes=0,this.root=new _o("".concat(this.id,".0"),e.root,this),this.geometricError=e.geometricError,this.trajectories=[],this.asset.trajectories)for(var h=0;h<this.asset.trajectories.length;h++){var v=new Cu(h,this.asset.trajectories[h],this);this.trajectories.push(v)}}return Object.defineProperty(n.prototype,"traverser",{get:function(){return this.mostDetail?this.mostDetailTraverser:this.skipLevelOfDetail?this.skipTraverser:this.normalTraverser},enumerable:!1,configurable:!0}),n.prototype.reset=function(){for(var t=this,e=[this.root],r;r=e.pop();){for(var i=0,a=r.children.length;i<a;i++)e.push(r.children[i]);this.cache.unloadTile(r)}for(var o=function(){var c=s.unloadTiles.pop();c&&(s.loadedTiles.delete(c),s.memoryUsageInBytes-=c.contentByteLength,s.options.tileUnloader(c).catch(function(){}).then(function(){t.options.onTileUnload&&t.options.onTileUnload(c)}))},s=this;this.unloadTiles.length;)o();this.cache.reset(),this.traverser.reset(),this.requestScheduler.reset(),this.loadedTiles.clear();for(var u=function(){var c=l.trajectories.pop();c&&l.options.trajectoryUnloader(c).catch(function(){}).then(function(){t.options.onTrajectoryUnload&&t.options.onTrajectoryUnload(c)})},l=this;this.trajectories.length;)u()},n.prototype.update=function(t,e){var r=this,i;e===void 0&&(e=[]),this.frameNumber=t.frameNumber,this.minLevelOfDetail=t.minLevelOfDetail,this.maxLevelOfDetail=t.maxLevelOfDetail,this.transformIsIdentity=this.transform.equals(Bd),this.traverser.traverse(this.root,t,e),this.cache.unloadTiles(function(){var p=r.memoryUsageInBytes>r.maxMemoryUsage*1024*1024;return p}),this.requestScheduler.update(this.requestedTiles,this.tileRequestOrder,t);for(var a=function(){var p=o.unloadTiles.pop();p&&(o.loadedTiles.delete(p),o.options.tileUnloader(p).catch(function(){}).then(function(){r.options.onTileUnload&&r.options.onTileUnload(p)}))},o=this;this.unloadTiles.length;)a();this.selectedTrajectories.length=0;for(var s=function(p){p.visible===!0&&p.content.loadState==="READY"&&(!((i=p.content.data)===null||i===void 0)&&i.object)?u.selectedTrajectories.push(p):p.visible===!0&&(p.content.loadState==="FAILED"&&t.time-p.content.loadStateUpdateTime>p.content.loadfailRetryDelay&&(p.content.loadState="UNLOADED",p.content.loadStateUpdateTime=t.time),p.content.loadState==="UNLOADED"&&u.options.trajectoryLoader(p).then(function(){r.options.onTrajectoryLoad(p)}).catch(function(A){r.options.onTrajectoryError(p,A)}))},u=this,l=0,c=this.trajectories;l<c.length;l++){var d=c[l];s(d)}},n.DEFAULT_MAX_MEMORY_USAGE=16,n.DEFAULT_MAX_SCREEN_SPACE_ERROR=4,n.DEFAULT_SKIP_LEVEL_OF_DETAIL=!1,n.DEFAULT_MOST_DETAIL=!1,n.DEFAULT_LOAD_SIBLINGS=!1,n.DEFAULT_LOAD_ALL=!1,n.DEFAULT_MAX_REQUESTS=6,n.DEFAULT_REQUEST_ORDER="SCREEN_SPACE_ERROR",n}(),Iu=function(){function n(t,e){this.position=t,this.indices=e}return n.prototype.getPositionCount=function(){var t,e,r=this.indices,i=this.position;return r?r.array.length/((t=r.stride)!==null&&t!==void 0?t:1):i.array.length/((e=i.stride)!==null&&e!==void 0?e:3)},n.prototype.getPositionByIndex=function(t,e){var r,i,a,o,s=this.indices,u=this.position,l=t;if(s){var c=s.array,d=(r=s.stride)!==null&&r!==void 0?r:1,p=(i=s.offset)!==null&&i!==void 0?i:0;l=c[t*d+p]}var A=u.array,h=(a=u.stride)!==null&&a!==void 0?a:3,v=(o=u.offset)!==null&&o!==void 0?o:0;return l=l*h+v,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}(),zn=function(){function n(t,e,r,i,a){this.id=t,this.extents=e,this.startIndex=r,this.endIndex=i,this.deepth=a}return n}(),Nr=6*4+4+4+2+2;function Tu(n,t){for(var e=new ArrayBuffer(t*Nr),r=new Float32Array(e),i=new Uint32Array(e),a=new Uint16Array(e),o=[n],s,u;s=o.pop();)u=s.id*Nr/4,r[u]=s.extents[0],r[u+1]=s.extents[1],r[u+2]=s.extents[2],r[u+3]=s.extents[3],r[u+4]=s.extents[4],r[u+5]=s.extents[5],i[u+6]=s.startIndex,i[u+7]=s.endIndex,u=s.id*Nr/2,s.node0&&(a[u+16]=s.node0.id,o.push(s.node0)),s.node1&&(a[u+17]=s.node1.id,o.push(s.node1));return e}function Pu(n,t,e,r,i,a,o,s,u){u===void 0&&(u=0),e=e-u,r=r-u,i=i-u,a=a+u,o=o+u,s=s+u;var l=0,c=0,d=0,p=0,A=0,h=0;return t.x>=0?(l=(e-n.x)*t.x,c=(a-n.x)*t.x):(l=(a-n.x)*t.x,c=(e-n.x)*t.x),t.y>=0?(d=(r-n.y)*t.y,p=(o-n.y)*t.y):(d=(o-n.y)*t.y,p=(r-n.y)*t.y),!(l>p||d>c||(d>l&&(l=d),p<c&&(c=p),t.z>=0?(A=(i-n.z)*t.z,h=(s-n.z)*t.z):(A=(s-n.z)*t.z,h=(i-n.z)*t.z),l>h||A>c)||(A>l&&(l=A),h<c&&(c=h),c<0))}var Mn=function(){function n(t,e,r){this.x=t,this.y=e,this.z=r}return n.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},n.prototype.set=function(t,e,r){return this.x=t,this.y=e,this.z=r,this},n.prototype.fromArray=function(t,e){return e===void 0&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},n.prototype.toArray=function(t,e){return t===void 0&&(t=[]),e===void 0&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},n.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this},n.prototype.multiplyScalar=function(t){return this.x*=t,this.y*=t,this.z*=t,this},n.prototype.subVectors=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},n.prototype.addScaledVector=function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},n.prototype.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z},n.prototype.cross=function(t){var e=this.x,r=this.y,i=this.z;return this.x=r*t.z-i*t.y,this.y=i*t.x-e*t.z,this.z=e*t.y-r*t.x,this},n.prototype.crossVectors=function(t,e){var r=t.x,i=t.y,a=t.z,o=e.x,s=e.y,u=e.z;return this.x=i*u-a*s,this.y=a*o-r*u,this.z=r*s-i*o,this},n.prototype.distanceTo=function(t){return Math.sqrt(this.distanceToSquared(t))},n.prototype.distanceToSquared=function(t){var e=this.x-t.x,r=this.y-t.y,i=this.z-t.z;return e*e+r*r+i*i},n.prototype.clone=function(){return new n(this.x,this.y,this.z)},n}(),Ru=function(){function n(t,e,r){this.triangle=t,this.intersectionPoint=e,this.index=r}return n}(),zs=1e-6,Je=new Mn(0,0,0),Xr=new Mn(0,0,0),Wr=new Mn(0,0,0),Zr=new Mn(0,0,0),Bu=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.createTree=function(e,r,i){r=Math.min(r,16);var a=this.getPositionCount()/3,o=a>65535?new Uint32Array(a):new Uint16Array(a),s=new Float32Array(a*6),u=[],l=0,c=-1;if(i)for(var d=0,p=0,A=0,h=void 0,v=void 0,g=void 0,m=void 0,y=void 0,b=void 0,x=void 0;d<a;d+=1,p+=3,A+=6)o[d]=d,this.getPositionByIndex(p,Xr),this.getPositionByIndex(p+1,Wr),this.getPositionByIndex(p+2,Zr),h=m=Xr.x,x=Wr.x,x<h&&(h=x),x>m&&(m=x),x=Zr.x,x<h&&(h=x),x>m&&(m=x),v=y=Xr.y,x=Wr.y,x<v&&(v=x),x>y&&(y=x),x=Zr.y,x<v&&(v=x),x>y&&(y=x),g=b=Xr.z,x=Wr.z,x<g&&(g=x),x>b&&(b=x),x=Zr.z,x<g&&(g=x),x>b&&(b=x),s[A]=h,s[A+1]=v,s[A+2]=g,s[A+3]=m,s[A+4]=y,s[A+5]=b;else{for(var w=1/0,E=1/0,S=1/0,C=-1/0,R=-1/0,B=-1/0,d=0,p=0,A=0,h=void 0,v=void 0,g=void 0,m=void 0,y=void 0,b=void 0,x=void 0;d<a;d+=1,p+=3,A+=6)o[d]=d,this.getPositionByIndex(p,Xr),this.getPositionByIndex(p+1,Wr),this.getPositionByIndex(p+2,Zr),h=m=Xr.x,x=Wr.x,x<h&&(h=x),x>m&&(m=x),x=Zr.x,x<h&&(h=x),x>m&&(m=x),v=y=Xr.y,x=Wr.y,x<v&&(v=x),x>y&&(y=x),x=Zr.y,x<v&&(v=x),x>y&&(y=x),g=b=Xr.z,x=Wr.z,x<g&&(g=x),x>b&&(b=x),x=Zr.z,x<g&&(g=x),x>b&&(b=x),s[A]=h,s[A+1]=v,s[A+2]=g,s[A+3]=m,s[A+4]=y,s[A+5]=b,h<w&&(w=h),m>C&&(C=m),v<E&&(E=v),y>R&&(R=y),g<S&&(S=g),b>B&&(B=b);i=[w,E,S,C,R,B]}var M=new zn(++c,i,0,a,0);u[l++]=M;var I=[],L=[0,1,2],T=function(D,V){return I[V]-I[D]};function F(D){var V=D.startIndex,z=D.endIndex,Q=D.extents;I[0]=Q[3]-Q[0],I[1]=Q[4]-Q[1],I[2]=Q[5]-Q[2],L.sort(T);for(var q=0;q<3;q++){for(var G=L[q],K=Q[G]+Q[G+3],j=V,J=z-1,W=-1,$=void 0;j<=J;)W===-1?($=o[j],s[$*6+G]+s[$*6+G+3]<K?j++:W=$):($=o[J],s[$*6+G]+s[$*6+G+3]>=K||(o[j]=$,o[J]=W,W=-1,j++),J--);if(j>V&&j<z){var Y=new zn(++c,Us(o,s,V,j,zs),V,j,D.deepth+1);Y.deepth<r&&Y.endIndex-Y.startIndex>e&&(u[l++]=Y);var Z=new zn(++c,Us(o,s,j,z,zs),j,z,D.deepth+1);Z.deepth<r&&Z.endIndex-Z.startIndex>e&&(u[l++]=Z),D.node0=Y,D.node1=Z,D.startIndex=0,D.endIndex=0;break}}}for(;l;)F(u[--l]);return this.offsetArray=o,this.rootNodePacked=Tu(M,c+1),u.length=0,this},t.prototype.trianglesInSphere=function(e,r){for(var i=this.offsetArray,a=this.rootNodePacked,o=new Float32Array(a),s=new Uint32Array(a),u=new Uint16Array(a),l=[0],c=[],d,p,A,h;(d=l.pop())!==void 0;){h=d*Nr/4;var v=La(e.x,o[h],o[h+3])-e.x,g=La(e.y,o[h+1],o[h+4])-e.y,m=La(e.z,o[h+2],o[h+5])-e.z;if(v*v+g*g+m*m<=r*r){for(var y=s[h+6];y<s[h+7];y++)c.push(i[y]);h=d*Nr/2,p=u[h+16],A=u[h+17],p&&l.push(p),A&&l.push(A)}}for(var b=c.length,x=new Float32Array(b*9),y=0;y<b;y++){var w=c[y];this.getPositionByIndex(w,Je),x[y*9]=Je.x,x[y*9+1]=Je.y,x[y*9+2]=Je.z,this.getPositionByIndex(w+1,Je),x[y*9+3]=Je.x,x[y*9+4]=Je.y,x[y*9+5]=Je.z,this.getPositionByIndex(w+2,Je),x[y*9+6]=Je.x,x[y*9+7]=Je.y,x[y*9+8]=Je.z}return x},t.prototype.intersectRay=function(e,r,i,a){for(var o=this.offsetArray,s=this.rootNodePacked,u=new Float32Array(s),l=new Uint32Array(s),c=new Uint16Array(s),d=new Mn(1/r.x,1/r.y,1/r.z),p=[0],A,h,v,g;(A=p.pop())!==void 0;)if(g=A*Nr/4,Pu(e,d,u[g],u[g+1],u[g+2],u[g+3],u[g+4],u[g+5])){for(var m=l[g+6],y=l[g+7],b=void 0,x=void 0,w=void 0,E=e.x,S=e.y,C=e.z,R=r.x,B=r.y,M=r.z,I=void 0,L=void 0,T=void 0,F=void 0,D=void 0,V=void 0,z=void 0,Q=void 0,q=void 0,G=void 0,K=void 0,j=void 0,J=void 0,W=void 0,$=void 0,Y=void 0,Z=void 0,oe=void 0,ne=void 0,de=void 0,se=void 0,ye=void 0,ie=void 0,xe=void 0,Le=void 0,Me=void 0,Oe=void 0;m<y;m++){if(b=o[m],x=b*3,this.getPositionByIndex(x,Je),I=Je.x,L=Je.y,T=Je.z,this.getPositionByIndex(x+1,Je),F=Je.x,D=Je.y,V=Je.z,this.getPositionByIndex(x+2,Je),z=Je.x,Q=Je.y,q=Je.z,G=F-I,K=D-L,j=V-T,J=z-I,W=Q-L,$=q-T,Y=K*$-j*W,Z=j*J-G*$,oe=G*W-K*J,ie=R*Y+B*Z+M*oe,ie>0)ye=1;else if(ie<0)ye=-1,ie=-ie;else continue;ne=E-I,de=S-L,se=C-T,xe=ye*(R*(de*$-se*W)+B*(se*J-ne*$)+M*(ne*W-de*J)),!(xe<0)&&(Le=ye*(R*(K*se-j*de)+B*(j*ne-G*se)+M*(G*de-K*ne)),!(Le<0)&&(xe+Le>ie||(Me=-ye*(ne*Y+de*Z+se*oe),!(Me<0)&&(Oe=Me/ie,a.push(new Ru([I,L,T,F,D,V,z,Q,q],[E+R*Oe,S+B*Oe,C+M*Oe],b))))))}g=A*Nr/2,h=c[g+16],v=c[g+17],h&&p.push(h),v&&p.push(v)}return a},t}(Iu);function La(n,t,e){return n<t?t:n>e?e:n}function Us(n,t,e,r,i){if(e>=r)return[0,0,0,0,0,0];for(var a=1/0,o=1/0,s=1/0,u=-1/0,l=-1/0,c=-1/0,d=e,p=void 0,A=void 0;d<r;d++)p=n[d]*6,A=t[p],A<a&&(a=A),A=t[p+1],A<o&&(o=A),A=t[p+2],A<s&&(s=A),A=t[p+3],A>u&&(u=A),A=t[p+4],A>l&&(l=A),A=t[p+5],A>c&&(c=A);return[a-i,o-i,s-i,u+i,l+i,c+i]}var Qs=1e-6,Fd=["x","y","z"],xt=new Mn(0,0,0),Fu=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.createTree=function(e,r,i){r=Math.min(r,16);var a=this.getPositionByIndex.bind(this),o=this.getPositionCount(),s=o>65535?new Uint32Array(o):new Uint16Array(o),u=[],l=0,c=-1;if(i)for(var d=0;d<o;d+=1)s[d]=d;else{a(0,xt);for(var p=xt.x,A=xt.y,h=xt.z,v=p,g=A,m=h,d=0,y=void 0,b=void 0,x=void 0;d<o;d+=1)s[d]=d,a(d,xt),y=xt.x,b=xt.y,x=xt.z,y<p?p=y:y>v&&(v=y),b<A?A=b:b>g&&(g=b),x<h?h=x:x>m&&(m=x);i=[p,A,h,v,g,m]}var w=new zn(++c,i,0,o,0);u[l++]=w;var E=[],S=[0,1,2],C=function(B,M){return E[M]-E[B]};function R(B){var M=B.startIndex,I=B.endIndex,L=B.extents;E[0]=L[3]-L[0],E[1]=L[4]-L[1],E[2]=L[5]-L[2];for(var T=S.sort(C)[0],F=Fd[T],D=(L[T]+L[T+3])/2,V=M,z=I-1,Q=-1,q;V<=z;)Q===-1?(q=s[V],a(q,xt),xt[F]<D?V++:Q=q):(q=s[z],a(q,xt),xt[F]>=D||(s[V]=q,s[z]=Q,Q=-1,V++),z--);if(V>M){var G=L.slice();G[T+3]=D+Qs;var K=new zn(++c,G,M,V,B.deepth+1);K.deepth<r&&K.endIndex-K.startIndex>e&&(u[l++]=K),B.node0=K}if(I>V){var j=L.slice();j[T]=D-Qs;var J=new zn(++c,j,V,I,B.deepth+1);J.deepth<r&&J.endIndex-J.startIndex>e&&(u[l++]=J),B.node1=J}B.startIndex=0,B.endIndex=0}for(;l;)R(u[--l]);return this.offsetArray=s,this.rootNodePacked=Tu(w,c+1),u.length=0,this},t.prototype.intersectRay=function(e,r,i,a){for(var o=this.offsetArray,s=this.rootNodePacked,u=new Float32Array(s),l=new Uint32Array(s),c=new Uint16Array(s),d=i*i,p=new Mn(1/r.x,1/r.y,1/r.z),A=[0],h,v,g,m;(h=A.pop())!==void 0;)if(m=h*Nr/4,Pu(e,p,u[m],u[m+1],u[m+2],u[m+3],u[m+4],u[m+5],i)){for(var y=l[m+6],b=l[m+7],x=void 0,w=void 0,E=void 0,S=void 0,C=void 0,R=void 0,B=void 0,M=void 0,I=void 0,L=void 0,T=void 0,F=void 0;y<b;y++)x=o[y],this.getPositionByIndex(x,xt),w=xt.x,E=xt.y,S=xt.z,C=e.x,R=e.y,B=e.z,M=r.x,I=r.y,L=r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PT09Im1lc2giKW49bmV3IEFyKHYuYXR0cmlidXRlcy5wb3NpdGlvbix2LmluZGljZXMpO2Vsc2UgaWYodi50eXBlPT09InBvaW50cyIpbj1uZXcgUHIodi5hdHRyaWJ1dGVzLnBvc2l0aW9uLHYuaW5kaWNlcyk7ZWxzZSB0aHJvdyBuZXcgRXJyb3IoIkludmFsaWQgVHlwZSIpO24uY3JlYXRlVHJlZSh2Lm1heEl0ZW1QZXJOb2RlLHYubWF4VHJlZURlcHRoLHYuZXh0ZW50cyk7dmFyIHM9e3R5cGU6di50eXBlLGF0dHJpYnV0ZXM6di5hdHRyaWJ1dGVzLGluZGljZXM6di5pbmRpY2VzLG9mZnNldEFycmF5Om4ub2Zmc2V0QXJyYXkscm9vdE5vZGVQYWNrZWQ6bi5yb290Tm9kZVBhY2tlZH07dC5wdXNoKHMpO3ZhciB1PXZvaWQgMDtmb3IodmFyIHcgaW4gcy5hdHRyaWJ1dGVzKXt2YXIgeT1zLmF0dHJpYnV0ZXNbd107eSYmeS5idWZmZXIgaW5zdGFuY2VvZiBBcnJheUJ1ZmZlciYmby5hZGQoeS5idWZmZXIpfXU9cy5pbmRpY2VzLHUmJnUuYnVmZmVyIGluc3RhbmNlb2YgQXJyYXlCdWZmZXImJm8uYWRkKHUuYnVmZmVyKSx1PXMub2Zmc2V0QXJyYXksdSYmdS5idWZmZXIgaW5zdGFuY2VvZiBBcnJheUJ1ZmZlciYmby5hZGQodS5idWZmZXIpLG8uYWRkKHMucm9vdE5vZGVQYWNrZWQpfXJldHVybntvdXRwdXQ6dCx0cmFuc2ZlcjpBcnJheS5mcm9tKG8pfX0pfSl9KSgpOwo=",Ld=n=>Uint8Array.from(atob(n),t=>t.charCodeAt(0)),qs=typeof self!="undefined"&&self.Blob&&new Blob([Ld(Lu)],{type:"text/javascript;charset=utf-8"});function kd(n){let t;try{if(t=qs&&(self.URL||self.webkitURL).createObjectURL(qs),!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,"+Lu,{name:n==null?void 0:n.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var ku=function(){function n(t,e){this.pool=e,this.workerCreator=t,this.queue=[],this.workers=[],this.workersResolver=[],this.workerStatus=0}return n.prototype.initWorker=function(t){if(this.workerCreator&&!this.workers[t]){var e=this.workerCreator();e.addEventListener("message",this.onMessage.bind(this,t)),this.workers[t]=e}},n.prototype.getIdleWorker=function(){for(var t=0;t<this.pool;t++)if(!(this.workerStatus&1<<t))return t;return-1},n.prototype.onMessage=function(t,e){var r=this.workersResolver[t],i=r.resolve,a=r.reject;if(e.data&&"$$error"in e.data?a(e.data.$$error):i(e.data),this.queue.length){var o=this.queue.shift(),s=o.resolve,u=o.reject,l=o.input,c=o.transfer;this.workersResolver[t]={resolve:s,reject:u},this.workers[t].postMessage(l,c)}else this.workerStatus^=1<<t},n.prototype.postMessage=function(t,e){var r=this;return e===void 0&&(e=[]),new Promise(function(i,a){var o=r.getIdleWorker();o!==-1?(r.initWorker(o),r.workerStatus|=1<<o,r.workersResolver[o]={resolve:i,reject:a},r.workers[o].postMessage(t,e)):r.queue.push({resolve:i,reject:a,input:t,transfer:e})})},n.prototype.dispose=function(){this.workers.forEach(function(t){return t.terminate()}),this.workersResolver.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0},n}(),Od=new ku(function(){return new kd},4),Dd=new Map,Un=new f.Ray,Hs=new f.Matrix3,oi=new f.Matrix4,Ou=new f.Vector3,Vd=new f.Vector3,Nd=new f.Vector3,zd=new f.Triangle;function Ud(n,t,e,r){var i,a=n.matrixWorld;oi.getInverse(a),Un.copy(e.ray).applyMatrix4(oi);for(var o=t.intersectRay(Un.origin,Un.direction,0,[]),s=n.geometry,u=n.material,l=s.groups,c=s.index,d=0,p=o.length;d<p;d++){var A=o[d],h=A.triangle,v=A.index,g=A.intersectionPoint,m=new f.Vector3(g[0],g[1],g[2]).applyMatrix4(a),y=e.ray.origin.distanceTo(m);if(!(y<e.near||y>e.far)){var b=void 0;if(Array.isArray(u)){if(l)for(var x=v*3,w=0,E=l;w<E.length;w++){var S=E[w];if(x>=S.start&&x-S.start<S.count){b=u[(i=S.materialIndex)!==null&&i!==void 0?i:0];break}}}else b=u;if(b){var C=zd.set(Ou.set(h[0],h[1],h[2]).applyMatrix4(a),Vd.set(h[3],h[4],h[5]).applyMatrix4(a),Nd.set(h[6],h[7],h[8]).applyMatrix4(a)).getNormal(new f.Vector3),R=v*3,B=new f.Face3(c?c.array[R]:R,c?c.array[R+1]:R+1,c?c.array[R+2]:R+2,C),M=e.ray.direction.dot(C);b.side===f.FrontSide&&M>=0||b.side===f.BackSide&&M<=0||r.push({distance:y,object:n,face:B,point:m,distanceToRay:0,faceIndex:v})}}}}function Qd(n,t,e,r){var i,a,o=n.matrixWorld;Hs.getNormalMatrix(o),oi.getInverse(o);var s=((a=(i=e.params.Points)===null||i===void 0?void 0:i.threshold)!==null&&a!==void 0?a:1)*oi.getMaxScaleOnAxis();Un.copy(e.ray).applyMatrix4(oi);for(var u=t.intersectRay(Un.origin,Un.direction,s,[]),l=n.geometry,c=l.index,d=l.getAttribute("normal"),p=0,A=u.length;p<A;p++){var h=u[p],v=h.triangle,g=h.index,m=h.intersectionPoint,y=new f.Vector3(m[0],m[1],m[2]).applyMatrix4(o),b=e.ray.origin.distanceTo(y);if(!(b<e.near||b>e.far)){var x=Ou.set(v[0],v[1],v[2]).applyMatrix4(o),w=c?c.array[g]:g,E=void 0;if(d instanceof f.BufferAttribute){var S=new f.Vector3().fromBufferAttribute(d,w).applyNormalMatrix(Hs);E=new f.Face3(w,w,w,S)}r.push({distance:b,object:n,face:E,point:y,distanceToRay:y.distanceTo(x),index:g})}}}var Du="__bvh_mesh__",qd=f.Mesh.prototype.raycast;function Hd(n,t){var e=Gd(this);e?Ud(this,e,n,t):qd.call(this,n,t)}function Gd(n){var t=n[Du];return t instanceof Bu,t}function Kd(n,t){var e;Object.assign(n,(e={},e[Du]=t,e.raycast=Hd,e))}var Vu="__bvh_points__",_d=f.Points.prototype.raycast;function jd(n,t){var e=Jd(this);e?Qd(this,e,n,t):_d.call(this,n,t)}function Jd(n){var t=n[Vu];return t instanceof Fu,t}function Xd(n,t){var e;Object.assign(n,(e={},e[Vu]=t,e.raycast=jd,e))}function Wd(n,t,e,r){var i=[];return n.traverse(function(a){(a instanceof f.Mesh||a instanceof f.Points)&&a.geometry instanceof f.BufferGeometry&&i.push(a)}),Promise.resolve().then(function(){for(var a=[],o=new Set,s=null,u=0;u<i.length;u++){var l=i[u],c=l.geometry;if(c instanceof f.BufferGeometry){var d=void 0;if(l instanceof f.Mesh?d="mesh":l instanceof f.Points&&(d="points"),!!d){var p=c.boundingBox,A=p?[p.min.x,p.min.y,p.min.z,p.max.x,p.max.y,p.max.z]:void 0,h={};for(var v in c.attributes){var g=c.attributes[v];g instanceof f.InterleavedBufferAttribute?(h[v]={array:g.data.array,stride:g.data.stride,offset:g.offset},s=g.data.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer)):(h[v]={array:g.array},s=g.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer))}var m=void 0,y=c.getIndex();y&&(y instanceof f.InterleavedBufferAttribute?(m={array:y.data.array,stride:y.data.stride,offset:y.offset},s=y.data.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer)):(m={array:y.array},s=y.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer)));var b={type:d,attributes:h,indices:m,maxItemPerNode:e,maxTreeDepth:r,extents:A};a.push(b)}}}return Od.postMessage(a,Array.from(o))}).then(function(a){for(var o=0;o<i.length;o++){var s=i[o],u=s.geometry,l=a[o];if(u instanceof f.BufferGeometry){for(var c in l.attributes){var d=l.attributes[c].array,p=u.attributes[c];p instanceof f.InterleavedBufferAttribute?p.data.array=d:p.array=d}var A=u.getIndex();if(A&&l.indices){var d=l.indices.array;A instanceof f.InterleavedBufferAttribute?A.data.array=d:A.array=d}if(s instanceof f.Mesh){var h=new Bu(l.attributes.position,l.indices);h.offsetArray=l.offsetArray,h.rootNodePacked=l.rootNodePacked,Kd(s,h)}else if(s instanceof f.Points){var h=new Fu(l.attributes.position,l.indices);h.offsetArray=l.offsetArray,h.rootNodePacked=l.rootNodePacked,Xd(s,h)}}}return n})}var Nu=function(n){ue(t,n);function t(e,r,i){i===void 0&&(i=U);var a=n.call(this)||this;return a.contentObject=r,a.name=e,a.materials=[],a.pbmObjects=[],a.disposers=[i],a.add(r),r.traverse(function(o){var s;if(o instanceof f.Mesh||o instanceof f.Points){var u=o.material;Array.isArray(u)?(s=a.materials).push.apply(s,u):a.materials.push(u)}(o instanceof kt||o instanceof mr)&&a.pbmObjects.push(o)}),a}return t.prototype.generateBvhTree=function(){return Wd(this,!0,200,10)},t.prototype.intersectRaycaster=function(e,r,i){r===void 0&&(r=!0),i===void 0&&(i=[]);for(var a=this.children.slice(),o,s=[];o=a.pop();)if(o.visible){o.raycast(e,s);for(var u=0,l=o.children.length;u<l;u++)a.push(o.children[u])}return s.forEach(function(c){var d=0;if((c.object instanceof kt||c.object instanceof mr)&&c.face){var p=Array.isArray(c.object.material)?c.object.material[c.face.materialIndex]:c.object.material;p&&(d=p.floor)}c.floor=d}),r&&s.sort(function(c,d){return c.distance-d.distance}),i.push.apply(i,s),i},t.prototype.update=function(e,r,i,a){for(var o=0,s=this.pbmObjects;o<s.length;o++){var u=s[o];u.update(e,r,i,a)}},t.prototype.dispose=function(){for(var e=0,r=this.disposers;e<r.length;e++){var i=r[e];i()}this.disposers.length=0,this.pbmObjects.length=0},t.prototype.clone=function(){return new t(this.name,this.contentObject.clone())},t}(f.Object3D);function st(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=[];n=n.map(function(s){return(s!=null?s:"").trim()}).filter(function(s){return s.length>0&&!/^\/+$/.test(s)});for(var r=0;r<n.length;r++){var i=r===0,a=r===n.length-1,o=n[r];i||(o=o.replace(/^\.\//,"").replace(/^\/+/,"")),a||(o=o.replace(/\/+$/,"")),e.push(o)}return e.join("/")}function Gi(n){var t,e=/^(http\:|https\:|file\:)?\/\/[^/]/.exec(n);if(!e)return n;var r=e[1]||"",i=n.slice(r.length+2),a=i.indexOf("#");a>=0&&(n.slice(a),i=n.slice(0,a));var o=i.indexOf("?");o>=0&&(n.slice(o),i=n.slice(0,o));for(var s=i.split("/"),u=s.shift(),l=(t=s.pop())!==null&&t!==void 0?t:"",c=[],d=0,p=s;d<p.length;d++){var A=p[d];if(!(A===""||A===".")){if(A===".."){c.pop();continue}c.push(A)}}return r+"//"+u+"/"+c.join("/")+"/"+l}function Ur(n){return n.indexOf("//")===0||/^[0-9a-z]+\:/i.test(n)}function zu(n,t,e){var r;if(n.content){var i=(r=n.content.uri)!==null&&r!==void 0?r:n.content.url;typeof i=="string"&&!Ur(i)&&(n.content.uri=Gi(st(t,i)))}if(n.transform){for(var a=!1,o=0;o<16;o++){var s=n.transform[o];if(typeof s!="number"||isNaN(s)||!isFinite(s)){a=!0;break}}if(n.transform[15]===0&&(a=!0),a)throw new Error("Invalid Tile Transform: "+JSON.stringify(n.transform))}if(n.children)for(var u=0,l=n.children;u<l.length;u++){var c=l[u];zu(c,t)}return n}function Ki(n,t){if(n.asset||(n.asset={}),n.rootMeta||(n.rootMeta={}),n.rootMeta.taskParameters||(n.rootMeta.taskParameters={}),n.asset.overview){var e=n.asset.overview;Ur(e.imageFile)||(e.imageFile=Gi(st(t,e.imageFile))),Ur(e.worldFile)||(e.worldFile=Gi(st(t,e.worldFile)))}if(n.asset.trajectories)for(var r=0;r<n.asset.trajectories.list.length;r++){var i=n.asset.trajectories.list[r];i.file=Gi(st(t,i.file))}return zu(n.root,t),n}function Zd(n,t,e){for(var r,i,a=Promise.resolve(),o=n.slice(),s=function(){for(var u=[],l=0,c=void 0;c=o.shift();){u.push(c);var d=((r=c.image)===null||r===void 0?void 0:r.width)*((i=c.image)===null||i===void 0?void 0:i.height);if(!isNaN(d)&&isFinite(d)&&(l+=d),l>=e)break}a=a.then(function(){return new Promise(function(p){Et.shared.add(function(){for(var A=0,h=u;A<h.length;A++){var v=h[A];t.initTexture(v)}p()},!0)})}).catch(function(){})};o.length>0;)s();return a}function fa(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)}var ka=4;function Uu(n,t,e){var r=new DataView(t);if(n.magic=r.getUint32(e,!0),e+=ka,n.version=r.getUint32(e,!0),e+=ka,n.byteLength=r.getUint32(e,!0),e+=ka,n.version!==1)throw new Error("3D Tile Version ".concat(n.version," not supported"));return e}var wr,at;(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"})(at||(at={}));var Yd=(wr={},wr[at.DOUBLE]=Float64Array,wr[at.FLOAT]=Float32Array,wr[at.UNSIGNED_SHORT]=Uint16Array,wr[at.UNSIGNED_INT]=Uint32Array,wr[at.UNSIGNED_BYTE]=Uint8Array,wr[at.BYTE]=Int8Array,wr[at.SHORT]=Int16Array,wr[at.INT]=Int32Array,wr),$d={DOUBLE:at.DOUBLE,FLOAT:at.FLOAT,UNSIGNED_SHORT:at.UNSIGNED_SHORT,UNSIGNED_INT:at.UNSIGNED_INT,UNSIGNED_BYTE:at.UNSIGNED_BYTE,BYTE:at.BYTE,SHORT:at.SHORT,INT:at.INT};function $i(n){var t=Yd[n];if(!t)throw new Error("Failed to convert GL type");return t}function Oa(n){var t=$i(n);return t.BYTES_PER_ELEMENT}function Gs(n,t,e,r){e===void 0&&(e=0);var i=$i(n);if(e%Oa(n)!==0){var a=r?t.slice(e,e+r*Oa(n)):t.slice(e);return new i(a)}else return new i(t,e,r!=null?r:(t.byteLength-e)/Oa(n))}function eh(n){var t=$d[n];if(!t)throw new Error("Failed to convert GL type");return t}var Qu=function(){function n(t,e){this.featuresLength=0,this.cachedTypedArrays={},this.json=t,this.buffer=e;var r=this.getGlobalProperty("POINTS_LENGTH",at.UNSIGNED_INT,1);r&&r.length&&(this.featuresLength=r[0])}return n.prototype.getExtension=function(t){return this.json.extensions&&this.json.extensions[t]},n.prototype.hasProperty=function(t){return!!this.json[t]},n.prototype.getGlobalProperty=function(t,e,r){var i=this.json[t];if(typeof i=="number"){var a=$i(e);return new a([i])}else if(Array.isArray(i)){var a=$i(e);return new a(i)}else if(i&&Number.isFinite(i.byteOffset))return this.getTypedArrayFromBinary(t,e,r,1,i.byteOffset);return null},n.prototype.getPropertyArray=function(t,e,r){var i=this.json[t];return i&&Number.isFinite(i.byteOffset)?("componentType"in i&&(e=eh(i.componentType)),this.getTypedArrayFromBinary(t,e,r,this.featuresLength,i.byteOffset)):this.getTypedArrayFromArray(t,e,i)},n.prototype.getProperty=function(t,e,r,i,a){var o=this.json[t];if(!o)return null;var s=this.getPropertyArray(t,e,r);if(r===1)return a[0]=s[i],a;for(var u=0;u<r;++u)a[u]=s[r*i+u];return a},n.prototype.getTypedArrayFromBinary=function(t,e,r,i,a){var o=this.cachedTypedArrays,s=o[t];return s||(s=Gs(e,this.buffer.buffer,this.buffer.byteOffset+a,i*r),o[t]=s),s},n.prototype.getTypedArrayFromArray=function(t,e,r){var i=this.cachedTypedArrays,a=i[t];return a||(a=Gs(e,r),i[t]=a),a},n}(),Bn=4,Ks="b3dm tile in legacy format.";function qu(n,t,e){var r=new TextDecoder("utf8"),i=new Uint8Array(n,t,e),a=r.decode(i);return a}function Hu(n,t,e){return e=th(n,t,e),e=rh(n,t,e),e=nh(n,t,e),e}function th(n,t,e){var r=new DataView(t),i=0;n.header=n.header||{};var a=r.getUint32(e,!0);e+=Bn;var o=r.getUint32(e,!0);e+=Bn;var s=r.getUint32(e,!0);e+=Bn;var u=r.getUint32(e,!0);return e+=Bn,s>=570425344?(e-=Bn*2,i=a,s=o,u=0,a=0,o=0,console.warn(Ks)):u>=570425344&&(e-=Bn,i=s,s=a,u=o,a=0,o=0,console.warn(Ks)),n.header.featureTableJsonByteLength=a,n.header.featureTableBinaryByteLength=o,n.header.batchTableJsonByteLength=s,n.header.batchTableBinaryByteLength=u,n.header.batchLength=i,e}function rh(n,t,e){var r=n.header||{},i=r.featureTableJsonByteLength,a=r.featureTableBinaryByteLength,o=r.batchLength;if(n.featureTableJson={BATCH_LENGTH:o||0},i&&i>0){var s=qu(t,e,i);n.featureTableJson=JSON.parse(s)}e+=i||0,n.featureTableBinary=new Uint8Array(t,e,a),e+=a||0,n.rtcCenter=[0,0,0];var u=new Qu(n.featureTableJson,n.featureTableBinary);if(Array.isArray(u.json.RTC_CENTER)){var l=u.json.RTC_CENTER;n.rtcCenter[0]=l[0],n.rtcCenter[1]=l[1],n.rtcCenter[2]=l[2]}else{var l=u.getGlobalProperty("RTC_CENTER",at.FLOAT,3);l&&(n.rtcCenter[0]=l[0],n.rtcCenter[1]=l[1],n.rtcCenter[2]=l[2])}return e}function nh(n,t,e){var r=n.header||{},i=r.batchTableJsonByteLength,a=r.batchTableBinaryByteLength;if(i&&i>0){var o=qu(t,e,i);n.batchTableJson=JSON.parse(o),e+=i,a&&a>0&&(n.batchTableBinary=new Uint8Array(t,e,a),n.batchTableBinary=new Uint8Array(n.batchTableBinary),e+=a)}return e}function ih(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 ah(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=ih(t,e,r),n.byteLength}function ea(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 Qe={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},Yn={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},ta={9728:f.NearestFilter,9729:f.LinearFilter,9984:f.NearestMipmapNearestFilter,9985:f.LinearMipmapNearestFilter,9986:f.NearestMipmapLinearFilter,9987:f.LinearMipmapLinearFilter},ra={33071:f.ClampToEdgeWrapping,33648:f.MirroredRepeatWrapping,10497:f.RepeatWrapping},_s={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Kt={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Yr={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},oh={CUBICSPLINE:void 0,LINEAR:f.InterpolateLinear,STEP:f.InterpolateDiscrete},Fr={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function Bt(n){var t=[];for(var e in n)t.push(n[e]);return t}function sh(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 uh=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,a=e.length;i<a;i++)for(var o=e[i].joints,s=0,u=o.length;s<u;s++)t[o[s]].isBone=!0;for(var l=0,c=t.length;l<c;l++){var d=t[l];d.mesh!==void 0&&d.skin!==void 0&&(r[d.mesh].isSkinnedMesh=!0)}},n.prototype.parse=function(){var t=this,e=this.json,r=this.extensions;this.markDefs();for(var i=0,a=Bt(r);i<a.length;i++){var o=a[i];o.markDefs(this)}return Promise.all(Bt(r).map(function(s){return s.prepare(t)})).then(function(){var s,u,l;return Promise.all([Promise.all(((s=e.scenes)!==null&&s!==void 0?s:[]).map(function(c,d){return t.loadScene(d)})),Promise.all(((u=e.animations)!==null&&u!==void 0?u:[]).map(function(c,d){return t.loadAnimation(d)})),Promise.all(((l=e.cameras)!==null&&l!==void 0?l:[]).map(function(c,d){return t.loadCamera(d)}))])}).then(function(s){var u=s[0],l=s[1],c=s[2],d={json:e,scene:u[e.scene||0],scenes:u,animations:l,cameras:c,textures:[],dispose:U};return d}).then(function(s){return Promise.all(Bt(r).map(function(u){return u.emitResult(s,t)})).then(function(){return s})}).then(function(s){var u=Array.from(t.textureSet),l=sh(t.disposeSet);return Object.assign(s,{textures:u,dispose:l}),t.textureSet.clear(),t.disposeSet.clear(),t.dispose(),s})},n.prototype.loadCamera=function(t){var e="camera:"+t,r=this.cache.get(e);if(r)return r;for(var i=null,a=0,o=Bt(this.extensions);a<o.length;a++){var s=o[a];if(i=s.loadCamera(t,this),i)break}if(!i){var u=void 0,l=this.json.cameras[t],c=l[l.type];c?l.type==="perspective"?u=new f.PerspectiveCamera(f.MathUtils.radToDeg(c.yfov),c.aspectRatio||1,c.znear||1,c.zfar||2e6):l.type==="orthographic"?u=new f.OrthographicCamera(-c.xmag,c.xmag,c.ymag,-c.ymag,c.znear,c.zfar):(console.warn("glTF: Invalid camera type ".concat(l.type,".")),u=new f.Camera):(console.warn("glTF: Missing camera parameters."),u=new f.Camera),l.name&&(u.name=this.createUniqueName(l.name)),i=Promise.resolve(u)}return this.cache.set(e,i),i},n.prototype.loadSkin=function(t){var e="animation:"+t,r=this.cache.get(e);if(r)return r;var i,a=this.json.skins[t],o={joints:a.joints};return a.inverseBindMatrices===void 0?i=Promise.resolve(o):i=this.loadAccessor(a.inverseBindMatrices).then(function(s){return s&&(o.inverseBindMatrices=s),o}),this.cache.set(e,i),i},n.prototype.loadAnimation=function(t){var e="animation:"+t,r=this.cache.get(e);if(r)return r;for(var i=null,a=0,o=Bt(this.extensions);a<o.length;a++){var s=o[a];if(i=s.loadAnimation(t,this),i)break}if(!i){for(var u=this.json,l=u.animations[t],c=[],d=[],p=[],A=[],h=[],v=0,g=l.channels.length;v<g;v++){var m=l.channels[v],y=l.samplers[m.sampler],b=m.target,x=b.node!==void 0?b.node:b.id,w=l.parameters!==void 0?l.parameters[y.input]:y.input,E=l.parameters!==void 0?l.parameters[y.output]:y.output;c.push(this.loadNode(x)),d.push(this.loadAccessor(w)),p.push(this.loadAccessor(E)),A.push(y),h.push(b)}i=Promise.all([Promise.all(c),Promise.all(d),Promise.all(p),Promise.all(A),Promise.all(h)]).then(function(S){for(var C=S[0],R=S[1],B=S[2],M=S[3],I=S[4],L=[],T=function(z,Q){var q=C[z],G=R[z],K=B[z],j=M[z],J=I[z];if(q===void 0)return"continue";q.updateMatrix(),q.matrixAutoUpdate=!0;var W=void 0;switch(Yr[J.path]){case Yr.weights:W=f.NumberKeyframeTrack;break;case Yr.rotation:W=f.QuaternionKeyframeTrack;break;case Yr.position:case Yr.scale:default:W=f.VectorKeyframeTrack;break}var $=q.name?q.name:q.uuid,Y=j.interpolation!==void 0?oh[j.interpolation]:f.InterpolateLinear,Z=[];Yr[J.path]===Yr.weights?q.traverse(function(xe){xe.morphTargetInfluences&&Z.push(xe.name?xe.name:xe.uuid)}):Z.push($);var oe=K.array;if(K.normalized){for(var ne=Da(oe.constructor),de=new Float32Array(oe.length),se=0,ye=oe.length;se<ye;se++)de[se]=oe[se]*ne;oe=de}for(var se=0,ye=Z.length;se<ye;se++){var ie=new W(Z[se]+"."+Yr[J.path],G.array,oe,Y);L.push(ie)}},F=0,D=C.length;F<D;F++)T(F);var V=l.name?l.name:"animation_"+t;return new f.AnimationClip(V,void 0,L)})}return this.cache.set(e,i),i},n.prototype.loadBuffer=function(t){var e=this.json.buffers[t];if(e.type&&e.type!=="arraybuffer")throw new Error("glTF: "+e.type+" buffer type is not supported.");var r="buffer:"+t,i=this.cache.get(r);if(i)return i;for(var a=null,o=0,s=Bt(this.extensions);o<s.length;o++){var u=s[o];if(a=u.loadBuffer(t,this),a)break}if(!a){var l=this.json.buffers[t];a=this.options.fetcher.ajax(this.resolveResouce(l.uri),{responseType:"arraybuffer"}).then(function(c){return c.body})}return this.cache.set(r,a),a},n.prototype.loadBufferView=function(t){var e="bufferView:"+t,r=this.cache.get(e);if(r)return r;for(var i=null,a=0,o=Bt(this.extensions);a<o.length;a++){var s=o[a];if(i=s.loadBufferView(t,this),i)break}if(!i){var u=this.json.bufferViews[t];i=this.loadBuffer(u.buffer).then(function(l){var c=u.byteLength||0,d=u.byteOffset||0;return l.slice(d,d+c)})}return this.cache.set(e,i),i},n.prototype.loadAccessor=function(t){var e=this,r="accessor:"+t,i=this.cache.get(r);if(i)return i;var a=null;if(!a){var o=this.json.accessors[t];if(o.bufferView===void 0&&o.sparse===void 0)a=Promise.resolve(null);else{var s=[];o.bufferView!==void 0?s.push(this.loadBufferView(o.bufferView)):s.push(Promise.resolve(null)),o.sparse!==void 0&&(s.push(this.loadBufferView(o.sparse.indices.bufferView)),s.push(this.loadBufferView(o.sparse.values.bufferView))),a=Promise.all(s).then(function(u){var l=u[0],c=_s[o.type],d=Yn[o.componentType],p=d.BYTES_PER_ELEMENT,A=p*c,h=o.byteOffset||0,v=o.bufferView!==void 0?e.json.bufferViews[o.bufferView].byteStride:void 0,g=o.normalized===!0,m,y;if(v&&v!==A){var b=Math.floor(h/v),x="InterleavedBuffer:"+o.bufferView+":"+o.componentType+":"+b+":"+o.count,w=e.cache.get(x);w||(m=new d(l,b*v,o.count*v/p),w=new f.InterleavedBuffer(m,v/p),e.cache.set(x,w)),y=new f.InterleavedBufferAttribute(w,c,h%v/p,g)}else l===null?m=new d(o.count*c):m=new d(l,h,o.count*c),y=new f.BufferAttribute(m,c,g);if(o.sparse!==void 0){var E=_s.SCALAR,S=Yn[o.sparse.indices.componentType],C=o.sparse.indices.byteOffset||0,R=o.sparse.values.byteOffset||0,B=new S(u[1],C,o.sparse.count*E),M=new d(u[2],R,o.sparse.count*c);l!==null&&(y=new f.BufferAttribute(y.array.slice(),y.itemSize,y.normalized));for(var I=0,L=B.length;I<L;I++){var T=B[I];if(y.setX(T,M[I*c]),c>=2&&y.setY(T,M[I*c+1]),c>=3&&y.setZ(T,M[I*c+2]),c>=4&&y.setW(T,M[I*c+3]),c>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return y})}}return this.cache.set(r,a),a},n.prototype.createPrimitiveKey=function(t){for(var e=0,r=Bt(this.extensions);e<r.length;e++){var i=r[e],a=i.createPrimitiveKey(t,this);if(a)return a}for(var o="",s=Object.keys(t.attributes).sort(),u=0,l=s.length;u<l;u++)o+=s[u]+":"+t.attributes[s[u]]+";";return t.indices+":"+o+":"+t.mode},n.prototype.loadGeometry=function(t){for(var e=this,r=null,i=0,a=Bt(this.extensions);i<a.length;i++){var o=a[i];if(r=o.loadGeometry(t,this),r)break}return r||(r=this.addGeometryPrimitiveAttributes(new f.BufferGeometry,t)),r=r.then(function(s){return e.disposeSet.add(s),s}),r},n.prototype.loadImage=function(t){for(var e=this,r=null,i=0,a=Bt(this.extensions);i<a.length;i++){var o=a[i];if(r=o.loadImage(t,this),r)break}if(!r){var s=this.json.images[t];if(s.bufferView!==void 0){var u=this.json.bufferViews[s.bufferView];r=this.loadBuffer(u.buffer).then(function(c){var d=u.byteOffset||0,p=u.byteLength||0,A=new Uint8Array(c,d,p),h=new Blob([A],{type:s.mimeType});return go(h)})}else if(s.uri){var l=this.resolveResouce(s.uri);r=this.options.fetcher.loadImage(l,{},void 0,void 0,void 0,hi()).then(function(c){return c.body})}else throw new Error("glTF: Invalid image defs.")}return r=r.then(function(c){return e.disposeSet.add(c),c}),r},n.prototype.loadMaterialAsMeshStandardMaterial=function(t){var e=this,r=[],i=new f.MeshStandardMaterial;if(i.color=new f.Color(1,1,1),i.opacity=1,Object.keys(t.attributes).filter(function(c){return Kt[c]==="color"}).length>0&&(i.vertexColors=!0),Object.keys(t.attributes).filter(function(c){return Kt[c]==="normal"}).length===0&&(i.flatShading=!0),Object.keys(t.attributes).filter(function(c){return Kt[c]==="tangent"}).length===0&&(i.normalScale&&(i.normalScale.y*=-1),i.clearcoatNormalScale&&(i.clearcoatNormalScale.y*=-1)),t.material!==void 0){var a=this.json.materials[t.material];a.name&&(i.name=a.name);var o=a.pbrMetallicRoughness||{};if(Array.isArray(o.baseColorFactor)){var s=o.baseColorFactor;i.color.fromArray(s),i.opacity=s[3]}o.baseColorTexture!==void 0&&r.push(this.createMaterialTexture(o.baseColorTexture).then(function(c){c.encoding=f.sRGBEncoding,i.map=c,e.disposeSet.add(c)})),i.metalness=o.metallicFactor!==void 0?o.metallicFactor:1,i.roughness=o.roughnessFactor!==void 0?o.roughnessFactor:1,o.metallicRoughnessTexture!==void 0&&r.push(this.createMaterialTexture(o.metallicRoughnessTexture).then(function(c){c.encoding=f.sRGBEncoding,i.metalnessMap=c,i.roughnessMap=c,e.disposeSet.add(c)})),a.doubleSided===!0&&(i.side=f.DoubleSide);var u=a.alphaMode||Fr.OPAQUE;if(u===Fr.BLEND?(i.transparent=!0,i.depthWrite=!1):(i.transparent=!1,u===Fr.MASK&&(i.alphaTest=a.alphaCutoff!==void 0?a.alphaCutoff:.5)),a.normalTexture!==void 0&&(r.push(this.createMaterialTexture(a.normalTexture).then(function(c){i.normalMap=c,e.disposeSet.add(c)})),i.normalScale=new f.Vector2(1,1),a.normalTexture.scale!==void 0)){var l=a.normalTexture.scale;i.normalScale.set(l,l)}a.occlusionTexture!==void 0&&(r.push(this.createMaterialTexture(a.occlusionTexture).then(function(c){i.aoMap=c,e.disposeSet.add(c)})),a.occlusionTexture.strength!==void 0&&(i.aoMapIntensity=a.occlusionTexture.strength)),a.emissiveFactor!==void 0&&(i.emissive=new f.Color().fromArray(a.emissiveFactor)),a.emissiveTexture!==void 0&&r.push(this.createMaterialTexture(a.emissiveTexture).then(function(c){i.emissiveMap=c,e.disposeSet.add(c)}))}return this.disposeSet.add(i),Promise.all(r).then(function(){return i})},n.prototype.loadMaterialAsLineBasicMaterial=function(t){var e=[],r=new f.LineBasicMaterial;if(r.color=new f.Color(1,1,1),r.opacity=1,Object.keys(t.attributes).filter(function(u){return Kt[u]==="color"}).length>0&&(r.vertexColors=!0),Object.keys(t.attributes).filter(function(u){return Kt[u]==="tangent"}).length===0&&(r.normalScale&&(r.normalScale.y*=-1),r.clearcoatNormalScale&&(r.clearcoatNormalScale.y*=-1)),t.material!==void 0){var i=this.json.materials[t.material];i.name&&(r.name=i.name);var a=i.pbrMetallicRoughness||{};if(Array.isArray(a.baseColorFactor)){var o=a.baseColorFactor;r.color.fromArray(o),r.opacity=o[3]}i.doubleSided===!0&&(r.side=f.DoubleSide);var s=i.alphaMode||Fr.OPAQUE;s===Fr.BLEND?(r.transparent=!0,r.depthWrite=!1):(r.transparent=!1,s===Fr.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 f.PointsMaterial;if(i.color=new f.Color(1,1,1),i.opacity=1,i.sizeAttenuation=!1,Object.keys(t.attributes).filter(function(l){return Kt[l]==="color"}).length>0&&(i.vertexColors=!0),Object.keys(t.attributes).filter(function(l){return Kt[l]==="tangent"}).length===0&&(i.normalScale&&(i.normalScale.y*=-1),i.clearcoatNormalScale&&(i.clearcoatNormalScale.y*=-1)),t.material!==void 0){var a=this.json.materials[t.material];a.name&&(i.name=a.name);var o=a.pbrMetallicRoughness||{};if(Array.isArray(o.baseColorFactor)){var s=o.baseColorFactor;i.color.fromArray(s),i.opacity=s[3]}o.baseColorTexture!==void 0&&r.push(this.createMaterialTexture(o.baseColorTexture).then(function(l){l.encoding=f.sRGBEncoding,i.map=l,e.disposeSet.add(l)})),a.doubleSided===!0&&(i.side=f.DoubleSide);var u=a.alphaMode||Fr.OPAQUE;u===Fr.BLEND?(i.transparent=!0,i.depthWrite=!1):(i.transparent=!1,u===Fr.MASK&&(i.alphaTest=a.alphaCutoff!==void 0?a.alphaCutoff:.5))}return this.disposeSet.add(i),Promise.all(r).then(function(){return i})},n.prototype.loadMaterial=function(t){var e,r=(e=t.mode)!==null&&e!==void 0?e:Qe.TRIANGLES,i="material:"+this.createPrimitiveKey(t),a=this.cache.get(i);if(a)return a;for(var o=null,s=0,u=Bt(this.extensions);s<u.length;s++){var l=u[s];if(o=l.loadMaterial(t,this),o)break}if(r===Qe.TRIANGLES||r===Qe.TRIANGLE_STRIP||r===Qe.TRIANGLE_FAN)o=this.loadMaterialAsMeshStandardMaterial(t);else if(r===Qe.LINES||r===Qe.LINE_STRIP||r===Qe.LINE_LOOP)o=this.loadMaterialAsLineBasicMaterial(t);else if(r===Qe.POINTS)o=this.loadMaterialAsPointsMaterial(t);else throw new Error("glTF: Primitive mode unsupported: "+r);return this.cache.set(i,o),o},n.prototype.loadTexture=function(t){var e=this,r="texture:"+t,i=this.cache.get(r);if(i)return i;for(var a=null,o=0,s=Bt(this.extensions);o<s.length;o++){var u=s[o];if(a=u.loadTexture(t,this),a)break}if(!a){var l=this.json.textures[t];a=this.loadImage(l.source).then(function(c){var d=new f.Texture(c);d.needsUpdate=!0,d.flipY=!1,l.name&&(d.name=l.name);var p=e.json.samplers||{},A=p[l.sampler]||{};return d.magFilter=ta[A.magFilter]||f.LinearFilter,d.minFilter=ta[A.minFilter]||f.LinearMipmapLinearFilter,d.wrapS=ra[A.wrapS]||f.RepeatWrapping,d.wrapT=ra[A.wrapT]||f.RepeatWrapping,d.onUpdate=function(){c.close()},d})}return a=a.then(function(c){return e.disposeSet.add(c),c}),this.cache.set(r,a),a},n.prototype.loadMesh=function(t){for(var e=this,r=null,i=0,a=Bt(this.extensions);i<a.length;i++){var o=a[i];if(r=o.loadMesh(t,this),r)break}if(!r){var s=this.json.meshes[t],u=s.primitives,l=Promise.all(u.map(function(d){return e.loadGeometry(d)})),c=Promise.all(u.map(function(d){return e.loadMaterial(d)}));r=Promise.all([l,c]).then(function(d){for(var p=d[0],A=d[1],h=[],v=0;v<u.length;v++){var g=u[v],m=p[v],y=A[v],b=g.mode||Qe.TRIANGLES,x=void 0;if(b===Qe.TRIANGLES||b===Qe.TRIANGLE_STRIP||b===Qe.TRIANGLE_FAN)if(b===Qe.TRIANGLE_STRIP?m=e.toGeometryTrianglesDrawMode(m,f.TriangleStripDrawMode):b===Qe.TRIANGLE_FAN&&(m=e.toGeometryTrianglesDrawMode(m,f.TriangleFanDrawMode)),e.disposeSet.add(m),s.isSkinnedMesh){var w=new f.SkinnedMesh(m,y);m.attributes.skinWeight.normalized||w.normalizeSkinWeights(),x=w}else x=new f.Mesh(m,y);else if(b===Qe.POINTS)x=new f.Points(m,y);else if(b===Qe.LINES)x=new f.LineSegments(m,y);else if(b===Qe.LINE_STRIP)x=new f.Line(m,y);else if(b===Qe.LINE_LOOP)x=new f.LineLoop(m,y);else throw new Error("glTF: Primitive mode unsupported: "+b);if(Object.keys(m.morphAttributes).length>0){if(s.weights!==void 0)for(var E=0,S=s.weights.length;E<S;E++)x.morphTargetInfluences[E]=s.weights[E];if(s.extras&&Array.isArray(s.extras.targetNames)){var C=s.extras.targetNames;if(x.morphTargetInfluences.length===C.length){x.morphTargetDictionary={};for(var E=0,S=C.length;E<S;E++)x.morphTargetDictionary[C[E]]=E}else console.warn("glTF: Invalid extras.targetNames length. Ignoring names.")}}x.name=e.createUniqueName(s.name||"mesh_"+t),h.push(x)}if(h.length===1)return h[0];for(var R=new f.Group,B=0,M=h;B<M.length;B++){var x=M[B];R.add(x)}return R})}return r},n.prototype.loadNodeAttachments=function(t){for(var e=[],r=0,i=Bt(this.extensions);r<i.length;r++){var a=i[r],o=a.loadNodeAttachments(t,this);o&&e.push(o)}return e},n.prototype.loadNode=function(t){var e="node:"+t,r=this.cache.get(e);if(r)return r;var i=this.json,a=i.nodes[t],o=a.name?this.createUniqueName(a.name):"",s=[];a.mesh!==void 0&&s.push(this.loadMesh(a.mesh).then(function(p){if(a.weights!==void 0){var A=a.weights;p.traverse(function(h){if(h instanceof f.Mesh||h instanceof f.Line||h instanceof f.Points)for(var v=0,g=A.length;v<g;v++)h.morphTargetInfluences[v]=A[v]})}return p})),a.camera!==void 0&&s.push(this.loadCamera(a.camera));for(var u=this.loadNodeAttachments(t),l=0,c=u;l<c.length;l++){var d=c[l];s.push(d)}return Promise.all(s).then(function(p){var A;if(a.isBone===!0?A=new f.Bone:p.length>1?A=new f.Group:p.length===1?A=p[0]:A=new f.Object3D,A!==p[0])for(var h=0,v=p.length;h<v;h++)A.add(p[h]);if(a.name&&(A.name=o),a.matrix!==void 0){var g=new f.Matrix4;g.fromArray(a.matrix),A.applyMatrix4(g)}else a.translation!==void 0&&A.position.fromArray(a.translation),a.rotation!==void 0&&A.quaternion.fromArray(a.rotation),a.scale!==void 0&&A.scale.fromArray(a.scale);return A})},n.prototype.loadScene=function(t){var e=this.json,r=e.scenes[t],i=new f.Group;r.name&&(i.name=this.createUniqueName(r.name));for(var a=r.nodes||[],o=[],s=0,u=a.length;s<u;s++)o.push(this.buildNodeHierarchy(a[s],i));return Promise.all(o).then(function(){return i})},n.prototype.createMaterialTexture=function(t){var e=this;return this.loadTexture(t.index).then(function(r){for(var i=0,a=Bt(e.extensions);i<a.length;i++){var o=a[i],s=o.extendTexture(r,t,e);s&&(r=s,e.disposeSet.add(r))}return e.textureSet.add(r),r})},n.prototype.addGeometryPrimitiveAttributes=function(t,e){var r=this,i=e.attributes,a=[],o=function(w){var E=Kt[w]||w.toLowerCase();if(E in t.attributes)return"continue";a.push(s.loadAccessor(i[w]).then(function(S){S&&t.setAttribute(E,S)}))},s=this;for(var u in i)o(u);e.indices!==void 0&&!t.index&&a.push(this.loadAccessor(e.indices).then(function(w){w&&t.setIndex(w)}));var l=new f.Box3;if(i.POSITION!==void 0){var c=this.json.accessors[i.POSITION],d=c.min,p=c.max;if(d!==void 0&&p!==void 0){if(l.set(new f.Vector3(d[0],d[1],d[2]),new f.Vector3(p[0],p[1],p[2])),c.normalized){var A=Da(Yn[c.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 v=new f.Vector3,g=new f.Vector3,m=0,y=h.length;m<y;m++){var b=h[m];if(b.POSITION!==void 0){var c=this.json.accessors[b.POSITION],d=c.min,p=c.max;if(d!==void 0&&p!==void 0){if(g.setX(Math.max(Math.abs(d[0]),Math.abs(p[0]))),g.setY(Math.max(Math.abs(d[1]),Math.abs(p[1]))),g.setZ(Math.max(Math.abs(d[2]),Math.abs(p[2]))),c.normalized){var A=Da(Yn[c.componentType]);g.multiplyScalar(A)}v.max(g)}else console.warn("glTF: Missing min/max properties for accessor POSITION.")}}l.expandByVector(v)}t.boundingBox=l;var x=new f.Sphere;return l.getCenter(x.center),x.radius=l.min.distanceTo(l.max)/2,t.boundingSphere=x,Promise.all(a).then(function(){if(t.attributes.uv&&!t.attributes.uv2&&r.options.copyUV2&&t.setAttribute("uv2",t.attributes.uv),e.targets){for(var w=!1,E=!1,S=0,C=e.targets.length;S<C;S++){var R=e.targets[S];if(R.POSITION!==void 0&&(w=!0),R.NORMAL!==void 0&&(E=!0),w&&E)break}if(!w&&!E)return t;var B=[];t.morphTargetsRelative=!0;for(var M=function(I,L){var T=e.targets[I];w?B.push(r.loadAccessor(T.POSITION).then(function(F){F&&(t.morphAttributes.position[I]=F)})):t.morphAttributes.position[I]=t.attributes.position,E?B.push(r.loadAccessor(T.NORMAL).then(function(F){F&&(t.morphAttributes.normal[I]=F)})):t.morphAttributes.normal[I]=t.attributes.normal},S=0,C=e.targets.length;S<C;S++)M(S,C);return Promise.all(B).then(function(){return t})}else return t})},n.prototype.buildNodeHierarchy=function(t,e){var r=this,i=this.json.nodes[t];return this.loadNode(t).then(function(a){if(i.skin===void 0)return a;var o;return r.loadSkin(i.skin).then(function(s){o=s;for(var u=[],l=0,c=o.joints.length;l<c;l++)u.push(r.loadNode(o.joints[l]));return Promise.all(u)}).then(function(s){return a.traverse(function(u){if(u instanceof f.SkinnedMesh){for(var l=[],c=[],d=0,p=s.length;d<p;d++){var A=s[d];if(A instanceof f.Bone){l.push(A);var h=new f.Matrix4;o.inverseBindMatrices!==void 0&&h.fromArray(o.inverseBindMatrices.array,d*16),c.push(h)}else console.warn('glTF: Joint "%s" could not be found.',o.joints[d])}u.bind(new f.Skeleton(l,c),u.matrixWorld)}}),a})}).then(function(a){e.add(a);var o=[];if(i.children)for(var s=i.children,u=0,l=s.length;u<l;u++){var c=s[u];o.push(r.buildNodeHierarchy(c,a))}return Promise.all(o).then(function(){return a})})},n.prototype.createUniqueName=function(t){for(var e=f.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 st(this.options.resourcePath,fa(t,this.options.search))},n.prototype.toGeometryTrianglesDrawMode=function(t,e){var r=t.getIndex();if(r===null){var i=[],a=t.getAttribute("position");if(a!==void 0){for(var o=0;o<a.count;o++)i.push(o);t.setIndex(i),r=t.getIndex()}}if(r===null)return console.error("glTF: Undefined position attribute. Processing not possible."),t;var s=r.count-2,u=[];if(e===f.TriangleFanDrawMode)for(var o=1;o<=s;o++)u.push(r.getX(0)),u.push(r.getX(o)),u.push(r.getX(o+1));else for(var o=0;o<s;o++)o%2===0?(u.push(r.getX(o)),u.push(r.getX(o+1)),u.push(r.getX(o+2))):(u.push(r.getX(o+2)),u.push(r.getX(o+1)),u.push(r.getX(o)));u.length/3!==s&&console.error("glTF: Unable to generate correct amount of triangles.");var l=t.clone();return l.setIndex(u),this.disposeSet.add(l),l},n}();function Da(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 Tr=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}(),lh=function(n){ue(t,n);function t(){var e=n.call(this)||this;return e.header={magic:"",version:0,length:0},e.content="",e.body=null,e}return t.getMagic=function(e){return ea(new Uint8Array(e.slice(0,4)))},t.prototype.loadGlbBinary=function(e){var r=new DataView(e,0,t.HEADER_LENGTH);if(this.header={magic:t.getMagic(e),version:r.getUint32(4,!0),length:r.getUint32(8,!0)},this.header.magic!==t.HEADER_MAGIC)throw new Error("glTF:KHR_binary_glTF: Unsupported.");if(this.header.version<2)throw new Error("glTF:KHR_binary_glTF: Legacy binary file detected.");for(var i=new DataView(e,t.HEADER_LENGTH),a=0,o=null,s=null;a<i.byteLength;){var u=i.getUint32(a,!0);if(a+=4,u!==0){var l=i.getUint32(a,!0);if(a+=4,l===t.CHUNK_TYPES.JSON){var c=new Uint8Array(e,t.HEADER_LENGTH+a,u);o=ea(c)}else if(l===t.CHUNK_TYPES.BIN){var d=t.HEADER_LENGTH+a;s=e.slice(d,d+u)}a+=u}}if(o===null)throw new Error("glTF:KHR_binary_glTF: JSON content not found.");this.content=o,this.body=s},t.prototype.loadBuffer=function(e,r){var i=r.json.buffers[e];return i.uri===void 0&&e===0&&this.body?Promise.resolve(this.body):null},t.prototype.clear=function(){this.body=null,this.content=""},t.HEADER_MAGIC="glTF",t.HEADER_LENGTH=12,t.CHUNK_TYPES={JSON:1313821514,BIN:5130562},t}(Tr),ch="https://vr-public.realsee-cdn.cn/release/static/image/release/five/resource/draco/1.5.6/",js={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},Js={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"},fh=function(){function n(){this.decoderPath=ch,this.decoderConfig={},this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL=""}return n.prototype.setDecoderPath=function(t){this.decoderPath=t},n.prototype.setDecoderConfig=function(t){return this.decoderConfig=t,this},n.prototype.setWorkerLimit=function(t){return this.workerLimit=t,this},n.prototype.decodeDracoFile=function(t,e,r,i){var a={attributeIDs:r||js,attributeTypes:i||Js,useUniqueIDs:!!r};this.decodeGeometry(t,a).then(e)},n.prototype.decodeGeometry=function(t,e){var r=this;e===void 0&&(e={attributeIDs:js,attributeTypes:Js,useUniqueIDs:!1});for(var i in e.attributeTypes){var a=e.attributeTypes[i];a.BYTES_PER_ELEMENT!==void 0&&(e.attributeTypes[i]=a.name)}var o,s=this.workerNextTaskID++,u=t.byteLength,l=this._getWorker(s,u).then(function(c){return o=c,new Promise(function(d,p){o._callbacks[s]={resolve:d,reject:p},o.postMessage({type:"decode",id:s,taskConfig:e,buffer:t},[t])})}).then(function(c){return r._createGeometry(c.geometry)});return l.catch(function(){return!0}).then(function(){o&&s&&r._releaseTask(o,s)}),l},n.prototype._createGeometry=function(t){var e=new f.BufferGeometry;t.index&&e.setIndex(new f.BufferAttribute(t.index.array,1));for(var r=0;r<t.attributes.length;r++){var i=t.attributes[r],a=i.name,o=i.array,s=i.itemSize,u=!(o instanceof Float32Array||o instanceof Float64Array);e.setAttribute(a,new f.BufferAttribute(o,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=Nn(this.decoderPath+"draco_decoder.js",{responseType:"text"}).then(function(a){return a.body});this.decoderPending=r.then(function(a){var o=["/* draco decoder */",a,"","/* worker */",Xs].join(`
|
|
418
418
|
`);t.workerSourceURL=URL.createObjectURL(new Blob([o]))})}else{var r=Nn(this.decoderPath+"draco_wasm_wrapper.js",{responseType:"text"}).then(function(o){return o.body}),i=Nn(this.decoderPath+"draco_decoder.wasm",{responseType:"arraybuffer"}).then(function(o){return o.body});this.decoderPending=Promise.all([r,i]).then(function(o){var s=o[0],u=o[1];t.decoderConfig.wasmBinary=u;var l=["/* draco decoder */",s,"","/* worker */",Xs].join(`
|
|
419
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(o){var s=o.data;switch(s.type){case"decode":i._callbacks[s.id].resolve(s);break;case"error":i._callbacks[s.id].reject(s);break;default:console.error('DRACO: Unexpected message, "'+s.type+'"')}},r.workerPool.push(i)}else r.workerPool.sort(function(o,s){return o._taskLoad>s._taskLoad?-1:1});var a=r.workerPool[r.workerPool.length-1];return a._taskCosts[t]=e,a._taskLoad+=e,a})},n.prototype._releaseTask=function(t,e){t._taskLoad-=t._taskCosts[e],delete t._callbacks[e],delete t._taskCosts[e]},n.prototype.dispose=function(){for(var t=0;t<this.workerPool.length;++t)this.workerPool[t].terminate();return this.workerPool.length=0,this},n}(),na=new fh,Xs=`
|
|
420
420
|
let decoderConfig;
|
|
@@ -611,7 +611,7 @@ void main() {
|
|
|
611
611
|
}
|
|
612
612
|
|
|
613
613
|
}
|
|
614
|
-
`,Va="KHR_draco_mesh_compression",dh=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadGeometry=function(e,r){return e.extensions&&e.extensions[Va]?this.decodePrimitive(e,r).then(function(i){return r.addGeometryPrimitiveAttributes(i,e)}):null},t.prototype.decodePrimitive=function(e,r){var i=r.json,a=e.extensions[Va].bufferView,o=e.extensions[Va].attributes,s={},u={},l={};for(var c in o){var d=
|
|
614
|
+
`,Va="KHR_draco_mesh_compression",dh=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadGeometry=function(e,r){return e.extensions&&e.extensions[Va]?this.decodePrimitive(e,r).then(function(i){return r.addGeometryPrimitiveAttributes(i,e)}):null},t.prototype.decodePrimitive=function(e,r){var i=r.json,a=e.extensions[Va].bufferView,o=e.extensions[Va].attributes,s={},u={},l={};for(var c in o){var d=Kt[c]||c.toLowerCase();s[d]=o[c]}for(var c in e.attributes){var d=Kt[c]||c.toLowerCase();if(o[c]!==void 0){var p=i.accessors[e.attributes[c]],A=Yn[p.componentType];l[d]=A,u[d]=p.normalized===!0}}return r.loadBufferView(a).then(function(h){return new Promise(function(v){na.decodeDracoFile(h,function(g){for(var m in g.attributes){var y=g.attributes[m],b=u[m];b!==void 0&&(y.normalized=b)}v(g)},s,l)})})},t}(Tr),hh="https://vr-public.realsee-cdn.cn/release/static/image/release/five/resource/basis/1.16/",ph=2,vh=1,mh=function(){function n(t){this.pool=t,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0,this.workerCreator=null}return n.prototype._initWorker=function(t){if(this.workerCreator&&!this.workers[t]){var e=this.workerCreator();e.addEventListener("message",this._onMessage.bind(this,t)),this.workers[t]=e}},n.prototype._getIdleWorker=function(){for(var t=0;t<this.pool;t++)if(!(this.workerStatus&1<<t))return t;return-1},n.prototype._onMessage=function(t,e){var r=this.workersResolve[t];if(r&&r(e),this.queue.length){var i=this.queue.shift(),a=i.resolve,o=i.msg,s=i.transfer;this.workersResolve[t]=a,this.workers[t].postMessage(o,s)}else this.workerStatus^=1<<t},n.prototype.setWorkerCreator=function(t){this.workerCreator=t},n.prototype.setWorkerLimit=function(t){this.pool=t},n.prototype.postMessage=function(t,e){var r=this;return new Promise(function(i){var a=r._getIdleWorker();a!==-1?(r._initWorker(a),r.workerStatus|=1<<a,r.workersResolve[a]=i,r.workers[a].postMessage(t,e)):r.queue.push({resolve:i,msg:t,transfer:e})})},n.prototype.dispose=function(){this.workers.forEach(function(t){return t.terminate()}),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0},n}(),Ah=function(){function n(){this.transcoderPath=hh,this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new mh(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=Nn(this.transcoderPath+"basis_transcoder.js",{responseType:"text"}).then(function(i){return i.body}),r=Nn(this.transcoderPath+"basis_transcoder.wasm",{responseType:"arraybuffer"}).then(function(i){return i.body});this.transcoderPending=Promise.all([e,r]).then(function(i){var a=i[0],o=i[1],s=["/* constants */","let _EngineFormat = "+JSON.stringify(bh),"let _TranscoderFormat = "+JSON.stringify(yh),"let _BasisFormat = "+JSON.stringify(gh),"/* basis_transcoder.js */",a,"/* worker */",xh].join(`
|
|
615
615
|
`);t.workerSourceURL=URL.createObjectURL(new Blob([s])),t.transcoderBinary=o,t.workerPool.setWorkerCreator(function(){var u=new Worker(t.workerSourceURL),l=t.transcoderBinary.slice(0);return u.postMessage({type:"init",config:t.workerConfig,transcoderBinary:l},[l]),u})})}return this.transcoderPending},n.prototype.parse=function(t){return this._createTexture([t])},n.prototype._createTextureFrom=function(t){var e=t.mipmaps,r=t.width,i=t.height,a=t.format,o=t.type,s=t.error,u=t.dfdTransferFn,l=t.dfdFlags;if(o==="error")return Promise.reject(s);var c=new f.CompressedTexture(e,r,i,a,f.UnsignedByteType);return c.minFilter=e.length===1?f.LinearFilter:f.LinearMipmapLinearFilter,c.magFilter=f.LinearFilter,c.generateMipmaps=!1,c.needsUpdate=!0,c.encoding=u===ph?f.sRGBEncoding:f.LinearEncoding,c.premultiplyAlpha=!!(l&vh),Promise.resolve(c)},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}(),si=new Ah,gh={ETC1S:0,UASTC_4x4:1},yh={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},bh={RGBAFormat:f.RGBAFormat,RGBA_ASTC_4x4_Format:f.RGBA_ASTC_4x4_Format,RGBA_BPTC_Format:f.RGBA_BPTC_Format,RGBA_ETC2_EAC_Format:f.RGBA_ETC2_EAC_Format,RGBA_PVRTC_4BPPV1_Format:f.RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT5_Format:f.RGBA_S3TC_DXT5_Format,RGB_ETC1_Format:f.RGB_ETC1_Format,RGB_ETC2_Format:f.RGB_ETC2_Format,RGB_PVRTC_4BPPV1_Format:f.RGB_PVRTC_4BPPV1_Format,RGB_S3TC_DXT1_Format:f.RGB_S3TC_DXT1_Format},xh=`
|
|
616
616
|
|
|
617
617
|
let config;
|
|
@@ -880,7 +880,7 @@ void main() {
|
|
|
880
880
|
return ( value & ( value - 1 ) ) === 0 && value !== 0;
|
|
881
881
|
|
|
882
882
|
}
|
|
883
|
-
`,Ws="KHR_texture_basisu",wh=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadTexture=function(e,r){var i=r.json.textures[e];if(!i.extensions||!i.extensions[Ws])return null;var a=i.extensions[Ws],o=r.json.images[a.source],s=null;if(o.bufferView!==void 0)s=r.loadBufferView(o.bufferView).then(function(u){return si.parse(u)});else if(o.uri)s=r.options.fetcher.ajax(r.resolveResouce(o.uri),{responseType:"arraybuffer"}).then(function(u){return si.parse(u.body)});else throw new Error("glTF: Invalid image defs.");return s},t}(Tr),Zs="KHR_texture_transform",Eh=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.extendTexture=function(e,r,i){var a=r.extensions!==void 0?r.extensions[Zs]:void 0;return a?(a.texCoord!==void 0&&console.warn('glTF: Custom UV sets in "'+Zs+'" extension not yet supported.'),a.offset===void 0&&a.rotation===void 0&&a.scale===void 0||(e=e.clone(),e.needsUpdate=!0,a.offset!==void 0&&e.offset.fromArray(a.offset),a.rotation!==void 0&&(e.rotation=a.rotation),a.scale!==void 0&&e.repeat.fromArray(a.scale)),e):null},t}(Tr),Sh=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(Tr),Mh=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(Tr),Na=function(){var n="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q;iekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq:78Yqdbk:qzezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9UhlaicefhodnadTmbalc;WFbGglcjdalcjd6EhDcbhqinaqae9pmeaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxdndndndnalc9WGgmTmbcbhPcehsawcjdfhzaohHinaraH9Rax6midnaraHaxfgo9RcK6mbczhlinalgic9Wfglawcj;cbffhOdndndndndnaHalco4fRbbalci4coG4ciGPlbedibkaO9cb83ibaOcwf9cb83ibxikaOaoRblaoRbbgAco4glalciSgCE86bbawcj;cbfaifglcGfaoclfaCfgORbbaAcl4ciGgCaCciSgCE86bbalcVfaOaCfgORbbaAcd4ciGgCaCciSgCE86bbalc7faOaCfgORbbaAciGgAaAciSgAE86bbalctfaOaAfgARbbaoRbegOco4gCaCciSgCE86bbalc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc93faAaCfgARbbaOciGgOaOciSgOE86bbalc94faAaOfgARbbaoRbdgOco4gCaCciSgCE86bbalc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc97faAaCfgARbbaOciGgOaOciSgOE86bbalc98faAaOfgORbbaoRbigoco4gAaAciSgAE86bbalc99faOaAfgORbbaocl4ciGgAaAciSgAE86bbalc9:faOaAfgORbbaocd4ciGgAaAciSgAE86bbalcufaOaAfglRbbaociGgoaociSgoE86bbalaofhoxdkaOaoRbwaoRbbgAcl4glalcsSgCE86bbawcj;cbfaifglcGfaocwfaCfgORbbaAcsGgAaAcsSgAE86bbalcVfaOaAfgORbbaoRbegAcl4gCaCcsSgCE86bbalc7faOaCfgORbbaAcsGgAaAcsSgAE86bbalctfaOaAfgORbbaoRbdgAcl4gCaCcsSgCE86bbalc91faOaCfgORbbaAcsGgAaAcsSgAE86bbalc4faOaAfgORbbaoRbigAcl4gCaCcsSgCE86bbalc93faOaCfgORbbaAcsGgAaAcsSgAE86bbalc94faOaAfgORbbaoRblgAcl4gCaCcsSgCE86bbalc95faOaCfgORbbaAcsGgAaAcsSgAE86bbalc96faOaAfgORbbaoRbvgAcl4gCaCcsSgCE86bbalc97faOaCfgORbbaAcsGgAaAcsSgAE86bbalc98faOaAfgORbbaoRbogAcl4gCaCcsSgCE86bbalc99faOaCfgORbbaAcsGgAaAcsSgAE86bbalc9:faOaAfgORbbaoRbrgocl4gAaAcsSgAE86bbalcufaOaAfglRbbaocsGgoaocsSgoE86bbalaofhoxekaOao8Pbb83bbaOcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaiczfhlarao9RcL0mekkaiam6miaoTmidnakTmbawaPfRbbhOawcj;cbfhlazhiakhHinaialRbbgAce4cbaAceG9R7aOfgO86bbaiadfhialcefhlaHcufgHmbkkazcefhzaPcefgPad6hsaohHaPad9hmexvkkcbhoasceGmdxikaoaxad2fhPdnakTmbcbhmcehsawcjdfhCinarao9Rax6miaoTmdaoaxfhoawamfRbbhOawcj;cbfhlaChiakhHinaialRbbgAce4cbaAceG9R7aOfgO86bbaiadfhialcefhlaHcufgHmbkaCcefhCamcefgmad6hsamad9hmbkaPhoxikcbhlcehsinarao9Rax6mdaoTmeaoaxfhoalcefglad6hsadal9hmbkaPhoxdkcbhoasceGTmekc9:hoxikabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekcbc99arao9Radcaadca0ESEhokavcj;ebf8Kjjjjbaok;xzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfalaDcu7gPcl4fcsGcitfgsydlhzasydbhHdnaDcsGgDak9pmbavaiaPfcsGcdtfydbaxaDEhsaDThDdndnadcd9hmbabarcetfgPaH87ebaPcdfaz87ebaPclfas87ebxekabarcdtfgPaHBdbaPclfazBdbaPcwfasBdbkaxaDfhxavc;abfalcitfgPasBdbaPazBdlavaicdtfasBdbavc;abfalcefcsGglcitfgPaHBdbaPasBdlaiaDfhialcefhlxdkdndnaDcsSmbamaDfaDc987fcefhmxekaocefhDao8SbbgscFeGhPdndnascu9mmbaDhoxekaocvfhoaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhokaPce4cbaPceG9R7amfhmkdndnadcd9hmbabarcetfgDaH87ebaDcdfaz87ebaDclfam87ebxekabarcdtfgDaHBdbaDclfazBdbaDcwfamBdbkavc;abfalcitfgDamBdbaDazBdlavaicdtfamBdbavc;abfalcefcsGglcitfgDaHBdbaDamBdlaicefhialcefhlxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHcdfaD87ebaHclfas87ebxekabarcdtfgHaxBdbaHclfaDBdbaHcwfasBdbkavaicdtfaxBdbavc;abfalcitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfalcefcsGcitfgHasBdbaHaDBdlavaiaPfcsGgicdtfasBdbavc;abfalcdfcsGglcitfgDaxBdbaDasBdlalcefhlaiaOfhiazaOfhxxekaxcbaoRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbaocefhDxekaocdfhDao8SbegPcFeGhsdnaPcu9kmbaocofhAascFbGhscrhodninaD8SbbgPcFbGaotasVhsaPcu9kmeaDcefhDaocrfgoc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbgocFeGhPdnaocu9kmbaDcvfhzaPcFbGhPcrhodninas8SbbgDcFbGaotaPVhPaDcu9kmeascefhsaocrfgoc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashoxekascefhoas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninao8SbbgscFbGaDtaPVhPascu9kmeaocefhoaDcrfgDc8J9hmbkaOhoxekaocefhokaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDcdfaz87ebaDclfaO87ebxekabarcdtfgDaABdbaDclfazBdbaDcwfaOBdbkavc;abfalcitfgDazBdbaDaABdlavaicdtfaABdbavc;abfalcefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfalcdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiarcifgrae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;siliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabavcefciGaiVcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:Ohkxekcjjjj94hkkabavcdfciGaiVcetfak87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:Ohqxekcjjjj94hqkabavcufciGaiVcetfaq87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohqxekcjjjj94hqkabavciGaiVcetfaq87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj;8ifcjjj98G::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklz9Kbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q;Aekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq;a9tqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk;d8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhwcbhDinaDae9pmeawaeaD9RaDawfae6Egqcsfgoc9WGgkci2hxakcethmaocl4cifcd4hPabaDad2fhscbhzdnincehHalhOcbhAdninaraO9RaP6miavcj;cbfaAak2fhCaOaPfhlcbhidnakc;ab6mbaral9Rc;Gb6mbcbhoinaCaofhidndndndndnaOaoco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklbalczfhlkdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklzalczfhlkdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklaalczfhlkdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalclfaYpQbfaXc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalcwfaYpQbfaXc:q:yjjbfRbbfhlxekaialpbbbpkl8Walczfhlkaoc;abfhiaocjefak0meaihoaral9Rc;Fb0mbkkdndnaiak9pmbaici4hoinaral9RcK6mdaCaifhXdndndndndnaOaico4fRbbaocoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpklbxikaXalpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaXalpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaXalpbbbpklbalczfhlkaocdfhoaiczfgiak6mbkkalTmbaAci6hHalhOaAcefgAclSmdxekkcbhlaHceGmdkdnakTmbavcjdfazfhiavazfpbdbhYcbhXinaiavcj;cbfaXfgopblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLaoakfpblbg8Acep9Ta8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naeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfalaDcu7gPcl4fcsGcitfgsydlhzasydbhHdnaDcsGgDak9pmbavaiaPfcsGcdtfydbaxaDEhsaDThDdndnadcd9hmbabarcetfgPaH87ebaPcdfaz87ebaPclfas87ebxekabarcdtfgPaHBdbaPclfazBdbaPcwfasBdbkaxaDfhxavc;abfalcitfgPasBdbaPazBdlavaicdtfasBdbavc;abfalcefcsGglcitfgPaHBdbaPasBdlaiaDfhialcefhlxdkdndnaDcsSmbamaDfaDc987fcefhmxekaocefhDao8SbbgscFeGhPdndnascu9mmbaDhoxekaocvfhoaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhokaPce4cbaPceG9R7amfhmkdndnadcd9hmbabarcetfgDaH87ebaDcdfaz87ebaDclfam87ebxekabarcdtfgDaHBdbaDclfazBdbaDcwfamBdbkavc;abfalcitfgDamBdbaDazBdlavaicdtfamBdbavc;abfalcefcsGglcitfgDaHBdbaDamBdlaicefhialcefhlxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHcdfaD87ebaHclfas87ebxekabarcdtfgHaxBdbaHclfaDBdbaHcwfasBdbkavaicdtfaxBdbavc;abfalcitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfalcefcsGcitfgHasBdbaHaDBdlavaiaPfcsGgicdtfasBdbavc;abfalcdfcsGglcitfgDaxBdbaDasBdlalcefhlaiaOfhiazaOfhxxekaxcbaoRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbaocefhDxekaocdfhDao8SbegPcFeGhsdnaPcu9kmbaocofhAascFbGhscrhodninaD8SbbgPcFbGaotasVhsaPcu9kmeaDcefhDaocrfgoc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbgocFeGhPdnaocu9kmbaDcvfhzaPcFbGhPcrhodninas8SbbgDcFbGaotaPVhPaDcu9kmeascefhsaocrfgoc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashoxekascefhoas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninao8SbbgscFbGaDtaPVhPascu9kmeaocefhoaDcrfgDc8J9hmbkaOhoxekaocefhokaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDcdfaz87ebaDclfaO87ebxekabarcdtfgDaABdbaDclfazBdbaDcwfaOBdbkavc;abfalcitfgDazBdbaDaABdlavaicdtfaABdbavc;abfalcefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfalcdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiarcifgrae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:wPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalae9pmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oawaopmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalae9pmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oawaopmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalae9pmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepkbbadczfhdaeclfgeav6mbkkdnaval9pmbaialciGgecdtgdVcbc;abad9R;8kbaiabavcdtfgvad;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepklbkavaiad;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz9Tbb",e=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),r=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var i=WebAssembly.validate(e)?t:n,a,o=WebAssembly.instantiate(s(i),{}).then(function(m){a=m.instance,a.exports.__wasm_call_ctors()});function s(m){for(var y=new Uint8Array(m.length),b=0;b<m.length;++b){var x=m.charCodeAt(b);y[b]=x>96?x-97:x>64?x-39:x+4}for(var w=0,b=0;b<m.length;++b)y[w++]=y[b]<60?r[y[b]]:(y[b]-60)*64+y[++b];return y.buffer.slice(0,w)}function u(m,y,b,x,w,E){var S=a.exports.sbrk,C=b+3&-4,R=S(C*x),B=S(w.length),M=new Uint8Array(a.exports.memory.buffer);M.set(w,B);var I=m(R,b,x,B,w.length);if(I==0&&E&&E(R,C,x),y.set(M.subarray(R,R+b*x)),S(R-S(0)),I!=0)throw new Error("Malformed buffer data: "+I)}var l={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},c={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},d=[],p=0;function A(m){var y={object:new Worker(m),pending:0,requests:{}};return y.object.onmessage=function(b){var x=b.data;y.pending-=x.count,y.requests[x.id][x.action](x.value),delete y.requests[x.id]},y}function h(m){for(var y="var instance; var ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(s(i))+"]), {}).then(function(result) { instance = result.instance; instance.exports.__wasm_call_ctors(); });self.onmessage = workerProcess;"+u.toString()+g.toString(),b=new Blob([y],{type:"text/javascript"}),x=URL.createObjectURL(b),w=0;w<m;++w)d[w]=A(x);URL.revokeObjectURL(x)}function v(m,y,b,x,w){for(var E=d[0],S=1;S<d.length;++S)d[S].pending<E.pending&&(E=d[S]);return new Promise(function(C,R){var B=new Uint8Array(b),M=p++;E.pending+=m,E.requests[M]={resolve:C,reject:R},E.object.postMessage({id:M,count:m,size:y,source:B,mode:x,filter:w},[B.buffer])})}function g(m){o.then(function(){var y=m.data;try{var b=new Uint8Array(y.count*y.size);u(a.exports[y.mode],b,y.count,y.size,y.source,a.exports[y.filter]),self.postMessage({id:y.id,count:y.count,action:"resolve",value:b},[b.buffer])}catch(x){self.postMessage({id:y.id,count:y.count,action:"reject",value:x})}})}return{ready:o,supported:!0,useWorkers:function(m){h(m)},decodeVertexBuffer:function(m,y,b,x,w){u(a.exports.meshopt_decodeVertexBuffer,m,y,b,x,a.exports[l[w]])},decodeIndexBuffer:function(m,y,b,x){u(a.exports.meshopt_decodeIndexBuffer,m,y,b,x)},decodeIndexSequence:function(m,y,b,x){u(a.exports.meshopt_decodeIndexSequence,m,y,b,x)},decodeGltfBuffer:function(m,y,b,x,w,E){u(a.exports[c[w]],m,y,b,x,a.exports[l[E]])},decodeGltfBufferAsync:function(m,y,b,x,w){return d.length>0?v(m,y,b,c[x],l[w]):o.then(function(){var E=new Uint8Array(m*y);return u(a.exports[c[x]],E,m,y,b,a.exports[l[w]]),E})}}}(),za="EXT_meshopt_compression",Ch=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadBufferView=function(e,r){var i=r.json,a=i.bufferViews[e];if(a.extensions&&a.extensions[za]){var o=a.extensions[za],s=r.loadBuffer(o.buffer);if(!Na.supported){if(i.extensionsRequired&&i.extensionsRequired.indexOf(za)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([s,Na.ready]).then(function(u){var l=u[0],c=o.byteOffset||0,d=o.byteLength||0,p=o.count,A=o.byteStride,h=new ArrayBuffer(p*A),v=new Uint8Array(l,c,d);return Na.decodeGltfBuffer(new Uint8Array(h),p,A,v,o.mode,o.filter),h})}else return null},t}(Tr),Ys="EXT_texture_webp",Ih=function(n){ue(t,n);function t(){var e=n!==null&&n.apply(this,arguments)||this;return e.supportsWep=!1,e}return t.prototype.prepare=function(e){var r=this;return cu().then(function(i){r.supportsWep=i.webp})},t.prototype.loadTexture=function(e,r){var i=r.json,a=i.textures[e];if(!a.extensions||!a.extensions[Ys]||!this.supportsWep)return null;var o=a.extensions[Ys];return r.loadImage(o.source).then(function(s){var u=new f.Texture(s);u.needsUpdate=!0,u.flipY=!1,a.name&&(u.name=a.name);var l=r.json.samplers||{},c=l[a.sampler]||{};return u.magFilter=ta[c.magFilter]||f.LinearFilter,u.minFilter=ta[c.minFilter]||f.LinearMipmapLinearFilter,u.wrapS=ra[c.wrapS]||f.RepeatWrapping,u.wrapT=ra[c.wrapT]||f.RepeatWrapping,u.onUpdate=function(){s.close()},u})},t}(Tr),Ua="CESIUM_RTC",Th=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.emitResult=function(e,r){if(r.json.extensions[Ua]&&r.json.extensions[Ua].center){var i=r.json.extensions[Ua].center;e.CESIUM_RTC={center:new f.Vector3().fromArray(i)}}},t}(Tr),Ph=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadMesh=function(e,r){var i=this,a=r.json.meshes[e],o=a.primitives,s=Promise.all(o.map(function(c){return r.loadGeometry(c)})),u=Promise.all(o.map(function(c){return i.loadPBMMaterial(c,r)})),l=Promise.all([s,u]).then(function(c){for(var d=c[0],p=c[1],A=[],h=0;h<o.length;h++){var v=o[h],g=d[h],m=p[h];g.attributes.normal===void 0&&(m.flatShading=!0),g.attributes.tangent===void 0&&m.normalScale&&(m.normalScale.y*=-1);var y=v.mode||Qe.TRIANGLES,b=void 0;if(y===Qe.TRIANGLES||y===Qe.TRIANGLE_STRIP||y===Qe.TRIANGLE_FAN)if(y===Qe.TRIANGLE_STRIP?g=r.toGeometryTrianglesDrawMode(g,f.TriangleStripDrawMode):y===Qe.TRIANGLE_FAN&&(g=r.toGeometryTrianglesDrawMode(g,f.TriangleFanDrawMode)),g.clearGroups(),g.addGroup(0,g.index?g.index.count:g.attributes.position.count,0),r.disposeSet.add(g),a.isSkinnedMesh){var x=new hu(g,[m]);g.attributes.skinWeight.normalized||x.normalizeSkinWeights(),b=x}else b=new kt(g,[m]);else if(y===Qe.POINTS)b=new mr(g,m);else throw new Error("glTF: Primitive mode unsupported: "+y);b.name=r.createUniqueName(a.name||"mesh_"+e),A.push(b)}if(A.length===1)return A[0];for(var w=new f.Group,E=0,S=A;E<S.length;E++){var b=S[E];w.add(b)}return w});return l},t.prototype.loadPBMMaterial=function(e,r){var i,a=(i=e.mode)!==null&&i!==void 0?i:Qe.TRIANGLES,o=null;if(a===Qe.TRIANGLES||a===Qe.TRIANGLE_STRIP||a===Qe.TRIANGLE_FAN)o=this.loadPBMMeshMaterial(e,r);else if(a===Qe.POINTS)o=this.loadPBMPointCloudMaterial(e,r);else throw new Error("glTF: Primitive mode unsupported: "+a);return o},t.prototype.extendTexture=function(e,r,i){return e.minFilter=f.LinearFilter,e.magFilter=f.LinearFilter,e.generateMipmaps=!1,e},t.prototype.loadPBMPointCloudMaterial=function(e,r){var i=new Mi;return Object.keys(e.attributes).filter(function(a){return Zt[a]==="normal"}).length>0&&(i.defines.USE_POINT_NORMAL=!0),r.disposeSet.add(i),Promise.resolve(i)},t.prototype.loadPBMMeshMaterial=function(e,r){var i=[],a=new Ar("basic");if(a.color=new f.Color(1,1,1),Object.keys(e.attributes).filter(function(c){return Zt[c]==="color"}).length>0&&(a.vertexColors=!0),e.material!==void 0){var o=r.json.materials[e.material];o.name&&(a.name=o.name);var s=o.pbrMetallicRoughness||{};if(Array.isArray(s.baseColorFactor)){var u=s.baseColorFactor;a.color=new f.Color().fromArray(u)}if(s.baseColorTexture!==void 0&&i.push(r.createMaterialTexture(s.baseColorTexture).then(function(c){r.disposeSet.add(c),c.encoding=f.sRGBEncoding,a.map=c})),o.doubleSided===!0&&(a.side=f.DoubleSide),o.normalTexture!==void 0&&(i.push(r.createMaterialTexture(o.normalTexture).then(function(c){r.disposeSet.add(c),a.normalMap=c})),a.normalScale=new f.Vector2(1,1),o.normalTexture.scale!==void 0)){var l=o.normalTexture.scale;a.normalScale.set(l,l)}}return r.disposeSet.add(a),a.refreshUniforms(),Promise.all(i).then(function(){return a})},t}(Tr),pn={KHR_binary_glTF:lh,KHR_draco_mesh_compression:dh,KHR_texture_basisu:wh,KHR_texture_transform:Eh,KHR_mesh_quantization:Sh,KHR_materials_unlit:Mh,EXT_meshopt_compression:Ch,EXT_texture_webp:Ih,CESIUM_RTC:Th,PBM_mesh:Ph};function Jo(n,t){var e,r,i,a={};if(t.addonExtensions)for(var o=0,s=t.addonExtensions;o<s.length;o++){var u=s[o];u in pn&&(a[u]=new pn[u])}var l,c;if(typeof n=="string")c=n;else{var d=pn.KHR_binary_glTF.getMagic(n);if(d===pn.KHR_binary_glTF.HEADER_MAGIC){l=new pn.KHR_binary_glTF;try{l.loadGlbBinary(n)}catch(m){return Promise.reject(m)}a.KHR_binary_glTF=l,c=l.content}else c=ea(new Uint8Array(n))}var p=JSON.parse(c);if(p.asset===void 0||Number(p.asset.version[0])<2)return Promise.reject(new Error("glTF: Unsupported asset. glTF versions >=2.0 are supported."));if(p.extensionsUsed)for(var A=p.extensionsRequired||[],h=0;h<p.extensionsUsed.length;h++){var v=p.extensionsUsed[h];a[v]||(pn[v]?a[v]=new pn[v]:A.indexOf(v)>=0&&console.warn('glTF: Unknown extension "'+v+'".'))}var g=new uh(p,a,{copyUV2:(e=t.copyUV2)!==null&&e!==void 0?e:!0,resourcePath:(r=t.resourcePath)!==null&&r!==void 0?r:"",search:(i=t.search)!==null&&i!==void 0?i:"",fetcher:t.fetcher});return g.parse().then(function(m){return l&&l.clear(),m})}var Rh=new f.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function Gu(n,t){var e,r;t===void 0&&(t={});var i=(e=t.upAxis)!==null&&e!==void 0?e:"Y",a=(r=t.fetcher)!==null&&r!==void 0?r:new Qt({allowHosts:["*"]}),o={uri:n,gltfUpAxis:i};return Promise.resolve().then(function(){return a.ajax(n,{responseType:"arraybuffer"}).then(function(s){return s.body})}).then(function(s){return Promise.resolve(0).then(function(u){return Uu(o,s,u)}).then(function(u){return Hu(o,s,u)}).then(function(u){return ah(o,s,u)})}).then(function(){var s;return Jo(o.gltfArrayBuffer,{copyUV2:!1,addonExtensions:["PBM_mesh"],resourcePath:n.slice(0,n.lastIndexOf("/")+1),search:(s=n.split("?")[1])!==null&&s!==void 0?s:"",fetcher:a}).then(function(u){var l=new f.Matrix4;i==="Y"&&l.premultiply(Rh);var c=new f.Matrix4().setPosition(o.rtcCenter[0],o.rtcCenter[1],o.rtcCenter[2]);if(l.premultiply(c),u.CESIUM_RTC){var d=new f.Matrix4().setPosition(u.CESIUM_RTC.center);l.premultiply(d)}var p=u.scene;return p.applyMatrix4(l),delete o.featureTableBinary,delete o.batchTableBinary,delete o.gltfArrayBuffer,{type:"b3dm",upAxis:"Z",uri:o.uri,byteLength:o.byteLength,scene:p,textures:u.textures,dispose:function(){return u.dispose()}}})})}const Ku="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2Z1bmN0aW9uIEIoYSl7b25tZXNzYWdlPWZ1bmN0aW9uKHIpe1Byb21pc2UucmVzb2x2ZShyLmRhdGEpLnRoZW4oZnVuY3Rpb24obil7cmV0dXJuIGEobil9KS50aGVuKGZ1bmN0aW9uKG4pe3ZhciBlPW4ub3V0cHV0LHQ9bi50cmFuc2ZlcjtyZXR1cm4gcG9zdE1lc3NhZ2UoZSx0KX0pLmNhdGNoKGZ1bmN0aW9uKG4pe3JldHVybiBwb3N0TWVzc2FnZSh7JCRlcnJvcjpufSl9KX19dmFyIHUseTsoZnVuY3Rpb24oYSl7YVthLkJZVEU9NTEyMF09IkJZVEUiLGFbYS5VTlNJR05FRF9CWVRFPTUxMjFdPSJVTlNJR05FRF9CWVRFIixhW2EuU0hPUlQ9NTEyMl09IlNIT1JUIixhW2EuVU5TSUdORURfU0hPUlQ9NTEyM109IlVOU0lHTkVEX1NIT1JUIixhW2EuSU5UPTUxMjRdPSJJTlQiLGFbYS5VTlNJR05FRF9JTlQ9NTEyNV09IlVOU0lHTkVEX0lOVCIsYVthLkZMT0FUPTUxMjZdPSJGTE9BVCIsYVthLkRPVUJMRT01MTMwXT0iRE9VQkxFIn0pKHl8fCh5PXt9KSk7dmFyIGM9KHU9e30sdVt5LkRPVUJMRV09RmxvYXQ2NEFycmF5LHVbeS5GTE9BVF09RmxvYXQzMkFycmF5LHVbeS5VTlNJR05FRF9TSE9SVF09VWludDE2QXJyYXksdVt5LlVOU0lHTkVEX0lOVF09VWludDMyQXJyYXksdVt5LlVOU0lHTkVEX0JZVEVdPVVpbnQ4QXJyYXksdVt5LkJ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aWQgMCxOPXZvaWQgMCxFPXZvaWQgMCxTPXZvaWQgMCxzPXZvaWQgMCxUPXZvaWQgMDt0PG47dCsrKXY9dCoyLEE9clt2XSpELTEsTj1yWysrdl0qRC0xLFM9QTwwPy1BOkEscz1OPDA/LU46TixFPTEtKFMrcyksRTwwJiYoQT0oMS1zKSooQTwwPy0xOjEpLE49KDEtUykqKE48MD8tMToxKSksVD1NYXRoLnNxcnQoQSpBK04qTitFKkUpLHY9dCo0LGVbdl09QS9UKmgsZVsrK3ZdPU4vVCpoLGVbKyt2XT1FL1QqaDtyZXR1cm57YXJyYXk6ZSxpdGVtU2l6ZTo0LG5vcm1hbGl6ZWQ6ITB9fXJldHVybiBudWxsfX0pKCk7Cg==",Bh=n=>Uint8Array.from(atob(n),t=>t.charCodeAt(0)),$s=typeof self!="undefined"&&self.Blob&&new Blob([Bh(Ku)],{type:"text/javascript;charset=utf-8"});function Fh(n){let t;try{if(t=$s&&(self.URL||self.webkitURL).createObjectURL($s),!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,"+Ku,{name:n==null?void 0:n.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var Lh=new ku(function(){return new Fh},2);function kh(n,t,e){var r=new Qu(n.featureTableJson,n.featureTableBinary);return Promise.resolve().then(function(){var i=r.getExtension("3DTILES_draco_point_compression");return i?Oh(i,r):Lh.postMessage({featureTableBinary:r.buffer,featureTableJson:r.json},[r.buffer.buffer])}).then(function(i){return n.attributes=i,e})}function Oh(n,t){return sa(this,void 0,void 0,function(){var e,r,i,a,o,s;return ua(this,function(u){if(e=n.properties||{},r=n.byteOffset,i=n.byteLength,!e||!Number.isFinite(r)||!i)throw new Error("Draco properties, byteOffset, and byteLength must be defined");return a=t.buffer.slice(r,r+i),o=n.properties,s={POSITION:"Float32Array",NORMAL:"Float32Array",RGB:"Uint8Array",RGBA:"Uint8Array"},[2,na.decodeGeometry(a.buffer,{attributeIDs:o,attributeTypes:s,useUniqueIDs:!0}).then(function(l){var c=l.getAttribute("POSITION"),d=l.getAttribute("RGB"),p=l.getAttribute("RGBA"),A=l.getAttribute("NORMAL"),h;if(p)h=p;else if(d){for(var v=d.count,g=d.array,m=new Uint8Array(v*4),y=0,b=void 0,x=void 0;y<v;y++)x=y*4,b=y*3,m[x]=g[b],m[++x]=g[++b],m[++x]=g[++b];h=new f.BufferAttribute(m,4,d.normalized)}return{position:c?{array:c.array,itemSize:c.itemSize,normalized:c.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 _u(n,t){var e;t===void 0&&(t={});var r=(e=t.fetcher)!==null&&e!==void 0?e:new Qt({allowHosts:["*"]}),i={uri:n};return Promise.resolve().then(function(){return r.ajax(n,{responseType:"arraybuffer"}).then(function(a){return a.body})}).then(function(a){return Promise.resolve(0).then(function(o){return Uu(i,a,o)}).then(function(o){return Hu(i,a,o)}).then(function(o){return kh(i,a,o)})}).then(function(){var a;return Dh(i.attributes,{computeBoundingBox:(a=t.computeBoundingBox)!==null&&a!==void 0?a:!0})}).then(function(a){var o=new f.Matrix4,s=new f.Matrix4().setPosition(i.rtcCenter[0],i.rtcCenter[1],i.rtcCenter[2]);return o.premultiply(s),a.object.applyMatrix4(o),delete i.gltfArrayBuffer,delete i.featureTableBinary,delete i.batchTableBinary,{type:"pnts",upAxis:"Z",uri:i.uri,byteLength:i.byteLength,scene:a.object,textures:[],dispose:function(){return a.dispose()}}})}function Dh(n,t){var e=new Set,r=new f.BufferGeometry;e.add(r);var i=new Mi;e.add(i),n.position&&r.setAttribute("position",new f.BufferAttribute(n.position.array,n.position.itemSize,n.position.normalized)),n.color&&r.setAttribute("color",new f.BufferAttribute(n.color.array,n.color.itemSize,n.color.normalized)),n.normal&&(r.setAttribute("normal",new f.BufferAttribute(n.normal.array,n.normal.itemSize,n.normal.normalized)),i.defines.USE_POINT_NORMAL=!0),t.computeBoundingBox&&r.computeBoundingBox();var a=new mr(r,i);return a.matrix.compose(a.position,a.quaternion,a.scale),a.matrixAutoUpdate=!1,a.frustumCulled=!1,Promise.resolve({object:a,dispose:function(){e.forEach(function(o){o.dispose()}),e.clear()}})}function ju(){var n={};return n.OutWindow=function(){this._windowSize=0},n.OutWindow.prototype.create=function(t){(!this._buffer||this._windowSize!==t)&&(this._buffer=[]),this._windowSize=t,this._pos=0,this._streamPos=0},n.OutWindow.prototype.flush=function(){var t=this._pos-this._streamPos;if(t!==0){for(;t--;)this._stream.writeByte(this._buffer[this._streamPos++]);this._pos>=this._windowSize&&(this._pos=0),this._streamPos=this._pos}},n.OutWindow.prototype.releaseStream=function(){this.flush(),this._stream=null},n.OutWindow.prototype.setStream=function(t){this.releaseStream(),this._stream=t},n.OutWindow.prototype.init=function(t){t||(this._streamPos=0,this._pos=0)},n.OutWindow.prototype.copyBlock=function(t,e){var r=this._pos-t-1;for(r<0&&(r+=this._windowSize);e--;)r>=this._windowSize&&(r=0),this._buffer[this._pos++]=this._buffer[r++],this._pos>=this._windowSize&&this.flush()},n.OutWindow.prototype.putByte=function(t){this._buffer[this._pos++]=t,this._pos>=this._windowSize&&this.flush()},n.OutWindow.prototype.getByte=function(t){var e=this._pos-t-1;return e<0&&(e+=this._windowSize),this._buffer[e]},n.RangeDecoder=function(){},n.RangeDecoder.prototype.setStream=function(t){this._stream=t},n.RangeDecoder.prototype.releaseStream=function(){this._stream=null},n.RangeDecoder.prototype.init=function(){var t=5;for(this._code=0,this._range=-1;t--;)this._code=this._code<<8|this._stream.readByte()},n.RangeDecoder.prototype.decodeDirectBits=function(t){for(var e=0,r=t,i;r--;)this._range>>>=1,i=this._code-this._range>>>31,this._code-=this._range&i-1,e=e<<1|1-i,this._range&4278190080||(this._code=this._code<<8|this._stream.readByte(),this._range<<=8);return e},n.RangeDecoder.prototype.decodeBit=function(t,e){var r=t[e],i=(this._range>>>11)*r;return(this._code^2147483648)<(i^2147483648)?(this._range=i,t[e]+=2048-r>>>5,this._range&4278190080||(this._code=this._code<<8|this._stream.readByte(),this._range<<=8),0):(this._range-=i,this._code-=i,t[e]-=r>>>5,this._range&4278190080||(this._code=this._code<<8|this._stream.readByte(),this._range<<=8),1)},n.initBitModels=function(t,e){for(;e--;)t[e]=1024},n.BitTreeDecoder=function(t){this._models=[],this._numBitLevels=t},n.BitTreeDecoder.prototype.init=function(){n.initBitModels(this._models,1<<this._numBitLevels)},n.BitTreeDecoder.prototype.decode=function(t){for(var e=1,r=this._numBitLevels;r--;)e=e<<1|t.decodeBit(this._models,e);return e-(1<<this._numBitLevels)},n.BitTreeDecoder.prototype.reverseDecode=function(t){for(var e=1,r=0,i=0,a;i<this._numBitLevels;++i)a=t.decodeBit(this._models,e),e=e<<1|a,r|=a<<i;return r},n.reverseDecode2=function(t,e,r,i){for(var a=1,o=0,s=0,u;s<i;++s)u=r.decodeBit(t,e+a),a=a<<1|u,o|=u<<s;return o},n.LenDecoder=function(){this._choice=[],this._lowCoder=[],this._midCoder=[],this._highCoder=new n.BitTreeDecoder(8),this._numPosStates=0},n.LenDecoder.prototype.create=function(t){for(;this._numPosStates<t;++this._numPosStates)this._lowCoder[this._numPosStates]=new n.BitTreeDecoder(3),this._midCoder[this._numPosStates]=new n.BitTreeDecoder(3)},n.LenDecoder.prototype.init=function(){var t=this._numPosStates;for(n.initBitModels(this._choice,2);t--;)this._lowCoder[t].init(),this._midCoder[t].init();this._highCoder.init()},n.LenDecoder.prototype.decode=function(t,e){return t.decodeBit(this._choice,0)===0?this._lowCoder[e].decode(t):t.decodeBit(this._choice,1)===0?8+this._midCoder[e].decode(t):16+this._highCoder.decode(t)},n.Decoder2=function(){this._decoders=[]},n.Decoder2.prototype.init=function(){n.initBitModels(this._decoders,768)},n.Decoder2.prototype.decodeNormal=function(t){var e=1;do e=e<<1|t.decodeBit(this._decoders,e);while(e<256);return e&255},n.Decoder2.prototype.decodeWithMatchByte=function(t,e){var r=1,i,a;do if(i=e>>7&1,e<<=1,a=t.decodeBit(this._decoders,(1+i<<8)+r),r=r<<1|a,i!==a){for(;r<256;)r=r<<1|t.decodeBit(this._decoders,r);break}while(r<256);return r&255},n.LiteralDecoder=function(){},n.LiteralDecoder.prototype.create=function(t,e){var r;if(!(this._coders&&this._numPrevBits===e&&this._numPosBits===t))for(this._numPosBits=t,this._posMask=(1<<t)-1,this._numPrevBits=e,this._coders=[],r=1<<this._numPrevBits+this._numPosBits;r--;)this._coders[r]=new n.Decoder2},n.LiteralDecoder.prototype.init=function(){for(var t=1<<this._numPrevBits+this._numPosBits;t--;)this._coders[t].init()},n.LiteralDecoder.prototype.getDecoder=function(t,e){return this._coders[((t&this._posMask)<<this._numPrevBits)+((e&255)>>>8-this._numPrevBits)]},n.Decoder=function(){this._outWindow=new n.OutWindow,this._rangeDecoder=new n.RangeDecoder,this._isMatchDecoders=[],this._isRepDecoders=[],this._isRepG0Decoders=[],this._isRepG1Decoders=[],this._isRepG2Decoders=[],this._isRep0LongDecoders=[],this._posSlotDecoder=[],this._posDecoders=[],this._posAlignDecoder=new n.BitTreeDecoder(4),this._lenDecoder=new n.LenDecoder,this._repLenDecoder=new n.LenDecoder,this._literalDecoder=new n.LiteralDecoder,this._dictionarySize=-1,this._dictionarySizeCheck=-1,this._posSlotDecoder[0]=new n.BitTreeDecoder(6),this._posSlotDecoder[1]=new n.BitTreeDecoder(6),this._posSlotDecoder[2]=new n.BitTreeDecoder(6),this._posSlotDecoder[3]=new n.BitTreeDecoder(6)},n.Decoder.prototype.setDictionarySize=function(t){return t<0?!1:(this._dictionarySize!==t&&(this._dictionarySize=t,this._dictionarySizeCheck=Math.max(this._dictionarySize,1),this._outWindow.create(Math.max(this._dictionarySizeCheck,4096))),!0)},n.Decoder.prototype.setLcLpPb=function(t,e,r){var i=1<<r;return t>8||e>4||r>4?!1:(this._literalDecoder.create(e,t),this._lenDecoder.create(i),this._repLenDecoder.create(i),this._posStateMask=i-1,!0)},n.Decoder.prototype.init=function(){var t=4;for(this._outWindow.init(!1),n.initBitModels(this._isMatchDecoders,192),n.initBitModels(this._isRep0LongDecoders,192),n.initBitModels(this._isRepDecoders,12),n.initBitModels(this._isRepG0Decoders,12),n.initBitModels(this._isRepG1Decoders,12),n.initBitModels(this._isRepG2Decoders,12),n.initBitModels(this._posDecoders,114),this._literalDecoder.init();t--;)this._posSlotDecoder[t].init();this._lenDecoder.init(),this._repLenDecoder.init(),this._posAlignDecoder.init(),this._rangeDecoder.init()},n.Decoder.prototype.decode=function(t,e,r){var i=0,a=0,o=0,s=0,u=0,l=0,c=0,d,p,A,h,v,g;for(this._rangeDecoder.setStream(t),this._outWindow.setStream(e),this.init();r<0||l<r;)if(d=l&this._posStateMask,this._rangeDecoder.decodeBit(this._isMatchDecoders,(i<<4)+d)===0)p=this._literalDecoder.getDecoder(l++,c),i>=7?c=p.decodeWithMatchByte(this._rangeDecoder,this._outWindow.getByte(a)):c=p.decodeNormal(this._rangeDecoder),this._outWindow.putByte(c),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)+d)===0&&(i=i<7?9:11,A=1):(this._rangeDecoder.decodeBit(this._isRepG1Decoders,i)===0?h=o:(this._rangeDecoder.decodeBit(this._isRepG2Decoders,i)===0?h=s:(h=u,u=s),s=o),o=a,a=h),A===0&&(A=2+this._repLenDecoder.decode(this._rangeDecoder,d),i=i<7?8:11);else if(u=s,s=o,o=a,A=2+this._lenDecoder.decode(this._rangeDecoder,d),i=i<7?7:10,v=this._posSlotDecoder[A<=5?A-2:3].decode(this._rangeDecoder),v>=4){if(g=(v>>1)-1,a=(2|v&1)<<g,v<14)a+=n.reverseDecode2(this._posDecoders,a-v-1,this._rangeDecoder,g);else if(a+=this._rangeDecoder.decodeDirectBits(g-4)<<4,a+=this._posAlignDecoder.reverseDecode(this._rangeDecoder),a<0){if(a===-1)break;return!1}}else a=v;if(a>=l||a>=this._dictionarySizeCheck)return!1;this._outWindow.copyBlock(a,A),l+=A,c=this._outWindow.getByte(0)}return this._outWindow.flush(),this._outWindow.releaseStream(),this._rangeDecoder.releaseStream(),!0},n.Decoder.prototype.setDecoderProperties=function(t){var e,r,i,a,o;return t.size<5||(e=t.readByte(),r=e%9,e=~~(e/9),i=e%5,a=~~(e/5),!this.setLcLpPb(r,i,a))?!1:(o=t.readByte(),o|=t.readByte()<<8,o|=t.readByte()<<16,o+=t.readByte()*16777216,this.setDictionarySize(o))},n.decompress=function(t,e,r,i){var a=new n.Decoder;if(!a.setDecoderProperties(t))throw"Incorrect stream properties";if(!a.decode(e,r,i))throw"Error in data stream";return!0},n.decompressFile=function(t,e){var r=new n.Decoder,i;if(!r.setDecoderProperties(t))throw"Incorrect stream properties";if(i=t.readByte(),i|=t.readByte()<<8,i|=t.readByte()<<16,i+=t.readByte()*16777216,t.readByte(),t.readByte(),t.readByte(),t.readByte(),!r.decode(t,e,i))throw"Error in data stream";return!0},n}var Vh=ju();function Nh(){function n(e){for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(256),a=0;a<r.length;a++)i[r.charCodeAt(a)]=a;var o=e.length*.75,s=e.length,u,l=0,c,d,p,A;e[e.length-1]==="="&&(o--,e[e.length-2]==="="&&o--);var h=new ArrayBuffer(o),v=new Uint8Array(h);for(u=0;u<s;u+=4)c=i[e.charCodeAt(u)],d=i[e.charCodeAt(u+1)],p=i[e.charCodeAt(u+2)],A=i[e.charCodeAt(u+3)],v[l++]=c<<2|d>>4,v[l++]=(d&15)<<4|p>>2,v[l++]=(p&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/QRQQASIAQQA2AgAgAEEAOgAEIABBADYCCCAAQQA2AgwgAEEANgIQIABBDTYCCCAAC0IBAX9BGRABIgBBADYCACAAQQA2AgQgAEEANgIIIABBADYCDCAAQQA2AhAgAEEANgIUIABBADoAGCAAQQA2AhAgAAu1AgEEf0HQABABIgBBADoAACAAQQA2AgQgAEEANgIIIABBADYCDCAAQQA2AhAgAEEAOgAUIABBADYCGCAAQQA2AhwgAEEANgIgIABBADYCJCAAQQA2AiggAEEANgIsIABBADYCMCAAQQA2AjQgAEEANgI4IABBADYCPCAAQQA2AkAgAEEANgJEIABBADYCSCAAQQA2AkxBBBAEIQIDQCABQQRIBEBBBhAHIQMgAigCACABQQJ0aiADNgIIIAFBAWohAQwBCwsgACACNgIkIABBBBAHNgIoIABB8wAQBjYCLCAAQcABEAY2AjAgAEEMEAY2AjQgAEEMEAY2AjggAEEMEAY2AjwgAEEMEAY2AkAgAEHAARAGNgJEIAAQCDYCSCAAEAg2AkwgABAJNgIEIAAQCjYCCCAACx8BAX9BCBABIgBBADYCACAAQQA2AgQgABALNgIAIAALCgAjACQBEAwkAwthAQF/IAFB+P///wNLBEBBAEHAAEEXQSIQAAALIAEQAiICQQhqIAEQAyAARQRAQQwQASEACyAAQQA2AgAgAEEANgIEIABBADYCCCAAIAI2AgAgAEEAN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IMAQsLIAEoAigoAgBBASQEEBgaIAEoAixBASQEEBgaIAAoAjBBASQEEBgaIAAoAjRBASQEEBgaIAAoAjhBASQEEBgaIAAoAjxBASQEEBgaIAAoAkBBASQEEBgaIAAoAkRBASQEEBgaIAAoAkgQGSAAKAJMEBkLyAwBA38DQCABQQNxIAIgAhsEQCAAIgRBAWohACABIgNBAWohASAEIAMtAAA6AAAgAkEBayECDAELCyAAQQNxRQRAA0AgAkEQTwRAIAAgASgCADYCACAAQQRqIAFBBGooAgA2AgAgAEEIaiABQQhqKAIANgIAIABBDGogAUEMaigCADYCACABQRBqIQEgAEEQaiEAIAJBEGshAgwBCwsgAkEIcQRAIAAgASgCADYCACAAQQRqIAFBBGooAgA2AgAgAUEIaiEBIABBCGohAAsgAkEEcQRAIAAgASgCADYCACABQQRqIQEgAEEEaiEACyACQQJxBEAgACABLwEAOwEAIAFBAmohASAAQQJqIQALIAJBAXEEQCAAIAEtAAA6AAALDwsgAkEgTwRAAkACQAJAIABBA3EiA0EBRwRAIANBAkYNASADQQNGDQIMAwsgASgCACEFIAAgASIDLQAAOgAAIABBAWoiASABIANBAWoiAS0AADoAAEEBaiIEQQFqIQAgAUEBaiIDQQFqIQEgBCADLQAAOgAAIAJBA2shAgNAIAJBEU8EQCAAIAFBAWooAgAiA0EIdCAFQRh2cjYCACAAQQRqIAFBBWooAgAiBUEIdCADQRh2cjYCACAAQQhqIAFBCWooAgAiA0EIdCAFQRh2cjYCACAAQQxqIAFBDWooAgAiBUEIdCADQRh2cjYCACABQRBqIQEgAEEQaiEAIAJBEGshAgwBCwsMAgsgASgCACEFIAAgAS0AADoAACAAQQFqIgRBAWohACABQQFqIgNBAWohASAEIAMtAAA6AAAgAkECayECA0AgAkESTwRAIAAgAUECaigCACIDQRB0IAVBEHZyNgIAIABBBGogAUEGaigCACIFQRB0IANBEHZyNgIAIABBCGogAUEKaigCACIDQRB0IAVBEHZyNgIAIABBDGogAUEOaigCACIFQRB0IANBEHZyNgIAIAFBEG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CBCACKAIAQQJqaiADQQVuIgM6AAggAigCBCACKAIAQQNqaiAFOgAIIAQgBzYCDCAEIAM2AhAgBCAFOgAUIARBADYCHEEAIQIDQAJAIAJBBE8NACAEIAQoAhwgBigCBCAGKAIAIAJBAWpqai0ACCACQQN0dHI2AhwgAkEBaiECDAELCyAEIAQoAhw2AhggBCgCGEGAIEkEQCAEQYAgNgIYC0EAIQJBACEFQQAhAwNAAkAgA0EITg0AIAYgA0EFahARQf8BcSIEQf8BRwRAQQEhBQsgBCADQQN0dCACciECIANBAWohAwwBCwsgACgCACAFRToAACAAKAIAKAIEIAE2AgAgACgCABAWAkAgACgCACAFIAIQICIBQQFGDQAgAUEDRwRAIAFBAkYEQCAFBEAgACgCACgCCCgCECACRw0DCwUMAgsLIAAoAgAoAgQtAAQaQQFBACAAKAIAKAIIKAIQIAAoAgAoAggoAgQQIQ8LQQBBAUEAQQAQIQsIACMDIAAQIgsWAEG4ASQAIwAkAUGAgIAIJAIQDCQDCwMAAQsLtwEEAEEICxcKAAAAdQBzAGUAIABzAHQAcgBpAGMAdABBIAsdDQAAAH4AbABpAGIALwBhAHIAcgBhAHkALgB0AHMAQcAACzkbAAAAfgBsAGkAYgAvAGkAbgB0AGUAcgBuAGEAbAAvAHQAeQBwAGUAZABhAHIAcgBhAHkALgB0AHMAQYABCzMYAAAAcwByAGMALwBsAHoAbQBhAC8AbAB6AG0AYQAtAGQAZQBjAG8AZABlAHIALgB0AHM=";return n(t)}function zh(n,t,e){try{var r={data:t,offset:0,readByte:function(){return this.data[this.offset++]}},i=r.data.length,a={data:[],offset:0,writeByte:function(u){var l=Math.floor(this.offset/i);this.data[l]||(this.data[l]=new Uint8Array(i)),this.data[l][this.offset%i]=u,this.offset++}};n.decompressFile(r,a);for(var o=new Uint8Array(a.offset),s=0;s<a.offset;s++)o[s]=a.data[Math.floor(s/i)][s%i];e(null,o)}catch(u){e(u)}}function Uh(n,t,e){var r=24;try{var i=new WebAssembly.Memory({initial:16}),a=new WebAssembly.Module(n),o=new WebAssembly.Instance(a,{env:{memory:i,abort:function(){e(new Error("webAssembly abort"))}}}),s=o.exports,u=s.newU8Array(t.length),l=new Uint8Array(i.buffer,u+r,t.length);l.set(t);var c=s.decode(u),d=new Uint32Array(i.buffer,c,4),p=d[0],A=d[2],h=d[3];p?e(null,new Uint8Array(i.buffer,h+r,A).slice(0,A)):e(new Error("lzma deocder error"))}catch(v){e(v)}}var Qh=`
|
|
883
|
+
`,Ws="KHR_texture_basisu",wh=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadTexture=function(e,r){var i=r.json.textures[e];if(!i.extensions||!i.extensions[Ws])return null;var a=i.extensions[Ws],o=r.json.images[a.source],s=null;if(o.bufferView!==void 0)s=r.loadBufferView(o.bufferView).then(function(u){return si.parse(u)});else if(o.uri)s=r.options.fetcher.ajax(r.resolveResouce(o.uri),{responseType:"arraybuffer"}).then(function(u){return si.parse(u.body)});else throw new Error("glTF: Invalid image defs.");return s},t}(Tr),Zs="KHR_texture_transform",Eh=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.extendTexture=function(e,r,i){var a=r.extensions!==void 0?r.extensions[Zs]:void 0;return a?(a.texCoord!==void 0&&console.warn('glTF: Custom UV sets in "'+Zs+'" extension not yet supported.'),a.offset===void 0&&a.rotation===void 0&&a.scale===void 0||(e=e.clone(),e.needsUpdate=!0,a.offset!==void 0&&e.offset.fromArray(a.offset),a.rotation!==void 0&&(e.rotation=a.rotation),a.scale!==void 0&&e.repeat.fromArray(a.scale)),e):null},t}(Tr),Sh=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(Tr),Mh=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(Tr),Na=function(){var n="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q;iekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq:78Yqdbk:qzezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9UhlaicefhodnadTmbalc;WFbGglcjdalcjd6EhDcbhqinaqae9pmeaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxdndndndnalc9WGgmTmbcbhPcehsawcjdfhzaohHinaraH9Rax6midnaraHaxfgo9RcK6mbczhlinalgic9Wfglawcj;cbffhOdndndndndnaHalco4fRbbalci4coG4ciGPlbedibkaO9cb83ibaOcwf9cb83ibxikaOaoRblaoRbbgAco4glalciSgCE86bbawcj;cbfaifglcGfaoclfaCfgORbbaAcl4ciGgCaCciSgCE86bbalcVfaOaCfgORbbaAcd4ciGgCaCciSgCE86bbalc7faOaCfgORbbaAciGgAaAciSgAE86bbalctfaOaAfgARbbaoRbegOco4gCaCciSgCE86bbalc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc93faAaCfgARbbaOciGgOaOciSgOE86bbalc94faAaOfgARbbaoRbdgOco4gCaCciSgCE86bbalc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc97faAaCfgARbbaOciGgOaOciSgOE86bbalc98faAaOfgORbbaoRbigoco4gAaAciSgAE86bbalc99faOaAfgORbbaocl4ciGgAaAciSgAE86bbalc9:faOaAfgORbbaocd4ciGgAaAciSgAE86bbalcufaOaAfglRbbaociGgoaociSgoE86bbalaofhoxdkaOaoRbwaoRbbgAcl4glalcsSgCE86bbawcj;cbfaifglcGfaocwfaCfgORbbaAcsGgAaAcsSgAE86bbalcVfaOaAfgORbbaoRbegAcl4gCaCcsSgCE86bbalc7faOaCfgORbbaAcsGgAaAcsSgAE86bbalctfaOaAfgORbbaoRbdgAcl4gCaCcsSgCE86bbalc91faOaCfgORbbaAcsGgAaAcsSgAE86bbalc4faOaAfgORbbaoRbigAcl4gCaCcsSgCE86bbalc93faOaCfgORbbaAcsGgAaAcsSgAE86bbalc94faOaAfgORbbaoRblgAcl4gCaCcsSgCE86bbalc95faOaCfgORbbaAcsGgAaAcsSgAE86bbalc96faOaAfgORbbaoRbvgAcl4gCaCcsSgCE86bbalc97faOaCfgORbbaAcsGgAaAcsSgAE86bbalc98faOaAfgORbbaoRbogAcl4gCaCcsSgCE86bbalc99faOaCfgORbbaAcsGgAaAcsSgAE86bbalc9:faOaAfgORbbaoRbrgocl4gAaAcsSgAE86bbalcufaOaAfglRbbaocsGgoaocsSgoE86bbalaofhoxekaOao8Pbb83bbaOcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaiczfhlarao9RcL0mekkaiam6miaoTmidnakTmbawaPfRbbhOawcj;cbfhlazhiakhHinaialRbbgAce4cbaAceG9R7aOfgO86bbaiadfhialcefhlaHcufgHmbkkazcefhzaPcefgPad6hsaohHaPad9hmexvkkcbhoasceGmdxikaoaxad2fhPdnakTmbcbhmcehsawcjdfhCinarao9Rax6miaoTmdaoaxfhoawamfRbbhOawcj;cbfhlaChiakhHinaialRbbgAce4cbaAceG9R7aOfgO86bbaiadfhialcefhlaHcufgHmbkaCcefhCamcefgmad6hsamad9hmbkaPhoxikcbhlcehsinarao9Rax6mdaoTmeaoaxfhoalcefglad6hsadal9hmbkaPhoxdkcbhoasceGTmekc9:hoxikabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekcbc99arao9Radcaadca0ESEhokavcj;ebf8Kjjjjbaok;xzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfalaDcu7gPcl4fcsGcitfgsydlhzasydbhHdnaDcsGgDak9pmbavaiaPfcsGcdtfydbaxaDEhsaDThDdndnadcd9hmbabarcetfgPaH87ebaPcdfaz87ebaPclfas87ebxekabarcdtfgPaHBdbaPclfazBdbaPcwfasBdbkaxaDfhxavc;abfalcitfgPasBdbaPazBdlavaicdtfasBdbavc;abfalcefcsGglcitfgPaHBdbaPasBdlaiaDfhialcefhlxdkdndnaDcsSmbamaDfaDc987fcefhmxekaocefhDao8SbbgscFeGhPdndnascu9mmbaDhoxekaocvfhoaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhokaPce4cbaPceG9R7amfhmkdndnadcd9hmbabarcetfgDaH87ebaDcdfaz87ebaDclfam87ebxekabarcdtfgDaHBdbaDclfazBdbaDcwfamBdbkavc;abfalcitfgDamBdbaDazBdlavaicdtfamBdbavc;abfalcefcsGglcitfgDaHBdbaDamBdlaicefhialcefhlxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHcdfaD87ebaHclfas87ebxekabarcdtfgHaxBdbaHclfaDBdbaHcwfasBdbkavaicdtfaxBdbavc;abfalcitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfalcefcsGcitfgHasBdbaHaDBdlavaiaPfcsGgicdtfasBdbavc;abfalcdfcsGglcitfgDaxBdbaDasBdlalcefhlaiaOfhiazaOfhxxekaxcbaoRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbaocefhDxekaocdfhDao8SbegPcFeGhsdnaPcu9kmbaocofhAascFbGhscrhodninaD8SbbgPcFbGaotasVhsaPcu9kmeaDcefhDaocrfgoc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbgocFeGhPdnaocu9kmbaDcvfhzaPcFbGhPcrhodninas8SbbgDcFbGaotaPVhPaDcu9kmeascefhsaocrfgoc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashoxekascefhoas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninao8SbbgscFbGaDtaPVhPascu9kmeaocefhoaDcrfgDc8J9hmbkaOhoxekaocefhokaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDcdfaz87ebaDclfaO87ebxekabarcdtfgDaABdbaDclfazBdbaDcwfaOBdbkavc;abfalcitfgDazBdbaDaABdlavaicdtfaABdbavc;abfalcefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfalcdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiarcifgrae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;siliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabavcefciGaiVcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:Ohkxekcjjjj94hkkabavcdfciGaiVcetfak87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:Ohqxekcjjjj94hqkabavcufciGaiVcetfaq87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohqxekcjjjj94hqkabavciGaiVcetfaq87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj;8ifcjjj98G::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklz9Kbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q;Aekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq;a9tqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk;d8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhwcbhDinaDae9pmeawaeaD9RaDawfae6Egqcsfgoc9WGgkci2hxakcethmaocl4cifcd4hPabaDad2fhscbhzdnincehHalhOcbhAdninaraO9RaP6miavcj;cbfaAak2fhCaOaPfhlcbhidnakc;ab6mbaral9Rc;Gb6mbcbhoinaCaofhidndndndndnaOaoco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklbalczfhlkdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklzalczfhlkdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklaalczfhlkdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalclfaYpQbfaXc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalcwfaYpQbfaXc:q:yjjbfRbbfhlxekaialpbbbpkl8Walczfhlkaoc;abfhiaocjefak0meaihoaral9Rc;Fb0mbkkdndnaiak9pmbaici4hoinaral9RcK6mdaCaifhXdndndndndnaOaico4fRbbaocoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpklbxikaXalpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaXalpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaXalpbbbpklbalczfhlkaocdfhoaiczfgiak6mbkkalTmbaAci6hHalhOaAcefgAclSmdxekkcbhlaHceGmdkdnakTmbavcjdfazfhiavazfpbdbhYcbhXinaiavcj;cbfaXfgopblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLaoakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEaoamfpblbg3cep9Ta3aQp9op9Hp9rg3aoaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfhiaXczfgXak6mbkkazclfgzad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfhDc9:hoalmexikkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk;tzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfalaDcu7gPcl4fcsGcitfgsydlhzasydbhHdnaDcsGgDak9pmbavaiaPfcsGcdtfydbaxaDEhsaDThDdndnadcd9hmbabarcetfgPaH87ebaPcdfaz87ebaPclfas87ebxekabarcdtfgPaHBdbaPclfazBdbaPcwfasBdbkaxaDfhxavc;abfalcitfgPasBdbaPazBdlavaicdtfasBdbavc;abfalcefcsGglcitfgPaHBdbaPasBdlaiaDfhialcefhlxdkdndnaDcsSmbamaDfaDc987fcefhmxekaocefhDao8SbbgscFeGhPdndnascu9mmbaDhoxekaocvfhoaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhokaPce4cbaPceG9R7amfhmkdndnadcd9hmbabarcetfgDaH87ebaDcdfaz87ebaDclfam87ebxekabarcdtfgDaHBdbaDclfazBdbaDcwfamBdbkavc;abfalcitfgDamBdbaDazBdlavaicdtfamBdbavc;abfalcefcsGglcitfgDaHBdbaDamBdlaicefhialcefhlxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHcdfaD87ebaHclfas87ebxekabarcdtfgHaxBdbaHclfaDBdbaHcwfasBdbkavaicdtfaxBdbavc;abfalcitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfalcefcsGcitfgHasBdbaHaDBdlavaiaPfcsGgicdtfasBdbavc;abfalcdfcsGglcitfgDaxBdbaDasBdlalcefhlaiaOfhiazaOfhxxekaxcbaoRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbaocefhDxekaocdfhDao8SbegPcFeGhsdnaPcu9kmbaocofhAascFbGhscrhodninaD8SbbgPcFbGaotasVhsaPcu9kmeaDcefhDaocrfgoc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbgocFeGhPdnaocu9kmbaDcvfhzaPcFbGhPcrhodninas8SbbgDcFbGaotaPVhPaDcu9kmeascefhsaocrfgoc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashoxekascefhoas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninao8SbbgscFbGaDtaPVhPascu9kmeaocefhoaDcrfgDc8J9hmbkaOhoxekaocefhokaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDcdfaz87ebaDclfaO87ebxekabarcdtfgDaABdbaDclfazBdbaDcwfaOBdbkavc;abfalcitfgDazBdbaDaABdlavaicdtfaABdbavc;abfalcefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfalcdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiarcifgrae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:wPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalae9pmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oawaopmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalae9pmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oawaopmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalae9pmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepkbbadczfhdaeclfgeav6mbkkdnaval9pmbaialciGgecdtgdVcbc;abad9R;8kbaiabavcdtfgvad;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepklbkavaiad;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz9Tbb",e=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),r=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var i=WebAssembly.validate(e)?t:n,a,o=WebAssembly.instantiate(s(i),{}).then(function(m){a=m.instance,a.exports.__wasm_call_ctors()});function s(m){for(var y=new Uint8Array(m.length),b=0;b<m.length;++b){var x=m.charCodeAt(b);y[b]=x>96?x-97:x>64?x-39:x+4}for(var w=0,b=0;b<m.length;++b)y[w++]=y[b]<60?r[y[b]]:(y[b]-60)*64+y[++b];return y.buffer.slice(0,w)}function u(m,y,b,x,w,E){var S=a.exports.sbrk,C=b+3&-4,R=S(C*x),B=S(w.length),M=new Uint8Array(a.exports.memory.buffer);M.set(w,B);var I=m(R,b,x,B,w.length);if(I==0&&E&&E(R,C,x),y.set(M.subarray(R,R+b*x)),S(R-S(0)),I!=0)throw new Error("Malformed buffer data: "+I)}var l={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},c={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},d=[],p=0;function A(m){var y={object:new Worker(m),pending:0,requests:{}};return y.object.onmessage=function(b){var x=b.data;y.pending-=x.count,y.requests[x.id][x.action](x.value),delete y.requests[x.id]},y}function h(m){for(var y="var instance; var ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(s(i))+"]), {}).then(function(result) { instance = result.instance; instance.exports.__wasm_call_ctors(); });self.onmessage = workerProcess;"+u.toString()+g.toString(),b=new Blob([y],{type:"text/javascript"}),x=URL.createObjectURL(b),w=0;w<m;++w)d[w]=A(x);URL.revokeObjectURL(x)}function v(m,y,b,x,w){for(var E=d[0],S=1;S<d.length;++S)d[S].pending<E.pending&&(E=d[S]);return new Promise(function(C,R){var B=new Uint8Array(b),M=p++;E.pending+=m,E.requests[M]={resolve:C,reject:R},E.object.postMessage({id:M,count:m,size:y,source:B,mode:x,filter:w},[B.buffer])})}function g(m){o.then(function(){var y=m.data;try{var b=new Uint8Array(y.count*y.size);u(a.exports[y.mode],b,y.count,y.size,y.source,a.exports[y.filter]),self.postMessage({id:y.id,count:y.count,action:"resolve",value:b},[b.buffer])}catch(x){self.postMessage({id:y.id,count:y.count,action:"reject",value:x})}})}return{ready:o,supported:!0,useWorkers:function(m){h(m)},decodeVertexBuffer:function(m,y,b,x,w){u(a.exports.meshopt_decodeVertexBuffer,m,y,b,x,a.exports[l[w]])},decodeIndexBuffer:function(m,y,b,x){u(a.exports.meshopt_decodeIndexBuffer,m,y,b,x)},decodeIndexSequence:function(m,y,b,x){u(a.exports.meshopt_decodeIndexSequence,m,y,b,x)},decodeGltfBuffer:function(m,y,b,x,w,E){u(a.exports[c[w]],m,y,b,x,a.exports[l[E]])},decodeGltfBufferAsync:function(m,y,b,x,w){return d.length>0?v(m,y,b,c[x],l[w]):o.then(function(){var E=new Uint8Array(m*y);return u(a.exports[c[x]],E,m,y,b,a.exports[l[w]]),E})}}}(),za="EXT_meshopt_compression",Ch=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadBufferView=function(e,r){var i=r.json,a=i.bufferViews[e];if(a.extensions&&a.extensions[za]){var o=a.extensions[za],s=r.loadBuffer(o.buffer);if(!Na.supported){if(i.extensionsRequired&&i.extensionsRequired.indexOf(za)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([s,Na.ready]).then(function(u){var l=u[0],c=o.byteOffset||0,d=o.byteLength||0,p=o.count,A=o.byteStride,h=new ArrayBuffer(p*A),v=new Uint8Array(l,c,d);return Na.decodeGltfBuffer(new Uint8Array(h),p,A,v,o.mode,o.filter),h})}else return null},t}(Tr),Ys="EXT_texture_webp",Ih=function(n){ue(t,n);function t(){var e=n!==null&&n.apply(this,arguments)||this;return e.supportsWep=!1,e}return t.prototype.prepare=function(e){var r=this;return cu().then(function(i){r.supportsWep=i.webp})},t.prototype.loadTexture=function(e,r){var i=r.json,a=i.textures[e];if(!a.extensions||!a.extensions[Ys]||!this.supportsWep)return null;var o=a.extensions[Ys];return r.loadImage(o.source).then(function(s){var u=new f.Texture(s);u.needsUpdate=!0,u.flipY=!1,a.name&&(u.name=a.name);var l=r.json.samplers||{},c=l[a.sampler]||{};return u.magFilter=ta[c.magFilter]||f.LinearFilter,u.minFilter=ta[c.minFilter]||f.LinearMipmapLinearFilter,u.wrapS=ra[c.wrapS]||f.RepeatWrapping,u.wrapT=ra[c.wrapT]||f.RepeatWrapping,u.onUpdate=function(){s.close()},u})},t}(Tr),Ua="CESIUM_RTC",Th=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.emitResult=function(e,r){if(r.json.extensions[Ua]&&r.json.extensions[Ua].center){var i=r.json.extensions[Ua].center;e.CESIUM_RTC={center:new f.Vector3().fromArray(i)}}},t}(Tr),Ph=function(n){ue(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadMesh=function(e,r){var i=this,a=r.json.meshes[e],o=a.primitives,s=Promise.all(o.map(function(c){return r.loadGeometry(c)})),u=Promise.all(o.map(function(c){return i.loadPBMMaterial(c,r)})),l=Promise.all([s,u]).then(function(c){for(var d=c[0],p=c[1],A=[],h=0;h<o.length;h++){var v=o[h],g=d[h],m=p[h];g.attributes.normal===void 0&&(m.flatShading=!0),g.attributes.tangent===void 0&&m.normalScale&&(m.normalScale.y*=-1);var y=v.mode||Qe.TRIANGLES,b=void 0;if(y===Qe.TRIANGLES||y===Qe.TRIANGLE_STRIP||y===Qe.TRIANGLE_FAN)if(y===Qe.TRIANGLE_STRIP?g=r.toGeometryTrianglesDrawMode(g,f.TriangleStripDrawMode):y===Qe.TRIANGLE_FAN&&(g=r.toGeometryTrianglesDrawMode(g,f.TriangleFanDrawMode)),g.clearGroups(),g.addGroup(0,g.index?g.index.count:g.attributes.position.count,0),r.disposeSet.add(g),a.isSkinnedMesh){var x=new hu(g,[m]);g.attributes.skinWeight.normalized||x.normalizeSkinWeights(),b=x}else b=new kt(g,[m]);else if(y===Qe.POINTS)b=new mr(g,m);else throw new Error("glTF: Primitive mode unsupported: "+y);if(Object.keys(g.morphAttributes).length>0){if(a.weights!==void 0)for(var w=0,E=a.weights.length;w<E;w++)b.morphTargetInfluences[w]=a.weights[w];if(a.extras&&Array.isArray(a.extras.targetNames)){var S=a.extras.targetNames;if(b.morphTargetInfluences.length===S.length){b.morphTargetDictionary={};for(var w=0,E=S.length;w<E;w++)b.morphTargetDictionary[S[w]]=w}else console.warn("glTF: Invalid extras.targetNames length. Ignoring names.")}}b.name=r.createUniqueName(a.name||"mesh_"+e),A.push(b)}if(A.length===1)return A[0];for(var C=new f.Group,R=0,B=A;R<B.length;R++){var b=B[R];C.add(b)}return C});return l},t.prototype.loadPBMMaterial=function(e,r){var i,a=(i=e.mode)!==null&&i!==void 0?i:Qe.TRIANGLES,o=null;if(a===Qe.TRIANGLES||a===Qe.TRIANGLE_STRIP||a===Qe.TRIANGLE_FAN)o=this.loadPBMMeshMaterial(e,r);else if(a===Qe.POINTS)o=this.loadPBMPointCloudMaterial(e,r);else throw new Error("glTF: Primitive mode unsupported: "+a);return o},t.prototype.extendTexture=function(e,r,i){return e.minFilter=f.LinearFilter,e.magFilter=f.LinearFilter,e.generateMipmaps=!1,e},t.prototype.loadPBMPointCloudMaterial=function(e,r){var i=new Mi;return Object.keys(e.attributes).filter(function(a){return Kt[a]==="normal"}).length>0&&(i.defines.USE_POINT_NORMAL=!0),r.disposeSet.add(i),Promise.resolve(i)},t.prototype.loadPBMMeshMaterial=function(e,r){var i=[],a=new Ar("basic");if(a.color=new f.Color(1,1,1),Object.keys(e.attributes).filter(function(c){return Kt[c]==="color"}).length>0&&(a.vertexColors=!0),Object.keys(e.attributes).filter(function(c){return Kt[c]==="tangent"}).length===0&&(a.normalScale&&(a.normalScale.y*=-1),a.clearcoatNormalScale&&(a.clearcoatNormalScale.y*=-1)),e.material!==void 0){var o=r.json.materials[e.material];o.name&&(a.name=o.name);var s=o.pbrMetallicRoughness||{};if(Array.isArray(s.baseColorFactor)){var u=s.baseColorFactor;a.color=new f.Color().fromArray(u)}if(s.baseColorTexture!==void 0&&i.push(r.createMaterialTexture(s.baseColorTexture).then(function(c){r.disposeSet.add(c),c.encoding=f.sRGBEncoding,a.map=c})),o.doubleSided===!0&&(a.side=f.DoubleSide),o.normalTexture!==void 0&&(i.push(r.createMaterialTexture(o.normalTexture).then(function(c){r.disposeSet.add(c),a.normalMap=c})),a.normalScale=new f.Vector2(1,1),o.normalTexture.scale!==void 0)){var l=o.normalTexture.scale;a.normalScale.set(l,l)}}return r.disposeSet.add(a),Promise.all(i).then(function(){return a.refreshUniforms(),a})},t}(Tr),pn={KHR_binary_glTF:lh,KHR_draco_mesh_compression:dh,KHR_texture_basisu:wh,KHR_texture_transform:Eh,KHR_mesh_quantization:Sh,KHR_materials_unlit:Mh,EXT_meshopt_compression:Ch,EXT_texture_webp:Ih,CESIUM_RTC:Th,PBM_mesh:Ph};function Jo(n,t){var e,r,i,a={};if(t.addonExtensions)for(var o=0,s=t.addonExtensions;o<s.length;o++){var u=s[o];u in pn&&(a[u]=new pn[u])}var l,c;if(typeof n=="string")c=n;else{var d=pn.KHR_binary_glTF.getMagic(n);if(d===pn.KHR_binary_glTF.HEADER_MAGIC){l=new pn.KHR_binary_glTF;try{l.loadGlbBinary(n)}catch(m){return Promise.reject(m)}a.KHR_binary_glTF=l,c=l.content}else c=ea(new Uint8Array(n))}var p=JSON.parse(c);if(p.asset===void 0||Number(p.asset.version[0])<2)return Promise.reject(new Error("glTF: Unsupported asset. glTF versions >=2.0 are supported."));if(p.extensionsUsed)for(var A=p.extensionsRequired||[],h=0;h<p.extensionsUsed.length;h++){var v=p.extensionsUsed[h];a[v]||(pn[v]?a[v]=new pn[v]:A.indexOf(v)>=0&&console.warn('glTF: Unknown extension "'+v+'".'))}var g=new uh(p,a,{copyUV2:(e=t.copyUV2)!==null&&e!==void 0?e:!0,resourcePath:(r=t.resourcePath)!==null&&r!==void 0?r:"",search:(i=t.search)!==null&&i!==void 0?i:"",fetcher:t.fetcher});return g.parse().then(function(m){return l&&l.clear(),m})}var Rh=new f.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function Gu(n,t){var e,r;t===void 0&&(t={});var i=(e=t.upAxis)!==null&&e!==void 0?e:"Y",a=(r=t.fetcher)!==null&&r!==void 0?r:new Qt({allowHosts:["*"]}),o={uri:n,gltfUpAxis:i};return Promise.resolve().then(function(){return a.ajax(n,{responseType:"arraybuffer"}).then(function(s){return s.body})}).then(function(s){return Promise.resolve(0).then(function(u){return Uu(o,s,u)}).then(function(u){return Hu(o,s,u)}).then(function(u){return ah(o,s,u)})}).then(function(){var s;return Jo(o.gltfArrayBuffer,{copyUV2:!1,addonExtensions:["PBM_mesh"],resourcePath:n.slice(0,n.lastIndexOf("/")+1),search:(s=n.split("?")[1])!==null&&s!==void 0?s:"",fetcher:a}).then(function(u){var l=new f.Matrix4;i==="Y"&&l.premultiply(Rh);var c=new f.Matrix4().setPosition(o.rtcCenter[0],o.rtcCenter[1],o.rtcCenter[2]);if(l.premultiply(c),u.CESIUM_RTC){var d=new f.Matrix4().setPosition(u.CESIUM_RTC.center);l.premultiply(d)}var p=u.scene;return p.applyMatrix4(l),delete o.featureTableBinary,delete o.batchTableBinary,delete o.gltfArrayBuffer,{type:"b3dm",upAxis:"Z",uri:o.uri,byteLength:o.byteLength,scene:p,textures:u.textures,dispose:function(){return u.dispose()}}})})}const Ku="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2Z1bmN0aW9uIEIoYSl7b25tZXNzYWdlPWZ1bmN0aW9uKHIpe1Byb21pc2UucmVzb2x2ZShyLmRhdGEpLnRoZW4oZnVuY3Rpb24obil7cmV0dXJuIGEobil9KS50aGVuKGZ1bmN0aW9uKG4pe3ZhciBlPW4ub3V0cHV0LHQ9bi50cmFuc2ZlcjtyZXR1cm4gcG9zdE1lc3NhZ2UoZSx0KX0pLmNhdGNoKGZ1bmN0aW9uKG4pe3JldHVybiBwb3N0TWVzc2FnZSh7JCRlcnJvcjpufSl9KX19dmFyIHUseTsoZnVuY3Rpb24oYSl7YVthLkJZVEU9NTEyMF09IkJZVEUiLGFbYS5VTlNJR05FRF9CWVRFPTUxMjFdPSJVTlNJR05FRF9CWVRFIixhW2EuU0hPUlQ9NTEyMl09IlNIT1JUIixhW2EuVU5TSUdORURfU0hPUlQ9NTEyM109IlVOU0lHTkVEX1NIT1JUIixhW2EuSU5UPTUxMjRdPSJJTlQiLGFbYS5VTlNJR05FRF9JTlQ9NTEyNV09IlVOU0lHTkVEX0lOVCIsYVthLkZMT0FUPTUxMjZdPSJGTE9BVCIsYVthLkRPVUJMRT01MTMwXT0iRE9VQkxFIn0pKHl8fCh5PXt9KSk7dmFyIGM9KHU9e30sdVt5LkRPVUJMRV09RmxvYXQ2NEFycmF5LHVbeS5GTE9BVF09RmxvYXQzMkFycmF5LHVbeS5VTlNJR05FRF9TSE9SVF09VWludDE2QXJyYXksdVt5L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VEX0JZVEUsMiksbj1yLmxlbmd0aC8yLGU9bmV3IEludDhBcnJheShuKjQpLHQ9MCx2PXZvaWQgMCxBPXZvaWQgMCxOPXZvaWQgMCxFPXZvaWQgMCxTPXZvaWQgMCxzPXZvaWQgMCxUPXZvaWQgMDt0PG47dCsrKXY9dCoyLEE9clt2XSpELTEsTj1yWysrdl0qRC0xLFM9QTwwPy1BOkEscz1OPDA/LU46TixFPTEtKFMrcyksRTwwJiYoQT0oMS1zKSooQTwwPy0xOjEpLE49KDEtUykqKE48MD8tMToxKSksVD1NYXRoLnNxcnQoQSpBK04qTitFKkUpLHY9dCo0LGVbdl09QS9UKmgsZVsrK3ZdPU4vVCpoLGVbKyt2XT1FL1QqaDtyZXR1cm57YXJyYXk6ZSxpdGVtU2l6ZTo0LG5vcm1hbGl6ZWQ6ITB9fXJldHVybiBudWxsfX0pKCk7Cg==",Bh=n=>Uint8Array.from(atob(n),t=>t.charCodeAt(0)),$s=typeof self!="undefined"&&self.Blob&&new Blob([Bh(Ku)],{type:"text/javascript;charset=utf-8"});function Fh(n){let t;try{if(t=$s&&(self.URL||self.webkitURL).createObjectURL($s),!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,"+Ku,{name:n==null?void 0:n.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var Lh=new ku(function(){return new Fh},2);function kh(n,t,e){var r=new Qu(n.featureTableJson,n.featureTableBinary);return Promise.resolve().then(function(){var i=r.getExtension("3DTILES_draco_point_compression");return i?Oh(i,r):Lh.postMessage({featureTableBinary:r.buffer,featureTableJson:r.json},[r.buffer.buffer])}).then(function(i){return n.attributes=i,e})}function Oh(n,t){return sa(this,void 0,void 0,function(){var e,r,i,a,o,s;return ua(this,function(u){if(e=n.properties||{},r=n.byteOffset,i=n.byteLength,!e||!Number.isFinite(r)||!i)throw new Error("Draco properties, byteOffset, and byteLength must be defined");return a=t.buffer.slice(r,r+i),o=n.properties,s={POSITION:"Float32Array",NORMAL:"Float32Array",RGB:"Uint8Array",RGBA:"Uint8Array"},[2,na.decodeGeometry(a.buffer,{attributeIDs:o,attributeTypes:s,useUniqueIDs:!0}).then(function(l){var c=l.getAttribute("POSITION"),d=l.getAttribute("RGB"),p=l.getAttribute("RGBA"),A=l.getAttribute("NORMAL"),h;if(p)h=p;else if(d){for(var v=d.count,g=d.array,m=new Uint8Array(v*4),y=0,b=void 0,x=void 0;y<v;y++)x=y*4,b=y*3,m[x]=g[b],m[++x]=g[++b],m[++x]=g[++b];h=new f.BufferAttribute(m,4,d.normalized)}return{position:c?{array:c.array,itemSize:c.itemSize,normalized:c.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 _u(n,t){var e;t===void 0&&(t={});var r=(e=t.fetcher)!==null&&e!==void 0?e:new Qt({allowHosts:["*"]}),i={uri:n};return Promise.resolve().then(function(){return r.ajax(n,{responseType:"arraybuffer"}).then(function(a){return a.body})}).then(function(a){return Promise.resolve(0).then(function(o){return Uu(i,a,o)}).then(function(o){return Hu(i,a,o)}).then(function(o){return kh(i,a,o)})}).then(function(){var a;return Dh(i.attributes,{computeBoundingBox:(a=t.computeBoundingBox)!==null&&a!==void 0?a:!0})}).then(function(a){var o=new f.Matrix4,s=new f.Matrix4().setPosition(i.rtcCenter[0],i.rtcCenter[1],i.rtcCenter[2]);return o.premultiply(s),a.object.applyMatrix4(o),delete i.gltfArrayBuffer,delete i.featureTableBinary,delete i.batchTableBinary,{type:"pnts",upAxis:"Z",uri:i.uri,byteLength:i.byteLength,scene:a.object,textures:[],dispose:function(){return a.dispose()}}})}function Dh(n,t){var e=new Set,r=new f.BufferGeometry;e.add(r);var i=new Mi;e.add(i),n.position&&r.setAttribute("position",new f.BufferAttribute(n.position.array,n.position.itemSize,n.position.normalized)),n.color&&r.setAttribute("color",new f.BufferAttribute(n.color.array,n.color.itemSize,n.color.normalized)),n.normal&&(r.setAttribute("normal",new f.BufferAttribute(n.normal.array,n.normal.itemSize,n.normal.normalized)),i.defines.USE_POINT_NORMAL=!0),t.computeBoundingBox&&r.computeBoundingBox();var a=new mr(r,i);return a.matrix.compose(a.position,a.quaternion,a.scale),a.matrixAutoUpdate=!1,a.frustumCulled=!1,Promise.resolve({object:a,dispose:function(){e.forEach(function(o){o.dispose()}),e.clear()}})}function ju(){var n={};return n.OutWindow=function(){this._windowSize=0},n.OutWindow.prototype.create=function(t){(!this._buffer||this._windowSize!==t)&&(this._buffer=[]),this._windowSize=t,this._pos=0,this._streamPos=0},n.OutWindow.prototype.flush=function(){var t=this._pos-this._streamPos;if(t!==0){for(;t--;)this._stream.writeByte(this._buffer[this._streamPos++]);this._pos>=this._windowSize&&(this._pos=0),this._streamPos=this._pos}},n.OutWindow.prototype.releaseStream=function(){this.flush(),this._stream=null},n.OutWindow.prototype.setStream=function(t){this.releaseStream(),this._stream=t},n.OutWindow.prototype.init=function(t){t||(this._streamPos=0,this._pos=0)},n.OutWindow.prototype.copyBlock=function(t,e){var r=this._pos-t-1;for(r<0&&(r+=this._windowSize);e--;)r>=this._windowSize&&(r=0),this._buffer[this._pos++]=this._buffer[r++],this._pos>=this._windowSize&&this.flush()},n.OutWindow.prototype.putByte=function(t){this._buffer[this._pos++]=t,this._pos>=this._windowSize&&this.flush()},n.OutWindow.prototype.getByte=function(t){var e=this._pos-t-1;return e<0&&(e+=this._windowSize),this._buffer[e]},n.RangeDecoder=function(){},n.RangeDecoder.prototype.setStream=function(t){this._stream=t},n.RangeDecoder.prototype.releaseStream=function(){this._stream=null},n.RangeDecoder.prototype.init=function(){var t=5;for(this._code=0,this._range=-1;t--;)this._code=this._code<<8|this._stream.readByte()},n.RangeDecoder.prototype.decodeDirectBits=function(t){for(var e=0,r=t,i;r--;)this._range>>>=1,i=this._code-this._range>>>31,this._code-=this._range&i-1,e=e<<1|1-i,this._range&4278190080||(this._code=this._code<<8|this._stream.readByte(),this._range<<=8);return e},n.RangeDecoder.prototype.decodeBit=function(t,e){var r=t[e],i=(this._range>>>11)*r;return(this._code^2147483648)<(i^2147483648)?(this._range=i,t[e]+=2048-r>>>5,this._range&4278190080||(this._code=this._code<<8|this._stream.readByte(),this._range<<=8),0):(this._range-=i,this._code-=i,t[e]-=r>>>5,this._range&4278190080||(this._code=this._code<<8|this._stream.readByte(),this._range<<=8),1)},n.initBitModels=function(t,e){for(;e--;)t[e]=1024},n.BitTreeDecoder=function(t){this._models=[],this._numBitLevels=t},n.BitTreeDecoder.prototype.init=function(){n.initBitModels(this._models,1<<this._numBitLevels)},n.BitTreeDecoder.prototype.decode=function(t){for(var e=1,r=this._numBitLevels;r--;)e=e<<1|t.decodeBit(this._models,e);return e-(1<<this._numBitLevels)},n.BitTreeDecoder.prototype.reverseDecode=function(t){for(var e=1,r=0,i=0,a;i<this._numBitLevels;++i)a=t.decodeBit(this._models,e),e=e<<1|a,r|=a<<i;return r},n.reverseDecode2=function(t,e,r,i){for(var a=1,o=0,s=0,u;s<i;++s)u=r.decodeBit(t,e+a),a=a<<1|u,o|=u<<s;return o},n.LenDecoder=function(){this._choice=[],this._lowCoder=[],this._midCoder=[],this._highCoder=new n.BitTreeDecoder(8),this._numPosStates=0},n.LenDecoder.prototype.create=function(t){for(;this._numPosStates<t;++this._numPosStates)this._lowCoder[this._numPosStates]=new n.BitTreeDecoder(3),this._midCoder[this._numPosStates]=new n.BitTreeDecoder(3)},n.LenDecoder.prototype.init=function(){var t=this._numPosStates;for(n.initBitModels(this._choice,2);t--;)this._lowCoder[t].init(),this._midCoder[t].init();this._highCoder.init()},n.LenDecoder.prototype.decode=function(t,e){return t.decodeBit(this._choice,0)===0?this._lowCoder[e].decode(t):t.decodeBit(this._choice,1)===0?8+this._midCoder[e].decode(t):16+this._highCoder.decode(t)},n.Decoder2=function(){this._decoders=[]},n.Decoder2.prototype.init=function(){n.initBitModels(this._decoders,768)},n.Decoder2.prototype.decodeNormal=function(t){var e=1;do e=e<<1|t.decodeBit(this._decoders,e);while(e<256);return e&255},n.Decoder2.prototype.decodeWithMatchByte=function(t,e){var r=1,i,a;do if(i=e>>7&1,e<<=1,a=t.decodeBit(this._decoders,(1+i<<8)+r),r=r<<1|a,i!==a){for(;r<256;)r=r<<1|t.decodeBit(this._decoders,r);break}while(r<256);return r&255},n.LiteralDecoder=function(){},n.LiteralDecoder.prototype.create=function(t,e){var r;if(!(this._coders&&this._numPrevBits===e&&this._numPosBits===t))for(this._numPosBits=t,this._posMask=(1<<t)-1,this._numPrevBits=e,this._coders=[],r=1<<this._numPrevBits+this._numPosBits;r--;)this._coders[r]=new n.Decoder2},n.LiteralDecoder.prototype.init=function(){for(var t=1<<this._numPrevBits+this._numPosBits;t--;)this._coders[t].init()},n.LiteralDecoder.prototype.getDecoder=function(t,e){return this._coders[((t&this._posMask)<<this._numPrevBits)+((e&255)>>>8-this._numPrevBits)]},n.Decoder=function(){this._outWindow=new n.OutWindow,this._rangeDecoder=new n.RangeDecoder,this._isMatchDecoders=[],this._isRepDecoders=[],this._isRepG0Decoders=[],this._isRepG1Decoders=[],this._isRepG2Decoders=[],this._isRep0LongDecoders=[],this._posSlotDecoder=[],this._posDecoders=[],this._posAlignDecoder=new n.BitTreeDecoder(4),this._lenDecoder=new n.LenDecoder,this._repLenDecoder=new n.LenDecoder,this._literalDecoder=new n.LiteralDecoder,this._dictionarySize=-1,this._dictionarySizeCheck=-1,this._posSlotDecoder[0]=new n.BitTreeDecoder(6),this._posSlotDecoder[1]=new n.BitTreeDecoder(6),this._posSlotDecoder[2]=new n.BitTreeDecoder(6),this._posSlotDecoder[3]=new n.BitTreeDecoder(6)},n.Decoder.prototype.setDictionarySize=function(t){return t<0?!1:(this._dictionarySize!==t&&(this._dictionarySize=t,this._dictionarySizeCheck=Math.max(this._dictionarySize,1),this._outWindow.create(Math.max(this._dictionarySizeCheck,4096))),!0)},n.Decoder.prototype.setLcLpPb=function(t,e,r){var i=1<<r;return t>8||e>4||r>4?!1:(this._literalDecoder.create(e,t),this._lenDecoder.create(i),this._repLenDecoder.create(i),this._posStateMask=i-1,!0)},n.Decoder.prototype.init=function(){var t=4;for(this._outWindow.init(!1),n.initBitModels(this._isMatchDecoders,192),n.initBitModels(this._isRep0LongDecoders,192),n.initBitModels(this._isRepDecoders,12),n.initBitModels(this._isRepG0Decoders,12),n.initBitModels(this._isRepG1Decoders,12),n.initBitModels(this._isRepG2Decoders,12),n.initBitModels(this._posDecoders,114),this._literalDecoder.init();t--;)this._posSlotDecoder[t].init();this._lenDecoder.init(),this._repLenDecoder.init(),this._posAlignDecoder.init(),this._rangeDecoder.init()},n.Decoder.prototype.decode=function(t,e,r){var i=0,a=0,o=0,s=0,u=0,l=0,c=0,d,p,A,h,v,g;for(this._rangeDecoder.setStream(t),this._outWindow.setStream(e),this.init();r<0||l<r;)if(d=l&this._posStateMask,this._rangeDecoder.decodeBit(this._isMatchDecoders,(i<<4)+d)===0)p=this._literalDecoder.getDecoder(l++,c),i>=7?c=p.decodeWithMatchByte(this._rangeDecoder,this._outWindow.getByte(a)):c=p.decodeNormal(this._rangeDecoder),this._outWindow.putByte(c),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)+d)===0&&(i=i<7?9:11,A=1):(this._rangeDecoder.decodeBit(this._isRepG1Decoders,i)===0?h=o:(this._rangeDecoder.decodeBit(this._isRepG2Decoders,i)===0?h=s:(h=u,u=s),s=o),o=a,a=h),A===0&&(A=2+this._repLenDecoder.decode(this._rangeDecoder,d),i=i<7?8:11);else if(u=s,s=o,o=a,A=2+this._lenDecoder.decode(this._rangeDecoder,d),i=i<7?7:10,v=this._posSlotDecoder[A<=5?A-2:3].decode(this._rangeDecoder),v>=4){if(g=(v>>1)-1,a=(2|v&1)<<g,v<14)a+=n.reverseDecode2(this._posDecoders,a-v-1,this._rangeDecoder,g);else if(a+=this._rangeDecoder.decodeDirectBits(g-4)<<4,a+=this._posAlignDecoder.reverseDecode(this._rangeDecoder),a<0){if(a===-1)break;return!1}}else a=v;if(a>=l||a>=this._dictionarySizeCheck)return!1;this._outWindow.copyBlock(a,A),l+=A,c=this._outWindow.getByte(0)}return this._outWindow.flush(),this._outWindow.releaseStream(),this._rangeDecoder.releaseStream(),!0},n.Decoder.prototype.setDecoderProperties=function(t){var e,r,i,a,o;return t.size<5||(e=t.readByte(),r=e%9,e=~~(e/9),i=e%5,a=~~(e/5),!this.setLcLpPb(r,i,a))?!1:(o=t.readByte(),o|=t.readByte()<<8,o|=t.readByte()<<16,o+=t.readByte()*16777216,this.setDictionarySize(o))},n.decompress=function(t,e,r,i){var a=new n.Decoder;if(!a.setDecoderProperties(t))throw"Incorrect stream properties";if(!a.decode(e,r,i))throw"Error in data stream";return!0},n.decompressFile=function(t,e){var r=new n.Decoder,i;if(!r.setDecoderProperties(t))throw"Incorrect stream properties";if(i=t.readByte(),i|=t.readByte()<<8,i|=t.readByte()<<16,i+=t.readByte()*16777216,t.readByte(),t.readByte(),t.readByte(),t.readByte(),!r.decode(t,e,i))throw"Error in data stream";return!0},n}var Vh=ju();function Nh(){function n(e){for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(256),a=0;a<r.length;a++)i[r.charCodeAt(a)]=a;var o=e.length*.75,s=e.length,u,l=0,c,d,p,A;e[e.length-1]==="="&&(o--,e[e.length-2]==="="&&o--);var h=new ArrayBuffer(o),v=new Uint8Array(h);for(u=0;u<s;u+=4)c=i[e.charCodeAt(u)],d=i[e.charCodeAt(u+1)],p=i[e.charCodeAt(u+2)],A=i[e.charCodeAt(u+3)],v[l++]=c<<2|d>>4,v[l++]=(d&15)<<4|p>>2,v[l++]=(p&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/QRQQASIAQQA2AgAgAEEAOgAEIABBADYCCCAAQQA2AgwgAEEANgIQIABBDTYCCCAAC0IBAX9BGRABIgBBADYCACAAQQA2AgQgAEEANgIIIABBADYCDCAAQQA2AhAgAEEANgIUIABBADoAGCAAQQA2AhAgAAu1AgEEf0HQABABIgBBADoAACAAQQA2AgQgAEEANgIIIABBADYCDCAAQQA2AhAgAEEAOgAUIABBADYCGCAAQQA2AhwgAEEANgIgIABBADYCJCAAQQA2AiggAEEANgIsIABBADYCMCAAQQA2AjQgAEEANgI4IABBADYCPCAAQQA2AkAgAEEANgJEIABBADYCSCAAQQA2AkxBBBAEIQIDQCABQQRIBEBBBhAHIQMgAigCACABQQJ0aiADNgIIIAFBAWohAQwBCwsgACACNgIkIABBBBAHNgIoIABB8wAQBjYCLCAAQcABEAY2AjAgAEEMEAY2AjQgAEEMEAY2AjggAEEMEAY2AjwgAEEMEAY2AkAgAEHAARAGNgJEIAAQCDYCSCAAEAg2AkwgABAJNgIEIAAQCjYCCCAACx8BAX9BCBABIgBBADYCACAAQQA2AgQgABALNgIAIAALCgAjACQBEAwkAwthAQF/IAFB+P///wNLBEBBAEHAAE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AhAgNAIAJBBEkEQCACIAEoAiQoAgAiAygCAEECdkkEfyACQQJ0IANqKAIIBQALKAIAQQEkBBAYGiACQQFqIQIMAQsLIAEoAigoAgBBASQEEBgaIAEoAixBASQEEBgaIAAoAjBBASQEEBgaIAAoAjRBASQEEBgaIAAoAjhBASQEEBgaIAAoAjxBASQEEBgaIAAoAkBBASQEEBgaIAAoAkRBASQEEBgaIAAoAkgQGSAAKAJMEBkLyAwBA38DQCABQQNxIAIgAhsEQCAAIgRBAWohACABIgNBAWohASAEIAMtAAA6AAAgAkEBayECDAELCyAAQQNxRQRAA0AgAkEQTwRAIAAgASgCADYCACAAQQRqIAFBBGooAgA2AgAgAEEIaiABQQhqKAIANgIAIABBDGogAUEMaigCADYCACABQRBqIQEgAEEQaiEAIAJBEGshAgwBCwsgAkEIcQRAIAAgASgCADYCACAAQQRqIAFBBGooAgA2AgAgAUEIaiEBIABBCGohAAsgAkEEcQRAIAAgASgCADYCACABQQRqIQEgAEEEaiEACyACQQJxBEAgACABLwEAOwEAIAFBAmohASAAQQJqIQALIAJBAXEEQCAAIAEtAAA6AAALDwsgAkEgTwRAAkACQAJAIABBA3EiA0EBRwRAIANBAkYNASADQQNGDQIMAwsgASgCACEFIAAgASIDLQAAOgAAIABBAWoiASABIANBAWoiAS0AADoAAEEBaiIEQQFqIQAgAUEBaiIDQQFqIQEgBCADLQAAOgAAIAJBA2shAgNAIAJBEU8EQCAAIAFBAWooAgAiA0EIdCAFQRh2cjYCACAAQQRqIAFBBWooAgAiBUEIdCADQRh2cjYCACAAQQhqIAFBCWooAgAiA0EIdCAFQRh2cjYCACAAQQxqIAFBDWooAgAiBUEIdCADQRh2cjYCACABQRBqIQEgAEEQaiEAIAJBEGshAgwBCwsMAgsgASgCACEFIAAgAS0AADoAACAAQQFqIgRBAWohACABQQFqIgNBAWohASAEIAMtAAA6AAAgAkECayECA0AgAkESTwRAIAAgAUECaigCACIDQRB0IAVBEHZyNgIAIABBBGogAUEGaigCACIFQRB0IAN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AsgAigCBCACKAIAQQFqaiADQf8BcUEJcCIHOgAIIAIoAgQgAigCAGogA0H/AXFBCW4iAzoACCADQQVwIQUgAigCBCACKAIAQQJqaiADQQVuIgM6AAggAigCBCACKAIAQQNqaiAFOgAIIAQgBzYCDCAEIAM2AhAgBCAFOgAUIARBADYCHEEAIQIDQAJAIAJBBE8NACAEIAQoAhwgBigCBCAGKAIAIAJBAWpqai0ACCACQQN0dHI2AhwgAkEBaiECDAELCyAEIAQoAhw2AhggBCgCGEGAIEkEQCAEQYAgNgIYC0EAIQJBACEFQQAhAwNAAkAgA0EITg0AIAYgA0EFahARQf8BcSIEQf8BRwRAQQEhBQsgBCADQQN0dCACciECIANBAWohAwwBCwsgACgCACAFRToAACAAKAIAKAIEIAE2AgAgACgCABAWAkAgACgCACAFIAIQICIBQQFGDQAgAUEDRwRAIAFBAkYEQCAFBEAgACgCACgCCCgCECACRw0DCwUMAgsLIAAoAgAoAgQtAAQaQQFBACAAKAIAKAIIKAIQIAAoAgAoAggoAgQQIQ8LQQBBAUEAQQAQIQsIACMDIAAQIgsWAEG4ASQAIwAkAUGAgIAIJAIQDCQDCwMAAQsLtwEEAEEICxcKAAAAdQBzAGUAIABzAHQAcgBpAGMAdABBIAsdDQAAAH4AbABpAGIALwBhAHIAcgBhAHkALgB0AHMAQcAACzkbAAAAfgBsAGkAYgAvAGkAbgB0AGUAcgBuAGEAbAAvAHQAeQBwAGUAZABhAHIAcgBhAHkALgB0AHMAQYABCzMYAAAAcwByAGMALwBsAHoAbQBhAC8AbAB6AG0AYQAtAGQAZQBjAG8AZABlAHIALgB0AHM=";return n(t)}function zh(n,t,e){try{var r={data:t,offset:0,readByte:function(){return this.data[this.offset++]}},i=r.data.length,a={data:[],offset:0,writeByte:function(u){var l=Math.floor(this.offset/i);this.data[l]||(this.data[l]=new Uint8Array(i)),this.data[l][this.offset%i]=u,this.offset++}};n.decompressFile(r,a);for(var o=new Uint8Array(a.offset),s=0;s<a.offset;s++)o[s]=a.data[Math.floor(s/i)][s%i];e(null,o)}catch(u){e(u)}}function Uh(n,t,e){var r=24;try{var i=new WebAssembly.Memory({initial:16}),a=new WebAssembly.Module(n),o=new WebAssembly.Instance(a,{env:{memory:i,abort:function(){e(new Error("webAssembly abort"))}}}),s=o.exports,u=s.newU8Array(t.length),l=new Uint8Array(i.buffer,u+r,t.length);l.set(t);var c=s.decode(u),d=new Uint32Array(i.buffer,c,4),p=d[0],A=d[2],h=d[3];p?e(null,new Uint8Array(i.buffer,h+r,A).slice(0,A)):e(new Error("lzma deocder error"))}catch(v){e(v)}}var Qh=`
|
|
884
884
|
var decodeLZMA = (function() {
|
|
885
885
|
var LZMA = (`.concat(ju.toString(),`)();
|
|
886
886
|
return function(data, callback) {
|
|
@@ -925,13 +925,13 @@ self.onmessage = function(event) {
|
|
|
925
925
|
}
|
|
926
926
|
postMessage({ id: packet.id, error: "type never matched." });
|
|
927
927
|
};
|
|
928
|
-
`),bo=typeof Worker!="undefined"&&typeof Blob!="undefined",Ju="";if(bo)try{var qh=new Blob([Qh],{type:"text/javascript"});Ju=URL.createObjectURL(qh)}catch(n){}var Xu=function(){function n(){var t=this;if(!bo)throw new Error("LZMAWorker cannot work in this broswer.");this.callCounter=0,this.requests={};var e=this.worker=new Worker(Ju);e.onmessage=function(r){var i=r.data,a=i.id,o=i.result,s=i.error,u=t.getKey(a);t.requests[u]&&(s?t.requests[u](new Error(s)):t.requests[u](null,o),delete t.requests[u])},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=bo,n}();function e0(n){return Array.prototype.reduce.call(n,function(t,e,r){return t|e<<r*8},0)}function Hh(n){for(var t=[],e=n.length,r=function(o){var s={data:n[o],offset:0,readByte:function(){return this.data[this.offset++]}},u=s.data.length,l={data:[],offset:0,writeByte:function(d){var p=Math.floor(this.offset/u);this.data[p]||(this.data[p]=new Uint8Array(u)),this.data[p][this.offset%u]=d,this.offset++}};Vh.decompressFile(s,l),i=new Uint8Array(l.offset);for(var c=0;c<l.offset;c++)i[c]=l.data[Math.floor(c/u)][c%u];t.push(i)},i,a=0;a<e;a++)r(a);return t}function Gh(n){for(var t=[],e=n.length,r=function(a){t.push(new Promise(function(o,s){var u=new Xu;u.decompress(n[a],function(l,c){if(u.terminate(),l)return s(l);o(c)})}))},i=0;i<e;i++)r(i);return Promise.all(t)}function Wu(n){var t=new Uint8Array(n),e=e0(t.slice(0,4));if(e>10)return Promise.reject(new Error("LZMA got too many sub chunks."));for(var r=[],i=[],a=4+e*4,o=0;o<e;o++)i[o]=e0(t.slice(4+o*4,8+o*4)),o===e-1?r[o]=t.subarray(a,a+i[o]):r[o]=t.slice(a,a+i[o]),a+=i[o];return Xu.support?Gh(r):Promise.resolve(Hh(r))}var Qa=!1,Zu=[];function Yu(n){if(n===void 0&&(n=!1),!(!n&&Qa)){Qa=!0;var t=Zu.shift();if(t){try{t()}catch(e){}Et.shared.add(function(){return Yu(!0)},!0,2,-100)}else Qa=!1}}function ia(n){return new Promise(function(t,e){var r=function(){try{t(n())}catch(i){e(i)}};Zu.push(r),Et.shared.add(function(){return Yu()},!0,2,-100)})}function rr(n,t){for(var e={},r=0,i=t;r<i.length;r++){var a=i[r];a in n&&(e[a]=n[a])}return e}function Kh(n,t){for(var e=O({},n),r=0,i=t;r<i.length;r++){var a=i[r];a in e&&delete e[a]}return e}const ln=sn.Reader,vr=sn.util,nr=sn.roots["@REALSEE/FIVE:five/loaders/model/parsers/protobuf/pbm.proto"]||(sn.roots["@REALSEE/FIVE:five/loaders/model/parsers/protobuf/pbm.proto"]={}),$u=nr.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=vr.emptyArray,n.prototype.createAt=vr.Long?vr.Long.fromBits(0,0,!0):0,n.prototype.description="",n.decode=function(e,r){e instanceof ln||(e=ln.create(e));let i=r===void 0?e.len:e.pos+r,a=new nr.Model;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.chunks&&a.chunks.length||(a.chunks=[]),a.chunks.push(nr.Chunk.decode(e,e.uint32()));break}case 2:{a.createAt=e.uint64();break}case 3:{a.description=e.string();break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Model"},n})();nr.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 ln||(e=ln.create(e));let i=r===void 0?e.len:e.pos+r,a=new nr.Chunk;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.vertices=nr.Vertices.decode(e,e.uint32());break}case 2:{a.faces=nr.Faces.decode(e,e.uint32());break}case 3:{a.name=e.string();break}case 4:{a.texture=e.string();break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("vertices"))throw vr.ProtocolError("missing required 'vertices'",{instance:a});if(!a.hasOwnProperty("faces"))throw vr.ProtocolError("missing required 'faces'",{instance:a});if(!a.hasOwnProperty("name"))throw vr.ProtocolError("missing required 'name'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Chunk"},n})();nr.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=vr.emptyArray,n.prototype.uvs=vr.emptyArray,n.prototype.marks=vr.emptyArray,n.decode=function(e,r){e instanceof ln||(e=ln.create(e));let i=r===void 0?e.len:e.pos+r,a=new nr.Vertices;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.xyz&&a.xyz.length||(a.xyz=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.xyz.push(e.float())}else a.xyz.push(e.float());break}case 2:{if(a.uvs&&a.uvs.length||(a.uvs=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.uvs.push(e.float())}else a.uvs.push(e.float());break}case 3:{if(a.marks&&a.marks.length||(a.marks=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.marks.push(e.int32())}else a.marks.push(e.int32());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Vertices"},n})();nr.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=vr.emptyArray,n.prototype.normals=vr.emptyArray,n.decode=function(e,r){e instanceof ln||(e=ln.create(e));let i=r===void 0?e.len:e.pos+r,a=new nr.Faces;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.indices&&a.indices.length||(a.indices=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.indices.push(e.uint32())}else a.indices.push(e.uint32());break}case 2:{if(a.normals&&a.normals.length||(a.normals=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.normals.push(e.float())}else a.normals.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Faces"},n})();nr.VertexMark=(()=>{const n={},t=Object.create(n);return t[n[0]="VERTEX_MARK_UNSPECIFIED"]=0,t[n[1]="VERTEX_MARK_ROOF"]=1,t})();function el(n,t){var e,r,i,a;t===void 0&&(t={});var o=(e=t.fetcher)!==null&&e!==void 0?e:new Qt({allowHosts:["*"]}),s={byteLength:0},u=Wo((r=t.textureOptions)!==null&&r!==void 0?r:{},(a=(i=t.textureArray)===null||i===void 0?void 0:i.length)!==null&&a!==void 0?a:0),l={};if(t.textureArray)for(var c=0,d=t.textureArray;c<d.length;c++){var p=d[c];l[p]=Xo(p,u,o)}return Promise.resolve().then(function(){return o.ajax(n,{responseType:"arraybuffer"})}).then(function(A){return s.byteLength=A.body.byteLength,ia(function(){var h=new Uint8Array(A.body);return $u.decode(h)})}).then(function(A){return ia(function(){var h,v;return rl(A,(h=t.textureBaseUri)!==null&&h!==void 0?h:function(){var g=n.lastIndexOf("/");if(g>=0){var m=n.slice(0,g)+"/";return/\/model\/$/.test(m)&&(m=m.replace(/\/model\/$/,"/materials/")),m}return""}(),((v=t.textureArray)!==null&&v!==void 0?v:[]).slice(),u,l,o)})}).then(function(A){var h=new f.Group;h.matrixAutoUpdate=!1,h.matrix.compose(h.position,h.quaternion,h.scale),h.name=n;for(var v=0,g=A.objects;v<g.length;v++){var m=g[v];h.add(m)}return{type:"pbm",upAxis:"Z",uri:n,byteLength:s.byteLength,scene:h,textures:A.textures,dispose:function(){return A.dispose()}}})}function tl(n){var t=n.match(/(group|floor)-?(\d+)/);return t?parseInt(t[2],10):0}function xo(n){var t=n.match(/(chunk)-?(\d+)/);return t?parseInt(t[2],10):0}function _h(n){var t=n.match(/(sub)-?(\d+)/);return t?parseInt(t[2],10):0}function t0(n){var t=tl(n.name),e=xo(n.name),r=_h(n.name);return t*1e6+e*1e3+r}function jh(n){for(var t,e,r,i=typeof n.createAt=="number"?n.createAt:0,a=(t=n.description)!==null&&t!==void 0?t:"",o=[],s=!0,u=!0,l=0,c=n.chunks;l<c.length;l++){var d=c[l];if(!d.vertices.marks||d.vertices.marks.length===0){u=!1;break}}for(var p=0,A=n.chunks;p<A.length;p++){var d=A[p];if(!d.faces.normals||d.faces.normals.length===0){s=!1;break}}for(var h=n.chunks.sort(function(ie,xe){return t0(ie)-t0(xe)}),v=[],g=0,m=h;g<m.length;g++){var d=m[g],y=tl(d.name);v[y]||(v[y]=[]),v[y].push(d)}for(var b=0;b<v.length;b++){var x=v[b];if(x)if(s){for(var w=0,E=0;E<x.length;E++){var d=x[E];w+=d.faces.indices.length}for(var S=new Float32Array(w*3),C=new Float32Array(w*2),R=new Float32Array(w*3),B=u?new Float32Array(w):void 0,M=[],I=[1/0,1/0,1/0,-1/0,-1/0,-1/0],L=0,T=0;T<x.length;T++){for(var F=[1/0,1/0,1/0,-1/0,-1/0,-1/0],d=x[T],D=d.vertices.xyz,V=d.vertices.uvs,z=d.faces.indices,Q=d.faces.normals,q=d.vertices.marks,G=z.length,E=0;E<G;E++){var K=z[E],j=S[L*3+E*3]=D[K*3],J=S[L*3+E*3+1]=D[K*3+1],W=S[L*3+E*3+2]=D[K*3+2];B&&(B[L+E]=q[K]),C[L*2+E*2]=V[K*2],C[L*2+E*2+1]=V[K*2+1];var $=Math.floor(E/3)*3;R[L*3+E*3]=Q[$],R[L*3+E*3+1]=Q[$+1],R[L*3+E*3+2]=Q[$+2],j<F[0]&&(F[0]=j),J<F[1]&&(F[1]=J),W<F[2]&&(F[2]=W),j>F[3]&&(F[3]=j),J>F[4]&&(F[4]=J),W>F[5]&&(F[5]=W)}F[0]<I[0]&&(I[0]=F[0]),F[1]<I[1]&&(I[1]=F[1]),F[2]<I[2]&&(I[2]=F[2]),F[3]>I[3]&&(I[3]=F[3]),F[4]>I[4]&&(I[4]=F[4]),F[5]>I[5]&&(I[5]=F[5]),M.push({materialIndex:T,name:d.name,chunkName:xo(d.name),start:L,count:d.faces.indices.length,texture:(e=d.texture)!==null&&e!==void 0?e:void 0}),L+=G}var Y={createAt:i,description:a,vertices:S,uvs:C,normals:R,masks:B,indices:null,floorIndex:b,groups:M,extents:I};o.push(Y)}else{for(var w=0,Z=0,E=0;E<x.length;E++){var d=x[E];Z+=d.vertices.xyz.length/3,w+=d.faces.indices.length}for(var S=new Float32Array(Z*3),C=new Float32Array(Z*2),R=void 0,oe=new Float32Array(Z),ne=new Uint32Array(w),B=u?new Float32Array(w):void 0,M=[],I=[1/0,1/0,1/0,-1/0,-1/0,-1/0],de=0,L=0,T=0;T<x.length;T++){for(var F=[1/0,1/0,1/0,-1/0,-1/0,-1/0],d=x[T],D=d.vertices.xyz,se=d.vertices.marks,V=d.vertices.uvs,z=d.faces.indices,ye=D.length/3,G=z.length,E=0;E<ye;E++){var j=S[L*3+E*3]=D[E*3],J=S[L*3+E*3+1]=D[E*3+1],W=S[L*3+E*3+2]=D[E*3+2];B&&(B[L+E]=se[E]),C[L*2+E*2]=V[E*2],C[L*2+E*2+1]=V[E*2+1],oe[L+E]=b,j<F[0]&&(F[0]=j),J<F[1]&&(F[1]=J),W<F[2]&&(F[2]=W),j>F[3]&&(F[3]=j),J>F[4]&&(F[4]=J),W>F[5]&&(F[5]=W)}F[0]<I[0]&&(I[0]=F[0]),F[1]<I[1]&&(I[1]=F[1]),F[2]<I[2]&&(I[2]=F[2]),F[3]>I[3]&&(I[3]=F[3]),F[4]>I[4]&&(I[4]=F[4]),F[5]>I[5]&&(I[5]=F[5]);for(var E=0;E<G;E++)ne[de+E]=L+z[E];M.push({materialIndex:T,name:d.name,chunkName:xo(d.name),start:de,count:d.faces.indices.length,texture:(r=d.texture)!==null&&r!==void 0?r:void 0}),L+=ye,de+=G}var Y={createAt:i,description:a,vertices:S,uvs:C,normals:R,masks:B,indices:ne,floorIndex:b,groups:M,extents:I};o.push(Y)}}return o}function Xo(n,t,e){var r=O({key:"texture.pbm"},rr(t,["format","quality","size","sharpen","mappings"])),i=new Kn,a=i.loadTexture(n,{imageURL:{transform:t.transform,options:r},encoding:f.sRGBEncoding,wrapS:f.ClampToEdgeWrapping,wrapT:f.ClampToEdgeWrapping,minFilter:f.LinearFilter,maxSize:typeof r.size=="number"?new f.Vector2(r.size,r.size):void 0,fetcher:e}).then(function(o){var s=o.body;return s.needsUpdate=!0,s});return Object.assign(a,{url:n,textureOptions:t})}function rl(n,t,e,r,i,a){i===void 0&&(i={});for(var o=jh(n),s=0,u="",l=[],c={},d=new Set,p=0,A=o;p<A.length;p++){var h=A[p],v=h.createAt,g=h.description,m=h.vertices,y=h.masks,b=h.uvs,x=h.normals,w=h.indices,E=h.floorIndex,S=h.groups,C=h.extents,R=new f.Box3;R.min.x=C[0],R.min.y=C[1],R.min.z=C[2],R.max.x=C[3],R.max.y=C[4],R.max.z=C[5];var B=new f.BufferGeometry;B.setAttribute("position",new f.BufferAttribute(m,3)),B.setAttribute("uv",new f.BufferAttribute(b,2)),x&&B.setAttribute("normal",new f.BufferAttribute(x,3)),y&&B.setAttribute("mask",new f.BufferAttribute(y,1)),w&&B.setIndex(new f.BufferAttribute(w,1)),B.boundingBox=R,B.boundingSphere=R.getBoundingSphere(new f.Sphere);for(var M=0,I=S;M<I.length;M++){var L=I[M];B.addGroup(L.start,L.count,L.materialIndex)}d.add(B);for(var T=[],F=0,D=S;F<D.length;F++){var L=D[F],V=e[L.chunkName]||(L.texture?st(t||"",L.texture):void 0),z=new Ar("basic");z.floor=E,B.attributes.normal===void 0&&(z.flatShading=!0),B.attributes.mask&&(z.defines.USE_VERTEX_MARK=!0),T.push(z),V?c[V]?c[V].push(z):c[V]=[z]:z.color=new f.Color(16777215),d.add(z),z.refreshUniforms()}var Q=new kt(B,T);Q.name="model_floor_"+E,Q.userData.createAt=v,Q.userData.description=g,Q.matrix.compose(Q.position,Q.quaternion,Q.scale),Q.matrixAutoUpdate=!1,Q.frustumCulled=!1,s=v,u=g,l.push(Q)}var q=function(G){G=Wo(G,e.length);for(var K=[],j=function(Y){var Z=null;Y in i&&(Z=i[Y]),Z||(Z=Xo(Y,G,a)),K.push(Z.then(function(oe){for(var ne=0,de=c[Y];ne<de.length;ne++){var se=de[ne];se.map&&(d.delete(se.map),se.map.dispose()),se.map=oe,se.refreshUniforms(),d.add(oe)}return oe}).catch(function(){for(var oe=0,ne=c[Y];oe<ne.length;oe++){var de=ne[oe];de.map&&(d.delete(de.map),de.map.dispose()),de.map=null,de.color=new f.Color(16777215),de.refreshUniforms()}return null}))},J=0,W=Object.keys(c);J<W.length;J++){var $=W[J];j($)}for(var $ in i)delete i[$];return Promise.all(K).then(function(Y){return Y.filter(function(Z){return Z})})};return q(r).then(function(G){return{createAt:s,description:u,objects:l,textures:G,dispose:function(){d.forEach(function(K){K.dispose()}),d.clear()}}})}function Wo(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 nl(n,t){var e,r,i,a;t===void 0&&(t={});var o=(e=t.fetcher)!==null&&e!==void 0?e:new Qt({allowHosts:["*"]}),s={byteLength:0},u=Wo((r=t.textureOptions)!==null&&r!==void 0?r:{},(a=(i=t.textureArray)===null||i===void 0?void 0:i.length)!==null&&a!==void 0?a:0),l={};if(t.textureArray)for(var c=0,d=t.textureArray;c<d.length;c++){var p=d[c];l[p]=Xo(p,u,o)}return Promise.resolve().then(function(){return o.ajax(n,{responseType:"arraybuffer"})}).then(function(A){return Wu(A.body)}).then(function(A){return ia(function(){for(var h,v={chunks:[],createAt:void 0,description:void 0},g=0,m=A;g<m.length;g++){var y=m[g],b=$u.decode(y);b.chunks.length&&((h=v.chunks).push.apply(h,b.chunks),v.createAt=b.createAt,v.description=b.description)}return v})}).then(function(A){return ia(function(){var h,v,g;return rl(A,(h=t.textureBaseUri)!==null&&h!==void 0?h:function(){var m=n.lastIndexOf("/");if(m>=0){var y=n.slice(0,m)+"/";return/\/model\/$/.test(y)&&(y=y.replace(/\/model\/$/,"/materials/")),y}return""}(),((v=t.textureArray)!==null&&v!==void 0?v:[]).slice(),(g=t.textureOptions)!==null&&g!==void 0?g:{},l,o)})}).then(function(A){var h=new f.Group;h.name=n;for(var v=0,g=A.objects;v<g.length;v++){var m=g[v];h.add(m)}return{type:"at3d",upAxis:"Z",uri:n,byteLength:s.byteLength,scene:h,textures:A.textures,dispose:function(){return A.dispose()}}})}const nt=sn.Reader,mt=sn.util,De=sn.roots["@REALSEE/FIVE:five/loaders/model/parsers/protobuf/dome.proto"]||(sn.roots["@REALSEE/FIVE:five/loaders/model/parsers/protobuf/dome.proto"]={}),Jh=De.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=mt.emptyArray,n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Model;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.meshes&&a.meshes.length||(a.meshes=[]),a.meshes.push(De.Mesh.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Model"},n})();De.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=mt.emptyArray,n.prototype.matrix=mt.emptyArray,n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Mesh;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.name=e.string();break}case 2:{a.chunks&&a.chunks.length||(a.chunks=[]),a.chunks.push(De.Chunk.decode(e,e.uint32()));break}case 3:{a.matrix&&a.matrix.length||(a.matrix=[]),a.matrix.push(De.Matrix.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("name"))throw mt.ProtocolError("missing required 'name'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Mesh"},n})();De.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=mt.emptyArray,n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Matrix;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.elements&&a.elements.length||(a.elements=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.elements.push(e.float())}else a.elements.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Matrix"},n})();De.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=mt.emptyArray,n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Chunk;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 2:{a.geometry=De.Geometry.decode(e,e.uint32());break}case 3:{a.material&&a.material.length||(a.material=[]),a.material.push(De.Material.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("geometry"))throw mt.ProtocolError("missing required 'geometry'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Chunk"},n})();De.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=mt.emptyArray,n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Geometry;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.position=De.Position.decode(e,e.uint32());break}case 2:{a.uv=De.UV.decode(e,e.uint32());break}case 3:{a.uv2=De.UV.decode(e,e.uint32());break}case 4:{a.normal=De.Normal.decode(e,e.uint32());break}case 5:{a.groups&&a.groups.length||(a.groups=[]),a.groups.push(De.Group.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("position"))throw mt.ProtocolError("missing required 'position'",{instance:a});if(!a.hasOwnProperty("normal"))throw mt.ProtocolError("missing required 'normal'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Geometry"},n})();De.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=mt.emptyArray,n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Position;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.array&&a.array.length||(a.array=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.array.push(e.float())}else a.array.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Position"},n})();De.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=mt.emptyArray,n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.UV;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.array&&a.array.length||(a.array=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.array.push(e.float())}else a.array.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/UV"},n})();De.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=mt.emptyArray,n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Normal;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.array&&a.array.length||(a.array=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.array.push(e.float())}else a.array.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Normal"},n})();De.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 nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Group;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.start=e.uint32();break}case 2:{a.count=e.uint32();break}case 3:{a.materialIndex=e.uint32();break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("start"))throw mt.ProtocolError("missing required 'start'",{instance:a});if(!a.hasOwnProperty("count"))throw mt.ProtocolError("missing required 'count'",{instance:a});if(!a.hasOwnProperty("materialIndex"))throw mt.ProtocolError("missing required 'materialIndex'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Group"},n})();De.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 nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Material;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.kd=De.Color.decode(e,e.uint32());break}case 2:{a.ks=De.Color.decode(e,e.uint32());break}case 3:{a.ke=De.Color.decode(e,e.uint32());break}case 4:{a.mapkd=e.string();break}case 5:{a.mapks=e.string();break}case 6:{a.mapke=e.string();break}case 7:{a.norm=e.string();break}case 8:{a.mapbump=e.string();break}case 9:{a.bump=e.string();break}case 10:{a.mapd=e.string();break}case 11:{a.ns=e.float();break}case 12:{a.d=e.float();break}case 13:{a.tr=e.float();break}case 14:{a.mapkdrepeat=e.string();break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Material"},n})();De.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=mt.emptyArray,n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Color;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.rgb&&a.rgb.length||(a.rgb=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.rgb.push(e.float())}else a.rgb.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Color"},n})();var Xh=new f.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function il(n,t){var e;t===void 0&&(t={});var r=(e=t.fetcher)!==null&&e!==void 0?e:new Qt({allowHosts:["*"]}),i={byteLength:0};return Promise.resolve().then(function(){return r.ajax(n,{responseType:"arraybuffer"})}).then(function(a){var o;return i.byteLength=a.body.byteLength,al(new Uint8Array(a.body),t.textureBaseUri||"",(o=t.textureOptions)!==null&&o!==void 0?o:{},r)}).then(function(a){var o=new f.Group;o.matrixAutoUpdate=!1,o.applyMatrix4(Xh),o.matrix.compose(o.position,o.quaternion,o.scale),o.name=n;for(var s=0,u=a.objects;s<u.length;s++){var l=u[s];o.add(l)}return{type:"dome",upAxis:"Z",uri:n,byteLength:i.byteLength,scene:o,textures:a.textures,dispose:function(){return a.dispose()}}})}function Wh(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 Zh(n){var t=n.position,e=n.normal,r=n.uv,i=n.uv2,a=n.groups,o=new f.BufferGeometry;o.setAttribute("position",new f.BufferAttribute(new Float32Array(t.array),3)),e&&o.setAttribute("normal",new f.BufferAttribute(new Float32Array(e.array),3)),r&&o.setAttribute("uv",new f.BufferAttribute(new Float32Array(r.array),2)),i&&o.setAttribute("uv2",new f.BufferAttribute(new Float32Array(i.array),2));for(var s=0,u=a;s<u.length;s++){var l=u[s];o.addGroup(l.start,l.count,l.materialIndex)}return o}function Fn(n,t,e,r,i,a,o){if(o.hasOwnProperty(n))return o[n];n=n.split("?")[0],Ur(n)||(n=st(t,n)),n=n.replace(/\/\/vrlab-image\d*.ljcdn.com\//,"//vrlab-public.ljcdn.com/"),n.indexOf("//")===0&&(n="https:"+n);var s=O({key:"texture.dome",size:64},rr(e,["quality","format","sharpen","mappings"])),u=o[n]=i.loadTexture(n,{imageURL:{transform:e.transform,options:s},wrapS:f.RepeatWrapping,wrapT:f.RepeatWrapping,fetcher:a}).then(function(l){var c=l.body;return r&&c.repeat.copy(r),c.needsUpdate=!0,c.updateMatrix(),c});return u}function Yh(n,t,e,r,i,a,o,s){var u=[],l=new Ar("phong");if(o.add(l),n.kd&&(l.color=new f.Color().fromArray(n.kd.rgb).convertLinearToSRGB()),n.mapkd){var c=null;if(n.mapkdrepeat){var d=n.mapkdrepeat.split(/\s+/).map(function(v){return Number(v)}),p=d[0],A=d[1];c=new f.Vector2(p,A)}u.push(Fn(n.mapkd,t,e,c,r,i,a).then(function(v){v.encoding=f.sRGBEncoding,l.map=v,o.add(v),s.add(v),l.needsUpdate=!0}).catch(U))}if(n.ks&&(l.specular=new f.Color().fromArray(n.ks.rgb).convertLinearToSRGB()),n.mapks&&u.push(Fn(n.mapks,t,e,null,r,i,a).then(function(v){l.specularMap=v,o.add(v),s.add(v)}).catch(U)),n.ke&&(l.emissive=new f.Color().fromArray(n.ke.rgb).convertLinearToSRGB()),n.mapke&&u.push(Fn(n.mapke,t,e,null,r,i,a).then(function(v){v.encoding=f.sRGBEncoding,l.emissiveMap=v,o.add(v),s.add(v)}).catch(U)),n.norm&&u.push(Fn(n.norm,t,e,null,r,i,a).then(function(v){l.normalMap=v,o.add(v),s.add(v)}).catch(U)),n.mapbump&&u.push(Fn(n.mapbump,t,e,null,r,i,a).then(function(v){l.bumpMap=v,o.add(v),s.add(v)}).catch(U)),n.bump&&u.push(Fn(n.bump,t,e,null,r,i,a).then(function(v){l.bumpMap=v,o.add(v),s.add(v)}).catch(U)),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,l.refreshUniforms(),{material:l,textureReady:Promise.all(u).then(U)}}function $h(n){return Jh.decode(n).meshes}function al(n,t,e,r){for(var i=[],a=[],o=new Set,s=$h(n),u=new Kn,l=new f.Matrix4,c=new f.Vector3,d=new f.Quaternion,p=new f.Vector3,A={},h=new Set,v=0,g=s;v<g.length;v++){var m=g[v],y=m.name,b=m.chunks,x=m.matrix;if(!(y==="Ceiling"||y==="CeilingDrop"))for(var w=0,E=x;w<E.length;w++){var S=E[w];l.elements=S.elements;for(var C=new f.Group,R=0;R<b.length;R++){var B=Zh(b[R].geometry);B.applyMatrix4(l),l.decompose(c,d,p),p.x*p.y*p.z<0&&B.attributes.normal&&B.attributes.position&&B.attributes.uv&&Wh(B),o.add(B);for(var M=[],I=0,L=b[R].material;I<L.length;I++){var T=L[I],F=Yh(T,t||"",e,u,r,A,o,h),D=F.material,V=F.textureReady;a.push(V),M.push(D)}var z=new kt(B,M);z.name="chunk_"+R,z.matrix.compose(z.position,z.quaternion,z.scale),z.matrixAutoUpdate=!1,z.frustumCulled=!1,C.add(z)}C.name=y,i.push(C)}}return Promise.all(a).catch(U).then(function(){return{createAt:0,description:"",objects:i,textures:Array.from(h),dispose:function(){o.forEach(function(Q){Q.dispose()}),o.clear()}}})}var ep=new f.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function ol(n,t){var e;t===void 0&&(t={});var r=(e=t.fetcher)!==null&&e!==void 0?e:new Qt({allowHosts:["*"]}),i={byteLength:0};return Promise.resolve().then(function(){return r.ajax(n,{responseType:"arraybuffer"})}).then(function(a){return i.byteLength=a.body.byteLength,Wu(a.body)}).then(function(a){var o=a.reduce(function(l,c){return l+c.length},0),s=new Uint8Array(o),u=0;return a.forEach(function(l){s.set(l,u),u+=l.length}),s}).then(function(a){var o;return al(a,t.textureBaseUri||"",(o=t.textureOptions)!==null&&o!==void 0?o:{},r)}).then(function(a){var o=new f.Group;o.matrixAutoUpdate=!1,o.applyMatrix4(ep),o.matrix.compose(o.position,o.quaternion,o.scale),o.name=n;for(var s=0,u=a.objects;s<u.length;s++){var l=u[s];o.add(l)}return{type:"domez",upAxis:"Z",uri:n,byteLength:i.byteLength,scene:o,textures:a.textures,dispose:function(){return a.dispose()}}})}var tp=new f.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function sl(n,t){var e,r;t===void 0&&(t={});var i=(e=t.upAxis)!==null&&e!==void 0?e:"Y",a=(r=t.fetcher)!==null&&r!==void 0?r:new Qt({allowHosts:["*"]}),o=0;return Promise.resolve().then(function(){return a.ajax(n,{responseType:"arraybuffer"}).then(function(s){return o=s.body.byteLength,s.body})}).then(function(s){var u;return Jo(s,{copyUV2:!1,addonExtensions:["PBM_mesh"],resourcePath:n.slice(0,n.lastIndexOf("/")+1),search:(u=n.split("?")[1])!==null&&u!==void 0?u:"",fetcher:a})}).then(function(s){var u=new f.Matrix4;if(i==="Y"&&u.premultiply(tp),s.CESIUM_RTC){var l=new f.Matrix4().setPosition(s.CESIUM_RTC.center);u.premultiply(l)}var c=s.scene;return c.applyMatrix4(u),{type:"glb",upAxis:"Z",uri:n,byteLength:o,scene:c,textures:s.textures,dispose:function(){return s.dispose()}}})}var jn=new f.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]),Vt=new f.Color;function Zo(n,t){var e,r;t===void 0&&(t={});var i=(e=t.upAxis)!==null&&e!==void 0?e:"Z",a=(r=t.fetcher)!==null&&r!==void 0?r:new Qt({allowHosts:["*"]}),o=0;return Promise.resolve().then(function(){return a.ajax(n,{responseType:"arraybuffer"}).then(function(s){return o=s.body.byteLength,s.body})}).then(function(s){var u,l;return rp(s,{propertyNameMapping:(u=t.propertyNameMapping)!==null&&u!==void 0?u:{},customPropertyMapping:(l=t.customPropertyMapping)!==null&&l!==void 0?l:{}})}).then(function(s){var u=s.geometry;switch(t.type){case"geometry":{var l=u;return i==="Y"&&l.applyMatrix4(jn),{type:"ply",upAxis:"Z",uri:n,byteLength:o,scene:l,meta:{},textures:[],dispose:function(){u.dispose()}}}case"mesh":{var c="color"in u.attributes,d=new f.MeshBasicMaterial({vertexColors:c}),l=new f.Mesh(u,d);return i==="Y"&&l.applyMatrix4(jn),{type:"ply",upAxis:"Z",uri:n,byteLength:o,scene:l,meta:{},textures:[],dispose:function(){u.dispose(),d.dispose()}}}case"line":{var c="color"in u.attributes,p=new f.LineBasicMaterial({vertexColors:c}),l=new f.Line(u,p);return l.computeLineDistances(),i==="Y"&&l.applyMatrix4(jn),{type:"ply",upAxis:"Z",uri:n,byteLength:o,scene:l,meta:{},textures:[],dispose:function(){u.dispose(),p.dispose()}}}case"points":{var A=new f.PointsMaterial({}),l=new f.Points(u,A);return i==="Y"&&l.applyMatrix4(jn),{type:"ply",upAxis:"Z",uri:n,byteLength:o,scene:l,meta:{},textures:[],dispose:function(){u.dispose(),A.dispose()}}}case"pbmPointCloud":{var h=new Mi,l=new mr(u,h);return i==="Y"&&l.applyMatrix4(jn),{type:"ply",upAxis:"Z",uri:n,byteLength:o,scene:l,meta:{},textures:[],dispose:function(){u.dispose(),h.dispose()}}}}throw new Error("Invalid Type: ".concat(t.type))})}function rp(n,t){var e=new Uint8Array(n),r=cp(e),i=r.headerText,a=r.headerLength,o=ip(i,a,t);if(o.format==="ascii"){var s=new TextDecoder().decode(e);return{header:o,geometry:op(s,o,t)}}else return{header:o,geometry:lp(n,o,t)}}function np(n,t){var e={name:"",type:n[0]};return e.type==="list"?(e.name=n[3],e.countType=n[1],e.itemType=n[2]):e.name=n[1],e.name in t.propertyNameMapping&&(e.name=t.propertyNameMapping[e.name]),e}function ip(n,t,e){t===void 0&&(t=0);var r=/^ply([\s\S]*)end_header(\r\n|\r|\n)/,i="",a=r.exec(n);a!==null&&(i=a[1]);for(var o={format:"",version:"",comments:[],elements:[],headerLength:t,objInfo:""},s=i.split(/\r\n|\r|\n/),u=null,l=0;l<s.length;l++){var c=s[l];if(c=c.trim(),c!==""){var d=c.split(/\s+/),p=d.shift();switch(c=d.join(" "),p){case"format":o.format=d[0],o.version=d[1];break;case"comment":o.comments.push(c);break;case"element":u&&o.elements.push(u),u={name:d[0],count:parseInt(d[1]),properties:[]};break;case"property":u&&u.properties.push(np(d,e));break;case"obj_info":o.objInfo=c;break;default:console.log("unhandled",p,d)}}}return u&&o.elements.push(u),o}function qa(n,t){switch(t){case"char":case"uchar":case"short":case"ushort":case"int":case"uint":case"int8":case"uint8":case"int16":case"uint16":case"int32":case"uint32":return parseInt(n);case"float":case"double":case"float32":case"float64":return parseFloat(n);default:throw new Error("unspport type: "+t)}}function ap(n,t){for(var e={},r=0;r<n.length;r++){if(t.empty())return null;if(n[r].type==="list"){for(var i=[],a=qa(t.next(),n[r].countType),o=0;o<a;o++){if(t.empty())return null;i.push(qa(t.next(),n[r].itemType))}e[n[r].name]=i}else e[n[r].name]=qa(t.next(),n[r].type)}return e}function ul(n){for(var t={indices:[],vertices:[],normals:[],uvs:[],faceVertexUvs:[],colors:[],faceVertexColors:[]},e=0,r=Object.keys(n.customPropertyMapping);e<r.length;e++){var i=r[e];t[i]=[]}return t}function ll(n){var t=n.map(function(r){return r.name});function e(r){for(var i=0,a=r.length;i<a;i++){var o=r[i];if(t.includes(o))return o}return null}return{attrX:e(["x","px","posx"])||"x",attrY:e(["y","py","posy"])||"y",attrZ:e(["z","pz","posz"])||"z",attrNX:e(["nx","normalx"]),attrNY:e(["ny","normaly"]),attrNZ:e(["nz","normalz"]),attrS:e(["s","u","texture_u","tx"]),attrT:e(["t","v","texture_v","ty"]),attrR:e(["red","diffuse_red","r","diffuse_r"]),attrG:e(["green","diffuse_green","g","diffuse_g"]),attrB:e(["blue","diffuse_blue","b","diffuse_b"])}}function op(n,t,e){var r=ul(e),i=/end_header\s+(\S[\s\S]*\S|\S)\s*$/,a,o=null;(o=i.exec(n))!==null?a=o[1].split(/\s+/):a=[];var s=new fp(a);e:for(var u=0;u<t.elements.length;u++)for(var l=t.elements[u],c=ll(l.properties),d=0;d<l.count;d++){var p=ap(l.properties,s);if(!p)break e;fl(r,l.name,p,c,e)}return cl(r,e)}function cl(n,t){var e=new f.BufferGeometry;n.indices.length>0&&e.setIndex(n.indices),e.setAttribute("position",new f.Float32BufferAttribute(n.vertices,3)),n.normals.length>0&&e.setAttribute("normal",new f.Float32BufferAttribute(n.normals,3)),n.uvs.length>0&&e.setAttribute("uv",new f.Float32BufferAttribute(n.uvs,2)),n.colors.length>0&&e.setAttribute("color",new f.Float32BufferAttribute(n.colors,3)),(n.faceVertexUvs.length>0||n.faceVertexColors.length>0)&&(e=e.toNonIndexed(),n.faceVertexUvs.length>0&&e.setAttribute("uv",new f.Float32BufferAttribute(n.faceVertexUvs,2)),n.faceVertexColors.length>0&&e.setAttribute("color",new f.Float32BufferAttribute(n.faceVertexColors,3)));for(var r=0,i=Object.keys(t.customPropertyMapping);r<i.length;r++){var a=i[r];if(n[a].length>0){var o=t.customPropertyMapping[a],s=o.itemType,u=o.itemNames,l=o.normalized,c=u.length,d=void 0;switch(s){case"float32":d=new f.Float32BufferAttribute(n[a],c,l);break;case"uint32":d=new f.Uint32BufferAttribute(n[a],c,l);break;case"int32":d=new f.Int32BufferAttribute(n[a],c,l);break;case"uint16":d=new f.Uint16BufferAttribute(n[a],c,l);break;case"int16":d=new f.Int16BufferAttribute(n[a],c,l);break;case"uint8":d=new f.Uint8BufferAttribute(n[a],c,l);break;case"int8":d=new f.Int8BufferAttribute(n[a],c,l);break;default:d=new f.Float32BufferAttribute(n[a],c,l);break}e.setAttribute(a,d)}}return e.computeBoundingSphere(),e}function fl(n,t,e,r,i){if(t==="vertex"){r.attrX!==null&&r.attrY!==null&&r.attrZ!==null&&n.vertices.push(e[r.attrX],e[r.attrY],e[r.attrZ]),r.attrNX!==null&&r.attrNY!==null&&r.attrNZ!==null&&n.normals.push(e[r.attrNX],e[r.attrNY],e[r.attrNZ]),r.attrS!==null&&r.attrT!==null&&n.uvs.push(e[r.attrS],e[r.attrT]),r.attrR!==null&&r.attrG!==null&&r.attrB!==null&&(Vt.setRGB(e[r.attrR]/255,e[r.attrG]/255,e[r.attrB]/255),n.colors.push(Vt.r,Vt.g,Vt.b));for(var a=0,o=Object.keys(i.customPropertyMapping);a<o.length;a++)for(var s=o[a],u=0,l=i.customPropertyMapping[s].itemNames;u<l.length;u++){var c=l[u];n[s].push(e[c])}}else if(t==="face"){var d=e.vertex_indices||e.vertex_index,p=e.texcoord;d.length===3?(n.indices.push(d[0],d[1],d[2]),p&&p.length===6&&(n.faceVertexUvs.push(p[0],p[1]),n.faceVertexUvs.push(p[2],p[3]),n.faceVertexUvs.push(p[4],p[5]))):d.length===4&&(n.indices.push(d[0],d[1],d[3]),n.indices.push(d[1],d[2],d[3])),r.attrR!==null&&r.attrG!==null&&r.attrB!==null&&(Vt.setRGB(e[r.attrR]/255,e[r.attrG]/255,e[r.attrB]/255),n.faceVertexColors.push(Vt.r,Vt.g,Vt.b),n.faceVertexColors.push(Vt.r,Vt.g,Vt.b),n.faceVertexColors.push(Vt.r,Vt.g,Vt.b))}}function sp(n,t){for(var e={},r=0,i=0;i<t.length;i++){var a=t[i],o=a.valueReader;if(a.type==="list"){var s=[],u=a.countReader.read(n+r);r+=a.countReader.size;for(var l=0;l<u;l++)s.push(o.read(n+r)),r+=o.size;e[a.name]=s}else e[a.name]=o.read(n+r),r+=o.size}return[e,r]}function up(n,t,e){function r(s,u,l){switch(u){case"int8":case"char":return{read:function(c){return s.getInt8(c)},size:1};case"uint8":case"uchar":return{read:function(c){return s.getUint8(c)},size:1};case"int16":case"short":return{read:function(c){return s.getInt16(c,l)},size:2};case"uint16":case"ushort":return{read:function(c){return s.getUint16(c,l)},size:2};case"int32":case"int":return{read:function(c){return s.getInt32(c,l)},size:4};case"uint32":case"uint":return{read:function(c){return s.getUint32(c,l)},size:4};case"float32":case"float":return{read:function(c){return s.getFloat32(c,l)},size:4};case"float64":case"double":return{read:function(c){return s.getFloat64(c,l)},size:8};default:throw new Error("not support type: "+u)}}for(var i=0,a=n.length;i<a;i++){var o=n[i];o.type==="list"?(o.countReader=r(t,o.countType,e),o.valueReader=r(t,o.itemType,e)):o.valueReader=r(t,o.type,e)}}function lp(n,t,e){for(var r=ul(e),i=t.format==="binary_little_endian",a=new DataView(n,t.headerLength),o,s=0,u=0;u<t.elements.length;u++){var l=t.elements[u],c=l.properties,d=ll(c);up(c,a,i);for(var p=0;p<l.count;p++){o=sp(s,c),s+=o[1];var A=o[0];fl(r,l.name,A,d,e)}}return cl(r,e)}function cp(n){var t=0,e=!0,r="",i=[],a=new TextDecoder().decode(n.subarray(0,5)),o=/^ply\r\n/.test(a);do{var s=String.fromCharCode(n[t++]);s!==`
|
|
928
|
+
`),bo=typeof Worker!="undefined"&&typeof Blob!="undefined",Ju="";if(bo)try{var qh=new Blob([Qh],{type:"text/javascript"});Ju=URL.createObjectURL(qh)}catch(n){}var Xu=function(){function n(){var t=this;if(!bo)throw new Error("LZMAWorker cannot work in this broswer.");this.callCounter=0,this.requests={};var e=this.worker=new Worker(Ju);e.onmessage=function(r){var i=r.data,a=i.id,o=i.result,s=i.error,u=t.getKey(a);t.requests[u]&&(s?t.requests[u](new Error(s)):t.requests[u](null,o),delete t.requests[u])},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=bo,n}();function e0(n){return Array.prototype.reduce.call(n,function(t,e,r){return t|e<<r*8},0)}function Hh(n){for(var t=[],e=n.length,r=function(o){var s={data:n[o],offset:0,readByte:function(){return this.data[this.offset++]}},u=s.data.length,l={data:[],offset:0,writeByte:function(d){var p=Math.floor(this.offset/u);this.data[p]||(this.data[p]=new Uint8Array(u)),this.data[p][this.offset%u]=d,this.offset++}};Vh.decompressFile(s,l),i=new Uint8Array(l.offset);for(var c=0;c<l.offset;c++)i[c]=l.data[Math.floor(c/u)][c%u];t.push(i)},i,a=0;a<e;a++)r(a);return t}function Gh(n){for(var t=[],e=n.length,r=function(a){t.push(new Promise(function(o,s){var u=new Xu;u.decompress(n[a],function(l,c){if(u.terminate(),l)return s(l);o(c)})}))},i=0;i<e;i++)r(i);return Promise.all(t)}function Wu(n){var t=new Uint8Array(n),e=e0(t.slice(0,4));if(e>10)return Promise.reject(new Error("LZMA got too many sub chunks."));for(var r=[],i=[],a=4+e*4,o=0;o<e;o++)i[o]=e0(t.slice(4+o*4,8+o*4)),o===e-1?r[o]=t.subarray(a,a+i[o]):r[o]=t.slice(a,a+i[o]),a+=i[o];return Xu.support?Gh(r):Promise.resolve(Hh(r))}var Qa=!1,Zu=[];function Yu(n){if(n===void 0&&(n=!1),!(!n&&Qa)){Qa=!0;var t=Zu.shift();if(t){try{t()}catch(e){}Et.shared.add(function(){return Yu(!0)},!0,2,-100)}else Qa=!1}}function ia(n){return new Promise(function(t,e){var r=function(){try{t(n())}catch(i){e(i)}};Zu.push(r),Et.shared.add(function(){return Yu()},!0,2,-100)})}function rr(n,t){for(var e={},r=0,i=t;r<i.length;r++){var a=i[r];a in n&&(e[a]=n[a])}return e}function Kh(n,t){for(var e=O({},n),r=0,i=t;r<i.length;r++){var a=i[r];a in e&&delete e[a]}return e}const ln=sn.Reader,vr=sn.util,nr=sn.roots["@REALSEE/FIVE:five/loaders/model/parsers/protobuf/pbm.proto"]||(sn.roots["@REALSEE/FIVE:five/loaders/model/parsers/protobuf/pbm.proto"]={}),$u=nr.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=vr.emptyArray,n.prototype.createAt=vr.Long?vr.Long.fromBits(0,0,!0):0,n.prototype.description="",n.decode=function(e,r){e instanceof ln||(e=ln.create(e));let i=r===void 0?e.len:e.pos+r,a=new nr.Model;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.chunks&&a.chunks.length||(a.chunks=[]),a.chunks.push(nr.Chunk.decode(e,e.uint32()));break}case 2:{a.createAt=e.uint64();break}case 3:{a.description=e.string();break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Model"},n})();nr.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 ln||(e=ln.create(e));let i=r===void 0?e.len:e.pos+r,a=new nr.Chunk;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.vertices=nr.Vertices.decode(e,e.uint32());break}case 2:{a.faces=nr.Faces.decode(e,e.uint32());break}case 3:{a.name=e.string();break}case 4:{a.texture=e.string();break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("vertices"))throw vr.ProtocolError("missing required 'vertices'",{instance:a});if(!a.hasOwnProperty("faces"))throw vr.ProtocolError("missing required 'faces'",{instance:a});if(!a.hasOwnProperty("name"))throw vr.ProtocolError("missing required 'name'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Chunk"},n})();nr.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=vr.emptyArray,n.prototype.uvs=vr.emptyArray,n.prototype.marks=vr.emptyArray,n.decode=function(e,r){e instanceof ln||(e=ln.create(e));let i=r===void 0?e.len:e.pos+r,a=new nr.Vertices;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.xyz&&a.xyz.length||(a.xyz=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.xyz.push(e.float())}else a.xyz.push(e.float());break}case 2:{if(a.uvs&&a.uvs.length||(a.uvs=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.uvs.push(e.float())}else a.uvs.push(e.float());break}case 3:{if(a.marks&&a.marks.length||(a.marks=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.marks.push(e.int32())}else a.marks.push(e.int32());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Vertices"},n})();nr.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=vr.emptyArray,n.prototype.normals=vr.emptyArray,n.decode=function(e,r){e instanceof ln||(e=ln.create(e));let i=r===void 0?e.len:e.pos+r,a=new nr.Faces;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.indices&&a.indices.length||(a.indices=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.indices.push(e.uint32())}else a.indices.push(e.uint32());break}case 2:{if(a.normals&&a.normals.length||(a.normals=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.normals.push(e.float())}else a.normals.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Faces"},n})();nr.VertexMark=(()=>{const n={},t=Object.create(n);return t[n[0]="VERTEX_MARK_UNSPECIFIED"]=0,t[n[1]="VERTEX_MARK_ROOF"]=1,t})();function el(n,t){var e,r,i,a;t===void 0&&(t={});var o=(e=t.fetcher)!==null&&e!==void 0?e:new Qt({allowHosts:["*"]}),s={byteLength:0},u=Wo((r=t.textureOptions)!==null&&r!==void 0?r:{},(a=(i=t.textureArray)===null||i===void 0?void 0:i.length)!==null&&a!==void 0?a:0),l={};if(t.textureArray)for(var c=0,d=t.textureArray;c<d.length;c++){var p=d[c];l[p]=Xo(p,u,o)}return Promise.resolve().then(function(){return o.ajax(n,{responseType:"arraybuffer"})}).then(function(A){return s.byteLength=A.body.byteLength,ia(function(){var h=new Uint8Array(A.body);return $u.decode(h)})}).then(function(A){return ia(function(){var h,v;return rl(A,(h=t.textureBaseUri)!==null&&h!==void 0?h:function(){var g=n.lastIndexOf("/");if(g>=0){var m=n.slice(0,g)+"/";return/\/model\/$/.test(m)&&(m=m.replace(/\/model\/$/,"/materials/")),m}return""}(),((v=t.textureArray)!==null&&v!==void 0?v:[]).slice(),u,l,o)})}).then(function(A){var h=new f.Group;h.matrixAutoUpdate=!1,h.matrix.compose(h.position,h.quaternion,h.scale),h.name=n;for(var v=0,g=A.objects;v<g.length;v++){var m=g[v];h.add(m)}return{type:"pbm",upAxis:"Z",uri:n,byteLength:s.byteLength,scene:h,textures:A.textures,dispose:function(){return A.dispose()}}})}function tl(n){var t=n.match(/(group|floor)-?(\d+)/);return t?parseInt(t[2],10):0}function xo(n){var t=n.match(/(chunk)-?(\d+)/);return t?parseInt(t[2],10):0}function _h(n){var t=n.match(/(sub)-?(\d+)/);return t?parseInt(t[2],10):0}function t0(n){var t=tl(n.name),e=xo(n.name),r=_h(n.name);return t*1e6+e*1e3+r}function jh(n){for(var t,e,r,i=typeof n.createAt=="number"?n.createAt:0,a=(t=n.description)!==null&&t!==void 0?t:"",o=[],s=!0,u=!0,l=0,c=n.chunks;l<c.length;l++){var d=c[l];if(!d.vertices.marks||d.vertices.marks.length===0){u=!1;break}}for(var p=0,A=n.chunks;p<A.length;p++){var d=A[p];if(!d.faces.normals||d.faces.normals.length===0){s=!1;break}}for(var h=n.chunks.sort(function(ie,xe){return t0(ie)-t0(xe)}),v=[],g=0,m=h;g<m.length;g++){var d=m[g],y=tl(d.name);v[y]||(v[y]=[]),v[y].push(d)}for(var b=0;b<v.length;b++){var x=v[b];if(x)if(s){for(var w=0,E=0;E<x.length;E++){var d=x[E];w+=d.faces.indices.length}for(var S=new Float32Array(w*3),C=new Float32Array(w*2),R=new Float32Array(w*3),B=u?new Float32Array(w):void 0,M=[],I=[1/0,1/0,1/0,-1/0,-1/0,-1/0],L=0,T=0;T<x.length;T++){for(var F=[1/0,1/0,1/0,-1/0,-1/0,-1/0],d=x[T],D=d.vertices.xyz,V=d.vertices.uvs,z=d.faces.indices,Q=d.faces.normals,q=d.vertices.marks,G=z.length,E=0;E<G;E++){var K=z[E],j=S[L*3+E*3]=D[K*3],J=S[L*3+E*3+1]=D[K*3+1],W=S[L*3+E*3+2]=D[K*3+2];B&&(B[L+E]=q[K]),C[L*2+E*2]=V[K*2],C[L*2+E*2+1]=V[K*2+1];var $=Math.floor(E/3)*3;R[L*3+E*3]=Q[$],R[L*3+E*3+1]=Q[$+1],R[L*3+E*3+2]=Q[$+2],j<F[0]&&(F[0]=j),J<F[1]&&(F[1]=J),W<F[2]&&(F[2]=W),j>F[3]&&(F[3]=j),J>F[4]&&(F[4]=J),W>F[5]&&(F[5]=W)}F[0]<I[0]&&(I[0]=F[0]),F[1]<I[1]&&(I[1]=F[1]),F[2]<I[2]&&(I[2]=F[2]),F[3]>I[3]&&(I[3]=F[3]),F[4]>I[4]&&(I[4]=F[4]),F[5]>I[5]&&(I[5]=F[5]),M.push({materialIndex:T,name:d.name,chunkName:xo(d.name),start:L,count:d.faces.indices.length,texture:(e=d.texture)!==null&&e!==void 0?e:void 0}),L+=G}var Y={createAt:i,description:a,vertices:S,uvs:C,normals:R,masks:B,indices:null,floorIndex:b,groups:M,extents:I};o.push(Y)}else{for(var w=0,Z=0,E=0;E<x.length;E++){var d=x[E];Z+=d.vertices.xyz.length/3,w+=d.faces.indices.length}for(var S=new Float32Array(Z*3),C=new Float32Array(Z*2),R=void 0,oe=new Float32Array(Z),ne=new Uint32Array(w),B=u?new Float32Array(w):void 0,M=[],I=[1/0,1/0,1/0,-1/0,-1/0,-1/0],de=0,L=0,T=0;T<x.length;T++){for(var F=[1/0,1/0,1/0,-1/0,-1/0,-1/0],d=x[T],D=d.vertices.xyz,se=d.vertices.marks,V=d.vertices.uvs,z=d.faces.indices,ye=D.length/3,G=z.length,E=0;E<ye;E++){var j=S[L*3+E*3]=D[E*3],J=S[L*3+E*3+1]=D[E*3+1],W=S[L*3+E*3+2]=D[E*3+2];B&&(B[L+E]=se[E]),C[L*2+E*2]=V[E*2],C[L*2+E*2+1]=V[E*2+1],oe[L+E]=b,j<F[0]&&(F[0]=j),J<F[1]&&(F[1]=J),W<F[2]&&(F[2]=W),j>F[3]&&(F[3]=j),J>F[4]&&(F[4]=J),W>F[5]&&(F[5]=W)}F[0]<I[0]&&(I[0]=F[0]),F[1]<I[1]&&(I[1]=F[1]),F[2]<I[2]&&(I[2]=F[2]),F[3]>I[3]&&(I[3]=F[3]),F[4]>I[4]&&(I[4]=F[4]),F[5]>I[5]&&(I[5]=F[5]);for(var E=0;E<G;E++)ne[de+E]=L+z[E];M.push({materialIndex:T,name:d.name,chunkName:xo(d.name),start:de,count:d.faces.indices.length,texture:(r=d.texture)!==null&&r!==void 0?r:void 0}),L+=ye,de+=G}var Y={createAt:i,description:a,vertices:S,uvs:C,normals:R,masks:B,indices:ne,floorIndex:b,groups:M,extents:I};o.push(Y)}}return o}function Xo(n,t,e){var r=O({key:"texture.pbm"},rr(t,["format","quality","size","sharpen","mappings"])),i=new Kn,a=i.loadTexture(n,{imageURL:{transform:t.transform,options:r},encoding:f.sRGBEncoding,wrapS:f.ClampToEdgeWrapping,wrapT:f.ClampToEdgeWrapping,minFilter:f.LinearFilter,maxSize:typeof r.size=="number"?new f.Vector2(r.size,r.size):void 0,fetcher:e}).then(function(o){var s=o.body;return s.needsUpdate=!0,s});return Object.assign(a,{url:n,textureOptions:t})}function rl(n,t,e,r,i,a){i===void 0&&(i={});for(var o=jh(n),s=0,u="",l=[],c={},d=new Set,p=0,A=o;p<A.length;p++){var h=A[p],v=h.createAt,g=h.description,m=h.vertices,y=h.masks,b=h.uvs,x=h.normals,w=h.indices,E=h.floorIndex,S=h.groups,C=h.extents,R=new f.Box3;R.min.x=C[0],R.min.y=C[1],R.min.z=C[2],R.max.x=C[3],R.max.y=C[4],R.max.z=C[5];var B=new f.BufferGeometry;B.setAttribute("position",new f.BufferAttribute(m,3)),B.setAttribute("uv",new f.BufferAttribute(b,2)),x&&B.setAttribute("normal",new f.BufferAttribute(x,3)),y&&B.setAttribute("mask",new f.BufferAttribute(y,1)),w&&B.setIndex(new f.BufferAttribute(w,1)),B.boundingBox=R,B.boundingSphere=R.getBoundingSphere(new f.Sphere);for(var M=0,I=S;M<I.length;M++){var L=I[M];B.addGroup(L.start,L.count,L.materialIndex)}d.add(B);for(var T=[],F=0,D=S;F<D.length;F++){var L=D[F],V=e[L.chunkName]||(L.texture?st(t||"",L.texture):void 0),z=new Ar("basic");z.floor=E,B.attributes.normal===void 0&&(z.flatShading=!0),B.attributes.mask&&(z.defines.USE_VERTEX_MARK=!0),T.push(z),V?c[V]?c[V].push(z):c[V]=[z]:z.color=new f.Color(16777215),d.add(z),z.refreshUniforms()}var Q=new kt(B,T);Q.name="model_floor_"+E,Q.userData.createAt=v,Q.userData.description=g,Q.matrix.compose(Q.position,Q.quaternion,Q.scale),Q.matrixAutoUpdate=!1,Q.frustumCulled=!1,s=v,u=g,l.push(Q)}var q=function(G){G=Wo(G,e.length);for(var K=[],j=function(Y){var Z=null;Y in i&&(Z=i[Y]),Z||(Z=Xo(Y,G,a)),K.push(Z.then(function(oe){for(var ne=0,de=c[Y];ne<de.length;ne++){var se=de[ne];se.map&&(d.delete(se.map),se.map.dispose()),se.map=oe,se.refreshUniforms(),d.add(oe)}return oe}).catch(function(){for(var oe=0,ne=c[Y];oe<ne.length;oe++){var de=ne[oe];de.map&&(d.delete(de.map),de.map.dispose()),de.map=null,de.color=new f.Color(16777215),de.refreshUniforms()}return null}))},J=0,W=Object.keys(c);J<W.length;J++){var $=W[J];j($)}for(var $ in i)delete i[$];return Promise.all(K).then(function(Y){return Y.filter(function(Z){return Z})})};return q(r).then(function(G){return{createAt:s,description:u,objects:l,textures:G,dispose:function(){d.forEach(function(K){K.dispose()}),d.clear()}}})}function Wo(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 nl(n,t){var e,r,i,a;t===void 0&&(t={});var o=(e=t.fetcher)!==null&&e!==void 0?e:new Qt({allowHosts:["*"]}),s={byteLength:0},u=Wo((r=t.textureOptions)!==null&&r!==void 0?r:{},(a=(i=t.textureArray)===null||i===void 0?void 0:i.length)!==null&&a!==void 0?a:0),l={};if(t.textureArray)for(var c=0,d=t.textureArray;c<d.length;c++){var p=d[c];l[p]=Xo(p,u,o)}return Promise.resolve().then(function(){return o.ajax(n,{responseType:"arraybuffer"})}).then(function(A){return Wu(A.body)}).then(function(A){return ia(function(){for(var h,v={chunks:[],createAt:void 0,description:void 0},g=0,m=A;g<m.length;g++){var y=m[g],b=$u.decode(y);b.chunks.length&&((h=v.chunks).push.apply(h,b.chunks),v.createAt=b.createAt,v.description=b.description)}return v})}).then(function(A){return ia(function(){var h,v,g;return rl(A,(h=t.textureBaseUri)!==null&&h!==void 0?h:function(){var m=n.lastIndexOf("/");if(m>=0){var y=n.slice(0,m)+"/";return/\/model\/$/.test(y)&&(y=y.replace(/\/model\/$/,"/materials/")),y}return""}(),((v=t.textureArray)!==null&&v!==void 0?v:[]).slice(),(g=t.textureOptions)!==null&&g!==void 0?g:{},l,o)})}).then(function(A){var h=new f.Group;h.name=n;for(var v=0,g=A.objects;v<g.length;v++){var m=g[v];h.add(m)}return{type:"at3d",upAxis:"Z",uri:n,byteLength:s.byteLength,scene:h,textures:A.textures,dispose:function(){return A.dispose()}}})}const nt=sn.Reader,mt=sn.util,De=sn.roots["@REALSEE/FIVE:five/loaders/model/parsers/protobuf/dome.proto"]||(sn.roots["@REALSEE/FIVE:five/loaders/model/parsers/protobuf/dome.proto"]={}),Jh=De.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=mt.emptyArray,n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Model;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.meshes&&a.meshes.length||(a.meshes=[]),a.meshes.push(De.Mesh.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Model"},n})();De.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=mt.emptyArray,n.prototype.matrix=mt.emptyArray,n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Mesh;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.name=e.string();break}case 2:{a.chunks&&a.chunks.length||(a.chunks=[]),a.chunks.push(De.Chunk.decode(e,e.uint32()));break}case 3:{a.matrix&&a.matrix.length||(a.matrix=[]),a.matrix.push(De.Matrix.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("name"))throw mt.ProtocolError("missing required 'name'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Mesh"},n})();De.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=mt.emptyArray,n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Matrix;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.elements&&a.elements.length||(a.elements=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.elements.push(e.float())}else a.elements.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Matrix"},n})();De.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=mt.emptyArray,n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Chunk;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 2:{a.geometry=De.Geometry.decode(e,e.uint32());break}case 3:{a.material&&a.material.length||(a.material=[]),a.material.push(De.Material.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("geometry"))throw mt.ProtocolError("missing required 'geometry'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Chunk"},n})();De.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=mt.emptyArray,n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Geometry;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.position=De.Position.decode(e,e.uint32());break}case 2:{a.uv=De.UV.decode(e,e.uint32());break}case 3:{a.uv2=De.UV.decode(e,e.uint32());break}case 4:{a.normal=De.Normal.decode(e,e.uint32());break}case 5:{a.groups&&a.groups.length||(a.groups=[]),a.groups.push(De.Group.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("position"))throw mt.ProtocolError("missing required 'position'",{instance:a});if(!a.hasOwnProperty("normal"))throw mt.ProtocolError("missing required 'normal'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Geometry"},n})();De.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=mt.emptyArray,n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Position;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.array&&a.array.length||(a.array=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.array.push(e.float())}else a.array.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Position"},n})();De.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=mt.emptyArray,n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.UV;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.array&&a.array.length||(a.array=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.array.push(e.float())}else a.array.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/UV"},n})();De.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=mt.emptyArray,n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Normal;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.array&&a.array.length||(a.array=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.array.push(e.float())}else a.array.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Normal"},n})();De.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 nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Group;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.start=e.uint32();break}case 2:{a.count=e.uint32();break}case 3:{a.materialIndex=e.uint32();break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("start"))throw mt.ProtocolError("missing required 'start'",{instance:a});if(!a.hasOwnProperty("count"))throw mt.ProtocolError("missing required 'count'",{instance:a});if(!a.hasOwnProperty("materialIndex"))throw mt.ProtocolError("missing required 'materialIndex'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Group"},n})();De.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 nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Material;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.kd=De.Color.decode(e,e.uint32());break}case 2:{a.ks=De.Color.decode(e,e.uint32());break}case 3:{a.ke=De.Color.decode(e,e.uint32());break}case 4:{a.mapkd=e.string();break}case 5:{a.mapks=e.string();break}case 6:{a.mapke=e.string();break}case 7:{a.norm=e.string();break}case 8:{a.mapbump=e.string();break}case 9:{a.bump=e.string();break}case 10:{a.mapd=e.string();break}case 11:{a.ns=e.float();break}case 12:{a.d=e.float();break}case 13:{a.tr=e.float();break}case 14:{a.mapkdrepeat=e.string();break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Material"},n})();De.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=mt.emptyArray,n.decode=function(e,r){e instanceof nt||(e=nt.create(e));let i=r===void 0?e.len:e.pos+r,a=new De.Color;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.rgb&&a.rgb.length||(a.rgb=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.rgb.push(e.float())}else a.rgb.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Color"},n})();var Xh=new f.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function il(n,t){var e;t===void 0&&(t={});var r=(e=t.fetcher)!==null&&e!==void 0?e:new Qt({allowHosts:["*"]}),i={byteLength:0};return Promise.resolve().then(function(){return r.ajax(n,{responseType:"arraybuffer"})}).then(function(a){var o;return i.byteLength=a.body.byteLength,al(new Uint8Array(a.body),t.textureBaseUri||"",(o=t.textureOptions)!==null&&o!==void 0?o:{},r)}).then(function(a){var o=new f.Group;o.matrixAutoUpdate=!1,o.applyMatrix4(Xh),o.matrix.compose(o.position,o.quaternion,o.scale),o.name=n;for(var s=0,u=a.objects;s<u.length;s++){var l=u[s];o.add(l)}return{type:"dome",upAxis:"Z",uri:n,byteLength:i.byteLength,scene:o,textures:a.textures,dispose:function(){return a.dispose()}}})}function Wh(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 Zh(n){var t=n.position,e=n.normal,r=n.uv,i=n.uv2,a=n.groups,o=new f.BufferGeometry;o.setAttribute("position",new f.BufferAttribute(new Float32Array(t.array),3)),e&&o.setAttribute("normal",new f.BufferAttribute(new Float32Array(e.array),3)),r&&o.setAttribute("uv",new f.BufferAttribute(new Float32Array(r.array),2)),i&&o.setAttribute("uv2",new f.BufferAttribute(new Float32Array(i.array),2));for(var s=0,u=a;s<u.length;s++){var l=u[s];o.addGroup(l.start,l.count,l.materialIndex)}return o}function Fn(n,t,e,r,i,a,o){if(o.hasOwnProperty(n))return o[n];n=n.split("?")[0],Ur(n)||(n=st(t,n)),n=n.replace(/\/\/vrlab-image\d*.ljcdn.com\//,"//vrlab-public.ljcdn.com/"),n.indexOf("//")===0&&(n="https:"+n);var s=O({key:"texture.dome",size:64},rr(e,["quality","format","sharpen","mappings"])),u=o[n]=i.loadTexture(n,{imageURL:{transform:e.transform,options:s},wrapS:f.RepeatWrapping,wrapT:f.RepeatWrapping,fetcher:a}).then(function(l){var c=l.body;return r&&c.repeat.copy(r),c.needsUpdate=!0,c.updateMatrix(),c});return u}function Yh(n,t,e,r,i,a,o,s){var u=[],l=new Ar("phong");if(o.add(l),n.kd&&(l.color=new f.Color().fromArray(n.kd.rgb).convertLinearToSRGB()),n.mapkd){var c=null;if(n.mapkdrepeat){var d=n.mapkdrepeat.split(/\s+/).map(function(v){return Number(v)}),p=d[0],A=d[1];c=new f.Vector2(p,A)}u.push(Fn(n.mapkd,t,e,c,r,i,a).then(function(v){v.encoding=f.sRGBEncoding,l.map=v,o.add(v),s.add(v),l.needsUpdate=!0}).catch(U))}if(n.ks&&(l.specular=new f.Color().fromArray(n.ks.rgb).convertLinearToSRGB()),n.mapks&&u.push(Fn(n.mapks,t,e,null,r,i,a).then(function(v){l.specularMap=v,o.add(v),s.add(v)}).catch(U)),n.ke&&(l.emissive=new f.Color().fromArray(n.ke.rgb).convertLinearToSRGB()),n.mapke&&u.push(Fn(n.mapke,t,e,null,r,i,a).then(function(v){v.encoding=f.sRGBEncoding,l.emissiveMap=v,o.add(v),s.add(v)}).catch(U)),n.norm&&u.push(Fn(n.norm,t,e,null,r,i,a).then(function(v){l.normalMap=v,o.add(v),s.add(v)}).catch(U)),n.mapbump&&u.push(Fn(n.mapbump,t,e,null,r,i,a).then(function(v){l.bumpMap=v,o.add(v),s.add(v)}).catch(U)),n.bump&&u.push(Fn(n.bump,t,e,null,r,i,a).then(function(v){l.bumpMap=v,o.add(v),s.add(v)}).catch(U)),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,l.refreshUniforms(),{material:l,textureReady:Promise.all(u).then(function(){return l.refreshUniforms()}).then(U)}}function $h(n){return Jh.decode(n).meshes}function al(n,t,e,r){for(var i=[],a=[],o=new Set,s=$h(n),u=new Kn,l=new f.Matrix4,c=new f.Vector3,d=new f.Quaternion,p=new f.Vector3,A={},h=new Set,v=0,g=s;v<g.length;v++){var m=g[v],y=m.name,b=m.chunks,x=m.matrix;if(!(y==="Ceiling"||y==="CeilingDrop"))for(var w=0,E=x;w<E.length;w++){var S=E[w];l.elements=S.elements;for(var C=new f.Group,R=0;R<b.length;R++){var B=Zh(b[R].geometry);B.applyMatrix4(l),l.decompose(c,d,p),p.x*p.y*p.z<0&&B.attributes.normal&&B.attributes.position&&B.attributes.uv&&Wh(B),o.add(B);for(var M=[],I=0,L=b[R].material;I<L.length;I++){var T=L[I],F=Yh(T,t||"",e,u,r,A,o,h),D=F.material,V=F.textureReady;a.push(V),M.push(D)}var z=new kt(B,M);z.name="chunk_"+R,z.matrix.compose(z.position,z.quaternion,z.scale),z.matrixAutoUpdate=!1,z.frustumCulled=!1,C.add(z)}C.name=y,i.push(C)}}return Promise.all(a).catch(U).then(function(){return{createAt:0,description:"",objects:i,textures:Array.from(h),dispose:function(){o.forEach(function(Q){Q.dispose()}),o.clear()}}})}var ep=new f.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function ol(n,t){var e;t===void 0&&(t={});var r=(e=t.fetcher)!==null&&e!==void 0?e:new Qt({allowHosts:["*"]}),i={byteLength:0};return Promise.resolve().then(function(){return r.ajax(n,{responseType:"arraybuffer"})}).then(function(a){return i.byteLength=a.body.byteLength,Wu(a.body)}).then(function(a){var o=a.reduce(function(l,c){return l+c.length},0),s=new Uint8Array(o),u=0;return a.forEach(function(l){s.set(l,u),u+=l.length}),s}).then(function(a){var o;return al(a,t.textureBaseUri||"",(o=t.textureOptions)!==null&&o!==void 0?o:{},r)}).then(function(a){var o=new f.Group;o.matrixAutoUpdate=!1,o.applyMatrix4(ep),o.matrix.compose(o.position,o.quaternion,o.scale),o.name=n;for(var s=0,u=a.objects;s<u.length;s++){var l=u[s];o.add(l)}return{type:"domez",upAxis:"Z",uri:n,byteLength:i.byteLength,scene:o,textures:a.textures,dispose:function(){return a.dispose()}}})}var tp=new f.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function sl(n,t){var e,r;t===void 0&&(t={});var i=(e=t.upAxis)!==null&&e!==void 0?e:"Y",a=(r=t.fetcher)!==null&&r!==void 0?r:new Qt({allowHosts:["*"]}),o=0;return Promise.resolve().then(function(){return a.ajax(n,{responseType:"arraybuffer"}).then(function(s){return o=s.body.byteLength,s.body})}).then(function(s){var u;return Jo(s,{copyUV2:!1,addonExtensions:["PBM_mesh"],resourcePath:n.slice(0,n.lastIndexOf("/")+1),search:(u=n.split("?")[1])!==null&&u!==void 0?u:"",fetcher:a})}).then(function(s){var u=new f.Matrix4;if(i==="Y"&&u.premultiply(tp),s.CESIUM_RTC){var l=new f.Matrix4().setPosition(s.CESIUM_RTC.center);u.premultiply(l)}var c=s.scene;return c.applyMatrix4(u),{type:"gltf",upAxis:"Z",uri:n,byteLength:o,scene:c,textures:s.textures,dispose:function(){return s.dispose()}}})}var jn=new f.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]),Vt=new f.Color;function Zo(n,t){var e,r;t===void 0&&(t={});var i=(e=t.upAxis)!==null&&e!==void 0?e:"Z",a=(r=t.fetcher)!==null&&r!==void 0?r:new Qt({allowHosts:["*"]}),o=0;return Promise.resolve().then(function(){return a.ajax(n,{responseType:"arraybuffer"}).then(function(s){return o=s.body.byteLength,s.body})}).then(function(s){var u,l;return rp(s,{propertyNameMapping:(u=t.propertyNameMapping)!==null&&u!==void 0?u:{},customPropertyMapping:(l=t.customPropertyMapping)!==null&&l!==void 0?l:{}})}).then(function(s){var u=s.geometry;switch(t.type){case"geometry":{var l=u;return i==="Y"&&l.applyMatrix4(jn),{type:"ply",upAxis:"Z",uri:n,byteLength:o,scene:l,meta:{},textures:[],dispose:function(){u.dispose()}}}case"mesh":{var c="color"in u.attributes,d=new f.MeshBasicMaterial({vertexColors:c}),l=new f.Mesh(u,d);return i==="Y"&&l.applyMatrix4(jn),{type:"ply",upAxis:"Z",uri:n,byteLength:o,scene:l,meta:{},textures:[],dispose:function(){u.dispose(),d.dispose()}}}case"line":{var c="color"in u.attributes,p=new f.LineBasicMaterial({vertexColors:c}),l=new f.Line(u,p);return l.computeLineDistances(),i==="Y"&&l.applyMatrix4(jn),{type:"ply",upAxis:"Z",uri:n,byteLength:o,scene:l,meta:{},textures:[],dispose:function(){u.dispose(),p.dispose()}}}case"points":{var A=new f.PointsMaterial({}),l=new f.Points(u,A);return i==="Y"&&l.applyMatrix4(jn),{type:"ply",upAxis:"Z",uri:n,byteLength:o,scene:l,meta:{},textures:[],dispose:function(){u.dispose(),A.dispose()}}}case"pbmPointCloud":{var h=new Mi,l=new mr(u,h);return i==="Y"&&l.applyMatrix4(jn),{type:"ply",upAxis:"Z",uri:n,byteLength:o,scene:l,meta:{},textures:[],dispose:function(){u.dispose(),h.dispose()}}}}throw new Error("Invalid Type: ".concat(t.type))})}function rp(n,t){var e=new Uint8Array(n),r=cp(e),i=r.headerText,a=r.headerLength,o=ip(i,a,t);if(o.format==="ascii"){var s=new TextDecoder().decode(e);return{header:o,geometry:op(s,o,t)}}else return{header:o,geometry:lp(n,o,t)}}function np(n,t){var e={name:"",type:n[0]};return e.type==="list"?(e.name=n[3],e.countType=n[1],e.itemType=n[2]):e.name=n[1],e.name in t.propertyNameMapping&&(e.name=t.propertyNameMapping[e.name]),e}function ip(n,t,e){t===void 0&&(t=0);var r=/^ply([\s\S]*)end_header(\r\n|\r|\n)/,i="",a=r.exec(n);a!==null&&(i=a[1]);for(var o={format:"",version:"",comments:[],elements:[],headerLength:t,objInfo:""},s=i.split(/\r\n|\r|\n/),u=null,l=0;l<s.length;l++){var c=s[l];if(c=c.trim(),c!==""){var d=c.split(/\s+/),p=d.shift();switch(c=d.join(" "),p){case"format":o.format=d[0],o.version=d[1];break;case"comment":o.comments.push(c);break;case"element":u&&o.elements.push(u),u={name:d[0],count:parseInt(d[1]),properties:[]};break;case"property":u&&u.properties.push(np(d,e));break;case"obj_info":o.objInfo=c;break;default:console.log("unhandled",p,d)}}}return u&&o.elements.push(u),o}function qa(n,t){switch(t){case"char":case"uchar":case"short":case"ushort":case"int":case"uint":case"int8":case"uint8":case"int16":case"uint16":case"int32":case"uint32":return parseInt(n);case"float":case"double":case"float32":case"float64":return parseFloat(n);default:throw new Error("unspport type: "+t)}}function ap(n,t){for(var e={},r=0;r<n.length;r++){if(t.empty())return null;if(n[r].type==="list"){for(var i=[],a=qa(t.next(),n[r].countType),o=0;o<a;o++){if(t.empty())return null;i.push(qa(t.next(),n[r].itemType))}e[n[r].name]=i}else e[n[r].name]=qa(t.next(),n[r].type)}return e}function ul(n){for(var t={indices:[],vertices:[],normals:[],uvs:[],faceVertexUvs:[],colors:[],faceVertexColors:[]},e=0,r=Object.keys(n.customPropertyMapping);e<r.length;e++){var i=r[e];t[i]=[]}return t}function ll(n){var t=n.map(function(r){return r.name});function e(r){for(var i=0,a=r.length;i<a;i++){var o=r[i];if(t.includes(o))return o}return null}return{attrX:e(["x","px","posx"])||"x",attrY:e(["y","py","posy"])||"y",attrZ:e(["z","pz","posz"])||"z",attrNX:e(["nx","normalx"]),attrNY:e(["ny","normaly"]),attrNZ:e(["nz","normalz"]),attrS:e(["s","u","texture_u","tx"]),attrT:e(["t","v","texture_v","ty"]),attrR:e(["red","diffuse_red","r","diffuse_r"]),attrG:e(["green","diffuse_green","g","diffuse_g"]),attrB:e(["blue","diffuse_blue","b","diffuse_b"])}}function op(n,t,e){var r=ul(e),i=/end_header\s+(\S[\s\S]*\S|\S)\s*$/,a,o=null;(o=i.exec(n))!==null?a=o[1].split(/\s+/):a=[];var s=new fp(a);e:for(var u=0;u<t.elements.length;u++)for(var l=t.elements[u],c=ll(l.properties),d=0;d<l.count;d++){var p=ap(l.properties,s);if(!p)break e;fl(r,l.name,p,c,e)}return cl(r,e)}function cl(n,t){var e=new f.BufferGeometry;n.indices.length>0&&e.setIndex(n.indices),e.setAttribute("position",new f.Float32BufferAttribute(n.vertices,3)),n.normals.length>0&&e.setAttribute("normal",new f.Float32BufferAttribute(n.normals,3)),n.uvs.length>0&&e.setAttribute("uv",new f.Float32BufferAttribute(n.uvs,2)),n.colors.length>0&&e.setAttribute("color",new f.Float32BufferAttribute(n.colors,3)),(n.faceVertexUvs.length>0||n.faceVertexColors.length>0)&&(e=e.toNonIndexed(),n.faceVertexUvs.length>0&&e.setAttribute("uv",new f.Float32BufferAttribute(n.faceVertexUvs,2)),n.faceVertexColors.length>0&&e.setAttribute("color",new f.Float32BufferAttribute(n.faceVertexColors,3)));for(var r=0,i=Object.keys(t.customPropertyMapping);r<i.length;r++){var a=i[r];if(n[a].length>0){var o=t.customPropertyMapping[a],s=o.itemType,u=o.itemNames,l=o.normalized,c=u.length,d=void 0;switch(s){case"float32":d=new f.Float32BufferAttribute(n[a],c,l);break;case"uint32":d=new f.Uint32BufferAttribute(n[a],c,l);break;case"int32":d=new f.Int32BufferAttribute(n[a],c,l);break;case"uint16":d=new f.Uint16BufferAttribute(n[a],c,l);break;case"int16":d=new f.Int16BufferAttribute(n[a],c,l);break;case"uint8":d=new f.Uint8BufferAttribute(n[a],c,l);break;case"int8":d=new f.Int8BufferAttribute(n[a],c,l);break;default:d=new f.Float32BufferAttribute(n[a],c,l);break}e.setAttribute(a,d)}}return e.computeBoundingSphere(),e}function fl(n,t,e,r,i){if(t==="vertex"){r.attrX!==null&&r.attrY!==null&&r.attrZ!==null&&n.vertices.push(e[r.attrX],e[r.attrY],e[r.attrZ]),r.attrNX!==null&&r.attrNY!==null&&r.attrNZ!==null&&n.normals.push(e[r.attrNX],e[r.attrNY],e[r.attrNZ]),r.attrS!==null&&r.attrT!==null&&n.uvs.push(e[r.attrS],e[r.attrT]),r.attrR!==null&&r.attrG!==null&&r.attrB!==null&&(Vt.setRGB(e[r.attrR]/255,e[r.attrG]/255,e[r.attrB]/255),n.colors.push(Vt.r,Vt.g,Vt.b));for(var a=0,o=Object.keys(i.customPropertyMapping);a<o.length;a++)for(var s=o[a],u=0,l=i.customPropertyMapping[s].itemNames;u<l.length;u++){var c=l[u];n[s].push(e[c])}}else if(t==="face"){var d=e.vertex_indices||e.vertex_index,p=e.texcoord;d.length===3?(n.indices.push(d[0],d[1],d[2]),p&&p.length===6&&(n.faceVertexUvs.push(p[0],p[1]),n.faceVertexUvs.push(p[2],p[3]),n.faceVertexUvs.push(p[4],p[5]))):d.length===4&&(n.indices.push(d[0],d[1],d[3]),n.indices.push(d[1],d[2],d[3])),r.attrR!==null&&r.attrG!==null&&r.attrB!==null&&(Vt.setRGB(e[r.attrR]/255,e[r.attrG]/255,e[r.attrB]/255),n.faceVertexColors.push(Vt.r,Vt.g,Vt.b),n.faceVertexColors.push(Vt.r,Vt.g,Vt.b),n.faceVertexColors.push(Vt.r,Vt.g,Vt.b))}}function sp(n,t){for(var e={},r=0,i=0;i<t.length;i++){var a=t[i],o=a.valueReader;if(a.type==="list"){var s=[],u=a.countReader.read(n+r);r+=a.countReader.size;for(var l=0;l<u;l++)s.push(o.read(n+r)),r+=o.size;e[a.name]=s}else e[a.name]=o.read(n+r),r+=o.size}return[e,r]}function up(n,t,e){function r(s,u,l){switch(u){case"int8":case"char":return{read:function(c){return s.getInt8(c)},size:1};case"uint8":case"uchar":return{read:function(c){return s.getUint8(c)},size:1};case"int16":case"short":return{read:function(c){return s.getInt16(c,l)},size:2};case"uint16":case"ushort":return{read:function(c){return s.getUint16(c,l)},size:2};case"int32":case"int":return{read:function(c){return s.getInt32(c,l)},size:4};case"uint32":case"uint":return{read:function(c){return s.getUint32(c,l)},size:4};case"float32":case"float":return{read:function(c){return s.getFloat32(c,l)},size:4};case"float64":case"double":return{read:function(c){return s.getFloat64(c,l)},size:8};default:throw new Error("not support type: "+u)}}for(var i=0,a=n.length;i<a;i++){var o=n[i];o.type==="list"?(o.countReader=r(t,o.countType,e),o.valueReader=r(t,o.itemType,e)):o.valueReader=r(t,o.type,e)}}function lp(n,t,e){for(var r=ul(e),i=t.format==="binary_little_endian",a=new DataView(n,t.headerLength),o,s=0,u=0;u<t.elements.length;u++){var l=t.elements[u],c=l.properties,d=ll(c);up(c,a,i);for(var p=0;p<l.count;p++){o=sp(s,c),s+=o[1];var A=o[0];fl(r,l.name,A,d,e)}}return cl(r,e)}function cp(n){var t=0,e=!0,r="",i=[],a=new TextDecoder().decode(n.subarray(0,5)),o=/^ply\r\n/.test(a);do{var s=String.fromCharCode(n[t++]);s!==`
|
|
929
929
|
`&&s!=="\r"?r+=s:(r==="end_header"&&(e=!1),r!==""&&(i.push(r),r=""))}while(e&&t<n.length);return o===!0&&t++,{headerText:i.join("\r")+"\r",headerLength:t}}var fp=function(){function n(t){this.arr=t,this.i=0}return n.prototype.empty=function(){return this.i>=this.arr.length},n.prototype.next=function(){return this.arr[this.i++]},n}(),dp=new f.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]),hp=/^[og]\s*(.+)?/,pp=/^mtllib /,vp=/^usemtl /,mp=/^usemap /,r0=/\s+/,Jn=new f.Color,Ap=function(){function n(){this.objects=[],this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.materials={},this.materialLibraries=[],this.startObject("",!1)}return n.prototype.startObject=function(t,e){if(this.object&&this.object.fromDeclaration===!1){this.object.name=t,this.object.fromDeclaration=e!==!1;return}var r=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:t||"",fromDeclaration:e!==!1,geometry:{vertices:[],hasNormal:!0,normals:[],hasColor:!0,colors:[],hasUV:!0,uvs:[],index:[],indexMap:{}},materials:[],smooth:!0,startMaterial:function(a,o){var s,u,l=this._finalize(!1);l&&(l.inherited||((s=l.groupCount)!==null&&s!==void 0?s:0)<=0)&&this.materials.splice((u=l.index)!==null&&u!==void 0?u:0,1);var c={index:this.materials.length,name:a||"",mtllib:Array.isArray(o)&&o.length>0?o[o.length-1]:"",smooth:l!==void 0?l.smooth:this.smooth,groupStart:l!==void 0?l.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(d){var p={index:typeof d=="number"?d:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(){return this}};return p.clone=this.clone.bind(p),p}};return this.materials.push(c),c},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(a){var o,s,u=this.currentMaterial();if(u&&u.groupEnd===-1&&(u.groupEnd=this.geometry.index.length,u.groupCount=u.groupEnd-((o=u.groupStart)!==null&&o!==void 0?o:0),u.inherited=!1),a&&this.materials.length>1)for(var l=this.materials.length-1;l>=0;l--)((s=this.materials[l].groupCount)!==null&&s!==void 0?s:0)<=0&&this.materials.splice(l,1);return a&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),u}},r&&r.name&&typeof r.clone=="function"){var i=r.clone(0);i.inherited=!0,this.object.materials.push(i)}this.objects.push(this.object)},n.prototype.finalize=function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},n.prototype.parseVertexIndex=function(t,e){var r=parseInt(t,10);return(r>=0?r-1:r+e/3)*3},n.prototype.parseNormalIndex=function(t,e){var r=parseInt(t,10);return(r>=0?r-1:r+e/3)*3},n.prototype.parseUVIndex=function(t,e){var r=parseInt(t,10);return(r>=0?r-1:r+e/2)*2},n.prototype.addFace=function(t,e,r,i,a,o,s,u,l){var c=this.object.geometry,d=this.vertices.length,p=this.normals.length,A=this.uvs.length,h=this.parseVertexIndex(t,d),v=this.parseVertexIndex(e,d),g=this.parseVertexIndex(r,d),m=s!==void 0?this.parseNormalIndex(s,p):void 0,y=u!==void 0?this.parseNormalIndex(u,p):void 0,b=l!==void 0?this.parseNormalIndex(l,p):void 0,x=i!==void 0?this.parseUVIndex(i,A):void 0,w=a!==void 0?this.parseUVIndex(a,A):void 0,E=o!==void 0?this.parseUVIndex(o,A):void 0;(c.hasNormal===!0&&m===void 0||y===void 0||b===void 0)&&(c.hasNormal=!1),(c.hasUV===!0&&x===void 0||w===void 0||E===void 0)&&(c.hasUV=!1);var S=[h,x,m].join(":"),C=c.indexMap[S];C===void 0&&(C=c.vertices.length/3,c.indexMap[S]=C,c.vertices.push(this.vertices[h+0],this.vertices[h+1],this.vertices[h+2]),c.hasColor&&(this.colors[h]===void 0?c.hasColor=!1:c.colors.push(this.colors[h+0],this.colors[h+1],this.colors[h+2])),c.hasNormal&&c.normals.push(this.normals[h+0],this.normals[h+1],this.normals[h+2]),c.hasUV&&c.uvs.push(this.uvs[x+0],this.uvs[x+1])),c.index.push(C);var R=[v,w,y].join(":"),B=c.indexMap[R];B===void 0&&(B=c.vertices.length/3,c.indexMap[R]=B,c.vertices.push(this.vertices[v+0],this.vertices[v+1],this.vertices[v+2]),c.hasColor&&(this.colors[v]===void 0?c.hasColor=!1:c.colors.push(this.colors[v+0],this.colors[v+1],this.colors[v+2])),c.hasNormal&&c.normals.push(this.normals[v+0],this.normals[v+1],this.normals[v+2]),c.hasUV&&c.uvs.push(this.uvs[w+0],this.uvs[w+1])),c.index.push(B);var M=[g,E,b].join(":"),I=c.indexMap[M];I===void 0&&(I=c.vertices.length/3,c.indexMap[M]=I,c.vertices.push(this.vertices[g+0],this.vertices[g+1],this.vertices[g+2]),c.hasColor&&(this.colors[g]===void 0?c.hasColor=!1:c.colors.push(this.colors[g+0],this.colors[g+1],this.colors[g+2])),c.hasNormal&&c.normals.push(this.normals[g+0],this.normals[g+1],this.normals[g+2]),c.hasUV&&c.uvs.push(this.uvs[E+0],this.uvs[E+1])),c.index.push(I)},n}();function gp(n){var t=new Ap;n.indexOf(`\r
|
|
930
930
|
`)!==-1&&(n=n.replace(/\r\n/g,`
|
|
931
931
|
`)),n.indexOf(`\\
|
|
932
932
|
`)!==-1&&(n=n.replace(/\\\n/g,""));for(var e=n.split(`
|
|
933
933
|
`),r=[],i=0,a=e.length;i<a;i++){var o=e[i].trimStart();if(o.length!==0){var s=o.charAt(0);if(s!=="#"){if(s==="v"){var u=o.split(r0);switch(u[0]){case"v":t.vertices.push(parseFloat(u[1]),parseFloat(u[2]),parseFloat(u[3])),u.length>=7?(Jn.setRGB(parseFloat(u[4]),parseFloat(u[5]),parseFloat(u[6])),Jn.convertSRGBToLinear(),t.colors.push(Jn.r,Jn.g,Jn.b)):t.colors.push(void 0,void 0,void 0);break;case"vn":t.normals.push(parseFloat(u[1]),parseFloat(u[2]),parseFloat(u[3]));break;case"vt":t.uvs.push(parseFloat(u[1]),parseFloat(u[2]));break}}else if(s==="f"){for(var l=o.slice(1).trim(),c=l.split(r0),d=[],p=0,A=c.length;p<A;p++){var h=c[p];if(h.length>0){var v=h.split("/");d.push(v)}}for(var g=d[0],p=1,A=d.length-1;p<A;p++){var m=d[p],y=d[p+1];t.addFace(g[0],m[0],y[0],g[1],m[1],y[1],g[2],m[2],y[2])}}else if(s!=="l"){if(s!=="p")if((r=hp.exec(o))!==null){var b=(" "+r[0].slice(1).trim()).slice(1);t.startObject(b)}else if(vp.test(o))t.object.startMaterial(o.substring(7).trim(),t.materialLibraries);else if(pp.test(o))t.materialLibraries.push(o.substring(7).trim());else if(mp.test(o))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(s==="s"){if(r=o.split(" "),r.length>1){var x=r[1].trim().toLowerCase();t.object.smooth=x!=="0"&&x!=="off"}else t.object.smooth=!0;var w=t.object.currentMaterial();w&&(w.smooth=t.object.smooth)}else{if(o==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+o+'"')}}}}}return t.finalize(),t}function yp(n,t,e){for(var r=new Kn,i=t.split(`
|
|
934
|
-
`),a={name:""},o=/\s+/,s={},u=0;u<i.length;u++){var l=i[u];if(l=l.trim(),!(l.length===0||l.charAt(0)==="#")){var c=l.indexOf(" "),d=c>=0?l.substring(0,c):l;d=d.toLowerCase();var p=c>=0?l.substring(c+1):"";if(p=p.trim(),d==="newmtl")a={name:p},s[p]=a;else if(d==="ka"||d==="kd"||d==="ks"||d==="ke"){var A=p.split(o,3);a[d]=[parseFloat(A[0]),parseFloat(A[1]),parseFloat(A[2])]}else(d==="map_kd"||d==="map_ks"||d==="map_ke"||d==="norm"||d==="map_bump"||d==="bump"||d==="map_d"||d==="ns"||d==="d"||d==="tr")&&(a[d]=p)}}function h(g){var m={url:"",scale:new f.Vector2(1,1),offset:new f.Vector2(0,0),bumpScale:1},y=g.split(/\s+/),b;return b=y.indexOf("-bm"),b>=0&&(m.bumpScale=parseFloat(y[b+1]),y.splice(b,2)),b=y.indexOf("-s"),b>=0&&(m.scale.set(parseFloat(y[b+1]),parseFloat(y[b+2])),y.splice(b,4)),b=y.indexOf("-o"),b>=0&&(m.offset.set(parseFloat(y[b+1]),parseFloat(y[b+2])),y.splice(b,4)),m.url=y.join(" ").trim(),m}function v(g,m,y){var b=h(y),x=st(e.path,b.url);return r.loadTexture(x,{fetcher:e.fetcher,encoding:m==="map"||m==="emissiveMap"?f.sRGBEncoding:f.LinearEncoding,minFilter:f.LinearFilter,magFilter:f.LinearFilter,wrapS:f.RepeatWrapping,wrapT:f.RepeatWrapping}).then(function(w){var E=w.body;return E.repeat.copy(b.scale),E.offset.copy(b.offset),g.bumpScale=b.bumpScale,g[m]=E,E})}return{name:n,create:function(g){var m=new Ar(e.materialType),y=[],b=s[g];if(b){if(b.kd!==void 0&&m.color.fromArray(b.kd),b.ks!==void 0&&m.specular.fromArray(b.ks),b.ke!==void 0&&m.emissive.fromArray(b.ke),b.map_kd!==void 0&&y.push(v(m,"map",b.map_kd)),b.map_ks!==void 0&&y.push(v(m,"specularMap",b.map_ks)),b.map_ke!==void 0&&y.push(v(m,"emissiveMap",b.map_ke)),b.norm!==void 0&&y.push(v(m,"normalMap",b.norm)),b.map_bump!==void 0&&y.push(v(m,"bumpMap",b.map_bump)),b.bump!==void 0&&y.push(v(m,"bumpMap",b.bump)),b.map_d!==void 0&&y.push(v(m,"alphaMap",b.map_d)),b.ns!==void 0&&(m.shininess=parseFloat(b.ns)),b.d!==void 0){var x=parseFloat(b.d);x<1&&(m.opacity=x,m.transparent=!0)}if(b.tr!==void 0){var x=parseFloat(b.tr);x>0&&(m.opacity=1-x,m.transparent=!0)}}var w=Promise.all(y).then(function(E){return m.refreshUniforms(),E});return[m,w]}}}function bp(n,t){for(var e,r,i=[],a=[],o=new f.Group,s=function(c,d){var p=n.objects[c],A=p.geometry,h=p.materials,v=!1;if(A.vertices.length===0)return"continue";var g=new f.BufferGeometry;a.push(function(){return g.dispose()}),g.setAttribute("position",new f.BufferAttribute(new Float32Array(A.vertices),3)),A.normals.length>0&&g.setAttribute("normal",new f.BufferAttribute(new Float32Array(A.normals),3)),A.colors.length>0&&(v=!0,g.setAttribute("color",new f.BufferAttribute(new Float32Array(A.colors),3))),A.uvs.length>0&&g.setAttribute("uv",new f.BufferAttribute(new Float32Array(A.uvs),2)),A.index.length>0&&g.setIndex(new f.BufferAttribute(new Uint32Array(A.index),1)),g.computeBoundingBox(),g.computeBoundingSphere();for(var m=[],y=function(S,C){var R=h[S],B=R.name+"_"+R.smooth+"_"+v,M=n.materials[B];if(!M){for(var I=null,L=0,T=t;L<T.length;L++){var F=T[L],D=F.name,V=F.create;D===R.mtllib&&(I=V(R.name))}if(!I){var z=new Ar;z.refreshUniforms(),I=[z,Promise.resolve([])]}M=I[0],M.name=R.name,M.flatShading=!(R.smooth||g.attributes.normal),M.vertexColors=v,n.materials[B]=M;var Q=I[1];i.push(Q),a.push(function(){return M.dispose()})}m.push(M)},b=0,x=h.length;b<x;b++)y(b);for(var b=0,x=h.length;b<x;b++){var w=h[b];g.addGroup((e=w.groupStart)!==null&&e!==void 0?e:0,(r=w.groupCount)!==null&&r!==void 0?r:0,b)}var E=new kt(g,m);E.name=p.name,o.add(E)},u=0,l=n.objects.length;u<l;u++)s(u);return Promise.all(i).then(function(c){for(var d=[],p=0,A=c;p<A.length;p++){var h=A[p];d=d.concat(h)}return{scene:o,textures:d,dispose:function(){return a.forEach(function(v){return v()})}}})}function xp(n,t){var e,r,i;t===void 0&&(t={});var a=(e=t.upAxis)!==null&&e!==void 0?e:"Z",o=(r=t.materialType)!==null&&r!==void 0?r:"basic",s=(i=t.fetcher)!==null&&i!==void 0?i:new Qt({allowHosts:["*"]}),u=n.slice(0,n.lastIndexOf("/")+1),l=0,c;return Promise.resolve().then(function(){return s.ajax(n,{responseType:"arraybuffer"})}).then(function(d){l=d.body.byteLength;var p=new TextDecoder;return p.decode(d.body)}).then(function(d){return c=gp(d),Promise.all(c.materialLibraries.map(function(p){var A=st(u,p),h=A.slice(0,A.lastIndexOf("/")+1);return s.ajax(A,{responseType:"text"}).then(function(v){return yp(p,v.body,{path:h,materialType:o,fetcher:s})})}))}).then(function(d){return bp(c,d)}).then(function(d){var p=new f.Matrix4;return a==="Y"&&p.premultiply(dp),d.scene.applyMatrix4(p),{type:"obj",upAxis:"Z",uri:n,byteLength:l,scene:d.scene,textures:d.textures,dispose:function(){return d.dispose()}}})}var Kt=Uint8Array,Dn=Uint16Array,wp=Int32Array,dl=new Kt([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),hl=new Kt([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ep=new Kt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),pl=function(n,t){for(var e=new Dn(31),r=0;r<31;++r)e[r]=t+=1<<n[r-1];for(var i=new wp(e[30]),r=1;r<30;++r)for(var a=e[r];a<e[r+1];++a)i[a]=a-e[r]<<5|r;return{b:e,r:i}},vl=pl(dl,2),ml=vl.b,Sp=vl.r;ml[28]=258,Sp[258]=28;var Mp=pl(hl,0),Cp=Mp.b,wo=new Dn(32768);for(var _e=0;_e<32768;++_e){var $r=(_e&43690)>>1|(_e&21845)<<1;$r=($r&52428)>>2|($r&13107)<<2,$r=($r&61680)>>4|($r&3855)<<4,wo[_e]=(($r&65280)>>8|($r&255)<<8)>>1}var ui=function(n,t,e){for(var r=n.length,i=0,a=new Dn(t);i<r;++i)n[i]&&++a[n[i]-1];var o=new Dn(t);for(i=1;i<t;++i)o[i]=o[i-1]+a[i-1]<<1;var s;if(e){s=new Dn(1<<t);var u=15-t;for(i=0;i<r;++i)if(n[i])for(var l=i<<4|n[i],c=t-n[i],d=o[n[i]-1]++<<c,p=d|(1<<c)-1;d<=p;++d)s[wo[d]>>u]=l}else for(s=new Dn(r),i=0;i<r;++i)n[i]&&(s[i]=wo[o[n[i]-1]++]>>15-n[i]);return s},Ci=new Kt(288);for(var _e=0;_e<144;++_e)Ci[_e]=8;for(var _e=144;_e<256;++_e)Ci[_e]=9;for(var _e=256;_e<280;++_e)Ci[_e]=7;for(var _e=280;_e<288;++_e)Ci[_e]=8;var Al=new Kt(32);for(var _e=0;_e<32;++_e)Al[_e]=5;var Ip=ui(Ci,9,1),Tp=ui(Al,5,1),Ha=function(n){for(var t=n[0],e=1;e<n.length;++e)n[e]>t&&(t=n[e]);return t},ur=function(n,t,e){var r=t/8|0;return(n[r]|n[r+1]<<8)>>(t&7)&e},Ga=function(n,t){var e=t/8|0;return(n[e]|n[e+1]<<8|n[e+2]<<16)>>(t&7)},Pp=function(n){return(n+7)/8|0},Yo=function(n,t,e){return(t==null||t<0)&&(t=0),(e==null||e>n.length)&&(e=n.length),new Kt(n.subarray(t,e))},Rp=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Nt=function(n,t,e){var r=new Error(t||Rp[n]);if(r.code=n,Error.captureStackTrace&&Error.captureStackTrace(r,Nt),!e)throw r;return r},gl=function(n,t,e,r){var i=n.length,a=r?r.length:0;if(!i||t.f&&!t.l)return e||new Kt(0);var o=!e,s=o||t.i!=2,u=t.i;o&&(e=new Kt(i*3));var l=function(de){var se=e.length;if(de>se){var ye=new Kt(Math.max(se*2,de));ye.set(e),e=ye}},c=t.f||0,d=t.p||0,p=t.b||0,A=t.l,h=t.d,v=t.m,g=t.n,m=i*8;do{if(!A){c=ur(n,d,1);var y=ur(n,d+1,3);if(d+=3,y)if(y==1)A=Ip,h=Tp,v=9,g=5;else if(y==2){var E=ur(n,d,31)+257,S=ur(n,d+10,15)+4,C=E+ur(n,d+5,31)+1;d+=14;for(var R=new Kt(C),B=new Kt(19),M=0;M<S;++M)B[Ep[M]]=ur(n,d+M*3,7);d+=S*3;for(var I=Ha(B),L=(1<<I)-1,T=ui(B,I,1),M=0;M<C;){var F=T[ur(n,d,L)];d+=F&15;var b=F>>4;if(b<16)R[M++]=b;else{var D=0,V=0;for(b==16?(V=3+ur(n,d,3),d+=2,D=R[M-1]):b==17?(V=3+ur(n,d,7),d+=3):b==18&&(V=11+ur(n,d,127),d+=7);V--;)R[M++]=D}}var z=R.subarray(0,E),Q=R.subarray(E);v=Ha(z),g=Ha(Q),A=ui(z,v,1),h=ui(Q,g,1)}else Nt(1);else{var b=Pp(d)+4,x=n[b-4]|n[b-3]<<8,w=b+x;if(w>i){u&&Nt(0);break}s&&l(p+x),e.set(n.subarray(b,w),p),t.b=p+=x,t.p=d=w*8,t.f=c;continue}if(d>m){u&&Nt(0);break}}s&&l(p+131072);for(var q=(1<<v)-1,G=(1<<g)-1,K=d;;K=d){var D=A[Ga(n,d)&q],j=D>>4;if(d+=D&15,d>m){u&&Nt(0);break}if(D||Nt(2),j<256)e[p++]=j;else if(j==256){K=d,A=null;break}else{var J=j-254;if(j>264){var M=j-257,W=dl[M];J=ur(n,d,(1<<W)-1)+ml[M],d+=W}var $=h[Ga(n,d)&G],Y=$>>4;$||Nt(3),d+=$&15;var Q=Cp[Y];if(Y>3){var W=hl[Y];Q+=Ga(n,d)&(1<<W)-1,d+=W}if(d>m){u&&Nt(0);break}s&&l(p+131072);var Z=p+J;if(p<Q){var oe=a-Q,ne=Math.min(Q,Z);for(oe+p<0&&Nt(3);p<ne;++p)e[p]=r[oe+p]}for(;p<Z;++p)e[p]=e[p-Q]}}t.l=A,t.p=K,t.b=p,t.f=c,A&&(c=1,t.m=v,t.d=h,t.n=g)}while(!c);return p!=e.length&&o?Yo(e,0,p):e.subarray(0,p)},Bp=new Kt(0),Mr=function(n,t){return n[t]|n[t+1]<<8},hr=function(n,t){return(n[t]|n[t+1]<<8|n[t+2]<<16|n[t+3]<<24)>>>0},Ka=function(n,t){return hr(n,t)+hr(n,t+4)*4294967296},Fp=function(n,t){return((n[0]&15)!=8||n[0]>>4>7||(n[0]<<8|n[1])%31)&&Nt(6,"invalid zlib data"),(n[1]>>5&1)==+!t&&Nt(6,"invalid zlib data: "+(n[1]&32?"need":"unexpected")+" dictionary"),(n[1]>>3&4)+2};function Lp(n,t){return gl(n,{i:2},t&&t.out,t&&t.dictionary)}function kp(n,t){return gl(n.subarray(Fp(n,t),-4),{i:2},t,t)}var Eo=typeof TextDecoder!="undefined"&&new TextDecoder,Op=0;try{Eo.decode(Bp,{stream:!0}),Op=1}catch(n){}var Dp=function(n){for(var t="",e=0;;){var r=n[e++],i=(r>127)+(r>223)+(r>239);if(e+i>n.length)return{s:t,r:Yo(n,e-1)};i?i==3?(r=((r&15)<<18|(n[e++]&63)<<12|(n[e++]&63)<<6|n[e++]&63)-65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023)):i&1?t+=String.fromCharCode((r&31)<<6|n[e++]&63):t+=String.fromCharCode((r&15)<<12|(n[e++]&63)<<6|n[e++]&63):t+=String.fromCharCode(r)}};function Vp(n,t){if(t){for(var e="",r=0;r<n.length;r+=16384)e+=String.fromCharCode.apply(null,n.subarray(r,r+16384));return e}else{if(Eo)return Eo.decode(n);var i=Dp(n),a=i.s,e=i.r;return e.length&&Nt(8),a}}var Np=function(n,t){return t+30+Mr(n,t+26)+Mr(n,t+28)},zp=function(n,t,e){var r=Mr(n,t+28),i=Vp(n.subarray(t+46,t+46+r),!(Mr(n,t+8)&2048)),a=t+46+r,o=hr(n,t+20),s=e&&o==4294967295?Up(n,a):[o,hr(n,t+24),hr(n,t+42)],u=s[0],l=s[1],c=s[2];return[Mr(n,t+10),u,l,i,a+Mr(n,t+30)+Mr(n,t+32),c]},Up=function(n,t){for(;Mr(n,t)!=1;t+=4+Mr(n,t+2));return[Ka(n,t+12),Ka(n,t+4),Ka(n,t+20)]};function Qp(n,t){for(var e={},r=n.length-22;hr(n,r)!=101010256;--r)(!r||n.length-r>65558)&&Nt(13);var i=Mr(n,r+8);if(!i)return{};var a=hr(n,r+16),o=a==4294967295||i==65535;if(o){var s=hr(n,r-12);o=hr(n,s)==101075792,o&&(i=hr(n,s+32),a=hr(n,s+48))}for(var u=0;u<i;++u){var l=zp(n,a,o),c=l[0],d=l[1],p=l[2],A=l[3],h=l[4],v=l[5],g=Np(n,v);a=h,c?c==8?e[A]=Lp(n.subarray(g,g+d),{out:new Kt(p)}):Nt(14,"unknown compression type "+c):e[A]=Yo(n,g,g+d)}return e}var qp=new f.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function yl(n,t){var e;t===void 0&&(t={});var r=(e=t.fetcher)!==null&&e!==void 0?e:new Qt({allowHosts:["*"]}),i=0;return Promise.resolve().then(function(){return r.ajax(n,{responseType:"arraybuffer"}).then(function(a){return i=a.body.byteLength,a.body})}).then(function(a){var o;return Hp(a,{materialType:t.materialType,resourcePath:n.slice(0,n.lastIndexOf("/")+1),search:(o=n.split("?")[1])!==null&&o!==void 0?o:"",fetcher:r})}).then(function(a){var o=a.scene,s=a.unitScale/100,u=new f.Matrix4;return u.makeScale(s,s,s),a.upAxis==="Y"&&u.premultiply(qp),o.applyMatrix4(u),{type:"fbx",upAxis:"Z",uri:n,byteLength:i,scene:o,textures:a.textures,dispose:function(){return a.dispose()}}})}function Hp(n,t){var e;if(Xp(n))e=new Jp().parse(n);else{var r=xl(n);if(!Wp(r))throw new Error("THREE.FBXLoader: Unknown format.");if(i0(r)<7e3)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+i0(r));e=new jp().parse(r)}return new Gp(t).parse(e)}var Gp=function(){function n(t){var e,r,i;this.materialType=(e=t.materialType)!==null&&e!==void 0?e:"phong",this.resourcePath=(r=t.resourcePath)!==null&&r!==void 0?r:"",this.search=(i=t.search)!==null&&i!==void 0?i:"",this.fetcher=t.fetcher}return n.prototype.parse=function(t){var e,r,i,a,o,s,u=this.parseConnections(t),l=new f.Group,c=[],d=this.parseImages(t),p=this.parseTextures(t,d,u,c),A=this.parseMaterials(t,p,u),h=this.parseDeformers(t,u),v=new Kp().parse(t,h,u);this.parseScene(t,h,v,A,u,l);var g=(r=(e=t.GlobalSettings.UpAxis)===null||e===void 0?void 0:e.value)!==null&&r!==void 0?r:1,m=(a=(i=t.GlobalSettings.FrontAxis)===null||i===void 0?void 0:i.value)!==null&&a!==void 0?a:2,y=(s=(o=t.GlobalSettings.UnitScaleFactor)===null||o===void 0?void 0:o.value)!==null&&s!==void 0?s:1,b;if(t.GlobalSettings.AmbientColor){var x=t.GlobalSettings.AmbientColor.value,w=x[0],E=x[1],S=x[2];if(w!==0||E!==0||S!==0){var C=new f.Color().setRGB(w,E,S);b=new f.AmbientLight(C,1)}}return Promise.all(c).then(function(R){return{scene:l,textures:R,ambientLight:b,upAxis:["X","Y","Z"][g],frontAxis:["X","Y","Z"][m],unitScale:y,dispose:function(){R.forEach(function(B){return B.dispose()}),A.forEach(function(B){return B.dispose()}),v.forEach(function(B){return B.dispose()})}}})},n.prototype.parseConnections=function(t){var e=new Map;if("Connections"in t){var r=t.Connections.connections;r.forEach(function(i){var a=i[0],o=i[1],s=i[2];e.has(a)||e.set(a,{parents:[],children:[]});var u={ID:o,relationship:s};e.get(a).parents.push(u),e.has(o)||e.set(o,{parents:[],children:[]});var l={ID:a,relationship:s};e.get(o).children.push(l)})}return e},n.prototype.parseImages=function(t){var e={},r={};if("Video"in t.Objects){var i=t.Objects.Video;for(var a in i){var o=i[a],s=parseInt(a);if(e[s]=o.RelativeFilename||o.Filename,"Content"in o){var u=o.Content instanceof ArrayBuffer&&o.Content.byteLength>0,l=typeof o.Content=="string"&&o.Content!=="";if(u||l){var c=this.parseImage(i[a]);r[o.RelativeFilename||o.Filename]=c}}}}for(var s in e){var d=e[s];r[d]!==void 0?e[s]=r[d]:e[s]=e[s].split("\\").pop()}return e},n.prototype.parseImage=function(t){var e=t.Content,r=t.RelativeFilename||t.Filename,i=r.slice(r.lastIndexOf(".")+1).toLowerCase(),a;switch(i){case"bmp":a="image/bmp";break;case"jpg":case"jpeg":a="image/jpeg";break;case"png":a="image/png";break;case"tif":a="image/tiff";break;case"tga":a="image/tga";break;default:return}if(typeof e=="string")return"data:"+a+";base64,"+e;var o=new Uint8Array(e);return window.URL.createObjectURL(new Blob([o],{type:a}))},n.prototype.parseTextures=function(t,e,r,i){var a=new Map;if("Texture"in t.Objects){var o=t.Objects.Texture;for(var s in o){var u=this.parseTexture(o[s],e,r,i);a.set(parseInt(s),u)}}return a},n.prototype.parseTexture=function(t,e,r,i){var a=this.loadTexture(t,e,r,i);a.ID=t.id,a.name=t.attrName;var o=t.WrapModeU,s=t.WrapModeV,u=o!==void 0?o.value:0,l=s!==void 0?s.value:0;if(a.wrapS=u===0?f.RepeatWrapping:f.ClampToEdgeWrapping,a.wrapT=l===0?f.RepeatWrapping:f.ClampToEdgeWrapping,t.Scaling){var c=t.Scaling.value;a.repeat.x=c[0],a.repeat.y=c[1]}if(t.Translation){var c=t.Translation.value;a.offset.x=c[0],a.offset.y=c[1]}return a},n.prototype.loadTexture=function(t,e,r,i){var a=r.get(t.id).children,o="";a!==void 0&&a.length>0&&e[a[0].ID]!==void 0&&(o=e[a[0].ID]),o=st(this.resourcePath,fa(o,this.search));var s=Object.assign(new f.Texture,{ID:0}),u;u=this.fetcher.loadImage(o,{},void 0,void 0,void 0,hi()).then(function(c){return c.body});var l=u.then(function(c){return s.image=c,s.needsUpdate=!0,s});return i.push(l),s},n.prototype.parseMaterials=function(t,e,r){var i=new Map;if("Material"in t.Objects){var a=t.Objects.Material;for(var o in a){var s=this.parseMaterial(t,a[o],e,r);s!==null&&i.set(parseInt(o),s)}}return i},n.prototype.parseMaterial=function(t,e,r,i){var a=e.id;e.attrName;var o=e.ShadingModel;if(typeof o=="object"&&(o=o.value),o=o.toLowerCase(),!i.has(a))return null;var s=new Ar(this.materialType);e.BumpFactor&&(s.bumpScale=e.BumpFactor.value),e.Diffuse?s.color=new f.Color().fromArray(e.Diffuse.value):e.DiffuseColor&&(e.DiffuseColor.type==="Color"||e.DiffuseColor.type==="ColorRGB")&&(s.color=new f.Color().fromArray(e.DiffuseColor.value)),e.DisplacementFactor&&(s.displacementScale=e.DisplacementFactor.value),e.Emissive?s.emissive=new f.Color().fromArray(e.Emissive.value):e.EmissiveColor&&(e.EmissiveColor.type==="Color"||e.EmissiveColor.type==="ColorRGB")&&(s.emissive=new f.Color().fromArray(e.EmissiveColor.value)),e.EmissiveFactor&&(s.emissiveIntensity=parseFloat(e.EmissiveFactor.value));var u=1-(e.TransparencyFactor?parseFloat(e.TransparencyFactor.value):0);(u===1||u===0)&&(u=e.Opacity?parseFloat(e.Opacity.value):null,u===null&&(u=1-(e.TransparentColor?parseFloat(e.TransparentColor.value[0]):0))),s.opacity=u,s.opacity<1&&(s.transparent=!0),e.ReflectionFactor&&(s.reflectivity=e.ReflectionFactor.value),e.Shininess&&(s.shininess=e.Shininess.value),e.Specular?s.specular=new f.Color().fromArray(e.Specular.value):e.SpecularColor&&e.SpecularColor.type==="Color"&&(s.specular=new f.Color().fromArray(e.SpecularColor.value));var l=this;return i.get(a).children.forEach(function(c){var d=c.relationship;switch(d){case"Bump":s.bumpMap=l.getTexture(t,r,c.ID,i);break;case"Maya|TEX_ao_map":s.aoMap=l.getTexture(t,r,c.ID,i);break;case"DiffuseColor":case"Maya|TEX_color_map":s.map=l.getTexture(t,r,c.ID,i),s.map!==void 0&&(s.map.encoding=f.sRGBEncoding);break;case"DisplacementColor":s.displacementMap=l.getTexture(t,r,c.ID,i);break;case"EmissiveColor":s.emissiveMap=l.getTexture(t,r,c.ID,i),s.emissiveMap!==void 0&&(s.emissiveMap.encoding=f.sRGBEncoding);break;case"NormalMap":case"Maya|TEX_normal_map":s.normalMap=l.getTexture(t,r,c.ID,i);break;case"ReflectionColor":s.envMap=l.getTexture(t,r,c.ID,i),s.envMap!==void 0&&(s.envMap.mapping=f.EquirectangularReflectionMapping,s.envMap.encoding=f.sRGBEncoding);break;case"SpecularColor":s.specularMap=l.getTexture(t,r,c.ID,i),s.specularMap!==void 0&&(s.specularMap.encoding=f.sRGBEncoding);break;case"TransparentColor":case"TransparencyFactor":s.alphaMap=l.getTexture(t,r,c.ID,i),s.transparent=!0;break;case"AmbientColor":case"ShininessExponent":case"SpecularFactor":case"VectorDisplacementColor":default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",d);break}}),s.refreshUniforms(),s},n.prototype.getTexture=function(t,e,r,i){return t.Objects.LayeredTexture&&r in t.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),r=i.get(r).children[0].ID),e.get(r)},n.prototype.parseDeformers=function(t,e){var r={},i={};if("Deformer"in t.Objects){var a=t.Objects.Deformer;for(var o in a){var s=a[o],u=e.get(parseInt(o));if(s.attrType==="Skin"){var l=this.parseSkeleton(u,a);l.ID=o,u.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),l.geometryID=u.parents[0].ID,r[o]=l}else if(s.attrType==="BlendShape"){var c={id:o};c.rawTargets=this.parseMorphTargets(u,a,e),c.id=o,u.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),i[o]=c}}}return{skeletons:r,morphTargets:i}},n.prototype.parseSkeleton=function(t,e){var r=[];return t.children.forEach(function(i){var a=e[i.ID];if(a.attrType==="Cluster"){var o={ID:i.ID,indices:[],weights:[],transformLink:new f.Matrix4().fromArray(a.TransformLink.a)};a.Indexes&&(o.indices=a.Indexes.a,o.weights=a.Weights.a),r.push(o)}}),{ID:"",geometryID:0,rawBones:r,bones:[]}},n.prototype.parseMorphTargets=function(t,e,r){for(var i=[],a=0;a<t.children.length;a++){var o=t.children[a],s=e[o.ID],u={name:s.attrName,initialWeight:s.DeformPercent,id:s.id,fullWeights:s.FullWeights.a,geoID:0};if(s.attrType!=="BlendShapeChannel")return;u.geoID=r.get(parseInt(o.ID)).children.filter(function(l){return l.relationship===void 0})[0].ID,i.push(u)}return i},n.prototype.parseScene=function(t,e,r,i,a,o){var s=this.parseModels(t,e.skeletons,r,i,a),u=t.Objects.Model,l=this;s.forEach(function(d){var p=u[d.ID];l.setLookAtProperties(t,d,p,a,o);var A=a.get(d.ID).parents;A.forEach(function(h){var v=s.get(h.ID);v!==void 0&&v.add(d)}),d.parent===null&&o.add(d)}),this.bindSkeleton(t,e.skeletons,r,s,a),o.traverse(function(d){if(d.userData.transformData){d.parent&&(d.userData.transformData.parentMatrix=d.parent.matrix,d.userData.transformData.parentMatrixWorld=d.parent.matrixWorld);var p=bl(d.userData.transformData);d.applyMatrix4(p),d.updateWorldMatrix(!0,!0)}});var c=new _p().parse(t,a,o);o.children.length===1&&o.children[0]instanceof f.Group&&(o.children[0].animations=c,o=o.children[0]),o.animations=c},n.prototype.parseModels=function(t,e,r,i,a){var o=new Map,s=t.Objects.Model;for(var u in s){var l=parseInt(u),c=s[u],d=a.get(l),p=this.buildSkeleton(d,e,l,c.attrName);if(!p){switch(c.attrType){case"Camera":p=this.createCamera(t,d);break;case"Light":p=this.createLight(t,d);break;case"Mesh":p=this.createMesh(d,r,i);break;case"NurbsCurve":case"LimbNode":case"Root":p=new f.Bone;break;case"Null":default:p=new f.Group;break}p.name=c.attrName?f.PropertyBinding.sanitizeNodeName(c.attrName):"",p.userData.originalName=c.attrName,p.ID=l}this.getTransformData(p,c),o.set(l,p)}return o},n.prototype.buildSkeleton=function(t,e,r,i){var a=null;return t.parents.forEach(function(o){var s=function(l){var c=e[l];c.rawBones.forEach(function(d,p){if(d.ID===o.ID){var A=a;a=new f.Bone,a.matrixWorld.copy(d.transformLink),a.name=i?f.PropertyBinding.sanitizeNodeName(i):"",a.userData.originalName=i,a.ID=r,c.bones[p]=a,A!==null&&a.add(A)}})};for(var u in e)s(u)}),a},n.prototype.createCamera=function(t,e){var r,i;if(e.children.forEach(function(A){var h=t.Objects.NodeAttribute[A.ID];h!==void 0&&(i=h)}),i===void 0)r=new f.Object3D;else{var a=0;i.CameraProjectionType!==void 0&&i.CameraProjectionType.value===1&&(a=1);var o=1;i.NearPlane!==void 0&&(o=i.NearPlane.value/1e3);var s=1e3;i.FarPlane!==void 0&&(s=i.FarPlane.value/1e3);var u=window.innerWidth,l=window.innerHeight;i.AspectWidth!==void 0&&i.AspectHeight!==void 0&&(u=i.AspectWidth.value,l=i.AspectHeight.value);var c=u/l,d=45;i.FieldOfView!==void 0&&(d=i.FieldOfView.value);var p=i.FocalLength?i.FocalLength.value:null;switch(a){case 0:r=new f.PerspectiveCamera(d,c,o,s),p!==null&&r.setFocalLength(p);break;case 1:console.warn("THREE.FBXLoader: Orthographic cameras not supported yet."),r=new f.Object3D;break;default:console.warn("THREE.FBXLoader: Unknown camera type "+a+"."),r=new f.Object3D;break}}return r},n.prototype.createLight=function(t,e){var r,i;if(e.children.forEach(function(p){var A=t.Objects.NodeAttribute[p.ID];A!==void 0&&(i=A)}),i===void 0)r=new f.Object3D;else{var a=void 0;i.LightType===void 0?a=0:a=i.LightType.value;var o=new f.Color(16777215);i.Color!==void 0&&(o=new f.Color().fromArray(i.Color.value));var s=i.Intensity===void 0?1:i.Intensity.value/100;i.CastLightOnObject!==void 0&&i.CastLightOnObject.value===0&&(s=0);var u=0;i.FarAttenuationEnd!==void 0&&(i.EnableFarAttenuation!==void 0&&i.EnableFarAttenuation.value===0?u=0:u=i.FarAttenuationEnd.value);var l=1;switch(a){case 0:r=new f.PointLight(o,s,u,l);break;case 1:r=new f.DirectionalLight(o,s);break;case 2:var c=Math.PI/3;i.InnerAngle!==void 0&&(c=f.MathUtils.degToRad(i.InnerAngle.value));var d=0;i.OuterAngle!==void 0&&(d=f.MathUtils.degToRad(i.OuterAngle.value),d=Math.max(d,1)),r=new f.SpotLight(o,s,u,c,d,l);break;default:console.warn("THREE.FBXLoader: Unknown light type "+i.LightType.value+", defaulting to a PointLight."),r=new f.PointLight(o,s);break}i.CastShadows!==void 0&&i.CastShadows.value===1&&(r.castShadow=!0)}return r},n.prototype.createMesh=function(t,e,r){var i,a=null,o=[];if(t.children.forEach(function(u){e.has(u.ID)&&(a=e.get(u.ID)),r.has(u.ID)&&o.push(r.get(u.ID))}),o.length===0){var s=new Ar(this.materialType);s.color=new f.Color(13421772),o.push(s)}return"color"in a.attributes&&o.forEach(function(u){u.vertexColors=!0}),(!a.groups||a.groups.length===0)&&a.addGroup(0,a.index?a.index.count:a.attributes.position.count,0),a.FBX_Deformer?(i=new hu(a,o),i.normalizeSkinWeights()):i=new kt(a,o),i},n.prototype.createCurve=function(t,e){var r=t.children.reduce(function(a,o){return e.has(o.ID)&&(a=e.get(o.ID)),a},null),i=new f.LineBasicMaterial({name:"",color:3342591,linewidth:1});return new f.Line(r,i)},n.prototype.getTransformData=function(t,e){var r={};e.InheritType&&(r.inheritType=parseInt(e.InheritType.value)),e.RotationOrder?r.eulerOrder=pi(e.RotationOrder.value):r.eulerOrder=pi(0),e.Lcl_Translation&&(r.translation=e.Lcl_Translation.value),e.PreRotation&&(r.preRotation=e.PreRotation.value),e.Lcl_Rotation&&(r.rotation=e.Lcl_Rotation.value),e.PostRotation&&(r.postRotation=e.PostRotation.value),e.Lcl_Scaling&&(r.scale=e.Lcl_Scaling.value),e.ScalingOffset&&(r.scalingOffset=e.ScalingOffset.value),e.ScalingPivot&&(r.scalingPivot=e.ScalingPivot.value),e.RotationOffset&&(r.rotationOffset=e.RotationOffset.value),e.RotationPivot&&(r.rotationPivot=e.RotationPivot.value),t.userData.transformData=r},n.prototype.setLookAtProperties=function(t,e,r,i,a){if("LookAtProperty"in r){var o=i.get(e.ID).children;o.forEach(function(s){if(s.relationship==="LookAtProperty"){var u=t.Objects.Model[s.ID];if(u.Lcl_Translation){var l=u.Lcl_Translation.value;"target"in e&&e.target instanceof f.Object3D?(e.target.position.fromArray(l),a.add(e.target)):e.lookAt(new f.Vector3().fromArray(l))}}})}},n.prototype.bindSkeleton=function(t,e,r,i,a){var o=this.parsePoseNodes(t),s=function(l){var c=e[l],d=a.get(parseInt(c.ID)).parents;d.forEach(function(p){if(r.has(p.ID)){var A=p.ID,h=a.get(A);h.parents.forEach(function(v){if(i.has(v.ID)){var g=i.get(v.ID);g instanceof f.SkinnedMesh&&g.bind(new f.Skeleton(c.bones),o[v.ID])}})}})};for(var u in e)s(u)},n.prototype.parsePoseNodes=function(t){var e={};if(t.Objects.Pose){var r=t.Objects.Pose;for(var i in r)if(r[i].attrType==="BindPose"&&r[i].NbPoseNodes>0){var a=r[i].PoseNode;Array.isArray(a)?a.forEach(function(o){e[o.Node]=new f.Matrix4().fromArray(o.Matrix.a)}):e[a.Node]=new f.Matrix4().fromArray(a.Matrix.a)}}return e},n}(),Kp=function(){function n(){this.negativeMaterialIndices=!1}return n.prototype.parse=function(t,e,r){var i=new Map;if("Geometry"in t.Objects){var a=t.Objects.Geometry;for(var o in a){var s=r.get(parseInt(o)),u=this.parseGeometry(t,s,a[o],e);i.set(parseInt(o),u)}}return this.negativeMaterialIndices===!0&&console.warn("THREE.FBXLoader: The FBX file contains invalid (negative) material indices. The asset might not render as expected."),i},n.prototype.parseGeometry=function(t,e,r,i){switch(r.attrType){case"Mesh":return this.parseMeshGeometry(t,e,r,i);case"NurbsCurve":return this.parseNurbsGeometry(r)}},n.prototype.parseMeshGeometry=function(t,e,r,i){var a=i.skeletons,o=[],s=e.parents.map(function(p){return t.Objects.Model[p.ID]});if(s.length!==0){var u=e.children.reduce(function(p,A){return a[A.ID]!==void 0&&(p=a[A.ID]),p},null);e.children.forEach(function(p){i.morphTargets[p.ID]!==void 0&&o.push(i.morphTargets[p.ID])});var l=s[0],c={};l.RotationOrder&&(c.eulerOrder=pi(l.RotationOrder.value)),l.InheritType&&(c.inheritType=parseInt(l.InheritType.value)),l.GeometricTranslation&&(c.translation=l.GeometricTranslation.value),l.GeometricRotation&&(c.rotation=l.GeometricRotation.value),l.GeometricScaling&&(c.scale=l.GeometricScaling.value);var d=bl(c);return this.genGeometry(t,r,u,o,d)}},n.prototype.genGeometry=function(t,e,r,i,a){var o=new f.BufferGeometry;e.attrName&&(o.name=e.attrName);var s=this.parseGeoNode(e,r),u=this.genBuffers(s),l=new f.Float32BufferAttribute(u.vertex,3);if(l.applyMatrix4(a),o.setAttribute("position",l),u.colors.length>0&&o.setAttribute("color",new f.Float32BufferAttribute(u.colors,3)),r&&(o.setAttribute("skinIndex",new f.Uint16BufferAttribute(u.weightsIndices,4)),o.setAttribute("skinWeight",new f.Float32BufferAttribute(u.vertexWeights,4)),o.FBX_Deformer=r),u.normal.length>0){var c=new f.Matrix3().getNormalMatrix(a),d=new f.Float32BufferAttribute(u.normal,3);d.applyNormalMatrix(c),o.setAttribute("normal",d)}if(u.uvs.forEach(function(g,m){var y=m===0?"uv":"uv".concat(m+1);o.setAttribute(y,new f.Float32BufferAttribute(u.uvs[m],2))}),s.material&&s.material.mappingType!=="AllSame"){var p=u.materialIndex[0],A=0;if(u.materialIndex.forEach(function(g,m){g!==p&&(o.addGroup(A,m-A,p),p=g,A=m)}),o.groups.length>0){var h=o.groups[o.groups.length-1],v=h.start+h.count;v!==u.materialIndex.length&&o.addGroup(v,u.materialIndex.length-v,p)}o.groups.length===0&&o.addGroup(0,u.materialIndex.length,u.materialIndex[0])}return this.addMorphTargets(t,o,e,i,a),o},n.prototype.parseGeoNode=function(t,e){var r={};if(r.vertexPositions=t.Vertices!==void 0?t.Vertices.a:[],r.vertexIndices=t.PolygonVertexIndex!==void 0?t.PolygonVertexIndex.a:[],t.LayerElementColor&&(r.color=this.parseVertexColors(t.LayerElementColor[0])),t.LayerElementMaterial&&(r.material=this.parseMaterialIndices(t.LayerElementMaterial[0])),t.LayerElementNormal&&(r.normal=this.parseNormals(t.LayerElementNormal[0])),t.LayerElementUV){r.uv=[];for(var i=0;t.LayerElementUV[i];)t.LayerElementUV[i].UV&&r.uv.push(this.parseUVs(t.LayerElementUV[i])),i++}return r.weightTable={},e!==null&&(r.skeleton=e,e.rawBones.forEach(function(a,o){a.indices.forEach(function(s,u){r.weightTable[s]===void 0&&(r.weightTable[s]=[]),r.weightTable[s].push({id:o,weight:a.weights[u]})})})),r},n.prototype.genBuffers=function(t){var e={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]},r=0,i=0,a=!1,o=[],s=[],u=[],l=[],c=[],d=[],p=this;return t.vertexIndices.forEach(function(A,h){var v=0,g=!1;A<0&&(A=A^-1,g=!0);var m=[],y=[];if(o.push(A*3,A*3+1,A*3+2),t.color){var b=Di(h,r,A,t.color);u.push(b[0],b[1],b[2])}if(t.skeleton){if(t.weightTable[A]!==void 0&&t.weightTable[A].forEach(function(S){y.push(S.weight),m.push(S.id)}),y.length>4){a||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),a=!0);var x=[0,0,0,0],w=[0,0,0,0];y.forEach(function(S,C){var R=S,B=m[C];w.forEach(function(M,I,L){if(R>M){L[I]=R,R=M;var T=x[I];x[I]=B,B=T}})}),m=x,y=w}for(;y.length<4;)y.push(0),m.push(0);for(var E=0;E<4;++E)c.push(y[E]),d.push(m[E])}if(t.normal){var b=Di(h,r,A,t.normal);s.push(b[0],b[1],b[2])}t.material&&t.material.mappingType!=="AllSame"&&(v=Di(h,r,A,t.material)[0],v<0&&(p.negativeMaterialIndices=!0,v=0)),t.uv&&t.uv.forEach(function(S,C){var R=Di(h,r,A,S);l[C]===void 0&&(l[C]=[]),l[C].push(R[0]),l[C].push(R[1])}),i++,g&&(p.genFace(e,t,o,v,s,u,l,c,d,i),r++,i=0,o=[],s=[],u=[],l=[],c=[],d=[])}),e},n.prototype.getNormalNewell=function(t){for(var e=new f.Vector3(0,0,0),r=0;r<t.length;r++){var i=t[r],a=t[(r+1)%t.length];e.x+=(i.y-a.y)*(i.z+a.z),e.y+=(i.z-a.z)*(i.x+a.x),e.z+=(i.x-a.x)*(i.y+a.y)}return e.normalize(),e},n.prototype.getNormalTangentAndBitangent=function(t){var e=this.getNormalNewell(t),r=Math.abs(e.z)>.5?new f.Vector3(0,1,0):new f.Vector3(0,0,1),i=r.cross(e).normalize(),a=e.clone().cross(i).normalize();return{normal:e,tangent:i,bitangent:a}},n.prototype.flattenVertex=function(t,e,r){return new f.Vector2(t.dot(e),t.dot(r))},n.prototype.genFace=function(t,e,r,i,a,o,s,u,l,c){var d;if(c>3){for(var p=[],A=e.baseVertexPositions||e.vertexPositions,h=0;h<r.length;h+=3)p.push(new f.Vector3(A[r[h]],A[r[h+1]],A[r[h+2]]));for(var v=this.getNormalTangentAndBitangent(p),g=v.tangent,m=v.bitangent,y=[],b=0,x=p;b<x.length;b++){var w=x[b];y.push(this.flattenVertex(w,g,m))}d=f.ShapeUtils.triangulateShape(y,[])}else d=[[0,1,2]];for(var E=function(L,T,F){t.vertex.push(e.vertexPositions[r[L*3]]),t.vertex.push(e.vertexPositions[r[L*3+1]]),t.vertex.push(e.vertexPositions[r[L*3+2]]),t.vertex.push(e.vertexPositions[r[T*3]]),t.vertex.push(e.vertexPositions[r[T*3+1]]),t.vertex.push(e.vertexPositions[r[T*3+2]]),t.vertex.push(e.vertexPositions[r[F*3]]),t.vertex.push(e.vertexPositions[r[F*3+1]]),t.vertex.push(e.vertexPositions[r[F*3+2]]),e.skeleton&&(t.vertexWeights.push(u[L*4]),t.vertexWeights.push(u[L*4+1]),t.vertexWeights.push(u[L*4+2]),t.vertexWeights.push(u[L*4+3]),t.vertexWeights.push(u[T*4]),t.vertexWeights.push(u[T*4+1]),t.vertexWeights.push(u[T*4+2]),t.vertexWeights.push(u[T*4+3]),t.vertexWeights.push(u[F*4]),t.vertexWeights.push(u[F*4+1]),t.vertexWeights.push(u[F*4+2]),t.vertexWeights.push(u[F*4+3]),t.weightsIndices.push(l[L*4]),t.weightsIndices.push(l[L*4+1]),t.weightsIndices.push(l[L*4+2]),t.weightsIndices.push(l[L*4+3]),t.weightsIndices.push(l[T*4]),t.weightsIndices.push(l[T*4+1]),t.weightsIndices.push(l[T*4+2]),t.weightsIndices.push(l[T*4+3]),t.weightsIndices.push(l[F*4]),t.weightsIndices.push(l[F*4+1]),t.weightsIndices.push(l[F*4+2]),t.weightsIndices.push(l[F*4+3])),e.color&&(t.colors.push(o[L*3]),t.colors.push(o[L*3+1]),t.colors.push(o[L*3+2]),t.colors.push(o[T*3]),t.colors.push(o[T*3+1]),t.colors.push(o[T*3+2]),t.colors.push(o[F*3]),t.colors.push(o[F*3+1]),t.colors.push(o[F*3+2])),e.material&&e.material.mappingType!=="AllSame"&&(t.materialIndex.push(i),t.materialIndex.push(i),t.materialIndex.push(i)),e.normal&&(t.normal.push(a[L*3]),t.normal.push(a[L*3+1]),t.normal.push(a[L*3+2]),t.normal.push(a[T*3]),t.normal.push(a[T*3+1]),t.normal.push(a[T*3+2]),t.normal.push(a[F*3]),t.normal.push(a[F*3+1]),t.normal.push(a[F*3+2])),e.uv&&e.uv.forEach(function(D,V){t.uvs[V]===void 0&&(t.uvs[V]=[]),t.uvs[V].push(s[V][L*2]),t.uvs[V].push(s[V][L*2+1]),t.uvs[V].push(s[V][T*2]),t.uvs[V].push(s[V][T*2+1]),t.uvs[V].push(s[V][F*2]),t.uvs[V].push(s[V][F*2+1])})},S=0,C=d;S<C.length;S++){var R=C[S],B=R[0],M=R[1],I=R[2];E(B,M,I)}},n.prototype.addMorphTargets=function(t,e,r,i,a){if(i.length!==0){e.morphTargetsRelative=!0,e.morphAttributes.position=[];var o=this;i.forEach(function(s){s.rawTargets.forEach(function(u){var l=t.Objects.Geometry[u.geoID];l!==void 0&&o.genMorphGeometry(e,r,l,a,u.name)})})}},n.prototype.genMorphGeometry=function(t,e,r,i,a){for(var o=e.Vertices!==void 0?e.Vertices.a:[],s=e.PolygonVertexIndex!==void 0?e.PolygonVertexIndex.a:[],u=r.Vertices!==void 0?r.Vertices.a:[],l=r.Indexes?r.Indexes.a:[],c=t.attributes.position.count*3,d=new Float32Array(c),p=0;p<l.length;p++){var A=l[p]*3;d[A]=u[p*3],d[A+1]=u[p*3+1],d[A+2]=u[p*3+2]}var h={vertexIndices:s,vertexPositions:d,baseVertexPositions:o},v=this.genBuffers(h),g=new f.Float32BufferAttribute(v.vertex,3);g.name=a||r.attrName,g.applyMatrix4(i),t.morphAttributes.position.push(g)},n.prototype.parseNormals=function(t){var e=t.MappingInformationType,r=t.ReferenceInformationType,i=t.Normals.a,a=[];return r==="IndexToDirect"&&(t.NormalIndex?a=t.NormalIndex.a:t.NormalsIndex&&(a=t.NormalsIndex.a)),{dataSize:3,buffer:i,indices:a,mappingType:e,referenceType:r}},n.prototype.parseUVs=function(t){var e=t.MappingInformationType,r=t.ReferenceInformationType,i=t.UV.a,a=[];return r==="IndexToDirect"&&(a=t.UVIndex.a),{dataSize:2,buffer:i,indices:a,mappingType:e,referenceType:r}},n.prototype.parseVertexColors=function(t){var e=t.MappingInformationType,r=t.ReferenceInformationType,i=t.Colors.a,a=[];r==="IndexToDirect"&&(a=t.ColorIndex.a);for(var o=0,s=new f.Color;o<i.length;o+=4)s.fromArray(i,o),s.toArray(i,o);return{dataSize:4,buffer:i,indices:a,mappingType:e,referenceType:r}},n.prototype.parseMaterialIndices=function(t){var e=t.MappingInformationType,r=t.ReferenceInformationType;if(e==="NoMappingInformation")return{dataSize:1,buffer:[0],indices:[0],mappingType:"AllSame",referenceType:r};for(var i=t.Materials.a,a=[],o=0;o<i.length;++o)a.push(o);return{dataSize:1,buffer:i,indices:a,mappingType:e,referenceType:r}},n.prototype.parseNurbsGeometry=function(t){var e=parseInt(t.Order);if(isNaN(e))return console.error("THREE.FBXLoader: Invalid Order %s given for geometry ID: %s",t.Order,t.id),new f.BufferGeometry;for(var r=e-1,i=t.KnotVector.a,a=[],o=t.Points.a,s=0,u=o.length;s<u;s+=4)a.push(new f.Vector4().fromArray(o,s));var l,c;if(t.Form==="Closed")a.push(a[0]);else if(t.Form==="Periodic"){l=r,c=i.length-1-l;for(var s=0;s<r;++s)a.push(a[s])}var d=new tv(r,i,a,l,c),p=d.getPoints(a.length*12);return new f.BufferGeometry().setFromPoints(p)},n}(),_p=function(){function n(){}return n.prototype.parse=function(t,e,r){var i=[],a=this.parseClips(t,e,r);if(a!==void 0)for(var o in a){var s=a[o],u=this.addClip(s,r);i.push(u)}return i},n.prototype.parseClips=function(t,e,r){if(t.Objects.AnimationCurve!==void 0){var i=this.parseAnimationCurveNodes(t);this.parseAnimationCurves(t,i,e);var a=this.parseAnimationLayers(t,i,e,r),o=this.parseAnimStacks(t,a,e);return o}},n.prototype.parseAnimationCurveNodes=function(t){var e=t.Objects.AnimationCurveNode,r=new Map;for(var i in e){var a=e[i];if(a.attrName.match(/S|R|T|DeformPercent/)!==null){var o={id:a.id,attr:a.attrName,curves:{}};r.set(o.id,o)}}return r},n.prototype.parseAnimationCurves=function(t,e,r){var i=t.Objects.AnimationCurve;for(var a in i){var o={id:i[a].id,times:i[a].KeyTime.a.map(Zp),values:i[a].KeyValueFloat.a},s=r.get(o.id);if(s!==void 0){var u=s.parents[0].ID,l=s.parents[0].relationship,c=e.get(u);c&&(l.match(/X/)?c.curves.x=o:l.match(/Y/)?c.curves.y=o:l.match(/Z/)?c.curves.z=o:l.match(/DeformPercent/)&&e.has(u)&&(c.curves.morph=o))}}},n.prototype.parseAnimationLayers=function(t,e,r,i){var a=t.Objects.AnimationLayer,o=new Map,s=function(l){var c=[],d=r.get(parseInt(l));if(d!==void 0){var p=d.children;p.forEach(function(A,h){if(e.has(A.ID)){var v=e.get(A.ID);if(v.curves.x!==void 0||v.curves.y!==void 0||v.curves.z!==void 0){if(c[h]===void 0){var g=r.get(A.ID).parents.filter(function(C){return C.relationship!==void 0})[0].ID;if(g!==void 0){var m=t.Objects.Model[g.toString()];if(m===void 0){console.warn("THREE.FBXLoader: Encountered a unused curve.",A);return}var y={modelName:m.attrName?f.PropertyBinding.sanitizeNodeName(m.attrName):"",ID:m.id,initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1],transform:new f.Matrix4,eulerOrder:"",preRotation:[0,0,0],postRotation:[0,0,0]};i.traverse(function(C){C.ID===m.id&&(y.transform=C.matrix,C.userData.transformData&&(y.eulerOrder=C.userData.transformData.eulerOrder))}),y.transform||(y.transform=new f.Matrix4),m.PreRotation&&(y.preRotation=m.PreRotation.value),m.PostRotation&&(y.postRotation=m.PostRotation.value),c[h]=y}}c[h]&&(c[h][v.attr]=v)}else if(v.curves.morph!==void 0){if(c[h]===void 0){var b=r.get(A.ID).parents.filter(function(R){return R.relationship!==void 0})[0].ID,x=r.get(b).parents[0].ID,w=r.get(x).parents[0].ID,g=r.get(w).parents[0].ID,E=t.Objects.Model[g],S={modelName:E.attrName?f.PropertyBinding.sanitizeNodeName(E.attrName):"",morphName:t.Objects.Deformer[b].attrName};c[h]=S}c[h][v.attr]=v}}}),o.set(parseInt(l),c)}};for(var u in a)s(u);return o},n.prototype.parseAnimStacks=function(t,e,r){var i=t.Objects.AnimationStack,a={};for(var o in i){var s=r.get(parseInt(o)).children;s.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");var u=e.get(s[0].ID);a[o]={name:i[o].attrName,layer:u}}return a},n.prototype.addClip=function(t,e){var r=[],i=this;return t.layer.forEach(function(a){r=r.concat(i.generateTracks(a,e))}),new f.AnimationClip(t.name,-1,r)},n.prototype.generateTracks=function(t,e){var r=[],i=new f.Vector3,a=new f.Vector3;t.transform&&t.transform.decompose(i,new f.Quaternion,a);var o=i.toArray(),s=a.toArray();if(t.T!==void 0&&Object.keys(t.T.curves).length>0){var u=this.generateVectorTrack(t.modelName,t.T.curves,o,"position");u!==void 0&&r.push(u)}if(t.R!==void 0&&Object.keys(t.R.curves).length>0){var l=this.generateRotationTrack(t.modelName,t.R.curves,t.preRotation,t.postRotation,t.eulerOrder);l!==void 0&&r.push(l)}if(t.S!==void 0&&Object.keys(t.S.curves).length>0){var c=this.generateVectorTrack(t.modelName,t.S.curves,s,"scale");c!==void 0&&r.push(c)}if(t.DeformPercent!==void 0){var d=this.generateMorphTrack(t,e);d!==void 0&&r.push(d)}return r},n.prototype.generateVectorTrack=function(t,e,r,i){var a=this.getTimesForAllAxes(e),o=this.getKeyframeTrackValues(a,e,r);return new f.VectorKeyframeTrack(t+"."+i,a,o)},n.prototype.generateRotationTrack=function(t,e,r,i,a){var o,s;if(e.x!==void 0&&e.y!==void 0&&e.z!==void 0){var u=this.interpolateRotations(e.x,e.y,e.z,a);o=u[0],s=u[1]}var l=pi(0),c=new f.Quaternion,d=new f.Quaternion;r!==void 0&&(r=r.map(f.MathUtils.degToRad),r.push(l),c.setFromEuler(new f.Euler().fromArray(r))),i!==void 0&&(i=i.map(f.MathUtils.degToRad),i.push(l),d.setFromEuler(new f.Euler().fromArray(i)),d.inverse());var p=new f.Quaternion,A=new f.Euler,h=[];if(!s||!o)return new f.QuaternionKeyframeTrack(t+".quaternion",[0],[0]);for(var v=0;v<s.length;v+=3){if(A.set(s[v],s[v+1],s[v+2],a),p.setFromEuler(A),p.premultiply(c),p.multiply(d),v>2){var g=new f.Quaternion().fromArray(h,(v-3)/3*4);g.dot(p)<0&&p.set(-p.x,-p.y,-p.z,-p.w)}p.toArray(h,v/3*4)}return new f.QuaternionKeyframeTrack(t+".quaternion",o,h)},n.prototype.generateMorphTrack=function(t,e){var r=t.DeformPercent.curves.morph,i=r.values.map(function(o){return o/100}),a=e.getObjectByName(t.modelName).morphTargetDictionary[t.morphName];return new f.NumberKeyframeTrack(t.modelName+".morphTargetInfluences["+a+"]",r.times,i)},n.prototype.getTimesForAllAxes=function(t){var e=[];if(t.x!==void 0&&(e=e.concat(t.x.times)),t.y!==void 0&&(e=e.concat(t.y.times)),t.z!==void 0&&(e=e.concat(t.z.times)),e=e.sort(function(s,u){return s-u}),e.length>1){for(var r=1,i=e[0],a=1;a<e.length;a++){var o=e[a];o!==i&&(e[r]=o,i=o,r++)}e=e.slice(0,r)}return e},n.prototype.getKeyframeTrackValues=function(t,e,r){var i=r,a=[],o=-1,s=-1,u=-1;return t.forEach(function(l){if(e.x&&(o=e.x.times.indexOf(l)),e.y&&(s=e.y.times.indexOf(l)),e.z&&(u=e.z.times.indexOf(l)),o!==-1){var c=e.x.values[o];a.push(c),i[0]=c}else a.push(i[0]);if(s!==-1){var d=e.y.values[s];a.push(d),i[1]=d}else a.push(i[1]);if(u!==-1){var p=e.z.values[u];a.push(p),i[2]=p}else a.push(i[2])}),a},n.prototype.interpolateRotations=function(t,e,r,i){var a=[],o=[];a.push(t.times[0]),o.push(f.MathUtils.degToRad(t.values[0])),o.push(f.MathUtils.degToRad(e.values[0])),o.push(f.MathUtils.degToRad(r.values[0]));for(var s=1;s<t.values.length;s++){var u=[t.values[s-1],e.values[s-1],r.values[s-1]];if(!(isNaN(u[0])||isNaN(u[1])||isNaN(u[2]))){var l=u.map(f.MathUtils.degToRad),c=[t.values[s],e.values[s],r.values[s]];if(!(isNaN(c[0])||isNaN(c[1])||isNaN(c[2]))){c.map(f.MathUtils.degToRad);var d=[c[0]-u[0],c[1]-u[1],c[2]-u[2]],p=[Math.abs(d[0]),Math.abs(d[1]),Math.abs(d[2])];if(p[0]>=180||p[1]>=180||p[2]>=180){var A=Math.max.apply(Math,p),h=A/180,v=new f.Euler(l[0],l[1],l[2],i),g=new f.Euler(l[0],l[1],l[2],i),m=new f.Quaternion().setFromEuler(v),y=new f.Quaternion().setFromEuler(g);m.dot(y)&&y.set(-y.x,-y.y,-y.z,-y.w);for(var b=t.times[s-1],x=t.times[s]-b,w=new f.Quaternion,E=new f.Euler,S=0;S<1;S+=1/h)w.copy(m.clone().slerp(y.clone(),S)),a.push(b+S*x),E.setFromQuaternion(w,i),o.push(E.x),o.push(E.y),o.push(E.z)}else a.push(t.times[s]),o.push(f.MathUtils.degToRad(t.values[s])),o.push(f.MathUtils.degToRad(e.values[s])),o.push(f.MathUtils.degToRad(r.values[s]))}}}return[a,o]},n}(),jp=function(){function n(){this.allNodes=new So,this.nodeStack=[],this.currentIndent=0,this.currentPropName=""}return n.prototype.getPrevNode=function(){return this.nodeStack[this.currentIndent-2]},n.prototype.getCurrentNode=function(){return this.nodeStack[this.currentIndent-1]},n.prototype.getCurrentProp=function(){return this.currentProp},n.prototype.pushStack=function(t){this.nodeStack.push(t),this.currentIndent+=1},n.prototype.popStack=function(){this.nodeStack.pop(),this.currentIndent-=1},n.prototype.setCurrentProp=function(t,e){this.currentProp=t,this.currentPropName=e},n.prototype.parse=function(t){this.currentIndent=0,this.allNodes=new So,this.nodeStack=[],this.currentProp=[],this.currentPropName="";var e=this,r=t.split(/[\r\n]+/);return r.forEach(function(i,a){var o=i.match(/^[\s\t]*;/),s=i.match(/^[\s\t]*$/);if(!(o||s)){var u=i.match("^\\t{"+e.currentIndent+"}(\\w+):(.*){"),l=i.match("^\\t{"+e.currentIndent+"}(\\w+):[\\s\\t\\r\\n](.*)"),c=i.match("^\\t{"+(e.currentIndent-1)+"}}");u?e.parseNodeBegin(i,u):l?e.parseNodeProperty(i,l,r[++a]):c?e.popStack():i.match(/^[^\s\t}]/)&&e.parseNodePropertyContinued(i)}}),this.allNodes},n.prototype.parseNodeBegin=function(t,e){var r=e[1].trim().replace(/^"/,"").replace(/"$/,""),i=e[2].split(",").map(function(u){return u.trim().replace(/^"/,"").replace(/"$/,"")}),a={name:r},o=this.parseNodeAttr(i),s=this.getCurrentNode();this.currentIndent===0?this.allNodes.add(r,a):r in s?(r==="PoseNode"?s.PoseNode.push(a):s[r].id!==void 0&&(s[r]={},s[r][s[r].id]=s[r]),o.id!==""&&(s[r][o.id]=a)):typeof o.id=="number"?(s[r]={},s[r][o.id]=a):r!=="Properties70"&&(r==="PoseNode"?s[r]=[a]:s[r]=a),typeof o.id=="number"&&(a.id=o.id),o.name!==""&&(a.attrName=o.name),o.type!==""&&(a.attrType=o.type),this.pushStack(a)},n.prototype.parseNodeAttr=function(t){var e=t[0];t[0]!==""&&(e=parseInt(t[0]),isNaN(e)&&(e=t[0]));var r="",i="";return t.length>1&&(r=t[1].replace(/^(\w+)::/,""),i=t[2]),{id:e,name:r,type:i}},n.prototype.parseNodeProperty=function(t,e,r){var i=e[1].replace(/^"/,"").replace(/"$/,"").trim(),a=e[2].replace(/^"/,"").replace(/"$/,"").trim();i==="Content"&&a===","&&(a=r.replace(/"/g,"").replace(/,$/,"").trim());var o=this.getCurrentNode(),s=o.name;if(s==="Properties70"){this.parseNodeSpecialProperty(t,i,a);return}if(i==="C"){var u=a.split(",").slice(1),l=parseInt(u[0]),c=parseInt(u[1]),d=a.split(",").slice(3);d=d.map(function(p){return p.trim().replace(/^"/,"")}),i="connections",a=[l,c],$p(a,d),o[i]===void 0&&(o[i]=[])}i==="Node"&&(o.id=a),i in o&&Array.isArray(o[i])?o[i].push(a):i!=="a"?o[i]=a:o.a=a,this.setCurrentProp(o,i),i==="a"&&a.slice(-1)!==","&&(o.a=ja(a))},n.prototype.parseNodePropertyContinued=function(t){var e=this.getCurrentNode();e.a+=t,t.slice(-1)!==","&&(e.a=ja(e.a))},n.prototype.parseNodeSpecialProperty=function(t,e,r){var i=r.split('",').map(function(c){return c.trim().replace(/^\"/,"").replace(/\s/,"_")}),a=i[0],o=i[1],s=i[2],u=i[3],l=i[4];switch(o){case"int":case"enum":case"bool":case"ULongLong":case"double":case"Number":case"FieldOfView":l=parseFloat(l);break;case"Color":case"ColorRGB":case"Vector3D":case"Lcl_Translation":case"Lcl_Rotation":case"Lcl_Scaling":l=ja(l);break}this.getPrevNode()[a]={type:o,type2:s,flag:u,value:l},this.setCurrentProp(this.getPrevNode(),a)},n}(),Jp=function(){function n(){}return n.prototype.parse=function(t){var e=new n0(t);e.skip(23);var r=e.getUint32();if(r<6400)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+r);for(var i=new So;!this.endOfContent(e);){var a=this.parseNode(e,r);a!==null&&i.add(a.name,a)}return i},n.prototype.endOfContent=function(t){return t.size()%16===0?(t.getOffset()+160+16&-16)>=t.size():t.getOffset()+160+16>=t.size()},n.prototype.parseNode=function(t,e){var r={},i=e>=7500?t.getUint64():t.getUint32(),a=e>=7500?t.getUint64():t.getUint32();e>=7500?t.getUint64():t.getUint32();var o=t.getUint8(),s=t.getString(o);if(i===0)return null;for(var u=[],l=0;l<a;l++)u.push(this.parseProperty(t));var c=u.length>0?u[0]:"",d=u.length>1?u[1]:"",p=u.length>2?u[2]:"";for(r.singleProperty=a===1&&t.getOffset()===i;i>t.getOffset();){var A=this.parseNode(t,e);A!==null&&this.parseSubNode(s,r,A)}return r.propertyList=u,typeof c=="number"&&(r.id=c),d!==""&&(r.attrName=d),p!==""&&(r.attrType=p),s!==""&&(r.name=s),r},n.prototype.parseSubNode=function(t,e,r){if(r.singleProperty===!0){var i=r.propertyList[0];Array.isArray(i)?(e[r.name]=r,r.a=i):e[r.name]=i}else if(t==="Connections"&&r.name==="C"){var a=[];r.propertyList.forEach(function(p,A){A!==0&&a.push(p)}),e.connections===void 0&&(e.connections=[]),e.connections.push(a)}else if(r.name==="Properties70"){var o=Object.keys(r);o.forEach(function(p){e[p]=r[p]})}else if(t==="Properties70"&&r.name==="P"){var s=r.propertyList[0],u=r.propertyList[1],l=r.propertyList[2],c=r.propertyList[3],d=void 0;s.indexOf("Lcl ")===0&&(s=s.replace("Lcl ","Lcl_")),u.indexOf("Lcl ")===0&&(u=u.replace("Lcl ","Lcl_")),u==="Color"||u==="ColorRGB"||u==="Vector"||u==="Vector3D"||u.indexOf("Lcl_")===0?d=[r.propertyList[4],r.propertyList[5],r.propertyList[6]]:d=r.propertyList[4],e[s]={type:u,type2:l,flag:c,value:d}}else e[r.name]===void 0?typeof r.id=="number"?(e[r.name]={},e[r.name][r.id]=r):e[r.name]=r:r.name==="PoseNode"?(Array.isArray(e[r.name])||(e[r.name]=[e[r.name]]),e[r.name].push(r)):e[r.name][r.id]===void 0&&(e[r.name][r.id]=r)},n.prototype.parseProperty=function(t){var e=t.getString(1),r;switch(e){case"C":return t.getBoolean();case"D":return t.getFloat64();case"F":return t.getFloat32();case"I":return t.getInt32();case"L":return t.getInt64();case"R":return r=t.getUint32(),t.getArrayBuffer(r);case"S":return r=t.getUint32(),t.getString(r);case"Y":return t.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":var i=t.getUint32(),a=t.getUint32(),o=t.getUint32();if(a===0)switch(e){case"b":case"c":return t.getBooleanArray(i);case"d":return t.getFloat64Array(i);case"f":return t.getFloat32Array(i);case"i":return t.getInt32Array(i);case"l":return t.getInt64Array(i)}var s=kp(new Uint8Array(t.getArrayBuffer(o))),u=new n0(s.buffer);switch(e){case"b":case"c":return u.getBooleanArray(i);case"d":return u.getFloat64Array(i);case"f":return u.getFloat32Array(i);case"i":return u.getInt32Array(i);case"l":return u.getInt64Array(i)}break;default:throw new Error("THREE.FBXLoader: Unknown property type "+e)}},n}(),n0=function(){function n(t,e){this.dv=new DataView(t),this.offset=0,this.littleEndian=e!==void 0?e:!0,this._textDecoder=new TextDecoder}return n.prototype.getOffset=function(){return this.offset},n.prototype.size=function(){return this.dv.buffer.byteLength},n.prototype.skip=function(t){this.offset+=t},n.prototype.getBoolean=function(){return(this.getUint8()&1)===1},n.prototype.getBooleanArray=function(t){for(var e=[],r=0;r<t;r++)e.push(this.getBoolean());return e},n.prototype.getUint8=function(){var t=this.dv.getUint8(this.offset);return this.offset+=1,t},n.prototype.getInt16=function(){var t=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,t},n.prototype.getInt32=function(){var t=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,t},n.prototype.getInt32Array=function(t){for(var e=[],r=0;r<t;r++)e.push(this.getInt32());return e},n.prototype.getUint32=function(){var t=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,t},n.prototype.getInt64=function(){var t,e;return this.littleEndian?(t=this.getUint32(),e=this.getUint32()):(e=this.getUint32(),t=this.getUint32()),e&2147483648?(e=~e&4294967295,t=~t&4294967295,t===4294967295&&(e=e+1&4294967295),t=t+1&4294967295,-(e*4294967296+t)):e*4294967296+t},n.prototype.getInt64Array=function(t){for(var e=[],r=0;r<t;r++)e.push(this.getInt64());return e},n.prototype.getUint64=function(){var t,e;return this.littleEndian?(t=this.getUint32(),e=this.getUint32()):(e=this.getUint32(),t=this.getUint32()),e*4294967296+t},n.prototype.getFloat32=function(){var t=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,t},n.prototype.getFloat32Array=function(t){for(var e=[],r=0;r<t;r++)e.push(this.getFloat32());return e},n.prototype.getFloat64=function(){var t=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,t},n.prototype.getFloat64Array=function(t){for(var e=[],r=0;r<t;r++)e.push(this.getFloat64());return e},n.prototype.getArrayBuffer=function(t){var e=this.dv.buffer.slice(this.offset,this.offset+t);return this.offset+=t,e},n.prototype.getString=function(t){var e=this.offset,r=new Uint8Array(this.dv.buffer,e,t);this.skip(t);var i=r.indexOf(0);return i>=0&&(r=new Uint8Array(this.dv.buffer,e,i)),this._textDecoder.decode(r)},n}(),So=function(){function n(){this.Connections={connections:[]},this.Objects={Model:{},NodeAttribute:{},Geometry:{}},this.GlobalSettings={}}return n.prototype.add=function(t,e){this[t]=e},n}();function Xp(n){var t="Kaydara FBX Binary \0";return n.byteLength>=t.length&&t===xl(n,0,t.length)}function Wp(n){var t=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"],e=0;function r(o){var s=n[o-1];return n=n.slice(e+o),e++,s}for(var i=0;i<t.length;++i){var a=r(1);if(a===t[i])return!1}return!0}function i0(n){var t=/FBXVersion: (\d+)/,e=n.match(t);if(e){var r=parseInt(e[1]);return r}throw new Error("THREE.FBXLoader: Cannot find the version number for the file given.")}function Zp(n){return n/46186158e3}var Yp=[];function Di(n,t,e,r){var i;switch(r.mappingType){case"ByPolygonVertex":i=n;break;case"ByPolygon":i=t;break;case"ByVertice":i=e;break;case"AllSame":i=r.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+r.mappingType),i=0}r.referenceType==="IndexToDirect"&&(i=r.indices[i]);var a=i*r.dataSize,o=a+r.dataSize;return ev(Yp,r.buffer,a,o)}var _a=new f.Euler,Ln=new f.Vector3;function bl(n){var t=new f.Matrix4,e=new f.Matrix4,r=new f.Matrix4,i=new f.Matrix4,a=new f.Matrix4,o=new f.Matrix4,s=new f.Matrix4,u=new f.Matrix4,l=new f.Matrix4,c=new f.Matrix4,d=new f.Matrix4,p=new f.Matrix4,A=n.inheritType?n.inheritType:0;n.translation&&t.setPosition(Ln.fromArray(n.translation));var h=pi(0);if(n.preRotation){var v=n.preRotation.map(f.MathUtils.degToRad);v.push(h),e.makeRotationFromEuler(_a.fromArray(v))}if(n.rotation){var v=n.rotation.map(f.MathUtils.degToRad);v.push(n.eulerOrder||h),r.makeRotationFromEuler(_a.fromArray(v))}if(n.postRotation){var v=n.postRotation.map(f.MathUtils.degToRad);v.push(h),i.makeRotationFromEuler(_a.fromArray(v)),i.copy(new f.Matrix4().getInverse(i))}n.scale&&a.scale(Ln.fromArray(n.scale)),n.scalingOffset&&s.setPosition(Ln.fromArray(n.scalingOffset)),n.scalingPivot&&o.setPosition(Ln.fromArray(n.scalingPivot)),n.rotationOffset&&u.setPosition(Ln.fromArray(n.rotationOffset)),n.rotationPivot&&l.setPosition(Ln.fromArray(n.rotationPivot)),n.parentMatrixWorld&&(d.copy(n.parentMatrix),c.copy(n.parentMatrixWorld));var g=e.clone().multiply(r).multiply(i),m=new f.Matrix4;m.extractRotation(c);var y=new f.Matrix4;y.copyPosition(c);var b=new f.Matrix4().getInverse(y).multiply(c),x=new f.Matrix4().getInverse(m).multiply(b),w=a,E=new f.Matrix4;if(A===0)E.copy(m).multiply(g).multiply(x).multiply(w);else if(A===1)E.copy(m).multiply(x).multiply(g).multiply(w);else{var S=new f.Matrix4().scale(new f.Vector3().setFromMatrixScale(d)),C=new f.Matrix4().getInverse(S),R=x.clone().multiply(C);E.copy(m).multiply(g).multiply(R).multiply(w)}var B=new f.Matrix4().getInverse(l),M=new f.Matrix4().getInverse(o),I=t.clone().multiply(u).multiply(l).multiply(e).multiply(r).multiply(i).multiply(B).multiply(s).multiply(o).multiply(a).multiply(M),L=new f.Matrix4().copyPosition(I),T=c.clone().multiply(L);return p.copyPosition(T),I=p.clone().multiply(E),I.premultiply(new f.Matrix4().getInverse(c)),I}function pi(n){n=n||0;var t=["ZYX","YZX","XZY","ZXY","YXZ","XYZ"];return n===6?(console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect."),t[0]):t[n]}function ja(n){var t=n.split(",").map(function(e){return parseFloat(e)});return t}function xl(n,t,e){return t===void 0&&(t=0),e===void 0&&(e=n.byteLength),new TextDecoder().decode(new Uint8Array(n,t,e))}function $p(n,t){for(var e=0,r=n.length,i=t.length;e<i;e++,r++)n[r]=t[e]}function ev(n,t,e,r){for(var i=e,a=0;i<r;i++,a++)n[a]=t[i];return n}var tv=function(n){ue(t,n);function t(e,r,i,a,o){var s=n.call(this)||this,u=r?r.length-1:0,l=i?i.length:0;s.degree=e,s.knots=r,s.controlPoints=[],s.startKnot=a||0,s.endKnot=o||u;for(var c=0;c<l;++c){var d=i[c];s.controlPoints[c]=new f.Vector4(d.x,d.y,d.z,d.w)}return s}return t.prototype.getPoint=function(e,r){r===void 0&&(r=new f.Vector3);var i=r,a=this.knots[this.startKnot]+e*(this.knots[this.endKnot]-this.knots[this.startKnot]),o=nv(this.degree,this.knots,this.controlPoints,a);return o.w!==1&&o.divideScalar(o.w),i.set(o.x,o.y,o.z)},t.prototype.getTangent=function(e,r){r===void 0&&(r=new f.Vector3);var i=r,a=this.knots[0]+e*(this.knots[this.knots.length-1]-this.knots[0]),o=uv(this.degree,this.knots,this.controlPoints,a,1);return i.copy(o[1]).normalize(),i},t.prototype.toJSON=function(){var e=n.prototype.toJSON.call(this);return e.degree=this.degree,e.knots=vt([],this.knots,!0),e.controlPoints=this.controlPoints.map(function(r){return r.toArray()}),e.startKnot=this.startKnot,e.endKnot=this.endKnot,e},t.prototype.fromJSON=function(e){return n.prototype.fromJSON.call(this,e),this.degree=e.degree,this.knots=vt([],e.knots,!0),this.controlPoints=e.controlPoints.map(function(r){return new f.Vector4(r[0],r[1],r[2],r[3])}),this.startKnot=e.startKnot,this.endKnot=e.endKnot,this},t}(f.Curve);function wl(n,t,e){var r=e.length-n-1;if(t>=e[r])return r-1;if(t<=e[n])return n;for(var i=n,a=r,o=Math.floor((i+a)/2);t<e[o]||t>=e[o+1];)t<e[o]?a=o:i=o,o=Math.floor((i+a)/2);return o}function rv(n,t,e,r){var i=[],a=[],o=[];i[0]=1;for(var s=1;s<=e;++s){a[s]=t-r[n+1-s],o[s]=r[n+s]-t;for(var u=0,l=0;l<s;++l){var c=o[l+1],d=a[s-l],p=i[l]/(c+d);i[l]=u+c*p,u=d*p}i[s]=u}return i}function nv(n,t,e,r){for(var i=wl(n,r,t),a=rv(i,r,n,t),o=new f.Vector4(0,0,0,0),s=0;s<=n;++s){var u=e[i-n+s],l=a[s],c=u.w*l;o.x+=u.x*c,o.y+=u.y*c,o.z+=u.z*c,o.w+=u.w*l}return o}function iv(n,t,e,r,i){for(var a=[],o=0;o<=e;++o)a[o]=0;for(var s=[],o=0;o<=r;++o)s[o]=a.slice(0);for(var u=[],o=0;o<=e;++o)u[o]=a.slice(0);u[0][0]=1;for(var l=a.slice(0),c=a.slice(0),d=1;d<=e;++d){l[d]=t-i[n+1-d],c[d]=i[n+d]-t;for(var p=0,A=0;A<d;++A){var h=c[A+1],v=l[d-A];u[d][A]=h+v;var g=u[A][d-1]/u[d][A];u[A][d]=p+h*g,p=v*g}u[d][d]=p}for(var d=0;d<=e;++d)s[0][d]=u[d][e];for(var m=0;m<=e;++m){for(var y=0,b=1,x=[],o=0;o<=e;++o)x[o]=a.slice(0);x[0][0]=1;for(var w=1;w<=r;++w){var E=0,S=m-w,C=e-w;m>=w&&(x[b][0]=x[y][0]/u[C+1][S],E=x[b][0]*u[S][C]);for(var R=S>=-1?1:-S,B=m-1<=C?w-1:e-m,M=R;M<=B;++M)x[b][M]=(x[y][M]-x[y][M-1])/u[C+1][S+M],E+=x[b][M]*u[S+M][C];m<=C&&(x[b][w]=-x[y][w-1]/u[C+1][m],E+=x[b][w]*u[m][C]),s[w][m]=E;var d=y;y=b,b=d}}for(var I=e,w=1;w<=r;++w){for(var d=0;d<=e;++d)s[w][d]*=I;I*=e-w}return s}function av(n,t,e,r,i){for(var a=i<n?i:n,o=[],s=wl(n,r,t),u=iv(s,r,n,a,t),l=[],c=0;c<e.length;++c){var d=e[c].clone(),p=d.w;d.x*=p,d.y*=p,d.z*=p,l[c]=d}for(var A=0;A<=a;++A){for(var d=l[s-n].clone().multiplyScalar(u[A][0]),h=1;h<=n;++h)d.add(l[s-n+h].clone().multiplyScalar(u[A][h]));o[A]=d}for(var A=a+1;A<=i+1;++A)o[A]=new f.Vector4(0,0,0);return o}function ov(n,t){for(var e=1,r=2;r<=n;++r)e*=r;for(var i=1,r=2;r<=t;++r)i*=r;for(var r=2;r<=n-t;++r)i*=r;return e/i}function sv(n){for(var t=n.length,e=[],r=[],i=0;i<t;++i){var a=n[i];e[i]=new f.Vector3(a.x,a.y,a.z),r[i]=a.w}for(var o=[],s=0;s<t;++s){for(var u=e[s].clone(),i=1;i<=s;++i)u.sub(o[s-i].clone().multiplyScalar(ov(s,i)*r[i]));o[s]=u.divideScalar(r[0])}return o}function uv(n,t,e,r,i){var a=av(n,t,e,r,i);return sv(a)}var kn=new f.Vector3;function lv(n,t){switch(t){case"D":return new Float64Array(n);case"F":return new Float32Array(n);case"L":return new Int32Array(n);case"I":return new Int16Array(n);default:return new Uint8Array(n)}}function El(n,t){var e;t===void 0&&(t={});var r=(e=t.fetcher)!==null&&e!==void 0?e:new Qt({allowHosts:["*"]}),i={byteLength:0};return Promise.resolve().then(function(){return r.ajax(n,{responseType:"arraybuffer"})}).then(function(a){var o;return i.byteLength=a.body.byteLength,cv(new Uint8Array(a.body),{materialType:t.materialType,color:t.color,resourcePath:n.slice(0,n.lastIndexOf("/")+1),search:(o=n.split("?")[1])!==null&&o!==void 0?o:"",fetcher:r})}).then(function(a){var o=new f.Group;return o.matrixAutoUpdate=!1,o.matrix.compose(o.position,o.quaternion,o.scale),o.name=n,o.add(a.object),{type:"x3p",upAxis:"Z",uri:n,byteLength:i.byteLength,scene:o,textures:[],dispose:function(){return a.dispose()}}})}function cv(n,t){for(var e,r,i,a,o,s,u,l,c,d,p,A,h,v,g,m,y,b,x,w,E,S,C,R,B,M,I,L,T,F,D,V,z,Q,q,G,K,j,J,W,$,Y,Z,oe,ne,de,se,ye,ie,xe,Le,Me,Oe,ee,re,H=Qp(n),Be="",Te=null,Ce=0,Ue=Object.keys(H);Ce<Ue.length;Ce++){var Ie=Ue[Ce];/(^|\/)main\.xml$/i.test(Ie)&&(Te=H[Ie],Be=Ie.slice(0,Ie.lastIndexOf("/")+1))}if(!Te)throw new Error("X3p: main.xml not found.");if(typeof DOMParser=="undefined")throw new Error("X3p: DOMParser not found.");var we=(e=t.materialType)!==null&&e!==void 0?e:"phong",be=(r=t.color)!==null&&r!==void 0?r:new f.Color(10066329),Ae=new DOMParser,me=ea(Te),ze=Ae.parseFromString(me,"text/xml"),pe=ze.querySelector("Record1 Axes"),Se={x:{type:(o=(a=(i=pe==null?void 0:pe.querySelector("CX AxisType"))===null||i===void 0?void 0:i.textContent)===null||a===void 0?void 0:a.toUpperCase())!==null&&o!==void 0?o:"I",dataType:(l=(u=(s=pe==null?void 0:pe.querySelector("CX DataType"))===null||s===void 0?void 0:s.textContent)===null||u===void 0?void 0:u.toUpperCase())!==null&&l!==void 0?l:"D",increment:Number((d=(c=pe==null?void 0:pe.querySelector("CX Increment"))===null||c===void 0?void 0:c.textContent)!==null&&d!==void 0?d:"1"),offset:Number((A=(p=pe==null?void 0:pe.querySelector("CX Offset"))===null||p===void 0?void 0:p.textContent)!==null&&A!==void 0?A:"0")},y:{type:(g=(v=(h=pe==null?void 0:pe.querySelector("CY AxisType"))===null||h===void 0?void 0:h.textContent)===null||v===void 0?void 0:v.toUpperCase())!==null&&g!==void 0?g:"I",dataType:(b=(y=(m=pe==null?void 0:pe.querySelector("CY DataType"))===null||m===void 0?void 0:m.textContent)===null||y===void 0?void 0:y.toUpperCase())!==null&&b!==void 0?b:"D",increment:Number((w=(x=pe==null?void 0:pe.querySelector("CY Increment"))===null||x===void 0?void 0:x.textContent)!==null&&w!==void 0?w:"1"),offset:Number((S=(E=pe==null?void 0:pe.querySelector("CY Offset"))===null||E===void 0?void 0:E.textContent)!==null&&S!==void 0?S:"0")},z:{type:(B=(R=(C=pe==null?void 0:pe.querySelector("CZ AxisType"))===null||C===void 0?void 0:C.textContent)===null||R===void 0?void 0:R.toUpperCase())!==null&&B!==void 0?B:"A",dataType:(L=(I=(M=pe==null?void 0:pe.querySelector("CZ DataType"))===null||M===void 0?void 0:M.textContent)===null||I===void 0?void 0:I.toUpperCase())!==null&&L!==void 0?L:"D",increment:Number((F=(T=pe==null?void 0:pe.querySelector("CZ Increment"))===null||T===void 0?void 0:T.textContent)!==null&&F!==void 0?F:"1"),offset:Number((V=(D=pe==null?void 0:pe.querySelector("CZ Offset"))===null||D===void 0?void 0:D.textContent)!==null&&V!==void 0?V:"0")}},St=null,Pe=ze.querySelector("Record1 Axes Rotation");Pe&&(St=new f.Matrix3,St.set(Number((Q=(z=Pe.querySelector("r11"))===null||z===void 0?void 0:z.textContent)!==null&&Q!==void 0?Q:0),Number((G=(q=Pe.querySelector("r12"))===null||q===void 0?void 0:q.textContent)!==null&&G!==void 0?G:0),Number((j=(K=Pe.querySelector("r13"))===null||K===void 0?void 0:K.textContent)!==null&&j!==void 0?j:0),Number((W=(J=Pe.querySelector("r21"))===null||J===void 0?void 0:J.textContent)!==null&&W!==void 0?W:0),Number((Y=($=Pe.querySelector("r22"))===null||$===void 0?void 0:$.textContent)!==null&&Y!==void 0?Y:0),Number((oe=(Z=Pe.querySelector("r23"))===null||Z===void 0?void 0:Z.textContent)!==null&&oe!==void 0?oe:0),Number((de=(ne=Pe.querySelector("r31"))===null||ne===void 0?void 0:ne.textContent)!==null&&de!==void 0?de:0),Number((ye=(se=Pe.querySelector("r32"))===null||se===void 0?void 0:se.textContent)!==null&&ye!==void 0?ye:0),Number((xe=(ie=Pe.querySelector("r33"))===null||ie===void 0?void 0:ie.textContent)!==null&&xe!==void 0?xe:0)));var je=(Le=ze.querySelector("Record3 DataLink PointDataLink"))===null||Le===void 0?void 0:Le.textContent;if(typeof je!="string")throw new Error("X3p: PointDataLink not found.");je=st(Be,je);var it=H[je];if(!it)throw new Error("X3p: ".concat(it," not found."));for(var _t=lv(it.buffer,Se.z.dataType),Qr=Number((Oe=(Me=ze.querySelector("Record3 MatrixDimension SizeX"))===null||Me===void 0?void 0:Me.textContent)!==null&&Oe!==void 0?Oe:"0"),jt=Number((re=(ee=ze.querySelector("Record3 MatrixDimension SizeY"))===null||ee===void 0?void 0:ee.textContent)!==null&&re!==void 0?re:"0"),ut=Math.floor(Qr-1),Mt=Math.floor(jt-1),dt=ut+1,Ct=Mt+1,It=new Float32Array(dt*Ct*3),Tt=new Float32Array(dt*Ct*2),Xe=new Uint32Array(ut*Mt*6),Ne=new f.Box3,We=0;We<Ct;We++)for(var At=We*Se.y.increment+Se.y.offset,Ze=0;Ze<dt;Ze++){var gt=We*dt+Ze,qt=Ze*Se.x.increment+Se.x.offset,yt=_t[gt],Jt=!isNaN(yt),gr=Jt?yt:NaN;kn.set(qt,-At,gr),St&&kn.applyMatrix3(St),Jt&&Ne.expandByPoint(kn),It[gt*3+0]=kn.x,It[gt*3+1]=kn.y,It[gt*3+2]=kn.z,Tt[gt*2+0]=Ze/ut,Tt[gt*2+1]=1-We/Mt}for(var We=0;We<Mt;We++)for(var Ze=0;Ze<ut;Ze++){var qr=Ze+dt*We,yr=Ze+dt*(We+1),Pr=Ze+1+dt*(We+1),Ot=Ze+1+dt*We,Ge=(We*ut+Ze)*6;Xe[Ge+0]=qr,Xe[Ge+1]=yr,Xe[Ge+2]=Ot,Xe[Ge+3]=yr,Xe[Ge+4]=Pr,Xe[Ge+5]=Ot}var ke=new f.BufferGeometry;ke.setAttribute("position",new f.BufferAttribute(It,3)),ke.setAttribute("uv",new f.BufferAttribute(Tt,2)),ke.setIndex(new f.BufferAttribute(Xe,1)),(!ke.groups||ke.groups.length===0)&&ke.addGroup(0,ke.index?ke.index.count:ke.attributes.position.count,0),ke.boundingBox=Ne;var Ye=new Ar(we);Ye.flatShading=!0,Ye.color.copy(be),Ye.refreshUniforms();var bt=new kt(ke,[Ye]);return{object:bt,dispose:function(){ke.dispose(),Ye.dispose()}}}var a0=new f.Matrix4,fv=5e3,o0=1e3;function Ja(n,t){n.name=t.id;var e=t.tileset.properties.floorInfo;n.traverse(function(r){if("floor"in t.extras){if(r instanceof f.Mesh||r instanceof f.Points)for(var i=Array.isArray(r.material)?r.material:r.material?[r.material]:[],a=0,o=i;a<o.length;a++){var s=o[a];(s instanceof Ar||s instanceof Mi)&&(s.floor=t.extras.floor)}}else if(!(r instanceof mr)){if(r instanceof kt&&e){for(var u=new f.Box3().expandByObject(r),l=u.getCenter(new f.Vector3),c=0,d=0;d<e.length;d++){var p=e[d],A=p.ground,h=p.height;if(l.y<A+h){c=d;break}}t.floor=c,t.tileset.floorLength=Math.max(t.tileset.floorLength,t.floor+1),r.material.forEach(function(v){return v.floor=c})}}})}function dv(n,t){if(!n.content)return Promise.resolve(n);var e=n.content,r=fa(e.uri,t.search);if(n.type==="TILESET"){var i=ft(r,{key:"model.".concat(n.siblingIndex)});return e.loadState="LOADING",e.loadStateUpdateTime=ve(),t.fetcher.ajax(i,{responseType:"text"}).then(function(a){return a.body}).then(function(a){var o=r.slice(0,r.lastIndexOf("/")+1);return Ki(JSON.parse(a),o)}).then(function(a){e.loadState="READY",e.loadStateUpdateTime=ve(),e.loadfailRetryDelay=0,n.children.length===0&&(n.children=[new _o("".concat(n.id,".0"),a.root,n.tileset,n)])}).then(function(){return n}).catch(function(a){return e.loadState="FAILED",e.loadStateUpdateTime=ve(),e.loadfailRetryDelay=Math.min(e.loadfailRetryDelay+1e3,5e3),Promise.reject(a)})}if(n.type==="SCENEGRAPH")return e.loadState="LOADING",e.loadStateUpdateTime=ve(),Promise.resolve().then(function(){var a,o,s,u,l,c,d,p,A,h,v="",g=r.split("#"),m=g[0],y=g[1],b=(y||m).split("?")[0].match(/\.([0-9a-zA-Z]+)$/);if(b&&(v=b[1]),v==="b3dm"){var x=ft(r,{key:"model.".concat(n.siblingIndex)});return Gu(x,{upAxis:n.tileset.asset.gltfUpAxis,fetcher:t.fetcher}).then(function(w){return w.scene.applyMatrix4(n.transform),w.scene.updateWorldMatrix(!1,!0),w.scene.matrixAutoUpdate=!1,Ja(w.scene,n),w})}if(v==="pnts"){var x=ft(r,{key:"model.".concat(n.siblingIndex)});return _u(x,{computeBoundingBox:!1,fetcher:t.fetcher}).then(function(E){if(E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,n.boundingVolume){var S=n.boundingVolume;E.scene.traverse(function(C){if(C instanceof mr){a0.getInverse(C.matrixWorld);var R=new f.Box3;S.getBoundingBox(R),R.applyMatrix4(a0),C.geometry.boundingBox=R}})}return Ja(E.scene,n),E})}if(v==="glb"){var x=ft(r,{key:"model.".concat(n.siblingIndex)});return sl(x,{upAxis:n.tileset.asset.gltfUpAxis,fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,Ja(E.scene,n),E})}if(v==="at3d"){var x=n.extras.at3d?r:ft(r,{key:"model.".concat(n.siblingIndex)});return nl(x,{textureBaseUri:(a=n.extras.at3d)===null||a===void 0?void 0:a.textureBaseUri,textureArray:(o=n.extras.at3d)===null||o===void 0?void 0:o.textureArray,textureOptions:(s=n.extras.at3d)===null||s===void 0?void 0:s.textureOptions,fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}if(v==="pbm"){var x=n.extras.pbm?r:ft(r,{key:"model.".concat(n.siblingIndex)});return el(x,{textureBaseUri:(u=n.extras.pbm)===null||u===void 0?void 0:u.textureBaseUri,textureArray:(l=n.extras.pbm)===null||l===void 0?void 0:l.textureArray,textureOptions:(c=n.extras.pbm)===null||c===void 0?void 0:c.textureOptions,fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}if(v==="dome"){var x=n.extras.dome?r:ft(r,{key:"model.".concat(n.siblingIndex)});return il(x,{textureBaseUri:(d=n.extras.dome)===null||d===void 0?void 0:d.textureBaseUri,textureOptions:(p=n.extras.dome)===null||p===void 0?void 0:p.textureOptions,fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}if(v==="domez"){var x=n.extras.domez?r:ft(r,{key:"model.".concat(n.siblingIndex)});return ol(x,{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(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}if(v==="ply"){var x=n.extras.ply?r:ft(r,{key:"model.".concat(n.siblingIndex)});return Zo(x,{type:"pbmPointCloud",upAxis:"Z",fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}if(v==="obj"){var x=n.extras.obj?r:ft(r,{key:"model.".concat(n.siblingIndex)});return xp(x,{upAxis:"Z",fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}if(v==="fbx"){var x=n.extras.obj?r:ft(r,{key:"model.".concat(n.siblingIndex)});return yl(x,{fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}if(v==="x3p"){var x=n.extras.x3p?r:ft(r,{key:"model.".concat(n.siblingIndex)});return El(x,{fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}throw new Error("Invalid Tile content: ".concat(r))}).then(function(a){a.scene.traverse(function(s){if(s instanceof mr)s.material.uniforms.geometricError.value=n.geometricError;else if(s instanceof kt)for(var u=0,l=s.material;u<l.length;u++){var c=l[u];c.uniforms.geometricError.value=n.geometricError}});var o={type:a.type,uri:a.uri,byteLength:a.byteLength,object:new Nu(n.id,a.scene,a.dispose)};return Promise.resolve().then(function(){return Promise.all([o.object.generateBvhTree(),t.renderer&&a.textures.length<16?Zd(a.textures,t.renderer,1024*1024):null])}).then(function(){return e.loadState="READY",e.loadStateUpdateTime=ve(),e.loadfailRetryDelay=0,e.byteLength=o.byteLength,e.data=o,n}).catch(function(s){return Mo(n),Promise.reject(s)})}).catch(function(a){return e.loadState="FAILED",e.loadStateUpdateTime=ve(),a instanceof Qn&&a.httpStatus===0||a instanceof fi||a instanceof mi?e.loadfailRetryDelay=ce(e.loadfailRetryDelay+o0,o0,fv):e.loadfailRetryDelay=1/0,Promise.reject(a)});throw new Error("Invalid Tile type: ".concat(n.type))}function Mo(n){n.content&&(n.content.data&&n.content.data.object.dispose(),n.content.data=void 0,n.content.loadState="UNLOADED",n.content.loadStateUpdateTime=ve(),n.content.byteLength=0)}var Sl=function(n){ue(t,n);function t(e,r,i){i===void 0&&(i=U);var a=n.call(this)||this;return a.name=e,a.contentObject=r,a.name=e,a.add(r),a.disposers=[i],a}return t.prototype.update=function(e,r,i){var a=this.contentObject.material[2];a.uniforms.dashOffset.value=(a.uniforms.dashOffset.value-.003)%(a.uniforms.dashSize.value.x+a.uniforms.dashSize.value.y),i.needsRender=!0},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.name,this.contentObject.clone())},t}(f.Object3D),hv=5e3,s0=1e3,Lr={vertexShader:`
|
|
934
|
+
`),a={name:""},o=/\s+/,s={},u=0;u<i.length;u++){var l=i[u];if(l=l.trim(),!(l.length===0||l.charAt(0)==="#")){var c=l.indexOf(" "),d=c>=0?l.substring(0,c):l;d=d.toLowerCase();var p=c>=0?l.substring(c+1):"";if(p=p.trim(),d==="newmtl")a={name:p},s[p]=a;else if(d==="ka"||d==="kd"||d==="ks"||d==="ke"){var A=p.split(o,3);a[d]=[parseFloat(A[0]),parseFloat(A[1]),parseFloat(A[2])]}else(d==="map_kd"||d==="map_ks"||d==="map_ke"||d==="norm"||d==="map_bump"||d==="bump"||d==="map_d"||d==="ns"||d==="d"||d==="tr")&&(a[d]=p)}}function h(g){var m={url:"",scale:new f.Vector2(1,1),offset:new f.Vector2(0,0),bumpScale:1},y=g.split(/\s+/),b;return b=y.indexOf("-bm"),b>=0&&(m.bumpScale=parseFloat(y[b+1]),y.splice(b,2)),b=y.indexOf("-s"),b>=0&&(m.scale.set(parseFloat(y[b+1]),parseFloat(y[b+2])),y.splice(b,4)),b=y.indexOf("-o"),b>=0&&(m.offset.set(parseFloat(y[b+1]),parseFloat(y[b+2])),y.splice(b,4)),m.url=y.join(" ").trim(),m}function v(g,m,y){var b=h(y),x=st(e.path,b.url);return r.loadTexture(x,{fetcher:e.fetcher,encoding:m==="map"||m==="emissiveMap"?f.sRGBEncoding:f.LinearEncoding,minFilter:f.LinearFilter,magFilter:f.LinearFilter,wrapS:f.RepeatWrapping,wrapT:f.RepeatWrapping}).then(function(w){var E=w.body;return E.repeat.copy(b.scale),E.offset.copy(b.offset),g.bumpScale=b.bumpScale,g[m]=E,E})}return{name:n,create:function(g){var m=new Ar(e.materialType),y=[],b=s[g];if(b){if(b.kd!==void 0&&m.color.fromArray(b.kd),b.ks!==void 0&&m.specular.fromArray(b.ks),b.ke!==void 0&&m.emissive.fromArray(b.ke),b.map_kd!==void 0&&y.push(v(m,"map",b.map_kd)),b.map_ks!==void 0&&y.push(v(m,"specularMap",b.map_ks)),b.map_ke!==void 0&&y.push(v(m,"emissiveMap",b.map_ke)),b.norm!==void 0&&y.push(v(m,"normalMap",b.norm)),b.map_bump!==void 0&&y.push(v(m,"bumpMap",b.map_bump)),b.bump!==void 0&&y.push(v(m,"bumpMap",b.bump)),b.map_d!==void 0&&y.push(v(m,"alphaMap",b.map_d)),b.ns!==void 0&&(m.shininess=parseFloat(b.ns)),b.d!==void 0){var x=parseFloat(b.d);x<1&&(m.opacity=x,m.transparent=!0)}if(b.tr!==void 0){var x=parseFloat(b.tr);x>0&&(m.opacity=1-x,m.transparent=!0)}}var w=Promise.all(y).then(function(E){return m.refreshUniforms(),E});return[m,w]}}}function bp(n,t){for(var e,r,i=[],a=[],o=new f.Group,s=function(c,d){var p=n.objects[c],A=p.geometry,h=p.materials,v=!1;if(A.vertices.length===0)return"continue";var g=new f.BufferGeometry;a.push(function(){return g.dispose()}),g.setAttribute("position",new f.BufferAttribute(new Float32Array(A.vertices),3)),A.normals.length>0&&g.setAttribute("normal",new f.BufferAttribute(new Float32Array(A.normals),3)),A.colors.length>0&&(v=!0,g.setAttribute("color",new f.BufferAttribute(new Float32Array(A.colors),3))),A.uvs.length>0&&g.setAttribute("uv",new f.BufferAttribute(new Float32Array(A.uvs),2)),A.index.length>0&&g.setIndex(new f.BufferAttribute(new Uint32Array(A.index),1)),g.computeBoundingBox(),g.computeBoundingSphere();for(var m=[],y=function(S,C){var R=h[S],B=R.name+"_"+R.smooth+"_"+v,M=n.materials[B];if(!M){for(var I=null,L=0,T=t;L<T.length;L++){var F=T[L],D=F.name,V=F.create;D===R.mtllib&&(I=V(R.name))}if(!I){var z=new Ar;z.refreshUniforms(),I=[z,Promise.resolve([])]}M=I[0],M.name=R.name,M.flatShading=!(R.smooth||g.attributes.normal),M.vertexColors=v,n.materials[B]=M;var Q=I[1];i.push(Q),a.push(function(){return M.dispose()})}m.push(M)},b=0,x=h.length;b<x;b++)y(b);for(var b=0,x=h.length;b<x;b++){var w=h[b];g.addGroup((e=w.groupStart)!==null&&e!==void 0?e:0,(r=w.groupCount)!==null&&r!==void 0?r:0,b)}var E=new kt(g,m);E.name=p.name,o.add(E)},u=0,l=n.objects.length;u<l;u++)s(u);return Promise.all(i).then(function(c){for(var d=[],p=0,A=c;p<A.length;p++){var h=A[p];d=d.concat(h)}return{scene:o,textures:d,dispose:function(){return a.forEach(function(v){return v()})}}})}function xp(n,t){var e,r,i;t===void 0&&(t={});var a=(e=t.upAxis)!==null&&e!==void 0?e:"Z",o=(r=t.materialType)!==null&&r!==void 0?r:"basic",s=(i=t.fetcher)!==null&&i!==void 0?i:new Qt({allowHosts:["*"]}),u=n.slice(0,n.lastIndexOf("/")+1),l=0,c;return Promise.resolve().then(function(){return s.ajax(n,{responseType:"arraybuffer"})}).then(function(d){l=d.body.byteLength;var p=new TextDecoder;return p.decode(d.body)}).then(function(d){return c=gp(d),Promise.all(c.materialLibraries.map(function(p){var A=st(u,p),h=A.slice(0,A.lastIndexOf("/")+1);return s.ajax(A,{responseType:"text"}).then(function(v){return yp(p,v.body,{path:h,materialType:o,fetcher:s})})}))}).then(function(d){return bp(c,d)}).then(function(d){var p=new f.Matrix4;return a==="Y"&&p.premultiply(dp),d.scene.applyMatrix4(p),{type:"obj",upAxis:"Z",uri:n,byteLength:l,scene:d.scene,textures:d.textures,dispose:function(){return d.dispose()}}})}var _t=Uint8Array,Dn=Uint16Array,wp=Int32Array,dl=new _t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),hl=new _t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ep=new _t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),pl=function(n,t){for(var e=new Dn(31),r=0;r<31;++r)e[r]=t+=1<<n[r-1];for(var i=new wp(e[30]),r=1;r<30;++r)for(var a=e[r];a<e[r+1];++a)i[a]=a-e[r]<<5|r;return{b:e,r:i}},vl=pl(dl,2),ml=vl.b,Sp=vl.r;ml[28]=258,Sp[258]=28;var Mp=pl(hl,0),Cp=Mp.b,wo=new Dn(32768);for(var _e=0;_e<32768;++_e){var $r=(_e&43690)>>1|(_e&21845)<<1;$r=($r&52428)>>2|($r&13107)<<2,$r=($r&61680)>>4|($r&3855)<<4,wo[_e]=(($r&65280)>>8|($r&255)<<8)>>1}var ui=function(n,t,e){for(var r=n.length,i=0,a=new Dn(t);i<r;++i)n[i]&&++a[n[i]-1];var o=new Dn(t);for(i=1;i<t;++i)o[i]=o[i-1]+a[i-1]<<1;var s;if(e){s=new Dn(1<<t);var u=15-t;for(i=0;i<r;++i)if(n[i])for(var l=i<<4|n[i],c=t-n[i],d=o[n[i]-1]++<<c,p=d|(1<<c)-1;d<=p;++d)s[wo[d]>>u]=l}else for(s=new Dn(r),i=0;i<r;++i)n[i]&&(s[i]=wo[o[n[i]-1]++]>>15-n[i]);return s},Ci=new _t(288);for(var _e=0;_e<144;++_e)Ci[_e]=8;for(var _e=144;_e<256;++_e)Ci[_e]=9;for(var _e=256;_e<280;++_e)Ci[_e]=7;for(var _e=280;_e<288;++_e)Ci[_e]=8;var Al=new _t(32);for(var _e=0;_e<32;++_e)Al[_e]=5;var Ip=ui(Ci,9,1),Tp=ui(Al,5,1),Ha=function(n){for(var t=n[0],e=1;e<n.length;++e)n[e]>t&&(t=n[e]);return t},ur=function(n,t,e){var r=t/8|0;return(n[r]|n[r+1]<<8)>>(t&7)&e},Ga=function(n,t){var e=t/8|0;return(n[e]|n[e+1]<<8|n[e+2]<<16)>>(t&7)},Pp=function(n){return(n+7)/8|0},Yo=function(n,t,e){return(t==null||t<0)&&(t=0),(e==null||e>n.length)&&(e=n.length),new _t(n.subarray(t,e))},Rp=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Nt=function(n,t,e){var r=new Error(t||Rp[n]);if(r.code=n,Error.captureStackTrace&&Error.captureStackTrace(r,Nt),!e)throw r;return r},gl=function(n,t,e,r){var i=n.length,a=r?r.length:0;if(!i||t.f&&!t.l)return e||new _t(0);var o=!e,s=o||t.i!=2,u=t.i;o&&(e=new _t(i*3));var l=function(de){var se=e.length;if(de>se){var ye=new _t(Math.max(se*2,de));ye.set(e),e=ye}},c=t.f||0,d=t.p||0,p=t.b||0,A=t.l,h=t.d,v=t.m,g=t.n,m=i*8;do{if(!A){c=ur(n,d,1);var y=ur(n,d+1,3);if(d+=3,y)if(y==1)A=Ip,h=Tp,v=9,g=5;else if(y==2){var E=ur(n,d,31)+257,S=ur(n,d+10,15)+4,C=E+ur(n,d+5,31)+1;d+=14;for(var R=new _t(C),B=new _t(19),M=0;M<S;++M)B[Ep[M]]=ur(n,d+M*3,7);d+=S*3;for(var I=Ha(B),L=(1<<I)-1,T=ui(B,I,1),M=0;M<C;){var F=T[ur(n,d,L)];d+=F&15;var b=F>>4;if(b<16)R[M++]=b;else{var D=0,V=0;for(b==16?(V=3+ur(n,d,3),d+=2,D=R[M-1]):b==17?(V=3+ur(n,d,7),d+=3):b==18&&(V=11+ur(n,d,127),d+=7);V--;)R[M++]=D}}var z=R.subarray(0,E),Q=R.subarray(E);v=Ha(z),g=Ha(Q),A=ui(z,v,1),h=ui(Q,g,1)}else Nt(1);else{var b=Pp(d)+4,x=n[b-4]|n[b-3]<<8,w=b+x;if(w>i){u&&Nt(0);break}s&&l(p+x),e.set(n.subarray(b,w),p),t.b=p+=x,t.p=d=w*8,t.f=c;continue}if(d>m){u&&Nt(0);break}}s&&l(p+131072);for(var q=(1<<v)-1,G=(1<<g)-1,K=d;;K=d){var D=A[Ga(n,d)&q],j=D>>4;if(d+=D&15,d>m){u&&Nt(0);break}if(D||Nt(2),j<256)e[p++]=j;else if(j==256){K=d,A=null;break}else{var J=j-254;if(j>264){var M=j-257,W=dl[M];J=ur(n,d,(1<<W)-1)+ml[M],d+=W}var $=h[Ga(n,d)&G],Y=$>>4;$||Nt(3),d+=$&15;var Q=Cp[Y];if(Y>3){var W=hl[Y];Q+=Ga(n,d)&(1<<W)-1,d+=W}if(d>m){u&&Nt(0);break}s&&l(p+131072);var Z=p+J;if(p<Q){var oe=a-Q,ne=Math.min(Q,Z);for(oe+p<0&&Nt(3);p<ne;++p)e[p]=r[oe+p]}for(;p<Z;++p)e[p]=e[p-Q]}}t.l=A,t.p=K,t.b=p,t.f=c,A&&(c=1,t.m=v,t.d=h,t.n=g)}while(!c);return p!=e.length&&o?Yo(e,0,p):e.subarray(0,p)},Bp=new _t(0),Mr=function(n,t){return n[t]|n[t+1]<<8},hr=function(n,t){return(n[t]|n[t+1]<<8|n[t+2]<<16|n[t+3]<<24)>>>0},Ka=function(n,t){return hr(n,t)+hr(n,t+4)*4294967296},Fp=function(n,t){return((n[0]&15)!=8||n[0]>>4>7||(n[0]<<8|n[1])%31)&&Nt(6,"invalid zlib data"),(n[1]>>5&1)==+!t&&Nt(6,"invalid zlib data: "+(n[1]&32?"need":"unexpected")+" dictionary"),(n[1]>>3&4)+2};function Lp(n,t){return gl(n,{i:2},t&&t.out,t&&t.dictionary)}function kp(n,t){return gl(n.subarray(Fp(n,t),-4),{i:2},t,t)}var Eo=typeof TextDecoder!="undefined"&&new TextDecoder,Op=0;try{Eo.decode(Bp,{stream:!0}),Op=1}catch(n){}var Dp=function(n){for(var t="",e=0;;){var r=n[e++],i=(r>127)+(r>223)+(r>239);if(e+i>n.length)return{s:t,r:Yo(n,e-1)};i?i==3?(r=((r&15)<<18|(n[e++]&63)<<12|(n[e++]&63)<<6|n[e++]&63)-65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023)):i&1?t+=String.fromCharCode((r&31)<<6|n[e++]&63):t+=String.fromCharCode((r&15)<<12|(n[e++]&63)<<6|n[e++]&63):t+=String.fromCharCode(r)}};function Vp(n,t){if(t){for(var e="",r=0;r<n.length;r+=16384)e+=String.fromCharCode.apply(null,n.subarray(r,r+16384));return e}else{if(Eo)return Eo.decode(n);var i=Dp(n),a=i.s,e=i.r;return e.length&&Nt(8),a}}var Np=function(n,t){return t+30+Mr(n,t+26)+Mr(n,t+28)},zp=function(n,t,e){var r=Mr(n,t+28),i=Vp(n.subarray(t+46,t+46+r),!(Mr(n,t+8)&2048)),a=t+46+r,o=hr(n,t+20),s=e&&o==4294967295?Up(n,a):[o,hr(n,t+24),hr(n,t+42)],u=s[0],l=s[1],c=s[2];return[Mr(n,t+10),u,l,i,a+Mr(n,t+30)+Mr(n,t+32),c]},Up=function(n,t){for(;Mr(n,t)!=1;t+=4+Mr(n,t+2));return[Ka(n,t+12),Ka(n,t+4),Ka(n,t+20)]};function Qp(n,t){for(var e={},r=n.length-22;hr(n,r)!=101010256;--r)(!r||n.length-r>65558)&&Nt(13);var i=Mr(n,r+8);if(!i)return{};var a=hr(n,r+16),o=a==4294967295||i==65535;if(o){var s=hr(n,r-12);o=hr(n,s)==101075792,o&&(i=hr(n,s+32),a=hr(n,s+48))}for(var u=0;u<i;++u){var l=zp(n,a,o),c=l[0],d=l[1],p=l[2],A=l[3],h=l[4],v=l[5],g=Np(n,v);a=h,c?c==8?e[A]=Lp(n.subarray(g,g+d),{out:new _t(p)}):Nt(14,"unknown compression type "+c):e[A]=Yo(n,g,g+d)}return e}var qp=new f.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function yl(n,t){var e;t===void 0&&(t={});var r=(e=t.fetcher)!==null&&e!==void 0?e:new Qt({allowHosts:["*"]}),i=0;return Promise.resolve().then(function(){return r.ajax(n,{responseType:"arraybuffer"}).then(function(a){return i=a.body.byteLength,a.body})}).then(function(a){var o;return Hp(a,{materialType:t.materialType,resourcePath:n.slice(0,n.lastIndexOf("/")+1),search:(o=n.split("?")[1])!==null&&o!==void 0?o:"",fetcher:r})}).then(function(a){var o=a.scene,s=a.unitScale/100,u=new f.Matrix4;return u.makeScale(s,s,s),a.upAxis==="Y"&&u.premultiply(qp),o.applyMatrix4(u),{type:"fbx",upAxis:"Z",uri:n,byteLength:i,scene:o,textures:a.textures,dispose:function(){return a.dispose()}}})}function Hp(n,t){var e;if(Xp(n))e=new Jp().parse(n);else{var r=xl(n);if(!Wp(r))throw new Error("THREE.FBXLoader: Unknown format.");if(i0(r)<7e3)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+i0(r));e=new jp().parse(r)}return new Gp(t).parse(e)}var Gp=function(){function n(t){var e,r,i;this.materialType=(e=t.materialType)!==null&&e!==void 0?e:"phong",this.resourcePath=(r=t.resourcePath)!==null&&r!==void 0?r:"",this.search=(i=t.search)!==null&&i!==void 0?i:"",this.fetcher=t.fetcher}return n.prototype.parse=function(t){var e,r,i,a,o,s,u=this.parseConnections(t),l=new f.Group,c=[],d=this.parseImages(t),p=this.parseTextures(t,d,u,c),A=this.parseMaterials(t,p,u),h=this.parseDeformers(t,u),v=new Kp().parse(t,h,u);this.parseScene(t,h,v,A,u,l);var g=(r=(e=t.GlobalSettings.UpAxis)===null||e===void 0?void 0:e.value)!==null&&r!==void 0?r:1,m=(a=(i=t.GlobalSettings.FrontAxis)===null||i===void 0?void 0:i.value)!==null&&a!==void 0?a:2,y=(s=(o=t.GlobalSettings.UnitScaleFactor)===null||o===void 0?void 0:o.value)!==null&&s!==void 0?s:1,b;if(t.GlobalSettings.AmbientColor){var x=t.GlobalSettings.AmbientColor.value,w=x[0],E=x[1],S=x[2];if(w!==0||E!==0||S!==0){var C=new f.Color().setRGB(w,E,S);b=new f.AmbientLight(C,1)}}return Promise.all(c).then(function(R){return{scene:l,textures:R,ambientLight:b,upAxis:["X","Y","Z"][g],frontAxis:["X","Y","Z"][m],unitScale:y,dispose:function(){R.forEach(function(B){return B.dispose()}),A.forEach(function(B){return B.dispose()}),v.forEach(function(B){return B.dispose()})}}})},n.prototype.parseConnections=function(t){var e=new Map;if("Connections"in t){var r=t.Connections.connections;r.forEach(function(i){var a=i[0],o=i[1],s=i[2];e.has(a)||e.set(a,{parents:[],children:[]});var u={ID:o,relationship:s};e.get(a).parents.push(u),e.has(o)||e.set(o,{parents:[],children:[]});var l={ID:a,relationship:s};e.get(o).children.push(l)})}return e},n.prototype.parseImages=function(t){var e={},r={};if("Video"in t.Objects){var i=t.Objects.Video;for(var a in i){var o=i[a],s=parseInt(a);if(e[s]=o.RelativeFilename||o.Filename,"Content"in o){var u=o.Content instanceof ArrayBuffer&&o.Content.byteLength>0,l=typeof o.Content=="string"&&o.Content!=="";if(u||l){var c=this.parseImage(i[a]);r[o.RelativeFilename||o.Filename]=c}}}}for(var s in e){var d=e[s];r[d]!==void 0?e[s]=r[d]:e[s]=e[s].split("\\").pop()}return e},n.prototype.parseImage=function(t){var e=t.Content,r=t.RelativeFilename||t.Filename,i=r.slice(r.lastIndexOf(".")+1).toLowerCase(),a;switch(i){case"bmp":a="image/bmp";break;case"jpg":case"jpeg":a="image/jpeg";break;case"png":a="image/png";break;case"tif":a="image/tiff";break;case"tga":a="image/tga";break;default:return}if(typeof e=="string")return"data:"+a+";base64,"+e;var o=new Uint8Array(e);return window.URL.createObjectURL(new Blob([o],{type:a}))},n.prototype.parseTextures=function(t,e,r,i){var a=new Map;if("Texture"in t.Objects){var o=t.Objects.Texture;for(var s in o){var u=this.parseTexture(o[s],e,r,i);a.set(parseInt(s),u)}}return a},n.prototype.parseTexture=function(t,e,r,i){var a=this.loadTexture(t,e,r,i);a.ID=t.id,a.name=t.attrName;var o=t.WrapModeU,s=t.WrapModeV,u=o!==void 0?o.value:0,l=s!==void 0?s.value:0;if(a.wrapS=u===0?f.RepeatWrapping:f.ClampToEdgeWrapping,a.wrapT=l===0?f.RepeatWrapping:f.ClampToEdgeWrapping,t.Scaling){var c=t.Scaling.value;a.repeat.x=c[0],a.repeat.y=c[1]}if(t.Translation){var c=t.Translation.value;a.offset.x=c[0],a.offset.y=c[1]}return a},n.prototype.loadTexture=function(t,e,r,i){var a=r.get(t.id).children,o="";a!==void 0&&a.length>0&&e[a[0].ID]!==void 0&&(o=e[a[0].ID]),o=st(this.resourcePath,fa(o,this.search));var s=Object.assign(new f.Texture,{ID:0}),u;u=this.fetcher.loadImage(o,{},void 0,void 0,void 0,hi()).then(function(c){return c.body});var l=u.then(function(c){return s.image=c,s.needsUpdate=!0,s});return i.push(l),s},n.prototype.parseMaterials=function(t,e,r){var i=new Map;if("Material"in t.Objects){var a=t.Objects.Material;for(var o in a){var s=this.parseMaterial(t,a[o],e,r);s!==null&&i.set(parseInt(o),s)}}return i},n.prototype.parseMaterial=function(t,e,r,i){var a=e.id;e.attrName;var o=e.ShadingModel;if(typeof o=="object"&&(o=o.value),o=o.toLowerCase(),!i.has(a))return null;var s=new Ar(this.materialType);e.BumpFactor&&(s.bumpScale=e.BumpFactor.value),e.Diffuse?s.color=new f.Color().fromArray(e.Diffuse.value):e.DiffuseColor&&(e.DiffuseColor.type==="Color"||e.DiffuseColor.type==="ColorRGB")&&(s.color=new f.Color().fromArray(e.DiffuseColor.value)),e.DisplacementFactor&&(s.displacementScale=e.DisplacementFactor.value),e.Emissive?s.emissive=new f.Color().fromArray(e.Emissive.value):e.EmissiveColor&&(e.EmissiveColor.type==="Color"||e.EmissiveColor.type==="ColorRGB")&&(s.emissive=new f.Color().fromArray(e.EmissiveColor.value)),e.EmissiveFactor&&(s.emissiveIntensity=parseFloat(e.EmissiveFactor.value));var u=1-(e.TransparencyFactor?parseFloat(e.TransparencyFactor.value):0);(u===1||u===0)&&(u=e.Opacity?parseFloat(e.Opacity.value):null,u===null&&(u=1-(e.TransparentColor?parseFloat(e.TransparentColor.value[0]):0))),s.opacity=u,s.opacity<1&&(s.transparent=!0),e.ReflectionFactor&&(s.reflectivity=e.ReflectionFactor.value),e.Shininess&&(s.shininess=e.Shininess.value),e.Specular?s.specular=new f.Color().fromArray(e.Specular.value):e.SpecularColor&&e.SpecularColor.type==="Color"&&(s.specular=new f.Color().fromArray(e.SpecularColor.value));var l=this;return i.get(a).children.forEach(function(c){var d=c.relationship;switch(d){case"Bump":s.bumpMap=l.getTexture(t,r,c.ID,i);break;case"Maya|TEX_ao_map":s.aoMap=l.getTexture(t,r,c.ID,i);break;case"DiffuseColor":case"Maya|TEX_color_map":s.map=l.getTexture(t,r,c.ID,i),s.map!==void 0&&(s.map.encoding=f.sRGBEncoding);break;case"DisplacementColor":s.displacementMap=l.getTexture(t,r,c.ID,i);break;case"EmissiveColor":s.emissiveMap=l.getTexture(t,r,c.ID,i),s.emissiveMap!==void 0&&(s.emissiveMap.encoding=f.sRGBEncoding);break;case"NormalMap":case"Maya|TEX_normal_map":s.normalMap=l.getTexture(t,r,c.ID,i);break;case"ReflectionColor":s.envMap=l.getTexture(t,r,c.ID,i),s.envMap!==void 0&&(s.envMap.mapping=f.EquirectangularReflectionMapping,s.envMap.encoding=f.sRGBEncoding);break;case"SpecularColor":s.specularMap=l.getTexture(t,r,c.ID,i),s.specularMap!==void 0&&(s.specularMap.encoding=f.sRGBEncoding);break;case"TransparentColor":case"TransparencyFactor":s.alphaMap=l.getTexture(t,r,c.ID,i),s.transparent=!0;break;case"AmbientColor":case"ShininessExponent":case"SpecularFactor":case"VectorDisplacementColor":default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",d);break}}),s.refreshUniforms(),s},n.prototype.getTexture=function(t,e,r,i){return t.Objects.LayeredTexture&&r in t.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),r=i.get(r).children[0].ID),e.get(r)},n.prototype.parseDeformers=function(t,e){var r={},i={};if("Deformer"in t.Objects){var a=t.Objects.Deformer;for(var o in a){var s=a[o],u=e.get(parseInt(o));if(s.attrType==="Skin"){var l=this.parseSkeleton(u,a);l.ID=o,u.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),l.geometryID=u.parents[0].ID,r[o]=l}else if(s.attrType==="BlendShape"){var c={id:o};c.rawTargets=this.parseMorphTargets(u,a,e),c.id=o,u.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),i[o]=c}}}return{skeletons:r,morphTargets:i}},n.prototype.parseSkeleton=function(t,e){var r=[];return t.children.forEach(function(i){var a=e[i.ID];if(a.attrType==="Cluster"){var o={ID:i.ID,indices:[],weights:[],transformLink:new f.Matrix4().fromArray(a.TransformLink.a)};a.Indexes&&(o.indices=a.Indexes.a,o.weights=a.Weights.a),r.push(o)}}),{ID:"",geometryID:0,rawBones:r,bones:[]}},n.prototype.parseMorphTargets=function(t,e,r){for(var i=[],a=0;a<t.children.length;a++){var o=t.children[a],s=e[o.ID],u={name:s.attrName,initialWeight:s.DeformPercent,id:s.id,fullWeights:s.FullWeights.a,geoID:0};if(s.attrType!=="BlendShapeChannel")return;u.geoID=r.get(parseInt(o.ID)).children.filter(function(l){return l.relationship===void 0})[0].ID,i.push(u)}return i},n.prototype.parseScene=function(t,e,r,i,a,o){var s=this.parseModels(t,e.skeletons,r,i,a),u=t.Objects.Model,l=this;s.forEach(function(d){var p=u[d.ID];l.setLookAtProperties(t,d,p,a,o);var A=a.get(d.ID).parents;A.forEach(function(h){var v=s.get(h.ID);v!==void 0&&v.add(d)}),d.parent===null&&o.add(d)}),this.bindSkeleton(t,e.skeletons,r,s,a),o.traverse(function(d){if(d.userData.transformData){d.parent&&(d.userData.transformData.parentMatrix=d.parent.matrix,d.userData.transformData.parentMatrixWorld=d.parent.matrixWorld);var p=bl(d.userData.transformData);d.applyMatrix4(p),d.updateWorldMatrix(!0,!0)}});var c=new _p().parse(t,a,o);o.children.length===1&&o.children[0]instanceof f.Group&&(o.children[0].animations=c,o=o.children[0]),o.animations=c},n.prototype.parseModels=function(t,e,r,i,a){var o=new Map,s=t.Objects.Model;for(var u in s){var l=parseInt(u),c=s[u],d=a.get(l),p=this.buildSkeleton(d,e,l,c.attrName);if(!p){switch(c.attrType){case"Camera":p=this.createCamera(t,d);break;case"Light":p=this.createLight(t,d);break;case"Mesh":p=this.createMesh(d,r,i);break;case"NurbsCurve":case"LimbNode":case"Root":p=new f.Bone;break;case"Null":default:p=new f.Group;break}p.name=c.attrName?f.PropertyBinding.sanitizeNodeName(c.attrName):"",p.userData.originalName=c.attrName,p.ID=l}this.getTransformData(p,c),o.set(l,p)}return o},n.prototype.buildSkeleton=function(t,e,r,i){var a=null;return t.parents.forEach(function(o){var s=function(l){var c=e[l];c.rawBones.forEach(function(d,p){if(d.ID===o.ID){var A=a;a=new f.Bone,a.matrixWorld.copy(d.transformLink),a.name=i?f.PropertyBinding.sanitizeNodeName(i):"",a.userData.originalName=i,a.ID=r,c.bones[p]=a,A!==null&&a.add(A)}})};for(var u in e)s(u)}),a},n.prototype.createCamera=function(t,e){var r,i;if(e.children.forEach(function(A){var h=t.Objects.NodeAttribute[A.ID];h!==void 0&&(i=h)}),i===void 0)r=new f.Object3D;else{var a=0;i.CameraProjectionType!==void 0&&i.CameraProjectionType.value===1&&(a=1);var o=1;i.NearPlane!==void 0&&(o=i.NearPlane.value/1e3);var s=1e3;i.FarPlane!==void 0&&(s=i.FarPlane.value/1e3);var u=window.innerWidth,l=window.innerHeight;i.AspectWidth!==void 0&&i.AspectHeight!==void 0&&(u=i.AspectWidth.value,l=i.AspectHeight.value);var c=u/l,d=45;i.FieldOfView!==void 0&&(d=i.FieldOfView.value);var p=i.FocalLength?i.FocalLength.value:null;switch(a){case 0:r=new f.PerspectiveCamera(d,c,o,s),p!==null&&r.setFocalLength(p);break;case 1:console.warn("THREE.FBXLoader: Orthographic cameras not supported yet."),r=new f.Object3D;break;default:console.warn("THREE.FBXLoader: Unknown camera type "+a+"."),r=new f.Object3D;break}}return r},n.prototype.createLight=function(t,e){var r,i;if(e.children.forEach(function(p){var A=t.Objects.NodeAttribute[p.ID];A!==void 0&&(i=A)}),i===void 0)r=new f.Object3D;else{var a=void 0;i.LightType===void 0?a=0:a=i.LightType.value;var o=new f.Color(16777215);i.Color!==void 0&&(o=new f.Color().fromArray(i.Color.value));var s=i.Intensity===void 0?1:i.Intensity.value/100;i.CastLightOnObject!==void 0&&i.CastLightOnObject.value===0&&(s=0);var u=0;i.FarAttenuationEnd!==void 0&&(i.EnableFarAttenuation!==void 0&&i.EnableFarAttenuation.value===0?u=0:u=i.FarAttenuationEnd.value);var l=1;switch(a){case 0:r=new f.PointLight(o,s,u,l);break;case 1:r=new f.DirectionalLight(o,s);break;case 2:var c=Math.PI/3;i.InnerAngle!==void 0&&(c=f.MathUtils.degToRad(i.InnerAngle.value));var d=0;i.OuterAngle!==void 0&&(d=f.MathUtils.degToRad(i.OuterAngle.value),d=Math.max(d,1)),r=new f.SpotLight(o,s,u,c,d,l);break;default:console.warn("THREE.FBXLoader: Unknown light type "+i.LightType.value+", defaulting to a PointLight."),r=new f.PointLight(o,s);break}i.CastShadows!==void 0&&i.CastShadows.value===1&&(r.castShadow=!0)}return r},n.prototype.createMesh=function(t,e,r){var i,a=null,o=[];if(t.children.forEach(function(u){e.has(u.ID)&&(a=e.get(u.ID)),r.has(u.ID)&&o.push(r.get(u.ID))}),o.length===0){var s=new Ar(this.materialType);s.color=new f.Color(13421772),o.push(s)}return"color"in a.attributes&&o.forEach(function(u){u.vertexColors=!0}),(!a.groups||a.groups.length===0)&&a.addGroup(0,a.index?a.index.count:a.attributes.position.count,0),a.FBX_Deformer?(i=new hu(a,o),i.normalizeSkinWeights()):i=new kt(a,o),i},n.prototype.createCurve=function(t,e){var r=t.children.reduce(function(a,o){return e.has(o.ID)&&(a=e.get(o.ID)),a},null),i=new f.LineBasicMaterial({name:"",color:3342591,linewidth:1});return new f.Line(r,i)},n.prototype.getTransformData=function(t,e){var r={};e.InheritType&&(r.inheritType=parseInt(e.InheritType.value)),e.RotationOrder?r.eulerOrder=pi(e.RotationOrder.value):r.eulerOrder=pi(0),e.Lcl_Translation&&(r.translation=e.Lcl_Translation.value),e.PreRotation&&(r.preRotation=e.PreRotation.value),e.Lcl_Rotation&&(r.rotation=e.Lcl_Rotation.value),e.PostRotation&&(r.postRotation=e.PostRotation.value),e.Lcl_Scaling&&(r.scale=e.Lcl_Scaling.value),e.ScalingOffset&&(r.scalingOffset=e.ScalingOffset.value),e.ScalingPivot&&(r.scalingPivot=e.ScalingPivot.value),e.RotationOffset&&(r.rotationOffset=e.RotationOffset.value),e.RotationPivot&&(r.rotationPivot=e.RotationPivot.value),t.userData.transformData=r},n.prototype.setLookAtProperties=function(t,e,r,i,a){if("LookAtProperty"in r){var o=i.get(e.ID).children;o.forEach(function(s){if(s.relationship==="LookAtProperty"){var u=t.Objects.Model[s.ID];if(u.Lcl_Translation){var l=u.Lcl_Translation.value;"target"in e&&e.target instanceof f.Object3D?(e.target.position.fromArray(l),a.add(e.target)):e.lookAt(new f.Vector3().fromArray(l))}}})}},n.prototype.bindSkeleton=function(t,e,r,i,a){var o=this.parsePoseNodes(t),s=function(l){var c=e[l],d=a.get(parseInt(c.ID)).parents;d.forEach(function(p){if(r.has(p.ID)){var A=p.ID,h=a.get(A);h.parents.forEach(function(v){if(i.has(v.ID)){var g=i.get(v.ID);g instanceof f.SkinnedMesh&&g.bind(new f.Skeleton(c.bones),o[v.ID])}})}})};for(var u in e)s(u)},n.prototype.parsePoseNodes=function(t){var e={};if(t.Objects.Pose){var r=t.Objects.Pose;for(var i in r)if(r[i].attrType==="BindPose"&&r[i].NbPoseNodes>0){var a=r[i].PoseNode;Array.isArray(a)?a.forEach(function(o){e[o.Node]=new f.Matrix4().fromArray(o.Matrix.a)}):e[a.Node]=new f.Matrix4().fromArray(a.Matrix.a)}}return e},n}(),Kp=function(){function n(){this.negativeMaterialIndices=!1}return n.prototype.parse=function(t,e,r){var i=new Map;if("Geometry"in t.Objects){var a=t.Objects.Geometry;for(var o in a){var s=r.get(parseInt(o)),u=this.parseGeometry(t,s,a[o],e);i.set(parseInt(o),u)}}return this.negativeMaterialIndices===!0&&console.warn("THREE.FBXLoader: The FBX file contains invalid (negative) material indices. The asset might not render as expected."),i},n.prototype.parseGeometry=function(t,e,r,i){switch(r.attrType){case"Mesh":return this.parseMeshGeometry(t,e,r,i);case"NurbsCurve":return this.parseNurbsGeometry(r)}},n.prototype.parseMeshGeometry=function(t,e,r,i){var a=i.skeletons,o=[],s=e.parents.map(function(p){return t.Objects.Model[p.ID]});if(s.length!==0){var u=e.children.reduce(function(p,A){return a[A.ID]!==void 0&&(p=a[A.ID]),p},null);e.children.forEach(function(p){i.morphTargets[p.ID]!==void 0&&o.push(i.morphTargets[p.ID])});var l=s[0],c={};l.RotationOrder&&(c.eulerOrder=pi(l.RotationOrder.value)),l.InheritType&&(c.inheritType=parseInt(l.InheritType.value)),l.GeometricTranslation&&(c.translation=l.GeometricTranslation.value),l.GeometricRotation&&(c.rotation=l.GeometricRotation.value),l.GeometricScaling&&(c.scale=l.GeometricScaling.value);var d=bl(c);return this.genGeometry(t,r,u,o,d)}},n.prototype.genGeometry=function(t,e,r,i,a){var o=new f.BufferGeometry;e.attrName&&(o.name=e.attrName);var s=this.parseGeoNode(e,r),u=this.genBuffers(s),l=new f.Float32BufferAttribute(u.vertex,3);if(l.applyMatrix4(a),o.setAttribute("position",l),u.colors.length>0&&o.setAttribute("color",new f.Float32BufferAttribute(u.colors,3)),r&&(o.setAttribute("skinIndex",new f.Uint16BufferAttribute(u.weightsIndices,4)),o.setAttribute("skinWeight",new f.Float32BufferAttribute(u.vertexWeights,4)),o.FBX_Deformer=r),u.normal.length>0){var c=new f.Matrix3().getNormalMatrix(a),d=new f.Float32BufferAttribute(u.normal,3);d.applyNormalMatrix(c),o.setAttribute("normal",d)}if(u.uvs.forEach(function(g,m){var y=m===0?"uv":"uv".concat(m+1);o.setAttribute(y,new f.Float32BufferAttribute(u.uvs[m],2))}),s.material&&s.material.mappingType!=="AllSame"){var p=u.materialIndex[0],A=0;if(u.materialIndex.forEach(function(g,m){g!==p&&(o.addGroup(A,m-A,p),p=g,A=m)}),o.groups.length>0){var h=o.groups[o.groups.length-1],v=h.start+h.count;v!==u.materialIndex.length&&o.addGroup(v,u.materialIndex.length-v,p)}o.groups.length===0&&o.addGroup(0,u.materialIndex.length,u.materialIndex[0])}return this.addMorphTargets(t,o,e,i,a),o},n.prototype.parseGeoNode=function(t,e){var r={};if(r.vertexPositions=t.Vertices!==void 0?t.Vertices.a:[],r.vertexIndices=t.PolygonVertexIndex!==void 0?t.PolygonVertexIndex.a:[],t.LayerElementColor&&(r.color=this.parseVertexColors(t.LayerElementColor[0])),t.LayerElementMaterial&&(r.material=this.parseMaterialIndices(t.LayerElementMaterial[0])),t.LayerElementNormal&&(r.normal=this.parseNormals(t.LayerElementNormal[0])),t.LayerElementUV){r.uv=[];for(var i=0;t.LayerElementUV[i];)t.LayerElementUV[i].UV&&r.uv.push(this.parseUVs(t.LayerElementUV[i])),i++}return r.weightTable={},e!==null&&(r.skeleton=e,e.rawBones.forEach(function(a,o){a.indices.forEach(function(s,u){r.weightTable[s]===void 0&&(r.weightTable[s]=[]),r.weightTable[s].push({id:o,weight:a.weights[u]})})})),r},n.prototype.genBuffers=function(t){var e={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]},r=0,i=0,a=!1,o=[],s=[],u=[],l=[],c=[],d=[],p=this;return t.vertexIndices.forEach(function(A,h){var v=0,g=!1;A<0&&(A=A^-1,g=!0);var m=[],y=[];if(o.push(A*3,A*3+1,A*3+2),t.color){var b=Di(h,r,A,t.color);u.push(b[0],b[1],b[2])}if(t.skeleton){if(t.weightTable[A]!==void 0&&t.weightTable[A].forEach(function(S){y.push(S.weight),m.push(S.id)}),y.length>4){a||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),a=!0);var x=[0,0,0,0],w=[0,0,0,0];y.forEach(function(S,C){var R=S,B=m[C];w.forEach(function(M,I,L){if(R>M){L[I]=R,R=M;var T=x[I];x[I]=B,B=T}})}),m=x,y=w}for(;y.length<4;)y.push(0),m.push(0);for(var E=0;E<4;++E)c.push(y[E]),d.push(m[E])}if(t.normal){var b=Di(h,r,A,t.normal);s.push(b[0],b[1],b[2])}t.material&&t.material.mappingType!=="AllSame"&&(v=Di(h,r,A,t.material)[0],v<0&&(p.negativeMaterialIndices=!0,v=0)),t.uv&&t.uv.forEach(function(S,C){var R=Di(h,r,A,S);l[C]===void 0&&(l[C]=[]),l[C].push(R[0]),l[C].push(R[1])}),i++,g&&(p.genFace(e,t,o,v,s,u,l,c,d,i),r++,i=0,o=[],s=[],u=[],l=[],c=[],d=[])}),e},n.prototype.getNormalNewell=function(t){for(var e=new f.Vector3(0,0,0),r=0;r<t.length;r++){var i=t[r],a=t[(r+1)%t.length];e.x+=(i.y-a.y)*(i.z+a.z),e.y+=(i.z-a.z)*(i.x+a.x),e.z+=(i.x-a.x)*(i.y+a.y)}return e.normalize(),e},n.prototype.getNormalTangentAndBitangent=function(t){var e=this.getNormalNewell(t),r=Math.abs(e.z)>.5?new f.Vector3(0,1,0):new f.Vector3(0,0,1),i=r.cross(e).normalize(),a=e.clone().cross(i).normalize();return{normal:e,tangent:i,bitangent:a}},n.prototype.flattenVertex=function(t,e,r){return new f.Vector2(t.dot(e),t.dot(r))},n.prototype.genFace=function(t,e,r,i,a,o,s,u,l,c){var d;if(c>3){for(var p=[],A=e.baseVertexPositions||e.vertexPositions,h=0;h<r.length;h+=3)p.push(new f.Vector3(A[r[h]],A[r[h+1]],A[r[h+2]]));for(var v=this.getNormalTangentAndBitangent(p),g=v.tangent,m=v.bitangent,y=[],b=0,x=p;b<x.length;b++){var w=x[b];y.push(this.flattenVertex(w,g,m))}d=f.ShapeUtils.triangulateShape(y,[])}else d=[[0,1,2]];for(var E=function(L,T,F){t.vertex.push(e.vertexPositions[r[L*3]]),t.vertex.push(e.vertexPositions[r[L*3+1]]),t.vertex.push(e.vertexPositions[r[L*3+2]]),t.vertex.push(e.vertexPositions[r[T*3]]),t.vertex.push(e.vertexPositions[r[T*3+1]]),t.vertex.push(e.vertexPositions[r[T*3+2]]),t.vertex.push(e.vertexPositions[r[F*3]]),t.vertex.push(e.vertexPositions[r[F*3+1]]),t.vertex.push(e.vertexPositions[r[F*3+2]]),e.skeleton&&(t.vertexWeights.push(u[L*4]),t.vertexWeights.push(u[L*4+1]),t.vertexWeights.push(u[L*4+2]),t.vertexWeights.push(u[L*4+3]),t.vertexWeights.push(u[T*4]),t.vertexWeights.push(u[T*4+1]),t.vertexWeights.push(u[T*4+2]),t.vertexWeights.push(u[T*4+3]),t.vertexWeights.push(u[F*4]),t.vertexWeights.push(u[F*4+1]),t.vertexWeights.push(u[F*4+2]),t.vertexWeights.push(u[F*4+3]),t.weightsIndices.push(l[L*4]),t.weightsIndices.push(l[L*4+1]),t.weightsIndices.push(l[L*4+2]),t.weightsIndices.push(l[L*4+3]),t.weightsIndices.push(l[T*4]),t.weightsIndices.push(l[T*4+1]),t.weightsIndices.push(l[T*4+2]),t.weightsIndices.push(l[T*4+3]),t.weightsIndices.push(l[F*4]),t.weightsIndices.push(l[F*4+1]),t.weightsIndices.push(l[F*4+2]),t.weightsIndices.push(l[F*4+3])),e.color&&(t.colors.push(o[L*3]),t.colors.push(o[L*3+1]),t.colors.push(o[L*3+2]),t.colors.push(o[T*3]),t.colors.push(o[T*3+1]),t.colors.push(o[T*3+2]),t.colors.push(o[F*3]),t.colors.push(o[F*3+1]),t.colors.push(o[F*3+2])),e.material&&e.material.mappingType!=="AllSame"&&(t.materialIndex.push(i),t.materialIndex.push(i),t.materialIndex.push(i)),e.normal&&(t.normal.push(a[L*3]),t.normal.push(a[L*3+1]),t.normal.push(a[L*3+2]),t.normal.push(a[T*3]),t.normal.push(a[T*3+1]),t.normal.push(a[T*3+2]),t.normal.push(a[F*3]),t.normal.push(a[F*3+1]),t.normal.push(a[F*3+2])),e.uv&&e.uv.forEach(function(D,V){t.uvs[V]===void 0&&(t.uvs[V]=[]),t.uvs[V].push(s[V][L*2]),t.uvs[V].push(s[V][L*2+1]),t.uvs[V].push(s[V][T*2]),t.uvs[V].push(s[V][T*2+1]),t.uvs[V].push(s[V][F*2]),t.uvs[V].push(s[V][F*2+1])})},S=0,C=d;S<C.length;S++){var R=C[S],B=R[0],M=R[1],I=R[2];E(B,M,I)}},n.prototype.addMorphTargets=function(t,e,r,i,a){if(i.length!==0){e.morphTargetsRelative=!0,e.morphAttributes.position=[];var o=this;i.forEach(function(s){s.rawTargets.forEach(function(u){var l=t.Objects.Geometry[u.geoID];l!==void 0&&o.genMorphGeometry(e,r,l,a,u.name)})})}},n.prototype.genMorphGeometry=function(t,e,r,i,a){for(var o=e.Vertices!==void 0?e.Vertices.a:[],s=e.PolygonVertexIndex!==void 0?e.PolygonVertexIndex.a:[],u=r.Vertices!==void 0?r.Vertices.a:[],l=r.Indexes?r.Indexes.a:[],c=t.attributes.position.count*3,d=new Float32Array(c),p=0;p<l.length;p++){var A=l[p]*3;d[A]=u[p*3],d[A+1]=u[p*3+1],d[A+2]=u[p*3+2]}var h={vertexIndices:s,vertexPositions:d,baseVertexPositions:o},v=this.genBuffers(h),g=new f.Float32BufferAttribute(v.vertex,3);g.name=a||r.attrName,g.applyMatrix4(i),t.morphAttributes.position.push(g)},n.prototype.parseNormals=function(t){var e=t.MappingInformationType,r=t.ReferenceInformationType,i=t.Normals.a,a=[];return r==="IndexToDirect"&&(t.NormalIndex?a=t.NormalIndex.a:t.NormalsIndex&&(a=t.NormalsIndex.a)),{dataSize:3,buffer:i,indices:a,mappingType:e,referenceType:r}},n.prototype.parseUVs=function(t){var e=t.MappingInformationType,r=t.ReferenceInformationType,i=t.UV.a,a=[];return r==="IndexToDirect"&&(a=t.UVIndex.a),{dataSize:2,buffer:i,indices:a,mappingType:e,referenceType:r}},n.prototype.parseVertexColors=function(t){var e=t.MappingInformationType,r=t.ReferenceInformationType,i=t.Colors.a,a=[];r==="IndexToDirect"&&(a=t.ColorIndex.a);for(var o=0,s=new f.Color;o<i.length;o+=4)s.fromArray(i,o),s.toArray(i,o);return{dataSize:4,buffer:i,indices:a,mappingType:e,referenceType:r}},n.prototype.parseMaterialIndices=function(t){var e=t.MappingInformationType,r=t.ReferenceInformationType;if(e==="NoMappingInformation")return{dataSize:1,buffer:[0],indices:[0],mappingType:"AllSame",referenceType:r};for(var i=t.Materials.a,a=[],o=0;o<i.length;++o)a.push(o);return{dataSize:1,buffer:i,indices:a,mappingType:e,referenceType:r}},n.prototype.parseNurbsGeometry=function(t){var e=parseInt(t.Order);if(isNaN(e))return console.error("THREE.FBXLoader: Invalid Order %s given for geometry ID: %s",t.Order,t.id),new f.BufferGeometry;for(var r=e-1,i=t.KnotVector.a,a=[],o=t.Points.a,s=0,u=o.length;s<u;s+=4)a.push(new f.Vector4().fromArray(o,s));var l,c;if(t.Form==="Closed")a.push(a[0]);else if(t.Form==="Periodic"){l=r,c=i.length-1-l;for(var s=0;s<r;++s)a.push(a[s])}var d=new tv(r,i,a,l,c),p=d.getPoints(a.length*12);return new f.BufferGeometry().setFromPoints(p)},n}(),_p=function(){function n(){}return n.prototype.parse=function(t,e,r){var i=[],a=this.parseClips(t,e,r);if(a!==void 0)for(var o in a){var s=a[o],u=this.addClip(s,r);i.push(u)}return i},n.prototype.parseClips=function(t,e,r){if(t.Objects.AnimationCurve!==void 0){var i=this.parseAnimationCurveNodes(t);this.parseAnimationCurves(t,i,e);var a=this.parseAnimationLayers(t,i,e,r),o=this.parseAnimStacks(t,a,e);return o}},n.prototype.parseAnimationCurveNodes=function(t){var e=t.Objects.AnimationCurveNode,r=new Map;for(var i in e){var a=e[i];if(a.attrName.match(/S|R|T|DeformPercent/)!==null){var o={id:a.id,attr:a.attrName,curves:{}};r.set(o.id,o)}}return r},n.prototype.parseAnimationCurves=function(t,e,r){var i=t.Objects.AnimationCurve;for(var a in i){var o={id:i[a].id,times:i[a].KeyTime.a.map(Zp),values:i[a].KeyValueFloat.a},s=r.get(o.id);if(s!==void 0){var u=s.parents[0].ID,l=s.parents[0].relationship,c=e.get(u);c&&(l.match(/X/)?c.curves.x=o:l.match(/Y/)?c.curves.y=o:l.match(/Z/)?c.curves.z=o:l.match(/DeformPercent/)&&e.has(u)&&(c.curves.morph=o))}}},n.prototype.parseAnimationLayers=function(t,e,r,i){var a=t.Objects.AnimationLayer,o=new Map,s=function(l){var c=[],d=r.get(parseInt(l));if(d!==void 0){var p=d.children;p.forEach(function(A,h){if(e.has(A.ID)){var v=e.get(A.ID);if(v.curves.x!==void 0||v.curves.y!==void 0||v.curves.z!==void 0){if(c[h]===void 0){var g=r.get(A.ID).parents.filter(function(C){return C.relationship!==void 0})[0].ID;if(g!==void 0){var m=t.Objects.Model[g.toString()];if(m===void 0){console.warn("THREE.FBXLoader: Encountered a unused curve.",A);return}var y={modelName:m.attrName?f.PropertyBinding.sanitizeNodeName(m.attrName):"",ID:m.id,initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1],transform:new f.Matrix4,eulerOrder:"",preRotation:[0,0,0],postRotation:[0,0,0]};i.traverse(function(C){C.ID===m.id&&(y.transform=C.matrix,C.userData.transformData&&(y.eulerOrder=C.userData.transformData.eulerOrder))}),y.transform||(y.transform=new f.Matrix4),m.PreRotation&&(y.preRotation=m.PreRotation.value),m.PostRotation&&(y.postRotation=m.PostRotation.value),c[h]=y}}c[h]&&(c[h][v.attr]=v)}else if(v.curves.morph!==void 0){if(c[h]===void 0){var b=r.get(A.ID).parents.filter(function(R){return R.relationship!==void 0})[0].ID,x=r.get(b).parents[0].ID,w=r.get(x).parents[0].ID,g=r.get(w).parents[0].ID,E=t.Objects.Model[g],S={modelName:E.attrName?f.PropertyBinding.sanitizeNodeName(E.attrName):"",morphName:t.Objects.Deformer[b].attrName};c[h]=S}c[h][v.attr]=v}}}),o.set(parseInt(l),c)}};for(var u in a)s(u);return o},n.prototype.parseAnimStacks=function(t,e,r){var i=t.Objects.AnimationStack,a={};for(var o in i){var s=r.get(parseInt(o)).children;s.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");var u=e.get(s[0].ID);a[o]={name:i[o].attrName,layer:u}}return a},n.prototype.addClip=function(t,e){var r=[],i=this;return t.layer.forEach(function(a){r=r.concat(i.generateTracks(a,e))}),new f.AnimationClip(t.name,-1,r)},n.prototype.generateTracks=function(t,e){var r=[],i=new f.Vector3,a=new f.Vector3;t.transform&&t.transform.decompose(i,new f.Quaternion,a);var o=i.toArray(),s=a.toArray();if(t.T!==void 0&&Object.keys(t.T.curves).length>0){var u=this.generateVectorTrack(t.modelName,t.T.curves,o,"position");u!==void 0&&r.push(u)}if(t.R!==void 0&&Object.keys(t.R.curves).length>0){var l=this.generateRotationTrack(t.modelName,t.R.curves,t.preRotation,t.postRotation,t.eulerOrder);l!==void 0&&r.push(l)}if(t.S!==void 0&&Object.keys(t.S.curves).length>0){var c=this.generateVectorTrack(t.modelName,t.S.curves,s,"scale");c!==void 0&&r.push(c)}if(t.DeformPercent!==void 0){var d=this.generateMorphTrack(t,e);d!==void 0&&r.push(d)}return r},n.prototype.generateVectorTrack=function(t,e,r,i){var a=this.getTimesForAllAxes(e),o=this.getKeyframeTrackValues(a,e,r);return new f.VectorKeyframeTrack(t+"."+i,a,o)},n.prototype.generateRotationTrack=function(t,e,r,i,a){var o,s;if(e.x!==void 0&&e.y!==void 0&&e.z!==void 0){var u=this.interpolateRotations(e.x,e.y,e.z,a);o=u[0],s=u[1]}var l=pi(0),c=new f.Quaternion,d=new f.Quaternion;r!==void 0&&(r=r.map(f.MathUtils.degToRad),r.push(l),c.setFromEuler(new f.Euler().fromArray(r))),i!==void 0&&(i=i.map(f.MathUtils.degToRad),i.push(l),d.setFromEuler(new f.Euler().fromArray(i)),d.inverse());var p=new f.Quaternion,A=new f.Euler,h=[];if(!s||!o)return new f.QuaternionKeyframeTrack(t+".quaternion",[0],[0]);for(var v=0;v<s.length;v+=3){if(A.set(s[v],s[v+1],s[v+2],a),p.setFromEuler(A),p.premultiply(c),p.multiply(d),v>2){var g=new f.Quaternion().fromArray(h,(v-3)/3*4);g.dot(p)<0&&p.set(-p.x,-p.y,-p.z,-p.w)}p.toArray(h,v/3*4)}return new f.QuaternionKeyframeTrack(t+".quaternion",o,h)},n.prototype.generateMorphTrack=function(t,e){var r=t.DeformPercent.curves.morph,i=r.values.map(function(o){return o/100}),a=e.getObjectByName(t.modelName).morphTargetDictionary[t.morphName];return new f.NumberKeyframeTrack(t.modelName+".morphTargetInfluences["+a+"]",r.times,i)},n.prototype.getTimesForAllAxes=function(t){var e=[];if(t.x!==void 0&&(e=e.concat(t.x.times)),t.y!==void 0&&(e=e.concat(t.y.times)),t.z!==void 0&&(e=e.concat(t.z.times)),e=e.sort(function(s,u){return s-u}),e.length>1){for(var r=1,i=e[0],a=1;a<e.length;a++){var o=e[a];o!==i&&(e[r]=o,i=o,r++)}e=e.slice(0,r)}return e},n.prototype.getKeyframeTrackValues=function(t,e,r){var i=r,a=[],o=-1,s=-1,u=-1;return t.forEach(function(l){if(e.x&&(o=e.x.times.indexOf(l)),e.y&&(s=e.y.times.indexOf(l)),e.z&&(u=e.z.times.indexOf(l)),o!==-1){var c=e.x.values[o];a.push(c),i[0]=c}else a.push(i[0]);if(s!==-1){var d=e.y.values[s];a.push(d),i[1]=d}else a.push(i[1]);if(u!==-1){var p=e.z.values[u];a.push(p),i[2]=p}else a.push(i[2])}),a},n.prototype.interpolateRotations=function(t,e,r,i){var a=[],o=[];a.push(t.times[0]),o.push(f.MathUtils.degToRad(t.values[0])),o.push(f.MathUtils.degToRad(e.values[0])),o.push(f.MathUtils.degToRad(r.values[0]));for(var s=1;s<t.values.length;s++){var u=[t.values[s-1],e.values[s-1],r.values[s-1]];if(!(isNaN(u[0])||isNaN(u[1])||isNaN(u[2]))){var l=u.map(f.MathUtils.degToRad),c=[t.values[s],e.values[s],r.values[s]];if(!(isNaN(c[0])||isNaN(c[1])||isNaN(c[2]))){c.map(f.MathUtils.degToRad);var d=[c[0]-u[0],c[1]-u[1],c[2]-u[2]],p=[Math.abs(d[0]),Math.abs(d[1]),Math.abs(d[2])];if(p[0]>=180||p[1]>=180||p[2]>=180){var A=Math.max.apply(Math,p),h=A/180,v=new f.Euler(l[0],l[1],l[2],i),g=new f.Euler(l[0],l[1],l[2],i),m=new f.Quaternion().setFromEuler(v),y=new f.Quaternion().setFromEuler(g);m.dot(y)&&y.set(-y.x,-y.y,-y.z,-y.w);for(var b=t.times[s-1],x=t.times[s]-b,w=new f.Quaternion,E=new f.Euler,S=0;S<1;S+=1/h)w.copy(m.clone().slerp(y.clone(),S)),a.push(b+S*x),E.setFromQuaternion(w,i),o.push(E.x),o.push(E.y),o.push(E.z)}else a.push(t.times[s]),o.push(f.MathUtils.degToRad(t.values[s])),o.push(f.MathUtils.degToRad(e.values[s])),o.push(f.MathUtils.degToRad(r.values[s]))}}}return[a,o]},n}(),jp=function(){function n(){this.allNodes=new So,this.nodeStack=[],this.currentIndent=0,this.currentPropName=""}return n.prototype.getPrevNode=function(){return this.nodeStack[this.currentIndent-2]},n.prototype.getCurrentNode=function(){return this.nodeStack[this.currentIndent-1]},n.prototype.getCurrentProp=function(){return this.currentProp},n.prototype.pushStack=function(t){this.nodeStack.push(t),this.currentIndent+=1},n.prototype.popStack=function(){this.nodeStack.pop(),this.currentIndent-=1},n.prototype.setCurrentProp=function(t,e){this.currentProp=t,this.currentPropName=e},n.prototype.parse=function(t){this.currentIndent=0,this.allNodes=new So,this.nodeStack=[],this.currentProp=[],this.currentPropName="";var e=this,r=t.split(/[\r\n]+/);return r.forEach(function(i,a){var o=i.match(/^[\s\t]*;/),s=i.match(/^[\s\t]*$/);if(!(o||s)){var u=i.match("^\\t{"+e.currentIndent+"}(\\w+):(.*){"),l=i.match("^\\t{"+e.currentIndent+"}(\\w+):[\\s\\t\\r\\n](.*)"),c=i.match("^\\t{"+(e.currentIndent-1)+"}}");u?e.parseNodeBegin(i,u):l?e.parseNodeProperty(i,l,r[++a]):c?e.popStack():i.match(/^[^\s\t}]/)&&e.parseNodePropertyContinued(i)}}),this.allNodes},n.prototype.parseNodeBegin=function(t,e){var r=e[1].trim().replace(/^"/,"").replace(/"$/,""),i=e[2].split(",").map(function(u){return u.trim().replace(/^"/,"").replace(/"$/,"")}),a={name:r},o=this.parseNodeAttr(i),s=this.getCurrentNode();this.currentIndent===0?this.allNodes.add(r,a):r in s?(r==="PoseNode"?s.PoseNode.push(a):s[r].id!==void 0&&(s[r]={},s[r][s[r].id]=s[r]),o.id!==""&&(s[r][o.id]=a)):typeof o.id=="number"?(s[r]={},s[r][o.id]=a):r!=="Properties70"&&(r==="PoseNode"?s[r]=[a]:s[r]=a),typeof o.id=="number"&&(a.id=o.id),o.name!==""&&(a.attrName=o.name),o.type!==""&&(a.attrType=o.type),this.pushStack(a)},n.prototype.parseNodeAttr=function(t){var e=t[0];t[0]!==""&&(e=parseInt(t[0]),isNaN(e)&&(e=t[0]));var r="",i="";return t.length>1&&(r=t[1].replace(/^(\w+)::/,""),i=t[2]),{id:e,name:r,type:i}},n.prototype.parseNodeProperty=function(t,e,r){var i=e[1].replace(/^"/,"").replace(/"$/,"").trim(),a=e[2].replace(/^"/,"").replace(/"$/,"").trim();i==="Content"&&a===","&&(a=r.replace(/"/g,"").replace(/,$/,"").trim());var o=this.getCurrentNode(),s=o.name;if(s==="Properties70"){this.parseNodeSpecialProperty(t,i,a);return}if(i==="C"){var u=a.split(",").slice(1),l=parseInt(u[0]),c=parseInt(u[1]),d=a.split(",").slice(3);d=d.map(function(p){return p.trim().replace(/^"/,"")}),i="connections",a=[l,c],$p(a,d),o[i]===void 0&&(o[i]=[])}i==="Node"&&(o.id=a),i in o&&Array.isArray(o[i])?o[i].push(a):i!=="a"?o[i]=a:o.a=a,this.setCurrentProp(o,i),i==="a"&&a.slice(-1)!==","&&(o.a=ja(a))},n.prototype.parseNodePropertyContinued=function(t){var e=this.getCurrentNode();e.a+=t,t.slice(-1)!==","&&(e.a=ja(e.a))},n.prototype.parseNodeSpecialProperty=function(t,e,r){var i=r.split('",').map(function(c){return c.trim().replace(/^\"/,"").replace(/\s/,"_")}),a=i[0],o=i[1],s=i[2],u=i[3],l=i[4];switch(o){case"int":case"enum":case"bool":case"ULongLong":case"double":case"Number":case"FieldOfView":l=parseFloat(l);break;case"Color":case"ColorRGB":case"Vector3D":case"Lcl_Translation":case"Lcl_Rotation":case"Lcl_Scaling":l=ja(l);break}this.getPrevNode()[a]={type:o,type2:s,flag:u,value:l},this.setCurrentProp(this.getPrevNode(),a)},n}(),Jp=function(){function n(){}return n.prototype.parse=function(t){var e=new n0(t);e.skip(23);var r=e.getUint32();if(r<6400)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+r);for(var i=new So;!this.endOfContent(e);){var a=this.parseNode(e,r);a!==null&&i.add(a.name,a)}return i},n.prototype.endOfContent=function(t){return t.size()%16===0?(t.getOffset()+160+16&-16)>=t.size():t.getOffset()+160+16>=t.size()},n.prototype.parseNode=function(t,e){var r={},i=e>=7500?t.getUint64():t.getUint32(),a=e>=7500?t.getUint64():t.getUint32();e>=7500?t.getUint64():t.getUint32();var o=t.getUint8(),s=t.getString(o);if(i===0)return null;for(var u=[],l=0;l<a;l++)u.push(this.parseProperty(t));var c=u.length>0?u[0]:"",d=u.length>1?u[1]:"",p=u.length>2?u[2]:"";for(r.singleProperty=a===1&&t.getOffset()===i;i>t.getOffset();){var A=this.parseNode(t,e);A!==null&&this.parseSubNode(s,r,A)}return r.propertyList=u,typeof c=="number"&&(r.id=c),d!==""&&(r.attrName=d),p!==""&&(r.attrType=p),s!==""&&(r.name=s),r},n.prototype.parseSubNode=function(t,e,r){if(r.singleProperty===!0){var i=r.propertyList[0];Array.isArray(i)?(e[r.name]=r,r.a=i):e[r.name]=i}else if(t==="Connections"&&r.name==="C"){var a=[];r.propertyList.forEach(function(p,A){A!==0&&a.push(p)}),e.connections===void 0&&(e.connections=[]),e.connections.push(a)}else if(r.name==="Properties70"){var o=Object.keys(r);o.forEach(function(p){e[p]=r[p]})}else if(t==="Properties70"&&r.name==="P"){var s=r.propertyList[0],u=r.propertyList[1],l=r.propertyList[2],c=r.propertyList[3],d=void 0;s.indexOf("Lcl ")===0&&(s=s.replace("Lcl ","Lcl_")),u.indexOf("Lcl ")===0&&(u=u.replace("Lcl ","Lcl_")),u==="Color"||u==="ColorRGB"||u==="Vector"||u==="Vector3D"||u.indexOf("Lcl_")===0?d=[r.propertyList[4],r.propertyList[5],r.propertyList[6]]:d=r.propertyList[4],e[s]={type:u,type2:l,flag:c,value:d}}else e[r.name]===void 0?typeof r.id=="number"?(e[r.name]={},e[r.name][r.id]=r):e[r.name]=r:r.name==="PoseNode"?(Array.isArray(e[r.name])||(e[r.name]=[e[r.name]]),e[r.name].push(r)):e[r.name][r.id]===void 0&&(e[r.name][r.id]=r)},n.prototype.parseProperty=function(t){var e=t.getString(1),r;switch(e){case"C":return t.getBoolean();case"D":return t.getFloat64();case"F":return t.getFloat32();case"I":return t.getInt32();case"L":return t.getInt64();case"R":return r=t.getUint32(),t.getArrayBuffer(r);case"S":return r=t.getUint32(),t.getString(r);case"Y":return t.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":var i=t.getUint32(),a=t.getUint32(),o=t.getUint32();if(a===0)switch(e){case"b":case"c":return t.getBooleanArray(i);case"d":return t.getFloat64Array(i);case"f":return t.getFloat32Array(i);case"i":return t.getInt32Array(i);case"l":return t.getInt64Array(i)}var s=kp(new Uint8Array(t.getArrayBuffer(o))),u=new n0(s.buffer);switch(e){case"b":case"c":return u.getBooleanArray(i);case"d":return u.getFloat64Array(i);case"f":return u.getFloat32Array(i);case"i":return u.getInt32Array(i);case"l":return u.getInt64Array(i)}break;default:throw new Error("THREE.FBXLoader: Unknown property type "+e)}},n}(),n0=function(){function n(t,e){this.dv=new DataView(t),this.offset=0,this.littleEndian=e!==void 0?e:!0,this._textDecoder=new TextDecoder}return n.prototype.getOffset=function(){return this.offset},n.prototype.size=function(){return this.dv.buffer.byteLength},n.prototype.skip=function(t){this.offset+=t},n.prototype.getBoolean=function(){return(this.getUint8()&1)===1},n.prototype.getBooleanArray=function(t){for(var e=[],r=0;r<t;r++)e.push(this.getBoolean());return e},n.prototype.getUint8=function(){var t=this.dv.getUint8(this.offset);return this.offset+=1,t},n.prototype.getInt16=function(){var t=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,t},n.prototype.getInt32=function(){var t=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,t},n.prototype.getInt32Array=function(t){for(var e=[],r=0;r<t;r++)e.push(this.getInt32());return e},n.prototype.getUint32=function(){var t=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,t},n.prototype.getInt64=function(){var t,e;return this.littleEndian?(t=this.getUint32(),e=this.getUint32()):(e=this.getUint32(),t=this.getUint32()),e&2147483648?(e=~e&4294967295,t=~t&4294967295,t===4294967295&&(e=e+1&4294967295),t=t+1&4294967295,-(e*4294967296+t)):e*4294967296+t},n.prototype.getInt64Array=function(t){for(var e=[],r=0;r<t;r++)e.push(this.getInt64());return e},n.prototype.getUint64=function(){var t,e;return this.littleEndian?(t=this.getUint32(),e=this.getUint32()):(e=this.getUint32(),t=this.getUint32()),e*4294967296+t},n.prototype.getFloat32=function(){var t=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,t},n.prototype.getFloat32Array=function(t){for(var e=[],r=0;r<t;r++)e.push(this.getFloat32());return e},n.prototype.getFloat64=function(){var t=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,t},n.prototype.getFloat64Array=function(t){for(var e=[],r=0;r<t;r++)e.push(this.getFloat64());return e},n.prototype.getArrayBuffer=function(t){var e=this.dv.buffer.slice(this.offset,this.offset+t);return this.offset+=t,e},n.prototype.getString=function(t){var e=this.offset,r=new Uint8Array(this.dv.buffer,e,t);this.skip(t);var i=r.indexOf(0);return i>=0&&(r=new Uint8Array(this.dv.buffer,e,i)),this._textDecoder.decode(r)},n}(),So=function(){function n(){this.Connections={connections:[]},this.Objects={Model:{},NodeAttribute:{},Geometry:{}},this.GlobalSettings={}}return n.prototype.add=function(t,e){this[t]=e},n}();function Xp(n){var t="Kaydara FBX Binary \0";return n.byteLength>=t.length&&t===xl(n,0,t.length)}function Wp(n){var t=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"],e=0;function r(o){var s=n[o-1];return n=n.slice(e+o),e++,s}for(var i=0;i<t.length;++i){var a=r(1);if(a===t[i])return!1}return!0}function i0(n){var t=/FBXVersion: (\d+)/,e=n.match(t);if(e){var r=parseInt(e[1]);return r}throw new Error("THREE.FBXLoader: Cannot find the version number for the file given.")}function Zp(n){return n/46186158e3}var Yp=[];function Di(n,t,e,r){var i;switch(r.mappingType){case"ByPolygonVertex":i=n;break;case"ByPolygon":i=t;break;case"ByVertice":i=e;break;case"AllSame":i=r.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+r.mappingType),i=0}r.referenceType==="IndexToDirect"&&(i=r.indices[i]);var a=i*r.dataSize,o=a+r.dataSize;return ev(Yp,r.buffer,a,o)}var _a=new f.Euler,Ln=new f.Vector3;function bl(n){var t=new f.Matrix4,e=new f.Matrix4,r=new f.Matrix4,i=new f.Matrix4,a=new f.Matrix4,o=new f.Matrix4,s=new f.Matrix4,u=new f.Matrix4,l=new f.Matrix4,c=new f.Matrix4,d=new f.Matrix4,p=new f.Matrix4,A=n.inheritType?n.inheritType:0;n.translation&&t.setPosition(Ln.fromArray(n.translation));var h=pi(0);if(n.preRotation){var v=n.preRotation.map(f.MathUtils.degToRad);v.push(h),e.makeRotationFromEuler(_a.fromArray(v))}if(n.rotation){var v=n.rotation.map(f.MathUtils.degToRad);v.push(n.eulerOrder||h),r.makeRotationFromEuler(_a.fromArray(v))}if(n.postRotation){var v=n.postRotation.map(f.MathUtils.degToRad);v.push(h),i.makeRotationFromEuler(_a.fromArray(v)),i.copy(new f.Matrix4().getInverse(i))}n.scale&&a.scale(Ln.fromArray(n.scale)),n.scalingOffset&&s.setPosition(Ln.fromArray(n.scalingOffset)),n.scalingPivot&&o.setPosition(Ln.fromArray(n.scalingPivot)),n.rotationOffset&&u.setPosition(Ln.fromArray(n.rotationOffset)),n.rotationPivot&&l.setPosition(Ln.fromArray(n.rotationPivot)),n.parentMatrixWorld&&(d.copy(n.parentMatrix),c.copy(n.parentMatrixWorld));var g=e.clone().multiply(r).multiply(i),m=new f.Matrix4;m.extractRotation(c);var y=new f.Matrix4;y.copyPosition(c);var b=new f.Matrix4().getInverse(y).multiply(c),x=new f.Matrix4().getInverse(m).multiply(b),w=a,E=new f.Matrix4;if(A===0)E.copy(m).multiply(g).multiply(x).multiply(w);else if(A===1)E.copy(m).multiply(x).multiply(g).multiply(w);else{var S=new f.Matrix4().scale(new f.Vector3().setFromMatrixScale(d)),C=new f.Matrix4().getInverse(S),R=x.clone().multiply(C);E.copy(m).multiply(g).multiply(R).multiply(w)}var B=new f.Matrix4().getInverse(l),M=new f.Matrix4().getInverse(o),I=t.clone().multiply(u).multiply(l).multiply(e).multiply(r).multiply(i).multiply(B).multiply(s).multiply(o).multiply(a).multiply(M),L=new f.Matrix4().copyPosition(I),T=c.clone().multiply(L);return p.copyPosition(T),I=p.clone().multiply(E),I.premultiply(new f.Matrix4().getInverse(c)),I}function pi(n){n=n||0;var t=["ZYX","YZX","XZY","ZXY","YXZ","XYZ"];return n===6?(console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect."),t[0]):t[n]}function ja(n){var t=n.split(",").map(function(e){return parseFloat(e)});return t}function xl(n,t,e){return t===void 0&&(t=0),e===void 0&&(e=n.byteLength),new TextDecoder().decode(new Uint8Array(n,t,e))}function $p(n,t){for(var e=0,r=n.length,i=t.length;e<i;e++,r++)n[r]=t[e]}function ev(n,t,e,r){for(var i=e,a=0;i<r;i++,a++)n[a]=t[i];return n}var tv=function(n){ue(t,n);function t(e,r,i,a,o){var s=n.call(this)||this,u=r?r.length-1:0,l=i?i.length:0;s.degree=e,s.knots=r,s.controlPoints=[],s.startKnot=a||0,s.endKnot=o||u;for(var c=0;c<l;++c){var d=i[c];s.controlPoints[c]=new f.Vector4(d.x,d.y,d.z,d.w)}return s}return t.prototype.getPoint=function(e,r){r===void 0&&(r=new f.Vector3);var i=r,a=this.knots[this.startKnot]+e*(this.knots[this.endKnot]-this.knots[this.startKnot]),o=nv(this.degree,this.knots,this.controlPoints,a);return o.w!==1&&o.divideScalar(o.w),i.set(o.x,o.y,o.z)},t.prototype.getTangent=function(e,r){r===void 0&&(r=new f.Vector3);var i=r,a=this.knots[0]+e*(this.knots[this.knots.length-1]-this.knots[0]),o=uv(this.degree,this.knots,this.controlPoints,a,1);return i.copy(o[1]).normalize(),i},t.prototype.toJSON=function(){var e=n.prototype.toJSON.call(this);return e.degree=this.degree,e.knots=vt([],this.knots,!0),e.controlPoints=this.controlPoints.map(function(r){return r.toArray()}),e.startKnot=this.startKnot,e.endKnot=this.endKnot,e},t.prototype.fromJSON=function(e){return n.prototype.fromJSON.call(this,e),this.degree=e.degree,this.knots=vt([],e.knots,!0),this.controlPoints=e.controlPoints.map(function(r){return new f.Vector4(r[0],r[1],r[2],r[3])}),this.startKnot=e.startKnot,this.endKnot=e.endKnot,this},t}(f.Curve);function wl(n,t,e){var r=e.length-n-1;if(t>=e[r])return r-1;if(t<=e[n])return n;for(var i=n,a=r,o=Math.floor((i+a)/2);t<e[o]||t>=e[o+1];)t<e[o]?a=o:i=o,o=Math.floor((i+a)/2);return o}function rv(n,t,e,r){var i=[],a=[],o=[];i[0]=1;for(var s=1;s<=e;++s){a[s]=t-r[n+1-s],o[s]=r[n+s]-t;for(var u=0,l=0;l<s;++l){var c=o[l+1],d=a[s-l],p=i[l]/(c+d);i[l]=u+c*p,u=d*p}i[s]=u}return i}function nv(n,t,e,r){for(var i=wl(n,r,t),a=rv(i,r,n,t),o=new f.Vector4(0,0,0,0),s=0;s<=n;++s){var u=e[i-n+s],l=a[s],c=u.w*l;o.x+=u.x*c,o.y+=u.y*c,o.z+=u.z*c,o.w+=u.w*l}return o}function iv(n,t,e,r,i){for(var a=[],o=0;o<=e;++o)a[o]=0;for(var s=[],o=0;o<=r;++o)s[o]=a.slice(0);for(var u=[],o=0;o<=e;++o)u[o]=a.slice(0);u[0][0]=1;for(var l=a.slice(0),c=a.slice(0),d=1;d<=e;++d){l[d]=t-i[n+1-d],c[d]=i[n+d]-t;for(var p=0,A=0;A<d;++A){var h=c[A+1],v=l[d-A];u[d][A]=h+v;var g=u[A][d-1]/u[d][A];u[A][d]=p+h*g,p=v*g}u[d][d]=p}for(var d=0;d<=e;++d)s[0][d]=u[d][e];for(var m=0;m<=e;++m){for(var y=0,b=1,x=[],o=0;o<=e;++o)x[o]=a.slice(0);x[0][0]=1;for(var w=1;w<=r;++w){var E=0,S=m-w,C=e-w;m>=w&&(x[b][0]=x[y][0]/u[C+1][S],E=x[b][0]*u[S][C]);for(var R=S>=-1?1:-S,B=m-1<=C?w-1:e-m,M=R;M<=B;++M)x[b][M]=(x[y][M]-x[y][M-1])/u[C+1][S+M],E+=x[b][M]*u[S+M][C];m<=C&&(x[b][w]=-x[y][w-1]/u[C+1][m],E+=x[b][w]*u[m][C]),s[w][m]=E;var d=y;y=b,b=d}}for(var I=e,w=1;w<=r;++w){for(var d=0;d<=e;++d)s[w][d]*=I;I*=e-w}return s}function av(n,t,e,r,i){for(var a=i<n?i:n,o=[],s=wl(n,r,t),u=iv(s,r,n,a,t),l=[],c=0;c<e.length;++c){var d=e[c].clone(),p=d.w;d.x*=p,d.y*=p,d.z*=p,l[c]=d}for(var A=0;A<=a;++A){for(var d=l[s-n].clone().multiplyScalar(u[A][0]),h=1;h<=n;++h)d.add(l[s-n+h].clone().multiplyScalar(u[A][h]));o[A]=d}for(var A=a+1;A<=i+1;++A)o[A]=new f.Vector4(0,0,0);return o}function ov(n,t){for(var e=1,r=2;r<=n;++r)e*=r;for(var i=1,r=2;r<=t;++r)i*=r;for(var r=2;r<=n-t;++r)i*=r;return e/i}function sv(n){for(var t=n.length,e=[],r=[],i=0;i<t;++i){var a=n[i];e[i]=new f.Vector3(a.x,a.y,a.z),r[i]=a.w}for(var o=[],s=0;s<t;++s){for(var u=e[s].clone(),i=1;i<=s;++i)u.sub(o[s-i].clone().multiplyScalar(ov(s,i)*r[i]));o[s]=u.divideScalar(r[0])}return o}function uv(n,t,e,r,i){var a=av(n,t,e,r,i);return sv(a)}var kn=new f.Vector3;function lv(n,t){switch(t){case"D":return new Float64Array(n);case"F":return new Float32Array(n);case"L":return new Int32Array(n);case"I":return new Int16Array(n);default:return new Uint8Array(n)}}function El(n,t){var e;t===void 0&&(t={});var r=(e=t.fetcher)!==null&&e!==void 0?e:new Qt({allowHosts:["*"]}),i={byteLength:0};return Promise.resolve().then(function(){return r.ajax(n,{responseType:"arraybuffer"})}).then(function(a){var o;return i.byteLength=a.body.byteLength,cv(new Uint8Array(a.body),{materialType:t.materialType,color:t.color,resourcePath:n.slice(0,n.lastIndexOf("/")+1),search:(o=n.split("?")[1])!==null&&o!==void 0?o:"",fetcher:r})}).then(function(a){var o=new f.Group;return o.matrixAutoUpdate=!1,o.matrix.compose(o.position,o.quaternion,o.scale),o.name=n,o.add(a.object),{type:"x3p",upAxis:"Z",uri:n,byteLength:i.byteLength,scene:o,textures:[],dispose:function(){return a.dispose()}}})}function cv(n,t){for(var e,r,i,a,o,s,u,l,c,d,p,A,h,v,g,m,y,b,x,w,E,S,C,R,B,M,I,L,T,F,D,V,z,Q,q,G,K,j,J,W,$,Y,Z,oe,ne,de,se,ye,ie,xe,Le,Me,Oe,ee,re,H=Qp(n),Be="",Te=null,Ce=0,Ue=Object.keys(H);Ce<Ue.length;Ce++){var Ie=Ue[Ce];/(^|\/)main\.xml$/i.test(Ie)&&(Te=H[Ie],Be=Ie.slice(0,Ie.lastIndexOf("/")+1))}if(!Te)throw new Error("X3p: main.xml not found.");if(typeof DOMParser=="undefined")throw new Error("X3p: DOMParser not found.");var we=(e=t.materialType)!==null&&e!==void 0?e:"phong",be=(r=t.color)!==null&&r!==void 0?r:new f.Color(10066329),Ae=new DOMParser,me=ea(Te),ze=Ae.parseFromString(me,"text/xml"),pe=ze.querySelector("Record1 Axes"),Se={x:{type:(o=(a=(i=pe==null?void 0:pe.querySelector("CX AxisType"))===null||i===void 0?void 0:i.textContent)===null||a===void 0?void 0:a.toUpperCase())!==null&&o!==void 0?o:"I",dataType:(l=(u=(s=pe==null?void 0:pe.querySelector("CX DataType"))===null||s===void 0?void 0:s.textContent)===null||u===void 0?void 0:u.toUpperCase())!==null&&l!==void 0?l:"D",increment:Number((d=(c=pe==null?void 0:pe.querySelector("CX Increment"))===null||c===void 0?void 0:c.textContent)!==null&&d!==void 0?d:"1"),offset:Number((A=(p=pe==null?void 0:pe.querySelector("CX Offset"))===null||p===void 0?void 0:p.textContent)!==null&&A!==void 0?A:"0")},y:{type:(g=(v=(h=pe==null?void 0:pe.querySelector("CY AxisType"))===null||h===void 0?void 0:h.textContent)===null||v===void 0?void 0:v.toUpperCase())!==null&&g!==void 0?g:"I",dataType:(b=(y=(m=pe==null?void 0:pe.querySelector("CY DataType"))===null||m===void 0?void 0:m.textContent)===null||y===void 0?void 0:y.toUpperCase())!==null&&b!==void 0?b:"D",increment:Number((w=(x=pe==null?void 0:pe.querySelector("CY Increment"))===null||x===void 0?void 0:x.textContent)!==null&&w!==void 0?w:"1"),offset:Number((S=(E=pe==null?void 0:pe.querySelector("CY Offset"))===null||E===void 0?void 0:E.textContent)!==null&&S!==void 0?S:"0")},z:{type:(B=(R=(C=pe==null?void 0:pe.querySelector("CZ AxisType"))===null||C===void 0?void 0:C.textContent)===null||R===void 0?void 0:R.toUpperCase())!==null&&B!==void 0?B:"A",dataType:(L=(I=(M=pe==null?void 0:pe.querySelector("CZ DataType"))===null||M===void 0?void 0:M.textContent)===null||I===void 0?void 0:I.toUpperCase())!==null&&L!==void 0?L:"D",increment:Number((F=(T=pe==null?void 0:pe.querySelector("CZ Increment"))===null||T===void 0?void 0:T.textContent)!==null&&F!==void 0?F:"1"),offset:Number((V=(D=pe==null?void 0:pe.querySelector("CZ Offset"))===null||D===void 0?void 0:D.textContent)!==null&&V!==void 0?V:"0")}},St=null,Pe=ze.querySelector("Record1 Axes Rotation");Pe&&(St=new f.Matrix3,St.set(Number((Q=(z=Pe.querySelector("r11"))===null||z===void 0?void 0:z.textContent)!==null&&Q!==void 0?Q:0),Number((G=(q=Pe.querySelector("r12"))===null||q===void 0?void 0:q.textContent)!==null&&G!==void 0?G:0),Number((j=(K=Pe.querySelector("r13"))===null||K===void 0?void 0:K.textContent)!==null&&j!==void 0?j:0),Number((W=(J=Pe.querySelector("r21"))===null||J===void 0?void 0:J.textContent)!==null&&W!==void 0?W:0),Number((Y=($=Pe.querySelector("r22"))===null||$===void 0?void 0:$.textContent)!==null&&Y!==void 0?Y:0),Number((oe=(Z=Pe.querySelector("r23"))===null||Z===void 0?void 0:Z.textContent)!==null&&oe!==void 0?oe:0),Number((de=(ne=Pe.querySelector("r31"))===null||ne===void 0?void 0:ne.textContent)!==null&&de!==void 0?de:0),Number((ye=(se=Pe.querySelector("r32"))===null||se===void 0?void 0:se.textContent)!==null&&ye!==void 0?ye:0),Number((xe=(ie=Pe.querySelector("r33"))===null||ie===void 0?void 0:ie.textContent)!==null&&xe!==void 0?xe:0)));var je=(Le=ze.querySelector("Record3 DataLink PointDataLink"))===null||Le===void 0?void 0:Le.textContent;if(typeof je!="string")throw new Error("X3p: PointDataLink not found.");je=st(Be,je);var it=H[je];if(!it)throw new Error("X3p: ".concat(it," not found."));for(var jt=lv(it.buffer,Se.z.dataType),Qr=Number((Oe=(Me=ze.querySelector("Record3 MatrixDimension SizeX"))===null||Me===void 0?void 0:Me.textContent)!==null&&Oe!==void 0?Oe:"0"),Jt=Number((re=(ee=ze.querySelector("Record3 MatrixDimension SizeY"))===null||ee===void 0?void 0:ee.textContent)!==null&&re!==void 0?re:"0"),ut=Math.floor(Qr-1),Mt=Math.floor(Jt-1),dt=ut+1,Ct=Mt+1,It=new Float32Array(dt*Ct*3),Tt=new Float32Array(dt*Ct*2),Xe=new Uint32Array(ut*Mt*6),Ne=new f.Box3,We=0;We<Ct;We++)for(var At=We*Se.y.increment+Se.y.offset,Ze=0;Ze<dt;Ze++){var gt=We*dt+Ze,qt=Ze*Se.x.increment+Se.x.offset,yt=jt[gt],Xt=!isNaN(yt),gr=Xt?yt:NaN;kn.set(qt,-At,gr),St&&kn.applyMatrix3(St),Xt&&Ne.expandByPoint(kn),It[gt*3+0]=kn.x,It[gt*3+1]=kn.y,It[gt*3+2]=kn.z,Tt[gt*2+0]=Ze/ut,Tt[gt*2+1]=1-We/Mt}for(var We=0;We<Mt;We++)for(var Ze=0;Ze<ut;Ze++){var qr=Ze+dt*We,yr=Ze+dt*(We+1),Pr=Ze+1+dt*(We+1),Ot=Ze+1+dt*We,Ge=(We*ut+Ze)*6;Xe[Ge+0]=qr,Xe[Ge+1]=yr,Xe[Ge+2]=Ot,Xe[Ge+3]=yr,Xe[Ge+4]=Pr,Xe[Ge+5]=Ot}var ke=new f.BufferGeometry;ke.setAttribute("position",new f.BufferAttribute(It,3)),ke.setAttribute("uv",new f.BufferAttribute(Tt,2)),ke.setIndex(new f.BufferAttribute(Xe,1)),(!ke.groups||ke.groups.length===0)&&ke.addGroup(0,ke.index?ke.index.count:ke.attributes.position.count,0),ke.boundingBox=Ne;var Ye=new Ar(we);Ye.flatShading=!0,Ye.color.copy(be),Ye.refreshUniforms();var bt=new kt(ke,[Ye]);return{object:bt,dispose:function(){ke.dispose(),Ye.dispose()}}}var a0=new f.Matrix4,fv=5e3,o0=1e3;function Ja(n,t){n.name=t.id;var e=t.tileset.properties.floorInfo;n.traverse(function(r){if("floor"in t.extras){if(r instanceof f.Mesh||r instanceof f.Points)for(var i=Array.isArray(r.material)?r.material:r.material?[r.material]:[],a=0,o=i;a<o.length;a++){var s=o[a];(s instanceof Ar||s instanceof Mi)&&(s.floor=t.extras.floor)}}else if(!(r instanceof mr)){if(r instanceof kt&&e){for(var u=new f.Box3().expandByObject(r),l=u.getCenter(new f.Vector3),c=0,d=0;d<e.length;d++){var p=e[d],A=p.ground,h=p.height;if(l.y<A+h){c=d;break}}t.floor=c,t.tileset.floorLength=Math.max(t.tileset.floorLength,t.floor+1),r.material.forEach(function(v){return v.floor=c})}}})}function dv(n,t){if(!n.content)return Promise.resolve(n);var e=n.content,r=fa(e.uri,t.search);if(n.type==="TILESET"){var i=ft(r,{key:"model.".concat(n.siblingIndex)});return e.loadState="LOADING",e.loadStateUpdateTime=ve(),t.fetcher.ajax(i,{responseType:"text"}).then(function(a){return a.body}).then(function(a){var o=r.slice(0,r.lastIndexOf("/")+1);return Ki(JSON.parse(a),o)}).then(function(a){e.loadState="READY",e.loadStateUpdateTime=ve(),e.loadfailRetryDelay=0,n.children.length===0&&(n.children=[new _o("".concat(n.id,".0"),a.root,n.tileset,n)])}).then(function(){return n}).catch(function(a){return e.loadState="FAILED",e.loadStateUpdateTime=ve(),e.loadfailRetryDelay=Math.min(e.loadfailRetryDelay+1e3,5e3),Promise.reject(a)})}if(n.type==="SCENEGRAPH")return e.loadState="LOADING",e.loadStateUpdateTime=ve(),Promise.resolve().then(function(){var a,o,s,u,l,c,d,p,A,h,v="",g=r.split("#"),m=g[0],y=g[1],b=(y||m).split("?")[0].match(/\.([0-9a-zA-Z]+)$/);if(b&&(v=b[1]),v==="b3dm"){var x=ft(r,{key:"model.".concat(n.siblingIndex)});return Gu(x,{upAxis:n.tileset.asset.gltfUpAxis,fetcher:t.fetcher}).then(function(w){return w.scene.applyMatrix4(n.transform),w.scene.updateWorldMatrix(!1,!0),w.scene.matrixAutoUpdate=!1,Ja(w.scene,n),w})}if(v==="pnts"){var x=ft(r,{key:"model.".concat(n.siblingIndex)});return _u(x,{computeBoundingBox:!1,fetcher:t.fetcher}).then(function(E){if(E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,n.boundingVolume){var S=n.boundingVolume;E.scene.traverse(function(C){if(C instanceof mr){a0.getInverse(C.matrixWorld);var R=new f.Box3;S.getBoundingBox(R),R.applyMatrix4(a0),C.geometry.boundingBox=R}})}return Ja(E.scene,n),E})}if(v==="glb"||v==="gltf"){var x=ft(r,{key:"model.".concat(n.siblingIndex)});return sl(x,{upAxis:n.tileset.asset.gltfUpAxis,fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,Ja(E.scene,n),E})}if(v==="at3d"){var x=n.extras.at3d?r:ft(r,{key:"model.".concat(n.siblingIndex)});return nl(x,{textureBaseUri:(a=n.extras.at3d)===null||a===void 0?void 0:a.textureBaseUri,textureArray:(o=n.extras.at3d)===null||o===void 0?void 0:o.textureArray,textureOptions:(s=n.extras.at3d)===null||s===void 0?void 0:s.textureOptions,fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}if(v==="pbm"){var x=n.extras.pbm?r:ft(r,{key:"model.".concat(n.siblingIndex)});return el(x,{textureBaseUri:(u=n.extras.pbm)===null||u===void 0?void 0:u.textureBaseUri,textureArray:(l=n.extras.pbm)===null||l===void 0?void 0:l.textureArray,textureOptions:(c=n.extras.pbm)===null||c===void 0?void 0:c.textureOptions,fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}if(v==="dome"){var x=n.extras.dome?r:ft(r,{key:"model.".concat(n.siblingIndex)});return il(x,{textureBaseUri:(d=n.extras.dome)===null||d===void 0?void 0:d.textureBaseUri,textureOptions:(p=n.extras.dome)===null||p===void 0?void 0:p.textureOptions,fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}if(v==="domez"){var x=n.extras.domez?r:ft(r,{key:"model.".concat(n.siblingIndex)});return ol(x,{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(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}if(v==="ply"){var x=n.extras.ply?r:ft(r,{key:"model.".concat(n.siblingIndex)});return Zo(x,{type:"pbmPointCloud",upAxis:"Z",fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}if(v==="obj"){var x=n.extras.obj?r:ft(r,{key:"model.".concat(n.siblingIndex)});return xp(x,{upAxis:"Z",fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}if(v==="fbx"){var x=n.extras.obj?r:ft(r,{key:"model.".concat(n.siblingIndex)});return yl(x,{fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}if(v==="x3p"){var x=n.extras.x3p?r:ft(r,{key:"model.".concat(n.siblingIndex)});return El(x,{fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}throw new Error("Invalid Tile content: ".concat(r))}).then(function(a){a.scene.traverse(function(s){if(s instanceof mr)s.material.uniforms.geometricError.value=n.geometricError;else if(s instanceof kt)for(var u=0,l=s.material;u<l.length;u++){var c=l[u];c.uniforms.geometricError.value=n.geometricError}});var o={type:a.type,uri:a.uri,byteLength:a.byteLength,object:new Nu(n.id,a.scene,a.dispose)};return Promise.resolve().then(function(){return Promise.all([o.object.generateBvhTree(),t.renderer&&a.textures.length<16?Zd(a.textures,t.renderer,1024*1024):null])}).then(function(){return e.loadState="READY",e.loadStateUpdateTime=ve(),e.loadfailRetryDelay=0,e.byteLength=o.byteLength,e.data=o,n}).catch(function(s){return Mo(n),Promise.reject(s)})}).catch(function(a){return e.loadState="FAILED",e.loadStateUpdateTime=ve(),a instanceof Qn&&a.httpStatus===0||a instanceof fi||a instanceof mi?e.loadfailRetryDelay=ce(e.loadfailRetryDelay+o0,o0,fv):e.loadfailRetryDelay=1/0,Promise.reject(a)});throw new Error("Invalid Tile type: ".concat(n.type))}function Mo(n){n.content&&(n.content.data&&n.content.data.object.dispose(),n.content.data=void 0,n.content.loadState="UNLOADED",n.content.loadStateUpdateTime=ve(),n.content.byteLength=0)}var Sl=function(n){ue(t,n);function t(e,r,i){i===void 0&&(i=U);var a=n.call(this)||this;return a.name=e,a.contentObject=r,a.name=e,a.add(r),a.disposers=[i],a}return t.prototype.update=function(e,r,i){var a=this.contentObject.material[2];a.uniforms.dashOffset.value=(a.uniforms.dashOffset.value-.003)%(a.uniforms.dashSize.value.x+a.uniforms.dashSize.value.y),i.needsRender=!0},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.name,this.contentObject.clone())},t}(f.Object3D),hv=5e3,s0=1e3,Lr={vertexShader:`
|
|
935
935
|
varying vec2 vUv;
|
|
936
936
|
uniform float displacementScalar;
|
|
937
937
|
#include <common>
|
|
@@ -1035,9 +1035,9 @@ void main() {
|
|
|
1035
1035
|
}
|
|
1036
1036
|
`,uniforms:{diffuse:{value:new f.Color},opacity:{value:1},displacementScalar:{value:0}}};function pv(n,t,e,r){for(var i=new Float32Array((e+1)*(r+1)*3),a=new Float32Array((e+1)*(r+1)*3),o=new Float32Array((e+1)*(r+1)*2),s=new Uint32Array(e*r*6),u=n.computeFrenetFrames(e),l=new f.Vector3,c=new f.Vector3,d=new f.Vector2,p=new f.Vector3,A=0;A<=e;A++){p=n.getPointAt(A/e,p);for(var h=u.normals[A],v=u.binormals[A],g=0;g<=r;g++){var m=A*(r+1)+g,y=g/r*Math.PI*2,b=Math.sin(y),x=-Math.cos(y);c.x=x*h.x+b*v.x,c.y=x*h.y+b*v.y,c.z=x*h.z+b*v.z,c.normalize(),c.toArray(a,m*3),l.x=p.x+t*c.x,l.y=p.y+t*c.y,l.z=p.z+t*c.z,l.toArray(i,m*3),d.x=A/e,d.y=g/r,d.toArray(o,m*2)}}for(var A=0;A<e;A++)for(var g=0;g<r;g++){var w=(A*r+g)*6,E=(r+1)*A+g,S=(r+1)*(A+1)+g,C=(r+1)*(A+1)+(g+1),R=(r+1)*A+(g+1);s[w]=E,s[w+1]=S,s[w+2]=R,s[w+3]=S,s[w+4]=C,s[w+5]=R}var B=new f.BufferGeometry;return B.setIndex(new f.BufferAttribute(s,1)),B.setAttribute("position",new f.BufferAttribute(i,3)),B.setAttribute("normal",new f.BufferAttribute(a,3)),B.setAttribute("uv",new f.BufferAttribute(o,2)),B}function vv(n,t){for(var e=new f.Color(0).convertSRGBToLinear(),r=new f.Color(52949).convertSRGBToLinear(),i=new f.Color(3370495).convertSRGBToLinear(),a=new f.Color(16777215).convertSRGBToLinear(),o=0,s=new f.CurvePath,u=n.length,l=3;l<u;l+=3){var c=new f.Vector3().fromArray(n,l-3),d=new f.Vector3().fromArray(n,l);o+=c.distanceTo(d);var p=new f.LineCurve3(c,d);s.add(p)}var A=.03,h=Math.ceil(o*100),v=6,g=pv(s,A,h,v);g.clearGroups(),g.addGroup(0,g.index?g.index.count:g.attributes.position.count,0),g.addGroup(0,g.index?g.index.count:g.attributes.position.count,1),g.addGroup(0,g.index?g.index.count:g.attributes.position.count,2);var m=new f.ShaderMaterial({vertexShader:Lr.vertexShader,fragmentShader:Lr.fragmentShader,uniforms:f.UniformsUtils.clone(Lr.uniforms),side:f.BackSide});m.uniforms.totalLength.value=o,m.uniforms.diffuse.value=e,m.uniforms.diffuse2.value=e,m.uniforms.opacity.value=.5,m.transparent=!0;var y=new f.ShaderMaterial({vertexShader:Lr.vertexShader,fragmentShader:Lr.fragmentShader,uniforms:f.UniformsUtils.clone(Lr.uniforms),side:f.BackSide});y.uniforms.totalLength.value=o,y.uniforms.displacementScalar.value=-.01,y.uniforms.diffuse.value=r,y.uniforms.diffuse2.value=i;var b=new f.ShaderMaterial({vertexShader:Lr.vertexShader,fragmentShader:Lr.fragmentShader,uniforms:f.UniformsUtils.clone(Lr.uniforms),side:f.DoubleSide});b.uniforms.totalLength.value=o,b.uniforms.displacementScalar.value=-.026,b.uniforms.dashSize.value=new f.Vector2(.06,.09),b.uniforms.diffuse.value=a,b.uniforms.diffuse2.value=a;var x=new f.Mesh(g,[m,y,b]),w=.08,E=24,S=new f.SphereBufferGeometry(w,E,E);S.clearGroups(),S.addGroup(0,g.index?g.index.count:g.attributes.position.count,0),S.addGroup(0,g.index?g.index.count:g.attributes.position.count,1);var C=new f.ShaderMaterial({vertexShader:kr.vertexShader,fragmentShader:kr.fragmentShader,uniforms:f.UniformsUtils.clone(kr.uniforms),side:f.BackSide});C.uniforms.diffuse.value=e,C.uniforms.opacity.value=.5,C.transparent=!0;var R=new f.ShaderMaterial({vertexShader:kr.vertexShader,fragmentShader:kr.fragmentShader,uniforms:f.UniformsUtils.clone(kr.uniforms),side:f.FrontSide});R.uniforms.displacementScalar.value=-.01,R.uniforms.diffuse.value=r;var B=new f.Mesh(S,[C,R]);B.position.fromArray(n,0),x.add(B);var M=new f.ShaderMaterial({vertexShader:kr.vertexShader,fragmentShader:kr.fragmentShader,uniforms:f.UniformsUtils.clone(kr.uniforms),side:f.FrontSide});M.uniforms.displacementScalar.value=-.01,M.uniforms.diffuse.value=i;var I=new f.Mesh(S,[C,M]);return I.position.fromArray(n,n.length-3),x.add(I),{scene:x,dispose:function(){g.dispose(),m.dispose(),y.dispose(),b.dispose(),S.dispose(),C.dispose(),R.dispose(),M.dispose()}}}function mv(n,t){var e=n.name,r=fa(n.content.uri,t.search),i=ft(r,{key:"model.0"});return n.content.loadState="LOADING",n.content.loadStateUpdateTime=ve(),Zo(i,{type:"geometry",customPropertyMapping:{time:{itemType:"uint32",itemNames:["time_milisec"]}},fetcher:t.fetcher}).then(function(a){var o,s,u,l,c=(s=(o=a.scene.attributes)===null||o===void 0?void 0:o.time.array)!==null&&s!==void 0?s:[],d=(l=(u=a.scene.attributes)===null||u===void 0?void 0:u.position.array)!==null&&l!==void 0?l:[],p=a.byteLength,A=vv(d);A.scene.applyMatrix4(n.transform),A.scene.updateWorldMatrix(!1,!0),A.scene.matrixAutoUpdate=!1;var h=new Sl(e,A.scene);return n.content.data={uri:i,byteLength:p,positionArray:d,timeArray:c,object:h},n.content.byteLength=p,n.content.loadState="READY",n.content.loadStateUpdateTime=ve(),n}).catch(function(a){return n.content.data=void 0,n.content.loadState="FAILED",n.content.loadStateUpdateTime=ve(),a instanceof Qn&&a.httpStatus===0||a instanceof fi||a instanceof mi?n.content.loadfailRetryDelay=ce(n.content.loadfailRetryDelay+s0,s0,hv):n.content.loadfailRetryDelay=1/0,Promise.reject(a)})}function u0(n){n.content&&(n.content.data&&n.content.data.object.dispose(),n.content.data=void 0,n.content.loadState="UNLOADED",n.content.loadStateUpdateTime=ve(),n.content.byteLength=0)}var l0=new f.Vector3,Av=new f.Matrix3,gv=new f.Matrix4,wt=6378137,Ml=298.257223563;function Cl(n){for(var t=wt-wt/Ml,e=(wt*wt-t*t)/(wt*wt),r=Math.sqrt(n.x*n.x+n.y*n.y),i=1e-12,a=1e3,o=0,s=Math.atan2(n.z,r),u=0;o++<a;){var l=Math.sin(s),c=wt/Math.sqrt(1-e*l*l);u=r/Math.cos(s)-c;var d=Math.atan2(n.z/(c*(1-e)+u),r/(c+u));if(isNaN(d))break;var p=Math.abs(d-s);if(p<i)break;s=d}return n.set(s,Math.atan2(n.y,n.x),u)}function yv(n){var t=n.x,e=n.y,r=n.z,i=wt-wt/Ml,a=(wt*wt-i*i)/(wt*wt),o=Math.sin(t),s=Math.cos(t),u=Math.sin(e),l=Math.cos(e),c=wt/Math.sqrt(1-a*o*o),d=(c+r)*s*l,p=(c+r)*s*u,A=(i*i/(wt*wt)*c+r)*o;return n.set(d,p,A)}function bv(n,t){var e=Cl(l0.copy(n)),r=e.x,i=e.y,a=e.z,o=Math.sin(r),s=Math.sin(i),u=Math.cos(r),l=Math.cos(i);t.fromArray([-s,-o*l,u*l,0,+l,-o*s,u*s,0,0,u,o,0,0,0,0,1]);var c=Av.setFromMatrix4(t),d=l0.copy(n).applyMatrix3(c).multiplyScalar(-1);t.setPosition(d);var p=gv.fromArray([1,0,0,0,0,1,0,0,0,0,1,0,0,0,a,1]);return t.premultiply(p),t}var fr={TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15},c0=function(){var n=new f.MeshBasicMaterial;return n.side=f.BackSide,n.color.setHex(16711935),n.colorWrite=!1,n.stencilWrite=!0,n.polygonOffset=!0,n.polygonOffsetFactor=2,n.polygonOffsetUnits=2,n.stencilRef=fr.TILE_MASK,n.stencilFunc=f.AlwaysStencilFunc,n.stencilFuncMask=fr.TILE_MASK,n.stencilZPass=f.ReplaceStencilOp,n.stencilWriteMask=fr.TILE_MASK,n}(),f0=function(){var n=new f.MeshBasicMaterial;return n.visible=!1,n}(),xv=new f.BufferGeometry,wv=new f.MeshBasicMaterial,An=function(n){ue(t,n);function t(e,r,i){var a,o,s,u=n.call(this)||this;return u.modelIndex=0,u.renderObjects=[],u.backfaceObjects=[],u.debugObjects=[],u.tileObjects=[],u.debug="none",u.name=i.name,u.type=i.type,u.upAxis=i.upAxis,u.model=e,u.fetcher=i.fetcher,u.search=(a=i.search)!==null&&a!==void 0?a:"",u.groundHeight=i.groundHeight,u.coordinateTransform=i.coordinateTransform,u.boundingBox=new f.Box3,u.minLevelOfDetail=t.DEFAULT_MIN_LEVEL_OF_DETAIL,u.maxLevelOfDetail=t.DEFAULT_MAX_LEVEL_OF_DETAIL,u.panoramaMaxLevelOfDetail=t.DEFAULT_MIN_LEVEL_OF_DETAIL,u.needsRefined=!0,u.refined=!1,u.refineProgress=[0,0],u.loaded=!1,u.modelsLoaded=!1,u.disposed=!1,u.needsRender=!0,u.lastRenderHash="",u.matrixAutoUpdate=!1,u.cacheCameras=[],u.clearStencilObject=new f.Mesh(xv,wv),u.clearStencilObject.frustumCulled=!1,u.clearStencilObject.onAfterRender=function(l){return l.clearStencil()},u.tileset=new Or((s=(o=u.model.work)===null||o===void 0?void 0:o.workCode)!==null&&s!==void 0?s:"",r,{referer:i.referer,tileLoader:function(l){return u.loadContent(l)},tileUnloader:function(l){return u.unloadContent(l)},onTileLoad:function(){},onTileUnload:function(l){},onTileError:function(l,c){i.onError&&i.onError(Object.assign(c,{error:c})),console.error("Tile error",l.id,c)},trajectoryLoader:function(l){return u.loadTrajectory(l)},trajectoryUnloader:function(l){return u.unloadTrajectory(l)},onTrajectoryLoad:function(){},onTrajectoryUnload:function(l){},onTrajectoryError:function(l,c){i.onError&&i.onError(Object.assign(c,{error:c})),console.error("Trajectory error",l,c)}}),u.tileset.root.boundingVolume&&u.tileset.root.boundingVolume.getBoundingBox(u.boundingBox),u}return t.prototype.getRecommendProps=function(e){var r,i,a;e===void 0&&(e={});var o,s,u,l=128;e.powerPreference==="high"&&(l=512);var c=typeof this.tileset.rootMeta.creationTime=="string";if(c){var d=typeof this.tileset.rootMeta.numTotalPoints=="number"&&this.tileset.rootMeta.numTotalPoints>0;if(d){u=4,e.powerPreference==="high"&&(u=2),o=u/1.6;var p=0;if(((r=this.tileset.rootMeta.taskParameters)===null||r===void 0?void 0:r.point_homogenization)==="1"&&(!((i=this.tileset.rootMeta.taskParameters)===null||i===void 0)&&i.homo_point_density)){var A=Number((a=this.tileset.rootMeta.taskParameters)===null||a===void 0?void 0:a.homo_point_density);isFinite(A)&&!isNaN(A)&&(p=A)}p<=0&&(p=.02),s=p*1.4}else u=5,e.powerPreference==="high"&&(u=4),o=1,s=.03}else u=6,o=1,s=.03,this.name==="aerophoto"?(u=12,e.powerPreference==="high"&&(u=10)):this.tileset.asset.extras&&typeof this.tileset.asset.extras.name=="string"&&/^matterport\b/i.test(this.tileset.asset.extras.name)&&(u=5,e.powerPreference==="high"&&(u=4));return{pointScale:s,pointMinPixel:o,maxScreenSpaceError:u,maxMemoryUsage:l}},t.prototype.getRenderHash=function(){return ca([this.tileset.id,this.tileset.skipLevelOfDetail,this.tileset.selectedTiles.map(function(e){return e.id}),this.tileset.selectedTrajectories.map(function(e){return e.index}),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,"requestOrder",{get:function(){return this.tileset.tileRequestOrder},set:function(e){this.tileset.tileRequestOrder=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,"mostDetail",{get:function(){return this.tileset.mostDetail},set:function(e){this.tileset.mostDetail=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,"loadAll",{get:function(){return this.tileset.loadAll},set:function(e){this.tileset.loadAll=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}),Object.defineProperty(t.prototype,"trajectories",{get:function(){return this.tileset.trajectories},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 Cl(this.localToEcef(e))},t.prototype.llaToLocal=function(e){return this.ecefToLocal(yv(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 dv(e,{fetcher:this.fetcher,search:this.search,renderer:this.renderer}).then(function(i){e.type==="SCENEGRAPH"&&(r.disposed||!e.content?Mo(e):e.content.data&&r.boundingBox.expandByObject(e.content.data.object))})},t.prototype.unloadContent=function(e){return Mo(e),Promise.resolve()},t.prototype.loadAllTilesets=function(){var e=this,r=function(i){var a=[];return e.tileset.root.traverse(function(o){var s;o.type==="TILESET"&&((s=o.content)===null||s===void 0?void 0:s.loadState)!=="READY"&&a.push(o)}),Promise.all(a.map(function(o){return e.loadContent(o).then(function(){return r()})})).then(function(){})};return r(this.tileset.root)},t.prototype.loadTrajectory=function(e){var r=this;return mv(e,{fetcher:this.fetcher,search:this.search,renderer:this.renderer}).then(function(i){r.disposed&&u0(i)})},t.prototype.unloadTrajectory=function(e){return u0(e),Promise.resolve()},t.prototype.intersectRaycaster=function(e,r,i){var a=this;r===void 0&&(r=!0),i===void 0&&(i=[]);for(var o=[this.tileset.root],s=this.tileset.transform,u=this.tileset.transformIsIdentity,l,c=[];l=o.pop();){var d=void 0;if(l.boundingVolume){var p=u?l.boundingVolume:l.boundingVolume.clone().applyMatrix4(s);d=p.intersectRay(e.ray,e.far)}else d=!0;if(d){for(var A=0,h=l.children.length;A<h;A++)o.push(l.children[A]);l.selected&&l.content&&l.content.data&&l.content.data.object.visible&&l.content.data.object.intersectRaycaster(e,!1,c)}}return this.model.shownFloorIndex>=0&&(c=c.filter(function(v){return v.floor===a.model.shownFloorIndex})),r&&c.sort(function(v,g){return v.distance-g.distance}),c.map(function(v){v.model=a.model,v.viewLayer=a.viewLayer}),i.push.apply(i,c),i},t.prototype.cloneSkipBackfaceObject=function(e){var r;e instanceof f.Mesh?r=new f.Mesh(e.geometry,Array.isArray(e.material)?e.material.map(function(s){return s.transparent?f0:c0}):e.material&&e.material.transparent?f0:c0):e instanceof f.Group?r=new f.Group:r=new f.Object3D,r.copy(e,!1);for(var i=0,a=e.children;i<a.length;i++){var o=a[i];r.add(this.cloneSkipBackfaceObject(o))}return r},t.prototype.update=function(e,r,i){var a,o,s,u=this,l,c,d;this.renderObjects.length=0,this.backfaceObjects.length=0,this.debugObjects.length=0,this.tileObjects.length=0,this.renderer=e,this.updateMatrixWorld(!0),this.tileset.transform.equals(this.matrixWorld)||this.tileset.transform.copy(this.matrixWorld),this.tileset.cache.reset();var p=this.tileset.frameNumber+1,A=this.maxLevelOfDetail;if(i==="Panorama"||i==="VRPanorama"||i==="XRPanorama"){var h=this.model.getMaterial().modelAlpha;h<.1&&(A=this.panoramaMaxLevelOfDetail)}A=Math.max(A,0);var v=Math.min(this.minLevelOfDetail,A);(!this.visible||!this.loaded||!this.modelsLoaded)&&(A=Math.max(v,0));var g={time:ve(),camera:{type:r.type,position:new f.Vector3().copy(r.position),direction:r.getDirection(new f.Vector3),near:r.near,far:r.far,up:new f.Vector3().copy(r.up).applyQuaternion(r.quaternion),visible:r.visible,refine:r.refineModel},minLevelOfDetail:v,maxLevelOfDetail:A,height:r.resolution.height,pixelRatio:r.pixelRatio,frameNumber:p,sseDenominator:2*Math.tan(.5*r.fov/180*Math.PI),cullingVolume:new ai().setFromCamera(r)},m=this.cacheCameras.map(function(Y){return O(O({},g),{camera:{type:r.type,position:new f.Vector3().copy(Y.position),direction:Y.getWorldDirection(new f.Vector3),near:r.near,far:r.far,up:new f.Vector3().copy(Y.up),visible:Y.visible,refine:!0},cullingVolume:new ai().setFromCamera(Y)})});this.needsRefined&&this.tileset.update(g,m),this.refined=!0,this.refineProgress[0]=0,this.refineProgress[1]=0,this.tileset.needsRefinedTiles.forEach(function(Y){if(u.refineProgress[1]++,Y.content){var Z=Y.content.loadState;if(Z==="UNLOADED"||Z==="LOADING"){u.refined=!1;return}}u.refineProgress[0]++}),this.loaded===!1&&this.needsRefined&&(this.loaded=!0,this.tileset.needsRefinedTiles.forEach(function(Y){if(u.loaded!==!1){if(u.tileset.skipLevelOfDetail){if(Y.state.finalResolution&&Y.content){var Z=Y.state.ancestorWithContentAvailable,oe=Z&&Z.content?Z.content:Y.content,ne=oe.loadState;(ne==="UNLOADED"||ne==="LOADING")&&(u.loaded=!1)}}else if(Y.state.visible&&Y.content&&Y.levelOfContent<=0){var ne=Y.content.loadState;(ne==="UNLOADED"||ne==="LOADING")&&(u.loaded=!1)}}}),this.loaded===!0&&(this.refined=!1,this.refineProgress[1]++)),this.remove.apply(this,this.children),this.tileset.skipLevelOfDetail||this.tileset.selectedTiles.sort(function(Y,Z){return Y.floor!==Z.floor?Y.floor-Z.floor:Y.levelOfContent!==Z.levelOfContent?Z.levelOfContent-Y.levelOfContent:Y.state.distanceToCamera!==Z.state.distanceToCamera?Y.state.distanceToCamera-Z.state.distanceToCamera:Y.state.centerZDepth-Z.state.centerZDepth}),this.debug==="root-bounding-volume"&&this.tileset.root.boundingVolumeDebugObject&&this.debugObjects.push(this.tileset.root.boundingVolumeDebugObject);for(var y=0,b=this.tileset.selectedTiles;y<b.length;y++){var x=b[y];this.debug==="selected-bounding-volume"&&x.boundingVolumeDebugObject&&this.debugObjects.push(x.boundingVolumeDebugObject);var w=(c=(l=x.content)===null||l===void 0?void 0:l.data)===null||c===void 0?void 0:c.object;if(w){if(w.update(e,r,this.model,x),this.tileset.hasMixedContent&&this.tileset.skipLevelOfDetail){if(!x.state.finalResolution){var E=this.cloneSkipBackfaceObject(w);this.backfaceObjects.push(E)}for(var S=x.state.selectionDepth,C=fr.TILE_MASK|S<<fr.SKIP_LOD_BIT_SHIFT,R=f.GreaterEqualStencilFunc,B=fr.SKIP_LOD_MASK,M=f.ReplaceStencilOp,I=fr.TILE_MASK|fr.SKIP_LOD_MASK,L=0,T=w.materials;L<T.length;L++){var F=T[L];F.stencilWrite=!0,F.stencilRef=C,F.stencilFunc=R,F.stencilFuncMask=B,F.stencilZPass=M,F.stencilWriteMask=I}}else for(var D=0,V=w.materials;D<V.length;D++){var F=V[D];F.stencilWrite=!1,F.stencilRef=fr.TILE_MASK,F.stencilFunc=f.AlwaysStencilFunc,F.stencilFuncMask=fr.TILE_MASK,F.stencilZPass=f.ReplaceStencilOp,F.stencilWriteMask=fr.TILE_MASK}this.tileObjects.push(w)}}this.tileset.skipLevelOfDetail&&this.backfaceObjects.length&&(a=this.renderObjects).push.apply(a,this.backfaceObjects),this.tileObjects.length&&(o=this.renderObjects).push.apply(o,this.tileObjects),this.tileset.skipLevelOfDetail&&this.renderObjects.push(this.clearStencilObject);for(var z=0,Q=this.tileset.selectedTrajectories;z<Q.length;z++){var q=Q[z],G=(d=q.content.data)===null||d===void 0?void 0:d.object;G&&(G.update(e,r,this.model),this.renderObjects.push(G))}this.debug&&(s=this.renderObjects).push.apply(s,this.debugObjects);for(var K=this.modelIndex*1e4,j=function(Y){var Z=J.renderObjects[Y],oe=Y+K;Z.traverse(function(ne){(ne instanceof f.Mesh||ne instanceof f.Line||ne instanceof f.Points)&&(ne.renderOrder=oe)}),J.add(Z)},J=this,W=0;W<this.renderObjects.length;W++)j(W);var $=this.getRenderHash();this.lastRenderHash!==$&&(this.needsRender=!0,this.lastRenderHash=$)},t.prototype.dispose=function(){this.disposed=!0,this.viewLayer=void 0,this.tileset.reset(),this.remove.apply(this,this.children),this.refineProgress[0]=0,this.refineProgress[1]=0,this.refined=!1,this.loaded=!1},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=Or.DEFAULT_MAX_SCREEN_SPACE_ERROR,t.DEFAULT_SKIP_LEVEL_OF_DETAIL=Or.DEFAULT_SKIP_LEVEL_OF_DETAIL,t.DEFAULT_MOST_DETAIL=Or.DEFAULT_MOST_DETAIL,t.DEFAULT_LOAD_SIBLINGS=Or.DEFAULT_LOAD_SIBLINGS,t.DEFAULT_LOAD_ALL=Or.DEFAULT_LOAD_ALL,t.DEFAULT_MAX_REQUESTS=Or.DEFAULT_MAX_REQUESTS,t.DEFAULT_REQUEST_ORDER=Or.DEFAULT_REQUEST_ORDER,t}(f.Object3D);function Ev(n){return-((n-.25)*360+90)/180*Math.PI}function Co(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(!Co(n[r],t[r]))return!1;return!0}if(n.constructor===RegExp)return n.source===t.source&&n.flags===t.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===t.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===t.toString();if(i=Object.keys(n),e=i.length,e!==Object.keys(t).length)return!1;for(r=e;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=e;r--!==0;){var a=i[r];if(!Co(n[a],t[a]))return!1}return!0}return n!==n&&t!==t}function lr(n){return typeof n=="number"}var d0=function(){return new Error("Invalid input.")},h0=function(){return new Error("Invalid certificate.")},p0=function(){return new Error("Invalid signature.")},Sv=function(n){return new Error("date(".concat(n.toString(),") expired."))},Mv=function(n){return new Error("host(".concat(JSON.stringify(n),") is not allowed."))};function Cv(n,t){for(var e={},r=0,i=Object.keys(n);r<i.length;r++){var a=i[r];t.indexOf(a)===-1&&(e[a]=n[a])}return e}function $n(n,t){t===void 0&&(t=!1);var e=typeof n;if(e==="string")return JSON.stringify(n);if(n===!0)return"true";if(n===!1)return"false";if(n===null)return"null";if(n instanceof Array){for(var r="[",i=n.length-1,a=0;a<i;a++)r+=$n(n[a],!1)+",";return i>-1&&(r+=$n(n[a],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return $n(n.toJSON(),t);for(var o=Object.keys(n).sort(),s=o.length,r="",a=0;a<s;){var u=o[a],l=$n(n[u],!0);l!==void 0&&(a&&r!==""&&(r+=","),r+=JSON.stringify(u)+":"+l),a++}return"{"+r+"}"}switch(e){case"function":case"undefined":return t?void 0:null;case"number":return 0;default:return isFinite(n)?n:null}}function Iv(n){return String($n(n,!1))}function Il(n){var t,e,r;if(Array.isArray(n)){var i=void 0,a,o;if(n.length<=0)return d0();for(var s=function(w){var E=Il(n[w]);if(E instanceof Error)return{value:E};if(!i)i=E.issuer;else if(i!==E.issuer)return{value:h0()};a?E.expire.getTime()<a.getTime()&&(a=E.expire):a=E.expire,o?o=o.filter(function(S){return E.allowHosts.indexOf(S)!==-1}):o=E.allowHosts},u=0;u<n.length;u++){var l=s(u);if(typeof l=="object")return l.value}return gn({issuer:i,expire:a,allowHosts:o})}var c=JSON.parse(n),d=typeof location!="undefined"?location.hostname:"",p=Date.now();if(typeof c!="object")return d0();var A=new Date(typeof c.expire_at=="string"&&/^\d+$/.test(c.expire_at)?Number(c.expire_at):c.expire_at),h=Array.isArray(c.allow_hosts)?c.allow_hosts:[];if(d.length===0||Sn(d)||Cr.filter(function(w){return un(w,d)}).length>0){var v=String((t=c.certificate)!==null&&t!==void 0?t:"");if(v){var g=new $e;return g.readCertPEM(v),gn({issuer:g.getSubjectString(),expire:A,allowHosts:h})}return gn({issuer:"none",expire:A,allowHosts:h})}var m=String((e=c.certificate)!==null&&e!==void 0?e:"");if(!m)return h0();var y=new $e;y.readCertPEM(m);var b=String((r=c._signature)!==null&&r!==void 0?r:"");if(!b)return p0();var x=Iv(Cv(c,["_signature"]));return gf(x,b,y)===!1?p0():p<A.getTime()?h.filter(function(w){return un(w,d)}).length===0?Mv(d):gn({issuer:y.getSubjectString(),expire:A,allowHosts:h}):Sv(A)}var v0=new f.Matrix4,da=new WeakMap,Xn=new Set,$o=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 f.Matrix4;{var r=this;this.options={get transform(){return r.transform},set transform(a){r.transform.copy(a)}}}if(t!==null){var i=Pv(t,e,this);if(i instanceof Error)throw new Error("[PARSE FAILED]: "+i.message+`
|
|
1037
1037
|
Error work input:
|
|
1038
|
-
`+JSON.stringify(t))}else Rv(t,this)}return n.prototype.toJSON=function(){return this.raw},n.parse=li,n}();function m0(n){return n==null?"null":Array.isArray(n)?"array":typeof n=="object"?"dict":"value"}function Io(n,t){var e=m0(n),r=m0(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]=Io(n[i],t[i]);else if(r==="dict")for(var a in t)n[a]=Io(n[a],t[a]);return n}function es(n,t){return n.indexOf(t)===0}function ts(n,t,e,r){var i,a=t;if(r.jsonp===!0){a=t.replace(/([\?\#].*)?$/i,"");var o=Ss("".concat(a)).slice(0,7);a="".concat(a,".").concat(o,".jsonp")}if(r.shortPath===!0){var s=a.replace(n,"").split("."),u=(i=s.shift())!==null&&i!==void 0?i:"",l=s.join(".");a=st(n,Ss(u))+(l?"."+l:"")}var c=a.replace(n,"");return r.baseURL&&(a=st(r.baseURL,c)),r.traverseResource&&r.traverseResource({origin:t,absolute:a,relative:c,type:e}),a}function ct(n,t,e,r,i){var a=e;return Ur(e)||(t&&(t=st(t,String(r))),a=st(t,a)),Ur(a)||(a=st(n,a)),es(a,n)||console.warn("".concat(a," is not start with base_url(").concat(n,").")),ts(n,a,"panorama",i)}function Wn(n,t,e){var r=t;return Ur(r)||(r=st(n,t)),es(r,n)||console.warn("".concat(r," is not start with base_url(").concat(n,").")),ts(n,r,"model",e)}function Vi(n,t,e,r){var i=t;return Ur(i)||(i=st(e,i)),Ur(i)||(i=st(n,i)),es(i,n)||console.warn("".concat(i," is not start with base_url(").concat(n,").")),ts(n,i,"texture",r)}var A0=function(n){for(var t=10;t>=0;t--){var e=512*Math.pow(2,t);if(e<=n)return t}return null},Tv=function(n){n=n.slice().sort(function(o,s){return o.level-s.level});for(var t=[],e=0,r=n;e<r.length;e++){var i=r[e];if(t.length===0){t.push(i);continue}var a=t[t.length-1];if(i.level>a.level){t.push(i);continue}if(i.size>a.size){t[t.length-1]=i;continue}}return t};function Pv(n,t,e){for(var r,i,a,o,s,u,l,c,d,p,A,h,v,g,m,y,b,x,w,E=JSON.stringify(t),S=[],C=0,R=[].concat(n);C<R.length;C++){var B=R[C];B instanceof $o?S.push.apply(S,B.raw.works):typeof B=="string"?S.push(B):S.push(JSON.stringify(B))}var M=Il(S);if(M instanceof Error)return M;Array.isArray(t.transform)?e.transform.fromArray(t.transform):t.transform&&e.transform.copy(t.transform),n=S.map(function(ee){return JSON.parse(ee)}).reduce(function(ee,re){return Io(ee,re)}),Object.defineProperty(e,"raw",{configurable:!1,get:function(){return{works:S,options:E}}});{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 L=String(n.name);Object.defineProperty(e,"name",{configurable:!1,get:function(){return L}})}if(M instanceof Error)return M;Object.defineProperty(e,"issuer",{configurable:!1,get:function(){return M.issuer}}),Object.defineProperty(e,"expire",{configurable:!1,get:function(){return M.expire}}),Object.defineProperty(e,"allowHosts",{configurable:!1,get:function(){return M.allowHosts}});var T=(r=n.base_url)!==null&&r!==void 0?r:"";if(T&&T[T.length-1]!=="/"&&(T+="/"),M instanceof Error)return M;if(n.model){var F={work:e,layers:[]},D;n.model.file?D=Wn(T,n.model.file,t):n.model.file_url&&(D=Wn(T,n.model.file_url,t)),Object.defineProperty(F,"file",{configurable:!1,get:function(){return D}});var V;n.model.textureBase?V=Vi(T,"",n.model.textureBase,t):n.model.material_base_url?V=Vi(T,"",n.model.material_base_url,t):F.file&&(V=F.file.split("/").slice(0,-1).join("/").replace("/model/","/materials/")),Object.defineProperty(F,"textureBase",{configurable:!1,get:function(){return V}});var z;Array.isArray(n.model.textures)?(z=n.model.textures.map(function(ee){var re,H;return Vi(T,ee,(H=(re=n.model.textureBase)!==null&&re!==void 0?re:n.model.material_base_url)!==null&&H!==void 0?H:"",t)}),Object.freeze(z)):Array.isArray(n.model.material_textures)&&(z=n.model.material_textures.map(function(ee){var re,H;return Vi(T,ee,(H=(re=n.model.textureBase)!==null&&re!==void 0?re:n.model.material_base_url)!==null&&H!==void 0?H:"",t)}),Object.freeze(z)),Object.defineProperty(F,"textures",{configurable:!1,get:function(){return z}});var Q=[];if(Array.isArray(n.model.tiles))for(var q=0,G=n.model.tiles;q<G.length;q++){var K=G[q];K&&(K.tileset||K.tileset_url)&&Q.push(Object.freeze({type:(i=K.type)!==null&&i!==void 0?i:"mesh",name:(a=K.name)!==null&&a!==void 0?a:"",upAxis:(s=(o=K.upAxis)!==null&&o!==void 0?o:K.up_axis)!==null&&s!==void 0?s:"-Y",tileset:Wn(T,K.tileset||K.tileset_url,t)}))}else n.model.tiles&&(n.model.tiles.tileset||n.model.tiles.tileset_url)&&Q.push(Object.freeze({type:(u=n.model.tiles.type)!==null&&u!==void 0?u:"mesh",name:(l=n.model.tiles.name)!==null&&l!==void 0?l:"lod",upAxis:(d=(c=n.model.tiles.upAxis)!==null&&c!==void 0?c:n.model.tiles.up_axis)!==null&&d!==void 0?d:"-Y",tileset:Wn(T,n.model.tiles.tileset||n.model.tiles.tileset_url,t)}));if(Array.isArray(n.model.layers))for(var j=0,J=n.model.layers;j<J.length;j++){var W=J[j];W&&(W.tileset||W.tileset_url)&&Q.push(Object.freeze({type:(p=W.type)!==null&&p!==void 0?p:"mesh",name:(A=W.name)!==null&&A!==void 0?A:"",upAxis:(h=W.upAxis)!==null&&h!==void 0?h:W.up_axis,tileset:Wn(T,W.tileset||W.tileset_url,t)}))}Object.freeze(Q),Object.defineProperty(F,"layers",{configurable:!1,get:function(){return Q}}),Object.defineProperty(e,"model",{configurable:!1,get:function(){if(F.file||F.layers.length)return F}})}if(M instanceof Error)return M;var $=new Set,Y=new Set;{var Z=[];if(n.observers&&Array.isArray(n.observers)){var oe=[];n.panorama&&(Array.isArray(n.panorama)?oe=n.panorama:Array.isArray(n.panorama.list)?oe=n.panorama.list:Array.isArray(n.panorama.info)&&(oe=n.panorama.info));for(var ne=function(ee){var re={},H=n.observers[ee];if(!H)return"break";var Be=oe[ee];if(!Be)return"break";H=Object.assign({},H,Be,{active:H.active!==!1&&Be.active!==!1}),Object.defineProperty(re,"work",{configurable:!1,get:function(){return e}}),Object.defineProperty(re,"index",{configurable:!1,get:function(){return ee}}),Y.add(ee),Object.defineProperty(re,"panoIndex",{configurable:!1,get:function(){return ee}});var Te=He({workCode:e.workCode,panoIndex:ee});$.add(Te),Object.defineProperty(re,"panoId",{configurable:!1,get:function(){return Te}});var Ce=Object.freeze({workCode:e.workCode,panoIndex:ee});Object.defineProperty(re,"pano",{configurable:!1,get:function(){return Ce}});var Ue=H.active!==!1;Object.defineProperty(re,"active",{configurable:!1,get:function(){return Ue}});var Ie=H.loadable===!0;Object.defineProperty(re,"loadable",{configurable:!1,get:function(){return Ie}});var we=H.derived_id;Object.defineProperty(re,"derivedId",{configurable:!1,get:function(){return we}});var be=H.derived_id_str;Object.defineProperty(re,"derivedIdStr",{configurable:!1,get:function(){return be}});var Ae=(x=(y=(g=(v=n.panorama)===null||v===void 0?void 0:v.pano_high_cube_base_url)!==null&&g!==void 0?g:(m=n.panorama)===null||m===void 0?void 0:m.pano_cube_base_url)!==null&&y!==void 0?y:(b=n.panorama)===null||b===void 0?void 0:b.base_url)!==null&&x!==void 0?x:"",me={up:ct(T,Ae,H.images?H.images.up:H.up,ee,t),down:ct(T,Ae,H.images?H.images.down:H.down,ee,t),right:ct(T,Ae,H.images?H.images.right:H.right,ee,t),left:ct(T,Ae,H.images?H.images.left:H.left,ee,t),front:ct(T,Ae,H.images?H.images.front:H.front,ee,t),back:ct(T,Ae,H.images?H.images.back:H.back,ee,t)};if(H.size_list)me.sizeList=H.size_list.slice();else{var ze=di(me.up);if(ze&&(me.sizeList=[ze],H.tiles))for(var pe=H.tiles.slice().sort(function(ke,Ye){return ke-Ye}).map(function(ke){return 512*Math.pow(2,ke)}),Se=0,St=pe;Se<St.length;Se++){var Pe=St[Se];Pe>ze&&me.sizeList.push(Pe)}}var je=H.images?H.images.luminance:H.luminance;je&&(me.luminance=Object.freeze({up:ct(T,Ae,je.up,ee,t),down:ct(T,Ae,je.down,ee,t),right:ct(T,Ae,je.right,ee,t),left:ct(T,Ae,je.left,ee,t),front:ct(T,Ae,je.front,ee,t),back:ct(T,Ae,je.back,ee,t)}));var it=void 0;if(H.images)it=H.images.tiles;else if(Array.isArray(H.size_list)){var _t=H.size_list.slice().sort(function(ke,Ye){return ke-Ye});if(_t[0]){var Qr=A0(_t[0]);if(Qr)for(var jt=Qr-1;jt>=0;jt--)_t.unshift(512*Math.pow(2,jt));it=_t}}else Array.isArray(H.tiles)&&(it=H.tiles.slice(),typeof it[0]=="number"&&(it=it.sort(function(ke,Ye){return ke-Ye}).map(function(ke){return 512*Math.pow(2,ke)})));if(it){for(var ut=[],Mt=0,dt=it;Mt<dt.length;Mt++){var Pe=dt[Mt];if(typeof Pe=="number"){var Ct=A0(Pe);if(typeof Ct!="number")continue;var It=di(me.front);if(!It)continue;if(Pe>It){var Tt=$t(me.up,Pe),Xe=$t(me.down,Pe),Ne=$t(me.right,Pe),We=$t(me.left,Pe),At=$t(me.front,Pe),Ze=$t(me.back,Pe);ut.push(Object.freeze({level:Ct,size:Pe,scale:1,up:Tt,down:Xe,right:Ne,left:We,front:At,back:Ze}))}else{var Tt=me.up,Xe=me.down,Ne=me.right,We=me.left,At=me.front,Ze=me.back;ut.push(Object.freeze({level:Ct,size:It,scale:Pe/It,up:Tt,down:Xe,right:Ne,left:We,front:At,back:Ze}))}}else{var Ct=Pe.level;if(typeof Ct!="number")continue;var ze=Pe.size;if(typeof ze!="number")continue;var Tt=ct(T,Ae,Pe.up,ee,t),Xe=ct(T,Ae,Pe.down,ee,t),Ne=ct(T,Ae,Pe.right,ee,t),We=ct(T,Ae,Pe.left,ee,t),At=ct(T,Ae,Pe.front,ee,t),Ze=ct(T,Ae,Pe.back,ee,t);ut.push(Object.freeze({level:Ct,size:ze,scale:(w=Pe.scale)!==null&&w!==void 0?w:1,up:Tt,down:Xe,right:Ne,left:We,front:At,back:Ze}))}}ut=Tv(ut),Object.freeze(ut),Object.defineProperty(me,"tiles",{configurable:!1,get:function(){return ut}})}Object.freeze(me),Object.defineProperty(re,"images",{configurable:!1,get:function(){return me}});var gt=new f.Vector3;if(H.position instanceof f.Vector3)gt.copy(H.position);else if(Array.isArray(H.position))gt.fromArray(H.position);else return"break";Object.freeze(gt),Object.defineProperty(re,"position",{configurable:!1,get:function(){return gt}});var qt=new f.Vector3;if(H.standingPosition instanceof f.Vector3)qt.copy(H.standingPosition);else if(Array.isArray(H.standingPosition))qt.fromArray(H.standingPosition);else if(H.standing_position instanceof f.Vector3)qt.copy(H.standing_position);else if(Array.isArray(H.standing_position))qt.fromArray(H.standing_position);else return"break";Object.freeze(qt),Object.defineProperty(re,"standingPosition",{configurable:!1,get:function(){return qt}});var yt=new f.Quaternion;if(H.quaternion instanceof f.Quaternion)yt.copy(H.quaternion);else if(Array.isArray(H.quaternion))yt.fromArray(H.quaternion);else if(H.quaternion){var Jt=H.quaternion,gr=Jt.x,qr=Jt.y,yr=Jt.z,Pr=Jt.w;yt.set(gr,qr,yr,Pr)}else return"break";Object.freeze(yt),Object.defineProperty(re,"quaternion",{configurable:!1,get:function(){return yt}});var Ot=0;lr(H.floorIndex)?Ot=H.floorIndex:lr(H.floor_index)?Ot=H.floor_index:lr(H.floor)&&(Ot=H.floor),Object.defineProperty(re,"floorIndex",{configurable:!1,get:function(){return Ot}});var Ge;H.video&&(Ge={},typeof H.video.source=="string"&&(Ge.source=H.video.source),H.video.matrix instanceof f.Matrix4?Ge.matrix=H.video.matrix.clone():Array.isArray(H.video.matrix)&&(Ge.matrix=new f.Matrix4().fromArray(H.video.matrix)),H.video.size instanceof f.Vector2?Ge.size=H.video.size.clone():Array.isArray(H.video.size)&&(Ge.size=new f.Vector2().fromArray(H.video.size)),Ge.source&&Ge.matrix&&Ge.size&&(re.video=Ge)),Object.freeze(Ge),Object.defineProperty(re,"video",{configurable:!1,get:function(){return Ge}}),Array.isArray(H.accessibleNodes)?(re.accessibleNodes=H.accessibleNodes.slice(),re.accessibleIds=H.accessibleNodes.map(function(ke){return He({workCode:e.workCode,panoIndex:ke})})):Array.isArray(H.accessible_nodes)&&(re.accessibleNodes=H.accessible_nodes.slice(),re.accessibleIds=H.accessible_nodes.map(function(ke){return He({workCode:e.workCode,panoIndex:ke})})),Array.isArray(H.visibleNodes)?(re.visibleNodes=H.visibleNodes.slice(),re.visibleIds=H.visibleNodes.map(function(ke){return He({workCode:e.workCode,panoIndex:ke})})):Array.isArray(H.visible_nodes)&&(re.visibleNodes=H.visible_nodes.slice(),re.visibleIds=H.visible_nodes.map(function(ke){return He({workCode:e.workCode,panoIndex:ke})})),Z[ee]=re},de=0;de<n.observers.length;de++){var se=ne(de);if(se==="break")break}}for(var ye=function(ee){if(ee.accessibleIds){var Be=ee.accessibleIds.filter(function(Ae){return $.has(Ae)});Object.freeze(Be),Object.defineProperty(ee,"accessibleIds",{configurable:!1,get:function(){return Be}})}else{for(var re=[],H=0;H<Z.length;H++)Z[H]!==ee&&(Math.abs(Z[H].position.y-ee.position.y)>3||Z[H].position.distanceTo(ee.position)>10||re.push(Z[H].panoId));Object.freeze(re),Object.defineProperty(ee,"accessibleIds",{configurable:!1,get:function(){return re}})}if(ee.accessibleNodes){var Ce=ee.accessibleNodes.filter(function(Ae){return Y.has(Ae)});Object.freeze(Ce),Object.defineProperty(ee,"accessibleNodes",{configurable:!1,get:function(){return Ce}})}else{for(var Te=[],H=0;H<Z.length;H++)Z[H]!==ee&&(Math.abs(Z[H].position.y-ee.position.y)>3||Z[H].position.distanceTo(ee.position)>10||Te.push(Z[H].panoIndex));Object.freeze(Te),Object.defineProperty(ee,"accessibleNodes",{configurable:!1,get:function(){return Te}})}if(ee.visibleIds){var Ie=ee.visibleIds.filter(function(Ae){return $.has(Ae)});Object.freeze(Ie),Object.defineProperty(ee,"visibleIds",{configurable:!1,get:function(){return Ie}})}else{var Ue=ee.accessibleIds.slice();Object.freeze(Ue),Object.defineProperty(ee,"visibleIds",{configurable:!1,get:function(){return Ue}})}if(ee.visibleNodes){var be=ee.visibleNodes.filter(function(Ae){return Y.has(Ae)});Object.freeze(be),Object.defineProperty(ee,"visibleNodes",{configurable:!1,get:function(){return be}})}else{var we=ee.accessibleNodes.slice();Object.freeze(we),Object.defineProperty(ee,"visibleNodes",{configurable:!1,get:function(){return we}})}},ie=0,xe=Z;ie<xe.length;ie++){var Le=xe[ie];ye(Le)}Object.freeze(Z),Object.defineProperty(e,"observers",{configurable:!1,get:function(){return Z}})}if(M instanceof Error)return M;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),lr(n.initial.latitude)&&(e.initial.latitude=n.initial.latitude),lr(n.initial.longitude)?e.initial.longitude=n.initial.longitude:lr(n.initial.heading)&&(e.initial.longitude=Ev(n.initial.heading)),lr(n.initial.fov)&&(e.initial.fov=n.initial.fov),e.observers.length>0){var Me=void 0;lr(n.initial.panoIndex)?Me=n.initial.panoIndex:lr(n.initial.pano_index)?Me=n.initial.pano_index:lr(n.initial.pano)&&(Me=n.initial.pano),typeof Me=="number"&&(Me=ce(Me,0,e.observers.length-1),e.initial.panoIndex=Me)}if(lr(n.initial.distance)&&(e.initial.distance=n.initial.distance),Array.isArray(n.initial.offset)){var Oe=[0,0,0].map(function(ee,re){var H=Number(n.initial.offset[re]);return isNaN(H)||!isFinite(H)?0:H});e.initial.offset=new f.Vector3().fromArray(Oe)}!e.initial.mode&&typeof e.initial.panoIndex=="number"&&(e.initial.mode="Panorama")}return M instanceof Error?M:(da.set(e,{works:S,options:E}),e)}function Rv(n,t){return t.issuer="null",gn(t),da.set(t,{works:["null"],options:"{}"}),t}function li(n,t){typeof n=="string"&&n.trim()[0]==="{"&&(n=JSON.parse(n));var e=da.get(n);if(e){if(t&&!Co(JSON.parse(e.options),t))throw new Error("[PARSE FAILED]: work is parsed with different options.");return n}else try{return new $o(n,t!=null?t:{})}catch(r){throw new Error("[PARSE FAILED]: "+r.message+`
|
|
1038
|
+
`+JSON.stringify(t))}else Rv(t,this)}return n.prototype.toJSON=function(){return this.raw},n.parse=li,n}();function m0(n){return n==null?"null":Array.isArray(n)?"array":typeof n=="object"?"dict":"value"}function Io(n,t){var e=m0(n),r=m0(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]=Io(n[i],t[i]);else if(r==="dict")for(var a in t)n[a]=Io(n[a],t[a]);return n}function es(n,t){return n.indexOf(t)===0}function ts(n,t,e,r){var i,a=t;if(r.jsonp===!0){a=t.replace(/([\?\#].*)?$/i,"");var o=Ss("".concat(a)).slice(0,7);a="".concat(a,".").concat(o,".jsonp")}if(r.shortPath===!0){var s=a.replace(n,"").split("."),u=(i=s.shift())!==null&&i!==void 0?i:"",l=s.join(".");a=st(n,Ss(u))+(l?"."+l:"")}var c=a.replace(n,"");return r.baseURL&&(a=st(r.baseURL,c)),r.traverseResource&&r.traverseResource({origin:t,absolute:a,relative:c,type:e}),a}function ct(n,t,e,r,i){var a=e;return Ur(e)||(t&&(t=st(t,String(r))),a=st(t,a)),Ur(a)||(a=st(n,a)),es(a,n)||console.warn("".concat(a," is not start with base_url(").concat(n,").")),ts(n,a,"panorama",i)}function Wn(n,t,e){var r=t;return Ur(r)||(r=st(n,t)),es(r,n)||console.warn("".concat(r," is not start with base_url(").concat(n,").")),ts(n,r,"model",e)}function Vi(n,t,e,r){var i=t;return Ur(i)||(i=st(e,i)),Ur(i)||(i=st(n,i)),es(i,n)||console.warn("".concat(i," is not start with base_url(").concat(n,").")),ts(n,i,"texture",r)}var A0=function(n){for(var t=10;t>=0;t--){var e=512*Math.pow(2,t);if(e<=n)return t}return null},Tv=function(n){n=n.slice().sort(function(o,s){return o.level-s.level});for(var t=[],e=0,r=n;e<r.length;e++){var i=r[e];if(t.length===0){t.push(i);continue}var a=t[t.length-1];if(i.level>a.level){t.push(i);continue}if(i.size>a.size){t[t.length-1]=i;continue}}return t};function Pv(n,t,e){for(var r,i,a,o,s,u,l,c,d,p,A,h,v,g,m,y,b,x,w,E=JSON.stringify(t),S=[],C=0,R=[].concat(n);C<R.length;C++){var B=R[C];B instanceof $o?S.push.apply(S,B.raw.works):typeof B=="string"?S.push(B):S.push(JSON.stringify(B))}var M=Il(S);if(M instanceof Error)return M;Array.isArray(t.transform)?e.transform.fromArray(t.transform):t.transform&&e.transform.copy(t.transform),n=S.map(function(ee){return JSON.parse(ee)}).reduce(function(ee,re){return Io(ee,re)}),Object.defineProperty(e,"raw",{configurable:!1,get:function(){return{works:S,options:E}}});{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 L=String(n.name);Object.defineProperty(e,"name",{configurable:!1,get:function(){return L}})}if(M instanceof Error)return M;Object.defineProperty(e,"issuer",{configurable:!1,get:function(){return M.issuer}}),Object.defineProperty(e,"expire",{configurable:!1,get:function(){return M.expire}}),Object.defineProperty(e,"allowHosts",{configurable:!1,get:function(){return M.allowHosts}});var T=(r=n.base_url)!==null&&r!==void 0?r:"";if(T&&T[T.length-1]!=="/"&&(T+="/"),M instanceof Error)return M;if(n.model){var F={work:e,layers:[]},D;n.model.file?D=Wn(T,n.model.file,t):n.model.file_url&&(D=Wn(T,n.model.file_url,t)),Object.defineProperty(F,"file",{configurable:!1,get:function(){return D}});var V;n.model.textureBase?V=Vi(T,"",n.model.textureBase,t):n.model.material_base_url?V=Vi(T,"",n.model.material_base_url,t):F.file&&(V=F.file.split("/").slice(0,-1).join("/").replace("/model/","/materials/")),Object.defineProperty(F,"textureBase",{configurable:!1,get:function(){return V}});var z;Array.isArray(n.model.textures)?(z=n.model.textures.map(function(ee){var re,H;return Vi(T,ee,(H=(re=n.model.textureBase)!==null&&re!==void 0?re:n.model.material_base_url)!==null&&H!==void 0?H:"",t)}),Object.freeze(z)):Array.isArray(n.model.material_textures)&&(z=n.model.material_textures.map(function(ee){var re,H;return Vi(T,ee,(H=(re=n.model.textureBase)!==null&&re!==void 0?re:n.model.material_base_url)!==null&&H!==void 0?H:"",t)}),Object.freeze(z)),Object.defineProperty(F,"textures",{configurable:!1,get:function(){return z}});var Q=[];if(Array.isArray(n.model.tiles))for(var q=0,G=n.model.tiles;q<G.length;q++){var K=G[q];K&&(K.tileset||K.tileset_url)&&Q.push(Object.freeze({type:(i=K.type)!==null&&i!==void 0?i:"mesh",name:(a=K.name)!==null&&a!==void 0?a:"",upAxis:(s=(o=K.upAxis)!==null&&o!==void 0?o:K.up_axis)!==null&&s!==void 0?s:"-Y",tileset:Wn(T,K.tileset||K.tileset_url,t)}))}else n.model.tiles&&(n.model.tiles.tileset||n.model.tiles.tileset_url)&&Q.push(Object.freeze({type:(u=n.model.tiles.type)!==null&&u!==void 0?u:"mesh",name:(l=n.model.tiles.name)!==null&&l!==void 0?l:"lod",upAxis:(d=(c=n.model.tiles.upAxis)!==null&&c!==void 0?c:n.model.tiles.up_axis)!==null&&d!==void 0?d:"-Y",tileset:Wn(T,n.model.tiles.tileset||n.model.tiles.tileset_url,t)}));if(Array.isArray(n.model.layers))for(var j=0,J=n.model.layers;j<J.length;j++){var W=J[j];W&&(W.tileset||W.tileset_url)&&Q.push(Object.freeze({type:(p=W.type)!==null&&p!==void 0?p:"mesh",name:(A=W.name)!==null&&A!==void 0?A:"",upAxis:(h=W.upAxis)!==null&&h!==void 0?h:W.up_axis,tileset:Wn(T,W.tileset||W.tileset_url,t)}))}Object.freeze(Q),Object.defineProperty(F,"layers",{configurable:!1,get:function(){return Q}}),Object.defineProperty(e,"model",{configurable:!1,get:function(){if(F.file||F.layers.length)return F}})}if(M instanceof Error)return M;var $=new Set,Y=new Set;{var Z=[];if(n.observers&&Array.isArray(n.observers)){var oe=[];n.panorama&&(Array.isArray(n.panorama)?oe=n.panorama:Array.isArray(n.panorama.list)?oe=n.panorama.list:Array.isArray(n.panorama.info)&&(oe=n.panorama.info));for(var ne=function(ee){var re={},H=n.observers[ee];if(!H)return"break";var Be=oe[ee];if(!Be)return"break";H=Object.assign({},H,Be,{active:H.active!==!1&&Be.active!==!1}),Object.defineProperty(re,"work",{configurable:!1,get:function(){return e}}),Object.defineProperty(re,"index",{configurable:!1,get:function(){return ee}}),Y.add(ee),Object.defineProperty(re,"panoIndex",{configurable:!1,get:function(){return ee}});var Te=He({workCode:e.workCode,panoIndex:ee});$.add(Te),Object.defineProperty(re,"panoId",{configurable:!1,get:function(){return Te}});var Ce=Object.freeze({workCode:e.workCode,panoIndex:ee});Object.defineProperty(re,"pano",{configurable:!1,get:function(){return Ce}});var Ue=H.active!==!1;Object.defineProperty(re,"active",{configurable:!1,get:function(){return Ue}});var Ie=H.loadable===!0;Object.defineProperty(re,"loadable",{configurable:!1,get:function(){return Ie}});var we=H.derived_id;Object.defineProperty(re,"derivedId",{configurable:!1,get:function(){return we}});var be=H.derived_id_str;Object.defineProperty(re,"derivedIdStr",{configurable:!1,get:function(){return be}});var Ae=(x=(y=(g=(v=n.panorama)===null||v===void 0?void 0:v.pano_high_cube_base_url)!==null&&g!==void 0?g:(m=n.panorama)===null||m===void 0?void 0:m.pano_cube_base_url)!==null&&y!==void 0?y:(b=n.panorama)===null||b===void 0?void 0:b.base_url)!==null&&x!==void 0?x:"",me={up:ct(T,Ae,H.images?H.images.up:H.up,ee,t),down:ct(T,Ae,H.images?H.images.down:H.down,ee,t),right:ct(T,Ae,H.images?H.images.right:H.right,ee,t),left:ct(T,Ae,H.images?H.images.left:H.left,ee,t),front:ct(T,Ae,H.images?H.images.front:H.front,ee,t),back:ct(T,Ae,H.images?H.images.back:H.back,ee,t)};if(H.size_list)me.sizeList=H.size_list.slice();else{var ze=di(me.up);if(ze&&(me.sizeList=[ze],H.tiles))for(var pe=H.tiles.slice().sort(function(ke,Ye){return ke-Ye}).map(function(ke){return 512*Math.pow(2,ke)}),Se=0,St=pe;Se<St.length;Se++){var Pe=St[Se];Pe>ze&&me.sizeList.push(Pe)}}var je=H.images?H.images.luminance:H.luminance;je&&(me.luminance=Object.freeze({up:ct(T,Ae,je.up,ee,t),down:ct(T,Ae,je.down,ee,t),right:ct(T,Ae,je.right,ee,t),left:ct(T,Ae,je.left,ee,t),front:ct(T,Ae,je.front,ee,t),back:ct(T,Ae,je.back,ee,t)}));var it=void 0;if(H.images)it=H.images.tiles;else if(Array.isArray(H.size_list)){var jt=H.size_list.slice().sort(function(ke,Ye){return ke-Ye});if(jt[0]){var Qr=A0(jt[0]);if(Qr)for(var Jt=Qr-1;Jt>=0;Jt--)jt.unshift(512*Math.pow(2,Jt));it=jt}}else Array.isArray(H.tiles)&&(it=H.tiles.slice(),typeof it[0]=="number"&&(it=it.sort(function(ke,Ye){return ke-Ye}).map(function(ke){return 512*Math.pow(2,ke)})));if(it){for(var ut=[],Mt=0,dt=it;Mt<dt.length;Mt++){var Pe=dt[Mt];if(typeof Pe=="number"){var Ct=A0(Pe);if(typeof Ct!="number")continue;var It=di(me.front);if(!It)continue;if(Pe>It){var Tt=$t(me.up,Pe),Xe=$t(me.down,Pe),Ne=$t(me.right,Pe),We=$t(me.left,Pe),At=$t(me.front,Pe),Ze=$t(me.back,Pe);ut.push(Object.freeze({level:Ct,size:Pe,scale:1,up:Tt,down:Xe,right:Ne,left:We,front:At,back:Ze}))}else{var Tt=me.up,Xe=me.down,Ne=me.right,We=me.left,At=me.front,Ze=me.back;ut.push(Object.freeze({level:Ct,size:It,scale:Pe/It,up:Tt,down:Xe,right:Ne,left:We,front:At,back:Ze}))}}else{var Ct=Pe.level;if(typeof Ct!="number")continue;var ze=Pe.size;if(typeof ze!="number")continue;var Tt=ct(T,Ae,Pe.up,ee,t),Xe=ct(T,Ae,Pe.down,ee,t),Ne=ct(T,Ae,Pe.right,ee,t),We=ct(T,Ae,Pe.left,ee,t),At=ct(T,Ae,Pe.front,ee,t),Ze=ct(T,Ae,Pe.back,ee,t);ut.push(Object.freeze({level:Ct,size:ze,scale:(w=Pe.scale)!==null&&w!==void 0?w:1,up:Tt,down:Xe,right:Ne,left:We,front:At,back:Ze}))}}ut=Tv(ut),Object.freeze(ut),Object.defineProperty(me,"tiles",{configurable:!1,get:function(){return ut}})}Object.freeze(me),Object.defineProperty(re,"images",{configurable:!1,get:function(){return me}});var gt=new f.Vector3;if(H.position instanceof f.Vector3)gt.copy(H.position);else if(Array.isArray(H.position))gt.fromArray(H.position);else return"break";Object.freeze(gt),Object.defineProperty(re,"position",{configurable:!1,get:function(){return gt}});var qt=new f.Vector3;if(H.standingPosition instanceof f.Vector3)qt.copy(H.standingPosition);else if(Array.isArray(H.standingPosition))qt.fromArray(H.standingPosition);else if(H.standing_position instanceof f.Vector3)qt.copy(H.standing_position);else if(Array.isArray(H.standing_position))qt.fromArray(H.standing_position);else return"break";Object.freeze(qt),Object.defineProperty(re,"standingPosition",{configurable:!1,get:function(){return qt}});var yt=new f.Quaternion;if(H.quaternion instanceof f.Quaternion)yt.copy(H.quaternion);else if(Array.isArray(H.quaternion))yt.fromArray(H.quaternion);else if(H.quaternion){var Xt=H.quaternion,gr=Xt.x,qr=Xt.y,yr=Xt.z,Pr=Xt.w;yt.set(gr,qr,yr,Pr)}else return"break";Object.freeze(yt),Object.defineProperty(re,"quaternion",{configurable:!1,get:function(){return yt}});var Ot=0;lr(H.floorIndex)?Ot=H.floorIndex:lr(H.floor_index)?Ot=H.floor_index:lr(H.floor)&&(Ot=H.floor),Object.defineProperty(re,"floorIndex",{configurable:!1,get:function(){return Ot}});var Ge;H.video&&(Ge={},typeof H.video.source=="string"&&(Ge.source=H.video.source),H.video.matrix instanceof f.Matrix4?Ge.matrix=H.video.matrix.clone():Array.isArray(H.video.matrix)&&(Ge.matrix=new f.Matrix4().fromArray(H.video.matrix)),H.video.size instanceof f.Vector2?Ge.size=H.video.size.clone():Array.isArray(H.video.size)&&(Ge.size=new f.Vector2().fromArray(H.video.size)),Ge.source&&Ge.matrix&&Ge.size&&(re.video=Ge)),Object.freeze(Ge),Object.defineProperty(re,"video",{configurable:!1,get:function(){return Ge}}),Array.isArray(H.accessibleNodes)?(re.accessibleNodes=H.accessibleNodes.slice(),re.accessibleIds=H.accessibleNodes.map(function(ke){return He({workCode:e.workCode,panoIndex:ke})})):Array.isArray(H.accessible_nodes)&&(re.accessibleNodes=H.accessible_nodes.slice(),re.accessibleIds=H.accessible_nodes.map(function(ke){return He({workCode:e.workCode,panoIndex:ke})})),Array.isArray(H.visibleNodes)?(re.visibleNodes=H.visibleNodes.slice(),re.visibleIds=H.visibleNodes.map(function(ke){return He({workCode:e.workCode,panoIndex:ke})})):Array.isArray(H.visible_nodes)&&(re.visibleNodes=H.visible_nodes.slice(),re.visibleIds=H.visible_nodes.map(function(ke){return He({workCode:e.workCode,panoIndex:ke})})),Z[ee]=re},de=0;de<n.observers.length;de++){var se=ne(de);if(se==="break")break}}for(var ye=function(ee){if(ee.accessibleIds){var Be=ee.accessibleIds.filter(function(Ae){return $.has(Ae)});Object.freeze(Be),Object.defineProperty(ee,"accessibleIds",{configurable:!1,get:function(){return Be}})}else{for(var re=[],H=0;H<Z.length;H++)Z[H]!==ee&&(Math.abs(Z[H].position.y-ee.position.y)>3||Z[H].position.distanceTo(ee.position)>10||re.push(Z[H].panoId));Object.freeze(re),Object.defineProperty(ee,"accessibleIds",{configurable:!1,get:function(){return re}})}if(ee.accessibleNodes){var Ce=ee.accessibleNodes.filter(function(Ae){return Y.has(Ae)});Object.freeze(Ce),Object.defineProperty(ee,"accessibleNodes",{configurable:!1,get:function(){return Ce}})}else{for(var Te=[],H=0;H<Z.length;H++)Z[H]!==ee&&(Math.abs(Z[H].position.y-ee.position.y)>3||Z[H].position.distanceTo(ee.position)>10||Te.push(Z[H].panoIndex));Object.freeze(Te),Object.defineProperty(ee,"accessibleNodes",{configurable:!1,get:function(){return Te}})}if(ee.visibleIds){var Ie=ee.visibleIds.filter(function(Ae){return $.has(Ae)});Object.freeze(Ie),Object.defineProperty(ee,"visibleIds",{configurable:!1,get:function(){return Ie}})}else{var Ue=ee.accessibleIds.slice();Object.freeze(Ue),Object.defineProperty(ee,"visibleIds",{configurable:!1,get:function(){return Ue}})}if(ee.visibleNodes){var be=ee.visibleNodes.filter(function(Ae){return Y.has(Ae)});Object.freeze(be),Object.defineProperty(ee,"visibleNodes",{configurable:!1,get:function(){return be}})}else{var we=ee.accessibleNodes.slice();Object.freeze(we),Object.defineProperty(ee,"visibleNodes",{configurable:!1,get:function(){return we}})}},ie=0,xe=Z;ie<xe.length;ie++){var Le=xe[ie];ye(Le)}Object.freeze(Z),Object.defineProperty(e,"observers",{configurable:!1,get:function(){return Z}})}if(M instanceof Error)return M;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),lr(n.initial.latitude)&&(e.initial.latitude=n.initial.latitude),lr(n.initial.longitude)?e.initial.longitude=n.initial.longitude:lr(n.initial.heading)&&(e.initial.longitude=Ev(n.initial.heading)),lr(n.initial.fov)&&(e.initial.fov=n.initial.fov),e.observers.length>0){var Me=void 0;lr(n.initial.panoIndex)?Me=n.initial.panoIndex:lr(n.initial.pano_index)?Me=n.initial.pano_index:lr(n.initial.pano)&&(Me=n.initial.pano),typeof Me=="number"&&(Me=ce(Me,0,e.observers.length-1),e.initial.panoIndex=Me)}if(lr(n.initial.distance)&&(e.initial.distance=n.initial.distance),Array.isArray(n.initial.offset)){var Oe=[0,0,0].map(function(ee,re){var H=Number(n.initial.offset[re]);return isNaN(H)||!isFinite(H)?0:H});e.initial.offset=new f.Vector3().fromArray(Oe)}!e.initial.mode&&typeof e.initial.panoIndex=="number"&&(e.initial.mode="Panorama")}return M instanceof Error?M:(da.set(e,{works:S,options:E}),e)}function Rv(n,t){return t.issuer="null",gn(t),da.set(t,{works:["null"],options:"{}"}),t}function li(n,t){typeof n=="string"&&n.trim()[0]==="{"&&(n=JSON.parse(n));var e=da.get(n);if(e){if(t&&!Co(JSON.parse(e.options),t))throw new Error("[PARSE FAILED]: work is parsed with different options.");return n}else try{return new $o(n,t!=null?t:{})}catch(r){throw new Error("[PARSE FAILED]: "+r.message+`
|
|
1039
1039
|
Error work input:
|
|
1040
|
-
`+JSON.stringify(n))}}function To(n){for(var t={},e=[],r={},i=0,a=n;i<a.length;i++){var o=a[i],s=t[o.workCode];s||(s=t[o.workCode]=new f.Matrix4().copy(o.transform));for(var u=0,l=o.observers;u<l.length;u++){var c=l[u],d={isResolved:!0,active:c.active,accessibleIds:c.accessibleIds,visibleIds:c.visibleIds,accessibleNodes:c.accessibleNodes,visibleNodes:c.visibleNodes,floorIndex:c.floorIndex,images:c.images,index:c.index,panoIndex:c.panoIndex,loadable:c.loadable,panoId:c.panoId,pano:c.pano,work:c.work,derivedId:c.derivedId,video:c.video,position:new f.Vector3().copy(c.position).applyMatrix4(s),standingPosition:new f.Vector3().copy(c.standingPosition).applyMatrix4(s),quaternion:new f.Quaternion().setFromRotationMatrix(v0.makeRotationFromQuaternion(c.quaternion).premultiply(s))};Object.freeze(d),e.push(d),r[d.panoId]=d}}Object.freeze(e);for(var p=n.slice(),A={},h=0,v=p;h<v.length;h++){var o=v[h];A[o.workCode]=o}return Object.freeze(Object.assign(p,{get initial(){return p.length>0?p[0].initial:{work:{}}},get resolvedObservers(){return e},getWork:function(g){return A[g]},getResolvedObserver:function(g){var m,y;return du(g)?r[g]:typeof g=="number"?r[He({workCode:(y=(m=n[0])===null||m===void 0?void 0:m.workCode)!==null&&y!==void 0?y:"",panoIndex:g})]:r[He(g)]},update:function(){for(var g=0,m=p;g<m.length;g++){var y=m[g],b=y.transform,x=t[y.workCode];x?x.equals(b)||(x.copy(b),Xn.add(y.workCode)):(t[y.workCode]=new f.Matrix4().copy(b),Xn.add(y.workCode))}if(Xn.size>0){for(var w=0,E=e;w<E.length;w++){var S=E[w];if(Xn.has(S.work.workCode)){var C=S.work.observers[S.index],R=S.work.transform;S.position.copy(C.position).applyMatrix4(R),S.standingPosition.copy(C.standingPosition).applyMatrix4(R),S.quaternion.setFromRotationMatrix(v0.makeRotationFromQuaternion(C.quaternion).premultiply(R))}}Xn.clear()}}}))}var Tl=new Map;function pt(n){var t=Tl.get(n);if(t)return t;throw new Error("fetcher never registered.")}function Bv(n,t){return Tl.set(n,t)}var g0={computeTangents:function(n){var t=n.index,e=n.attributes;if(t===null||e.position===void 0||e.normal===void 0||e.uv===void 0){console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");return}var r=t.array,i=e.position.array,a=e.normal.array,o=e.uv.array,s=i.length/3;e.tangent===void 0&&n.setAttribute("tangent",new f.BufferAttribute(new Float32Array(4*s),4));for(var u=e.tangent.array,l=[],c=[],d=0;d<s;d++)l[d]=new f.Vector3,c[d]=new f.Vector3;var p=new f.Vector3,A=new f.Vector3,h=new f.Vector3,v=new f.Vector2,g=new f.Vector2,m=new f.Vector2,y=new f.Vector3,b=new f.Vector3;function x(q,G,K){p.fromArray(i,q*3),A.fromArray(i,G*3),h.fromArray(i,K*3),v.fromArray(o,q*2),g.fromArray(o,G*2),m.fromArray(o,K*2);var j=A.x-p.x,J=h.x-p.x,W=A.y-p.y,$=h.y-p.y,Y=A.z-p.z,Z=h.z-p.z,oe=g.x-v.x,ne=m.x-v.x,de=g.y-v.y,se=m.y-v.y,ye=1/(oe*se-ne*de);y.set((se*j-de*J)*ye,(se*W-de*$)*ye,(se*Y-de*Z)*ye),b.set((oe*J-ne*j)*ye,(oe*$-ne*W)*ye,(oe*Z-ne*Y)*ye),l[q].add(y),l[G].add(y),l[K].add(y),c[q].add(b),c[G].add(b),c[K].add(b)}var w=n.groups;w.length===0&&(w=[{start:0,count:r.length}]);for(var d=0,E=w.length;d<E;++d)for(var S=w[d],C=S.start,R=S.count,B=C,M=C+R;B<M;B+=3)x(r[B+0],r[B+1],r[B+2]);var I=new f.Vector3,L=new f.Vector3,T=new f.Vector3,F=new f.Vector3,D,V,z;function Q(q){T.fromArray(a,q*3),F.copy(T),V=l[q],I.copy(V),I.sub(T.multiplyScalar(T.dot(V))).normalize(),L.crossVectors(F,V),z=L.dot(c[q]),D=z<0?-1:1,u[q*4]=I.x,u[q*4+1]=I.y,u[q*4+2]=I.z,u[q*4+3]=D}for(var d=0,E=w.length;d<E;++d)for(var S=w[d],C=S.start,R=S.count,B=C,M=C+R;B<M;B+=3)Q(r[B+0]),Q(r[B+1]),Q(r[B+2])},mergeBufferGeometries:function(n,t){for(var e=n[0].index!==null,r=new Set(Object.keys(n[0].attributes)),i=new Set(Object.keys(n[0].morphAttributes)),a={},o={},s=new f.BufferGeometry,u=0,l=0;l<n.length;++l){var c=n[l];if(e!==(c.index!==null))return null;for(var d in c.attributes){if(!r.has(d))return null;a[d]===void 0&&(a[d]=[]),a[d].push(c.attributes[d])}for(var d in c.morphAttributes){if(!i.has(d))return null;o[d]===void 0&&(o[d]=[]),o[d].push(c.morphAttributes[d])}if(s.userData.mergedUserData=s.userData.mergedUserData||[],s.userData.mergedUserData.push(c.userData),t){var p;if(e)p=c.index.count;else if(c.attributes.position!==void 0)p=c.attributes.position.count;else return null;s.addGroup(u,p,l),u+=p}}if(e){for(var A=0,h=[],l=0;l<n.length;++l){for(var v=n[l].index,g=0;g<v.count;++g)h.push(v.getX(g)+A);A+=n[l].attributes.position.count}s.setIndex(h)}for(var d in a){var m=this.mergeBufferAttributes(a[d]);if(!m)return null;s.setAttribute(d,m)}for(var d in o){var y=o[d][0].length;if(y===0)break;s.morphAttributes=s.morphAttributes||{},s.morphAttributes[d]=[];for(var l=0;l<y;++l){for(var b=[],g=0;g<o[d].length;++g)b.push(o[d][g][l]);var x=this.mergeBufferAttributes(b);if(!x)return null;s.morphAttributes[d].push(x)}}return s},mergeBufferAttributes:function(n){for(var t,e,r,i=0,a=0;a<n.length;++a){var o=n[a];if(o.isInterleavedBufferAttribute||(t===void 0&&(t=o.array.constructor),t!==o.array.constructor)||(e===void 0&&(e=o.itemSize),e!==o.itemSize)||(r===void 0&&(r=o.normalized),r!==o.normalized))return null;i+=o.array.length}for(var s=new t(i),u=0,a=0;a<n.length;++a)s.set(n[a].array,u),u+=n[a].array.length;return new f.BufferAttribute(s,e,r)},interleaveAttributes:function(n){for(var t,e=0,r=0,i=0,a=n.length;i<a;++i){var o=n[i];if(t===void 0&&(t=o.array.constructor),t!==o.array.constructor)return console.warn("AttributeBuffers of different types cannot be interleaved"),null;e+=o.array.length,r+=o.itemSize}for(var s=new f.InterleavedBuffer(new t(e),r),u=0,l=[],c=["getX","getY","getZ","getW"],d=["setX","setY","setZ","setW"],p=0,a=n.length;p<a;p++){var o=n[p],A=o.itemSize,h=o.count,v=new f.InterleavedBufferAttribute(s,A,u,o.normalized);l.push(v),u+=A;for(var g=0;g<h;g++)for(var m=0;m<A;m++)v[d[m]](g,o[c[m]](g))}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"),a=r?r.count:i.count,o=0,s=Object.keys(n.attributes),u={},l={},c=[],d=["getX","getY","getZ","getW"],p=0,A=s.length;p<A;p++){var h=s[p];u[h]=[];var v=n.morphAttributes[h];v&&(l[h]=new Array(v.length).fill().map(function(){return[]}))}for(var g=Math.log10(1/t),m=Math.pow(10,g),p=0;p<a;p++){for(var y=r?r.getX(p):p,b="",x=0,A=s.length;x<A;x++)for(var h=s[x],w=n.getAttribute(h),E=w.itemSize,S=0;S<E;S++)b+="".concat(~~(w[d[S]](y)*m),",");if(b in e)c.push(e[b]);else{for(var x=0,A=s.length;x<A;x++)for(var h=s[x],w=n.getAttribute(h),v=n.morphAttributes[h],E=w.itemSize,C=u[h],R=l[h],S=0;S<E;S++){var B=d[S];if(C.push(w[B](y)),v)for(var M=0,I=v.length;M<I;M++)R[M].push(v[M][B](y))}e[b]=o,c.push(o),o++}}for(var L=n.clone(),p=0,A=s.length;p<A;p++){var h=s[p],T=n.getAttribute(h),F=new T.array.constructor(u[h]),w=new f.BufferAttribute(F,T.itemSize,T.normalized);if(L.setAttribute(h,w),h in l)for(var x=0;x<l[h].length;x++){var D=n.morphAttributes[h][x],F=new D.array.constructor(l[h][x]),V=new f.BufferAttribute(F,D.itemSize,D.normalized);L.morphAttributes[h][x]=V}}return L.setIndex(c),L}};function Po(n){switch(n){case"Floorplan":return!0;case"Mapview":return!0;default:return!1}}function vi(n){switch(n){case"Panorama":return!0;case"VRPanorama":return!0;case"XRPanorama":return!0;case"Model":return!0;default:return!1}}var dr=new f.Vector3,Xa=new f.Sphere,Wa=new f.Matrix4,y0=new f.Matrix4,b0=new f.Box3,_i=new f.Matrix4().fromArray([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),ji=new f.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]),Pl=new f.Box3(new f.Vector3(-.5,-.5,-.5),new f.Vector3(.5,.5,.5));function x0(n,t,e){switch(n){case"Z":break;case"Y":e.copy(ji);break;case"-Y":e.copy(_i);break;case"WGS84":case"GCJ02":case"BD09":bv(t,e);break;default:e.identity();break}return e}function Fv(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 Ji=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(){dr.setScalar(0);var t=this.scene.localToLla(dr),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 f.Matrix4),t.copy(this.scene.coordinateTransform.ecefToLocalMatrix),this.scene&&t.premultiply(this.scene.matrixWorld),t},n.prototype.coordinatesToWorldPoint=function(t){var e=new f.Vector3(t.latitude,t.longitude,t.altitude);return this.scene.llaToWorld(e)},n.prototype.worldPointToCoordinates=function(t){return dr.copy(t),this.scene.worldToLla(dr),{latitude:dr.x,longitude:dr.y,altitude:dr.z}},n}(),Ro=function(n){ue(t,n);function t(e){e===void 0&&(e={});var r,i,a,o=n.call(this)||this;return o.name="",o.onError=(r=e.onError)!==null&&r!==void 0?r:U,o.onShownFloorChange=(i=e.onShownFloorChange)!==null&&i!==void 0?i:U,o.onLoad=(a=e.onLoad)!==null&&a!==void 0?a:U,o.work=null,o.viewLayers=[],o.bounding=new f.Box3(new f.Vector3,new f.Vector3),o.floorLength=0,o.textureOptions={},o.refined=!1,o.refineProgress=[0,0],o.loaded=!1,o.matrixAutoUpdate=!1,o.needsRender=!0,o.autoRefine=!0,o.materialVersion=0,o.materialParameters=O({},ge),o.cacheCameras=[],o.disposed=!1,o}return Object.defineProperty(t.prototype,"empty",{get:function(){return this.viewLayers.length===0},enumerable:!1,configurable:!0}),t.prototype.getMaterial=function(){return O({},this.materialParameters)},t.prototype.setMaterial=function(e){var r=this.materialParameters.shownFloorIndex,i=pu(this.materialParameters,e);if(i){var a=this.materialParameters.shownFloorIndex;r!==a&&this.onShownFloorChange(a),this.materialVersion++,this.needsRender=!0}},Object.defineProperty(t.prototype,"brightness",{get:function(){return this.materialParameters.brightness},set:function(e){this.setMaterial({brightness:typeof e=="number"?e:1})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shownFloorIndex",{get:function(){return this.materialParameters.shownFloorIndex},set:function(e){this.setMaterial({shownFloorIndex:e})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shownFloor",{get:function(){return this.shownFloorIndex===-1?null:this.shownFloorIndex},set:function(e){this.shownFloorIndex=e===null?-1:e},enumerable:!1,configurable:!0}),t.prototype.show=function(e){this.shownFloor=e!=null?e:null},Object.defineProperty(t.prototype,"clippers",{get:function(){return this.materialParameters.clippers},set:function(e){this.setMaterial({clippers:e})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"customShaders",{get:function(){return this.materialParameters.customShaders},set:function(e){this.setMaterial({customShaders:e})},enumerable:!1,configurable:!0}),t.prototype.getEdgesBySphere=function(e,r){r===void 0&&(r=30/180*Math.PI);for(var i=Math.cos(r),a=[],o=0,s=this.children;o<s.length;o++){var u=s[o];u instanceof An&&u.tileset.selectedTiles.forEach(function(l){var c,d,p;if(!(l.boundingVolume&&l.boundingVolume.distanceToPoint(e.center)>e.radius)){var A=(d=(c=l.content)===null||c===void 0?void 0:c.data)===null||d===void 0?void 0:d.object;if(A&&A.visible){var h=[];if(A.traverseVisible(function(K){if(K instanceof f.Mesh){var j=Dd.get(K);if(j){Wa.copy(K.matrixWorld),y0.getInverse(Wa),Xa.copy(e).applyMatrix4(y0);var J=j.trianglesInSphere(Xa.center,Xa.radius),W=new f.BufferGeometry;W.setAttribute("position",new f.BufferAttribute(J,3)),W.applyMatrix4(K.matrixWorld),W=g0.mergeVertices(W,.01),h.push(W)}}}),h.length===0)return;for(var v=["a","b","c"],g=g0.mergeBufferGeometries(h,!1),m=g.getAttribute("position").array,y=((p=g.getIndex())===null||p===void 0?void 0:p.array)||[],b=[],x=[],w=0,E=m.length;w<E;w+=3){var S=new f.Vector3(m[w],m[w+1],m[w+2]);b.push(S)}for(var w=0,E=y.length;w<E;w+=3){var C=y[w],R=y[w+1],B=y[w+2],M=new f.Vector3().crossVectors(b[R].clone().sub(b[C]),b[B].clone().sub(b[C])).normalize();x.push({a:C,b:R,c:B,normal:M})}for(var I={},w=0,E=x.length;w<E;w++)for(var L=x[w],T=0;T<3;T++){var F=L[v[T]],D=L[v[(T+1)%3]],V=[Math.min(F,D),Math.max(F,D)],z=V[0]+"-"+V[1];I[z]===void 0?I[z]={index1:V[0],index2:V[1],face1:w}:I[z].face2=w}for(var z in I){var Q=I[z];if(Q.face2===void 0||x[Q.face1].normal.dot(x[Q.face2].normal)<=i){var q=b[Q.index1],G=b[Q.index2];a.push(new f.Line3(q,G))}}b.length=0,x.length=0}}})}return a},t.prototype.intersectRaycaster=function(e,r,i){r===void 0&&(r=null),i===void 0&&(i=!0);for(var a=[],o=0,s=this.children.length;o<s;o++){var u=this.children[o];u.visible&&u instanceof An&&u.intersectRaycaster(e,!1,a)}return r!=null&&(a=a.filter(function(l){return l.floor===r})),this.getMaterial().pointBack==="HIDDEN"&&(a=a.filter(function(l){return!(l.object instanceof mr&&l.face&&l.face.normal.angleTo(e.ray.direction)<Math.PI/2)})),i&&a.sort(function(l,c){return l.distance-c.distance}),a},t.prototype.load=function(e,r){var i,a=this,o,s,u,l;if(r===void 0&&(r={}),this.work=e,this.name=this.work.workCode,!e.model)return Promise.resolve();for(var c=e.model,d=0,p=0,A=e.observers;p<A.length;p++){var h=A[p];d=Math.max(d,h.floorIndex)}this.floorLength=d+1;for(var v=!1,g=[],m=function(W){var $=W.tileset,Y=W.upAxis,Z=W.name,oe=W.type;oe==="mesh"&&(v=!0);var ne=$.split("#"),de=ne[0],se=ne[1],ye=(o=(se||de).split("?")[1])!==null&&o!==void 0?o:"",ie=typeof r["3d-tiles"]=="function"?r["3d-tiles"](W):(s=r["3d-tiles"])!==null&&s!==void 0?s:{},xe=pt(e).ajax($,{responseType:"text"}).then(function(Le){var Me,Oe=$?$.slice(0,$.lastIndexOf("/")+1):"",ee=Ki(JSON.parse(Le.body),Oe),re=ee.root,H=ee.rootMeta,Be=H===void 0?{}:H;Be.upAxis&&Be.upAxis!==Y&&(Y=Be.upAxis),"lodVersion"in ee&&(Y="-Y","floorInfo"in ee&&(ee.properties=ee.properties||{},ee.properties.floorInfo=ee.floorInfo.map(function(St){return{ground:-St.ground,height:St.height}}),delete ee.floorInfo),ee.asset.tilesetVersion=String(ee.lodVersion),delete ee.lodVersion);var Te=re.boundingVolume?yn(re.boundingVolume):void 0;Te&&re.transform&&Te.applyMatrix4(Wa.fromArray(re.transform));var Ce=null,Ue=new f.Matrix4,Ie=new f.Matrix4;Be.coordinate?(Ce=Be.coordinate.ground_height,Ue.fromArray(Be.coordinate.pose_ecef_to_enu),Ie.fromArray(Be.coordinate.pose_enu_to_ecef)):(Te?Te.getCenter(dr):dr.setScalar(0),x0(Y,dr,Ue),Ie.getInverse(Ue));var we=new f.Matrix4().copy(_i),be=new f.Matrix4().copy(ji),Ae=new f.Matrix4().premultiply(Ue).premultiply(we),me=new f.Matrix4().getInverse(Ae),ze;if(ie.viewerRequestVolume){var pe=Ba(ie.viewerRequestVolume)?ie.viewerRequestVolume:yn(ie.viewerRequestVolume);pe.applyMatrix4(me),ze=pe.toJson()}ee.root={refine:(Me=re.refine)!==null&&Me!==void 0?Me:"REPLACE",geometricError:re.geometricError,transform:Ae.toArray(),boundingVolume:Te?Te.toJson():void 0,viewerRequestVolume:ze,children:[re]};var Se=new An(a,ee,{name:Z,type:oe,upAxis:Y,url:$,referer:$,search:ye,fetcher:pt(e),groundHeight:Ce,coordinateTransform:{localToEnuMatrix:be,enuToLocalMatrix:we,enuToEcefMatrix:Ie,ecefToEnuMatrix:Ue,localToEcefMatrix:me,ecefToLocalMatrix:Ae}});return Se.matrix.copy(e.transform),Se.matrix.decompose(Se.position,Se.quaternion,Se.scale),Se.matrixWorldNeedsUpdate=!0,Object.assign(Se.maxMemoryUsage,Se.getRecommendProps()),typeof ie.debug!="undefined"&&(Se.debug=ie.debug),typeof ie.minLevelOfDetail!="undefined"&&(Se.minLevelOfDetail=ie.minLevelOfDetail),typeof ie.maxLevelOfDetail!="undefined"&&(Se.maxLevelOfDetail=ie.maxLevelOfDetail),typeof ie.skipLevelOfDetail!="undefined"&&(Se.skipLevelOfDetail=ie.skipLevelOfDetail),typeof ie.mostDetail!="undefined"&&(Se.mostDetail=ie.mostDetail),typeof ie.loadSiblings!="undefined"&&(Se.loadSiblings=ie.loadSiblings),typeof ie.loadAll!="undefined"&&(Se.loadAll=ie.loadAll),typeof ie.maxMemoryUsage!="undefined"&&(Se.maxMemoryUsage=ie.maxMemoryUsage),typeof ie.maxRequests!="undefined"&&(Se.maxRequests=ie.maxRequests),typeof ie.requestOrder!="undefined"&&(Se.requestOrder=ie.requestOrder),typeof ie.maxScreenSpaceError!="undefined"&&(Se.maxScreenSpaceError=ie.maxScreenSpaceError),(ie.showLayers===!1||Array.isArray(ie.showLayers)&&ie.showLayers.indexOf(Z)===-1)&&(Se.visible=!1),new Ji(Se,null)});g.push(xe.catch(function(Le){a.onError(Le);var Me=new f.Matrix4,Oe=new f.Matrix4,ee=new f.Matrix4().copy(_i),re=new f.Matrix4().copy(ji),H=new f.Matrix4().premultiply(Me).premultiply(ee),Be=new f.Matrix4().getInverse(H),Te=$?$.slice(0,$.lastIndexOf("/")+1):"",Ce;if(ie.viewerRequestVolume){var Ue=Ba(ie.viewerRequestVolume)?ie.viewerRequestVolume:yn(ie.viewerRequestVolume);Ue.applyMatrix4(Be),Ce=Ue.toJson()}var Ie=Ki({asset:{version:"0.0"},geometricError:0,viewerRequestVolume:Ce,root:{geometricError:0}},Te),we=new An(a,Ie,{name:Z,type:oe,upAxis:Y,url:$,referer:$,search:ye,fetcher:pt(e),groundHeight:null,coordinateTransform:{localToEnuMatrix:re,enuToLocalMatrix:ee,enuToEcefMatrix:Oe,ecefToEnuMatrix:Me,localToEcefMatrix:Be,ecefToLocalMatrix:H},onError:a.onError});return we.matrix.copy(e.transform),we.matrix.decompose(we.position,we.quaternion,we.scale),we.matrixWorldNeedsUpdate=!0,(ie.showLayers===!1||Array.isArray(ie.showLayers)&&ie.showLayers.indexOf(Z)===-1)&&(we.visible=!1),new Ji(we,Le)}))},y=0,b=c.layers;y<b.length;y++){var x=b[y];m(x)}if(!v&&c.file){var w=c.file,E=c.textureBase,S=c.textures,C="fallback",R="mesh",B="Z",M="",x={name:C,type:R,upAxis:B,tileset:M},I=typeof r["3d-tiles"]=="function"?r["3d-tiles"](x):(u=r["3d-tiles"])!==null&&u!==void 0?u:{},L=Fv(w)||"at3d",T=new f.Matrix4,F=new f.Matrix4,D=new f.Matrix4().copy(_i),V=new f.Matrix4().copy(ji);x0(B,dr.setScalar(0),T),F.getInverse(T);var z=new f.Matrix4().premultiply(T).premultiply(D),Q=new f.Matrix4().getInverse(z),q=void 0;if(I.viewerRequestVolume){var G=Ba(I.viewerRequestVolume)?I.viewerRequestVolume:yn(I.viewerRequestVolume);G.applyMatrix4(Q),q=G.toJson()}var K=Ki({asset:{gltfUpAxis:"Z",version:"0.0"},geometricError:0,root:{refine:"REPLACE",geometricError:0,transform:z.toArray(),viewerRequestVolume:q,content:{uri:w},extras:(i={},i[L]={textureBaseUri:E,textureArray:S,textureOptions:(l=r.textureOptions)!==null&&l!==void 0?l:{}},i)}},""),j=new An(this,K,{name:C,type:R,upAxis:B,url:M,referer:w,fetcher:pt(e),groundHeight:null,coordinateTransform:{localToEnuMatrix:V,enuToLocalMatrix:D,enuToEcefMatrix:F,ecefToEnuMatrix:T,localToEcefMatrix:Q,ecefToLocalMatrix:z},onError:this.onError});j.matrix.copy(e.transform),j.matrix.decompose(j.position,j.quaternion,j.scale),j.matrixWorldNeedsUpdate=!0,(I.showLayers===!1||Array.isArray(I.showLayers)&&I.showLayers.indexOf(C)===-1)&&(j.visible=!1);var J=new Ji(j,null);g.push(Promise.resolve(J))}return Promise.all(g).then(function(W){for(var $=0,Y=W;$<Y.length;$++){var Z=Y[$];if(a.disposed){Z.scene.dispose();continue}a.viewLayers.push(Z),a.add(Z.scene)}})},t.prototype.update=function(e,r,i){if(this.children.length){var a=this.loaded;this.refined=this.work!==null,this.refineProgress[0]=0,this.refineProgress[1]=0,this.loaded=this.work!==null;for(var o=0,s=this.viewLayers;o<s.length;o++){var u=s[o],l=u.scene;l&&(this.work&&(l.cacheCameras=this.cacheCameras,this.autoRefine===!1?l.needsRefined=!1:vi(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,i),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.makeEmpty();for(var c=0,d=this.viewLayers;c<d.length;c++){var u=d[c],l=u.scene;l&&(l.boundingBox.isEmpty()||(b0.copy(l.boundingBox).applyMatrix4(l.matrix),this.bounding.union(b0)))}this.bounding.isEmpty()&&this.bounding.copy(Pl),a===!1&&this.loaded===!0&&this.onLoad()}else this.work&&!this.work.model?(this.refined=!0,this.refineProgress[0]=0,this.refineProgress[1]=0,this.loaded=!0):(this.refined=!1,this.refineProgress[0]=0,this.refineProgress[1]=0,this.loaded=!1),this.bounding.set(new f.Vector3,new f.Vector3)},t.prototype.dispose=function(){this.disposed=!0;for(var e;e=this.children[0];)e instanceof An&&e.dispose(),this.remove(e)},t}(f.Object3D);function w0(){var n=new f.Box3,t=Kh(ge,["clippers","shownFloorIndex","brightness","customShaders"]),e=Object.assign([],{bounding:n,needsRender:!1,refined:!1,refineProgress:[0,0],loaded:!1,materialVersion:0,cacheCameras:[],autoUpdate:!0,intersectRaycaster:function(r,i,a){a===void 0&&(a=!0);var o;if(e.length===1)o=e[0].intersectRaycaster(r,i,a);else if(e.length===0)o=[];else{o=[];for(var s=0,u=e;s<u.length;s++){var l=u[s];if(l.visible){var c=l.intersectRaycaster(r,i,!1);c.length&&o.push.apply(o,c)}}a&&o.sort(function(d,p){return d.distance-p.distance})}return o},setMaterial:function(r){var i=pu(t,r);i&&(e.materialVersion++,e.needsRender=!0)},getMaterial:function(){return O({},t)},resetBrightness:function(){for(var r=0,i=e;r<i.length;r++){var a=i[r];a.setMaterial({brightness:1})}},update:function(r,i,a){e.refined=e.length>0,e.loaded=e.length>0,e.refineProgress[0]=0,e.refineProgress[1]=0,n.makeEmpty();for(var o=0,s=e.cacheCameras;o<s.length;o++){var u=s[o];u.updateMatrixWorld(!0),u.updateProjectionMatrix()}for(var l=0,c=0,d=e;c<d.length;c++){for(var p=d[c],A=0,h=p.viewLayers;A<h.length;A++){var v=h[A];v.scene.modelIndex=l++}p.setMaterial(t),p.cacheCameras=e.cacheCameras,p.autoRefine=this.autoUpdate,p.update(r,i,a),p.needsRender===!0&&(e.needsRender=!0,p.needsRender=!1),p.refined===!1&&(e.refined=!1),e.refineProgress[0]+=p.refineProgress[0],e.refineProgress[1]+=p.refineProgress[1],p.loaded===!1&&(e.loaded=!1),n.union(p.bounding)}for(var g=0,m=e;g<m.length;g++)for(var p=m[g],y=0,b=p.viewLayers;y<b.length;y++){var v=b[y];v.scene.modelsLoaded=e.loaded}n.isEmpty()&&n.copy(Pl)}});return e}var E0=function(n){return n*(2-n)},Lv=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 f.BufferGeometry;return r.setAttribute("position",new f.BufferAttribute(n,3)),r.setAttribute("uv",new f.BufferAttribute(t,2)),r.setIndex(new f.BufferAttribute(e,1)),r}(),kv=`
|
|
1040
|
+
`+JSON.stringify(n))}}function To(n){for(var t={},e=[],r={},i=0,a=n;i<a.length;i++){var o=a[i],s=t[o.workCode];s||(s=t[o.workCode]=new f.Matrix4().copy(o.transform));for(var u=0,l=o.observers;u<l.length;u++){var c=l[u],d={isResolved:!0,active:c.active,accessibleIds:c.accessibleIds,visibleIds:c.visibleIds,accessibleNodes:c.accessibleNodes,visibleNodes:c.visibleNodes,floorIndex:c.floorIndex,images:c.images,index:c.index,panoIndex:c.panoIndex,loadable:c.loadable,panoId:c.panoId,pano:c.pano,work:c.work,derivedId:c.derivedId,video:c.video,position:new f.Vector3().copy(c.position).applyMatrix4(s),standingPosition:new f.Vector3().copy(c.standingPosition).applyMatrix4(s),quaternion:new f.Quaternion().setFromRotationMatrix(v0.makeRotationFromQuaternion(c.quaternion).premultiply(s))};Object.freeze(d),e.push(d),r[d.panoId]=d}}Object.freeze(e);for(var p=n.slice(),A={},h=0,v=p;h<v.length;h++){var o=v[h];A[o.workCode]=o}return Object.freeze(Object.assign(p,{get initial(){return p.length>0?p[0].initial:{work:{}}},get resolvedObservers(){return e},getWork:function(g){return A[g]},getResolvedObserver:function(g){var m,y;return du(g)?r[g]:typeof g=="number"?r[He({workCode:(y=(m=n[0])===null||m===void 0?void 0:m.workCode)!==null&&y!==void 0?y:"",panoIndex:g})]:r[He(g)]},update:function(){for(var g=0,m=p;g<m.length;g++){var y=m[g],b=y.transform,x=t[y.workCode];x?x.equals(b)||(x.copy(b),Xn.add(y.workCode)):(t[y.workCode]=new f.Matrix4().copy(b),Xn.add(y.workCode))}if(Xn.size>0){for(var w=0,E=e;w<E.length;w++){var S=E[w];if(Xn.has(S.work.workCode)){var C=S.work.observers[S.index],R=S.work.transform;S.position.copy(C.position).applyMatrix4(R),S.standingPosition.copy(C.standingPosition).applyMatrix4(R),S.quaternion.setFromRotationMatrix(v0.makeRotationFromQuaternion(C.quaternion).premultiply(R))}}Xn.clear()}}}))}var Tl=new Map;function pt(n){var t=Tl.get(n);if(t)return t;throw new Error("fetcher never registered.")}function Bv(n,t){return Tl.set(n,t)}var g0={computeTangents:function(n){var t=n.index,e=n.attributes;if(t===null||e.position===void 0||e.normal===void 0||e.uv===void 0){console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");return}var r=t.array,i=e.position.array,a=e.normal.array,o=e.uv.array,s=i.length/3;e.tangent===void 0&&n.setAttribute("tangent",new f.BufferAttribute(new Float32Array(4*s),4));for(var u=e.tangent.array,l=[],c=[],d=0;d<s;d++)l[d]=new f.Vector3,c[d]=new f.Vector3;var p=new f.Vector3,A=new f.Vector3,h=new f.Vector3,v=new f.Vector2,g=new f.Vector2,m=new f.Vector2,y=new f.Vector3,b=new f.Vector3;function x(q,G,K){p.fromArray(i,q*3),A.fromArray(i,G*3),h.fromArray(i,K*3),v.fromArray(o,q*2),g.fromArray(o,G*2),m.fromArray(o,K*2);var j=A.x-p.x,J=h.x-p.x,W=A.y-p.y,$=h.y-p.y,Y=A.z-p.z,Z=h.z-p.z,oe=g.x-v.x,ne=m.x-v.x,de=g.y-v.y,se=m.y-v.y,ye=1/(oe*se-ne*de);y.set((se*j-de*J)*ye,(se*W-de*$)*ye,(se*Y-de*Z)*ye),b.set((oe*J-ne*j)*ye,(oe*$-ne*W)*ye,(oe*Z-ne*Y)*ye),l[q].add(y),l[G].add(y),l[K].add(y),c[q].add(b),c[G].add(b),c[K].add(b)}var w=n.groups;w.length===0&&(w=[{start:0,count:r.length}]);for(var d=0,E=w.length;d<E;++d)for(var S=w[d],C=S.start,R=S.count,B=C,M=C+R;B<M;B+=3)x(r[B+0],r[B+1],r[B+2]);var I=new f.Vector3,L=new f.Vector3,T=new f.Vector3,F=new f.Vector3,D,V,z;function Q(q){T.fromArray(a,q*3),F.copy(T),V=l[q],I.copy(V),I.sub(T.multiplyScalar(T.dot(V))).normalize(),L.crossVectors(F,V),z=L.dot(c[q]),D=z<0?-1:1,u[q*4]=I.x,u[q*4+1]=I.y,u[q*4+2]=I.z,u[q*4+3]=D}for(var d=0,E=w.length;d<E;++d)for(var S=w[d],C=S.start,R=S.count,B=C,M=C+R;B<M;B+=3)Q(r[B+0]),Q(r[B+1]),Q(r[B+2])},mergeBufferGeometries:function(n,t){for(var e=n[0].index!==null,r=new Set(Object.keys(n[0].attributes)),i=new Set(Object.keys(n[0].morphAttributes)),a={},o={},s=new f.BufferGeometry,u=0,l=0;l<n.length;++l){var c=n[l];if(e!==(c.index!==null))return null;for(var d in c.attributes){if(!r.has(d))return null;a[d]===void 0&&(a[d]=[]),a[d].push(c.attributes[d])}for(var d in c.morphAttributes){if(!i.has(d))return null;o[d]===void 0&&(o[d]=[]),o[d].push(c.morphAttributes[d])}if(s.userData.mergedUserData=s.userData.mergedUserData||[],s.userData.mergedUserData.push(c.userData),t){var p;if(e)p=c.index.count;else if(c.attributes.position!==void 0)p=c.attributes.position.count;else return null;s.addGroup(u,p,l),u+=p}}if(e){for(var A=0,h=[],l=0;l<n.length;++l){for(var v=n[l].index,g=0;g<v.count;++g)h.push(v.getX(g)+A);A+=n[l].attributes.position.count}s.setIndex(h)}for(var d in a){var m=this.mergeBufferAttributes(a[d]);if(!m)return null;s.setAttribute(d,m)}for(var d in o){var y=o[d][0].length;if(y===0)break;s.morphAttributes=s.morphAttributes||{},s.morphAttributes[d]=[];for(var l=0;l<y;++l){for(var b=[],g=0;g<o[d].length;++g)b.push(o[d][g][l]);var x=this.mergeBufferAttributes(b);if(!x)return null;s.morphAttributes[d].push(x)}}return s},mergeBufferAttributes:function(n){for(var t,e,r,i=0,a=0;a<n.length;++a){var o=n[a];if(o.isInterleavedBufferAttribute||(t===void 0&&(t=o.array.constructor),t!==o.array.constructor)||(e===void 0&&(e=o.itemSize),e!==o.itemSize)||(r===void 0&&(r=o.normalized),r!==o.normalized))return null;i+=o.array.length}for(var s=new t(i),u=0,a=0;a<n.length;++a)s.set(n[a].array,u),u+=n[a].array.length;return new f.BufferAttribute(s,e,r)},interleaveAttributes:function(n){for(var t,e=0,r=0,i=0,a=n.length;i<a;++i){var o=n[i];if(t===void 0&&(t=o.array.constructor),t!==o.array.constructor)return console.warn("AttributeBuffers of different types cannot be interleaved"),null;e+=o.array.length,r+=o.itemSize}for(var s=new f.InterleavedBuffer(new t(e),r),u=0,l=[],c=["getX","getY","getZ","getW"],d=["setX","setY","setZ","setW"],p=0,a=n.length;p<a;p++){var o=n[p],A=o.itemSize,h=o.count,v=new f.InterleavedBufferAttribute(s,A,u,o.normalized);l.push(v),u+=A;for(var g=0;g<h;g++)for(var m=0;m<A;m++)v[d[m]](g,o[c[m]](g))}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"),a=r?r.count:i.count,o=0,s=Object.keys(n.attributes),u={},l={},c=[],d=["getX","getY","getZ","getW"],p=0,A=s.length;p<A;p++){var h=s[p];u[h]=[];var v=n.morphAttributes[h];v&&(l[h]=new Array(v.length).fill().map(function(){return[]}))}for(var g=Math.log10(1/t),m=Math.pow(10,g),p=0;p<a;p++){for(var y=r?r.getX(p):p,b="",x=0,A=s.length;x<A;x++)for(var h=s[x],w=n.getAttribute(h),E=w.itemSize,S=0;S<E;S++)b+="".concat(~~(w[d[S]](y)*m),",");if(b in e)c.push(e[b]);else{for(var x=0,A=s.length;x<A;x++)for(var h=s[x],w=n.getAttribute(h),v=n.morphAttributes[h],E=w.itemSize,C=u[h],R=l[h],S=0;S<E;S++){var B=d[S];if(C.push(w[B](y)),v)for(var M=0,I=v.length;M<I;M++)R[M].push(v[M][B](y))}e[b]=o,c.push(o),o++}}for(var L=n.clone(),p=0,A=s.length;p<A;p++){var h=s[p],T=n.getAttribute(h),F=new T.array.constructor(u[h]),w=new f.BufferAttribute(F,T.itemSize,T.normalized);if(L.setAttribute(h,w),h in l)for(var x=0;x<l[h].length;x++){var D=n.morphAttributes[h][x],F=new D.array.constructor(l[h][x]),V=new f.BufferAttribute(F,D.itemSize,D.normalized);L.morphAttributes[h][x]=V}}return L.setIndex(c),L}};function Po(n){switch(n){case"Floorplan":return!0;case"Mapview":return!0;default:return!1}}function vi(n){switch(n){case"Panorama":return!0;case"VRPanorama":return!0;case"XRPanorama":return!0;case"Model":return!0;default:return!1}}var dr=new f.Vector3,Xa=new f.Sphere,Wa=new f.Matrix4,y0=new f.Matrix4,b0=new f.Box3,_i=new f.Matrix4().fromArray([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),ji=new f.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]),Pl=new f.Box3(new f.Vector3(-.5,-.5,-.5),new f.Vector3(.5,.5,.5));function x0(n,t,e){switch(n){case"Z":break;case"Y":e.copy(ji);break;case"-Y":e.copy(_i);break;case"WGS84":case"GCJ02":case"BD09":bv(t,e);break;default:e.identity();break}return e}function Fv(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 Ji=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(){dr.setScalar(0);var t=this.scene.localToLla(dr),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 f.Matrix4),t.copy(this.scene.coordinateTransform.ecefToLocalMatrix),this.scene&&t.premultiply(this.scene.matrixWorld),t},n.prototype.coordinatesToWorldPoint=function(t){var e=new f.Vector3(t.latitude,t.longitude,t.altitude);return this.scene.llaToWorld(e)},n.prototype.worldPointToCoordinates=function(t){return dr.copy(t),this.scene.worldToLla(dr),{latitude:dr.x,longitude:dr.y,altitude:dr.z}},n}(),Ro=function(n){ue(t,n);function t(e){e===void 0&&(e={});var r,i,a,o=n.call(this)||this;return o.name="",o.onError=(r=e.onError)!==null&&r!==void 0?r:U,o.onShownFloorChange=(i=e.onShownFloorChange)!==null&&i!==void 0?i:U,o.onLoad=(a=e.onLoad)!==null&&a!==void 0?a:U,o.work=null,o.viewLayers=[],o.bounding=new f.Box3(new f.Vector3,new f.Vector3),o.floorLength=0,o.textureOptions={},o.refined=!1,o.refineProgress=[0,0],o.loaded=!1,o.matrixAutoUpdate=!1,o.needsRender=!0,o.autoRefine=!0,o.materialVersion=0,o.materialParameters=O({},ge),o.cacheCameras=[],o.disposed=!1,o}return Object.defineProperty(t.prototype,"empty",{get:function(){return this.viewLayers.length===0},enumerable:!1,configurable:!0}),t.prototype.getMaterial=function(){return O({},this.materialParameters)},t.prototype.setMaterial=function(e){var r=this.materialParameters.shownFloorIndex,i=pu(this.materialParameters,e);if(i){var a=this.materialParameters.shownFloorIndex;r!==a&&this.onShownFloorChange(a),this.materialVersion++,this.needsRender=!0}},Object.defineProperty(t.prototype,"brightness",{get:function(){return this.materialParameters.brightness},set:function(e){this.setMaterial({brightness:typeof e=="number"?e:1})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shownFloorIndex",{get:function(){return this.materialParameters.shownFloorIndex},set:function(e){this.setMaterial({shownFloorIndex:e})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shownFloor",{get:function(){return this.shownFloorIndex===-1?null:this.shownFloorIndex},set:function(e){this.shownFloorIndex=e===null?-1:e},enumerable:!1,configurable:!0}),t.prototype.show=function(e){this.shownFloor=e!=null?e:null},Object.defineProperty(t.prototype,"clippers",{get:function(){return this.materialParameters.clippers},set:function(e){this.setMaterial({clippers:e})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"customShaders",{get:function(){return this.materialParameters.customShaders},set:function(e){this.setMaterial({customShaders:e})},enumerable:!1,configurable:!0}),t.prototype.getEdgesBySphere=function(e,r){r===void 0&&(r=30/180*Math.PI);for(var i=Math.cos(r),a=[],o=0,s=this.children;o<s.length;o++){var u=s[o];u instanceof An&&u.tileset.selectedTiles.forEach(function(l){var c,d,p;if(!(l.boundingVolume&&l.boundingVolume.distanceToPoint(e.center)>e.radius)){var A=(d=(c=l.content)===null||c===void 0?void 0:c.data)===null||d===void 0?void 0:d.object;if(A&&A.visible){var h=[];if(A.traverseVisible(function(K){if(K instanceof f.Mesh){var j=Dd.get(K);if(j){Wa.copy(K.matrixWorld),y0.getInverse(Wa),Xa.copy(e).applyMatrix4(y0);var J=j.trianglesInSphere(Xa.center,Xa.radius),W=new f.BufferGeometry;W.setAttribute("position",new f.BufferAttribute(J,3)),W.applyMatrix4(K.matrixWorld),W=g0.mergeVertices(W,.01),h.push(W)}}}),h.length===0)return;for(var v=["a","b","c"],g=g0.mergeBufferGeometries(h,!1),m=g.getAttribute("position").array,y=((p=g.getIndex())===null||p===void 0?void 0:p.array)||[],b=[],x=[],w=0,E=m.length;w<E;w+=3){var S=new f.Vector3(m[w],m[w+1],m[w+2]);b.push(S)}for(var w=0,E=y.length;w<E;w+=3){var C=y[w],R=y[w+1],B=y[w+2],M=new f.Vector3().crossVectors(b[R].clone().sub(b[C]),b[B].clone().sub(b[C])).normalize();x.push({a:C,b:R,c:B,normal:M})}for(var I={},w=0,E=x.length;w<E;w++)for(var L=x[w],T=0;T<3;T++){var F=L[v[T]],D=L[v[(T+1)%3]],V=[Math.min(F,D),Math.max(F,D)],z=V[0]+"-"+V[1];I[z]===void 0?I[z]={index1:V[0],index2:V[1],face1:w}:I[z].face2=w}for(var z in I){var Q=I[z];if(Q.face2===void 0||x[Q.face1].normal.dot(x[Q.face2].normal)<=i){var q=b[Q.index1],G=b[Q.index2];a.push(new f.Line3(q,G))}}b.length=0,x.length=0}}})}return a},t.prototype.intersectRaycaster=function(e,r,i){r===void 0&&(r=null),i===void 0&&(i=!0);for(var a=[],o=0,s=this.children.length;o<s;o++){var u=this.children[o];u.visible&&u instanceof An&&u.intersectRaycaster(e,!1,a)}return r!=null&&(a=a.filter(function(l){return l.floor===r})),this.getMaterial().pointBack==="HIDDEN"&&(a=a.filter(function(l){return!(l.object instanceof mr&&l.face&&l.face.normal.angleTo(e.ray.direction)<Math.PI/2)})),i&&a.sort(function(l,c){return l.distance-c.distance}),a},t.prototype.load=function(e,r){var i,a=this,o,s,u,l;if(r===void 0&&(r={}),this.work=e,this.name=this.work.workCode,!e.model)return Promise.resolve();for(var c=e.model,d=0,p=0,A=e.observers;p<A.length;p++){var h=A[p];d=Math.max(d,h.floorIndex)}this.floorLength=d+1;for(var v=!1,g=[],m=function(W){var $=W.tileset,Y=W.upAxis,Z=W.name,oe=W.type;oe==="mesh"&&(v=!0);var ne=$.split("#"),de=ne[0],se=ne[1],ye=(o=(se||de).split("?")[1])!==null&&o!==void 0?o:"",ie=typeof r["3d-tiles"]=="function"?r["3d-tiles"](W):(s=r["3d-tiles"])!==null&&s!==void 0?s:{},xe=pt(e).ajax($,{responseType:"text"}).then(function(Le){var Me,Oe=$?$.slice(0,$.lastIndexOf("/")+1):"",ee=Ki(JSON.parse(Le.body),Oe),re=ee.root,H=ee.rootMeta,Be=H===void 0?{}:H;Be.upAxis&&Be.upAxis!==Y&&(Y=Be.upAxis),"lodVersion"in ee&&(Y="-Y","floorInfo"in ee&&(ee.properties=ee.properties||{},ee.properties.floorInfo=ee.floorInfo.map(function(St){return{ground:-St.ground,height:St.height}}),delete ee.floorInfo),ee.asset.tilesetVersion=String(ee.lodVersion),delete ee.lodVersion);var Te=re.boundingVolume?yn(re.boundingVolume):void 0;Te&&re.transform&&Te.applyMatrix4(Wa.fromArray(re.transform));var Ce=null,Ue=new f.Matrix4,Ie=new f.Matrix4;Be.coordinate?(Ce=Be.coordinate.ground_height,Ue.fromArray(Be.coordinate.pose_ecef_to_enu),Ie.fromArray(Be.coordinate.pose_enu_to_ecef)):(Te?Te.getCenter(dr):dr.setScalar(0),x0(Y,dr,Ue),Ie.getInverse(Ue));var we=new f.Matrix4().copy(_i),be=new f.Matrix4().copy(ji),Ae=new f.Matrix4().premultiply(Ue).premultiply(we),me=new f.Matrix4().getInverse(Ae),ze;if(ie.viewerRequestVolume){var pe=Ba(ie.viewerRequestVolume)?ie.viewerRequestVolume:yn(ie.viewerRequestVolume);pe.applyMatrix4(me),ze=pe.toJson()}ee.root={refine:(Me=re.refine)!==null&&Me!==void 0?Me:"REPLACE",geometricError:re.geometricError,transform:Ae.toArray(),boundingVolume:Te?Te.toJson():void 0,viewerRequestVolume:ze,children:[re]};var Se=new An(a,ee,{name:Z,type:oe,upAxis:Y,url:$,referer:$,search:ye,fetcher:pt(e),groundHeight:Ce,coordinateTransform:{localToEnuMatrix:be,enuToLocalMatrix:we,enuToEcefMatrix:Ie,ecefToEnuMatrix:Ue,localToEcefMatrix:me,ecefToLocalMatrix:Ae}});return Se.matrix.copy(e.transform),Se.matrix.decompose(Se.position,Se.quaternion,Se.scale),Se.matrixWorldNeedsUpdate=!0,Object.assign(Se.maxMemoryUsage,Se.getRecommendProps()),typeof ie.debug!="undefined"&&(Se.debug=ie.debug),typeof ie.minLevelOfDetail!="undefined"&&(Se.minLevelOfDetail=ie.minLevelOfDetail),typeof ie.maxLevelOfDetail!="undefined"&&(Se.maxLevelOfDetail=ie.maxLevelOfDetail),typeof ie.skipLevelOfDetail!="undefined"&&(Se.skipLevelOfDetail=ie.skipLevelOfDetail),typeof ie.mostDetail!="undefined"&&(Se.mostDetail=ie.mostDetail),typeof ie.loadSiblings!="undefined"&&(Se.loadSiblings=ie.loadSiblings),typeof ie.loadAll!="undefined"&&(Se.loadAll=ie.loadAll),typeof ie.maxMemoryUsage!="undefined"&&(Se.maxMemoryUsage=ie.maxMemoryUsage),typeof ie.maxRequests!="undefined"&&(Se.maxRequests=ie.maxRequests),typeof ie.requestOrder!="undefined"&&(Se.requestOrder=ie.requestOrder),typeof ie.maxScreenSpaceError!="undefined"&&(Se.maxScreenSpaceError=ie.maxScreenSpaceError),(ie.showLayers===!1||Array.isArray(ie.showLayers)&&ie.showLayers.indexOf(Z)===-1)&&(Se.visible=!1),new Ji(Se,null)});g.push(xe.catch(function(Le){a.onError(Le);var Me=new f.Matrix4,Oe=new f.Matrix4,ee=new f.Matrix4().copy(_i),re=new f.Matrix4().copy(ji),H=new f.Matrix4().premultiply(Me).premultiply(ee),Be=new f.Matrix4().getInverse(H),Te=$?$.slice(0,$.lastIndexOf("/")+1):"",Ce;if(ie.viewerRequestVolume){var Ue=Ba(ie.viewerRequestVolume)?ie.viewerRequestVolume:yn(ie.viewerRequestVolume);Ue.applyMatrix4(Be),Ce=Ue.toJson()}var Ie=Ki({asset:{version:"0.0"},geometricError:0,viewerRequestVolume:Ce,root:{geometricError:0}},Te),we=new An(a,Ie,{name:Z,type:oe,upAxis:Y,url:$,referer:$,search:ye,fetcher:pt(e),groundHeight:null,coordinateTransform:{localToEnuMatrix:re,enuToLocalMatrix:ee,enuToEcefMatrix:Oe,ecefToEnuMatrix:Me,localToEcefMatrix:Be,ecefToLocalMatrix:H},onError:a.onError});return we.matrix.copy(e.transform),we.matrix.decompose(we.position,we.quaternion,we.scale),we.matrixWorldNeedsUpdate=!0,(ie.showLayers===!1||Array.isArray(ie.showLayers)&&ie.showLayers.indexOf(Z)===-1)&&(we.visible=!1),new Ji(we,Le)}))},y=0,b=c.layers;y<b.length;y++){var x=b[y];m(x)}if(!v&&c.file){var w=c.file,E=c.textureBase,S=c.textures,C="fallback",R="mesh",B="Z",M="",x={name:C,type:R,upAxis:B,tileset:M},I=typeof r["3d-tiles"]=="function"?r["3d-tiles"](x):(u=r["3d-tiles"])!==null&&u!==void 0?u:{},L=Fv(w)||"at3d",T=new f.Matrix4,F=new f.Matrix4,D=new f.Matrix4().copy(_i),V=new f.Matrix4().copy(ji);x0(B,dr.setScalar(0),T),F.getInverse(T);var z=new f.Matrix4().premultiply(T).premultiply(D),Q=new f.Matrix4().getInverse(z),q=void 0;if(I.viewerRequestVolume){var G=Ba(I.viewerRequestVolume)?I.viewerRequestVolume:yn(I.viewerRequestVolume);G.applyMatrix4(Q),q=G.toJson()}var K=Ki({asset:{version:"0.0"},geometricError:0,root:{refine:"REPLACE",geometricError:0,transform:z.toArray(),viewerRequestVolume:q,content:{uri:w},extras:(i={},i[L]={textureBaseUri:E,textureArray:S,textureOptions:(l=r.textureOptions)!==null&&l!==void 0?l:{}},i)}},""),j=new An(this,K,{name:C,type:R,upAxis:B,url:M,referer:w,fetcher:pt(e),groundHeight:null,coordinateTransform:{localToEnuMatrix:V,enuToLocalMatrix:D,enuToEcefMatrix:F,ecefToEnuMatrix:T,localToEcefMatrix:Q,ecefToLocalMatrix:z},onError:this.onError});j.matrix.copy(e.transform),j.matrix.decompose(j.position,j.quaternion,j.scale),j.matrixWorldNeedsUpdate=!0,(I.showLayers===!1||Array.isArray(I.showLayers)&&I.showLayers.indexOf(C)===-1)&&(j.visible=!1);var J=new Ji(j,null);g.push(Promise.resolve(J))}return Promise.all(g).then(function(W){for(var $=0,Y=W;$<Y.length;$++){var Z=Y[$];if(a.disposed){Z.scene.dispose();continue}a.viewLayers.push(Z),a.add(Z.scene)}})},t.prototype.update=function(e,r,i){if(this.children.length){var a=this.loaded;this.refined=this.work!==null,this.refineProgress[0]=0,this.refineProgress[1]=0,this.loaded=this.work!==null;for(var o=0,s=this.viewLayers;o<s.length;o++){var u=s[o],l=u.scene;l&&(this.work&&(l.cacheCameras=this.cacheCameras,this.autoRefine===!1?l.needsRefined=!1:vi(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,i),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.makeEmpty();for(var c=0,d=this.viewLayers;c<d.length;c++){var u=d[c],l=u.scene;l&&(l.boundingBox.isEmpty()||(b0.copy(l.boundingBox).applyMatrix4(l.matrix),this.bounding.union(b0)))}this.bounding.isEmpty()&&this.bounding.copy(Pl),a===!1&&this.loaded===!0&&this.onLoad()}else this.work&&!this.work.model?(this.refined=!0,this.refineProgress[0]=0,this.refineProgress[1]=0,this.loaded=!0):(this.refined=!1,this.refineProgress[0]=0,this.refineProgress[1]=0,this.loaded=!1),this.bounding.set(new f.Vector3,new f.Vector3)},t.prototype.dispose=function(){this.disposed=!0;for(var e;e=this.children[0];)e instanceof An&&e.dispose(),this.remove(e)},t}(f.Object3D);function w0(){var n=new f.Box3,t=Kh(ge,["clippers","shownFloorIndex","brightness","customShaders"]),e=Object.assign([],{bounding:n,needsRender:!1,refined:!1,refineProgress:[0,0],loaded:!1,materialVersion:0,cacheCameras:[],autoUpdate:!0,intersectRaycaster:function(r,i,a){a===void 0&&(a=!0);var o;if(e.length===1)o=e[0].intersectRaycaster(r,i,a);else if(e.length===0)o=[];else{o=[];for(var s=0,u=e;s<u.length;s++){var l=u[s];if(l.visible){var c=l.intersectRaycaster(r,i,!1);c.length&&o.push.apply(o,c)}}a&&o.sort(function(d,p){return d.distance-p.distance})}return o},setMaterial:function(r){var i=pu(t,r);i&&(e.materialVersion++,e.needsRender=!0)},getMaterial:function(){return O({},t)},resetBrightness:function(){for(var r=0,i=e;r<i.length;r++){var a=i[r];a.setMaterial({brightness:1})}},update:function(r,i,a){e.refined=e.length>0,e.loaded=e.length>0,e.refineProgress[0]=0,e.refineProgress[1]=0,n.makeEmpty();for(var o=0,s=e.cacheCameras;o<s.length;o++){var u=s[o];u.updateMatrixWorld(!0),u.updateProjectionMatrix()}for(var l=0,c=0,d=e;c<d.length;c++){for(var p=d[c],A=0,h=p.viewLayers;A<h.length;A++){var v=h[A];v.scene.modelIndex=l++}p.setMaterial(t),p.cacheCameras=e.cacheCameras,p.autoRefine=this.autoUpdate,p.update(r,i,a),p.needsRender===!0&&(e.needsRender=!0,p.needsRender=!1),p.refined===!1&&(e.refined=!1),e.refineProgress[0]+=p.refineProgress[0],e.refineProgress[1]+=p.refineProgress[1],p.loaded===!1&&(e.loaded=!1),n.union(p.bounding)}for(var g=0,m=e;g<m.length;g++)for(var p=m[g],y=0,b=p.viewLayers;y<b.length;y++){var v=b[y];v.scene.modelsLoaded=e.loaded}n.isEmpty()&&n.copy(Pl)}});return e}var E0=function(n){return n*(2-n)},Lv=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 f.BufferGeometry;return r.setAttribute("position",new f.BufferAttribute(n,3)),r.setAttribute("uv",new f.BufferAttribute(t,2)),r.setIndex(new f.BufferAttribute(e,1)),r}(),kv=`
|
|
1041
1041
|
varying vec2 vUv;
|
|
1042
1042
|
#include <common>
|
|
1043
1043
|
#include <logdepthbuf_pars_vertex>
|
|
@@ -1433,7 +1433,7 @@ void main() {
|
|
|
1433
1433
|
* Copyright (c) 2016 Jorik Tangelder;
|
|
1434
1434
|
* Licensed under the MIT license */var ri=function(n,t,e,r){var i=["","webkit","Moz","MS","ms","o"],a=t.createElement?t.createElement("div"):r,o="function",s=Math.round,u=Math.abs,l=Date.now;function c(P,k,N){return setTimeout(y(P,N),k)}function d(P,k,N){return Array.isArray(P)?(p(P,N[k],N),!0):!1}function p(P,k,N){var _;if(P)if(P.forEach)P.forEach(k,N);else if(P.length!==r)for(_=0;_<P.length;)k.call(N,P[_],_,P),_++;else for(_ in P)P.hasOwnProperty(_)&&k.call(N,P[_],_,P)}function A(P,k,N){var _="DEPRECATED METHOD: "+k+`
|
|
1435
1435
|
`+N+` AT
|
|
1436
|
-
`;return function(){var te=new Error("get-stack-trace"),fe=te&&te.stack?te.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",Fe=n.console&&(n.console.warn||n.console.log);return Fe&&Fe.call(n.console,_,fe),P.apply(this,arguments)}}var h;typeof Object.assign!="function"?h=function(k){if(k===r||k===null)throw new TypeError("Cannot convert undefined or null to object");for(var N=Object(k),_=1;_<arguments.length;_++){var te=arguments[_];if(te!==r&&te!==null)for(var fe in te)te.hasOwnProperty(fe)&&(N[fe]=te[fe])}return N}:h=Object.assign;var v=A(function(k,N,_){for(var te=Object.keys(N),fe=0;fe<te.length;)(!_||_&&k[te[fe]]===r)&&(k[te[fe]]=N[te[fe]]),fe++;return k},"extend","Use `assign`."),g=A(function(k,N){return v(k,N,!0)},"merge","Use `assign`.");function m(P,k,N){var _=k.prototype,te;te=P.prototype=Object.create(_),te.constructor=P,te._super=_,N&&h(te,N)}function y(P,k){return function(){return P.apply(k,arguments)}}function b(P,k){return typeof P==o?P.apply(k&&k[0]||r,k):P}function x(P,k){return P===r?k:P}function w(P,k,N){p(R(k),function(_){P.addEventListener(_,N,!1)})}function E(P,k,N){p(R(k),function(_){P.removeEventListener(_,N,!1)})}function S(P,k){for(;P;){if(P==k)return!0;P=P.parentNode}return!1}function C(P,k){return P.indexOf(k)>-1}function R(P){return P.trim().split(/\s+/g)}function B(P,k,N){if(P.indexOf&&!N)return P.indexOf(k);for(var _=0;_<P.length;){if(N&&P[_][N]==k||!N&&P[_]===k)return _;_++}return-1}function M(P){return Array.prototype.slice.call(P,0)}function I(P,k,N){for(var _=[],te=[],fe=0;fe<P.length;){var Fe=P[fe][k];B(te,Fe)<0&&_.push(P[fe]),te[fe]=Fe,fe++}return _=_.sort(function(Dt,et){return Dt[k]>et[k]}),_}function L(P,k){for(var N,_,te=k[0].toUpperCase()+k.slice(1),fe=0;fe<i.length;){if(N=i[fe],_=N?N+te:k,_ in P)return _;fe++}return r}var T=1;function F(){return T++}function D(P){var k=P.ownerDocument||P;return k.defaultView||k.parentWindow||n}var V=/mobile|tablet|ip(ad|hone|od)|android/i,z="ontouchstart"in n,Q=L(n,"PointerEvent")!==r,q=z&&V.test(navigator.userAgent),G="touch",K="pen",j="mouse",J="kinect",W=25,$=1,Y=2,Z=4,oe=8,ne=1,de=2,se=4,ye=8,ie=16,xe=de|se,Le=ye|ie,Me=xe|Le,Oe=["x","y"],ee=["clientX","clientY"];function re(P,k){var N=this;this.manager=P,this.callback=k,this.element=P.element,this.target=P.options.inputTarget,this.domHandler=function(_){b(P.options.enable,[P])&&N.handler(_)},this.init()}re.prototype={handler:function(){},init:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(D(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(D(this.element),this.evWin,this.domHandler)}};function H(P){var k,N=P.options.inputClass;return N?k=N:Q?k=Mt:q?k=At:z?k=yt:k=it,new k(P,Be)}function Be(P,k,N){var _=N.pointers.length,te=N.changedPointers.length,fe=k&$&&_-te===0,Fe=k&(Z|oe)&&_-te===0;N.isFirst=!!fe,N.isFinal=!!Fe,fe&&(P.session={}),N.eventType=k,Te(P,N),P.emit("hammer.input",N),P.recognize(N),P.session.prevInput=N}function Te(P,k){var N=P.session,_=k.pointers,te=_.length;N.firstInput||(N.firstInput=Ie(k)),te>1&&!N.firstMultiple?N.firstMultiple=Ie(k):te===1&&(N.firstMultiple=!1);var fe=N.firstInput,Fe=N.firstMultiple,ot=Fe?Fe.center:fe.center,Dt=k.center=we(_);k.timeStamp=l(),k.deltaTime=k.timeStamp-fe.timeStamp,k.angle=ze(ot,Dt),k.distance=me(ot,Dt),Ce(N,k),k.offsetDirection=Ae(k.deltaX,k.deltaY);var et=be(k.deltaTime,k.deltaX,k.deltaY);k.overallVelocityX=et.x,k.overallVelocityY=et.y,k.overallVelocity=u(et.x)>u(et.y)?et.x:et.y,k.scale=Fe?Se(Fe.pointers,_):1,k.rotation=Fe?pe(Fe.pointers,_):0,k.maxPointers=N.prevInput?k.pointers.length>N.prevInput.maxPointers?k.pointers.length:N.prevInput.maxPointers:k.pointers.length,Ue(N,k);var xr=P.element;S(k.srcEvent.target,xr)&&(xr=k.srcEvent.target),k.target=xr}function Ce(P,k){var N=k.center,_=P.offsetDelta||{},te=P.prevDelta||{},fe=P.prevInput||{};(k.eventType===$||fe.eventType===Z)&&(te=P.prevDelta={x:fe.deltaX||0,y:fe.deltaY||0},_=P.offsetDelta={x:N.x,y:N.y}),k.deltaX=te.x+(N.x-_.x),k.deltaY=te.y+(N.y-_.y)}function Ue(P,k){var N=P.lastInterval||k,_=k.timeStamp-N.timeStamp,te,fe,Fe,ot;if(k.eventType!=oe&&(_>W||N.velocity===r)){var Dt=k.deltaX-N.deltaX,et=k.deltaY-N.deltaY,xr=be(_,Dt,et);fe=xr.x,Fe=xr.y,te=u(xr.x)>u(xr.y)?xr.x:xr.y,ot=Ae(Dt,et),P.lastInterval=k}else te=N.velocity,fe=N.velocityX,Fe=N.velocityY,ot=N.direction;k.velocity=te,k.velocityX=fe,k.velocityY=Fe,k.direction=ot}function Ie(P){for(var k=[],N=0;N<P.pointers.length;)k[N]={clientX:s(P.pointers[N].clientX),clientY:s(P.pointers[N].clientY)},N++;return{timeStamp:l(),pointers:k,center:we(k),deltaX:P.deltaX,deltaY:P.deltaY}}function we(P){var k=P.length;if(k===1)return{x:s(P[0].clientX),y:s(P[0].clientY)};for(var N=0,_=0,te=0;te<k;)N+=P[te].clientX,_+=P[te].clientY,te++;return{x:s(N/k),y:s(_/k)}}function be(P,k,N){return{x:k/P||0,y:N/P||0}}function Ae(P,k){return P===k?ne:u(P)>=u(k)?P<0?de:se:k<0?ye:ie}function me(P,k,N){N||(N=Oe);var _=k[N[0]]-P[N[0]],te=k[N[1]]-P[N[1]];return Math.sqrt(_*_+te*te)}function ze(P,k,N){N||(N=Oe);var _=k[N[0]]-P[N[0]],te=k[N[1]]-P[N[1]];return Math.atan2(te,_)*180/Math.PI}function pe(P,k){return ze(k[1],k[0],ee)+ze(P[1],P[0],ee)}function Se(P,k){return me(k[0],k[1],ee)/me(P[0],P[1],ee)}var St={mousedown:$,mousemove:Y,mouseup:Z},Pe="mousedown",je="mousemove mouseup";function it(){this.evEl=Pe,this.evWin=je,this.pressed=!1,re.apply(this,arguments)}m(it,re,{handler:function(k){var N=St[k.type];N&$&&(k.button===0||k.button===2)&&(this.pressed=!0),N&Y&&k.which!==1&&(N=Z),this.pressed&&(N&Z&&(this.pressed=!1),this.callback(this.manager,N,{pointers:[k],changedPointers:[k],pointerType:j,srcEvent:k}))}});var _t={pointerdown:$,pointermove:Y,pointerup:Z,pointercancel:oe,pointerout:oe},Qr={2:G,3:K,4:j,5:J},jt="pointerdown",ut="pointermove pointerup pointercancel";n.MSPointerEvent&&!n.PointerEvent&&(jt="MSPointerDown",ut="MSPointerMove MSPointerUp MSPointerCancel");function Mt(){this.evEl=jt,this.evWin=ut,re.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}m(Mt,re,{handler:function(k){var N=this.store,_=!1,te=!1,fe=k.type.toLowerCase().replace("ms",""),Fe=_t[fe],ot=Qr[k.pointerType]||k.pointerType,Dt=ot==G,et=B(N,k.pointerId,"pointerId");Fe&$&&(k.button===0||k.button===2||Dt)?et<0&&(N.push(k),et=N.length-1):Fe&(Z|oe)?_=!0:!Dt&&k.buttons===0&&(_=!0,te=!0,Fe=_t.pointerup),!(et<0)&&(te||(N[et]=k),this.callback(this.manager,Fe,{pointers:N,changedPointers:[k],pointerType:ot,srcEvent:N[et]}),_&&N.splice(et,1))}});var dt={touchstart:$,touchmove:Y,touchend:Z,touchcancel:oe},Ct="touchstart",It="touchstart touchmove touchend touchcancel";function Tt(){this.evTarget=Ct,this.evWin=It,this.started=!1,re.apply(this,arguments)}m(Tt,re,{handler:function(k){var N=dt[k.type];if(N===$&&(this.started=!0),!!this.started){var _=Xe.call(this,k,N);N&(Z|oe)&&_[0].length-_[1].length===0&&(this.started=!1),this.callback(this.manager,N,{pointers:_[0],changedPointers:_[1],pointerType:G,srcEvent:k})}}});function Xe(P,k){var N=M(P.touches),_=M(P.changedTouches);return k&(Z|oe)&&(N=I(N.concat(_),"identifier")),[N,_]}var Ne={touchstart:$,touchmove:Y,touchend:Z,touchcancel:oe},We="touchstart touchmove touchend touchcancel";function At(){this.evTarget=We,this.targetIds={},re.apply(this,arguments)}m(At,re,{handler:function(k){var N=Ne[k.type],_=Ze.call(this,k,N);_&&this.callback(this.manager,N,{pointers:_[0],changedPointers:_[1],pointerType:G,srcEvent:k})}});function Ze(P,k){var N=M(P.touches),_=this.targetIds;if(k&($|Y)&&N.length===1)return _[N[0].identifier]=!0,[N,N];var te,fe,Fe=M(P.changedTouches),ot=[],Dt=this.target;if(fe=N.filter(function(et){return S(et.target,Dt)}),k===$)for(te=0;te<fe.length;)_[fe[te].identifier]=!0,te++;for(te=0;te<Fe.length;)_[Fe[te].identifier]&&ot.push(Fe[te]),k&(Z|oe)&&delete _[Fe[te].identifier],te++;if(ot.length)return[I(fe.concat(ot),"identifier"),ot]}var gt=2500,qt=25;function yt(){re.apply(this,arguments);var P=y(this.handler,this);this.touch=new At(this.manager,P),this.mouse=new it(this.manager,P),this.primaryTouch=null,this.lastTouches=[]}m(yt,re,{handler:function(k,N,_){var te=_.pointerType==G,fe=_.pointerType==j;if(!(fe&&_.sourceCapabilities&&_.sourceCapabilities.firesTouchEvents)){if(te)Jt.call(this,N,_);else if(fe&&qr.call(this,_))return;this.callback(k,N,_)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function Jt(P,k){P&$?(this.primaryTouch=k.changedPointers[0].identifier,gr.call(this,k)):P&(Z|oe)&&gr.call(this,k)}function gr(P){var k=P.changedPointers[0];if(k.identifier===this.primaryTouch){var N={x:k.clientX,y:k.clientY};this.lastTouches.push(N);var _=this.lastTouches,te=function(){var fe=_.indexOf(N);fe>-1&&_.splice(fe,1)};setTimeout(te,gt)}}function qr(P){for(var k=P.srcEvent.clientX,N=P.srcEvent.clientY,_=0;_<this.lastTouches.length;_++){var te=this.lastTouches[_],fe=Math.abs(k-te.x),Fe=Math.abs(N-te.y);if(fe<=qt&&Fe<=qt)return!0}return!1}var yr=a?L(a.style,"touchAction"):r,Pr=yr!==r,Ot="compute",Ge="auto",ke="manipulation",Ye="none",bt="pan-x",Pt="pan-y",or=ec();function Hr(P,k){this.manager=P,this.set(k)}Hr.prototype={set:function(P){P==Ot&&(P=this.compute()),Pr&&this.manager.element.style&&or[P]&&(this.manager.element.style[yr]=P),this.actions=P.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var P=[];return p(this.manager.recognizers,function(k){b(k.options.enable,[k])&&(P=P.concat(k.getTouchAction()))}),fn(P.join(" "))},preventDefaults:function(P){var k=P.srcEvent,N=P.offsetDirection;if(this.manager.session.prevented){k.preventDefault();return}var _=this.actions,te=C(_,Ye)&&!or[Ye],fe=C(_,Pt)&&!or[Pt],Fe=C(_,bt)&&!or[bt];if(te){var ot=P.pointers.length===1,Dt=P.distance<2,et=P.deltaTime<250;if(ot&&Dt&&et)return}if(!(Fe&&fe)&&(te||fe&&N&xe||Fe&&N&Le))return this.preventSrc(k)},preventSrc:function(P){this.manager.session.prevented=!0,P.preventDefault()}};function fn(P){if(C(P,Ye))return Ye;var k=C(P,bt),N=C(P,Pt);return k&&N?Ye:k||N?k?bt:Pt:C(P,ke)?ke:Ge}function ec(){if(!Pr)return!1;var P={},k=n.CSS&&n.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(N){P[N]=k?n.CSS.supports("touch-action",N):!0}),P}var Pi=1,Xt=2,Cn=4,Gr=8,Rr=Gr,_n=16,br=32;function Br(P){this.options=h({},this.defaults,P||{}),this.id=F(),this.manager=null,this.options.enable=x(this.options.enable,!0),this.state=Pi,this.simultaneous={},this.requireFail=[]}Br.prototype={defaults:{},set:function(P){return h(this.options,P),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(P){if(d(P,"recognizeWith",this))return this;var k=this.simultaneous;return P=Ri(P,this),k[P.id]||(k[P.id]=P,P.recognizeWith(this)),this},dropRecognizeWith:function(P){return d(P,"dropRecognizeWith",this)?this:(P=Ri(P,this),delete this.simultaneous[P.id],this)},requireFailure:function(P){if(d(P,"requireFailure",this))return this;var k=this.requireFail;return P=Ri(P,this),B(k,P)===-1&&(k.push(P),P.requireFailure(this)),this},dropRequireFailure:function(P){if(d(P,"dropRequireFailure",this))return this;P=Ri(P,this);var k=B(this.requireFail,P);return k>-1&&this.requireFail.splice(k,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(P){return!!this.simultaneous[P.id]},emit:function(P){var k=this,N=this.state;function _(te){k.manager.emit(te,P)}N<Gr&&_(k.options.event+ps(N)),_(k.options.event),P.additionalEvent&&_(P.additionalEvent),N>=Gr&&_(k.options.event+ps(N))},tryEmit:function(P){if(this.canEmit())return this.emit(P);this.state=br},canEmit:function(){for(var P=0;P<this.requireFail.length;){if(!(this.requireFail[P].state&(br|Pi)))return!1;P++}return!0},recognize:function(P){var k=h({},P);if(!b(this.options.enable,[this,k])){this.reset(),this.state=br;return}this.state&(Rr|_n|br)&&(this.state=Pi),this.state=this.process(k),this.state&(Xt|Cn|Gr|_n)&&this.tryEmit(k)},process:function(P){},getTouchAction:function(){},reset:function(){}};function ps(P){return P&_n?"cancel":P&Gr?"end":P&Cn?"move":P&Xt?"start":""}function vs(P){return P==ie?"down":P==ye?"up":P==de?"left":P==se?"right":""}function Ri(P,k){var N=k.manager;return N?N.get(P):P}function sr(){Br.apply(this,arguments)}m(sr,Br,{defaults:{pointers:1},attrTest:function(P){var k=this.options.pointers;return k===0||P.pointers.length===k},process:function(P){var k=this.state,N=P.eventType,_=k&(Xt|Cn),te=this.attrTest(P);return _&&(N&oe||!te)?k|_n:_||te?N&Z?k|Gr:k&Xt?k|Cn:Xt:br}});function Bi(){sr.apply(this,arguments),this.pX=null,this.pY=null}m(Bi,sr,{defaults:{event:"pan",threshold:10,pointers:1,direction:Me},getTouchAction:function(){var P=this.options.direction,k=[];return P&xe&&k.push(Pt),P&Le&&k.push(bt),k},directionTest:function(P){var k=this.options,N=!0,_=P.distance,te=P.direction,fe=P.deltaX,Fe=P.deltaY;return te&k.direction||(k.direction&xe?(te=fe===0?ne:fe<0?de:se,N=fe!=this.pX,_=Math.abs(P.deltaX)):(te=Fe===0?ne:Fe<0?ye:ie,N=Fe!=this.pY,_=Math.abs(P.deltaY))),P.direction=te,N&&_>k.threshold&&te&k.direction},attrTest:function(P){return sr.prototype.attrTest.call(this,P)&&(this.state&Xt||!(this.state&Xt)&&this.directionTest(P))},emit:function(P){this.pX=P.deltaX,this.pY=P.deltaY;var k=vs(P.direction);k&&(P.additionalEvent=this.options.event+k),this._super.emit.call(this,P)}});function Aa(){sr.apply(this,arguments)}m(Aa,sr,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Ye]},attrTest:function(P){return this._super.attrTest.call(this,P)&&(Math.abs(P.scale-1)>this.options.threshold||this.state&Xt)},emit:function(P){if(P.scale!==1){var k=P.scale<1?"in":"out";P.additionalEvent=this.options.event+k}this._super.emit.call(this,P)}});function ga(){Br.apply(this,arguments),this._timer=null,this._input=null}m(ga,Br,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Ge]},process:function(P){var k=this.options,N=P.pointers.length===k.pointers,_=P.distance<k.threshold,te=P.deltaTime>k.time;if(this._input=P,!_||!N||P.eventType&(Z|oe)&&!te)this.reset();else if(P.eventType&$)this.reset(),this._timer=c(function(){this.state=Rr,this.tryEmit()},k.time,this);else if(P.eventType&Z)return Rr;return br},reset:function(){clearTimeout(this._timer)},emit:function(P){this.state===Rr&&(P&&P.eventType&Z?this.manager.emit(this.options.event+"up",P):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}});function ya(){sr.apply(this,arguments)}m(ya,sr,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Ye]},attrTest:function(P){return this._super.attrTest.call(this,P)&&(Math.abs(P.rotation)>this.options.threshold||this.state&Xt)}});function ba(){sr.apply(this,arguments)}m(ba,sr,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:xe|Le,pointers:1},getTouchAction:function(){return Bi.prototype.getTouchAction.call(this)},attrTest:function(P){var k=this.options.direction,N;return k&(xe|Le)?N=P.overallVelocity:k&xe?N=P.overallVelocityX:k&Le&&(N=P.overallVelocityY),this._super.attrTest.call(this,P)&&k&P.offsetDirection&&P.distance>this.options.threshold&&P.maxPointers==this.options.pointers&&u(N)>this.options.velocity&&P.eventType&Z},emit:function(P){var k=vs(P.offsetDirection);k&&this.manager.emit(this.options.event+k,P),this.manager.emit(this.options.event,P)}});function Fi(){Br.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}m(Fi,Br,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ke]},process:function(P){var k=this.options,N=P.pointers.length===k.pointers,_=P.distance<k.threshold,te=P.deltaTime<k.time;if(this.reset(),P.eventType&$&&this.count===0)return this.failTimeout();if(_&&te&&N){if(P.eventType!=Z)return this.failTimeout();var fe=this.pTime?P.timeStamp-this.pTime<k.interval:!0,Fe=!this.pCenter||me(this.pCenter,P.center)<k.posThreshold;this.pTime=P.timeStamp,this.pCenter=P.center,!Fe||!fe?this.count=1:this.count+=1,this._input=P;var ot=this.count%k.taps;if(ot===0)return this.hasRequireFailures()?(this._timer=c(function(){this.state=Rr,this.tryEmit()},k.interval,this),Xt):Rr}return br},failTimeout:function(){return this._timer=c(function(){this.state=br},this.options.interval,this),br},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Rr&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function In(P,k){return k=k||{},k.recognizers=x(k.recognizers,In.defaults.preset),new xa(P,k)}In.VERSION="2.0.7",In.defaults={domEvents:!1,touchAction:Ot,enable:!0,inputTarget:null,inputClass:null,preset:[[ya,{enable:!1}],[Aa,{enable:!1},["rotate"]],[ba,{direction:xe}],[Bi,{direction:xe},["swipe"]],[Fi],[Fi,{event:"doubletap",taps:2},["tap"]],[ga]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var tc=1,ms=2;function xa(P,k){this.options=h({},In.defaults,k||{}),this.options.inputTarget=this.options.inputTarget||P,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=P,this.input=H(this),this.touchAction=new Hr(this,this.options.touchAction),As(this,!0),p(this.options.recognizers,function(N){var _=this.add(new N[0](N[1]));N[2]&&_.recognizeWith(N[2]),N[3]&&_.requireFailure(N[3])},this)}xa.prototype={set:function(P){return h(this.options,P),P.touchAction&&this.touchAction.update(),P.inputTarget&&(this.input.destroy(),this.input.target=P.inputTarget,this.input.init()),this},stop:function(P){this.session.stopped=P?ms:tc},recognize:function(P){var k=this.session;if(!k.stopped){this.touchAction.preventDefaults(P);var N,_=this.recognizers,te=k.curRecognizer;(!te||te&&te.state&Rr)&&(te=k.curRecognizer=null);for(var fe=0;fe<_.length;)N=_[fe],k.stopped!==ms&&(!te||N==te||N.canRecognizeWith(te))?N.recognize(P):N.reset(),!te&&N.state&(Xt|Cn|Gr)&&(te=k.curRecognizer=N),fe++}},get:function(P){if(P instanceof Br)return P;for(var k=this.recognizers,N=0;N<k.length;N++)if(k[N].options.event==P)return k[N];return null},add:function(P){if(d(P,"add",this))return this;var k=this.get(P.options.event);return k&&this.remove(k),this.recognizers.push(P),P.manager=this,this.touchAction.update(),P},remove:function(P){if(d(P,"remove",this))return this;if(P=this.get(P),P){var k=this.recognizers,N=B(k,P);N!==-1&&(k.splice(N,1),this.touchAction.update())}return this},on:function(P,k){if(P!==r&&k!==r){var N=this.handlers;return p(R(P),function(_){N[_]=N[_]||[],N[_].push(k)}),this}},off:function(P,k){if(P!==r){var N=this.handlers;return p(R(P),function(_){k?N[_]&&N[_].splice(B(N[_],k),1):delete N[_]}),this}},emit:function(P,k){this.options.domEvents&&rc(P,k);var N=this.handlers[P]&&this.handlers[P].slice();if(!(!N||!N.length)){k.type=P,k.preventDefault=function(){k.srcEvent.preventDefault()};for(var _=0;_<N.length;)N[_](k),_++}},destroy:function(){this.element&&As(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function As(P,k){var N=P.element;if(N.style){var _;p(P.options.cssProps,function(te,fe){_=L(N.style,fe),k?(P.oldCssProps[_]=N.style[_],N.style[_]=te):N.style[_]=P.oldCssProps[_]||""}),k||(P.oldCssProps={})}}function rc(P,k){var N=t.createEvent("Event");N.initEvent(P,!0,!0),N.gesture=k,k.target.dispatchEvent(N)}return h(In,{INPUT_START:$,INPUT_MOVE:Y,INPUT_END:Z,INPUT_CANCEL:oe,STATE_POSSIBLE:Pi,STATE_BEGAN:Xt,STATE_CHANGED:Cn,STATE_ENDED:Gr,STATE_RECOGNIZED:Rr,STATE_CANCELLED:_n,STATE_FAILED:br,DIRECTION_NONE:ne,DIRECTION_LEFT:de,DIRECTION_RIGHT:se,DIRECTION_UP:ye,DIRECTION_DOWN:ie,DIRECTION_HORIZONTAL:xe,DIRECTION_VERTICAL:Le,DIRECTION_ALL:Me,Manager:xa,Input:re,TouchAction:Hr,TouchInput:At,MouseInput:it,PointerEventInput:Mt,TouchMouseInput:yt,SingleTouchInput:Tt,Recognizer:Br,AttrRecognizer:sr,Tap:Fi,Pan:Bi,Swipe:ba,Pinch:Aa,Rotate:ya,Press:ga,on:w,off:E,each:p,merge:g,extend:v,assign:h,inherit:m,bindFn:y,prefixed:L}),In}(typeof window!="undefined"?window:{},typeof document!="undefined"?document:{});function T0(n,t,e){var r=t.getBoundingClientRect(),i=r.top,a=r.left,o=r.width,s=r.height;return e&&(a=a+o*e.left,i=i+s*(1-e.bottom-e.height),o=o*e.width,s=s*e.height),new f.Vector2((n.x-a)/o*2-1,-(n.y-i)/s*2+1)}var Fl=new f.OrthographicCamera(-1,1,1,-1,0,1),rs=new f.BufferGeometry;rs.setAttribute("position",new f.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));rs.setAttribute("uv",new f.Float32BufferAttribute([0,2,0,0,2,0],2));var wn=new f.Mesh(rs),ns=new f.Scene;ns.add(wn);var nm=`
|
|
1436
|
+
`;return function(){var te=new Error("get-stack-trace"),fe=te&&te.stack?te.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",Fe=n.console&&(n.console.warn||n.console.log);return Fe&&Fe.call(n.console,_,fe),P.apply(this,arguments)}}var h;typeof Object.assign!="function"?h=function(k){if(k===r||k===null)throw new TypeError("Cannot convert undefined or null to object");for(var N=Object(k),_=1;_<arguments.length;_++){var te=arguments[_];if(te!==r&&te!==null)for(var fe in te)te.hasOwnProperty(fe)&&(N[fe]=te[fe])}return N}:h=Object.assign;var v=A(function(k,N,_){for(var te=Object.keys(N),fe=0;fe<te.length;)(!_||_&&k[te[fe]]===r)&&(k[te[fe]]=N[te[fe]]),fe++;return k},"extend","Use `assign`."),g=A(function(k,N){return v(k,N,!0)},"merge","Use `assign`.");function m(P,k,N){var _=k.prototype,te;te=P.prototype=Object.create(_),te.constructor=P,te._super=_,N&&h(te,N)}function y(P,k){return function(){return P.apply(k,arguments)}}function b(P,k){return typeof P==o?P.apply(k&&k[0]||r,k):P}function x(P,k){return P===r?k:P}function w(P,k,N){p(R(k),function(_){P.addEventListener(_,N,!1)})}function E(P,k,N){p(R(k),function(_){P.removeEventListener(_,N,!1)})}function S(P,k){for(;P;){if(P==k)return!0;P=P.parentNode}return!1}function C(P,k){return P.indexOf(k)>-1}function R(P){return P.trim().split(/\s+/g)}function B(P,k,N){if(P.indexOf&&!N)return P.indexOf(k);for(var _=0;_<P.length;){if(N&&P[_][N]==k||!N&&P[_]===k)return _;_++}return-1}function M(P){return Array.prototype.slice.call(P,0)}function I(P,k,N){for(var _=[],te=[],fe=0;fe<P.length;){var Fe=P[fe][k];B(te,Fe)<0&&_.push(P[fe]),te[fe]=Fe,fe++}return _=_.sort(function(Dt,et){return Dt[k]>et[k]}),_}function L(P,k){for(var N,_,te=k[0].toUpperCase()+k.slice(1),fe=0;fe<i.length;){if(N=i[fe],_=N?N+te:k,_ in P)return _;fe++}return r}var T=1;function F(){return T++}function D(P){var k=P.ownerDocument||P;return k.defaultView||k.parentWindow||n}var V=/mobile|tablet|ip(ad|hone|od)|android/i,z="ontouchstart"in n,Q=L(n,"PointerEvent")!==r,q=z&&V.test(navigator.userAgent),G="touch",K="pen",j="mouse",J="kinect",W=25,$=1,Y=2,Z=4,oe=8,ne=1,de=2,se=4,ye=8,ie=16,xe=de|se,Le=ye|ie,Me=xe|Le,Oe=["x","y"],ee=["clientX","clientY"];function re(P,k){var N=this;this.manager=P,this.callback=k,this.element=P.element,this.target=P.options.inputTarget,this.domHandler=function(_){b(P.options.enable,[P])&&N.handler(_)},this.init()}re.prototype={handler:function(){},init:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(D(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(D(this.element),this.evWin,this.domHandler)}};function H(P){var k,N=P.options.inputClass;return N?k=N:Q?k=Mt:q?k=At:z?k=yt:k=it,new k(P,Be)}function Be(P,k,N){var _=N.pointers.length,te=N.changedPointers.length,fe=k&$&&_-te===0,Fe=k&(Z|oe)&&_-te===0;N.isFirst=!!fe,N.isFinal=!!Fe,fe&&(P.session={}),N.eventType=k,Te(P,N),P.emit("hammer.input",N),P.recognize(N),P.session.prevInput=N}function Te(P,k){var N=P.session,_=k.pointers,te=_.length;N.firstInput||(N.firstInput=Ie(k)),te>1&&!N.firstMultiple?N.firstMultiple=Ie(k):te===1&&(N.firstMultiple=!1);var fe=N.firstInput,Fe=N.firstMultiple,ot=Fe?Fe.center:fe.center,Dt=k.center=we(_);k.timeStamp=l(),k.deltaTime=k.timeStamp-fe.timeStamp,k.angle=ze(ot,Dt),k.distance=me(ot,Dt),Ce(N,k),k.offsetDirection=Ae(k.deltaX,k.deltaY);var et=be(k.deltaTime,k.deltaX,k.deltaY);k.overallVelocityX=et.x,k.overallVelocityY=et.y,k.overallVelocity=u(et.x)>u(et.y)?et.x:et.y,k.scale=Fe?Se(Fe.pointers,_):1,k.rotation=Fe?pe(Fe.pointers,_):0,k.maxPointers=N.prevInput?k.pointers.length>N.prevInput.maxPointers?k.pointers.length:N.prevInput.maxPointers:k.pointers.length,Ue(N,k);var xr=P.element;S(k.srcEvent.target,xr)&&(xr=k.srcEvent.target),k.target=xr}function Ce(P,k){var N=k.center,_=P.offsetDelta||{},te=P.prevDelta||{},fe=P.prevInput||{};(k.eventType===$||fe.eventType===Z)&&(te=P.prevDelta={x:fe.deltaX||0,y:fe.deltaY||0},_=P.offsetDelta={x:N.x,y:N.y}),k.deltaX=te.x+(N.x-_.x),k.deltaY=te.y+(N.y-_.y)}function Ue(P,k){var N=P.lastInterval||k,_=k.timeStamp-N.timeStamp,te,fe,Fe,ot;if(k.eventType!=oe&&(_>W||N.velocity===r)){var Dt=k.deltaX-N.deltaX,et=k.deltaY-N.deltaY,xr=be(_,Dt,et);fe=xr.x,Fe=xr.y,te=u(xr.x)>u(xr.y)?xr.x:xr.y,ot=Ae(Dt,et),P.lastInterval=k}else te=N.velocity,fe=N.velocityX,Fe=N.velocityY,ot=N.direction;k.velocity=te,k.velocityX=fe,k.velocityY=Fe,k.direction=ot}function Ie(P){for(var k=[],N=0;N<P.pointers.length;)k[N]={clientX:s(P.pointers[N].clientX),clientY:s(P.pointers[N].clientY)},N++;return{timeStamp:l(),pointers:k,center:we(k),deltaX:P.deltaX,deltaY:P.deltaY}}function we(P){var k=P.length;if(k===1)return{x:s(P[0].clientX),y:s(P[0].clientY)};for(var N=0,_=0,te=0;te<k;)N+=P[te].clientX,_+=P[te].clientY,te++;return{x:s(N/k),y:s(_/k)}}function be(P,k,N){return{x:k/P||0,y:N/P||0}}function Ae(P,k){return P===k?ne:u(P)>=u(k)?P<0?de:se:k<0?ye:ie}function me(P,k,N){N||(N=Oe);var _=k[N[0]]-P[N[0]],te=k[N[1]]-P[N[1]];return Math.sqrt(_*_+te*te)}function ze(P,k,N){N||(N=Oe);var _=k[N[0]]-P[N[0]],te=k[N[1]]-P[N[1]];return Math.atan2(te,_)*180/Math.PI}function pe(P,k){return ze(k[1],k[0],ee)+ze(P[1],P[0],ee)}function Se(P,k){return me(k[0],k[1],ee)/me(P[0],P[1],ee)}var St={mousedown:$,mousemove:Y,mouseup:Z},Pe="mousedown",je="mousemove mouseup";function it(){this.evEl=Pe,this.evWin=je,this.pressed=!1,re.apply(this,arguments)}m(it,re,{handler:function(k){var N=St[k.type];N&$&&(k.button===0||k.button===2)&&(this.pressed=!0),N&Y&&k.which!==1&&(N=Z),this.pressed&&(N&Z&&(this.pressed=!1),this.callback(this.manager,N,{pointers:[k],changedPointers:[k],pointerType:j,srcEvent:k}))}});var jt={pointerdown:$,pointermove:Y,pointerup:Z,pointercancel:oe,pointerout:oe},Qr={2:G,3:K,4:j,5:J},Jt="pointerdown",ut="pointermove pointerup pointercancel";n.MSPointerEvent&&!n.PointerEvent&&(Jt="MSPointerDown",ut="MSPointerMove MSPointerUp MSPointerCancel");function Mt(){this.evEl=Jt,this.evWin=ut,re.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}m(Mt,re,{handler:function(k){var N=this.store,_=!1,te=!1,fe=k.type.toLowerCase().replace("ms",""),Fe=jt[fe],ot=Qr[k.pointerType]||k.pointerType,Dt=ot==G,et=B(N,k.pointerId,"pointerId");Fe&$&&(k.button===0||k.button===2||Dt)?et<0&&(N.push(k),et=N.length-1):Fe&(Z|oe)?_=!0:!Dt&&k.buttons===0&&(_=!0,te=!0,Fe=jt.pointerup),!(et<0)&&(te||(N[et]=k),this.callback(this.manager,Fe,{pointers:N,changedPointers:[k],pointerType:ot,srcEvent:N[et]}),_&&N.splice(et,1))}});var dt={touchstart:$,touchmove:Y,touchend:Z,touchcancel:oe},Ct="touchstart",It="touchstart touchmove touchend touchcancel";function Tt(){this.evTarget=Ct,this.evWin=It,this.started=!1,re.apply(this,arguments)}m(Tt,re,{handler:function(k){var N=dt[k.type];if(N===$&&(this.started=!0),!!this.started){var _=Xe.call(this,k,N);N&(Z|oe)&&_[0].length-_[1].length===0&&(this.started=!1),this.callback(this.manager,N,{pointers:_[0],changedPointers:_[1],pointerType:G,srcEvent:k})}}});function Xe(P,k){var N=M(P.touches),_=M(P.changedTouches);return k&(Z|oe)&&(N=I(N.concat(_),"identifier")),[N,_]}var Ne={touchstart:$,touchmove:Y,touchend:Z,touchcancel:oe},We="touchstart touchmove touchend touchcancel";function At(){this.evTarget=We,this.targetIds={},re.apply(this,arguments)}m(At,re,{handler:function(k){var N=Ne[k.type],_=Ze.call(this,k,N);_&&this.callback(this.manager,N,{pointers:_[0],changedPointers:_[1],pointerType:G,srcEvent:k})}});function Ze(P,k){var N=M(P.touches),_=this.targetIds;if(k&($|Y)&&N.length===1)return _[N[0].identifier]=!0,[N,N];var te,fe,Fe=M(P.changedTouches),ot=[],Dt=this.target;if(fe=N.filter(function(et){return S(et.target,Dt)}),k===$)for(te=0;te<fe.length;)_[fe[te].identifier]=!0,te++;for(te=0;te<Fe.length;)_[Fe[te].identifier]&&ot.push(Fe[te]),k&(Z|oe)&&delete _[Fe[te].identifier],te++;if(ot.length)return[I(fe.concat(ot),"identifier"),ot]}var gt=2500,qt=25;function yt(){re.apply(this,arguments);var P=y(this.handler,this);this.touch=new At(this.manager,P),this.mouse=new it(this.manager,P),this.primaryTouch=null,this.lastTouches=[]}m(yt,re,{handler:function(k,N,_){var te=_.pointerType==G,fe=_.pointerType==j;if(!(fe&&_.sourceCapabilities&&_.sourceCapabilities.firesTouchEvents)){if(te)Xt.call(this,N,_);else if(fe&&qr.call(this,_))return;this.callback(k,N,_)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function Xt(P,k){P&$?(this.primaryTouch=k.changedPointers[0].identifier,gr.call(this,k)):P&(Z|oe)&&gr.call(this,k)}function gr(P){var k=P.changedPointers[0];if(k.identifier===this.primaryTouch){var N={x:k.clientX,y:k.clientY};this.lastTouches.push(N);var _=this.lastTouches,te=function(){var fe=_.indexOf(N);fe>-1&&_.splice(fe,1)};setTimeout(te,gt)}}function qr(P){for(var k=P.srcEvent.clientX,N=P.srcEvent.clientY,_=0;_<this.lastTouches.length;_++){var te=this.lastTouches[_],fe=Math.abs(k-te.x),Fe=Math.abs(N-te.y);if(fe<=qt&&Fe<=qt)return!0}return!1}var yr=a?L(a.style,"touchAction"):r,Pr=yr!==r,Ot="compute",Ge="auto",ke="manipulation",Ye="none",bt="pan-x",Pt="pan-y",or=ec();function Hr(P,k){this.manager=P,this.set(k)}Hr.prototype={set:function(P){P==Ot&&(P=this.compute()),Pr&&this.manager.element.style&&or[P]&&(this.manager.element.style[yr]=P),this.actions=P.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var P=[];return p(this.manager.recognizers,function(k){b(k.options.enable,[k])&&(P=P.concat(k.getTouchAction()))}),fn(P.join(" "))},preventDefaults:function(P){var k=P.srcEvent,N=P.offsetDirection;if(this.manager.session.prevented){k.preventDefault();return}var _=this.actions,te=C(_,Ye)&&!or[Ye],fe=C(_,Pt)&&!or[Pt],Fe=C(_,bt)&&!or[bt];if(te){var ot=P.pointers.length===1,Dt=P.distance<2,et=P.deltaTime<250;if(ot&&Dt&&et)return}if(!(Fe&&fe)&&(te||fe&&N&xe||Fe&&N&Le))return this.preventSrc(k)},preventSrc:function(P){this.manager.session.prevented=!0,P.preventDefault()}};function fn(P){if(C(P,Ye))return Ye;var k=C(P,bt),N=C(P,Pt);return k&&N?Ye:k||N?k?bt:Pt:C(P,ke)?ke:Ge}function ec(){if(!Pr)return!1;var P={},k=n.CSS&&n.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(N){P[N]=k?n.CSS.supports("touch-action",N):!0}),P}var Pi=1,Wt=2,Cn=4,Gr=8,Rr=Gr,_n=16,br=32;function Br(P){this.options=h({},this.defaults,P||{}),this.id=F(),this.manager=null,this.options.enable=x(this.options.enable,!0),this.state=Pi,this.simultaneous={},this.requireFail=[]}Br.prototype={defaults:{},set:function(P){return h(this.options,P),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(P){if(d(P,"recognizeWith",this))return this;var k=this.simultaneous;return P=Ri(P,this),k[P.id]||(k[P.id]=P,P.recognizeWith(this)),this},dropRecognizeWith:function(P){return d(P,"dropRecognizeWith",this)?this:(P=Ri(P,this),delete this.simultaneous[P.id],this)},requireFailure:function(P){if(d(P,"requireFailure",this))return this;var k=this.requireFail;return P=Ri(P,this),B(k,P)===-1&&(k.push(P),P.requireFailure(this)),this},dropRequireFailure:function(P){if(d(P,"dropRequireFailure",this))return this;P=Ri(P,this);var k=B(this.requireFail,P);return k>-1&&this.requireFail.splice(k,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(P){return!!this.simultaneous[P.id]},emit:function(P){var k=this,N=this.state;function _(te){k.manager.emit(te,P)}N<Gr&&_(k.options.event+ps(N)),_(k.options.event),P.additionalEvent&&_(P.additionalEvent),N>=Gr&&_(k.options.event+ps(N))},tryEmit:function(P){if(this.canEmit())return this.emit(P);this.state=br},canEmit:function(){for(var P=0;P<this.requireFail.length;){if(!(this.requireFail[P].state&(br|Pi)))return!1;P++}return!0},recognize:function(P){var k=h({},P);if(!b(this.options.enable,[this,k])){this.reset(),this.state=br;return}this.state&(Rr|_n|br)&&(this.state=Pi),this.state=this.process(k),this.state&(Wt|Cn|Gr|_n)&&this.tryEmit(k)},process:function(P){},getTouchAction:function(){},reset:function(){}};function ps(P){return P&_n?"cancel":P&Gr?"end":P&Cn?"move":P&Wt?"start":""}function vs(P){return P==ie?"down":P==ye?"up":P==de?"left":P==se?"right":""}function Ri(P,k){var N=k.manager;return N?N.get(P):P}function sr(){Br.apply(this,arguments)}m(sr,Br,{defaults:{pointers:1},attrTest:function(P){var k=this.options.pointers;return k===0||P.pointers.length===k},process:function(P){var k=this.state,N=P.eventType,_=k&(Wt|Cn),te=this.attrTest(P);return _&&(N&oe||!te)?k|_n:_||te?N&Z?k|Gr:k&Wt?k|Cn:Wt:br}});function Bi(){sr.apply(this,arguments),this.pX=null,this.pY=null}m(Bi,sr,{defaults:{event:"pan",threshold:10,pointers:1,direction:Me},getTouchAction:function(){var P=this.options.direction,k=[];return P&xe&&k.push(Pt),P&Le&&k.push(bt),k},directionTest:function(P){var k=this.options,N=!0,_=P.distance,te=P.direction,fe=P.deltaX,Fe=P.deltaY;return te&k.direction||(k.direction&xe?(te=fe===0?ne:fe<0?de:se,N=fe!=this.pX,_=Math.abs(P.deltaX)):(te=Fe===0?ne:Fe<0?ye:ie,N=Fe!=this.pY,_=Math.abs(P.deltaY))),P.direction=te,N&&_>k.threshold&&te&k.direction},attrTest:function(P){return sr.prototype.attrTest.call(this,P)&&(this.state&Wt||!(this.state&Wt)&&this.directionTest(P))},emit:function(P){this.pX=P.deltaX,this.pY=P.deltaY;var k=vs(P.direction);k&&(P.additionalEvent=this.options.event+k),this._super.emit.call(this,P)}});function Aa(){sr.apply(this,arguments)}m(Aa,sr,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Ye]},attrTest:function(P){return this._super.attrTest.call(this,P)&&(Math.abs(P.scale-1)>this.options.threshold||this.state&Wt)},emit:function(P){if(P.scale!==1){var k=P.scale<1?"in":"out";P.additionalEvent=this.options.event+k}this._super.emit.call(this,P)}});function ga(){Br.apply(this,arguments),this._timer=null,this._input=null}m(ga,Br,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Ge]},process:function(P){var k=this.options,N=P.pointers.length===k.pointers,_=P.distance<k.threshold,te=P.deltaTime>k.time;if(this._input=P,!_||!N||P.eventType&(Z|oe)&&!te)this.reset();else if(P.eventType&$)this.reset(),this._timer=c(function(){this.state=Rr,this.tryEmit()},k.time,this);else if(P.eventType&Z)return Rr;return br},reset:function(){clearTimeout(this._timer)},emit:function(P){this.state===Rr&&(P&&P.eventType&Z?this.manager.emit(this.options.event+"up",P):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}});function ya(){sr.apply(this,arguments)}m(ya,sr,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Ye]},attrTest:function(P){return this._super.attrTest.call(this,P)&&(Math.abs(P.rotation)>this.options.threshold||this.state&Wt)}});function ba(){sr.apply(this,arguments)}m(ba,sr,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:xe|Le,pointers:1},getTouchAction:function(){return Bi.prototype.getTouchAction.call(this)},attrTest:function(P){var k=this.options.direction,N;return k&(xe|Le)?N=P.overallVelocity:k&xe?N=P.overallVelocityX:k&Le&&(N=P.overallVelocityY),this._super.attrTest.call(this,P)&&k&P.offsetDirection&&P.distance>this.options.threshold&&P.maxPointers==this.options.pointers&&u(N)>this.options.velocity&&P.eventType&Z},emit:function(P){var k=vs(P.offsetDirection);k&&this.manager.emit(this.options.event+k,P),this.manager.emit(this.options.event,P)}});function Fi(){Br.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}m(Fi,Br,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ke]},process:function(P){var k=this.options,N=P.pointers.length===k.pointers,_=P.distance<k.threshold,te=P.deltaTime<k.time;if(this.reset(),P.eventType&$&&this.count===0)return this.failTimeout();if(_&&te&&N){if(P.eventType!=Z)return this.failTimeout();var fe=this.pTime?P.timeStamp-this.pTime<k.interval:!0,Fe=!this.pCenter||me(this.pCenter,P.center)<k.posThreshold;this.pTime=P.timeStamp,this.pCenter=P.center,!Fe||!fe?this.count=1:this.count+=1,this._input=P;var ot=this.count%k.taps;if(ot===0)return this.hasRequireFailures()?(this._timer=c(function(){this.state=Rr,this.tryEmit()},k.interval,this),Wt):Rr}return br},failTimeout:function(){return this._timer=c(function(){this.state=br},this.options.interval,this),br},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Rr&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function In(P,k){return k=k||{},k.recognizers=x(k.recognizers,In.defaults.preset),new xa(P,k)}In.VERSION="2.0.7",In.defaults={domEvents:!1,touchAction:Ot,enable:!0,inputTarget:null,inputClass:null,preset:[[ya,{enable:!1}],[Aa,{enable:!1},["rotate"]],[ba,{direction:xe}],[Bi,{direction:xe},["swipe"]],[Fi],[Fi,{event:"doubletap",taps:2},["tap"]],[ga]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var tc=1,ms=2;function xa(P,k){this.options=h({},In.defaults,k||{}),this.options.inputTarget=this.options.inputTarget||P,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=P,this.input=H(this),this.touchAction=new Hr(this,this.options.touchAction),As(this,!0),p(this.options.recognizers,function(N){var _=this.add(new N[0](N[1]));N[2]&&_.recognizeWith(N[2]),N[3]&&_.requireFailure(N[3])},this)}xa.prototype={set:function(P){return h(this.options,P),P.touchAction&&this.touchAction.update(),P.inputTarget&&(this.input.destroy(),this.input.target=P.inputTarget,this.input.init()),this},stop:function(P){this.session.stopped=P?ms:tc},recognize:function(P){var k=this.session;if(!k.stopped){this.touchAction.preventDefaults(P);var N,_=this.recognizers,te=k.curRecognizer;(!te||te&&te.state&Rr)&&(te=k.curRecognizer=null);for(var fe=0;fe<_.length;)N=_[fe],k.stopped!==ms&&(!te||N==te||N.canRecognizeWith(te))?N.recognize(P):N.reset(),!te&&N.state&(Wt|Cn|Gr)&&(te=k.curRecognizer=N),fe++}},get:function(P){if(P instanceof Br)return P;for(var k=this.recognizers,N=0;N<k.length;N++)if(k[N].options.event==P)return k[N];return null},add:function(P){if(d(P,"add",this))return this;var k=this.get(P.options.event);return k&&this.remove(k),this.recognizers.push(P),P.manager=this,this.touchAction.update(),P},remove:function(P){if(d(P,"remove",this))return this;if(P=this.get(P),P){var k=this.recognizers,N=B(k,P);N!==-1&&(k.splice(N,1),this.touchAction.update())}return this},on:function(P,k){if(P!==r&&k!==r){var N=this.handlers;return p(R(P),function(_){N[_]=N[_]||[],N[_].push(k)}),this}},off:function(P,k){if(P!==r){var N=this.handlers;return p(R(P),function(_){k?N[_]&&N[_].splice(B(N[_],k),1):delete N[_]}),this}},emit:function(P,k){this.options.domEvents&&rc(P,k);var N=this.handlers[P]&&this.handlers[P].slice();if(!(!N||!N.length)){k.type=P,k.preventDefault=function(){k.srcEvent.preventDefault()};for(var _=0;_<N.length;)N[_](k),_++}},destroy:function(){this.element&&As(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function As(P,k){var N=P.element;if(N.style){var _;p(P.options.cssProps,function(te,fe){_=L(N.style,fe),k?(P.oldCssProps[_]=N.style[_],N.style[_]=te):N.style[_]=P.oldCssProps[_]||""}),k||(P.oldCssProps={})}}function rc(P,k){var N=t.createEvent("Event");N.initEvent(P,!0,!0),N.gesture=k,k.target.dispatchEvent(N)}return h(In,{INPUT_START:$,INPUT_MOVE:Y,INPUT_END:Z,INPUT_CANCEL:oe,STATE_POSSIBLE:Pi,STATE_BEGAN:Wt,STATE_CHANGED:Cn,STATE_ENDED:Gr,STATE_RECOGNIZED:Rr,STATE_CANCELLED:_n,STATE_FAILED:br,DIRECTION_NONE:ne,DIRECTION_LEFT:de,DIRECTION_RIGHT:se,DIRECTION_UP:ye,DIRECTION_DOWN:ie,DIRECTION_HORIZONTAL:xe,DIRECTION_VERTICAL:Le,DIRECTION_ALL:Me,Manager:xa,Input:re,TouchAction:Hr,TouchInput:At,MouseInput:it,PointerEventInput:Mt,TouchMouseInput:yt,SingleTouchInput:Tt,Recognizer:Br,AttrRecognizer:sr,Tap:Fi,Pan:Bi,Swipe:ba,Pinch:Aa,Rotate:ya,Press:ga,on:w,off:E,each:p,merge:g,extend:v,assign:h,inherit:m,bindFn:y,prefixed:L}),In}(typeof window!="undefined"?window:{},typeof document!="undefined"?document:{});function T0(n,t,e){var r=t.getBoundingClientRect(),i=r.top,a=r.left,o=r.width,s=r.height;return e&&(a=a+o*e.left,i=i+s*(1-e.bottom-e.height),o=o*e.width,s=s*e.height),new f.Vector2((n.x-a)/o*2-1,-(n.y-i)/s*2+1)}var Fl=new f.OrthographicCamera(-1,1,1,-1,0,1),rs=new f.BufferGeometry;rs.setAttribute("position",new f.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));rs.setAttribute("uv",new f.Float32BufferAttribute([0,2,0,0,2,0],2));var wn=new f.Mesh(rs),ns=new f.Scene;ns.add(wn);var nm=`
|
|
1437
1437
|
varying vec2 vUv;
|
|
1438
1438
|
void main() {
|
|
1439
1439
|
vUv = uv;
|
|
@@ -1963,11 +1963,11 @@ void main() {
|
|
|
1963
1963
|
--------z-8J-zn\x075=;=9-qr}u-:-{rvtuo|Qr}u6H------\f----\f--\f--r{-z-<-sy|n5[RVTUO\\b_lP\\b[a6H\f|vq-znv{56
|
|
1964
1964
|
--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--
|
|
1965
1965
|
-<<-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
|
|
1966
|
-
----qvpnqH--\f\f`);var cA=function(n){ue(t,n);function t(e){var r=n.call(this)||this;return r.uniforms={screenWidth:
|
|
1967
|
-
`,e},t.prototype.updateShaderSource=function(){var e=this.getDefines()+uA,r=this.getDefines()+lA;this.setValues({vertexShader:e,fragmentShader:r}),this.needsUpdate=!0},Ht([cr("screenWidth"),Gt("design:type",Number)],t.prototype,"screenWidth",void 0),Ht([cr("screenHeight"),Gt("design:type",Number)],t.prototype,"screenHeight",void 0),Ht([cr("edlStrength"),Gt("design:type",Number)],t.prototype,"edlStrength",void 0),Ht([cr("uNear"),Gt("design:type",Number)],t.prototype,"uNear",void 0),Ht([cr("uFar"),Gt("design:type",Number)],t.prototype,"uFar",void 0),Ht([cr("radius"),Gt("design:type",Number)],t.prototype,"radius",void 0),Ht([cr("neighbours",!0),Gt("design:type",Float32Array)],t.prototype,"neighbours",void 0),Ht([cr("depthMap"),Gt("design:type",f.Texture)],t.prototype,"depthMap",void 0),Ht([cr("uEDLColor"),Gt("design:type",f.Texture)],t.prototype,"uEDLColor",void 0),Ht([cr("uEDLDepth"),Gt("design:type",f.Texture)],t.prototype,"uEDLDepth",void 0),Ht([cr("uProj"),Gt("design:type",Array)],t.prototype,"uProj",void 0),t}(f.RawShaderMaterial);function
|
|
1966
|
+
----qvpnqH--\f\f`);var cA=function(n){ue(t,n);function t(e){var r=n.call(this)||this;return r.uniforms={screenWidth:Zt("f",0),screenHeight:Zt("f",0),edlStrength:Zt("f",1),uNear:Zt("f",1),uFar:Zt("f",1),radius:Zt("f",1),neighbours:Zt("2fv",new Float32Array),depthMap:Zt("t",new f.Texture),uEDLColor:Zt("t",new f.Texture),uEDLDepth:Zt("t",new f.Texture),opacity:Zt("f",1),uProj:Zt("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+`
|
|
1967
|
+
`,e},t.prototype.updateShaderSource=function(){var e=this.getDefines()+uA,r=this.getDefines()+lA;this.setValues({vertexShader:e,fragmentShader:r}),this.needsUpdate=!0},Ht([cr("screenWidth"),Gt("design:type",Number)],t.prototype,"screenWidth",void 0),Ht([cr("screenHeight"),Gt("design:type",Number)],t.prototype,"screenHeight",void 0),Ht([cr("edlStrength"),Gt("design:type",Number)],t.prototype,"edlStrength",void 0),Ht([cr("uNear"),Gt("design:type",Number)],t.prototype,"uNear",void 0),Ht([cr("uFar"),Gt("design:type",Number)],t.prototype,"uFar",void 0),Ht([cr("radius"),Gt("design:type",Number)],t.prototype,"radius",void 0),Ht([cr("neighbours",!0),Gt("design:type",Float32Array)],t.prototype,"neighbours",void 0),Ht([cr("depthMap"),Gt("design:type",f.Texture)],t.prototype,"depthMap",void 0),Ht([cr("uEDLColor"),Gt("design:type",f.Texture)],t.prototype,"uEDLColor",void 0),Ht([cr("uEDLDepth"),Gt("design:type",f.Texture)],t.prototype,"uEDLDepth",void 0),Ht([cr("uProj"),Gt("design:type",Array)],t.prototype,"uProj",void 0),t}(f.RawShaderMaterial);function Zt(n,t){return{type:n,value:t}}function cr(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 fA=new f.OrthographicCamera(-1,1,1,-1,0,1),ls=new f.BufferGeometry;ls.setAttribute("position",new f.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));ls.setAttribute("uv",new f.Float32BufferAttribute([0,2,0,0,2,0],2));var ql=new f.Mesh(ls),Hl=new f.Scene;Hl.add(ql);var dA=function(n){ue(t,n);function t(e,r,i,a){var o=n.call(this,e,r,i,a)||this;return o.sharedV2=new f.Vector2,o.renderer=e,o.material=new cA,ql.material=o.material,o.material.needsUpdate=!0,o}return t.prototype.render=function(e){this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0,this.renderer.setRenderTarget(e[0]),this.renderer.render(this.scene,this.camera);var r=this.camera,i=this.material.uniforms,a=this.renderer.getSize(this.sharedV2);i.screenWidth.value=a.x,i.screenHeight.value=a.y;var o=r.projectionMatrix,s=new Float32Array(16);s.set(o.elements);for(var u=new Float32Array(this.material.neighbourCount*2),l=0;l<this.material.neighbourCount;l++)u[2*l+0]=Math.cos(2*l*Math.PI/this.material.neighbourCount),u[2*l+1]=Math.sin(2*l*Math.PI/this.material.neighbourCount);i.neighbours.value=u,i.uNear.value=r.near,i.uFar.value=r.far,i.uEDLColor.value=e[0].texture,i.uProj.value=s,i.edlStrength.value=.5,i.radius.value=1,i.opacity.value=1,this.renderer.setRenderTarget(e[1]),this.renderer.render(Hl,fA)},t.prototype.dispose=function(){this.copyPass.dispose()},t}(os);const hA=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}(`}rpvv|{-zrqvz}-sy|nH}rpvv|{-zrqvz}-v{H{vs|z-nz}yr?Q-drvtuZn}H{vs|z-nz}yr?Q-Qr}uZn}Hn\bv{t-rp?-bH|vq-znv{56-
|
|
1968
1968
|
sy|n-qr}u-J-r\x07r?Q5Qr}uZn}9-b6;Hvs5qr}u-KJ->;=6
|
|
1969
1969
|
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`),pA=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}(`}rpvv|{-zrqvz}-sy|nH}rpvv|{-zrqvz}-v{Hnvor-rp@-}|vv|{Hnvor-rp?-H{vs|z-znA-}|wrpv|{Znv\x07H{vs|z-znA-z|qrycvrZnv\x07Hn\bv{t-rp?-bH|vq-znv{56-
|
|
1970
|
-
b-J-Htyl]|vv|{-J-}|wrpv|{Znv\x07-7-z|qrycvrZnv\x07-7-rpA5}|vv|{9>;=6H\f`);var vA=function(n){ue(t,n);function t(e){var r=n.call(this,{vertexShader:pA,fragmentShader:hA})||this;return r.uniforms={uDepthMap:z0("t",null),uWeightMap:z0("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}},Ht([U0("uDepthMap"),Gt("design:type",Number)],t.prototype,"uDepthMap",void 0),Ht([U0("uWeightMap"),Gt("design:type",Number)],t.prototype,"uWeightMap",void 0),t}(f.RawShaderMaterial);function z0(n,t){return{type:n,value:t}}function U0(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 mA=new f.OrthographicCamera(-1,1,1,-1,0,1),cs=new f.BufferGeometry;cs.setAttribute("position",new f.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));cs.setAttribute("uv",new f.Float32BufferAttribute([0,2,0,0,2,0],2));var Gl=new f.Mesh(cs),Kl=new f.Scene;Kl.add(Gl);var AA=function(n){ue(t,n);function t(e,r,i,a){var o=n.call(this,e,r,i,a)||this;return o.sharedV2=new f.Vector2,o.renderer=e,o.material=new vA,o.camera=i,Gl.material=o.material,o}return t.prototype.render=function(e){this.models.setMaterial({useHQDepth:!0,useHQWeight:!1}),this.models.update(this.renderer,this.camera,"Mapview"),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0,this.renderer.setRenderTarget(e[0]),this.renderer.render(this.scene,this.camera),this.models.setMaterial({useHQWeight:!0,useHQDepth:!1}),this.models.update(this.renderer,this.camera,"Mapview"),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.renderer.setClearColor(new f.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 f.Color(0,0,0)),this.renderer.setClearAlpha(1),this.renderer.setRenderTarget(e[2]),this.renderer.render(Kl,mA)},t.prototype.dispose=function(){this.copyPass.dispose()},t}(os),oo=.5,so=.5,Q0=Math.PI/7,gA=function(n){ue(t,n);function t(e){var r=this,i,a=t.parseArgs(e);return r=n.call(this,a)||this,r.mode="Mapview",r.defaultLongitude=a.defaultLongitude,r.defaultLatitude=a.defaultLatitude,r.defaultDistance=a.defaultDistance,r.maxLatitude=a.maxLatitude,r.minLatitude=a.minLatitude,r.cameraType=a.cameraType,r.modelInScreen=a.modelInScreen,r.locationMotion=new Re({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 Re({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new Re({perspToOrtho:r.camera.perspToOrtho.x}),r.intersectMeshCreator=a.intersectMeshCreator,r.intersectMesh=r.intersectMeshCreator(),r.intersectMesh.name="intersect",r.intersectMesh.visible=!1,r.currentTapId=null,r.helper.add(r.intersectMesh),r.edlTarget=new f.WebGLRenderTarget(1024,1024,{generateMipmaps:!1,minFilter:f.NearestFilter,magFilter:f.NearestFilter,format:f.RGBAFormat,type:f.FloatType,depthTexture:new f.DepthTexture(1024,1024,f.UnsignedIntType)}),r.edlEffect=new dA(r.renderer,r.modelScene,r.camera,r.models),r.hqEffect=new AA(r.renderer,r.modelScene,r.camera,r.models),r}return t.parseArgs=function(e){var r,i,a,o,s,u,l,c;if(e instanceof t)return e;var d=n.parseArgs.call(this,e);return O(O({},d),{defaultLongitude:(r=e.defaultLongitude)!==null&&r!==void 0?r:Math.PI/4,defaultLatitude:(i=e.defaultLatitude)!==null&&i!==void 0?i:Math.PI/4,defaultDistance:(a=e.defaultDistance)!==null&&a!==void 0?a:150,maxLatitude:(o=e.maxLatitude)!==null&&o!==void 0?o:+Math.PI/2,minLatitude:(s=e.minLatitude)!==null&&s!==void 0?s:0,cameraType:(u=e.cameraType)!==null&&u!==void 0?u:"auto",modelInScreen:(l=e.modelInScreen)!==null&&l!==void 0?l:"boundingbox-center",intersectMeshCreator:(c=e.intersectMeshCreator)!==null&&c!==void 0?c:function(){return new ha}})},t.distanceFromModel=function(e,r,i){var a=e.bounding,o=Math.pow(Math.pow(a.max.x-a.min.x+1,2)+Math.pow(a.max.y-a.min.y+1,2)+Math.pow(a.max.z-a.min.z+1,2),1/2),s=o/2/Math.tan(Math.PI*r/360);return i<1&&(s=s/i),isNaN(s)?o:s},t.initAnimationEndState=function(e){var r,i,a,o,s,u,l,c=this.parseArgs(e),d=c.works,p=c.models,A=e.initial,h=A.state,v=A.currentState,g=typeof h.panoIndex=="number"?{workCode:(a=(r=h.workCode)!==null&&r!==void 0?r:(i=c.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:h.panoIndex}:{workCode:v.workCode,panoIndex:v.panoIndex},m=d.getResolvedObserver(g),y=(o=h.fov)!==null&&o!==void 0?o:60,b=ce((s=h.latitude)!==null&&s!==void 0?s:Po(v.mode)?v.latitude:c.defaultLatitude,c.minLatitude,c.maxLatitude),x=t.distanceFromModel(c.models,y,c.camera.aspect),w=new f.Vector3,E=(u=h.distance)!==null&&u!==void 0?u:Math.min(c.defaultDistance,x),S=(l=h.longitude)!==null&&l!==void 0?l:Po(v.mode)?v.longitude:c.defaultLongitude;return h.offset?w.copy(h.offset):c.defaultDistance<x&&m?(w.copy(m.position),h.longitude===void 0&&(S=v.longitude)):(p.bounding.getCenter(w),E=x/2),O(O({},g),{mode:"Mapview",longitude:S,latitude:b,fov:y,offset:w,distance:E})},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.locationMotion.dispose(),delete this.panState,this.intersectMesh.dispose(),this.helper.remove(this.intersectMesh)},t.prototype.isReady=function(){return this.locationMotion.ended===!1?!1:n.prototype.isReady.call(this)},t.prototype.updateWork=function(e,r,i,a){this.userAction=a,this.works=e;var o=t.initAnimationEndState(O(O({},this),{initial:{currentState:O(O({},this.currentPano),this.camera.pose),duration:i.duration,effect:i.effect,state:r,userAction:a}}));this.currentPano={workCode:o.workCode,panoIndex:o.panoIndex};var s={longitude:o.longitude,latitude:o.latitude,fov:o.fov},u={x:o.offset.x,y:o.offset.y,z:o.offset.z,distance:o.distance,orthoDistance:o.distance};return this.locationMotion.set(u,i.duration).catch(U),this.cameraMotion.set(s,i.duration).catch(U),!0},t.prototype.updateModel=function(e){n.prototype.updateModel.call(this,e);var r=e.bounding.getCenter(new f.Vector3),i=t.distanceFromModel(e,this.cameraMotion.value.fov,this.camera.aspect);this.updateCamera({offset:r,distance:i},0,!0)},t.prototype.updateCamera=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();var o={},s={};return e.distance!==void 0&&(o.distance=e.distance),e.offset!==void 0&&(o.x=e.offset.x,o.y=e.offset.y,o.z=e.offset.z),e.longitude!==void 0&&(s.longitude=e.longitude),e.latitude!==void 0&&(s.latitude=e.latitude),e.fov!==void 0&&(s.fov=e.fov),a.locationMotion.set(o,r).catch(U),a.cameraMotion.set(s,r).catch(U)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();for(var o=[],s=[],u=0,l=e;u<l.length;u++){var c=l[u];o.push({key:c.key,progress:c.progress,value:{distance:c.value.distance,x:c.value.offset.x,y:c.value.offset.x,z:c.value.offset.x}}),s.push({key:c.key,progress:c.progress,value:{longitude:c.value.longitude,latitude:c.value.latitude,fov:c.value.fov}})}return a.locationMotion.setKeyframes(o,r).catch(U),a.cameraMotion.setKeyframes(e,r)})},t.prototype.updateTime=function(e,r){if(!this.destroyed){var i={},a={};this.locationMotion.ended||(this.locationMotion.update(e),a.distance=this.locationMotion.value.distance,a.offset=new f.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z)),this.cameraMotion.ended||(this.cameraMotion.update(e),a.longitude=this.cameraMotion.value.longitude,a.latitude=this.cameraMotion.value.latitude,a.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended||(this.modelAlphaMotion.update(e),i.modelAlpha=this.modelAlphaMotion.value.modelAlpha);var o=0;this.cameraType==="auto"?o=Math.abs(Math.PI/2-this.cameraMotion.value.latitude)<.02||Math.abs(-Math.PI/2-this.cameraMotion.value.latitude)<.02?1:0:this.cameraType==="perspective"?o=0:this.cameraType==="orthographic"&&(o=1),this.perspToOrthoMotion.getTargetKeyframe().value.perspToOrtho!==o&&this.perspToOrthoMotion.set({perspToOrtho:o},500).catch(U),this.perspToOrthoMotion.ended||(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(ce(this.perspToOrthoMotion.value.perspToOrtho,0,1))),ar(i)||this.models.setMaterial(i),ar(a)||this.setCamera(a)}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(ve())[1],r=this.locationMotion.getKeyFrameSegment(ve())[1];return O(O({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,distance:r.value.distance,offset:new f.Vector3(r.value.x,r.value.y,r.value.z)})},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var i=e.initial;i.state,i.currentState;var a=i.duration,o=i.userAction;e.userAction=o;var s=t.initAnimationEndState(e),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},c={modelAlpha:1},d={perspToOrtho:0};e.emit("initAnimation.start",X("initAnimation.start",{state:s,userAction:e.userAction})),e.perspToOrthoMotion.set(d,a).catch(U),e.modelAlphaMotion.set(c,a/3).catch(U),e.cameraMotion.set(u,a).catch(U),e.locationMotion.set(l,a).then(function(){e.emit("initAnimation.end",X("initAnimation.end",{state:s,userAction:e.userAction}))},function(p){var A=O(O(O({},e.currentPano),{mode:e.mode}),tt(e.camera.pose));e.emit("initAnimation.end",X("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 a=this.works.resolvedObservers.filter(function(l){for(var c,d=0,p=r.models;d<p.length;d++){var A=p[d];if(A.visible&&((c=A.work)===null||c===void 0?void 0:c.workCode)===l.work.workCode)return!0}return!1}),o=Ir(a,function(l){return l.standingPosition.distanceTo(i.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 f.Vector2);return{longitude:-2*e.x/(r.x*this.scissor.width),latitude:2*e.y/(r.y*this.scissor.height)}},t.prototype.requestMomentumMovement=function(e,r,i,a){var o=this;if(this.inMomentumMovement!==null){for(var s=O({},i),u={longitude:0,latitude:0,x:0,y:0,z:0},l=0;l<a;l++)s.longitude*=.996,s.latitude*=.996*.998,s.x*=.99,s.y*=.99,s.z*=.99,u.longitude+=s.longitude,u.latitude+=s.latitude,u.x+=s.x,u.y+=s.y,u.z+=s.z;var c=cn(this.cameraMotion.value.longitude+u.longitude),d=ce(this.cameraMotion.value.latitude+u.latitude,this.minLatitude,this.maxLatitude),p=new f.Vector3(this.locationMotion.value.x+u.x,this.locationMotion.value.y+u.y,this.locationMotion.value.z+u.z),A=O(O({},this.currentPano),{mode:this.mode,longitude:c,latitude:d,offset:p,fov:this.cameraMotion.value.fov,distance:this.camera.pose.distance}),h=!(Math.abs(s.longitude)>1e-4||Math.abs(s.latitude)>1e-4||Math.abs(s.x)>1e-4||Math.abs(s.y)>1e-4||Math.abs(s.z)>1e-4),v=X("gesture.momentum",O(O({},e),{isFirst:r,isFinal:h,state:A}));if(this.inMomentumMovement.event=v,this.emit("gesture.momentum",v),e.defaultPrevented){this.inMomentumMovement=null;return}this.inMomentumMovement&&(this.cameraMotion.set({longitude:c,latitude:d},0).catch(U),this.locationMotion.set({x:A.offset.x,y:A.offset.y,z:A.offset.z},0).catch(U),h?this.inMomentumMovement=null:Et.shared.add(function(g,m){o.requestMomentumMovement(e,!1,s,m|0)},!0,1))}},t.prototype.fixFinalState=function(e){if(this.perspToOrthoMotion.getTargetKeyframe().value.perspToOrtho!==1){var r=tr(e,new f.Vector3),i=new f.Vector3().copy(e.offset).sub(r.clone().multiplyScalar(e.distance)),a=new f.Raycaster(i,r);a.params.Points={threshold:.1},a.near=oo;var o;if(a.ray.direction.y<-.3&&(o=this.models.intersectRaycaster(a).filter(function(d){var p,A=(p=d.face)===null||p===void 0?void 0:p.normal;return A&&a.ray.direction.dot(A)>=0?!1:d.distance>so+a.near})[0],!o)){var s=new f.Plane(new f.Vector3(0,1,0),-this.models.bounding.min.y),u=a.ray.intersectPlane(s,new f.Vector3);if(u){var l=u.distanceTo(a.ray.origin);l<1e4&&l>=a.near&&(o={distance:l,floor:0,point:u,object:this.scene,face:null})}}if(!o){var c=Math.max(e.distance,3);o={distance:c,floor:0,point:a.ray.direction.clone().setLength(c).add(a.ray.origin),object:this.scene,face:null}}o&&(e.distance=ce(o.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,a=0;e.pointerType==="mouse"&&(a=e.srcEvent.buttons),i&&a===0&&i.buttons!==0&&(a=i.buttons);var o=i==null?void 0:i.target;if(!o){var s=this.relativeClientPosition(e.center),u=new f.Raycaster;u.params.Points={threshold:.1},u.setFromCamera(s,this.camera),u.near=oo,o=new f.Vector3().copy(u.ray.direction).multiplyScalar(3).add(u.ray.origin);var l=this.models.intersectRaycaster(u)[0];if(!l&&u.ray.direction.y<-.3){var c=new f.Plane(new f.Vector3(0,1,0),0),d=u.ray.intersectPlane(c,new f.Vector3);if(d){var p=d.distanceTo(u.ray.origin);p<1e4&&p>=u.near&&(l={distance:p,floor:0,point:d,object:this.scene})}}if(l)o.copy(l.point);else{var A=new f.Vector3().copy(this.camera.pose.offset).sub(this.camera.position).normalize(),c=new f.Plane().setFromNormalAndCoplanarPoint(A,this.camera.pose.offset);u.ray.intersectPlane(c,o)}}if(e.isFinal?delete this.panState:this.panState={target:o,buttons:a,pointerLength:r,x:e.center.x,y:e.center.y},!(typeof i=="undefined"||i.pointerLength!==r)){var h=r>1||a===2;if(h){var v={x:e.center.x-i.x,y:e.center.y-i.y},g=new f.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),m=tr(this.cameraMotion.value).setLength(this.locationMotion.value.distance).add(g),y=new f.Vector3().copy(m).sub(i.target).length();y*=Math.tan(this.camera.pose.fov/2*Math.PI/180);var b=this.renderer.getSize(new f.Vector2),x=2*v.x*y/b.y,w=2*v.y*y/b.y,E=new f.Vector3;if(E.setFromMatrixColumn(this.camera.matrix,0),E.multiplyScalar(-x),g.add(E),this.camera.pose.latitude<Q0?E.setFromMatrixColumn(this.camera.matrix,1):(E.setFromMatrixColumn(this.camera.matrix,0),E.crossVectors(this.camera.up,E)),E.multiplyScalar(w),g.add(E),this.modelInScreen==="boundingbox-center"){var S=this.models.bounding.clone();S.expandByScalar(this.camera.pose.distance),g.clamp(S.min,S.max)}var C=O(O({},this.currentPano),{mode:this.mode,longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:g,distance:this.camera.pose.distance});if(e.state=C,this.emit("gesture.pan",e),e.defaultPrevented)return;if(this.locationMotion.set({x:C.offset.x,y:C.offset.y,z:C.offset.z},0).catch(U),e.isFinal&&(this.fixFinalState(C),Object.assign(e,{__fixFinalState:!0}),this.locationMotion.set({distance:C.distance,x:C.offset.x,y:C.offset.y,z:C.offset.z},0).catch(U)),e.isFinal){var R=this.renderer.getSize(new f.Vector2),B=2*e.velocityX*y/R.y,M=2*e.velocityY*y/R.y,I=new f.Vector3,L=new f.Vector3;I.setFromMatrixColumn(this.camera.matrix,0),I.multiplyScalar(-B),L.add(I),this.camera.pose.latitude<Q0?I.setFromMatrixColumn(this.camera.matrix,1):(I.setFromMatrixColumn(this.camera.matrix,0),I.crossVectors(this.camera.up,I)),I.multiplyScalar(M),L.add(I),this.inMomentumMovement={uuid:Ut()},this.requestMomentumMovement(e,!0,{longitude:0,latitude:0,x:L.x,y:L.y,z:L.z},0)}}else{var v={x:e.center.x-i.x,y:e.center.y-i.y},T=this.coordinatesForOffset(v),F=cn(this.cameraMotion.value.longitude+T.longitude),D=ce(this.cameraMotion.value.latitude+T.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 C=O(O({},this.currentPano),{mode:this.mode,longitude:F,latitude:D,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=C,this.emit("gesture.pan",e),e.defaultPrevented)return;if(e.isFinal?this.locationMotion.set({distance:C.distance,x:C.offset.x,y:C.offset.y,z:C.offset.z},0).catch(U):this.cameraMotion.set({longitude:C.longitude,latitude:C.latitude},0).catch(U),e.isFinal){var V=e.velocityX,z=e.velocityY;this.inMomentumMovement={uuid:Ut()},this.requestMomentumMovement(e,!0,O(O({},this.coordinatesForOffset({x:V,y:z})),{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 a=this.models.bounding.getCenter(new f.Vector3),o=t.distanceFromModel(this.models,this.cameraMotion.value.fov,this.camera.aspect),s=ce(i/e.scale,so,1/0),u=e.state.offset.clone().sub(tr(e.state).setLength(s)),l=this.models.bounding.containsPoint(u),c;if(!l&&this.pinchState&&this.pinchState.scale>e.scale&&a.distanceTo(u)>o?c=e.state.distance:(c=s,this.pinchState&&(this.pinchState.scale=e.scale)),e.state.distance=c,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.locationMotion.set({distance:e.state.distance},0).catch(U),e.pointerType!=="mouse"&&(e.type="gesture.pan",this.onPanGesture(e)),e.isFinal)){if(!("__fixFinalState"in e)){var d=e.state;this.fixFinalState(e.state);var p={x:d.offset.x,y:d.offset.y,z:d.offset.z,distance:d.distance};this.locationMotion.set(p,0).catch(U)}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 a=e.center.raycaster;if(a.near=oo,a.far=500,e.isFinal&&this.intersectMesh.parent&&this.intersectMesh.visible===!0){this.hideIntersectMesh();return}var o=this.models.intersectRaycaster(a)[0],s=X("intersect.update",{raycaster:a,intersection:o!=null?o:null,object:this.intersectMesh});if(this.emit("intersect.update",s),s.defaultPrevented){this.hideIntersectMesh();return}if(o){var u=(i=(r=o.face)===null||r===void 0?void 0:r.normal)!==null&&i!==void 0?i:new f.Vector3().copy(a.ray.direction).multiplyScalar(-1),l=u.clone(),c=o.point.clone();this.intersectMesh.position.copy(c);var d=a.ray.origin.distanceTo(c),p=2*Math.tan(.5*this.camera.fov/180*Math.PI),A=Math.max(d*p/10,1);this.intersectMesh.scale.set(A,A,A);var h=c.clone().add(l);if(this.intersectMesh.lookAt(h),Math.abs(u.y)>.99){var v=this.camera.position.clone().sub(c);this.intersectMesh.rotation.z=-Math.atan2(v.z,v.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(U)}else{var a=e.center.delta/2*Math.max(Math.log(this.locationMotion.value.distance),1);if(this.locationMotion.value.distance-a>=so){var o=this.locationMotion.value.distance-a;e.state.distance=o}else{var s=tr(this.cameraMotion.value);s.setLength(a),e.state.offset.add(s),this.modelInScreen==="boundingbox-center"&&e.state.offset.clamp(this.models.bounding.min,this.models.bounding.max)}if(this.emit("gesture.mousewheel",e),e.defaultPrevented)return;this.locationMotion.set({distance:e.state.distance,x:e.state.offset.x,y:e.state.offset.y,z:e.state.offset.z},0).catch(U)}},t.prototype.onTapGesture=function(e){var r=this;this.userAction=e.userAction,this.stopMomentumMovement();var i=e.center.raycaster,a=this.getForwardObserverOrNot(i);if(!a)this.emit("gesture.tap",e);else{var o={longitude:this.camera.pose.longitude,latitude:0},s=O(O({},e.state),{mode:"Panorama",workCode:a.pano.workCode,panoIndex:a.pano.panoIndex,longitude:o.longitude,latitude:o.latitude,offset:a?a.position.clone():new f.Vector3,distance:0});if(e.state=s,this.emit("gesture.tap",e),!e.defaultPrevented&&(this.emit("pano.select",X("pano.select",{prevPano:this.currentPano,state:s,userAction:e.userAction,options:o,progress:0,error:null})),a&&a.active)){var u=this.currentTapId=Ut();this.preloadPano(a.pano).then(function(l){r.currentTapId===u&&r.emit("pano.request",X("pano.request",{userAction:!0,prevPano:r.currentPano,progress:0,state:s,options:o,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,a=i.ray.origin.clone().add(i.ray.direction.clone().setLength(3)),o=1,s=3,u=o,l=this.models.intersectRaycaster(i)[0];if(l&&(a=l.point.clone(),l.distance>(o+s)/2?u=o:u=s),e.state.distance=u,e.state.offset=a,this.emit("gesture.dbltap",e),!e.defaultPrevented){var c={x:r.offset.x,y:r.offset.y,z:r.offset.z,distance:r.distance};this.locationMotion.set(c,360).catch(U),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}(as);function q0(n){return n==null}var yA={type:"move"},H0=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 f.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 f.Group,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new f.Vector3,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new f.Vector3),this._targetRay},n.prototype.getGripSpace=function(){return this._grip===null&&(this._grip=new f.Group,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new f.Vector3,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new f.Vector3),this._grip},n.prototype.dispatchEvent=function(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this},n.prototype.disconnect=function(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this},n.prototype.getAxes=function(){return this._axes},n.prototype.update=function(t,e,r){var i=null,a=null,o=null,s=this._targetRay,u=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(s!==null&&(i=e.getPose(t.targetRaySpace,r),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(yA))),l&&t.hand){o=!0;for(var c=0,d=t.hand.values();c<d.length;c++){var p=d[c],A=e.getJointPose(p,r);if(l.joints[p.jointName]===void 0){var h=new f.Group;h.matrixAutoUpdate=!1,h.visible=!1,l.joints[p.jointName]=h,l.add(h)}var v=l.joints[p.jointName];A!==null&&(v.matrix.fromArray(A.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.jointRadius=A.radius),v.visible=A!==null}var g=l.joints["index-finger-tip"],m=l.joints["thumb-tip"],y=g.position.distanceTo(m.position),b=.02,x=.005;l.inputState.pinching&&y>b+x?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&y<=b-x&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else u!==null&&t.gripSpace&&(a=e.getPose(t.gripSpace,r),a!==null&&(u.matrix.fromArray(a.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),a.linearVelocity?(u.hasLinearVelocity=!0,u.linearVelocity.copy(a.linearVelocity)):u.hasLinearVelocity=!1,a.angularVelocity?(u.hasAngularVelocity=!0,u.angularVelocity.copy(a.angularVelocity)):u.hasAngularVelocity=!1));return s!==null&&(s.visible=i!==null),u!==null&&(u.visible=a!==null),l!==null&&(l.visible=o!==null),this},n}(),bA=1,xA=function(){function n(t,e,r){var i,a,o,s,u;this.isPanorama=(i=r==null?void 0:r.isPanorama)!==null&&i!==void 0?i:!0;var l=navigator.userAgent.toLowerCase(),c;l.includes("pico")?c="Pico":l.includes("oculus")?c="Oculus":c="VP",this.machineType=(a=r==null?void 0:r.machineType)!==null&&a!==void 0?a:c,this.renderer=t,this.gl=e,this.enabled=!1,this.session=null,this.referenceSpaceType=(o=r==null?void 0:r.referenceSpaceType)!==null&&o!==void 0?o:"local-floor",this.referenceSpace=null,this.onSessionStartCallback=(s=r==null?void 0:r.onSessionStart)!==null&&s!==void 0?s:U,this.onSessionEndCallback=(u=r==null?void 0:r.onSessionEnd)!==null&&u!==void 0?u:U,this.controllers=[new H0,new H0],this.inputSourcesMap=new Map,this.cameraVR=new f.ArrayCamera,this.cameraL=new f.PerspectiveCamera,this.cameraR=new f.PerspectiveCamera,this.cameraL.viewport=new f.Vector4,this.cameraR.viewport=new f.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 f.Vector3,this.cameraRPos=new f.Vector3}return n.prototype.getController=function(t){var e=this.controllers[t];return e||console.warn("no controller find"),e.getTargetRaySpace()},n.prototype.getRightController=function(){if(!this.session)return null;var t=this.session.inputSources[0].handedness==="right"?0:1,e=this.controllers[t];return e||console.warn("no controller find"),e.getTargetRaySpace()},n.prototype.getLeftController=function(){if(!this.session)return null;var t=this.session.inputSources[0].handedness==="left"?0:1,e=this.controllers[t];return e||console.warn("no controller find"),e.getTargetRaySpace()},n.prototype.getControllerGrip=function(t){var e=this.controllers[t];return e||console.warn("no controller find"),e.getGripSpace()},n.prototype.getCameras=function(){return{cameraL:this.cameraL,cameraR:this.cameraR,cameraVR:this.cameraVR}},n.prototype.updateCamera=function(t,e){e===null?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.getInverse(t.matrixWorld)},n.prototype.setProjectionFromUnion=function(t,e,r){this.cameraLPos.setFromMatrixPosition(e.matrixWorld),this.cameraRPos.setFromMatrixPosition(r.matrixWorld);var i=this.cameraLPos.distanceTo(this.cameraRPos),a=e.projectionMatrix.elements,o=r.projectionMatrix.elements,s=a[14]/(a[10]-1),u=a[14]/(a[10]+1),l=(a[9]+1)/a[5],c=(a[9]-1)/a[5],d=(a[8]-1)/a[0],p=(o[8]+1)/o[0],A=s*d,h=s*p,v=i/(-d+p),g=v*-d;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(g),t.translateZ(v),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);var m=s+v,y=u+v,b=A-g,x=h+(i-g),w=l*u/y*m,E=c*u/y*m;t.projectionMatrix.makePerspective(b,x,w,E,m,y)},n.prototype.getCamera=function(t){this.cameraVR.near=this.cameraR.near=this.cameraL.near=t.near,this.cameraVR.far=this.cameraR.far=this.cameraL.far=t.far,this.session&&(this.currentDepthNear!==this.cameraVR.near||this.currentDepthFar!==this.cameraVR.far)&&(this.session.updateRenderState({depthNear:this.cameraVR.near,depthFar:this.cameraVR.far}),this.currentDepthNear=this.cameraVR.near,this.currentDepthFar=this.cameraVR.far);var e=t.parent,r=this.cameraVR.cameras;this.updateCamera(this.cameraVR,e);for(var i=0;i<r.length;i++)this.updateCamera(r[i],e);t.matrixWorld.copy(this.cameraVR.matrixWorld);for(var a=t.children,i=0,o=a.length;i<o;i++)a[i].updateMatrixWorld(!0);return r.length===2?this.setProjectionFromUnion(this.cameraVR,this.cameraL,this.cameraR):this.cameraVR.projectionMatrix.copy(this.cameraL.projectionMatrix),this.cameraVR},n.prototype.updateInputSources=function(t){if(!this.session){console.warn("session is lose!");return}for(var e=this.session.inputSources,r=0;r<this.controllers.length;r++)this.inputSourcesMap.set(e[r],this.controllers[r]);for(var r=0;r<t.removed.length;r++){var i=t.removed[r],a=this.inputSourcesMap.get(i);a&&(a.dispatchEvent({type:"disconnected",data:i}),this.inputSourcesMap.delete(i))}for(var r=0;r<t.added.length;r++){var i=t.added[r],a=this.inputSourcesMap.get(i);a&&a.dispatchEvent({type:"connected",data:i})}},n.prototype.onSessionEvent=function(t){var e=this.inputSourcesMap.get(t.inputSource);e&&e.dispatchEvent({type:t.type})},n.prototype.onSessionEnd=function(){this.inputSourcesMap.forEach(function(t,e){t.disconnect(e)}),this.inputSourcesMap.clear(),this.renderer.setFramebuffer(null),this.renderer.setRenderTarget(this.renderer.getRenderTarget()),this.isPresenting=!1,this.session=null,Et.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:bA};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({baseLayer:new XRWebGLLayer(e.session,e.gl,i)});break;default:e.machineType;break}e.session.requestReferenceSpace(e.referenceSpaceType).then(function(a){e.onRequestReferenceSpace(a)}),e.session.addEventListener("inputsourceschange",function(a){e.updateInputSources(a)})})}},n}(),fs=function(n){ue(t,n);function t(){var e=n.call(this)||this;e.type="LineSegmentsGeometry";var r=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],i=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],a=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];return e.setIndex(a),e.setAttribute("position",new f.Float32BufferAttribute(r,3)),e.setAttribute("uv",new f.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 f.InstancedInterleavedBuffer(r,6,1);return this.setAttribute("instanceStart",new f.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceEnd",new f.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 f.InstancedInterleavedBuffer(r,6,1);return this.setAttribute("instanceColorStart",new f.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceColorEnd",new f.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 f.WireframeGeometry(e.geometry)),this},t.prototype.fromLineSegments=function(e){var r=e.geometry;if(r instanceof f.Geometry){var i=new f.BufferGeometry().fromGeometry(r);this.setPositions(i.attributes.position.array)}else r instanceof f.BufferGeometry&&this.setPositions(r.attributes.position.array);return this},t.prototype.computeBoundingBox=function(){this.boundingBox===null&&(this.boundingBox=new f.Box3);var e=this.attributes.instanceStart,r=this.attributes.instanceEnd;if(e!==void 0&&r!==void 0){var i=new f.Box3;this.boundingBox.setFromBufferAttribute(e),i.setFromBufferAttribute(r),this.boundingBox.union(i)}},t.prototype.computeBoundingSphere=function(){this.boundingSphere===null&&(this.boundingSphere=new f.Sphere),this.boundingBox===null&&this.computeBoundingBox();var e=this.attributes.instanceStart,r=this.attributes.instanceEnd;if(e!==void 0&&r!==void 0){var i=this.boundingSphere.center;this.boundingBox.getCenter(i);for(var a=0,o=new f.Vector3,s=0,u=e.count;s<u;s++)o.fromBufferAttribute(e,s),a=Math.max(a,i.distanceToSquared(o)),o.fromBufferAttribute(r,s),a=Math.max(a,i.distanceToSquared(o));this.boundingSphere.radius=Math.sqrt(a),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}},t.prototype.toJSON=function(){},t}(f.InstancedBufferGeometry);Object.assign(fs.prototype,{isLineSegmentsGeometry:!0});var uo={uniforms:f.UniformsUtils.merge([f.UniformsLib.common,f.UniformsLib.fog,{linewidth:{value:1},resolution:{value:new f.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1},opacity:{value:1}}]),vertexShader:`
|
|
1970
|
+
b-J-Htyl]|vv|{-J-}|wrpv|{Znv\x07-7-z|qrycvrZnv\x07-7-rpA5}|vv|{9>;=6H\f`);var vA=function(n){ue(t,n);function t(e){var r=n.call(this,{vertexShader:pA,fragmentShader:hA})||this;return r.uniforms={uDepthMap:z0("t",null),uWeightMap:z0("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}},Ht([U0("uDepthMap"),Gt("design:type",Number)],t.prototype,"uDepthMap",void 0),Ht([U0("uWeightMap"),Gt("design:type",Number)],t.prototype,"uWeightMap",void 0),t}(f.RawShaderMaterial);function z0(n,t){return{type:n,value:t}}function U0(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 mA=new f.OrthographicCamera(-1,1,1,-1,0,1),cs=new f.BufferGeometry;cs.setAttribute("position",new f.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));cs.setAttribute("uv",new f.Float32BufferAttribute([0,2,0,0,2,0],2));var Gl=new f.Mesh(cs),Kl=new f.Scene;Kl.add(Gl);var AA=function(n){ue(t,n);function t(e,r,i,a){var o=n.call(this,e,r,i,a)||this;return o.sharedV2=new f.Vector2,o.renderer=e,o.material=new vA,o.camera=i,Gl.material=o.material,o}return t.prototype.render=function(e){this.models.setMaterial({useHQDepth:!0,useHQWeight:!1}),this.models.update(this.renderer,this.camera,"Mapview"),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0,this.renderer.setRenderTarget(e[0]),this.renderer.render(this.scene,this.camera),this.models.setMaterial({useHQWeight:!0,useHQDepth:!1}),this.models.update(this.renderer,this.camera,"Mapview"),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.renderer.setClearColor(new f.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 f.Color(0,0,0)),this.renderer.setClearAlpha(1),this.renderer.setRenderTarget(e[2]),this.renderer.render(Kl,mA)},t.prototype.dispose=function(){this.copyPass.dispose()},t}(os),oo=.5,so=.5,Q0=Math.PI/7,gA=function(n){ue(t,n);function t(e){var r=this,i,a=t.parseArgs(e);return r=n.call(this,a)||this,r.mode="Mapview",r.defaultLongitude=a.defaultLongitude,r.defaultLatitude=a.defaultLatitude,r.defaultDistance=a.defaultDistance,r.maxLatitude=a.maxLatitude,r.minLatitude=a.minLatitude,r.cameraType=a.cameraType,r.modelInScreen=a.modelInScreen,r.locationMotion=new Re({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 Re({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new Re({perspToOrtho:r.camera.perspToOrtho.x}),r.intersectMeshCreator=a.intersectMeshCreator,r.intersectMesh=r.intersectMeshCreator(),r.intersectMesh.name="intersect",r.intersectMesh.visible=!1,r.currentTapId=null,r.helper.add(r.intersectMesh),r.edlTarget=new f.WebGLRenderTarget(1024,1024,{generateMipmaps:!1,minFilter:f.NearestFilter,magFilter:f.NearestFilter,format:f.RGBAFormat,type:f.FloatType,depthTexture:new f.DepthTexture(1024,1024,f.UnsignedIntType)}),r.edlEffect=new dA(r.renderer,r.modelScene,r.camera,r.models),r.hqEffect=new AA(r.renderer,r.modelScene,r.camera,r.models),r}return t.parseArgs=function(e){var r,i,a,o,s,u,l,c;if(e instanceof t)return e;var d=n.parseArgs.call(this,e);return O(O({},d),{defaultLongitude:(r=e.defaultLongitude)!==null&&r!==void 0?r:Math.PI/4,defaultLatitude:(i=e.defaultLatitude)!==null&&i!==void 0?i:Math.PI/4,defaultDistance:(a=e.defaultDistance)!==null&&a!==void 0?a:150,maxLatitude:(o=e.maxLatitude)!==null&&o!==void 0?o:+Math.PI/2,minLatitude:(s=e.minLatitude)!==null&&s!==void 0?s:0,cameraType:(u=e.cameraType)!==null&&u!==void 0?u:"auto",modelInScreen:(l=e.modelInScreen)!==null&&l!==void 0?l:"boundingbox-center",intersectMeshCreator:(c=e.intersectMeshCreator)!==null&&c!==void 0?c:function(){return new ha}})},t.distanceFromModel=function(e,r,i){var a=e.bounding,o=Math.pow(Math.pow(a.max.x-a.min.x+1,2)+Math.pow(a.max.y-a.min.y+1,2)+Math.pow(a.max.z-a.min.z+1,2),1/2),s=o/2/Math.tan(Math.PI*r/360);return i<1&&(s=s/i),isNaN(s)?o:s},t.initAnimationEndState=function(e){var r,i,a,o,s,u,l,c=this.parseArgs(e),d=c.works,p=c.models,A=e.initial,h=A.state,v=A.currentState,g=typeof h.panoIndex=="number"?{workCode:(a=(r=h.workCode)!==null&&r!==void 0?r:(i=c.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:h.panoIndex}:{workCode:v.workCode,panoIndex:v.panoIndex},m=d.getResolvedObserver(g),y=(o=h.fov)!==null&&o!==void 0?o:60,b=ce((s=h.latitude)!==null&&s!==void 0?s:Po(v.mode)?v.latitude:c.defaultLatitude,c.minLatitude,c.maxLatitude),x=t.distanceFromModel(c.models,y,c.camera.aspect),w=new f.Vector3,E=(u=h.distance)!==null&&u!==void 0?u:Math.min(c.defaultDistance,x),S=(l=h.longitude)!==null&&l!==void 0?l:Po(v.mode)?v.longitude:c.defaultLongitude;return h.offset?w.copy(h.offset):c.defaultDistance<x&&m?(w.copy(m.position),h.longitude===void 0&&(S=v.longitude)):(p.bounding.getCenter(w),E=x),O(O({},g),{mode:"Mapview",longitude:S,latitude:b,fov:y,offset:w,distance:E})},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.locationMotion.dispose(),delete this.panState,this.intersectMesh.dispose(),this.helper.remove(this.intersectMesh)},t.prototype.isReady=function(){return this.locationMotion.ended===!1?!1:n.prototype.isReady.call(this)},t.prototype.updateWork=function(e,r,i,a){this.userAction=a,this.works=e;var o=t.initAnimationEndState(O(O({},this),{initial:{currentState:O(O({},this.currentPano),this.camera.pose),duration:i.duration,effect:i.effect,state:r,userAction:a}}));this.currentPano={workCode:o.workCode,panoIndex:o.panoIndex};var s={longitude:o.longitude,latitude:o.latitude,fov:o.fov},u={x:o.offset.x,y:o.offset.y,z:o.offset.z,distance:o.distance,orthoDistance:o.distance};return this.locationMotion.set(u,i.duration).catch(U),this.cameraMotion.set(s,i.duration).catch(U),!0},t.prototype.updateModel=function(e){n.prototype.updateModel.call(this,e);var r=e.bounding.getCenter(new f.Vector3),i=t.distanceFromModel(e,this.cameraMotion.value.fov,this.camera.aspect);this.updateCamera({offset:r,distance:i},0,!0)},t.prototype.updateCamera=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();var o={},s={};return e.distance!==void 0&&(o.distance=e.distance),e.offset!==void 0&&(o.x=e.offset.x,o.y=e.offset.y,o.z=e.offset.z),e.longitude!==void 0&&(s.longitude=e.longitude),e.latitude!==void 0&&(s.latitude=e.latitude),e.fov!==void 0&&(s.fov=e.fov),a.locationMotion.set(o,r).catch(U),a.cameraMotion.set(s,r).catch(U)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();for(var o=[],s=[],u=0,l=e;u<l.length;u++){var c=l[u];o.push({key:c.key,progress:c.progress,value:{distance:c.value.distance,x:c.value.offset.x,y:c.value.offset.x,z:c.value.offset.x}}),s.push({key:c.key,progress:c.progress,value:{longitude:c.value.longitude,latitude:c.value.latitude,fov:c.value.fov}})}return a.locationMotion.setKeyframes(o,r).catch(U),a.cameraMotion.setKeyframes(e,r)})},t.prototype.updateTime=function(e,r){if(!this.destroyed){var i={},a={};this.locationMotion.ended||(this.locationMotion.update(e),a.distance=this.locationMotion.value.distance,a.offset=new f.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z)),this.cameraMotion.ended||(this.cameraMotion.update(e),a.longitude=this.cameraMotion.value.longitude,a.latitude=this.cameraMotion.value.latitude,a.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended||(this.modelAlphaMotion.update(e),i.modelAlpha=this.modelAlphaMotion.value.modelAlpha);var o=0;this.cameraType==="auto"?o=Math.abs(Math.PI/2-this.cameraMotion.value.latitude)<.02||Math.abs(-Math.PI/2-this.cameraMotion.value.latitude)<.02?1:0:this.cameraType==="perspective"?o=0:this.cameraType==="orthographic"&&(o=1),this.perspToOrthoMotion.getTargetKeyframe().value.perspToOrtho!==o&&this.perspToOrthoMotion.set({perspToOrtho:o},500).catch(U),this.perspToOrthoMotion.ended||(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(ce(this.perspToOrthoMotion.value.perspToOrtho,0,1))),ar(i)||this.models.setMaterial(i),ar(a)||this.setCamera(a)}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(ve())[1],r=this.locationMotion.getKeyFrameSegment(ve())[1];return O(O({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,distance:r.value.distance,offset:new f.Vector3(r.value.x,r.value.y,r.value.z)})},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var i=e.initial;i.state,i.currentState;var a=i.duration,o=i.userAction;e.userAction=o;var s=t.initAnimationEndState(e),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},c={modelAlpha:1},d={perspToOrtho:0};e.emit("initAnimation.start",X("initAnimation.start",{state:s,userAction:e.userAction})),e.perspToOrthoMotion.set(d,a).catch(U),e.modelAlphaMotion.set(c,a/3).catch(U),e.cameraMotion.set(u,a).catch(U),e.locationMotion.set(l,a).then(function(){e.emit("initAnimation.end",X("initAnimation.end",{state:s,userAction:e.userAction}))},function(p){var A=O(O(O({},e.currentPano),{mode:e.mode}),tt(e.camera.pose));e.emit("initAnimation.end",X("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 a=this.works.resolvedObservers.filter(function(l){for(var c,d=0,p=r.models;d<p.length;d++){var A=p[d];if(A.visible&&((c=A.work)===null||c===void 0?void 0:c.workCode)===l.work.workCode)return!0}return!1}),o=Ir(a,function(l){return l.standingPosition.distanceTo(i.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 f.Vector2);return{longitude:-2*e.x/(r.x*this.scissor.width),latitude:2*e.y/(r.y*this.scissor.height)}},t.prototype.requestMomentumMovement=function(e,r,i,a){var o=this;if(this.inMomentumMovement!==null){for(var s=O({},i),u={longitude:0,latitude:0,x:0,y:0,z:0},l=0;l<a;l++)s.longitude*=.996,s.latitude*=.996*.998,s.x*=.99,s.y*=.99,s.z*=.99,u.longitude+=s.longitude,u.latitude+=s.latitude,u.x+=s.x,u.y+=s.y,u.z+=s.z;var c=cn(this.cameraMotion.value.longitude+u.longitude),d=ce(this.cameraMotion.value.latitude+u.latitude,this.minLatitude,this.maxLatitude),p=new f.Vector3(this.locationMotion.value.x+u.x,this.locationMotion.value.y+u.y,this.locationMotion.value.z+u.z),A=O(O({},this.currentPano),{mode:this.mode,longitude:c,latitude:d,offset:p,fov:this.cameraMotion.value.fov,distance:this.camera.pose.distance}),h=!(Math.abs(s.longitude)>1e-4||Math.abs(s.latitude)>1e-4||Math.abs(s.x)>1e-4||Math.abs(s.y)>1e-4||Math.abs(s.z)>1e-4),v=X("gesture.momentum",O(O({},e),{isFirst:r,isFinal:h,state:A}));if(this.inMomentumMovement.event=v,this.emit("gesture.momentum",v),e.defaultPrevented){this.inMomentumMovement=null;return}this.inMomentumMovement&&(this.cameraMotion.set({longitude:c,latitude:d},0).catch(U),this.locationMotion.set({x:A.offset.x,y:A.offset.y,z:A.offset.z},0).catch(U),h?this.inMomentumMovement=null:Et.shared.add(function(g,m){o.requestMomentumMovement(e,!1,s,m|0)},!0,1))}},t.prototype.fixFinalState=function(e){if(this.perspToOrthoMotion.getTargetKeyframe().value.perspToOrtho!==1){var r=tr(e,new f.Vector3),i=new f.Vector3().copy(e.offset).sub(r.clone().multiplyScalar(e.distance)),a=new f.Raycaster(i,r);a.params.Points={threshold:.1},a.near=oo;var o;if(a.ray.direction.y<-.3&&(o=this.models.intersectRaycaster(a).filter(function(d){var p,A=(p=d.face)===null||p===void 0?void 0:p.normal;return A&&a.ray.direction.dot(A)>=0?!1:d.distance>so+a.near})[0],!o)){var s=new f.Plane(new f.Vector3(0,1,0),-this.models.bounding.min.y),u=a.ray.intersectPlane(s,new f.Vector3);if(u){var l=u.distanceTo(a.ray.origin);l<1e4&&l>=a.near&&(o={distance:l,floor:0,point:u,object:this.scene,face:null})}}if(!o){var c=Math.max(e.distance,3);o={distance:c,floor:0,point:a.ray.direction.clone().setLength(c).add(a.ray.origin),object:this.scene,face:null}}o&&(e.distance=ce(o.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,a=0;e.pointerType==="mouse"&&(a=e.srcEvent.buttons),i&&a===0&&i.buttons!==0&&(a=i.buttons);var o=i==null?void 0:i.target;if(!o){var s=this.relativeClientPosition(e.center),u=new f.Raycaster;u.params.Points={threshold:.1},u.setFromCamera(s,this.camera),u.near=oo,o=new f.Vector3().copy(u.ray.direction).multiplyScalar(3).add(u.ray.origin);var l=this.models.intersectRaycaster(u)[0];if(!l&&u.ray.direction.y<-.3){var c=new f.Plane(new f.Vector3(0,1,0),0),d=u.ray.intersectPlane(c,new f.Vector3);if(d){var p=d.distanceTo(u.ray.origin);p<1e4&&p>=u.near&&(l={distance:p,floor:0,point:d,object:this.scene})}}if(l)o.copy(l.point);else{var A=new f.Vector3().copy(this.camera.pose.offset).sub(this.camera.position).normalize(),c=new f.Plane().setFromNormalAndCoplanarPoint(A,this.camera.pose.offset);u.ray.intersectPlane(c,o)}}if(e.isFinal?delete this.panState:this.panState={target:o,buttons:a,pointerLength:r,x:e.center.x,y:e.center.y},!(typeof i=="undefined"||i.pointerLength!==r)){var h=r>1||a===2;if(h){var v={x:e.center.x-i.x,y:e.center.y-i.y},g=new f.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),m=tr(this.cameraMotion.value).setLength(this.locationMotion.value.distance).add(g),y=new f.Vector3().copy(m).sub(i.target).length();y*=Math.tan(this.camera.pose.fov/2*Math.PI/180);var b=this.renderer.getSize(new f.Vector2),x=2*v.x*y/b.y,w=2*v.y*y/b.y,E=new f.Vector3;if(E.setFromMatrixColumn(this.camera.matrix,0),E.multiplyScalar(-x),g.add(E),this.camera.pose.latitude<Q0?E.setFromMatrixColumn(this.camera.matrix,1):(E.setFromMatrixColumn(this.camera.matrix,0),E.crossVectors(this.camera.up,E)),E.multiplyScalar(w),g.add(E),this.modelInScreen==="boundingbox-center"){var S=this.models.bounding.clone();S.expandByScalar(this.camera.pose.distance),g.clamp(S.min,S.max)}var C=O(O({},this.currentPano),{mode:this.mode,longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:g,distance:this.camera.pose.distance});if(e.state=C,this.emit("gesture.pan",e),e.defaultPrevented)return;if(this.locationMotion.set({x:C.offset.x,y:C.offset.y,z:C.offset.z},0).catch(U),e.isFinal&&(this.fixFinalState(C),Object.assign(e,{__fixFinalState:!0}),this.locationMotion.set({distance:C.distance,x:C.offset.x,y:C.offset.y,z:C.offset.z},0).catch(U)),e.isFinal){var R=this.renderer.getSize(new f.Vector2),B=2*e.velocityX*y/R.y,M=2*e.velocityY*y/R.y,I=new f.Vector3,L=new f.Vector3;I.setFromMatrixColumn(this.camera.matrix,0),I.multiplyScalar(-B),L.add(I),this.camera.pose.latitude<Q0?I.setFromMatrixColumn(this.camera.matrix,1):(I.setFromMatrixColumn(this.camera.matrix,0),I.crossVectors(this.camera.up,I)),I.multiplyScalar(M),L.add(I),this.inMomentumMovement={uuid:Ut()},this.requestMomentumMovement(e,!0,{longitude:0,latitude:0,x:L.x,y:L.y,z:L.z},0)}}else{var v={x:e.center.x-i.x,y:e.center.y-i.y},T=this.coordinatesForOffset(v),F=cn(this.cameraMotion.value.longitude+T.longitude),D=ce(this.cameraMotion.value.latitude+T.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 C=O(O({},this.currentPano),{mode:this.mode,longitude:F,latitude:D,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=C,this.emit("gesture.pan",e),e.defaultPrevented)return;if(e.isFinal?this.locationMotion.set({distance:C.distance,x:C.offset.x,y:C.offset.y,z:C.offset.z},0).catch(U):this.cameraMotion.set({longitude:C.longitude,latitude:C.latitude},0).catch(U),e.isFinal){var V=e.velocityX,z=e.velocityY;this.inMomentumMovement={uuid:Ut()},this.requestMomentumMovement(e,!0,O(O({},this.coordinatesForOffset({x:V,y:z})),{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 a=this.models.bounding.getCenter(new f.Vector3),o=t.distanceFromModel(this.models,this.cameraMotion.value.fov,this.camera.aspect),s=ce(i/e.scale,so,1/0),u=e.state.offset.clone().sub(tr(e.state).setLength(s)),l=this.models.bounding.containsPoint(u),c;if(!l&&this.pinchState&&this.pinchState.scale>e.scale&&a.distanceTo(u)>o?c=e.state.distance:(c=s,this.pinchState&&(this.pinchState.scale=e.scale)),e.state.distance=c,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.locationMotion.set({distance:e.state.distance},0).catch(U),e.pointerType!=="mouse"&&(e.type="gesture.pan",this.onPanGesture(e)),e.isFinal)){if(!("__fixFinalState"in e)){var d=e.state;this.fixFinalState(e.state);var p={x:d.offset.x,y:d.offset.y,z:d.offset.z,distance:d.distance};this.locationMotion.set(p,0).catch(U)}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 a=e.center.raycaster;if(a.near=oo,a.far=500,e.isFinal&&this.intersectMesh.parent&&this.intersectMesh.visible===!0){this.hideIntersectMesh();return}var o=this.models.intersectRaycaster(a)[0],s=X("intersect.update",{raycaster:a,intersection:o!=null?o:null,object:this.intersectMesh});if(this.emit("intersect.update",s),s.defaultPrevented){this.hideIntersectMesh();return}if(o){var u=(i=(r=o.face)===null||r===void 0?void 0:r.normal)!==null&&i!==void 0?i:new f.Vector3().copy(a.ray.direction).multiplyScalar(-1),l=u.clone(),c=o.point.clone();this.intersectMesh.position.copy(c);var d=a.ray.origin.distanceTo(c),p=2*Math.tan(.5*this.camera.fov/180*Math.PI),A=Math.max(d*p/10,1);this.intersectMesh.scale.set(A,A,A);var h=c.clone().add(l);if(this.intersectMesh.lookAt(h),Math.abs(u.y)>.99){var v=this.camera.position.clone().sub(c);this.intersectMesh.rotation.z=-Math.atan2(v.z,v.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(U)}else{var a=e.center.delta/2*Math.max(Math.log(this.locationMotion.value.distance),1);if(this.locationMotion.value.distance-a>=so){var o=this.locationMotion.value.distance-a;e.state.distance=o}else{var s=tr(this.cameraMotion.value);s.setLength(a),e.state.offset.add(s),this.modelInScreen==="boundingbox-center"&&e.state.offset.clamp(this.models.bounding.min,this.models.bounding.max)}if(this.emit("gesture.mousewheel",e),e.defaultPrevented)return;this.locationMotion.set({distance:e.state.distance,x:e.state.offset.x,y:e.state.offset.y,z:e.state.offset.z},0).catch(U)}},t.prototype.onTapGesture=function(e){var r=this;this.userAction=e.userAction,this.stopMomentumMovement();var i=e.center.raycaster,a=this.getForwardObserverOrNot(i);if(!a)this.emit("gesture.tap",e);else{var o={longitude:this.camera.pose.longitude,latitude:0},s=O(O({},e.state),{mode:"Panorama",workCode:a.pano.workCode,panoIndex:a.pano.panoIndex,longitude:o.longitude,latitude:o.latitude,offset:a?a.position.clone():new f.Vector3,distance:0});if(e.state=s,this.emit("gesture.tap",e),!e.defaultPrevented&&(this.emit("pano.select",X("pano.select",{prevPano:this.currentPano,state:s,userAction:e.userAction,options:o,progress:0,error:null})),a&&a.active)){var u=this.currentTapId=Ut();this.preloadPano(a.pano).then(function(l){r.currentTapId===u&&r.emit("pano.request",X("pano.request",{userAction:!0,prevPano:r.currentPano,progress:0,state:s,options:o,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,a=i.ray.origin.clone().add(i.ray.direction.clone().setLength(3)),o=1,s=3,u=o,l=this.models.intersectRaycaster(i)[0];if(l&&(a=l.point.clone(),l.distance>(o+s)/2?u=o:u=s),e.state.distance=u,e.state.offset=a,this.emit("gesture.dbltap",e),!e.defaultPrevented){var c={x:r.offset.x,y:r.offset.y,z:r.offset.z,distance:r.distance};this.locationMotion.set(c,360).catch(U),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}(as);function q0(n){return n==null}var yA={type:"move"},H0=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 f.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 f.Group,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new f.Vector3,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new f.Vector3),this._targetRay},n.prototype.getGripSpace=function(){return this._grip===null&&(this._grip=new f.Group,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new f.Vector3,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new f.Vector3),this._grip},n.prototype.dispatchEvent=function(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this},n.prototype.disconnect=function(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this},n.prototype.getAxes=function(){return this._axes},n.prototype.update=function(t,e,r){var i=null,a=null,o=null,s=this._targetRay,u=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(s!==null&&(i=e.getPose(t.targetRaySpace,r),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(yA))),l&&t.hand){o=!0;for(var c=0,d=t.hand.values();c<d.length;c++){var p=d[c],A=e.getJointPose(p,r);if(l.joints[p.jointName]===void 0){var h=new f.Group;h.matrixAutoUpdate=!1,h.visible=!1,l.joints[p.jointName]=h,l.add(h)}var v=l.joints[p.jointName];A!==null&&(v.matrix.fromArray(A.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.jointRadius=A.radius),v.visible=A!==null}var g=l.joints["index-finger-tip"],m=l.joints["thumb-tip"],y=g.position.distanceTo(m.position),b=.02,x=.005;l.inputState.pinching&&y>b+x?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&y<=b-x&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else u!==null&&t.gripSpace&&(a=e.getPose(t.gripSpace,r),a!==null&&(u.matrix.fromArray(a.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),a.linearVelocity?(u.hasLinearVelocity=!0,u.linearVelocity.copy(a.linearVelocity)):u.hasLinearVelocity=!1,a.angularVelocity?(u.hasAngularVelocity=!0,u.angularVelocity.copy(a.angularVelocity)):u.hasAngularVelocity=!1));return s!==null&&(s.visible=i!==null),u!==null&&(u.visible=a!==null),l!==null&&(l.visible=o!==null),this},n}(),bA=1,xA=function(){function n(t,e,r){var i,a,o,s,u;this.isPanorama=(i=r==null?void 0:r.isPanorama)!==null&&i!==void 0?i:!0;var l=navigator.userAgent.toLowerCase(),c;l.includes("pico")?c="Pico":l.includes("oculus")?c="Oculus":c="VP",this.machineType=(a=r==null?void 0:r.machineType)!==null&&a!==void 0?a:c,this.renderer=t,this.gl=e,this.enabled=!1,this.session=null,this.referenceSpaceType=(o=r==null?void 0:r.referenceSpaceType)!==null&&o!==void 0?o:"local-floor",this.referenceSpace=null,this.onSessionStartCallback=(s=r==null?void 0:r.onSessionStart)!==null&&s!==void 0?s:U,this.onSessionEndCallback=(u=r==null?void 0:r.onSessionEnd)!==null&&u!==void 0?u:U,this.controllers=[new H0,new H0],this.inputSourcesMap=new Map,this.cameraVR=new f.ArrayCamera,this.cameraL=new f.PerspectiveCamera,this.cameraR=new f.PerspectiveCamera,this.cameraL.viewport=new f.Vector4,this.cameraR.viewport=new f.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 f.Vector3,this.cameraRPos=new f.Vector3}return n.prototype.getController=function(t){var e=this.controllers[t];return e||console.warn("no controller find"),e.getTargetRaySpace()},n.prototype.getRightController=function(){if(!this.session)return null;var t=this.session.inputSources[0].handedness==="right"?0:1,e=this.controllers[t];return e||console.warn("no controller find"),e.getTargetRaySpace()},n.prototype.getLeftController=function(){if(!this.session)return null;var t=this.session.inputSources[0].handedness==="left"?0:1,e=this.controllers[t];return e||console.warn("no controller find"),e.getTargetRaySpace()},n.prototype.getControllerGrip=function(t){var e=this.controllers[t];return e||console.warn("no controller find"),e.getGripSpace()},n.prototype.getCameras=function(){return{cameraL:this.cameraL,cameraR:this.cameraR,cameraVR:this.cameraVR}},n.prototype.updateCamera=function(t,e){e===null?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.getInverse(t.matrixWorld)},n.prototype.setProjectionFromUnion=function(t,e,r){this.cameraLPos.setFromMatrixPosition(e.matrixWorld),this.cameraRPos.setFromMatrixPosition(r.matrixWorld);var i=this.cameraLPos.distanceTo(this.cameraRPos),a=e.projectionMatrix.elements,o=r.projectionMatrix.elements,s=a[14]/(a[10]-1),u=a[14]/(a[10]+1),l=(a[9]+1)/a[5],c=(a[9]-1)/a[5],d=(a[8]-1)/a[0],p=(o[8]+1)/o[0],A=s*d,h=s*p,v=i/(-d+p),g=v*-d;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(g),t.translateZ(v),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);var m=s+v,y=u+v,b=A-g,x=h+(i-g),w=l*u/y*m,E=c*u/y*m;t.projectionMatrix.makePerspective(b,x,w,E,m,y)},n.prototype.getCamera=function(t){this.cameraVR.near=this.cameraR.near=this.cameraL.near=t.near,this.cameraVR.far=this.cameraR.far=this.cameraL.far=t.far,this.session&&(this.currentDepthNear!==this.cameraVR.near||this.currentDepthFar!==this.cameraVR.far)&&(this.session.updateRenderState({depthNear:this.cameraVR.near,depthFar:this.cameraVR.far}),this.currentDepthNear=this.cameraVR.near,this.currentDepthFar=this.cameraVR.far);var e=t.parent,r=this.cameraVR.cameras;this.updateCamera(this.cameraVR,e);for(var i=0;i<r.length;i++)this.updateCamera(r[i],e);t.matrixWorld.copy(this.cameraVR.matrixWorld);for(var a=t.children,i=0,o=a.length;i<o;i++)a[i].updateMatrixWorld(!0);return r.length===2?this.setProjectionFromUnion(this.cameraVR,this.cameraL,this.cameraR):this.cameraVR.projectionMatrix.copy(this.cameraL.projectionMatrix),this.cameraVR},n.prototype.updateInputSources=function(t){if(!this.session){console.warn("session is lose!");return}for(var e=this.session.inputSources,r=0;r<this.controllers.length;r++)this.inputSourcesMap.set(e[r],this.controllers[r]);for(var r=0;r<t.removed.length;r++){var i=t.removed[r],a=this.inputSourcesMap.get(i);a&&(a.dispatchEvent({type:"disconnected",data:i}),this.inputSourcesMap.delete(i))}for(var r=0;r<t.added.length;r++){var i=t.added[r],a=this.inputSourcesMap.get(i);a&&a.dispatchEvent({type:"connected",data:i})}},n.prototype.onSessionEvent=function(t){var e=this.inputSourcesMap.get(t.inputSource);e&&e.dispatchEvent({type:t.type})},n.prototype.onSessionEnd=function(){this.inputSourcesMap.forEach(function(t,e){t.disconnect(e)}),this.inputSourcesMap.clear(),this.renderer.setFramebuffer(null),this.renderer.setRenderTarget(this.renderer.getRenderTarget()),this.isPresenting=!1,this.session=null,Et.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:bA};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({baseLayer:new XRWebGLLayer(e.session,e.gl,i)});break;default:e.machineType;break}e.session.requestReferenceSpace(e.referenceSpaceType).then(function(a){e.onRequestReferenceSpace(a)}),e.session.addEventListener("inputsourceschange",function(a){e.updateInputSources(a)})})}},n}(),fs=function(n){ue(t,n);function t(){var e=n.call(this)||this;e.type="LineSegmentsGeometry";var r=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],i=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],a=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];return e.setIndex(a),e.setAttribute("position",new f.Float32BufferAttribute(r,3)),e.setAttribute("uv",new f.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 f.InstancedInterleavedBuffer(r,6,1);return this.setAttribute("instanceStart",new f.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceEnd",new f.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 f.InstancedInterleavedBuffer(r,6,1);return this.setAttribute("instanceColorStart",new f.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceColorEnd",new f.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 f.WireframeGeometry(e.geometry)),this},t.prototype.fromLineSegments=function(e){var r=e.geometry;if(r instanceof f.Geometry){var i=new f.BufferGeometry().fromGeometry(r);this.setPositions(i.attributes.position.array)}else r instanceof f.BufferGeometry&&this.setPositions(r.attributes.position.array);return this},t.prototype.computeBoundingBox=function(){this.boundingBox===null&&(this.boundingBox=new f.Box3);var e=this.attributes.instanceStart,r=this.attributes.instanceEnd;if(e!==void 0&&r!==void 0){var i=new f.Box3;this.boundingBox.setFromBufferAttribute(e),i.setFromBufferAttribute(r),this.boundingBox.union(i)}},t.prototype.computeBoundingSphere=function(){this.boundingSphere===null&&(this.boundingSphere=new f.Sphere),this.boundingBox===null&&this.computeBoundingBox();var e=this.attributes.instanceStart,r=this.attributes.instanceEnd;if(e!==void 0&&r!==void 0){var i=this.boundingSphere.center;this.boundingBox.getCenter(i);for(var a=0,o=new f.Vector3,s=0,u=e.count;s<u;s++)o.fromBufferAttribute(e,s),a=Math.max(a,i.distanceToSquared(o)),o.fromBufferAttribute(r,s),a=Math.max(a,i.distanceToSquared(o));this.boundingSphere.radius=Math.sqrt(a),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}},t.prototype.toJSON=function(){},t}(f.InstancedBufferGeometry);Object.assign(fs.prototype,{isLineSegmentsGeometry:!0});var uo={uniforms:f.UniformsUtils.merge([f.UniformsLib.common,f.UniformsLib.fog,{linewidth:{value:1},resolution:{value:new f.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1},opacity:{value:1}}]),vertexShader:`
|
|
1971
1971
|
#include <common>
|
|
1972
1972
|
#include <color_pars_vertex>
|
|
1973
1973
|
#include <fog_pars_vertex>
|
|
@@ -2166,7 +2166,7 @@ void main() {
|
|
|
2166
2166
|
#include <premultiplied_alpha_fragment>
|
|
2167
2167
|
|
|
2168
2168
|
}
|
|
2169
|
-
`},ds=function(n){ue(t,n);function t(e){var r=n.call(this,{uniforms:f.UniformsUtils.clone(uo.uniforms),vertexShader:uo.vertexShader,fragmentShader:uo.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}(f.ShaderMaterial);Object.assign(ds.prototype,{isLineMaterial:!0});var _l=function(n){ue(t,n);function t(e,r){var i=n.call(this)||this;return i.type="LineSegments2",i.geometry=e!==void 0?e:new fs,i.material=r!==void 0?r:new ds({color:Math.random()*16777215}),i}return t.prototype.computeLineDistances=function(){for(var e=this.geometry,r=e.attributes.instanceStart,i=e.attributes.instanceEnd,a=new Float32Array(2*r.count),o=new f.Vector3,s=new f.Vector3,u=0,l=0,c=r.count;u<c;u++,l+=2)o.fromBufferAttribute(r,u),s.fromBufferAttribute(i,u),a[l]=l===0?0:a[l-1],a[l+1]=a[l]+o.distanceTo(s);var d=new f.InstancedInterleavedBuffer(a,2,1);return e.setAttribute("instanceDistanceStart",new f.InterleavedBufferAttribute(d,1,0)),e.setAttribute("instanceDistanceEnd",new f.InterleavedBufferAttribute(d,1,1)),this},t.prototype.raycast=function(e,r){e.camera===null&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var i=e.ray,a=e.camera,o=a.projectionMatrix,s=this.geometry,u=this.material,l=u.resolution,c=u.linewidth,d=s.attributes.instanceStart,p=s.attributes.instanceEnd,A=new f.Vector4,h=new f.Vector4,v=new f.Vector4,g=new f.Vector3,m=new f.Matrix4,y=new f.Line3,b=new f.Vector3;i.at(1,v),v.w=1,v.applyMatrix4(a.matrixWorldInverse),v.applyMatrix4(o),v.multiplyScalar(1/v.w),v.x*=l.x/2,v.y*=l.y/2,v.z=0,g.copy(v);var x=this.matrixWorld;m.multiplyMatrices(a.matrixWorldInverse,x);for(var w=0,E=d.count;w<E;w++){A.fromBufferAttribute(d,w),h.fromBufferAttribute(p,w),A.w=1,h.w=1,A.applyMatrix4(m),h.applyMatrix4(m),A.applyMatrix4(o),h.applyMatrix4(o),A.multiplyScalar(1/A.w),h.multiplyScalar(1/h.w);var S=A.z<-1&&h.z<-1,C=A.z>1&&h.z>1;if(!(S||C)){A.x*=l.x/2,A.y*=l.y/2,h.x*=l.x/2,h.y*=l.y/2,y.start.copy(A),y.start.z=0,y.end.copy(h),y.end.z=0;var R=y.closestPointToPointParameter(g,!0);y.at(R,b);var B=f.MathUtils.lerp(A.z,h.z,R),M=B>=-1&&B<=1,I=g.distanceTo(b)<c*.5;if(M&&I){y.start.fromBufferAttribute(d,w),y.end.fromBufferAttribute(p,w),y.start.applyMatrix4(x),y.end.applyMatrix4(x);var L=new f.Vector3,T=new f.Vector3;i.distanceSqToSegment(y.start,y.end,T,L),r.push({point:T,pointOnLine:L,distance:i.origin.distanceTo(T),object:this,faceIndex:w})}}}},t}(f.Mesh);Object.assign(_l.prototype,{isLineSegments2:!0});var jl=function(n){ue(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.type="Line2",i}return t}(_l);Object.assign(jl.prototype,{isLine2:!0});var Jl=function(n){ue(t,n);function t(){var e=n.call(this)||this;return e.type="LineGeometry",e}return t.prototype.setPositions=function(e){for(var r=e.length-3,i=new Float32Array(2*r),a=0;a<r;a+=3)i[2*a]=e[a],i[2*a+1]=e[a+1],i[2*a+2]=e[a+2],i[2*a+3]=e[a+3],i[2*a+4]=e[a+4],i[2*a+5]=e[a+5];return n.prototype.setPositions.call(this,i),this},t.prototype.setColors=function(e){for(var r=e.length-3,i=new Float32Array(2*r),a=0;a<r;a+=3)i[2*a]=e[a],i[2*a+1]=e[a+1],i[2*a+2]=e[a+2],i[2*a+3]=e[a+3],i[2*a+4]=e[a+4],i[2*a+5]=e[a+5];return n.prototype.setColors.call(this,i),this},t.prototype.fromLine=function(e){var r=e.geometry;if(r instanceof f.Geometry){var i=new f.BufferGeometry().fromGeometry(r);this.setPositions(i.attributes.position.array)}else r instanceof f.BufferGeometry&&this.setPositions(r.attributes.position.array);return this},t.prototype.copy=function(){return this},t}(fs);Object.assign(Jl.prototype,{isLineGeometry:!0});var wA="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaG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2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==",G0=14467195,EA=8,SA=2,MA=20,K0=null,ko=function(n){ue(t,n);function t(e,r){e===void 0&&(e=new f.Vector3),r===void 0&&(r=new f.Vector3);var i=n.call(this)||this;i.type="FiveLine",i.needsRender=!0;var a=new Jl,o=new ds({color:G0,linewidth:SA,dashScale:MA,dashed:!1});i.line=new jl(a,o);var s=new f.BufferGeometry,u=new f.PointsMaterial({color:G0,size:EA,map:K0||(K0=new f.TextureLoader().load(wA)),sizeAttenuation:!1,transparent:!0});return i.points=new f.Points(s,u),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.4.0-alpha.13"},enumerable:!1,configurable:!0}),t.prototype.setPoints=function(e,r){var i=[].concat(e.toArray(),r.toArray());this.points.geometry.setAttribute("position",new f.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 f.Vector3(e[0],e[1],e[2]),new f.Vector3(e[3],e[4],e[5])]},t.prototype.setMaterial=function(e){var r=this.line.material;for(var i in e)if(e.hasOwnProperty(i)){var a=e[i];i==="dashed"?(r.dashed=a,a?r.defines.USE_DASH="":delete r.defines.USE_DASH,r.needsUpdate=!0):r[i]=e[i]}this.needsRender=!0},t.prototype.setResolution=function(e,r){var i=this.line.material.resolution;(i.x!==e||i.y!==r)&&(i.set(e,r),this.needsRender=!0)},t}(f.Object3D);Object.assign(ko.prototype,{isFiveLine:!0});var rt={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 Xl(n){return sa(this,void 0,void 0,function(){var t;return ua(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 CA(n){return sa(this,void 0,void 0,function(){var t,e;return ua(this,function(r){switch(r.label){case 0:if(!n)throw new Error("No basePath supplied");return t="profilesList.json",[4,Xl("".concat(n,"/").concat(t))];case 1:return e=r.sent(),[2,e]}})})}function IA(n,t){return sa(this,arguments,void 0,function(e,r,i,a){var o,s,u,l,c,d;return i===void 0&&(i=null),a===void 0&&(a=!0),ua(this,function(p){switch(p.label){case 0:if(!e)throw new Error("No xrInputSource supplied");if(!r)throw new Error("No basePath supplied");return[4,CA(r)];case 1:if(o=p.sent(),e.profiles.some(function(A){var h=o[A];return h&&(s={profileId:A,profilePath:"".concat(r,"/").concat(h.path),deprecated:!!h.deprecated}),!!s}),!s){if(!i)throw new Error("No matching profile name found");if(u=o[i],!u)throw new Error('No matching profile name found and default profile "'.concat(i,'" missing.'));s={profileId:i,profilePath:"".concat(r,"/").concat(u.path),deprecated:!!u.deprecated}}return[4,Xl(s.profilePath)];case 2:if(l=p.sent(),a){if(d=void 0,d=l.layouts[e.handedness],!d)throw new Error("No matching handedness, ".concat(e.handedness,", in profile ").concat(s.profileId));d.assetPath&&(c=s.profilePath.replace("profile.json",d.assetPath))}return[2,{profile:l,assetPath:c}]}})})}var TA={xAxis:0,yAxis:0,button:0,state:rt.ComponentState.DEFAULT};function PA(n,t){n===void 0&&(n=0),t===void 0&&(t=0);var e=n,r=t,i=Math.sqrt(n*n+t*t);if(i>1){var a=Math.atan2(t,n);e=Math.cos(a),r=Math.sin(a)}var o={normalizedXAxis:e*.5+.5,normalizedYAxis:r*.5+.5};return o}var RA=function(){function n(t){this.componentProperty=t.componentProperty,this.states=t.states,this.valueNodeName=t.valueNodeName,this.valueNodeProperty=t.valueNodeProperty,this.valueNodeProperty===rt.VisualResponseProperty.TRANSFORM&&(this.minNodeName=t.minNodeName,this.maxNodeName=t.maxNodeName),this.value=0,this.updateFromComponent(TA)}return n.prototype.updateFromComponent=function(t){var e=t.xAxis,r=t.yAxis,i=t.button,a=t.state,o=PA(e,r),s=o.normalizedXAxis,u=o.normalizedYAxis;switch(this.componentProperty){case rt.ComponentProperty.X_AXIS:this.value=this.states.includes(a)?s:.5;break;case rt.ComponentProperty.Y_AXIS:this.value=this.states.includes(a)?u:.5;break;case rt.ComponentProperty.BUTTON:this.value=this.states.includes(a)?i:0;break;case rt.ComponentProperty.STATE:this.valueNodeProperty===rt.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(a):this.value=this.states.includes(a)?1:0;break;default:throw new Error("Unexpected visualResponse componentProperty ".concat(this.componentProperty))}},n}(),BA=function(){function n(t,e){var r=this;if(!t||!e||!e.visualResponses||!e.gamepadIndices||Object.keys(e.gamepadIndices).length===0)throw new Error("Invalid arguments supplied");this.id=t,this.type=e.type,this.rootNodeName=e.rootNodeName,this.touchPointNodeName=e.touchPointNodeName,this.visualResponses={},Object.keys(e.visualResponses).forEach(function(i){var a=new RA(e.visualResponses[i]);r.visualResponses[i]=a}),this.gamepadIndices=Object.assign({},e.gamepadIndices),this.values={state:rt.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=O({id:this.id},this.values);return t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(t){var e=this;if(this.values.state=rt.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=rt.ComponentState.PRESSED:(r.touched||this.values.button>rt.ButtonTouchThreshold)&&(this.values.state=rt.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===rt.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>rt.AxisTouchThreshold&&(this.values.state=rt.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===rt.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>rt.AxisTouchThreshold&&(this.values.state=rt.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(function(i){i.updateFromComponent(e.values)})},n}(),FA=function(){function n(t,e,r){var i=this;if(!t)throw new Error("No xrInputSource supplied");if(!e)throw new Error("No profile supplied");this.xrInputSource=t,this.assetUrl=r,this.id=e.profileId,this.layoutDescription=e.layouts[t.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach(function(a){var o=i.layoutDescription.components[a];i.components[a]=new BA(a,o)}),this.updateFromGamepad()}return Object.defineProperty(n.prototype,"gripSpace",{get:function(){return this.xrInputSource.gripSpace},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"targetRaySpace",{get:function(){return this.xrInputSource.targetRaySpace},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"data",{get:function(){var t=[];return Object.values(this.components).forEach(function(e){t.push(e.data)}),t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(){var t=this;Object.values(this.components).forEach(function(e){e.updateFromGamepad(t.xrInputSource.gamepad)})},n}(),LA="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",kA="generic-trigger",OA=function(n){ue(t,n);function t(){var e=n.call(this)||this;return e.motionController=null,e.envMap=null,e}return t.prototype.setEnvironmentMap=function(e){var r=this;return this.envMap==e?this:(this.envMap=e,this.traverse(function(i){i instanceof f.Mesh&&i.isMesh&&(i.material.envMap=r.envMap,i.material.needsUpdate=!0)}),this)},t.prototype.updateMatrixWorld=function(e){n.prototype.updateMatrixWorld.call(this,e),this.motionController&&(this.motionController.updateFromGamepad(),Object.values(this.motionController.components).forEach(function(r){Object.values(r.visualResponses).forEach(function(i){var a=i.valueNode,o=i.minNode,s=i.maxNode,u=i.value,l=i.valueNodeProperty;a&&(l===rt.VisualResponseProperty.VISIBILITY?a.visible=u:l===rt.VisualResponseProperty.TRANSFORM&&(a.quaternion.copy(o.quaternion).slerp(s.quaternion,u),a.position.lerpVectors(o.position,s.position,u)))})}))},t}(ni.Object3D);function DA(n,t){Object.values(n.components).forEach(function(e){var r=e.type,i=e.touchPointNodeName,a=e.visualResponses;if(r===rt.ComponentType.TOUCHPAD)if(e.touchPointNode=t.getObjectByName(i),e.touchPointNode){var o=new ni.SphereGeometry(.001),s=new ni.MeshBasicMaterial({color:255}),u=new ni.Mesh(o,s);e.touchPointNode.add(u)}else console.warn("Could not find touch dot, ".concat(e.touchPointNodeName,", in touchpad component ").concat(e.id));Object.values(a).forEach(function(l){var c=l.valueNodeName,d=l.minNodeName,p=l.maxNodeName,A=l.valueNodeProperty;if(A===rt.VisualResponseProperty.TRANSFORM){if(l.minNode=t.getObjectByName(d),l.maxNode=t.getObjectByName(p),!l.minNode){console.warn("Could not find ".concat(d," in the model"));return}if(!l.maxNode){console.warn("Could not find ".concat(p," in the model"));return}}l.valueNode=t.getObjectByName(c),l.valueNode||console.warn("Could not find ".concat(c," in the model"))})})}function _0(n,t){DA(n.motionController,t),n.envMap&&t.traverse(function(e){e instanceof f.Mesh&&e.isMesh&&(e.material.envMap=n.envMap,e.material.needsUpdate=!0)}),n.add(t)}var VA=function(){function n(t){t===void 0&&(t=null),this.gltfLoader=t,this.path=LA,this._assetCache={}}return n.prototype.createControllerModel=function(t){var e=this,r=new OA,i=null;return t.addEventListener("connected",function(a){var o=a.data;o.targetRayMode!=="tracked-pointer"||!o.gamepad||IA(o,e.path,kA).then(function(s){var u=s.profile,l=s.assetPath;r.motionController=new FA(o,u,l);var c=e._assetCache[r.motionController.assetUrl];if(c)i=c.scene.clone(),_0(r,i);else{if(!e.gltfLoader)throw new Error("GLTFLoader not set.");e.gltfLoader.load(r.motionController.assetUrl,function(d){e._assetCache[r.motionController.assetUrl]=d,i=d.scene.clone(),_0(r,i)})}}).catch(function(s){console.warn(s)})}),t.addEventListener("disconnected",function(){r.motionController=null,r.remove(i),i=null}),r},n}();function NA(n,t){return n}var j0=300,zA=new f.Matrix4().makeRotationAxis(new f.Vector3(0,1,0),Math.PI),J0=new f.Vector3(-1,1,1),UA=function(n){ue(t,n);function t(e){var r=n.call(this,e)||this;r.xrManager=new xA(r.renderer,r.renderer.getContext(),{onSessionStart:function(u){r.emit("xr.session.start",X("xr.session.start",{session:u,machineType:r.xrManager.machineType}))},onSessionEnd:function(){r.emit("xr.session.end",X("xr.session.end",{session:null,machineType:r.xrManager.machineType}))}}),r.xrControllerRay={left:new f.Raycaster,right:new f.Raycaster},r.xrControllerRay.left.params.Points={threshold:.1},r.xrControllerRay.right.params.Points={threshold:.1},r.gazeRay=null,r.pointerLines={left:new ko,right:new ko},r.pointerLines.left.visible=!1,r.pointerLines.right.visible=!0,r.pointerLines.left.setMaterial({color:new f.Vector3(1,1,1)}),r.pointerLines.left.points.material.depthTest=!1,r.pointerLines.right.setMaterial({color:new f.Vector3(1,1,1)}),r.pointerLines.right.points.material.depthTest=!1,r.controllerWrappers=[new f.Group,new f.Group];var i=r.xrManager.getController(0);r.controllerWrappers[0].add(i);var a=r.xrManager.getController(1);r.controllerWrappers[1].add(a);var o=new VA;o.gltfLoader={load:function(u,l){Zi.ajax(u,{responseType:"arraybuffer"}).then(function(c){var d;return Jo(c.body,{resourcePath:u.slice(0,u.lastIndexOf("/")+1),search:(d=u.split("?")[1])!==null&&d!==void 0?d:"",fetcher:Zi})}).then(function(c){return l(c)})}},(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=Ut()]={panoId:He(r.currentPano),leftPanoPicture:null,position:r.camera.pose.offset.clone(),effect:"fade",fixCameraTransform:new f.Matrix4},r.parallaxCameraMatrixs=[];var s=Et.shared.getContext();return s?(r.on("xr.session.end",function(){r.scene.remove(r.pointerLines.left,r.pointerLines.right)}),r.xrManager.setSession(s),r.on("xr.session.start",function(){var u=r.xrManager.getControllerGrip(0);u.add(o.createControllerModel(u)),r.controllerWrappers[0].add(u);var l=r.xrManager.getControllerGrip(1);l.add(o.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=O(O({},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 O(O({},i),{mode:"XRPanorama"})},t.prototype.moveToPano=function(e,r,i){var a=this,o,s,u,l,c=(o=r.effect)!==null&&o!==void 0?o:"fade";this.userAction=i,this.stopMomentumMovement();var d=this.works.getResolvedObserver(e);if(!d)throw new Error("Invalid PanoIndex");var p=di(d.images.up),A=this.imageOptions.size;typeof A=="undefined"&&d&&p&&(A=Number(p)),typeof A=="undefined"&&(A=2048);var h=this.imageOptions.transform,v=function(M,I){return NA(xn(M,h,I))},g=O({key:"pano.".concat(d.panoId)},rr(this.imageOptions,["format","size","quality"])),m=d.images,y=(u=(s=d.images.tiles)===null||s===void 0?void 0:s.filter(function(M){return M.size>A}))!==null&&u!==void 0?u:null,b="pano:"+ca([m,g,h]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===b)return;var x=this.pendingTextureTask.panoId;(l=this.panoMeshes[x])===null||l===void 0||l.setProgress(0),this.emit("pano.texture.abort",X("pano.texture.abort",{error:null,progress:0,meta:null,pano:d.pano}))}var w=this.models.getMaterial()||{},E=w.pano0,S=w.pano1,C;if((E==null?void 0:E.map.name)===b?C=E:(S==null?void 0:S.map.name)===b&&(C=S),C){var R={panoId:d.panoId,effect:c,leftPanoPicture:{zoom:1,map:C.map,luminanceMap:C.luminanceMap,matrix:new f.Matrix4().compose(d.position,d.quaternion,J0)},position:d.position.clone(),fixCameraTransform:new f.Matrix4};this.doMoveToPano(d.pano,R,r);return}var B="move-to-pano-"+d.panoId;this.pending.add(B),this.pendingTextureTask={panoId:d.panoId,hash:b,onLoad:function(M){if(a.pending.delete(B),a.destroyed)M.body.dispose();else{M.body.name=b;var I={panoId:d.panoId,effect:c,leftPanoPicture:{zoom:1,map:M.body,luminanceMap:null,matrix:new f.Matrix4().compose(d.position,d.quaternion,J0)},position:d.position.clone(),fixCameraTransform:new f.Matrix4};a.doMoveToPano(d.pano,I,r)}},onError:function(M){a.pending.delete(B);var I=O(O(O({},d.pano),{mode:a.mode}),tt(a.camera.pose));a.emit("pano.error",X("pano.error",{error:M,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:I})),a.emit("pano.cancel",X("pano.cancel",{error:null,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:I})),r.moveCancelCallback&&r.moveCancelCallback()}},Promise.all([this.tileLevelForFov&&y&&y.length?this.textureLoader.loadTiledCubeTexture(m,y,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:v,options:g},format:f.RGBAFormat,minFilter:f.LinearFilter,magFilter:f.LinearFilter,generateMipmaps:!1,viaAjax:!0,fetcher:pt(d.work)},void 0,void 0,function(M){var I,L;a.emit("pano.texture.progress",X("pano.texture.progress",{error:null,progress:M,meta:null,pano:d.pano})),((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===b&&((L=a.panoMeshes[d.panoId])===null||L===void 0||L.setProgress(M))},this.renderer):this.textureLoader.loadCubeTexture(m,{imageURL:{transform:v,options:g},format:f.RGBAFormat,fetcher:pt(d.work)},void 0,void 0,function(M){var I,L;((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===b&&((L=a.panoMeshes[d.panoId])===null||L===void 0||L.setProgress(M)),a.emit("pano.texture.progress",X("pano.texture.progress",{error:null,progress:M,meta:null,pano:d.pano}))},this.renderer)]).then(function(M){var I,L,T=M[0];((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===b?(a.pendingTextureTask.onLoad(T),(L=a.panoMeshes[d.panoId])===null||L===void 0||L.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.success",X("pano.texture.success",{error:null,progress:1,meta:T.meta,pano:d.pano}))):T.body.dispose()}).catch(function(M){var I,L;((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===b&&(a.pendingTextureTask.onError(M),(L=a.panoMeshes[d.panoId])===null||L===void 0||L.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.error",X("pano.texture.error",{error:M,progress:0,meta:null,pano:d.pano})),a.emit("error",M))}),this.emit("pano.texture.load",X("pano.texture.load",{error:null,progress:0,meta:null,pano:d.pano}))},t.prototype.doMoveToPano=function(e,r,i){var a=this,o,s,u,l,c,d,p,A,h,v;i===void 0&&(i={});var g=ve(),m=Ut();this.panoResources[m]=r;var y=1,b,x,w;if(this.locationMotion.ended){var E=this.locationMotion.getKeyFrameSegment(g);E[0];var S=E[1],C=this.locationMotion.value,R=this.panoResourceFromLocationMotionKeyframe(S).position,B=r.position;b=Math.max(R.distanceTo(B),y),x=[{key:S.key,progress:0,value:O(O({},C),{count:0})},{key:m,progress:1,value:{distance:0,count:1}}],w=0}else{var M=this.locationMotion.getKeyFrameSegment(g),I=M[0],S=M[1],C=this.locationMotion.value,L=this.panoResourceFromLocationMotionKeyframe(I).position,R=this.panoResourceFromLocationMotionKeyframe(S).position,B=r.position,T=S.value.count-C.count,F=Math.max(L.distanceTo(R),y)*T,D=Math.max(R.distanceTo(B),y);b=F+D,x=[{key:I.key,progress:0,value:O({},C)},{key:S.key,progress:F/b,value:S.value},{key:m,progress:1,value:{count:S.value.count+1,distance:0}}];var V=this.locationMotionKeyframesLength(this.locationMotion.keyframes),z=this.locationMotionKeyframesLength(x);w=this.locationMotion.getProgressVelocity(g)*V/z}var Q=r.effect==="instant"?0:this.calculateMovingDuration(i.duration,r.effect==="fly"?b:0),q={longitude:i.longitude,latitude:i.latitude,fov:i.fov},G=O(O({},e),{mode:this.mode,longitude:(o=q.longitude)!==null&&o!==void 0?o:this.camera.pose.longitude,latitude:(s=q.latitude)!==null&&s!==void 0?s:this.camera.pose.latitude,fov:(u=q.fov)!==null&&u!==void 0?u:this.camera.pose.fov,offset:r.position.clone(),distance:0}),K=this.currentPano;if(this.emit("pano.moveTo",X("pano.moveTo",{options:i,prevPano:K,progress:0,state:G,userAction:this.userAction,error:null})),i.moveStartCallback&&i.moveStartCallback(G),this.videoTexture&&this.videoTexture.image instanceof HTMLVideoElement&&this.videoTexture.image.getAttribute("src")&&(this.videoTexture.image.pause(),this.videoTexture.image.removeAttribute("uuid"),this.videoTexture.image.removeAttribute("src"),this.videoTexture.image.oncanplay=U,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),r.effect==="fly")this.cameraMotion.set(q,Q).catch(U);else{var j=tr({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),J=tr({longitude:(l=q.longitude)!==null&&l!==void 0?l:this.cameraMotion.value.longitude,latitude:(c=q.latitude)!==null&&c!==void 0?c:this.cameraMotion.value.latitude}),W=new f.Object3D;W.lookAt(j);var $=new f.Matrix4().makeRotationFromQuaternion(W.quaternion);W.lookAt(J);var Y=new f.Matrix4().makeRotationFromQuaternion(W.quaternion),Z=new f.Matrix4().getInverse($).premultiply(Y),oe=this.cameraMotion.value.fov,ne=(d=q.fov)!==null&&d!==void 0?d:this.cameraMotion.value.fov,de=1;r.effect==="zoomin"?de=1.5:r.effect==="zoomout"&&(de=.4);for(var se=ne*de,ye=0;ye<x.length-1;ye++){var ie=x[ye].key;if(ie){var xe=this.panoResources[ie];xe&&(xe.fixCameraTransform.copy(Z),xe.leftPanoPicture&&(xe.leftPanoPicture.zoom=Math.tan(oe/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:(p=q.longitude)!==null&&p!==void 0?p:this.cameraMotion.value.longitude,latitude:(A=q.latitude)!==null&&A!==void 0?A:this.cameraMotion.value.latitude,fov:se}},{progress:1,value:{longitude:(h=q.longitude)!==null&&h!==void 0?h:this.cameraMotion.value.longitude,latitude:(v=q.latitude)!==null&&v!==void 0?v:this.cameraMotion.value.latitude,fov:ne}}],Q).catch(U)}var Le=this.locationMotion.setKeyframes(x,Q,w);Le.then(function(){for(var Me,Oe,ee,re=0,H=a.models;re<H.length;re++){var Be=H[re];Be.show()}var Te=O(O({},e),{mode:a.mode,longitude:a.camera.pose.longitude,latitude:a.camera.pose.latitude,fov:a.camera.pose.fov,offset:a.camera.pose.offset.clone(),distance:0});a.emit("pano.arrived",X("pano.arrived",{options:i,prevPano:K,progress:1,state:Te,userAction:a.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(Te);var Ce=a.works.getResolvedObserver(a.currentPano);if(Ce&&Ce.video&&a.videoTexture&&a.videoTexture.image instanceof HTMLVideoElement){var Ue=zA.clone().multiply((ee=(Oe=(Me=a.models.getMaterial())===null||Me===void 0?void 0:Me.pano1)===null||Oe===void 0?void 0:Oe.matrix)!==null&&ee!==void 0?ee:new f.Matrix4).multiply(Ce.video.matrix),Ie={map:a.videoTexture,size:Ce.video.size,matrix:Ue,alpha:1},we=Ut(),be=a.videoTexture.image;be.setAttribute("uuid",we),Vl().then(function(Ae){Ae&&Ce.video&&be.getAttribute("uuid")===we&&(be.oncanplay=function(){be.oncanplay=U,be.play()},be.ontimeupdate=function(){be.currentTime>.5&&(be.ontimeupdate=U,a.panoVideo.setMaterial(Ie))},be.src=Ce.video.source)}).catch(function(){be.removeAttribute("uuid")})}},function(){a.emit("pano.cancel",X("pano.cancel",{options:i,prevPano:K,progress:0,state:G,userAction:a.userAction,error:null})),i.moveCancelCallback&&i.moveCancelCallback()})},t.prototype.checkSelectedPano=function(e){var r=this,i,a,o,s;this.stopMomentumMovement();var u=this.camera.getDirection(new f.Vector3).setY(0),l=null,c=this.works.getResolvedObserver(this.currentPano);if(!c)return null;var d=c.accessibleIds.filter(function(J){var W=Lt(J);if(pr(W,r.currentPano))return!1;var $=r.works.getResolvedObserver(W);return!$||$.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:$.loadable||$.active}),p=this.models.intersectRaycaster(e)[0];if(p){var A=Ir(d,function(J){var W=r.works.getResolvedObserver(J);if(!W)return 1/0;var $=W.standingPosition.clone();return $.distanceTo(p.point)},!0),h=A[0],v=A[1];h&&v<this.panoTapTriggerRadius&&(l=(i=this.works.getResolvedObserver(h))!==null&&i!==void 0?i:null)}if(q0(l)){var g=this.getForwardObserverOrNot(e);g&&(l=g)}for(var m=0,y=this.locationMotion.keyframes;m<y.length;m++){var b=y[m],x=this.panoResourceFromLocationMotionKeyframe(b);if(!(b.progress<this.locationMotion.progress)&&l&&x.panoId===l.panoId){l=null;break}}if(q0(l))return this.locationMotion.ended===!0&&this.cameraBounce(),null;if(l&&!l.active){var w=l.panoId;this.panoMeshes[w]&&(this.panoMeshes[w].setDisabled(!1),this.panoMeshes[w].setLoading(!0))}var E={};if(l){for(var S=Math.PI/6,C=Math.PI/12,R=new f.Vector3(0,1,0),B=l.position.clone().setY(0).sub(c.position.clone().setY(0)).normalize(),M=B.clone().applyAxisAngle(R,S),I=B.clone().applyAxisAngle(R,-S),L=[],T=[],F=[],D=0,V=l.accessibleIds;D<V.length;D++){var h=V[D],z=Lt(h);if(!(pr(z,this.currentPano)||pr(z,l.pano))){var Q=this.works.getResolvedObserver(h);if(Q){var q=Q.position.clone().sub(l.position).setY(0);B.angleTo(q)<S?F.push(q):M.angleTo(q)<S?L.push(q):I.angleTo(q)<S&&T.push(q)}}}var G=F.length>0?F:vt(vt([],L,!0),T,!0),K=G.slice().sort(function(J,W){return J.angleTo(B)-W.angleTo(B)})[0];K&&K.angleTo(u)>C&&(E.longitude=Math.atan2(-K.x,-K.z))}this.cameraMotion.value.latitude<-Math.PI/4&&(E.latitude=ce(0,this.minLatitude,this.maxLatitude)),this.cameraMotion.value.fov<60&&(E.fov=this.defaultFov);var j={workCode:l.pano.workCode,panoIndex:l.pano.panoIndex,mode:this.mode,longitude:(a=E.longitude)!==null&&a!==void 0?a:this.camera.pose.longitude,latitude:(o=E.latitude)!==null&&o!==void 0?o:this.camera.pose.latitude,fov:(s=E.fov)!==null&&s!==void 0?s:this.camera.pose.fov,distance:0,offset:l?l.position.clone():new f.Vector3};return this.emit("pano.select",X("pano.select",{prevPano:this.currentPano,state:j,userAction:!0,options:E,progress:0,error:null})),l&&l.active?(this.emit("pano.request",X("pano.request",{userAction:!0,prevPano:this.currentPano,progress:0,state:j,options:E,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,a,o,s,u,l,c,d,p,A=[],h=2;h<arguments.length;h++)A[h-2]=arguments[h];this.userAction=!0;var v={},g={},m=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),y=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),b=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),g.longitude=this.cameraMotion.value.longitude,g.latitude=this.cameraMotion.value.latitude,g.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),v.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(ce(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var x=this.locationMotion.getKeyFrameSegment(e),w=x[0],E=x[1],S=this.panoResourceFromLocationMotionKeyframe(w),C=this.panoResourceFromLocationMotionKeyframe(E),R=new f.Vector3().copy(S.position),B=new f.Vector3().copy(C.position),M=this.locationMotion.value.count-E.value.count+1;v.progress=M,C.leftPanoPicture&&(M<1?S.leftPanoPicture&&(v.pano0=S.leftPanoPicture):v.pano0=C.leftPanoPicture,v.pano1=C.leftPanoPicture),C.effect==="montage"?v.transition="BLACK":C.effect==="spread"?v.transition="SPREAD":v.transition="FADE",(C.effect==="zoomin"||C.effect==="zoomout")&&(v.progress=Math.pow(M,3)),M<1&&C.effect!=="fly"&&(v.pano0&&S.leftPanoPicture&&(v.pano0={map:v.pano0.map,zoom:v.pano0.zoom,luminanceMap:v.pano0.luminanceMap,matrix:S.leftPanoPicture.matrix.clone().setPosition(C.position)}),R.copy(B),b=!0),g.distance=this.locationMotion.value.distance,g.offset=new f.Vector3(R.x+(B.x-R.x)*M,R.y+(B.y-R.y)*M,R.z+(B.z-R.z)*M);for(var I=[],L=[],T=0,F=this.locationMotion.keyframes;T<F.length;T++){var D=F[T],V=D.key,z=D.progress;V!==void 0&&(I.push(V),z>this.locationMotion.progress&&L.push(V))}for(var Q=0,q=Object.keys(this.panoResources);Q<q.length;Q++){var G=q[Q];if(!(L.indexOf(G)>=0)){var K=this.panoResources[G];if(K.leftPanoPicture){var j=K.leftPanoPicture.map;if(j){if(j===((a=v.pano0)===null||a===void 0?void 0:a.map)||j===((o=v.pano1)===null||o===void 0?void 0:o.map))continue;j instanceof qe&&j.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(j.cubeRenderTarget),j.dispose(),K.leftPanoPicture=null}}I.indexOf(G)>=0||delete this.panoResources[G]}}this.currentPano=Lt(C.panoId),this.emit("pano.moving",X("pano.moving",{userAction:this.userAction,prevPano:Lt(m.panoId),state:O(O(O(O({},Lt(y.panoId)),{mode:this.mode}),tt(this.camera.pose)),g),options:{},progress:this.locationMotion.progress,error:null}))}ar(v)===!1&&(!((s=v.pano0)===null||s===void 0)&&s.map&&v.pano0.map instanceof qe&&!v.pano0.map.cubeRenderTarget&&(v.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((u=v.pano1)===null||u===void 0)&&u.map&&v.pano1.map instanceof qe&&!v.pano1.map.cubeRenderTarget&&(v.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),this.models.setMaterial(v)),ar(g)===!1&&this.setCamera(g);var J=this.works.getResolvedObserver(this.currentPano),W=A[1];if(!W){console.error("xrFrame丢失,请重试");return}if(!this.xrManager.session){console.error("session丢失,请重试");return}var $=this.xrManager.referenceSpace;if($){var Y=this.xrManager.cameraVR,Z=this.xrManager.cameraL,oe=this.xrManager.cameraR,ne=[Z,oe],de=W.getViewerPose($),se=new f.Vector3(0,0,0);if(de){var ye;ye=this.xrManager.session.renderState.baseLayer;var ie=de.views;if(!ye){console.error("no layer found");return}this.renderer.setFramebuffer(ye.framebuffer);var xe=!1;ie.length!==Y.cameras.length&&(Y.cameras.length=0,xe=!0),this.parallaxCameraMatrixs=[];var Le=new f.Vector3,Me=new f.Vector3;new f.Matrix4().fromArray(ie[0].transform.matrix).decompose(Le,new f.Quaternion,new f.Vector3),new f.Matrix4().fromArray(ie[1].transform.matrix).decompose(Me,new f.Quaternion,new f.Vector3),Me.clone().sub(Le).normalize();var Oe=new f.Vector3,ee=new f.Quaternion,re=new f.Vector3;this.camera.matrix.decompose(Oe,ee,re);for(var H=0;H<ie.length;H++){var Be=ie[H],Te=ye.getViewport(Be),Ce=ne[H];Ce.matrix.fromArray(Be.transform.matrix);var Ue=new f.Vector3,Ie=new f.Quaternion,we=new f.Vector3;Ce.matrix.decompose(Ue,Ie,we),se.copy(Oe),Ce.position.copy(Oe),Ce.quaternion.copy(Ie),Ce.scale.copy(we),Ce.updateMatrix(),Ce.projectionMatrix.fromArray(Be.projectionMatrix),Ce.viewport.set(Te.x,Te.y,Te.width,Te.height),xe===!0&&Y.cameras.push(Ce)}if(this.xrManager.session&&this.xrManager.session.inputSources){for(var H=0;H<this.xrManager.session.inputSources.length;H++)if(this.xrManager.session.inputSources[H]&&this.xrManager.session.inputSources[H].targetRayMode==="transient-pointer"){var be=W.getPose(this.xrManager.session.inputSources[H].targetRaySpace,$);if(be){var Ae=new f.Vector3(0,0,-1).applyQuaternion(be.transform.orientation),me=new f.Raycaster(this.camera.position,Ae);this.gazeRay=me}}}if(this.xrManager.machineType==="Oculus"||this.xrManager.machineType==="Pico"){for(var ze=this.xrManager.session.inputSources,H=0;H<ze.length;H++){var pe=this.xrManager.controllers[H],Se=ze[H];if(Se){pe&&pe.update(Se,W,$);var me=this.xrManager.getController(H),St=new f.Vector3(0,1.2,0),Pe=me.position.clone().add(se).sub(St);Se.handedness==="left"?this.xrControllerRay.left.set(Pe,new f.Vector3(0,0,-1).applyEuler(me.rotation)):Se.handedness==="right"&&this.xrControllerRay.right.set(Pe,new f.Vector3(0,0,-1).applyEuler(me.rotation)),this.controllerWrappers[H].position.copy(new f.Vector3(0,0,0).add(se).sub(St));var je=this.models.intersectRaycaster(this.xrControllerRay.right);if(je.length===0&&(je=this.xrControllerRay.right.intersectObject(this.boundingMesh,!0).map(function(Hr){var fn;return O({floor:(fn=J==null?void 0:J.floorIndex)!==null&&fn!==void 0?fn:0},Hr)})),je.length>=1&&je[0].face)if(Se.handedness==="right"){var it=this.xrControllerRay.right.intersectObject(this.xrCustomObjectsScene,!0),_t=je[0].face.normal,Qr=_t.clone(),jt=je[0].point.clone();this.intersectMesh.position.copy(jt);var ut=jt.clone().add(Qr);if(this.intersectMesh.lookAt(ut),Math.abs(_t.y)>.99){var Mt=this.camera.position.clone().sub(jt);this.intersectMesh.rotation.z=-Math.atan2(Mt.z,Mt.x)}this.intersectMesh.visible=!0,this.needsRender=!0,it.length>0?(this.pointerLines.right.setPoints(Pe,it[0].point),this.pointerLines.right.points.visible=!0,this.intersectMesh.visible=!1):(this.pointerLines.right.points.visible=!1,this.pointerLines.right.setPoints(Pe,je[0].point));var dt=je[0],Ct=X("intersect.update",{raycaster:(l=this.xrControllerRay.right)!==null&&l!==void 0?l:null,intersection:dt!=null?dt:null,object:this.intersectMesh});if(this.emit("intersect.update",Ct),Ct.defaultPrevented){this.hideIntersectMesh();return}}else this.pointerLines.left.setPoints(Pe,je[0].point)}}this.updateControllerHelper(ze,e,r)}if(this.camera.pose.distance>.1||b)for(var It=0,Tt=Object.keys(this.panoMeshes);It<Tt.length;It++){var Xe=Tt[It],Ne=this.panoMeshes[Xe];Ne.setOpacity(0),Ne.setCurrent(!1),Ne.updateTime&&Ne.updateTime(e,r),Ne.visible=!1}else if(J){var We=Ir(J.visibleIds,function(Pt){var or=i.works.getResolvedObserver(Pt);return or?J.standingPosition.distanceTo(or.standingPosition):1/0},!0),At=We[1];At=ce(At,2.5,1/0);for(var Ze=J.visibleIds.concat(He(this.currentPano)),gt=this.getForwardObserverOrNot(),qt=this.camera.getDirection(new f.Vector3),yt=0,Jt=Object.keys(this.panoMeshes);yt<Jt.length;yt++){var Xe=Jt[yt],Ne=this.panoMeshes[Xe],gr=this.works.getResolvedObserver(Xe);if(Ze.indexOf(Xe)===-1)Ne.setCurrent(!1),Ne.setOpacity(0);else if(!gr)Ne.setCurrent(!1),Ne.setOpacity(0);else if(!gr.loadable&&!gr.active)Ne.setCurrent(!1),Ne.setOpacity(0);else{var qr=Ne.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);Ne.setCurrent(!Ne.loading&&Ne.progress===0&>!==null&>.panoId===Xe),Ne.setOpacity(qr<.01?0:ce(At/qr*1.2,.65,.98));var yr=this.camera.position.clone().setY(Ne.position.y),Ae=new f.Vector3().copy(Ne.position).sub(yr).normalize();if(Xe===He(this.currentPano)){var Pr=ce((.5-yr.distanceTo(Ne.position))/.5,0,1);Ae.multiplyScalar(1-Pr).add(qt.clone().multiplyScalar(Pr))}Ae.length()>0&&Ne.quaternion.setFromEuler(new f.Euler(0,Math.atan2(Ae.x,Ae.z),0))}Ne.updateTime&&Ne.updateTime(e,r)}}var Ot=function(){return 4}(),Ge=function(){var Pt=new f.PerspectiveCamera;Pt.applyMatrix4(Y.matrix),Pt.position.set(0,0,0);var or=i.works.getResolvedObserver(y.panoId),Hr=or!=null?or:J;Hr&&Pt.quaternion.premultiply(Hr.quaternion.clone().inverse()),Pt.updateProjectionMatrix(),Pt.updateMatrixWorld(!0);var fn=new f.Frustum().setFromProjectionMatrix(new f.Matrix4().multiplyMatrices(Pt.projectionMatrix,Pt.matrixWorldInverse));return fn}();y.panoId===He(this.currentPano)&&((c=y.leftPanoPicture)===null||c===void 0?void 0:c.map)instanceof qe&&(y.leftPanoPicture.map.maxRequest=this.tileMaxRequest,y.leftPanoPicture.map.update(Ge,Ot),y.leftPanoPicture.map.needsRender===!0&&(this.needsRender=!0,this.modelSceneNeedsRender=!0));{var ke=this.tiling.object.visible;if(this.initAnimationed){var Ye=y.panoId,bt=this.works.getResolvedObserver(Ye);bt?Ii(this.camera.position,bt.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==Ye&&this.tiling.cleanup(),this.tiling.panoId=Ye,this.tiling.setResource((p=(d=bt.images)===null||d===void 0?void 0:d.tiles)!==null&&p!==void 0?p:[],this.enableIOSEDR&&bt.images.luminance?bt.images.luminance:null),this.tiling.setFetcher(pt(bt.work)),this.tiling.setRotation(bt.quaternion),this.tiling.setPosition(bt.position),this.tiling.maxRequest=this.tileMaxRequest,Ot>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update(Ge,Ot,e):this.tiling.update(Ge,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;ke!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0,this.modelSceneNeedsRender=!0)}this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e)}}},t.prototype.render=function(){var e=this.xrManager.getCamera(this.camera);this.renderer.render(this.modelScene,e),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,e),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0},t.prototype.onPanGesture=function(){},t.prototype.onTapGesture=function(){},t.prototype.onPinchGesture=function(){},t.prototype.onMouseMove=function(){},t.prototype.onMouseOut=function(){},t.prototype.panoResourceFromLocationMotionKeyframe=function(e){return this.panoResources[e.key]},t.prototype.updateControllerHelper=function(e,r,i){var a=this.xrControllerRay.left,o=this.xrControllerRay.right;if(!(!e||e.length===0)){for(var s={buttons:{X:!1,Y:!1,LeftTrigger:!1,LeftPinch:!1,A:!1,B:!1,RightTrigger:!1,RightPinch:!1}},u=0;u<e.length;u++){var l=e[u].handedness,c=e[u].gamepad;switch(l){case"left":c.axes&&(this.emitHandleEvent(c.axes[2]===-1,"LeftAxesLeft",r),this.emitHandleEvent(c.axes[2]===1,"LeftAxesRight",r),this.emitHandleEvent(c.axes[3]===-1,"LeftAxesUp",r),this.emitHandleEvent(c.axes[3]===1,"LeftAxesDown",r)),c!=null&&c.buttons&&(c.buttons[4]&&this.emitHandleEvent(c.buttons[4].pressed,"X",r),c.buttons[5]&&this.emitHandleEvent(c.buttons[5].pressed,"Y",r),c.buttons[0]&&this.emitHandleEvent(c.buttons[0].pressed,"LeftTrigger",r),c.buttons[1]&&this.emitHandleEvent(c.buttons[1].pressed,"LeftPinch",r));var d={raycaster:a,axes:{up:c.axes&&c.axes[3]<0?Math.abs(c.axes[3]):0,down:c.axes&&c.axes[3]<0?0:Math.abs(c.axes[3]),left:c.axes&&c.axes[2]<0?Math.abs(c.axes[2]):0,right:c.axes&&c.axes[2]<0?0:Math.abs(c.axes[2])},deltaTime:i};s.buttons.X=c.buttons&&c.buttons[4]?c.buttons[4].pressed:!1,s.buttons.Y=c.buttons&&c.buttons[5]?c==null?void 0:c.buttons[5].pressed:!1,s.buttons.LeftTrigger=c.buttons&&c.buttons[0]?c==null?void 0:c.buttons[0].pressed:!1,s.buttons.LeftPinch=c.buttons&&c.buttons[1]?c==null?void 0:c.buttons[1].pressed:!1,s.left=d;break;case"right":c.axes&&(this.emitHandleEvent(c.axes[2]===-1,"RightAxesLeft",r),this.emitHandleEvent(c.axes[2]===1,"RightAxesRight",r),this.emitHandleEvent(c.axes[3]===-1,"RightAxesUp",r),this.emitHandleEvent(c.axes[3]===1,"RightAxesDown",r)),c.buttons&&(c.buttons[4]&&this.emitHandleEvent(c.buttons[4].pressed,"A",r),c.buttons[5]&&this.emitHandleEvent(c.buttons[5].pressed,"B",r),c.buttons[0]&&this.emitHandleEvent(c.buttons[0].pressed,"RightTrigger",r),c.buttons[1]&&this.emitHandleEvent(c.buttons[1].pressed,"RightPinch",r));var p={raycaster:o,axes:{up:c.axes&&c.axes[3]<0?Math.abs(c.axes[3]):0,down:c.axes&&c.axes[3]<0?0:Math.abs(c.axes[3]),left:c.axes&&c.axes[2]<0?Math.abs(c.axes[2]):0,right:c.axes&&c.axes[2]<0?0:Math.abs(c.axes[2])},deltaTime:i};s.right=p,s.buttons.A=c.buttons&&c.buttons[4]?c==null?void 0:c.buttons[4].pressed:!1,s.buttons.B=c.buttons&&c.buttons[5]?c==null?void 0:c.buttons[5].pressed:!1,s.buttons.RightTrigger=c.buttons&&c.buttons[0]?c==null?void 0:c.buttons[0].pressed:!1,s.buttons.RightPinch=c.buttons&&c.buttons[1]?c==null?void 0:c.buttons[1].pressed:!1;break}}this.emit("xr.controller.update",X("xr.controller.update",s))}},t.prototype.emitHandleEvent=function(e,r,i){var a=this.xrControllerRay.left,o=this.xrControllerRay.right;if(e)if(this.xrHandleState[r].touchStart===!1)this.xrHandleState[r].touchStartTime=i,this.xrHandleState[r].touchStart=!0,this.emit("xr.gesture.buttonDown",X("xr.gesture.buttonDown",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!1,isFirst:!0,controllers:{raycaster:{leftRay:a,rightRay:o}}}));else{var s=i-this.xrHandleState[r].touchStartTime;s>j0&&this.emit("xr.gesture.press",X("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!0,controllers:{raycaster:{leftRay:a,rightRay:o}}}))}else if(this.xrHandleState[r].touchStart===!0){this.emit("xr.gesture.buttonUp",X("xr.gesture.buttonUp",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:a,rightRay:o}}}));var s=i-this.xrHandleState[r].touchStartTime;if(s<=j0){var u=X("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:a,rightRay:o}}}),l=this.emit("xr.gesture.tap",u);!l&&!u.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}(us),ht={Floorplan:Lo,Topview:dm,Panorama:us,VRPanorama:aA,Model:sA,Mapview:gA,XRPanorama:UA},Wl=["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 QA(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=tr(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 qA(){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 X0(n){var t=new f.Group;t.name="internalLights";{var e=new f.DirectionalLight(16777215,.3);e.position.copy(new f.Vector3(1,1,1)),t.add(e)}{var e=new f.DirectionalLight(16777215,.1);e.position.copy(new f.Vector3(-1,-1,-1)),t.add(e)}{var e=new f.DirectionalLight(16777215,.1);t.add(e)}{var e=new f.AmbientLight(16777215,.6);t.add(e)}n.add(t)}function HA(n){for(var t,e,r={},i=n.split(/(\;|\,)/),a=0,o=i;a<o.length;a++){var s=o[a],u=s.split("="),l=(t=u[0])===null||t===void 0?void 0:t.trim(),c=(e=u[1])===null||e===void 0?void 0:e.trim();l&&c&&(r[l]=c)}return r}function Zl(){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=HA((n=r.getAttribute("content"))!==null&&n!==void 0?n:""),a=Number(i["initial-scale"]);if(!isNaN(a))return a}}return 1}const GA="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV8AAAA/CAQAAADtPwPkAAAR+0lEQVR4AezYg3LEQACH8d1cbdu23Q5qG9G47z/TN/h6tn2b/H+TUTLc7yjcOXV46OUAnUs6EbUp022Z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FX4c079dJNq6Qi5xbuyTmpPSJ1Ur4UtF7GoTtmUL3zxaWqMU8P/k3cXSQ1EQRjHGdzdHTa4u7tzBs7CedhykNwF2/5jq56iU11db6Lv2yTj8hs3JoiU9sZZp5/62J5v1z9NjrDHaSbnbFMf52sHrDUVaidDxNG0o9+uLjfosfdb3jT5d5j757riJgst9NIZQ2Pn+ySZll80vjI6Wz/hQJG4vPG0L/H6poQch/dW3vL3B0u8jl0HvVj5PvHCElEF8DUAFikVYTcvmfBdDzQlvvMXSV5lP5zrXj/fJ54zuWaeeuoqkW8AwCIaqeTZKkmYrpPwR2eqN9X72W7EG57vU67OBeuMV8KXLUzv93UTTj42tvaFS++GVsc5JRyLSLJ8nzO555hFBmiSRCqMr4GwrcmGkib5xSvcwmzFK6e8s7DMa2xH4YZdZumSOwsVzFeBWdr37tpIhOpSwXqONNgZq/2KgvBt54znHN1HzlljTO4oVD5fb+prNIJXQNL1ofDKQisbPLJDv3jNSLq9OkYBEIihKIj3v7S1TRQCX5Kdl1ZQlol7LF+E++fwirfiq2sf4cTXxc6hzxffPuLEeqSWrPGWMF58TWr5viyJAP5/4EV4KePiaSE8eNRgjDy8/tyRW+FZjhS+2tlovNJovtJovNJ0uhK6Wo64SDdxEbM//KesjwAAAABJRU5ErkJggg==";var W0=[351,63],Z0=[20,20],KA=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),_A=new Float32Array([0,0,1,0,0,1,1,1]),jA=new Uint8Array([0,1,2,1,3,2]),ma=new f.BufferGeometry;ma.setAttribute("position",new f.BufferAttribute(KA,3));ma.setAttribute("uv",new f.BufferAttribute(_A,2));ma.setIndex(new f.BufferAttribute(jA,1));var Wi=new f.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1,fog:!1}),Yl=new f.Mesh(ma,Wi);Yl.matrixAutoUpdate=!1;var hs=new f.Scene;hs.add(Yl);hs.matrixAutoUpdate=!1;var Ti=new f.OrthographicCamera(-.5,.5,.5,-.5,.1,1);Ti.position.set(0,0,.5);Ti.lookAt(0,0,0);Ti.updateMatrixWorld(!0);Ti.matrixAutoUpdate=!1;var JA=new f.Vector4,XA=new f.Vector4;function WA(n){if(Wi.map){var r=n.getViewport(JA),i=n.getScissor(XA),a=n.getScissorTest(),o=n.autoClear,s=i.x+Z0[0]/3,u=i.y+Z0[1]/3,l=W0[0]/3,c=W0[1]/3;n.setViewport(s,u,l,c),n.setScissor(s,u,l,c),n.setScissorTest(!0),n.autoClear=!1,n.render(hs,Ti),n.setViewport(r),n.setScissor(i),n.setScissorTest(a),n.autoClear=o}else{var t=new f.Texture,e=new Image;e.onload=function(){t.image=e,t.wrapS=f.ClampToEdgeWrapping,t.wrapT=f.ClampToEdgeWrapping,t.minFilter=f.LinearFilter,t.needsUpdate=!0,t.generateMipmaps=!1,Wi.needsUpdate=!0,e.onload=U},e.src=GA,Wi.map=t}}var ZA=800,Y0=90,YA=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/")},$A=new f.Vector2,eg=new f.Sphere,Qi=new f.Frustum,qi=new f.Matrix4,$0=new WeakMap,lo=new WeakMap,co=To([]),$l=function(n){ue(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,u,l,c,d,p,A,h=n.call(this)||this;if(h.ident=Ut(),typeof window!="undefined"&&(Oo.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=O({},(i=e.imageOptions)!==null&&i!==void 0?i:{}),h.textureOptions=O({},(a=e.textureOptions)!==null&&a!==void 0?a:{}),h.poweredByRealsee=(o=e.poweredByRealsee)!==null&&o!==void 0?o:!0,h.extraElements=[],h.controllerInits={Panorama:Object.assign({},e.panorama),Model:Object.assign({},e.model),Floorplan:Object.assign({},e.floorplan),Topview:Object.assign({},e.topview),Mapview:Object.assign({},e.mapview),VRPanorama:Object.assign({},e.vrPanorama),XRPanorama:Object.assign({},e.xrPanorama)},h.fps={testCount:0,testTime:ve()},h.info=null,h.modeChangeDuration=(s=e.modeChangeDuration)!==null&&s!==void 0?s:ZA,h.enableWheel=(u=e.enableWheel)!==null&&u!==void 0?u:!0,typeof window!="undefined")if("renderer"in e)e.renderer instanceof mn&&h.throwError(new Error("cannot render a internal renderer")),h.renderer=e.renderer;else try{h.renderer=new mn({preserveDrawingBuffer:e.preserveDrawingBuffer,backgroundColor:e.backgroundColor,backgroundAlpha:e.backgroundAlpha,antialias:e.antialias,webgl2:e.webgl2,logarithmicDepthBuffer:e.logarithmicDepthBuffer,precision:e.precision,powerPreference:e.powerPreference});var v=Zl();h.renderer.setPixelRatio(v===1?window.devicePixelRatio:1),h.renderer.setSize(512,512)}catch(B){B instanceof Error&&h.throwError(B)}h.getPixelsRenderTarget=new f.WebGLRenderTarget(1,1,{encoding:(c=(l=h.renderer)===null||l===void 0?void 0:l.outputEncoding)!==null&&c!==void 0?c:f.sRGBEncoding,generateMipmaps:!1});var g=new f.DepthTexture(1,1);g.generateMipmaps=!1,g.format=f.DepthStencilFormat,g.type=f.UnsignedInt248Type,h.modelRenderTarget=new f.WebGLRenderTarget(1,1,{encoding:(p=(d=h.renderer)===null||d===void 0?void 0:d.outputEncoding)!==null&&p!==void 0?p:f.sRGBEncoding,depthTexture:g,generateMipmaps:!1,depthBuffer:!0,stencilBuffer:!0}),h.scissor=Object.assign({left:0,bottom:0,width:1,height:1},e.scissor),h.camera=new bu(Y0),h.scene=new yu,h.xrCustomObjectsScene=new f.Scene,h.scene.add(h.xrCustomObjectsScene),h.scene.matrixAutoUpdate=!1,h.lastLoadWorkTask=Promise.resolve(),h.requestProxy=(A=e.requestProxy)!==null&&A!==void 0?A:YA,h.networkSubscribe=new su,h.networkSubscribe.on("network",function(B,M,I,L){var T;h.emit("network.resource",X("network.resource",{source:B,requestType:M,requestState:I,detail:L})),(T=h.analysis)===null||T===void 0||T.network(h.works,B,M,I,L)}),h.boundingMesh=Xv(new f.Box3(new f.Vector3(-.5,-.5,-.5),new f.Vector3(.5,.5,.5))),h.boundingMesh.name="bounding",h.models=w0(),h.models.push(new Ro),h.lastModels=w0(),h.lastWorks=To([]),h.readyCallbacks=[],h.syncingState=!1,h.helperGroup=new f.Group,h.helperGroup.name="helper",h.helperGroup.matrixAutoUpdate=!1,h.scene.add(h.helperGroup),h.modelGroup=new f.Group,h.modelGroup.visible=!1,h.modelGroup.name="model",h.modelGroup.matrixAutoUpdate=!1,h.modelScene=new f.Scene,h.modelScene.add(h.modelGroup),h.modelScene.add(h.boundingMesh),h.modelScene.matrixAutoUpdate=!1,h.videoTexture=new f.VideoTexture(e.videoInstance||qA()),X0(h.scene),X0(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=Et.shared.add(function(B,M){for(var I=[],L=2;L<arguments.length;L++)I[L-2]=arguments[L];h.updateTime.apply(h,vt([B,M],I,!1))},!1,0,10));var m=function(){typeof document!="undefined"&&document.fullscreenElement===null&&h.currentMode==="VRPanorama"&&h.controller.emit("vr.requestExit",X("vr.requestExit",{}))},y=function(){h.needsRender=!0,h.modelSceneNeedsRender=!0};if(typeof document!="undefined"&&document.addEventListener("fullscreenchange",m,!1),h.renderer&&h.renderer.domElement.addEventListener("webglcontextrestored",y,!1),h.removeEventListeners=function(){typeof document!="undefined"&&document.removeEventListener("fullscreenchange",m,!1),h.renderer&&h.renderer.domElement.removeEventListener("webglcontextrestored",y,!1)},h.plugins={},e.plugins&&e.plugins.length)for(var b=0,x=e.plugins;b<x.length;b++){var w=x[b];if(typeof w=="function")w(h);else if(Array.isArray(w)){var E=w[0],S=w[1],C=w[2];if(typeof E=="function"){var R=E(h,C);typeof S=="string"&&(h.plugins[S]?h.throwError(new Error("plugin name ".concat(S," is exists."))):h.plugins[S]=R)}}}return h.gpuPickingRenderTarget=new f.WebGLRenderTarget(1,1,{generateMipmaps:!1}),h.meshReplaceMaterialMap=new Map,h.meshOriginMaterialMap=new Map,QA(h),h}return Object.defineProperty(t,"version",{get:function(){return"6.4.0-alpha.13"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"dracoPath",{get:function(){return na.decoderPath},set:function(e){na.setDecoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t,"ktx2Path",{get:function(){return si.transcoderPath},set:function(e){si.setTranscoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panoIndex",{get:function(){return this.pano.panoIndex},enumerable:!1,configurable:!0}),t.prototype.getGPUPicking=function(e,r,i,a,o){var s=this;if(a===void 0&&(a=1),o===void 0&&(o=new f.Vector3(0,0,0)),!this.renderer)throw new Error("renderer is not initialized.");var u=this.models.getMaterial(),l=u.constantColor,c=u.colorStyle;this.models.setMaterial({colorStyle:"CONSTANT",constantColor:o}),this.scene.traverse(function(h){if(!(!(h instanceof f.Mesh)||h instanceof kt)){var v=Object.keys(i).filter(function(m){return m===h.uuid})[0];if(v)if(s.meshOriginMaterialMap.set(v,h.material),s.meshReplaceMaterialMap.get(v))h.material=s.meshReplaceMaterialMap.get(v);else{var g=new f.ShaderMaterial({uniforms:{color:{value:i[v]}},vertexShader:`
|
|
2169
|
+
`},ds=function(n){ue(t,n);function t(e){var r=n.call(this,{uniforms:f.UniformsUtils.clone(uo.uniforms),vertexShader:uo.vertexShader,fragmentShader:uo.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}(f.ShaderMaterial);Object.assign(ds.prototype,{isLineMaterial:!0});var _l=function(n){ue(t,n);function t(e,r){var i=n.call(this)||this;return i.type="LineSegments2",i.geometry=e!==void 0?e:new fs,i.material=r!==void 0?r:new ds({color:Math.random()*16777215}),i}return t.prototype.computeLineDistances=function(){for(var e=this.geometry,r=e.attributes.instanceStart,i=e.attributes.instanceEnd,a=new Float32Array(2*r.count),o=new f.Vector3,s=new f.Vector3,u=0,l=0,c=r.count;u<c;u++,l+=2)o.fromBufferAttribute(r,u),s.fromBufferAttribute(i,u),a[l]=l===0?0:a[l-1],a[l+1]=a[l]+o.distanceTo(s);var d=new f.InstancedInterleavedBuffer(a,2,1);return e.setAttribute("instanceDistanceStart",new f.InterleavedBufferAttribute(d,1,0)),e.setAttribute("instanceDistanceEnd",new f.InterleavedBufferAttribute(d,1,1)),this},t.prototype.raycast=function(e,r){e.camera===null&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var i=e.ray,a=e.camera,o=a.projectionMatrix,s=this.geometry,u=this.material,l=u.resolution,c=u.linewidth,d=s.attributes.instanceStart,p=s.attributes.instanceEnd,A=new f.Vector4,h=new f.Vector4,v=new f.Vector4,g=new f.Vector3,m=new f.Matrix4,y=new f.Line3,b=new f.Vector3;i.at(1,v),v.w=1,v.applyMatrix4(a.matrixWorldInverse),v.applyMatrix4(o),v.multiplyScalar(1/v.w),v.x*=l.x/2,v.y*=l.y/2,v.z=0,g.copy(v);var x=this.matrixWorld;m.multiplyMatrices(a.matrixWorldInverse,x);for(var w=0,E=d.count;w<E;w++){A.fromBufferAttribute(d,w),h.fromBufferAttribute(p,w),A.w=1,h.w=1,A.applyMatrix4(m),h.applyMatrix4(m),A.applyMatrix4(o),h.applyMatrix4(o),A.multiplyScalar(1/A.w),h.multiplyScalar(1/h.w);var S=A.z<-1&&h.z<-1,C=A.z>1&&h.z>1;if(!(S||C)){A.x*=l.x/2,A.y*=l.y/2,h.x*=l.x/2,h.y*=l.y/2,y.start.copy(A),y.start.z=0,y.end.copy(h),y.end.z=0;var R=y.closestPointToPointParameter(g,!0);y.at(R,b);var B=f.MathUtils.lerp(A.z,h.z,R),M=B>=-1&&B<=1,I=g.distanceTo(b)<c*.5;if(M&&I){y.start.fromBufferAttribute(d,w),y.end.fromBufferAttribute(p,w),y.start.applyMatrix4(x),y.end.applyMatrix4(x);var L=new f.Vector3,T=new f.Vector3;i.distanceSqToSegment(y.start,y.end,T,L),r.push({point:T,pointOnLine:L,distance:i.origin.distanceTo(T),object:this,faceIndex:w})}}}},t}(f.Mesh);Object.assign(_l.prototype,{isLineSegments2:!0});var jl=function(n){ue(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.type="Line2",i}return t}(_l);Object.assign(jl.prototype,{isLine2:!0});var Jl=function(n){ue(t,n);function t(){var e=n.call(this)||this;return e.type="LineGeometry",e}return t.prototype.setPositions=function(e){for(var r=e.length-3,i=new Float32Array(2*r),a=0;a<r;a+=3)i[2*a]=e[a],i[2*a+1]=e[a+1],i[2*a+2]=e[a+2],i[2*a+3]=e[a+3],i[2*a+4]=e[a+4],i[2*a+5]=e[a+5];return n.prototype.setPositions.call(this,i),this},t.prototype.setColors=function(e){for(var r=e.length-3,i=new Float32Array(2*r),a=0;a<r;a+=3)i[2*a]=e[a],i[2*a+1]=e[a+1],i[2*a+2]=e[a+2],i[2*a+3]=e[a+3],i[2*a+4]=e[a+4],i[2*a+5]=e[a+5];return n.prototype.setColors.call(this,i),this},t.prototype.fromLine=function(e){var r=e.geometry;if(r instanceof f.Geometry){var i=new f.BufferGeometry().fromGeometry(r);this.setPositions(i.attributes.position.array)}else r instanceof f.BufferGeometry&&this.setPositions(r.attributes.position.array);return this},t.prototype.copy=function(){return this},t}(fs);Object.assign(Jl.prototype,{isLineGeometry:!0});var wA="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAe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tq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==",G0=14467195,EA=8,SA=2,MA=20,K0=null,ko=function(n){ue(t,n);function t(e,r){e===void 0&&(e=new f.Vector3),r===void 0&&(r=new f.Vector3);var i=n.call(this)||this;i.type="FiveLine",i.needsRender=!0;var a=new Jl,o=new ds({color:G0,linewidth:SA,dashScale:MA,dashed:!1});i.line=new jl(a,o);var s=new f.BufferGeometry,u=new f.PointsMaterial({color:G0,size:EA,map:K0||(K0=new f.TextureLoader().load(wA)),sizeAttenuation:!1,transparent:!0});return i.points=new f.Points(s,u),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.4.0-alpha.15"},enumerable:!1,configurable:!0}),t.prototype.setPoints=function(e,r){var i=[].concat(e.toArray(),r.toArray());this.points.geometry.setAttribute("position",new f.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 f.Vector3(e[0],e[1],e[2]),new f.Vector3(e[3],e[4],e[5])]},t.prototype.setMaterial=function(e){var r=this.line.material;for(var i in e)if(e.hasOwnProperty(i)){var a=e[i];i==="dashed"?(r.dashed=a,a?r.defines.USE_DASH="":delete r.defines.USE_DASH,r.needsUpdate=!0):r[i]=e[i]}this.needsRender=!0},t.prototype.setResolution=function(e,r){var i=this.line.material.resolution;(i.x!==e||i.y!==r)&&(i.set(e,r),this.needsRender=!0)},t}(f.Object3D);Object.assign(ko.prototype,{isFiveLine:!0});var rt={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 Xl(n){return sa(this,void 0,void 0,function(){var t;return ua(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 CA(n){return sa(this,void 0,void 0,function(){var t,e;return ua(this,function(r){switch(r.label){case 0:if(!n)throw new Error("No basePath supplied");return t="profilesList.json",[4,Xl("".concat(n,"/").concat(t))];case 1:return e=r.sent(),[2,e]}})})}function IA(n,t){return sa(this,arguments,void 0,function(e,r,i,a){var o,s,u,l,c,d;return i===void 0&&(i=null),a===void 0&&(a=!0),ua(this,function(p){switch(p.label){case 0:if(!e)throw new Error("No xrInputSource supplied");if(!r)throw new Error("No basePath supplied");return[4,CA(r)];case 1:if(o=p.sent(),e.profiles.some(function(A){var h=o[A];return h&&(s={profileId:A,profilePath:"".concat(r,"/").concat(h.path),deprecated:!!h.deprecated}),!!s}),!s){if(!i)throw new Error("No matching profile name found");if(u=o[i],!u)throw new Error('No matching profile name found and default profile "'.concat(i,'" missing.'));s={profileId:i,profilePath:"".concat(r,"/").concat(u.path),deprecated:!!u.deprecated}}return[4,Xl(s.profilePath)];case 2:if(l=p.sent(),a){if(d=void 0,d=l.layouts[e.handedness],!d)throw new Error("No matching handedness, ".concat(e.handedness,", in profile ").concat(s.profileId));d.assetPath&&(c=s.profilePath.replace("profile.json",d.assetPath))}return[2,{profile:l,assetPath:c}]}})})}var TA={xAxis:0,yAxis:0,button:0,state:rt.ComponentState.DEFAULT};function PA(n,t){n===void 0&&(n=0),t===void 0&&(t=0);var e=n,r=t,i=Math.sqrt(n*n+t*t);if(i>1){var a=Math.atan2(t,n);e=Math.cos(a),r=Math.sin(a)}var o={normalizedXAxis:e*.5+.5,normalizedYAxis:r*.5+.5};return o}var RA=function(){function n(t){this.componentProperty=t.componentProperty,this.states=t.states,this.valueNodeName=t.valueNodeName,this.valueNodeProperty=t.valueNodeProperty,this.valueNodeProperty===rt.VisualResponseProperty.TRANSFORM&&(this.minNodeName=t.minNodeName,this.maxNodeName=t.maxNodeName),this.value=0,this.updateFromComponent(TA)}return n.prototype.updateFromComponent=function(t){var e=t.xAxis,r=t.yAxis,i=t.button,a=t.state,o=PA(e,r),s=o.normalizedXAxis,u=o.normalizedYAxis;switch(this.componentProperty){case rt.ComponentProperty.X_AXIS:this.value=this.states.includes(a)?s:.5;break;case rt.ComponentProperty.Y_AXIS:this.value=this.states.includes(a)?u:.5;break;case rt.ComponentProperty.BUTTON:this.value=this.states.includes(a)?i:0;break;case rt.ComponentProperty.STATE:this.valueNodeProperty===rt.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(a):this.value=this.states.includes(a)?1:0;break;default:throw new Error("Unexpected visualResponse componentProperty ".concat(this.componentProperty))}},n}(),BA=function(){function n(t,e){var r=this;if(!t||!e||!e.visualResponses||!e.gamepadIndices||Object.keys(e.gamepadIndices).length===0)throw new Error("Invalid arguments supplied");this.id=t,this.type=e.type,this.rootNodeName=e.rootNodeName,this.touchPointNodeName=e.touchPointNodeName,this.visualResponses={},Object.keys(e.visualResponses).forEach(function(i){var a=new RA(e.visualResponses[i]);r.visualResponses[i]=a}),this.gamepadIndices=Object.assign({},e.gamepadIndices),this.values={state:rt.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=O({id:this.id},this.values);return t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(t){var e=this;if(this.values.state=rt.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=rt.ComponentState.PRESSED:(r.touched||this.values.button>rt.ButtonTouchThreshold)&&(this.values.state=rt.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===rt.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>rt.AxisTouchThreshold&&(this.values.state=rt.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===rt.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>rt.AxisTouchThreshold&&(this.values.state=rt.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(function(i){i.updateFromComponent(e.values)})},n}(),FA=function(){function n(t,e,r){var i=this;if(!t)throw new Error("No xrInputSource supplied");if(!e)throw new Error("No profile supplied");this.xrInputSource=t,this.assetUrl=r,this.id=e.profileId,this.layoutDescription=e.layouts[t.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach(function(a){var o=i.layoutDescription.components[a];i.components[a]=new BA(a,o)}),this.updateFromGamepad()}return Object.defineProperty(n.prototype,"gripSpace",{get:function(){return this.xrInputSource.gripSpace},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"targetRaySpace",{get:function(){return this.xrInputSource.targetRaySpace},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"data",{get:function(){var t=[];return Object.values(this.components).forEach(function(e){t.push(e.data)}),t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(){var t=this;Object.values(this.components).forEach(function(e){e.updateFromGamepad(t.xrInputSource.gamepad)})},n}(),LA="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",kA="generic-trigger",OA=function(n){ue(t,n);function t(){var e=n.call(this)||this;return e.motionController=null,e.envMap=null,e}return t.prototype.setEnvironmentMap=function(e){var r=this;return this.envMap==e?this:(this.envMap=e,this.traverse(function(i){i instanceof f.Mesh&&i.isMesh&&(i.material.envMap=r.envMap,i.material.needsUpdate=!0)}),this)},t.prototype.updateMatrixWorld=function(e){n.prototype.updateMatrixWorld.call(this,e),this.motionController&&(this.motionController.updateFromGamepad(),Object.values(this.motionController.components).forEach(function(r){Object.values(r.visualResponses).forEach(function(i){var a=i.valueNode,o=i.minNode,s=i.maxNode,u=i.value,l=i.valueNodeProperty;a&&(l===rt.VisualResponseProperty.VISIBILITY?a.visible=u:l===rt.VisualResponseProperty.TRANSFORM&&(a.quaternion.copy(o.quaternion).slerp(s.quaternion,u),a.position.lerpVectors(o.position,s.position,u)))})}))},t}(ni.Object3D);function DA(n,t){Object.values(n.components).forEach(function(e){var r=e.type,i=e.touchPointNodeName,a=e.visualResponses;if(r===rt.ComponentType.TOUCHPAD)if(e.touchPointNode=t.getObjectByName(i),e.touchPointNode){var o=new ni.SphereGeometry(.001),s=new ni.MeshBasicMaterial({color:255}),u=new ni.Mesh(o,s);e.touchPointNode.add(u)}else console.warn("Could not find touch dot, ".concat(e.touchPointNodeName,", in touchpad component ").concat(e.id));Object.values(a).forEach(function(l){var c=l.valueNodeName,d=l.minNodeName,p=l.maxNodeName,A=l.valueNodeProperty;if(A===rt.VisualResponseProperty.TRANSFORM){if(l.minNode=t.getObjectByName(d),l.maxNode=t.getObjectByName(p),!l.minNode){console.warn("Could not find ".concat(d," in the model"));return}if(!l.maxNode){console.warn("Could not find ".concat(p," in the model"));return}}l.valueNode=t.getObjectByName(c),l.valueNode||console.warn("Could not find ".concat(c," in the model"))})})}function _0(n,t){DA(n.motionController,t),n.envMap&&t.traverse(function(e){e instanceof f.Mesh&&e.isMesh&&(e.material.envMap=n.envMap,e.material.needsUpdate=!0)}),n.add(t)}var VA=function(){function n(t){t===void 0&&(t=null),this.gltfLoader=t,this.path=LA,this._assetCache={}}return n.prototype.createControllerModel=function(t){var e=this,r=new OA,i=null;return t.addEventListener("connected",function(a){var o=a.data;o.targetRayMode!=="tracked-pointer"||!o.gamepad||IA(o,e.path,kA).then(function(s){var u=s.profile,l=s.assetPath;r.motionController=new FA(o,u,l);var c=e._assetCache[r.motionController.assetUrl];if(c)i=c.scene.clone(),_0(r,i);else{if(!e.gltfLoader)throw new Error("GLTFLoader not set.");e.gltfLoader.load(r.motionController.assetUrl,function(d){e._assetCache[r.motionController.assetUrl]=d,i=d.scene.clone(),_0(r,i)})}}).catch(function(s){console.warn(s)})}),t.addEventListener("disconnected",function(){r.motionController=null,r.remove(i),i=null}),r},n}();function NA(n,t){return n}var j0=300,zA=new f.Matrix4().makeRotationAxis(new f.Vector3(0,1,0),Math.PI),J0=new f.Vector3(-1,1,1),UA=function(n){ue(t,n);function t(e){var r=n.call(this,e)||this;r.xrManager=new xA(r.renderer,r.renderer.getContext(),{onSessionStart:function(u){r.emit("xr.session.start",X("xr.session.start",{session:u,machineType:r.xrManager.machineType}))},onSessionEnd:function(){r.emit("xr.session.end",X("xr.session.end",{session:null,machineType:r.xrManager.machineType}))}}),r.xrControllerRay={left:new f.Raycaster,right:new f.Raycaster},r.xrControllerRay.left.params.Points={threshold:.1},r.xrControllerRay.right.params.Points={threshold:.1},r.gazeRay=null,r.pointerLines={left:new ko,right:new ko},r.pointerLines.left.visible=!1,r.pointerLines.right.visible=!0,r.pointerLines.left.setMaterial({color:new f.Vector3(1,1,1)}),r.pointerLines.left.points.material.depthTest=!1,r.pointerLines.right.setMaterial({color:new f.Vector3(1,1,1)}),r.pointerLines.right.points.material.depthTest=!1,r.controllerWrappers=[new f.Group,new f.Group];var i=r.xrManager.getController(0);r.controllerWrappers[0].add(i);var a=r.xrManager.getController(1);r.controllerWrappers[1].add(a);var o=new VA;o.gltfLoader={load:function(u,l){Zi.ajax(u,{responseType:"arraybuffer"}).then(function(c){var d;return Jo(c.body,{resourcePath:u.slice(0,u.lastIndexOf("/")+1),search:(d=u.split("?")[1])!==null&&d!==void 0?d:"",fetcher:Zi})}).then(function(c){return l(c)})}},(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=Ut()]={panoId:He(r.currentPano),leftPanoPicture:null,position:r.camera.pose.offset.clone(),effect:"fade",fixCameraTransform:new f.Matrix4},r.parallaxCameraMatrixs=[];var s=Et.shared.getContext();return s?(r.on("xr.session.end",function(){r.scene.remove(r.pointerLines.left,r.pointerLines.right)}),r.xrManager.setSession(s),r.on("xr.session.start",function(){var u=r.xrManager.getControllerGrip(0);u.add(o.createControllerModel(u)),r.controllerWrappers[0].add(u);var l=r.xrManager.getControllerGrip(1);l.add(o.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=O(O({},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 O(O({},i),{mode:"XRPanorama"})},t.prototype.moveToPano=function(e,r,i){var a=this,o,s,u,l,c=(o=r.effect)!==null&&o!==void 0?o:"fade";this.userAction=i,this.stopMomentumMovement();var d=this.works.getResolvedObserver(e);if(!d)throw new Error("Invalid PanoIndex");var p=di(d.images.up),A=this.imageOptions.size;typeof A=="undefined"&&d&&p&&(A=Number(p)),typeof A=="undefined"&&(A=2048);var h=this.imageOptions.transform,v=function(M,I){return NA(xn(M,h,I))},g=O({key:"pano.".concat(d.panoId)},rr(this.imageOptions,["format","size","quality"])),m=d.images,y=(u=(s=d.images.tiles)===null||s===void 0?void 0:s.filter(function(M){return M.size>A}))!==null&&u!==void 0?u:null,b="pano:"+ca([m,g,h]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===b)return;var x=this.pendingTextureTask.panoId;(l=this.panoMeshes[x])===null||l===void 0||l.setProgress(0),this.emit("pano.texture.abort",X("pano.texture.abort",{error:null,progress:0,meta:null,pano:d.pano}))}var w=this.models.getMaterial()||{},E=w.pano0,S=w.pano1,C;if((E==null?void 0:E.map.name)===b?C=E:(S==null?void 0:S.map.name)===b&&(C=S),C){var R={panoId:d.panoId,effect:c,leftPanoPicture:{zoom:1,map:C.map,luminanceMap:C.luminanceMap,matrix:new f.Matrix4().compose(d.position,d.quaternion,J0)},position:d.position.clone(),fixCameraTransform:new f.Matrix4};this.doMoveToPano(d.pano,R,r);return}var B="move-to-pano-"+d.panoId;this.pending.add(B),this.pendingTextureTask={panoId:d.panoId,hash:b,onLoad:function(M){if(a.pending.delete(B),a.destroyed)M.body.dispose();else{M.body.name=b;var I={panoId:d.panoId,effect:c,leftPanoPicture:{zoom:1,map:M.body,luminanceMap:null,matrix:new f.Matrix4().compose(d.position,d.quaternion,J0)},position:d.position.clone(),fixCameraTransform:new f.Matrix4};a.doMoveToPano(d.pano,I,r)}},onError:function(M){a.pending.delete(B);var I=O(O(O({},d.pano),{mode:a.mode}),tt(a.camera.pose));a.emit("pano.error",X("pano.error",{error:M,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:I})),a.emit("pano.cancel",X("pano.cancel",{error:null,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:I})),r.moveCancelCallback&&r.moveCancelCallback()}},Promise.all([this.tileLevelForFov&&y&&y.length?this.textureLoader.loadTiledCubeTexture(m,y,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:v,options:g},format:f.RGBAFormat,minFilter:f.LinearFilter,magFilter:f.LinearFilter,generateMipmaps:!1,viaAjax:!0,fetcher:pt(d.work)},void 0,void 0,function(M){var I,L;a.emit("pano.texture.progress",X("pano.texture.progress",{error:null,progress:M,meta:null,pano:d.pano})),((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===b&&((L=a.panoMeshes[d.panoId])===null||L===void 0||L.setProgress(M))},this.renderer):this.textureLoader.loadCubeTexture(m,{imageURL:{transform:v,options:g},format:f.RGBAFormat,fetcher:pt(d.work)},void 0,void 0,function(M){var I,L;((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===b&&((L=a.panoMeshes[d.panoId])===null||L===void 0||L.setProgress(M)),a.emit("pano.texture.progress",X("pano.texture.progress",{error:null,progress:M,meta:null,pano:d.pano}))},this.renderer)]).then(function(M){var I,L,T=M[0];((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===b?(a.pendingTextureTask.onLoad(T),(L=a.panoMeshes[d.panoId])===null||L===void 0||L.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.success",X("pano.texture.success",{error:null,progress:1,meta:T.meta,pano:d.pano}))):T.body.dispose()}).catch(function(M){var I,L;((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===b&&(a.pendingTextureTask.onError(M),(L=a.panoMeshes[d.panoId])===null||L===void 0||L.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.error",X("pano.texture.error",{error:M,progress:0,meta:null,pano:d.pano})),a.emit("error",M))}),this.emit("pano.texture.load",X("pano.texture.load",{error:null,progress:0,meta:null,pano:d.pano}))},t.prototype.doMoveToPano=function(e,r,i){var a=this,o,s,u,l,c,d,p,A,h,v;i===void 0&&(i={});var g=ve(),m=Ut();this.panoResources[m]=r;var y=1,b,x,w;if(this.locationMotion.ended){var E=this.locationMotion.getKeyFrameSegment(g);E[0];var S=E[1],C=this.locationMotion.value,R=this.panoResourceFromLocationMotionKeyframe(S).position,B=r.position;b=Math.max(R.distanceTo(B),y),x=[{key:S.key,progress:0,value:O(O({},C),{count:0})},{key:m,progress:1,value:{distance:0,count:1}}],w=0}else{var M=this.locationMotion.getKeyFrameSegment(g),I=M[0],S=M[1],C=this.locationMotion.value,L=this.panoResourceFromLocationMotionKeyframe(I).position,R=this.panoResourceFromLocationMotionKeyframe(S).position,B=r.position,T=S.value.count-C.count,F=Math.max(L.distanceTo(R),y)*T,D=Math.max(R.distanceTo(B),y);b=F+D,x=[{key:I.key,progress:0,value:O({},C)},{key:S.key,progress:F/b,value:S.value},{key:m,progress:1,value:{count:S.value.count+1,distance:0}}];var V=this.locationMotionKeyframesLength(this.locationMotion.keyframes),z=this.locationMotionKeyframesLength(x);w=this.locationMotion.getProgressVelocity(g)*V/z}var Q=r.effect==="instant"?0:this.calculateMovingDuration(i.duration,r.effect==="fly"?b:0),q={longitude:i.longitude,latitude:i.latitude,fov:i.fov},G=O(O({},e),{mode:this.mode,longitude:(o=q.longitude)!==null&&o!==void 0?o:this.camera.pose.longitude,latitude:(s=q.latitude)!==null&&s!==void 0?s:this.camera.pose.latitude,fov:(u=q.fov)!==null&&u!==void 0?u:this.camera.pose.fov,offset:r.position.clone(),distance:0}),K=this.currentPano;if(this.emit("pano.moveTo",X("pano.moveTo",{options:i,prevPano:K,progress:0,state:G,userAction:this.userAction,error:null})),i.moveStartCallback&&i.moveStartCallback(G),this.videoTexture&&this.videoTexture.image instanceof HTMLVideoElement&&this.videoTexture.image.getAttribute("src")&&(this.videoTexture.image.pause(),this.videoTexture.image.removeAttribute("uuid"),this.videoTexture.image.removeAttribute("src"),this.videoTexture.image.oncanplay=U,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),r.effect==="fly")this.cameraMotion.set(q,Q).catch(U);else{var j=tr({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),J=tr({longitude:(l=q.longitude)!==null&&l!==void 0?l:this.cameraMotion.value.longitude,latitude:(c=q.latitude)!==null&&c!==void 0?c:this.cameraMotion.value.latitude}),W=new f.Object3D;W.lookAt(j);var $=new f.Matrix4().makeRotationFromQuaternion(W.quaternion);W.lookAt(J);var Y=new f.Matrix4().makeRotationFromQuaternion(W.quaternion),Z=new f.Matrix4().getInverse($).premultiply(Y),oe=this.cameraMotion.value.fov,ne=(d=q.fov)!==null&&d!==void 0?d:this.cameraMotion.value.fov,de=1;r.effect==="zoomin"?de=1.5:r.effect==="zoomout"&&(de=.4);for(var se=ne*de,ye=0;ye<x.length-1;ye++){var ie=x[ye].key;if(ie){var xe=this.panoResources[ie];xe&&(xe.fixCameraTransform.copy(Z),xe.leftPanoPicture&&(xe.leftPanoPicture.zoom=Math.tan(oe/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:(p=q.longitude)!==null&&p!==void 0?p:this.cameraMotion.value.longitude,latitude:(A=q.latitude)!==null&&A!==void 0?A:this.cameraMotion.value.latitude,fov:se}},{progress:1,value:{longitude:(h=q.longitude)!==null&&h!==void 0?h:this.cameraMotion.value.longitude,latitude:(v=q.latitude)!==null&&v!==void 0?v:this.cameraMotion.value.latitude,fov:ne}}],Q).catch(U)}var Le=this.locationMotion.setKeyframes(x,Q,w);Le.then(function(){for(var Me,Oe,ee,re=0,H=a.models;re<H.length;re++){var Be=H[re];Be.show()}var Te=O(O({},e),{mode:a.mode,longitude:a.camera.pose.longitude,latitude:a.camera.pose.latitude,fov:a.camera.pose.fov,offset:a.camera.pose.offset.clone(),distance:0});a.emit("pano.arrived",X("pano.arrived",{options:i,prevPano:K,progress:1,state:Te,userAction:a.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(Te);var Ce=a.works.getResolvedObserver(a.currentPano);if(Ce&&Ce.video&&a.videoTexture&&a.videoTexture.image instanceof HTMLVideoElement){var Ue=zA.clone().multiply((ee=(Oe=(Me=a.models.getMaterial())===null||Me===void 0?void 0:Me.pano1)===null||Oe===void 0?void 0:Oe.matrix)!==null&&ee!==void 0?ee:new f.Matrix4).multiply(Ce.video.matrix),Ie={map:a.videoTexture,size:Ce.video.size,matrix:Ue,alpha:1},we=Ut(),be=a.videoTexture.image;be.setAttribute("uuid",we),Vl().then(function(Ae){Ae&&Ce.video&&be.getAttribute("uuid")===we&&(be.oncanplay=function(){be.oncanplay=U,be.play()},be.ontimeupdate=function(){be.currentTime>.5&&(be.ontimeupdate=U,a.panoVideo.setMaterial(Ie))},be.src=Ce.video.source)}).catch(function(){be.removeAttribute("uuid")})}},function(){a.emit("pano.cancel",X("pano.cancel",{options:i,prevPano:K,progress:0,state:G,userAction:a.userAction,error:null})),i.moveCancelCallback&&i.moveCancelCallback()})},t.prototype.checkSelectedPano=function(e){var r=this,i,a,o,s;this.stopMomentumMovement();var u=this.camera.getDirection(new f.Vector3).setY(0),l=null,c=this.works.getResolvedObserver(this.currentPano);if(!c)return null;var d=c.accessibleIds.filter(function(J){var W=Lt(J);if(pr(W,r.currentPano))return!1;var $=r.works.getResolvedObserver(W);return!$||$.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:$.loadable||$.active}),p=this.models.intersectRaycaster(e)[0];if(p){var A=Ir(d,function(J){var W=r.works.getResolvedObserver(J);if(!W)return 1/0;var $=W.standingPosition.clone();return $.distanceTo(p.point)},!0),h=A[0],v=A[1];h&&v<this.panoTapTriggerRadius&&(l=(i=this.works.getResolvedObserver(h))!==null&&i!==void 0?i:null)}if(q0(l)){var g=this.getForwardObserverOrNot(e);g&&(l=g)}for(var m=0,y=this.locationMotion.keyframes;m<y.length;m++){var b=y[m],x=this.panoResourceFromLocationMotionKeyframe(b);if(!(b.progress<this.locationMotion.progress)&&l&&x.panoId===l.panoId){l=null;break}}if(q0(l))return this.locationMotion.ended===!0&&this.cameraBounce(),null;if(l&&!l.active){var w=l.panoId;this.panoMeshes[w]&&(this.panoMeshes[w].setDisabled(!1),this.panoMeshes[w].setLoading(!0))}var E={};if(l){for(var S=Math.PI/6,C=Math.PI/12,R=new f.Vector3(0,1,0),B=l.position.clone().setY(0).sub(c.position.clone().setY(0)).normalize(),M=B.clone().applyAxisAngle(R,S),I=B.clone().applyAxisAngle(R,-S),L=[],T=[],F=[],D=0,V=l.accessibleIds;D<V.length;D++){var h=V[D],z=Lt(h);if(!(pr(z,this.currentPano)||pr(z,l.pano))){var Q=this.works.getResolvedObserver(h);if(Q){var q=Q.position.clone().sub(l.position).setY(0);B.angleTo(q)<S?F.push(q):M.angleTo(q)<S?L.push(q):I.angleTo(q)<S&&T.push(q)}}}var G=F.length>0?F:vt(vt([],L,!0),T,!0),K=G.slice().sort(function(J,W){return J.angleTo(B)-W.angleTo(B)})[0];K&&K.angleTo(u)>C&&(E.longitude=Math.atan2(-K.x,-K.z))}this.cameraMotion.value.latitude<-Math.PI/4&&(E.latitude=ce(0,this.minLatitude,this.maxLatitude)),this.cameraMotion.value.fov<60&&(E.fov=this.defaultFov);var j={workCode:l.pano.workCode,panoIndex:l.pano.panoIndex,mode:this.mode,longitude:(a=E.longitude)!==null&&a!==void 0?a:this.camera.pose.longitude,latitude:(o=E.latitude)!==null&&o!==void 0?o:this.camera.pose.latitude,fov:(s=E.fov)!==null&&s!==void 0?s:this.camera.pose.fov,distance:0,offset:l?l.position.clone():new f.Vector3};return this.emit("pano.select",X("pano.select",{prevPano:this.currentPano,state:j,userAction:!0,options:E,progress:0,error:null})),l&&l.active?(this.emit("pano.request",X("pano.request",{userAction:!0,prevPano:this.currentPano,progress:0,state:j,options:E,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,a,o,s,u,l,c,d,p,A=[],h=2;h<arguments.length;h++)A[h-2]=arguments[h];this.userAction=!0;var v={},g={},m=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),y=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),b=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),g.longitude=this.cameraMotion.value.longitude,g.latitude=this.cameraMotion.value.latitude,g.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),v.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(ce(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var x=this.locationMotion.getKeyFrameSegment(e),w=x[0],E=x[1],S=this.panoResourceFromLocationMotionKeyframe(w),C=this.panoResourceFromLocationMotionKeyframe(E),R=new f.Vector3().copy(S.position),B=new f.Vector3().copy(C.position),M=this.locationMotion.value.count-E.value.count+1;v.progress=M,C.leftPanoPicture&&(M<1?S.leftPanoPicture&&(v.pano0=S.leftPanoPicture):v.pano0=C.leftPanoPicture,v.pano1=C.leftPanoPicture),C.effect==="montage"?v.transition="BLACK":C.effect==="spread"?v.transition="SPREAD":v.transition="FADE",(C.effect==="zoomin"||C.effect==="zoomout")&&(v.progress=Math.pow(M,3)),M<1&&C.effect!=="fly"&&(v.pano0&&S.leftPanoPicture&&(v.pano0={map:v.pano0.map,zoom:v.pano0.zoom,luminanceMap:v.pano0.luminanceMap,matrix:S.leftPanoPicture.matrix.clone().setPosition(C.position)}),R.copy(B),b=!0),g.distance=this.locationMotion.value.distance,g.offset=new f.Vector3(R.x+(B.x-R.x)*M,R.y+(B.y-R.y)*M,R.z+(B.z-R.z)*M);for(var I=[],L=[],T=0,F=this.locationMotion.keyframes;T<F.length;T++){var D=F[T],V=D.key,z=D.progress;V!==void 0&&(I.push(V),z>this.locationMotion.progress&&L.push(V))}for(var Q=0,q=Object.keys(this.panoResources);Q<q.length;Q++){var G=q[Q];if(!(L.indexOf(G)>=0)){var K=this.panoResources[G];if(K.leftPanoPicture){var j=K.leftPanoPicture.map;if(j){if(j===((a=v.pano0)===null||a===void 0?void 0:a.map)||j===((o=v.pano1)===null||o===void 0?void 0:o.map))continue;j instanceof qe&&j.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(j.cubeRenderTarget),j.dispose(),K.leftPanoPicture=null}}I.indexOf(G)>=0||delete this.panoResources[G]}}this.currentPano=Lt(C.panoId),this.emit("pano.moving",X("pano.moving",{userAction:this.userAction,prevPano:Lt(m.panoId),state:O(O(O(O({},Lt(y.panoId)),{mode:this.mode}),tt(this.camera.pose)),g),options:{},progress:this.locationMotion.progress,error:null}))}ar(v)===!1&&(!((s=v.pano0)===null||s===void 0)&&s.map&&v.pano0.map instanceof qe&&!v.pano0.map.cubeRenderTarget&&(v.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((u=v.pano1)===null||u===void 0)&&u.map&&v.pano1.map instanceof qe&&!v.pano1.map.cubeRenderTarget&&(v.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),this.models.setMaterial(v)),ar(g)===!1&&this.setCamera(g);var J=this.works.getResolvedObserver(this.currentPano),W=A[1];if(!W){console.error("xrFrame丢失,请重试");return}if(!this.xrManager.session){console.error("session丢失,请重试");return}var $=this.xrManager.referenceSpace;if($){var Y=this.xrManager.cameraVR,Z=this.xrManager.cameraL,oe=this.xrManager.cameraR,ne=[Z,oe],de=W.getViewerPose($),se=new f.Vector3(0,0,0);if(de){var ye;ye=this.xrManager.session.renderState.baseLayer;var ie=de.views;if(!ye){console.error("no layer found");return}this.renderer.setFramebuffer(ye.framebuffer);var xe=!1;ie.length!==Y.cameras.length&&(Y.cameras.length=0,xe=!0),this.parallaxCameraMatrixs=[];var Le=new f.Vector3,Me=new f.Vector3;new f.Matrix4().fromArray(ie[0].transform.matrix).decompose(Le,new f.Quaternion,new f.Vector3),new f.Matrix4().fromArray(ie[1].transform.matrix).decompose(Me,new f.Quaternion,new f.Vector3),Me.clone().sub(Le).normalize();var Oe=new f.Vector3,ee=new f.Quaternion,re=new f.Vector3;this.camera.matrix.decompose(Oe,ee,re);for(var H=0;H<ie.length;H++){var Be=ie[H],Te=ye.getViewport(Be),Ce=ne[H];Ce.matrix.fromArray(Be.transform.matrix);var Ue=new f.Vector3,Ie=new f.Quaternion,we=new f.Vector3;Ce.matrix.decompose(Ue,Ie,we),se.copy(Oe),Ce.position.copy(Oe),Ce.quaternion.copy(Ie),Ce.scale.copy(we),Ce.updateMatrix(),Ce.projectionMatrix.fromArray(Be.projectionMatrix),Ce.viewport.set(Te.x,Te.y,Te.width,Te.height),xe===!0&&Y.cameras.push(Ce)}if(this.xrManager.session&&this.xrManager.session.inputSources){for(var H=0;H<this.xrManager.session.inputSources.length;H++)if(this.xrManager.session.inputSources[H]&&this.xrManager.session.inputSources[H].targetRayMode==="transient-pointer"){var be=W.getPose(this.xrManager.session.inputSources[H].targetRaySpace,$);if(be){var Ae=new f.Vector3(0,0,-1).applyQuaternion(be.transform.orientation),me=new f.Raycaster(this.camera.position,Ae);this.gazeRay=me}}}if(this.xrManager.machineType==="Oculus"||this.xrManager.machineType==="Pico"){for(var ze=this.xrManager.session.inputSources,H=0;H<ze.length;H++){var pe=this.xrManager.controllers[H],Se=ze[H];if(Se){pe&&pe.update(Se,W,$);var me=this.xrManager.getController(H),St=new f.Vector3(0,1.2,0),Pe=me.position.clone().add(se).sub(St);Se.handedness==="left"?this.xrControllerRay.left.set(Pe,new f.Vector3(0,0,-1).applyEuler(me.rotation)):Se.handedness==="right"&&this.xrControllerRay.right.set(Pe,new f.Vector3(0,0,-1).applyEuler(me.rotation)),this.controllerWrappers[H].position.copy(new f.Vector3(0,0,0).add(se).sub(St));var je=this.models.intersectRaycaster(this.xrControllerRay.right);if(je.length===0&&(je=this.xrControllerRay.right.intersectObject(this.boundingMesh,!0).map(function(Hr){var fn;return O({floor:(fn=J==null?void 0:J.floorIndex)!==null&&fn!==void 0?fn:0},Hr)})),je.length>=1&&je[0].face)if(Se.handedness==="right"){var it=this.xrControllerRay.right.intersectObject(this.xrCustomObjectsScene,!0),jt=je[0].face.normal,Qr=jt.clone(),Jt=je[0].point.clone();this.intersectMesh.position.copy(Jt);var ut=Jt.clone().add(Qr);if(this.intersectMesh.lookAt(ut),Math.abs(jt.y)>.99){var Mt=this.camera.position.clone().sub(Jt);this.intersectMesh.rotation.z=-Math.atan2(Mt.z,Mt.x)}this.intersectMesh.visible=!0,this.needsRender=!0,it.length>0?(this.pointerLines.right.setPoints(Pe,it[0].point),this.pointerLines.right.points.visible=!0,this.intersectMesh.visible=!1):(this.pointerLines.right.points.visible=!1,this.pointerLines.right.setPoints(Pe,je[0].point));var dt=je[0],Ct=X("intersect.update",{raycaster:(l=this.xrControllerRay.right)!==null&&l!==void 0?l:null,intersection:dt!=null?dt:null,object:this.intersectMesh});if(this.emit("intersect.update",Ct),Ct.defaultPrevented){this.hideIntersectMesh();return}}else this.pointerLines.left.setPoints(Pe,je[0].point)}}this.updateControllerHelper(ze,e,r)}if(this.camera.pose.distance>.1||b)for(var It=0,Tt=Object.keys(this.panoMeshes);It<Tt.length;It++){var Xe=Tt[It],Ne=this.panoMeshes[Xe];Ne.setOpacity(0),Ne.setCurrent(!1),Ne.updateTime&&Ne.updateTime(e,r),Ne.visible=!1}else if(J){var We=Ir(J.visibleIds,function(Pt){var or=i.works.getResolvedObserver(Pt);return or?J.standingPosition.distanceTo(or.standingPosition):1/0},!0),At=We[1];At=ce(At,2.5,1/0);for(var Ze=J.visibleIds.concat(He(this.currentPano)),gt=this.getForwardObserverOrNot(),qt=this.camera.getDirection(new f.Vector3),yt=0,Xt=Object.keys(this.panoMeshes);yt<Xt.length;yt++){var Xe=Xt[yt],Ne=this.panoMeshes[Xe],gr=this.works.getResolvedObserver(Xe);if(Ze.indexOf(Xe)===-1)Ne.setCurrent(!1),Ne.setOpacity(0);else if(!gr)Ne.setCurrent(!1),Ne.setOpacity(0);else if(!gr.loadable&&!gr.active)Ne.setCurrent(!1),Ne.setOpacity(0);else{var qr=Ne.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);Ne.setCurrent(!Ne.loading&&Ne.progress===0&>!==null&>.panoId===Xe),Ne.setOpacity(qr<.01?0:ce(At/qr*1.2,.65,.98));var yr=this.camera.position.clone().setY(Ne.position.y),Ae=new f.Vector3().copy(Ne.position).sub(yr).normalize();if(Xe===He(this.currentPano)){var Pr=ce((.5-yr.distanceTo(Ne.position))/.5,0,1);Ae.multiplyScalar(1-Pr).add(qt.clone().multiplyScalar(Pr))}Ae.length()>0&&Ne.quaternion.setFromEuler(new f.Euler(0,Math.atan2(Ae.x,Ae.z),0))}Ne.updateTime&&Ne.updateTime(e,r)}}var Ot=function(){return 4}(),Ge=function(){var Pt=new f.PerspectiveCamera;Pt.applyMatrix4(Y.matrix),Pt.position.set(0,0,0);var or=i.works.getResolvedObserver(y.panoId),Hr=or!=null?or:J;Hr&&Pt.quaternion.premultiply(Hr.quaternion.clone().inverse()),Pt.updateProjectionMatrix(),Pt.updateMatrixWorld(!0);var fn=new f.Frustum().setFromProjectionMatrix(new f.Matrix4().multiplyMatrices(Pt.projectionMatrix,Pt.matrixWorldInverse));return fn}();y.panoId===He(this.currentPano)&&((c=y.leftPanoPicture)===null||c===void 0?void 0:c.map)instanceof qe&&(y.leftPanoPicture.map.maxRequest=this.tileMaxRequest,y.leftPanoPicture.map.update(Ge,Ot),y.leftPanoPicture.map.needsRender===!0&&(this.needsRender=!0,this.modelSceneNeedsRender=!0));{var ke=this.tiling.object.visible;if(this.initAnimationed){var Ye=y.panoId,bt=this.works.getResolvedObserver(Ye);bt?Ii(this.camera.position,bt.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==Ye&&this.tiling.cleanup(),this.tiling.panoId=Ye,this.tiling.setResource((p=(d=bt.images)===null||d===void 0?void 0:d.tiles)!==null&&p!==void 0?p:[],this.enableIOSEDR&&bt.images.luminance?bt.images.luminance:null),this.tiling.setFetcher(pt(bt.work)),this.tiling.setRotation(bt.quaternion),this.tiling.setPosition(bt.position),this.tiling.maxRequest=this.tileMaxRequest,Ot>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update(Ge,Ot,e):this.tiling.update(Ge,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;ke!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0,this.modelSceneNeedsRender=!0)}this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e)}}},t.prototype.render=function(){var e=this.xrManager.getCamera(this.camera);this.renderer.render(this.modelScene,e),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,e),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0},t.prototype.onPanGesture=function(){},t.prototype.onTapGesture=function(){},t.prototype.onPinchGesture=function(){},t.prototype.onMouseMove=function(){},t.prototype.onMouseOut=function(){},t.prototype.panoResourceFromLocationMotionKeyframe=function(e){return this.panoResources[e.key]},t.prototype.updateControllerHelper=function(e,r,i){var a=this.xrControllerRay.left,o=this.xrControllerRay.right;if(!(!e||e.length===0)){for(var s={buttons:{X:!1,Y:!1,LeftTrigger:!1,LeftPinch:!1,A:!1,B:!1,RightTrigger:!1,RightPinch:!1}},u=0;u<e.length;u++){var l=e[u].handedness,c=e[u].gamepad;switch(l){case"left":c.axes&&(this.emitHandleEvent(c.axes[2]===-1,"LeftAxesLeft",r),this.emitHandleEvent(c.axes[2]===1,"LeftAxesRight",r),this.emitHandleEvent(c.axes[3]===-1,"LeftAxesUp",r),this.emitHandleEvent(c.axes[3]===1,"LeftAxesDown",r)),c!=null&&c.buttons&&(c.buttons[4]&&this.emitHandleEvent(c.buttons[4].pressed,"X",r),c.buttons[5]&&this.emitHandleEvent(c.buttons[5].pressed,"Y",r),c.buttons[0]&&this.emitHandleEvent(c.buttons[0].pressed,"LeftTrigger",r),c.buttons[1]&&this.emitHandleEvent(c.buttons[1].pressed,"LeftPinch",r));var d={raycaster:a,axes:{up:c.axes&&c.axes[3]<0?Math.abs(c.axes[3]):0,down:c.axes&&c.axes[3]<0?0:Math.abs(c.axes[3]),left:c.axes&&c.axes[2]<0?Math.abs(c.axes[2]):0,right:c.axes&&c.axes[2]<0?0:Math.abs(c.axes[2])},deltaTime:i};s.buttons.X=c.buttons&&c.buttons[4]?c.buttons[4].pressed:!1,s.buttons.Y=c.buttons&&c.buttons[5]?c==null?void 0:c.buttons[5].pressed:!1,s.buttons.LeftTrigger=c.buttons&&c.buttons[0]?c==null?void 0:c.buttons[0].pressed:!1,s.buttons.LeftPinch=c.buttons&&c.buttons[1]?c==null?void 0:c.buttons[1].pressed:!1,s.left=d;break;case"right":c.axes&&(this.emitHandleEvent(c.axes[2]===-1,"RightAxesLeft",r),this.emitHandleEvent(c.axes[2]===1,"RightAxesRight",r),this.emitHandleEvent(c.axes[3]===-1,"RightAxesUp",r),this.emitHandleEvent(c.axes[3]===1,"RightAxesDown",r)),c.buttons&&(c.buttons[4]&&this.emitHandleEvent(c.buttons[4].pressed,"A",r),c.buttons[5]&&this.emitHandleEvent(c.buttons[5].pressed,"B",r),c.buttons[0]&&this.emitHandleEvent(c.buttons[0].pressed,"RightTrigger",r),c.buttons[1]&&this.emitHandleEvent(c.buttons[1].pressed,"RightPinch",r));var p={raycaster:o,axes:{up:c.axes&&c.axes[3]<0?Math.abs(c.axes[3]):0,down:c.axes&&c.axes[3]<0?0:Math.abs(c.axes[3]),left:c.axes&&c.axes[2]<0?Math.abs(c.axes[2]):0,right:c.axes&&c.axes[2]<0?0:Math.abs(c.axes[2])},deltaTime:i};s.right=p,s.buttons.A=c.buttons&&c.buttons[4]?c==null?void 0:c.buttons[4].pressed:!1,s.buttons.B=c.buttons&&c.buttons[5]?c==null?void 0:c.buttons[5].pressed:!1,s.buttons.RightTrigger=c.buttons&&c.buttons[0]?c==null?void 0:c.buttons[0].pressed:!1,s.buttons.RightPinch=c.buttons&&c.buttons[1]?c==null?void 0:c.buttons[1].pressed:!1;break}}this.emit("xr.controller.update",X("xr.controller.update",s))}},t.prototype.emitHandleEvent=function(e,r,i){var a=this.xrControllerRay.left,o=this.xrControllerRay.right;if(e)if(this.xrHandleState[r].touchStart===!1)this.xrHandleState[r].touchStartTime=i,this.xrHandleState[r].touchStart=!0,this.emit("xr.gesture.buttonDown",X("xr.gesture.buttonDown",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!1,isFirst:!0,controllers:{raycaster:{leftRay:a,rightRay:o}}}));else{var s=i-this.xrHandleState[r].touchStartTime;s>j0&&this.emit("xr.gesture.press",X("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!0,controllers:{raycaster:{leftRay:a,rightRay:o}}}))}else if(this.xrHandleState[r].touchStart===!0){this.emit("xr.gesture.buttonUp",X("xr.gesture.buttonUp",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:a,rightRay:o}}}));var s=i-this.xrHandleState[r].touchStartTime;if(s<=j0){var u=X("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:a,rightRay:o}}}),l=this.emit("xr.gesture.tap",u);!l&&!u.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}(us),ht={Floorplan:Lo,Topview:dm,Panorama:us,VRPanorama:aA,Model:sA,Mapview:gA,XRPanorama:UA},Wl=["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 QA(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=tr(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 qA(){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 X0(n){var t=new f.Group;t.name="internalLights";{var e=new f.DirectionalLight(16777215,.3);e.position.copy(new f.Vector3(1,1,1)),t.add(e)}{var e=new f.DirectionalLight(16777215,.1);e.position.copy(new f.Vector3(-1,-1,-1)),t.add(e)}{var e=new f.DirectionalLight(16777215,.1);t.add(e)}{var e=new f.AmbientLight(16777215,.6);t.add(e)}n.add(t)}function HA(n){for(var t,e,r={},i=n.split(/(\;|\,)/),a=0,o=i;a<o.length;a++){var s=o[a],u=s.split("="),l=(t=u[0])===null||t===void 0?void 0:t.trim(),c=(e=u[1])===null||e===void 0?void 0:e.trim();l&&c&&(r[l]=c)}return r}function Zl(){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=HA((n=r.getAttribute("content"))!==null&&n!==void 0?n:""),a=Number(i["initial-scale"]);if(!isNaN(a))return a}}return 1}const GA="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV8AAAA/CAQAAADtPwPkAAAR+0lEQVR4AezYg3LEQACH8d1cbdu23Q5qG9G47z/TN/h6tn2b/H+TUTLc7yjcOXV46OUAnU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9dhmP3QAwFX4c079dJNq6Qi5xbuyTmpPSJ1Ur4UtF7GoTtmUL3zxaWqMU8P/k3cXSQ1EQRjHGdzdHTa4u7tzBs7CedhykNwF2/5jq56iU11db6Lv2yTj8hs3JoiU9sZZp5/62J5v1z9NjrDHaSbnbFMf52sHrDUVaidDxNG0o9+uLjfosfdb3jT5d5j757riJgst9NIZQ2Pn+ySZll80vjI6Wz/hQJG4vPG0L/H6poQch/dW3vL3B0u8jl0HvVj5PvHCElEF8DUAFikVYTcvmfBdDzQlvvMXSV5lP5zrXj/fJ54zuWaeeuoqkW8AwCIaqeTZKkmYrpPwR2eqN9X72W7EG57vU67OBeuMV8KXLUzv93UTTj42tvaFS++GVsc5JRyLSLJ8nzO555hFBmiSRCqMr4GwrcmGkib5xSvcwmzFK6e8s7DMa2xH4YZdZumSOwsVzFeBWdr37tpIhOpSwXqONNgZq/2KgvBt54znHN1HzlljTO4oVD5fb+prNIJXQNL1ofDKQisbPLJDv3jNSLq9OkYBEIihKIj3v7S1TRQCX5Kdl1ZQlol7LF+E++fwirfiq2sf4cTXxc6hzxffPuLEeqSWrPGWMF58TWr5viyJAP5/4EV4KePiaSE8eNRgjDy8/tyRW+FZjhS+2tlovNJovtJovNJ0uhK6Wo64SDdxEbM//KesjwAAAABJRU5ErkJggg==";var W0=[351,63],Z0=[20,20],KA=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),_A=new Float32Array([0,0,1,0,0,1,1,1]),jA=new Uint8Array([0,1,2,1,3,2]),ma=new f.BufferGeometry;ma.setAttribute("position",new f.BufferAttribute(KA,3));ma.setAttribute("uv",new f.BufferAttribute(_A,2));ma.setIndex(new f.BufferAttribute(jA,1));var Wi=new f.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1,fog:!1}),Yl=new f.Mesh(ma,Wi);Yl.matrixAutoUpdate=!1;var hs=new f.Scene;hs.add(Yl);hs.matrixAutoUpdate=!1;var Ti=new f.OrthographicCamera(-.5,.5,.5,-.5,.1,1);Ti.position.set(0,0,.5);Ti.lookAt(0,0,0);Ti.updateMatrixWorld(!0);Ti.matrixAutoUpdate=!1;var JA=new f.Vector4,XA=new f.Vector4;function WA(n){if(Wi.map){var r=n.getViewport(JA),i=n.getScissor(XA),a=n.getScissorTest(),o=n.autoClear,s=i.x+Z0[0]/3,u=i.y+Z0[1]/3,l=W0[0]/3,c=W0[1]/3;n.setViewport(s,u,l,c),n.setScissor(s,u,l,c),n.setScissorTest(!0),n.autoClear=!1,n.render(hs,Ti),n.setViewport(r),n.setScissor(i),n.setScissorTest(a),n.autoClear=o}else{var t=new f.Texture,e=new Image;e.onload=function(){t.image=e,t.wrapS=f.ClampToEdgeWrapping,t.wrapT=f.ClampToEdgeWrapping,t.minFilter=f.LinearFilter,t.needsUpdate=!0,t.generateMipmaps=!1,Wi.needsUpdate=!0,e.onload=U},e.src=GA,Wi.map=t}}var ZA=800,Y0=90,YA=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/")},$A=new f.Vector2,eg=new f.Sphere,Qi=new f.Frustum,qi=new f.Matrix4,$0=new WeakMap,lo=new WeakMap,co=To([]),$l=function(n){ue(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,u,l,c,d,p,A,h=n.call(this)||this;if(h.ident=Ut(),typeof window!="undefined"&&(Oo.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=O({},(i=e.imageOptions)!==null&&i!==void 0?i:{}),h.textureOptions=O({},(a=e.textureOptions)!==null&&a!==void 0?a:{}),h.poweredByRealsee=(o=e.poweredByRealsee)!==null&&o!==void 0?o:!0,h.extraElements=[],h.controllerInits={Panorama:Object.assign({},e.panorama),Model:Object.assign({},e.model),Floorplan:Object.assign({},e.floorplan),Topview:Object.assign({},e.topview),Mapview:Object.assign({},e.mapview),VRPanorama:Object.assign({},e.vrPanorama),XRPanorama:Object.assign({},e.xrPanorama)},h.fps={testCount:0,testTime:ve()},h.info=null,h.modeChangeDuration=(s=e.modeChangeDuration)!==null&&s!==void 0?s:ZA,h.enableWheel=(u=e.enableWheel)!==null&&u!==void 0?u:!0,typeof window!="undefined")if("renderer"in e)e.renderer instanceof mn&&h.throwError(new Error("cannot render a internal renderer")),h.renderer=e.renderer;else try{h.renderer=new mn({preserveDrawingBuffer:e.preserveDrawingBuffer,backgroundColor:e.backgroundColor,backgroundAlpha:e.backgroundAlpha,antialias:e.antialias,webgl2:e.webgl2,logarithmicDepthBuffer:e.logarithmicDepthBuffer,precision:e.precision,powerPreference:e.powerPreference});var v=Zl();h.renderer.setPixelRatio(v===1?window.devicePixelRatio:1),h.renderer.setSize(512,512)}catch(B){B instanceof Error&&h.throwError(B)}h.getPixelsRenderTarget=new f.WebGLRenderTarget(1,1,{encoding:(c=(l=h.renderer)===null||l===void 0?void 0:l.outputEncoding)!==null&&c!==void 0?c:f.sRGBEncoding,generateMipmaps:!1});var g=new f.DepthTexture(1,1);g.generateMipmaps=!1,g.format=f.DepthStencilFormat,g.type=f.UnsignedInt248Type,h.modelRenderTarget=new f.WebGLRenderTarget(1,1,{encoding:(p=(d=h.renderer)===null||d===void 0?void 0:d.outputEncoding)!==null&&p!==void 0?p:f.sRGBEncoding,depthTexture:g,generateMipmaps:!1,depthBuffer:!0,stencilBuffer:!0}),h.scissor=Object.assign({left:0,bottom:0,width:1,height:1},e.scissor),h.camera=new bu(Y0),h.scene=new yu,h.xrCustomObjectsScene=new f.Scene,h.scene.add(h.xrCustomObjectsScene),h.scene.matrixAutoUpdate=!1,h.lastLoadWorkTask=Promise.resolve(),h.requestProxy=(A=e.requestProxy)!==null&&A!==void 0?A:YA,h.networkSubscribe=new su,h.networkSubscribe.on("network",function(B,M,I,L){var T;h.emit("network.resource",X("network.resource",{source:B,requestType:M,requestState:I,detail:L})),(T=h.analysis)===null||T===void 0||T.network(h.works,B,M,I,L)}),h.boundingMesh=Xv(new f.Box3(new f.Vector3(-.5,-.5,-.5),new f.Vector3(.5,.5,.5))),h.boundingMesh.name="bounding",h.models=w0(),h.models.push(new Ro),h.lastModels=w0(),h.lastWorks=To([]),h.readyCallbacks=[],h.syncingState=!1,h.helperGroup=new f.Group,h.helperGroup.name="helper",h.helperGroup.matrixAutoUpdate=!1,h.scene.add(h.helperGroup),h.modelGroup=new f.Group,h.modelGroup.visible=!1,h.modelGroup.name="model",h.modelGroup.matrixAutoUpdate=!1,h.modelScene=new f.Scene,h.modelScene.add(h.modelGroup),h.modelScene.add(h.boundingMesh),h.modelScene.matrixAutoUpdate=!1,h.videoTexture=new f.VideoTexture(e.videoInstance||qA()),X0(h.scene),X0(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=Et.shared.add(function(B,M){for(var I=[],L=2;L<arguments.length;L++)I[L-2]=arguments[L];h.updateTime.apply(h,vt([B,M],I,!1))},!1,0,10));var m=function(){typeof document!="undefined"&&document.fullscreenElement===null&&h.currentMode==="VRPanorama"&&h.controller.emit("vr.requestExit",X("vr.requestExit",{}))},y=function(){h.needsRender=!0,h.modelSceneNeedsRender=!0};if(typeof document!="undefined"&&document.addEventListener("fullscreenchange",m,!1),h.renderer&&h.renderer.domElement.addEventListener("webglcontextrestored",y,!1),h.removeEventListeners=function(){typeof document!="undefined"&&document.removeEventListener("fullscreenchange",m,!1),h.renderer&&h.renderer.domElement.removeEventListener("webglcontextrestored",y,!1)},h.plugins={},e.plugins&&e.plugins.length)for(var b=0,x=e.plugins;b<x.length;b++){var w=x[b];if(typeof w=="function")w(h);else if(Array.isArray(w)){var E=w[0],S=w[1],C=w[2];if(typeof E=="function"){var R=E(h,C);typeof S=="string"&&(h.plugins[S]?h.throwError(new Error("plugin name ".concat(S," is exists."))):h.plugins[S]=R)}}}return h.gpuPickingRenderTarget=new f.WebGLRenderTarget(1,1,{generateMipmaps:!1}),h.meshReplaceMaterialMap=new Map,h.meshOriginMaterialMap=new Map,QA(h),h}return Object.defineProperty(t,"version",{get:function(){return"6.4.0-alpha.15"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"dracoPath",{get:function(){return na.decoderPath},set:function(e){na.setDecoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t,"ktx2Path",{get:function(){return si.transcoderPath},set:function(e){si.setTranscoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panoIndex",{get:function(){return this.pano.panoIndex},enumerable:!1,configurable:!0}),t.prototype.getGPUPicking=function(e,r,i,a,o){var s=this;if(a===void 0&&(a=1),o===void 0&&(o=new f.Vector3(0,0,0)),!this.renderer)throw new Error("renderer is not initialized.");var u=this.models.getMaterial(),l=u.constantColor,c=u.colorStyle;this.models.setMaterial({colorStyle:"CONSTANT",constantColor:o}),this.scene.traverse(function(h){if(!(!(h instanceof f.Mesh)||h instanceof kt)){var v=Object.keys(i).filter(function(m){return m===h.uuid})[0];if(v)if(s.meshOriginMaterialMap.set(v,h.material),s.meshReplaceMaterialMap.get(v))h.material=s.meshReplaceMaterialMap.get(v);else{var g=new f.ShaderMaterial({uniforms:{color:{value:i[v]}},vertexShader:`
|
|
2170
2170
|
void main() {
|
|
2171
2171
|
vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
|
|
2172
2172
|
gl_Position = projectionMatrix * mvPosition;
|
|
@@ -2176,4 +2176,4 @@ void main() {
|
|
|
2176
2176
|
void main() {
|
|
2177
2177
|
gl_FragColor = vec4( color, 1.0 );
|
|
2178
2178
|
}
|
|
2179
|
-
`});g.depthTest=h.material.depthTest,g.side=h.material.side,s.meshReplaceMaterialMap.set(v,g),h.material=g}}});var d=this.renderer.getSize(new f.Vector2);this.camera.setViewOffset(d.width,d.height,e*a,r*a,1,1),this.renderer.setRenderTarget(this.gpuPickingRenderTarget),this.render();var p=new Uint8Array(4);this.renderer.readRenderTargetPixels(this.gpuPickingRenderTarget,0,0,1,1,p),this.renderer.setRenderTarget(null),this.camera.clearViewOffset(),this.scene.traverse(function(h){!(h instanceof f.Mesh)||h instanceof kt||s.meshOriginMaterialMap.get(h.uuid)&&(h.material=s.meshOriginMaterialMap.get(h.uuid))}),this.models.setMaterial({colorStyle:c,constantColor:l});var A=Object.keys(i).filter(function(h){return i[h].equals(new f.Color().setRGB(p[0]/255,p[1]/255,p[2]/255))})[0];return A||!1},t.prototype.dispose=function(){var e,r;if(this.destroyed!==!0){delete Oo.instances[this.ident],this.emit("dispose"),this.destroyed=!0,this.pause(),this.stopAnimationLoop&&(this.stopAnimationLoop(),delete this.stopAnimationLoop),(e=this.renderer)===null||e===void 0||e.setAnimationLoop(null),this.off(),this.networkSubscribe.off(),this.controller&&(this.controller.destroy(),this.controller=void 0);var i=this.getElement();i&&i.parentNode&&i.parentNode.removeChild(i);var a=this.models.getMaterial();a&&(a.pano0&&a.pano0.map.dispose(),a.pano1&&a.pano1.map!==((r=a.pano0)===null||r===void 0?void 0:r.map)&&a.pano1.map.dispose());for(var o=0,s=this.models;o<s.length;o++){var u=s[o];u.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 mn&&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 f.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",X("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 mn)){this.throwError(new Error("cannot call appendTo method when render a external renderer"));return}var i=this.getElement();if(i){e.appendChild(i),this.refresh(r);var a=window.getComputedStyle(e).position;a!=="relative"&&a!=="absolute"&&a!=="fixed"&&a!=="sticky"&&(e.style.position="relative")}}},t.prototype.refresh=function(e,r){if(e===void 0&&(e={}),!!this.renderer){var i=this.getElement();if(i){var a=i.parentNode;if(a&&a.nodeName){var o=e.width,s=o===void 0?a.offsetWidth:o,u=e.height,l=u===void 0?a.offsetHeight:u;this.renderer instanceof mn&&(r&&this.renderer.setPixelRatio(r),this.renderer.setSize(s,l))}var c=new f.Vector2;if(this.renderer.getDrawingBufferSize(c),this.controller&&this.controller.updateRenderSize&&this.controller.updateRenderSize(c),this.modelRenderTarget.width!==c.x||this.modelRenderTarget.height!==c.y){this.modelRenderTarget.setSize(c.x,c.y),this.modelRenderTarget.depthTexture.dispose();var d=new f.DepthTexture(c.x,c.y);d.generateMipmaps=!1,d.format=f.DepthStencilFormat,d.type=f.UnsignedInt248Type,this.modelRenderTarget.depthTexture=d,this.modelRenderTarget.depthTexture.needsUpdate=!0}this.needsRender=!0,this.modelSceneNeedsRender=!0,this.render(U,!0)}}},t.prototype.addExtraElement=function(e){var r=this;return this.extraElements.indexOf(e)===-1&&(this.extraElements.push(e),this.controller&&this.controller.bindExtraElement(e)),function(){return r.removeExtraElement(e)}},t.prototype.removeExtraElement=function(e){var r=this.extraElements.indexOf(e);r!==-1&&(this.extraElements.splice(r,1),this.controller&&this.controller.unbindExtraElement(e))},t.prototype.getPose=function(){var e=this.camera.copyPose(),r=e.longitude,i=e.latitude,a=e.fov,o=e.offset,s=e.distance;return{longitude:r,latitude:i,fov:a,offset:o.clone(),distance:s}},t.prototype.getSize=function(e){if(!this.renderer)throw new Error("renderer is not initialized");return this.renderer.getSize(e),e.x*=this.scissor.width,e.y*=this.scissor.height,e},t.prototype.getDrawingBufferSize=function(e){if(!this.renderer)throw new Error("renderer is not initialized");return this.renderer.getDrawingBufferSize(e),e.x*=this.scissor.width,e.y*=this.scissor.height,e},t.prototype.updateCamera=function(e,r,i){if(i===void 0&&(i=!0),!this.controller)throw new Error("controller is not initialized.");return this.controller.updateCamera(e,r,i)},t.prototype.updateCameraWithKeyframes=function(e,r,i){if(i===void 0&&(i=!0),!this.controller)throw new Error("controller is not initialized.");return this.controller.updateCameraWithKeyframes(e,r,i)},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 f.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,Wv(this.camera,r)}}return null},Object.defineProperty(t.prototype,"works",{get:function(){var e=lo.get(this);if(!e)return co;for(var r=0,i=e;r<i.length;r++){var a=i[r];if(!da.has(a))return co}return e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"work",{get:function(){return this.works[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"model",{get:function(){return this.models[0]},enumerable:!1,configurable:!0}),t.prototype.load=function(e,r,i,a){var o=this;if(a===void 0&&(a=!0),!this.renderer)throw new Error("renderer is not initialized");var s=this.lastLoadWorkTask.then(function(){return Yv(e)?e.then(function(u){return o.load_(u,r,i,a)}):o.load_(e,r,i,a)});return this.lastLoadWorkTask=s.catch(function(u){o.throwError(u)}),s},t.prototype.load_=function(e,r,i,a){var o=this,s,u,l,c,d,p,A,h;a===void 0&&(a=!0);var v={};typeof i=="number"?v.duration=i:typeof i=="object"&&Object.assign(v,i),this.works===co&&(v.duration===void 0&&(v.duration=0),v.effect===void 0&&(v.effect="instant"));var g=[];if(Array.isArray(e))for(var m=0,y=e;m<y.length;m++){var b=y[m];typeof b!="string"&&"work"in b?g.push(li(b.work,b)):g.push(li(b))}else g.push(li(e));for(var x=To(g),w=function(J){var W=E,$=new Qt({allowHosts:J.allowHosts,get requestProxy(){return W.requestProxy},get networkSubscribe(){return W.networkSubscribe}});Bv(J,$)},E=this,S=0,C=x;S<C.length;S++){var R=C[S];w(R)}this.lastWorks=this.works,r===void 0&&(r="inherit"),r==="inherit"&&this.lastWorks.length===0&&(r="initial");var B=x.initial,M=B.work.observers[0],I=M?{workCode:M.work.workCode,panoIndex:M.panoIndex}:{workCode:B.work.workCode,panoIndex:0},L=(s=B.mode)!==null&&s!==void 0?s:M?"Panorama":"Mapview",T={};if(r==="inherit"){L=this.currentMode;var F=x.resolvedObservers[this.panoIndex];F?I={workCode:F.work.workCode,panoIndex:F.panoIndex}:typeof x.initial.panoIndex=="number"?I={workCode:x.initial.work.workCode,panoIndex:x.initial.panoIndex}:(L==="Panorama"||L==="VRPanorama"||L==="XRPanorama")&&(L="Mapview"),T={longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,distance:void 0,offset:void 0}}else if(r==="initial")typeof B.panoIndex=="number"&&(I={workCode:B.work.workCode,panoIndex:B.panoIndex}),B.mode&&(L=B.mode),T={longitude:B.longitude,latitude:B.latitude,fov:B.fov,distance:B.distance,offset:(u=B.offset)===null||u===void 0?void 0:u.clone()};else{if(L=(l=r.mode)!==null&&l!==void 0?l:this.currentMode,typeof r.panoIndex=="number"){var F=x.getResolvedObserver({workCode:(d=(c=r.workCode)!==null&&c!==void 0?c:B.work.workCode)!==null&&d!==void 0?d:"",panoIndex:r.panoIndex});F&&(I={workCode:F.work.workCode,panoIndex:F.panoIndex})}T={longitude:r.longitude,latitude:r.latitude,fov:r.fov,distance:r.distance,offset:r.offset}}var D=O(O(O({},I),{mode:L}),T),V=this.getCurrentState(),z=(p=v.duration)!==null&&p!==void 0?p:this.modeChangeDuration;(L==="Floorplan"||L==="Topview"||L==="Mapview")&&this.currentMode===L&&(z=0);var Q="fly";(L==="Panorama"||L==="VRPanorama"||L==="XRPanorama")&&this.currentMode===L&&(Q=(A=v.effect)!==null&&A!==void 0?A:"fade"),this.emit("works.request",X("works.request",{input:e,works:x,state:D,userAction:a}));var q=function(){o.modelGroup.visible=!0,o.pano=I;var J=O(O({initial:{state:D,currentState:V,duration:z,effect:Q,userAction:a}},o.commonParams()),o.controllerInits[L]),W=ht[L].initAnimationEndState(J);if(o.controller&&o.currentMode===L)o.controller.updateWork(x,W,{effect:Q,duration:z},a)===!1&&(o.controller.destroy(),o.controller=o.applyController(L,J));else{var $=o.currentMode;if(o.controller)o.controller.destroy();else{var Y=ht[L].initAnimationEndState(J);o.camera.setFromPose(Y),o.emit("camera.update",X("camera.update",{state:o.getCurrentState(),userAction:a}))}o.controller=o.applyController(L,J);var Z=X("mode.change",{prevMode:$,mode:L,state:W,userAction:a});o.emit("mode.change",Z)}};lo.set(this,x),this.updateConfiguration(v,!1);var G=Promise.resolve();if(L===t.Mode.Floorplan||L===t.Mode.Topview||L===t.Mode.Mapview||L===t.Mode.Model)this.models.loaded===!1&&(this.camera.setFromPose(D),tm(this.state,this.camera.pose)),this.controller||(this.currentMode=L),G=this.loadModel(x,v).then(function(){o.needsRender=!0,o.modelSceneNeedsRender=!0,q(),o.emit("camera.update",X("camera.update",{state:o.getCurrentState(),userAction:a}))});else{q();var K=!1,j=function(){o.works===x&&K===!1&&(o.needsRender=!0,o.modelSceneNeedsRender=!0,o.emit("camera.update",X("camera.update",{state:o.getCurrentState(),userAction:a})),o.loadModel(x,v),K=!0)};this.controller.once("pano.arrived",j),this.controller.once("pano.cancel",j),setTimeout(j,((h=v.duration)!==null&&h!==void 0?h:this.modeChangeDuration)+1e3)}return this.emit("works.load",X("works.load",{input:e,state:this.getCurrentState(),userAction:a,works:x})),G.then(function(){return o.ready()}).then(function(){var J;o.emit("works.ready",X("works.ready",{input:e,state:o.getCurrentState(),userAction:a,works:x})),(J=o.analysis)===null||J===void 0||J.work(x)})},t.prototype.reset=function(){var e=this,r=this.lastLoadWorkTask.then(function(){return e.reset_()});return this.lastLoadWorkTask=r.catch(function(i){e.throwError(i)}),r},t.prototype.reset_=function(){var e=this;return new Promise(function(r){var i;e.controller&&(e.controller.destroy(),e.controller=void 0);var a=e.models.getMaterial();a&&(a.pano0&&a.pano0.map.dispose(),a.pano1&&a.pano1.map!==((i=a.pano0)===null||i===void 0?void 0:i.map)&&a.pano1.map.dispose()),e.models.setMaterial({pano0:null,pano1:null,modelAlpha:1}),e.lastModels.setMaterial({pano0:null,pano1:null,modelAlpha:1}),e.renderer&&(e.models.update(e.renderer,e.camera,e.currentMode),e.lastModels.update(e.renderer,e.camera,e.currentMode),e.model&&e.boundingMesh.update(e.renderer,e.camera,e.model));for(var o=0,s=e.models;o<s.length;o++){var u=s[o];e.lastModels.push(u)}if(e.models.length=0,e.lastModels.length>0){for(var l=0,c=e.lastModels;l<c.length;l++){var u=c[l];e.modelGroup.remove(u),u.dispose(),e.needsRender=!0,e.modelSceneNeedsRender=!0}e.lastModels.length=0}e.lastWorks&&delete e.lastWorks,lo.delete(e),e.currentMode="Mapview",e.pano={workCode:"",panoIndex:0},e.camera.setFromPose({distance:0,fov:Y0,longitude:0,latitude:0,offset:new f.Vector3(0,0,0)}),e.state={mode:e.currentMode,workCode:e.pano.workCode,panoIndex:e.pano.panoIndex,longitude:e.camera.pose.longitude,latitude:e.camera.pose.latitude,fov:e.camera.pose.fov,offset:e.camera.pose.offset.clone(),distance:e.camera.pose.distance},e.models.needsRender=!1,e.camera.needsRender=!1,e.needsRender=!1,e.modelSceneNeedsRender=!1,r()})},t.prototype.changeMode=function(e,r,i,a,o){var s=this;return r===void 0&&(r={}),a===void 0&&(a=!0),o===void 0&&(o=!1),new Promise(function(u,l){var c,d,p,A;if(!s.renderer)throw new Error("renderer is not initialized.");r=O({},r);var h=0;s.controller&&(typeof i=="number"?h=i:h=(c=i==null?void 0:i.duration)!==null&&c!==void 0?c:s.modeChangeDuration);var v="fly";s.controller&&typeof i=="object"&&i.effect&&(v=i.effect);var g=typeof r.panoIndex=="number"?{workCode:(A=(d=r.workCode)!==null&&d!==void 0?d:(p=s.work)===null||p===void 0?void 0:p.workCode)!==null&&A!==void 0?A:"",panoIndex:r.panoIndex}:s.pano;if(!t.Mode.hasOwnProperty(e)){var m=new Error('mode "'.concat(e,'" is not existed'));s.throwError(m),l(m);return}if((e===t.Mode.Panorama||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama)&&!s.works.getResolvedObserver(g)){var m=new Error("PanoId ".concat(He(g)," not existed."));s.throwError(m),l(m);return}(e===t.Mode.Floorplan||e===t.Mode.Topview||e===t.Mode.Mapview||e===t.Mode.Model)&&(s.models.loaded||(h=0));var y=s.controller,b=s.currentMode,x=function(){if(s.controller&&s.controller.stopMomentumMovement(),s.controller&&o===!1&&b===e)e===t.Mode.Panorama||e===t.Mode.Model||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama?pr(s.pano,g)&&"moveToPano"in s.controller&&typeof s.controller.moveToPano=="function"?s.controller.moveToPano(g,O({duration:h},r),a):s.controller.updateCamera(r,h,a).catch(U):(pr(s.pano,g)||(s.pano=g),s.controller.updateCamera(r,h,a).catch(U));else{var E=O(O({},r),g),S=O(O({initial:{state:E,currentState:s.getCurrentState(),duration:h,effect:v,userAction:a}},s.commonParams()),s.controllerInits[e]),C=ht[e].initAnimationEndState(S),R=X("mode.change.request",{prevMode:s.currentMode,mode:e,state:C,userAction:a});if(s.emit("mode.change.request",R),!R.defaultPrevented){y&&y.destroy(),s.controller=s.applyController(e,S);var B=X("mode.change",{prevMode:s.currentMode,mode:e,state:C,userAction:a});s.emit("mode.change",B)}}u()};if(e===t.Mode.VRPanorama)s.requestFullscreen(),$v().then(function(){return x()}).catch(function(E){E instanceof Error&&(s.exitFullscreen(),s.throwError(E),l(E))});else if(e===t.Mode.XRPanorama){var w=Et.shared.getContext();w?w.end():em().then(function(E){Et.shared.setContext(E),x()}).catch(function(E){E instanceof Error&&(s.throwError(E),l(E))})}else x()})},t.prototype.getPixels=function(e,r,i,a,o,s,u){if(!this.renderer)throw new Error("renderer is not initialized.");var l=this.renderer.getPixelRatio(),c=this.renderer.getRenderTarget(),d=this.renderer.getSize(new f.Vector2),p=0,A=0,h=1,v=1,g,m,y,b,x;typeof e=="number"?(p=e,typeof r=="number"&&(A=r),typeof i=="number"&&(h=i),typeof a=="number"&&(v=a),g=o,m=s,x=u):(p=e.x,A=e.y,h=e.width,v=e.height,g=e.pixelRatio,m=e.flipY,y=e.helperVisible,b=e.skipPanorama,x=e.buffer),p=Math.ceil(p),A=Math.ceil(A),h=Math.ceil(h),v=Math.ceil(v),g=Math.ceil(g!=null?g:l),m=m!=null?m:!1;var w=this.getPixelsRenderTarget;w.setSize(h*g,v*g),this.renderer.setRenderTarget(w),this.camera.pixelRatio=g,this.camera.resolution.set(h,v),this.camera.setViewOffset(d.width,d.height,p,d.height-A-v,h,v);for(var E=0,S=this.scene.children;E<S.length;E++){var C=S[E];C instanceof f.Object3D&&C.traverseVisible(function(j){j.setResolution&&j.setResolution(h*g/l,v*g/l)})}this.models.autoUpdate=!1;var R=!0,B=0;b&&(this.controller instanceof ht.Panorama||this.controller instanceof ht.VRPanorama||this.controller instanceof ht.XRPanorama)&&(R=this.controller.tiling.object.visible,this.controller.tiling.object.visible=!1,B=this.models.getMaterial().modelAlpha,this.models.setMaterial({modelAlpha:b===!0?1:B}));var M=this.helperVisible;y===!1&&(this.helperVisible=!1),this.models.update(this.renderer,this.camera,this.currentMode),this.controller?(this.controller.updateRenderSize(new f.Vector2(h*g,v*g)),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),this.helperVisible=M,b&&(this.controller instanceof ht.Panorama||this.controller instanceof ht.VRPanorama||this.controller instanceof ht.XRPanorama)&&(this.controller.tiling.object.visible=R,this.models.setMaterial({modelAlpha:B})),this.models.update(this.renderer,this.camera,this.currentMode),this.models.autoUpdate=!0;var I=h*g,L=v*g,T=I*L,F=T*4,D;try{if(x){if(x.length!==F)throw new Error("buffer length is not equals pixels ".concat(F))}else x=new Uint8Array(F);if(this.renderer.readRenderTargetPixels(w,0,0,h*g,v*g,x),m)for(var V=T/2,z=0,Q=0,q=0,G=0;Q<V;Q++)for(G=(L-Math.floor(Q/I)-1)*I+Q%I,q=0;q<4;q++)z=x[Q*4+q],x[Q*4+q]=x[G*4+q],x[G*4+q]=z}catch(j){D=j}if(this.renderer.setRenderTarget(c),this.controller&&this.controller.updateRenderSize){var K=new f.Vector2;this.renderer.getDrawingBufferSize(K),this.controller.updateRenderSize(K)}if(this.camera.clearViewOffset(),this.camera.pixelRatio=l,this.getSize(this.camera.resolution),this.camera.aspect=this.camera.resolution.width/this.camera.resolution.height,D)throw D;return x},t.prototype.getElement=function(){var e;return(e=this.renderer)===null||e===void 0?void 0:e.domElement},Object.defineProperty(t.prototype,"observers",{get:function(){return this.works.resolvedObservers},enumerable:!1,configurable:!0}),t.prototype.render=function(e,r){var i=this;if(r===void 0&&(r=!1),!this.renderer)return null;if(r){var a=this.renderer.getSize($A);this.scene.traverseVisible(function(o){o.setResolution&&o.setResolution(a.x,a.y)})}return this.aroundScissor(function(){i.renderer&&(i.controller?(i.controller.render(i.onlyRenderIfNeeds?i.modelSceneNeedsRender:!0,i.postProcessingType),i.info={memory:O({},i.controller.renderer.info.memory),render:O({},i.controller.renderer.info.render)}):(i.renderer.render(i.scene,i.camera),i.info={memory:O({},i.renderer.info.memory),render:O({},i.renderer.info.render)}),i.poweredByRealsee&&i.currentMode!=="VRPanorama"&&i.currentMode!=="XRPanorama"&&i.renderer.getRenderTarget()!==i.getPixelsRenderTarget&&WA(i.renderer)),e&&Et.shared.add(e,!0)}),null},t.prototype.updateTime=function(e,r){for(var i,a=this,o=[],s=2;s<arguments.length;s++)o[s-2]=arguments[s];if(!this.destroyed){if(this.works.update(),this.syncingState=this.syncState(e,r),this.controller&&(i=this.controller).updateTime.apply(i,vt([e,r],o,!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),this.renderer){si.detectSupport(this.renderer);var u=this.models.loaded,l=this.models.refined;if(this.models.update(this.renderer,this.camera,this.currentMode),this.camera.autoNearFar){var c=this.models.bounding.getBoundingSphere(eg),d=c.radius*2;c.containsPoint(this.camera.position)||(d=this.camera.position.distanceTo(c.center)+c.radius),d=ce(d,800,5e4),this.camera.far!==d&&(this.camera.far=d);var p=d/1e4;p=ce(p,.03,.1),this.camera.near!==p&&(this.camera.near=p)}if(u===!1&&this.models.loaded===!0&&this.emit("models.load",X("models.load",{models:this.models})),l===!1&&this.models.refined===!0&&this.emit("models.refined",X("models.refined",{models:this.models})),this.models.loaded){for(var A=0,h=this.models;A<h.length;A++){var v=h[A];v.parent!==this.modelGroup&&(this.modelGroup.add(v),this.needsRender=!0,this.modelSceneNeedsRender=!0)}if(this.lastModels.length>0){for(var g=0,m=this.lastModels;g<m.length;g++){var v=m[g];this.modelGroup.remove(v),v.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 y=new f.Vector2(512,512),b=new f.Vector2(512,512);this.renderer&&(this.renderer.getSize(y),y.x*=this.scissor.width,y.y*=this.scissor.height,this.renderer.getDrawingBufferSize(b),b.x*=this.scissor.width,b.y*=this.scissor.height);{for(var x=new f.Box3,w=new f.Box3,E=new f.Vector3(4,4,4),S=0,C=this.works.resolvedObservers;S<C.length;S++){var R=C[S];w.setFromCenterAndSize(R.position,E),x.union(w)}if(x.union(this.models.bounding),this.lastWorks)for(var B=0,M=this.lastWorks.resolvedObservers;B<M.length;B++){var R=M[B];w.setFromCenterAndSize(R.position,E),x.union(w)}x.union(this.lastModels.bounding),x.getCenter(this.boundingMesh.position),x.getSize(this.boundingMesh.scale),this.boundingMesh.boundingBox.copy(x),this.renderer&&this.model&&this.boundingMesh.update(this.renderer,this.camera,this.model)}var I=X("render.prepare",{needsRender:!0,info:null});if(this.emit("render.prepare",I),!I.defaultPrevented){var L=[];qi.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),Qi.setFromProjectionMatrix(qi);for(var T=0,F=this.scene.children;T<F.length;T++){var D=F[T];D!==this.modelGroup&&D!==this.boundingMesh&&D.traverseVisible(function(K){if(K.setResolution&&K.setResolution(y.x,y.y),K.setTime&&K.setTime(e),K.mixer instanceof f.AnimationMixer){var j=$0.get(K.mixer);j||(j=new f.Clock,$0.set(K.mixer,j)),K.mixer.update(j.getDelta())}(K instanceof f.Mesh||K instanceof f.Line||K instanceof f.Points)&&(K instanceof f.ImmediateRenderObject||!K.frustumCulled||Qi.intersectsObject(K))&&L.push(K)})}if(b.width*b.height>4096*2048?this.renderSwitch01=this.renderSwitch01^1:this.renderSwitch01=0,this.renderer&&this.paused===!1&&this.renderSwitch01===0){var V=void 0;if(this.onlyRenderIfNeeds!==!0)V=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,Q=L;z<Q.length;z++){var q=Q[z],G=function(K){K.needsRender===!0?(K.needsRender=!1,a.needsRender=!0):K.mixer&&K.mixer.stats.actions.inUse>0&&(a.needsRender=!0)};G(q),q.traverseAncestors(G)}(this.needsRender!==!1||this.modelSceneNeedsRender!==!1)&&(V=this.render())}this.needsRender=!1,this.modelSceneNeedsRender=!1,this.hasListener("render")&&this.emit("render",X("render",{needsRender:V!==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 mn&&this.renderer.clear(!0,!0,!0)},t.prototype.play=function(){this.needsRender=!0,this.modelSceneNeedsRender=!0,this.paused=!1},t.prototype.moveToPano=function(e,r,i){r===void 0&&(r={}),i===void 0&&(i=!0);var a=this,o=a.controller,s=a.renderer;if(!o)return this.throwError(new Error("controller is not initialized.")),Promise.resolve();if(!s)return this.throwError(new Error("renderer is not initialized.")),Promise.resolve();var u=this.works.getResolvedObserver(e);if(!u)return this.throwError(new Error("pano ".concat(JSON.stringify(e)," not existed."))),Promise.resolve();var l={workCode:u.work.workCode,panoIndex:u.panoIndex};return"moveToPano"in o&&typeof o.moveToPano=="function"?o.moveToPano(l,r,i):u&&(this.pano=l,this.once("initAnimation.start",function(c){r.moveStartCallback&&r.moveStartCallback(c.state)}),this.once("initAnimation.end",function(c){r.moveEndCallback&&r.moveEndCallback(c.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=U);var a=this.works.getResolvedObserver(e);if(!a)return Promise.reject(new Error("Pano ".concat(JSON.stringify(e)," never found")));var o=["right","left","up","down","front","back"],s=ve();return Promise.all(o.map(function(u){var l=O({key:"pano.".concat(a.panoId,".").concat(u)},rr(i.imageOptions,["size","format","quality","mappings"])),c=a.images[u],d=i.imageOptions.transform?i.imageOptions.transform(c,l):ft(c,l);return pt(a.work).preload(d)})).then(function(){var u=ve()-s;return r(u),u})},t.prototype.project2d=function(e,r){if(r===void 0&&(r=!1),!this.renderer)return null;if(this.models.length>0&&r){var i=this.camera.position,a=e.clone().sub(i),o=new f.Raycaster(i,a.clone().normalize());o.params.Points={threshold:.1};var s=this.models.intersectRaycaster(o)[0];if(s&&s.distance+.01<a.length())return null}var u=e.clone().project(this.camera);if(Math.abs(u.z)>1)return null;var l=this.renderer.getSize(new f.Vector2),c=l.x*this.scissor.width,d=l.y*this.scissor.height,p=l.x*this.scissor.left+(u.x+1)/2*c,A=l.y*(1-this.scissor.bottom-this.scissor.height)+(-u.y+1)/2*d;return new f.Vector2(p,A)},t.prototype.getRenderObjects=function(e){qi.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),Qi.setFromProjectionMatrix(qi),e||(e=this.scene);var r=[];return e.traverseVisible(function(i){(i instanceof f.Mesh||i instanceof f.Line||i instanceof f.Points)&&(i instanceof f.ImmediateRenderObject||!i.frustumCulled||Qi.intersectsObject(i))&&r.push(i)}),r},t.prototype.getCurrentState=function(){return O(O({},this.getPose()),{mode:this.currentMode,workCode:this.pano.workCode,panoIndex:this.pano.panoIndex})},t.prototype.setState=function(e,r,i){var a,o,s,u,l,c,d,p,A,h;r===void 0&&(r=!1),i===void 0&&(i=!0),e=Object.assign({},e),e.offset&&!(e instanceof f.Vector3)&&(e.offset=new f.Vector3(e.offset.x,e.offset.y,e.offset.z));var v;if(typeof e.panoIndex=="number")if(e.workCode)v={workCode:e.workCode,panoIndex:e.panoIndex};else{var g=(o=(a=this.work)===null||a===void 0?void 0:a.workCode)!==null&&o!==void 0?o:"",m=this.state.workCode;this.works.filter(function(I){return I.workCode===m}).length>0&&(g=m),v={workCode:g,panoIndex:e.panoIndex}}var y=(s=e.mode)!==null&&s!==void 0?s:this.state.mode,b,x,w,E,S;if(this.controller&&this.controller.stopMomentumMovement(),this.state.mode!==y){if(y==="VRPanorama"){this.changeMode("VRPanorama",void 0,void 0,!0);return}var C={workCode:v==null?void 0:v.workCode,panoIndex:v==null?void 0:v.panoIndex};typeof e.longitude=="number"&&(C.longitude=e.longitude),typeof e.latitude=="number"&&(C.latitude=e.latitude),typeof e.fov=="number"&&(C.fov=e.fov),typeof e.distance=="number"&&(C.distance=e.distance),e.offset instanceof f.Vector3&&(C.offset=e.offset);var R=O(O({initial:{state:C,currentState:this.getCurrentState(),duration:this.modeChangeDuration,effect:"fly",userAction:!1}},this.commonParams()),this.controllerInits[y]),B=ht[y].initAnimationEndState(R);b=B.longitude,x=B.latitude,w=B.fov,E=B.offset,S=B.distance}else b=(u=e.longitude)!==null&&u!==void 0?u:this.state.longitude,x=(l=e.latitude)!==null&&l!==void 0?l:this.state.latitude,w=(c=e.fov)!==null&&c!==void 0?c:this.state.fov,E=(d=e.offset)!==null&&d!==void 0?d:this.state.offset,S=(p=e.distance)!==null&&p!==void 0?p:this.state.distance;var M={workCode:(v!=null?v:this.pano).workCode,panoIndex:(v!=null?v:this.pano).panoIndex,mode:y,longitude:b,latitude:x,fov:w,offset:E,distance:S};this.emit("state.set",X("state.set",{userAction:i,state:M})),tn(this.state,M)||(this.controller&&M.mode==="VRPanorama"&&M.mode!==this.state.mode?(Er(this.state,M),this.changeMode("VRPanorama")):this.controller&&M.mode==="XRPanorama"&&M.mode!==this.state.mode?(Er(this.state,M),this.changeMode("XRPanorama")):(Er(this.state,M),this.controller&&i&&(this.controller.userAction=!1),r&&this.state.mode===M.mode&&(this.syncingState=this.syncState(ve(),0,r),this.syncingState&&((A=this.controller)===null||A===void 0||A.updateTime(ve(),0),this.syncingState=!1)),this.emit("state.change",X("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 f.Vector2,i=this.scissor.left!==0||this.scissor.bottom!==0||this.scissor.width!==1||this.scissor.height!==1;if(i){this.renderer.getSize(r);var a=Math.floor(r.x*this.scissor.left),o=Math.floor(r.y*this.scissor.bottom),s=Math.floor(r.x*this.scissor.width),u=Math.floor(r.y*this.scissor.height);this.renderer.setViewport(a,o,s,u),this.renderer.setScissor(a,o,s,u),this.renderer.setScissorTest(!0)}e(),i&&(this.renderer.setViewport(0,0,r.x,r.y),this.renderer.setScissor(0,0,r.x,r.y),this.renderer.setScissorTest(!1))}},t.prototype.syncState=function(e,r,i){i===void 0&&(i=!1);var a=this.stateSynced;if(this.stateSynced=!1,!this.controller)return!1;if(this.state.mode!==this.currentMode){var o={mode:this.state.mode,workCode:this.state.workCode,panoIndex:this.state.panoIndex,longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.changeMode(this.state.mode,o,this.modeChangeDuration,this.controller.userAction),!0}if(!this.controller.isReady())return!1;if(this.controller instanceof ht.Model){if(Xi(this.camera.pose.offset,this.state.offset)){var s={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset};return this.controller.moveToPosition(this.state.offset,O(O({},s),{duration:i?0:void 0}),!1),!0}}else{var u={workCode:this.state.workCode,panoIndex:this.state.panoIndex};if(!pr(u,this.pano)&&"moveToPano"in this.controller&&typeof this.controller.moveToPano=="function"){var s={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.controller.moveToPano(u,s,!1),!0}}if(this.controller instanceof ht.Floorplan||this.controller instanceof ht.Topview||this.controller instanceof ht.Mapview){var l=1,c=.2,d=.2,p=Math.PI/45,A=i?this.state.fov:Za(this.camera.pose.fov,this.state.fov,l),h=Math.abs(this.camera.pose.distance-this.state.distance),v=h>d*15?h/15:c,g=i?this.state.distance:Za(this.camera.pose.distance,this.state.distance,v),m=this.camera.pose.offset.distanceTo(this.state.offset),y=m>d*15?m/15:d,b=i?new f.Vector3().copy(this.state.offset):Zv(this.camera.pose.offset,this.state.offset,y),x=i?{longitude:this.state.longitude,latitude:this.state.latitude}:I0({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},p),w=x.longitude,E=x.latitude;if(Yt(A,this.camera.pose.fov)||Xi(b,this.camera.pose.offset)||Yt(g,this.camera.pose.distance)||Yt(w,this.camera.pose.longitude,Math.PI*2)||Yt(E,this.camera.pose.latitude)){var S={x:b.x,y:b.y,z:b.z},C={fov:A};return Object.assign(S,{distance:g}),Object.assign(C,{longitude:w,latitude:E}),this.controller.stopMomentumMovement(),this.controller.cameraMotion.set(C,0).catch(U),this.controller.locationMotion.set(S,0).catch(U),!0}}else{var R=1,B=Math.PI/45,A=i?this.state.fov:Za(this.camera.pose.fov,this.state.fov,R),M=i?{longitude:this.state.longitude,latitude:this.state.latitude}:I0({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},B),w=M.longitude,E=M.latitude,g=this.state.distance,b=new f.Vector3().copy(this.state.offset);if(Yt(g,this.camera.pose.distance)&&(this.state.distance=this.camera.pose.distance),Xi(b,this.camera.pose.offset)&&(this.state.offset=this.camera.pose.offset.clone()),Yt(w,this.camera.pose.longitude,Math.PI*2)||Yt(E,this.camera.pose.latitude)||Yt(A,this.camera.pose.fov))return this.controller.stopMomentumMovement(),this.controller.cameraMotion.set({longitude:w,latitude:E,fov:A},0).catch(U),!0}if(this.stateSynced=!0,a===!1&&this.emit("state.synced",X("state.synced",{userAction:!1,state:this.state})),this.readyCallbacks.length&&this.stateSynced){var I=this.currentMode,L=I===t.Mode.Floorplan||I===t.Mode.Topview||I===t.Mode.Mapview||I===t.Mode.Model;if(!L||this.models.loaded){var T=this.readyCallbacks.slice();this.readyCallbacks.length=0;for(var F=0,D=T;F<D.length;F++){var V=D[F];this.controller instanceof ht.Panorama&&V.tile===!0&&!this.controller.isTileReady()?this.readyCallbacks.push(V):V()}}}return!1},t.prototype.ready=function(e){var r=this;return e===void 0&&(e={}),new Promise(function(i){var a;r.readyCallbacks.push(Object.assign(i,{tile:(a=e.tile)!==null&&a!==void 0?a:!1}))})},t.prototype.requestFullscreen=function(){var e;if(ti){var r=(e=this.getElement())===null||e===void 0?void 0:e.parentNode;r&&"requestFullscreen"in r&&typeof document!="undefined"&&document.fullscreenElement===null&&r.requestFullscreen()}},t.prototype.exitFullscreen=function(){typeof document!="undefined"&&document.fullscreenElement&&"exitFullscreen"in document&&document.exitFullscreen()},t.prototype.throwError=function(e){this.hasListener("error")?this.emit("error",e):console.error(e)},t.prototype.loadModel=function(e,r){for(var i=this,a=[],o=function(g){var m=s.models.filter(function(b){var x;return((x=b.work)===null||x===void 0?void 0:x.workCode)===g.workCode})[0];if(m)m.work=g,a.push(m);else{var y=new Ro({onError:function(b){i.emit("model.error",X("model.error",{work:g,model:y,error:b})),i.throwError(b)},onShownFloorChange:function(b){i.emit("model.changeShownFloor",X("model.changeShownFloor",{work:g,model:y,error:null}))},onLoad:function(){i.emit("model.load",X("model.load",{work:g,model:y,error:null}))}});a.push(y),s.emit("model.request",X("model.request",{work:g,model:y,error:null})),y.load(g,{textureOptions:s.textureOptions,"3d-tiles":r["3d-tiles"]})}},s=this,u=0,l=e;u<l.length;u++){var c=l[u];o(c)}if(this.models.length>0){for(var d=0,p=this.models;d<p.length;d++){var A=p[d];a.indexOf(A)===-1&&this.lastModels.push(A)}this.models.length=0}for(var h=0,v=a;h<v.length;h++){var A=v[h];this.models.push(A)}return this.renderer&&(this.models.loaded=!1),new Promise(function(g){i.on("models.load",function(){i.controller&&i.controller.updateModel(i.models),g()})})},t.prototype.commonParams=function(){return{ident:this.ident,scene:this.scene,xrCustomObjectsScene:this.xrCustomObjectsScene,helper:this.helperGroup,boundingMesh:this.boundingMesh,camera:this.camera,renderer:this.renderer,scissor:this.scissor,element:this.getElement(),models:this.models,works:this.works,imageOptions:this.imageOptions,enableWheel:this.enableWheel,enableIOSEDR:this._enableIOSEDR,enableEDL:this.enableEDL,enableHQ:this.enableHQ,extraElements:this.extraElements,videoTexture:this.videoTexture,modelScene:this.modelScene,modelRenderTarget:this.modelRenderTarget}},t.prototype.applyController=function(e,r){var i=this;if(!this.renderer)throw new Error("renderer is not initialized.");e!==t.Mode.Mapview&&(this.enableEDL=!1,this.enableHQ=!1);var a=ht[e];this.currentMode=e;for(var o=new a(r),s=function(A){o.on(A,function(){for(var h=[],v=0;v<arguments.length;v++)h[v]=arguments[v];var g=i.emit.apply(i,vt([A],h,!1));if(g)return!1})},u=0,l=Wl;u<l.length;u++){var c=l[u];s(c)}{var d=ht[e].initAnimationEndState(r),p=r.initial.userAction;tn(this.state,d)||(Er(this.state,d),this.emit("state.change",X("state.change",{userAction:p,state:this.state}))),this.emit("currentState.change",X("currentState.change",{userAction:p,state:this.getCurrentState()}))}return o.on("camera.update",function(A){var h;if(i.controller){var v=i.controller.getTargetState();A.userAction&&i.syncingState===!1&&i.state.mode===v.mode&&!tn(i.state,v)&&(Er(i.state,v),i.emit("state.change",X("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",X("currentState.change",{userAction:A.userAction,state:i.getCurrentState()}))}),o.on("initAnimation.start",function(A){var h,v=A.state,g=A.userAction;g&&i.state.mode===v.mode&&!tn(i.state,v)&&(Er(i.state,v),i.emit("state.change",X("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("initAnimation.end",function(A){var h,v=A.state,g=A.userAction;g&&i.state.mode===v.mode&&!tn(i.state,v)&&(Er(i.state,v),i.emit("state.change",X("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.moveTo",function(A){var h,v=A.state,g=A.userAction;i.pano={workCode:v.workCode,panoIndex:v.panoIndex},g&&i.state.mode===v.mode&&!tn(i.state,v)&&(Er(i.state,v),i.emit("state.change",X("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.arrived",function(A){var h,v=A.state,g=A.userAction;g&&i.state.mode===v.mode&&!tn(i.state,v)&&(Er(i.state,v),i.emit("state.change",X("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.cancel",function(A){var h,v=A.state,g=A.userAction;g&&i.state.mode===v.mode&&!tn(i.state,v)&&(Er(i.state,v),i.emit("state.change",X("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.moveTo",function(A){var h=A.userAction;i.emit("currentState.change",X("currentState.change",{userAction:h,state:i.getCurrentState()}))}),o.on("pano.request",function(A){i.emit("pano.request",A),A.defaultPrevented||i.moveToPano(A.state,A.options,A.userAction)}),o.on("vr.requestExit",function(){i.currentMode===t.Mode.VRPanorama&&(i.exitFullscreen(),i.changeMode(t.Mode.Panorama))}),o.on("error",function(A){return i.throwError(A)}),o},t.prototype.removeEventListeners=function(){},t.prototype.getWorkResources=function(e){var r=this,i,a=this.models.find(function(l){return l.work===e}),o=((i=a==null?void 0:a.viewLayers)!==null&&i!==void 0?i:[]).map(function(l){return l.scene});function s(l){var c=/([0-9a-z\.\_\-]+)([\?\#].*)?$/i.exec(l);if(c){var d=String(c[1]).trim().split(".").slice(1).reverse()[0];if(d)return d}return""}function u(l,c){c===void 0&&(c=0);var d=[];if(l.content&&l.content.uri){var p=s(l.content.uri);if(p==="json"){var A=ft(l.content.uri,{key:"model.".concat(c)});d.push({url:A,type:"tileset"})}else if(p==="at3d"&&l.extras[p]){var A=l.content.uri;d.push({url:A,type:"model"});for(var h=l.extras[p],v=h.textureArray,g=h.textureOptions,m=0,y=v;m<y.length;m++){var b=y[m],x=O({key:"texture.pbm"},rr(g,["format","quality","size","sharpen","mappings"])),w=xn(b,g==null?void 0:g.transform,x);d.push({url:w,type:"texture"})}}else{var A=ft(l.content.uri,{key:"model.".concat(c)});d.push({url:A,type:"model"})}}if(l.children)for(var E=0;E<l.children.length;E++){var S=l.children[E];d.push.apply(d,u(S,E))}return d}return Promise.all(o.map(function(l){return l.loadAllTilesets()})).then(function(){for(var l=[],c=["right","left","up","down","front","back"],d=0,p=e.observers;d<p.length;d++){for(var A=p[d],h=0,v=c;h<v.length;h++){var g=v[h],m=O({key:"pano.".concat(He(A.pano),".").concat(g)},rr(r.imageOptions,["size","format","quality","mappings"])),y=A.images[g],b=xn(y,r.imageOptions.transform,m);l.push({url:b,type:"pano"})}if(A.images.tiles)for(var x=0,w=A.images.tiles;x<w.length;x++)for(var E=w[x],S=0,C=c;S<C.length;S++)for(var g=C[S],R=E.size,B=Math.pow(2,E.level),M=1/B,I=0;I<B;I++)for(var L=0;L<B;L++){var T="".concat(A.panoId,".").concat(g,".").concat(E.level,".").concat(I,".").concat(L),m=O(O({key:"pano_tile.".concat(T)},rr(r.imageOptions,["format","size","quality","sharpen","mappings"])),{size:E.scale>=1?void 0:R*M*E.scale,cut:[R*M*L,R*M*I,R*M,R*M]}),b=xn(E[g],r.imageOptions.transform,m);l.push({url:b,type:"pano_tile"})}}for(var F=0,D=o;F<D.length;F++){var V=D[F];V.tileset.url&&l.push({url:V.tileset.url,type:"model"}),l.push.apply(l,u(V.tileset.root))}return l})},Object.defineProperty(t.prototype,"internalLightsEnabled",{get:function(){var e=this.scene.children.find(function(r){return r.name==="internalLights"});return e?e.visible:!1},set:function(e){var r=this.scene.children.find(function(i){return i.name==="internalLights"});r&&(r.visible=e)},enumerable:!1,configurable:!0}),t.Mode={Panorama:"Panorama",Model:"Model",Floorplan:"Floorplan",Topview:"Topview",Mapview:"Mapview",VRPanorama:"VRPanorama",XRPanorama:"XRPanorama"},t.Line=null,t}(la),Oo={instances:{},constructor:$l};typeof window!="undefined"&&Object.assign(window,{__FIVE_DEBUG__:Oo});var tg=function(){function n(){}return n.createButton=function(t){var e=document.createElement("button");function r(){e.style.display="",e.style.cursor="pointer",e.style.left="calc(50% - 50px)",e.style.width="100px",e.textContent="ENTER VR",e.onmouseenter=function(){e.style.opacity="1.0"},e.onmouseleave=function(){e.style.opacity="0.5"},e.onclick=function(){t&&t()}}function i(){e.style.display="",e.style.cursor="auto",e.style.left="calc(50% - 75px)",e.style.width="150px",e.onmouseenter=null,e.onmouseleave=null,e.onclick=null}function a(){i(),e.textContent="VR NOT SUPPORTED"}function o(u){u.style.position="absolute",u.style.bottom="20px",u.style.padding="12px 6px",u.style.border="1px solid #fff",u.style.borderRadius="4px",u.style.background="rgba(0,0,0,0.1)",u.style.color="#fff",u.style.font="normal 13px sans-serif",u.style.textAlign="center",u.style.opacity="0.5",u.style.outline="none",u.style.zIndex="999"}if("xr"in navigator)return e.id="VRButton",e.style.display="none",o(e),navigator.xr.isSessionSupported("immersive-vr").then(function(u){u?r():a()}),e;var s=document.createElement("a");return window.isSecureContext===!1?(s.href=document.location.href.replace(/^http:/,"https:"),s.innerHTML="WEBXR NEEDS HTTPS"):(s.href="https://immersiveweb.dev/",s.innerHTML="WEBXR NOT AVAILABLE"),s.style.left="calc(50% - 90px)",s.style.width="180px",s.style.textDecoration="none",o(s),s},n}();exports.AnimationFrameLoop=Et;exports.Camera=bu;exports.CustomShader=Nf;exports.Fetcher=Qt;exports.Five=$l;exports.InternalWebGLRenderer=mn;exports.IntersectMesh=ha;exports.Model=Ro;exports.ModelViewLayer=Ji;exports.NetworkSubscribe=su;exports.PBMContainer=jf;exports.PBMGroup=Vf;exports.PBMMesh=kt;exports.PBMMeshMaterial=Ar;exports.PBMPointCloud=mr;exports.PBMPointCloudMaterial=Mi;exports.PROXY_CONTROLLER_EVENT_NAMES=Wl;exports.PanoCircleMesh=Rl;exports.PanoCircleMeshCustom=Hv;exports.PanoCircleMeshSolid=zv;exports.Scene=yu;exports.Subscribe=la;exports.TextureLoader=Kn;exports.Tile=_o;exports.Tile3DModel=An;exports.TileCache=Mu;exports.TileCubeTextureTarget=qe;exports.TileNode=Nu;exports.TileRequestScheduler=Su;exports.Tileset=Or;exports.Trajectory=Cu;exports.TrajectoryNode=Sl;exports.Work=$o;exports.XRButton=tg;exports.defaultImageURLTransform=ft;exports.defaultPbmParameters=ge;exports.getViewportScale=Zl;exports.imageSupport=cu;exports.isPanoId=du;exports.loadAt3d=nl;exports.loadB3dm=Gu;exports.loadDome=il;exports.loadDomez=ol;exports.loadFbx=yl;exports.loadGlb=sl;exports.loadPbm=el;exports.loadPly=Zo;exports.loadPnts=_u;exports.loadX3p=El;exports.panoEqual=pr;exports.panoParse=Lt;exports.panoStringify=He;exports.parseWork=li;
|
|
2179
|
+
`});g.depthTest=h.material.depthTest,g.side=h.material.side,s.meshReplaceMaterialMap.set(v,g),h.material=g}}});var d=this.renderer.getSize(new f.Vector2);this.camera.setViewOffset(d.width,d.height,e*a,r*a,1,1),this.renderer.setRenderTarget(this.gpuPickingRenderTarget),this.render();var p=new Uint8Array(4);this.renderer.readRenderTargetPixels(this.gpuPickingRenderTarget,0,0,1,1,p),this.renderer.setRenderTarget(null),this.camera.clearViewOffset(),this.scene.traverse(function(h){!(h instanceof f.Mesh)||h instanceof kt||s.meshOriginMaterialMap.get(h.uuid)&&(h.material=s.meshOriginMaterialMap.get(h.uuid))}),this.models.setMaterial({colorStyle:c,constantColor:l});var A=Object.keys(i).filter(function(h){return i[h].equals(new f.Color().setRGB(p[0]/255,p[1]/255,p[2]/255))})[0];return A||!1},t.prototype.dispose=function(){var e,r;if(this.destroyed!==!0){delete Oo.instances[this.ident],this.emit("dispose"),this.destroyed=!0,this.pause(),this.stopAnimationLoop&&(this.stopAnimationLoop(),delete this.stopAnimationLoop),(e=this.renderer)===null||e===void 0||e.setAnimationLoop(null),this.off(),this.networkSubscribe.off(),this.controller&&(this.controller.destroy(),this.controller=void 0);var i=this.getElement();i&&i.parentNode&&i.parentNode.removeChild(i);var a=this.models.getMaterial();a&&(a.pano0&&a.pano0.map.dispose(),a.pano1&&a.pano1.map!==((r=a.pano0)===null||r===void 0?void 0:r.map)&&a.pano1.map.dispose());for(var o=0,s=this.models;o<s.length;o++){var u=s[o];u.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 mn&&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 f.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",X("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 mn)){this.throwError(new Error("cannot call appendTo method when render a external renderer"));return}var i=this.getElement();if(i){e.appendChild(i),this.refresh(r);var a=window.getComputedStyle(e).position;a!=="relative"&&a!=="absolute"&&a!=="fixed"&&a!=="sticky"&&(e.style.position="relative")}}},t.prototype.refresh=function(e,r){if(e===void 0&&(e={}),!!this.renderer){var i=this.getElement();if(i){var a=i.parentNode;if(a&&a.nodeName){var o=e.width,s=o===void 0?a.offsetWidth:o,u=e.height,l=u===void 0?a.offsetHeight:u;this.renderer instanceof mn&&(r&&this.renderer.setPixelRatio(r),this.renderer.setSize(s,l))}var c=new f.Vector2;if(this.renderer.getDrawingBufferSize(c),this.controller&&this.controller.updateRenderSize&&this.controller.updateRenderSize(c),this.modelRenderTarget.width!==c.x||this.modelRenderTarget.height!==c.y){this.modelRenderTarget.setSize(c.x,c.y),this.modelRenderTarget.depthTexture.dispose();var d=new f.DepthTexture(c.x,c.y);d.generateMipmaps=!1,d.format=f.DepthStencilFormat,d.type=f.UnsignedInt248Type,this.modelRenderTarget.depthTexture=d,this.modelRenderTarget.depthTexture.needsUpdate=!0}this.needsRender=!0,this.modelSceneNeedsRender=!0,this.render(U,!0)}}},t.prototype.addExtraElement=function(e){var r=this;return this.extraElements.indexOf(e)===-1&&(this.extraElements.push(e),this.controller&&this.controller.bindExtraElement(e)),function(){return r.removeExtraElement(e)}},t.prototype.removeExtraElement=function(e){var r=this.extraElements.indexOf(e);r!==-1&&(this.extraElements.splice(r,1),this.controller&&this.controller.unbindExtraElement(e))},t.prototype.getPose=function(){var e=this.camera.copyPose(),r=e.longitude,i=e.latitude,a=e.fov,o=e.offset,s=e.distance;return{longitude:r,latitude:i,fov:a,offset:o.clone(),distance:s}},t.prototype.getSize=function(e){if(!this.renderer)throw new Error("renderer is not initialized");return this.renderer.getSize(e),e.x*=this.scissor.width,e.y*=this.scissor.height,e},t.prototype.getDrawingBufferSize=function(e){if(!this.renderer)throw new Error("renderer is not initialized");return this.renderer.getDrawingBufferSize(e),e.x*=this.scissor.width,e.y*=this.scissor.height,e},t.prototype.updateCamera=function(e,r,i){if(i===void 0&&(i=!0),!this.controller)throw new Error("controller is not initialized.");return this.controller.updateCamera(e,r,i)},t.prototype.updateCameraWithKeyframes=function(e,r,i){if(i===void 0&&(i=!0),!this.controller)throw new Error("controller is not initialized.");return this.controller.updateCameraWithKeyframes(e,r,i)},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 f.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,Wv(this.camera,r)}}return null},Object.defineProperty(t.prototype,"works",{get:function(){var e=lo.get(this);if(!e)return co;for(var r=0,i=e;r<i.length;r++){var a=i[r];if(!da.has(a))return co}return e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"work",{get:function(){return this.works[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"model",{get:function(){return this.models[0]},enumerable:!1,configurable:!0}),t.prototype.load=function(e,r,i,a){var o=this;if(a===void 0&&(a=!0),!this.renderer)throw new Error("renderer is not initialized");var s=this.lastLoadWorkTask.then(function(){return Yv(e)?e.then(function(u){return o.load_(u,r,i,a)}):o.load_(e,r,i,a)});return this.lastLoadWorkTask=s.catch(function(u){o.throwError(u)}),s},t.prototype.load_=function(e,r,i,a){var o=this,s,u,l,c,d,p,A,h;a===void 0&&(a=!0);var v={};typeof i=="number"?v.duration=i:typeof i=="object"&&Object.assign(v,i),this.works===co&&(v.duration===void 0&&(v.duration=0),v.effect===void 0&&(v.effect="instant"));var g=[];if(Array.isArray(e))for(var m=0,y=e;m<y.length;m++){var b=y[m];typeof b!="string"&&"work"in b?g.push(li(b.work,b)):g.push(li(b))}else g.push(li(e));for(var x=To(g),w=function(J){var W=E,$=new Qt({allowHosts:J.allowHosts,get requestProxy(){return W.requestProxy},get networkSubscribe(){return W.networkSubscribe}});Bv(J,$)},E=this,S=0,C=x;S<C.length;S++){var R=C[S];w(R)}this.lastWorks=this.works,r===void 0&&(r="inherit"),r==="inherit"&&this.lastWorks.length===0&&(r="initial");var B=x.initial,M=B.work.observers[0],I=M?{workCode:M.work.workCode,panoIndex:M.panoIndex}:{workCode:B.work.workCode,panoIndex:0},L=(s=B.mode)!==null&&s!==void 0?s:M?"Panorama":"Mapview",T={};if(r==="inherit"){L=this.currentMode;var F=x.resolvedObservers[this.panoIndex];F?I={workCode:F.work.workCode,panoIndex:F.panoIndex}:typeof x.initial.panoIndex=="number"?I={workCode:x.initial.work.workCode,panoIndex:x.initial.panoIndex}:(L==="Panorama"||L==="VRPanorama"||L==="XRPanorama")&&(L="Mapview"),T={longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,distance:void 0,offset:void 0}}else if(r==="initial")typeof B.panoIndex=="number"&&(I={workCode:B.work.workCode,panoIndex:B.panoIndex}),B.mode&&(L=B.mode),T={longitude:B.longitude,latitude:B.latitude,fov:B.fov,distance:B.distance,offset:(u=B.offset)===null||u===void 0?void 0:u.clone()};else{if(L=(l=r.mode)!==null&&l!==void 0?l:this.currentMode,typeof r.panoIndex=="number"){var F=x.getResolvedObserver({workCode:(d=(c=r.workCode)!==null&&c!==void 0?c:B.work.workCode)!==null&&d!==void 0?d:"",panoIndex:r.panoIndex});F&&(I={workCode:F.work.workCode,panoIndex:F.panoIndex})}T={longitude:r.longitude,latitude:r.latitude,fov:r.fov,distance:r.distance,offset:r.offset}}var D=O(O(O({},I),{mode:L}),T),V=this.getCurrentState(),z=(p=v.duration)!==null&&p!==void 0?p:this.modeChangeDuration;(L==="Floorplan"||L==="Topview"||L==="Mapview")&&this.currentMode===L&&(z=0);var Q="fly";(L==="Panorama"||L==="VRPanorama"||L==="XRPanorama")&&this.currentMode===L&&(Q=(A=v.effect)!==null&&A!==void 0?A:"fade"),this.emit("works.request",X("works.request",{input:e,works:x,state:D,userAction:a}));var q=function(){o.modelGroup.visible=!0,o.pano=I;var J=O(O({initial:{state:D,currentState:V,duration:z,effect:Q,userAction:a}},o.commonParams()),o.controllerInits[L]),W=ht[L].initAnimationEndState(J);if(o.controller&&o.currentMode===L)o.controller.updateWork(x,W,{effect:Q,duration:z},a)===!1&&(o.controller.destroy(),o.controller=o.applyController(L,J));else{var $=o.currentMode;if(o.controller)o.controller.destroy();else{var Y=ht[L].initAnimationEndState(J);o.camera.setFromPose(Y),o.emit("camera.update",X("camera.update",{state:o.getCurrentState(),userAction:a}))}o.controller=o.applyController(L,J);var Z=X("mode.change",{prevMode:$,mode:L,state:W,userAction:a});o.emit("mode.change",Z)}};lo.set(this,x),this.updateConfiguration(v,!1);var G=Promise.resolve();if(L===t.Mode.Floorplan||L===t.Mode.Topview||L===t.Mode.Mapview||L===t.Mode.Model)this.models.loaded===!1&&(this.camera.setFromPose(D),tm(this.state,this.camera.pose)),this.controller||(this.currentMode=L),G=this.loadModel(x,v).then(function(){o.needsRender=!0,o.modelSceneNeedsRender=!0,q(),o.emit("camera.update",X("camera.update",{state:o.getCurrentState(),userAction:a}))});else{q();var K=!1,j=function(){o.works===x&&K===!1&&(o.needsRender=!0,o.modelSceneNeedsRender=!0,o.emit("camera.update",X("camera.update",{state:o.getCurrentState(),userAction:a})),o.loadModel(x,v),K=!0)};this.controller.once("pano.arrived",j),this.controller.once("pano.cancel",j),setTimeout(j,((h=v.duration)!==null&&h!==void 0?h:this.modeChangeDuration)+1e3)}return this.emit("works.load",X("works.load",{input:e,state:this.getCurrentState(),userAction:a,works:x})),G.then(function(){return o.ready()}).then(function(){var J;o.emit("works.ready",X("works.ready",{input:e,state:o.getCurrentState(),userAction:a,works:x})),(J=o.analysis)===null||J===void 0||J.work(x)})},t.prototype.reset=function(){var e=this,r=this.lastLoadWorkTask.then(function(){return e.reset_()});return this.lastLoadWorkTask=r.catch(function(i){e.throwError(i)}),r},t.prototype.reset_=function(){var e=this;return new Promise(function(r){var i;e.controller&&(e.controller.destroy(),e.controller=void 0);var a=e.models.getMaterial();a&&(a.pano0&&a.pano0.map.dispose(),a.pano1&&a.pano1.map!==((i=a.pano0)===null||i===void 0?void 0:i.map)&&a.pano1.map.dispose()),e.models.setMaterial({pano0:null,pano1:null,modelAlpha:1}),e.lastModels.setMaterial({pano0:null,pano1:null,modelAlpha:1}),e.renderer&&(e.models.update(e.renderer,e.camera,e.currentMode),e.lastModels.update(e.renderer,e.camera,e.currentMode),e.model&&e.boundingMesh.update(e.renderer,e.camera,e.model));for(var o=0,s=e.models;o<s.length;o++){var u=s[o];e.lastModels.push(u)}if(e.models.length=0,e.lastModels.length>0){for(var l=0,c=e.lastModels;l<c.length;l++){var u=c[l];e.modelGroup.remove(u),u.dispose(),e.needsRender=!0,e.modelSceneNeedsRender=!0}e.lastModels.length=0}e.lastWorks&&delete e.lastWorks,lo.delete(e),e.currentMode="Mapview",e.pano={workCode:"",panoIndex:0},e.camera.setFromPose({distance:0,fov:Y0,longitude:0,latitude:0,offset:new f.Vector3(0,0,0)}),e.state={mode:e.currentMode,workCode:e.pano.workCode,panoIndex:e.pano.panoIndex,longitude:e.camera.pose.longitude,latitude:e.camera.pose.latitude,fov:e.camera.pose.fov,offset:e.camera.pose.offset.clone(),distance:e.camera.pose.distance},e.models.needsRender=!1,e.camera.needsRender=!1,e.needsRender=!1,e.modelSceneNeedsRender=!1,r()})},t.prototype.changeMode=function(e,r,i,a,o){var s=this;return r===void 0&&(r={}),a===void 0&&(a=!0),o===void 0&&(o=!1),new Promise(function(u,l){var c,d,p,A;if(!s.renderer)throw new Error("renderer is not initialized.");r=O({},r);var h=0;s.controller&&(typeof i=="number"?h=i:h=(c=i==null?void 0:i.duration)!==null&&c!==void 0?c:s.modeChangeDuration);var v="fly";s.controller&&typeof i=="object"&&i.effect&&(v=i.effect);var g=typeof r.panoIndex=="number"?{workCode:(A=(d=r.workCode)!==null&&d!==void 0?d:(p=s.work)===null||p===void 0?void 0:p.workCode)!==null&&A!==void 0?A:"",panoIndex:r.panoIndex}:s.pano;if(!t.Mode.hasOwnProperty(e)){var m=new Error('mode "'.concat(e,'" is not existed'));s.throwError(m),l(m);return}if((e===t.Mode.Panorama||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama)&&!s.works.getResolvedObserver(g)){var m=new Error("PanoId ".concat(He(g)," not existed."));s.throwError(m),l(m);return}(e===t.Mode.Floorplan||e===t.Mode.Topview||e===t.Mode.Mapview||e===t.Mode.Model)&&(s.models.loaded||(h=0));var y=s.controller,b=s.currentMode,x=function(){if(s.controller&&s.controller.stopMomentumMovement(),s.controller&&o===!1&&b===e)e===t.Mode.Panorama||e===t.Mode.Model||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama?pr(s.pano,g)&&"moveToPano"in s.controller&&typeof s.controller.moveToPano=="function"?s.controller.moveToPano(g,O({duration:h},r),a):s.controller.updateCamera(r,h,a).catch(U):(pr(s.pano,g)||(s.pano=g),s.controller.updateCamera(r,h,a).catch(U));else{var E=O(O({},r),g),S=O(O({initial:{state:E,currentState:s.getCurrentState(),duration:h,effect:v,userAction:a}},s.commonParams()),s.controllerInits[e]),C=ht[e].initAnimationEndState(S),R=X("mode.change.request",{prevMode:s.currentMode,mode:e,state:C,userAction:a});if(s.emit("mode.change.request",R),!R.defaultPrevented){y&&y.destroy(),s.controller=s.applyController(e,S);var B=X("mode.change",{prevMode:s.currentMode,mode:e,state:C,userAction:a});s.emit("mode.change",B)}}u()};if(e===t.Mode.VRPanorama)s.requestFullscreen(),$v().then(function(){return x()}).catch(function(E){E instanceof Error&&(s.exitFullscreen(),s.throwError(E),l(E))});else if(e===t.Mode.XRPanorama){var w=Et.shared.getContext();w?w.end():em().then(function(E){Et.shared.setContext(E),x()}).catch(function(E){E instanceof Error&&(s.throwError(E),l(E))})}else x()})},t.prototype.getPixels=function(e,r,i,a,o,s,u){if(!this.renderer)throw new Error("renderer is not initialized.");var l=this.renderer.getPixelRatio(),c=this.renderer.getRenderTarget(),d=this.renderer.getSize(new f.Vector2),p=0,A=0,h=1,v=1,g,m,y,b,x;typeof e=="number"?(p=e,typeof r=="number"&&(A=r),typeof i=="number"&&(h=i),typeof a=="number"&&(v=a),g=o,m=s,x=u):(p=e.x,A=e.y,h=e.width,v=e.height,g=e.pixelRatio,m=e.flipY,y=e.helperVisible,b=e.skipPanorama,x=e.buffer),p=Math.ceil(p),A=Math.ceil(A),h=Math.ceil(h),v=Math.ceil(v),g=Math.ceil(g!=null?g:l),m=m!=null?m:!1;var w=this.getPixelsRenderTarget;w.setSize(h*g,v*g),this.renderer.setRenderTarget(w),this.camera.pixelRatio=g,this.camera.resolution.set(h,v),this.camera.setViewOffset(d.width,d.height,p,d.height-A-v,h,v);for(var E=0,S=this.scene.children;E<S.length;E++){var C=S[E];C instanceof f.Object3D&&C.traverseVisible(function(j){j.setResolution&&j.setResolution(h*g/l,v*g/l)})}this.models.autoUpdate=!1;var R=!0,B=0;b&&(this.controller instanceof ht.Panorama||this.controller instanceof ht.VRPanorama||this.controller instanceof ht.XRPanorama)&&(R=this.controller.tiling.object.visible,this.controller.tiling.object.visible=!1,B=this.models.getMaterial().modelAlpha,this.models.setMaterial({modelAlpha:b===!0?1:B}));var M=this.helperVisible;y===!1&&(this.helperVisible=!1),this.models.update(this.renderer,this.camera,this.currentMode),this.controller?(this.controller.updateRenderSize(new f.Vector2(h*g,v*g)),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),this.helperVisible=M,b&&(this.controller instanceof ht.Panorama||this.controller instanceof ht.VRPanorama||this.controller instanceof ht.XRPanorama)&&(this.controller.tiling.object.visible=R,this.models.setMaterial({modelAlpha:B})),this.models.update(this.renderer,this.camera,this.currentMode),this.models.autoUpdate=!0;var I=h*g,L=v*g,T=I*L,F=T*4,D;try{if(x){if(x.length!==F)throw new Error("buffer length is not equals pixels ".concat(F))}else x=new Uint8Array(F);if(this.renderer.readRenderTargetPixels(w,0,0,h*g,v*g,x),m)for(var V=T/2,z=0,Q=0,q=0,G=0;Q<V;Q++)for(G=(L-Math.floor(Q/I)-1)*I+Q%I,q=0;q<4;q++)z=x[Q*4+q],x[Q*4+q]=x[G*4+q],x[G*4+q]=z}catch(j){D=j}if(this.renderer.setRenderTarget(c),this.controller&&this.controller.updateRenderSize){var K=new f.Vector2;this.renderer.getDrawingBufferSize(K),this.controller.updateRenderSize(K)}if(this.camera.clearViewOffset(),this.camera.pixelRatio=l,this.getSize(this.camera.resolution),this.camera.aspect=this.camera.resolution.width/this.camera.resolution.height,D)throw D;return x},t.prototype.getElement=function(){var e;return(e=this.renderer)===null||e===void 0?void 0:e.domElement},Object.defineProperty(t.prototype,"observers",{get:function(){return this.works.resolvedObservers},enumerable:!1,configurable:!0}),t.prototype.render=function(e,r){var i=this;if(r===void 0&&(r=!1),!this.renderer)return null;if(r){var a=this.renderer.getSize($A);this.scene.traverseVisible(function(o){o.setResolution&&o.setResolution(a.x,a.y)})}return this.aroundScissor(function(){i.renderer&&(i.controller?(i.controller.render(i.onlyRenderIfNeeds?i.modelSceneNeedsRender:!0,i.postProcessingType),i.info={memory:O({},i.controller.renderer.info.memory),render:O({},i.controller.renderer.info.render)}):(i.renderer.render(i.scene,i.camera),i.info={memory:O({},i.renderer.info.memory),render:O({},i.renderer.info.render)}),i.poweredByRealsee&&i.currentMode!=="VRPanorama"&&i.currentMode!=="XRPanorama"&&i.renderer.getRenderTarget()!==i.getPixelsRenderTarget&&WA(i.renderer)),e&&Et.shared.add(e,!0)}),null},t.prototype.updateTime=function(e,r){for(var i,a=this,o=[],s=2;s<arguments.length;s++)o[s-2]=arguments[s];if(!this.destroyed){if(this.works.update(),this.syncingState=this.syncState(e,r),this.controller&&(i=this.controller).updateTime.apply(i,vt([e,r],o,!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),this.renderer){si.detectSupport(this.renderer);var u=this.models.loaded,l=this.models.refined;if(this.models.update(this.renderer,this.camera,this.currentMode),this.camera.autoNearFar){var c=this.models.bounding.getBoundingSphere(eg),d=c.radius*2;c.containsPoint(this.camera.position)||(d=this.camera.position.distanceTo(c.center)+c.radius),d=ce(d,800,5e4),this.camera.far!==d&&(this.camera.far=d);var p=d/1e4;p=ce(p,.03,.1),this.camera.near!==p&&(this.camera.near=p)}if(u===!1&&this.models.loaded===!0&&this.emit("models.load",X("models.load",{models:this.models})),l===!1&&this.models.refined===!0&&this.emit("models.refined",X("models.refined",{models:this.models})),this.models.loaded){for(var A=0,h=this.models;A<h.length;A++){var v=h[A];v.parent!==this.modelGroup&&(this.modelGroup.add(v),this.needsRender=!0,this.modelSceneNeedsRender=!0)}if(this.lastModels.length>0){for(var g=0,m=this.lastModels;g<m.length;g++){var v=m[g];this.modelGroup.remove(v),v.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 y=new f.Vector2(512,512),b=new f.Vector2(512,512);this.renderer&&(this.renderer.getSize(y),y.x*=this.scissor.width,y.y*=this.scissor.height,this.renderer.getDrawingBufferSize(b),b.x*=this.scissor.width,b.y*=this.scissor.height);{for(var x=new f.Box3,w=new f.Box3,E=new f.Vector3(4,4,4),S=0,C=this.works.resolvedObservers;S<C.length;S++){var R=C[S];w.setFromCenterAndSize(R.position,E),x.union(w)}if(x.union(this.models.bounding),this.lastWorks)for(var B=0,M=this.lastWorks.resolvedObservers;B<M.length;B++){var R=M[B];w.setFromCenterAndSize(R.position,E),x.union(w)}x.union(this.lastModels.bounding),x.getCenter(this.boundingMesh.position),x.getSize(this.boundingMesh.scale),this.boundingMesh.boundingBox.copy(x),this.renderer&&this.model&&this.boundingMesh.update(this.renderer,this.camera,this.model)}var I=X("render.prepare",{needsRender:!0,info:null});if(this.emit("render.prepare",I),!I.defaultPrevented){var L=[];qi.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),Qi.setFromProjectionMatrix(qi);for(var T=0,F=this.scene.children;T<F.length;T++){var D=F[T];D!==this.modelGroup&&D!==this.boundingMesh&&D.traverseVisible(function(K){if(K.setResolution&&K.setResolution(y.x,y.y),K.setTime&&K.setTime(e),K.mixer instanceof f.AnimationMixer){var j=$0.get(K.mixer);j||(j=new f.Clock,$0.set(K.mixer,j)),K.mixer.update(j.getDelta())}(K instanceof f.Mesh||K instanceof f.Line||K instanceof f.Points)&&(K instanceof f.ImmediateRenderObject||!K.frustumCulled||Qi.intersectsObject(K))&&L.push(K)})}if(b.width*b.height>4096*2048?this.renderSwitch01=this.renderSwitch01^1:this.renderSwitch01=0,this.renderer&&this.paused===!1&&this.renderSwitch01===0){var V=void 0;if(this.onlyRenderIfNeeds!==!0)V=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,Q=L;z<Q.length;z++){var q=Q[z],G=function(K){K.needsRender===!0?(K.needsRender=!1,a.needsRender=!0):K.mixer&&K.mixer.stats.actions.inUse>0&&(a.needsRender=!0)};G(q),q.traverseAncestors(G)}(this.needsRender!==!1||this.modelSceneNeedsRender!==!1)&&(V=this.render())}this.needsRender=!1,this.modelSceneNeedsRender=!1,this.hasListener("render")&&this.emit("render",X("render",{needsRender:V!==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 mn&&this.renderer.clear(!0,!0,!0)},t.prototype.play=function(){this.needsRender=!0,this.modelSceneNeedsRender=!0,this.paused=!1},t.prototype.moveToPano=function(e,r,i){r===void 0&&(r={}),i===void 0&&(i=!0);var a=this,o=a.controller,s=a.renderer;if(!o)return this.throwError(new Error("controller is not initialized.")),Promise.resolve();if(!s)return this.throwError(new Error("renderer is not initialized.")),Promise.resolve();var u=this.works.getResolvedObserver(e);if(!u)return this.throwError(new Error("pano ".concat(JSON.stringify(e)," not existed."))),Promise.resolve();var l={workCode:u.work.workCode,panoIndex:u.panoIndex};return"moveToPano"in o&&typeof o.moveToPano=="function"?o.moveToPano(l,r,i):u&&(this.pano=l,this.once("initAnimation.start",function(c){r.moveStartCallback&&r.moveStartCallback(c.state)}),this.once("initAnimation.end",function(c){r.moveEndCallback&&r.moveEndCallback(c.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=U);var a=this.works.getResolvedObserver(e);if(!a)return Promise.reject(new Error("Pano ".concat(JSON.stringify(e)," never found")));var o=["right","left","up","down","front","back"],s=ve();return Promise.all(o.map(function(u){var l=O({key:"pano.".concat(a.panoId,".").concat(u)},rr(i.imageOptions,["size","format","quality","mappings"])),c=a.images[u],d=i.imageOptions.transform?i.imageOptions.transform(c,l):ft(c,l);return pt(a.work).preload(d)})).then(function(){var u=ve()-s;return r(u),u})},t.prototype.project2d=function(e,r){if(r===void 0&&(r=!1),!this.renderer)return null;if(this.models.length>0&&r){var i=this.camera.position,a=e.clone().sub(i),o=new f.Raycaster(i,a.clone().normalize());o.params.Points={threshold:.1};var s=this.models.intersectRaycaster(o)[0];if(s&&s.distance+.01<a.length())return null}var u=e.clone().project(this.camera);if(Math.abs(u.z)>1)return null;var l=this.renderer.getSize(new f.Vector2),c=l.x*this.scissor.width,d=l.y*this.scissor.height,p=l.x*this.scissor.left+(u.x+1)/2*c,A=l.y*(1-this.scissor.bottom-this.scissor.height)+(-u.y+1)/2*d;return new f.Vector2(p,A)},t.prototype.getRenderObjects=function(e){qi.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),Qi.setFromProjectionMatrix(qi),e||(e=this.scene);var r=[];return e.traverseVisible(function(i){(i instanceof f.Mesh||i instanceof f.Line||i instanceof f.Points)&&(i instanceof f.ImmediateRenderObject||!i.frustumCulled||Qi.intersectsObject(i))&&r.push(i)}),r},t.prototype.getCurrentState=function(){return O(O({},this.getPose()),{mode:this.currentMode,workCode:this.pano.workCode,panoIndex:this.pano.panoIndex})},t.prototype.setState=function(e,r,i){var a,o,s,u,l,c,d,p,A,h;r===void 0&&(r=!1),i===void 0&&(i=!0),e=Object.assign({},e),e.offset&&!(e instanceof f.Vector3)&&(e.offset=new f.Vector3(e.offset.x,e.offset.y,e.offset.z));var v;if(typeof e.panoIndex=="number")if(e.workCode)v={workCode:e.workCode,panoIndex:e.panoIndex};else{var g=(o=(a=this.work)===null||a===void 0?void 0:a.workCode)!==null&&o!==void 0?o:"",m=this.state.workCode;this.works.filter(function(I){return I.workCode===m}).length>0&&(g=m),v={workCode:g,panoIndex:e.panoIndex}}var y=(s=e.mode)!==null&&s!==void 0?s:this.state.mode,b,x,w,E,S;if(this.controller&&this.controller.stopMomentumMovement(),this.state.mode!==y){if(y==="VRPanorama"){this.changeMode("VRPanorama",void 0,void 0,!0);return}var C={workCode:v==null?void 0:v.workCode,panoIndex:v==null?void 0:v.panoIndex};typeof e.longitude=="number"&&(C.longitude=e.longitude),typeof e.latitude=="number"&&(C.latitude=e.latitude),typeof e.fov=="number"&&(C.fov=e.fov),typeof e.distance=="number"&&(C.distance=e.distance),e.offset instanceof f.Vector3&&(C.offset=e.offset);var R=O(O({initial:{state:C,currentState:this.getCurrentState(),duration:this.modeChangeDuration,effect:"fly",userAction:!1}},this.commonParams()),this.controllerInits[y]),B=ht[y].initAnimationEndState(R);b=B.longitude,x=B.latitude,w=B.fov,E=B.offset,S=B.distance}else b=(u=e.longitude)!==null&&u!==void 0?u:this.state.longitude,x=(l=e.latitude)!==null&&l!==void 0?l:this.state.latitude,w=(c=e.fov)!==null&&c!==void 0?c:this.state.fov,E=(d=e.offset)!==null&&d!==void 0?d:this.state.offset,S=(p=e.distance)!==null&&p!==void 0?p:this.state.distance;var M={workCode:(v!=null?v:this.pano).workCode,panoIndex:(v!=null?v:this.pano).panoIndex,mode:y,longitude:b,latitude:x,fov:w,offset:E,distance:S};this.emit("state.set",X("state.set",{userAction:i,state:M})),tn(this.state,M)||(this.controller&&M.mode==="VRPanorama"&&M.mode!==this.state.mode?(Er(this.state,M),this.changeMode("VRPanorama")):this.controller&&M.mode==="XRPanorama"&&M.mode!==this.state.mode?(Er(this.state,M),this.changeMode("XRPanorama")):(Er(this.state,M),this.controller&&i&&(this.controller.userAction=!1),r&&this.state.mode===M.mode&&(this.syncingState=this.syncState(ve(),0,r),this.syncingState&&((A=this.controller)===null||A===void 0||A.updateTime(ve(),0),this.syncingState=!1)),this.emit("state.change",X("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 f.Vector2,i=this.scissor.left!==0||this.scissor.bottom!==0||this.scissor.width!==1||this.scissor.height!==1;if(i){this.renderer.getSize(r);var a=Math.floor(r.x*this.scissor.left),o=Math.floor(r.y*this.scissor.bottom),s=Math.floor(r.x*this.scissor.width),u=Math.floor(r.y*this.scissor.height);this.renderer.setViewport(a,o,s,u),this.renderer.setScissor(a,o,s,u),this.renderer.setScissorTest(!0)}e(),i&&(this.renderer.setViewport(0,0,r.x,r.y),this.renderer.setScissor(0,0,r.x,r.y),this.renderer.setScissorTest(!1))}},t.prototype.syncState=function(e,r,i){i===void 0&&(i=!1);var a=this.stateSynced;if(this.stateSynced=!1,!this.controller)return!1;if(this.state.mode!==this.currentMode){var o={mode:this.state.mode,workCode:this.state.workCode,panoIndex:this.state.panoIndex,longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.changeMode(this.state.mode,o,this.modeChangeDuration,this.controller.userAction),!0}if(!this.controller.isReady())return!1;if(this.controller instanceof ht.Model){if(Xi(this.camera.pose.offset,this.state.offset)){var s={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset};return this.controller.moveToPosition(this.state.offset,O(O({},s),{duration:i?0:void 0}),!1),!0}}else{var u={workCode:this.state.workCode,panoIndex:this.state.panoIndex};if(!pr(u,this.pano)&&"moveToPano"in this.controller&&typeof this.controller.moveToPano=="function"){var s={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.controller.moveToPano(u,s,!1),!0}}if(this.controller instanceof ht.Floorplan||this.controller instanceof ht.Topview||this.controller instanceof ht.Mapview){var l=1,c=.2,d=.2,p=Math.PI/45,A=i?this.state.fov:Za(this.camera.pose.fov,this.state.fov,l),h=Math.abs(this.camera.pose.distance-this.state.distance),v=h>d*15?h/15:c,g=i?this.state.distance:Za(this.camera.pose.distance,this.state.distance,v),m=this.camera.pose.offset.distanceTo(this.state.offset),y=m>d*15?m/15:d,b=i?new f.Vector3().copy(this.state.offset):Zv(this.camera.pose.offset,this.state.offset,y),x=i?{longitude:this.state.longitude,latitude:this.state.latitude}:I0({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},p),w=x.longitude,E=x.latitude;if(Yt(A,this.camera.pose.fov)||Xi(b,this.camera.pose.offset)||Yt(g,this.camera.pose.distance)||Yt(w,this.camera.pose.longitude,Math.PI*2)||Yt(E,this.camera.pose.latitude)){var S={x:b.x,y:b.y,z:b.z},C={fov:A};return Object.assign(S,{distance:g}),Object.assign(C,{longitude:w,latitude:E}),this.controller.stopMomentumMovement(),this.controller.cameraMotion.set(C,0).catch(U),this.controller.locationMotion.set(S,0).catch(U),!0}}else{var R=1,B=Math.PI/45,A=i?this.state.fov:Za(this.camera.pose.fov,this.state.fov,R),M=i?{longitude:this.state.longitude,latitude:this.state.latitude}:I0({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},B),w=M.longitude,E=M.latitude,g=this.state.distance,b=new f.Vector3().copy(this.state.offset);if(Yt(g,this.camera.pose.distance)&&(this.state.distance=this.camera.pose.distance),Xi(b,this.camera.pose.offset)&&(this.state.offset=this.camera.pose.offset.clone()),Yt(w,this.camera.pose.longitude,Math.PI*2)||Yt(E,this.camera.pose.latitude)||Yt(A,this.camera.pose.fov))return this.controller.stopMomentumMovement(),this.controller.cameraMotion.set({longitude:w,latitude:E,fov:A},0).catch(U),!0}if(this.stateSynced=!0,a===!1&&this.emit("state.synced",X("state.synced",{userAction:!1,state:this.state})),this.readyCallbacks.length&&this.stateSynced){var I=this.currentMode,L=I===t.Mode.Floorplan||I===t.Mode.Topview||I===t.Mode.Mapview||I===t.Mode.Model;if(!L||this.models.loaded){var T=this.readyCallbacks.slice();this.readyCallbacks.length=0;for(var F=0,D=T;F<D.length;F++){var V=D[F];this.controller instanceof ht.Panorama&&V.tile===!0&&!this.controller.isTileReady()?this.readyCallbacks.push(V):V()}}}return!1},t.prototype.ready=function(e){var r=this;return e===void 0&&(e={}),new Promise(function(i){var a;r.readyCallbacks.push(Object.assign(i,{tile:(a=e.tile)!==null&&a!==void 0?a:!1}))})},t.prototype.requestFullscreen=function(){var e;if(ti){var r=(e=this.getElement())===null||e===void 0?void 0:e.parentNode;r&&"requestFullscreen"in r&&typeof document!="undefined"&&document.fullscreenElement===null&&r.requestFullscreen()}},t.prototype.exitFullscreen=function(){typeof document!="undefined"&&document.fullscreenElement&&"exitFullscreen"in document&&document.exitFullscreen()},t.prototype.throwError=function(e){this.hasListener("error")?this.emit("error",e):console.error(e)},t.prototype.loadModel=function(e,r){for(var i=this,a=[],o=function(g){var m=s.models.filter(function(b){var x;return((x=b.work)===null||x===void 0?void 0:x.workCode)===g.workCode})[0];if(m)m.work=g,a.push(m);else{var y=new Ro({onError:function(b){i.emit("model.error",X("model.error",{work:g,model:y,error:b})),i.throwError(b)},onShownFloorChange:function(b){i.emit("model.changeShownFloor",X("model.changeShownFloor",{work:g,model:y,error:null}))},onLoad:function(){i.emit("model.load",X("model.load",{work:g,model:y,error:null}))}});a.push(y),s.emit("model.request",X("model.request",{work:g,model:y,error:null})),y.load(g,{textureOptions:s.textureOptions,"3d-tiles":r["3d-tiles"]})}},s=this,u=0,l=e;u<l.length;u++){var c=l[u];o(c)}if(this.models.length>0){for(var d=0,p=this.models;d<p.length;d++){var A=p[d];a.indexOf(A)===-1&&this.lastModels.push(A)}this.models.length=0}for(var h=0,v=a;h<v.length;h++){var A=v[h];this.models.push(A)}return this.renderer&&(this.models.loaded=!1),new Promise(function(g){i.on("models.load",function(){i.controller&&i.controller.updateModel(i.models),g()})})},t.prototype.commonParams=function(){return{ident:this.ident,scene:this.scene,xrCustomObjectsScene:this.xrCustomObjectsScene,helper:this.helperGroup,boundingMesh:this.boundingMesh,camera:this.camera,renderer:this.renderer,scissor:this.scissor,element:this.getElement(),models:this.models,works:this.works,imageOptions:this.imageOptions,enableWheel:this.enableWheel,enableIOSEDR:this._enableIOSEDR,enableEDL:this.enableEDL,enableHQ:this.enableHQ,extraElements:this.extraElements,videoTexture:this.videoTexture,modelScene:this.modelScene,modelRenderTarget:this.modelRenderTarget}},t.prototype.applyController=function(e,r){var i=this;if(!this.renderer)throw new Error("renderer is not initialized.");e!==t.Mode.Mapview&&(this.enableEDL=!1,this.enableHQ=!1);var a=ht[e];this.currentMode=e;for(var o=new a(r),s=function(A){o.on(A,function(){for(var h=[],v=0;v<arguments.length;v++)h[v]=arguments[v];var g=i.emit.apply(i,vt([A],h,!1));if(g)return!1})},u=0,l=Wl;u<l.length;u++){var c=l[u];s(c)}{var d=ht[e].initAnimationEndState(r),p=r.initial.userAction;tn(this.state,d)||(Er(this.state,d),this.emit("state.change",X("state.change",{userAction:p,state:this.state}))),this.emit("currentState.change",X("currentState.change",{userAction:p,state:this.getCurrentState()}))}return o.on("camera.update",function(A){var h;if(i.controller){var v=i.controller.getTargetState();A.userAction&&i.syncingState===!1&&i.state.mode===v.mode&&!tn(i.state,v)&&(Er(i.state,v),i.emit("state.change",X("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",X("currentState.change",{userAction:A.userAction,state:i.getCurrentState()}))}),o.on("initAnimation.start",function(A){var h,v=A.state,g=A.userAction;g&&i.state.mode===v.mode&&!tn(i.state,v)&&(Er(i.state,v),i.emit("state.change",X("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("initAnimation.end",function(A){var h,v=A.state,g=A.userAction;g&&i.state.mode===v.mode&&!tn(i.state,v)&&(Er(i.state,v),i.emit("state.change",X("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.moveTo",function(A){var h,v=A.state,g=A.userAction;i.pano={workCode:v.workCode,panoIndex:v.panoIndex},g&&i.state.mode===v.mode&&!tn(i.state,v)&&(Er(i.state,v),i.emit("state.change",X("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.arrived",function(A){var h,v=A.state,g=A.userAction;g&&i.state.mode===v.mode&&!tn(i.state,v)&&(Er(i.state,v),i.emit("state.change",X("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.cancel",function(A){var h,v=A.state,g=A.userAction;g&&i.state.mode===v.mode&&!tn(i.state,v)&&(Er(i.state,v),i.emit("state.change",X("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.moveTo",function(A){var h=A.userAction;i.emit("currentState.change",X("currentState.change",{userAction:h,state:i.getCurrentState()}))}),o.on("pano.request",function(A){i.emit("pano.request",A),A.defaultPrevented||i.moveToPano(A.state,A.options,A.userAction)}),o.on("vr.requestExit",function(){i.currentMode===t.Mode.VRPanorama&&(i.exitFullscreen(),i.changeMode(t.Mode.Panorama))}),o.on("error",function(A){return i.throwError(A)}),o},t.prototype.removeEventListeners=function(){},t.prototype.getWorkResources=function(e){var r=this,i,a=this.models.find(function(l){return l.work===e}),o=((i=a==null?void 0:a.viewLayers)!==null&&i!==void 0?i:[]).map(function(l){return l.scene});function s(l){var c=/([0-9a-z\.\_\-]+)([\?\#].*)?$/i.exec(l);if(c){var d=String(c[1]).trim().split(".").slice(1).reverse()[0];if(d)return d}return""}function u(l,c){c===void 0&&(c=0);var d=[];if(l.content&&l.content.uri){var p=s(l.content.uri);if(p==="json"){var A=ft(l.content.uri,{key:"model.".concat(c)});d.push({url:A,type:"tileset"})}else if(p==="at3d"&&l.extras[p]){var A=l.content.uri;d.push({url:A,type:"model"});for(var h=l.extras[p],v=h.textureArray,g=h.textureOptions,m=0,y=v;m<y.length;m++){var b=y[m],x=O({key:"texture.pbm"},rr(g,["format","quality","size","sharpen","mappings"])),w=xn(b,g==null?void 0:g.transform,x);d.push({url:w,type:"texture"})}}else{var A=ft(l.content.uri,{key:"model.".concat(c)});d.push({url:A,type:"model"})}}if(l.children)for(var E=0;E<l.children.length;E++){var S=l.children[E];d.push.apply(d,u(S,E))}return d}return Promise.all(o.map(function(l){return l.loadAllTilesets()})).then(function(){for(var l=[],c=["right","left","up","down","front","back"],d=0,p=e.observers;d<p.length;d++){for(var A=p[d],h=0,v=c;h<v.length;h++){var g=v[h],m=O({key:"pano.".concat(He(A.pano),".").concat(g)},rr(r.imageOptions,["size","format","quality","mappings"])),y=A.images[g],b=xn(y,r.imageOptions.transform,m);l.push({url:b,type:"pano"})}if(A.images.tiles)for(var x=0,w=A.images.tiles;x<w.length;x++)for(var E=w[x],S=0,C=c;S<C.length;S++)for(var g=C[S],R=E.size,B=Math.pow(2,E.level),M=1/B,I=0;I<B;I++)for(var L=0;L<B;L++){var T="".concat(A.panoId,".").concat(g,".").concat(E.level,".").concat(I,".").concat(L),m=O(O({key:"pano_tile.".concat(T)},rr(r.imageOptions,["format","size","quality","sharpen","mappings"])),{size:E.scale>=1?void 0:R*M*E.scale,cut:[R*M*L,R*M*I,R*M,R*M]}),b=xn(E[g],r.imageOptions.transform,m);l.push({url:b,type:"pano_tile"})}}for(var F=0,D=o;F<D.length;F++){var V=D[F];V.tileset.url&&l.push({url:V.tileset.url,type:"model"}),l.push.apply(l,u(V.tileset.root))}return l})},Object.defineProperty(t.prototype,"internalLightsEnabled",{get:function(){var e=this.scene.children.find(function(r){return r.name==="internalLights"});return e?e.visible:!1},set:function(e){var r=this.scene.children.find(function(i){return i.name==="internalLights"});r&&(r.visible=e)},enumerable:!1,configurable:!0}),t.Mode={Panorama:"Panorama",Model:"Model",Floorplan:"Floorplan",Topview:"Topview",Mapview:"Mapview",VRPanorama:"VRPanorama",XRPanorama:"XRPanorama"},t.Line=null,t}(la),Oo={instances:{},constructor:$l};typeof window!="undefined"&&Object.assign(window,{__FIVE_DEBUG__:Oo});var tg=function(){function n(){}return n.createButton=function(t){var e=document.createElement("button");function r(){e.style.display="",e.style.cursor="pointer",e.style.left="calc(50% - 50px)",e.style.width="100px",e.textContent="ENTER VR",e.onmouseenter=function(){e.style.opacity="1.0"},e.onmouseleave=function(){e.style.opacity="0.5"},e.onclick=function(){t&&t()}}function i(){e.style.display="",e.style.cursor="auto",e.style.left="calc(50% - 75px)",e.style.width="150px",e.onmouseenter=null,e.onmouseleave=null,e.onclick=null}function a(){i(),e.textContent="VR NOT SUPPORTED"}function o(u){u.style.position="absolute",u.style.bottom="20px",u.style.padding="12px 6px",u.style.border="1px solid #fff",u.style.borderRadius="4px",u.style.background="rgba(0,0,0,0.1)",u.style.color="#fff",u.style.font="normal 13px sans-serif",u.style.textAlign="center",u.style.opacity="0.5",u.style.outline="none",u.style.zIndex="999"}if("xr"in navigator)return e.id="VRButton",e.style.display="none",o(e),navigator.xr.isSessionSupported("immersive-vr").then(function(u){u?r():a()}),e;var s=document.createElement("a");return window.isSecureContext===!1?(s.href=document.location.href.replace(/^http:/,"https:"),s.innerHTML="WEBXR NEEDS HTTPS"):(s.href="https://immersiveweb.dev/",s.innerHTML="WEBXR NOT AVAILABLE"),s.style.left="calc(50% - 90px)",s.style.width="180px",s.style.textDecoration="none",o(s),s},n}();exports.AnimationFrameLoop=Et;exports.Camera=bu;exports.CustomShader=Nf;exports.Fetcher=Qt;exports.Five=$l;exports.InternalWebGLRenderer=mn;exports.IntersectMesh=ha;exports.Model=Ro;exports.ModelViewLayer=Ji;exports.NetworkSubscribe=su;exports.PBMContainer=jf;exports.PBMGroup=Vf;exports.PBMMesh=kt;exports.PBMMeshMaterial=Ar;exports.PBMPointCloud=mr;exports.PBMPointCloudMaterial=Mi;exports.PROXY_CONTROLLER_EVENT_NAMES=Wl;exports.PanoCircleMesh=Rl;exports.PanoCircleMeshCustom=Hv;exports.PanoCircleMeshSolid=zv;exports.Scene=yu;exports.Subscribe=la;exports.TextureLoader=Kn;exports.Tile=_o;exports.Tile3DModel=An;exports.TileCache=Mu;exports.TileCubeTextureTarget=qe;exports.TileNode=Nu;exports.TileRequestScheduler=Su;exports.Tileset=Or;exports.Trajectory=Cu;exports.TrajectoryNode=Sl;exports.Work=$o;exports.XRButton=tg;exports.defaultImageURLTransform=ft;exports.defaultPbmParameters=ge;exports.getViewportScale=Zl;exports.imageSupport=cu;exports.isPanoId=du;exports.loadAt3d=nl;exports.loadB3dm=Gu;exports.loadDome=il;exports.loadDomez=ol;exports.loadFbx=yl;exports.loadGltf=sl;exports.loadPbm=el;exports.loadPly=Zo;exports.loadPnts=_u;exports.loadX3p=El;exports.panoEqual=pr;exports.panoParse=Lt;exports.panoStringify=He;exports.parseWork=li;
|