1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[55116],{55116:(e,t,s)=>{s.d(t,{B:()=>i});var r=s(90625);function n(e,t){if(t===r.RJ4)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t!==r.rYR&&t!==r.O49)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e;{let s=e.getIndex();if(null===s){let t=[],r=e.getAttribute("position");if(void 0===r)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let e=0;e<r.count;e++)t.push(e);e.setIndex(t),s=e.getIndex()}let n=s.count-2,i=[];if(t===r.rYR)for(let e=1;e<=n;e++)i.push(s.getX(0)),i.push(s.getX(e)),i.push(s.getX(e+1));else for(let e=0;e<n;e++)e%2==0?(i.push(s.getX(e)),i.push(s.getX(e+1)),i.push(s.getX(e+2))):(i.push(s.getX(e+2)),i.push(s.getX(e+1)),i.push(s.getX(e)));i.length/3!==n&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");let o=e.clone();return o.setIndex(i),o.clearGroups(),o}}class i extends r.aHM{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 d(e)}),this.register(function(e){return new _(e)}),this.register(function(e){return new E(e)}),this.register(function(e){return new v(e)}),this.register(function(e){return new p(e)}),this.register(function(e){return new f(e)}),this.register(function(e){return new A(e)}),this.register(function(e){return new g(e)}),this.register(function(e){return new c(e)}),this.register(function(e){return new T(e)}),this.register(function(e){return new m(e)}),this.register(function(e){return new R(e)}),this.register(function(e){return new x(e)}),this.register(function(e){return new l(e)}),this.register(function(e){return new S(e)}),this.register(function(e){return new w(e)})}load(e,t,s,n){let i,o=this;if(""!==this.resourcePath)i=this.resourcePath;else if(""!==this.path){let t=r.r6x.extractUrlBase(e);i=r.r6x.resolveURL(t,this.path)}else i=r.r6x.extractUrlBase(e);this.manager.itemStart(e);let a=function(t){n?n(t):console.error(t),o.manager.itemError(e),o.manager.itemEnd(e)},l=new r.Y9S(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(s){try{o.parse(s,i,function(s){t(s),o.manager.itemEnd(e)},a)}catch(e){a(e)}},s,a)}setDRACOLoader(e){return this.dracoLoader=e,this}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,s,r){let n,i={},o={},l=new TextDecoder;if("string"==typeof e)n=JSON.parse(e);else if(e instanceof ArrayBuffer)if(l.decode(new Uint8Array(e,0,4))===y){try{i[a.KHR_BINARY_GLTF]=new L(e)}catch(e){r&&r(e);return}n=JSON.parse(i[a.KHR_BINARY_GLTF].content)}else n=JSON.parse(l.decode(e));else n=e;if(void 0===n.asset||n.asset.version[0]<2){r&&r(Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}let c=new Q(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);t.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),o[t.name]=t,i[t.name]=!0}if(n.extensionsUsed)for(let e=0;e<n.extensionsUsed.length;++e){let t=n.extensionsUsed[e],s=n.extensionsRequired||[];switch(t){case a.KHR_MATERIALS_UNLIT:i[t]=new u;break;case a.KHR_DRACO_MESH_COMPRESSION:i[t]=new M(n,this.dracoLoader);break;case a.KHR_TEXTURE_TRANSFORM:i[t]=new b;break;
1case a.KHR_MESH_QUANTIZATION:i[t]=new N;break;default:s.indexOf(t)>=0&&void 0===o[t]&&console.warn('THREE.GLTFLoader: Unknown extension "'+t+'".')}}c.setExtensions(i),c.setPlugins(o),c.parse(s,r)}parseAsync(e,t){let s=this;return new Promise(function(r,n){s.parse(e,t,r,n)})}}function o(){let e={};return{get:function(t){return e[t]},add:function(t,s){e[t]=s},remove:function(t){delete e[t]},removeAll:function(){e={}}}}let a={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_DISPERSION:"KHR_materials_dispersion",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_MATERIALS_BUMP:"EXT_materials_bump",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=a.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let s=0,r=t.length;s<r;s++){let r=t[s];r.extensions&&r.extensions[this.name]&&void 0!==r.extensions[this.name].light&&e._addNodeRef(this.cache,r.extensions[this.name].light)}}_loadLight(e){let t,s=this.parser,n="light:"+e,i=s.cache.get(n);if(i)return i;let o=s.json,a=((o.extensions&&o.extensions[this.name]||{}).lights||[])[e],l=new r.Q1f(0xffffff);void 0!==a.color&&l.setRGB(a.color[0],a.color[1],a.color[2],r.Zr2);let u=void 0!==a.range?a.range:0;switch(a.type){case"directional":(t=new r.ZyN(l)).target.position.set(0,0,-1),t.add(t.target);break;case"point":(t=new r.HiM(l)).distance=u;break;case"spot":(t=new r.nCl(l)).distance=u,a.spot=a.spot||{},a.spot.innerConeAngle=void 0!==a.spot.innerConeAngle?a.spot.innerConeAngle:0,a.spot.outerConeAngle=void 0!==a.spot.outerConeAngle?a.spot.outerConeAngle:Math.PI/4,t.angle=a.spot.outerConeAngle,t.penumbra=1-a.spot.innerConeAngle/a.spot.outerConeAngle,t.target.position.set(0,0,-1),t.add(t.target);break;default:throw Error("THREE.GLTFLoader: Unexpected light type: "+a.type)}return t.position.set(0,0,0),t.decay=2,X(t,a),void 0!==a.intensity&&(t.intensity=a.intensity),t.name=s.createUniqueName(a.name||"light_"+e),i=Promise.resolve(t),s.cache.add(n,i),i}getDependency(e,t){if("light"===e)return this._loadLight(t)}createNodeAttachment(e){let t=this,s=this.parser,r=s.json.nodes[e],n=(r.extensions&&r.extensions[this.name]||{}).light;return void 0===n?null:this._loadLight(n).then(function(e){return s._getNodeRef(t.cache,n,e)})}}class u{constructor(){this.name=a.KHR_MATERIALS_UNLIT}getMaterialType(){return r.V9B}extendParams(e,t,s){let n=[];e.color=new r.Q1f(1,1,1),e.opacity=1;let i=t.pbrMetallicRoughness;if(i){if(Array.isArray(i.baseColorFactor)){let t=i.baseColorFactor;e.color.setRGB(t[0],t[1],t[2],r.Zr2),e.opacity=t[3]}void 0!==i.baseColorTexture&&n.push(s.assignTexture(e,"map",i.baseColorTexture,r.er$))}return Promise.all(n)}}class c{constructor(e){this.parser=e,this.name=a.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){let s=this.parser.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let r=s.extensions[this.name].emissiveStrength;return void 0!==r&&(t.emissiveIntensity=r),Promise.resolve()}}class h{constructor(e){this.parser=e,this.name=a.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?r.uSd:null}extendMaterialParams(e,t){let s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let i=[],o=n.extensions[this.name];if(void 0!==o.clearcoatFactor&&(t.clearcoat=o.clearcoatFactor),void 0!==o.clearcoatTexture&&i.push(s.assignTexture(t,"clearcoatMap",o.clearcoatTexture)),void 0!==o.clearcoatRoughnessFactor&&(t.clearcoatRoughness=o.clearcoatRoughnessFactor),void 0!==o.clearcoatRoughnessTexture&&i.push(s.assignTexture(t,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),void 0!==o.clearcoatNormalTexture&&(i.push(s.assignTexture(t,"clearcoatNormalMap",o.clearcoatNormalTexture)),void 0!==o.clearcoatNormalTexture.scale)){let e=o.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new r.I9Y(e,e)}return Promise.all(i)}}class d{constructor(e){this.parser=e,this.name=a.KHR_MATERIALS_DISPERSION}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?r.uSd:null}extendMaterialParams(e,t){let s=this.parser.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let r=s.extensions[this.name];return t.dispersion=void 0!==r.dispersion?r.dispersion:0,Promise.resolve()}}class m{constructor(e){this.parser=e,this.name=a.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?r.uSd:null}extendMaterialParams(e,t){let s=this.parser,r=s.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let n=[],i=r.extensions[this.name];return void 0!==i.iridescenceFactor&&(t.iridescence=i.iridescenceFactor),void 0!==i.iridescenceTexture&&n.push(s.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(s.assignTexture(t,"iridescenceThicknessMap",i.iridescenceThicknessTexture)),Promise.all(n)}}class p{constructor(e){this.parser=e,this.name=a.KHR_MATERIALS_SHEEN}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?r.uSd:null}extendMaterialParams(e,t){let s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let i=[];t.sheenColor=new r.Q1f(0,0,0),t.sheenRoughness=0,t.sheen=1;let o=n.extensions[this.name];if(void 0!==o.sheenColorFactor){let e=o.sheenColorFactor;t.sheenColor.setRGB(e[0],e[1],e[2],r.Zr2)}return void 0!==o.sheenRoughnessFactor&&(t.sheenRoughness=o.sheenRoughnessFactor),void 0!==o.sheenColorTexture&&i.push(s.assignTexture(t,"sheenColorMap",o.sheenColorTexture,r.er$)),void 0!==o.sheenRoughnessTexture&&i.push(s.assignTexture(t,"sheenRoughnessMap",o.sheenRoughnessTexture)),Promise.all(i)}}class f{constructor(e){this.parser=e,this.name=a.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?r.uSd:null}extendMaterialParams(e,t){let s=this.parser,r=s.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let n=[],i=r.extensions[this.name];return void 0!==i.transmissionFactor&&(t.transmission=i.transmissionFactor),void 0!==i.transmissionTexture&&n.push(s.assignTexture(t,"transmissionMap",i.transmissionTexture)),Promise.all(n)}}class A{constructor(e){this.parser=e,this.name=a.KHR_MATERIALS_VOLUME}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?r.uSd:null}extendMaterialParams(e,t){let s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let i=[],o=n.extensions[this.name];t.thickness=void 0!==o.thicknessFactor?o.thicknessFactor:0,void 0!==o.thicknessTexture&&i.push(s.assignTexture(t,"thicknessMap",o.thicknessTexture)),t.attenuationDistance=o.attenuationDistance||1/0;let a=o.attenuationColor||[1,1,1];return t.attenuationColor=new r.Q1f().setRGB(a[0],a[1],a[2],r.Zr2),Promise.all(i)}}class g{constructor(e){this.parser=e,this.name=a.KHR_MATERIALS_IOR}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?r.uSd:null}extendMaterialParams(e,t){let s=this.parser.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let r=s.extensions[this.name];return t.ior=void 0!==r.ior?r.ior:1.5,Promise.resolve()}}class T{constructor(e){this.parser=e,this.name=a.KHR_MATERIALS_SPECULAR}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?r.uSd:null}extendMaterialParams(e,t){let s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let i=[],o=n.extensions[this.name];t.specularIntensity=void 0!==o.specularFactor?o.specularFactor:1,void 0!==o.specularTexture&&i.push(s.assignTexture(t,"specularIntensityMap",o.specularTexture));let a=o.specularColorFactor||[1,1,1];return t.specularColor=new r.Q1f().setRGB(a[0],a[1],a[2],r.Zr2),void 0!==o.specularColorTexture&&i.push(s.assignTexture(t,"specularColorMap",o.specularColorTexture,r.er$)),Promise.all(i)}}class x{constructor(e){this.parser=e,this.name=a.EXT_MATERIALS_BUMP}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?r.uSd:null}extendMaterialParams(e,t){let s=this.parser,r=s.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let n=[],i=r.extensions[this.name];return t.bumpScale=void 0!==i.bumpFactor?i.bumpFactor:1,void 0!==i.bumpTexture&&n.push(s.assignTexture(t,"bumpMap",i.bumpTexture)),Promise.all(n)}}class R{constructor(e){this.parser=e,this.name=a.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?r.uSd:null}extendMaterialParams(e,t){let s=this.parser,r=s.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let n=[],i=r.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(s.assignTexture(t,"anisotropyMap",i.anisotropyTexture)),Promise.all(n)}}class _{constructor(e){this.parser=e,this.name=a.KHR_TEXTURE_BASISU}loadTexture(e){let t=this.parser,s=t.json,r=s.textures[e];if(!r.extensions||!r.extensions[this.name])return null;let n=r.extensions[this.name],i=t.options.ktx2Loader;if(!i)if(!(s.extensionsRequired&&s.extensionsRequired.indexOf(this.name)>=0))return null;else throw Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return t.loadTextureImage(e,n.source,i)}}class E{constructor(e){this.parser=e,this.name=a.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){let t=this.name,s=this.parser,r=s.json,n=r.textures[e];if(!n.extensions||!n.extensions[t])return null;let i=n.extensions[t],o=r.images[i.source],a=s.textureLoader;if(o.uri){let e=s.options.manager.getHandler(o.uri);null!==e&&(a=e)}return this.detectSupport().then(function(n){if(n)return s.loadTextureImage(e,i.source,a);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return s.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 v{constructor(e){this.parser=e,this.name=a.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){let t=this.name,s=this.parser,r=s.json,n=r.textures[e];if(!n.extensions||!n.extensions[t])return null;let i=n.extensions[t],o=r.images[i.source],a=s.textureLoader;if(o.uri){let e=s.options.manager.getHandler(o.uri);null!==e&&(a=e)}return this.detectSupport().then(function(n){if(n)return s.loadTextureImage(e,i.source,a);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return s.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 S{constructor(e){this.name=a.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,s=t.bufferViews[e];if(!s.extensions||!s.extensions[this.name])return null;{let e=s.extensions[this.name],r=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;else throw Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return r.then(function(t){let s=e.byteOffset||0,r=e.byteLength||0,i=e.count,o=e.byteStride,a=new Uint8Array(t,s,r);return n.decodeGltfBufferAsync?n.decodeGltfBufferAsync(i,o,a,e.mode,e.filter).then(function(e){return e.buffer}):n.ready.then(function(){let t=new ArrayBuffer(i*o);return n.decodeGltfBuffer(new Uint8Array(t),i,o,a,e.mode,e.filter),t})})}}}class w{constructor(e){this.name=a.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){let t=this.parser.json,s=t.nodes[e];if(!s.extensions||!s.extensions[this.name]||void 0===s.mesh)return null;for(let e of t.meshes[s.mesh].primitives)if(e.mode!==H.TRIANGLES&&e.mode!==H.TRIANGLE_STRIP&&e.mode!==H.TRIANGLE_FAN&&void 0!==e.mode)return null;let n=s.extensions[this.name].attributes,i=[],o={};for(let e in n)i.push(this.parser.getDependency("accessor",n[e]).then(t=>(o[e]=t,o[e])));return i.length<1?null:(i.push(this.parser.createNodeMesh(e)),Promise.all(i).then(e=>{let t=e.pop(),s=t.isGroup?t.children:[t],n=e[0].count,i=[];for(let e of s){let t=new r.kn4,s=new r.Pq0,a=new r.PTz,l=new r.Pq0(1,1,1),u=new r.ZLX(e.geometry,e.material,n);for(let e=0;e<n;e++)o.TRANSLATION&&s.fromBufferAttribute(o.TRANSLATION,e),o.ROTATION&&a.fromBufferAttribute(o.ROTATION,e),o.SCALE&&l.fromBufferAttribute(o.SCALE,e),u.setMatrixAt(e,t.compose(s,a,l));for(let t in o)if("_COLOR_0"===t){let e=o[t];u.instanceColor=new r.uWO(e.array,e.itemSize,e.normalized)}else"TRANSLATION"!==t&&"ROTATION"!==t&&"SCALE"!==t&&e.geometry.setAttribute(t,o[t]);r.B69.prototype.copy.call(u,e),this.parser.assignFinalMaterial(u),i.push(u)}return t.isGroup?(t.clear(),t.add(...i),t):i[0]}))}}let y="glTF",I={JSON:0x4e4f534a,BIN:5130562};class L{constructor(e){this.name=a.KHR_BINARY_GLTF,this.content=null,this.body=null;let t=new DataView(e,0,12),s=new TextDecoder;if(this.header={magic:s.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==y)throw Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw Error("THREE.GLTFLoader: Legacy binary file detected.");let r=this.header.length-12,n=new DataView(e,12),i=0;for(;i<r;){let t=n.getUint32(i,!0);i+=4;let r=n.getUint32(i,!0);if(i+=4,r===I.JSON){let r=new Uint8Array(e,12+i,t);this.content=s.decode(r)}else if(r===I.BIN){let s=12+i;this.body=e.slice(s,s+t)}i+=t}if(null===this.content)throw Error("THREE.GLTFLoader: JSON content not found.")}}class M{constructor(e,t){if(!t)throw Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=a.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){let s=this.json,n=this.dracoLoader,i=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,a={},l={},u={};for(let e in o)a[D[e]||e.toLowerCase()]=o[e];for(let t in e.attributes){let r=D[t]||t.toLowerCase();if(void 0!==o[t]){let n=s.accessors[e.attributes[t]],i=k[n.componentType];u[r]=i.name,l[r]=!0===n.normalized}}return t.getDependency("bufferView",i).then(function(e){return new Promise(function(t,s){n.decodeDracoFile(e,function(e){for(let t in e.attributes){let s=e.attributes[t],r=l[t];void 0!==r&&(s.normalized=r)}t(e)},a,u,r.Zr2,s)})})}}class b{constructor(){this.name=a.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 N{constructor(){this.name=a.KHR_MESH_QUANTIZATION}}class O extends r.lGw{constructor(e,t,s,r){super(e,t,s,r)}copySampleValue_(e){let t=this.resultBuffer,s=this.sampleValues,r=this.valueSize,n=e*r*3+r;for(let e=0;e!==r;e++)t[e]=s[n+e];return t}interpolate_(e,t,s,r){let n=this.resultBuffer,i=this.sampleValues,o=this.valueSize,a=2*o,l=3*o,u=r-t,c=(s-t)/u,h=c*c,d=h*c,m=e*l,p=m-l,f=-2*d+3*h,A=d-h,g=1-f,T=A-h+c;for(let e=0;e!==o;e++){let t=i[p+e+o],s=i[p+e+a]*u,r=i[m+e+o],l=i[m+e]*u;n[e]=g*t+T*s+f*r+A*l}return n}}let C=new r.PTz;class P extends O{interpolate_(e,t,s,r){let n=super.interpolate_(e,t,s,r);return C.fromArray(n).normalize().toArray(n),n}}let H={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},k={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},B={9728:r.hxR,9729:r.k6q,9984:r.pHI,9985:r.kRr,9986:r.Cfg,9987:r.$_I},F={33071:r.ghU,33648:r.kTW,10497:r.GJx},U={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"},G={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},j={CUBICSPLINE:void 0,LINEAR:r.PJ3,STEP:r.ljd},K={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function V(e,t,s){for(let r in s.extensions)void 0===e[r]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[r]=s.extensions[r])}function X(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 q(e){let t="",s=Object.keys(e).sort();for(let r=0,n=s.length;r<n;r++)t+=s[r]+":"+e[s[r]]+";";return t}function z(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 Y=new r.kn4;class Q{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new o,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 s=!1,n=-1,i=!1,a=-1;if("undefined"!=typeof navigator){let e=navigator.userAgent;s=!0===/^((?!chrome|android).)*safari/i.test(e);let t=e.match(/Version\/(\d+)/);n=s&&t?parseInt(t[1],10):-1,a=(i=e.indexOf("Firefox")>-1)?e.match(/Firefox\/([0-9]+)\./)[1]:-1}"undefined"==typeof createImageBitmap||s&&n<17||i&&a<98?this.textureLoader=new r.Tap(this.options.manager):this.textureLoader=new r.Kzg(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new r.Y9S(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 s=this,r=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([s.getDependencies("scene"),s.getDependencies("animation"),s.getDependencies("camera")])}).then(function(t){let i={scene:t[0][r.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:r.asset,parser:s,userData:{}};return V(n,i,r),X(i,r),Promise.all(s._invokeAll(function(e){return e.afterRoot&&e.afterRoot(i)})).then(function(){for(let e of i.scenes)e.updateMatrixWorld();e(i)})}).catch(t)}_markDefs(){let e=this.json.nodes||[],t=this.json.skins||[],s=this.json.meshes||[];for(let s=0,r=t.length;s<r;s++){let r=t[s].joints;for(let t=0,s=r.length;t<s;t++)e[r[t]].isBone=!0}for(let t=0,r=e.length;t<r;t++){let r=e[t];void 0!==r.mesh&&(this._addNodeRef(this.meshCache,r.mesh),void 0!==r.skin&&(s[r.mesh].isSkinnedMesh=!0)),void 0!==r.camera&&this._addNodeRef(this.cameraCache,r.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,s){if(e.refs[t]<=1)return s;let r=s.clone(),n=(e,t)=>{let s=this.associations.get(e);for(let[r,i]of(null!=s&&this.associations.set(t,s),e.children.entries()))n(i,t.children[r])};return n(s,r),r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){let t=Object.values(this.plugins);t.push(this);for(let s=0;s<t.length;s++){let r=e(t[s]);if(r)return r}return null}_invokeAll(e){let t=Object.values(this.plugins);t.unshift(this);let s=[];for(let r=0;r<t.length;r++){let n=e(t[r]);n&&s.push(n)}return s}getDependency(e,t){let s=e+":"+t,r=this.cache.get(s);if(!r){switch(e){case"scene":r=this.loadScene(t);break;case"node":r=this._invokeOne(function(e){return e.loadNode&&e.loadNode(t)});break;case"mesh":r=this._invokeOne(function(e){return e.loadMesh&&e.loadMesh(t)});break;case"accessor":r=this.loadAccessor(t);break;case"bufferView":r=this._invokeOne(function(e){return e.loadBufferView&&e.loadBufferView(t)});break;case"buffer":r=this.loadBuffer(t);break;case"material":r=this._invokeOne(function(e){return e.loadMaterial&&e.loadMaterial(t)});break;case"texture":r=this._invokeOne(function(e){return e.loadTexture&&e.loadTexture(t)});break;case"skin":r=this.loadSkin(t);break;case"animation":r=this._invokeOne(function(e){return e.loadAnimation&&e.loadAnimation(t)});break;case"camera":r=this.loadCamera(t);break;default:if(!(r=this._invokeOne(function(s){return s!=this&&s.getDependency&&s.getDependency(e,t)})))throw Error("Unknown type: "+e)}this.cache.add(s,r)}return r}getDependencies(e){let t=this.cache.get(e);if(!t){let s=this;t=Promise.all((this.json[e+("mesh"===e?"es":"s")]||[]).map(function(t,r){return s.getDependency(e,r)})),this.cache.add(e,t)}return t}loadBuffer(e){let t=this.json.buffers[e],s=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[a.KHR_BINARY_GLTF].body);let n=this.options;return new Promise(function(e,i){s.load(r.r6x.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 s=t.byteLength||0,r=t.byteOffset||0;return e.slice(r,r+s)})}loadAccessor(e){let t=this,s=this.json,n=this.json.accessors[e];if(void 0===n.bufferView&&void 0===n.sparse){let e=U[n.type],t=k[n.componentType],s=!0===n.normalized,i=new t(n.count*e);return Promise.resolve(new r.THS(i,e,s))}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,o,a=e[0],l=U[n.type],u=k[n.componentType],c=u.BYTES_PER_ELEMENT,h=c*l,d=n.byteOffset||0,m=void 0!==n.bufferView?s.bufferViews[n.bufferView].byteStride:void 0,p=!0===n.normalized;if(m&&m!==h){let e=Math.floor(d/m),s="InterleavedBuffer:"+n.bufferView+":"+n.componentType+":"+e+":"+n.count,h=t.cache.get(s);h||(i=new u(a,e*m,n.count*m/c),h=new r.eB$(i,m/c),t.cache.add(s,h)),o=new r.eHs(h,l,d%m/c,p)}else i=null===a?new u(n.count*l):new u(a,d,n.count*l),o=new r.THS(i,l,p);if(void 0!==n.sparse){let t=U.SCALAR,s=k[n.sparse.indices.componentType],i=n.sparse.indices.byteOffset||0,c=n.sparse.values.byteOffset||0,h=new s(e[1],i,n.sparse.count*t),d=new u(e[2],c,n.sparse.count*l);null!==a&&(o=new r.THS(o.array.slice(),o.itemSize,o.normalized)),o.normalized=!1;for(let e=0,t=h.length;e<t;e++){let t=h[e];if(o.setX(t,d[e*l]),l>=2&&o.setY(t,d[e*l+1]),l>=3&&o.setZ(t,d[e*l+2]),l>=4&&o.setW(t,d[e*l+3]),l>=5)throw Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}o.normalized=p}return o})}loadTexture(e){let t=this.json,s=this.options,r=t.textures[e].source,n=t.images[r],i=this.textureLoader;if(n.uri){let e=s.manager.getHandler(n.uri);null!==e&&(i=e)}return this.loadTextureImage(e,r,i)}loadTextureImage(e,t,s){let n=this,i=this.json,o=i.textures[e],a=i.images[t],l=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[l])return this.textureCache[l];let u=this.loadImageSource(t,s).then(function(t){t.flipY=!1,t.name=o.name||a.name||"",""===t.name&&"string"==typeof a.uri&&!1===a.uri.startsWith("data:image/")&&(t.name=a.uri);let s=(i.samplers||{})[o.sampler]||{};return t.magFilter=B[s.magFilter]||r.k6q,t.minFilter=B[s.minFilter]||r.$_I,t.wrapS=F[s.wrapS]||r.GJx,t.wrapT=F[s.wrapT]||r.GJx,t.generateMipmaps=!t.isCompressedTexture&&t.minFilter!==r.hxR&&t.minFilter!==r.k6q,n.associations.set(t,{textures:e}),t}).catch(function(){return null});return this.textureCache[l]=u,u}loadImageSource(e,t){let s=this.json,n=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then(e=>e.clone());let i=s.images[e],o=self.URL||self.webkitURL,a=i.uri||"",l=!1;if(void 0!==i.bufferView)a=this.getDependency("bufferView",i.bufferView).then(function(e){l=!0;let t=new Blob([e],{type:i.mimeType});return a=o.createObjectURL(t)});else if(void 0===i.uri)throw Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let u=Promise.resolve(a).then(function(e){return new Promise(function(s,i){let o=s;!0===t.isImageBitmapLoader&&(o=function(e){let t=new r.gPd(e);t.needsUpdate=!0,s(t)}),t.load(r.r6x.resolveURL(e,n.path),o,void 0,i)})}).then(function(e){var t;return!0===l&&o.revokeObjectURL(a),X(e,i),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":t.search(/\.ktx2($|\?)/i)>0||0===t.search(/^data\:image\/ktx2/)?"image/ktx2":"image/png"),e}).catch(function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",a),e});return this.sourceCache[e]=u,u}assignTexture(e,t,s,r){let n=this;return this.getDependency("texture",s.index).then(function(i){if(!i)return null;if(void 0!==s.texCoord&&s.texCoord>0&&((i=i.clone()).channel=s.texCoord),n.extensions[a.KHR_TEXTURE_TRANSFORM]){let e=void 0!==s.extensions?s.extensions[a.KHR_TEXTURE_TRANSFORM]:void 0;if(e){let t=n.associations.get(i);i=n.extensions[a.KHR_TEXTURE_TRANSFORM].extendTexture(i,e),n.associations.set(i,t)}}
1return void 0!==r&&(i.colorSpace=r),e[t]=i,i})}assignFinalMaterial(e){let t=e.geometry,s=e.material,n=void 0===t.attributes.tangent,i=void 0!==t.attributes.color,o=void 0===t.attributes.normal;if(e.isPoints){let e="PointsMaterial:"+s.uuid,t=this.cache.get(e);t||(t=new r.BH$,r.imn.prototype.copy.call(t,s),t.color.copy(s.color),t.map=s.map,t.sizeAttenuation=!1,this.cache.add(e,t)),s=t}else if(e.isLine){let e="LineBasicMaterial:"+s.uuid,t=this.cache.get(e);t||(t=new r.mrM,r.imn.prototype.copy.call(t,s),t.color.copy(s.color),t.map=s.map,this.cache.add(e,t)),s=t}if(n||i||o){let e="ClonedMaterial:"+s.uuid+":";n&&(e+="derivative-tangents:"),i&&(e+="vertex-colors:"),o&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=s.clone(),i&&(t.vertexColors=!0),o&&(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(s))),s=t}e.material=s}getMaterialType(){return r._4j}loadMaterial(e){let t,s=this,n=this.json,i=this.extensions,o=n.materials[e],l={},u=o.extensions||{},c=[];if(u[a.KHR_MATERIALS_UNLIT]){let e=i[a.KHR_MATERIALS_UNLIT];t=e.getMaterialType(),c.push(e.extendParams(l,o,s))}else{let n=o.pbrMetallicRoughness||{};if(l.color=new r.Q1f(1,1,1),l.opacity=1,Array.isArray(n.baseColorFactor)){let e=n.baseColorFactor;l.color.setRGB(e[0],e[1],e[2],r.Zr2),l.opacity=e[3]}void 0!==n.baseColorTexture&&c.push(s.assignTexture(l,"map",n.baseColorTexture,r.er$)),l.metalness=void 0!==n.metallicFactor?n.metallicFactor:1,l.roughness=void 0!==n.roughnessFactor?n.roughnessFactor:1,void 0!==n.metallicRoughnessTexture&&(c.push(s.assignTexture(l,"metalnessMap",n.metallicRoughnessTexture)),c.push(s.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===o.doubleSided&&(l.side=r.$EB);let h=o.alphaMode||K.OPAQUE;if(h===K.BLEND?(l.transparent=!0,l.depthWrite=!1):(l.transparent=!1,h===K.MASK&&(l.alphaTest=void 0!==o.alphaCutoff?o.alphaCutoff:.5)),void 0!==o.normalTexture&&t!==r.V9B&&(c.push(s.assignTexture(l,"normalMap",o.normalTexture)),l.normalScale=new r.I9Y(1,1),void 0!==o.normalTexture.scale)){let e=o.normalTexture.scale;l.normalScale.set(e,e)}if(void 0!==o.occlusionTexture&&t!==r.V9B&&(c.push(s.assignTexture(l,"aoMap",o.occlusionTexture)),void 0!==o.occlusionTexture.strength&&(l.aoMapIntensity=o.occlusionTexture.strength)),void 0!==o.emissiveFactor&&t!==r.V9B){let e=o.emissiveFactor;l.emissive=new r.Q1f().setRGB(e[0],e[1],e[2],r.Zr2)}return void 0!==o.emissiveTexture&&t!==r.V9B&&c.push(s.assignTexture(l,"emissiveMap",o.emissiveTexture,r.er$)),Promise.all(c).then(function(){let r=new t(l);return o.name&&(r.name=o.name),X(r,o),s.associations.set(r,{materials:e}),o.extensions&&V(i,r,o),r})}createUniqueName(e){let t=r.Nwf.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){let t=this,s=this.extensions,n=this.primitiveCache,i=[];for(let o=0,l=e.length;o<l;o++){let l=e[o],u=function(e){let t,s=e.extensions&&e.extensions[a.KHR_DRACO_MESH_COMPRESSION];if(t=s?"draco:"+s.bufferView+":"+s.indices+":"+q(s.attributes):e.indices+":"+q(e.attributes)+":"+e.mode,void 0!==e.targets)for(let s=0,r=e.targets.length;s<r;s++)t+=":"+q(e.targets[s]);return t}(l),c=n[u];if(c)i.push(c.promise);else{let e;e=l.extensions&&l.extensions[a.KHR_DRACO_MESH_COMPRESSION]?function(e){return s[a.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then(function(s){return Z(s,e,t)})}(l):Z(new r.LoY,l,t),n[u]={primitive:l,promise:e},i.push(e)}}return Promise.all(i)}loadMesh(e){let t=this,s=this.json,i=this.extensions,o=s.meshes[e],a=o.primitives,l=[];for(let e=0,t=a.length;e<t;e++){var u;let t=void 0===a[e].material?(void 0===(u=this.cache).DefaultMaterial&&(u.DefaultMaterial=new r._4j({color:0xffffff,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:r.hB5})),u.DefaultMaterial):this.getDependency("material",a[e].material);l.push(t)}return l.push(t.loadGeometries(a)),Promise.all(l).then(function(s){let l=s.slice(0,s.length-1),u=s[s.length-1],c=[];for(let s=0,h=u.length;s<h;s++){let h,d=u[s],m=a[s],p=l[s];if(m.mode===H.TRIANGLES||m.mode===H.TRIANGLE_STRIP||m.mode===H.TRIANGLE_FAN||void 0===m.mode)!0===(h=!0===o.isSkinnedMesh?new r.I46(d,p):new r.eaF(d,p)).isSkinnedMesh&&h.normalizeSkinWeights(),m.mode===H.TRIANGLE_STRIP?h.geometry=n(h.geometry,r.O49):m.mode===H.TRIANGLE_FAN&&(h.geometry=n(h.geometry,r.rYR));else if(m.mode===H.LINES)h=new r.DXC(d,p);
1else if(m.mode===H.LINE_STRIP)h=new r.N1A(d,p);else if(m.mode===H.LINE_LOOP)h=new r.FCc(d,p);else if(m.mode===H.POINTS)h=new r.ONl(d,p);else throw Error("THREE.GLTFLoader: Primitive mode unsupported: "+m.mode);Object.keys(h.geometry.morphAttributes).length>0&&function(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(let s=0,r=t.weights.length;s<r;s++)e.morphTargetInfluences[s]=t.weights[s];if(t.extras&&Array.isArray(t.extras.targetNames)){let s=t.extras.targetNames;if(e.morphTargetInfluences.length===s.length){e.morphTargetDictionary={};for(let t=0,r=s.length;t<r;t++)e.morphTargetDictionary[s[t]]=t}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}(h,o),h.name=t.createUniqueName(o.name||"mesh_"+e),X(h,o),m.extensions&&V(i,h,m),t.assignFinalMaterial(h),c.push(h)}for(let s=0,r=c.length;s<r;s++)t.associations.set(c[s],{meshes:e,primitives:s});if(1===c.length)return o.extensions&&V(i,c[0],o),c[0];let h=new r.YJl;o.extensions&&V(i,h,o),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,s=this.json.cameras[e],n=s[s.type];return n?("perspective"===s.type?t=new r.ubm(r.cj9.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):"orthographic"===s.type&&(t=new r.qUd(-n.xmag,n.xmag,n.ymag,-n.ymag,n.znear,n.zfar)),s.name&&(t.name=this.createUniqueName(s.name)),X(t,s),Promise.resolve(t)):void console.warn("THREE.GLTFLoader: Missing camera parameters.")}loadSkin(e){let t=this.json.skins[e],s=[];for(let e=0,r=t.joints.length;e<r;e++)s.push(this._loadNodeShallow(t.joints[e]));return void 0!==t.inverseBindMatrices?s.push(this.getDependency("accessor",t.inverseBindMatrices)):s.push(null),Promise.all(s).then(function(e){let s=e.pop(),n=[],i=[];for(let o=0,a=e.length;o<a;o++){let a=e[o];if(a){n.push(a);let e=new r.kn4;null!==s&&e.fromArray(s.array,16*o),i.push(e)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[o])}return new r.EAD(n,i)})}loadAnimation(e){let t=this.json,s=this,n=t.animations[e],i=n.name?n.name:"animation_"+e,o=[],a=[],l=[],u=[],c=[];for(let e=0,t=n.channels.length;e<t;e++){let t=n.channels[e],s=n.samplers[t.sampler],r=t.target,i=r.node,h=void 0!==n.parameters?n.parameters[s.input]:s.input,d=void 0!==n.parameters?n.parameters[s.output]:s.output;void 0!==r.node&&(o.push(this.getDependency("node",i)),a.push(this.getDependency("accessor",h)),l.push(this.getDependency("accessor",d)),u.push(s),c.push(r))}return Promise.all([Promise.all(o),Promise.all(a),Promise.all(l),Promise.all(u),Promise.all(c)]).then(function(e){let t=e[0],n=e[1],o=e[2],a=e[3],l=e[4],u=[];for(let e=0,r=t.length;e<r;e++){let r=t[e],i=n[e],c=o[e],h=a[e],d=l[e];if(void 0===r)continue;r.updateMatrix&&r.updateMatrix();let m=s._createAnimationTracks(r,i,c,h,d);if(m)for(let e=0;e<m.length;e++)u.push(m[e])}return new r.tz3(i,void 0,u)})}createNodeMesh(e){let t=this.json,s=this,r=t.nodes[e];return void 0===r.mesh?null:s.getDependency("mesh",r.mesh).then(function(e){let t=s._getNodeRef(s.meshCache,r.mesh,e);return void 0!==r.weights&&t.traverse(function(e){if(e.isMesh)for(let t=0,s=r.weights.length;t<s;t++)e.morphTargetInfluences[t]=r.weights[t]}),t})}loadNode(e){let t=this.json.nodes[e],s=this._loadNodeShallow(e),r=[],n=t.children||[];for(let e=0,t=n.length;e<t;e++)r.push(this.getDependency("node",n[e]));let i=void 0===t.skin?Promise.resolve(null):this.getDependency("skin",t.skin);return Promise.all([s,Promise.all(r),i]).then(function(e){let t=e[0],s=e[1],r=e[2];null!==r&&t.traverse(function(e){e.isSkinnedMesh&&e.bind(r,Y)});for(let e=0,r=s.length;e<r;e++)t.add(s[e]);return t})}_loadNodeShallow(e){let t=this.json,s=this.extensions,n=this;if(void 0!==this.nodeCache[e])return this.nodeCache[e];let i=t.nodes[e],o=i.name?n.createUniqueName(i.name):"",a=[],l=n._invokeOne(function(t){return t.createNodeMesh&&t.createNodeMesh(e)});return l&&a.push(l),void 0!==i.camera&&a.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)}
1).forEach(function(e){a.push(e)}),this.nodeCache[e]=Promise.all(a).then(function(t){let a;if((a=!0===i.isBone?new r.$Kf:t.length>1?new r.YJl:1===t.length?t[0]:new r.B69)!==t[0])for(let e=0,s=t.length;e<s;e++)a.add(t[e]);if(i.name&&(a.userData.name=i.name,a.name=o),X(a,i),i.extensions&&V(s,a,i),void 0!==i.matrix){let e=new r.kn4;e.fromArray(i.matrix),a.applyMatrix4(e)}else void 0!==i.translation&&a.position.fromArray(i.translation),void 0!==i.rotation&&a.quaternion.fromArray(i.rotation),void 0!==i.scale&&a.scale.fromArray(i.scale);return n.associations.has(a)||n.associations.set(a,{}),n.associations.get(a).nodes=e,a}),this.nodeCache[e]}loadScene(e){let t=this.extensions,s=this.json.scenes[e],n=this,i=new r.YJl;s.name&&(i.name=n.createUniqueName(s.name)),X(i,s),s.extensions&&V(t,i,s);let o=s.nodes||[],a=[];for(let e=0,t=o.length;e<t;e++)a.push(n.getDependency("node",o[e]));return Promise.all(a).then(function(e){for(let t=0,s=e.length;t<s;t++)i.add(e[t]);return n.associations=(e=>{let t=new Map;for(let[e,s]of n.associations)(e instanceof r.imn||e instanceof r.gPd)&&t.set(e,s);return e.traverse(e=>{let s=n.associations.get(e);null!=s&&t.set(e,s)}),t})(i),i})}_createAnimationTracks(e,t,s,n,i){let o,a=[],l=e.name?e.name:e.uuid,u=[];switch(G[i.path]===G.weights?e.traverse(function(e){e.morphTargetInfluences&&u.push(e.name?e.name:e.uuid)}):u.push(l),G[i.path]){case G.weights:o=r.Hit;break;case G.rotation:o=r.MBL;break;case G.position:case G.scale:o=r.RiT;break;default:o=1===s.itemSize?r.Hit:r.RiT}let c=void 0!==n.interpolation?j[n.interpolation]:r.PJ3,h=this._getArrayFromAccessor(s);for(let e=0,s=u.length;e<s;e++){let s=new o(u[e]+"."+G[i.path],t.array,h,c);"CUBICSPLINE"===n.interpolation&&this._createCubicSplineTrackInterpolant(s),a.push(s)}return a}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){let e=z(t.constructor),s=new Float32Array(t.length);for(let r=0,n=t.length;r<n;r++)s[r]=t[r]*e;t=s}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(e){return new(this instanceof r.MBL?P:O)(this.times,this.values,this.getValueSize()/3,e)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function Z(e,t,s){let n=t.attributes,i=[];for(let t in n){let r=D[t]||t.toLowerCase();r in e.attributes||i.push(function(t,r){return s.getDependency("accessor",t).then(function(t){e.setAttribute(r,t)})}(n[t],r))}if(void 0!==t.indices&&!e.index){let r=s.getDependency("accessor",t.indices).then(function(t){e.setIndex(t)});i.push(r)}return r.ppV.workingColorSpace!==r.Zr2&&"COLOR_0"in n&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${r.ppV.workingColorSpace}" not supported.`),X(e,t),!function(e,t,s){let n=t.attributes,i=new r.NRn;if(void 0===n.POSITION)return;{let e=s.json.accessors[n.POSITION],t=e.min,o=e.max;if(void 0===t||void 0===o)return console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");if(i.set(new r.Pq0(t[0],t[1],t[2]),new r.Pq0(o[0],o[1],o[2])),e.normalized){let t=z(k[e.componentType]);i.min.multiplyScalar(t),i.max.multiplyScalar(t)}}let o=t.targets;if(void 0!==o){let e=new r.Pq0,t=new r.Pq0;for(let r=0,n=o.length;r<n;r++){let n=o[r];if(void 0!==n.POSITION){let r=s.json.accessors[n.POSITION],i=r.min,o=r.max;if(void 0!==i&&void 0!==o){if(t.setX(Math.max(Math.abs(i[0]),Math.abs(o[0]))),t.setY(Math.max(Math.abs(i[1]),Math.abs(o[1]))),t.setZ(Math.max(Math.abs(i[2]),Math.abs(o[2]))),r.normalized){let e=z(k[r.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 a=new r.iyt;i.getCenter(a.center),a.radius=i.min.distanceTo(i.max)/2,e.boundingSphere=a}(e,t,s),Promise.all(i).then(function(){return void 0!==t.targets?function(e,t,s){let r=!1,n=!1,i=!1;for(let e=0,s=t.length;e<s;e++){let s=t[e];if(void 0!==s.POSITION&&(r=!0),void 0!==s.NORMAL&&(n=!0),void 0!==s.COLOR_0&&(i=!0),r&&n&&i)break}if(!r&&!n&&!i)return Promise.resolve(e);let o=[],a=[],l=[];for(let u=0,c=t.length;u<c;u++){let c=t[u];if(r){let t=void 0!==c.POSITION?s.getDependency("accessor",c.POSITION):e.attributes.position;o.push(t)}if(n){let t=void 0!==c.NORMAL?s.getDependency("accessor",c.NORMAL):e.attributes.normal;a.push(t)}if(i){let t=void 0!==c.COLOR_0?s.getDependency("accessor",c.COLOR_0):e.attributes.color;l.push(t)}}return Promise.all([Promise.all(o),Promise.all(a),Promise.all(l)]).then(function(t){let s=t[0],o=t[1],a=t[2];return r&&(e.morphAttributes.position=s),n&&(e.morphAttributes.normal=o),i&&(e.morphAttributes.color=a),e.morphTargetsRelative=!0,e})}(e,t.targets,s):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.