UNPKG

750 kBJavaScriptView Raw
1!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("three")):"function"==typeof define&&define.amd?define(["three"],t):"object"==typeof exports?exports.vrm=t(require("three")):e.vrm=t(e.three)}(window,function(e){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=11)}([function(t,n){t.exports=e},function(e,t,n){"use strict";n.r(t);var i=n(4);for(var r in i)"default"!==r&&function(e){n.d(t,e,function(){return i[e]})}(r);var a=n(9);n.d(t,"VMD",function(){return a.a});var o=n(2);n.d(t,"USERDATA_KEY_VRM",function(){return o.a}),n.d(t,"VRM",function(){return o.b});var s=n(5);for(var r in s)["VMD","USERDATA_KEY_VRM","VRM","default"].indexOf(r)<0&&function(e){n.d(t,e,function(){return s[e]})}(r)},function(e,t,n){"use strict";n.d(t,"a",function(){return o}),n.d(t,"b",function(){return s});var i=n(0),r=n(3),a=function(e,t,n,i){return new(n||(n=Promise))(function(r,a){function o(e){try{c(i.next(e))}catch(e){a(e)}}function s(e){try{c(i.throw(e))}catch(e){a(e)}}function c(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(o,s)}c((i=i.apply(e,t||[])).next())})};const o="VRM";class s{fromGLTF(e){return a(this,void 0,void 0,function*(){if(this.asset=e.asset,this.model=e.scene,this.model.type="Object3D",this.parser=e.parser,this.userData=e.userData,!e.userData.gltfExtensions||!e.userData.gltfExtensions.VRM)throw new Error("Loaded glTF is not a VRM model.");this.exporterVersion=e.userData.gltfExtensions.VRM.exporterVersion,this.meta=e.userData.gltfExtensions.VRM.meta,this.humanoid=e.userData.gltfExtensions.VRM.humanoid,this.blendShapeMaster=e.userData.gltfExtensions.VRM.blendShapeMaster,this.firstPerson=e.userData.gltfExtensions.VRM.firstPerson,this.secondaryAnimation=e.userData.gltfExtensions.VRM.secondaryAnimation,this.materialProperties=e.userData.gltfExtensions.VRM.materialProperties,this.model.name=this.meta.title;{const e=new Set;this.materialProperties.forEach(t=>{Object.values(t.textureProperties).forEach(t=>{e.add(t)})});const t=new Array(this.parser.json.textures.length);for(const n of e.values())t[n]=this.parser.loadTexture(n);this.textures=yield Promise.all(t)}{const e=e=>{const t=this.materialProperties.filter(t=>t.name===e.name);return 1===t.length?t[0]:t.find(t=>{const n=t.vectorProperties._Color,i=e.color;return n&&i&&n[0]===i.r&&n[1]===i.g&&n[2]===i.b})||t[0]};this.model.traverse(t=>{if(t instanceof i.Mesh){const n=t.geometry instanceof i.BufferGeometry&&!!t.geometry.morphAttributes.position;if(Array.isArray(t.material))return void console.warn(`"${t.name}" is a multi-material mesh.`,t);const a=e(t.material);if("VRM_USE_GLTFSHADER"===a.shader)return;const o=new r.a({morphTargets:n,skinning:!0});o.fromMaterialProperty(a,this.textures),t.material=o}})}{const e=new Array(this.parser.json.nodes.length);for(let t=0;t<this.parser.json.nodes.length;++t)e[t]=this.parser.loadNode(t);this.nodes=(yield Promise.all(e)).map(e=>this.model.getObjectByName(e.name))}this.meshes=this.parser.json.meshes.map(()=>[]),this.model.traverse(e=>{if(e instanceof i.Mesh){const t=this.parser.json.nodes.find(t=>t.name===e.name);if(t&&void 0!==t.mesh)return void(this.meshes[t.mesh]=[e]);const n=e.name.lastIndexOf("_"),i=-1!==n?Number(e.name.substr(n+1)):0,r=-1===n||isNaN(i)?e.name:e.name.substr(0,n),a=this.parser.json.meshes.findIndex(e=>e.name===r);-1!==a&&(this.meshes[a][i]=e)}}),this.model.updateMatrixWorld(!0);{const e=this.getNodeByHumanBoneName("hips");if(e){const t=new i.Bone;t.name="全ての親";const n=new i.Bone;n.name="センター";const r=new i.Bone;r.name="グルーブ",t.add(n.add(r)),e.parent.add(t),r.add(e)}const t=new i.Bone;t.name="左足IK";const n=this.getNodeByHumanBoneName("leftFoot");n&&t.applyMatrix(n.matrixWorld),this.model.add(t);const r=new i.Bone;r.name="右足IK";const a=this.getNodeByHumanBoneName("rightFoot");a&&r.applyMatrix(a.matrixWorld),this.model.add(r);const o=new i.Object3D;o.name="左つま先IK";const s=this.getNodeByHumanBoneName("leftToes");s&&o.applyMatrix(s.matrix),t.add(o);const c=new i.Object3D;c.name="右つま先IK";const l=this.getNodeByHumanBoneName("rightToes");l&&c.applyMatrix(l.matrix),r.add(c)}return this.model.traverse(e=>{let t;if(e.userData[o]={},e.userData[o].default={position:e.position.clone(),quaternion:e.quaternion.clone()},e.children.length){t=e.children[0].position.clone();const n=e.children[0].getWorldScale(new i.Vector3);t.x*=n.x,t.y*=n.y,t.z*=n.z}else if(e.parent){const n=e.getWorldPosition(new i.Vector3).sub(e.parent.getWorldPosition(new i.Vector3)).normalize().multiplyScalar(.07).add(e.getWorldPosition(new i.Vector3));t=e.worldToLocal(n)}else t=new i.Vector3(0,1,0);e.userData[o].bone={length:t.length(),axis:t.normalize()}}),this})}getNode(e){return this.nodes[e]}getNodeByHumanBoneName(e){const t=this.getHumanBone(e);return t&&this.getNode(t.node)}getSubMeshesByIndex(e){return this.meshes[e]}getHumanBone(e){return this.humanoid.humanBones.find(t=>e===t.bone)}setBlendShapeWeight(e,t,n){this.meshes[e].forEach(e=>{e&&e.morphTargetInfluences&&(e.morphTargetInfluences[t]=n)})}setBlendShapeGroupWeight(e,t){const n=this.blendShapeMaster.blendShapeGroups[e];n&&n.binds.forEach(e=>{this.setBlendShapeWeight(e.mesh,e.index,t*(e.weight/100))})}}},function(e,t,n){"use strict";var i=n(0);n.d(t,"a",function(){return o}),Object.assign(i.ShaderChunk,{common_mtoon:"uniform float f_Cutoff;\nuniform vec4 v_Color;\nuniform vec4 v_ShadeColor;\nuniform sampler2D t_MainTex;\nuniform sampler2D t_ShadeTexture;\nuniform float f_BumpScale;\nuniform sampler2D t_BumpMap;\nuniform float f_ReceiveShadowRate;\nuniform sampler2D t_ReceiveShadowTexture;\nuniform float f_ShadeShift;\nuniform float f_ShadeToony;\nuniform float f_LightColorAttenuation;\nuniform sampler2D t_SphereAdd;\nuniform vec4 v_EmissionColor;\nuniform sampler2D t_EmissionMap;\nuniform sampler2D t_OutlineWidthTexture;\nuniform float f_OutlineWidth;\nuniform float f_OutlineScaledMaxDistance;\nuniform vec4 v_OutlineColor;\nuniform float f_OutlineLightingMix;\n\nuniform int f_DebugMode;\nuniform int f_BlendMode;\nuniform int f_OutlineWidthMode;\nuniform int f_OutlineColorMode;\nuniform int f_CullMode; // Cull [0: Off | 1: Front | 2: Back]\nuniform int f_OutlineCullMode;\nuniform float f_SrcBlend; // Blend [SrcFactor] [DstFactor]\nuniform float f_DstBlend; // Blend [SrcFactor] [DstFactor]\nuniform int f_ZWrite; // ZWrite [On | Off]\nuniform int f_IsFirstSetup;\n",lights_mtoon_pars_fragment:"varying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n varying vec3 vNormal;\n\n#endif\n\nstruct BlinnPhongMaterial {\n\n vec3 diffuseColor;\n vec3 specularColor;\n float specularShininess;\n float specularStrength;\n\n};\n\nvoid RE_Direct_BlinnPhong(const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight) {\n\n float dotNL = saturate(dot(geometry.normal, directLight.direction));\n dotNL = saturate(smoothstep(f_ShadeShift, f_ShadeShift + (1.0 + f_ShadeToony), dotNL));\n vec3 irradiance = mix(v_ShadeColor.rgb, vec3(1.0), dotNL);\n\n irradiance = irradiance * mix(directLight.color, vec3(average(directLight.color)), f_LightColorAttenuation);\n\n #ifndef PHYSICALLY_CORRECT_LIGHTS\n\n irradiance *= PI;\n\n #endif\n\n reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert(material.diffuseColor);\n reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong(directLight, geometry, material.specularColor, material.specularShininess) * material.specularStrength;\n\n}\n\nvoid RE_IndirectDiffuse_BlinnPhong(const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight) {\n\n reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert(material.diffuseColor);\n\n}\n\n#define RE_Direct RE_Direct_BlinnPhong\n#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong\n\n#define Material_LightProbeLOD(material) (0)\n"});const r=new Map([["VRM/UnlitTexture",{defines:{},uniforms:Object.assign({},i.ShaderLib.basic.uniforms,{f_Cutoff:{value:0},v_Color:{value:new i.Vector4(1,1,1,1)}}),vertexShader:i.ShaderLib.basic.vertexShader,fragmentShader:i.ShaderLib.basic.fragmentShader,lights:!1}],["VRM/UnlitCutout",{defines:{},uniforms:Object.assign({},i.ShaderLib.basic.uniforms,{f_Cutoff:{value:0},v_Color:{value:new i.Vector4(1,1,1,1)}}),vertexShader:i.ShaderLib.basic.vertexShader,fragmentShader:i.ShaderLib.basic.fragmentShader,lights:!1}],["VRM/UnlitTransparent",{defines:{},uniforms:Object.assign({},i.ShaderLib.basic.uniforms,{f_Cutoff:{value:0},v_Color:{value:new i.Vector4(1,1,1,1)}}),vertexShader:i.ShaderLib.basic.vertexShader,fragmentShader:i.ShaderLib.basic.fragmentShader,lights:!1}],["VRM/UnlitTransparentZWrite",{defines:{},uniforms:Object.assign({},i.ShaderLib.basic.uniforms,{f_Cutoff:{value:0},v_Color:{value:new i.Vector4(1,1,1,1)}}),vertexShader:i.ShaderLib.basic.vertexShader,fragmentShader:i.ShaderLib.basic.fragmentShader,lights:!1}],["VRM/MToon",{defines:{},uniforms:Object.assign({},i.ShaderLib.phong.uniforms,{f_Cutoff:{value:0},v_Color:{value:new i.Vector4(1,1,1,1)}}),vertexShader:"#include <common_mtoon>\n\n// Extend MeshPhongMaterial\n#define PHONG\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n varying vec3 vNormal;\n\n#endif\n\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n #include <uv_vertex>\n #include <uv2_vertex>\n #include <color_vertex>\n\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n\n vNormal = normalize( transformedNormal );\n\n#endif\n\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n\n vViewPosition = - mvPosition.xyz;\n\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n\n}\n",fragmentShader:"#include <common_mtoon>\n\n// Extend MeshPhongMaterial\n#define PHONG\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n// #include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n// #include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\n#include <lights_mtoon_pars_fragment>\n\nvoid main() {\n\n #include <clipping_planes_fragment>\n\n vec4 diffuseColor = vec4(diffuse, opacity);\n ReflectedLight reflectedLight = ReflectedLight(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));\n vec3 totalEmissiveRadiance = emissive;\n\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n\n // accumulation\n #include <lights_phong_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n\n // modulation\n #include <aomap_fragment>\n\n // vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n vec3 outgoingLight = reflectedLight.directDiffuse + totalEmissiveRadiance;\n\n #include <envmap_fragment>\n\n // outgoingLight = mix(v_ShadeColor.rgb, diffuseColor.rgb, saturate(outgoingLight / diffuseColor.rgb));\n outgoingLight = clamp(outgoingLight, 0.0, 1.0);\n\n // MToon additive matcap\n vec3 viewNormal = normalize(normal);\n vec2 rimUv = vec2(dot(vec3(1.0, 0.0, 0.0), normal), -dot(vec3(0.0, 1.0, 0.0), normal)) * 0.5 + 0.5;\n vec4 rimColor = texture2D(t_SphereAdd, rimUv);\n outgoingLight += rimColor.rgb;\n\n gl_FragColor = vec4(outgoingLight, diffuseColor.a);\n\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n\n}\n",lights:!0}]]),a=new Map([["common",e=>{e.uniforms.f_Cutoff&&(e.defines.ALPHATEST=e.uniforms.f_Cutoff.value.toFixed(6));const t=e.uniforms.v_Color.value;e.uniforms.diffuse={value:new i.Color(t.x,t.y,t.z)},e.uniforms.opacity={value:t.w},e.uniforms.t_MainTex&&(e.map=e.uniforms.t_MainTex.value,e.uniforms.map=e.uniforms.t_MainTex)}],["VRM/UnlitTexture",e=>null],["VRM/UnlitCutout",e=>null],["VRM/UnlitTransparent",e=>{e.transparent=!0}],["VRM/UnlitTransparentZWrite",e=>{e.transparent=!0}],["VRM/MToon",e=>{switch(e.uniforms.t_SphereAdd||(e.uniforms.t_SphereAdd={value:new i.DataTexture(new Uint8Array(3),1,1,i.RGBFormat)}),e.uniforms.shininess={value:0},e.userData.RenderType.value){case"Opaque":delete e.defines.ALPHATEST;break;case"Cutout":break;case"Transparent":delete e.defines.ALPHATEST,e.transparent=!0;break;case"TransparentCutout":e.transparent=!0}if(e.uniforms.f_BumpScale){const t=new i.Vector2(1,1).multiplyScalar(e.uniforms.f_BumpScale.value);e.normalScale=t,e.uniforms.normalScale={value:t}}if(e.uniforms.t_BumpMap&&(e.normalMap=e.uniforms.t_BumpMap.value,e.uniforms.normalMap=e.uniforms.t_BumpMap),e.uniforms.v_EmissionColor&&(e.emissive=e.uniforms.v_EmissionColor.value,e.uniforms.emissive=e.uniforms.v_EmissionColor),e.uniforms.t_EmissionMap&&(e.emissiveMap=e.uniforms.t_EmissionMap.value,e.uniforms.emissiveMap=e.uniforms.t_EmissionMap),e.uniforms.f_CullMode)switch(e.uniforms.f_CullMode.value){case 0:e.side=i.DoubleSide;break;case 1:e.side=i.BackSide;break;case 2:e.side=i.FrontSide}}]]);class o extends i.ShaderMaterial{constructor(e){super(e),Object.assign(this.uniforms,{v_Color:{value:new i.Vector4(1,0,1,1)}}),this.vertexShader=i.ShaderLib.basic.vertexShader,this.fragmentShader=i.ShaderLib.basic.fragmentShader,a.get("common")(this)}fromMaterialProperty(e,t){if(this.name=e.name,!r.has(e.shader)||!a.has(e.shader))return;const n=r.get(e.shader),o={},s={};for(const t of Object.keys(e.floatProperties))s["f"+t]={value:e.floatProperties[t]};for(const t of Object.keys(e.vectorProperties)){const n=e.vectorProperties[t].concat();n.length=4,s["v"+t]={value:(new i.Vector4).fromArray(n)}}for(const n of Object.keys(e.textureProperties))void 0!==t[e.textureProperties[n]]&&(s["t"+n]={value:t[e.textureProperties[n]]});for(const t of Object.keys(e.keywordMap))o[t]=e.keywordMap[t];for(const t of Object.keys(e.tagMap))this.userData[t]={value:e.tagMap[t]};Object.assign(this.defines,n.defines),Object.assign(this.defines,o),Object.assign(this.uniforms,n.uniforms),Object.assign(this.uniforms,s),this.vertexShader=n.vertexShader,this.fragmentShader=n.fragmentShader,this.lights=n.lights,a.get("common")(this),a.get(e.shader)(this)}}},function(e,t){},function(e,t){},function(e,t,n){"use strict";var i=n(3);n.d(t,"a",function(){return i.a})},function(e,t,n){"use strict";var i=n(10),r=n(0),a=n(1);class o{constructor(e){this.fileLoader=new r.FileLoader(e)}load(e,t,n,r){this.fileLoader.setResponseType("arraybuffer"),this.fileLoader.load(e,e=>{const n=(new i.Parser).parseVmd(e,!0);t((new a.VMD).fromObject(n))},n,r)}}function s(){}void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}),void 0===Math.sign&&(Math.sign=function(e){return e<0?-1:e>0?1:+e}),"name"in Function.prototype==!1&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var i=arguments[n];if(null!=i)for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t}),Object.assign(s.prototype,{addEventListener:function(e,t){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)},hasEventListener:function(e,t){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)},removeEventListener:function(e,t){if(void 0!==this._listeners){var n=this._listeners[e];if(void 0!==n){var i=n.indexOf(t);-1!==i&&n.splice(i,1)}}},dispatchEvent:function(e){if(void 0!==this._listeners){var t=this._listeners[e.type];if(void 0!==t){e.target=this;for(var n=t.slice(0),i=0,r=n.length;i<r;i++)n[i].call(this,e)}}}});var c,l,h,u,p,d="103",f=0,m=1,g=2,v=1,y=2,x=0,b=1,w=2,_=0,M=1,S=2,T=0,E=1,A=2,L=3,R=4,P=5,C=100,I=101,O=102,D=103,N=104,U=200,B=201,F=202,z=203,G=204,H=205,V=206,k=207,j=208,W=209,q=210,X=0,Y=1,J=2,Z=3,K=4,Q=5,$=6,ee=7,te=0,ne=1,ie=2,re=0,ae=1,oe=2,se=3,ce=4,le=5,he=301,ue=302,pe=303,de=304,fe=305,me=306,ge=307,ve=1e3,ye=1001,xe=1002,be=1003,we=1004,_e=1005,Me=1006,Se=1007,Te=1008,Ee=1009,Ae=1010,Le=1011,Re=1012,Pe=1013,Ce=1014,Ie=1015,Oe=1016,De=1017,Ne=1018,Ue=1019,Be=1020,Fe=1021,ze=1022,Ge=1023,He=1024,Ve=1025,ke=1026,je=1027,We=1028,qe=33776,Xe=33777,Ye=33778,Je=33779,Ze=35840,Ke=35841,Qe=35842,$e=35843,et=36196,tt=37808,nt=37809,it=37810,rt=37811,at=37812,ot=37813,st=37814,ct=37815,lt=37816,ht=37817,ut=37818,pt=37819,dt=37820,ft=37821,mt=2201,gt=2400,vt=0,yt=1,xt=2,bt=3e3,wt=3001,_t=3007,Mt=3002,St=3004,Tt=3005,Et=3006,At=3200,Lt=3201,Rt=0,Pt=1,Ct={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){for(var e=[],t=0;t<256;t++)e[t]=(t<16?"0":"")+t.toString(16);return function(){var t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,i=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(e[255&t]+e[t>>8&255]+e[t>>16&255]+e[t>>24&255]+"-"+e[255&n]+e[n>>8&255]+"-"+e[n>>16&15|64]+e[n>>24&255]+"-"+e[63&i|128]+e[i>>8&255]+"-"+e[i>>16&255]+e[i>>24&255]+e[255&r]+e[r>>8&255]+e[r>>16&255]+e[r>>24&255]).toUpperCase()}}(),clamp:function(e,t,n){return Math.max(t,Math.min(n,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,n,i,r){return i+(e-t)*(r-i)/(n-t)},lerp:function(e,t,n){return(1-n)*e+n*t},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},degToRad:function(e){return e*Ct.DEG2RAD},radToDeg:function(e){return e*Ct.RAD2DEG},isPowerOfTwo:function(e){return 0==(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}};function It(e,t){this.x=e||0,this.y=t||0}function Ot(e,t,n,i){this._x=e||0,this._y=t||0,this._z=n||0,this._w=void 0!==i?i:1}function Dt(e,t,n){this.x=e||0,this.y=t||0,this.z=n||0}function Nt(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}Object.defineProperties(It.prototype,{width:{get:function(){return this.x},set:function(e){this.x=e}},height:{get:function(){return this.y},set:function(e){this.y=e}}}),Object.assign(It.prototype,{isVector2:!0,set:function(e,t){return this.x=e,this.y=t,this},setScalar:function(e){return this.x=e,this.y=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(e){return this.x=e.x,this.y=e.y,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)},addScalar:function(e){return this.x+=e,this.y+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)},subScalar:function(e){return this.x-=e,this.y-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this},multiply:function(e){return this.x*=e.x,this.y*=e.y,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return this.x/=e.x,this.y/=e.y,this},divideScalar:function(e){return this.multiplyScalar(1/e)},applyMatrix3:function(e){var t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this},clampScalar:(c=new It,l=new It,function(e,t){return c.set(e,e),l.set(t,t),this.clamp(c,l)}),clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(e){return this.x*e.x+this.y*e.y},cross:function(e){return this.x*e.y-this.y*e.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var e=Math.atan2(this.y,this.x);return e<0&&(e+=2*Math.PI),e},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this},rotateAround:function(e,t){var n=Math.cos(t),i=Math.sin(t),r=this.x-e.x,a=this.y-e.y;return this.x=r*n-a*i+e.x,this.y=r*i+a*n+e.y,this}}),Object.assign(Ot,{slerp:function(e,t,n,i){return n.copy(e).slerp(t,i)},slerpFlat:function(e,t,n,i,r,a,o){var s=n[i+0],c=n[i+1],l=n[i+2],h=n[i+3],u=r[a+0],p=r[a+1],d=r[a+2],f=r[a+3];if(h!==f||s!==u||c!==p||l!==d){var m=1-o,g=s*u+c*p+l*d+h*f,v=g>=0?1:-1,y=1-g*g;if(y>Number.EPSILON){var x=Math.sqrt(y),b=Math.atan2(x,g*v);m=Math.sin(m*b)/x,o=Math.sin(o*b)/x}var w=o*v;if(s=s*m+u*w,c=c*m+p*w,l=l*m+d*w,h=h*m+f*w,m===1-o){var _=1/Math.sqrt(s*s+c*c+l*l+h*h);s*=_,c*=_,l*=_,h*=_}}e[t]=s,e[t+1]=c,e[t+2]=l,e[t+3]=h}}),Object.defineProperties(Ot.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this.onChangeCallback()}},w:{get:function(){return this._w},set:function(e){this._w=e,this.onChangeCallback()}}}),Object.assign(Ot.prototype,{isQuaternion:!0,set:function(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this.onChangeCallback(),this},setFromEuler:function(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=e._x,i=e._y,r=e._z,a=e.order,o=Math.cos,s=Math.sin,c=o(n/2),l=o(i/2),h=o(r/2),u=s(n/2),p=s(i/2),d=s(r/2);return"XYZ"===a?(this._x=u*l*h+c*p*d,this._y=c*p*h-u*l*d,this._z=c*l*d+u*p*h,this._w=c*l*h-u*p*d):"YXZ"===a?(this._x=u*l*h+c*p*d,this._y=c*p*h-u*l*d,this._z=c*l*d-u*p*h,this._w=c*l*h+u*p*d):"ZXY"===a?(this._x=u*l*h-c*p*d,this._y=c*p*h+u*l*d,this._z=c*l*d+u*p*h,this._w=c*l*h-u*p*d):"ZYX"===a?(this._x=u*l*h-c*p*d,this._y=c*p*h+u*l*d,this._z=c*l*d-u*p*h,this._w=c*l*h+u*p*d):"YZX"===a?(this._x=u*l*h+c*p*d,this._y=c*p*h+u*l*d,this._z=c*l*d-u*p*h,this._w=c*l*h-u*p*d):"XZY"===a&&(this._x=u*l*h-c*p*d,this._y=c*p*h-u*l*d,this._z=c*l*d+u*p*h,this._w=c*l*h+u*p*d),!1!==t&&this.onChangeCallback(),this},setFromAxisAngle:function(e,t){var n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this.onChangeCallback(),this},setFromRotationMatrix:function(e){var t,n=e.elements,i=n[0],r=n[4],a=n[8],o=n[1],s=n[5],c=n[9],l=n[2],h=n[6],u=n[10],p=i+s+u;return p>0?(t=.5/Math.sqrt(p+1),this._w=.25/t,this._x=(h-c)*t,this._y=(a-l)*t,this._z=(o-r)*t):i>s&&i>u?(t=2*Math.sqrt(1+i-s-u),this._w=(h-c)/t,this._x=.25*t,this._y=(r+o)/t,this._z=(a+l)/t):s>u?(t=2*Math.sqrt(1+s-i-u),this._w=(a-l)/t,this._x=(r+o)/t,this._y=.25*t,this._z=(c+h)/t):(t=2*Math.sqrt(1+u-i-s),this._w=(o-r)/t,this._x=(a+l)/t,this._y=(c+h)/t,this._z=.25*t),this.onChangeCallback(),this},setFromUnitVectors:function(e,t){var n=e.dot(t)+1;return n<1e-6?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()},angleTo:function(e){return 2*Math.acos(Math.abs(Ct.clamp(this.dot(e),-1,1)))},rotateTowards:function(e,t){var n=this.angleTo(e);if(0===n)return this;var i=Math.min(1,t/n);return this.slerp(e,i),this},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this.onChangeCallback(),this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)},premultiply:function(e){return this.multiplyQuaternions(e,this)},multiplyQuaternions:function(e,t){var n=e._x,i=e._y,r=e._z,a=e._w,o=t._x,s=t._y,c=t._z,l=t._w;return this._x=n*l+a*o+i*c-r*s,this._y=i*l+a*s+r*o-n*c,this._z=r*l+a*c+n*s-i*o,this._w=a*l-n*o-i*s-r*c,this.onChangeCallback(),this},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var n=this._x,i=this._y,r=this._z,a=this._w,o=a*e._w+n*e._x+i*e._y+r*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=n,this._y=i,this._z=r,this;var s=1-o*o;if(s<=Number.EPSILON){var c=1-t;return this._w=c*a+t*this._w,this._x=c*n+t*this._x,this._y=c*i+t*this._y,this._z=c*r+t*this._z,this.normalize()}var l=Math.sqrt(s),h=Math.atan2(l,o),u=Math.sin((1-t)*h)/l,p=Math.sin(t*h)/l;return this._w=a*u+this._w*p,this._x=n*u+this._x*p,this._y=i*u+this._y*p,this._z=r*u+this._z*p,this.onChangeCallback(),this},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},fromArray:function(e,t){return void 0===t&&(t=0),this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this.onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e},onChange:function(e){return this.onChangeCallback=e,this},onChangeCallback:function(){}}),Object.assign(Dt.prototype,{isVector3:!0,set:function(e,t,n){return this.x=e,this.y=t,this.z=n,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this},multiplyVectors:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this},applyEuler:(u=new Ot,function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(u.setFromEuler(e))}),applyAxisAngle:function(){var e=new Ot;return function(t,n){return this.applyQuaternion(e.setFromAxisAngle(t,n))}}(),applyMatrix3:function(e){var t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6]*i,this.y=r[1]*t+r[4]*n+r[7]*i,this.z=r[2]*t+r[5]*n+r[8]*i,this},applyMatrix4:function(e){var t=this.x,n=this.y,i=this.z,r=e.elements,a=1/(r[3]*t+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*t+r[4]*n+r[8]*i+r[12])*a,this.y=(r[1]*t+r[5]*n+r[9]*i+r[13])*a,this.z=(r[2]*t+r[6]*n+r[10]*i+r[14])*a,this},applyQuaternion:function(e){var t=this.x,n=this.y,i=this.z,r=e.x,a=e.y,o=e.z,s=e.w,c=s*t+a*i-o*n,l=s*n+o*t-r*i,h=s*i+r*n-a*t,u=-r*t-a*n-o*i;return this.x=c*s+u*-r+l*-o-h*-a,this.y=l*s+u*-a+h*-r-c*-o,this.z=h*s+u*-o+c*-a-l*-r,this},project:function(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)},unproject:function(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)},transformDirection:function(e){var t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[4]*n+r[8]*i,this.y=r[1]*t+r[5]*n+r[9]*i,this.z=r[2]*t+r[6]*n+r[10]*i,this.normalize()},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},divideScalar:function(e){return this.multiplyScalar(1/e)},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this},clampScalar:function(){var e=new Dt,t=new Dt;return function(n,i){return e.set(n,n,n),t.set(i,i,i),this.clamp(e,t)}}(),clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},cross:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)},crossVectors:function(e,t){var n=e.x,i=e.y,r=e.z,a=t.x,o=t.y,s=t.z;return this.x=i*s-r*o,this.y=r*a-n*s,this.z=n*o-i*a,this},projectOnVector:function(e){var t=e.dot(this)/e.lengthSq();return this.copy(e).multiplyScalar(t)},projectOnPlane:(h=new Dt,function(e){return h.copy(this).projectOnVector(e),this.sub(h)}),reflect:function(){var e=new Dt;return function(t){return this.sub(e.copy(t).multiplyScalar(2*this.dot(t)))}}(),angleTo:function(e){var t=this.dot(e)/Math.sqrt(this.lengthSq()*e.lengthSq());return Math.acos(Ct.clamp(t,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)},setFromSpherical:function(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)},setFromSphericalCoords:function(e,t,n){var i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this},setFromCylindrical:function(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)},setFromCylindricalCoords:function(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this},setFromMatrixPosition:function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this},setFromMatrixScale:function(e){var t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this},setFromMatrixColumn:function(e,t){return this.fromArray(e.elements,4*t)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}}),Object.assign(Nt.prototype,{isMatrix3:!0,set:function(e,t,n,i,r,a,o,s,c){var l=this.elements;return l[0]=e,l[1]=i,l[2]=o,l[3]=t,l[4]=r,l[5]=s,l[6]=n,l[7]=a,l[8]=c,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this},setFromMatrix4:function(e){var t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this},applyToBufferAttribute:function(){var e=new Dt;return function(t){for(var n=0,i=t.count;n<i;n++)e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.applyMatrix3(this),t.setXYZ(n,e.x,e.y,e.z);return t}}(),multiply:function(e){return this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,i=t.elements,r=this.elements,a=n[0],o=n[3],s=n[6],c=n[1],l=n[4],h=n[7],u=n[2],p=n[5],d=n[8],f=i[0],m=i[3],g=i[6],v=i[1],y=i[4],x=i[7],b=i[2],w=i[5],_=i[8];return r[0]=a*f+o*v+s*b,r[3]=a*m+o*y+s*w,r[6]=a*g+o*x+s*_,r[1]=c*f+l*v+h*b,r[4]=c*m+l*y+h*w,r[7]=c*g+l*x+h*_,r[2]=u*f+p*v+d*b,r[5]=u*m+p*y+d*w,r[8]=u*g+p*x+d*_,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this},determinant:function(){var e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8];return t*a*l-t*o*c-n*r*l+n*o*s+i*r*c-i*a*s},getInverse:function(e,t){e&&e.isMatrix4&&console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");var n=e.elements,i=this.elements,r=n[0],a=n[1],o=n[2],s=n[3],c=n[4],l=n[5],h=n[6],u=n[7],p=n[8],d=p*c-l*u,f=l*h-p*s,m=u*s-c*h,g=r*d+a*f+o*m;if(0===g){var v="THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0";if(!0===t)throw new Error(v);return console.warn(v),this.identity()}var y=1/g;return i[0]=d*y,i[1]=(o*u-p*a)*y,i[2]=(l*a-o*c)*y,i[3]=f*y,i[4]=(p*r-o*h)*y,i[5]=(o*s-l*r)*y,i[6]=m*y,i[7]=(a*h-u*r)*y,i[8]=(c*r-a*s)*y,this},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this},getNormalMatrix:function(e){return this.setFromMatrix4(e).getInverse(this).transpose()},transposeIntoArray:function(e){var t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this},setUvTransform:function(e,t,n,i,r,a,o){var s=Math.cos(r),c=Math.sin(r);this.set(n*s,n*c,-n*(s*a+c*o)+a+e,-i*c,i*s,-i*(-c*a+s*o)+o+t,0,0,1)},scale:function(e,t){var n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this},rotate:function(e){var t=Math.cos(e),n=Math.sin(e),i=this.elements,r=i[0],a=i[3],o=i[6],s=i[1],c=i[4],l=i[7];return i[0]=t*r+n*s,i[3]=t*a+n*c,i[6]=t*o+n*l,i[1]=-n*r+t*s,i[4]=-n*a+t*c,i[7]=-n*o+t*l,this},translate:function(e,t){var n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this},equals:function(e){for(var t=this.elements,n=e.elements,i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var n=0;n<9;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}});var Ut,Bt,Ft,zt,Gt,Ht,Vt,kt,jt,Wt,qt,Xt,Yt={getDataURL:function(e){var t;if("undefined"==typeof HTMLCanvasElement)return e.src;if(e instanceof HTMLCanvasElement)t=e;else{void 0===p&&(p=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),p.width=e.width,p.height=e.height;var n=p.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=p}return t.width>2048||t.height>2048?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}},Jt=0;function Zt(e,t,n,i,r,a,o,s,c,l){Object.defineProperty(this,"id",{value:Jt++}),this.uuid=Ct.generateUUID(),this.name="",this.image=void 0!==e?e:Zt.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==t?t:Zt.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:ye,this.wrapT=void 0!==i?i:ye,this.magFilter=void 0!==r?r:Me,this.minFilter=void 0!==a?a:Te,this.anisotropy=void 0!==c?c:1,this.format=void 0!==o?o:Ge,this.type=void 0!==s?s:Ee,this.offset=new It(0,0),this.repeat=new It(1,1),this.center=new It(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Nt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==l?l:bt,this.version=0,this.onUpdate=null}function Kt(e,t,n,i){this.x=e||0,this.y=t||0,this.z=n||0,this.w=void 0!==i?i:1}function Qt(e,t,n){this.width=e,this.height=t,this.scissor=new Kt(0,0,e,t),this.scissorTest=!1,this.viewport=new Kt(0,0,e,t),n=n||{},this.texture=new Zt(void 0,void 0,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:Me,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0===n.stencilBuffer||n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}function $t(e,t,n){Qt.call(this,e,t,n),this.samples=4}function en(e,t,n){Qt.call(this,e,t,n)}function tn(e,t,n,i,r,a,o,s,c,l,h,u){Zt.call(this,null,a,o,s,c,l,i,r,h,u),this.image={data:e,width:t,height:n},this.magFilter=void 0!==c?c:be,this.minFilter=void 0!==l?l:be,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}function nn(e,t){this.min=void 0!==e?e:new Dt(1/0,1/0,1/0),this.max=void 0!==t?t:new Dt(-1/0,-1/0,-1/0)}function rn(e,t){this.center=void 0!==e?e:new Dt,this.radius=void 0!==t?t:0}function an(e,t){this.normal=void 0!==e?e:new Dt(1,0,0),this.constant=void 0!==t?t:0}function on(e,t,n,i,r,a){this.planes=[void 0!==e?e:new an,void 0!==t?t:new an,void 0!==n?n:new an,void 0!==i?i:new an,void 0!==r?r:new an,void 0!==a?a:new an]}function sn(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}Zt.DEFAULT_IMAGE=void 0,Zt.DEFAULT_MAPPING=300,Zt.prototype=Object.assign(Object.create(s.prototype),{constructor:Zt,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){var t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];var n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var i=this.image;if(void 0===i.uuid&&(i.uuid=Ct.generateUUID()),!t&&void 0===e.images[i.uuid]){var r;if(Array.isArray(i)){r=[];for(var a=0,o=i.length;a<o;a++)r.push(Yt.getDataURL(i[a]))}else r=Yt.getDataURL(i);e.images[i.uuid]={uuid:i.uuid,url:r}}n.image=i.uuid}return t||(e.textures[this.uuid]=n),n},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(e){if(300!==this.mapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case ve:e.x=e.x-Math.floor(e.x);break;case ye:e.x=e.x<0?0:1;break;case xe:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case ve:e.y=e.y-Math.floor(e.y);break;case ye:e.y=e.y<0?0:1;break;case xe:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}}),Object.defineProperty(Zt.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(Kt.prototype,{isVector4:!0,set:function(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setW:function(e){return this.w=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},applyMatrix4:function(e){var t=this.x,n=this.y,i=this.z,r=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*i+a[12]*r,this.y=a[1]*t+a[5]*n+a[9]*i+a[13]*r,this.z=a[2]*t+a[6]*n+a[10]*i+a[14]*r,this.w=a[3]*t+a[7]*n+a[11]*i+a[15]*r,this},divideScalar:function(e){return this.multiplyScalar(1/e)},setAxisAngleFromQuaternion:function(e){this.w=2*Math.acos(e.w);var t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this},setAxisAngleFromRotationMatrix:function(e){var t,n,i,r,a=e.elements,o=a[0],s=a[4],c=a[8],l=a[1],h=a[5],u=a[9],p=a[2],d=a[6],f=a[10];if(Math.abs(s-l)<.01&&Math.abs(c-p)<.01&&Math.abs(u-d)<.01){if(Math.abs(s+l)<.1&&Math.abs(c+p)<.1&&Math.abs(u+d)<.1&&Math.abs(o+h+f-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;var m=(o+1)/2,g=(h+1)/2,v=(f+1)/2,y=(s+l)/4,x=(c+p)/4,b=(u+d)/4;return m>g&&m>v?m<.01?(n=0,i=.707106781,r=.707106781):(i=y/(n=Math.sqrt(m)),r=x/n):g>v?g<.01?(n=.707106781,i=0,r=.707106781):(n=y/(i=Math.sqrt(g)),r=b/i):v<.01?(n=.707106781,i=.707106781,r=0):(n=x/(r=Math.sqrt(v)),i=b/r),this.set(n,i,r,t),this}var w=Math.sqrt((d-u)*(d-u)+(c-p)*(c-p)+(l-s)*(l-s));return Math.abs(w)<.001&&(w=1),this.x=(d-u)/w,this.y=(c-p)/w,this.z=(l-s)/w,this.w=Math.acos((o+h+f-1)/2),this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this},clampScalar:function(){var e,t;return function(n,i){return void 0===e&&(e=new Kt,t=new Kt),e.set(n,n,n,n),t.set(i,i,i,i),this.clamp(e,t)}}(),clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}}),Qt.prototype=Object.assign(Object.create(s.prototype),{constructor:Qt,isWebGLRenderTarget:!0,setSize:function(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.width=e.width,this.height=e.height,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),$t.prototype=Object.assign(Object.create(Qt.prototype),{constructor:$t,isWebGLMultisampleRenderTarget:!0,copy:function(e){return Qt.prototype.copy.call(this,e),this.samples=e.samples,this}}),en.prototype=Object.create(Qt.prototype),en.prototype.constructor=en,en.prototype.isWebGLRenderTargetCube=!0,tn.prototype=Object.create(Zt.prototype),tn.prototype.constructor=tn,tn.prototype.isDataTexture=!0,Object.assign(nn.prototype,{isBox3:!0,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromArray:function(e){for(var t=1/0,n=1/0,i=1/0,r=-1/0,a=-1/0,o=-1/0,s=0,c=e.length;s<c;s+=3){var l=e[s],h=e[s+1],u=e[s+2];l<t&&(t=l),h<n&&(n=h),u<i&&(i=u),l>r&&(r=l),h>a&&(a=h),u>o&&(o=u)}return this.min.set(t,n,i),this.max.set(r,a,o),this},setFromBufferAttribute:function(e){for(var t=1/0,n=1/0,i=1/0,r=-1/0,a=-1/0,o=-1/0,s=0,c=e.count;s<c;s++){var l=e.getX(s),h=e.getY(s),u=e.getZ(s);l<t&&(t=l),h<n&&(n=h),u<i&&(i=u),l>r&&(r=l),h>a&&(a=h),u>o&&(o=u)}return this.min.set(t,n,i),this.max.set(r,a,o),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(){var e=new Dt;return function(t,n){var i=e.copy(n).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this}}(),setFromObject:function(e){return this.makeEmpty(),this.expandByObject(e)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(e){return void 0===e&&(console.warn("THREE.Box3: .getCenter() target is now required"),e=new Dt),this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){return void 0===e&&(console.warn("THREE.Box3: .getSize() target is now required"),e=new Dt),this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},expandByObject:function(){var e,t,n,i=new Dt;function r(r){var a=r.geometry;if(void 0!==a)if(a.isGeometry){var o=a.vertices;for(t=0,n=o.length;t<n;t++)i.copy(o[t]),i.applyMatrix4(r.matrixWorld),e.expandByPoint(i)}else if(a.isBufferGeometry){var s=a.attributes.position;if(void 0!==s)for(t=0,n=s.count;t<n;t++)i.fromBufferAttribute(s,t).applyMatrix4(r.matrixWorld),e.expandByPoint(i)}}return function(t){return e=this,t.updateMatrixWorld(!0),t.traverse(r),this}}(),containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z},getParameter:function(e,t){return void 0===t&&(console.warn("THREE.Box3: .getParameter() target is now required"),t=new Dt),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)},intersectsSphere:(Bt=new Dt,function(e){return this.clampPoint(e.center,Bt),Bt.distanceToSquared(e.center)<=e.radius*e.radius}),intersectsPlane:function(e){var t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant},intersectsTriangle:function(){var e=new Dt,t=new Dt,n=new Dt,i=new Dt,r=new Dt,a=new Dt,o=new Dt,s=new Dt,c=new Dt,l=new Dt;function h(i){var r,a;for(r=0,a=i.length-3;r<=a;r+=3){o.fromArray(i,r);var s=c.x*Math.abs(o.x)+c.y*Math.abs(o.y)+c.z*Math.abs(o.z),l=e.dot(o),h=t.dot(o),u=n.dot(o);if(Math.max(-Math.max(l,h,u),Math.min(l,h,u))>s)return!1}return!0}return function(o){if(this.isEmpty())return!1;this.getCenter(s),c.subVectors(this.max,s),e.subVectors(o.a,s),t.subVectors(o.b,s),n.subVectors(o.c,s),i.subVectors(t,e),r.subVectors(n,t),a.subVectors(e,n);var u=[0,-i.z,i.y,0,-r.z,r.y,0,-a.z,a.y,i.z,0,-i.x,r.z,0,-r.x,a.z,0,-a.x,-i.y,i.x,0,-r.y,r.x,0,-a.y,a.x,0];return!!h(u)&&(!!h(u=[1,0,0,0,1,0,0,0,1])&&(l.crossVectors(i,r),h(u=[l.x,l.y,l.z])))}}(),clampPoint:function(e,t){return void 0===t&&(console.warn("THREE.Box3: .clampPoint() target is now required"),t=new Dt),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new Dt;return function(t){return e.copy(t).clamp(this.min,this.max).sub(t).length()}}(),getBoundingSphere:function(){var e=new Dt;return function(t){return void 0===t&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(t.center),t.radius=.5*this.getSize(e).length(),t}}(),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},applyMatrix4:(Ut=[new Dt,new Dt,new Dt,new Dt,new Dt,new Dt,new Dt,new Dt],function(e){return this.isEmpty()?this:(Ut[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Ut[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Ut[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Ut[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Ut[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Ut[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Ut[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Ut[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Ut),this)}),translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}),Object.assign(rn.prototype,{set:function(e,t){return this.center.copy(e),this.radius=t,this},setFromPoints:(Ft=new nn,function(e,t){var n=this.center;void 0!==t?n.copy(t):Ft.setFromPoints(e).getCenter(n);for(var i=0,r=0,a=e.length;r<a;r++)i=Math.max(i,n.distanceToSquared(e[r]));return this.radius=Math.sqrt(i),this}),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.center.copy(e.center),this.radius=e.radius,this},empty:function(){return this.radius<=0},containsPoint:function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(e){return e.distanceTo(this.center)-this.radius},intersectsSphere:function(e){var t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t},intersectsBox:function(e){return e.intersectsSphere(this)},intersectsPlane:function(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius},clampPoint:function(e,t){var n=this.center.distanceToSquared(e);return void 0===t&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),t=new Dt),t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t},getBoundingBox:function(e){return void 0===e&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),e=new nn),e.set(this.center,this.center),e.expandByScalar(this.radius),e},applyMatrix4:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this},translate:function(e){return this.center.add(e),this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius}}),Object.assign(an.prototype,{set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(){var e=new Dt,t=new Dt;return function(n,i,r){var a=e.subVectors(r,i).cross(t.subVectors(n,i)).normalize();return this.setFromNormalAndCoplanarPoint(a,n),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this},normalize:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(e){return this.normal.dot(e)+this.constant},distanceToSphere:function(e){return this.distanceToPoint(e.center)-e.radius},projectPoint:function(e,t){return void 0===t&&(console.warn("THREE.Plane: .projectPoint() target is now required"),t=new Dt),t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)},intersectLine:function(){var e=new Dt;return function(t,n){void 0===n&&(console.warn("THREE.Plane: .intersectLine() target is now required"),n=new Dt);var i=t.delta(e),r=this.normal.dot(i);if(0===r)return 0===this.distanceToPoint(t.start)?n.copy(t.start):void 0;var a=-(t.start.dot(this.normal)+this.constant)/r;return a<0||a>1?void 0:n.copy(i).multiplyScalar(a).add(t.start)}}(),intersectsLine:function(e){var t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0},intersectsBox:function(e){return e.intersectsPlane(this)},intersectsSphere:function(e){return e.intersectsPlane(this)},coplanarPoint:function(e){return void 0===e&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),e=new Dt),e.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var e=new Dt,t=new Nt;return function(n,i){var r=i||t.getNormalMatrix(n),a=this.coplanarPoint(e).applyMatrix4(n),o=this.normal.applyMatrix3(r).normalize();return this.constant=-a.dot(o),this}}(),translate:function(e){return this.constant-=e.dot(this.normal),this},equals:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}}),Object.assign(on.prototype,{set:function(e,t,n,i,r,a){var o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(i),o[4].copy(r),o[5].copy(a),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){for(var t=this.planes,n=0;n<6;n++)t[n].copy(e.planes[n]);return this},setFromMatrix:function(e){var t=this.planes,n=e.elements,i=n[0],r=n[1],a=n[2],o=n[3],s=n[4],c=n[5],l=n[6],h=n[7],u=n[8],p=n[9],d=n[10],f=n[11],m=n[12],g=n[13],v=n[14],y=n[15];return t[0].setComponents(o-i,h-s,f-u,y-m).normalize(),t[1].setComponents(o+i,h+s,f+u,y+m).normalize(),t[2].setComponents(o+r,h+c,f+p,y+g).normalize(),t[3].setComponents(o-r,h-c,f-p,y-g).normalize(),t[4].setComponents(o-a,h-l,f-d,y-v).normalize(),t[5].setComponents(o+a,h+l,f+d,y+v).normalize(),this},intersectsObject:(Gt=new rn,function(e){var t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),Gt.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(Gt)}),intersectsSprite:function(){var e=new rn;return function(t){return e.center.set(0,0,0),e.radius=.7071067811865476,e.applyMatrix4(t.matrixWorld),this.intersectsSphere(e)}}(),intersectsSphere:function(e){for(var t=this.planes,n=e.center,i=-e.radius,r=0;r<6;r++){if(t[r].distanceToPoint(n)<i)return!1}return!0},intersectsBox:(zt=new Dt,function(e){for(var t=this.planes,n=0;n<6;n++){var i=t[n];if(zt.x=i.normal.x>0?e.max.x:e.min.x,zt.y=i.normal.y>0?e.max.y:e.min.y,zt.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(zt)<0)return!1}return!0}),containsPoint:function(e){for(var t=this.planes,n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}}),Object.assign(sn.prototype,{isMatrix4:!0,set:function(e,t,n,i,r,a,o,s,c,l,h,u,p,d,f,m){var g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=i,g[1]=r,g[5]=a,g[9]=o,g[13]=s,g[2]=c,g[6]=l,g[10]=h,g[14]=u,g[3]=p,g[7]=d,g[11]=f,g[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new sn).fromArray(this.elements)},copy:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this},copyPosition:function(e){var t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this},extractBasis:function(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis:function(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this},extractRotation:function(){var e=new Dt;return function(t){var n=this.elements,i=t.elements,r=1/e.setFromMatrixColumn(t,0).length(),a=1/e.setFromMatrixColumn(t,1).length(),o=1/e.setFromMatrixColumn(t,2).length();return n[0]=i[0]*r,n[1]=i[1]*r,n[2]=i[2]*r,n[3]=0,n[4]=i[4]*a,n[5]=i[5]*a,n[6]=i[6]*a,n[7]=0,n[8]=i[8]*o,n[9]=i[9]*o,n[10]=i[10]*o,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}}(),makeRotationFromEuler:function(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,n=e.x,i=e.y,r=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(i),c=Math.sin(i),l=Math.cos(r),h=Math.sin(r);if("XYZ"===e.order){var u=a*l,p=a*h,d=o*l,f=o*h;t[0]=s*l,t[4]=-s*h,t[8]=c,t[1]=p+d*c,t[5]=u-f*c,t[9]=-o*s,t[2]=f-u*c,t[6]=d+p*c,t[10]=a*s}else if("YXZ"===e.order){var m=s*l,g=s*h,v=c*l,y=c*h;t[0]=m+y*o,t[4]=v*o-g,t[8]=a*c,t[1]=a*h,t[5]=a*l,t[9]=-o,t[2]=g*o-v,t[6]=y+m*o,t[10]=a*s}else if("ZXY"===e.order){m=s*l,g=s*h,v=c*l,y=c*h;t[0]=m-y*o,t[4]=-a*h,t[8]=v+g*o,t[1]=g+v*o,t[5]=a*l,t[9]=y-m*o,t[2]=-a*c,t[6]=o,t[10]=a*s}else if("ZYX"===e.order){u=a*l,p=a*h,d=o*l,f=o*h;t[0]=s*l,t[4]=d*c-p,t[8]=u*c+f,t[1]=s*h,t[5]=f*c+u,t[9]=p*c-d,t[2]=-c,t[6]=o*s,t[10]=a*s}else if("YZX"===e.order){var x=a*s,b=a*c,w=o*s,_=o*c;t[0]=s*l,t[4]=_-x*h,t[8]=w*h+b,t[1]=h,t[5]=a*l,t[9]=-o*l,t[2]=-c*l,t[6]=b*h+w,t[10]=x-_*h}else if("XZY"===e.order){x=a*s,b=a*c,w=o*s,_=o*c;t[0]=s*l,t[4]=-h,t[8]=c*l,t[1]=x*h+_,t[5]=a*l,t[9]=b*h-w,t[2]=w*h-b,t[6]=o*l,t[10]=_*h+x}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromQuaternion:(qt=new Dt(0,0,0),Xt=new Dt(1,1,1),function(e){return this.compose(qt,e,Xt)}),lookAt:(kt=new Dt,jt=new Dt,Wt=new Dt,function(e,t,n){var i=this.elements;return Wt.subVectors(e,t),0===Wt.lengthSq()&&(Wt.z=1),Wt.normalize(),kt.crossVectors(n,Wt),0===kt.lengthSq()&&(1===Math.abs(n.z)?Wt.x+=1e-4:Wt.z+=1e-4,Wt.normalize(),kt.crossVectors(n,Wt)),kt.normalize(),jt.crossVectors(Wt,kt),i[0]=kt.x,i[4]=jt.x,i[8]=Wt.x,i[1]=kt.y,i[5]=jt.y,i[9]=Wt.y,i[2]=kt.z,i[6]=jt.z,i[10]=Wt.z,this}),multiply:function(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,i=t.elements,r=this.elements,a=n[0],o=n[4],s=n[8],c=n[12],l=n[1],h=n[5],u=n[9],p=n[13],d=n[2],f=n[6],m=n[10],g=n[14],v=n[3],y=n[7],x=n[11],b=n[15],w=i[0],_=i[4],M=i[8],S=i[12],T=i[1],E=i[5],A=i[9],L=i[13],R=i[2],P=i[6],C=i[10],I=i[14],O=i[3],D=i[7],N=i[11],U=i[15];return r[0]=a*w+o*T+s*R+c*O,r[4]=a*_+o*E+s*P+c*D,r[8]=a*M+o*A+s*C+c*N,r[12]=a*S+o*L+s*I+c*U,r[1]=l*w+h*T+u*R+p*O,r[5]=l*_+h*E+u*P+p*D,r[9]=l*M+h*A+u*C+p*N,r[13]=l*S+h*L+u*I+p*U,r[2]=d*w+f*T+m*R+g*O,r[6]=d*_+f*E+m*P+g*D,r[10]=d*M+f*A+m*C+g*N,r[14]=d*S+f*L+m*I+g*U,r[3]=v*w+y*T+x*R+b*O,r[7]=v*_+y*E+x*P+b*D,r[11]=v*M+y*A+x*C+b*N,r[15]=v*S+y*L+x*I+b*U,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this},applyToBufferAttribute:function(){var e=new Dt;return function(t){for(var n=0,i=t.count;n<i;n++)e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.applyMatrix4(this),t.setXYZ(n,e.x,e.y,e.z);return t}}(),determinant:function(){var e=this.elements,t=e[0],n=e[4],i=e[8],r=e[12],a=e[1],o=e[5],s=e[9],c=e[13],l=e[2],h=e[6],u=e[10],p=e[14];return e[3]*(+r*s*h-i*c*h-r*o*u+n*c*u+i*o*p-n*s*p)+e[7]*(+t*s*p-t*c*u+r*a*u-i*a*p+i*c*l-r*s*l)+e[11]*(+t*c*h-t*o*p-r*a*h+n*a*p+r*o*l-n*c*l)+e[15]*(-i*o*l-t*s*h+t*o*u+i*a*h-n*a*u+n*s*l)},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this},setPosition:function(e){var t=this.elements;return t[12]=e.x,t[13]=e.y,t[14]=e.z,this},getInverse:function(e,t){var n=this.elements,i=e.elements,r=i[0],a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],h=i[6],u=i[7],p=i[8],d=i[9],f=i[10],m=i[11],g=i[12],v=i[13],y=i[14],x=i[15],b=d*y*u-v*f*u+v*h*m-l*y*m-d*h*x+l*f*x,w=g*f*u-p*y*u-g*h*m+c*y*m+p*h*x-c*f*x,_=p*v*u-g*d*u+g*l*m-c*v*m-p*l*x+c*d*x,M=g*d*h-p*v*h-g*l*f+c*v*f+p*l*y-c*d*y,S=r*b+a*w+o*_+s*M;if(0===S){var T="THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";if(!0===t)throw new Error(T);return console.warn(T),this.identity()}var E=1/S;return n[0]=b*E,n[1]=(v*f*s-d*y*s-v*o*m+a*y*m+d*o*x-a*f*x)*E,n[2]=(l*y*s-v*h*s+v*o*u-a*y*u-l*o*x+a*h*x)*E,n[3]=(d*h*s-l*f*s-d*o*u+a*f*u+l*o*m-a*h*m)*E,n[4]=w*E,n[5]=(p*y*s-g*f*s+g*o*m-r*y*m-p*o*x+r*f*x)*E,n[6]=(g*h*s-c*y*s-g*o*u+r*y*u+c*o*x-r*h*x)*E,n[7]=(c*f*s-p*h*s+p*o*u-r*f*u-c*o*m+r*h*m)*E,n[8]=_*E,n[9]=(g*d*s-p*v*s-g*a*m+r*v*m+p*a*x-r*d*x)*E,n[10]=(c*v*s-g*l*s+g*a*u-r*v*u-c*a*x+r*l*x)*E,n[11]=(p*l*s-c*d*s-p*a*u+r*d*u+c*a*m-r*l*m)*E,n[12]=M*E,n[13]=(p*v*o-g*d*o+g*a*f-r*v*f-p*a*y+r*d*y)*E,n[14]=(g*l*o-c*v*o-g*a*h+r*v*h+c*a*y-r*l*y)*E,n[15]=(c*d*o-p*l*o+p*a*h-r*d*h-c*a*f+r*l*f)*E,this},scale:function(e){var t=this.elements,n=e.x,i=e.y,r=e.z;return t[0]*=n,t[4]*=i,t[8]*=r,t[1]*=n,t[5]*=i,t[9]*=r,t[2]*=n,t[6]*=i,t[10]*=r,t[3]*=n,t[7]*=i,t[11]*=r,this},getMaxScaleOnAxis:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))},makeTranslation:function(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this},makeRotationX:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this},makeRotationY:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this},makeRotationZ:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(e,t){var n=Math.cos(t),i=Math.sin(t),r=1-n,a=e.x,o=e.y,s=e.z,c=r*a,l=r*o;return this.set(c*a+n,c*o-i*s,c*s+i*o,0,c*o+i*s,l*o+n,l*s-i*a,0,c*s-i*o,l*s+i*a,r*s*s+n,0,0,0,0,1),this},makeScale:function(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this},makeShear:function(e,t,n){return this.set(1,t,n,0,e,1,n,0,e,t,1,0,0,0,0,1),this},compose:function(e,t,n){var i=this.elements,r=t._x,a=t._y,o=t._z,s=t._w,c=r+r,l=a+a,h=o+o,u=r*c,p=r*l,d=r*h,f=a*l,m=a*h,g=o*h,v=s*c,y=s*l,x=s*h,b=n.x,w=n.y,_=n.z;return i[0]=(1-(f+g))*b,i[1]=(p+x)*b,i[2]=(d-y)*b,i[3]=0,i[4]=(p-x)*w,i[5]=(1-(u+g))*w,i[6]=(m+v)*w,i[7]=0,i[8]=(d+y)*_,i[9]=(m-v)*_,i[10]=(1-(u+f))*_,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this},decompose:(Ht=new Dt,Vt=new sn,function(e,t,n){var i=this.elements,r=Ht.set(i[0],i[1],i[2]).length(),a=Ht.set(i[4],i[5],i[6]).length(),o=Ht.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),e.x=i[12],e.y=i[13],e.z=i[14],Vt.copy(this);var s=1/r,c=1/a,l=1/o;return Vt.elements[0]*=s,Vt.elements[1]*=s,Vt.elements[2]*=s,Vt.elements[4]*=c,Vt.elements[5]*=c,Vt.elements[6]*=c,Vt.elements[8]*=l,Vt.elements[9]*=l,Vt.elements[10]*=l,t.setFromRotationMatrix(Vt),n.x=r,n.y=a,n.z=o,this}),makePerspective:function(e,t,n,i,r,a){void 0===a&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var o=this.elements,s=2*r/(t-e),c=2*r/(n-i),l=(t+e)/(t-e),h=(n+i)/(n-i),u=-(a+r)/(a-r),p=-2*a*r/(a-r);return o[0]=s,o[4]=0,o[8]=l,o[12]=0,o[1]=0,o[5]=c,o[9]=h,o[13]=0,o[2]=0,o[6]=0,o[10]=u,o[14]=p,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this},makeOrthographic:function(e,t,n,i,r,a){var o=this.elements,s=1/(t-e),c=1/(n-i),l=1/(a-r),h=(t+e)*s,u=(n+i)*c,p=(a+r)*l;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-h,o[1]=0,o[5]=2*c,o[9]=0,o[13]=-u,o[2]=0,o[6]=0,o[10]=-2*l,o[14]=-p,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this},equals:function(e){for(var t=this.elements,n=e.elements,i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var n=0;n<16;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}});var cn={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick( specularColor, dotNV );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvarying vec3 vViewPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",common:"#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_textureSize (1024.0)\nint getFaceFromDirection(vec3 direction) {\n\tvec3 absDirection = abs(direction);\n\tint face = -1;\n\tif( absDirection.x > absDirection.z ) {\n\t\tif(absDirection.x > absDirection.y )\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\telse {\n\t\tif(absDirection.z > absDirection.y )\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\treturn face;\n}\n#define cubeUV_maxLods1 (log2(cubeUV_textureSize*0.25) - 1.0)\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n\tfloat dxRoughness = dFdx(roughness);\n\tfloat dyRoughness = dFdy(roughness);\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\n\tfloat mipLevel = 0.5 * log2(d);\n\treturn vec2(floor(mipLevel), fract(mipLevel));\n}\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n\tbool bRes = mipLevel == 0.0;\n\tscale = bRes && (scale < a) ? a : scale;\n\tvec3 r;\n\tvec2 offset;\n\tint face = getFaceFromDirection(direction);\n\tfloat rcpPowScale = 1.0 / powScale;\n\tif( face == 0) {\n\t\tr = vec3(direction.x, -direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 1) {\n\t\tr = vec3(direction.y, direction.x, direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 2) {\n\t\tr = vec3(direction.z, direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 3) {\n\t\tr = vec3(direction.x, direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse if( face == 4) {\n\t\tr = vec3(direction.y, direction.x, -direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse {\n\t\tr = vec3(direction.z, -direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\tr = normalize(r);\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n\tvec2 base = offset + vec2( texelOffset );\n\treturn base + s * ( scale - 2.0 * texelOffset );\n}\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\nvec4 textureCubeUV( sampler2D envMap, vec3 reflectedDirection, float roughness ) {\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\n\tfloat r1 = floor(roughnessVal);\n\tfloat r2 = r1 + 1.0;\n\tfloat t = fract(roughnessVal);\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n\tfloat s = mipInfo.y;\n\tfloat level0 = mipInfo.x;\n\tfloat level1 = level0 + 1.0;\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n\tvec4 result = mix(color10, color20, t);\n\treturn vec4(result.rgb, 1.0);\n}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = normalMatrix * objectNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = normalMatrix * objectTangent;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = min( floor( D ) / 255.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\treflectVec = normalize( reflectVec );\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_pars_fragment:"#if defined( USE_ENVMAP ) || defined( PHYSICAL )\n\tuniform float reflectivity;\n\tuniform float envMapIntensity;\n#endif\n#ifdef USE_ENVMAP\n\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\n\t\tvarying vec3 vWorldPosition;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent ));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = -mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef TOON\n\tuniform sampler2D gradientMap;\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\t\tfloat dotNL = dot( normal, lightDirection );\n\t\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t\t#ifdef USE_GRADIENTMAP\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\n\t\t#else\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t\t#endif\n\t}\n#endif",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif",lights_pars_begin:"uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t\tfloat shadowCameraNear;\n\t\tfloat shadowCameraFar;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifdef TOON\n\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#else\n\t\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\t\tvec3 irradiance = dotNL * directLight.color;\n\t#endif\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n#ifdef STANDARD\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.clearCoat = saturate( clearCoat );\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n\t#ifndef STANDARD\n\t\tfloat clearCoat;\n\t\tfloat clearCoatRoughness;\n\t#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifndef STANDARD\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#ifndef STANDARD\n\t\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#endif\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifndef STANDARD\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\tfloat dotNL = dotNV;\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\tfloat clearCoatInv = 1.0 - clearCoatDHR;\n\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec3 singleScattering = vec3( 0.0 );\n\t\tvec3 multiScattering = vec3( 0.0 );\n\t\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\t\tvec3 diffuse = material.diffuseColor;\n\t\treflectedLight.indirectSpecular += clearCoatInv * radiance * singleScattering;\n\t\treflectedLight.indirectDiffuse += multiScattering * cosineWeightedIrradiance;\n\t\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n\t#else\n\t\treflectedLight.indirectSpecular += clearCoatInv * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n\t#endif\n\t#ifndef STANDARD\n\t\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\n#define Material_ClearCoat_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearCoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tirradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), maxMipLevel );\n\t#ifndef STANDARD\n\t\tclearCoatRadiance += getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, irradiance, clearCoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\tgl_Position.z *= gl_Position.w;\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#ifdef USE_MAP\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif",map_particle_pars_fragment:"#ifdef USE_MAP\n\tuniform mat3 uvTransform;\n\tuniform sampler2D map;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t#endif\n#endif",normal_fragment_maps:"#ifdef USE_NORMALMAP\n\t#ifdef OBJECTSPACE_NORMALMAP\n\t\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t#ifdef FLIP_SIDED\n\t\t\tnormal = - normal;\n\t\t#endif\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\tnormal = normalize( normalMatrix * normal );\n\t#else\n\t\t#ifdef USE_TANGENT\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t\tmapN.xy = normalScale * mapN.xy;\n\t\t\tnormal = normalize( vTBN * mapN );\n\t\t#else\n\t\t\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n\t\t#endif\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\t#ifdef OBJECTSPACE_NORMALMAP\n\t\tuniform mat3 normalMatrix;\n\t#else\n\t\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\t\tvec2 st0 = dFdx( vUv.st );\n\t\t\tvec2 st1 = dFdy( vUv.st );\n\t\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\t\tvec3 N = normalize( surf_norm );\n\t\t\tmat3 tsn = mat3( S, T, N );\n\t\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t\tmapN.xy *= normalScale;\n\t\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\treturn normalize( tsn * mapN );\n\t\t}\n\t#endif\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#if defined( DITHERING )\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#if defined( DITHERING )\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tshadow = (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n\t#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );\n}",uv_pars_fragment:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}",depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV;\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphysical_frag:"#define PHYSICAL\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifndef STANDARD\n\tuniform float clearCoat;\n\tuniform float clearCoatRoughness;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define PHYSICAL\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <fog_fragment>\n}",shadow_vert:"#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}"};function ln(e){var t={};for(var n in e)for(var i in t[n]={},e[n]){var r=e[n][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture)?t[n][i]=r.clone():Array.isArray(r)?t[n][i]=r.slice():t[n][i]=r}return t}function hn(e){for(var t={},n=0;n<e.length;n++){var i=ln(e[n]);for(var r in i)t[r]=i[r]}return t}var un,pn,dn,fn={clone:ln,merge:hn},mn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function gn(e,t,n){return void 0===t&&void 0===n?this.set(e):this.setRGB(e,t,n)}Object.assign(gn.prototype,{isColor:!0,r:1,g:1,b:1,set:function(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this},setScalar:function(e){return this.r=e,this.g=e,this.b=e,this},setHex:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this},setRGB:function(e,t,n){return this.r=e,this.g=t,this.b=n,this},setHSL:function(){function e(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}return function(t,n,i){if(t=Ct.euclideanModulo(t,1),n=Ct.clamp(n,0,1),i=Ct.clamp(i,0,1),0===n)this.r=this.g=this.b=i;else{var r=i<=.5?i*(1+n):i+n-i*n,a=2*i-r;this.r=e(a,r,t+1/3),this.g=e(a,r,t),this.b=e(a,r,t-1/3)}return this}}(),setStyle:function(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var i,r=n[1],a=n[2];switch(r){case"rgb":case"rgba":if(i=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,t(i[5]),this;if(i=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,t(i[5]),this;break;case"hsl":case"hsla":if(i=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){var o=parseFloat(i[1])/360,s=parseInt(i[2],10)/100,c=parseInt(i[3],10)/100;return t(i[5]),this.setHSL(o,s,c)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(e)){var l,h=(l=n[1]).length;if(3===h)return this.r=parseInt(l.charAt(0)+l.charAt(0),16)/255,this.g=parseInt(l.charAt(1)+l.charAt(1),16)/255,this.b=parseInt(l.charAt(2)+l.charAt(2),16)/255,this;if(6===h)return this.r=parseInt(l.charAt(0)+l.charAt(1),16)/255,this.g=parseInt(l.charAt(2)+l.charAt(3),16)/255,this.b=parseInt(l.charAt(4)+l.charAt(5),16)/255,this}e&&e.length>0&&(void 0!==(l=mn[e])?this.setHex(l):console.warn("THREE.Color: Unknown color "+e));return this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},copyGammaToLinear:function(e,t){return void 0===t&&(t=2),this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this},copyLinearToGamma:function(e,t){void 0===t&&(t=2);var n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this},convertGammaToLinear:function(e){return this.copyGammaToLinear(this,e),this},convertLinearToGamma:function(e){return this.copyLinearToGamma(this,e),this},copySRGBToLinear:function(){function e(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}return function(t){return this.r=e(t.r),this.g=e(t.g),this.b=e(t.b),this}}(),copyLinearToSRGB:function(){function e(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}return function(t){return this.r=e(t.r),this.g=e(t.g),this.b=e(t.b),this}}(),convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(e){void 0===e&&(console.warn("THREE.Color: .getHSL() target is now required"),e={h:0,s:0,l:0});var t,n,i=this.r,r=this.g,a=this.b,o=Math.max(i,r,a),s=Math.min(i,r,a),c=(s+o)/2;if(s===o)t=0,n=0;else{var l=o-s;switch(n=c<=.5?l/(o+s):l/(2-o-s),o){case i:t=(r-a)/l+(r<a?6:0);break;case r:t=(a-i)/l+2;break;case a:t=(i-r)/l+4}t/=6}return e.h=t,e.s=n,e.l=c,e},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:(dn={},function(e,t,n){return this.getHSL(dn),dn.h+=e,dn.s+=t,dn.l+=n,this.setHSL(dn.h,dn.s,dn.l),this}),add:function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this},addColors:function(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this},addScalar:function(e){return this.r+=e,this.g+=e,this.b+=e,this},sub:function(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this},multiply:function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this},multiplyScalar:function(e){return this.r*=e,this.g*=e,this.b*=e,this},lerp:function(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this},lerpHSL:(un={h:0,s:0,l:0},pn={h:0,s:0,l:0},function(e,t){this.getHSL(un),e.getHSL(pn);var n=Ct.lerp(un.h,pn.h,t),i=Ct.lerp(un.s,pn.s,t),r=Ct.lerp(un.l,pn.l,t);return this.setHSL(n,i,r),this}),equals:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b},fromArray:function(e,t){return void 0===t&&(t=0),this.r=e[t],this.g=e[t+1],this.b=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e},toJSON:function(){return this.getHex()}});var vn,yn={common:{diffuse:{value:new gn(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new Nt},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new It(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new gn(16777215)}},lights:{ambientLightColor:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new gn(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},uvTransform:{value:new Nt}},sprite:{diffuse:{value:new gn(15658734)},opacity:{value:1},center:{value:new It(.5,.5)},rotation:{value:0},map:{value:null},uvTransform:{value:new Nt}}},xn={basic:{uniforms:hn([yn.common,yn.specularmap,yn.envmap,yn.aomap,yn.lightmap,yn.fog]),vertexShader:cn.meshbasic_vert,fragmentShader:cn.meshbasic_frag},lambert:{uniforms:hn([yn.common,yn.specularmap,yn.envmap,yn.aomap,yn.lightmap,yn.emissivemap,yn.fog,yn.lights,{emissive:{value:new gn(0)}}]),vertexShader:cn.meshlambert_vert,fragmentShader:cn.meshlambert_frag},phong:{uniforms:hn([yn.common,yn.specularmap,yn.envmap,yn.aomap,yn.lightmap,yn.emissivemap,yn.bumpmap,yn.normalmap,yn.displacementmap,yn.gradientmap,yn.fog,yn.lights,{emissive:{value:new gn(0)},specular:{value:new gn(1118481)},shininess:{value:30}}]),vertexShader:cn.meshphong_vert,fragmentShader:cn.meshphong_frag},standard:{uniforms:hn([yn.common,yn.envmap,yn.aomap,yn.lightmap,yn.emissivemap,yn.bumpmap,yn.normalmap,yn.displacementmap,yn.roughnessmap,yn.metalnessmap,yn.fog,yn.lights,{emissive:{value:new gn(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:cn.meshphysical_vert,fragmentShader:cn.meshphysical_frag},matcap:{uniforms:hn([yn.common,yn.bumpmap,yn.normalmap,yn.displacementmap,yn.fog,{matcap:{value:null}}]),vertexShader:cn.meshmatcap_vert,fragmentShader:cn.meshmatcap_frag},points:{uniforms:hn([yn.points,yn.fog]),vertexShader:cn.points_vert,fragmentShader:cn.points_frag},dashed:{uniforms:hn([yn.common,yn.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:cn.linedashed_vert,fragmentShader:cn.linedashed_frag},depth:{uniforms:hn([yn.common,yn.displacementmap]),vertexShader:cn.depth_vert,fragmentShader:cn.depth_frag},normal:{uniforms:hn([yn.common,yn.bumpmap,yn.normalmap,yn.displacementmap,{opacity:{value:1}}]),vertexShader:cn.normal_vert,fragmentShader:cn.normal_frag},sprite:{uniforms:hn([yn.sprite,yn.fog]),vertexShader:cn.sprite_vert,fragmentShader:cn.sprite_frag},background:{uniforms:{uvTransform:{value:new Nt},t2D:{value:null}},vertexShader:cn.background_vert,fragmentShader:cn.background_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:cn.cube_vert,fragmentShader:cn.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:cn.equirect_vert,fragmentShader:cn.equirect_frag},distanceRGBA:{uniforms:hn([yn.common,yn.displacementmap,{referencePosition:{value:new Dt},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:cn.distanceRGBA_vert,fragmentShader:cn.distanceRGBA_frag},shadow:{uniforms:hn([yn.lights,yn.fog,{color:{value:new gn(0)},opacity:{value:1}}]),vertexShader:cn.shadow_vert,fragmentShader:cn.shadow_frag}};function bn(){var e=null,t=!1,n=null;function i(r,a){!1!==t&&(n(r,a),e.requestAnimationFrame(i))}return{start:function(){!0!==t&&null!==n&&(e.requestAnimationFrame(i),t=!0)},stop:function(){t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function wn(e){var t=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),t.get(e)},remove:function(n){n.isInterleavedBufferAttribute&&(n=n.data);var i=t.get(n);i&&(e.deleteBuffer(i.buffer),t.delete(n))},update:function(n,i){n.isInterleavedBufferAttribute&&(n=n.data);var r=t.get(n);void 0===r?t.set(n,function(t,n){var i=t.array,r=t.dynamic?35048:35044,a=e.createBuffer();e.bindBuffer(n,a),e.bufferData(n,i,r),t.onUploadCallback();var o=5126;return i instanceof Float32Array?o=5126:i instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):i instanceof Uint16Array?o=5123:i instanceof Int16Array?o=5122:i instanceof Uint32Array?o=5125:i instanceof Int32Array?o=5124:i instanceof Int8Array?o=5120:i instanceof Uint8Array&&(o=5121),{buffer:a,type:o,bytesPerElement:i.BYTES_PER_ELEMENT,version:t.version}}(n,i)):r.version<n.version&&(function(t,n,i){var r=n.array,a=n.updateRange;e.bindBuffer(i,t),!1===n.dynamic?e.bufferData(i,r,35044):-1===a.count?e.bufferSubData(i,0,r):0===a.count?console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."):(e.bufferSubData(i,a.offset*r.BYTES_PER_ELEMENT,r.subarray(a.offset,a.offset+a.count)),a.count=-1)}(r.buffer,n,i),r.version=n.version)}}}function _n(e,t,n,i,r,a){this.a=e,this.b=t,this.c=n,this.normal=i&&i.isVector3?i:new Dt,this.vertexNormals=Array.isArray(i)?i:[],this.color=r&&r.isColor?r:new gn,this.vertexColors=Array.isArray(r)?r:[],this.materialIndex=void 0!==a?a:0}function Mn(e,t,n,i){this._x=e||0,this._y=t||0,this._z=n||0,this._order=i||Mn.DefaultOrder}function Sn(){this.mask=1}xn.physical={uniforms:hn([xn.standard.uniforms,{clearCoat:{value:0},clearCoatRoughness:{value:0}}]),vertexShader:cn.meshphysical_vert,fragmentShader:cn.meshphysical_frag},Object.assign(_n.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.a=e.a,this.b=e.b,this.c=e.c,this.normal.copy(e.normal),this.color.copy(e.color),this.materialIndex=e.materialIndex;for(var t=0,n=e.vertexNormals.length;t<n;t++)this.vertexNormals[t]=e.vertexNormals[t].clone();for(t=0,n=e.vertexColors.length;t<n;t++)this.vertexColors[t]=e.vertexColors[t].clone();return this}}),Mn.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],Mn.DefaultOrder="XYZ",Object.defineProperties(Mn.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this.onChangeCallback()}},order:{get:function(){return this._order},set:function(e){this._order=e,this.onChangeCallback()}}}),Object.assign(Mn.prototype,{isEuler:!0,set:function(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._order=i||this._order,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this.onChangeCallback(),this},setFromRotationMatrix:function(e,t,n){var i=Ct.clamp,r=e.elements,a=r[0],o=r[4],s=r[8],c=r[1],l=r[5],h=r[9],u=r[2],p=r[6],d=r[10];return"XYZ"===(t=t||this._order)?(this._y=Math.asin(i(s,-1,1)),Math.abs(s)<.99999?(this._x=Math.atan2(-h,d),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(p,l),this._z=0)):"YXZ"===t?(this._x=Math.asin(-i(h,-1,1)),Math.abs(h)<.99999?(this._y=Math.atan2(s,d),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-u,a),this._z=0)):"ZXY"===t?(this._x=Math.asin(i(p,-1,1)),Math.abs(p)<.99999?(this._y=Math.atan2(-u,d),this._z=Math.atan2(-o,l)):(this._y=0,this._z=Math.atan2(c,a))):"ZYX"===t?(this._y=Math.asin(-i(u,-1,1)),Math.abs(u)<.99999?(this._x=Math.atan2(p,d),this._z=Math.atan2(c,a)):(this._x=0,this._z=Math.atan2(-o,l))):"YZX"===t?(this._z=Math.asin(i(c,-1,1)),Math.abs(c)<.99999?(this._x=Math.atan2(-h,l),this._y=Math.atan2(-u,a)):(this._x=0,this._y=Math.atan2(s,d))):"XZY"===t?(this._z=Math.asin(-i(o,-1,1)),Math.abs(o)<.99999?(this._x=Math.atan2(p,l),this._y=Math.atan2(s,a)):(this._x=Math.atan2(-h,d),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+t),this._order=t,!1!==n&&this.onChangeCallback(),this},setFromQuaternion:function(){var e=new sn;return function(t,n,i){return e.makeRotationFromQuaternion(t),this.setFromRotationMatrix(e,n,i)}}(),setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:(vn=new Ot,function(e){return vn.setFromEuler(this),this.setFromQuaternion(vn,e)}),equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order},fromArray:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this.onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e},toVector3:function(e){return e?e.set(this._x,this._y,this._z):new Dt(this._x,this._y,this._z)},onChange:function(e){return this.onChangeCallback=e,this},onChangeCallback:function(){}}),Object.assign(Sn.prototype,{set:function(e){this.mask=1<<e|0},enable:function(e){this.mask|=1<<e|0},toggle:function(e){this.mask^=1<<e|0},disable:function(e){this.mask&=~(1<<e|0)},test:function(e){return 0!=(this.mask&e.mask)}});var Tn,En,An,Ln,Rn=0;function Pn(){Object.defineProperty(this,"id",{value:Rn++}),this.uuid=Ct.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Pn.DefaultUp.clone();var e=new Dt,t=new Mn,n=new Ot,i=new Dt(1,1,1);t.onChange(function(){n.setFromEuler(t,!1)}),n.onChange(function(){t.setFromQuaternion(n,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new sn},normalMatrix:{value:new Nt}}),this.matrix=new sn,this.matrixWorld=new sn,this.matrixAutoUpdate=Pn.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new Sn,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}Pn.DefaultUp=new Dt(0,1,0),Pn.DefaultMatrixAutoUpdate=!0,Pn.prototype=Object.assign(Object.create(s.prototype),{constructor:Pn,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix:function(e){this.matrix.multiplyMatrices(e,this.matrix),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(e){return this.quaternion.premultiply(e),this},setRotationFromAxisAngle:function(e,t){this.quaternion.setFromAxisAngle(e,t)},setRotationFromEuler:function(e){this.quaternion.setFromEuler(e,!0)},setRotationFromMatrix:function(e){this.quaternion.setFromRotationMatrix(e)},setRotationFromQuaternion:function(e){this.quaternion.copy(e)},rotateOnAxis:(Ln=new Ot,function(e,t){return Ln.setFromAxisAngle(e,t),this.quaternion.multiply(Ln),this}),rotateOnWorldAxis:function(){var e=new Ot;return function(t,n){return e.setFromAxisAngle(t,n),this.quaternion.premultiply(e),this}}(),rotateX:function(){var e=new Dt(1,0,0);return function(t){return this.rotateOnAxis(e,t)}}(),rotateY:function(){var e=new Dt(0,1,0);return function(t){return this.rotateOnAxis(e,t)}}(),rotateZ:function(){var e=new Dt(0,0,1);return function(t){return this.rotateOnAxis(e,t)}}(),translateOnAxis:function(){var e=new Dt;return function(t,n){return e.copy(t).applyQuaternion(this.quaternion),this.position.add(e.multiplyScalar(n)),this}}(),translateX:function(){var e=new Dt(1,0,0);return function(t){return this.translateOnAxis(e,t)}}(),translateY:function(){var e=new Dt(0,1,0);return function(t){return this.translateOnAxis(e,t)}}(),translateZ:function(){var e=new Dt(0,0,1);return function(t){return this.translateOnAxis(e,t)}}(),localToWorld:function(e){return e.applyMatrix4(this.matrixWorld)},worldToLocal:(An=new sn,function(e){return e.applyMatrix4(An.getInverse(this.matrixWorld))}),lookAt:function(){var e=new Ot,t=new sn,n=new Dt,i=new Dt;return function(r,a,o){r.isVector3?n.copy(r):n.set(r,a,o);var s=this.parent;this.updateWorldMatrix(!0,!1),i.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?t.lookAt(i,n,this.up):t.lookAt(n,i,this.up),this.quaternion.setFromRotationMatrix(t),s&&(t.extractRotation(s.matrixWorld),e.setFromRotationMatrix(t),this.quaternion.premultiply(e.inverse()))}}(),add:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,e.dispatchEvent({type:"added"}),this.children.push(e)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)},remove:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}var n=this.children.indexOf(e);return-1!==n&&(e.parent=null,e.dispatchEvent({type:"removed"}),this.children.splice(n,1)),this},getObjectById:function(e){return this.getObjectByProperty("id",e)},getObjectByName:function(e){return this.getObjectByProperty("name",e)},getObjectByProperty:function(e,t){if(this[e]===t)return this;for(var n=0,i=this.children.length;n<i;n++){var r=this.children[n].getObjectByProperty(e,t);if(void 0!==r)return r}},getWorldPosition:function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),e=new Dt),this.updateMatrixWorld(!0),e.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:(Tn=new Dt,En=new Dt,function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),e=new Ot),this.updateMatrixWorld(!0),this.matrixWorld.decompose(Tn,e,En),e}),getWorldScale:function(){var e=new Dt,t=new Ot;return function(n){return void 0===n&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),n=new Dt),this.updateMatrixWorld(!0),this.matrixWorld.decompose(e,t,n),n}}(),getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),e=new Dt),this.updateMatrixWorld(!0);var t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()},raycast:function(){},traverse:function(e){e(this);for(var t=this.children,n=0,i=t.length;n<i;n++)t[n].traverse(e)},traverseVisible:function(e){if(!1!==this.visible){e(this);for(var t=this.children,n=0,i=t.length;n<i;n++)t[n].traverseVisible(e)}},traverseAncestors:function(e){var t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);for(var t=this.children,n=0,i=t.length;n<i;n++)t[n].updateMatrixWorld(e)},updateWorldMatrix:function(e,t){var n=this.parent;if(!0===e&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===t)for(var i=this.children,r=0,a=i.length;r<a;r++)i[r].updateWorldMatrix(!1,!0)},toJSON:function(e){var t=void 0===e||"string"==typeof e,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var i={};function r(t,n){return void 0===t[n.uuid]&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),!0===this.castShadow&&(i.castShadow=!0),!0===this.receiveShadow&&(i.receiveShadow=!0),!1===this.visible&&(i.visible=!1),!1===this.frustumCulled&&(i.frustumCulled=!1),0!==this.renderOrder&&(i.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(i.matrixAutoUpdate=!1),this.isMesh&&this.drawMode!==vt&&(i.drawMode=this.drawMode),this.isMesh||this.isLine||this.isPoints){i.geometry=r(e.geometries,this.geometry);var a=this.geometry.parameters;if(void 0!==a&&void 0!==a.shapes){var o=a.shapes;if(Array.isArray(o))for(var s=0,c=o.length;s<c;s++){var l=o[s];r(e.shapes,l)}else r(e.shapes,o)}}if(void 0!==this.material)if(Array.isArray(this.material)){var h=[];for(s=0,c=this.material.length;s<c;s++)h.push(r(e.materials,this.material[s]));i.material=h}else i.material=r(e.materials,this.material);if(this.children.length>0){i.children=[];for(s=0;s<this.children.length;s++)i.children.push(this.children[s].toJSON(e).object)}if(t){var u=m(e.geometries),p=m(e.materials),d=m(e.textures),f=m(e.images);o=m(e.shapes);u.length>0&&(n.geometries=u),p.length>0&&(n.materials=p),d.length>0&&(n.textures=d),f.length>0&&(n.images=f),o.length>0&&(n.shapes=o)}return n.object=i,n;function m(e){var t=[];for(var n in e){var i=e[n];delete i.metadata,t.push(i)}return t}},clone:function(e){return(new this.constructor).copy(this,e)},copy:function(e,t){if(void 0===t&&(t=!0),this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(var n=0;n<e.children.length;n++){var i=e.children[n];this.add(i.clone())}return this}});var Cn,In,On=0;function Dn(){Object.defineProperty(this,"id",{value:On+=2}),this.uuid=Ct.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}function Nn(e,t,n){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===n,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0}function Un(e,t,n){Nn.call(this,new Int8Array(e),t,n)}function Bn(e,t,n){Nn.call(this,new Uint8Array(e),t,n)}function Fn(e,t,n){Nn.call(this,new Uint8ClampedArray(e),t,n)}function zn(e,t,n){Nn.call(this,new Int16Array(e),t,n)}function Gn(e,t,n){Nn.call(this,new Uint16Array(e),t,n)}function Hn(e,t,n){Nn.call(this,new Int32Array(e),t,n)}function Vn(e,t,n){Nn.call(this,new Uint32Array(e),t,n)}function kn(e,t,n){Nn.call(this,new Float32Array(e),t,n)}function jn(e,t,n){Nn.call(this,new Float64Array(e),t,n)}function Wn(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function qn(e){if(0===e.length)return-1/0;for(var t=e[0],n=1,i=e.length;n<i;++n)e[n]>t&&(t=e[n]);return t}Dn.prototype=Object.assign(Object.create(s.prototype),{constructor:Dn,isGeometry:!0,applyMatrix:function(e){for(var t=(new Nt).getNormalMatrix(e),n=0,i=this.vertices.length;n<i;n++){this.vertices[n].applyMatrix4(e)}for(n=0,i=this.faces.length;n<i;n++){var r=this.faces[n];r.normal.applyMatrix3(t).normalize();for(var a=0,o=r.vertexNormals.length;a<o;a++)r.vertexNormals[a].applyMatrix3(t).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(){var e=new sn;return function(t){return e.makeRotationX(t),this.applyMatrix(e),this}}(),rotateY:function(){var e=new sn;return function(t){return e.makeRotationY(t),this.applyMatrix(e),this}}(),rotateZ:function(){var e=new sn;return function(t){return e.makeRotationZ(t),this.applyMatrix(e),this}}(),translate:function(){var e=new sn;return function(t,n,i){return e.makeTranslation(t,n,i),this.applyMatrix(e),this}}(),scale:function(){var e=new sn;return function(t,n,i){return e.makeScale(t,n,i),this.applyMatrix(e),this}}(),lookAt:(In=new Pn,function(e){In.lookAt(e),In.updateMatrix(),this.applyMatrix(In.matrix)}),fromBufferGeometry:function(e){var t=this,n=null!==e.index?e.index.array:void 0,i=e.attributes,r=i.position.array,a=void 0!==i.normal?i.normal.array:void 0,o=void 0!==i.color?i.color.array:void 0,s=void 0!==i.uv?i.uv.array:void 0,c=void 0!==i.uv2?i.uv2.array:void 0;void 0!==c&&(this.faceVertexUvs[1]=[]);for(var l=0,h=0;l<r.length;l+=3,h+=2)t.vertices.push((new Dt).fromArray(r,l)),void 0!==o&&t.colors.push((new gn).fromArray(o,l));function u(e,n,i,r){var l=void 0===o?[]:[t.colors[e].clone(),t.colors[n].clone(),t.colors[i].clone()],h=new _n(e,n,i,void 0===a?[]:[(new Dt).fromArray(a,3*e),(new Dt).fromArray(a,3*n),(new Dt).fromArray(a,3*i)],l,r);t.faces.push(h),void 0!==s&&t.faceVertexUvs[0].push([(new It).fromArray(s,2*e),(new It).fromArray(s,2*n),(new It).fromArray(s,2*i)]),void 0!==c&&t.faceVertexUvs[1].push([(new It).fromArray(c,2*e),(new It).fromArray(c,2*n),(new It).fromArray(c,2*i)])}var p=e.groups;if(p.length>0)for(l=0;l<p.length;l++)for(var d=p[l],f=d.start,m=(h=f,f+d.count);h<m;h+=3)void 0!==n?u(n[h],n[h+1],n[h+2],d.materialIndex):u(h,h+1,h+2,d.materialIndex);else if(void 0!==n)for(l=0;l<n.length;l+=3)u(n[l],n[l+1],n[l+2]);else for(l=0;l<r.length/3;l+=3)u(l,l+1,l+2);return this.computeFaceNormals(),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this},center:(Cn=new Dt,function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Cn).negate(),this.translate(Cn.x,Cn.y,Cn.z),this}),normalize:function(){this.computeBoundingSphere();var e=this.boundingSphere.center,t=this.boundingSphere.radius,n=0===t?1:1/t,i=new sn;return i.set(n,0,0,-n*e.x,0,n,0,-n*e.y,0,0,n,-n*e.z,0,0,0,1),this.applyMatrix(i),this},computeFaceNormals:function(){for(var e=new Dt,t=new Dt,n=0,i=this.faces.length;n<i;n++){var r=this.faces[n],a=this.vertices[r.a],o=this.vertices[r.b],s=this.vertices[r.c];e.subVectors(s,o),t.subVectors(a,o),e.cross(t),e.normalize(),r.normal.copy(e)}},computeVertexNormals:function(e){var t,n,i,r,a,o;for(void 0===e&&(e=!0),o=new Array(this.vertices.length),t=0,n=this.vertices.length;t<n;t++)o[t]=new Dt;if(e){var s,c,l,h=new Dt,u=new Dt;for(i=0,r=this.faces.length;i<r;i++)a=this.faces[i],s=this.vertices[a.a],c=this.vertices[a.b],l=this.vertices[a.c],h.subVectors(l,c),u.subVectors(s,c),h.cross(u),o[a.a].add(h),o[a.b].add(h),o[a.c].add(h)}else for(this.computeFaceNormals(),i=0,r=this.faces.length;i<r;i++)o[(a=this.faces[i]).a].add(a.normal),o[a.b].add(a.normal),o[a.c].add(a.normal);for(t=0,n=this.vertices.length;t<n;t++)o[t].normalize();for(i=0,r=this.faces.length;i<r;i++){var p=(a=this.faces[i]).vertexNormals;3===p.length?(p[0].copy(o[a.a]),p[1].copy(o[a.b]),p[2].copy(o[a.c])):(p[0]=o[a.a].clone(),p[1]=o[a.b].clone(),p[2]=o[a.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var e,t,n;for(this.computeFaceNormals(),e=0,t=this.faces.length;e<t;e++){var i=(n=this.faces[e]).vertexNormals;3===i.length?(i[0].copy(n.normal),i[1].copy(n.normal),i[2].copy(n.normal)):(i[0]=n.normal.clone(),i[1]=n.normal.clone(),i[2]=n.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var e,t,n,i,r;for(n=0,i=this.faces.length;n<i;n++)for((r=this.faces[n]).__originalFaceNormal?r.__originalFaceNormal.copy(r.normal):r.__originalFaceNormal=r.normal.clone(),r.__originalVertexNormals||(r.__originalVertexNormals=[]),e=0,t=r.vertexNormals.length;e<t;e++)r.__originalVertexNormals[e]?r.__originalVertexNormals[e].copy(r.vertexNormals[e]):r.__originalVertexNormals[e]=r.vertexNormals[e].clone();var a=new Dn;for(a.faces=this.faces,e=0,t=this.morphTargets.length;e<t;e++){if(!this.morphNormals[e]){this.morphNormals[e]={},this.morphNormals[e].faceNormals=[],this.morphNormals[e].vertexNormals=[];var o=this.morphNormals[e].faceNormals,s=this.morphNormals[e].vertexNormals;for(n=0,i=this.faces.length;n<i;n++)c=new Dt,l={a:new Dt,b:new Dt,c:new Dt},o.push(c),s.push(l)}var c,l,h=this.morphNormals[e];for(a.vertices=this.morphTargets[e].vertices,a.computeFaceNormals(),a.computeVertexNormals(),n=0,i=this.faces.length;n<i;n++)r=this.faces[n],c=h.faceNormals[n],l=h.vertexNormals[n],c.copy(r.normal),l.a.copy(r.vertexNormals[0]),l.b.copy(r.vertexNormals[1]),l.c.copy(r.vertexNormals[2])}for(n=0,i=this.faces.length;n<i;n++)(r=this.faces[n]).normal=r.__originalFaceNormal,r.vertexNormals=r.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new nn),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new rn),this.boundingSphere.setFromPoints(this.vertices)},merge:function(e,t,n){if(e&&e.isGeometry){var i,r=this.vertices.length,a=this.vertices,o=e.vertices,s=this.faces,c=e.faces,l=this.faceVertexUvs[0],h=e.faceVertexUvs[0],u=this.colors,p=e.colors;void 0===n&&(n=0),void 0!==t&&(i=(new Nt).getNormalMatrix(t));for(var d=0,f=o.length;d<f;d++){var m=o[d].clone();void 0!==t&&m.applyMatrix4(t),a.push(m)}for(d=0,f=p.length;d<f;d++)u.push(p[d].clone());for(d=0,f=c.length;d<f;d++){var g,v,y,x=c[d],b=x.vertexNormals,w=x.vertexColors;(g=new _n(x.a+r,x.b+r,x.c+r)).normal.copy(x.normal),void 0!==i&&g.normal.applyMatrix3(i).normalize();for(var _=0,M=b.length;_<M;_++)v=b[_].clone(),void 0!==i&&v.applyMatrix3(i).normalize(),g.vertexNormals.push(v);g.color.copy(x.color);for(_=0,M=w.length;_<M;_++)y=w[_],g.vertexColors.push(y.clone());g.materialIndex=x.materialIndex+n,s.push(g)}for(d=0,f=h.length;d<f;d++){var S=h[d],T=[];if(void 0!==S){for(_=0,M=S.length;_<M;_++)T.push(S[_].clone());l.push(T)}}}else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e)},mergeMesh:function(e){e&&e.isMesh?(e.matrixAutoUpdate&&e.updateMatrix(),this.merge(e.geometry,e.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",e)},mergeVertices:function(){var e,t,n,i,r,a,o,s,c={},l=[],h=[],u=Math.pow(10,4);for(n=0,i=this.vertices.length;n<i;n++)e=this.vertices[n],void 0===c[t=Math.round(e.x*u)+"_"+Math.round(e.y*u)+"_"+Math.round(e.z*u)]?(c[t]=n,l.push(this.vertices[n]),h[n]=l.length-1):h[n]=h[c[t]];var p=[];for(n=0,i=this.faces.length;n<i;n++){(r=this.faces[n]).a=h[r.a],r.b=h[r.b],r.c=h[r.c],a=[r.a,r.b,r.c];for(var d=0;d<3;d++)if(a[d]===a[(d+1)%3]){p.push(n);break}}for(n=p.length-1;n>=0;n--){var f=p[n];for(this.faces.splice(f,1),o=0,s=this.faceVertexUvs.length;o<s;o++)this.faceVertexUvs[o].splice(f,1)}var m=this.vertices.length-l.length;return this.vertices=l,m},setFromPoints:function(e){this.vertices=[];for(var t=0,n=e.length;t<n;t++){var i=e[t];this.vertices.push(new Dt(i.x,i.y,i.z||0))}return this},sortFacesByMaterialIndex:function(){for(var e=this.faces,t=e.length,n=0;n<t;n++)e[n]._id=n;e.sort(function(e,t){return e.materialIndex-t.materialIndex});var i,r,a=this.faceVertexUvs[0],o=this.faceVertexUvs[1];a&&a.length===t&&(i=[]),o&&o.length===t&&(r=[]);for(n=0;n<t;n++){var s=e[n]._id;i&&i.push(a[s]),r&&r.push(o[s])}i&&(this.faceVertexUvs[0]=i),r&&(this.faceVertexUvs[1]=r)},toJSON:function(){var e={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),void 0!==this.parameters){var t=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}for(var i=[],r=0;r<this.vertices.length;r++){var a=this.vertices[r];i.push(a.x,a.y,a.z)}var o=[],s=[],c={},l=[],h={},u=[],p={};for(r=0;r<this.faces.length;r++){var d=this.faces[r],f=void 0!==this.faceVertexUvs[0][r],m=d.normal.length()>0,g=d.vertexNormals.length>0,v=1!==d.color.r||1!==d.color.g||1!==d.color.b,y=d.vertexColors.length>0,x=0;if(x=M(x,0,0),x=M(x,1,!0),x=M(x,2,!1),x=M(x,3,f),x=M(x,4,m),x=M(x,5,g),x=M(x,6,v),x=M(x,7,y),o.push(x),o.push(d.a,d.b,d.c),o.push(d.materialIndex),f){var b=this.faceVertexUvs[0][r];o.push(E(b[0]),E(b[1]),E(b[2]))}if(m&&o.push(S(d.normal)),g){var w=d.vertexNormals;o.push(S(w[0]),S(w[1]),S(w[2]))}if(v&&o.push(T(d.color)),y){var _=d.vertexColors;o.push(T(_[0]),T(_[1]),T(_[2]))}}function M(e,t,n){return n?e|1<<t:e&~(1<<t)}function S(e){var t=e.x.toString()+e.y.toString()+e.z.toString();return void 0!==c[t]?c[t]:(c[t]=s.length/3,s.push(e.x,e.y,e.z),c[t])}function T(e){var t=e.r.toString()+e.g.toString()+e.b.toString();return void 0!==h[t]?h[t]:(h[t]=l.length,l.push(e.getHex()),h[t])}function E(e){var t=e.x.toString()+e.y.toString();return void 0!==p[t]?p[t]:(p[t]=u.length/2,u.push(e.x,e.y),p[t])}return e.data={},e.data.vertices=i,e.data.normals=s,l.length>0&&(e.data.colors=l),u.length>0&&(e.data.uvs=[u]),e.data.faces=o,e},clone:function(){return(new Dn).copy(this)},copy:function(e){var t,n,i,r,a,o;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var s=e.vertices;for(t=0,n=s.length;t<n;t++)this.vertices.push(s[t].clone());var c=e.colors;for(t=0,n=c.length;t<n;t++)this.colors.push(c[t].clone());var l=e.faces;for(t=0,n=l.length;t<n;t++)this.faces.push(l[t].clone());for(t=0,n=e.faceVertexUvs.length;t<n;t++){var h=e.faceVertexUvs[t];for(void 0===this.faceVertexUvs[t]&&(this.faceVertexUvs[t]=[]),i=0,r=h.length;i<r;i++){var u=h[i],p=[];for(a=0,o=u.length;a<o;a++){var d=u[a];p.push(d.clone())}this.faceVertexUvs[t].push(p)}}var f=e.morphTargets;for(t=0,n=f.length;t<n;t++){var m={};if(m.name=f[t].name,void 0!==f[t].vertices)for(m.vertices=[],i=0,r=f[t].vertices.length;i<r;i++)m.vertices.push(f[t].vertices[i].clone());if(void 0!==f[t].normals)for(m.normals=[],i=0,r=f[t].normals.length;i<r;i++)m.normals.push(f[t].normals[i].clone());this.morphTargets.push(m)}var g=e.morphNormals;for(t=0,n=g.length;t<n;t++){var v={};if(void 0!==g[t].vertexNormals)for(v.vertexNormals=[],i=0,r=g[t].vertexNormals.length;i<r;i++){var y=g[t].vertexNormals[i],x={};x.a=y.a.clone(),x.b=y.b.clone(),x.c=y.c.clone(),v.vertexNormals.push(x)}if(void 0!==g[t].faceNormals)for(v.faceNormals=[],i=0,r=g[t].faceNormals.length;i<r;i++)v.faceNormals.push(g[t].faceNormals[i].clone());this.morphNormals.push(v)}var b=e.skinWeights;for(t=0,n=b.length;t<n;t++)this.skinWeights.push(b[t].clone());var w=e.skinIndices;for(t=0,n=w.length;t<n;t++)this.skinIndices.push(w[t].clone());var _=e.lineDistances;for(t=0,n=_.length;t<n;t++)this.lineDistances.push(_[t]);var M=e.boundingBox;null!==M&&(this.boundingBox=M.clone());var S=e.boundingSphere;return null!==S&&(this.boundingSphere=S.clone()),this.elementsNeedUpdate=e.elementsNeedUpdate,this.verticesNeedUpdate=e.verticesNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.lineDistancesNeedUpdate=e.lineDistancesNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(Nn.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(Nn.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setArray:function(e){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");return this.count=void 0!==e?e.length/this.itemSize:0,this.array=e,this},setDynamic:function(e){return this.dynamic=e,this},copy:function(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.dynamic=e.dynamic,this},copyAt:function(e,t,n){e*=this.itemSize,n*=t.itemSize;for(var i=0,r=this.itemSize;i<r;i++)this.array[e+i]=t.array[n+i];return this},copyArray:function(e){return this.array.set(e),this},copyColorsArray:function(e){for(var t=this.array,n=0,i=0,r=e.length;i<r;i++){var a=e[i];void 0===a&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",i),a=new gn),t[n++]=a.r,t[n++]=a.g,t[n++]=a.b}return this},copyVector2sArray:function(e){for(var t=this.array,n=0,i=0,r=e.length;i<r;i++){var a=e[i];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",i),a=new It),t[n++]=a.x,t[n++]=a.y}return this},copyVector3sArray:function(e){for(var t=this.array,n=0,i=0,r=e.length;i<r;i++){var a=e[i];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",i),a=new Dt),t[n++]=a.x,t[n++]=a.y,t[n++]=a.z}return this},copyVector4sArray:function(e){for(var t=this.array,n=0,i=0,r=e.length;i<r;i++){var a=e[i];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",i),a=new Kt),t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n++]=a.w}return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},getX:function(e){return this.array[e*this.itemSize]},setX:function(e,t){return this.array[e*this.itemSize]=t,this},getY:function(e){return this.array[e*this.itemSize+1]},setY:function(e,t){return this.array[e*this.itemSize+1]=t,this},getZ:function(e){return this.array[e*this.itemSize+2]},setZ:function(e,t){return this.array[e*this.itemSize+2]=t,this},getW:function(e){return this.array[e*this.itemSize+3]},setW:function(e,t){return this.array[e*this.itemSize+3]=t,this},setXY:function(e,t,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this},setXYZ:function(e,t,n,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this},setXYZW:function(e,t,n,i,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=r,this},onUpload:function(e){return this.onUploadCallback=e,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)}}),Un.prototype=Object.create(Nn.prototype),Un.prototype.constructor=Un,Bn.prototype=Object.create(Nn.prototype),Bn.prototype.constructor=Bn,Fn.prototype=Object.create(Nn.prototype),Fn.prototype.constructor=Fn,zn.prototype=Object.create(Nn.prototype),zn.prototype.constructor=zn,Gn.prototype=Object.create(Nn.prototype),Gn.prototype.constructor=Gn,Hn.prototype=Object.create(Nn.prototype),Hn.prototype.constructor=Hn,Vn.prototype=Object.create(Nn.prototype),Vn.prototype.constructor=Vn,kn.prototype=Object.create(Nn.prototype),kn.prototype.constructor=kn,jn.prototype=Object.create(Nn.prototype),jn.prototype.constructor=jn,Object.assign(Wn.prototype,{computeGroups:function(e){for(var t,n=[],i=void 0,r=e.faces,a=0;a<r.length;a++){var o=r[a];o.materialIndex!==i&&(i=o.materialIndex,void 0!==t&&(t.count=3*a-t.start,n.push(t)),t={start:3*a,materialIndex:i})}void 0!==t&&(t.count=3*a-t.start,n.push(t)),this.groups=n},fromGeometry:function(e){var t,n=e.faces,i=e.vertices,r=e.faceVertexUvs,a=r[0]&&r[0].length>0,o=r[1]&&r[1].length>0,s=e.morphTargets,c=s.length;if(c>0){t=[];for(var l=0;l<c;l++)t[l]={name:s[l].name,data:[]};this.morphTargets.position=t}var h,u=e.morphNormals,p=u.length;if(p>0){h=[];for(l=0;l<p;l++)h[l]={name:u[l].name,data:[]};this.morphTargets.normal=h}var d=e.skinIndices,f=e.skinWeights,m=d.length===i.length,g=f.length===i.length;i.length>0&&0===n.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(l=0;l<n.length;l++){var v=n[l];this.vertices.push(i[v.a],i[v.b],i[v.c]);var y=v.vertexNormals;if(3===y.length)this.normals.push(y[0],y[1],y[2]);else{var x=v.normal;this.normals.push(x,x,x)}var b,w=v.vertexColors;if(3===w.length)this.colors.push(w[0],w[1],w[2]);else{var _=v.color;this.colors.push(_,_,_)}if(!0===a)void 0!==(b=r[0][l])?this.uvs.push(b[0],b[1],b[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",l),this.uvs.push(new It,new It,new It));if(!0===o)void 0!==(b=r[1][l])?this.uvs2.push(b[0],b[1],b[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",l),this.uvs2.push(new It,new It,new It));for(var M=0;M<c;M++){var S=s[M].vertices;t[M].data.push(S[v.a],S[v.b],S[v.c])}for(M=0;M<p;M++){var T=u[M].vertexNormals[l];h[M].data.push(T.a,T.b,T.c)}m&&this.skinIndices.push(d[v.a],d[v.b],d[v.c]),g&&this.skinWeights.push(f[v.a],f[v.b],f[v.c])}return this.computeGroups(e),this.verticesNeedUpdate=e.verticesNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this}});var Xn=1;function Yn(){Object.defineProperty(this,"id",{value:Xn+=2}),this.uuid=Ct.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}function Jn(e,t,n,i,r,a){Dn.call(this),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:r,depthSegments:a},this.fromBufferGeometry(new Zn(e,t,n,i,r,a)),this.mergeVertices()}function Zn(e,t,n,i,r,a){Yn.call(this),this.type="BoxBufferGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:r,depthSegments:a};var o=this;e=e||1,t=t||1,n=n||1,i=Math.floor(i)||1,r=Math.floor(r)||1,a=Math.floor(a)||1;var s=[],c=[],l=[],h=[],u=0,p=0;function d(e,t,n,i,r,a,d,f,m,g,v){var y,x,b=a/m,w=d/g,_=a/2,M=d/2,S=f/2,T=m+1,E=g+1,A=0,L=0,R=new Dt;for(x=0;x<E;x++){var P=x*w-M;for(y=0;y<T;y++){var C=y*b-_;R[e]=C*i,R[t]=P*r,R[n]=S,c.push(R.x,R.y,R.z),R[e]=0,R[t]=0,R[n]=f>0?1:-1,l.push(R.x,R.y,R.z),h.push(y/m),h.push(1-x/g),A+=1}}for(x=0;x<g;x++)for(y=0;y<m;y++){var I=u+y+T*x,O=u+y+T*(x+1),D=u+(y+1)+T*(x+1),N=u+(y+1)+T*x;s.push(I,O,N),s.push(O,D,N),L+=6}o.addGroup(p,L,v),p+=L,u+=A}d("z","y","x",-1,-1,n,t,e,a,r,0),d("z","y","x",1,-1,n,t,-e,a,r,1),d("x","z","y",1,1,e,n,t,i,a,2),d("x","z","y",1,-1,e,n,-t,i,a,3),d("x","y","z",1,-1,e,t,n,i,r,4),d("x","y","z",-1,-1,e,t,-n,i,r,5),this.setIndex(s),this.addAttribute("position",new kn(c,3)),this.addAttribute("normal",new kn(l,3)),this.addAttribute("uv",new kn(h,2))}function Kn(e,t,n,i){Dn.call(this),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i},this.fromBufferGeometry(new Qn(e,t,n,i)),this.mergeVertices()}function Qn(e,t,n,i){Yn.call(this),this.type="PlaneBufferGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i};var r,a,o=(e=e||1)/2,s=(t=t||1)/2,c=Math.floor(n)||1,l=Math.floor(i)||1,h=c+1,u=l+1,p=e/c,d=t/l,f=[],m=[],g=[],v=[];for(a=0;a<u;a++){var y=a*d-s;for(r=0;r<h;r++){var x=r*p-o;m.push(x,-y,0),g.push(0,0,1),v.push(r/c),v.push(1-a/l)}}for(a=0;a<l;a++)for(r=0;r<c;r++){var b=r+h*a,w=r+h*(a+1),_=r+1+h*(a+1),M=r+1+h*a;f.push(b,w,M),f.push(w,_,M)}this.setIndex(f),this.addAttribute("position",new kn(m,3)),this.addAttribute("normal",new kn(g,3)),this.addAttribute("uv",new kn(v,2))}Yn.prototype=Object.assign(Object.create(s.prototype),{constructor:Yn,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(e){Array.isArray(e)?this.index=new(qn(e)>65535?Vn:Gn)(e,1):this.index=e},addAttribute:function(e,t){return t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):(this.attributes[e]=t,this):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.addAttribute(e,new Nn(arguments[1],arguments[2])))},getAttribute:function(e){return this.attributes[e]},removeAttribute:function(e){return delete this.attributes[e],this},addGroup:function(e,t,n){this.groups.push({start:e,count:t,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix:function(e){var t=this.attributes.position;void 0!==t&&(e.applyToBufferAttribute(t),t.needsUpdate=!0);var n=this.attributes.normal;void 0!==n&&((new Nt).getNormalMatrix(e).applyToBufferAttribute(n),n.needsUpdate=!0);var i=this.attributes.tangent;void 0!==i&&((new Nt).getNormalMatrix(e).applyToBufferAttribute(i),i.needsUpdate=!0);return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(){var e=new sn;return function(t){return e.makeRotationX(t),this.applyMatrix(e),this}}(),rotateY:function(){var e=new sn;return function(t){return e.makeRotationY(t),this.applyMatrix(e),this}}(),rotateZ:function(){var e=new sn;return function(t){return e.makeRotationZ(t),this.applyMatrix(e),this}}(),translate:function(){var e=new sn;return function(t,n,i){return e.makeTranslation(t,n,i),this.applyMatrix(e),this}}(),scale:function(){var e=new sn;return function(t,n,i){return e.makeScale(t,n,i),this.applyMatrix(e),this}}(),lookAt:function(){var e=new Pn;return function(t){e.lookAt(t),e.updateMatrix(),this.applyMatrix(e.matrix)}}(),center:function(){var e=new Dt;return function(){return this.computeBoundingBox(),this.boundingBox.getCenter(e).negate(),this.translate(e.x,e.y,e.z),this}}(),setFromObject:function(e){var t=e.geometry;if(e.isPoints||e.isLine){var n=new kn(3*t.vertices.length,3),i=new kn(3*t.colors.length,3);if(this.addAttribute("position",n.copyVector3sArray(t.vertices)),this.addAttribute("color",i.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length){var r=new kn(t.lineDistances.length,1);this.addAttribute("lineDistance",r.copyArray(t.lineDistances))}null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone())}else e.isMesh&&t&&t.isGeometry&&this.fromGeometry(t);return this},setFromPoints:function(e){for(var t=[],n=0,i=e.length;n<i;n++){var r=e[n];t.push(r.x,r.y,r.z||0)}return this.addAttribute("position",new kn(t,3)),this},updateFromObject:function(e){var t,n=e.geometry;if(e.isMesh){var i=n.__directGeometry;if(!0===n.elementsNeedUpdate&&(i=void 0,n.elementsNeedUpdate=!1),void 0===i)return this.fromGeometry(n);i.verticesNeedUpdate=n.verticesNeedUpdate,i.normalsNeedUpdate=n.normalsNeedUpdate,i.colorsNeedUpdate=n.colorsNeedUpdate,i.uvsNeedUpdate=n.uvsNeedUpdate,i.groupsNeedUpdate=n.groupsNeedUpdate,n.verticesNeedUpdate=!1,n.normalsNeedUpdate=!1,n.colorsNeedUpdate=!1,n.uvsNeedUpdate=!1,n.groupsNeedUpdate=!1,n=i}return!0===n.verticesNeedUpdate&&(void 0!==(t=this.attributes.position)&&(t.copyVector3sArray(n.vertices),t.needsUpdate=!0),n.verticesNeedUpdate=!1),!0===n.normalsNeedUpdate&&(void 0!==(t=this.attributes.normal)&&(t.copyVector3sArray(n.normals),t.needsUpdate=!0),n.normalsNeedUpdate=!1),!0===n.colorsNeedUpdate&&(void 0!==(t=this.attributes.color)&&(t.copyColorsArray(n.colors),t.needsUpdate=!0),n.colorsNeedUpdate=!1),n.uvsNeedUpdate&&(void 0!==(t=this.attributes.uv)&&(t.copyVector2sArray(n.uvs),t.needsUpdate=!0),n.uvsNeedUpdate=!1),n.lineDistancesNeedUpdate&&(void 0!==(t=this.attributes.lineDistance)&&(t.copyArray(n.lineDistances),t.needsUpdate=!0),n.lineDistancesNeedUpdate=!1),n.groupsNeedUpdate&&(n.computeGroups(e.geometry),this.groups=n.groups,n.groupsNeedUpdate=!1),this},fromGeometry:function(e){return e.__directGeometry=(new Wn).fromGeometry(e),this.fromDirectGeometry(e.__directGeometry)},fromDirectGeometry:function(e){var t=new Float32Array(3*e.vertices.length);if(this.addAttribute("position",new Nn(t,3).copyVector3sArray(e.vertices)),e.normals.length>0){var n=new Float32Array(3*e.normals.length);this.addAttribute("normal",new Nn(n,3).copyVector3sArray(e.normals))}if(e.colors.length>0){var i=new Float32Array(3*e.colors.length);this.addAttribute("color",new Nn(i,3).copyColorsArray(e.colors))}if(e.uvs.length>0){var r=new Float32Array(2*e.uvs.length);this.addAttribute("uv",new Nn(r,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){var a=new Float32Array(2*e.uvs2.length);this.addAttribute("uv2",new Nn(a,2).copyVector2sArray(e.uvs2))}for(var o in this.groups=e.groups,e.morphTargets){for(var s=[],c=e.morphTargets[o],l=0,h=c.length;l<h;l++){var u=c[l],p=new kn(3*u.data.length,3);p.name=u.name,s.push(p.copyVector3sArray(u.data))}this.morphAttributes[o]=s}if(e.skinIndices.length>0){var d=new kn(4*e.skinIndices.length,4);this.addAttribute("skinIndex",d.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){var f=new kn(4*e.skinWeights.length,4);this.addAttribute("skinWeight",f.copyVector4sArray(e.skinWeights))}return null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this},computeBoundingBox:function(){var e=new nn;return function(){null===this.boundingBox&&(this.boundingBox=new nn);var t=this.attributes.position,n=this.morphAttributes.position;if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),n)for(var i=0,r=n.length;i<r;i++){var a=n[i];e.setFromBufferAttribute(a),this.boundingBox.expandByPoint(e.min),this.boundingBox.expandByPoint(e.max)}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}}(),computeBoundingSphere:function(){var e=new nn,t=new nn,n=new Dt;return function(){null===this.boundingSphere&&(this.boundingSphere=new rn);var i=this.attributes.position,r=this.morphAttributes.position;if(i){var a=this.boundingSphere.center;if(e.setFromBufferAttribute(i),r)for(var o=0,s=r.length;o<s;o++){var c=r[o];t.setFromBufferAttribute(c),e.expandByPoint(t.min),e.expandByPoint(t.max)}e.getCenter(a);var l=0;for(o=0,s=i.count;o<s;o++)n.fromBufferAttribute(i,o),l=Math.max(l,a.distanceToSquared(n));if(r)for(o=0,s=r.length;o<s;o++)for(var h=0,u=(c=r[o]).count;h<u;h++)n.fromBufferAttribute(c,o),l=Math.max(l,a.distanceToSquared(n));this.boundingSphere.radius=Math.sqrt(l),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var e=this.index,t=this.attributes;if(t.position){var n=t.position.array;if(void 0===t.normal)this.addAttribute("normal",new Nn(new Float32Array(n.length),3));else for(var i=t.normal.array,r=0,a=i.length;r<a;r++)i[r]=0;var o,s,c,l=t.normal.array,h=new Dt,u=new Dt,p=new Dt,d=new Dt,f=new Dt;if(e){var m=e.array;for(r=0,a=e.count;r<a;r+=3)o=3*m[r+0],s=3*m[r+1],c=3*m[r+2],h.fromArray(n,o),u.fromArray(n,s),p.fromArray(n,c),d.subVectors(p,u),f.subVectors(h,u),d.cross(f),l[o]+=d.x,l[o+1]+=d.y,l[o+2]+=d.z,l[s]+=d.x,l[s+1]+=d.y,l[s+2]+=d.z,l[c]+=d.x,l[c+1]+=d.y,l[c+2]+=d.z}else for(r=0,a=n.length;r<a;r+=9)h.fromArray(n,r),u.fromArray(n,r+3),p.fromArray(n,r+6),d.subVectors(p,u),f.subVectors(h,u),d.cross(f),l[r]=d.x,l[r+1]=d.y,l[r+2]=d.z,l[r+3]=d.x,l[r+4]=d.y,l[r+5]=d.z,l[r+6]=d.x,l[r+7]=d.y,l[r+8]=d.z;this.normalizeNormals(),t.normal.needsUpdate=!0}},merge:function(e,t){if(e&&e.isBufferGeometry){void 0===t&&(t=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));var n=this.attributes;for(var i in n)if(void 0!==e.attributes[i])for(var r=n[i].array,a=e.attributes[i],o=a.array,s=0,c=a.itemSize*t;s<o.length;s++,c++)r[c]=o[s];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e)},normalizeNormals:function(){var e=new Dt;return function(){for(var t=this.attributes.normal,n=0,i=t.count;n<i;n++)e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.normalize(),t.setXYZ(n,e.x,e.y,e.z)}}(),toNonIndexed:function(){function e(e,t){for(var n=e.array,i=e.itemSize,r=new n.constructor(t.length*i),a=0,o=0,s=0,c=t.length;s<c;s++){a=t[s]*i;for(var l=0;l<i;l++)r[o++]=n[a++]}return new Nn(r,i)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var t=new Yn,n=this.index.array,i=this.attributes;for(var r in i){var a=e(i[r],n);t.addAttribute(r,a)}var o=this.morphAttributes;for(r in o){for(var s=[],c=o[r],l=0,h=c.length;l<h;l++){a=e(c[l],n);s.push(a)}t.morphAttributes[r]=s}for(var u=this.groups,p=(l=0,u.length);l<p;l++){var d=u[l];t.addGroup(d.start,d.count,d.materialIndex)}return t},toJSON:function(){var e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){var t=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};var i=this.index;null!==i&&(e.data.index={type:i.array.constructor.name,array:Array.prototype.slice.call(i.array)});var r=this.attributes;for(var n in r){var a={itemSize:(p=r[n]).itemSize,type:p.array.constructor.name,array:Array.prototype.slice.call(p.array),normalized:p.normalized};""!==p.name&&(a.name=p.name),e.data.attributes[n]=a}var o={},s=!1;for(var n in this.morphAttributes){for(var c=this.morphAttributes[n],l=[],h=0,u=c.length;h<u;h++){var p;a={itemSize:(p=c[h]).itemSize,type:p.array.constructor.name,array:Array.prototype.slice.call(p.array),normalized:p.normalized};""!==p.name&&(a.name=p.name),l.push(a)}l.length>0&&(o[n]=l,s=!0)}s&&(e.data.morphAttributes=o);var d=this.groups;d.length>0&&(e.data.groups=JSON.parse(JSON.stringify(d)));var f=this.boundingSphere;return null!==f&&(e.data.boundingSphere={center:f.center.toArray(),radius:f.radius}),e},clone:function(){return(new Yn).copy(this)},copy:function(e){var t,n,i;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var r=e.index;null!==r&&this.setIndex(r.clone());var a=e.attributes;for(t in a){var o=a[t];this.addAttribute(t,o.clone())}var s=e.morphAttributes;for(t in s){var c=[],l=s[t];for(n=0,i=l.length;n<i;n++)c.push(l[n].clone());this.morphAttributes[t]=c}var h=e.groups;for(n=0,i=h.length;n<i;n++){var u=h[n];this.addGroup(u.start,u.count,u.materialIndex)}var p=e.boundingBox;null!==p&&(this.boundingBox=p.clone());var d=e.boundingSphere;return null!==d&&(this.boundingSphere=d.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Jn.prototype=Object.create(Dn.prototype),Jn.prototype.constructor=Jn,Zn.prototype=Object.create(Yn.prototype),Zn.prototype.constructor=Zn,Kn.prototype=Object.create(Dn.prototype),Kn.prototype.constructor=Kn,Qn.prototype=Object.create(Yn.prototype),Qn.prototype.constructor=Qn;var $n=0;function ei(){Object.defineProperty(this,"id",{value:$n++}),this.uuid=Ct.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.lights=!0,this.blending=E,this.side=x,this.flatShading=!1,this.vertexTangents=!1,this.vertexColors=_,this.opacity=1,this.transparent=!1,this.blendSrc=G,this.blendDst=H,this.blendEquation=C,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Z,this.depthTest=!0,this.depthWrite=!0,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.visible=!0,this.userData={},this.needsUpdate=!0}ei.prototype=Object.assign(Object.create(s.prototype),{constructor:ei,isMaterial:!0,onBeforeCompile:function(){},setValues:function(e){if(void 0!==e)for(var t in e){var n=e[t];if(void 0!==n)if("shading"!==t){var i=this[t];void 0!==i?i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===n;else console.warn("THREE.Material: '"+t+"' parameter is undefined.")}},toJSON:function(e){var t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});var n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function i(e){var t=[];for(var n in e){var i=e[n];delete i.metadata,t.push(i)}return t}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearCoat&&(n.clearCoat=this.clearCoat),void 0!==this.clearCoatRoughness&&(n.clearCoatRoughness=this.clearCoatRoughness),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,n.reflectivity=this.reflectivity,void 0!==this.combine&&(n.combine=this.combine),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.size&&(n.size=this.size),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==E&&(n.blending=this.blending),!0===this.flatShading&&(n.flatShading=this.flatShading),this.side!==x&&(n.side=this.side),this.vertexColors!==_&&(n.vertexColors=this.vertexColors),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),t){var r=i(e.textures),a=i(e.images);r.length>0&&(n.textures=r),a.length>0&&(n.images=a)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.lights=e.lights,this.blending=e.blending,this.side=e.side,this.flatShading=e.flatShading,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.userData=JSON.parse(JSON.stringify(e.userData)),this.clipShadows=e.clipShadows,this.clipIntersection=e.clipIntersection;var t=e.clippingPlanes,n=null;if(null!==t){var i=t.length;n=new Array(i);for(var r=0;r!==i;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.shadowSide=e.shadowSide,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var ti,ni,ii,ri,ai,oi,si,ci,li,hi,ui,pi,di="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fi="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}";function mi(e){ei.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=di,this.fragmentShader=fi,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,void 0!==e&&(void 0!==e.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))}function gi(e,t){this.origin=void 0!==e?e:new Dt,this.direction=void 0!==t?t:new Dt}function vi(e,t,n){this.a=void 0!==e?e:new Dt,this.b=void 0!==t?t:new Dt,this.c=void 0!==n?n:new Dt}function yi(e){ei.call(this),this.type="MeshBasicMaterial",this.color=new gn(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=te,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.lights=!1,this.setValues(e)}function xi(e,t){Pn.call(this),this.type="Mesh",this.geometry=void 0!==e?e:new Yn,this.material=void 0!==t?t:new yi({color:16777215*Math.random()}),this.drawMode=vt,this.updateMorphTargets()}function bi(e,t,n,i){var r,a,o=new gn(0),s=0,c=null,l=0;function h(e,n){t.buffers.color.setClear(e.r,e.g,e.b,n,i)}return{getClearColor:function(){return o},setClearColor:function(e,t){o.set(e),h(o,s=void 0!==t?t:1)},getClearAlpha:function(){return s},setClearAlpha:function(e){h(o,s=e)},render:function(t,i,u,p){var d=i.background,f=e.vr,m=f.getSession&&f.getSession();if(m&&"additive"===m.environmentBlendMode&&(d=null),null===d?(h(o,s),c=null,l=0):d&&d.isColor&&(h(d,1),p=!0,c=null,l=0),(e.autoClear||p)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),d&&(d.isCubeTexture||d.isWebGLRenderTargetCube)){void 0===a&&((a=new xi(new Zn(1,1,1),new mi({type:"BackgroundCubeMaterial",uniforms:ln(xn.cube.uniforms),vertexShader:xn.cube.vertexShader,fragmentShader:xn.cube.fragmentShader,side:b,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.removeAttribute("normal"),a.geometry.removeAttribute("uv"),a.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.tCube.value}}),n.update(a));var g=d.isWebGLRenderTargetCube?d.texture:d;a.material.uniforms.tCube.value=g,a.material.uniforms.tFlip.value=d.isWebGLRenderTargetCube?1:-1,c===d&&l===g.version||(a.material.needsUpdate=!0,c=d,l=g.version),t.unshift(a,a.geometry,a.material,0,0,null)}else d&&d.isTexture&&(void 0===r&&((r=new xi(new Qn(2,2),new mi({type:"BackgroundMaterial",uniforms:ln(xn.background.uniforms),vertexShader:xn.background.vertexShader,fragmentShader:xn.background.fragmentShader,side:x,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.removeAttribute("normal"),Object.defineProperty(r.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(r)),r.material.uniforms.t2D.value=d,!0===d.matrixAutoUpdate&&d.updateMatrix(),r.material.uniforms.uvTransform.value.copy(d.matrix),c===d&&l===d.version||(r.material.needsUpdate=!0,c=d,l=d.version),t.unshift(r,r.geometry,r.material,0,0,null))}}}function wi(e,t,n,i){var r;this.setMode=function(e){r=e},this.render=function(t,i){e.drawArrays(r,t,i),n.update(i,r)},this.renderInstances=function(a,o,s){var c;if(i.isWebGL2)c=e;else if(null===(c=t.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");c[i.isWebGL2?"drawArraysInstanced":"drawArraysInstancedANGLE"](r,o,s,a.maxInstancedCount),n.update(s,r,a.maxInstancedCount)}}function _i(e,t,n){var i;function r(t){if("highp"===t){if(e.getShaderPrecisionFormat(35633,36338).precision>0&&e.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(35633,36337).precision>0&&e.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}var a="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext,o=void 0!==n.precision?n.precision:"highp",s=r(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);var c=!0===n.logarithmicDepthBuffer,l=e.getParameter(34930),h=e.getParameter(35660),u=e.getParameter(3379),p=e.getParameter(34076),d=e.getParameter(34921),f=e.getParameter(36347),m=e.getParameter(36348),g=e.getParameter(36349),v=h>0,y=a||!!t.get("OES_texture_float");return{isWebGL2:a,getMaxAnisotropy:function(){if(void 0!==i)return i;var n=t.get("EXT_texture_filter_anisotropic");return i=null!==n?e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:r,precision:o,logarithmicDepthBuffer:c,maxTextures:l,maxVertexTextures:h,maxTextureSize:u,maxCubemapSize:p,maxAttributes:d,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:v,floatFragmentTextures:y,floatVertexTextures:v&&y,maxSamples:a?e.getParameter(36183):0}}function Mi(){var e=this,t=null,n=0,i=!1,r=!1,a=new an,o=new Nt,s={value:null,needsUpdate:!1};function c(){s.value!==t&&(s.value=t,s.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function l(t,n,i,r){var c=null!==t?t.length:0,l=null;if(0!==c){if(l=s.value,!0!==r||null===l){var h=i+4*c,u=n.matrixWorldInverse;o.getNormalMatrix(u),(null===l||l.length<h)&&(l=new Float32Array(h));for(var p=0,d=i;p!==c;++p,d+=4)a.copy(t[p]).applyMatrix4(u,o),a.normal.toArray(l,d),l[d+3]=a.constant}s.value=l,s.needsUpdate=!0}return e.numPlanes=c,l}this.uniform=s,this.numPlanes=0,this.numIntersection=0,this.init=function(e,r,a){var o=0!==e.length||r||0!==n||i;return i=r,t=l(e,a,0),n=e.length,o},this.beginShadows=function(){r=!0,l(null)},this.endShadows=function(){r=!1,c()},this.setState=function(e,a,o,h,u,p){if(!i||null===e||0===e.length||r&&!o)r?l(null):c();else{var d=r?0:n,f=4*d,m=u.clippingState||null;s.value=m,m=l(e,h,f,p);for(var g=0;g!==f;++g)m[g]=t[g];u.clippingState=m,this.numIntersection=a?this.numPlanes:0,this.numPlanes+=d}}}function Si(e){var t={};return{get:function(n){if(void 0!==t[n])return t[n];var i;switch(n){case"WEBGL_depth_texture":i=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=e.getExtension(n)}return null===i&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),t[n]=i,i}}}function Ti(e,t,n){var i={},r={};function a(e){var o=e.target,s=i[o.id];for(var c in null!==s.index&&t.remove(s.index),s.attributes)t.remove(s.attributes[c]);o.removeEventListener("dispose",a),delete i[o.id];var l=r[s.id];l&&(t.remove(l),delete r[s.id]),n.memory.geometries--}return{get:function(e,t){var r=i[t.id];return r||(t.addEventListener("dispose",a),t.isBufferGeometry?r=t:t.isGeometry&&(void 0===t._bufferGeometry&&(t._bufferGeometry=(new Yn).setFromObject(e)),r=t._bufferGeometry),i[t.id]=r,n.memory.geometries++,r)},update:function(e){var n=e.index,i=e.attributes;for(var r in null!==n&&t.update(n,34963),i)t.update(i[r],34962);var a=e.morphAttributes;for(var r in a)for(var o=a[r],s=0,c=o.length;s<c;s++)t.update(o[s],34962)},getWireframeAttribute:function(e){var n=r[e.id];if(n)return n;var i,a=[],o=e.index,s=e.attributes;if(null!==o)for(var c=0,l=(i=o.array).length;c<l;c+=3){var h=i[c+0],u=i[c+1],p=i[c+2];a.push(h,u,u,p,p,h)}else for(c=0,l=(i=s.position.array).length/3-1;c<l;c+=3)h=c+0,u=c+1,p=c+2,a.push(h,u,u,p,p,h);return n=new(qn(a)>65535?Vn:Gn)(a,1),t.update(n,34963),r[e.id]=n,n}}}function Ei(e,t,n,i){var r,a,o;this.setMode=function(e){r=e},this.setIndex=function(e){a=e.type,o=e.bytesPerElement},this.render=function(t,i){e.drawElements(r,i,a,t*o),n.update(i,r)},this.renderInstances=function(s,c,l){var h;if(i.isWebGL2)h=e;else if(null===(h=t.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");h[i.isWebGL2?"drawElementsInstanced":"drawElementsInstancedANGLE"](r,l,a,c*o,s.maxInstancedCount),n.update(l,r,s.maxInstancedCount)}}function Ai(e){var t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function(){t.frame++,t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(e,n,i){switch(i=i||1,t.calls++,n){case 4:t.triangles+=i*(e/3);break;case 5:case 6:t.triangles+=i*(e-2);break;case 1:t.lines+=i*(e/2);break;case 3:t.lines+=i*(e-1);break;case 2:t.lines+=i*e;break;case 0:t.points+=i*e;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",n)}}}}function Li(e,t){return Math.abs(t[1])-Math.abs(e[1])}function Ri(e){var t={},n=new Float32Array(8);return{update:function(i,r,a,o){var s=i.morphTargetInfluences,c=s.length,l=t[r.id];if(void 0===l){l=[];for(var h=0;h<c;h++)l[h]=[h,0];t[r.id]=l}var u=a.morphTargets&&r.morphAttributes.position,p=a.morphNormals&&r.morphAttributes.normal;for(h=0;h<c;h++)0!==(d=l[h])[1]&&(u&&r.removeAttribute("morphTarget"+h),p&&r.removeAttribute("morphNormal"+h));for(h=0;h<c;h++)(d=l[h])[0]=h,d[1]=s[h];for(l.sort(Li),h=0;h<8;h++){var d;if(d=l[h]){var f=d[0],m=d[1];if(m){u&&r.addAttribute("morphTarget"+h,u[f]),p&&r.addAttribute("morphNormal"+h,p[f]),n[h]=m;continue}}n[h]=0}o.getUniforms().setValue(e,"morphTargetInfluences",n)}}}function Pi(e,t){var n={};return{update:function(i){var r=t.render.frame,a=i.geometry,o=e.get(i,a);return n[o.id]!==r&&(a.isGeometry&&o.updateFromObject(i),e.update(o),n[o.id]=r),o},dispose:function(){n={}}}}function Ci(e,t,n,i,r,a,o,s,c,l){e=void 0!==e?e:[],t=void 0!==t?t:he,o=void 0!==o?o:ze,Zt.call(this,e,t,n,i,r,a,o,s,c,l),this.flipY=!1}function Ii(e,t,n,i){Zt.call(this,null),this.image={data:e,width:t,height:n,depth:i},this.magFilter=be,this.minFilter=be,this.wrapR=ye,this.generateMipmaps=!1,this.flipY=!1}function Oi(e,t,n,i){Zt.call(this,null),this.image={data:e,width:t,height:n,depth:i},this.magFilter=be,this.minFilter=be,this.wrapR=ye,this.generateMipmaps=!1,this.flipY=!1}mi.prototype=Object.create(ei.prototype),mi.prototype.constructor=mi,mi.prototype.isShaderMaterial=!0,mi.prototype.copy=function(e){return ei.prototype.copy.call(this,e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=ln(e.uniforms),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.extensions=e.extensions,this},mi.prototype.toJSON=function(e){var t=ei.prototype.toJSON.call(this,e);for(var n in t.uniforms={},this.uniforms){var i=this.uniforms[n].value;i&&i.isTexture?t.uniforms[n]={type:"t",value:i.toJSON(e).uuid}:i&&i.isColor?t.uniforms[n]={type:"c",value:i.getHex()}:i&&i.isVector2?t.uniforms[n]={type:"v2",value:i.toArray()}:i&&i.isVector3?t.uniforms[n]={type:"v3",value:i.toArray()}:i&&i.isVector4?t.uniforms[n]={type:"v4",value:i.toArray()}:i&&i.isMatrix3?t.uniforms[n]={type:"m3",value:i.toArray()}:i&&i.isMatrix4?t.uniforms[n]={type:"m4",value:i.toArray()}:t.uniforms[n]={value:i}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;var r={};for(var a in this.extensions)!0===this.extensions[a]&&(r[a]=!0);return Object.keys(r).length>0&&(t.extensions=r),t},Object.assign(gi.prototype,{set:function(e,t){return this.origin.copy(e),this.direction.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this},at:function(e,t){return void 0===t&&(console.warn("THREE.Ray: .at() target is now required"),t=new Dt),t.copy(this.direction).multiplyScalar(e).add(this.origin)},lookAt:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this},recast:function(){var e=new Dt;return function(t){return this.origin.copy(this.at(t,e)),this}}(),closestPointToPoint:function(e,t){void 0===t&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),t=new Dt),t.subVectors(e,this.origin);var n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)},distanceToPoint:function(e){return Math.sqrt(this.distanceSqToPoint(e))},distanceSqToPoint:function(){var e=new Dt;return function(t){var n=e.subVectors(t,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(t):(e.copy(this.direction).multiplyScalar(n).add(this.origin),e.distanceToSquared(t))}}(),distanceSqToSegment:(ni=new Dt,ii=new Dt,ri=new Dt,function(e,t,n,i){ni.copy(e).add(t).multiplyScalar(.5),ii.copy(t).sub(e).normalize(),ri.copy(this.origin).sub(ni);var r,a,o,s,c=.5*e.distanceTo(t),l=-this.direction.dot(ii),h=ri.dot(this.direction),u=-ri.dot(ii),p=ri.lengthSq(),d=Math.abs(1-l*l);if(d>0)if(a=l*h-u,s=c*d,(r=l*u-h)>=0)if(a>=-s)if(a<=s){var f=1/d;o=(r*=f)*(r+l*(a*=f)+2*h)+a*(l*r+a+2*u)+p}else a=c,o=-(r=Math.max(0,-(l*a+h)))*r+a*(a+2*u)+p;else a=-c,o=-(r=Math.max(0,-(l*a+h)))*r+a*(a+2*u)+p;else a<=-s?o=-(r=Math.max(0,-(-l*c+h)))*r+(a=r>0?-c:Math.min(Math.max(-c,-u),c))*(a+2*u)+p:a<=s?(r=0,o=(a=Math.min(Math.max(-c,-u),c))*(a+2*u)+p):o=-(r=Math.max(0,-(l*c+h)))*r+(a=r>0?c:Math.min(Math.max(-c,-u),c))*(a+2*u)+p;else a=l>0?-c:c,o=-(r=Math.max(0,-(l*a+h)))*r+a*(a+2*u)+p;return n&&n.copy(this.direction).multiplyScalar(r).add(this.origin),i&&i.copy(ii).multiplyScalar(a).add(ni),o}),intersectSphere:function(){var e=new Dt;return function(t,n){e.subVectors(t.center,this.origin);var i=e.dot(this.direction),r=e.dot(e)-i*i,a=t.radius*t.radius;if(r>a)return null;var o=Math.sqrt(a-r),s=i-o,c=i+o;return s<0&&c<0?null:s<0?this.at(c,n):this.at(s,n)}}(),intersectsSphere:function(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius},distanceToPlane:function(e){var t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null},intersectPlane:function(e,t){var n=this.distanceToPlane(e);return null===n?null:this.at(n,t)},intersectsPlane:function(e){var t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0},intersectBox:function(e,t){var n,i,r,a,o,s,c=1/this.direction.x,l=1/this.direction.y,h=1/this.direction.z,u=this.origin;return c>=0?(n=(e.min.x-u.x)*c,i=(e.max.x-u.x)*c):(n=(e.max.x-u.x)*c,i=(e.min.x-u.x)*c),l>=0?(r=(e.min.y-u.y)*l,a=(e.max.y-u.y)*l):(r=(e.max.y-u.y)*l,a=(e.min.y-u.y)*l),n>a||r>i?null:((r>n||n!=n)&&(n=r),(a<i||i!=i)&&(i=a),h>=0?(o=(e.min.z-u.z)*h,s=(e.max.z-u.z)*h):(o=(e.max.z-u.z)*h,s=(e.min.z-u.z)*h),n>s||o>i?null:((o>n||n!=n)&&(n=o),(s<i||i!=i)&&(i=s),i<0?null:this.at(n>=0?n:i,t)))},intersectsBox:(ti=new Dt,function(e){return null!==this.intersectBox(e,ti)}),intersectTriangle:function(){var e=new Dt,t=new Dt,n=new Dt,i=new Dt;return function(r,a,o,s,c){t.subVectors(a,r),n.subVectors(o,r),i.crossVectors(t,n);var l,h=this.direction.dot(i);if(h>0){if(s)return null;l=1}else{if(!(h<0))return null;l=-1,h=-h}e.subVectors(this.origin,r);var u=l*this.direction.dot(n.crossVectors(e,n));if(u<0)return null;var p=l*this.direction.dot(t.cross(e));if(p<0)return null;if(u+p>h)return null;var d=-l*e.dot(i);return d<0?null:this.at(d/h,c)}}(),applyMatrix4:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this},equals:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}}),Object.assign(vi,{getNormal:(oi=new Dt,function(e,t,n,i){void 0===i&&(console.warn("THREE.Triangle: .getNormal() target is now required"),i=new Dt),i.subVectors(n,t),oi.subVectors(e,t),i.cross(oi);var r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}),getBarycoord:function(){var e=new Dt,t=new Dt,n=new Dt;return function(i,r,a,o,s){e.subVectors(o,r),t.subVectors(a,r),n.subVectors(i,r);var c=e.dot(e),l=e.dot(t),h=e.dot(n),u=t.dot(t),p=t.dot(n),d=c*u-l*l;if(void 0===s&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),s=new Dt),0===d)return s.set(-2,-1,-1);var f=1/d,m=(u*h-l*p)*f,g=(c*p-l*h)*f;return s.set(1-m-g,g,m)}}(),containsPoint:function(){var e=new Dt;return function(t,n,i,r){return vi.getBarycoord(t,n,i,r,e),e.x>=0&&e.y>=0&&e.x+e.y<=1}}(),getUV:(ai=new Dt,function(e,t,n,i,r,a,o,s){return this.getBarycoord(e,t,n,i,ai),s.set(0,0),s.addScaledVector(r,ai.x),s.addScaledVector(a,ai.y),s.addScaledVector(o,ai.z),s})}),Object.assign(vi.prototype,{set:function(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this},setFromPointsAndIndices:function(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},getArea:function(){var e=new Dt,t=new Dt;return function(){return e.subVectors(this.c,this.b),t.subVectors(this.a,this.b),.5*e.cross(t).length()}}(),getMidpoint:function(e){return void 0===e&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),e=new Dt),e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(e){return vi.getNormal(this.a,this.b,this.c,e)},getPlane:function(e){return void 0===e&&(console.warn("THREE.Triangle: .getPlane() target is now required"),e=new Dt),e.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(e,t){return vi.getBarycoord(e,this.a,this.b,this.c,t)},containsPoint:function(e){return vi.containsPoint(e,this.a,this.b,this.c)},getUV:function(e,t,n,i,r){return vi.getUV(e,this.a,this.b,this.c,t,n,i,r)},intersectsBox:function(e){return e.intersectsTriangle(this)},closestPointToPoint:(si=new Dt,ci=new Dt,li=new Dt,hi=new Dt,ui=new Dt,pi=new Dt,function(e,t){void 0===t&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),t=new Dt);var n,i,r=this.a,a=this.b,o=this.c;si.subVectors(a,r),ci.subVectors(o,r),hi.subVectors(e,r);var s=si.dot(hi),c=ci.dot(hi);if(s<=0&&c<=0)return t.copy(r);ui.subVectors(e,a);var l=si.dot(ui),h=ci.dot(ui);if(l>=0&&h<=l)return t.copy(a);var u=s*h-l*c;if(u<=0&&s>=0&&l<=0)return n=s/(s-l),t.copy(r).addScaledVector(si,n);pi.subVectors(e,o);var p=si.dot(pi),d=ci.dot(pi);if(d>=0&&p<=d)return t.copy(o);var f=p*c-s*d;if(f<=0&&c>=0&&d<=0)return i=c/(c-d),t.copy(r).addScaledVector(ci,i);var m=l*d-p*h;if(m<=0&&h-l>=0&&p-d>=0)return li.subVectors(o,a),i=(h-l)/(h-l+(p-d)),t.copy(a).addScaledVector(li,i);var g=1/(m+f+u);return n=f*g,i=u*g,t.copy(r).addScaledVector(si,n).addScaledVector(ci,i)}),equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}),yi.prototype=Object.create(ei.prototype),yi.prototype.constructor=yi,yi.prototype.isMeshBasicMaterial=!0,yi.prototype.copy=function(e){return ei.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this},xi.prototype=Object.assign(Object.create(Pn.prototype),{constructor:xi,isMesh:!0,setDrawMode:function(e){this.drawMode=e},copy:function(e){return Pn.prototype.copy.call(this,e),this.drawMode=e.drawMode,void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this},updateMorphTargets:function(){var e,t,n,i=this.geometry;if(i.isBufferGeometry){var r=i.morphAttributes,a=Object.keys(r);if(a.length>0){var o=r[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=o.length;e<t;e++)n=o[e].name||String(e),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}else{var s=i.morphTargets;void 0!==s&&s.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(){var e=new sn,t=new gi,n=new rn,i=new Dt,r=new Dt,a=new Dt,o=new Dt,s=new Dt,c=new Dt,l=new Dt,h=new Dt,u=new Dt,p=new It,d=new It,f=new It,m=new Dt,g=new Dt;function v(e,t,n,i,r,a,o,s){if(null===(t.side===b?i.intersectTriangle(o,a,r,!0,s):i.intersectTriangle(r,a,o,t.side!==w,s)))return null;g.copy(s),g.applyMatrix4(e.matrixWorld);var c=n.ray.origin.distanceTo(g);return c<n.near||c>n.far?null:{distance:c,point:g.clone(),object:e}}function y(e,t,n,g,y,x,b,w,_,M){i.fromBufferAttribute(y,w),r.fromBufferAttribute(y,_),a.fromBufferAttribute(y,M);var S=e.morphTargetInfluences;if(t.morphTargets&&x&&S){l.set(0,0,0),h.set(0,0,0),u.set(0,0,0);for(var T=0,E=x.length;T<E;T++){var A=S[T],L=x[T];0!==A&&(o.fromBufferAttribute(L,w),s.fromBufferAttribute(L,_),c.fromBufferAttribute(L,M),l.addScaledVector(o.sub(i),A),h.addScaledVector(s.sub(r),A),u.addScaledVector(c.sub(a),A))}i.add(l),r.add(h),a.add(u)}var R=v(e,t,n,g,i,r,a,m);if(R){b&&(p.fromBufferAttribute(b,w),d.fromBufferAttribute(b,_),f.fromBufferAttribute(b,M),R.uv=vi.getUV(m,i,r,a,p,d,f,new It));var P=new _n(w,_,M);vi.getNormal(i,r,a,P.normal),R.face=P}return R}return function(i,r){var a,o=this.geometry,s=this.material,c=this.matrixWorld;if(void 0!==s&&(null===o.boundingSphere&&o.computeBoundingSphere(),n.copy(o.boundingSphere),n.applyMatrix4(c),!1!==i.ray.intersectsSphere(n)&&(e.getInverse(c),t.copy(i.ray).applyMatrix4(e),null===o.boundingBox||!1!==t.intersectsBox(o.boundingBox))))if(o.isBufferGeometry){var l,h,u,g,x,b,w,_,M,S=o.index,T=o.attributes.position,E=o.morphAttributes.position,A=o.attributes.uv,L=o.groups,R=o.drawRange;if(null!==S)if(Array.isArray(s))for(g=0,b=L.length;g<b;g++)for(M=s[(_=L[g]).materialIndex],x=Math.max(_.start,R.start),w=Math.min(_.start+_.count,R.start+R.count);x<w;x+=3)l=S.getX(x),h=S.getX(x+1),u=S.getX(x+2),(a=y(this,M,i,t,T,E,A,l,h,u))&&(a.faceIndex=Math.floor(x/3),a.face.materialIndex=_.materialIndex,r.push(a));else for(g=Math.max(0,R.start),b=Math.min(S.count,R.start+R.count);g<b;g+=3)l=S.getX(g),h=S.getX(g+1),u=S.getX(g+2),(a=y(this,s,i,t,T,E,A,l,h,u))&&(a.faceIndex=Math.floor(g/3),r.push(a));else if(void 0!==T)if(Array.isArray(s))for(g=0,b=L.length;g<b;g++)for(M=s[(_=L[g]).materialIndex],x=Math.max(_.start,R.start),w=Math.min(_.start+_.count,R.start+R.count);x<w;x+=3)(a=y(this,M,i,t,T,E,A,l=x,h=x+1,u=x+2))&&(a.faceIndex=Math.floor(x/3),a.face.materialIndex=_.materialIndex,r.push(a));else for(g=Math.max(0,R.start),b=Math.min(T.count,R.start+R.count);g<b;g+=3)(a=y(this,s,i,t,T,E,A,l=g,h=g+1,u=g+2))&&(a.faceIndex=Math.floor(g/3),r.push(a))}else if(o.isGeometry){var P,C,I,O,D=Array.isArray(s),N=o.vertices,U=o.faces,B=o.faceVertexUvs[0];B.length>0&&(O=B);for(var F=0,z=U.length;F<z;F++){var G=U[F],H=D?s[G.materialIndex]:s;if(void 0!==H&&(P=N[G.a],C=N[G.b],I=N[G.c],a=v(this,H,i,t,P,C,I,m))){if(O&&O[F]){var V=O[F];p.copy(V[0]),d.copy(V[1]),f.copy(V[2]),a.uv=vi.getUV(m,P,C,I,p,d,f,new It)}a.face=G,a.faceIndex=F,r.push(a)}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Ci.prototype=Object.create(Zt.prototype),Ci.prototype.constructor=Ci,Ci.prototype.isCubeTexture=!0,Object.defineProperty(Ci.prototype,"images",{get:function(){return this.image},set:function(e){this.image=e}}),Ii.prototype=Object.create(Zt.prototype),Ii.prototype.constructor=Ii,Ii.prototype.isDataTexture2DArray=!0,Oi.prototype=Object.create(Zt.prototype),Oi.prototype.constructor=Oi,Oi.prototype.isDataTexture3D=!0;var Di=new Zt,Ni=new Ii,Ui=new Oi,Bi=new Ci,Fi=[],zi=[],Gi=new Float32Array(16),Hi=new Float32Array(9),Vi=new Float32Array(4);function ki(e,t,n){var i=e[0];if(i<=0||i>0)return e;var r=t*n,a=Fi[r];if(void 0===a&&(a=new Float32Array(r),Fi[r]=a),0!==t){i.toArray(a,0);for(var o=1,s=0;o!==t;++o)s+=n,e[o].toArray(a,s)}return a}function ji(e,t){if(e.length!==t.length)return!1;for(var n=0,i=e.length;n<i;n++)if(e[n]!==t[n])return!1;return!0}function Wi(e,t){for(var n=0,i=t.length;n<i;n++)e[n]=t[n]}function qi(e,t){var n=zi[t];void 0===n&&(n=new Int32Array(t),zi[t]=n);for(var i=0;i!==t;++i)n[i]=e.allocateTextureUnit();return n}function Xi(e,t){var n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function Yi(e,t){var n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function Ji(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(ji(n,t))return;e.uniform2fv(this.addr,t),Wi(n,t)}}function Zi(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else if(void 0!==t.r)n[0]===t.r&&n[1]===t.g&&n[2]===t.b||(e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b);else{if(ji(n,t))return;e.uniform3fv(this.addr,t),Wi(n,t)}}function Ki(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(ji(n,t))return;e.uniform4fv(this.addr,t),Wi(n,t)}}function Qi(e,t){var n=this.cache,i=t.elements;if(void 0===i){if(ji(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),Wi(n,t)}else{if(ji(n,i))return;Vi.set(i),e.uniformMatrix2fv(this.addr,!1,Vi),Wi(n,i)}}function $i(e,t){var n=this.cache,i=t.elements;if(void 0===i){if(ji(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),Wi(n,t)}else{if(ji(n,i))return;Hi.set(i),e.uniformMatrix3fv(this.addr,!1,Hi),Wi(n,i)}}function er(e,t){var n=this.cache,i=t.elements;if(void 0===i){if(ji(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),Wi(n,t)}else{if(ji(n,i))return;Gi.set(i),e.uniformMatrix4fv(this.addr,!1,Gi),Wi(n,i)}}function tr(e,t,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.safeSetTexture2D(t||Di,r)}function nr(e,t,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.setTexture2DArray(t||Ni,r)}function ir(e,t,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.setTexture3D(t||Ui,r)}function rr(e,t,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.safeSetTextureCube(t||Bi,r)}function ar(e,t){var n=this.cache;ji(n,t)||(e.uniform2iv(this.addr,t),Wi(n,t))}function or(e,t){var n=this.cache;ji(n,t)||(e.uniform3iv(this.addr,t),Wi(n,t))}function sr(e,t){var n=this.cache;ji(n,t)||(e.uniform4iv(this.addr,t),Wi(n,t))}function cr(e,t){var n=this.cache;ji(n,t)||(e.uniform1fv(this.addr,t),Wi(n,t))}function lr(e,t){var n=this.cache;ji(n,t)||(e.uniform1iv(this.addr,t),Wi(n,t))}function hr(e,t){var n=this.cache,i=ki(t,this.size,2);ji(n,i)||(e.uniform2fv(this.addr,i),this.updateCache(i))}function ur(e,t){var n=this.cache,i=ki(t,this.size,3);ji(n,i)||(e.uniform3fv(this.addr,i),this.updateCache(i))}function pr(e,t){var n=this.cache,i=ki(t,this.size,4);ji(n,i)||(e.uniform4fv(this.addr,i),this.updateCache(i))}function dr(e,t){var n=this.cache,i=ki(t,this.size,4);ji(n,i)||(e.uniformMatrix2fv(this.addr,!1,i),this.updateCache(i))}function fr(e,t){var n=this.cache,i=ki(t,this.size,9);ji(n,i)||(e.uniformMatrix3fv(this.addr,!1,i),this.updateCache(i))}function mr(e,t){var n=this.cache,i=ki(t,this.size,16);ji(n,i)||(e.uniformMatrix4fv(this.addr,!1,i),this.updateCache(i))}function gr(e,t,n){var i=this.cache,r=t.length,a=qi(n,r);!1===ji(i,a)&&(e.uniform1iv(this.addr,a),Wi(i,a));for(var o=0;o!==r;++o)n.safeSetTexture2D(t[o]||Di,a[o])}function vr(e,t,n){var i=this.cache,r=t.length,a=qi(n,r);!1===ji(i,a)&&(e.uniform1iv(this.addr,a),Wi(i,a));for(var o=0;o!==r;++o)n.safeSetTextureCube(t[o]||Bi,a[o])}function yr(e,t,n){this.id=e,this.addr=n,this.cache=[],this.setValue=function(e){switch(e){case 5126:return Xi;case 35664:return Ji;case 35665:return Zi;case 35666:return Ki;case 35674:return Qi;case 35675:return $i;case 35676:return er;case 35678:case 36198:return tr;case 35679:return ir;case 35680:return rr;case 36289:return nr;case 5124:case 35670:return Yi;case 35667:case 35671:return ar;case 35668:case 35672:return or;case 35669:case 35673:return sr}}(t.type)}function xr(e,t,n){this.id=e,this.addr=n,this.cache=[],this.size=t.size,this.setValue=function(e){switch(e){case 5126:return cr;case 35664:return hr;case 35665:return ur;case 35666:return pr;case 35674:return dr;case 35675:return fr;case 35676:return mr;case 35678:return gr;case 35680:return vr;case 5124:case 35670:return lr;case 35667:case 35671:return ar;case 35668:case 35672:return or;case 35669:case 35673:return sr}}(t.type)}function br(e){this.id=e,this.seq=[],this.map={}}xr.prototype.updateCache=function(e){var t=this.cache;e instanceof Float32Array&&t.length!==e.length&&(this.cache=new Float32Array(e.length)),Wi(t,e)},br.prototype.setValue=function(e,t,n){for(var i=this.seq,r=0,a=i.length;r!==a;++r){var o=i[r];o.setValue(e,t[o.id],n)}};var wr=/([\w\d_]+)(\])?(\[|\.)?/g;function _r(e,t){e.seq.push(t),e.map[t.id]=t}function Mr(e,t,n){var i=e.name,r=i.length;for(wr.lastIndex=0;;){var a=wr.exec(i),o=wr.lastIndex,s=a[1],c="]"===a[2],l=a[3];if(c&&(s|=0),void 0===l||"["===l&&o+2===r){_r(n,void 0===l?new yr(s,e,t):new xr(s,e,t));break}var h=n.map[s];void 0===h&&_r(n,h=new br(s)),n=h}}function Sr(e,t){this.seq=[],this.map={};for(var n=e.getProgramParameter(t,35718),i=0;i<n;++i){var r=e.getActiveUniform(t,i);Mr(r,e.getUniformLocation(t,r.name),this)}}function Tr(e,t,n){var i=e.createShader(t);return e.shaderSource(i,n),e.compileShader(i),!1===e.getShaderParameter(i,35713)&&console.error("THREE.WebGLShader: Shader couldn't compile."),""!==e.getShaderInfoLog(i)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",35633===t?"vertex":"fragment",e.getShaderInfoLog(i),function(e){for(var t=e.split("\n"),n=0;n<t.length;n++)t[n]=n+1+": "+t[n];return t.join("\n")}(n)),i}Sr.prototype.setValue=function(e,t,n,i){var r=this.map[t];void 0!==r&&r.setValue(e,n,i)},Sr.prototype.setOptional=function(e,t,n){var i=t[n];void 0!==i&&this.setValue(e,n,i)},Sr.upload=function(e,t,n,i){for(var r=0,a=t.length;r!==a;++r){var o=t[r],s=n[o.id];!1!==s.needsUpdate&&o.setValue(e,s.value,i)}},Sr.seqWithValue=function(e,t){for(var n=[],i=0,r=e.length;i!==r;++i){var a=e[i];a.id in t&&n.push(a)}return n};var Er=0;function Ar(e){switch(e){case bt:return["Linear","( value )"];case wt:return["sRGB","( value )"];case Mt:return["RGBE","( value )"];case St:return["RGBM","( value, 7.0 )"];case Tt:return["RGBM","( value, 16.0 )"];case Et:return["RGBD","( value, 256.0 )"];case _t:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw new Error("unsupported encoding: "+e)}}function Lr(e,t){var n=Ar(t);return"vec4 "+e+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function Rr(e,t){var n;switch(t){case ae:n="Linear";break;case oe:n="Reinhard";break;case se:n="Uncharted2";break;case ce:n="OptimizedCineon";break;case le:n="ACESFilmic";break;default:throw new Error("unsupported toneMapping: "+t)}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function Pr(e){return""!==e}function Cr(e,t){return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights)}function Ir(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}function Or(e){return e.replace(/^[ \t]*#include +<([\w\d.\/]+)>/gm,function(e,t){var n=cn[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return Or(n)})}function Dr(e){return e.replace(/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,function(e,t,n,i){for(var r="",a=parseInt(t);a<parseInt(n);a++)r+=i.replace(/\[ i \]/g,"[ "+a+" ]");return r})}function Nr(e,t,n,i,r,a,o,s){var c=e.context,l=i.defines,h=r.vertexShader,u=r.fragmentShader,p="SHADOWMAP_TYPE_BASIC";a.shadowMapType===v?p="SHADOWMAP_TYPE_PCF":a.shadowMapType===y&&(p="SHADOWMAP_TYPE_PCF_SOFT");var d="ENVMAP_TYPE_CUBE",f="ENVMAP_MODE_REFLECTION",m="ENVMAP_BLENDING_MULTIPLY";if(a.envMap){switch(i.envMap.mapping){case he:case ue:d="ENVMAP_TYPE_CUBE";break;case me:case ge:d="ENVMAP_TYPE_CUBE_UV";break;case pe:case de:d="ENVMAP_TYPE_EQUIREC";break;case fe:d="ENVMAP_TYPE_SPHERE"}switch(i.envMap.mapping){case ue:case de:f="ENVMAP_MODE_REFRACTION"}switch(i.combine){case te:m="ENVMAP_BLENDING_MULTIPLY";break;case ne:m="ENVMAP_BLENDING_MIX";break;case ie:m="ENVMAP_BLENDING_ADD"}}var g,x,b,w,_,M=e.gammaFactor>0?e.gammaFactor:1,S=o.isWebGL2?"":function(e,t,n){return[(e=e||{}).derivatives||t.envMapCubeUV||t.bumpMap||t.normalMap&&!t.objectSpaceNormalMap||t.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(e.fragDepth||t.logarithmicDepthBuffer)&&n.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",e.drawBuffers&&n.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(e.shaderTextureLOD||t.envMap)&&n.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Pr).join("\n")}(i.extensions,a,t),T=function(e){var t=[];for(var n in e){var i=e[n];!1!==i&&t.push("#define "+n+" "+i)}return t.join("\n")}(l),E=c.createProgram();if(i.isRawShaderMaterial?((g=[T].filter(Pr).join("\n")).length>0&&(g+="\n"),(x=[S,T].filter(Pr).join("\n")).length>0&&(x+="\n")):(g=["precision "+a.precision+" float;","precision "+a.precision+" int;","#define SHADER_NAME "+r.name,T,a.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+M,"#define MAX_BONES "+a.maxBones,a.useFog&&a.fog?"#define USE_FOG":"",a.useFog&&a.fogExp?"#define FOG_EXP2":"",a.map?"#define USE_MAP":"",a.envMap?"#define USE_ENVMAP":"",a.envMap?"#define "+f:"",a.lightMap?"#define USE_LIGHTMAP":"",a.aoMap?"#define USE_AOMAP":"",a.emissiveMap?"#define USE_EMISSIVEMAP":"",a.bumpMap?"#define USE_BUMPMAP":"",a.normalMap?"#define USE_NORMALMAP":"",a.normalMap&&a.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",a.displacementMap&&a.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",a.specularMap?"#define USE_SPECULARMAP":"",a.roughnessMap?"#define USE_ROUGHNESSMAP":"",a.metalnessMap?"#define USE_METALNESSMAP":"",a.alphaMap?"#define USE_ALPHAMAP":"",a.vertexTangents?"#define USE_TANGENT":"",a.vertexColors?"#define USE_COLOR":"",a.flatShading?"#define FLAT_SHADED":"",a.skinning?"#define USE_SKINNING":"",a.useVertexTexture?"#define BONE_TEXTURE":"",a.morphTargets?"#define USE_MORPHTARGETS":"",a.morphNormals&&!1===a.flatShading?"#define USE_MORPHNORMALS":"",a.doubleSided?"#define DOUBLE_SIDED":"",a.flipSided?"#define FLIP_SIDED":"",a.shadowMapEnabled?"#define USE_SHADOWMAP":"",a.shadowMapEnabled?"#define "+p:"",a.sizeAttenuation?"#define USE_SIZEATTENUATION":"",a.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",a.logarithmicDepthBuffer&&(o.isWebGL2||t.get("EXT_frag_depth"))?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Pr).join("\n"),x=[S,"precision "+a.precision+" float;","precision "+a.precision+" int;","#define SHADER_NAME "+r.name,T,a.alphaTest?"#define ALPHATEST "+a.alphaTest+(a.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+M,a.useFog&&a.fog?"#define USE_FOG":"",a.useFog&&a.fogExp?"#define FOG_EXP2":"",a.map?"#define USE_MAP":"",a.matcap?"#define USE_MATCAP":"",a.envMap?"#define USE_ENVMAP":"",a.envMap?"#define "+d:"",a.envMap?"#define "+f:"",a.envMap?"#define "+m:"",a.lightMap?"#define USE_LIGHTMAP":"",a.aoMap?"#define USE_AOMAP":"",a.emissiveMap?"#define USE_EMISSIVEMAP":"",a.bumpMap?"#define USE_BUMPMAP":"",a.normalMap?"#define USE_NORMALMAP":"",a.normalMap&&a.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",a.specularMap?"#define USE_SPECULARMAP":"",a.roughnessMap?"#define USE_ROUGHNESSMAP":"",a.metalnessMap?"#define USE_METALNESSMAP":"",a.alphaMap?"#define USE_ALPHAMAP":"",a.vertexTangents?"#define USE_TANGENT":"",a.vertexColors?"#define USE_COLOR":"",a.gradientMap?"#define USE_GRADIENTMAP":"",a.flatShading?"#define FLAT_SHADED":"",a.doubleSided?"#define DOUBLE_SIDED":"",a.flipSided?"#define FLIP_SIDED":"",a.shadowMapEnabled?"#define USE_SHADOWMAP":"",a.shadowMapEnabled?"#define "+p:"",a.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",a.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",a.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",a.logarithmicDepthBuffer&&(o.isWebGL2||t.get("EXT_frag_depth"))?"#define USE_LOGDEPTHBUF_EXT":"",a.envMap&&(o.isWebGL2||t.get("EXT_shader_texture_lod"))?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",a.toneMapping!==re?"#define TONE_MAPPING":"",a.toneMapping!==re?cn.tonemapping_pars_fragment:"",a.toneMapping!==re?Rr("toneMapping",a.toneMapping):"",a.dithering?"#define DITHERING":"",a.outputEncoding||a.mapEncoding||a.matcapEncoding||a.envMapEncoding||a.emissiveMapEncoding?cn.encodings_pars_fragment:"",a.mapEncoding?Lr("mapTexelToLinear",a.mapEncoding):"",a.matcapEncoding?Lr("matcapTexelToLinear",a.matcapEncoding):"",a.envMapEncoding?Lr("envMapTexelToLinear",a.envMapEncoding):"",a.emissiveMapEncoding?Lr("emissiveMapTexelToLinear",a.emissiveMapEncoding):"",a.outputEncoding?(b="linearToOutputTexel",w=a.outputEncoding,_=Ar(w),"vec4 "+b+"( vec4 value ) { return LinearTo"+_[0]+_[1]+"; }"):"",a.depthPacking?"#define DEPTH_PACKING "+i.depthPacking:"","\n"].filter(Pr).join("\n")),h=Ir(h=Cr(h=Or(h),a),a),u=Ir(u=Cr(u=Or(u),a),a),h=Dr(h),u=Dr(u),o.isWebGL2&&!i.isRawShaderMaterial){var A=!1,L=/^\s*#version\s+300\s+es\s*\n/;i.isShaderMaterial&&null!==h.match(L)&&null!==u.match(L)&&(A=!0,h=h.replace(L,""),u=u.replace(L,"")),g=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+g,x=["#version 300 es\n","#define varying in",A?"":"out highp vec4 pc_fragColor;",A?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+x}var R=x+u,P=Tr(c,35633,g+h),C=Tr(c,35632,R);c.attachShader(E,P),c.attachShader(E,C),void 0!==i.index0AttributeName?c.bindAttribLocation(E,0,i.index0AttributeName):!0===a.morphTargets&&c.bindAttribLocation(E,0,"position"),c.linkProgram(E);var I,O,D=c.getProgramInfoLog(E).trim(),N=c.getShaderInfoLog(P).trim(),U=c.getShaderInfoLog(C).trim(),B=!0,F=!0;return!1===c.getProgramParameter(E,35714)?(B=!1,console.error("THREE.WebGLProgram: shader error: ",c.getError(),"35715",c.getProgramParameter(E,35715),"gl.getProgramInfoLog",D,N,U)):""!==D?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",D):""!==N&&""!==U||(F=!1),F&&(this.diagnostics={runnable:B,material:i,programLog:D,vertexShader:{log:N,prefix:g},fragmentShader:{log:U,prefix:x}}),c.deleteShader(P),c.deleteShader(C),this.getUniforms=function(){return void 0===I&&(I=new Sr(c,E,s)),I},this.getAttributes=function(){return void 0===O&&(O=function(e,t){for(var n={},i=e.getProgramParameter(t,35721),r=0;r<i;r++){var a=e.getActiveAttrib(t,r).name;n[a]=e.getAttribLocation(t,a)}return n}(c,E)),O},this.destroy=function(){c.deleteProgram(E),this.program=void 0},Object.defineProperties(this,{uniforms:{get:function(){return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),this.getUniforms()}},attributes:{get:function(){return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),this.getAttributes()}}}),this.name=r.name,this.id=Er++,this.code=n,this.usedTimes=1,this.program=E,this.vertexShader=P,this.fragmentShader=C,this}function Ur(e,t,n,i){var r=[],a={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},o=["precision","supportsVertexTextures","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","lightMap","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexTangents","fog","useFog","fogExp","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering"];function s(e,t){var n;return e?e.isTexture?n=e.encoding:e.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),n=e.texture.encoding):n=bt,n===bt&&t&&(n=_t),n}this.getParameters=function(t,i,r,o,c,l,h){var u=a[t.type],p=h.isSkinnedMesh?function(e){var t=e.skeleton.bones;if(n.floatVertexTextures)return 1024;var i=n.maxVertexUniforms,r=Math.floor((i-20)/4),a=Math.min(r,t.length);return a<t.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+t.length+" bones. This GPU supports "+a+"."),0):a}(h):0,d=n.precision;null!==t.precision&&(d=n.getMaxPrecision(t.precision))!==t.precision&&console.warn("THREE.WebGLProgram.getParameters:",t.precision,"not supported, using",d,"instead.");var f=e.getRenderTarget();return{shaderID:u,precision:d,supportsVertexTextures:n.vertexTextures,outputEncoding:s(f?f.texture:null,e.gammaOutput),map:!!t.map,mapEncoding:s(t.map,e.gammaInput),matcap:!!t.matcap,matcapEncoding:s(t.matcap,e.gammaInput),envMap:!!t.envMap,envMapMode:t.envMap&&t.envMap.mapping,envMapEncoding:s(t.envMap,e.gammaInput),envMapCubeUV:!!t.envMap&&(t.envMap.mapping===me||t.envMap.mapping===ge),lightMap:!!t.lightMap,aoMap:!!t.aoMap,emissiveMap:!!t.emissiveMap,emissiveMapEncoding:s(t.emissiveMap,e.gammaInput),bumpMap:!!t.bumpMap,normalMap:!!t.normalMap,objectSpaceNormalMap:t.normalMapType===Pt,displacementMap:!!t.displacementMap,roughnessMap:!!t.roughnessMap,metalnessMap:!!t.metalnessMap,specularMap:!!t.specularMap,alphaMap:!!t.alphaMap,gradientMap:!!t.gradientMap,combine:t.combine,vertexTangents:t.normalMap&&t.vertexTangents,vertexColors:t.vertexColors,fog:!!o,useFog:t.fog,fogExp:o&&o.isFogExp2,flatShading:t.flatShading,sizeAttenuation:t.sizeAttenuation,logarithmicDepthBuffer:n.logarithmicDepthBuffer,skinning:t.skinning&&p>0,maxBones:p,useVertexTexture:n.floatVertexTextures,morphTargets:t.morphTargets,morphNormals:t.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:i.directional.length,numPointLights:i.point.length,numSpotLights:i.spot.length,numRectAreaLights:i.rectArea.length,numHemiLights:i.hemi.length,numClippingPlanes:c,numClipIntersection:l,dithering:t.dithering,shadowMapEnabled:e.shadowMap.enabled&&h.receiveShadow&&r.length>0,shadowMapType:e.shadowMap.type,toneMapping:e.toneMapping,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:t.premultipliedAlpha,alphaTest:t.alphaTest,doubleSided:t.side===w,flipSided:t.side===b,depthPacking:void 0!==t.depthPacking&&t.depthPacking}},this.getProgramCode=function(t,n){var i=[];if(n.shaderID?i.push(n.shaderID):(i.push(t.fragmentShader),i.push(t.vertexShader)),void 0!==t.defines)for(var r in t.defines)i.push(r),i.push(t.defines[r]);for(var a=0;a<o.length;a++)i.push(n[o[a]]);return i.push(t.onBeforeCompile.toString()),i.push(e.gammaOutput),i.push(e.gammaFactor),i.join()},this.acquireProgram=function(a,o,s,c){for(var l,h=0,u=r.length;h<u;h++){var p=r[h];if(p.code===c){++(l=p).usedTimes;break}}return void 0===l&&(l=new Nr(e,t,c,a,o,s,n,i),r.push(l)),l},this.releaseProgram=function(e){if(0==--e.usedTimes){var t=r.indexOf(e);r[t]=r[r.length-1],r.pop(),e.destroy()}},this.programs=r}function Br(){var e=new WeakMap;return{get:function(t){var n=e.get(t);return void 0===n&&(n={},e.set(t,n)),n},remove:function(t){e.delete(t)},update:function(t,n,i){e.get(t)[n]=i},dispose:function(){e=new WeakMap}}}function Fr(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.program!==t.program?e.program.id-t.program.id:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function zr(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function Gr(){var e=[],t=0,n=[],i=[],r={id:-1};function a(n,i,a,o,s,c){var l=e[t];return void 0===l?(l={id:n.id,object:n,geometry:i,material:a,program:a.program||r,groupOrder:o,renderOrder:n.renderOrder,z:s,group:c},e[t]=l):(l.id=n.id,l.object=n,l.geometry=i,l.material=a,l.program=a.program||r,l.groupOrder=o,l.renderOrder=n.renderOrder,l.z=s,l.group=c),t++,l}return{opaque:n,transparent:i,init:function(){t=0,n.length=0,i.length=0},push:function(e,t,r,o,s,c){var l=a(e,t,r,o,s,c);(!0===r.transparent?i:n).push(l)},unshift:function(e,t,r,o,s,c){var l=a(e,t,r,o,s,c);(!0===r.transparent?i:n).unshift(l)},sort:function(){n.length>1&&n.sort(Fr),i.length>1&&i.sort(zr)}}}function Hr(){var e={};function t(n){var i=n.target;i.removeEventListener("dispose",t),delete e[i.id]}return{get:function(n,i){var r,a=e[n.id];return void 0===a?(r=new Gr,e[n.id]={},e[n.id][i.id]=r,n.addEventListener("dispose",t)):void 0===(r=a[i.id])&&(r=new Gr,a[i.id]=r),r},dispose:function(){e={}}}}function Vr(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var n;switch(t.type){case"DirectionalLight":n={direction:new Dt,color:new gn,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new It};break;case"SpotLight":n={position:new Dt,direction:new Dt,color:new gn,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new It};break;case"PointLight":n={position:new Dt,color:new gn,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new It,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":n={direction:new Dt,skyColor:new gn,groundColor:new gn};break;case"RectAreaLight":n={color:new gn,position:new Dt,halfWidth:new Dt,halfHeight:new Dt}}return e[t.id]=n,n}}}var kr=0;function jr(){var e=new Vr,t={id:kr++,hash:{stateID:-1,directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,shadowsLength:-1},ambient:[0,0,0],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},n=new Dt,i=new sn,r=new sn;return{setup:function(a,o,s){for(var c=0,l=0,h=0,u=0,p=0,d=0,f=0,m=0,g=s.matrixWorldInverse,v=0,y=a.length;v<y;v++){var x=a[v],b=x.color,w=x.intensity,_=x.distance,M=x.shadow&&x.shadow.map?x.shadow.map.texture:null;if(x.isAmbientLight)c+=b.r*w,l+=b.g*w,h+=b.b*w;else if(x.isDirectionalLight){if((T=e.get(x)).color.copy(x.color).multiplyScalar(x.intensity),T.direction.setFromMatrixPosition(x.matrixWorld),n.setFromMatrixPosition(x.target.matrixWorld),T.direction.sub(n),T.direction.transformDirection(g),T.shadow=x.castShadow,x.castShadow){var S=x.shadow;T.shadowBias=S.bias,T.shadowRadius=S.radius,T.shadowMapSize=S.mapSize}t.directionalShadowMap[u]=M,t.directionalShadowMatrix[u]=x.shadow.matrix,t.directional[u]=T,u++}else if(x.isSpotLight)(T=e.get(x)).position.setFromMatrixPosition(x.matrixWorld),T.position.applyMatrix4(g),T.color.copy(b).multiplyScalar(w),T.distance=_,T.direction.setFromMatrixPosition(x.matrixWorld),n.setFromMatrixPosition(x.target.matrixWorld),T.direction.sub(n),T.direction.transformDirection(g),T.coneCos=Math.cos(x.angle),T.penumbraCos=Math.cos(x.angle*(1-x.penumbra)),T.decay=x.decay,T.shadow=x.castShadow,x.castShadow&&(S=x.shadow,T.shadowBias=S.bias,T.shadowRadius=S.radius,T.shadowMapSize=S.mapSize),t.spotShadowMap[d]=M,t.spotShadowMatrix[d]=x.shadow.matrix,t.spot[d]=T,d++;else if(x.isRectAreaLight)(T=e.get(x)).color.copy(b).multiplyScalar(w),T.position.setFromMatrixPosition(x.matrixWorld),T.position.applyMatrix4(g),r.identity(),i.copy(x.matrixWorld),i.premultiply(g),r.extractRotation(i),T.halfWidth.set(.5*x.width,0,0),T.halfHeight.set(0,.5*x.height,0),T.halfWidth.applyMatrix4(r),T.halfHeight.applyMatrix4(r),t.rectArea[f]=T,f++;else if(x.isPointLight)(T=e.get(x)).position.setFromMatrixPosition(x.matrixWorld),T.position.applyMatrix4(g),T.color.copy(x.color).multiplyScalar(x.intensity),T.distance=x.distance,T.decay=x.decay,T.shadow=x.castShadow,x.castShadow&&(S=x.shadow,T.shadowBias=S.bias,T.shadowRadius=S.radius,T.shadowMapSize=S.mapSize,T.shadowCameraNear=S.camera.near,T.shadowCameraFar=S.camera.far),t.pointShadowMap[p]=M,t.pointShadowMatrix[p]=x.shadow.matrix,t.point[p]=T,p++;else if(x.isHemisphereLight){var T;(T=e.get(x)).direction.setFromMatrixPosition(x.matrixWorld),T.direction.transformDirection(g),T.direction.normalize(),T.skyColor.copy(x.color).multiplyScalar(w),T.groundColor.copy(x.groundColor).multiplyScalar(w),t.hemi[m]=T,m++}}t.ambient[0]=c,t.ambient[1]=l,t.ambient[2]=h,t.directional.length=u,t.spot.length=d,t.rectArea.length=f,t.point.length=p,t.hemi.length=m,t.hash.stateID=t.id,t.hash.directionalLength=u,t.hash.pointLength=p,t.hash.spotLength=d,t.hash.rectAreaLength=f,t.hash.hemiLength=m,t.hash.shadowsLength=o.length},state:t}}function Wr(){var e=new jr,t=[],n=[];return{init:function(){t.length=0,n.length=0},state:{lightsArray:t,shadowsArray:n,lights:e},setupLights:function(i){e.setup(t,n,i)},pushLight:function(e){t.push(e)},pushShadow:function(e){n.push(e)}}}function qr(){var e={};function t(n){var i=n.target;i.removeEventListener("dispose",t),delete e[i.id]}return{get:function(n,i){var r;return void 0===e[n.id]?(r=new Wr,e[n.id]={},e[n.id][i.id]=r,n.addEventListener("dispose",t)):void 0===e[n.id][i.id]?(r=new Wr,e[n.id][i.id]=r):r=e[n.id][i.id],r},dispose:function(){e={}}}}function Xr(e){ei.call(this),this.type="MeshDepthMaterial",this.depthPacking=At,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.setValues(e)}function Yr(e){ei.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new Dt,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.lights=!1,this.setValues(e)}function Jr(e,t,n){for(var i=new on,r=new sn,a=new It,o=new It(n,n),s=new Dt,c=new Dt,l=1,h=2,u=1+(l|h),p=new Array(u),d=new Array(u),f={},m={0:b,1:x,2:w},g=[new Dt(1,0,0),new Dt(-1,0,0),new Dt(0,0,1),new Dt(0,0,-1),new Dt(0,1,0),new Dt(0,-1,0)],y=[new Dt(0,1,0),new Dt(0,1,0),new Dt(0,1,0),new Dt(0,1,0),new Dt(0,0,1),new Dt(0,0,-1)],_=[new Kt,new Kt,new Kt,new Kt,new Kt,new Kt],M=0;M!==u;++M){var S=0!=(M&l),E=0!=(M&h),A=new Xr({depthPacking:Lt,morphTargets:S,skinning:E});p[M]=A;var L=new Yr({morphTargets:S,skinning:E});d[M]=L}var R=this;function P(t,n,i,r,a,o){var s=t.geometry,c=null,u=p,g=t.customDepthMaterial;if(i&&(u=d,g=t.customDistanceMaterial),g)c=g;else{var v=!1;n.morphTargets&&(s&&s.isBufferGeometry?v=s.morphAttributes&&s.morphAttributes.position&&s.morphAttributes.position.length>0:s&&s.isGeometry&&(v=s.morphTargets&&s.morphTargets.length>0)),t.isSkinnedMesh&&!1===n.skinning&&console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t);var y=t.isSkinnedMesh&&n.skinning,x=0;v&&(x|=l),y&&(x|=h),c=u[x]}if(e.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length){var b=c.uuid,w=n.uuid,_=f[b];void 0===_&&(_={},f[b]=_);var M=_[w];void 0===M&&(M=c.clone(),_[w]=M),c=M}return c.visible=n.visible,c.wireframe=n.wireframe,c.side=null!=n.shadowSide?n.shadowSide:m[n.side],c.clipShadows=n.clipShadows,c.clippingPlanes=n.clippingPlanes,c.clipIntersection=n.clipIntersection,c.wireframeLinewidth=n.wireframeLinewidth,c.linewidth=n.linewidth,i&&c.isMeshDistanceMaterial&&(c.referencePosition.copy(r),c.nearDistance=a,c.farDistance=o),c}function C(n,r,a,o){if(!1!==n.visible){if(n.layers.test(r.layers)&&(n.isMesh||n.isLine||n.isPoints)&&n.castShadow&&(!n.frustumCulled||i.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);var s=t.update(n),l=n.material;if(Array.isArray(l))for(var h=s.groups,u=0,p=h.length;u<p;u++){var d=h[u],f=l[d.materialIndex];if(f&&f.visible){var m=P(n,f,o,c,a.near,a.far);e.renderBufferDirect(a,null,s,m,n,d)}}else if(l.visible){m=P(n,l,o,c,a.near,a.far);e.renderBufferDirect(a,null,s,m,n,null)}}for(var g=n.children,v=0,y=g.length;v<y;v++)C(g[v],r,a,o)}}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=v,this.render=function(t,n,l){if(!1!==R.enabled&&(!1!==R.autoUpdate||!1!==R.needsUpdate)&&0!==t.length){var h,u=e.getRenderTarget(),p=e.state;p.setBlending(T),p.buffers.color.setClear(1,1,1,1),p.buffers.depth.setTest(!0),p.setScissorTest(!1);for(var d=0,f=t.length;d<f;d++){var m=t[d],v=m.shadow,x=m&&m.isPointLight;if(void 0!==v){var b=v.camera;if(a.copy(v.mapSize),a.min(o),x){var w=a.x,M=a.y;_[0].set(2*w,M,w,M),_[1].set(0,M,w,M),_[2].set(3*w,M,w,M),_[3].set(w,M,w,M),_[4].set(3*w,0,w,M),_[5].set(w,0,w,M),a.x*=4,a.y*=2}if(null===v.map){var S={minFilter:be,magFilter:be,format:Ge};v.map=new Qt(a.x,a.y,S),v.map.texture.name=m.name+".shadowMap",b.updateProjectionMatrix()}v.isSpotLightShadow&&v.update(m);var E=v.map,A=v.matrix;c.setFromMatrixPosition(m.matrixWorld),b.position.copy(c),x?(h=6,A.makeTranslation(-c.x,-c.y,-c.z)):(h=1,s.setFromMatrixPosition(m.target.matrixWorld),b.lookAt(s),b.updateMatrixWorld(),A.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),A.multiply(b.projectionMatrix),A.multiply(b.matrixWorldInverse)),e.setRenderTarget(E),e.clear();for(var L=0;L<h;L++){if(x){s.copy(b.position),s.add(g[L]),b.up.copy(y[L]),b.lookAt(s),b.updateMatrixWorld();var P=_[L];p.viewport(P)}r.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse),i.setFromMatrix(r),C(n,l,b,x)}}else console.warn("THREE.WebGLShadowMap:",m,"has no shadow.")}R.needsUpdate=!1,e.setRenderTarget(u)}}}function Zr(e,t,n,i){var r=new function(){var t=!1,n=new Kt,i=null,r=new Kt(0,0,0,0);return{setMask:function(n){i===n||t||(e.colorMask(n,n,n,n),i=n)},setLocked:function(e){t=e},setClear:function(t,i,a,o,s){!0===s&&(t*=o,i*=o,a*=o),n.set(t,i,a,o),!1===r.equals(n)&&(e.clearColor(t,i,a,o),r.copy(n))},reset:function(){t=!1,i=null,r.set(-1,0,0,0)}}},a=new function(){var t=!1,n=null,i=null,r=null;return{setTest:function(e){e?ae(2929):oe(2929)},setMask:function(i){n===i||t||(e.depthMask(i),n=i)},setFunc:function(t){if(i!==t){if(t)switch(t){case X:e.depthFunc(512);break;case Y:e.depthFunc(519);break;case J:e.depthFunc(513);break;case Z:e.depthFunc(515);break;case K:e.depthFunc(514);break;case Q:e.depthFunc(518);break;case $:e.depthFunc(516);break;case ee:e.depthFunc(517);break;default:e.depthFunc(515)}else e.depthFunc(515);i=t}},setLocked:function(e){t=e},setClear:function(t){r!==t&&(e.clearDepth(t),r=t)},reset:function(){t=!1,n=null,i=null,r=null}}},o=new function(){var t=!1,n=null,i=null,r=null,a=null,o=null,s=null,c=null,l=null;return{setTest:function(e){e?ae(2960):oe(2960)},setMask:function(i){n===i||t||(e.stencilMask(i),n=i)},setFunc:function(t,n,o){i===t&&r===n&&a===o||(e.stencilFunc(t,n,o),i=t,r=n,a=o)},setOp:function(t,n,i){o===t&&s===n&&c===i||(e.stencilOp(t,n,i),o=t,s=n,c=i)},setLocked:function(e){t=e},setClear:function(t){l!==t&&(e.clearStencil(t),l=t)},reset:function(){t=!1,n=null,i=null,r=null,a=null,o=null,s=null,c=null,l=null}}},s=e.getParameter(34921),c=new Uint8Array(s),l=new Uint8Array(s),h=new Uint8Array(s),u={},p=null,d=null,v=null,y=null,x=null,_=null,M=null,S=null,I=null,O=null,D=!1,N=null,U=null,B=null,F=null,z=null,G=e.getParameter(35661),H=!1,V=0,k=e.getParameter(7938);-1!==k.indexOf("WebGL")?(V=parseFloat(/^WebGL\ ([0-9])/.exec(k)[1]),H=V>=1):-1!==k.indexOf("OpenGL ES")&&(V=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(k)[1]),H=V>=2);var j=null,W={},q=new Kt,te=new Kt;function ne(t,n,i){var r=new Uint8Array(4),a=e.createTexture();e.bindTexture(t,a),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(var o=0;o<i;o++)e.texImage2D(n+o,0,6408,1,1,0,6408,5121,r);return a}var ie={};function re(n,r){(c[n]=1,0===l[n]&&(e.enableVertexAttribArray(n),l[n]=1),h[n]!==r)&&((i.isWebGL2?e:t.get("ANGLE_instanced_arrays"))[i.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,r),h[n]=r)}function ae(t){!0!==u[t]&&(e.enable(t),u[t]=!0)}function oe(t){!1!==u[t]&&(e.disable(t),u[t]=!1)}function se(t,i,r,a,o,s,c,l){if(t!==T){if(v||(ae(3042),v=!0),t===P)o=o||i,s=s||r,c=c||a,i===x&&o===S||(e.blendEquationSeparate(n.convert(i),n.convert(o)),x=i,S=o),r===_&&a===M&&s===I&&c===O||(e.blendFuncSeparate(n.convert(r),n.convert(a),n.convert(s),n.convert(c)),_=r,M=a,I=s,O=c),y=t,D=null;else if(t!==y||l!==D){if(x===C&&S===C||(e.blendEquation(32774),x=C,S=C),l)switch(t){case E:e.blendFuncSeparate(1,771,1,771);break;case A:e.blendFunc(1,1);break;case L:e.blendFuncSeparate(0,0,769,771);break;case R:e.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case E:e.blendFuncSeparate(770,771,1,771);break;case A:e.blendFunc(770,1);break;case L:e.blendFunc(0,769);break;case R:e.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}_=null,M=null,I=null,O=null,y=t,D=l}}else v&&(oe(3042),v=!1)}function ce(t){N!==t&&(t?e.frontFace(2304):e.frontFace(2305),N=t)}function le(t){t!==f?(ae(2884),t!==U&&(t===m?e.cullFace(1029):t===g?e.cullFace(1028):e.cullFace(1032))):oe(2884),U=t}function he(t,n,i){t?(ae(32823),F===n&&z===i||(e.polygonOffset(n,i),F=n,z=i)):oe(32823)}function ue(t){void 0===t&&(t=33984+G-1),j!==t&&(e.activeTexture(t),j=t)}return ie[3553]=ne(3553,3553,1),ie[34067]=ne(34067,34069,6),r.setClear(0,0,0,1),a.setClear(1),o.setClear(0),ae(2929),a.setFunc(Z),ce(!1),le(m),ae(2884),se(T),{buffers:{color:r,depth:a,stencil:o},initAttributes:function(){for(var e=0,t=c.length;e<t;e++)c[e]=0},enableAttribute:function(e){re(e,0)},enableAttributeAndDivisor:re,disableUnusedAttributes:function(){for(var t=0,n=l.length;t!==n;++t)l[t]!==c[t]&&(e.disableVertexAttribArray(t),l[t]=0)},enable:ae,disable:oe,getCompressedTextureFormats:function(){if(null===p&&(p=[],t.get("WEBGL_compressed_texture_pvrtc")||t.get("WEBGL_compressed_texture_s3tc")||t.get("WEBGL_compressed_texture_etc1")||t.get("WEBGL_compressed_texture_astc")))for(var n=e.getParameter(34467),i=0;i<n.length;i++)p.push(n[i]);return p},useProgram:function(t){return d!==t&&(e.useProgram(t),d=t,!0)},setBlending:se,setMaterial:function(e,t){e.side===w?oe(2884):ae(2884);var n=e.side===b;t&&(n=!n),ce(n),e.blending===E&&!1===e.transparent?se(T):se(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha),a.setFunc(e.depthFunc),a.setTest(e.depthTest),a.setMask(e.depthWrite),r.setMask(e.colorWrite),he(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits)},setFlipSided:ce,setCullFace:le,setLineWidth:function(t){t!==B&&(H&&e.lineWidth(t),B=t)},setPolygonOffset:he,setScissorTest:function(e){e?ae(3089):oe(3089)},activeTexture:ue,bindTexture:function(t,n){null===j&&ue();var i=W[j];void 0===i&&(i={type:void 0,texture:void 0},W[j]=i),i.type===t&&i.texture===n||(e.bindTexture(t,n||ie[t]),i.type=t,i.texture=n)},compressedTexImage2D:function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage2D:function(){try{e.texImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage3D:function(){try{e.texImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},scissor:function(t){!1===q.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),q.copy(t))},viewport:function(t){!1===te.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),te.copy(t))},reset:function(){for(var t=0;t<l.length;t++)1===l[t]&&(e.disableVertexAttribArray(t),l[t]=0);u={},p=null,j=null,W={},d=null,y=null,N=null,U=null,r.reset(),a.reset(),o.reset()}}}function Kr(e,t,n,i,r,a,o){var s,c={},l="undefined"!=typeof OffscreenCanvas;function h(e,t){return l?new OffscreenCanvas(e,t):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function u(e,t,n,i){var r=1;if((e.width>i||e.height>i)&&(r=i/Math.max(e.width,e.height)),r<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){var a=t?Ct.floorPowerOfTwo:Math.floor,o=a(r*e.width),c=a(r*e.height);void 0===s&&(s=h(o,c));var l=n?h(o,c):s;return l.width=o,l.height=c,l.getContext("2d").drawImage(e,0,0,o,c),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+o+"x"+c+")."),l}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function p(e){return Ct.isPowerOfTwo(e.width)&&Ct.isPowerOfTwo(e.height)}function d(e,t){return e.generateMipmaps&&t&&e.minFilter!==be&&e.minFilter!==Me}function f(t,n,r,a){e.generateMipmap(t),i.get(n).__maxMipLevel=Math.log(Math.max(r,a))*Math.LOG2E}function m(e,n){if(!r.isWebGL2)return e;var i=e;return 6403===e&&(5126===n&&(i=33326),5131===n&&(i=33325),5121===n&&(i=33321)),6407===e&&(5126===n&&(i=34837),5131===n&&(i=34843),5121===n&&(i=32849)),6408===e&&(5126===n&&(i=34836),5131===n&&(i=34842),5121===n&&(i=32856)),33325===i||33326===i||34842===i||34836===i?t.get("EXT_color_buffer_float"):34843!==i&&34837!==i||console.warn("THREE.WebGLRenderer: Floating point textures with RGB format not supported. Please use RGBA instead."),i}function g(e){return e===be||e===we||e===_e?9728:9729}function v(t){var n=t.target;n.removeEventListener("dispose",v),function(t){var n=i.get(t);if(void 0===n.__webglInit)return;e.deleteTexture(n.__webglTexture),i.remove(t)}(n),n.isVideoTexture&&delete c[n.id],o.memory.textures--}function y(t){var n=t.target;n.removeEventListener("dispose",y),function(t){var n=i.get(t),r=i.get(t.texture);if(!t)return;void 0!==r.__webglTexture&&e.deleteTexture(r.__webglTexture);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLRenderTargetCube)for(var a=0;a<6;a++)e.deleteFramebuffer(n.__webglFramebuffer[a]),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[a]);else e.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer);i.remove(t.texture),i.remove(t)}(n),o.memory.textures--}var x=0;function b(e,t){var r=i.get(e);if(e.isVideoTexture&&function(e){var t=e.id,n=o.render.frame;c[t]!==n&&(c[t]=n,e.update())}(e),e.version>0&&r.__version!==e.version){var a=e.image;if(void 0===a)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==a.complete)return void T(r,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+t),n.bindTexture(3553,r.__webglTexture)}function w(t,o){var s=i.get(t);if(6===t.image.length)if(t.version>0&&s.__version!==t.version){S(s,t),n.activeTexture(33984+o),n.bindTexture(34067,s.__webglTexture),e.pixelStorei(37440,t.flipY);for(var c=t&&t.isCompressedTexture,l=t.image[0]&&t.image[0].isDataTexture,h=[],g=0;g<6;g++)h[g]=c||l?l?t.image[g].image:t.image[g]:u(t.image[g],!1,!0,r.maxCubemapSize);var v=h[0],y=p(v)||r.isWebGL2,x=a.convert(t.format),b=a.convert(t.type),w=m(x,b);M(34067,t,y);for(g=0;g<6;g++)if(c)for(var _,T=h[g].mipmaps,E=0,A=T.length;E<A;E++)_=T[E],t.format!==Ge&&t.format!==ze?n.getCompressedTextureFormats().indexOf(x)>-1?n.compressedTexImage2D(34069+g,E,w,_.width,_.height,0,_.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):n.texImage2D(34069+g,E,w,_.width,_.height,0,x,b,_.data);else l?n.texImage2D(34069+g,0,w,h[g].width,h[g].height,0,x,b,h[g].data):n.texImage2D(34069+g,0,w,x,b,h[g]);s.__maxMipLevel=c?T.length-1:0,d(t,y)&&f(34067,t,v.width,v.height),s.__version=t.version,t.onUpdate&&t.onUpdate(t)}else n.activeTexture(33984+o),n.bindTexture(34067,s.__webglTexture)}function _(e,t){n.activeTexture(33984+t),n.bindTexture(34067,i.get(e).__webglTexture)}function M(n,o,s){var c;if(s?(e.texParameteri(n,10242,a.convert(o.wrapS)),e.texParameteri(n,10243,a.convert(o.wrapT)),32879!==n&&35866!==n||e.texParameteri(n,32882,a.convert(o.wrapR)),e.texParameteri(n,10240,a.convert(o.magFilter)),e.texParameteri(n,10241,a.convert(o.minFilter))):(e.texParameteri(n,10242,33071),e.texParameteri(n,10243,33071),32879!==n&&35866!==n||e.texParameteri(n,32882,33071),o.wrapS===ye&&o.wrapT===ye||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),e.texParameteri(n,10240,g(o.magFilter)),e.texParameteri(n,10241,g(o.minFilter)),o.minFilter!==be&&o.minFilter!==Me&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),c=t.get("EXT_texture_filter_anisotropic")){if(o.type===Ie&&null===t.get("OES_texture_float_linear"))return;if(o.type===Oe&&null===(r.isWebGL2||t.get("OES_texture_half_float_linear")))return;(o.anisotropy>1||i.get(o).__currentAnisotropy)&&(e.texParameterf(n,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,r.getMaxAnisotropy())),i.get(o).__currentAnisotropy=o.anisotropy)}}function S(t,n){void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",v),t.__webglTexture=e.createTexture(),o.memory.textures++)}function T(t,i,o){var s=3553;i.isDataTexture2DArray&&(s=35866),i.isDataTexture3D&&(s=32879),S(t,i),n.activeTexture(33984+o),n.bindTexture(s,t.__webglTexture),e.pixelStorei(37440,i.flipY),e.pixelStorei(37441,i.premultiplyAlpha),e.pixelStorei(3317,i.unpackAlignment);var c=function(e){return!r.isWebGL2&&(e.wrapS!==ye||e.wrapT!==ye||e.minFilter!==be&&e.minFilter!==Me)}(i)&&!1===p(i.image),l=u(i.image,c,!1,r.maxTextureSize),h=p(l)||r.isWebGL2,g=a.convert(i.format),v=a.convert(i.type),y=m(g,v);M(s,i,h);var x,b=i.mipmaps;if(i.isDepthTexture){if(y=6402,i.type===Ie){if(!r.isWebGL2)throw new Error("Float Depth Texture only supported in WebGL2.0");y=36012}else r.isWebGL2&&(y=33189);i.format===ke&&6402===y&&i.type!==Re&&i.type!==Ce&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),i.type=Re,v=a.convert(i.type)),i.format===je&&(y=34041,i.type!==Be&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),i.type=Be,v=a.convert(i.type))),n.texImage2D(3553,0,y,l.width,l.height,0,g,v,null)}else if(i.isDataTexture)if(b.length>0&&h){for(var w=0,_=b.length;w<_;w++)x=b[w],n.texImage2D(3553,w,y,x.width,x.height,0,g,v,x.data);i.generateMipmaps=!1,t.__maxMipLevel=b.length-1}else n.texImage2D(3553,0,y,l.width,l.height,0,g,v,l.data),t.__maxMipLevel=0;else if(i.isCompressedTexture){for(w=0,_=b.length;w<_;w++)x=b[w],i.format!==Ge&&i.format!==ze?n.getCompressedTextureFormats().indexOf(g)>-1?n.compressedTexImage2D(3553,w,y,x.width,x.height,0,x.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texImage2D(3553,w,y,x.width,x.height,0,g,v,x.data);t.__maxMipLevel=b.length-1}else if(i.isDataTexture2DArray)n.texImage3D(35866,0,y,l.width,l.height,l.depth,0,g,v,l.data),t.__maxMipLevel=0;else if(i.isDataTexture3D)n.texImage3D(32879,0,y,l.width,l.height,l.depth,0,g,v,l.data),t.__maxMipLevel=0;else if(b.length>0&&h){for(w=0,_=b.length;w<_;w++)x=b[w],n.texImage2D(3553,w,y,g,v,x);i.generateMipmaps=!1,t.__maxMipLevel=b.length-1}else n.texImage2D(3553,0,y,g,v,l),t.__maxMipLevel=0;d(i,h)&&f(3553,i,l.width,l.height),t.__version=i.version,i.onUpdate&&i.onUpdate(i)}function E(t,r,o,s){var c=a.convert(r.texture.format),l=a.convert(r.texture.type),h=m(c,l);n.texImage2D(s,0,h,r.width,r.height,0,c,l,null),e.bindFramebuffer(36160,t),e.framebufferTexture2D(36160,o,s,i.get(r.texture).__webglTexture,0),e.bindFramebuffer(36160,null)}function A(t,n,i){if(e.bindRenderbuffer(36161,t),n.depthBuffer&&!n.stencilBuffer){if(i){var r=R(n);e.renderbufferStorageMultisample(36161,r,33189,n.width,n.height)}else e.renderbufferStorage(36161,33189,n.width,n.height);e.framebufferRenderbuffer(36160,36096,36161,t)}else if(n.depthBuffer&&n.stencilBuffer){if(i){r=R(n);e.renderbufferStorageMultisample(36161,r,34041,n.width,n.height)}else e.renderbufferStorage(36161,34041,n.width,n.height);e.framebufferRenderbuffer(36160,33306,36161,t)}else{var o=m(a.convert(n.texture.format),a.convert(n.texture.type));if(i){r=R(n);e.renderbufferStorageMultisample(36161,r,o,n.width,n.height)}else e.renderbufferStorage(36161,o,n.width,n.height)}e.bindRenderbuffer(36161,null)}function L(t){var n=i.get(t),r=!0===t.isWebGLRenderTargetCube;if(t.depthTexture){if(r)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,n){if(n&&n.isWebGLRenderTargetCube)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(36160,t),!n.depthTexture||!n.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");i.get(n.depthTexture).__webglTexture&&n.depthTexture.image.width===n.width&&n.depthTexture.image.height===n.height||(n.depthTexture.image.width=n.width,n.depthTexture.image.height=n.height,n.depthTexture.needsUpdate=!0),b(n.depthTexture,0);var r=i.get(n.depthTexture).__webglTexture;if(n.depthTexture.format===ke)e.framebufferTexture2D(36160,36096,3553,r,0);else{if(n.depthTexture.format!==je)throw new Error("Unknown depthTexture format");e.framebufferTexture2D(36160,33306,3553,r,0)}}(n.__webglFramebuffer,t)}else if(r){n.__webglDepthbuffer=[];for(var a=0;a<6;a++)e.bindFramebuffer(36160,n.__webglFramebuffer[a]),n.__webglDepthbuffer[a]=e.createRenderbuffer(),A(n.__webglDepthbuffer[a],t)}else e.bindFramebuffer(36160,n.__webglFramebuffer),n.__webglDepthbuffer=e.createRenderbuffer(),A(n.__webglDepthbuffer,t);e.bindFramebuffer(36160,null)}function R(e){return r.isWebGL2&&e.isWebGLMultisampleRenderTarget?Math.min(r.maxSamples,e.samples):0}var P=!1,C=!1;this.allocateTextureUnit=function(){var e=x;return e>=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+r.maxTextures),x+=1,e},this.resetTextureUnits=function(){x=0},this.setTexture2D=b,this.setTexture2DArray=function(e,t){var r=i.get(e);e.version>0&&r.__version!==e.version?T(r,e,t):(n.activeTexture(33984+t),n.bindTexture(35866,r.__webglTexture))},this.setTexture3D=function(e,t){var r=i.get(e);e.version>0&&r.__version!==e.version?T(r,e,t):(n.activeTexture(33984+t),n.bindTexture(32879,r.__webglTexture))},this.setTextureCube=w,this.setTextureCubeDynamic=_,this.setupRenderTarget=function(t){var s=i.get(t),c=i.get(t.texture);t.addEventListener("dispose",y),c.__webglTexture=e.createTexture(),o.memory.textures++;var l=!0===t.isWebGLRenderTargetCube,h=!0===t.isWebGLMultisampleRenderTarget,u=p(t)||r.isWebGL2;if(l){s.__webglFramebuffer=[];for(var g=0;g<6;g++)s.__webglFramebuffer[g]=e.createFramebuffer()}else if(s.__webglFramebuffer=e.createFramebuffer(),h)if(r.isWebGL2){s.__webglMultisampledFramebuffer=e.createFramebuffer(),s.__webglColorRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,s.__webglColorRenderbuffer);var v=m(a.convert(t.texture.format),a.convert(t.texture.type)),x=R(t);e.renderbufferStorageMultisample(36161,x,v,t.width,t.height),e.bindFramebuffer(36160,s.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064,36161,s.__webglColorRenderbuffer),e.bindRenderbuffer(36161,null),t.depthBuffer&&(s.__webglDepthRenderbuffer=e.createRenderbuffer(),A(s.__webglDepthRenderbuffer,t,!0)),e.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(l){for(n.bindTexture(34067,c.__webglTexture),M(34067,t.texture,u),g=0;g<6;g++)E(s.__webglFramebuffer[g],t,36064,34069+g);d(t.texture,u)&&f(34067,t.texture,t.width,t.height),n.bindTexture(34067,null)}else n.bindTexture(3553,c.__webglTexture),M(3553,t.texture,u),E(s.__webglFramebuffer,t,36064,3553),d(t.texture,u)&&f(3553,t.texture,t.width,t.height),n.bindTexture(3553,null);t.depthBuffer&&L(t)},this.updateRenderTargetMipmap=function(e){var t=e.texture;if(d(t,p(e)||r.isWebGL2)){var a=e.isWebGLRenderTargetCube?34067:3553,o=i.get(t).__webglTexture;n.bindTexture(a,o),f(a,t,e.width,e.height),n.bindTexture(a,null)}},this.updateMultisampleRenderTarget=function(t){if(t.isWebGLMultisampleRenderTarget)if(r.isWebGL2){var n=i.get(t);e.bindFramebuffer(36008,n.__webglMultisampledFramebuffer),e.bindFramebuffer(36009,n.__webglFramebuffer);var a=t.width,o=t.height,s=16384;t.depthBuffer&&(s|=256),t.stencilBuffer&&(s|=1024),e.blitFramebuffer(0,0,a,o,0,0,a,o,s,9728)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(e,t){e&&e.isWebGLRenderTarget&&(!1===P&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),P=!0),e=e.texture),b(e,t)},this.safeSetTextureCube=function(e,t){e&&e.isWebGLRenderTargetCube&&(!1===C&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),C=!0),e=e.texture),e&&e.isCubeTexture||Array.isArray(e.image)&&6===e.image.length?w(e,t):_(e,t)}}function Qr(e,t,n){return{convert:function(e){var i;if(e===ve)return 10497;if(e===ye)return 33071;if(e===xe)return 33648;if(e===be)return 9728;if(e===we)return 9984;if(e===_e)return 9986;if(e===Me)return 9729;if(e===Se)return 9985;if(e===Te)return 9987;if(e===Ee)return 5121;if(e===De)return 32819;if(e===Ne)return 32820;if(e===Ue)return 33635;if(e===Ae)return 5120;if(e===Le)return 5122;if(e===Re)return 5123;if(e===Pe)return 5124;if(e===Ce)return 5125;if(e===Ie)return 5126;if(e===Oe){if(n.isWebGL2)return 5131;if(null!==(i=t.get("OES_texture_half_float")))return i.HALF_FLOAT_OES}if(e===Fe)return 6406;if(e===ze)return 6407;if(e===Ge)return 6408;if(e===He)return 6409;if(e===Ve)return 6410;if(e===ke)return 6402;if(e===je)return 34041;if(e===We)return 6403;if(e===C)return 32774;if(e===I)return 32778;if(e===O)return 32779;if(e===U)return 0;if(e===B)return 1;if(e===F)return 768;if(e===z)return 769;if(e===G)return 770;if(e===H)return 771;if(e===V)return 772;if(e===k)return 773;if(e===j)return 774;if(e===W)return 775;if(e===q)return 776;if((e===qe||e===Xe||e===Ye||e===Je)&&null!==(i=t.get("WEBGL_compressed_texture_s3tc"))){if(e===qe)return i.COMPRESSED_RGB_S3TC_DXT1_EXT;if(e===Xe)return i.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(e===Ye)return i.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(e===Je)return i.COMPRESSED_RGBA_S3TC_DXT5_EXT}if((e===Ze||e===Ke||e===Qe||e===$e)&&null!==(i=t.get("WEBGL_compressed_texture_pvrtc"))){if(e===Ze)return i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(e===Ke)return i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(e===Qe)return i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(e===$e)return i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(e===et&&null!==(i=t.get("WEBGL_compressed_texture_etc1")))return i.COMPRESSED_RGB_ETC1_WEBGL;if((e===tt||e===nt||e===it||e===rt||e===at||e===ot||e===st||e===ct||e===lt||e===ht||e===ut||e===pt||e===dt||e===ft)&&null!==(i=t.get("WEBGL_compressed_texture_astc")))return e;if(e===D||e===N){if(n.isWebGL2){if(e===D)return 32775;if(e===N)return 32776}if(null!==(i=t.get("EXT_blend_minmax"))){if(e===D)return i.MIN_EXT;if(e===N)return i.MAX_EXT}}if(e===Be){if(n.isWebGL2)return 34042;if(null!==(i=t.get("WEBGL_depth_texture")))return i.UNSIGNED_INT_24_8_WEBGL}return 0}}}function $r(){Pn.call(this),this.type="Group"}function ea(){Pn.call(this),this.type="Camera",this.matrixWorldInverse=new sn,this.projectionMatrix=new sn,this.projectionMatrixInverse=new sn}function ta(e,t,n,i){ea.call(this),this.type="PerspectiveCamera",this.fov=void 0!==e?e:50,this.zoom=1,this.near=void 0!==n?n:.1,this.far=void 0!==i?i:2e3,this.focus=10,this.aspect=void 0!==t?t:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function na(e){ta.call(this),this.cameras=e||[]}Xr.prototype=Object.create(ei.prototype),Xr.prototype.constructor=Xr,Xr.prototype.isMeshDepthMaterial=!0,Xr.prototype.copy=function(e){return ei.prototype.copy.call(this,e),this.depthPacking=e.depthPacking,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this},Yr.prototype=Object.create(ei.prototype),Yr.prototype.constructor=Yr,Yr.prototype.isMeshDistanceMaterial=!0,Yr.prototype.copy=function(e){return ei.prototype.copy.call(this,e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this},$r.prototype=Object.assign(Object.create(Pn.prototype),{constructor:$r,isGroup:!0}),ea.prototype=Object.assign(Object.create(Pn.prototype),{constructor:ea,isCamera:!0,copy:function(e,t){return Pn.prototype.copy.call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this},getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),e=new Dt),this.updateMatrixWorld(!0);var t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()},updateMatrixWorld:function(e){Pn.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),ta.prototype=Object.assign(Object.create(ea.prototype),{constructor:ta,isPerspectiveCamera:!0,copy:function(e,t){return ea.prototype.copy.call(this,e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this},setFocalLength:function(e){var t=.5*this.getFilmHeight()/e;this.fov=2*Ct.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var e=Math.tan(.5*Ct.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e},getEffectiveFOV:function(){return 2*Ct.RAD2DEG*Math.atan(Math.tan(.5*Ct.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(e,t,n,i,r,a){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=this.near,t=e*Math.tan(.5*Ct.DEG2RAD*this.fov)/this.zoom,n=2*t,i=this.aspect*n,r=-.5*i,a=this.view;if(null!==this.view&&this.view.enabled){var o=a.fullWidth,s=a.fullHeight;r+=a.offsetX*i/o,t-=a.offsetY*n/s,i*=a.width/o,n*=a.height/s}var c=this.filmOffset;0!==c&&(r+=e*c/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,t,t-n,e,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){var t=Pn.prototype.toJSON.call(this,e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}),na.prototype=Object.assign(Object.create(ta.prototype),{constructor:na,isArrayCamera:!0});var ia,ra,aa,oa,sa,ca,la=new Dt,ha=new Dt;function ua(e,t,n){la.setFromMatrixPosition(t.matrixWorld),ha.setFromMatrixPosition(n.matrixWorld);var i=la.distanceTo(ha),r=t.projectionMatrix.elements,a=n.projectionMatrix.elements,o=r[14]/(r[10]-1),s=r[14]/(r[10]+1),c=(r[9]+1)/r[5],l=(r[9]-1)/r[5],h=(r[8]-1)/r[0],u=(a[8]+1)/a[0],p=o*h,d=o*u,f=i/(-h+u),m=f*-h;t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(m),e.translateZ(f),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.getInverse(e.matrixWorld);var g=o+f,v=s+f,y=p-m,x=d+(i-m),b=c*s/v*g,w=l*s/v*g;e.projectionMatrix.makePerspective(y,x,b,w,g,v)}function pa(e){var t=this,n=null,i=null,r=null,a=[],o=new sn,s=new sn,c=1,l="stage";"undefined"!=typeof window&&"VRFrameData"in window&&(i=new window.VRFrameData,window.addEventListener("vrdisplaypresentchange",x,!1));var h=new sn,u=new Ot,p=new Dt,d=new ta;d.bounds=new Kt(0,0,.5,1),d.layers.enable(1);var f=new ta;f.bounds=new Kt(.5,0,.5,1),f.layers.enable(2);var m=new na([d,f]);function g(){return null!==n&&!0===n.isPresenting}m.layers.enable(1),m.layers.enable(2);var v,y=new It;function x(){if(g()){var i=n.getEyeParameters("left"),r=i.renderWidth*c,a=i.renderHeight*c;v=e.getPixelRatio(),e.getSize(y),e.setDrawingBufferSize(2*r,a,1),_.start()}else t.enabled&&e.setDrawingBufferSize(y.width,y.height,v),_.stop()}var b=[];function w(e){for(var t=navigator.getGamepads&&navigator.getGamepads(),n=0,i=0,r=t.length;n<r;n++){var a=t[n];if(a&&("Daydream Controller"===a.id||"Gear VR Controller"===a.id||"Oculus Go Controller"===a.id||"OpenVR Gamepad"===a.id||a.id.startsWith("Oculus Touch")||a.id.startsWith("Spatial Controller"))){if(i===e)return a;i++}}}this.enabled=!1,this.getController=function(e){var t=a[e];return void 0===t&&((t=new $r).matrixAutoUpdate=!1,t.visible=!1,a[e]=t),t},this.getDevice=function(){return n},this.setDevice=function(e){void 0!==e&&(n=e),_.setContext(e)},this.setFramebufferScaleFactor=function(e){c=e},this.setFrameOfReferenceType=function(e){l=e},this.setPoseTarget=function(e){void 0!==e&&(r=e)},this.getCamera=function(e){var t="stage"===l?1.6:0;if(!1===g())return e.position.set(0,t,0),e.rotation.set(0,0,0),e;if(n.depthNear=e.near,n.depthFar=e.far,n.getFrameData(i),"stage"===l){var c=n.stageParameters;c?o.fromArray(c.sittingToStandingTransform):o.makeTranslation(0,t,0)}var v=i.pose,y=null!==r?r:e;y.matrix.copy(o),y.matrix.decompose(y.position,y.quaternion,y.scale),null!==v.orientation&&(u.fromArray(v.orientation),y.quaternion.multiply(u)),null!==v.position&&(u.setFromRotationMatrix(o),p.fromArray(v.position),p.applyQuaternion(u),y.position.add(p)),y.updateMatrixWorld(),d.near=e.near,f.near=e.near,d.far=e.far,f.far=e.far,d.matrixWorldInverse.fromArray(i.leftViewMatrix),f.matrixWorldInverse.fromArray(i.rightViewMatrix),s.getInverse(o),"stage"===l&&(d.matrixWorldInverse.multiply(s),f.matrixWorldInverse.multiply(s));var x=y.parent;null!==x&&(h.getInverse(x.matrixWorld),d.matrixWorldInverse.multiply(h),f.matrixWorldInverse.multiply(h)),d.matrixWorld.getInverse(d.matrixWorldInverse),f.matrixWorld.getInverse(f.matrixWorldInverse),d.projectionMatrix.fromArray(i.leftProjectionMatrix),f.projectionMatrix.fromArray(i.rightProjectionMatrix),ua(m,d,f);var _=n.getLayers();if(_.length){var M=_[0];null!==M.leftBounds&&4===M.leftBounds.length&&d.bounds.fromArray(M.leftBounds),null!==M.rightBounds&&4===M.rightBounds.length&&f.bounds.fromArray(M.rightBounds)}return function(){for(var e=0;e<a.length;e++){var t=a[e],n=w(e);if(void 0!==n&&void 0!==n.pose){if(null===n.pose)return;var i=n.pose;!1===i.hasPosition&&t.position.set(.2,-.6,-.05),null!==i.position&&t.position.fromArray(i.position),null!==i.orientation&&t.quaternion.fromArray(i.orientation),t.matrix.compose(t.position,t.quaternion,t.scale),t.matrix.premultiply(o),t.matrix.decompose(t.position,t.quaternion,t.scale),t.matrixWorldNeedsUpdate=!0,t.visible=!0;var r="Daydream Controller"===n.id?0:1;b[e]!==n.buttons[r].pressed&&(b[e]=n.buttons[r].pressed,!0===b[e]?t.dispatchEvent({type:"selectstart"}):(t.dispatchEvent({type:"selectend"}),t.dispatchEvent({type:"select"})))}else t.visible=!1}}(),m},this.getStandingMatrix=function(){return o},this.isPresenting=g;var _=new bn;this.setAnimationLoop=function(e){_.setAnimationLoop(e),g()&&_.start()},this.submitFrame=function(){g()&&n.submitFrame()},this.dispose=function(){"undefined"!=typeof window&&window.removeEventListener("vrdisplaypresentchange",x)}}function da(e){var t=e.context,n=null,i=null,r=1,a=null,o="stage",s=null,c=[],l=[];function h(){return null!==i&&null!==a}var u=new ta;u.layers.enable(1),u.viewport=new Kt;var p=new ta;p.layers.enable(2),p.viewport=new Kt;var d=new na([u,p]);function f(e){var t=c[l.indexOf(e.inputSource)];t&&t.dispatchEvent({type:e.type})}function m(){e.setFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),y.stop()}function g(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.getInverse(e.matrixWorld)}d.layers.enable(1),d.layers.enable(2),this.enabled=!1,this.getController=function(e){var t=c[e];return void 0===t&&((t=new $r).matrixAutoUpdate=!1,t.visible=!1,c[e]=t),t},this.getDevice=function(){return n},this.setDevice=function(e){void 0!==e&&(n=e),e instanceof XRDevice&&t.setCompatibleXRDevice(e)},this.setFramebufferScaleFactor=function(e){r=e},this.setFrameOfReferenceType=function(e){o=e},this.setSession=function(n){null!==(i=n)&&(i.addEventListener("select",f),i.addEventListener("selectstart",f),i.addEventListener("selectend",f),i.addEventListener("end",m),i.baseLayer=new XRWebGLLayer(i,t,{framebufferScaleFactor:r}),i.requestFrameOfReference(o).then(function(t){a=t,e.setFramebuffer(i.baseLayer.framebuffer),y.setContext(i),y.start()}),l=i.getInputSources(),i.addEventListener("inputsourceschange",function(){l=i.getInputSources(),console.log(l);for(var e=0;e<c.length;e++){c[e].userData.inputSource=l[e]}}))},this.getCamera=function(e){if(h()){var t=e.parent,n=d.cameras;g(d,t);for(var i=0;i<n.length;i++)g(n[i],t);e.matrixWorld.copy(d.matrixWorld);for(var r=e.children,a=(i=0,r.length);i<a;i++)r[i].updateMatrixWorld(!0);return ua(d,u,p),d}return e},this.isPresenting=h;var v=null;var y=new bn;y.setAnimationLoop(function(e,t){if(null!==(s=t.getDevicePose(a)))for(var n=i.baseLayer,r=t.views,o=0;o<r.length;o++){var h=r[o],u=n.getViewport(h),p=s.getViewMatrix(h),f=d.cameras[o];f.matrix.fromArray(p).getInverse(f.matrix),f.projectionMatrix.fromArray(h.projectionMatrix),f.viewport.set(u.x,u.y,u.width,u.height),0===o&&d.matrix.copy(f.matrix)}for(o=0;o<c.length;o++){var m=c[o],g=l[o];if(g){var y=t.getInputPose(g,a);if(null!==y){"targetRay"in y?m.matrix.elements=y.targetRay.transformMatrix:"pointerMatrix"in y&&(m.matrix.elements=y.pointerMatrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.visible=!0;continue}}m.visible=!1}v&&v(e)}),this.setAnimationLoop=function(e){v=e},this.dispose=function(){},this.getStandingMatrix=function(){return console.warn("THREE.WebXRManager: getStandingMatrix() is no longer needed."),new sn},this.submitFrame=function(){}}function fa(e){console.log("THREE.WebGLRenderer",d);var t=void 0!==(e=e||{}).canvas?e.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),n=void 0!==e.context?e.context:null,i=void 0!==e.alpha&&e.alpha,r=void 0===e.depth||e.depth,a=void 0===e.stencil||e.stencil,o=void 0!==e.antialias&&e.antialias,s=void 0===e.premultipliedAlpha||e.premultipliedAlpha,c=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,l=void 0!==e.powerPreference?e.powerPreference:"default",h=null,u=null;this.domElement=t,this.context=null,this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.gammaInput=!1,this.gammaOutput=!1,this.physicallyCorrectLights=!1,this.toneMapping=ae,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var p,f,m,g,v,y,x,w,_,M,S,T,E,A,L,R,P,C,I=this,O=!1,D=null,N=null,U=null,B=-1,F={geometry:null,program:null,wireframe:!1},z=null,G=null,H=new Kt,V=new Kt,k=null,j=t.width,W=t.height,q=1,X=new Kt(0,0,j,W),Y=new Kt(0,0,j,W),J=!1,Z=new on,K=new Mi,Q=!1,$=!1,ee=new sn,te=new Dt;function ne(){return null===N?q:1}try{var ie={alpha:i,depth:r,stencil:a,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:c,powerPreference:l};if(t.addEventListener("webglcontextlost",ce,!1),t.addEventListener("webglcontextrestored",le,!1),null===(p=n||t.getContext("webgl",ie)||t.getContext("experimental-webgl",ie)))throw null!==t.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");void 0===p.getShaderPrecisionFormat&&(p.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(e){throw console.error("THREE.WebGLRenderer: "+e.message),e}function re(){f=new Si(p),(m=new _i(p,f,e)).isWebGL2||(f.get("WEBGL_depth_texture"),f.get("OES_texture_float"),f.get("OES_texture_half_float"),f.get("OES_texture_half_float_linear"),f.get("OES_standard_derivatives"),f.get("OES_element_index_uint"),f.get("ANGLE_instanced_arrays")),f.get("OES_texture_float_linear"),C=new Qr(p,f,m),(g=new Zr(p,f,C,m)).scissor(V.copy(Y).multiplyScalar(q)),g.viewport(H.copy(X).multiplyScalar(q)),v=new Ai(p),y=new Br,x=new Kr(p,f,g,y,m,C,v),w=new wn(p),_=new Ti(p,w,v),M=new Pi(_,v),L=new Ri(p),S=new Ur(I,f,m,x),T=new Hr,E=new qr,A=new bi(I,g,M,s),R=new wi(p,f,v,m),P=new Ei(p,f,v,m),v.programs=S.programs,I.context=p,I.capabilities=m,I.extensions=f,I.properties=y,I.renderLists=T,I.state=g,I.info=v}re();var oe=null;"undefined"!=typeof navigator&&(oe="xr"in navigator?new da(I):new pa(I)),this.vr=oe;var se=new Jr(I,M,m.maxTextureSize);function ce(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),O=!0}function le(){console.log("THREE.WebGLRenderer: Context Restored."),O=!1,re()}function he(e){var t=e.target;t.removeEventListener("dispose",he),function(e){ue(e),y.remove(e)}(t)}function ue(e){var t=y.get(e).program;e.program=void 0,void 0!==t&&S.releaseProgram(t)}this.shadowMap=se,this.getContext=function(){return p},this.getContextAttributes=function(){return p.getContextAttributes()},this.forceContextLoss=function(){var e=f.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){var e=f.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return q},this.setPixelRatio=function(e){void 0!==e&&(q=e,this.setSize(j,W,!1))},this.getSize=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),e=new It),e.set(j,W)},this.setSize=function(e,n,i){oe.isPresenting()?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(j=e,W=n,t.width=e*q,t.height=n*q,!1!==i&&(t.style.width=e+"px",t.style.height=n+"px"),this.setViewport(0,0,e,n))},this.getDrawingBufferSize=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),e=new It),e.set(j*q,W*q)},this.setDrawingBufferSize=function(e,n,i){j=e,W=n,q=i,t.width=e*i,t.height=n*i,this.setViewport(0,0,e,n)},this.getCurrentViewport=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),e=new Kt),e.copy(H)},this.getViewport=function(e){return e.copy(X)},this.setViewport=function(e,t,n,i){e.isVector4?X.set(e.x,e.y,e.z,e.w):X.set(e,t,n,i),g.viewport(H.copy(X).multiplyScalar(q))},this.getScissor=function(e){return e.copy(Y)},this.setScissor=function(e,t,n,i){e.isVector4?Y.set(e.x,e.y,e.z,e.w):Y.set(e,t,n,i),g.scissor(V.copy(Y).multiplyScalar(q))},this.getScissorTest=function(){return J},this.setScissorTest=function(e){g.setScissorTest(J=e)},this.getClearColor=function(){return A.getClearColor()},this.setClearColor=function(){A.setClearColor.apply(A,arguments)},this.getClearAlpha=function(){return A.getClearAlpha()},this.setClearAlpha=function(){A.setClearAlpha.apply(A,arguments)},this.clear=function(e,t,n){var i=0;(void 0===e||e)&&(i|=16384),(void 0===t||t)&&(i|=256),(void 0===n||n)&&(i|=1024),p.clear(i)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",ce,!1),t.removeEventListener("webglcontextrestored",le,!1),T.dispose(),E.dispose(),y.dispose(),M.dispose(),oe.dispose(),de.stop()},this.renderBufferImmediate=function(e,t){g.initAttributes();var n=y.get(e);e.hasPositions&&!n.position&&(n.position=p.createBuffer()),e.hasNormals&&!n.normal&&(n.normal=p.createBuffer()),e.hasUvs&&!n.uv&&(n.uv=p.createBuffer()),e.hasColors&&!n.color&&(n.color=p.createBuffer());var i=t.getAttributes();e.hasPositions&&(p.bindBuffer(34962,n.position),p.bufferData(34962,e.positionArray,35048),g.enableAttribute(i.position),p.vertexAttribPointer(i.position,3,5126,!1,0,0)),e.hasNormals&&(p.bindBuffer(34962,n.normal),p.bufferData(34962,e.normalArray,35048),g.enableAttribute(i.normal),p.vertexAttribPointer(i.normal,3,5126,!1,0,0)),e.hasUvs&&(p.bindBuffer(34962,n.uv),p.bufferData(34962,e.uvArray,35048),g.enableAttribute(i.uv),p.vertexAttribPointer(i.uv,2,5126,!1,0,0)),e.hasColors&&(p.bindBuffer(34962,n.color),p.bufferData(34962,e.colorArray,35048),g.enableAttribute(i.color),p.vertexAttribPointer(i.color,3,5126,!1,0,0)),g.disableUnusedAttributes(),p.drawArrays(4,0,e.count),e.count=0},this.renderBufferDirect=function(e,t,n,i,r,a){var o=r.isMesh&&r.matrixWorld.determinant()<0;g.setMaterial(i,o);var s=ve(e,t,i,r),c=!1;F.geometry===n.id&&F.program===s.id&&F.wireframe===(!0===i.wireframe)||(F.geometry=n.id,F.program=s.id,F.wireframe=!0===i.wireframe,c=!0),r.morphTargetInfluences&&(L.update(r,n,i,s),c=!0);var l,h=n.index,u=n.attributes.position,d=1;!0===i.wireframe&&(h=_.getWireframeAttribute(n),d=2);var v=R;null!==h&&(l=w.get(h),(v=P).setIndex(l)),c&&(!function(e,t,n){if(n&&n.isInstancedBufferGeometry&&!m.isWebGL2&&null===f.get("ANGLE_instanced_arrays"))return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");g.initAttributes();var i=n.attributes,r=t.getAttributes(),a=e.defaultAttributeValues;for(var o in r){var s=r[o];if(s>=0){var c=i[o];if(void 0!==c){var l=c.normalized,h=c.itemSize,u=w.get(c);if(void 0===u)continue;var d=u.buffer,v=u.type,y=u.bytesPerElement;if(c.isInterleavedBufferAttribute){var x=c.data,b=x.stride,_=c.offset;x&&x.isInstancedInterleavedBuffer?(g.enableAttributeAndDivisor(s,x.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=x.meshPerAttribute*x.count)):g.enableAttribute(s),p.bindBuffer(34962,d),p.vertexAttribPointer(s,h,v,l,b*y,_*y)}else c.isInstancedBufferAttribute?(g.enableAttributeAndDivisor(s,c.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=c.meshPerAttribute*c.count)):g.enableAttribute(s),p.bindBuffer(34962,d),p.vertexAttribPointer(s,h,v,l,0,0)}else if(void 0!==a){var M=a[o];if(void 0!==M)switch(M.length){case 2:p.vertexAttrib2fv(s,M);break;case 3:p.vertexAttrib3fv(s,M);break;case 4:p.vertexAttrib4fv(s,M);break;default:p.vertexAttrib1fv(s,M)}}}}g.disableUnusedAttributes()}(i,s,n),null!==h&&p.bindBuffer(34963,l.buffer));var y=1/0;null!==h?y=h.count:void 0!==u&&(y=u.count);var x=n.drawRange.start*d,b=n.drawRange.count*d,M=null!==a?a.start*d:0,S=null!==a?a.count*d:1/0,T=Math.max(x,M),E=Math.min(y,x+b,M+S)-1,A=Math.max(0,E-T+1);if(0!==A){if(r.isMesh)if(!0===i.wireframe)g.setLineWidth(i.wireframeLinewidth*ne()),v.setMode(1);else switch(r.drawMode){case vt:v.setMode(4);break;case yt:v.setMode(5);break;case xt:v.setMode(6)}else if(r.isLine){var C=i.linewidth;void 0===C&&(C=1),g.setLineWidth(C*ne()),r.isLineSegments?v.setMode(1):r.isLineLoop?v.setMode(2):v.setMode(3)}else r.isPoints?v.setMode(0):r.isSprite&&v.setMode(4);n&&n.isInstancedBufferGeometry?n.maxInstancedCount>0&&v.renderInstances(n,T,A):v.render(T,A)}},this.compile=function(e,t){(u=E.get(e,t)).init(),e.traverse(function(e){e.isLight&&(u.pushLight(e),e.castShadow&&u.pushShadow(e))}),u.setupLights(t),e.traverse(function(t){if(t.material)if(Array.isArray(t.material))for(var n=0;n<t.material.length;n++)ge(t.material[n],e.fog,t);else ge(t.material,e.fog,t)})};var pe=null;var de=new bn;function fe(e,t,n,i){for(var r=0,a=e.length;r<a;r++){var o=e[r],s=o.object,c=o.geometry,l=void 0===i?o.material:i,h=o.group;if(n.isArrayCamera){G=n;for(var p=n.cameras,d=0,f=p.length;d<f;d++){var m=p[d];if(s.layers.test(m.layers)){if("viewport"in m)g.viewport(H.copy(m.viewport));else{var v=m.bounds,y=v.x*j,x=v.y*W,b=v.z*j,w=v.w*W;g.viewport(H.set(y,x,b,w).multiplyScalar(q))}u.setupLights(m),me(s,t,m,c,l,h)}}}else G=null,me(s,t,n,c,l,h)}}function me(e,t,n,i,r,a){if(e.onBeforeRender(I,t,n,i,r,a),u=E.get(t,G||n),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),e.isImmediateRenderObject){g.setMaterial(r);var o=ve(n,t.fog,r,e);F.geometry=null,F.program=null,F.wireframe=!1,function(e,t){e.render(function(e){I.renderBufferImmediate(e,t)})}(e,o)}else I.renderBufferDirect(n,t.fog,i,r,e,a);e.onAfterRender(I,t,n,i,r,a),u=E.get(t,G||n)}function ge(e,t,n){var i=y.get(e),r=u.state.lights,a=u.state.shadowsArray,o=i.lightsHash,s=r.state.hash,c=S.getParameters(e,r.state,a,t,K.numPlanes,K.numIntersection,n),l=S.getProgramCode(e,c),h=i.program,p=!0;if(void 0===h)e.addEventListener("dispose",he);else if(h.code!==l)ue(e);else if(o.stateID!==s.stateID||o.directionalLength!==s.directionalLength||o.pointLength!==s.pointLength||o.spotLength!==s.spotLength||o.rectAreaLength!==s.rectAreaLength||o.hemiLength!==s.hemiLength||o.shadowsLength!==s.shadowsLength)o.stateID=s.stateID,o.directionalLength=s.directionalLength,o.pointLength=s.pointLength,o.spotLength=s.spotLength,o.rectAreaLength=s.rectAreaLength,o.hemiLength=s.hemiLength,o.shadowsLength=s.shadowsLength,p=!1;else{if(void 0!==c.shaderID)return;p=!1}if(p){if(c.shaderID){var d=xn[c.shaderID];i.shader={name:e.type,uniforms:ln(d.uniforms),vertexShader:d.vertexShader,fragmentShader:d.fragmentShader}}else i.shader={name:e.type,uniforms:e.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader};e.onBeforeCompile(i.shader,I),l=S.getProgramCode(e,c),h=S.acquireProgram(e,i.shader,c,l),i.program=h,e.program=h}var f=h.getAttributes();if(e.morphTargets){e.numSupportedMorphTargets=0;for(var m=0;m<I.maxMorphTargets;m++)f["morphTarget"+m]>=0&&e.numSupportedMorphTargets++}if(e.morphNormals){e.numSupportedMorphNormals=0;for(m=0;m<I.maxMorphNormals;m++)f["morphNormal"+m]>=0&&e.numSupportedMorphNormals++}var g=i.shader.uniforms;(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(i.numClippingPlanes=K.numPlanes,i.numIntersection=K.numIntersection,g.clippingPlanes=K.uniform),i.fog=t,void 0===o&&(i.lightsHash=o={}),o.stateID=s.stateID,o.directionalLength=s.directionalLength,o.pointLength=s.pointLength,o.spotLength=s.spotLength,o.rectAreaLength=s.rectAreaLength,o.hemiLength=s.hemiLength,o.shadowsLength=s.shadowsLength,e.lights&&(g.ambientLightColor.value=r.state.ambient,g.directionalLights.value=r.state.directional,g.spotLights.value=r.state.spot,g.rectAreaLights.value=r.state.rectArea,g.pointLights.value=r.state.point,g.hemisphereLights.value=r.state.hemi,g.directionalShadowMap.value=r.state.directionalShadowMap,g.directionalShadowMatrix.value=r.state.directionalShadowMatrix,g.spotShadowMap.value=r.state.spotShadowMap,g.spotShadowMatrix.value=r.state.spotShadowMatrix,g.pointShadowMap.value=r.state.pointShadowMap,g.pointShadowMatrix.value=r.state.pointShadowMatrix);var v=i.program.getUniforms(),x=Sr.seqWithValue(v.seq,g);i.uniformsList=x}function ve(e,t,n,i){x.resetTextureUnits();var r=y.get(n),a=u.state.lights,o=r.lightsHash,s=a.state.hash;if(Q&&($||e!==z)){var c=e===z&&n.id===B;K.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,e,r,c)}!1===n.needsUpdate&&(void 0===r.program?n.needsUpdate=!0:n.fog&&r.fog!==t?n.needsUpdate=!0:(!n.lights||o.stateID===s.stateID&&o.directionalLength===s.directionalLength&&o.pointLength===s.pointLength&&o.spotLength===s.spotLength&&o.rectAreaLength===s.rectAreaLength&&o.hemiLength===s.hemiLength&&o.shadowsLength===s.shadowsLength)&&(void 0===r.numClippingPlanes||r.numClippingPlanes===K.numPlanes&&r.numIntersection===K.numIntersection)||(n.needsUpdate=!0)),n.needsUpdate&&(ge(n,t,i),n.needsUpdate=!1);var l,h,d=!1,f=!1,v=!1,w=r.program,_=w.getUniforms(),M=r.shader.uniforms;if(g.useProgram(w.program)&&(d=!0,f=!0,v=!0),n.id!==B&&(B=n.id,f=!0),d||z!==e){if(_.setValue(p,"projectionMatrix",e.projectionMatrix),m.logarithmicDepthBuffer&&_.setValue(p,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),z!==e&&(z=e,f=!0,v=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshStandardMaterial||n.envMap){var S=_.map.cameraPosition;void 0!==S&&S.setValue(p,te.setFromMatrixPosition(e.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.skinning)&&_.setValue(p,"viewMatrix",e.matrixWorldInverse)}if(n.skinning){_.setOptional(p,i,"bindMatrix"),_.setOptional(p,i,"bindMatrixInverse");var T=i.skeleton;if(T){var E=T.bones;if(m.floatVertexTextures){if(void 0===T.boneTexture){var A=Math.sqrt(4*E.length);A=Ct.ceilPowerOfTwo(A),A=Math.max(A,4);var L=new Float32Array(A*A*4);L.set(T.boneMatrices);var R=new tn(L,A,A,Ge,Ie);R.needsUpdate=!0,T.boneMatrices=L,T.boneTexture=R,T.boneTextureSize=A}_.setValue(p,"boneTexture",T.boneTexture,x),_.setValue(p,"boneTextureSize",T.boneTextureSize)}else _.setOptional(p,T,"boneMatrices")}}return f&&(_.setValue(p,"toneMappingExposure",I.toneMappingExposure),_.setValue(p,"toneMappingWhitePoint",I.toneMappingWhitePoint),n.lights&&(h=v,(l=M).ambientLightColor.needsUpdate=h,l.directionalLights.needsUpdate=h,l.pointLights.needsUpdate=h,l.spotLights.needsUpdate=h,l.rectAreaLights.needsUpdate=h,l.hemisphereLights.needsUpdate=h),t&&n.fog&&function(e,t){e.fogColor.value=t.color,t.isFog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t.isFogExp2&&(e.fogDensity.value=t.density)}(M,t),n.isMeshBasicMaterial?ye(M,n):n.isMeshLambertMaterial?(ye(M,n),function(e,t){t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap)}(M,n)):n.isMeshPhongMaterial?(ye(M,n),n.isMeshToonMaterial?function(e,t){xe(e,t),t.gradientMap&&(e.gradientMap.value=t.gradientMap)}(M,n):xe(M,n)):n.isMeshStandardMaterial?(ye(M,n),n.isMeshPhysicalMaterial?function(e,t){be(e,t),e.reflectivity.value=t.reflectivity,e.clearCoat.value=t.clearCoat,e.clearCoatRoughness.value=t.clearCoatRoughness}(M,n):be(M,n)):n.isMeshMatcapMaterial?(ye(M,n),function(e,t){t.matcap&&(e.matcap.value=t.matcap);t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===b&&(e.bumpScale.value*=-1));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===b&&e.normalScale.value.negate());t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(M,n)):n.isMeshDepthMaterial?(ye(M,n),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(M,n)):n.isMeshDistanceMaterial?(ye(M,n),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias);e.referencePosition.value.copy(t.referencePosition),e.nearDistance.value=t.nearDistance,e.farDistance.value=t.farDistance}(M,n)):n.isMeshNormalMaterial?(ye(M,n),function(e,t){t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===b&&(e.bumpScale.value*=-1));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===b&&e.normalScale.value.negate());t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(M,n)):n.isLineBasicMaterial?(function(e,t){e.diffuse.value=t.color,e.opacity.value=t.opacity}(M,n),n.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(M,n)):n.isPointsMaterial?function(e,t){e.diffuse.value=t.color,e.opacity.value=t.opacity,e.size.value=t.size*q,e.scale.value=.5*W,e.map.value=t.map,null!==t.map&&(!0===t.map.matrixAutoUpdate&&t.map.updateMatrix(),e.uvTransform.value.copy(t.map.matrix))}(M,n):n.isSpriteMaterial?function(e,t){e.diffuse.value=t.color,e.opacity.value=t.opacity,e.rotation.value=t.rotation,e.map.value=t.map,null!==t.map&&(!0===t.map.matrixAutoUpdate&&t.map.updateMatrix(),e.uvTransform.value.copy(t.map.matrix))}(M,n):n.isShadowMaterial&&(M.color.value=n.color,M.opacity.value=n.opacity),void 0!==M.ltc_1&&(M.ltc_1.value=yn.LTC_1),void 0!==M.ltc_2&&(M.ltc_2.value=yn.LTC_2),Sr.upload(p,r.uniformsList,M,x)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(Sr.upload(p,r.uniformsList,M,x),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&_.setValue(p,"center",i.center),_.setValue(p,"modelViewMatrix",i.modelViewMatrix),_.setValue(p,"normalMatrix",i.normalMatrix),_.setValue(p,"modelMatrix",i.matrixWorld),w}function ye(e,t){var n;e.opacity.value=t.opacity,t.color&&(e.diffuse.value=t.color),t.emissive&&e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.specularMap&&(e.specularMap.value=t.specularMap),t.envMap&&(e.envMap.value=t.envMap,e.flipEnvMap.value=t.envMap.isCubeTexture?-1:1,e.reflectivity.value=t.reflectivity,e.refractionRatio.value=t.refractionRatio,e.maxMipLevel.value=y.get(t.envMap).__maxMipLevel),t.lightMap&&(e.lightMap.value=t.lightMap,e.lightMapIntensity.value=t.lightMapIntensity),t.aoMap&&(e.aoMap.value=t.aoMap,e.aoMapIntensity.value=t.aoMapIntensity),t.map?n=t.map:t.specularMap?n=t.specularMap:t.displacementMap?n=t.displacementMap:t.normalMap?n=t.normalMap:t.bumpMap?n=t.bumpMap:t.roughnessMap?n=t.roughnessMap:t.metalnessMap?n=t.metalnessMap:t.alphaMap?n=t.alphaMap:t.emissiveMap&&(n=t.emissiveMap),void 0!==n&&(n.isWebGLRenderTarget&&(n=n.texture),!0===n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix))}function xe(e,t){e.specular.value=t.specular,e.shininess.value=Math.max(t.shininess,1e-4),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===b&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===b&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function be(e,t){e.roughness.value=t.roughness,e.metalness.value=t.metalness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap),t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===b&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===b&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}de.setAnimationLoop(function(e){oe.isPresenting()||pe&&pe(e)}),"undefined"!=typeof window&&de.setContext(window),this.setAnimationLoop=function(e){pe=e,oe.setAnimationLoop(e),de.start()},this.render=function(e,t){var n,i;if(void 0!==arguments[2]&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),n=arguments[2]),void 0!==arguments[3]&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),i=arguments[3]),t&&t.isCamera){if(!O){F.geometry=null,F.program=null,F.wireframe=!1,B=-1,z=null,!0===e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),oe.enabled&&(t=oe.getCamera(t)),(u=E.get(e,t)).init(),e.onBeforeRender(I,e,t,n||N),ee.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),Z.setFromMatrix(ee),$=this.localClippingEnabled,Q=K.init(this.clippingPlanes,$,t),(h=T.get(e,t)).init(),function e(t,n,i,r){if(!1===t.visible)return;var a=t.layers.test(n.layers);if(a)if(t.isGroup)i=t.renderOrder;else if(t.isLight)u.pushLight(t),t.castShadow&&u.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||Z.intersectsSprite(t)){r&&te.setFromMatrixPosition(t.matrixWorld).applyMatrix4(ee);var o=M.update(t),s=t.material;s.visible&&h.push(t,o,s,i,te.z,null)}}else if(t.isImmediateRenderObject)r&&te.setFromMatrixPosition(t.matrixWorld).applyMatrix4(ee),h.push(t,null,t.material,i,te.z,null);else if((t.isMesh||t.isLine||t.isPoints)&&(t.isSkinnedMesh&&t.skeleton.update(),!t.frustumCulled||Z.intersectsObject(t))){r&&te.setFromMatrixPosition(t.matrixWorld).applyMatrix4(ee);var o=M.update(t),s=t.material;if(Array.isArray(s))for(var c=o.groups,l=0,p=c.length;l<p;l++){var d=c[l],f=s[d.materialIndex];f&&f.visible&&h.push(t,o,f,i,te.z,d)}else s.visible&&h.push(t,o,s,i,te.z,null)}var m=t.children;for(var l=0,p=m.length;l<p;l++)e(m[l],n,i,r)}(e,t,0,I.sortObjects),!0===I.sortObjects&&h.sort(),Q&&K.beginShadows();var r=u.state.shadowsArray;se.render(r,e,t),u.setupLights(t),Q&&K.endShadows(),this.info.autoReset&&this.info.reset(),void 0!==n&&this.setRenderTarget(n),A.render(h,e,t,i);var a=h.opaque,o=h.transparent;if(e.overrideMaterial){var s=e.overrideMaterial;a.length&&fe(a,e,t,s),o.length&&fe(o,e,t,s)}else a.length&&fe(a,e,t),o.length&&fe(o,e,t);e.onAfterRender(I,e,t),null!==N&&(x.updateRenderTargetMipmap(N),x.updateMultisampleRenderTarget(N)),g.buffers.depth.setTest(!0),g.buffers.depth.setMask(!0),g.buffers.color.setMask(!0),g.setPolygonOffset(!1),oe.enabled&&oe.submitFrame(),h=null,u=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.setFramebuffer=function(e){D=e},this.getRenderTarget=function(){return N},this.setRenderTarget=function(e,t,n){N=e,e&&void 0===y.get(e).__webglFramebuffer&&x.setupRenderTarget(e);var i=D,r=!1;if(e){var a=y.get(e).__webglFramebuffer;e.isWebGLRenderTargetCube?(i=a[t||0],r=!0):i=e.isWebGLMultisampleRenderTarget?y.get(e).__webglMultisampledFramebuffer:a,H.copy(e.viewport),V.copy(e.scissor),k=e.scissorTest}else H.copy(X).multiplyScalar(q),V.copy(Y).multiplyScalar(q),k=J;if(U!==i&&(p.bindFramebuffer(36160,i),U=i),g.viewport(H),g.scissor(V),g.setScissorTest(k),r){var o=y.get(e.texture);p.framebufferTexture2D(36160,36064,34069+(t||0),o.__webglTexture,n||0)}},this.readRenderTargetPixels=function(e,t,n,i,r,a){if(e&&e.isWebGLRenderTarget){var o=y.get(e).__webglFramebuffer;if(o){var s=!1;o!==U&&(p.bindFramebuffer(36160,o),s=!0);try{var c=e.texture,l=c.format,h=c.type;if(l!==Ge&&C.convert(l)!==p.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(h===Ee||C.convert(h)===p.getParameter(35738)||h===Ie&&(m.isWebGL2||f.get("OES_texture_float")||f.get("WEBGL_color_buffer_float"))||h===Oe&&(m.isWebGL2?f.get("EXT_color_buffer_float"):f.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===p.checkFramebufferStatus(36160)?t>=0&&t<=e.width-i&&n>=0&&n<=e.height-r&&p.readPixels(t,n,i,r,C.convert(l),C.convert(h),a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{s&&p.bindFramebuffer(36160,U)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(e,t,n){var i=t.image.width,r=t.image.height,a=C.convert(t.format);x.setTexture2D(t,0),p.copyTexImage2D(3553,n||0,a,e.x,e.y,i,r,0)},this.copyTextureToTexture=function(e,t,n,i){var r=t.image.width,a=t.image.height,o=C.convert(n.format),s=C.convert(n.type);x.setTexture2D(n,0),t.isDataTexture?p.texSubImage2D(3553,i||0,e.x,e.y,r,a,o,s,t.image.data):p.texSubImage2D(3553,i||0,e.x,e.y,o,s,t.image)}}function ma(e,t){this.name="",this.color=new gn(e),this.density=void 0!==t?t:25e-5}function ga(e,t,n){this.name="",this.color=new gn(e),this.near=void 0!==t?t:1,this.far=void 0!==n?n:1e3}function va(){Pn.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0}function ya(e,t){this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0}function xa(e,t,n,i){this.data=e,this.itemSize=t,this.offset=n,this.normalized=!0===i}function ba(e){ei.call(this),this.type="SpriteMaterial",this.color=new gn(16777215),this.map=null,this.rotation=0,this.sizeAttenuation=!0,this.lights=!1,this.transparent=!0,this.setValues(e)}function wa(e){if(Pn.call(this),this.type="Sprite",void 0===ia){ia=new Yn;var t=new ya(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);ia.setIndex([0,1,2,0,2,3]),ia.addAttribute("position",new xa(t,3,0,!1)),ia.addAttribute("uv",new xa(t,2,3,!1))}this.geometry=ia,this.material=void 0!==e?e:new ba,this.center=new It(.5,.5)}function _a(){Pn.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function Ma(e,t){e&&e.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),xi.call(this,e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new sn,this.bindMatrixInverse=new sn}function Sa(e,t){if(e=e||[],this.bones=e.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),void 0===t)this.calculateInverses();else if(this.bones.length===t.length)this.boneInverses=t.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var n=0,i=this.bones.length;n<i;n++)this.boneInverses.push(new sn)}}function Ta(){Pn.call(this),this.type="Bone"}function Ea(e){ei.call(this),this.type="LineBasicMaterial",this.color=new gn(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.lights=!1,this.setValues(e)}function Aa(e,t,n){1===n&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),Pn.call(this),this.type="Line",this.geometry=void 0!==e?e:new Yn,this.material=void 0!==t?t:new Ea({color:16777215*Math.random()})}function La(e,t){Aa.call(this,e,t),this.type="LineSegments"}function Ra(e,t){Aa.call(this,e,t),this.type="LineLoop"}function Pa(e){ei.call(this),this.type="PointsMaterial",this.color=new gn(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.lights=!1,this.setValues(e)}function Ca(e,t){Pn.call(this),this.type="Points",this.geometry=void 0!==e?e:new Yn,this.material=void 0!==t?t:new Pa({color:16777215*Math.random()})}function Ia(e,t,n,i,r,a,o,s,c){Zt.call(this,e,t,n,i,r,a,o,s,c),this.format=void 0!==o?o:ze,this.minFilter=void 0!==a?a:Me,this.magFilter=void 0!==r?r:Me,this.generateMipmaps=!1}function Oa(e,t,n,i,r,a,o,s,c,l,h,u){Zt.call(this,null,a,o,s,c,l,i,r,h,u),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}function Da(e,t,n,i,r,a,o,s,c){Zt.call(this,e,t,n,i,r,a,o,s,c),this.needsUpdate=!0}function Na(e,t,n,i,r,a,o,s,c,l){if((l=void 0!==l?l:ke)!==ke&&l!==je)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&l===ke&&(n=Re),void 0===n&&l===je&&(n=Be),Zt.call(this,null,i,r,a,o,s,l,n,c),this.image={width:e,height:t},this.magFilter=void 0!==o?o:be,this.minFilter=void 0!==s?s:be,this.flipY=!1,this.generateMipmaps=!1}function Ua(e){Yn.call(this),this.type="WireframeGeometry";var t,n,i,r,a,o,s,c,l,h,u=[],p=[0,0],d={},f=["a","b","c"];if(e&&e.isGeometry){var m=e.faces;for(t=0,i=m.length;t<i;t++){var g=m[t];for(n=0;n<3;n++)s=g[f[n]],c=g[f[(n+1)%3]],p[0]=Math.min(s,c),p[1]=Math.max(s,c),void 0===d[l=p[0]+","+p[1]]&&(d[l]={index1:p[0],index2:p[1]})}for(l in d)o=d[l],h=e.vertices[o.index1],u.push(h.x,h.y,h.z),h=e.vertices[o.index2],u.push(h.x,h.y,h.z)}else if(e&&e.isBufferGeometry){var v,y,x,b,w,_,M;if(h=new Dt,null!==e.index){for(v=e.attributes.position,y=e.index,0===(x=e.groups).length&&(x=[{start:0,count:y.count,materialIndex:0}]),r=0,a=x.length;r<a;++r)for(t=w=(b=x[r]).start,i=w+b.count;t<i;t+=3)for(n=0;n<3;n++)s=y.getX(t+n),c=y.getX(t+(n+1)%3),p[0]=Math.min(s,c),p[1]=Math.max(s,c),void 0===d[l=p[0]+","+p[1]]&&(d[l]={index1:p[0],index2:p[1]});for(l in d)o=d[l],h.fromBufferAttribute(v,o.index1),u.push(h.x,h.y,h.z),h.fromBufferAttribute(v,o.index2),u.push(h.x,h.y,h.z)}else for(t=0,i=(v=e.attributes.position).count/3;t<i;t++)for(n=0;n<3;n++)_=3*t+n,h.fromBufferAttribute(v,_),u.push(h.x,h.y,h.z),M=3*t+(n+1)%3,h.fromBufferAttribute(v,M),u.push(h.x,h.y,h.z)}this.addAttribute("position",new kn(u,3))}function Ba(e,t,n){Dn.call(this),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:n},this.fromBufferGeometry(new Fa(e,t,n)),this.mergeVertices()}function Fa(e,t,n){Yn.call(this),this.type="ParametricBufferGeometry",this.parameters={func:e,slices:t,stacks:n};var i,r,a=[],o=[],s=[],c=[],l=new Dt,h=new Dt,u=new Dt,p=new Dt,d=new Dt;e.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var f=t+1;for(i=0;i<=n;i++){var m=i/n;for(r=0;r<=t;r++){var g=r/t;e(g,m,h),o.push(h.x,h.y,h.z),g-1e-5>=0?(e(g-1e-5,m,u),p.subVectors(h,u)):(e(g+1e-5,m,u),p.subVectors(u,h)),m-1e-5>=0?(e(g,m-1e-5,u),d.subVectors(h,u)):(e(g,m+1e-5,u),d.subVectors(u,h)),l.crossVectors(p,d).normalize(),s.push(l.x,l.y,l.z),c.push(g,m)}}for(i=0;i<n;i++)for(r=0;r<t;r++){var v=i*f+r,y=i*f+r+1,x=(i+1)*f+r+1,b=(i+1)*f+r;a.push(v,y,b),a.push(y,x,b)}this.setIndex(a),this.addAttribute("position",new kn(o,3)),this.addAttribute("normal",new kn(s,3)),this.addAttribute("uv",new kn(c,2))}function za(e,t,n,i){Dn.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:i},this.fromBufferGeometry(new Ga(e,t,n,i)),this.mergeVertices()}function Ga(e,t,n,i){Yn.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:i},n=n||1;var r=[],a=[];function o(e,t,n,i){var r,a,o=Math.pow(2,i),c=[];for(r=0;r<=o;r++){c[r]=[];var l=e.clone().lerp(n,r/o),h=t.clone().lerp(n,r/o),u=o-r;for(a=0;a<=u;a++)c[r][a]=0===a&&r===o?l:l.clone().lerp(h,a/u)}for(r=0;r<o;r++)for(a=0;a<2*(o-r)-1;a++){var p=Math.floor(a/2);a%2==0?(s(c[r][p+1]),s(c[r+1][p]),s(c[r][p])):(s(c[r][p+1]),s(c[r+1][p+1]),s(c[r+1][p]))}}function s(e){r.push(e.x,e.y,e.z)}function c(t,n){var i=3*t;n.x=e[i+0],n.y=e[i+1],n.z=e[i+2]}function l(e,t,n,i){i<0&&1===e.x&&(a[t]=e.x-1),0===n.x&&0===n.z&&(a[t]=i/2/Math.PI+.5)}function h(e){return Math.atan2(e.z,-e.x)}!function(e){for(var n=new Dt,i=new Dt,r=new Dt,a=0;a<t.length;a+=3)c(t[a+0],n),c(t[a+1],i),c(t[a+2],r),o(n,i,r,e)}(i=i||0),function(e){for(var t=new Dt,n=0;n<r.length;n+=3)t.x=r[n+0],t.y=r[n+1],t.z=r[n+2],t.normalize().multiplyScalar(e),r[n+0]=t.x,r[n+1]=t.y,r[n+2]=t.z}(n),function(){for(var e=new Dt,t=0;t<r.length;t+=3){e.x=r[t+0],e.y=r[t+1],e.z=r[t+2];var n=h(e)/2/Math.PI+.5,i=(o=e,Math.atan2(-o.y,Math.sqrt(o.x*o.x+o.z*o.z))/Math.PI+.5);a.push(n,1-i)}var o;(function(){for(var e=new Dt,t=new Dt,n=new Dt,i=new Dt,o=new It,s=new It,c=new It,u=0,p=0;u<r.length;u+=9,p+=6){e.set(r[u+0],r[u+1],r[u+2]),t.set(r[u+3],r[u+4],r[u+5]),n.set(r[u+6],r[u+7],r[u+8]),o.set(a[p+0],a[p+1]),s.set(a[p+2],a[p+3]),c.set(a[p+4],a[p+5]),i.copy(e).add(t).add(n).divideScalar(3);var d=h(i);l(o,p+0,e,d),l(s,p+2,t,d),l(c,p+4,n,d)}})(),function(){for(var e=0;e<a.length;e+=6){var t=a[e+0],n=a[e+2],i=a[e+4],r=Math.max(t,n,i),o=Math.min(t,n,i);r>.9&&o<.1&&(t<.2&&(a[e+0]+=1),n<.2&&(a[e+2]+=1),i<.2&&(a[e+4]+=1))}}()}(),this.addAttribute("position",new kn(r,3)),this.addAttribute("normal",new kn(r.slice(),3)),this.addAttribute("uv",new kn(a,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}function Ha(e,t){Dn.call(this),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Va(e,t)),this.mergeVertices()}function Va(e,t){Ga.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type="TetrahedronBufferGeometry",this.parameters={radius:e,detail:t}}function ka(e,t){Dn.call(this),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new ja(e,t)),this.mergeVertices()}function ja(e,t){Ga.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Wa(e,t){Dn.call(this),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new qa(e,t)),this.mergeVertices()}function qa(e,t){var n=(1+Math.sqrt(5))/2,i=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1];Ga.call(this,i,[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],e,t),this.type="IcosahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Xa(e,t){Dn.call(this),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Ya(e,t)),this.mergeVertices()}function Ya(e,t){var n=(1+Math.sqrt(5))/2,i=1/n,r=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,i];Ga.call(this,r,[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t),this.type="DodecahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Ja(e,t,n,i,r,a){Dn.call(this),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:i,closed:r},void 0!==a&&console.warn("THREE.TubeGeometry: taper has been removed.");var o=new Za(e,t,n,i,r);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals,this.fromBufferGeometry(o),this.mergeVertices()}function Za(e,t,n,i,r){Yn.call(this),this.type="TubeBufferGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:i,closed:r},t=t||64,n=n||1,i=i||8,r=r||!1;var a=e.computeFrenetFrames(t,r);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;var o,s,c=new Dt,l=new Dt,h=new It,u=new Dt,p=[],d=[],f=[],m=[];function g(r){u=e.getPointAt(r/t,u);var o=a.normals[r],h=a.binormals[r];for(s=0;s<=i;s++){var f=s/i*Math.PI*2,m=Math.sin(f),g=-Math.cos(f);l.x=g*o.x+m*h.x,l.y=g*o.y+m*h.y,l.z=g*o.z+m*h.z,l.normalize(),d.push(l.x,l.y,l.z),c.x=u.x+n*l.x,c.y=u.y+n*l.y,c.z=u.z+n*l.z,p.push(c.x,c.y,c.z)}}!function(){for(o=0;o<t;o++)g(o);g(!1===r?t:0),function(){for(o=0;o<=t;o++)for(s=0;s<=i;s++)h.x=o/t,h.y=s/i,f.push(h.x,h.y)}(),function(){for(s=1;s<=t;s++)for(o=1;o<=i;o++){var e=(i+1)*(s-1)+(o-1),n=(i+1)*s+(o-1),r=(i+1)*s+o,a=(i+1)*(s-1)+o;m.push(e,n,a),m.push(n,r,a)}}()}(),this.setIndex(m),this.addAttribute("position",new kn(p,3)),this.addAttribute("normal",new kn(d,3)),this.addAttribute("uv",new kn(f,2))}function Ka(e,t,n,i,r,a,o){Dn.call(this),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:i,p:r,q:a},void 0!==o&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new Qa(e,t,n,i,r,a)),this.mergeVertices()}function Qa(e,t,n,i,r,a){Yn.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:i,p:r,q:a},e=e||1,t=t||.4,n=Math.floor(n)||64,i=Math.floor(i)||8,r=r||2,a=a||3;var o,s,c=[],l=[],h=[],u=[],p=new Dt,d=new Dt,f=new Dt,m=new Dt,g=new Dt,v=new Dt,y=new Dt;for(o=0;o<=n;++o){var x=o/n*r*Math.PI*2;for(A(x,r,a,e,f),A(x+.01,r,a,e,m),v.subVectors(m,f),y.addVectors(m,f),g.crossVectors(v,y),y.crossVectors(g,v),g.normalize(),y.normalize(),s=0;s<=i;++s){var b=s/i*Math.PI*2,w=-t*Math.cos(b),_=t*Math.sin(b);p.x=f.x+(w*y.x+_*g.x),p.y=f.y+(w*y.y+_*g.y),p.z=f.z+(w*y.z+_*g.z),l.push(p.x,p.y,p.z),d.subVectors(p,f).normalize(),h.push(d.x,d.y,d.z),u.push(o/n),u.push(s/i)}}for(s=1;s<=n;s++)for(o=1;o<=i;o++){var M=(i+1)*(s-1)+(o-1),S=(i+1)*s+(o-1),T=(i+1)*s+o,E=(i+1)*(s-1)+o;c.push(M,S,E),c.push(S,T,E)}function A(e,t,n,i,r){var a=Math.cos(e),o=Math.sin(e),s=n/t*e,c=Math.cos(s);r.x=i*(2+c)*.5*a,r.y=i*(2+c)*o*.5,r.z=i*Math.sin(s)*.5}this.setIndex(c),this.addAttribute("position",new kn(l,3)),this.addAttribute("normal",new kn(h,3)),this.addAttribute("uv",new kn(u,2))}function $a(e,t,n,i,r){Dn.call(this),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:i,arc:r},this.fromBufferGeometry(new eo(e,t,n,i,r)),this.mergeVertices()}function eo(e,t,n,i,r){Yn.call(this),this.type="TorusBufferGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:i,arc:r},e=e||1,t=t||.4,n=Math.floor(n)||8,i=Math.floor(i)||6,r=r||2*Math.PI;var a,o,s=[],c=[],l=[],h=[],u=new Dt,p=new Dt,d=new Dt;for(a=0;a<=n;a++)for(o=0;o<=i;o++){var f=o/i*r,m=a/n*Math.PI*2;p.x=(e+t*Math.cos(m))*Math.cos(f),p.y=(e+t*Math.cos(m))*Math.sin(f),p.z=t*Math.sin(m),c.push(p.x,p.y,p.z),u.x=e*Math.cos(f),u.y=e*Math.sin(f),d.subVectors(p,u).normalize(),l.push(d.x,d.y,d.z),h.push(o/i),h.push(a/n)}for(a=1;a<=n;a++)for(o=1;o<=i;o++){var g=(i+1)*a+o-1,v=(i+1)*(a-1)+o-1,y=(i+1)*(a-1)+o,x=(i+1)*a+o;s.push(g,v,x),s.push(v,y,x)}this.setIndex(s),this.addAttribute("position",new kn(c,3)),this.addAttribute("normal",new kn(l,3)),this.addAttribute("uv",new kn(h,2))}Object.assign(ma.prototype,{isFogExp2:!0,clone:function(){return new ma(this.color,this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}),Object.assign(ga.prototype,{isFog:!0,clone:function(){return new ga(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}),va.prototype=Object.assign(Object.create(Pn.prototype),{constructor:va,isScene:!0,copy:function(e,t){return Pn.prototype.copy.call(this,e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this},toJSON:function(e){var t=Pn.prototype.toJSON.call(this,e);return null!==this.background&&(t.object.background=this.background.toJSON(e)),null!==this.fog&&(t.object.fog=this.fog.toJSON()),t},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(ya.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(ya.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setArray:function(e){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");return this.count=void 0!==e?e.length/this.stride:0,this.array=e,this},setDynamic:function(e){return this.dynamic=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.dynamic=e.dynamic,this},copyAt:function(e,t,n){e*=this.stride,n*=t.stride;for(var i=0,r=this.stride;i<r;i++)this.array[e+i]=t.array[n+i];return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(e){return this.onUploadCallback=e,this}}),Object.defineProperties(xa.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(xa.prototype,{isInterleavedBufferAttribute:!0,setX:function(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this},setY:function(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this},setZ:function(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this},setW:function(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this},getX:function(e){return this.data.array[e*this.data.stride+this.offset]},getY:function(e){return this.data.array[e*this.data.stride+this.offset+1]},getZ:function(e){return this.data.array[e*this.data.stride+this.offset+2]},getW:function(e){return this.data.array[e*this.data.stride+this.offset+3]},setXY:function(e,t,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this},setXYZ:function(e,t,n,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this},setXYZW:function(e,t,n,i,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this.data.array[e+3]=r,this}}),ba.prototype=Object.create(ei.prototype),ba.prototype.constructor=ba,ba.prototype.isSpriteMaterial=!0,ba.prototype.copy=function(e){return ei.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this},wa.prototype=Object.assign(Object.create(Pn.prototype),{constructor:wa,isSprite:!0,raycast:function(){var e=new Dt,t=new Dt,n=new Dt,i=new It,r=new It,a=new sn,o=new Dt,s=new Dt,c=new Dt,l=new It,h=new It,u=new It;function p(e,t,n,o,s,c){i.subVectors(e,n).addScalar(.5).multiply(o),void 0!==s?(r.x=c*i.x-s*i.y,r.y=s*i.x+c*i.y):r.copy(i),e.copy(t),e.x+=r.x,e.y+=r.y,e.applyMatrix4(a)}return function(i,r){t.setFromMatrixScale(this.matrixWorld),a.getInverse(this.modelViewMatrix).premultiply(this.matrixWorld),n.setFromMatrixPosition(this.modelViewMatrix);var d,f,m=this.material.rotation;0!==m&&(f=Math.cos(m),d=Math.sin(m));var g=this.center;p(o.set(-.5,-.5,0),n,g,t,d,f),p(s.set(.5,-.5,0),n,g,t,d,f),p(c.set(.5,.5,0),n,g,t,d,f),l.set(0,0),h.set(1,0),u.set(1,1);var v=i.ray.intersectTriangle(o,s,c,!1,e);if(null!==v||(p(s.set(-.5,.5,0),n,g,t,d,f),h.set(0,1),null!==(v=i.ray.intersectTriangle(o,c,s,!1,e)))){var y=i.ray.origin.distanceTo(e);y<i.near||y>i.far||r.push({distance:y,point:e.clone(),uv:vi.getUV(e,o,s,c,l,h,u,new It),face:null,object:this})}}}(),clone:function(){return new this.constructor(this.material).copy(this)},copy:function(e){return Pn.prototype.copy.call(this,e),void 0!==e.center&&this.center.copy(e.center),this}}),_a.prototype=Object.assign(Object.create(Pn.prototype),{constructor:_a,copy:function(e){Pn.prototype.copy.call(this,e,!1);for(var t=e.levels,n=0,i=t.length;n<i;n++){var r=t[n];this.addLevel(r.object.clone(),r.distance)}return this},addLevel:function(e,t){void 0===t&&(t=0),t=Math.abs(t);for(var n=this.levels,i=0;i<n.length&&!(t<n[i].distance);i++);n.splice(i,0,{distance:t,object:e}),this.add(e)},getObjectForDistance:function(e){for(var t=this.levels,n=1,i=t.length;n<i&&!(e<t[n].distance);n++);return t[n-1].object},raycast:(ra=new Dt,function(e,t){ra.setFromMatrixPosition(this.matrixWorld);var n=e.ray.origin.distanceTo(ra);this.getObjectForDistance(n).raycast(e,t)}),update:function(){var e=new Dt,t=new Dt;return function(n){var i=this.levels;if(i.length>1){e.setFromMatrixPosition(n.matrixWorld),t.setFromMatrixPosition(this.matrixWorld);var r=e.distanceTo(t);i[0].object.visible=!0;for(var a=1,o=i.length;a<o&&r>=i[a].distance;a++)i[a-1].object.visible=!1,i[a].object.visible=!0;for(;a<o;a++)i[a].object.visible=!1}}}(),toJSON:function(e){var t=Pn.prototype.toJSON.call(this,e);t.object.levels=[];for(var n=this.levels,i=0,r=n.length;i<r;i++){var a=n[i];t.object.levels.push({object:a.object.uuid,distance:a.distance})}return t}}),Ma.prototype=Object.assign(Object.create(xi.prototype),{constructor:Ma,isSkinnedMesh:!0,bind:function(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.getInverse(t)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){for(var e=new Kt,t=this.geometry.attributes.skinWeight,n=0,i=t.count;n<i;n++){e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.w=t.getW(n);var r=1/e.manhattanLength();r!==1/0?e.multiplyScalar(r):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}},updateMatrixWorld:function(e){xi.prototype.updateMatrixWorld.call(this,e),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Object.assign(Sa.prototype,{calculateInverses:function(){this.boneInverses=[];for(var e=0,t=this.bones.length;e<t;e++){var n=new sn;this.bones[e]&&n.getInverse(this.bones[e].matrixWorld),this.boneInverses.push(n)}},pose:function(){var e,t,n;for(t=0,n=this.bones.length;t<n;t++)(e=this.bones[t])&&e.matrixWorld.getInverse(this.boneInverses[t]);for(t=0,n=this.bones.length;t<n;t++)(e=this.bones[t])&&(e.parent&&e.parent.isBone?(e.matrix.getInverse(e.parent.matrixWorld),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))},update:(aa=new sn,oa=new sn,function(){for(var e=this.bones,t=this.boneInverses,n=this.boneMatrices,i=this.boneTexture,r=0,a=e.length;r<a;r++){var o=e[r]?e[r].matrixWorld:oa;aa.multiplyMatrices(o,t[r]),aa.toArray(n,16*r)}void 0!==i&&(i.needsUpdate=!0)}),clone:function(){return new Sa(this.bones,this.boneInverses)},getBoneByName:function(e){for(var t=0,n=this.bones.length;t<n;t++){var i=this.bones[t];if(i.name===e)return i}}}),Ta.prototype=Object.assign(Object.create(Pn.prototype),{constructor:Ta,isBone:!0}),Ea.prototype=Object.create(ei.prototype),Ea.prototype.constructor=Ea,Ea.prototype.isLineBasicMaterial=!0,Ea.prototype.copy=function(e){return ei.prototype.copy.call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this},Aa.prototype=Object.assign(Object.create(Pn.prototype),{constructor:Aa,isLine:!0,computeLineDistances:(sa=new Dt,ca=new Dt,function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[0],i=1,r=t.count;i<r;i++)sa.fromBufferAttribute(t,i-1),ca.fromBufferAttribute(t,i),n[i]=n[i-1],n[i]+=sa.distanceTo(ca);e.addAttribute("lineDistance",new kn(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry){var a=e.vertices;for((n=e.lineDistances)[0]=0,i=1,r=a.length;i<r;i++)n[i]=n[i-1],n[i]+=a[i-1].distanceTo(a[i])}return this}),raycast:function(){var e=new sn,t=new gi,n=new rn;return function(i,r){var a=i.linePrecision,o=this.geometry,s=this.matrixWorld;if(null===o.boundingSphere&&o.computeBoundingSphere(),n.copy(o.boundingSphere),n.applyMatrix4(s),n.radius+=a,!1!==i.ray.intersectsSphere(n)){e.getInverse(s),t.copy(i.ray).applyMatrix4(e);var c=a/((this.scale.x+this.scale.y+this.scale.z)/3),l=c*c,h=new Dt,u=new Dt,p=new Dt,d=new Dt,f=this&&this.isLineSegments?2:1;if(o.isBufferGeometry){var m=o.index,g=o.attributes.position.array;if(null!==m)for(var v=m.array,y=0,x=v.length-1;y<x;y+=f){var b=v[y],w=v[y+1];if(h.fromArray(g,3*b),u.fromArray(g,3*w),!(t.distanceSqToSegment(h,u,d,p)>l))d.applyMatrix4(this.matrixWorld),(S=i.ray.origin.distanceTo(d))<i.near||S>i.far||r.push({distance:S,point:p.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}else for(y=0,x=g.length/3-1;y<x;y+=f){if(h.fromArray(g,3*y),u.fromArray(g,3*y+3),!(t.distanceSqToSegment(h,u,d,p)>l))d.applyMatrix4(this.matrixWorld),(S=i.ray.origin.distanceTo(d))<i.near||S>i.far||r.push({distance:S,point:p.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}else if(o.isGeometry){var _=o.vertices,M=_.length;for(y=0;y<M-1;y+=f){var S;if(!(t.distanceSqToSegment(_[y],_[y+1],d,p)>l))d.applyMatrix4(this.matrixWorld),(S=i.ray.origin.distanceTo(d))<i.near||S>i.far||r.push({distance:S,point:p.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),La.prototype=Object.assign(Object.create(Aa.prototype),{constructor:La,isLineSegments:!0,computeLineDistances:function(){var e=new Dt,t=new Dt;return function(){var n=this.geometry;if(n.isBufferGeometry)if(null===n.index){for(var i=n.attributes.position,r=[],a=0,o=i.count;a<o;a+=2)e.fromBufferAttribute(i,a),t.fromBufferAttribute(i,a+1),r[a]=0===a?0:r[a-1],r[a+1]=r[a]+e.distanceTo(t);n.addAttribute("lineDistance",new kn(r,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(n.isGeometry){var s=n.vertices;for(r=n.lineDistances,a=0,o=s.length;a<o;a+=2)e.copy(s[a]),t.copy(s[a+1]),r[a]=0===a?0:r[a-1],r[a+1]=r[a]+e.distanceTo(t)}return this}}()}),Ra.prototype=Object.assign(Object.create(Aa.prototype),{constructor:Ra,isLineLoop:!0}),Pa.prototype=Object.create(ei.prototype),Pa.prototype.constructor=Pa,Pa.prototype.isPointsMaterial=!0,Pa.prototype.copy=function(e){return ei.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.morphTargets=e.morphTargets,this},Ca.prototype=Object.assign(Object.create(Pn.prototype),{constructor:Ca,isPoints:!0,raycast:function(){var e=new sn,t=new gi,n=new rn;return function(i,r){var a=this,o=this.geometry,s=this.matrixWorld,c=i.params.Points.threshold;if(null===o.boundingSphere&&o.computeBoundingSphere(),n.copy(o.boundingSphere),n.applyMatrix4(s),n.radius+=c,!1!==i.ray.intersectsSphere(n)){e.getInverse(s),t.copy(i.ray).applyMatrix4(e);var l=c/((this.scale.x+this.scale.y+this.scale.z)/3),h=l*l,u=new Dt,p=new Dt;if(o.isBufferGeometry){var d=o.index,f=o.attributes.position.array;if(null!==d)for(var m=d.array,g=0,v=m.length;g<v;g++){var y=m[g];u.fromArray(f,3*y),w(u,y)}else{g=0;for(var x=f.length/3;g<x;g++)u.fromArray(f,3*g),w(u,g)}}else{var b=o.vertices;for(g=0,x=b.length;g<x;g++)w(b[g],g)}}function w(e,n){var o=t.distanceSqToPoint(e);if(o<h){t.closestPointToPoint(e,p),p.applyMatrix4(s);var c=i.ray.origin.distanceTo(p);if(c<i.near||c>i.far)return;r.push({distance:c,distanceToRay:Math.sqrt(o),point:p.clone(),index:n,face:null,object:a})}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Ia.prototype=Object.assign(Object.create(Zt.prototype),{constructor:Ia,isVideoTexture:!0,update:function(){var e=this.image;e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),Oa.prototype=Object.create(Zt.prototype),Oa.prototype.constructor=Oa,Oa.prototype.isCompressedTexture=!0,Da.prototype=Object.create(Zt.prototype),Da.prototype.constructor=Da,Da.prototype.isCanvasTexture=!0,Na.prototype=Object.create(Zt.prototype),Na.prototype.constructor=Na,Na.prototype.isDepthTexture=!0,Ua.prototype=Object.create(Yn.prototype),Ua.prototype.constructor=Ua,Ba.prototype=Object.create(Dn.prototype),Ba.prototype.constructor=Ba,Fa.prototype=Object.create(Yn.prototype),Fa.prototype.constructor=Fa,za.prototype=Object.create(Dn.prototype),za.prototype.constructor=za,Ga.prototype=Object.create(Yn.prototype),Ga.prototype.constructor=Ga,Ha.prototype=Object.create(Dn.prototype),Ha.prototype.constructor=Ha,Va.prototype=Object.create(Ga.prototype),Va.prototype.constructor=Va,ka.prototype=Object.create(Dn.prototype),ka.prototype.constructor=ka,ja.prototype=Object.create(Ga.prototype),ja.prototype.constructor=ja,Wa.prototype=Object.create(Dn.prototype),Wa.prototype.constructor=Wa,qa.prototype=Object.create(Ga.prototype),qa.prototype.constructor=qa,Xa.prototype=Object.create(Dn.prototype),Xa.prototype.constructor=Xa,Ya.prototype=Object.create(Ga.prototype),Ya.prototype.constructor=Ya,Ja.prototype=Object.create(Dn.prototype),Ja.prototype.constructor=Ja,Za.prototype=Object.create(Yn.prototype),Za.prototype.constructor=Za,Za.prototype.toJSON=function(){var e=Yn.prototype.toJSON.call(this);return e.path=this.parameters.path.toJSON(),e},Ka.prototype=Object.create(Dn.prototype),Ka.prototype.constructor=Ka,Qa.prototype=Object.create(Yn.prototype),Qa.prototype.constructor=Qa,$a.prototype=Object.create(Dn.prototype),$a.prototype.constructor=$a,eo.prototype=Object.create(Yn.prototype),eo.prototype.constructor=eo;var to=function(e,t,n){n=n||2;var i,r,a,o,s,c,l,h=t&&t.length,u=h?t[0]*n:e.length,p=no(e,0,u,n,!0),d=[];if(!p)return d;if(h&&(p=function(e,t,n,i){var r,a,o,s,c,l=[];for(r=0,a=t.length;r<a;r++)o=t[r]*i,s=r<a-1?t[r+1]*i:e.length,(c=no(e,o,s,i,!1))===c.next&&(c.steiner=!0),l.push(po(c));for(l.sort(lo),r=0;r<l.length;r++)ho(l[r],n),n=io(n,n.next);return n}(e,t,p,n)),e.length>80*n){i=a=e[0],r=o=e[1];for(var f=n;f<u;f+=n)(s=e[f])<i&&(i=s),(c=e[f+1])<r&&(r=c),s>a&&(a=s),c>o&&(o=c);l=0!==(l=Math.max(a-i,o-r))?1/l:0}return ro(p,d,n,i,r,l),d};function no(e,t,n,i,r){var a,o;if(r===function(e,t,n,i){for(var r=0,a=t,o=n-i;a<n;a+=i)r+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return r}(e,t,n,i)>0)for(a=t;a<n;a+=i)o=wo(a,e[a],e[a+1],o);else for(a=n-i;a>=t;a-=i)o=wo(a,e[a],e[a+1],o);return o&&vo(o,o.next)&&(_o(o),o=o.next),o}function io(e,t){if(!e)return e;t||(t=e);var n,i=e;do{if(n=!1,i.steiner||!vo(i,i.next)&&0!==go(i.prev,i,i.next))i=i.next;else{if(_o(i),(i=t=i.prev)===i.next)break;n=!0}}while(n||i!==t);return t}function ro(e,t,n,i,r,a,o){if(e){!o&&a&&function(e,t,n,i){var r=e;do{null===r.z&&(r.z=uo(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,function(e){var t,n,i,r,a,o,s,c,l=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,i=n,s=0,t=0;t<l&&(s++,i=i.nextZ);t++);for(c=l;s>0||c>0&&i;)0!==s&&(0===c||!i||n.z<=i.z)?(r=n,n=n.nextZ,s--):(r=i,i=i.nextZ,c--),a?a.nextZ=r:e=r,r.prevZ=a,a=r;n=i}a.nextZ=null,l*=2}while(o>1)}(r)}(e,i,r,a);for(var s,c,l=e;e.prev!==e.next;)if(s=e.prev,c=e.next,a?oo(e,i,r,a):ao(e))t.push(s.i/n),t.push(e.i/n),t.push(c.i/n),_o(e),e=c.next,l=c.next;else if((e=c)===l){o?1===o?ro(e=so(e,t,n),t,n,i,r,a,2):2===o&&co(e,t,n,i,r,a):ro(io(e),t,n,i,r,a,1);break}}}function ao(e){var t=e.prev,n=e,i=e.next;if(go(t,n,i)>=0)return!1;for(var r=e.next.next;r!==e.prev;){if(fo(t.x,t.y,n.x,n.y,i.x,i.y,r.x,r.y)&&go(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function oo(e,t,n,i){var r=e.prev,a=e,o=e.next;if(go(r,a,o)>=0)return!1;for(var s=r.x<a.x?r.x<o.x?r.x:o.x:a.x<o.x?a.x:o.x,c=r.y<a.y?r.y<o.y?r.y:o.y:a.y<o.y?a.y:o.y,l=r.x>a.x?r.x>o.x?r.x:o.x:a.x>o.x?a.x:o.x,h=r.y>a.y?r.y>o.y?r.y:o.y:a.y>o.y?a.y:o.y,u=uo(s,c,t,n,i),p=uo(l,h,t,n,i),d=e.nextZ;d&&d.z<=p;){if(d!==e.prev&&d!==e.next&&fo(r.x,r.y,a.x,a.y,o.x,o.y,d.x,d.y)&&go(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=e.prevZ;d&&d.z>=u;){if(d!==e.prev&&d!==e.next&&fo(r.x,r.y,a.x,a.y,o.x,o.y,d.x,d.y)&&go(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function so(e,t,n){var i=e;do{var r=i.prev,a=i.next.next;!vo(r,a)&&yo(r,i,i.next,a)&&xo(r,a)&&xo(a,r)&&(t.push(r.i/n),t.push(i.i/n),t.push(a.i/n),_o(i),_o(i.next),i=e=a),i=i.next}while(i!==e);return i}function co(e,t,n,i,r,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&mo(o,s)){var c=bo(o,s);return o=io(o,o.next),c=io(c,c.next),ro(o,t,n,i,r,a),void ro(c,t,n,i,r,a)}s=s.next}o=o.next}while(o!==e)}function lo(e,t){return e.x-t.x}function ho(e,t){if(t=function(e,t){var n,i=t,r=e.x,a=e.y,o=-1/0;do{if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){var s=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=r&&s>o){if(o=s,s===r){if(a===i.y)return i;if(a===i.next.y)return i.next}n=i.x<i.next.x?i:i.next}}i=i.next}while(i!==t);if(!n)return null;if(r===o)return n.prev;var c,l=n,h=n.x,u=n.y,p=1/0;i=n.next;for(;i!==l;)r>=i.x&&i.x>=h&&r!==i.x&&fo(a<u?r:o,a,h,u,a<u?o:r,a,i.x,i.y)&&((c=Math.abs(a-i.y)/(r-i.x))<p||c===p&&i.x>n.x)&&xo(i,e)&&(n=i,p=c),i=i.next;return n}(e,t)){var n=bo(t,e);io(n,n.next)}}function uo(e,t,n,i,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function po(e){var t=e,n=e;do{t.x<n.x&&(n=t),t=t.next}while(t!==e);return n}function fo(e,t,n,i,r,a,o,s){return(r-o)*(t-s)-(e-o)*(a-s)>=0&&(e-o)*(i-s)-(n-o)*(t-s)>=0&&(n-o)*(a-s)-(r-o)*(i-s)>=0}function mo(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&yo(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&xo(e,t)&&xo(t,e)&&function(e,t){var n=e,i=!1,r=(e.x+t.x)/2,a=(e.y+t.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&r<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==e);return i}(e,t)}function go(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function vo(e,t){return e.x===t.x&&e.y===t.y}function yo(e,t,n,i){return!!(vo(e,t)&&vo(n,i)||vo(e,i)&&vo(n,t))||go(e,t,n)>0!=go(e,t,i)>0&&go(n,i,e)>0!=go(n,i,t)>0}function xo(e,t){return go(e.prev,e,e.next)<0?go(e,t,e.next)>=0&&go(e,e.prev,t)>=0:go(e,t,e.prev)<0||go(e,e.next,t)<0}function bo(e,t){var n=new Mo(e.i,e.x,e.y),i=new Mo(t.i,t.x,t.y),r=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,a.next=i,i.prev=a,i}function wo(e,t,n,i){var r=new Mo(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function _o(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Mo(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var So={area:function(e){for(var t=e.length,n=0,i=t-1,r=0;r<t;i=r++)n+=e[i].x*e[r].y-e[r].x*e[i].y;return.5*n},isClockWise:function(e){return So.area(e)<0},triangulateShape:function(e,t){var n=[],i=[],r=[];To(e),Eo(n,e);var a=e.length;t.forEach(To);for(var o=0;o<t.length;o++)i.push(a),a+=t[o].length,Eo(n,t[o]);var s=to(n,i);for(o=0;o<s.length;o+=3)r.push(s.slice(o,o+3));return r}};function To(e){var t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function Eo(e,t){for(var n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}function Ao(e,t){Dn.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},this.fromBufferGeometry(new Lo(e,t)),this.mergeVertices()}function Lo(e,t){Yn.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];for(var n=this,i=[],r=[],a=0,o=e.length;a<o;a++){s(e[a])}function s(e){var a=[],o=void 0!==t.curveSegments?t.curveSegments:12,s=void 0!==t.steps?t.steps:1,c=void 0!==t.depth?t.depth:100,l=void 0===t.bevelEnabled||t.bevelEnabled,h=void 0!==t.bevelThickness?t.bevelThickness:6,u=void 0!==t.bevelSize?t.bevelSize:h-2,p=void 0!==t.bevelSegments?t.bevelSegments:3,d=t.extrudePath,f=void 0!==t.UVGenerator?t.UVGenerator:Ro;void 0!==t.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),c=t.amount);var m,g,v,y,x,b,w,_,M=!1;d&&(m=d.getSpacedPoints(s),M=!0,l=!1,g=d.computeFrenetFrames(s,!1),v=new Dt,y=new Dt,x=new Dt),l||(p=0,h=0,u=0);var S=e.extractPoints(o),T=S.shape,E=S.holes;if(!So.isClockWise(T))for(T=T.reverse(),w=0,_=E.length;w<_;w++)b=E[w],So.isClockWise(b)&&(E[w]=b.reverse());var A=So.triangulateShape(T,E),L=T;for(w=0,_=E.length;w<_;w++)b=E[w],T=T.concat(b);function R(e,t,n){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(n).add(e)}var P,C,I,O,D,N,U=T.length,B=A.length;function F(e,t,n){var i,r,a,o=e.x-t.x,s=e.y-t.y,c=n.x-e.x,l=n.y-e.y,h=o*o+s*s,u=o*l-s*c;if(Math.abs(u)>Number.EPSILON){var p=Math.sqrt(h),d=Math.sqrt(c*c+l*l),f=t.x-s/p,m=t.y+o/p,g=((n.x-l/d-f)*l-(n.y+c/d-m)*c)/(o*l-s*c),v=(i=f+o*g-e.x)*i+(r=m+s*g-e.y)*r;if(v<=2)return new It(i,r);a=Math.sqrt(v/2)}else{var y=!1;o>Number.EPSILON?c>Number.EPSILON&&(y=!0):o<-Number.EPSILON?c<-Number.EPSILON&&(y=!0):Math.sign(s)===Math.sign(l)&&(y=!0),y?(i=-s,r=o,a=Math.sqrt(h)):(i=o,r=s,a=Math.sqrt(h/2))}return new It(i/a,r/a)}for(var z=[],G=0,H=L.length,V=H-1,k=G+1;G<H;G++,V++,k++)V===H&&(V=0),k===H&&(k=0),z[G]=F(L[G],L[V],L[k]);var j,W,q=[],X=z.concat();for(w=0,_=E.length;w<_;w++){for(b=E[w],j=[],G=0,V=(H=b.length)-1,k=G+1;G<H;G++,V++,k++)V===H&&(V=0),k===H&&(k=0),j[G]=F(b[G],b[V],b[k]);q.push(j),X=X.concat(j)}for(P=0;P<p;P++){for(I=P/p,O=h*Math.cos(I*Math.PI/2),C=u*Math.sin(I*Math.PI/2),G=0,H=L.length;G<H;G++)J((D=R(L[G],z[G],C)).x,D.y,-O);for(w=0,_=E.length;w<_;w++)for(b=E[w],j=q[w],G=0,H=b.length;G<H;G++)J((D=R(b[G],j[G],C)).x,D.y,-O)}for(C=u,G=0;G<U;G++)D=l?R(T[G],X[G],C):T[G],M?(y.copy(g.normals[0]).multiplyScalar(D.x),v.copy(g.binormals[0]).multiplyScalar(D.y),x.copy(m[0]).add(y).add(v),J(x.x,x.y,x.z)):J(D.x,D.y,0);for(W=1;W<=s;W++)for(G=0;G<U;G++)D=l?R(T[G],X[G],C):T[G],M?(y.copy(g.normals[W]).multiplyScalar(D.x),v.copy(g.binormals[W]).multiplyScalar(D.y),x.copy(m[W]).add(y).add(v),J(x.x,x.y,x.z)):J(D.x,D.y,c/s*W);for(P=p-1;P>=0;P--){for(I=P/p,O=h*Math.cos(I*Math.PI/2),C=u*Math.sin(I*Math.PI/2),G=0,H=L.length;G<H;G++)J((D=R(L[G],z[G],C)).x,D.y,c+O);for(w=0,_=E.length;w<_;w++)for(b=E[w],j=q[w],G=0,H=b.length;G<H;G++)D=R(b[G],j[G],C),M?J(D.x,D.y+m[s-1].y,m[s-1].x+O):J(D.x,D.y,c+O)}function Y(e,t){var n,i;for(G=e.length;--G>=0;){n=G,(i=G-1)<0&&(i=e.length-1);var r=0,a=s+2*p;for(r=0;r<a;r++){var o=U*r,c=U*(r+1);K(t+n+o,t+i+o,t+i+c,t+n+c)}}}function J(e,t,n){a.push(e),a.push(t),a.push(n)}function Z(e,t,r){Q(e),Q(t),Q(r);var a=i.length/3,o=f.generateTopUV(n,i,a-3,a-2,a-1);$(o[0]),$(o[1]),$(o[2])}function K(e,t,r,a){Q(e),Q(t),Q(a),Q(t),Q(r),Q(a);var o=i.length/3,s=f.generateSideWallUV(n,i,o-6,o-3,o-2,o-1);$(s[0]),$(s[1]),$(s[3]),$(s[1]),$(s[2]),$(s[3])}function Q(e){i.push(a[3*e+0]),i.push(a[3*e+1]),i.push(a[3*e+2])}function $(e){r.push(e.x),r.push(e.y)}!function(){var e=i.length/3;if(l){var t=0,r=U*t;for(G=0;G<B;G++)Z((N=A[G])[2]+r,N[1]+r,N[0]+r);for(r=U*(t=s+2*p),G=0;G<B;G++)Z((N=A[G])[0]+r,N[1]+r,N[2]+r)}else{for(G=0;G<B;G++)Z((N=A[G])[2],N[1],N[0]);for(G=0;G<B;G++)Z((N=A[G])[0]+U*s,N[1]+U*s,N[2]+U*s)}n.addGroup(e,i.length/3-e,0)}(),function(){var e=i.length/3,t=0;for(Y(L,t),t+=L.length,w=0,_=E.length;w<_;w++)Y(b=E[w],t),t+=b.length;n.addGroup(e,i.length/3-e,1)}()}this.addAttribute("position",new kn(i,3)),this.addAttribute("uv",new kn(r,2)),this.computeVertexNormals()}Ao.prototype=Object.create(Dn.prototype),Ao.prototype.constructor=Ao,Ao.prototype.toJSON=function(){var e=Dn.prototype.toJSON.call(this);return Po(this.parameters.shapes,this.parameters.options,e)},Lo.prototype=Object.create(Yn.prototype),Lo.prototype.constructor=Lo,Lo.prototype.toJSON=function(){var e=Yn.prototype.toJSON.call(this);return Po(this.parameters.shapes,this.parameters.options,e)};var Ro={generateTopUV:function(e,t,n,i,r){var a=t[3*n],o=t[3*n+1],s=t[3*i],c=t[3*i+1],l=t[3*r],h=t[3*r+1];return[new It(a,o),new It(s,c),new It(l,h)]},generateSideWallUV:function(e,t,n,i,r,a){var o=t[3*n],s=t[3*n+1],c=t[3*n+2],l=t[3*i],h=t[3*i+1],u=t[3*i+2],p=t[3*r],d=t[3*r+1],f=t[3*r+2],m=t[3*a],g=t[3*a+1],v=t[3*a+2];return Math.abs(s-h)<.01?[new It(o,1-c),new It(l,1-u),new It(p,1-f),new It(m,1-v)]:[new It(s,1-c),new It(h,1-u),new It(d,1-f),new It(g,1-v)]}};function Po(e,t,n){if(n.shapes=[],Array.isArray(e))for(var i=0,r=e.length;i<r;i++){var a=e[i];n.shapes.push(a.uuid)}else n.shapes.push(e.uuid);return void 0!==t.extrudePath&&(n.options.extrudePath=t.extrudePath.toJSON()),n}function Co(e,t){Dn.call(this),this.type="TextGeometry",this.parameters={text:e,parameters:t},this.fromBufferGeometry(new Io(e,t)),this.mergeVertices()}function Io(e,t){var n=(t=t||{}).font;if(!n||!n.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new Dn;var i=n.generateShapes(e,t.size);t.depth=void 0!==t.height?t.height:50,void 0===t.bevelThickness&&(t.bevelThickness=10),void 0===t.bevelSize&&(t.bevelSize=8),void 0===t.bevelEnabled&&(t.bevelEnabled=!1),Lo.call(this,i,t),this.type="TextBufferGeometry"}function Oo(e,t,n,i,r,a,o){Dn.call(this),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:i,phiLength:r,thetaStart:a,thetaLength:o},this.fromBufferGeometry(new Do(e,t,n,i,r,a,o)),this.mergeVertices()}function Do(e,t,n,i,r,a,o){Yn.call(this),this.type="SphereBufferGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:i,phiLength:r,thetaStart:a,thetaLength:o},e=e||1,t=Math.max(3,Math.floor(t)||8),n=Math.max(2,Math.floor(n)||6),i=void 0!==i?i:0,r=void 0!==r?r:2*Math.PI;var s,c,l=(a=void 0!==a?a:0)+(o=void 0!==o?o:Math.PI),h=0,u=[],p=new Dt,d=new Dt,f=[],m=[],g=[],v=[];for(c=0;c<=n;c++){var y=[],x=c/n,b=0==c?.5/t:c==n?-.5/t:0;for(s=0;s<=t;s++){var w=s/t;p.x=-e*Math.cos(i+w*r)*Math.sin(a+x*o),p.y=e*Math.cos(a+x*o),p.z=e*Math.sin(i+w*r)*Math.sin(a+x*o),m.push(p.x,p.y,p.z),d.copy(p).normalize(),g.push(d.x,d.y,d.z),v.push(w+b,1-x),y.push(h++)}u.push(y)}for(c=0;c<n;c++)for(s=0;s<t;s++){var _=u[c][s+1],M=u[c][s],S=u[c+1][s],T=u[c+1][s+1];(0!==c||a>0)&&f.push(_,M,T),(c!==n-1||l<Math.PI)&&f.push(M,S,T)}this.setIndex(f),this.addAttribute("position",new kn(m,3)),this.addAttribute("normal",new kn(g,3)),this.addAttribute("uv",new kn(v,2))}function No(e,t,n,i,r,a){Dn.call(this),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:i,thetaStart:r,thetaLength:a},this.fromBufferGeometry(new Uo(e,t,n,i,r,a)),this.mergeVertices()}function Uo(e,t,n,i,r,a){Yn.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:i,thetaStart:r,thetaLength:a},e=e||.5,t=t||1,r=void 0!==r?r:0,a=void 0!==a?a:2*Math.PI,n=void 0!==n?Math.max(3,n):8;var o,s,c,l=[],h=[],u=[],p=[],d=e,f=(t-e)/(i=void 0!==i?Math.max(1,i):1),m=new Dt,g=new It;for(s=0;s<=i;s++){for(c=0;c<=n;c++)o=r+c/n*a,m.x=d*Math.cos(o),m.y=d*Math.sin(o),h.push(m.x,m.y,m.z),u.push(0,0,1),g.x=(m.x/t+1)/2,g.y=(m.y/t+1)/2,p.push(g.x,g.y);d+=f}for(s=0;s<i;s++){var v=s*(n+1);for(c=0;c<n;c++){var y=o=c+v,x=o+n+1,b=o+n+2,w=o+1;l.push(y,x,w),l.push(x,b,w)}}this.setIndex(l),this.addAttribute("position",new kn(h,3)),this.addAttribute("normal",new kn(u,3)),this.addAttribute("uv",new kn(p,2))}function Bo(e,t,n,i){Dn.call(this),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:i},this.fromBufferGeometry(new Fo(e,t,n,i)),this.mergeVertices()}function Fo(e,t,n,i){Yn.call(this),this.type="LatheBufferGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:i},t=Math.floor(t)||12,n=n||0,i=i||2*Math.PI,i=Ct.clamp(i,0,2*Math.PI);var r,a,o,s=[],c=[],l=[],h=1/t,u=new Dt,p=new It;for(a=0;a<=t;a++){var d=n+a*h*i,f=Math.sin(d),m=Math.cos(d);for(o=0;o<=e.length-1;o++)u.x=e[o].x*f,u.y=e[o].y,u.z=e[o].x*m,c.push(u.x,u.y,u.z),p.x=a/t,p.y=o/(e.length-1),l.push(p.x,p.y)}for(a=0;a<t;a++)for(o=0;o<e.length-1;o++){var g=r=o+a*e.length,v=r+e.length,y=r+e.length+1,x=r+1;s.push(g,v,x),s.push(v,y,x)}if(this.setIndex(s),this.addAttribute("position",new kn(c,3)),this.addAttribute("uv",new kn(l,2)),this.computeVertexNormals(),i===2*Math.PI){var b=this.attributes.normal.array,w=new Dt,_=new Dt,M=new Dt;for(r=t*e.length*3,a=0,o=0;a<e.length;a++,o+=3)w.x=b[o+0],w.y=b[o+1],w.z=b[o+2],_.x=b[r+o+0],_.y=b[r+o+1],_.z=b[r+o+2],M.addVectors(w,_).normalize(),b[o+0]=b[r+o+0]=M.x,b[o+1]=b[r+o+1]=M.y,b[o+2]=b[r+o+2]=M.z}}function zo(e,t){Dn.call(this),this.type="ShapeGeometry","object"==typeof t&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),t=t.curveSegments),this.parameters={shapes:e,curveSegments:t},this.fromBufferGeometry(new Go(e,t)),this.mergeVertices()}function Go(e,t){Yn.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:e,curveSegments:t},t=t||12;var n=[],i=[],r=[],a=[],o=0,s=0;if(!1===Array.isArray(e))l(e);else for(var c=0;c<e.length;c++)l(e[c]),this.addGroup(o,s,c),o+=s,s=0;function l(e){var o,c,l,h=i.length/3,u=e.extractPoints(t),p=u.shape,d=u.holes;for(!1===So.isClockWise(p)&&(p=p.reverse()),o=0,c=d.length;o<c;o++)l=d[o],!0===So.isClockWise(l)&&(d[o]=l.reverse());var f=So.triangulateShape(p,d);for(o=0,c=d.length;o<c;o++)l=d[o],p=p.concat(l);for(o=0,c=p.length;o<c;o++){var m=p[o];i.push(m.x,m.y,0),r.push(0,0,1),a.push(m.x,m.y)}for(o=0,c=f.length;o<c;o++){var g=f[o],v=g[0]+h,y=g[1]+h,x=g[2]+h;n.push(v,y,x),s+=3}}this.setIndex(n),this.addAttribute("position",new kn(i,3)),this.addAttribute("normal",new kn(r,3)),this.addAttribute("uv",new kn(a,2))}function Ho(e,t){if(t.shapes=[],Array.isArray(e))for(var n=0,i=e.length;n<i;n++){var r=e[n];t.shapes.push(r.uuid)}else t.shapes.push(e.uuid);return t}function Vo(e,t){Yn.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:t},t=void 0!==t?t:1;var n,i,r,a,o=[],s=Math.cos(Ct.DEG2RAD*t),c=[0,0],l={},h=["a","b","c"];e.isBufferGeometry?(a=new Dn).fromBufferGeometry(e):a=e.clone(),a.mergeVertices(),a.computeFaceNormals();for(var u=a.vertices,p=a.faces,d=0,f=p.length;d<f;d++)for(var m=p[d],g=0;g<3;g++)n=m[h[g]],i=m[h[(g+1)%3]],c[0]=Math.min(n,i),c[1]=Math.max(n,i),void 0===l[r=c[0]+","+c[1]]?l[r]={index1:c[0],index2:c[1],face1:d,face2:void 0}:l[r].face2=d;for(r in l){var v=l[r];if(void 0===v.face2||p[v.face1].normal.dot(p[v.face2].normal)<=s){var y=u[v.index1];o.push(y.x,y.y,y.z),y=u[v.index2],o.push(y.x,y.y,y.z)}}this.addAttribute("position",new kn(o,3))}function ko(e,t,n,i,r,a,o,s){Dn.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:r,openEnded:a,thetaStart:o,thetaLength:s},this.fromBufferGeometry(new jo(e,t,n,i,r,a,o,s)),this.mergeVertices()}function jo(e,t,n,i,r,a,o,s){Yn.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:r,openEnded:a,thetaStart:o,thetaLength:s};var c=this;e=void 0!==e?e:1,t=void 0!==t?t:1,n=n||1,i=Math.floor(i)||8,r=Math.floor(r)||1,a=void 0!==a&&a,o=void 0!==o?o:0,s=void 0!==s?s:2*Math.PI;var l=[],h=[],u=[],p=[],d=0,f=[],m=n/2,g=0;function v(n){var r,a,f,v=new It,y=new Dt,x=0,b=!0===n?e:t,w=!0===n?1:-1;for(a=d,r=1;r<=i;r++)h.push(0,m*w,0),u.push(0,w,0),p.push(.5,.5),d++;for(f=d,r=0;r<=i;r++){var _=r/i*s+o,M=Math.cos(_),S=Math.sin(_);y.x=b*S,y.y=m*w,y.z=b*M,h.push(y.x,y.y,y.z),u.push(0,w,0),v.x=.5*M+.5,v.y=.5*S*w+.5,p.push(v.x,v.y),d++}for(r=0;r<i;r++){var T=a+r,E=f+r;!0===n?l.push(E,E+1,T):l.push(E+1,E,T),x+=3}c.addGroup(g,x,!0===n?1:2),g+=x}!function(){var a,v,y=new Dt,x=new Dt,b=0,w=(t-e)/n;for(v=0;v<=r;v++){var _=[],M=v/r,S=M*(t-e)+e;for(a=0;a<=i;a++){var T=a/i,E=T*s+o,A=Math.sin(E),L=Math.cos(E);x.x=S*A,x.y=-M*n+m,x.z=S*L,h.push(x.x,x.y,x.z),y.set(A,w,L).normalize(),u.push(y.x,y.y,y.z),p.push(T,1-M),_.push(d++)}f.push(_)}for(a=0;a<i;a++)for(v=0;v<r;v++){var R=f[v][a],P=f[v+1][a],C=f[v+1][a+1],I=f[v][a+1];l.push(R,P,I),l.push(P,C,I),b+=6}c.addGroup(g,b,0),g+=b}(),!1===a&&(e>0&&v(!0),t>0&&v(!1)),this.setIndex(l),this.addAttribute("position",new kn(h,3)),this.addAttribute("normal",new kn(u,3)),this.addAttribute("uv",new kn(p,2))}function Wo(e,t,n,i,r,a,o){ko.call(this,0,e,t,n,i,r,a,o),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:a,thetaLength:o}}function qo(e,t,n,i,r,a,o){jo.call(this,0,e,t,n,i,r,a,o),this.type="ConeBufferGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:a,thetaLength:o}}function Xo(e,t,n,i){Dn.call(this),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},this.fromBufferGeometry(new Yo(e,t,n,i)),this.mergeVertices()}function Yo(e,t,n,i){Yn.call(this),this.type="CircleBufferGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},e=e||1,t=void 0!==t?Math.max(3,t):8,n=void 0!==n?n:0,i=void 0!==i?i:2*Math.PI;var r,a,o=[],s=[],c=[],l=[],h=new Dt,u=new It;for(s.push(0,0,0),c.push(0,0,1),l.push(.5,.5),a=0,r=3;a<=t;a++,r+=3){var p=n+a/t*i;h.x=e*Math.cos(p),h.y=e*Math.sin(p),s.push(h.x,h.y,h.z),c.push(0,0,1),u.x=(s[r]/e+1)/2,u.y=(s[r+1]/e+1)/2,l.push(u.x,u.y)}for(r=1;r<=t;r++)o.push(r,r+1,0);this.setIndex(o),this.addAttribute("position",new kn(s,3)),this.addAttribute("normal",new kn(c,3)),this.addAttribute("uv",new kn(l,2))}Co.prototype=Object.create(Dn.prototype),Co.prototype.constructor=Co,Io.prototype=Object.create(Lo.prototype),Io.prototype.constructor=Io,Oo.prototype=Object.create(Dn.prototype),Oo.prototype.constructor=Oo,Do.prototype=Object.create(Yn.prototype),Do.prototype.constructor=Do,No.prototype=Object.create(Dn.prototype),No.prototype.constructor=No,Uo.prototype=Object.create(Yn.prototype),Uo.prototype.constructor=Uo,Bo.prototype=Object.create(Dn.prototype),Bo.prototype.constructor=Bo,Fo.prototype=Object.create(Yn.prototype),Fo.prototype.constructor=Fo,zo.prototype=Object.create(Dn.prototype),zo.prototype.constructor=zo,zo.prototype.toJSON=function(){var e=Dn.prototype.toJSON.call(this);return Ho(this.parameters.shapes,e)},Go.prototype=Object.create(Yn.prototype),Go.prototype.constructor=Go,Go.prototype.toJSON=function(){var e=Yn.prototype.toJSON.call(this);return Ho(this.parameters.shapes,e)},Vo.prototype=Object.create(Yn.prototype),Vo.prototype.constructor=Vo,ko.prototype=Object.create(Dn.prototype),ko.prototype.constructor=ko,jo.prototype=Object.create(Yn.prototype),jo.prototype.constructor=jo,Wo.prototype=Object.create(ko.prototype),Wo.prototype.constructor=Wo,qo.prototype=Object.create(jo.prototype),qo.prototype.constructor=qo,Xo.prototype=Object.create(Dn.prototype),Xo.prototype.constructor=Xo,Yo.prototype=Object.create(Yn.prototype),Yo.prototype.constructor=Yo;var Jo=Object.freeze({WireframeGeometry:Ua,ParametricGeometry:Ba,ParametricBufferGeometry:Fa,TetrahedronGeometry:Ha,TetrahedronBufferGeometry:Va,OctahedronGeometry:ka,OctahedronBufferGeometry:ja,IcosahedronGeometry:Wa,IcosahedronBufferGeometry:qa,DodecahedronGeometry:Xa,DodecahedronBufferGeometry:Ya,PolyhedronGeometry:za,PolyhedronBufferGeometry:Ga,TubeGeometry:Ja,TubeBufferGeometry:Za,TorusKnotGeometry:Ka,TorusKnotBufferGeometry:Qa,TorusGeometry:$a,TorusBufferGeometry:eo,TextGeometry:Co,TextBufferGeometry:Io,SphereGeometry:Oo,SphereBufferGeometry:Do,RingGeometry:No,RingBufferGeometry:Uo,PlaneGeometry:Kn,PlaneBufferGeometry:Qn,LatheGeometry:Bo,LatheBufferGeometry:Fo,ShapeGeometry:zo,ShapeBufferGeometry:Go,ExtrudeGeometry:Ao,ExtrudeBufferGeometry:Lo,EdgesGeometry:Vo,ConeGeometry:Wo,ConeBufferGeometry:qo,CylinderGeometry:ko,CylinderBufferGeometry:jo,CircleGeometry:Xo,CircleBufferGeometry:Yo,BoxGeometry:Jn,BoxBufferGeometry:Zn});function Zo(e){ei.call(this),this.type="ShadowMaterial",this.color=new gn(0),this.transparent=!0,this.setValues(e)}function Ko(e){mi.call(this,e),this.type="RawShaderMaterial"}function Qo(e){ei.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new gn(16777215),this.roughness=.5,this.metalness=.5,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new gn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Rt,this.normalScale=new It(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function $o(e){Qo.call(this),this.defines={PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearCoat=0,this.clearCoatRoughness=0,this.setValues(e)}function es(e){ei.call(this),this.type="MeshPhongMaterial",this.color=new gn(16777215),this.specular=new gn(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new gn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Rt,this.normalScale=new It(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=te,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function ts(e){es.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.gradientMap=null,this.setValues(e)}function ns(e){ei.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Rt,this.normalScale=new It(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function is(e){ei.call(this),this.type="MeshLambertMaterial",this.color=new gn(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new gn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=te,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function rs(e){ei.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new gn(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Rt,this.normalScale=new It(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.lights=!1,this.setValues(e)}function as(e){Ea.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}Zo.prototype=Object.create(ei.prototype),Zo.prototype.constructor=Zo,Zo.prototype.isShadowMaterial=!0,Zo.prototype.copy=function(e){return ei.prototype.copy.call(this,e),this.color.copy(e.color),this},Ko.prototype=Object.create(mi.prototype),Ko.prototype.constructor=Ko,Ko.prototype.isRawShaderMaterial=!0,Qo.prototype=Object.create(ei.prototype),Qo.prototype.constructor=Qo,Qo.prototype.isMeshStandardMaterial=!0,Qo.prototype.copy=function(e){return ei.prototype.copy.call(this,e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},$o.prototype=Object.create(Qo.prototype),$o.prototype.constructor=$o,$o.prototype.isMeshPhysicalMaterial=!0,$o.prototype.copy=function(e){return Qo.prototype.copy.call(this,e),this.defines={PHYSICAL:""},this.reflectivity=e.reflectivity,this.clearCoat=e.clearCoat,this.clearCoatRoughness=e.clearCoatRoughness,this},es.prototype=Object.create(ei.prototype),es.prototype.constructor=es,es.prototype.isMeshPhongMaterial=!0,es.prototype.copy=function(e){return ei.prototype.copy.call(this,e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},ts.prototype=Object.create(es.prototype),ts.prototype.constructor=ts,ts.prototype.isMeshToonMaterial=!0,ts.prototype.copy=function(e){return es.prototype.copy.call(this,e),this.gradientMap=e.gradientMap,this},ns.prototype=Object.create(ei.prototype),ns.prototype.constructor=ns,ns.prototype.isMeshNormalMaterial=!0,ns.prototype.copy=function(e){return ei.prototype.copy.call(this,e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},is.prototype=Object.create(ei.prototype),is.prototype.constructor=is,is.prototype.isMeshLambertMaterial=!0,is.prototype.copy=function(e){return ei.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},rs.prototype=Object.create(ei.prototype),rs.prototype.constructor=rs,rs.prototype.isMeshMatcapMaterial=!0,rs.prototype.copy=function(e){return ei.prototype.copy.call(this,e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},as.prototype=Object.create(Ea.prototype),as.prototype.constructor=as,as.prototype.isLineDashedMaterial=!0,as.prototype.copy=function(e){return Ea.prototype.copy.call(this,e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this};var os=Object.freeze({ShadowMaterial:Zo,SpriteMaterial:ba,RawShaderMaterial:Ko,ShaderMaterial:mi,PointsMaterial:Pa,MeshPhysicalMaterial:$o,MeshStandardMaterial:Qo,MeshPhongMaterial:es,MeshToonMaterial:ts,MeshNormalMaterial:ns,MeshLambertMaterial:is,MeshDepthMaterial:Xr,MeshDistanceMaterial:Yr,MeshBasicMaterial:yi,MeshMatcapMaterial:rs,LineDashedMaterial:as,LineBasicMaterial:Ea,Material:ei}),ss={arraySlice:function(e,t,n){return ss.isTypedArray(e)?new e.constructor(e.subarray(t,void 0!==n?n:e.length)):e.slice(t,n)},convertArray:function(e,t,n){return!e||!n&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)},isTypedArray:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},getKeyframeOrder:function(e){for(var t=e.length,n=new Array(t),i=0;i!==t;++i)n[i]=i;return n.sort(function(t,n){return e[t]-e[n]}),n},sortedArray:function(e,t,n){for(var i=e.length,r=new e.constructor(i),a=0,o=0;o!==i;++a)for(var s=n[a]*t,c=0;c!==t;++c)r[o++]=e[s+c];return r},flattenJSON:function(e,t,n,i){for(var r=1,a=e[0];void 0!==a&&void 0===a[i];)a=e[r++];if(void 0!==a){var o=a[i];if(void 0!==o)if(Array.isArray(o))do{void 0!==(o=a[i])&&(t.push(a.time),n.push.apply(n,o)),a=e[r++]}while(void 0!==a);else if(void 0!==o.toArray)do{void 0!==(o=a[i])&&(t.push(a.time),o.toArray(n,n.length)),a=e[r++]}while(void 0!==a);else do{void 0!==(o=a[i])&&(t.push(a.time),n.push(o)),a=e[r++]}while(void 0!==a)}}};function cs(e,t,n,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==i?i:new t.constructor(n),this.sampleValues=t,this.valueSize=n}function ls(e,t,n,i){cs.call(this,e,t,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function hs(e,t,n,i){cs.call(this,e,t,n,i)}function us(e,t,n,i){cs.call(this,e,t,n,i)}function ps(e,t,n,i){if(void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=ss.convertArray(t,this.TimeBufferType),this.values=ss.convertArray(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}function ds(e,t,n){ps.call(this,e,t,n)}function fs(e,t,n,i){ps.call(this,e,t,n,i)}function ms(e,t,n,i){ps.call(this,e,t,n,i)}function gs(e,t,n,i){cs.call(this,e,t,n,i)}function vs(e,t,n,i){ps.call(this,e,t,n,i)}function ys(e,t,n,i){ps.call(this,e,t,n,i)}function xs(e,t,n,i){ps.call(this,e,t,n,i)}function bs(e,t,n){this.name=e,this.tracks=n,this.duration=void 0!==t?t:-1,this.uuid=Ct.generateUUID(),this.duration<0&&this.resetDuration()}function ws(e){if(void 0===e.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return ms;case"vector":case"vector2":case"vector3":case"vector4":return xs;case"color":return fs;case"quaternion":return vs;case"bool":case"boolean":return ds;case"string":return ys}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(e.type);if(void 0===e.times){var n=[],i=[];ss.flattenJSON(e.keys,n,i,"value"),e.times=n,e.values=i}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}Object.assign(cs.prototype,{evaluate:function(e){var t=this.parameterPositions,n=this._cachedIndex,i=t[n],r=t[n-1];e:{t:{var a;n:{i:if(!(e<i)){for(var o=n+2;;){if(void 0===i){if(e<r)break i;return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,e,r)}if(n===o)break;if(r=i,e<(i=t[++n]))break t}a=t.length;break n}if(e>=r)break e;var s=t[1];e<s&&(n=2,r=s);for(o=n-2;;){if(void 0===r)return this._cachedIndex=0,this.beforeStart_(0,e,i);if(n===o)break;if(i=r,e>=(r=t[--n-1]))break t}a=n,n=0}for(;n<a;){var c=n+a>>>1;e<t[c]?a=c:n=c+1}if(i=t[n],void 0===(r=t[n-1]))return this._cachedIndex=0,this.beforeStart_(0,e,i);if(void 0===i)return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,r,e)}this._cachedIndex=n,this.intervalChanged_(n,r,i)}return this.interpolate_(n,r,e,i)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(e){for(var t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=e*i,a=0;a!==i;++a)t[a]=n[r+a];return t},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),
2//!\ DECLARE ALIAS AFTER assign prototype !
3Object.assign(cs.prototype,{beforeStart_:cs.prototype.copySampleValue_,afterEnd_:cs.prototype.copySampleValue_}),ls.prototype=Object.assign(Object.create(cs.prototype),{constructor:ls,DefaultSettings_:{endingStart:gt,endingEnd:gt},intervalChanged_:function(e,t,n){var i=this.parameterPositions,r=e-2,a=e+1,o=i[r],s=i[a];if(void 0===o)switch(this.getSettings_().endingStart){case 2401:r=e,o=2*t-n;break;case 2402:o=t+i[r=i.length-2]-i[r+1];break;default:r=e,o=n}if(void 0===s)switch(this.getSettings_().endingEnd){case 2401:a=e,s=2*n-t;break;case 2402:a=1,s=n+i[1]-i[0];break;default:a=e-1,s=t}var c=.5*(n-t),l=this.valueSize;this._weightPrev=c/(t-o),this._weightNext=c/(s-n),this._offsetPrev=r*l,this._offsetNext=a*l},interpolate_:function(e,t,n,i){for(var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=s-o,l=this._offsetPrev,h=this._offsetNext,u=this._weightPrev,p=this._weightNext,d=(n-t)/(i-t),f=d*d,m=f*d,g=-u*m+2*u*f-u*d,v=(1+u)*m+(-1.5-2*u)*f+(-.5+u)*d+1,y=(-1-p)*m+(1.5+p)*f+.5*d,x=p*m-p*f,b=0;b!==o;++b)r[b]=g*a[l+b]+v*a[c+b]+y*a[s+b]+x*a[h+b];return r}}),hs.prototype=Object.assign(Object.create(cs.prototype),{constructor:hs,interpolate_:function(e,t,n,i){for(var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=s-o,l=(n-t)/(i-t),h=1-l,u=0;u!==o;++u)r[u]=a[c+u]*h+a[s+u]*l;return r}}),us.prototype=Object.assign(Object.create(cs.prototype),{constructor:us,interpolate_:function(e){return this.copySampleValue_(e-1)}}),Object.assign(ps,{toJSON:function(e){var t,n=e.constructor;if(void 0!==n.toJSON)t=n.toJSON(e);else{t={name:e.name,times:ss.convertArray(e.times,Array),values:ss.convertArray(e.values,Array)};var i=e.getInterpolation();i!==e.DefaultInterpolation&&(t.interpolation=i)}return t.type=e.ValueTypeName,t}}),Object.assign(ps.prototype,{constructor:ps,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:2301,InterpolantFactoryMethodDiscrete:function(e){return new us(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodLinear:function(e){return new hs(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:function(e){return new ls(this.times,this.values,this.getValueSize(),e)},setInterpolation:function(e){var t;switch(e){case 2300:t=this.InterpolantFactoryMethodDiscrete;break;case 2301:t=this.InterpolantFactoryMethodLinear;break;case 2302:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){var n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=t,this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}},getValueSize:function(){return this.values.length/this.times.length},shift:function(e){if(0!==e)for(var t=this.times,n=0,i=t.length;n!==i;++n)t[n]+=e;return this},scale:function(e){if(1!==e)for(var t=this.times,n=0,i=t.length;n!==i;++n)t[n]*=e;return this},trim:function(e,t){for(var n=this.times,i=n.length,r=0,a=i-1;r!==i&&n[r]<e;)++r;for(;-1!==a&&n[a]>t;)--a;if(++a,0!==r||a!==i){r>=a&&(r=(a=Math.max(a,1))-1);var o=this.getValueSize();this.times=ss.arraySlice(n,r,a),this.values=ss.arraySlice(this.values,r*o,a*o)}return this},validate:function(){var e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);var n=this.times,i=this.values,r=n.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);for(var a=null,o=0;o!==r;o++){var s=n[o];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,s),e=!1;break}if(null!==a&&a>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,s,a),e=!1;break}a=s}if(void 0!==i&&ss.isTypedArray(i)){o=0;for(var c=i.length;o!==c;++o){var l=i[o];if(isNaN(l)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,l),e=!1;break}}}return e},optimize:function(){for(var e=this.times,t=this.values,n=this.getValueSize(),i=2302===this.getInterpolation(),r=1,a=e.length-1,o=1;o<a;++o){var s=!1,c=e[o];if(c!==e[o+1]&&(1!==o||c!==c[0]))if(i)s=!0;else for(var l=o*n,h=l-n,u=l+n,p=0;p!==n;++p){var d=t[l+p];if(d!==t[h+p]||d!==t[u+p]){s=!0;break}}if(s){if(o!==r){e[r]=e[o];var f=o*n,m=r*n;for(p=0;p!==n;++p)t[m+p]=t[f+p]}++r}}if(a>0){e[r]=e[a];for(f=a*n,m=r*n,p=0;p!==n;++p)t[m+p]=t[f+p];++r}return r!==e.length&&(this.times=ss.arraySlice(e,0,r),this.values=ss.arraySlice(t,0,r*n)),this},clone:function(){var e=ss.arraySlice(this.times,0),t=ss.arraySlice(this.values,0),n=new(0,this.constructor)(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}),ds.prototype=Object.assign(Object.create(ps.prototype),{constructor:ds,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),fs.prototype=Object.assign(Object.create(ps.prototype),{constructor:fs,ValueTypeName:"color"}),ms.prototype=Object.assign(Object.create(ps.prototype),{constructor:ms,ValueTypeName:"number"}),gs.prototype=Object.assign(Object.create(cs.prototype),{constructor:gs,interpolate_:function(e,t,n,i){for(var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=(n-t)/(i-t),l=s+o;s!==l;s+=4)Ot.slerpFlat(r,0,a,s-o,a,s,c);return r}}),vs.prototype=Object.assign(Object.create(ps.prototype),{constructor:vs,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(e){return new gs(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),ys.prototype=Object.assign(Object.create(ps.prototype),{constructor:ys,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),xs.prototype=Object.assign(Object.create(ps.prototype),{constructor:xs,ValueTypeName:"vector"}),Object.assign(bs,{parse:function(e){for(var t=[],n=e.tracks,i=1/(e.fps||1),r=0,a=n.length;r!==a;++r)t.push(ws(n[r]).scale(i));return new bs(e.name,e.duration,t)},toJSON:function(e){for(var t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid},r=0,a=n.length;r!==a;++r)t.push(ps.toJSON(n[r]));return i},CreateFromMorphTargetSequence:function(e,t,n,i){for(var r=t.length,a=[],o=0;o<r;o++){var s=[],c=[];s.push((o+r-1)%r,o,(o+1)%r),c.push(0,1,0);var l=ss.getKeyframeOrder(s);s=ss.sortedArray(s,1,l),c=ss.sortedArray(c,1,l),i||0!==s[0]||(s.push(r),c.push(c[0])),a.push(new ms(".morphTargetInfluences["+t[o].name+"]",s,c).scale(1/n))}return new bs(e,-1,a)},findByName:function(e,t){var n=e;if(!Array.isArray(e)){var i=e;n=i.geometry&&i.geometry.animations||i.animations}for(var r=0;r<n.length;r++)if(n[r].name===t)return n[r];return null},CreateClipsFromMorphTargetSequences:function(e,t,n){for(var i={},r=/^([\w-]*?)([\d]+)$/,a=0,o=e.length;a<o;a++){var s=e[a],c=s.name.match(r);if(c&&c.length>1){var l=i[u=c[1]];l||(i[u]=l=[]),l.push(s)}}var h=[];for(var u in i)h.push(bs.CreateFromMorphTargetSequence(u,i[u],t,n));return h},parseAnimation:function(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(e,t,n,i,r){if(0!==n.length){var a=[],o=[];ss.flattenJSON(n,a,o,i),0!==a.length&&r.push(new e(t,a,o))}},i=[],r=e.name||"default",a=e.length||-1,o=e.fps||30,s=e.hierarchy||[],c=0;c<s.length;c++){var l=s[c].keys;if(l&&0!==l.length)if(l[0].morphTargets){for(var h={},u=0;u<l.length;u++)if(l[u].morphTargets)for(var p=0;p<l[u].morphTargets.length;p++)h[l[u].morphTargets[p]]=-1;for(var d in h){var f=[],m=[];for(p=0;p!==l[u].morphTargets.length;++p){var g=l[u];f.push(g.time),m.push(g.morphTarget===d?1:0)}i.push(new ms(".morphTargetInfluence["+d+"]",f,m))}a=h.length*(o||1)}else{var v=".bones["+t[c].name+"]";n(xs,v+".position",l,"pos",i),n(vs,v+".quaternion",l,"rot",i),n(xs,v+".scale",l,"scl",i)}}return 0===i.length?null:new bs(r,a,i)}}),Object.assign(bs.prototype,{resetDuration:function(){for(var e=0,t=0,n=this.tracks.length;t!==n;++t){var i=this.tracks[t];e=Math.max(e,i.times[i.times.length-1])}return this.duration=e,this},trim:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this},validate:function(){for(var e=!0,t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e},optimize:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this},clone:function(){for(var e=[],t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new bs(this.name,this.duration,e)}});var _s={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};function Ms(e,t,n){var i=this,r=!1,a=0,o=0,s=void 0;this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){o++,!1===r&&void 0!==i.onStart&&i.onStart(e,a,o),r=!0},this.itemEnd=function(e){a++,void 0!==i.onProgress&&i.onProgress(e,a,o),a===o&&(r=!1,void 0!==i.onLoad&&i.onLoad())},this.itemError=function(e){void 0!==i.onError&&i.onError(e)},this.resolveURL=function(e){return s?s(e):e},this.setURLModifier=function(e){return s=e,this}}var Ss=new Ms,Ts={};function Es(e){this.manager=void 0!==e?e:Ss}function As(e){this.manager=void 0!==e?e:Ss,this._parser=null}function Ls(e){this.manager=void 0!==e?e:Ss}function Rs(e){this.manager=void 0!==e?e:Ss}function Ps(e){this.manager=void 0!==e?e:Ss}function Cs(){this.type="Curve",this.arcLengthDivisions=200}function Is(e,t,n,i,r,a,o,s){Cs.call(this),this.type="EllipseCurve",this.aX=e||0,this.aY=t||0,this.xRadius=n||1,this.yRadius=i||1,this.aStartAngle=r||0,this.aEndAngle=a||2*Math.PI,this.aClockwise=o||!1,this.aRotation=s||0}function Os(e,t,n,i,r,a){Is.call(this,e,t,n,n,i,r,a),this.type="ArcCurve"}function Ds(){var e=0,t=0,n=0,i=0;function r(r,a,o,s){e=r,t=o,n=-3*r+3*a-2*o-s,i=2*r-2*a+o+s}return{initCatmullRom:function(e,t,n,i,a){r(t,n,a*(n-e),a*(i-t))},initNonuniformCatmullRom:function(e,t,n,i,a,o,s){var c=(t-e)/a-(n-e)/(a+o)+(n-t)/o,l=(n-t)/o-(i-t)/(o+s)+(i-n)/s;r(t,n,c*=o,l*=o)},calc:function(r){var a=r*r;return e+t*r+n*a+i*(a*r)}}}Object.assign(Es.prototype,{load:function(e,t,n,i){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var r=this,a=_s.get(e);if(void 0!==a)return r.manager.itemStart(e),setTimeout(function(){t&&t(a),r.manager.itemEnd(e)},0),a;if(void 0===Ts[e]){var o=e.match(/^data:(.*?)(;base64)?,(.*)$/);if(o){var s=o[1],c=!!o[2],l=o[3];l=decodeURIComponent(l),c&&(l=atob(l));try{var h,u=(this.responseType||"").toLowerCase();switch(u){case"arraybuffer":case"blob":for(var p=new Uint8Array(l.length),d=0;d<l.length;d++)p[d]=l.charCodeAt(d);h="blob"===u?new Blob([p.buffer],{type:s}):p.buffer;break;case"document":var f=new DOMParser;h=f.parseFromString(l,s);break;case"json":h=JSON.parse(l);break;default:h=l}setTimeout(function(){t&&t(h),r.manager.itemEnd(e)},0)}catch(t){setTimeout(function(){i&&i(t),r.manager.itemError(e),r.manager.itemEnd(e)},0)}}else{Ts[e]=[],Ts[e].push({onLoad:t,onProgress:n,onError:i});var m=new XMLHttpRequest;for(var g in m.open("GET",e,!0),m.addEventListener("load",function(t){var n=this.response;_s.add(e,n);var i=Ts[e];if(delete Ts[e],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received.");for(var a=0,o=i.length;a<o;a++){(s=i[a]).onLoad&&s.onLoad(n)}r.manager.itemEnd(e)}else{for(a=0,o=i.length;a<o;a++){var s;(s=i[a]).onError&&s.onError(t)}r.manager.itemError(e),r.manager.itemEnd(e)}},!1),m.addEventListener("progress",function(t){for(var n=Ts[e],i=0,r=n.length;i<r;i++){var a=n[i];a.onProgress&&a.onProgress(t)}},!1),m.addEventListener("error",function(t){var n=Ts[e];delete Ts[e];for(var i=0,a=n.length;i<a;i++){var o=n[i];o.onError&&o.onError(t)}r.manager.itemError(e),r.manager.itemEnd(e)},!1),m.addEventListener("abort",function(t){var n=Ts[e];delete Ts[e];for(var i=0,a=n.length;i<a;i++){var o=n[i];o.onError&&o.onError(t)}r.manager.itemError(e),r.manager.itemEnd(e)},!1),void 0!==this.responseType&&(m.responseType=this.responseType),void 0!==this.withCredentials&&(m.withCredentials=this.withCredentials),m.overrideMimeType&&m.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)m.setRequestHeader(g,this.requestHeader[g]);m.send(null)}return r.manager.itemStart(e),m}Ts[e].push({onLoad:t,onProgress:n,onError:i})},setPath:function(e){return this.path=e,this},setResponseType:function(e){return this.responseType=e,this},setWithCredentials:function(e){return this.withCredentials=e,this},setMimeType:function(e){return this.mimeType=e,this},setRequestHeader:function(e){return this.requestHeader=e,this}}),Object.assign(function(e){this.manager=void 0!==e?e:Ss}.prototype,{load:function(e,t,n,i){var r=this,a=new Es(r.manager);a.setPath(r.path),a.load(e,function(e){t(r.parse(JSON.parse(e)))},n,i)},parse:function(e){for(var t=[],n=0;n<e.length;n++){var i=bs.parse(e[n]);t.push(i)}return t},setPath:function(e){return this.path=e,this}}),Object.assign(function(e){this.manager=void 0!==e?e:Ss,this._parser=null}.prototype,{load:function(e,t,n,i){var r=this,a=[],o=new Oa;o.image=a;var s=new Es(this.manager);function c(c){s.load(e[c],function(e){var n=r._parser(e,!0);a[c]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},6===(l+=1)&&(1===n.mipmapCount&&(o.minFilter=Me),o.format=n.format,o.needsUpdate=!0,t&&t(o))},n,i)}if(s.setPath(this.path),s.setResponseType("arraybuffer"),Array.isArray(e))for(var l=0,h=0,u=e.length;h<u;++h)c(h);else s.load(e,function(e){var n=r._parser(e,!0);if(n.isCubemap)for(var i=n.mipmaps.length/n.mipmapCount,s=0;s<i;s++){a[s]={mipmaps:[]};for(var c=0;c<n.mipmapCount;c++)a[s].mipmaps.push(n.mipmaps[s*n.mipmapCount+c]),a[s].format=n.format,a[s].width=n.width,a[s].height=n.height}else o.image.width=n.width,o.image.height=n.height,o.mipmaps=n.mipmaps;1===n.mipmapCount&&(o.minFilter=Me),o.format=n.format,o.needsUpdate=!0,t&&t(o)},n,i);return o},setPath:function(e){return this.path=e,this}}),Object.assign(As.prototype,{load:function(e,t,n,i){var r=this,a=new tn,o=new Es(this.manager);return o.setResponseType("arraybuffer"),o.setPath(this.path),o.load(e,function(e){var n=r._parser(e);n&&(void 0!==n.image?a.image=n.image:void 0!==n.data&&(a.image.width=n.width,a.image.height=n.height,a.image.data=n.data),a.wrapS=void 0!==n.wrapS?n.wrapS:ye,a.wrapT=void 0!==n.wrapT?n.wrapT:ye,a.magFilter=void 0!==n.magFilter?n.magFilter:Me,a.minFilter=void 0!==n.minFilter?n.minFilter:Te,a.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.format&&(a.format=n.format),void 0!==n.type&&(a.type=n.type),void 0!==n.mipmaps&&(a.mipmaps=n.mipmaps),1===n.mipmapCount&&(a.minFilter=Me),a.needsUpdate=!0,t&&t(a,n))},n,i),a},setPath:function(e){return this.path=e,this}}),Object.assign(Ls.prototype,{crossOrigin:"anonymous",load:function(e,t,n,i){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var r=this,a=_s.get(e);if(void 0!==a)return r.manager.itemStart(e),setTimeout(function(){t&&t(a),r.manager.itemEnd(e)},0),a;var o=document.createElementNS("http://www.w3.org/1999/xhtml","img");function s(){o.removeEventListener("load",s,!1),o.removeEventListener("error",c,!1),_s.add(e,this),t&&t(this),r.manager.itemEnd(e)}function c(t){o.removeEventListener("load",s,!1),o.removeEventListener("error",c,!1),i&&i(t),r.manager.itemError(e),r.manager.itemEnd(e)}return o.addEventListener("load",s,!1),o.addEventListener("error",c,!1),"data:"!==e.substr(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),r.manager.itemStart(e),o.src=e,o},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this}}),Object.assign(Rs.prototype,{crossOrigin:"anonymous",load:function(e,t,n,i){var r=new Ci,a=new Ls(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);var o=0;function s(n){a.load(e[n],function(e){r.images[n]=e,6===++o&&(r.needsUpdate=!0,t&&t(r))},void 0,i)}for(var c=0;c<e.length;++c)s(c);return r},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this}}),Object.assign(Ps.prototype,{crossOrigin:"anonymous",load:function(e,t,n,i){var r=new Zt,a=new Ls(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(n){r.image=n;var i=e.search(/\.jpe?g($|\?)/i)>0||0===e.search(/^data\:image\/jpeg/);r.format=i?ze:Ge,r.needsUpdate=!0,void 0!==t&&t(r)},n,i),r},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this}}),Object.assign(Cs.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e,t){var n=this.getUtoTmapping(e);return this.getPoint(n,t)},getPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return t},getSpacedPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t},getLength:function(){var e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(void 0===e&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,n,i=[],r=this.getPoint(0),a=0;for(i.push(0),n=1;n<=e;n++)a+=(t=this.getPoint(n/e)).distanceTo(r),i.push(a),r=t;return this.cacheArcLengths=i,i},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var n,i=this.getLengths(),r=0,a=i.length;n=t||e*i[a-1];for(var o,s=0,c=a-1;s<=c;)if((o=i[r=Math.floor(s+(c-s)/2)]-n)<0)s=r+1;else{if(!(o>0)){c=r;break}c=r-1}if(i[r=c]===n)return r/(a-1);var l=i[r];return(r+(n-l)/(i[r+1]-l))/(a-1)},getTangent:function(e){var t=e-1e-4,n=e+1e-4;t<0&&(t=0),n>1&&(n=1);var i=this.getPoint(t);return this.getPoint(n).clone().sub(i).normalize()},getTangentAt:function(e){var t=this.getUtoTmapping(e);return this.getTangent(t)},computeFrenetFrames:function(e,t){var n,i,r,a=new Dt,o=[],s=[],c=[],l=new Dt,h=new sn;for(n=0;n<=e;n++)i=n/e,o[n]=this.getTangentAt(i),o[n].normalize();s[0]=new Dt,c[0]=new Dt;var u=Number.MAX_VALUE,p=Math.abs(o[0].x),d=Math.abs(o[0].y),f=Math.abs(o[0].z);for(p<=u&&(u=p,a.set(1,0,0)),d<=u&&(u=d,a.set(0,1,0)),f<=u&&a.set(0,0,1),l.crossVectors(o[0],a).normalize(),s[0].crossVectors(o[0],l),c[0].crossVectors(o[0],s[0]),n=1;n<=e;n++)s[n]=s[n-1].clone(),c[n]=c[n-1].clone(),l.crossVectors(o[n-1],o[n]),l.length()>Number.EPSILON&&(l.normalize(),r=Math.acos(Ct.clamp(o[n-1].dot(o[n]),-1,1)),s[n].applyMatrix4(h.makeRotationAxis(l,r))),c[n].crossVectors(o[n],s[n]);if(!0===t)for(r=Math.acos(Ct.clamp(s[0].dot(s[e]),-1,1)),r/=e,o[0].dot(l.crossVectors(s[0],s[e]))>0&&(r=-r),n=1;n<=e;n++)s[n].applyMatrix4(h.makeRotationAxis(o[n],r*n)),c[n].crossVectors(o[n],s[n]);return{tangents:o,normals:s,binormals:c}},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this},toJSON:function(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e},fromJSON:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}),Is.prototype=Object.create(Cs.prototype),Is.prototype.constructor=Is,Is.prototype.isEllipseCurve=!0,Is.prototype.getPoint=function(e,t){for(var n=t||new It,i=2*Math.PI,r=this.aEndAngle-this.aStartAngle,a=Math.abs(r)<Number.EPSILON;r<0;)r+=i;for(;r>i;)r-=i;r<Number.EPSILON&&(r=a?0:i),!0!==this.aClockwise||a||(r===i?r=-i:r-=i);var o=this.aStartAngle+e*r,s=this.aX+this.xRadius*Math.cos(o),c=this.aY+this.yRadius*Math.sin(o);if(0!==this.aRotation){var l=Math.cos(this.aRotation),h=Math.sin(this.aRotation),u=s-this.aX,p=c-this.aY;s=u*l-p*h+this.aX,c=u*h+p*l+this.aY}return n.set(s,c)},Is.prototype.copy=function(e){return Cs.prototype.copy.call(this,e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this},Is.prototype.toJSON=function(){var e=Cs.prototype.toJSON.call(this);return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e},Is.prototype.fromJSON=function(e){return Cs.prototype.fromJSON.call(this,e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this},Os.prototype=Object.create(Is.prototype),Os.prototype.constructor=Os,Os.prototype.isArcCurve=!0;var Ns=new Dt,Us=new Ds,Bs=new Ds,Fs=new Ds;function zs(e,t,n,i){Cs.call(this),this.type="CatmullRomCurve3",this.points=e||[],this.closed=t||!1,this.curveType=n||"centripetal",this.tension=i||.5}function Gs(e,t,n,i,r){var a=.5*(i-t),o=.5*(r-n),s=e*e;return(2*n-2*i+a+o)*(e*s)+(-3*n+3*i-2*a-o)*s+a*e+n}function Hs(e,t,n,i){return function(e,t){var n=1-e;return n*n*t}(e,t)+function(e,t){return 2*(1-e)*e*t}(e,n)+function(e,t){return e*e*t}(e,i)}function Vs(e,t,n,i,r){return function(e,t){var n=1-e;return n*n*n*t}(e,t)+function(e,t){var n=1-e;return 3*n*n*e*t}(e,n)+function(e,t){return 3*(1-e)*e*e*t}(e,i)+function(e,t){return e*e*e*t}(e,r)}function ks(e,t,n,i){Cs.call(this),this.type="CubicBezierCurve",this.v0=e||new It,this.v1=t||new It,this.v2=n||new It,this.v3=i||new It}function js(e,t,n,i){Cs.call(this),this.type="CubicBezierCurve3",this.v0=e||new Dt,this.v1=t||new Dt,this.v2=n||new Dt,this.v3=i||new Dt}function Ws(e,t){Cs.call(this),this.type="LineCurve",this.v1=e||new It,this.v2=t||new It}function qs(e,t){Cs.call(this),this.type="LineCurve3",this.v1=e||new Dt,this.v2=t||new Dt}function Xs(e,t,n){Cs.call(this),this.type="QuadraticBezierCurve",this.v0=e||new It,this.v1=t||new It,this.v2=n||new It}function Ys(e,t,n){Cs.call(this),this.type="QuadraticBezierCurve3",this.v0=e||new Dt,this.v1=t||new Dt,this.v2=n||new Dt}function Js(e){Cs.call(this),this.type="SplineCurve",this.points=e||[]}zs.prototype=Object.create(Cs.prototype),zs.prototype.constructor=zs,zs.prototype.isCatmullRomCurve3=!0,zs.prototype.getPoint=function(e,t){var n,i,r,a,o=t||new Dt,s=this.points,c=s.length,l=(c-(this.closed?0:1))*e,h=Math.floor(l),u=l-h;if(this.closed?h+=h>0?0:(Math.floor(Math.abs(h)/c)+1)*c:0===u&&h===c-1&&(h=c-2,u=1),this.closed||h>0?n=s[(h-1)%c]:(Ns.subVectors(s[0],s[1]).add(s[0]),n=Ns),i=s[h%c],r=s[(h+1)%c],this.closed||h+2<c?a=s[(h+2)%c]:(Ns.subVectors(s[c-1],s[c-2]).add(s[c-1]),a=Ns),"centripetal"===this.curveType||"chordal"===this.curveType){var p="chordal"===this.curveType?.5:.25,d=Math.pow(n.distanceToSquared(i),p),f=Math.pow(i.distanceToSquared(r),p),m=Math.pow(r.distanceToSquared(a),p);f<1e-4&&(f=1),d<1e-4&&(d=f),m<1e-4&&(m=f),Us.initNonuniformCatmullRom(n.x,i.x,r.x,a.x,d,f,m),Bs.initNonuniformCatmullRom(n.y,i.y,r.y,a.y,d,f,m),Fs.initNonuniformCatmullRom(n.z,i.z,r.z,a.z,d,f,m)}else"catmullrom"===this.curveType&&(Us.initCatmullRom(n.x,i.x,r.x,a.x,this.tension),Bs.initCatmullRom(n.y,i.y,r.y,a.y,this.tension),Fs.initCatmullRom(n.z,i.z,r.z,a.z,this.tension));return o.set(Us.calc(u),Bs.calc(u),Fs.calc(u)),o},zs.prototype.copy=function(e){Cs.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var i=e.points[t];this.points.push(i.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},zs.prototype.toJSON=function(){var e=Cs.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var i=this.points[t];e.points.push(i.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e},zs.prototype.fromJSON=function(e){Cs.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var i=e.points[t];this.points.push((new Dt).fromArray(i))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},ks.prototype=Object.create(Cs.prototype),ks.prototype.constructor=ks,ks.prototype.isCubicBezierCurve=!0,ks.prototype.getPoint=function(e,t){var n=t||new It,i=this.v0,r=this.v1,a=this.v2,o=this.v3;return n.set(Vs(e,i.x,r.x,a.x,o.x),Vs(e,i.y,r.y,a.y,o.y)),n},ks.prototype.copy=function(e){return Cs.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},ks.prototype.toJSON=function(){var e=Cs.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},ks.prototype.fromJSON=function(e){return Cs.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},js.prototype=Object.create(Cs.prototype),js.prototype.constructor=js,js.prototype.isCubicBezierCurve3=!0,js.prototype.getPoint=function(e,t){var n=t||new Dt,i=this.v0,r=this.v1,a=this.v2,o=this.v3;return n.set(Vs(e,i.x,r.x,a.x,o.x),Vs(e,i.y,r.y,a.y,o.y),Vs(e,i.z,r.z,a.z,o.z)),n},js.prototype.copy=function(e){return Cs.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},js.prototype.toJSON=function(){var e=Cs.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},js.prototype.fromJSON=function(e){return Cs.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},Ws.prototype=Object.create(Cs.prototype),Ws.prototype.constructor=Ws,Ws.prototype.isLineCurve=!0,Ws.prototype.getPoint=function(e,t){var n=t||new It;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},Ws.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},Ws.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()},Ws.prototype.copy=function(e){return Cs.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Ws.prototype.toJSON=function(){var e=Cs.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Ws.prototype.fromJSON=function(e){return Cs.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},qs.prototype=Object.create(Cs.prototype),qs.prototype.constructor=qs,qs.prototype.isLineCurve3=!0,qs.prototype.getPoint=function(e,t){var n=t||new Dt;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},qs.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},qs.prototype.copy=function(e){return Cs.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},qs.prototype.toJSON=function(){var e=Cs.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},qs.prototype.fromJSON=function(e){return Cs.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Xs.prototype=Object.create(Cs.prototype),Xs.prototype.constructor=Xs,Xs.prototype.isQuadraticBezierCurve=!0,Xs.prototype.getPoint=function(e,t){var n=t||new It,i=this.v0,r=this.v1,a=this.v2;return n.set(Hs(e,i.x,r.x,a.x),Hs(e,i.y,r.y,a.y)),n},Xs.prototype.copy=function(e){return Cs.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Xs.prototype.toJSON=function(){var e=Cs.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Xs.prototype.fromJSON=function(e){return Cs.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Ys.prototype=Object.create(Cs.prototype),Ys.prototype.constructor=Ys,Ys.prototype.isQuadraticBezierCurve3=!0,Ys.prototype.getPoint=function(e,t){var n=t||new Dt,i=this.v0,r=this.v1,a=this.v2;return n.set(Hs(e,i.x,r.x,a.x),Hs(e,i.y,r.y,a.y),Hs(e,i.z,r.z,a.z)),n},Ys.prototype.copy=function(e){return Cs.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Ys.prototype.toJSON=function(){var e=Cs.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Ys.prototype.fromJSON=function(e){return Cs.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Js.prototype=Object.create(Cs.prototype),Js.prototype.constructor=Js,Js.prototype.isSplineCurve=!0,Js.prototype.getPoint=function(e,t){var n=t||new It,i=this.points,r=(i.length-1)*e,a=Math.floor(r),o=r-a,s=i[0===a?a:a-1],c=i[a],l=i[a>i.length-2?i.length-1:a+1],h=i[a>i.length-3?i.length-1:a+2];return n.set(Gs(o,s.x,c.x,l.x,h.x),Gs(o,s.y,c.y,l.y,h.y)),n},Js.prototype.copy=function(e){Cs.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var i=e.points[t];this.points.push(i.clone())}return this},Js.prototype.toJSON=function(){var e=Cs.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var i=this.points[t];e.points.push(i.toArray())}return e},Js.prototype.fromJSON=function(e){Cs.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var i=e.points[t];this.points.push((new It).fromArray(i))}return this};var Zs=Object.freeze({ArcCurve:Os,CatmullRomCurve3:zs,CubicBezierCurve:ks,CubicBezierCurve3:js,EllipseCurve:Is,LineCurve:Ws,LineCurve3:qs,QuadraticBezierCurve:Xs,QuadraticBezierCurve3:Ys,SplineCurve:Js});function Ks(){Cs.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function Qs(e){Ks.call(this),this.type="Path",this.currentPoint=new It,e&&this.setFromPoints(e)}function $s(e){Qs.call(this,e),this.uuid=Ct.generateUUID(),this.type="Shape",this.holes=[]}function ec(e,t){Pn.call(this),this.type="Light",this.color=new gn(e),this.intensity=void 0!==t?t:1,this.receiveShadow=void 0}function tc(e,t,n){ec.call(this,e,n),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(Pn.DefaultUp),this.updateMatrix(),this.groundColor=new gn(t)}function nc(e){this.camera=e,this.bias=0,this.radius=1,this.mapSize=new It(512,512),this.map=null,this.matrix=new sn}function ic(){nc.call(this,new ta(50,1,.5,500))}function rc(e,t,n,i,r,a){ec.call(this,e,t),this.type="SpotLight",this.position.copy(Pn.DefaultUp),this.updateMatrix(),this.target=new Pn,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(e){this.intensity=e/Math.PI}}),this.distance=void 0!==n?n:0,this.angle=void 0!==i?i:Math.PI/3,this.penumbra=void 0!==r?r:0,this.decay=void 0!==a?a:1,this.shadow=new ic}function ac(e,t,n,i){ec.call(this,e,t),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(e){this.intensity=e/(4*Math.PI)}}),this.distance=void 0!==n?n:0,this.decay=void 0!==i?i:1,this.shadow=new nc(new ta(90,1,.5,500))}function oc(e,t,n,i,r,a){ea.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=void 0!==e?e:-1,this.right=void 0!==t?t:1,this.top=void 0!==n?n:1,this.bottom=void 0!==i?i:-1,this.near=void 0!==r?r:.1,this.far=void 0!==a?a:2e3,this.updateProjectionMatrix()}function sc(){nc.call(this,new oc(-5,5,5,-5,.5,500))}function cc(e,t){ec.call(this,e,t),this.type="DirectionalLight",this.position.copy(Pn.DefaultUp),this.updateMatrix(),this.target=new Pn,this.shadow=new sc}function lc(e,t){ec.call(this,e,t),this.type="AmbientLight",this.castShadow=void 0}function hc(e,t,n,i){ec.call(this,e,t),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==i?i:10}function uc(e){this.manager=void 0!==e?e:Ss,this.textures={}}Ks.prototype=Object.assign(Object.create(Cs.prototype),{constructor:Ks,add:function(e){this.curves.push(e)},closePath:function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new Ws(t,e))},getPoint:function(e){for(var t=e*this.getLength(),n=this.getCurveLengths(),i=0;i<n.length;){if(n[i]>=t){var r=n[i]-t,a=this.curves[i],o=a.getLength(),s=0===o?0:1-r/o;return a.getPointAt(s)}i++}return null},getLength:function(){var e=this.getCurveLengths();return e[e.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,n=0,i=this.curves.length;n<i;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e},getSpacedPoints:function(e){void 0===e&&(e=40);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t},getPoints:function(e){e=e||12;for(var t,n=[],i=0,r=this.curves;i<r.length;i++)for(var a=r[i],o=a&&a.isEllipseCurve?2*e:a&&(a.isLineCurve||a.isLineCurve3)?1:a&&a.isSplineCurve?e*a.points.length:e,s=a.getPoints(o),c=0;c<s.length;c++){var l=s[c];t&&t.equals(l)||(n.push(l),t=l)}return this.autoClose&&n.length>1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(e){Cs.prototype.copy.call(this,e),this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var i=e.curves[t];this.curves.push(i.clone())}return this.autoClose=e.autoClose,this},toJSON:function(){var e=Cs.prototype.toJSON.call(this);e.autoClose=this.autoClose,e.curves=[];for(var t=0,n=this.curves.length;t<n;t++){var i=this.curves[t];e.curves.push(i.toJSON())}return e},fromJSON:function(e){Cs.prototype.fromJSON.call(this,e),this.autoClose=e.autoClose,this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var i=e.curves[t];this.curves.push((new Zs[i.type]).fromJSON(i))}return this}}),Qs.prototype=Object.assign(Object.create(Ks.prototype),{constructor:Qs,setFromPoints:function(e){this.moveTo(e[0].x,e[0].y);for(var t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y)},moveTo:function(e,t){this.currentPoint.set(e,t)},lineTo:function(e,t){var n=new Ws(this.currentPoint.clone(),new It(e,t));this.curves.push(n),this.currentPoint.set(e,t)},quadraticCurveTo:function(e,t,n,i){var r=new Xs(this.currentPoint.clone(),new It(e,t),new It(n,i));this.curves.push(r),this.currentPoint.set(n,i)},bezierCurveTo:function(e,t,n,i,r,a){var o=new ks(this.currentPoint.clone(),new It(e,t),new It(n,i),new It(r,a));this.curves.push(o),this.currentPoint.set(r,a)},splineThru:function(e){var t=new Js([this.currentPoint.clone()].concat(e));this.curves.push(t),this.currentPoint.copy(e[e.length-1])},arc:function(e,t,n,i,r,a){var o=this.currentPoint.x,s=this.currentPoint.y;this.absarc(e+o,t+s,n,i,r,a)},absarc:function(e,t,n,i,r,a){this.absellipse(e,t,n,n,i,r,a)},ellipse:function(e,t,n,i,r,a,o,s){var c=this.currentPoint.x,l=this.currentPoint.y;this.absellipse(e+c,t+l,n,i,r,a,o,s)},absellipse:function(e,t,n,i,r,a,o,s){var c=new Is(e,t,n,i,r,a,o,s);if(this.curves.length>0){var l=c.getPoint(0);l.equals(this.currentPoint)||this.lineTo(l.x,l.y)}this.curves.push(c);var h=c.getPoint(1);this.currentPoint.copy(h)},copy:function(e){return Ks.prototype.copy.call(this,e),this.currentPoint.copy(e.currentPoint),this},toJSON:function(){var e=Ks.prototype.toJSON.call(this);return e.currentPoint=this.currentPoint.toArray(),e},fromJSON:function(e){return Ks.prototype.fromJSON.call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}),$s.prototype=Object.assign(Object.create(Qs.prototype),{constructor:$s,getPointsHoles:function(e){for(var t=[],n=0,i=this.holes.length;n<i;n++)t[n]=this.holes[n].getPoints(e);return t},extractPoints:function(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}},copy:function(e){Qs.prototype.copy.call(this,e),this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var i=e.holes[t];this.holes.push(i.clone())}return this},toJSON:function(){var e=Qs.prototype.toJSON.call(this);e.uuid=this.uuid,e.holes=[];for(var t=0,n=this.holes.length;t<n;t++){var i=this.holes[t];e.holes.push(i.toJSON())}return e},fromJSON:function(e){Qs.prototype.fromJSON.call(this,e),this.uuid=e.uuid,this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var i=e.holes[t];this.holes.push((new Qs).fromJSON(i))}return this}}),ec.prototype=Object.assign(Object.create(Pn.prototype),{constructor:ec,isLight:!0,copy:function(e){return Pn.prototype.copy.call(this,e),this.color.copy(e.color),this.intensity=e.intensity,this},toJSON:function(e){var t=Pn.prototype.toJSON.call(this,e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}),tc.prototype=Object.assign(Object.create(ec.prototype),{constructor:tc,isHemisphereLight:!0,copy:function(e){return ec.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}),Object.assign(nc.prototype,{copy:function(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var e={};return 0!==this.bias&&(e.bias=this.bias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}),ic.prototype=Object.assign(Object.create(nc.prototype),{constructor:ic,isSpotLightShadow:!0,update:function(e){var t=this.camera,n=2*Ct.RAD2DEG*e.angle,i=this.mapSize.width/this.mapSize.height,r=e.distance||t.far;n===t.fov&&i===t.aspect&&r===t.far||(t.fov=n,t.aspect=i,t.far=r,t.updateProjectionMatrix())}}),rc.prototype=Object.assign(Object.create(ec.prototype),{constructor:rc,isSpotLight:!0,copy:function(e){return ec.prototype.copy.call(this,e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),ac.prototype=Object.assign(Object.create(ec.prototype),{constructor:ac,isPointLight:!0,copy:function(e){return ec.prototype.copy.call(this,e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}),oc.prototype=Object.assign(Object.create(ea.prototype),{constructor:oc,isOrthographicCamera:!0,copy:function(e,t){return ea.prototype.copy.call(this,e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this},setViewOffset:function(e,t,n,i,r,a){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,r=n-e,a=n+e,o=i+t,s=i-t;if(null!==this.view&&this.view.enabled){var c=this.zoom/(this.view.width/this.view.fullWidth),l=this.zoom/(this.view.height/this.view.fullHeight),h=(this.right-this.left)/this.view.width,u=(this.top-this.bottom)/this.view.height;a=(r+=h*(this.view.offsetX/c))+h*(this.view.width/c),s=(o-=u*(this.view.offsetY/l))-u*(this.view.height/l)}this.projectionMatrix.makeOrthographic(r,a,o,s,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){var t=Pn.prototype.toJSON.call(this,e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}),sc.prototype=Object.assign(Object.create(nc.prototype),{constructor:sc}),cc.prototype=Object.assign(Object.create(ec.prototype),{constructor:cc,isDirectionalLight:!0,copy:function(e){return ec.prototype.copy.call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),lc.prototype=Object.assign(Object.create(ec.prototype),{constructor:lc,isAmbientLight:!0}),hc.prototype=Object.assign(Object.create(ec.prototype),{constructor:hc,isRectAreaLight:!0,copy:function(e){return ec.prototype.copy.call(this,e),this.width=e.width,this.height=e.height,this},toJSON:function(e){var t=ec.prototype.toJSON.call(this,e);return t.object.width=this.width,t.object.height=this.height,t}}),Object.assign(uc.prototype,{load:function(e,t,n,i){var r=this,a=new Es(r.manager);a.setPath(r.path),a.load(e,function(e){t(r.parse(JSON.parse(e)))},n,i)},parse:function(e){var t=this.textures;function n(e){return void 0===t[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),t[e]}var i=new os[e.type];if(void 0!==e.uuid&&(i.uuid=e.uuid),void 0!==e.name&&(i.name=e.name),void 0!==e.color&&i.color.setHex(e.color),void 0!==e.roughness&&(i.roughness=e.roughness),void 0!==e.metalness&&(i.metalness=e.metalness),void 0!==e.emissive&&i.emissive.setHex(e.emissive),void 0!==e.specular&&i.specular.setHex(e.specular),void 0!==e.shininess&&(i.shininess=e.shininess),void 0!==e.clearCoat&&(i.clearCoat=e.clearCoat),void 0!==e.clearCoatRoughness&&(i.clearCoatRoughness=e.clearCoatRoughness),void 0!==e.vertexColors&&(i.vertexColors=e.vertexColors),void 0!==e.fog&&(i.fog=e.fog),void 0!==e.flatShading&&(i.flatShading=e.flatShading),void 0!==e.blending&&(i.blending=e.blending),void 0!==e.combine&&(i.combine=e.combine),void 0!==e.side&&(i.side=e.side),void 0!==e.opacity&&(i.opacity=e.opacity),void 0!==e.transparent&&(i.transparent=e.transparent),void 0!==e.alphaTest&&(i.alphaTest=e.alphaTest),void 0!==e.depthTest&&(i.depthTest=e.depthTest),void 0!==e.depthWrite&&(i.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(i.colorWrite=e.colorWrite),void 0!==e.wireframe&&(i.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(i.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(i.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(i.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(i.rotation=e.rotation),1!==e.linewidth&&(i.linewidth=e.linewidth),void 0!==e.dashSize&&(i.dashSize=e.dashSize),void 0!==e.gapSize&&(i.gapSize=e.gapSize),void 0!==e.scale&&(i.scale=e.scale),void 0!==e.polygonOffset&&(i.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(i.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(i.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.skinning&&(i.skinning=e.skinning),void 0!==e.morphTargets&&(i.morphTargets=e.morphTargets),void 0!==e.dithering&&(i.dithering=e.dithering),void 0!==e.visible&&(i.visible=e.visible),void 0!==e.userData&&(i.userData=e.userData),void 0!==e.uniforms)for(var r in e.uniforms){var a=e.uniforms[r];switch(i.uniforms[r]={},a.type){case"t":i.uniforms[r].value=n(a.value);break;case"c":i.uniforms[r].value=(new gn).setHex(a.value);break;case"v2":i.uniforms[r].value=(new It).fromArray(a.value);break;case"v3":i.uniforms[r].value=(new Dt).fromArray(a.value);break;case"v4":i.uniforms[r].value=(new Kt).fromArray(a.value);break;case"m3":i.uniforms[r].value=(new Nt).fromArray(a.value);case"m4":i.uniforms[r].value=(new sn).fromArray(a.value);break;default:i.uniforms[r].value=a.value}}if(void 0!==e.defines&&(i.defines=e.defines),void 0!==e.vertexShader&&(i.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(i.fragmentShader=e.fragmentShader),void 0!==e.extensions)for(var o in e.extensions)i.extensions[o]=e.extensions[o];if(void 0!==e.shading&&(i.flatShading=1===e.shading),void 0!==e.size&&(i.size=e.size),void 0!==e.sizeAttenuation&&(i.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(i.map=n(e.map)),void 0!==e.alphaMap&&(i.alphaMap=n(e.alphaMap),i.transparent=!0),void 0!==e.bumpMap&&(i.bumpMap=n(e.bumpMap)),void 0!==e.bumpScale&&(i.bumpScale=e.bumpScale),void 0!==e.normalMap&&(i.normalMap=n(e.normalMap)),void 0!==e.normalMapType&&(i.normalMapType=e.normalMapType),void 0!==e.normalScale){var s=e.normalScale;!1===Array.isArray(s)&&(s=[s,s]),i.normalScale=(new It).fromArray(s)}return void 0!==e.displacementMap&&(i.displacementMap=n(e.displacementMap)),void 0!==e.displacementScale&&(i.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(i.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(i.roughnessMap=n(e.roughnessMap)),void 0!==e.metalnessMap&&(i.metalnessMap=n(e.metalnessMap)),void 0!==e.emissiveMap&&(i.emissiveMap=n(e.emissiveMap)),void 0!==e.emissiveIntensity&&(i.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(i.specularMap=n(e.specularMap)),void 0!==e.envMap&&(i.envMap=n(e.envMap)),void 0!==e.envMapIntensity&&(i.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(i.reflectivity=e.reflectivity),void 0!==e.lightMap&&(i.lightMap=n(e.lightMap)),void 0!==e.lightMapIntensity&&(i.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(i.aoMap=n(e.aoMap)),void 0!==e.aoMapIntensity&&(i.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(i.gradientMap=n(e.gradientMap)),i},setPath:function(e){return this.path=e,this},setTextures:function(e){return this.textures=e,this}});var pc={decodeText:function(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var t="",n=0,i=e.length;n<i;n++)t+=String.fromCharCode(e[n]);return decodeURIComponent(escape(t))},extractUrlBase:function(e){var t=e.lastIndexOf("/");return-1===t?"./":e.substr(0,t+1)}};function dc(e){this.manager=void 0!==e?e:Ss}Object.assign(dc.prototype,{load:function(e,t,n,i){var r=this,a=new Es(r.manager);a.setPath(r.path),a.load(e,function(e){t(r.parse(JSON.parse(e)))},n,i)},parse:function(e){var t=new Yn,n=e.data.index;if(void 0!==n){var i=new fc[n.type](n.array);t.setIndex(new Nn(i,1))}var r=e.data.attributes;for(var a in r){var o=r[a],s=new Nn(i=new fc[o.type](o.array),o.itemSize,o.normalized);void 0!==o.name&&(s.name=o.name),t.addAttribute(a,s)}var c=e.data.morphAttributes;if(c)for(var a in c){for(var l=c[a],h=[],u=0,p=l.length;u<p;u++){o=l[u],s=new Nn(i=new fc[o.type](o.array),o.itemSize,o.normalized);void 0!==o.name&&(s.name=o.name),h.push(s)}t.morphAttributes[a]=h}var d=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==d){u=0;for(var f=d.length;u!==f;++u){var m=d[u];t.addGroup(m.start,m.count,m.materialIndex)}}var g=e.data.boundingSphere;if(void 0!==g){var v=new Dt;void 0!==g.center&&v.fromArray(g.center),t.boundingSphere=new rn(v,g.radius)}return e.name&&(t.name=e.name),e.userData&&(t.userData=e.userData),t},setPath:function(e){return this.path=e,this}});var fc={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function mc(e){this.manager=void 0!==e?e:Ss,this.resourcePath=""}Object.assign(mc.prototype,{crossOrigin:"anonymous",load:function(e,t,n,i){var r=this,a=void 0===this.path?pc.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||a;var o=new Es(r.manager);o.setPath(this.path),o.load(e,function(n){var a=null;try{a=JSON.parse(n)}catch(t){return void 0!==i&&i(t),void console.error("THREE:ObjectLoader: Can't parse "+e+".",t.message)}var o=a.metadata;void 0!==o&&void 0!==o.type&&"geometry"!==o.type.toLowerCase()?r.parse(a,t):console.error("THREE.ObjectLoader: Can't load "+e)},n,i)},setPath:function(e){return this.path=e,this},setResourcePath:function(e){return this.resourcePath=e,this},setCrossOrigin:function(e){return this.crossOrigin=e,this},parse:function(e,t){var n=this.parseShape(e.shapes),i=this.parseGeometries(e.geometries,n),r=this.parseImages(e.images,function(){void 0!==t&&t(s)}),a=this.parseTextures(e.textures,r),o=this.parseMaterials(e.materials,a),s=this.parseObject(e.object,i,o);return e.animations&&(s.animations=this.parseAnimations(e.animations)),void 0!==e.images&&0!==e.images.length||void 0!==t&&t(s),s},parseShape:function(e){var t={};if(void 0!==e)for(var n=0,i=e.length;n<i;n++){var r=(new $s).fromJSON(e[n]);t[r.uuid]=r}return t},parseGeometries:function(e,t){var n={};if(void 0!==e)for(var i=new dc,r=0,a=e.length;r<a;r++){var o,s=e[r];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":o=new Jo[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":o=new Jo[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":o=new Jo[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":o=new Jo[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":o=new Jo[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":o=new Jo[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":o=new Jo[s.type](s.radius,s.detail);break;case"RingGeometry":case"RingBufferGeometry":o=new Jo[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":o=new Jo[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":o=new Jo[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case"TubeGeometry":case"TubeBufferGeometry":o=new Jo[s.type]((new Zs[s.path.type]).fromJSON(s.path),s.tubularSegments,s.radius,s.radialSegments,s.closed);break;case"LatheGeometry":case"LatheBufferGeometry":o=new Jo[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":o=new Jo[s.type](s.vertices,s.indices,s.radius,s.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":for(var c=[],l=0,h=s.shapes.length;l<h;l++){var u=t[s.shapes[l]];c.push(u)}o=new Jo[s.type](c,s.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":for(c=[],l=0,h=s.shapes.length;l<h;l++){u=t[s.shapes[l]];c.push(u)}var p=s.options.extrudePath;void 0!==p&&(s.options.extrudePath=(new Zs[p.type]).fromJSON(p)),o=new Jo[s.type](c,s.options);break;case"BufferGeometry":o=i.parse(s);break;case"Geometry":if("THREE"in window&&"LegacyJSONLoader"in THREE)o=(new THREE.LegacyJSONLoader).parse(s,this.resourcePath).geometry;else console.error('THREE.ObjectLoader: You have to import LegacyJSONLoader in order load geometry data of type "Geometry".');break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+s.type+'"');continue}o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),!0===o.isBufferGeometry&&void 0!==s.userData&&(o.userData=s.userData),n[s.uuid]=o}return n},parseMaterials:function(e,t){var n={},i={};if(void 0!==e){var r=new uc;r.setTextures(t);for(var a=0,o=e.length;a<o;a++){var s=e[a];if("MultiMaterial"===s.type){for(var c=[],l=0;l<s.materials.length;l++){var h=s.materials[l];void 0===n[h.uuid]&&(n[h.uuid]=r.parse(h)),c.push(n[h.uuid])}i[s.uuid]=c}else void 0===n[s.uuid]&&(n[s.uuid]=r.parse(s)),i[s.uuid]=n[s.uuid]}}return i},parseAnimations:function(e){for(var t=[],n=0;n<e.length;n++){var i=e[n],r=bs.parse(i);void 0!==i.uuid&&(r.uuid=i.uuid),t.push(r)}return t},parseImages:function(e,t){var n=this,i={};function r(e){return n.manager.itemStart(e),a.load(e,function(){n.manager.itemEnd(e)},void 0,function(){n.manager.itemError(e),n.manager.itemEnd(e)})}if(void 0!==e&&e.length>0){var a=new Ls(new Ms(t));a.setCrossOrigin(this.crossOrigin);for(var o=0,s=e.length;o<s;o++){var c=e[o],l=c.url;if(Array.isArray(l)){i[c.uuid]=[];for(var h=0,u=l.length;h<u;h++){var p=l[h],d=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(p)?p:n.resourcePath+p;i[c.uuid].push(r(d))}}else{d=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url)?c.url:n.resourcePath+c.url;i[c.uuid]=r(d)}}}return i},parseTextures:function(e,t){function n(e,t){return"number"==typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),t[e])}var i={};if(void 0!==e)for(var r=0,a=e.length;r<a;r++){var o,s=e[r];void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===t[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image),(o=Array.isArray(t[s.image])?new Ci(t[s.image]):new Zt(t[s.image])).needsUpdate=!0,o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),void 0!==s.mapping&&(o.mapping=n(s.mapping,wc)),void 0!==s.offset&&o.offset.fromArray(s.offset),void 0!==s.repeat&&o.repeat.fromArray(s.repeat),void 0!==s.center&&o.center.fromArray(s.center),void 0!==s.rotation&&(o.rotation=s.rotation),void 0!==s.wrap&&(o.wrapS=n(s.wrap[0],_c),o.wrapT=n(s.wrap[1],_c)),void 0!==s.format&&(o.format=s.format),void 0!==s.type&&(o.type=s.type),void 0!==s.encoding&&(o.encoding=s.encoding),void 0!==s.minFilter&&(o.minFilter=n(s.minFilter,Mc)),void 0!==s.magFilter&&(o.magFilter=n(s.magFilter,Mc)),void 0!==s.anisotropy&&(o.anisotropy=s.anisotropy),void 0!==s.flipY&&(o.flipY=s.flipY),void 0!==s.premultiplyAlpha&&(o.premultiplyAlpha=s.premultiplyAlpha),void 0!==s.unpackAlignment&&(o.unpackAlignment=s.unpackAlignment),i[s.uuid]=o}return i},parseObject:function(e,t,n){var i;function r(e){return void 0===t[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),t[e]}function a(e){if(void 0!==e){if(Array.isArray(e)){for(var t=[],i=0,r=e.length;i<r;i++){var a=e[i];void 0===n[a]&&console.warn("THREE.ObjectLoader: Undefined material",a),t.push(n[a])}return t}return void 0===n[e]&&console.warn("THREE.ObjectLoader: Undefined material",e),n[e]}}switch(e.type){case"Scene":i=new va,void 0!==e.background&&Number.isInteger(e.background)&&(i.background=new gn(e.background)),void 0!==e.fog&&("Fog"===e.fog.type?i.fog=new ga(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(i.fog=new ma(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":i=new ta(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(i.focus=e.focus),void 0!==e.zoom&&(i.zoom=e.zoom),void 0!==e.filmGauge&&(i.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(i.filmOffset=e.filmOffset),void 0!==e.view&&(i.view=Object.assign({},e.view));break;case"OrthographicCamera":i=new oc(e.left,e.right,e.top,e.bottom,e.near,e.far),void 0!==e.zoom&&(i.zoom=e.zoom),void 0!==e.view&&(i.view=Object.assign({},e.view));break;case"AmbientLight":i=new lc(e.color,e.intensity);break;case"DirectionalLight":i=new cc(e.color,e.intensity);break;case"PointLight":i=new ac(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":i=new hc(e.color,e.intensity,e.width,e.height);break;case"SpotLight":i=new rc(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":i=new tc(e.color,e.groundColor,e.intensity);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":var o=r(e.geometry),s=a(e.material);i=o.bones&&o.bones.length>0?new Ma(o,s):new xi(o,s),void 0!==e.drawMode&&i.setDrawMode(e.drawMode);break;case"LOD":i=new _a;break;case"Line":i=new Aa(r(e.geometry),a(e.material),e.mode);break;case"LineLoop":i=new Ra(r(e.geometry),a(e.material));break;case"LineSegments":i=new La(r(e.geometry),a(e.material));break;case"PointCloud":case"Points":i=new Ca(r(e.geometry),a(e.material));break;case"Sprite":i=new wa(a(e.material));break;case"Group":i=new $r;break;default:i=new Pn}if(i.uuid=e.uuid,void 0!==e.name&&(i.name=e.name),void 0!==e.matrix?(i.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(i.matrixAutoUpdate=e.matrixAutoUpdate),i.matrixAutoUpdate&&i.matrix.decompose(i.position,i.quaternion,i.scale)):(void 0!==e.position&&i.position.fromArray(e.position),void 0!==e.rotation&&i.rotation.fromArray(e.rotation),void 0!==e.quaternion&&i.quaternion.fromArray(e.quaternion),void 0!==e.scale&&i.scale.fromArray(e.scale)),void 0!==e.castShadow&&(i.castShadow=e.castShadow),void 0!==e.receiveShadow&&(i.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(i.shadow.bias=e.shadow.bias),void 0!==e.shadow.radius&&(i.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&i.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(i.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(i.visible=e.visible),void 0!==e.frustumCulled&&(i.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(i.renderOrder=e.renderOrder),void 0!==e.userData&&(i.userData=e.userData),void 0!==e.layers&&(i.layers.mask=e.layers),void 0!==e.children)for(var c=e.children,l=0;l<c.length;l++)i.add(this.parseObject(c[l],t,n));if("LOD"===e.type)for(var h=e.levels,u=0;u<h.length;u++){var p=h[u],d=i.getObjectByProperty("uuid",p.object);void 0!==d&&i.addLevel(d,p.distance)}return i}});var gc,vc,yc,xc,bc,wc={UVMapping:300,CubeReflectionMapping:he,CubeRefractionMapping:ue,EquirectangularReflectionMapping:pe,EquirectangularRefractionMapping:de,SphericalReflectionMapping:fe,CubeUVReflectionMapping:me,CubeUVRefractionMapping:ge},_c={RepeatWrapping:ve,ClampToEdgeWrapping:ye,MirroredRepeatWrapping:xe},Mc={NearestFilter:be,NearestMipMapNearestFilter:we,NearestMipMapLinearFilter:_e,LinearFilter:Me,LinearMipMapNearestFilter:Se,LinearMipMapLinearFilter:Te};function Sc(e){"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.manager=void 0!==e?e:Ss,this.options=void 0}function Tc(){this.type="ShapePath",this.color=new gn,this.subPaths=[],this.currentPath=null}function Ec(e){this.type="Font",this.data=e}function Ac(e,t,n,i,r){var a=r.glyphs[e]||r.glyphs["?"];if(a){var o,s,c,l,h,u,p,d,f=new Tc;if(a.o)for(var m=a._cachedOutline||(a._cachedOutline=a.o.split(" ")),g=0,v=m.length;g<v;){switch(m[g++]){case"m":o=m[g++]*t+n,s=m[g++]*t+i,f.moveTo(o,s);break;case"l":o=m[g++]*t+n,s=m[g++]*t+i,f.lineTo(o,s);break;case"q":c=m[g++]*t+n,l=m[g++]*t+i,h=m[g++]*t+n,u=m[g++]*t+i,f.quadraticCurveTo(h,u,c,l);break;case"b":c=m[g++]*t+n,l=m[g++]*t+i,h=m[g++]*t+n,u=m[g++]*t+i,p=m[g++]*t+n,d=m[g++]*t+i,f.bezierCurveTo(h,u,p,d,c,l)}}return{offsetX:a.ha*t,path:f}}}function Lc(){}Sc.prototype={constructor:Sc,setOptions:function(e){return this.options=e,this},load:function(e,t,n,i){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var r=this,a=_s.get(e);if(void 0!==a)return r.manager.itemStart(e),setTimeout(function(){t&&t(a),r.manager.itemEnd(e)},0),a;fetch(e).then(function(e){return e.blob()}).then(function(e){return void 0===r.options?createImageBitmap(e):createImageBitmap(e,r.options)}).then(function(n){_s.add(e,n),t&&t(n),r.manager.itemEnd(e)}).catch(function(t){i&&i(t),r.manager.itemError(e),r.manager.itemEnd(e)}),r.manager.itemStart(e)},setCrossOrigin:function(){return this},setPath:function(e){return this.path=e,this}},Object.assign(Tc.prototype,{moveTo:function(e,t){this.currentPath=new Qs,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t)},lineTo:function(e,t){this.currentPath.lineTo(e,t)},quadraticCurveTo:function(e,t,n,i){this.currentPath.quadraticCurveTo(e,t,n,i)},bezierCurveTo:function(e,t,n,i,r,a){this.currentPath.bezierCurveTo(e,t,n,i,r,a)},splineThru:function(e){this.currentPath.splineThru(e)},toShapes:function(e,t){function n(e){for(var t=[],n=0,i=e.length;n<i;n++){var r=e[n],a=new $s;a.curves=r.curves,t.push(a)}return t}function i(e,t){for(var n=t.length,i=!1,r=n-1,a=0;a<n;r=a++){var o=t[r],s=t[a],c=s.x-o.x,l=s.y-o.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(o=t[a],c=-c,s=t[r],l=-l),e.y<o.y||e.y>s.y)continue;if(e.y===o.y){if(e.x===o.x)return!0}else{var h=l*(e.x-o.x)-c*(e.y-o.y);if(0===h)return!0;if(h<0)continue;i=!i}}else{if(e.y!==o.y)continue;if(s.x<=e.x&&e.x<=o.x||o.x<=e.x&&e.x<=s.x)return!0}}return i}var r=So.isClockWise,a=this.subPaths;if(0===a.length)return[];if(!0===t)return n(a);var o,s,c,l=[];if(1===a.length)return s=a[0],(c=new $s).curves=s.curves,l.push(c),l;var h=!r(a[0].getPoints());h=e?!h:h;var u,p,d=[],f=[],m=[],g=0;f[g]=void 0,m[g]=[];for(var v=0,y=a.length;v<y;v++)o=r(u=(s=a[v]).getPoints()),(o=e?!o:o)?(!h&&f[g]&&g++,f[g]={s:new $s,p:u},f[g].s.curves=s.curves,h&&g++,m[g]=[]):m[g].push({h:s,p:u[0]});if(!f[0])return n(a);if(f.length>1){for(var x=!1,b=[],w=0,_=f.length;w<_;w++)d[w]=[];for(w=0,_=f.length;w<_;w++)for(var M=m[w],S=0;S<M.length;S++){for(var T=M[S],E=!0,A=0;A<f.length;A++)i(T.p,f[A].p)&&(w!==A&&b.push({froms:w,tos:A,hole:S}),E?(E=!1,d[A].push(T)):x=!0);E&&d[w].push(T)}b.length>0&&(x||(m=d))}v=0;for(var L=f.length;v<L;v++){c=f[v].s,l.push(c);for(var R=0,P=(p=m[v]).length;R<P;R++)c.holes.push(p[R].h)}return l}}),Object.assign(Ec.prototype,{isFont:!0,generateShapes:function(e,t){void 0===t&&(t=100);for(var n=[],i=function(e,t,n){for(var i=Array.from?Array.from(e):String(e).split(""),r=t/n.resolution,a=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*r,o=[],s=0,c=0,l=0;l<i.length;l++){var h=i[l];if("\n"===h)s=0,c-=a;else{var u=Ac(h,r,s,c,n);s+=u.offsetX,o.push(u.path)}}return o}(e,t,this.data),r=0,a=i.length;r<a;r++)Array.prototype.push.apply(n,i[r].toShapes());return n}}),Object.assign(function(e){this.manager=void 0!==e?e:Ss}.prototype,{load:function(e,t,n,i){var r=this,a=new Es(this.manager);a.setPath(this.path),a.load(e,function(e){var n;try{n=JSON.parse(e)}catch(t){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(e.substring(65,e.length-2))}var i=r.parse(n);t&&t(i)},n,i)},parse:function(e){return new Ec(e)},setPath:function(e){return this.path=e,this}}),Lc.Handlers={handlers:[],add:function(e,t){this.handlers.push(e,t)},get:function(e){for(var t=this.handlers,n=0,i=t.length;n<i;n+=2){var r=t[n],a=t[n+1];if(r.test(e))return a}return null}},Object.assign(Lc.prototype,{crossOrigin:"anonymous",onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(e,t,n){for(var i=[],r=0;r<e.length;++r)i[r]=this.createMaterial(e[r],t,n);return i},createMaterial:(gc={NoBlending:T,NormalBlending:E,AdditiveBlending:A,SubtractiveBlending:L,MultiplyBlending:R,CustomBlending:P},vc=new gn,yc=new Ps,xc=new uc,function(e,t,n){var i={};function r(e,r,a,o,s){var c,l=t+e,h=Lc.Handlers.get(l);null!==h?c=h.load(l):(yc.setCrossOrigin(n),c=yc.load(l)),void 0!==r&&(c.repeat.fromArray(r),1!==r[0]&&(c.wrapS=ve),1!==r[1]&&(c.wrapT=ve)),void 0!==a&&c.offset.fromArray(a),void 0!==o&&("repeat"===o[0]&&(c.wrapS=ve),"mirror"===o[0]&&(c.wrapS=xe),"repeat"===o[1]&&(c.wrapT=ve),"mirror"===o[1]&&(c.wrapT=xe)),void 0!==s&&(c.anisotropy=s);var u=Ct.generateUUID();return i[u]=c,u}var a={uuid:Ct.generateUUID(),type:"MeshLambertMaterial"};for(var o in e){var s=e[o];switch(o){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":a.name=s;break;case"blending":a.blending=gc[s];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",o,"is no longer supported.");break;case"colorDiffuse":a.color=vc.fromArray(s).getHex();break;case"colorSpecular":a.specular=vc.fromArray(s).getHex();break;case"colorEmissive":a.emissive=vc.fromArray(s).getHex();break;case"specularCoef":a.shininess=s;break;case"shading":"basic"===s.toLowerCase()&&(a.type="MeshBasicMaterial"),"phong"===s.toLowerCase()&&(a.type="MeshPhongMaterial"),"standard"===s.toLowerCase()&&(a.type="MeshStandardMaterial");break;case"mapDiffuse":a.map=r(s,e.mapDiffuseRepeat,e.mapDiffuseOffset,e.mapDiffuseWrap,e.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":a.emissiveMap=r(s,e.mapEmissiveRepeat,e.mapEmissiveOffset,e.mapEmissiveWrap,e.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":a.lightMap=r(s,e.mapLightRepeat,e.mapLightOffset,e.mapLightWrap,e.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":a.aoMap=r(s,e.mapAORepeat,e.mapAOOffset,e.mapAOWrap,e.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":a.bumpMap=r(s,e.mapBumpRepeat,e.mapBumpOffset,e.mapBumpWrap,e.mapBumpAnisotropy);break;case"mapBumpScale":a.bumpScale=s;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":a.normalMap=r(s,e.mapNormalRepeat,e.mapNormalOffset,e.mapNormalWrap,e.mapNormalAnisotropy);break;case"mapNormalFactor":a.normalScale=s;break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":a.specularMap=r(s,e.mapSpecularRepeat,e.mapSpecularOffset,e.mapSpecularWrap,e.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":a.metalnessMap=r(s,e.mapMetalnessRepeat,e.mapMetalnessOffset,e.mapMetalnessWrap,e.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":a.roughnessMap=r(s,e.mapRoughnessRepeat,e.mapRoughnessOffset,e.mapRoughnessWrap,e.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":a.alphaMap=r(s,e.mapAlphaRepeat,e.mapAlphaOffset,e.mapAlphaWrap,e.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":a.side=b;break;case"doubleSided":a.side=w;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),a.opacity=s;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":a[o]=s;break;case"vertexColors":!0===s&&(a.vertexColors=S),"face"===s&&(a.vertexColors=M);break;default:console.error("THREE.Loader.createMaterial: Unsupported",o,s)}}return"MeshBasicMaterial"===a.type&&delete a.emissive,"MeshPhongMaterial"!==a.type&&delete a.specular,a.opacity<1&&(a.transparent=!0),xc.setTextures(i),xc.parse(a)})});var Rc,Pc,Cc,Ic,Oc,Dc,Nc,Uc,Bc,Fc,zc={getContext:function(){return void 0===bc&&(bc=new(window.AudioContext||window.webkitAudioContext)),bc},setContext:function(e){bc=e}};function Gc(e){this.manager=void 0!==e?e:Ss}function Hc(e,t,n,i){Pn.call(this),this.type="CubeCamera";var r=new ta(90,1,e,t);r.up.set(0,-1,0),r.lookAt(new Dt(1,0,0)),this.add(r);var a=new ta(90,1,e,t);a.up.set(0,-1,0),a.lookAt(new Dt(-1,0,0)),this.add(a);var o=new ta(90,1,e,t);o.up.set(0,0,1),o.lookAt(new Dt(0,1,0)),this.add(o);var s=new ta(90,1,e,t);s.up.set(0,0,-1),s.lookAt(new Dt(0,-1,0)),this.add(s);var c=new ta(90,1,e,t);c.up.set(0,-1,0),c.lookAt(new Dt(0,0,1)),this.add(c);var l=new ta(90,1,e,t);l.up.set(0,-1,0),l.lookAt(new Dt(0,0,-1)),this.add(l),i=i||{format:ze,magFilter:Me,minFilter:Me},this.renderTarget=new en(n,n,i),this.renderTarget.texture.name="CubeCamera",this.update=function(e,t){null===this.parent&&this.updateMatrixWorld();var n=e.getRenderTarget(),i=this.renderTarget,h=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0),e.render(t,r),e.setRenderTarget(i,1),e.render(t,a),e.setRenderTarget(i,2),e.render(t,o),e.setRenderTarget(i,3),e.render(t,s),e.setRenderTarget(i,4),e.render(t,c),i.texture.generateMipmaps=h,e.setRenderTarget(i,5),e.render(t,l),e.setRenderTarget(n)},this.clear=function(e,t,n,i){for(var r=e.getRenderTarget(),a=this.renderTarget,o=0;o<6;o++)e.setRenderTarget(a,o),e.clear(t,n,i);e.setRenderTarget(r)}}function Vc(e){this.autoStart=void 0===e||e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}function kc(){Pn.call(this),this.type="AudioListener",this.context=zc.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0}function jc(e){Pn.call(this),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.startTime=0,this.offset=0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this.filters=[]}function Wc(e){jc.call(this,e),this.panner=this.context.createPanner(),this.panner.connect(this.gain)}function qc(e,t){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=void 0!==t?t:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}function Xc(e,t,n){this.binding=e,this.valueSize=n;var i,r=Float64Array;switch(t){case"quaternion":i=this._slerp;break;case"string":case"bool":r=Array,i=this._select;break;default:i=this._lerp}this.buffer=new r(4*n),this._mixBufferRegion=i,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}Object.assign(Gc.prototype,{load:function(e,t,n,i){var r=new Es(this.manager);r.setResponseType("arraybuffer"),r.setPath(this.path),r.load(e,function(e){var n=e.slice(0);zc.getContext().decodeAudioData(n,function(e){t(e)})},n,i)},setPath:function(e){return this.path=e,this}}),Object.assign(function(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new ta,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new ta,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1}.prototype,{update:(Bc=new sn,Fc=new sn,function(e){if(Rc!==this||Pc!==e.focus||Cc!==e.fov||Ic!==e.aspect*this.aspect||Oc!==e.near||Dc!==e.far||Nc!==e.zoom||Uc!==this.eyeSep){Rc=this,Pc=e.focus,Cc=e.fov,Ic=e.aspect*this.aspect,Oc=e.near,Dc=e.far,Nc=e.zoom;var t,n,i=e.projectionMatrix.clone(),r=(Uc=this.eyeSep/2)*Oc/Pc,a=Oc*Math.tan(Ct.DEG2RAD*Cc*.5)/Nc;Fc.elements[12]=-Uc,Bc.elements[12]=Uc,t=-a*Ic+r,n=a*Ic+r,i.elements[0]=2*Oc/(n-t),i.elements[8]=(n+t)/(n-t),this.cameraL.projectionMatrix.copy(i),t=-a*Ic-r,n=a*Ic-r,i.elements[0]=2*Oc/(n-t),i.elements[8]=(n+t)/(n-t),this.cameraR.projectionMatrix.copy(i)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Fc),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Bc)})}),Hc.prototype=Object.create(Pn.prototype),Hc.prototype.constructor=Hc,Object.assign(Vc.prototype,{start:function(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var t=("undefined"==typeof performance?Date:performance).now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}),kc.prototype=Object.assign(Object.create(Pn.prototype),{constructor:kc,getInput:function(){return this.gain},removeFilter:function(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this},getFilter:function(){return this.filter},setFilter:function(e){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this},updateMatrixWorld:function(){var e=new Dt,t=new Ot,n=new Dt,i=new Dt,r=new Vc;return function(a){Pn.prototype.updateMatrixWorld.call(this,a);var o=this.context.listener,s=this.up;if(this.timeDelta=r.getDelta(),this.matrixWorld.decompose(e,t,n),i.set(0,0,-1).applyQuaternion(t),o.positionX){var c=this.context.currentTime+this.timeDelta;o.positionX.linearRampToValueAtTime(e.x,c),o.positionY.linearRampToValueAtTime(e.y,c),o.positionZ.linearRampToValueAtTime(e.z,c),o.forwardX.linearRampToValueAtTime(i.x,c),o.forwardY.linearRampToValueAtTime(i.y,c),o.forwardZ.linearRampToValueAtTime(i.z,c),o.upX.linearRampToValueAtTime(s.x,c),o.upY.linearRampToValueAtTime(s.y,c),o.upZ.linearRampToValueAtTime(s.z,c)}else o.setPosition(e.x,e.y,e.z),o.setOrientation(i.x,i.y,i.z,s.x,s.y,s.z)}}()}),jc.prototype=Object.assign(Object.create(Pn.prototype),{constructor:jc,getOutput:function(){return this.gain},setNodeSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this},setMediaElementSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this},setBuffer:function(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(){if(!0!==this.isPlaying){if(!1!==this.hasPlaybackControl){var e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.onended=this.onEnded.bind(this),this.startTime=this.context.currentTime,e.start(this.startTime,this.offset),this.isPlaying=!0,this.source=e,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}console.warn("THREE.Audio: this Audio has no playback control.")}else console.warn("THREE.Audio: Audio is already playing.")},pause:function(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this.source.stop(),this.source.onended=null,this.offset+=(this.context.currentTime-this.startTime)*this.playbackRate,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")},stop:function(){if(!1!==this.hasPlaybackControl)return this.source.stop(),this.source.onended=null,this.offset=0,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")},connect:function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(var e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(e){return e||(e=[]),!0===this.isPlaying?(this.disconnect(),this.filters=e,this.connect()):this.filters=e,this},setDetune:function(e){if(this.detune=e,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this},getDetune:function(){return this.detune},getFilter:function(){return this.getFilters()[0]},setFilter:function(e){return this.setFilters(e?[e]:[])},setPlaybackRate:function(e){if(!1!==this.hasPlaybackControl)return this.playbackRate=e,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(e){if(!1!==this.hasPlaybackControl)return this.loop=e,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")},getVolume:function(){return this.gain.gain.value},setVolume:function(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}}),Wc.prototype=Object.assign(Object.create(jc.prototype),{constructor:Wc,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(e){return this.panner.refDistance=e,this},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(e){return this.panner.rolloffFactor=e,this},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(e){return this.panner.distanceModel=e,this},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(e){return this.panner.maxDistance=e,this},setDirectionalCone:function(e,t,n){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=n,this},updateMatrixWorld:function(){var e=new Dt,t=new Ot,n=new Dt,i=new Dt;return function(r){if(Pn.prototype.updateMatrixWorld.call(this,r),!0!==this.hasPlaybackControl||!1!==this.isPlaying){this.matrixWorld.decompose(e,t,n),i.set(0,0,1).applyQuaternion(t);var a=this.panner;if(a.positionX){var o=this.context.currentTime+this.listener.timeDelta;a.positionX.linearRampToValueAtTime(e.x,o),a.positionY.linearRampToValueAtTime(e.y,o),a.positionZ.linearRampToValueAtTime(e.z,o),a.orientationX.linearRampToValueAtTime(i.x,o),a.orientationY.linearRampToValueAtTime(i.y,o),a.orientationZ.linearRampToValueAtTime(i.z,o)}else a.setPosition(e.x,e.y,e.z),a.setOrientation(i.x,i.y,i.z)}}}()}),Object.assign(qc.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var e=0,t=this.getFrequencyData(),n=0;n<t.length;n++)e+=t[n];return e/t.length}}),Object.assign(Xc.prototype,{accumulate:function(e,t){var n=this.buffer,i=this.valueSize,r=e*i+i,a=this.cumulativeWeight;if(0===a){for(var o=0;o!==i;++o)n[r+o]=n[o];a=t}else{var s=t/(a+=t);this._mixBufferRegion(n,r,0,s,i)}this.cumulativeWeight=a},apply:function(e){var t=this.valueSize,n=this.buffer,i=e*t+t,r=this.cumulativeWeight,a=this.binding;if(this.cumulativeWeight=0,r<1){var o=3*t;this._mixBufferRegion(n,i,o,1-r,t)}for(var s=t,c=t+t;s!==c;++s)if(n[s]!==n[s+t]){a.setValue(n,i);break}},saveOriginalState:function(){var e=this.binding,t=this.buffer,n=this.valueSize,i=3*n;e.getValue(t,i);for(var r=n,a=i;r!==a;++r)t[r]=t[i+r%n];this.cumulativeWeight=0},restoreOriginalState:function(){var e=3*this.valueSize;this.binding.setValue(this.buffer,e)},_select:function(e,t,n,i,r){if(i>=.5)for(var a=0;a!==r;++a)e[t+a]=e[n+a]},_slerp:function(e,t,n,i){Ot.slerpFlat(e,t,e,t,e,n,i)},_lerp:function(e,t,n,i,r){for(var a=1-i,o=0;o!==r;++o){var s=t+o;e[s]=e[s]*a+e[n+o]*i}}});var Yc,Jc,Zc,Kc,Qc,$c,el,tl,nl,il,rl,al,ol,sl,cl;function ll(e,t,n){var i=n||hl.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}function hl(e,t,n){this.path=t,this.parsedPath=n||hl.parseTrackName(t),this.node=hl.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}function ul(e,t,n){this._mixer=e,this._clip=t,this._localRoot=n||null;for(var i=t.tracks,r=i.length,a=new Array(r),o={endingStart:gt,endingEnd:gt},s=0;s!==r;++s){var c=i[s].createInterpolant(null);a[s]=c,c.settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=new Array(r),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=mt,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function pl(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function dl(e){"string"==typeof e&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}function fl(){Yn.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function ml(e,t,n){ya.call(this,e,t),this.meshPerAttribute=n||1}function gl(e,t,n,i){"number"==typeof n&&(i=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),Nn.call(this,e,t,n),this.meshPerAttribute=i||1}function vl(e,t){return e.distance-t.distance}function yl(e,t,n,i){if(!1!==e.visible&&(e.raycast(t,n),!0===i))for(var r=e.children,a=0,o=r.length;a<o;a++)yl(r[a],t,n,!0)}function xl(e,t){this.min=void 0!==e?e:new It(1/0,1/0),this.max=void 0!==t?t:new It(-1/0,-1/0)}function bl(e,t){this.start=void 0!==e?e:new Dt,this.end=void 0!==t?t:new Dt}function wl(e){Pn.call(this),this.material=e,this.render=function(){}}function _l(e,t,n,i){this.object=e,this.size=void 0!==t?t:1;var r=void 0!==n?n:16711680,a=void 0!==i?i:1,o=0,s=this.object.geometry;s&&s.isGeometry?o=3*s.faces.length:s&&s.isBufferGeometry&&(o=s.attributes.normal.count);var c=new Yn,l=new kn(2*o*3,3);c.addAttribute("position",l),La.call(this,c,new Ea({color:r,linewidth:a})),this.matrixAutoUpdate=!1,this.update()}function Ml(e,t){Pn.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;for(var n=new Yn,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],r=0,a=1;r<32;r++,a++){var o=r/32*Math.PI*2,s=a/32*Math.PI*2;i.push(Math.cos(o),Math.sin(o),1,Math.cos(s),Math.sin(s),1)}n.addAttribute("position",new kn(i,3));var c=new Ea({fog:!1});this.cone=new La(n,c),this.add(this.cone),this.update()}function Sl(e){for(var t=function e(t){var n=[];t&&t.isBone&&n.push(t);for(var i=0;i<t.children.length;i++)n.push.apply(n,e(t.children[i]));return n}(e),n=new Yn,i=[],r=[],a=new gn(0,0,1),o=new gn(0,1,0),s=0;s<t.length;s++){var c=t[s];c.parent&&c.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),r.push(a.r,a.g,a.b),r.push(o.r,o.g,o.b))}n.addAttribute("position",new kn(i,3)),n.addAttribute("color",new kn(r,3));var l=new Ea({vertexColors:S,depthTest:!1,depthWrite:!1,transparent:!0});La.call(this,n,l),this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}function Tl(e,t,n){this.light=e,this.light.updateMatrixWorld(),this.color=n;var i=new Do(t,4,2),r=new yi({wireframe:!0,fog:!1});xi.call(this,i,r),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}function El(e,t){this.type="RectAreaLightHelper",this.light=e,this.color=t;var n=new Yn;n.addAttribute("position",new kn([1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],3)),n.computeBoundingSphere();var i=new Ea({fog:!1});Aa.call(this,n,i);var r=new Yn;r.addAttribute("position",new kn([1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],3)),r.computeBoundingSphere(),this.add(new xi(r,new yi({side:b,fog:!1}))),this.update()}function Al(e,t,n){Pn.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;var i=new ja(t);i.rotateY(.5*Math.PI),this.material=new yi({wireframe:!0,fog:!1}),void 0===this.color&&(this.material.vertexColors=S);var r=i.getAttribute("position"),a=new Float32Array(3*r.count);i.addAttribute("color",new Nn(a,3)),this.add(new xi(i,this.material)),this.update()}function Ll(e,t,n,i){e=e||10,t=t||10,n=new gn(void 0!==n?n:4473924),i=new gn(void 0!==i?i:8947848);for(var r=t/2,a=e/t,o=e/2,s=[],c=[],l=0,h=0,u=-o;l<=t;l++,u+=a){s.push(-o,0,u,o,0,u),s.push(u,0,-o,u,0,o);var p=l===r?n:i;p.toArray(c,h),h+=3,p.toArray(c,h),h+=3,p.toArray(c,h),h+=3,p.toArray(c,h),h+=3}var d=new Yn;d.addAttribute("position",new kn(s,3)),d.addAttribute("color",new kn(c,3));var f=new Ea({vertexColors:S});La.call(this,d,f)}function Rl(e,t,n,i,r,a){e=e||10,t=t||16,n=n||8,i=i||64,r=new gn(void 0!==r?r:4473924),a=new gn(void 0!==a?a:8947848);var o,s,c,l,h,u,p,d=[],f=[];for(l=0;l<=t;l++)c=l/t*(2*Math.PI),o=Math.sin(c)*e,s=Math.cos(c)*e,d.push(0,0,0),d.push(o,0,s),p=1&l?r:a,f.push(p.r,p.g,p.b),f.push(p.r,p.g,p.b);for(l=0;l<=n;l++)for(p=1&l?r:a,u=e-e/n*l,h=0;h<i;h++)c=h/i*(2*Math.PI),o=Math.sin(c)*u,s=Math.cos(c)*u,d.push(o,0,s),f.push(p.r,p.g,p.b),c=(h+1)/i*(2*Math.PI),o=Math.sin(c)*u,s=Math.cos(c)*u,d.push(o,0,s),f.push(p.r,p.g,p.b);var m=new Yn;m.addAttribute("position",new kn(d,3)),m.addAttribute("color",new kn(f,3));var g=new Ea({vertexColors:S});La.call(this,m,g)}function Pl(e,t,n,i){this.audio=e,this.range=t||1,this.divisionsInnerAngle=n||16,this.divisionsOuterAngle=i||2;var r=new Yn,a=this.divisionsInnerAngle+2*this.divisionsOuterAngle,o=new Float32Array(3*(3*a+3));r.addAttribute("position",new Nn(o,3));var s=new Ea({color:65280}),c=new Ea({color:16776960});Aa.call(this,r,[c,s]),this.update()}function Cl(e,t,n,i){this.object=e,this.size=void 0!==t?t:1;var r=void 0!==n?n:16776960,a=void 0!==i?i:1,o=0,s=this.object.geometry;s&&s.isGeometry?o=s.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");var c=new Yn,l=new kn(2*o*3,3);c.addAttribute("position",l),La.call(this,c,new Ea({color:r,linewidth:a})),this.matrixAutoUpdate=!1,this.update()}function Il(e,t,n){Pn.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,void 0===t&&(t=1);var i=new Yn;i.addAttribute("position",new kn([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));var r=new Ea({fog:!1});this.lightPlane=new Aa(i,r),this.add(this.lightPlane),(i=new Yn).addAttribute("position",new kn([0,0,0,0,0,1],3)),this.targetLine=new Aa(i,r),this.add(this.targetLine),this.update()}function Ol(e){var t=new Yn,n=new Ea({color:16777215,vertexColors:M}),i=[],r=[],a={},o=new gn(16755200),s=new gn(16711680),c=new gn(43775),l=new gn(16777215),h=new gn(3355443);function u(e,t,n){p(e,n),p(t,n)}function p(e,t){i.push(0,0,0),r.push(t.r,t.g,t.b),void 0===a[e]&&(a[e]=[]),a[e].push(i.length/3-1)}u("n1","n2",o),u("n2","n4",o),u("n4","n3",o),u("n3","n1",o),u("f1","f2",o),u("f2","f4",o),u("f4","f3",o),u("f3","f1",o),u("n1","f1",o),u("n2","f2",o),u("n3","f3",o),u("n4","f4",o),u("p","n1",s),u("p","n2",s),u("p","n3",s),u("p","n4",s),u("u1","u2",c),u("u2","u3",c),u("u3","u1",c),u("c","t",l),u("p","c",h),u("cn1","cn2",h),u("cn3","cn4",h),u("cf1","cf2",h),u("cf3","cf4",h),t.addAttribute("position",new kn(i,3)),t.addAttribute("color",new kn(r,3)),La.call(this,t,n),this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update()}function Dl(e,t){this.object=e,void 0===t&&(t=16776960);var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(24),r=new Yn;r.setIndex(new Nn(n,1)),r.addAttribute("position",new Nn(i,3)),La.call(this,r,new Ea({color:t})),this.matrixAutoUpdate=!1,this.update()}function Nl(e,t){this.type="Box3Helper",this.box=e;var n=void 0!==t?t:16776960,i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Yn;r.setIndex(new Nn(i,1)),r.addAttribute("position",new kn([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),La.call(this,r,new Ea({color:n})),this.geometry.computeBoundingSphere()}function Ul(e,t,n){this.type="PlaneHelper",this.plane=e,this.size=void 0===t?1:t;var i=void 0!==n?n:16776960,r=new Yn;r.addAttribute("position",new kn([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),r.computeBoundingSphere(),Aa.call(this,r,new Ea({color:i}));var a=new Yn;a.addAttribute("position",new kn([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),a.computeBoundingSphere(),this.add(new xi(a,new yi({color:i,opacity:.2,transparent:!0,depthWrite:!1})))}function Bl(e,t,n,i,r,a){Pn.call(this),void 0===e&&(e=new Dt(0,0,1)),void 0===t&&(t=new Dt(0,0,0)),void 0===n&&(n=1),void 0===i&&(i=16776960),void 0===r&&(r=.2*n),void 0===a&&(a=.2*r),void 0===al&&((al=new Yn).addAttribute("position",new kn([0,0,0,0,1,0],3)),(ol=new jo(0,.5,1,5,1)).translate(0,-.5,0)),this.position.copy(t),this.line=new Aa(al,new Ea({color:i})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new xi(ol,new yi({color:i})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,r,a)}function Fl(e){var t=[0,0,0,e=e||1,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=new Yn;n.addAttribute("position",new kn(t,3)),n.addAttribute("color",new kn([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));var i=new Ea({vertexColors:S});La.call(this,n,i)}Object.assign(ll.prototype,{getValue:function(e,t){this.bind();var n=this._targetGroup.nCachedObjects_,i=this._bindings[n];void 0!==i&&i.getValue(e,t)},setValue:function(e,t){for(var n=this._bindings,i=this._targetGroup.nCachedObjects_,r=n.length;i!==r;++i)n[i].setValue(e,t)},bind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()},unbind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}),Object.assign(hl,{Composite:ll,create:function(e,t,n){return e&&e.isAnimationObjectGroup?new hl.Composite(e,t,n):new hl(e,t,n)},sanitizeNodeName:(nl=new RegExp("[\\[\\]\\.:\\/]","g"),function(e){return e.replace(/\s/g,"_").replace(nl,"")}),parseTrackName:(Yc="[^\\[\\]\\.:\\/]",Jc="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",Zc=/((?:WC+[\/:])*)/.source.replace("WC",Yc),Kc=/(WCOD+)?/.source.replace("WCOD",Jc),Qc=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Yc),$c=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Yc),el=new RegExp("^"+Zc+Kc+Qc+$c+"$"),tl=["material","materials","bones"],function(e){var t=el.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);var n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){var r=n.nodeName.substring(i+1);-1!==tl.indexOf(r)&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=r)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}),findNode:function(e,t){if(!t||""===t||"root"===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){var n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){var i=function(e){for(var n=0;n<e.length;n++){var r=e[n];if(r.name===t||r.uuid===t)return r;var a=i(r.children);if(a)return a}return null},r=i(e.children);if(r)return r}return null}}),Object.assign(hl.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(e,t){e[t]=this.node[this.propertyName]},function(e,t){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)e[t++]=n[i]},function(e,t){e[t]=this.resolvedProperty[this.propertyIndex]},function(e,t){this.resolvedProperty.toArray(e,t)}],SetterByBindingTypeAndVersioning:[[function(e,t){this.targetObject[this.propertyName]=e[t]},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=e[t++]},function(e,t){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=e[t++];this.targetObject.needsUpdate=!0},function(e,t){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty[this.propertyIndex]=e[t]},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty.fromArray(e,t)},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(e,t){this.bind(),this.getValue(e,t)},setValue:function(e,t){this.bind(),this.setValue(e,t)},bind:function(){var e=this.node,t=this.parsedPath,n=t.objectName,i=t.propertyName,r=t.propertyIndex;if(e||(e=hl.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,e){if(n){var a=t.objectIndex;switch(n){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(var o=0;o<e.length;o++)if(e[o].name===a){a=o;break}break;default:if(void 0===e[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[n]}if(void 0!==a){if(void 0===e[a])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[a]}}var s=e[i];if(void 0!==s){var c=this.Versioning.None;this.targetObject=e,void 0!==e.needsUpdate?c=this.Versioning.NeedsUpdate:void 0!==e.matrixWorldNeedsUpdate&&(c=this.Versioning.MatrixWorldNeedsUpdate);var l=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===i){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(e.geometry.isBufferGeometry){if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);for(o=0;o<this.node.geometry.morphAttributes.position.length;o++)if(e.geometry.morphAttributes.position[o].name===r){r=o;break}}else{if(!e.geometry.morphTargets)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.",this);for(o=0;o<this.node.geometry.morphTargets.length;o++)if(e.geometry.morphTargets[o].name===r){r=o;break}}}l=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=r}else void 0!==s.fromArray&&void 0!==s.toArray?(l=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(l=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=i;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][c]}else{var h=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+h+"."+i+" but it wasn't found.",e)}}else console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.")},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),
4//!\ DECLARE ALIAS AFTER assign prototype !
5Object.assign(hl.prototype,{_getValue_unbound:hl.prototype.getValue,_setValue_unbound:hl.prototype.setValue}),Object.assign(function(){this.uuid=Ct.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var e={};this._indicesByUUID=e;for(var t=0,n=arguments.length;t!==n;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var i=this;this.stats={objects:{get total(){return i._objects.length},get inUse(){return this.total-i.nCachedObjects_}},get bindingsPerObject(){return i._bindings.length}}}.prototype,{isAnimationObjectGroup:!0,add:function(){for(var e=this._objects,t=e.length,n=this.nCachedObjects_,i=this._indicesByUUID,r=this._paths,a=this._parsedPaths,o=this._bindings,s=o.length,c=void 0,l=0,h=arguments.length;l!==h;++l){var u=arguments[l],p=u.uuid,d=i[p];if(void 0===d){d=t++,i[p]=d,e.push(u);for(var f=0,m=s;f!==m;++f)o[f].push(new hl(u,r[f],a[f]))}else if(d<n){c=e[d];var g=--n,v=e[g];i[v.uuid]=d,e[d]=v,i[p]=g,e[g]=u;for(f=0,m=s;f!==m;++f){var y=o[f],x=y[g],b=y[d];y[d]=x,void 0===b&&(b=new hl(u,r[f],a[f])),y[g]=b}}else e[d]!==c&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=n},remove:function(){for(var e=this._objects,t=this.nCachedObjects_,n=this._indicesByUUID,i=this._bindings,r=i.length,a=0,o=arguments.length;a!==o;++a){var s=arguments[a],c=s.uuid,l=n[c];if(void 0!==l&&l>=t){var h=t++,u=e[h];n[u.uuid]=l,e[l]=u,n[c]=h,e[h]=s;for(var p=0,d=r;p!==d;++p){var f=i[p],m=f[h],g=f[l];f[l]=m,f[h]=g}}}this.nCachedObjects_=t},uncache:function(){for(var e=this._objects,t=e.length,n=this.nCachedObjects_,i=this._indicesByUUID,r=this._bindings,a=r.length,o=0,s=arguments.length;o!==s;++o){var c=arguments[o].uuid,l=i[c];if(void 0!==l)if(delete i[c],l<n){var h=--n,u=e[h],p=e[v=--t];i[u.uuid]=l,e[l]=u,i[p.uuid]=h,e[h]=p,e.pop();for(var d=0,f=a;d!==f;++d){var m=(y=r[d])[h],g=y[v];y[l]=m,y[h]=g,y.pop()}}else{var v;i[(p=e[v=--t]).uuid]=l,e[l]=p,e.pop();for(d=0,f=a;d!==f;++d){var y;(y=r[d])[l]=y[v],y.pop()}}}this.nCachedObjects_=n},subscribe_:function(e,t){var n=this._bindingsIndicesByPath,i=n[e],r=this._bindings;if(void 0!==i)return r[i];var a=this._paths,o=this._parsedPaths,s=this._objects,c=s.length,l=this.nCachedObjects_,h=new Array(c);i=r.length,n[e]=i,a.push(e),o.push(t),r.push(h);for(var u=l,p=s.length;u!==p;++u){var d=s[u];h[u]=new hl(d,e,t)}return h},unsubscribe_:function(e){var t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){var i=this._paths,r=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o];t[e[o]]=n,a[n]=s,a.pop(),r[n]=r[o],r.pop(),i[n]=i[o],i.pop()}}}),Object.assign(ul.prototype,{play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(e){return this._startTime=e,this},setLoop:function(e,t){return this.loop=e,this.repetitions=t,this},setEffectiveWeight:function(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(e){return this._scheduleFading(e,0,1)},fadeOut:function(e){return this._scheduleFading(e,1,0)},crossFadeFrom:function(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){var i=this._clip.duration,r=e._clip.duration,a=r/i,o=i/r;e.warp(1,a,t),this.warp(o,1,t)}return this},crossFadeTo:function(e,t,n){return e.crossFadeFrom(this,t,n)},stopFading:function(){var e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},setEffectiveTimeScale:function(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(e){return this.timeScale=this._clip.duration/e,this.stopWarping()},syncWith:function(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()},halt:function(e){return this.warp(this._effectiveTimeScale,0,e)},warp:function(e,t,n){var i=this._mixer,r=i.time,a=this._timeScaleInterpolant,o=this.timeScale;null===a&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);var s=a.parameterPositions,c=a.sampleValues;return s[0]=r,s[1]=r+n,c[0]=e/o,c[1]=t/o,this},stopWarping:function(){var e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(e,t,n,i){if(this.enabled){var r=this._startTime;if(null!==r){var a=(e-r)*n;if(a<0||0===n)return;this._startTime=null,t=n*a}t*=this._updateTimeScale(e);var o=this._updateTime(t),s=this._updateWeight(e);if(s>0)for(var c=this._interpolants,l=this._propertyBindings,h=0,u=c.length;h!==u;++h)c[h].evaluate(o),l[h].accumulate(i,s)}else this._updateWeight(e)},_updateWeight:function(e){var t=0;if(this.enabled){t=this.weight;var n=this._weightInterpolant;if(null!==n){var i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=t,t},_updateTimeScale:function(e){var t=0;if(!this.paused){t=this.timeScale;var n=this._timeScaleInterpolant;if(null!==n)t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}return this._effectiveTimeScale=t,t},_updateTime:function(e){var t=this.time+e,n=this._clip.duration,i=this.loop,r=this._loopCount,a=2202===i;if(0===e)return-1===r?t:a&&1==(1&r)?n-t:t;if(2200===i){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(t>=n)t=n;else{if(!(t<0))break e;t=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===r&&(e>=0?(r=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),t>=n||t<0){var o=Math.floor(t/n);t-=n*o,r+=Math.abs(o);var s=this.repetitions-r;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,t=e>0?n:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===s){var c=e<0;this._setEndings(c,!c,a)}else this._setEndings(!1,!1,a);this._loopCount=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}if(a&&1==(1&r))return this.time=t,n-t}return this.time=t,t},_setEndings:function(e,t,n){var i=this._interpolantSettings;n?(i.endingStart=2401,i.endingEnd=2401):(i.endingStart=e?this.zeroSlopeAtStart?2401:gt:2402,i.endingEnd=t?this.zeroSlopeAtEnd?2401:gt:2402)},_scheduleFading:function(e,t,n){var i=this._mixer,r=i.time,a=this._weightInterpolant;null===a&&(a=i._lendControlInterpolant(),this._weightInterpolant=a);var o=a.parameterPositions,s=a.sampleValues;return o[0]=r,s[0]=t,o[1]=r+e,s[1]=n,this}}),pl.prototype=Object.assign(Object.create(s.prototype),{constructor:pl,_bindAction:function(e,t){var n=e._localRoot||this._root,i=e._clip.tracks,r=i.length,a=e._propertyBindings,o=e._interpolants,s=n.uuid,c=this._bindingsByRootAndName,l=c[s];void 0===l&&(l={},c[s]=l);for(var h=0;h!==r;++h){var u=i[h],p=u.name,d=l[p];if(void 0!==d)a[h]=d;else{if(void 0!==(d=a[h])){null===d._cacheIndex&&(++d.referenceCount,this._addInactiveBinding(d,s,p));continue}var f=t&&t._propertyBindings[h].binding.parsedPath;++(d=new Xc(hl.create(n,p,f),u.ValueTypeName,u.getValueSize())).referenceCount,this._addInactiveBinding(d,s,p),a[h]=d}o[h].resultBuffer=d.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){var t=(e._localRoot||this._root).uuid,n=e._clip.uuid,i=this._actionsByClip[n];this._bindAction(e,i&&i.knownActions[0]),this._addInactiveAction(e,n,t)}for(var r=e._propertyBindings,a=0,o=r.length;a!==o;++a){var s=r[a];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,n=0,i=t.length;n!==i;++n){var r=t[n];0==--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(e)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}},_isActiveAction:function(e){var t=e._cacheIndex;return null!==t&&t<this._nActiveActions},_addInactiveAction:function(e,t,n){var i=this._actions,r=this._actionsByClip,a=r[t];if(void 0===a)a={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,r[t]=a;else{var o=a.knownActions;e._byClipCacheIndex=o.length,o.push(e)}e._cacheIndex=i.length,i.push(e),a.actionByRoot[n]=e},_removeInactiveAction:function(e){var t=this._actions,n=t[t.length-1],i=e._cacheIndex;n._cacheIndex=i,t[i]=n,t.pop(),e._cacheIndex=null;var r=e._clip.uuid,a=this._actionsByClip,o=a[r],s=o.knownActions,c=s[s.length-1],l=e._byClipCacheIndex;c._byClipCacheIndex=l,s[l]=c,s.pop(),e._byClipCacheIndex=null,delete o.actionByRoot[(e._localRoot||this._root).uuid],0===s.length&&delete a[r],this._removeInactiveBindingsForAction(e)},_removeInactiveBindingsForAction:function(e){for(var t=e._propertyBindings,n=0,i=t.length;n!==i;++n){var r=t[n];0==--r.referenceCount&&this._removeInactiveBinding(r)}},_lendAction:function(e){var t=this._actions,n=e._cacheIndex,i=this._nActiveActions++,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r},_takeBackAction:function(e){var t=this._actions,n=e._cacheIndex,i=--this._nActiveActions,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r},_addInactiveBinding:function(e,t,n){var i=this._bindingsByRootAndName,r=i[t],a=this._bindings;void 0===r&&(r={},i[t]=r),r[n]=e,e._cacheIndex=a.length,a.push(e)},_removeInactiveBinding:function(e){var t=this._bindings,n=e.binding,i=n.rootNode.uuid,r=n.path,a=this._bindingsByRootAndName,o=a[i],s=t[t.length-1],c=e._cacheIndex;s._cacheIndex=c,t[c]=s,t.pop(),delete o[r];e:{for(var l in o)break e;delete a[i]}},_lendBinding:function(e){var t=this._bindings,n=e._cacheIndex,i=this._nActiveBindings++,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r},_takeBackBinding:function(e){var t=this._bindings,n=e._cacheIndex,i=--this._nActiveBindings,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r},_lendControlInterpolant:function(){var e=this._controlInterpolants,t=this._nActiveControlInterpolants++,n=e[t];return void 0===n&&((n=new hs(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex=t,e[t]=n),n},_takeBackControlInterpolant:function(e){var t=this._controlInterpolants,n=e.__cacheIndex,i=--this._nActiveControlInterpolants,r=t[i];e.__cacheIndex=i,t[i]=e,r.__cacheIndex=n,t[n]=r},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(e,t){var n=t||this._root,i=n.uuid,r="string"==typeof e?bs.findByName(n,e):e,a=null!==r?r.uuid:e,o=this._actionsByClip[a],s=null;if(void 0!==o){var c=o.actionByRoot[i];if(void 0!==c)return c;s=o.knownActions[0],null===r&&(r=s._clip)}if(null===r)return null;var l=new ul(this,r,t);return this._bindAction(l,s),this._addInactiveAction(l,a,i),l},existingAction:function(e,t){var n=t||this._root,i=n.uuid,r="string"==typeof e?bs.findByName(n,e):e,a=r?r.uuid:e,o=this._actionsByClip[a];return void 0!==o&&o.actionByRoot[i]||null},stopAllAction:function(){var e=this._actions,t=this._nActiveActions,n=this._bindings,i=this._nActiveBindings;this._nActiveActions=0,this._nActiveBindings=0;for(var r=0;r!==t;++r)e[r].reset();for(r=0;r!==i;++r)n[r].useCount=0;return this},update:function(e){e*=this.timeScale;for(var t=this._actions,n=this._nActiveActions,i=this.time+=e,r=Math.sign(e),a=this._accuIndex^=1,o=0;o!==n;++o){t[o]._update(i,e,r,a)}var s=this._bindings,c=this._nActiveBindings;for(o=0;o!==c;++o)s[o].apply(a);return this},getRoot:function(){return this._root},uncacheClip:function(e){var t=this._actions,n=e.uuid,i=this._actionsByClip,r=i[n];if(void 0!==r){for(var a=r.knownActions,o=0,s=a.length;o!==s;++o){var c=a[o];this._deactivateAction(c);var l=c._cacheIndex,h=t[t.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,h._cacheIndex=l,t[l]=h,t.pop(),this._removeInactiveBindingsForAction(c)}delete i[n]}},uncacheRoot:function(e){var t=e.uuid,n=this._actionsByClip;for(var i in n){var r=n[i].actionByRoot[t];void 0!==r&&(this._deactivateAction(r),this._removeInactiveAction(r))}var a=this._bindingsByRootAndName[t];if(void 0!==a)for(var o in a){var s=a[o];s.restoreOriginalState(),this._removeInactiveBinding(s)}},uncacheAction:function(e,t){var n=this.existingAction(e,t);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}),dl.prototype.clone=function(){return new dl(void 0===this.value.clone?this.value:this.value.clone())},fl.prototype=Object.assign(Object.create(Yn.prototype),{constructor:fl,isInstancedBufferGeometry:!0,copy:function(e){return Yn.prototype.copy.call(this,e),this.maxInstancedCount=e.maxInstancedCount,this},clone:function(){return(new this.constructor).copy(this)}}),ml.prototype=Object.assign(Object.create(ya.prototype),{constructor:ml,isInstancedInterleavedBuffer:!0,copy:function(e){return ya.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this}}),gl.prototype=Object.assign(Object.create(Nn.prototype),{constructor:gl,isInstancedBufferAttribute:!0,copy:function(e){return Nn.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this}}),Object.assign(function(e,t,n,i){this.ray=new gi(e,t),this.near=n||0,this.far=i||1/0,this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}.prototype,{linePrecision:1,set:function(e,t){this.ray.set(e,t)},setFromCamera:function(e,t){t&&t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize()):t&&t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld)):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(e,t,n){var i=n||[];return yl(e,this,i,t),i.sort(vl),i},intersectObjects:function(e,t,n){var i=n||[];if(!1===Array.isArray(e))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),i;for(var r=0,a=e.length;r<a;r++)yl(e[r],this,i,t);return i.sort(vl),i}}),Object.assign(function(e,t,n){return this.radius=void 0!==e?e:1,this.phi=void 0!==t?t:0,this.theta=void 0!==n?n:0,this}.prototype,{set:function(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this},makeSafe:function(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this},setFromVector3:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)},setFromCartesianCoords:function(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(Ct.clamp(t/this.radius,-1,1))),this}}),Object.assign(function(e,t,n){return this.radius=void 0!==e?e:1,this.theta=void 0!==t?t:0,this.y=void 0!==n?n:0,this}.prototype,{set:function(e,t,n){return this.radius=e,this.theta=t,this.y=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this},setFromVector3:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)},setFromCartesianCoords:function(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}}),Object.assign(xl.prototype,{set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(){var e=new It;return function(t,n){var i=e.copy(n).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(e){return void 0===e&&(console.warn("THREE.Box2: .getCenter() target is now required"),e=new It),this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){return void 0===e&&(console.warn("THREE.Box2: .getSize() target is now required"),e=new It),this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y},getParameter:function(e,t){return void 0===t&&(console.warn("THREE.Box2: .getParameter() target is now required"),t=new It),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)},clampPoint:function(e,t){return void 0===t&&(console.warn("THREE.Box2: .clampPoint() target is now required"),t=new It),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new It;return function(t){return e.copy(t).clamp(this.min,this.max).sub(t).length()}}(),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}),Object.assign(bl.prototype,{set:function(e,t){return this.start.copy(e),this.end.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.start.copy(e.start),this.end.copy(e.end),this},getCenter:function(e){return void 0===e&&(console.warn("THREE.Line3: .getCenter() target is now required"),e=new Dt),e.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(e){return void 0===e&&(console.warn("THREE.Line3: .delta() target is now required"),e=new Dt),e.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(e,t){return void 0===t&&(console.warn("THREE.Line3: .at() target is now required"),t=new Dt),this.delta(t).multiplyScalar(e).add(this.start)},closestPointToPointParameter:(il=new Dt,rl=new Dt,function(e,t){il.subVectors(e,this.start),rl.subVectors(this.end,this.start);var n=rl.dot(rl),i=rl.dot(il)/n;return t&&(i=Ct.clamp(i,0,1)),i}),closestPointToPoint:function(e,t,n){var i=this.closestPointToPointParameter(e,t);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new Dt),this.delta(n).multiplyScalar(i).add(this.start)},applyMatrix4:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this},equals:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)}}),wl.prototype=Object.create(Pn.prototype),wl.prototype.constructor=wl,wl.prototype.isImmediateRenderObject=!0,_l.prototype=Object.create(La.prototype),_l.prototype.constructor=_l,_l.prototype.update=function(){var e=new Dt,t=new Dt,n=new Nt;return function(){var i=["a","b","c"];this.object.updateMatrixWorld(!0),n.getNormalMatrix(this.object.matrixWorld);var r=this.object.matrixWorld,a=this.geometry.attributes.position,o=this.object.geometry;if(o&&o.isGeometry)for(var s=o.vertices,c=o.faces,l=0,h=0,u=c.length;h<u;h++)for(var p=c[h],d=0,f=p.vertexNormals.length;d<f;d++){var m=s[p[i[d]]],g=p.vertexNormals[d];e.copy(m).applyMatrix4(r),t.copy(g).applyMatrix3(n).normalize().multiplyScalar(this.size).add(e),a.setXYZ(l,e.x,e.y,e.z),l+=1,a.setXYZ(l,t.x,t.y,t.z),l+=1}else if(o&&o.isBufferGeometry){var v=o.attributes.position,y=o.attributes.normal;for(l=0,d=0,f=v.count;d<f;d++)e.set(v.getX(d),v.getY(d),v.getZ(d)).applyMatrix4(r),t.set(y.getX(d),y.getY(d),y.getZ(d)),t.applyMatrix3(n).normalize().multiplyScalar(this.size).add(e),a.setXYZ(l,e.x,e.y,e.z),l+=1,a.setXYZ(l,t.x,t.y,t.z),l+=1}a.needsUpdate=!0}}(),Ml.prototype=Object.create(Pn.prototype),Ml.prototype.constructor=Ml,Ml.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},Ml.prototype.update=function(){var e=new Dt;return function(){this.light.updateMatrixWorld();var t=this.light.distance?this.light.distance:1e3,n=t*Math.tan(this.light.angle);this.cone.scale.set(n,n,t),e.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(e),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}(),Sl.prototype=Object.create(La.prototype),Sl.prototype.constructor=Sl,Sl.prototype.updateMatrixWorld=function(){var e=new Dt,t=new sn,n=new sn;return function(i){var r=this.bones,a=this.geometry,o=a.getAttribute("position");n.getInverse(this.root.matrixWorld);for(var s=0,c=0;s<r.length;s++){var l=r[s];l.parent&&l.parent.isBone&&(t.multiplyMatrices(n,l.matrixWorld),e.setFromMatrixPosition(t),o.setXYZ(c,e.x,e.y,e.z),t.multiplyMatrices(n,l.parent.matrixWorld),e.setFromMatrixPosition(t),o.setXYZ(c+1,e.x,e.y,e.z),c+=2)}a.getAttribute("position").needsUpdate=!0,Pn.prototype.updateMatrixWorld.call(this,i)}}(),Tl.prototype=Object.create(xi.prototype),Tl.prototype.constructor=Tl,Tl.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},Tl.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)},El.prototype=Object.create(Aa.prototype),El.prototype.constructor=El,El.prototype.update=function(){if(this.scale.set(.5*this.light.width,.5*this.light.height,1),void 0!==this.color)this.material.color.set(this.color),this.children[0].material.color.set(this.color);else{this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);var e=this.material.color,t=Math.max(e.r,e.g,e.b);t>1&&e.multiplyScalar(1/t),this.children[0].material.color.copy(this.material.color)}},El.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()},Al.prototype=Object.create(Pn.prototype),Al.prototype.constructor=Al,Al.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},Al.prototype.update=function(){var e=new Dt,t=new gn,n=new gn;return function(){var i=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var r=i.geometry.getAttribute("color");t.copy(this.light.color),n.copy(this.light.groundColor);for(var a=0,o=r.count;a<o;a++){var s=a<o/2?t:n;r.setXYZ(a,s.r,s.g,s.b)}r.needsUpdate=!0}i.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate())}}(),Ll.prototype=Object.assign(Object.create(La.prototype),{constructor:Ll,copy:function(e){return La.prototype.copy.call(this,e),this.geometry.copy(e.geometry),this.material.copy(e.material),this},clone:function(){return(new this.constructor).copy(this)}}),Rl.prototype=Object.create(La.prototype),Rl.prototype.constructor=Rl,Pl.prototype=Object.create(Aa.prototype),Pl.prototype.constructor=Pl,Pl.prototype.update=function(){var e,t,n=this.audio,i=this.range,r=this.divisionsInnerAngle,a=this.divisionsOuterAngle,o=Ct.degToRad(n.panner.coneInnerAngle),s=Ct.degToRad(n.panner.coneOuterAngle),c=o/2,l=s/2,h=0,u=0,p=this.geometry,d=p.attributes.position;function f(n,r,a,o){var s=(r-n)/a;for(d.setXYZ(h,0,0,0),u++,e=n;e<r;e+=s)t=h+u,d.setXYZ(t,Math.sin(e)*i,0,Math.cos(e)*i),d.setXYZ(t+1,Math.sin(Math.min(e+s,r))*i,0,Math.cos(Math.min(e+s,r))*i),d.setXYZ(t+2,0,0,0),u+=3;p.addGroup(h,u,o),h+=u,u=0}p.clearGroups(),f(-l,-c,a,0),f(-c,c,r,1),f(c,l,a,0),d.needsUpdate=!0,o===s&&(this.material[0].visible=!1)},Pl.prototype.dispose=function(){this.geometry.dispose(),this.material[0].dispose(),this.material[1].dispose()},Cl.prototype=Object.create(La.prototype),Cl.prototype.constructor=Cl,Cl.prototype.update=function(){var e=new Dt,t=new Dt,n=new Nt;return function(){this.object.updateMatrixWorld(!0),n.getNormalMatrix(this.object.matrixWorld);for(var i=this.object.matrixWorld,r=this.geometry.attributes.position,a=this.object.geometry,o=a.vertices,s=a.faces,c=0,l=0,h=s.length;l<h;l++){var u=s[l],p=u.normal;e.copy(o[u.a]).add(o[u.b]).add(o[u.c]).divideScalar(3).applyMatrix4(i),t.copy(p).applyMatrix3(n).normalize().multiplyScalar(this.size).add(e),r.setXYZ(c,e.x,e.y,e.z),c+=1,r.setXYZ(c,t.x,t.y,t.z),c+=1}r.needsUpdate=!0}}(),Il.prototype=Object.create(Pn.prototype),Il.prototype.constructor=Il,Il.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},Il.prototype.update=function(){var e=new Dt,t=new Dt,n=new Dt;return function(){e.setFromMatrixPosition(this.light.matrixWorld),t.setFromMatrixPosition(this.light.target.matrixWorld),n.subVectors(t,e),this.lightPlane.lookAt(t),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(t),this.targetLine.scale.z=n.length()}}(),Ol.prototype=Object.create(La.prototype),Ol.prototype.constructor=Ol,Ol.prototype.update=function(){var e,t,n=new Dt,i=new ea;function r(r,a,o,s){n.set(a,o,s).unproject(i);var c=t[r];if(void 0!==c)for(var l=e.getAttribute("position"),h=0,u=c.length;h<u;h++)l.setXYZ(c[h],n.x,n.y,n.z)}return function(){e=this.geometry,t=this.pointMap;i.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),r("c",0,0,-1),r("t",0,0,1),r("n1",-1,-1,-1),r("n2",1,-1,-1),r("n3",-1,1,-1),r("n4",1,1,-1),r("f1",-1,-1,1),r("f2",1,-1,1),r("f3",-1,1,1),r("f4",1,1,1),r("u1",.7,1.1,-1),r("u2",-.7,1.1,-1),r("u3",0,2,-1),r("cf1",-1,0,1),r("cf2",1,0,1),r("cf3",0,-1,1),r("cf4",0,1,1),r("cn1",-1,0,-1),r("cn2",1,0,-1),r("cn3",0,-1,-1),r("cn4",0,1,-1),e.getAttribute("position").needsUpdate=!0}}(),Dl.prototype=Object.create(La.prototype),Dl.prototype.constructor=Dl,Dl.prototype.update=function(){var e=new nn;return function(t){if(void 0!==t&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&e.setFromObject(this.object),!e.isEmpty()){var n=e.min,i=e.max,r=this.geometry.attributes.position,a=r.array;a[0]=i.x,a[1]=i.y,a[2]=i.z,a[3]=n.x,a[4]=i.y,a[5]=i.z,a[6]=n.x,a[7]=n.y,a[8]=i.z,a[9]=i.x,a[10]=n.y,a[11]=i.z,a[12]=i.x,a[13]=i.y,a[14]=n.z,a[15]=n.x,a[16]=i.y,a[17]=n.z,a[18]=n.x,a[19]=n.y,a[20]=n.z,a[21]=i.x,a[22]=n.y,a[23]=n.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}}}(),Dl.prototype.setFromObject=function(e){return this.object=e,this.update(),this},Dl.prototype.copy=function(e){return La.prototype.copy.call(this,e),this.object=e.object,this},Dl.prototype.clone=function(){return(new this.constructor).copy(this)},Nl.prototype=Object.create(La.prototype),Nl.prototype.constructor=Nl,Nl.prototype.updateMatrixWorld=function(e){var t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),Pn.prototype.updateMatrixWorld.call(this,e))},Ul.prototype=Object.create(Aa.prototype),Ul.prototype.constructor=Ul,Ul.prototype.updateMatrixWorld=function(e){var t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=t<0?b:x,this.lookAt(this.plane.normal),Pn.prototype.updateMatrixWorld.call(this,e)},Bl.prototype=Object.create(Pn.prototype),Bl.prototype.constructor=Bl,Bl.prototype.setDirection=(cl=new Dt,function(e){e.y>.99999?this.quaternion.set(0,0,0,1):e.y<-.99999?this.quaternion.set(1,0,0,0):(cl.set(e.z,0,-e.x).normalize(),sl=Math.acos(e.y),this.quaternion.setFromAxisAngle(cl,sl))}),Bl.prototype.setLength=function(e,t,n){void 0===t&&(t=.2*e),void 0===n&&(n=.2*t),this.line.scale.set(1,Math.max(0,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()},Bl.prototype.setColor=function(e){this.line.material.color.copy(e),this.cone.material.color.copy(e)},Bl.prototype.copy=function(e){return Pn.prototype.copy.call(this,e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this},Bl.prototype.clone=function(){return(new this.constructor).copy(this)},Fl.prototype=Object.create(La.prototype),Fl.prototype.constructor=Fl;function zl(e){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),zs.call(this,e),this.type="catmullrom"}Cs.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(Cs.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},Object.assign(Ks.prototype,{createPointsGeometry:function(e){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getPoints(e);return this.createGeometry(t)},createSpacedPointsGeometry:function(e){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getSpacedPoints(e);return this.createGeometry(t)},createGeometry:function(e){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var t=new Dn,n=0,i=e.length;n<i;n++){var r=e[n];t.vertices.push(new Dt(r.x,r.y,r.z||0))}return t}}),Object.assign(Qs.prototype,{fromPoints:function(e){console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)}}),Object.create(zs.prototype),Object.create(zs.prototype),zl.prototype=Object.create(zs.prototype),Object.assign(zl.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),Ll.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},Sl.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(Lc.prototype,{extractUrlBase:function(e){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),pc.extractUrlBase(e)}}),Object.assign(mc.prototype,{setTexturePath:function(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}}),Object.assign(xl.prototype,{center:function(e){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},size:function(e){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(e)}}),Object.assign(nn.prototype,{center:function(e){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionSphere:function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},size:function(e){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(e)}}),bl.prototype.center=function(e){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(e)},Object.assign(Ct,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(e){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),Ct.floorPowerOfTwo(e)},nextPowerOfTwo:function(e){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),Ct.ceilPowerOfTwo(e)}}),Object.assign(Nt.prototype,{flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},multiplyVector3:function(e){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBuffer:function(e){return console.warn("THREE.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(e)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(sn.prototype,{extractPosition:function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},getPosition:function(){var e;return function(){return void 0===e&&(e=new Dt),console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),e.setFromMatrixColumn(this,3)}}(),setRotationFromQuaternion:function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(e){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector4:function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},crossVector:function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBuffer:function(e){return console.warn("THREE.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(e)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(e,t,n,i,r,a){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,i,n,r,a)}}),an.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},Ot.prototype.multiplyVector3=function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},Object.assign(gi.prototype,{isIntersectionBox:function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionPlane:function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},isIntersectionSphere:function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)}}),Object.assign(vi.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(e,t){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(e,t)},midpoint:function(e){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(e)},normal:function(e){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(e)},plane:function(e){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(e)}}),Object.assign(vi,{barycoordFromPoint:function(e,t,n,i,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),vi.getBarycoord(e,t,n,i,r)},normal:function(e,t,n,i){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),vi.getNormal(e,t,n,i)}}),Object.assign($s.prototype,{extractAllPoints:function(e){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(e)},extrude:function(e){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Ao(this,e)},makeGeometry:function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new zo(this,e)}}),Object.assign(It.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Dt.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},getScaleFromMatrix:function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},getColumnFromMatrix:function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},applyProjection:function(e){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(e)},fromAttribute:function(e,t,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Kt.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Dn.prototype,{computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")}}),Object.assign(Pn.prototype,{getChildByName:function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")}}),Object.defineProperties(Pn.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(e){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=e}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.defineProperties(_a.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(Sa.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),Ma.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(Cs.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(e){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=e}}),ta.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(ec.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(e){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(e){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=e}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(e){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=e}}}),Object.defineProperties(Nn.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")}}),Object.assign(Yn.prototype,{addIndex:function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},addDrawCall:function(e,t,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")}}),Object.defineProperties(Yn.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.assign(Lo.prototype,{getArrays:function(){console.error("THREE.ExtrudeBufferGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeBufferGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeBufferGeometry: .addShape() has been removed.")}}),Object.defineProperties(dl.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(ei.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new gn}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===e}}}),Object.defineProperties(es.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(mi.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(e){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=e}}}),Object.assign(fa.prototype,{clearTarget:function(e,t,n,i){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(e),this.clear(t,n,i)},animate:function(e){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(e)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},allocTextureUnit:function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},setTexture2D:function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},setTextureCube:function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")}}),Object.defineProperties(fa.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(Jr.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(en.prototype,{activeCubeFace:{set:function(){console.warn("THREE.WebGLRenderTargetCube: .activeCubeFace has been removed. It is now the second parameter of WebGLRenderer.setRenderTarget().")}},activeMipMapLevel:{set:function(){console.warn("THREE.WebGLRenderTargetCube: .activeMipMapLevel has been removed. It is now the third parameter of WebGLRenderer.setRenderTarget().")}}}),Object.defineProperties(Qt.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=e}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=e}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=e}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=e}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(e){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=e}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(e){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=e}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(e){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=e}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(e){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=e}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(e){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=e}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(e){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=e}}}),Object.defineProperties(pa.prototype,{standing:{set:function(){console.warn("THREE.WebVRManager: .standing has been removed.")}},userHeight:{set:function(){console.warn("THREE.WebVRManager: .userHeight has been removed.")}}}),jc.prototype.load=function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var t=this;return(new Gc).load(e,function(e){t.setBuffer(e)}),this},qc.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},Hc.prototype.updateCubeMap=function(e,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(e,t)};Yt.crossOrigin=void 0,Yt.loadTexture=function(e,t,n,i){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var r=new Ps;r.setCrossOrigin(this.crossOrigin);var a=r.load(e,n,void 0,i);return t&&(a.mapping=t),a},Yt.loadTextureCube=function(e,t,n,i){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var r=new Rs;r.setCrossOrigin(this.crossOrigin);var a=r.load(e,n,void 0,i);return t&&(a.mapping=t),a},Yt.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},Yt.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};var Gl=function(){function e(e){this.manager=void 0!==e?e:Ss,this.dracoLoader=null}function t(){var e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}e.prototype={constructor:e,crossOrigin:"anonymous",load:function(e,t,n,i){var r,a=this;r=void 0!==this.resourcePath?this.resourcePath:void 0!==this.path?this.path:pc.extractUrlBase(e),a.manager.itemStart(e);var o=function(t){i?i(t):console.error(t),a.manager.itemError(e),a.manager.itemEnd(e)},s=new Es(a.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.load(e,function(n){try{a.parse(n,r,function(n){t(n),a.manager.itemEnd(e)},o)}catch(e){o(e)}},n,o)},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this},setResourcePath:function(e){return this.resourcePath=e,this},setDRACOLoader:function(e){return this.dracoLoader=e,this},parse:function(e,t,s,c){var d,f={};if("string"==typeof e)d=e;else if(pc.decodeText(new Uint8Array(e,0,4))===o){try{f[n.KHR_BINARY_GLTF]=new l(e)}catch(e){return void(c&&c(e))}d=f[n.KHR_BINARY_GLTF].content}else d=pc.decodeText(new Uint8Array(e));var m=JSON.parse(d);if(void 0===m.asset||m.asset.version[0]<2)c&&c(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported. Use LegacyGLTFLoader instead."));else{if(m.extensionsUsed)for(var g=0;g<m.extensionsUsed.length;++g){var v=m.extensionsUsed[g],y=m.extensionsRequired||[];switch(v){case n.KHR_LIGHTS_PUNCTUAL:f[v]=new r(m);break;case n.KHR_MATERIALS_UNLIT:f[v]=new a(m);break;case n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:f[v]=new p(m);break;case n.KHR_DRACO_MESH_COMPRESSION:f[v]=new h(m,this.dracoLoader);break;case n.MSFT_TEXTURE_DDS:f[n.MSFT_TEXTURE_DDS]=new i;break;case n.KHR_TEXTURE_TRANSFORM:f[n.KHR_TEXTURE_TRANSFORM]=new u(m);break;default:y.indexOf(v)>=0&&console.warn('THREE.GLTFLoader: Unknown extension "'+v+'".')}}new V(m,f,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,manager:this.manager}).parse(s,c)}}};var n={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function i(){if(!THREE.DDSLoader)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing THREE.DDSLoader");this.name=n.MSFT_TEXTURE_DDS,this.ddsLoader=new THREE.DDSLoader}function r(e){this.name=n.KHR_LIGHTS_PUNCTUAL;var t=e.extensions&&e.extensions[n.KHR_LIGHTS_PUNCTUAL]||{};this.lightDefs=t.lights||[]}function a(e){this.name=n.KHR_MATERIALS_UNLIT}r.prototype.loadLight=function(e){var t,n=this.lightDefs[e],i=new gn(16777215);void 0!==n.color&&i.fromArray(n.color);var r=void 0!==n.range?n.range:0;switch(n.type){case"directional":(t=new cc(i)).target.position.set(0,0,-1),t.add(t.target);break;case"point":(t=new ac(i)).distance=r;break;case"spot":(t=new rc(i)).distance=r,n.spot=n.spot||{},n.spot.innerConeAngle=void 0!==n.spot.innerConeAngle?n.spot.innerConeAngle:0,n.spot.outerConeAngle=void 0!==n.spot.outerConeAngle?n.spot.outerConeAngle:Math.PI/4,t.angle=n.spot.outerConeAngle,t.penumbra=1-n.spot.innerConeAngle/n.spot.outerConeAngle,t.target.position.set(0,0,-1),t.add(t.target);break;default:throw new Error('THREE.GLTFLoader: Unexpected light type, "'+n.type+'".')}return t.position.set(0,0,0),t.decay=2,void 0!==n.intensity&&(t.intensity=n.intensity),t.name=n.name||"light_"+e,Promise.resolve(t)},a.prototype.getMaterialType=function(e){return yi},a.prototype.extendParams=function(e,t,n){var i=[];e.color=new gn(1,1,1),e.opacity=1;var r=t.pbrMetallicRoughness;if(r){if(Array.isArray(r.baseColorFactor)){var a=r.baseColorFactor;e.color.fromArray(a),e.opacity=a[3]}void 0!==r.baseColorTexture&&i.push(n.assignTexture(e,"map",r.baseColorTexture))}return Promise.all(i)};var o="glTF",s=12,c={JSON:1313821514,BIN:5130562};function l(e){this.name=n.KHR_BINARY_GLTF,this.content=null,this.body=null;var t=new DataView(e,0,s);if(this.header={magic:pc.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==o)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected. Use LegacyGLTFLoader instead.");for(var i=new DataView(e,s),r=0;r<i.byteLength;){var a=i.getUint32(r,!0);r+=4;var l=i.getUint32(r,!0);if(r+=4,l===c.JSON){var h=new Uint8Array(e,s+r,a);this.content=pc.decodeText(h)}else if(l===c.BIN){var u=s+r;this.body=e.slice(u,u+a)}r+=a}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}function h(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=n.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t}function u(e){this.name=n.KHR_TEXTURE_TRANSFORM}function p(){return{name:n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,specularGlossinessParams:["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"],getMaterialType:function(){return mi},extendParams:function(e,t,n){var i=t.extensions[this.name],r=xn.standard,a=fn.clone(r.uniforms),o=["#ifdef USE_SPECULARMAP","\tuniform sampler2D specularMap;","#endif"].join("\n"),s=["#ifdef USE_GLOSSINESSMAP","\tuniform sampler2D glossinessMap;","#endif"].join("\n"),c=["vec3 specularFactor = specular;","#ifdef USE_SPECULARMAP","\tvec4 texelSpecular = texture2D( specularMap, vUv );","\ttexelSpecular = sRGBToLinear( texelSpecular );","\t// reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture","\tspecularFactor *= texelSpecular.rgb;","#endif"].join("\n"),l=["float glossinessFactor = glossiness;","#ifdef USE_GLOSSINESSMAP","\tvec4 texelGlossiness = texture2D( glossinessMap, vUv );","\t// reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture","\tglossinessFactor *= texelGlossiness.a;","#endif"].join("\n"),h=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb;","material.specularRoughness = clamp( 1.0 - glossinessFactor, 0.04, 1.0 );","material.specularColor = specularFactor.rgb;"].join("\n"),u=r.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;").replace("uniform float metalness;","uniform float glossiness;").replace("#include <roughnessmap_pars_fragment>",o).replace("#include <metalnessmap_pars_fragment>",s).replace("#include <roughnessmap_fragment>",c).replace("#include <metalnessmap_fragment>",l).replace("#include <lights_physical_fragment>",h);delete a.roughness,delete a.metalness,delete a.roughnessMap,delete a.metalnessMap,a.specular={value:(new gn).setHex(1118481)},a.glossiness={value:.5},a.specularMap={value:null},a.glossinessMap={value:null},e.vertexShader=r.vertexShader,e.fragmentShader=u,e.uniforms=a,e.defines={STANDARD:""},e.color=new gn(1,1,1),e.opacity=1;var p=[];if(Array.isArray(i.diffuseFactor)){var d=i.diffuseFactor;e.color.fromArray(d),e.opacity=d[3]}if(void 0!==i.diffuseTexture&&p.push(n.assignTexture(e,"map",i.diffuseTexture)),e.emissive=new gn(0,0,0),e.glossiness=void 0!==i.glossinessFactor?i.glossinessFactor:1,e.specular=new gn(1,1,1),Array.isArray(i.specularFactor)&&e.specular.fromArray(i.specularFactor),void 0!==i.specularGlossinessTexture){var f=i.specularGlossinessTexture;p.push(n.assignTexture(e,"glossinessMap",f)),p.push(n.assignTexture(e,"specularMap",f))}return Promise.all(p)},createMaterial:function(e){var t=new mi({defines:e.defines,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader,uniforms:e.uniforms,fog:!0,lights:!0,opacity:e.opacity,transparent:e.transparent});return t.isGLTFSpecularGlossinessMaterial=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t.extensions.derivatives=!0,t},cloneMaterial:function(e){var t=e.clone();t.isGLTFSpecularGlossinessMaterial=!0;for(var n=this.specularGlossinessParams,i=0,r=n.length;i<r;i++)t[n[i]]=e[n[i]];return t},refreshUniforms:function(e,t,n,i,r,a){if(!0===r.isGLTFSpecularGlossinessMaterial){var o,s=r.uniforms,c=r.defines;s.opacity.value=r.opacity,s.diffuse.value.copy(r.color),s.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity),s.map.value=r.map,s.specularMap.value=r.specularMap,s.alphaMap.value=r.alphaMap,s.lightMap.value=r.lightMap,s.lightMapIntensity.value=r.lightMapIntensity,s.aoMap.value=r.aoMap,s.aoMapIntensity.value=r.aoMapIntensity,r.map?o=r.map:r.specularMap?o=r.specularMap:r.displacementMap?o=r.displacementMap:r.normalMap?o=r.normalMap:r.bumpMap?o=r.bumpMap:r.glossinessMap?o=r.glossinessMap:r.alphaMap?o=r.alphaMap:r.emissiveMap&&(o=r.emissiveMap),void 0!==o&&(o.isWebGLRenderTarget&&(o=o.texture),!0===o.matrixAutoUpdate&&o.updateMatrix(),s.uvTransform.value.copy(o.matrix)),r.envMap&&(s.envMap.value=r.envMap,s.envMapIntensity.value=r.envMapIntensity,s.flipEnvMap.value=r.envMap.isCubeTexture?-1:1,s.reflectivity.value=r.reflectivity,s.refractionRatio.value=r.refractionRatio,s.maxMipLevel.value=e.properties.get(r.envMap).__maxMipLevel),s.specular.value.copy(r.specular),s.glossiness.value=r.glossiness,s.glossinessMap.value=r.glossinessMap,s.emissiveMap.value=r.emissiveMap,s.bumpMap.value=r.bumpMap,s.normalMap.value=r.normalMap,s.displacementMap.value=r.displacementMap,s.displacementScale.value=r.displacementScale,s.displacementBias.value=r.displacementBias,null!==s.glossinessMap.value&&void 0===c.USE_GLOSSINESSMAP&&(c.USE_GLOSSINESSMAP="",c.USE_ROUGHNESSMAP=""),null===s.glossinessMap.value&&void 0!==c.USE_GLOSSINESSMAP&&(delete c.USE_GLOSSINESSMAP,delete c.USE_ROUGHNESSMAP)}}}}function d(e,t,n,i){cs.call(this,e,t,n,i)}h.prototype.decodePrimitive=function(e,t){var n=this.json,i=this.dracoLoader,r=e.extensions[this.name].bufferView,a=e.extensions[this.name].attributes,o={},s={},c={};for(var l in a){var h=R[l]||l.toLowerCase();o[h]=a[l]}for(l in e.attributes){h=R[l]||l.toLowerCase();if(void 0!==a[l]){var u=n.accessors[e.attributes[l]],p=T[u.componentType];c[h]=p,s[h]=!0===u.normalized}}return t.getDependency("bufferView",r).then(function(e){return new Promise(function(t){i.decodeDracoFile(e,function(e){for(var n in e.attributes){var i=e.attributes[n],r=s[n];void 0!==r&&(i.normalized=r)}t(e)},o,c)})})},u.prototype.extendTexture=function(e,t){return e=e.clone(),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),void 0!==t.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),e.needsUpdate=!0,e},d.prototype=Object.create(cs.prototype),d.prototype.constructor=d,d.prototype.copySampleValue_=function(e){for(var t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=e*i*3+i,a=0;a!==i;a++)t[a]=n[r+a];return t},d.prototype.beforeStart_=d.prototype.copySampleValue_,d.prototype.afterEnd_=d.prototype.copySampleValue_,d.prototype.interpolate_=function(e,t,n,i){for(var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=2*o,c=3*o,l=i-t,h=(n-t)/l,u=h*h,p=u*h,d=e*c,f=d-c,m=-2*p+3*u,g=p-u,v=1-m,y=g-u+h,x=0;x!==o;x++){var b=a[f+x+o],w=a[f+x+s]*l,_=a[d+x+o],M=a[d+x]*l;r[x]=v*b+y*w+m*_+g*M}return r};var f,m=0,g=1,v=2,y=3,b=4,_=5,M=6,T=(Number,{5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array}),E={9728:be,9729:Me,9984:we,9985:Se,9986:_e,9987:Te},A={33071:ye,33648:xe,10497:ve},L={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},R={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},P={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},C={CUBICSPLINE:void 0,LINEAR:2301,STEP:2300},I="OPAQUE",O="MASK",D="BLEND",N={"image/png":Ge,"image/jpeg":ze};function U(e,t){return"string"!=typeof e||""===e?"":/^(https?:)?\/\//i.test(e)?e:/^data:.*,.*$/i.test(e)?e:/^blob:.*$/i.test(e)?e:t+e}function B(e,t,n){for(var i in n.extensions)void 0===e[i]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[i]=n.extensions[i])}function F(e,t){void 0!==t.extras&&("object"==typeof t.extras?e.userData=t.extras:console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function z(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(var n=0,i=t.weights.length;n<i;n++)e.morphTargetInfluences[n]=t.weights[n];if(t.extras&&Array.isArray(t.extras.targetNames)){var r=t.extras.targetNames;if(e.morphTargetInfluences.length===r.length){e.morphTargetDictionary={};for(n=0,i=r.length;n<i;n++)e.morphTargetDictionary[r[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function G(e){for(var t="",n=Object.keys(e).sort(),i=0,r=n.length;i<r;i++)t+=n[i]+":"+e[n[i]]+";";return t}function H(e){if(e.isInterleavedBufferAttribute){for(var t=e.count,n=e.itemSize,i=e.array.slice(0,t*n),r=0,a=0;r<t;++r)i[a++]=e.getX(r),n>=2&&(i[a++]=e.getY(r)),n>=3&&(i[a++]=e.getZ(r)),n>=4&&(i[a++]=e.getW(r));return new Nn(i,n,e.normalized)}return e.clone()}function V(e,n,i){this.json=e||{},this.extensions=n||{},this.options=i||{},this.cache=new t,this.primitiveCache={},this.textureLoader=new Ps(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.fileLoader=new Es(this.options.manager),this.fileLoader.setResponseType("arraybuffer")}function k(e,t,n){var i=t.attributes,r=[];function a(t,i){return n.getDependency("accessor",t).then(function(t){e.addAttribute(i,t)})}for(var o in i){var s=R[o]||o.toLowerCase();s in e.attributes||r.push(a(i[o],s))}if(void 0!==t.indices&&!e.index){var c=n.getDependency("accessor",t.indices).then(function(t){e.setIndex(t)});r.push(c)}return F(e,t),Promise.all(r).then(function(){return void 0!==t.targets?function(e,t,n){for(var i=!1,r=!1,a=0,o=t.length;a<o&&(void 0!==(l=t[a]).POSITION&&(i=!0),void 0!==l.NORMAL&&(r=!0),!i||!r);a++);if(!i&&!r)return Promise.resolve(e);var s=[],c=[];for(a=0,o=t.length;a<o;a++){var l=t[a];if(i){var h=void 0!==l.POSITION?n.getDependency("accessor",l.POSITION):e.attributes.position;s.push(h)}r&&(h=void 0!==l.NORMAL?n.getDependency("accessor",l.NORMAL):e.attributes.normal,c.push(h))}return Promise.all([Promise.all(s),Promise.all(c)]).then(function(n){for(var a=n[0],o=n[1],s=0,c=a.length;s<c;s++)e.attributes.position!==a[s]&&(a[s]=H(a[s]));for(s=0,c=o.length;s<c;s++)e.attributes.normal!==o[s]&&(o[s]=H(o[s]));for(s=0,c=t.length;s<c;s++){var l=t[s],h="morphTarget"+s;if(i&&void 0!==l.POSITION){var u=a[s];u.name=h;for(var p=e.attributes.position,d=0,f=u.count;d<f;d++)u.setXYZ(d,u.getX(d)+p.getX(d),u.getY(d)+p.getY(d),u.getZ(d)+p.getZ(d))}if(r&&void 0!==l.NORMAL){var m=o[s];m.name=h;var g=e.attributes.normal;for(d=0,f=m.count;d<f;d++)m.setXYZ(d,m.getX(d)+g.getX(d),m.getY(d)+g.getY(d),m.getZ(d)+g.getZ(d))}}return i&&(e.morphAttributes.position=a),r&&(e.morphAttributes.normal=o),e})}(e,t.targets,n):e})}return V.prototype.parse=function(e,t){var n=this,i=this.json,r=this.extensions;this.cache.removeAll(),this.markDefs(),Promise.all([this.getDependencies("scene"),this.getDependencies("animation"),this.getDependencies("camera")]).then(function(t){var a={scene:t[0][i.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:i.asset,parser:n,userData:{}};B(r,a,i),e(a)}).catch(t)},V.prototype.markDefs=function(){for(var e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[],i={},r={},a=0,o=t.length;a<o;a++)for(var s=t[a].joints,c=0,l=s.length;c<l;c++)e[s[c]].isBone=!0;for(var h=0,u=e.length;h<u;h++){var p=e[h];void 0!==p.mesh&&(void 0===i[p.mesh]&&(i[p.mesh]=r[p.mesh]=0),i[p.mesh]++,void 0!==p.skin&&(n[p.mesh].isSkinnedMesh=!0))}this.json.meshReferences=i,this.json.meshUses=r},V.prototype.getDependency=function(e,t){var i=e+":"+t,r=this.cache.get(i);if(!r){switch(e){case"scene":r=this.loadScene(t);break;case"node":r=this.loadNode(t);break;case"mesh":r=this.loadMesh(t);break;case"accessor":r=this.loadAccessor(t);break;case"bufferView":r=this.loadBufferView(t);break;case"buffer":r=this.loadBuffer(t);break;case"material":r=this.loadMaterial(t);break;case"texture":r=this.loadTexture(t);break;case"skin":r=this.loadSkin(t);break;case"animation":r=this.loadAnimation(t);break;case"camera":r=this.loadCamera(t);break;case"light":r=this.extensions[n.KHR_LIGHTS_PUNCTUAL].loadLight(t);break;default:throw new Error("Unknown type: "+e)}this.cache.add(i,r)}return r},V.prototype.getDependencies=function(e){var t=this.cache.get(e);if(!t){var n=this,i=this.json[e+("mesh"===e?"es":"s")]||[];t=Promise.all(i.map(function(t,i){return n.getDependency(e,i)})),this.cache.add(e,t)}return t},V.prototype.loadBuffer=function(e){var t=this.json.buffers[e],i=this.fileLoader;if(t.type&&"arraybuffer"!==t.type)throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(void 0===t.uri&&0===e)return Promise.resolve(this.extensions[n.KHR_BINARY_GLTF].body);var r=this.options;return new Promise(function(e,n){i.load(U(t.uri,r.path),e,void 0,function(){n(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})},V.prototype.loadBufferView=function(e){var t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(e){var n=t.byteLength||0,i=t.byteOffset||0;return e.slice(i,i+n)})},V.prototype.loadAccessor=function(e){var t=this,n=this.json,i=this.json.accessors[e];if(void 0===i.bufferView&&void 0===i.sparse)return Promise.resolve(null);var r=[];return void 0!==i.bufferView?r.push(this.getDependency("bufferView",i.bufferView)):r.push(null),void 0!==i.sparse&&(r.push(this.getDependency("bufferView",i.sparse.indices.bufferView)),r.push(this.getDependency("bufferView",i.sparse.values.bufferView))),Promise.all(r).then(function(e){var r,a=e[0],o=L[i.type],s=T[i.componentType],c=s.BYTES_PER_ELEMENT,l=c*o,h=i.byteOffset||0,u=void 0!==i.bufferView?n.bufferViews[i.bufferView].byteStride:void 0,p=!0===i.normalized;if(u&&u!==l){var d="InterleavedBuffer:"+i.bufferView+":"+i.componentType,f=t.cache.get(d);f||(f=new ya(new s(a),u/c),t.cache.add(d,f)),r=new xa(f,o,h/c,p)}else r=new Nn(null===a?new s(i.count*o):new s(a,h,i.count*o),o,p);if(void 0!==i.sparse){var m=L.SCALAR,g=T[i.sparse.indices.componentType],v=i.sparse.indices.byteOffset||0,y=i.sparse.values.byteOffset||0,x=new g(e[1],v,i.sparse.count*m),b=new s(e[2],y,i.sparse.count*o);null!==a&&r.setArray(r.array.slice());for(var w=0,_=x.length;w<_;w++){var M=x[w];if(r.setX(M,b[w*o]),o>=2&&r.setY(M,b[w*o+1]),o>=3&&r.setZ(M,b[w*o+2]),o>=4&&r.setW(M,b[w*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return r})},V.prototype.loadTexture=function(e){var t,i=this,r=this.json,a=this.options,o=this.textureLoader,s=window.URL||window.webkitURL,c=r.textures[e],l=c.extensions||{},h=(t=l[n.MSFT_TEXTURE_DDS]?r.images[l[n.MSFT_TEXTURE_DDS].source]:r.images[c.source]).uri,u=!1;return void 0!==t.bufferView&&(h=i.getDependency("bufferView",t.bufferView).then(function(e){u=!0;var n=new Blob([e],{type:t.mimeType});return h=s.createObjectURL(n)})),Promise.resolve(h).then(function(e){var t=Lc.Handlers.get(e);return t||(t=l[n.MSFT_TEXTURE_DDS]?i.extensions[n.MSFT_TEXTURE_DDS].ddsLoader:o),new Promise(function(n,i){t.load(U(e,a.path),n,void 0,i)})}).then(function(e){!0===u&&s.revokeObjectURL(h),e.flipY=!1,void 0!==c.name&&(e.name=c.name),t.mimeType in N&&(e.format=N[t.mimeType]);var n=(r.samplers||{})[c.sampler]||{};return e.magFilter=E[n.magFilter]||Me,e.minFilter=E[n.minFilter]||Te,e.wrapS=A[n.wrapS]||ve,e.wrapT=A[n.wrapT]||ve,e})},V.prototype.assignTexture=function(e,t,i){var r=this;return this.getDependency("texture",i.index).then(function(a){switch(t){case"aoMap":case"emissiveMap":case"metalnessMap":case"normalMap":case"roughnessMap":a.format=ze}if(r.extensions[n.KHR_TEXTURE_TRANSFORM]){var o=void 0!==i.extensions?i.extensions[n.KHR_TEXTURE_TRANSFORM]:void 0;o&&(a=r.extensions[n.KHR_TEXTURE_TRANSFORM].extendTexture(a,o))}e[t]=a})},V.prototype.assignFinalMaterial=function(e){var t=e.geometry,i=e.material,r=this.extensions,a=void 0!==t.attributes.tangent,o=void 0!==t.attributes.color,s=void 0===t.attributes.normal,c=!0===e.isSkinnedMesh,l=Object.keys(t.morphAttributes).length>0,h=l&&void 0!==t.morphAttributes.normal;if(e.isPoints){var u="PointsMaterial:"+i.uuid,p=this.cache.get(u);p||(p=new Pa,ei.prototype.copy.call(p,i),p.color.copy(i.color),p.map=i.map,p.lights=!1,this.cache.add(u,p)),i=p}else if(e.isLine){u="LineBasicMaterial:"+i.uuid;var d=this.cache.get(u);d||(d=new Ea,ei.prototype.copy.call(d,i),d.color.copy(i.color),d.lights=!1,this.cache.add(u,d)),i=d}if(a||o||s||c||l){u="ClonedMaterial:"+i.uuid+":";i.isGLTFSpecularGlossinessMaterial&&(u+="specular-glossiness:"),c&&(u+="skinning:"),a&&(u+="vertex-tangents:"),o&&(u+="vertex-colors:"),s&&(u+="flat-shading:"),l&&(u+="morph-targets:"),h&&(u+="morph-normals:");var f=this.cache.get(u);f||(f=i.isGLTFSpecularGlossinessMaterial?r[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].cloneMaterial(i):i.clone(),c&&(f.skinning=!0),a&&(f.vertexTangents=!0),o&&(f.vertexColors=S),s&&(f.flatShading=!0),l&&(f.morphTargets=!0),h&&(f.morphNormals=!0),this.cache.add(u,f)),i=f}i.aoMap&&void 0===t.attributes.uv2&&void 0!==t.attributes.uv&&(console.log("THREE.GLTFLoader: Duplicating UVs to support aoMap."),t.addAttribute("uv2",new Nn(t.attributes.uv.array,2))),i.isGLTFSpecularGlossinessMaterial&&(e.onBeforeRender=r[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].refreshUniforms),e.material=i},V.prototype.loadMaterial=function(e){var t,i=this.json,r=this.extensions,a=i.materials[e],o={},s=a.extensions||{},c=[];if(s[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var l=r[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];t=l.getMaterialType(a),c.push(l.extendParams(o,a,this))}else if(s[n.KHR_MATERIALS_UNLIT]){var h=r[n.KHR_MATERIALS_UNLIT];t=h.getMaterialType(a),c.push(h.extendParams(o,a,this))}else{t=Qo;var u=a.pbrMetallicRoughness||{};if(o.color=new gn(1,1,1),o.opacity=1,Array.isArray(u.baseColorFactor)){var p=u.baseColorFactor;o.color.fromArray(p),o.opacity=p[3]}void 0!==u.baseColorTexture&&c.push(this.assignTexture(o,"map",u.baseColorTexture)),o.metalness=void 0!==u.metallicFactor?u.metallicFactor:1,o.roughness=void 0!==u.roughnessFactor?u.roughnessFactor:1,void 0!==u.metallicRoughnessTexture&&(c.push(this.assignTexture(o,"metalnessMap",u.metallicRoughnessTexture)),c.push(this.assignTexture(o,"roughnessMap",u.metallicRoughnessTexture)))}!0===a.doubleSided&&(o.side=w);var d=a.alphaMode||I;return d===D?o.transparent=!0:(o.transparent=!1,d===O&&(o.alphaTest=void 0!==a.alphaCutoff?a.alphaCutoff:.5)),void 0!==a.normalTexture&&t!==yi&&(c.push(this.assignTexture(o,"normalMap",a.normalTexture)),o.normalScale=new It(1,1),void 0!==a.normalTexture.scale&&o.normalScale.set(a.normalTexture.scale,a.normalTexture.scale)),void 0!==a.occlusionTexture&&t!==yi&&(c.push(this.assignTexture(o,"aoMap",a.occlusionTexture)),void 0!==a.occlusionTexture.strength&&(o.aoMapIntensity=a.occlusionTexture.strength)),void 0!==a.emissiveFactor&&t!==yi&&(o.emissive=(new gn).fromArray(a.emissiveFactor)),void 0!==a.emissiveTexture&&t!==yi&&c.push(this.assignTexture(o,"emissiveMap",a.emissiveTexture)),Promise.all(c).then(function(){var e;return e=t===mi?r[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(o):new t(o),void 0!==a.name&&(e.name=a.name),e.map&&(e.map.encoding=wt),e.emissiveMap&&(e.emissiveMap.encoding=wt),e.specularMap&&(e.specularMap.encoding=wt),F(e,a),a.extensions&&B(r,e,a),e})},V.prototype.loadGeometries=function(e){var t=this,i=this.extensions,r=this.primitiveCache;function a(e){return i[n.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then(function(n){return k(n,e,t)})}for(var o,s,c=[],l=0,h=e.length;l<h;l++){var u,p=e[l],d=(s=void 0,(s=(o=p).extensions&&o.extensions[n.KHR_DRACO_MESH_COMPRESSION])?"draco:"+s.bufferView+":"+s.indices+":"+G(s.attributes):o.indices+":"+G(o.attributes)+":"+o.mode),f=r[d];if(f)c.push(f.promise);else u=p.extensions&&p.extensions[n.KHR_DRACO_MESH_COMPRESSION]?a(p):k(new Yn,p,t),r[d]={primitive:p,promise:u},c.push(u)}return Promise.all(c)},V.prototype.loadMesh=function(e){for(var t=this,n=this.json,i=(this.extensions,n.meshes[e]),r=i.primitives,a=[],o=0,s=r.length;o<s;o++){var c=void 0===r[o].material?f=f||new Qo({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:x}):this.getDependency("material",r[o].material);a.push(c)}return Promise.all(a).then(function(n){return t.loadGeometries(r).then(function(a){for(var o=[],s=0,c=a.length;s<c;s++){var l,h=a[s],u=r[s],p=n[s];if(u.mode===b||u.mode===_||u.mode===M||void 0===u.mode)!0===(l=!0===i.isSkinnedMesh?new Ma(h,p):new xi(h,p)).isSkinnedMesh&&l.normalizeSkinWeights(),u.mode===_?l.drawMode=yt:u.mode===M&&(l.drawMode=xt);else if(u.mode===g)l=new La(h,p);else if(u.mode===y)l=new Aa(h,p);else if(u.mode===v)l=new Ra(h,p);else{if(u.mode!==m)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+u.mode);l=new Ca(h,p)}Object.keys(l.geometry.morphAttributes).length>0&&z(l,i),l.name=i.name||"mesh_"+e,a.length>1&&(l.name+="_"+s),F(l,i),t.assignFinalMaterial(l),o.push(l)}if(1===o.length)return o[0];var d=new $r;for(s=0,c=o.length;s<c;s++)d.add(o[s]);return d})})},V.prototype.loadCamera=function(e){var t,n=this.json.cameras[e],i=n[n.type];if(i)return"perspective"===n.type?t=new ta(Ct.radToDeg(i.yfov),i.aspectRatio||1,i.znear||1,i.zfar||2e6):"orthographic"===n.type&&(t=new oc(i.xmag/-2,i.xmag/2,i.ymag/2,i.ymag/-2,i.znear,i.zfar)),void 0!==n.name&&(t.name=n.name),F(t,n),Promise.resolve(t);console.warn("THREE.GLTFLoader: Missing camera parameters.")},V.prototype.loadSkin=function(e){var t=this.json.skins[e],n={joints:t.joints};return void 0===t.inverseBindMatrices?Promise.resolve(n):this.getDependency("accessor",t.inverseBindMatrices).then(function(e){return n.inverseBindMatrices=e,n})},V.prototype.loadAnimation=function(e){for(var t=this.json.animations[e],n=[],i=[],r=[],a=[],o=[],s=0,c=t.channels.length;s<c;s++){var l=t.channels[s],h=t.samplers[l.sampler],u=l.target,p=void 0!==u.node?u.node:u.id,f=void 0!==t.parameters?t.parameters[h.input]:h.input,m=void 0!==t.parameters?t.parameters[h.output]:h.output;n.push(this.getDependency("node",p)),i.push(this.getDependency("accessor",f)),r.push(this.getDependency("accessor",m)),a.push(h),o.push(u)}return Promise.all([Promise.all(n),Promise.all(i),Promise.all(r),Promise.all(a),Promise.all(o)]).then(function(n){for(var i=n[0],r=n[1],a=n[2],o=n[3],s=n[4],c=[],l=0,h=i.length;l<h;l++){var u=i[l],p=r[l],f=a[l],m=o[l],g=s[l];if(void 0!==u){var v;switch(u.updateMatrix(),u.matrixAutoUpdate=!0,P[g.path]){case P.weights:v=ms;break;case P.rotation:v=vs;break;case P.position:case P.scale:default:v=xs}var y=u.name?u.name:u.uuid,x=void 0!==m.interpolation?C[m.interpolation]:2301,b=[];P[g.path]===P.weights?u.traverse(function(e){!0===e.isMesh&&e.morphTargetInfluences&&b.push(e.name?e.name:e.uuid)}):b.push(y);for(var w=0,_=b.length;w<_;w++){var M=new v(b[w]+"."+P[g.path],p.array,f.array,x);"CUBICSPLINE"===m.interpolation&&(M.createInterpolant=function(e){return new d(this.times,this.values,this.getValueSize()/3,e)},M.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),c.push(M)}}}return new bs(void 0!==t.name?t.name:"animation_"+e,void 0,c)})},V.prototype.loadNode=function(e){var t=this.json,i=this.extensions,r=this,a=t.meshReferences,o=t.meshUses,s=t.nodes[e];return(!0===s.isBone?Promise.resolve(new Ta):void 0!==s.mesh?r.getDependency("mesh",s.mesh).then(function(e){var t;if(a[s.mesh]>1){var n=o[s.mesh]++;(t=e.clone()).name+="_instance_"+n,t.onBeforeRender=e.onBeforeRender;for(var i=0,r=t.children.length;i<r;i++)t.children[i].name+="_instance_"+n,t.children[i].onBeforeRender=e.children[i].onBeforeRender}else t=e;return void 0!==s.weights&&t.traverse(function(e){if(e.isMesh)for(var t=0,n=s.weights.length;t<n;t++)e.morphTargetInfluences[t]=s.weights[t]}),t}):void 0!==s.camera?r.getDependency("camera",s.camera):s.extensions&&s.extensions[n.KHR_LIGHTS_PUNCTUAL]&&void 0!==s.extensions[n.KHR_LIGHTS_PUNCTUAL].light?r.getDependency("light",s.extensions[n.KHR_LIGHTS_PUNCTUAL].light):Promise.resolve(new Pn)).then(function(e){if(void 0!==s.name&&(e.name=hl.sanitizeNodeName(s.name)),F(e,s),s.extensions&&B(i,e,s),void 0!==s.matrix){var t=new sn;t.fromArray(s.matrix),e.applyMatrix(t)}else void 0!==s.translation&&e.position.fromArray(s.translation),void 0!==s.rotation&&e.quaternion.fromArray(s.rotation),void 0!==s.scale&&e.scale.fromArray(s.scale);return e})},V.prototype.loadScene=function(){function e(t,n,i,r){var a=i.nodes[t];return r.getDependency("node",t).then(function(e){return void 0===a.skin?e:r.getDependency("skin",a.skin).then(function(e){for(var n=[],i=0,a=(t=e).joints.length;i<a;i++)n.push(r.getDependency("node",t.joints[i]));return Promise.all(n)}).then(function(n){for(var i=!0===e.isGroup?e.children:[e],r=0,a=i.length;r<a;r++){for(var o=i[r],s=[],c=[],l=0,h=n.length;l<h;l++){var u=n[l];if(u){s.push(u);var p=new sn;void 0!==t.inverseBindMatrices&&p.fromArray(t.inverseBindMatrices.array,16*l),c.push(p)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[l])}o.bind(new Sa(s,c),o.matrixWorld)}return e});var t}).then(function(t){n.add(t);var o=[];if(a.children)for(var s=a.children,c=0,l=s.length;c<l;c++){var h=s[c];o.push(e(h,t,i,r))}return Promise.all(o)})}return function(t){var n=this.json,i=this.extensions,r=this.json.scenes[t],a=new va;void 0!==r.name&&(a.name=r.name),F(a,r),r.extensions&&B(i,a,r);for(var o=r.nodes||[],s=[],c=0,l=o.length;c<l;c++)s.push(e(o[c],a,n,this));return Promise.all(s).then(function(){return a})}}(),e}(),Hl=n(2);class Vl{constructor(e){this.manager=e||r.DefaultLoadingManager,this.gltfLoader=new Gl(this.manager)}load(e,t,n,i){this.gltfLoader.load(e,e=>{(new Hl.b).fromGLTF(e).then(e=>{t(e)})},n,i)}setCrossOrigin(e){return this.gltfLoader.setCrossOrigin(e),this}setPath(e){return this.gltfLoader.setPath(e),this}setDRACOLoader(e){return this.gltfLoader.setDRACOLoader(e),this}}n.d(t,"a",function(){return o}),n.d(t,"b",function(){return Vl})},function(e,t,n){"use strict";var i=n(0),r=n(1);class a{constructor(e){this.iks=e||[],this.validate()}update(){const e=new i.Quaternion,t=new i.Vector3,n=new i.Vector3,r=new i.Vector3,a=new i.Vector3,o=new i.Vector3,s=new i.Quaternion,c=new i.Vector3,l=new i.Vector3,h=new i.Vector3;return this.iks.forEach(i=>{t.setFromMatrixPosition(i.target.matrixWorld);for(let u=void 0!==i.iteration?i.iteration:1;u>0;u--){let u=!0,p=!1;if(i.links.forEach(d=>{if(p||!1===d.enabled)return void(p=!0);d.bone.matrixWorld.decompose(o,s,c),s.inverse(),r.setFromMatrixPosition(i.effector.matrixWorld),a.subVectors(r,o),a.applyQuaternion(s),a.normalize(),n.subVectors(t,o),n.applyQuaternion(s),n.normalize();let f=n.dot(a);if(f>1?f=1:f<-1&&(f=-1),!((f=Math.acos(f))<1e-5)){if(void 0!==i.minAngle&&f<i.minAngle&&(f=i.minAngle),void 0!==i.maxAngle&&f>i.maxAngle&&(f=i.maxAngle),l.crossVectors(a,n),l.normalize(),e.setFromAxisAngle(l,f),d.bone.quaternion.multiply(e),d.limitation){let e=d.bone.quaternion.w;e>1&&(e=1);const t=Math.sqrt(1-e*e);d.bone.quaternion.set(d.limitation.x*t,d.limitation.y*t,d.limitation.z*t,e)}d.rotationMin&&d.bone.rotation.setFromVector3(d.bone.rotation.toVector3(h).max(d.rotationMin)),d.rotationMax&&d.bone.rotation.setFromVector3(d.bone.rotation.toVector3(h).min(d.rotationMax)),d.bone.updateMatrixWorld(!0),u=!1}}),u)break}}),this}validate(){this.iks.forEach(e=>{let t,n=e.effector;e.links.forEach(e=>{t=e.bone,n.parent!==t&&console.warn("CCDIKSolver: bone "+n.name+" is not the child of bone "+t.name),n=t})})}}const o="VRMIK";class s{constructor(e){if(e.userData[o])this.copy(e.userData[o]);else{e.userData[o]=this,this.vrm=e,this.iks=[];{const e=this.vrm.model.getObjectByName("左足IK"),t=this.vrm.getNodeByHumanBoneName("leftFoot");this.iks[c.LeftFoot]={enabled:!0,target:e,solver:new a([{target:e,effector:t,links:[{bone:this.vrm.getNodeByHumanBoneName("leftLowerLeg"),rotationMin:new i.Vector3(-1*Math.PI,0,0),rotationMax:new i.Vector3(-5/180*Math.PI,0,0)},{bone:this.vrm.getNodeByHumanBoneName("leftUpperLeg"),rotationMin:new i.Vector3(-.5*Math.PI,-.5*Math.PI,-1*Math.PI),rotationMax:new i.Vector3(1*Math.PI,.5*Math.PI,.25*Math.PI)}],iteration:128}])}}{const e=this.vrm.model.getObjectByName("右足IK"),t=this.vrm.getNodeByHumanBoneName("rightFoot");this.iks[c.RightFoot]={enabled:!0,target:e,solver:new a([{target:e,effector:t,links:[{bone:this.vrm.getNodeByHumanBoneName("rightLowerLeg"),rotationMin:new i.Vector3(-1*Math.PI,0,0),rotationMax:new i.Vector3(-5/180*Math.PI,0,0)},{bone:this.vrm.getNodeByHumanBoneName("rightUpperLeg"),rotationMin:new i.Vector3(-.5*Math.PI,-.5*Math.PI,-.25*Math.PI),rotationMax:new i.Vector3(1*Math.PI,.5*Math.PI,1*Math.PI)}],iteration:128}])}}{const e=this.vrm.model.getObjectByName("左つま先IK"),t=this.vrm.getNodeByHumanBoneName("leftToes");this.iks[c.LeftToes]={enabled:!0,target:e,solver:new a([{target:e,effector:t,links:[{bone:this.vrm.getNodeByHumanBoneName("leftFoot"),rotationMin:new i.Vector3(-1*Math.PI,-1*Math.PI,-5/180*Math.PI),rotationMax:new i.Vector3(.25*Math.PI,1*Math.PI,5/180*Math.PI)}],iteration:2}])}}{const e=this.vrm.model.getObjectByName("右つま先IK"),t=this.vrm.getNodeByHumanBoneName("rightToes");this.iks[c.RightToes]={enabled:!0,target:e,solver:new a([{target:e,effector:t,links:[{bone:this.vrm.getNodeByHumanBoneName("rightFoot"),rotationMin:new i.Vector3(-1*Math.PI,-1*Math.PI,-5/180*Math.PI),rotationMax:new i.Vector3(.25*Math.PI,1*Math.PI,5/180*Math.PI)}],iteration:2}])}}this.iks.forEach(e=>{e.target.userData[r.USERDATA_KEY_VRM]={},e.target.userData[r.USERDATA_KEY_VRM].default={position:e.target.position.clone(),quaternion:e.target.quaternion.clone()}})}}update(){this.iks.forEach(e=>{e.enabled&&e.solver.update()})}copy(e){this.vrm=e.vrm,this.iks=e.iks}getTarget(e){return this.iks[e].target}}var c;!function(e){e[e.LeftFoot=0]="LeftFoot",e[e.RightFoot=1]="RightFoot",e[e.LeftToes=2]="LeftToes",e[e.RightToes=3]="RightToes"}(c||(c={}));class l{constructor(e){this.vrm=e,this.sphereColliderGroups=this.vrm.secondaryAnimation.colliderGroups.map(e=>{const t=new p(this.vrm.getNode(e.node));return e.colliders.forEach(e=>{t.createSphereCollider(new i.Vector3(e.offset.x,e.offset.y,-e.offset.z),e.radius)}),t}),this.springBoneGroups=this.vrm.secondaryAnimation.boneGroups.map(e=>{const t=new h;return t.stiffnessForce=e.stiffiness,t.gravityPower=e.gravityPower,t.gravityDirection=new i.Vector3(e.gravityDir.x,e.gravityDir.y,e.gravityDir.z).normalize(),t.dragForce=e.dragForce,t.center=-1!==e.center?this.vrm.getNode(e.center):void 0,t.hitRadius=e.hitRadius,e.bones.forEach(e=>{this.vrm.getNode(e).traverse(e=>{"Bone"===e.type&&t.springBones.push(new u(t,e))})}),t.sphereColliderGroups=e.colliderGroups.map(e=>this.sphereColliderGroups[e]),t})}reset(){return this.springBoneGroups.forEach(e=>{e.reset()}),this}update(e){return this.sphereColliderGroups.forEach(e=>{e.update()}),this.springBoneGroups.forEach(t=>{t.update(e)}),this}}class h{constructor(){this.stiffnessForce=1,this.gravityPower=1,this.gravityDirection=new i.Vector3(0,-1,0),this.dragForce=.4,this.hitRadius=.02,this.springBones=[],this.sphereColliderGroups=[]}reset(){this.springBones.forEach(e=>{e.reset()})}update(e){this.springBones.forEach(t=>{t.update(e)})}}class u{constructor(e,t){this.group=e,this.bone=t,this.initialQuaternion=t.quaternion.clone(),this.length=this.bone.userData[r.USERDATA_KEY_VRM].bone.length,this.boneAxis=this.bone.userData[r.USERDATA_KEY_VRM].bone.axis;const n=this.bone.localToWorld(this.boneAxis.clone().multiplyScalar(this.length));this.currentTailWorldPosition=this.group.center?this.group.center.worldToLocal(n):n,this.previousTailWorldPosition=this.currentTailWorldPosition.clone()}reset(){this.bone.setRotationFromQuaternion(this.initialQuaternion)}update(e){const t=this.group.center?this.group.center.localToWorld(this.previousTailWorldPosition):this.previousTailWorldPosition,n=this.group.center?this.group.center.localToWorld(this.currentTailWorldPosition):this.currentTailWorldPosition,r=n.clone();r.add(n.clone().sub(t).multiplyScalar(1-this.group.dragForce)),r.add(this.boneAxis.clone().applyQuaternion(this.bone.parent.getWorldQuaternion(new i.Quaternion).multiply(this.initialQuaternion)).multiplyScalar(e*this.group.stiffnessForce)),r.add(this.group.gravityDirection.clone().multiplyScalar(e*this.group.gravityPower));const a=this.bone.getWorldPosition(new i.Vector3);r.sub(a).normalize().multiplyScalar(this.length).add(a),this.group.sphereColliderGroups.forEach(e=>{e.colliders.forEach(e=>{const t=this.group.hitRadius+e.radius,n=r.clone().sub(e.worldPosition);if(n.lengthSq()<=t*t){n.normalize().multiplyScalar(t).add(e.worldPosition),r.set(n.x,n.y,n.z);const a=this.bone.getWorldPosition(new i.Vector3);r.sub(a).normalize().multiplyScalar(this.length).add(a)}})}),this.previousTailWorldPosition=this.group.center?this.group.center.worldToLocal(n):n,this.currentTailWorldPosition=this.group.center?this.group.center.worldToLocal(r):r,this.bone.setRotationFromQuaternion(this.tailPositionToQuaternion(r))}tailPositionToQuaternion(e){const t=this.bone.parent.getWorldQuaternion(new i.Quaternion).multiply(this.initialQuaternion),n=this.boneAxis.clone().applyQuaternion(t).normalize(),r=e.clone().sub(this.bone.getWorldPosition(new i.Vector3)).normalize();return(new i.Quaternion).setFromUnitVectors(n,r).multiply(t).premultiply(t.inverse())}}class p{constructor(e){this.object3d=e,this.colliders=[]}createSphereCollider(e,t){this.colliders.push(new d(this,e,t))}update(){this.colliders.forEach(e=>{e.update()})}}class d{constructor(e,t,n){this.group=e,this.offset=t.clone(),this.radius=n,this.worldPosition=new i.Vector3,this.update()}update(){this.worldPosition=this.group.object3d.localToWorld(this.offset.clone())}}n.d(t,"a",function(){return o}),n.d(t,"c",function(){return s}),n.d(t,"b",function(){return c}),n.d(t,"d",function(){return l})},function(e,t,n){"use strict";var i=n(0),r=n(1);function a(e,t,n,i){return r=>new o(e,t,n,r,new Float32Array(i))}class o extends i.Interpolant{constructor(e,t,n,i,r){super(e,t,n,i),this.interpolationParams=r}interpolate_(e,t,n,r){const a=this.resultBuffer,o=this.sampleValues,s=this.valueSize,c=this.interpolationParams,l=e*s,h=l-s,u=r-t<.05?0:(n-t)/(r-t);if(4===s){const t=c[4*e+0],n=c[4*e+1],r=c[4*e+2],s=c[4*e+3],p=this._calculate(t,n,r,s,u);i.Quaternion.slerpFlat(a,0,o,h,o,l,p)}else if(3===s)for(let t=0;t!==s;++t){const n=c[12*e+4*t+0],i=c[12*e+4*t+1],r=c[12*e+4*t+2],s=c[12*e+4*t+3],p=this._calculate(n,i,r,s,u);a[t]=o[h+t]*(1-p)+o[l+t]*p}else{const t=c[4*e+0],n=c[4*e+1],i=c[4*e+2],r=c[4*e+3],s=this._calculate(t,n,i,r,u);a[0]=o[h]*(1-s)+o[l]*s}return a}_calculate(e,t,n,i,r){let a=.5,o=a,s=1-o;const c=Math;let l,h,u;for(let n=0;n<15;n++){const n=(l=3*s*s*o)*e+(h=3*s*o*o)*t+(u=o*o*o)-r;if(c.abs(n)<1e-5)break;a/=2,s=1-(o+=n<0?a:-a)}return l*n+h*i+u}}n.d(t,"a",function(){return s});class s{constructor(){this.metadata={magic:"",name:"",coordinateSystem:"right",motionCount:0,morphCount:0,cameraCount:0},this.motions=[],this.morphs=[],this.cameras=[]}fromObject(e){return Object.assign(this,e),this}toAnimationClipForVRM(e){const t=new Map;this.motions.forEach(e=>{t.has(e.boneName)?t.get(e.boneName).push(e):t.set(e.boneName,[e])}),t.forEach(e=>{e.sort((e,t)=>e.frameNum-t.frameNum)});const n=new Map;this.morphs.forEach(e=>{n.has(e.morphName)?n.get(e.morphName).push(e):n.set(e.morphName,[e])}),n.forEach(e=>{e.sort((e,t)=>e.frameNum-t.frameNum)});const o=[],s=new i.Vector3(0,0,-1),h=new Map([["leftShoulder",(new i.Quaternion).setFromAxisAngle(s,-5/180*Math.PI)],["rightShoulder",(new i.Quaternion).setFromAxisAngle(s,5/180*Math.PI)],["leftUpperArm",(new i.Quaternion).setFromAxisAngle(s,-35/180*Math.PI)],["rightUpperArm",(new i.Quaternion).setFromAxisAngle(s,35/180*Math.PI)]]);return t.forEach((t,n)=>{const s=c.get(n);let l;if(!(l=s?e.getNodeByHumanBoneName(s):e.model.getObjectByName(n)))return void console.warn(`VMD.toAnimationClipForVRM : Bone '${n}' not found.`);const u=h.get(s),p=[],d=[],f=[],m=[],g=[];t.forEach(e=>{p.push(e.frameNum/30);const t=new i.Vector3(-e.position[0],e.position[1],-e.position[2]).multiplyScalar(.08).add(l.userData[r.USERDATA_KEY_VRM].default.position);d.push(t.x,t.y,t.z);const n=new i.Quaternion(e.rotation[0],-e.rotation[1],e.rotation[2],-e.rotation[3]);u&&n.multiply(u),f.push(n.x,n.y,n.z,n.w);for(let t=0;t<3;t++)m.push(e.interpolation[t+0]/127,e.interpolation[t+8]/127,e.interpolation[t+4]/127,e.interpolation[t+12]/127);g.push(e.interpolation[3]/127,e.interpolation[11]/127,e.interpolation[7]/127,e.interpolation[15]/127)});const v=new i.VectorKeyframeTrack(`${l.uuid}.position`,p,d),y=new i.QuaternionKeyframeTrack(`${l.uuid}.quaternion`,p,f);v.createInterpolant=a(p,d,3,m),y.createInterpolant=a(p,f,4,g),o.push(v),o.push(y)}),n.forEach((t,n)=>{const r=l.get(n)||n,a=e.blendShapeMaster.blendShapeGroups.find(e=>e.name===r);a&&a.binds.forEach(n=>{e.getSubMeshesByIndex(n.mesh).forEach(e=>{const r=[],a=[];t.forEach(e=>{r.push(e.frameNum/30),a.push(n.weight/100*e.weight)}),o.push(new i.NumberKeyframeTrack(`${e.uuid}.morphTargetInfluences[morphTarget${n.index}]`,r,a))})})}),new i.AnimationClip(i.Math.generateUUID(),-1,o)}}const c=new Map([["腰","hips"],["左足","leftUpperLeg"],["左ひざ","leftLowerLeg"],["左足首","leftFoot"],["左つま先","leftToes"],["右足","rightUpperLeg"],["右ひざ","rightLowerLeg"],["右足首","rightFoot"],["右つま先","rightToes"],["下半身","spine"],["上半身","chest"],["上半身2","upperChest"],["首","neck"],["頭","head"],["左目","leftEye"],["右目","rightEye"],["左肩","leftShoulder"],["左腕","leftUpperArm"],["左ひじ","leftLowerArm"],["左手首","leftHand"],["右肩","rightShoulder"],["右腕","rightUpperArm"],["右ひじ","rightLowerArm"],["右手首","rightHand"],["左親指0","leftThumbProximal"],["左親指1","leftThumbIntermediate"],["左親指2","leftThumbDistal"],["左人指1","leftIndexProximal"],["左人指2","leftIndexIntermediate"],["左人指3","leftIndexDistal"],["左中指1","leftMiddleProximal"],["左中指2","leftMiddleIntermediate"],["左中指3","leftMiddleDistal"],["左薬指1","leftRingProximal"],["左薬指2","leftRingIntermediate"],["左薬指3","leftRingDistal"],["左小指1","leftLittleProximal"],["左小指2","leftLittleIntermediate"],["左小指3","leftLittleDistal"],["右親指0","rightThumbProximal"],["右親指1","rightThumbIntermediate"],["右親指2","rightThumbDistal"],["右人指1","rightIndexProximal"],["右人指2","rightIndexIntermediate"],["右人指3","rightIndexDistal"],["右中指1","rightMiddleProximal"],["右中指2","rightMiddleIntermediate"],["右中指3","rightMiddleDistal"],["右薬指1","rightRingProximal"],["右薬指2","rightRingIntermediate"],["右薬指3","rightRingDistal"],["右小指1","rightLittleProximal"],["右小指2","rightLittleIntermediate"],["右小指3","rightLittleDistal"]]),l=new Map([["困る","Sorrow"],["にこり","Joy"],["怒り","Angry"],["まばたき","Blink"],["笑い","Fun"],["ウィンク","Blink_L"],["ウィンク2","Blink_L"],["ウィンク右","Blink_R"],["ウィンク2右","Blink_R"],["あ","A"],["い","I"],["う","U"],["お","O"],["えー","E"]])},function(e,t,n){!function(e){"use strict";function t(){}function n(e,n){this.dv=new DataView(e),this.offset=0,this.littleEndian=void 0===n||n,this.encoder=new t}function i(){}function r(){}t.prototype.s2u=function(e){for(var t=this.s2uTable,n="",i=0;i<e.length;){var r=e[i++];if(!(r>=0&&r<=126||r>=161&&r<=223)&&i<e.length&&(r=r<<8|e[i++]),void 0===t[r])throw"unknown char code "+r+".";n+=String.fromCharCode(t[r])}return n},t.prototype.s2uTable={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,10:10,11:11,12:12,13:13,14:14,15:15,16:16,17:17,18:18,19:19,20:20,21:21,22:22,23:23,24:24,25:25,26:26,27:27,28:28,29:29,30:30,31:31,32:32,33:33,34:34,35:35,36:36,37:37,38:38,39:39,40:40,41:41,42:42,43:43,44:44,45:45,46:46,47:47,48:48,49:49,50:50,51:51,52:52,53:53,54:54,55:55,56:56,57:57,58:58,59:59,60:60,61:61,62:62,63:63,64:64,65:65,66:66,67:67,68:68,69:69,70:70,71:71,72:72,73:73,74:74,75:75,76:76,77:77,78:78,79:79,80:80,81:81,82:82,83:83,84:84,85:85,86:86,87:87,88:88,89:89,90:90,91:91,92:92,93:93,94:94,95:95,96:96,97:97,98:98,99:99,100:100,101:101,102:102,103:103,104:104,105:105,106:106,107:107,108:108,109:109,110:110,111:111,112:112,113:113,114:114,115:115,116:116,117:117,118:118,119:119,120:120,121:121,122:122,123:123,124:124,125:125,126:126,161:65377,162:65378,163:65379,164:65380,165:65381,166:65382,167:65383,168:65384,169:65385,170:65386,171:65387,172:65388,173:65389,174:65390,175:65391,176:65392,177:65393,178:65394,179:65395,180:65396,181:65397,182:65398,183:65399,184:65400,185:65401,186:65402,187:65403,188:65404,189:65405,190:65406,191:65407,192:65408,193:65409,194:65410,195:65411,196:65412,197:65413,198:65414,199:65415,200:65416,201:65417,202:65418,203:65419,204:65420,205:65421,206:65422,207:65423,208:65424,209:65425,210:65426,211:65427,212:65428,213:65429,214:65430,215:65431,216:65432,217:65433,218:65434,219:65435,220:65436,221:65437,222:65438,223:65439,33088:12288,33089:12289,33090:12290,33091:65292,33092:65294,33093:12539,33094:65306,33095:65307,33096:65311,33097:65281,33098:12443,33099:12444,33100:180,33101:65344,33102:168,33103:65342,33104:65507,33105:65343,33106:12541,33107:12542,33108:12445,33109:12446,33110:12291,33111:20189,33112:12293,33113:12294,33114:12295,33115:12540,33116:8213,33117:8208,33118:65295,33119:65340,33120:65374,33121:8741,33122:65372,33123:8230,33124:8229,33125:8216,33126:8217,33127:8220,33128:8221,33129:65288,33130:65289,33131:12308,33132:12309,33133:65339,33134:65341,33135:65371,33136:65373,33137:12296,33138:12297,33139:12298,33140:12299,33141:12300,33142:12301,33143:12302,33144:12303,33145:12304,33146:12305,33147:65291,33148:65293,33149:177,33150:215,33152:247,33153:65309,33154:8800,33155:65308,33156:65310,33157:8806,33158:8807,33159:8734,33160:8756,33161:9794,33162:9792,33163:176,33164:8242,33165:8243,33166:8451,33167:65509,33168:65284,33169:65504,33170:65505,33171:65285,33172:65283,33173:65286,33174:65290,33175:65312,33176:167,33177:9734,33178:9733,33179:9675,33180:9679,33181:9678,33182:9671,33183:9670,33184:9633,33185:9632,33186:9651,33187:9650,33188:9661,33189:9660,33190:8251,33191:12306,33192:8594,33193:8592,33194:8593,33195:8595,33196:12307,33208:8712,33209:8715,33210:8838,33211:8839,33212:8834,33213:8835,33214:8746,33215:8745,33224:8743,33225:8744,33226:65506,33227:8658,33228:8660,33229:8704,33230:8707,33242:8736,33243:8869,33244:8978,33245:8706,33246:8711,33247:8801,33248:8786,33249:8810,33250:8811,33251:8730,33252:8765,33253:8733,33254:8757,33255:8747,33256:8748,33264:8491,33265:8240,33266:9839,33267:9837,33268:9834,33269:8224,33270:8225,33271:182,33276:9711,33359:65296,33360:65297,33361:65298,33362:65299,33363:65300,33364:65301,33365:65302,33366:65303,33367:65304,33368:65305,33376:65313,33377:65314,33378:65315,33379:65316,33380:65317,33381:65318,33382:65319,33383:65320,33384:65321,33385:65322,33386:65323,33387:65324,33388:65325,33389:65326,33390:65327,33391:65328,33392:65329,33393:65330,33394:65331,33395:65332,33396:65333,33397:65334,33398:65335,33399:65336,33400:65337,33401:65338,33409:65345,33410:65346,33411:65347,33412:65348,33413:65349,33414:65350,33415:65351,33416:65352,33417:65353,33418:65354,33419:65355,33420:65356,33421:65357,33422:65358,33423:65359,33424:65360,33425:65361,33426:65362,33427:65363,33428:65364,33429:65365,33430:65366,33431:65367,33432:65368,33433:65369,33434:65370,33439:12353,33440:12354,33441:12355,33442:12356,33443:12357,33444:12358,33445:12359,33446:12360,33447:12361,33448:12362,33449:12363,33450:12364,33451:12365,33452:12366,33453:12367,33454:12368,33455:12369,33456:12370,33457:12371,33458:12372,33459:12373,33460:12374,33461:12375,33462:12376,33463:12377,33464:12378,33465:12379,33466:12380,33467:12381,33468:12382,33469:12383,33470:12384,33471:12385,33472:12386,33473:12387,33474:12388,33475:12389,33476:12390,33477:12391,33478:12392,33479:12393,33480:12394,33481:12395,33482:12396,33483:12397,33484:12398,33485:12399,33486:12400,33487:12401,33488:12402,33489:12403,33490:12404,33491:12405,33492:12406,33493:12407,33494:12408,33495:12409,33496:12410,33497:12411,33498:12412,33499:12413,33500:12414,33501:12415,33502:12416,33503:12417,33504:12418,33505:12419,33506:12420,33507:12421,33508:12422,33509:12423,33510:12424,33511:12425,33512:12426,33513:12427,33514:12428,33515:12429,33516:12430,33517:12431,33518:12432,33519:12433,33520:12434,33521:12435,33600:12449,33601:12450,33602:12451,33603:12452,33604:12453,33605:12454,33606:12455,33607:12456,33608:12457,33609:12458,33610:12459,33611:12460,33612:12461,33613:12462,33614:12463,33615:12464,33616:12465,33617:12466,33618:12467,33619:12468,33620:12469,33621:12470,33622:12471,33623:12472,33624:12473,33625:12474,33626:12475,33627:12476,33628:12477,33629:12478,33630:12479,33631:12480,33632:12481,33633:12482,33634:12483,33635:12484,33636:12485,33637:12486,33638:12487,33639:12488,33640:12489,33641:12490,33642:12491,33643:12492,33644:12493,33645:12494,33646:12495,33647:12496,33648:12497,33649:12498,33650:12499,33651:12500,33652:12501,33653:12502,33654:12503,33655:12504,33656:12505,33657:12506,33658:12507,33659:12508,33660:12509,33661:12510,33662:12511,33664:12512,33665:12513,33666:12514,33667:12515,33668:12516,33669:12517,33670:12518,33671:12519,33672:12520,33673:12521,33674:12522,33675:12523,33676:12524,33677:12525,33678:12526,33679:12527,33680:12528,33681:12529,33682:12530,33683:12531,33684:12532,33685:12533,33686:12534,33695:913,33696:914,33697:915,33698:916,33699:917,33700:918,33701:919,33702:920,33703:921,33704:922,33705:923,33706:924,33707:925,33708:926,33709:927,33710:928,33711:929,33712:931,33713:932,33714:933,33715:934,33716:935,33717:936,33718:937,33727:945,33728:946,33729:947,33730:948,33731:949,33732:950,33733:951,33734:952,33735:953,33736:954,33737:955,33738:956,33739:957,33740:958,33741:959,33742:960,33743:961,33744:963,33745:964,33746:965,33747:966,33748:967,33749:968,33750:969,33856:1040,33857:1041,33858:1042,33859:1043,33860:1044,33861:1045,33862:1025,33863:1046,33864:1047,33865:1048,33866:1049,33867:1050,33868:1051,33869:1052,33870:1053,33871:1054,33872:1055,33873:1056,33874:1057,33875:1058,33876:1059,33877:1060,33878:1061,33879:1062,33880:1063,33881:1064,33882:1065,33883:1066,33884:1067,33885:1068,33886:1069,33887:1070,33888:1071,33904:1072,33905:1073,33906:1074,33907:1075,33908:1076,33909:1077,33910:1105,33911:1078,33912:1079,33913:1080,33914:1081,33915:1082,33916:1083,33917:1084,33918:1085,33920:1086,33921:1087,33922:1088,33923:1089,33924:1090,33925:1091,33926:1092,33927:1093,33928:1094,33929:1095,33930:1096,33931:1097,33932:1098,33933:1099,33934:1100,33935:1101,33936:1102,33937:1103,33951:9472,33952:9474,33953:9484,33954:9488,33955:9496,33956:9492,33957:9500,33958:9516,33959:9508,33960:9524,33961:9532,33962:9473,33963:9475,33964:9487,33965:9491,33966:9499,33967:9495,33968:9507,33969:9523,33970:9515,33971:9531,33972:9547,33973:9504,33974:9519,33975:9512,33976:9527,33977:9535,33978:9501,33979:9520,33980:9509,33981:9528,33982:9538,34624:9312,34625:9313,34626:9314,34627:9315,34628:9316,34629:9317,34630:9318,34631:9319,34632:9320,34633:9321,34634:9322,34635:9323,34636:9324,34637:9325,34638:9326,34639:9327,34640:9328,34641:9329,34642:9330,34643:9331,34644:8544,34645:8545,34646:8546,34647:8547,34648:8548,34649:8549,34650:8550,34651:8551,34652:8552,34653:8553,34655:13129,34656:13076,34657:13090,34658:13133,34659:13080,34660:13095,34661:13059,34662:13110,34663:13137,34664:13143,34665:13069,34666:13094,34667:13091,34668:13099,34669:13130,34670:13115,34671:13212,34672:13213,34673:13214,34674:13198,34675:13199,34676:13252,34677:13217,34686:13179,34688:12317,34689:12319,34690:8470,34691:13261,34692:8481,34693:12964,34694:12965,34695:12966,34696:12967,34697:12968,34698:12849,34699:12850,34700:12857,34701:13182,34702:13181,34703:13180,34704:8786,34705:8801,34706:8747,34707:8750,34708:8721,34709:8730,34710:8869,34711:8736,34712:8735,34713:8895,34714:8757,34715:8745,34716:8746,34975:20124,34976:21782,34977:23043,34978:38463,34979:21696,34980:24859,34981:25384,34982:23030,34983:36898,34984:33909,34985:33564,34986:31312,34987:24746,34988:25569,34989:28197,34990:26093,34991:33894,34992:33446,34993:39925,34994:26771,34995:22311,34996:26017,34997:25201,34998:23451,34999:22992,35000:34427,35001:39156,35002:32098,35003:32190,35004:39822,35005:25110,35006:31903,35007:34999,35008:23433,35009:24245,35010:25353,35011:26263,35012:26696,35013:38343,35014:38797,35015:26447,35016:20197,35017:20234,35018:20301,35019:20381,35020:20553,35021:22258,35022:22839,35023:22996,35024:23041,35025:23561,35026:24799,35027:24847,35028:24944,35029:26131,35030:26885,35031:28858,35032:30031,35033:30064,35034:31227,35035:32173,35036:32239,35037:32963,35038:33806,35039:34915,35040:35586,35041:36949,35042:36986,35043:21307,35044:20117,35045:20133,35046:22495,35047:32946,35048:37057,35049:30959,35050:19968,35051:22769,35052:28322,35053:36920,35054:31282,35055:33576,35056:33419,35057:39983,35058:20801,35059:21360,35060:21693,35061:21729,35062:22240,35063:23035,35064:24341,35065:39154,35066:28139,35067:32996,35068:34093,35136:38498,35137:38512,35138:38560,35139:38907,35140:21515,35141:21491,35142:23431,35143:28879,35144:32701,35145:36802,35146:38632,35147:21359,35148:40284,35149:31418,35150:19985,35151:30867,35152:33276,35153:28198,35154:22040,35155:21764,35156:27421,35157:34074,35158:39995,35159:23013,35160:21417,35161:28006,35162:29916,35163:38287,35164:22082,35165:20113,35166:36939,35167:38642,35168:33615,35169:39180,35170:21473,35171:21942,35172:23344,35173:24433,35174:26144,35175:26355,35176:26628,35177:27704,35178:27891,35179:27945,35180:29787,35181:30408,35182:31310,35183:38964,35184:33521,35185:34907,35186:35424,35187:37613,35188:28082,35189:30123,35190:30410,35191:39365,35192:24742,35193:35585,35194:36234,35195:38322,35196:27022,35197:21421,35198:20870,35200:22290,35201:22576,35202:22852,35203:23476,35204:24310,35205:24616,35206:25513,35207:25588,35208:27839,35209:28436,35210:28814,35211:28948,35212:29017,35213:29141,35214:29503,35215:32257,35216:33398,35217:33489,35218:34199,35219:36960,35220:37467,35221:40219,35222:22633,35223:26044,35224:27738,35225:29989,35226:20985,35227:22830,35228:22885,35229:24448,35230:24540,35231:25276,35232:26106,35233:27178,35234:27431,35235:27572,35236:29579,35237:32705,35238:35158,35239:40236,35240:40206,35241:40644,35242:23713,35243:27798,35244:33659,35245:20740,35246:23627,35247:25014,35248:33222,35249:26742,35250:29281,35251:20057,35252:20474,35253:21368,35254:24681,35255:28201,35256:31311,35257:38899,35258:19979,35259:21270,35260:20206,35261:20309,35262:20285,35263:20385,35264:20339,35265:21152,35266:21487,35267:22025,35268:22799,35269:23233,35270:23478,35271:23521,35272:31185,35273:26247,35274:26524,35275:26550,35276:27468,35277:27827,35278:28779,35279:29634,35280:31117,35281:31166,35282:31292,35283:31623,35284:33457,35285:33499,35286:33540,35287:33655,35288:33775,35289:33747,35290:34662,35291:35506,35292:22057,35293:36008,35294:36838,35295:36942,35296:38686,35297:34442,35298:20420,35299:23784,35300:25105,35301:29273,35302:30011,35303:33253,35304:33469,35305:34558,35306:36032,35307:38597,35308:39187,35309:39381,35310:20171,35311:20250,35312:35299,35313:22238,35314:22602,35315:22730,35316:24315,35317:24555,35318:24618,35319:24724,35320:24674,35321:25040,35322:25106,35323:25296,35324:25913,35392:39745,35393:26214,35394:26800,35395:28023,35396:28784,35397:30028,35398:30342,35399:32117,35400:33445,35401:34809,35402:38283,35403:38542,35404:35997,35405:20977,35406:21182,35407:22806,35408:21683,35409:23475,35410:23830,35411:24936,35412:27010,35413:28079,35414:30861,35415:33995,35416:34903,35417:35442,35418:37799,35419:39608,35420:28012,35421:39336,35422:34521,35423:22435,35424:26623,35425:34510,35426:37390,35427:21123,35428:22151,35429:21508,35430:24275,35431:25313,35432:25785,35433:26684,35434:26680,35435:27579,35436:29554,35437:30906,35438:31339,35439:35226,35440:35282,35441:36203,35442:36611,35443:37101,35444:38307,35445:38548,35446:38761,35447:23398,35448:23731,35449:27005,35450:38989,35451:38990,35452:25499,35453:31520,35454:27179,35456:27263,35457:26806,35458:39949,35459:28511,35460:21106,35461:21917,35462:24688,35463:25324,35464:27963,35465:28167,35466:28369,35467:33883,35468:35088,35469:36676,35470:19988,35471:39993,35472:21494,35473:26907,35474:27194,35475:38788,35476:26666,35477:20828,35478:31427,35479:33970,35480:37340,35481:37772,35482:22107,35483:40232,35484:26658,35485:33541,35486:33841,35487:31909,35488:21e3,35489:33477,35490:29926,35491:20094,35492:20355,35493:20896,35494:23506,35495:21002,35496:21208,35497:21223,35498:24059,35499:21914,35500:22570,35501:23014,35502:23436,35503:23448,35504:23515,35505:24178,35506:24185,35507:24739,35508:24863,35509:24931,35510:25022,35511:25563,35512:25954,35513:26577,35514:26707,35515:26874,35516:27454,35517:27475,35518:27735,35519:28450,35520:28567,35521:28485,35522:29872,35523:29976,35524:30435,35525:30475,35526:31487,35527:31649,35528:31777,35529:32233,35530:32566,35531:32752,35532:32925,35533:33382,35534:33694,35535:35251,35536:35532,35537:36011,35538:36996,35539:37969,35540:38291,35541:38289,35542:38306,35543:38501,35544:38867,35545:39208,35546:33304,35547:20024,35548:21547,35549:23736,35550:24012,35551:29609,35552:30284,35553:30524,35554:23721,35555:32747,35556:36107,35557:38593,35558:38929,35559:38996,35560:39e3,35561:20225,35562:20238,35563:21361,35564:21916,35565:22120,35566:22522,35567:22855,35568:23305,35569:23492,35570:23696,35571:24076,35572:24190,35573:24524,35574:25582,35575:26426,35576:26071,35577:26082,35578:26399,35579:26827,35580:26820,35648:27231,35649:24112,35650:27589,35651:27671,35652:27773,35653:30079,35654:31048,35655:23395,35656:31232,35657:32e3,35658:24509,35659:35215,35660:35352,35661:36020,35662:36215,35663:36556,35664:36637,35665:39138,35666:39438,35667:39740,35668:20096,35669:20605,35670:20736,35671:22931,35672:23452,35673:25135,35674:25216,35675:25836,35676:27450,35677:29344,35678:30097,35679:31047,35680:32681,35681:34811,35682:35516,35683:35696,35684:25516,35685:33738,35686:38816,35687:21513,35688:21507,35689:21931,35690:26708,35691:27224,35692:35440,35693:30759,35694:26485,35695:40653,35696:21364,35697:23458,35698:33050,35699:34384,35700:36870,35701:19992,35702:20037,35703:20167,35704:20241,35705:21450,35706:21560,35707:23470,35708:24339,35709:24613,35710:25937,35712:26429,35713:27714,35714:27762,35715:27875,35716:28792,35717:29699,35718:31350,35719:31406,35720:31496,35721:32026,35722:31998,35723:32102,35724:26087,35725:29275,35726:21435,35727:23621,35728:24040,35729:25298,35730:25312,35731:25369,35732:28192,35733:34394,35734:35377,35735:36317,35736:37624,35737:28417,35738:31142,35739:39770,35740:20136,35741:20139,35742:20140,35743:20379,35744:20384,35745:20689,35746:20807,35747:31478,35748:20849,35749:20982,35750:21332,35751:21281,35752:21375,35753:21483,35754:21932,35755:22659,35756:23777,35757:24375,35758:24394,35759:24623,35760:24656,35761:24685,35762:25375,35763:25945,35764:27211,35765:27841,35766:29378,35767:29421,35768:30703,35769:33016,35770:33029,35771:33288,35772:34126,35773:37111,35774:37857,35775:38911,35776:39255,35777:39514,35778:20208,35779:20957,35780:23597,35781:26241,35782:26989,35783:23616,35784:26354,35785:26997,35786:29577,35787:26704,35788:31873,35789:20677,35790:21220,35791:22343,35792:24062,35793:37670,35794:26020,35795:27427,35796:27453,35797:29748,35798:31105,35799:31165,35800:31563,35801:32202,35802:33465,35803:33740,35804:34943,35805:35167,35806:35641,35807:36817,35808:37329,35809:21535,35810:37504,35811:20061,35812:20534,35813:21477,35814:21306,35815:29399,35816:29590,35817:30697,35818:33510,35819:36527,35820:39366,35821:39368,35822:39378,35823:20855,35824:24858,35825:34398,35826:21936,35827:31354,35828:20598,35829:23507,35830:36935,35831:38533,35832:20018,35833:27355,35834:37351,35835:23633,35836:23624,35904:25496,35905:31391,35906:27795,35907:38772,35908:36705,35909:31402,35910:29066,35911:38536,35912:31874,35913:26647,35914:32368,35915:26705,35916:37740,35917:21234,35918:21531,35919:34219,35920:35347,35921:32676,35922:36557,35923:37089,35924:21350,35925:34952,35926:31041,35927:20418,35928:20670,35929:21009,35930:20804,35931:21843,35932:22317,35933:29674,35934:22411,35935:22865,35936:24418,35937:24452,35938:24693,35939:24950,35940:24935,35941:25001,35942:25522,35943:25658,35944:25964,35945:26223,35946:26690,35947:28179,35948:30054,35949:31293,35950:31995,35951:32076,35952:32153,35953:32331,35954:32619,35955:33550,35956:33610,35957:34509,35958:35336,35959:35427,35960:35686,35961:36605,35962:38938,35963:40335,35964:33464,35965:36814,35966:39912,35968:21127,35969:25119,35970:25731,35971:28608,35972:38553,35973:26689,35974:20625,35975:27424,35976:27770,35977:28500,35978:31348,35979:32080,35980:34880,35981:35363,35982:26376,35983:20214,35984:20537,35985:20518,35986:20581,35987:20860,35988:21048,35989:21091,35990:21927,35991:22287,35992:22533,35993:23244,35994:24314,35995:25010,35996:25080,35997:25331,35998:25458,35999:26908,36000:27177,36001:29309,36002:29356,36003:29486,36004:30740,36005:30831,36006:32121,36007:30476,36008:32937,36009:35211,36010:35609,36011:36066,36012:36562,36013:36963,36014:37749,36015:38522,36016:38997,36017:39443,36018:40568,36019:20803,36020:21407,36021:21427,36022:24187,36023:24358,36024:28187,36025:28304,36026:29572,36027:29694,36028:32067,36029:33335,36030:35328,36031:35578,36032:38480,36033:20046,36034:20491,36035:21476,36036:21628,36037:22266,36038:22993,36039:23396,36040:24049,36041:24235,36042:24359,36043:25144,36044:25925,36045:26543,36046:28246,36047:29392,36048:31946,36049:34996,36050:32929,36051:32993,36052:33776,36053:34382,36054:35463,36055:36328,36056:37431,36057:38599,36058:39015,36059:40723,36060:20116,36061:20114,36062:20237,36063:21320,36064:21577,36065:21566,36066:23087,36067:24460,36068:24481,36069:24735,36070:26791,36071:27278,36072:29786,36073:30849,36074:35486,36075:35492,36076:35703,36077:37264,36078:20062,36079:39881,36080:20132,36081:20348,36082:20399,36083:20505,36084:20502,36085:20809,36086:20844,36087:21151,36088:21177,36089:21246,36090:21402,36091:21475,36092:21521,36160:21518,36161:21897,36162:22353,36163:22434,36164:22909,36165:23380,36166:23389,36167:23439,36168:24037,36169:24039,36170:24055,36171:24184,36172:24195,36173:24218,36174:24247,36175:24344,36176:24658,36177:24908,36178:25239,36179:25304,36180:25511,36181:25915,36182:26114,36183:26179,36184:26356,36185:26477,36186:26657,36187:26775,36188:27083,36189:27743,36190:27946,36191:28009,36192:28207,36193:28317,36194:30002,36195:30343,36196:30828,36197:31295,36198:31968,36199:32005,36200:32024,36201:32094,36202:32177,36203:32789,36204:32771,36205:32943,36206:32945,36207:33108,36208:33167,36209:33322,36210:33618,36211:34892,36212:34913,36213:35611,36214:36002,36215:36092,36216:37066,36217:37237,36218:37489,36219:30783,36220:37628,36221:38308,36222:38477,36224:38917,36225:39321,36226:39640,36227:40251,36228:21083,36229:21163,36230:21495,36231:21512,36232:22741,36233:25335,36234:28640,36235:35946,36236:36703,36237:40633,36238:20811,36239:21051,36240:21578,36241:22269,36242:31296,36243:37239,36244:40288,36245:40658,36246:29508,36247:28425,36248:33136,36249:29969,36250:24573,36251:24794,36252:39592,36253:29403,36254:36796,36255:27492,36256:38915,36257:20170,36258:22256,36259:22372,36260:22718,36261:23130,36262:24680,36263:25031,36264:26127,36265:26118,36266:26681,36267:26801,36268:28151,36269:30165,36270:32058,36271:33390,36272:39746,36273:20123,36274:20304,36275:21449,36276:21766,36277:23919,36278:24038,36279:24046,36280:26619,36281:27801,36282:29811,36283:30722,36284:35408,36285:37782,36286:35039,36287:22352,36288:24231,36289:25387,36290:20661,36291:20652,36292:20877,36293:26368,36294:21705,36295:22622,36296:22971,36297:23472,36298:24425,36299:25165,36300:25505,36301:26685,36302:27507,36303:28168,36304:28797,36305:37319,36306:29312,36307:30741,36308:30758,36309:31085,36310:25998,36311:32048,36312:33756,36313:35009,36314:36617,36315:38555,36316:21092,36317:22312,36318:26448,36319:32618,36320:36001,36321:20916,36322:22338,36323:38442,36324:22586,36325:27018,36326:32948,36327:21682,36328:23822,36329:22524,36330:30869,36331:40442,36332:20316,36333:21066,36334:21643,36335:25662,36336:26152,36337:26388,36338:26613,36339:31364,36340:31574,36341:32034,36342:37679,36343:26716,36344:39853,36345:31545,36346:21273,36347:20874,36348:21047,36416:23519,36417:25334,36418:25774,36419:25830,36420:26413,36421:27578,36422:34217,36423:38609,36424:30352,36425:39894,36426:25420,36427:37638,36428:39851,36429:30399,36430:26194,36431:19977,36432:20632,36433:21442,36434:23665,36435:24808,36436:25746,36437:25955,36438:26719,36439:29158,36440:29642,36441:29987,36442:31639,36443:32386,36444:34453,36445:35715,36446:36059,36447:37240,36448:39184,36449:26028,36450:26283,36451:27531,36452:20181,36453:20180,36454:20282,36455:20351,36456:21050,36457:21496,36458:21490,36459:21987,36460:22235,36461:22763,36462:22987,36463:22985,36464:23039,36465:23376,36466:23629,36467:24066,36468:24107,36469:24535,36470:24605,36471:25351,36472:25903,36473:23388,36474:26031,36475:26045,36476:26088,36477:26525,36478:27490,36480:27515,36481:27663,36482:29509,36483:31049,36484:31169,36485:31992,36486:32025,36487:32043,36488:32930,36489:33026,36490:33267,36491:35222,36492:35422,36493:35433,36494:35430,36495:35468,36496:35566,36497:36039,36498:36060,36499:38604,36500:39164,36501:27503,36502:20107,36503:20284,36504:20365,36505:20816,36506:23383,36507:23546,36508:24904,36509:25345,36510:26178,36511:27425,36512:28363,36513:27835,36514:29246,36515:29885,36516:30164,36517:30913,36518:31034,36519:32780,36520:32819,36521:33258,36522:33940,36523:36766,36524:27728,36525:40575,36526:24335,36527:35672,36528:40235,36529:31482,36530:36600,36531:23437,36532:38635,36533:19971,36534:21489,36535:22519,36536:22833,36537:23241,36538:23460,36539:24713,36540:28287,36541:28422,36542:30142,36543:36074,36544:23455,36545:34048,36546:31712,36547:20594,36548:26612,36549:33437,36550:23649,36551:34122,36552:32286,36553:33294,36554:20889,36555:23556,36556:25448,36557:36198,36558:26012,36559:29038,36560:31038,36561:32023,36562:32773,36563:35613,36564:36554,36565:36974,36566:34503,36567:37034,36568:20511,36569:21242,36570:23610,36571:26451,36572:28796,36573:29237,36574:37196,36575:37320,36576:37675,36577:33509,36578:23490,36579:24369,36580:24825,36581:20027,36582:21462,36583:23432,36584:25163,36585:26417,36586:27530,36587:29417,36588:29664,36589:31278,36590:33131,36591:36259,36592:37202,36593:39318,36594:20754,36595:21463,36596:21610,36597:23551,36598:25480,36599:27193,36600:32172,36601:38656,36602:22234,36603:21454,36604:21608,36672:23447,36673:23601,36674:24030,36675:20462,36676:24833,36677:25342,36678:27954,36679:31168,36680:31179,36681:32066,36682:32333,36683:32722,36684:33261,36685:33311,36686:33936,36687:34886,36688:35186,36689:35728,36690:36468,36691:36655,36692:36913,36693:37195,36694:37228,36695:38598,36696:37276,36697:20160,36698:20303,36699:20805,36700:21313,36701:24467,36702:25102,36703:26580,36704:27713,36705:28171,36706:29539,36707:32294,36708:37325,36709:37507,36710:21460,36711:22809,36712:23487,36713:28113,36714:31069,36715:32302,36716:31899,36717:22654,36718:29087,36719:20986,36720:34899,36721:36848,36722:20426,36723:23803,36724:26149,36725:30636,36726:31459,36727:33308,36728:39423,36729:20934,36730:24490,36731:26092,36732:26991,36733:27529,36734:28147,36736:28310,36737:28516,36738:30462,36739:32020,36740:24033,36741:36981,36742:37255,36743:38918,36744:20966,36745:21021,36746:25152,36747:26257,36748:26329,36749:28186,36750:24246,36751:32210,36752:32626,36753:26360,36754:34223,36755:34295,36756:35576,36757:21161,36758:21465,36759:22899,36760:24207,36761:24464,36762:24661,36763:37604,36764:38500,36765:20663,36766:20767,36767:21213,36768:21280,36769:21319,36770:21484,36771:21736,36772:21830,36773:21809,36774:22039,36775:22888,36776:22974,36777:23100,36778:23477,36779:23558,36780:23567,36781:23569,36782:23578,36783:24196,36784:24202,36785:24288,36786:24432,36787:25215,36788:25220,36789:25307,36790:25484,36791:25463,36792:26119,36793:26124,36794:26157,36795:26230,36796:26494,36797:26786,36798:27167,36799:27189,36800:27836,36801:28040,36802:28169,36803:28248,36804:28988,36805:28966,36806:29031,36807:30151,36808:30465,36809:30813,36810:30977,36811:31077,36812:31216,36813:31456,36814:31505,36815:31911,36816:32057,36817:32918,36818:33750,36819:33931,36820:34121,36821:34909,36822:35059,36823:35359,36824:35388,36825:35412,36826:35443,36827:35937,36828:36062,36829:37284,36830:37478,36831:37758,36832:37912,36833:38556,36834:38808,36835:19978,36836:19976,36837:19998,36838:20055,36839:20887,36840:21104,36841:22478,36842:22580,36843:22732,36844:23330,36845:24120,36846:24773,36847:25854,36848:26465,36849:26454,36850:27972,36851:29366,36852:30067,36853:31331,36854:33976,36855:35698,36856:37304,36857:37664,36858:22065,36859:22516,36860:39166,36928:25325,36929:26893,36930:27542,36931:29165,36932:32340,36933:32887,36934:33394,36935:35302,36936:39135,36937:34645,36938:36785,36939:23611,36940:20280,36941:20449,36942:20405,36943:21767,36944:23072,36945:23517,36946:23529,36947:24515,36948:24910,36949:25391,36950:26032,36951:26187,36952:26862,36953:27035,36954:28024,36955:28145,36956:30003,36957:30137,36958:30495,36959:31070,36960:31206,36961:32051,36962:33251,36963:33455,36964:34218,36965:35242,36966:35386,36967:36523,36968:36763,36969:36914,36970:37341,36971:38663,36972:20154,36973:20161,36974:20995,36975:22645,36976:22764,36977:23563,36978:29978,36979:23613,36980:33102,36981:35338,36982:36805,36983:38499,36984:38765,36985:31525,36986:35535,36987:38920,36988:37218,36989:22259,36990:21416,36992:36887,36993:21561,36994:22402,36995:24101,36996:25512,36997:27700,36998:28810,36999:30561,37000:31883,37001:32736,37002:34928,37003:36930,37004:37204,37005:37648,37006:37656,37007:38543,37008:29790,37009:39620,37010:23815,37011:23913,37012:25968,37013:26530,37014:36264,37015:38619,37016:25454,37017:26441,37018:26905,37019:33733,37020:38935,37021:38592,37022:35070,37023:28548,37024:25722,37025:23544,37026:19990,37027:28716,37028:30045,37029:26159,37030:20932,37031:21046,37032:21218,37033:22995,37034:24449,37035:24615,37036:25104,37037:25919,37038:25972,37039:26143,37040:26228,37041:26866,37042:26646,37043:27491,37044:28165,37045:29298,37046:29983,37047:30427,37048:31934,37049:32854,37050:22768,37051:35069,37052:35199,37053:35488,37054:35475,37055:35531,37056:36893,37057:37266,37058:38738,37059:38745,37060:25993,37061:31246,37062:33030,37063:38587,37064:24109,37065:24796,37066:25114,37067:26021,37068:26132,37069:26512,37070:30707,37071:31309,37072:31821,37073:32318,37074:33034,37075:36012,37076:36196,37077:36321,37078:36447,37079:30889,37080:20999,37081:25305,37082:25509,37083:25666,37084:25240,37085:35373,37086:31363,37087:31680,37088:35500,37089:38634,37090:32118,37091:33292,37092:34633,37093:20185,37094:20808,37095:21315,37096:21344,37097:23459,37098:23554,37099:23574,37100:24029,37101:25126,37102:25159,37103:25776,37104:26643,37105:26676,37106:27849,37107:27973,37108:27927,37109:26579,37110:28508,37111:29006,37112:29053,37113:26059,37114:31359,37115:31661,37116:32218,37184:32330,37185:32680,37186:33146,37187:33307,37188:33337,37189:34214,37190:35438,37191:36046,37192:36341,37193:36984,37194:36983,37195:37549,37196:37521,37197:38275,37198:39854,37199:21069,37200:21892,37201:28472,37202:28982,37203:20840,37204:31109,37205:32341,37206:33203,37207:31950,37208:22092,37209:22609,37210:23720,37211:25514,37212:26366,37213:26365,37214:26970,37215:29401,37216:30095,37217:30094,37218:30990,37219:31062,37220:31199,37221:31895,37222:32032,37223:32068,37224:34311,37225:35380,37226:38459,37227:36961,37228:40736,37229:20711,37230:21109,37231:21452,37232:21474,37233:20489,37234:21930,37235:22766,37236:22863,37237:29245,37238:23435,37239:23652,37240:21277,37241:24803,37242:24819,37243:25436,37244:25475,37245:25407,37246:25531,37248:25805,37249:26089,37250:26361,37251:24035,37252:27085,37253:27133,37254:28437,37255:29157,37256:20105,37257:30185,37258:30456,37259:31379,37260:31967,37261:32207,37262:32156,37263:32865,37264:33609,37265:33624,37266:33900,37267:33980,37268:34299,37269:35013,37270:36208,37271:36865,37272:36973,37273:37783,37274:38684,37275:39442,37276:20687,37277:22679,37278:24974,37279:33235,37280:34101,37281:36104,37282:36896,37283:20419,37284:20596,37285:21063,37286:21363,37287:24687,37288:25417,37289:26463,37290:28204,37291:36275,37292:36895,37293:20439,37294:23646,37295:36042,37296:26063,37297:32154,37298:21330,37299:34966,37300:20854,37301:25539,37302:23384,37303:23403,37304:23562,37305:25613,37306:26449,37307:36956,37308:20182,37309:22810,37310:22826,37311:27760,37312:35409,37313:21822,37314:22549,37315:22949,37316:24816,37317:25171,37318:26561,37319:33333,37320:26965,37321:38464,37322:39364,37323:39464,37324:20307,37325:22534,37326:23550,37327:32784,37328:23729,37329:24111,37330:24453,37331:24608,37332:24907,37333:25140,37334:26367,37335:27888,37336:28382,37337:32974,37338:33151,37339:33492,37340:34955,37341:36024,37342:36864,37343:36910,37344:38538,37345:40667,37346:39899,37347:20195,37348:21488,37349:22823,37350:31532,37351:37261,37352:38988,37353:40441,37354:28381,37355:28711,37356:21331,37357:21828,37358:23429,37359:25176,37360:25246,37361:25299,37362:27810,37363:28655,37364:29730,37365:35351,37366:37944,37367:28609,37368:35582,37369:33592,37370:20967,37371:34552,37372:21482,37440:21481,37441:20294,37442:36948,37443:36784,37444:22890,37445:33073,37446:24061,37447:31466,37448:36799,37449:26842,37450:35895,37451:29432,37452:40008,37453:27197,37454:35504,37455:20025,37456:21336,37457:22022,37458:22374,37459:25285,37460:25506,37461:26086,37462:27470,37463:28129,37464:28251,37465:28845,37466:30701,37467:31471,37468:31658,37469:32187,37470:32829,37471:32966,37472:34507,37473:35477,37474:37723,37475:22243,37476:22727,37477:24382,37478:26029,37479:26262,37480:27264,37481:27573,37482:30007,37483:35527,37484:20516,37485:30693,37486:22320,37487:24347,37488:24677,37489:26234,37490:27744,37491:30196,37492:31258,37493:32622,37494:33268,37495:34584,37496:36933,37497:39347,37498:31689,37499:30044,37500:31481,37501:31569,37502:33988,37504:36880,37505:31209,37506:31378,37507:33590,37508:23265,37509:30528,37510:20013,37511:20210,37512:23449,37513:24544,37514:25277,37515:26172,37516:26609,37517:27880,37518:34411,37519:34935,37520:35387,37521:37198,37522:37619,37523:39376,37524:27159,37525:28710,37526:29482,37527:33511,37528:33879,37529:36015,37530:19969,37531:20806,37532:20939,37533:21899,37534:23541,37535:24086,37536:24115,37537:24193,37538:24340,37539:24373,37540:24427,37541:24500,37542:25074,37543:25361,37544:26274,37545:26397,37546:28526,37547:29266,37548:30010,37549:30522,37550:32884,37551:33081,37552:33144,37553:34678,37554:35519,37555:35548,37556:36229,37557:36339,37558:37530,37559:38263,37560:38914,37561:40165,37562:21189,37563:25431,37564:30452,37565:26389,37566:27784,37567:29645,37568:36035,37569:37806,37570:38515,37571:27941,37572:22684,37573:26894,37574:27084,37575:36861,37576:37786,37577:30171,37578:36890,37579:22618,37580:26626,37581:25524,37582:27131,37583:20291,37584:28460,37585:26584,37586:36795,37587:34086,37588:32180,37589:37716,37590:26943,37591:28528,37592:22378,37593:22775,37594:23340,37595:32044,37596:29226,37597:21514,37598:37347,37599:40372,37600:20141,37601:20302,37602:20572,37603:20597,37604:21059,37605:35998,37606:21576,37607:22564,37608:23450,37609:24093,37610:24213,37611:24237,37612:24311,37613:24351,37614:24716,37615:25269,37616:25402,37617:25552,37618:26799,37619:27712,37620:30855,37621:31118,37622:31243,37623:32224,37624:33351,37625:35330,37626:35558,37627:36420,37628:36883,37696:37048,37697:37165,37698:37336,37699:40718,37700:27877,37701:25688,37702:25826,37703:25973,37704:28404,37705:30340,37706:31515,37707:36969,37708:37841,37709:28346,37710:21746,37711:24505,37712:25764,37713:36685,37714:36845,37715:37444,37716:20856,37717:22635,37718:22825,37719:23637,37720:24215,37721:28155,37722:32399,37723:29980,37724:36028,37725:36578,37726:39003,37727:28857,37728:20253,37729:27583,37730:28593,37731:3e4,37732:38651,37733:20814,37734:21520,37735:22581,37736:22615,37737:22956,37738:23648,37739:24466,37740:26007,37741:26460,37742:28193,37743:30331,37744:33759,37745:36077,37746:36884,37747:37117,37748:37709,37749:30757,37750:30778,37751:21162,37752:24230,37753:22303,37754:22900,37755:24594,37756:20498,37757:20826,37758:20908,37760:20941,37761:20992,37762:21776,37763:22612,37764:22616,37765:22871,37766:23445,37767:23798,37768:23947,37769:24764,37770:25237,37771:25645,37772:26481,37773:26691,37774:26812,37775:26847,37776:30423,37777:28120,37778:28271,37779:28059,37780:28783,37781:29128,37782:24403,37783:30168,37784:31095,37785:31561,37786:31572,37787:31570,37788:31958,37789:32113,37790:21040,37791:33891,37792:34153,37793:34276,37794:35342,37795:35588,37796:35910,37797:36367,37798:36867,37799:36879,37800:37913,37801:38518,37802:38957,37803:39472,37804:38360,37805:20685,37806:21205,37807:21516,37808:22530,37809:23566,37810:24999,37811:25758,37812:27934,37813:30643,37814:31461,37815:33012,37816:33796,37817:36947,37818:37509,37819:23776,37820:40199,37821:21311,37822:24471,37823:24499,37824:28060,37825:29305,37826:30563,37827:31167,37828:31716,37829:27602,37830:29420,37831:35501,37832:26627,37833:27233,37834:20984,37835:31361,37836:26932,37837:23626,37838:40182,37839:33515,37840:23493,37841:37193,37842:28702,37843:22136,37844:23663,37845:24775,37846:25958,37847:27788,37848:35930,37849:36929,37850:38931,37851:21585,37852:26311,37853:37389,37854:22856,37855:37027,37856:20869,37857:20045,37858:20970,37859:34201,37860:35598,37861:28760,37862:25466,37863:37707,37864:26978,37865:39348,37866:32260,37867:30071,37868:21335,37869:26976,37870:36575,37871:38627,37872:27741,37873:20108,37874:23612,37875:24336,37876:36841,37877:21250,37878:36049,37879:32905,37880:34425,37881:24319,37882:26085,37883:20083,37884:20837,37952:22914,37953:23615,37954:38894,37955:20219,37956:22922,37957:24525,37958:35469,37959:28641,37960:31152,37961:31074,37962:23527,37963:33905,37964:29483,37965:29105,37966:24180,37967:24565,37968:25467,37969:25754,37970:29123,37971:31896,37972:20035,37973:24316,37974:20043,37975:22492,37976:22178,37977:24745,37978:28611,37979:32013,37980:33021,37981:33075,37982:33215,37983:36786,37984:35223,37985:34468,37986:24052,37987:25226,37988:25773,37989:35207,37990:26487,37991:27874,37992:27966,37993:29750,37994:30772,37995:23110,37996:32629,37997:33453,37998:39340,37999:20467,38000:24259,38001:25309,38002:25490,38003:25943,38004:26479,38005:30403,38006:29260,38007:32972,38008:32954,38009:36649,38010:37197,38011:20493,38012:22521,38013:23186,38014:26757,38016:26995,38017:29028,38018:29437,38019:36023,38020:22770,38021:36064,38022:38506,38023:36889,38024:34687,38025:31204,38026:30695,38027:33833,38028:20271,38029:21093,38030:21338,38031:25293,38032:26575,38033:27850,38034:30333,38035:31636,38036:31893,38037:33334,38038:34180,38039:36843,38040:26333,38041:28448,38042:29190,38043:32283,38044:33707,38045:39361,38046:40614,38047:20989,38048:31665,38049:30834,38050:31672,38051:32903,38052:31560,38053:27368,38054:24161,38055:32908,38056:30033,38057:30048,38058:20843,38059:37474,38060:28300,38061:30330,38062:37271,38063:39658,38064:20240,38065:32624,38066:25244,38067:31567,38068:38309,38069:40169,38070:22138,38071:22617,38072:34532,38073:38588,38074:20276,38075:21028,38076:21322,38077:21453,38078:21467,38079:24070,38080:25644,38081:26001,38082:26495,38083:27710,38084:27726,38085:29256,38086:29359,38087:29677,38088:30036,38089:32321,38090:33324,38091:34281,38092:36009,38093:31684,38094:37318,38095:29033,38096:38930,38097:39151,38098:25405,38099:26217,38100:30058,38101:30436,38102:30928,38103:34115,38104:34542,38105:21290,38106:21329,38107:21542,38108:22915,38109:24199,38110:24444,38111:24754,38112:25161,38113:25209,38114:25259,38115:26e3,38116:27604,38117:27852,38118:30130,38119:30382,38120:30865,38121:31192,38122:32203,38123:32631,38124:32933,38125:34987,38126:35513,38127:36027,38128:36991,38129:38750,38130:39131,38131:27147,38132:31800,38133:20633,38134:23614,38135:24494,38136:26503,38137:27608,38138:29749,38139:30473,38140:32654,38208:40763,38209:26570,38210:31255,38211:21305,38212:30091,38213:39661,38214:24422,38215:33181,38216:33777,38217:32920,38218:24380,38219:24517,38220:30050,38221:31558,38222:36924,38223:26727,38224:23019,38225:23195,38226:32016,38227:30334,38228:35628,38229:20469,38230:24426,38231:27161,38232:27703,38233:28418,38234:29922,38235:31080,38236:34920,38237:35413,38238:35961,38239:24287,38240:25551,38241:30149,38242:31186,38243:33495,38244:37672,38245:37618,38246:33948,38247:34541,38248:39981,38249:21697,38250:24428,38251:25996,38252:27996,38253:28693,38254:36007,38255:36051,38256:38971,38257:25935,38258:29942,38259:19981,38260:20184,38261:22496,38262:22827,38263:23142,38264:23500,38265:20904,38266:24067,38267:24220,38268:24598,38269:25206,38270:25975,38272:26023,38273:26222,38274:28014,38275:29238,38276:31526,38277:33104,38278:33178,38279:33433,38280:35676,38281:36e3,38282:36070,38283:36212,38284:38428,38285:38468,38286:20398,38287:25771,38288:27494,38289:33310,38290:33889,38291:34154,38292:37096,38293:23553,38294:26963,38295:39080,38296:33914,38297:34135,38298:20239,38299:21103,38300:24489,38301:24133,38302:26381,38303:31119,38304:33145,38305:35079,38306:35206,38307:28149,38308:24343,38309:25173,38310:27832,38311:20175,38312:29289,38313:39826,38314:20998,38315:21563,38316:22132,38317:22707,38318:24996,38319:25198,38320:28954,38321:22894,38322:31881,38323:31966,38324:32027,38325:38640,38326:25991,38327:32862,38328:19993,38329:20341,38330:20853,38331:22592,38332:24163,38333:24179,38334:24330,38335:26564,38336:20006,38337:34109,38338:38281,38339:38491,38340:31859,38341:38913,38342:20731,38343:22721,38344:30294,38345:30887,38346:21029,38347:30629,38348:34065,38349:31622,38350:20559,38351:22793,38352:29255,38353:31687,38354:32232,38355:36794,38356:36820,38357:36941,38358:20415,38359:21193,38360:23081,38361:24321,38362:38829,38363:20445,38364:33303,38365:37610,38366:22275,38367:25429,38368:27497,38369:29995,38370:35036,38371:36628,38372:31298,38373:21215,38374:22675,38375:24917,38376:25098,38377:26286,38378:27597,38379:31807,38380:33769,38381:20515,38382:20472,38383:21253,38384:21574,38385:22577,38386:22857,38387:23453,38388:23792,38389:23791,38390:23849,38391:24214,38392:25265,38393:25447,38394:25918,38395:26041,38396:26379,38464:27861,38465:27873,38466:28921,38467:30770,38468:32299,38469:32990,38470:33459,38471:33804,38472:34028,38473:34562,38474:35090,38475:35370,38476:35914,38477:37030,38478:37586,38479:39165,38480:40179,38481:40300,38482:20047,38483:20129,38484:20621,38485:21078,38486:22346,38487:22952,38488:24125,38489:24536,38490:24537,38491:25151,38492:26292,38493:26395,38494:26576,38495:26834,38496:20882,38497:32033,38498:32938,38499:33192,38500:35584,38501:35980,38502:36031,38503:37502,38504:38450,38505:21536,38506:38956,38507:21271,38508:20693,38509:21340,38510:22696,38511:25778,38512:26420,38513:29287,38514:30566,38515:31302,38516:37350,38517:21187,38518:27809,38519:27526,38520:22528,38521:24140,38522:22868,38523:26412,38524:32763,38525:20961,38526:30406,38528:25705,38529:30952,38530:39764,38531:40635,38532:22475,38533:22969,38534:26151,38535:26522,38536:27598,38537:21737,38538:27097,38539:24149,38540:33180,38541:26517,38542:39850,38543:26622,38544:40018,38545:26717,38546:20134,38547:20451,38548:21448,38549:25273,38550:26411,38551:27819,38552:36804,38553:20397,38554:32365,38555:40639,38556:19975,38557:24930,38558:28288,38559:28459,38560:34067,38561:21619,38562:26410,38563:39749,38564:24051,38565:31637,38566:23724,38567:23494,38568:34588,38569:28234,38570:34001,38571:31252,38572:33032,38573:22937,38574:31885,38575:27665,38576:30496,38577:21209,38578:22818,38579:28961,38580:29279,38581:30683,38582:38695,38583:40289,38584:26891,38585:23167,38586:23064,38587:20901,38588:21517,38589:21629,38590:26126,38591:30431,38592:36855,38593:37528,38594:40180,38595:23018,38596:29277,38597:28357,38598:20813,38599:26825,38600:32191,38601:32236,38602:38754,38603:40634,38604:25720,38605:27169,38606:33538,38607:22916,38608:23391,38609:27611,38610:29467,38611:30450,38612:32178,38613:32791,38614:33945,38615:20786,38616:26408,38617:40665,38618:30446,38619:26466,38620:21247,38621:39173,38622:23588,38623:25147,38624:31870,38625:36016,38626:21839,38627:24758,38628:32011,38629:38272,38630:21249,38631:20063,38632:20918,38633:22812,38634:29242,38635:32822,38636:37326,38637:24357,38638:30690,38639:21380,38640:24441,38641:32004,38642:34220,38643:35379,38644:36493,38645:38742,38646:26611,38647:34222,38648:37971,38649:24841,38650:24840,38651:27833,38652:30290,38720:35565,38721:36664,38722:21807,38723:20305,38724:20778,38725:21191,38726:21451,38727:23461,38728:24189,38729:24736,38730:24962,38731:25558,38732:26377,38733:26586,38734:28263,38735:28044,38736:29494,38737:29495,38738:30001,38739:31056,38740:35029,38741:35480,38742:36938,38743:37009,38744:37109,38745:38596,38746:34701,38747:22805,38748:20104,38749:20313,38750:19982,38751:35465,38752:36671,38753:38928,38754:20653,38755:24188,38756:22934,38757:23481,38758:24248,38759:25562,38760:25594,38761:25793,38762:26332,38763:26954,38764:27096,38765:27915,38766:28342,38767:29076,38768:29992,38769:31407,38770:32650,38771:32768,38772:33865,38773:33993,38774:35201,38775:35617,38776:36362,38777:36965,38778:38525,38779:39178,38780:24958,38781:25233,38782:27442,38784:27779,38785:28020,38786:32716,38787:32764,38788:28096,38789:32645,38790:34746,38791:35064,38792:26469,38793:33713,38794:38972,38795:38647,38796:27931,38797:32097,38798:33853,38799:37226,38800:20081,38801:21365,38802:23888,38803:27396,38804:28651,38805:34253,38806:34349,38807:35239,38808:21033,38809:21519,38810:23653,38811:26446,38812:26792,38813:29702,38814:29827,38815:30178,38816:35023,38817:35041,38818:37324,38819:38626,38820:38520,38821:24459,38822:29575,38823:31435,38824:33870,38825:25504,38826:30053,38827:21129,38828:27969,38829:28316,38830:29705,38831:30041,38832:30827,38833:31890,38834:38534,38835:31452,38836:40845,38837:20406,38838:24942,38839:26053,38840:34396,38841:20102,38842:20142,38843:20698,38844:20001,38845:20940,38846:23534,38847:26009,38848:26753,38849:28092,38850:29471,38851:30274,38852:30637,38853:31260,38854:31975,38855:33391,38856:35538,38857:36988,38858:37327,38859:38517,38860:38936,38861:21147,38862:32209,38863:20523,38864:21400,38865:26519,38866:28107,38867:29136,38868:29747,38869:33256,38870:36650,38871:38563,38872:40023,38873:40607,38874:29792,38875:22593,38876:28057,38877:32047,38878:39006,38879:20196,38880:20278,38881:20363,38882:20919,38883:21169,38884:23994,38885:24604,38886:29618,38887:31036,38888:33491,38889:37428,38890:38583,38891:38646,38892:38666,38893:40599,38894:40802,38895:26278,38896:27508,38897:21015,38898:21155,38899:28872,38900:35010,38901:24265,38902:24651,38903:24976,38904:28451,38905:29001,38906:31806,38907:32244,38908:32879,38976:34030,38977:36899,38978:37676,38979:21570,38980:39791,38981:27347,38982:28809,38983:36034,38984:36335,38985:38706,38986:21172,38987:23105,38988:24266,38989:24324,38990:26391,38991:27004,38992:27028,38993:28010,38994:28431,38995:29282,38996:29436,38997:31725,38998:32769,38999:32894,39000:34635,39001:37070,39002:20845,39003:40595,39004:31108,39005:32907,39006:37682,39007:35542,39008:20525,39009:21644,39010:35441,39011:27498,39012:36036,39013:33031,39014:24785,39015:26528,39016:40434,39017:20121,39018:20120,39019:39952,39020:35435,39021:34241,39022:34152,39023:26880,39024:28286,39025:30871,39026:33109,39071:24332,39072:19984,39073:19989,39074:20010,39075:20017,39076:20022,39077:20028,39078:20031,39079:20034,39080:20054,39081:20056,39082:20098,39083:20101,39084:35947,39085:20106,39086:33298,39087:24333,39088:20110,39089:20126,39090:20127,39091:20128,39092:20130,39093:20144,39094:20147,39095:20150,39096:20174,39097:20173,39098:20164,39099:20166,39100:20162,39101:20183,39102:20190,39103:20205,39104:20191,39105:20215,39106:20233,39107:20314,39108:20272,39109:20315,39110:20317,39111:20311,39112:20295,39113:20342,39114:20360,39115:20367,39116:20376,39117:20347,39118:20329,39119:20336,39120:20369,39121:20335,39122:20358,39123:20374,39124:20760,39125:20436,39126:20447,39127:20430,39128:20440,39129:20443,39130:20433,39131:20442,39132:20432,39133:20452,39134:20453,39135:20506,39136:20520,39137:20500,39138:20522,39139:20517,39140:20485,39141:20252,39142:20470,39143:20513,39144:20521,39145:20524,39146:20478,39147:20463,39148:20497,39149:20486,39150:20547,39151:20551,39152:26371,39153:20565,39154:20560,39155:20552,39156:20570,39157:20566,39158:20588,39159:20600,39160:20608,39161:20634,39162:20613,39163:20660,39164:20658,39232:20681,39233:20682,39234:20659,39235:20674,39236:20694,39237:20702,39238:20709,39239:20717,39240:20707,39241:20718,39242:20729,39243:20725,39244:20745,39245:20737,39246:20738,39247:20758,39248:20757,39249:20756,39250:20762,39251:20769,39252:20794,39253:20791,39254:20796,39255:20795,39256:20799,39257:20800,39258:20818,39259:20812,39260:20820,39261:20834,39262:31480,39263:20841,39264:20842,39265:20846,39266:20864,39267:20866,39268:22232,39269:20876,39270:20873,39271:20879,39272:20881,39273:20883,39274:20885,39275:20886,39276:20900,39277:20902,39278:20898,39279:20905,39280:20906,39281:20907,39282:20915,39283:20913,39284:20914,39285:20912,39286:20917,39287:20925,39288:20933,39289:20937,39290:20955,39291:20960,39292:34389,39293:20969,39294:20973,39296:20976,39297:20981,39298:20990,39299:20996,39300:21003,39301:21012,39302:21006,39303:21031,39304:21034,39305:21038,39306:21043,39307:21049,39308:21071,39309:21060,39310:21067,39311:21068,39312:21086,39313:21076,39314:21098,39315:21108,39316:21097,39317:21107,39318:21119,39319:21117,39320:21133,39321:21140,39322:21138,39323:21105,39324:21128,39325:21137,39326:36776,39327:36775,39328:21164,39329:21165,39330:21180,39331:21173,39332:21185,39333:21197,39334:21207,39335:21214,39336:21219,39337:21222,39338:39149,39339:21216,39340:21235,39341:21237,39342:21240,39343:21241,39344:21254,39345:21256,39346:30008,39347:21261,39348:21264,39349:21263,39350:21269,39351:21274,39352:21283,39353:21295,39354:21297,39355:21299,39356:21304,39357:21312,39358:21318,39359:21317,39360:19991,39361:21321,39362:21325,39363:20950,39364:21342,39365:21353,39366:21358,39367:22808,39368:21371,39369:21367,39370:21378,39371:21398,39372:21408,39373:21414,39374:21413,39375:21422,39376:21424,39377:21430,39378:21443,39379:31762,39380:38617,39381:21471,39382:26364,39383:29166,39384:21486,39385:21480,39386:21485,39387:21498,39388:21505,39389:21565,39390:21568,39391:21548,39392:21549,39393:21564,39394:21550,39395:21558,39396:21545,39397:21533,39398:21582,39399:21647,39400:21621,39401:21646,39402:21599,39403:21617,39404:21623,39405:21616,39406:21650,39407:21627,39408:21632,39409:21622,39410:21636,39411:21648,39412:21638,39413:21703,39414:21666,39415:21688,39416:21669,39417:21676,39418:21700,39419:21704,39420:21672,39488:21675,39489:21698,39490:21668,39491:21694,39492:21692,39493:21720,39494:21733,39495:21734,39496:21775,39497:21780,39498:21757,39499:21742,39500:21741,39501:21754,39502:21730,39503:21817,39504:21824,39505:21859,39506:21836,39507:21806,39508:21852,39509:21829,39510:21846,39511:21847,39512:21816,39513:21811,39514:21853,39515:21913,39516:21888,39517:21679,39518:21898,39519:21919,39520:21883,39521:21886,39522:21912,39523:21918,39524:21934,39525:21884,39526:21891,39527:21929,39528:21895,39529:21928,39530:21978,39531:21957,39532:21983,39533:21956,39534:21980,39535:21988,39536:21972,39537:22036,39538:22007,39539:22038,39540:22014,39541:22013,39542:22043,39543:22009,39544:22094,39545:22096,39546:29151,39547:22068,39548:22070,39549:22066,39550:22072,39552:22123,39553:22116,39554:22063,39555:22124,39556:22122,39557:22150,39558:22144,39559:22154,39560:22176,39561:22164,39562:22159,39563:22181,39564:22190,39565:22198,39566:22196,39567:22210,39568:22204,39569:22209,39570:22211,39571:22208,39572:22216,39573:22222,39574:22225,39575:22227,39576:22231,39577:22254,39578:22265,39579:22272,39580:22271,39581:22276,39582:22281,39583:22280,39584:22283,39585:22285,39586:22291,39587:22296,39588:22294,39589:21959,39590:22300,39591:22310,39592:22327,39593:22328,39594:22350,39595:22331,39596:22336,39597:22351,39598:22377,39599:22464,39600:22408,39601:22369,39602:22399,39603:22409,39604:22419,39605:22432,39606:22451,39607:22436,39608:22442,39609:22448,39610:22467,39611:22470,39612:22484,39613:22482,39614:22483,39615:22538,39616:22486,39617:22499,39618:22539,39619:22553,39620:22557,39621:22642,39622:22561,39623:22626,39624:22603,39625:22640,39626:27584,39627:22610,39628:22589,39629:22649,39630:22661,39631:22713,39632:22687,39633:22699,39634:22714,39635:22750,39636:22715,39637:22712,39638:22702,39639:22725,39640:22739,39641:22737,39642:22743,39643:22745,39644:22744,39645:22757,39646:22748,39647:22756,39648:22751,39649:22767,39650:22778,39651:22777,39652:22779,39653:22780,39654:22781,39655:22786,39656:22794,39657:22800,39658:22811,39659:26790,39660:22821,39661:22828,39662:22829,39663:22834,39664:22840,39665:22846,39666:31442,39667:22869,39668:22864,39669:22862,39670:22874,39671:22872,39672:22882,39673:22880,39674:22887,39675:22892,39676:22889,39744:22904,39745:22913,39746:22941,39747:20318,39748:20395,39749:22947,39750:22962,39751:22982,39752:23016,39753:23004,39754:22925,39755:23001,39756:23002,39757:23077,39758:23071,39759:23057,39760:23068,39761:23049,39762:23066,39763:23104,39764:23148,39765:23113,39766:23093,39767:23094,39768:23138,39769:23146,39770:23194,39771:23228,39772:23230,39773:23243,39774:23234,39775:23229,39776:23267,39777:23255,39778:23270,39779:23273,39780:23254,39781:23290,39782:23291,39783:23308,39784:23307,39785:23318,39786:23346,39787:23248,39788:23338,39789:23350,39790:23358,39791:23363,39792:23365,39793:23360,39794:23377,39795:23381,39796:23386,39797:23387,39798:23397,39799:23401,39800:23408,39801:23411,39802:23413,39803:23416,39804:25992,39805:23418,39806:23424,39808:23427,39809:23462,39810:23480,39811:23491,39812:23495,39813:23497,39814:23508,39815:23504,39816:23524,39817:23526,39818:23522,39819:23518,39820:23525,39821:23531,39822:23536,39823:23542,39824:23539,39825:23557,39826:23559,39827:23560,39828:23565,39829:23571,39830:23584,39831:23586,39832:23592,39833:23608,39834:23609,39835:23617,39836:23622,39837:23630,39838:23635,39839:23632,39840:23631,39841:23409,39842:23660,39843:23662,39844:20066,39845:23670,39846:23673,39847:23692,39848:23697,39849:23700,39850:22939,39851:23723,39852:23739,39853:23734,39854:23740,39855:23735,39856:23749,39857:23742,39858:23751,39859:23769,39860:23785,39861:23805,39862:23802,39863:23789,39864:23948,39865:23786,39866:23819,39867:23829,39868:23831,39869:23900,39870:23839,39871:23835,39872:23825,39873:23828,39874:23842,39875:23834,39876:23833,39877:23832,39878:23884,39879:23890,39880:23886,39881:23883,39882:23916,39883:23923,39884:23926,39885:23943,39886:23940,39887:23938,39888:23970,39889:23965,39890:23980,39891:23982,39892:23997,39893:23952,39894:23991,39895:23996,39896:24009,39897:24013,39898:24019,39899:24018,39900:24022,39901:24027,39902:24043,39903:24050,39904:24053,39905:24075,39906:24090,39907:24089,39908:24081,39909:24091,39910:24118,39911:24119,39912:24132,39913:24131,39914:24128,39915:24142,39916:24151,39917:24148,39918:24159,39919:24162,39920:24164,39921:24135,39922:24181,39923:24182,39924:24186,39925:40636,39926:24191,39927:24224,39928:24257,39929:24258,39930:24264,39931:24272,39932:24271,40000:24278,40001:24291,40002:24285,40003:24282,40004:24283,40005:24290,40006:24289,40007:24296,40008:24297,40009:24300,40010:24305,40011:24307,40012:24304,40013:24308,40014:24312,40015:24318,40016:24323,40017:24329,40018:24413,40019:24412,40020:24331,40021:24337,40022:24342,40023:24361,40024:24365,40025:24376,40026:24385,40027:24392,40028:24396,40029:24398,40030:24367,40031:24401,40032:24406,40033:24407,40034:24409,40035:24417,40036:24429,40037:24435,40038:24439,40039:24451,40040:24450,40041:24447,40042:24458,40043:24456,40044:24465,40045:24455,40046:24478,40047:24473,40048:24472,40049:24480,40050:24488,40051:24493,40052:24508,40053:24534,40054:24571,40055:24548,40056:24568,40057:24561,40058:24541,40059:24755,40060:24575,40061:24609,40062:24672,40064:24601,40065:24592,40066:24617,40067:24590,40068:24625,40069:24603,40070:24597,40071:24619,40072:24614,40073:24591,40074:24634,40075:24666,40076:24641,40077:24682,40078:24695,40079:24671,40080:24650,40081:24646,40082:24653,40083:24675,40084:24643,40085:24676,40086:24642,40087:24684,40088:24683,40089:24665,40090:24705,40091:24717,40092:24807,40093:24707,40094:24730,40095:24708,40096:24731,40097:24726,40098:24727,40099:24722,40100:24743,40101:24715,40102:24801,40103:24760,40104:24800,40105:24787,40106:24756,40107:24560,40108:24765,40109:24774,40110:24757,40111:24792,40112:24909,40113:24853,40114:24838,40115:24822,40116:24823,40117:24832,40118:24820,40119:24826,40120:24835,40121:24865,40122:24827,40123:24817,40124:24845,40125:24846,40126:24903,40127:24894,40128:24872,40129:24871,40130:24906,40131:24895,40132:24892,40133:24876,40134:24884,40135:24893,40136:24898,40137:24900,40138:24947,40139:24951,40140:24920,40141:24921,40142:24922,40143:24939,40144:24948,40145:24943,40146:24933,40147:24945,40148:24927,40149:24925,40150:24915,40151:24949,40152:24985,40153:24982,40154:24967,40155:25004,40156:24980,40157:24986,40158:24970,40159:24977,40160:25003,40161:25006,40162:25036,40163:25034,40164:25033,40165:25079,40166:25032,40167:25027,40168:25030,40169:25018,40170:25035,40171:32633,40172:25037,40173:25062,40174:25059,40175:25078,40176:25082,40177:25076,40178:25087,40179:25085,40180:25084,40181:25086,40182:25088,40183:25096,40184:25097,40185:25101,40186:25100,40187:25108,40188:25115,40256:25118,40257:25121,40258:25130,40259:25134,40260:25136,40261:25138,40262:25139,40263:25153,40264:25166,40265:25182,40266:25187,40267:25179,40268:25184,40269:25192,40270:25212,40271:25218,40272:25225,40273:25214,40274:25234,40275:25235,40276:25238,40277:25300,40278:25219,40279:25236,40280:25303,40281:25297,40282:25275,40283:25295,40284:25343,40285:25286,40286:25812,40287:25288,40288:25308,40289:25292,40290:25290,40291:25282,40292:25287,40293:25243,40294:25289,40295:25356,40296:25326,40297:25329,40298:25383,40299:25346,40300:25352,40301:25327,40302:25333,40303:25424,40304:25406,40305:25421,40306:25628,40307:25423,40308:25494,40309:25486,40310:25472,40311:25515,40312:25462,40313:25507,40314:25487,40315:25481,40316:25503,40317:25525,40318:25451,40320:25449,40321:25534,40322:25577,40323:25536,40324:25542,40325:25571,40326:25545,40327:25554,40328:25590,40329:25540,40330:25622,40331:25652,40332:25606,40333:25619,40334:25638,40335:25654,40336:25885,40337:25623,40338:25640,40339:25615,40340:25703,40341:25711,40342:25718,40343:25678,40344:25898,40345:25749,40346:25747,40347:25765,40348:25769,40349:25736,40350:25788,40351:25818,40352:25810,40353:25797,40354:25799,40355:25787,40356:25816,40357:25794,40358:25841,40359:25831,40360:33289,40361:25824,40362:25825,40363:25260,40364:25827,40365:25839,40366:25900,40367:25846,40368:25844,40369:25842,40370:25850,40371:25856,40372:25853,40373:25880,40374:25884,40375:25861,40376:25892,40377:25891,40378:25899,40379:25908,40380:25909,40381:25911,40382:25910,40383:25912,40384:30027,40385:25928,40386:25942,40387:25941,40388:25933,40389:25944,40390:25950,40391:25949,40392:25970,40393:25976,40394:25986,40395:25987,40396:35722,40397:26011,40398:26015,40399:26027,40400:26039,40401:26051,40402:26054,40403:26049,40404:26052,40405:26060,40406:26066,40407:26075,40408:26073,40409:26080,40410:26081,40411:26097,40412:26482,40413:26122,40414:26115,40415:26107,40416:26483,40417:26165,40418:26166,40419:26164,40420:26140,40421:26191,40422:26180,40423:26185,40424:26177,40425:26206,40426:26205,40427:26212,40428:26215,40429:26216,40430:26207,40431:26210,40432:26224,40433:26243,40434:26248,40435:26254,40436:26249,40437:26244,40438:26264,40439:26269,40440:26305,40441:26297,40442:26313,40443:26302,40444:26300,40512:26308,40513:26296,40514:26326,40515:26330,40516:26336,40517:26175,40518:26342,40519:26345,40520:26352,40521:26357,40522:26359,40523:26383,40524:26390,40525:26398,40526:26406,40527:26407,40528:38712,40529:26414,40530:26431,40531:26422,40532:26433,40533:26424,40534:26423,40535:26438,40536:26462,40537:26464,40538:26457,40539:26467,40540:26468,40541:26505,40542:26480,40543:26537,40544:26492,40545:26474,40546:26508,40547:26507,40548:26534,40549:26529,40550:26501,40551:26551,40552:26607,40553:26548,40554:26604,40555:26547,40556:26601,40557:26552,40558:26596,40559:26590,40560:26589,40561:26594,40562:26606,40563:26553,40564:26574,40565:26566,40566:26599,40567:27292,40568:26654,40569:26694,40570:26665,40571:26688,40572:26701,40573:26674,40574:26702,40576:26803,40577:26667,40578:26713,40579:26723,40580:26743,40581:26751,40582:26783,40583:26767,40584:26797,40585:26772,40586:26781,40587:26779,40588:26755,40589:27310,40590:26809,40591:26740,40592:26805,40593:26784,40594:26810,40595:26895,40596:26765,40597:26750,40598:26881,40599:26826,40600:26888,40601:26840,40602:26914,40603:26918,40604:26849,40605:26892,40606:26829,40607:26836,40608:26855,40609:26837,40610:26934,40611:26898,40612:26884,40613:26839,40614:26851,40615:26917,40616:26873,40617:26848,40618:26863,40619:26920,40620:26922,40621:26906,40622:26915,40623:26913,40624:26822,40625:27001,40626:26999,40627:26972,40628:27e3,40629:26987,40630:26964,40631:27006,40632:26990,40633:26937,40634:26996,40635:26941,40636:26969,40637:26928,40638:26977,40639:26974,40640:26973,40641:27009,40642:26986,40643:27058,40644:27054,40645:27088,40646:27071,40647:27073,40648:27091,40649:27070,40650:27086,40651:23528,40652:27082,40653:27101,40654:27067,40655:27075,40656:27047,40657:27182,40658:27025,40659:27040,40660:27036,40661:27029,40662:27060,40663:27102,40664:27112,40665:27138,40666:27163,40667:27135,40668:27402,40669:27129,40670:27122,40671:27111,40672:27141,40673:27057,40674:27166,40675:27117,40676:27156,40677:27115,40678:27146,40679:27154,40680:27329,40681:27171,40682:27155,40683:27204,40684:27148,40685:27250,40686:27190,40687:27256,40688:27207,40689:27234,40690:27225,40691:27238,40692:27208,40693:27192,40694:27170,40695:27280,40696:27277,40697:27296,40698:27268,40699:27298,40700:27299,40768:27287,40769:34327,40770:27323,40771:27331,40772:27330,40773:27320,40774:27315,40775:27308,40776:27358,40777:27345,40778:27359,40779:27306,40780:27354,40781:27370,40782:27387,40783:27397,40784:34326,40785:27386,40786:27410,40787:27414,40788:39729,40789:27423,40790:27448,40791:27447,40792:30428,40793:27449,40794:39150,40795:27463,40796:27459,40797:27465,40798:27472,40799:27481,40800:27476,40801:27483,40802:27487,40803:27489,40804:27512,40805:27513,40806:27519,40807:27520,40808:27524,40809:27523,40810:27533,40811:27544,40812:27541,40813:27550,40814:27556,40815:27562,40816:27563,40817:27567,40818:27570,40819:27569,40820:27571,40821:27575,40822:27580,40823:27590,40824:27595,40825:27603,40826:27615,40827:27628,40828:27627,40829:27635,40830:27631,40832:40638,40833:27656,40834:27667,40835:27668,40836:27675,40837:27684,40838:27683,40839:27742,40840:27733,40841:27746,40842:27754,40843:27778,40844:27789,40845:27802,40846:27777,40847:27803,40848:27774,40849:27752,40850:27763,40851:27794,40852:27792,40853:27844,40854:27889,40855:27859,40856:27837,40857:27863,40858:27845,40859:27869,40860:27822,40861:27825,40862:27838,40863:27834,40864:27867,40865:27887,40866:27865,40867:27882,40868:27935,40869:34893,40870:27958,40871:27947,40872:27965,40873:27960,40874:27929,40875:27957,40876:27955,40877:27922,40878:27916,40879:28003,40880:28051,40881:28004,40882:27994,40883:28025,40884:27993,40885:28046,40886:28053,40887:28644,40888:28037,40889:28153,40890:28181,40891:28170,40892:28085,40893:28103,40894:28134,40895:28088,40896:28102,40897:28140,40898:28126,40899:28108,40900:28136,40901:28114,40902:28101,40903:28154,40904:28121,40905:28132,40906:28117,40907:28138,40908:28142,40909:28205,40910:28270,40911:28206,40912:28185,40913:28274,40914:28255,40915:28222,40916:28195,40917:28267,40918:28203,40919:28278,40920:28237,40921:28191,40922:28227,40923:28218,40924:28238,40925:28196,40926:28415,40927:28189,40928:28216,40929:28290,40930:28330,40931:28312,40932:28361,40933:28343,40934:28371,40935:28349,40936:28335,40937:28356,40938:28338,40939:28372,40940:28373,40941:28303,40942:28325,40943:28354,40944:28319,40945:28481,40946:28433,40947:28748,40948:28396,40949:28408,40950:28414,40951:28479,40952:28402,40953:28465,40954:28399,40955:28466,40956:28364,57408:28478,57409:28435,57410:28407,57411:28550,57412:28538,57413:28536,57414:28545,57415:28544,57416:28527,57417:28507,57418:28659,57419:28525,57420:28546,57421:28540,57422:28504,57423:28558,57424:28561,57425:28610,57426:28518,57427:28595,57428:28579,57429:28577,57430:28580,57431:28601,57432:28614,57433:28586,57434:28639,57435:28629,57436:28652,57437:28628,57438:28632,57439:28657,57440:28654,57441:28635,57442:28681,57443:28683,57444:28666,57445:28689,57446:28673,57447:28687,57448:28670,57449:28699,57450:28698,57451:28532,57452:28701,57453:28696,57454:28703,57455:28720,57456:28734,57457:28722,57458:28753,57459:28771,57460:28825,57461:28818,57462:28847,57463:28913,57464:28844,57465:28856,57466:28851,57467:28846,57468:28895,57469:28875,57470:28893,57472:28889,57473:28937,57474:28925,57475:28956,57476:28953,57477:29029,57478:29013,57479:29064,57480:29030,57481:29026,57482:29004,57483:29014,57484:29036,57485:29071,57486:29179,57487:29060,57488:29077,57489:29096,57490:29100,57491:29143,57492:29113,57493:29118,57494:29138,57495:29129,57496:29140,57497:29134,57498:29152,57499:29164,57500:29159,57501:29173,57502:29180,57503:29177,57504:29183,57505:29197,57506:29200,57507:29211,57508:29224,57509:29229,57510:29228,57511:29232,57512:29234,57513:29243,57514:29244,57515:29247,57516:29248,57517:29254,57518:29259,57519:29272,57520:29300,57521:29310,57522:29314,57523:29313,57524:29319,57525:29330,57526:29334,57527:29346,57528:29351,57529:29369,57530:29362,57531:29379,57532:29382,57533:29380,57534:29390,57535:29394,57536:29410,57537:29408,57538:29409,57539:29433,57540:29431,57541:20495,57542:29463,57543:29450,57544:29468,57545:29462,57546:29469,57547:29492,57548:29487,57549:29481,57550:29477,57551:29502,57552:29518,57553:29519,57554:40664,57555:29527,57556:29546,57557:29544,57558:29552,57559:29560,57560:29557,57561:29563,57562:29562,57563:29640,57564:29619,57565:29646,57566:29627,57567:29632,57568:29669,57569:29678,57570:29662,57571:29858,57572:29701,57573:29807,57574:29733,57575:29688,57576:29746,57577:29754,57578:29781,57579:29759,57580:29791,57581:29785,57582:29761,57583:29788,57584:29801,57585:29808,57586:29795,57587:29802,57588:29814,57589:29822,57590:29835,57591:29854,57592:29863,57593:29898,57594:29903,57595:29908,57596:29681,57664:29920,57665:29923,57666:29927,57667:29929,57668:29934,57669:29938,57670:29936,57671:29937,57672:29944,57673:29943,57674:29956,57675:29955,57676:29957,57677:29964,57678:29966,57679:29965,57680:29973,57681:29971,57682:29982,57683:29990,57684:29996,57685:30012,57686:30020,57687:30029,57688:30026,57689:30025,57690:30043,57691:30022,57692:30042,57693:30057,57694:30052,57695:30055,57696:30059,57697:30061,57698:30072,57699:30070,57700:30086,57701:30087,57702:30068,57703:30090,57704:30089,57705:30082,57706:30100,57707:30106,57708:30109,57709:30117,57710:30115,57711:30146,57712:30131,57713:30147,57714:30133,57715:30141,57716:30136,57717:30140,57718:30129,57719:30157,57720:30154,57721:30162,57722:30169,57723:30179,57724:30174,57725:30206,57726:30207,57728:30204,57729:30209,57730:30192,57731:30202,57732:30194,57733:30195,57734:30219,57735:30221,57736:30217,57737:30239,57738:30247,57739:30240,57740:30241,57741:30242,57742:30244,57743:30260,57744:30256,57745:30267,57746:30279,57747:30280,57748:30278,57749:30300,57750:30296,57751:30305,57752:30306,57753:30312,57754:30313,57755:30314,57756:30311,57757:30316,57758:30320,57759:30322,57760:30326,57761:30328,57762:30332,57763:30336,57764:30339,57765:30344,57766:30347,57767:30350,57768:30358,57769:30355,57770:30361,57771:30362,57772:30384,57773:30388,57774:30392,57775:30393,57776:30394,57777:30402,57778:30413,57779:30422,57780:30418,57781:30430,57782:30433,57783:30437,57784:30439,57785:30442,57786:34351,57787:30459,57788:30472,57789:30471,57790:30468,57791:30505,57792:30500,57793:30494,57794:30501,57795:30502,57796:30491,57797:30519,57798:30520,57799:30535,57800:30554,57801:30568,57802:30571,57803:30555,57804:30565,57805:30591,57806:30590,57807:30585,57808:30606,57809:30603,57810:30609,57811:30624,57812:30622,57813:30640,57814:30646,57815:30649,57816:30655,57817:30652,57818:30653,57819:30651,57820:30663,57821:30669,57822:30679,57823:30682,57824:30684,57825:30691,57826:30702,57827:30716,57828:30732,57829:30738,57830:31014,57831:30752,57832:31018,57833:30789,57834:30862,57835:30836,57836:30854,57837:30844,57838:30874,57839:30860,57840:30883,57841:30901,57842:30890,57843:30895,57844:30929,57845:30918,57846:30923,57847:30932,57848:30910,57849:30908,57850:30917,57851:30922,57852:30956,57920:30951,57921:30938,57922:30973,57923:30964,57924:30983,57925:30994,57926:30993,57927:31001,57928:31020,57929:31019,57930:31040,57931:31072,57932:31063,57933:31071,57934:31066,57935:31061,57936:31059,57937:31098,57938:31103,57939:31114,57940:31133,57941:31143,57942:40779,57943:31146,57944:31150,57945:31155,57946:31161,57947:31162,57948:31177,57949:31189,57950:31207,57951:31212,57952:31201,57953:31203,57954:31240,57955:31245,57956:31256,57957:31257,57958:31264,57959:31263,57960:31104,57961:31281,57962:31291,57963:31294,57964:31287,57965:31299,57966:31319,57967:31305,57968:31329,57969:31330,57970:31337,57971:40861,57972:31344,57973:31353,57974:31357,57975:31368,57976:31383,57977:31381,57978:31384,57979:31382,57980:31401,57981:31432,57982:31408,57984:31414,57985:31429,57986:31428,57987:31423,57988:36995,57989:31431,57990:31434,57991:31437,57992:31439,57993:31445,57994:31443,57995:31449,57996:31450,57997:31453,57998:31457,57999:31458,58000:31462,58001:31469,58002:31472,58003:31490,58004:31503,58005:31498,58006:31494,58007:31539,58008:31512,58009:31513,58010:31518,58011:31541,58012:31528,58013:31542,58014:31568,58015:31610,58016:31492,58017:31565,58018:31499,58019:31564,58020:31557,58021:31605,58022:31589,58023:31604,58024:31591,58025:31600,58026:31601,58027:31596,58028:31598,58029:31645,58030:31640,58031:31647,58032:31629,58033:31644,58034:31642,58035:31627,58036:31634,58037:31631,58038:31581,58039:31641,58040:31691,58041:31681,58042:31692,58043:31695,58044:31668,58045:31686,58046:31709,58047:31721,58048:31761,58049:31764,58050:31718,58051:31717,58052:31840,58053:31744,58054:31751,58055:31763,58056:31731,58057:31735,58058:31767,58059:31757,58060:31734,58061:31779,58062:31783,58063:31786,58064:31775,58065:31799,58066:31787,58067:31805,58068:31820,58069:31811,58070:31828,58071:31823,58072:31808,58073:31824,58074:31832,58075:31839,58076:31844,58077:31830,58078:31845,58079:31852,58080:31861,58081:31875,58082:31888,58083:31908,58084:31917,58085:31906,58086:31915,58087:31905,58088:31912,58089:31923,58090:31922,58091:31921,58092:31918,58093:31929,58094:31933,58095:31936,58096:31941,58097:31938,58098:31960,58099:31954,58100:31964,58101:31970,58102:39739,58103:31983,58104:31986,58105:31988,58106:31990,58107:31994,58108:32006,58176:32002,58177:32028,58178:32021,58179:32010,58180:32069,58181:32075,58182:32046,58183:32050,58184:32063,58185:32053,58186:32070,58187:32115,58188:32086,58189:32078,58190:32114,58191:32104,58192:32110,58193:32079,58194:32099,58195:32147,58196:32137,58197:32091,58198:32143,58199:32125,58200:32155,58201:32186,58202:32174,58203:32163,58204:32181,58205:32199,58206:32189,58207:32171,58208:32317,58209:32162,58210:32175,58211:32220,58212:32184,58213:32159,58214:32176,58215:32216,58216:32221,58217:32228,58218:32222,58219:32251,58220:32242,58221:32225,58222:32261,58223:32266,58224:32291,58225:32289,58226:32274,58227:32305,58228:32287,58229:32265,58230:32267,58231:32290,58232:32326,58233:32358,58234:32315,58235:32309,58236:32313,58237:32323,58238:32311,58240:32306,58241:32314,58242:32359,58243:32349,58244:32342,58245:32350,58246:32345,58247:32346,58248:32377,58249:32362,58250:32361,58251:32380,58252:32379,58253:32387,58254:32213,58255:32381,58256:36782,58257:32383,58258:32392,58259:32393,58260:32396,58261:32402,58262:32400,58263:32403,58264:32404,58265:32406,58266:32398,58267:32411,58268:32412,58269:32568,58270:32570,58271:32581,58272:32588,58273:32589,58274:32590,58275:32592,58276:32593,58277:32597,58278:32596,58279:32600,58280:32607,58281:32608,58282:32616,58283:32617,58284:32615,58285:32632,58286:32642,58287:32646,58288:32643,58289:32648,58290:32647,58291:32652,58292:32660,58293:32670,58294:32669,58295:32666,58296:32675,58297:32687,58298:32690,58299:32697,58300:32686,58301:32694,58302:32696,58303:35697,58304:32709,58305:32710,58306:32714,58307:32725,58308:32724,58309:32737,58310:32742,58311:32745,58312:32755,58313:32761,58314:39132,58315:32774,58316:32772,58317:32779,58318:32786,58319:32792,58320:32793,58321:32796,58322:32801,58323:32808,58324:32831,58325:32827,58326:32842,58327:32838,58328:32850,58329:32856,58330:32858,58331:32863,58332:32866,58333:32872,58334:32883,58335:32882,58336:32880,58337:32886,58338:32889,58339:32893,58340:32895,58341:32900,58342:32902,58343:32901,58344:32923,58345:32915,58346:32922,58347:32941,58348:20880,58349:32940,58350:32987,58351:32997,58352:32985,58353:32989,58354:32964,58355:32986,58356:32982,58357:33033,58358:33007,58359:33009,58360:33051,58361:33065,58362:33059,58363:33071,58364:33099,58432:38539,58433:33094,58434:33086,58435:33107,58436:33105,58437:33020,58438:33137,58439:33134,58440:33125,58441:33126,58442:33140,58443:33155,58444:33160,58445:33162,58446:33152,58447:33154,58448:33184,58449:33173,58450:33188,58451:33187,58452:33119,58453:33171,58454:33193,58455:33200,58456:33205,58457:33214,58458:33208,58459:33213,58460:33216,58461:33218,58462:33210,58463:33225,58464:33229,58465:33233,58466:33241,58467:33240,58468:33224,58469:33242,58470:33247,58471:33248,58472:33255,58473:33274,58474:33275,58475:33278,58476:33281,58477:33282,58478:33285,58479:33287,58480:33290,58481:33293,58482:33296,58483:33302,58484:33321,58485:33323,58486:33336,58487:33331,58488:33344,58489:33369,58490:33368,58491:33373,58492:33370,58493:33375,58494:33380,58496:33378,58497:33384,58498:33386,58499:33387,58500:33326,58501:33393,58502:33399,58503:33400,58504:33406,58505:33421,58506:33426,58507:33451,58508:33439,58509:33467,58510:33452,58511:33505,58512:33507,58513:33503,58514:33490,58515:33524,58516:33523,58517:33530,58518:33683,58519:33539,58520:33531,58521:33529,58522:33502,58523:33542,58524:33500,58525:33545,58526:33497,58527:33589,58528:33588,58529:33558,58530:33586,58531:33585,58532:33600,58533:33593,58534:33616,58535:33605,58536:33583,58537:33579,58538:33559,58539:33560,58540:33669,58541:33690,58542:33706,58543:33695,58544:33698,58545:33686,58546:33571,58547:33678,58548:33671,58549:33674,58550:33660,58551:33717,58552:33651,58553:33653,58554:33696,58555:33673,58556:33704,58557:33780,58558:33811,58559:33771,58560:33742,58561:33789,58562:33795,58563:33752,58564:33803,58565:33729,58566:33783,58567:33799,58568:33760,58569:33778,58570:33805,58571:33826,58572:33824,58573:33725,58574:33848,58575:34054,58576:33787,58577:33901,58578:33834,58579:33852,58580:34138,58581:33924,58582:33911,58583:33899,58584:33965,58585:33902,58586:33922,58587:33897,58588:33862,58589:33836,58590:33903,58591:33913,58592:33845,58593:33994,58594:33890,58595:33977,58596:33983,58597:33951,58598:34009,58599:33997,58600:33979,58601:34010,58602:34e3,58603:33985,58604:33990,58605:34006,58606:33953,58607:34081,58608:34047,58609:34036,58610:34071,58611:34072,58612:34092,58613:34079,58614:34069,58615:34068,58616:34044,58617:34112,58618:34147,58619:34136,58620:34120,58688:34113,58689:34306,58690:34123,58691:34133,58692:34176,58693:34212,58694:34184,58695:34193,58696:34186,58697:34216,58698:34157,58699:34196,58700:34203,58701:34282,58702:34183,58703:34204,58704:34167,58705:34174,58706:34192,58707:34249,58708:34234,58709:34255,58710:34233,58711:34256,58712:34261,58713:34269,58714:34277,58715:34268,58716:34297,58717:34314,58718:34323,58719:34315,58720:34302,58721:34298,58722:34310,58723:34338,58724:34330,58725:34352,58726:34367,58727:34381,58728:20053,58729:34388,58730:34399,58731:34407,58732:34417,58733:34451,58734:34467,58735:34473,58736:34474,58737:34443,58738:34444,58739:34486,58740:34479,58741:34500,58742:34502,58743:34480,58744:34505,58745:34851,58746:34475,58747:34516,58748:34526,58749:34537,58750:34540,58752:34527,58753:34523,58754:34543,58755:34578,58756:34566,58757:34568,58758:34560,58759:34563,58760:34555,58761:34577,58762:34569,58763:34573,58764:34553,58765:34570,58766:34612,58767:34623,58768:34615,58769:34619,58770:34597,58771:34601,58772:34586,58773:34656,58774:34655,58775:34680,58776:34636,58777:34638,58778:34676,58779:34647,58780:34664,58781:34670,58782:34649,58783:34643,58784:34659,58785:34666,58786:34821,58787:34722,58788:34719,58789:34690,58790:34735,58791:34763,58792:34749,58793:34752,58794:34768,58795:38614,58796:34731,58797:34756,58798:34739,58799:34759,58800:34758,58801:34747,58802:34799,58803:34802,58804:34784,58805:34831,58806:34829,58807:34814,58808:34806,58809:34807,58810:34830,58811:34770,58812:34833,58813:34838,58814:34837,58815:34850,58816:34849,58817:34865,58818:34870,58819:34873,58820:34855,58821:34875,58822:34884,58823:34882,58824:34898,58825:34905,58826:34910,58827:34914,58828:34923,58829:34945,58830:34942,58831:34974,58832:34933,58833:34941,58834:34997,58835:34930,58836:34946,58837:34967,58838:34962,58839:34990,58840:34969,58841:34978,58842:34957,58843:34980,58844:34992,58845:35007,58846:34993,58847:35011,58848:35012,58849:35028,58850:35032,58851:35033,58852:35037,58853:35065,58854:35074,58855:35068,58856:35060,58857:35048,58858:35058,58859:35076,58860:35084,58861:35082,58862:35091,58863:35139,58864:35102,58865:35109,58866:35114,58867:35115,58868:35137,58869:35140,58870:35131,58871:35126,58872:35128,58873:35148,58874:35101,58875:35168,58876:35166,58944:35174,58945:35172,58946:35181,58947:35178,58948:35183,58949:35188,58950:35191,58951:35198,58952:35203,58953:35208,58954:35210,58955:35219,58956:35224,58957:35233,58958:35241,58959:35238,58960:35244,58961:35247,58962:35250,58963:35258,58964:35261,58965:35263,58966:35264,58967:35290,58968:35292,58969:35293,58970:35303,58971:35316,58972:35320,58973:35331,58974:35350,58975:35344,58976:35340,58977:35355,58978:35357,58979:35365,58980:35382,58981:35393,58982:35419,58983:35410,58984:35398,58985:35400,58986:35452,58987:35437,58988:35436,58989:35426,58990:35461,58991:35458,58992:35460,58993:35496,58994:35489,58995:35473,58996:35493,58997:35494,58998:35482,58999:35491,59000:35524,59001:35533,59002:35522,59003:35546,59004:35563,59005:35571,59006:35559,59008:35556,59009:35569,59010:35604,59011:35552,59012:35554,59013:35575,59014:35550,59015:35547,59016:35596,59017:35591,59018:35610,59019:35553,59020:35606,59021:35600,59022:35607,59023:35616,59024:35635,59025:38827,59026:35622,59027:35627,59028:35646,59029:35624,59030:35649,59031:35660,59032:35663,59033:35662,59034:35657,59035:35670,59036:35675,59037:35674,59038:35691,59039:35679,59040:35692,59041:35695,59042:35700,59043:35709,59044:35712,59045:35724,59046:35726,59047:35730,59048:35731,59049:35734,59050:35737,59051:35738,59052:35898,59053:35905,59054:35903,59055:35912,59056:35916,59057:35918,59058:35920,59059:35925,59060:35938,59061:35948,59062:35960,59063:35962,59064:35970,59065:35977,59066:35973,59067:35978,59068:35981,59069:35982,59070:35988,59071:35964,59072:35992,59073:25117,59074:36013,59075:36010,59076:36029,59077:36018,59078:36019,59079:36014,59080:36022,59081:36040,59082:36033,59083:36068,59084:36067,59085:36058,59086:36093,59087:36090,59088:36091,59089:36100,59090:36101,59091:36106,59092:36103,59093:36111,59094:36109,59095:36112,59096:40782,59097:36115,59098:36045,59099:36116,59100:36118,59101:36199,59102:36205,59103:36209,59104:36211,59105:36225,59106:36249,59107:36290,59108:36286,59109:36282,59110:36303,59111:36314,59112:36310,59113:36300,59114:36315,59115:36299,59116:36330,59117:36331,59118:36319,59119:36323,59120:36348,59121:36360,59122:36361,59123:36351,59124:36381,59125:36382,59126:36368,59127:36383,59128:36418,59129:36405,59130:36400,59131:36404,59132:36426,59200:36423,59201:36425,59202:36428,59203:36432,59204:36424,59205:36441,59206:36452,59207:36448,59208:36394,59209:36451,59210:36437,59211:36470,59212:36466,59213:36476,59214:36481,59215:36487,59216:36485,59217:36484,59218:36491,59219:36490,59220:36499,59221:36497,59222:36500,59223:36505,59224:36522,59225:36513,59226:36524,59227:36528,59228:36550,59229:36529,59230:36542,59231:36549,59232:36552,59233:36555,59234:36571,59235:36579,59236:36604,59237:36603,59238:36587,59239:36606,59240:36618,59241:36613,59242:36629,59243:36626,59244:36633,59245:36627,59246:36636,59247:36639,59248:36635,59249:36620,59250:36646,59251:36659,59252:36667,59253:36665,59254:36677,59255:36674,59256:36670,59257:36684,59258:36681,59259:36678,59260:36686,59261:36695,59262:36700,59264:36706,59265:36707,59266:36708,59267:36764,59268:36767,59269:36771,59270:36781,59271:36783,59272:36791,59273:36826,59274:36837,59275:36834,59276:36842,59277:36847,59278:36999,59279:36852,59280:36869,59281:36857,59282:36858,59283:36881,59284:36885,59285:36897,59286:36877,59287:36894,59288:36886,59289:36875,59290:36903,59291:36918,59292:36917,59293:36921,59294:36856,59295:36943,59296:36944,59297:36945,59298:36946,59299:36878,59300:36937,59301:36926,59302:36950,59303:36952,59304:36958,59305:36968,59306:36975,59307:36982,59308:38568,59309:36978,59310:36994,59311:36989,59312:36993,59313:36992,59314:37002,59315:37001,59316:37007,59317:37032,59318:37039,59319:37041,59320:37045,59321:37090,59322:37092,59323:25160,59324:37083,59325:37122,59326:37138,59327:37145,59328:37170,59329:37168,59330:37194,59331:37206,59332:37208,59333:37219,59334:37221,59335:37225,59336:37235,59337:37234,59338:37259,59339:37257,59340:37250,59341:37282,59342:37291,59343:37295,59344:37290,59345:37301,59346:37300,59347:37306,59348:37312,59349:37313,59350:37321,59351:37323,59352:37328,59353:37334,59354:37343,59355:37345,59356:37339,59357:37372,59358:37365,59359:37366,59360:37406,59361:37375,59362:37396,59363:37420,59364:37397,59365:37393,59366:37470,59367:37463,59368:37445,59369:37449,59370:37476,59371:37448,59372:37525,59373:37439,59374:37451,59375:37456,59376:37532,59377:37526,59378:37523,59379:37531,59380:37466,59381:37583,59382:37561,59383:37559,59384:37609,59385:37647,59386:37626,59387:37700,59388:37678,59456:37657,59457:37666,59458:37658,59459:37667,59460:37690,59461:37685,59462:37691,59463:37724,59464:37728,59465:37756,59466:37742,59467:37718,59468:37808,59469:37804,59470:37805,59471:37780,59472:37817,59473:37846,59474:37847,59475:37864,59476:37861,59477:37848,59478:37827,59479:37853,59480:37840,59481:37832,59482:37860,59483:37914,59484:37908,59485:37907,59486:37891,59487:37895,59488:37904,59489:37942,59490:37931,59491:37941,59492:37921,59493:37946,59494:37953,59495:37970,59496:37956,59497:37979,59498:37984,59499:37986,59500:37982,59501:37994,59502:37417,59503:38e3,59504:38005,59505:38007,59506:38013,59507:37978,59508:38012,59509:38014,59510:38017,59511:38015,59512:38274,59513:38279,59514:38282,59515:38292,59516:38294,59517:38296,59518:38297,59520:38304,59521:38312,59522:38311,59523:38317,59524:38332,59525:38331,59526:38329,59527:38334,59528:38346,59529:28662,59530:38339,59531:38349,59532:38348,59533:38357,59534:38356,59535:38358,59536:38364,59537:38369,59538:38373,59539:38370,59540:38433,59541:38440,59542:38446,59543:38447,59544:38466,59545:38476,59546:38479,59547:38475,59548:38519,59549:38492,59550:38494,59551:38493,59552:38495,59553:38502,59554:38514,59555:38508,59556:38541,59557:38552,59558:38549,59559:38551,59560:38570,59561:38567,59562:38577,59563:38578,59564:38576,59565:38580,59566:38582,59567:38584,59568:38585,59569:38606,59570:38603,59571:38601,59572:38605,59573:35149,59574:38620,59575:38669,59576:38613,59577:38649,59578:38660,59579:38662,59580:38664,59581:38675,59582:38670,59583:38673,59584:38671,59585:38678,59586:38681,59587:38692,59588:38698,59589:38704,59590:38713,59591:38717,59592:38718,59593:38724,59594:38726,59595:38728,59596:38722,59597:38729,59598:38748,59599:38752,59600:38756,59601:38758,59602:38760,59603:21202,59604:38763,59605:38769,59606:38777,59607:38789,59608:38780,59609:38785,59610:38778,59611:38790,59612:38795,59613:38799,59614:38800,59615:38812,59616:38824,59617:38822,59618:38819,59619:38835,59620:38836,59621:38851,59622:38854,59623:38856,59624:38859,59625:38876,59626:38893,59627:40783,59628:38898,59629:31455,59630:38902,59631:38901,59632:38927,59633:38924,59634:38968,59635:38948,59636:38945,59637:38967,59638:38973,59639:38982,59640:38991,59641:38987,59642:39019,59643:39023,59644:39024,59712:39025,59713:39028,59714:39027,59715:39082,59716:39087,59717:39089,59718:39094,59719:39108,59720:39107,59721:39110,59722:39145,59723:39147,59724:39171,59725:39177,59726:39186,59727:39188,59728:39192,59729:39201,59730:39197,59731:39198,59732:39204,59733:39200,59734:39212,59735:39214,59736:39229,59737:39230,59738:39234,59739:39241,59740:39237,59741:39248,59742:39243,59743:39249,59744:39250,59745:39244,59746:39253,59747:39319,59748:39320,59749:39333,59750:39341,59751:39342,59752:39356,59753:39391,59754:39387,59755:39389,59756:39384,59757:39377,59758:39405,59759:39406,59760:39409,59761:39410,59762:39419,59763:39416,59764:39425,59765:39439,59766:39429,59767:39394,59768:39449,59769:39467,59770:39479,59771:39493,59772:39490,59773:39488,59774:39491,59776:39486,59777:39509,59778:39501,59779:39515,59780:39511,59781:39519,59782:39522,59783:39525,59784:39524,59785:39529,59786:39531,59787:39530,59788:39597,59789:39600,59790:39612,59791:39616,59792:39631,59793:39633,59794:39635,59795:39636,59796:39646,59797:39647,59798:39650,59799:39651,59800:39654,59801:39663,59802:39659,59803:39662,59804:39668,59805:39665,59806:39671,59807:39675,59808:39686,59809:39704,59810:39706,59811:39711,59812:39714,59813:39715,59814:39717,59815:39719,59816:39720,59817:39721,59818:39722,59819:39726,59820:39727,59821:39730,59822:39748,59823:39747,59824:39759,59825:39757,59826:39758,59827:39761,59828:39768,59829:39796,59830:39827,59831:39811,59832:39825,59833:39830,59834:39831,59835:39839,59836:39840,59837:39848,59838:39860,59839:39872,59840:39882,59841:39865,59842:39878,59843:39887,59844:39889,59845:39890,59846:39907,59847:39906,59848:39908,59849:39892,59850:39905,59851:39994,59852:39922,59853:39921,59854:39920,59855:39957,59856:39956,59857:39945,59858:39955,59859:39948,59860:39942,59861:39944,59862:39954,59863:39946,59864:39940,59865:39982,59866:39963,59867:39973,59868:39972,59869:39969,59870:39984,59871:40007,59872:39986,59873:40006,59874:39998,59875:40026,59876:40032,59877:40039,59878:40054,59879:40056,59880:40167,59881:40172,59882:40176,59883:40201,59884:40200,59885:40171,59886:40195,59887:40198,59888:40234,59889:40230,59890:40367,59891:40227,59892:40223,59893:40260,59894:40213,59895:40210,59896:40257,59897:40255,59898:40254,59899:40262,59900:40264,59968:40285,59969:40286,59970:40292,59971:40273,59972:40272,59973:40281,59974:40306,59975:40329,59976:40327,59977:40363,59978:40303,59979:40314,59980:40346,59981:40356,59982:40361,59983:40370,59984:40388,59985:40385,59986:40379,59987:40376,59988:40378,59989:40390,59990:40399,59991:40386,59992:40409,59993:40403,59994:40440,59995:40422,59996:40429,59997:40431,59998:40445,59999:40474,60000:40475,60001:40478,60002:40565,60003:40569,60004:40573,60005:40577,60006:40584,60007:40587,60008:40588,60009:40594,60010:40597,60011:40593,60012:40605,60013:40613,60014:40617,60015:40632,60016:40618,60017:40621,60018:38753,60019:40652,60020:40654,60021:40655,60022:40656,60023:40660,60024:40668,60025:40670,60026:40669,60027:40672,60028:40677,60029:40680,60030:40687,60032:40692,60033:40694,60034:40695,60035:40697,60036:40699,60037:40700,60038:40701,60039:40711,60040:40712,60041:30391,60042:40725,60043:40737,60044:40748,60045:40766,60046:40778,60047:40786,60048:40788,60049:40803,60050:40799,60051:40800,60052:40801,60053:40806,60054:40807,60055:40812,60056:40810,60057:40823,60058:40818,60059:40822,60060:40853,60061:40860,60062:40864,60063:22575,60064:27079,60065:36953,60066:29796,60067:20956,60068:29081,60736:32394,60737:35100,60738:37704,60739:37512,60740:34012,60741:20425,60742:28859,60743:26161,60744:26824,60745:37625,60746:26363,60747:24389,60748:20008,60749:20193,60750:20220,60751:20224,60752:20227,60753:20281,60754:20310,60755:20370,60756:20362,60757:20378,60758:20372,60759:20429,60760:20544,60761:20514,60762:20479,60763:20510,60764:20550,60765:20592,60766:20546,60767:20628,60768:20724,60769:20696,60770:20810,60771:20836,60772:20893,60773:20926,60774:20972,60775:21013,60776:21148,60777:21158,60778:21184,60779:21211,60780:21248,60781:21255,60782:21284,60783:21362,60784:21395,60785:21426,60786:21469,60787:64014,60788:21660,60789:21642,60790:21673,60791:21759,60792:21894,60793:22361,60794:22373,60795:22444,60796:22472,60797:22471,60798:64015,60800:64016,60801:22686,60802:22706,60803:22795,60804:22867,60805:22875,60806:22877,60807:22883,60808:22948,60809:22970,60810:23382,60811:23488,60812:29999,60813:23512,60814:23532,60815:23582,60816:23718,60817:23738,60818:23797,60819:23847,60820:23891,60821:64017,60822:23874,60823:23917,60824:23992,60825:23993,60826:24016,60827:24353,60828:24372,60829:24423,60830:24503,60831:24542,60832:24669,60833:24709,60834:24714,60835:24798,60836:24789,60837:24864,60838:24818,60839:24849,60840:24887,60841:24880,60842:24984,60843:25107,60844:25254,60845:25589,60846:25696,60847:25757,60848:25806,60849:25934,60850:26112,60851:26133,60852:26171,60853:26121,60854:26158,60855:26142,60856:26148,60857:26213,60858:26199,60859:26201,60860:64018,60861:26227,60862:26265,60863:26272,60864:26290,60865:26303,60866:26362,60867:26382,60868:63785,60869:26470,60870:26555,60871:26706,60872:26560,60873:26625,60874:26692,60875:26831,60876:64019,60877:26984,60878:64020,60879:27032,60880:27106,60881:27184,60882:27243,60883:27206,60884:27251,60885:27262,60886:27362,60887:27364,60888:27606,60889:27711,60890:27740,60891:27782,60892:27759,60893:27866,60894:27908,60895:28039,60896:28015,60897:28054,60898:28076,60899:28111,60900:28152,60901:28146,60902:28156,60903:28217,60904:28252,60905:28199,60906:28220,60907:28351,60908:28552,60909:28597,60910:28661,60911:28677,60912:28679,60913:28712,60914:28805,60915:28843,60916:28943,60917:28932,60918:29020,60919:28998,60920:28999,60921:64021,60922:29121,60923:29182,60924:29361,60992:29374,60993:29476,60994:64022,60995:29559,60996:29629,60997:29641,60998:29654,60999:29667,61000:29650,61001:29703,61002:29685,61003:29734,61004:29738,61005:29737,61006:29742,61007:29794,61008:29833,61009:29855,61010:29953,61011:30063,61012:30338,61013:30364,61014:30366,61015:30363,61016:30374,61017:64023,61018:30534,61019:21167,61020:30753,61021:30798,61022:30820,61023:30842,61024:31024,61025:64024,61026:64025,61027:64026,61028:31124,61029:64027,61030:31131,61031:31441,61032:31463,61033:64028,61034:31467,61035:31646,61036:64029,61037:32072,61038:32092,61039:32183,61040:32160,61041:32214,61042:32338,61043:32583,61044:32673,61045:64030,61046:33537,61047:33634,61048:33663,61049:33735,61050:33782,61051:33864,61052:33972,61053:34131,61054:34137,61056:34155,61057:64031,61058:34224,61059:64032,61060:64033,61061:34823,61062:35061,61063:35346,61064:35383,61065:35449,61066:35495,61067:35518,61068:35551,61069:64034,61070:35574,61071:35667,61072:35711,61073:36080,61074:36084,61075:36114,61076:36214,61077:64035,61078:36559,61079:64036,61080:64037,61081:36967,61082:37086,61083:64038,61084:37141,61085:37159,61086:37338,61087:37335,61088:37342,61089:37357,61090:37358,61091:37348,61092:37349,61093:37382,61094:37392,61095:37386,61096:37434,61097:37440,61098:37436,61099:37454,61100:37465,61101:37457,61102:37433,61103:37479,61104:37543,61105:37495,61106:37496,61107:37607,61108:37591,61109:37593,61110:37584,61111:64039,61112:37589,61113:37600,61114:37587,61115:37669,61116:37665,61117:37627,61118:64040,61119:37662,61120:37631,61121:37661,61122:37634,61123:37744,61124:37719,61125:37796,61126:37830,61127:37854,61128:37880,61129:37937,61130:37957,61131:37960,61132:38290,61133:63964,61134:64041,61135:38557,61136:38575,61137:38707,61138:38715,61139:38723,61140:38733,61141:38735,61142:38737,61143:38741,61144:38999,61145:39013,61146:64042,61147:64043,61148:39207,61149:64044,61150:39326,61151:39502,61152:39641,61153:39644,61154:39797,61155:39794,61156:39823,61157:39857,61158:39867,61159:39936,61160:40304,61161:40299,61162:64045,61163:40473,61164:40657,61167:8560,61168:8561,61169:8562,61170:8563,61171:8564,61172:8565,61173:8566,61174:8567,61175:8568,61176:8569,61177:65506,61178:65508,61179:65287,61180:65282,61504:57344,61505:57345,61506:57346,61507:57347,61508:57348,61509:57349,61510:57350,61511:57351,61512:57352,61513:57353,61514:57354,61515:57355,61516:57356,61517:57357,61518:57358,61519:57359,61520:57360,61521:57361,61522:57362,61523:57363,61524:57364,61525:57365,61526:57366,61527:57367,61528:57368,61529:57369,61530:57370,61531:57371,61532:57372,61533:57373,61534:57374,61535:57375,61536:57376,61537:57377,61538:57378,61539:57379,61540:57380,61541:57381,61542:57382,61543:57383,61544:57384,61545:57385,61546:57386,61547:57387,61548:57388,61549:57389,61550:57390,61551:57391,61552:57392,61553:57393,61554:57394,61555:57395,61556:57396,61557:57397,61558:57398,61559:57399,61560:57400,61561:57401,61562:57402,61563:57403,61564:57404,61565:57405,61566:57406,61568:57407,61569:57408,61570:57409,61571:57410,61572:57411,61573:57412,61574:57413,61575:57414,61576:57415,61577:57416,61578:57417,61579:57418,61580:57419,61581:57420,61582:57421,61583:57422,61584:57423,61585:57424,61586:57425,61587:57426,61588:57427,61589:57428,61590:57429,61591:57430,61592:57431,61593:57432,61594:57433,61595:57434,61596:57435,61597:57436,61598:57437,61599:57438,61600:57439,61601:57440,61602:57441,61603:57442,61604:57443,61605:57444,61606:57445,61607:57446,61608:57447,61609:57448,61610:57449,61611:57450,61612:57451,61613:57452,61614:57453,61615:57454,61616:57455,61617:57456,61618:57457,61619:57458,61620:57459,61621:57460,61622:57461,61623:57462,61624:57463,61625:57464,61626:57465,61627:57466,61628:57467,61629:57468,61630:57469,61631:57470,61632:57471,61633:57472,61634:57473,61635:57474,61636:57475,61637:57476,61638:57477,61639:57478,61640:57479,61641:57480,61642:57481,61643:57482,61644:57483,61645:57484,61646:57485,61647:57486,61648:57487,61649:57488,61650:57489,61651:57490,61652:57491,61653:57492,61654:57493,61655:57494,61656:57495,61657:57496,61658:57497,61659:57498,61660:57499,61661:57500,61662:57501,61663:57502,61664:57503,61665:57504,61666:57505,61667:57506,61668:57507,61669:57508,61670:57509,61671:57510,61672:57511,61673:57512,61674:57513,61675:57514,61676:57515,61677:57516,61678:57517,61679:57518,61680:57519,61681:57520,61682:57521,61683:57522,61684:57523,61685:57524,61686:57525,61687:57526,61688:57527,61689:57528,61690:57529,61691:57530,61692:57531,61760:57532,61761:57533,61762:57534,61763:57535,61764:57536,61765:57537,61766:57538,61767:57539,61768:57540,61769:57541,61770:57542,61771:57543,61772:57544,61773:57545,61774:57546,61775:57547,61776:57548,61777:57549,61778:57550,61779:57551,61780:57552,61781:57553,61782:57554,61783:57555,61784:57556,61785:57557,61786:57558,61787:57559,61788:57560,61789:57561,61790:57562,61791:57563,61792:57564,61793:57565,61794:57566,61795:57567,61796:57568,61797:57569,61798:57570,61799:57571,61800:57572,61801:57573,61802:57574,61803:57575,61804:57576,61805:57577,61806:57578,61807:57579,61808:57580,61809:57581,61810:57582,61811:57583,61812:57584,61813:57585,61814:57586,61815:57587,61816:57588,61817:57589,61818:57590,61819:57591,61820:57592,61821:57593,61822:57594,61824:57595,61825:57596,61826:57597,61827:57598,61828:57599,61829:57600,61830:57601,61831:57602,61832:57603,61833:57604,61834:57605,61835:57606,61836:57607,61837:57608,61838:57609,61839:57610,61840:57611,61841:57612,61842:57613,61843:57614,61844:57615,61845:57616,61846:57617,61847:57618,61848:57619,61849:57620,61850:57621,61851:57622,61852:57623,61853:57624,61854:57625,61855:57626,61856:57627,61857:57628,61858:57629,61859:57630,61860:57631,61861:57632,61862:57633,61863:57634,61864:57635,61865:57636,61866:57637,61867:57638,61868:57639,61869:57640,61870:57641,61871:57642,61872:57643,61873:57644,61874:57645,61875:57646,61876:57647,61877:57648,61878:57649,61879:57650,61880:57651,61881:57652,61882:57653,61883:57654,61884:57655,61885:57656,61886:57657,61887:57658,61888:57659,61889:57660,61890:57661,61891:57662,61892:57663,61893:57664,61894:57665,61895:57666,61896:57667,61897:57668,61898:57669,61899:57670,61900:57671,61901:57672,61902:57673,61903:57674,61904:57675,61905:57676,61906:57677,61907:57678,61908:57679,61909:57680,61910:57681,61911:57682,61912:57683,61913:57684,61914:57685,61915:57686,61916:57687,61917:57688,61918:57689,61919:57690,61920:57691,61921:57692,61922:57693,61923:57694,61924:57695,61925:57696,61926:57697,61927:57698,61928:57699,61929:57700,61930:57701,61931:57702,61932:57703,61933:57704,61934:57705,61935:57706,61936:57707,61937:57708,61938:57709,61939:57710,61940:57711,61941:57712,61942:57713,61943:57714,61944:57715,61945:57716,61946:57717,61947:57718,61948:57719,62016:57720,62017:57721,62018:57722,62019:57723,62020:57724,62021:57725,62022:57726,62023:57727,62024:57728,62025:57729,62026:57730,62027:57731,62028:57732,62029:57733,62030:57734,62031:57735,62032:57736,62033:57737,62034:57738,62035:57739,62036:57740,62037:57741,62038:57742,62039:57743,62040:57744,62041:57745,62042:57746,62043:57747,62044:57748,62045:57749,62046:57750,62047:57751,62048:57752,62049:57753,62050:57754,62051:57755,62052:57756,62053:57757,62054:57758,62055:57759,62056:57760,62057:57761,62058:57762,62059:57763,62060:57764,62061:57765,62062:57766,62063:57767,62064:57768,62065:57769,62066:57770,62067:57771,62068:57772,62069:57773,62070:57774,62071:57775,62072:57776,62073:57777,62074:57778,62075:57779,62076:57780,62077:57781,62078:57782,62080:57783,62081:57784,62082:57785,62083:57786,62084:57787,62085:57788,62086:57789,62087:57790,62088:57791,62089:57792,62090:57793,62091:57794,62092:57795,62093:57796,62094:57797,62095:57798,62096:57799,62097:57800,62098:57801,62099:57802,62100:57803,62101:57804,62102:57805,62103:57806,62104:57807,62105:57808,62106:57809,62107:57810,62108:57811,62109:57812,62110:57813,62111:57814,62112:57815,62113:57816,62114:57817,62115:57818,62116:57819,62117:57820,62118:57821,62119:57822,62120:57823,62121:57824,62122:57825,62123:57826,62124:57827,62125:57828,62126:57829,62127:57830,62128:57831,62129:57832,62130:57833,62131:57834,62132:57835,62133:57836,62134:57837,62135:57838,62136:57839,62137:57840,62138:57841,62139:57842,62140:57843,62141:57844,62142:57845,62143:57846,62144:57847,62145:57848,62146:57849,62147:57850,62148:57851,62149:57852,62150:57853,62151:57854,62152:57855,62153:57856,62154:57857,62155:57858,62156:57859,62157:57860,62158:57861,62159:57862,62160:57863,62161:57864,62162:57865,62163:57866,62164:57867,62165:57868,62166:57869,62167:57870,62168:57871,62169:57872,62170:57873,62171:57874,62172:57875,62173:57876,62174:57877,62175:57878,62176:57879,62177:57880,62178:57881,62179:57882,62180:57883,62181:57884,62182:57885,62183:57886,62184:57887,62185:57888,62186:57889,62187:57890,62188:57891,62189:57892,62190:57893,62191:57894,62192:57895,62193:57896,62194:57897,62195:57898,62196:57899,62197:57900,62198:57901,62199:57902,62200:57903,62201:57904,62202:57905,62203:57906,62204:57907,62272:57908,62273:57909,62274:57910,62275:57911,62276:57912,62277:57913,62278:57914,62279:57915,62280:57916,62281:57917,62282:57918,62283:57919,62284:57920,62285:57921,62286:57922,62287:57923,62288:57924,62289:57925,62290:57926,62291:57927,62292:57928,62293:57929,62294:57930,62295:57931,62296:57932,62297:57933,62298:57934,62299:57935,62300:57936,62301:57937,62302:57938,62303:57939,62304:57940,62305:57941,62306:57942,62307:57943,62308:57944,62309:57945,62310:57946,62311:57947,62312:57948,62313:57949,62314:57950,62315:57951,62316:57952,62317:57953,62318:57954,62319:57955,62320:57956,62321:57957,62322:57958,62323:57959,62324:57960,62325:57961,62326:57962,62327:57963,62328:57964,62329:57965,62330:57966,62331:57967,62332:57968,62333:57969,62334:57970,62336:57971,62337:57972,62338:57973,62339:57974,62340:57975,62341:57976,62342:57977,62343:57978,62344:57979,62345:57980,62346:57981,62347:57982,62348:57983,62349:57984,62350:57985,62351:57986,62352:57987,62353:57988,62354:57989,62355:57990,62356:57991,62357:57992,62358:57993,62359:57994,62360:57995,62361:57996,62362:57997,62363:57998,62364:57999,62365:58e3,62366:58001,62367:58002,62368:58003,62369:58004,62370:58005,62371:58006,62372:58007,62373:58008,62374:58009,62375:58010,62376:58011,62377:58012,62378:58013,62379:58014,62380:58015,62381:58016,62382:58017,62383:58018,62384:58019,62385:58020,62386:58021,62387:58022,62388:58023,62389:58024,62390:58025,62391:58026,62392:58027,62393:58028,62394:58029,62395:58030,62396:58031,62397:58032,62398:58033,62399:58034,62400:58035,62401:58036,62402:58037,62403:58038,62404:58039,62405:58040,62406:58041,62407:58042,62408:58043,62409:58044,62410:58045,62411:58046,62412:58047,62413:58048,62414:58049,62415:58050,62416:58051,62417:58052,62418:58053,62419:58054,62420:58055,62421:58056,62422:58057,62423:58058,62424:58059,62425:58060,62426:58061,62427:58062,62428:58063,62429:58064,62430:58065,62431:58066,62432:58067,62433:58068,62434:58069,62435:58070,62436:58071,62437:58072,62438:58073,62439:58074,62440:58075,62441:58076,62442:58077,62443:58078,62444:58079,62445:58080,62446:58081,62447:58082,62448:58083,62449:58084,62450:58085,62451:58086,62452:58087,62453:58088,62454:58089,62455:58090,62456:58091,62457:58092,62458:58093,62459:58094,62460:58095,62528:58096,62529:58097,62530:58098,62531:58099,62532:58100,62533:58101,62534:58102,62535:58103,62536:58104,62537:58105,62538:58106,62539:58107,62540:58108,62541:58109,62542:58110,62543:58111,62544:58112,62545:58113,62546:58114,62547:58115,62548:58116,62549:58117,62550:58118,62551:58119,62552:58120,62553:58121,62554:58122,62555:58123,62556:58124,62557:58125,62558:58126,62559:58127,62560:58128,62561:58129,62562:58130,62563:58131,62564:58132,62565:58133,62566:58134,62567:58135,62568:58136,62569:58137,62570:58138,62571:58139,62572:58140,62573:58141,62574:58142,62575:58143,62576:58144,62577:58145,62578:58146,62579:58147,62580:58148,62581:58149,62582:58150,62583:58151,62584:58152,62585:58153,62586:58154,62587:58155,62588:58156,62589:58157,62590:58158,62592:58159,62593:58160,62594:58161,62595:58162,62596:58163,62597:58164,62598:58165,62599:58166,62600:58167,62601:58168,62602:58169,62603:58170,62604:58171,62605:58172,62606:58173,62607:58174,62608:58175,62609:58176,62610:58177,62611:58178,62612:58179,62613:58180,62614:58181,62615:58182,62616:58183,62617:58184,62618:58185,62619:58186,62620:58187,62621:58188,62622:58189,62623:58190,62624:58191,62625:58192,62626:58193,62627:58194,62628:58195,62629:58196,62630:58197,62631:58198,62632:58199,62633:58200,62634:58201,62635:58202,62636:58203,62637:58204,62638:58205,62639:58206,62640:58207,62641:58208,62642:58209,62643:58210,62644:58211,62645:58212,62646:58213,62647:58214,62648:58215,62649:58216,62650:58217,62651:58218,62652:58219,62653:58220,62654:58221,62655:58222,62656:58223,62657:58224,62658:58225,62659:58226,62660:58227,62661:58228,62662:58229,62663:58230,62664:58231,62665:58232,62666:58233,62667:58234,62668:58235,62669:58236,62670:58237,62671:58238,62672:58239,62673:58240,62674:58241,62675:58242,62676:58243,62677:58244,62678:58245,62679:58246,62680:58247,62681:58248,62682:58249,62683:58250,62684:58251,62685:58252,62686:58253,62687:58254,62688:58255,62689:58256,62690:58257,62691:58258,62692:58259,62693:58260,62694:58261,62695:58262,62696:58263,62697:58264,62698:58265,62699:58266,62700:58267,62701:58268,62702:58269,62703:58270,62704:58271,62705:58272,62706:58273,62707:58274,62708:58275,62709:58276,62710:58277,62711:58278,62712:58279,62713:58280,62714:58281,62715:58282,62716:58283,62784:58284,62785:58285,62786:58286,62787:58287,62788:58288,62789:58289,62790:58290,62791:58291,62792:58292,62793:58293,62794:58294,62795:58295,62796:58296,62797:58297,62798:58298,62799:58299,62800:58300,62801:58301,62802:58302,62803:58303,62804:58304,62805:58305,62806:58306,62807:58307,62808:58308,62809:58309,62810:58310,62811:58311,62812:58312,62813:58313,62814:58314,62815:58315,62816:58316,62817:58317,62818:58318,62819:58319,62820:58320,62821:58321,62822:58322,62823:58323,62824:58324,62825:58325,62826:58326,62827:58327,62828:58328,62829:58329,62830:58330,62831:58331,62832:58332,62833:58333,62834:58334,62835:58335,62836:58336,62837:58337,62838:58338,62839:58339,62840:58340,62841:58341,62842:58342,62843:58343,62844:58344,62845:58345,62846:58346,62848:58347,62849:58348,62850:58349,62851:58350,62852:58351,62853:58352,62854:58353,62855:58354,62856:58355,62857:58356,62858:58357,62859:58358,62860:58359,62861:58360,62862:58361,62863:58362,62864:58363,62865:58364,62866:58365,62867:58366,62868:58367,62869:58368,62870:58369,62871:58370,62872:58371,62873:58372,62874:58373,62875:58374,62876:58375,62877:58376,62878:58377,62879:58378,62880:58379,62881:58380,62882:58381,62883:58382,62884:58383,62885:58384,62886:58385,62887:58386,62888:58387,62889:58388,62890:58389,62891:58390,62892:58391,62893:58392,62894:58393,62895:58394,62896:58395,62897:58396,62898:58397,62899:58398,62900:58399,62901:58400,62902:58401,62903:58402,62904:58403,62905:58404,62906:58405,62907:58406,62908:58407,62909:58408,62910:58409,62911:58410,62912:58411,62913:58412,62914:58413,62915:58414,62916:58415,62917:58416,62918:58417,62919:58418,62920:58419,62921:58420,62922:58421,62923:58422,62924:58423,62925:58424,62926:58425,62927:58426,62928:58427,62929:58428,62930:58429,62931:58430,62932:58431,62933:58432,62934:58433,62935:58434,62936:58435,62937:58436,62938:58437,62939:58438,62940:58439,62941:58440,62942:58441,62943:58442,62944:58443,62945:58444,62946:58445,62947:58446,62948:58447,62949:58448,62950:58449,62951:58450,62952:58451,62953:58452,62954:58453,62955:58454,62956:58455,62957:58456,62958:58457,62959:58458,62960:58459,62961:58460,62962:58461,62963:58462,62964:58463,62965:58464,62966:58465,62967:58466,62968:58467,62969:58468,62970:58469,62971:58470,62972:58471,63040:58472,63041:58473,63042:58474,63043:58475,63044:58476,63045:58477,63046:58478,63047:58479,63048:58480,63049:58481,63050:58482,63051:58483,63052:58484,63053:58485,63054:58486,63055:58487,63056:58488,63057:58489,63058:58490,63059:58491,63060:58492,63061:58493,63062:58494,63063:58495,63064:58496,63065:58497,63066:58498,63067:58499,63068:58500,63069:58501,63070:58502,63071:58503,63072:58504,63073:58505,63074:58506,63075:58507,63076:58508,63077:58509,63078:58510,63079:58511,63080:58512,63081:58513,63082:58514,63083:58515,63084:58516,63085:58517,63086:58518,63087:58519,63088:58520,63089:58521,63090:58522,63091:58523,63092:58524,63093:58525,63094:58526,63095:58527,63096:58528,63097:58529,63098:58530,63099:58531,63100:58532,63101:58533,63102:58534,63104:58535,63105:58536,63106:58537,63107:58538,63108:58539,63109:58540,63110:58541,63111:58542,63112:58543,63113:58544,63114:58545,63115:58546,63116:58547,63117:58548,63118:58549,63119:58550,63120:58551,63121:58552,63122:58553,63123:58554,63124:58555,63125:58556,63126:58557,63127:58558,63128:58559,63129:58560,63130:58561,63131:58562,63132:58563,63133:58564,63134:58565,63135:58566,63136:58567,63137:58568,63138:58569,63139:58570,63140:58571,63141:58572,63142:58573,63143:58574,63144:58575,63145:58576,63146:58577,63147:58578,63148:58579,63149:58580,63150:58581,63151:58582,63152:58583,63153:58584,63154:58585,63155:58586,63156:58587,63157:58588,63158:58589,63159:58590,63160:58591,63161:58592,63162:58593,63163:58594,63164:58595,63165:58596,63166:58597,63167:58598,63168:58599,63169:58600,63170:58601,63171:58602,63172:58603,63173:58604,63174:58605,63175:58606,63176:58607,63177:58608,63178:58609,63179:58610,63180:58611,63181:58612,63182:58613,63183:58614,63184:58615,63185:58616,63186:58617,63187:58618,63188:58619,63189:58620,63190:58621,63191:58622,63192:58623,63193:58624,63194:58625,63195:58626,63196:58627,63197:58628,63198:58629,63199:58630,63200:58631,63201:58632,63202:58633,63203:58634,63204:58635,63205:58636,63206:58637,63207:58638,63208:58639,63209:58640,63210:58641,63211:58642,63212:58643,63213:58644,63214:58645,63215:58646,63216:58647,63217:58648,63218:58649,63219:58650,63220:58651,63221:58652,63222:58653,63223:58654,63224:58655,63225:58656,63226:58657,63227:58658,63228:58659,63296:58660,63297:58661,63298:58662,63299:58663,63300:58664,63301:58665,63302:58666,63303:58667,63304:58668,63305:58669,63306:58670,63307:58671,63308:58672,63309:58673,63310:58674,63311:58675,63312:58676,63313:58677,63314:58678,63315:58679,63316:58680,63317:58681,63318:58682,63319:58683,63320:58684,63321:58685,63322:58686,63323:58687,63324:58688,63325:58689,63326:58690,63327:58691,63328:58692,63329:58693,63330:58694,63331:58695,63332:58696,63333:58697,63334:58698,63335:58699,63336:58700,63337:58701,63338:58702,63339:58703,63340:58704,63341:58705,63342:58706,63343:58707,63344:58708,63345:58709,63346:58710,63347:58711,63348:58712,63349:58713,63350:58714,63351:58715,63352:58716,63353:58717,63354:58718,63355:58719,63356:58720,63357:58721,63358:58722,63360:58723,63361:58724,63362:58725,63363:58726,63364:58727,63365:58728,63366:58729,63367:58730,63368:58731,63369:58732,63370:58733,63371:58734,63372:58735,63373:58736,63374:58737,63375:58738,63376:58739,63377:58740,63378:58741,63379:58742,63380:58743,63381:58744,63382:58745,63383:58746,63384:58747,63385:58748,63386:58749,63387:58750,63388:58751,63389:58752,63390:58753,63391:58754,63392:58755,63393:58756,63394:58757,63395:58758,63396:58759,63397:58760,63398:58761,63399:58762,63400:58763,63401:58764,63402:58765,63403:58766,63404:58767,63405:58768,63406:58769,63407:58770,63408:58771,63409:58772,63410:58773,63411:58774,63412:58775,63413:58776,63414:58777,63415:58778,63416:58779,63417:58780,63418:58781,63419:58782,63420:58783,63421:58784,63422:58785,63423:58786,63424:58787,63425:58788,63426:58789,63427:58790,63428:58791,63429:58792,63430:58793,63431:58794,63432:58795,63433:58796,63434:58797,63435:58798,63436:58799,63437:58800,63438:58801,63439:58802,63440:58803,63441:58804,63442:58805,63443:58806,63444:58807,63445:58808,63446:58809,63447:58810,63448:58811,63449:58812,63450:58813,63451:58814,63452:58815,63453:58816,63454:58817,63455:58818,63456:58819,63457:58820,63458:58821,63459:58822,63460:58823,63461:58824,63462:58825,63463:58826,63464:58827,63465:58828,63466:58829,63467:58830,63468:58831,63469:58832,63470:58833,63471:58834,63472:58835,63473:58836,63474:58837,63475:58838,63476:58839,63477:58840,63478:58841,63479:58842,63480:58843,63481:58844,63482:58845,63483:58846,63484:58847,63552:58848,63553:58849,63554:58850,63555:58851,63556:58852,63557:58853,63558:58854,63559:58855,63560:58856,63561:58857,63562:58858,63563:58859,63564:58860,63565:58861,63566:58862,63567:58863,63568:58864,63569:58865,63570:58866,63571:58867,63572:58868,63573:58869,63574:58870,63575:58871,63576:58872,63577:58873,63578:58874,63579:58875,63580:58876,63581:58877,63582:58878,63583:58879,63584:58880,63585:58881,63586:58882,63587:58883,63588:58884,63589:58885,63590:58886,63591:58887,63592:58888,63593:58889,63594:58890,63595:58891,63596:58892,63597:58893,63598:58894,63599:58895,63600:58896,63601:58897,63602:58898,63603:58899,63604:58900,63605:58901,63606:58902,63607:58903,63608:58904,63609:58905,63610:58906,63611:58907,63612:58908,63613:58909,63614:58910,63616:58911,63617:58912,63618:58913,63619:58914,63620:58915,63621:58916,63622:58917,63623:58918,63624:58919,63625:58920,63626:58921,63627:58922,63628:58923,63629:58924,63630:58925,63631:58926,63632:58927,63633:58928,63634:58929,63635:58930,63636:58931,63637:58932,63638:58933,63639:58934,63640:58935,63641:58936,63642:58937,63643:58938,63644:58939,63645:58940,63646:58941,63647:58942,63648:58943,63649:58944,63650:58945,63651:58946,63652:58947,63653:58948,63654:58949,63655:58950,63656:58951,63657:58952,63658:58953,63659:58954,63660:58955,63661:58956,63662:58957,63663:58958,63664:58959,63665:58960,63666:58961,63667:58962,63668:58963,63669:58964,63670:58965,63671:58966,63672:58967,63673:58968,63674:58969,63675:58970,63676:58971,63677:58972,63678:58973,63679:58974,63680:58975,63681:58976,63682:58977,63683:58978,63684:58979,63685:58980,63686:58981,63687:58982,63688:58983,63689:58984,63690:58985,63691:58986,63692:58987,63693:58988,63694:58989,63695:58990,63696:58991,63697:58992,63698:58993,63699:58994,63700:58995,63701:58996,63702:58997,63703:58998,63704:58999,63705:59e3,63706:59001,63707:59002,63708:59003,63709:59004,63710:59005,63711:59006,63712:59007,63713:59008,63714:59009,63715:59010,63716:59011,63717:59012,63718:59013,63719:59014,63720:59015,63721:59016,63722:59017,63723:59018,63724:59019,63725:59020,63726:59021,63727:59022,63728:59023,63729:59024,63730:59025,63731:59026,63732:59027,63733:59028,63734:59029,63735:59030,63736:59031,63737:59032,63738:59033,63739:59034,63740:59035,64064:8560,64065:8561,64066:8562,64067:8563,64068:8564,64069:8565,64070:8566,64071:8567,64072:8568,64073:8569,64074:8544,64075:8545,64076:8546,64077:8547,64078:8548,64079:8549,64080:8550,64081:8551,64082:8552,64083:8553,64084:65506,64085:65508,64086:65287,64087:65282,64088:12849,64089:8470,64090:8481,64091:8757,64092:32394,64093:35100,64094:37704,64095:37512,64096:34012,64097:20425,64098:28859,64099:26161,64100:26824,64101:37625,64102:26363,64103:24389,64104:20008,64105:20193,64106:20220,64107:20224,64108:20227,64109:20281,64110:20310,64111:20370,64112:20362,64113:20378,64114:20372,64115:20429,64116:20544,64117:20514,64118:20479,64119:20510,64120:20550,64121:20592,64122:20546,64123:20628,64124:20724,64125:20696,64126:20810,64128:20836,64129:20893,64130:20926,64131:20972,64132:21013,64133:21148,64134:21158,64135:21184,64136:21211,64137:21248,64138:21255,64139:21284,64140:21362,64141:21395,64142:21426,64143:21469,64144:64014,64145:21660,64146:21642,64147:21673,64148:21759,64149:21894,64150:22361,64151:22373,64152:22444,64153:22472,64154:22471,64155:64015,64156:64016,64157:22686,64158:22706,64159:22795,64160:22867,64161:22875,64162:22877,64163:22883,64164:22948,64165:22970,64166:23382,64167:23488,64168:29999,64169:23512,64170:23532,64171:23582,64172:23718,64173:23738,64174:23797,64175:23847,64176:23891,64177:64017,64178:23874,64179:23917,64180:23992,64181:23993,64182:24016,64183:24353,64184:24372,64185:24423,64186:24503,64187:24542,64188:24669,64189:24709,64190:24714,64191:24798,64192:24789,64193:24864,64194:24818,64195:24849,64196:24887,64197:24880,64198:24984,64199:25107,64200:25254,64201:25589,64202:25696,64203:25757,64204:25806,64205:25934,64206:26112,64207:26133,64208:26171,64209:26121,64210:26158,64211:26142,64212:26148,64213:26213,64214:26199,64215:26201,64216:64018,64217:26227,64218:26265,64219:26272,64220:26290,64221:26303,64222:26362,64223:26382,64224:63785,64225:26470,64226:26555,64227:26706,64228:26560,64229:26625,64230:26692,64231:26831,64232:64019,64233:26984,64234:64020,64235:27032,64236:27106,64237:27184,64238:27243,64239:27206,64240:27251,64241:27262,64242:27362,64243:27364,64244:27606,64245:27711,64246:27740,64247:27782,64248:27759,64249:27866,64250:27908,64251:28039,64252:28015,64320:28054,64321:28076,64322:28111,64323:28152,64324:28146,64325:28156,64326:28217,64327:28252,64328:28199,64329:28220,64330:28351,64331:28552,64332:28597,64333:28661,64334:28677,64335:28679,64336:28712,64337:28805,64338:28843,64339:28943,64340:28932,64341:29020,64342:28998,64343:28999,64344:64021,64345:29121,64346:29182,64347:29361,64348:29374,64349:29476,64350:64022,64351:29559,64352:29629,64353:29641,64354:29654,64355:29667,64356:29650,64357:29703,64358:29685,64359:29734,64360:29738,64361:29737,64362:29742,64363:29794,64364:29833,64365:29855,64366:29953,64367:30063,64368:30338,64369:30364,64370:30366,64371:30363,64372:30374,64373:64023,64374:30534,64375:21167,64376:30753,64377:30798,64378:30820,64379:30842,64380:31024,64381:64024,64382:64025,64384:64026,64385:31124,64386:64027,64387:31131,64388:31441,64389:31463,64390:64028,64391:31467,64392:31646,64393:64029,64394:32072,64395:32092,64396:32183,64397:32160,64398:32214,64399:32338,64400:32583,64401:32673,64402:64030,64403:33537,64404:33634,64405:33663,64406:33735,64407:33782,64408:33864,64409:33972,64410:34131,64411:34137,64412:34155,64413:64031,64414:34224,64415:64032,64416:64033,64417:34823,64418:35061,64419:35346,64420:35383,64421:35449,64422:35495,64423:35518,64424:35551,64425:64034,64426:35574,64427:35667,64428:35711,64429:36080,64430:36084,64431:36114,64432:36214,64433:64035,64434:36559,64435:64036,64436:64037,64437:36967,64438:37086,64439:64038,64440:37141,64441:37159,64442:37338,64443:37335,64444:37342,64445:37357,64446:37358,64447:37348,64448:37349,64449:37382,64450:37392,64451:37386,64452:37434,64453:37440,64454:37436,64455:37454,64456:37465,64457:37457,64458:37433,64459:37479,64460:37543,64461:37495,64462:37496,64463:37607,64464:37591,64465:37593,64466:37584,64467:64039,64468:37589,64469:37600,64470:37587,64471:37669,64472:37665,64473:37627,64474:64040,64475:37662,64476:37631,64477:37661,64478:37634,64479:37744,64480:37719,64481:37796,64482:37830,64483:37854,64484:37880,64485:37937,64486:37957,64487:37960,64488:38290,64489:63964,64490:64041,64491:38557,64492:38575,64493:38707,64494:38715,64495:38723,64496:38733,64497:38735,64498:38737,64499:38741,64500:38999,64501:39013,64502:64042,64503:64043,64504:39207,64505:64044,64506:39326,64507:39502,64508:39641,64576:39644,64577:39797,64578:39794,64579:39823,64580:39857,64581:39867,64582:39936,64583:40304,64584:40299,64585:64045,64586:40473,64587:40657},n.prototype={constructor:n,getInt8:function(){var e=this.dv.getInt8(this.offset);return this.offset+=1,e},getInt8Array:function(e){for(var t=[],n=0;n<e;n++)t.push(this.getInt8());return t},getUint8:function(){var e=this.dv.getUint8(this.offset);return this.offset+=1,e},getUint8Array:function(e){for(var t=[],n=0;n<e;n++)t.push(this.getUint8());return t},getInt16:function(){var e=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,e},getInt16Array:function(e){for(var t=[],n=0;n<e;n++)t.push(this.getInt16());return t},getUint16:function(){var e=this.dv.getUint16(this.offset,this.littleEndian);return this.offset+=2,e},getUint16Array:function(e){for(var t=[],n=0;n<e;n++)t.push(this.getUint16());return t},getInt32:function(){var e=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,e},getInt32Array:function(e){for(var t=[],n=0;n<e;n++)t.push(this.getInt32());return t},getUint32:function(){var e=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,e},getUint32Array:function(e){for(var t=[],n=0;n<e;n++)t.push(this.getUint32());return t},getFloat32:function(){var e=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e},getFloat32Array:function(e){for(var t=[],n=0;n<e;n++)t.push(this.getFloat32());return t},getFloat64:function(){var e=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e},getFloat64Array:function(e){for(var t=[],n=0;n<e;n++)t.push(this.getFloat64());return t},getIndex:function(e,t){switch(e){case 1:return!0===t?this.getUint8():this.getInt8();case 2:return!0===t?this.getUint16():this.getInt16();case 4:return this.getInt32();default:throw"unknown number type "+e+" exception."}},getIndexArray:function(e,t,n){for(var i=[],r=0;r<t;r++)i.push(this.getIndex(e,n));return i},getChars:function(e){for(var t="";e>0;){var n=this.getUint8();if(e--,0===n)break;t+=String.fromCharCode(n)}for(;e>0;)this.getUint8(),e--;return t},getSjisStringsAsUnicode:function(e){for(var t=[];e>0;){var n=this.getUint8();if(e--,0===n)break;t.push(n)}for(;e>0;)this.getUint8(),e--;return this.encoder.s2u(new Uint8Array(t))},getUnicodeStrings:function(e){for(var t="";e>0;){var n=this.getUint16();if(e-=2,0===n)break;t+=String.fromCharCode(n)}for(;e>0;)this.getUint8(),e--;return t},getTextBuffer:function(){var e=this.getUint32();return this.getUnicodeStrings(e)}},i.prototype={constructor:i,leftToRightVector3:function(e){e[2]=-e[2]},leftToRightQuaternion:function(e){e[0]=-e[0],e[1]=-e[1]},leftToRightEuler:function(e){e[0]=-e[0],e[1]=-e[1]},leftToRightIndexOrder:function(e){var t=e[2];e[2]=e[0],e[0]=t},leftToRightVector3Range:function(e,t){var n=-t[2];t[2]=-e[2],e[2]=n},leftToRightEulerRange:function(e,t){var n=-t[0],i=-t[1];t[0]=-e[0],t[1]=-e[1],e[0]=n,e[1]=i}},r.prototype.parsePmd=function(e,t){var i,r={},a=new n(e);return r.metadata={},r.metadata.format="pmd",r.metadata.coordinateSystem="left",function(){var e=r.metadata;if(e.magic=a.getChars(3),"Pmd"!==e.magic)throw"PMD file magic is not Pmd, but "+e.magic;e.version=a.getFloat32(),e.modelName=a.getSjisStringsAsUnicode(20),e.comment=a.getSjisStringsAsUnicode(256)}(),function(){var e,t=r.metadata;t.vertexCount=a.getUint32(),r.vertices=[];for(var n=0;n<t.vertexCount;n++)r.vertices.push((e=void 0,(e={}).position=a.getFloat32Array(3),e.normal=a.getFloat32Array(3),e.uv=a.getFloat32Array(2),e.skinIndices=a.getUint16Array(2),e.skinWeights=[a.getUint8()/100],e.skinWeights.push(1-e.skinWeights[0]),e.edgeFlag=a.getUint8(),e))}(),function(){var e,t=r.metadata;t.faceCount=a.getUint32()/3,r.faces=[];for(var n=0;n<t.faceCount;n++)r.faces.push((e=void 0,(e={}).indices=a.getUint16Array(3),e))}(),function(){var e,t=r.metadata;t.materialCount=a.getUint32(),r.materials=[];for(var n=0;n<t.materialCount;n++)r.materials.push((e=void 0,(e={}).diffuse=a.getFloat32Array(4),e.shininess=a.getFloat32(),e.specular=a.getFloat32Array(3),e.ambient=a.getFloat32Array(3),e.toonIndex=a.getInt8(),e.edgeFlag=a.getUint8(),e.faceCount=a.getUint32()/3,e.fileName=a.getSjisStringsAsUnicode(20),e))}(),function(){var e,t=r.metadata;t.boneCount=a.getUint16(),r.bones=[];for(var n=0;n<t.boneCount;n++)r.bones.push((e=void 0,(e={}).name=a.getSjisStringsAsUnicode(20),e.parentIndex=a.getInt16(),e.tailIndex=a.getInt16(),e.type=a.getUint8(),e.ikIndex=a.getInt16(),e.position=a.getFloat32Array(3),e))}(),function(){var e=function(){var e={};e.target=a.getUint16(),e.effector=a.getUint16(),e.linkCount=a.getUint8(),e.iteration=a.getUint16(),e.maxAngle=a.getFloat32(),e.links=[];for(var t=0;t<e.linkCount;t++){var n={};n.index=a.getUint16(),e.links.push(n)}return e},t=r.metadata;t.ikCount=a.getUint16(),r.iks=[];for(var n=0;n<t.ikCount;n++)r.iks.push(e())}(),function(){var e=function(){var e={};e.name=a.getSjisStringsAsUnicode(20),e.elementCount=a.getUint32(),e.type=a.getUint8(),e.elements=[];for(var t=0;t<e.elementCount;t++)e.elements.push({index:a.getUint32(),position:a.getFloat32Array(3)});return e},t=r.metadata;t.morphCount=a.getUint16(),r.morphs=[];for(var n=0;n<t.morphCount;n++)r.morphs.push(e())}(),function(){var e,t=r.metadata;t.morphFrameCount=a.getUint8(),r.morphFrames=[];for(var n=0;n<t.morphFrameCount;n++)r.morphFrames.push((e=void 0,(e={}).index=a.getUint16(),e))}(),function(){var e,t=r.metadata;t.boneFrameNameCount=a.getUint8(),r.boneFrameNames=[];for(var n=0;n<t.boneFrameNameCount;n++)r.boneFrameNames.push((e=void 0,(e={}).name=a.getSjisStringsAsUnicode(50),e))}(),function(){var e,t=r.metadata;t.boneFrameCount=a.getUint32(),r.boneFrames=[];for(var n=0;n<t.boneFrameCount;n++)r.boneFrames.push((e=void 0,(e={}).boneIndex=a.getInt16(),e.frameIndex=a.getUint8(),e))}(),(i=r.metadata).englishCompatibility=a.getUint8(),i.englishCompatibility>0&&(i.englishModelName=a.getSjisStringsAsUnicode(20),i.englishComment=a.getSjisStringsAsUnicode(256)),function(){var e=r.metadata;if(0!==e.englishCompatibility){r.englishBoneNames=[];for(var t=0;t<e.boneCount;t++)r.englishBoneNames.push((n=void 0,(n={}).name=a.getSjisStringsAsUnicode(20),n));var n}}(),function(){var e=r.metadata;if(0!==e.englishCompatibility){r.englishMorphNames=[];for(var t=0;t<e.morphCount-1;t++)r.englishMorphNames.push((n=void 0,(n={}).name=a.getSjisStringsAsUnicode(20),n));var n}}(),function(){var e=r.metadata;if(0!==e.englishCompatibility){r.englishBoneFrameNames=[];for(var t=0;t<e.boneFrameNameCount;t++)r.englishBoneFrameNames.push((n=void 0,(n={}).name=a.getSjisStringsAsUnicode(50),n));var n}}(),function(){var e;r.toonTextures=[];for(var t=0;t<10;t++)r.toonTextures.push((e=void 0,(e={}).fileName=a.getSjisStringsAsUnicode(100),e))}(),function(){var e,t=r.metadata;t.rigidBodyCount=a.getUint32(),r.rigidBodies=[];for(var n=0;n<t.rigidBodyCount;n++)r.rigidBodies.push((e=void 0,(e={}).name=a.getSjisStringsAsUnicode(20),e.boneIndex=a.getInt16(),e.groupIndex=a.getUint8(),e.groupTarget=a.getUint16(),e.shapeType=a.getUint8(),e.width=a.getFloat32(),e.height=a.getFloat32(),e.depth=a.getFloat32(),e.position=a.getFloat32Array(3),e.rotation=a.getFloat32Array(3),e.weight=a.getFloat32(),e.positionDamping=a.getFloat32(),e.rotationDamping=a.getFloat32(),e.restitution=a.getFloat32(),e.friction=a.getFloat32(),e.type=a.getUint8(),e))}(),function(){var e,t=r.metadata;t.constraintCount=a.getUint32(),r.constraints=[];for(var n=0;n<t.constraintCount;n++)r.constraints.push((e=void 0,(e={}).name=a.getSjisStringsAsUnicode(20),e.rigidBodyIndex1=a.getUint32(),e.rigidBodyIndex2=a.getUint32(),e.position=a.getFloat32Array(3),e.rotation=a.getFloat32Array(3),e.translationLimitation1=a.getFloat32Array(3),e.translationLimitation2=a.getFloat32Array(3),e.rotationLimitation1=a.getFloat32Array(3),e.rotationLimitation2=a.getFloat32Array(3),e.springPosition=a.getFloat32Array(3),e.springRotation=a.getFloat32Array(3),e))}(),!0===t&&this.leftToRightModel(r),r},r.prototype.parsePmx=function(e,t){var i={},r=new n(e);return i.metadata={},i.metadata.format="pmx",i.metadata.coordinateSystem="left",function(){var e=i.metadata;if(e.magic=r.getChars(4),"PMX "!==e.magic)throw"PMX file magic is not PMX , but "+e.magic;if(e.version=r.getFloat32(),2!==e.version&&2.1!==e.version)throw"PMX version "+e.version+" is not supported.";e.headerSize=r.getUint8(),e.encoding=r.getUint8(),e.additionalUvNum=r.getUint8(),e.vertexIndexSize=r.getUint8(),e.textureIndexSize=r.getUint8(),e.materialIndexSize=r.getUint8(),e.boneIndexSize=r.getUint8(),e.morphIndexSize=r.getUint8(),e.rigidBodyIndexSize=r.getUint8(),e.modelName=r.getTextBuffer(),e.englishModelName=r.getTextBuffer(),e.comment=r.getTextBuffer(),e.englishComment=r.getTextBuffer()}(),function(){var e=function(){var e={};e.position=r.getFloat32Array(3),e.normal=r.getFloat32Array(3),e.uv=r.getFloat32Array(2),e.auvs=[];for(var n=0;n<i.metadata.additionalUvNum;n++)e.auvs.push(r.getFloat32Array(4));e.type=r.getUint8();var a=t.boneIndexSize;if(0===e.type)e.skinIndices=r.getIndexArray(a,1),e.skinWeights=[1];else if(1===e.type)e.skinIndices=r.getIndexArray(a,2),e.skinWeights=r.getFloat32Array(1),e.skinWeights.push(1-e.skinWeights[0]);else if(2===e.type)e.skinIndices=r.getIndexArray(a,4),e.skinWeights=r.getFloat32Array(4);else{if(3!==e.type)throw"unsupport bone type "+e.type+" exception.";e.skinIndices=r.getIndexArray(a,2),e.skinWeights=r.getFloat32Array(1),e.skinWeights.push(1-e.skinWeights[0]),e.skinC=r.getFloat32Array(3),e.skinR0=r.getFloat32Array(3),e.skinR1=r.getFloat32Array(3),e.type=1}return e.edgeRatio=r.getFloat32(),e},t=i.metadata;t.vertexCount=r.getUint32(),i.vertices=[];for(var n=0;n<t.vertexCount;n++)i.vertices.push(e())}(),function(){var e,t=i.metadata;t.faceCount=r.getUint32()/3,i.faces=[];for(var n=0;n<t.faceCount;n++)i.faces.push((e=void 0,(e={}).indices=r.getIndexArray(t.vertexIndexSize,3,!0),e))}(),function(){var e=i.metadata;e.textureCount=r.getUint32(),i.textures=[];for(var t=0;t<e.textureCount;t++)i.textures.push(r.getTextBuffer())}(),function(){var e=function(){var e={};if(e.name=r.getTextBuffer(),e.englishName=r.getTextBuffer(),e.diffuse=r.getFloat32Array(4),e.specular=r.getFloat32Array(3),e.shininess=r.getFloat32(),e.ambient=r.getFloat32Array(3),e.flag=r.getUint8(),e.edgeColor=r.getFloat32Array(4),e.edgeSize=r.getFloat32(),e.textureIndex=r.getIndex(i.metadata.textureIndexSize),e.envTextureIndex=r.getIndex(i.metadata.textureIndexSize),e.envFlag=r.getUint8(),e.toonFlag=r.getUint8(),0===e.toonFlag)e.toonIndex=r.getIndex(i.metadata.textureIndexSize);else{if(1!==e.toonFlag)throw"unknown toon flag "+e.toonFlag+" exception.";e.toonIndex=r.getInt8()}return e.comment=r.getTextBuffer(),e.faceCount=r.getUint32()/3,e},t=i.metadata;t.materialCount=r.getUint32(),i.materials=[];for(var n=0;n<t.materialCount;n++)i.materials.push(e())}(),function(){var e=function(){var e={};if(e.name=r.getTextBuffer(),e.englishName=r.getTextBuffer(),e.position=r.getFloat32Array(3),e.parentIndex=r.getIndex(i.metadata.boneIndexSize),e.transformationClass=r.getUint32(),e.flag=r.getUint16(),1&e.flag?e.connectIndex=r.getIndex(i.metadata.boneIndexSize):e.offsetPosition=r.getFloat32Array(3),256&e.flag||512&e.flag){var t={};t.isLocal=0!=(128&e.flag),t.affectRotation=0!=(256&e.flag),t.affectPosition=0!=(512&e.flag),t.parentIndex=r.getIndex(i.metadata.boneIndexSize),t.ratio=r.getFloat32(),e.grant=t}if(1024&e.flag&&(e.fixAxis=r.getFloat32Array(3)),2048&e.flag&&(e.localXVector=r.getFloat32Array(3),e.localZVector=r.getFloat32Array(3)),8192&e.flag&&(e.key=r.getUint32()),32&e.flag){var n={};n.effector=r.getIndex(i.metadata.boneIndexSize),n.target=null,n.iteration=r.getUint32(),n.maxAngle=r.getFloat32(),n.linkCount=r.getUint32(),n.links=[];for(var a=0;a<n.linkCount;a++){var o={};o.index=r.getIndex(i.metadata.boneIndexSize),o.angleLimitation=r.getUint8(),1===o.angleLimitation&&(o.lowerLimitationAngle=r.getFloat32Array(3),o.upperLimitationAngle=r.getFloat32Array(3)),n.links.push(o)}e.ik=n}return e},t=i.metadata;t.boneCount=r.getUint32(),i.bones=[];for(var n=0;n<t.boneCount;n++)i.bones.push(e())}(),function(){var e=function(){var e={};e.name=r.getTextBuffer(),e.englishName=r.getTextBuffer(),e.panel=r.getUint8(),e.type=r.getUint8(),e.elementCount=r.getUint32(),e.elements=[];for(var t=0;t<e.elementCount;t++)if(0===e.type){var n={};n.index=r.getIndex(i.metadata.morphIndexSize),n.ratio=r.getFloat32(),e.elements.push(n)}else if(1===e.type){var n={};n.index=r.getIndex(i.metadata.vertexIndexSize,!0),n.position=r.getFloat32Array(3),e.elements.push(n)}else if(2===e.type){var n={};n.index=r.getIndex(i.metadata.boneIndexSize),n.position=r.getFloat32Array(3),n.rotation=r.getFloat32Array(4),e.elements.push(n)}else if(3===e.type){var n={};n.index=r.getIndex(i.metadata.vertexIndexSize,!0),n.uv=r.getFloat32Array(4),e.elements.push(n)}else if(4===e.type);else if(5===e.type);else if(6===e.type);else if(7===e.type);else if(8===e.type){var n={};n.index=r.getIndex(i.metadata.materialIndexSize),n.type=r.getUint8(),n.diffuse=r.getFloat32Array(4),n.specular=r.getFloat32Array(3),n.shininess=r.getFloat32(),n.ambient=r.getFloat32Array(3),n.edgeColor=r.getFloat32Array(4),n.edgeSize=r.getFloat32(),n.textureColor=r.getFloat32Array(4),n.sphereTextureColor=r.getFloat32Array(4),n.toonColor=r.getFloat32Array(4),e.elements.push(n)}return e},t=i.metadata;t.morphCount=r.getUint32(),i.morphs=[];for(var n=0;n<t.morphCount;n++)i.morphs.push(e())}(),function(){var e=function(){var e={};e.name=r.getTextBuffer(),e.englishName=r.getTextBuffer(),e.type=r.getUint8(),e.elementCount=r.getUint32(),e.elements=[];for(var t=0;t<e.elementCount;t++){var n={};n.target=r.getUint8(),n.index=0===n.target?r.getIndex(i.metadata.boneIndexSize):r.getIndex(i.metadata.morphIndexSize),e.elements.push(n)}return e},t=i.metadata;t.frameCount=r.getUint32(),i.frames=[];for(var n=0;n<t.frameCount;n++)i.frames.push(e())}(),function(){var e,t=i.metadata;t.rigidBodyCount=r.getUint32(),i.rigidBodies=[];for(var n=0;n<t.rigidBodyCount;n++)i.rigidBodies.push((e=void 0,(e={}).name=r.getTextBuffer(),e.englishName=r.getTextBuffer(),e.boneIndex=r.getIndex(i.metadata.boneIndexSize),e.groupIndex=r.getUint8(),e.groupTarget=r.getUint16(),e.shapeType=r.getUint8(),e.width=r.getFloat32(),e.height=r.getFloat32(),e.depth=r.getFloat32(),e.position=r.getFloat32Array(3),e.rotation=r.getFloat32Array(3),e.weight=r.getFloat32(),e.positionDamping=r.getFloat32(),e.rotationDamping=r.getFloat32(),e.restitution=r.getFloat32(),e.friction=r.getFloat32(),e.type=r.getUint8(),e))}(),function(){var e,t=i.metadata;t.constraintCount=r.getUint32(),i.constraints=[];for(var n=0;n<t.constraintCount;n++)i.constraints.push((e=void 0,(e={}).name=r.getTextBuffer(),e.englishName=r.getTextBuffer(),e.type=r.getUint8(),e.rigidBodyIndex1=r.getIndex(i.metadata.rigidBodyIndexSize),e.rigidBodyIndex2=r.getIndex(i.metadata.rigidBodyIndexSize),e.position=r.getFloat32Array(3),e.rotation=r.getFloat32Array(3),e.translationLimitation1=r.getFloat32Array(3),e.translationLimitation2=r.getFloat32Array(3),e.rotationLimitation1=r.getFloat32Array(3),e.rotationLimitation2=r.getFloat32Array(3),e.springPosition=r.getFloat32Array(3),e.springRotation=r.getFloat32Array(3),e))}(),!0===t&&this.leftToRightModel(i),i},r.prototype.parseVmd=function(e,t){var i={},r=new n(e);return i.metadata={},i.metadata.coordinateSystem="left",function(){var e=i.metadata;if(e.magic=r.getChars(30),"Vocaloid Motion Data 0002"!==e.magic)throw"VMD file magic is not Vocaloid Motion Data 0002, but "+e.magic;e.name=r.getSjisStringsAsUnicode(20)}(),function(){var e,t=i.metadata;t.motionCount=r.getUint32(),i.motions=[];for(var n=0;n<t.motionCount;n++)i.motions.push((e=void 0,(e={}).boneName=r.getSjisStringsAsUnicode(15),e.frameNum=r.getUint32(),e.position=r.getFloat32Array(3),e.rotation=r.getFloat32Array(4),e.interpolation=r.getUint8Array(64),e))}(),function(){var e,t=i.metadata;t.morphCount=r.getUint32(),i.morphs=[];for(var n=0;n<t.morphCount;n++)i.morphs.push((e=void 0,(e={}).morphName=r.getSjisStringsAsUnicode(15),e.frameNum=r.getUint32(),e.weight=r.getFloat32(),e))}(),function(){var e,t=i.metadata;t.cameraCount=r.getUint32(),i.cameras=[];for(var n=0;n<t.cameraCount;n++)i.cameras.push((e=void 0,(e={}).frameNum=r.getUint32(),e.distance=r.getFloat32(),e.position=r.getFloat32Array(3),e.rotation=r.getFloat32Array(3),e.interpolation=r.getUint8Array(24),e.fov=r.getUint32(),e.perspective=r.getUint8(),e))}(),!0===t&&this.leftToRightVmd(i),i},r.prototype.parseVpd=function(e,t){var n={metadata:{}};n.metadata.coordinateSystem="left",n.bones=[];var i=e.replace(/\/\/\w*(\r|\n|\r\n)/g,"").split(/\r|\n|\r\n/);function r(){throw"the file seems not vpd file."}return"Vocaloid Pose Data file"!==i[0]&&r(),i.length<4&&r(),n.metadata.parentFile=i[2],n.metadata.boneCount=parseInt(i[3]),function(){for(var e=/^\s*(Bone[0-9]+)\s*\{\s*(.*)$/,t=/^\s*(-?[0-9]+\.[0-9]+)\s*,\s*(-?[0-9]+\.[0-9]+)\s*,\s*(-?[0-9]+\.[0-9]+)\s*;/,a=/^\s*(-?[0-9]+\.[0-9]+)\s*,\s*(-?[0-9]+\.[0-9]+)\s*,\s*(-?[0-9]+\.[0-9]+)\s*,\s*(-?[0-9]+\.[0-9]+)\s*;/,o=/^\s*}/,s=n.bones,c=null,l=null,h=null,u=4;u<i.length;u++){var p,d=i[u];null!==(p=d.match(e))&&(null!==c&&r(),c=p[2]),null!==(p=d.match(t))&&(null!==l&&r(),l=[parseFloat(p[1]),parseFloat(p[2]),parseFloat(p[3])]),null!==(p=d.match(a))&&(null!==h&&r(),h=[parseFloat(p[1]),parseFloat(p[2]),parseFloat(p[3]),parseFloat(p[4])]),null!==(p=d.match(o))&&(null!==c&&null!==l&&null!==h||r(),s.push({name:c,translation:l,quaternion:h}),c=null,l=null,h=null)}null===c&&null===l&&null===h||r()}(),!0===t&&this.leftToRightVpd(n),n},r.prototype.mergeVmds=function(e){var t={metadata:{}};t.metadata.name=e[0].metadata.name,t.metadata.coordinateSystem=e[0].metadata.coordinateSystem,t.metadata.motionCount=0,t.metadata.morphCount=0,t.metadata.cameraCount=0,t.motions=[],t.morphs=[],t.cameras=[];for(var n=0;n<e.length;n++){var i=e[n];t.metadata.motionCount+=i.metadata.motionCount,t.metadata.morphCount+=i.metadata.morphCount,t.metadata.cameraCount+=i.metadata.cameraCount;for(var r=0;r<i.metadata.motionCount;r++)t.motions.push(i.motions[r]);for(var r=0;r<i.metadata.morphCount;r++)t.morphs.push(i.morphs[r]);for(var r=0;r<i.metadata.cameraCount;r++)t.cameras.push(i.cameras[r])}return t},r.prototype.leftToRightModel=function(e){if("right"!==e.metadata.coordinateSystem){e.metadata.coordinateSystem="right";for(var t=new i,n=0;n<e.metadata.vertexCount;n++)t.leftToRightVector3(e.vertices[n].position),t.leftToRightVector3(e.vertices[n].normal);for(var n=0;n<e.metadata.faceCount;n++)t.leftToRightIndexOrder(e.faces[n].indices);for(var n=0;n<e.metadata.boneCount;n++)t.leftToRightVector3(e.bones[n].position);for(var n=0;n<e.metadata.morphCount;n++){var r=e.morphs[n];if("pmx"!==e.metadata.format||1===r.type)for(var a=0;a<r.elements.length;a++)t.leftToRightVector3(r.elements[a].position)}for(var n=0;n<e.metadata.rigidBodyCount;n++)t.leftToRightVector3(e.rigidBodies[n].position),t.leftToRightEuler(e.rigidBodies[n].rotation);for(var n=0;n<e.metadata.constraintCount;n++)t.leftToRightVector3(e.constraints[n].position),t.leftToRightEuler(e.constraints[n].rotation),t.leftToRightVector3Range(e.constraints[n].translationLimitation1,e.constraints[n].translationLimitation2),t.leftToRightEulerRange(e.constraints[n].rotationLimitation1,e.constraints[n].rotationLimitation2)}},r.prototype.leftToRightVmd=function(e){if("right"!==e.metadata.coordinateSystem){e.metadata.coordinateSystem="right";for(var t=new i,n=0;n<e.metadata.motionCount;n++)t.leftToRightVector3(e.motions[n].position),t.leftToRightQuaternion(e.motions[n].rotation);for(var n=0;n<e.metadata.cameraCount;n++)t.leftToRightVector3(e.cameras[n].position),t.leftToRightEuler(e.cameras[n].rotation)}},r.prototype.leftToRightVpd=function(e){if("right"!==e.metadata.coordinateSystem){e.metadata.coordinateSystem="right";for(var t=new i,n=0;n<e.bones.length;n++)t.leftToRightVector3(e.bones[n].translation),t.leftToRightQuaternion(e.bones[n].quaternion)}},e.CharsetEncoder=t,e.Parser=r,Object.defineProperty(e,"__esModule",{value:!0})}(t)},function(e,t,n){"use strict";n.r(t);var i=n(8);n.d(t,"USERDATA_KEY_VRM_IK_SOLVER",function(){return i.a}),n.d(t,"VRMIKSolver",function(){return i.c}),n.d(t,"VRMIKName",function(){return i.b}),n.d(t,"VRMPhysics",function(){return i.d});var r=n(1);for(var a in r)["USERDATA_KEY_VRM_IK_SOLVER","VRMIKSolver","VRMIKName","VRMPhysics","default"].indexOf(a)<0&&function(e){n.d(t,e,function(){return r[e]})}(a);var o=n(7);n.d(t,"VMDLoader",function(){return o.a}),n.d(t,"VRMLoader",function(){return o.b});var s=n(6);n.d(t,"VRMShaderMaterial",function(){return s.a})}])});
\No newline at end of file