PageSourceSearch

https://afk.ai/_next/static/chunks/251-0aa0493a138a603a.js

js afk.ai collected 2026-10-05 11:55:58 UTC 34,294 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[251],{7251:(e,t,s)=>{let r,n,i,a;s.r(t),s.d(t,{GLTFExporter:()=>u});var o=s(5351);function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;n||(n=new o.PlaneGeometry(2,2,1,1)),i||(i=new o.ShaderMaterial({uniforms:{blitTexture:new o.Uniform(e)},vertexShader:"\n			varying vec2 vUv;\n			void main(){\n				vUv = uv;\n				gl_Position = vec4(position.xy * 1.0,0.,.999999);\n			}",fragmentShader:"\n			uniform sampler2D blitTexture; \n			varying vec2 vUv;\n\n			void main(){ \n				gl_FragColor = vec4(vUv.xy, 0, 1);\n				\n				#ifdef IS_SRGB\n				gl_FragColor = LinearTosRGB( texture2D( blitTexture, vUv) );\n				#else\n				gl_FragColor = texture2D( blitTexture, vUv);\n				#endif\n			}"})),i.uniforms.blitTexture.value=e,i.defines.IS_SRGB=e.colorSpace==o.SRGBColorSpace,i.needsUpdate=!0,a||((a=new o.Mesh(n,i)).frustrumCulled=!1);let l=new o.PerspectiveCamera,c=new o.Scene;c.add(a),null===s&&(s=r=new o.WebGLRenderer({antialias:!1}));let u=Math.min(e.image.width,t),h=Math.min(e.image.height,t);s.setSize(u,h),s.clear(),s.render(c,l);let p=document.createElement("canvas"),m=p.getContext("2d");p.width=u,p.height=h,m.drawImage(s.domElement,0,0,u,h);let f=new o.CanvasTexture(p);return f.minFilter=e.minFilter,f.magFilter=e.magFilter,f.wrapS=e.wrapS,f.wrapT=e.wrapT,f.name=e.name,r&&(r.forceContextLoss(),r.dispose(),r=null),f}let c={POSITION:["byte","byte normalized","unsigned byte","unsigned byte normalized","short","short normalized","unsigned short","unsigned short normalized"],NORMAL:["byte normalized","short normalized"],TANGENT:["byte normalized","short normalized"],TEXCOORD:["byte","byte normalized","unsigned byte","short","short normalized","unsigned short"]};class u{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=new b,i=[];for(let e=0,t=this.pluginCallbacks.length;e<t;e++)i.push(this.pluginCallbacks[e](n));n.setPlugins(i),n.write(e,t,r).catch(s)}parseAsync(e,t){let s=this;
1return new Promise(function(r,n){s.parse(e,r,n,t)})}constructor(){this.pluginCallbacks=[],this.register(function(e){return new w(e)}),this.register(function(e){return new E(e)}),this.register(function(e){return new I(e)}),this.register(function(e){return new N(e)}),this.register(function(e){return new S(e)}),this.register(function(e){return new v(e)}),this.register(function(e){return new A(e)}),this.register(function(e){return new R(e)}),this.register(function(e){return new _(e)}),this.register(function(e){return new L(e)}),this.register(function(e){return new C(e)}),this.register(function(e){return new U(e)}),this.register(function(e){return new F(e)})}}let h={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497},p="KHR_mesh_quantization",m={};m[o.NearestFilter]=h.NEAREST,m[o.NearestMipmapNearestFilter]=h.NEAREST_MIPMAP_NEAREST,m[o.NearestMipmapLinearFilter]=h.NEAREST_MIPMAP_LINEAR,m[o.LinearFilter]=h.LINEAR,m[o.LinearMipmapNearestFilter]=h.LINEAR_MIPMAP_NEAREST,m[o.LinearMipmapLinearFilter]=h.LINEAR_MIPMAP_LINEAR,m[o.ClampToEdgeWrapping]=h.CLAMP_TO_EDGE,m[o.RepeatWrapping]=h.REPEAT,m[o.MirroredRepeatWrapping]=h.MIRRORED_REPEAT;let f={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},d=new o.Color;function g(e,t){return e.length===t.length&&e.every(function(e,s){return e===t[s]})}function x(e){return 4*Math.ceil(e/4)}function T(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=x(e.byteLength);if(s!==e.byteLength){let r=new Uint8Array(s);if(r.set(new Uint8Array(e)),0!==t)for(let n=e.byteLength;n<s;n++)r[n]=t;return r.buffer}return e}function y(){return"undefined"==typeof document&&"undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas")}function M(e,t){let s;return void 0!==e.toBlob?new Promise(s=>e.toBlob(s,t)):("image/jpeg"===t?s=.92:"image/webp"===t&&(s=.8),e.convertToBlob({type:t,quality:s}))}class b{setPlugins(e){this.plugins=e}async write(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},s),this.options.animations.length>0&&(this.options.trs=!0),this.processInput(e),await Promise.all(this.pending);let r=this.buffers,n=this.json;s=this.options;let i=this.extensionsUsed,a=this.extensionsRequired,o=new Blob(r,{type:"application/octet-stream"}),l=Object.keys(i),c=Object.keys(a);if(l.length>0&&(n.extensionsUsed=l),c.length>0&&(n.extensionsRequired=c),n.buffers&&n.buffers.length>0&&(n.buffers[0].byteLength=o.size),!0===s.binary){let e=new FileReader;e.readAsArrayBuffer(o),e.onloadend=function(){var s;let r=T(e.result),i=new DataView(new ArrayBuffer(8));i.setUint32(0,r.byteLength,!0),i.setUint32(4,5130562,!0);let a=T((s=JSON.stringify(n),new TextEncoder().encode(s).buffer),32),o=new DataView(new ArrayBuffer(8));o.setUint32(0,a.byteLength,!0),o.setUint32(4,0x4e4f534a,!0);let l=new ArrayBuffer(12),c=new DataView(l);c.setUint32(0,0x46546c67,!0),c.setUint32(4,2,!0);let u=12+o.byteLength+a.byteLength+i.byteLength+r.byteLength;c.setUint32(8,u,!0);let h=new Blob([l,o,a,i,r],{type:"application/octet-stream"}),p=new FileReader;p.readAsArrayBuffer(h),p.onloadend=function(){t(p.result)}}}else if(n.buffers&&n.buffers.length>0){let e=new FileReader;e.readAsDataURL(o),e.onloadend=function(){let s=e.result;n.buffers[0].uri=s,t(n)}}else t(n)}serializeUserData(e,t){if(0===Object.keys(e.userData).length)return;let s=this.options,r=this.extensionsUsed;try{let n=JSON.parse(JSON.stringify(e.userData));if(s.includeCustomExtensions&&n.gltfExtensions){for(let e in void 0===t.extensions&&(t.extensions={}),n.gltfExtensions)t.extensions[e]=n.gltfExtensions[e],r[e]=!0;delete n.gltfExtensions}Object.keys(n).length>0&&(t.extras=n)}
1catch(t){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+t.message)}}getUID(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!1===this.uids.has(e)){let t=new Map;t.set(!0,this.uid++),t.set(!1,this.uid++),this.uids.set(e,t)}return this.uids.get(e).get(t)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;let t=new o.Vector3;for(let s=0,r=e.count;s<r;s++)if(Math.abs(t.fromBufferAttribute(e,s).length()-1)>5e-4)return!1;return!0}createNormalizedNormalAttribute(e){let t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);let s=e.clone(),r=new o.Vector3;for(let e=0,t=s.count;e<t;e++)r.fromBufferAttribute(s,e),0===r.x&&0===r.y&&0===r.z?r.setX(1):r.normalize(),s.setXYZ(e,r.x,r.y,r.z);return t.attributesNormalized.set(e,s),s}applyTextureTransform(e,t){let s=!1,r={};(0!==t.offset.x||0!==t.offset.y)&&(r.offset=t.offset.toArray(),s=!0),0!==t.rotation&&(r.rotation=t.rotation,s=!0),(1!==t.repeat.x||1!==t.repeat.y)&&(r.scale=t.repeat.toArray(),s=!0),s&&(e.extensions=e.extensions||{},e.extensions.KHR_texture_transform=r,this.extensionsUsed.KHR_texture_transform=!0)}buildMetalRoughTexture(e,t){if(e===t)return e;function s(e){return e.colorSpace===o.SRGBColorSpace?function(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}:function(e){return e}}console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures."),e instanceof o.CompressedTexture&&(e=l(e)),t instanceof o.CompressedTexture&&(t=l(t));let r=e?e.image:null,n=t?t.image:null,i=Math.max(r?r.width:0,n?n.width:0),a=Math.max(r?r.height:0,n?n.height:0),c=y();c.width=i,c.height=a;let u=c.getContext("2d");u.fillStyle="#00ffff",u.fillRect(0,0,i,a);let h=u.getImageData(0,0,i,a);if(r){u.drawImage(r,0,0,i,a);let t=s(e),n=u.getImageData(0,0,i,a).data;for(let e=2;e<n.length;e+=4)h.data[e]=256*t(n[e]/256)}if(n){u.drawImage(n,0,0,i,a);let e=s(t),r=u.getImageData(0,0,i,a).data;for(let t=1;t<r.length;t+=4)h.data[t]=256*e(r[t]/256)}u.putImageData(h,0,0);let p=(e||t).clone();return p.source=new o.Source(c),p.colorSpace=o.NoColorSpace,p.channel=(e||t).channel,e&&t&&e.channel!==t.channel&&console.warn("THREE.GLTFExporter: UV channels for metalnessMap and roughnessMap textures must match."),p}processBuffer(e){let t=this.json,s=this.buffers;return t.buffers||(t.buffers=[{byteLength:0}]),s.push(e),0}processBufferView(e,t,s,r,n){let i,a=this.json;switch(!a.bufferViews&&(a.bufferViews=[]),t){case h.BYTE:case h.UNSIGNED_BYTE:i=1;break;case h.SHORT:case h.UNSIGNED_SHORT:i=2;break;default:i=4}let l=x(r*e.itemSize*i),c=new DataView(new ArrayBuffer(l)),u=0;for(let n=s;n<s+r;n++)for(let s=0;s<e.itemSize;s++){let r;e.itemSize>4?r=e.array[n*e.itemSize+s]:(0===s?r=e.getX(n):1===s?r=e.getY(n):2===s?r=e.getZ(n):3===s&&(r=e.getW(n)),!0===e.normalized&&(r=o.MathUtils.normalize(r,e.array))),t===h.FLOAT?c.setFloat32(u,r,!0):t===h.INT?c.setInt32(u,r,!0):t===h.UNSIGNED_INT?c.setUint32(u,r,!0):t===h.SHORT?c.setInt16(u,r,!0):t===h.UNSIGNED_SHORT?c.setUint16(u,r,!0):t===h.BYTE?c.setInt8(u,r):t===h.UNSIGNED_BYTE&&c.setUint8(u,r),u+=i}let p={buffer:this.processBuffer(c.buffer),byteOffset:this.byteOffset,byteLength:l};return void 0!==n&&(p.target=n),n===h.ARRAY_BUFFER&&(p.byteStride=e.itemSize*i),this.byteOffset+=l,a.bufferViews.push(p),{id:a.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){let t=this,s=t.json;return s.bufferViews||(s.bufferViews=[]),new Promise(function(r){let n=new FileReader;n.readAsArrayBuffer(e),n.onloadend=function(){let e=T(n.result),i={buffer:t.processBuffer(e),byteOffset:t.byteOffset,byteLength:e.byteLength};t.byteOffset+=e.byteLength,r(s.bufferViews.push(i)-1)}})}processAccessor(e,t,s,r){let n,i,a=this.json;if(e.array.constructor===Float32Array)n=h.FLOAT;else if(e.array.constructor===Int32Array)n=h.INT;else if(e.array.constructor===Uint32Array)n=h.UNSIGNED_INT;else if(e.array.constructor===Int16Array)n=h.SHORT;else if(e.array.constructor===Uint16Array)n=h.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)n=h.BYTE;else if(e.array.constructor===Uint8Array)n=h.UNSIGNED_BYTE;else throw Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: "+e.array.constructor.name);
1if(void 0===s&&(s=0),(void 0===r||r===1/0)&&(r=e.count),0===r)return null;let l=function(e,t,s){let r={min:Array(e.itemSize).fill(Number.POSITIVE_INFINITY),max:Array(e.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let n=t;n<t+s;n++)for(let t=0;t<e.itemSize;t++){let s;e.itemSize>4?s=e.array[n*e.itemSize+t]:(0===t?s=e.getX(n):1===t?s=e.getY(n):2===t?s=e.getZ(n):3===t&&(s=e.getW(n)),!0===e.normalized&&(s=o.MathUtils.normalize(s,e.array))),r.min[t]=Math.min(r.min[t],s),r.max[t]=Math.max(r.max[t],s)}return r}(e,s,r);void 0!==t&&(i=e===t.index?h.ELEMENT_ARRAY_BUFFER:h.ARRAY_BUFFER);let c=this.processBufferView(e,n,s,r,i),u={bufferView:c.id,byteOffset:c.byteOffset,componentType:n,count:r,max:l.max,min:l.min,type:{1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"}[e.itemSize]};return!0===e.normalized&&(u.normalized=!0),a.accessors||(a.accessors=[]),a.accessors.push(u)-1}processImage(e,t,s){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"image/png";if(null!==e){let n=this,i=n.cache,a=n.json,l=n.options,c=n.pending;i.images.has(e)||i.images.set(e,{});let u=i.images.get(e),h=r+":flipY/"+s.toString();if(void 0!==u[h])return u[h];a.images||(a.images=[]);let p={mimeType:r},m=y();m.width=Math.min(e.width,l.maxTextureSize),m.height=Math.min(e.height,l.maxTextureSize);let f=m.getContext("2d");if(!0===s&&(f.translate(0,m.height),f.scale(1,-1)),void 0!==e.data){t!==o.RGBAFormat&&console.error("GLTFExporter: Only RGBAFormat is supported.",t),(e.width>l.maxTextureSize||e.height>l.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);let s=new Uint8ClampedArray(e.height*e.width*4);for(let t=0;t<s.length;t+=4)s[t+0]=e.data[t+0],s[t+1]=e.data[t+1],s[t+2]=e.data[t+2],s[t+3]=e.data[t+3];f.putImageData(new ImageData(s,e.width,e.height),0,0)}else f.drawImage(e,0,0,m.width,m.height);!0===l.binary?c.push(M(m,r).then(e=>n.processBufferViewImage(e)).then(e=>{p.bufferView=e})):void 0!==m.toDataURL?p.uri=m.toDataURL(r):c.push(M(m,r).then(e=>new FileReader().readAsDataURL(e)).then(e=>{p.uri=e}));let d=a.images.push(p)-1;return u[h]=d,d}throw Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.")}processSampler(e){let t=this.json;t.samplers||(t.samplers=[]);let s={magFilter:m[e.magFilter],minFilter:m[e.minFilter],wrapS:m[e.wrapS],wrapT:m[e.wrapT]};return t.samplers.push(s)-1}processTexture(e){let t=this.options,s=this.cache,r=this.json;if(s.textures.has(e))return s.textures.get(e);r.textures||(r.textures=[]),e instanceof o.CompressedTexture&&(e=l(e,t.maxTextureSize));let n=e.userData.mimeType;"image/webp"===n&&(n="image/png");let i={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,n)};e.name&&(i.name=e.name),this._invokeAll(function(t){t.writeTexture&&t.writeTexture(e,i)});let a=r.textures.push(i)-1;return s.textures.set(e,a),a}processMaterial(e){let t=this.cache,s=this.json;if(t.materials.has(e))return t.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;s.materials||(s.materials=[]);let r={pbrMetallicRoughness:{}};!0!==e.isMeshStandardMaterial&&!0!==e.isMeshBasicMaterial&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");let n=e.color.toArray().concat([e.opacity]);if(g(n,[1,1,1,1])||(r.pbrMetallicRoughness.baseColorFactor=n),e.isMeshStandardMaterial?(r.pbrMetallicRoughness.metallicFactor=e.metalness,r.pbrMetallicRoughness.roughnessFactor=e.roughness):(r.pbrMetallicRoughness.metallicFactor=.5,r.pbrMetallicRoughness.roughnessFactor=.5),e.metalnessMap||e.roughnessMap){let t=this.buildMetalRoughTexture(e.metalnessMap,e.roughnessMap),s={index:this.processTexture(t),channel:t.channel};this.applyTextureTransform(s,t),r.pbrMetallicRoughness.metallicRoughnessTexture=s}if(e.map){let t={index:this.processTexture(e.map),texCoord:e.map.channel};this.applyTextureTransform(t,e.map),r.pbrMetallicRoughness.baseColorTexture=t}if(e.emissive){let t=e.emissive;if(Math.max(t.r,t.g,t.b)>0&&(r.emissiveFactor=e.emissive.toArray()),e.emissiveMap){let t={index:this.processTexture(e.emissiveMap),texCoord:e.emissiveMap.channel};this.applyTextureTransform(t,e.emissiveMap),r.emissiveTexture=t}}if(e.normalMap){let t={index:this.processTexture(e.normalMap),texCoord:e.normalMap.channel};e.normalScale&&1!==e.normalScale.x&&(t.scale=e.normalScale.x),this.applyTextureTransform(t,e.normalMap),r.normalTexture=t}if(e.aoMap){let t={index:this.processTexture(e.aoMap),texCoord:e.aoMap.channel};1!==e.aoMapIntensity&&(t.strength=e.aoMapIntensity),this.applyTextureTransform(t,e.aoMap),r.occlusionTexture=t}e.transparent?r.alphaMode="BLEND":e.alphaTest>0&&(r.alphaMode="MASK",r.alphaCutoff=e.alphaTest),e.side===o.DoubleSide&&(r.doubleSided=!0),""!==e.name&&(r.name=e.name),this.serializeUserData(e,r),this._invokeAll(function(t){t.writeMaterial&&t.writeMaterial(e,r)});let i=s.materials.push(r)-1;return t.materials.set(e,i),i}processMesh(e){let t,s=this.cache,r=this.json,n=[e.geometry.uuid];if(Array.isArray(e.material))for(let t=0,s=e.material.length;t<s;t++)n.push(e.material[t].uuid);else n.push(e.material.uuid);let i=n.join(":");if(s.meshes.has(i))return s.meshes.get(i);let a=e.geometry;t=e.isLineSegments?h.LINES:e.isLineLoop?h.LINE_LOOP:e.isLine?h.LINE_STRIP:e.isPoints?h.POINTS:e.material.wireframe?h.LINES:h.TRIANGLES;let l={},c={},u=[],p=[],m={uv:"TEXCOORD_0",uv1:"TEXCOORD_1",uv2:"TEXCOORD_2",uv3:"TEXCOORD_3",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},f=a.getAttribute("normal");void 0===f||this.isNormalizedNormalAttribute(f)||(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),a.setAttribute("normal",this.createNormalizedNormalAttribute(f)));let d=null;
1for(let e in a.attributes){if("morph"===e.slice(0,5))continue;let t=a.attributes[e];if(e=m[e]||e.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(e)||(e="_"+e),s.attributes.has(this.getUID(t))){c[e]=s.attributes.get(this.getUID(t));continue}d=null;let r=t.array;"JOINTS_0"!==e||r instanceof Uint16Array||r instanceof Uint8Array||(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),d=new o.BufferAttribute(new Uint16Array(r),t.itemSize,t.normalized));let n=this.processAccessor(d||t,a);null!==n&&(e.startsWith("_")||this.detectMeshQuantization(e,t),c[e]=n,s.attributes.set(this.getUID(t),n))}if(void 0!==f&&a.setAttribute("normal",f),0===Object.keys(c).length)return null;if(void 0!==e.morphTargetInfluences&&e.morphTargetInfluences.length>0){let t=[],r=[],n={};if(void 0!==e.morphTargetDictionary)for(let t in e.morphTargetDictionary)n[e.morphTargetDictionary[t]]=t;for(let i=0;i<e.morphTargetInfluences.length;++i){let o={},l=!1;for(let e in a.morphAttributes){if("position"!==e&&"normal"!==e){l||(console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."),l=!0);continue}let t=a.morphAttributes[e][i],r=e.toUpperCase(),n=a.attributes[e];if(s.attributes.has(this.getUID(t,!0))){o[r]=s.attributes.get(this.getUID(t,!0));continue}let c=t.clone();if(!a.morphTargetsRelative)for(let e=0,s=t.count;e<s;e++)for(let s=0;s<t.itemSize;s++)0===s&&c.setX(e,t.getX(e)-n.getX(e)),1===s&&c.setY(e,t.getY(e)-n.getY(e)),2===s&&c.setZ(e,t.getZ(e)-n.getZ(e)),3===s&&c.setW(e,t.getW(e)-n.getW(e));o[r]=this.processAccessor(c,a),s.attributes.set(this.getUID(n,!0),o[r])}p.push(o),t.push(e.morphTargetInfluences[i]),void 0!==e.morphTargetDictionary&&r.push(n[i])}l.weights=t,r.length>0&&(l.extras={},l.extras.targetNames=r)}let g=Array.isArray(e.material);if(g&&0===a.groups.length)return null;let x=!1;if(g&&null===a.index){let e=[];for(let t=0,s=a.attributes.position.count;t<s;t++)e[t]=t;a.setIndex(e),x=!0}let T=g?e.material:[e.material],y=g?a.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let e=0,r=y.length;e<r;e++){let r={mode:t,attributes:c};if(this.serializeUserData(a,r),p.length>0&&(r.targets=p),null!==a.index){let t=this.getUID(a.index);(void 0!==y[e].start||void 0!==y[e].count)&&(t+=":"+y[e].start+":"+y[e].count),s.attributes.has(t)?r.indices=s.attributes.get(t):(r.indices=this.processAccessor(a.index,a,y[e].start,y[e].count),s.attributes.set(t,r.indices)),null===r.indices&&delete r.indices}let n=this.processMaterial(T[y[e].materialIndex]);null!==n&&(r.material=n),u.push(r)}!0===x&&a.setIndex(null),l.primitives=u,r.meshes||(r.meshes=[]),this._invokeAll(function(t){t.writeMesh&&t.writeMesh(e,l)});let M=r.meshes.push(l)-1;return s.meshes.set(i,M),M}detectMeshQuantization(e,t){let s;if(this.extensionsUsed[p])return;switch(t.array.constructor){case Int8Array:s="byte";break;case Uint8Array:s="unsigned byte";break;case Int16Array:s="short";break;case Uint16Array:s="unsigned short";break;default:return}t.normalized&&(s+=" normalized");let r=e.split("_",1)[0];c[r]&&c[r].includes(s)&&(this.extensionsUsed[p]=!0,this.extensionsRequired[p]=!0)}processCamera(e){let t=this.json;t.cameras||(t.cameras=[]);let s=e.isOrthographicCamera,r={type:s?"orthographic":"perspective"};return s?r.orthographic={xmag:2*e.right,ymag:2*e.top,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:r.perspective={aspectRatio:e.aspect,yfov:o.MathUtils.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},""!==e.name&&(r.name=e.type),t.cameras.push(r)-1}processAnimation(e,t){let s=this.json,r=this.nodeMap;s.animations||(s.animations=[]);let n=(e=u.Utils.mergeMorphTargetTracks(e.clone(),t)).tracks,i=[],a=[];for(let e=0;e<n.length;++e){let s,l=n[e],c=o.PropertyBinding.parseTrackName(l.name),u=o.PropertyBinding.findNode(t,c.nodeName),h=f[c.propertyName];if("bones"===c.objectName&&(u=!0===u.isSkinnedMesh?u.skeleton.getBoneByName(c.objectIndex):void 0),!u||!h)return console.warn('THREE.GLTFExporter: Could not export animation track "%s".',l.name),null;let p=l.values.length/l.times.length;h===f.morphTargetInfluences&&(p/=u.morphTargetInfluences.length),!0===l.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline?(s="CUBICSPLINE",p/=3):s=l.getInterpolation()===o.InterpolateDiscrete?"STEP":"LINEAR",a.push({input:this.processAccessor(new o.BufferAttribute(l.times,1)),output:this.processAccessor(new o.BufferAttribute(l.values,p)),interpolation:s}),i.push({sampler:a.length-1,target:{node:r.get(u),path:h}})}return s.animations.push({name:e.name||"clip_"+s.animations.length,samplers:a,channels:i}),s.animations.length-1}
1processSkin(e){let t=this.json,s=this.nodeMap,r=t.nodes[s.get(e)],n=e.skeleton;if(void 0===n)return null;let i=e.skeleton.bones[0];if(void 0===i)return null;let a=[],l=new Float32Array(16*n.bones.length),c=new o.Matrix4;for(let t=0;t<n.bones.length;++t)a.push(s.get(n.bones[t])),c.copy(n.boneInverses[t]),c.multiply(e.bindMatrix).toArray(l,16*t);return void 0===t.skins&&(t.skins=[]),t.skins.push({inverseBindMatrices:this.processAccessor(new o.BufferAttribute(l,16)),joints:a,skeleton:s.get(i)}),r.skin=t.skins.length-1}processNode(e){let t=this.json,s=this.options,r=this.nodeMap;t.nodes||(t.nodes=[]);let n={};if(s.trs){let t=e.quaternion.toArray(),s=e.position.toArray(),r=e.scale.toArray();g(t,[0,0,0,1])||(n.rotation=t),g(s,[0,0,0])||(n.translation=s),g(r,[1,1,1])||(n.scale=r)}else e.matrixAutoUpdate&&e.updateMatrix(),!1===g(e.matrix.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])&&(n.matrix=e.matrix.elements);if(""!==e.name&&(n.name=String(e.name)),this.serializeUserData(e,n),e.isMesh||e.isLine||e.isPoints){let t=this.processMesh(e);null!==t&&(n.mesh=t)}else e.isCamera&&(n.camera=this.processCamera(e));if(e.isSkinnedMesh&&this.skins.push(e),e.children.length>0){let t=[];for(let r=0,n=e.children.length;r<n;r++){let n=e.children[r];if(n.visible||!1===s.onlyVisible){let e=this.processNode(n);null!==e&&t.push(e)}}t.length>0&&(n.children=t)}this._invokeAll(function(t){t.writeNode&&t.writeNode(e,n)});let i=t.nodes.push(n)-1;return r.set(e,i),i}processScene(e){let t=this.json,s=this.options;t.scenes||(t.scenes=[],t.scene=0);let r={};""!==e.name&&(r.name=e.name),t.scenes.push(r);let n=[];for(let t=0,r=e.children.length;t<r;t++){let r=e.children[t];if(r.visible||!1===s.onlyVisible){let e=this.processNode(r);null!==e&&n.push(e)}}n.length>0&&(r.nodes=n),this.serializeUserData(e,r)}processObjects(e){let t=new o.Scene;t.name="AuxScene";for(let s=0;s<e.length;s++)t.children.push(e[s]);this.processScene(t)}processInput(e){let t=this.options;e=e instanceof Array?e:[e],this._invokeAll(function(t){t.beforeParse&&t.beforeParse(e)});let s=[];for(let t=0;t<e.length;t++)e[t]instanceof o.Scene?this.processScene(e[t]):s.push(e[t]);s.length>0&&this.processObjects(s);for(let e=0;e<this.skins.length;++e)this.processSkin(this.skins[e]);for(let s=0;s<t.animations.length;++s)this.processAnimation(t.animations[s],e[0]);this._invokeAll(function(t){t.afterParse&&t.afterParse(e)})}_invokeAll(e){for(let t=0,s=this.plugins.length;t<s;t++)e(this.plugins[t])}constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.extensionsRequired={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}}class w{writeNode(e,t){if(!e.isLight)return;if(!e.isDirectionalLight&&!e.isPointLight&&!e.isSpotLight)return void console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",e);let s=this.writer,r=s.json,n=s.extensionsUsed,i={};e.name&&(i.name=e.name),i.color=e.color.toArray(),i.intensity=e.intensity,e.isDirectionalLight?i.type="directional":e.isPointLight?(i.type="point",e.distance>0&&(i.range=e.distance)):e.isSpotLight&&(i.type="spot",e.distance>0&&(i.range=e.distance),i.spot={},i.spot.innerConeAngle=(1-e.penumbra)*e.angle,i.spot.outerConeAngle=e.angle),void 0!==e.decay&&2!==e.decay&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||0!==e.target.position.x||0!==e.target.position.y||-1!==e.target.position.z)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),n[this.name]||(r.extensions=r.extensions||{},r.extensions[this.name]={lights:[]},n[this.name]=!0);let a=r.extensions[this.name].lights;a.push(i),t.extensions=t.extensions||{},t.extensions[this.name]={light:a.length-1}}constructor(e){this.writer=e,this.name="KHR_lights_punctual"}}class E{writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;let s=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},s[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}constructor(e){this.writer=e,this.name="KHR_materials_unlit"}}class A{writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0===e.clearcoat)return;let s=this.writer,r=s.extensionsUsed,n={};if(n.clearcoatFactor=e.clearcoat,e.clearcoatMap){let t={index:s.processTexture(e.clearcoatMap),texCoord:e.clearcoatMap.channel};s.applyTextureTransform(t,e.clearcoatMap),n.clearcoatTexture=t}if(n.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){let t={index:s.processTexture(e.clearcoatRoughnessMap),texCoord:e.clearcoatRoughnessMap.channel};s.applyTextureTransform(t,e.clearcoatRoughnessMap),n.clearcoatRoughnessTexture=t}if(e.clearcoatNormalMap){let t={index:s.processTexture(e.clearcoatNormalMap),texCoord:e.clearcoatNormalMap.channel};s.applyTextureTransform(t,e.clearcoatNormalMap),n.clearcoatNormalTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=n,r[this.name]=!0}constructor(e){this.writer=e,this.name="KHR_materials_clearcoat"}}class R{writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0===e.iridescence)return;let s=this.writer,r=s.extensionsUsed,n={};if(n.iridescenceFactor=e.iridescence,e.iridescenceMap){let t={index:s.processTexture(e.iridescenceMap),texCoord:e.iridescenceMap.channel};s.applyTextureTransform(t,e.iridescenceMap),n.iridescenceTexture=t}if(n.iridescenceIor=e.iridescenceIOR,n.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],n.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){let t={index:s.processTexture(e.iridescenceThicknessMap),texCoord:e.iridescenceThicknessMap.channel};s.applyTextureTransform(t,e.iridescenceThicknessMap),n.iridescenceThicknessTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=n,r[this.name]=!0}constructor(e){this.writer=e,this.name="KHR_materials_iridescence"}}class I{writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0===e.transmission)return;let s=this.writer,r=s.extensionsUsed,n={};if(n.transmissionFactor=e.transmission,e.transmissionMap){let t={index:s.processTexture(e.transmissionMap),texCoord:e.transmissionMap.channel};s.applyTextureTransform(t,e.transmissionMap),n.transmissionTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=n,r[this.name]=!0}constructor(e){this.writer=e,this.name="KHR_materials_transmission"}}class N{writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0===e.transmission)return;let s=this.writer,r=s.extensionsUsed,n={};if(n.thicknessFactor=e.thickness,e.thicknessMap){let t={index:s.processTexture(e.thicknessMap),texCoord:e.thicknessMap.channel};s.applyTextureTransform(t,e.thicknessMap),n.thicknessTexture=t}n.attenuationDistance=e.attenuationDistance,n.attenuationColor=e.attenuationColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=n,r[this.name]=!0}constructor(e){this.writer=e,this.name="KHR_materials_volume"}}class S{writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||1.5===e.ior)return;let s=this.writer.extensionsUsed,r={};
1r.ior=e.ior,t.extensions=t.extensions||{},t.extensions[this.name]=r,s[this.name]=!0}constructor(e){this.writer=e,this.name="KHR_materials_ior"}}class v{writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||1===e.specularIntensity&&e.specularColor.equals(d)&&!e.specularIntensityMap&&!e.specularColorMap)return;let s=this.writer,r=s.extensionsUsed,n={};if(e.specularIntensityMap){let t={index:s.processTexture(e.specularIntensityMap),texCoord:e.specularIntensityMap.channel};s.applyTextureTransform(t,e.specularIntensityMap),n.specularTexture=t}if(e.specularColorMap){let t={index:s.processTexture(e.specularColorMap),texCoord:e.specularColorMap.channel};s.applyTextureTransform(t,e.specularColorMap),n.specularColorTexture=t}n.specularFactor=e.specularIntensity,n.specularColorFactor=e.specularColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=n,r[this.name]=!0}constructor(e){this.writer=e,this.name="KHR_materials_specular"}}class _{writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0==e.sheen)return;let s=this.writer,r=s.extensionsUsed,n={};if(e.sheenRoughnessMap){let t={index:s.processTexture(e.sheenRoughnessMap),texCoord:e.sheenRoughnessMap.channel};s.applyTextureTransform(t,e.sheenRoughnessMap),n.sheenRoughnessTexture=t}if(e.sheenColorMap){let t={index:s.processTexture(e.sheenColorMap),texCoord:e.sheenColorMap.channel};s.applyTextureTransform(t,e.sheenColorMap),n.sheenColorTexture=t}n.sheenRoughnessFactor=e.sheenRoughness,n.sheenColorFactor=e.sheenColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=n,r[this.name]=!0}constructor(e){this.writer=e,this.name="KHR_materials_sheen"}}class L{writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0==e.anisotropy)return;let s=this.writer,r=s.extensionsUsed,n={};if(e.anisotropyMap){let t={index:s.processTexture(e.anisotropyMap)};s.applyTextureTransform(t,e.anisotropyMap),n.anisotropyTexture=t}n.anisotropyStrength=e.anisotropy,n.anisotropyRotation=e.anisotropyRotation,t.extensions=t.extensions||{},t.extensions[this.name]=n,r[this.name]=!0}constructor(e){this.writer=e,this.name="KHR_materials_anisotropy"}}class C{writeMaterial(e,t){if(!e.isMeshStandardMaterial||1===e.emissiveIntensity)return;let s=this.writer.extensionsUsed,r={};r.emissiveStrength=e.emissiveIntensity,t.extensions=t.extensions||{},t.extensions[this.name]=r,s[this.name]=!0}constructor(e){this.writer=e,this.name="KHR_materials_emissive_strength"}}class U{writeMaterial(e,t){if(!e.isMeshStandardMaterial||1===e.bumpScale&&!e.bumpMap)return;let s=this.writer,r=s.extensionsUsed,n={};if(e.bumpMap){let t={index:s.processTexture(e.bumpMap),texCoord:e.bumpMap.channel};s.applyTextureTransform(t,e.bumpMap),n.bumpTexture=t}n.bumpFactor=e.bumpScale,t.extensions=t.extensions||{},t.extensions[this.name]=n,r[this.name]=!0}constructor(e){this.writer=e,this.name="EXT_materials_bump"}}class F{writeNode(e,t){if(!e.isInstancedMesh)return;let s=this.writer,r=new Float32Array(3*e.count),n=new Float32Array(4*e.count),i=new Float32Array(3*e.count),a=new o.Matrix4,l=new o.Vector3,c=new o.Quaternion,u=new o.Vector3;for(let t=0;t<e.count;t++)e.getMatrixAt(t,a),a.decompose(l,c,u),l.toArray(r,3*t),c.toArray(n,4*t),u.toArray(i,3*t);let h={TRANSLATION:s.processAccessor(new o.BufferAttribute(r,3)),ROTATION:s.processAccessor(new o.BufferAttribute(n,4)),SCALE:s.processAccessor(new o.BufferAttribute(i,3))};e.instanceColor&&(h._COLOR_0=s.processAccessor(e.instanceColor)),t.extensions=t.extensions||{},t.extensions[this.name]={attributes:h},s.extensionsUsed[this.name]=!0,s.extensionsRequired[this.name]=!0}constructor(e){this.writer=e,this.name="EXT_mesh_gpu_instancing"}}u.Utils={insertKeyframe:function(e,t){let s,r=e.getValueSize(),n=new e.TimeBufferType(e.times.length+1),i=new e.ValueBufferType(e.values.length+r),a=e.createInterpolant(new e.ValueBufferType(r));if(0===e.times.length){n[0]=t;for(let e=0;e<r;e++)i[e]=0;s=0}else if(t<e.times[0]){if(.001>Math.abs(e.times[0]-t))return 0;n[0]=t,n.set(e.times,1),i.set(a.evaluate(t),0),i.set(e.values,r),s=0}else if(t>e.times[e.times.length-1]){if(.001>Math.abs(e.times[e.times.length-1]-t))return e.times.length-1;n[n.length-1]=t,n.set(e.times,0),i.set(e.values,0),i.set(a.evaluate(t),e.values.length),s=n.length-1}else for(let o=0;o<e.times.length;o++){if(.001>Math.abs(e.times[o]-t))return o;if(e.times[o]<t&&e.times[o+1]>t){n.set(e.times.slice(0,o+1),0),n[o+1]=t,n.set(e.times.slice(o+1),o+2),i.set(e.values.slice(0,(o+1)*r),0),i.set(a.evaluate(t),(o+1)*r),i.set(e.values.slice((o+1)*r),(o+2)*r),s=o+1;break}}return e.times=n,e.values=i,s},mergeMorphTargetTracks:function(e,t){let s=[],r={},n=e.tracks;for(let e=0;e<n.length;++e){let i,a=n[e],l=o.PropertyBinding.parseTrackName(a.name),c=o.PropertyBinding.findNode(t,l.nodeName);if("morphTargetInfluences"!==l.propertyName||void 0===l.propertyIndex){s.push(a);continue}if(a.createInterpolant!==a.InterpolantFactoryMethodDiscrete&&a.createInterpolant!==a.InterpolantFactoryMethodLinear){if(a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)throw Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."),(a=a.clone()).setInterpolation(o.InterpolateLinear)}let u=c.morphTargetInfluences.length,h=c.morphTargetDictionary[l.propertyIndex];if(void 0===h)throw Error("THREE.GLTFExporter: Morph target name not found: "+l.propertyIndex);if(void 0===r[c.uuid]){let e=new(i=a.clone()).ValueBufferType(u*i.times.length);for(let t=0;t<i.times.length;t++)e[t*u+h]=i.values[t];
vendor: 356 bytes, line 1
1i.name=(l.nodeName||"")+".morphTargetInfluences",i.values=e,r[c.uuid]=i,s.push(i);continue}let p=a.createInterpolant(new a.ValueBufferType(1));i=r[c.uuid];for(let e=0;e<i.times.length;e++)i.values[e*u+h]=p.evaluate(i.times[e]);for(let e=0;e<a.times.length;e++){let t=this.insertKeyframe(i,a.times[e]);i.values[t*u+h]=a.values[e]}}return e.tracks=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.