PageSourceSearch

https://www.tapetenshop.de/theme/9e9efb7c0f7d862d35728f241ecb5ba7/…/spatial-cms-element.GLTFLoader.7ac1e0.js

js tapetenshop.de collected 2026-09-26 07:22:34 UTC 44,590 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[1990],{990:(e,t,r)=>{r.d(t,{GLTFLoader:()=>i});var s=r(173);function n(e,t){if(t===s.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t!==s.TriangleFanDrawMode&&t!==s.TriangleStripDrawMode)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e;{let r=e.getIndex();if(null===r){let t=[],s=e.getAttribute("position");if(void 0===s)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let e=0;e<s.count;e++)t.push(e);e.setIndex(t),r=e.getIndex()}let n=r.count-2,i=[];if(t===s.TriangleFanDrawMode)for(let e=1;e<=n;e++)i.push(r.getX(0)),i.push(r.getX(e)),i.push(r.getX(e+1));else for(let e=0;e<n;e++)e%2==0?(i.push(r.getX(e)),i.push(r.getX(e+1)),i.push(r.getX(e+2))):(i.push(r.getX(e+2)),i.push(r.getX(e+1)),i.push(r.getX(e)));i.length/3!==n&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");let a=e.clone();return a.setIndex(i),a.clearGroups(),a}}class i extends s.Loader{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new h(e)}),this.register(function(e){return new x(e)}),this.register(function(e){return new R(e)}),this.register(function(e){return new E(e)}),this.register(function(e){return new p(e)}),this.register(function(e){return new m(e)}),this.register(function(e){return new f(e)}),this.register(function(e){return new A(e)}),this.register(function(e){return new c(e)}),this.register(function(e){return new g(e)}),this.register(function(e){return new d(e)}),this.register(function(e){return new T(e)}),this.register(function(e){return new l(e)}),this.register(function(e){return new _(e)}),this.register(function(e){return new v(e)})}load(e,t,r,n){let i;let a=this;i=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:s.LoaderUtils.extractUrlBase(e),this.manager.itemStart(e);let o=function(t){n?n(t):console.error(t),a.manager.itemError(e),a.manager.itemEnd(e)},l=new s.FileLoader(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(r){try{a.parse(r,i,function(r){t(r),a.manager.itemEnd(e)},o)}catch(e){o(e)}},r,o)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return -1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this}unregister(e){return -1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,r,s){let n;let i={},a={},l=new TextDecoder;if("string"==typeof e)n=JSON.parse(e);else if(e instanceof ArrayBuffer){if(l.decode(new Uint8Array(e,0,4))===M){try{i[o.KHR_BINARY_GLTF]=new w(e)}catch(e){s&&s(e);return}n=JSON.parse(i[o.KHR_BINARY_GLTF].content)}else n=JSON.parse(l.decode(e))}else n=e;if(void 0===n.asset||n.asset.version[0]<2){s&&s(Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}let c=new z(n,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e<this.pluginCallbacks.length;e++){let t=this.pluginCallbacks[e](c);a[t.name]=t,i[t.name]=!0}if(n.extensionsUsed)for(let e=0;e<n.extensionsUsed.length;++e){let t=n.extensionsUsed[e],r=n.extensionsRequired||[];switch(t){case o.KHR_MATERIALS_UNLIT:i[t]=new u;break;case o.KHR_DRACO_MESH_COMPRESSION:i[t]=new S(n,this.dracoLoader);break;case o.KHR_TEXTURE_TRANSFORM:i[t]=new L;break;case o.KHR_MESH_QUANTIZATION:i[t]=new I;break;default:r.indexOf(t)>=0&&void 0===a[t]&&console.warn('THREE.GLTFLoader: Unknown extension "'+t+'".')}}c.setExtensions(i),c.setPlugins(a),c.parse(r,s)}parseAsync(e,t){let r=this;return new Promise(function(s,n){r.parse(e,t,s,n)})}}function a(){let e={};return{get:function(t){return e[t]},add:function(t,r){e[t]=r},remove:function(t){delete e[t]},removeAll:function(){e={}}}}let o={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_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class l{constructor(e){this.parser=e,this.name=o.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let r=0,s=t.length;r<s;r++){let s=t[r];s.extensions&&s.extensions[this.name]&&void 0!==s.extensions[this.name].light&&e._addNodeRef(this.cache,s.extensions[this.name].light)}}_loadLight(e){let t;let r=this.parser,n="light:"+e,i=r.cache.get(n);if(i)return i;let a=r.json,o=((a.extensions&&a.extensions[this.name]||{}).lights||[])[e],l=new s.Color(16777215);void 0!==o.color&&l.fromArray(o.color);let u=void 0!==o.range?o.range:0;switch(o.type){case"directional":(t=new s.DirectionalLight(l)).target.position.set(0,0,-1),t.add(t.target);break;case"point":(t=new s.PointLight(l)).distance=u;break;case"spot":(t=new s.SpotLight(l)).distance=u,o.spot=o.spot||{},o.spot.innerConeAngle=void 0!==o.spot.innerConeAngle?o.spot.innerConeAngle:0,o.spot.outerConeAngle=void 0!==o.spot.outerConeAngle?o.spot.outerConeAngle:Math.PI/4,t.angle=o.spot.outerConeAngle,t.penumbra=1-o.spot.innerConeAngle/o.spot.outerConeAngle,t.target.position.set(0,0,-1),t.add(t.target);break;default:throw Error("THREE.GLTFLoader: Unexpected light type: "+o.type)}return t.position.set(0,0,0),t.decay=2,j(t,o),void 0!==o.intensity&&(t.intensity=o.intensity),t.name=r.createUniqueName(o.name||"light_"+e),i=Promise.resolve(t),r.cache.add(n,i),i}getDependency(e,t){if("light"===e)return this._loadLight(t)}createNodeAttachment(e){let t=this,r=this.parser,s=r.json.nodes[e],n=(s.extensions&&s.extensions[this.name]||{}).light;return void 0===n?null:this._loadLight(n).then(function(e){return r._getNodeRef(t.cache,n,e)})}}class u{constructor(){this.name=o.KHR_MATERIALS_UNLIT}getMaterialType(){return s.MeshBasicMaterial}extendParams(e,t,r){let n=[];e.color=new s.Color(1,1,1),e.opacity=1;let i=t.pbrMetallicRoughness;if(i){if(Array.isArray(i.baseColorFactor)){let t=i.baseColorFactor;e.color.fromArray(t),e.opacity=t[3]}void 0!==i.baseColorTexture&&n.push(r.assignTexture(e,"map",i.baseColorTexture,s.SRGBColorSpace))}return Promise.all(n)}}class c{constructor(e){this.parser=e,this.name=o.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){let r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let s=r.extensions[this.name].emissiveStrength;return void 0!==s&&(t.emissiveIntensity=s),Promise.resolve()}}class h{constructor(e){this.parser=e,this.name=o.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?s.MeshPhysicalMaterial:null}extendMaterialParams(e,t){let r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let i=[],a=n.extensions[this.name];if(void 0!==a.clearcoatFactor&&(t.clearcoat=a.clearcoatFactor),void 0!==a.clearcoatTexture&&i.push(r.assignTexture(t,"clearcoatMap",a.clearcoatTexture)),void 0!==a.clearcoatRoughnessFactor&&(t.clearcoatRoughness=a.clearcoatRoughnessFactor),void 0!==a.clearcoatRoughnessTexture&&i.push(r.assignTexture(t,"clearcoatRoughnessMap",a.clearcoatRoughnessTexture)),void 0!==a.clearcoatNormalTexture&&(i.push(r.assignTexture(t,"clearcoatNormalMap",a.clearcoatNormalTexture)),void 0!==a.clearcoatNormalTexture.scale)){let e=a.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new s.Vector2(e,e)}return Promise.all(i)}}class d{constructor(e){this.parser=e,this.name=o.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?s.MeshPhysicalMaterial:null}extendMaterialParams(e,t){let r=this.parser,s=r.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let n=[],i=s.extensions[this.name];return void 0!==i.iridescenceFactor&&(t.iridescence=i.iridescenceFactor),void 0!==i.iridescenceTexture&&n.push(r.assignTexture(t,"iridescenceMap",i.iridescenceTexture)),void 0!==i.iridescenceIor&&(t.iridescenceIOR=i.iridescenceIor),void 0===t.iridescenceThicknessRange&&(t.iridescenceThicknessRange=[100,400]),void 0!==i.iridescenceThicknessMinimum&&(t.iridescenceThicknessRange[0]=i.iridescenceThicknessMinimum),void 0!==i.iridescenceThicknessMaximum&&(t.iridescenceThicknessRange[1]=i.iridescenceThicknessMaximum),void 0!==i.iridescenceThicknessTexture&&n.push(r.assignTexture(t,"iridescenceThicknessMap",i.iridescenceThicknessTexture)),Promise.all(n)}}class p{constructor(e){this.parser=e,this.name=o.KHR_MATERIALS_SHEEN}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?s.MeshPhysicalMaterial:null}extendMaterialParams(e,t){let r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let i=[];t.sheenColor=new s.Color(0,0,0),t.sheenRoughness=0,t.sheen=1;let a=n.extensions[this.name];return void 0!==a.sheenColorFactor&&t.sheenColor.fromArray(a.sheenColorFactor),void 0!==a.sheenRoughnessFactor&&(t.sheenRoughness=a.sheenRoughnessFactor),void 0!==a.sheenColorTexture&&i.push(r.assignTexture(t,"sheenColorMap",a.sheenColorTexture,s.SRGBColorSpace)),void 0!==a.sheenRoughnessTexture&&i.push(r.assignTexture(t,"sheenRoughnessMap",a.sheenRoughnessTexture)),Promise.all(i)}}class m{constructor(e){this.parser=e,this.name=o.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?s.MeshPhysicalMaterial:null}extendMaterialParams(e,t){let r=this.parser,s=r.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let n=[],i=s.extensions[this.name];return void 0!==i.transmissionFactor&&(t.transmission=i.transmissionFactor),void 0!==i.transmissionTexture&&n.push(r.assignTexture(t,"transmissionMap",i.transmissionTexture)),Promise.all(n)}}class f{constructor(e){this.parser=e,this.name=o.KHR_MATERIALS_VOLUME}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?s.MeshPhysicalMaterial:null}extendMaterialParams(e,t){let r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let i=[],a=n.extensions[this.name];t.thickness=void 0!==a.thicknessFactor?a.thicknessFactor:0,void 0!==a.thicknessTexture&&i.push(r.assignTexture(t,"thicknessMap",a.thicknessTexture)),t.attenuationDistance=a.attenuationDistance||1/0;let o=a.attenuationColor||[1,1,1];return t.attenuationColor=new s.Color(o[0],o[1],o[2]),Promise.all(i)}}class A{constructor(e){this.parser=e,this.name=o.KHR_MATERIALS_IOR}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?s.MeshPhysicalMaterial:null}extendMaterialParams(e,t){let r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let s=r.extensions[this.name];return t.ior=void 0!==s.ior?s.ior:1.5,Promise.resolve()}}class g{constructor(e){this.parser=e,this.name=o.KHR_MATERIALS_SPECULAR}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?s.MeshPhysicalMaterial:null}extendMaterialParams(e,t){let r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let i=[],a=n.extensions[this.name];t.specularIntensity=void 0!==a.specularFactor?a.specularFactor:1,void 0!==a.specularTexture&&i.push(r.assignTexture(t,"specularIntensityMap",a.specularTexture));let o=a.specularColorFactor||[1,1,1];return t.specularColor=new s.Color(o[0],o[1],o[2]),void 0!==a.specularColorTexture&&i.push(r.assignTexture(t,"specularColorMap",a.specularColorTexture,s.SRGBColorSpace)),Promise.all(i)}}class T{constructor(e){this.parser=e,this.name=o.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?s.MeshPhysicalMaterial:null}extendMaterialParams(e,t){let r=this.parser,s=r.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let n=[],i=s.extensions[this.name];return void 0!==i.anisotropyStrength&&(t.anisotropy=i.anisotropyStrength),void 0!==i.anisotropyRotation&&(t.anisotropyRotation=i.anisotropyRotation),void 0!==i.anisotropyTexture&&n.push(r.assignTexture(t,"anisotropyMap",i.anisotropyTexture)),Promise.all(n)}}class x{constructor(e){this.parser=e,this.name=o.KHR_TEXTURE_BASISU}loadTexture(e){let t=this.parser,r=t.json,s=r.textures[e];if(!s.extensions||!s.extensions[this.name])return null;let n=s.extensions[this.name],i=t.options.ktx2Loader;if(!i){if(!(r.extensionsRequired&&r.extensionsRequired.indexOf(this.name)>=0))return null;throw Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures")}return t.loadTextureImage(e,n.source,i)}}class R{constructor(e){this.parser=e,this.name=o.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){let t=this.name,r=this.parser,s=r.json,n=s.textures[e];if(!n.extensions||!n.extensions[t])return null;let i=n.extensions[t],a=s.images[i.source],o=r.textureLoader;if(a.uri){let e=r.options.manager.getHandler(a.uri);null!==e&&(o=e)}return this.detectSupport().then(function(n){if(n)return r.loadTextureImage(e,i.source,o);if(s.extensionsRequired&&s.extensionsRequired.indexOf(t)>=0)throw Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}})),this.isSupported}}class E{constructor(e){this.parser=e,this.name=o.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){let t=this.name,r=this.parser,s=r.json,n=s.textures[e];if(!n.extensions||!n.extensions[t])return null;let i=n.extensions[t],a=s.images[i.source],o=r.textureLoader;if(a.uri){let e=r.options.manager.getHandler(a.uri);null!==e&&(o=e)}return this.detectSupport().then(function(n){if(n)return r.loadTextureImage(e,i.source,o);if(s.extensionsRequired&&s.extensionsRequired.indexOf(t)>=0)throw Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdj
1FDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(1===t.height)}})),this.isSupported}}class _{constructor(e){this.name=o.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,r=t.bufferViews[e];if(!r.extensions||!r.extensions[this.name])return null;{let e=r.extensions[this.name],s=this.parser.getDependency("buffer",e.buffer),n=this.parser.options.meshoptDecoder;if(!n||!n.supported){if(!(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0))return null;throw Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files")}return s.then(function(t){let r=e.byteOffset||0,s=e.byteLength||0,i=e.count,a=e.byteStride,o=new Uint8Array(t,r,s);return n.decodeGltfBufferAsync?n.decodeGltfBufferAsync(i,a,o,e.mode,e.filter).then(function(e){return e.buffer}):n.ready.then(function(){let t=new ArrayBuffer(i*a);return n.decodeGltfBuffer(new Uint8Array(t),i,a,o,e.mode,e.filter),t})})}}}class v{constructor(e){this.name=o.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){let t=this.parser.json,r=t.nodes[e];if(!r.extensions||!r.extensions[this.name]||void 0===r.mesh)return null;for(let e of t.meshes[r.mesh].primitives)if(e.mode!==O.TRIANGLES&&e.mode!==O.TRIANGLE_STRIP&&e.mode!==O.TRIANGLE_FAN&&void 0!==e.mode)return null;let n=r.extensions[this.name].attributes,i=[],a={};for(let e in n)i.push(this.parser.getDependency("accessor",n[e]).then(t=>(a[e]=t,a[e])));return i.length<1?null:(i.push(this.parser.createNodeMesh(e)),Promise.all(i).then(e=>{let t=e.pop(),r=t.isGroup?t.children:[t],n=e[0].count,i=[];for(let e of r){let t=new s.Matrix4,r=new s.Vector3,o=new s.Quaternion,l=new s.Vector3(1,1,1),u=new s.InstancedMesh(e.geometry,e.material,n);for(let e=0;e<n;e++)a.TRANSLATION&&r.fromBufferAttribute(a.TRANSLATION,e),a.ROTATION&&o.fromBufferAttribute(a.ROTATION,e),a.SCALE&&l.fromBufferAttribute(a.SCALE,e),u.setMatrixAt(e,t.compose(r,o,l));for(let t in a)"TRANSLATION"!==t&&"ROTATION"!==t&&"SCALE"!==t&&e.geometry.setAttribute(t,a[t]);s.Object3D.prototype.copy.call(u,e),this.parser.assignFinalMaterial(u),i.push(u)}return t.isGroup?(t.clear(),t.add(...i),t):i[0]}))}}let M="glTF",y={JSON:1313821514,BIN:5130562};class w{constructor(e){this.name=o.KHR_BINARY_GLTF,this.content=null,this.body=null;let t=new DataView(e,0,12),r=new TextDecoder;if(this.header={magic:r.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==M)throw Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw Error("THREE.GLTFLoader: Legacy binary file detected.");let s=this.header.length-12,n=new DataView(e,12),i=0;for(;i<s;){let t=n.getUint32(i,!0);i+=4;let s=n.getUint32(i,!0);if(i+=4,s===y.JSON){let s=new Uint8Array(e,12+i,t);this.content=r.decode(s)}else if(s===y.BIN){let r=12+i;this.body=e.slice(r,r+t)}i+=t}if(null===this.content)throw Error("THREE.GLTFLoader: JSON content not found.")}}class S{constructor(e,t){if(!t)throw Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=o.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){let r=this.json,s=this.dracoLoader,n=e.extensions[this.name].bufferView,i=e.extensions[this.name].attributes,a={},o={},l={};for(let e in i)a[D[e]||e.toLowerCase()]=i[e];for(let t in e.attributes){let s=D[t]||t.toLowerCase();if(void 0!==i[t]){let n=r.accessors[e.attributes[t]],i=P[n.componentType];l[s]=i.name,o[s]=!0===n.normalized}}return t.getDependency("bufferView",n).then(function(e){return new Promise(function(t){s.decodeDracoFile(e,function(e){for(let t in e.attributes){let r=e.attributes[t],s=o[t];void 0!==s&&(r.normalized=s)}t(e)},a,l)})})}}class L{constructor(){this.name=o.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(void 0===t.texCoord||t.texCoord===e.channel)&&void 0===t.offset&&void 0===t.rotation&&void 0===t.scale||(e=e.clone(),void 0!==t.texCoord&&(e.channel=t.texCoord),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),e.needsUpdate=!0),e}}
1class I{constructor(){this.name=o.KHR_MESH_QUANTIZATION}}class b extends s.Interpolant{constructor(e,t,r,s){super(e,t,r,s)}copySampleValue_(e){let t=this.resultBuffer,r=this.sampleValues,s=this.valueSize,n=e*s*3+s;for(let e=0;e!==s;e++)t[e]=r[n+e];return t}interpolate_(e,t,r,s){let n=this.resultBuffer,i=this.sampleValues,a=this.valueSize,o=2*a,l=3*a,u=s-t,c=(r-t)/u,h=c*c,d=h*c,p=e*l,m=p-l,f=-2*d+3*h,A=d-h,g=1-f,T=A-h+c;for(let e=0;e!==a;e++){let t=i[m+e+a],r=i[m+e+o]*u,s=i[p+e+a],l=i[p+e]*u;n[e]=g*t+T*r+f*s+A*l}return n}}let N=new s.Quaternion;class C extends b{interpolate_(e,t,r,s){let n=super.interpolate_(e,t,r,s);return N.fromArray(n).normalize().toArray(n),n}}let O={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},P={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},H={9728:s.NearestFilter,9729:s.LinearFilter,9984:s.NearestMipmapNearestFilter,9985:s.LinearMipmapNearestFilter,9986:s.NearestMipmapLinearFilter,9987:s.LinearMipmapLinearFilter},k={33071:s.ClampToEdgeWrapping,33648:s.MirroredRepeatWrapping,10497:s.RepeatWrapping},F={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},D={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},B={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},U={CUBICSPLINE:void 0,LINEAR:s.InterpolateLinear,STEP:s.InterpolateDiscrete},G={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function K(e,t,r){for(let s in r.extensions)void 0===e[s]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[s]=r.extensions[s])}function j(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function V(e){let t="",r=Object.keys(e).sort();for(let s=0,n=r.length;s<n;s++)t+=r[s]+":"+e[r[s]]+";";return t}function X(e){switch(e){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}let q=new s.Matrix4;class z{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new a,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let r=!1,n=!1,i=-1;"undefined"!=typeof navigator&&(r=!0===/^((?!chrome|android).)*safari/i.test(navigator.userAgent),i=(n=navigator.userAgent.indexOf("Firefox")>-1)?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),"undefined"==typeof createImageBitmap||r||n&&i<98?this.textureLoader=new s.TextureLoader(this.options.manager):this.textureLoader=new s.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new s.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){let r=this,s=this.json,n=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(e){return e._markDefs&&e._markDefs()}),Promise.all(this._invokeAll(function(e){return e.beforeRoot&&e.beforeRoot()})).then(function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])}).then(function(t){let i={scene:t[0][s.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:s.asset,parser:r,userData:{}};K(n,i,s),j(i,s),Promise.all(r._invokeAll(function(e){return e.afterRoot&&e.afterRoot(i)})).then(function(){e(i)})}).catch(t)}_markDefs(){let e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[];for(let r=0,s=t.length;r<s;r++){let s=t[r].joints;for(let t=0,r=s.length;t<r;t++)e[s[t]].isBone=!0}for(let t=0,s=e.length;t<s;t++){let s=e[t];void 0!==s.mesh&&(this._addNodeRef(this.meshCache,s.mesh),void 0!==s.skin&&(r[s.mesh].isSkinnedMesh=!0)),void 0!==s.camera&&this._addNodeRef(this.cameraCache,s.camera)}}_addNodeRef(e,t){void 0!==t&&(void 0===e.refs[t]&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,r){if(e.refs[t]<=1)return r;let s=r.clone(),n=(e,t)=>{let r=this.associations.get(e);for(let[s,i]of(null!=r&&this.associations.set(t,r),e.children.entries()))n(i,t.children[s])};return n(r,s),s.name+="_instance_"+e.uses[t]++,s}_invokeOne(e){let t=Object.values(this.plugins);t.push(this);for(let r=0;r<t.length;r++){let s=e(t[r]);if(s)return s}return null}_invokeAll(e){let t=Object.values(this.plugins);t.unshift(this);let r=[];for(let s=0;s<t.length;s++){let n=e(t[s]);n&&r.push(n)}return r}getDependency(e,t){let r=e+":"+t,s=this.cache.get(r);if(!s){switch(e){case"scene":s=this.loadScene(t);break;case"node":s=this._invokeOne(function(e){return e.loadNode&&e.loadNode(t)});break;case"mesh":s=this._invokeOne(function(e){return e.loadMesh&&e.loadMesh(t)});break;case"accessor":s=this.loadAccessor(t);break;case"bufferView":s=this._invokeOne(function(e){return e.loadBufferView&&e.loadBufferView(t)});break;case"buffer":s=this.loadBuffer(t);break;case"material":s=this._invokeOne(function(e){return e.loadMaterial&&e.loadMaterial(t)});break;case"texture":s=this._invokeOne(function(e){return e.loadTexture&&e.loadTexture(t)});break;case"skin":s=this.loadSkin(t);break;case"animation":s=this._invokeOne(function(e){return e.loadAnimation&&e.loadAnimation(t)});break;case"camera":s=this.loadCamera(t);break;default:if(!(s=this._invokeOne(function(r){return r!=this&&r.getDependency&&r.getDependency(e,t)})))throw Error("Unknown type: "+e)}this.cache.add(r,s)}return s}getDependencies(e){let t=this.cache.get(e);if(!t){let r=this;t=Promise.all((this.json[e+("mesh"===e?"es":"s")]||[]).map(function(t,s){return r.getDependency(e,s)})),this.cache.add(e,t)}return t}loadBuffer(e){let t=this.json.buffers[e],r=this.fileLoader;if(t.type&&"arraybuffer"!==t.type)throw Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");
1if(void 0===t.uri&&0===e)return Promise.resolve(this.extensions[o.KHR_BINARY_GLTF].body);let n=this.options;return new Promise(function(e,i){r.load(s.LoaderUtils.resolveURL(t.uri,n.path),e,void 0,function(){i(Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){let t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(e){let r=t.byteLength||0,s=t.byteOffset||0;return e.slice(s,s+r)})}loadAccessor(e){let t=this,r=this.json,n=this.json.accessors[e];if(void 0===n.bufferView&&void 0===n.sparse){let e=F[n.type],t=P[n.componentType],r=!0===n.normalized,i=new t(n.count*e);return Promise.resolve(new s.BufferAttribute(i,e,r))}let i=[];return void 0!==n.bufferView?i.push(this.getDependency("bufferView",n.bufferView)):i.push(null),void 0!==n.sparse&&(i.push(this.getDependency("bufferView",n.sparse.indices.bufferView)),i.push(this.getDependency("bufferView",n.sparse.values.bufferView))),Promise.all(i).then(function(e){let i,a;let o=e[0],l=F[n.type],u=P[n.componentType],c=u.BYTES_PER_ELEMENT,h=c*l,d=n.byteOffset||0,p=void 0!==n.bufferView?r.bufferViews[n.bufferView].byteStride:void 0,m=!0===n.normalized;if(p&&p!==h){let e=Math.floor(d/p),r="InterleavedBuffer:"+n.bufferView+":"+n.componentType+":"+e+":"+n.count,h=t.cache.get(r);h||(i=new u(o,e*p,n.count*p/c),h=new s.InterleavedBuffer(i,p/c),t.cache.add(r,h)),a=new s.InterleavedBufferAttribute(h,l,d%p/c,m)}else i=null===o?new u(n.count*l):new u(o,d,n.count*l),a=new s.BufferAttribute(i,l,m);if(void 0!==n.sparse){let t=F.SCALAR,r=P[n.sparse.indices.componentType],i=n.sparse.indices.byteOffset||0,c=n.sparse.values.byteOffset||0,h=new r(e[1],i,n.sparse.count*t),d=new u(e[2],c,n.sparse.count*l);null!==o&&(a=new s.BufferAttribute(a.array.slice(),a.itemSize,a.normalized));for(let e=0,t=h.length;e<t;e++){let t=h[e];if(a.setX(t,d[e*l]),l>=2&&a.setY(t,d[e*l+1]),l>=3&&a.setZ(t,d[e*l+2]),l>=4&&a.setW(t,d[e*l+3]),l>=5)throw Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return a})}loadTexture(e){let t=this.json,r=this.options,s=t.textures[e].source,n=t.images[s],i=this.textureLoader;if(n.uri){let e=r.manager.getHandler(n.uri);null!==e&&(i=e)}return this.loadTextureImage(e,s,i)}loadTextureImage(e,t,r){let n=this,i=this.json,a=i.textures[e],o=i.images[t],l=(o.uri||o.bufferView)+":"+a.sampler;if(this.textureCache[l])return this.textureCache[l];let u=this.loadImageSource(t,r).then(function(t){t.flipY=!1,t.name=a.name||o.name||"",""===t.name&&"string"==typeof o.uri&&!1===o.uri.startsWith("data:image/")&&(t.name=o.uri);let r=(i.samplers||{})[a.sampler]||{};return t.magFilter=H[r.magFilter]||s.LinearFilter,t.minFilter=H[r.minFilter]||s.LinearMipmapLinearFilter,t.wrapS=k[r.wrapS]||s.RepeatWrapping,t.wrapT=k[r.wrapT]||s.RepeatWrapping,n.associations.set(t,{textures:e}),t}).catch(function(){return null});return this.textureCache[l]=u,u}loadImageSource(e,t){let r=this.json,n=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then(e=>e.clone());let i=r.images[e],a=self.URL||self.webkitURL,o=i.uri||"",l=!1;if(void 0!==i.bufferView)o=this.getDependency("bufferView",i.bufferView).then(function(e){l=!0;let t=new Blob([e],{type:i.mimeType});return o=a.createObjectURL(t)});else if(void 0===i.uri)throw Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let u=Promise.resolve(o).then(function(e){return new Promise(function(r,i){let a=r;!0===t.isImageBitmapLoader&&(a=function(e){let t=new s.Texture(e);t.needsUpdate=!0,r(t)}),t.load(s.LoaderUtils.resolveURL(e,n.path),a,void 0,i)})}).then(function(e){var t;return!0===l&&a.revokeObjectURL(o),e.userData.mimeType=i.mimeType||((t=i.uri).search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/)?"image/jpeg":t.search(/\.webp($|\?)/i)>0||0===t.search(/^data\:image\/webp/)?"image/webp":"image/png"),e}).catch(function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",o),e});return this.sourceCache[e]=u,u}assignTexture(e,t,r,s){let n=this;return this.getDependency("texture",r.index).then(function(i){if(!i)return null;if(void 0!==r.texCoord&&r.texCoord>0&&((i=i.clone()).channel=r.texCoord),n.extensions[o.KHR_TEXTURE_TRANSFORM]){let e=void 0!==r.extensions?r.extensions[o.KHR_TEXTURE_TRANSFORM]:void 0;if(e){let t=n.associations.get(i);i=n.extensions[o.KHR_TEXTURE_TRANSFORM].extendTexture(i,e),n.associations.set(i,t)}}
1return void 0!==s&&(i.colorSpace=s),e[t]=i,i})}assignFinalMaterial(e){let t=e.geometry,r=e.material,n=void 0===t.attributes.tangent,i=void 0!==t.attributes.color,a=void 0===t.attributes.normal;if(e.isPoints){let e="PointsMaterial:"+r.uuid,t=this.cache.get(e);t||(t=new s.PointsMaterial,s.Material.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,t.sizeAttenuation=!1,this.cache.add(e,t)),r=t}else if(e.isLine){let e="LineBasicMaterial:"+r.uuid,t=this.cache.get(e);t||(t=new s.LineBasicMaterial,s.Material.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,this.cache.add(e,t)),r=t}if(n||i||a){let e="ClonedMaterial:"+r.uuid+":";n&&(e+="derivative-tangents:"),i&&(e+="vertex-colors:"),a&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=r.clone(),i&&(t.vertexColors=!0),a&&(t.flatShading=!0),n&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(r))),r=t}e.material=r}getMaterialType(){return s.MeshStandardMaterial}loadMaterial(e){let t;let r=this,n=this.json,i=this.extensions,a=n.materials[e],l={},u=a.extensions||{},c=[];if(u[o.KHR_MATERIALS_UNLIT]){let e=i[o.KHR_MATERIALS_UNLIT];t=e.getMaterialType(),c.push(e.extendParams(l,a,r))}else{let n=a.pbrMetallicRoughness||{};if(l.color=new s.Color(1,1,1),l.opacity=1,Array.isArray(n.baseColorFactor)){let e=n.baseColorFactor;l.color.fromArray(e),l.opacity=e[3]}void 0!==n.baseColorTexture&&c.push(r.assignTexture(l,"map",n.baseColorTexture,s.SRGBColorSpace)),l.metalness=void 0!==n.metallicFactor?n.metallicFactor:1,l.roughness=void 0!==n.roughnessFactor?n.roughnessFactor:1,void 0!==n.metallicRoughnessTexture&&(c.push(r.assignTexture(l,"metalnessMap",n.metallicRoughnessTexture)),c.push(r.assignTexture(l,"roughnessMap",n.metallicRoughnessTexture))),t=this._invokeOne(function(t){return t.getMaterialType&&t.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,l)})))}!0===a.doubleSided&&(l.side=s.DoubleSide);let h=a.alphaMode||G.OPAQUE;if(h===G.BLEND?(l.transparent=!0,l.depthWrite=!1):(l.transparent=!1,h===G.MASK&&(l.alphaTest=void 0!==a.alphaCutoff?a.alphaCutoff:.5)),void 0!==a.normalTexture&&t!==s.MeshBasicMaterial&&(c.push(r.assignTexture(l,"normalMap",a.normalTexture)),l.normalScale=new s.Vector2(1,1),void 0!==a.normalTexture.scale)){let e=a.normalTexture.scale;l.normalScale.set(e,e)}return void 0!==a.occlusionTexture&&t!==s.MeshBasicMaterial&&(c.push(r.assignTexture(l,"aoMap",a.occlusionTexture)),void 0!==a.occlusionTexture.strength&&(l.aoMapIntensity=a.occlusionTexture.strength)),void 0!==a.emissiveFactor&&t!==s.MeshBasicMaterial&&(l.emissive=new s.Color().fromArray(a.emissiveFactor)),void 0!==a.emissiveTexture&&t!==s.MeshBasicMaterial&&c.push(r.assignTexture(l,"emissiveMap",a.emissiveTexture,s.SRGBColorSpace)),Promise.all(c).then(function(){let s=new t(l);return a.name&&(s.name=a.name),j(s,a),r.associations.set(s,{materials:e}),a.extensions&&K(i,s,a),s})}createUniqueName(e){let t=s.PropertyBinding.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){let t=this,r=this.extensions,n=this.primitiveCache,i=[];for(let a=0,l=e.length;a<l;a++){let l=e[a],u=function(e){let t;let r=e.extensions&&e.extensions[o.KHR_DRACO_MESH_COMPRESSION];if(t=r?"draco:"+r.bufferView+":"+r.indices+":"+V(r.attributes):e.indices+":"+V(e.attributes)+":"+e.mode,void 0!==e.targets)for(let r=0,s=e.targets.length;r<s;r++)t+=":"+V(e.targets[r]);return t}(l),c=n[u];if(c)i.push(c.promise);else{let e;e=l.extensions&&l.extensions[o.KHR_DRACO_MESH_COMPRESSION]?function(e){return r[o.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then(function(r){return W(r,e,t)})}(l):W(new s.BufferGeometry,l,t),n[u]={primitive:l,promise:e},i.push(e)}}return Promise.all(i)}loadMesh(e){let t=this,r=this.json,i=this.extensions,a=r.meshes[e],o=a.primitives,l=[];for(let e=0,t=o.length;e<t;e++){var u;let t=void 0===o[e].material?(void 0===(u=this.cache).DefaultMaterial&&(u.DefaultMaterial=new s.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:s.FrontSide})),u.DefaultMaterial):this.getDependency("material",o[e].material);l.push(t)}return l.push(t.loadGeometries(o)),Promise.all(l).then(function(r){let l=r.slice(0,r.length-1),u=r[r.length-1],c=[];for(let r=0,h=u.length;r<h;r++){let h;let d=u[r],p=o[r],m=l[r];if(p.mode===O.TRIANGLES||p.mode===O.TRIANGLE_STRIP||p.mode===O.TRIANGLE_FAN||void 0===p.mode)!0===(h=!0===a.isSkinnedMesh?new s.SkinnedMesh(d,m):new s.Mesh(d,m)).isSkinnedMesh&&h.normalizeSkinWeights(),p.mode===O.TRIANGLE_STRIP?h.geometry=n(h.geometry,s.TriangleStripDrawMode):p.mode===O.TRIANGLE_FAN&&(h.geometry=n(h.geometry,s.TriangleFanDrawMode));else if(p.mode===O.LINES)h=new s.LineSegments(d,m);else if(p.mode===O.LINE_STRIP)h=new s.Line(d,m);else if(p.mode===O.LINE_LOOP)h=new s.LineLoop(d,m);else if(p.mode===O.POINTS)h=new s.Points(d,m);else throw Error("THREE.GLTFLoader: Primitive mode unsupported: "+p.mode);Object.keys(h.geometry.morphAttributes).length>0&&function(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(let r=0,s=t.weights.length;r<s;r++)e.morphTargetInfluences[r]=t.weights[r];if(t.extras&&Array.isArray(t.extras.targetNames)){let r=t.extras.targetNames;if(e.morphTargetInfluences.length===r.length){e.morphTargetDictionary={};for(let t=0,s=r.length;t<s;t++)e.morphTargetDictionary[r[t]]=t}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}(h,a),h.name=t.createUniqueName(a.name||"mesh_"+e),j(h,a),p.extensions&&K(i,h,p),t.assignFinalMaterial(h),c.push(h)}for(let r=0,s=c.length;r<s;r++)t.associations.set(c[r],{meshes:e,primitives:r});
1if(1===c.length)return a.extensions&&K(i,c[0],a),c[0];let h=new s.Group;a.extensions&&K(i,h,a),t.associations.set(h,{meshes:e});for(let e=0,t=c.length;e<t;e++)h.add(c[e]);return h})}loadCamera(e){let t;let r=this.json.cameras[e],n=r[r.type];if(!n){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return"perspective"===r.type?t=new s.PerspectiveCamera(s.MathUtils.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):"orthographic"===r.type&&(t=new s.OrthographicCamera(-n.xmag,n.xmag,n.ymag,-n.ymag,n.znear,n.zfar)),r.name&&(t.name=this.createUniqueName(r.name)),j(t,r),Promise.resolve(t)}loadSkin(e){let t=this.json.skins[e],r=[];for(let e=0,s=t.joints.length;e<s;e++)r.push(this._loadNodeShallow(t.joints[e]));return void 0!==t.inverseBindMatrices?r.push(this.getDependency("accessor",t.inverseBindMatrices)):r.push(null),Promise.all(r).then(function(e){let r=e.pop(),n=[],i=[];for(let a=0,o=e.length;a<o;a++){let o=e[a];if(o){n.push(o);let e=new s.Matrix4;null!==r&&e.fromArray(r.array,16*a),i.push(e)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[a])}return new s.Skeleton(n,i)})}loadAnimation(e){let t=this.json,r=this,n=t.animations[e],i=n.name?n.name:"animation_"+e,a=[],o=[],l=[],u=[],c=[];for(let e=0,t=n.channels.length;e<t;e++){let t=n.channels[e],r=n.samplers[t.sampler],s=t.target,i=s.node,h=void 0!==n.parameters?n.parameters[r.input]:r.input,d=void 0!==n.parameters?n.parameters[r.output]:r.output;void 0!==s.node&&(a.push(this.getDependency("node",i)),o.push(this.getDependency("accessor",h)),l.push(this.getDependency("accessor",d)),u.push(r),c.push(s))}return Promise.all([Promise.all(a),Promise.all(o),Promise.all(l),Promise.all(u),Promise.all(c)]).then(function(e){let t=e[0],n=e[1],a=e[2],o=e[3],l=e[4],u=[];for(let e=0,s=t.length;e<s;e++){let s=t[e],i=n[e],c=a[e],h=o[e],d=l[e];if(void 0===s)continue;s.updateMatrix&&s.updateMatrix();let p=r._createAnimationTracks(s,i,c,h,d);if(p)for(let e=0;e<p.length;e++)u.push(p[e])}return new s.AnimationClip(i,void 0,u)})}createNodeMesh(e){let t=this.json,r=this,s=t.nodes[e];return void 0===s.mesh?null:r.getDependency("mesh",s.mesh).then(function(e){let t=r._getNodeRef(r.meshCache,s.mesh,e);return void 0!==s.weights&&t.traverse(function(e){if(e.isMesh)for(let t=0,r=s.weights.length;t<r;t++)e.morphTargetInfluences[t]=s.weights[t]}),t})}loadNode(e){let t=this.json.nodes[e],r=this._loadNodeShallow(e),s=[],n=t.children||[];for(let e=0,t=n.length;e<t;e++)s.push(this.getDependency("node",n[e]));let i=void 0===t.skin?Promise.resolve(null):this.getDependency("skin",t.skin);return Promise.all([r,Promise.all(s),i]).then(function(e){let t=e[0],r=e[1],s=e[2];null!==s&&t.traverse(function(e){e.isSkinnedMesh&&e.bind(s,q)});for(let e=0,s=r.length;e<s;e++)t.add(r[e]);return t})}_loadNodeShallow(e){let t=this.json,r=this.extensions,n=this;if(void 0!==this.nodeCache[e])return this.nodeCache[e];let i=t.nodes[e],a=i.name?n.createUniqueName(i.name):"",o=[],l=n._invokeOne(function(t){return t.createNodeMesh&&t.createNodeMesh(e)});return l&&o.push(l),void 0!==i.camera&&o.push(n.getDependency("camera",i.camera).then(function(e){return n._getNodeRef(n.cameraCache,i.camera,e)})),n._invokeAll(function(t){return t.createNodeAttachment&&t.createNodeAttachment(e)}).forEach(function(e){o.push(e)}),this.nodeCache[e]=Promise.all(o).then(function(t){let o;if((o=!0===i.isBone?new s.Bone:t.length>1?new s.Group:1===t.length?t[0]:new s.Object3D)!==t[0])for(let e=0,r=t.length;e<r;e++)o.add(t[e]);if(i.name&&(o.userData.name=i.name,o.name=a),j(o,i),i.extensions&&K(r,o,i),void 0!==i.matrix){let e=new s.Matrix4;e.fromArray(i.matrix),o.applyMatrix4(e)}else void 0!==i.translation&&o.position.fromArray(i.translation),void 0!==i.rotation&&o.quaternion.fromArray(i.rotation),void 0!==i.scale&&o.scale.fromArray(i.scale);return n.associations.has(o)||n.associations.set(o,{}),n.associations.get(o).nodes=e,o}),this.nodeCache[e]}loadScene(e){let t=this.extensions,r=this.json.scenes[e],n=this,i=new s.Group;r.name&&(i.name=n.createUniqueName(r.name)),j(i,r),r.extensions&&K(t,i,r);let a=r.nodes||[],o=[];for(let e=0,t=a.length;e<t;e++)o.push(n.getDependency("node",a[e]));return Promise.all(o).then(function(e){for(let t=0,r=e.length;t<r;t++)i.add(e[t]);return n.associations=(e=>{let t=new Map;for(let[e,r]of n.associations)(e instanceof s.Material||e instanceof s.Texture)&&t.set(e,r);return e.traverse(e=>{let r=n.associations.get(e);null!=r&&t.set(e,r)}),t})(i),i})}_createAnimationTracks(e,t,r,n,i){let a;let o=[],l=e.name?e.name:e.uuid,u=[];switch(B[i.path]===B.weights?e.traverse(function(e){e.morphTargetInfluences&&u.push(e.name?e.name:e.uuid)}):u.push(l),B[i.path]){case B.weights:a=s.NumberKeyframeTrack;break;case B.rotation:a=s.QuaternionKeyframeTrack;break;case B.position:case B.scale:a=s.VectorKeyframeTrack;break;default:a=1===r.itemSize?s.NumberKeyframeTrack:s.VectorKeyframeTrack}let c=void 0!==n.interpolation?U[n.interpolation]:s.InterpolateLinear,h=this._getArrayFromAccessor(r);for(let e=0,r=u.length;e<r;e++){let r=new a(u[e]+"."+B[i.path],t.array,h,c);
1"CUBICSPLINE"===n.interpolation&&this._createCubicSplineTrackInterpolant(r),o.push(r)}return o}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){let e=X(t.constructor),r=new Float32Array(t.length);for(let s=0,n=t.length;s<n;s++)r[s]=t[s]*e;t=r}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(e){return new(this instanceof s.QuaternionKeyframeTrack?C:b)(this.times,this.values,this.getValueSize()/3,e)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function W(e,t,r){let n=t.attributes,i=[];for(let t in n){let s=D[t]||t.toLowerCase();s in e.attributes||i.push(function(t,s){return r.getDependency("accessor",t).then(function(t){e.setAttribute(s,t)})}(n[t],s))}if(void 0!==t.indices&&!e.index){let s=r.getDependency("accessor",t.indices).then(function(t){e.setIndex(t)});i.push(s)}return j(e,t),!function(e,t,r){let n=t.attributes,i=new s.Box3;if(void 0===n.POSITION)return;{let e=r.json.accessors[n.POSITION],t=e.min,a=e.max;if(void 0!==t&&void 0!==a){if(i.set(new s.Vector3(t[0],t[1],t[2]),new s.Vector3(a[0],a[1],a[2])),e.normalized){let t=X(P[e.componentType]);i.min.multiplyScalar(t),i.max.multiplyScalar(t)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}let a=t.targets;if(void 0!==a){let e=new s.Vector3,t=new s.Vector3;for(let s=0,n=a.length;s<n;s++){let n=a[s];if(void 0!==n.POSITION){let s=r.json.accessors[n.POSITION],i=s.min,a=s.max;if(void 0!==i&&void 0!==a){if(t.setX(Math.max(Math.abs(i[0]),Math.abs(a[0]))),t.setY(Math.max(Math.abs(i[1]),Math.abs(a[1]))),t.setZ(Math.max(Math.abs(i[2]),Math.abs(a[2]))),s.normalized){let e=X(P[s.componentType]);t.multiplyScalar(e)}e.max(t)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}i.expandByVector(e)}e.boundingBox=i;let o=new s.Sphere;i.getCenter(o.center),o.radius=i.min.distanceTo(i.max)/2,e.boundingSphere=o}(e,t,r),Promise.all(i).then(function(){return void 0!==t.targets?function(e,t,r){let s=!1,n=!1,i=!1;for(let e=0,r=t.length;e<r;e++){let r=t[e];if(void 0!==r.POSITION&&(s=!0),void 0!==r.NORMAL&&(n=!0),void 0!==r.COLOR_0&&(i=!0),s&&n&&i)break}if(!s&&!n&&!i)return Promise.resolve(e);let a=[],o=[],l=[];for(let u=0,c=t.length;u<c;u++){let c=t[u];if(s){let t=void 0!==c.POSITION?r.getDependency("accessor",c.POSITION):e.attributes.position;a.push(t)}if(n){let t=void 0!==c.NORMAL?r.getDependency("accessor",c.NORMAL):e.attributes.normal;o.push(t)}if(i){let t=void 0!==c.COLOR_0?r.getDependency("accessor",c.COLOR_0):e.attributes.color;l.push(t)}}return Promise.all([Promise.all(a),Promise.all(o),Promise.all(l)]).then(function(t){let r=t[0],a=t[1],o=t[2];return s&&(e.morphAttributes.position=r),n&&(e.morphAttributes.normal=a),i&&(e.morphAttributes.color=o),e.morphTargetsRelative=!0,e})}(e,t.targets,r):e})}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.