(self.webpackChunkthreejs_es6_webpack_boilerplate=self.webpackChunkthreejs_es6_webpack_boilerplate||[]).push([[179],{332:(e,t,n)=>{"use strict";var a=n(194);const o={isDev:!1,isShowingStats:!0,isLoaded:!1,isTweening:!1,isRotating:!0,isMouseMoving:!1,isMouseOver:!1,maxAnisotropy:1,dpr:1,easing:a.ZP.Easing.Quadratic.InOut,duration:500,model:{selected:0,initialTypes:["gltf","object"],type:"gltf"},models:[{path:"./assets/models/duck.gltf",scale:20,type:"gltf"},{path:"./assets/models/Teapot.json",scale:20,type:"object"}],texture:{path:"./assets/textures/",imageFiles:[{name:"UV",image:"UV_Grid_Sm.jpg"}]},mesh:{enableHelper:!0,wireframe:!1,translucent:!1,material:{color:16777215,emissive:16777215}},fog:{color:16777215,near:8e-4},camera:{fov:40,near:2,far:1e3,aspect:1,posX:0,posY:30,posZ:40},controls:{autoRotate:!0,autoRotateSpeed:-.5,rotateSpeed:.5,zoomSpeed:.8,minDistance:200,maxDistance:600,minPolarAngle:Math.PI/5,maxPolarAngle:Math.PI/2,minAzimuthAngle:-1/0,maxAzimuthAngle:1/0,enableDamping:!0,dampingFactor:.5,enableZoom:!0,target:{x:0,y:0,z:0}},ambientLight:{enabled:!0,color:1315860},directionalLight:{enabled:!0,color:15790320,intensity:.4,x:-75,y:280,z:150},shadow:{enabled:!0,helperEnabled:!0,bias:0,mapWidth:2048,mapHeight:2048,near:250,far:400,top:100,right:100,bottom:-100,left:-100},pointLight:{enabled:!0,color:16777215,intensity:.34,distance:115,x:0,y:0,z:0},hemiLight:{enabled:!0,color:13158600,groundColor:16777215,intensity:.55,x:0,y:0,z:0}},r={canvas:!!window.CanvasRenderingContext2D,webgl:function(){try{var e=document.createElement("canvas");return!(!window.WebGLRenderingContext||!e.getContext("webgl")&&!e.getContext("experimental-webgl"))}catch(e){return!1}}(),workers:!!window.Worker,fileapi:window.File&&window.FileReader&&window.FileList&&window.Blob,getWebGLErrorMessage:function(){var e=document.createElement("div");return e.id="webgl-error-message",e.style.fontFamily="monospace",e.style.fontSize="13px",e.style.fontWeight="normal",e.style.textAlign="center",e.style.background="#fff",e.style.color="#000",e.style.padding="1.5em",e.style.width="400px",e.style.margin="5em auto 0",this.webgl||(e.innerHTML=window.WebGLRenderingContext?['Your graphics card does not seem to support WebGL.
','Find out how to get it here.'].join("\n"):['Your browser does not seem to support WebGL.
','Find out how to get it here.'].join("\n")),e},addGetWebGLMessage:function(e){var t,n,a;t=void 0!==(e=e||{}).parent?e.parent:document.body,n=void 0!==e.id?e.id:"oldie",(a=this.getWebGLErrorMessage()).id=n,t.appendChild(a)}};var i=n(212);function s(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,a=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;t.geo=new i.PlaneGeometry(e,n,a,o)}:"sphere"===e?function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:32;t.geo=new i.SphereGeometry(e,n,a)}:void 0}},{key:"place",value:function(e,t){var n,a,r=new v(15658734).standard,s=new i.Mesh(this.geo,r);(n=s.position).set.apply(n,b(e)),(a=s.rotation).set.apply(a,b(t)),o.shadow.enabled&&(s.receiveShadow=!0),this.scene.add(s)}}])&&w(t.prototype,n),a&&w(t,a),e}();function T(e,t){for(var n=0;n=2.0 are supported."));else{if(b.extensionsUsed)for(var y=0;y=0&&console.warn('THREE.GLTFLoader: Unknown extension "'+w+'".')}}new z(b,v,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,manager:this.manager}).parse(c,h)}}});var n={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function a(e){if(!e)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing DDSLoader");this.name=n.MSFT_TEXTURE_DDS,this.ddsLoader=e}function o(e){this.name=n.KHR_LIGHTS_PUNCTUAL;var t=e.extensions&&e.extensions[n.KHR_LIGHTS_PUNCTUAL]||{};this.lightDefs=t.lights||[]}function r(){this.name=n.KHR_MATERIALS_UNLIT}function s(){this.name=n.KHR_MATERIALS_CLEARCOAT}o.prototype.loadLight=function(e){var t,n=this.lightDefs[e],a=new i.Color(16777215);void 0!==n.color&&a.fromArray(n.color);var o=void 0!==n.range?n.range:0;switch(n.type){case"directional":(t=new i.DirectionalLight(a)).target.position.set(0,0,-1),t.add(t.target);break;case"point":(t=new i.PointLight(a)).distance=o;break;case"spot":(t=new i.SpotLight(a)).distance=o,n.spot=n.spot||{},n.spot.innerConeAngle=void 0!==n.spot.innerConeAngle?n.spot.innerConeAngle:0,n.spot.outerConeAngle=void 0!==n.spot.outerConeAngle?n.spot.outerConeAngle:Math.PI/4,t.angle=n.spot.outerConeAngle,t.penumbra=1-n.spot.innerConeAngle/n.spot.outerConeAngle,t.target.position.set(0,0,-1),t.add(t.target);break;default:throw new Error('THREE.GLTFLoader: Unexpected light type, "'+n.type+'".')}return t.position.set(0,0,0),t.decay=2,void 0!==n.intensity&&(t.intensity=n.intensity),t.name=n.name||"light_"+e,Promise.resolve(t)},r.prototype.getMaterialType=function(){return i.MeshBasicMaterial},r.prototype.extendParams=function(e,t,n){var a=[];e.color=new i.Color(1,1,1),e.opacity=1;var o=t.pbrMetallicRoughness;if(o){if(Array.isArray(o.baseColorFactor)){var r=o.baseColorFactor;e.color.fromArray(r),e.opacity=r[3]}void 0!==o.baseColorTexture&&a.push(n.assignTexture(e,"map",o.baseColorTexture))}return Promise.all(a)},s.prototype.getMaterialType=function(){return i.MeshPhysicalMaterial},s.prototype.extendParams=function(e,t,n){var a=[],o=t.extensions[this.name];if(void 0!==o.clearcoatFactor&&(e.clearcoat=o.clearcoatFactor),void 0!==o.clearcoatTexture&&a.push(n.assignTexture(e,"clearcoatMap",o.clearcoatTexture)),void 0!==o.clearcoatRoughnessFactor&&(e.clearcoatRoughness=o.clearcoatRoughnessFactor),void 0!==o.clearcoatRoughnessTexture&&a.push(n.assignTexture(e,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),void 0!==o.clearcoatNormalTexture&&(a.push(n.assignTexture(e,"clearcoatNormalMap",o.clearcoatNormalTexture)),void 0!==o.clearcoatNormalTexture.scale)){var r=o.clearcoatNormalTexture.scale;e.clearcoatNormalScale=new i.Vector2(r,r)}return Promise.all(a)};var l="glTF",c=1313821514,h=5130562;function u(e){this.name=n.KHR_BINARY_GLTF,this.content=null,this.body=null;var t=new DataView(e,0,12);if(this.header={magic:i.LoaderUtils.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==l)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");for(var a=new DataView(e,12),o=0;o",t),e.fragmentShader=e.fragmentShader.replace("#include ",n),e.fragmentShader=e.fragmentShader.replace("#include ",a),e.fragmentShader=e.fragmentShader.replace("#include ",o),e.fragmentShader=e.fragmentShader.replace("#include ",r)},Object.defineProperties(this,{specular:{get:function(){return s.specular.value},set:function(e){s.specular.value=e}},specularMap:{get:function(){return s.specularMap.value},set:function(e){s.specularMap.value=e}},glossiness:{get:function(){return s.glossiness.value},set:function(e){s.glossiness.value=e}},glossinessMap:{get:function(){return s.glossinessMap.value},set:function(e){s.glossinessMap.value=e,e?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_ROUGHNESSMAP=""):(delete this.defines.USE_ROUGHNESSMAP,delete this.defines.USE_GLOSSINESSMAP)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}function f(){return{name:n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,specularGlossinessParams:["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"],getMaterialType:function(){return m},extendParams:function(e,t,n){var a=t.extensions[this.name];e.color=new i.Color(1,1,1),e.opacity=1;var o=[];if(Array.isArray(a.diffuseFactor)){var r=a.diffuseFactor;e.color.fromArray(r),e.opacity=r[3]}if(void 0!==a.diffuseTexture&&o.push(n.assignTexture(e,"map",a.diffuseTexture)),e.emissive=new i.Color(0,0,0),e.glossiness=void 0!==a.glossinessFactor?a.glossinessFactor:1,e.specular=new i.Color(1,1,1),Array.isArray(a.specularFactor)&&e.specular.fromArray(a.specularFactor),void 0!==a.specularGlossinessTexture){var s=a.specularGlossinessTexture;o.push(n.assignTexture(e,"glossinessMap",s)),o.push(n.assignTexture(e,"specularMap",s))}return Promise.all(o)},createMaterial:function(e){var t=new m(e);return t.fog=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,t.normalMapType=i.TangentSpaceNormalMap,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}}}function g(){this.name=n.KHR_MESH_QUANTIZATION}function v(e,t,n,a){i.Interpolant.call(this,e,t,n,a)}d.prototype.decodePrimitive=function(e,t){var n=this.json,a=this.dracoLoader,o=e.extensions[this.name].bufferView,r=e.extensions[this.name].attributes,i={},s={},l={};for(var c in r){var h=A[c]||c.toLowerCase();i[h]=r[c]}for(c in e.attributes){h=A[c]||c.toLowerCase();if(void 0!==r[c]){var u=n.accessors[e.attributes[c]],d=E[u.componentType];l[h]=d,s[h]=!0===u.normalized}}return t.getDependency("bufferView",o).then((function(e){return new Promise((function(t){a.decodeDracoFile(e,(function(e){for(var n in e.attributes){var a=e.attributes[n],o=s[n];void 0!==o&&(a.normalized=o)}t(e)}),i,l)}))}))},p.prototype.extendTexture=function(e,t){return e=e.clone(),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),void 0!==t.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),e.needsUpdate=!0,e},m.prototype=Object.create(i.MeshStandardMaterial.prototype),m.prototype.constructor=m,m.prototype.copy=function(e){return i.MeshStandardMaterial.prototype.copy.call(this,e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this},v.prototype=Object.create(i.Interpolant.prototype),v.prototype.constructor=v,v.prototype.copySampleValue_=function(e){for(var t=this.resultBuffer,n=this.sampleValues,a=this.valueSize,o=e*a*3+a,r=0;r!==a;r++)t[r]=n[o+r];return t},v.prototype.beforeStart_=v.prototype.copySampleValue_,v.prototype.afterEnd_=v.prototype.copySampleValue_,v.prototype.interpolate_=function(e,t,n,a){for(var o=this.resultBuffer,r=this.sampleValues,i=this.valueSize,s=2*i,l=3*i,c=a-t,h=(n-t)/c,u=h*h,d=u*h,p=e*l,m=p-l,f=-2*d+3*u,g=d-u,v=1-f,b=g-u+h,y=0;y!==i;y++){var w=r[m+y+i],L=r[m+y+s]*c,M=r[p+y+i],S=r[p+y]*c;o[y]=v*w+b*L+f*M+g*S}return o};var b=0,y=1,w=2,L=3,M=4,S=5,x=6,E={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},T={9728:i.NearestFilter,9729:i.LinearFilter,9984:i.NearestMipmapNearestFilter,9985:i.LinearMipmapNearestFilter,9986:i.NearestMipmapLinearFilter,9987:i.LinearMipmapLinearFilter},R={33071:i.ClampToEdgeWrapping,33648:i.MirroredRepeatWrapping,10497:i.RepeatWrapping},C={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},A={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},P={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},_={CUBICSPLINE:void 0,LINEAR:i.InterpolateLinear,STEP:i.InterpolateDiscrete},F="OPAQUE",O="MASK",k="BLEND",H={"image/png":i.RGBAFormat,"image/jpeg":i.RGBFormat};function I(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}function D(e,t,n){for(var a in n.extensions)void 0===e[a]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[a]=n.extensions[a])}function U(e,t){void 0!==t.extras&&("object"===G(t.extras)?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function j(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(var n=0,a=t.weights.length;n=2&&r.setY(R,S[x*l+1]),l>=3&&r.setZ(R,S[x*l+2]),l>=4&&r.setW(R,S[x*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return r}))},z.prototype.loadTexture=function(e){var t,a=this,o=this.json,r=this.options,s=this.textureLoader,l=self.URL||self.webkitURL,c=o.textures[e],h=c.extensions||{},u=(t=h[n.MSFT_TEXTURE_DDS]?o.images[h[n.MSFT_TEXTURE_DDS].source]:o.images[c.source]).uri,d=!1;return void 0!==t.bufferView&&(u=a.getDependency("bufferView",t.bufferView).then((function(e){d=!0;var n=new Blob([e],{type:t.mimeType});return u=l.createObjectURL(n)}))),Promise.resolve(u).then((function(e){var t=r.manager.getHandler(e);return t||(t=h[n.MSFT_TEXTURE_DDS]?a.extensions[n.MSFT_TEXTURE_DDS].ddsLoader:s),new Promise((function(n,a){t.load(I(e,r.path),n,void 0,a)}))})).then((function(e){!0===d&&l.revokeObjectURL(u),e.flipY=!1,c.name&&(e.name=c.name),t.mimeType in H&&(e.format=H[t.mimeType]);var n=(o.samplers||{})[c.sampler]||{};return e.magFilter=T[n.magFilter]||i.LinearFilter,e.minFilter=T[n.minFilter]||i.LinearMipmapLinearFilter,e.wrapS=R[n.wrapS]||i.RepeatWrapping,e.wrapT=R[n.wrapT]||i.RepeatWrapping,e}))},z.prototype.assignTexture=function(e,t,a){var o=this;return this.getDependency("texture",a.index).then((function(r){if(!r.isCompressedTexture)switch(t){case"aoMap":case"emissiveMap":case"metalnessMap":case"normalMap":case"roughnessMap":r.format=i.RGBFormat}if(void 0===a.texCoord||0==a.texCoord||"aoMap"===t&&1==a.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+a.texCoord+" for texture "+t+" not yet supported."),o.extensions[n.KHR_TEXTURE_TRANSFORM]){var s=void 0!==a.extensions?a.extensions[n.KHR_TEXTURE_TRANSFORM]:void 0;s&&(r=o.extensions[n.KHR_TEXTURE_TRANSFORM].extendTexture(r,s))}e[t]=r}))},z.prototype.assignFinalMaterial=function(e){var t=e.geometry,n=e.material,a=void 0!==t.attributes.tangent,o=void 0!==t.attributes.color,r=void 0===t.attributes.normal,s=!0===e.isSkinnedMesh,l=Object.keys(t.morphAttributes).length>0,c=l&&void 0!==t.morphAttributes.normal;if(e.isPoints){var h="PointsMaterial:"+n.uuid,u=this.cache.get(h);u||(u=new i.PointsMaterial,i.Material.prototype.copy.call(u,n),u.color.copy(n.color),u.map=n.map,u.sizeAttenuation=!1,this.cache.add(h,u)),n=u}else if(e.isLine){h="LineBasicMaterial:"+n.uuid;var d=this.cache.get(h);d||(d=new i.LineBasicMaterial,i.Material.prototype.copy.call(d,n),d.color.copy(n.color),this.cache.add(h,d)),n=d}if(a||o||r||s||l){h="ClonedMaterial:"+n.uuid+":";n.isGLTFSpecularGlossinessMaterial&&(h+="specular-glossiness:"),s&&(h+="skinning:"),a&&(h+="vertex-tangents:"),o&&(h+="vertex-colors:"),r&&(h+="flat-shading:"),l&&(h+="morph-targets:"),c&&(h+="morph-normals:");var p=this.cache.get(h);p||(p=n.clone(),s&&(p.skinning=!0),a&&(p.vertexTangents=!0),o&&(p.vertexColors=!0),r&&(p.flatShading=!0),l&&(p.morphTargets=!0),c&&(p.morphNormals=!0),this.cache.add(h,p)),n=p}n.aoMap&&void 0===t.attributes.uv2&&void 0!==t.attributes.uv&&t.setAttribute("uv2",t.attributes.uv),n.normalScale&&!a&&(n.normalScale.y=-n.normalScale.y),n.clearcoatNormalScale&&!a&&(n.clearcoatNormalScale.y=-n.clearcoatNormalScale.y),e.material=n},z.prototype.loadMaterial=function(e){var t,a=this,o=this.json,r=this.extensions,s=o.materials[e],l={},c=s.extensions||{},h=[];if(c[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var u=r[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];t=u.getMaterialType(),h.push(u.extendParams(l,s,a))}else if(c[n.KHR_MATERIALS_UNLIT]){var d=r[n.KHR_MATERIALS_UNLIT];t=d.getMaterialType(),h.push(d.extendParams(l,s,a))}else{t=i.MeshStandardMaterial;var p=s.pbrMetallicRoughness||{};if(l.color=new i.Color(1,1,1),l.opacity=1,Array.isArray(p.baseColorFactor)){var f=p.baseColorFactor;l.color.fromArray(f),l.opacity=f[3]}void 0!==p.baseColorTexture&&h.push(a.assignTexture(l,"map",p.baseColorTexture)),l.metalness=void 0!==p.metallicFactor?p.metallicFactor:1,l.roughness=void 0!==p.roughnessFactor?p.roughnessFactor:1,void 0!==p.metallicRoughnessTexture&&(h.push(a.assignTexture(l,"metalnessMap",p.metallicRoughnessTexture)),h.push(a.assignTexture(l,"roughnessMap",p.metallicRoughnessTexture)))}!0===s.doubleSided&&(l.side=i.DoubleSide);var g=s.alphaMode||F;if(g===k?(l.transparent=!0,l.depthWrite=!1):(l.transparent=!1,g===O&&(l.alphaTest=void 0!==s.alphaCutoff?s.alphaCutoff:.5)),void 0!==s.normalTexture&&t!==i.MeshBasicMaterial&&(h.push(a.assignTexture(l,"normalMap",s.normalTexture)),l.normalScale=new i.Vector2(1,1),void 0!==s.normalTexture.scale&&l.normalScale.set(s.normalTexture.scale,s.normalTexture.scale)),void 0!==s.occlusionTexture&&t!==i.MeshBasicMaterial&&(h.push(a.assignTexture(l,"aoMap",s.occlusionTexture)),void 0!==s.occlusionTexture.strength&&(l.aoMapIntensity=s.occlusionTexture.strength)),void 0!==s.emissiveFactor&&t!==i.MeshBasicMaterial&&(l.emissive=(new i.Color).fromArray(s.emissiveFactor)),void 0!==s.emissiveTexture&&t!==i.MeshBasicMaterial&&h.push(a.assignTexture(l,"emissiveMap",s.emissiveTexture)),c[n.KHR_MATERIALS_CLEARCOAT]){var v=r[n.KHR_MATERIALS_CLEARCOAT];t=v.getMaterialType(),h.push(v.extendParams(l,{extensions:c},a))}return Promise.all(h).then((function(){var e;return e=t===m?r[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(l):new t(l),s.name&&(e.name=s.name),e.map&&(e.map.encoding=i.sRGBEncoding),e.emissiveMap&&(e.emissiveMap.encoding=i.sRGBEncoding),U(e,s),s.extensions&&D(r,e,s),e}))},z.prototype.loadGeometries=function(e){var t=this,a=this.extensions,o=this.primitiveCache;function r(e){return a[n.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then((function(n){return V(n,e,t)}))}for(var s,l,c=[],h=0,u=e.length;h0&&j(u,a),u.name=a.name||"mesh_"+e,s.length>1&&(u.name+="_"+c),U(u,a),n.assignFinalMaterial(u),l.push(u)}if(1===l.length)return l[0];var f=new i.Group;for(c=0,h=l.length;c1){var n=l[c.mesh]++;(t=e.clone()).name+="_instance_"+n}else t=e;return void 0!==c.weights&&t.traverse((function(e){if(e.isMesh)for(var t=0,n=c.weights.length;t1?new i.Group:1===e.length?e[0]:new i.Object3D)!==e[0])for(var n=0,a=e.length;ne.length)&&(t=e.length);for(var n=0,a=new Array(t);n{e.exports=function(e){var t=e.MOUSE;function n(t){this.object=t,this.target=new e.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.25;var n,a,o,r,i,s,l,c,h=this,u=1e-6,d=0,p=0,m=1,f=new e.Vector3,g=!1;this.getPolarAngle=function(){return a},this.getAzimuthalAngle=function(){return n},this.rotateLeft=function(e){p-=e},this.rotateUp=function(e){d-=e},this.panLeft=(o=new e.Vector3,function(e){var t=this.object.matrix.elements;o.set(t[0],t[1],t[2]),o.multiplyScalar(-e),f.add(o)}),this.panUp=function(){var t=new e.Vector3;return function(e){var n=this.object.matrix.elements;t.set(n[4],n[5],n[6]),t.multiplyScalar(e),f.add(t)}}(),this.pan=function(t,n,a,o){if(h.object instanceof e.PerspectiveCamera){var r=h.object.position.clone().sub(h.target).length();r*=Math.tan(h.object.fov/2*Math.PI/180),h.panLeft(2*t*r/o),h.panUp(2*n*r/o)}else h.object instanceof e.OrthographicCamera?(h.panLeft(t*(h.object.right-h.object.left)/a),h.panUp(n*(h.object.top-h.object.bottom)/o)):console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.")},this.dollyIn=function(t){h.object instanceof e.PerspectiveCamera?m/=t:h.object instanceof e.OrthographicCamera?(h.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom*t)),h.object.updateProjectionMatrix(),g=!0):console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.")},this.dollyOut=function(t){h.object instanceof e.PerspectiveCamera?m*=t:h.object instanceof e.OrthographicCamera?(h.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/t)),h.object.updateProjectionMatrix(),g=!0):console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.")},this.update=(r=new e.Vector3,i=(new e.Quaternion).setFromUnitVectors(t.up,new e.Vector3(0,1,0)),s=i.clone().inverse(),l=new e.Vector3,c=new e.Quaternion,function(){var e=this.object.position;r.copy(e).sub(this.target),r.applyQuaternion(i),n=Math.atan2(r.x,r.z),a=Math.atan2(Math.sqrt(r.x*r.x+r.z*r.z),r.y),n+=p,a+=d,n=Math.max(this.minAzimuthAngle,Math.min(this.maxAzimuthAngle,n)),a=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,a)),a=Math.max(u,Math.min(Math.PI-u,a));var t=r.length()*m;return t=Math.max(this.minDistance,Math.min(this.maxDistance,t)),this.target.add(f),r.x=t*Math.sin(a)*Math.sin(n),r.y=t*Math.cos(a),r.z=t*Math.sin(a)*Math.cos(n),r.applyQuaternion(s),e.copy(this.target).add(r),this.object.lookAt(this.target),!0===this.enableDamping?(p*=1-this.dampingFactor,d*=1-this.dampingFactor):(p=0,d=0),m=1,f.set(0,0,0),!!(g||l.distanceToSquared(this.object.position)>u||8*(1-c.dot(this.object.quaternion))>u)&&(l.copy(this.object.position),c.copy(this.object.quaternion),g=!1,!0)})}function a(t,a){var o=new n(t);this.domElement=void 0!==a?a:document,Object.defineProperty(this,"constraint",{get:function(){return o}}),this.getPolarAngle=function(){return o.getPolarAngle()},this.getAzimuthalAngle=function(){return o.getAzimuthalAngle()},this.enabled=!0,this.center=this.target,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:e.MOUSE.LEFT,ZOOM:e.MOUSE.MIDDLE,PAN:e.MOUSE.RIGHT};var r=this,i=new e.Vector2,s=new e.Vector2,l=new e.Vector2,c=new e.Vector2,h=new e.Vector2,u=new e.Vector2,d=new e.Vector2,p=new e.Vector2,m=new e.Vector2,f=-1,g=0,v=1,b=2,y=3,w=4,L=5,M=f;this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom;var S={type:"change"},x={type:"start"},E={type:"end"};function T(e,t){var n=r.domElement===document?r.domElement.body:r.domElement;o.pan(e,t,n.clientWidth,n.clientHeight)}function R(){return Math.pow(.95,r.zoomSpeed)}function C(e){if(!1!==r.enabled){if(e.preventDefault(),e.button===r.mouseButtons.ORBIT){if(!1===r.enableRotate)return;M=g,i.set(e.clientX,e.clientY)}else if(e.button===r.mouseButtons.ZOOM){if(!1===r.enableZoom)return;M=v,d.set(e.clientX,e.clientY)}else if(e.button===r.mouseButtons.PAN){if(!1===r.enablePan)return;M=b,c.set(e.clientX,e.clientY)}M!==f&&(document.addEventListener("mousemove",A,!1),document.addEventListener("mouseup",P,!1),r.dispatchEvent(x))}}function A(e){if(!1!==r.enabled){e.preventDefault();var t=r.domElement===document?r.domElement.body:r.domElement;if(M===g){if(!1===r.enableRotate)return;s.set(e.clientX,e.clientY),l.subVectors(s,i),o.rotateLeft(2*Math.PI*l.x/t.clientWidth*r.rotateSpeed),o.rotateUp(2*Math.PI*l.y/t.clientHeight*r.rotateSpeed),i.copy(s)}else if(M===v){if(!1===r.enableZoom)return;p.set(e.clientX,e.clientY),m.subVectors(p,d),m.y>0?o.dollyIn(R()):m.y<0&&o.dollyOut(R()),d.copy(p)}else if(M===b){if(!1===r.enablePan)return;h.set(e.clientX,e.clientY),u.subVectors(h,c),T(u.x,u.y),c.copy(h)}M!==f&&r.update()}}function P(){!1!==r.enabled&&(document.removeEventListener("mousemove",A,!1),document.removeEventListener("mouseup",P,!1),r.dispatchEvent(E),M=f)}function _(e){if(!1!==r.enabled&&!1!==r.enableZoom&&M===f){e.preventDefault(),e.stopPropagation();var t=0;void 0!==e.wheelDelta?t=e.wheelDelta:void 0!==e.detail&&(t=-e.detail),t>0?o.dollyOut(R()):t<0&&o.dollyIn(R()),r.update(),r.dispatchEvent(x),r.dispatchEvent(E)}}function F(e){if(!1!==r.enabled&&!1!==r.enableKeys&&!1!==r.enablePan)switch(e.keyCode){case r.keys.UP:T(0,r.keyPanSpeed),r.update();break;case r.keys.BOTTOM:T(0,-r.keyPanSpeed),r.update();break;case r.keys.LEFT:T(r.keyPanSpeed,0),r.update();break;case r.keys.RIGHT:T(-r.keyPanSpeed,0),r.update()}}function O(e){if(!1!==r.enabled){switch(e.touches.length){case 1:if(!1===r.enableRotate)return;M=y,i.set(e.touches[0].pageX,e.touches[0].pageY);break;case 2:if(!1===r.enableZoom)return;M=w;var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+n*n);d.set(0,a);break;case 3:if(!1===r.enablePan)return;M=L,c.set(e.touches[0].pageX,e.touches[0].pageY);break;default:M=f}M!==f&&r.dispatchEvent(x)}}function k(e){if(!1!==r.enabled){e.preventDefault(),e.stopPropagation();var t=r.domElement===document?r.domElement.body:r.domElement;switch(e.touches.length){case 1:if(!1===r.enableRotate)return;if(M!==y)return;s.set(e.touches[0].pageX,e.touches[0].pageY),l.subVectors(s,i),o.rotateLeft(2*Math.PI*l.x/t.clientWidth*r.rotateSpeed),o.rotateUp(2*Math.PI*l.y/t.clientHeight*r.rotateSpeed),i.copy(s),r.update();break;case 2:if(!1===r.enableZoom)return;if(M!==w)return;var n=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY,g=Math.sqrt(n*n+a*a);p.set(0,g),m.subVectors(p,d),m.y>0?o.dollyOut(R()):m.y<0&&o.dollyIn(R()),d.copy(p),r.update();break;case 3:if(!1===r.enablePan)return;if(M!==L)return;h.set(e.touches[0].pageX,e.touches[0].pageY),u.subVectors(h,c),T(u.x,u.y),c.copy(h),r.update();break;default:M=f}}}function H(){!1!==r.enabled&&(r.dispatchEvent(E),M=f)}function I(e){e.preventDefault()}this.update=function(){this.autoRotate&&M===f&&o.rotateLeft(2*Math.PI/60/60*r.autoRotateSpeed),!0===o.update()&&this.dispatchEvent(S)},this.reset=function(){M=f,this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(S),this.update()},this.dispose=function(){this.domElement.removeEventListener("contextmenu",I,!1),this.domElement.removeEventListener("mousedown",C,!1),this.domElement.removeEventListener("mousewheel",_,!1),this.domElement.removeEventListener("MozMousePixelScroll",_,!1),this.domElement.removeEventListener("touchstart",O,!1),this.domElement.removeEventListener("touchend",H,!1),this.domElement.removeEventListener("touchmove",k,!1),document.removeEventListener("mousemove",A,!1),document.removeEventListener("mouseup",P,!1),window.removeEventListener("keydown",F,!1)},this.domElement.addEventListener("contextmenu",I,!1),this.domElement.addEventListener("mousedown",C,!1),this.domElement.addEventListener("mousewheel",_,!1),this.domElement.addEventListener("MozMousePixelScroll",_,!1),this.domElement.addEventListener("touchstart",O,!1),this.domElement.addEventListener("touchend",H,!1),this.domElement.addEventListener("touchmove",k,!1),window.addEventListener("keydown",F,!1),this.update()}return t||(t={LEFT:0,MIDDLE:1,RIGHT:2}),a.prototype=Object.create(e.EventDispatcher.prototype),a.prototype.constructor=a,Object.defineProperties(a.prototype,{object:{get:function(){return this.constraint.object}},target:{get:function(){return this.constraint.target},set:function(e){console.warn("THREE.OrbitControls: target is now immutable. Use target.set() instead."),this.constraint.target.copy(e)}},minDistance:{get:function(){return this.constraint.minDistance},set:function(e){this.constraint.minDistance=e}},maxDistance:{get:function(){return this.constraint.maxDistance},set:function(e){this.constraint.maxDistance=e}},minZoom:{get:function(){return this.constraint.minZoom},set:function(e){this.constraint.minZoom=e}},maxZoom:{get:function(){return this.constraint.maxZoom},set:function(e){this.constraint.maxZoom=e}},minPolarAngle:{get:function(){return this.constraint.minPolarAngle},set:function(e){this.constraint.minPolarAngle=e}},maxPolarAngle:{get:function(){return this.constraint.maxPolarAngle},set:function(e){this.constraint.maxPolarAngle=e}},minAzimuthAngle:{get:function(){return this.constraint.minAzimuthAngle},set:function(e){this.constraint.minAzimuthAngle=e}},maxAzimuthAngle:{get:function(){return this.constraint.maxAzimuthAngle},set:function(e){this.constraint.maxAzimuthAngle=e}},enableDamping:{get:function(){return this.constraint.enableDamping},set:function(e){this.constraint.enableDamping=e}},dampingFactor:{get:function(){return this.constraint.dampingFactor},set:function(e){this.constraint.dampingFactor=e}},noZoom:{get:function(){return console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(e){console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!e}},noRotate:{get:function(){return console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(e){console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!e}},noPan:{get:function(){return console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.constraint.enableDamping},set:function(e){console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.constraint.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.constraint.dampingFactor},set:function(e){console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.constraint.dampingFactor=e}}}),a}}},e=>{"use strict";e.O(0,[216],(()=>{return t=332,e(e.s=t);var t}));e.O()}]);