ss-component-new 1.1.612 → 1.1.613
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{array-mnEYd91h.cjs → array-Bq7cMxbK.cjs} +1 -1
- package/dist/{array-wJSGLzMi.js → array-D4dLF1xj.js} +1 -1
- package/dist/icons/svg/query.svg +1 -0
- package/dist/{index-NHRmQhXb.js → index-5cKa20gg.js} +5 -5
- package/dist/index-6DTZ5srt.cjs +1 -0
- package/dist/{index-dMsdBhZR.cjs → index-8Juw-vHr.cjs} +1 -1
- package/dist/{index-n0r1Sh2B.js → index-A885uuFC.js} +4 -4
- package/dist/{index-ndIyfzUk.cjs → index-B4CjnKtd.cjs} +12 -12
- package/dist/{index-DNzcAMFb.cjs → index-B4gAKBoa.cjs} +1 -1
- package/dist/{index-BjleSQq1.js → index-B7MJ84rl.js} +4 -4
- package/dist/{index-DmBrXru-.js → index-B7STLPQk.js} +3 -3
- package/dist/index-B8Kd-FiX.cjs +1 -0
- package/dist/{index-CJ_rdkr8.js → index-BFELXxoC.js} +1 -1
- package/dist/{index-R68OOqlG.cjs → index-BTcprbvh.cjs} +1 -1
- package/dist/{index-l4jhtgPJ.js → index-B_jcwz8h.js} +5 -5
- package/dist/{index-Cm0AWbmH.js → index-BefuyAwv.js} +36 -31
- package/dist/{index-FztSyrOr.js → index-Bh3pY3Jj.js} +5 -5
- package/dist/index-BnolyTQo.cjs +1 -0
- package/dist/{index-Bk6AgbX9.cjs → index-BscVxcWg.cjs} +1 -1
- package/dist/{index-Buf4TmEA.js → index-ByqiusUf.js} +5 -5
- package/dist/{index-Dm8EQvZF.cjs → index-C-AfxANM.cjs} +1 -1
- package/dist/{index-DSZ-dJfB.js → index-C2gWLtuP.js} +1182 -1165
- package/dist/{index-Co7qMp6d.cjs → index-C2oTEiOz.cjs} +1 -1
- package/dist/{index-CZnxVxT-.js → index-C8IGgf80.js} +3 -3
- package/dist/{index-BTE5_xGG.js → index-C8JbYV9i.js} +4 -4
- package/dist/{index-tjZvKw6H.js → index-CIk03V2m.js} +8 -8
- package/dist/{index-CWaBQ1DX.cjs → index-CPq1CV6b.cjs} +1 -1
- package/dist/{index-l52VRsV3.cjs → index-Cbht3RG4.cjs} +1 -1
- package/dist/{index-BOb-2bQ6.js → index-CfpRAxJB.js} +2 -2
- package/dist/{index-CVbQPh0w.cjs → index-Chwdv_Xm.cjs} +1 -1
- package/dist/index-CjbW-TOF.js +785 -0
- package/dist/{index-chfPU5Di.cjs → index-CjfSFVch.cjs} +1 -1
- package/dist/{index-DgfctgnZ.cjs → index-CoQ5q08W.cjs} +1 -1
- package/dist/{index-RFCzxTjm.cjs → index-CsCDreKP.cjs} +1 -1
- package/dist/{index-B7zu-Th4.cjs → index-CtxOJNHA.cjs} +1 -1
- package/dist/{index-DSQNVSnX.js → index-DCT9raO7.js} +14 -14
- package/dist/{index-BG4IF9YQ.cjs → index-DDffuw8C.cjs} +20 -20
- package/dist/{index-BWzFnNAa.js → index-DHXlo9Tk.js} +6 -6
- package/dist/{index-BY7b1jSA.js → index-DVNL8B38.js} +3 -3
- package/dist/{index-BJi_ECqJ.cjs → index-DXkSDTRj.cjs} +1 -1
- package/dist/{index-DR3WrhKH.cjs → index-DXmRodF3.cjs} +1 -1
- package/dist/{index-DUiCPNl4.cjs → index-DY7U0ulO.cjs} +1 -1
- package/dist/{index-qqxCHR1f.cjs → index-DYxoBbtJ.cjs} +1 -1
- package/dist/{index-YOGc-Trd.js → index-D_HszcpC.js} +3 -3
- package/dist/{index-Bkm9CeI0.js → index-DaBCF0Nd.js} +1 -1
- package/dist/{index-CmXpvujN.js → index-DaOakrcL.js} +1 -1
- package/dist/{index-B0e7C08n.js → index-DaljBanN.js} +1 -1
- package/dist/{index-Co3FWnWC.js → index-DnS2Ulaz.js} +1 -1
- package/dist/{index-pnJ2ytKe.cjs → index-DuYtDUrA.cjs} +1 -1
- package/dist/index-j-V6cmGh.js +4577 -0
- package/dist/{index-BpEem65c.cjs → index-u76SwcjA.cjs} +1 -1
- package/dist/{index-B3bcujKn.js → index-uOFoDGfr.js} +1295 -1289
- package/dist/{index-DjeKotP5.cjs → index-z9FzE2kG.cjs} +1 -1
- package/dist/{index.vue_vue_type_script_setup_true_lang-F5FbVKlu.js → index.vue_vue_type_script_setup_true_lang-BBjmwIHl.js} +2 -2
- package/dist/{index.vue_vue_type_script_setup_true_lang-DO-iPkrT.cjs → index.vue_vue_type_script_setup_true_lang-C0WdqAD3.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-3cBVkstL.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-8sKf69T7.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BppZaMnT.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BBtXjJyn.js} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_1ee6cc73_lang-DVuPwJAn.js → index.vue_vue_type_style_index_0_scoped_1ee6cc73_lang-DIyem6Zd.js} +210 -210
- package/dist/{index.vue_vue_type_style_index_0_scoped_1ee6cc73_lang-XVgpv0vK.cjs → index.vue_vue_type_style_index_0_scoped_1ee6cc73_lang-DfW-NcWK.cjs} +7 -7
- package/dist/{index.vue_vue_type_style_index_0_scoped_57a7854d_lang-Bg3wWt9Z.js → index.vue_vue_type_style_index_0_scoped_57a7854d_lang-Bj6wXs-K.js} +8 -8
- package/dist/{index.vue_vue_type_style_index_0_scoped_57a7854d_lang-DhLSvSWi.cjs → index.vue_vue_type_style_index_0_scoped_57a7854d_lang-CoP3t1MS.cjs} +1 -1
- package/dist/{login-BBvcYktp.cjs → login--G67Cn_f.cjs} +1 -1
- package/dist/{login-afGmER0u.js → login-C8DAyy2e.js} +1 -1
- package/dist/{main-D9vTlRj4.cjs → main-DEB71tXS.cjs} +1 -1
- package/dist/{main-CXZ6xrQe.js → main-DSnZpabn.js} +5 -5
- package/dist/{menu-DYsWoy6Z.cjs → menu-B98fDP-p.cjs} +10 -10
- package/dist/{menu-Qw1eGtzq.js → menu-DArqZlON.js} +1 -2
- package/dist/{modelComp-y7HaQuVQ.js → modelComp-6AqovLWA.js} +1 -1
- package/dist/{modelComp-8s0tWZDU.cjs → modelComp-RmvEs7pM.cjs} +1 -1
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.css +2 -2
- package/dist/ss-component.js +9 -9
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +9 -9
- package/dist/{threeModel-DC6PX3wY.js → threeModel-BuK8iClH.js} +2 -2
- package/dist/{threeModel-DCA3CEkQ.cjs → threeModel-j-ksghdx.cjs} +1 -1
- package/package.json +1 -1
- package/public/icons/svg/query.svg +1 -0
- package/dist/index-B3kkcHGw.cjs +0 -1
- package/dist/index-Boa-o-ZU.js +0 -4492
- package/dist/index-BzsEjGyJ.cjs +0 -1
- package/dist/index-CQHMPLLG.js +0 -771
- package/dist/index-CYS-zlSw.cjs +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const Y=require("vue"),ft=require("./menu-B98fDP-p.cjs"),kn=require("./index-B4CjnKtd.cjs"),Vh=require("./modelComp-RmvEs7pM.cjs"),bn=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-8sKf69T7.cjs"),gl=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Gu={__name:"index",props:{isVisible:{type:Boolean,default:!1},title:{type:String,default:""},placement:{type:String,default:"bottom"},width:{type:Number,default:200}},setup(s){const e=s,t=Y.ref(null),n=Y.ref(!1),i=Y.ref(null);return Y.watch(()=>e==null?void 0:e.isVisible,()=>{n.value=e==null?void 0:e.isVisible},{deep:!0,immediate:!0}),Y.watch(()=>i.value,()=>{Y.nextTick(()=>{var r,a;(a=(r=t.value)==null?void 0:r.updatePopper)==null||a.call(r)})},{deep:!0,immediate:!0}),(r,a)=>{const o=Y.resolveComponent("el-popover");return Y.openBlock(),Y.createBlock(o,{visible:n.value,title:e==null?void 0:e.title,placement:e==null?void 0:e.placement,width:e==null?void 0:e.width,ref_key:"popOverRef",ref:t},{reference:Y.withCtx(()=>[Y.createElementVNode("div",null,[Y.renderSlot(r.$slots,"reference",{ref_key:"referenceRef",ref:i})])]),default:Y.withCtx(()=>[Y.createElementVNode("div",null,[Y.renderSlot(r.$slots,"content")])]),_:3},8,["visible","title","placement","width"])}}},Wu={class:"extra-button-content"},Xu={class:"table-operator-wrap"},qu={class:"extra-button-filter"},ju={class:"form-content-value"},Yu={key:0,class:"extra-header"},$u=["onClick"],Ju={__name:"header",props:{compName:{type:String,default:"表格名称",required:!1},buttons:{type:Array,default:()=>[]},columns:{type:Array,default:()=>[]}},emits:["buttonClick","filter"],setup(s,{emit:e}){const t=e,n=s,i=Y.ref(""),r=Y.ref(!1),a=Y.ref([]),o=Y.ref([{label:"取消",background:"#999999"},{label:"确认"}]),l=d=>{t("buttonClick",d)},c=d=>{var u,f;a.value=(f=(u=bn.getColumnChild(ft.cloneDeep(d)))==null?void 0:u.filter(m=>(m==null?void 0:m.label)!==""&&(m==null?void 0:m.label)!=="操作"))==null?void 0:f.map(m=>({label:(m==null?void 0:m.label)??"",value:"",name:(m==null?void 0:m.label)??"",isFormColHidden:m==null?void 0:m.isTableColHidden,width:2}))},h=d=>{(d==null?void 0:d.buttonName)==="确认"&&t("filter",d==null?void 0:d.content),r.value=!1};return Y.onMounted(()=>{c(n.columns)}),Y.watch(()=>n.columns,()=>{c(n.columns)},{deep:!0,immediate:!0}),(d,u)=>{var g;const f=Y.resolveComponent("svg-icon"),m=Y.resolveComponent("el-tooltip"),_=Y.resolveComponent("el-input");return Y.openBlock(),Y.createElementBlock("div",Wu,[Y.createElementVNode("div",{class:Y.normalizeClass(s.compName?"table-name-wrap":"")},Y.toDisplayString(s.compName),3),Y.createElementVNode("div",Xu,[Y.createElementVNode("div",qu,[Y.createVNode(Gu,{title:"",width:800,placement:"bottom-start",isVisible:r.value},{reference:Y.withCtx(()=>[Y.createVNode(_,{modelValue:i.value,"onUpdate:modelValue":u[1]||(u[1]=p=>i.value=p),style:{width:"240px"},placeholder:"查询","prefix-icon":Y.unref(ft.search_default)},{append:Y.withCtx(()=>[Y.createVNode(m,{content:"高级查询",placement:"top",effect:"light"},{default:Y.withCtx(()=>[Y.createVNode(f,{onClick:u[0]||(u[0]=p=>r.value=!r.value),name:"query",style:{width:"15px",height:"15px",cursor:"pointer"}})]),_:1})]),_:1},8,["modelValue","prefix-icon"])]),content:Y.withCtx(()=>[Y.createElementVNode("div",ju,[(Y.openBlock(),Y.createBlock(kn.ssForm,{rowContents:a.value,buttonValue:o.value,isRowFlex:!0,isEnableWrap:!1,isButtonRow:!1,key:o.value,isStartJustify:!1,onOnButtonClick:h},null,8,["rowContents","buttonValue"]))])]),_:1},8,["isVisible"])]),n!=null&&n.buttons&&((g=n==null?void 0:n.buttons)==null?void 0:g.length)>0?(Y.openBlock(),Y.createElementBlock("div",Yu,[(Y.openBlock(!0),Y.createElementBlock(Y.Fragment,null,Y.renderList(n==null?void 0:n.buttons,(p,w)=>(Y.openBlock(),Y.createElementBlock("div",{class:"extra-contents",key:w},[Y.createElementVNode("div",{class:"extra-content",style:Y.normalizeStyle({background:(p==null?void 0:p.background)??"var(--ssbutton-theme-bg)",color:"var(--ssbutton-theme-color)"}),onClick:E=>l(p==null?void 0:p.label)},Y.toDisplayString(p==null?void 0:p.label),13,$u)]))),128))])):Y.createCommentVNode("",!0)])])}}},Ku=gl._export_sfc(Ju,[["__scopeId","data-v-1a9876d8"]]);/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2010-2025 Three.js Authors
|
|
4
4
|
* SPDX-License-Identifier: MIT
|
|
5
|
-
*/const _l="177",Zu={ROTATE:0,DOLLY:1,PAN:2},Qu={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},ed=0,Xl=1,td=2,Hh=1,Gh=2,ui=3,Wn=0,gn=1,un=2,Ci=0,Es=1,ql=2,jl=3,Yl=4,nd=5,Wi=100,id=101,sd=102,rd=103,ad=104,od=200,ld=201,cd=202,hd=203,yo=204,Mo=205,ud=206,dd=207,fd=208,pd=209,md=210,gd=211,_d=212,vd=213,xd=214,bo=0,So=1,Eo=2,Ts=3,wo=4,Ao=5,To=6,Co=7,_a=0,yd=1,Md=2,Ri=0,bd=1,Sd=2,Ed=3,Wh=4,wd=5,Ad=6,Td=7,$l="attached",Cd="detached",Xh=300,Cs=301,Rs=302,Ro=303,Lo=304,va=306,Zn=1e3,Hn=1001,Po=1002,Ln=1003,Rd=1004,dr=1005,Rn=1006,Aa=1007,di=1008,ni=1009,qh=1010,jh=1011,tr=1012,vl=1013,$i=1014,Qn=1015,or=1016,xl=1017,yl=1018,nr=1020,Yh=35902,$h=1021,Jh=1022,Fn=1023,ir=1026,sr=1027,Kh=1028,Ml=1029,Zh=1030,bl=1031,Sl=1033,ea=33776,ta=33777,na=33778,ia=33779,Do=35840,No=35841,Uo=35842,Io=35843,Fo=36196,Oo=37492,zo=37496,Bo=37808,ko=37809,Vo=37810,Ho=37811,Go=37812,Wo=37813,Xo=37814,qo=37815,jo=37816,Yo=37817,$o=37818,Jo=37819,Ko=37820,Zo=37821,sa=36492,Qo=36494,el=36495,Qh=36283,tl=36284,nl=36285,il=36286,ca=2300,sl=2301,Ta=2302,Jl=2400,Kl=2401,Zl=2402,Ld=2500,Pd=3200,Dd=3201,xa=0,Nd=1,Ti="",Tt="srgb",Ls="srgb-linear",ha="linear",Ut="srgb",is=7680,Ql=519,Ud=512,Id=513,Fd=514,eu=515,Od=516,zd=517,Bd=518,kd=519,rl=35044,ec="300 es",fi=2e3,ua=2001;class Ki{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){const n=this._listeners;return n===void 0?!1:n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){const n=this._listeners;if(n===void 0)return;const i=n[e];if(i!==void 0){const r=i.indexOf(t);r!==-1&&i.splice(r,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const n=t[e.type];if(n!==void 0){e.target=this;const i=n.slice(0);for(let r=0,a=i.length;r<a;r++)i[r].call(this,e);e.target=null}}}const cn=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let tc=1234567;const Js=Math.PI/180,Ps=180/Math.PI;function Gn(){const s=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(cn[s&255]+cn[s>>8&255]+cn[s>>16&255]+cn[s>>24&255]+"-"+cn[e&255]+cn[e>>8&255]+"-"+cn[e>>16&15|64]+cn[e>>24&255]+"-"+cn[t&63|128]+cn[t>>8&255]+"-"+cn[t>>16&255]+cn[t>>24&255]+cn[n&255]+cn[n>>8&255]+cn[n>>16&255]+cn[n>>24&255]).toLowerCase()}function vt(s,e,t){return Math.max(e,Math.min(t,s))}function El(s,e){return(s%e+e)%e}function Vd(s,e,t,n,i){return n+(s-e)*(i-n)/(t-e)}function Hd(s,e,t){return s!==e?(t-s)/(e-s):0}function Ks(s,e,t){return(1-t)*s+t*e}function Gd(s,e,t,n){return Ks(s,e,1-Math.exp(-t*n))}function Wd(s,e=1){return e-Math.abs(El(s,e*2)-e)}function Xd(s,e,t){return s<=e?0:s>=t?1:(s=(s-e)/(t-e),s*s*(3-2*s))}function qd(s,e,t){return s<=e?0:s>=t?1:(s=(s-e)/(t-e),s*s*s*(s*(s*6-15)+10))}function jd(s,e){return s+Math.floor(Math.random()*(e-s+1))}function Yd(s,e){return s+Math.random()*(e-s)}function $d(s){return s*(.5-Math.random())}function Jd(s){s!==void 0&&(tc=s);let e=tc+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function Kd(s){return s*Js}function Zd(s){return s*Ps}function Qd(s){return(s&s-1)===0&&s!==0}function ef(s){return Math.pow(2,Math.ceil(Math.log(s)/Math.LN2))}function tf(s){return Math.pow(2,Math.floor(Math.log(s)/Math.LN2))}function nf(s,e,t,n,i){const r=Math.cos,a=Math.sin,o=r(t/2),l=a(t/2),c=r((e+n)/2),h=a((e+n)/2),f=r((e-n)/2),u=a((e-n)/2),d=r((n-e)/2),m=a((n-e)/2);switch(i){case"XYX":s.set(o*h,l*f,l*u,o*c);break;case"YZY":s.set(l*u,o*h,l*f,o*c);break;case"ZXZ":s.set(l*f,l*u,o*h,o*c);break;case"XZX":s.set(o*h,l*m,l*d,o*c);break;case"YXY":s.set(l*d,o*h,l*m,o*c);break;case"ZYZ":s.set(l*m,l*d,o*h,o*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Vn(s,e){switch(e.constructor){case Float32Array:return s;case Uint32Array:return s/4294967295;case Uint16Array:return s/65535;case Uint8Array:return s/255;case Int32Array:return Math.max(s/2147483647,-1);case Int16Array:return Math.max(s/32767,-1);case Int8Array:return Math.max(s/127,-1);default:throw new Error("Invalid component type.")}}function Nt(s,e){switch(e.constructor){case Float32Array:return s;case Uint32Array:return Math.round(s*4294967295);case Uint16Array:return Math.round(s*65535);case Uint8Array:return Math.round(s*255);case Int32Array:return Math.round(s*2147483647);case Int16Array:return Math.round(s*32767);case Int8Array:return Math.round(s*127);default:throw new Error("Invalid component type.")}}const Xi={DEG2RAD:Js,RAD2DEG:Ps,generateUUID:Gn,clamp:vt,euclideanModulo:El,mapLinear:Vd,inverseLerp:Hd,lerp:Ks,damp:Gd,pingpong:Wd,smoothstep:Xd,smootherstep:qd,randInt:jd,randFloat:Yd,randFloatSpread:$d,seededRandom:Jd,degToRad:Kd,radToDeg:Zd,isPowerOfTwo:Qd,ceilPowerOfTwo:ef,floorPowerOfTwo:tf,setQuaternionFromProperEuler:nf,normalize:Nt,denormalize:Vn};class Be{constructor(e=0,t=0){Be.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(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(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const 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(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=vt(this.x,e.x,t.x),this.y=vt(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=vt(this.x,e,t),this.y=vt(this.y,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(vt(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(vt(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const 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}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Pn{constructor(e=0,t=0,n=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=i}static slerpFlat(e,t,n,i,r,a,o){let l=n[i+0],c=n[i+1],h=n[i+2],f=n[i+3];const u=r[a+0],d=r[a+1],m=r[a+2],_=r[a+3];if(o===0){e[t+0]=l,e[t+1]=c,e[t+2]=h,e[t+3]=f;return}if(o===1){e[t+0]=u,e[t+1]=d,e[t+2]=m,e[t+3]=_;return}if(f!==_||l!==u||c!==d||h!==m){let g=1-o;const p=l*u+c*d+h*m+f*_,w=p>=0?1:-1,E=1-p*p;if(E>Number.EPSILON){const U=Math.sqrt(E),L=Math.atan2(U,p*w);g=Math.sin(g*L)/U,o=Math.sin(o*L)/U}const S=o*w;if(l=l*g+u*S,c=c*g+d*S,h=h*g+m*S,f=f*g+_*S,g===1-o){const U=1/Math.sqrt(l*l+c*c+h*h+f*f);l*=U,c*=U,h*=U,f*=U}}e[t]=l,e[t+1]=c,e[t+2]=h,e[t+3]=f}static multiplyQuaternionsFlat(e,t,n,i,r,a){const o=n[i],l=n[i+1],c=n[i+2],h=n[i+3],f=r[a],u=r[a+1],d=r[a+2],m=r[a+3];return e[t]=o*m+h*f+l*d-c*u,e[t+1]=l*m+h*u+c*f-o*d,e[t+2]=c*m+h*d+o*u-l*f,e[t+3]=h*m-o*f-l*u-c*d,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const n=e._x,i=e._y,r=e._z,a=e._order,o=Math.cos,l=Math.sin,c=o(n/2),h=o(i/2),f=o(r/2),u=l(n/2),d=l(i/2),m=l(r/2);switch(a){case"XYZ":this._x=u*h*f+c*d*m,this._y=c*d*f-u*h*m,this._z=c*h*m+u*d*f,this._w=c*h*f-u*d*m;break;case"YXZ":this._x=u*h*f+c*d*m,this._y=c*d*f-u*h*m,this._z=c*h*m-u*d*f,this._w=c*h*f+u*d*m;break;case"ZXY":this._x=u*h*f-c*d*m,this._y=c*d*f+u*h*m,this._z=c*h*m+u*d*f,this._w=c*h*f-u*d*m;break;case"ZYX":this._x=u*h*f-c*d*m,this._y=c*d*f+u*h*m,this._z=c*h*m-u*d*f,this._w=c*h*f+u*d*m;break;case"YZX":this._x=u*h*f+c*d*m,this._y=c*d*f+u*h*m,this._z=c*h*m-u*d*f,this._w=c*h*f-u*d*m;break;case"XZY":this._x=u*h*f-c*d*m,this._y=c*d*f-u*h*m,this._z=c*h*m+u*d*f,this._w=c*h*f+u*d*m;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const 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(e){const t=e.elements,n=t[0],i=t[4],r=t[8],a=t[1],o=t[5],l=t[9],c=t[2],h=t[6],f=t[10],u=n+o+f;if(u>0){const d=.5/Math.sqrt(u+1);this._w=.25/d,this._x=(h-l)*d,this._y=(r-c)*d,this._z=(a-i)*d}else if(n>o&&n>f){const d=2*Math.sqrt(1+n-o-f);this._w=(h-l)/d,this._x=.25*d,this._y=(i+a)/d,this._z=(r+c)/d}else if(o>f){const d=2*Math.sqrt(1+o-n-f);this._w=(r-c)/d,this._x=(i+a)/d,this._y=.25*d,this._z=(l+h)/d}else{const d=2*Math.sqrt(1+f-n-o);this._w=(a-i)/d,this._x=(r+c)/d,this._y=(l+h)/d,this._z=.25*d}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(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(e){return 2*Math.acos(Math.abs(vt(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(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(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,i=e._y,r=e._z,a=e._w,o=t._x,l=t._y,c=t._z,h=t._w;return this._x=n*h+a*o+i*c-r*l,this._y=i*h+a*l+r*o-n*c,this._z=r*h+a*c+n*l-i*o,this._w=a*h-n*o-i*l-r*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const n=this._x,i=this._y,r=this._z,a=this._w;let 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;const l=1-o*o;if(l<=Number.EPSILON){const d=1-t;return this._w=d*a+t*this._w,this._x=d*n+t*this._x,this._y=d*i+t*this._y,this._z=d*r+t*this._z,this.normalize(),this}const c=Math.sqrt(l),h=Math.atan2(c,o),f=Math.sin((1-t)*h)/c,u=Math.sin(t*h)/c;return this._w=a*f+this._w*u,this._x=n*f+this._x*u,this._y=i*f+this._y*u,this._z=r*f+this._z*u,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(i*Math.sin(e),i*Math.cos(e),r*Math.sin(t),r*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class F{constructor(e=0,t=0,n=0){F.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(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(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(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(nc.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(nc.setFromAxisAngle(e,t))}applyMatrix3(e){const 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}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const 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(e){const t=this.x,n=this.y,i=this.z,r=e.x,a=e.y,o=e.z,l=e.w,c=2*(a*i-o*n),h=2*(o*t-r*i),f=2*(r*n-a*t);return this.x=t+l*c+a*f-o*h,this.y=n+l*h+o*c-r*f,this.z=i+l*f+r*h-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const 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(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(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(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(e,t){return this.x=vt(this.x,e.x,t.x),this.y=vt(this.y,e.y,t.y),this.z=vt(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=vt(this.x,e,t),this.y=vt(this.y,e,t),this.z=vt(this.z,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(vt(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(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(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,i=e.y,r=e.z,a=t.x,o=t.y,l=t.z;return this.x=i*l-r*o,this.y=r*a-n*l,this.z=n*o-i*a,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return Ca.copy(this).projectOnVector(e),this.sub(Ca)}reflect(e){return this.sub(Ca.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(vt(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const 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(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const 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(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Ca=new F,nc=new Pn;class _t{constructor(e,t,n,i,r,a,o,l,c){_t.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,i,r,a,o,l,c)}set(e,t,n,i,r,a,o,l,c){const h=this.elements;return h[0]=e,h[1]=i,h[2]=o,h[3]=t,h[4]=r,h[5]=l,h[6]=n,h[7]=a,h[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const 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}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const 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}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,r=this.elements,a=n[0],o=n[3],l=n[6],c=n[1],h=n[4],f=n[7],u=n[2],d=n[5],m=n[8],_=i[0],g=i[3],p=i[6],w=i[1],E=i[4],S=i[7],U=i[2],L=i[5],D=i[8];return r[0]=a*_+o*w+l*U,r[3]=a*g+o*E+l*L,r[6]=a*p+o*S+l*D,r[1]=c*_+h*w+f*U,r[4]=c*g+h*E+f*L,r[7]=c*p+h*S+f*D,r[2]=u*_+d*w+m*U,r[5]=u*g+d*E+m*L,r[8]=u*p+d*S+m*D,this}multiplyScalar(e){const 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(){const e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8];return t*a*h-t*o*c-n*r*h+n*o*l+i*r*c-i*a*l}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8],f=h*a-o*c,u=o*l-h*r,d=c*r-a*l,m=t*f+n*u+i*d;if(m===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/m;return e[0]=f*_,e[1]=(i*c-h*n)*_,e[2]=(o*n-i*a)*_,e[3]=u*_,e[4]=(h*t-i*l)*_,e[5]=(i*r-o*t)*_,e[6]=d*_,e[7]=(n*l-c*t)*_,e[8]=(a*t-n*r)*_,this}transpose(){let e;const 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(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const 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(e,t,n,i,r,a,o){const l=Math.cos(r),c=Math.sin(r);return this.set(n*l,n*c,-n*(l*a+c*o)+a+e,-i*c,i*l,-i*(-c*a+l*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(Ra.makeScale(e,t)),this}rotate(e){return this.premultiply(Ra.makeRotation(-e)),this}translate(e,t){return this.premultiply(Ra.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const 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}clone(){return new this.constructor().fromArray(this.elements)}}const Ra=new _t;function tu(s){for(let e=s.length-1;e>=0;--e)if(s[e]>=65535)return!0;return!1}function rr(s){return document.createElementNS("http://www.w3.org/1999/xhtml",s)}function sf(){const s=rr("canvas");return s.style.display="block",s}const ic={};function ws(s){s in ic||(ic[s]=!0,console.warn(s))}function rf(s,e,t){return new Promise(function(n,i){function r(){switch(s.clientWaitSync(e,s.SYNC_FLUSH_COMMANDS_BIT,0)){case s.WAIT_FAILED:i();break;case s.TIMEOUT_EXPIRED:setTimeout(r,t);break;default:n()}}setTimeout(r,t)})}function af(s){const e=s.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function of(s){const e=s.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const sc=new _t().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),rc=new _t().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function lf(){const s={enabled:!0,workingColorSpace:Ls,spaces:{},convert:function(i,r,a){return this.enabled===!1||r===a||!r||!a||(this.spaces[r].transfer===Ut&&(i.r=pi(i.r),i.g=pi(i.g),i.b=pi(i.b)),this.spaces[r].primaries!==this.spaces[a].primaries&&(i.applyMatrix3(this.spaces[r].toXYZ),i.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===Ut&&(i.r=As(i.r),i.g=As(i.g),i.b=As(i.b))),i},workingToColorSpace:function(i,r){return this.convert(i,this.workingColorSpace,r)},colorSpaceToWorking:function(i,r){return this.convert(i,r,this.workingColorSpace)},getPrimaries:function(i){return this.spaces[i].primaries},getTransfer:function(i){return i===Ti?ha:this.spaces[i].transfer},getLuminanceCoefficients:function(i,r=this.workingColorSpace){return i.fromArray(this.spaces[r].luminanceCoefficients)},define:function(i){Object.assign(this.spaces,i)},_getMatrix:function(i,r,a){return i.copy(this.spaces[r].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(i){return this.spaces[i].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(i=this.workingColorSpace){return this.spaces[i].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(i,r){return ws("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),s.workingToColorSpace(i,r)},toWorkingColorSpace:function(i,r){return ws("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),s.colorSpaceToWorking(i,r)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],n=[.3127,.329];return s.define({[Ls]:{primaries:e,whitePoint:n,transfer:ha,toXYZ:sc,fromXYZ:rc,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Tt},outputColorSpaceConfig:{drawingBufferColorSpace:Tt}},[Tt]:{primaries:e,whitePoint:n,transfer:Ut,toXYZ:sc,fromXYZ:rc,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Tt}}}),s}const Mt=lf();function pi(s){return s<.04045?s*.0773993808:Math.pow(s*.9478672986+.0521327014,2.4)}function As(s){return s<.0031308?s*12.92:1.055*Math.pow(s,.41666)-.055}let ss;class cf{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{ss===void 0&&(ss=rr("canvas")),ss.width=e.width,ss.height=e.height;const i=ss.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),n=ss}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=rr("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const i=n.getImageData(0,0,e.width,e.height),r=i.data;for(let a=0;a<r.length;a++)r[a]=pi(r[a]/255)*255;return n.putImageData(i,0,0),t}else if(e.data){const t=e.data.slice(0);for(let n=0;n<t.length;n++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[n]=Math.floor(pi(t[n]/255)*255):t[n]=pi(t[n]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let hf=0;class wl{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:hf++}),this.uuid=Gn(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const t=this.data;return t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight):t!==null?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const n={uuid:this.uuid,url:""},i=this.data;if(i!==null){let r;if(Array.isArray(i)){r=[];for(let a=0,o=i.length;a<o;a++)i[a].isDataTexture?r.push(La(i[a].image)):r.push(La(i[a]))}else r=La(i);n.url=r}return t||(e.images[this.uuid]=n),n}}function La(s){return typeof HTMLImageElement<"u"&&s instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&s instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&s instanceof ImageBitmap?cf.getDataURL(s):s.data?{data:Array.from(s.data),width:s.width,height:s.height,type:s.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let uf=0;const Pa=new F;class on extends Ki{constructor(e=on.DEFAULT_IMAGE,t=on.DEFAULT_MAPPING,n=Hn,i=Hn,r=Rn,a=di,o=Fn,l=ni,c=on.DEFAULT_ANISOTROPY,h=Ti){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:uf++}),this.uuid=Gn(),this.name="",this.source=new wl(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=r,this.minFilter=a,this.anisotropy=c,this.format=o,this.internalFormat=null,this.type=l,this.offset=new Be(0,0),this.repeat=new Be(1,1),this.center=new Be(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new _t,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0}get width(){return this.source.getSize(Pa).x}get height(){return this.source.getSize(Pa).y}get depth(){return this.source.getSize(Pa).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,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.internalFormat=e.internalFormat,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.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const t in e){const n=e[t];if(n===void 0){console.warn(`THREE.Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){console.warn(`THREE.Texture.setValues(): property '${t}' does not exist.`);continue}i&&n&&i.isVector2&&n.isVector2||i&&n&&i.isVector3&&n.isVector3||i&&n&&i.isMatrix3&&n.isMatrix3?i.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const n={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,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,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Xh)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Zn:e.x=e.x-Math.floor(e.x);break;case Hn:e.x=e.x<0?0:1;break;case Po:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Zn:e.y=e.y-Math.floor(e.y);break;case Hn:e.y=e.y<0?0:1;break;case Po:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}on.DEFAULT_IMAGE=null;on.DEFAULT_MAPPING=Xh;on.DEFAULT_ANISOTROPY=1;class bt{constructor(e=0,t=0,n=0,i=1){bt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(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(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(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(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(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(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(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}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const 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}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const 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(e){let t,n,i,r;const l=e.elements,c=l[0],h=l[4],f=l[8],u=l[1],d=l[5],m=l[9],_=l[2],g=l[6],p=l[10];if(Math.abs(h-u)<.01&&Math.abs(f-_)<.01&&Math.abs(m-g)<.01){if(Math.abs(h+u)<.1&&Math.abs(f+_)<.1&&Math.abs(m+g)<.1&&Math.abs(c+d+p-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const E=(c+1)/2,S=(d+1)/2,U=(p+1)/2,L=(h+u)/4,D=(f+_)/4,N=(m+g)/4;return E>S&&E>U?E<.01?(n=0,i=.707106781,r=.707106781):(n=Math.sqrt(E),i=L/n,r=D/n):S>U?S<.01?(n=.707106781,i=0,r=.707106781):(i=Math.sqrt(S),n=L/i,r=N/i):U<.01?(n=.707106781,i=.707106781,r=0):(r=Math.sqrt(U),n=D/r,i=N/r),this.set(n,i,r,t),this}let w=Math.sqrt((g-m)*(g-m)+(f-_)*(f-_)+(u-h)*(u-h));return Math.abs(w)<.001&&(w=1),this.x=(g-m)/w,this.y=(f-_)/w,this.z=(u-h)/w,this.w=Math.acos((c+d+p-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(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(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(e,t){return this.x=vt(this.x,e.x,t.x),this.y=vt(this.y,e.y,t.y),this.z=vt(this.z,e.z,t.z),this.w=vt(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=vt(this.x,e,t),this.y=vt(this.y,e,t),this.z=vt(this.z,e,t),this.w=vt(this.w,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(vt(n,e,t))}floor(){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(){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(){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(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(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(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class df extends Ki{constructor(e=1,t=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Rn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},n),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=n.depth,this.scissor=new bt(0,0,e,t),this.scissorTest=!1,this.viewport=new bt(0,0,e,t);const i={width:e,height:t,depth:n.depth},r=new on(i);this.textures=[];const a=n.count;for(let o=0;o<a;o++)this.textures[o]=r.clone(),this.textures[o].isRenderTargetTexture=!0,this.textures[o].renderTarget=this;this._setTextureOptions(n),this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=n.depthTexture,this.samples=n.samples,this.multiview=n.multiview}_setTextureOptions(e={}){const t={minFilter:Rn,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(t.mapping=e.mapping),e.wrapS!==void 0&&(t.wrapS=e.wrapS),e.wrapT!==void 0&&(t.wrapT=e.wrapT),e.wrapR!==void 0&&(t.wrapR=e.wrapR),e.magFilter!==void 0&&(t.magFilter=e.magFilter),e.minFilter!==void 0&&(t.minFilter=e.minFilter),e.format!==void 0&&(t.format=e.format),e.type!==void 0&&(t.type=e.type),e.anisotropy!==void 0&&(t.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(t.colorSpace=e.colorSpace),e.flipY!==void 0&&(t.flipY=e.flipY),e.generateMipmaps!==void 0&&(t.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(t.internalFormat=e.internalFormat);for(let n=0;n<this.textures.length;n++)this.textures[n].setValues(t)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let i=0,r=this.textures.length;i<r;i++)this.textures[i].image.width=e,this.textures[i].image.height=t,this.textures[i].image.depth=n,this.textures[i].isArrayTexture=this.textures[i].image.depth>1;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t<n;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;const i=Object.assign({},e.textures[t].image);this.textures[t].source=new wl(i)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Ji extends df{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class nu extends on{constructor(e=null,t=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=Ln,this.minFilter=Ln,this.wrapR=Hn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class ff extends on{constructor(e=null,t=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=Ln,this.minFilter=Ln,this.wrapR=Hn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class qn{constructor(e=new F(1/0,1/0,1/0),t=new F(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(On.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(On.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=On.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){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(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const n=e.geometry;if(n!==void 0){const r=n.getAttribute("position");if(t===!0&&r!==void 0&&e.isInstancedMesh!==!0)for(let a=0,o=r.count;a<o;a++)e.isMesh===!0?e.getVertexPosition(a,On):On.fromBufferAttribute(r,a),On.applyMatrix4(e.matrixWorld),this.expandByPoint(On);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),fr.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),fr.copy(n.boundingBox)),fr.applyMatrix4(e.matrixWorld),this.union(fr)}const i=e.children;for(let r=0,a=i.length;r<a;r++)this.expandByObject(i[r],t);return this}containsPoint(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(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(e,t){return 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(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(e){return this.clampPoint(e.center,On),On.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let 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(e){if(this.isEmpty())return!1;this.getCenter(Bs),pr.subVectors(this.max,Bs),rs.subVectors(e.a,Bs),as.subVectors(e.b,Bs),os.subVectors(e.c,Bs),xi.subVectors(as,rs),yi.subVectors(os,as),Ii.subVectors(rs,os);let t=[0,-xi.z,xi.y,0,-yi.z,yi.y,0,-Ii.z,Ii.y,xi.z,0,-xi.x,yi.z,0,-yi.x,Ii.z,0,-Ii.x,-xi.y,xi.x,0,-yi.y,yi.x,0,-Ii.y,Ii.x,0];return!Da(t,rs,as,os,pr)||(t=[1,0,0,0,1,0,0,0,1],!Da(t,rs,as,os,pr))?!1:(mr.crossVectors(xi,yi),t=[mr.x,mr.y,mr.z],Da(t,rs,as,os,pr))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,On).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(On).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(ri[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ri[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ri[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ri[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ri[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ri[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ri[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ri[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ri),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const ri=[new F,new F,new F,new F,new F,new F,new F,new F],On=new F,fr=new qn,rs=new F,as=new F,os=new F,xi=new F,yi=new F,Ii=new F,Bs=new F,pr=new F,mr=new F,Fi=new F;function Da(s,e,t,n,i){for(let r=0,a=s.length-3;r<=a;r+=3){Fi.fromArray(s,r);const o=i.x*Math.abs(Fi.x)+i.y*Math.abs(Fi.y)+i.z*Math.abs(Fi.z),l=e.dot(Fi),c=t.dot(Fi),h=n.dot(Fi);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>o)return!1}return!0}const pf=new qn,ks=new F,Na=new F;class gi{constructor(e=new F,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;t!==void 0?n.copy(t):pf.setFromPoints(e).getCenter(n);let i=0;for(let r=0,a=e.length;r<a;r++)i=Math.max(i,n.distanceToSquared(e[r]));return this.radius=Math.sqrt(i),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;ks.subVectors(e,this.center);const t=ks.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.addScaledVector(ks,i/n),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(Na.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(ks.copy(e.center).add(Na)),this.expandByPoint(ks.copy(e.center).sub(Na))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}const ai=new F,Ua=new F,gr=new F,Mi=new F,Ia=new F,_r=new F,Fa=new F;class Us{constructor(e=new F,t=new F(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,ai)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=ai.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(ai.copy(this.origin).addScaledVector(this.direction,t),ai.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){Ua.copy(e).add(t).multiplyScalar(.5),gr.copy(t).sub(e).normalize(),Mi.copy(this.origin).sub(Ua);const r=e.distanceTo(t)*.5,a=-this.direction.dot(gr),o=Mi.dot(this.direction),l=-Mi.dot(gr),c=Mi.lengthSq(),h=Math.abs(1-a*a);let f,u,d,m;if(h>0)if(f=a*l-o,u=a*o-l,m=r*h,f>=0)if(u>=-m)if(u<=m){const _=1/h;f*=_,u*=_,d=f*(f+a*u+2*o)+u*(a*f+u+2*l)+c}else u=r,f=Math.max(0,-(a*u+o)),d=-f*f+u*(u+2*l)+c;else u=-r,f=Math.max(0,-(a*u+o)),d=-f*f+u*(u+2*l)+c;else u<=-m?(f=Math.max(0,-(-a*r+o)),u=f>0?-r:Math.min(Math.max(-r,-l),r),d=-f*f+u*(u+2*l)+c):u<=m?(f=0,u=Math.min(Math.max(-r,-l),r),d=u*(u+2*l)+c):(f=Math.max(0,-(a*r+o)),u=f>0?r:Math.min(Math.max(-r,-l),r),d=-f*f+u*(u+2*l)+c);else u=a>0?-r:r,f=Math.max(0,-(a*u+o)),d=-f*f+u*(u+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,f),i&&i.copy(Ua).addScaledVector(gr,u),d}intersectSphere(e,t){ai.subVectors(e.center,this.origin);const n=ai.dot(this.direction),i=ai.dot(ai)-n*n,r=e.radius*e.radius;if(i>r)return null;const a=Math.sqrt(r-i),o=n-a,l=n+a;return l<0?null:o<0?this.at(l,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,r,a,o,l;const c=1/this.direction.x,h=1/this.direction.y,f=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),h>=0?(r=(e.min.y-u.y)*h,a=(e.max.y-u.y)*h):(r=(e.max.y-u.y)*h,a=(e.min.y-u.y)*h),n>a||r>i||((r>n||isNaN(n))&&(n=r),(a<i||isNaN(i))&&(i=a),f>=0?(o=(e.min.z-u.z)*f,l=(e.max.z-u.z)*f):(o=(e.max.z-u.z)*f,l=(e.min.z-u.z)*f),n>l||o>i)||((o>n||n!==n)&&(n=o),(l<i||i!==i)&&(i=l),i<0)?null:this.at(n>=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,ai)!==null}intersectTriangle(e,t,n,i,r){Ia.subVectors(t,e),_r.subVectors(n,e),Fa.crossVectors(Ia,_r);let a=this.direction.dot(Fa),o;if(a>0){if(i)return null;o=1}else if(a<0)o=-1,a=-a;else return null;Mi.subVectors(this.origin,e);const l=o*this.direction.dot(_r.crossVectors(Mi,_r));if(l<0)return null;const c=o*this.direction.dot(Ia.cross(Mi));if(c<0||l+c>a)return null;const h=-o*Mi.dot(Fa);return h<0?null:this.at(h/a,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class st{constructor(e,t,n,i,r,a,o,l,c,h,f,u,d,m,_,g){st.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,i,r,a,o,l,c,h,f,u,d,m,_,g)}set(e,t,n,i,r,a,o,l,c,h,f,u,d,m,_,g){const p=this.elements;return p[0]=e,p[4]=t,p[8]=n,p[12]=i,p[1]=r,p[5]=a,p[9]=o,p[13]=l,p[2]=c,p[6]=h,p[10]=f,p[14]=u,p[3]=d,p[7]=m,p[11]=_,p[15]=g,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new st().fromArray(this.elements)}copy(e){const 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(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(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(e){const t=this.elements,n=e.elements,i=1/ls.setFromMatrixColumn(e,0).length(),r=1/ls.setFromMatrixColumn(e,1).length(),a=1/ls.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*r,t[5]=n[5]*r,t[6]=n[6]*r,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,i=e.y,r=e.z,a=Math.cos(n),o=Math.sin(n),l=Math.cos(i),c=Math.sin(i),h=Math.cos(r),f=Math.sin(r);if(e.order==="XYZ"){const u=a*h,d=a*f,m=o*h,_=o*f;t[0]=l*h,t[4]=-l*f,t[8]=c,t[1]=d+m*c,t[5]=u-_*c,t[9]=-o*l,t[2]=_-u*c,t[6]=m+d*c,t[10]=a*l}else if(e.order==="YXZ"){const u=l*h,d=l*f,m=c*h,_=c*f;t[0]=u+_*o,t[4]=m*o-d,t[8]=a*c,t[1]=a*f,t[5]=a*h,t[9]=-o,t[2]=d*o-m,t[6]=_+u*o,t[10]=a*l}else if(e.order==="ZXY"){const u=l*h,d=l*f,m=c*h,_=c*f;t[0]=u-_*o,t[4]=-a*f,t[8]=m+d*o,t[1]=d+m*o,t[5]=a*h,t[9]=_-u*o,t[2]=-a*c,t[6]=o,t[10]=a*l}else if(e.order==="ZYX"){const u=a*h,d=a*f,m=o*h,_=o*f;t[0]=l*h,t[4]=m*c-d,t[8]=u*c+_,t[1]=l*f,t[5]=_*c+u,t[9]=d*c-m,t[2]=-c,t[6]=o*l,t[10]=a*l}else if(e.order==="YZX"){const u=a*l,d=a*c,m=o*l,_=o*c;t[0]=l*h,t[4]=_-u*f,t[8]=m*f+d,t[1]=f,t[5]=a*h,t[9]=-o*h,t[2]=-c*h,t[6]=d*f+m,t[10]=u-_*f}else if(e.order==="XZY"){const u=a*l,d=a*c,m=o*l,_=o*c;t[0]=l*h,t[4]=-f,t[8]=c*h,t[1]=u*f+_,t[5]=a*h,t[9]=d*f-m,t[2]=m*f-d,t[6]=o*h,t[10]=_*f+u}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(mf,e,gf)}lookAt(e,t,n){const i=this.elements;return Tn.subVectors(e,t),Tn.lengthSq()===0&&(Tn.z=1),Tn.normalize(),bi.crossVectors(n,Tn),bi.lengthSq()===0&&(Math.abs(n.z)===1?Tn.x+=1e-4:Tn.z+=1e-4,Tn.normalize(),bi.crossVectors(n,Tn)),bi.normalize(),vr.crossVectors(Tn,bi),i[0]=bi.x,i[4]=vr.x,i[8]=Tn.x,i[1]=bi.y,i[5]=vr.y,i[9]=Tn.y,i[2]=bi.z,i[6]=vr.z,i[10]=Tn.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,r=this.elements,a=n[0],o=n[4],l=n[8],c=n[12],h=n[1],f=n[5],u=n[9],d=n[13],m=n[2],_=n[6],g=n[10],p=n[14],w=n[3],E=n[7],S=n[11],U=n[15],L=i[0],D=i[4],N=i[8],b=i[12],M=i[1],I=i[5],V=i[9],H=i[13],J=i[2],ie=i[6],B=i[10],oe=i[14],j=i[3],ue=i[7],pe=i[11],Me=i[15];return r[0]=a*L+o*M+l*J+c*j,r[4]=a*D+o*I+l*ie+c*ue,r[8]=a*N+o*V+l*B+c*pe,r[12]=a*b+o*H+l*oe+c*Me,r[1]=h*L+f*M+u*J+d*j,r[5]=h*D+f*I+u*ie+d*ue,r[9]=h*N+f*V+u*B+d*pe,r[13]=h*b+f*H+u*oe+d*Me,r[2]=m*L+_*M+g*J+p*j,r[6]=m*D+_*I+g*ie+p*ue,r[10]=m*N+_*V+g*B+p*pe,r[14]=m*b+_*H+g*oe+p*Me,r[3]=w*L+E*M+S*J+U*j,r[7]=w*D+E*I+S*ie+U*ue,r[11]=w*N+E*V+S*B+U*pe,r[15]=w*b+E*H+S*oe+U*Me,this}multiplyScalar(e){const 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}determinant(){const e=this.elements,t=e[0],n=e[4],i=e[8],r=e[12],a=e[1],o=e[5],l=e[9],c=e[13],h=e[2],f=e[6],u=e[10],d=e[14],m=e[3],_=e[7],g=e[11],p=e[15];return m*(+r*l*f-i*c*f-r*o*u+n*c*u+i*o*d-n*l*d)+_*(+t*l*d-t*c*u+r*a*u-i*a*d+i*c*h-r*l*h)+g*(+t*c*f-t*o*d-r*a*f+n*a*d+r*o*h-n*c*h)+p*(-i*o*h-t*l*f+t*o*u+i*a*f-n*a*u+n*l*h)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8],f=e[9],u=e[10],d=e[11],m=e[12],_=e[13],g=e[14],p=e[15],w=f*g*c-_*u*c+_*l*d-o*g*d-f*l*p+o*u*p,E=m*u*c-h*g*c-m*l*d+a*g*d+h*l*p-a*u*p,S=h*_*c-m*f*c+m*o*d-a*_*d-h*o*p+a*f*p,U=m*f*l-h*_*l-m*o*u+a*_*u+h*o*g-a*f*g,L=t*w+n*E+i*S+r*U;if(L===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const D=1/L;return e[0]=w*D,e[1]=(_*u*r-f*g*r-_*i*d+n*g*d+f*i*p-n*u*p)*D,e[2]=(o*g*r-_*l*r+_*i*c-n*g*c-o*i*p+n*l*p)*D,e[3]=(f*l*r-o*u*r-f*i*c+n*u*c+o*i*d-n*l*d)*D,e[4]=E*D,e[5]=(h*g*r-m*u*r+m*i*d-t*g*d-h*i*p+t*u*p)*D,e[6]=(m*l*r-a*g*r-m*i*c+t*g*c+a*i*p-t*l*p)*D,e[7]=(a*u*r-h*l*r+h*i*c-t*u*c-a*i*d+t*l*d)*D,e[8]=S*D,e[9]=(m*f*r-h*_*r-m*n*d+t*_*d+h*n*p-t*f*p)*D,e[10]=(a*_*r-m*o*r+m*n*c-t*_*c-a*n*p+t*o*p)*D,e[11]=(h*o*r-a*f*r-h*n*c+t*f*c+a*n*d-t*o*d)*D,e[12]=U*D,e[13]=(h*_*i-m*f*i+m*n*u-t*_*u-h*n*g+t*f*g)*D,e[14]=(m*o*i-a*_*i-m*n*l+t*_*l+a*n*g-t*o*g)*D,e[15]=(a*f*i-h*o*i+h*n*l-t*f*l-a*n*u+t*o*u)*D,this}scale(e){const 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(){const 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(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const 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(e){const 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(e){const 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(e,t){const n=Math.cos(t),i=Math.sin(t),r=1-n,a=e.x,o=e.y,l=e.z,c=r*a,h=r*o;return this.set(c*a+n,c*o-i*l,c*l+i*o,0,c*o+i*l,h*o+n,h*l-i*a,0,c*l-i*o,h*l+i*a,r*l*l+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,r,a){return this.set(1,n,r,0,e,1,a,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,r=t._x,a=t._y,o=t._z,l=t._w,c=r+r,h=a+a,f=o+o,u=r*c,d=r*h,m=r*f,_=a*h,g=a*f,p=o*f,w=l*c,E=l*h,S=l*f,U=n.x,L=n.y,D=n.z;return i[0]=(1-(_+p))*U,i[1]=(d+S)*U,i[2]=(m-E)*U,i[3]=0,i[4]=(d-S)*L,i[5]=(1-(u+p))*L,i[6]=(g+w)*L,i[7]=0,i[8]=(m+E)*D,i[9]=(g-w)*D,i[10]=(1-(u+_))*D,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){const i=this.elements;let r=ls.set(i[0],i[1],i[2]).length();const a=ls.set(i[4],i[5],i[6]).length(),o=ls.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],zn.copy(this);const c=1/r,h=1/a,f=1/o;return zn.elements[0]*=c,zn.elements[1]*=c,zn.elements[2]*=c,zn.elements[4]*=h,zn.elements[5]*=h,zn.elements[6]*=h,zn.elements[8]*=f,zn.elements[9]*=f,zn.elements[10]*=f,t.setFromRotationMatrix(zn),n.x=r,n.y=a,n.z=o,this}makePerspective(e,t,n,i,r,a,o=fi){const l=this.elements,c=2*r/(t-e),h=2*r/(n-i),f=(t+e)/(t-e),u=(n+i)/(n-i);let d,m;if(o===fi)d=-(a+r)/(a-r),m=-2*a*r/(a-r);else if(o===ua)d=-a/(a-r),m=-a*r/(a-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return l[0]=c,l[4]=0,l[8]=f,l[12]=0,l[1]=0,l[5]=h,l[9]=u,l[13]=0,l[2]=0,l[6]=0,l[10]=d,l[14]=m,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,n,i,r,a,o=fi){const l=this.elements,c=1/(t-e),h=1/(n-i),f=1/(a-r),u=(t+e)*c,d=(n+i)*h;let m,_;if(o===fi)m=(a+r)*f,_=-2*f;else if(o===ua)m=r*f,_=-1*f;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-u,l[1]=0,l[5]=2*h,l[9]=0,l[13]=-d,l[2]=0,l[6]=0,l[10]=_,l[14]=-m,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const 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}}const ls=new F,zn=new st,mf=new F(0,0,0),gf=new F(1,1,1),bi=new F,vr=new F,Tn=new F,ac=new st,oc=new Pn;class _n{constructor(e=0,t=0,n=0,i=_n.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const i=e.elements,r=i[0],a=i[4],o=i[8],l=i[1],c=i[5],h=i[9],f=i[2],u=i[6],d=i[10];switch(t){case"XYZ":this._y=Math.asin(vt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,d),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(u,c),this._z=0);break;case"YXZ":this._x=Math.asin(-vt(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,d),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-f,r),this._z=0);break;case"ZXY":this._x=Math.asin(vt(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(-f,d),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,r));break;case"ZYX":this._y=Math.asin(-vt(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(u,d),this._z=Math.atan2(l,r)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(vt(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-f,r)):(this._x=0,this._y=Math.atan2(o,d));break;case"XZY":this._z=Math.asin(-vt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(u,c),this._y=Math.atan2(o,r)):(this._x=Math.atan2(-h,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return ac.makeRotationFromQuaternion(e),this.setFromRotationMatrix(ac,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return oc.setFromEuler(this),this.setFromQuaternion(oc,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}_n.DEFAULT_ORDER="XYZ";class Al{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let _f=0;const lc=new F,cs=new Pn,oi=new st,xr=new F,Vs=new F,vf=new F,xf=new Pn,cc=new F(1,0,0),hc=new F(0,1,0),uc=new F(0,0,1),dc={type:"added"},yf={type:"removed"},hs={type:"childadded",child:null},Oa={type:"childremoved",child:null};class It extends Ki{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:_f++}),this.uuid=Gn(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=It.DEFAULT_UP.clone();const e=new F,t=new _n,n=new Pn,i=new F(1,1,1);function r(){n.setFromEuler(t,!1)}function a(){t.setFromQuaternion(n,void 0,!1)}t._onChange(r),n._onChange(a),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 st},normalMatrix:{value:new _t}}),this.matrix=new st,this.matrixWorld=new st,this.matrixAutoUpdate=It.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=It.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Al,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return cs.setFromAxisAngle(e,t),this.quaternion.multiply(cs),this}rotateOnWorldAxis(e,t){return cs.setFromAxisAngle(e,t),this.quaternion.premultiply(cs),this}rotateX(e){return this.rotateOnAxis(cc,e)}rotateY(e){return this.rotateOnAxis(hc,e)}rotateZ(e){return this.rotateOnAxis(uc,e)}translateOnAxis(e,t){return lc.copy(e).applyQuaternion(this.quaternion),this.position.add(lc.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(cc,e)}translateY(e){return this.translateOnAxis(hc,e)}translateZ(e){return this.translateOnAxis(uc,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(oi.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?xr.copy(e):xr.set(e,t,n);const i=this.parent;this.updateWorldMatrix(!0,!1),Vs.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?oi.lookAt(Vs,xr,this.up):oi.lookAt(xr,Vs,this.up),this.quaternion.setFromRotationMatrix(oi),i&&(oi.extractRotation(i.matrixWorld),cs.setFromRotationMatrix(oi),this.quaternion.premultiply(cs.invert()))}add(e){if(arguments.length>1){for(let 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?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(dc),hs.child=e,this.dispatchEvent(hs),hs.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(yf),Oa.child=e,this.dispatchEvent(Oa),Oa.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),oi.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),oi.multiply(e.parent.matrixWorld)),e.applyMatrix4(oi),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(dc),hs.child=e,this.dispatchEvent(hs),hs.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,i=this.children.length;n<i;n++){const a=this.children[n].getObjectByProperty(e,t);if(a!==void 0)return a}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const i=this.children;for(let r=0,a=i.length;r<a;r++)i[r].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Vs,e,vf),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Vs,xf,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t){const n=this.parent;if(e===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){const i=this.children;for(let r=0,a=i.length;r<a;r++)i[r].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.geometryInfo=this._geometryInfo.map(o=>({...o,boundingBox:o.boundingBox?o.boundingBox.toJSON():void 0,boundingSphere:o.boundingSphere?o.boundingSphere.toJSON():void 0})),i.instanceInfo=this._instanceInfo.map(o=>({...o})),i.availableInstanceIds=this._availableInstanceIds.slice(),i.availableGeometryIds=this._availableGeometryIds.slice(),i.nextIndexStart=this._nextIndexStart,i.nextVertexStart=this._nextVertexStart,i.geometryCount=this._geometryCount,i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.matricesTexture=this._matricesTexture.toJSON(e),i.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(i.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(i.boundingBox=this.boundingBox.toJSON()));function r(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=r(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let c=0,h=l.length;c<h;c++){const f=l[c];r(e.shapes,f)}else r(e.shapes,l)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(r(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let l=0,c=this.material.length;l<c;l++)o.push(r(e.materials,this.material[l]));i.material=o}else i.material=r(e.materials,this.material);if(this.children.length>0){i.children=[];for(let o=0;o<this.children.length;o++)i.children.push(this.children[o].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let o=0;o<this.animations.length;o++){const l=this.animations[o];i.animations.push(r(e.animations,l))}}if(t){const o=a(e.geometries),l=a(e.materials),c=a(e.textures),h=a(e.images),f=a(e.shapes),u=a(e.skeletons),d=a(e.animations),m=a(e.nodes);o.length>0&&(n.geometries=o),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),h.length>0&&(n.images=h),f.length>0&&(n.shapes=f),u.length>0&&(n.skeletons=u),d.length>0&&(n.animations=d),m.length>0&&(n.nodes=m)}return n.object=i,n;function a(o){const l=[];for(const c in o){const h=o[c];delete h.metadata,l.push(h)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,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.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,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.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n<e.children.length;n++){const i=e.children[n];this.add(i.clone())}return this}}It.DEFAULT_UP=new F(0,1,0);It.DEFAULT_MATRIX_AUTO_UPDATE=!0;It.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Bn=new F,li=new F,za=new F,ci=new F,us=new F,ds=new F,fc=new F,Ba=new F,ka=new F,Va=new F,Ha=new bt,Ga=new bt,Wa=new bt;class In{constructor(e=new F,t=new F,n=new F){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,i){i.subVectors(n,t),Bn.subVectors(e,t),i.cross(Bn);const r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(e,t,n,i,r){Bn.subVectors(i,t),li.subVectors(n,t),za.subVectors(e,t);const a=Bn.dot(Bn),o=Bn.dot(li),l=Bn.dot(za),c=li.dot(li),h=li.dot(za),f=a*c-o*o;if(f===0)return r.set(0,0,0),null;const u=1/f,d=(c*l-o*h)*u,m=(a*h-o*l)*u;return r.set(1-d-m,m,d)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,ci)===null?!1:ci.x>=0&&ci.y>=0&&ci.x+ci.y<=1}static getInterpolation(e,t,n,i,r,a,o,l){return this.getBarycoord(e,t,n,i,ci)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(r,ci.x),l.addScaledVector(a,ci.y),l.addScaledVector(o,ci.z),l)}static getInterpolatedAttribute(e,t,n,i,r,a){return Ha.setScalar(0),Ga.setScalar(0),Wa.setScalar(0),Ha.fromBufferAttribute(e,t),Ga.fromBufferAttribute(e,n),Wa.fromBufferAttribute(e,i),a.setScalar(0),a.addScaledVector(Ha,r.x),a.addScaledVector(Ga,r.y),a.addScaledVector(Wa,r.z),a}static isFrontFacing(e,t,n,i){return Bn.subVectors(n,t),li.subVectors(e,t),Bn.cross(li).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,n,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Bn.subVectors(this.c,this.b),li.subVectors(this.a,this.b),Bn.cross(li).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return In.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return In.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,i,r){return In.getInterpolation(e,this.a,this.b,this.c,t,n,i,r)}containsPoint(e){return In.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return In.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,i=this.b,r=this.c;let a,o;us.subVectors(i,n),ds.subVectors(r,n),Ba.subVectors(e,n);const l=us.dot(Ba),c=ds.dot(Ba);if(l<=0&&c<=0)return t.copy(n);ka.subVectors(e,i);const h=us.dot(ka),f=ds.dot(ka);if(h>=0&&f<=h)return t.copy(i);const u=l*f-h*c;if(u<=0&&l>=0&&h<=0)return a=l/(l-h),t.copy(n).addScaledVector(us,a);Va.subVectors(e,r);const d=us.dot(Va),m=ds.dot(Va);if(m>=0&&d<=m)return t.copy(r);const _=d*c-l*m;if(_<=0&&c>=0&&m<=0)return o=c/(c-m),t.copy(n).addScaledVector(ds,o);const g=h*m-d*f;if(g<=0&&f-h>=0&&d-m>=0)return fc.subVectors(r,i),o=(f-h)/(f-h+(d-m)),t.copy(i).addScaledVector(fc,o);const p=1/(g+_+u);return a=_*p,o=u*p,t.copy(n).addScaledVector(us,a).addScaledVector(ds,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const iu={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},Si={h:0,s:0,l:0},yr={h:0,s:0,l:0};function Xa(s,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?s+(e-s)*6*t:t<1/2?e:t<2/3?s+(e-s)*6*(2/3-t):s}class et{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Tt){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Mt.colorSpaceToWorking(this,t),this}setRGB(e,t,n,i=Mt.workingColorSpace){return this.r=e,this.g=t,this.b=n,Mt.colorSpaceToWorking(this,i),this}setHSL(e,t,n,i=Mt.workingColorSpace){if(e=El(e,1),t=vt(t,0,1),n=vt(n,0,1),t===0)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+t):n+t-n*t,a=2*n-r;this.r=Xa(a,r,e+1/3),this.g=Xa(a,r,e),this.b=Xa(a,r,e-1/3)}return Mt.colorSpaceToWorking(this,i),this}setStyle(e,t=Tt){function n(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let r;const a=i[1],o=i[2];switch(a){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=i[1],a=r.length;if(a===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(a===6)return this.setHex(parseInt(r,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Tt){const n=iu[e.toLowerCase()];return n!==void 0?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=pi(e.r),this.g=pi(e.g),this.b=pi(e.b),this}copyLinearToSRGB(e){return this.r=As(e.r),this.g=As(e.g),this.b=As(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Tt){return Mt.workingToColorSpace(hn.copy(this),e),Math.round(vt(hn.r*255,0,255))*65536+Math.round(vt(hn.g*255,0,255))*256+Math.round(vt(hn.b*255,0,255))}getHexString(e=Tt){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Mt.workingColorSpace){Mt.workingToColorSpace(hn.copy(this),t);const n=hn.r,i=hn.g,r=hn.b,a=Math.max(n,i,r),o=Math.min(n,i,r);let l,c;const h=(o+a)/2;if(o===a)l=0,c=0;else{const f=a-o;switch(c=h<=.5?f/(a+o):f/(2-a-o),a){case n:l=(i-r)/f+(i<r?6:0);break;case i:l=(r-n)/f+2;break;case r:l=(n-i)/f+4;break}l/=6}return e.h=l,e.s=c,e.l=h,e}getRGB(e,t=Mt.workingColorSpace){return Mt.workingToColorSpace(hn.copy(this),t),e.r=hn.r,e.g=hn.g,e.b=hn.b,e}getStyle(e=Tt){Mt.workingToColorSpace(hn.copy(this),e);const t=hn.r,n=hn.g,i=hn.b;return e!==Tt?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(i*255)})`}offsetHSL(e,t,n){return this.getHSL(Si),this.setHSL(Si.h+e,Si.s+t,Si.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(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(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(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}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(Si),e.getHSL(yr);const n=Ks(Si.h,yr.h,t),i=Ks(Si.s,yr.s,t),r=Ks(Si.l,yr.l,t);return this.setHSL(n,i,r),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,i=this.b,r=e.elements;return this.r=r[0]*t+r[3]*n+r[6]*i,this.g=r[1]*t+r[4]*n+r[7]*i,this.b=r[2]*t+r[5]*n+r[8]*i,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const hn=new et;et.NAMES=iu;let Mf=0;class Dn extends Ki{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Mf++}),this.uuid=Gn(),this.name="",this.type="Material",this.blending=Es,this.side=Wn,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=yo,this.blendDst=Mo,this.blendEquation=Wi,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new et(0,0,0),this.blendAlpha=0,this.depthFunc=Ts,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Ql,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=is,this.stencilZFail=is,this.stencilZPass=is,this.stencilWrite=!1,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.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.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,n.lightMapIntensity=this.lightMapIntensity),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.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Es&&(n.blending=this.blending),this.side!==Wn&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==yo&&(n.blendSrc=this.blendSrc),this.blendDst!==Mo&&(n.blendDst=this.blendDst),this.blendEquation!==Wi&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==Ts&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==Ql&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==is&&(n.stencilFail=this.stencilFail),this.stencilZFail!==is&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==is&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function i(r){const a=[];for(const o in r){const l=r[o];delete l.metadata,a.push(l)}return a}if(t){const r=i(e.textures),a=i(e.images);r.length>0&&(n.textures=r),a.length>0&&(n.images=a)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,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.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(t!==null){const i=t.length;n=new Array(i);for(let r=0;r!==i;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,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.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class Pi extends Dn{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new et(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.envMapRotation=new _n,this.combine=_a,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(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.envMapRotation.copy(e.envMapRotation),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.fog=e.fog,this}}const Xt=new F,Mr=new Be;let bf=0;class Ht{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:bf++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=rl,this.updateRanges=[],this.gpuType=Qn,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(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.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let i=0,r=this.itemSize;i<r;i++)this.array[e+i]=t.array[n+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)Mr.fromBufferAttribute(this,t),Mr.applyMatrix3(e),this.setXY(t,Mr.x,Mr.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)Xt.fromBufferAttribute(this,t),Xt.applyMatrix3(e),this.setXYZ(t,Xt.x,Xt.y,Xt.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)Xt.fromBufferAttribute(this,t),Xt.applyMatrix4(e),this.setXYZ(t,Xt.x,Xt.y,Xt.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Xt.fromBufferAttribute(this,t),Xt.applyNormalMatrix(e),this.setXYZ(t,Xt.x,Xt.y,Xt.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Xt.fromBufferAttribute(this,t),Xt.transformDirection(e),this.setXYZ(t,Xt.x,Xt.y,Xt.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=Vn(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Nt(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Vn(t,this.array)),t}setX(e,t){return this.normalized&&(t=Nt(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Vn(t,this.array)),t}setY(e,t){return this.normalized&&(t=Nt(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=Vn(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Nt(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=Vn(t,this.array)),t}setW(e,t){return this.normalized&&(t=Nt(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Nt(t,this.array),n=Nt(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,i){return e*=this.itemSize,this.normalized&&(t=Nt(t,this.array),n=Nt(n,this.array),i=Nt(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this}setXYZW(e,t,n,i,r){return e*=this.itemSize,this.normalized&&(t=Nt(t,this.array),n=Nt(n,this.array),i=Nt(i,this.array),r=Nt(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=r,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==rl&&(e.usage=this.usage),e}}class su extends Ht{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class Sf extends Ht{constructor(e,t,n){super(new Int32Array(e),t,n)}}class ru extends Ht{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class mt extends Ht{constructor(e,t,n){super(new Float32Array(e),t,n)}}let Ef=0;const Nn=new st,qa=new It,fs=new F,Cn=new qn,Hs=new qn,Qt=new F;class Bt extends Ki{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Ef++}),this.uuid=Gn(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(tu(e)?ru:su)(e,1):this.index=e,this}setIndirect(e){return this.indirect=e,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const r=new _t().getNormalMatrix(e);n.applyNormalMatrix(r),n.needsUpdate=!0}const i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return Nn.makeRotationFromQuaternion(e),this.applyMatrix4(Nn),this}rotateX(e){return Nn.makeRotationX(e),this.applyMatrix4(Nn),this}rotateY(e){return Nn.makeRotationY(e),this.applyMatrix4(Nn),this}rotateZ(e){return Nn.makeRotationZ(e),this.applyMatrix4(Nn),this}translate(e,t,n){return Nn.makeTranslation(e,t,n),this.applyMatrix4(Nn),this}scale(e,t,n){return Nn.makeScale(e,t,n),this.applyMatrix4(Nn),this}lookAt(e){return qa.lookAt(e),qa.updateMatrix(),this.applyMatrix4(qa.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(fs).negate(),this.translate(fs.x,fs.y,fs.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const n=[];for(let i=0,r=e.length;i<r;i++){const a=e[i];n.push(a.x,a.y,a.z||0)}this.setAttribute("position",new mt(n,3))}else{const n=Math.min(e.length,t.count);for(let i=0;i<n;i++){const r=e[i];t.setXYZ(i,r.x,r.y,r.z||0)}e.length>t.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new qn);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new F(-1/0,-1/0,-1/0),new F(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,i=t.length;n<i;n++){const r=t[n];Cn.setFromBufferAttribute(r),this.morphTargetsRelative?(Qt.addVectors(this.boundingBox.min,Cn.min),this.boundingBox.expandByPoint(Qt),Qt.addVectors(this.boundingBox.max,Cn.max),this.boundingBox.expandByPoint(Qt)):(this.boundingBox.expandByPoint(Cn.min),this.boundingBox.expandByPoint(Cn.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(){this.boundingSphere===null&&(this.boundingSphere=new gi);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new F,1/0);return}if(e){const n=this.boundingSphere.center;if(Cn.setFromBufferAttribute(e),t)for(let r=0,a=t.length;r<a;r++){const o=t[r];Hs.setFromBufferAttribute(o),this.morphTargetsRelative?(Qt.addVectors(Cn.min,Hs.min),Cn.expandByPoint(Qt),Qt.addVectors(Cn.max,Hs.max),Cn.expandByPoint(Qt)):(Cn.expandByPoint(Hs.min),Cn.expandByPoint(Hs.max))}Cn.getCenter(n);let i=0;for(let r=0,a=e.count;r<a;r++)Qt.fromBufferAttribute(e,r),i=Math.max(i,n.distanceToSquared(Qt));if(t)for(let r=0,a=t.length;r<a;r++){const o=t[r],l=this.morphTargetsRelative;for(let c=0,h=o.count;c<h;c++)Qt.fromBufferAttribute(o,c),l&&(fs.fromBufferAttribute(e,c),Qt.add(fs)),i=Math.max(i,n.distanceToSquared(Qt))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=t.position,i=t.normal,r=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Ht(new Float32Array(4*n.count),4));const a=this.getAttribute("tangent"),o=[],l=[];for(let N=0;N<n.count;N++)o[N]=new F,l[N]=new F;const c=new F,h=new F,f=new F,u=new Be,d=new Be,m=new Be,_=new F,g=new F;function p(N,b,M){c.fromBufferAttribute(n,N),h.fromBufferAttribute(n,b),f.fromBufferAttribute(n,M),u.fromBufferAttribute(r,N),d.fromBufferAttribute(r,b),m.fromBufferAttribute(r,M),h.sub(c),f.sub(c),d.sub(u),m.sub(u);const I=1/(d.x*m.y-m.x*d.y);isFinite(I)&&(_.copy(h).multiplyScalar(m.y).addScaledVector(f,-d.y).multiplyScalar(I),g.copy(f).multiplyScalar(d.x).addScaledVector(h,-m.x).multiplyScalar(I),o[N].add(_),o[b].add(_),o[M].add(_),l[N].add(g),l[b].add(g),l[M].add(g))}let w=this.groups;w.length===0&&(w=[{start:0,count:e.count}]);for(let N=0,b=w.length;N<b;++N){const M=w[N],I=M.start,V=M.count;for(let H=I,J=I+V;H<J;H+=3)p(e.getX(H+0),e.getX(H+1),e.getX(H+2))}const E=new F,S=new F,U=new F,L=new F;function D(N){U.fromBufferAttribute(i,N),L.copy(U);const b=o[N];E.copy(b),E.sub(U.multiplyScalar(U.dot(b))).normalize(),S.crossVectors(L,b);const I=S.dot(l[N])<0?-1:1;a.setXYZW(N,E.x,E.y,E.z,I)}for(let N=0,b=w.length;N<b;++N){const M=w[N],I=M.start,V=M.count;for(let H=I,J=I+V;H<J;H+=3)D(e.getX(H+0)),D(e.getX(H+1)),D(e.getX(H+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new Ht(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let u=0,d=n.count;u<d;u++)n.setXYZ(u,0,0,0);const i=new F,r=new F,a=new F,o=new F,l=new F,c=new F,h=new F,f=new F;if(e)for(let u=0,d=e.count;u<d;u+=3){const m=e.getX(u+0),_=e.getX(u+1),g=e.getX(u+2);i.fromBufferAttribute(t,m),r.fromBufferAttribute(t,_),a.fromBufferAttribute(t,g),h.subVectors(a,r),f.subVectors(i,r),h.cross(f),o.fromBufferAttribute(n,m),l.fromBufferAttribute(n,_),c.fromBufferAttribute(n,g),o.add(h),l.add(h),c.add(h),n.setXYZ(m,o.x,o.y,o.z),n.setXYZ(_,l.x,l.y,l.z),n.setXYZ(g,c.x,c.y,c.z)}else for(let u=0,d=t.count;u<d;u+=3)i.fromBufferAttribute(t,u+0),r.fromBufferAttribute(t,u+1),a.fromBufferAttribute(t,u+2),h.subVectors(a,r),f.subVectors(i,r),h.cross(f),n.setXYZ(u+0,h.x,h.y,h.z),n.setXYZ(u+1,h.x,h.y,h.z),n.setXYZ(u+2,h.x,h.y,h.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)Qt.fromBufferAttribute(e,t),Qt.normalize(),e.setXYZ(t,Qt.x,Qt.y,Qt.z)}toNonIndexed(){function e(o,l){const c=o.array,h=o.itemSize,f=o.normalized,u=new c.constructor(l.length*h);let d=0,m=0;for(let _=0,g=l.length;_<g;_++){o.isInterleavedBufferAttribute?d=l[_]*o.data.stride+o.offset:d=l[_]*h;for(let p=0;p<h;p++)u[m++]=c[d++]}return new Ht(u,h,f)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Bt,n=this.index.array,i=this.attributes;for(const o in i){const l=i[o],c=e(l,n);t.setAttribute(o,c)}const r=this.morphAttributes;for(const o in r){const l=[],c=r[o];for(let h=0,f=c.length;h<f;h++){const u=c[h],d=e(u,n);l.push(d)}t.morphAttributes[o]=l}t.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let o=0,l=a.length;o<l;o++){const c=a[o];t.addGroup(c.start,c.count,c.materialIndex)}return t}toJSON(){const e={metadata:{version:4.7,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),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const l in n){const c=n[l];e.data.attributes[l]=c.toJSON(e.data)}const i={};let r=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],h=[];for(let f=0,u=c.length;f<u;f++){const d=c[f];h.push(d.toJSON(e.data))}h.length>0&&(i[l]=h,r=!0)}r&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;n!==null&&this.setIndex(n.clone());const i=e.attributes;for(const c in i){const h=i[c];this.setAttribute(c,h.clone(t))}const r=e.morphAttributes;for(const c in r){const h=[],f=r[c];for(let u=0,d=f.length;u<d;u++)h.push(f[u].clone(t));this.morphAttributes[c]=h}this.morphTargetsRelative=e.morphTargetsRelative;const a=e.groups;for(let c=0,h=a.length;c<h;c++){const f=a[c];this.addGroup(f.start,f.count,f.materialIndex)}const o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());const l=e.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const pc=new st,Oi=new Us,br=new gi,mc=new F,Sr=new F,Er=new F,wr=new F,ja=new F,Ar=new F,gc=new F,Tr=new F;class Ct extends It{constructor(e=new Bt,t=new Pi){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=i.length;r<a;r++){const o=i[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=r}}}}getVertexPosition(e,t){const n=this.geometry,i=n.attributes.position,r=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(i,e);const o=this.morphTargetInfluences;if(r&&o){Ar.set(0,0,0);for(let l=0,c=r.length;l<c;l++){const h=o[l],f=r[l];h!==0&&(ja.fromBufferAttribute(f,e),a?Ar.addScaledVector(ja,h):Ar.addScaledVector(ja.sub(t),h))}t.add(Ar)}return t}raycast(e,t){const n=this.geometry,i=this.material,r=this.matrixWorld;i!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),br.copy(n.boundingSphere),br.applyMatrix4(r),Oi.copy(e.ray).recast(e.near),!(br.containsPoint(Oi.origin)===!1&&(Oi.intersectSphere(br,mc)===null||Oi.origin.distanceToSquared(mc)>(e.far-e.near)**2))&&(pc.copy(r).invert(),Oi.copy(e.ray).applyMatrix4(pc),!(n.boundingBox!==null&&Oi.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,Oi)))}_computeIntersections(e,t,n){let i;const r=this.geometry,a=this.material,o=r.index,l=r.attributes.position,c=r.attributes.uv,h=r.attributes.uv1,f=r.attributes.normal,u=r.groups,d=r.drawRange;if(o!==null)if(Array.isArray(a))for(let m=0,_=u.length;m<_;m++){const g=u[m],p=a[g.materialIndex],w=Math.max(g.start,d.start),E=Math.min(o.count,Math.min(g.start+g.count,d.start+d.count));for(let S=w,U=E;S<U;S+=3){const L=o.getX(S),D=o.getX(S+1),N=o.getX(S+2);i=Cr(this,p,e,n,c,h,f,L,D,N),i&&(i.faceIndex=Math.floor(S/3),i.face.materialIndex=g.materialIndex,t.push(i))}}else{const m=Math.max(0,d.start),_=Math.min(o.count,d.start+d.count);for(let g=m,p=_;g<p;g+=3){const w=o.getX(g),E=o.getX(g+1),S=o.getX(g+2);i=Cr(this,a,e,n,c,h,f,w,E,S),i&&(i.faceIndex=Math.floor(g/3),t.push(i))}}else if(l!==void 0)if(Array.isArray(a))for(let m=0,_=u.length;m<_;m++){const g=u[m],p=a[g.materialIndex],w=Math.max(g.start,d.start),E=Math.min(l.count,Math.min(g.start+g.count,d.start+d.count));for(let S=w,U=E;S<U;S+=3){const L=S,D=S+1,N=S+2;i=Cr(this,p,e,n,c,h,f,L,D,N),i&&(i.faceIndex=Math.floor(S/3),i.face.materialIndex=g.materialIndex,t.push(i))}}else{const m=Math.max(0,d.start),_=Math.min(l.count,d.start+d.count);for(let g=m,p=_;g<p;g+=3){const w=g,E=g+1,S=g+2;i=Cr(this,a,e,n,c,h,f,w,E,S),i&&(i.faceIndex=Math.floor(g/3),t.push(i))}}}}function wf(s,e,t,n,i,r,a,o){let l;if(e.side===gn?l=n.intersectTriangle(a,r,i,!0,o):l=n.intersectTriangle(i,r,a,e.side===Wn,o),l===null)return null;Tr.copy(o),Tr.applyMatrix4(s.matrixWorld);const c=t.ray.origin.distanceTo(Tr);return c<t.near||c>t.far?null:{distance:c,point:Tr.clone(),object:s}}function Cr(s,e,t,n,i,r,a,o,l,c){s.getVertexPosition(o,Sr),s.getVertexPosition(l,Er),s.getVertexPosition(c,wr);const h=wf(s,e,t,n,Sr,Er,wr,gc);if(h){const f=new F;In.getBarycoord(gc,Sr,Er,wr,f),i&&(h.uv=In.getInterpolatedAttribute(i,o,l,c,f,new Be)),r&&(h.uv1=In.getInterpolatedAttribute(r,o,l,c,f,new Be)),a&&(h.normal=In.getInterpolatedAttribute(a,o,l,c,f,new F),h.normal.dot(n.direction)>0&&h.normal.multiplyScalar(-1));const u={a:o,b:l,c,normal:new F,materialIndex:0};In.getNormal(Sr,Er,wr,u.normal),h.face=u,h.barycoord=f}return h}class Zi extends Bt{constructor(e=1,t=1,n=1,i=1,r=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:r,depthSegments:a};const o=this;i=Math.floor(i),r=Math.floor(r),a=Math.floor(a);const l=[],c=[],h=[],f=[];let u=0,d=0;m("z","y","x",-1,-1,n,t,e,a,r,0),m("z","y","x",1,-1,n,t,-e,a,r,1),m("x","z","y",1,1,e,n,t,i,a,2),m("x","z","y",1,-1,e,n,-t,i,a,3),m("x","y","z",1,-1,e,t,n,i,r,4),m("x","y","z",-1,-1,e,t,-n,i,r,5),this.setIndex(l),this.setAttribute("position",new mt(c,3)),this.setAttribute("normal",new mt(h,3)),this.setAttribute("uv",new mt(f,2));function m(_,g,p,w,E,S,U,L,D,N,b){const M=S/D,I=U/N,V=S/2,H=U/2,J=L/2,ie=D+1,B=N+1;let oe=0,j=0;const ue=new F;for(let pe=0;pe<B;pe++){const Me=pe*I-H;for(let Ue=0;Ue<ie;Ue++){const Ne=Ue*M-V;ue[_]=Ne*w,ue[g]=Me*E,ue[p]=J,c.push(ue.x,ue.y,ue.z),ue[_]=0,ue[g]=0,ue[p]=L>0?1:-1,h.push(ue.x,ue.y,ue.z),f.push(Ue/D),f.push(1-pe/N),oe+=1}}for(let pe=0;pe<N;pe++)for(let Me=0;Me<D;Me++){const Ue=u+Me+ie*pe,Ne=u+Me+ie*(pe+1),Y=u+(Me+1)+ie*(pe+1),se=u+(Me+1)+ie*pe;l.push(Ue,Ne,se),l.push(Ne,Y,se),j+=6}o.addGroup(d,j,b),d+=j,u+=oe}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Zi(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function Ds(s){const e={};for(const t in s){e[t]={};for(const n in s[t]){const i=s[t][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=i.clone():Array.isArray(i)?e[t][n]=i.slice():e[t][n]=i}}return e}function mn(s){const e={};for(let t=0;t<s.length;t++){const n=Ds(s[t]);for(const i in n)e[i]=n[i]}return e}function Af(s){const e=[];for(let t=0;t<s.length;t++)e.push(s[t].clone());return e}function au(s){const e=s.getRenderTarget();return e===null?s.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:Mt.workingColorSpace}const Tl={clone:Ds,merge:mn};var Tf=`void main() {
|
|
5
|
+
*/const _l="177",Zu={ROTATE:0,DOLLY:1,PAN:2},Qu={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},ed=0,Xl=1,td=2,Hh=1,Gh=2,ui=3,Wn=0,gn=1,un=2,Ci=0,Es=1,ql=2,jl=3,Yl=4,nd=5,Wi=100,id=101,sd=102,rd=103,ad=104,od=200,ld=201,cd=202,hd=203,yo=204,Mo=205,ud=206,dd=207,fd=208,pd=209,md=210,gd=211,_d=212,vd=213,xd=214,bo=0,So=1,Eo=2,Ts=3,wo=4,Ao=5,To=6,Co=7,_a=0,yd=1,Md=2,Ri=0,bd=1,Sd=2,Ed=3,Wh=4,wd=5,Ad=6,Td=7,$l="attached",Cd="detached",Xh=300,Cs=301,Rs=302,Ro=303,Lo=304,va=306,Zn=1e3,Hn=1001,Po=1002,Ln=1003,Rd=1004,dr=1005,Rn=1006,Aa=1007,di=1008,ni=1009,qh=1010,jh=1011,tr=1012,vl=1013,$i=1014,Qn=1015,or=1016,xl=1017,yl=1018,nr=1020,Yh=35902,$h=1021,Jh=1022,Fn=1023,ir=1026,sr=1027,Kh=1028,Ml=1029,Zh=1030,bl=1031,Sl=1033,ea=33776,ta=33777,na=33778,ia=33779,Do=35840,No=35841,Uo=35842,Io=35843,Fo=36196,Oo=37492,zo=37496,Bo=37808,ko=37809,Vo=37810,Ho=37811,Go=37812,Wo=37813,Xo=37814,qo=37815,jo=37816,Yo=37817,$o=37818,Jo=37819,Ko=37820,Zo=37821,sa=36492,Qo=36494,el=36495,Qh=36283,tl=36284,nl=36285,il=36286,ca=2300,sl=2301,Ta=2302,Jl=2400,Kl=2401,Zl=2402,Ld=2500,Pd=3200,Dd=3201,xa=0,Nd=1,Ti="",Tt="srgb",Ls="srgb-linear",ha="linear",Ut="srgb",is=7680,Ql=519,Ud=512,Id=513,Fd=514,eu=515,Od=516,zd=517,Bd=518,kd=519,rl=35044,ec="300 es",fi=2e3,ua=2001;class Ki{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){const n=this._listeners;return n===void 0?!1:n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){const n=this._listeners;if(n===void 0)return;const i=n[e];if(i!==void 0){const r=i.indexOf(t);r!==-1&&i.splice(r,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const n=t[e.type];if(n!==void 0){e.target=this;const i=n.slice(0);for(let r=0,a=i.length;r<a;r++)i[r].call(this,e);e.target=null}}}const cn=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let tc=1234567;const Js=Math.PI/180,Ps=180/Math.PI;function Gn(){const s=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(cn[s&255]+cn[s>>8&255]+cn[s>>16&255]+cn[s>>24&255]+"-"+cn[e&255]+cn[e>>8&255]+"-"+cn[e>>16&15|64]+cn[e>>24&255]+"-"+cn[t&63|128]+cn[t>>8&255]+"-"+cn[t>>16&255]+cn[t>>24&255]+cn[n&255]+cn[n>>8&255]+cn[n>>16&255]+cn[n>>24&255]).toLowerCase()}function vt(s,e,t){return Math.max(e,Math.min(t,s))}function El(s,e){return(s%e+e)%e}function Vd(s,e,t,n,i){return n+(s-e)*(i-n)/(t-e)}function Hd(s,e,t){return s!==e?(t-s)/(e-s):0}function Ks(s,e,t){return(1-t)*s+t*e}function Gd(s,e,t,n){return Ks(s,e,1-Math.exp(-t*n))}function Wd(s,e=1){return e-Math.abs(El(s,e*2)-e)}function Xd(s,e,t){return s<=e?0:s>=t?1:(s=(s-e)/(t-e),s*s*(3-2*s))}function qd(s,e,t){return s<=e?0:s>=t?1:(s=(s-e)/(t-e),s*s*s*(s*(s*6-15)+10))}function jd(s,e){return s+Math.floor(Math.random()*(e-s+1))}function Yd(s,e){return s+Math.random()*(e-s)}function $d(s){return s*(.5-Math.random())}function Jd(s){s!==void 0&&(tc=s);let e=tc+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function Kd(s){return s*Js}function Zd(s){return s*Ps}function Qd(s){return(s&s-1)===0&&s!==0}function ef(s){return Math.pow(2,Math.ceil(Math.log(s)/Math.LN2))}function tf(s){return Math.pow(2,Math.floor(Math.log(s)/Math.LN2))}function nf(s,e,t,n,i){const r=Math.cos,a=Math.sin,o=r(t/2),l=a(t/2),c=r((e+n)/2),h=a((e+n)/2),d=r((e-n)/2),u=a((e-n)/2),f=r((n-e)/2),m=a((n-e)/2);switch(i){case"XYX":s.set(o*h,l*d,l*u,o*c);break;case"YZY":s.set(l*u,o*h,l*d,o*c);break;case"ZXZ":s.set(l*d,l*u,o*h,o*c);break;case"XZX":s.set(o*h,l*m,l*f,o*c);break;case"YXY":s.set(l*f,o*h,l*m,o*c);break;case"ZYZ":s.set(l*m,l*f,o*h,o*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Vn(s,e){switch(e.constructor){case Float32Array:return s;case Uint32Array:return s/4294967295;case Uint16Array:return s/65535;case Uint8Array:return s/255;case Int32Array:return Math.max(s/2147483647,-1);case Int16Array:return Math.max(s/32767,-1);case Int8Array:return Math.max(s/127,-1);default:throw new Error("Invalid component type.")}}function Nt(s,e){switch(e.constructor){case Float32Array:return s;case Uint32Array:return Math.round(s*4294967295);case Uint16Array:return Math.round(s*65535);case Uint8Array:return Math.round(s*255);case Int32Array:return Math.round(s*2147483647);case Int16Array:return Math.round(s*32767);case Int8Array:return Math.round(s*127);default:throw new Error("Invalid component type.")}}const Xi={DEG2RAD:Js,RAD2DEG:Ps,generateUUID:Gn,clamp:vt,euclideanModulo:El,mapLinear:Vd,inverseLerp:Hd,lerp:Ks,damp:Gd,pingpong:Wd,smoothstep:Xd,smootherstep:qd,randInt:jd,randFloat:Yd,randFloatSpread:$d,seededRandom:Jd,degToRad:Kd,radToDeg:Zd,isPowerOfTwo:Qd,ceilPowerOfTwo:ef,floorPowerOfTwo:tf,setQuaternionFromProperEuler:nf,normalize:Nt,denormalize:Vn};class Be{constructor(e=0,t=0){Be.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(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(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const 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(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=vt(this.x,e.x,t.x),this.y=vt(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=vt(this.x,e,t),this.y=vt(this.y,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(vt(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(vt(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const 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}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Pn{constructor(e=0,t=0,n=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=i}static slerpFlat(e,t,n,i,r,a,o){let l=n[i+0],c=n[i+1],h=n[i+2],d=n[i+3];const u=r[a+0],f=r[a+1],m=r[a+2],_=r[a+3];if(o===0){e[t+0]=l,e[t+1]=c,e[t+2]=h,e[t+3]=d;return}if(o===1){e[t+0]=u,e[t+1]=f,e[t+2]=m,e[t+3]=_;return}if(d!==_||l!==u||c!==f||h!==m){let g=1-o;const p=l*u+c*f+h*m+d*_,w=p>=0?1:-1,E=1-p*p;if(E>Number.EPSILON){const U=Math.sqrt(E),L=Math.atan2(U,p*w);g=Math.sin(g*L)/U,o=Math.sin(o*L)/U}const S=o*w;if(l=l*g+u*S,c=c*g+f*S,h=h*g+m*S,d=d*g+_*S,g===1-o){const U=1/Math.sqrt(l*l+c*c+h*h+d*d);l*=U,c*=U,h*=U,d*=U}}e[t]=l,e[t+1]=c,e[t+2]=h,e[t+3]=d}static multiplyQuaternionsFlat(e,t,n,i,r,a){const o=n[i],l=n[i+1],c=n[i+2],h=n[i+3],d=r[a],u=r[a+1],f=r[a+2],m=r[a+3];return e[t]=o*m+h*d+l*f-c*u,e[t+1]=l*m+h*u+c*d-o*f,e[t+2]=c*m+h*f+o*u-l*d,e[t+3]=h*m-o*d-l*u-c*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const n=e._x,i=e._y,r=e._z,a=e._order,o=Math.cos,l=Math.sin,c=o(n/2),h=o(i/2),d=o(r/2),u=l(n/2),f=l(i/2),m=l(r/2);switch(a){case"XYZ":this._x=u*h*d+c*f*m,this._y=c*f*d-u*h*m,this._z=c*h*m+u*f*d,this._w=c*h*d-u*f*m;break;case"YXZ":this._x=u*h*d+c*f*m,this._y=c*f*d-u*h*m,this._z=c*h*m-u*f*d,this._w=c*h*d+u*f*m;break;case"ZXY":this._x=u*h*d-c*f*m,this._y=c*f*d+u*h*m,this._z=c*h*m+u*f*d,this._w=c*h*d-u*f*m;break;case"ZYX":this._x=u*h*d-c*f*m,this._y=c*f*d+u*h*m,this._z=c*h*m-u*f*d,this._w=c*h*d+u*f*m;break;case"YZX":this._x=u*h*d+c*f*m,this._y=c*f*d+u*h*m,this._z=c*h*m-u*f*d,this._w=c*h*d-u*f*m;break;case"XZY":this._x=u*h*d-c*f*m,this._y=c*f*d-u*h*m,this._z=c*h*m+u*f*d,this._w=c*h*d+u*f*m;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const 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(e){const t=e.elements,n=t[0],i=t[4],r=t[8],a=t[1],o=t[5],l=t[9],c=t[2],h=t[6],d=t[10],u=n+o+d;if(u>0){const f=.5/Math.sqrt(u+1);this._w=.25/f,this._x=(h-l)*f,this._y=(r-c)*f,this._z=(a-i)*f}else if(n>o&&n>d){const f=2*Math.sqrt(1+n-o-d);this._w=(h-l)/f,this._x=.25*f,this._y=(i+a)/f,this._z=(r+c)/f}else if(o>d){const f=2*Math.sqrt(1+o-n-d);this._w=(r-c)/f,this._x=(i+a)/f,this._y=.25*f,this._z=(l+h)/f}else{const f=2*Math.sqrt(1+d-n-o);this._w=(a-i)/f,this._x=(r+c)/f,this._y=(l+h)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(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(e){return 2*Math.acos(Math.abs(vt(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(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(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,i=e._y,r=e._z,a=e._w,o=t._x,l=t._y,c=t._z,h=t._w;return this._x=n*h+a*o+i*c-r*l,this._y=i*h+a*l+r*o-n*c,this._z=r*h+a*c+n*l-i*o,this._w=a*h-n*o-i*l-r*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const n=this._x,i=this._y,r=this._z,a=this._w;let 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;const l=1-o*o;if(l<=Number.EPSILON){const f=1-t;return this._w=f*a+t*this._w,this._x=f*n+t*this._x,this._y=f*i+t*this._y,this._z=f*r+t*this._z,this.normalize(),this}const c=Math.sqrt(l),h=Math.atan2(c,o),d=Math.sin((1-t)*h)/c,u=Math.sin(t*h)/c;return this._w=a*d+this._w*u,this._x=n*d+this._x*u,this._y=i*d+this._y*u,this._z=r*d+this._z*u,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(i*Math.sin(e),i*Math.cos(e),r*Math.sin(t),r*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class F{constructor(e=0,t=0,n=0){F.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(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(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(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(nc.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(nc.setFromAxisAngle(e,t))}applyMatrix3(e){const 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}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const 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(e){const t=this.x,n=this.y,i=this.z,r=e.x,a=e.y,o=e.z,l=e.w,c=2*(a*i-o*n),h=2*(o*t-r*i),d=2*(r*n-a*t);return this.x=t+l*c+a*d-o*h,this.y=n+l*h+o*c-r*d,this.z=i+l*d+r*h-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const 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(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(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(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(e,t){return this.x=vt(this.x,e.x,t.x),this.y=vt(this.y,e.y,t.y),this.z=vt(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=vt(this.x,e,t),this.y=vt(this.y,e,t),this.z=vt(this.z,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(vt(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(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(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,i=e.y,r=e.z,a=t.x,o=t.y,l=t.z;return this.x=i*l-r*o,this.y=r*a-n*l,this.z=n*o-i*a,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return Ca.copy(this).projectOnVector(e),this.sub(Ca)}reflect(e){return this.sub(Ca.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(vt(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const 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(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const 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(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Ca=new F,nc=new Pn;class _t{constructor(e,t,n,i,r,a,o,l,c){_t.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,i,r,a,o,l,c)}set(e,t,n,i,r,a,o,l,c){const h=this.elements;return h[0]=e,h[1]=i,h[2]=o,h[3]=t,h[4]=r,h[5]=l,h[6]=n,h[7]=a,h[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const 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}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const 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}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,r=this.elements,a=n[0],o=n[3],l=n[6],c=n[1],h=n[4],d=n[7],u=n[2],f=n[5],m=n[8],_=i[0],g=i[3],p=i[6],w=i[1],E=i[4],S=i[7],U=i[2],L=i[5],D=i[8];return r[0]=a*_+o*w+l*U,r[3]=a*g+o*E+l*L,r[6]=a*p+o*S+l*D,r[1]=c*_+h*w+d*U,r[4]=c*g+h*E+d*L,r[7]=c*p+h*S+d*D,r[2]=u*_+f*w+m*U,r[5]=u*g+f*E+m*L,r[8]=u*p+f*S+m*D,this}multiplyScalar(e){const 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(){const e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8];return t*a*h-t*o*c-n*r*h+n*o*l+i*r*c-i*a*l}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8],d=h*a-o*c,u=o*l-h*r,f=c*r-a*l,m=t*d+n*u+i*f;if(m===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/m;return e[0]=d*_,e[1]=(i*c-h*n)*_,e[2]=(o*n-i*a)*_,e[3]=u*_,e[4]=(h*t-i*l)*_,e[5]=(i*r-o*t)*_,e[6]=f*_,e[7]=(n*l-c*t)*_,e[8]=(a*t-n*r)*_,this}transpose(){let e;const 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(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const 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(e,t,n,i,r,a,o){const l=Math.cos(r),c=Math.sin(r);return this.set(n*l,n*c,-n*(l*a+c*o)+a+e,-i*c,i*l,-i*(-c*a+l*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(Ra.makeScale(e,t)),this}rotate(e){return this.premultiply(Ra.makeRotation(-e)),this}translate(e,t){return this.premultiply(Ra.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const 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}clone(){return new this.constructor().fromArray(this.elements)}}const Ra=new _t;function tu(s){for(let e=s.length-1;e>=0;--e)if(s[e]>=65535)return!0;return!1}function rr(s){return document.createElementNS("http://www.w3.org/1999/xhtml",s)}function sf(){const s=rr("canvas");return s.style.display="block",s}const ic={};function ws(s){s in ic||(ic[s]=!0,console.warn(s))}function rf(s,e,t){return new Promise(function(n,i){function r(){switch(s.clientWaitSync(e,s.SYNC_FLUSH_COMMANDS_BIT,0)){case s.WAIT_FAILED:i();break;case s.TIMEOUT_EXPIRED:setTimeout(r,t);break;default:n()}}setTimeout(r,t)})}function af(s){const e=s.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function of(s){const e=s.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const sc=new _t().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),rc=new _t().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function lf(){const s={enabled:!0,workingColorSpace:Ls,spaces:{},convert:function(i,r,a){return this.enabled===!1||r===a||!r||!a||(this.spaces[r].transfer===Ut&&(i.r=pi(i.r),i.g=pi(i.g),i.b=pi(i.b)),this.spaces[r].primaries!==this.spaces[a].primaries&&(i.applyMatrix3(this.spaces[r].toXYZ),i.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===Ut&&(i.r=As(i.r),i.g=As(i.g),i.b=As(i.b))),i},workingToColorSpace:function(i,r){return this.convert(i,this.workingColorSpace,r)},colorSpaceToWorking:function(i,r){return this.convert(i,r,this.workingColorSpace)},getPrimaries:function(i){return this.spaces[i].primaries},getTransfer:function(i){return i===Ti?ha:this.spaces[i].transfer},getLuminanceCoefficients:function(i,r=this.workingColorSpace){return i.fromArray(this.spaces[r].luminanceCoefficients)},define:function(i){Object.assign(this.spaces,i)},_getMatrix:function(i,r,a){return i.copy(this.spaces[r].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(i){return this.spaces[i].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(i=this.workingColorSpace){return this.spaces[i].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(i,r){return ws("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),s.workingToColorSpace(i,r)},toWorkingColorSpace:function(i,r){return ws("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),s.colorSpaceToWorking(i,r)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],n=[.3127,.329];return s.define({[Ls]:{primaries:e,whitePoint:n,transfer:ha,toXYZ:sc,fromXYZ:rc,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Tt},outputColorSpaceConfig:{drawingBufferColorSpace:Tt}},[Tt]:{primaries:e,whitePoint:n,transfer:Ut,toXYZ:sc,fromXYZ:rc,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Tt}}}),s}const Mt=lf();function pi(s){return s<.04045?s*.0773993808:Math.pow(s*.9478672986+.0521327014,2.4)}function As(s){return s<.0031308?s*12.92:1.055*Math.pow(s,.41666)-.055}let ss;class cf{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{ss===void 0&&(ss=rr("canvas")),ss.width=e.width,ss.height=e.height;const i=ss.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),n=ss}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=rr("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const i=n.getImageData(0,0,e.width,e.height),r=i.data;for(let a=0;a<r.length;a++)r[a]=pi(r[a]/255)*255;return n.putImageData(i,0,0),t}else if(e.data){const t=e.data.slice(0);for(let n=0;n<t.length;n++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[n]=Math.floor(pi(t[n]/255)*255):t[n]=pi(t[n]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let hf=0;class wl{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:hf++}),this.uuid=Gn(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const t=this.data;return t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight):t!==null?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const n={uuid:this.uuid,url:""},i=this.data;if(i!==null){let r;if(Array.isArray(i)){r=[];for(let a=0,o=i.length;a<o;a++)i[a].isDataTexture?r.push(La(i[a].image)):r.push(La(i[a]))}else r=La(i);n.url=r}return t||(e.images[this.uuid]=n),n}}function La(s){return typeof HTMLImageElement<"u"&&s instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&s instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&s instanceof ImageBitmap?cf.getDataURL(s):s.data?{data:Array.from(s.data),width:s.width,height:s.height,type:s.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let uf=0;const Pa=new F;class on extends Ki{constructor(e=on.DEFAULT_IMAGE,t=on.DEFAULT_MAPPING,n=Hn,i=Hn,r=Rn,a=di,o=Fn,l=ni,c=on.DEFAULT_ANISOTROPY,h=Ti){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:uf++}),this.uuid=Gn(),this.name="",this.source=new wl(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=r,this.minFilter=a,this.anisotropy=c,this.format=o,this.internalFormat=null,this.type=l,this.offset=new Be(0,0),this.repeat=new Be(1,1),this.center=new Be(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new _t,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0}get width(){return this.source.getSize(Pa).x}get height(){return this.source.getSize(Pa).y}get depth(){return this.source.getSize(Pa).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,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.internalFormat=e.internalFormat,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.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const t in e){const n=e[t];if(n===void 0){console.warn(`THREE.Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){console.warn(`THREE.Texture.setValues(): property '${t}' does not exist.`);continue}i&&n&&i.isVector2&&n.isVector2||i&&n&&i.isVector3&&n.isVector3||i&&n&&i.isMatrix3&&n.isMatrix3?i.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const n={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,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,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Xh)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Zn:e.x=e.x-Math.floor(e.x);break;case Hn:e.x=e.x<0?0:1;break;case Po:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Zn:e.y=e.y-Math.floor(e.y);break;case Hn:e.y=e.y<0?0:1;break;case Po:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}on.DEFAULT_IMAGE=null;on.DEFAULT_MAPPING=Xh;on.DEFAULT_ANISOTROPY=1;class bt{constructor(e=0,t=0,n=0,i=1){bt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(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(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(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(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(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(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(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}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const 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}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const 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(e){let t,n,i,r;const l=e.elements,c=l[0],h=l[4],d=l[8],u=l[1],f=l[5],m=l[9],_=l[2],g=l[6],p=l[10];if(Math.abs(h-u)<.01&&Math.abs(d-_)<.01&&Math.abs(m-g)<.01){if(Math.abs(h+u)<.1&&Math.abs(d+_)<.1&&Math.abs(m+g)<.1&&Math.abs(c+f+p-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const E=(c+1)/2,S=(f+1)/2,U=(p+1)/2,L=(h+u)/4,D=(d+_)/4,N=(m+g)/4;return E>S&&E>U?E<.01?(n=0,i=.707106781,r=.707106781):(n=Math.sqrt(E),i=L/n,r=D/n):S>U?S<.01?(n=.707106781,i=0,r=.707106781):(i=Math.sqrt(S),n=L/i,r=N/i):U<.01?(n=.707106781,i=.707106781,r=0):(r=Math.sqrt(U),n=D/r,i=N/r),this.set(n,i,r,t),this}let w=Math.sqrt((g-m)*(g-m)+(d-_)*(d-_)+(u-h)*(u-h));return Math.abs(w)<.001&&(w=1),this.x=(g-m)/w,this.y=(d-_)/w,this.z=(u-h)/w,this.w=Math.acos((c+f+p-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(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(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(e,t){return this.x=vt(this.x,e.x,t.x),this.y=vt(this.y,e.y,t.y),this.z=vt(this.z,e.z,t.z),this.w=vt(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=vt(this.x,e,t),this.y=vt(this.y,e,t),this.z=vt(this.z,e,t),this.w=vt(this.w,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(vt(n,e,t))}floor(){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(){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(){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(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(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(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class df extends Ki{constructor(e=1,t=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Rn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},n),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=n.depth,this.scissor=new bt(0,0,e,t),this.scissorTest=!1,this.viewport=new bt(0,0,e,t);const i={width:e,height:t,depth:n.depth},r=new on(i);this.textures=[];const a=n.count;for(let o=0;o<a;o++)this.textures[o]=r.clone(),this.textures[o].isRenderTargetTexture=!0,this.textures[o].renderTarget=this;this._setTextureOptions(n),this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=n.depthTexture,this.samples=n.samples,this.multiview=n.multiview}_setTextureOptions(e={}){const t={minFilter:Rn,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(t.mapping=e.mapping),e.wrapS!==void 0&&(t.wrapS=e.wrapS),e.wrapT!==void 0&&(t.wrapT=e.wrapT),e.wrapR!==void 0&&(t.wrapR=e.wrapR),e.magFilter!==void 0&&(t.magFilter=e.magFilter),e.minFilter!==void 0&&(t.minFilter=e.minFilter),e.format!==void 0&&(t.format=e.format),e.type!==void 0&&(t.type=e.type),e.anisotropy!==void 0&&(t.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(t.colorSpace=e.colorSpace),e.flipY!==void 0&&(t.flipY=e.flipY),e.generateMipmaps!==void 0&&(t.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(t.internalFormat=e.internalFormat);for(let n=0;n<this.textures.length;n++)this.textures[n].setValues(t)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let i=0,r=this.textures.length;i<r;i++)this.textures[i].image.width=e,this.textures[i].image.height=t,this.textures[i].image.depth=n,this.textures[i].isArrayTexture=this.textures[i].image.depth>1;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t<n;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;const i=Object.assign({},e.textures[t].image);this.textures[t].source=new wl(i)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Ji extends df{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class nu extends on{constructor(e=null,t=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=Ln,this.minFilter=Ln,this.wrapR=Hn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class ff extends on{constructor(e=null,t=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=Ln,this.minFilter=Ln,this.wrapR=Hn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class qn{constructor(e=new F(1/0,1/0,1/0),t=new F(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(On.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(On.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=On.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){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(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const n=e.geometry;if(n!==void 0){const r=n.getAttribute("position");if(t===!0&&r!==void 0&&e.isInstancedMesh!==!0)for(let a=0,o=r.count;a<o;a++)e.isMesh===!0?e.getVertexPosition(a,On):On.fromBufferAttribute(r,a),On.applyMatrix4(e.matrixWorld),this.expandByPoint(On);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),fr.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),fr.copy(n.boundingBox)),fr.applyMatrix4(e.matrixWorld),this.union(fr)}const i=e.children;for(let r=0,a=i.length;r<a;r++)this.expandByObject(i[r],t);return this}containsPoint(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(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(e,t){return 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(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(e){return this.clampPoint(e.center,On),On.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let 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(e){if(this.isEmpty())return!1;this.getCenter(Bs),pr.subVectors(this.max,Bs),rs.subVectors(e.a,Bs),as.subVectors(e.b,Bs),os.subVectors(e.c,Bs),xi.subVectors(as,rs),yi.subVectors(os,as),Ii.subVectors(rs,os);let t=[0,-xi.z,xi.y,0,-yi.z,yi.y,0,-Ii.z,Ii.y,xi.z,0,-xi.x,yi.z,0,-yi.x,Ii.z,0,-Ii.x,-xi.y,xi.x,0,-yi.y,yi.x,0,-Ii.y,Ii.x,0];return!Da(t,rs,as,os,pr)||(t=[1,0,0,0,1,0,0,0,1],!Da(t,rs,as,os,pr))?!1:(mr.crossVectors(xi,yi),t=[mr.x,mr.y,mr.z],Da(t,rs,as,os,pr))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,On).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(On).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(ri[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ri[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ri[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ri[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ri[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ri[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ri[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ri[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ri),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const ri=[new F,new F,new F,new F,new F,new F,new F,new F],On=new F,fr=new qn,rs=new F,as=new F,os=new F,xi=new F,yi=new F,Ii=new F,Bs=new F,pr=new F,mr=new F,Fi=new F;function Da(s,e,t,n,i){for(let r=0,a=s.length-3;r<=a;r+=3){Fi.fromArray(s,r);const o=i.x*Math.abs(Fi.x)+i.y*Math.abs(Fi.y)+i.z*Math.abs(Fi.z),l=e.dot(Fi),c=t.dot(Fi),h=n.dot(Fi);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>o)return!1}return!0}const pf=new qn,ks=new F,Na=new F;class gi{constructor(e=new F,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;t!==void 0?n.copy(t):pf.setFromPoints(e).getCenter(n);let i=0;for(let r=0,a=e.length;r<a;r++)i=Math.max(i,n.distanceToSquared(e[r]));return this.radius=Math.sqrt(i),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;ks.subVectors(e,this.center);const t=ks.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.addScaledVector(ks,i/n),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(Na.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(ks.copy(e.center).add(Na)),this.expandByPoint(ks.copy(e.center).sub(Na))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}const ai=new F,Ua=new F,gr=new F,Mi=new F,Ia=new F,_r=new F,Fa=new F;class Us{constructor(e=new F,t=new F(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,ai)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=ai.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(ai.copy(this.origin).addScaledVector(this.direction,t),ai.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){Ua.copy(e).add(t).multiplyScalar(.5),gr.copy(t).sub(e).normalize(),Mi.copy(this.origin).sub(Ua);const r=e.distanceTo(t)*.5,a=-this.direction.dot(gr),o=Mi.dot(this.direction),l=-Mi.dot(gr),c=Mi.lengthSq(),h=Math.abs(1-a*a);let d,u,f,m;if(h>0)if(d=a*l-o,u=a*o-l,m=r*h,d>=0)if(u>=-m)if(u<=m){const _=1/h;d*=_,u*=_,f=d*(d+a*u+2*o)+u*(a*d+u+2*l)+c}else u=r,d=Math.max(0,-(a*u+o)),f=-d*d+u*(u+2*l)+c;else u=-r,d=Math.max(0,-(a*u+o)),f=-d*d+u*(u+2*l)+c;else u<=-m?(d=Math.max(0,-(-a*r+o)),u=d>0?-r:Math.min(Math.max(-r,-l),r),f=-d*d+u*(u+2*l)+c):u<=m?(d=0,u=Math.min(Math.max(-r,-l),r),f=u*(u+2*l)+c):(d=Math.max(0,-(a*r+o)),u=d>0?r:Math.min(Math.max(-r,-l),r),f=-d*d+u*(u+2*l)+c);else u=a>0?-r:r,d=Math.max(0,-(a*u+o)),f=-d*d+u*(u+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,d),i&&i.copy(Ua).addScaledVector(gr,u),f}intersectSphere(e,t){ai.subVectors(e.center,this.origin);const n=ai.dot(this.direction),i=ai.dot(ai)-n*n,r=e.radius*e.radius;if(i>r)return null;const a=Math.sqrt(r-i),o=n-a,l=n+a;return l<0?null:o<0?this.at(l,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,r,a,o,l;const c=1/this.direction.x,h=1/this.direction.y,d=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),h>=0?(r=(e.min.y-u.y)*h,a=(e.max.y-u.y)*h):(r=(e.max.y-u.y)*h,a=(e.min.y-u.y)*h),n>a||r>i||((r>n||isNaN(n))&&(n=r),(a<i||isNaN(i))&&(i=a),d>=0?(o=(e.min.z-u.z)*d,l=(e.max.z-u.z)*d):(o=(e.max.z-u.z)*d,l=(e.min.z-u.z)*d),n>l||o>i)||((o>n||n!==n)&&(n=o),(l<i||i!==i)&&(i=l),i<0)?null:this.at(n>=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,ai)!==null}intersectTriangle(e,t,n,i,r){Ia.subVectors(t,e),_r.subVectors(n,e),Fa.crossVectors(Ia,_r);let a=this.direction.dot(Fa),o;if(a>0){if(i)return null;o=1}else if(a<0)o=-1,a=-a;else return null;Mi.subVectors(this.origin,e);const l=o*this.direction.dot(_r.crossVectors(Mi,_r));if(l<0)return null;const c=o*this.direction.dot(Ia.cross(Mi));if(c<0||l+c>a)return null;const h=-o*Mi.dot(Fa);return h<0?null:this.at(h/a,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class st{constructor(e,t,n,i,r,a,o,l,c,h,d,u,f,m,_,g){st.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,i,r,a,o,l,c,h,d,u,f,m,_,g)}set(e,t,n,i,r,a,o,l,c,h,d,u,f,m,_,g){const p=this.elements;return p[0]=e,p[4]=t,p[8]=n,p[12]=i,p[1]=r,p[5]=a,p[9]=o,p[13]=l,p[2]=c,p[6]=h,p[10]=d,p[14]=u,p[3]=f,p[7]=m,p[11]=_,p[15]=g,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new st().fromArray(this.elements)}copy(e){const 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(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(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(e){const t=this.elements,n=e.elements,i=1/ls.setFromMatrixColumn(e,0).length(),r=1/ls.setFromMatrixColumn(e,1).length(),a=1/ls.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*r,t[5]=n[5]*r,t[6]=n[6]*r,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,i=e.y,r=e.z,a=Math.cos(n),o=Math.sin(n),l=Math.cos(i),c=Math.sin(i),h=Math.cos(r),d=Math.sin(r);if(e.order==="XYZ"){const u=a*h,f=a*d,m=o*h,_=o*d;t[0]=l*h,t[4]=-l*d,t[8]=c,t[1]=f+m*c,t[5]=u-_*c,t[9]=-o*l,t[2]=_-u*c,t[6]=m+f*c,t[10]=a*l}else if(e.order==="YXZ"){const u=l*h,f=l*d,m=c*h,_=c*d;t[0]=u+_*o,t[4]=m*o-f,t[8]=a*c,t[1]=a*d,t[5]=a*h,t[9]=-o,t[2]=f*o-m,t[6]=_+u*o,t[10]=a*l}else if(e.order==="ZXY"){const u=l*h,f=l*d,m=c*h,_=c*d;t[0]=u-_*o,t[4]=-a*d,t[8]=m+f*o,t[1]=f+m*o,t[5]=a*h,t[9]=_-u*o,t[2]=-a*c,t[6]=o,t[10]=a*l}else if(e.order==="ZYX"){const u=a*h,f=a*d,m=o*h,_=o*d;t[0]=l*h,t[4]=m*c-f,t[8]=u*c+_,t[1]=l*d,t[5]=_*c+u,t[9]=f*c-m,t[2]=-c,t[6]=o*l,t[10]=a*l}else if(e.order==="YZX"){const u=a*l,f=a*c,m=o*l,_=o*c;t[0]=l*h,t[4]=_-u*d,t[8]=m*d+f,t[1]=d,t[5]=a*h,t[9]=-o*h,t[2]=-c*h,t[6]=f*d+m,t[10]=u-_*d}else if(e.order==="XZY"){const u=a*l,f=a*c,m=o*l,_=o*c;t[0]=l*h,t[4]=-d,t[8]=c*h,t[1]=u*d+_,t[5]=a*h,t[9]=f*d-m,t[2]=m*d-f,t[6]=o*h,t[10]=_*d+u}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(mf,e,gf)}lookAt(e,t,n){const i=this.elements;return Tn.subVectors(e,t),Tn.lengthSq()===0&&(Tn.z=1),Tn.normalize(),bi.crossVectors(n,Tn),bi.lengthSq()===0&&(Math.abs(n.z)===1?Tn.x+=1e-4:Tn.z+=1e-4,Tn.normalize(),bi.crossVectors(n,Tn)),bi.normalize(),vr.crossVectors(Tn,bi),i[0]=bi.x,i[4]=vr.x,i[8]=Tn.x,i[1]=bi.y,i[5]=vr.y,i[9]=Tn.y,i[2]=bi.z,i[6]=vr.z,i[10]=Tn.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,r=this.elements,a=n[0],o=n[4],l=n[8],c=n[12],h=n[1],d=n[5],u=n[9],f=n[13],m=n[2],_=n[6],g=n[10],p=n[14],w=n[3],E=n[7],S=n[11],U=n[15],L=i[0],D=i[4],N=i[8],b=i[12],M=i[1],I=i[5],V=i[9],H=i[13],J=i[2],ie=i[6],B=i[10],oe=i[14],j=i[3],ue=i[7],pe=i[11],Me=i[15];return r[0]=a*L+o*M+l*J+c*j,r[4]=a*D+o*I+l*ie+c*ue,r[8]=a*N+o*V+l*B+c*pe,r[12]=a*b+o*H+l*oe+c*Me,r[1]=h*L+d*M+u*J+f*j,r[5]=h*D+d*I+u*ie+f*ue,r[9]=h*N+d*V+u*B+f*pe,r[13]=h*b+d*H+u*oe+f*Me,r[2]=m*L+_*M+g*J+p*j,r[6]=m*D+_*I+g*ie+p*ue,r[10]=m*N+_*V+g*B+p*pe,r[14]=m*b+_*H+g*oe+p*Me,r[3]=w*L+E*M+S*J+U*j,r[7]=w*D+E*I+S*ie+U*ue,r[11]=w*N+E*V+S*B+U*pe,r[15]=w*b+E*H+S*oe+U*Me,this}multiplyScalar(e){const 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}determinant(){const e=this.elements,t=e[0],n=e[4],i=e[8],r=e[12],a=e[1],o=e[5],l=e[9],c=e[13],h=e[2],d=e[6],u=e[10],f=e[14],m=e[3],_=e[7],g=e[11],p=e[15];return m*(+r*l*d-i*c*d-r*o*u+n*c*u+i*o*f-n*l*f)+_*(+t*l*f-t*c*u+r*a*u-i*a*f+i*c*h-r*l*h)+g*(+t*c*d-t*o*f-r*a*d+n*a*f+r*o*h-n*c*h)+p*(-i*o*h-t*l*d+t*o*u+i*a*d-n*a*u+n*l*h)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8],d=e[9],u=e[10],f=e[11],m=e[12],_=e[13],g=e[14],p=e[15],w=d*g*c-_*u*c+_*l*f-o*g*f-d*l*p+o*u*p,E=m*u*c-h*g*c-m*l*f+a*g*f+h*l*p-a*u*p,S=h*_*c-m*d*c+m*o*f-a*_*f-h*o*p+a*d*p,U=m*d*l-h*_*l-m*o*u+a*_*u+h*o*g-a*d*g,L=t*w+n*E+i*S+r*U;if(L===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const D=1/L;return e[0]=w*D,e[1]=(_*u*r-d*g*r-_*i*f+n*g*f+d*i*p-n*u*p)*D,e[2]=(o*g*r-_*l*r+_*i*c-n*g*c-o*i*p+n*l*p)*D,e[3]=(d*l*r-o*u*r-d*i*c+n*u*c+o*i*f-n*l*f)*D,e[4]=E*D,e[5]=(h*g*r-m*u*r+m*i*f-t*g*f-h*i*p+t*u*p)*D,e[6]=(m*l*r-a*g*r-m*i*c+t*g*c+a*i*p-t*l*p)*D,e[7]=(a*u*r-h*l*r+h*i*c-t*u*c-a*i*f+t*l*f)*D,e[8]=S*D,e[9]=(m*d*r-h*_*r-m*n*f+t*_*f+h*n*p-t*d*p)*D,e[10]=(a*_*r-m*o*r+m*n*c-t*_*c-a*n*p+t*o*p)*D,e[11]=(h*o*r-a*d*r-h*n*c+t*d*c+a*n*f-t*o*f)*D,e[12]=U*D,e[13]=(h*_*i-m*d*i+m*n*u-t*_*u-h*n*g+t*d*g)*D,e[14]=(m*o*i-a*_*i-m*n*l+t*_*l+a*n*g-t*o*g)*D,e[15]=(a*d*i-h*o*i+h*n*l-t*d*l-a*n*u+t*o*u)*D,this}scale(e){const 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(){const 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(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const 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(e){const 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(e){const 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(e,t){const n=Math.cos(t),i=Math.sin(t),r=1-n,a=e.x,o=e.y,l=e.z,c=r*a,h=r*o;return this.set(c*a+n,c*o-i*l,c*l+i*o,0,c*o+i*l,h*o+n,h*l-i*a,0,c*l-i*o,h*l+i*a,r*l*l+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,r,a){return this.set(1,n,r,0,e,1,a,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,r=t._x,a=t._y,o=t._z,l=t._w,c=r+r,h=a+a,d=o+o,u=r*c,f=r*h,m=r*d,_=a*h,g=a*d,p=o*d,w=l*c,E=l*h,S=l*d,U=n.x,L=n.y,D=n.z;return i[0]=(1-(_+p))*U,i[1]=(f+S)*U,i[2]=(m-E)*U,i[3]=0,i[4]=(f-S)*L,i[5]=(1-(u+p))*L,i[6]=(g+w)*L,i[7]=0,i[8]=(m+E)*D,i[9]=(g-w)*D,i[10]=(1-(u+_))*D,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){const i=this.elements;let r=ls.set(i[0],i[1],i[2]).length();const a=ls.set(i[4],i[5],i[6]).length(),o=ls.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],zn.copy(this);const c=1/r,h=1/a,d=1/o;return zn.elements[0]*=c,zn.elements[1]*=c,zn.elements[2]*=c,zn.elements[4]*=h,zn.elements[5]*=h,zn.elements[6]*=h,zn.elements[8]*=d,zn.elements[9]*=d,zn.elements[10]*=d,t.setFromRotationMatrix(zn),n.x=r,n.y=a,n.z=o,this}makePerspective(e,t,n,i,r,a,o=fi){const l=this.elements,c=2*r/(t-e),h=2*r/(n-i),d=(t+e)/(t-e),u=(n+i)/(n-i);let f,m;if(o===fi)f=-(a+r)/(a-r),m=-2*a*r/(a-r);else if(o===ua)f=-a/(a-r),m=-a*r/(a-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return l[0]=c,l[4]=0,l[8]=d,l[12]=0,l[1]=0,l[5]=h,l[9]=u,l[13]=0,l[2]=0,l[6]=0,l[10]=f,l[14]=m,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,n,i,r,a,o=fi){const l=this.elements,c=1/(t-e),h=1/(n-i),d=1/(a-r),u=(t+e)*c,f=(n+i)*h;let m,_;if(o===fi)m=(a+r)*d,_=-2*d;else if(o===ua)m=r*d,_=-1*d;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-u,l[1]=0,l[5]=2*h,l[9]=0,l[13]=-f,l[2]=0,l[6]=0,l[10]=_,l[14]=-m,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const 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}}const ls=new F,zn=new st,mf=new F(0,0,0),gf=new F(1,1,1),bi=new F,vr=new F,Tn=new F,ac=new st,oc=new Pn;class _n{constructor(e=0,t=0,n=0,i=_n.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const i=e.elements,r=i[0],a=i[4],o=i[8],l=i[1],c=i[5],h=i[9],d=i[2],u=i[6],f=i[10];switch(t){case"XYZ":this._y=Math.asin(vt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,f),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(u,c),this._z=0);break;case"YXZ":this._x=Math.asin(-vt(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,f),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-d,r),this._z=0);break;case"ZXY":this._x=Math.asin(vt(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(-d,f),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,r));break;case"ZYX":this._y=Math.asin(-vt(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(u,f),this._z=Math.atan2(l,r)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(vt(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-d,r)):(this._x=0,this._y=Math.atan2(o,f));break;case"XZY":this._z=Math.asin(-vt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(u,c),this._y=Math.atan2(o,r)):(this._x=Math.atan2(-h,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return ac.makeRotationFromQuaternion(e),this.setFromRotationMatrix(ac,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return oc.setFromEuler(this),this.setFromQuaternion(oc,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}_n.DEFAULT_ORDER="XYZ";class Al{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let _f=0;const lc=new F,cs=new Pn,oi=new st,xr=new F,Vs=new F,vf=new F,xf=new Pn,cc=new F(1,0,0),hc=new F(0,1,0),uc=new F(0,0,1),dc={type:"added"},yf={type:"removed"},hs={type:"childadded",child:null},Oa={type:"childremoved",child:null};class It extends Ki{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:_f++}),this.uuid=Gn(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=It.DEFAULT_UP.clone();const e=new F,t=new _n,n=new Pn,i=new F(1,1,1);function r(){n.setFromEuler(t,!1)}function a(){t.setFromQuaternion(n,void 0,!1)}t._onChange(r),n._onChange(a),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 st},normalMatrix:{value:new _t}}),this.matrix=new st,this.matrixWorld=new st,this.matrixAutoUpdate=It.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=It.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Al,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return cs.setFromAxisAngle(e,t),this.quaternion.multiply(cs),this}rotateOnWorldAxis(e,t){return cs.setFromAxisAngle(e,t),this.quaternion.premultiply(cs),this}rotateX(e){return this.rotateOnAxis(cc,e)}rotateY(e){return this.rotateOnAxis(hc,e)}rotateZ(e){return this.rotateOnAxis(uc,e)}translateOnAxis(e,t){return lc.copy(e).applyQuaternion(this.quaternion),this.position.add(lc.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(cc,e)}translateY(e){return this.translateOnAxis(hc,e)}translateZ(e){return this.translateOnAxis(uc,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(oi.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?xr.copy(e):xr.set(e,t,n);const i=this.parent;this.updateWorldMatrix(!0,!1),Vs.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?oi.lookAt(Vs,xr,this.up):oi.lookAt(xr,Vs,this.up),this.quaternion.setFromRotationMatrix(oi),i&&(oi.extractRotation(i.matrixWorld),cs.setFromRotationMatrix(oi),this.quaternion.premultiply(cs.invert()))}add(e){if(arguments.length>1){for(let 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?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(dc),hs.child=e,this.dispatchEvent(hs),hs.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(yf),Oa.child=e,this.dispatchEvent(Oa),Oa.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),oi.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),oi.multiply(e.parent.matrixWorld)),e.applyMatrix4(oi),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(dc),hs.child=e,this.dispatchEvent(hs),hs.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,i=this.children.length;n<i;n++){const a=this.children[n].getObjectByProperty(e,t);if(a!==void 0)return a}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const i=this.children;for(let r=0,a=i.length;r<a;r++)i[r].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Vs,e,vf),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Vs,xf,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t){const n=this.parent;if(e===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){const i=this.children;for(let r=0,a=i.length;r<a;r++)i[r].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.geometryInfo=this._geometryInfo.map(o=>({...o,boundingBox:o.boundingBox?o.boundingBox.toJSON():void 0,boundingSphere:o.boundingSphere?o.boundingSphere.toJSON():void 0})),i.instanceInfo=this._instanceInfo.map(o=>({...o})),i.availableInstanceIds=this._availableInstanceIds.slice(),i.availableGeometryIds=this._availableGeometryIds.slice(),i.nextIndexStart=this._nextIndexStart,i.nextVertexStart=this._nextVertexStart,i.geometryCount=this._geometryCount,i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.matricesTexture=this._matricesTexture.toJSON(e),i.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(i.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(i.boundingBox=this.boundingBox.toJSON()));function r(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=r(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let c=0,h=l.length;c<h;c++){const d=l[c];r(e.shapes,d)}else r(e.shapes,l)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(r(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let l=0,c=this.material.length;l<c;l++)o.push(r(e.materials,this.material[l]));i.material=o}else i.material=r(e.materials,this.material);if(this.children.length>0){i.children=[];for(let o=0;o<this.children.length;o++)i.children.push(this.children[o].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let o=0;o<this.animations.length;o++){const l=this.animations[o];i.animations.push(r(e.animations,l))}}if(t){const o=a(e.geometries),l=a(e.materials),c=a(e.textures),h=a(e.images),d=a(e.shapes),u=a(e.skeletons),f=a(e.animations),m=a(e.nodes);o.length>0&&(n.geometries=o),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),h.length>0&&(n.images=h),d.length>0&&(n.shapes=d),u.length>0&&(n.skeletons=u),f.length>0&&(n.animations=f),m.length>0&&(n.nodes=m)}return n.object=i,n;function a(o){const l=[];for(const c in o){const h=o[c];delete h.metadata,l.push(h)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,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.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,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.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n<e.children.length;n++){const i=e.children[n];this.add(i.clone())}return this}}It.DEFAULT_UP=new F(0,1,0);It.DEFAULT_MATRIX_AUTO_UPDATE=!0;It.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Bn=new F,li=new F,za=new F,ci=new F,us=new F,ds=new F,fc=new F,Ba=new F,ka=new F,Va=new F,Ha=new bt,Ga=new bt,Wa=new bt;class In{constructor(e=new F,t=new F,n=new F){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,i){i.subVectors(n,t),Bn.subVectors(e,t),i.cross(Bn);const r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(e,t,n,i,r){Bn.subVectors(i,t),li.subVectors(n,t),za.subVectors(e,t);const a=Bn.dot(Bn),o=Bn.dot(li),l=Bn.dot(za),c=li.dot(li),h=li.dot(za),d=a*c-o*o;if(d===0)return r.set(0,0,0),null;const u=1/d,f=(c*l-o*h)*u,m=(a*h-o*l)*u;return r.set(1-f-m,m,f)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,ci)===null?!1:ci.x>=0&&ci.y>=0&&ci.x+ci.y<=1}static getInterpolation(e,t,n,i,r,a,o,l){return this.getBarycoord(e,t,n,i,ci)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(r,ci.x),l.addScaledVector(a,ci.y),l.addScaledVector(o,ci.z),l)}static getInterpolatedAttribute(e,t,n,i,r,a){return Ha.setScalar(0),Ga.setScalar(0),Wa.setScalar(0),Ha.fromBufferAttribute(e,t),Ga.fromBufferAttribute(e,n),Wa.fromBufferAttribute(e,i),a.setScalar(0),a.addScaledVector(Ha,r.x),a.addScaledVector(Ga,r.y),a.addScaledVector(Wa,r.z),a}static isFrontFacing(e,t,n,i){return Bn.subVectors(n,t),li.subVectors(e,t),Bn.cross(li).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,n,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Bn.subVectors(this.c,this.b),li.subVectors(this.a,this.b),Bn.cross(li).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return In.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return In.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,i,r){return In.getInterpolation(e,this.a,this.b,this.c,t,n,i,r)}containsPoint(e){return In.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return In.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,i=this.b,r=this.c;let a,o;us.subVectors(i,n),ds.subVectors(r,n),Ba.subVectors(e,n);const l=us.dot(Ba),c=ds.dot(Ba);if(l<=0&&c<=0)return t.copy(n);ka.subVectors(e,i);const h=us.dot(ka),d=ds.dot(ka);if(h>=0&&d<=h)return t.copy(i);const u=l*d-h*c;if(u<=0&&l>=0&&h<=0)return a=l/(l-h),t.copy(n).addScaledVector(us,a);Va.subVectors(e,r);const f=us.dot(Va),m=ds.dot(Va);if(m>=0&&f<=m)return t.copy(r);const _=f*c-l*m;if(_<=0&&c>=0&&m<=0)return o=c/(c-m),t.copy(n).addScaledVector(ds,o);const g=h*m-f*d;if(g<=0&&d-h>=0&&f-m>=0)return fc.subVectors(r,i),o=(d-h)/(d-h+(f-m)),t.copy(i).addScaledVector(fc,o);const p=1/(g+_+u);return a=_*p,o=u*p,t.copy(n).addScaledVector(us,a).addScaledVector(ds,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const iu={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},Si={h:0,s:0,l:0},yr={h:0,s:0,l:0};function Xa(s,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?s+(e-s)*6*t:t<1/2?e:t<2/3?s+(e-s)*6*(2/3-t):s}class et{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Tt){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Mt.colorSpaceToWorking(this,t),this}setRGB(e,t,n,i=Mt.workingColorSpace){return this.r=e,this.g=t,this.b=n,Mt.colorSpaceToWorking(this,i),this}setHSL(e,t,n,i=Mt.workingColorSpace){if(e=El(e,1),t=vt(t,0,1),n=vt(n,0,1),t===0)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+t):n+t-n*t,a=2*n-r;this.r=Xa(a,r,e+1/3),this.g=Xa(a,r,e),this.b=Xa(a,r,e-1/3)}return Mt.colorSpaceToWorking(this,i),this}setStyle(e,t=Tt){function n(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let r;const a=i[1],o=i[2];switch(a){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=i[1],a=r.length;if(a===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(a===6)return this.setHex(parseInt(r,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Tt){const n=iu[e.toLowerCase()];return n!==void 0?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=pi(e.r),this.g=pi(e.g),this.b=pi(e.b),this}copyLinearToSRGB(e){return this.r=As(e.r),this.g=As(e.g),this.b=As(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Tt){return Mt.workingToColorSpace(hn.copy(this),e),Math.round(vt(hn.r*255,0,255))*65536+Math.round(vt(hn.g*255,0,255))*256+Math.round(vt(hn.b*255,0,255))}getHexString(e=Tt){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Mt.workingColorSpace){Mt.workingToColorSpace(hn.copy(this),t);const n=hn.r,i=hn.g,r=hn.b,a=Math.max(n,i,r),o=Math.min(n,i,r);let l,c;const h=(o+a)/2;if(o===a)l=0,c=0;else{const d=a-o;switch(c=h<=.5?d/(a+o):d/(2-a-o),a){case n:l=(i-r)/d+(i<r?6:0);break;case i:l=(r-n)/d+2;break;case r:l=(n-i)/d+4;break}l/=6}return e.h=l,e.s=c,e.l=h,e}getRGB(e,t=Mt.workingColorSpace){return Mt.workingToColorSpace(hn.copy(this),t),e.r=hn.r,e.g=hn.g,e.b=hn.b,e}getStyle(e=Tt){Mt.workingToColorSpace(hn.copy(this),e);const t=hn.r,n=hn.g,i=hn.b;return e!==Tt?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(i*255)})`}offsetHSL(e,t,n){return this.getHSL(Si),this.setHSL(Si.h+e,Si.s+t,Si.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(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(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(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}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(Si),e.getHSL(yr);const n=Ks(Si.h,yr.h,t),i=Ks(Si.s,yr.s,t),r=Ks(Si.l,yr.l,t);return this.setHSL(n,i,r),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,i=this.b,r=e.elements;return this.r=r[0]*t+r[3]*n+r[6]*i,this.g=r[1]*t+r[4]*n+r[7]*i,this.b=r[2]*t+r[5]*n+r[8]*i,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const hn=new et;et.NAMES=iu;let Mf=0;class Dn extends Ki{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Mf++}),this.uuid=Gn(),this.name="",this.type="Material",this.blending=Es,this.side=Wn,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=yo,this.blendDst=Mo,this.blendEquation=Wi,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new et(0,0,0),this.blendAlpha=0,this.depthFunc=Ts,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Ql,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=is,this.stencilZFail=is,this.stencilZPass=is,this.stencilWrite=!1,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.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.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,n.lightMapIntensity=this.lightMapIntensity),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.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Es&&(n.blending=this.blending),this.side!==Wn&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==yo&&(n.blendSrc=this.blendSrc),this.blendDst!==Mo&&(n.blendDst=this.blendDst),this.blendEquation!==Wi&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==Ts&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==Ql&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==is&&(n.stencilFail=this.stencilFail),this.stencilZFail!==is&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==is&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function i(r){const a=[];for(const o in r){const l=r[o];delete l.metadata,a.push(l)}return a}if(t){const r=i(e.textures),a=i(e.images);r.length>0&&(n.textures=r),a.length>0&&(n.images=a)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,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.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(t!==null){const i=t.length;n=new Array(i);for(let r=0;r!==i;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,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.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class Pi extends Dn{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new et(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.envMapRotation=new _n,this.combine=_a,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(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.envMapRotation.copy(e.envMapRotation),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.fog=e.fog,this}}const Xt=new F,Mr=new Be;let bf=0;class Ht{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:bf++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=rl,this.updateRanges=[],this.gpuType=Qn,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(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.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let i=0,r=this.itemSize;i<r;i++)this.array[e+i]=t.array[n+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)Mr.fromBufferAttribute(this,t),Mr.applyMatrix3(e),this.setXY(t,Mr.x,Mr.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)Xt.fromBufferAttribute(this,t),Xt.applyMatrix3(e),this.setXYZ(t,Xt.x,Xt.y,Xt.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)Xt.fromBufferAttribute(this,t),Xt.applyMatrix4(e),this.setXYZ(t,Xt.x,Xt.y,Xt.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Xt.fromBufferAttribute(this,t),Xt.applyNormalMatrix(e),this.setXYZ(t,Xt.x,Xt.y,Xt.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Xt.fromBufferAttribute(this,t),Xt.transformDirection(e),this.setXYZ(t,Xt.x,Xt.y,Xt.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=Vn(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Nt(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Vn(t,this.array)),t}setX(e,t){return this.normalized&&(t=Nt(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Vn(t,this.array)),t}setY(e,t){return this.normalized&&(t=Nt(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=Vn(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Nt(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=Vn(t,this.array)),t}setW(e,t){return this.normalized&&(t=Nt(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Nt(t,this.array),n=Nt(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,i){return e*=this.itemSize,this.normalized&&(t=Nt(t,this.array),n=Nt(n,this.array),i=Nt(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this}setXYZW(e,t,n,i,r){return e*=this.itemSize,this.normalized&&(t=Nt(t,this.array),n=Nt(n,this.array),i=Nt(i,this.array),r=Nt(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=r,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==rl&&(e.usage=this.usage),e}}class su extends Ht{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class Sf extends Ht{constructor(e,t,n){super(new Int32Array(e),t,n)}}class ru extends Ht{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class mt extends Ht{constructor(e,t,n){super(new Float32Array(e),t,n)}}let Ef=0;const Nn=new st,qa=new It,fs=new F,Cn=new qn,Hs=new qn,Qt=new F;class Bt extends Ki{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Ef++}),this.uuid=Gn(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(tu(e)?ru:su)(e,1):this.index=e,this}setIndirect(e){return this.indirect=e,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const r=new _t().getNormalMatrix(e);n.applyNormalMatrix(r),n.needsUpdate=!0}const i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return Nn.makeRotationFromQuaternion(e),this.applyMatrix4(Nn),this}rotateX(e){return Nn.makeRotationX(e),this.applyMatrix4(Nn),this}rotateY(e){return Nn.makeRotationY(e),this.applyMatrix4(Nn),this}rotateZ(e){return Nn.makeRotationZ(e),this.applyMatrix4(Nn),this}translate(e,t,n){return Nn.makeTranslation(e,t,n),this.applyMatrix4(Nn),this}scale(e,t,n){return Nn.makeScale(e,t,n),this.applyMatrix4(Nn),this}lookAt(e){return qa.lookAt(e),qa.updateMatrix(),this.applyMatrix4(qa.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(fs).negate(),this.translate(fs.x,fs.y,fs.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const n=[];for(let i=0,r=e.length;i<r;i++){const a=e[i];n.push(a.x,a.y,a.z||0)}this.setAttribute("position",new mt(n,3))}else{const n=Math.min(e.length,t.count);for(let i=0;i<n;i++){const r=e[i];t.setXYZ(i,r.x,r.y,r.z||0)}e.length>t.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new qn);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new F(-1/0,-1/0,-1/0),new F(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,i=t.length;n<i;n++){const r=t[n];Cn.setFromBufferAttribute(r),this.morphTargetsRelative?(Qt.addVectors(this.boundingBox.min,Cn.min),this.boundingBox.expandByPoint(Qt),Qt.addVectors(this.boundingBox.max,Cn.max),this.boundingBox.expandByPoint(Qt)):(this.boundingBox.expandByPoint(Cn.min),this.boundingBox.expandByPoint(Cn.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(){this.boundingSphere===null&&(this.boundingSphere=new gi);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new F,1/0);return}if(e){const n=this.boundingSphere.center;if(Cn.setFromBufferAttribute(e),t)for(let r=0,a=t.length;r<a;r++){const o=t[r];Hs.setFromBufferAttribute(o),this.morphTargetsRelative?(Qt.addVectors(Cn.min,Hs.min),Cn.expandByPoint(Qt),Qt.addVectors(Cn.max,Hs.max),Cn.expandByPoint(Qt)):(Cn.expandByPoint(Hs.min),Cn.expandByPoint(Hs.max))}Cn.getCenter(n);let i=0;for(let r=0,a=e.count;r<a;r++)Qt.fromBufferAttribute(e,r),i=Math.max(i,n.distanceToSquared(Qt));if(t)for(let r=0,a=t.length;r<a;r++){const o=t[r],l=this.morphTargetsRelative;for(let c=0,h=o.count;c<h;c++)Qt.fromBufferAttribute(o,c),l&&(fs.fromBufferAttribute(e,c),Qt.add(fs)),i=Math.max(i,n.distanceToSquared(Qt))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=t.position,i=t.normal,r=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Ht(new Float32Array(4*n.count),4));const a=this.getAttribute("tangent"),o=[],l=[];for(let N=0;N<n.count;N++)o[N]=new F,l[N]=new F;const c=new F,h=new F,d=new F,u=new Be,f=new Be,m=new Be,_=new F,g=new F;function p(N,b,M){c.fromBufferAttribute(n,N),h.fromBufferAttribute(n,b),d.fromBufferAttribute(n,M),u.fromBufferAttribute(r,N),f.fromBufferAttribute(r,b),m.fromBufferAttribute(r,M),h.sub(c),d.sub(c),f.sub(u),m.sub(u);const I=1/(f.x*m.y-m.x*f.y);isFinite(I)&&(_.copy(h).multiplyScalar(m.y).addScaledVector(d,-f.y).multiplyScalar(I),g.copy(d).multiplyScalar(f.x).addScaledVector(h,-m.x).multiplyScalar(I),o[N].add(_),o[b].add(_),o[M].add(_),l[N].add(g),l[b].add(g),l[M].add(g))}let w=this.groups;w.length===0&&(w=[{start:0,count:e.count}]);for(let N=0,b=w.length;N<b;++N){const M=w[N],I=M.start,V=M.count;for(let H=I,J=I+V;H<J;H+=3)p(e.getX(H+0),e.getX(H+1),e.getX(H+2))}const E=new F,S=new F,U=new F,L=new F;function D(N){U.fromBufferAttribute(i,N),L.copy(U);const b=o[N];E.copy(b),E.sub(U.multiplyScalar(U.dot(b))).normalize(),S.crossVectors(L,b);const I=S.dot(l[N])<0?-1:1;a.setXYZW(N,E.x,E.y,E.z,I)}for(let N=0,b=w.length;N<b;++N){const M=w[N],I=M.start,V=M.count;for(let H=I,J=I+V;H<J;H+=3)D(e.getX(H+0)),D(e.getX(H+1)),D(e.getX(H+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new Ht(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let u=0,f=n.count;u<f;u++)n.setXYZ(u,0,0,0);const i=new F,r=new F,a=new F,o=new F,l=new F,c=new F,h=new F,d=new F;if(e)for(let u=0,f=e.count;u<f;u+=3){const m=e.getX(u+0),_=e.getX(u+1),g=e.getX(u+2);i.fromBufferAttribute(t,m),r.fromBufferAttribute(t,_),a.fromBufferAttribute(t,g),h.subVectors(a,r),d.subVectors(i,r),h.cross(d),o.fromBufferAttribute(n,m),l.fromBufferAttribute(n,_),c.fromBufferAttribute(n,g),o.add(h),l.add(h),c.add(h),n.setXYZ(m,o.x,o.y,o.z),n.setXYZ(_,l.x,l.y,l.z),n.setXYZ(g,c.x,c.y,c.z)}else for(let u=0,f=t.count;u<f;u+=3)i.fromBufferAttribute(t,u+0),r.fromBufferAttribute(t,u+1),a.fromBufferAttribute(t,u+2),h.subVectors(a,r),d.subVectors(i,r),h.cross(d),n.setXYZ(u+0,h.x,h.y,h.z),n.setXYZ(u+1,h.x,h.y,h.z),n.setXYZ(u+2,h.x,h.y,h.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)Qt.fromBufferAttribute(e,t),Qt.normalize(),e.setXYZ(t,Qt.x,Qt.y,Qt.z)}toNonIndexed(){function e(o,l){const c=o.array,h=o.itemSize,d=o.normalized,u=new c.constructor(l.length*h);let f=0,m=0;for(let _=0,g=l.length;_<g;_++){o.isInterleavedBufferAttribute?f=l[_]*o.data.stride+o.offset:f=l[_]*h;for(let p=0;p<h;p++)u[m++]=c[f++]}return new Ht(u,h,d)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Bt,n=this.index.array,i=this.attributes;for(const o in i){const l=i[o],c=e(l,n);t.setAttribute(o,c)}const r=this.morphAttributes;for(const o in r){const l=[],c=r[o];for(let h=0,d=c.length;h<d;h++){const u=c[h],f=e(u,n);l.push(f)}t.morphAttributes[o]=l}t.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let o=0,l=a.length;o<l;o++){const c=a[o];t.addGroup(c.start,c.count,c.materialIndex)}return t}toJSON(){const e={metadata:{version:4.7,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),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const l in n){const c=n[l];e.data.attributes[l]=c.toJSON(e.data)}const i={};let r=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],h=[];for(let d=0,u=c.length;d<u;d++){const f=c[d];h.push(f.toJSON(e.data))}h.length>0&&(i[l]=h,r=!0)}r&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;n!==null&&this.setIndex(n.clone());const i=e.attributes;for(const c in i){const h=i[c];this.setAttribute(c,h.clone(t))}const r=e.morphAttributes;for(const c in r){const h=[],d=r[c];for(let u=0,f=d.length;u<f;u++)h.push(d[u].clone(t));this.morphAttributes[c]=h}this.morphTargetsRelative=e.morphTargetsRelative;const a=e.groups;for(let c=0,h=a.length;c<h;c++){const d=a[c];this.addGroup(d.start,d.count,d.materialIndex)}const o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());const l=e.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const pc=new st,Oi=new Us,br=new gi,mc=new F,Sr=new F,Er=new F,wr=new F,ja=new F,Ar=new F,gc=new F,Tr=new F;class Ct extends It{constructor(e=new Bt,t=new Pi){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=i.length;r<a;r++){const o=i[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=r}}}}getVertexPosition(e,t){const n=this.geometry,i=n.attributes.position,r=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(i,e);const o=this.morphTargetInfluences;if(r&&o){Ar.set(0,0,0);for(let l=0,c=r.length;l<c;l++){const h=o[l],d=r[l];h!==0&&(ja.fromBufferAttribute(d,e),a?Ar.addScaledVector(ja,h):Ar.addScaledVector(ja.sub(t),h))}t.add(Ar)}return t}raycast(e,t){const n=this.geometry,i=this.material,r=this.matrixWorld;i!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),br.copy(n.boundingSphere),br.applyMatrix4(r),Oi.copy(e.ray).recast(e.near),!(br.containsPoint(Oi.origin)===!1&&(Oi.intersectSphere(br,mc)===null||Oi.origin.distanceToSquared(mc)>(e.far-e.near)**2))&&(pc.copy(r).invert(),Oi.copy(e.ray).applyMatrix4(pc),!(n.boundingBox!==null&&Oi.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,Oi)))}_computeIntersections(e,t,n){let i;const r=this.geometry,a=this.material,o=r.index,l=r.attributes.position,c=r.attributes.uv,h=r.attributes.uv1,d=r.attributes.normal,u=r.groups,f=r.drawRange;if(o!==null)if(Array.isArray(a))for(let m=0,_=u.length;m<_;m++){const g=u[m],p=a[g.materialIndex],w=Math.max(g.start,f.start),E=Math.min(o.count,Math.min(g.start+g.count,f.start+f.count));for(let S=w,U=E;S<U;S+=3){const L=o.getX(S),D=o.getX(S+1),N=o.getX(S+2);i=Cr(this,p,e,n,c,h,d,L,D,N),i&&(i.faceIndex=Math.floor(S/3),i.face.materialIndex=g.materialIndex,t.push(i))}}else{const m=Math.max(0,f.start),_=Math.min(o.count,f.start+f.count);for(let g=m,p=_;g<p;g+=3){const w=o.getX(g),E=o.getX(g+1),S=o.getX(g+2);i=Cr(this,a,e,n,c,h,d,w,E,S),i&&(i.faceIndex=Math.floor(g/3),t.push(i))}}else if(l!==void 0)if(Array.isArray(a))for(let m=0,_=u.length;m<_;m++){const g=u[m],p=a[g.materialIndex],w=Math.max(g.start,f.start),E=Math.min(l.count,Math.min(g.start+g.count,f.start+f.count));for(let S=w,U=E;S<U;S+=3){const L=S,D=S+1,N=S+2;i=Cr(this,p,e,n,c,h,d,L,D,N),i&&(i.faceIndex=Math.floor(S/3),i.face.materialIndex=g.materialIndex,t.push(i))}}else{const m=Math.max(0,f.start),_=Math.min(l.count,f.start+f.count);for(let g=m,p=_;g<p;g+=3){const w=g,E=g+1,S=g+2;i=Cr(this,a,e,n,c,h,d,w,E,S),i&&(i.faceIndex=Math.floor(g/3),t.push(i))}}}}function wf(s,e,t,n,i,r,a,o){let l;if(e.side===gn?l=n.intersectTriangle(a,r,i,!0,o):l=n.intersectTriangle(i,r,a,e.side===Wn,o),l===null)return null;Tr.copy(o),Tr.applyMatrix4(s.matrixWorld);const c=t.ray.origin.distanceTo(Tr);return c<t.near||c>t.far?null:{distance:c,point:Tr.clone(),object:s}}function Cr(s,e,t,n,i,r,a,o,l,c){s.getVertexPosition(o,Sr),s.getVertexPosition(l,Er),s.getVertexPosition(c,wr);const h=wf(s,e,t,n,Sr,Er,wr,gc);if(h){const d=new F;In.getBarycoord(gc,Sr,Er,wr,d),i&&(h.uv=In.getInterpolatedAttribute(i,o,l,c,d,new Be)),r&&(h.uv1=In.getInterpolatedAttribute(r,o,l,c,d,new Be)),a&&(h.normal=In.getInterpolatedAttribute(a,o,l,c,d,new F),h.normal.dot(n.direction)>0&&h.normal.multiplyScalar(-1));const u={a:o,b:l,c,normal:new F,materialIndex:0};In.getNormal(Sr,Er,wr,u.normal),h.face=u,h.barycoord=d}return h}class Zi extends Bt{constructor(e=1,t=1,n=1,i=1,r=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:r,depthSegments:a};const o=this;i=Math.floor(i),r=Math.floor(r),a=Math.floor(a);const l=[],c=[],h=[],d=[];let u=0,f=0;m("z","y","x",-1,-1,n,t,e,a,r,0),m("z","y","x",1,-1,n,t,-e,a,r,1),m("x","z","y",1,1,e,n,t,i,a,2),m("x","z","y",1,-1,e,n,-t,i,a,3),m("x","y","z",1,-1,e,t,n,i,r,4),m("x","y","z",-1,-1,e,t,-n,i,r,5),this.setIndex(l),this.setAttribute("position",new mt(c,3)),this.setAttribute("normal",new mt(h,3)),this.setAttribute("uv",new mt(d,2));function m(_,g,p,w,E,S,U,L,D,N,b){const M=S/D,I=U/N,V=S/2,H=U/2,J=L/2,ie=D+1,B=N+1;let oe=0,j=0;const ue=new F;for(let pe=0;pe<B;pe++){const Me=pe*I-H;for(let Ue=0;Ue<ie;Ue++){const Ne=Ue*M-V;ue[_]=Ne*w,ue[g]=Me*E,ue[p]=J,c.push(ue.x,ue.y,ue.z),ue[_]=0,ue[g]=0,ue[p]=L>0?1:-1,h.push(ue.x,ue.y,ue.z),d.push(Ue/D),d.push(1-pe/N),oe+=1}}for(let pe=0;pe<N;pe++)for(let Me=0;Me<D;Me++){const Ue=u+Me+ie*pe,Ne=u+Me+ie*(pe+1),$=u+(Me+1)+ie*(pe+1),se=u+(Me+1)+ie*pe;l.push(Ue,Ne,se),l.push(Ne,$,se),j+=6}o.addGroup(f,j,b),f+=j,u+=oe}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Zi(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function Ds(s){const e={};for(const t in s){e[t]={};for(const n in s[t]){const i=s[t][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=i.clone():Array.isArray(i)?e[t][n]=i.slice():e[t][n]=i}}return e}function mn(s){const e={};for(let t=0;t<s.length;t++){const n=Ds(s[t]);for(const i in n)e[i]=n[i]}return e}function Af(s){const e=[];for(let t=0;t<s.length;t++)e.push(s[t].clone());return e}function au(s){const e=s.getRenderTarget();return e===null?s.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:Mt.workingColorSpace}const Tl={clone:Ds,merge:mn};var Tf=`void main() {
|
|
6
6
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
7
7
|
}`,Cf=`void main() {
|
|
8
8
|
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
|
|
9
|
-
}`;class mi extends Dn{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=Tf,this.fragmentShader=Cf,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Ds(e.uniforms),this.uniformsGroups=Af(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const i in this.uniforms){const a=this.uniforms[i].value;a&&a.isTexture?t.uniforms[i]={type:"t",value:a.toJSON(e).uuid}:a&&a.isColor?t.uniforms[i]={type:"c",value:a.getHex()}:a&&a.isVector2?t.uniforms[i]={type:"v2",value:a.toArray()}:a&&a.isVector3?t.uniforms[i]={type:"v3",value:a.toArray()}:a&&a.isVector4?t.uniforms[i]={type:"v4",value:a.toArray()}:a&&a.isMatrix3?t.uniforms[i]={type:"m3",value:a.toArray()}:a&&a.isMatrix4?t.uniforms[i]={type:"m4",value:a.toArray()}:t.uniforms[i]={value:a}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const n={};for(const i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}class ou extends It{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new st,this.projectionMatrix=new st,this.projectionMatrixInverse=new st,this.coordinateSystem=fi}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const Ei=new F,_c=new Be,vc=new Be;class an extends ou{constructor(e=50,t=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(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=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=Ps*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Js*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Ps*2*Math.atan(Math.tan(Js*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){Ei.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(Ei.x,Ei.y).multiplyScalar(-e/Ei.z),Ei.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Ei.x,Ei.y).multiplyScalar(-e/Ei.z)}getViewSize(e,t){return this.getViewBounds(e,_c,vc),t.subVectors(vc,_c)}setViewOffset(e,t,n,i,r,a){this.aspect=e/t,this.view===null&&(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(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(Js*.5*this.fov)/this.zoom,n=2*t,i=this.aspect*n,r=-.5*i;const a=this.view;if(this.view!==null&&this.view.enabled){const l=a.fullWidth,c=a.fullHeight;r+=a.offsetX*i/l,t-=a.offsetY*n/c,i*=a.width/l,n*=a.height/c}const o=this.filmOffset;o!==0&&(r+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,t,t-n,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(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,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const ps=-90,ms=1;class Rf extends It{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new an(ps,ms,e,t);i.layers=this.layers,this.add(i);const r=new an(ps,ms,e,t);r.layers=this.layers,this.add(r);const a=new an(ps,ms,e,t);a.layers=this.layers,this.add(a);const o=new an(ps,ms,e,t);o.layers=this.layers,this.add(o);const l=new an(ps,ms,e,t);l.layers=this.layers,this.add(l);const c=new an(ps,ms,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,i,r,a,o,l]=t;for(const c of t)this.remove(c);if(e===fi)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===ua)n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const c of t)this.add(c),c.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[r,a,o,l,c,h]=this.children,
|
|
9
|
+
}`;class mi extends Dn{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=Tf,this.fragmentShader=Cf,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Ds(e.uniforms),this.uniformsGroups=Af(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const i in this.uniforms){const a=this.uniforms[i].value;a&&a.isTexture?t.uniforms[i]={type:"t",value:a.toJSON(e).uuid}:a&&a.isColor?t.uniforms[i]={type:"c",value:a.getHex()}:a&&a.isVector2?t.uniforms[i]={type:"v2",value:a.toArray()}:a&&a.isVector3?t.uniforms[i]={type:"v3",value:a.toArray()}:a&&a.isVector4?t.uniforms[i]={type:"v4",value:a.toArray()}:a&&a.isMatrix3?t.uniforms[i]={type:"m3",value:a.toArray()}:a&&a.isMatrix4?t.uniforms[i]={type:"m4",value:a.toArray()}:t.uniforms[i]={value:a}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const n={};for(const i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}class ou extends It{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new st,this.projectionMatrix=new st,this.projectionMatrixInverse=new st,this.coordinateSystem=fi}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const Ei=new F,_c=new Be,vc=new Be;class an extends ou{constructor(e=50,t=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(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=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=Ps*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Js*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Ps*2*Math.atan(Math.tan(Js*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){Ei.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(Ei.x,Ei.y).multiplyScalar(-e/Ei.z),Ei.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Ei.x,Ei.y).multiplyScalar(-e/Ei.z)}getViewSize(e,t){return this.getViewBounds(e,_c,vc),t.subVectors(vc,_c)}setViewOffset(e,t,n,i,r,a){this.aspect=e/t,this.view===null&&(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(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(Js*.5*this.fov)/this.zoom,n=2*t,i=this.aspect*n,r=-.5*i;const a=this.view;if(this.view!==null&&this.view.enabled){const l=a.fullWidth,c=a.fullHeight;r+=a.offsetX*i/l,t-=a.offsetY*n/c,i*=a.width/l,n*=a.height/c}const o=this.filmOffset;o!==0&&(r+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,t,t-n,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(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,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const ps=-90,ms=1;class Rf extends It{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new an(ps,ms,e,t);i.layers=this.layers,this.add(i);const r=new an(ps,ms,e,t);r.layers=this.layers,this.add(r);const a=new an(ps,ms,e,t);a.layers=this.layers,this.add(a);const o=new an(ps,ms,e,t);o.layers=this.layers,this.add(o);const l=new an(ps,ms,e,t);l.layers=this.layers,this.add(l);const c=new an(ps,ms,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,i,r,a,o,l]=t;for(const c of t)this.remove(c);if(e===fi)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===ua)n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const c of t)this.add(c),c.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[r,a,o,l,c,h]=this.children,d=e.getRenderTarget(),u=e.getActiveCubeFace(),f=e.getActiveMipmapLevel(),m=e.xr.enabled;e.xr.enabled=!1;const _=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,i),e.render(t,r),e.setRenderTarget(n,1,i),e.render(t,a),e.setRenderTarget(n,2,i),e.render(t,o),e.setRenderTarget(n,3,i),e.render(t,l),e.setRenderTarget(n,4,i),e.render(t,c),n.texture.generateMipmaps=_,e.setRenderTarget(n,5,i),e.render(t,h),e.setRenderTarget(d,u,f),e.xr.enabled=m,n.texture.needsPMREMUpdate=!0}}class lu extends on{constructor(e=[],t=Cs,n,i,r,a,o,l,c,h){super(e,t,n,i,r,a,o,l,c,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class Lf extends Ji{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1},i=[n,n,n,n,n,n];this.texture=new lu(i),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:`
|
|
10
10
|
|
|
11
11
|
varying vec3 vWorldDirection;
|
|
12
12
|
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
gl_FragColor = texture2D( tEquirect, sampleUV );
|
|
42
42
|
|
|
43
43
|
}
|
|
44
|
-
`},i=new Zi(5,5,5),r=new mi({name:"CubemapFromEquirect",uniforms:Ds(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:gn,blending:Ci});r.uniforms.tEquirect.value=t;const a=new Ct(i,r),o=t.minFilter;return t.minFilter===di&&(t.minFilter=Rn),new Rf(1,10,this).update(e,a),t.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(e,t=!0,n=!0,i=!0){const r=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(t,n,i);e.setRenderTarget(r)}}class ei extends It{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Pf={type:"move"};class Ya{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new ei,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new ei,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new F,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new F),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new ei,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new F,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new F),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let i=null,r=null,a=null;const o=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){a=!0;for(const _ of e.hand.values()){const g=t.getJointPose(_,n),p=this._getHandJoint(c,_);g!==null&&(p.matrix.fromArray(g.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.matrixWorldNeedsUpdate=!0,p.jointRadius=g.radius),p.visible=g!==null}const h=c.joints["index-finger-tip"],f=c.joints["thumb-tip"],u=h.position.distanceTo(f.position),d=.02,m=.005;c.inputState.pinching&&u>d+m?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&u<=d-m&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(r=t.getPose(e.gripSpace,n),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1));o!==null&&(i=t.getPose(e.targetRaySpace,n),i===null&&r!==null&&(i=r),i!==null&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,i.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(i.linearVelocity)):o.hasLinearVelocity=!1,i.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(i.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(Pf)))}return o!==null&&(o.visible=i!==null),l!==null&&(l.visible=r!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new ei;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}class Cl extends It{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new _n,this.environmentIntensity=1,this.environmentRotation=new _n,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class cu{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=rl,this.updateRanges=[],this.version=0,this.uuid=Gn()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,r=this.stride;i<r;i++)this.array[e+i]=t.array[n+i];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Gn()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Gn()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const pn=new F;class ti{constructor(e,t,n,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=i}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)pn.fromBufferAttribute(this,t),pn.applyMatrix4(e),this.setXYZ(t,pn.x,pn.y,pn.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)pn.fromBufferAttribute(this,t),pn.applyNormalMatrix(e),this.setXYZ(t,pn.x,pn.y,pn.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)pn.fromBufferAttribute(this,t),pn.transformDirection(e),this.setXYZ(t,pn.x,pn.y,pn.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=Vn(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Nt(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=Nt(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Nt(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Nt(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Nt(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=Vn(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Vn(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Vn(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Vn(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=Nt(t,this.array),n=Nt(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=Nt(t,this.array),n=Nt(n,this.array),i=Nt(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this}setXYZW(e,t,n,i,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=Nt(t,this.array),n=Nt(n,this.array),i=Nt(i,this.array),r=Nt(r,this.array)),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}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let r=0;r<this.itemSize;r++)t.push(this.data.array[i+r])}return new Ht(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new ti(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let r=0;r<this.itemSize;r++)t.push(this.data.array[i+r])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class ya extends Dn{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new et(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}let gs;const Gs=new F,_s=new F,vs=new F,xs=new Be,Ws=new Be,hu=new st,Rr=new F,Xs=new F,Lr=new F,xc=new Be,$a=new Be,yc=new Be;class Rl extends It{constructor(e=new ya){if(super(),this.isSprite=!0,this.type="Sprite",gs===void 0){gs=new Bt;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),n=new cu(t,5);gs.setIndex([0,1,2,0,2,3]),gs.setAttribute("position",new ti(n,3,0,!1)),gs.setAttribute("uv",new ti(n,2,3,!1))}this.geometry=gs,this.material=e,this.center=new Be(.5,.5),this.count=1}raycast(e,t){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),_s.setFromMatrixScale(this.matrixWorld),hu.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),vs.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&_s.multiplyScalar(-vs.z);const n=this.material.rotation;let i,r;n!==0&&(r=Math.cos(n),i=Math.sin(n));const a=this.center;Pr(Rr.set(-.5,-.5,0),vs,a,_s,i,r),Pr(Xs.set(.5,-.5,0),vs,a,_s,i,r),Pr(Lr.set(.5,.5,0),vs,a,_s,i,r),xc.set(0,0),$a.set(1,0),yc.set(1,1);let o=e.ray.intersectTriangle(Rr,Xs,Lr,!1,Gs);if(o===null&&(Pr(Xs.set(-.5,.5,0),vs,a,_s,i,r),$a.set(0,1),o=e.ray.intersectTriangle(Rr,Lr,Xs,!1,Gs),o===null))return;const l=e.ray.origin.distanceTo(Gs);l<e.near||l>e.far||t.push({distance:l,point:Gs.clone(),uv:In.getInterpolation(Gs,Rr,Xs,Lr,xc,$a,yc,new Be),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function Pr(s,e,t,n,i,r){xs.subVectors(s,t).addScalar(.5).multiply(n),i!==void 0?(Ws.x=r*xs.x-i*xs.y,Ws.y=i*xs.x+r*xs.y):Ws.copy(xs),s.copy(e),s.x+=Ws.x,s.y+=Ws.y,s.applyMatrix4(hu)}const Dr=new F,Mc=new F;class Df extends It{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let n=0,i=t.length;n<i;n++){const r=t[n];this.addLevel(r.object.clone(),r.distance,r.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0,n=0){t=Math.abs(t);const i=this.levels;let r;for(r=0;r<i.length&&!(t<i[r].distance);r++);return i.splice(r,0,{distance:t,hysteresis:n,object:e}),this.add(e),this}removeLevel(e){const t=this.levels;for(let n=0;n<t.length;n++)if(t[n].distance===e){const i=t.splice(n,1);return this.remove(i[0].object),!0}return!1}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let n,i;for(n=1,i=t.length;n<i;n++){let r=t[n].distance;if(t[n].object.visible&&(r-=r*t[n].hysteresis),e<r)break}return t[n-1].object}return null}raycast(e,t){if(this.levels.length>0){Dr.setFromMatrixPosition(this.matrixWorld);const i=e.ray.origin.distanceTo(Dr);this.getObjectForDistance(i).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Dr.setFromMatrixPosition(e.matrixWorld),Mc.setFromMatrixPosition(this.matrixWorld);const n=Dr.distanceTo(Mc)/e.zoom;t[0].object.visible=!0;let i,r;for(i=1,r=t.length;i<r;i++){let a=t[i].distance;if(t[i].object.visible&&(a-=a*t[i].hysteresis),n>=a)t[i-1].object.visible=!1,t[i].object.visible=!0;else break}for(this._currentLevel=i-1;i<r;i++)t[i].object.visible=!1}}toJSON(e){const t=super.toJSON(e);this.autoUpdate===!1&&(t.object.autoUpdate=!1),t.object.levels=[];const n=this.levels;for(let i=0,r=n.length;i<r;i++){const a=n[i];t.object.levels.push({object:a.object.uuid,distance:a.distance,hysteresis:a.hysteresis})}return t}}const bc=new F,Sc=new bt,Ec=new bt,Nf=new F,wc=new st,Nr=new F,Ja=new gi,Ac=new st,Ka=new Us;class Uf extends Ct{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=$l,this.bindMatrix=new st,this.bindMatrixInverse=new st,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new qn),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Nr),this.boundingBox.expandByPoint(Nr)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new gi),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Nr),this.boundingSphere.expandByPoint(Nr)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){const n=this.material,i=this.matrixWorld;n!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Ja.copy(this.boundingSphere),Ja.applyMatrix4(i),e.ray.intersectsSphere(Ja)!==!1&&(Ac.copy(i).invert(),Ka.copy(e.ray).applyMatrix4(Ac),!(this.boundingBox!==null&&Ka.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,Ka)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new bt,t=this.geometry.attributes.skinWeight;for(let n=0,i=t.count;n<i;n++){e.fromBufferAttribute(t,n);const 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(e){super.updateMatrixWorld(e),this.bindMode===$l?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===Cd?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const n=this.skeleton,i=this.geometry;Sc.fromBufferAttribute(i.attributes.skinIndex,e),Ec.fromBufferAttribute(i.attributes.skinWeight,e),bc.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let r=0;r<4;r++){const a=Ec.getComponent(r);if(a!==0){const o=Sc.getComponent(r);wc.multiplyMatrices(n.bones[o].matrixWorld,n.boneInverses[o]),t.addScaledVector(Nf.copy(bc).applyMatrix4(wc),a)}}return t.applyMatrix4(this.bindMatrixInverse)}}class uu extends It{constructor(){super(),this.isBone=!0,this.type="Bone"}}class du extends on{constructor(e=null,t=1,n=1,i,r,a,o,l,c=Ln,h=Ln,f,u){super(null,a,o,l,c,h,i,r,f,u),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Tc=new st,If=new st;class Ll{constructor(e=[],t=[]){this.uuid=Gn(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let n=0,i=this.bones.length;n<i;n++)this.boneInverses.push(new st)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const n=new st;this.bones[e]&&n.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(n)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&n.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&(n.parent&&n.parent.isBone?(n.matrix.copy(n.parent.matrixWorld).invert(),n.matrix.multiply(n.matrixWorld)):n.matrix.copy(n.matrixWorld),n.matrix.decompose(n.position,n.quaternion,n.scale))}}update(){const e=this.bones,t=this.boneInverses,n=this.boneMatrices,i=this.boneTexture;for(let r=0,a=e.length;r<a;r++){const o=e[r]?e[r].matrixWorld:If;Tc.multiplyMatrices(o,t[r]),Tc.toArray(n,r*16)}i!==null&&(i.needsUpdate=!0)}clone(){return new Ll(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const n=new du(t,e,e,Fn,Qn);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){const i=this.bones[t];if(i.name===e)return i}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,i=e.bones.length;n<i;n++){const r=e.bones[n];let a=t[r];a===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",r),a=new uu),this.bones.push(a),this.boneInverses.push(new st().fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.7,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,n=this.boneInverses;for(let i=0,r=t.length;i<r;i++){const a=t[i];e.bones.push(a.uuid);const o=n[i];e.boneInverses.push(o.toArray())}return e}}const Za=new F,Ff=new F,Of=new _t;class Ai{constructor(e=new F(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const i=Za.subVectors(n,t).cross(Ff.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const n=e.delta(Za),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const r=-(e.start.dot(this.normal)+this.constant)/i;return r<0||r>1?null:t.copy(e.start).addScaledVector(n,r)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||Of.getNormalMatrix(e),i=this.coplanarPoint(Za).applyMatrix4(e),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const zi=new gi,Ur=new F;class Pl{constructor(e=new Ai,t=new Ai,n=new Ai,i=new Ai,r=new Ai,a=new Ai){this.planes=[e,t,n,i,r,a]}set(e,t,n,i,r,a){const 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}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=fi){const n=this.planes,i=e.elements,r=i[0],a=i[1],o=i[2],l=i[3],c=i[4],h=i[5],f=i[6],u=i[7],d=i[8],m=i[9],_=i[10],g=i[11],p=i[12],w=i[13],E=i[14],S=i[15];if(n[0].setComponents(l-r,u-c,g-d,S-p).normalize(),n[1].setComponents(l+r,u+c,g+d,S+p).normalize(),n[2].setComponents(l+a,u+h,g+m,S+w).normalize(),n[3].setComponents(l-a,u-h,g-m,S-w).normalize(),n[4].setComponents(l-o,u-f,g-_,S-E).normalize(),t===fi)n[5].setComponents(l+o,u+f,g+_,S+E).normalize();else if(t===ua)n[5].setComponents(o,f,_,E).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),zi.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),zi.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(zi)}intersectsSprite(e){return zi.center.set(0,0,0),zi.radius=.7071067811865476,zi.applyMatrix4(e.matrixWorld),this.intersectsSphere(zi)}intersectsSphere(e){const t=this.planes,n=e.center,i=-e.radius;for(let r=0;r<6;r++)if(t[r].distanceToPoint(n)<i)return!1;return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const i=t[n];if(Ur.x=i.normal.x>0?e.max.x:e.min.x,Ur.y=i.normal.y>0?e.max.y:e.min.y,Ur.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Ur)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class Li extends Dn{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new et(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const da=new F,fa=new F,Cc=new st,qs=new Us,Ir=new gi,Qa=new F,Rc=new F;class Dl extends It{constructor(e=new Bt,t=new Li){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[0];for(let i=1,r=t.count;i<r;i++)da.fromBufferAttribute(t,i-1),fa.fromBufferAttribute(t,i),n[i]=n[i-1],n[i]+=da.distanceTo(fa);e.setAttribute("lineDistance",new mt(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,r=e.params.Line.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Ir.copy(n.boundingSphere),Ir.applyMatrix4(i),Ir.radius+=r,e.ray.intersectsSphere(Ir)===!1)return;Cc.copy(i).invert(),qs.copy(e.ray).applyMatrix4(Cc);const o=r/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,c=this.isLineSegments?2:1,h=n.index,u=n.attributes.position;if(h!==null){const d=Math.max(0,a.start),m=Math.min(h.count,a.start+a.count);for(let _=d,g=m-1;_<g;_+=c){const p=h.getX(_),w=h.getX(_+1),E=Fr(this,e,qs,l,p,w,_);E&&t.push(E)}if(this.isLineLoop){const _=h.getX(m-1),g=h.getX(d),p=Fr(this,e,qs,l,_,g,m-1);p&&t.push(p)}}else{const d=Math.max(0,a.start),m=Math.min(u.count,a.start+a.count);for(let _=d,g=m-1;_<g;_+=c){const p=Fr(this,e,qs,l,_,_+1,_);p&&t.push(p)}if(this.isLineLoop){const _=Fr(this,e,qs,l,m-1,d,m-1);_&&t.push(_)}}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=i.length;r<a;r++){const o=i[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=r}}}}}function Fr(s,e,t,n,i,r,a){const o=s.geometry.attributes.position;if(da.fromBufferAttribute(o,i),fa.fromBufferAttribute(o,r),t.distanceSqToSegment(da,fa,Qa,Rc)>n)return;Qa.applyMatrix4(s.matrixWorld);const c=e.ray.origin.distanceTo(Qa);if(!(c<e.near||c>e.far))return{distance:c,point:Rc.clone().applyMatrix4(s.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:s}}const Lc=new F,Pc=new F;class pa extends Dl{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[];for(let i=0,r=t.count;i<r;i+=2)Lc.fromBufferAttribute(t,i),Pc.fromBufferAttribute(t,i+1),n[i]=i===0?0:n[i-1],n[i+1]=n[i]+Lc.distanceTo(Pc);e.setAttribute("lineDistance",new mt(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class ji extends Dn{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new et(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const Dc=new st,al=new Us,Or=new gi,zr=new F;class Zs extends It{constructor(e=new Bt,t=new ji){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,r=e.params.Points.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Or.copy(n.boundingSphere),Or.applyMatrix4(i),Or.radius+=r,e.ray.intersectsSphere(Or)===!1)return;Dc.copy(i).invert(),al.copy(e.ray).applyMatrix4(Dc);const o=r/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,c=n.index,f=n.attributes.position;if(c!==null){const u=Math.max(0,a.start),d=Math.min(c.count,a.start+a.count);for(let m=u,_=d;m<_;m++){const g=c.getX(m);zr.fromBufferAttribute(f,g),Nc(zr,g,l,i,e,t,this)}}else{const u=Math.max(0,a.start),d=Math.min(f.count,a.start+a.count);for(let m=u,_=d;m<_;m++)zr.fromBufferAttribute(f,m),Nc(zr,m,l,i,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=i.length;r<a;r++){const o=i[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=r}}}}}function Nc(s,e,t,n,i,r,a){const o=al.distanceSqToPoint(s);if(o<t){const l=new F;al.closestPointToPoint(s,l),l.applyMatrix4(n);const c=i.ray.origin.distanceTo(l);if(c<i.near||c>i.far)return;r.push({distance:c,distanceToRay:Math.sqrt(o),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:a})}}class zf extends on{constructor(e,t,n,i,r,a,o,l,c){super(e,t,n,i,r,a,o,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class fu extends on{constructor(e,t,n=$i,i,r,a,o=Ln,l=Ln,c,h=ir,f=1){if(h!==ir&&h!==sr)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const u={width:e,height:t,depth:f};super(u,i,r,a,o,l,h,n,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new wl(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class Nl extends Bt{constructor(e=1,t=1,n=1,i=32,r=1,a=!1,o=0,l=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:r,openEnded:a,thetaStart:o,thetaLength:l};const c=this;i=Math.floor(i),r=Math.floor(r);const h=[],f=[],u=[],d=[];let m=0;const _=[],g=n/2;let p=0;w(),a===!1&&(e>0&&E(!0),t>0&&E(!1)),this.setIndex(h),this.setAttribute("position",new mt(f,3)),this.setAttribute("normal",new mt(u,3)),this.setAttribute("uv",new mt(d,2));function w(){const S=new F,U=new F;let L=0;const D=(t-e)/n;for(let N=0;N<=r;N++){const b=[],M=N/r,I=M*(t-e)+e;for(let V=0;V<=i;V++){const H=V/i,J=H*l+o,ie=Math.sin(J),B=Math.cos(J);U.x=I*ie,U.y=-M*n+g,U.z=I*B,f.push(U.x,U.y,U.z),S.set(ie,D,B).normalize(),u.push(S.x,S.y,S.z),d.push(H,1-M),b.push(m++)}_.push(b)}for(let N=0;N<i;N++)for(let b=0;b<r;b++){const M=_[b][N],I=_[b+1][N],V=_[b+1][N+1],H=_[b][N+1];(e>0||b!==0)&&(h.push(M,I,H),L+=3),(t>0||b!==r-1)&&(h.push(I,V,H),L+=3)}c.addGroup(p,L,0),p+=L}function E(S){const U=m,L=new Be,D=new F;let N=0;const b=S===!0?e:t,M=S===!0?1:-1;for(let V=1;V<=i;V++)f.push(0,g*M,0),u.push(0,M,0),d.push(.5,.5),m++;const I=m;for(let V=0;V<=i;V++){const J=V/i*l+o,ie=Math.cos(J),B=Math.sin(J);D.x=b*B,D.y=g*M,D.z=b*ie,f.push(D.x,D.y,D.z),u.push(0,M,0),L.x=ie*.5+.5,L.y=B*.5*M+.5,d.push(L.x,L.y),m++}for(let V=0;V<i;V++){const H=U+V,J=I+V;S===!0?h.push(J,J+1,H):h.push(J+1,J,H),N+=3}c.addGroup(p,N,S===!0?1:2),p+=N}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Nl(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class _i{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){console.warn("THREE.Curve: .getPoint() not implemented.")}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,i=this.getPoint(0),r=0;t.push(0);for(let a=1;a<=e;a++)n=this.getPoint(a/e),r+=n.distanceTo(i),t.push(r),i=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t=null){const n=this.getLengths();let i=0;const r=n.length;let a;t?a=t:a=e*n[r-1];let o=0,l=r-1,c;for(;o<=l;)if(i=Math.floor(o+(l-o)/2),c=n[i]-a,c<0)o=i+1;else if(c>0)l=i-1;else{l=i;break}if(i=l,n[i]===a)return i/(r-1);const h=n[i],u=n[i+1]-h,d=(a-h)/u;return(i+d)/(r-1)}getTangent(e,t){let i=e-1e-4,r=e+1e-4;i<0&&(i=0),r>1&&(r=1);const a=this.getPoint(i),o=this.getPoint(r),l=t||(a.isVector2?new Be:new F);return l.copy(o).sub(a).normalize(),l}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t=!1){const n=new F,i=[],r=[],a=[],o=new F,l=new st;for(let d=0;d<=e;d++){const m=d/e;i[d]=this.getTangentAt(m,new F)}r[0]=new F,a[0]=new F;let c=Number.MAX_VALUE;const h=Math.abs(i[0].x),f=Math.abs(i[0].y),u=Math.abs(i[0].z);h<=c&&(c=h,n.set(1,0,0)),f<=c&&(c=f,n.set(0,1,0)),u<=c&&n.set(0,0,1),o.crossVectors(i[0],n).normalize(),r[0].crossVectors(i[0],o),a[0].crossVectors(i[0],r[0]);for(let d=1;d<=e;d++){if(r[d]=r[d-1].clone(),a[d]=a[d-1].clone(),o.crossVectors(i[d-1],i[d]),o.length()>Number.EPSILON){o.normalize();const m=Math.acos(vt(i[d-1].dot(i[d]),-1,1));r[d].applyMatrix4(l.makeRotationAxis(o,m))}a[d].crossVectors(i[d],r[d])}if(t===!0){let d=Math.acos(vt(r[0].dot(r[e]),-1,1));d/=e,i[0].dot(o.crossVectors(r[0],r[e]))>0&&(d=-d);for(let m=1;m<=e;m++)r[m].applyMatrix4(l.makeRotationAxis(i[m],d*m)),a[m].crossVectors(i[m],r[m])}return{tangents:i,normals:r,binormals:a}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class pu extends _i{constructor(e=0,t=0,n=1,i=1,r=0,a=Math.PI*2,o=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=r,this.aEndAngle=a,this.aClockwise=o,this.aRotation=l}getPoint(e,t=new Be){const n=t,i=Math.PI*2;let r=this.aEndAngle-this.aStartAngle;const a=Math.abs(r)<Number.EPSILON;for(;r<0;)r+=i;for(;r>i;)r-=i;r<Number.EPSILON&&(a?r=0:r=i),this.aClockwise===!0&&!a&&(r===i?r=-i:r=r-i);const o=this.aStartAngle+e*r;let l=this.aX+this.xRadius*Math.cos(o),c=this.aY+this.yRadius*Math.sin(o);if(this.aRotation!==0){const h=Math.cos(this.aRotation),f=Math.sin(this.aRotation),u=l-this.aX,d=c-this.aY;l=u*h-d*f+this.aX,c=u*f+d*h+this.aY}return n.set(l,c)}copy(e){return super.copy(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}toJSON(){const e=super.toJSON();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}fromJSON(e){return super.fromJSON(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}}class Bf extends pu{constructor(e,t,n,i,r,a){super(e,t,n,n,i,r,a),this.isArcCurve=!0,this.type="ArcCurve"}}function Ul(){let s=0,e=0,t=0,n=0;function i(r,a,o,l){s=r,e=o,t=-3*r+3*a-2*o-l,n=2*r-2*a+o+l}return{initCatmullRom:function(r,a,o,l,c){i(a,o,c*(o-r),c*(l-a))},initNonuniformCatmullRom:function(r,a,o,l,c,h,f){let u=(a-r)/c-(o-r)/(c+h)+(o-a)/h,d=(o-a)/h-(l-a)/(h+f)+(l-o)/f;u*=h,d*=h,i(a,o,u,d)},calc:function(r){const a=r*r,o=a*r;return s+e*r+t*a+n*o}}}const Br=new F,eo=new Ul,to=new Ul,no=new Ul;class mu extends _i{constructor(e=[],t=!1,n="centripetal",i=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=i}getPoint(e,t=new F){const n=t,i=this.points,r=i.length,a=(r-(this.closed?0:1))*e;let o=Math.floor(a),l=a-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/r)+1)*r:l===0&&o===r-1&&(o=r-2,l=1);let c,h;this.closed||o>0?c=i[(o-1)%r]:(Br.subVectors(i[0],i[1]).add(i[0]),c=Br);const f=i[o%r],u=i[(o+1)%r];if(this.closed||o+2<r?h=i[(o+2)%r]:(Br.subVectors(i[r-1],i[r-2]).add(i[r-1]),h=Br),this.curveType==="centripetal"||this.curveType==="chordal"){const d=this.curveType==="chordal"?.5:.25;let m=Math.pow(c.distanceToSquared(f),d),_=Math.pow(f.distanceToSquared(u),d),g=Math.pow(u.distanceToSquared(h),d);_<1e-4&&(_=1),m<1e-4&&(m=_),g<1e-4&&(g=_),eo.initNonuniformCatmullRom(c.x,f.x,u.x,h.x,m,_,g),to.initNonuniformCatmullRom(c.y,f.y,u.y,h.y,m,_,g),no.initNonuniformCatmullRom(c.z,f.z,u.z,h.z,m,_,g)}else this.curveType==="catmullrom"&&(eo.initCatmullRom(c.x,f.x,u.x,h.x,this.tension),to.initCatmullRom(c.y,f.y,u.y,h.y,this.tension),no.initCatmullRom(c.z,f.z,u.z,h.z,this.tension));return n.set(eo.calc(l),to.calc(l),no.calc(l)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(i.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const i=this.points[t];e.points.push(i.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(new F().fromArray(i))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function Uc(s,e,t,n,i){const r=(n-e)*.5,a=(i-t)*.5,o=s*s,l=s*o;return(2*t-2*n+r+a)*l+(-3*t+3*n-2*r-a)*o+r*s+t}function kf(s,e){const t=1-s;return t*t*e}function Vf(s,e){return 2*(1-s)*s*e}function Hf(s,e){return s*s*e}function Qs(s,e,t,n){return kf(s,e)+Vf(s,t)+Hf(s,n)}function Gf(s,e){const t=1-s;return t*t*t*e}function Wf(s,e){const t=1-s;return 3*t*t*s*e}function Xf(s,e){return 3*(1-s)*s*s*e}function qf(s,e){return s*s*s*e}function er(s,e,t,n,i){return Gf(s,e)+Wf(s,t)+Xf(s,n)+qf(s,i)}class jf extends _i{constructor(e=new Be,t=new Be,n=new Be,i=new Be){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=i}getPoint(e,t=new Be){const n=t,i=this.v0,r=this.v1,a=this.v2,o=this.v3;return n.set(er(e,i.x,r.x,a.x,o.x),er(e,i.y,r.y,a.y,o.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class Yf extends _i{constructor(e=new F,t=new F,n=new F,i=new F){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=i}getPoint(e,t=new F){const n=t,i=this.v0,r=this.v1,a=this.v2,o=this.v3;return n.set(er(e,i.x,r.x,a.x,o.x),er(e,i.y,r.y,a.y,o.y),er(e,i.z,r.z,a.z,o.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class $f extends _i{constructor(e=new Be,t=new Be){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new Be){const n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new Be){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class Jf extends _i{constructor(e=new F,t=new F){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new F){const n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new F){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class Kf extends _i{constructor(e=new Be,t=new Be,n=new Be){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new Be){const n=t,i=this.v0,r=this.v1,a=this.v2;return n.set(Qs(e,i.x,r.x,a.x),Qs(e,i.y,r.y,a.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class gu extends _i{constructor(e=new F,t=new F,n=new F){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new F){const n=t,i=this.v0,r=this.v1,a=this.v2;return n.set(Qs(e,i.x,r.x,a.x),Qs(e,i.y,r.y,a.y),Qs(e,i.z,r.z,a.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class Zf extends _i{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new Be){const n=t,i=this.points,r=(i.length-1)*e,a=Math.floor(r),o=r-a,l=i[a===0?a:a-1],c=i[a],h=i[a>i.length-2?i.length-1:a+1],f=i[a>i.length-3?i.length-1:a+2];return n.set(Uc(o,l.x,c.x,h.x,f.x),Uc(o,l.y,c.y,h.y,f.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(i.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const i=this.points[t];e.points.push(i.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(new Be().fromArray(i))}return this}}var Qf=Object.freeze({__proto__:null,ArcCurve:Bf,CatmullRomCurve3:mu,CubicBezierCurve:jf,CubicBezierCurve3:Yf,EllipseCurve:pu,LineCurve:$f,LineCurve3:Jf,QuadraticBezierCurve:Kf,QuadraticBezierCurve3:gu,SplineCurve:Zf});class lr extends Bt{constructor(e=1,t=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i};const r=e/2,a=t/2,o=Math.floor(n),l=Math.floor(i),c=o+1,h=l+1,f=e/o,u=t/l,d=[],m=[],_=[],g=[];for(let p=0;p<h;p++){const w=p*u-a;for(let E=0;E<c;E++){const S=E*f-r;m.push(S,-w,0),_.push(0,0,1),g.push(E/o),g.push(1-p/l)}}for(let p=0;p<l;p++)for(let w=0;w<o;w++){const E=w+c*p,S=w+c*(p+1),U=w+1+c*(p+1),L=w+1+c*p;d.push(E,S,L),d.push(S,U,L)}this.setIndex(d),this.setAttribute("position",new mt(m,3)),this.setAttribute("normal",new mt(_,3)),this.setAttribute("uv",new mt(g,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new lr(e.width,e.height,e.widthSegments,e.heightSegments)}}class Ma extends Bt{constructor(e=1,t=32,n=16,i=0,r=Math.PI*2,a=0,o=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:i,phiLength:r,thetaStart:a,thetaLength:o},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));const l=Math.min(a+o,Math.PI);let c=0;const h=[],f=new F,u=new F,d=[],m=[],_=[],g=[];for(let p=0;p<=n;p++){const w=[],E=p/n;let S=0;p===0&&a===0?S=.5/t:p===n&&l===Math.PI&&(S=-.5/t);for(let U=0;U<=t;U++){const L=U/t;f.x=-e*Math.cos(i+L*r)*Math.sin(a+E*o),f.y=e*Math.cos(a+E*o),f.z=e*Math.sin(i+L*r)*Math.sin(a+E*o),m.push(f.x,f.y,f.z),u.copy(f).normalize(),_.push(u.x,u.y,u.z),g.push(L+S,1-E),w.push(c++)}h.push(w)}for(let p=0;p<n;p++)for(let w=0;w<t;w++){const E=h[p][w+1],S=h[p][w],U=h[p+1][w],L=h[p+1][w+1];(p!==0||a>0)&&d.push(E,S,L),(p!==n-1||l<Math.PI)&&d.push(S,U,L)}this.setIndex(d),this.setAttribute("position",new mt(m,3)),this.setAttribute("normal",new mt(_,3)),this.setAttribute("uv",new mt(g,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Ma(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class Il extends Bt{constructor(e=new gu(new F(-1,-1,0),new F(-1,1,0),new F(1,1,0)),t=64,n=1,i=8,r=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:i,closed:r};const a=e.computeFrenetFrames(t,r);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;const o=new F,l=new F,c=new Be;let h=new F;const f=[],u=[],d=[],m=[];_(),this.setIndex(m),this.setAttribute("position",new mt(f,3)),this.setAttribute("normal",new mt(u,3)),this.setAttribute("uv",new mt(d,2));function _(){for(let E=0;E<t;E++)g(E);g(r===!1?t:0),w(),p()}function g(E){h=e.getPointAt(E/t,h);const S=a.normals[E],U=a.binormals[E];for(let L=0;L<=i;L++){const D=L/i*Math.PI*2,N=Math.sin(D),b=-Math.cos(D);l.x=b*S.x+N*U.x,l.y=b*S.y+N*U.y,l.z=b*S.z+N*U.z,l.normalize(),u.push(l.x,l.y,l.z),o.x=h.x+n*l.x,o.y=h.y+n*l.y,o.z=h.z+n*l.z,f.push(o.x,o.y,o.z)}}function p(){for(let E=1;E<=t;E++)for(let S=1;S<=i;S++){const U=(i+1)*(E-1)+(S-1),L=(i+1)*E+(S-1),D=(i+1)*E+S,N=(i+1)*(E-1)+S;m.push(U,L,N),m.push(L,D,N)}}function w(){for(let E=0;E<=t;E++)for(let S=0;S<=i;S++)c.x=E/t,c.y=S/i,d.push(c.x,c.y)}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new Il(new Qf[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class ep extends Bt{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){const t=[],n=new Set,i=new F,r=new F;if(e.index!==null){const a=e.attributes.position,o=e.index;let l=e.groups;l.length===0&&(l=[{start:0,count:o.count,materialIndex:0}]);for(let c=0,h=l.length;c<h;++c){const f=l[c],u=f.start,d=f.count;for(let m=u,_=u+d;m<_;m+=3)for(let g=0;g<3;g++){const p=o.getX(m+g),w=o.getX(m+(g+1)%3);i.fromBufferAttribute(a,p),r.fromBufferAttribute(a,w),Ic(i,r,n)===!0&&(t.push(i.x,i.y,i.z),t.push(r.x,r.y,r.z))}}}else{const a=e.attributes.position;for(let o=0,l=a.count/3;o<l;o++)for(let c=0;c<3;c++){const h=3*o+c,f=3*o+(c+1)%3;i.fromBufferAttribute(a,h),r.fromBufferAttribute(a,f),Ic(i,r,n)===!0&&(t.push(i.x,i.y,i.z),t.push(r.x,r.y,r.z))}}this.setAttribute("position",new mt(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function Ic(s,e,t){const n=`${s.x},${s.y},${s.z}-${e.x},${e.y},${e.z}`,i=`${e.x},${e.y},${e.z}-${s.x},${s.y},${s.z}`;return t.has(n)===!0||t.has(i)===!0?!1:(t.add(n),t.add(i),!0)}class tp extends Dn{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new et(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}}class np extends Dn{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new et(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new et(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=xa,this.normalScale=new Be(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new _n,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(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.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Sn extends Dn{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new et(16777215),this.specular=new et(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new et(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=xa,this.normalScale=new Be(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new _n,this.combine=_a,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(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.envMapRotation.copy(e.envMapRotation),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.flatShading=e.flatShading,this.fog=e.fog,this}}class ip extends Dn{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new et(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new et(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=xa,this.normalScale=new Be(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new _n,this.combine=_a,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(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.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.envMapRotation.copy(e.envMapRotation),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.flatShading=e.flatShading,this.fog=e.fog,this}}class sp extends Dn{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Pd,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,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}}class rp extends Dn{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}function kr(s,e){return!s||s.constructor===e?s:typeof e.BYTES_PER_ELEMENT=="number"?new e(s):Array.prototype.slice.call(s)}function ap(s){return ArrayBuffer.isView(s)&&!(s instanceof DataView)}function op(s){function e(i,r){return s[i]-s[r]}const t=s.length,n=new Array(t);for(let i=0;i!==t;++i)n[i]=i;return n.sort(e),n}function Fc(s,e,t){const n=s.length,i=new s.constructor(n);for(let r=0,a=0;a!==n;++r){const o=t[r]*e;for(let l=0;l!==e;++l)i[a++]=s[o+l]}return i}function _u(s,e,t,n){let i=1,r=s[0];for(;r!==void 0&&r[n]===void 0;)r=s[i++];if(r===void 0)return;let a=r[n];if(a!==void 0)if(Array.isArray(a))do a=r[n],a!==void 0&&(e.push(r.time),t.push(...a)),r=s[i++];while(r!==void 0);else if(a.toArray!==void 0)do a=r[n],a!==void 0&&(e.push(r.time),a.toArray(t,t.length)),r=s[i++];while(r!==void 0);else do a=r[n],a!==void 0&&(e.push(r.time),t.push(a)),r=s[i++];while(r!==void 0)}class ba{constructor(e,t,n,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,i=t[n],r=t[n-1];n:{e:{let a;t:{i:if(!(e<i)){for(let o=n+2;;){if(i===void 0){if(e<r)break i;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===o)break;if(r=i,i=t[++n],e<i)break e}a=t.length;break t}if(!(e>=r)){const o=t[1];e<o&&(n=2,r=o);for(let l=n-2;;){if(r===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===l)break;if(i=r,r=t[--n-1],e>=r)break e}a=n,n=0;break t}break n}for(;n<a;){const o=n+a>>>1;e<t[o]?a=o:n=o+1}if(i=t[n],r=t[n-1],r===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,r,i)}return this.interpolate_(n,r,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=e*i;for(let a=0;a!==i;++a)t[a]=n[r+a];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class lp extends ba{constructor(e,t,n,i){super(e,t,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Jl,endingEnd:Jl}}intervalChanged_(e,t,n){const i=this.parameterPositions;let r=e-2,a=e+1,o=i[r],l=i[a];if(o===void 0)switch(this.getSettings_().endingStart){case Kl:r=e,o=2*t-n;break;case Zl:r=i.length-2,o=t+i[r]-i[r+1];break;default:r=e,o=n}if(l===void 0)switch(this.getSettings_().endingEnd){case Kl:a=e,l=2*n-t;break;case Zl:a=1,l=n+i[1]-i[0];break;default:a=e-1,l=t}const c=(n-t)*.5,h=this.valueSize;this._weightPrev=c/(t-o),this._weightNext=c/(l-n),this._offsetPrev=r*h,this._offsetNext=a*h}interpolate_(e,t,n,i){const r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=e*o,c=l-o,h=this._offsetPrev,f=this._offsetNext,u=this._weightPrev,d=this._weightNext,m=(n-t)/(i-t),_=m*m,g=_*m,p=-u*g+2*u*_-u*m,w=(1+u)*g+(-1.5-2*u)*_+(-.5+u)*m+1,E=(-1-d)*g+(1.5+d)*_+.5*m,S=d*g-d*_;for(let U=0;U!==o;++U)r[U]=p*a[h+U]+w*a[c+U]+E*a[l+U]+S*a[f+U];return r}}class cp extends ba{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=e*o,c=l-o,h=(n-t)/(i-t),f=1-h;for(let u=0;u!==o;++u)r[u]=a[c+u]*f+a[l+u]*h;return r}}class hp extends ba{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class jn{constructor(e,t,n,i){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=kr(t,this.TimeBufferType),this.values=kr(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:kr(e.times,Array),values:kr(e.values,Array)};const i=e.getInterpolation();i!==e.DefaultInterpolation&&(n.interpolation=i)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new hp(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new cp(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new lp(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case ca:t=this.InterpolantFactoryMethodDiscrete;break;case sl:t=this.InterpolantFactoryMethodLinear;break;case Ta:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(n);return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return ca;case this.InterpolantFactoryMethodLinear:return sl;case this.InterpolantFactoryMethodSmooth:return Ta}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]*=e}return this}trim(e,t){const n=this.times,i=n.length;let r=0,a=i-1;for(;r!==i&&n[r]<e;)++r;for(;a!==-1&&n[a]>t;)--a;if(++a,r!==0||a!==i){r>=a&&(a=Math.max(a,1),r=a-1);const o=this.getValueSize();this.times=n.slice(r,a),this.values=this.values.slice(r*o,a*o)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,i=this.values,r=n.length;r===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let o=0;o!==r;o++){const l=n[o];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,l),e=!1;break}if(a!==null&&a>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,l,a),e=!1;break}a=l}if(i!==void 0&&ap(i))for(let o=0,l=i.length;o!==l;++o){const c=i[o];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===Ta,r=e.length-1;let a=1;for(let o=1;o<r;++o){let l=!1;const c=e[o],h=e[o+1];if(c!==h&&(o!==1||c!==e[0]))if(i)l=!0;else{const f=o*n,u=f-n,d=f+n;for(let m=0;m!==n;++m){const _=t[f+m];if(_!==t[u+m]||_!==t[d+m]){l=!0;break}}}if(l){if(o!==a){e[a]=e[o];const f=o*n,u=a*n;for(let d=0;d!==n;++d)t[u+d]=t[f+d]}++a}}if(r>0){e[a]=e[r];for(let o=r*n,l=a*n,c=0;c!==n;++c)t[l+c]=t[o+c];++a}return a!==e.length?(this.times=e.slice(0,a),this.values=t.slice(0,a*n)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}jn.prototype.ValueTypeName="";jn.prototype.TimeBufferType=Float32Array;jn.prototype.ValueBufferType=Float32Array;jn.prototype.DefaultInterpolation=sl;class Is extends jn{constructor(e,t,n){super(e,t,n)}}Is.prototype.ValueTypeName="bool";Is.prototype.ValueBufferType=Array;Is.prototype.DefaultInterpolation=ca;Is.prototype.InterpolantFactoryMethodLinear=void 0;Is.prototype.InterpolantFactoryMethodSmooth=void 0;class vu extends jn{constructor(e,t,n,i){super(e,t,n,i)}}vu.prototype.ValueTypeName="color";class ma extends jn{constructor(e,t,n,i){super(e,t,n,i)}}ma.prototype.ValueTypeName="number";class up extends ba{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=(n-t)/(i-t);let c=e*o;for(let h=c+o;c!==h;c+=4)Pn.slerpFlat(r,0,a,c-o,a,c,l);return r}}class cr extends jn{constructor(e,t,n,i){super(e,t,n,i)}InterpolantFactoryMethodLinear(e){return new up(this.times,this.values,this.getValueSize(),e)}}cr.prototype.ValueTypeName="quaternion";cr.prototype.InterpolantFactoryMethodSmooth=void 0;class Fs extends jn{constructor(e,t,n){super(e,t,n)}}Fs.prototype.ValueTypeName="string";Fs.prototype.ValueBufferType=Array;Fs.prototype.DefaultInterpolation=ca;Fs.prototype.InterpolantFactoryMethodLinear=void 0;Fs.prototype.InterpolantFactoryMethodSmooth=void 0;class Ns extends jn{constructor(e,t,n,i){super(e,t,n,i)}}Ns.prototype.ValueTypeName="vector";class Oc{constructor(e="",t=-1,n=[],i=Ld){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=Gn(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,i=1/(e.fps||1);for(let a=0,o=n.length;a!==o;++a)t.push(fp(n[a]).scale(i));const r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r}static toJSON(e){const t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let r=0,a=n.length;r!==a;++r)t.push(jn.toJSON(n[r]));return i}static CreateFromMorphTargetSequence(e,t,n,i){const r=t.length,a=[];for(let o=0;o<r;o++){let l=[],c=[];l.push((o+r-1)%r,o,(o+1)%r),c.push(0,1,0);const h=op(l);l=Fc(l,1,h),c=Fc(c,1,h),!i&&l[0]===0&&(l.push(r),c.push(c[0])),a.push(new ma(".morphTargetInfluences["+t[o].name+"]",l,c).scale(1/n))}return new this(e,-1,a)}static findByName(e,t){let n=e;if(!Array.isArray(e)){const i=e;n=i.geometry&&i.geometry.animations||i.animations}for(let i=0;i<n.length;i++)if(n[i].name===t)return n[i];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const i={},r=/^([\w-]*?)([\d]+)$/;for(let o=0,l=e.length;o<l;o++){const c=e[o],h=c.name.match(r);if(h&&h.length>1){const f=h[1];let u=i[f];u||(i[f]=u=[]),u.push(c)}}const a=[];for(const o in i)a.push(this.CreateFromMorphTargetSequence(o,i[o],t,n));return a}static parseAnimation(e,t){if(console.warn("THREE.AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(f,u,d,m,_){if(d.length!==0){const g=[],p=[];_u(d,g,p,m),g.length!==0&&_.push(new f(u,g,p))}},i=[],r=e.name||"default",a=e.fps||30,o=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let f=0;f<c.length;f++){const u=c[f].keys;if(!(!u||u.length===0))if(u[0].morphTargets){const d={};let m;for(m=0;m<u.length;m++)if(u[m].morphTargets)for(let _=0;_<u[m].morphTargets.length;_++)d[u[m].morphTargets[_]]=-1;for(const _ in d){const g=[],p=[];for(let w=0;w!==u[m].morphTargets.length;++w){const E=u[m];g.push(E.time),p.push(E.morphTarget===_?1:0)}i.push(new ma(".morphTargetInfluence["+_+"]",g,p))}l=d.length*a}else{const d=".bones["+t[f].name+"]";n(Ns,d+".position",u,"pos",i),n(cr,d+".quaternion",u,"rot",i),n(Ns,d+".scale",u,"scl",i)}}return i.length===0?null:new this(r,l,i,o)}resetDuration(){const e=this.tracks;let t=0;for(let n=0,i=e.length;n!==i;++n){const r=this.tracks[n];t=Math.max(t,r.times[r.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function dp(s){switch(s.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return ma;case"vector":case"vector2":case"vector3":case"vector4":return Ns;case"color":return vu;case"quaternion":return cr;case"bool":case"boolean":return Is;case"string":return Fs}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+s)}function fp(s){if(s.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=dp(s.type);if(s.times===void 0){const t=[],n=[];_u(s.keys,t,n,"value"),s.times=t,s.values=n}return e.parse!==void 0?e.parse(s):new e(s.name,s.times,s.values,s.interpolation)}const ga={enabled:!1,files:{},add:function(s,e){this.enabled!==!1&&(this.files[s]=e)},get:function(s){if(this.enabled!==!1)return this.files[s]},remove:function(s){delete this.files[s]},clear:function(){this.files={}}};class pp{constructor(e,t,n){const i=this;let r=!1,a=0,o=0,l;const c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(h){o++,r===!1&&i.onStart!==void 0&&i.onStart(h,a,o),r=!0},this.itemEnd=function(h){a++,i.onProgress!==void 0&&i.onProgress(h,a,o),a===o&&(r=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(h){i.onError!==void 0&&i.onError(h)},this.resolveURL=function(h){return l?l(h):h},this.setURLModifier=function(h){return l=h,this},this.addHandler=function(h,f){return c.push(h,f),this},this.removeHandler=function(h){const f=c.indexOf(h);return f!==-1&&c.splice(f,2),this},this.getHandler=function(h){for(let f=0,u=c.length;f<u;f+=2){const d=c[f],m=c[f+1];if(d.global&&(d.lastIndex=0),d.test(h))return m}return null}}}const Fl=new pp;class Xn{constructor(e){this.manager=e!==void 0?e:Fl,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise(function(i,r){n.load(e,i,t,r)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}Xn.DEFAULT_MATERIAL_NAME="__DEFAULT";const hi={};class mp extends Error{constructor(e,t){super(e),this.response=t}}class Os extends Xn{constructor(e){super(e),this.mimeType="",this.responseType=""}load(e,t,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=ga.get(e);if(r!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(r),this.manager.itemEnd(e)},0),r;if(hi[e]!==void 0){hi[e].push({onLoad:t,onProgress:n,onError:i});return}hi[e]=[],hi[e].push({onLoad:t,onProgress:n,onError:i});const a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,l=this.responseType;fetch(a).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const h=hi[e],f=c.body.getReader(),u=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),d=u?parseInt(u):0,m=d!==0;let _=0;const g=new ReadableStream({start(p){w();function w(){f.read().then(({done:E,value:S})=>{if(E)p.close();else{_+=S.byteLength;const U=new ProgressEvent("progress",{lengthComputable:m,loaded:_,total:d});for(let L=0,D=h.length;L<D;L++){const N=h[L];N.onProgress&&N.onProgress(U)}p.enqueue(S),w()}},E=>{p.error(E)})}}});return new Response(g)}else throw new mp(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(h=>new DOMParser().parseFromString(h,o));case"json":return c.json();default:if(o==="")return c.text();{const f=/charset="?([^;"\s]*)"?/i.exec(o),u=f&&f[1]?f[1].toLowerCase():void 0,d=new TextDecoder(u);return c.arrayBuffer().then(m=>d.decode(m))}}}).then(c=>{ga.add(e,c);const h=hi[e];delete hi[e];for(let f=0,u=h.length;f<u;f++){const d=h[f];d.onLoad&&d.onLoad(c)}}).catch(c=>{const h=hi[e];if(h===void 0)throw this.manager.itemError(e),c;delete hi[e];for(let f=0,u=h.length;f<u;f++){const d=h[f];d.onError&&d.onError(c)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class gp extends Xn{constructor(e){super(e)}load(e,t,n,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,a=ga.get(e);if(a!==void 0)return r.manager.itemStart(e),setTimeout(function(){t&&t(a),r.manager.itemEnd(e)},0),a;const o=rr("img");function l(){h(),ga.add(e,this),t&&t(this),r.manager.itemEnd(e)}function c(f){h(),i&&i(f),r.manager.itemError(e),r.manager.itemEnd(e)}function h(){o.removeEventListener("load",l,!1),o.removeEventListener("error",c,!1)}return o.addEventListener("load",l,!1),o.addEventListener("error",c,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(o.crossOrigin=this.crossOrigin),r.manager.itemStart(e),o.src=e,o}}class _p extends Xn{constructor(e){super(e)}load(e,t,n,i){const r=this,a=new du,o=new Os(this.manager);return o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(r.withCredentials),o.load(e,function(l){let c;try{c=r.parse(l)}catch(h){if(i!==void 0)i(h);else{console.error(h);return}}c.image!==void 0?a.image=c.image:c.data!==void 0&&(a.image.width=c.width,a.image.height=c.height,a.image.data=c.data),a.wrapS=c.wrapS!==void 0?c.wrapS:Hn,a.wrapT=c.wrapT!==void 0?c.wrapT:Hn,a.magFilter=c.magFilter!==void 0?c.magFilter:Rn,a.minFilter=c.minFilter!==void 0?c.minFilter:Rn,a.anisotropy=c.anisotropy!==void 0?c.anisotropy:1,c.colorSpace!==void 0&&(a.colorSpace=c.colorSpace),c.flipY!==void 0&&(a.flipY=c.flipY),c.format!==void 0&&(a.format=c.format),c.type!==void 0&&(a.type=c.type),c.mipmaps!==void 0&&(a.mipmaps=c.mipmaps,a.minFilter=di),c.mipmapCount===1&&(a.minFilter=Rn),c.generateMipmaps!==void 0&&(a.generateMipmaps=c.generateMipmaps),a.needsUpdate=!0,t&&t(a,c)},n,i),a}}class Ol extends Xn{constructor(e){super(e)}load(e,t,n,i){const r=new on,a=new gp(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(o){r.image=o,r.needsUpdate=!0,t!==void 0&&t(r)},n,i),r}}class hr extends It{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new et(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),this.target!==void 0&&(t.object.target=this.target.uuid),t}}class vp extends hr{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(It.DEFAULT_UP),this.updateMatrix(),this.groundColor=new et(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}const io=new st,zc=new F,Bc=new F;class zl{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Be(512,512),this.mapType=ni,this.map=null,this.mapPass=null,this.matrix=new st,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Pl,this._frameExtents=new Be(1,1),this._viewportCount=1,this._viewports=[new bt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;zc.setFromMatrixPosition(e.matrixWorld),t.position.copy(zc),Bc.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Bc),t.updateMatrixWorld(),io.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(io),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(io)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class xp extends zl{constructor(){super(new an(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){const t=this.camera,n=Ps*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height*this.aspect,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()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class yp extends hr{constructor(e,t,n=0,i=Math.PI/3,r=0,a=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(It.DEFAULT_UP),this.updateMatrix(),this.target=new It,this.distance=n,this.angle=i,this.penumbra=r,this.decay=a,this.map=null,this.shadow=new xp}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),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}}const kc=new st,js=new F,so=new F;class Mp extends zl{constructor(){super(new an(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Be(4,2),this._viewportCount=6,this._viewports=[new bt(2,1,1,1),new bt(0,1,1,1),new bt(3,1,1,1),new bt(1,1,1,1),new bt(3,0,1,1),new bt(1,0,1,1)],this._cubeDirections=[new F(1,0,0),new F(-1,0,0),new F(0,0,1),new F(0,0,-1),new F(0,1,0),new F(0,-1,0)],this._cubeUps=[new F(0,1,0),new F(0,1,0),new F(0,1,0),new F(0,1,0),new F(0,0,1),new F(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,i=this.matrix,r=e.distance||n.far;r!==n.far&&(n.far=r,n.updateProjectionMatrix()),js.setFromMatrixPosition(e.matrixWorld),n.position.copy(js),so.copy(n.position),so.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(so),n.updateMatrixWorld(),i.makeTranslation(-js.x,-js.y,-js.z),kc.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(kc)}}class xu extends hr{constructor(e,t,n=0,i=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=i,this.shadow=new Mp}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class Sa extends ou{constructor(e=-1,t=1,n=1,i=-1,r=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=r,this.far=a,this.updateProjectionMatrix()}copy(e,t){return super.copy(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=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,r,a){this.view===null&&(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(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const 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;let r=n-e,a=n+e,o=i+t,l=i-t;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,h=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=c*this.view.offsetX,a=r+c*this.view.width,o-=h*this.view.offsetY,l=o-h*this.view.height}this.projectionMatrix.makeOrthographic(r,a,o,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(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,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}class bp extends zl{constructor(){super(new Sa(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class yu extends hr{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(It.DEFAULT_UP),this.updateMatrix(),this.target=new It,this.shadow=new bp}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class Mu extends hr{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class Bl{static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class Sp extends Bt{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class Ep extends an{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class wp{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Vc(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=Vc();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function Vc(){return performance.now()}class ol extends cu{constructor(e,t,n=1){super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}const Hc=new st;class Ap{constructor(e,t,n=0,i=1/0){this.ray=new Us(e,t),this.near=n,this.far=i,this.camera=null,this.layers=new Al,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,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(),this.camera=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),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}setFromXRController(e){return Hc.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(Hc),this}intersectObject(e,t=!0,n=[]){return ll(e,this,n,t),n.sort(Gc),n}intersectObjects(e,t=!0,n=[]){for(let i=0,r=e.length;i<r;i++)ll(e[i],this,n,t);return n.sort(Gc),n}}function Gc(s,e){return s.distance-e.distance}function ll(s,e,t,n){let i=!0;if(s.layers.test(e.layers)&&s.raycast(e,t)===!1&&(i=!1),i===!0&&n===!0){const r=s.children;for(let a=0,o=r.length;a<o;a++)ll(r[a],e,t,!0)}}class bu{constructor(e=1,t=0,n=0){this.radius=e,this.phi=t,this.theta=n}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=vt(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(vt(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}const Wc=new F,Vr=new F;class Tp{constructor(e=new F,t=new F){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){Wc.subVectors(e,this.start),Vr.subVectors(this.end,this.start);const n=Vr.dot(Vr);let r=Vr.dot(Wc)/n;return t&&(r=vt(r,0,1)),r}closestPointToPoint(e,t,n){const i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}class Cp extends pa{constructor(e=10,t=10,n=4473924,i=8947848){n=new et(n),i=new et(i);const r=t/2,a=e/t,o=e/2,l=[],c=[];for(let u=0,d=0,m=-o;u<=t;u++,m+=a){l.push(-o,0,m,o,0,m),l.push(m,0,-o,m,0,o);const _=u===r?n:i;_.toArray(c,d),d+=3,_.toArray(c,d),d+=3,_.toArray(c,d),d+=3,_.toArray(c,d),d+=3}const h=new Bt;h.setAttribute("position",new mt(l,3)),h.setAttribute("color",new mt(c,3));const f=new Li({vertexColors:!0,toneMapped:!1});super(h,f),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class Rp extends Ki{constructor(e,t=null){super(),this.object=e,this.domElement=t,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(e){if(e===void 0){console.warn("THREE.Controls: connect() now requires an element.");return}this.domElement!==null&&this.disconnect(),this.domElement=e}disconnect(){}dispose(){}update(){}}function Xc(s,e,t,n){const i=Lp(n);switch(t){case $h:return s*e;case Kh:return s*e/i.components*i.byteLength;case Ml:return s*e/i.components*i.byteLength;case Zh:return s*e*2/i.components*i.byteLength;case bl:return s*e*2/i.components*i.byteLength;case Jh:return s*e*3/i.components*i.byteLength;case Fn:return s*e*4/i.components*i.byteLength;case Sl:return s*e*4/i.components*i.byteLength;case ea:case ta:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*8;case na:case ia:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*16;case No:case Io:return Math.max(s,16)*Math.max(e,8)/4;case Do:case Uo:return Math.max(s,8)*Math.max(e,8)/2;case Fo:case Oo:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*8;case zo:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*16;case Bo:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*16;case ko:return Math.floor((s+4)/5)*Math.floor((e+3)/4)*16;case Vo:return Math.floor((s+4)/5)*Math.floor((e+4)/5)*16;case Ho:return Math.floor((s+5)/6)*Math.floor((e+4)/5)*16;case Go:return Math.floor((s+5)/6)*Math.floor((e+5)/6)*16;case Wo:return Math.floor((s+7)/8)*Math.floor((e+4)/5)*16;case Xo:return Math.floor((s+7)/8)*Math.floor((e+5)/6)*16;case qo:return Math.floor((s+7)/8)*Math.floor((e+7)/8)*16;case jo:return Math.floor((s+9)/10)*Math.floor((e+4)/5)*16;case Yo:return Math.floor((s+9)/10)*Math.floor((e+5)/6)*16;case $o:return Math.floor((s+9)/10)*Math.floor((e+7)/8)*16;case Jo:return Math.floor((s+9)/10)*Math.floor((e+9)/10)*16;case Ko:return Math.floor((s+11)/12)*Math.floor((e+9)/10)*16;case Zo:return Math.floor((s+11)/12)*Math.floor((e+11)/12)*16;case sa:case Qo:case el:return Math.ceil(s/4)*Math.ceil(e/4)*16;case Qh:case tl:return Math.ceil(s/4)*Math.ceil(e/4)*8;case nl:case il:return Math.ceil(s/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function Lp(s){switch(s){case ni:case qh:return{byteLength:1,components:1};case tr:case jh:case or:return{byteLength:2,components:1};case xl:case yl:return{byteLength:2,components:4};case $i:case vl:case Qn:return{byteLength:4,components:1};case Yh:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${s}.`)}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:_l}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=_l);/**
|
|
44
|
+
`},i=new Zi(5,5,5),r=new mi({name:"CubemapFromEquirect",uniforms:Ds(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:gn,blending:Ci});r.uniforms.tEquirect.value=t;const a=new Ct(i,r),o=t.minFilter;return t.minFilter===di&&(t.minFilter=Rn),new Rf(1,10,this).update(e,a),t.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(e,t=!0,n=!0,i=!0){const r=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(t,n,i);e.setRenderTarget(r)}}class ei extends It{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Pf={type:"move"};class Ya{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new ei,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new ei,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new F,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new F),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new ei,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new F,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new F),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let i=null,r=null,a=null;const o=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){a=!0;for(const _ of e.hand.values()){const g=t.getJointPose(_,n),p=this._getHandJoint(c,_);g!==null&&(p.matrix.fromArray(g.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.matrixWorldNeedsUpdate=!0,p.jointRadius=g.radius),p.visible=g!==null}const h=c.joints["index-finger-tip"],d=c.joints["thumb-tip"],u=h.position.distanceTo(d.position),f=.02,m=.005;c.inputState.pinching&&u>f+m?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&u<=f-m&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(r=t.getPose(e.gripSpace,n),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1));o!==null&&(i=t.getPose(e.targetRaySpace,n),i===null&&r!==null&&(i=r),i!==null&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,i.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(i.linearVelocity)):o.hasLinearVelocity=!1,i.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(i.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(Pf)))}return o!==null&&(o.visible=i!==null),l!==null&&(l.visible=r!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new ei;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}class Cl extends It{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new _n,this.environmentIntensity=1,this.environmentRotation=new _n,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class cu{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=rl,this.updateRanges=[],this.version=0,this.uuid=Gn()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,r=this.stride;i<r;i++)this.array[e+i]=t.array[n+i];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Gn()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Gn()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const pn=new F;class ti{constructor(e,t,n,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=i}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)pn.fromBufferAttribute(this,t),pn.applyMatrix4(e),this.setXYZ(t,pn.x,pn.y,pn.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)pn.fromBufferAttribute(this,t),pn.applyNormalMatrix(e),this.setXYZ(t,pn.x,pn.y,pn.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)pn.fromBufferAttribute(this,t),pn.transformDirection(e),this.setXYZ(t,pn.x,pn.y,pn.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=Vn(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Nt(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=Nt(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Nt(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Nt(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Nt(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=Vn(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Vn(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Vn(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Vn(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=Nt(t,this.array),n=Nt(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=Nt(t,this.array),n=Nt(n,this.array),i=Nt(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this}setXYZW(e,t,n,i,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=Nt(t,this.array),n=Nt(n,this.array),i=Nt(i,this.array),r=Nt(r,this.array)),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}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let r=0;r<this.itemSize;r++)t.push(this.data.array[i+r])}return new Ht(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new ti(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let r=0;r<this.itemSize;r++)t.push(this.data.array[i+r])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class ya extends Dn{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new et(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}let gs;const Gs=new F,_s=new F,vs=new F,xs=new Be,Ws=new Be,hu=new st,Rr=new F,Xs=new F,Lr=new F,xc=new Be,$a=new Be,yc=new Be;class Rl extends It{constructor(e=new ya){if(super(),this.isSprite=!0,this.type="Sprite",gs===void 0){gs=new Bt;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),n=new cu(t,5);gs.setIndex([0,1,2,0,2,3]),gs.setAttribute("position",new ti(n,3,0,!1)),gs.setAttribute("uv",new ti(n,2,3,!1))}this.geometry=gs,this.material=e,this.center=new Be(.5,.5),this.count=1}raycast(e,t){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),_s.setFromMatrixScale(this.matrixWorld),hu.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),vs.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&_s.multiplyScalar(-vs.z);const n=this.material.rotation;let i,r;n!==0&&(r=Math.cos(n),i=Math.sin(n));const a=this.center;Pr(Rr.set(-.5,-.5,0),vs,a,_s,i,r),Pr(Xs.set(.5,-.5,0),vs,a,_s,i,r),Pr(Lr.set(.5,.5,0),vs,a,_s,i,r),xc.set(0,0),$a.set(1,0),yc.set(1,1);let o=e.ray.intersectTriangle(Rr,Xs,Lr,!1,Gs);if(o===null&&(Pr(Xs.set(-.5,.5,0),vs,a,_s,i,r),$a.set(0,1),o=e.ray.intersectTriangle(Rr,Lr,Xs,!1,Gs),o===null))return;const l=e.ray.origin.distanceTo(Gs);l<e.near||l>e.far||t.push({distance:l,point:Gs.clone(),uv:In.getInterpolation(Gs,Rr,Xs,Lr,xc,$a,yc,new Be),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function Pr(s,e,t,n,i,r){xs.subVectors(s,t).addScalar(.5).multiply(n),i!==void 0?(Ws.x=r*xs.x-i*xs.y,Ws.y=i*xs.x+r*xs.y):Ws.copy(xs),s.copy(e),s.x+=Ws.x,s.y+=Ws.y,s.applyMatrix4(hu)}const Dr=new F,Mc=new F;class Df extends It{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let n=0,i=t.length;n<i;n++){const r=t[n];this.addLevel(r.object.clone(),r.distance,r.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0,n=0){t=Math.abs(t);const i=this.levels;let r;for(r=0;r<i.length&&!(t<i[r].distance);r++);return i.splice(r,0,{distance:t,hysteresis:n,object:e}),this.add(e),this}removeLevel(e){const t=this.levels;for(let n=0;n<t.length;n++)if(t[n].distance===e){const i=t.splice(n,1);return this.remove(i[0].object),!0}return!1}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let n,i;for(n=1,i=t.length;n<i;n++){let r=t[n].distance;if(t[n].object.visible&&(r-=r*t[n].hysteresis),e<r)break}return t[n-1].object}return null}raycast(e,t){if(this.levels.length>0){Dr.setFromMatrixPosition(this.matrixWorld);const i=e.ray.origin.distanceTo(Dr);this.getObjectForDistance(i).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Dr.setFromMatrixPosition(e.matrixWorld),Mc.setFromMatrixPosition(this.matrixWorld);const n=Dr.distanceTo(Mc)/e.zoom;t[0].object.visible=!0;let i,r;for(i=1,r=t.length;i<r;i++){let a=t[i].distance;if(t[i].object.visible&&(a-=a*t[i].hysteresis),n>=a)t[i-1].object.visible=!1,t[i].object.visible=!0;else break}for(this._currentLevel=i-1;i<r;i++)t[i].object.visible=!1}}toJSON(e){const t=super.toJSON(e);this.autoUpdate===!1&&(t.object.autoUpdate=!1),t.object.levels=[];const n=this.levels;for(let i=0,r=n.length;i<r;i++){const a=n[i];t.object.levels.push({object:a.object.uuid,distance:a.distance,hysteresis:a.hysteresis})}return t}}const bc=new F,Sc=new bt,Ec=new bt,Nf=new F,wc=new st,Nr=new F,Ja=new gi,Ac=new st,Ka=new Us;class Uf extends Ct{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=$l,this.bindMatrix=new st,this.bindMatrixInverse=new st,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new qn),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Nr),this.boundingBox.expandByPoint(Nr)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new gi),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Nr),this.boundingSphere.expandByPoint(Nr)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){const n=this.material,i=this.matrixWorld;n!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Ja.copy(this.boundingSphere),Ja.applyMatrix4(i),e.ray.intersectsSphere(Ja)!==!1&&(Ac.copy(i).invert(),Ka.copy(e.ray).applyMatrix4(Ac),!(this.boundingBox!==null&&Ka.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,Ka)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new bt,t=this.geometry.attributes.skinWeight;for(let n=0,i=t.count;n<i;n++){e.fromBufferAttribute(t,n);const 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(e){super.updateMatrixWorld(e),this.bindMode===$l?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===Cd?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const n=this.skeleton,i=this.geometry;Sc.fromBufferAttribute(i.attributes.skinIndex,e),Ec.fromBufferAttribute(i.attributes.skinWeight,e),bc.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let r=0;r<4;r++){const a=Ec.getComponent(r);if(a!==0){const o=Sc.getComponent(r);wc.multiplyMatrices(n.bones[o].matrixWorld,n.boneInverses[o]),t.addScaledVector(Nf.copy(bc).applyMatrix4(wc),a)}}return t.applyMatrix4(this.bindMatrixInverse)}}class uu extends It{constructor(){super(),this.isBone=!0,this.type="Bone"}}class du extends on{constructor(e=null,t=1,n=1,i,r,a,o,l,c=Ln,h=Ln,d,u){super(null,a,o,l,c,h,i,r,d,u),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Tc=new st,If=new st;class Ll{constructor(e=[],t=[]){this.uuid=Gn(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let n=0,i=this.bones.length;n<i;n++)this.boneInverses.push(new st)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const n=new st;this.bones[e]&&n.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(n)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&n.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&(n.parent&&n.parent.isBone?(n.matrix.copy(n.parent.matrixWorld).invert(),n.matrix.multiply(n.matrixWorld)):n.matrix.copy(n.matrixWorld),n.matrix.decompose(n.position,n.quaternion,n.scale))}}update(){const e=this.bones,t=this.boneInverses,n=this.boneMatrices,i=this.boneTexture;for(let r=0,a=e.length;r<a;r++){const o=e[r]?e[r].matrixWorld:If;Tc.multiplyMatrices(o,t[r]),Tc.toArray(n,r*16)}i!==null&&(i.needsUpdate=!0)}clone(){return new Ll(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const n=new du(t,e,e,Fn,Qn);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){const i=this.bones[t];if(i.name===e)return i}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,i=e.bones.length;n<i;n++){const r=e.bones[n];let a=t[r];a===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",r),a=new uu),this.bones.push(a),this.boneInverses.push(new st().fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.7,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,n=this.boneInverses;for(let i=0,r=t.length;i<r;i++){const a=t[i];e.bones.push(a.uuid);const o=n[i];e.boneInverses.push(o.toArray())}return e}}const Za=new F,Ff=new F,Of=new _t;class Ai{constructor(e=new F(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const i=Za.subVectors(n,t).cross(Ff.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const n=e.delta(Za),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const r=-(e.start.dot(this.normal)+this.constant)/i;return r<0||r>1?null:t.copy(e.start).addScaledVector(n,r)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||Of.getNormalMatrix(e),i=this.coplanarPoint(Za).applyMatrix4(e),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const zi=new gi,Ur=new F;class Pl{constructor(e=new Ai,t=new Ai,n=new Ai,i=new Ai,r=new Ai,a=new Ai){this.planes=[e,t,n,i,r,a]}set(e,t,n,i,r,a){const 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}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=fi){const n=this.planes,i=e.elements,r=i[0],a=i[1],o=i[2],l=i[3],c=i[4],h=i[5],d=i[6],u=i[7],f=i[8],m=i[9],_=i[10],g=i[11],p=i[12],w=i[13],E=i[14],S=i[15];if(n[0].setComponents(l-r,u-c,g-f,S-p).normalize(),n[1].setComponents(l+r,u+c,g+f,S+p).normalize(),n[2].setComponents(l+a,u+h,g+m,S+w).normalize(),n[3].setComponents(l-a,u-h,g-m,S-w).normalize(),n[4].setComponents(l-o,u-d,g-_,S-E).normalize(),t===fi)n[5].setComponents(l+o,u+d,g+_,S+E).normalize();else if(t===ua)n[5].setComponents(o,d,_,E).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),zi.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),zi.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(zi)}intersectsSprite(e){return zi.center.set(0,0,0),zi.radius=.7071067811865476,zi.applyMatrix4(e.matrixWorld),this.intersectsSphere(zi)}intersectsSphere(e){const t=this.planes,n=e.center,i=-e.radius;for(let r=0;r<6;r++)if(t[r].distanceToPoint(n)<i)return!1;return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const i=t[n];if(Ur.x=i.normal.x>0?e.max.x:e.min.x,Ur.y=i.normal.y>0?e.max.y:e.min.y,Ur.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Ur)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class Li extends Dn{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new et(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const da=new F,fa=new F,Cc=new st,qs=new Us,Ir=new gi,Qa=new F,Rc=new F;class Dl extends It{constructor(e=new Bt,t=new Li){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[0];for(let i=1,r=t.count;i<r;i++)da.fromBufferAttribute(t,i-1),fa.fromBufferAttribute(t,i),n[i]=n[i-1],n[i]+=da.distanceTo(fa);e.setAttribute("lineDistance",new mt(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,r=e.params.Line.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Ir.copy(n.boundingSphere),Ir.applyMatrix4(i),Ir.radius+=r,e.ray.intersectsSphere(Ir)===!1)return;Cc.copy(i).invert(),qs.copy(e.ray).applyMatrix4(Cc);const o=r/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,c=this.isLineSegments?2:1,h=n.index,u=n.attributes.position;if(h!==null){const f=Math.max(0,a.start),m=Math.min(h.count,a.start+a.count);for(let _=f,g=m-1;_<g;_+=c){const p=h.getX(_),w=h.getX(_+1),E=Fr(this,e,qs,l,p,w,_);E&&t.push(E)}if(this.isLineLoop){const _=h.getX(m-1),g=h.getX(f),p=Fr(this,e,qs,l,_,g,m-1);p&&t.push(p)}}else{const f=Math.max(0,a.start),m=Math.min(u.count,a.start+a.count);for(let _=f,g=m-1;_<g;_+=c){const p=Fr(this,e,qs,l,_,_+1,_);p&&t.push(p)}if(this.isLineLoop){const _=Fr(this,e,qs,l,m-1,f,m-1);_&&t.push(_)}}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=i.length;r<a;r++){const o=i[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=r}}}}}function Fr(s,e,t,n,i,r,a){const o=s.geometry.attributes.position;if(da.fromBufferAttribute(o,i),fa.fromBufferAttribute(o,r),t.distanceSqToSegment(da,fa,Qa,Rc)>n)return;Qa.applyMatrix4(s.matrixWorld);const c=e.ray.origin.distanceTo(Qa);if(!(c<e.near||c>e.far))return{distance:c,point:Rc.clone().applyMatrix4(s.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:s}}const Lc=new F,Pc=new F;class pa extends Dl{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[];for(let i=0,r=t.count;i<r;i+=2)Lc.fromBufferAttribute(t,i),Pc.fromBufferAttribute(t,i+1),n[i]=i===0?0:n[i-1],n[i+1]=n[i]+Lc.distanceTo(Pc);e.setAttribute("lineDistance",new mt(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class ji extends Dn{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new et(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const Dc=new st,al=new Us,Or=new gi,zr=new F;class Zs extends It{constructor(e=new Bt,t=new ji){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,r=e.params.Points.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Or.copy(n.boundingSphere),Or.applyMatrix4(i),Or.radius+=r,e.ray.intersectsSphere(Or)===!1)return;Dc.copy(i).invert(),al.copy(e.ray).applyMatrix4(Dc);const o=r/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,c=n.index,d=n.attributes.position;if(c!==null){const u=Math.max(0,a.start),f=Math.min(c.count,a.start+a.count);for(let m=u,_=f;m<_;m++){const g=c.getX(m);zr.fromBufferAttribute(d,g),Nc(zr,g,l,i,e,t,this)}}else{const u=Math.max(0,a.start),f=Math.min(d.count,a.start+a.count);for(let m=u,_=f;m<_;m++)zr.fromBufferAttribute(d,m),Nc(zr,m,l,i,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=i.length;r<a;r++){const o=i[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=r}}}}}function Nc(s,e,t,n,i,r,a){const o=al.distanceSqToPoint(s);if(o<t){const l=new F;al.closestPointToPoint(s,l),l.applyMatrix4(n);const c=i.ray.origin.distanceTo(l);if(c<i.near||c>i.far)return;r.push({distance:c,distanceToRay:Math.sqrt(o),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:a})}}class zf extends on{constructor(e,t,n,i,r,a,o,l,c){super(e,t,n,i,r,a,o,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class fu extends on{constructor(e,t,n=$i,i,r,a,o=Ln,l=Ln,c,h=ir,d=1){if(h!==ir&&h!==sr)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const u={width:e,height:t,depth:d};super(u,i,r,a,o,l,h,n,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new wl(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class Nl extends Bt{constructor(e=1,t=1,n=1,i=32,r=1,a=!1,o=0,l=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:r,openEnded:a,thetaStart:o,thetaLength:l};const c=this;i=Math.floor(i),r=Math.floor(r);const h=[],d=[],u=[],f=[];let m=0;const _=[],g=n/2;let p=0;w(),a===!1&&(e>0&&E(!0),t>0&&E(!1)),this.setIndex(h),this.setAttribute("position",new mt(d,3)),this.setAttribute("normal",new mt(u,3)),this.setAttribute("uv",new mt(f,2));function w(){const S=new F,U=new F;let L=0;const D=(t-e)/n;for(let N=0;N<=r;N++){const b=[],M=N/r,I=M*(t-e)+e;for(let V=0;V<=i;V++){const H=V/i,J=H*l+o,ie=Math.sin(J),B=Math.cos(J);U.x=I*ie,U.y=-M*n+g,U.z=I*B,d.push(U.x,U.y,U.z),S.set(ie,D,B).normalize(),u.push(S.x,S.y,S.z),f.push(H,1-M),b.push(m++)}_.push(b)}for(let N=0;N<i;N++)for(let b=0;b<r;b++){const M=_[b][N],I=_[b+1][N],V=_[b+1][N+1],H=_[b][N+1];(e>0||b!==0)&&(h.push(M,I,H),L+=3),(t>0||b!==r-1)&&(h.push(I,V,H),L+=3)}c.addGroup(p,L,0),p+=L}function E(S){const U=m,L=new Be,D=new F;let N=0;const b=S===!0?e:t,M=S===!0?1:-1;for(let V=1;V<=i;V++)d.push(0,g*M,0),u.push(0,M,0),f.push(.5,.5),m++;const I=m;for(let V=0;V<=i;V++){const J=V/i*l+o,ie=Math.cos(J),B=Math.sin(J);D.x=b*B,D.y=g*M,D.z=b*ie,d.push(D.x,D.y,D.z),u.push(0,M,0),L.x=ie*.5+.5,L.y=B*.5*M+.5,f.push(L.x,L.y),m++}for(let V=0;V<i;V++){const H=U+V,J=I+V;S===!0?h.push(J,J+1,H):h.push(J+1,J,H),N+=3}c.addGroup(p,N,S===!0?1:2),p+=N}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Nl(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class _i{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){console.warn("THREE.Curve: .getPoint() not implemented.")}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,i=this.getPoint(0),r=0;t.push(0);for(let a=1;a<=e;a++)n=this.getPoint(a/e),r+=n.distanceTo(i),t.push(r),i=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t=null){const n=this.getLengths();let i=0;const r=n.length;let a;t?a=t:a=e*n[r-1];let o=0,l=r-1,c;for(;o<=l;)if(i=Math.floor(o+(l-o)/2),c=n[i]-a,c<0)o=i+1;else if(c>0)l=i-1;else{l=i;break}if(i=l,n[i]===a)return i/(r-1);const h=n[i],u=n[i+1]-h,f=(a-h)/u;return(i+f)/(r-1)}getTangent(e,t){let i=e-1e-4,r=e+1e-4;i<0&&(i=0),r>1&&(r=1);const a=this.getPoint(i),o=this.getPoint(r),l=t||(a.isVector2?new Be:new F);return l.copy(o).sub(a).normalize(),l}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t=!1){const n=new F,i=[],r=[],a=[],o=new F,l=new st;for(let f=0;f<=e;f++){const m=f/e;i[f]=this.getTangentAt(m,new F)}r[0]=new F,a[0]=new F;let c=Number.MAX_VALUE;const h=Math.abs(i[0].x),d=Math.abs(i[0].y),u=Math.abs(i[0].z);h<=c&&(c=h,n.set(1,0,0)),d<=c&&(c=d,n.set(0,1,0)),u<=c&&n.set(0,0,1),o.crossVectors(i[0],n).normalize(),r[0].crossVectors(i[0],o),a[0].crossVectors(i[0],r[0]);for(let f=1;f<=e;f++){if(r[f]=r[f-1].clone(),a[f]=a[f-1].clone(),o.crossVectors(i[f-1],i[f]),o.length()>Number.EPSILON){o.normalize();const m=Math.acos(vt(i[f-1].dot(i[f]),-1,1));r[f].applyMatrix4(l.makeRotationAxis(o,m))}a[f].crossVectors(i[f],r[f])}if(t===!0){let f=Math.acos(vt(r[0].dot(r[e]),-1,1));f/=e,i[0].dot(o.crossVectors(r[0],r[e]))>0&&(f=-f);for(let m=1;m<=e;m++)r[m].applyMatrix4(l.makeRotationAxis(i[m],f*m)),a[m].crossVectors(i[m],r[m])}return{tangents:i,normals:r,binormals:a}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class pu extends _i{constructor(e=0,t=0,n=1,i=1,r=0,a=Math.PI*2,o=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=r,this.aEndAngle=a,this.aClockwise=o,this.aRotation=l}getPoint(e,t=new Be){const n=t,i=Math.PI*2;let r=this.aEndAngle-this.aStartAngle;const a=Math.abs(r)<Number.EPSILON;for(;r<0;)r+=i;for(;r>i;)r-=i;r<Number.EPSILON&&(a?r=0:r=i),this.aClockwise===!0&&!a&&(r===i?r=-i:r=r-i);const o=this.aStartAngle+e*r;let l=this.aX+this.xRadius*Math.cos(o),c=this.aY+this.yRadius*Math.sin(o);if(this.aRotation!==0){const h=Math.cos(this.aRotation),d=Math.sin(this.aRotation),u=l-this.aX,f=c-this.aY;l=u*h-f*d+this.aX,c=u*d+f*h+this.aY}return n.set(l,c)}copy(e){return super.copy(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}toJSON(){const e=super.toJSON();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}fromJSON(e){return super.fromJSON(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}}class Bf extends pu{constructor(e,t,n,i,r,a){super(e,t,n,n,i,r,a),this.isArcCurve=!0,this.type="ArcCurve"}}function Ul(){let s=0,e=0,t=0,n=0;function i(r,a,o,l){s=r,e=o,t=-3*r+3*a-2*o-l,n=2*r-2*a+o+l}return{initCatmullRom:function(r,a,o,l,c){i(a,o,c*(o-r),c*(l-a))},initNonuniformCatmullRom:function(r,a,o,l,c,h,d){let u=(a-r)/c-(o-r)/(c+h)+(o-a)/h,f=(o-a)/h-(l-a)/(h+d)+(l-o)/d;u*=h,f*=h,i(a,o,u,f)},calc:function(r){const a=r*r,o=a*r;return s+e*r+t*a+n*o}}}const Br=new F,eo=new Ul,to=new Ul,no=new Ul;class mu extends _i{constructor(e=[],t=!1,n="centripetal",i=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=i}getPoint(e,t=new F){const n=t,i=this.points,r=i.length,a=(r-(this.closed?0:1))*e;let o=Math.floor(a),l=a-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/r)+1)*r:l===0&&o===r-1&&(o=r-2,l=1);let c,h;this.closed||o>0?c=i[(o-1)%r]:(Br.subVectors(i[0],i[1]).add(i[0]),c=Br);const d=i[o%r],u=i[(o+1)%r];if(this.closed||o+2<r?h=i[(o+2)%r]:(Br.subVectors(i[r-1],i[r-2]).add(i[r-1]),h=Br),this.curveType==="centripetal"||this.curveType==="chordal"){const f=this.curveType==="chordal"?.5:.25;let m=Math.pow(c.distanceToSquared(d),f),_=Math.pow(d.distanceToSquared(u),f),g=Math.pow(u.distanceToSquared(h),f);_<1e-4&&(_=1),m<1e-4&&(m=_),g<1e-4&&(g=_),eo.initNonuniformCatmullRom(c.x,d.x,u.x,h.x,m,_,g),to.initNonuniformCatmullRom(c.y,d.y,u.y,h.y,m,_,g),no.initNonuniformCatmullRom(c.z,d.z,u.z,h.z,m,_,g)}else this.curveType==="catmullrom"&&(eo.initCatmullRom(c.x,d.x,u.x,h.x,this.tension),to.initCatmullRom(c.y,d.y,u.y,h.y,this.tension),no.initCatmullRom(c.z,d.z,u.z,h.z,this.tension));return n.set(eo.calc(l),to.calc(l),no.calc(l)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(i.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const i=this.points[t];e.points.push(i.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(new F().fromArray(i))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function Uc(s,e,t,n,i){const r=(n-e)*.5,a=(i-t)*.5,o=s*s,l=s*o;return(2*t-2*n+r+a)*l+(-3*t+3*n-2*r-a)*o+r*s+t}function kf(s,e){const t=1-s;return t*t*e}function Vf(s,e){return 2*(1-s)*s*e}function Hf(s,e){return s*s*e}function Qs(s,e,t,n){return kf(s,e)+Vf(s,t)+Hf(s,n)}function Gf(s,e){const t=1-s;return t*t*t*e}function Wf(s,e){const t=1-s;return 3*t*t*s*e}function Xf(s,e){return 3*(1-s)*s*s*e}function qf(s,e){return s*s*s*e}function er(s,e,t,n,i){return Gf(s,e)+Wf(s,t)+Xf(s,n)+qf(s,i)}class jf extends _i{constructor(e=new Be,t=new Be,n=new Be,i=new Be){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=i}getPoint(e,t=new Be){const n=t,i=this.v0,r=this.v1,a=this.v2,o=this.v3;return n.set(er(e,i.x,r.x,a.x,o.x),er(e,i.y,r.y,a.y,o.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class Yf extends _i{constructor(e=new F,t=new F,n=new F,i=new F){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=i}getPoint(e,t=new F){const n=t,i=this.v0,r=this.v1,a=this.v2,o=this.v3;return n.set(er(e,i.x,r.x,a.x,o.x),er(e,i.y,r.y,a.y,o.y),er(e,i.z,r.z,a.z,o.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class $f extends _i{constructor(e=new Be,t=new Be){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new Be){const n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new Be){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class Jf extends _i{constructor(e=new F,t=new F){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new F){const n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new F){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class Kf extends _i{constructor(e=new Be,t=new Be,n=new Be){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new Be){const n=t,i=this.v0,r=this.v1,a=this.v2;return n.set(Qs(e,i.x,r.x,a.x),Qs(e,i.y,r.y,a.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class gu extends _i{constructor(e=new F,t=new F,n=new F){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new F){const n=t,i=this.v0,r=this.v1,a=this.v2;return n.set(Qs(e,i.x,r.x,a.x),Qs(e,i.y,r.y,a.y),Qs(e,i.z,r.z,a.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class Zf extends _i{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new Be){const n=t,i=this.points,r=(i.length-1)*e,a=Math.floor(r),o=r-a,l=i[a===0?a:a-1],c=i[a],h=i[a>i.length-2?i.length-1:a+1],d=i[a>i.length-3?i.length-1:a+2];return n.set(Uc(o,l.x,c.x,h.x,d.x),Uc(o,l.y,c.y,h.y,d.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(i.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const i=this.points[t];e.points.push(i.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(new Be().fromArray(i))}return this}}var Qf=Object.freeze({__proto__:null,ArcCurve:Bf,CatmullRomCurve3:mu,CubicBezierCurve:jf,CubicBezierCurve3:Yf,EllipseCurve:pu,LineCurve:$f,LineCurve3:Jf,QuadraticBezierCurve:Kf,QuadraticBezierCurve3:gu,SplineCurve:Zf});class lr extends Bt{constructor(e=1,t=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i};const r=e/2,a=t/2,o=Math.floor(n),l=Math.floor(i),c=o+1,h=l+1,d=e/o,u=t/l,f=[],m=[],_=[],g=[];for(let p=0;p<h;p++){const w=p*u-a;for(let E=0;E<c;E++){const S=E*d-r;m.push(S,-w,0),_.push(0,0,1),g.push(E/o),g.push(1-p/l)}}for(let p=0;p<l;p++)for(let w=0;w<o;w++){const E=w+c*p,S=w+c*(p+1),U=w+1+c*(p+1),L=w+1+c*p;f.push(E,S,L),f.push(S,U,L)}this.setIndex(f),this.setAttribute("position",new mt(m,3)),this.setAttribute("normal",new mt(_,3)),this.setAttribute("uv",new mt(g,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new lr(e.width,e.height,e.widthSegments,e.heightSegments)}}class Ma extends Bt{constructor(e=1,t=32,n=16,i=0,r=Math.PI*2,a=0,o=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:i,phiLength:r,thetaStart:a,thetaLength:o},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));const l=Math.min(a+o,Math.PI);let c=0;const h=[],d=new F,u=new F,f=[],m=[],_=[],g=[];for(let p=0;p<=n;p++){const w=[],E=p/n;let S=0;p===0&&a===0?S=.5/t:p===n&&l===Math.PI&&(S=-.5/t);for(let U=0;U<=t;U++){const L=U/t;d.x=-e*Math.cos(i+L*r)*Math.sin(a+E*o),d.y=e*Math.cos(a+E*o),d.z=e*Math.sin(i+L*r)*Math.sin(a+E*o),m.push(d.x,d.y,d.z),u.copy(d).normalize(),_.push(u.x,u.y,u.z),g.push(L+S,1-E),w.push(c++)}h.push(w)}for(let p=0;p<n;p++)for(let w=0;w<t;w++){const E=h[p][w+1],S=h[p][w],U=h[p+1][w],L=h[p+1][w+1];(p!==0||a>0)&&f.push(E,S,L),(p!==n-1||l<Math.PI)&&f.push(S,U,L)}this.setIndex(f),this.setAttribute("position",new mt(m,3)),this.setAttribute("normal",new mt(_,3)),this.setAttribute("uv",new mt(g,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Ma(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class Il extends Bt{constructor(e=new gu(new F(-1,-1,0),new F(-1,1,0),new F(1,1,0)),t=64,n=1,i=8,r=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:i,closed:r};const a=e.computeFrenetFrames(t,r);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;const o=new F,l=new F,c=new Be;let h=new F;const d=[],u=[],f=[],m=[];_(),this.setIndex(m),this.setAttribute("position",new mt(d,3)),this.setAttribute("normal",new mt(u,3)),this.setAttribute("uv",new mt(f,2));function _(){for(let E=0;E<t;E++)g(E);g(r===!1?t:0),w(),p()}function g(E){h=e.getPointAt(E/t,h);const S=a.normals[E],U=a.binormals[E];for(let L=0;L<=i;L++){const D=L/i*Math.PI*2,N=Math.sin(D),b=-Math.cos(D);l.x=b*S.x+N*U.x,l.y=b*S.y+N*U.y,l.z=b*S.z+N*U.z,l.normalize(),u.push(l.x,l.y,l.z),o.x=h.x+n*l.x,o.y=h.y+n*l.y,o.z=h.z+n*l.z,d.push(o.x,o.y,o.z)}}function p(){for(let E=1;E<=t;E++)for(let S=1;S<=i;S++){const U=(i+1)*(E-1)+(S-1),L=(i+1)*E+(S-1),D=(i+1)*E+S,N=(i+1)*(E-1)+S;m.push(U,L,N),m.push(L,D,N)}}function w(){for(let E=0;E<=t;E++)for(let S=0;S<=i;S++)c.x=E/t,c.y=S/i,f.push(c.x,c.y)}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new Il(new Qf[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class ep extends Bt{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){const t=[],n=new Set,i=new F,r=new F;if(e.index!==null){const a=e.attributes.position,o=e.index;let l=e.groups;l.length===0&&(l=[{start:0,count:o.count,materialIndex:0}]);for(let c=0,h=l.length;c<h;++c){const d=l[c],u=d.start,f=d.count;for(let m=u,_=u+f;m<_;m+=3)for(let g=0;g<3;g++){const p=o.getX(m+g),w=o.getX(m+(g+1)%3);i.fromBufferAttribute(a,p),r.fromBufferAttribute(a,w),Ic(i,r,n)===!0&&(t.push(i.x,i.y,i.z),t.push(r.x,r.y,r.z))}}}else{const a=e.attributes.position;for(let o=0,l=a.count/3;o<l;o++)for(let c=0;c<3;c++){const h=3*o+c,d=3*o+(c+1)%3;i.fromBufferAttribute(a,h),r.fromBufferAttribute(a,d),Ic(i,r,n)===!0&&(t.push(i.x,i.y,i.z),t.push(r.x,r.y,r.z))}}this.setAttribute("position",new mt(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function Ic(s,e,t){const n=`${s.x},${s.y},${s.z}-${e.x},${e.y},${e.z}`,i=`${e.x},${e.y},${e.z}-${s.x},${s.y},${s.z}`;return t.has(n)===!0||t.has(i)===!0?!1:(t.add(n),t.add(i),!0)}class tp extends Dn{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new et(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}}class np extends Dn{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new et(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new et(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=xa,this.normalScale=new Be(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new _n,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(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.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Sn extends Dn{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new et(16777215),this.specular=new et(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new et(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=xa,this.normalScale=new Be(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new _n,this.combine=_a,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(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.envMapRotation.copy(e.envMapRotation),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.flatShading=e.flatShading,this.fog=e.fog,this}}class ip extends Dn{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new et(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new et(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=xa,this.normalScale=new Be(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new _n,this.combine=_a,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(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.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.envMapRotation.copy(e.envMapRotation),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.flatShading=e.flatShading,this.fog=e.fog,this}}class sp extends Dn{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Pd,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,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}}class rp extends Dn{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}function kr(s,e){return!s||s.constructor===e?s:typeof e.BYTES_PER_ELEMENT=="number"?new e(s):Array.prototype.slice.call(s)}function ap(s){return ArrayBuffer.isView(s)&&!(s instanceof DataView)}function op(s){function e(i,r){return s[i]-s[r]}const t=s.length,n=new Array(t);for(let i=0;i!==t;++i)n[i]=i;return n.sort(e),n}function Fc(s,e,t){const n=s.length,i=new s.constructor(n);for(let r=0,a=0;a!==n;++r){const o=t[r]*e;for(let l=0;l!==e;++l)i[a++]=s[o+l]}return i}function _u(s,e,t,n){let i=1,r=s[0];for(;r!==void 0&&r[n]===void 0;)r=s[i++];if(r===void 0)return;let a=r[n];if(a!==void 0)if(Array.isArray(a))do a=r[n],a!==void 0&&(e.push(r.time),t.push(...a)),r=s[i++];while(r!==void 0);else if(a.toArray!==void 0)do a=r[n],a!==void 0&&(e.push(r.time),a.toArray(t,t.length)),r=s[i++];while(r!==void 0);else do a=r[n],a!==void 0&&(e.push(r.time),t.push(a)),r=s[i++];while(r!==void 0)}class ba{constructor(e,t,n,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,i=t[n],r=t[n-1];n:{e:{let a;t:{i:if(!(e<i)){for(let o=n+2;;){if(i===void 0){if(e<r)break i;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===o)break;if(r=i,i=t[++n],e<i)break e}a=t.length;break t}if(!(e>=r)){const o=t[1];e<o&&(n=2,r=o);for(let l=n-2;;){if(r===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===l)break;if(i=r,r=t[--n-1],e>=r)break e}a=n,n=0;break t}break n}for(;n<a;){const o=n+a>>>1;e<t[o]?a=o:n=o+1}if(i=t[n],r=t[n-1],r===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,r,i)}return this.interpolate_(n,r,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=e*i;for(let a=0;a!==i;++a)t[a]=n[r+a];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class lp extends ba{constructor(e,t,n,i){super(e,t,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Jl,endingEnd:Jl}}intervalChanged_(e,t,n){const i=this.parameterPositions;let r=e-2,a=e+1,o=i[r],l=i[a];if(o===void 0)switch(this.getSettings_().endingStart){case Kl:r=e,o=2*t-n;break;case Zl:r=i.length-2,o=t+i[r]-i[r+1];break;default:r=e,o=n}if(l===void 0)switch(this.getSettings_().endingEnd){case Kl:a=e,l=2*n-t;break;case Zl:a=1,l=n+i[1]-i[0];break;default:a=e-1,l=t}const c=(n-t)*.5,h=this.valueSize;this._weightPrev=c/(t-o),this._weightNext=c/(l-n),this._offsetPrev=r*h,this._offsetNext=a*h}interpolate_(e,t,n,i){const r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=e*o,c=l-o,h=this._offsetPrev,d=this._offsetNext,u=this._weightPrev,f=this._weightNext,m=(n-t)/(i-t),_=m*m,g=_*m,p=-u*g+2*u*_-u*m,w=(1+u)*g+(-1.5-2*u)*_+(-.5+u)*m+1,E=(-1-f)*g+(1.5+f)*_+.5*m,S=f*g-f*_;for(let U=0;U!==o;++U)r[U]=p*a[h+U]+w*a[c+U]+E*a[l+U]+S*a[d+U];return r}}class cp extends ba{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=e*o,c=l-o,h=(n-t)/(i-t),d=1-h;for(let u=0;u!==o;++u)r[u]=a[c+u]*d+a[l+u]*h;return r}}class hp extends ba{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class jn{constructor(e,t,n,i){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=kr(t,this.TimeBufferType),this.values=kr(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:kr(e.times,Array),values:kr(e.values,Array)};const i=e.getInterpolation();i!==e.DefaultInterpolation&&(n.interpolation=i)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new hp(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new cp(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new lp(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case ca:t=this.InterpolantFactoryMethodDiscrete;break;case sl:t=this.InterpolantFactoryMethodLinear;break;case Ta:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(n);return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return ca;case this.InterpolantFactoryMethodLinear:return sl;case this.InterpolantFactoryMethodSmooth:return Ta}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]*=e}return this}trim(e,t){const n=this.times,i=n.length;let r=0,a=i-1;for(;r!==i&&n[r]<e;)++r;for(;a!==-1&&n[a]>t;)--a;if(++a,r!==0||a!==i){r>=a&&(a=Math.max(a,1),r=a-1);const o=this.getValueSize();this.times=n.slice(r,a),this.values=this.values.slice(r*o,a*o)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,i=this.values,r=n.length;r===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let o=0;o!==r;o++){const l=n[o];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,l),e=!1;break}if(a!==null&&a>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,l,a),e=!1;break}a=l}if(i!==void 0&&ap(i))for(let o=0,l=i.length;o!==l;++o){const c=i[o];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===Ta,r=e.length-1;let a=1;for(let o=1;o<r;++o){let l=!1;const c=e[o],h=e[o+1];if(c!==h&&(o!==1||c!==e[0]))if(i)l=!0;else{const d=o*n,u=d-n,f=d+n;for(let m=0;m!==n;++m){const _=t[d+m];if(_!==t[u+m]||_!==t[f+m]){l=!0;break}}}if(l){if(o!==a){e[a]=e[o];const d=o*n,u=a*n;for(let f=0;f!==n;++f)t[u+f]=t[d+f]}++a}}if(r>0){e[a]=e[r];for(let o=r*n,l=a*n,c=0;c!==n;++c)t[l+c]=t[o+c];++a}return a!==e.length?(this.times=e.slice(0,a),this.values=t.slice(0,a*n)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}jn.prototype.ValueTypeName="";jn.prototype.TimeBufferType=Float32Array;jn.prototype.ValueBufferType=Float32Array;jn.prototype.DefaultInterpolation=sl;class Is extends jn{constructor(e,t,n){super(e,t,n)}}Is.prototype.ValueTypeName="bool";Is.prototype.ValueBufferType=Array;Is.prototype.DefaultInterpolation=ca;Is.prototype.InterpolantFactoryMethodLinear=void 0;Is.prototype.InterpolantFactoryMethodSmooth=void 0;class vu extends jn{constructor(e,t,n,i){super(e,t,n,i)}}vu.prototype.ValueTypeName="color";class ma extends jn{constructor(e,t,n,i){super(e,t,n,i)}}ma.prototype.ValueTypeName="number";class up extends ba{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=(n-t)/(i-t);let c=e*o;for(let h=c+o;c!==h;c+=4)Pn.slerpFlat(r,0,a,c-o,a,c,l);return r}}class cr extends jn{constructor(e,t,n,i){super(e,t,n,i)}InterpolantFactoryMethodLinear(e){return new up(this.times,this.values,this.getValueSize(),e)}}cr.prototype.ValueTypeName="quaternion";cr.prototype.InterpolantFactoryMethodSmooth=void 0;class Fs extends jn{constructor(e,t,n){super(e,t,n)}}Fs.prototype.ValueTypeName="string";Fs.prototype.ValueBufferType=Array;Fs.prototype.DefaultInterpolation=ca;Fs.prototype.InterpolantFactoryMethodLinear=void 0;Fs.prototype.InterpolantFactoryMethodSmooth=void 0;class Ns extends jn{constructor(e,t,n,i){super(e,t,n,i)}}Ns.prototype.ValueTypeName="vector";class Oc{constructor(e="",t=-1,n=[],i=Ld){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=Gn(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,i=1/(e.fps||1);for(let a=0,o=n.length;a!==o;++a)t.push(fp(n[a]).scale(i));const r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r}static toJSON(e){const t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let r=0,a=n.length;r!==a;++r)t.push(jn.toJSON(n[r]));return i}static CreateFromMorphTargetSequence(e,t,n,i){const r=t.length,a=[];for(let o=0;o<r;o++){let l=[],c=[];l.push((o+r-1)%r,o,(o+1)%r),c.push(0,1,0);const h=op(l);l=Fc(l,1,h),c=Fc(c,1,h),!i&&l[0]===0&&(l.push(r),c.push(c[0])),a.push(new ma(".morphTargetInfluences["+t[o].name+"]",l,c).scale(1/n))}return new this(e,-1,a)}static findByName(e,t){let n=e;if(!Array.isArray(e)){const i=e;n=i.geometry&&i.geometry.animations||i.animations}for(let i=0;i<n.length;i++)if(n[i].name===t)return n[i];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const i={},r=/^([\w-]*?)([\d]+)$/;for(let o=0,l=e.length;o<l;o++){const c=e[o],h=c.name.match(r);if(h&&h.length>1){const d=h[1];let u=i[d];u||(i[d]=u=[]),u.push(c)}}const a=[];for(const o in i)a.push(this.CreateFromMorphTargetSequence(o,i[o],t,n));return a}static parseAnimation(e,t){if(console.warn("THREE.AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(d,u,f,m,_){if(f.length!==0){const g=[],p=[];_u(f,g,p,m),g.length!==0&&_.push(new d(u,g,p))}},i=[],r=e.name||"default",a=e.fps||30,o=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let d=0;d<c.length;d++){const u=c[d].keys;if(!(!u||u.length===0))if(u[0].morphTargets){const f={};let m;for(m=0;m<u.length;m++)if(u[m].morphTargets)for(let _=0;_<u[m].morphTargets.length;_++)f[u[m].morphTargets[_]]=-1;for(const _ in f){const g=[],p=[];for(let w=0;w!==u[m].morphTargets.length;++w){const E=u[m];g.push(E.time),p.push(E.morphTarget===_?1:0)}i.push(new ma(".morphTargetInfluence["+_+"]",g,p))}l=f.length*a}else{const f=".bones["+t[d].name+"]";n(Ns,f+".position",u,"pos",i),n(cr,f+".quaternion",u,"rot",i),n(Ns,f+".scale",u,"scl",i)}}return i.length===0?null:new this(r,l,i,o)}resetDuration(){const e=this.tracks;let t=0;for(let n=0,i=e.length;n!==i;++n){const r=this.tracks[n];t=Math.max(t,r.times[r.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function dp(s){switch(s.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return ma;case"vector":case"vector2":case"vector3":case"vector4":return Ns;case"color":return vu;case"quaternion":return cr;case"bool":case"boolean":return Is;case"string":return Fs}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+s)}function fp(s){if(s.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=dp(s.type);if(s.times===void 0){const t=[],n=[];_u(s.keys,t,n,"value"),s.times=t,s.values=n}return e.parse!==void 0?e.parse(s):new e(s.name,s.times,s.values,s.interpolation)}const ga={enabled:!1,files:{},add:function(s,e){this.enabled!==!1&&(this.files[s]=e)},get:function(s){if(this.enabled!==!1)return this.files[s]},remove:function(s){delete this.files[s]},clear:function(){this.files={}}};class pp{constructor(e,t,n){const i=this;let r=!1,a=0,o=0,l;const c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(h){o++,r===!1&&i.onStart!==void 0&&i.onStart(h,a,o),r=!0},this.itemEnd=function(h){a++,i.onProgress!==void 0&&i.onProgress(h,a,o),a===o&&(r=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(h){i.onError!==void 0&&i.onError(h)},this.resolveURL=function(h){return l?l(h):h},this.setURLModifier=function(h){return l=h,this},this.addHandler=function(h,d){return c.push(h,d),this},this.removeHandler=function(h){const d=c.indexOf(h);return d!==-1&&c.splice(d,2),this},this.getHandler=function(h){for(let d=0,u=c.length;d<u;d+=2){const f=c[d],m=c[d+1];if(f.global&&(f.lastIndex=0),f.test(h))return m}return null}}}const Fl=new pp;class Xn{constructor(e){this.manager=e!==void 0?e:Fl,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise(function(i,r){n.load(e,i,t,r)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}Xn.DEFAULT_MATERIAL_NAME="__DEFAULT";const hi={};class mp extends Error{constructor(e,t){super(e),this.response=t}}class Os extends Xn{constructor(e){super(e),this.mimeType="",this.responseType=""}load(e,t,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=ga.get(e);if(r!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(r),this.manager.itemEnd(e)},0),r;if(hi[e]!==void 0){hi[e].push({onLoad:t,onProgress:n,onError:i});return}hi[e]=[],hi[e].push({onLoad:t,onProgress:n,onError:i});const a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,l=this.responseType;fetch(a).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const h=hi[e],d=c.body.getReader(),u=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),f=u?parseInt(u):0,m=f!==0;let _=0;const g=new ReadableStream({start(p){w();function w(){d.read().then(({done:E,value:S})=>{if(E)p.close();else{_+=S.byteLength;const U=new ProgressEvent("progress",{lengthComputable:m,loaded:_,total:f});for(let L=0,D=h.length;L<D;L++){const N=h[L];N.onProgress&&N.onProgress(U)}p.enqueue(S),w()}},E=>{p.error(E)})}}});return new Response(g)}else throw new mp(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(h=>new DOMParser().parseFromString(h,o));case"json":return c.json();default:if(o==="")return c.text();{const d=/charset="?([^;"\s]*)"?/i.exec(o),u=d&&d[1]?d[1].toLowerCase():void 0,f=new TextDecoder(u);return c.arrayBuffer().then(m=>f.decode(m))}}}).then(c=>{ga.add(e,c);const h=hi[e];delete hi[e];for(let d=0,u=h.length;d<u;d++){const f=h[d];f.onLoad&&f.onLoad(c)}}).catch(c=>{const h=hi[e];if(h===void 0)throw this.manager.itemError(e),c;delete hi[e];for(let d=0,u=h.length;d<u;d++){const f=h[d];f.onError&&f.onError(c)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class gp extends Xn{constructor(e){super(e)}load(e,t,n,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,a=ga.get(e);if(a!==void 0)return r.manager.itemStart(e),setTimeout(function(){t&&t(a),r.manager.itemEnd(e)},0),a;const o=rr("img");function l(){h(),ga.add(e,this),t&&t(this),r.manager.itemEnd(e)}function c(d){h(),i&&i(d),r.manager.itemError(e),r.manager.itemEnd(e)}function h(){o.removeEventListener("load",l,!1),o.removeEventListener("error",c,!1)}return o.addEventListener("load",l,!1),o.addEventListener("error",c,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(o.crossOrigin=this.crossOrigin),r.manager.itemStart(e),o.src=e,o}}class _p extends Xn{constructor(e){super(e)}load(e,t,n,i){const r=this,a=new du,o=new Os(this.manager);return o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(r.withCredentials),o.load(e,function(l){let c;try{c=r.parse(l)}catch(h){if(i!==void 0)i(h);else{console.error(h);return}}c.image!==void 0?a.image=c.image:c.data!==void 0&&(a.image.width=c.width,a.image.height=c.height,a.image.data=c.data),a.wrapS=c.wrapS!==void 0?c.wrapS:Hn,a.wrapT=c.wrapT!==void 0?c.wrapT:Hn,a.magFilter=c.magFilter!==void 0?c.magFilter:Rn,a.minFilter=c.minFilter!==void 0?c.minFilter:Rn,a.anisotropy=c.anisotropy!==void 0?c.anisotropy:1,c.colorSpace!==void 0&&(a.colorSpace=c.colorSpace),c.flipY!==void 0&&(a.flipY=c.flipY),c.format!==void 0&&(a.format=c.format),c.type!==void 0&&(a.type=c.type),c.mipmaps!==void 0&&(a.mipmaps=c.mipmaps,a.minFilter=di),c.mipmapCount===1&&(a.minFilter=Rn),c.generateMipmaps!==void 0&&(a.generateMipmaps=c.generateMipmaps),a.needsUpdate=!0,t&&t(a,c)},n,i),a}}class Ol extends Xn{constructor(e){super(e)}load(e,t,n,i){const r=new on,a=new gp(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(o){r.image=o,r.needsUpdate=!0,t!==void 0&&t(r)},n,i),r}}class hr extends It{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new et(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),this.target!==void 0&&(t.object.target=this.target.uuid),t}}class vp extends hr{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(It.DEFAULT_UP),this.updateMatrix(),this.groundColor=new et(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}const io=new st,zc=new F,Bc=new F;class zl{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Be(512,512),this.mapType=ni,this.map=null,this.mapPass=null,this.matrix=new st,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Pl,this._frameExtents=new Be(1,1),this._viewportCount=1,this._viewports=[new bt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;zc.setFromMatrixPosition(e.matrixWorld),t.position.copy(zc),Bc.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Bc),t.updateMatrixWorld(),io.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(io),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(io)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class xp extends zl{constructor(){super(new an(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){const t=this.camera,n=Ps*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height*this.aspect,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()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class yp extends hr{constructor(e,t,n=0,i=Math.PI/3,r=0,a=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(It.DEFAULT_UP),this.updateMatrix(),this.target=new It,this.distance=n,this.angle=i,this.penumbra=r,this.decay=a,this.map=null,this.shadow=new xp}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),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}}const kc=new st,js=new F,so=new F;class Mp extends zl{constructor(){super(new an(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Be(4,2),this._viewportCount=6,this._viewports=[new bt(2,1,1,1),new bt(0,1,1,1),new bt(3,1,1,1),new bt(1,1,1,1),new bt(3,0,1,1),new bt(1,0,1,1)],this._cubeDirections=[new F(1,0,0),new F(-1,0,0),new F(0,0,1),new F(0,0,-1),new F(0,1,0),new F(0,-1,0)],this._cubeUps=[new F(0,1,0),new F(0,1,0),new F(0,1,0),new F(0,1,0),new F(0,0,1),new F(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,i=this.matrix,r=e.distance||n.far;r!==n.far&&(n.far=r,n.updateProjectionMatrix()),js.setFromMatrixPosition(e.matrixWorld),n.position.copy(js),so.copy(n.position),so.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(so),n.updateMatrixWorld(),i.makeTranslation(-js.x,-js.y,-js.z),kc.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(kc)}}class xu extends hr{constructor(e,t,n=0,i=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=i,this.shadow=new Mp}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class Sa extends ou{constructor(e=-1,t=1,n=1,i=-1,r=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=r,this.far=a,this.updateProjectionMatrix()}copy(e,t){return super.copy(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=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,r,a){this.view===null&&(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(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const 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;let r=n-e,a=n+e,o=i+t,l=i-t;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,h=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=c*this.view.offsetX,a=r+c*this.view.width,o-=h*this.view.offsetY,l=o-h*this.view.height}this.projectionMatrix.makeOrthographic(r,a,o,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(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,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}class bp extends zl{constructor(){super(new Sa(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class yu extends hr{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(It.DEFAULT_UP),this.updateMatrix(),this.target=new It,this.shadow=new bp}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class Mu extends hr{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class Bl{static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class Sp extends Bt{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class Ep extends an{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class wp{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Vc(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=Vc();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function Vc(){return performance.now()}class ol extends cu{constructor(e,t,n=1){super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}const Hc=new st;class Ap{constructor(e,t,n=0,i=1/0){this.ray=new Us(e,t),this.near=n,this.far=i,this.camera=null,this.layers=new Al,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,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(),this.camera=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),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}setFromXRController(e){return Hc.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(Hc),this}intersectObject(e,t=!0,n=[]){return ll(e,this,n,t),n.sort(Gc),n}intersectObjects(e,t=!0,n=[]){for(let i=0,r=e.length;i<r;i++)ll(e[i],this,n,t);return n.sort(Gc),n}}function Gc(s,e){return s.distance-e.distance}function ll(s,e,t,n){let i=!0;if(s.layers.test(e.layers)&&s.raycast(e,t)===!1&&(i=!1),i===!0&&n===!0){const r=s.children;for(let a=0,o=r.length;a<o;a++)ll(r[a],e,t,!0)}}class bu{constructor(e=1,t=0,n=0){this.radius=e,this.phi=t,this.theta=n}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=vt(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(vt(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}const Wc=new F,Vr=new F;class Tp{constructor(e=new F,t=new F){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){Wc.subVectors(e,this.start),Vr.subVectors(this.end,this.start);const n=Vr.dot(Vr);let r=Vr.dot(Wc)/n;return t&&(r=vt(r,0,1)),r}closestPointToPoint(e,t,n){const i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}class Cp extends pa{constructor(e=10,t=10,n=4473924,i=8947848){n=new et(n),i=new et(i);const r=t/2,a=e/t,o=e/2,l=[],c=[];for(let u=0,f=0,m=-o;u<=t;u++,m+=a){l.push(-o,0,m,o,0,m),l.push(m,0,-o,m,0,o);const _=u===r?n:i;_.toArray(c,f),f+=3,_.toArray(c,f),f+=3,_.toArray(c,f),f+=3,_.toArray(c,f),f+=3}const h=new Bt;h.setAttribute("position",new mt(l,3)),h.setAttribute("color",new mt(c,3));const d=new Li({vertexColors:!0,toneMapped:!1});super(h,d),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class Rp extends Ki{constructor(e,t=null){super(),this.object=e,this.domElement=t,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(e){if(e===void 0){console.warn("THREE.Controls: connect() now requires an element.");return}this.domElement!==null&&this.disconnect(),this.domElement=e}disconnect(){}dispose(){}update(){}}function Xc(s,e,t,n){const i=Lp(n);switch(t){case $h:return s*e;case Kh:return s*e/i.components*i.byteLength;case Ml:return s*e/i.components*i.byteLength;case Zh:return s*e*2/i.components*i.byteLength;case bl:return s*e*2/i.components*i.byteLength;case Jh:return s*e*3/i.components*i.byteLength;case Fn:return s*e*4/i.components*i.byteLength;case Sl:return s*e*4/i.components*i.byteLength;case ea:case ta:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*8;case na:case ia:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*16;case No:case Io:return Math.max(s,16)*Math.max(e,8)/4;case Do:case Uo:return Math.max(s,8)*Math.max(e,8)/2;case Fo:case Oo:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*8;case zo:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*16;case Bo:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*16;case ko:return Math.floor((s+4)/5)*Math.floor((e+3)/4)*16;case Vo:return Math.floor((s+4)/5)*Math.floor((e+4)/5)*16;case Ho:return Math.floor((s+5)/6)*Math.floor((e+4)/5)*16;case Go:return Math.floor((s+5)/6)*Math.floor((e+5)/6)*16;case Wo:return Math.floor((s+7)/8)*Math.floor((e+4)/5)*16;case Xo:return Math.floor((s+7)/8)*Math.floor((e+5)/6)*16;case qo:return Math.floor((s+7)/8)*Math.floor((e+7)/8)*16;case jo:return Math.floor((s+9)/10)*Math.floor((e+4)/5)*16;case Yo:return Math.floor((s+9)/10)*Math.floor((e+5)/6)*16;case $o:return Math.floor((s+9)/10)*Math.floor((e+7)/8)*16;case Jo:return Math.floor((s+9)/10)*Math.floor((e+9)/10)*16;case Ko:return Math.floor((s+11)/12)*Math.floor((e+9)/10)*16;case Zo:return Math.floor((s+11)/12)*Math.floor((e+11)/12)*16;case sa:case Qo:case el:return Math.ceil(s/4)*Math.ceil(e/4)*16;case Qh:case tl:return Math.ceil(s/4)*Math.ceil(e/4)*8;case nl:case il:return Math.ceil(s/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function Lp(s){switch(s){case ni:case qh:return{byteLength:1,components:1};case tr:case jh:case or:return{byteLength:2,components:1};case xl:case yl:return{byteLength:2,components:4};case $i:case vl:case Qn:return{byteLength:4,components:1};case Yh:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${s}.`)}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:_l}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=_l);/**
|
|
45
45
|
* @license
|
|
46
46
|
* Copyright 2010-2025 Three.js Authors
|
|
47
47
|
* SPDX-License-Identifier: MIT
|
|
48
|
-
*/function Su(){let s=null,e=!1,t=null,n=null;function i(r,a){t(r,a),n=s.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(n=s.requestAnimationFrame(i),e=!0)},stop:function(){s.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(r){t=r},setContext:function(r){s=r}}}function Pp(s){const e=new WeakMap;function t(o,l){const c=o.array,h=o.usage,
|
|
48
|
+
*/function Su(){let s=null,e=!1,t=null,n=null;function i(r,a){t(r,a),n=s.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(n=s.requestAnimationFrame(i),e=!0)},stop:function(){s.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(r){t=r},setContext:function(r){s=r}}}function Pp(s){const e=new WeakMap;function t(o,l){const c=o.array,h=o.usage,d=c.byteLength,u=s.createBuffer();s.bindBuffer(l,u),s.bufferData(l,c,h),o.onUploadCallback();let f;if(c instanceof Float32Array)f=s.FLOAT;else if(c instanceof Uint16Array)o.isFloat16BufferAttribute?f=s.HALF_FLOAT:f=s.UNSIGNED_SHORT;else if(c instanceof Int16Array)f=s.SHORT;else if(c instanceof Uint32Array)f=s.UNSIGNED_INT;else if(c instanceof Int32Array)f=s.INT;else if(c instanceof Int8Array)f=s.BYTE;else if(c instanceof Uint8Array)f=s.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)f=s.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:u,type:f,bytesPerElement:c.BYTES_PER_ELEMENT,version:o.version,size:d}}function n(o,l,c){const h=l.array,d=l.updateRanges;if(s.bindBuffer(c,o),d.length===0)s.bufferSubData(c,0,h);else{d.sort((f,m)=>f.start-m.start);let u=0;for(let f=1;f<d.length;f++){const m=d[u],_=d[f];_.start<=m.start+m.count+1?m.count=Math.max(m.count,_.start+_.count-m.start):(++u,d[u]=_)}d.length=u+1;for(let f=0,m=d.length;f<m;f++){const _=d[f];s.bufferSubData(c,_.start*h.BYTES_PER_ELEMENT,h,_.start,_.count)}l.clearUpdateRanges()}l.onUploadCallback()}function i(o){return o.isInterleavedBufferAttribute&&(o=o.data),e.get(o)}function r(o){o.isInterleavedBufferAttribute&&(o=o.data);const l=e.get(o);l&&(s.deleteBuffer(l.buffer),e.delete(o))}function a(o,l){if(o.isInterleavedBufferAttribute&&(o=o.data),o.isGLBufferAttribute){const h=e.get(o);(!h||h.version<o.version)&&e.set(o,{buffer:o.buffer,type:o.type,bytesPerElement:o.elementSize,version:o.version});return}const c=e.get(o);if(c===void 0)e.set(o,t(o,l));else if(c.version<o.version){if(c.size!==o.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");n(c.buffer,o,l),c.version=o.version}}return{get:i,remove:r,update:a}}var Dp=`#ifdef USE_ALPHAHASH
|
|
49
49
|
if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
|
|
50
50
|
#endif`,Np=`#ifdef USE_ALPHAHASH
|
|
51
51
|
const float ALPHA_HASH_SCALE = 0.05;
|
|
@@ -3571,7 +3571,7 @@ void main() {
|
|
|
3571
3571
|
#include <tonemapping_fragment>
|
|
3572
3572
|
#include <colorspace_fragment>
|
|
3573
3573
|
#include <fog_fragment>
|
|
3574
|
-
}`,xt={alphahash_fragment:Dp,alphahash_pars_fragment:Np,alphamap_fragment:Up,alphamap_pars_fragment:Ip,alphatest_fragment:Fp,alphatest_pars_fragment:Op,aomap_fragment:zp,aomap_pars_fragment:Bp,batching_pars_vertex:kp,batching_vertex:Vp,begin_vertex:Hp,beginnormal_vertex:Gp,bsdfs:Wp,iridescence_fragment:Xp,bumpmap_pars_fragment:qp,clipping_planes_fragment:jp,clipping_planes_pars_fragment:Yp,clipping_planes_pars_vertex:$p,clipping_planes_vertex:Jp,color_fragment:Kp,color_pars_fragment:Zp,color_pars_vertex:Qp,color_vertex:e0,common:t0,cube_uv_reflection_fragment:n0,defaultnormal_vertex:i0,displacementmap_pars_vertex:s0,displacementmap_vertex:r0,emissivemap_fragment:a0,emissivemap_pars_fragment:o0,colorspace_fragment:l0,colorspace_pars_fragment:c0,envmap_fragment:h0,envmap_common_pars_fragment:u0,envmap_pars_fragment:d0,envmap_pars_vertex:f0,envmap_physical_pars_fragment:E0,envmap_vertex:p0,fog_vertex:m0,fog_pars_vertex:g0,fog_fragment:_0,fog_pars_fragment:v0,gradientmap_pars_fragment:x0,lightmap_pars_fragment:y0,lights_lambert_fragment:M0,lights_lambert_pars_fragment:b0,lights_pars_begin:S0,lights_toon_fragment:w0,lights_toon_pars_fragment:A0,lights_phong_fragment:T0,lights_phong_pars_fragment:C0,lights_physical_fragment:R0,lights_physical_pars_fragment:L0,lights_fragment_begin:P0,lights_fragment_maps:D0,lights_fragment_end:N0,logdepthbuf_fragment:U0,logdepthbuf_pars_fragment:I0,logdepthbuf_pars_vertex:F0,logdepthbuf_vertex:O0,map_fragment:z0,map_pars_fragment:B0,map_particle_fragment:k0,map_particle_pars_fragment:V0,metalnessmap_fragment:H0,metalnessmap_pars_fragment:G0,morphinstance_vertex:W0,morphcolor_vertex:X0,morphnormal_vertex:q0,morphtarget_pars_vertex:j0,morphtarget_vertex:Y0,normal_fragment_begin:$0,normal_fragment_maps:J0,normal_pars_fragment:K0,normal_pars_vertex:Z0,normal_vertex:Q0,normalmap_pars_fragment:em,clearcoat_normal_fragment_begin:tm,clearcoat_normal_fragment_maps:nm,clearcoat_pars_fragment:im,iridescence_pars_fragment:sm,opaque_fragment:rm,packing:am,premultiplied_alpha_fragment:om,project_vertex:lm,dithering_fragment:cm,dithering_pars_fragment:hm,roughnessmap_fragment:um,roughnessmap_pars_fragment:dm,shadowmap_pars_fragment:fm,shadowmap_pars_vertex:pm,shadowmap_vertex:mm,shadowmask_pars_fragment:gm,skinbase_vertex:_m,skinning_pars_vertex:vm,skinning_vertex:xm,skinnormal_vertex:ym,specularmap_fragment:Mm,specularmap_pars_fragment:bm,tonemapping_fragment:Sm,tonemapping_pars_fragment:Em,transmission_fragment:wm,transmission_pars_fragment:Am,uv_pars_fragment:Tm,uv_pars_vertex:Cm,uv_vertex:Rm,worldpos_vertex:Lm,background_vert:Pm,background_frag:Dm,backgroundCube_vert:Nm,backgroundCube_frag:Um,cube_vert:Im,cube_frag:Fm,depth_vert:Om,depth_frag:zm,distanceRGBA_vert:Bm,distanceRGBA_frag:km,equirect_vert:Vm,equirect_frag:Hm,linedashed_vert:Gm,linedashed_frag:Wm,meshbasic_vert:Xm,meshbasic_frag:qm,meshlambert_vert:jm,meshlambert_frag:Ym,meshmatcap_vert:$m,meshmatcap_frag:Jm,meshnormal_vert:Km,meshnormal_frag:Zm,meshphong_vert:Qm,meshphong_frag:e1,meshphysical_vert:t1,meshphysical_frag:n1,meshtoon_vert:i1,meshtoon_frag:s1,points_vert:r1,points_frag:a1,shadow_vert:o1,shadow_frag:l1,sprite_vert:c1,sprite_frag:h1},Le={common:{diffuse:{value:new et(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new _t},alphaMap:{value:null},alphaMapTransform:{value:new _t},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new _t}},envmap:{envMap:{value:null},envMapRotation:{value:new _t},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new _t}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new _t}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new _t},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new _t},normalScale:{value:new Be(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new _t},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new _t}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new _t}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new _t}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new et(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new et(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new _t},alphaTest:{value:0},uvTransform:{value:new _t}},sprite:{diffuse:{value:new et(16777215)},opacity:{value:1},center:{value:new Be(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new _t},alphaMap:{value:null},alphaMapTransform:{value:new _t},alphaTest:{value:0}}},En={basic:{uniforms:mn([Le.common,Le.specularmap,Le.envmap,Le.aomap,Le.lightmap,Le.fog]),vertexShader:xt.meshbasic_vert,fragmentShader:xt.meshbasic_frag},lambert:{uniforms:mn([Le.common,Le.specularmap,Le.envmap,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.fog,Le.lights,{emissive:{value:new et(0)}}]),vertexShader:xt.meshlambert_vert,fragmentShader:xt.meshlambert_frag},phong:{uniforms:mn([Le.common,Le.specularmap,Le.envmap,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.fog,Le.lights,{emissive:{value:new et(0)},specular:{value:new et(1118481)},shininess:{value:30}}]),vertexShader:xt.meshphong_vert,fragmentShader:xt.meshphong_frag},standard:{uniforms:mn([Le.common,Le.envmap,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.roughnessmap,Le.metalnessmap,Le.fog,Le.lights,{emissive:{value:new et(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:xt.meshphysical_vert,fragmentShader:xt.meshphysical_frag},toon:{uniforms:mn([Le.common,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.gradientmap,Le.fog,Le.lights,{emissive:{value:new et(0)}}]),vertexShader:xt.meshtoon_vert,fragmentShader:xt.meshtoon_frag},matcap:{uniforms:mn([Le.common,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.fog,{matcap:{value:null}}]),vertexShader:xt.meshmatcap_vert,fragmentShader:xt.meshmatcap_frag},points:{uniforms:mn([Le.points,Le.fog]),vertexShader:xt.points_vert,fragmentShader:xt.points_frag},dashed:{uniforms:mn([Le.common,Le.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:xt.linedashed_vert,fragmentShader:xt.linedashed_frag},depth:{uniforms:mn([Le.common,Le.displacementmap]),vertexShader:xt.depth_vert,fragmentShader:xt.depth_frag},normal:{uniforms:mn([Le.common,Le.bumpmap,Le.normalmap,Le.displacementmap,{opacity:{value:1}}]),vertexShader:xt.meshnormal_vert,fragmentShader:xt.meshnormal_frag},sprite:{uniforms:mn([Le.sprite,Le.fog]),vertexShader:xt.sprite_vert,fragmentShader:xt.sprite_frag},background:{uniforms:{uvTransform:{value:new _t},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:xt.background_vert,fragmentShader:xt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new _t}},vertexShader:xt.backgroundCube_vert,fragmentShader:xt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:xt.cube_vert,fragmentShader:xt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:xt.equirect_vert,fragmentShader:xt.equirect_frag},distanceRGBA:{uniforms:mn([Le.common,Le.displacementmap,{referencePosition:{value:new F},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:xt.distanceRGBA_vert,fragmentShader:xt.distanceRGBA_frag},shadow:{uniforms:mn([Le.lights,Le.fog,{color:{value:new et(0)},opacity:{value:1}}]),vertexShader:xt.shadow_vert,fragmentShader:xt.shadow_frag}};En.physical={uniforms:mn([En.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new _t},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new _t},clearcoatNormalScale:{value:new Be(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new _t},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new _t},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new _t},sheen:{value:0},sheenColor:{value:new et(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new _t},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new _t},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new _t},transmissionSamplerSize:{value:new Be},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new _t},attenuationDistance:{value:0},attenuationColor:{value:new et(0)},specularColor:{value:new et(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new _t},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new _t},anisotropyVector:{value:new Be},anisotropyMap:{value:null},anisotropyMapTransform:{value:new _t}}]),vertexShader:xt.meshphysical_vert,fragmentShader:xt.meshphysical_frag};const Hr={r:0,b:0,g:0},Bi=new _n,u1=new st;function d1(s,e,t,n,i,r,a){const o=new et(0);let l=r===!0?0:1,c,h,f=null,u=0,d=null;function m(E){let S=E.isScene===!0?E.background:null;return S&&S.isTexture&&(S=(E.backgroundBlurriness>0?t:e).get(S)),S}function _(E){let S=!1;const U=m(E);U===null?p(o,l):U&&U.isColor&&(p(U,1),S=!0);const L=s.xr.getEnvironmentBlendMode();L==="additive"?n.buffers.color.setClear(0,0,0,1,a):L==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,a),(s.autoClear||S)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),s.clear(s.autoClearColor,s.autoClearDepth,s.autoClearStencil))}function g(E,S){const U=m(S);U&&(U.isCubeTexture||U.mapping===va)?(h===void 0&&(h=new Ct(new Zi(1,1,1),new mi({name:"BackgroundCubeMaterial",uniforms:Ds(En.backgroundCube.uniforms),vertexShader:En.backgroundCube.vertexShader,fragmentShader:En.backgroundCube.fragmentShader,side:gn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(L,D,N){this.matrixWorld.copyPosition(N.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(h)),Bi.copy(S.backgroundRotation),Bi.x*=-1,Bi.y*=-1,Bi.z*=-1,U.isCubeTexture&&U.isRenderTargetTexture===!1&&(Bi.y*=-1,Bi.z*=-1),h.material.uniforms.envMap.value=U,h.material.uniforms.flipEnvMap.value=U.isCubeTexture&&U.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=S.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=S.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(u1.makeRotationFromEuler(Bi)),h.material.toneMapped=Mt.getTransfer(U.colorSpace)!==Ut,(f!==U||u!==U.version||d!==s.toneMapping)&&(h.material.needsUpdate=!0,f=U,u=U.version,d=s.toneMapping),h.layers.enableAll(),E.unshift(h,h.geometry,h.material,0,0,null)):U&&U.isTexture&&(c===void 0&&(c=new Ct(new lr(2,2),new mi({name:"BackgroundMaterial",uniforms:Ds(En.background.uniforms),vertexShader:En.background.vertexShader,fragmentShader:En.background.fragmentShader,side:Wn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(c)),c.material.uniforms.t2D.value=U,c.material.uniforms.backgroundIntensity.value=S.backgroundIntensity,c.material.toneMapped=Mt.getTransfer(U.colorSpace)!==Ut,U.matrixAutoUpdate===!0&&U.updateMatrix(),c.material.uniforms.uvTransform.value.copy(U.matrix),(f!==U||u!==U.version||d!==s.toneMapping)&&(c.material.needsUpdate=!0,f=U,u=U.version,d=s.toneMapping),c.layers.enableAll(),E.unshift(c,c.geometry,c.material,0,0,null))}function p(E,S){E.getRGB(Hr,au(s)),n.buffers.color.setClear(Hr.r,Hr.g,Hr.b,S,a)}function w(){h!==void 0&&(h.geometry.dispose(),h.material.dispose(),h=void 0),c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0)}return{getClearColor:function(){return o},setClearColor:function(E,S=1){o.set(E),l=S,p(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(E){l=E,p(o,l)},render:_,addToRenderList:g,dispose:w}}function f1(s,e){const t=s.getParameter(s.MAX_VERTEX_ATTRIBS),n={},i=u(null);let r=i,a=!1;function o(M,I,V,H,J){let ie=!1;const B=f(H,V,I);r!==B&&(r=B,c(r.object)),ie=d(M,H,V,J),ie&&m(M,H,V,J),J!==null&&e.update(J,s.ELEMENT_ARRAY_BUFFER),(ie||a)&&(a=!1,S(M,I,V,H),J!==null&&s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,e.get(J).buffer))}function l(){return s.createVertexArray()}function c(M){return s.bindVertexArray(M)}function h(M){return s.deleteVertexArray(M)}function f(M,I,V){const H=V.wireframe===!0;let J=n[M.id];J===void 0&&(J={},n[M.id]=J);let ie=J[I.id];ie===void 0&&(ie={},J[I.id]=ie);let B=ie[H];return B===void 0&&(B=u(l()),ie[H]=B),B}function u(M){const I=[],V=[],H=[];for(let J=0;J<t;J++)I[J]=0,V[J]=0,H[J]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:I,enabledAttributes:V,attributeDivisors:H,object:M,attributes:{},index:null}}function d(M,I,V,H){const J=r.attributes,ie=I.attributes;let B=0;const oe=V.getAttributes();for(const j in oe)if(oe[j].location>=0){const pe=J[j];let Me=ie[j];if(Me===void 0&&(j==="instanceMatrix"&&M.instanceMatrix&&(Me=M.instanceMatrix),j==="instanceColor"&&M.instanceColor&&(Me=M.instanceColor)),pe===void 0||pe.attribute!==Me||Me&&pe.data!==Me.data)return!0;B++}return r.attributesNum!==B||r.index!==H}function m(M,I,V,H){const J={},ie=I.attributes;let B=0;const oe=V.getAttributes();for(const j in oe)if(oe[j].location>=0){let pe=ie[j];pe===void 0&&(j==="instanceMatrix"&&M.instanceMatrix&&(pe=M.instanceMatrix),j==="instanceColor"&&M.instanceColor&&(pe=M.instanceColor));const Me={};Me.attribute=pe,pe&&pe.data&&(Me.data=pe.data),J[j]=Me,B++}r.attributes=J,r.attributesNum=B,r.index=H}function _(){const M=r.newAttributes;for(let I=0,V=M.length;I<V;I++)M[I]=0}function g(M){p(M,0)}function p(M,I){const V=r.newAttributes,H=r.enabledAttributes,J=r.attributeDivisors;V[M]=1,H[M]===0&&(s.enableVertexAttribArray(M),H[M]=1),J[M]!==I&&(s.vertexAttribDivisor(M,I),J[M]=I)}function w(){const M=r.newAttributes,I=r.enabledAttributes;for(let V=0,H=I.length;V<H;V++)I[V]!==M[V]&&(s.disableVertexAttribArray(V),I[V]=0)}function E(M,I,V,H,J,ie,B){B===!0?s.vertexAttribIPointer(M,I,V,J,ie):s.vertexAttribPointer(M,I,V,H,J,ie)}function S(M,I,V,H){_();const J=H.attributes,ie=V.getAttributes(),B=I.defaultAttributeValues;for(const oe in ie){const j=ie[oe];if(j.location>=0){let ue=J[oe];if(ue===void 0&&(oe==="instanceMatrix"&&M.instanceMatrix&&(ue=M.instanceMatrix),oe==="instanceColor"&&M.instanceColor&&(ue=M.instanceColor)),ue!==void 0){const pe=ue.normalized,Me=ue.itemSize,Ue=e.get(ue);if(Ue===void 0)continue;const Ne=Ue.buffer,Y=Ue.type,se=Ue.bytesPerElement,re=Y===s.INT||Y===s.UNSIGNED_INT||ue.gpuType===vl;if(ue.isInterleavedBufferAttribute){const le=ue.data,Ee=le.stride,fe=ue.offset;if(le.isInstancedInterleavedBuffer){for(let be=0;be<j.locationSize;be++)p(j.location+be,le.meshPerAttribute);M.isInstancedMesh!==!0&&H._maxInstanceCount===void 0&&(H._maxInstanceCount=le.meshPerAttribute*le.count)}else for(let be=0;be<j.locationSize;be++)g(j.location+be);s.bindBuffer(s.ARRAY_BUFFER,Ne);for(let be=0;be<j.locationSize;be++)E(j.location+be,Me/j.locationSize,Y,pe,Ee*se,(fe+Me/j.locationSize*be)*se,re)}else{if(ue.isInstancedBufferAttribute){for(let le=0;le<j.locationSize;le++)p(j.location+le,ue.meshPerAttribute);M.isInstancedMesh!==!0&&H._maxInstanceCount===void 0&&(H._maxInstanceCount=ue.meshPerAttribute*ue.count)}else for(let le=0;le<j.locationSize;le++)g(j.location+le);s.bindBuffer(s.ARRAY_BUFFER,Ne);for(let le=0;le<j.locationSize;le++)E(j.location+le,Me/j.locationSize,Y,pe,Me*se,Me/j.locationSize*le*se,re)}}else if(B!==void 0){const pe=B[oe];if(pe!==void 0)switch(pe.length){case 2:s.vertexAttrib2fv(j.location,pe);break;case 3:s.vertexAttrib3fv(j.location,pe);break;case 4:s.vertexAttrib4fv(j.location,pe);break;default:s.vertexAttrib1fv(j.location,pe)}}}}w()}function U(){N();for(const M in n){const I=n[M];for(const V in I){const H=I[V];for(const J in H)h(H[J].object),delete H[J];delete I[V]}delete n[M]}}function L(M){if(n[M.id]===void 0)return;const I=n[M.id];for(const V in I){const H=I[V];for(const J in H)h(H[J].object),delete H[J];delete I[V]}delete n[M.id]}function D(M){for(const I in n){const V=n[I];if(V[M.id]===void 0)continue;const H=V[M.id];for(const J in H)h(H[J].object),delete H[J];delete V[M.id]}}function N(){b(),a=!0,r!==i&&(r=i,c(r.object))}function b(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:o,reset:N,resetDefaultState:b,dispose:U,releaseStatesOfGeometry:L,releaseStatesOfProgram:D,initAttributes:_,enableAttribute:g,disableUnusedAttributes:w}}function p1(s,e,t){let n;function i(c){n=c}function r(c,h){s.drawArrays(n,c,h),t.update(h,n,1)}function a(c,h,f){f!==0&&(s.drawArraysInstanced(n,c,h,f),t.update(h,n,f))}function o(c,h,f){if(f===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(n,c,0,h,0,f);let d=0;for(let m=0;m<f;m++)d+=h[m];t.update(d,n,1)}function l(c,h,f,u){if(f===0)return;const d=e.get("WEBGL_multi_draw");if(d===null)for(let m=0;m<c.length;m++)a(c[m],h[m],u[m]);else{d.multiDrawArraysInstancedWEBGL(n,c,0,h,0,u,0,f);let m=0;for(let _=0;_<f;_++)m+=h[_]*u[_];t.update(m,n,1)}}this.setMode=i,this.render=r,this.renderInstances=a,this.renderMultiDraw=o,this.renderMultiDrawInstances=l}function m1(s,e,t,n){let i;function r(){if(i!==void 0)return i;if(e.has("EXT_texture_filter_anisotropic")===!0){const D=e.get("EXT_texture_filter_anisotropic");i=s.getParameter(D.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function a(D){return!(D!==Fn&&n.convert(D)!==s.getParameter(s.IMPLEMENTATION_COLOR_READ_FORMAT))}function o(D){const N=D===or&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(D!==ni&&n.convert(D)!==s.getParameter(s.IMPLEMENTATION_COLOR_READ_TYPE)&&D!==Qn&&!N)}function l(D){if(D==="highp"){if(s.getShaderPrecisionFormat(s.VERTEX_SHADER,s.HIGH_FLOAT).precision>0&&s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.HIGH_FLOAT).precision>0)return"highp";D="mediump"}return D==="mediump"&&s.getShaderPrecisionFormat(s.VERTEX_SHADER,s.MEDIUM_FLOAT).precision>0&&s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=t.precision!==void 0?t.precision:"highp";const h=l(c);h!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",h,"instead."),c=h);const f=t.logarithmicDepthBuffer===!0,u=t.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),d=s.getParameter(s.MAX_TEXTURE_IMAGE_UNITS),m=s.getParameter(s.MAX_VERTEX_TEXTURE_IMAGE_UNITS),_=s.getParameter(s.MAX_TEXTURE_SIZE),g=s.getParameter(s.MAX_CUBE_MAP_TEXTURE_SIZE),p=s.getParameter(s.MAX_VERTEX_ATTRIBS),w=s.getParameter(s.MAX_VERTEX_UNIFORM_VECTORS),E=s.getParameter(s.MAX_VARYING_VECTORS),S=s.getParameter(s.MAX_FRAGMENT_UNIFORM_VECTORS),U=m>0,L=s.getParameter(s.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:r,getMaxPrecision:l,textureFormatReadable:a,textureTypeReadable:o,precision:c,logarithmicDepthBuffer:f,reverseDepthBuffer:u,maxTextures:d,maxVertexTextures:m,maxTextureSize:_,maxCubemapSize:g,maxAttributes:p,maxVertexUniforms:w,maxVaryings:E,maxFragmentUniforms:S,vertexTextures:U,maxSamples:L}}function g1(s){const e=this;let t=null,n=0,i=!1,r=!1;const a=new Ai,o=new _t,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(f,u){const d=f.length!==0||u||n!==0||i;return i=u,n=f.length,d},this.beginShadows=function(){r=!0,h(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(f,u){t=h(f,u,0)},this.setState=function(f,u,d){const m=f.clippingPlanes,_=f.clipIntersection,g=f.clipShadows,p=s.get(f);if(!i||m===null||m.length===0||r&&!g)r?h(null):c();else{const w=r?0:n,E=w*4;let S=p.clippingState||null;l.value=S,S=h(m,u,E,d);for(let U=0;U!==E;++U)S[U]=t[U];p.clippingState=S,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=w}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function h(f,u,d,m){const _=f!==null?f.length:0;let g=null;if(_!==0){if(g=l.value,m!==!0||g===null){const p=d+_*4,w=u.matrixWorldInverse;o.getNormalMatrix(w),(g===null||g.length<p)&&(g=new Float32Array(p));for(let E=0,S=d;E!==_;++E,S+=4)a.copy(f[E]).applyMatrix4(w,o),a.normal.toArray(g,S),g[S+3]=a.constant}l.value=g,l.needsUpdate=!0}return e.numPlanes=_,e.numIntersection=0,g}}function _1(s){let e=new WeakMap;function t(a,o){return o===Ro?a.mapping=Cs:o===Lo&&(a.mapping=Rs),a}function n(a){if(a&&a.isTexture){const o=a.mapping;if(o===Ro||o===Lo)if(e.has(a)){const l=e.get(a).texture;return t(l,a.mapping)}else{const l=a.image;if(l&&l.height>0){const c=new Lf(l.height);return c.fromEquirectangularTexture(s,a),e.set(a,c),a.addEventListener("dispose",i),t(c.texture,a.mapping)}else return null}}return a}function i(a){const o=a.target;o.removeEventListener("dispose",i);const l=e.get(o);l!==void 0&&(e.delete(o),l.dispose())}function r(){e=new WeakMap}return{get:n,dispose:r}}const Ss=4,qc=[.125,.215,.35,.446,.526,.582],qi=20,ro=new Sa,jc=new et;let ao=null,oo=0,lo=0,co=!1;const Gi=(1+Math.sqrt(5))/2,ys=1/Gi,Yc=[new F(-Gi,ys,0),new F(Gi,ys,0),new F(-ys,0,Gi),new F(ys,0,Gi),new F(0,Gi,-ys),new F(0,Gi,ys),new F(-1,1,-1),new F(1,1,-1),new F(-1,1,1),new F(1,1,1)],v1=new F;class $c{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,i=100,r={}){const{size:a=256,position:o=v1}=r;ao=this._renderer.getRenderTarget(),oo=this._renderer.getActiveCubeFace(),lo=this._renderer.getActiveMipmapLevel(),co=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);const l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(e,n,i,l,o),t>0&&this._blur(l,0,0,t),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=Zc(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Kc(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(ao,oo,lo),this._renderer.xr.enabled=co,e.scissorTest=!1,Gr(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===Cs||e.mapping===Rs?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),ao=this._renderer.getRenderTarget(),oo=this._renderer.getActiveCubeFace(),lo=this._renderer.getActiveMipmapLevel(),co=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:Rn,minFilter:Rn,generateMipmaps:!1,type:or,format:Fn,colorSpace:Ls,depthBuffer:!1},i=Jc(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=Jc(e,t,n);const{_lodMax:r}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=x1(r)),this._blurMaterial=y1(r,e,t)}return i}_compileMaterial(e){const t=new Ct(this._lodPlanes[0],e);this._renderer.compile(t,ro)}_sceneToCubeUV(e,t,n,i,r){const l=new an(90,1,t,n),c=[1,-1,1,1,1,1],h=[1,1,1,-1,-1,-1],f=this._renderer,u=f.autoClear,d=f.toneMapping;f.getClearColor(jc),f.toneMapping=Ri,f.autoClear=!1;const m=new Pi({name:"PMREM.Background",side:gn,depthWrite:!1,depthTest:!1}),_=new Ct(new Zi,m);let g=!1;const p=e.background;p?p.isColor&&(m.color.copy(p),e.background=null,g=!0):(m.color.copy(jc),g=!0);for(let w=0;w<6;w++){const E=w%3;E===0?(l.up.set(0,c[w],0),l.position.set(r.x,r.y,r.z),l.lookAt(r.x+h[w],r.y,r.z)):E===1?(l.up.set(0,0,c[w]),l.position.set(r.x,r.y,r.z),l.lookAt(r.x,r.y+h[w],r.z)):(l.up.set(0,c[w],0),l.position.set(r.x,r.y,r.z),l.lookAt(r.x,r.y,r.z+h[w]));const S=this._cubeSize;Gr(i,E*S,w>2?S:0,S,S),f.setRenderTarget(i),g&&f.render(_,l),f.render(e,l)}_.geometry.dispose(),_.material.dispose(),f.toneMapping=d,f.autoClear=u,e.background=p}_textureToCubeUV(e,t){const n=this._renderer,i=e.mapping===Cs||e.mapping===Rs;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=Zc()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Kc());const r=i?this._cubemapMaterial:this._equirectMaterial,a=new Ct(this._lodPlanes[0],r),o=r.uniforms;o.envMap.value=e;const l=this._cubeSize;Gr(t,0,0,3*l,2*l),n.setRenderTarget(t),n.render(a,ro)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;const i=this._lodPlanes.length;for(let r=1;r<i;r++){const a=Math.sqrt(this._sigmas[r]*this._sigmas[r]-this._sigmas[r-1]*this._sigmas[r-1]),o=Yc[(i-r-1)%Yc.length];this._blur(e,r-1,r,a,o)}t.autoClear=n}_blur(e,t,n,i,r){const a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,i,"latitudinal",r),this._halfBlur(a,e,n,n,i,"longitudinal",r)}_halfBlur(e,t,n,i,r,a,o){const l=this._renderer,c=this._blurMaterial;a!=="latitudinal"&&a!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const h=3,f=new Ct(this._lodPlanes[i],c),u=c.uniforms,d=this._sizeLods[n]-1,m=isFinite(r)?Math.PI/(2*d):2*Math.PI/(2*qi-1),_=r/m,g=isFinite(r)?1+Math.floor(h*_):qi;g>qi&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${g} samples when the maximum is set to ${qi}`);const p=[];let w=0;for(let D=0;D<qi;++D){const N=D/_,b=Math.exp(-N*N/2);p.push(b),D===0?w+=b:D<g&&(w+=2*b)}for(let D=0;D<p.length;D++)p[D]=p[D]/w;u.envMap.value=e.texture,u.samples.value=g,u.weights.value=p,u.latitudinal.value=a==="latitudinal",o&&(u.poleAxis.value=o);const{_lodMax:E}=this;u.dTheta.value=m,u.mipInt.value=E-n;const S=this._sizeLods[i],U=3*S*(i>E-Ss?i-E+Ss:0),L=4*(this._cubeSize-S);Gr(t,U,L,3*S,2*S),l.setRenderTarget(t),l.render(f,ro)}}function x1(s){const e=[],t=[],n=[];let i=s;const r=s-Ss+1+qc.length;for(let a=0;a<r;a++){const o=Math.pow(2,i);t.push(o);let l=1/o;a>s-Ss?l=qc[a-s+Ss-1]:a===0&&(l=0),n.push(l);const c=1/(o-2),h=-c,f=1+c,u=[h,h,f,h,f,f,h,h,f,f,h,f],d=6,m=6,_=3,g=2,p=1,w=new Float32Array(_*m*d),E=new Float32Array(g*m*d),S=new Float32Array(p*m*d);for(let L=0;L<d;L++){const D=L%3*2/3-1,N=L>2?0:-1,b=[D,N,0,D+2/3,N,0,D+2/3,N+1,0,D,N,0,D+2/3,N+1,0,D,N+1,0];w.set(b,_*m*L),E.set(u,g*m*L);const M=[L,L,L,L,L,L];S.set(M,p*m*L)}const U=new Bt;U.setAttribute("position",new Ht(w,_)),U.setAttribute("uv",new Ht(E,g)),U.setAttribute("faceIndex",new Ht(S,p)),e.push(U),i>Ss&&i--}return{lodPlanes:e,sizeLods:t,sigmas:n}}function Jc(s,e,t){const n=new Ji(s,e,t);return n.texture.mapping=va,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Gr(s,e,t,n,i){s.viewport.set(e,t,n,i),s.scissor.set(e,t,n,i)}function y1(s,e,t){const n=new Float32Array(qi),i=new F(0,1,0);return new mi({name:"SphericalGaussianBlur",defines:{n:qi,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${s}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:kl(),fragmentShader:`
|
|
3574
|
+
}`,xt={alphahash_fragment:Dp,alphahash_pars_fragment:Np,alphamap_fragment:Up,alphamap_pars_fragment:Ip,alphatest_fragment:Fp,alphatest_pars_fragment:Op,aomap_fragment:zp,aomap_pars_fragment:Bp,batching_pars_vertex:kp,batching_vertex:Vp,begin_vertex:Hp,beginnormal_vertex:Gp,bsdfs:Wp,iridescence_fragment:Xp,bumpmap_pars_fragment:qp,clipping_planes_fragment:jp,clipping_planes_pars_fragment:Yp,clipping_planes_pars_vertex:$p,clipping_planes_vertex:Jp,color_fragment:Kp,color_pars_fragment:Zp,color_pars_vertex:Qp,color_vertex:e0,common:t0,cube_uv_reflection_fragment:n0,defaultnormal_vertex:i0,displacementmap_pars_vertex:s0,displacementmap_vertex:r0,emissivemap_fragment:a0,emissivemap_pars_fragment:o0,colorspace_fragment:l0,colorspace_pars_fragment:c0,envmap_fragment:h0,envmap_common_pars_fragment:u0,envmap_pars_fragment:d0,envmap_pars_vertex:f0,envmap_physical_pars_fragment:E0,envmap_vertex:p0,fog_vertex:m0,fog_pars_vertex:g0,fog_fragment:_0,fog_pars_fragment:v0,gradientmap_pars_fragment:x0,lightmap_pars_fragment:y0,lights_lambert_fragment:M0,lights_lambert_pars_fragment:b0,lights_pars_begin:S0,lights_toon_fragment:w0,lights_toon_pars_fragment:A0,lights_phong_fragment:T0,lights_phong_pars_fragment:C0,lights_physical_fragment:R0,lights_physical_pars_fragment:L0,lights_fragment_begin:P0,lights_fragment_maps:D0,lights_fragment_end:N0,logdepthbuf_fragment:U0,logdepthbuf_pars_fragment:I0,logdepthbuf_pars_vertex:F0,logdepthbuf_vertex:O0,map_fragment:z0,map_pars_fragment:B0,map_particle_fragment:k0,map_particle_pars_fragment:V0,metalnessmap_fragment:H0,metalnessmap_pars_fragment:G0,morphinstance_vertex:W0,morphcolor_vertex:X0,morphnormal_vertex:q0,morphtarget_pars_vertex:j0,morphtarget_vertex:Y0,normal_fragment_begin:$0,normal_fragment_maps:J0,normal_pars_fragment:K0,normal_pars_vertex:Z0,normal_vertex:Q0,normalmap_pars_fragment:em,clearcoat_normal_fragment_begin:tm,clearcoat_normal_fragment_maps:nm,clearcoat_pars_fragment:im,iridescence_pars_fragment:sm,opaque_fragment:rm,packing:am,premultiplied_alpha_fragment:om,project_vertex:lm,dithering_fragment:cm,dithering_pars_fragment:hm,roughnessmap_fragment:um,roughnessmap_pars_fragment:dm,shadowmap_pars_fragment:fm,shadowmap_pars_vertex:pm,shadowmap_vertex:mm,shadowmask_pars_fragment:gm,skinbase_vertex:_m,skinning_pars_vertex:vm,skinning_vertex:xm,skinnormal_vertex:ym,specularmap_fragment:Mm,specularmap_pars_fragment:bm,tonemapping_fragment:Sm,tonemapping_pars_fragment:Em,transmission_fragment:wm,transmission_pars_fragment:Am,uv_pars_fragment:Tm,uv_pars_vertex:Cm,uv_vertex:Rm,worldpos_vertex:Lm,background_vert:Pm,background_frag:Dm,backgroundCube_vert:Nm,backgroundCube_frag:Um,cube_vert:Im,cube_frag:Fm,depth_vert:Om,depth_frag:zm,distanceRGBA_vert:Bm,distanceRGBA_frag:km,equirect_vert:Vm,equirect_frag:Hm,linedashed_vert:Gm,linedashed_frag:Wm,meshbasic_vert:Xm,meshbasic_frag:qm,meshlambert_vert:jm,meshlambert_frag:Ym,meshmatcap_vert:$m,meshmatcap_frag:Jm,meshnormal_vert:Km,meshnormal_frag:Zm,meshphong_vert:Qm,meshphong_frag:e1,meshphysical_vert:t1,meshphysical_frag:n1,meshtoon_vert:i1,meshtoon_frag:s1,points_vert:r1,points_frag:a1,shadow_vert:o1,shadow_frag:l1,sprite_vert:c1,sprite_frag:h1},Le={common:{diffuse:{value:new et(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new _t},alphaMap:{value:null},alphaMapTransform:{value:new _t},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new _t}},envmap:{envMap:{value:null},envMapRotation:{value:new _t},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new _t}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new _t}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new _t},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new _t},normalScale:{value:new Be(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new _t},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new _t}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new _t}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new _t}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new et(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new et(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new _t},alphaTest:{value:0},uvTransform:{value:new _t}},sprite:{diffuse:{value:new et(16777215)},opacity:{value:1},center:{value:new Be(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new _t},alphaMap:{value:null},alphaMapTransform:{value:new _t},alphaTest:{value:0}}},En={basic:{uniforms:mn([Le.common,Le.specularmap,Le.envmap,Le.aomap,Le.lightmap,Le.fog]),vertexShader:xt.meshbasic_vert,fragmentShader:xt.meshbasic_frag},lambert:{uniforms:mn([Le.common,Le.specularmap,Le.envmap,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.fog,Le.lights,{emissive:{value:new et(0)}}]),vertexShader:xt.meshlambert_vert,fragmentShader:xt.meshlambert_frag},phong:{uniforms:mn([Le.common,Le.specularmap,Le.envmap,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.fog,Le.lights,{emissive:{value:new et(0)},specular:{value:new et(1118481)},shininess:{value:30}}]),vertexShader:xt.meshphong_vert,fragmentShader:xt.meshphong_frag},standard:{uniforms:mn([Le.common,Le.envmap,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.roughnessmap,Le.metalnessmap,Le.fog,Le.lights,{emissive:{value:new et(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:xt.meshphysical_vert,fragmentShader:xt.meshphysical_frag},toon:{uniforms:mn([Le.common,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.gradientmap,Le.fog,Le.lights,{emissive:{value:new et(0)}}]),vertexShader:xt.meshtoon_vert,fragmentShader:xt.meshtoon_frag},matcap:{uniforms:mn([Le.common,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.fog,{matcap:{value:null}}]),vertexShader:xt.meshmatcap_vert,fragmentShader:xt.meshmatcap_frag},points:{uniforms:mn([Le.points,Le.fog]),vertexShader:xt.points_vert,fragmentShader:xt.points_frag},dashed:{uniforms:mn([Le.common,Le.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:xt.linedashed_vert,fragmentShader:xt.linedashed_frag},depth:{uniforms:mn([Le.common,Le.displacementmap]),vertexShader:xt.depth_vert,fragmentShader:xt.depth_frag},normal:{uniforms:mn([Le.common,Le.bumpmap,Le.normalmap,Le.displacementmap,{opacity:{value:1}}]),vertexShader:xt.meshnormal_vert,fragmentShader:xt.meshnormal_frag},sprite:{uniforms:mn([Le.sprite,Le.fog]),vertexShader:xt.sprite_vert,fragmentShader:xt.sprite_frag},background:{uniforms:{uvTransform:{value:new _t},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:xt.background_vert,fragmentShader:xt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new _t}},vertexShader:xt.backgroundCube_vert,fragmentShader:xt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:xt.cube_vert,fragmentShader:xt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:xt.equirect_vert,fragmentShader:xt.equirect_frag},distanceRGBA:{uniforms:mn([Le.common,Le.displacementmap,{referencePosition:{value:new F},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:xt.distanceRGBA_vert,fragmentShader:xt.distanceRGBA_frag},shadow:{uniforms:mn([Le.lights,Le.fog,{color:{value:new et(0)},opacity:{value:1}}]),vertexShader:xt.shadow_vert,fragmentShader:xt.shadow_frag}};En.physical={uniforms:mn([En.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new _t},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new _t},clearcoatNormalScale:{value:new Be(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new _t},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new _t},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new _t},sheen:{value:0},sheenColor:{value:new et(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new _t},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new _t},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new _t},transmissionSamplerSize:{value:new Be},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new _t},attenuationDistance:{value:0},attenuationColor:{value:new et(0)},specularColor:{value:new et(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new _t},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new _t},anisotropyVector:{value:new Be},anisotropyMap:{value:null},anisotropyMapTransform:{value:new _t}}]),vertexShader:xt.meshphysical_vert,fragmentShader:xt.meshphysical_frag};const Hr={r:0,b:0,g:0},Bi=new _n,u1=new st;function d1(s,e,t,n,i,r,a){const o=new et(0);let l=r===!0?0:1,c,h,d=null,u=0,f=null;function m(E){let S=E.isScene===!0?E.background:null;return S&&S.isTexture&&(S=(E.backgroundBlurriness>0?t:e).get(S)),S}function _(E){let S=!1;const U=m(E);U===null?p(o,l):U&&U.isColor&&(p(U,1),S=!0);const L=s.xr.getEnvironmentBlendMode();L==="additive"?n.buffers.color.setClear(0,0,0,1,a):L==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,a),(s.autoClear||S)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),s.clear(s.autoClearColor,s.autoClearDepth,s.autoClearStencil))}function g(E,S){const U=m(S);U&&(U.isCubeTexture||U.mapping===va)?(h===void 0&&(h=new Ct(new Zi(1,1,1),new mi({name:"BackgroundCubeMaterial",uniforms:Ds(En.backgroundCube.uniforms),vertexShader:En.backgroundCube.vertexShader,fragmentShader:En.backgroundCube.fragmentShader,side:gn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(L,D,N){this.matrixWorld.copyPosition(N.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(h)),Bi.copy(S.backgroundRotation),Bi.x*=-1,Bi.y*=-1,Bi.z*=-1,U.isCubeTexture&&U.isRenderTargetTexture===!1&&(Bi.y*=-1,Bi.z*=-1),h.material.uniforms.envMap.value=U,h.material.uniforms.flipEnvMap.value=U.isCubeTexture&&U.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=S.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=S.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(u1.makeRotationFromEuler(Bi)),h.material.toneMapped=Mt.getTransfer(U.colorSpace)!==Ut,(d!==U||u!==U.version||f!==s.toneMapping)&&(h.material.needsUpdate=!0,d=U,u=U.version,f=s.toneMapping),h.layers.enableAll(),E.unshift(h,h.geometry,h.material,0,0,null)):U&&U.isTexture&&(c===void 0&&(c=new Ct(new lr(2,2),new mi({name:"BackgroundMaterial",uniforms:Ds(En.background.uniforms),vertexShader:En.background.vertexShader,fragmentShader:En.background.fragmentShader,side:Wn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(c)),c.material.uniforms.t2D.value=U,c.material.uniforms.backgroundIntensity.value=S.backgroundIntensity,c.material.toneMapped=Mt.getTransfer(U.colorSpace)!==Ut,U.matrixAutoUpdate===!0&&U.updateMatrix(),c.material.uniforms.uvTransform.value.copy(U.matrix),(d!==U||u!==U.version||f!==s.toneMapping)&&(c.material.needsUpdate=!0,d=U,u=U.version,f=s.toneMapping),c.layers.enableAll(),E.unshift(c,c.geometry,c.material,0,0,null))}function p(E,S){E.getRGB(Hr,au(s)),n.buffers.color.setClear(Hr.r,Hr.g,Hr.b,S,a)}function w(){h!==void 0&&(h.geometry.dispose(),h.material.dispose(),h=void 0),c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0)}return{getClearColor:function(){return o},setClearColor:function(E,S=1){o.set(E),l=S,p(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(E){l=E,p(o,l)},render:_,addToRenderList:g,dispose:w}}function f1(s,e){const t=s.getParameter(s.MAX_VERTEX_ATTRIBS),n={},i=u(null);let r=i,a=!1;function o(M,I,V,H,J){let ie=!1;const B=d(H,V,I);r!==B&&(r=B,c(r.object)),ie=f(M,H,V,J),ie&&m(M,H,V,J),J!==null&&e.update(J,s.ELEMENT_ARRAY_BUFFER),(ie||a)&&(a=!1,S(M,I,V,H),J!==null&&s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,e.get(J).buffer))}function l(){return s.createVertexArray()}function c(M){return s.bindVertexArray(M)}function h(M){return s.deleteVertexArray(M)}function d(M,I,V){const H=V.wireframe===!0;let J=n[M.id];J===void 0&&(J={},n[M.id]=J);let ie=J[I.id];ie===void 0&&(ie={},J[I.id]=ie);let B=ie[H];return B===void 0&&(B=u(l()),ie[H]=B),B}function u(M){const I=[],V=[],H=[];for(let J=0;J<t;J++)I[J]=0,V[J]=0,H[J]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:I,enabledAttributes:V,attributeDivisors:H,object:M,attributes:{},index:null}}function f(M,I,V,H){const J=r.attributes,ie=I.attributes;let B=0;const oe=V.getAttributes();for(const j in oe)if(oe[j].location>=0){const pe=J[j];let Me=ie[j];if(Me===void 0&&(j==="instanceMatrix"&&M.instanceMatrix&&(Me=M.instanceMatrix),j==="instanceColor"&&M.instanceColor&&(Me=M.instanceColor)),pe===void 0||pe.attribute!==Me||Me&&pe.data!==Me.data)return!0;B++}return r.attributesNum!==B||r.index!==H}function m(M,I,V,H){const J={},ie=I.attributes;let B=0;const oe=V.getAttributes();for(const j in oe)if(oe[j].location>=0){let pe=ie[j];pe===void 0&&(j==="instanceMatrix"&&M.instanceMatrix&&(pe=M.instanceMatrix),j==="instanceColor"&&M.instanceColor&&(pe=M.instanceColor));const Me={};Me.attribute=pe,pe&&pe.data&&(Me.data=pe.data),J[j]=Me,B++}r.attributes=J,r.attributesNum=B,r.index=H}function _(){const M=r.newAttributes;for(let I=0,V=M.length;I<V;I++)M[I]=0}function g(M){p(M,0)}function p(M,I){const V=r.newAttributes,H=r.enabledAttributes,J=r.attributeDivisors;V[M]=1,H[M]===0&&(s.enableVertexAttribArray(M),H[M]=1),J[M]!==I&&(s.vertexAttribDivisor(M,I),J[M]=I)}function w(){const M=r.newAttributes,I=r.enabledAttributes;for(let V=0,H=I.length;V<H;V++)I[V]!==M[V]&&(s.disableVertexAttribArray(V),I[V]=0)}function E(M,I,V,H,J,ie,B){B===!0?s.vertexAttribIPointer(M,I,V,J,ie):s.vertexAttribPointer(M,I,V,H,J,ie)}function S(M,I,V,H){_();const J=H.attributes,ie=V.getAttributes(),B=I.defaultAttributeValues;for(const oe in ie){const j=ie[oe];if(j.location>=0){let ue=J[oe];if(ue===void 0&&(oe==="instanceMatrix"&&M.instanceMatrix&&(ue=M.instanceMatrix),oe==="instanceColor"&&M.instanceColor&&(ue=M.instanceColor)),ue!==void 0){const pe=ue.normalized,Me=ue.itemSize,Ue=e.get(ue);if(Ue===void 0)continue;const Ne=Ue.buffer,$=Ue.type,se=Ue.bytesPerElement,re=$===s.INT||$===s.UNSIGNED_INT||ue.gpuType===vl;if(ue.isInterleavedBufferAttribute){const le=ue.data,Ee=le.stride,fe=ue.offset;if(le.isInstancedInterleavedBuffer){for(let be=0;be<j.locationSize;be++)p(j.location+be,le.meshPerAttribute);M.isInstancedMesh!==!0&&H._maxInstanceCount===void 0&&(H._maxInstanceCount=le.meshPerAttribute*le.count)}else for(let be=0;be<j.locationSize;be++)g(j.location+be);s.bindBuffer(s.ARRAY_BUFFER,Ne);for(let be=0;be<j.locationSize;be++)E(j.location+be,Me/j.locationSize,$,pe,Ee*se,(fe+Me/j.locationSize*be)*se,re)}else{if(ue.isInstancedBufferAttribute){for(let le=0;le<j.locationSize;le++)p(j.location+le,ue.meshPerAttribute);M.isInstancedMesh!==!0&&H._maxInstanceCount===void 0&&(H._maxInstanceCount=ue.meshPerAttribute*ue.count)}else for(let le=0;le<j.locationSize;le++)g(j.location+le);s.bindBuffer(s.ARRAY_BUFFER,Ne);for(let le=0;le<j.locationSize;le++)E(j.location+le,Me/j.locationSize,$,pe,Me*se,Me/j.locationSize*le*se,re)}}else if(B!==void 0){const pe=B[oe];if(pe!==void 0)switch(pe.length){case 2:s.vertexAttrib2fv(j.location,pe);break;case 3:s.vertexAttrib3fv(j.location,pe);break;case 4:s.vertexAttrib4fv(j.location,pe);break;default:s.vertexAttrib1fv(j.location,pe)}}}}w()}function U(){N();for(const M in n){const I=n[M];for(const V in I){const H=I[V];for(const J in H)h(H[J].object),delete H[J];delete I[V]}delete n[M]}}function L(M){if(n[M.id]===void 0)return;const I=n[M.id];for(const V in I){const H=I[V];for(const J in H)h(H[J].object),delete H[J];delete I[V]}delete n[M.id]}function D(M){for(const I in n){const V=n[I];if(V[M.id]===void 0)continue;const H=V[M.id];for(const J in H)h(H[J].object),delete H[J];delete V[M.id]}}function N(){b(),a=!0,r!==i&&(r=i,c(r.object))}function b(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:o,reset:N,resetDefaultState:b,dispose:U,releaseStatesOfGeometry:L,releaseStatesOfProgram:D,initAttributes:_,enableAttribute:g,disableUnusedAttributes:w}}function p1(s,e,t){let n;function i(c){n=c}function r(c,h){s.drawArrays(n,c,h),t.update(h,n,1)}function a(c,h,d){d!==0&&(s.drawArraysInstanced(n,c,h,d),t.update(h,n,d))}function o(c,h,d){if(d===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(n,c,0,h,0,d);let f=0;for(let m=0;m<d;m++)f+=h[m];t.update(f,n,1)}function l(c,h,d,u){if(d===0)return;const f=e.get("WEBGL_multi_draw");if(f===null)for(let m=0;m<c.length;m++)a(c[m],h[m],u[m]);else{f.multiDrawArraysInstancedWEBGL(n,c,0,h,0,u,0,d);let m=0;for(let _=0;_<d;_++)m+=h[_]*u[_];t.update(m,n,1)}}this.setMode=i,this.render=r,this.renderInstances=a,this.renderMultiDraw=o,this.renderMultiDrawInstances=l}function m1(s,e,t,n){let i;function r(){if(i!==void 0)return i;if(e.has("EXT_texture_filter_anisotropic")===!0){const D=e.get("EXT_texture_filter_anisotropic");i=s.getParameter(D.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function a(D){return!(D!==Fn&&n.convert(D)!==s.getParameter(s.IMPLEMENTATION_COLOR_READ_FORMAT))}function o(D){const N=D===or&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(D!==ni&&n.convert(D)!==s.getParameter(s.IMPLEMENTATION_COLOR_READ_TYPE)&&D!==Qn&&!N)}function l(D){if(D==="highp"){if(s.getShaderPrecisionFormat(s.VERTEX_SHADER,s.HIGH_FLOAT).precision>0&&s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.HIGH_FLOAT).precision>0)return"highp";D="mediump"}return D==="mediump"&&s.getShaderPrecisionFormat(s.VERTEX_SHADER,s.MEDIUM_FLOAT).precision>0&&s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=t.precision!==void 0?t.precision:"highp";const h=l(c);h!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",h,"instead."),c=h);const d=t.logarithmicDepthBuffer===!0,u=t.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),f=s.getParameter(s.MAX_TEXTURE_IMAGE_UNITS),m=s.getParameter(s.MAX_VERTEX_TEXTURE_IMAGE_UNITS),_=s.getParameter(s.MAX_TEXTURE_SIZE),g=s.getParameter(s.MAX_CUBE_MAP_TEXTURE_SIZE),p=s.getParameter(s.MAX_VERTEX_ATTRIBS),w=s.getParameter(s.MAX_VERTEX_UNIFORM_VECTORS),E=s.getParameter(s.MAX_VARYING_VECTORS),S=s.getParameter(s.MAX_FRAGMENT_UNIFORM_VECTORS),U=m>0,L=s.getParameter(s.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:r,getMaxPrecision:l,textureFormatReadable:a,textureTypeReadable:o,precision:c,logarithmicDepthBuffer:d,reverseDepthBuffer:u,maxTextures:f,maxVertexTextures:m,maxTextureSize:_,maxCubemapSize:g,maxAttributes:p,maxVertexUniforms:w,maxVaryings:E,maxFragmentUniforms:S,vertexTextures:U,maxSamples:L}}function g1(s){const e=this;let t=null,n=0,i=!1,r=!1;const a=new Ai,o=new _t,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(d,u){const f=d.length!==0||u||n!==0||i;return i=u,n=d.length,f},this.beginShadows=function(){r=!0,h(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(d,u){t=h(d,u,0)},this.setState=function(d,u,f){const m=d.clippingPlanes,_=d.clipIntersection,g=d.clipShadows,p=s.get(d);if(!i||m===null||m.length===0||r&&!g)r?h(null):c();else{const w=r?0:n,E=w*4;let S=p.clippingState||null;l.value=S,S=h(m,u,E,f);for(let U=0;U!==E;++U)S[U]=t[U];p.clippingState=S,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=w}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function h(d,u,f,m){const _=d!==null?d.length:0;let g=null;if(_!==0){if(g=l.value,m!==!0||g===null){const p=f+_*4,w=u.matrixWorldInverse;o.getNormalMatrix(w),(g===null||g.length<p)&&(g=new Float32Array(p));for(let E=0,S=f;E!==_;++E,S+=4)a.copy(d[E]).applyMatrix4(w,o),a.normal.toArray(g,S),g[S+3]=a.constant}l.value=g,l.needsUpdate=!0}return e.numPlanes=_,e.numIntersection=0,g}}function _1(s){let e=new WeakMap;function t(a,o){return o===Ro?a.mapping=Cs:o===Lo&&(a.mapping=Rs),a}function n(a){if(a&&a.isTexture){const o=a.mapping;if(o===Ro||o===Lo)if(e.has(a)){const l=e.get(a).texture;return t(l,a.mapping)}else{const l=a.image;if(l&&l.height>0){const c=new Lf(l.height);return c.fromEquirectangularTexture(s,a),e.set(a,c),a.addEventListener("dispose",i),t(c.texture,a.mapping)}else return null}}return a}function i(a){const o=a.target;o.removeEventListener("dispose",i);const l=e.get(o);l!==void 0&&(e.delete(o),l.dispose())}function r(){e=new WeakMap}return{get:n,dispose:r}}const Ss=4,qc=[.125,.215,.35,.446,.526,.582],qi=20,ro=new Sa,jc=new et;let ao=null,oo=0,lo=0,co=!1;const Gi=(1+Math.sqrt(5))/2,ys=1/Gi,Yc=[new F(-Gi,ys,0),new F(Gi,ys,0),new F(-ys,0,Gi),new F(ys,0,Gi),new F(0,Gi,-ys),new F(0,Gi,ys),new F(-1,1,-1),new F(1,1,-1),new F(-1,1,1),new F(1,1,1)],v1=new F;class $c{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,i=100,r={}){const{size:a=256,position:o=v1}=r;ao=this._renderer.getRenderTarget(),oo=this._renderer.getActiveCubeFace(),lo=this._renderer.getActiveMipmapLevel(),co=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);const l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(e,n,i,l,o),t>0&&this._blur(l,0,0,t),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=Zc(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Kc(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(ao,oo,lo),this._renderer.xr.enabled=co,e.scissorTest=!1,Gr(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===Cs||e.mapping===Rs?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),ao=this._renderer.getRenderTarget(),oo=this._renderer.getActiveCubeFace(),lo=this._renderer.getActiveMipmapLevel(),co=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:Rn,minFilter:Rn,generateMipmaps:!1,type:or,format:Fn,colorSpace:Ls,depthBuffer:!1},i=Jc(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=Jc(e,t,n);const{_lodMax:r}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=x1(r)),this._blurMaterial=y1(r,e,t)}return i}_compileMaterial(e){const t=new Ct(this._lodPlanes[0],e);this._renderer.compile(t,ro)}_sceneToCubeUV(e,t,n,i,r){const l=new an(90,1,t,n),c=[1,-1,1,1,1,1],h=[1,1,1,-1,-1,-1],d=this._renderer,u=d.autoClear,f=d.toneMapping;d.getClearColor(jc),d.toneMapping=Ri,d.autoClear=!1;const m=new Pi({name:"PMREM.Background",side:gn,depthWrite:!1,depthTest:!1}),_=new Ct(new Zi,m);let g=!1;const p=e.background;p?p.isColor&&(m.color.copy(p),e.background=null,g=!0):(m.color.copy(jc),g=!0);for(let w=0;w<6;w++){const E=w%3;E===0?(l.up.set(0,c[w],0),l.position.set(r.x,r.y,r.z),l.lookAt(r.x+h[w],r.y,r.z)):E===1?(l.up.set(0,0,c[w]),l.position.set(r.x,r.y,r.z),l.lookAt(r.x,r.y+h[w],r.z)):(l.up.set(0,c[w],0),l.position.set(r.x,r.y,r.z),l.lookAt(r.x,r.y,r.z+h[w]));const S=this._cubeSize;Gr(i,E*S,w>2?S:0,S,S),d.setRenderTarget(i),g&&d.render(_,l),d.render(e,l)}_.geometry.dispose(),_.material.dispose(),d.toneMapping=f,d.autoClear=u,e.background=p}_textureToCubeUV(e,t){const n=this._renderer,i=e.mapping===Cs||e.mapping===Rs;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=Zc()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Kc());const r=i?this._cubemapMaterial:this._equirectMaterial,a=new Ct(this._lodPlanes[0],r),o=r.uniforms;o.envMap.value=e;const l=this._cubeSize;Gr(t,0,0,3*l,2*l),n.setRenderTarget(t),n.render(a,ro)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;const i=this._lodPlanes.length;for(let r=1;r<i;r++){const a=Math.sqrt(this._sigmas[r]*this._sigmas[r]-this._sigmas[r-1]*this._sigmas[r-1]),o=Yc[(i-r-1)%Yc.length];this._blur(e,r-1,r,a,o)}t.autoClear=n}_blur(e,t,n,i,r){const a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,i,"latitudinal",r),this._halfBlur(a,e,n,n,i,"longitudinal",r)}_halfBlur(e,t,n,i,r,a,o){const l=this._renderer,c=this._blurMaterial;a!=="latitudinal"&&a!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const h=3,d=new Ct(this._lodPlanes[i],c),u=c.uniforms,f=this._sizeLods[n]-1,m=isFinite(r)?Math.PI/(2*f):2*Math.PI/(2*qi-1),_=r/m,g=isFinite(r)?1+Math.floor(h*_):qi;g>qi&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${g} samples when the maximum is set to ${qi}`);const p=[];let w=0;for(let D=0;D<qi;++D){const N=D/_,b=Math.exp(-N*N/2);p.push(b),D===0?w+=b:D<g&&(w+=2*b)}for(let D=0;D<p.length;D++)p[D]=p[D]/w;u.envMap.value=e.texture,u.samples.value=g,u.weights.value=p,u.latitudinal.value=a==="latitudinal",o&&(u.poleAxis.value=o);const{_lodMax:E}=this;u.dTheta.value=m,u.mipInt.value=E-n;const S=this._sizeLods[i],U=3*S*(i>E-Ss?i-E+Ss:0),L=4*(this._cubeSize-S);Gr(t,U,L,3*S,2*S),l.setRenderTarget(t),l.render(d,ro)}}function x1(s){const e=[],t=[],n=[];let i=s;const r=s-Ss+1+qc.length;for(let a=0;a<r;a++){const o=Math.pow(2,i);t.push(o);let l=1/o;a>s-Ss?l=qc[a-s+Ss-1]:a===0&&(l=0),n.push(l);const c=1/(o-2),h=-c,d=1+c,u=[h,h,d,h,d,d,h,h,d,d,h,d],f=6,m=6,_=3,g=2,p=1,w=new Float32Array(_*m*f),E=new Float32Array(g*m*f),S=new Float32Array(p*m*f);for(let L=0;L<f;L++){const D=L%3*2/3-1,N=L>2?0:-1,b=[D,N,0,D+2/3,N,0,D+2/3,N+1,0,D,N,0,D+2/3,N+1,0,D,N+1,0];w.set(b,_*m*L),E.set(u,g*m*L);const M=[L,L,L,L,L,L];S.set(M,p*m*L)}const U=new Bt;U.setAttribute("position",new Ht(w,_)),U.setAttribute("uv",new Ht(E,g)),U.setAttribute("faceIndex",new Ht(S,p)),e.push(U),i>Ss&&i--}return{lodPlanes:e,sizeLods:t,sigmas:n}}function Jc(s,e,t){const n=new Ji(s,e,t);return n.texture.mapping=va,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Gr(s,e,t,n,i){s.viewport.set(e,t,n,i),s.scissor.set(e,t,n,i)}function y1(s,e,t){const n=new Float32Array(qi),i=new F(0,1,0);return new mi({name:"SphericalGaussianBlur",defines:{n:qi,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${s}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:kl(),fragmentShader:`
|
|
3575
3575
|
|
|
3576
3576
|
precision mediump float;
|
|
3577
3577
|
precision mediump int;
|
|
@@ -3721,7 +3721,7 @@ void main() {
|
|
|
3721
3721
|
gl_Position = vec4( position, 1.0 );
|
|
3722
3722
|
|
|
3723
3723
|
}
|
|
3724
|
-
`}function M1(s){let e=new WeakMap,t=null;function n(o){if(o&&o.isTexture){const l=o.mapping,c=l===Ro||l===Lo,h=l===Cs||l===Rs;if(c||h){let f=e.get(o);const u=f!==void 0?f.texture.pmremVersion:0;if(o.isRenderTargetTexture&&o.pmremVersion!==u)return t===null&&(t=new $c(s)),f=c?t.fromEquirectangular(o,f):t.fromCubemap(o,f),f.texture.pmremVersion=o.pmremVersion,e.set(o,f),f.texture;if(f!==void 0)return f.texture;{const d=o.image;return c&&d&&d.height>0||h&&d&&i(d)?(t===null&&(t=new $c(s)),f=c?t.fromEquirectangular(o):t.fromCubemap(o),f.texture.pmremVersion=o.pmremVersion,e.set(o,f),o.addEventListener("dispose",r),f.texture):null}}}return o}function i(o){let l=0;const c=6;for(let h=0;h<c;h++)o[h]!==void 0&&l++;return l===c}function r(o){const l=o.target;l.removeEventListener("dispose",r);const c=e.get(l);c!==void 0&&(e.delete(l),c.dispose())}function a(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:n,dispose:a}}function b1(s){const e={};function t(n){if(e[n]!==void 0)return e[n];let i;switch(n){case"WEBGL_depth_texture":i=s.getExtension("WEBGL_depth_texture")||s.getExtension("MOZ_WEBGL_depth_texture")||s.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=s.getExtension("EXT_texture_filter_anisotropic")||s.getExtension("MOZ_EXT_texture_filter_anisotropic")||s.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=s.getExtension("WEBGL_compressed_texture_s3tc")||s.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||s.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=s.getExtension("WEBGL_compressed_texture_pvrtc")||s.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=s.getExtension(n)}return e[n]=i,i}return{has:function(n){return t(n)!==null},init:function(){t("EXT_color_buffer_float"),t("WEBGL_clip_cull_distance"),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture"),t("WEBGL_render_shared_exponent")},get:function(n){const i=t(n);return i===null&&ws("THREE.WebGLRenderer: "+n+" extension not supported."),i}}}function S1(s,e,t,n){const i={},r=new WeakMap;function a(f){const u=f.target;u.index!==null&&e.remove(u.index);for(const m in u.attributes)e.remove(u.attributes[m]);u.removeEventListener("dispose",a),delete i[u.id];const d=r.get(u);d&&(e.remove(d),r.delete(u)),n.releaseStatesOfGeometry(u),u.isInstancedBufferGeometry===!0&&delete u._maxInstanceCount,t.memory.geometries--}function o(f,u){return i[u.id]===!0||(u.addEventListener("dispose",a),i[u.id]=!0,t.memory.geometries++),u}function l(f){const u=f.attributes;for(const d in u)e.update(u[d],s.ARRAY_BUFFER)}function c(f){const u=[],d=f.index,m=f.attributes.position;let _=0;if(d!==null){const w=d.array;_=d.version;for(let E=0,S=w.length;E<S;E+=3){const U=w[E+0],L=w[E+1],D=w[E+2];u.push(U,L,L,D,D,U)}}else if(m!==void 0){const w=m.array;_=m.version;for(let E=0,S=w.length/3-1;E<S;E+=3){const U=E+0,L=E+1,D=E+2;u.push(U,L,L,D,D,U)}}else return;const g=new(tu(u)?ru:su)(u,1);g.version=_;const p=r.get(f);p&&e.remove(p),r.set(f,g)}function h(f){const u=r.get(f);if(u){const d=f.index;d!==null&&u.version<d.version&&c(f)}else c(f);return r.get(f)}return{get:o,update:l,getWireframeAttribute:h}}function E1(s,e,t){let n;function i(u){n=u}let r,a;function o(u){r=u.type,a=u.bytesPerElement}function l(u,d){s.drawElements(n,d,r,u*a),t.update(d,n,1)}function c(u,d,m){m!==0&&(s.drawElementsInstanced(n,d,r,u*a,m),t.update(d,n,m))}function h(u,d,m){if(m===0)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(n,d,0,r,u,0,m);let g=0;for(let p=0;p<m;p++)g+=d[p];t.update(g,n,1)}function f(u,d,m,_){if(m===0)return;const g=e.get("WEBGL_multi_draw");if(g===null)for(let p=0;p<u.length;p++)c(u[p]/a,d[p],_[p]);else{g.multiDrawElementsInstancedWEBGL(n,d,0,r,u,0,_,0,m);let p=0;for(let w=0;w<m;w++)p+=d[w]*_[w];t.update(p,n,1)}}this.setMode=i,this.setIndex=o,this.render=l,this.renderInstances=c,this.renderMultiDraw=h,this.renderMultiDrawInstances=f}function w1(s){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function n(r,a,o){switch(t.calls++,a){case s.TRIANGLES:t.triangles+=o*(r/3);break;case s.LINES:t.lines+=o*(r/2);break;case s.LINE_STRIP:t.lines+=o*(r-1);break;case s.LINE_LOOP:t.lines+=o*r;break;case s.POINTS:t.points+=o*r;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",a);break}}function i(){t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:i,update:n}}function A1(s,e,t){const n=new WeakMap,i=new bt;function r(a,o,l){const c=a.morphTargetInfluences,h=o.morphAttributes.position||o.morphAttributes.normal||o.morphAttributes.color,f=h!==void 0?h.length:0;let u=n.get(o);if(u===void 0||u.count!==f){let b=function(){D.dispose(),n.delete(o),o.removeEventListener("dispose",b)};u!==void 0&&u.texture.dispose();const d=o.morphAttributes.position!==void 0,m=o.morphAttributes.normal!==void 0,_=o.morphAttributes.color!==void 0,g=o.morphAttributes.position||[],p=o.morphAttributes.normal||[],w=o.morphAttributes.color||[];let E=0;d===!0&&(E=1),m===!0&&(E=2),_===!0&&(E=3);let S=o.attributes.position.count*E,U=1;S>e.maxTextureSize&&(U=Math.ceil(S/e.maxTextureSize),S=e.maxTextureSize);const L=new Float32Array(S*U*4*f),D=new nu(L,S,U,f);D.type=Qn,D.needsUpdate=!0;const N=E*4;for(let M=0;M<f;M++){const I=g[M],V=p[M],H=w[M],J=S*U*4*M;for(let ie=0;ie<I.count;ie++){const B=ie*N;d===!0&&(i.fromBufferAttribute(I,ie),L[J+B+0]=i.x,L[J+B+1]=i.y,L[J+B+2]=i.z,L[J+B+3]=0),m===!0&&(i.fromBufferAttribute(V,ie),L[J+B+4]=i.x,L[J+B+5]=i.y,L[J+B+6]=i.z,L[J+B+7]=0),_===!0&&(i.fromBufferAttribute(H,ie),L[J+B+8]=i.x,L[J+B+9]=i.y,L[J+B+10]=i.z,L[J+B+11]=H.itemSize===4?i.w:1)}}u={count:f,texture:D,size:new Be(S,U)},n.set(o,u),o.addEventListener("dispose",b)}if(a.isInstancedMesh===!0&&a.morphTexture!==null)l.getUniforms().setValue(s,"morphTexture",a.morphTexture,t);else{let d=0;for(let _=0;_<c.length;_++)d+=c[_];const m=o.morphTargetsRelative?1:1-d;l.getUniforms().setValue(s,"morphTargetBaseInfluence",m),l.getUniforms().setValue(s,"morphTargetInfluences",c)}l.getUniforms().setValue(s,"morphTargetsTexture",u.texture,t),l.getUniforms().setValue(s,"morphTargetsTextureSize",u.size)}return{update:r}}function T1(s,e,t,n){let i=new WeakMap;function r(l){const c=n.render.frame,h=l.geometry,f=e.get(l,h);if(i.get(f)!==c&&(e.update(f),i.set(f,c)),l.isInstancedMesh&&(l.hasEventListener("dispose",o)===!1&&l.addEventListener("dispose",o),i.get(l)!==c&&(t.update(l.instanceMatrix,s.ARRAY_BUFFER),l.instanceColor!==null&&t.update(l.instanceColor,s.ARRAY_BUFFER),i.set(l,c))),l.isSkinnedMesh){const u=l.skeleton;i.get(u)!==c&&(u.update(),i.set(u,c))}return f}function a(){i=new WeakMap}function o(l){const c=l.target;c.removeEventListener("dispose",o),t.remove(c.instanceMatrix),c.instanceColor!==null&&t.remove(c.instanceColor)}return{update:r,dispose:a}}const Eu=new on,Qc=new fu(1,1),wu=new nu,Au=new ff,Tu=new lu,eh=[],th=[],nh=new Float32Array(16),ih=new Float32Array(9),sh=new Float32Array(4);function zs(s,e,t){const n=s[0];if(n<=0||n>0)return s;const i=e*t;let r=eh[i];if(r===void 0&&(r=new Float32Array(i),eh[i]=r),e!==0){n.toArray(r,0);for(let a=1,o=0;a!==e;++a)o+=t,s[a].toArray(r,o)}return r}function Kt(s,e){if(s.length!==e.length)return!1;for(let t=0,n=s.length;t<n;t++)if(s[t]!==e[t])return!1;return!0}function Zt(s,e){for(let t=0,n=e.length;t<n;t++)s[t]=e[t]}function Ea(s,e){let t=th[e];t===void 0&&(t=new Int32Array(e),th[e]=t);for(let n=0;n!==e;++n)t[n]=s.allocateTextureUnit();return t}function C1(s,e){const t=this.cache;t[0]!==e&&(s.uniform1f(this.addr,e),t[0]=e)}function R1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(s.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Kt(t,e))return;s.uniform2fv(this.addr,e),Zt(t,e)}}function L1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(s.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(s.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(Kt(t,e))return;s.uniform3fv(this.addr,e),Zt(t,e)}}function P1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(s.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Kt(t,e))return;s.uniform4fv(this.addr,e),Zt(t,e)}}function D1(s,e){const t=this.cache,n=e.elements;if(n===void 0){if(Kt(t,e))return;s.uniformMatrix2fv(this.addr,!1,e),Zt(t,e)}else{if(Kt(t,n))return;sh.set(n),s.uniformMatrix2fv(this.addr,!1,sh),Zt(t,n)}}function N1(s,e){const t=this.cache,n=e.elements;if(n===void 0){if(Kt(t,e))return;s.uniformMatrix3fv(this.addr,!1,e),Zt(t,e)}else{if(Kt(t,n))return;ih.set(n),s.uniformMatrix3fv(this.addr,!1,ih),Zt(t,n)}}function U1(s,e){const t=this.cache,n=e.elements;if(n===void 0){if(Kt(t,e))return;s.uniformMatrix4fv(this.addr,!1,e),Zt(t,e)}else{if(Kt(t,n))return;nh.set(n),s.uniformMatrix4fv(this.addr,!1,nh),Zt(t,n)}}function I1(s,e){const t=this.cache;t[0]!==e&&(s.uniform1i(this.addr,e),t[0]=e)}function F1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(s.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Kt(t,e))return;s.uniform2iv(this.addr,e),Zt(t,e)}}function O1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(s.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(Kt(t,e))return;s.uniform3iv(this.addr,e),Zt(t,e)}}function z1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(s.uniform4i(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Kt(t,e))return;s.uniform4iv(this.addr,e),Zt(t,e)}}function B1(s,e){const t=this.cache;t[0]!==e&&(s.uniform1ui(this.addr,e),t[0]=e)}function k1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(s.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Kt(t,e))return;s.uniform2uiv(this.addr,e),Zt(t,e)}}function V1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(s.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(Kt(t,e))return;s.uniform3uiv(this.addr,e),Zt(t,e)}}function H1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(s.uniform4ui(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Kt(t,e))return;s.uniform4uiv(this.addr,e),Zt(t,e)}}function G1(s,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(s.uniform1i(this.addr,i),n[0]=i);let r;this.type===s.SAMPLER_2D_SHADOW?(Qc.compareFunction=eu,r=Qc):r=Eu,t.setTexture2D(e||r,i)}function W1(s,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(s.uniform1i(this.addr,i),n[0]=i),t.setTexture3D(e||Au,i)}function X1(s,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(s.uniform1i(this.addr,i),n[0]=i),t.setTextureCube(e||Tu,i)}function q1(s,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(s.uniform1i(this.addr,i),n[0]=i),t.setTexture2DArray(e||wu,i)}function j1(s){switch(s){case 5126:return C1;case 35664:return R1;case 35665:return L1;case 35666:return P1;case 35674:return D1;case 35675:return N1;case 35676:return U1;case 5124:case 35670:return I1;case 35667:case 35671:return F1;case 35668:case 35672:return O1;case 35669:case 35673:return z1;case 5125:return B1;case 36294:return k1;case 36295:return V1;case 36296:return H1;case 35678:case 36198:case 36298:case 36306:case 35682:return G1;case 35679:case 36299:case 36307:return W1;case 35680:case 36300:case 36308:case 36293:return X1;case 36289:case 36303:case 36311:case 36292:return q1}}function Y1(s,e){s.uniform1fv(this.addr,e)}function $1(s,e){const t=zs(e,this.size,2);s.uniform2fv(this.addr,t)}function J1(s,e){const t=zs(e,this.size,3);s.uniform3fv(this.addr,t)}function K1(s,e){const t=zs(e,this.size,4);s.uniform4fv(this.addr,t)}function Z1(s,e){const t=zs(e,this.size,4);s.uniformMatrix2fv(this.addr,!1,t)}function Q1(s,e){const t=zs(e,this.size,9);s.uniformMatrix3fv(this.addr,!1,t)}function e2(s,e){const t=zs(e,this.size,16);s.uniformMatrix4fv(this.addr,!1,t)}function t2(s,e){s.uniform1iv(this.addr,e)}function n2(s,e){s.uniform2iv(this.addr,e)}function i2(s,e){s.uniform3iv(this.addr,e)}function s2(s,e){s.uniform4iv(this.addr,e)}function r2(s,e){s.uniform1uiv(this.addr,e)}function a2(s,e){s.uniform2uiv(this.addr,e)}function o2(s,e){s.uniform3uiv(this.addr,e)}function l2(s,e){s.uniform4uiv(this.addr,e)}function c2(s,e,t){const n=this.cache,i=e.length,r=Ea(t,i);Kt(n,r)||(s.uniform1iv(this.addr,r),Zt(n,r));for(let a=0;a!==i;++a)t.setTexture2D(e[a]||Eu,r[a])}function h2(s,e,t){const n=this.cache,i=e.length,r=Ea(t,i);Kt(n,r)||(s.uniform1iv(this.addr,r),Zt(n,r));for(let a=0;a!==i;++a)t.setTexture3D(e[a]||Au,r[a])}function u2(s,e,t){const n=this.cache,i=e.length,r=Ea(t,i);Kt(n,r)||(s.uniform1iv(this.addr,r),Zt(n,r));for(let a=0;a!==i;++a)t.setTextureCube(e[a]||Tu,r[a])}function d2(s,e,t){const n=this.cache,i=e.length,r=Ea(t,i);Kt(n,r)||(s.uniform1iv(this.addr,r),Zt(n,r));for(let a=0;a!==i;++a)t.setTexture2DArray(e[a]||wu,r[a])}function f2(s){switch(s){case 5126:return Y1;case 35664:return $1;case 35665:return J1;case 35666:return K1;case 35674:return Z1;case 35675:return Q1;case 35676:return e2;case 5124:case 35670:return t2;case 35667:case 35671:return n2;case 35668:case 35672:return i2;case 35669:case 35673:return s2;case 5125:return r2;case 36294:return a2;case 36295:return o2;case 36296:return l2;case 35678:case 36198:case 36298:case 36306:case 35682:return c2;case 35679:case 36299:case 36307:return h2;case 35680:case 36300:case 36308:case 36293:return u2;case 36289:case 36303:case 36311:case 36292:return d2}}class p2{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=j1(t.type)}}class m2{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=f2(t.type)}}class g2{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const i=this.seq;for(let r=0,a=i.length;r!==a;++r){const o=i[r];o.setValue(e,t[o.id],n)}}}const ho=/(\w+)(\])?(\[|\.)?/g;function rh(s,e){s.seq.push(e),s.map[e.id]=e}function _2(s,e,t){const n=s.name,i=n.length;for(ho.lastIndex=0;;){const r=ho.exec(n),a=ho.lastIndex;let o=r[1];const l=r[2]==="]",c=r[3];if(l&&(o=o|0),c===void 0||c==="["&&a+2===i){rh(t,c===void 0?new p2(o,s,e):new m2(o,s,e));break}else{let f=t.map[o];f===void 0&&(f=new g2(o),rh(t,f)),t=f}}}class ra{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let i=0;i<n;++i){const r=e.getActiveUniform(t,i),a=e.getUniformLocation(t,r.name);_2(r,a,this)}}setValue(e,t,n,i){const r=this.map[t];r!==void 0&&r.setValue(e,n,i)}setOptional(e,t,n){const i=t[n];i!==void 0&&this.setValue(e,n,i)}static upload(e,t,n,i){for(let r=0,a=t.length;r!==a;++r){const o=t[r],l=n[o.id];l.needsUpdate!==!1&&o.setValue(e,l.value,i)}}static seqWithValue(e,t){const n=[];for(let i=0,r=e.length;i!==r;++i){const a=e[i];a.id in t&&n.push(a)}return n}}function ah(s,e,t){const n=s.createShader(e);return s.shaderSource(n,t),s.compileShader(n),n}const v2=37297;let x2=0;function y2(s,e){const t=s.split(`
|
|
3724
|
+
`}function M1(s){let e=new WeakMap,t=null;function n(o){if(o&&o.isTexture){const l=o.mapping,c=l===Ro||l===Lo,h=l===Cs||l===Rs;if(c||h){let d=e.get(o);const u=d!==void 0?d.texture.pmremVersion:0;if(o.isRenderTargetTexture&&o.pmremVersion!==u)return t===null&&(t=new $c(s)),d=c?t.fromEquirectangular(o,d):t.fromCubemap(o,d),d.texture.pmremVersion=o.pmremVersion,e.set(o,d),d.texture;if(d!==void 0)return d.texture;{const f=o.image;return c&&f&&f.height>0||h&&f&&i(f)?(t===null&&(t=new $c(s)),d=c?t.fromEquirectangular(o):t.fromCubemap(o),d.texture.pmremVersion=o.pmremVersion,e.set(o,d),o.addEventListener("dispose",r),d.texture):null}}}return o}function i(o){let l=0;const c=6;for(let h=0;h<c;h++)o[h]!==void 0&&l++;return l===c}function r(o){const l=o.target;l.removeEventListener("dispose",r);const c=e.get(l);c!==void 0&&(e.delete(l),c.dispose())}function a(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:n,dispose:a}}function b1(s){const e={};function t(n){if(e[n]!==void 0)return e[n];let i;switch(n){case"WEBGL_depth_texture":i=s.getExtension("WEBGL_depth_texture")||s.getExtension("MOZ_WEBGL_depth_texture")||s.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=s.getExtension("EXT_texture_filter_anisotropic")||s.getExtension("MOZ_EXT_texture_filter_anisotropic")||s.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=s.getExtension("WEBGL_compressed_texture_s3tc")||s.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||s.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=s.getExtension("WEBGL_compressed_texture_pvrtc")||s.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=s.getExtension(n)}return e[n]=i,i}return{has:function(n){return t(n)!==null},init:function(){t("EXT_color_buffer_float"),t("WEBGL_clip_cull_distance"),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture"),t("WEBGL_render_shared_exponent")},get:function(n){const i=t(n);return i===null&&ws("THREE.WebGLRenderer: "+n+" extension not supported."),i}}}function S1(s,e,t,n){const i={},r=new WeakMap;function a(d){const u=d.target;u.index!==null&&e.remove(u.index);for(const m in u.attributes)e.remove(u.attributes[m]);u.removeEventListener("dispose",a),delete i[u.id];const f=r.get(u);f&&(e.remove(f),r.delete(u)),n.releaseStatesOfGeometry(u),u.isInstancedBufferGeometry===!0&&delete u._maxInstanceCount,t.memory.geometries--}function o(d,u){return i[u.id]===!0||(u.addEventListener("dispose",a),i[u.id]=!0,t.memory.geometries++),u}function l(d){const u=d.attributes;for(const f in u)e.update(u[f],s.ARRAY_BUFFER)}function c(d){const u=[],f=d.index,m=d.attributes.position;let _=0;if(f!==null){const w=f.array;_=f.version;for(let E=0,S=w.length;E<S;E+=3){const U=w[E+0],L=w[E+1],D=w[E+2];u.push(U,L,L,D,D,U)}}else if(m!==void 0){const w=m.array;_=m.version;for(let E=0,S=w.length/3-1;E<S;E+=3){const U=E+0,L=E+1,D=E+2;u.push(U,L,L,D,D,U)}}else return;const g=new(tu(u)?ru:su)(u,1);g.version=_;const p=r.get(d);p&&e.remove(p),r.set(d,g)}function h(d){const u=r.get(d);if(u){const f=d.index;f!==null&&u.version<f.version&&c(d)}else c(d);return r.get(d)}return{get:o,update:l,getWireframeAttribute:h}}function E1(s,e,t){let n;function i(u){n=u}let r,a;function o(u){r=u.type,a=u.bytesPerElement}function l(u,f){s.drawElements(n,f,r,u*a),t.update(f,n,1)}function c(u,f,m){m!==0&&(s.drawElementsInstanced(n,f,r,u*a,m),t.update(f,n,m))}function h(u,f,m){if(m===0)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(n,f,0,r,u,0,m);let g=0;for(let p=0;p<m;p++)g+=f[p];t.update(g,n,1)}function d(u,f,m,_){if(m===0)return;const g=e.get("WEBGL_multi_draw");if(g===null)for(let p=0;p<u.length;p++)c(u[p]/a,f[p],_[p]);else{g.multiDrawElementsInstancedWEBGL(n,f,0,r,u,0,_,0,m);let p=0;for(let w=0;w<m;w++)p+=f[w]*_[w];t.update(p,n,1)}}this.setMode=i,this.setIndex=o,this.render=l,this.renderInstances=c,this.renderMultiDraw=h,this.renderMultiDrawInstances=d}function w1(s){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function n(r,a,o){switch(t.calls++,a){case s.TRIANGLES:t.triangles+=o*(r/3);break;case s.LINES:t.lines+=o*(r/2);break;case s.LINE_STRIP:t.lines+=o*(r-1);break;case s.LINE_LOOP:t.lines+=o*r;break;case s.POINTS:t.points+=o*r;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",a);break}}function i(){t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:i,update:n}}function A1(s,e,t){const n=new WeakMap,i=new bt;function r(a,o,l){const c=a.morphTargetInfluences,h=o.morphAttributes.position||o.morphAttributes.normal||o.morphAttributes.color,d=h!==void 0?h.length:0;let u=n.get(o);if(u===void 0||u.count!==d){let b=function(){D.dispose(),n.delete(o),o.removeEventListener("dispose",b)};u!==void 0&&u.texture.dispose();const f=o.morphAttributes.position!==void 0,m=o.morphAttributes.normal!==void 0,_=o.morphAttributes.color!==void 0,g=o.morphAttributes.position||[],p=o.morphAttributes.normal||[],w=o.morphAttributes.color||[];let E=0;f===!0&&(E=1),m===!0&&(E=2),_===!0&&(E=3);let S=o.attributes.position.count*E,U=1;S>e.maxTextureSize&&(U=Math.ceil(S/e.maxTextureSize),S=e.maxTextureSize);const L=new Float32Array(S*U*4*d),D=new nu(L,S,U,d);D.type=Qn,D.needsUpdate=!0;const N=E*4;for(let M=0;M<d;M++){const I=g[M],V=p[M],H=w[M],J=S*U*4*M;for(let ie=0;ie<I.count;ie++){const B=ie*N;f===!0&&(i.fromBufferAttribute(I,ie),L[J+B+0]=i.x,L[J+B+1]=i.y,L[J+B+2]=i.z,L[J+B+3]=0),m===!0&&(i.fromBufferAttribute(V,ie),L[J+B+4]=i.x,L[J+B+5]=i.y,L[J+B+6]=i.z,L[J+B+7]=0),_===!0&&(i.fromBufferAttribute(H,ie),L[J+B+8]=i.x,L[J+B+9]=i.y,L[J+B+10]=i.z,L[J+B+11]=H.itemSize===4?i.w:1)}}u={count:d,texture:D,size:new Be(S,U)},n.set(o,u),o.addEventListener("dispose",b)}if(a.isInstancedMesh===!0&&a.morphTexture!==null)l.getUniforms().setValue(s,"morphTexture",a.morphTexture,t);else{let f=0;for(let _=0;_<c.length;_++)f+=c[_];const m=o.morphTargetsRelative?1:1-f;l.getUniforms().setValue(s,"morphTargetBaseInfluence",m),l.getUniforms().setValue(s,"morphTargetInfluences",c)}l.getUniforms().setValue(s,"morphTargetsTexture",u.texture,t),l.getUniforms().setValue(s,"morphTargetsTextureSize",u.size)}return{update:r}}function T1(s,e,t,n){let i=new WeakMap;function r(l){const c=n.render.frame,h=l.geometry,d=e.get(l,h);if(i.get(d)!==c&&(e.update(d),i.set(d,c)),l.isInstancedMesh&&(l.hasEventListener("dispose",o)===!1&&l.addEventListener("dispose",o),i.get(l)!==c&&(t.update(l.instanceMatrix,s.ARRAY_BUFFER),l.instanceColor!==null&&t.update(l.instanceColor,s.ARRAY_BUFFER),i.set(l,c))),l.isSkinnedMesh){const u=l.skeleton;i.get(u)!==c&&(u.update(),i.set(u,c))}return d}function a(){i=new WeakMap}function o(l){const c=l.target;c.removeEventListener("dispose",o),t.remove(c.instanceMatrix),c.instanceColor!==null&&t.remove(c.instanceColor)}return{update:r,dispose:a}}const Eu=new on,Qc=new fu(1,1),wu=new nu,Au=new ff,Tu=new lu,eh=[],th=[],nh=new Float32Array(16),ih=new Float32Array(9),sh=new Float32Array(4);function zs(s,e,t){const n=s[0];if(n<=0||n>0)return s;const i=e*t;let r=eh[i];if(r===void 0&&(r=new Float32Array(i),eh[i]=r),e!==0){n.toArray(r,0);for(let a=1,o=0;a!==e;++a)o+=t,s[a].toArray(r,o)}return r}function Kt(s,e){if(s.length!==e.length)return!1;for(let t=0,n=s.length;t<n;t++)if(s[t]!==e[t])return!1;return!0}function Zt(s,e){for(let t=0,n=e.length;t<n;t++)s[t]=e[t]}function Ea(s,e){let t=th[e];t===void 0&&(t=new Int32Array(e),th[e]=t);for(let n=0;n!==e;++n)t[n]=s.allocateTextureUnit();return t}function C1(s,e){const t=this.cache;t[0]!==e&&(s.uniform1f(this.addr,e),t[0]=e)}function R1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(s.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Kt(t,e))return;s.uniform2fv(this.addr,e),Zt(t,e)}}function L1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(s.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(s.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(Kt(t,e))return;s.uniform3fv(this.addr,e),Zt(t,e)}}function P1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(s.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Kt(t,e))return;s.uniform4fv(this.addr,e),Zt(t,e)}}function D1(s,e){const t=this.cache,n=e.elements;if(n===void 0){if(Kt(t,e))return;s.uniformMatrix2fv(this.addr,!1,e),Zt(t,e)}else{if(Kt(t,n))return;sh.set(n),s.uniformMatrix2fv(this.addr,!1,sh),Zt(t,n)}}function N1(s,e){const t=this.cache,n=e.elements;if(n===void 0){if(Kt(t,e))return;s.uniformMatrix3fv(this.addr,!1,e),Zt(t,e)}else{if(Kt(t,n))return;ih.set(n),s.uniformMatrix3fv(this.addr,!1,ih),Zt(t,n)}}function U1(s,e){const t=this.cache,n=e.elements;if(n===void 0){if(Kt(t,e))return;s.uniformMatrix4fv(this.addr,!1,e),Zt(t,e)}else{if(Kt(t,n))return;nh.set(n),s.uniformMatrix4fv(this.addr,!1,nh),Zt(t,n)}}function I1(s,e){const t=this.cache;t[0]!==e&&(s.uniform1i(this.addr,e),t[0]=e)}function F1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(s.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Kt(t,e))return;s.uniform2iv(this.addr,e),Zt(t,e)}}function O1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(s.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(Kt(t,e))return;s.uniform3iv(this.addr,e),Zt(t,e)}}function z1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(s.uniform4i(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Kt(t,e))return;s.uniform4iv(this.addr,e),Zt(t,e)}}function B1(s,e){const t=this.cache;t[0]!==e&&(s.uniform1ui(this.addr,e),t[0]=e)}function k1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(s.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Kt(t,e))return;s.uniform2uiv(this.addr,e),Zt(t,e)}}function V1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(s.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(Kt(t,e))return;s.uniform3uiv(this.addr,e),Zt(t,e)}}function H1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(s.uniform4ui(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Kt(t,e))return;s.uniform4uiv(this.addr,e),Zt(t,e)}}function G1(s,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(s.uniform1i(this.addr,i),n[0]=i);let r;this.type===s.SAMPLER_2D_SHADOW?(Qc.compareFunction=eu,r=Qc):r=Eu,t.setTexture2D(e||r,i)}function W1(s,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(s.uniform1i(this.addr,i),n[0]=i),t.setTexture3D(e||Au,i)}function X1(s,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(s.uniform1i(this.addr,i),n[0]=i),t.setTextureCube(e||Tu,i)}function q1(s,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(s.uniform1i(this.addr,i),n[0]=i),t.setTexture2DArray(e||wu,i)}function j1(s){switch(s){case 5126:return C1;case 35664:return R1;case 35665:return L1;case 35666:return P1;case 35674:return D1;case 35675:return N1;case 35676:return U1;case 5124:case 35670:return I1;case 35667:case 35671:return F1;case 35668:case 35672:return O1;case 35669:case 35673:return z1;case 5125:return B1;case 36294:return k1;case 36295:return V1;case 36296:return H1;case 35678:case 36198:case 36298:case 36306:case 35682:return G1;case 35679:case 36299:case 36307:return W1;case 35680:case 36300:case 36308:case 36293:return X1;case 36289:case 36303:case 36311:case 36292:return q1}}function Y1(s,e){s.uniform1fv(this.addr,e)}function $1(s,e){const t=zs(e,this.size,2);s.uniform2fv(this.addr,t)}function J1(s,e){const t=zs(e,this.size,3);s.uniform3fv(this.addr,t)}function K1(s,e){const t=zs(e,this.size,4);s.uniform4fv(this.addr,t)}function Z1(s,e){const t=zs(e,this.size,4);s.uniformMatrix2fv(this.addr,!1,t)}function Q1(s,e){const t=zs(e,this.size,9);s.uniformMatrix3fv(this.addr,!1,t)}function e2(s,e){const t=zs(e,this.size,16);s.uniformMatrix4fv(this.addr,!1,t)}function t2(s,e){s.uniform1iv(this.addr,e)}function n2(s,e){s.uniform2iv(this.addr,e)}function i2(s,e){s.uniform3iv(this.addr,e)}function s2(s,e){s.uniform4iv(this.addr,e)}function r2(s,e){s.uniform1uiv(this.addr,e)}function a2(s,e){s.uniform2uiv(this.addr,e)}function o2(s,e){s.uniform3uiv(this.addr,e)}function l2(s,e){s.uniform4uiv(this.addr,e)}function c2(s,e,t){const n=this.cache,i=e.length,r=Ea(t,i);Kt(n,r)||(s.uniform1iv(this.addr,r),Zt(n,r));for(let a=0;a!==i;++a)t.setTexture2D(e[a]||Eu,r[a])}function h2(s,e,t){const n=this.cache,i=e.length,r=Ea(t,i);Kt(n,r)||(s.uniform1iv(this.addr,r),Zt(n,r));for(let a=0;a!==i;++a)t.setTexture3D(e[a]||Au,r[a])}function u2(s,e,t){const n=this.cache,i=e.length,r=Ea(t,i);Kt(n,r)||(s.uniform1iv(this.addr,r),Zt(n,r));for(let a=0;a!==i;++a)t.setTextureCube(e[a]||Tu,r[a])}function d2(s,e,t){const n=this.cache,i=e.length,r=Ea(t,i);Kt(n,r)||(s.uniform1iv(this.addr,r),Zt(n,r));for(let a=0;a!==i;++a)t.setTexture2DArray(e[a]||wu,r[a])}function f2(s){switch(s){case 5126:return Y1;case 35664:return $1;case 35665:return J1;case 35666:return K1;case 35674:return Z1;case 35675:return Q1;case 35676:return e2;case 5124:case 35670:return t2;case 35667:case 35671:return n2;case 35668:case 35672:return i2;case 35669:case 35673:return s2;case 5125:return r2;case 36294:return a2;case 36295:return o2;case 36296:return l2;case 35678:case 36198:case 36298:case 36306:case 35682:return c2;case 35679:case 36299:case 36307:return h2;case 35680:case 36300:case 36308:case 36293:return u2;case 36289:case 36303:case 36311:case 36292:return d2}}class p2{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=j1(t.type)}}class m2{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=f2(t.type)}}class g2{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const i=this.seq;for(let r=0,a=i.length;r!==a;++r){const o=i[r];o.setValue(e,t[o.id],n)}}}const ho=/(\w+)(\])?(\[|\.)?/g;function rh(s,e){s.seq.push(e),s.map[e.id]=e}function _2(s,e,t){const n=s.name,i=n.length;for(ho.lastIndex=0;;){const r=ho.exec(n),a=ho.lastIndex;let o=r[1];const l=r[2]==="]",c=r[3];if(l&&(o=o|0),c===void 0||c==="["&&a+2===i){rh(t,c===void 0?new p2(o,s,e):new m2(o,s,e));break}else{let d=t.map[o];d===void 0&&(d=new g2(o),rh(t,d)),t=d}}}class ra{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let i=0;i<n;++i){const r=e.getActiveUniform(t,i),a=e.getUniformLocation(t,r.name);_2(r,a,this)}}setValue(e,t,n,i){const r=this.map[t];r!==void 0&&r.setValue(e,n,i)}setOptional(e,t,n){const i=t[n];i!==void 0&&this.setValue(e,n,i)}static upload(e,t,n,i){for(let r=0,a=t.length;r!==a;++r){const o=t[r],l=n[o.id];l.needsUpdate!==!1&&o.setValue(e,l.value,i)}}static seqWithValue(e,t){const n=[];for(let i=0,r=e.length;i!==r;++i){const a=e[i];a.id in t&&n.push(a)}return n}}function ah(s,e,t){const n=s.createShader(e);return s.shaderSource(n,t),s.compileShader(n),n}const v2=37297;let x2=0;function y2(s,e){const t=s.split(`
|
|
3725
3725
|
`),n=[],i=Math.max(e-6,0),r=Math.min(e+6,t.length);for(let a=i;a<r;a++){const o=a+1;n.push(`${o===e?">":" "} ${o}: ${t[a]}`)}return n.join(`
|
|
3726
3726
|
`)}const oh=new _t;function M2(s){Mt._getMatrix(oh,Mt.workingColorSpace,s);const e=`mat3( ${oh.elements.map(t=>t.toFixed(4))} )`;switch(Mt.getTransfer(s)){case ha:return[e,"LinearTransferOETF"];case Ut:return[e,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",s),[e,"LinearTransferOETF"]}}function lh(s,e,t){const n=s.getShaderParameter(e,s.COMPILE_STATUS),i=s.getShaderInfoLog(e).trim();if(n&&i==="")return"";const r=/ERROR: 0:(\d+)/.exec(i);if(r){const a=parseInt(r[1]);return t.toUpperCase()+`
|
|
3727
3727
|
|
|
@@ -3751,17 +3751,17 @@ void main() {
|
|
|
3751
3751
|
`;return s.precision==="highp"?e+=`
|
|
3752
3752
|
#define HIGH_PRECISION`:s.precision==="mediump"?e+=`
|
|
3753
3753
|
#define MEDIUM_PRECISION`:s.precision==="lowp"&&(e+=`
|
|
3754
|
-
#define LOW_PRECISION`),e}function N2(s){let e="SHADOWMAP_TYPE_BASIC";return s.shadowMapType===Hh?e="SHADOWMAP_TYPE_PCF":s.shadowMapType===Gh?e="SHADOWMAP_TYPE_PCF_SOFT":s.shadowMapType===ui&&(e="SHADOWMAP_TYPE_VSM"),e}function U2(s){let e="ENVMAP_TYPE_CUBE";if(s.envMap)switch(s.envMapMode){case Cs:case Rs:e="ENVMAP_TYPE_CUBE";break;case va:e="ENVMAP_TYPE_CUBE_UV";break}return e}function I2(s){let e="ENVMAP_MODE_REFLECTION";if(s.envMap)switch(s.envMapMode){case Rs:e="ENVMAP_MODE_REFRACTION";break}return e}function F2(s){let e="ENVMAP_BLENDING_NONE";if(s.envMap)switch(s.combine){case _a:e="ENVMAP_BLENDING_MULTIPLY";break;case yd:e="ENVMAP_BLENDING_MIX";break;case Md:e="ENVMAP_BLENDING_ADD";break}return e}function O2(s){const e=s.envMapCubeUVHeight;if(e===null)return null;const t=Math.log2(e)-2,n=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),7*16)),texelHeight:n,maxMip:t}}function z2(s,e,t,n){const i=s.getContext(),r=t.defines;let a=t.vertexShader,o=t.fragmentShader;const l=N2(t),c=U2(t),h=I2(t),
|
|
3754
|
+
#define LOW_PRECISION`),e}function N2(s){let e="SHADOWMAP_TYPE_BASIC";return s.shadowMapType===Hh?e="SHADOWMAP_TYPE_PCF":s.shadowMapType===Gh?e="SHADOWMAP_TYPE_PCF_SOFT":s.shadowMapType===ui&&(e="SHADOWMAP_TYPE_VSM"),e}function U2(s){let e="ENVMAP_TYPE_CUBE";if(s.envMap)switch(s.envMapMode){case Cs:case Rs:e="ENVMAP_TYPE_CUBE";break;case va:e="ENVMAP_TYPE_CUBE_UV";break}return e}function I2(s){let e="ENVMAP_MODE_REFLECTION";if(s.envMap)switch(s.envMapMode){case Rs:e="ENVMAP_MODE_REFRACTION";break}return e}function F2(s){let e="ENVMAP_BLENDING_NONE";if(s.envMap)switch(s.combine){case _a:e="ENVMAP_BLENDING_MULTIPLY";break;case yd:e="ENVMAP_BLENDING_MIX";break;case Md:e="ENVMAP_BLENDING_ADD";break}return e}function O2(s){const e=s.envMapCubeUVHeight;if(e===null)return null;const t=Math.log2(e)-2,n=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),7*16)),texelHeight:n,maxMip:t}}function z2(s,e,t,n){const i=s.getContext(),r=t.defines;let a=t.vertexShader,o=t.fragmentShader;const l=N2(t),c=U2(t),h=I2(t),d=F2(t),u=O2(t),f=w2(t),m=A2(r),_=i.createProgram();let g,p,w=t.glslVersion?"#version "+t.glslVersion+`
|
|
3755
3755
|
`:"";t.isRawShaderMaterial?(g=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,m].filter($s).join(`
|
|
3756
3756
|
`),g.length>0&&(g+=`
|
|
3757
3757
|
`),p=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,m].filter($s).join(`
|
|
3758
3758
|
`),p.length>0&&(p+=`
|
|
3759
3759
|
`)):(g=[dh(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,m,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.batchingColor?"#define USE_BATCHING_COLOR":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+h:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",`
|
|
3760
3760
|
`].filter($s).join(`
|
|
3761
|
-
`),p=[dh(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,m,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+h:"",t.envMap?"#define "+
|
|
3761
|
+
`),p=[dh(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,m,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+h:"",t.envMap?"#define "+d:"",u?"#define CUBEUV_TEXEL_WIDTH "+u.texelWidth:"",u?"#define CUBEUV_TEXEL_HEIGHT "+u.texelHeight:"",u?"#define CUBEUV_MAX_MIP "+u.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor||t.batchingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Ri?"#define TONE_MAPPING":"",t.toneMapping!==Ri?xt.tonemapping_pars_fragment:"",t.toneMapping!==Ri?S2("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",xt.colorspace_pars_fragment,b2("linearToOutputTexel",t.outputColorSpace),E2(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",`
|
|
3762
3762
|
`].filter($s).join(`
|
|
3763
3763
|
`)),a=cl(a),a=ch(a,t),a=hh(a,t),o=cl(o),o=ch(o,t),o=hh(o,t),a=uh(a),o=uh(o),t.isRawShaderMaterial!==!0&&(w=`#version 300 es
|
|
3764
|
-
`,g=[
|
|
3764
|
+
`,g=[f,"#define attribute in","#define varying out","#define texture2D texture"].join(`
|
|
3765
3765
|
`)+`
|
|
3766
3766
|
`+g,p=["#define varying in",t.glslVersion===ec?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===ec?"":"#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(`
|
|
3767
3767
|
`)+`
|
|
@@ -3772,7 +3772,7 @@ Material Type: `+I.type+`
|
|
|
3772
3772
|
|
|
3773
3773
|
Program Info Log: `+V+`
|
|
3774
3774
|
`+oe+`
|
|
3775
|
-
`+j)}else V!==""?console.warn("THREE.WebGLProgram: Program Info Log:",V):(H===""||J==="")&&(B=!1);B&&(I.diagnostics={runnable:ie,programLog:V,vertexShader:{log:H,prefix:g},fragmentShader:{log:J,prefix:p}})}i.deleteShader(U),i.deleteShader(L),N=new ra(i,_),b=T2(i,_)}let N;this.getUniforms=function(){return N===void 0&&D(this),N};let b;this.getAttributes=function(){return b===void 0&&D(this),b};let M=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return M===!1&&(M=i.getProgramParameter(_,v2)),M},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(_),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=x2++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=U,this.fragmentShader=L,this}let B2=0;class k2{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,i=this._getShaderStage(t),r=this._getShaderStage(n),a=this._getShaderCacheForMaterial(e);return a.has(i)===!1&&(a.add(i),i.usedTimes++),a.has(r)===!1&&(a.add(r),r.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return n===void 0&&(n=new V2(e),t.set(e,n)),n}}class V2{constructor(e){this.id=B2++,this.code=e,this.usedTimes=0}}function H2(s,e,t,n,i,r,a){const o=new Al,l=new k2,c=new Set,h=[],f=i.logarithmicDepthBuffer,u=i.vertexTextures;let d=i.precision;const m={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function _(b){return c.add(b),b===0?"uv":`uv${b}`}function g(b,M,I,V,H){const J=V.fog,ie=H.geometry,B=b.isMeshStandardMaterial?V.environment:null,oe=(b.isMeshStandardMaterial?t:e).get(b.envMap||B),j=oe&&oe.mapping===va?oe.image.height:null,ue=m[b.type];b.precision!==null&&(d=i.getMaxPrecision(b.precision),d!==b.precision&&console.warn("THREE.WebGLProgram.getParameters:",b.precision,"not supported, using",d,"instead."));const pe=ie.morphAttributes.position||ie.morphAttributes.normal||ie.morphAttributes.color,Me=pe!==void 0?pe.length:0;let Ue=0;ie.morphAttributes.position!==void 0&&(Ue=1),ie.morphAttributes.normal!==void 0&&(Ue=2),ie.morphAttributes.color!==void 0&&(Ue=3);let Ne,Y,se,re;if(ue){const pt=En[ue];Ne=pt.vertexShader,Y=pt.fragmentShader}else Ne=b.vertexShader,Y=b.fragmentShader,l.update(b),se=l.getVertexShaderID(b),re=l.getFragmentShaderID(b);const le=s.getRenderTarget(),Ee=s.state.buffers.depth.getReversed(),fe=H.isInstancedMesh===!0,be=H.isBatchedMesh===!0,Je=!!b.map,at=!!b.matcap,it=!!oe,z=!!b.aoMap,yt=!!b.lightMap,dt=!!b.bumpMap,ot=!!b.normalMap,W=!!b.displacementMap,ae=!!b.emissiveMap,ne=!!b.metalnessMap,ye=!!b.roughnessMap,Oe=b.anisotropy>0,T=b.clearcoat>0,y=b.dispersion>0,k=b.iridescence>0,K=b.sheen>0,Q=b.transmission>0,O=Oe&&!!b.anisotropyMap,we=T&&!!b.clearcoatMap,xe=T&&!!b.clearcoatNormalMap,Se=T&&!!b.clearcoatRoughnessMap,Ie=k&&!!b.iridescenceMap,de=k&&!!b.iridescenceThicknessMap,Pe=K&&!!b.sheenColorMap,qe=K&&!!b.sheenRoughnessMap,ke=!!b.specularMap,Ae=!!b.specularColorMap,rt=!!b.specularIntensityMap,G=Q&&!!b.transmissionMap,De=Q&&!!b.thicknessMap,ge=!!b.gradientMap,ze=!!b.alphaMap,ve=b.alphaTest>0,he=!!b.alphaHash,Ge=!!b.extensions;let lt=Ri;b.toneMapped&&(le===null||le.isXRRenderTarget===!0)&&(lt=s.toneMapping);const Lt={shaderID:ue,shaderType:b.type,shaderName:b.name,vertexShader:Ne,fragmentShader:Y,defines:b.defines,customVertexShaderID:se,customFragmentShaderID:re,isRawShaderMaterial:b.isRawShaderMaterial===!0,glslVersion:b.glslVersion,precision:d,batching:be,batchingColor:be&&H._colorsTexture!==null,instancing:fe,instancingColor:fe&&H.instanceColor!==null,instancingMorph:fe&&H.morphTexture!==null,supportsVertexTextures:u,outputColorSpace:le===null?s.outputColorSpace:le.isXRRenderTarget===!0?le.texture.colorSpace:Ls,alphaToCoverage:!!b.alphaToCoverage,map:Je,matcap:at,envMap:it,envMapMode:it&&oe.mapping,envMapCubeUVHeight:j,aoMap:z,lightMap:yt,bumpMap:dt,normalMap:ot,displacementMap:u&&W,emissiveMap:ae,normalMapObjectSpace:ot&&b.normalMapType===Nd,normalMapTangentSpace:ot&&b.normalMapType===xa,metalnessMap:ne,roughnessMap:ye,anisotropy:Oe,anisotropyMap:O,clearcoat:T,clearcoatMap:we,clearcoatNormalMap:xe,clearcoatRoughnessMap:Se,dispersion:y,iridescence:k,iridescenceMap:Ie,iridescenceThicknessMap:de,sheen:K,sheenColorMap:Pe,sheenRoughnessMap:qe,specularMap:ke,specularColorMap:Ae,specularIntensityMap:rt,transmission:Q,transmissionMap:G,thicknessMap:De,gradientMap:ge,opaque:b.transparent===!1&&b.blending===Es&&b.alphaToCoverage===!1,alphaMap:ze,alphaTest:ve,alphaHash:he,combine:b.combine,mapUv:Je&&_(b.map.channel),aoMapUv:z&&_(b.aoMap.channel),lightMapUv:yt&&_(b.lightMap.channel),bumpMapUv:dt&&_(b.bumpMap.channel),normalMapUv:ot&&_(b.normalMap.channel),displacementMapUv:W&&_(b.displacementMap.channel),emissiveMapUv:ae&&_(b.emissiveMap.channel),metalnessMapUv:ne&&_(b.metalnessMap.channel),roughnessMapUv:ye&&_(b.roughnessMap.channel),anisotropyMapUv:O&&_(b.anisotropyMap.channel),clearcoatMapUv:we&&_(b.clearcoatMap.channel),clearcoatNormalMapUv:xe&&_(b.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Se&&_(b.clearcoatRoughnessMap.channel),iridescenceMapUv:Ie&&_(b.iridescenceMap.channel),iridescenceThicknessMapUv:de&&_(b.iridescenceThicknessMap.channel),sheenColorMapUv:Pe&&_(b.sheenColorMap.channel),sheenRoughnessMapUv:qe&&_(b.sheenRoughnessMap.channel),specularMapUv:ke&&_(b.specularMap.channel),specularColorMapUv:Ae&&_(b.specularColorMap.channel),specularIntensityMapUv:rt&&_(b.specularIntensityMap.channel),transmissionMapUv:G&&_(b.transmissionMap.channel),thicknessMapUv:De&&_(b.thicknessMap.channel),alphaMapUv:ze&&_(b.alphaMap.channel),vertexTangents:!!ie.attributes.tangent&&(ot||Oe),vertexColors:b.vertexColors,vertexAlphas:b.vertexColors===!0&&!!ie.attributes.color&&ie.attributes.color.itemSize===4,pointsUvs:H.isPoints===!0&&!!ie.attributes.uv&&(Je||ze),fog:!!J,useFog:b.fog===!0,fogExp2:!!J&&J.isFogExp2,flatShading:b.flatShading===!0,sizeAttenuation:b.sizeAttenuation===!0,logarithmicDepthBuffer:f,reverseDepthBuffer:Ee,skinning:H.isSkinnedMesh===!0,morphTargets:ie.morphAttributes.position!==void 0,morphNormals:ie.morphAttributes.normal!==void 0,morphColors:ie.morphAttributes.color!==void 0,morphTargetsCount:Me,morphTextureStride:Ue,numDirLights:M.directional.length,numPointLights:M.point.length,numSpotLights:M.spot.length,numSpotLightMaps:M.spotLightMap.length,numRectAreaLights:M.rectArea.length,numHemiLights:M.hemi.length,numDirLightShadows:M.directionalShadowMap.length,numPointLightShadows:M.pointShadowMap.length,numSpotLightShadows:M.spotShadowMap.length,numSpotLightShadowsWithMaps:M.numSpotLightShadowsWithMaps,numLightProbes:M.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:b.dithering,shadowMapEnabled:s.shadowMap.enabled&&I.length>0,shadowMapType:s.shadowMap.type,toneMapping:lt,decodeVideoTexture:Je&&b.map.isVideoTexture===!0&&Mt.getTransfer(b.map.colorSpace)===Ut,decodeVideoTextureEmissive:ae&&b.emissiveMap.isVideoTexture===!0&&Mt.getTransfer(b.emissiveMap.colorSpace)===Ut,premultipliedAlpha:b.premultipliedAlpha,doubleSided:b.side===un,flipSided:b.side===gn,useDepthPacking:b.depthPacking>=0,depthPacking:b.depthPacking||0,index0AttributeName:b.index0AttributeName,extensionClipCullDistance:Ge&&b.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Ge&&b.extensions.multiDraw===!0||be)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:b.customProgramCacheKey()};return Lt.vertexUv1s=c.has(1),Lt.vertexUv2s=c.has(2),Lt.vertexUv3s=c.has(3),c.clear(),Lt}function p(b){const M=[];if(b.shaderID?M.push(b.shaderID):(M.push(b.customVertexShaderID),M.push(b.customFragmentShaderID)),b.defines!==void 0)for(const I in b.defines)M.push(I),M.push(b.defines[I]);return b.isRawShaderMaterial===!1&&(w(M,b),E(M,b),M.push(s.outputColorSpace)),M.push(b.customProgramCacheKey),M.join()}function w(b,M){b.push(M.precision),b.push(M.outputColorSpace),b.push(M.envMapMode),b.push(M.envMapCubeUVHeight),b.push(M.mapUv),b.push(M.alphaMapUv),b.push(M.lightMapUv),b.push(M.aoMapUv),b.push(M.bumpMapUv),b.push(M.normalMapUv),b.push(M.displacementMapUv),b.push(M.emissiveMapUv),b.push(M.metalnessMapUv),b.push(M.roughnessMapUv),b.push(M.anisotropyMapUv),b.push(M.clearcoatMapUv),b.push(M.clearcoatNormalMapUv),b.push(M.clearcoatRoughnessMapUv),b.push(M.iridescenceMapUv),b.push(M.iridescenceThicknessMapUv),b.push(M.sheenColorMapUv),b.push(M.sheenRoughnessMapUv),b.push(M.specularMapUv),b.push(M.specularColorMapUv),b.push(M.specularIntensityMapUv),b.push(M.transmissionMapUv),b.push(M.thicknessMapUv),b.push(M.combine),b.push(M.fogExp2),b.push(M.sizeAttenuation),b.push(M.morphTargetsCount),b.push(M.morphAttributeCount),b.push(M.numDirLights),b.push(M.numPointLights),b.push(M.numSpotLights),b.push(M.numSpotLightMaps),b.push(M.numHemiLights),b.push(M.numRectAreaLights),b.push(M.numDirLightShadows),b.push(M.numPointLightShadows),b.push(M.numSpotLightShadows),b.push(M.numSpotLightShadowsWithMaps),b.push(M.numLightProbes),b.push(M.shadowMapType),b.push(M.toneMapping),b.push(M.numClippingPlanes),b.push(M.numClipIntersection),b.push(M.depthPacking)}function E(b,M){o.disableAll(),M.supportsVertexTextures&&o.enable(0),M.instancing&&o.enable(1),M.instancingColor&&o.enable(2),M.instancingMorph&&o.enable(3),M.matcap&&o.enable(4),M.envMap&&o.enable(5),M.normalMapObjectSpace&&o.enable(6),M.normalMapTangentSpace&&o.enable(7),M.clearcoat&&o.enable(8),M.iridescence&&o.enable(9),M.alphaTest&&o.enable(10),M.vertexColors&&o.enable(11),M.vertexAlphas&&o.enable(12),M.vertexUv1s&&o.enable(13),M.vertexUv2s&&o.enable(14),M.vertexUv3s&&o.enable(15),M.vertexTangents&&o.enable(16),M.anisotropy&&o.enable(17),M.alphaHash&&o.enable(18),M.batching&&o.enable(19),M.dispersion&&o.enable(20),M.batchingColor&&o.enable(21),b.push(o.mask),o.disableAll(),M.fog&&o.enable(0),M.useFog&&o.enable(1),M.flatShading&&o.enable(2),M.logarithmicDepthBuffer&&o.enable(3),M.reverseDepthBuffer&&o.enable(4),M.skinning&&o.enable(5),M.morphTargets&&o.enable(6),M.morphNormals&&o.enable(7),M.morphColors&&o.enable(8),M.premultipliedAlpha&&o.enable(9),M.shadowMapEnabled&&o.enable(10),M.doubleSided&&o.enable(11),M.flipSided&&o.enable(12),M.useDepthPacking&&o.enable(13),M.dithering&&o.enable(14),M.transmission&&o.enable(15),M.sheen&&o.enable(16),M.opaque&&o.enable(17),M.pointsUvs&&o.enable(18),M.decodeVideoTexture&&o.enable(19),M.decodeVideoTextureEmissive&&o.enable(20),M.alphaToCoverage&&o.enable(21),b.push(o.mask)}function S(b){const M=m[b.type];let I;if(M){const V=En[M];I=Tl.clone(V.uniforms)}else I=b.uniforms;return I}function U(b,M){let I;for(let V=0,H=h.length;V<H;V++){const J=h[V];if(J.cacheKey===M){I=J,++I.usedTimes;break}}return I===void 0&&(I=new z2(s,M,b,r),h.push(I)),I}function L(b){if(--b.usedTimes===0){const M=h.indexOf(b);h[M]=h[h.length-1],h.pop(),b.destroy()}}function D(b){l.remove(b)}function N(){l.dispose()}return{getParameters:g,getProgramCacheKey:p,getUniforms:S,acquireProgram:U,releaseProgram:L,releaseShaderCache:D,programs:h,dispose:N}}function G2(){let s=new WeakMap;function e(a){return s.has(a)}function t(a){let o=s.get(a);return o===void 0&&(o={},s.set(a,o)),o}function n(a){s.delete(a)}function i(a,o,l){s.get(a)[o]=l}function r(){s=new WeakMap}return{has:e,get:t,remove:n,update:i,dispose:r}}function W2(s,e){return s.groupOrder!==e.groupOrder?s.groupOrder-e.groupOrder:s.renderOrder!==e.renderOrder?s.renderOrder-e.renderOrder:s.material.id!==e.material.id?s.material.id-e.material.id:s.z!==e.z?s.z-e.z:s.id-e.id}function fh(s,e){return s.groupOrder!==e.groupOrder?s.groupOrder-e.groupOrder:s.renderOrder!==e.renderOrder?s.renderOrder-e.renderOrder:s.z!==e.z?e.z-s.z:s.id-e.id}function ph(){const s=[];let e=0;const t=[],n=[],i=[];function r(){e=0,t.length=0,n.length=0,i.length=0}function a(f,u,d,m,_,g){let p=s[e];return p===void 0?(p={id:f.id,object:f,geometry:u,material:d,groupOrder:m,renderOrder:f.renderOrder,z:_,group:g},s[e]=p):(p.id=f.id,p.object=f,p.geometry=u,p.material=d,p.groupOrder=m,p.renderOrder=f.renderOrder,p.z=_,p.group=g),e++,p}function o(f,u,d,m,_,g){const p=a(f,u,d,m,_,g);d.transmission>0?n.push(p):d.transparent===!0?i.push(p):t.push(p)}function l(f,u,d,m,_,g){const p=a(f,u,d,m,_,g);d.transmission>0?n.unshift(p):d.transparent===!0?i.unshift(p):t.unshift(p)}function c(f,u){t.length>1&&t.sort(f||W2),n.length>1&&n.sort(u||fh),i.length>1&&i.sort(u||fh)}function h(){for(let f=e,u=s.length;f<u;f++){const d=s[f];if(d.id===null)break;d.id=null,d.object=null,d.geometry=null,d.material=null,d.group=null}}return{opaque:t,transmissive:n,transparent:i,init:r,push:o,unshift:l,finish:h,sort:c}}function X2(){let s=new WeakMap;function e(n,i){const r=s.get(n);let a;return r===void 0?(a=new ph,s.set(n,[a])):i>=r.length?(a=new ph,r.push(a)):a=r[i],a}function t(){s=new WeakMap}return{get:e,dispose:t}}function q2(){const s={};return{get:function(e){if(s[e.id]!==void 0)return s[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new F,color:new et};break;case"SpotLight":t={position:new F,direction:new F,color:new et,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new F,color:new et,distance:0,decay:0};break;case"HemisphereLight":t={direction:new F,skyColor:new et,groundColor:new et};break;case"RectAreaLight":t={color:new et,position:new F,halfWidth:new F,halfHeight:new F};break}return s[e.id]=t,t}}}function j2(){const s={};return{get:function(e){if(s[e.id]!==void 0)return s[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Be};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Be};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Be,shadowCameraNear:1,shadowCameraFar:1e3};break}return s[e.id]=t,t}}}let Y2=0;function $2(s,e){return(e.castShadow?2:0)-(s.castShadow?2:0)+(e.map?1:0)-(s.map?1:0)}function J2(s){const e=new q2,t=j2(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)n.probe.push(new F);const i=new F,r=new st,a=new st;function o(c){let h=0,f=0,u=0;for(let b=0;b<9;b++)n.probe[b].set(0,0,0);let d=0,m=0,_=0,g=0,p=0,w=0,E=0,S=0,U=0,L=0,D=0;c.sort($2);for(let b=0,M=c.length;b<M;b++){const I=c[b],V=I.color,H=I.intensity,J=I.distance,ie=I.shadow&&I.shadow.map?I.shadow.map.texture:null;if(I.isAmbientLight)h+=V.r*H,f+=V.g*H,u+=V.b*H;else if(I.isLightProbe){for(let B=0;B<9;B++)n.probe[B].addScaledVector(I.sh.coefficients[B],H);D++}else if(I.isDirectionalLight){const B=e.get(I);if(B.color.copy(I.color).multiplyScalar(I.intensity),I.castShadow){const oe=I.shadow,j=t.get(I);j.shadowIntensity=oe.intensity,j.shadowBias=oe.bias,j.shadowNormalBias=oe.normalBias,j.shadowRadius=oe.radius,j.shadowMapSize=oe.mapSize,n.directionalShadow[d]=j,n.directionalShadowMap[d]=ie,n.directionalShadowMatrix[d]=I.shadow.matrix,w++}n.directional[d]=B,d++}else if(I.isSpotLight){const B=e.get(I);B.position.setFromMatrixPosition(I.matrixWorld),B.color.copy(V).multiplyScalar(H),B.distance=J,B.coneCos=Math.cos(I.angle),B.penumbraCos=Math.cos(I.angle*(1-I.penumbra)),B.decay=I.decay,n.spot[_]=B;const oe=I.shadow;if(I.map&&(n.spotLightMap[U]=I.map,U++,oe.updateMatrices(I),I.castShadow&&L++),n.spotLightMatrix[_]=oe.matrix,I.castShadow){const j=t.get(I);j.shadowIntensity=oe.intensity,j.shadowBias=oe.bias,j.shadowNormalBias=oe.normalBias,j.shadowRadius=oe.radius,j.shadowMapSize=oe.mapSize,n.spotShadow[_]=j,n.spotShadowMap[_]=ie,S++}_++}else if(I.isRectAreaLight){const B=e.get(I);B.color.copy(V).multiplyScalar(H),B.halfWidth.set(I.width*.5,0,0),B.halfHeight.set(0,I.height*.5,0),n.rectArea[g]=B,g++}else if(I.isPointLight){const B=e.get(I);if(B.color.copy(I.color).multiplyScalar(I.intensity),B.distance=I.distance,B.decay=I.decay,I.castShadow){const oe=I.shadow,j=t.get(I);j.shadowIntensity=oe.intensity,j.shadowBias=oe.bias,j.shadowNormalBias=oe.normalBias,j.shadowRadius=oe.radius,j.shadowMapSize=oe.mapSize,j.shadowCameraNear=oe.camera.near,j.shadowCameraFar=oe.camera.far,n.pointShadow[m]=j,n.pointShadowMap[m]=ie,n.pointShadowMatrix[m]=I.shadow.matrix,E++}n.point[m]=B,m++}else if(I.isHemisphereLight){const B=e.get(I);B.skyColor.copy(I.color).multiplyScalar(H),B.groundColor.copy(I.groundColor).multiplyScalar(H),n.hemi[p]=B,p++}}g>0&&(s.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=Le.LTC_FLOAT_1,n.rectAreaLTC2=Le.LTC_FLOAT_2):(n.rectAreaLTC1=Le.LTC_HALF_1,n.rectAreaLTC2=Le.LTC_HALF_2)),n.ambient[0]=h,n.ambient[1]=f,n.ambient[2]=u;const N=n.hash;(N.directionalLength!==d||N.pointLength!==m||N.spotLength!==_||N.rectAreaLength!==g||N.hemiLength!==p||N.numDirectionalShadows!==w||N.numPointShadows!==E||N.numSpotShadows!==S||N.numSpotMaps!==U||N.numLightProbes!==D)&&(n.directional.length=d,n.spot.length=_,n.rectArea.length=g,n.point.length=m,n.hemi.length=p,n.directionalShadow.length=w,n.directionalShadowMap.length=w,n.pointShadow.length=E,n.pointShadowMap.length=E,n.spotShadow.length=S,n.spotShadowMap.length=S,n.directionalShadowMatrix.length=w,n.pointShadowMatrix.length=E,n.spotLightMatrix.length=S+U-L,n.spotLightMap.length=U,n.numSpotLightShadowsWithMaps=L,n.numLightProbes=D,N.directionalLength=d,N.pointLength=m,N.spotLength=_,N.rectAreaLength=g,N.hemiLength=p,N.numDirectionalShadows=w,N.numPointShadows=E,N.numSpotShadows=S,N.numSpotMaps=U,N.numLightProbes=D,n.version=Y2++)}function l(c,h){let f=0,u=0,d=0,m=0,_=0;const g=h.matrixWorldInverse;for(let p=0,w=c.length;p<w;p++){const E=c[p];if(E.isDirectionalLight){const S=n.directional[f];S.direction.setFromMatrixPosition(E.matrixWorld),i.setFromMatrixPosition(E.target.matrixWorld),S.direction.sub(i),S.direction.transformDirection(g),f++}else if(E.isSpotLight){const S=n.spot[d];S.position.setFromMatrixPosition(E.matrixWorld),S.position.applyMatrix4(g),S.direction.setFromMatrixPosition(E.matrixWorld),i.setFromMatrixPosition(E.target.matrixWorld),S.direction.sub(i),S.direction.transformDirection(g),d++}else if(E.isRectAreaLight){const S=n.rectArea[m];S.position.setFromMatrixPosition(E.matrixWorld),S.position.applyMatrix4(g),a.identity(),r.copy(E.matrixWorld),r.premultiply(g),a.extractRotation(r),S.halfWidth.set(E.width*.5,0,0),S.halfHeight.set(0,E.height*.5,0),S.halfWidth.applyMatrix4(a),S.halfHeight.applyMatrix4(a),m++}else if(E.isPointLight){const S=n.point[u];S.position.setFromMatrixPosition(E.matrixWorld),S.position.applyMatrix4(g),u++}else if(E.isHemisphereLight){const S=n.hemi[_];S.direction.setFromMatrixPosition(E.matrixWorld),S.direction.transformDirection(g),_++}}}return{setup:o,setupView:l,state:n}}function mh(s){const e=new J2(s),t=[],n=[];function i(h){c.camera=h,t.length=0,n.length=0}function r(h){t.push(h)}function a(h){n.push(h)}function o(){e.setup(t)}function l(h){e.setupView(t,h)}const c={lightsArray:t,shadowsArray:n,camera:null,lights:e,transmissionRenderTarget:{}};return{init:i,state:c,setupLights:o,setupLightsView:l,pushLight:r,pushShadow:a}}function K2(s){let e=new WeakMap;function t(i,r=0){const a=e.get(i);let o;return a===void 0?(o=new mh(s),e.set(i,[o])):r>=a.length?(o=new mh(s),a.push(o)):o=a[r],o}function n(){e=new WeakMap}return{get:t,dispose:n}}const Z2=`void main() {
|
|
3775
|
+
`+j)}else V!==""?console.warn("THREE.WebGLProgram: Program Info Log:",V):(H===""||J==="")&&(B=!1);B&&(I.diagnostics={runnable:ie,programLog:V,vertexShader:{log:H,prefix:g},fragmentShader:{log:J,prefix:p}})}i.deleteShader(U),i.deleteShader(L),N=new ra(i,_),b=T2(i,_)}let N;this.getUniforms=function(){return N===void 0&&D(this),N};let b;this.getAttributes=function(){return b===void 0&&D(this),b};let M=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return M===!1&&(M=i.getProgramParameter(_,v2)),M},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(_),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=x2++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=U,this.fragmentShader=L,this}let B2=0;class k2{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,i=this._getShaderStage(t),r=this._getShaderStage(n),a=this._getShaderCacheForMaterial(e);return a.has(i)===!1&&(a.add(i),i.usedTimes++),a.has(r)===!1&&(a.add(r),r.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return n===void 0&&(n=new V2(e),t.set(e,n)),n}}class V2{constructor(e){this.id=B2++,this.code=e,this.usedTimes=0}}function H2(s,e,t,n,i,r,a){const o=new Al,l=new k2,c=new Set,h=[],d=i.logarithmicDepthBuffer,u=i.vertexTextures;let f=i.precision;const m={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function _(b){return c.add(b),b===0?"uv":`uv${b}`}function g(b,M,I,V,H){const J=V.fog,ie=H.geometry,B=b.isMeshStandardMaterial?V.environment:null,oe=(b.isMeshStandardMaterial?t:e).get(b.envMap||B),j=oe&&oe.mapping===va?oe.image.height:null,ue=m[b.type];b.precision!==null&&(f=i.getMaxPrecision(b.precision),f!==b.precision&&console.warn("THREE.WebGLProgram.getParameters:",b.precision,"not supported, using",f,"instead."));const pe=ie.morphAttributes.position||ie.morphAttributes.normal||ie.morphAttributes.color,Me=pe!==void 0?pe.length:0;let Ue=0;ie.morphAttributes.position!==void 0&&(Ue=1),ie.morphAttributes.normal!==void 0&&(Ue=2),ie.morphAttributes.color!==void 0&&(Ue=3);let Ne,$,se,re;if(ue){const pt=En[ue];Ne=pt.vertexShader,$=pt.fragmentShader}else Ne=b.vertexShader,$=b.fragmentShader,l.update(b),se=l.getVertexShaderID(b),re=l.getFragmentShaderID(b);const le=s.getRenderTarget(),Ee=s.state.buffers.depth.getReversed(),fe=H.isInstancedMesh===!0,be=H.isBatchedMesh===!0,Je=!!b.map,at=!!b.matcap,it=!!oe,z=!!b.aoMap,yt=!!b.lightMap,dt=!!b.bumpMap,ot=!!b.normalMap,W=!!b.displacementMap,ae=!!b.emissiveMap,ne=!!b.metalnessMap,ye=!!b.roughnessMap,Oe=b.anisotropy>0,T=b.clearcoat>0,y=b.dispersion>0,k=b.iridescence>0,K=b.sheen>0,Q=b.transmission>0,O=Oe&&!!b.anisotropyMap,we=T&&!!b.clearcoatMap,xe=T&&!!b.clearcoatNormalMap,Se=T&&!!b.clearcoatRoughnessMap,Ie=k&&!!b.iridescenceMap,de=k&&!!b.iridescenceThicknessMap,Pe=K&&!!b.sheenColorMap,qe=K&&!!b.sheenRoughnessMap,ke=!!b.specularMap,Ae=!!b.specularColorMap,rt=!!b.specularIntensityMap,G=Q&&!!b.transmissionMap,De=Q&&!!b.thicknessMap,ge=!!b.gradientMap,ze=!!b.alphaMap,ve=b.alphaTest>0,he=!!b.alphaHash,Ge=!!b.extensions;let lt=Ri;b.toneMapped&&(le===null||le.isXRRenderTarget===!0)&&(lt=s.toneMapping);const Lt={shaderID:ue,shaderType:b.type,shaderName:b.name,vertexShader:Ne,fragmentShader:$,defines:b.defines,customVertexShaderID:se,customFragmentShaderID:re,isRawShaderMaterial:b.isRawShaderMaterial===!0,glslVersion:b.glslVersion,precision:f,batching:be,batchingColor:be&&H._colorsTexture!==null,instancing:fe,instancingColor:fe&&H.instanceColor!==null,instancingMorph:fe&&H.morphTexture!==null,supportsVertexTextures:u,outputColorSpace:le===null?s.outputColorSpace:le.isXRRenderTarget===!0?le.texture.colorSpace:Ls,alphaToCoverage:!!b.alphaToCoverage,map:Je,matcap:at,envMap:it,envMapMode:it&&oe.mapping,envMapCubeUVHeight:j,aoMap:z,lightMap:yt,bumpMap:dt,normalMap:ot,displacementMap:u&&W,emissiveMap:ae,normalMapObjectSpace:ot&&b.normalMapType===Nd,normalMapTangentSpace:ot&&b.normalMapType===xa,metalnessMap:ne,roughnessMap:ye,anisotropy:Oe,anisotropyMap:O,clearcoat:T,clearcoatMap:we,clearcoatNormalMap:xe,clearcoatRoughnessMap:Se,dispersion:y,iridescence:k,iridescenceMap:Ie,iridescenceThicknessMap:de,sheen:K,sheenColorMap:Pe,sheenRoughnessMap:qe,specularMap:ke,specularColorMap:Ae,specularIntensityMap:rt,transmission:Q,transmissionMap:G,thicknessMap:De,gradientMap:ge,opaque:b.transparent===!1&&b.blending===Es&&b.alphaToCoverage===!1,alphaMap:ze,alphaTest:ve,alphaHash:he,combine:b.combine,mapUv:Je&&_(b.map.channel),aoMapUv:z&&_(b.aoMap.channel),lightMapUv:yt&&_(b.lightMap.channel),bumpMapUv:dt&&_(b.bumpMap.channel),normalMapUv:ot&&_(b.normalMap.channel),displacementMapUv:W&&_(b.displacementMap.channel),emissiveMapUv:ae&&_(b.emissiveMap.channel),metalnessMapUv:ne&&_(b.metalnessMap.channel),roughnessMapUv:ye&&_(b.roughnessMap.channel),anisotropyMapUv:O&&_(b.anisotropyMap.channel),clearcoatMapUv:we&&_(b.clearcoatMap.channel),clearcoatNormalMapUv:xe&&_(b.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Se&&_(b.clearcoatRoughnessMap.channel),iridescenceMapUv:Ie&&_(b.iridescenceMap.channel),iridescenceThicknessMapUv:de&&_(b.iridescenceThicknessMap.channel),sheenColorMapUv:Pe&&_(b.sheenColorMap.channel),sheenRoughnessMapUv:qe&&_(b.sheenRoughnessMap.channel),specularMapUv:ke&&_(b.specularMap.channel),specularColorMapUv:Ae&&_(b.specularColorMap.channel),specularIntensityMapUv:rt&&_(b.specularIntensityMap.channel),transmissionMapUv:G&&_(b.transmissionMap.channel),thicknessMapUv:De&&_(b.thicknessMap.channel),alphaMapUv:ze&&_(b.alphaMap.channel),vertexTangents:!!ie.attributes.tangent&&(ot||Oe),vertexColors:b.vertexColors,vertexAlphas:b.vertexColors===!0&&!!ie.attributes.color&&ie.attributes.color.itemSize===4,pointsUvs:H.isPoints===!0&&!!ie.attributes.uv&&(Je||ze),fog:!!J,useFog:b.fog===!0,fogExp2:!!J&&J.isFogExp2,flatShading:b.flatShading===!0,sizeAttenuation:b.sizeAttenuation===!0,logarithmicDepthBuffer:d,reverseDepthBuffer:Ee,skinning:H.isSkinnedMesh===!0,morphTargets:ie.morphAttributes.position!==void 0,morphNormals:ie.morphAttributes.normal!==void 0,morphColors:ie.morphAttributes.color!==void 0,morphTargetsCount:Me,morphTextureStride:Ue,numDirLights:M.directional.length,numPointLights:M.point.length,numSpotLights:M.spot.length,numSpotLightMaps:M.spotLightMap.length,numRectAreaLights:M.rectArea.length,numHemiLights:M.hemi.length,numDirLightShadows:M.directionalShadowMap.length,numPointLightShadows:M.pointShadowMap.length,numSpotLightShadows:M.spotShadowMap.length,numSpotLightShadowsWithMaps:M.numSpotLightShadowsWithMaps,numLightProbes:M.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:b.dithering,shadowMapEnabled:s.shadowMap.enabled&&I.length>0,shadowMapType:s.shadowMap.type,toneMapping:lt,decodeVideoTexture:Je&&b.map.isVideoTexture===!0&&Mt.getTransfer(b.map.colorSpace)===Ut,decodeVideoTextureEmissive:ae&&b.emissiveMap.isVideoTexture===!0&&Mt.getTransfer(b.emissiveMap.colorSpace)===Ut,premultipliedAlpha:b.premultipliedAlpha,doubleSided:b.side===un,flipSided:b.side===gn,useDepthPacking:b.depthPacking>=0,depthPacking:b.depthPacking||0,index0AttributeName:b.index0AttributeName,extensionClipCullDistance:Ge&&b.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Ge&&b.extensions.multiDraw===!0||be)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:b.customProgramCacheKey()};return Lt.vertexUv1s=c.has(1),Lt.vertexUv2s=c.has(2),Lt.vertexUv3s=c.has(3),c.clear(),Lt}function p(b){const M=[];if(b.shaderID?M.push(b.shaderID):(M.push(b.customVertexShaderID),M.push(b.customFragmentShaderID)),b.defines!==void 0)for(const I in b.defines)M.push(I),M.push(b.defines[I]);return b.isRawShaderMaterial===!1&&(w(M,b),E(M,b),M.push(s.outputColorSpace)),M.push(b.customProgramCacheKey),M.join()}function w(b,M){b.push(M.precision),b.push(M.outputColorSpace),b.push(M.envMapMode),b.push(M.envMapCubeUVHeight),b.push(M.mapUv),b.push(M.alphaMapUv),b.push(M.lightMapUv),b.push(M.aoMapUv),b.push(M.bumpMapUv),b.push(M.normalMapUv),b.push(M.displacementMapUv),b.push(M.emissiveMapUv),b.push(M.metalnessMapUv),b.push(M.roughnessMapUv),b.push(M.anisotropyMapUv),b.push(M.clearcoatMapUv),b.push(M.clearcoatNormalMapUv),b.push(M.clearcoatRoughnessMapUv),b.push(M.iridescenceMapUv),b.push(M.iridescenceThicknessMapUv),b.push(M.sheenColorMapUv),b.push(M.sheenRoughnessMapUv),b.push(M.specularMapUv),b.push(M.specularColorMapUv),b.push(M.specularIntensityMapUv),b.push(M.transmissionMapUv),b.push(M.thicknessMapUv),b.push(M.combine),b.push(M.fogExp2),b.push(M.sizeAttenuation),b.push(M.morphTargetsCount),b.push(M.morphAttributeCount),b.push(M.numDirLights),b.push(M.numPointLights),b.push(M.numSpotLights),b.push(M.numSpotLightMaps),b.push(M.numHemiLights),b.push(M.numRectAreaLights),b.push(M.numDirLightShadows),b.push(M.numPointLightShadows),b.push(M.numSpotLightShadows),b.push(M.numSpotLightShadowsWithMaps),b.push(M.numLightProbes),b.push(M.shadowMapType),b.push(M.toneMapping),b.push(M.numClippingPlanes),b.push(M.numClipIntersection),b.push(M.depthPacking)}function E(b,M){o.disableAll(),M.supportsVertexTextures&&o.enable(0),M.instancing&&o.enable(1),M.instancingColor&&o.enable(2),M.instancingMorph&&o.enable(3),M.matcap&&o.enable(4),M.envMap&&o.enable(5),M.normalMapObjectSpace&&o.enable(6),M.normalMapTangentSpace&&o.enable(7),M.clearcoat&&o.enable(8),M.iridescence&&o.enable(9),M.alphaTest&&o.enable(10),M.vertexColors&&o.enable(11),M.vertexAlphas&&o.enable(12),M.vertexUv1s&&o.enable(13),M.vertexUv2s&&o.enable(14),M.vertexUv3s&&o.enable(15),M.vertexTangents&&o.enable(16),M.anisotropy&&o.enable(17),M.alphaHash&&o.enable(18),M.batching&&o.enable(19),M.dispersion&&o.enable(20),M.batchingColor&&o.enable(21),b.push(o.mask),o.disableAll(),M.fog&&o.enable(0),M.useFog&&o.enable(1),M.flatShading&&o.enable(2),M.logarithmicDepthBuffer&&o.enable(3),M.reverseDepthBuffer&&o.enable(4),M.skinning&&o.enable(5),M.morphTargets&&o.enable(6),M.morphNormals&&o.enable(7),M.morphColors&&o.enable(8),M.premultipliedAlpha&&o.enable(9),M.shadowMapEnabled&&o.enable(10),M.doubleSided&&o.enable(11),M.flipSided&&o.enable(12),M.useDepthPacking&&o.enable(13),M.dithering&&o.enable(14),M.transmission&&o.enable(15),M.sheen&&o.enable(16),M.opaque&&o.enable(17),M.pointsUvs&&o.enable(18),M.decodeVideoTexture&&o.enable(19),M.decodeVideoTextureEmissive&&o.enable(20),M.alphaToCoverage&&o.enable(21),b.push(o.mask)}function S(b){const M=m[b.type];let I;if(M){const V=En[M];I=Tl.clone(V.uniforms)}else I=b.uniforms;return I}function U(b,M){let I;for(let V=0,H=h.length;V<H;V++){const J=h[V];if(J.cacheKey===M){I=J,++I.usedTimes;break}}return I===void 0&&(I=new z2(s,M,b,r),h.push(I)),I}function L(b){if(--b.usedTimes===0){const M=h.indexOf(b);h[M]=h[h.length-1],h.pop(),b.destroy()}}function D(b){l.remove(b)}function N(){l.dispose()}return{getParameters:g,getProgramCacheKey:p,getUniforms:S,acquireProgram:U,releaseProgram:L,releaseShaderCache:D,programs:h,dispose:N}}function G2(){let s=new WeakMap;function e(a){return s.has(a)}function t(a){let o=s.get(a);return o===void 0&&(o={},s.set(a,o)),o}function n(a){s.delete(a)}function i(a,o,l){s.get(a)[o]=l}function r(){s=new WeakMap}return{has:e,get:t,remove:n,update:i,dispose:r}}function W2(s,e){return s.groupOrder!==e.groupOrder?s.groupOrder-e.groupOrder:s.renderOrder!==e.renderOrder?s.renderOrder-e.renderOrder:s.material.id!==e.material.id?s.material.id-e.material.id:s.z!==e.z?s.z-e.z:s.id-e.id}function fh(s,e){return s.groupOrder!==e.groupOrder?s.groupOrder-e.groupOrder:s.renderOrder!==e.renderOrder?s.renderOrder-e.renderOrder:s.z!==e.z?e.z-s.z:s.id-e.id}function ph(){const s=[];let e=0;const t=[],n=[],i=[];function r(){e=0,t.length=0,n.length=0,i.length=0}function a(d,u,f,m,_,g){let p=s[e];return p===void 0?(p={id:d.id,object:d,geometry:u,material:f,groupOrder:m,renderOrder:d.renderOrder,z:_,group:g},s[e]=p):(p.id=d.id,p.object=d,p.geometry=u,p.material=f,p.groupOrder=m,p.renderOrder=d.renderOrder,p.z=_,p.group=g),e++,p}function o(d,u,f,m,_,g){const p=a(d,u,f,m,_,g);f.transmission>0?n.push(p):f.transparent===!0?i.push(p):t.push(p)}function l(d,u,f,m,_,g){const p=a(d,u,f,m,_,g);f.transmission>0?n.unshift(p):f.transparent===!0?i.unshift(p):t.unshift(p)}function c(d,u){t.length>1&&t.sort(d||W2),n.length>1&&n.sort(u||fh),i.length>1&&i.sort(u||fh)}function h(){for(let d=e,u=s.length;d<u;d++){const f=s[d];if(f.id===null)break;f.id=null,f.object=null,f.geometry=null,f.material=null,f.group=null}}return{opaque:t,transmissive:n,transparent:i,init:r,push:o,unshift:l,finish:h,sort:c}}function X2(){let s=new WeakMap;function e(n,i){const r=s.get(n);let a;return r===void 0?(a=new ph,s.set(n,[a])):i>=r.length?(a=new ph,r.push(a)):a=r[i],a}function t(){s=new WeakMap}return{get:e,dispose:t}}function q2(){const s={};return{get:function(e){if(s[e.id]!==void 0)return s[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new F,color:new et};break;case"SpotLight":t={position:new F,direction:new F,color:new et,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new F,color:new et,distance:0,decay:0};break;case"HemisphereLight":t={direction:new F,skyColor:new et,groundColor:new et};break;case"RectAreaLight":t={color:new et,position:new F,halfWidth:new F,halfHeight:new F};break}return s[e.id]=t,t}}}function j2(){const s={};return{get:function(e){if(s[e.id]!==void 0)return s[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Be};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Be};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Be,shadowCameraNear:1,shadowCameraFar:1e3};break}return s[e.id]=t,t}}}let Y2=0;function $2(s,e){return(e.castShadow?2:0)-(s.castShadow?2:0)+(e.map?1:0)-(s.map?1:0)}function J2(s){const e=new q2,t=j2(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)n.probe.push(new F);const i=new F,r=new st,a=new st;function o(c){let h=0,d=0,u=0;for(let b=0;b<9;b++)n.probe[b].set(0,0,0);let f=0,m=0,_=0,g=0,p=0,w=0,E=0,S=0,U=0,L=0,D=0;c.sort($2);for(let b=0,M=c.length;b<M;b++){const I=c[b],V=I.color,H=I.intensity,J=I.distance,ie=I.shadow&&I.shadow.map?I.shadow.map.texture:null;if(I.isAmbientLight)h+=V.r*H,d+=V.g*H,u+=V.b*H;else if(I.isLightProbe){for(let B=0;B<9;B++)n.probe[B].addScaledVector(I.sh.coefficients[B],H);D++}else if(I.isDirectionalLight){const B=e.get(I);if(B.color.copy(I.color).multiplyScalar(I.intensity),I.castShadow){const oe=I.shadow,j=t.get(I);j.shadowIntensity=oe.intensity,j.shadowBias=oe.bias,j.shadowNormalBias=oe.normalBias,j.shadowRadius=oe.radius,j.shadowMapSize=oe.mapSize,n.directionalShadow[f]=j,n.directionalShadowMap[f]=ie,n.directionalShadowMatrix[f]=I.shadow.matrix,w++}n.directional[f]=B,f++}else if(I.isSpotLight){const B=e.get(I);B.position.setFromMatrixPosition(I.matrixWorld),B.color.copy(V).multiplyScalar(H),B.distance=J,B.coneCos=Math.cos(I.angle),B.penumbraCos=Math.cos(I.angle*(1-I.penumbra)),B.decay=I.decay,n.spot[_]=B;const oe=I.shadow;if(I.map&&(n.spotLightMap[U]=I.map,U++,oe.updateMatrices(I),I.castShadow&&L++),n.spotLightMatrix[_]=oe.matrix,I.castShadow){const j=t.get(I);j.shadowIntensity=oe.intensity,j.shadowBias=oe.bias,j.shadowNormalBias=oe.normalBias,j.shadowRadius=oe.radius,j.shadowMapSize=oe.mapSize,n.spotShadow[_]=j,n.spotShadowMap[_]=ie,S++}_++}else if(I.isRectAreaLight){const B=e.get(I);B.color.copy(V).multiplyScalar(H),B.halfWidth.set(I.width*.5,0,0),B.halfHeight.set(0,I.height*.5,0),n.rectArea[g]=B,g++}else if(I.isPointLight){const B=e.get(I);if(B.color.copy(I.color).multiplyScalar(I.intensity),B.distance=I.distance,B.decay=I.decay,I.castShadow){const oe=I.shadow,j=t.get(I);j.shadowIntensity=oe.intensity,j.shadowBias=oe.bias,j.shadowNormalBias=oe.normalBias,j.shadowRadius=oe.radius,j.shadowMapSize=oe.mapSize,j.shadowCameraNear=oe.camera.near,j.shadowCameraFar=oe.camera.far,n.pointShadow[m]=j,n.pointShadowMap[m]=ie,n.pointShadowMatrix[m]=I.shadow.matrix,E++}n.point[m]=B,m++}else if(I.isHemisphereLight){const B=e.get(I);B.skyColor.copy(I.color).multiplyScalar(H),B.groundColor.copy(I.groundColor).multiplyScalar(H),n.hemi[p]=B,p++}}g>0&&(s.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=Le.LTC_FLOAT_1,n.rectAreaLTC2=Le.LTC_FLOAT_2):(n.rectAreaLTC1=Le.LTC_HALF_1,n.rectAreaLTC2=Le.LTC_HALF_2)),n.ambient[0]=h,n.ambient[1]=d,n.ambient[2]=u;const N=n.hash;(N.directionalLength!==f||N.pointLength!==m||N.spotLength!==_||N.rectAreaLength!==g||N.hemiLength!==p||N.numDirectionalShadows!==w||N.numPointShadows!==E||N.numSpotShadows!==S||N.numSpotMaps!==U||N.numLightProbes!==D)&&(n.directional.length=f,n.spot.length=_,n.rectArea.length=g,n.point.length=m,n.hemi.length=p,n.directionalShadow.length=w,n.directionalShadowMap.length=w,n.pointShadow.length=E,n.pointShadowMap.length=E,n.spotShadow.length=S,n.spotShadowMap.length=S,n.directionalShadowMatrix.length=w,n.pointShadowMatrix.length=E,n.spotLightMatrix.length=S+U-L,n.spotLightMap.length=U,n.numSpotLightShadowsWithMaps=L,n.numLightProbes=D,N.directionalLength=f,N.pointLength=m,N.spotLength=_,N.rectAreaLength=g,N.hemiLength=p,N.numDirectionalShadows=w,N.numPointShadows=E,N.numSpotShadows=S,N.numSpotMaps=U,N.numLightProbes=D,n.version=Y2++)}function l(c,h){let d=0,u=0,f=0,m=0,_=0;const g=h.matrixWorldInverse;for(let p=0,w=c.length;p<w;p++){const E=c[p];if(E.isDirectionalLight){const S=n.directional[d];S.direction.setFromMatrixPosition(E.matrixWorld),i.setFromMatrixPosition(E.target.matrixWorld),S.direction.sub(i),S.direction.transformDirection(g),d++}else if(E.isSpotLight){const S=n.spot[f];S.position.setFromMatrixPosition(E.matrixWorld),S.position.applyMatrix4(g),S.direction.setFromMatrixPosition(E.matrixWorld),i.setFromMatrixPosition(E.target.matrixWorld),S.direction.sub(i),S.direction.transformDirection(g),f++}else if(E.isRectAreaLight){const S=n.rectArea[m];S.position.setFromMatrixPosition(E.matrixWorld),S.position.applyMatrix4(g),a.identity(),r.copy(E.matrixWorld),r.premultiply(g),a.extractRotation(r),S.halfWidth.set(E.width*.5,0,0),S.halfHeight.set(0,E.height*.5,0),S.halfWidth.applyMatrix4(a),S.halfHeight.applyMatrix4(a),m++}else if(E.isPointLight){const S=n.point[u];S.position.setFromMatrixPosition(E.matrixWorld),S.position.applyMatrix4(g),u++}else if(E.isHemisphereLight){const S=n.hemi[_];S.direction.setFromMatrixPosition(E.matrixWorld),S.direction.transformDirection(g),_++}}}return{setup:o,setupView:l,state:n}}function mh(s){const e=new J2(s),t=[],n=[];function i(h){c.camera=h,t.length=0,n.length=0}function r(h){t.push(h)}function a(h){n.push(h)}function o(){e.setup(t)}function l(h){e.setupView(t,h)}const c={lightsArray:t,shadowsArray:n,camera:null,lights:e,transmissionRenderTarget:{}};return{init:i,state:c,setupLights:o,setupLightsView:l,pushLight:r,pushShadow:a}}function K2(s){let e=new WeakMap;function t(i,r=0){const a=e.get(i);let o;return a===void 0?(o=new mh(s),e.set(i,[o])):r>=a.length?(o=new mh(s),a.push(o)):o=a[r],o}function n(){e=new WeakMap}return{get:t,dispose:n}}const Z2=`void main() {
|
|
3776
3776
|
gl_Position = vec4( position, 1.0 );
|
|
3777
3777
|
}`,Q2=`uniform sampler2D shadow_pass;
|
|
3778
3778
|
uniform vec2 resolution;
|
|
@@ -3800,7 +3800,7 @@ void main() {
|
|
|
3800
3800
|
squared_mean = squared_mean / samples;
|
|
3801
3801
|
float std_dev = sqrt( squared_mean - mean * mean );
|
|
3802
3802
|
gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
|
|
3803
|
-
}`;function eg(s,e,t){let n=new Pl;const i=new Be,r=new Be,a=new bt,o=new sp({depthPacking:Dd}),l=new rp,c={},h=t.maxTextureSize,f={[Wn]:gn,[gn]:Wn,[un]:un},u=new mi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Be},radius:{value:4}},vertexShader:Z2,fragmentShader:Q2}),d=u.clone();d.defines.HORIZONTAL_PASS=1;const m=new Bt;m.setAttribute("position",new Ht(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new Ct(m,u),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Hh;let p=this.type;this.render=function(L,D,N){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||L.length===0)return;const b=s.getRenderTarget(),M=s.getActiveCubeFace(),I=s.getActiveMipmapLevel(),V=s.state;V.setBlending(Ci),V.buffers.color.setClear(1,1,1,1),V.buffers.depth.setTest(!0),V.setScissorTest(!1);const H=p!==ui&&this.type===ui,J=p===ui&&this.type!==ui;for(let ie=0,B=L.length;ie<B;ie++){const oe=L[ie],j=oe.shadow;if(j===void 0){console.warn("THREE.WebGLShadowMap:",oe,"has no shadow.");continue}if(j.autoUpdate===!1&&j.needsUpdate===!1)continue;i.copy(j.mapSize);const ue=j.getFrameExtents();if(i.multiply(ue),r.copy(j.mapSize),(i.x>h||i.y>h)&&(i.x>h&&(r.x=Math.floor(h/ue.x),i.x=r.x*ue.x,j.mapSize.x=r.x),i.y>h&&(r.y=Math.floor(h/ue.y),i.y=r.y*ue.y,j.mapSize.y=r.y)),j.map===null||H===!0||J===!0){const Me=this.type!==ui?{minFilter:Ln,magFilter:Ln}:{};j.map!==null&&j.map.dispose(),j.map=new Ji(i.x,i.y,Me),j.map.texture.name=oe.name+".shadowMap",j.camera.updateProjectionMatrix()}s.setRenderTarget(j.map),s.clear();const pe=j.getViewportCount();for(let Me=0;Me<pe;Me++){const Ue=j.getViewport(Me);a.set(r.x*Ue.x,r.y*Ue.y,r.x*Ue.z,r.y*Ue.w),V.viewport(a),j.updateMatrices(oe,Me),n=j.getFrustum(),S(D,N,j.camera,oe,this.type)}j.isPointLightShadow!==!0&&this.type===ui&&w(j,N),j.needsUpdate=!1}p=this.type,g.needsUpdate=!1,s.setRenderTarget(b,M,I)};function w(L,D){const N=e.update(_);u.defines.VSM_SAMPLES!==L.blurSamples&&(u.defines.VSM_SAMPLES=L.blurSamples,d.defines.VSM_SAMPLES=L.blurSamples,u.needsUpdate=!0,d.needsUpdate=!0),L.mapPass===null&&(L.mapPass=new Ji(i.x,i.y)),u.uniforms.shadow_pass.value=L.map.texture,u.uniforms.resolution.value=L.mapSize,u.uniforms.radius.value=L.radius,s.setRenderTarget(L.mapPass),s.clear(),s.renderBufferDirect(D,null,N,u,_,null),d.uniforms.shadow_pass.value=L.mapPass.texture,d.uniforms.resolution.value=L.mapSize,d.uniforms.radius.value=L.radius,s.setRenderTarget(L.map),s.clear(),s.renderBufferDirect(D,null,N,d,_,null)}function E(L,D,N,b){let M=null;const I=N.isPointLight===!0?L.customDistanceMaterial:L.customDepthMaterial;if(I!==void 0)M=I;else if(M=N.isPointLight===!0?l:o,s.localClippingEnabled&&D.clipShadows===!0&&Array.isArray(D.clippingPlanes)&&D.clippingPlanes.length!==0||D.displacementMap&&D.displacementScale!==0||D.alphaMap&&D.alphaTest>0||D.map&&D.alphaTest>0||D.alphaToCoverage===!0){const V=M.uuid,H=D.uuid;let J=c[V];J===void 0&&(J={},c[V]=J);let ie=J[H];ie===void 0&&(ie=M.clone(),J[H]=ie,D.addEventListener("dispose",U)),M=ie}if(M.visible=D.visible,M.wireframe=D.wireframe,b===ui?M.side=D.shadowSide!==null?D.shadowSide:D.side:M.side=D.shadowSide!==null?D.shadowSide:f[D.side],M.alphaMap=D.alphaMap,M.alphaTest=D.alphaToCoverage===!0?.5:D.alphaTest,M.map=D.map,M.clipShadows=D.clipShadows,M.clippingPlanes=D.clippingPlanes,M.clipIntersection=D.clipIntersection,M.displacementMap=D.displacementMap,M.displacementScale=D.displacementScale,M.displacementBias=D.displacementBias,M.wireframeLinewidth=D.wireframeLinewidth,M.linewidth=D.linewidth,N.isPointLight===!0&&M.isMeshDistanceMaterial===!0){const V=s.properties.get(M);V.light=N}return M}function S(L,D,N,b,M){if(L.visible===!1)return;if(L.layers.test(D.layers)&&(L.isMesh||L.isLine||L.isPoints)&&(L.castShadow||L.receiveShadow&&M===ui)&&(!L.frustumCulled||n.intersectsObject(L))){L.modelViewMatrix.multiplyMatrices(N.matrixWorldInverse,L.matrixWorld);const H=e.update(L),J=L.material;if(Array.isArray(J)){const ie=H.groups;for(let B=0,oe=ie.length;B<oe;B++){const j=ie[B],ue=J[j.materialIndex];if(ue&&ue.visible){const pe=E(L,ue,b,M);L.onBeforeShadow(s,L,D,N,H,pe,j),s.renderBufferDirect(N,null,H,pe,L,j),L.onAfterShadow(s,L,D,N,H,pe,j)}}}else if(J.visible){const ie=E(L,J,b,M);L.onBeforeShadow(s,L,D,N,H,ie,null),s.renderBufferDirect(N,null,H,ie,L,null),L.onAfterShadow(s,L,D,N,H,ie,null)}}const V=L.children;for(let H=0,J=V.length;H<J;H++)S(V[H],D,N,b,M)}function U(L){L.target.removeEventListener("dispose",U);for(const N in c){const b=c[N],M=L.target.uuid;M in b&&(b[M].dispose(),delete b[M])}}}const tg={[bo]:So,[Eo]:To,[wo]:Co,[Ts]:Ao,[So]:bo,[To]:Eo,[Co]:wo,[Ao]:Ts};function ng(s,e){function t(){let G=!1;const De=new bt;let ge=null;const ze=new bt(0,0,0,0);return{setMask:function(ve){ge!==ve&&!G&&(s.colorMask(ve,ve,ve,ve),ge=ve)},setLocked:function(ve){G=ve},setClear:function(ve,he,Ge,lt,Lt){Lt===!0&&(ve*=lt,he*=lt,Ge*=lt),De.set(ve,he,Ge,lt),ze.equals(De)===!1&&(s.clearColor(ve,he,Ge,lt),ze.copy(De))},reset:function(){G=!1,ge=null,ze.set(-1,0,0,0)}}}function n(){let G=!1,De=!1,ge=null,ze=null,ve=null;return{setReversed:function(he){if(De!==he){const Ge=e.get("EXT_clip_control");he?Ge.clipControlEXT(Ge.LOWER_LEFT_EXT,Ge.ZERO_TO_ONE_EXT):Ge.clipControlEXT(Ge.LOWER_LEFT_EXT,Ge.NEGATIVE_ONE_TO_ONE_EXT),De=he;const lt=ve;ve=null,this.setClear(lt)}},getReversed:function(){return De},setTest:function(he){he?le(s.DEPTH_TEST):Ee(s.DEPTH_TEST)},setMask:function(he){ge!==he&&!G&&(s.depthMask(he),ge=he)},setFunc:function(he){if(De&&(he=tg[he]),ze!==he){switch(he){case bo:s.depthFunc(s.NEVER);break;case So:s.depthFunc(s.ALWAYS);break;case Eo:s.depthFunc(s.LESS);break;case Ts:s.depthFunc(s.LEQUAL);break;case wo:s.depthFunc(s.EQUAL);break;case Ao:s.depthFunc(s.GEQUAL);break;case To:s.depthFunc(s.GREATER);break;case Co:s.depthFunc(s.NOTEQUAL);break;default:s.depthFunc(s.LEQUAL)}ze=he}},setLocked:function(he){G=he},setClear:function(he){ve!==he&&(De&&(he=1-he),s.clearDepth(he),ve=he)},reset:function(){G=!1,ge=null,ze=null,ve=null,De=!1}}}function i(){let G=!1,De=null,ge=null,ze=null,ve=null,he=null,Ge=null,lt=null,Lt=null;return{setTest:function(pt){G||(pt?le(s.STENCIL_TEST):Ee(s.STENCIL_TEST))},setMask:function(pt){De!==pt&&!G&&(s.stencilMask(pt),De=pt)},setFunc:function(pt,en,vn){(ge!==pt||ze!==en||ve!==vn)&&(s.stencilFunc(pt,en,vn),ge=pt,ze=en,ve=vn)},setOp:function(pt,en,vn){(he!==pt||Ge!==en||lt!==vn)&&(s.stencilOp(pt,en,vn),he=pt,Ge=en,lt=vn)},setLocked:function(pt){G=pt},setClear:function(pt){Lt!==pt&&(s.clearStencil(pt),Lt=pt)},reset:function(){G=!1,De=null,ge=null,ze=null,ve=null,he=null,Ge=null,lt=null,Lt=null}}}const r=new t,a=new n,o=new i,l=new WeakMap,c=new WeakMap;let h={},f={},u=new WeakMap,d=[],m=null,_=!1,g=null,p=null,w=null,E=null,S=null,U=null,L=null,D=new et(0,0,0),N=0,b=!1,M=null,I=null,V=null,H=null,J=null;const ie=s.getParameter(s.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let B=!1,oe=0;const j=s.getParameter(s.VERSION);j.indexOf("WebGL")!==-1?(oe=parseFloat(/^WebGL (\d)/.exec(j)[1]),B=oe>=1):j.indexOf("OpenGL ES")!==-1&&(oe=parseFloat(/^OpenGL ES (\d)/.exec(j)[1]),B=oe>=2);let ue=null,pe={};const Me=s.getParameter(s.SCISSOR_BOX),Ue=s.getParameter(s.VIEWPORT),Ne=new bt().fromArray(Me),Y=new bt().fromArray(Ue);function se(G,De,ge,ze){const ve=new Uint8Array(4),he=s.createTexture();s.bindTexture(G,he),s.texParameteri(G,s.TEXTURE_MIN_FILTER,s.NEAREST),s.texParameteri(G,s.TEXTURE_MAG_FILTER,s.NEAREST);for(let Ge=0;Ge<ge;Ge++)G===s.TEXTURE_3D||G===s.TEXTURE_2D_ARRAY?s.texImage3D(De,0,s.RGBA,1,1,ze,0,s.RGBA,s.UNSIGNED_BYTE,ve):s.texImage2D(De+Ge,0,s.RGBA,1,1,0,s.RGBA,s.UNSIGNED_BYTE,ve);return he}const re={};re[s.TEXTURE_2D]=se(s.TEXTURE_2D,s.TEXTURE_2D,1),re[s.TEXTURE_CUBE_MAP]=se(s.TEXTURE_CUBE_MAP,s.TEXTURE_CUBE_MAP_POSITIVE_X,6),re[s.TEXTURE_2D_ARRAY]=se(s.TEXTURE_2D_ARRAY,s.TEXTURE_2D_ARRAY,1,1),re[s.TEXTURE_3D]=se(s.TEXTURE_3D,s.TEXTURE_3D,1,1),r.setClear(0,0,0,1),a.setClear(1),o.setClear(0),le(s.DEPTH_TEST),a.setFunc(Ts),dt(!1),ot(Xl),le(s.CULL_FACE),z(Ci);function le(G){h[G]!==!0&&(s.enable(G),h[G]=!0)}function Ee(G){h[G]!==!1&&(s.disable(G),h[G]=!1)}function fe(G,De){return f[G]!==De?(s.bindFramebuffer(G,De),f[G]=De,G===s.DRAW_FRAMEBUFFER&&(f[s.FRAMEBUFFER]=De),G===s.FRAMEBUFFER&&(f[s.DRAW_FRAMEBUFFER]=De),!0):!1}function be(G,De){let ge=d,ze=!1;if(G){ge=u.get(De),ge===void 0&&(ge=[],u.set(De,ge));const ve=G.textures;if(ge.length!==ve.length||ge[0]!==s.COLOR_ATTACHMENT0){for(let he=0,Ge=ve.length;he<Ge;he++)ge[he]=s.COLOR_ATTACHMENT0+he;ge.length=ve.length,ze=!0}}else ge[0]!==s.BACK&&(ge[0]=s.BACK,ze=!0);ze&&s.drawBuffers(ge)}function Je(G){return m!==G?(s.useProgram(G),m=G,!0):!1}const at={[Wi]:s.FUNC_ADD,[id]:s.FUNC_SUBTRACT,[sd]:s.FUNC_REVERSE_SUBTRACT};at[rd]=s.MIN,at[ad]=s.MAX;const it={[od]:s.ZERO,[ld]:s.ONE,[cd]:s.SRC_COLOR,[yo]:s.SRC_ALPHA,[md]:s.SRC_ALPHA_SATURATE,[fd]:s.DST_COLOR,[ud]:s.DST_ALPHA,[hd]:s.ONE_MINUS_SRC_COLOR,[Mo]:s.ONE_MINUS_SRC_ALPHA,[pd]:s.ONE_MINUS_DST_COLOR,[dd]:s.ONE_MINUS_DST_ALPHA,[gd]:s.CONSTANT_COLOR,[_d]:s.ONE_MINUS_CONSTANT_COLOR,[vd]:s.CONSTANT_ALPHA,[xd]:s.ONE_MINUS_CONSTANT_ALPHA};function z(G,De,ge,ze,ve,he,Ge,lt,Lt,pt){if(G===Ci){_===!0&&(Ee(s.BLEND),_=!1);return}if(_===!1&&(le(s.BLEND),_=!0),G!==nd){if(G!==g||pt!==b){if((p!==Wi||S!==Wi)&&(s.blendEquation(s.FUNC_ADD),p=Wi,S=Wi),pt)switch(G){case Es:s.blendFuncSeparate(s.ONE,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA);break;case ql:s.blendFunc(s.ONE,s.ONE);break;case jl:s.blendFuncSeparate(s.ZERO,s.ONE_MINUS_SRC_COLOR,s.ZERO,s.ONE);break;case Yl:s.blendFuncSeparate(s.ZERO,s.SRC_COLOR,s.ZERO,s.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",G);break}else switch(G){case Es:s.blendFuncSeparate(s.SRC_ALPHA,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA);break;case ql:s.blendFunc(s.SRC_ALPHA,s.ONE);break;case jl:s.blendFuncSeparate(s.ZERO,s.ONE_MINUS_SRC_COLOR,s.ZERO,s.ONE);break;case Yl:s.blendFunc(s.ZERO,s.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",G);break}w=null,E=null,U=null,L=null,D.set(0,0,0),N=0,g=G,b=pt}return}ve=ve||De,he=he||ge,Ge=Ge||ze,(De!==p||ve!==S)&&(s.blendEquationSeparate(at[De],at[ve]),p=De,S=ve),(ge!==w||ze!==E||he!==U||Ge!==L)&&(s.blendFuncSeparate(it[ge],it[ze],it[he],it[Ge]),w=ge,E=ze,U=he,L=Ge),(lt.equals(D)===!1||Lt!==N)&&(s.blendColor(lt.r,lt.g,lt.b,Lt),D.copy(lt),N=Lt),g=G,b=!1}function yt(G,De){G.side===un?Ee(s.CULL_FACE):le(s.CULL_FACE);let ge=G.side===gn;De&&(ge=!ge),dt(ge),G.blending===Es&&G.transparent===!1?z(Ci):z(G.blending,G.blendEquation,G.blendSrc,G.blendDst,G.blendEquationAlpha,G.blendSrcAlpha,G.blendDstAlpha,G.blendColor,G.blendAlpha,G.premultipliedAlpha),a.setFunc(G.depthFunc),a.setTest(G.depthTest),a.setMask(G.depthWrite),r.setMask(G.colorWrite);const ze=G.stencilWrite;o.setTest(ze),ze&&(o.setMask(G.stencilWriteMask),o.setFunc(G.stencilFunc,G.stencilRef,G.stencilFuncMask),o.setOp(G.stencilFail,G.stencilZFail,G.stencilZPass)),ae(G.polygonOffset,G.polygonOffsetFactor,G.polygonOffsetUnits),G.alphaToCoverage===!0?le(s.SAMPLE_ALPHA_TO_COVERAGE):Ee(s.SAMPLE_ALPHA_TO_COVERAGE)}function dt(G){M!==G&&(G?s.frontFace(s.CW):s.frontFace(s.CCW),M=G)}function ot(G){G!==ed?(le(s.CULL_FACE),G!==I&&(G===Xl?s.cullFace(s.BACK):G===td?s.cullFace(s.FRONT):s.cullFace(s.FRONT_AND_BACK))):Ee(s.CULL_FACE),I=G}function W(G){G!==V&&(B&&s.lineWidth(G),V=G)}function ae(G,De,ge){G?(le(s.POLYGON_OFFSET_FILL),(H!==De||J!==ge)&&(s.polygonOffset(De,ge),H=De,J=ge)):Ee(s.POLYGON_OFFSET_FILL)}function ne(G){G?le(s.SCISSOR_TEST):Ee(s.SCISSOR_TEST)}function ye(G){G===void 0&&(G=s.TEXTURE0+ie-1),ue!==G&&(s.activeTexture(G),ue=G)}function Oe(G,De,ge){ge===void 0&&(ue===null?ge=s.TEXTURE0+ie-1:ge=ue);let ze=pe[ge];ze===void 0&&(ze={type:void 0,texture:void 0},pe[ge]=ze),(ze.type!==G||ze.texture!==De)&&(ue!==ge&&(s.activeTexture(ge),ue=ge),s.bindTexture(G,De||re[G]),ze.type=G,ze.texture=De)}function T(){const G=pe[ue];G!==void 0&&G.type!==void 0&&(s.bindTexture(G.type,null),G.type=void 0,G.texture=void 0)}function y(){try{s.compressedTexImage2D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function k(){try{s.compressedTexImage3D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function K(){try{s.texSubImage2D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function Q(){try{s.texSubImage3D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function O(){try{s.compressedTexSubImage2D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function we(){try{s.compressedTexSubImage3D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function xe(){try{s.texStorage2D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function Se(){try{s.texStorage3D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function Ie(){try{s.texImage2D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function de(){try{s.texImage3D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function Pe(G){Ne.equals(G)===!1&&(s.scissor(G.x,G.y,G.z,G.w),Ne.copy(G))}function qe(G){Y.equals(G)===!1&&(s.viewport(G.x,G.y,G.z,G.w),Y.copy(G))}function ke(G,De){let ge=c.get(De);ge===void 0&&(ge=new WeakMap,c.set(De,ge));let ze=ge.get(G);ze===void 0&&(ze=s.getUniformBlockIndex(De,G.name),ge.set(G,ze))}function Ae(G,De){const ze=c.get(De).get(G);l.get(De)!==ze&&(s.uniformBlockBinding(De,ze,G.__bindingPointIndex),l.set(De,ze))}function rt(){s.disable(s.BLEND),s.disable(s.CULL_FACE),s.disable(s.DEPTH_TEST),s.disable(s.POLYGON_OFFSET_FILL),s.disable(s.SCISSOR_TEST),s.disable(s.STENCIL_TEST),s.disable(s.SAMPLE_ALPHA_TO_COVERAGE),s.blendEquation(s.FUNC_ADD),s.blendFunc(s.ONE,s.ZERO),s.blendFuncSeparate(s.ONE,s.ZERO,s.ONE,s.ZERO),s.blendColor(0,0,0,0),s.colorMask(!0,!0,!0,!0),s.clearColor(0,0,0,0),s.depthMask(!0),s.depthFunc(s.LESS),a.setReversed(!1),s.clearDepth(1),s.stencilMask(4294967295),s.stencilFunc(s.ALWAYS,0,4294967295),s.stencilOp(s.KEEP,s.KEEP,s.KEEP),s.clearStencil(0),s.cullFace(s.BACK),s.frontFace(s.CCW),s.polygonOffset(0,0),s.activeTexture(s.TEXTURE0),s.bindFramebuffer(s.FRAMEBUFFER,null),s.bindFramebuffer(s.DRAW_FRAMEBUFFER,null),s.bindFramebuffer(s.READ_FRAMEBUFFER,null),s.useProgram(null),s.lineWidth(1),s.scissor(0,0,s.canvas.width,s.canvas.height),s.viewport(0,0,s.canvas.width,s.canvas.height),h={},ue=null,pe={},f={},u=new WeakMap,d=[],m=null,_=!1,g=null,p=null,w=null,E=null,S=null,U=null,L=null,D=new et(0,0,0),N=0,b=!1,M=null,I=null,V=null,H=null,J=null,Ne.set(0,0,s.canvas.width,s.canvas.height),Y.set(0,0,s.canvas.width,s.canvas.height),r.reset(),a.reset(),o.reset()}return{buffers:{color:r,depth:a,stencil:o},enable:le,disable:Ee,bindFramebuffer:fe,drawBuffers:be,useProgram:Je,setBlending:z,setMaterial:yt,setFlipSided:dt,setCullFace:ot,setLineWidth:W,setPolygonOffset:ae,setScissorTest:ne,activeTexture:ye,bindTexture:Oe,unbindTexture:T,compressedTexImage2D:y,compressedTexImage3D:k,texImage2D:Ie,texImage3D:de,updateUBOMapping:ke,uniformBlockBinding:Ae,texStorage2D:xe,texStorage3D:Se,texSubImage2D:K,texSubImage3D:Q,compressedTexSubImage2D:O,compressedTexSubImage3D:we,scissor:Pe,viewport:qe,reset:rt}}function ig(s,e,t,n,i,r,a){const o=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new Be,h=new WeakMap;let f;const u=new WeakMap;let d=!1;try{d=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function m(T,y){return d?new OffscreenCanvas(T,y):rr("canvas")}function _(T,y,k){let K=1;const Q=Oe(T);if((Q.width>k||Q.height>k)&&(K=k/Math.max(Q.width,Q.height)),K<1)if(typeof HTMLImageElement<"u"&&T instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&T instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&T instanceof ImageBitmap||typeof VideoFrame<"u"&&T instanceof VideoFrame){const O=Math.floor(K*Q.width),we=Math.floor(K*Q.height);f===void 0&&(f=m(O,we));const xe=y?m(O,we):f;return xe.width=O,xe.height=we,xe.getContext("2d").drawImage(T,0,0,O,we),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+Q.width+"x"+Q.height+") to ("+O+"x"+we+")."),xe}else return"data"in T&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+Q.width+"x"+Q.height+")."),T;return T}function g(T){return T.generateMipmaps}function p(T){s.generateMipmap(T)}function w(T){return T.isWebGLCubeRenderTarget?s.TEXTURE_CUBE_MAP:T.isWebGL3DRenderTarget?s.TEXTURE_3D:T.isWebGLArrayRenderTarget||T.isCompressedArrayTexture?s.TEXTURE_2D_ARRAY:s.TEXTURE_2D}function E(T,y,k,K,Q=!1){if(T!==null){if(s[T]!==void 0)return s[T];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+T+"'")}let O=y;if(y===s.RED&&(k===s.FLOAT&&(O=s.R32F),k===s.HALF_FLOAT&&(O=s.R16F),k===s.UNSIGNED_BYTE&&(O=s.R8)),y===s.RED_INTEGER&&(k===s.UNSIGNED_BYTE&&(O=s.R8UI),k===s.UNSIGNED_SHORT&&(O=s.R16UI),k===s.UNSIGNED_INT&&(O=s.R32UI),k===s.BYTE&&(O=s.R8I),k===s.SHORT&&(O=s.R16I),k===s.INT&&(O=s.R32I)),y===s.RG&&(k===s.FLOAT&&(O=s.RG32F),k===s.HALF_FLOAT&&(O=s.RG16F),k===s.UNSIGNED_BYTE&&(O=s.RG8)),y===s.RG_INTEGER&&(k===s.UNSIGNED_BYTE&&(O=s.RG8UI),k===s.UNSIGNED_SHORT&&(O=s.RG16UI),k===s.UNSIGNED_INT&&(O=s.RG32UI),k===s.BYTE&&(O=s.RG8I),k===s.SHORT&&(O=s.RG16I),k===s.INT&&(O=s.RG32I)),y===s.RGB_INTEGER&&(k===s.UNSIGNED_BYTE&&(O=s.RGB8UI),k===s.UNSIGNED_SHORT&&(O=s.RGB16UI),k===s.UNSIGNED_INT&&(O=s.RGB32UI),k===s.BYTE&&(O=s.RGB8I),k===s.SHORT&&(O=s.RGB16I),k===s.INT&&(O=s.RGB32I)),y===s.RGBA_INTEGER&&(k===s.UNSIGNED_BYTE&&(O=s.RGBA8UI),k===s.UNSIGNED_SHORT&&(O=s.RGBA16UI),k===s.UNSIGNED_INT&&(O=s.RGBA32UI),k===s.BYTE&&(O=s.RGBA8I),k===s.SHORT&&(O=s.RGBA16I),k===s.INT&&(O=s.RGBA32I)),y===s.RGB&&k===s.UNSIGNED_INT_5_9_9_9_REV&&(O=s.RGB9_E5),y===s.RGBA){const we=Q?ha:Mt.getTransfer(K);k===s.FLOAT&&(O=s.RGBA32F),k===s.HALF_FLOAT&&(O=s.RGBA16F),k===s.UNSIGNED_BYTE&&(O=we===Ut?s.SRGB8_ALPHA8:s.RGBA8),k===s.UNSIGNED_SHORT_4_4_4_4&&(O=s.RGBA4),k===s.UNSIGNED_SHORT_5_5_5_1&&(O=s.RGB5_A1)}return(O===s.R16F||O===s.R32F||O===s.RG16F||O===s.RG32F||O===s.RGBA16F||O===s.RGBA32F)&&e.get("EXT_color_buffer_float"),O}function S(T,y){let k;return T?y===null||y===$i||y===nr?k=s.DEPTH24_STENCIL8:y===Qn?k=s.DEPTH32F_STENCIL8:y===tr&&(k=s.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):y===null||y===$i||y===nr?k=s.DEPTH_COMPONENT24:y===Qn?k=s.DEPTH_COMPONENT32F:y===tr&&(k=s.DEPTH_COMPONENT16),k}function U(T,y){return g(T)===!0||T.isFramebufferTexture&&T.minFilter!==Ln&&T.minFilter!==Rn?Math.log2(Math.max(y.width,y.height))+1:T.mipmaps!==void 0&&T.mipmaps.length>0?T.mipmaps.length:T.isCompressedTexture&&Array.isArray(T.image)?y.mipmaps.length:1}function L(T){const y=T.target;y.removeEventListener("dispose",L),N(y),y.isVideoTexture&&h.delete(y)}function D(T){const y=T.target;y.removeEventListener("dispose",D),M(y)}function N(T){const y=n.get(T);if(y.__webglInit===void 0)return;const k=T.source,K=u.get(k);if(K){const Q=K[y.__cacheKey];Q.usedTimes--,Q.usedTimes===0&&b(T),Object.keys(K).length===0&&u.delete(k)}n.remove(T)}function b(T){const y=n.get(T);s.deleteTexture(y.__webglTexture);const k=T.source,K=u.get(k);delete K[y.__cacheKey],a.memory.textures--}function M(T){const y=n.get(T);if(T.depthTexture&&(T.depthTexture.dispose(),n.remove(T.depthTexture)),T.isWebGLCubeRenderTarget)for(let K=0;K<6;K++){if(Array.isArray(y.__webglFramebuffer[K]))for(let Q=0;Q<y.__webglFramebuffer[K].length;Q++)s.deleteFramebuffer(y.__webglFramebuffer[K][Q]);else s.deleteFramebuffer(y.__webglFramebuffer[K]);y.__webglDepthbuffer&&s.deleteRenderbuffer(y.__webglDepthbuffer[K])}else{if(Array.isArray(y.__webglFramebuffer))for(let K=0;K<y.__webglFramebuffer.length;K++)s.deleteFramebuffer(y.__webglFramebuffer[K]);else s.deleteFramebuffer(y.__webglFramebuffer);if(y.__webglDepthbuffer&&s.deleteRenderbuffer(y.__webglDepthbuffer),y.__webglMultisampledFramebuffer&&s.deleteFramebuffer(y.__webglMultisampledFramebuffer),y.__webglColorRenderbuffer)for(let K=0;K<y.__webglColorRenderbuffer.length;K++)y.__webglColorRenderbuffer[K]&&s.deleteRenderbuffer(y.__webglColorRenderbuffer[K]);y.__webglDepthRenderbuffer&&s.deleteRenderbuffer(y.__webglDepthRenderbuffer)}const k=T.textures;for(let K=0,Q=k.length;K<Q;K++){const O=n.get(k[K]);O.__webglTexture&&(s.deleteTexture(O.__webglTexture),a.memory.textures--),n.remove(k[K])}n.remove(T)}let I=0;function V(){I=0}function H(){const T=I;return T>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+T+" texture units while this GPU supports only "+i.maxTextures),I+=1,T}function J(T){const y=[];return y.push(T.wrapS),y.push(T.wrapT),y.push(T.wrapR||0),y.push(T.magFilter),y.push(T.minFilter),y.push(T.anisotropy),y.push(T.internalFormat),y.push(T.format),y.push(T.type),y.push(T.generateMipmaps),y.push(T.premultiplyAlpha),y.push(T.flipY),y.push(T.unpackAlignment),y.push(T.colorSpace),y.join()}function ie(T,y){const k=n.get(T);if(T.isVideoTexture&&ne(T),T.isRenderTargetTexture===!1&&T.version>0&&k.__version!==T.version){const K=T.image;if(K===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(K.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{re(k,T,y);return}}t.bindTexture(s.TEXTURE_2D,k.__webglTexture,s.TEXTURE0+y)}function B(T,y){const k=n.get(T);if(T.version>0&&k.__version!==T.version){re(k,T,y);return}t.bindTexture(s.TEXTURE_2D_ARRAY,k.__webglTexture,s.TEXTURE0+y)}function oe(T,y){const k=n.get(T);if(T.version>0&&k.__version!==T.version){re(k,T,y);return}t.bindTexture(s.TEXTURE_3D,k.__webglTexture,s.TEXTURE0+y)}function j(T,y){const k=n.get(T);if(T.version>0&&k.__version!==T.version){le(k,T,y);return}t.bindTexture(s.TEXTURE_CUBE_MAP,k.__webglTexture,s.TEXTURE0+y)}const ue={[Zn]:s.REPEAT,[Hn]:s.CLAMP_TO_EDGE,[Po]:s.MIRRORED_REPEAT},pe={[Ln]:s.NEAREST,[Rd]:s.NEAREST_MIPMAP_NEAREST,[dr]:s.NEAREST_MIPMAP_LINEAR,[Rn]:s.LINEAR,[Aa]:s.LINEAR_MIPMAP_NEAREST,[di]:s.LINEAR_MIPMAP_LINEAR},Me={[Ud]:s.NEVER,[kd]:s.ALWAYS,[Id]:s.LESS,[eu]:s.LEQUAL,[Fd]:s.EQUAL,[Bd]:s.GEQUAL,[Od]:s.GREATER,[zd]:s.NOTEQUAL};function Ue(T,y){if(y.type===Qn&&e.has("OES_texture_float_linear")===!1&&(y.magFilter===Rn||y.magFilter===Aa||y.magFilter===dr||y.magFilter===di||y.minFilter===Rn||y.minFilter===Aa||y.minFilter===dr||y.minFilter===di)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),s.texParameteri(T,s.TEXTURE_WRAP_S,ue[y.wrapS]),s.texParameteri(T,s.TEXTURE_WRAP_T,ue[y.wrapT]),(T===s.TEXTURE_3D||T===s.TEXTURE_2D_ARRAY)&&s.texParameteri(T,s.TEXTURE_WRAP_R,ue[y.wrapR]),s.texParameteri(T,s.TEXTURE_MAG_FILTER,pe[y.magFilter]),s.texParameteri(T,s.TEXTURE_MIN_FILTER,pe[y.minFilter]),y.compareFunction&&(s.texParameteri(T,s.TEXTURE_COMPARE_MODE,s.COMPARE_REF_TO_TEXTURE),s.texParameteri(T,s.TEXTURE_COMPARE_FUNC,Me[y.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(y.magFilter===Ln||y.minFilter!==dr&&y.minFilter!==di||y.type===Qn&&e.has("OES_texture_float_linear")===!1)return;if(y.anisotropy>1||n.get(y).__currentAnisotropy){const k=e.get("EXT_texture_filter_anisotropic");s.texParameterf(T,k.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(y.anisotropy,i.getMaxAnisotropy())),n.get(y).__currentAnisotropy=y.anisotropy}}}function Ne(T,y){let k=!1;T.__webglInit===void 0&&(T.__webglInit=!0,y.addEventListener("dispose",L));const K=y.source;let Q=u.get(K);Q===void 0&&(Q={},u.set(K,Q));const O=J(y);if(O!==T.__cacheKey){Q[O]===void 0&&(Q[O]={texture:s.createTexture(),usedTimes:0},a.memory.textures++,k=!0),Q[O].usedTimes++;const we=Q[T.__cacheKey];we!==void 0&&(Q[T.__cacheKey].usedTimes--,we.usedTimes===0&&b(y)),T.__cacheKey=O,T.__webglTexture=Q[O].texture}return k}function Y(T,y,k){return Math.floor(Math.floor(T/k)/y)}function se(T,y,k,K){const O=T.updateRanges;if(O.length===0)t.texSubImage2D(s.TEXTURE_2D,0,0,0,y.width,y.height,k,K,y.data);else{O.sort((de,Pe)=>de.start-Pe.start);let we=0;for(let de=1;de<O.length;de++){const Pe=O[we],qe=O[de],ke=Pe.start+Pe.count,Ae=Y(qe.start,y.width,4),rt=Y(Pe.start,y.width,4);qe.start<=ke+1&&Ae===rt&&Y(qe.start+qe.count-1,y.width,4)===Ae?Pe.count=Math.max(Pe.count,qe.start+qe.count-Pe.start):(++we,O[we]=qe)}O.length=we+1;const xe=s.getParameter(s.UNPACK_ROW_LENGTH),Se=s.getParameter(s.UNPACK_SKIP_PIXELS),Ie=s.getParameter(s.UNPACK_SKIP_ROWS);s.pixelStorei(s.UNPACK_ROW_LENGTH,y.width);for(let de=0,Pe=O.length;de<Pe;de++){const qe=O[de],ke=Math.floor(qe.start/4),Ae=Math.ceil(qe.count/4),rt=ke%y.width,G=Math.floor(ke/y.width),De=Ae,ge=1;s.pixelStorei(s.UNPACK_SKIP_PIXELS,rt),s.pixelStorei(s.UNPACK_SKIP_ROWS,G),t.texSubImage2D(s.TEXTURE_2D,0,rt,G,De,ge,k,K,y.data)}T.clearUpdateRanges(),s.pixelStorei(s.UNPACK_ROW_LENGTH,xe),s.pixelStorei(s.UNPACK_SKIP_PIXELS,Se),s.pixelStorei(s.UNPACK_SKIP_ROWS,Ie)}}function re(T,y,k){let K=s.TEXTURE_2D;(y.isDataArrayTexture||y.isCompressedArrayTexture)&&(K=s.TEXTURE_2D_ARRAY),y.isData3DTexture&&(K=s.TEXTURE_3D);const Q=Ne(T,y),O=y.source;t.bindTexture(K,T.__webglTexture,s.TEXTURE0+k);const we=n.get(O);if(O.version!==we.__version||Q===!0){t.activeTexture(s.TEXTURE0+k);const xe=Mt.getPrimaries(Mt.workingColorSpace),Se=y.colorSpace===Ti?null:Mt.getPrimaries(y.colorSpace),Ie=y.colorSpace===Ti||xe===Se?s.NONE:s.BROWSER_DEFAULT_WEBGL;s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,y.flipY),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y.premultiplyAlpha),s.pixelStorei(s.UNPACK_ALIGNMENT,y.unpackAlignment),s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ie);let de=_(y.image,!1,i.maxTextureSize);de=ye(y,de);const Pe=r.convert(y.format,y.colorSpace),qe=r.convert(y.type);let ke=E(y.internalFormat,Pe,qe,y.colorSpace,y.isVideoTexture);Ue(K,y);let Ae;const rt=y.mipmaps,G=y.isVideoTexture!==!0,De=we.__version===void 0||Q===!0,ge=O.dataReady,ze=U(y,de);if(y.isDepthTexture)ke=S(y.format===sr,y.type),De&&(G?t.texStorage2D(s.TEXTURE_2D,1,ke,de.width,de.height):t.texImage2D(s.TEXTURE_2D,0,ke,de.width,de.height,0,Pe,qe,null));else if(y.isDataTexture)if(rt.length>0){G&&De&&t.texStorage2D(s.TEXTURE_2D,ze,ke,rt[0].width,rt[0].height);for(let ve=0,he=rt.length;ve<he;ve++)Ae=rt[ve],G?ge&&t.texSubImage2D(s.TEXTURE_2D,ve,0,0,Ae.width,Ae.height,Pe,qe,Ae.data):t.texImage2D(s.TEXTURE_2D,ve,ke,Ae.width,Ae.height,0,Pe,qe,Ae.data);y.generateMipmaps=!1}else G?(De&&t.texStorage2D(s.TEXTURE_2D,ze,ke,de.width,de.height),ge&&se(y,de,Pe,qe)):t.texImage2D(s.TEXTURE_2D,0,ke,de.width,de.height,0,Pe,qe,de.data);else if(y.isCompressedTexture)if(y.isCompressedArrayTexture){G&&De&&t.texStorage3D(s.TEXTURE_2D_ARRAY,ze,ke,rt[0].width,rt[0].height,de.depth);for(let ve=0,he=rt.length;ve<he;ve++)if(Ae=rt[ve],y.format!==Fn)if(Pe!==null)if(G){if(ge)if(y.layerUpdates.size>0){const Ge=Xc(Ae.width,Ae.height,y.format,y.type);for(const lt of y.layerUpdates){const Lt=Ae.data.subarray(lt*Ge/Ae.data.BYTES_PER_ELEMENT,(lt+1)*Ge/Ae.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(s.TEXTURE_2D_ARRAY,ve,0,0,lt,Ae.width,Ae.height,1,Pe,Lt)}y.clearLayerUpdates()}else t.compressedTexSubImage3D(s.TEXTURE_2D_ARRAY,ve,0,0,0,Ae.width,Ae.height,de.depth,Pe,Ae.data)}else t.compressedTexImage3D(s.TEXTURE_2D_ARRAY,ve,ke,Ae.width,Ae.height,de.depth,0,Ae.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else G?ge&&t.texSubImage3D(s.TEXTURE_2D_ARRAY,ve,0,0,0,Ae.width,Ae.height,de.depth,Pe,qe,Ae.data):t.texImage3D(s.TEXTURE_2D_ARRAY,ve,ke,Ae.width,Ae.height,de.depth,0,Pe,qe,Ae.data)}else{G&&De&&t.texStorage2D(s.TEXTURE_2D,ze,ke,rt[0].width,rt[0].height);for(let ve=0,he=rt.length;ve<he;ve++)Ae=rt[ve],y.format!==Fn?Pe!==null?G?ge&&t.compressedTexSubImage2D(s.TEXTURE_2D,ve,0,0,Ae.width,Ae.height,Pe,Ae.data):t.compressedTexImage2D(s.TEXTURE_2D,ve,ke,Ae.width,Ae.height,0,Ae.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):G?ge&&t.texSubImage2D(s.TEXTURE_2D,ve,0,0,Ae.width,Ae.height,Pe,qe,Ae.data):t.texImage2D(s.TEXTURE_2D,ve,ke,Ae.width,Ae.height,0,Pe,qe,Ae.data)}else if(y.isDataArrayTexture)if(G){if(De&&t.texStorage3D(s.TEXTURE_2D_ARRAY,ze,ke,de.width,de.height,de.depth),ge)if(y.layerUpdates.size>0){const ve=Xc(de.width,de.height,y.format,y.type);for(const he of y.layerUpdates){const Ge=de.data.subarray(he*ve/de.data.BYTES_PER_ELEMENT,(he+1)*ve/de.data.BYTES_PER_ELEMENT);t.texSubImage3D(s.TEXTURE_2D_ARRAY,0,0,0,he,de.width,de.height,1,Pe,qe,Ge)}y.clearLayerUpdates()}else t.texSubImage3D(s.TEXTURE_2D_ARRAY,0,0,0,0,de.width,de.height,de.depth,Pe,qe,de.data)}else t.texImage3D(s.TEXTURE_2D_ARRAY,0,ke,de.width,de.height,de.depth,0,Pe,qe,de.data);else if(y.isData3DTexture)G?(De&&t.texStorage3D(s.TEXTURE_3D,ze,ke,de.width,de.height,de.depth),ge&&t.texSubImage3D(s.TEXTURE_3D,0,0,0,0,de.width,de.height,de.depth,Pe,qe,de.data)):t.texImage3D(s.TEXTURE_3D,0,ke,de.width,de.height,de.depth,0,Pe,qe,de.data);else if(y.isFramebufferTexture){if(De)if(G)t.texStorage2D(s.TEXTURE_2D,ze,ke,de.width,de.height);else{let ve=de.width,he=de.height;for(let Ge=0;Ge<ze;Ge++)t.texImage2D(s.TEXTURE_2D,Ge,ke,ve,he,0,Pe,qe,null),ve>>=1,he>>=1}}else if(rt.length>0){if(G&&De){const ve=Oe(rt[0]);t.texStorage2D(s.TEXTURE_2D,ze,ke,ve.width,ve.height)}for(let ve=0,he=rt.length;ve<he;ve++)Ae=rt[ve],G?ge&&t.texSubImage2D(s.TEXTURE_2D,ve,0,0,Pe,qe,Ae):t.texImage2D(s.TEXTURE_2D,ve,ke,Pe,qe,Ae);y.generateMipmaps=!1}else if(G){if(De){const ve=Oe(de);t.texStorage2D(s.TEXTURE_2D,ze,ke,ve.width,ve.height)}ge&&t.texSubImage2D(s.TEXTURE_2D,0,0,0,Pe,qe,de)}else t.texImage2D(s.TEXTURE_2D,0,ke,Pe,qe,de);g(y)&&p(K),we.__version=O.version,y.onUpdate&&y.onUpdate(y)}T.__version=y.version}function le(T,y,k){if(y.image.length!==6)return;const K=Ne(T,y),Q=y.source;t.bindTexture(s.TEXTURE_CUBE_MAP,T.__webglTexture,s.TEXTURE0+k);const O=n.get(Q);if(Q.version!==O.__version||K===!0){t.activeTexture(s.TEXTURE0+k);const we=Mt.getPrimaries(Mt.workingColorSpace),xe=y.colorSpace===Ti?null:Mt.getPrimaries(y.colorSpace),Se=y.colorSpace===Ti||we===xe?s.NONE:s.BROWSER_DEFAULT_WEBGL;s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,y.flipY),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y.premultiplyAlpha),s.pixelStorei(s.UNPACK_ALIGNMENT,y.unpackAlignment),s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,Se);const Ie=y.isCompressedTexture||y.image[0].isCompressedTexture,de=y.image[0]&&y.image[0].isDataTexture,Pe=[];for(let he=0;he<6;he++)!Ie&&!de?Pe[he]=_(y.image[he],!0,i.maxCubemapSize):Pe[he]=de?y.image[he].image:y.image[he],Pe[he]=ye(y,Pe[he]);const qe=Pe[0],ke=r.convert(y.format,y.colorSpace),Ae=r.convert(y.type),rt=E(y.internalFormat,ke,Ae,y.colorSpace),G=y.isVideoTexture!==!0,De=O.__version===void 0||K===!0,ge=Q.dataReady;let ze=U(y,qe);Ue(s.TEXTURE_CUBE_MAP,y);let ve;if(Ie){G&&De&&t.texStorage2D(s.TEXTURE_CUBE_MAP,ze,rt,qe.width,qe.height);for(let he=0;he<6;he++){ve=Pe[he].mipmaps;for(let Ge=0;Ge<ve.length;Ge++){const lt=ve[Ge];y.format!==Fn?ke!==null?G?ge&&t.compressedTexSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+he,Ge,0,0,lt.width,lt.height,ke,lt.data):t.compressedTexImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+he,Ge,rt,lt.width,lt.height,0,lt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):G?ge&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+he,Ge,0,0,lt.width,lt.height,ke,Ae,lt.data):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+he,Ge,rt,lt.width,lt.height,0,ke,Ae,lt.data)}}}else{if(ve=y.mipmaps,G&&De){ve.length>0&&ze++;const he=Oe(Pe[0]);t.texStorage2D(s.TEXTURE_CUBE_MAP,ze,rt,he.width,he.height)}for(let he=0;he<6;he++)if(de){G?ge&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,0,0,Pe[he].width,Pe[he].height,ke,Ae,Pe[he].data):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,rt,Pe[he].width,Pe[he].height,0,ke,Ae,Pe[he].data);for(let Ge=0;Ge<ve.length;Ge++){const Lt=ve[Ge].image[he].image;G?ge&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+he,Ge+1,0,0,Lt.width,Lt.height,ke,Ae,Lt.data):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+he,Ge+1,rt,Lt.width,Lt.height,0,ke,Ae,Lt.data)}}else{G?ge&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,0,0,ke,Ae,Pe[he]):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,rt,ke,Ae,Pe[he]);for(let Ge=0;Ge<ve.length;Ge++){const lt=ve[Ge];G?ge&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+he,Ge+1,0,0,ke,Ae,lt.image[he]):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+he,Ge+1,rt,ke,Ae,lt.image[he])}}}g(y)&&p(s.TEXTURE_CUBE_MAP),O.__version=Q.version,y.onUpdate&&y.onUpdate(y)}T.__version=y.version}function Ee(T,y,k,K,Q,O){const we=r.convert(k.format,k.colorSpace),xe=r.convert(k.type),Se=E(k.internalFormat,we,xe,k.colorSpace),Ie=n.get(y),de=n.get(k);if(de.__renderTarget=y,!Ie.__hasExternalTextures){const Pe=Math.max(1,y.width>>O),qe=Math.max(1,y.height>>O);Q===s.TEXTURE_3D||Q===s.TEXTURE_2D_ARRAY?t.texImage3D(Q,O,Se,Pe,qe,y.depth,0,we,xe,null):t.texImage2D(Q,O,Se,Pe,qe,0,we,xe,null)}t.bindFramebuffer(s.FRAMEBUFFER,T),ae(y)?o.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER,K,Q,de.__webglTexture,0,W(y)):(Q===s.TEXTURE_2D||Q>=s.TEXTURE_CUBE_MAP_POSITIVE_X&&Q<=s.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&s.framebufferTexture2D(s.FRAMEBUFFER,K,Q,de.__webglTexture,O),t.bindFramebuffer(s.FRAMEBUFFER,null)}function fe(T,y,k){if(s.bindRenderbuffer(s.RENDERBUFFER,T),y.depthBuffer){const K=y.depthTexture,Q=K&&K.isDepthTexture?K.type:null,O=S(y.stencilBuffer,Q),we=y.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,xe=W(y);ae(y)?o.renderbufferStorageMultisampleEXT(s.RENDERBUFFER,xe,O,y.width,y.height):k?s.renderbufferStorageMultisample(s.RENDERBUFFER,xe,O,y.width,y.height):s.renderbufferStorage(s.RENDERBUFFER,O,y.width,y.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,we,s.RENDERBUFFER,T)}else{const K=y.textures;for(let Q=0;Q<K.length;Q++){const O=K[Q],we=r.convert(O.format,O.colorSpace),xe=r.convert(O.type),Se=E(O.internalFormat,we,xe,O.colorSpace),Ie=W(y);k&&ae(y)===!1?s.renderbufferStorageMultisample(s.RENDERBUFFER,Ie,Se,y.width,y.height):ae(y)?o.renderbufferStorageMultisampleEXT(s.RENDERBUFFER,Ie,Se,y.width,y.height):s.renderbufferStorage(s.RENDERBUFFER,Se,y.width,y.height)}}s.bindRenderbuffer(s.RENDERBUFFER,null)}function be(T,y){if(y&&y.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(s.FRAMEBUFFER,T),!(y.depthTexture&&y.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const K=n.get(y.depthTexture);K.__renderTarget=y,(!K.__webglTexture||y.depthTexture.image.width!==y.width||y.depthTexture.image.height!==y.height)&&(y.depthTexture.image.width=y.width,y.depthTexture.image.height=y.height,y.depthTexture.needsUpdate=!0),ie(y.depthTexture,0);const Q=K.__webglTexture,O=W(y);if(y.depthTexture.format===ir)ae(y)?o.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.TEXTURE_2D,Q,0,O):s.framebufferTexture2D(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.TEXTURE_2D,Q,0);else if(y.depthTexture.format===sr)ae(y)?o.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.TEXTURE_2D,Q,0,O):s.framebufferTexture2D(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.TEXTURE_2D,Q,0);else throw new Error("Unknown depthTexture format")}function Je(T){const y=n.get(T),k=T.isWebGLCubeRenderTarget===!0;if(y.__boundDepthTexture!==T.depthTexture){const K=T.depthTexture;if(y.__depthDisposeCallback&&y.__depthDisposeCallback(),K){const Q=()=>{delete y.__boundDepthTexture,delete y.__depthDisposeCallback,K.removeEventListener("dispose",Q)};K.addEventListener("dispose",Q),y.__depthDisposeCallback=Q}y.__boundDepthTexture=K}if(T.depthTexture&&!y.__autoAllocateDepthBuffer){if(k)throw new Error("target.depthTexture not supported in Cube render targets");const K=T.texture.mipmaps;K&&K.length>0?be(y.__webglFramebuffer[0],T):be(y.__webglFramebuffer,T)}else if(k){y.__webglDepthbuffer=[];for(let K=0;K<6;K++)if(t.bindFramebuffer(s.FRAMEBUFFER,y.__webglFramebuffer[K]),y.__webglDepthbuffer[K]===void 0)y.__webglDepthbuffer[K]=s.createRenderbuffer(),fe(y.__webglDepthbuffer[K],T,!1);else{const Q=T.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,O=y.__webglDepthbuffer[K];s.bindRenderbuffer(s.RENDERBUFFER,O),s.framebufferRenderbuffer(s.FRAMEBUFFER,Q,s.RENDERBUFFER,O)}}else{const K=T.texture.mipmaps;if(K&&K.length>0?t.bindFramebuffer(s.FRAMEBUFFER,y.__webglFramebuffer[0]):t.bindFramebuffer(s.FRAMEBUFFER,y.__webglFramebuffer),y.__webglDepthbuffer===void 0)y.__webglDepthbuffer=s.createRenderbuffer(),fe(y.__webglDepthbuffer,T,!1);else{const Q=T.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,O=y.__webglDepthbuffer;s.bindRenderbuffer(s.RENDERBUFFER,O),s.framebufferRenderbuffer(s.FRAMEBUFFER,Q,s.RENDERBUFFER,O)}}t.bindFramebuffer(s.FRAMEBUFFER,null)}function at(T,y,k){const K=n.get(T);y!==void 0&&Ee(K.__webglFramebuffer,T,T.texture,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,0),k!==void 0&&Je(T)}function it(T){const y=T.texture,k=n.get(T),K=n.get(y);T.addEventListener("dispose",D);const Q=T.textures,O=T.isWebGLCubeRenderTarget===!0,we=Q.length>1;if(we||(K.__webglTexture===void 0&&(K.__webglTexture=s.createTexture()),K.__version=y.version,a.memory.textures++),O){k.__webglFramebuffer=[];for(let xe=0;xe<6;xe++)if(y.mipmaps&&y.mipmaps.length>0){k.__webglFramebuffer[xe]=[];for(let Se=0;Se<y.mipmaps.length;Se++)k.__webglFramebuffer[xe][Se]=s.createFramebuffer()}else k.__webglFramebuffer[xe]=s.createFramebuffer()}else{if(y.mipmaps&&y.mipmaps.length>0){k.__webglFramebuffer=[];for(let xe=0;xe<y.mipmaps.length;xe++)k.__webglFramebuffer[xe]=s.createFramebuffer()}else k.__webglFramebuffer=s.createFramebuffer();if(we)for(let xe=0,Se=Q.length;xe<Se;xe++){const Ie=n.get(Q[xe]);Ie.__webglTexture===void 0&&(Ie.__webglTexture=s.createTexture(),a.memory.textures++)}if(T.samples>0&&ae(T)===!1){k.__webglMultisampledFramebuffer=s.createFramebuffer(),k.__webglColorRenderbuffer=[],t.bindFramebuffer(s.FRAMEBUFFER,k.__webglMultisampledFramebuffer);for(let xe=0;xe<Q.length;xe++){const Se=Q[xe];k.__webglColorRenderbuffer[xe]=s.createRenderbuffer(),s.bindRenderbuffer(s.RENDERBUFFER,k.__webglColorRenderbuffer[xe]);const Ie=r.convert(Se.format,Se.colorSpace),de=r.convert(Se.type),Pe=E(Se.internalFormat,Ie,de,Se.colorSpace,T.isXRRenderTarget===!0),qe=W(T);s.renderbufferStorageMultisample(s.RENDERBUFFER,qe,Pe,T.width,T.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+xe,s.RENDERBUFFER,k.__webglColorRenderbuffer[xe])}s.bindRenderbuffer(s.RENDERBUFFER,null),T.depthBuffer&&(k.__webglDepthRenderbuffer=s.createRenderbuffer(),fe(k.__webglDepthRenderbuffer,T,!0)),t.bindFramebuffer(s.FRAMEBUFFER,null)}}if(O){t.bindTexture(s.TEXTURE_CUBE_MAP,K.__webglTexture),Ue(s.TEXTURE_CUBE_MAP,y);for(let xe=0;xe<6;xe++)if(y.mipmaps&&y.mipmaps.length>0)for(let Se=0;Se<y.mipmaps.length;Se++)Ee(k.__webglFramebuffer[xe][Se],T,y,s.COLOR_ATTACHMENT0,s.TEXTURE_CUBE_MAP_POSITIVE_X+xe,Se);else Ee(k.__webglFramebuffer[xe],T,y,s.COLOR_ATTACHMENT0,s.TEXTURE_CUBE_MAP_POSITIVE_X+xe,0);g(y)&&p(s.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(we){for(let xe=0,Se=Q.length;xe<Se;xe++){const Ie=Q[xe],de=n.get(Ie);t.bindTexture(s.TEXTURE_2D,de.__webglTexture),Ue(s.TEXTURE_2D,Ie),Ee(k.__webglFramebuffer,T,Ie,s.COLOR_ATTACHMENT0+xe,s.TEXTURE_2D,0),g(Ie)&&p(s.TEXTURE_2D)}t.unbindTexture()}else{let xe=s.TEXTURE_2D;if((T.isWebGL3DRenderTarget||T.isWebGLArrayRenderTarget)&&(xe=T.isWebGL3DRenderTarget?s.TEXTURE_3D:s.TEXTURE_2D_ARRAY),t.bindTexture(xe,K.__webglTexture),Ue(xe,y),y.mipmaps&&y.mipmaps.length>0)for(let Se=0;Se<y.mipmaps.length;Se++)Ee(k.__webglFramebuffer[Se],T,y,s.COLOR_ATTACHMENT0,xe,Se);else Ee(k.__webglFramebuffer,T,y,s.COLOR_ATTACHMENT0,xe,0);g(y)&&p(xe),t.unbindTexture()}T.depthBuffer&&Je(T)}function z(T){const y=T.textures;for(let k=0,K=y.length;k<K;k++){const Q=y[k];if(g(Q)){const O=w(T),we=n.get(Q).__webglTexture;t.bindTexture(O,we),p(O),t.unbindTexture()}}}const yt=[],dt=[];function ot(T){if(T.samples>0){if(ae(T)===!1){const y=T.textures,k=T.width,K=T.height;let Q=s.COLOR_BUFFER_BIT;const O=T.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,we=n.get(T),xe=y.length>1;if(xe)for(let Ie=0;Ie<y.length;Ie++)t.bindFramebuffer(s.FRAMEBUFFER,we.__webglMultisampledFramebuffer),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+Ie,s.RENDERBUFFER,null),t.bindFramebuffer(s.FRAMEBUFFER,we.__webglFramebuffer),s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,s.COLOR_ATTACHMENT0+Ie,s.TEXTURE_2D,null,0);t.bindFramebuffer(s.READ_FRAMEBUFFER,we.__webglMultisampledFramebuffer);const Se=T.texture.mipmaps;Se&&Se.length>0?t.bindFramebuffer(s.DRAW_FRAMEBUFFER,we.__webglFramebuffer[0]):t.bindFramebuffer(s.DRAW_FRAMEBUFFER,we.__webglFramebuffer);for(let Ie=0;Ie<y.length;Ie++){if(T.resolveDepthBuffer&&(T.depthBuffer&&(Q|=s.DEPTH_BUFFER_BIT),T.stencilBuffer&&T.resolveStencilBuffer&&(Q|=s.STENCIL_BUFFER_BIT)),xe){s.framebufferRenderbuffer(s.READ_FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.RENDERBUFFER,we.__webglColorRenderbuffer[Ie]);const de=n.get(y[Ie]).__webglTexture;s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,de,0)}s.blitFramebuffer(0,0,k,K,0,0,k,K,Q,s.NEAREST),l===!0&&(yt.length=0,dt.length=0,yt.push(s.COLOR_ATTACHMENT0+Ie),T.depthBuffer&&T.resolveDepthBuffer===!1&&(yt.push(O),dt.push(O),s.invalidateFramebuffer(s.DRAW_FRAMEBUFFER,dt)),s.invalidateFramebuffer(s.READ_FRAMEBUFFER,yt))}if(t.bindFramebuffer(s.READ_FRAMEBUFFER,null),t.bindFramebuffer(s.DRAW_FRAMEBUFFER,null),xe)for(let Ie=0;Ie<y.length;Ie++){t.bindFramebuffer(s.FRAMEBUFFER,we.__webglMultisampledFramebuffer),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+Ie,s.RENDERBUFFER,we.__webglColorRenderbuffer[Ie]);const de=n.get(y[Ie]).__webglTexture;t.bindFramebuffer(s.FRAMEBUFFER,we.__webglFramebuffer),s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,s.COLOR_ATTACHMENT0+Ie,s.TEXTURE_2D,de,0)}t.bindFramebuffer(s.DRAW_FRAMEBUFFER,we.__webglMultisampledFramebuffer)}else if(T.depthBuffer&&T.resolveDepthBuffer===!1&&l){const y=T.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT;s.invalidateFramebuffer(s.DRAW_FRAMEBUFFER,[y])}}}function W(T){return Math.min(i.maxSamples,T.samples)}function ae(T){const y=n.get(T);return T.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&y.__useRenderToTexture!==!1}function ne(T){const y=a.render.frame;h.get(T)!==y&&(h.set(T,y),T.update())}function ye(T,y){const k=T.colorSpace,K=T.format,Q=T.type;return T.isCompressedTexture===!0||T.isVideoTexture===!0||k!==Ls&&k!==Ti&&(Mt.getTransfer(k)===Ut?(K!==Fn||Q!==ni)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",k)),y}function Oe(T){return typeof HTMLImageElement<"u"&&T instanceof HTMLImageElement?(c.width=T.naturalWidth||T.width,c.height=T.naturalHeight||T.height):typeof VideoFrame<"u"&&T instanceof VideoFrame?(c.width=T.displayWidth,c.height=T.displayHeight):(c.width=T.width,c.height=T.height),c}this.allocateTextureUnit=H,this.resetTextureUnits=V,this.setTexture2D=ie,this.setTexture2DArray=B,this.setTexture3D=oe,this.setTextureCube=j,this.rebindTextures=at,this.setupRenderTarget=it,this.updateRenderTargetMipmap=z,this.updateMultisampleRenderTarget=ot,this.setupDepthRenderbuffer=Je,this.setupFrameBufferTexture=Ee,this.useMultisampledRTT=ae}function sg(s,e){function t(n,i=Ti){let r;const a=Mt.getTransfer(i);if(n===ni)return s.UNSIGNED_BYTE;if(n===xl)return s.UNSIGNED_SHORT_4_4_4_4;if(n===yl)return s.UNSIGNED_SHORT_5_5_5_1;if(n===Yh)return s.UNSIGNED_INT_5_9_9_9_REV;if(n===qh)return s.BYTE;if(n===jh)return s.SHORT;if(n===tr)return s.UNSIGNED_SHORT;if(n===vl)return s.INT;if(n===$i)return s.UNSIGNED_INT;if(n===Qn)return s.FLOAT;if(n===or)return s.HALF_FLOAT;if(n===$h)return s.ALPHA;if(n===Jh)return s.RGB;if(n===Fn)return s.RGBA;if(n===ir)return s.DEPTH_COMPONENT;if(n===sr)return s.DEPTH_STENCIL;if(n===Kh)return s.RED;if(n===Ml)return s.RED_INTEGER;if(n===Zh)return s.RG;if(n===bl)return s.RG_INTEGER;if(n===Sl)return s.RGBA_INTEGER;if(n===ea||n===ta||n===na||n===ia)if(a===Ut)if(r=e.get("WEBGL_compressed_texture_s3tc_srgb"),r!==null){if(n===ea)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===ta)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===na)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===ia)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(r=e.get("WEBGL_compressed_texture_s3tc"),r!==null){if(n===ea)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===ta)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===na)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===ia)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===Do||n===No||n===Uo||n===Io)if(r=e.get("WEBGL_compressed_texture_pvrtc"),r!==null){if(n===Do)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===No)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Uo)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Io)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===Fo||n===Oo||n===zo)if(r=e.get("WEBGL_compressed_texture_etc"),r!==null){if(n===Fo||n===Oo)return a===Ut?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(n===zo)return a===Ut?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===Bo||n===ko||n===Vo||n===Ho||n===Go||n===Wo||n===Xo||n===qo||n===jo||n===Yo||n===$o||n===Jo||n===Ko||n===Zo)if(r=e.get("WEBGL_compressed_texture_astc"),r!==null){if(n===Bo)return a===Ut?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===ko)return a===Ut?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===Vo)return a===Ut?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===Ho)return a===Ut?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===Go)return a===Ut?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===Wo)return a===Ut?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===Xo)return a===Ut?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===qo)return a===Ut?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===jo)return a===Ut?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===Yo)return a===Ut?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===$o)return a===Ut?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===Jo)return a===Ut?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===Ko)return a===Ut?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===Zo)return a===Ut?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===sa||n===Qo||n===el)if(r=e.get("EXT_texture_compression_bptc"),r!==null){if(n===sa)return a===Ut?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===Qo)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===el)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===Qh||n===tl||n===nl||n===il)if(r=e.get("EXT_texture_compression_rgtc"),r!==null){if(n===sa)return r.COMPRESSED_RED_RGTC1_EXT;if(n===tl)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===nl)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===il)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===nr?s.UNSIGNED_INT_24_8:s[n]!==void 0?s[n]:null}return{convert:t}}const rg=`
|
|
3803
|
+
}`;function eg(s,e,t){let n=new Pl;const i=new Be,r=new Be,a=new bt,o=new sp({depthPacking:Dd}),l=new rp,c={},h=t.maxTextureSize,d={[Wn]:gn,[gn]:Wn,[un]:un},u=new mi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Be},radius:{value:4}},vertexShader:Z2,fragmentShader:Q2}),f=u.clone();f.defines.HORIZONTAL_PASS=1;const m=new Bt;m.setAttribute("position",new Ht(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new Ct(m,u),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Hh;let p=this.type;this.render=function(L,D,N){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||L.length===0)return;const b=s.getRenderTarget(),M=s.getActiveCubeFace(),I=s.getActiveMipmapLevel(),V=s.state;V.setBlending(Ci),V.buffers.color.setClear(1,1,1,1),V.buffers.depth.setTest(!0),V.setScissorTest(!1);const H=p!==ui&&this.type===ui,J=p===ui&&this.type!==ui;for(let ie=0,B=L.length;ie<B;ie++){const oe=L[ie],j=oe.shadow;if(j===void 0){console.warn("THREE.WebGLShadowMap:",oe,"has no shadow.");continue}if(j.autoUpdate===!1&&j.needsUpdate===!1)continue;i.copy(j.mapSize);const ue=j.getFrameExtents();if(i.multiply(ue),r.copy(j.mapSize),(i.x>h||i.y>h)&&(i.x>h&&(r.x=Math.floor(h/ue.x),i.x=r.x*ue.x,j.mapSize.x=r.x),i.y>h&&(r.y=Math.floor(h/ue.y),i.y=r.y*ue.y,j.mapSize.y=r.y)),j.map===null||H===!0||J===!0){const Me=this.type!==ui?{minFilter:Ln,magFilter:Ln}:{};j.map!==null&&j.map.dispose(),j.map=new Ji(i.x,i.y,Me),j.map.texture.name=oe.name+".shadowMap",j.camera.updateProjectionMatrix()}s.setRenderTarget(j.map),s.clear();const pe=j.getViewportCount();for(let Me=0;Me<pe;Me++){const Ue=j.getViewport(Me);a.set(r.x*Ue.x,r.y*Ue.y,r.x*Ue.z,r.y*Ue.w),V.viewport(a),j.updateMatrices(oe,Me),n=j.getFrustum(),S(D,N,j.camera,oe,this.type)}j.isPointLightShadow!==!0&&this.type===ui&&w(j,N),j.needsUpdate=!1}p=this.type,g.needsUpdate=!1,s.setRenderTarget(b,M,I)};function w(L,D){const N=e.update(_);u.defines.VSM_SAMPLES!==L.blurSamples&&(u.defines.VSM_SAMPLES=L.blurSamples,f.defines.VSM_SAMPLES=L.blurSamples,u.needsUpdate=!0,f.needsUpdate=!0),L.mapPass===null&&(L.mapPass=new Ji(i.x,i.y)),u.uniforms.shadow_pass.value=L.map.texture,u.uniforms.resolution.value=L.mapSize,u.uniforms.radius.value=L.radius,s.setRenderTarget(L.mapPass),s.clear(),s.renderBufferDirect(D,null,N,u,_,null),f.uniforms.shadow_pass.value=L.mapPass.texture,f.uniforms.resolution.value=L.mapSize,f.uniforms.radius.value=L.radius,s.setRenderTarget(L.map),s.clear(),s.renderBufferDirect(D,null,N,f,_,null)}function E(L,D,N,b){let M=null;const I=N.isPointLight===!0?L.customDistanceMaterial:L.customDepthMaterial;if(I!==void 0)M=I;else if(M=N.isPointLight===!0?l:o,s.localClippingEnabled&&D.clipShadows===!0&&Array.isArray(D.clippingPlanes)&&D.clippingPlanes.length!==0||D.displacementMap&&D.displacementScale!==0||D.alphaMap&&D.alphaTest>0||D.map&&D.alphaTest>0||D.alphaToCoverage===!0){const V=M.uuid,H=D.uuid;let J=c[V];J===void 0&&(J={},c[V]=J);let ie=J[H];ie===void 0&&(ie=M.clone(),J[H]=ie,D.addEventListener("dispose",U)),M=ie}if(M.visible=D.visible,M.wireframe=D.wireframe,b===ui?M.side=D.shadowSide!==null?D.shadowSide:D.side:M.side=D.shadowSide!==null?D.shadowSide:d[D.side],M.alphaMap=D.alphaMap,M.alphaTest=D.alphaToCoverage===!0?.5:D.alphaTest,M.map=D.map,M.clipShadows=D.clipShadows,M.clippingPlanes=D.clippingPlanes,M.clipIntersection=D.clipIntersection,M.displacementMap=D.displacementMap,M.displacementScale=D.displacementScale,M.displacementBias=D.displacementBias,M.wireframeLinewidth=D.wireframeLinewidth,M.linewidth=D.linewidth,N.isPointLight===!0&&M.isMeshDistanceMaterial===!0){const V=s.properties.get(M);V.light=N}return M}function S(L,D,N,b,M){if(L.visible===!1)return;if(L.layers.test(D.layers)&&(L.isMesh||L.isLine||L.isPoints)&&(L.castShadow||L.receiveShadow&&M===ui)&&(!L.frustumCulled||n.intersectsObject(L))){L.modelViewMatrix.multiplyMatrices(N.matrixWorldInverse,L.matrixWorld);const H=e.update(L),J=L.material;if(Array.isArray(J)){const ie=H.groups;for(let B=0,oe=ie.length;B<oe;B++){const j=ie[B],ue=J[j.materialIndex];if(ue&&ue.visible){const pe=E(L,ue,b,M);L.onBeforeShadow(s,L,D,N,H,pe,j),s.renderBufferDirect(N,null,H,pe,L,j),L.onAfterShadow(s,L,D,N,H,pe,j)}}}else if(J.visible){const ie=E(L,J,b,M);L.onBeforeShadow(s,L,D,N,H,ie,null),s.renderBufferDirect(N,null,H,ie,L,null),L.onAfterShadow(s,L,D,N,H,ie,null)}}const V=L.children;for(let H=0,J=V.length;H<J;H++)S(V[H],D,N,b,M)}function U(L){L.target.removeEventListener("dispose",U);for(const N in c){const b=c[N],M=L.target.uuid;M in b&&(b[M].dispose(),delete b[M])}}}const tg={[bo]:So,[Eo]:To,[wo]:Co,[Ts]:Ao,[So]:bo,[To]:Eo,[Co]:wo,[Ao]:Ts};function ng(s,e){function t(){let G=!1;const De=new bt;let ge=null;const ze=new bt(0,0,0,0);return{setMask:function(ve){ge!==ve&&!G&&(s.colorMask(ve,ve,ve,ve),ge=ve)},setLocked:function(ve){G=ve},setClear:function(ve,he,Ge,lt,Lt){Lt===!0&&(ve*=lt,he*=lt,Ge*=lt),De.set(ve,he,Ge,lt),ze.equals(De)===!1&&(s.clearColor(ve,he,Ge,lt),ze.copy(De))},reset:function(){G=!1,ge=null,ze.set(-1,0,0,0)}}}function n(){let G=!1,De=!1,ge=null,ze=null,ve=null;return{setReversed:function(he){if(De!==he){const Ge=e.get("EXT_clip_control");he?Ge.clipControlEXT(Ge.LOWER_LEFT_EXT,Ge.ZERO_TO_ONE_EXT):Ge.clipControlEXT(Ge.LOWER_LEFT_EXT,Ge.NEGATIVE_ONE_TO_ONE_EXT),De=he;const lt=ve;ve=null,this.setClear(lt)}},getReversed:function(){return De},setTest:function(he){he?le(s.DEPTH_TEST):Ee(s.DEPTH_TEST)},setMask:function(he){ge!==he&&!G&&(s.depthMask(he),ge=he)},setFunc:function(he){if(De&&(he=tg[he]),ze!==he){switch(he){case bo:s.depthFunc(s.NEVER);break;case So:s.depthFunc(s.ALWAYS);break;case Eo:s.depthFunc(s.LESS);break;case Ts:s.depthFunc(s.LEQUAL);break;case wo:s.depthFunc(s.EQUAL);break;case Ao:s.depthFunc(s.GEQUAL);break;case To:s.depthFunc(s.GREATER);break;case Co:s.depthFunc(s.NOTEQUAL);break;default:s.depthFunc(s.LEQUAL)}ze=he}},setLocked:function(he){G=he},setClear:function(he){ve!==he&&(De&&(he=1-he),s.clearDepth(he),ve=he)},reset:function(){G=!1,ge=null,ze=null,ve=null,De=!1}}}function i(){let G=!1,De=null,ge=null,ze=null,ve=null,he=null,Ge=null,lt=null,Lt=null;return{setTest:function(pt){G||(pt?le(s.STENCIL_TEST):Ee(s.STENCIL_TEST))},setMask:function(pt){De!==pt&&!G&&(s.stencilMask(pt),De=pt)},setFunc:function(pt,en,vn){(ge!==pt||ze!==en||ve!==vn)&&(s.stencilFunc(pt,en,vn),ge=pt,ze=en,ve=vn)},setOp:function(pt,en,vn){(he!==pt||Ge!==en||lt!==vn)&&(s.stencilOp(pt,en,vn),he=pt,Ge=en,lt=vn)},setLocked:function(pt){G=pt},setClear:function(pt){Lt!==pt&&(s.clearStencil(pt),Lt=pt)},reset:function(){G=!1,De=null,ge=null,ze=null,ve=null,he=null,Ge=null,lt=null,Lt=null}}}const r=new t,a=new n,o=new i,l=new WeakMap,c=new WeakMap;let h={},d={},u=new WeakMap,f=[],m=null,_=!1,g=null,p=null,w=null,E=null,S=null,U=null,L=null,D=new et(0,0,0),N=0,b=!1,M=null,I=null,V=null,H=null,J=null;const ie=s.getParameter(s.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let B=!1,oe=0;const j=s.getParameter(s.VERSION);j.indexOf("WebGL")!==-1?(oe=parseFloat(/^WebGL (\d)/.exec(j)[1]),B=oe>=1):j.indexOf("OpenGL ES")!==-1&&(oe=parseFloat(/^OpenGL ES (\d)/.exec(j)[1]),B=oe>=2);let ue=null,pe={};const Me=s.getParameter(s.SCISSOR_BOX),Ue=s.getParameter(s.VIEWPORT),Ne=new bt().fromArray(Me),$=new bt().fromArray(Ue);function se(G,De,ge,ze){const ve=new Uint8Array(4),he=s.createTexture();s.bindTexture(G,he),s.texParameteri(G,s.TEXTURE_MIN_FILTER,s.NEAREST),s.texParameteri(G,s.TEXTURE_MAG_FILTER,s.NEAREST);for(let Ge=0;Ge<ge;Ge++)G===s.TEXTURE_3D||G===s.TEXTURE_2D_ARRAY?s.texImage3D(De,0,s.RGBA,1,1,ze,0,s.RGBA,s.UNSIGNED_BYTE,ve):s.texImage2D(De+Ge,0,s.RGBA,1,1,0,s.RGBA,s.UNSIGNED_BYTE,ve);return he}const re={};re[s.TEXTURE_2D]=se(s.TEXTURE_2D,s.TEXTURE_2D,1),re[s.TEXTURE_CUBE_MAP]=se(s.TEXTURE_CUBE_MAP,s.TEXTURE_CUBE_MAP_POSITIVE_X,6),re[s.TEXTURE_2D_ARRAY]=se(s.TEXTURE_2D_ARRAY,s.TEXTURE_2D_ARRAY,1,1),re[s.TEXTURE_3D]=se(s.TEXTURE_3D,s.TEXTURE_3D,1,1),r.setClear(0,0,0,1),a.setClear(1),o.setClear(0),le(s.DEPTH_TEST),a.setFunc(Ts),dt(!1),ot(Xl),le(s.CULL_FACE),z(Ci);function le(G){h[G]!==!0&&(s.enable(G),h[G]=!0)}function Ee(G){h[G]!==!1&&(s.disable(G),h[G]=!1)}function fe(G,De){return d[G]!==De?(s.bindFramebuffer(G,De),d[G]=De,G===s.DRAW_FRAMEBUFFER&&(d[s.FRAMEBUFFER]=De),G===s.FRAMEBUFFER&&(d[s.DRAW_FRAMEBUFFER]=De),!0):!1}function be(G,De){let ge=f,ze=!1;if(G){ge=u.get(De),ge===void 0&&(ge=[],u.set(De,ge));const ve=G.textures;if(ge.length!==ve.length||ge[0]!==s.COLOR_ATTACHMENT0){for(let he=0,Ge=ve.length;he<Ge;he++)ge[he]=s.COLOR_ATTACHMENT0+he;ge.length=ve.length,ze=!0}}else ge[0]!==s.BACK&&(ge[0]=s.BACK,ze=!0);ze&&s.drawBuffers(ge)}function Je(G){return m!==G?(s.useProgram(G),m=G,!0):!1}const at={[Wi]:s.FUNC_ADD,[id]:s.FUNC_SUBTRACT,[sd]:s.FUNC_REVERSE_SUBTRACT};at[rd]=s.MIN,at[ad]=s.MAX;const it={[od]:s.ZERO,[ld]:s.ONE,[cd]:s.SRC_COLOR,[yo]:s.SRC_ALPHA,[md]:s.SRC_ALPHA_SATURATE,[fd]:s.DST_COLOR,[ud]:s.DST_ALPHA,[hd]:s.ONE_MINUS_SRC_COLOR,[Mo]:s.ONE_MINUS_SRC_ALPHA,[pd]:s.ONE_MINUS_DST_COLOR,[dd]:s.ONE_MINUS_DST_ALPHA,[gd]:s.CONSTANT_COLOR,[_d]:s.ONE_MINUS_CONSTANT_COLOR,[vd]:s.CONSTANT_ALPHA,[xd]:s.ONE_MINUS_CONSTANT_ALPHA};function z(G,De,ge,ze,ve,he,Ge,lt,Lt,pt){if(G===Ci){_===!0&&(Ee(s.BLEND),_=!1);return}if(_===!1&&(le(s.BLEND),_=!0),G!==nd){if(G!==g||pt!==b){if((p!==Wi||S!==Wi)&&(s.blendEquation(s.FUNC_ADD),p=Wi,S=Wi),pt)switch(G){case Es:s.blendFuncSeparate(s.ONE,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA);break;case ql:s.blendFunc(s.ONE,s.ONE);break;case jl:s.blendFuncSeparate(s.ZERO,s.ONE_MINUS_SRC_COLOR,s.ZERO,s.ONE);break;case Yl:s.blendFuncSeparate(s.ZERO,s.SRC_COLOR,s.ZERO,s.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",G);break}else switch(G){case Es:s.blendFuncSeparate(s.SRC_ALPHA,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA);break;case ql:s.blendFunc(s.SRC_ALPHA,s.ONE);break;case jl:s.blendFuncSeparate(s.ZERO,s.ONE_MINUS_SRC_COLOR,s.ZERO,s.ONE);break;case Yl:s.blendFunc(s.ZERO,s.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",G);break}w=null,E=null,U=null,L=null,D.set(0,0,0),N=0,g=G,b=pt}return}ve=ve||De,he=he||ge,Ge=Ge||ze,(De!==p||ve!==S)&&(s.blendEquationSeparate(at[De],at[ve]),p=De,S=ve),(ge!==w||ze!==E||he!==U||Ge!==L)&&(s.blendFuncSeparate(it[ge],it[ze],it[he],it[Ge]),w=ge,E=ze,U=he,L=Ge),(lt.equals(D)===!1||Lt!==N)&&(s.blendColor(lt.r,lt.g,lt.b,Lt),D.copy(lt),N=Lt),g=G,b=!1}function yt(G,De){G.side===un?Ee(s.CULL_FACE):le(s.CULL_FACE);let ge=G.side===gn;De&&(ge=!ge),dt(ge),G.blending===Es&&G.transparent===!1?z(Ci):z(G.blending,G.blendEquation,G.blendSrc,G.blendDst,G.blendEquationAlpha,G.blendSrcAlpha,G.blendDstAlpha,G.blendColor,G.blendAlpha,G.premultipliedAlpha),a.setFunc(G.depthFunc),a.setTest(G.depthTest),a.setMask(G.depthWrite),r.setMask(G.colorWrite);const ze=G.stencilWrite;o.setTest(ze),ze&&(o.setMask(G.stencilWriteMask),o.setFunc(G.stencilFunc,G.stencilRef,G.stencilFuncMask),o.setOp(G.stencilFail,G.stencilZFail,G.stencilZPass)),ae(G.polygonOffset,G.polygonOffsetFactor,G.polygonOffsetUnits),G.alphaToCoverage===!0?le(s.SAMPLE_ALPHA_TO_COVERAGE):Ee(s.SAMPLE_ALPHA_TO_COVERAGE)}function dt(G){M!==G&&(G?s.frontFace(s.CW):s.frontFace(s.CCW),M=G)}function ot(G){G!==ed?(le(s.CULL_FACE),G!==I&&(G===Xl?s.cullFace(s.BACK):G===td?s.cullFace(s.FRONT):s.cullFace(s.FRONT_AND_BACK))):Ee(s.CULL_FACE),I=G}function W(G){G!==V&&(B&&s.lineWidth(G),V=G)}function ae(G,De,ge){G?(le(s.POLYGON_OFFSET_FILL),(H!==De||J!==ge)&&(s.polygonOffset(De,ge),H=De,J=ge)):Ee(s.POLYGON_OFFSET_FILL)}function ne(G){G?le(s.SCISSOR_TEST):Ee(s.SCISSOR_TEST)}function ye(G){G===void 0&&(G=s.TEXTURE0+ie-1),ue!==G&&(s.activeTexture(G),ue=G)}function Oe(G,De,ge){ge===void 0&&(ue===null?ge=s.TEXTURE0+ie-1:ge=ue);let ze=pe[ge];ze===void 0&&(ze={type:void 0,texture:void 0},pe[ge]=ze),(ze.type!==G||ze.texture!==De)&&(ue!==ge&&(s.activeTexture(ge),ue=ge),s.bindTexture(G,De||re[G]),ze.type=G,ze.texture=De)}function T(){const G=pe[ue];G!==void 0&&G.type!==void 0&&(s.bindTexture(G.type,null),G.type=void 0,G.texture=void 0)}function y(){try{s.compressedTexImage2D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function k(){try{s.compressedTexImage3D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function K(){try{s.texSubImage2D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function Q(){try{s.texSubImage3D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function O(){try{s.compressedTexSubImage2D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function we(){try{s.compressedTexSubImage3D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function xe(){try{s.texStorage2D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function Se(){try{s.texStorage3D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function Ie(){try{s.texImage2D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function de(){try{s.texImage3D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function Pe(G){Ne.equals(G)===!1&&(s.scissor(G.x,G.y,G.z,G.w),Ne.copy(G))}function qe(G){$.equals(G)===!1&&(s.viewport(G.x,G.y,G.z,G.w),$.copy(G))}function ke(G,De){let ge=c.get(De);ge===void 0&&(ge=new WeakMap,c.set(De,ge));let ze=ge.get(G);ze===void 0&&(ze=s.getUniformBlockIndex(De,G.name),ge.set(G,ze))}function Ae(G,De){const ze=c.get(De).get(G);l.get(De)!==ze&&(s.uniformBlockBinding(De,ze,G.__bindingPointIndex),l.set(De,ze))}function rt(){s.disable(s.BLEND),s.disable(s.CULL_FACE),s.disable(s.DEPTH_TEST),s.disable(s.POLYGON_OFFSET_FILL),s.disable(s.SCISSOR_TEST),s.disable(s.STENCIL_TEST),s.disable(s.SAMPLE_ALPHA_TO_COVERAGE),s.blendEquation(s.FUNC_ADD),s.blendFunc(s.ONE,s.ZERO),s.blendFuncSeparate(s.ONE,s.ZERO,s.ONE,s.ZERO),s.blendColor(0,0,0,0),s.colorMask(!0,!0,!0,!0),s.clearColor(0,0,0,0),s.depthMask(!0),s.depthFunc(s.LESS),a.setReversed(!1),s.clearDepth(1),s.stencilMask(4294967295),s.stencilFunc(s.ALWAYS,0,4294967295),s.stencilOp(s.KEEP,s.KEEP,s.KEEP),s.clearStencil(0),s.cullFace(s.BACK),s.frontFace(s.CCW),s.polygonOffset(0,0),s.activeTexture(s.TEXTURE0),s.bindFramebuffer(s.FRAMEBUFFER,null),s.bindFramebuffer(s.DRAW_FRAMEBUFFER,null),s.bindFramebuffer(s.READ_FRAMEBUFFER,null),s.useProgram(null),s.lineWidth(1),s.scissor(0,0,s.canvas.width,s.canvas.height),s.viewport(0,0,s.canvas.width,s.canvas.height),h={},ue=null,pe={},d={},u=new WeakMap,f=[],m=null,_=!1,g=null,p=null,w=null,E=null,S=null,U=null,L=null,D=new et(0,0,0),N=0,b=!1,M=null,I=null,V=null,H=null,J=null,Ne.set(0,0,s.canvas.width,s.canvas.height),$.set(0,0,s.canvas.width,s.canvas.height),r.reset(),a.reset(),o.reset()}return{buffers:{color:r,depth:a,stencil:o},enable:le,disable:Ee,bindFramebuffer:fe,drawBuffers:be,useProgram:Je,setBlending:z,setMaterial:yt,setFlipSided:dt,setCullFace:ot,setLineWidth:W,setPolygonOffset:ae,setScissorTest:ne,activeTexture:ye,bindTexture:Oe,unbindTexture:T,compressedTexImage2D:y,compressedTexImage3D:k,texImage2D:Ie,texImage3D:de,updateUBOMapping:ke,uniformBlockBinding:Ae,texStorage2D:xe,texStorage3D:Se,texSubImage2D:K,texSubImage3D:Q,compressedTexSubImage2D:O,compressedTexSubImage3D:we,scissor:Pe,viewport:qe,reset:rt}}function ig(s,e,t,n,i,r,a){const o=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new Be,h=new WeakMap;let d;const u=new WeakMap;let f=!1;try{f=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function m(T,y){return f?new OffscreenCanvas(T,y):rr("canvas")}function _(T,y,k){let K=1;const Q=Oe(T);if((Q.width>k||Q.height>k)&&(K=k/Math.max(Q.width,Q.height)),K<1)if(typeof HTMLImageElement<"u"&&T instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&T instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&T instanceof ImageBitmap||typeof VideoFrame<"u"&&T instanceof VideoFrame){const O=Math.floor(K*Q.width),we=Math.floor(K*Q.height);d===void 0&&(d=m(O,we));const xe=y?m(O,we):d;return xe.width=O,xe.height=we,xe.getContext("2d").drawImage(T,0,0,O,we),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+Q.width+"x"+Q.height+") to ("+O+"x"+we+")."),xe}else return"data"in T&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+Q.width+"x"+Q.height+")."),T;return T}function g(T){return T.generateMipmaps}function p(T){s.generateMipmap(T)}function w(T){return T.isWebGLCubeRenderTarget?s.TEXTURE_CUBE_MAP:T.isWebGL3DRenderTarget?s.TEXTURE_3D:T.isWebGLArrayRenderTarget||T.isCompressedArrayTexture?s.TEXTURE_2D_ARRAY:s.TEXTURE_2D}function E(T,y,k,K,Q=!1){if(T!==null){if(s[T]!==void 0)return s[T];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+T+"'")}let O=y;if(y===s.RED&&(k===s.FLOAT&&(O=s.R32F),k===s.HALF_FLOAT&&(O=s.R16F),k===s.UNSIGNED_BYTE&&(O=s.R8)),y===s.RED_INTEGER&&(k===s.UNSIGNED_BYTE&&(O=s.R8UI),k===s.UNSIGNED_SHORT&&(O=s.R16UI),k===s.UNSIGNED_INT&&(O=s.R32UI),k===s.BYTE&&(O=s.R8I),k===s.SHORT&&(O=s.R16I),k===s.INT&&(O=s.R32I)),y===s.RG&&(k===s.FLOAT&&(O=s.RG32F),k===s.HALF_FLOAT&&(O=s.RG16F),k===s.UNSIGNED_BYTE&&(O=s.RG8)),y===s.RG_INTEGER&&(k===s.UNSIGNED_BYTE&&(O=s.RG8UI),k===s.UNSIGNED_SHORT&&(O=s.RG16UI),k===s.UNSIGNED_INT&&(O=s.RG32UI),k===s.BYTE&&(O=s.RG8I),k===s.SHORT&&(O=s.RG16I),k===s.INT&&(O=s.RG32I)),y===s.RGB_INTEGER&&(k===s.UNSIGNED_BYTE&&(O=s.RGB8UI),k===s.UNSIGNED_SHORT&&(O=s.RGB16UI),k===s.UNSIGNED_INT&&(O=s.RGB32UI),k===s.BYTE&&(O=s.RGB8I),k===s.SHORT&&(O=s.RGB16I),k===s.INT&&(O=s.RGB32I)),y===s.RGBA_INTEGER&&(k===s.UNSIGNED_BYTE&&(O=s.RGBA8UI),k===s.UNSIGNED_SHORT&&(O=s.RGBA16UI),k===s.UNSIGNED_INT&&(O=s.RGBA32UI),k===s.BYTE&&(O=s.RGBA8I),k===s.SHORT&&(O=s.RGBA16I),k===s.INT&&(O=s.RGBA32I)),y===s.RGB&&k===s.UNSIGNED_INT_5_9_9_9_REV&&(O=s.RGB9_E5),y===s.RGBA){const we=Q?ha:Mt.getTransfer(K);k===s.FLOAT&&(O=s.RGBA32F),k===s.HALF_FLOAT&&(O=s.RGBA16F),k===s.UNSIGNED_BYTE&&(O=we===Ut?s.SRGB8_ALPHA8:s.RGBA8),k===s.UNSIGNED_SHORT_4_4_4_4&&(O=s.RGBA4),k===s.UNSIGNED_SHORT_5_5_5_1&&(O=s.RGB5_A1)}return(O===s.R16F||O===s.R32F||O===s.RG16F||O===s.RG32F||O===s.RGBA16F||O===s.RGBA32F)&&e.get("EXT_color_buffer_float"),O}function S(T,y){let k;return T?y===null||y===$i||y===nr?k=s.DEPTH24_STENCIL8:y===Qn?k=s.DEPTH32F_STENCIL8:y===tr&&(k=s.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):y===null||y===$i||y===nr?k=s.DEPTH_COMPONENT24:y===Qn?k=s.DEPTH_COMPONENT32F:y===tr&&(k=s.DEPTH_COMPONENT16),k}function U(T,y){return g(T)===!0||T.isFramebufferTexture&&T.minFilter!==Ln&&T.minFilter!==Rn?Math.log2(Math.max(y.width,y.height))+1:T.mipmaps!==void 0&&T.mipmaps.length>0?T.mipmaps.length:T.isCompressedTexture&&Array.isArray(T.image)?y.mipmaps.length:1}function L(T){const y=T.target;y.removeEventListener("dispose",L),N(y),y.isVideoTexture&&h.delete(y)}function D(T){const y=T.target;y.removeEventListener("dispose",D),M(y)}function N(T){const y=n.get(T);if(y.__webglInit===void 0)return;const k=T.source,K=u.get(k);if(K){const Q=K[y.__cacheKey];Q.usedTimes--,Q.usedTimes===0&&b(T),Object.keys(K).length===0&&u.delete(k)}n.remove(T)}function b(T){const y=n.get(T);s.deleteTexture(y.__webglTexture);const k=T.source,K=u.get(k);delete K[y.__cacheKey],a.memory.textures--}function M(T){const y=n.get(T);if(T.depthTexture&&(T.depthTexture.dispose(),n.remove(T.depthTexture)),T.isWebGLCubeRenderTarget)for(let K=0;K<6;K++){if(Array.isArray(y.__webglFramebuffer[K]))for(let Q=0;Q<y.__webglFramebuffer[K].length;Q++)s.deleteFramebuffer(y.__webglFramebuffer[K][Q]);else s.deleteFramebuffer(y.__webglFramebuffer[K]);y.__webglDepthbuffer&&s.deleteRenderbuffer(y.__webglDepthbuffer[K])}else{if(Array.isArray(y.__webglFramebuffer))for(let K=0;K<y.__webglFramebuffer.length;K++)s.deleteFramebuffer(y.__webglFramebuffer[K]);else s.deleteFramebuffer(y.__webglFramebuffer);if(y.__webglDepthbuffer&&s.deleteRenderbuffer(y.__webglDepthbuffer),y.__webglMultisampledFramebuffer&&s.deleteFramebuffer(y.__webglMultisampledFramebuffer),y.__webglColorRenderbuffer)for(let K=0;K<y.__webglColorRenderbuffer.length;K++)y.__webglColorRenderbuffer[K]&&s.deleteRenderbuffer(y.__webglColorRenderbuffer[K]);y.__webglDepthRenderbuffer&&s.deleteRenderbuffer(y.__webglDepthRenderbuffer)}const k=T.textures;for(let K=0,Q=k.length;K<Q;K++){const O=n.get(k[K]);O.__webglTexture&&(s.deleteTexture(O.__webglTexture),a.memory.textures--),n.remove(k[K])}n.remove(T)}let I=0;function V(){I=0}function H(){const T=I;return T>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+T+" texture units while this GPU supports only "+i.maxTextures),I+=1,T}function J(T){const y=[];return y.push(T.wrapS),y.push(T.wrapT),y.push(T.wrapR||0),y.push(T.magFilter),y.push(T.minFilter),y.push(T.anisotropy),y.push(T.internalFormat),y.push(T.format),y.push(T.type),y.push(T.generateMipmaps),y.push(T.premultiplyAlpha),y.push(T.flipY),y.push(T.unpackAlignment),y.push(T.colorSpace),y.join()}function ie(T,y){const k=n.get(T);if(T.isVideoTexture&&ne(T),T.isRenderTargetTexture===!1&&T.version>0&&k.__version!==T.version){const K=T.image;if(K===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(K.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{re(k,T,y);return}}t.bindTexture(s.TEXTURE_2D,k.__webglTexture,s.TEXTURE0+y)}function B(T,y){const k=n.get(T);if(T.version>0&&k.__version!==T.version){re(k,T,y);return}t.bindTexture(s.TEXTURE_2D_ARRAY,k.__webglTexture,s.TEXTURE0+y)}function oe(T,y){const k=n.get(T);if(T.version>0&&k.__version!==T.version){re(k,T,y);return}t.bindTexture(s.TEXTURE_3D,k.__webglTexture,s.TEXTURE0+y)}function j(T,y){const k=n.get(T);if(T.version>0&&k.__version!==T.version){le(k,T,y);return}t.bindTexture(s.TEXTURE_CUBE_MAP,k.__webglTexture,s.TEXTURE0+y)}const ue={[Zn]:s.REPEAT,[Hn]:s.CLAMP_TO_EDGE,[Po]:s.MIRRORED_REPEAT},pe={[Ln]:s.NEAREST,[Rd]:s.NEAREST_MIPMAP_NEAREST,[dr]:s.NEAREST_MIPMAP_LINEAR,[Rn]:s.LINEAR,[Aa]:s.LINEAR_MIPMAP_NEAREST,[di]:s.LINEAR_MIPMAP_LINEAR},Me={[Ud]:s.NEVER,[kd]:s.ALWAYS,[Id]:s.LESS,[eu]:s.LEQUAL,[Fd]:s.EQUAL,[Bd]:s.GEQUAL,[Od]:s.GREATER,[zd]:s.NOTEQUAL};function Ue(T,y){if(y.type===Qn&&e.has("OES_texture_float_linear")===!1&&(y.magFilter===Rn||y.magFilter===Aa||y.magFilter===dr||y.magFilter===di||y.minFilter===Rn||y.minFilter===Aa||y.minFilter===dr||y.minFilter===di)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),s.texParameteri(T,s.TEXTURE_WRAP_S,ue[y.wrapS]),s.texParameteri(T,s.TEXTURE_WRAP_T,ue[y.wrapT]),(T===s.TEXTURE_3D||T===s.TEXTURE_2D_ARRAY)&&s.texParameteri(T,s.TEXTURE_WRAP_R,ue[y.wrapR]),s.texParameteri(T,s.TEXTURE_MAG_FILTER,pe[y.magFilter]),s.texParameteri(T,s.TEXTURE_MIN_FILTER,pe[y.minFilter]),y.compareFunction&&(s.texParameteri(T,s.TEXTURE_COMPARE_MODE,s.COMPARE_REF_TO_TEXTURE),s.texParameteri(T,s.TEXTURE_COMPARE_FUNC,Me[y.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(y.magFilter===Ln||y.minFilter!==dr&&y.minFilter!==di||y.type===Qn&&e.has("OES_texture_float_linear")===!1)return;if(y.anisotropy>1||n.get(y).__currentAnisotropy){const k=e.get("EXT_texture_filter_anisotropic");s.texParameterf(T,k.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(y.anisotropy,i.getMaxAnisotropy())),n.get(y).__currentAnisotropy=y.anisotropy}}}function Ne(T,y){let k=!1;T.__webglInit===void 0&&(T.__webglInit=!0,y.addEventListener("dispose",L));const K=y.source;let Q=u.get(K);Q===void 0&&(Q={},u.set(K,Q));const O=J(y);if(O!==T.__cacheKey){Q[O]===void 0&&(Q[O]={texture:s.createTexture(),usedTimes:0},a.memory.textures++,k=!0),Q[O].usedTimes++;const we=Q[T.__cacheKey];we!==void 0&&(Q[T.__cacheKey].usedTimes--,we.usedTimes===0&&b(y)),T.__cacheKey=O,T.__webglTexture=Q[O].texture}return k}function $(T,y,k){return Math.floor(Math.floor(T/k)/y)}function se(T,y,k,K){const O=T.updateRanges;if(O.length===0)t.texSubImage2D(s.TEXTURE_2D,0,0,0,y.width,y.height,k,K,y.data);else{O.sort((de,Pe)=>de.start-Pe.start);let we=0;for(let de=1;de<O.length;de++){const Pe=O[we],qe=O[de],ke=Pe.start+Pe.count,Ae=$(qe.start,y.width,4),rt=$(Pe.start,y.width,4);qe.start<=ke+1&&Ae===rt&&$(qe.start+qe.count-1,y.width,4)===Ae?Pe.count=Math.max(Pe.count,qe.start+qe.count-Pe.start):(++we,O[we]=qe)}O.length=we+1;const xe=s.getParameter(s.UNPACK_ROW_LENGTH),Se=s.getParameter(s.UNPACK_SKIP_PIXELS),Ie=s.getParameter(s.UNPACK_SKIP_ROWS);s.pixelStorei(s.UNPACK_ROW_LENGTH,y.width);for(let de=0,Pe=O.length;de<Pe;de++){const qe=O[de],ke=Math.floor(qe.start/4),Ae=Math.ceil(qe.count/4),rt=ke%y.width,G=Math.floor(ke/y.width),De=Ae,ge=1;s.pixelStorei(s.UNPACK_SKIP_PIXELS,rt),s.pixelStorei(s.UNPACK_SKIP_ROWS,G),t.texSubImage2D(s.TEXTURE_2D,0,rt,G,De,ge,k,K,y.data)}T.clearUpdateRanges(),s.pixelStorei(s.UNPACK_ROW_LENGTH,xe),s.pixelStorei(s.UNPACK_SKIP_PIXELS,Se),s.pixelStorei(s.UNPACK_SKIP_ROWS,Ie)}}function re(T,y,k){let K=s.TEXTURE_2D;(y.isDataArrayTexture||y.isCompressedArrayTexture)&&(K=s.TEXTURE_2D_ARRAY),y.isData3DTexture&&(K=s.TEXTURE_3D);const Q=Ne(T,y),O=y.source;t.bindTexture(K,T.__webglTexture,s.TEXTURE0+k);const we=n.get(O);if(O.version!==we.__version||Q===!0){t.activeTexture(s.TEXTURE0+k);const xe=Mt.getPrimaries(Mt.workingColorSpace),Se=y.colorSpace===Ti?null:Mt.getPrimaries(y.colorSpace),Ie=y.colorSpace===Ti||xe===Se?s.NONE:s.BROWSER_DEFAULT_WEBGL;s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,y.flipY),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y.premultiplyAlpha),s.pixelStorei(s.UNPACK_ALIGNMENT,y.unpackAlignment),s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ie);let de=_(y.image,!1,i.maxTextureSize);de=ye(y,de);const Pe=r.convert(y.format,y.colorSpace),qe=r.convert(y.type);let ke=E(y.internalFormat,Pe,qe,y.colorSpace,y.isVideoTexture);Ue(K,y);let Ae;const rt=y.mipmaps,G=y.isVideoTexture!==!0,De=we.__version===void 0||Q===!0,ge=O.dataReady,ze=U(y,de);if(y.isDepthTexture)ke=S(y.format===sr,y.type),De&&(G?t.texStorage2D(s.TEXTURE_2D,1,ke,de.width,de.height):t.texImage2D(s.TEXTURE_2D,0,ke,de.width,de.height,0,Pe,qe,null));else if(y.isDataTexture)if(rt.length>0){G&&De&&t.texStorage2D(s.TEXTURE_2D,ze,ke,rt[0].width,rt[0].height);for(let ve=0,he=rt.length;ve<he;ve++)Ae=rt[ve],G?ge&&t.texSubImage2D(s.TEXTURE_2D,ve,0,0,Ae.width,Ae.height,Pe,qe,Ae.data):t.texImage2D(s.TEXTURE_2D,ve,ke,Ae.width,Ae.height,0,Pe,qe,Ae.data);y.generateMipmaps=!1}else G?(De&&t.texStorage2D(s.TEXTURE_2D,ze,ke,de.width,de.height),ge&&se(y,de,Pe,qe)):t.texImage2D(s.TEXTURE_2D,0,ke,de.width,de.height,0,Pe,qe,de.data);else if(y.isCompressedTexture)if(y.isCompressedArrayTexture){G&&De&&t.texStorage3D(s.TEXTURE_2D_ARRAY,ze,ke,rt[0].width,rt[0].height,de.depth);for(let ve=0,he=rt.length;ve<he;ve++)if(Ae=rt[ve],y.format!==Fn)if(Pe!==null)if(G){if(ge)if(y.layerUpdates.size>0){const Ge=Xc(Ae.width,Ae.height,y.format,y.type);for(const lt of y.layerUpdates){const Lt=Ae.data.subarray(lt*Ge/Ae.data.BYTES_PER_ELEMENT,(lt+1)*Ge/Ae.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(s.TEXTURE_2D_ARRAY,ve,0,0,lt,Ae.width,Ae.height,1,Pe,Lt)}y.clearLayerUpdates()}else t.compressedTexSubImage3D(s.TEXTURE_2D_ARRAY,ve,0,0,0,Ae.width,Ae.height,de.depth,Pe,Ae.data)}else t.compressedTexImage3D(s.TEXTURE_2D_ARRAY,ve,ke,Ae.width,Ae.height,de.depth,0,Ae.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else G?ge&&t.texSubImage3D(s.TEXTURE_2D_ARRAY,ve,0,0,0,Ae.width,Ae.height,de.depth,Pe,qe,Ae.data):t.texImage3D(s.TEXTURE_2D_ARRAY,ve,ke,Ae.width,Ae.height,de.depth,0,Pe,qe,Ae.data)}else{G&&De&&t.texStorage2D(s.TEXTURE_2D,ze,ke,rt[0].width,rt[0].height);for(let ve=0,he=rt.length;ve<he;ve++)Ae=rt[ve],y.format!==Fn?Pe!==null?G?ge&&t.compressedTexSubImage2D(s.TEXTURE_2D,ve,0,0,Ae.width,Ae.height,Pe,Ae.data):t.compressedTexImage2D(s.TEXTURE_2D,ve,ke,Ae.width,Ae.height,0,Ae.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):G?ge&&t.texSubImage2D(s.TEXTURE_2D,ve,0,0,Ae.width,Ae.height,Pe,qe,Ae.data):t.texImage2D(s.TEXTURE_2D,ve,ke,Ae.width,Ae.height,0,Pe,qe,Ae.data)}else if(y.isDataArrayTexture)if(G){if(De&&t.texStorage3D(s.TEXTURE_2D_ARRAY,ze,ke,de.width,de.height,de.depth),ge)if(y.layerUpdates.size>0){const ve=Xc(de.width,de.height,y.format,y.type);for(const he of y.layerUpdates){const Ge=de.data.subarray(he*ve/de.data.BYTES_PER_ELEMENT,(he+1)*ve/de.data.BYTES_PER_ELEMENT);t.texSubImage3D(s.TEXTURE_2D_ARRAY,0,0,0,he,de.width,de.height,1,Pe,qe,Ge)}y.clearLayerUpdates()}else t.texSubImage3D(s.TEXTURE_2D_ARRAY,0,0,0,0,de.width,de.height,de.depth,Pe,qe,de.data)}else t.texImage3D(s.TEXTURE_2D_ARRAY,0,ke,de.width,de.height,de.depth,0,Pe,qe,de.data);else if(y.isData3DTexture)G?(De&&t.texStorage3D(s.TEXTURE_3D,ze,ke,de.width,de.height,de.depth),ge&&t.texSubImage3D(s.TEXTURE_3D,0,0,0,0,de.width,de.height,de.depth,Pe,qe,de.data)):t.texImage3D(s.TEXTURE_3D,0,ke,de.width,de.height,de.depth,0,Pe,qe,de.data);else if(y.isFramebufferTexture){if(De)if(G)t.texStorage2D(s.TEXTURE_2D,ze,ke,de.width,de.height);else{let ve=de.width,he=de.height;for(let Ge=0;Ge<ze;Ge++)t.texImage2D(s.TEXTURE_2D,Ge,ke,ve,he,0,Pe,qe,null),ve>>=1,he>>=1}}else if(rt.length>0){if(G&&De){const ve=Oe(rt[0]);t.texStorage2D(s.TEXTURE_2D,ze,ke,ve.width,ve.height)}for(let ve=0,he=rt.length;ve<he;ve++)Ae=rt[ve],G?ge&&t.texSubImage2D(s.TEXTURE_2D,ve,0,0,Pe,qe,Ae):t.texImage2D(s.TEXTURE_2D,ve,ke,Pe,qe,Ae);y.generateMipmaps=!1}else if(G){if(De){const ve=Oe(de);t.texStorage2D(s.TEXTURE_2D,ze,ke,ve.width,ve.height)}ge&&t.texSubImage2D(s.TEXTURE_2D,0,0,0,Pe,qe,de)}else t.texImage2D(s.TEXTURE_2D,0,ke,Pe,qe,de);g(y)&&p(K),we.__version=O.version,y.onUpdate&&y.onUpdate(y)}T.__version=y.version}function le(T,y,k){if(y.image.length!==6)return;const K=Ne(T,y),Q=y.source;t.bindTexture(s.TEXTURE_CUBE_MAP,T.__webglTexture,s.TEXTURE0+k);const O=n.get(Q);if(Q.version!==O.__version||K===!0){t.activeTexture(s.TEXTURE0+k);const we=Mt.getPrimaries(Mt.workingColorSpace),xe=y.colorSpace===Ti?null:Mt.getPrimaries(y.colorSpace),Se=y.colorSpace===Ti||we===xe?s.NONE:s.BROWSER_DEFAULT_WEBGL;s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,y.flipY),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y.premultiplyAlpha),s.pixelStorei(s.UNPACK_ALIGNMENT,y.unpackAlignment),s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,Se);const Ie=y.isCompressedTexture||y.image[0].isCompressedTexture,de=y.image[0]&&y.image[0].isDataTexture,Pe=[];for(let he=0;he<6;he++)!Ie&&!de?Pe[he]=_(y.image[he],!0,i.maxCubemapSize):Pe[he]=de?y.image[he].image:y.image[he],Pe[he]=ye(y,Pe[he]);const qe=Pe[0],ke=r.convert(y.format,y.colorSpace),Ae=r.convert(y.type),rt=E(y.internalFormat,ke,Ae,y.colorSpace),G=y.isVideoTexture!==!0,De=O.__version===void 0||K===!0,ge=Q.dataReady;let ze=U(y,qe);Ue(s.TEXTURE_CUBE_MAP,y);let ve;if(Ie){G&&De&&t.texStorage2D(s.TEXTURE_CUBE_MAP,ze,rt,qe.width,qe.height);for(let he=0;he<6;he++){ve=Pe[he].mipmaps;for(let Ge=0;Ge<ve.length;Ge++){const lt=ve[Ge];y.format!==Fn?ke!==null?G?ge&&t.compressedTexSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+he,Ge,0,0,lt.width,lt.height,ke,lt.data):t.compressedTexImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+he,Ge,rt,lt.width,lt.height,0,lt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):G?ge&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+he,Ge,0,0,lt.width,lt.height,ke,Ae,lt.data):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+he,Ge,rt,lt.width,lt.height,0,ke,Ae,lt.data)}}}else{if(ve=y.mipmaps,G&&De){ve.length>0&&ze++;const he=Oe(Pe[0]);t.texStorage2D(s.TEXTURE_CUBE_MAP,ze,rt,he.width,he.height)}for(let he=0;he<6;he++)if(de){G?ge&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,0,0,Pe[he].width,Pe[he].height,ke,Ae,Pe[he].data):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,rt,Pe[he].width,Pe[he].height,0,ke,Ae,Pe[he].data);for(let Ge=0;Ge<ve.length;Ge++){const Lt=ve[Ge].image[he].image;G?ge&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+he,Ge+1,0,0,Lt.width,Lt.height,ke,Ae,Lt.data):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+he,Ge+1,rt,Lt.width,Lt.height,0,ke,Ae,Lt.data)}}else{G?ge&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,0,0,ke,Ae,Pe[he]):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,rt,ke,Ae,Pe[he]);for(let Ge=0;Ge<ve.length;Ge++){const lt=ve[Ge];G?ge&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+he,Ge+1,0,0,ke,Ae,lt.image[he]):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+he,Ge+1,rt,ke,Ae,lt.image[he])}}}g(y)&&p(s.TEXTURE_CUBE_MAP),O.__version=Q.version,y.onUpdate&&y.onUpdate(y)}T.__version=y.version}function Ee(T,y,k,K,Q,O){const we=r.convert(k.format,k.colorSpace),xe=r.convert(k.type),Se=E(k.internalFormat,we,xe,k.colorSpace),Ie=n.get(y),de=n.get(k);if(de.__renderTarget=y,!Ie.__hasExternalTextures){const Pe=Math.max(1,y.width>>O),qe=Math.max(1,y.height>>O);Q===s.TEXTURE_3D||Q===s.TEXTURE_2D_ARRAY?t.texImage3D(Q,O,Se,Pe,qe,y.depth,0,we,xe,null):t.texImage2D(Q,O,Se,Pe,qe,0,we,xe,null)}t.bindFramebuffer(s.FRAMEBUFFER,T),ae(y)?o.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER,K,Q,de.__webglTexture,0,W(y)):(Q===s.TEXTURE_2D||Q>=s.TEXTURE_CUBE_MAP_POSITIVE_X&&Q<=s.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&s.framebufferTexture2D(s.FRAMEBUFFER,K,Q,de.__webglTexture,O),t.bindFramebuffer(s.FRAMEBUFFER,null)}function fe(T,y,k){if(s.bindRenderbuffer(s.RENDERBUFFER,T),y.depthBuffer){const K=y.depthTexture,Q=K&&K.isDepthTexture?K.type:null,O=S(y.stencilBuffer,Q),we=y.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,xe=W(y);ae(y)?o.renderbufferStorageMultisampleEXT(s.RENDERBUFFER,xe,O,y.width,y.height):k?s.renderbufferStorageMultisample(s.RENDERBUFFER,xe,O,y.width,y.height):s.renderbufferStorage(s.RENDERBUFFER,O,y.width,y.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,we,s.RENDERBUFFER,T)}else{const K=y.textures;for(let Q=0;Q<K.length;Q++){const O=K[Q],we=r.convert(O.format,O.colorSpace),xe=r.convert(O.type),Se=E(O.internalFormat,we,xe,O.colorSpace),Ie=W(y);k&&ae(y)===!1?s.renderbufferStorageMultisample(s.RENDERBUFFER,Ie,Se,y.width,y.height):ae(y)?o.renderbufferStorageMultisampleEXT(s.RENDERBUFFER,Ie,Se,y.width,y.height):s.renderbufferStorage(s.RENDERBUFFER,Se,y.width,y.height)}}s.bindRenderbuffer(s.RENDERBUFFER,null)}function be(T,y){if(y&&y.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(s.FRAMEBUFFER,T),!(y.depthTexture&&y.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const K=n.get(y.depthTexture);K.__renderTarget=y,(!K.__webglTexture||y.depthTexture.image.width!==y.width||y.depthTexture.image.height!==y.height)&&(y.depthTexture.image.width=y.width,y.depthTexture.image.height=y.height,y.depthTexture.needsUpdate=!0),ie(y.depthTexture,0);const Q=K.__webglTexture,O=W(y);if(y.depthTexture.format===ir)ae(y)?o.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.TEXTURE_2D,Q,0,O):s.framebufferTexture2D(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.TEXTURE_2D,Q,0);else if(y.depthTexture.format===sr)ae(y)?o.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.TEXTURE_2D,Q,0,O):s.framebufferTexture2D(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.TEXTURE_2D,Q,0);else throw new Error("Unknown depthTexture format")}function Je(T){const y=n.get(T),k=T.isWebGLCubeRenderTarget===!0;if(y.__boundDepthTexture!==T.depthTexture){const K=T.depthTexture;if(y.__depthDisposeCallback&&y.__depthDisposeCallback(),K){const Q=()=>{delete y.__boundDepthTexture,delete y.__depthDisposeCallback,K.removeEventListener("dispose",Q)};K.addEventListener("dispose",Q),y.__depthDisposeCallback=Q}y.__boundDepthTexture=K}if(T.depthTexture&&!y.__autoAllocateDepthBuffer){if(k)throw new Error("target.depthTexture not supported in Cube render targets");const K=T.texture.mipmaps;K&&K.length>0?be(y.__webglFramebuffer[0],T):be(y.__webglFramebuffer,T)}else if(k){y.__webglDepthbuffer=[];for(let K=0;K<6;K++)if(t.bindFramebuffer(s.FRAMEBUFFER,y.__webglFramebuffer[K]),y.__webglDepthbuffer[K]===void 0)y.__webglDepthbuffer[K]=s.createRenderbuffer(),fe(y.__webglDepthbuffer[K],T,!1);else{const Q=T.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,O=y.__webglDepthbuffer[K];s.bindRenderbuffer(s.RENDERBUFFER,O),s.framebufferRenderbuffer(s.FRAMEBUFFER,Q,s.RENDERBUFFER,O)}}else{const K=T.texture.mipmaps;if(K&&K.length>0?t.bindFramebuffer(s.FRAMEBUFFER,y.__webglFramebuffer[0]):t.bindFramebuffer(s.FRAMEBUFFER,y.__webglFramebuffer),y.__webglDepthbuffer===void 0)y.__webglDepthbuffer=s.createRenderbuffer(),fe(y.__webglDepthbuffer,T,!1);else{const Q=T.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,O=y.__webglDepthbuffer;s.bindRenderbuffer(s.RENDERBUFFER,O),s.framebufferRenderbuffer(s.FRAMEBUFFER,Q,s.RENDERBUFFER,O)}}t.bindFramebuffer(s.FRAMEBUFFER,null)}function at(T,y,k){const K=n.get(T);y!==void 0&&Ee(K.__webglFramebuffer,T,T.texture,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,0),k!==void 0&&Je(T)}function it(T){const y=T.texture,k=n.get(T),K=n.get(y);T.addEventListener("dispose",D);const Q=T.textures,O=T.isWebGLCubeRenderTarget===!0,we=Q.length>1;if(we||(K.__webglTexture===void 0&&(K.__webglTexture=s.createTexture()),K.__version=y.version,a.memory.textures++),O){k.__webglFramebuffer=[];for(let xe=0;xe<6;xe++)if(y.mipmaps&&y.mipmaps.length>0){k.__webglFramebuffer[xe]=[];for(let Se=0;Se<y.mipmaps.length;Se++)k.__webglFramebuffer[xe][Se]=s.createFramebuffer()}else k.__webglFramebuffer[xe]=s.createFramebuffer()}else{if(y.mipmaps&&y.mipmaps.length>0){k.__webglFramebuffer=[];for(let xe=0;xe<y.mipmaps.length;xe++)k.__webglFramebuffer[xe]=s.createFramebuffer()}else k.__webglFramebuffer=s.createFramebuffer();if(we)for(let xe=0,Se=Q.length;xe<Se;xe++){const Ie=n.get(Q[xe]);Ie.__webglTexture===void 0&&(Ie.__webglTexture=s.createTexture(),a.memory.textures++)}if(T.samples>0&&ae(T)===!1){k.__webglMultisampledFramebuffer=s.createFramebuffer(),k.__webglColorRenderbuffer=[],t.bindFramebuffer(s.FRAMEBUFFER,k.__webglMultisampledFramebuffer);for(let xe=0;xe<Q.length;xe++){const Se=Q[xe];k.__webglColorRenderbuffer[xe]=s.createRenderbuffer(),s.bindRenderbuffer(s.RENDERBUFFER,k.__webglColorRenderbuffer[xe]);const Ie=r.convert(Se.format,Se.colorSpace),de=r.convert(Se.type),Pe=E(Se.internalFormat,Ie,de,Se.colorSpace,T.isXRRenderTarget===!0),qe=W(T);s.renderbufferStorageMultisample(s.RENDERBUFFER,qe,Pe,T.width,T.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+xe,s.RENDERBUFFER,k.__webglColorRenderbuffer[xe])}s.bindRenderbuffer(s.RENDERBUFFER,null),T.depthBuffer&&(k.__webglDepthRenderbuffer=s.createRenderbuffer(),fe(k.__webglDepthRenderbuffer,T,!0)),t.bindFramebuffer(s.FRAMEBUFFER,null)}}if(O){t.bindTexture(s.TEXTURE_CUBE_MAP,K.__webglTexture),Ue(s.TEXTURE_CUBE_MAP,y);for(let xe=0;xe<6;xe++)if(y.mipmaps&&y.mipmaps.length>0)for(let Se=0;Se<y.mipmaps.length;Se++)Ee(k.__webglFramebuffer[xe][Se],T,y,s.COLOR_ATTACHMENT0,s.TEXTURE_CUBE_MAP_POSITIVE_X+xe,Se);else Ee(k.__webglFramebuffer[xe],T,y,s.COLOR_ATTACHMENT0,s.TEXTURE_CUBE_MAP_POSITIVE_X+xe,0);g(y)&&p(s.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(we){for(let xe=0,Se=Q.length;xe<Se;xe++){const Ie=Q[xe],de=n.get(Ie);t.bindTexture(s.TEXTURE_2D,de.__webglTexture),Ue(s.TEXTURE_2D,Ie),Ee(k.__webglFramebuffer,T,Ie,s.COLOR_ATTACHMENT0+xe,s.TEXTURE_2D,0),g(Ie)&&p(s.TEXTURE_2D)}t.unbindTexture()}else{let xe=s.TEXTURE_2D;if((T.isWebGL3DRenderTarget||T.isWebGLArrayRenderTarget)&&(xe=T.isWebGL3DRenderTarget?s.TEXTURE_3D:s.TEXTURE_2D_ARRAY),t.bindTexture(xe,K.__webglTexture),Ue(xe,y),y.mipmaps&&y.mipmaps.length>0)for(let Se=0;Se<y.mipmaps.length;Se++)Ee(k.__webglFramebuffer[Se],T,y,s.COLOR_ATTACHMENT0,xe,Se);else Ee(k.__webglFramebuffer,T,y,s.COLOR_ATTACHMENT0,xe,0);g(y)&&p(xe),t.unbindTexture()}T.depthBuffer&&Je(T)}function z(T){const y=T.textures;for(let k=0,K=y.length;k<K;k++){const Q=y[k];if(g(Q)){const O=w(T),we=n.get(Q).__webglTexture;t.bindTexture(O,we),p(O),t.unbindTexture()}}}const yt=[],dt=[];function ot(T){if(T.samples>0){if(ae(T)===!1){const y=T.textures,k=T.width,K=T.height;let Q=s.COLOR_BUFFER_BIT;const O=T.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,we=n.get(T),xe=y.length>1;if(xe)for(let Ie=0;Ie<y.length;Ie++)t.bindFramebuffer(s.FRAMEBUFFER,we.__webglMultisampledFramebuffer),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+Ie,s.RENDERBUFFER,null),t.bindFramebuffer(s.FRAMEBUFFER,we.__webglFramebuffer),s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,s.COLOR_ATTACHMENT0+Ie,s.TEXTURE_2D,null,0);t.bindFramebuffer(s.READ_FRAMEBUFFER,we.__webglMultisampledFramebuffer);const Se=T.texture.mipmaps;Se&&Se.length>0?t.bindFramebuffer(s.DRAW_FRAMEBUFFER,we.__webglFramebuffer[0]):t.bindFramebuffer(s.DRAW_FRAMEBUFFER,we.__webglFramebuffer);for(let Ie=0;Ie<y.length;Ie++){if(T.resolveDepthBuffer&&(T.depthBuffer&&(Q|=s.DEPTH_BUFFER_BIT),T.stencilBuffer&&T.resolveStencilBuffer&&(Q|=s.STENCIL_BUFFER_BIT)),xe){s.framebufferRenderbuffer(s.READ_FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.RENDERBUFFER,we.__webglColorRenderbuffer[Ie]);const de=n.get(y[Ie]).__webglTexture;s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,de,0)}s.blitFramebuffer(0,0,k,K,0,0,k,K,Q,s.NEAREST),l===!0&&(yt.length=0,dt.length=0,yt.push(s.COLOR_ATTACHMENT0+Ie),T.depthBuffer&&T.resolveDepthBuffer===!1&&(yt.push(O),dt.push(O),s.invalidateFramebuffer(s.DRAW_FRAMEBUFFER,dt)),s.invalidateFramebuffer(s.READ_FRAMEBUFFER,yt))}if(t.bindFramebuffer(s.READ_FRAMEBUFFER,null),t.bindFramebuffer(s.DRAW_FRAMEBUFFER,null),xe)for(let Ie=0;Ie<y.length;Ie++){t.bindFramebuffer(s.FRAMEBUFFER,we.__webglMultisampledFramebuffer),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+Ie,s.RENDERBUFFER,we.__webglColorRenderbuffer[Ie]);const de=n.get(y[Ie]).__webglTexture;t.bindFramebuffer(s.FRAMEBUFFER,we.__webglFramebuffer),s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,s.COLOR_ATTACHMENT0+Ie,s.TEXTURE_2D,de,0)}t.bindFramebuffer(s.DRAW_FRAMEBUFFER,we.__webglMultisampledFramebuffer)}else if(T.depthBuffer&&T.resolveDepthBuffer===!1&&l){const y=T.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT;s.invalidateFramebuffer(s.DRAW_FRAMEBUFFER,[y])}}}function W(T){return Math.min(i.maxSamples,T.samples)}function ae(T){const y=n.get(T);return T.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&y.__useRenderToTexture!==!1}function ne(T){const y=a.render.frame;h.get(T)!==y&&(h.set(T,y),T.update())}function ye(T,y){const k=T.colorSpace,K=T.format,Q=T.type;return T.isCompressedTexture===!0||T.isVideoTexture===!0||k!==Ls&&k!==Ti&&(Mt.getTransfer(k)===Ut?(K!==Fn||Q!==ni)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",k)),y}function Oe(T){return typeof HTMLImageElement<"u"&&T instanceof HTMLImageElement?(c.width=T.naturalWidth||T.width,c.height=T.naturalHeight||T.height):typeof VideoFrame<"u"&&T instanceof VideoFrame?(c.width=T.displayWidth,c.height=T.displayHeight):(c.width=T.width,c.height=T.height),c}this.allocateTextureUnit=H,this.resetTextureUnits=V,this.setTexture2D=ie,this.setTexture2DArray=B,this.setTexture3D=oe,this.setTextureCube=j,this.rebindTextures=at,this.setupRenderTarget=it,this.updateRenderTargetMipmap=z,this.updateMultisampleRenderTarget=ot,this.setupDepthRenderbuffer=Je,this.setupFrameBufferTexture=Ee,this.useMultisampledRTT=ae}function sg(s,e){function t(n,i=Ti){let r;const a=Mt.getTransfer(i);if(n===ni)return s.UNSIGNED_BYTE;if(n===xl)return s.UNSIGNED_SHORT_4_4_4_4;if(n===yl)return s.UNSIGNED_SHORT_5_5_5_1;if(n===Yh)return s.UNSIGNED_INT_5_9_9_9_REV;if(n===qh)return s.BYTE;if(n===jh)return s.SHORT;if(n===tr)return s.UNSIGNED_SHORT;if(n===vl)return s.INT;if(n===$i)return s.UNSIGNED_INT;if(n===Qn)return s.FLOAT;if(n===or)return s.HALF_FLOAT;if(n===$h)return s.ALPHA;if(n===Jh)return s.RGB;if(n===Fn)return s.RGBA;if(n===ir)return s.DEPTH_COMPONENT;if(n===sr)return s.DEPTH_STENCIL;if(n===Kh)return s.RED;if(n===Ml)return s.RED_INTEGER;if(n===Zh)return s.RG;if(n===bl)return s.RG_INTEGER;if(n===Sl)return s.RGBA_INTEGER;if(n===ea||n===ta||n===na||n===ia)if(a===Ut)if(r=e.get("WEBGL_compressed_texture_s3tc_srgb"),r!==null){if(n===ea)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===ta)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===na)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===ia)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(r=e.get("WEBGL_compressed_texture_s3tc"),r!==null){if(n===ea)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===ta)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===na)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===ia)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===Do||n===No||n===Uo||n===Io)if(r=e.get("WEBGL_compressed_texture_pvrtc"),r!==null){if(n===Do)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===No)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Uo)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Io)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===Fo||n===Oo||n===zo)if(r=e.get("WEBGL_compressed_texture_etc"),r!==null){if(n===Fo||n===Oo)return a===Ut?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(n===zo)return a===Ut?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===Bo||n===ko||n===Vo||n===Ho||n===Go||n===Wo||n===Xo||n===qo||n===jo||n===Yo||n===$o||n===Jo||n===Ko||n===Zo)if(r=e.get("WEBGL_compressed_texture_astc"),r!==null){if(n===Bo)return a===Ut?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===ko)return a===Ut?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===Vo)return a===Ut?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===Ho)return a===Ut?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===Go)return a===Ut?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===Wo)return a===Ut?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===Xo)return a===Ut?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===qo)return a===Ut?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===jo)return a===Ut?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===Yo)return a===Ut?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===$o)return a===Ut?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===Jo)return a===Ut?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===Ko)return a===Ut?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===Zo)return a===Ut?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===sa||n===Qo||n===el)if(r=e.get("EXT_texture_compression_bptc"),r!==null){if(n===sa)return a===Ut?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===Qo)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===el)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===Qh||n===tl||n===nl||n===il)if(r=e.get("EXT_texture_compression_rgtc"),r!==null){if(n===sa)return r.COMPRESSED_RED_RGTC1_EXT;if(n===tl)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===nl)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===il)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===nr?s.UNSIGNED_INT_24_8:s[n]!==void 0?s[n]:null}return{convert:t}}const rg=`
|
|
3804
3804
|
void main() {
|
|
3805
3805
|
|
|
3806
3806
|
gl_Position = vec4( position, 1.0 );
|
|
@@ -3824,7 +3824,7 @@ void main() {
|
|
|
3824
3824
|
|
|
3825
3825
|
}
|
|
3826
3826
|
|
|
3827
|
-
}`;class og{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(this.texture===null){const i=new on,r=e.properties.get(i);r.__webglTexture=t.texture,(t.depthNear!==n.depthNear||t.depthFar!==n.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=i}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,n=new mi({vertexShader:rg,fragmentShader:ag,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Ct(new lr(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class lg extends Ki{constructor(e,t){super();const n=this;let i=null,r=1,a=null,o="local-floor",l=1,c=null,h=null,f=null,u=null,d=null,m=null;const _=new og,g=t.getContextAttributes();let p=null,w=null;const E=[],S=[],U=new Be;let L=null;const D=new an;D.viewport=new bt;const N=new an;N.viewport=new bt;const b=[D,N],M=new Ep;let I=null,V=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Y){let se=E[Y];return se===void 0&&(se=new Ya,E[Y]=se),se.getTargetRaySpace()},this.getControllerGrip=function(Y){let se=E[Y];return se===void 0&&(se=new Ya,E[Y]=se),se.getGripSpace()},this.getHand=function(Y){let se=E[Y];return se===void 0&&(se=new Ya,E[Y]=se),se.getHandSpace()};function H(Y){const se=S.indexOf(Y.inputSource);if(se===-1)return;const re=E[se];re!==void 0&&(re.update(Y.inputSource,Y.frame,c||a),re.dispatchEvent({type:Y.type,data:Y.inputSource}))}function J(){i.removeEventListener("select",H),i.removeEventListener("selectstart",H),i.removeEventListener("selectend",H),i.removeEventListener("squeeze",H),i.removeEventListener("squeezestart",H),i.removeEventListener("squeezeend",H),i.removeEventListener("end",J),i.removeEventListener("inputsourceschange",ie);for(let Y=0;Y<E.length;Y++){const se=S[Y];se!==null&&(S[Y]=null,E[Y].disconnect(se))}I=null,V=null,_.reset(),e.setRenderTarget(p),d=null,u=null,f=null,i=null,w=null,Ne.stop(),n.isPresenting=!1,e.setPixelRatio(L),e.setSize(U.width,U.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(Y){r=Y,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(Y){o=Y,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||a},this.setReferenceSpace=function(Y){c=Y},this.getBaseLayer=function(){return u!==null?u:d},this.getBinding=function(){return f},this.getFrame=function(){return m},this.getSession=function(){return i},this.setSession=async function(Y){if(i=Y,i!==null){if(p=e.getRenderTarget(),i.addEventListener("select",H),i.addEventListener("selectstart",H),i.addEventListener("selectend",H),i.addEventListener("squeeze",H),i.addEventListener("squeezestart",H),i.addEventListener("squeezeend",H),i.addEventListener("end",J),i.addEventListener("inputsourceschange",ie),g.xrCompatible!==!0&&await t.makeXRCompatible(),L=e.getPixelRatio(),e.getSize(U),typeof XRWebGLBinding<"u"&&"createProjectionLayer"in XRWebGLBinding.prototype){let re=null,le=null,Ee=null;g.depth&&(Ee=g.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,re=g.stencil?sr:ir,le=g.stencil?nr:$i);const fe={colorFormat:t.RGBA8,depthFormat:Ee,scaleFactor:r};f=new XRWebGLBinding(i,t),u=f.createProjectionLayer(fe),i.updateRenderState({layers:[u]}),e.setPixelRatio(1),e.setSize(u.textureWidth,u.textureHeight,!1),w=new Ji(u.textureWidth,u.textureHeight,{format:Fn,type:ni,depthTexture:new fu(u.textureWidth,u.textureHeight,le,void 0,void 0,void 0,void 0,void 0,void 0,re),stencilBuffer:g.stencil,colorSpace:e.outputColorSpace,samples:g.antialias?4:0,resolveDepthBuffer:u.ignoreDepthValues===!1,resolveStencilBuffer:u.ignoreDepthValues===!1})}else{const re={antialias:g.antialias,alpha:!0,depth:g.depth,stencil:g.stencil,framebufferScaleFactor:r};d=new XRWebGLLayer(i,t,re),i.updateRenderState({baseLayer:d}),e.setPixelRatio(1),e.setSize(d.framebufferWidth,d.framebufferHeight,!1),w=new Ji(d.framebufferWidth,d.framebufferHeight,{format:Fn,type:ni,colorSpace:e.outputColorSpace,stencilBuffer:g.stencil,resolveDepthBuffer:d.ignoreDepthValues===!1,resolveStencilBuffer:d.ignoreDepthValues===!1})}w.isXRRenderTarget=!0,this.setFoveation(l),c=null,a=await i.requestReferenceSpace(o),Ne.setContext(i),Ne.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode},this.getDepthTexture=function(){return _.getDepthTexture()};function ie(Y){for(let se=0;se<Y.removed.length;se++){const re=Y.removed[se],le=S.indexOf(re);le>=0&&(S[le]=null,E[le].disconnect(re))}for(let se=0;se<Y.added.length;se++){const re=Y.added[se];let le=S.indexOf(re);if(le===-1){for(let fe=0;fe<E.length;fe++)if(fe>=S.length){S.push(re),le=fe;break}else if(S[fe]===null){S[fe]=re,le=fe;break}if(le===-1)break}const Ee=E[le];Ee&&Ee.connect(re)}}const B=new F,oe=new F;function j(Y,se,re){B.setFromMatrixPosition(se.matrixWorld),oe.setFromMatrixPosition(re.matrixWorld);const le=B.distanceTo(oe),Ee=se.projectionMatrix.elements,fe=re.projectionMatrix.elements,be=Ee[14]/(Ee[10]-1),Je=Ee[14]/(Ee[10]+1),at=(Ee[9]+1)/Ee[5],it=(Ee[9]-1)/Ee[5],z=(Ee[8]-1)/Ee[0],yt=(fe[8]+1)/fe[0],dt=be*z,ot=be*yt,W=le/(-z+yt),ae=W*-z;if(se.matrixWorld.decompose(Y.position,Y.quaternion,Y.scale),Y.translateX(ae),Y.translateZ(W),Y.matrixWorld.compose(Y.position,Y.quaternion,Y.scale),Y.matrixWorldInverse.copy(Y.matrixWorld).invert(),Ee[10]===-1)Y.projectionMatrix.copy(se.projectionMatrix),Y.projectionMatrixInverse.copy(se.projectionMatrixInverse);else{const ne=be+W,ye=Je+W,Oe=dt-ae,T=ot+(le-ae),y=at*Je/ye*ne,k=it*Je/ye*ne;Y.projectionMatrix.makePerspective(Oe,T,y,k,ne,ye),Y.projectionMatrixInverse.copy(Y.projectionMatrix).invert()}}function ue(Y,se){se===null?Y.matrixWorld.copy(Y.matrix):Y.matrixWorld.multiplyMatrices(se.matrixWorld,Y.matrix),Y.matrixWorldInverse.copy(Y.matrixWorld).invert()}this.updateCamera=function(Y){if(i===null)return;let se=Y.near,re=Y.far;_.texture!==null&&(_.depthNear>0&&(se=_.depthNear),_.depthFar>0&&(re=_.depthFar)),M.near=N.near=D.near=se,M.far=N.far=D.far=re,(I!==M.near||V!==M.far)&&(i.updateRenderState({depthNear:M.near,depthFar:M.far}),I=M.near,V=M.far),D.layers.mask=Y.layers.mask|2,N.layers.mask=Y.layers.mask|4,M.layers.mask=D.layers.mask|N.layers.mask;const le=Y.parent,Ee=M.cameras;ue(M,le);for(let fe=0;fe<Ee.length;fe++)ue(Ee[fe],le);Ee.length===2?j(M,D,N):M.projectionMatrix.copy(D.projectionMatrix),pe(Y,M,le)};function pe(Y,se,re){re===null?Y.matrix.copy(se.matrixWorld):(Y.matrix.copy(re.matrixWorld),Y.matrix.invert(),Y.matrix.multiply(se.matrixWorld)),Y.matrix.decompose(Y.position,Y.quaternion,Y.scale),Y.updateMatrixWorld(!0),Y.projectionMatrix.copy(se.projectionMatrix),Y.projectionMatrixInverse.copy(se.projectionMatrixInverse),Y.isPerspectiveCamera&&(Y.fov=Ps*2*Math.atan(1/Y.projectionMatrix.elements[5]),Y.zoom=1)}this.getCamera=function(){return M},this.getFoveation=function(){if(!(u===null&&d===null))return l},this.setFoveation=function(Y){l=Y,u!==null&&(u.fixedFoveation=Y),d!==null&&d.fixedFoveation!==void 0&&(d.fixedFoveation=Y)},this.hasDepthSensing=function(){return _.texture!==null},this.getDepthSensingMesh=function(){return _.getMesh(M)};let Me=null;function Ue(Y,se){if(h=se.getViewerPose(c||a),m=se,h!==null){const re=h.views;d!==null&&(e.setRenderTargetFramebuffer(w,d.framebuffer),e.setRenderTarget(w));let le=!1;re.length!==M.cameras.length&&(M.cameras.length=0,le=!0);for(let be=0;be<re.length;be++){const Je=re[be];let at=null;if(d!==null)at=d.getViewport(Je);else{const z=f.getViewSubImage(u,Je);at=z.viewport,be===0&&(e.setRenderTargetTextures(w,z.colorTexture,z.depthStencilTexture),e.setRenderTarget(w))}let it=b[be];it===void 0&&(it=new an,it.layers.enable(be),it.viewport=new bt,b[be]=it),it.matrix.fromArray(Je.transform.matrix),it.matrix.decompose(it.position,it.quaternion,it.scale),it.projectionMatrix.fromArray(Je.projectionMatrix),it.projectionMatrixInverse.copy(it.projectionMatrix).invert(),it.viewport.set(at.x,at.y,at.width,at.height),be===0&&(M.matrix.copy(it.matrix),M.matrix.decompose(M.position,M.quaternion,M.scale)),le===!0&&M.cameras.push(it)}const Ee=i.enabledFeatures;if(Ee&&Ee.includes("depth-sensing")&&i.depthUsage=="gpu-optimized"&&f){const be=f.getDepthInformation(re[0]);be&&be.isValid&&be.texture&&_.init(e,be,i.renderState)}}for(let re=0;re<E.length;re++){const le=S[re],Ee=E[re];le!==null&&Ee!==void 0&&Ee.update(le,se,c||a)}Me&&Me(Y,se),se.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:se}),m=null}const Ne=new Su;Ne.setAnimationLoop(Ue),this.setAnimationLoop=function(Y){Me=Y},this.dispose=function(){}}}const ki=new _n,cg=new st;function hg(s,e){function t(g,p){g.matrixAutoUpdate===!0&&g.updateMatrix(),p.value.copy(g.matrix)}function n(g,p){p.color.getRGB(g.fogColor.value,au(s)),p.isFog?(g.fogNear.value=p.near,g.fogFar.value=p.far):p.isFogExp2&&(g.fogDensity.value=p.density)}function i(g,p,w,E,S){p.isMeshBasicMaterial||p.isMeshLambertMaterial?r(g,p):p.isMeshToonMaterial?(r(g,p),f(g,p)):p.isMeshPhongMaterial?(r(g,p),h(g,p)):p.isMeshStandardMaterial?(r(g,p),u(g,p),p.isMeshPhysicalMaterial&&d(g,p,S)):p.isMeshMatcapMaterial?(r(g,p),m(g,p)):p.isMeshDepthMaterial?r(g,p):p.isMeshDistanceMaterial?(r(g,p),_(g,p)):p.isMeshNormalMaterial?r(g,p):p.isLineBasicMaterial?(a(g,p),p.isLineDashedMaterial&&o(g,p)):p.isPointsMaterial?l(g,p,w,E):p.isSpriteMaterial?c(g,p):p.isShadowMaterial?(g.color.value.copy(p.color),g.opacity.value=p.opacity):p.isShaderMaterial&&(p.uniformsNeedUpdate=!1)}function r(g,p){g.opacity.value=p.opacity,p.color&&g.diffuse.value.copy(p.color),p.emissive&&g.emissive.value.copy(p.emissive).multiplyScalar(p.emissiveIntensity),p.map&&(g.map.value=p.map,t(p.map,g.mapTransform)),p.alphaMap&&(g.alphaMap.value=p.alphaMap,t(p.alphaMap,g.alphaMapTransform)),p.bumpMap&&(g.bumpMap.value=p.bumpMap,t(p.bumpMap,g.bumpMapTransform),g.bumpScale.value=p.bumpScale,p.side===gn&&(g.bumpScale.value*=-1)),p.normalMap&&(g.normalMap.value=p.normalMap,t(p.normalMap,g.normalMapTransform),g.normalScale.value.copy(p.normalScale),p.side===gn&&g.normalScale.value.negate()),p.displacementMap&&(g.displacementMap.value=p.displacementMap,t(p.displacementMap,g.displacementMapTransform),g.displacementScale.value=p.displacementScale,g.displacementBias.value=p.displacementBias),p.emissiveMap&&(g.emissiveMap.value=p.emissiveMap,t(p.emissiveMap,g.emissiveMapTransform)),p.specularMap&&(g.specularMap.value=p.specularMap,t(p.specularMap,g.specularMapTransform)),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest);const w=e.get(p),E=w.envMap,S=w.envMapRotation;E&&(g.envMap.value=E,ki.copy(S),ki.x*=-1,ki.y*=-1,ki.z*=-1,E.isCubeTexture&&E.isRenderTargetTexture===!1&&(ki.y*=-1,ki.z*=-1),g.envMapRotation.value.setFromMatrix4(cg.makeRotationFromEuler(ki)),g.flipEnvMap.value=E.isCubeTexture&&E.isRenderTargetTexture===!1?-1:1,g.reflectivity.value=p.reflectivity,g.ior.value=p.ior,g.refractionRatio.value=p.refractionRatio),p.lightMap&&(g.lightMap.value=p.lightMap,g.lightMapIntensity.value=p.lightMapIntensity,t(p.lightMap,g.lightMapTransform)),p.aoMap&&(g.aoMap.value=p.aoMap,g.aoMapIntensity.value=p.aoMapIntensity,t(p.aoMap,g.aoMapTransform))}function a(g,p){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,p.map&&(g.map.value=p.map,t(p.map,g.mapTransform))}function o(g,p){g.dashSize.value=p.dashSize,g.totalSize.value=p.dashSize+p.gapSize,g.scale.value=p.scale}function l(g,p,w,E){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,g.size.value=p.size*w,g.scale.value=E*.5,p.map&&(g.map.value=p.map,t(p.map,g.uvTransform)),p.alphaMap&&(g.alphaMap.value=p.alphaMap,t(p.alphaMap,g.alphaMapTransform)),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest)}function c(g,p){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,g.rotation.value=p.rotation,p.map&&(g.map.value=p.map,t(p.map,g.mapTransform)),p.alphaMap&&(g.alphaMap.value=p.alphaMap,t(p.alphaMap,g.alphaMapTransform)),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest)}function h(g,p){g.specular.value.copy(p.specular),g.shininess.value=Math.max(p.shininess,1e-4)}function f(g,p){p.gradientMap&&(g.gradientMap.value=p.gradientMap)}function u(g,p){g.metalness.value=p.metalness,p.metalnessMap&&(g.metalnessMap.value=p.metalnessMap,t(p.metalnessMap,g.metalnessMapTransform)),g.roughness.value=p.roughness,p.roughnessMap&&(g.roughnessMap.value=p.roughnessMap,t(p.roughnessMap,g.roughnessMapTransform)),p.envMap&&(g.envMapIntensity.value=p.envMapIntensity)}function d(g,p,w){g.ior.value=p.ior,p.sheen>0&&(g.sheenColor.value.copy(p.sheenColor).multiplyScalar(p.sheen),g.sheenRoughness.value=p.sheenRoughness,p.sheenColorMap&&(g.sheenColorMap.value=p.sheenColorMap,t(p.sheenColorMap,g.sheenColorMapTransform)),p.sheenRoughnessMap&&(g.sheenRoughnessMap.value=p.sheenRoughnessMap,t(p.sheenRoughnessMap,g.sheenRoughnessMapTransform))),p.clearcoat>0&&(g.clearcoat.value=p.clearcoat,g.clearcoatRoughness.value=p.clearcoatRoughness,p.clearcoatMap&&(g.clearcoatMap.value=p.clearcoatMap,t(p.clearcoatMap,g.clearcoatMapTransform)),p.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=p.clearcoatRoughnessMap,t(p.clearcoatRoughnessMap,g.clearcoatRoughnessMapTransform)),p.clearcoatNormalMap&&(g.clearcoatNormalMap.value=p.clearcoatNormalMap,t(p.clearcoatNormalMap,g.clearcoatNormalMapTransform),g.clearcoatNormalScale.value.copy(p.clearcoatNormalScale),p.side===gn&&g.clearcoatNormalScale.value.negate())),p.dispersion>0&&(g.dispersion.value=p.dispersion),p.iridescence>0&&(g.iridescence.value=p.iridescence,g.iridescenceIOR.value=p.iridescenceIOR,g.iridescenceThicknessMinimum.value=p.iridescenceThicknessRange[0],g.iridescenceThicknessMaximum.value=p.iridescenceThicknessRange[1],p.iridescenceMap&&(g.iridescenceMap.value=p.iridescenceMap,t(p.iridescenceMap,g.iridescenceMapTransform)),p.iridescenceThicknessMap&&(g.iridescenceThicknessMap.value=p.iridescenceThicknessMap,t(p.iridescenceThicknessMap,g.iridescenceThicknessMapTransform))),p.transmission>0&&(g.transmission.value=p.transmission,g.transmissionSamplerMap.value=w.texture,g.transmissionSamplerSize.value.set(w.width,w.height),p.transmissionMap&&(g.transmissionMap.value=p.transmissionMap,t(p.transmissionMap,g.transmissionMapTransform)),g.thickness.value=p.thickness,p.thicknessMap&&(g.thicknessMap.value=p.thicknessMap,t(p.thicknessMap,g.thicknessMapTransform)),g.attenuationDistance.value=p.attenuationDistance,g.attenuationColor.value.copy(p.attenuationColor)),p.anisotropy>0&&(g.anisotropyVector.value.set(p.anisotropy*Math.cos(p.anisotropyRotation),p.anisotropy*Math.sin(p.anisotropyRotation)),p.anisotropyMap&&(g.anisotropyMap.value=p.anisotropyMap,t(p.anisotropyMap,g.anisotropyMapTransform))),g.specularIntensity.value=p.specularIntensity,g.specularColor.value.copy(p.specularColor),p.specularColorMap&&(g.specularColorMap.value=p.specularColorMap,t(p.specularColorMap,g.specularColorMapTransform)),p.specularIntensityMap&&(g.specularIntensityMap.value=p.specularIntensityMap,t(p.specularIntensityMap,g.specularIntensityMapTransform))}function m(g,p){p.matcap&&(g.matcap.value=p.matcap)}function _(g,p){const w=e.get(p).light;g.referencePosition.value.setFromMatrixPosition(w.matrixWorld),g.nearDistance.value=w.shadow.camera.near,g.farDistance.value=w.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function ug(s,e,t,n){let i={},r={},a=[];const o=s.getParameter(s.MAX_UNIFORM_BUFFER_BINDINGS);function l(w,E){const S=E.program;n.uniformBlockBinding(w,S)}function c(w,E){let S=i[w.id];S===void 0&&(m(w),S=h(w),i[w.id]=S,w.addEventListener("dispose",g));const U=E.program;n.updateUBOMapping(w,U);const L=e.render.frame;r[w.id]!==L&&(u(w),r[w.id]=L)}function h(w){const E=f();w.__bindingPointIndex=E;const S=s.createBuffer(),U=w.__size,L=w.usage;return s.bindBuffer(s.UNIFORM_BUFFER,S),s.bufferData(s.UNIFORM_BUFFER,U,L),s.bindBuffer(s.UNIFORM_BUFFER,null),s.bindBufferBase(s.UNIFORM_BUFFER,E,S),S}function f(){for(let w=0;w<o;w++)if(a.indexOf(w)===-1)return a.push(w),w;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function u(w){const E=i[w.id],S=w.uniforms,U=w.__cache;s.bindBuffer(s.UNIFORM_BUFFER,E);for(let L=0,D=S.length;L<D;L++){const N=Array.isArray(S[L])?S[L]:[S[L]];for(let b=0,M=N.length;b<M;b++){const I=N[b];if(d(I,L,b,U)===!0){const V=I.__offset,H=Array.isArray(I.value)?I.value:[I.value];let J=0;for(let ie=0;ie<H.length;ie++){const B=H[ie],oe=_(B);typeof B=="number"||typeof B=="boolean"?(I.__data[0]=B,s.bufferSubData(s.UNIFORM_BUFFER,V+J,I.__data)):B.isMatrix3?(I.__data[0]=B.elements[0],I.__data[1]=B.elements[1],I.__data[2]=B.elements[2],I.__data[3]=0,I.__data[4]=B.elements[3],I.__data[5]=B.elements[4],I.__data[6]=B.elements[5],I.__data[7]=0,I.__data[8]=B.elements[6],I.__data[9]=B.elements[7],I.__data[10]=B.elements[8],I.__data[11]=0):(B.toArray(I.__data,J),J+=oe.storage/Float32Array.BYTES_PER_ELEMENT)}s.bufferSubData(s.UNIFORM_BUFFER,V,I.__data)}}}s.bindBuffer(s.UNIFORM_BUFFER,null)}function d(w,E,S,U){const L=w.value,D=E+"_"+S;if(U[D]===void 0)return typeof L=="number"||typeof L=="boolean"?U[D]=L:U[D]=L.clone(),!0;{const N=U[D];if(typeof L=="number"||typeof L=="boolean"){if(N!==L)return U[D]=L,!0}else if(N.equals(L)===!1)return N.copy(L),!0}return!1}function m(w){const E=w.uniforms;let S=0;const U=16;for(let D=0,N=E.length;D<N;D++){const b=Array.isArray(E[D])?E[D]:[E[D]];for(let M=0,I=b.length;M<I;M++){const V=b[M],H=Array.isArray(V.value)?V.value:[V.value];for(let J=0,ie=H.length;J<ie;J++){const B=H[J],oe=_(B),j=S%U,ue=j%oe.boundary,pe=j+ue;S+=ue,pe!==0&&U-pe<oe.storage&&(S+=U-pe),V.__data=new Float32Array(oe.storage/Float32Array.BYTES_PER_ELEMENT),V.__offset=S,S+=oe.storage}}}const L=S%U;return L>0&&(S+=U-L),w.__size=S,w.__cache={},this}function _(w){const E={boundary:0,storage:0};return typeof w=="number"||typeof w=="boolean"?(E.boundary=4,E.storage=4):w.isVector2?(E.boundary=8,E.storage=8):w.isVector3||w.isColor?(E.boundary=16,E.storage=12):w.isVector4?(E.boundary=16,E.storage=16):w.isMatrix3?(E.boundary=48,E.storage=48):w.isMatrix4?(E.boundary=64,E.storage=64):w.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",w),E}function g(w){const E=w.target;E.removeEventListener("dispose",g);const S=a.indexOf(E.__bindingPointIndex);a.splice(S,1),s.deleteBuffer(i[E.id]),delete i[E.id],delete r[E.id]}function p(){for(const w in i)s.deleteBuffer(i[w]);a=[],i={},r={}}return{bind:l,update:c,dispose:p}}class dg{constructor(e={}){const{canvas:t=sf(),context:n=null,depth:i=!0,stencil:r=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:f=!1,reverseDepthBuffer:u=!1}=e;this.isWebGLRenderer=!0;let d;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");d=n.getContextAttributes().alpha}else d=a;const m=new Uint32Array(4),_=new Int32Array(4);let g=null,p=null;const w=[],E=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=Ri,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const S=this;let U=!1;this._outputColorSpace=Tt;let L=0,D=0,N=null,b=-1,M=null;const I=new bt,V=new bt;let H=null;const J=new et(0);let ie=0,B=t.width,oe=t.height,j=1,ue=null,pe=null;const Me=new bt(0,0,B,oe),Ue=new bt(0,0,B,oe);let Ne=!1;const Y=new Pl;let se=!1,re=!1;const le=new st,Ee=new st,fe=new F,be=new bt,Je={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let at=!1;function it(){return N===null?j:1}let z=n;function yt(C,X){return t.getContext(C,X)}try{const C={alpha:!0,depth:i,stencil:r,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:h,failIfMajorPerformanceCaveat:f};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${_l}`),t.addEventListener("webglcontextlost",ze,!1),t.addEventListener("webglcontextrestored",ve,!1),t.addEventListener("webglcontextcreationerror",he,!1),z===null){const X="webgl2";if(z=yt(X,C),z===null)throw yt(X)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(C){throw console.error("THREE.WebGLRenderer: "+C.message),C}let dt,ot,W,ae,ne,ye,Oe,T,y,k,K,Q,O,we,xe,Se,Ie,de,Pe,qe,ke,Ae,rt,G;function De(){dt=new b1(z),dt.init(),Ae=new sg(z,dt),ot=new m1(z,dt,e,Ae),W=new ng(z,dt),ot.reverseDepthBuffer&&u&&W.buffers.depth.setReversed(!0),ae=new w1(z),ne=new G2,ye=new ig(z,dt,W,ne,ot,Ae,ae),Oe=new _1(S),T=new M1(S),y=new Pp(z),rt=new f1(z,y),k=new S1(z,y,ae,rt),K=new T1(z,k,y,ae),Pe=new A1(z,ot,ye),Se=new g1(ne),Q=new H2(S,Oe,T,dt,ot,rt,Se),O=new hg(S,ne),we=new X2,xe=new K2(dt),de=new d1(S,Oe,T,W,K,d,l),Ie=new eg(S,K,ot),G=new ug(z,ae,ot,W),qe=new p1(z,dt,ae),ke=new E1(z,dt,ae),ae.programs=Q.programs,S.capabilities=ot,S.extensions=dt,S.properties=ne,S.renderLists=we,S.shadowMap=Ie,S.state=W,S.info=ae}De();const ge=new lg(S,z);this.xr=ge,this.getContext=function(){return z},this.getContextAttributes=function(){return z.getContextAttributes()},this.forceContextLoss=function(){const C=dt.get("WEBGL_lose_context");C&&C.loseContext()},this.forceContextRestore=function(){const C=dt.get("WEBGL_lose_context");C&&C.restoreContext()},this.getPixelRatio=function(){return j},this.setPixelRatio=function(C){C!==void 0&&(j=C,this.setSize(B,oe,!1))},this.getSize=function(C){return C.set(B,oe)},this.setSize=function(C,X,Z=!0){if(ge.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}B=C,oe=X,t.width=Math.floor(C*j),t.height=Math.floor(X*j),Z===!0&&(t.style.width=C+"px",t.style.height=X+"px"),this.setViewport(0,0,C,X)},this.getDrawingBufferSize=function(C){return C.set(B*j,oe*j).floor()},this.setDrawingBufferSize=function(C,X,Z){B=C,oe=X,j=Z,t.width=Math.floor(C*Z),t.height=Math.floor(X*Z),this.setViewport(0,0,C,X)},this.getCurrentViewport=function(C){return C.copy(I)},this.getViewport=function(C){return C.copy(Me)},this.setViewport=function(C,X,Z,ee){C.isVector4?Me.set(C.x,C.y,C.z,C.w):Me.set(C,X,Z,ee),W.viewport(I.copy(Me).multiplyScalar(j).round())},this.getScissor=function(C){return C.copy(Ue)},this.setScissor=function(C,X,Z,ee){C.isVector4?Ue.set(C.x,C.y,C.z,C.w):Ue.set(C,X,Z,ee),W.scissor(V.copy(Ue).multiplyScalar(j).round())},this.getScissorTest=function(){return Ne},this.setScissorTest=function(C){W.setScissorTest(Ne=C)},this.setOpaqueSort=function(C){ue=C},this.setTransparentSort=function(C){pe=C},this.getClearColor=function(C){return C.copy(de.getClearColor())},this.setClearColor=function(){de.setClearColor(...arguments)},this.getClearAlpha=function(){return de.getClearAlpha()},this.setClearAlpha=function(){de.setClearAlpha(...arguments)},this.clear=function(C=!0,X=!0,Z=!0){let ee=0;if(C){let q=!1;if(N!==null){const me=N.texture.format;q=me===Sl||me===bl||me===Ml}if(q){const me=N.texture.type,Ce=me===ni||me===$i||me===tr||me===nr||me===xl||me===yl,We=de.getClearColor(),Ve=de.getClearAlpha(),ct=We.r,ht=We.g,Ze=We.b;Ce?(m[0]=ct,m[1]=ht,m[2]=Ze,m[3]=Ve,z.clearBufferuiv(z.COLOR,0,m)):(_[0]=ct,_[1]=ht,_[2]=Ze,_[3]=Ve,z.clearBufferiv(z.COLOR,0,_))}else ee|=z.COLOR_BUFFER_BIT}X&&(ee|=z.DEPTH_BUFFER_BIT),Z&&(ee|=z.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),z.clear(ee)},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",ze,!1),t.removeEventListener("webglcontextrestored",ve,!1),t.removeEventListener("webglcontextcreationerror",he,!1),de.dispose(),we.dispose(),xe.dispose(),ne.dispose(),Oe.dispose(),T.dispose(),K.dispose(),rt.dispose(),G.dispose(),Q.dispose(),ge.dispose(),ge.removeEventListener("sessionstart",Di),ge.removeEventListener("sessionend",Ni),je.stop()};function ze(C){C.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),U=!0}function ve(){console.log("THREE.WebGLRenderer: Context Restored."),U=!1;const C=ae.autoReset,X=Ie.enabled,Z=Ie.autoUpdate,ee=Ie.needsUpdate,q=Ie.type;De(),ae.autoReset=C,Ie.enabled=X,Ie.autoUpdate=Z,Ie.needsUpdate=ee,Ie.type=q}function he(C){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",C.statusMessage)}function Ge(C){const X=C.target;X.removeEventListener("dispose",Ge),lt(X)}function lt(C){Lt(C),ne.remove(C)}function Lt(C){const X=ne.get(C).programs;X!==void 0&&(X.forEach(function(Z){Q.releaseProgram(Z)}),C.isShaderMaterial&&Q.releaseShaderCache(C))}this.renderBufferDirect=function(C,X,Z,ee,q,me){X===null&&(X=Je);const Ce=q.isMesh&&q.matrixWorld.determinant()<0,We=xn(C,X,Z,ee,q);W.setMaterial(ee,Ce);let Ve=Z.index,ct=1;if(ee.wireframe===!0){if(Ve=k.getWireframeAttribute(Z),Ve===void 0)return;ct=2}const ht=Z.drawRange,Ze=Z.attributes.position;let gt=ht.start*ct,Rt=(ht.start+ht.count)*ct;me!==null&&(gt=Math.max(gt,me.start*ct),Rt=Math.min(Rt,(me.start+me.count)*ct)),Ve!==null?(gt=Math.max(gt,0),Rt=Math.min(Rt,Ve.count)):Ze!=null&&(gt=Math.max(gt,0),Rt=Math.min(Rt,Ze.count));const Ot=Rt-gt;if(Ot<0||Ot===1/0)return;rt.setup(q,ee,We,Z,Ve);let kt,St=qe;if(Ve!==null&&(kt=y.get(Ve),St=ke,St.setIndex(kt)),q.isMesh)ee.wireframe===!0?(W.setLineWidth(ee.wireframeLinewidth*it()),St.setMode(z.LINES)):St.setMode(z.TRIANGLES);else if(q.isLine){let tt=ee.linewidth;tt===void 0&&(tt=1),W.setLineWidth(tt*it()),q.isLineSegments?St.setMode(z.LINES):q.isLineLoop?St.setMode(z.LINE_LOOP):St.setMode(z.LINE_STRIP)}else q.isPoints?St.setMode(z.POINTS):q.isSprite&&St.setMode(z.TRIANGLES);if(q.isBatchedMesh)if(q._multiDrawInstances!==null)ws("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),St.renderMultiDrawInstances(q._multiDrawStarts,q._multiDrawCounts,q._multiDrawCount,q._multiDrawInstances);else if(dt.get("WEBGL_multi_draw"))St.renderMultiDraw(q._multiDrawStarts,q._multiDrawCounts,q._multiDrawCount);else{const tt=q._multiDrawStarts,$t=q._multiDrawCounts,Et=q._multiDrawCount,yn=Ve?y.get(Ve).bytesPerElement:1,zt=ne.get(ee).currentProgram.getUniforms();for(let tn=0;tn<Et;tn++)zt.setValue(z,"_gl_DrawID",tn),St.render(tt[tn]/yn,$t[tn])}else if(q.isInstancedMesh)St.renderInstances(gt,Ot,q.count);else if(Z.isInstancedBufferGeometry){const tt=Z._maxInstanceCount!==void 0?Z._maxInstanceCount:1/0,$t=Math.min(Z.instanceCount,tt);St.renderInstances(gt,Ot,$t)}else St.render(gt,Ot)};function pt(C,X,Z){C.transparent===!0&&C.side===un&&C.forceSinglePass===!1?(C.side=gn,C.needsUpdate=!0,Ye(C,X,Z),C.side=Wn,C.needsUpdate=!0,Ye(C,X,Z),C.side=un):Ye(C,X,Z)}this.compile=function(C,X,Z=null){Z===null&&(Z=C),p=xe.get(Z),p.init(X),E.push(p),Z.traverseVisible(function(q){q.isLight&&q.layers.test(X.layers)&&(p.pushLight(q),q.castShadow&&p.pushShadow(q))}),C!==Z&&C.traverseVisible(function(q){q.isLight&&q.layers.test(X.layers)&&(p.pushLight(q),q.castShadow&&p.pushShadow(q))}),p.setupLights();const ee=new Set;return C.traverse(function(q){if(!(q.isMesh||q.isPoints||q.isLine||q.isSprite))return;const me=q.material;if(me)if(Array.isArray(me))for(let Ce=0;Ce<me.length;Ce++){const We=me[Ce];pt(We,Z,q),ee.add(We)}else pt(me,Z,q),ee.add(me)}),p=E.pop(),ee},this.compileAsync=function(C,X,Z=null){const ee=this.compile(C,X,Z);return new Promise(q=>{function me(){if(ee.forEach(function(Ce){ne.get(Ce).currentProgram.isReady()&&ee.delete(Ce)}),ee.size===0){q(C);return}setTimeout(me,10)}dt.get("KHR_parallel_shader_compile")!==null?me():setTimeout(me,10)})};let en=null;function vn(C){en&&en(C)}function Di(){je.stop()}function Ni(){je.start()}const je=new Su;je.setAnimationLoop(vn),typeof self<"u"&&je.setContext(self),this.setAnimationLoop=function(C){en=C,ge.setAnimationLoop(C),C===null?je.stop():je.start()},ge.addEventListener("sessionstart",Di),ge.addEventListener("sessionend",Ni),this.render=function(C,X){if(X!==void 0&&X.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(U===!0)return;if(C.matrixWorldAutoUpdate===!0&&C.updateMatrixWorld(),X.parent===null&&X.matrixWorldAutoUpdate===!0&&X.updateMatrixWorld(),ge.enabled===!0&&ge.isPresenting===!0&&(ge.cameraAutoUpdate===!0&&ge.updateCamera(X),X=ge.getCamera()),C.isScene===!0&&C.onBeforeRender(S,C,X,N),p=xe.get(C,E.length),p.init(X),E.push(p),Ee.multiplyMatrices(X.projectionMatrix,X.matrixWorldInverse),Y.setFromProjectionMatrix(Ee),re=this.localClippingEnabled,se=Se.init(this.clippingPlanes,re),g=we.get(C,w.length),g.init(),w.push(g),ge.enabled===!0&&ge.isPresenting===!0){const me=S.xr.getDepthSensingMesh();me!==null&&qt(me,X,-1/0,S.sortObjects)}qt(C,X,0,S.sortObjects),g.finish(),S.sortObjects===!0&&g.sort(ue,pe),at=ge.enabled===!1||ge.isPresenting===!1||ge.hasDepthSensing()===!1,at&&de.addToRenderList(g,C),this.info.render.frame++,se===!0&&Se.beginShadows();const Z=p.state.shadowsArray;Ie.render(Z,C,X),se===!0&&Se.endShadows(),this.info.autoReset===!0&&this.info.reset();const ee=g.opaque,q=g.transmissive;if(p.setupLights(),X.isArrayCamera){const me=X.cameras;if(q.length>0)for(let Ce=0,We=me.length;Ce<We;Ce++){const Ve=me[Ce];wn(ee,q,C,Ve)}at&&de.render(C);for(let Ce=0,We=me.length;Ce<We;Ce++){const Ve=me[Ce];jt(g,C,Ve,Ve.viewport)}}else q.length>0&&wn(ee,q,C,X),at&&de.render(C),jt(g,C,X);N!==null&&D===0&&(ye.updateMultisampleRenderTarget(N),ye.updateRenderTargetMipmap(N)),C.isScene===!0&&C.onAfterRender(S,C,X),rt.resetDefaultState(),b=-1,M=null,E.pop(),E.length>0?(p=E[E.length-1],se===!0&&Se.setGlobalState(S.clippingPlanes,p.state.camera)):p=null,w.pop(),w.length>0?g=w[w.length-1]:g=null};function qt(C,X,Z,ee){if(C.visible===!1)return;if(C.layers.test(X.layers)){if(C.isGroup)Z=C.renderOrder;else if(C.isLOD)C.autoUpdate===!0&&C.update(X);else if(C.isLight)p.pushLight(C),C.castShadow&&p.pushShadow(C);else if(C.isSprite){if(!C.frustumCulled||Y.intersectsSprite(C)){ee&&be.setFromMatrixPosition(C.matrixWorld).applyMatrix4(Ee);const Ce=K.update(C),We=C.material;We.visible&&g.push(C,Ce,We,Z,be.z,null)}}else if((C.isMesh||C.isLine||C.isPoints)&&(!C.frustumCulled||Y.intersectsObject(C))){const Ce=K.update(C),We=C.material;if(ee&&(C.boundingSphere!==void 0?(C.boundingSphere===null&&C.computeBoundingSphere(),be.copy(C.boundingSphere.center)):(Ce.boundingSphere===null&&Ce.computeBoundingSphere(),be.copy(Ce.boundingSphere.center)),be.applyMatrix4(C.matrixWorld).applyMatrix4(Ee)),Array.isArray(We)){const Ve=Ce.groups;for(let ct=0,ht=Ve.length;ct<ht;ct++){const Ze=Ve[ct],gt=We[Ze.materialIndex];gt&>.visible&&g.push(C,Ce,gt,Z,be.z,Ze)}}else We.visible&&g.push(C,Ce,We,Z,be.z,null)}}const me=C.children;for(let Ce=0,We=me.length;Ce<We;Ce++)qt(me[Ce],X,Z,ee)}function jt(C,X,Z,ee){const q=C.opaque,me=C.transmissive,Ce=C.transparent;p.setupLightsView(Z),se===!0&&Se.setGlobalState(S.clippingPlanes,Z),ee&&W.viewport(I.copy(ee)),q.length>0&&vi(q,X,Z),me.length>0&&vi(me,X,Z),Ce.length>0&&vi(Ce,X,Z),W.buffers.depth.setTest(!0),W.buffers.depth.setMask(!0),W.buffers.color.setMask(!0),W.setPolygonOffset(!1)}function wn(C,X,Z,ee){if((Z.isScene===!0?Z.overrideMaterial:null)!==null)return;p.state.transmissionRenderTarget[ee.id]===void 0&&(p.state.transmissionRenderTarget[ee.id]=new Ji(1,1,{generateMipmaps:!0,type:dt.has("EXT_color_buffer_half_float")||dt.has("EXT_color_buffer_float")?or:ni,minFilter:di,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Mt.workingColorSpace}));const me=p.state.transmissionRenderTarget[ee.id],Ce=ee.viewport||I;me.setSize(Ce.z*S.transmissionResolutionScale,Ce.w*S.transmissionResolutionScale);const We=S.getRenderTarget();S.setRenderTarget(me),S.getClearColor(J),ie=S.getClearAlpha(),ie<1&&S.setClearColor(16777215,.5),S.clear(),at&&de.render(Z);const Ve=S.toneMapping;S.toneMapping=Ri;const ct=ee.viewport;if(ee.viewport!==void 0&&(ee.viewport=void 0),p.setupLightsView(ee),se===!0&&Se.setGlobalState(S.clippingPlanes,ee),vi(C,Z,ee),ye.updateMultisampleRenderTarget(me),ye.updateRenderTargetMipmap(me),dt.has("WEBGL_multisampled_render_to_texture")===!1){let ht=!1;for(let Ze=0,gt=X.length;Ze<gt;Ze++){const Rt=X[Ze],Ot=Rt.object,kt=Rt.geometry,St=Rt.material,tt=Rt.group;if(St.side===un&&Ot.layers.test(ee.layers)){const $t=St.side;St.side=gn,St.needsUpdate=!0,Yn(Ot,Z,ee,kt,St,tt),St.side=$t,St.needsUpdate=!0,ht=!0}}ht===!0&&(ye.updateMultisampleRenderTarget(me),ye.updateRenderTargetMipmap(me))}S.setRenderTarget(We),S.setClearColor(J,ie),ct!==void 0&&(ee.viewport=ct),S.toneMapping=Ve}function vi(C,X,Z){const ee=X.isScene===!0?X.overrideMaterial:null;for(let q=0,me=C.length;q<me;q++){const Ce=C[q],We=Ce.object,Ve=Ce.geometry,ct=Ce.group;let ht=Ce.material;ht.allowOverride===!0&&ee!==null&&(ht=ee),We.layers.test(Z.layers)&&Yn(We,X,Z,Ve,ht,ct)}}function Yn(C,X,Z,ee,q,me){C.onBeforeRender(S,X,Z,ee,q,me),C.modelViewMatrix.multiplyMatrices(Z.matrixWorldInverse,C.matrixWorld),C.normalMatrix.getNormalMatrix(C.modelViewMatrix),q.onBeforeRender(S,X,Z,ee,C,me),q.transparent===!0&&q.side===un&&q.forceSinglePass===!1?(q.side=gn,q.needsUpdate=!0,S.renderBufferDirect(Z,X,ee,q,C,me),q.side=Wn,q.needsUpdate=!0,S.renderBufferDirect(Z,X,ee,q,C,me),q.side=un):S.renderBufferDirect(Z,X,ee,q,C,me),C.onAfterRender(S,X,Z,ee,q,me)}function Ye(C,X,Z){X.isScene!==!0&&(X=Je);const ee=ne.get(C),q=p.state.lights,me=p.state.shadowsArray,Ce=q.state.version,We=Q.getParameters(C,q.state,me,X,Z),Ve=Q.getProgramCacheKey(We);let ct=ee.programs;ee.environment=C.isMeshStandardMaterial?X.environment:null,ee.fog=X.fog,ee.envMap=(C.isMeshStandardMaterial?T:Oe).get(C.envMap||ee.environment),ee.envMapRotation=ee.environment!==null&&C.envMap===null?X.environmentRotation:C.envMapRotation,ct===void 0&&(C.addEventListener("dispose",Ge),ct=new Map,ee.programs=ct);let ht=ct.get(Ve);if(ht!==void 0){if(ee.currentProgram===ht&&ee.lightsStateVersion===Ce)return Gt(C,We),ht}else We.uniforms=Q.getUniforms(C),C.onBeforeCompile(We,S),ht=Q.acquireProgram(We,Ve),ct.set(Ve,ht),ee.uniforms=We.uniforms;const Ze=ee.uniforms;return(!C.isShaderMaterial&&!C.isRawShaderMaterial||C.clipping===!0)&&(Ze.clippingPlanes=Se.uniform),Gt(C,We),ee.needsLights=dn(C),ee.lightsStateVersion=Ce,ee.needsLights&&(Ze.ambientLightColor.value=q.state.ambient,Ze.lightProbe.value=q.state.probe,Ze.directionalLights.value=q.state.directional,Ze.directionalLightShadows.value=q.state.directionalShadow,Ze.spotLights.value=q.state.spot,Ze.spotLightShadows.value=q.state.spotShadow,Ze.rectAreaLights.value=q.state.rectArea,Ze.ltc_1.value=q.state.rectAreaLTC1,Ze.ltc_2.value=q.state.rectAreaLTC2,Ze.pointLights.value=q.state.point,Ze.pointLightShadows.value=q.state.pointShadow,Ze.hemisphereLights.value=q.state.hemi,Ze.directionalShadowMap.value=q.state.directionalShadowMap,Ze.directionalShadowMatrix.value=q.state.directionalShadowMatrix,Ze.spotShadowMap.value=q.state.spotShadowMap,Ze.spotLightMatrix.value=q.state.spotLightMatrix,Ze.spotLightMap.value=q.state.spotLightMap,Ze.pointShadowMap.value=q.state.pointShadowMap,Ze.pointShadowMatrix.value=q.state.pointShadowMatrix),ee.currentProgram=ht,ee.uniformsList=null,ht}function Te(C){if(C.uniformsList===null){const X=C.currentProgram.getUniforms();C.uniformsList=ra.seqWithValue(X.seq,C.uniforms)}return C.uniformsList}function Gt(C,X){const Z=ne.get(C);Z.outputColorSpace=X.outputColorSpace,Z.batching=X.batching,Z.batchingColor=X.batchingColor,Z.instancing=X.instancing,Z.instancingColor=X.instancingColor,Z.instancingMorph=X.instancingMorph,Z.skinning=X.skinning,Z.morphTargets=X.morphTargets,Z.morphNormals=X.morphNormals,Z.morphColors=X.morphColors,Z.morphTargetsCount=X.morphTargetsCount,Z.numClippingPlanes=X.numClippingPlanes,Z.numIntersection=X.numClipIntersection,Z.vertexAlphas=X.vertexAlphas,Z.vertexTangents=X.vertexTangents,Z.toneMapping=X.toneMapping}function xn(C,X,Z,ee,q){X.isScene!==!0&&(X=Je),ye.resetTextureUnits();const me=X.fog,Ce=ee.isMeshStandardMaterial?X.environment:null,We=N===null?S.outputColorSpace:N.isXRRenderTarget===!0?N.texture.colorSpace:Ls,Ve=(ee.isMeshStandardMaterial?T:Oe).get(ee.envMap||Ce),ct=ee.vertexColors===!0&&!!Z.attributes.color&&Z.attributes.color.itemSize===4,ht=!!Z.attributes.tangent&&(!!ee.normalMap||ee.anisotropy>0),Ze=!!Z.morphAttributes.position,gt=!!Z.morphAttributes.normal,Rt=!!Z.morphAttributes.color;let Ot=Ri;ee.toneMapped&&(N===null||N.isXRRenderTarget===!0)&&(Ot=S.toneMapping);const kt=Z.morphAttributes.position||Z.morphAttributes.normal||Z.morphAttributes.color,St=kt!==void 0?kt.length:0,tt=ne.get(ee),$t=p.state.lights;if(se===!0&&(re===!0||C!==M)){const Wt=C===M&&ee.id===b;Se.setState(ee,C,Wt)}let Et=!1;ee.version===tt.__version?(tt.needsLights&&tt.lightsStateVersion!==$t.state.version||tt.outputColorSpace!==We||q.isBatchedMesh&&tt.batching===!1||!q.isBatchedMesh&&tt.batching===!0||q.isBatchedMesh&&tt.batchingColor===!0&&q.colorTexture===null||q.isBatchedMesh&&tt.batchingColor===!1&&q.colorTexture!==null||q.isInstancedMesh&&tt.instancing===!1||!q.isInstancedMesh&&tt.instancing===!0||q.isSkinnedMesh&&tt.skinning===!1||!q.isSkinnedMesh&&tt.skinning===!0||q.isInstancedMesh&&tt.instancingColor===!0&&q.instanceColor===null||q.isInstancedMesh&&tt.instancingColor===!1&&q.instanceColor!==null||q.isInstancedMesh&&tt.instancingMorph===!0&&q.morphTexture===null||q.isInstancedMesh&&tt.instancingMorph===!1&&q.morphTexture!==null||tt.envMap!==Ve||ee.fog===!0&&tt.fog!==me||tt.numClippingPlanes!==void 0&&(tt.numClippingPlanes!==Se.numPlanes||tt.numIntersection!==Se.numIntersection)||tt.vertexAlphas!==ct||tt.vertexTangents!==ht||tt.morphTargets!==Ze||tt.morphNormals!==gt||tt.morphColors!==Rt||tt.toneMapping!==Ot||tt.morphTargetsCount!==St)&&(Et=!0):(Et=!0,tt.__version=ee.version);let yn=tt.currentProgram;Et===!0&&(yn=Ye(ee,X,q));let zt=!1,tn=!1,Ui=!1;const Ft=yn.getUniforms(),fn=tt.uniforms;if(W.useProgram(yn.program)&&(zt=!0,tn=!0,Ui=!0),ee.id!==b&&(b=ee.id,tn=!0),zt||M!==C){W.buffers.depth.getReversed()?(le.copy(C.projectionMatrix),af(le),of(le),Ft.setValue(z,"projectionMatrix",le)):Ft.setValue(z,"projectionMatrix",C.projectionMatrix),Ft.setValue(z,"viewMatrix",C.matrixWorldInverse);const Jt=Ft.map.cameraPosition;Jt!==void 0&&Jt.setValue(z,fe.setFromMatrixPosition(C.matrixWorld)),ot.logarithmicDepthBuffer&&Ft.setValue(z,"logDepthBufFC",2/(Math.log(C.far+1)/Math.LN2)),(ee.isMeshPhongMaterial||ee.isMeshToonMaterial||ee.isMeshLambertMaterial||ee.isMeshBasicMaterial||ee.isMeshStandardMaterial||ee.isShaderMaterial)&&Ft.setValue(z,"isOrthographic",C.isOrthographicCamera===!0),M!==C&&(M=C,tn=!0,Ui=!0)}if(q.isSkinnedMesh){Ft.setOptional(z,q,"bindMatrix"),Ft.setOptional(z,q,"bindMatrixInverse");const Wt=q.skeleton;Wt&&(Wt.boneTexture===null&&Wt.computeBoneTexture(),Ft.setValue(z,"boneTexture",Wt.boneTexture,ye))}q.isBatchedMesh&&(Ft.setOptional(z,q,"batchingTexture"),Ft.setValue(z,"batchingTexture",q._matricesTexture,ye),Ft.setOptional(z,q,"batchingIdTexture"),Ft.setValue(z,"batchingIdTexture",q._indirectTexture,ye),Ft.setOptional(z,q,"batchingColorTexture"),q._colorsTexture!==null&&Ft.setValue(z,"batchingColorTexture",q._colorsTexture,ye));const ln=Z.morphAttributes;if((ln.position!==void 0||ln.normal!==void 0||ln.color!==void 0)&&Pe.update(q,Z,yn),(tn||tt.receiveShadow!==q.receiveShadow)&&(tt.receiveShadow=q.receiveShadow,Ft.setValue(z,"receiveShadow",q.receiveShadow)),ee.isMeshGouraudMaterial&&ee.envMap!==null&&(fn.envMap.value=Ve,fn.flipEnvMap.value=Ve.isCubeTexture&&Ve.isRenderTargetTexture===!1?-1:1),ee.isMeshStandardMaterial&&ee.envMap===null&&X.environment!==null&&(fn.envMapIntensity.value=X.environmentIntensity),tn&&(Ft.setValue(z,"toneMappingExposure",S.toneMappingExposure),tt.needsLights&&Yt(fn,Ui),me&&ee.fog===!0&&O.refreshFogUniforms(fn,me),O.refreshMaterialUniforms(fn,ee,j,oe,p.state.transmissionRenderTarget[C.id]),ra.upload(z,Te(tt),fn,ye)),ee.isShaderMaterial&&ee.uniformsNeedUpdate===!0&&(ra.upload(z,Te(tt),fn,ye),ee.uniformsNeedUpdate=!1),ee.isSpriteMaterial&&Ft.setValue(z,"center",q.center),Ft.setValue(z,"modelViewMatrix",q.modelViewMatrix),Ft.setValue(z,"normalMatrix",q.normalMatrix),Ft.setValue(z,"modelMatrix",q.matrixWorld),ee.isShaderMaterial||ee.isRawShaderMaterial){const Wt=ee.uniformsGroups;for(let Jt=0,ts=Wt.length;Jt<ts;Jt++){const ii=Wt[Jt];G.update(ii,yn),G.bind(ii,yn)}}return yn}function Yt(C,X){C.ambientLightColor.needsUpdate=X,C.lightProbe.needsUpdate=X,C.directionalLights.needsUpdate=X,C.directionalLightShadows.needsUpdate=X,C.pointLights.needsUpdate=X,C.pointLightShadows.needsUpdate=X,C.spotLights.needsUpdate=X,C.spotLightShadows.needsUpdate=X,C.rectAreaLights.needsUpdate=X,C.hemisphereLights.needsUpdate=X}function dn(C){return C.isMeshLambertMaterial||C.isMeshToonMaterial||C.isMeshPhongMaterial||C.isMeshStandardMaterial||C.isShadowMaterial||C.isShaderMaterial&&C.lights===!0}this.getActiveCubeFace=function(){return L},this.getActiveMipmapLevel=function(){return D},this.getRenderTarget=function(){return N},this.setRenderTargetTextures=function(C,X,Z){const ee=ne.get(C);ee.__autoAllocateDepthBuffer=C.resolveDepthBuffer===!1,ee.__autoAllocateDepthBuffer===!1&&(ee.__useRenderToTexture=!1),ne.get(C.texture).__webglTexture=X,ne.get(C.depthTexture).__webglTexture=ee.__autoAllocateDepthBuffer?void 0:Z,ee.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(C,X){const Z=ne.get(C);Z.__webglFramebuffer=X,Z.__useDefaultFramebuffer=X===void 0};const An=z.createFramebuffer();this.setRenderTarget=function(C,X=0,Z=0){N=C,L=X,D=Z;let ee=!0,q=null,me=!1,Ce=!1;if(C){const Ve=ne.get(C);if(Ve.__useDefaultFramebuffer!==void 0)W.bindFramebuffer(z.FRAMEBUFFER,null),ee=!1;else if(Ve.__webglFramebuffer===void 0)ye.setupRenderTarget(C);else if(Ve.__hasExternalTextures)ye.rebindTextures(C,ne.get(C.texture).__webglTexture,ne.get(C.depthTexture).__webglTexture);else if(C.depthBuffer){const Ze=C.depthTexture;if(Ve.__boundDepthTexture!==Ze){if(Ze!==null&&ne.has(Ze)&&(C.width!==Ze.image.width||C.height!==Ze.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");ye.setupDepthRenderbuffer(C)}}const ct=C.texture;(ct.isData3DTexture||ct.isDataArrayTexture||ct.isCompressedArrayTexture)&&(Ce=!0);const ht=ne.get(C).__webglFramebuffer;C.isWebGLCubeRenderTarget?(Array.isArray(ht[X])?q=ht[X][Z]:q=ht[X],me=!0):C.samples>0&&ye.useMultisampledRTT(C)===!1?q=ne.get(C).__webglMultisampledFramebuffer:Array.isArray(ht)?q=ht[Z]:q=ht,I.copy(C.viewport),V.copy(C.scissor),H=C.scissorTest}else I.copy(Me).multiplyScalar(j).floor(),V.copy(Ue).multiplyScalar(j).floor(),H=Ne;if(Z!==0&&(q=An),W.bindFramebuffer(z.FRAMEBUFFER,q)&&ee&&W.drawBuffers(C,q),W.viewport(I),W.scissor(V),W.setScissorTest(H),me){const Ve=ne.get(C.texture);z.framebufferTexture2D(z.FRAMEBUFFER,z.COLOR_ATTACHMENT0,z.TEXTURE_CUBE_MAP_POSITIVE_X+X,Ve.__webglTexture,Z)}else if(Ce){const Ve=ne.get(C.texture),ct=X;z.framebufferTextureLayer(z.FRAMEBUFFER,z.COLOR_ATTACHMENT0,Ve.__webglTexture,Z,ct)}else if(C!==null&&Z!==0){const Ve=ne.get(C.texture);z.framebufferTexture2D(z.FRAMEBUFFER,z.COLOR_ATTACHMENT0,z.TEXTURE_2D,Ve.__webglTexture,Z)}b=-1},this.readRenderTargetPixels=function(C,X,Z,ee,q,me,Ce,We=0){if(!(C&&C.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Ve=ne.get(C).__webglFramebuffer;if(C.isWebGLCubeRenderTarget&&Ce!==void 0&&(Ve=Ve[Ce]),Ve){W.bindFramebuffer(z.FRAMEBUFFER,Ve);try{const ct=C.textures[We],ht=ct.format,Ze=ct.type;if(!ot.textureFormatReadable(ht)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!ot.textureTypeReadable(Ze)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}X>=0&&X<=C.width-ee&&Z>=0&&Z<=C.height-q&&(C.textures.length>1&&z.readBuffer(z.COLOR_ATTACHMENT0+We),z.readPixels(X,Z,ee,q,Ae.convert(ht),Ae.convert(Ze),me))}finally{const ct=N!==null?ne.get(N).__webglFramebuffer:null;W.bindFramebuffer(z.FRAMEBUFFER,ct)}}},this.readRenderTargetPixelsAsync=async function(C,X,Z,ee,q,me,Ce,We=0){if(!(C&&C.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Ve=ne.get(C).__webglFramebuffer;if(C.isWebGLCubeRenderTarget&&Ce!==void 0&&(Ve=Ve[Ce]),Ve)if(X>=0&&X<=C.width-ee&&Z>=0&&Z<=C.height-q){W.bindFramebuffer(z.FRAMEBUFFER,Ve);const ct=C.textures[We],ht=ct.format,Ze=ct.type;if(!ot.textureFormatReadable(ht))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!ot.textureTypeReadable(Ze))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const gt=z.createBuffer();z.bindBuffer(z.PIXEL_PACK_BUFFER,gt),z.bufferData(z.PIXEL_PACK_BUFFER,me.byteLength,z.STREAM_READ),C.textures.length>1&&z.readBuffer(z.COLOR_ATTACHMENT0+We),z.readPixels(X,Z,ee,q,Ae.convert(ht),Ae.convert(Ze),0);const Rt=N!==null?ne.get(N).__webglFramebuffer:null;W.bindFramebuffer(z.FRAMEBUFFER,Rt);const Ot=z.fenceSync(z.SYNC_GPU_COMMANDS_COMPLETE,0);return z.flush(),await rf(z,Ot,4),z.bindBuffer(z.PIXEL_PACK_BUFFER,gt),z.getBufferSubData(z.PIXEL_PACK_BUFFER,0,me),z.deleteBuffer(gt),z.deleteSync(Ot),me}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(C,X=null,Z=0){const ee=Math.pow(2,-Z),q=Math.floor(C.image.width*ee),me=Math.floor(C.image.height*ee),Ce=X!==null?X.x:0,We=X!==null?X.y:0;ye.setTexture2D(C,0),z.copyTexSubImage2D(z.TEXTURE_2D,Z,0,0,Ce,We,q,me),W.unbindTexture()};const Qi=z.createFramebuffer(),es=z.createFramebuffer();this.copyTextureToTexture=function(C,X,Z=null,ee=null,q=0,me=null){me===null&&(q!==0?(ws("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),me=q,q=0):me=0);let Ce,We,Ve,ct,ht,Ze,gt,Rt,Ot;const kt=C.isCompressedTexture?C.mipmaps[me]:C.image;if(Z!==null)Ce=Z.max.x-Z.min.x,We=Z.max.y-Z.min.y,Ve=Z.isBox3?Z.max.z-Z.min.z:1,ct=Z.min.x,ht=Z.min.y,Ze=Z.isBox3?Z.min.z:0;else{const ln=Math.pow(2,-q);Ce=Math.floor(kt.width*ln),We=Math.floor(kt.height*ln),C.isDataArrayTexture?Ve=kt.depth:C.isData3DTexture?Ve=Math.floor(kt.depth*ln):Ve=1,ct=0,ht=0,Ze=0}ee!==null?(gt=ee.x,Rt=ee.y,Ot=ee.z):(gt=0,Rt=0,Ot=0);const St=Ae.convert(X.format),tt=Ae.convert(X.type);let $t;X.isData3DTexture?(ye.setTexture3D(X,0),$t=z.TEXTURE_3D):X.isDataArrayTexture||X.isCompressedArrayTexture?(ye.setTexture2DArray(X,0),$t=z.TEXTURE_2D_ARRAY):(ye.setTexture2D(X,0),$t=z.TEXTURE_2D),z.pixelStorei(z.UNPACK_FLIP_Y_WEBGL,X.flipY),z.pixelStorei(z.UNPACK_PREMULTIPLY_ALPHA_WEBGL,X.premultiplyAlpha),z.pixelStorei(z.UNPACK_ALIGNMENT,X.unpackAlignment);const Et=z.getParameter(z.UNPACK_ROW_LENGTH),yn=z.getParameter(z.UNPACK_IMAGE_HEIGHT),zt=z.getParameter(z.UNPACK_SKIP_PIXELS),tn=z.getParameter(z.UNPACK_SKIP_ROWS),Ui=z.getParameter(z.UNPACK_SKIP_IMAGES);z.pixelStorei(z.UNPACK_ROW_LENGTH,kt.width),z.pixelStorei(z.UNPACK_IMAGE_HEIGHT,kt.height),z.pixelStorei(z.UNPACK_SKIP_PIXELS,ct),z.pixelStorei(z.UNPACK_SKIP_ROWS,ht),z.pixelStorei(z.UNPACK_SKIP_IMAGES,Ze);const Ft=C.isDataArrayTexture||C.isData3DTexture,fn=X.isDataArrayTexture||X.isData3DTexture;if(C.isDepthTexture){const ln=ne.get(C),Wt=ne.get(X),Jt=ne.get(ln.__renderTarget),ts=ne.get(Wt.__renderTarget);W.bindFramebuffer(z.READ_FRAMEBUFFER,Jt.__webglFramebuffer),W.bindFramebuffer(z.DRAW_FRAMEBUFFER,ts.__webglFramebuffer);for(let ii=0;ii<Ve;ii++)Ft&&(z.framebufferTextureLayer(z.READ_FRAMEBUFFER,z.COLOR_ATTACHMENT0,ne.get(C).__webglTexture,q,Ze+ii),z.framebufferTextureLayer(z.DRAW_FRAMEBUFFER,z.COLOR_ATTACHMENT0,ne.get(X).__webglTexture,me,Ot+ii)),z.blitFramebuffer(ct,ht,Ce,We,gt,Rt,Ce,We,z.DEPTH_BUFFER_BIT,z.NEAREST);W.bindFramebuffer(z.READ_FRAMEBUFFER,null),W.bindFramebuffer(z.DRAW_FRAMEBUFFER,null)}else if(q!==0||C.isRenderTargetTexture||ne.has(C)){const ln=ne.get(C),Wt=ne.get(X);W.bindFramebuffer(z.READ_FRAMEBUFFER,Qi),W.bindFramebuffer(z.DRAW_FRAMEBUFFER,es);for(let Jt=0;Jt<Ve;Jt++)Ft?z.framebufferTextureLayer(z.READ_FRAMEBUFFER,z.COLOR_ATTACHMENT0,ln.__webglTexture,q,Ze+Jt):z.framebufferTexture2D(z.READ_FRAMEBUFFER,z.COLOR_ATTACHMENT0,z.TEXTURE_2D,ln.__webglTexture,q),fn?z.framebufferTextureLayer(z.DRAW_FRAMEBUFFER,z.COLOR_ATTACHMENT0,Wt.__webglTexture,me,Ot+Jt):z.framebufferTexture2D(z.DRAW_FRAMEBUFFER,z.COLOR_ATTACHMENT0,z.TEXTURE_2D,Wt.__webglTexture,me),q!==0?z.blitFramebuffer(ct,ht,Ce,We,gt,Rt,Ce,We,z.COLOR_BUFFER_BIT,z.NEAREST):fn?z.copyTexSubImage3D($t,me,gt,Rt,Ot+Jt,ct,ht,Ce,We):z.copyTexSubImage2D($t,me,gt,Rt,ct,ht,Ce,We);W.bindFramebuffer(z.READ_FRAMEBUFFER,null),W.bindFramebuffer(z.DRAW_FRAMEBUFFER,null)}else fn?C.isDataTexture||C.isData3DTexture?z.texSubImage3D($t,me,gt,Rt,Ot,Ce,We,Ve,St,tt,kt.data):X.isCompressedArrayTexture?z.compressedTexSubImage3D($t,me,gt,Rt,Ot,Ce,We,Ve,St,kt.data):z.texSubImage3D($t,me,gt,Rt,Ot,Ce,We,Ve,St,tt,kt):C.isDataTexture?z.texSubImage2D(z.TEXTURE_2D,me,gt,Rt,Ce,We,St,tt,kt.data):C.isCompressedTexture?z.compressedTexSubImage2D(z.TEXTURE_2D,me,gt,Rt,kt.width,kt.height,St,kt.data):z.texSubImage2D(z.TEXTURE_2D,me,gt,Rt,Ce,We,St,tt,kt);z.pixelStorei(z.UNPACK_ROW_LENGTH,Et),z.pixelStorei(z.UNPACK_IMAGE_HEIGHT,yn),z.pixelStorei(z.UNPACK_SKIP_PIXELS,zt),z.pixelStorei(z.UNPACK_SKIP_ROWS,tn),z.pixelStorei(z.UNPACK_SKIP_IMAGES,Ui),me===0&&X.generateMipmaps&&z.generateMipmap($t),W.unbindTexture()},this.copyTextureToTexture3D=function(C,X,Z=null,ee=null,q=0){return ws('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(C,X,Z,ee,q)},this.initRenderTarget=function(C){ne.get(C).__webglFramebuffer===void 0&&ye.setupRenderTarget(C)},this.initTexture=function(C){C.isCubeTexture?ye.setTextureCube(C,0):C.isData3DTexture?ye.setTexture3D(C,0):C.isDataArrayTexture||C.isCompressedArrayTexture?ye.setTexture2DArray(C,0):ye.setTexture2D(C,0),W.unbindTexture()},this.resetState=function(){L=0,D=0,N=null,W.reset(),rt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return fi}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=Mt._getDrawingBufferColorSpace(e),t.unpackColorSpace=Mt._getUnpackColorSpace()}}var fg=Object.defineProperty,pg=(s,e,t)=>e in s?fg(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,Pt=(s,e,t)=>pg(s,typeof e!="symbol"?e+"":e,t);const Cu=(s,e)=>{const[t,n]=e.split("-");return Object.assign(s.style,{left:n==="left"?"0":n==="center"?"50%":"",right:n==="right"?"0":"",top:t==="top"?"0":t==="bottom"?"":"50%",bottom:t==="bottom"?"0":"",transform:`${n==="center"?"translateX(-50%)":""} ${t==="center"?"translateY(-50%)":""}`}),e},mg=({placement:s,size:e,offset:t,id:n,className:i})=>{const r=document.createElement("div"),{top:a,left:o,right:l,bottom:c}=t;return Object.assign(r.style,{id:n,position:"absolute",zIndex:"1000",height:`${e}px`,width:`${e}px`,margin:`${a}px ${l}px ${c}px ${o}px`,borderRadius:"100%"}),Cu(r,s),n&&(r.id=n),i&&(r.className=i),r},gg=s=>{const e=typeof s=="string"?document.querySelector(s):s;if(!e)throw Error("Invalid DOM element");return e};function hl(s,e,t){return Math.max(e,Math.min(t,s))}const _g=[["x",0,3],["y",1,4],["z",2,5]],gh=new F;function _h({isSphere:s},e,t){s&&(gh.set(0,0,1).applyQuaternion(t.quaternion),_g.forEach(([n,i,r])=>{const a=gh[n];let o=e[i],l=o.userData.opacity;o.material.opacity=hl(a>=0?l:l/2,0,1),o=e[r],l=o.userData.opacity,o.material.opacity=hl(a>=0?l/2:l,0,1)}))}const vg=(s,e,t=10)=>Math.abs(s.clientX-e.x)<t&&Math.abs(s.clientY-e.y)<t,vh=new Ap,xh=new Be,yh=(s,e,t,n)=>{xh.set((s.clientX-e.left)/e.width*2-1,-((s.clientY-e.top)/e.height)*2+1),vh.setFromCamera(xh,t);const i=vh.intersectObjects(n,!1),r=i.length?i[0]:null;return!r||!r.object.visible?null:r},uo=1e-6,xg=2*Math.PI,Ru=["x","y","z"],ar=[...Ru,"nx","ny","nz"],yg=["x","z","y","nx","nz","ny"],Mg=["z","x","y","nz","nx","ny"],ul="Right",aa="Top",dl="Front",fl="Left",oa="Bottom",pl="Back",bg=[ul,aa,dl,fl,oa,pl].map(s=>s.toLocaleLowerCase()),Lu=1.3,Mh=(s,e=!0)=>{const{material:t,userData:n}=s,{color:i,opacity:r}=e?n.hover:n;t.color.set(i),t.opacity=r},Vi=s=>JSON.parse(JSON.stringify(s)),Sg=s=>{const e=s.type||"sphere",t=e==="sphere",n=s.resolution||t?64:128,i=It.DEFAULT_UP,r=i.z===1,a=i.x===1,{container:o}=s;s.container=void 0,s=JSON.parse(JSON.stringify(s)),s.container=o;const l=r?yg:a?Mg:ar;bg.forEach((u,d)=>{s[u]&&(s[l[d]]=s[u])});const c={enabled:!0,color:16777215,opacity:1,scale:.7,labelColor:2236962,line:!1,border:{size:0,color:14540253},hover:{color:t?16777215:9688043,labelColor:2236962,opacity:1,scale:.7,border:{size:0,color:14540253}}},h={line:!1,scale:t?.45:.7,hover:{scale:t?.5:.7}},f={type:e,container:document.body,size:128,placement:"top-right",resolution:n,lineWidth:4,radius:t?1:.2,smoothness:18,animated:!0,speed:1,background:{enabled:!0,color:t?16777215:14739180,opacity:t?0:1,hover:{color:t?16777215:14739180,opacity:t?.2:1}},font:{family:"sans-serif",weight:900},offset:{top:10,left:10,bottom:10,right:10},corners:{enabled:!t,color:t?15915362:16777215,opacity:1,scale:t?.15:.2,radius:1,smoothness:18,hover:{color:t?16777215:9688043,opacity:1,scale:t?.2:.225}},edges:{enabled:!t,color:t?15915362:16777215,opacity:t?1:0,radius:t?1:.125,smoothness:18,scale:t?.15:1,hover:{color:t?16777215:9688043,opacity:1,scale:t?.2:1}},x:{...Vi(c),...t?{label:"X",color:16725587,line:!0}:{label:a?aa:ul}},y:{...Vi(c),...t?{label:"Y",color:9100032,line:!0}:{label:r||a?dl:aa}},z:{...Vi(c),...t?{label:"Z",color:2920447,line:!0}:{label:r?aa:a?ul:dl}},nx:{...Vi(h),label:t?"":a?oa:fl},ny:{...Vi(h),label:t?"":r||a?pl:oa},nz:{...Vi(h),label:t?"":r?oa:a?fl:pl}};return ml(s,f),Ru.forEach(u=>ml(s[`n${u}`],Vi(s[u]))),{...s,isSphere:t}};function ml(s,...e){if(s instanceof HTMLElement||typeof s!="object"||s===null)return s;for(const t of e)for(const n in t)n!=="container"&&n in t&&(s[n]===void 0?s[n]=t[n]:typeof t[n]=="object"&&!Array.isArray(t[n])&&(s[n]=ml(s[n]||{},t[n])));return s}const Eg=(s,e=2)=>{const t=new et,n=e*2,{isSphere:i,resolution:r,radius:a,font:o,corners:l,edges:c}=s,h=ar.map(D=>({...s[D],radius:a}));i&&l.enabled&&h.push(l),i&&c.enabled&&h.push(c);const f=document.createElement("canvas"),u=f.getContext("2d");f.width=r*2+n*2,f.height=r*h.length+n*h.length;const[d,m]=U(h,r,o);h.forEach(({radius:D,label:N,color:b,labelColor:M,border:I,hover:{color:V,labelColor:H,border:J}},ie)=>{const B=r*ie+ie*n+e;S(e,B,e,r,D,N,I,b,M),S(r+e*3,B,e,r,D,N,J??I,V??b,H??M)});const _=h.length,g=e/(r*2),p=e/(r*6),w=1/_,E=new zf(f);return E.repeat.set(.5-2*g,w-2*p),E.offset.set(g,1-p),Object.assign(E,{colorSpace:Tt,wrapS:Zn,wrapT:Zn,userData:{offsetX:g,offsetY:p,cellHeight:w}}),E;function S(D,N,b,M,I,V,H,J,ie){if(I=I*(M/2),J!=null&&J!==""&&(B(),u.fillStyle=t.set(J).getStyle(),u.fill()),H&&H.size){const oe=H.size*M/2;D+=oe,N+=oe,M-=H.size*M,I=Math.max(0,I-oe),B(),u.strokeStyle=t.set(H.color).getStyle(),u.lineWidth=H.size*M,u.stroke()}V&&L(u,D+M/2,N+(M+b)/2,V,t.set(ie).getStyle());function B(){u.beginPath(),u.moveTo(D+I,N),u.lineTo(D+M-I,N),u.arcTo(D+M,N,D+M,N+I,I),u.lineTo(D+M,N+M-I),u.arcTo(D+M,N+M,D+M-I,N+M,I),u.lineTo(D+I,N+M),u.arcTo(D,N+M,D,N+M-I,I),u.lineTo(D,N+I),u.arcTo(D,N,D+I,N,I),u.closePath()}}function U(D,N,b){const M=[...D].sort((pe,Me)=>{var Ue,Ne;return(((Ue=pe.label)==null?void 0:Ue.length)||0)-(((Ne=Me.label)==null?void 0:Ne.length)||0)}).pop().label,{family:I,weight:V}=b,H=i?Math.sqrt(Math.pow(N*.7,2)/2):N;let J=H,ie=0,B=0;do{u.font=`${V} ${J}px ${I}`;const pe=u.measureText(M);ie=pe.width,B=pe.fontBoundingBoxDescent,J--}while(ie>H&&J>0);const oe=H/B,j=Math.min(H/ie,oe),ue=Math.floor(J*j);return[`${V} ${ue}px ${I}`,oe]}function L(D,N,b,M,I){D.font=d,D.textAlign="center",D.textBaseline="middle",D.fillStyle=I,D.fillText(M,N,b+(i?m:0))}},wg=(s,e)=>s.offset.x=(e?.5:0)+s.userData.offsetX,Vl=(s,e)=>{const{offset:t,userData:{offsetY:n,cellHeight:i}}=s;t.y=1-(e+1)*i+n};function Hl(s,e,t=2,n=2){const i=t/2-s,r=n/2-s,a=s/t,o=(t-s)/t,l=s/n,c=(n-s)/n,h=[i,r,0,-i,r,0,-i,-r,0,i,-r,0],f=[o,c,a,c,a,l,o,l],u=[3*(e+1)+3,3*(e+1)+4,e+4,e+5,2*(e+1)+4,2,1,2*(e+1)+3,3,4*(e+1)+3,4,0],d=[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11].map(L=>u[L]);let m,_,g,p,w,E,S,U;for(let L=0;L<4;L++){p=L<1||L>2?i:-i,w=L<2?r:-r,E=L<1||L>2?o:a,S=L<2?c:l;for(let D=0;D<=e;D++)m=Math.PI/2*(L+D/e),_=Math.cos(m),g=Math.sin(m),h.push(p+s*_,w+s*g,0),f.push(E+a*_,S+l*g),D<e&&(U=(e+1)*L+D+4,d.push(L,U,U+1))}return new Bt().setIndex(new Ht(new Uint32Array(d),1)).setAttribute("position",new Ht(new Float32Array(h),3)).setAttribute("uv",new Ht(new Float32Array(f),2))}const Ag=(s,e)=>{const t=new F,{isSphere:n,radius:i,smoothness:r}=s,a=Hl(i,r);return ar.map((o,l)=>{const c=l<3,h=ar[l],f=l?e.clone():e;Vl(f,l);const{enabled:u,scale:d,opacity:m,hover:_}=s[h],g={map:f,opacity:m,transparent:!0},p=n?new Rl(new ya(g)):new Ct(a,new Pi(g)),w=c?h:h[1];return p.position[w]=(c?1:-1)*(n?Lu:1),n||p.lookAt(t.copy(p.position).multiplyScalar(1.7)),p.scale.setScalar(d),p.renderOrder=1,p.visible=u,p.userData={scale:d,opacity:m,hover:_},p})},Tg=(s,e)=>{const{isSphere:t,corners:n}=s;if(!n.enabled)return[];const{color:i,opacity:r,scale:a,radius:o,smoothness:l,hover:c}=n,h=t?null:Hl(o,l),f={transparent:!0,opacity:r},u=[1,1,1,-1,1,1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,-1,-1,-1,-1,-1].map(m=>m*.85),d=new F;return Array(u.length/3).fill(0).map((m,_)=>{if(t){const w=e.clone();Vl(w,6),f.map=w}else f.color=i;const g=t?new Rl(new ya(f)):new Ct(h,new Pi(f)),p=_*3;return g.position.set(u[p],u[p+1],u[p+2]),t&&g.position.normalize().multiplyScalar(1.7),g.scale.setScalar(a),g.lookAt(d.copy(g.position).multiplyScalar(2)),g.renderOrder=1,g.userData={color:i,opacity:r,scale:a,hover:c},g})},Cg=(s,e,t)=>{const{isSphere:n,edges:i}=s;if(!i.enabled)return[];const{color:r,opacity:a,scale:o,hover:l,radius:c,smoothness:h}=i,f=n?null:Hl(c,h,1.2,.25),u={transparent:!0,opacity:a},d=[0,1,1,0,-1,1,1,0,1,-1,0,1,0,1,-1,0,-1,-1,1,0,-1,-1,0,-1,1,1,0,1,-1,0,-1,1,0,-1,-1,0].map(g=>g*.925),m=new F,_=new F(0,1,0);return Array(d.length/3).fill(0).map((g,p)=>{if(n){const S=e.clone();Vl(S,t),u.map=S}else u.color=r;const w=n?new Rl(new ya(u)):new Ct(f,new Pi(u)),E=p*3;return w.position.set(d[E],d[E+1],d[E+2]),n&&w.position.normalize().multiplyScalar(1.7),w.scale.setScalar(o),w.up.copy(_),w.lookAt(m.copy(w.position).multiplyScalar(2)),!n&&!w.position.y&&(w.rotation.z=Math.PI/2),w.renderOrder=1,w.userData={color:r,opacity:a,scale:o,hover:l},w})};function Rg(s,e=!1){const t=s[0].index!==null,n=new Set(Object.keys(s[0].attributes)),i=new Set(Object.keys(s[0].morphAttributes)),r={},a={},o=s[0].morphTargetsRelative,l=new Bt;let c=0;for(let h=0;h<s.length;++h){const f=s[h];let u=0;if(t!==(f.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(const d in f.attributes){if(!n.has(d))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+'. All geometries must have compatible attributes; make sure "'+d+'" attribute exists among all geometries, or in none of them.'),null;r[d]===void 0&&(r[d]=[]),r[d].push(f.attributes[d]),u++}if(u!==n.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". Make sure all geometries have the same number of attributes."),null;if(o!==f.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(const d in f.morphAttributes){if(!i.has(d))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". .morphAttributes must be consistent throughout all geometries."),null;a[d]===void 0&&(a[d]=[]),a[d].push(f.morphAttributes[d])}if(e){let d;if(t)d=f.index.count;else if(f.attributes.position!==void 0)d=f.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". The geometry must have either an index or a position attribute"),null;l.addGroup(c,d,h),c+=d}}if(t){let h=0;const f=[];for(let u=0;u<s.length;++u){const d=s[u].index;for(let m=0;m<d.count;++m)f.push(d.getX(m)+h);h+=s[u].attributes.position.count}l.setIndex(f)}for(const h in r){const f=bh(r[h]);if(!f)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+h+" attribute."),null;l.setAttribute(h,f)}for(const h in a){const f=a[h][0].length;if(f===0)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[h]=[];for(let u=0;u<f;++u){const d=[];for(let _=0;_<a[h].length;++_)d.push(a[h][_][u]);const m=bh(d);if(!m)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+h+" morphAttribute."),null;l.morphAttributes[h].push(m)}}return l}function bh(s){let e,t,n,i=-1,r=0;for(let c=0;c<s.length;++c){const h=s[c];if(e===void 0&&(e=h.array.constructor),e!==h.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(t===void 0&&(t=h.itemSize),t!==h.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(n===void 0&&(n=h.normalized),n!==h.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(i===-1&&(i=h.gpuType),i!==h.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;r+=h.count*t}const a=new e(r),o=new Ht(a,t,n);let l=0;for(let c=0;c<s.length;++c){const h=s[c];if(h.isInterleavedBufferAttribute){const f=l/t;for(let u=0,d=h.count;u<d;u++)for(let m=0;m<t;m++){const _=h.getComponent(u,m);o.setComponent(u+f,m,_)}}else a.set(h.array,l);l+=h.count*t}return i!==void 0&&(o.gpuType=i),o}const Lg=(s,e)=>{const{isSphere:t,background:{enabled:n,color:i,opacity:r,hover:a}}=e;let o;const l=new Pi({color:i,side:gn,opacity:r,transparent:!0,depthWrite:!1});if(!n)return null;if(t)o=new Ct(new Ma(1.8,64,64),l);else{let c;s.forEach(h=>{const f=h.scale.x;h.scale.setScalar(.9),h.updateMatrix();const u=h.geometry.clone();u.applyMatrix4(h.matrix),c=c?Rg([c,u]):u,h.scale.setScalar(f)}),o=new Ct(c,l)}return o.userData={color:i,opacity:r,hover:a},o},Sh=new qn,Xr=new F;class Pu extends Sp{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],t=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],n=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(n),this.setAttribute("position",new mt(e,3)),this.setAttribute("uv",new mt(t,2))}applyMatrix4(e){const t=this.attributes.instanceStart,n=this.attributes.instanceEnd;return t!==void 0&&(t.applyMatrix4(e),n.applyMatrix4(e),t.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const n=new ol(t,6,1);return this.setAttribute("instanceStart",new ti(n,3,0)),this.setAttribute("instanceEnd",new ti(n,3,3)),this.instanceCount=this.attributes.instanceStart.count,this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const n=new ol(t,6,1);return this.setAttribute("instanceColorStart",new ti(n,3,0)),this.setAttribute("instanceColorEnd",new ti(n,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new ep(e.geometry)),this}fromLineSegments(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new qn);const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;e!==void 0&&t!==void 0&&(this.boundingBox.setFromBufferAttribute(e),Sh.setFromBufferAttribute(t),this.boundingBox.union(Sh))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new gi),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(e!==void 0&&t!==void 0){const n=this.boundingSphere.center;this.boundingBox.getCenter(n);let i=0;for(let r=0,a=e.count;r<a;r++)Xr.fromBufferAttribute(e,r),i=Math.max(i,n.distanceToSquared(Xr)),Xr.fromBufferAttribute(t,r),i=Math.max(i,n.distanceToSquared(Xr));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(e){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(e)}}Le.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new Be(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};En.line={uniforms:Tl.merge([Le.common,Le.fog,Le.line]),vertexShader:`
|
|
3827
|
+
}`;class og{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(this.texture===null){const i=new on,r=e.properties.get(i);r.__webglTexture=t.texture,(t.depthNear!==n.depthNear||t.depthFar!==n.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=i}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,n=new mi({vertexShader:rg,fragmentShader:ag,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Ct(new lr(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class lg extends Ki{constructor(e,t){super();const n=this;let i=null,r=1,a=null,o="local-floor",l=1,c=null,h=null,d=null,u=null,f=null,m=null;const _=new og,g=t.getContextAttributes();let p=null,w=null;const E=[],S=[],U=new Be;let L=null;const D=new an;D.viewport=new bt;const N=new an;N.viewport=new bt;const b=[D,N],M=new Ep;let I=null,V=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function($){let se=E[$];return se===void 0&&(se=new Ya,E[$]=se),se.getTargetRaySpace()},this.getControllerGrip=function($){let se=E[$];return se===void 0&&(se=new Ya,E[$]=se),se.getGripSpace()},this.getHand=function($){let se=E[$];return se===void 0&&(se=new Ya,E[$]=se),se.getHandSpace()};function H($){const se=S.indexOf($.inputSource);if(se===-1)return;const re=E[se];re!==void 0&&(re.update($.inputSource,$.frame,c||a),re.dispatchEvent({type:$.type,data:$.inputSource}))}function J(){i.removeEventListener("select",H),i.removeEventListener("selectstart",H),i.removeEventListener("selectend",H),i.removeEventListener("squeeze",H),i.removeEventListener("squeezestart",H),i.removeEventListener("squeezeend",H),i.removeEventListener("end",J),i.removeEventListener("inputsourceschange",ie);for(let $=0;$<E.length;$++){const se=S[$];se!==null&&(S[$]=null,E[$].disconnect(se))}I=null,V=null,_.reset(),e.setRenderTarget(p),f=null,u=null,d=null,i=null,w=null,Ne.stop(),n.isPresenting=!1,e.setPixelRatio(L),e.setSize(U.width,U.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function($){r=$,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function($){o=$,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||a},this.setReferenceSpace=function($){c=$},this.getBaseLayer=function(){return u!==null?u:f},this.getBinding=function(){return d},this.getFrame=function(){return m},this.getSession=function(){return i},this.setSession=async function($){if(i=$,i!==null){if(p=e.getRenderTarget(),i.addEventListener("select",H),i.addEventListener("selectstart",H),i.addEventListener("selectend",H),i.addEventListener("squeeze",H),i.addEventListener("squeezestart",H),i.addEventListener("squeezeend",H),i.addEventListener("end",J),i.addEventListener("inputsourceschange",ie),g.xrCompatible!==!0&&await t.makeXRCompatible(),L=e.getPixelRatio(),e.getSize(U),typeof XRWebGLBinding<"u"&&"createProjectionLayer"in XRWebGLBinding.prototype){let re=null,le=null,Ee=null;g.depth&&(Ee=g.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,re=g.stencil?sr:ir,le=g.stencil?nr:$i);const fe={colorFormat:t.RGBA8,depthFormat:Ee,scaleFactor:r};d=new XRWebGLBinding(i,t),u=d.createProjectionLayer(fe),i.updateRenderState({layers:[u]}),e.setPixelRatio(1),e.setSize(u.textureWidth,u.textureHeight,!1),w=new Ji(u.textureWidth,u.textureHeight,{format:Fn,type:ni,depthTexture:new fu(u.textureWidth,u.textureHeight,le,void 0,void 0,void 0,void 0,void 0,void 0,re),stencilBuffer:g.stencil,colorSpace:e.outputColorSpace,samples:g.antialias?4:0,resolveDepthBuffer:u.ignoreDepthValues===!1,resolveStencilBuffer:u.ignoreDepthValues===!1})}else{const re={antialias:g.antialias,alpha:!0,depth:g.depth,stencil:g.stencil,framebufferScaleFactor:r};f=new XRWebGLLayer(i,t,re),i.updateRenderState({baseLayer:f}),e.setPixelRatio(1),e.setSize(f.framebufferWidth,f.framebufferHeight,!1),w=new Ji(f.framebufferWidth,f.framebufferHeight,{format:Fn,type:ni,colorSpace:e.outputColorSpace,stencilBuffer:g.stencil,resolveDepthBuffer:f.ignoreDepthValues===!1,resolveStencilBuffer:f.ignoreDepthValues===!1})}w.isXRRenderTarget=!0,this.setFoveation(l),c=null,a=await i.requestReferenceSpace(o),Ne.setContext(i),Ne.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode},this.getDepthTexture=function(){return _.getDepthTexture()};function ie($){for(let se=0;se<$.removed.length;se++){const re=$.removed[se],le=S.indexOf(re);le>=0&&(S[le]=null,E[le].disconnect(re))}for(let se=0;se<$.added.length;se++){const re=$.added[se];let le=S.indexOf(re);if(le===-1){for(let fe=0;fe<E.length;fe++)if(fe>=S.length){S.push(re),le=fe;break}else if(S[fe]===null){S[fe]=re,le=fe;break}if(le===-1)break}const Ee=E[le];Ee&&Ee.connect(re)}}const B=new F,oe=new F;function j($,se,re){B.setFromMatrixPosition(se.matrixWorld),oe.setFromMatrixPosition(re.matrixWorld);const le=B.distanceTo(oe),Ee=se.projectionMatrix.elements,fe=re.projectionMatrix.elements,be=Ee[14]/(Ee[10]-1),Je=Ee[14]/(Ee[10]+1),at=(Ee[9]+1)/Ee[5],it=(Ee[9]-1)/Ee[5],z=(Ee[8]-1)/Ee[0],yt=(fe[8]+1)/fe[0],dt=be*z,ot=be*yt,W=le/(-z+yt),ae=W*-z;if(se.matrixWorld.decompose($.position,$.quaternion,$.scale),$.translateX(ae),$.translateZ(W),$.matrixWorld.compose($.position,$.quaternion,$.scale),$.matrixWorldInverse.copy($.matrixWorld).invert(),Ee[10]===-1)$.projectionMatrix.copy(se.projectionMatrix),$.projectionMatrixInverse.copy(se.projectionMatrixInverse);else{const ne=be+W,ye=Je+W,Oe=dt-ae,T=ot+(le-ae),y=at*Je/ye*ne,k=it*Je/ye*ne;$.projectionMatrix.makePerspective(Oe,T,y,k,ne,ye),$.projectionMatrixInverse.copy($.projectionMatrix).invert()}}function ue($,se){se===null?$.matrixWorld.copy($.matrix):$.matrixWorld.multiplyMatrices(se.matrixWorld,$.matrix),$.matrixWorldInverse.copy($.matrixWorld).invert()}this.updateCamera=function($){if(i===null)return;let se=$.near,re=$.far;_.texture!==null&&(_.depthNear>0&&(se=_.depthNear),_.depthFar>0&&(re=_.depthFar)),M.near=N.near=D.near=se,M.far=N.far=D.far=re,(I!==M.near||V!==M.far)&&(i.updateRenderState({depthNear:M.near,depthFar:M.far}),I=M.near,V=M.far),D.layers.mask=$.layers.mask|2,N.layers.mask=$.layers.mask|4,M.layers.mask=D.layers.mask|N.layers.mask;const le=$.parent,Ee=M.cameras;ue(M,le);for(let fe=0;fe<Ee.length;fe++)ue(Ee[fe],le);Ee.length===2?j(M,D,N):M.projectionMatrix.copy(D.projectionMatrix),pe($,M,le)};function pe($,se,re){re===null?$.matrix.copy(se.matrixWorld):($.matrix.copy(re.matrixWorld),$.matrix.invert(),$.matrix.multiply(se.matrixWorld)),$.matrix.decompose($.position,$.quaternion,$.scale),$.updateMatrixWorld(!0),$.projectionMatrix.copy(se.projectionMatrix),$.projectionMatrixInverse.copy(se.projectionMatrixInverse),$.isPerspectiveCamera&&($.fov=Ps*2*Math.atan(1/$.projectionMatrix.elements[5]),$.zoom=1)}this.getCamera=function(){return M},this.getFoveation=function(){if(!(u===null&&f===null))return l},this.setFoveation=function($){l=$,u!==null&&(u.fixedFoveation=$),f!==null&&f.fixedFoveation!==void 0&&(f.fixedFoveation=$)},this.hasDepthSensing=function(){return _.texture!==null},this.getDepthSensingMesh=function(){return _.getMesh(M)};let Me=null;function Ue($,se){if(h=se.getViewerPose(c||a),m=se,h!==null){const re=h.views;f!==null&&(e.setRenderTargetFramebuffer(w,f.framebuffer),e.setRenderTarget(w));let le=!1;re.length!==M.cameras.length&&(M.cameras.length=0,le=!0);for(let be=0;be<re.length;be++){const Je=re[be];let at=null;if(f!==null)at=f.getViewport(Je);else{const z=d.getViewSubImage(u,Je);at=z.viewport,be===0&&(e.setRenderTargetTextures(w,z.colorTexture,z.depthStencilTexture),e.setRenderTarget(w))}let it=b[be];it===void 0&&(it=new an,it.layers.enable(be),it.viewport=new bt,b[be]=it),it.matrix.fromArray(Je.transform.matrix),it.matrix.decompose(it.position,it.quaternion,it.scale),it.projectionMatrix.fromArray(Je.projectionMatrix),it.projectionMatrixInverse.copy(it.projectionMatrix).invert(),it.viewport.set(at.x,at.y,at.width,at.height),be===0&&(M.matrix.copy(it.matrix),M.matrix.decompose(M.position,M.quaternion,M.scale)),le===!0&&M.cameras.push(it)}const Ee=i.enabledFeatures;if(Ee&&Ee.includes("depth-sensing")&&i.depthUsage=="gpu-optimized"&&d){const be=d.getDepthInformation(re[0]);be&&be.isValid&&be.texture&&_.init(e,be,i.renderState)}}for(let re=0;re<E.length;re++){const le=S[re],Ee=E[re];le!==null&&Ee!==void 0&&Ee.update(le,se,c||a)}Me&&Me($,se),se.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:se}),m=null}const Ne=new Su;Ne.setAnimationLoop(Ue),this.setAnimationLoop=function($){Me=$},this.dispose=function(){}}}const ki=new _n,cg=new st;function hg(s,e){function t(g,p){g.matrixAutoUpdate===!0&&g.updateMatrix(),p.value.copy(g.matrix)}function n(g,p){p.color.getRGB(g.fogColor.value,au(s)),p.isFog?(g.fogNear.value=p.near,g.fogFar.value=p.far):p.isFogExp2&&(g.fogDensity.value=p.density)}function i(g,p,w,E,S){p.isMeshBasicMaterial||p.isMeshLambertMaterial?r(g,p):p.isMeshToonMaterial?(r(g,p),d(g,p)):p.isMeshPhongMaterial?(r(g,p),h(g,p)):p.isMeshStandardMaterial?(r(g,p),u(g,p),p.isMeshPhysicalMaterial&&f(g,p,S)):p.isMeshMatcapMaterial?(r(g,p),m(g,p)):p.isMeshDepthMaterial?r(g,p):p.isMeshDistanceMaterial?(r(g,p),_(g,p)):p.isMeshNormalMaterial?r(g,p):p.isLineBasicMaterial?(a(g,p),p.isLineDashedMaterial&&o(g,p)):p.isPointsMaterial?l(g,p,w,E):p.isSpriteMaterial?c(g,p):p.isShadowMaterial?(g.color.value.copy(p.color),g.opacity.value=p.opacity):p.isShaderMaterial&&(p.uniformsNeedUpdate=!1)}function r(g,p){g.opacity.value=p.opacity,p.color&&g.diffuse.value.copy(p.color),p.emissive&&g.emissive.value.copy(p.emissive).multiplyScalar(p.emissiveIntensity),p.map&&(g.map.value=p.map,t(p.map,g.mapTransform)),p.alphaMap&&(g.alphaMap.value=p.alphaMap,t(p.alphaMap,g.alphaMapTransform)),p.bumpMap&&(g.bumpMap.value=p.bumpMap,t(p.bumpMap,g.bumpMapTransform),g.bumpScale.value=p.bumpScale,p.side===gn&&(g.bumpScale.value*=-1)),p.normalMap&&(g.normalMap.value=p.normalMap,t(p.normalMap,g.normalMapTransform),g.normalScale.value.copy(p.normalScale),p.side===gn&&g.normalScale.value.negate()),p.displacementMap&&(g.displacementMap.value=p.displacementMap,t(p.displacementMap,g.displacementMapTransform),g.displacementScale.value=p.displacementScale,g.displacementBias.value=p.displacementBias),p.emissiveMap&&(g.emissiveMap.value=p.emissiveMap,t(p.emissiveMap,g.emissiveMapTransform)),p.specularMap&&(g.specularMap.value=p.specularMap,t(p.specularMap,g.specularMapTransform)),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest);const w=e.get(p),E=w.envMap,S=w.envMapRotation;E&&(g.envMap.value=E,ki.copy(S),ki.x*=-1,ki.y*=-1,ki.z*=-1,E.isCubeTexture&&E.isRenderTargetTexture===!1&&(ki.y*=-1,ki.z*=-1),g.envMapRotation.value.setFromMatrix4(cg.makeRotationFromEuler(ki)),g.flipEnvMap.value=E.isCubeTexture&&E.isRenderTargetTexture===!1?-1:1,g.reflectivity.value=p.reflectivity,g.ior.value=p.ior,g.refractionRatio.value=p.refractionRatio),p.lightMap&&(g.lightMap.value=p.lightMap,g.lightMapIntensity.value=p.lightMapIntensity,t(p.lightMap,g.lightMapTransform)),p.aoMap&&(g.aoMap.value=p.aoMap,g.aoMapIntensity.value=p.aoMapIntensity,t(p.aoMap,g.aoMapTransform))}function a(g,p){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,p.map&&(g.map.value=p.map,t(p.map,g.mapTransform))}function o(g,p){g.dashSize.value=p.dashSize,g.totalSize.value=p.dashSize+p.gapSize,g.scale.value=p.scale}function l(g,p,w,E){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,g.size.value=p.size*w,g.scale.value=E*.5,p.map&&(g.map.value=p.map,t(p.map,g.uvTransform)),p.alphaMap&&(g.alphaMap.value=p.alphaMap,t(p.alphaMap,g.alphaMapTransform)),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest)}function c(g,p){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,g.rotation.value=p.rotation,p.map&&(g.map.value=p.map,t(p.map,g.mapTransform)),p.alphaMap&&(g.alphaMap.value=p.alphaMap,t(p.alphaMap,g.alphaMapTransform)),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest)}function h(g,p){g.specular.value.copy(p.specular),g.shininess.value=Math.max(p.shininess,1e-4)}function d(g,p){p.gradientMap&&(g.gradientMap.value=p.gradientMap)}function u(g,p){g.metalness.value=p.metalness,p.metalnessMap&&(g.metalnessMap.value=p.metalnessMap,t(p.metalnessMap,g.metalnessMapTransform)),g.roughness.value=p.roughness,p.roughnessMap&&(g.roughnessMap.value=p.roughnessMap,t(p.roughnessMap,g.roughnessMapTransform)),p.envMap&&(g.envMapIntensity.value=p.envMapIntensity)}function f(g,p,w){g.ior.value=p.ior,p.sheen>0&&(g.sheenColor.value.copy(p.sheenColor).multiplyScalar(p.sheen),g.sheenRoughness.value=p.sheenRoughness,p.sheenColorMap&&(g.sheenColorMap.value=p.sheenColorMap,t(p.sheenColorMap,g.sheenColorMapTransform)),p.sheenRoughnessMap&&(g.sheenRoughnessMap.value=p.sheenRoughnessMap,t(p.sheenRoughnessMap,g.sheenRoughnessMapTransform))),p.clearcoat>0&&(g.clearcoat.value=p.clearcoat,g.clearcoatRoughness.value=p.clearcoatRoughness,p.clearcoatMap&&(g.clearcoatMap.value=p.clearcoatMap,t(p.clearcoatMap,g.clearcoatMapTransform)),p.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=p.clearcoatRoughnessMap,t(p.clearcoatRoughnessMap,g.clearcoatRoughnessMapTransform)),p.clearcoatNormalMap&&(g.clearcoatNormalMap.value=p.clearcoatNormalMap,t(p.clearcoatNormalMap,g.clearcoatNormalMapTransform),g.clearcoatNormalScale.value.copy(p.clearcoatNormalScale),p.side===gn&&g.clearcoatNormalScale.value.negate())),p.dispersion>0&&(g.dispersion.value=p.dispersion),p.iridescence>0&&(g.iridescence.value=p.iridescence,g.iridescenceIOR.value=p.iridescenceIOR,g.iridescenceThicknessMinimum.value=p.iridescenceThicknessRange[0],g.iridescenceThicknessMaximum.value=p.iridescenceThicknessRange[1],p.iridescenceMap&&(g.iridescenceMap.value=p.iridescenceMap,t(p.iridescenceMap,g.iridescenceMapTransform)),p.iridescenceThicknessMap&&(g.iridescenceThicknessMap.value=p.iridescenceThicknessMap,t(p.iridescenceThicknessMap,g.iridescenceThicknessMapTransform))),p.transmission>0&&(g.transmission.value=p.transmission,g.transmissionSamplerMap.value=w.texture,g.transmissionSamplerSize.value.set(w.width,w.height),p.transmissionMap&&(g.transmissionMap.value=p.transmissionMap,t(p.transmissionMap,g.transmissionMapTransform)),g.thickness.value=p.thickness,p.thicknessMap&&(g.thicknessMap.value=p.thicknessMap,t(p.thicknessMap,g.thicknessMapTransform)),g.attenuationDistance.value=p.attenuationDistance,g.attenuationColor.value.copy(p.attenuationColor)),p.anisotropy>0&&(g.anisotropyVector.value.set(p.anisotropy*Math.cos(p.anisotropyRotation),p.anisotropy*Math.sin(p.anisotropyRotation)),p.anisotropyMap&&(g.anisotropyMap.value=p.anisotropyMap,t(p.anisotropyMap,g.anisotropyMapTransform))),g.specularIntensity.value=p.specularIntensity,g.specularColor.value.copy(p.specularColor),p.specularColorMap&&(g.specularColorMap.value=p.specularColorMap,t(p.specularColorMap,g.specularColorMapTransform)),p.specularIntensityMap&&(g.specularIntensityMap.value=p.specularIntensityMap,t(p.specularIntensityMap,g.specularIntensityMapTransform))}function m(g,p){p.matcap&&(g.matcap.value=p.matcap)}function _(g,p){const w=e.get(p).light;g.referencePosition.value.setFromMatrixPosition(w.matrixWorld),g.nearDistance.value=w.shadow.camera.near,g.farDistance.value=w.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function ug(s,e,t,n){let i={},r={},a=[];const o=s.getParameter(s.MAX_UNIFORM_BUFFER_BINDINGS);function l(w,E){const S=E.program;n.uniformBlockBinding(w,S)}function c(w,E){let S=i[w.id];S===void 0&&(m(w),S=h(w),i[w.id]=S,w.addEventListener("dispose",g));const U=E.program;n.updateUBOMapping(w,U);const L=e.render.frame;r[w.id]!==L&&(u(w),r[w.id]=L)}function h(w){const E=d();w.__bindingPointIndex=E;const S=s.createBuffer(),U=w.__size,L=w.usage;return s.bindBuffer(s.UNIFORM_BUFFER,S),s.bufferData(s.UNIFORM_BUFFER,U,L),s.bindBuffer(s.UNIFORM_BUFFER,null),s.bindBufferBase(s.UNIFORM_BUFFER,E,S),S}function d(){for(let w=0;w<o;w++)if(a.indexOf(w)===-1)return a.push(w),w;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function u(w){const E=i[w.id],S=w.uniforms,U=w.__cache;s.bindBuffer(s.UNIFORM_BUFFER,E);for(let L=0,D=S.length;L<D;L++){const N=Array.isArray(S[L])?S[L]:[S[L]];for(let b=0,M=N.length;b<M;b++){const I=N[b];if(f(I,L,b,U)===!0){const V=I.__offset,H=Array.isArray(I.value)?I.value:[I.value];let J=0;for(let ie=0;ie<H.length;ie++){const B=H[ie],oe=_(B);typeof B=="number"||typeof B=="boolean"?(I.__data[0]=B,s.bufferSubData(s.UNIFORM_BUFFER,V+J,I.__data)):B.isMatrix3?(I.__data[0]=B.elements[0],I.__data[1]=B.elements[1],I.__data[2]=B.elements[2],I.__data[3]=0,I.__data[4]=B.elements[3],I.__data[5]=B.elements[4],I.__data[6]=B.elements[5],I.__data[7]=0,I.__data[8]=B.elements[6],I.__data[9]=B.elements[7],I.__data[10]=B.elements[8],I.__data[11]=0):(B.toArray(I.__data,J),J+=oe.storage/Float32Array.BYTES_PER_ELEMENT)}s.bufferSubData(s.UNIFORM_BUFFER,V,I.__data)}}}s.bindBuffer(s.UNIFORM_BUFFER,null)}function f(w,E,S,U){const L=w.value,D=E+"_"+S;if(U[D]===void 0)return typeof L=="number"||typeof L=="boolean"?U[D]=L:U[D]=L.clone(),!0;{const N=U[D];if(typeof L=="number"||typeof L=="boolean"){if(N!==L)return U[D]=L,!0}else if(N.equals(L)===!1)return N.copy(L),!0}return!1}function m(w){const E=w.uniforms;let S=0;const U=16;for(let D=0,N=E.length;D<N;D++){const b=Array.isArray(E[D])?E[D]:[E[D]];for(let M=0,I=b.length;M<I;M++){const V=b[M],H=Array.isArray(V.value)?V.value:[V.value];for(let J=0,ie=H.length;J<ie;J++){const B=H[J],oe=_(B),j=S%U,ue=j%oe.boundary,pe=j+ue;S+=ue,pe!==0&&U-pe<oe.storage&&(S+=U-pe),V.__data=new Float32Array(oe.storage/Float32Array.BYTES_PER_ELEMENT),V.__offset=S,S+=oe.storage}}}const L=S%U;return L>0&&(S+=U-L),w.__size=S,w.__cache={},this}function _(w){const E={boundary:0,storage:0};return typeof w=="number"||typeof w=="boolean"?(E.boundary=4,E.storage=4):w.isVector2?(E.boundary=8,E.storage=8):w.isVector3||w.isColor?(E.boundary=16,E.storage=12):w.isVector4?(E.boundary=16,E.storage=16):w.isMatrix3?(E.boundary=48,E.storage=48):w.isMatrix4?(E.boundary=64,E.storage=64):w.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",w),E}function g(w){const E=w.target;E.removeEventListener("dispose",g);const S=a.indexOf(E.__bindingPointIndex);a.splice(S,1),s.deleteBuffer(i[E.id]),delete i[E.id],delete r[E.id]}function p(){for(const w in i)s.deleteBuffer(i[w]);a=[],i={},r={}}return{bind:l,update:c,dispose:p}}class dg{constructor(e={}){const{canvas:t=sf(),context:n=null,depth:i=!0,stencil:r=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:d=!1,reverseDepthBuffer:u=!1}=e;this.isWebGLRenderer=!0;let f;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");f=n.getContextAttributes().alpha}else f=a;const m=new Uint32Array(4),_=new Int32Array(4);let g=null,p=null;const w=[],E=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=Ri,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const S=this;let U=!1;this._outputColorSpace=Tt;let L=0,D=0,N=null,b=-1,M=null;const I=new bt,V=new bt;let H=null;const J=new et(0);let ie=0,B=t.width,oe=t.height,j=1,ue=null,pe=null;const Me=new bt(0,0,B,oe),Ue=new bt(0,0,B,oe);let Ne=!1;const $=new Pl;let se=!1,re=!1;const le=new st,Ee=new st,fe=new F,be=new bt,Je={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let at=!1;function it(){return N===null?j:1}let z=n;function yt(C,X){return t.getContext(C,X)}try{const C={alpha:!0,depth:i,stencil:r,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:h,failIfMajorPerformanceCaveat:d};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${_l}`),t.addEventListener("webglcontextlost",ze,!1),t.addEventListener("webglcontextrestored",ve,!1),t.addEventListener("webglcontextcreationerror",he,!1),z===null){const X="webgl2";if(z=yt(X,C),z===null)throw yt(X)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(C){throw console.error("THREE.WebGLRenderer: "+C.message),C}let dt,ot,W,ae,ne,ye,Oe,T,y,k,K,Q,O,we,xe,Se,Ie,de,Pe,qe,ke,Ae,rt,G;function De(){dt=new b1(z),dt.init(),Ae=new sg(z,dt),ot=new m1(z,dt,e,Ae),W=new ng(z,dt),ot.reverseDepthBuffer&&u&&W.buffers.depth.setReversed(!0),ae=new w1(z),ne=new G2,ye=new ig(z,dt,W,ne,ot,Ae,ae),Oe=new _1(S),T=new M1(S),y=new Pp(z),rt=new f1(z,y),k=new S1(z,y,ae,rt),K=new T1(z,k,y,ae),Pe=new A1(z,ot,ye),Se=new g1(ne),Q=new H2(S,Oe,T,dt,ot,rt,Se),O=new hg(S,ne),we=new X2,xe=new K2(dt),de=new d1(S,Oe,T,W,K,f,l),Ie=new eg(S,K,ot),G=new ug(z,ae,ot,W),qe=new p1(z,dt,ae),ke=new E1(z,dt,ae),ae.programs=Q.programs,S.capabilities=ot,S.extensions=dt,S.properties=ne,S.renderLists=we,S.shadowMap=Ie,S.state=W,S.info=ae}De();const ge=new lg(S,z);this.xr=ge,this.getContext=function(){return z},this.getContextAttributes=function(){return z.getContextAttributes()},this.forceContextLoss=function(){const C=dt.get("WEBGL_lose_context");C&&C.loseContext()},this.forceContextRestore=function(){const C=dt.get("WEBGL_lose_context");C&&C.restoreContext()},this.getPixelRatio=function(){return j},this.setPixelRatio=function(C){C!==void 0&&(j=C,this.setSize(B,oe,!1))},this.getSize=function(C){return C.set(B,oe)},this.setSize=function(C,X,Z=!0){if(ge.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}B=C,oe=X,t.width=Math.floor(C*j),t.height=Math.floor(X*j),Z===!0&&(t.style.width=C+"px",t.style.height=X+"px"),this.setViewport(0,0,C,X)},this.getDrawingBufferSize=function(C){return C.set(B*j,oe*j).floor()},this.setDrawingBufferSize=function(C,X,Z){B=C,oe=X,j=Z,t.width=Math.floor(C*Z),t.height=Math.floor(X*Z),this.setViewport(0,0,C,X)},this.getCurrentViewport=function(C){return C.copy(I)},this.getViewport=function(C){return C.copy(Me)},this.setViewport=function(C,X,Z,ee){C.isVector4?Me.set(C.x,C.y,C.z,C.w):Me.set(C,X,Z,ee),W.viewport(I.copy(Me).multiplyScalar(j).round())},this.getScissor=function(C){return C.copy(Ue)},this.setScissor=function(C,X,Z,ee){C.isVector4?Ue.set(C.x,C.y,C.z,C.w):Ue.set(C,X,Z,ee),W.scissor(V.copy(Ue).multiplyScalar(j).round())},this.getScissorTest=function(){return Ne},this.setScissorTest=function(C){W.setScissorTest(Ne=C)},this.setOpaqueSort=function(C){ue=C},this.setTransparentSort=function(C){pe=C},this.getClearColor=function(C){return C.copy(de.getClearColor())},this.setClearColor=function(){de.setClearColor(...arguments)},this.getClearAlpha=function(){return de.getClearAlpha()},this.setClearAlpha=function(){de.setClearAlpha(...arguments)},this.clear=function(C=!0,X=!0,Z=!0){let ee=0;if(C){let q=!1;if(N!==null){const me=N.texture.format;q=me===Sl||me===bl||me===Ml}if(q){const me=N.texture.type,Ce=me===ni||me===$i||me===tr||me===nr||me===xl||me===yl,We=de.getClearColor(),Ve=de.getClearAlpha(),ct=We.r,ht=We.g,Ze=We.b;Ce?(m[0]=ct,m[1]=ht,m[2]=Ze,m[3]=Ve,z.clearBufferuiv(z.COLOR,0,m)):(_[0]=ct,_[1]=ht,_[2]=Ze,_[3]=Ve,z.clearBufferiv(z.COLOR,0,_))}else ee|=z.COLOR_BUFFER_BIT}X&&(ee|=z.DEPTH_BUFFER_BIT),Z&&(ee|=z.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),z.clear(ee)},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",ze,!1),t.removeEventListener("webglcontextrestored",ve,!1),t.removeEventListener("webglcontextcreationerror",he,!1),de.dispose(),we.dispose(),xe.dispose(),ne.dispose(),Oe.dispose(),T.dispose(),K.dispose(),rt.dispose(),G.dispose(),Q.dispose(),ge.dispose(),ge.removeEventListener("sessionstart",Di),ge.removeEventListener("sessionend",Ni),je.stop()};function ze(C){C.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),U=!0}function ve(){console.log("THREE.WebGLRenderer: Context Restored."),U=!1;const C=ae.autoReset,X=Ie.enabled,Z=Ie.autoUpdate,ee=Ie.needsUpdate,q=Ie.type;De(),ae.autoReset=C,Ie.enabled=X,Ie.autoUpdate=Z,Ie.needsUpdate=ee,Ie.type=q}function he(C){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",C.statusMessage)}function Ge(C){const X=C.target;X.removeEventListener("dispose",Ge),lt(X)}function lt(C){Lt(C),ne.remove(C)}function Lt(C){const X=ne.get(C).programs;X!==void 0&&(X.forEach(function(Z){Q.releaseProgram(Z)}),C.isShaderMaterial&&Q.releaseShaderCache(C))}this.renderBufferDirect=function(C,X,Z,ee,q,me){X===null&&(X=Je);const Ce=q.isMesh&&q.matrixWorld.determinant()<0,We=xn(C,X,Z,ee,q);W.setMaterial(ee,Ce);let Ve=Z.index,ct=1;if(ee.wireframe===!0){if(Ve=k.getWireframeAttribute(Z),Ve===void 0)return;ct=2}const ht=Z.drawRange,Ze=Z.attributes.position;let gt=ht.start*ct,Rt=(ht.start+ht.count)*ct;me!==null&&(gt=Math.max(gt,me.start*ct),Rt=Math.min(Rt,(me.start+me.count)*ct)),Ve!==null?(gt=Math.max(gt,0),Rt=Math.min(Rt,Ve.count)):Ze!=null&&(gt=Math.max(gt,0),Rt=Math.min(Rt,Ze.count));const Ot=Rt-gt;if(Ot<0||Ot===1/0)return;rt.setup(q,ee,We,Z,Ve);let kt,St=qe;if(Ve!==null&&(kt=y.get(Ve),St=ke,St.setIndex(kt)),q.isMesh)ee.wireframe===!0?(W.setLineWidth(ee.wireframeLinewidth*it()),St.setMode(z.LINES)):St.setMode(z.TRIANGLES);else if(q.isLine){let tt=ee.linewidth;tt===void 0&&(tt=1),W.setLineWidth(tt*it()),q.isLineSegments?St.setMode(z.LINES):q.isLineLoop?St.setMode(z.LINE_LOOP):St.setMode(z.LINE_STRIP)}else q.isPoints?St.setMode(z.POINTS):q.isSprite&&St.setMode(z.TRIANGLES);if(q.isBatchedMesh)if(q._multiDrawInstances!==null)ws("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),St.renderMultiDrawInstances(q._multiDrawStarts,q._multiDrawCounts,q._multiDrawCount,q._multiDrawInstances);else if(dt.get("WEBGL_multi_draw"))St.renderMultiDraw(q._multiDrawStarts,q._multiDrawCounts,q._multiDrawCount);else{const tt=q._multiDrawStarts,$t=q._multiDrawCounts,Et=q._multiDrawCount,yn=Ve?y.get(Ve).bytesPerElement:1,zt=ne.get(ee).currentProgram.getUniforms();for(let tn=0;tn<Et;tn++)zt.setValue(z,"_gl_DrawID",tn),St.render(tt[tn]/yn,$t[tn])}else if(q.isInstancedMesh)St.renderInstances(gt,Ot,q.count);else if(Z.isInstancedBufferGeometry){const tt=Z._maxInstanceCount!==void 0?Z._maxInstanceCount:1/0,$t=Math.min(Z.instanceCount,tt);St.renderInstances(gt,Ot,$t)}else St.render(gt,Ot)};function pt(C,X,Z){C.transparent===!0&&C.side===un&&C.forceSinglePass===!1?(C.side=gn,C.needsUpdate=!0,Ye(C,X,Z),C.side=Wn,C.needsUpdate=!0,Ye(C,X,Z),C.side=un):Ye(C,X,Z)}this.compile=function(C,X,Z=null){Z===null&&(Z=C),p=xe.get(Z),p.init(X),E.push(p),Z.traverseVisible(function(q){q.isLight&&q.layers.test(X.layers)&&(p.pushLight(q),q.castShadow&&p.pushShadow(q))}),C!==Z&&C.traverseVisible(function(q){q.isLight&&q.layers.test(X.layers)&&(p.pushLight(q),q.castShadow&&p.pushShadow(q))}),p.setupLights();const ee=new Set;return C.traverse(function(q){if(!(q.isMesh||q.isPoints||q.isLine||q.isSprite))return;const me=q.material;if(me)if(Array.isArray(me))for(let Ce=0;Ce<me.length;Ce++){const We=me[Ce];pt(We,Z,q),ee.add(We)}else pt(me,Z,q),ee.add(me)}),p=E.pop(),ee},this.compileAsync=function(C,X,Z=null){const ee=this.compile(C,X,Z);return new Promise(q=>{function me(){if(ee.forEach(function(Ce){ne.get(Ce).currentProgram.isReady()&&ee.delete(Ce)}),ee.size===0){q(C);return}setTimeout(me,10)}dt.get("KHR_parallel_shader_compile")!==null?me():setTimeout(me,10)})};let en=null;function vn(C){en&&en(C)}function Di(){je.stop()}function Ni(){je.start()}const je=new Su;je.setAnimationLoop(vn),typeof self<"u"&&je.setContext(self),this.setAnimationLoop=function(C){en=C,ge.setAnimationLoop(C),C===null?je.stop():je.start()},ge.addEventListener("sessionstart",Di),ge.addEventListener("sessionend",Ni),this.render=function(C,X){if(X!==void 0&&X.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(U===!0)return;if(C.matrixWorldAutoUpdate===!0&&C.updateMatrixWorld(),X.parent===null&&X.matrixWorldAutoUpdate===!0&&X.updateMatrixWorld(),ge.enabled===!0&&ge.isPresenting===!0&&(ge.cameraAutoUpdate===!0&&ge.updateCamera(X),X=ge.getCamera()),C.isScene===!0&&C.onBeforeRender(S,C,X,N),p=xe.get(C,E.length),p.init(X),E.push(p),Ee.multiplyMatrices(X.projectionMatrix,X.matrixWorldInverse),$.setFromProjectionMatrix(Ee),re=this.localClippingEnabled,se=Se.init(this.clippingPlanes,re),g=we.get(C,w.length),g.init(),w.push(g),ge.enabled===!0&&ge.isPresenting===!0){const me=S.xr.getDepthSensingMesh();me!==null&&qt(me,X,-1/0,S.sortObjects)}qt(C,X,0,S.sortObjects),g.finish(),S.sortObjects===!0&&g.sort(ue,pe),at=ge.enabled===!1||ge.isPresenting===!1||ge.hasDepthSensing()===!1,at&&de.addToRenderList(g,C),this.info.render.frame++,se===!0&&Se.beginShadows();const Z=p.state.shadowsArray;Ie.render(Z,C,X),se===!0&&Se.endShadows(),this.info.autoReset===!0&&this.info.reset();const ee=g.opaque,q=g.transmissive;if(p.setupLights(),X.isArrayCamera){const me=X.cameras;if(q.length>0)for(let Ce=0,We=me.length;Ce<We;Ce++){const Ve=me[Ce];wn(ee,q,C,Ve)}at&&de.render(C);for(let Ce=0,We=me.length;Ce<We;Ce++){const Ve=me[Ce];jt(g,C,Ve,Ve.viewport)}}else q.length>0&&wn(ee,q,C,X),at&&de.render(C),jt(g,C,X);N!==null&&D===0&&(ye.updateMultisampleRenderTarget(N),ye.updateRenderTargetMipmap(N)),C.isScene===!0&&C.onAfterRender(S,C,X),rt.resetDefaultState(),b=-1,M=null,E.pop(),E.length>0?(p=E[E.length-1],se===!0&&Se.setGlobalState(S.clippingPlanes,p.state.camera)):p=null,w.pop(),w.length>0?g=w[w.length-1]:g=null};function qt(C,X,Z,ee){if(C.visible===!1)return;if(C.layers.test(X.layers)){if(C.isGroup)Z=C.renderOrder;else if(C.isLOD)C.autoUpdate===!0&&C.update(X);else if(C.isLight)p.pushLight(C),C.castShadow&&p.pushShadow(C);else if(C.isSprite){if(!C.frustumCulled||$.intersectsSprite(C)){ee&&be.setFromMatrixPosition(C.matrixWorld).applyMatrix4(Ee);const Ce=K.update(C),We=C.material;We.visible&&g.push(C,Ce,We,Z,be.z,null)}}else if((C.isMesh||C.isLine||C.isPoints)&&(!C.frustumCulled||$.intersectsObject(C))){const Ce=K.update(C),We=C.material;if(ee&&(C.boundingSphere!==void 0?(C.boundingSphere===null&&C.computeBoundingSphere(),be.copy(C.boundingSphere.center)):(Ce.boundingSphere===null&&Ce.computeBoundingSphere(),be.copy(Ce.boundingSphere.center)),be.applyMatrix4(C.matrixWorld).applyMatrix4(Ee)),Array.isArray(We)){const Ve=Ce.groups;for(let ct=0,ht=Ve.length;ct<ht;ct++){const Ze=Ve[ct],gt=We[Ze.materialIndex];gt&>.visible&&g.push(C,Ce,gt,Z,be.z,Ze)}}else We.visible&&g.push(C,Ce,We,Z,be.z,null)}}const me=C.children;for(let Ce=0,We=me.length;Ce<We;Ce++)qt(me[Ce],X,Z,ee)}function jt(C,X,Z,ee){const q=C.opaque,me=C.transmissive,Ce=C.transparent;p.setupLightsView(Z),se===!0&&Se.setGlobalState(S.clippingPlanes,Z),ee&&W.viewport(I.copy(ee)),q.length>0&&vi(q,X,Z),me.length>0&&vi(me,X,Z),Ce.length>0&&vi(Ce,X,Z),W.buffers.depth.setTest(!0),W.buffers.depth.setMask(!0),W.buffers.color.setMask(!0),W.setPolygonOffset(!1)}function wn(C,X,Z,ee){if((Z.isScene===!0?Z.overrideMaterial:null)!==null)return;p.state.transmissionRenderTarget[ee.id]===void 0&&(p.state.transmissionRenderTarget[ee.id]=new Ji(1,1,{generateMipmaps:!0,type:dt.has("EXT_color_buffer_half_float")||dt.has("EXT_color_buffer_float")?or:ni,minFilter:di,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Mt.workingColorSpace}));const me=p.state.transmissionRenderTarget[ee.id],Ce=ee.viewport||I;me.setSize(Ce.z*S.transmissionResolutionScale,Ce.w*S.transmissionResolutionScale);const We=S.getRenderTarget();S.setRenderTarget(me),S.getClearColor(J),ie=S.getClearAlpha(),ie<1&&S.setClearColor(16777215,.5),S.clear(),at&&de.render(Z);const Ve=S.toneMapping;S.toneMapping=Ri;const ct=ee.viewport;if(ee.viewport!==void 0&&(ee.viewport=void 0),p.setupLightsView(ee),se===!0&&Se.setGlobalState(S.clippingPlanes,ee),vi(C,Z,ee),ye.updateMultisampleRenderTarget(me),ye.updateRenderTargetMipmap(me),dt.has("WEBGL_multisampled_render_to_texture")===!1){let ht=!1;for(let Ze=0,gt=X.length;Ze<gt;Ze++){const Rt=X[Ze],Ot=Rt.object,kt=Rt.geometry,St=Rt.material,tt=Rt.group;if(St.side===un&&Ot.layers.test(ee.layers)){const $t=St.side;St.side=gn,St.needsUpdate=!0,Yn(Ot,Z,ee,kt,St,tt),St.side=$t,St.needsUpdate=!0,ht=!0}}ht===!0&&(ye.updateMultisampleRenderTarget(me),ye.updateRenderTargetMipmap(me))}S.setRenderTarget(We),S.setClearColor(J,ie),ct!==void 0&&(ee.viewport=ct),S.toneMapping=Ve}function vi(C,X,Z){const ee=X.isScene===!0?X.overrideMaterial:null;for(let q=0,me=C.length;q<me;q++){const Ce=C[q],We=Ce.object,Ve=Ce.geometry,ct=Ce.group;let ht=Ce.material;ht.allowOverride===!0&&ee!==null&&(ht=ee),We.layers.test(Z.layers)&&Yn(We,X,Z,Ve,ht,ct)}}function Yn(C,X,Z,ee,q,me){C.onBeforeRender(S,X,Z,ee,q,me),C.modelViewMatrix.multiplyMatrices(Z.matrixWorldInverse,C.matrixWorld),C.normalMatrix.getNormalMatrix(C.modelViewMatrix),q.onBeforeRender(S,X,Z,ee,C,me),q.transparent===!0&&q.side===un&&q.forceSinglePass===!1?(q.side=gn,q.needsUpdate=!0,S.renderBufferDirect(Z,X,ee,q,C,me),q.side=Wn,q.needsUpdate=!0,S.renderBufferDirect(Z,X,ee,q,C,me),q.side=un):S.renderBufferDirect(Z,X,ee,q,C,me),C.onAfterRender(S,X,Z,ee,q,me)}function Ye(C,X,Z){X.isScene!==!0&&(X=Je);const ee=ne.get(C),q=p.state.lights,me=p.state.shadowsArray,Ce=q.state.version,We=Q.getParameters(C,q.state,me,X,Z),Ve=Q.getProgramCacheKey(We);let ct=ee.programs;ee.environment=C.isMeshStandardMaterial?X.environment:null,ee.fog=X.fog,ee.envMap=(C.isMeshStandardMaterial?T:Oe).get(C.envMap||ee.environment),ee.envMapRotation=ee.environment!==null&&C.envMap===null?X.environmentRotation:C.envMapRotation,ct===void 0&&(C.addEventListener("dispose",Ge),ct=new Map,ee.programs=ct);let ht=ct.get(Ve);if(ht!==void 0){if(ee.currentProgram===ht&&ee.lightsStateVersion===Ce)return Gt(C,We),ht}else We.uniforms=Q.getUniforms(C),C.onBeforeCompile(We,S),ht=Q.acquireProgram(We,Ve),ct.set(Ve,ht),ee.uniforms=We.uniforms;const Ze=ee.uniforms;return(!C.isShaderMaterial&&!C.isRawShaderMaterial||C.clipping===!0)&&(Ze.clippingPlanes=Se.uniform),Gt(C,We),ee.needsLights=dn(C),ee.lightsStateVersion=Ce,ee.needsLights&&(Ze.ambientLightColor.value=q.state.ambient,Ze.lightProbe.value=q.state.probe,Ze.directionalLights.value=q.state.directional,Ze.directionalLightShadows.value=q.state.directionalShadow,Ze.spotLights.value=q.state.spot,Ze.spotLightShadows.value=q.state.spotShadow,Ze.rectAreaLights.value=q.state.rectArea,Ze.ltc_1.value=q.state.rectAreaLTC1,Ze.ltc_2.value=q.state.rectAreaLTC2,Ze.pointLights.value=q.state.point,Ze.pointLightShadows.value=q.state.pointShadow,Ze.hemisphereLights.value=q.state.hemi,Ze.directionalShadowMap.value=q.state.directionalShadowMap,Ze.directionalShadowMatrix.value=q.state.directionalShadowMatrix,Ze.spotShadowMap.value=q.state.spotShadowMap,Ze.spotLightMatrix.value=q.state.spotLightMatrix,Ze.spotLightMap.value=q.state.spotLightMap,Ze.pointShadowMap.value=q.state.pointShadowMap,Ze.pointShadowMatrix.value=q.state.pointShadowMatrix),ee.currentProgram=ht,ee.uniformsList=null,ht}function Te(C){if(C.uniformsList===null){const X=C.currentProgram.getUniforms();C.uniformsList=ra.seqWithValue(X.seq,C.uniforms)}return C.uniformsList}function Gt(C,X){const Z=ne.get(C);Z.outputColorSpace=X.outputColorSpace,Z.batching=X.batching,Z.batchingColor=X.batchingColor,Z.instancing=X.instancing,Z.instancingColor=X.instancingColor,Z.instancingMorph=X.instancingMorph,Z.skinning=X.skinning,Z.morphTargets=X.morphTargets,Z.morphNormals=X.morphNormals,Z.morphColors=X.morphColors,Z.morphTargetsCount=X.morphTargetsCount,Z.numClippingPlanes=X.numClippingPlanes,Z.numIntersection=X.numClipIntersection,Z.vertexAlphas=X.vertexAlphas,Z.vertexTangents=X.vertexTangents,Z.toneMapping=X.toneMapping}function xn(C,X,Z,ee,q){X.isScene!==!0&&(X=Je),ye.resetTextureUnits();const me=X.fog,Ce=ee.isMeshStandardMaterial?X.environment:null,We=N===null?S.outputColorSpace:N.isXRRenderTarget===!0?N.texture.colorSpace:Ls,Ve=(ee.isMeshStandardMaterial?T:Oe).get(ee.envMap||Ce),ct=ee.vertexColors===!0&&!!Z.attributes.color&&Z.attributes.color.itemSize===4,ht=!!Z.attributes.tangent&&(!!ee.normalMap||ee.anisotropy>0),Ze=!!Z.morphAttributes.position,gt=!!Z.morphAttributes.normal,Rt=!!Z.morphAttributes.color;let Ot=Ri;ee.toneMapped&&(N===null||N.isXRRenderTarget===!0)&&(Ot=S.toneMapping);const kt=Z.morphAttributes.position||Z.morphAttributes.normal||Z.morphAttributes.color,St=kt!==void 0?kt.length:0,tt=ne.get(ee),$t=p.state.lights;if(se===!0&&(re===!0||C!==M)){const Wt=C===M&&ee.id===b;Se.setState(ee,C,Wt)}let Et=!1;ee.version===tt.__version?(tt.needsLights&&tt.lightsStateVersion!==$t.state.version||tt.outputColorSpace!==We||q.isBatchedMesh&&tt.batching===!1||!q.isBatchedMesh&&tt.batching===!0||q.isBatchedMesh&&tt.batchingColor===!0&&q.colorTexture===null||q.isBatchedMesh&&tt.batchingColor===!1&&q.colorTexture!==null||q.isInstancedMesh&&tt.instancing===!1||!q.isInstancedMesh&&tt.instancing===!0||q.isSkinnedMesh&&tt.skinning===!1||!q.isSkinnedMesh&&tt.skinning===!0||q.isInstancedMesh&&tt.instancingColor===!0&&q.instanceColor===null||q.isInstancedMesh&&tt.instancingColor===!1&&q.instanceColor!==null||q.isInstancedMesh&&tt.instancingMorph===!0&&q.morphTexture===null||q.isInstancedMesh&&tt.instancingMorph===!1&&q.morphTexture!==null||tt.envMap!==Ve||ee.fog===!0&&tt.fog!==me||tt.numClippingPlanes!==void 0&&(tt.numClippingPlanes!==Se.numPlanes||tt.numIntersection!==Se.numIntersection)||tt.vertexAlphas!==ct||tt.vertexTangents!==ht||tt.morphTargets!==Ze||tt.morphNormals!==gt||tt.morphColors!==Rt||tt.toneMapping!==Ot||tt.morphTargetsCount!==St)&&(Et=!0):(Et=!0,tt.__version=ee.version);let yn=tt.currentProgram;Et===!0&&(yn=Ye(ee,X,q));let zt=!1,tn=!1,Ui=!1;const Ft=yn.getUniforms(),fn=tt.uniforms;if(W.useProgram(yn.program)&&(zt=!0,tn=!0,Ui=!0),ee.id!==b&&(b=ee.id,tn=!0),zt||M!==C){W.buffers.depth.getReversed()?(le.copy(C.projectionMatrix),af(le),of(le),Ft.setValue(z,"projectionMatrix",le)):Ft.setValue(z,"projectionMatrix",C.projectionMatrix),Ft.setValue(z,"viewMatrix",C.matrixWorldInverse);const Jt=Ft.map.cameraPosition;Jt!==void 0&&Jt.setValue(z,fe.setFromMatrixPosition(C.matrixWorld)),ot.logarithmicDepthBuffer&&Ft.setValue(z,"logDepthBufFC",2/(Math.log(C.far+1)/Math.LN2)),(ee.isMeshPhongMaterial||ee.isMeshToonMaterial||ee.isMeshLambertMaterial||ee.isMeshBasicMaterial||ee.isMeshStandardMaterial||ee.isShaderMaterial)&&Ft.setValue(z,"isOrthographic",C.isOrthographicCamera===!0),M!==C&&(M=C,tn=!0,Ui=!0)}if(q.isSkinnedMesh){Ft.setOptional(z,q,"bindMatrix"),Ft.setOptional(z,q,"bindMatrixInverse");const Wt=q.skeleton;Wt&&(Wt.boneTexture===null&&Wt.computeBoneTexture(),Ft.setValue(z,"boneTexture",Wt.boneTexture,ye))}q.isBatchedMesh&&(Ft.setOptional(z,q,"batchingTexture"),Ft.setValue(z,"batchingTexture",q._matricesTexture,ye),Ft.setOptional(z,q,"batchingIdTexture"),Ft.setValue(z,"batchingIdTexture",q._indirectTexture,ye),Ft.setOptional(z,q,"batchingColorTexture"),q._colorsTexture!==null&&Ft.setValue(z,"batchingColorTexture",q._colorsTexture,ye));const ln=Z.morphAttributes;if((ln.position!==void 0||ln.normal!==void 0||ln.color!==void 0)&&Pe.update(q,Z,yn),(tn||tt.receiveShadow!==q.receiveShadow)&&(tt.receiveShadow=q.receiveShadow,Ft.setValue(z,"receiveShadow",q.receiveShadow)),ee.isMeshGouraudMaterial&&ee.envMap!==null&&(fn.envMap.value=Ve,fn.flipEnvMap.value=Ve.isCubeTexture&&Ve.isRenderTargetTexture===!1?-1:1),ee.isMeshStandardMaterial&&ee.envMap===null&&X.environment!==null&&(fn.envMapIntensity.value=X.environmentIntensity),tn&&(Ft.setValue(z,"toneMappingExposure",S.toneMappingExposure),tt.needsLights&&Yt(fn,Ui),me&&ee.fog===!0&&O.refreshFogUniforms(fn,me),O.refreshMaterialUniforms(fn,ee,j,oe,p.state.transmissionRenderTarget[C.id]),ra.upload(z,Te(tt),fn,ye)),ee.isShaderMaterial&&ee.uniformsNeedUpdate===!0&&(ra.upload(z,Te(tt),fn,ye),ee.uniformsNeedUpdate=!1),ee.isSpriteMaterial&&Ft.setValue(z,"center",q.center),Ft.setValue(z,"modelViewMatrix",q.modelViewMatrix),Ft.setValue(z,"normalMatrix",q.normalMatrix),Ft.setValue(z,"modelMatrix",q.matrixWorld),ee.isShaderMaterial||ee.isRawShaderMaterial){const Wt=ee.uniformsGroups;for(let Jt=0,ts=Wt.length;Jt<ts;Jt++){const ii=Wt[Jt];G.update(ii,yn),G.bind(ii,yn)}}return yn}function Yt(C,X){C.ambientLightColor.needsUpdate=X,C.lightProbe.needsUpdate=X,C.directionalLights.needsUpdate=X,C.directionalLightShadows.needsUpdate=X,C.pointLights.needsUpdate=X,C.pointLightShadows.needsUpdate=X,C.spotLights.needsUpdate=X,C.spotLightShadows.needsUpdate=X,C.rectAreaLights.needsUpdate=X,C.hemisphereLights.needsUpdate=X}function dn(C){return C.isMeshLambertMaterial||C.isMeshToonMaterial||C.isMeshPhongMaterial||C.isMeshStandardMaterial||C.isShadowMaterial||C.isShaderMaterial&&C.lights===!0}this.getActiveCubeFace=function(){return L},this.getActiveMipmapLevel=function(){return D},this.getRenderTarget=function(){return N},this.setRenderTargetTextures=function(C,X,Z){const ee=ne.get(C);ee.__autoAllocateDepthBuffer=C.resolveDepthBuffer===!1,ee.__autoAllocateDepthBuffer===!1&&(ee.__useRenderToTexture=!1),ne.get(C.texture).__webglTexture=X,ne.get(C.depthTexture).__webglTexture=ee.__autoAllocateDepthBuffer?void 0:Z,ee.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(C,X){const Z=ne.get(C);Z.__webglFramebuffer=X,Z.__useDefaultFramebuffer=X===void 0};const An=z.createFramebuffer();this.setRenderTarget=function(C,X=0,Z=0){N=C,L=X,D=Z;let ee=!0,q=null,me=!1,Ce=!1;if(C){const Ve=ne.get(C);if(Ve.__useDefaultFramebuffer!==void 0)W.bindFramebuffer(z.FRAMEBUFFER,null),ee=!1;else if(Ve.__webglFramebuffer===void 0)ye.setupRenderTarget(C);else if(Ve.__hasExternalTextures)ye.rebindTextures(C,ne.get(C.texture).__webglTexture,ne.get(C.depthTexture).__webglTexture);else if(C.depthBuffer){const Ze=C.depthTexture;if(Ve.__boundDepthTexture!==Ze){if(Ze!==null&&ne.has(Ze)&&(C.width!==Ze.image.width||C.height!==Ze.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");ye.setupDepthRenderbuffer(C)}}const ct=C.texture;(ct.isData3DTexture||ct.isDataArrayTexture||ct.isCompressedArrayTexture)&&(Ce=!0);const ht=ne.get(C).__webglFramebuffer;C.isWebGLCubeRenderTarget?(Array.isArray(ht[X])?q=ht[X][Z]:q=ht[X],me=!0):C.samples>0&&ye.useMultisampledRTT(C)===!1?q=ne.get(C).__webglMultisampledFramebuffer:Array.isArray(ht)?q=ht[Z]:q=ht,I.copy(C.viewport),V.copy(C.scissor),H=C.scissorTest}else I.copy(Me).multiplyScalar(j).floor(),V.copy(Ue).multiplyScalar(j).floor(),H=Ne;if(Z!==0&&(q=An),W.bindFramebuffer(z.FRAMEBUFFER,q)&&ee&&W.drawBuffers(C,q),W.viewport(I),W.scissor(V),W.setScissorTest(H),me){const Ve=ne.get(C.texture);z.framebufferTexture2D(z.FRAMEBUFFER,z.COLOR_ATTACHMENT0,z.TEXTURE_CUBE_MAP_POSITIVE_X+X,Ve.__webglTexture,Z)}else if(Ce){const Ve=ne.get(C.texture),ct=X;z.framebufferTextureLayer(z.FRAMEBUFFER,z.COLOR_ATTACHMENT0,Ve.__webglTexture,Z,ct)}else if(C!==null&&Z!==0){const Ve=ne.get(C.texture);z.framebufferTexture2D(z.FRAMEBUFFER,z.COLOR_ATTACHMENT0,z.TEXTURE_2D,Ve.__webglTexture,Z)}b=-1},this.readRenderTargetPixels=function(C,X,Z,ee,q,me,Ce,We=0){if(!(C&&C.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Ve=ne.get(C).__webglFramebuffer;if(C.isWebGLCubeRenderTarget&&Ce!==void 0&&(Ve=Ve[Ce]),Ve){W.bindFramebuffer(z.FRAMEBUFFER,Ve);try{const ct=C.textures[We],ht=ct.format,Ze=ct.type;if(!ot.textureFormatReadable(ht)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!ot.textureTypeReadable(Ze)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}X>=0&&X<=C.width-ee&&Z>=0&&Z<=C.height-q&&(C.textures.length>1&&z.readBuffer(z.COLOR_ATTACHMENT0+We),z.readPixels(X,Z,ee,q,Ae.convert(ht),Ae.convert(Ze),me))}finally{const ct=N!==null?ne.get(N).__webglFramebuffer:null;W.bindFramebuffer(z.FRAMEBUFFER,ct)}}},this.readRenderTargetPixelsAsync=async function(C,X,Z,ee,q,me,Ce,We=0){if(!(C&&C.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Ve=ne.get(C).__webglFramebuffer;if(C.isWebGLCubeRenderTarget&&Ce!==void 0&&(Ve=Ve[Ce]),Ve)if(X>=0&&X<=C.width-ee&&Z>=0&&Z<=C.height-q){W.bindFramebuffer(z.FRAMEBUFFER,Ve);const ct=C.textures[We],ht=ct.format,Ze=ct.type;if(!ot.textureFormatReadable(ht))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!ot.textureTypeReadable(Ze))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const gt=z.createBuffer();z.bindBuffer(z.PIXEL_PACK_BUFFER,gt),z.bufferData(z.PIXEL_PACK_BUFFER,me.byteLength,z.STREAM_READ),C.textures.length>1&&z.readBuffer(z.COLOR_ATTACHMENT0+We),z.readPixels(X,Z,ee,q,Ae.convert(ht),Ae.convert(Ze),0);const Rt=N!==null?ne.get(N).__webglFramebuffer:null;W.bindFramebuffer(z.FRAMEBUFFER,Rt);const Ot=z.fenceSync(z.SYNC_GPU_COMMANDS_COMPLETE,0);return z.flush(),await rf(z,Ot,4),z.bindBuffer(z.PIXEL_PACK_BUFFER,gt),z.getBufferSubData(z.PIXEL_PACK_BUFFER,0,me),z.deleteBuffer(gt),z.deleteSync(Ot),me}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(C,X=null,Z=0){const ee=Math.pow(2,-Z),q=Math.floor(C.image.width*ee),me=Math.floor(C.image.height*ee),Ce=X!==null?X.x:0,We=X!==null?X.y:0;ye.setTexture2D(C,0),z.copyTexSubImage2D(z.TEXTURE_2D,Z,0,0,Ce,We,q,me),W.unbindTexture()};const Qi=z.createFramebuffer(),es=z.createFramebuffer();this.copyTextureToTexture=function(C,X,Z=null,ee=null,q=0,me=null){me===null&&(q!==0?(ws("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),me=q,q=0):me=0);let Ce,We,Ve,ct,ht,Ze,gt,Rt,Ot;const kt=C.isCompressedTexture?C.mipmaps[me]:C.image;if(Z!==null)Ce=Z.max.x-Z.min.x,We=Z.max.y-Z.min.y,Ve=Z.isBox3?Z.max.z-Z.min.z:1,ct=Z.min.x,ht=Z.min.y,Ze=Z.isBox3?Z.min.z:0;else{const ln=Math.pow(2,-q);Ce=Math.floor(kt.width*ln),We=Math.floor(kt.height*ln),C.isDataArrayTexture?Ve=kt.depth:C.isData3DTexture?Ve=Math.floor(kt.depth*ln):Ve=1,ct=0,ht=0,Ze=0}ee!==null?(gt=ee.x,Rt=ee.y,Ot=ee.z):(gt=0,Rt=0,Ot=0);const St=Ae.convert(X.format),tt=Ae.convert(X.type);let $t;X.isData3DTexture?(ye.setTexture3D(X,0),$t=z.TEXTURE_3D):X.isDataArrayTexture||X.isCompressedArrayTexture?(ye.setTexture2DArray(X,0),$t=z.TEXTURE_2D_ARRAY):(ye.setTexture2D(X,0),$t=z.TEXTURE_2D),z.pixelStorei(z.UNPACK_FLIP_Y_WEBGL,X.flipY),z.pixelStorei(z.UNPACK_PREMULTIPLY_ALPHA_WEBGL,X.premultiplyAlpha),z.pixelStorei(z.UNPACK_ALIGNMENT,X.unpackAlignment);const Et=z.getParameter(z.UNPACK_ROW_LENGTH),yn=z.getParameter(z.UNPACK_IMAGE_HEIGHT),zt=z.getParameter(z.UNPACK_SKIP_PIXELS),tn=z.getParameter(z.UNPACK_SKIP_ROWS),Ui=z.getParameter(z.UNPACK_SKIP_IMAGES);z.pixelStorei(z.UNPACK_ROW_LENGTH,kt.width),z.pixelStorei(z.UNPACK_IMAGE_HEIGHT,kt.height),z.pixelStorei(z.UNPACK_SKIP_PIXELS,ct),z.pixelStorei(z.UNPACK_SKIP_ROWS,ht),z.pixelStorei(z.UNPACK_SKIP_IMAGES,Ze);const Ft=C.isDataArrayTexture||C.isData3DTexture,fn=X.isDataArrayTexture||X.isData3DTexture;if(C.isDepthTexture){const ln=ne.get(C),Wt=ne.get(X),Jt=ne.get(ln.__renderTarget),ts=ne.get(Wt.__renderTarget);W.bindFramebuffer(z.READ_FRAMEBUFFER,Jt.__webglFramebuffer),W.bindFramebuffer(z.DRAW_FRAMEBUFFER,ts.__webglFramebuffer);for(let ii=0;ii<Ve;ii++)Ft&&(z.framebufferTextureLayer(z.READ_FRAMEBUFFER,z.COLOR_ATTACHMENT0,ne.get(C).__webglTexture,q,Ze+ii),z.framebufferTextureLayer(z.DRAW_FRAMEBUFFER,z.COLOR_ATTACHMENT0,ne.get(X).__webglTexture,me,Ot+ii)),z.blitFramebuffer(ct,ht,Ce,We,gt,Rt,Ce,We,z.DEPTH_BUFFER_BIT,z.NEAREST);W.bindFramebuffer(z.READ_FRAMEBUFFER,null),W.bindFramebuffer(z.DRAW_FRAMEBUFFER,null)}else if(q!==0||C.isRenderTargetTexture||ne.has(C)){const ln=ne.get(C),Wt=ne.get(X);W.bindFramebuffer(z.READ_FRAMEBUFFER,Qi),W.bindFramebuffer(z.DRAW_FRAMEBUFFER,es);for(let Jt=0;Jt<Ve;Jt++)Ft?z.framebufferTextureLayer(z.READ_FRAMEBUFFER,z.COLOR_ATTACHMENT0,ln.__webglTexture,q,Ze+Jt):z.framebufferTexture2D(z.READ_FRAMEBUFFER,z.COLOR_ATTACHMENT0,z.TEXTURE_2D,ln.__webglTexture,q),fn?z.framebufferTextureLayer(z.DRAW_FRAMEBUFFER,z.COLOR_ATTACHMENT0,Wt.__webglTexture,me,Ot+Jt):z.framebufferTexture2D(z.DRAW_FRAMEBUFFER,z.COLOR_ATTACHMENT0,z.TEXTURE_2D,Wt.__webglTexture,me),q!==0?z.blitFramebuffer(ct,ht,Ce,We,gt,Rt,Ce,We,z.COLOR_BUFFER_BIT,z.NEAREST):fn?z.copyTexSubImage3D($t,me,gt,Rt,Ot+Jt,ct,ht,Ce,We):z.copyTexSubImage2D($t,me,gt,Rt,ct,ht,Ce,We);W.bindFramebuffer(z.READ_FRAMEBUFFER,null),W.bindFramebuffer(z.DRAW_FRAMEBUFFER,null)}else fn?C.isDataTexture||C.isData3DTexture?z.texSubImage3D($t,me,gt,Rt,Ot,Ce,We,Ve,St,tt,kt.data):X.isCompressedArrayTexture?z.compressedTexSubImage3D($t,me,gt,Rt,Ot,Ce,We,Ve,St,kt.data):z.texSubImage3D($t,me,gt,Rt,Ot,Ce,We,Ve,St,tt,kt):C.isDataTexture?z.texSubImage2D(z.TEXTURE_2D,me,gt,Rt,Ce,We,St,tt,kt.data):C.isCompressedTexture?z.compressedTexSubImage2D(z.TEXTURE_2D,me,gt,Rt,kt.width,kt.height,St,kt.data):z.texSubImage2D(z.TEXTURE_2D,me,gt,Rt,Ce,We,St,tt,kt);z.pixelStorei(z.UNPACK_ROW_LENGTH,Et),z.pixelStorei(z.UNPACK_IMAGE_HEIGHT,yn),z.pixelStorei(z.UNPACK_SKIP_PIXELS,zt),z.pixelStorei(z.UNPACK_SKIP_ROWS,tn),z.pixelStorei(z.UNPACK_SKIP_IMAGES,Ui),me===0&&X.generateMipmaps&&z.generateMipmap($t),W.unbindTexture()},this.copyTextureToTexture3D=function(C,X,Z=null,ee=null,q=0){return ws('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(C,X,Z,ee,q)},this.initRenderTarget=function(C){ne.get(C).__webglFramebuffer===void 0&&ye.setupRenderTarget(C)},this.initTexture=function(C){C.isCubeTexture?ye.setTextureCube(C,0):C.isData3DTexture?ye.setTexture3D(C,0):C.isDataArrayTexture||C.isCompressedArrayTexture?ye.setTexture2DArray(C,0):ye.setTexture2D(C,0),W.unbindTexture()},this.resetState=function(){L=0,D=0,N=null,W.reset(),rt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return fi}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=Mt._getDrawingBufferColorSpace(e),t.unpackColorSpace=Mt._getUnpackColorSpace()}}var fg=Object.defineProperty,pg=(s,e,t)=>e in s?fg(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,Pt=(s,e,t)=>pg(s,typeof e!="symbol"?e+"":e,t);const Cu=(s,e)=>{const[t,n]=e.split("-");return Object.assign(s.style,{left:n==="left"?"0":n==="center"?"50%":"",right:n==="right"?"0":"",top:t==="top"?"0":t==="bottom"?"":"50%",bottom:t==="bottom"?"0":"",transform:`${n==="center"?"translateX(-50%)":""} ${t==="center"?"translateY(-50%)":""}`}),e},mg=({placement:s,size:e,offset:t,id:n,className:i})=>{const r=document.createElement("div"),{top:a,left:o,right:l,bottom:c}=t;return Object.assign(r.style,{id:n,position:"absolute",zIndex:"1000",height:`${e}px`,width:`${e}px`,margin:`${a}px ${l}px ${c}px ${o}px`,borderRadius:"100%"}),Cu(r,s),n&&(r.id=n),i&&(r.className=i),r},gg=s=>{const e=typeof s=="string"?document.querySelector(s):s;if(!e)throw Error("Invalid DOM element");return e};function hl(s,e,t){return Math.max(e,Math.min(t,s))}const _g=[["x",0,3],["y",1,4],["z",2,5]],gh=new F;function _h({isSphere:s},e,t){s&&(gh.set(0,0,1).applyQuaternion(t.quaternion),_g.forEach(([n,i,r])=>{const a=gh[n];let o=e[i],l=o.userData.opacity;o.material.opacity=hl(a>=0?l:l/2,0,1),o=e[r],l=o.userData.opacity,o.material.opacity=hl(a>=0?l/2:l,0,1)}))}const vg=(s,e,t=10)=>Math.abs(s.clientX-e.x)<t&&Math.abs(s.clientY-e.y)<t,vh=new Ap,xh=new Be,yh=(s,e,t,n)=>{xh.set((s.clientX-e.left)/e.width*2-1,-((s.clientY-e.top)/e.height)*2+1),vh.setFromCamera(xh,t);const i=vh.intersectObjects(n,!1),r=i.length?i[0]:null;return!r||!r.object.visible?null:r},uo=1e-6,xg=2*Math.PI,Ru=["x","y","z"],ar=[...Ru,"nx","ny","nz"],yg=["x","z","y","nx","nz","ny"],Mg=["z","x","y","nz","nx","ny"],ul="Right",aa="Top",dl="Front",fl="Left",oa="Bottom",pl="Back",bg=[ul,aa,dl,fl,oa,pl].map(s=>s.toLocaleLowerCase()),Lu=1.3,Mh=(s,e=!0)=>{const{material:t,userData:n}=s,{color:i,opacity:r}=e?n.hover:n;t.color.set(i),t.opacity=r},Vi=s=>JSON.parse(JSON.stringify(s)),Sg=s=>{const e=s.type||"sphere",t=e==="sphere",n=s.resolution||t?64:128,i=It.DEFAULT_UP,r=i.z===1,a=i.x===1,{container:o}=s;s.container=void 0,s=JSON.parse(JSON.stringify(s)),s.container=o;const l=r?yg:a?Mg:ar;bg.forEach((u,f)=>{s[u]&&(s[l[f]]=s[u])});const c={enabled:!0,color:16777215,opacity:1,scale:.7,labelColor:2236962,line:!1,border:{size:0,color:14540253},hover:{color:t?16777215:9688043,labelColor:2236962,opacity:1,scale:.7,border:{size:0,color:14540253}}},h={line:!1,scale:t?.45:.7,hover:{scale:t?.5:.7}},d={type:e,container:document.body,size:128,placement:"top-right",resolution:n,lineWidth:4,radius:t?1:.2,smoothness:18,animated:!0,speed:1,background:{enabled:!0,color:t?16777215:14739180,opacity:t?0:1,hover:{color:t?16777215:14739180,opacity:t?.2:1}},font:{family:"sans-serif",weight:900},offset:{top:10,left:10,bottom:10,right:10},corners:{enabled:!t,color:t?15915362:16777215,opacity:1,scale:t?.15:.2,radius:1,smoothness:18,hover:{color:t?16777215:9688043,opacity:1,scale:t?.2:.225}},edges:{enabled:!t,color:t?15915362:16777215,opacity:t?1:0,radius:t?1:.125,smoothness:18,scale:t?.15:1,hover:{color:t?16777215:9688043,opacity:1,scale:t?.2:1}},x:{...Vi(c),...t?{label:"X",color:16725587,line:!0}:{label:a?aa:ul}},y:{...Vi(c),...t?{label:"Y",color:9100032,line:!0}:{label:r||a?dl:aa}},z:{...Vi(c),...t?{label:"Z",color:2920447,line:!0}:{label:r?aa:a?ul:dl}},nx:{...Vi(h),label:t?"":a?oa:fl},ny:{...Vi(h),label:t?"":r||a?pl:oa},nz:{...Vi(h),label:t?"":r?oa:a?fl:pl}};return ml(s,d),Ru.forEach(u=>ml(s[`n${u}`],Vi(s[u]))),{...s,isSphere:t}};function ml(s,...e){if(s instanceof HTMLElement||typeof s!="object"||s===null)return s;for(const t of e)for(const n in t)n!=="container"&&n in t&&(s[n]===void 0?s[n]=t[n]:typeof t[n]=="object"&&!Array.isArray(t[n])&&(s[n]=ml(s[n]||{},t[n])));return s}const Eg=(s,e=2)=>{const t=new et,n=e*2,{isSphere:i,resolution:r,radius:a,font:o,corners:l,edges:c}=s,h=ar.map(D=>({...s[D],radius:a}));i&&l.enabled&&h.push(l),i&&c.enabled&&h.push(c);const d=document.createElement("canvas"),u=d.getContext("2d");d.width=r*2+n*2,d.height=r*h.length+n*h.length;const[f,m]=U(h,r,o);h.forEach(({radius:D,label:N,color:b,labelColor:M,border:I,hover:{color:V,labelColor:H,border:J}},ie)=>{const B=r*ie+ie*n+e;S(e,B,e,r,D,N,I,b,M),S(r+e*3,B,e,r,D,N,J??I,V??b,H??M)});const _=h.length,g=e/(r*2),p=e/(r*6),w=1/_,E=new zf(d);return E.repeat.set(.5-2*g,w-2*p),E.offset.set(g,1-p),Object.assign(E,{colorSpace:Tt,wrapS:Zn,wrapT:Zn,userData:{offsetX:g,offsetY:p,cellHeight:w}}),E;function S(D,N,b,M,I,V,H,J,ie){if(I=I*(M/2),J!=null&&J!==""&&(B(),u.fillStyle=t.set(J).getStyle(),u.fill()),H&&H.size){const oe=H.size*M/2;D+=oe,N+=oe,M-=H.size*M,I=Math.max(0,I-oe),B(),u.strokeStyle=t.set(H.color).getStyle(),u.lineWidth=H.size*M,u.stroke()}V&&L(u,D+M/2,N+(M+b)/2,V,t.set(ie).getStyle());function B(){u.beginPath(),u.moveTo(D+I,N),u.lineTo(D+M-I,N),u.arcTo(D+M,N,D+M,N+I,I),u.lineTo(D+M,N+M-I),u.arcTo(D+M,N+M,D+M-I,N+M,I),u.lineTo(D+I,N+M),u.arcTo(D,N+M,D,N+M-I,I),u.lineTo(D,N+I),u.arcTo(D,N,D+I,N,I),u.closePath()}}function U(D,N,b){const M=[...D].sort((pe,Me)=>{var Ue,Ne;return(((Ue=pe.label)==null?void 0:Ue.length)||0)-(((Ne=Me.label)==null?void 0:Ne.length)||0)}).pop().label,{family:I,weight:V}=b,H=i?Math.sqrt(Math.pow(N*.7,2)/2):N;let J=H,ie=0,B=0;do{u.font=`${V} ${J}px ${I}`;const pe=u.measureText(M);ie=pe.width,B=pe.fontBoundingBoxDescent,J--}while(ie>H&&J>0);const oe=H/B,j=Math.min(H/ie,oe),ue=Math.floor(J*j);return[`${V} ${ue}px ${I}`,oe]}function L(D,N,b,M,I){D.font=f,D.textAlign="center",D.textBaseline="middle",D.fillStyle=I,D.fillText(M,N,b+(i?m:0))}},wg=(s,e)=>s.offset.x=(e?.5:0)+s.userData.offsetX,Vl=(s,e)=>{const{offset:t,userData:{offsetY:n,cellHeight:i}}=s;t.y=1-(e+1)*i+n};function Hl(s,e,t=2,n=2){const i=t/2-s,r=n/2-s,a=s/t,o=(t-s)/t,l=s/n,c=(n-s)/n,h=[i,r,0,-i,r,0,-i,-r,0,i,-r,0],d=[o,c,a,c,a,l,o,l],u=[3*(e+1)+3,3*(e+1)+4,e+4,e+5,2*(e+1)+4,2,1,2*(e+1)+3,3,4*(e+1)+3,4,0],f=[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11].map(L=>u[L]);let m,_,g,p,w,E,S,U;for(let L=0;L<4;L++){p=L<1||L>2?i:-i,w=L<2?r:-r,E=L<1||L>2?o:a,S=L<2?c:l;for(let D=0;D<=e;D++)m=Math.PI/2*(L+D/e),_=Math.cos(m),g=Math.sin(m),h.push(p+s*_,w+s*g,0),d.push(E+a*_,S+l*g),D<e&&(U=(e+1)*L+D+4,f.push(L,U,U+1))}return new Bt().setIndex(new Ht(new Uint32Array(f),1)).setAttribute("position",new Ht(new Float32Array(h),3)).setAttribute("uv",new Ht(new Float32Array(d),2))}const Ag=(s,e)=>{const t=new F,{isSphere:n,radius:i,smoothness:r}=s,a=Hl(i,r);return ar.map((o,l)=>{const c=l<3,h=ar[l],d=l?e.clone():e;Vl(d,l);const{enabled:u,scale:f,opacity:m,hover:_}=s[h],g={map:d,opacity:m,transparent:!0},p=n?new Rl(new ya(g)):new Ct(a,new Pi(g)),w=c?h:h[1];return p.position[w]=(c?1:-1)*(n?Lu:1),n||p.lookAt(t.copy(p.position).multiplyScalar(1.7)),p.scale.setScalar(f),p.renderOrder=1,p.visible=u,p.userData={scale:f,opacity:m,hover:_},p})},Tg=(s,e)=>{const{isSphere:t,corners:n}=s;if(!n.enabled)return[];const{color:i,opacity:r,scale:a,radius:o,smoothness:l,hover:c}=n,h=t?null:Hl(o,l),d={transparent:!0,opacity:r},u=[1,1,1,-1,1,1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,-1,-1,-1,-1,-1].map(m=>m*.85),f=new F;return Array(u.length/3).fill(0).map((m,_)=>{if(t){const w=e.clone();Vl(w,6),d.map=w}else d.color=i;const g=t?new Rl(new ya(d)):new Ct(h,new Pi(d)),p=_*3;return g.position.set(u[p],u[p+1],u[p+2]),t&&g.position.normalize().multiplyScalar(1.7),g.scale.setScalar(a),g.lookAt(f.copy(g.position).multiplyScalar(2)),g.renderOrder=1,g.userData={color:i,opacity:r,scale:a,hover:c},g})},Cg=(s,e,t)=>{const{isSphere:n,edges:i}=s;if(!i.enabled)return[];const{color:r,opacity:a,scale:o,hover:l,radius:c,smoothness:h}=i,d=n?null:Hl(c,h,1.2,.25),u={transparent:!0,opacity:a},f=[0,1,1,0,-1,1,1,0,1,-1,0,1,0,1,-1,0,-1,-1,1,0,-1,-1,0,-1,1,1,0,1,-1,0,-1,1,0,-1,-1,0].map(g=>g*.925),m=new F,_=new F(0,1,0);return Array(f.length/3).fill(0).map((g,p)=>{if(n){const S=e.clone();Vl(S,t),u.map=S}else u.color=r;const w=n?new Rl(new ya(u)):new Ct(d,new Pi(u)),E=p*3;return w.position.set(f[E],f[E+1],f[E+2]),n&&w.position.normalize().multiplyScalar(1.7),w.scale.setScalar(o),w.up.copy(_),w.lookAt(m.copy(w.position).multiplyScalar(2)),!n&&!w.position.y&&(w.rotation.z=Math.PI/2),w.renderOrder=1,w.userData={color:r,opacity:a,scale:o,hover:l},w})};function Rg(s,e=!1){const t=s[0].index!==null,n=new Set(Object.keys(s[0].attributes)),i=new Set(Object.keys(s[0].morphAttributes)),r={},a={},o=s[0].morphTargetsRelative,l=new Bt;let c=0;for(let h=0;h<s.length;++h){const d=s[h];let u=0;if(t!==(d.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(const f in d.attributes){if(!n.has(f))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+'. All geometries must have compatible attributes; make sure "'+f+'" attribute exists among all geometries, or in none of them.'),null;r[f]===void 0&&(r[f]=[]),r[f].push(d.attributes[f]),u++}if(u!==n.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". Make sure all geometries have the same number of attributes."),null;if(o!==d.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(const f in d.morphAttributes){if(!i.has(f))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". .morphAttributes must be consistent throughout all geometries."),null;a[f]===void 0&&(a[f]=[]),a[f].push(d.morphAttributes[f])}if(e){let f;if(t)f=d.index.count;else if(d.attributes.position!==void 0)f=d.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". The geometry must have either an index or a position attribute"),null;l.addGroup(c,f,h),c+=f}}if(t){let h=0;const d=[];for(let u=0;u<s.length;++u){const f=s[u].index;for(let m=0;m<f.count;++m)d.push(f.getX(m)+h);h+=s[u].attributes.position.count}l.setIndex(d)}for(const h in r){const d=bh(r[h]);if(!d)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+h+" attribute."),null;l.setAttribute(h,d)}for(const h in a){const d=a[h][0].length;if(d===0)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[h]=[];for(let u=0;u<d;++u){const f=[];for(let _=0;_<a[h].length;++_)f.push(a[h][_][u]);const m=bh(f);if(!m)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+h+" morphAttribute."),null;l.morphAttributes[h].push(m)}}return l}function bh(s){let e,t,n,i=-1,r=0;for(let c=0;c<s.length;++c){const h=s[c];if(e===void 0&&(e=h.array.constructor),e!==h.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(t===void 0&&(t=h.itemSize),t!==h.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(n===void 0&&(n=h.normalized),n!==h.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(i===-1&&(i=h.gpuType),i!==h.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;r+=h.count*t}const a=new e(r),o=new Ht(a,t,n);let l=0;for(let c=0;c<s.length;++c){const h=s[c];if(h.isInterleavedBufferAttribute){const d=l/t;for(let u=0,f=h.count;u<f;u++)for(let m=0;m<t;m++){const _=h.getComponent(u,m);o.setComponent(u+d,m,_)}}else a.set(h.array,l);l+=h.count*t}return i!==void 0&&(o.gpuType=i),o}const Lg=(s,e)=>{const{isSphere:t,background:{enabled:n,color:i,opacity:r,hover:a}}=e;let o;const l=new Pi({color:i,side:gn,opacity:r,transparent:!0,depthWrite:!1});if(!n)return null;if(t)o=new Ct(new Ma(1.8,64,64),l);else{let c;s.forEach(h=>{const d=h.scale.x;h.scale.setScalar(.9),h.updateMatrix();const u=h.geometry.clone();u.applyMatrix4(h.matrix),c=c?Rg([c,u]):u,h.scale.setScalar(d)}),o=new Ct(c,l)}return o.userData={color:i,opacity:r,hover:a},o},Sh=new qn,Xr=new F;class Pu extends Sp{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],t=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],n=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(n),this.setAttribute("position",new mt(e,3)),this.setAttribute("uv",new mt(t,2))}applyMatrix4(e){const t=this.attributes.instanceStart,n=this.attributes.instanceEnd;return t!==void 0&&(t.applyMatrix4(e),n.applyMatrix4(e),t.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const n=new ol(t,6,1);return this.setAttribute("instanceStart",new ti(n,3,0)),this.setAttribute("instanceEnd",new ti(n,3,3)),this.instanceCount=this.attributes.instanceStart.count,this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const n=new ol(t,6,1);return this.setAttribute("instanceColorStart",new ti(n,3,0)),this.setAttribute("instanceColorEnd",new ti(n,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new ep(e.geometry)),this}fromLineSegments(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new qn);const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;e!==void 0&&t!==void 0&&(this.boundingBox.setFromBufferAttribute(e),Sh.setFromBufferAttribute(t),this.boundingBox.union(Sh))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new gi),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(e!==void 0&&t!==void 0){const n=this.boundingSphere.center;this.boundingBox.getCenter(n);let i=0;for(let r=0,a=e.count;r<a;r++)Xr.fromBufferAttribute(e,r),i=Math.max(i,n.distanceToSquared(Xr)),Xr.fromBufferAttribute(t,r),i=Math.max(i,n.distanceToSquared(Xr));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(e){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(e)}}Le.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new Be(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};En.line={uniforms:Tl.merge([Le.common,Le.fog,Le.line]),vertexShader:`
|
|
3828
3828
|
#include <common>
|
|
3829
3829
|
#include <color_pars_vertex>
|
|
3830
3830
|
#include <fog_pars_vertex>
|
|
@@ -4194,14 +4194,14 @@ void main() {
|
|
|
4194
4194
|
#include <premultiplied_alpha_fragment>
|
|
4195
4195
|
|
|
4196
4196
|
}
|
|
4197
|
-
`};class Gl extends mi{constructor(e){super({type:"LineMaterial",uniforms:Tl.clone(En.line.uniforms),vertexShader:En.line.vertexShader,fragmentShader:En.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(e)}get color(){return this.uniforms.diffuse.value}set color(e){this.uniforms.diffuse.value=e}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(e){e===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(e){this.uniforms.linewidth&&(this.uniforms.linewidth.value=e)}get dashed(){return"USE_DASH"in this.defines}set dashed(e){e===!0!==this.dashed&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(e){this.uniforms.dashScale.value=e}get dashSize(){return this.uniforms.dashSize.value}set dashSize(e){this.uniforms.dashSize.value=e}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(e){this.uniforms.dashOffset.value=e}get gapSize(){return this.uniforms.gapSize.value}set gapSize(e){this.uniforms.gapSize.value=e}get opacity(){return this.uniforms.opacity.value}set opacity(e){this.uniforms&&(this.uniforms.opacity.value=e)}get resolution(){return this.uniforms.resolution.value}set resolution(e){this.uniforms.resolution.value.copy(e)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(e){this.defines&&(e===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),e===!0?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const fo=new bt,Eh=new F,wh=new F,nn=new bt,sn=new bt,$n=new bt,po=new F,mo=new st,rn=new Tp,Ah=new F,qr=new qn,jr=new gi,Jn=new bt;let Kn,Yi;function Th(s,e,t){return Jn.set(0,0,-e,1).applyMatrix4(s.projectionMatrix),Jn.multiplyScalar(1/Jn.w),Jn.x=Yi/t.width,Jn.y=Yi/t.height,Jn.applyMatrix4(s.projectionMatrixInverse),Jn.multiplyScalar(1/Jn.w),Math.abs(Math.max(Jn.x,Jn.y))}function Pg(s,e){const t=s.matrixWorld,n=s.geometry,i=n.attributes.instanceStart,r=n.attributes.instanceEnd,a=Math.min(n.instanceCount,i.count);for(let o=0,l=a;o<l;o++){rn.start.fromBufferAttribute(i,o),rn.end.fromBufferAttribute(r,o),rn.applyMatrix4(t);const c=new F,h=new F;Kn.distanceSqToSegment(rn.start,rn.end,h,c),h.distanceTo(c)<Yi*.5&&e.push({point:h,pointOnLine:c,distance:Kn.origin.distanceTo(h),object:s,face:null,faceIndex:o,uv:null,uv1:null})}}function Dg(s,e,t){const n=e.projectionMatrix,i=s.material.resolution,r=s.matrixWorld,a=s.geometry,o=a.attributes.instanceStart,l=a.attributes.instanceEnd,c=Math.min(a.instanceCount,o.count),h=-e.near;Kn.at(1,$n),$n.w=1,$n.applyMatrix4(e.matrixWorldInverse),$n.applyMatrix4(n),$n.multiplyScalar(1/$n.w),$n.x*=i.x/2,$n.y*=i.y/2,$n.z=0,po.copy($n),mo.multiplyMatrices(e.matrixWorldInverse,r);for(let f=0,u=c;f<u;f++){if(nn.fromBufferAttribute(o,f),sn.fromBufferAttribute(l,f),nn.w=1,sn.w=1,nn.applyMatrix4(mo),sn.applyMatrix4(mo),nn.z>h&&sn.z>h)continue;if(nn.z>h){const p=nn.z-sn.z,w=(nn.z-h)/p;nn.lerp(sn,w)}else if(sn.z>h){const p=sn.z-nn.z,w=(sn.z-h)/p;sn.lerp(nn,w)}nn.applyMatrix4(n),sn.applyMatrix4(n),nn.multiplyScalar(1/nn.w),sn.multiplyScalar(1/sn.w),nn.x*=i.x/2,nn.y*=i.y/2,sn.x*=i.x/2,sn.y*=i.y/2,rn.start.copy(nn),rn.start.z=0,rn.end.copy(sn),rn.end.z=0;const d=rn.closestPointToPointParameter(po,!0);rn.at(d,Ah);const m=Xi.lerp(nn.z,sn.z,d),_=m>=-1&&m<=1,g=po.distanceTo(Ah)<Yi*.5;if(_&&g){rn.start.fromBufferAttribute(o,f),rn.end.fromBufferAttribute(l,f),rn.start.applyMatrix4(r),rn.end.applyMatrix4(r);const p=new F,w=new F;Kn.distanceSqToSegment(rn.start,rn.end,w,p),t.push({point:w,pointOnLine:p,distance:Kn.origin.distanceTo(w),object:s,face:null,faceIndex:f,uv:null,uv1:null})}}}class Ng extends Ct{constructor(e=new Pu,t=new Gl({color:Math.random()*16777215})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,t=e.attributes.instanceStart,n=e.attributes.instanceEnd,i=new Float32Array(2*t.count);for(let a=0,o=0,l=t.count;a<l;a++,o+=2)Eh.fromBufferAttribute(t,a),wh.fromBufferAttribute(n,a),i[o]=o===0?0:i[o-1],i[o+1]=i[o]+Eh.distanceTo(wh);const r=new ol(i,2,1);return e.setAttribute("instanceDistanceStart",new ti(r,1,0)),e.setAttribute("instanceDistanceEnd",new ti(r,1,1)),this}raycast(e,t){const n=this.material.worldUnits,i=e.camera;i===null&&!n&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const r=e.params.Line2!==void 0&&e.params.Line2.threshold||0;Kn=e.ray;const a=this.matrixWorld,o=this.geometry,l=this.material;Yi=l.linewidth+r,o.boundingSphere===null&&o.computeBoundingSphere(),jr.copy(o.boundingSphere).applyMatrix4(a);let c;if(n)c=Yi*.5;else{const f=Math.max(i.near,jr.distanceToPoint(Kn.origin));c=Th(i,f,l.resolution)}if(jr.radius+=c,Kn.intersectsSphere(jr)===!1)return;o.boundingBox===null&&o.computeBoundingBox(),qr.copy(o.boundingBox).applyMatrix4(a);let h;if(n)h=Yi*.5;else{const f=Math.max(i.near,qr.distanceToPoint(Kn.origin));h=Th(i,f,l.resolution)}qr.expandByScalar(h),Kn.intersectsBox(qr)!==!1&&(n?Pg(this,t):Dg(this,i,t))}onBeforeRender(e){const t=this.material.uniforms;t&&t.resolution&&(e.getViewport(fo),this.material.uniforms.resolution.value.set(fo.z,fo.w))}}class Du extends Pu{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const t=e.length-3,n=new Float32Array(2*t);for(let i=0;i<t;i+=3)n[2*i]=e[i],n[2*i+1]=e[i+1],n[2*i+2]=e[i+2],n[2*i+3]=e[i+3],n[2*i+4]=e[i+4],n[2*i+5]=e[i+5];return super.setPositions(n),this}setColors(e){const t=e.length-3,n=new Float32Array(2*t);for(let i=0;i<t;i+=3)n[2*i]=e[i],n[2*i+1]=e[i+1],n[2*i+2]=e[i+2],n[2*i+3]=e[i+3],n[2*i+4]=e[i+4],n[2*i+5]=e[i+5];return super.setColors(n),this}setFromPoints(e){const t=e.length-1,n=new Float32Array(6*t);for(let i=0;i<t;i++)n[6*i]=e[i].x,n[6*i+1]=e[i].y,n[6*i+2]=e[i].z||0,n[6*i+3]=e[i+1].x,n[6*i+4]=e[i+1].y,n[6*i+5]=e[i+1].z||0;return super.setPositions(n),this}fromLine(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}}class Ug extends Ng{constructor(e=new Du,t=new Gl({color:Math.random()*16777215})){super(e,t),this.isLine2=!0,this.type="Line2"}}const Ig=s=>{const e=new et,t=[],n=[],{isSphere:i}=s;if(ar.forEach((o,l)=>{const{enabled:c,line:h,scale:f,color:u}=s[o];if(!c||!h)return;const d=l<3?1:-1,m=(i?Lu-f/2:.975)*d;t.push(o.includes("x")?m:0,o.includes("y")?m:0,o.includes("z")?m:0,0,0,0);const _=e.set(u).toArray();n.push(..._,..._)}),!t.length)return null;const r=new Du().setPositions(t).setColors(n),a=new Gl({linewidth:s.lineWidth,vertexColors:!0,resolution:new Be(window.innerWidth,window.innerHeight)});return new Ug(r,a).computeLineDistances()},Fg=s=>{const{corners:e,edges:t}=s,n=[],i=Eg(s),r=Ag(s,i);n.push(...r),e.enabled&&n.push(...Tg(s,i)),t.enabled&&n.push(...Cg(s,i,e.enabled?7:6));const a=Lg(r,s),o=Ig(s);return[n,a,o]},Ys=(s,e=!0)=>{const{material:t,userData:n}=s,{opacity:i,color:r,scale:a}=e?n.hover:n;s.scale.setScalar(a),t.opacity=i,t.map?wg(t.map,e):t.color.set(r)},Ms=new st,Ch=new bu,Og=new Be,Hi=new F,Rh=new bt;class zg extends It{constructor(e,t,n={}){super(),Pt(this,"enabled",!0),Pt(this,"camera"),Pt(this,"renderer"),Pt(this,"options"),Pt(this,"target",new F),Pt(this,"animated",!0),Pt(this,"speed",1),Pt(this,"animating",!1),Pt(this,"_options"),Pt(this,"_intersections"),Pt(this,"_background",null),Pt(this,"_viewport",[0,0,0,0]),Pt(this,"_originalViewport",[0,0,0,0]),Pt(this,"_originalScissor",[0,0,0,0]),Pt(this,"_scene"),Pt(this,"_camera"),Pt(this,"_container"),Pt(this,"_domElement"),Pt(this,"_domRect"),Pt(this,"_dragging",!1),Pt(this,"_distance",0),Pt(this,"_clock",new wp),Pt(this,"_targetQuaternion",new Pn),Pt(this,"_quaternionStart",new Pn),Pt(this,"_quaternionEnd",new Pn),Pt(this,"_pointerStart",new Be),Pt(this,"_focus",null),Pt(this,"_placement"),Pt(this,"_controls"),Pt(this,"_controlsListeners"),this.camera=e,this.renderer=t,this._scene=new Cl().add(this),this.set(n)}get placement(){return this._placement}set placement(e){this._placement=Cu(this._domElement,e),this.domUpdate()}set(e={}){this.dispose(),this.options=e,this._options=Sg(e),this._camera=this._options.isSphere?new Sa(-1.8,1.8,1.8,-1.8,5,10):new an(26,1,5,10),this._camera.position.set(0,0,7);const[t,n,i]=Fg(this._options);n&&this.add(n),i&&this.add(i),this.add(...t),this._background=n,this._intersections=t;const{container:r,animated:a,speed:o}=this._options;return this.animated=a,this.speed=o,this._container=r?gg(r):document.body,this._domElement=mg(this._options),this._domElement.onpointerdown=l=>this._onPointerDown(l),this._domElement.onpointermove=l=>this._onPointerMove(l),this._domElement.onpointerleave=()=>this._onPointerLeave(),this._container.appendChild(this._domElement),this._controls&&this.attachControls(this._controls),this.update(),this._updateOrientation(!0),this}render(){this.animating&&this._animate();const{renderer:e,_viewport:t}=this,n=e.getScissorTest(),i=e.autoClear;return e.autoClear=!1,e.setViewport(...t),n&&e.setScissor(...t),e.clear(!1,!0,!1),e.render(this._scene,this._camera),e.setViewport(...this._originalViewport),n&&e.setScissor(...this._originalScissor),e.autoClear=i,this}domUpdate(){this._domRect=this._domElement.getBoundingClientRect();const e=this.renderer,t=this._domRect,n=e.domElement.getBoundingClientRect();return this._viewport.splice(0,4,t.left-n.left,e.domElement.clientHeight-(t.top-n.top+t.height),t.width,t.height),e.getViewport(Rh).toArray(this._originalViewport),e.getScissorTest()&&e.getScissor(Rh).toArray(this._originalScissor),this}cameraUpdate(){return this._updateOrientation(),this}update(e=!0){return e&&this._controls&&this._controls.update(),this.domUpdate().cameraUpdate()}attachControls(e){return this.detachControls(),this.target=e.target,this._controlsListeners={start:()=>e.enabled=!1,end:()=>e.enabled=!0,change:()=>this.update(!1)},this.addEventListener("start",this._controlsListeners.start),this.addEventListener("end",this._controlsListeners.end),e.addEventListener("change",this._controlsListeners.change),this._controls=e,this}detachControls(){if(!(!this._controlsListeners||!this._controls))return this.target=new F().copy(this._controls.target),this.removeEventListener("start",this._controlsListeners.start),this.removeEventListener("end",this._controlsListeners.end),this._controls.removeEventListener("change",this._controlsListeners.change),this._controlsListeners=void 0,this._controls=void 0,this}dispose(){var e;this.detachControls(),this.children.forEach(t=>{var n,i,r,a;this.remove(t);const o=t;(n=o.material)==null||n.dispose(),(r=(i=o.material)==null?void 0:i.map)==null||r.dispose(),(a=o.geometry)==null||a.dispose()}),(e=this._domElement)==null||e.remove()}_updateOrientation(e=!0){e&&(this.quaternion.copy(this.camera.quaternion).invert(),this.updateMatrixWorld()),_h(this._options,this._intersections,this.camera)}_animate(){const{position:e,quaternion:t}=this.camera;if(e.set(0,0,1),!this.animated){e.applyQuaternion(this._quaternionEnd).multiplyScalar(this._distance).add(this.target),t.copy(this._targetQuaternion),this._updateOrientation(),this.animating=!1,this.dispatchEvent({type:"change"}),this.dispatchEvent({type:"end"});return}this._controls&&(this._controls.enabled=!1);const n=this._clock.getDelta()*xg*this.speed;this._quaternionStart.rotateTowards(this._quaternionEnd,n),e.applyQuaternion(this._quaternionStart).multiplyScalar(this._distance).add(this.target),t.rotateTowards(this._targetQuaternion,n),this._updateOrientation(),requestAnimationFrame(()=>this.dispatchEvent({type:"change"})),this._quaternionStart.angleTo(this._quaternionEnd)<uo&&(this._controls&&(this._controls.enabled=!0),this.animating=!1,this.dispatchEvent({type:"end"}))}_setOrientation(e){const t=this.camera,n=this.target;Hi.copy(e).multiplyScalar(this._distance),Ms.setPosition(Hi).lookAt(Hi,this.position,this.up),this._targetQuaternion.setFromRotationMatrix(Ms),Hi.add(n),Ms.lookAt(Hi,n,this.up),this._quaternionEnd.setFromRotationMatrix(Ms),Ms.setPosition(t.position).lookAt(t.position,n,this.up),this._quaternionStart.setFromRotationMatrix(Ms),this.animating=!0,this._clock.start(),this.dispatchEvent({type:"start"})}_onPointerDown(e){if(!this.enabled)return;const t=l=>{if(!this._dragging){if(vg(l,this._pointerStart))return;this._dragging=!0}const c=Og.set(l.clientX,l.clientY).sub(this._pointerStart).multiplyScalar(1/this._domRect.width*Math.PI),h=this.coordinateConversion(Hi.subVectors(this.camera.position,this.target)),f=Ch.setFromVector3(h);f.theta=a-c.x,f.phi=hl(o-c.y,uo,Math.PI-uo),this.coordinateConversion(this.camera.position.setFromSpherical(f),!0).add(this.target),this.camera.lookAt(this.target),this.quaternion.copy(this.camera.quaternion).invert(),this._updateOrientation(!1),this.dispatchEvent({type:"change"})},n=()=>{if(document.removeEventListener("pointermove",t,!1),document.removeEventListener("pointerup",n,!1),!this._dragging)return this._handleClick(e);this._focus&&(Ys(this._focus,!1),this._focus=null),this._dragging=!1,this.dispatchEvent({type:"end"})};if(this.animating)return;e.preventDefault(),this._pointerStart.set(e.clientX,e.clientY);const i=this.coordinateConversion(Hi.subVectors(this.camera.position,this.target)),r=Ch.setFromVector3(i),a=r.theta,o=r.phi;this._distance=r.radius,document.addEventListener("pointermove",t,!1),document.addEventListener("pointerup",n,!1),this.dispatchEvent({type:"start"})}coordinateConversion(e,t=!1){const{x:n,y:i,z:r}=e,a=It.DEFAULT_UP;return a.x===1?t?e.set(i,r,n):e.set(r,n,i):a.z===1?t?e.set(r,n,i):e.set(i,r,n):e}_onPointerMove(e){!this.enabled||this._dragging||(this._background&&Mh(this._background,!0),this._handleHover(e))}_onPointerLeave(){!this.enabled||this._dragging||(this._background&&Mh(this._background,!1),this._focus&&Ys(this._focus,!1),this._domElement.style.cursor="")}_handleClick(e){const t=yh(e,this._domRect,this._camera,this._intersections);this._focus&&(Ys(this._focus,!1),this._focus=null),t&&(this._setOrientation(t.object.position),this.dispatchEvent({type:"change"}))}_handleHover(e){const t=yh(e,this._domRect,this._camera,this._intersections),n=(t==null?void 0:t.object)||null;this._focus!==n&&(this._domElement.style.cursor=n?"pointer":"",this._focus&&Ys(this._focus,!1),(this._focus=n)?Ys(n,!0):_h(this._options,this._intersections,this.camera))}}const Bg=/^[og]\s*(.+)?/,kg=/^mtllib /,Vg=/^usemtl /,Hg=/^usemap /,Lh=/\s+/,Ph=new F,go=new F,Dh=new F,Nh=new F,Un=new F,Yr=new et;function Gg(){const s={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(e,t){if(this.object&&this.object.fromDeclaration===!1){this.object.name=e,this.object.fromDeclaration=t!==!1;return}const n=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:e||"",fromDeclaration:t!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(i,r){const a=this._finalize(!1);a&&(a.inherited||a.groupCount<=0)&&this.materials.splice(a.index,1);const o={index:this.materials.length,name:i||"",mtllib:Array.isArray(r)&&r.length>0?r[r.length-1]:"",smooth:a!==void 0?a.smooth:this.smooth,groupStart:a!==void 0?a.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(l){const c={index:typeof l=="number"?l:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return c.clone=this.clone.bind(c),c}};return this.materials.push(o),o},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(i){const r=this.currentMaterial();if(r&&r.groupEnd===-1&&(r.groupEnd=this.geometry.vertices.length/3,r.groupCount=r.groupEnd-r.groupStart,r.inherited=!1),i&&this.materials.length>1)for(let a=this.materials.length-1;a>=0;a--)this.materials[a].groupCount<=0&&this.materials.splice(a,1);return i&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),r}},n&&n.name&&typeof n.clone=="function"){const i=n.clone(0);i.inherited=!0,this.object.materials.push(i)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(e,t){const n=parseInt(e,10);return(n>=0?n-1:n+t/3)*3},parseNormalIndex:function(e,t){const n=parseInt(e,10);return(n>=0?n-1:n+t/3)*3},parseUVIndex:function(e,t){const n=parseInt(e,10);return(n>=0?n-1:n+t/2)*2},addVertex:function(e,t,n){const i=this.vertices,r=this.object.geometry.vertices;r.push(i[e+0],i[e+1],i[e+2]),r.push(i[t+0],i[t+1],i[t+2]),r.push(i[n+0],i[n+1],i[n+2])},addVertexPoint:function(e){const t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){const t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,n){const i=this.normals,r=this.object.geometry.normals;r.push(i[e+0],i[e+1],i[e+2]),r.push(i[t+0],i[t+1],i[t+2]),r.push(i[n+0],i[n+1],i[n+2])},addFaceNormal:function(e,t,n){const i=this.vertices,r=this.object.geometry.normals;Ph.fromArray(i,e),go.fromArray(i,t),Dh.fromArray(i,n),Un.subVectors(Dh,go),Nh.subVectors(Ph,go),Un.cross(Nh),Un.normalize(),r.push(Un.x,Un.y,Un.z),r.push(Un.x,Un.y,Un.z),r.push(Un.x,Un.y,Un.z)},addColor:function(e,t,n){const i=this.colors,r=this.object.geometry.colors;i[e]!==void 0&&r.push(i[e+0],i[e+1],i[e+2]),i[t]!==void 0&&r.push(i[t+0],i[t+1],i[t+2]),i[n]!==void 0&&r.push(i[n+0],i[n+1],i[n+2])},addUV:function(e,t,n){const i=this.uvs,r=this.object.geometry.uvs;r.push(i[e+0],i[e+1]),r.push(i[t+0],i[t+1]),r.push(i[n+0],i[n+1])},addDefaultUV:function(){const e=this.object.geometry.uvs;e.push(0,0),e.push(0,0),e.push(0,0)},addUVLine:function(e){const t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,n,i,r,a,o,l,c){const h=this.vertices.length;let f=this.parseVertexIndex(e,h),u=this.parseVertexIndex(t,h),d=this.parseVertexIndex(n,h);if(this.addVertex(f,u,d),this.addColor(f,u,d),o!==void 0&&o!==""){const m=this.normals.length;f=this.parseNormalIndex(o,m),u=this.parseNormalIndex(l,m),d=this.parseNormalIndex(c,m),this.addNormal(f,u,d)}else this.addFaceNormal(f,u,d);if(i!==void 0&&i!==""){const m=this.uvs.length;f=this.parseUVIndex(i,m),u=this.parseUVIndex(r,m),d=this.parseUVIndex(a,m),this.addUV(f,u,d),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(e){this.object.geometry.type="Points";const t=this.vertices.length;for(let n=0,i=e.length;n<i;n++){const r=this.parseVertexIndex(e[n],t);this.addVertexPoint(r),this.addColor(r)}},addLineGeometry:function(e,t){this.object.geometry.type="Line";const n=this.vertices.length,i=this.uvs.length;for(let r=0,a=e.length;r<a;r++)this.addVertexLine(this.parseVertexIndex(e[r],n));for(let r=0,a=t.length;r<a;r++)this.addUVLine(this.parseUVIndex(t[r],i))}};return s.startObject("",!1),s}class _o extends Xn{constructor(e){super(e),this.materials=null}load(e,t,n,i){const r=this,a=new Os(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(o){try{t(r.parse(o))}catch(l){i?i(l):console.error(l),r.manager.itemError(e)}},n,i)}setMaterials(e){return this.materials=e,this}parse(e){const t=new Gg;e.indexOf(`\r
|
|
4197
|
+
`};class Gl extends mi{constructor(e){super({type:"LineMaterial",uniforms:Tl.clone(En.line.uniforms),vertexShader:En.line.vertexShader,fragmentShader:En.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(e)}get color(){return this.uniforms.diffuse.value}set color(e){this.uniforms.diffuse.value=e}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(e){e===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(e){this.uniforms.linewidth&&(this.uniforms.linewidth.value=e)}get dashed(){return"USE_DASH"in this.defines}set dashed(e){e===!0!==this.dashed&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(e){this.uniforms.dashScale.value=e}get dashSize(){return this.uniforms.dashSize.value}set dashSize(e){this.uniforms.dashSize.value=e}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(e){this.uniforms.dashOffset.value=e}get gapSize(){return this.uniforms.gapSize.value}set gapSize(e){this.uniforms.gapSize.value=e}get opacity(){return this.uniforms.opacity.value}set opacity(e){this.uniforms&&(this.uniforms.opacity.value=e)}get resolution(){return this.uniforms.resolution.value}set resolution(e){this.uniforms.resolution.value.copy(e)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(e){this.defines&&(e===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),e===!0?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const fo=new bt,Eh=new F,wh=new F,nn=new bt,sn=new bt,$n=new bt,po=new F,mo=new st,rn=new Tp,Ah=new F,qr=new qn,jr=new gi,Jn=new bt;let Kn,Yi;function Th(s,e,t){return Jn.set(0,0,-e,1).applyMatrix4(s.projectionMatrix),Jn.multiplyScalar(1/Jn.w),Jn.x=Yi/t.width,Jn.y=Yi/t.height,Jn.applyMatrix4(s.projectionMatrixInverse),Jn.multiplyScalar(1/Jn.w),Math.abs(Math.max(Jn.x,Jn.y))}function Pg(s,e){const t=s.matrixWorld,n=s.geometry,i=n.attributes.instanceStart,r=n.attributes.instanceEnd,a=Math.min(n.instanceCount,i.count);for(let o=0,l=a;o<l;o++){rn.start.fromBufferAttribute(i,o),rn.end.fromBufferAttribute(r,o),rn.applyMatrix4(t);const c=new F,h=new F;Kn.distanceSqToSegment(rn.start,rn.end,h,c),h.distanceTo(c)<Yi*.5&&e.push({point:h,pointOnLine:c,distance:Kn.origin.distanceTo(h),object:s,face:null,faceIndex:o,uv:null,uv1:null})}}function Dg(s,e,t){const n=e.projectionMatrix,i=s.material.resolution,r=s.matrixWorld,a=s.geometry,o=a.attributes.instanceStart,l=a.attributes.instanceEnd,c=Math.min(a.instanceCount,o.count),h=-e.near;Kn.at(1,$n),$n.w=1,$n.applyMatrix4(e.matrixWorldInverse),$n.applyMatrix4(n),$n.multiplyScalar(1/$n.w),$n.x*=i.x/2,$n.y*=i.y/2,$n.z=0,po.copy($n),mo.multiplyMatrices(e.matrixWorldInverse,r);for(let d=0,u=c;d<u;d++){if(nn.fromBufferAttribute(o,d),sn.fromBufferAttribute(l,d),nn.w=1,sn.w=1,nn.applyMatrix4(mo),sn.applyMatrix4(mo),nn.z>h&&sn.z>h)continue;if(nn.z>h){const p=nn.z-sn.z,w=(nn.z-h)/p;nn.lerp(sn,w)}else if(sn.z>h){const p=sn.z-nn.z,w=(sn.z-h)/p;sn.lerp(nn,w)}nn.applyMatrix4(n),sn.applyMatrix4(n),nn.multiplyScalar(1/nn.w),sn.multiplyScalar(1/sn.w),nn.x*=i.x/2,nn.y*=i.y/2,sn.x*=i.x/2,sn.y*=i.y/2,rn.start.copy(nn),rn.start.z=0,rn.end.copy(sn),rn.end.z=0;const f=rn.closestPointToPointParameter(po,!0);rn.at(f,Ah);const m=Xi.lerp(nn.z,sn.z,f),_=m>=-1&&m<=1,g=po.distanceTo(Ah)<Yi*.5;if(_&&g){rn.start.fromBufferAttribute(o,d),rn.end.fromBufferAttribute(l,d),rn.start.applyMatrix4(r),rn.end.applyMatrix4(r);const p=new F,w=new F;Kn.distanceSqToSegment(rn.start,rn.end,w,p),t.push({point:w,pointOnLine:p,distance:Kn.origin.distanceTo(w),object:s,face:null,faceIndex:d,uv:null,uv1:null})}}}class Ng extends Ct{constructor(e=new Pu,t=new Gl({color:Math.random()*16777215})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,t=e.attributes.instanceStart,n=e.attributes.instanceEnd,i=new Float32Array(2*t.count);for(let a=0,o=0,l=t.count;a<l;a++,o+=2)Eh.fromBufferAttribute(t,a),wh.fromBufferAttribute(n,a),i[o]=o===0?0:i[o-1],i[o+1]=i[o]+Eh.distanceTo(wh);const r=new ol(i,2,1);return e.setAttribute("instanceDistanceStart",new ti(r,1,0)),e.setAttribute("instanceDistanceEnd",new ti(r,1,1)),this}raycast(e,t){const n=this.material.worldUnits,i=e.camera;i===null&&!n&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const r=e.params.Line2!==void 0&&e.params.Line2.threshold||0;Kn=e.ray;const a=this.matrixWorld,o=this.geometry,l=this.material;Yi=l.linewidth+r,o.boundingSphere===null&&o.computeBoundingSphere(),jr.copy(o.boundingSphere).applyMatrix4(a);let c;if(n)c=Yi*.5;else{const d=Math.max(i.near,jr.distanceToPoint(Kn.origin));c=Th(i,d,l.resolution)}if(jr.radius+=c,Kn.intersectsSphere(jr)===!1)return;o.boundingBox===null&&o.computeBoundingBox(),qr.copy(o.boundingBox).applyMatrix4(a);let h;if(n)h=Yi*.5;else{const d=Math.max(i.near,qr.distanceToPoint(Kn.origin));h=Th(i,d,l.resolution)}qr.expandByScalar(h),Kn.intersectsBox(qr)!==!1&&(n?Pg(this,t):Dg(this,i,t))}onBeforeRender(e){const t=this.material.uniforms;t&&t.resolution&&(e.getViewport(fo),this.material.uniforms.resolution.value.set(fo.z,fo.w))}}class Du extends Pu{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const t=e.length-3,n=new Float32Array(2*t);for(let i=0;i<t;i+=3)n[2*i]=e[i],n[2*i+1]=e[i+1],n[2*i+2]=e[i+2],n[2*i+3]=e[i+3],n[2*i+4]=e[i+4],n[2*i+5]=e[i+5];return super.setPositions(n),this}setColors(e){const t=e.length-3,n=new Float32Array(2*t);for(let i=0;i<t;i+=3)n[2*i]=e[i],n[2*i+1]=e[i+1],n[2*i+2]=e[i+2],n[2*i+3]=e[i+3],n[2*i+4]=e[i+4],n[2*i+5]=e[i+5];return super.setColors(n),this}setFromPoints(e){const t=e.length-1,n=new Float32Array(6*t);for(let i=0;i<t;i++)n[6*i]=e[i].x,n[6*i+1]=e[i].y,n[6*i+2]=e[i].z||0,n[6*i+3]=e[i+1].x,n[6*i+4]=e[i+1].y,n[6*i+5]=e[i+1].z||0;return super.setPositions(n),this}fromLine(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}}class Ug extends Ng{constructor(e=new Du,t=new Gl({color:Math.random()*16777215})){super(e,t),this.isLine2=!0,this.type="Line2"}}const Ig=s=>{const e=new et,t=[],n=[],{isSphere:i}=s;if(ar.forEach((o,l)=>{const{enabled:c,line:h,scale:d,color:u}=s[o];if(!c||!h)return;const f=l<3?1:-1,m=(i?Lu-d/2:.975)*f;t.push(o.includes("x")?m:0,o.includes("y")?m:0,o.includes("z")?m:0,0,0,0);const _=e.set(u).toArray();n.push(..._,..._)}),!t.length)return null;const r=new Du().setPositions(t).setColors(n),a=new Gl({linewidth:s.lineWidth,vertexColors:!0,resolution:new Be(window.innerWidth,window.innerHeight)});return new Ug(r,a).computeLineDistances()},Fg=s=>{const{corners:e,edges:t}=s,n=[],i=Eg(s),r=Ag(s,i);n.push(...r),e.enabled&&n.push(...Tg(s,i)),t.enabled&&n.push(...Cg(s,i,e.enabled?7:6));const a=Lg(r,s),o=Ig(s);return[n,a,o]},Ys=(s,e=!0)=>{const{material:t,userData:n}=s,{opacity:i,color:r,scale:a}=e?n.hover:n;s.scale.setScalar(a),t.opacity=i,t.map?wg(t.map,e):t.color.set(r)},Ms=new st,Ch=new bu,Og=new Be,Hi=new F,Rh=new bt;class zg extends It{constructor(e,t,n={}){super(),Pt(this,"enabled",!0),Pt(this,"camera"),Pt(this,"renderer"),Pt(this,"options"),Pt(this,"target",new F),Pt(this,"animated",!0),Pt(this,"speed",1),Pt(this,"animating",!1),Pt(this,"_options"),Pt(this,"_intersections"),Pt(this,"_background",null),Pt(this,"_viewport",[0,0,0,0]),Pt(this,"_originalViewport",[0,0,0,0]),Pt(this,"_originalScissor",[0,0,0,0]),Pt(this,"_scene"),Pt(this,"_camera"),Pt(this,"_container"),Pt(this,"_domElement"),Pt(this,"_domRect"),Pt(this,"_dragging",!1),Pt(this,"_distance",0),Pt(this,"_clock",new wp),Pt(this,"_targetQuaternion",new Pn),Pt(this,"_quaternionStart",new Pn),Pt(this,"_quaternionEnd",new Pn),Pt(this,"_pointerStart",new Be),Pt(this,"_focus",null),Pt(this,"_placement"),Pt(this,"_controls"),Pt(this,"_controlsListeners"),this.camera=e,this.renderer=t,this._scene=new Cl().add(this),this.set(n)}get placement(){return this._placement}set placement(e){this._placement=Cu(this._domElement,e),this.domUpdate()}set(e={}){this.dispose(),this.options=e,this._options=Sg(e),this._camera=this._options.isSphere?new Sa(-1.8,1.8,1.8,-1.8,5,10):new an(26,1,5,10),this._camera.position.set(0,0,7);const[t,n,i]=Fg(this._options);n&&this.add(n),i&&this.add(i),this.add(...t),this._background=n,this._intersections=t;const{container:r,animated:a,speed:o}=this._options;return this.animated=a,this.speed=o,this._container=r?gg(r):document.body,this._domElement=mg(this._options),this._domElement.onpointerdown=l=>this._onPointerDown(l),this._domElement.onpointermove=l=>this._onPointerMove(l),this._domElement.onpointerleave=()=>this._onPointerLeave(),this._container.appendChild(this._domElement),this._controls&&this.attachControls(this._controls),this.update(),this._updateOrientation(!0),this}render(){this.animating&&this._animate();const{renderer:e,_viewport:t}=this,n=e.getScissorTest(),i=e.autoClear;return e.autoClear=!1,e.setViewport(...t),n&&e.setScissor(...t),e.clear(!1,!0,!1),e.render(this._scene,this._camera),e.setViewport(...this._originalViewport),n&&e.setScissor(...this._originalScissor),e.autoClear=i,this}domUpdate(){this._domRect=this._domElement.getBoundingClientRect();const e=this.renderer,t=this._domRect,n=e.domElement.getBoundingClientRect();return this._viewport.splice(0,4,t.left-n.left,e.domElement.clientHeight-(t.top-n.top+t.height),t.width,t.height),e.getViewport(Rh).toArray(this._originalViewport),e.getScissorTest()&&e.getScissor(Rh).toArray(this._originalScissor),this}cameraUpdate(){return this._updateOrientation(),this}update(e=!0){return e&&this._controls&&this._controls.update(),this.domUpdate().cameraUpdate()}attachControls(e){return this.detachControls(),this.target=e.target,this._controlsListeners={start:()=>e.enabled=!1,end:()=>e.enabled=!0,change:()=>this.update(!1)},this.addEventListener("start",this._controlsListeners.start),this.addEventListener("end",this._controlsListeners.end),e.addEventListener("change",this._controlsListeners.change),this._controls=e,this}detachControls(){if(!(!this._controlsListeners||!this._controls))return this.target=new F().copy(this._controls.target),this.removeEventListener("start",this._controlsListeners.start),this.removeEventListener("end",this._controlsListeners.end),this._controls.removeEventListener("change",this._controlsListeners.change),this._controlsListeners=void 0,this._controls=void 0,this}dispose(){var e;this.detachControls(),this.children.forEach(t=>{var n,i,r,a;this.remove(t);const o=t;(n=o.material)==null||n.dispose(),(r=(i=o.material)==null?void 0:i.map)==null||r.dispose(),(a=o.geometry)==null||a.dispose()}),(e=this._domElement)==null||e.remove()}_updateOrientation(e=!0){e&&(this.quaternion.copy(this.camera.quaternion).invert(),this.updateMatrixWorld()),_h(this._options,this._intersections,this.camera)}_animate(){const{position:e,quaternion:t}=this.camera;if(e.set(0,0,1),!this.animated){e.applyQuaternion(this._quaternionEnd).multiplyScalar(this._distance).add(this.target),t.copy(this._targetQuaternion),this._updateOrientation(),this.animating=!1,this.dispatchEvent({type:"change"}),this.dispatchEvent({type:"end"});return}this._controls&&(this._controls.enabled=!1);const n=this._clock.getDelta()*xg*this.speed;this._quaternionStart.rotateTowards(this._quaternionEnd,n),e.applyQuaternion(this._quaternionStart).multiplyScalar(this._distance).add(this.target),t.rotateTowards(this._targetQuaternion,n),this._updateOrientation(),requestAnimationFrame(()=>this.dispatchEvent({type:"change"})),this._quaternionStart.angleTo(this._quaternionEnd)<uo&&(this._controls&&(this._controls.enabled=!0),this.animating=!1,this.dispatchEvent({type:"end"}))}_setOrientation(e){const t=this.camera,n=this.target;Hi.copy(e).multiplyScalar(this._distance),Ms.setPosition(Hi).lookAt(Hi,this.position,this.up),this._targetQuaternion.setFromRotationMatrix(Ms),Hi.add(n),Ms.lookAt(Hi,n,this.up),this._quaternionEnd.setFromRotationMatrix(Ms),Ms.setPosition(t.position).lookAt(t.position,n,this.up),this._quaternionStart.setFromRotationMatrix(Ms),this.animating=!0,this._clock.start(),this.dispatchEvent({type:"start"})}_onPointerDown(e){if(!this.enabled)return;const t=l=>{if(!this._dragging){if(vg(l,this._pointerStart))return;this._dragging=!0}const c=Og.set(l.clientX,l.clientY).sub(this._pointerStart).multiplyScalar(1/this._domRect.width*Math.PI),h=this.coordinateConversion(Hi.subVectors(this.camera.position,this.target)),d=Ch.setFromVector3(h);d.theta=a-c.x,d.phi=hl(o-c.y,uo,Math.PI-uo),this.coordinateConversion(this.camera.position.setFromSpherical(d),!0).add(this.target),this.camera.lookAt(this.target),this.quaternion.copy(this.camera.quaternion).invert(),this._updateOrientation(!1),this.dispatchEvent({type:"change"})},n=()=>{if(document.removeEventListener("pointermove",t,!1),document.removeEventListener("pointerup",n,!1),!this._dragging)return this._handleClick(e);this._focus&&(Ys(this._focus,!1),this._focus=null),this._dragging=!1,this.dispatchEvent({type:"end"})};if(this.animating)return;e.preventDefault(),this._pointerStart.set(e.clientX,e.clientY);const i=this.coordinateConversion(Hi.subVectors(this.camera.position,this.target)),r=Ch.setFromVector3(i),a=r.theta,o=r.phi;this._distance=r.radius,document.addEventListener("pointermove",t,!1),document.addEventListener("pointerup",n,!1),this.dispatchEvent({type:"start"})}coordinateConversion(e,t=!1){const{x:n,y:i,z:r}=e,a=It.DEFAULT_UP;return a.x===1?t?e.set(i,r,n):e.set(r,n,i):a.z===1?t?e.set(r,n,i):e.set(i,r,n):e}_onPointerMove(e){!this.enabled||this._dragging||(this._background&&Mh(this._background,!0),this._handleHover(e))}_onPointerLeave(){!this.enabled||this._dragging||(this._background&&Mh(this._background,!1),this._focus&&Ys(this._focus,!1),this._domElement.style.cursor="")}_handleClick(e){const t=yh(e,this._domRect,this._camera,this._intersections);this._focus&&(Ys(this._focus,!1),this._focus=null),t&&(this._setOrientation(t.object.position),this.dispatchEvent({type:"change"}))}_handleHover(e){const t=yh(e,this._domRect,this._camera,this._intersections),n=(t==null?void 0:t.object)||null;this._focus!==n&&(this._domElement.style.cursor=n?"pointer":"",this._focus&&Ys(this._focus,!1),(this._focus=n)?Ys(n,!0):_h(this._options,this._intersections,this.camera))}}const Bg=/^[og]\s*(.+)?/,kg=/^mtllib /,Vg=/^usemtl /,Hg=/^usemap /,Lh=/\s+/,Ph=new F,go=new F,Dh=new F,Nh=new F,Un=new F,Yr=new et;function Gg(){const s={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(e,t){if(this.object&&this.object.fromDeclaration===!1){this.object.name=e,this.object.fromDeclaration=t!==!1;return}const n=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:e||"",fromDeclaration:t!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(i,r){const a=this._finalize(!1);a&&(a.inherited||a.groupCount<=0)&&this.materials.splice(a.index,1);const o={index:this.materials.length,name:i||"",mtllib:Array.isArray(r)&&r.length>0?r[r.length-1]:"",smooth:a!==void 0?a.smooth:this.smooth,groupStart:a!==void 0?a.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(l){const c={index:typeof l=="number"?l:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return c.clone=this.clone.bind(c),c}};return this.materials.push(o),o},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(i){const r=this.currentMaterial();if(r&&r.groupEnd===-1&&(r.groupEnd=this.geometry.vertices.length/3,r.groupCount=r.groupEnd-r.groupStart,r.inherited=!1),i&&this.materials.length>1)for(let a=this.materials.length-1;a>=0;a--)this.materials[a].groupCount<=0&&this.materials.splice(a,1);return i&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),r}},n&&n.name&&typeof n.clone=="function"){const i=n.clone(0);i.inherited=!0,this.object.materials.push(i)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(e,t){const n=parseInt(e,10);return(n>=0?n-1:n+t/3)*3},parseNormalIndex:function(e,t){const n=parseInt(e,10);return(n>=0?n-1:n+t/3)*3},parseUVIndex:function(e,t){const n=parseInt(e,10);return(n>=0?n-1:n+t/2)*2},addVertex:function(e,t,n){const i=this.vertices,r=this.object.geometry.vertices;r.push(i[e+0],i[e+1],i[e+2]),r.push(i[t+0],i[t+1],i[t+2]),r.push(i[n+0],i[n+1],i[n+2])},addVertexPoint:function(e){const t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){const t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,n){const i=this.normals,r=this.object.geometry.normals;r.push(i[e+0],i[e+1],i[e+2]),r.push(i[t+0],i[t+1],i[t+2]),r.push(i[n+0],i[n+1],i[n+2])},addFaceNormal:function(e,t,n){const i=this.vertices,r=this.object.geometry.normals;Ph.fromArray(i,e),go.fromArray(i,t),Dh.fromArray(i,n),Un.subVectors(Dh,go),Nh.subVectors(Ph,go),Un.cross(Nh),Un.normalize(),r.push(Un.x,Un.y,Un.z),r.push(Un.x,Un.y,Un.z),r.push(Un.x,Un.y,Un.z)},addColor:function(e,t,n){const i=this.colors,r=this.object.geometry.colors;i[e]!==void 0&&r.push(i[e+0],i[e+1],i[e+2]),i[t]!==void 0&&r.push(i[t+0],i[t+1],i[t+2]),i[n]!==void 0&&r.push(i[n+0],i[n+1],i[n+2])},addUV:function(e,t,n){const i=this.uvs,r=this.object.geometry.uvs;r.push(i[e+0],i[e+1]),r.push(i[t+0],i[t+1]),r.push(i[n+0],i[n+1])},addDefaultUV:function(){const e=this.object.geometry.uvs;e.push(0,0),e.push(0,0),e.push(0,0)},addUVLine:function(e){const t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,n,i,r,a,o,l,c){const h=this.vertices.length;let d=this.parseVertexIndex(e,h),u=this.parseVertexIndex(t,h),f=this.parseVertexIndex(n,h);if(this.addVertex(d,u,f),this.addColor(d,u,f),o!==void 0&&o!==""){const m=this.normals.length;d=this.parseNormalIndex(o,m),u=this.parseNormalIndex(l,m),f=this.parseNormalIndex(c,m),this.addNormal(d,u,f)}else this.addFaceNormal(d,u,f);if(i!==void 0&&i!==""){const m=this.uvs.length;d=this.parseUVIndex(i,m),u=this.parseUVIndex(r,m),f=this.parseUVIndex(a,m),this.addUV(d,u,f),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(e){this.object.geometry.type="Points";const t=this.vertices.length;for(let n=0,i=e.length;n<i;n++){const r=this.parseVertexIndex(e[n],t);this.addVertexPoint(r),this.addColor(r)}},addLineGeometry:function(e,t){this.object.geometry.type="Line";const n=this.vertices.length,i=this.uvs.length;for(let r=0,a=e.length;r<a;r++)this.addVertexLine(this.parseVertexIndex(e[r],n));for(let r=0,a=t.length;r<a;r++)this.addUVLine(this.parseUVIndex(t[r],i))}};return s.startObject("",!1),s}class _o extends Xn{constructor(e){super(e),this.materials=null}load(e,t,n,i){const r=this,a=new Os(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(o){try{t(r.parse(o))}catch(l){i?i(l):console.error(l),r.manager.itemError(e)}},n,i)}setMaterials(e){return this.materials=e,this}parse(e){const t=new Gg;e.indexOf(`\r
|
|
4198
4198
|
`)!==-1&&(e=e.replace(/\r\n/g,`
|
|
4199
4199
|
`)),e.indexOf(`\\
|
|
4200
4200
|
`)!==-1&&(e=e.replace(/\\\n/g,""));const n=e.split(`
|
|
4201
|
-
`);let i=[];for(let o=0,l=n.length;o<l;o++){const c=n[o].trimStart();if(c.length===0)continue;const h=c.charAt(0);if(h!=="#")if(h==="v"){const
|
|
4202
|
-
`);let i={};const r=/\s+/,a={};for(let l=0;l<n.length;l++){let c=n[l];if(c=c.trim(),c.length===0||c.charAt(0)==="#")continue;const h=c.indexOf(" ");let
|
|
4203
|
-
`||N==="\r"?(p.trim().toLowerCase().startsWith("data")&&(E=!0),p=""):p+=N,g+=N}const U=g.search(/[\r\n]DATA\s(\S*)\s/i),L=/[\r\n]DATA\s(\S*)\s/i.exec(g.slice(U-1));if(m.data=L[1],m.headerLen=L[0].length+U,m.str=g.slice(0,m.headerLen),m.str=m.str.replace(/#.*/gi,""),m.version=/^VERSION (.*)/im.exec(m.str),m.fields=/^FIELDS (.*)/im.exec(m.str),m.size=/^SIZE (.*)/im.exec(m.str),m.type=/^TYPE (.*)/im.exec(m.str),m.count=/^COUNT (.*)/im.exec(m.str),m.width=/^WIDTH (.*)/im.exec(m.str),m.height=/^HEIGHT (.*)/im.exec(m.str),m.viewpoint=/^VIEWPOINT (.*)/im.exec(m.str),m.points=/^POINTS (.*)/im.exec(m.str),m.version!==null&&(m.version=parseFloat(m.version[1])),m.fields=m.fields!==null?m.fields[1].split(" "):[],m.type!==null&&(m.type=m.type[1].split(" ")),m.width!==null&&(m.width=parseInt(m.width[1])),m.height!==null&&(m.height=parseInt(m.height[1])),m.viewpoint!==null&&(m.viewpoint=m.viewpoint[1]),m.points!==null&&(m.points=parseInt(m.points[1],10)),m.points===null&&(m.points=m.width*m.height),m.size!==null&&(m.size=m.size[1].split(" ").map(function(N){return parseInt(N,10)})),m.count!==null)m.count=m.count[1].split(" ").map(function(N){return parseInt(N,10)});else{m.count=[];for(let N=0,b=m.fields.length;N<b;N++)m.count.push(1)}m.offset={};let D=0;for(let N=0,b=m.fields.length;N<b;N++)m.data==="ascii"?m.offset[m.fields[N]]=N:(m.offset[m.fields[N]]=D,D+=m.size[N]*m.count[N]);return m.rowSize=D,m}const i=n(e),r=[],a=[],o=[],l=[],c=[],h=new et;if(i.data==="ascii"){const
|
|
4204
|
-
`);for(let p=0,w=g.length;p<w;p++){if(g[p]==="")continue;const E=g[p].split(" ");if(d.x!==void 0&&(r.push(parseFloat(E[d.x])),r.push(parseFloat(E[d.y])),r.push(parseFloat(E[d.z]))),d.rgb!==void 0){const S=i.fields.findIndex(I=>I==="rgb"),U=i.type[S],L=parseFloat(E[d.rgb]);let D=L;if(U==="F"){const I=new Float32Array(1);I[0]=L,D=new Int32Array(I.buffer)[0]}const N=(D>>16&255)/255,b=(D>>8&255)/255,M=(D>>0&255)/255;h.setRGB(N,b,M,Tt),o.push(h.r,h.g,h.b)}d.normal_x!==void 0&&(a.push(parseFloat(E[d.normal_x])),a.push(parseFloat(E[d.normal_y])),a.push(parseFloat(E[d.normal_z]))),d.intensity!==void 0&&l.push(parseFloat(E[d.intensity])),d.label!==void 0&&c.push(parseInt(E[d.label]))}}if(i.data==="binary_compressed"){const d=new Uint32Array(e.slice(i.headerLen,i.headerLen+8)),m=d[0],_=d[1],g=t(new Uint8Array(e,i.headerLen+8,m),_),p=new DataView(g.buffer),w=i.offset;for(let E=0;E<i.points;E++){if(w.x!==void 0){const S=i.fields.indexOf("x"),U=i.fields.indexOf("y"),L=i.fields.indexOf("z");r.push(this._getDataView(p,i.points*w.x+i.size[S]*E,i.type[S],i.size[S])),r.push(this._getDataView(p,i.points*w.y+i.size[U]*E,i.type[U],i.size[U])),r.push(this._getDataView(p,i.points*w.z+i.size[L]*E,i.type[L],i.size[L]))}if(w.rgb!==void 0){const S=i.fields.indexOf("rgb"),U=p.getUint8(i.points*w.rgb+i.size[S]*E+2)/255,L=p.getUint8(i.points*w.rgb+i.size[S]*E+1)/255,D=p.getUint8(i.points*w.rgb+i.size[S]*E+0)/255;h.setRGB(U,L,D,Tt),o.push(h.r,h.g,h.b)}if(w.normal_x!==void 0){const S=i.fields.indexOf("normal_x"),U=i.fields.indexOf("normal_y"),L=i.fields.indexOf("normal_z");a.push(this._getDataView(p,i.points*w.normal_x+i.size[S]*E,i.type[S],i.size[S])),a.push(this._getDataView(p,i.points*w.normal_y+i.size[U]*E,i.type[U],i.size[U])),a.push(this._getDataView(p,i.points*w.normal_z+i.size[L]*E,i.type[L],i.size[L]))}if(w.intensity!==void 0){const S=i.fields.indexOf("intensity");l.push(this._getDataView(p,i.points*w.intensity+i.size[S]*E,i.type[S],i.size[S]))}if(w.label!==void 0){const S=i.fields.indexOf("label");c.push(p.getInt32(i.points*w.label+i.size[S]*E,this.littleEndian))}}}if(i.data==="binary"){const d=new DataView(e,i.headerLen),m=i.offset;for(let _=0,g=0;_<i.points;_++,g+=i.rowSize){if(m.x!==void 0){const p=i.fields.indexOf("x"),w=i.fields.indexOf("y"),E=i.fields.indexOf("z");r.push(this._getDataView(d,g+m.x,i.type[p],i.size[p])),r.push(this._getDataView(d,g+m.y,i.type[w],i.size[w])),r.push(this._getDataView(d,g+m.z,i.type[E],i.size[E]))}if(m.rgb!==void 0){const p=d.getUint8(g+m.rgb+2)/255,w=d.getUint8(g+m.rgb+1)/255,E=d.getUint8(g+m.rgb+0)/255;h.setRGB(p,w,E,Tt),o.push(h.r,h.g,h.b)}if(m.normal_x!==void 0){const p=i.fields.indexOf("normal_x"),w=i.fields.indexOf("normal_y"),E=i.fields.indexOf("normal_z");a.push(this._getDataView(d,g+m.normal_x,i.type[p],i.size[p])),a.push(this._getDataView(d,g+m.normal_y,i.type[w],i.size[w])),a.push(this._getDataView(d,g+m.normal_z,i.type[E],i.size[E]))}if(m.intensity!==void 0){const p=i.fields.indexOf("intensity");l.push(this._getDataView(d,g+m.intensity,i.type[p],i.size[p]))}m.label!==void 0&&c.push(d.getInt32(g+m.label,this.littleEndian))}}const f=new Bt;r.length>0&&f.setAttribute("position",new mt(r,3)),a.length>0&&f.setAttribute("normal",new mt(a,3)),o.length>0&&f.setAttribute("color",new mt(o,3)),l.length>0&&f.setAttribute("intensity",new mt(l,1)),c.length>0&&f.setAttribute("label",new Sf(c,1)),f.computeBoundingSphere();const u=new ji({size:.005});return o.length>0&&(u.vertexColors=!0),new Zs(f,u)}}class Uh extends _p{constructor(e){super(e)}parse(e){function t(B){switch(B.image_type){case u:case _:if(B.colormap_length>256||B.colormap_size!==24||B.colormap_type!==1)throw new Error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case d:case m:case g:case p:if(B.colormap_type)throw new Error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case f:throw new Error("THREE.TGALoader: No data.");default:throw new Error("THREE.TGALoader: Invalid type "+B.image_type)}if(B.width<=0||B.height<=0)throw new Error("THREE.TGALoader: Invalid image size.");if(B.pixel_size!==8&&B.pixel_size!==16&&B.pixel_size!==24&&B.pixel_size!==32)throw new Error("THREE.TGALoader: Invalid pixel size "+B.pixel_size)}function n(B,oe,j,ue,pe){let Me,Ue;const Ne=j.pixel_size>>3,Y=j.width*j.height*Ne;if(oe&&(Ue=pe.subarray(ue,ue+=j.colormap_length*(j.colormap_size>>3))),B){Me=new Uint8Array(Y);let se,re,le,Ee=0;const fe=new Uint8Array(Ne);for(;Ee<Y;)if(se=pe[ue++],re=(se&127)+1,se&128){for(le=0;le<Ne;++le)fe[le]=pe[ue++];for(le=0;le<re;++le)Me.set(fe,Ee+le*Ne);Ee+=Ne*re}else{for(re*=Ne,le=0;le<re;++le)Me[Ee+le]=pe[ue++];Ee+=re}}else Me=pe.subarray(ue,ue+=oe?j.width*j.height:Y);return{pixel_data:Me,palettes:Ue}}function i(B,oe,j,ue,pe,Me,Ue,Ne,Y){const se=Y;let re,le=0,Ee,fe;const be=M.width;for(fe=oe;fe!==ue;fe+=j)for(Ee=pe;Ee!==Ue;Ee+=Me,le++)re=Ne[le],B[(Ee+be*fe)*4+3]=255,B[(Ee+be*fe)*4+2]=se[re*3+0],B[(Ee+be*fe)*4+1]=se[re*3+1],B[(Ee+be*fe)*4+0]=se[re*3+2];return B}function r(B,oe,j,ue,pe,Me,Ue,Ne){let Y,se=0,re,le;const Ee=M.width;for(le=oe;le!==ue;le+=j)for(re=pe;re!==Ue;re+=Me,se+=2)Y=Ne[se+0]+(Ne[se+1]<<8),B[(re+Ee*le)*4+0]=(Y&31744)>>7,B[(re+Ee*le)*4+1]=(Y&992)>>2,B[(re+Ee*le)*4+2]=(Y&31)<<3,B[(re+Ee*le)*4+3]=Y&32768?0:255;return B}function a(B,oe,j,ue,pe,Me,Ue,Ne){let Y=0,se,re;const le=M.width;for(re=oe;re!==ue;re+=j)for(se=pe;se!==Ue;se+=Me,Y+=3)B[(se+le*re)*4+3]=255,B[(se+le*re)*4+2]=Ne[Y+0],B[(se+le*re)*4+1]=Ne[Y+1],B[(se+le*re)*4+0]=Ne[Y+2];return B}function o(B,oe,j,ue,pe,Me,Ue,Ne){let Y=0,se,re;const le=M.width;for(re=oe;re!==ue;re+=j)for(se=pe;se!==Ue;se+=Me,Y+=4)B[(se+le*re)*4+2]=Ne[Y+0],B[(se+le*re)*4+1]=Ne[Y+1],B[(se+le*re)*4+0]=Ne[Y+2],B[(se+le*re)*4+3]=Ne[Y+3];return B}function l(B,oe,j,ue,pe,Me,Ue,Ne){let Y,se=0,re,le;const Ee=M.width;for(le=oe;le!==ue;le+=j)for(re=pe;re!==Ue;re+=Me,se++)Y=Ne[se],B[(re+Ee*le)*4+0]=Y,B[(re+Ee*le)*4+1]=Y,B[(re+Ee*le)*4+2]=Y,B[(re+Ee*le)*4+3]=255;return B}function c(B,oe,j,ue,pe,Me,Ue,Ne){let Y=0,se,re;const le=M.width;for(re=oe;re!==ue;re+=j)for(se=pe;se!==Ue;se+=Me,Y+=2)B[(se+le*re)*4+0]=Ne[Y+0],B[(se+le*re)*4+1]=Ne[Y+0],B[(se+le*re)*4+2]=Ne[Y+0],B[(se+le*re)*4+3]=Ne[Y+1];return B}function h(B,oe,j,ue,pe){let Me,Ue,Ne,Y,se,re;switch((M.flags&w)>>E){default:case L:Me=0,Ne=1,se=oe,Ue=0,Y=1,re=j;break;case S:Me=0,Ne=1,se=oe,Ue=j-1,Y=-1,re=-1;break;case D:Me=oe-1,Ne=-1,se=-1,Ue=0,Y=1,re=j;break;case U:Me=oe-1,Ne=-1,se=-1,Ue=j-1,Y=-1,re=-1;break}if(H)switch(M.pixel_size){case 8:l(B,Ue,Y,re,Me,Ne,se,ue);break;case 16:c(B,Ue,Y,re,Me,Ne,se,ue);break;default:throw new Error("THREE.TGALoader: Format not supported.")}else switch(M.pixel_size){case 8:i(B,Ue,Y,re,Me,Ne,se,ue,pe);break;case 16:r(B,Ue,Y,re,Me,Ne,se,ue);break;case 24:a(B,Ue,Y,re,Me,Ne,se,ue);break;case 32:o(B,Ue,Y,re,Me,Ne,se,ue);break;default:throw new Error("THREE.TGALoader: Format not supported.")}return B}const f=0,u=1,d=2,m=3,_=9,g=10,p=11,w=48,E=4,S=0,U=1,L=2,D=3;if(e.length<19)throw new Error("THREE.TGALoader: Not enough data to contain header.");let N=0;const b=new Uint8Array(e),M={id_length:b[N++],colormap_type:b[N++],image_type:b[N++],colormap_index:b[N++]|b[N++]<<8,colormap_length:b[N++]|b[N++]<<8,colormap_size:b[N++],origin:[b[N++]|b[N++]<<8,b[N++]|b[N++]<<8],width:b[N++]|b[N++]<<8,height:b[N++]|b[N++]<<8,pixel_size:b[N++],flags:b[N++]};if(t(M),M.id_length+N>e.length)throw new Error("THREE.TGALoader: No data.");N+=M.id_length;let I=!1,V=!1,H=!1;switch(M.image_type){case _:I=!0,V=!0;break;case u:V=!0;break;case g:I=!0;break;case d:break;case p:I=!0,H=!0;break;case m:H=!0;break}const J=new Uint8Array(M.width*M.height*4),ie=n(I,V,M,N,b);return h(J,M.width,M.height,ie.pixel_data,ie.palettes),{data:J,width:M.width,height:M.height,flipY:!0,generateMipmaps:!0,minFilter:di}}}class qg extends Xn{load(e,t,n,i){const r=this,a=r.path===""?Bl.extractUrlBase(e):r.path,o=new Os(r.manager);o.setPath(r.path),o.setRequestHeader(r.requestHeader),o.setWithCredentials(r.withCredentials),o.load(e,function(l){try{t(r.parse(l,a))}catch(c){i?i(c):console.error(c),r.manager.itemError(e)}},n,i)}parse(e,t){function n(x,v){const R=[],A=x.childNodes;for(let P=0,te=A.length;P<te;P++){const ce=A[P];ce.nodeName===v&&R.push(ce)}return R}function i(x){if(x.length===0)return[];const v=x.trim().split(/\s+/),R=new Array(v.length);for(let A=0,P=v.length;A<P;A++)R[A]=v[A];return R}function r(x){if(x.length===0)return[];const v=x.trim().split(/\s+/),R=new Array(v.length);for(let A=0,P=v.length;A<P;A++)R[A]=parseFloat(v[A]);return R}function a(x){if(x.length===0)return[];const v=x.trim().split(/\s+/),R=new Array(v.length);for(let A=0,P=v.length;A<P;A++)R[A]=parseInt(v[A]);return R}function o(x){return x.substring(1)}function l(){return"three_default_"+ii++}function c(x){return Object.keys(x).length===0}function h(x){return{unit:f(n(x,"unit")[0]),upAxis:u(n(x,"up_axis")[0])}}function f(x){return x!==void 0&&x.hasAttribute("meter")===!0?parseFloat(x.getAttribute("meter")):1}function u(x){return x!==void 0?x.textContent:"Y_UP"}function d(x,v,R,A){const P=n(x,v)[0];if(P!==void 0){const te=n(P,R);for(let ce=0;ce<te.length;ce++)A(te[ce])}}function m(x,v){for(const R in x){const A=x[R];A.build=v(x[R])}}function _(x,v){return x.build!==void 0||(x.build=v(x)),x.build}function g(x){const v={sources:{},samplers:{},channels:{}};let R=!1;for(let A=0,P=x.childNodes.length;A<P;A++){const te=x.childNodes[A];if(te.nodeType!==1)continue;let ce;switch(te.nodeName){case"source":ce=te.getAttribute("id"),v.sources[ce]=ge(te);break;case"sampler":ce=te.getAttribute("id"),v.samplers[ce]=p(te);break;case"channel":ce=te.getAttribute("target"),v.channels[ce]=w(te);break;case"animation":g(te),R=!0;break;default:console.log(te)}}R===!1&&(ut.animations[x.getAttribute("id")||Xi.generateUUID()]=v)}function p(x){const v={inputs:{}};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"input":const te=o(P.getAttribute("source")),ce=P.getAttribute("semantic");v.inputs[ce]=te;break}}return v}function w(x){const v={};let A=x.getAttribute("target").split("/");const P=A.shift();let te=A.shift();const ce=te.indexOf("(")!==-1,He=te.indexOf(".")!==-1;if(He)A=te.split("."),te=A.shift(),v.member=A.shift();else if(ce){const Re=te.split("(");te=Re.shift();for(let Fe=0;Fe<Re.length;Fe++)Re[Fe]=parseInt(Re[Fe].replace(/\)/,""));v.indices=Re}return v.id=P,v.sid=te,v.arraySyntax=ce,v.memberSyntax=He,v.sampler=o(x.getAttribute("source")),v}function E(x){const v=[],R=x.channels,A=x.samplers,P=x.sources;for(const te in R)if(R.hasOwnProperty(te)){const ce=R[te],He=A[ce.sampler],Re=He.inputs.INPUT,Fe=He.inputs.OUTPUT,Ke=P[Re],_e=P[Fe],$e=U(ce,Ke,_e);M($e,v)}return v}function S(x){return _(ut.animations[x],E)}function U(x,v,R){const A=ut.nodes[x.id],P=gt(A.id),te=A.transforms[x.sid],ce=A.matrix.clone().transpose();let He,Re,Fe,Ke,_e,$e;const Xe={};switch(te){case"matrix":for(Fe=0,Ke=v.array.length;Fe<Ke;Fe++)if(He=v.array[Fe],Re=Fe*R.stride,Xe[He]===void 0&&(Xe[He]={}),x.arraySyntax===!0){const Vt=R.array[Re],Dt=x.indices[0]+4*x.indices[1];Xe[He][Dt]=Vt}else for(_e=0,$e=R.stride;_e<$e;_e++)Xe[He][_e]=R.array[Re+_e];break;case"translate":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',te);break;case"rotate":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',te);break;case"scale":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',te);break}const nt=L(Xe,ce);return{name:P.uuid,keyframes:nt}}function L(x,v){const R=[];for(const P in x)R.push({time:parseFloat(P),value:x[P]});R.sort(A);for(let P=0;P<16;P++)I(R,P,v.elements[P]);return R;function A(P,te){return P.time-te.time}}const D=new F,N=new F,b=new Pn;function M(x,v){const R=x.keyframes,A=x.name,P=[],te=[],ce=[],He=[];for(let Re=0,Fe=R.length;Re<Fe;Re++){const Ke=R[Re],_e=Ke.time,$e=Ke.value;X.fromArray($e).transpose(),X.decompose(D,b,N),P.push(_e),te.push(D.x,D.y,D.z),ce.push(b.x,b.y,b.z,b.w),He.push(N.x,N.y,N.z)}return te.length>0&&v.push(new Ns(A+".position",P,te)),ce.length>0&&v.push(new cr(A+".quaternion",P,ce)),He.length>0&&v.push(new Ns(A+".scale",P,He)),v}function I(x,v,R){let A,P=!0,te,ce;for(te=0,ce=x.length;te<ce;te++)A=x[te],A.value[v]===void 0?A.value[v]=null:P=!1;if(P===!0)for(te=0,ce=x.length;te<ce;te++)A=x[te],A.value[v]=R;else V(x,v)}function V(x,v){let R,A;for(let P=0,te=x.length;P<te;P++){const ce=x[P];if(ce.value[v]===null){if(R=H(x,P,v),A=J(x,P,v),R===null){ce.value[v]=A.value[v];continue}if(A===null){ce.value[v]=R.value[v];continue}ie(ce,R,A,v)}}}function H(x,v,R){for(;v>=0;){const A=x[v];if(A.value[R]!==null)return A;v--}return null}function J(x,v,R){for(;v<x.length;){const A=x[v];if(A.value[R]!==null)return A;v++}return null}function ie(x,v,R,A){if(R.time-v.time===0){x.value[A]=v.value[A];return}x.value[A]=(x.time-v.time)*(R.value[A]-v.value[A])/(R.time-v.time)+v.value[A]}function B(x){const v={name:x.getAttribute("id")||"default",start:parseFloat(x.getAttribute("start")||0),end:parseFloat(x.getAttribute("end")||0),animations:[]};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"instance_animation":v.animations.push(o(P.getAttribute("url")));break}}ut.clips[x.getAttribute("id")]=v}function oe(x){const v=[],R=x.name,A=x.end-x.start||-1,P=x.animations;for(let te=0,ce=P.length;te<ce;te++){const He=S(P[te]);for(let Re=0,Fe=He.length;Re<Fe;Re++)v.push(He[Re])}return new Oc(R,A,v)}function j(x){return _(ut.clips[x],oe)}function ue(x){const v={};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"skin":v.id=o(P.getAttribute("source")),v.skin=pe(P);break;case"morph":v.id=o(P.getAttribute("source")),console.warn("THREE.ColladaLoader: Morph target animation not supported yet.");break}}ut.controllers[x.getAttribute("id")]=v}function pe(x){const v={sources:{}};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"bind_shape_matrix":v.bindShapeMatrix=r(P.textContent);break;case"source":const te=P.getAttribute("id");v.sources[te]=ge(P);break;case"joints":v.joints=Me(P);break;case"vertex_weights":v.vertexWeights=Ue(P);break}}return v}function Me(x){const v={inputs:{}};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"input":const te=P.getAttribute("semantic"),ce=o(P.getAttribute("source"));v.inputs[te]=ce;break}}return v}function Ue(x){const v={inputs:{}};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"input":const te=P.getAttribute("semantic"),ce=o(P.getAttribute("source")),He=parseInt(P.getAttribute("offset"));v.inputs[te]={id:ce,offset:He};break;case"vcount":v.vcount=a(P.textContent);break;case"v":v.v=a(P.textContent);break}}return v}function Ne(x){const v={id:x.id},R=ut.geometries[v.id];return x.skin!==void 0&&(v.skin=Y(x.skin),R.sources.skinIndices=v.skin.indices,R.sources.skinWeights=v.skin.weights),v}function Y(x){const R={joints:[],indices:{array:[],stride:4},weights:{array:[],stride:4}},A=x.sources,P=x.vertexWeights,te=P.vcount,ce=P.v,He=P.inputs.JOINT.offset,Re=P.inputs.WEIGHT.offset,Fe=x.sources[x.joints.inputs.JOINT],Ke=x.sources[x.joints.inputs.INV_BIND_MATRIX],_e=A[P.inputs.WEIGHT.id].array;let $e=0,Xe,nt,Qe;for(Xe=0,Qe=te.length;Xe<Qe;Xe++){const Dt=te[Xe],wt=[];for(nt=0;nt<Dt;nt++){const At=ce[$e+He],si=ce[$e+Re],Mn=_e[si];wt.push({index:At,weight:Mn}),$e+=2}for(wt.sort(Vt),nt=0;nt<4;nt++){const At=wt[nt];At!==void 0?(R.indices.array.push(At.index),R.weights.array.push(At.weight)):(R.indices.array.push(0),R.weights.array.push(0))}}for(x.bindShapeMatrix?R.bindMatrix=new st().fromArray(x.bindShapeMatrix).transpose():R.bindMatrix=new st().identity(),Xe=0,Qe=Fe.array.length;Xe<Qe;Xe++){const Dt=Fe.array[Xe],wt=new st().fromArray(Ke.array,Xe*Ke.stride).transpose();R.joints.push({name:Dt,boneInverse:wt})}return R;function Vt(Dt,wt){return wt.weight-Dt.weight}}function se(x){return _(ut.controllers[x],Ne)}function re(x){const v={init_from:n(x,"init_from")[0].textContent};ut.images[x.getAttribute("id")]=v}function le(x){return x.build!==void 0?x.build:x.init_from}function Ee(x){const v=ut.images[x];return v!==void 0?_(v,le):(console.warn("THREE.ColladaLoader: Couldn't find image with ID:",x),null)}function fe(x){const v={};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"profile_COMMON":v.profile=be(P);break}}ut.effects[x.getAttribute("id")]=v}function be(x){const v={surfaces:{},samplers:{}};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"newparam":Je(P,v);break;case"technique":v.technique=z(P);break;case"extra":v.extra=ne(P);break}}return v}function Je(x,v){const R=x.getAttribute("sid");for(let A=0,P=x.childNodes.length;A<P;A++){const te=x.childNodes[A];if(te.nodeType===1)switch(te.nodeName){case"surface":v.surfaces[R]=at(te);break;case"sampler2D":v.samplers[R]=it(te);break}}}function at(x){const v={};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"init_from":v.init_from=P.textContent;break}}return v}function it(x){const v={};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"source":v.source=P.textContent;break}}return v}function z(x){const v={};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"constant":case"lambert":case"blinn":case"phong":v.type=P.nodeName,v.parameters=yt(P);break;case"extra":v.extra=ne(P);break}}return v}function yt(x){const v={};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"emission":case"diffuse":case"specular":case"bump":case"ambient":case"shininess":case"transparency":v[P.nodeName]=dt(P);break;case"transparent":v[P.nodeName]={opaque:P.hasAttribute("opaque")?P.getAttribute("opaque"):"A_ONE",data:dt(P)};break}}return v}function dt(x){const v={};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"color":v[P.nodeName]=r(P.textContent);break;case"float":v[P.nodeName]=parseFloat(P.textContent);break;case"texture":v[P.nodeName]={id:P.getAttribute("texture"),extra:ot(P)};break}}return v}function ot(x){const v={technique:{}};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"extra":W(P,v);break}}return v}function W(x,v){for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"technique":ae(P,v);break}}}function ae(x,v){for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"repeatU":case"repeatV":case"offsetU":case"offsetV":v.technique[P.nodeName]=parseFloat(P.textContent);break;case"wrapU":case"wrapV":P.textContent.toUpperCase()==="TRUE"?v.technique[P.nodeName]=1:P.textContent.toUpperCase()==="FALSE"?v.technique[P.nodeName]=0:v.technique[P.nodeName]=parseInt(P.textContent);break;case"bump":v[P.nodeName]=Oe(P);break}}}function ne(x){const v={};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"technique":v.technique=ye(P);break}}return v}function ye(x){const v={};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"double_sided":v[P.nodeName]=parseInt(P.textContent);break;case"bump":v[P.nodeName]=Oe(P);break}}return v}function Oe(x){const v={};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"texture":v[P.nodeName]={id:P.getAttribute("texture"),texcoord:P.getAttribute("texcoord"),extra:ot(P)};break}}return v}function T(x){return x}function y(x){return _(ut.effects[x],T)}function k(x){const v={name:x.getAttribute("name")};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"instance_effect":v.url=o(P.getAttribute("url"));break}}ut.materials[x.getAttribute("id")]=v}function K(x){let v,R=x.slice((x.lastIndexOf(".")-1>>>0)+2);switch(R=R.toLowerCase(),R){case"tga":v=ln;break;default:v=fn}return v}function Q(x){const v=y(x.url),R=v.profile.technique;let A;switch(R.type){case"phong":case"blinn":A=new Sn;break;case"lambert":A=new ip;break;default:A=new Pi;break}A.name=x.name||"";function P(Re,Fe=null){const Ke=v.profile.samplers[Re.id];let _e=null;if(Ke!==void 0){const $e=v.profile.surfaces[Ke.source];_e=Ee($e.init_from)}else console.warn("THREE.ColladaLoader: Undefined sampler. Access image directly (see #12530)."),_e=Ee(Re.id);if(_e!==null){const $e=K(_e);if($e!==void 0){const Xe=$e.load(_e),nt=Re.extra;if(nt!==void 0&&nt.technique!==void 0&&c(nt.technique)===!1){const Qe=nt.technique;Xe.wrapS=Qe.wrapU?Zn:Hn,Xe.wrapT=Qe.wrapV?Zn:Hn,Xe.offset.set(Qe.offsetU||0,Qe.offsetV||0),Xe.repeat.set(Qe.repeatU||1,Qe.repeatV||1)}else Xe.wrapS=Zn,Xe.wrapT=Zn;return Fe!==null&&(Xe.colorSpace=Fe),Xe}else return console.warn("THREE.ColladaLoader: Loader for texture %s not found.",_e),null}else return console.warn("THREE.ColladaLoader: Couldn't create texture with ID:",Re.id),null}const te=R.parameters;for(const Re in te){const Fe=te[Re];switch(Re){case"diffuse":Fe.color&&A.color.fromArray(Fe.color),Fe.texture&&(A.map=P(Fe.texture,Tt));break;case"specular":Fe.color&&A.specular&&A.specular.fromArray(Fe.color),Fe.texture&&(A.specularMap=P(Fe.texture));break;case"bump":Fe.texture&&(A.normalMap=P(Fe.texture));break;case"ambient":Fe.texture&&(A.lightMap=P(Fe.texture,Tt));break;case"shininess":Fe.float&&A.shininess&&(A.shininess=Fe.float);break;case"emission":Fe.color&&A.emissive&&A.emissive.fromArray(Fe.color),Fe.texture&&(A.emissiveMap=P(Fe.texture,Tt));break}}Mt.colorSpaceToWorking(A.color,Tt),A.specular&&Mt.colorSpaceToWorking(A.specular,Tt),A.emissive&&Mt.colorSpaceToWorking(A.emissive,Tt);let ce=te.transparent,He=te.transparency;if(He===void 0&&ce&&(He={float:1}),ce===void 0&&He&&(ce={opaque:"A_ONE",data:{color:[1,1,1,1]}}),ce&&He)if(ce.data.texture)A.transparent=!0;else{const Re=ce.data.color;switch(ce.opaque){case"A_ONE":A.opacity=Re[3]*He.float;break;case"RGB_ZERO":A.opacity=1-Re[0]*He.float;break;case"A_ZERO":A.opacity=1-Re[3]*He.float;break;case"RGB_ONE":A.opacity=Re[0]*He.float;break;default:console.warn('THREE.ColladaLoader: Invalid opaque type "%s" of transparent tag.',ce.opaque)}A.opacity<1&&(A.transparent=!0)}if(R.extra!==void 0&&R.extra.technique!==void 0){const Re=R.extra.technique;for(const Fe in Re){const Ke=Re[Fe];switch(Fe){case"double_sided":A.side=Ke===1?un:Wn;break;case"bump":A.normalMap=P(Ke.texture),A.normalScale=new Be(1,1);break}}}return A}function O(x){return _(ut.materials[x],Q)}function we(x){const v={name:x.getAttribute("name")};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"optics":v.optics=xe(P);break}}ut.cameras[x.getAttribute("id")]=v}function xe(x){for(let v=0;v<x.childNodes.length;v++){const R=x.childNodes[v];switch(R.nodeName){case"technique_common":return Se(R)}}return{}}function Se(x){const v={};for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];switch(A.nodeName){case"perspective":case"orthographic":v.technique=A.nodeName,v.parameters=Ie(A);break}}return v}function Ie(x){const v={};for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];switch(A.nodeName){case"xfov":case"yfov":case"xmag":case"ymag":case"znear":case"zfar":case"aspect_ratio":v[A.nodeName]=parseFloat(A.textContent);break}}return v}function de(x){let v;switch(x.optics.technique){case"perspective":v=new an(x.optics.parameters.yfov,x.optics.parameters.aspect_ratio,x.optics.parameters.znear,x.optics.parameters.zfar);break;case"orthographic":let R=x.optics.parameters.ymag,A=x.optics.parameters.xmag;const P=x.optics.parameters.aspect_ratio;A=A===void 0?R*P:A,R=R===void 0?A/P:R,A*=.5,R*=.5,v=new Sa(-A,A,R,-R,x.optics.parameters.znear,x.optics.parameters.zfar);break;default:v=new an;break}return v.name=x.name||"",v}function Pe(x){const v=ut.cameras[x];return v!==void 0?_(v,de):(console.warn("THREE.ColladaLoader: Couldn't find camera with ID:",x),null)}function qe(x){let v={};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"technique_common":v=ke(P);break}}ut.lights[x.getAttribute("id")]=v}function ke(x){const v={};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"directional":case"point":case"spot":case"ambient":v.technique=P.nodeName,v.parameters=Ae(P)}}return v}function Ae(x){const v={};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"color":const te=r(P.textContent);v.color=new et().fromArray(te),Mt.colorSpaceToWorking(v.color,Tt);break;case"falloff_angle":v.falloffAngle=parseFloat(P.textContent);break;case"quadratic_attenuation":const ce=parseFloat(P.textContent);v.distance=ce?Math.sqrt(1/ce):0;break}}return v}function rt(x){let v;switch(x.technique){case"directional":v=new yu;break;case"point":v=new xu;break;case"spot":v=new yp;break;case"ambient":v=new Mu;break}return x.parameters.color&&v.color.copy(x.parameters.color),x.parameters.distance&&(v.distance=x.parameters.distance),v}function G(x){const v=ut.lights[x];return v!==void 0?_(v,rt):(console.warn("THREE.ColladaLoader: Couldn't find light with ID:",x),null)}function De(x){const v={name:x.getAttribute("name"),sources:{},vertices:{},primitives:[]},R=n(x,"mesh")[0];if(R!==void 0){for(let A=0;A<R.childNodes.length;A++){const P=R.childNodes[A];if(P.nodeType!==1)continue;const te=P.getAttribute("id");switch(P.nodeName){case"source":v.sources[te]=ge(P);break;case"vertices":v.vertices=ze(P);break;case"polygons":console.warn("THREE.ColladaLoader: Unsupported primitive type: ",P.nodeName);break;case"lines":case"linestrips":case"polylist":case"triangles":v.primitives.push(ve(P));break;default:console.log(P)}}ut.geometries[x.getAttribute("id")]=v}}function ge(x){const v={array:[],stride:3};for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];if(A.nodeType===1)switch(A.nodeName){case"float_array":v.array=r(A.textContent);break;case"Name_array":v.array=i(A.textContent);break;case"technique_common":const P=n(A,"accessor")[0];P!==void 0&&(v.stride=parseInt(P.getAttribute("stride")));break}}return v}function ze(x){const v={};for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];A.nodeType===1&&(v[A.getAttribute("semantic")]=o(A.getAttribute("source")))}return v}function ve(x){const v={type:x.nodeName,material:x.getAttribute("material"),count:parseInt(x.getAttribute("count")),inputs:{},stride:0,hasUV:!1};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"input":const te=o(P.getAttribute("source")),ce=P.getAttribute("semantic"),He=parseInt(P.getAttribute("offset")),Re=parseInt(P.getAttribute("set")),Fe=Re>0?ce+Re:ce;v.inputs[Fe]={id:te,offset:He},v.stride=Math.max(v.stride,He+1),ce==="TEXCOORD"&&(v.hasUV=!0);break;case"vcount":v.vcount=a(P.textContent);break;case"p":v.p=a(P.textContent);break}}return v}function he(x){const v={};for(let R=0;R<x.length;R++){const A=x[R];v[A.type]===void 0&&(v[A.type]=[]),v[A.type].push(A)}return v}function Ge(x){let v=0;for(let R=0,A=x.length;R<A;R++)x[R].hasUV===!0&&v++;v>0&&v<x.length&&(x.uvsNeedsFix=!0)}function lt(x){const v={},R=x.sources,A=x.vertices,P=x.primitives;if(P.length===0)return{};const te=he(P);for(const ce in te){const He=te[ce];Ge(He),v[ce]=Lt(He,R,A)}return v}function Lt(x,v,R){const A={},P={array:[],stride:0},te={array:[],stride:0},ce={array:[],stride:0},He={array:[],stride:0},Re={array:[],stride:0},Fe={array:[],stride:4},Ke={array:[],stride:4},_e=new Bt,$e=[];let Xe=0;for(let nt=0;nt<x.length;nt++){const Qe=x[nt],Vt=Qe.inputs;let Dt=0;switch(Qe.type){case"lines":case"linestrips":Dt=Qe.count*2;break;case"triangles":Dt=Qe.count*3;break;case"polylist":for(let wt=0;wt<Qe.count;wt++){const At=Qe.vcount[wt];switch(At){case 3:Dt+=3;break;case 4:Dt+=6;break;default:Dt+=(At-2)*3;break}}break;default:console.warn("THREE.ColladaLoader: Unknown primitive type:",Qe.type)}_e.addGroup(Xe,Dt,nt),Xe+=Dt,Qe.material&&$e.push(Qe.material);for(const wt in Vt){const At=Vt[wt];switch(wt){case"VERTEX":for(const si in R){const Mn=R[si];switch(si){case"POSITION":const ns=P.array.length;if(pt(Qe,v[Mn],At.offset,P.array),P.stride=v[Mn].stride,v.skinWeights&&v.skinIndices&&(pt(Qe,v.skinIndices,At.offset,Fe.array),pt(Qe,v.skinWeights,At.offset,Ke.array)),Qe.hasUV===!1&&x.uvsNeedsFix===!0){const Hu=(P.array.length-ns)/P.stride;for(let Wl=0;Wl<Hu;Wl++)ce.array.push(0,0)}break;case"NORMAL":pt(Qe,v[Mn],At.offset,te.array),te.stride=v[Mn].stride;break;case"COLOR":pt(Qe,v[Mn],At.offset,Re.array),Re.stride=v[Mn].stride;break;case"TEXCOORD":pt(Qe,v[Mn],At.offset,ce.array),ce.stride=v[Mn].stride;break;case"TEXCOORD1":pt(Qe,v[Mn],At.offset,He.array),ce.stride=v[Mn].stride;break;default:console.warn('THREE.ColladaLoader: Semantic "%s" not handled in geometry build process.',si)}}break;case"NORMAL":pt(Qe,v[At.id],At.offset,te.array),te.stride=v[At.id].stride;break;case"COLOR":pt(Qe,v[At.id],At.offset,Re.array,!0),Re.stride=v[At.id].stride;break;case"TEXCOORD":pt(Qe,v[At.id],At.offset,ce.array),ce.stride=v[At.id].stride;break;case"TEXCOORD1":pt(Qe,v[At.id],At.offset,He.array),He.stride=v[At.id].stride;break}}}return P.array.length>0&&_e.setAttribute("position",new mt(P.array,P.stride)),te.array.length>0&&_e.setAttribute("normal",new mt(te.array,te.stride)),Re.array.length>0&&_e.setAttribute("color",new mt(Re.array,Re.stride)),ce.array.length>0&&_e.setAttribute("uv",new mt(ce.array,ce.stride)),He.array.length>0&&_e.setAttribute("uv1",new mt(He.array,He.stride)),Fe.array.length>0&&_e.setAttribute("skinIndex",new mt(Fe.array,Fe.stride)),Ke.array.length>0&&_e.setAttribute("skinWeight",new mt(Ke.array,Ke.stride)),A.data=_e,A.type=x[0].type,A.materialKeys=$e,A}function pt(x,v,R,A,P=!1){const te=x.p,ce=x.stride,He=x.vcount;function Re(_e){let $e=te[_e+R]*Ke;const Xe=$e+Ke;for(;$e<Xe;$e++)A.push(Fe[$e]);if(P){const nt=A.length-Ke-1;Wt.setRGB(A[nt+0],A[nt+1],A[nt+2],Tt),A[nt+0]=Wt.r,A[nt+1]=Wt.g,A[nt+2]=Wt.b}}const Fe=v.array,Ke=v.stride;if(x.vcount!==void 0){let _e=0;for(let $e=0,Xe=He.length;$e<Xe;$e++){const nt=He[$e];if(nt===4){const Qe=_e+ce*0,Vt=_e+ce*1,Dt=_e+ce*2,wt=_e+ce*3;Re(Qe),Re(Vt),Re(wt),Re(Vt),Re(Dt),Re(wt)}else if(nt===3){const Qe=_e+ce*0,Vt=_e+ce*1,Dt=_e+ce*2;Re(Qe),Re(Vt),Re(Dt)}else if(nt>4)for(let Qe=1,Vt=nt-2;Qe<=Vt;Qe++){const Dt=_e+ce*0,wt=_e+ce*Qe,At=_e+ce*(Qe+1);Re(Dt),Re(wt),Re(At)}_e+=ce*nt}}else for(let _e=0,$e=te.length;_e<$e;_e+=ce)Re(_e)}function en(x){return _(ut.geometries[x],lt)}function vn(x){const v={name:x.getAttribute("name")||"",joints:{},links:[]};for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];if(A.nodeType===1)switch(A.nodeName){case"technique_common":je(A,v);break}}ut.kinematicsModels[x.getAttribute("id")]=v}function Di(x){return x.build!==void 0?x.build:x}function Ni(x){return _(ut.kinematicsModels[x],Di)}function je(x,v){for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];if(A.nodeType===1)switch(A.nodeName){case"joint":v.joints[A.getAttribute("sid")]=qt(A);break;case"link":v.links.push(wn(A));break}}}function qt(x){let v;for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];if(A.nodeType===1)switch(A.nodeName){case"prismatic":case"revolute":v=jt(A);break}}return v}function jt(x){const v={sid:x.getAttribute("sid"),name:x.getAttribute("name")||"",axis:new F,limits:{min:0,max:0},type:x.nodeName,static:!1,zeroPosition:0,middlePosition:0};for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];if(A.nodeType===1)switch(A.nodeName){case"axis":const P=r(A.textContent);v.axis.fromArray(P);break;case"limits":const te=A.getElementsByTagName("max")[0],ce=A.getElementsByTagName("min")[0];v.limits.max=parseFloat(te.textContent),v.limits.min=parseFloat(ce.textContent);break}}return v.limits.min>=v.limits.max&&(v.static=!0),v.middlePosition=(v.limits.min+v.limits.max)/2,v}function wn(x){const v={sid:x.getAttribute("sid"),name:x.getAttribute("name")||"",attachments:[],transforms:[]};for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];if(A.nodeType===1)switch(A.nodeName){case"attachment_full":v.attachments.push(vi(A));break;case"matrix":case"translate":case"rotate":v.transforms.push(Yn(A));break}}return v}function vi(x){const v={joint:x.getAttribute("joint").split("/").pop(),transforms:[],links:[]};for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];if(A.nodeType===1)switch(A.nodeName){case"link":v.links.push(wn(A));break;case"matrix":case"translate":case"rotate":v.transforms.push(Yn(A));break}}return v}function Yn(x){const v={type:x.nodeName},R=r(x.textContent);switch(v.type){case"matrix":v.obj=new st,v.obj.fromArray(R).transpose();break;case"translate":v.obj=new F,v.obj.fromArray(R);break;case"rotate":v.obj=new F,v.obj.fromArray(R),v.angle=Xi.degToRad(R[3]);break}return v}function Ye(x){const v={name:x.getAttribute("name")||"",rigidBodies:{}};for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];if(A.nodeType===1)switch(A.nodeName){case"rigid_body":v.rigidBodies[A.getAttribute("name")]={},Te(A,v.rigidBodies[A.getAttribute("name")]);break}}ut.physicsModels[x.getAttribute("id")]=v}function Te(x,v){for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];if(A.nodeType===1)switch(A.nodeName){case"technique_common":Gt(A,v);break}}}function Gt(x,v){for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];if(A.nodeType===1)switch(A.nodeName){case"inertia":v.inertia=r(A.textContent);break;case"mass":v.mass=r(A.textContent)[0];break}}}function xn(x){const v={bindJointAxis:[]};for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];if(A.nodeType===1)switch(A.nodeName){case"bind_joint_axis":v.bindJointAxis.push(Yt(A));break}}ut.kinematicsScenes[o(x.getAttribute("url"))]=v}function Yt(x){const v={target:x.getAttribute("target").split("/").pop()};for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];if(A.nodeType===1)switch(A.nodeName){case"axis":const P=A.getElementsByTagName("param")[0];v.axis=P.textContent;const te=v.axis.split("inst_").pop().split("axis")[0];v.jointIndex=te.substring(0,te.length-1);break}}return v}function dn(x){return x.build!==void 0?x.build:x}function An(x){return _(ut.kinematicsScenes[x],dn)}function Qi(){const x=Object.keys(ut.kinematicsModels)[0],v=Object.keys(ut.kinematicsScenes)[0],R=Object.keys(ut.visualScenes)[0];if(x===void 0||v===void 0)return;const A=Ni(x),P=An(v),te=St(R),ce=P.bindJointAxis,He={};for(let Ke=0,_e=ce.length;Ke<_e;Ke++){const $e=ce[Ke],Xe=zt.querySelector('[sid="'+$e.target+'"]');if(Xe){const nt=Xe.parentElement;Re($e.jointIndex,nt)}}function Re(Ke,_e){const $e=_e.getAttribute("name"),Xe=A.joints[Ke];te.traverse(function(nt){nt.name===$e&&(He[Ke]={object:nt,transforms:es(_e),joint:Xe,position:Xe.zeroPosition})})}const Fe=new st;ts={joints:A&&A.joints,getJointValue:function(Ke){const _e=He[Ke];if(_e)return _e.position;console.warn("THREE.ColladaLoader: Joint "+Ke+" doesn't exist.")},setJointValue:function(Ke,_e){const $e=He[Ke];if($e){const Xe=$e.joint;if(_e>Xe.limits.max||_e<Xe.limits.min)console.warn("THREE.ColladaLoader: Joint "+Ke+" value "+_e+" outside of limits (min: "+Xe.limits.min+", max: "+Xe.limits.max+").");else if(Xe.static)console.warn("THREE.ColladaLoader: Joint "+Ke+" is static.");else{const nt=$e.object,Qe=Xe.axis,Vt=$e.transforms;X.identity();for(let Dt=0;Dt<Vt.length;Dt++){const wt=Vt[Dt];if(wt.sid&&wt.sid.indexOf(Ke)!==-1)switch(Xe.type){case"revolute":X.multiply(Fe.makeRotationAxis(Qe,Xi.degToRad(_e)));break;case"prismatic":X.multiply(Fe.makeTranslation(Qe.x*_e,Qe.y*_e,Qe.z*_e));break;default:console.warn("THREE.ColladaLoader: Unknown joint type: "+Xe.type);break}else switch(wt.type){case"matrix":X.multiply(wt.obj);break;case"translate":X.multiply(Fe.makeTranslation(wt.obj.x,wt.obj.y,wt.obj.z));break;case"scale":X.scale(wt.obj);break;case"rotate":X.multiply(Fe.makeRotationAxis(wt.obj,wt.angle));break}}nt.matrix.copy(X),nt.matrix.decompose(nt.position,nt.quaternion,nt.scale),He[Ke].position=_e}}else console.log("THREE.ColladaLoader: "+Ke+" does not exist.")}}}function es(x){const v=[],R=zt.querySelector('[id="'+x.id+'"]');for(let A=0;A<R.childNodes.length;A++){const P=R.childNodes[A];if(P.nodeType!==1)continue;let te,ce;switch(P.nodeName){case"matrix":te=r(P.textContent);const He=new st().fromArray(te).transpose();v.push({sid:P.getAttribute("sid"),type:P.nodeName,obj:He});break;case"translate":case"scale":te=r(P.textContent),ce=new F().fromArray(te),v.push({sid:P.getAttribute("sid"),type:P.nodeName,obj:ce});break;case"rotate":te=r(P.textContent),ce=new F().fromArray(te);const Re=Xi.degToRad(te[3]);v.push({sid:P.getAttribute("sid"),type:P.nodeName,obj:ce,angle:Re});break}}return v}function C(x){const v=x.getElementsByTagName("node");for(let R=0;R<v.length;R++){const A=v[R];A.hasAttribute("id")===!1&&A.setAttribute("id",l())}}const X=new st,Z=new F;function ee(x){const v={name:x.getAttribute("name")||"",type:x.getAttribute("type"),id:x.getAttribute("id"),sid:x.getAttribute("sid"),matrix:new st,nodes:[],instanceCameras:[],instanceControllers:[],instanceLights:[],instanceGeometries:[],instanceNodes:[],transforms:{}};for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];if(A.nodeType!==1)continue;let P;switch(A.nodeName){case"node":v.nodes.push(A.getAttribute("id")),ee(A);break;case"instance_camera":v.instanceCameras.push(o(A.getAttribute("url")));break;case"instance_controller":v.instanceControllers.push(q(A));break;case"instance_light":v.instanceLights.push(o(A.getAttribute("url")));break;case"instance_geometry":v.instanceGeometries.push(q(A));break;case"instance_node":v.instanceNodes.push(o(A.getAttribute("url")));break;case"matrix":P=r(A.textContent),v.matrix.multiply(X.fromArray(P).transpose()),v.transforms[A.getAttribute("sid")]=A.nodeName;break;case"translate":P=r(A.textContent),Z.fromArray(P),v.matrix.multiply(X.makeTranslation(Z.x,Z.y,Z.z)),v.transforms[A.getAttribute("sid")]=A.nodeName;break;case"rotate":P=r(A.textContent);const te=Xi.degToRad(P[3]);v.matrix.multiply(X.makeRotationAxis(Z.fromArray(P),te)),v.transforms[A.getAttribute("sid")]=A.nodeName;break;case"scale":P=r(A.textContent),v.matrix.scale(Z.fromArray(P)),v.transforms[A.getAttribute("sid")]=A.nodeName;break;case"extra":break;default:console.log(A)}}return Ze(v.id)?console.warn("THREE.ColladaLoader: There is already a node with ID %s. Exclude current node from further processing.",v.id):ut.nodes[v.id]=v,v}function q(x){const v={id:o(x.getAttribute("url")),materials:{},skeletons:[]};for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];switch(A.nodeName){case"bind_material":const P=A.getElementsByTagName("instance_material");for(let te=0;te<P.length;te++){const ce=P[te],He=ce.getAttribute("symbol"),Re=ce.getAttribute("target");v.materials[He]=o(Re)}break;case"skeleton":v.skeletons.push(o(A.textContent));break}}return v}function me(x,v){const R=[],A=[];let P,te,ce;for(P=0;P<x.length;P++){const Fe=x[P];let Ke;if(Ze(Fe))Ke=gt(Fe),Ce(Ke,v,R);else if(kt(Fe)){const $e=ut.visualScenes[Fe].children;for(let Xe=0;Xe<$e.length;Xe++){const nt=$e[Xe];if(nt.type==="JOINT"){const Qe=gt(nt.id);Ce(Qe,v,R)}}}else console.error("THREE.ColladaLoader: Unable to find root bone of skeleton with ID:",Fe)}for(P=0;P<v.length;P++)for(te=0;te<R.length;te++)if(ce=R[te],ce.bone.name===v[P].name){A[P]=ce,ce.processed=!0;break}for(P=0;P<R.length;P++)ce=R[P],ce.processed===!1&&(A.push(ce),ce.processed=!0);const He=[],Re=[];for(P=0;P<A.length;P++)ce=A[P],He.push(ce.bone),Re.push(ce.boneInverse);return new Ll(He,Re)}function Ce(x,v,R){x.traverse(function(A){if(A.isBone===!0){let P;for(let te=0;te<v.length;te++){const ce=v[te];if(ce.name===A.name){P=ce.boneInverse;break}}P===void 0&&(P=new st),R.push({bone:A,boneInverse:P,processed:!1})}})}function We(x){const v=[],R=x.matrix,A=x.nodes,P=x.type,te=x.instanceCameras,ce=x.instanceControllers,He=x.instanceLights,Re=x.instanceGeometries,Fe=x.instanceNodes;for(let _e=0,$e=A.length;_e<$e;_e++)v.push(gt(A[_e]));for(let _e=0,$e=te.length;_e<$e;_e++){const Xe=Pe(te[_e]);Xe!==null&&v.push(Xe.clone())}for(let _e=0,$e=ce.length;_e<$e;_e++){const Xe=ce[_e],nt=se(Xe.id),Qe=en(nt.id),Vt=ht(Qe,Xe.materials),Dt=Xe.skeletons,wt=nt.skin.joints,At=me(Dt,wt);for(let si=0,Mn=Vt.length;si<Mn;si++){const ns=Vt[si];ns.isSkinnedMesh&&(ns.bind(At,nt.skin.bindMatrix),ns.normalizeSkinWeights()),v.push(ns)}}for(let _e=0,$e=He.length;_e<$e;_e++){const Xe=G(He[_e]);Xe!==null&&v.push(Xe.clone())}for(let _e=0,$e=Re.length;_e<$e;_e++){const Xe=Re[_e],nt=en(Xe.id),Qe=ht(nt,Xe.materials);for(let Vt=0,Dt=Qe.length;Vt<Dt;Vt++)v.push(Qe[Vt])}for(let _e=0,$e=Fe.length;_e<$e;_e++)v.push(gt(Fe[_e]).clone());let Ke;if(A.length===0&&v.length===1)Ke=v[0];else{Ke=P==="JOINT"?new uu:new ei;for(let _e=0;_e<v.length;_e++)Ke.add(v[_e])}return Ke.name=P==="JOINT"?x.sid:x.name,Ke.matrix.copy(R),Ke.matrix.decompose(Ke.position,Ke.quaternion,Ke.scale),Ke}const Ve=new Pi({name:Xn.DEFAULT_MATERIAL_NAME,color:16711935});function ct(x,v){const R=[];for(let A=0,P=x.length;A<P;A++){const te=v[x[A]];te===void 0?(console.warn("THREE.ColladaLoader: Material with key %s not found. Apply fallback material.",x[A]),R.push(Ve)):R.push(O(te))}return R}function ht(x,v){const R=[];for(const A in x){const P=x[A],te=ct(P.materialKeys,v);if(te.length===0&&(A==="lines"||A==="linestrips"?te.push(new Li):te.push(new Sn)),A==="lines"||A==="linestrips")for(let Fe=0,Ke=te.length;Fe<Ke;Fe++){const _e=te[Fe];if(_e.isMeshPhongMaterial===!0||_e.isMeshLambertMaterial===!0){const $e=new Li;$e.color.copy(_e.color),$e.opacity=_e.opacity,$e.transparent=_e.transparent,te[Fe]=$e}}const ce=P.data.attributes.skinIndex!==void 0,He=te.length===1?te[0]:te;let Re;switch(A){case"lines":Re=new pa(P.data,He);break;case"linestrips":Re=new Dl(P.data,He);break;case"triangles":case"polylist":ce?Re=new Uf(P.data,He):Re=new Ct(P.data,He);break}R.push(Re)}return R}function Ze(x){return ut.nodes[x]!==void 0}function gt(x){return _(ut.nodes[x],We)}function Rt(x){const v={name:x.getAttribute("name"),children:[]};C(x);const R=n(x,"node");for(let A=0;A<R.length;A++)v.children.push(ee(R[A]));ut.visualScenes[x.getAttribute("id")]=v}function Ot(x){const v=new ei;v.name=x.name;const R=x.children;for(let A=0;A<R.length;A++){const P=R[A];v.add(gt(P.id))}return v}function kt(x){return ut.visualScenes[x]!==void 0}function St(x){return _(ut.visualScenes[x],Ot)}function tt(x){const v=n(x,"instance_visual_scene")[0];return St(o(v.getAttribute("url")))}function $t(){const x=ut.clips;if(c(x)===!0){if(c(ut.animations)===!1){const v=[];for(const R in ut.animations){const A=S(R);for(let P=0,te=A.length;P<te;P++)v.push(A[P])}Jt.push(new Oc("default",-1,v))}}else for(const v in x)Jt.push(j(v))}function Et(x){let v="";const R=[x];for(;R.length;){const A=R.shift();A.nodeType===Node.TEXT_NODE?v+=A.textContent:(v+=`
|
|
4201
|
+
`);let i=[];for(let o=0,l=n.length;o<l;o++){const c=n[o].trimStart();if(c.length===0)continue;const h=c.charAt(0);if(h!=="#")if(h==="v"){const d=c.split(Lh);switch(d[0]){case"v":t.vertices.push(parseFloat(d[1]),parseFloat(d[2]),parseFloat(d[3])),d.length>=7?(Yr.setRGB(parseFloat(d[4]),parseFloat(d[5]),parseFloat(d[6]),Tt),t.colors.push(Yr.r,Yr.g,Yr.b)):t.colors.push(void 0,void 0,void 0);break;case"vn":t.normals.push(parseFloat(d[1]),parseFloat(d[2]),parseFloat(d[3]));break;case"vt":t.uvs.push(parseFloat(d[1]),parseFloat(d[2]));break}}else if(h==="f"){const u=c.slice(1).trim().split(Lh),f=[];for(let _=0,g=u.length;_<g;_++){const p=u[_];if(p.length>0){const w=p.split("/");f.push(w)}}const m=f[0];for(let _=1,g=f.length-1;_<g;_++){const p=f[_],w=f[_+1];t.addFace(m[0],p[0],w[0],m[1],p[1],w[1],m[2],p[2],w[2])}}else if(h==="l"){const d=c.substring(1).trim().split(" ");let u=[];const f=[];if(c.indexOf("/")===-1)u=d;else for(let m=0,_=d.length;m<_;m++){const g=d[m].split("/");g[0]!==""&&u.push(g[0]),g[1]!==""&&f.push(g[1])}t.addLineGeometry(u,f)}else if(h==="p"){const u=c.slice(1).trim().split(" ");t.addPointGeometry(u)}else if((i=Bg.exec(c))!==null){const d=(" "+i[0].slice(1).trim()).slice(1);t.startObject(d)}else if(Vg.test(c))t.object.startMaterial(c.substring(7).trim(),t.materialLibraries);else if(kg.test(c))t.materialLibraries.push(c.substring(7).trim());else if(Hg.test(c))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(h==="s"){if(i=c.split(" "),i.length>1){const u=i[1].trim().toLowerCase();t.object.smooth=u!=="0"&&u!=="off"}else t.object.smooth=!0;const d=t.object.currentMaterial();d&&(d.smooth=t.object.smooth)}else{if(c==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+c+'"')}}t.finalize();const r=new ei;if(r.materialLibraries=[].concat(t.materialLibraries),!(t.objects.length===1&&t.objects[0].geometry.vertices.length===0)===!0)for(let o=0,l=t.objects.length;o<l;o++){const c=t.objects[o],h=c.geometry,d=c.materials,u=h.type==="Line",f=h.type==="Points";let m=!1;if(h.vertices.length===0)continue;const _=new Bt;_.setAttribute("position",new mt(h.vertices,3)),h.normals.length>0&&_.setAttribute("normal",new mt(h.normals,3)),h.colors.length>0&&(m=!0,_.setAttribute("color",new mt(h.colors,3))),h.hasUVIndices===!0&&_.setAttribute("uv",new mt(h.uvs,2));const g=[];for(let w=0,E=d.length;w<E;w++){const S=d[w],U=S.name+"_"+S.smooth+"_"+m;let L=t.materials[U];if(this.materials!==null){if(L=this.materials.create(S.name),u&&L&&!(L instanceof Li)){const D=new Li;Dn.prototype.copy.call(D,L),D.color.copy(L.color),L=D}else if(f&&L&&!(L instanceof ji)){const D=new ji({size:10,sizeAttenuation:!1});Dn.prototype.copy.call(D,L),D.color.copy(L.color),D.map=L.map,L=D}}L===void 0&&(u?L=new Li:f?L=new ji({size:1,sizeAttenuation:!1}):L=new Sn,L.name=S.name,L.flatShading=!S.smooth,L.vertexColors=m,t.materials[U]=L),g.push(L)}let p;if(g.length>1){for(let w=0,E=d.length;w<E;w++){const S=d[w];_.addGroup(S.groupStart,S.groupCount,w)}u?p=new pa(_,g):f?p=new Zs(_,g):p=new Ct(_,g)}else u?p=new pa(_,g[0]):f?p=new Zs(_,g[0]):p=new Ct(_,g[0]);p.name=c.name,r.add(p)}else if(t.vertices.length>0){const o=new ji({size:1,sizeAttenuation:!1}),l=new Bt;l.setAttribute("position",new mt(t.vertices,3)),t.colors.length>0&&t.colors[0]!==void 0&&(l.setAttribute("color",new mt(t.colors,3)),o.vertexColors=!0);const c=new Zs(l,o);r.add(c)}return r}}class vo extends Xn{constructor(e){super(e)}load(e,t,n,i){const r=this,a=this.path===""?Bl.extractUrlBase(e):this.path,o=new Os(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{t(r.parse(l,a))}catch(c){i?i(c):console.error(c),r.manager.itemError(e)}},n,i)}setMaterialOptions(e){return this.materialOptions=e,this}parse(e,t){const n=e.split(`
|
|
4202
|
+
`);let i={};const r=/\s+/,a={};for(let l=0;l<n.length;l++){let c=n[l];if(c=c.trim(),c.length===0||c.charAt(0)==="#")continue;const h=c.indexOf(" ");let d=h>=0?c.substring(0,h):c;d=d.toLowerCase();let u=h>=0?c.substring(h+1):"";if(u=u.trim(),d==="newmtl")i={name:u},a[u]=i;else if(d==="ka"||d==="kd"||d==="ks"||d==="ke"){const f=u.split(r,3);i[d]=[parseFloat(f[0]),parseFloat(f[1]),parseFloat(f[2])]}else i[d]=u}const o=new Wg(this.resourcePath||t,this.materialOptions);return o.setCrossOrigin(this.crossOrigin),o.setManager(this.manager),o.setMaterials(a),o}}class Wg{constructor(e="",t={}){this.baseUrl=e,this.options=t,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.crossOrigin="anonymous",this.side=this.options.side!==void 0?this.options.side:Wn,this.wrap=this.options.wrap!==void 0?this.options.wrap:Zn}setCrossOrigin(e){return this.crossOrigin=e,this}setManager(e){this.manager=e}setMaterials(e){this.materialsInfo=this.convert(e),this.materials={},this.materialsArray=[],this.nameLookup={}}convert(e){if(!this.options)return e;const t={};for(const n in e){const i=e[n],r={};t[n]=r;for(const a in i){let o=!0,l=i[a];const c=a.toLowerCase();switch(c){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(l=[l[0]/255,l[1]/255,l[2]/255]),this.options&&this.options.ignoreZeroRGBs&&l[0]===0&&l[1]===0&&l[2]===0&&(o=!1);break}o&&(r[c]=l)}}return t}preload(){for(const e in this.materialsInfo)this.create(e)}getIndex(e){return this.nameLookup[e]}getAsArray(){let e=0;for(const t in this.materialsInfo)this.materialsArray[e]=this.create(t),this.nameLookup[t]=e,e++;return this.materialsArray}create(e){return this.materials[e]===void 0&&this.createMaterial_(e),this.materials[e]}createMaterial_(e){const t=this,n=this.materialsInfo[e],i={name:e,side:this.side};function r(o,l){return typeof l!="string"||l===""?"":/^https?:\/\//i.test(l)?l:o+l}function a(o,l){if(i[o])return;const c=t.getTextureParams(l,i),h=t.loadTexture(r(t.baseUrl,c.url));h.repeat.copy(c.scale),h.offset.copy(c.offset),h.wrapS=t.wrap,h.wrapT=t.wrap,(o==="map"||o==="emissiveMap")&&(h.colorSpace=Tt),i[o]=h}for(const o in n){const l=n[o];let c;if(l!=="")switch(o.toLowerCase()){case"kd":i.color=Mt.colorSpaceToWorking(new et().fromArray(l),Tt);break;case"ks":i.specular=Mt.colorSpaceToWorking(new et().fromArray(l),Tt);break;case"ke":i.emissive=Mt.colorSpaceToWorking(new et().fromArray(l),Tt);break;case"map_kd":a("map",l);break;case"map_ks":a("specularMap",l);break;case"map_ke":a("emissiveMap",l);break;case"norm":a("normalMap",l);break;case"map_bump":case"bump":a("bumpMap",l);break;case"disp":a("displacementMap",l);break;case"map_d":a("alphaMap",l),i.transparent=!0;break;case"ns":i.shininess=parseFloat(l);break;case"d":c=parseFloat(l),c<1&&(i.opacity=c,i.transparent=!0);break;case"tr":c=parseFloat(l),this.options&&this.options.invertTrProperty&&(c=1-c),c>0&&(i.opacity=1-c,i.transparent=!0);break}}return this.materials[e]=new Sn(i),this.materials[e]}getTextureParams(e,t){const n={scale:new Be(1,1),offset:new Be(0,0)},i=e.split(/\s+/);let r;return r=i.indexOf("-bm"),r>=0&&(t.bumpScale=parseFloat(i[r+1]),i.splice(r,2)),r=i.indexOf("-mm"),r>=0&&(t.displacementBias=parseFloat(i[r+1]),t.displacementScale=parseFloat(i[r+2]),i.splice(r,3)),r=i.indexOf("-s"),r>=0&&(n.scale.set(parseFloat(i[r+1]),parseFloat(i[r+2])),i.splice(r,4)),r=i.indexOf("-o"),r>=0&&(n.offset.set(parseFloat(i[r+1]),parseFloat(i[r+2])),i.splice(r,4)),n.url=i.join(" ").trim(),n}loadTexture(e,t,n,i,r){const a=this.manager!==void 0?this.manager:Fl;let o=a.getHandler(e);o===null&&(o=new Ol(a)),o.setCrossOrigin&&o.setCrossOrigin(this.crossOrigin);const l=o.load(e,n,i,r);return t!==void 0&&(l.mapping=t),l}}class la extends Xn{constructor(e){super(e)}load(e,t,n,i){const r=this,a=new Os(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(o){try{t(r.parse(o))}catch(l){i?i(l):console.error(l),r.manager.itemError(e)}},n,i)}parse(e){function t(c){const h=new DataView(c),d=32/8*3+32/8*3*3+16/8,u=h.getUint32(80,!0);if(80+32/8+u*d===h.byteLength)return!0;const m=[115,111,108,105,100];for(let _=0;_<5;_++)if(n(m,h,_))return!1;return!0}function n(c,h,d){for(let u=0,f=c.length;u<f;u++)if(c[u]!==h.getUint8(d+u))return!1;return!0}function i(c){const h=new DataView(c),d=h.getUint32(80,!0);let u,f,m,_=!1,g,p,w,E,S;for(let I=0;I<70;I++)h.getUint32(I,!1)==1129270351&&h.getUint8(I+4)==82&&h.getUint8(I+5)==61&&(_=!0,g=new Float32Array(d*3*3),p=h.getUint8(I+6)/255,w=h.getUint8(I+7)/255,E=h.getUint8(I+8)/255,S=h.getUint8(I+9)/255);const U=84,L=12*4+2,D=new Bt,N=new Float32Array(d*3*3),b=new Float32Array(d*3*3),M=new et;for(let I=0;I<d;I++){const V=U+I*L,H=h.getFloat32(V,!0),J=h.getFloat32(V+4,!0),ie=h.getFloat32(V+8,!0);if(_){const B=h.getUint16(V+48,!0);(B&32768)===0?(u=(B&31)/31,f=(B>>5&31)/31,m=(B>>10&31)/31):(u=p,f=w,m=E)}for(let B=1;B<=3;B++){const oe=V+B*12,j=I*3*3+(B-1)*3;N[j]=h.getFloat32(oe,!0),N[j+1]=h.getFloat32(oe+4,!0),N[j+2]=h.getFloat32(oe+8,!0),b[j]=H,b[j+1]=J,b[j+2]=ie,_&&(M.setRGB(u,f,m,Tt),g[j]=M.r,g[j+1]=M.g,g[j+2]=M.b)}}return D.setAttribute("position",new Ht(N,3)),D.setAttribute("normal",new Ht(b,3)),_&&(D.setAttribute("color",new Ht(g,3)),D.hasColors=!0,D.alpha=S),D}function r(c){const h=new Bt,d=/solid([\s\S]*?)endsolid/g,u=/facet([\s\S]*?)endfacet/g,f=/solid\s(.+)/;let m=0;const _=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,g=new RegExp("vertex"+_+_+_,"g"),p=new RegExp("normal"+_+_+_,"g"),w=[],E=[],S=[],U=new F;let L,D=0,N=0,b=0;for(;(L=d.exec(c))!==null;){N=b;const M=L[0],I=(L=f.exec(M))!==null?L[1]:"";for(S.push(I);(L=u.exec(M))!==null;){let J=0,ie=0;const B=L[0];for(;(L=p.exec(B))!==null;)U.x=parseFloat(L[1]),U.y=parseFloat(L[2]),U.z=parseFloat(L[3]),ie++;for(;(L=g.exec(B))!==null;)w.push(parseFloat(L[1]),parseFloat(L[2]),parseFloat(L[3])),E.push(U.x,U.y,U.z),J++,b++;ie!==1&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+m),J!==3&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+m),m++}const V=N,H=b-N;h.userData.groupNames=S,h.addGroup(V,H,D),D++}return h.setAttribute("position",new mt(w,3)),h.setAttribute("normal",new mt(E,3)),h}function a(c){return typeof c!="string"?new TextDecoder().decode(c):c}function o(c){if(typeof c=="string"){const h=new Uint8Array(c.length);for(let d=0;d<c.length;d++)h[d]=c.charCodeAt(d)&255;return h.buffer||h}else return c}const l=o(e);return t(l)?i(l):r(a(e))}}class Xg extends Xn{constructor(e){super(e),this.littleEndian=!0}load(e,t,n,i){const r=this,a=new Os(r.manager);a.setPath(r.path),a.setResponseType("arraybuffer"),a.setRequestHeader(r.requestHeader),a.setWithCredentials(r.withCredentials),a.load(e,function(o){try{t(r.parse(o))}catch(l){i?i(l):console.error(l),r.manager.itemError(e)}},n,i)}_getDataView(e,t,n,i){switch(n){case"F":return i===8?e.getFloat64(t,this.littleEndian):e.getFloat32(t,this.littleEndian);case"I":return i===1?e.getInt8(t):i===2?e.getInt16(t,this.littleEndian):e.getInt32(t,this.littleEndian);case"U":return i===1?e.getUint8(t):i===2?e.getUint16(t,this.littleEndian):e.getUint32(t,this.littleEndian)}}parse(e){function t(f,m){const _=f.length,g=new Uint8Array(m);let p=0,w=0,E,S,U;do if(E=f[p++],E<32){if(E++,w+E>m)throw new Error("Output buffer is not large enough");if(p+E>_)throw new Error("Invalid compressed data");do g[w++]=f[p++];while(--E)}else{if(S=E>>5,U=w-((E&31)<<8)-1,p>=_)throw new Error("Invalid compressed data");if(S===7&&(S+=f[p++],p>=_))throw new Error("Invalid compressed data");if(U-=f[p++],w+S+2>m)throw new Error("Output buffer is not large enough");if(U<0)throw new Error("Invalid compressed data");if(U>=w)throw new Error("Invalid compressed data");do g[w++]=g[U++];while(--S+2)}while(p<_);return g}function n(f){const m={},_=new Uint8Array(f);let g="",p="",w=0,E=!1;const S=_.length;for(;w<S&&E===!1;){const N=String.fromCharCode(_[w++]);N===`
|
|
4203
|
+
`||N==="\r"?(p.trim().toLowerCase().startsWith("data")&&(E=!0),p=""):p+=N,g+=N}const U=g.search(/[\r\n]DATA\s(\S*)\s/i),L=/[\r\n]DATA\s(\S*)\s/i.exec(g.slice(U-1));if(m.data=L[1],m.headerLen=L[0].length+U,m.str=g.slice(0,m.headerLen),m.str=m.str.replace(/#.*/gi,""),m.version=/^VERSION (.*)/im.exec(m.str),m.fields=/^FIELDS (.*)/im.exec(m.str),m.size=/^SIZE (.*)/im.exec(m.str),m.type=/^TYPE (.*)/im.exec(m.str),m.count=/^COUNT (.*)/im.exec(m.str),m.width=/^WIDTH (.*)/im.exec(m.str),m.height=/^HEIGHT (.*)/im.exec(m.str),m.viewpoint=/^VIEWPOINT (.*)/im.exec(m.str),m.points=/^POINTS (.*)/im.exec(m.str),m.version!==null&&(m.version=parseFloat(m.version[1])),m.fields=m.fields!==null?m.fields[1].split(" "):[],m.type!==null&&(m.type=m.type[1].split(" ")),m.width!==null&&(m.width=parseInt(m.width[1])),m.height!==null&&(m.height=parseInt(m.height[1])),m.viewpoint!==null&&(m.viewpoint=m.viewpoint[1]),m.points!==null&&(m.points=parseInt(m.points[1],10)),m.points===null&&(m.points=m.width*m.height),m.size!==null&&(m.size=m.size[1].split(" ").map(function(N){return parseInt(N,10)})),m.count!==null)m.count=m.count[1].split(" ").map(function(N){return parseInt(N,10)});else{m.count=[];for(let N=0,b=m.fields.length;N<b;N++)m.count.push(1)}m.offset={};let D=0;for(let N=0,b=m.fields.length;N<b;N++)m.data==="ascii"?m.offset[m.fields[N]]=N:(m.offset[m.fields[N]]=D,D+=m.size[N]*m.count[N]);return m.rowSize=D,m}const i=n(e),r=[],a=[],o=[],l=[],c=[],h=new et;if(i.data==="ascii"){const f=i.offset,g=new TextDecoder().decode(e).slice(i.headerLen).split(`
|
|
4204
|
+
`);for(let p=0,w=g.length;p<w;p++){if(g[p]==="")continue;const E=g[p].split(" ");if(f.x!==void 0&&(r.push(parseFloat(E[f.x])),r.push(parseFloat(E[f.y])),r.push(parseFloat(E[f.z]))),f.rgb!==void 0){const S=i.fields.findIndex(I=>I==="rgb"),U=i.type[S],L=parseFloat(E[f.rgb]);let D=L;if(U==="F"){const I=new Float32Array(1);I[0]=L,D=new Int32Array(I.buffer)[0]}const N=(D>>16&255)/255,b=(D>>8&255)/255,M=(D>>0&255)/255;h.setRGB(N,b,M,Tt),o.push(h.r,h.g,h.b)}f.normal_x!==void 0&&(a.push(parseFloat(E[f.normal_x])),a.push(parseFloat(E[f.normal_y])),a.push(parseFloat(E[f.normal_z]))),f.intensity!==void 0&&l.push(parseFloat(E[f.intensity])),f.label!==void 0&&c.push(parseInt(E[f.label]))}}if(i.data==="binary_compressed"){const f=new Uint32Array(e.slice(i.headerLen,i.headerLen+8)),m=f[0],_=f[1],g=t(new Uint8Array(e,i.headerLen+8,m),_),p=new DataView(g.buffer),w=i.offset;for(let E=0;E<i.points;E++){if(w.x!==void 0){const S=i.fields.indexOf("x"),U=i.fields.indexOf("y"),L=i.fields.indexOf("z");r.push(this._getDataView(p,i.points*w.x+i.size[S]*E,i.type[S],i.size[S])),r.push(this._getDataView(p,i.points*w.y+i.size[U]*E,i.type[U],i.size[U])),r.push(this._getDataView(p,i.points*w.z+i.size[L]*E,i.type[L],i.size[L]))}if(w.rgb!==void 0){const S=i.fields.indexOf("rgb"),U=p.getUint8(i.points*w.rgb+i.size[S]*E+2)/255,L=p.getUint8(i.points*w.rgb+i.size[S]*E+1)/255,D=p.getUint8(i.points*w.rgb+i.size[S]*E+0)/255;h.setRGB(U,L,D,Tt),o.push(h.r,h.g,h.b)}if(w.normal_x!==void 0){const S=i.fields.indexOf("normal_x"),U=i.fields.indexOf("normal_y"),L=i.fields.indexOf("normal_z");a.push(this._getDataView(p,i.points*w.normal_x+i.size[S]*E,i.type[S],i.size[S])),a.push(this._getDataView(p,i.points*w.normal_y+i.size[U]*E,i.type[U],i.size[U])),a.push(this._getDataView(p,i.points*w.normal_z+i.size[L]*E,i.type[L],i.size[L]))}if(w.intensity!==void 0){const S=i.fields.indexOf("intensity");l.push(this._getDataView(p,i.points*w.intensity+i.size[S]*E,i.type[S],i.size[S]))}if(w.label!==void 0){const S=i.fields.indexOf("label");c.push(p.getInt32(i.points*w.label+i.size[S]*E,this.littleEndian))}}}if(i.data==="binary"){const f=new DataView(e,i.headerLen),m=i.offset;for(let _=0,g=0;_<i.points;_++,g+=i.rowSize){if(m.x!==void 0){const p=i.fields.indexOf("x"),w=i.fields.indexOf("y"),E=i.fields.indexOf("z");r.push(this._getDataView(f,g+m.x,i.type[p],i.size[p])),r.push(this._getDataView(f,g+m.y,i.type[w],i.size[w])),r.push(this._getDataView(f,g+m.z,i.type[E],i.size[E]))}if(m.rgb!==void 0){const p=f.getUint8(g+m.rgb+2)/255,w=f.getUint8(g+m.rgb+1)/255,E=f.getUint8(g+m.rgb+0)/255;h.setRGB(p,w,E,Tt),o.push(h.r,h.g,h.b)}if(m.normal_x!==void 0){const p=i.fields.indexOf("normal_x"),w=i.fields.indexOf("normal_y"),E=i.fields.indexOf("normal_z");a.push(this._getDataView(f,g+m.normal_x,i.type[p],i.size[p])),a.push(this._getDataView(f,g+m.normal_y,i.type[w],i.size[w])),a.push(this._getDataView(f,g+m.normal_z,i.type[E],i.size[E]))}if(m.intensity!==void 0){const p=i.fields.indexOf("intensity");l.push(this._getDataView(f,g+m.intensity,i.type[p],i.size[p]))}m.label!==void 0&&c.push(f.getInt32(g+m.label,this.littleEndian))}}const d=new Bt;r.length>0&&d.setAttribute("position",new mt(r,3)),a.length>0&&d.setAttribute("normal",new mt(a,3)),o.length>0&&d.setAttribute("color",new mt(o,3)),l.length>0&&d.setAttribute("intensity",new mt(l,1)),c.length>0&&d.setAttribute("label",new Sf(c,1)),d.computeBoundingSphere();const u=new ji({size:.005});return o.length>0&&(u.vertexColors=!0),new Zs(d,u)}}class Uh extends _p{constructor(e){super(e)}parse(e){function t(B){switch(B.image_type){case u:case _:if(B.colormap_length>256||B.colormap_size!==24||B.colormap_type!==1)throw new Error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case f:case m:case g:case p:if(B.colormap_type)throw new Error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case d:throw new Error("THREE.TGALoader: No data.");default:throw new Error("THREE.TGALoader: Invalid type "+B.image_type)}if(B.width<=0||B.height<=0)throw new Error("THREE.TGALoader: Invalid image size.");if(B.pixel_size!==8&&B.pixel_size!==16&&B.pixel_size!==24&&B.pixel_size!==32)throw new Error("THREE.TGALoader: Invalid pixel size "+B.pixel_size)}function n(B,oe,j,ue,pe){let Me,Ue;const Ne=j.pixel_size>>3,$=j.width*j.height*Ne;if(oe&&(Ue=pe.subarray(ue,ue+=j.colormap_length*(j.colormap_size>>3))),B){Me=new Uint8Array($);let se,re,le,Ee=0;const fe=new Uint8Array(Ne);for(;Ee<$;)if(se=pe[ue++],re=(se&127)+1,se&128){for(le=0;le<Ne;++le)fe[le]=pe[ue++];for(le=0;le<re;++le)Me.set(fe,Ee+le*Ne);Ee+=Ne*re}else{for(re*=Ne,le=0;le<re;++le)Me[Ee+le]=pe[ue++];Ee+=re}}else Me=pe.subarray(ue,ue+=oe?j.width*j.height:$);return{pixel_data:Me,palettes:Ue}}function i(B,oe,j,ue,pe,Me,Ue,Ne,$){const se=$;let re,le=0,Ee,fe;const be=M.width;for(fe=oe;fe!==ue;fe+=j)for(Ee=pe;Ee!==Ue;Ee+=Me,le++)re=Ne[le],B[(Ee+be*fe)*4+3]=255,B[(Ee+be*fe)*4+2]=se[re*3+0],B[(Ee+be*fe)*4+1]=se[re*3+1],B[(Ee+be*fe)*4+0]=se[re*3+2];return B}function r(B,oe,j,ue,pe,Me,Ue,Ne){let $,se=0,re,le;const Ee=M.width;for(le=oe;le!==ue;le+=j)for(re=pe;re!==Ue;re+=Me,se+=2)$=Ne[se+0]+(Ne[se+1]<<8),B[(re+Ee*le)*4+0]=($&31744)>>7,B[(re+Ee*le)*4+1]=($&992)>>2,B[(re+Ee*le)*4+2]=($&31)<<3,B[(re+Ee*le)*4+3]=$&32768?0:255;return B}function a(B,oe,j,ue,pe,Me,Ue,Ne){let $=0,se,re;const le=M.width;for(re=oe;re!==ue;re+=j)for(se=pe;se!==Ue;se+=Me,$+=3)B[(se+le*re)*4+3]=255,B[(se+le*re)*4+2]=Ne[$+0],B[(se+le*re)*4+1]=Ne[$+1],B[(se+le*re)*4+0]=Ne[$+2];return B}function o(B,oe,j,ue,pe,Me,Ue,Ne){let $=0,se,re;const le=M.width;for(re=oe;re!==ue;re+=j)for(se=pe;se!==Ue;se+=Me,$+=4)B[(se+le*re)*4+2]=Ne[$+0],B[(se+le*re)*4+1]=Ne[$+1],B[(se+le*re)*4+0]=Ne[$+2],B[(se+le*re)*4+3]=Ne[$+3];return B}function l(B,oe,j,ue,pe,Me,Ue,Ne){let $,se=0,re,le;const Ee=M.width;for(le=oe;le!==ue;le+=j)for(re=pe;re!==Ue;re+=Me,se++)$=Ne[se],B[(re+Ee*le)*4+0]=$,B[(re+Ee*le)*4+1]=$,B[(re+Ee*le)*4+2]=$,B[(re+Ee*le)*4+3]=255;return B}function c(B,oe,j,ue,pe,Me,Ue,Ne){let $=0,se,re;const le=M.width;for(re=oe;re!==ue;re+=j)for(se=pe;se!==Ue;se+=Me,$+=2)B[(se+le*re)*4+0]=Ne[$+0],B[(se+le*re)*4+1]=Ne[$+0],B[(se+le*re)*4+2]=Ne[$+0],B[(se+le*re)*4+3]=Ne[$+1];return B}function h(B,oe,j,ue,pe){let Me,Ue,Ne,$,se,re;switch((M.flags&w)>>E){default:case L:Me=0,Ne=1,se=oe,Ue=0,$=1,re=j;break;case S:Me=0,Ne=1,se=oe,Ue=j-1,$=-1,re=-1;break;case D:Me=oe-1,Ne=-1,se=-1,Ue=0,$=1,re=j;break;case U:Me=oe-1,Ne=-1,se=-1,Ue=j-1,$=-1,re=-1;break}if(H)switch(M.pixel_size){case 8:l(B,Ue,$,re,Me,Ne,se,ue);break;case 16:c(B,Ue,$,re,Me,Ne,se,ue);break;default:throw new Error("THREE.TGALoader: Format not supported.")}else switch(M.pixel_size){case 8:i(B,Ue,$,re,Me,Ne,se,ue,pe);break;case 16:r(B,Ue,$,re,Me,Ne,se,ue);break;case 24:a(B,Ue,$,re,Me,Ne,se,ue);break;case 32:o(B,Ue,$,re,Me,Ne,se,ue);break;default:throw new Error("THREE.TGALoader: Format not supported.")}return B}const d=0,u=1,f=2,m=3,_=9,g=10,p=11,w=48,E=4,S=0,U=1,L=2,D=3;if(e.length<19)throw new Error("THREE.TGALoader: Not enough data to contain header.");let N=0;const b=new Uint8Array(e),M={id_length:b[N++],colormap_type:b[N++],image_type:b[N++],colormap_index:b[N++]|b[N++]<<8,colormap_length:b[N++]|b[N++]<<8,colormap_size:b[N++],origin:[b[N++]|b[N++]<<8,b[N++]|b[N++]<<8],width:b[N++]|b[N++]<<8,height:b[N++]|b[N++]<<8,pixel_size:b[N++],flags:b[N++]};if(t(M),M.id_length+N>e.length)throw new Error("THREE.TGALoader: No data.");N+=M.id_length;let I=!1,V=!1,H=!1;switch(M.image_type){case _:I=!0,V=!0;break;case u:V=!0;break;case g:I=!0;break;case f:break;case p:I=!0,H=!0;break;case m:H=!0;break}const J=new Uint8Array(M.width*M.height*4),ie=n(I,V,M,N,b);return h(J,M.width,M.height,ie.pixel_data,ie.palettes),{data:J,width:M.width,height:M.height,flipY:!0,generateMipmaps:!0,minFilter:di}}}class qg extends Xn{load(e,t,n,i){const r=this,a=r.path===""?Bl.extractUrlBase(e):r.path,o=new Os(r.manager);o.setPath(r.path),o.setRequestHeader(r.requestHeader),o.setWithCredentials(r.withCredentials),o.load(e,function(l){try{t(r.parse(l,a))}catch(c){i?i(c):console.error(c),r.manager.itemError(e)}},n,i)}parse(e,t){function n(x,v){const R=[],A=x.childNodes;for(let P=0,te=A.length;P<te;P++){const ce=A[P];ce.nodeName===v&&R.push(ce)}return R}function i(x){if(x.length===0)return[];const v=x.trim().split(/\s+/),R=new Array(v.length);for(let A=0,P=v.length;A<P;A++)R[A]=v[A];return R}function r(x){if(x.length===0)return[];const v=x.trim().split(/\s+/),R=new Array(v.length);for(let A=0,P=v.length;A<P;A++)R[A]=parseFloat(v[A]);return R}function a(x){if(x.length===0)return[];const v=x.trim().split(/\s+/),R=new Array(v.length);for(let A=0,P=v.length;A<P;A++)R[A]=parseInt(v[A]);return R}function o(x){return x.substring(1)}function l(){return"three_default_"+ii++}function c(x){return Object.keys(x).length===0}function h(x){return{unit:d(n(x,"unit")[0]),upAxis:u(n(x,"up_axis")[0])}}function d(x){return x!==void 0&&x.hasAttribute("meter")===!0?parseFloat(x.getAttribute("meter")):1}function u(x){return x!==void 0?x.textContent:"Y_UP"}function f(x,v,R,A){const P=n(x,v)[0];if(P!==void 0){const te=n(P,R);for(let ce=0;ce<te.length;ce++)A(te[ce])}}function m(x,v){for(const R in x){const A=x[R];A.build=v(x[R])}}function _(x,v){return x.build!==void 0||(x.build=v(x)),x.build}function g(x){const v={sources:{},samplers:{},channels:{}};let R=!1;for(let A=0,P=x.childNodes.length;A<P;A++){const te=x.childNodes[A];if(te.nodeType!==1)continue;let ce;switch(te.nodeName){case"source":ce=te.getAttribute("id"),v.sources[ce]=ge(te);break;case"sampler":ce=te.getAttribute("id"),v.samplers[ce]=p(te);break;case"channel":ce=te.getAttribute("target"),v.channels[ce]=w(te);break;case"animation":g(te),R=!0;break;default:console.log(te)}}R===!1&&(ut.animations[x.getAttribute("id")||Xi.generateUUID()]=v)}function p(x){const v={inputs:{}};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"input":const te=o(P.getAttribute("source")),ce=P.getAttribute("semantic");v.inputs[ce]=te;break}}return v}function w(x){const v={};let A=x.getAttribute("target").split("/");const P=A.shift();let te=A.shift();const ce=te.indexOf("(")!==-1,He=te.indexOf(".")!==-1;if(He)A=te.split("."),te=A.shift(),v.member=A.shift();else if(ce){const Re=te.split("(");te=Re.shift();for(let Fe=0;Fe<Re.length;Fe++)Re[Fe]=parseInt(Re[Fe].replace(/\)/,""));v.indices=Re}return v.id=P,v.sid=te,v.arraySyntax=ce,v.memberSyntax=He,v.sampler=o(x.getAttribute("source")),v}function E(x){const v=[],R=x.channels,A=x.samplers,P=x.sources;for(const te in R)if(R.hasOwnProperty(te)){const ce=R[te],He=A[ce.sampler],Re=He.inputs.INPUT,Fe=He.inputs.OUTPUT,Ke=P[Re],_e=P[Fe],$e=U(ce,Ke,_e);M($e,v)}return v}function S(x){return _(ut.animations[x],E)}function U(x,v,R){const A=ut.nodes[x.id],P=gt(A.id),te=A.transforms[x.sid],ce=A.matrix.clone().transpose();let He,Re,Fe,Ke,_e,$e;const Xe={};switch(te){case"matrix":for(Fe=0,Ke=v.array.length;Fe<Ke;Fe++)if(He=v.array[Fe],Re=Fe*R.stride,Xe[He]===void 0&&(Xe[He]={}),x.arraySyntax===!0){const Vt=R.array[Re],Dt=x.indices[0]+4*x.indices[1];Xe[He][Dt]=Vt}else for(_e=0,$e=R.stride;_e<$e;_e++)Xe[He][_e]=R.array[Re+_e];break;case"translate":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',te);break;case"rotate":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',te);break;case"scale":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',te);break}const nt=L(Xe,ce);return{name:P.uuid,keyframes:nt}}function L(x,v){const R=[];for(const P in x)R.push({time:parseFloat(P),value:x[P]});R.sort(A);for(let P=0;P<16;P++)I(R,P,v.elements[P]);return R;function A(P,te){return P.time-te.time}}const D=new F,N=new F,b=new Pn;function M(x,v){const R=x.keyframes,A=x.name,P=[],te=[],ce=[],He=[];for(let Re=0,Fe=R.length;Re<Fe;Re++){const Ke=R[Re],_e=Ke.time,$e=Ke.value;X.fromArray($e).transpose(),X.decompose(D,b,N),P.push(_e),te.push(D.x,D.y,D.z),ce.push(b.x,b.y,b.z,b.w),He.push(N.x,N.y,N.z)}return te.length>0&&v.push(new Ns(A+".position",P,te)),ce.length>0&&v.push(new cr(A+".quaternion",P,ce)),He.length>0&&v.push(new Ns(A+".scale",P,He)),v}function I(x,v,R){let A,P=!0,te,ce;for(te=0,ce=x.length;te<ce;te++)A=x[te],A.value[v]===void 0?A.value[v]=null:P=!1;if(P===!0)for(te=0,ce=x.length;te<ce;te++)A=x[te],A.value[v]=R;else V(x,v)}function V(x,v){let R,A;for(let P=0,te=x.length;P<te;P++){const ce=x[P];if(ce.value[v]===null){if(R=H(x,P,v),A=J(x,P,v),R===null){ce.value[v]=A.value[v];continue}if(A===null){ce.value[v]=R.value[v];continue}ie(ce,R,A,v)}}}function H(x,v,R){for(;v>=0;){const A=x[v];if(A.value[R]!==null)return A;v--}return null}function J(x,v,R){for(;v<x.length;){const A=x[v];if(A.value[R]!==null)return A;v++}return null}function ie(x,v,R,A){if(R.time-v.time===0){x.value[A]=v.value[A];return}x.value[A]=(x.time-v.time)*(R.value[A]-v.value[A])/(R.time-v.time)+v.value[A]}function B(x){const v={name:x.getAttribute("id")||"default",start:parseFloat(x.getAttribute("start")||0),end:parseFloat(x.getAttribute("end")||0),animations:[]};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"instance_animation":v.animations.push(o(P.getAttribute("url")));break}}ut.clips[x.getAttribute("id")]=v}function oe(x){const v=[],R=x.name,A=x.end-x.start||-1,P=x.animations;for(let te=0,ce=P.length;te<ce;te++){const He=S(P[te]);for(let Re=0,Fe=He.length;Re<Fe;Re++)v.push(He[Re])}return new Oc(R,A,v)}function j(x){return _(ut.clips[x],oe)}function ue(x){const v={};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"skin":v.id=o(P.getAttribute("source")),v.skin=pe(P);break;case"morph":v.id=o(P.getAttribute("source")),console.warn("THREE.ColladaLoader: Morph target animation not supported yet.");break}}ut.controllers[x.getAttribute("id")]=v}function pe(x){const v={sources:{}};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"bind_shape_matrix":v.bindShapeMatrix=r(P.textContent);break;case"source":const te=P.getAttribute("id");v.sources[te]=ge(P);break;case"joints":v.joints=Me(P);break;case"vertex_weights":v.vertexWeights=Ue(P);break}}return v}function Me(x){const v={inputs:{}};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"input":const te=P.getAttribute("semantic"),ce=o(P.getAttribute("source"));v.inputs[te]=ce;break}}return v}function Ue(x){const v={inputs:{}};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"input":const te=P.getAttribute("semantic"),ce=o(P.getAttribute("source")),He=parseInt(P.getAttribute("offset"));v.inputs[te]={id:ce,offset:He};break;case"vcount":v.vcount=a(P.textContent);break;case"v":v.v=a(P.textContent);break}}return v}function Ne(x){const v={id:x.id},R=ut.geometries[v.id];return x.skin!==void 0&&(v.skin=$(x.skin),R.sources.skinIndices=v.skin.indices,R.sources.skinWeights=v.skin.weights),v}function $(x){const R={joints:[],indices:{array:[],stride:4},weights:{array:[],stride:4}},A=x.sources,P=x.vertexWeights,te=P.vcount,ce=P.v,He=P.inputs.JOINT.offset,Re=P.inputs.WEIGHT.offset,Fe=x.sources[x.joints.inputs.JOINT],Ke=x.sources[x.joints.inputs.INV_BIND_MATRIX],_e=A[P.inputs.WEIGHT.id].array;let $e=0,Xe,nt,Qe;for(Xe=0,Qe=te.length;Xe<Qe;Xe++){const Dt=te[Xe],wt=[];for(nt=0;nt<Dt;nt++){const At=ce[$e+He],si=ce[$e+Re],Mn=_e[si];wt.push({index:At,weight:Mn}),$e+=2}for(wt.sort(Vt),nt=0;nt<4;nt++){const At=wt[nt];At!==void 0?(R.indices.array.push(At.index),R.weights.array.push(At.weight)):(R.indices.array.push(0),R.weights.array.push(0))}}for(x.bindShapeMatrix?R.bindMatrix=new st().fromArray(x.bindShapeMatrix).transpose():R.bindMatrix=new st().identity(),Xe=0,Qe=Fe.array.length;Xe<Qe;Xe++){const Dt=Fe.array[Xe],wt=new st().fromArray(Ke.array,Xe*Ke.stride).transpose();R.joints.push({name:Dt,boneInverse:wt})}return R;function Vt(Dt,wt){return wt.weight-Dt.weight}}function se(x){return _(ut.controllers[x],Ne)}function re(x){const v={init_from:n(x,"init_from")[0].textContent};ut.images[x.getAttribute("id")]=v}function le(x){return x.build!==void 0?x.build:x.init_from}function Ee(x){const v=ut.images[x];return v!==void 0?_(v,le):(console.warn("THREE.ColladaLoader: Couldn't find image with ID:",x),null)}function fe(x){const v={};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"profile_COMMON":v.profile=be(P);break}}ut.effects[x.getAttribute("id")]=v}function be(x){const v={surfaces:{},samplers:{}};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"newparam":Je(P,v);break;case"technique":v.technique=z(P);break;case"extra":v.extra=ne(P);break}}return v}function Je(x,v){const R=x.getAttribute("sid");for(let A=0,P=x.childNodes.length;A<P;A++){const te=x.childNodes[A];if(te.nodeType===1)switch(te.nodeName){case"surface":v.surfaces[R]=at(te);break;case"sampler2D":v.samplers[R]=it(te);break}}}function at(x){const v={};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"init_from":v.init_from=P.textContent;break}}return v}function it(x){const v={};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"source":v.source=P.textContent;break}}return v}function z(x){const v={};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"constant":case"lambert":case"blinn":case"phong":v.type=P.nodeName,v.parameters=yt(P);break;case"extra":v.extra=ne(P);break}}return v}function yt(x){const v={};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"emission":case"diffuse":case"specular":case"bump":case"ambient":case"shininess":case"transparency":v[P.nodeName]=dt(P);break;case"transparent":v[P.nodeName]={opaque:P.hasAttribute("opaque")?P.getAttribute("opaque"):"A_ONE",data:dt(P)};break}}return v}function dt(x){const v={};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"color":v[P.nodeName]=r(P.textContent);break;case"float":v[P.nodeName]=parseFloat(P.textContent);break;case"texture":v[P.nodeName]={id:P.getAttribute("texture"),extra:ot(P)};break}}return v}function ot(x){const v={technique:{}};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"extra":W(P,v);break}}return v}function W(x,v){for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"technique":ae(P,v);break}}}function ae(x,v){for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"repeatU":case"repeatV":case"offsetU":case"offsetV":v.technique[P.nodeName]=parseFloat(P.textContent);break;case"wrapU":case"wrapV":P.textContent.toUpperCase()==="TRUE"?v.technique[P.nodeName]=1:P.textContent.toUpperCase()==="FALSE"?v.technique[P.nodeName]=0:v.technique[P.nodeName]=parseInt(P.textContent);break;case"bump":v[P.nodeName]=Oe(P);break}}}function ne(x){const v={};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"technique":v.technique=ye(P);break}}return v}function ye(x){const v={};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"double_sided":v[P.nodeName]=parseInt(P.textContent);break;case"bump":v[P.nodeName]=Oe(P);break}}return v}function Oe(x){const v={};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"texture":v[P.nodeName]={id:P.getAttribute("texture"),texcoord:P.getAttribute("texcoord"),extra:ot(P)};break}}return v}function T(x){return x}function y(x){return _(ut.effects[x],T)}function k(x){const v={name:x.getAttribute("name")};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"instance_effect":v.url=o(P.getAttribute("url"));break}}ut.materials[x.getAttribute("id")]=v}function K(x){let v,R=x.slice((x.lastIndexOf(".")-1>>>0)+2);switch(R=R.toLowerCase(),R){case"tga":v=ln;break;default:v=fn}return v}function Q(x){const v=y(x.url),R=v.profile.technique;let A;switch(R.type){case"phong":case"blinn":A=new Sn;break;case"lambert":A=new ip;break;default:A=new Pi;break}A.name=x.name||"";function P(Re,Fe=null){const Ke=v.profile.samplers[Re.id];let _e=null;if(Ke!==void 0){const $e=v.profile.surfaces[Ke.source];_e=Ee($e.init_from)}else console.warn("THREE.ColladaLoader: Undefined sampler. Access image directly (see #12530)."),_e=Ee(Re.id);if(_e!==null){const $e=K(_e);if($e!==void 0){const Xe=$e.load(_e),nt=Re.extra;if(nt!==void 0&&nt.technique!==void 0&&c(nt.technique)===!1){const Qe=nt.technique;Xe.wrapS=Qe.wrapU?Zn:Hn,Xe.wrapT=Qe.wrapV?Zn:Hn,Xe.offset.set(Qe.offsetU||0,Qe.offsetV||0),Xe.repeat.set(Qe.repeatU||1,Qe.repeatV||1)}else Xe.wrapS=Zn,Xe.wrapT=Zn;return Fe!==null&&(Xe.colorSpace=Fe),Xe}else return console.warn("THREE.ColladaLoader: Loader for texture %s not found.",_e),null}else return console.warn("THREE.ColladaLoader: Couldn't create texture with ID:",Re.id),null}const te=R.parameters;for(const Re in te){const Fe=te[Re];switch(Re){case"diffuse":Fe.color&&A.color.fromArray(Fe.color),Fe.texture&&(A.map=P(Fe.texture,Tt));break;case"specular":Fe.color&&A.specular&&A.specular.fromArray(Fe.color),Fe.texture&&(A.specularMap=P(Fe.texture));break;case"bump":Fe.texture&&(A.normalMap=P(Fe.texture));break;case"ambient":Fe.texture&&(A.lightMap=P(Fe.texture,Tt));break;case"shininess":Fe.float&&A.shininess&&(A.shininess=Fe.float);break;case"emission":Fe.color&&A.emissive&&A.emissive.fromArray(Fe.color),Fe.texture&&(A.emissiveMap=P(Fe.texture,Tt));break}}Mt.colorSpaceToWorking(A.color,Tt),A.specular&&Mt.colorSpaceToWorking(A.specular,Tt),A.emissive&&Mt.colorSpaceToWorking(A.emissive,Tt);let ce=te.transparent,He=te.transparency;if(He===void 0&&ce&&(He={float:1}),ce===void 0&&He&&(ce={opaque:"A_ONE",data:{color:[1,1,1,1]}}),ce&&He)if(ce.data.texture)A.transparent=!0;else{const Re=ce.data.color;switch(ce.opaque){case"A_ONE":A.opacity=Re[3]*He.float;break;case"RGB_ZERO":A.opacity=1-Re[0]*He.float;break;case"A_ZERO":A.opacity=1-Re[3]*He.float;break;case"RGB_ONE":A.opacity=Re[0]*He.float;break;default:console.warn('THREE.ColladaLoader: Invalid opaque type "%s" of transparent tag.',ce.opaque)}A.opacity<1&&(A.transparent=!0)}if(R.extra!==void 0&&R.extra.technique!==void 0){const Re=R.extra.technique;for(const Fe in Re){const Ke=Re[Fe];switch(Fe){case"double_sided":A.side=Ke===1?un:Wn;break;case"bump":A.normalMap=P(Ke.texture),A.normalScale=new Be(1,1);break}}}return A}function O(x){return _(ut.materials[x],Q)}function we(x){const v={name:x.getAttribute("name")};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"optics":v.optics=xe(P);break}}ut.cameras[x.getAttribute("id")]=v}function xe(x){for(let v=0;v<x.childNodes.length;v++){const R=x.childNodes[v];switch(R.nodeName){case"technique_common":return Se(R)}}return{}}function Se(x){const v={};for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];switch(A.nodeName){case"perspective":case"orthographic":v.technique=A.nodeName,v.parameters=Ie(A);break}}return v}function Ie(x){const v={};for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];switch(A.nodeName){case"xfov":case"yfov":case"xmag":case"ymag":case"znear":case"zfar":case"aspect_ratio":v[A.nodeName]=parseFloat(A.textContent);break}}return v}function de(x){let v;switch(x.optics.technique){case"perspective":v=new an(x.optics.parameters.yfov,x.optics.parameters.aspect_ratio,x.optics.parameters.znear,x.optics.parameters.zfar);break;case"orthographic":let R=x.optics.parameters.ymag,A=x.optics.parameters.xmag;const P=x.optics.parameters.aspect_ratio;A=A===void 0?R*P:A,R=R===void 0?A/P:R,A*=.5,R*=.5,v=new Sa(-A,A,R,-R,x.optics.parameters.znear,x.optics.parameters.zfar);break;default:v=new an;break}return v.name=x.name||"",v}function Pe(x){const v=ut.cameras[x];return v!==void 0?_(v,de):(console.warn("THREE.ColladaLoader: Couldn't find camera with ID:",x),null)}function qe(x){let v={};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"technique_common":v=ke(P);break}}ut.lights[x.getAttribute("id")]=v}function ke(x){const v={};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"directional":case"point":case"spot":case"ambient":v.technique=P.nodeName,v.parameters=Ae(P)}}return v}function Ae(x){const v={};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"color":const te=r(P.textContent);v.color=new et().fromArray(te),Mt.colorSpaceToWorking(v.color,Tt);break;case"falloff_angle":v.falloffAngle=parseFloat(P.textContent);break;case"quadratic_attenuation":const ce=parseFloat(P.textContent);v.distance=ce?Math.sqrt(1/ce):0;break}}return v}function rt(x){let v;switch(x.technique){case"directional":v=new yu;break;case"point":v=new xu;break;case"spot":v=new yp;break;case"ambient":v=new Mu;break}return x.parameters.color&&v.color.copy(x.parameters.color),x.parameters.distance&&(v.distance=x.parameters.distance),v}function G(x){const v=ut.lights[x];return v!==void 0?_(v,rt):(console.warn("THREE.ColladaLoader: Couldn't find light with ID:",x),null)}function De(x){const v={name:x.getAttribute("name"),sources:{},vertices:{},primitives:[]},R=n(x,"mesh")[0];if(R!==void 0){for(let A=0;A<R.childNodes.length;A++){const P=R.childNodes[A];if(P.nodeType!==1)continue;const te=P.getAttribute("id");switch(P.nodeName){case"source":v.sources[te]=ge(P);break;case"vertices":v.vertices=ze(P);break;case"polygons":console.warn("THREE.ColladaLoader: Unsupported primitive type: ",P.nodeName);break;case"lines":case"linestrips":case"polylist":case"triangles":v.primitives.push(ve(P));break;default:console.log(P)}}ut.geometries[x.getAttribute("id")]=v}}function ge(x){const v={array:[],stride:3};for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];if(A.nodeType===1)switch(A.nodeName){case"float_array":v.array=r(A.textContent);break;case"Name_array":v.array=i(A.textContent);break;case"technique_common":const P=n(A,"accessor")[0];P!==void 0&&(v.stride=parseInt(P.getAttribute("stride")));break}}return v}function ze(x){const v={};for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];A.nodeType===1&&(v[A.getAttribute("semantic")]=o(A.getAttribute("source")))}return v}function ve(x){const v={type:x.nodeName,material:x.getAttribute("material"),count:parseInt(x.getAttribute("count")),inputs:{},stride:0,hasUV:!1};for(let R=0,A=x.childNodes.length;R<A;R++){const P=x.childNodes[R];if(P.nodeType===1)switch(P.nodeName){case"input":const te=o(P.getAttribute("source")),ce=P.getAttribute("semantic"),He=parseInt(P.getAttribute("offset")),Re=parseInt(P.getAttribute("set")),Fe=Re>0?ce+Re:ce;v.inputs[Fe]={id:te,offset:He},v.stride=Math.max(v.stride,He+1),ce==="TEXCOORD"&&(v.hasUV=!0);break;case"vcount":v.vcount=a(P.textContent);break;case"p":v.p=a(P.textContent);break}}return v}function he(x){const v={};for(let R=0;R<x.length;R++){const A=x[R];v[A.type]===void 0&&(v[A.type]=[]),v[A.type].push(A)}return v}function Ge(x){let v=0;for(let R=0,A=x.length;R<A;R++)x[R].hasUV===!0&&v++;v>0&&v<x.length&&(x.uvsNeedsFix=!0)}function lt(x){const v={},R=x.sources,A=x.vertices,P=x.primitives;if(P.length===0)return{};const te=he(P);for(const ce in te){const He=te[ce];Ge(He),v[ce]=Lt(He,R,A)}return v}function Lt(x,v,R){const A={},P={array:[],stride:0},te={array:[],stride:0},ce={array:[],stride:0},He={array:[],stride:0},Re={array:[],stride:0},Fe={array:[],stride:4},Ke={array:[],stride:4},_e=new Bt,$e=[];let Xe=0;for(let nt=0;nt<x.length;nt++){const Qe=x[nt],Vt=Qe.inputs;let Dt=0;switch(Qe.type){case"lines":case"linestrips":Dt=Qe.count*2;break;case"triangles":Dt=Qe.count*3;break;case"polylist":for(let wt=0;wt<Qe.count;wt++){const At=Qe.vcount[wt];switch(At){case 3:Dt+=3;break;case 4:Dt+=6;break;default:Dt+=(At-2)*3;break}}break;default:console.warn("THREE.ColladaLoader: Unknown primitive type:",Qe.type)}_e.addGroup(Xe,Dt,nt),Xe+=Dt,Qe.material&&$e.push(Qe.material);for(const wt in Vt){const At=Vt[wt];switch(wt){case"VERTEX":for(const si in R){const Mn=R[si];switch(si){case"POSITION":const ns=P.array.length;if(pt(Qe,v[Mn],At.offset,P.array),P.stride=v[Mn].stride,v.skinWeights&&v.skinIndices&&(pt(Qe,v.skinIndices,At.offset,Fe.array),pt(Qe,v.skinWeights,At.offset,Ke.array)),Qe.hasUV===!1&&x.uvsNeedsFix===!0){const Hu=(P.array.length-ns)/P.stride;for(let Wl=0;Wl<Hu;Wl++)ce.array.push(0,0)}break;case"NORMAL":pt(Qe,v[Mn],At.offset,te.array),te.stride=v[Mn].stride;break;case"COLOR":pt(Qe,v[Mn],At.offset,Re.array),Re.stride=v[Mn].stride;break;case"TEXCOORD":pt(Qe,v[Mn],At.offset,ce.array),ce.stride=v[Mn].stride;break;case"TEXCOORD1":pt(Qe,v[Mn],At.offset,He.array),ce.stride=v[Mn].stride;break;default:console.warn('THREE.ColladaLoader: Semantic "%s" not handled in geometry build process.',si)}}break;case"NORMAL":pt(Qe,v[At.id],At.offset,te.array),te.stride=v[At.id].stride;break;case"COLOR":pt(Qe,v[At.id],At.offset,Re.array,!0),Re.stride=v[At.id].stride;break;case"TEXCOORD":pt(Qe,v[At.id],At.offset,ce.array),ce.stride=v[At.id].stride;break;case"TEXCOORD1":pt(Qe,v[At.id],At.offset,He.array),He.stride=v[At.id].stride;break}}}return P.array.length>0&&_e.setAttribute("position",new mt(P.array,P.stride)),te.array.length>0&&_e.setAttribute("normal",new mt(te.array,te.stride)),Re.array.length>0&&_e.setAttribute("color",new mt(Re.array,Re.stride)),ce.array.length>0&&_e.setAttribute("uv",new mt(ce.array,ce.stride)),He.array.length>0&&_e.setAttribute("uv1",new mt(He.array,He.stride)),Fe.array.length>0&&_e.setAttribute("skinIndex",new mt(Fe.array,Fe.stride)),Ke.array.length>0&&_e.setAttribute("skinWeight",new mt(Ke.array,Ke.stride)),A.data=_e,A.type=x[0].type,A.materialKeys=$e,A}function pt(x,v,R,A,P=!1){const te=x.p,ce=x.stride,He=x.vcount;function Re(_e){let $e=te[_e+R]*Ke;const Xe=$e+Ke;for(;$e<Xe;$e++)A.push(Fe[$e]);if(P){const nt=A.length-Ke-1;Wt.setRGB(A[nt+0],A[nt+1],A[nt+2],Tt),A[nt+0]=Wt.r,A[nt+1]=Wt.g,A[nt+2]=Wt.b}}const Fe=v.array,Ke=v.stride;if(x.vcount!==void 0){let _e=0;for(let $e=0,Xe=He.length;$e<Xe;$e++){const nt=He[$e];if(nt===4){const Qe=_e+ce*0,Vt=_e+ce*1,Dt=_e+ce*2,wt=_e+ce*3;Re(Qe),Re(Vt),Re(wt),Re(Vt),Re(Dt),Re(wt)}else if(nt===3){const Qe=_e+ce*0,Vt=_e+ce*1,Dt=_e+ce*2;Re(Qe),Re(Vt),Re(Dt)}else if(nt>4)for(let Qe=1,Vt=nt-2;Qe<=Vt;Qe++){const Dt=_e+ce*0,wt=_e+ce*Qe,At=_e+ce*(Qe+1);Re(Dt),Re(wt),Re(At)}_e+=ce*nt}}else for(let _e=0,$e=te.length;_e<$e;_e+=ce)Re(_e)}function en(x){return _(ut.geometries[x],lt)}function vn(x){const v={name:x.getAttribute("name")||"",joints:{},links:[]};for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];if(A.nodeType===1)switch(A.nodeName){case"technique_common":je(A,v);break}}ut.kinematicsModels[x.getAttribute("id")]=v}function Di(x){return x.build!==void 0?x.build:x}function Ni(x){return _(ut.kinematicsModels[x],Di)}function je(x,v){for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];if(A.nodeType===1)switch(A.nodeName){case"joint":v.joints[A.getAttribute("sid")]=qt(A);break;case"link":v.links.push(wn(A));break}}}function qt(x){let v;for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];if(A.nodeType===1)switch(A.nodeName){case"prismatic":case"revolute":v=jt(A);break}}return v}function jt(x){const v={sid:x.getAttribute("sid"),name:x.getAttribute("name")||"",axis:new F,limits:{min:0,max:0},type:x.nodeName,static:!1,zeroPosition:0,middlePosition:0};for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];if(A.nodeType===1)switch(A.nodeName){case"axis":const P=r(A.textContent);v.axis.fromArray(P);break;case"limits":const te=A.getElementsByTagName("max")[0],ce=A.getElementsByTagName("min")[0];v.limits.max=parseFloat(te.textContent),v.limits.min=parseFloat(ce.textContent);break}}return v.limits.min>=v.limits.max&&(v.static=!0),v.middlePosition=(v.limits.min+v.limits.max)/2,v}function wn(x){const v={sid:x.getAttribute("sid"),name:x.getAttribute("name")||"",attachments:[],transforms:[]};for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];if(A.nodeType===1)switch(A.nodeName){case"attachment_full":v.attachments.push(vi(A));break;case"matrix":case"translate":case"rotate":v.transforms.push(Yn(A));break}}return v}function vi(x){const v={joint:x.getAttribute("joint").split("/").pop(),transforms:[],links:[]};for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];if(A.nodeType===1)switch(A.nodeName){case"link":v.links.push(wn(A));break;case"matrix":case"translate":case"rotate":v.transforms.push(Yn(A));break}}return v}function Yn(x){const v={type:x.nodeName},R=r(x.textContent);switch(v.type){case"matrix":v.obj=new st,v.obj.fromArray(R).transpose();break;case"translate":v.obj=new F,v.obj.fromArray(R);break;case"rotate":v.obj=new F,v.obj.fromArray(R),v.angle=Xi.degToRad(R[3]);break}return v}function Ye(x){const v={name:x.getAttribute("name")||"",rigidBodies:{}};for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];if(A.nodeType===1)switch(A.nodeName){case"rigid_body":v.rigidBodies[A.getAttribute("name")]={},Te(A,v.rigidBodies[A.getAttribute("name")]);break}}ut.physicsModels[x.getAttribute("id")]=v}function Te(x,v){for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];if(A.nodeType===1)switch(A.nodeName){case"technique_common":Gt(A,v);break}}}function Gt(x,v){for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];if(A.nodeType===1)switch(A.nodeName){case"inertia":v.inertia=r(A.textContent);break;case"mass":v.mass=r(A.textContent)[0];break}}}function xn(x){const v={bindJointAxis:[]};for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];if(A.nodeType===1)switch(A.nodeName){case"bind_joint_axis":v.bindJointAxis.push(Yt(A));break}}ut.kinematicsScenes[o(x.getAttribute("url"))]=v}function Yt(x){const v={target:x.getAttribute("target").split("/").pop()};for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];if(A.nodeType===1)switch(A.nodeName){case"axis":const P=A.getElementsByTagName("param")[0];v.axis=P.textContent;const te=v.axis.split("inst_").pop().split("axis")[0];v.jointIndex=te.substring(0,te.length-1);break}}return v}function dn(x){return x.build!==void 0?x.build:x}function An(x){return _(ut.kinematicsScenes[x],dn)}function Qi(){const x=Object.keys(ut.kinematicsModels)[0],v=Object.keys(ut.kinematicsScenes)[0],R=Object.keys(ut.visualScenes)[0];if(x===void 0||v===void 0)return;const A=Ni(x),P=An(v),te=St(R),ce=P.bindJointAxis,He={};for(let Ke=0,_e=ce.length;Ke<_e;Ke++){const $e=ce[Ke],Xe=zt.querySelector('[sid="'+$e.target+'"]');if(Xe){const nt=Xe.parentElement;Re($e.jointIndex,nt)}}function Re(Ke,_e){const $e=_e.getAttribute("name"),Xe=A.joints[Ke];te.traverse(function(nt){nt.name===$e&&(He[Ke]={object:nt,transforms:es(_e),joint:Xe,position:Xe.zeroPosition})})}const Fe=new st;ts={joints:A&&A.joints,getJointValue:function(Ke){const _e=He[Ke];if(_e)return _e.position;console.warn("THREE.ColladaLoader: Joint "+Ke+" doesn't exist.")},setJointValue:function(Ke,_e){const $e=He[Ke];if($e){const Xe=$e.joint;if(_e>Xe.limits.max||_e<Xe.limits.min)console.warn("THREE.ColladaLoader: Joint "+Ke+" value "+_e+" outside of limits (min: "+Xe.limits.min+", max: "+Xe.limits.max+").");else if(Xe.static)console.warn("THREE.ColladaLoader: Joint "+Ke+" is static.");else{const nt=$e.object,Qe=Xe.axis,Vt=$e.transforms;X.identity();for(let Dt=0;Dt<Vt.length;Dt++){const wt=Vt[Dt];if(wt.sid&&wt.sid.indexOf(Ke)!==-1)switch(Xe.type){case"revolute":X.multiply(Fe.makeRotationAxis(Qe,Xi.degToRad(_e)));break;case"prismatic":X.multiply(Fe.makeTranslation(Qe.x*_e,Qe.y*_e,Qe.z*_e));break;default:console.warn("THREE.ColladaLoader: Unknown joint type: "+Xe.type);break}else switch(wt.type){case"matrix":X.multiply(wt.obj);break;case"translate":X.multiply(Fe.makeTranslation(wt.obj.x,wt.obj.y,wt.obj.z));break;case"scale":X.scale(wt.obj);break;case"rotate":X.multiply(Fe.makeRotationAxis(wt.obj,wt.angle));break}}nt.matrix.copy(X),nt.matrix.decompose(nt.position,nt.quaternion,nt.scale),He[Ke].position=_e}}else console.log("THREE.ColladaLoader: "+Ke+" does not exist.")}}}function es(x){const v=[],R=zt.querySelector('[id="'+x.id+'"]');for(let A=0;A<R.childNodes.length;A++){const P=R.childNodes[A];if(P.nodeType!==1)continue;let te,ce;switch(P.nodeName){case"matrix":te=r(P.textContent);const He=new st().fromArray(te).transpose();v.push({sid:P.getAttribute("sid"),type:P.nodeName,obj:He});break;case"translate":case"scale":te=r(P.textContent),ce=new F().fromArray(te),v.push({sid:P.getAttribute("sid"),type:P.nodeName,obj:ce});break;case"rotate":te=r(P.textContent),ce=new F().fromArray(te);const Re=Xi.degToRad(te[3]);v.push({sid:P.getAttribute("sid"),type:P.nodeName,obj:ce,angle:Re});break}}return v}function C(x){const v=x.getElementsByTagName("node");for(let R=0;R<v.length;R++){const A=v[R];A.hasAttribute("id")===!1&&A.setAttribute("id",l())}}const X=new st,Z=new F;function ee(x){const v={name:x.getAttribute("name")||"",type:x.getAttribute("type"),id:x.getAttribute("id"),sid:x.getAttribute("sid"),matrix:new st,nodes:[],instanceCameras:[],instanceControllers:[],instanceLights:[],instanceGeometries:[],instanceNodes:[],transforms:{}};for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];if(A.nodeType!==1)continue;let P;switch(A.nodeName){case"node":v.nodes.push(A.getAttribute("id")),ee(A);break;case"instance_camera":v.instanceCameras.push(o(A.getAttribute("url")));break;case"instance_controller":v.instanceControllers.push(q(A));break;case"instance_light":v.instanceLights.push(o(A.getAttribute("url")));break;case"instance_geometry":v.instanceGeometries.push(q(A));break;case"instance_node":v.instanceNodes.push(o(A.getAttribute("url")));break;case"matrix":P=r(A.textContent),v.matrix.multiply(X.fromArray(P).transpose()),v.transforms[A.getAttribute("sid")]=A.nodeName;break;case"translate":P=r(A.textContent),Z.fromArray(P),v.matrix.multiply(X.makeTranslation(Z.x,Z.y,Z.z)),v.transforms[A.getAttribute("sid")]=A.nodeName;break;case"rotate":P=r(A.textContent);const te=Xi.degToRad(P[3]);v.matrix.multiply(X.makeRotationAxis(Z.fromArray(P),te)),v.transforms[A.getAttribute("sid")]=A.nodeName;break;case"scale":P=r(A.textContent),v.matrix.scale(Z.fromArray(P)),v.transforms[A.getAttribute("sid")]=A.nodeName;break;case"extra":break;default:console.log(A)}}return Ze(v.id)?console.warn("THREE.ColladaLoader: There is already a node with ID %s. Exclude current node from further processing.",v.id):ut.nodes[v.id]=v,v}function q(x){const v={id:o(x.getAttribute("url")),materials:{},skeletons:[]};for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];switch(A.nodeName){case"bind_material":const P=A.getElementsByTagName("instance_material");for(let te=0;te<P.length;te++){const ce=P[te],He=ce.getAttribute("symbol"),Re=ce.getAttribute("target");v.materials[He]=o(Re)}break;case"skeleton":v.skeletons.push(o(A.textContent));break}}return v}function me(x,v){const R=[],A=[];let P,te,ce;for(P=0;P<x.length;P++){const Fe=x[P];let Ke;if(Ze(Fe))Ke=gt(Fe),Ce(Ke,v,R);else if(kt(Fe)){const $e=ut.visualScenes[Fe].children;for(let Xe=0;Xe<$e.length;Xe++){const nt=$e[Xe];if(nt.type==="JOINT"){const Qe=gt(nt.id);Ce(Qe,v,R)}}}else console.error("THREE.ColladaLoader: Unable to find root bone of skeleton with ID:",Fe)}for(P=0;P<v.length;P++)for(te=0;te<R.length;te++)if(ce=R[te],ce.bone.name===v[P].name){A[P]=ce,ce.processed=!0;break}for(P=0;P<R.length;P++)ce=R[P],ce.processed===!1&&(A.push(ce),ce.processed=!0);const He=[],Re=[];for(P=0;P<A.length;P++)ce=A[P],He.push(ce.bone),Re.push(ce.boneInverse);return new Ll(He,Re)}function Ce(x,v,R){x.traverse(function(A){if(A.isBone===!0){let P;for(let te=0;te<v.length;te++){const ce=v[te];if(ce.name===A.name){P=ce.boneInverse;break}}P===void 0&&(P=new st),R.push({bone:A,boneInverse:P,processed:!1})}})}function We(x){const v=[],R=x.matrix,A=x.nodes,P=x.type,te=x.instanceCameras,ce=x.instanceControllers,He=x.instanceLights,Re=x.instanceGeometries,Fe=x.instanceNodes;for(let _e=0,$e=A.length;_e<$e;_e++)v.push(gt(A[_e]));for(let _e=0,$e=te.length;_e<$e;_e++){const Xe=Pe(te[_e]);Xe!==null&&v.push(Xe.clone())}for(let _e=0,$e=ce.length;_e<$e;_e++){const Xe=ce[_e],nt=se(Xe.id),Qe=en(nt.id),Vt=ht(Qe,Xe.materials),Dt=Xe.skeletons,wt=nt.skin.joints,At=me(Dt,wt);for(let si=0,Mn=Vt.length;si<Mn;si++){const ns=Vt[si];ns.isSkinnedMesh&&(ns.bind(At,nt.skin.bindMatrix),ns.normalizeSkinWeights()),v.push(ns)}}for(let _e=0,$e=He.length;_e<$e;_e++){const Xe=G(He[_e]);Xe!==null&&v.push(Xe.clone())}for(let _e=0,$e=Re.length;_e<$e;_e++){const Xe=Re[_e],nt=en(Xe.id),Qe=ht(nt,Xe.materials);for(let Vt=0,Dt=Qe.length;Vt<Dt;Vt++)v.push(Qe[Vt])}for(let _e=0,$e=Fe.length;_e<$e;_e++)v.push(gt(Fe[_e]).clone());let Ke;if(A.length===0&&v.length===1)Ke=v[0];else{Ke=P==="JOINT"?new uu:new ei;for(let _e=0;_e<v.length;_e++)Ke.add(v[_e])}return Ke.name=P==="JOINT"?x.sid:x.name,Ke.matrix.copy(R),Ke.matrix.decompose(Ke.position,Ke.quaternion,Ke.scale),Ke}const Ve=new Pi({name:Xn.DEFAULT_MATERIAL_NAME,color:16711935});function ct(x,v){const R=[];for(let A=0,P=x.length;A<P;A++){const te=v[x[A]];te===void 0?(console.warn("THREE.ColladaLoader: Material with key %s not found. Apply fallback material.",x[A]),R.push(Ve)):R.push(O(te))}return R}function ht(x,v){const R=[];for(const A in x){const P=x[A],te=ct(P.materialKeys,v);if(te.length===0&&(A==="lines"||A==="linestrips"?te.push(new Li):te.push(new Sn)),A==="lines"||A==="linestrips")for(let Fe=0,Ke=te.length;Fe<Ke;Fe++){const _e=te[Fe];if(_e.isMeshPhongMaterial===!0||_e.isMeshLambertMaterial===!0){const $e=new Li;$e.color.copy(_e.color),$e.opacity=_e.opacity,$e.transparent=_e.transparent,te[Fe]=$e}}const ce=P.data.attributes.skinIndex!==void 0,He=te.length===1?te[0]:te;let Re;switch(A){case"lines":Re=new pa(P.data,He);break;case"linestrips":Re=new Dl(P.data,He);break;case"triangles":case"polylist":ce?Re=new Uf(P.data,He):Re=new Ct(P.data,He);break}R.push(Re)}return R}function Ze(x){return ut.nodes[x]!==void 0}function gt(x){return _(ut.nodes[x],We)}function Rt(x){const v={name:x.getAttribute("name"),children:[]};C(x);const R=n(x,"node");for(let A=0;A<R.length;A++)v.children.push(ee(R[A]));ut.visualScenes[x.getAttribute("id")]=v}function Ot(x){const v=new ei;v.name=x.name;const R=x.children;for(let A=0;A<R.length;A++){const P=R[A];v.add(gt(P.id))}return v}function kt(x){return ut.visualScenes[x]!==void 0}function St(x){return _(ut.visualScenes[x],Ot)}function tt(x){const v=n(x,"instance_visual_scene")[0];return St(o(v.getAttribute("url")))}function $t(){const x=ut.clips;if(c(x)===!0){if(c(ut.animations)===!1){const v=[];for(const R in ut.animations){const A=S(R);for(let P=0,te=A.length;P<te;P++)v.push(A[P])}Jt.push(new Oc("default",-1,v))}}else for(const v in x)Jt.push(j(v))}function Et(x){let v="";const R=[x];for(;R.length;){const A=R.shift();A.nodeType===Node.TEXT_NODE?v+=A.textContent:(v+=`
|
|
4205
4205
|
`,R.push(...A.childNodes))}return v.trim()}if(e.length===0)return{scene:new Cl};const yn=new DOMParser().parseFromString(e,"application/xml"),zt=n(yn,"COLLADA")[0],tn=yn.getElementsByTagName("parsererror")[0];if(tn!==void 0){const x=n(tn,"div")[0];let v;return x?v=x.textContent:v=Et(tn),console.error(`THREE.ColladaLoader: Failed to parse collada file.
|
|
4206
|
-
`,v),null}const Ui=zt.getAttribute("version");console.debug("THREE.ColladaLoader: File version",Ui);const Ft=h(n(zt,"asset")[0]),fn=new Ol(this.manager);fn.setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin);let ln;Uh&&(ln=new Uh(this.manager),ln.setPath(this.resourcePath||t));const Wt=new et,Jt=[];let ts={},ii=0;const ut={animations:{},clips:{},controllers:{},images:{},effects:{},materials:{},cameras:{},lights:{},geometries:{},nodes:{},visualScenes:{},kinematicsModels:{},physicsModels:{},kinematicsScenes:{}};d(zt,"library_animations","animation",g),d(zt,"library_animation_clips","animation_clip",B),d(zt,"library_controllers","controller",ue),d(zt,"library_images","image",re),d(zt,"library_effects","effect",fe),d(zt,"library_materials","material",k),d(zt,"library_cameras","camera",we),d(zt,"library_lights","light",qe),d(zt,"library_geometries","geometry",De),d(zt,"library_nodes","node",ee),d(zt,"library_visual_scenes","visual_scene",Rt),d(zt,"library_kinematics_models","kinematics_model",vn),d(zt,"library_physics_models","physics_model",Ye),d(zt,"scene","instance_kinematics_scene",xn),m(ut.animations,E),m(ut.clips,oe),m(ut.controllers,Ne),m(ut.images,le),m(ut.effects,T),m(ut.materials,Q),m(ut.cameras,de),m(ut.lights,rt),m(ut.geometries,lt),m(ut.visualScenes,Ot),$t(),Qi();const ur=tt(n(zt,"scene")[0]);return ur.animations=Jt,Ft.upAxis==="Z_UP"&&(console.warn("THREE.ColladaLoader: You are loading an asset with a Z-UP coordinate system. The loader just rotates the asset to transform it into Y-UP. The vertex data are not converted, see #24289."),ur.rotation.set(-Math.PI/2,0,0)),ur.scale.multiplyScalar(Ft.unit),{get animations(){return console.warn("THREE.ColladaLoader: Please access animations over scene.animations now."),Jt},kinematics:ts,library:ut,scene:ur}}}const Ih=new F,jg=new _n,$r=new st,wi=new st,Jr=new Pn,Kr=new F(1,1,1),Zr=new F;class wa extends It{constructor(...e){super(...e),this.urdfNode=null,this.urdfName=""}copy(e,t){return super.copy(e,t),this.urdfNode=e.urdfNode,this.urdfName=e.urdfName,this}}class Yg extends wa{constructor(...e){super(...e),this.isURDFCollider=!0,this.type="URDFCollider"}}class $g extends wa{constructor(...e){super(...e),this.isURDFVisual=!0,this.type="URDFVisual"}}class Nu extends wa{constructor(...e){super(...e),this.isURDFLink=!0,this.type="URDFLink"}}class Uu extends wa{get jointType(){return this._jointType}set jointType(e){if(this.jointType!==e)switch(this._jointType=e,this.matrixWorldNeedsUpdate=!0,e){case"fixed":this.jointValue=[];break;case"continuous":case"revolute":case"prismatic":this.jointValue=new Array(1).fill(0);break;case"planar":this.jointValue=new Array(3).fill(0),this.axis=new F(0,0,1);break;case"floating":this.jointValue=new Array(6).fill(0);break}}get angle(){return this.jointValue[0]}constructor(...e){super(...e),this.isURDFJoint=!0,this.type="URDFJoint",this.jointValue=null,this.jointType="fixed",this.axis=new F(1,0,0),this.limit={lower:0,upper:0},this.ignoreLimits=!1,this.origPosition=null,this.origQuaternion=null,this.mimicJoints=[]}copy(e,t){return super.copy(e,t),this.jointType=e.jointType,this.axis=e.axis.clone(),this.limit.lower=e.limit.lower,this.limit.upper=e.limit.upper,this.ignoreLimits=!1,this.jointValue=[...e.jointValue],this.origPosition=e.origPosition?e.origPosition.clone():null,this.origQuaternion=e.origQuaternion?e.origQuaternion.clone():null,this.mimicJoints=[...e.mimicJoints],this}setJointValue(...e){e=e.map(n=>n===null?null:parseFloat(n)),(!this.origPosition||!this.origQuaternion)&&(this.origPosition=this.position.clone(),this.origQuaternion=this.quaternion.clone());let t=!1;switch(this.mimicJoints.forEach(n=>{t=n.updateFromMimickedJoint(...e)||t}),this.jointType){case"fixed":return t;case"continuous":case"revolute":{let n=e[0];return n==null||n===this.jointValue[0]?t:(!this.ignoreLimits&&this.jointType==="revolute"&&(n=Math.min(this.limit.upper,n),n=Math.max(this.limit.lower,n)),this.quaternion.setFromAxisAngle(this.axis,n).premultiply(this.origQuaternion),this.jointValue[0]!==n?(this.jointValue[0]=n,this.matrixWorldNeedsUpdate=!0,!0):t)}case"prismatic":{let n=e[0];return n==null||n===this.jointValue[0]?t:(this.ignoreLimits||(n=Math.min(this.limit.upper,n),n=Math.max(this.limit.lower,n)),this.position.copy(this.origPosition),Ih.copy(this.axis).applyEuler(this.rotation),this.position.addScaledVector(Ih,n),this.jointValue[0]!==n?(this.jointValue[0]=n,this.matrixWorldNeedsUpdate=!0,!0):t)}case"floating":return this.jointValue.every((n,i)=>e[i]===n||e[i]===null)?t:(this.jointValue[0]=e[0]!==null?e[0]:this.jointValue[0],this.jointValue[1]=e[1]!==null?e[1]:this.jointValue[1],this.jointValue[2]=e[2]!==null?e[2]:this.jointValue[2],this.jointValue[3]=e[3]!==null?e[3]:this.jointValue[3],this.jointValue[4]=e[4]!==null?e[4]:this.jointValue[4],this.jointValue[5]=e[5]!==null?e[5]:this.jointValue[5],wi.compose(this.origPosition,this.origQuaternion,Kr),Jr.setFromEuler(jg.set(this.jointValue[3],this.jointValue[4],this.jointValue[5],"XYZ")),Zr.set(this.jointValue[0],this.jointValue[1],this.jointValue[2]),$r.compose(Zr,Jr,Kr),wi.premultiply($r),this.position.setFromMatrixPosition(wi),this.rotation.setFromRotationMatrix(wi),this.matrixWorldNeedsUpdate=!0,!0);case"planar":return this.jointValue.every((n,i)=>e[i]===n||e[i]===null)?t:(this.jointValue[0]=e[0]!==null?e[0]:this.jointValue[0],this.jointValue[1]=e[1]!==null?e[1]:this.jointValue[1],this.jointValue[2]=e[2]!==null?e[2]:this.jointValue[2],wi.compose(this.origPosition,this.origQuaternion,Kr),Jr.setFromAxisAngle(this.axis,this.jointValue[2]),Zr.set(this.jointValue[0],this.jointValue[1],0),$r.compose(Zr,Jr,Kr),wi.premultiply($r),this.position.setFromMatrixPosition(wi),this.rotation.setFromRotationMatrix(wi),this.matrixWorldNeedsUpdate=!0,!0)}return t}}class Fh extends Uu{constructor(...e){super(...e),this.type="URDFMimicJoint",this.mimicJoint=null,this.offset=0,this.multiplier=1}updateFromMimickedJoint(...e){const t=e.map(n=>n*this.multiplier+this.offset);return super.setJointValue(...t)}copy(e,t){return super.copy(e,t),this.mimicJoint=e.mimicJoint,this.offset=e.offset,this.multiplier=e.multiplier,this}}class Jg extends Nu{constructor(...e){super(...e),this.isURDFRobot=!0,this.urdfNode=null,this.urdfRobotNode=null,this.robotName=null,this.links=null,this.joints=null,this.colliders=null,this.visual=null,this.frames=null}copy(e,t){super.copy(e,t),this.urdfRobotNode=e.urdfRobotNode,this.robotName=e.robotName,this.links={},this.joints={},this.colliders={},this.visual={},this.traverse(n=>{n.isURDFJoint&&n.urdfName in e.joints&&(this.joints[n.urdfName]=n),n.isURDFLink&&n.urdfName in e.links&&(this.links[n.urdfName]=n),n.isURDFCollider&&n.urdfName in e.colliders&&(this.colliders[n.urdfName]=n),n.isURDFVisual&&n.urdfName in e.visual&&(this.visual[n.urdfName]=n)});for(const n in this.joints)this.joints[n].mimicJoints=this.joints[n].mimicJoints.map(i=>this.joints[i.name]);return this.frames={...this.colliders,...this.visual,...this.links,...this.joints},this}getFrame(e){return this.frames[e]}setJointValue(e,...t){const n=this.joints[e];return n?n.setJointValue(...t):!1}setJointValues(e){let t=!1;for(const n in e){const i=e[n];Array.isArray(i)?t=this.setJointValue(n,...i)||t:t=this.setJointValue(n,i)||t}return t}}const xo=new Pn,Oh=new _n;function bs(s){return s?s.trim().split(/\s+/g).map(e=>parseFloat(e)):[0,0,0]}function zh(s,e,t=!1){t||s.rotation.set(0,0,0),Oh.set(e[0],e[1],e[2],"ZYX"),xo.setFromEuler(Oh),xo.multiply(s.quaternion),s.quaternion.copy(xo)}class Kg{constructor(e){this.manager=e||Fl,this.loadMeshCb=this.defaultMeshLoader.bind(this),this.parseVisual=!0,this.parseCollision=!1,this.packages="",this.workingPath="",this.fetchOptions={}}loadAsync(e){return new Promise((t,n)=>{this.load(e,t,null,n)})}load(e,t,n,i){const r=this.manager,a=Bl.extractUrlBase(e),o=this.manager.resolveURL(e);r.itemStart(o),fetch(o,this.fetchOptions).then(l=>{if(l.ok)return n&&n(null),l.text();throw new Error(`URDFLoader: Failed to load url '${o}' with error code ${l.status} : ${l.statusText}.`)}).then(l=>{const c=this.parse(l,this.workingPath||a);t(c),r.itemEnd(o)}).catch(l=>{i?i(l):console.error("URDFLoader: Error loading file.",l),r.itemError(o),r.itemEnd(o)})}parse(e,t=this.workingPath){const n=this.packages,i=this.loadMeshCb,r=this.parseVisual,a=this.parseCollision,o=this.manager,l={},c={},h={};function f(w){if(!/^package:\/\//.test(w))return t?t+w:w;const[E,S]=w.replace(/^package:\/\//,"").split(/\/(.+)/);if(typeof n=="string")return n.endsWith(E)?n+"/"+S:n+"/"+E+"/"+S;if(n instanceof Function)return n(E)+"/"+S;if(typeof n=="object")return E in n?n[E]+"/"+S:(console.error(`URDFLoader : ${E} not found in provided package list.`),null)}function u(w){let E;w instanceof Document?E=[...w.children]:w instanceof Element?E=[w]:E=[...new DOMParser().parseFromString(w,"text/xml").children];const S=E.filter(U=>U.nodeName==="robot").pop();return d(S)}function d(w){const E=[...w.children],S=E.filter(I=>I.nodeName.toLowerCase()==="link"),U=E.filter(I=>I.nodeName.toLowerCase()==="joint"),L=E.filter(I=>I.nodeName.toLowerCase()==="material"),D=new Jg;D.robotName=w.getAttribute("name"),D.urdfRobotNode=w,L.forEach(I=>{const V=I.getAttribute("name");h[V]=g(I)});const N={},b={};S.forEach(I=>{const V=I.getAttribute("name"),H=w.querySelector(`child[link="${V}"]`)===null;l[V]=_(I,N,b,H?D:null)}),U.forEach(I=>{const V=I.getAttribute("name");c[V]=m(I)}),D.joints=c,D.links=l,D.colliders=b,D.visual=N;const M=Object.values(c);return M.forEach(I=>{I instanceof Fh&&c[I.mimicJoint].mimicJoints.push(I)}),M.forEach(I=>{const V=new Set,H=J=>{if(V.has(J))throw new Error("URDFLoader: Detected an infinite loop of mimic joints.");V.add(J),J.mimicJoints.forEach(ie=>{H(ie)})};H(I)}),D.frames={...b,...N,...l,...c},D}function m(w){const E=[...w.children],S=w.getAttribute("type");let U;const L=E.find(V=>V.nodeName.toLowerCase()==="mimic");L?(U=new Fh,U.mimicJoint=L.getAttribute("joint"),U.multiplier=parseFloat(L.getAttribute("multiplier")||1),U.offset=parseFloat(L.getAttribute("offset")||0)):U=new Uu,U.urdfNode=w,U.name=w.getAttribute("name"),U.urdfName=U.name,U.jointType=S;let D=null,N=null,b=[0,0,0],M=[0,0,0];E.forEach(V=>{const H=V.nodeName.toLowerCase();H==="origin"?(b=bs(V.getAttribute("xyz")),M=bs(V.getAttribute("rpy"))):H==="child"?N=l[V.getAttribute("link")]:H==="parent"?D=l[V.getAttribute("link")]:H==="limit"&&(U.limit.lower=parseFloat(V.getAttribute("lower")||U.limit.lower),U.limit.upper=parseFloat(V.getAttribute("upper")||U.limit.upper))}),D.add(U),U.add(N),zh(U,M),U.position.set(b[0],b[1],b[2]);const I=E.filter(V=>V.nodeName.toLowerCase()==="axis")[0];if(I){const V=I.getAttribute("xyz").split(/\s+/g).map(H=>parseFloat(H));U.axis=new F(V[0],V[1],V[2]),U.axis.normalize()}return U}function _(w,E,S,U=null){U===null&&(U=new Nu);const L=[...w.children];return U.name=w.getAttribute("name"),U.urdfName=U.name,U.urdfNode=w,r&&L.filter(N=>N.nodeName.toLowerCase()==="visual").forEach(N=>{const b=p(N,h);if(U.add(b),N.hasAttribute("name")){const M=N.getAttribute("name");b.name=M,b.urdfName=M,E[M]=b}}),a&&L.filter(N=>N.nodeName.toLowerCase()==="collision").forEach(N=>{const b=p(N);if(U.add(b),N.hasAttribute("name")){const M=N.getAttribute("name");b.name=M,b.urdfName=M,S[M]=b}}),U}function g(w){const E=[...w.children],S=new Sn;return S.name=w.getAttribute("name")||"",E.forEach(U=>{const L=U.nodeName.toLowerCase();if(L==="color"){const D=U.getAttribute("rgba").split(/\s/g).map(N=>parseFloat(N));S.color.setRGB(D[0],D[1],D[2]),S.opacity=D[3],S.transparent=D[3]<1,S.depthWrite=!S.transparent}else if(L==="texture"){const D=U.getAttribute("filename");if(D){const N=new Ol(o),b=f(D);S.map=N.load(b),S.map.colorSpace=Tt}}}),S}function p(w,E={}){const S=w.nodeName.toLowerCase()==="collision",U=[...w.children];let L=null;const D=U.filter(b=>b.nodeName.toLowerCase()==="material")[0];if(D){const b=D.getAttribute("name");b&&b in E?L=E[b]:L=g(D)}else L=new Sn;const N=S?new Yg:new $g;return N.urdfNode=w,U.forEach(b=>{const M=b.nodeName.toLowerCase();if(M==="geometry"){const I=b.children[0].nodeName.toLowerCase();if(I==="mesh"){const V=b.children[0].getAttribute("filename"),H=f(V);if(H!==null){const J=b.children[0].getAttribute("scale");if(J){const ie=bs(J);N.scale.set(ie[0],ie[1],ie[2])}i(H,o,(ie,B)=>{B?console.error("URDFLoader: Error loading mesh.",B):ie&&(ie instanceof Ct&&(ie.material=L),ie.position.set(0,0,0),ie.quaternion.identity(),N.add(ie))})}}else if(I==="box"){const V=new Ct;V.geometry=new Zi(1,1,1),V.material=L;const H=bs(b.children[0].getAttribute("size"));V.scale.set(H[0],H[1],H[2]),N.add(V)}else if(I==="sphere"){const V=new Ct;V.geometry=new Ma(1,30,30),V.material=L;const H=parseFloat(b.children[0].getAttribute("radius"))||0;V.scale.set(H,H,H),N.add(V)}else if(I==="cylinder"){const V=new Ct;V.geometry=new Nl(1,1,1,30),V.material=L;const H=parseFloat(b.children[0].getAttribute("radius"))||0,J=parseFloat(b.children[0].getAttribute("length"))||0;V.scale.set(H,J,H),V.rotation.set(Math.PI/2,0,0),N.add(V)}}else if(M==="origin"){const I=bs(b.getAttribute("xyz")),V=bs(b.getAttribute("rpy"));N.position.set(I[0],I[1],I[2]),N.rotation.set(0,0,0),zh(N,V)}}),N}return u(e)}defaultMeshLoader(e,t,n){/\.stl$/i.test(e)?new la(t).load(e,r=>{const a=new Ct(r,new Sn);n(a)}):/\.dae$/i.test(e)?new qg(t).load(e,r=>n(r.scene)):console.warn(`URDFLoader: Could not load model at ${e}.
|
|
4207
|
-
No loader available`)}}const Zg=Vh.useModelComp(ft.pinia),{systemPath:Bh}=ft.storeToRefs(Zg),Qr=$.ref(),kh=new Map;function Qg(s,e,t,n,i){const r=async u=>{try{const d=await kn.downloadAvatarApi({url:u});if(d.status!==200)throw new Error(`下载失败: ${d.status}`);return d.data}catch(d){throw console.error("addModelFromUrl失败:",d),d}},a=u=>new Promise((d,m)=>{const _=new FileReader;_.onload=g=>{try{const p=g.target.result,E=new vo().parse(p);E.preload(),d(E)}catch(p){m(p)}},_.onerror=()=>{m(new Error("MTL文件读取失败"))},_.readAsText(u)}),o=async u=>{const d={materials:{},create:function(m){return this.materials[m]?this.materials[m]:(console.warn(`Material '${m}' not found, using default material`),new Sn({color:8947848,side:un}))},getAsArray:function(){const m=[];for(const _ in this.materials)m.push(this.materials[_]);return m},preload:function(){for(const m in this.materials)this.materials[m].map&&(this.materials[m].map.needsUpdate=!0)}};for(const m of u){const _=await a(m);Object.assign(d.materials,_.materials)}return d.preload(),d},l=async(u,d=[])=>new Promise((m,_)=>{const g=new FileReader;g.onload=async p=>{try{const w=p.target.result;let E=null;d&&d.length>0&&(d.length===1?E=await a(d[0]):E=await o(d));const S=new _o;E&&S.setMaterials(E);const U=S.parse(w);E||U.traverse(L=>{L.isMesh&&(L.material=new Sn({color:8947848,side:un}))}),m(U)}catch(w){_(w)}},g.onerror=()=>{_(new Error("OBJ文件读取失败"))},g.readAsText(u)}),c=async u=>{var d;try{t.value=!0;const{scene:m}=s();if(!m)throw new Error("Scene not initialized");i();const _=[];for(let g=0;g<u.length;g++){const p=u[g];n.value=`正在加载模型 ${g+1}/${u.length}...`;const w=await r(p.objUrl),E=((d=p.objUrl)==null?void 0:d.split("/").pop())||`model_${g}.obj`,S=new File([w],E,{type:w.type});let U=[];if(p.mtlUrls){const D=Array.isArray(p.mtlUrls)?p.mtlUrls:[p.mtlUrls];for(let N=0;N<D.length;N++){const b=D[N],M=await r(b),I=(b==null?void 0:b.split("/").pop())||`material_${g}_${N}.mtl`,V=new File([M],I,{type:M.type});U.push(V)}}const L=await l(S,U);m.add(L),e.value.push(L),_.push(L)}return t.value=!1,_}catch(m){throw console.error("加载模型失败:",m),t.value=!1,m}},h=async(u,d,m=[],_=[])=>{let g;const p=u.toLowerCase();switch(p){case".txt":case".cpt":case".obj":const w=await d.text();if(p===".txt"||p===".cpt"){const fe=/^(?!.*\bf\b)[^\n]*?(-?\d*\.?\d+)[^\n]*?(-?\d*\.?\d+)[^\n]*?(-?\d*\.?\d+)[^\n]*?$/gm,Je=[...w.matchAll(fe)].map(z=>({x:parseFloat(z[1]),y:parseFloat(z[2]),z:parseFloat(z[3])})),at=new Bt,it=Je.flatMap(z=>[z.x,z.y,z.z]);if(at.setAttribute("position",new mt(it,3)),p===".txt"){const z=new ji({color:"#5B5C99",size:1,sizeAttenuation:!1});g=new Zs(at,z)}else if(p===".cpt"){const z=new Li({color:"#5B5C99",linewidth:100});g=new Dl(at,z)}}else if(p===".obj"){const fe=new _o;if(m&&m.length>0){const be=new vo;for(const Je of m){const at=await Je.text(),it=be.parse(at);it.preload(),fe.setMaterials(it);break}}g=fe.parse(w),(!m||m.length===0)&&g.traverse(be=>{be.isMesh&&(be.material=new Sn({color:"#B3B3D4"})),be instanceof Ct&&(be.material.side=un)})}break;case".stl":const E=await d.arrayBuffer(),U=new la().parse(E),L=new Sn({color:"#B3B3D4",side:un});g=new Ct(U,L);break;case".nc":const D=["Mach_B_Axis_0.STL","Mach_C_Axis_0.STL","Mach_X_Axis_0.STL","Mach_Y_Axis_0.STL","Mach_Z_Axis_0.STL","Mach_Spindle_0.STL"],N={"Mach_Y_Axis_0.STL":"rgb(128,118,152)","Mach_B_Axis_0.STL":"rgb(204,143,89)","Mach_C_Axis_0.STL":"rgb(145,245,251)","Mach_X_Axis_0.STL":"rgb(125,158,192)","Mach_Z_Axis_0.STL":"rgb(248,228,118)","Mach_Spindle_0.STL":"rgb(145,145,145)"},b=new ei,M=D.map(fe=>new Promise((be,Je)=>{new la().load(Bh.value===""?`/model/${fe}`:`${Bh.value}\\${fe}`,it=>{const z=new Sn({color:N[fe]||"#B3B3D4",side:un}),yt=new Ct(it,z);be(yt)},void 0,Je)}));try{(await Promise.all(M)).forEach(be=>b.add(be)),g=b}catch(fe){throw console.error("加载NC文件对应的STL文件失败:",fe),new Error("无法加载.NC文件对应的STL文件")}break;case".pcd":const I=new Xg,V=new ei;try{const fe=await ft.axios.get("http://139.196.154.85:20026/chfs/shared/重大专项/重大专项文件/target.pcd",{responseType:"blob",headers:{"Content-Type":"application/json"}}),be=new Blob([fe.data],{type:"application/octet-stream;charset=UTF-8"}),Je=await ft.axios.get("http://139.196.154.85:20026/chfs/shared/重大专项/重大专项文件/final.pcd",{responseType:"blob",headers:{"Content-Type":"application/json"}}),at=new Blob([Je.data],{type:"application/octet-stream;charset=UTF-8"}),it=await new Promise((yt,dt)=>{const ot=URL.createObjectURL(be);I.load(ot,W=>{const ae=new Float32Array(W.geometry.attributes.position.count*3);for(let ne=0;ne<W.geometry.attributes.position.count;ne++)ae[ne*3]=1,ae[ne*3+1]=0,ae[ne*3+2]=0;W.geometry.setAttribute("color",new Ht(ae,3)),W.material.vertexColors=!0,W.scale.set(.3,.3,.3),URL.revokeObjectURL(ot),yt(W)},void 0,dt)}),z=await new Promise((yt,dt)=>{const ot=URL.createObjectURL(at);I.load(ot,W=>{const ae=new Float32Array(W.geometry.attributes.position.count*3);for(let ne=0;ne<W.geometry.attributes.position.count;ne++)ae[ne*3]=0,ae[ne*3+1]=1,ae[ne*3+2]=0;W.geometry.setAttribute("color",new Ht(ae,3)),W.material.vertexColors=!0,W.scale.set(.3,.3,.3),URL.revokeObjectURL(ot),yt(W)},void 0,dt)});V.add(it),V.add(z),g=V}catch(fe){throw console.error("PCD文件加载失败:",fe),new Error("无法加载PCD文件")}break;case".urdf":const H=URL.createObjectURL(d),J=new Kg,ie="http://139.196.154.85:20026/chfs/shared/机器人/urdf/SmallBender_R-2000iC-165F/meshes",B={maxConcurrentLoads:4,enableCache:!0,enableLOD:!0,simplifyGeometry:!0,shareMaterials:!0,enableInstancing:!0},oe=new Map,j=new Map,ue=new Map,pe=async fe=>{if(oe.has(fe))return console.log(`从缓存加载: ${fe}`),oe.get(fe);try{const be=await ft.axios.get(`${ie}/${fe}`,{responseType:"blob",headers:{"Content-Type":"application/json"},timeout:6e5}),Je=new Blob([be.data],{type:"application/octet-stream;charset=UTF-8"});return B.enableCache&&oe.set(fe,Je),Je}catch(be){throw console.error(`加载文件失败: ${fe}`,be),new Error(`无法加载文件: ${fe}`)}},Me=(fe="default")=>{if(j.has(fe))return j.get(fe);const be=new Sn({color:12303291,shininess:30,transparent:!1,alphaTest:.1,side:Wn});return j.set(fe,be),be},Ue=fe=>{try{fe.isBufferGeometry&&fe.mergeVertices&&fe.mergeVertices(),fe.computeVertexNormals&&fe.computeVertexNormals(),fe.computeBoundingSphere&&fe.computeBoundingSphere(),fe.deleteAttribute&&fe.deleteAttribute("uv2")}catch(be){console.warn("几何体优化失败,使用原始几何体:",be)}return fe},Ne=async(fe,be,Je)=>{const at=`stl_${be}`;if(ue.has(at)){const dt=ue.get(at);return new Ct(dt,Me())}const it=await fe.arrayBuffer();let yt=new la(Je).parse(it);return yt=Ue(yt),ue.set(at,yt),new Ct(yt,Me())},Y=async(fe,be,Je)=>{const at=`obj_${be}`;if(oe.has(at))return oe.get(at).clone();const it=await fe.text(),z=new _o(Je),yt=be.replace(".obj",".mtl");try{const W=await(await pe(yt)).text(),ne=new vo(Je).parse(W);ne.preload(),z.setMaterials(ne)}catch{console.warn(`MTL文件加载失败,使用默认材质: ${yt}`)}const dt=z.parse(it);return dt.traverse(ot=>{ot.isMesh&&(ot.geometry=Ue(ot.geometry),ot.castShadow=!0,ot.receiveShadow=!0,ot.renderOrder=1)}),oe.set(at,dt),dt},se=(fe,be)=>{const Je=new Df;if(Je.addLevel(fe,0),fe.geometry){const at=fe.geometry.clone(),it=new Ct(at,fe.material);Je.addLevel(it,50)}return Je};let re=0,le=0;const Ee=[];J.loadMeshCb=async(fe,be,Je,at,it)=>{const z=fe.split("/").pop(),yt=Je||(()=>{});re++;const dt=new Promise(async(ot,W)=>{try{const ae=await pe(z);if(!ae||ae.size===0)throw new Error(`文件为空: ${z}`);const ne=z.split(".").pop().toLowerCase();let ye;switch(ne){case"stl":ye=await Ne(ae,z,be);break;case"obj":ye=await Y(ae,z,be);break;default:throw new Error(`不支持的文件格式: ${ne}`)}B.enableLOD&&ye.isMesh&&(ye=se(ye,z)),yt(ye),le++,at&&at({loaded:le,total:re,progress:le/re}),ot(ye)}catch(ae){console.error(`mesh文件加载失败: ${z}`,ae);const ne=new ei;yt(ne),ot(ne);const ye=new Zi(.1,.1,.1),Oe=new np({color:16711680,wireframe:!0});return new Ct(ye,Oe)}});Ee.push(dt)};try{if(!H){Qr.value=void 0;break}if(g=await J.loadAsync(H),console.log(`URDF文件加载完成,等待${re}个mesh文件加载...`),Ee.length>0)try{await Promise.allSettled(Ee),console.log(`所有mesh文件处理完成,成功加载: ${le}/${re}`)}catch(Je){console.warn("部分mesh文件加载失败,但继续显示模型",Je)}g.traverse(Je=>{Je.isMesh&&(Je.castShadow=!0,Je.receiveShadow=!0,Je.renderOrder=1,Je.material&&(Je.material.needsUpdate=!0))}),console.time("计算包围盒");const fe=new qn;fe.expandByObject(g);const be=`urdf_${Date.now()}`;g.userData.boundingBox=fe.clone(),g.userData.modelId=be,kh.set(be,{box:fe.clone(),center:fe.getCenter(new F),size:fe.getSize(new F),maxSize:Math.max(...fe.getSize(new F).toArray())}),Qr.value=g,console.log("URDF模型加载完成并优化")}catch(fe){console.error("URDF加载失败:",fe),Qr.value=void 0}finally{H&&URL.revokeObjectURL(H)}break;default:throw new Error(`不支持的文件格式: ${u}`)}return g};return{addModelsFromUrls:c,loadModelByDefaultPath:async u=>{console.log(u);try{t.value=!0,n.value="正在加载模型...";const{scene:d}=s();if(!d)throw new Error("Scene not initialized");i(),await new Promise(_=>setTimeout(_,100));const m=[];for(let _=0;_<u.length;_++){const g=u[_],p=await h(g.suffix,g.blob,g.mtlBlobs||[],g.meshFiles||[]);p&&(d.add(p),e.value.push(p),m.push(p))}return t.value=!1,n.value="",m}catch(d){throw console.error("加载模型失败:",d),t.value=!1,n.value="",d}},urdfModel:Qr,modelBoundingBoxes:kh}}window._iconfont_svg_string_4634042='<svg><symbol id="icon-lookAround" viewBox="0 0 1041 1024"><path d="M520.685026 798.355937c-10.788594 0-21.577187-2.790872-31.241101-8.372615l-291.583615-168.36871A62.482203 62.482203 0 0 1 166.619208 567.505024V230.850913c0-22.368629 11.913273-42.987756 31.241102-54.109588l291.583615-168.36871a62.482203 62.482203 0 0 1 62.482203 0l291.583615 168.36871c19.327828 11.121832 31.241102 31.740959 31.241101 54.109588v336.654111a62.482203 62.482203 0 0 1-31.241101 54.109588l-291.583615 168.36871a62.857096 62.857096 0 0 1-31.241102 8.372615zM291.583615 531.39031l229.101411 132.295652 229.101412-132.295652v-264.507993l-229.101412-132.295651L291.583615 266.923972v264.466338z m520.685026 36.114714h0.416548-0.416548z" fill="#aaaaaa" ></path><path d="M520.685026 461.660172c-10.788594 0-21.577187-2.790872-31.241101-8.372616l-291.583615-168.327055a62.482203 62.482203 0 0 1 62.482203-108.219176L520.685026 326.990196l260.342513-150.248871a62.482203 62.482203 0 1 1 62.482204 108.219176l-291.583615 168.327055a62.857096 62.857096 0 0 1-31.241102 8.372616z" fill="#aaaaaa" ></path><path d="M520.685026 798.355937a62.482203 62.482203 0 0 1-62.482203-62.482203V399.177969a62.482203 62.482203 0 1 1 124.964406 0v336.695765a62.482203 62.482203 0 0 1-62.482203 62.482203z" fill="#aaaaaa" ></path><path d="M520.685026 1003.172599c-53.276492 0-520.685026-5.248505-520.685026-187.446609 0-62.982061 54.776065-111.259976 162.870276-143.584103 33.073913-9.622259 67.855673 8.914128 77.769516 41.98804s-8.872473 67.897327-41.946386 77.769516c-30.324696 9.080747-49.194321 17.619981-60.649392 24.11813 46.32014 26.242525 178.657446 62.19062 382.641012 62.19062s336.320872-35.948094 382.641012-62.19062c-11.455071-6.498149-30.324696-15.037384-60.649392-24.11813a62.482203 62.482203 0 1 1 35.82313-119.757556c108.094211 32.324126 162.870276 80.643697 162.870276 143.584103 0 182.198104-467.408534 187.446609-520.685026 187.446609z m398.886385-175.366717h0.416548-0.416548z" fill="#72B02D" ></path></symbol><symbol id="icon-xuanzhuan" viewBox="0 0 1024 1024"><path d="M378.963454 724.443778l91.182641 163.473426c6.246088 11.212239 2.252687 25.39393-9.010749 31.691216l-163.473427 91.18264c-18.123894 10.085896-39.422029-6.758062-33.739113-26.673866l72.290786-254.707264c5.682916-19.967002 32.663967-23.090045 42.749862-4.966152z" fill="#FC794B" ></path><path d="M414.64807 903.9932c-1.228739 0-2.40628-0.051197-3.635018-0.204789C169.002752 879.367232 0.000003 771.443028 0.000003 641.452727c0-52.221389 27.032248-102.19009 78.127293-144.581571a35.827969 35.827969 0 0 1 50.480676 4.710165 35.827969 35.827969 0 0 1-4.710164 50.480676C100.090998 571.824209 71.727616 603.310634 71.727616 641.452727c0 88.929954 148.984551 171.050647 346.504275 191.068847 19.711014 1.9967 34.046298 19.557422 32.049597 39.268436a35.879166 35.879166 0 0 1-35.633418 32.20319zM608.430381 904.095595c-18.175091 0-33.79031-13.772111-35.633418-32.254387-1.945503-19.711014 12.389781-37.271736 32.100795-39.217239 198.134093-19.813409 347.528224-101.985301 347.528223-191.171242 0-23.550822-10.649068-47.050447-31.58882-69.935703-13.362532-14.59127-12.389781-37.271736 2.20149-50.634268 14.59127-13.362532 37.271736-12.389781 50.634268 2.20149 32.971151 35.9918 50.429479 76.898555 50.429478 118.368481 0 130.297485-169.463527 238.221689-412.088195 262.489276-1.177541 0.102395-2.40628 0.153592-3.583821 0.153592z" fill="#FC794B" ></path><path d="M846.703267 184.413179l-325.308534 184.464377L196.137396 184.413179 521.394733 0z" fill="#BEC5CB" ></path><path d="M521.394733 737.703915l325.308534-184.41318V184.413179l-325.308534 184.464377z" fill="#808487" ></path><path d="M521.394733 737.703915L196.137396 553.290735V184.413179l325.257337 184.464377z" fill="#9CA3A9" ></path></symbol><symbol id="icon-clipping" viewBox="0 0 1024 1024"><path d="M341.930667 201.770667l353.706666 204.245333v408.448l-353.706666-204.245333z" fill="#4A80FF" fill-opacity="0.15" ></path><path d="M320.853333 165.248l396.117334 228.608v457.173333l-395.946667-228.608z m353.749334 252.970667L362.837333 238.336v359.722667l311.466667 179.882666z" fill="#72B02D" ></path><path d="M544.384 746.453333l-211.669333-211.669333 18.688-18.688 211.669333 211.669333z" fill="#72B02D" ></path><path d="M693.717333 530.261333l-266.453333-266.325333 20.906667-20.906667 266.325333 266.453334z" fill="#72B02D" ></path><path d="M688.853333 621.098667l-366.933333-366.933334 24.448-24.704 366.933333 366.933334z" fill="#72B02D" ></path><path d="M689.664 713.856L321.578667 345.770667l24.618666-24.618667 368.085334 368.128z" fill="#72B02D" ></path><path d="M683.605333 799.317333l-355.712-355.712 24.234667-24.234666 355.712 355.712z" fill="#72B02D" ></path><path d="M537.770667 944.938667h-51.2v-418.602667l-362.666667-209.28 25.6-44.330667 362.666667 209.066667 362.666666-209.066667 25.6 44.330667-362.666666 209.066667z" fill="#AAAAAA" ></path><path d="M512.170667 53.461333a31.146667 31.146667 0 0 1 15.488 4.266667l370.090666 213.632a31.232 31.232 0 0 1 15.317334 26.794667v426.922666a31.274667 31.274667 0 0 1-15.317334 26.837334l-369.834666 213.333333a31.488 31.488 0 0 1-31.061334 0l-369.834666-213.333333a31.146667 31.146667 0 0 1-15.914667-26.837334V298.069333a31.146667 31.146667 0 0 1 15.573333-27.008l369.792-213.333333a30.976 30.976 0 0 1 15.701334-4.266667z m349.866666 256l-349.866666-201.642666-349.866667 201.856v403.84l349.866667 201.813333 349.866666-201.898667z" fill="#AAAAAA" ></path></symbol><symbol id="icon-viewReset" viewBox="0 0 1024 1024"><path d="M643.2 515.2c-89.6-67.2-179.2-60.8-268.8 0-32 22.4-67.2 57.6-105.6 89.6 38.4 32 70.4 70.4 108.8 96 28.8 19.2 60.8 32 96 38.4 118.4 19.2 188.8-57.6 268.8-137.6-35.2-28.8-60.8-64-99.2-86.4zM508.8 704c-51.2 0-96-41.6-96-99.2s41.6-105.6 96-105.6 96 41.6 96 99.2c0 64-38.4 105.6-96 105.6z" fill="#AAAAAA" ></path><path d="M515.2 544c-3.2 41.6 12.8 60.8 51.2 51.2 0 32-19.2 57.6-51.2 57.6s-57.6-22.4-51.2-57.6c-6.4-32 16-51.2 51.2-51.2" fill="#AAAAAA" ></path><path d="M652.8 3.2c9.6-3.2 19.2-3.2 28.8 0 9.6 3.2 12.8 12.8 12.8 22.4v108.8c70.4 28.8 131.2 70.4 179.2 128 80 89.6 118.4 214.4 108.8 336-9.6 124.8-70.4 236.8-166.4 313.6-96 80-224 118.4-345.6 108.8-124.8-9.6-243.2-67.2-323.2-160S32 649.6 41.6 524.8c9.6-118.4 70.4-233.6 160-307.2 22.4-19.2 60.8-19.2 80 3.2 19.2 22.4 19.2 57.6-3.2 80-70.4 57.6-115.2 140.8-124.8 233.6s22.4 185.6 80 249.6c60.8 70.4 147.2 115.2 243.2 124.8 96 9.6 188.8-19.2 259.2-80s118.4-140.8 124.8-236.8c9.6-89.6-22.4-185.6-80-249.6-28.8-28.8-57.6-57.6-89.6-76.8v89.6c0 9.6-3.2 19.2-12.8 22.4-9.6 3.2-19.2 3.2-28.8 0l-227.2-160c-3.2-3.2-9.6-12.8-9.6-19.2 0-9.6 3.2-12.8 9.6-19.2L652.8 3.2z" fill="#72B02D" ></path></symbol><symbol id="icon-donghuafangzhen" viewBox="0 0 1024 1024"><path d="M868.864 228.864c-19.968 0-38.912 7.68-53.248 20.992l-291.328-170.496c-7.168-5.12-16.896-5.12-24.064 0L208.896 248.832c-14.336-12.8-33.28-20.48-53.76-20.48-43.52 0-79.872 36.864-79.872 80.896 0 33.792 21.504 63.488 53.248 74.24v318.976c0 9.216 4.608 17.408 12.288 22.016L437.248 896c11.776 30.72 41.472 51.712 74.752 52.224 33.28-0.512 62.464-20.992 74.752-52.224l296.448-171.52c7.68-4.608 12.288-13.312 12.288-22.016V386.048c31.744-11.776 53.248-42.496 53.248-76.288 0-44.032-36.352-80.896-79.872-80.896zM155.136 339.456c-16.896 0-29.184-12.288-29.184-29.696v-2.048c0.512-15.36 13.312-27.648 29.184-27.136h2.048c15.36 0.512 27.648 13.824 27.136 29.696 0 15.872-12.8 28.672-29.184 29.184zM512 897.024c-16.896 0-29.184-12.288-29.184-29.696 0-14.848 12.288-29.696 29.184-29.696h2.048c15.36 0.512 27.648 13.824 27.136 29.696 0 14.848-14.848 29.696-29.184 29.696z m74.752-58.368c-11.776-30.208-40.96-51.712-74.752-51.712-27.136 0-52.224 14.336-67.072 37.376l-3.072 1.024c-4.608 2.048-8.704 5.632-9.728 10.752l-252.416-146.944V384.512C212.48 373.76 234.496 343.04 235.52 308.736l3.072 0.512h2.048c3.584 0 7.168-1.536 10.24-3.584 7.168-5.632 8.192-16.384 2.048-23.552L512 130.56l278.528 162.816c-7.68 36.864 11.264 74.24 45.568 90.624 0.512 5.632 3.584 10.24 8.704 13.312v291.328l-258.048 150.016z m282.112-499.2c-16.896 0-29.184-12.288-29.184-29.696v-2.048c0.512-15.36 13.312-27.648 29.184-27.136h2.048c15.36 0.512 27.648 13.824 27.136 29.696v2.56c-1.024 14.848-13.824 27.136-29.184 26.624z" fill="#AAAAAA" ></path><path d="M422.912 724.992c-3.072-8.704-12.288-12.8-20.992-9.728-8.704 3.072-12.8 12.8-9.728 21.504l19.968 54.784c2.56 6.656 8.192 10.752 15.36 10.752 2.048 0 3.584-0.512 5.12-1.024 8.704-3.072 12.8-12.8 9.728-21.504l-19.456-54.784zM706.048 507.392c0-107.52-86.016-195.072-192-196.096-2.048-1.536-4.608-2.56-7.68-3.072l-24.064-3.072c-8.192-1.024-15.872 4.096-17.92 11.776-5.632 1.536-11.776 3.584-16.896 5.632 0.512-1.536 1.024-3.072 1.536-5.12 1.024-9.216-5.12-17.408-14.336-18.432l-48.128-5.632c-5.632-1.024-11.776 1.536-15.36 6.144-3.584 4.608-4.608 11.264-2.048 16.896 2.56 5.632 7.68 9.216 13.312 9.728l44.032 5.12C384 353.28 351.232 388.608 333.312 432.64c-25.088 60.928-17.92 130.048 18.432 184.832-1.024 3.584-1.024 7.168 0.512 10.24l19.968 54.784c1.024 3.072 3.072 5.632 6.144 7.68 7.168 5.12 17.408 3.072 22.528-4.096 3.072-4.608 3.584-10.24 2.048-15.36l-0.512-1.536c53.76 37.888 123.392 45.568 184.32 19.968 46.08-19.456 82.944-55.808 102.912-101.376l12.8-14.336c6.144-6.656 5.632-17.408-0.512-23.04 2.56-14.336 4.096-28.672 4.096-43.008z m-193.536 156.16C427.52 663.552 358.4 593.92 358.4 507.392c0-86.016 69.12-156.16 154.112-156.16s154.112 69.632 154.112 156.16c0 86.016-69.12 156.16-154.112 156.16z" fill="#72B02D" ></path><path d="M765.44 478.72c-6.144-5.632-15.872-5.632-22.016 0l-32.256 35.84c-4.096 4.608-5.632 11.776-3.072 17.92 2.56 6.144 8.192 9.728 14.848 9.728 4.608 0 8.704-2.048 11.776-5.12l32.256-35.84c5.12-7.168 4.608-16.896-1.536-22.528zM823.296 401.92c-5.632-1.024-11.776 0.512-15.872 5.12l-32.256 35.84c-4.608 4.608-5.632 11.776-3.072 17.92 1.024 2.048 2.56 4.096 4.096 5.632 6.656 6.144 16.896 5.632 23.04-1.536l32.256-35.84c4.096-4.096 5.632-10.752 3.584-16.384-1.024-5.632-5.632-9.728-11.776-10.752zM336.384 321.024c8.704 0 15.872-6.656 16.384-15.36 0.512-8.704-5.632-16.384-14.336-17.408l-48.128-5.632c-5.632-1.024-11.776 1.536-15.36 6.144-3.584 4.608-4.096 11.264-2.048 16.896 2.56 5.632 7.68 9.216 13.312 9.728l48.128 5.632h2.048z" fill="#72B02D" ></path></symbol><symbol id="icon-guanjianjiexi" viewBox="0 0 1024 1024"><path d="M298.496 200.704v83.456h-39.936v177.664h137.728V389.12h47.104v245.76h-47.104v-79.872H211.456c-10.752-3.584-54.272-14.336-54.272-57.856V280.064h-32.768V200.704h174.08m47.104-47.104H77.824v177.152h36.352v169.984c0 68.608 61.44 97.792 97.792 104.96H353.28v79.872h141.312V342.016H349.184v72.192h-43.52v-87.04h39.936V153.6zM627.712 389.12v79.872H812.544c10.752 3.584 54.272 14.336 54.272 54.272V740.352h32.768v83.456h-173.568v-83.456h39.936v-177.664h-137.728V634.88h-47.104V389.12h46.592m47.104-47.104h-141.312v340.48h141.312v-72.192h43.52v83.456h-39.936V870.4h267.776v-177.152h-36.352v-169.984c0-68.608-61.44-97.792-97.792-104.96H670.72V342.528h4.096z" fill="#AAAAAA" ></path></symbol><symbol id="icon-gongyishengcheng" viewBox="0 0 1024 1024"><path d="M889.344 391.68h29.696v-43.008h-208.896l1.024 45.056 28.16 3.072v20.992c55.808 5.632 108.032 28.672 150.016 66.56-0.512 0 0-92.672 0-92.672z m-366.592 102.912c13.312-13.312 27.648-24.576 43.008-34.816-2.048-70.144-5.632-153.088-8.704-179.712-5.632-48.64-34.816-204.288-226.816-202.752-191.488 1.536-223.744 164.864-230.912 207.36s-11.776 197.632-11.776 197.632h-24.576v43.008l208.896 1.024v-40.96h-24.064V316.928S245.76 230.912 335.36 231.424C424.448 232.448 415.232 327.68 414.72 327.68v313.856c4.608 0 6.144 77.824 50.176 144.896-13.312-32.256-20.48-67.072-20.48-102.912 0-71.168 27.648-138.24 78.336-188.928z" fill="#AAAAAA" ></path><path d="M75.264 601.6h31.232v281.088s41.984 29.184 141.824 0v-274.944l29.184-2.56v-44.032H75.264v40.448zM906.24 263.168h-29.184l1.024-188.416s-53.76-27.648-144.384 0l1.024 192-31.744 1.024V307.2h203.776l-0.512-44.032z" fill="#AAAAAA" ></path><path d="M934.912 627.712c-9.216-4.608-20.48-2.048-29.184 6.656l-21.504 21.504c-9.216 9.216-20.992 13.824-33.792 13.824s-24.576-5.12-33.792-13.824c-9.216-9.216-13.824-20.992-13.824-33.792s5.12-24.576 13.824-33.792l21.504-21.504c8.704-8.704 11.264-19.968 6.656-29.184-5.632-10.752-18.432-15.36-34.304-13.312-25.6 4.096-48.64 15.36-66.56 33.792-27.136 27.136-39.424 65.536-33.792 103.936l-178.176 178.176c-13.312 13.312-20.992 31.232-20.992 50.176s7.168 36.864 20.992 50.176c13.312 13.312 31.232 20.992 50.176 20.992 18.944 0 36.864-7.168 50.176-20.992l178.176-178.176c37.888 6.144 76.288-6.656 103.936-33.792 17.92-17.92 29.696-41.472 33.792-66.56 2.048-15.872-2.56-28.672-13.312-34.304z m-9.728 30.72c-3.072 20.48-12.8 38.912-27.136 53.76-23.04 23.04-56.32 33.28-89.088 26.624l-6.144-1.536-186.88 186.88c-8.704 9.216-20.992 13.824-33.792 13.824s-24.576-5.12-33.792-13.824c-9.216-9.216-13.824-20.992-13.824-33.792s5.12-24.576 13.824-33.792l186.88-186.88-1.536-6.144c-6.656-32.256 3.072-65.536 26.624-89.088 14.848-14.848 33.28-24.064 53.76-27.136 1.536-0.512 3.072-0.512 4.608-0.512 2.56 0 4.608 0.512 5.12 1.024-0.512 0.512-1.024 1.536-2.048 2.56l-21.504 21.504c-13.312 13.312-20.992 31.232-20.992 50.176s7.168 36.864 20.992 50.176c13.312 13.312 31.232 20.992 50.176 20.992 18.944 0 36.864-7.168 50.176-20.992l21.504-21.504c1.024-1.024 2.048-1.536 2.56-2.048 0.512 1.536 1.024 4.608 0.512 9.728z" fill="#72B02D" ></path><path d="M560.64 870.912c-12.8 12.8-12.8 33.28 0 45.568 6.144 6.144 14.336 9.216 23.04 9.216s16.896-3.072 23.04-9.216c6.144-6.144 9.728-14.336 9.728-23.04 0-8.704-3.584-16.896-9.728-23.04-12.8-12.288-33.792-12.288-46.08 0.512z m28.672 28.672c-3.072 3.072-8.704 3.072-11.776 0-3.072-3.072-3.072-8.704 0-11.776 1.536-1.536 3.584-2.56 6.144-2.56 2.048 0 4.096 1.024 6.144 2.56 1.536 1.536 2.56 3.584 2.56 6.144-0.512 2.048-1.536 4.096-3.072 5.632z m225.28-107.008c-4.096-4.096-10.24-4.096-14.336 0l-43.52 43.52c-4.096 4.096-4.096 10.24 0 14.336l102.4 102.4c15.872 15.872 41.984 15.872 57.856 0 15.872-15.872 15.872-41.984 0-57.856l-102.4-102.4z m-237.056-150.528l70.656 70.656 28.672-28.672-70.656-70.656-15.872-30.208-50.688-36.352-28.672 28.672 36.352 50.688 30.208 15.872z" fill="#72B02D" ></path></symbol><symbol id="icon-mojupipei" viewBox="0 0 1024 1024"><path d="M880.64 117.248c32.768 0 58.88 23.04 64.512 54.784l1.024 7.68v663.04c0.512 31.744-22.528 58.368-53.76 62.464l-7.68 1.024H151.552c-34.816 0-66.048-22.528-72.192-53.248l-1.024-6.656V183.296c0-31.744 27.648-59.904 61.952-65.024l7.168-1.024h142.848c24.064 0 44.032 16.896 48.64 39.936l1.024 6.656V406.528c0 7.68 5.12 14.848 12.288 16.896l3.584 0.512H424.96c13.312 0 25.088 9.216 29.184 22.528 6.144 23.552 33.792 46.08 58.368 46.08 22.528 0 48.128-19.456 55.808-39.424l2.048-5.632c2.048-10.24 9.216-18.432 19.456-21.504l5.12-1.024 3.072-0.512h71.168c6.144 0 11.776-3.584 14.336-9.728l1.024-3.584V164.864c0-23.04 15.872-41.984 37.888-46.592l6.144-1.024H880.64zM273.92 184.32H151.552l-2.048 0.512-2.048 0.512-2.56 1.536-1.536 649.728 3.072 1.536 3.072 1.024h1.024l328.192 3.072 2.048-286.72-2.048-0.512-10.24-3.584c-24.576-10.24-45.568-27.136-60.928-49.152l-6.144-9.216 1.024-1.536H349.184c-37.888-4.096-68.608-33.792-74.24-71.68l-1.024-8.192v-4.096V184.32z m476.16-3.072V409.6l-0.512 8.704c-3.584 36.864-32.256 66.56-68.608 72.192l-8.192 1.024h-4.096l-45.568-1.536-6.144 9.728c-14.848 22.528-36.352 40.448-61.44 51.2l-10.752 4.096-3.072 284.16h337.408v-655.36l-129.024-2.56z" fill="#AAAAAA" ></path></symbol><symbol id="icon-buchangshezhi" viewBox="0 0 1024 1024"><path d="M792.576 75.264h-686.08c-17.408 0-31.232 13.824-31.232 31.232v686.08c0 17.408 13.824 31.232 31.232 31.232h436.736c17.408 0 31.232-13.824 31.232-31.232s-13.824-31.232-31.232-31.232H137.728V262.656h624.128v280.576c0 17.408 13.824 31.232 31.232 31.232s31.232-13.824 31.232-31.232V106.496c-0.512-17.408-14.336-31.232-31.744-31.232z" fill="#AAAAAA" ></path><path d="M792.576 948.736c-17.408 0-31.232-13.824-31.232-31.232v-93.696h-93.696c-17.408 0-31.232-13.824-31.232-31.232 0-17.408 13.824-31.232 31.232-31.232h93.696v-93.696c0-17.408 13.824-31.232 31.232-31.232 17.408 0 31.232 13.824 31.232 31.232v93.696h93.696c17.408 0 31.232 13.824 31.232 31.232 0 17.408-13.824 31.232-31.232 31.232h-93.696v93.696c0 17.408-13.824 31.232-31.232 31.232z" fill="#72B02D" ></path><path d="M372.224 518.144l-110.08 110.08c-20.992 20.992-20.992 55.296 0 76.288s55.296 20.992 76.288 0l110.08-110.08c-16.896-6.144-32.768-15.872-46.592-29.696-13.824-13.312-23.552-29.696-29.696-46.592z m-57.856 162.304c-7.68 7.68-20.48 7.68-28.672 0-7.68-7.68-7.68-20.48 0-28.672 7.68-7.68 20.48-7.68 28.672 0 7.68 8.192 7.68 20.992 0 28.672z m340.48-292.864L592.384 450.56c-20.992 20.992-55.296 20.992-76.288 0s-20.992-55.296 0-76.288l62.976-62.976c-51.712-8.704-116.224 14.848-151.552 50.176-49.152 49.152-49.152 128.512 0 177.664s129.024 49.152 177.664 0c35.328-35.328 58.368-99.84 49.664-151.552z" fill="#AAAAAA" ></path></symbol><symbol id="icon-shuchujiagongchengxu" viewBox="0 0 1024 1024"><path d="M876.544 473.6v374.272c0 16.384-13.312 29.696-29.696 29.696h-522.24c-16.384 0-29.696-13.312-29.696-29.696V503.296c0-16.384 13.312-29.696 29.696-29.696h551.936m40.96-70.656H253.952c-16.384 0-29.696 13.312-29.696 29.696v486.4c0 16.384 13.312 29.696 29.696 29.696h663.552c16.384 0 29.696-13.312 29.696-29.696v-486.4c0-16.384-13.312-29.696-29.696-29.696z" fill="#AAAAAA" ></path><path d="M489.984 211.968H814.08l-41.984-41.984c-13.824-13.824-13.824-36.352 0-50.176 13.824-13.824 36.352-13.824 50.176 0L947.712 245.76l-0.512 0.512 0.512 0.512-125.952 125.952c-13.824 13.824-36.352 13.824-50.176 0-13.824-13.824-13.824-36.352 0-50.176l38.912-38.912H489.472c-19.456 0-35.328-15.872-35.328-35.328 0.512-20.48 16.384-36.352 35.84-36.352z" fill="#72B02D" ></path><path d="M531.456 717.824c0-11.776-7.68-22.016-18.944-25.6l-55.808-16.896-14.848-4.608 14.848-4.608 55.808-16.896c11.264-3.584 18.944-13.824 18.944-25.6v-2.048c0-18.432-17.92-31.232-35.328-25.088L363.52 641.024c-10.752 3.584-17.92 13.824-17.92 25.088v8.192c0 11.264 7.168 21.504 17.92 25.088l132.608 45.568c17.408 6.144 35.328-7.168 35.328-25.088v-2.048z m123.392-96.768v2.048c0 11.776 7.68 22.016 18.944 25.6l56.32 16.896 14.848 4.608-14.848 4.608-56.32 16.896c-11.264 3.584-18.944 13.824-18.944 25.6v2.56c0 18.432 17.92 31.232 35.328 25.088l132.608-45.568c10.752-3.584 17.92-13.824 17.92-25.088v-8.192c0-11.264-7.168-21.504-17.92-25.088l-132.608-45.568c-17.408-6.144-35.328 7.168-35.328 25.6z m-54.784-64l-70.144 248.32c-4.608 16.896 8.192 33.792 25.6 33.792 11.776 0 22.528-8.192 25.6-19.456l70.144-248.32c4.608-16.896-8.192-33.792-25.6-33.792-11.776 0-22.016 8.192-25.6 19.456zM147.456 814.08V173.056c0-14.848 11.776-26.624 26.624-26.624h463.872c19.456 0 35.328-15.872 35.328-35.328 0-19.456-15.872-35.328-35.328-35.328H107.008c-16.896 0-30.72 13.824-30.72 30.72v748.032c0 16.896 13.824 30.72 30.72 30.72h40.448c19.456 0 35.328-15.872 35.328-35.328 0.512-19.968-15.36-35.84-35.328-35.84z" fill="#AAAAAA" ></path></symbol><symbol id="icon-guanjiekongzhi" viewBox="0 0 1024 1024"><path d="M648.192 377.344h-71.68c-18.432 0-33.792-14.848-33.792-33.792H366.592c12.288-30.72 25.088-80.896 0-134.656H542.72c0-18.432 15.36-33.792 33.792-33.792h67.584c1.536 0 2.56 0 4.096 0.512L719.36 87.04c10.752-13.312 29.184-16.384 44.032-7.68l168.96 100.864c15.872 9.728 20.992 30.208 11.776 46.08-9.728 15.872-30.208 20.992-46.592 11.264l-143.872-85.504L677.888 245.76v61.44l75.776 93.696 143.872-85.504c15.872-9.728 36.864-4.608 46.592 11.776 9.728 15.872 4.608 36.352-11.264 46.08h-0.512l-168.96 100.864c-14.336 8.704-33.28 5.12-44.032-7.68l-71.168-89.088zM319.488 780.8L102.912 415.744c76.8 69.632 185.344 48.64 231.424-13.312l222.72 378.368H711.68c18.432 0 33.792 14.848 33.792 33.792v100.864c0 18.432-15.36 33.792-33.792 33.792H170.496c-18.432 0-33.792-14.848-33.792-33.792v-100.864c0-18.432 15.36-33.792 33.792-33.792h148.992z" fill="#AAAAAA" ></path><path d="M204.288 148.48C133.12 148.48 75.264 205.824 75.264 276.48S133.12 404.48 204.288 404.48c71.168 0 129.024-57.344 129.024-128S275.456 148.48 204.288 148.48z m0 202.752c-41.472 0-74.752-33.28-74.752-74.752 0-40.96 33.792-74.24 74.752-74.24C245.76 202.24 279.04 235.52 279.04 276.48c0 41.472-33.792 75.264-74.752 74.752z" fill="#72B02D" ></path></symbol><symbol id="icon-jiegoushu" viewBox="0 0 1024 1024"><path d="M233.984 472.064h317.44c0-44.032 35.328-79.36 79.36-79.36h238.08c44.032 0 79.36 35.328 79.36 79.36v79.36c0 44.032-35.328 79.36-79.36 79.36h-238.08c-44.032 0-79.36-35.328-79.36-79.36h-317.44v238.08h317.44c0-44.032 35.328-79.36 79.36-79.36h238.08c44.032 0 79.36 35.328 79.36 79.36v79.36c0 44.032-35.328 79.36-79.36 79.36h-238.08c-44.032 0-79.36-35.328-79.36-79.36h-317.44c-44.032 0-79.36-35.328-79.36-79.36V233.984h-39.936c-22.016 0-39.936-17.92-39.936-39.936V115.2c0-22.016 17.92-39.936 39.936-39.936h158.72c22.016 0 39.936 17.92 39.936 39.936V194.56c0 22.016-17.92 39.936-39.936 39.936h-39.936v237.568z" fill="#AAAAAA" ></path><path d="M551.936 75.264h317.44c44.032 0 79.36 35.328 79.36 79.36v79.36c0 44.032-35.328 79.36-79.36 79.36h-317.44c-44.032 0-79.36-35.328-79.36-79.36V154.624c-0.512-44.032 35.328-79.36 79.36-79.36z" fill="#72B02D" ></path></symbol><symbol id="icon-kuaitui" viewBox="0 0 1024 1024"><path d="M512 148.992c199.68 0 361.984 162.304 361.984 361.984S711.68 872.448 512 872.448s-361.984-162.304-361.984-361.984S312.32 148.992 512 148.992m0-74.752c-241.152 0-436.736 195.584-436.736 436.736s195.584 436.736 436.736 436.736 436.736-195.584 436.736-436.736-195.584-436.736-436.736-436.736z" fill="#AAAAAA" ></path><path d="M670.72 456.192v109.056l-75.264-54.784L670.72 456.192m25.6-102.912c-10.24 0-20.992 3.072-30.208 10.24l-144.896 105.472c-28.672 20.48-28.672 62.976 0 83.968l144.896 105.472c9.216 6.656 19.968 10.24 30.208 10.24 27.136 0 52.224-21.504 52.224-51.712V405.504c0-30.72-25.088-52.224-52.224-52.224z" fill="#72B02D" ></path><path d="M499.712 456.192v109.056L424.96 510.976l74.752-54.784m26.112-102.912c-10.24 0-20.992 3.072-30.208 10.24L350.208 468.992c-28.672 20.48-28.672 62.976 0 83.968l144.896 105.472c9.216 6.656 19.968 10.24 30.208 10.24 27.136 0 52.224-21.504 52.224-51.712V405.504c0-30.72-25.088-52.224-51.712-52.224z" fill="#72B02D" ></path><path d="M314.368 381.44c-21.504 0-38.912 17.408-38.912 38.912v181.248c0 21.504 17.408 38.912 38.912 38.912s38.912-17.408 38.912-38.912V420.352c0-21.504-17.408-38.912-38.912-38.912z" fill="#72B02D" ></path></symbol><symbol id="icon-bofang" viewBox="0 0 1024 1024"><path d="M512 150.016c199.68 0 361.984 162.304 361.984 361.984S711.68 873.984 512 873.984 150.016 711.68 150.016 512 312.32 150.016 512 150.016m0-74.752c-241.152 0-436.736 195.584-436.736 436.736s195.584 436.736 436.736 436.736 436.736-195.584 436.736-436.736-195.584-436.736-436.736-436.736z" fill="#AAAAAA" ></path><path d="M491.008 445.952l115.712 66.048-115.712 66.048V445.952m-23.552-87.04c-24.576 0-46.592 19.456-46.592 46.592v212.48c0 27.136 22.528 46.592 46.592 46.592 7.68 0 15.36-2.048 23.04-6.144l185.856-106.496c31.232-17.92 31.232-62.976 0-80.896L490.496 365.056c-7.168-4.096-15.36-6.144-23.04-6.144z" fill="#72B02D" ></path></symbol><symbol id="icon-kuaijin" viewBox="0 0 1024 1024"><path d="M515.584 151.04c199.168 0 360.96 161.792 360.96 360.96s-161.792 360.96-360.96 360.96-360.96-161.792-360.96-360.96 161.792-360.96 360.96-360.96m0-74.752c-240.64 0-435.712 195.072-435.712 435.712s195.072 435.712 435.712 435.712 435.712-195.072 435.712-435.712-195.072-435.712-435.712-435.712z" fill="#AAAAAA" ></path><path d="M358.912 458.24L433.152 512l-74.24 53.76v-107.52m-25.088-101.376c-26.624 0-51.2 20.992-51.2 51.2v207.872c0 30.208 24.576 51.2 51.2 51.2 10.24 0 20.48-3.072 29.696-9.728l142.848-103.936c28.16-20.48 28.16-61.952 0-82.432L363.52 366.592c-9.216-6.656-19.456-9.728-29.696-9.728z" fill="#72B02D" ></path><path d="M527.36 458.24l74.24 53.76-74.24 53.76v-107.52m-25.088-101.376c-26.624 0-51.2 20.992-51.2 51.2v207.872c0 30.208 24.576 51.2 51.2 51.2 10.24 0 20.48-3.072 29.696-9.728l142.848-103.936c28.16-20.48 28.16-61.952 0-82.432l-142.848-103.936c-9.216-7.168-19.968-10.24-29.696-10.24z" fill="#72B02D" ></path><path d="M710.144 384.512c-20.992 0-38.4 17.408-38.4 38.4v178.688c0 20.992 17.408 38.4 38.4 38.4s38.4-17.408 38.4-38.4V422.912c0-21.504-17.408-38.4-38.4-38.4z" fill="#72B02D" ></path></symbol><symbol id="icon-zanting" viewBox="0 0 1024 1024"><path d="M512 150.016c199.68 0 361.984 162.304 361.984 361.984S711.68 873.984 512 873.984 150.016 711.68 150.016 512 312.32 150.016 512 150.016m0-74.752c-241.152 0-436.736 195.584-436.736 436.736s195.584 436.736 436.736 436.736 436.736-195.584 436.736-436.736-195.584-436.736-436.736-436.736z" fill="#AAAAAA" ></path><path d="M416.768 353.28c-22.016 0-39.936 17.92-39.936 39.936v238.08c0 22.016 17.92 39.936 39.936 39.936s39.936-17.92 39.936-39.936V392.704c-0.512-21.504-17.92-39.424-39.936-39.424z m190.464 0c-22.016 0-39.936 17.92-39.936 39.936v238.08c0 22.016 17.92 39.936 39.936 39.936s39.936-17.92 39.936-39.936V392.704c0-21.504-17.92-39.424-39.936-39.424z" fill="#72B02D" ></path></symbol><symbol id="icon-zhongzhi" viewBox="0 0 1024 1024"><path d="M512 150.016c199.68 0 361.984 162.304 361.984 361.984S711.68 873.984 512 873.984 150.016 711.68 150.016 512 312.32 150.016 512 150.016m0-74.752c-241.152 0-436.736 195.584-436.736 436.736s195.584 436.736 436.736 436.736 436.736-195.584 436.736-436.736-195.584-436.736-436.736-436.736z" fill="#AAAAAA" ></path><path d="M580.096 421.376c12.288 0 22.528 10.24 22.528 22.528v136.192c0 12.288-10.24 22.528-22.528 22.528H443.904c-12.288 0-22.528-10.24-22.528-22.528V443.904c0-12.288 10.24-22.528 22.528-22.528h136.192m0-68.096H443.904C393.728 353.28 353.28 393.728 353.28 443.904v136.192c0 50.176 40.448 90.624 90.624 90.624h136.192c50.176 0 90.624-40.448 90.624-90.624V443.904c0-50.176-40.448-90.624-90.624-90.624z" fill="#72B02D" ></path></symbol><symbol id="icon-suoxiao" viewBox="0 0 1024 1024"><path d="M491.008 463.36c32.256 0 58.88-26.112 58.88-58.88s-26.112-58.88-58.88-58.88H285.696c-32.256 0-58.88 26.112-58.88 58.88s26.112 58.88 58.88 58.88h205.312z" fill="#72B02D" ></path><path d="M810.496 720.384l-158.208-158.208c29.184-48.128 46.08-104.96 46.08-165.376 0-175.616-142.848-318.976-318.976-318.976s-318.976 143.36-318.976 318.976 142.848 318.976 318.976 318.976c78.336 0 150.016-28.16 205.824-75.264l152.576 152.576c10.24 10.24 23.04 14.848 36.352 14.848 13.312 0 26.112-5.12 36.352-14.848 19.968-19.968 19.968-52.736 0-72.704z m-431.104-107.52c-119.296 0-216.064-96.768-216.064-216.064 0-119.296 96.768-216.064 216.064-216.064s216.064 96.768 216.064 216.064c0 119.296-97.28 216.064-216.064 216.064z" fill="#72B02D" ></path><path d="M811.008 106.496h-109.056V209.92h109.056c29.696 0 53.76 24.064 53.76 53.76v81.408H967.68v-81.92c0-86.016-70.144-156.672-156.672-156.672zM864.768 791.552c0 29.696-24.064 53.76-53.76 53.76h-109.056v102.912h109.056c86.528 0 156.672-70.144 156.672-156.672v-81.92h-102.912v81.92z m-690.176 0v-81.92H71.68v81.92c0 86.528 70.144 156.672 156.672 156.672h109.056v-102.912H228.352c-29.696 0-53.76-24.064-53.76-53.76z" fill="#AAAAAA" ></path></symbol><symbol id="icon-fangda" viewBox="0 0 1024 1024"><path d="M488.96 333.824h-47.104V286.72c0-34.816-28.16-62.976-62.976-62.976-34.816 0-62.976 28.16-62.976 62.976v47.104h-47.104c-34.816 0-62.976 28.16-62.976 62.976s28.16 62.976 62.976 62.976h47.104V506.88c0 34.816 28.16 62.976 62.976 62.976 34.816 0 62.976-28.16 62.976-62.976v-47.104h47.104c34.816 0 62.976-28.16 62.976-62.976 0-34.304-28.16-62.976-62.976-62.976z" fill="#72B02D" ></path><path d="M810.496 720.384l-158.208-158.208c29.184-48.128 46.08-104.96 46.08-165.376 0-175.616-142.848-318.976-318.976-318.976s-318.976 143.36-318.976 318.976 142.848 318.976 318.976 318.976c78.336 0 150.016-28.16 205.824-75.264l152.576 152.576c10.24 10.24 23.04 14.848 36.352 14.848s26.112-5.12 36.352-14.848c19.968-19.968 19.968-52.736 0-72.704z m-431.104-107.52c-119.296 0-216.064-96.768-216.064-216.064 0-119.296 96.768-216.064 216.064-216.064s216.064 96.768 216.064 216.064c0 119.296-97.28 216.064-216.064 216.064z" fill="#72B02D" ></path><path d="M811.008 106.496h-109.056V209.92h109.056c29.696 0 53.76 24.064 53.76 53.76v81.408H967.68v-81.92c0-86.016-70.144-156.672-156.672-156.672zM864.768 791.552c0 29.696-24.064 53.76-53.76 53.76h-109.056v102.912h109.056c86.528 0 156.672-70.144 156.672-156.672v-81.92h-102.912v81.92z m-690.176 0v-81.92H71.68v81.92c0 86.528 70.144 156.672 156.672 156.672h109.056v-102.912H228.352c-29.696 0-53.76-24.064-53.76-53.76z" fill="#AAAAAA" ></path></symbol><symbol id="icon-fangdazhichuangkou" viewBox="0 0 1024 1024"><path d="M949.248 858.624l-158.208-158.208c29.184-48.128 46.08-104.96 46.08-165.376 0-175.616-142.848-318.976-318.976-318.976s-318.976 142.848-318.976 318.976 142.848 318.976 318.976 318.976c78.336 0 150.016-28.16 205.824-75.264l152.576 152.576c10.24 10.24 23.04 14.848 36.352 14.848s26.112-5.12 36.352-14.848c19.968-19.968 19.968-52.736 0-72.704z m-431.616-107.52c-119.296 0-216.064-96.768-216.064-216.064 0-119.296 96.768-216.064 216.064-216.064s216.064 96.768 216.064 216.064c0 119.296-96.768 216.064-216.064 216.064z" fill="#72B02D" ></path><path d="M216.576 919.04h109.056v-102.912H216.576c-29.696 0-53.76-24.064-53.76-53.76V233.984c0-29.696 24.064-53.76 53.76-53.76H798.72c29.696 0 53.76 24.064 53.76 53.76v81.92h102.912v-81.92c0-86.528-70.144-156.672-156.672-156.672H216.576c-86.528 0-156.672 70.144-156.672 156.672v528.384c0 86.528 70.144 156.672 156.672 156.672z" fill="#AAAAAA" ></path></symbol><symbol id="icon-shiyingpingmu" viewBox="0 0 1024 1024"><path d="M876.032 75.264H147.968c-39.936 0-72.704 32.768-72.704 72.704v728.064c0 39.936 32.768 72.704 72.704 72.704h728.064c39.936 0 72.704-32.768 72.704-72.704V147.968c0-39.936-32.768-72.704-72.704-72.704z m0 764.416c0 22.016-14.336 36.352-36.352 36.352H184.32c-22.016 0-36.352-14.336-36.352-36.352V184.32c0-22.016 14.336-36.352 36.352-36.352h655.36c22.016 0 36.352 14.336 36.352 36.352v655.36z" fill="#AAAAAA" ></path><path d="M329.728 184.32H220.672c-3.584 0-10.752 0-14.336 3.584-7.168 3.584-14.336 10.752-18.432 18.432-3.584 3.584-3.584 10.752-3.584 14.336v109.056c0 22.016 14.336 36.352 36.352 36.352s36.352-14.336 36.352-36.352v-22.016l47.104 47.104c7.168 7.168 14.336 10.752 25.6 10.752 10.752 0 18.432-3.584 25.6-10.752 14.336-14.336 14.336-36.352 0-51.2l-47.104-47.104h22.016c22.016 0 36.352-14.336 36.352-36.352 0-21.504-14.848-35.84-36.864-35.84zM329.728 766.976h-22.016l47.104-47.104c14.336-14.336 14.336-36.352 0-51.2-14.336-14.336-36.352-14.336-51.2 0l-47.104 47.104v-22.016c0-22.016-14.336-36.352-36.352-36.352s-36.352 14.336-36.352 36.352v109.056c0 3.584 0 10.752 3.584 14.336 3.584 7.168 10.752 14.336 18.432 18.432 3.584 3.584 10.752 3.584 14.336 3.584h109.056c22.016 0 36.352-14.336 36.352-36.352s-13.824-35.84-35.84-35.84zM817.664 187.904c-3.584-3.584-10.752-3.584-14.336-3.584h-109.056c-22.016 0-36.352 14.336-36.352 36.352s14.336 36.352 36.352 36.352h22.016l-47.104 47.104c-14.336 14.336-14.336 36.352 0 51.2 7.168 7.168 14.336 10.752 25.6 10.752s18.432-3.584 25.6-10.752l47.104-47.104v22.016c0 22.016 14.336 36.352 36.352 36.352s36.352-14.336 36.352-36.352V220.672c0-3.584 0-10.752-3.584-14.336-4.096-7.68-11.264-14.848-18.944-18.432zM803.328 657.408c-22.016 0-36.352 14.336-36.352 36.352v22.016l-47.104-47.104c-14.336-14.336-36.352-14.336-51.2 0-14.336 14.336-14.336 36.352 0 51.2l47.104 47.104h-22.016c-22.016 0-36.352 14.336-36.352 36.352s14.336 36.352 36.352 36.352h109.056c3.584 0 10.752 0 14.336-3.584 7.168-3.584 14.336-10.752 18.432-18.432 3.584-3.584 3.584-10.752 3.584-14.336v-109.056c0.512-22.016-13.824-36.864-35.84-36.864z" fill="#72B02D" ></path></symbol><symbol id="icon-yangshitu-01" viewBox="0 0 1024 1024"><path d="M645.632 882.688H150.528l252.928-204.8 477.696 0.512z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512z m-542.72 23.552H880.64l-234.496 203.264-228.864 0.512V140.8z m0 247.296l217.088-0.512-1.024 247.296H417.28V388.096z m-43.008-223.744v180.736l-225.792 1.024 225.792-181.76zM113.152 389.12l261.632-0.512v256l-263.168 211.968 1.536-467.456z m532.48 493.568H150.528l252.928-204.288 477.696 0.512-235.52 203.776z m271.36-247.808h-239.104V375.808l239.104-208.896V634.88z" fill="#AAAAAA" ></path></symbol><symbol id="icon-zuoshitu-01" viewBox="0 0 1024 1024"><path d="M374.272 644.096l-262.656 211.968L112.64 373.76l261.632-209.408z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512zM112.64 373.76l261.632-209.408v479.744l-263.168 211.968L112.64 373.76z m520.192 507.904l-482.304 1.536 252.928-204.8h230.4l-1.024 203.264z m1.024-246.784H417.28V388.096l217.088-0.512-0.512 247.296z m12.288-290.304l-228.864 0.512V140.8H880.64l-234.496 203.776z m31.232 510.976v-177.664H880.64l-203.264 177.664z m239.616-220.672h-239.104V375.808l239.104-208.896V634.88z" fill="#AAAAAA" ></path></symbol><symbol id="icon-qianshitu-01" viewBox="0 0 1024 1024"><path d="M112.64 389.12h520.704v493.056H112.64z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512zM374.272 164.352v180.736l-225.792 1.024 225.792-181.76z m259.584 717.824H112.64V389.12h520.704v493.056z m12.288-537.6l-228.864 0.512V140.8H880.64l-234.496 203.776z m31.232 510.976v-177.664H880.64l-203.264 177.664z m239.616-220.672h-239.104V375.808l239.104-208.896V634.88z" fill="#AAAAAA" ></path></symbol><symbol id="icon-youshitu-01" viewBox="0 0 1024 1024"><path d="M916.992 659.456l-239.616 196.096V375.808l239.616-208.896z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512zM374.272 164.352v180.736l-225.792 1.024 225.792-181.76zM113.152 389.12l261.632-0.512v256l-263.168 211.968 1.536-467.456z m519.68 492.544l-482.304 1.536 252.928-204.8h230.4l-1.024 203.264z m1.024-246.784H417.28V388.096l217.088-0.512-0.512 247.296z m12.288-290.304l-228.864 0.512V140.8H880.64l-234.496 203.776z m270.848 314.88l-239.104 196.096V375.808l239.104-208.896v492.544z" fill="#AAAAAA" ></path></symbol><symbol id="icon-houshitu-01" viewBox="0 0 1024 1024"><path d="M960 118.784V117.76v-1.024-1.024-1.024-0.512-0.512c1.536 7.68-1.024 15.872-6.656 20.992L677.376 373.76v299.52h-43.008V389.12H374.272v254.976l-262.656 211.968L112.64 389.12l261.632-0.512v-42.496h269.824l280.064-243.2c3.072-2.56 6.656-4.096 10.752-5.12H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c-0.512 0.512-0.512 1.024-1.024 2.048 0 0.512 0 0.512-0.512 1.024 0 0.512 0 0.512-0.512 1.024 0 0.512 0 1.024-0.512 1.536v0.512c0 0.512 0 1.024-0.512 1.536V907.264c0 0.512 0 1.024 0.512 2.048v0.512s0 0.512 0.512 1.024c0 0.512 0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.024s0 0.512 0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512c0.512 0.512 1.024 1.024 1.536 1.024 0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512c0.512 0 1.024 0 1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-242.176 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024 0-0.512 0.512-1.024 0.512-1.536v-0.512V658.944v-2.048V118.272c1.536 1.024 1.536 1.024 1.536 0.512zM374.272 164.352v180.736l-225.792 1.024 225.792-181.76z m258.56 717.312l-482.304 1.536 252.928-204.8h230.4l-1.024 203.264z m44.544-26.112v-177.664H880.64l-203.264 177.664z m281.6-741.376v-0.512-0.512 1.024z" fill="#AAAAAA" ></path><path d="M916.992 634.88h-239.616V375.808l239.616-211.456zM644.096 346.112H417.28V141.824h462.336zM417.28 389.12H634.88v245.76H417.28z" fill="#72B02D" ></path><path d="M958.976 114.176c0 0.512 0.512 0.512 0 0z m-20.48-16.384H945.152l0.512 0.512 0.512 0.512h1.024l0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512c0 0.512 0.512 0.512 0.512 1.024s0 0.512 0.512 0.512c0 0.512 0.512 1.024 0.512 1.536 0 0.512 0.512 1.024 0.512 1.024-3.072-10.24-13.312-16.896-24.064-14.848h4.608v1.024z" fill="#C1272D" ></path></symbol><symbol id="icon-dingshitu-01" viewBox="0 0 1024 1024"><path d="M880.64 140.8l-234.496 203.776-497.664 1.536 256-206.336z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512zM113.152 389.12l261.632-0.512v256l-263.168 211.968 1.536-467.456z m519.68 492.544l-482.304 1.536 252.928-204.8h230.4l-1.024 203.264z m1.024-246.784H417.28V388.096l217.088-0.512-0.512 247.296z m12.288-290.304l-497.664 1.536 256-205.824 476.16 1.024-234.496 203.264z m31.232 510.976v-177.664H880.64l-203.264 177.664z m239.616-220.672h-239.104V375.808l239.104-208.896V634.88z" fill="#AAAAAA" ></path></symbol><symbol id="icon-toushitu-01" viewBox="0 0 1024 1024"><path d="M965.632 114.176V112.64v-1.024-0.512-1.024-0.512s0-0.512-0.512-1.024v-0.512c-0.512-1.024-0.512-2.048-1.024-3.072v-0.512c0-0.512-0.512-0.512-0.512-1.024s0-0.512-0.512-0.512l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512s-0.512-1.024-1.024-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024s-0.512 0-0.512-0.512c0 0-0.512 0-0.512-0.512H950.784h-0.512H392.704c-5.12 0-9.728 1.536-13.312 4.608l-312.32 251.392-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536 0 0 0 0.512-0.512 0.512 0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024c0 0.512 0 0.512-0.512 1.024s0 0.512 0 1.024 0 1.024-0.512 1.536v0.512c0 0.512 0 1.024-0.512 1.536V912.896c0 0.512 0 1.024 0.512 2.048v0.512s0 0.512 0.512 1.024l0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.024l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512 0 0.512 0.512 0.512 1.024 1.024l0.512 0.512 1.024 1.024 0.512 0.512c0.512 0.512 1.024 1.024 1.536 1.024 0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512c0.512 0 1.024 0 1.024 0.512h583.168c7.68 0 14.848-4.096 18.432-10.752L957.44 675.84l1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024 0-0.512 0.512-1.024 0.512-1.536v-0.512V661.504v-1.536V658.432l1.024-544.256zM372.736 343.04l-229.888 0.512L372.736 158.72v184.32z m43.008 43.008l220.672-0.512-0.512 251.392h-220.16v-250.88z m-43.008 0v260.096l-267.264 215.552 1.536-474.624 265.728-1.024z m-227.84 502.272l257.024-208.384h233.984l-0.512 206.848-490.496 1.536z m503.296-545.792l-172.544 0.512H415.232V135.68h471.04l-238.08 206.848z m31.232 337.408h207.36l-207.36 181.248v-181.248z m0-43.008V373.76l243.2-212.48v475.648h-243.2z" fill="#AAAAAA" ></path></symbol><symbol id="icon-a-jixiebi3" viewBox="0 0 1024 1024"><path d="M483.386004 821.695719H164.779715l29.075502-22.648286h260.455285l29.075502 22.648286z" fill="#3F3F3F" ></path><path d="M483.386004 776.399147H164.779715l29.075502 22.648286h260.455285l29.075502-22.648286z" fill="#7A807D" ></path><path d="M483.386004 776.399147H164.779715l29.075502-22.648285h260.455285l29.075502 22.648285z" fill="#3F3F3F" ></path><path d="M483.386004 730.796518H164.779715l29.075502 22.954344h260.455285l29.075502-22.954344zM483.386004 685.499947H164.779715l29.075502 22.648285h260.455285l29.075502-22.648285z" fill="#7A807D" ></path><path d="M483.386004 730.796518H164.779715l29.075502-22.648286h260.455285l29.075502 22.648286z" fill="#3F3F3F" ></path><path d="M150.701051 623.064132h339.418227v62.435815H150.701051z" fill="#F7A53F" ></path><path d="M150.701051 821.695719h339.418227v31.217907H150.701051z" fill="#FFFFFF" ></path><path d="M607.951575 339.654504a74.984189 74.984189 0 0 1-23.872517 103.447575 75.290247 75.290247 0 0 1-103.753633-23.872518L293.324039 120.823095A75.290247 75.290247 0 0 1 317.196557 17.069462a75.290247 75.290247 0 0 1 103.753633 23.872517zM441.762128 517.474152v105.58998H198.752144v-105.58998a122.423166 122.423166 0 1 1 244.846331 0z" fill="#FFC200" ></path><path d="M627.233224 377.605685a103.141517 103.141517 0 0 1-52.948019 82.635637l-165.88339 118.750471-2.448463 1.836347a112.93537 112.93537 0 1 1-112.017197-194.346775l195.571007-84.471985a132.523077 132.523077 0 0 1 48.357151-12.854432A89.062853 89.062853 0 0 1 627.233224 377.605685z" fill="#FFE610" ></path><path d="M401.056425 493.601635a71.005436 71.005436 0 1 1-71.005436-71.311494 71.005436 71.005436 0 0 1 71.005436 71.311494z" fill="#FFFFFF" ></path><path d="M375.34756 493.601635a45.296571 45.296571 0 1 1-45.296571-45.60263 45.296571 45.296571 0 0 1 45.296571 45.60263z" fill="#48B8BF" ></path><path d="M592.342622 376.381453a49.88744 49.88744 0 1 1-49.581382-49.88744 49.88744 49.88744 0 0 1 49.581382 49.88744z" fill="#FFFFFF" ></path><path d="M574.285205 376.381453a30.605791 30.605791 0 1 1-30.605792-30.605791 30.605791 30.605791 0 0 1 30.605792 30.605791z" fill="#48B8BF" ></path><path d="M731.048068 230.789704l165.975207-62.099151 18.883774 50.46895-165.975207 62.068545z" fill="#FFE610" ></path><path d="M734.047436 202.785404l145.836596-54.294674 9.426584 25.31099-145.867202 54.294674z" fill="#F7A53F" ></path><path d="M808.419509 259.161272l23.872517 63.353988 31.523966 35.808776-19.893765 18.057417-48.051092-38.257239-27.851271-63.660046 40.399645-15.302896zM854.940312 242.022029l23.56646 63.04793-0.306058 47.745035 26.627038 0.612116 11.324143-60.293409-20.811938-66.414568-40.399645 15.302896zM716.173654 94.379691l102.345766-38.257239 37.216643 99.468822-102.345767 38.257239z" fill="#7A807D" ></path><path d="M841.473764 83.790087a66.108509 66.108509 0 0 1-65.802452 66.10851l-407.669142 15.608953a67.944857 67.944857 0 0 1-11.324142 0 82.635637 82.635637 0 0 1 0-165.271273 67.944857 67.944857 0 0 1 11.324142 0l407.669142 17.445301A66.108509 66.108509 0 0 1 841.473764 83.790087z" fill="#FFE610" ></path><path d="M402.892773 83.790087a46.520803 46.520803 0 1 1-46.520803-46.214745A46.520803 46.520803 0 0 1 402.892773 83.790087z" fill="#FFFFFF" ></path><path d="M386.059587 83.790087a30.605791 30.605791 0 1 1-30.605791-30.605791 30.605791 30.605791 0 0 1 30.605791 30.605791z" fill="#48B8BF" ></path><path d="M810.867972 83.790087a38.257239 38.257239 0 1 1-39.787528-38.257239A38.257239 38.257239 0 0 1 810.867972 83.790087z" fill="#FFFFFF" ></path><path d="M795.565077 83.790087a24.484633 24.484633 0 1 1-24.484633-24.484633 24.484633 24.484633 0 0 1 24.484633 24.484633z" fill="#48B8BF" ></path><path d="M106.93477 852.913626h639.66104v171.086374H106.93477z" fill="#FFE610" ></path><path d="M383.305066 709.678522h337.275822v207.201208H383.305066z" fill="#4D4D4D" ></path><path d="M407.177584 732.02075h291.061076v161.904636H407.177584z" fill="#FFFFFF" ></path><path d="M429.825869 755.893267h159.150116v16.22107h-159.150116zM429.825869 784.356653h131.604903v16.22107h-131.604903zM429.825869 812.820039h199.855818v16.22107h-199.855818zM429.825869 841.283425h146.601741v16.22107h-146.601741z" fill="#92D5D2" ></path><path d="M507.564579 732.326808l-31.830023 161.904636H407.177584v-161.904636h100.386995z" fill="#F5F5F5" opacity=".5" ></path><path d="M474.816383 916.87973h155.783478v31.830023h-155.783478z" fill="#7A807D" ></path><path d="M106.93477 977.173139h639.66104v46.826861H106.93477z" fill="#F7A53F" ></path><path d="M252.006221 899.740487h66.414567v48.969266H252.006221z" fill="#7A807D" ></path><path d="M319.64502 817.716966l-3.672695 11.324143-21.730112 70.699378h-21.730112l23.872518-76.820537 3.366637-11.324143 19.893764 6.121159z" fill="#999999" ></path><path d="M341.069074 809.147344A28.463386 28.463386 0 1 1 321.17531 773.950684a28.463386 28.463386 0 0 1 19.893764 35.19666z" fill="#48B8BF" ></path><path d="M322.705599 793.538391a13.16049 13.16049 0 1 1-26.014923 0 13.16049 13.16049 0 0 1 26.014923 0z" fill="#FFFFFF" ></path><path d="M165.085773 899.740487h66.414568v49.275324H165.085773z" fill="#7A807D" ></path><path d="M163.861542 817.716966l3.366637 11.324143 22.03617 70.699378h21.730111l-23.872517-76.820537-3.672695-11.324143-19.587706 6.121159z" fill="#999999" ></path><path d="M142.437488 809.147344a28.157328 28.157328 0 1 0 18.669532-35.19666 28.157328 28.157328 0 0 0-18.669532 35.19666z" fill="#F7A53F" ></path><path d="M160.800963 793.538391a13.16049 13.16049 0 1 0 12.854432-12.854433 12.854432 12.854432 0 0 0-12.854432 12.854433z" fill="#FFFFFF" ></path></symbol><symbol id="icon-jixiebi2" viewBox="0 0 1164 1024"><path d="M848.55632 485.108049h233.370249v430.146938h-233.370249z" fill="#FFE610" ></path><path d="M974.217224 605.245396h154.314351v64.211341h-154.314351zM974.217224 689.82485h154.314351v64.211341h-154.314351zM974.217224 774.749527h154.314351v64.211341h-154.314351z" fill="#54D9D9" ></path><path d="M306.557369 245.869021l99.078789 31.760448 69.389675 22.094225 145.683794 46.259783 69.734897 22.094225 119.101681 37.974449 66.627896 21.058558 1.035667-2.761778 21.749003-69.044453 23.129891-72.151453-22.784669-7.249667-79.746343-25.201225-20.368113-6.559223-337.972595-107.364124-21.40378-6.904445-87.686455-27.617781-45.224116 142.576794-0.345222 1.035667z" fill="#FFE610" ></path><path d="M412.33347 357.755556l10.70189-33.555604 441.470229 140.401894-10.667368 33.555604z" fill="#A3A3A3" ></path><path d="M380.331366 357.686512l25.408359-79.953476 69.424197 22.094225-25.408359 79.918953zM595.508402 425.626253l25.408359-79.953476 69.389674 22.059703-25.373836 79.953476z" fill="#3F3F3F" ></path><path d="M809.200982 411.575707a144.302906 144.302906 0 0 0 4.833112 37.284004 138.088905 138.088905 0 0 0 18.987224 43.152783 144.302906 144.302906 0 0 0 15.535002 19.677669 146.719461 146.719461 0 0 0 256.154919-100.114456 144.648128 144.648128 0 0 0-34.522226-94.5909 180.206021 180.206021 0 0 0-15.880224-16.570668 146.719461 146.719461 0 0 0-96.317012-34.522227 148.445573 148.445573 0 0 0-58.687784 10.356668 146.719461 146.719461 0 0 0-89.757788 129.803571 34.522226 34.522226 0 0 0-0.345223 5.523556z" fill="#FFC200" ></path><path d="M876.174101 411.575707A80.091565 80.091565 0 1 0 956.265666 331.484142a80.091565 80.091565 0 0 0-80.091565 80.091565z" fill="#FFFFFF" ></path><path d="M904.827549 411.575707a51.438117 51.438117 0 1 0 51.438117-51.092895 51.438117 51.438117 0 0 0-51.438117 51.092895z" fill="#54D9D9" ></path><path d="M218.076903 216.594173l37.007826-117.202958 88.894733 28.06657L306.902591 244.660743zM86.512699 119.345062l92.450522-16.467102 19.401491 108.745013-92.450522 16.467102z" fill="#8A8A8A" ></path><path d="M0 65.317778l45.224116 254.083585 21.058558-3.797445 31.415226-5.523556 22.094225-4.142667-13.808891-77.675009-19.332446-109.090235-12.082779-67.318341-14.499335 2.761778-21.403781 3.797445-38.664893 6.904445z" fill="#292929" ></path><path d="M95.626567 436.43171l16.570668-3.107-14.499335-123.244348-31.415226 5.523556 29.343893 120.827792z" fill="#7A807D" ></path><path d="M138.088905 153.349455a80.782009 80.782009 0 0 0 31.070003 63.520896 79.40112 79.40112 0 0 0 49.021562 16.915891 75.258453 75.258453 0 0 0 32.10567-6.904445 80.091565 80.091565 0 0 0 48.331117-73.532342 78.710676 78.710676 0 0 0-13.808891-44.18845 76.984564 76.984564 0 0 0-31.760448-27.617781l-7.59489-3.452222a83.543787 83.543787 0 0 0-12.428001-3.452223H217.835247A80.091565 80.091565 0 0 0 138.088905 153.349455z" fill="#FFC200" ></path><path d="M167.087575 153.694677A51.092895 51.092895 0 1 0 217.835247 103.637449a50.747673 50.747673 0 0 0-50.747672 50.057228z" fill="#FFFFFF" ></path><path d="M185.384355 153.694677a32.450893 32.450893 0 1 0 32.450892-34.522226 32.450893 32.450893 0 0 0-32.450892 34.522226z" fill="#54D9D9" ></path><path d="M38.664893 58.413333l21.403781-3.797445C66.627897 19.74844 108.745013 11.117883 141.88635 14.915328a89.757788 89.757788 0 0 1 81.472454 58.687784h9.321001a83.543787 83.543787 0 0 1 12.428001 3.452223l7.59489 3.452223c53.854673-42.807561 165.016241-17.951558 187.110466 48.331116l21.40378 6.904446C439.813162 59.449 307.593036 24.581551 241.655583 69.115223a113.923346 113.923346 0 0 0-108.745012-69.044452C90.793455 0.070771 41.081449 10.772661 38.664893 58.413333zM799.189537 244.14291l20.368113 6.559223a345.222262 345.222262 0 0 0 89.412566-34.522226c48.331117-22.784669 133.601015-34.522226 144.99335 34.522226a114.613791 114.613791 0 0 1 0 48.676339 180.206021 180.206021 0 0 1 15.880224 16.570668c15.880224-50.057228 3.797445-107.364124-54.545117-124.280014-83.198565-22.439447-141.541127 45.569339-216.109136 52.473784z" fill="#3F3F3F" ></path><path d="M44.18845 731.251522a105.638012 105.638012 0 0 0 105.638012 105.638012h698.729858v-31.415226H149.826462a74.222786 74.222786 0 0 1 0-148.445573h698.729858v-31.415225H149.826462a105.638012 105.638012 0 0 0-105.638012 105.638012z" fill="#8A8A8A" ></path><path d="M75.603675 731.251522a74.222786 74.222786 0 0 0 74.222787 74.222786h698.729858V655.993069H149.826462a74.222786 74.222786 0 0 0-74.222787 75.258453z" fill="#FFE610" ></path><path d="M103.566679 731.251522a51.092895 51.092895 0 1 0 50.747672-50.747673A50.747673 50.747673 0 0 0 103.566679 731.251522z" fill="#FFFFFF" ></path><path d="M121.863459 731.251522a32.450893 32.450893 0 1 0 32.450892-32.450893 32.450893 32.450893 0 0 0-32.450892 32.450893zM290.331922 731.251522a34.522226 34.522226 0 0 0 34.522227 34.522226h414.266714a34.522226 34.522226 0 0 0 34.522226-34.522226 34.522226 34.522226 0 0 0-34.522226-34.522226h-414.266714a34.522226 34.522226 0 0 0-34.522227 34.522226z" fill="#54D9D9" ></path><path d="M827.15254 877.625761h276.523032v61.794785h-276.523032z" fill="#F7A53F" ></path><path d="M839.925764 939.765768h250.976584v31.070004h-250.976584z" fill="#707070" ></path><path d="M747.75142 657.028735v148.445573h43.152783v31.415226h57.652117v-211.276024h-57.652117v31.415225h-43.152783z" fill="#B3B3B3" opacity=".76" ></path><path d="M14.499335 970.490549h1149.590133v53.509451H14.499335z" fill="#B86805" ></path><path d="M154.314351 836.889534H272.725587v133.601015H154.314351zM614.150404 836.889534h118.411236v133.601015h-118.411236z" fill="#F7A53F" ></path><path d="M614.150404 836.889534h118.411236v78.365453h-118.411236zM154.314351 836.889534H272.725587v78.365453H154.314351z" fill="#B3B3B3" opacity=".76" ></path></symbol><symbol id="icon-jixiebi4" viewBox="0 0 1123 1024"><path d="M502.569098 505.335276h543.234824v85.15391H502.569098z" fill="#FFE610" ></path><path d="M483.047648 203.089382a81.451566 81.451566 0 0 1-41.06236 73.373725l-302.919047 173.33701a82.124719 82.124719 0 0 1-81.788143-143.045105l302.919047-173.33701a82.124719 82.124719 0 0 1 83.807603 0 79.768682 79.768682 0 0 1 27.935868 28.945597A77.412645 77.412645 0 0 1 483.047648 203.089382z" fill="#FFC200" ></path><path d="M39.776109 803.542249h1082.094151v220.121174H39.776109z" fill="#FFE610" ></path><path d="M39.776109 971.830609h1082.094151v52.169391H39.776109zM466.218812 723.43699v146.747449H219.844654v-146.747449a123.187079 123.187079 0 0 1 246.374158 0z" fill="#FFC200" ></path><path d="M396.210854 790.415757a100.973016 100.973016 0 0 1-141.698798-23.896947l-235.603704-331.864645a100.973016 100.973016 0 0 1 23.896947-141.362222 100.973016 100.973016 0 0 1 141.698799 23.896947l235.603703 331.528068a100.973016 100.973016 0 0 1-24.233523 141.698799z" fill="#FFE610" ></path><path d="M146.470929 451.146424a86.16364 86.16364 0 1 1 29.282174-118.138428 86.16364 86.16364 0 0 1-29.282174 118.138428z" fill="#B8B8B8" ></path><path d="M131.661553 424.556864a56.881466 56.881466 0 1 1 19.52145-78.085799 56.544889 56.544889 0 0 1-19.52145 78.085799z" fill="#B8B8B8" ></path><path d="M120.554522 405.035414a35.677132 35.677132 0 0 1-36.686863-60.920386A35.677132 35.677132 0 1 1 120.554522 405.035414z" fill="#FFFFFF" ></path><path d="M370.9676 757.767815a56.881466 56.881466 0 1 1 19.184873-78.085798 56.881466 56.881466 0 0 1-19.184873 78.085798z" fill="#B8B8B8" ></path><path d="M358.850839 739.592672a35.677132 35.677132 0 1 1 12.116761-48.803624 35.677132 35.677132 0 0 1-12.116761 48.803624z" fill="#FFFFFF" ></path><path d="M423.136992 384.167657l-112.416624 66.305614-32.984519-55.871735 112.753201-65.969037 9.760725 16.492259 13.463069 22.887217 9.424148 16.155682z" fill="#8A8A8A" ></path><path d="M400.18246 345.023785l70.512822-41.398937 13.463069 22.887217-70.512823 41.432594z" fill="#C4C4C4" ></path><path d="M489.442606 313.823123a21.877487 21.877487 0 0 1-11.780186 27.935868 21.54091 21.54091 0 0 1-27.935867-12.116762l-29.955328-73.373725a21.54091 21.54091 0 0 1 12.116762-27.935868 21.204333 21.204333 0 0 1 27.599291 11.780186z" fill="#F7A53F" ></path><path d="M482.037918 318.19862a12.453339 12.453339 0 0 1-9.424148 14.809376 12.789915 12.789915 0 0 1-14.809376-9.424148 12.789915 12.789915 0 0 1 9.424148-14.809376 12.453339 12.453339 0 0 1 14.809376 9.424148z" fill="#707070" ></path><path d="M303.652257 388.543155a24.5701 24.5701 0 0 0-7.404688 8.077841l-24.906677 45.10128 32.311365 44.764704 36.350285-65.63246a24.906677 24.906677 0 0 0-36.013709-33.657672z m12.453338 6.394957a14.472799 14.472799 0 0 1 16.155683 12.116762 14.136222 14.136222 0 0 1-12.116762 16.155683 13.799645 13.799645 0 0 1-16.155683-11.780185 14.136222 14.136222 0 0 1 13.463069-16.49226z" fill="#B86805" ></path><path d="M305.33514 411.430372a13.799645 13.799645 0 0 0 16.155683 11.780185 14.136222 14.136222 0 0 0 12.116762-16.155683 14.472799 14.472799 0 0 0-16.155683-12.116762 14.136222 14.136222 0 0 0-12.116762 16.49226z" fill="#5E5E5E" ></path><path d="M625.4196 163.709906l-19.858026 12.116762-37.360016 22.55064-19.858027 12.116762-20.867756-34.667402-40.389207-66.64219-19.184872-31.301635 9.424148-5.721804 58.227772-35.340556 9.424148-5.385227 80.441836 132.27465z" fill="#8A8A8A" ></path><path d="M568.066927 198.276335l37.124412-22.516982 36.484917 60.14626-37.15807 22.55064z" fill="#4D4D4D" ></path><path d="M931.031261 336.373763l-85.15391 217.765137h-128.572307l-46.447587-118.811581-30.965058-79.768683-7.404688-19.184873 46.111011-46.447587h205.648375l46.784164 46.447587z" fill="#AEBABD" ></path><path d="M744.668732 483.861681l105.954351-43.182793 2.423352 5.890093-105.988009 43.182793zM840.8287 361.953594l-120.157889-26.252984 1.682884-6.058381 119.821312 26.252984-1.346307 6.058381zM683.916634 363.838423l6.125696-1.851172 32.984518 109.252803-6.159353 1.851172z" fill="#6A5060" ></path><path d="M880.544753 403.015954a49.813354 49.813354 0 1 1-49.813354-49.813355 50.149931 50.149931 0 0 1 49.813354 49.813355zM746.923796 359.597557a33.657672 33.657672 0 1 1-33.657672-33.657672 33.657672 33.657672 0 0 1 33.657672 33.657672zM767.454975 465.282647a26.589561 26.589561 0 0 1-26.58956 26.252984A26.252984 26.252984 0 0 1 741.201991 438.693086a26.589561 26.589561 0 0 1 26.252984 26.589561z" fill="#FFFFFF" ></path><path d="M846.887081 403.015954a16.155683 16.155683 0 1 1-16.155682-16.155683 16.155683 16.155683 0 0 1 16.155682 16.155683zM724.709732 359.597557a10.097302 10.097302 0 0 1-10.097302 9.760725 9.760725 9.760725 0 1 1 0-19.52145 10.097302 10.097302 0 0 1 10.097302 9.760725zM748.943256 465.282647A7.741265 7.741265 0 0 1 741.201991 472.350758a8.077841 8.077841 0 0 1-8.077841-8.077842 8.077841 8.077841 0 0 1 8.077841-8.077841 8.077841 8.077841 0 0 1 7.741265 9.087572z" fill="#788B90" opacity=".37" ></path><path d="M698.456748 219.581642h166.268899v46.11101h-166.268899z" fill="#F7A53F" ></path><path d="M702.159092 223.620562h5.048651v38.03317h-5.048651zM711.246663 223.620562h5.048651v38.03317h-5.048651zM720.334235 223.620562h5.048651v38.03317h-5.048651zM729.421806 223.620562h5.048651v38.03317h-5.048651zM738.509378 223.620562h5.04865v38.03317h-5.04865zM747.596949 223.620562h5.048651v38.03317h-5.048651zM756.68452 223.620562h5.048651v38.03317h-5.048651zM765.772092 223.620562h5.048651v38.03317h-5.048651zM774.859663 223.620562h5.048651v38.03317H774.859663zM783.610658 223.620562h5.048651v38.03317h-5.048651zM792.698229 223.620562h5.048651v38.03317h-5.048651zM801.785801 223.620562h5.04865v38.03317h-5.04865zM810.873372 223.620562h5.048651v38.03317h-5.048651zM819.960944 223.620562h5.04865v38.03317h-5.04865zM829.048515 223.620562h5.048651v38.03317h-5.048651zM838.136086 223.620562h5.048651v38.03317h-5.048651zM847.223658 223.620562h5.048651v38.03317h-5.048651zM856.311229 223.620562h5.048651v38.03317h-5.048651z" fill="#788B90" opacity=".38" ></path><path d="M738.845954 265.692652h85.490487v23.896947h-85.490487z" fill="#707070" ></path><path d="M735.816764 288.916446h-1.682884L640.228976 355.558636l-39.0429 26.926138-4.712074 3.365767-16.492259-23.896947a25.916407 25.916407 0 0 1 6.731534-36.013709l97.270672-67.315344a25.916407 25.916407 0 0 1 36.013709 6.731534z" fill="#58BFD2" ></path><path d="M670.857457 435.327319h-33.657672a12.116762 12.116762 0 0 1-10.433878-8.414418l-24.906677-44.428127 39.042899-26.926138z" fill="#8A8A8A" ></path><path d="M827.365631 288.916446h1.682884l94.241481 65.63246 39.0429 26.926138 4.712074 3.365767 16.492259-23.896947a25.916407 25.916407 0 0 0-6.731534-35.003979l-97.270672-67.315344a25.916407 25.916407 0 0 0-36.013709 6.731534z" fill="#58BFD2" ></path><path d="M892.324938 435.327319h33.657672a12.116762 12.116762 0 0 0 10.433878-8.414418l24.906677-44.428127-39.042899-26.926138z" fill="#8A8A8A" ></path><path d="M738.845954 265.692652h85.490487v12.116762h-85.490487zM922.95342 355.558636l-31.301635 79.768683-46.447588 118.811581 49.140201-194.541343-70.007957-69.671381h4.038921l94.578058 65.63246z" fill="#848484" opacity=".25" ></path><path d="M661.433309 321.900964l-48.467048-67.988497 21.204334-12.789915 38.033169 74.383455-10.770455 6.394957z" fill="#7A807D" ></path><path d="M535.553616 36.820483l-58.227772 33.657672-11.780186-19.184873A33.657672 33.657672 0 0 1 502.905674 1.143351a33.657672 33.657672 0 0 1 21.204334 15.482529z" fill="#F7A53F" ></path><path d="M527.475775 175.826668L483.047648 203.089382A77.412645 77.412645 0 0 0 471.940616 164.046483a79.768682 79.768682 0 0 0-27.599291-28.272444l42.745243-25.916408zM527.475775 175.826668l-40.389207-66.64219 40.389207 66.64219z" fill="#C4C4C4" ></path><path d="M956.274515 854.028757H600.512923l32.311365-25.243254h290.802285l32.647942 25.243254z" fill="#999999" ></path><path d="M650.999431 304.062398l-70.007958 14.809376 69.671381 8.414418-4.712074 38.033169 25.243254-25.243254 22.887217 25.243254-3.702344-36.350286 35.003979-1.682883-31.974789-19.52145 14.809376-35.677132-33.657672 24.906677-26.252984-43.754973 2.692614 50.823084z" fill="#FFFFFF" ></path><path d="M956.274515 803.542249H600.512923l32.311365 25.243254h290.802285l32.647942-25.243254z" fill="#7A807D" ></path><path d="M956.274515 803.542249H600.512923l32.311365-25.579831h290.802285l32.647942 25.579831z" fill="#999999" ></path><path d="M956.274515 752.719165H600.512923l32.311365 25.243253h290.802285l32.647942-25.243253zM956.274515 702.232657H600.512923l32.311365 25.243254h290.802285l32.647942-25.243254z" fill="#7A807D" ></path><path d="M956.274515 752.719165H600.512923l32.311365-25.243254h290.802285l32.647942 25.243254z" fill="#999999" ></path><path d="M584.693817 632.561276h378.985386v69.671381H584.693817zM584.693817 854.028757h378.985386v34.667402H584.693817z" fill="#FFC200" ></path><path d="M502.569098 590.489186h543.234824v42.07209H502.569098z" fill="#F7A53F" ></path><path d="M273.696929 882.637778h80.441836v59.574079H273.696929z" fill="#7A807D" ></path><path d="M355.821648 783.011069l-4.375497 13.799646-26.589561 85.827063h-26.252984l28.945598-93.231751 4.375497-13.799646 23.896947 7.404688z" fill="#999999" ></path><path d="M381.738055 772.913768a33.657672 33.657672 0 1 1-22.55064-43.08182 33.657672 33.657672 0 0 1 22.55064 43.08182z" fill="#F7A53F" ></path><path d="M359.523992 753.728895a15.819106 15.819106 0 1 1-15.819106-15.819106 15.819106 15.819106 0 0 1 15.819106 15.819106z" fill="#FFFFFF" ></path><path d="M168.348416 882.637778h80.441835v59.574079H168.348416z" fill="#7A807D" ></path><path d="M166.665532 783.011069l4.375497 13.799646 26.589561 85.827063h26.252984l-28.945598-93.231751-4.03892-13.799646-24.233524 7.404688z" fill="#999999" ></path><path d="M140.749125 772.913768a33.657672 33.657672 0 1 0 67.315343-20.53118 33.657672 33.657672 0 0 0-43.08182-22.55064 33.657672 33.657672 0 0 0-24.233523 43.08182z" fill="#68FF4B" ></path><path d="M162.963188 753.728895a15.819106 15.819106 0 1 0 15.819106-15.819106 15.819106 15.819106 0 0 0-15.819106 15.819106z" fill="#FFFFFF" ></path></symbol></svg>',(s=>{var e=(t=(t=document.getElementsByTagName("script"))[t.length-1]).getAttribute("data-injectcss"),t=t.getAttribute("data-disable-injectsvg");if(!t){var n,i,r,a,o,l=function(f,u){u.parentNode.insertBefore(f,u)};if(e&&!s.__iconfont__svg__cssinject__){s.__iconfont__svg__cssinject__=!0;try{document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>")}catch(f){console&&console.log(f)}}n=function(){var f,u=document.createElement("div");u.innerHTML=s._iconfont_svg_string_4634042,(u=u.getElementsByTagName("svg")[0])&&(u.setAttribute("aria-hidden","true"),u.style.position="absolute",u.style.width=0,u.style.height=0,u.style.overflow="hidden",u=u,(f=document.body).firstChild?l(u,f.firstChild):f.appendChild(u))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(n,0):(i=function(){document.removeEventListener("DOMContentLoaded",i,!1),n()},document.addEventListener("DOMContentLoaded",i,!1)):document.attachEvent&&(r=n,a=s.document,o=!1,h(),a.onreadystatechange=function(){a.readyState=="complete"&&(a.onreadystatechange=null,c())})}function c(){o||(o=!0,r())}function h(){try{a.documentElement.doScroll("left")}catch{return void setTimeout(h,50)}c()}})(window);const Iu=ft.defineStore("formToTableComp",{state:()=>({selectArray:[],selectString:""}),actions:{setSelectArray(s){this.selectArray=s},setSelectString(s){this.selectString=s}}}),e3={class:"calculator-content"},t3={class:"calculator-child"},n3={class:"calculator-child"},i3=$.defineComponent({__name:"calculator",setup(s){const e=$.ref(),t=$.ref();return $.onMounted(()=>{e.value=[{type:"Upload",label:"输入",name:"input"}],t.value=[{type:"Upload",label:"输出",name:"output"}]}),(n,i)=>($.openBlock(),$.createElementBlock("div",e3,[$.createElementVNode("div",t3,[$.createVNode(kn.ssForm,{rowContents:e.value,isRowFlex:!0},null,8,["rowContents"])]),$.createElementVNode("div",n3,[$.createVNode(kn.ssForm,{rowContents:t.value,isEdit:!1,isRowFlex:!0},null,8,["rowContents"])])]))}}),s3=gl._export_sfc(i3,[["__scopeId","data-v-73db0fe7"]]),Fu=ft.defineStore("unit",{state:()=>({selectIndex:"",selectMenu:"",selectTitle:[]}),actions:{setSelectIndex(s){this.selectIndex=s},setSelectMenu(s){this.selectMenu=s},setSelectTitle(s){this.selectTitle=s}}}),Ou=(s,e)=>{let t=s,n=e;return Array.isArray(t)&&(t=t==null?void 0:t.map((i,r)=>{if(Array.isArray(i)){let a={};return i=i==null?void 0:i.forEach((o,l)=>{var c;(c=n==null?void 0:n[l])!=null&&c.prop?a[n[l].prop]=o:Array.isArray(o)&&(a.children=Ou(o,n))}),Object.assign(a,{id:r})}else return i})),t},zu=(s,e,t)=>{let n=s,i=e;return n=n==null?void 0:n.map((r,a)=>{var o,l;return!Array.isArray(r)||!((o=i==null?void 0:i[a])!=null&&o.label)&&!t||(r.unshift(((l=i==null?void 0:i[a])==null?void 0:l.label)??""),r.some(c=>Array.isArray(c))&&(r=r==null?void 0:r.map(c=>{var h;return Array.isArray(c)&&(c=zu(c,(h=i==null?void 0:i[a])==null?void 0:h.children,t)),c}))),r}),n},r3=(s,e,t)=>{if(e==="")return s==null?void 0:s.filter(n=>(n==null?void 0:n.id)!==t);{const n=e.split("-");return a3(s,n,t)}},a3=(s,e,t)=>{let n=s,i=e;return(i==null?void 0:i.length)===0?n=n==null?void 0:n.filter(r=>r.id!==t):n=n==null?void 0:n.map(r=>(r.id.toString()===(i==null?void 0:i[0])&&(i==null||i.shift(),r=Bu(r,i,t)),r)),n},Bu=(s,e,t)=>{var r,a;let n=s,i=e;return(i==null?void 0:i.length)===0?n.children=(r=n.children)==null?void 0:r.filter(o=>o.id!==t):n.children=(a=n.children)==null?void 0:a.map(o=>(o.id.toString()===(i==null?void 0:i[0])&&(i==null||i.shift(),o=Bu(o,i,t)),o)),n},o3=(s,e,t)=>{if(e==="")return t;{const n=e.split("-");return l3(s,n,t)}},l3=(s,e,t)=>{let n=s,i=e;return(i==null?void 0:i.length)===0?n=t:n=n==null?void 0:n.map(r=>(r.id.toString()===(i==null?void 0:i[0])&&(i==null||i.shift(),r=ku(r,i,t)),r)),n},ku=(s,e,t)=>{var r;let n=s,i=e;return(i==null?void 0:i.length)===0?n.children=t:n.children=(r=n.children)==null?void 0:r.map(a=>(a.id.toString()===(i==null?void 0:i[0])&&(i==null||i.shift(),a=ku(a,i,t)),a)),n},Vu=ft.defineStore("modelTableComp",{state:()=>({tableIndex:0,tableShowThree:""}),actions:{setTableIndex(s){this.tableIndex=s},setTableShowThree(s){this.tableShowThree=s}}}),c3={class:"table-content"},h3={class:"menu-config-wrap"},u3=["onClick"],d3={class:"menu-config-wrap",style:{padding:"0 16px","box-sizing":"border-box","max-height":"600px",width:"200px"}},f3={class:"form-content"},p3={key:0,class:"dialog-footer"},m3={class:"dialog-footer"},g3={__name:"index",props:{compName:{type:String,default:"",required:!1},operatingForm:{type:Object,default:()=>{}},itemData:{type:Array,default:()=>[]},childItemData:{type:Array,default:()=>[]},index:Number,changedContent:{type:Object,default:()=>{}},showHeader:{type:Boolean,default:!0}},emits:["change","contentChange","onButtonClick","contentClick","pageChange","rowClick"],setup(s,{emit:e}){const t=$.ref([]),n=s,i=e,r=$.ref([]),a=$.ref(!1),o=$.ref(),l=ft.useMenuState(),{activeMenuPath:c}=ft.storeToRefs(l),h=Vu(ft.pinia),f=Vh.useModelComp(ft.pinia),{extraContents:u}=ft.storeToRefs(f),d=$.ref([]);$.ref(!1);const m=$.ref("");$.ref();const _=$.ref(!0),g=$.ref(0),p=$.ref(!1),w=$.ref(""),E=$.ref(!1),S=$.ref({label:"查看三维模型"}),U=$.ref(!1),L=$.ref(),D=$.ref([]),N=$.ref([]),b=$.ref(!1),M=$.ref([]),I=$.ref([]),V=$.ref(),H=$.ref(),J=Iu(ft.pinia),ie=$.ref(),B=Fu(ft.pinia),{selectIndex:oe,selectMenu:j,selectTitle:ue}=ft.storeToRefs(B),{selectString:pe}=ft.storeToRefs(J),Me=$.ref(720),Ue=$.computed(()=>{var W;return(W=r.value)==null?void 0:W.filter(ae=>(ae==null?void 0:ae.label)!=="操作")}),Ne=()=>{E.value=!1},Y=W=>{i("clickTrigger",W)},se=(W,ae)=>{if(Object.values(ae).length!==0)return Object.values(ae).find(ne=>{var ye,Oe,T;return((ye=ne==null?void 0:ne.toString())==null?void 0:ye.includes(".txt"))||((Oe=ne==null?void 0:ne.toString())==null?void 0:Oe.includes(".cpt"))||((T=ne==null?void 0:ne.toString())==null?void 0:T.includes(".obj"))})?[...W,S.value]:W},re=W=>{var Oe;pe.value===""?W==null||W[0]:(W==null?void 0:W.find(T=>(T==null?void 0:T.selectLabel)==="("+pe.value+")"))??(W==null||W.find(T=>!(T!=null&&T.selectLabel)));let ae=W;(Oe=r.value)!=null&&Oe.find(T=>T.prop==="index");let ne=V.value;const ye=[];return ae==null||ae.forEach((T,y)=>{var K;let k={};if(Array.isArray(T)){let Q=[];T==null||T.filter(O=>!(O!=null&&O.id)).forEach((O,we)=>{var xe,Se,Ie,de,Pe;if((xe=ne==null?void 0:ne[we])!=null&&xe.prop&&!Array.isArray(O)){let qe={};qe[ne[we].column]=O,u!=null&&u.value&&((Se=u==null?void 0:u.value)==null?void 0:Se.length)>0&&((Ie=u==null?void 0:u.value)!=null&&Ie.find(ke=>JSON.stringify(ke==null?void 0:ke[0])===JSON.stringify(qe)))&&(Q=(de=u==null?void 0:u.value)==null?void 0:de.find(ke=>JSON.stringify(ke==null?void 0:ke[0])===JSON.stringify(qe))),Q&&Q.length>0?k[ne[we].prop]=Q!=null&&Q.find(ke=>{var Ae;return((Ae=Object.keys(ke))==null?void 0:Ae[0])===ne[we].column})?(Pe=Q==null?void 0:Q.find(ke=>{var Ae;return((Ae=Object.keys(ke))==null?void 0:Ae[0])===ne[we].column}))==null?void 0:Pe[ne[we].column]:O:k[ne[we].prop]=O}})}else k=T;Array.isArray(T)&&T.some(Q=>Q==null?void 0:Q.id)?ye.push(Object.assign(k,{id:(K=T==null?void 0:T.find(Q=>Q.id))==null?void 0:K.id})):k.id?ye.push(k):ye.push(Object.assign(k,{id:y}))}),ye},le=async W=>{var Oe,T,y,k,K;let ae={};for(let Q in W)W[Q]!==""&&(ae["tableData."+Q]=W[Q]);const ne=await bn.filterContents({type:"data",tableId:n==null?void 0:n.index,systemKey:sessionStorage.getItem("systemKey"),pageKey:c.value},ae),ye=(y=(T=(Oe=ft.cloneDeep(ne))==null?void 0:Oe.data)==null?void 0:T.result)==null?void 0:y.map(Q=>{var we;let O=[];return O.push({id:Q.id}),O.push((we=Q==null?void 0:Q.value)==null?void 0:we.tableData),O});d.value=re(bn.getTableContents(ye,(K=(k=ft.cloneDeep(r.value))==null?void 0:k.map(Q=>Q.label))==null?void 0:K.filter(Q=>Q!=="操作")))},Ee=async W=>{var ye,Oe,T,y,k,K,Q,O,we,xe;const ae=(ye=ft.cloneDeep(r.value))==null?void 0:ye.filter(Se=>Se==null?void 0:Se.isRoute);if((ae==null?void 0:ae.length)>0){let Se=(Oe=ae==null?void 0:ae[0])==null?void 0:Oe.prop,Ie=c.value+"/"+(W==null?void 0:W[Se]),de=c.value,Pe=await bn.getItemData(Ie,sessionStorage.getItem("systemKey"),"");if((Pe==null?void 0:Pe.length)>0)f.setRouteToChildPath(de),l.setActiveMenuPath(Ie);else{const qe=await bn.findFirstContent(n==null?void 0:n.index);qe&&(Ie=c.value+"/"+(qe==null?void 0:qe[(T=ae==null?void 0:ae[0])==null?void 0:T.label]),await bn.loadingConstruct(Ie,c.value+"/"+(W==null?void 0:W[Se])),f.setRouteToChildPath(de),l.setActiveMenuPath(c.value+"/"+(W==null?void 0:W[Se])))}}let ne=await bn.getItemData(c.value,sessionStorage.getItem("systemKey"),W.id);if(ne=ne==null?void 0:ne.filter(Se=>Se.comp!=="methodButton"),ne&&ne.length>0){const Se=!Array.isArray(ue.value)&&((y=ue.value)==null?void 0:y.key)!=="main"?[]:ue.value;Se.push({key:j.value===""?(k=W==null?void 0:W.id)==null?void 0:k.toString():j.value+"-"+((K=W==null?void 0:W.id)==null?void 0:K.toString()),value:W[(Q=Object.keys(W))==null?void 0:Q.filter(Ie=>Ie!=="index"&&Ie!=="id")[0]]}),B.setSelectMenu(j.value===""?(O=W==null?void 0:W.id)==null?void 0:O.toString():j.value+"-"+((we=W==null?void 0:W.id)==null?void 0:we.toString())),B.setSelectTitle(Se),B.setSelectIndex((xe=W==null?void 0:W.id)==null?void 0:xe.toString()),i("pageChange",ne)}},fe=W=>{var ae;(ae=ft.cloneDeep(n.itemData))==null||ae.map(ne=>((ne==null?void 0:ne.key)==="tableContents"&&(ne.contents=W),ne))},be=async(W,ae,ne,ye)=>{var Oe;if((ye==null?void 0:ye.data)==="查看"&&(W!=null&&W.every(T=>(T==null?void 0:T.url)&&(T==null?void 0:T.name)))){let T=ft.cloneDeep(W);T=await((Oe=ft.cloneDeep(T))==null?void 0:Oe.map(async k=>{var O,we,xe,Se;const K=await kn.downloadAvatarApi({url:k==null?void 0:k.url});let Q=URL.createObjectURL(K.data);return{name:(k==null?void 0:k.name)+"."+((Se=(O=k==null?void 0:k.url)==null?void 0:O.split("."))==null?void 0:Se[((xe=(we=k==null?void 0:k.url)==null?void 0:we.split("."))==null?void 0:xe.length)-1]),blobUrl:Q}}));let y=await Promise.all(T);o.value=y,a.value=!0}i("contentClick",W,ae,ne,{id:n==null?void 0:n.index,type:"table"})},Je=()=>{a.value=!1},at=W=>{i("rowClick",W)};$.watch(()=>n.changedContent,()=>{var ne,ye;if(!n.changedContent)return;let W=(ne=d.value)==null?void 0:ne.map(Oe=>{var T;return Oe.id===((T=n.changedContent)==null?void 0:T.id)&&(Oe={...n.changedContent,id:n.changedContent.newId?n.changedContent.newId:n.changedContent.id},delete Oe.newId),Oe});const ae=(ye=n.itemData)==null?void 0:ye.map(Oe=>((Oe==null?void 0:Oe.key)==="tableContents"&&(Oe.contents=W),Oe));d.value=W,i("contentChange",{contents:ae,index:n.index}),i("change",{content:W,index:n==null?void 0:n.index,buttonName:"",id:n==null?void 0:n.index})},{deep:!0,immediate:!0});const it=()=>{},z=(W,ae,ne)=>{var ye,Oe,T;if(m.value="",b.value=!0,_.value=!0,i("onButtonClick",W,ae),W==="删除"){d.value=(ye=ft.cloneDeep(d.value))==null?void 0:ye.filter(k=>(k==null?void 0:k.id)!==(ae==null?void 0:ae.id));const y=r3(ie.value,j.value,ae==null?void 0:ae.id);fe(y),i("change",{content:d.value,singleContent:ae,index:n==null?void 0:n.index,type:"delete",buttonName:W,column:r.value})}else if(W==="新增")w.value="新增",yt(""),E.value=!0;else if(W==="编辑")w.value="编辑",yt(ae),E.value=!0;else if(W==="查看")w.value="查看",yt(ae),b.value=!1,_.value=!1,E.value=!0;else if(W==="查看三维模型"){const y={};for(let K in ae)K!=="id"&&(y[K]=ae[K]);let k=(Oe=Object.values(y))==null?void 0:Oe[1];h.setTableShowThree(k)}else((T=ne==null?void 0:ne.extra)==null?void 0:T.type)==="modelExample"&&(w.value=W,U.value=!0)},yt=W=>{var Oe,T,y,k,K,Q;const ae=[];let ne=[];for(let O in W)Array.isArray(W==null?void 0:W[O])&&ne.push(O);(T=bn.getColumnChild((Oe=ft.cloneDeep(r.value))==null?void 0:Oe.filter(O=>(O==null?void 0:O.label)!=="操作")))==null||T.forEach((O,we)=>{var xe;ne.find(Se=>Se===(O==null?void 0:O.prop))||(O!=null&&O.formType&&((xe=O==null?void 0:O.formType)==null?void 0:xe.toUpperCase())==="SELECT"?ae.push({label:(O==null?void 0:O.label)??"",name:(O==null?void 0:O.prop)??"t"+we,type:!(O!=null&&O.formType)||(O==null?void 0:O.formType)===""?"Input":O==null?void 0:O.formType,value:(W==null?void 0:W[O==null?void 0:O.prop])??(O==null?void 0:O.value)??"",id:(O==null?void 0:O.id)??we,contents:(O==null?void 0:O.options)??[],width:1,isFormColHidden:O==null?void 0:O.isFormColHidden,optionUrl:{groupSelect:O==null?void 0:O.groupSelect,menuSelect:O==null?void 0:O.formMenuSelect,type:"Select",selectRelateType:O==null?void 0:O.selectRelateType}}):ae.push({label:(O==null?void 0:O.label)??"",name:(O==null?void 0:O.prop)??"t"+we,type:!(O!=null&&O.formType)||(O==null?void 0:O.formType)===""?"Input":O==null?void 0:O.formType,value:(W==null?void 0:W[O==null?void 0:O.prop])??(O==null?void 0:O.value)??"",id:(O==null?void 0:O.id)??we,contents:(O==null?void 0:O.options)??[],width:1,isFormColHidden:O==null?void 0:O.isFormColHidden}))}),W===""||!W||(m.value=W==null?void 0:W.id);let ye=bn.getColumnChild((y=ft.cloneDeep(r.value))==null?void 0:y.filter(O=>(O==null?void 0:O.label)!=="操作"));D.value&&((k=D.value)==null?void 0:k.length)>0&&(D.value=(K=ft.cloneDeep(D).value)==null?void 0:K.map(O=>{var xe;let we=(xe=ye==null?void 0:ye.find(Se=>(Se==null?void 0:Se.label)===(O==null?void 0:O.label)))==null?void 0:xe.prop;return we&&(O.value=W[we]),O})),I.value=D.value&&((Q=D.value)==null?void 0:Q.length)>0?bn.getTableFormToForm(D.value):ae};$.onMounted(()=>{L.value=window.innerWidth-240*2});const dt=()=>{var Oe;let W=bn.getColumnChild((Oe=ft.cloneDeep(r.value))==null?void 0:Oe.filter(T=>(T==null?void 0:T.label)!=="操作")),ae,ne=ft.cloneDeep(d.value);m.value===""?(g.value++,ne.push(Object.assign(H.value,{id:g.value})),ae=Object.assign(H.value,{id:g.value})):ne=ne==null?void 0:ne.map(T=>{var y;if((T==null?void 0:T.id)===m.value){let k={};for(let K in T){let Q=(y=W==null?void 0:W.find(O=>(O==null?void 0:O.prop)===K))==null?void 0:y.label;Q?k[K]=H.value[Q]:k[K]=T[K]}T=Object.assign(k,H.value),ae=T}return T}),d.value=ne;const ye=o3(ie.value,j.value,ne);fe(ye),E.value=!1,i("change",{content:ye,singleContent:ae,index:n==null?void 0:n.index,buttonName:w.value,column:r.value})},ot=W=>{H.value=W,i("onFormChange",W)};return $.watch(()=>[n.itemData,pe.value,oe.value,j.value,u==null?void 0:u.value],()=>{var K,Q,O,we,xe,Se,Ie,de,Pe,qe,ke,Ae,rt,G,De,ge,ze,ve,he,Ge,lt,Lt,pt,en,vn,Di,Ni;const W=(K=ft.cloneDeep(n.itemData))==null?void 0:K.filter(je=>(je==null?void 0:je.key)==="header");(Q=ft.cloneDeep(n.itemData))==null||Q.filter(je=>(je==null?void 0:je.key)==="tableIndexColumn")[0];const ae=(O=ft.cloneDeep(n.itemData))==null?void 0:O.find(je=>(je==null?void 0:je.key)==="page"),ne=(we=ft.cloneDeep(n.itemData))==null?void 0:we.find(je=>(je==null?void 0:je.key)==="rowButton"),ye=(xe=ft.cloneDeep(n.itemData))==null?void 0:xe.find(je=>(je==null?void 0:je.key)==="extraButton"),Oe=(Se=ft.cloneDeep(n.itemData))==null?void 0:Se.filter(je=>(je==null?void 0:je.key)==="tableContents"),T=(Ie=ft.cloneDeep(n.itemData))==null?void 0:Ie.filter(je=>(je==null?void 0:je.key)==="tableIndex");D.value=(qe=(Pe=(de=ft.cloneDeep(n.itemData))==null?void 0:de.filter(je=>(je==null?void 0:je.key)==="tableToForm"))==null?void 0:Pe[0])==null?void 0:qe.contents,p.value=(ae==null?void 0:ae.contents)??!1;let y=[];pe.value===""?y=W==null?void 0:W[0]:y=(W==null?void 0:W.find(je=>(je==null?void 0:je.selectLabel)==="("+pe.value+")"))??(W==null?void 0:W.find(je=>!(je!=null&&je.selectLabel)));let k=[];if(pe.value===""?k=T==null?void 0:T[0]:k=(T==null?void 0:T.find(je=>(je==null?void 0:je.selectLabel)==="("+pe.value+")"))??(T==null?void 0:T.find(je=>!(je!=null&&je.selectLabel))),((ke=y==null?void 0:y.contents)==null?void 0:ke.length)>0){let je=[];if(y!=null&&y.contents.some(Ye=>Array.isArray(Ye)&&(Ye==null?void 0:Ye.find(Te=>Te.children))))j.value===""?je=(rt=(Ae=bn.getGradeColumns(ft.cloneDeep(y==null?void 0:y.contents)))==null?void 0:Ae[0])==null?void 0:rt.filter(Ye=>!Array.isArray(Ye)):(j.value.split("-"),je=(G=bn.getGradeColumns(ft.cloneDeep(y==null?void 0:y.contents)))==null?void 0:G[0]);else{const Ye=y!=null&&y.contents.some(Te=>Array.isArray(Te))?(De=y==null?void 0:y.contents)==null?void 0:De[0]:y==null?void 0:y.contents;Ye==null||Ye.forEach((Te,Gt)=>{var xn;je.push({label:(Te==null?void 0:Te.label)??"",prop:(Te==null?void 0:Te.label)==="操作"?"operate":(Te==null?void 0:Te.prop)??"a"+Gt,width:Te!=null&&Te.width?parseInt(Te.width):"",fixed:(Te==null?void 0:Te.fixed)??void 0,sortable:(Te==null?void 0:Te.sortable)??!1,align:(Te==null?void 0:Te.align)??"center",showOverflowTooltip:(Te==null?void 0:Te.showOverflowTooltip)??!0,isNotDrag:(Te==null?void 0:Te.isNotDrag)??!1,isEditCol:(Te==null?void 0:Te.isEditCol)??!1,isOperate:(Te==null?void 0:Te.isOperate)??!1,id:(Te==null?void 0:Te.id)??Gt,type:(Te==null?void 0:Te.label)==="操作"?"operate":void 0,formType:(Te==null?void 0:Te.formType)??(Te!=null&&Te.groupSelect?"Select":""),isTableColHidden:Te==null?void 0:Te.isTableColHidden,isFormColHidden:Te==null?void 0:Te.isFormColHidden,options:(Te==null?void 0:Te.options)??[],value:(Te==null?void 0:Te.value)??"",formMenuSelect:(Te==null?void 0:Te.formMenuSelect)??[],isRoute:(Te==null?void 0:Te.isRoute)??!1,groupSelect:Te!=null&&Te.groupSelect?(xn=Te==null?void 0:Te.groupSelect)==null?void 0:xn.replaceAll('"',"").split(":"):[]})})}r.value=je,t.value=(ge=r.value)==null?void 0:ge.map(Ye=>Ye==null?void 0:Ye.label);let qt=(ve=(ze=bn.getAllLeafNodes(ft.cloneDeep(r.value)))==null?void 0:ze.filter(Ye=>(Ye==null?void 0:Ye.type)!=="operate"))==null?void 0:ve.map((Ye,Te)=>({prop:(Ye==null?void 0:Ye.prop)??"a"+Te,column:Ye.label}));V.value=qt;let jt=[];pe.value===""?jt=Oe==null?void 0:Oe[0]:jt=(Oe==null?void 0:Oe.find(Ye=>(Ye==null?void 0:Ye.selectLabel)==="("+pe.value+")"))??(Oe==null?void 0:Oe.find(Ye=>!(Ye!=null&&Ye.selectLabel)));let wn=Array.isArray((he=jt==null?void 0:jt.contents)==null?void 0:he[0])&&((Ge=jt==null?void 0:jt.contents)!=null&&Ge[0].every(Ye=>Array.isArray(Ye)))?(lt=ft.cloneDeep(jt==null?void 0:jt.contents))==null?void 0:lt[0]:ft.cloneDeep(jt==null?void 0:jt.contents);k!=null&&k.contents&&((Lt=k==null?void 0:k.contents)==null?void 0:Lt.length)!==0&&(wn=(pt=ft.cloneDeep(wn))==null?void 0:pt.map((Ye,Te)=>{if(!Array.isArray(Ye)){let Gt={};for(let xn in Ye)xn!=="id"&&xn!=="index"&&(Gt[xn]=Ye[xn]);Ye=Object.values(Gt)}return Ye}));const vi=!!((en=r.value)!=null&&en.find(Ye=>Ye.prop==="index"));wn=zu(ft.cloneDeep(wn),k==null?void 0:k.contents,vi);const Yn=[];wn==null||wn.forEach((Ye,Te)=>{var xn;let Gt={};if(Array.isArray(Ye)){let Yt=[];Ye==null||Ye.filter(dn=>!(dn!=null&&dn.id)).forEach((dn,An)=>{var Qi,es,C,X,Z,ee;if((Qi=qt==null?void 0:qt[An])!=null&&Qi.prop&&!Array.isArray(dn)){let q={};q[qt[An].column]=dn,u!=null&&u.value&&((es=u==null?void 0:u.value)==null?void 0:es.length)>0&&((C=u==null?void 0:u.value)!=null&&C.find(me=>JSON.stringify(me==null?void 0:me[0])===JSON.stringify(q)))&&(Yt=(X=u==null?void 0:u.value)==null?void 0:X.find(me=>JSON.stringify(me==null?void 0:me[0])===JSON.stringify(q))),Yt&&Yt.length>0?Gt[qt[An].prop]=Yt!=null&&Yt.find(me=>{var Ce;return((Ce=Object.keys(me))==null?void 0:Ce[0])===qt[An].column})?(Z=Yt==null?void 0:Yt.find(me=>{var Ce;return((Ce=Object.keys(me))==null?void 0:Ce[0])===qt[An].column}))==null?void 0:Z[qt[An].column]:dn:Gt[qt[An].prop]=dn}else Array.isArray(dn)&&((ee=qt[An])!=null&&ee.prop?Gt[qt[An].prop]=dn:Gt.children=Ou(dn,qt))})}else Gt=Ye;Array.isArray(Ye)&&Ye.some(Yt=>Yt==null?void 0:Yt.id)?Yn.push(Object.assign(Gt,{id:(xn=Ye==null?void 0:Ye.find(Yt=>Yt.id))==null?void 0:xn.id})):Gt.id?Yn.push(Gt):Yn.push(Object.assign(Gt,{id:Te}))}),d.value=Yn}else r.value=[],d.value=[];((vn=ne==null?void 0:ne.contents)==null?void 0:vn.length)>0?N.value=ne==null?void 0:ne.contents:N.value=[],((Di=ye==null?void 0:ye.contents)==null?void 0:Di.length)>0?M.value=ye==null?void 0:ye.contents:M.value=[],g.value=((Ni=d==null?void 0:d.value)==null?void 0:Ni.length)??0,ie.value=d.value},{deep:!0,immediate:!0}),$.watch(()=>n==null?void 0:n.operatingForm,W=>{W!=null&&W.form&&(yt(W==null?void 0:W.form),w.value=W==null?void 0:W.dialogTitle,b.value=!0,E.value=!0)},{immediate:!0,deep:!0}),(W,ae)=>{var y;const ne=$.resolveComponent("el-icon"),ye=$.resolveComponent("el-popover"),Oe=$.resolveComponent("svg-icon"),T=$.resolveComponent("el-button");return $.openBlock(),$.createElementBlock("div",c3,[($.openBlock(),$.createBlock(kn.ssTable,{columns:r.value,checkedColumns:t.value,key:r.value,tableData:d.value,isShowPagination:p.value,isShowEdit:!1,isShowDelete:!1,onDbClickRow:Ee,extraButton:M.value,onContentClick:be,onRowClick:at},$.createSlots({headerButton:$.withCtx(k=>[s.showHeader?($.openBlock(),$.createBlock(Ku,{key:0,compName:s.compName,buttons:k.buttons,onButtonClick:ae[0]||(ae[0]=K=>z(K,"",{})),columns:r.value,onFilter:le},null,8,["compName","buttons","columns"])):$.createCommentVNode("",!0)]),operateCol:$.withCtx(()=>[$.createVNode(ye,{title:"选择显示列信息",placement:"left-start","popper-class":"menu-operate-popover",trigger:"click",width:200},{reference:$.withCtx(()=>[$.createVNode(Oe,{name:"operate",style:{width:"15px",height:"15px",cursor:"pointer"}})]),default:$.withCtx(()=>[$.createElementVNode("div",d3,[$.createVNode(kn._sfc_main$5,{content:Ue.value,modelValue:t.value,"onUpdate:modelValue":ae[1]||(ae[1]=k=>t.value=k),min:2,isWrap:!0,onChange:W.handleColumnCheck},null,8,["content","modelValue","onChange"])])]),_:1})]),_:2},[((y=N.value)==null?void 0:y.length)>0?{name:"actions",fn:$.withCtx(({item:k})=>[$.createVNode(ye,{title:"",placement:"left-start","popper-class":"menu-operate-popover"},{reference:$.withCtx(()=>[$.createVNode(ne,null,{default:$.withCtx(()=>[$.createVNode($.unref(ft.more_filled_default))]),_:1})]),default:$.withCtx(()=>[$.createElementVNode("div",h3,[($.openBlock(!0),$.createElementBlock($.Fragment,null,$.renderList(se(N.value,k),(K,Q)=>($.openBlock(),$.createElementBlock("div",{class:"menu-config-item",key:Q},[$.createElementVNode("div",{style:$.normalizeStyle({color:K==null?void 0:K.textColor}),class:"extra-button-label",onClick:O=>z(K==null?void 0:K.label,k,{extra:K})},$.toDisplayString(K==null?void 0:K.label),13,u3)]))),128))])]),_:2},1024)]),key:"0"}:void 0]),1032,["columns","checkedColumns","tableData","isShowPagination","extraButton"])),$.createVNode(kn.ssDialog,{title:w.value,visible:E.value,width:Me.value,onBeforeDestroy:Ne},{default:$.withCtx(()=>[$.createElementVNode("div",f3,[$.createVNode(kn.ssForm,{rowContents:I.value,isEnableWrap:!1,onChange:ot,onClickTrigger:Y,isEdit:_.value},null,8,["rowContents","isEdit"])])]),footer:$.withCtx(()=>[b.value?($.openBlock(),$.createElementBlock("div",p3,[$.createVNode(T,{onClick:ae[2]||(ae[2]=k=>E.value=!1),id:"themeBorderButton"},{default:$.withCtx(()=>ae[5]||(ae[5]=[$.createTextVNode($.toDisplayString("取消"))])),_:1,__:[5]}),$.createVNode(T,{class:"ok-button",onClick:dt,id:"themeButton"},{default:$.withCtx(()=>ae[6]||(ae[6]=[$.createTextVNode($.toDisplayString("确认"))])),_:1,__:[6]})])):$.createCommentVNode("",!0)]),_:1},8,["title","visible","width"]),$.createVNode(kn.ssDialog,{title:w.value,visible:U.value,width:L.value,onBeforeDestroy:ae[4]||(ae[4]=k=>U.value=!1)},{default:$.withCtx(()=>[$.createVNode(s3)]),footer:$.withCtx(()=>[$.createElementVNode("div",m3,[$.createVNode(T,{onClick:ae[3]||(ae[3]=k=>U.value=!1),class:"cancel-button",id:"themeBorderButton"},{default:$.withCtx(()=>ae[7]||(ae[7]=[$.createTextVNode($.toDisplayString("取消"))])),_:1,__:[7]}),$.createVNode(T,{class:"ok-button",onClick:it,id:"themeButton"},{default:$.withCtx(()=>ae[8]||(ae[8]=[$.createTextVNode($.toDisplayString("确认"))])),_:1,__:[8]})])]),_:1},8,["title","visible","width"]),a.value?($.openBlock(),$.createBlock(kn.ssFilePreview,{key:0,fileDataList:o.value,onDestroy:Je},null,8,["fileDataList"])):$.createCommentVNode("",!0)])}}},_3=gl._export_sfc(g3,[["__scopeId","data-v-8c6018ff"]]);exports.ACESFilmicToneMapping=Wh;exports.AmbientLight=Mu;exports.Box3=qn;exports.CatmullRomCurve3=mu;exports.Color=et;exports.Controls=Rp;exports.DirectionalLight=yu;exports.DoubleSide=un;exports.Euler=_n;exports.GridHelper=Cp;exports.HemisphereLight=vp;exports.MOUSE=Zu;exports.MathUtils=Xi;exports.Matrix4=st;exports.Mesh=Ct;exports.MeshPhongMaterial=Sn;exports.PCFSoftShadowMap=Gh;exports.PerspectiveCamera=an;exports.Plane=Ai;exports.PlaneGeometry=lr;exports.PointLight=xu;exports.Quaternion=Pn;exports.Ray=Us;exports.SRGBColorSpace=Tt;exports.Scene=Cl;exports.ShadowMaterial=tp;exports.Spherical=bu;exports.TOUCH=Qu;exports.TubeGeometry=Il;exports.Vector2=Be;exports.Vector3=F;exports.WebGLRenderer=dg;exports.Xe=zg;exports.ssTable=_3;exports.useFormToTableComp=Iu;exports.useModelLoader=Qg;exports.useTableComp=Vu;exports.useUnit=Fu;
|
|
4206
|
+
`,v),null}const Ui=zt.getAttribute("version");console.debug("THREE.ColladaLoader: File version",Ui);const Ft=h(n(zt,"asset")[0]),fn=new Ol(this.manager);fn.setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin);let ln;Uh&&(ln=new Uh(this.manager),ln.setPath(this.resourcePath||t));const Wt=new et,Jt=[];let ts={},ii=0;const ut={animations:{},clips:{},controllers:{},images:{},effects:{},materials:{},cameras:{},lights:{},geometries:{},nodes:{},visualScenes:{},kinematicsModels:{},physicsModels:{},kinematicsScenes:{}};f(zt,"library_animations","animation",g),f(zt,"library_animation_clips","animation_clip",B),f(zt,"library_controllers","controller",ue),f(zt,"library_images","image",re),f(zt,"library_effects","effect",fe),f(zt,"library_materials","material",k),f(zt,"library_cameras","camera",we),f(zt,"library_lights","light",qe),f(zt,"library_geometries","geometry",De),f(zt,"library_nodes","node",ee),f(zt,"library_visual_scenes","visual_scene",Rt),f(zt,"library_kinematics_models","kinematics_model",vn),f(zt,"library_physics_models","physics_model",Ye),f(zt,"scene","instance_kinematics_scene",xn),m(ut.animations,E),m(ut.clips,oe),m(ut.controllers,Ne),m(ut.images,le),m(ut.effects,T),m(ut.materials,Q),m(ut.cameras,de),m(ut.lights,rt),m(ut.geometries,lt),m(ut.visualScenes,Ot),$t(),Qi();const ur=tt(n(zt,"scene")[0]);return ur.animations=Jt,Ft.upAxis==="Z_UP"&&(console.warn("THREE.ColladaLoader: You are loading an asset with a Z-UP coordinate system. The loader just rotates the asset to transform it into Y-UP. The vertex data are not converted, see #24289."),ur.rotation.set(-Math.PI/2,0,0)),ur.scale.multiplyScalar(Ft.unit),{get animations(){return console.warn("THREE.ColladaLoader: Please access animations over scene.animations now."),Jt},kinematics:ts,library:ut,scene:ur}}}const Ih=new F,jg=new _n,$r=new st,wi=new st,Jr=new Pn,Kr=new F(1,1,1),Zr=new F;class wa extends It{constructor(...e){super(...e),this.urdfNode=null,this.urdfName=""}copy(e,t){return super.copy(e,t),this.urdfNode=e.urdfNode,this.urdfName=e.urdfName,this}}class Yg extends wa{constructor(...e){super(...e),this.isURDFCollider=!0,this.type="URDFCollider"}}class $g extends wa{constructor(...e){super(...e),this.isURDFVisual=!0,this.type="URDFVisual"}}class Nu extends wa{constructor(...e){super(...e),this.isURDFLink=!0,this.type="URDFLink"}}class Uu extends wa{get jointType(){return this._jointType}set jointType(e){if(this.jointType!==e)switch(this._jointType=e,this.matrixWorldNeedsUpdate=!0,e){case"fixed":this.jointValue=[];break;case"continuous":case"revolute":case"prismatic":this.jointValue=new Array(1).fill(0);break;case"planar":this.jointValue=new Array(3).fill(0),this.axis=new F(0,0,1);break;case"floating":this.jointValue=new Array(6).fill(0);break}}get angle(){return this.jointValue[0]}constructor(...e){super(...e),this.isURDFJoint=!0,this.type="URDFJoint",this.jointValue=null,this.jointType="fixed",this.axis=new F(1,0,0),this.limit={lower:0,upper:0},this.ignoreLimits=!1,this.origPosition=null,this.origQuaternion=null,this.mimicJoints=[]}copy(e,t){return super.copy(e,t),this.jointType=e.jointType,this.axis=e.axis.clone(),this.limit.lower=e.limit.lower,this.limit.upper=e.limit.upper,this.ignoreLimits=!1,this.jointValue=[...e.jointValue],this.origPosition=e.origPosition?e.origPosition.clone():null,this.origQuaternion=e.origQuaternion?e.origQuaternion.clone():null,this.mimicJoints=[...e.mimicJoints],this}setJointValue(...e){e=e.map(n=>n===null?null:parseFloat(n)),(!this.origPosition||!this.origQuaternion)&&(this.origPosition=this.position.clone(),this.origQuaternion=this.quaternion.clone());let t=!1;switch(this.mimicJoints.forEach(n=>{t=n.updateFromMimickedJoint(...e)||t}),this.jointType){case"fixed":return t;case"continuous":case"revolute":{let n=e[0];return n==null||n===this.jointValue[0]?t:(!this.ignoreLimits&&this.jointType==="revolute"&&(n=Math.min(this.limit.upper,n),n=Math.max(this.limit.lower,n)),this.quaternion.setFromAxisAngle(this.axis,n).premultiply(this.origQuaternion),this.jointValue[0]!==n?(this.jointValue[0]=n,this.matrixWorldNeedsUpdate=!0,!0):t)}case"prismatic":{let n=e[0];return n==null||n===this.jointValue[0]?t:(this.ignoreLimits||(n=Math.min(this.limit.upper,n),n=Math.max(this.limit.lower,n)),this.position.copy(this.origPosition),Ih.copy(this.axis).applyEuler(this.rotation),this.position.addScaledVector(Ih,n),this.jointValue[0]!==n?(this.jointValue[0]=n,this.matrixWorldNeedsUpdate=!0,!0):t)}case"floating":return this.jointValue.every((n,i)=>e[i]===n||e[i]===null)?t:(this.jointValue[0]=e[0]!==null?e[0]:this.jointValue[0],this.jointValue[1]=e[1]!==null?e[1]:this.jointValue[1],this.jointValue[2]=e[2]!==null?e[2]:this.jointValue[2],this.jointValue[3]=e[3]!==null?e[3]:this.jointValue[3],this.jointValue[4]=e[4]!==null?e[4]:this.jointValue[4],this.jointValue[5]=e[5]!==null?e[5]:this.jointValue[5],wi.compose(this.origPosition,this.origQuaternion,Kr),Jr.setFromEuler(jg.set(this.jointValue[3],this.jointValue[4],this.jointValue[5],"XYZ")),Zr.set(this.jointValue[0],this.jointValue[1],this.jointValue[2]),$r.compose(Zr,Jr,Kr),wi.premultiply($r),this.position.setFromMatrixPosition(wi),this.rotation.setFromRotationMatrix(wi),this.matrixWorldNeedsUpdate=!0,!0);case"planar":return this.jointValue.every((n,i)=>e[i]===n||e[i]===null)?t:(this.jointValue[0]=e[0]!==null?e[0]:this.jointValue[0],this.jointValue[1]=e[1]!==null?e[1]:this.jointValue[1],this.jointValue[2]=e[2]!==null?e[2]:this.jointValue[2],wi.compose(this.origPosition,this.origQuaternion,Kr),Jr.setFromAxisAngle(this.axis,this.jointValue[2]),Zr.set(this.jointValue[0],this.jointValue[1],0),$r.compose(Zr,Jr,Kr),wi.premultiply($r),this.position.setFromMatrixPosition(wi),this.rotation.setFromRotationMatrix(wi),this.matrixWorldNeedsUpdate=!0,!0)}return t}}class Fh extends Uu{constructor(...e){super(...e),this.type="URDFMimicJoint",this.mimicJoint=null,this.offset=0,this.multiplier=1}updateFromMimickedJoint(...e){const t=e.map(n=>n*this.multiplier+this.offset);return super.setJointValue(...t)}copy(e,t){return super.copy(e,t),this.mimicJoint=e.mimicJoint,this.offset=e.offset,this.multiplier=e.multiplier,this}}class Jg extends Nu{constructor(...e){super(...e),this.isURDFRobot=!0,this.urdfNode=null,this.urdfRobotNode=null,this.robotName=null,this.links=null,this.joints=null,this.colliders=null,this.visual=null,this.frames=null}copy(e,t){super.copy(e,t),this.urdfRobotNode=e.urdfRobotNode,this.robotName=e.robotName,this.links={},this.joints={},this.colliders={},this.visual={},this.traverse(n=>{n.isURDFJoint&&n.urdfName in e.joints&&(this.joints[n.urdfName]=n),n.isURDFLink&&n.urdfName in e.links&&(this.links[n.urdfName]=n),n.isURDFCollider&&n.urdfName in e.colliders&&(this.colliders[n.urdfName]=n),n.isURDFVisual&&n.urdfName in e.visual&&(this.visual[n.urdfName]=n)});for(const n in this.joints)this.joints[n].mimicJoints=this.joints[n].mimicJoints.map(i=>this.joints[i.name]);return this.frames={...this.colliders,...this.visual,...this.links,...this.joints},this}getFrame(e){return this.frames[e]}setJointValue(e,...t){const n=this.joints[e];return n?n.setJointValue(...t):!1}setJointValues(e){let t=!1;for(const n in e){const i=e[n];Array.isArray(i)?t=this.setJointValue(n,...i)||t:t=this.setJointValue(n,i)||t}return t}}const xo=new Pn,Oh=new _n;function bs(s){return s?s.trim().split(/\s+/g).map(e=>parseFloat(e)):[0,0,0]}function zh(s,e,t=!1){t||s.rotation.set(0,0,0),Oh.set(e[0],e[1],e[2],"ZYX"),xo.setFromEuler(Oh),xo.multiply(s.quaternion),s.quaternion.copy(xo)}class Kg{constructor(e){this.manager=e||Fl,this.loadMeshCb=this.defaultMeshLoader.bind(this),this.parseVisual=!0,this.parseCollision=!1,this.packages="",this.workingPath="",this.fetchOptions={}}loadAsync(e){return new Promise((t,n)=>{this.load(e,t,null,n)})}load(e,t,n,i){const r=this.manager,a=Bl.extractUrlBase(e),o=this.manager.resolveURL(e);r.itemStart(o),fetch(o,this.fetchOptions).then(l=>{if(l.ok)return n&&n(null),l.text();throw new Error(`URDFLoader: Failed to load url '${o}' with error code ${l.status} : ${l.statusText}.`)}).then(l=>{const c=this.parse(l,this.workingPath||a);t(c),r.itemEnd(o)}).catch(l=>{i?i(l):console.error("URDFLoader: Error loading file.",l),r.itemError(o),r.itemEnd(o)})}parse(e,t=this.workingPath){const n=this.packages,i=this.loadMeshCb,r=this.parseVisual,a=this.parseCollision,o=this.manager,l={},c={},h={};function d(w){if(!/^package:\/\//.test(w))return t?t+w:w;const[E,S]=w.replace(/^package:\/\//,"").split(/\/(.+)/);if(typeof n=="string")return n.endsWith(E)?n+"/"+S:n+"/"+E+"/"+S;if(n instanceof Function)return n(E)+"/"+S;if(typeof n=="object")return E in n?n[E]+"/"+S:(console.error(`URDFLoader : ${E} not found in provided package list.`),null)}function u(w){let E;w instanceof Document?E=[...w.children]:w instanceof Element?E=[w]:E=[...new DOMParser().parseFromString(w,"text/xml").children];const S=E.filter(U=>U.nodeName==="robot").pop();return f(S)}function f(w){const E=[...w.children],S=E.filter(I=>I.nodeName.toLowerCase()==="link"),U=E.filter(I=>I.nodeName.toLowerCase()==="joint"),L=E.filter(I=>I.nodeName.toLowerCase()==="material"),D=new Jg;D.robotName=w.getAttribute("name"),D.urdfRobotNode=w,L.forEach(I=>{const V=I.getAttribute("name");h[V]=g(I)});const N={},b={};S.forEach(I=>{const V=I.getAttribute("name"),H=w.querySelector(`child[link="${V}"]`)===null;l[V]=_(I,N,b,H?D:null)}),U.forEach(I=>{const V=I.getAttribute("name");c[V]=m(I)}),D.joints=c,D.links=l,D.colliders=b,D.visual=N;const M=Object.values(c);return M.forEach(I=>{I instanceof Fh&&c[I.mimicJoint].mimicJoints.push(I)}),M.forEach(I=>{const V=new Set,H=J=>{if(V.has(J))throw new Error("URDFLoader: Detected an infinite loop of mimic joints.");V.add(J),J.mimicJoints.forEach(ie=>{H(ie)})};H(I)}),D.frames={...b,...N,...l,...c},D}function m(w){const E=[...w.children],S=w.getAttribute("type");let U;const L=E.find(V=>V.nodeName.toLowerCase()==="mimic");L?(U=new Fh,U.mimicJoint=L.getAttribute("joint"),U.multiplier=parseFloat(L.getAttribute("multiplier")||1),U.offset=parseFloat(L.getAttribute("offset")||0)):U=new Uu,U.urdfNode=w,U.name=w.getAttribute("name"),U.urdfName=U.name,U.jointType=S;let D=null,N=null,b=[0,0,0],M=[0,0,0];E.forEach(V=>{const H=V.nodeName.toLowerCase();H==="origin"?(b=bs(V.getAttribute("xyz")),M=bs(V.getAttribute("rpy"))):H==="child"?N=l[V.getAttribute("link")]:H==="parent"?D=l[V.getAttribute("link")]:H==="limit"&&(U.limit.lower=parseFloat(V.getAttribute("lower")||U.limit.lower),U.limit.upper=parseFloat(V.getAttribute("upper")||U.limit.upper))}),D.add(U),U.add(N),zh(U,M),U.position.set(b[0],b[1],b[2]);const I=E.filter(V=>V.nodeName.toLowerCase()==="axis")[0];if(I){const V=I.getAttribute("xyz").split(/\s+/g).map(H=>parseFloat(H));U.axis=new F(V[0],V[1],V[2]),U.axis.normalize()}return U}function _(w,E,S,U=null){U===null&&(U=new Nu);const L=[...w.children];return U.name=w.getAttribute("name"),U.urdfName=U.name,U.urdfNode=w,r&&L.filter(N=>N.nodeName.toLowerCase()==="visual").forEach(N=>{const b=p(N,h);if(U.add(b),N.hasAttribute("name")){const M=N.getAttribute("name");b.name=M,b.urdfName=M,E[M]=b}}),a&&L.filter(N=>N.nodeName.toLowerCase()==="collision").forEach(N=>{const b=p(N);if(U.add(b),N.hasAttribute("name")){const M=N.getAttribute("name");b.name=M,b.urdfName=M,S[M]=b}}),U}function g(w){const E=[...w.children],S=new Sn;return S.name=w.getAttribute("name")||"",E.forEach(U=>{const L=U.nodeName.toLowerCase();if(L==="color"){const D=U.getAttribute("rgba").split(/\s/g).map(N=>parseFloat(N));S.color.setRGB(D[0],D[1],D[2]),S.opacity=D[3],S.transparent=D[3]<1,S.depthWrite=!S.transparent}else if(L==="texture"){const D=U.getAttribute("filename");if(D){const N=new Ol(o),b=d(D);S.map=N.load(b),S.map.colorSpace=Tt}}}),S}function p(w,E={}){const S=w.nodeName.toLowerCase()==="collision",U=[...w.children];let L=null;const D=U.filter(b=>b.nodeName.toLowerCase()==="material")[0];if(D){const b=D.getAttribute("name");b&&b in E?L=E[b]:L=g(D)}else L=new Sn;const N=S?new Yg:new $g;return N.urdfNode=w,U.forEach(b=>{const M=b.nodeName.toLowerCase();if(M==="geometry"){const I=b.children[0].nodeName.toLowerCase();if(I==="mesh"){const V=b.children[0].getAttribute("filename"),H=d(V);if(H!==null){const J=b.children[0].getAttribute("scale");if(J){const ie=bs(J);N.scale.set(ie[0],ie[1],ie[2])}i(H,o,(ie,B)=>{B?console.error("URDFLoader: Error loading mesh.",B):ie&&(ie instanceof Ct&&(ie.material=L),ie.position.set(0,0,0),ie.quaternion.identity(),N.add(ie))})}}else if(I==="box"){const V=new Ct;V.geometry=new Zi(1,1,1),V.material=L;const H=bs(b.children[0].getAttribute("size"));V.scale.set(H[0],H[1],H[2]),N.add(V)}else if(I==="sphere"){const V=new Ct;V.geometry=new Ma(1,30,30),V.material=L;const H=parseFloat(b.children[0].getAttribute("radius"))||0;V.scale.set(H,H,H),N.add(V)}else if(I==="cylinder"){const V=new Ct;V.geometry=new Nl(1,1,1,30),V.material=L;const H=parseFloat(b.children[0].getAttribute("radius"))||0,J=parseFloat(b.children[0].getAttribute("length"))||0;V.scale.set(H,J,H),V.rotation.set(Math.PI/2,0,0),N.add(V)}}else if(M==="origin"){const I=bs(b.getAttribute("xyz")),V=bs(b.getAttribute("rpy"));N.position.set(I[0],I[1],I[2]),N.rotation.set(0,0,0),zh(N,V)}}),N}return u(e)}defaultMeshLoader(e,t,n){/\.stl$/i.test(e)?new la(t).load(e,r=>{const a=new Ct(r,new Sn);n(a)}):/\.dae$/i.test(e)?new qg(t).load(e,r=>n(r.scene)):console.warn(`URDFLoader: Could not load model at ${e}.
|
|
4207
|
+
No loader available`)}}const Zg=Vh.useModelComp(ft.pinia),{systemPath:Bh}=ft.storeToRefs(Zg),Qr=Y.ref(),kh=new Map;function Qg(s,e,t,n,i){const r=async u=>{try{const f=await kn.downloadAvatarApi({url:u});if(f.status!==200)throw new Error(`下载失败: ${f.status}`);return f.data}catch(f){throw console.error("addModelFromUrl失败:",f),f}},a=u=>new Promise((f,m)=>{const _=new FileReader;_.onload=g=>{try{const p=g.target.result,E=new vo().parse(p);E.preload(),f(E)}catch(p){m(p)}},_.onerror=()=>{m(new Error("MTL文件读取失败"))},_.readAsText(u)}),o=async u=>{const f={materials:{},create:function(m){return this.materials[m]?this.materials[m]:(console.warn(`Material '${m}' not found, using default material`),new Sn({color:8947848,side:un}))},getAsArray:function(){const m=[];for(const _ in this.materials)m.push(this.materials[_]);return m},preload:function(){for(const m in this.materials)this.materials[m].map&&(this.materials[m].map.needsUpdate=!0)}};for(const m of u){const _=await a(m);Object.assign(f.materials,_.materials)}return f.preload(),f},l=async(u,f=[])=>new Promise((m,_)=>{const g=new FileReader;g.onload=async p=>{try{const w=p.target.result;let E=null;f&&f.length>0&&(f.length===1?E=await a(f[0]):E=await o(f));const S=new _o;E&&S.setMaterials(E);const U=S.parse(w);E||U.traverse(L=>{L.isMesh&&(L.material=new Sn({color:8947848,side:un}))}),m(U)}catch(w){_(w)}},g.onerror=()=>{_(new Error("OBJ文件读取失败"))},g.readAsText(u)}),c=async u=>{var f;try{t.value=!0;const{scene:m}=s();if(!m)throw new Error("Scene not initialized");i();const _=[];for(let g=0;g<u.length;g++){const p=u[g];n.value=`正在加载模型 ${g+1}/${u.length}...`;const w=await r(p.objUrl),E=((f=p.objUrl)==null?void 0:f.split("/").pop())||`model_${g}.obj`,S=new File([w],E,{type:w.type});let U=[];if(p.mtlUrls){const D=Array.isArray(p.mtlUrls)?p.mtlUrls:[p.mtlUrls];for(let N=0;N<D.length;N++){const b=D[N],M=await r(b),I=(b==null?void 0:b.split("/").pop())||`material_${g}_${N}.mtl`,V=new File([M],I,{type:M.type});U.push(V)}}const L=await l(S,U);m.add(L),e.value.push(L),_.push(L)}return t.value=!1,_}catch(m){throw console.error("加载模型失败:",m),t.value=!1,m}},h=async(u,f,m=[],_=[])=>{let g;const p=u.toLowerCase();switch(p){case".txt":case".cpt":case".obj":const w=await f.text();if(p===".txt"||p===".cpt"){const fe=/^(?!.*\bf\b)[^\n]*?(-?\d*\.?\d+)[^\n]*?(-?\d*\.?\d+)[^\n]*?(-?\d*\.?\d+)[^\n]*?$/gm,Je=[...w.matchAll(fe)].map(z=>({x:parseFloat(z[1]),y:parseFloat(z[2]),z:parseFloat(z[3])})),at=new Bt,it=Je.flatMap(z=>[z.x,z.y,z.z]);if(at.setAttribute("position",new mt(it,3)),p===".txt"){const z=new ji({color:"#5B5C99",size:1,sizeAttenuation:!1});g=new Zs(at,z)}else if(p===".cpt"){const z=new Li({color:"#5B5C99",linewidth:100});g=new Dl(at,z)}}else if(p===".obj"){const fe=new _o;if(m&&m.length>0){const be=new vo;for(const Je of m){const at=await Je.text(),it=be.parse(at);it.preload(),fe.setMaterials(it);break}}g=fe.parse(w),(!m||m.length===0)&&g.traverse(be=>{be.isMesh&&(be.material=new Sn({color:"#B3B3D4"})),be instanceof Ct&&(be.material.side=un)})}break;case".stl":const E=await f.arrayBuffer(),U=new la().parse(E),L=new Sn({color:"#B3B3D4",side:un});g=new Ct(U,L);break;case".nc":const D=["Mach_B_Axis_0.STL","Mach_C_Axis_0.STL","Mach_X_Axis_0.STL","Mach_Y_Axis_0.STL","Mach_Z_Axis_0.STL","Mach_Spindle_0.STL"],N={"Mach_Y_Axis_0.STL":"rgb(128,118,152)","Mach_B_Axis_0.STL":"rgb(204,143,89)","Mach_C_Axis_0.STL":"rgb(145,245,251)","Mach_X_Axis_0.STL":"rgb(125,158,192)","Mach_Z_Axis_0.STL":"rgb(248,228,118)","Mach_Spindle_0.STL":"rgb(145,145,145)"},b=new ei,M=D.map(fe=>new Promise((be,Je)=>{new la().load(Bh.value===""?`/model/${fe}`:`${Bh.value}\\${fe}`,it=>{const z=new Sn({color:N[fe]||"#B3B3D4",side:un}),yt=new Ct(it,z);be(yt)},void 0,Je)}));try{(await Promise.all(M)).forEach(be=>b.add(be)),g=b}catch(fe){throw console.error("加载NC文件对应的STL文件失败:",fe),new Error("无法加载.NC文件对应的STL文件")}break;case".pcd":const I=new Xg,V=new ei;try{const fe=await ft.axios.get("http://139.196.154.85:20026/chfs/shared/重大专项/重大专项文件/target.pcd",{responseType:"blob",headers:{"Content-Type":"application/json"}}),be=new Blob([fe.data],{type:"application/octet-stream;charset=UTF-8"}),Je=await ft.axios.get("http://139.196.154.85:20026/chfs/shared/重大专项/重大专项文件/final.pcd",{responseType:"blob",headers:{"Content-Type":"application/json"}}),at=new Blob([Je.data],{type:"application/octet-stream;charset=UTF-8"}),it=await new Promise((yt,dt)=>{const ot=URL.createObjectURL(be);I.load(ot,W=>{const ae=new Float32Array(W.geometry.attributes.position.count*3);for(let ne=0;ne<W.geometry.attributes.position.count;ne++)ae[ne*3]=1,ae[ne*3+1]=0,ae[ne*3+2]=0;W.geometry.setAttribute("color",new Ht(ae,3)),W.material.vertexColors=!0,W.scale.set(.3,.3,.3),URL.revokeObjectURL(ot),yt(W)},void 0,dt)}),z=await new Promise((yt,dt)=>{const ot=URL.createObjectURL(at);I.load(ot,W=>{const ae=new Float32Array(W.geometry.attributes.position.count*3);for(let ne=0;ne<W.geometry.attributes.position.count;ne++)ae[ne*3]=0,ae[ne*3+1]=1,ae[ne*3+2]=0;W.geometry.setAttribute("color",new Ht(ae,3)),W.material.vertexColors=!0,W.scale.set(.3,.3,.3),URL.revokeObjectURL(ot),yt(W)},void 0,dt)});V.add(it),V.add(z),g=V}catch(fe){throw console.error("PCD文件加载失败:",fe),new Error("无法加载PCD文件")}break;case".urdf":const H=URL.createObjectURL(f),J=new Kg,ie="http://139.196.154.85:20026/chfs/shared/机器人/urdf/SmallBender_R-2000iC-165F/meshes",B={maxConcurrentLoads:4,enableCache:!0,enableLOD:!0,simplifyGeometry:!0,shareMaterials:!0,enableInstancing:!0},oe=new Map,j=new Map,ue=new Map,pe=async fe=>{if(oe.has(fe))return console.log(`从缓存加载: ${fe}`),oe.get(fe);try{const be=await ft.axios.get(`${ie}/${fe}`,{responseType:"blob",headers:{"Content-Type":"application/json"},timeout:6e5}),Je=new Blob([be.data],{type:"application/octet-stream;charset=UTF-8"});return B.enableCache&&oe.set(fe,Je),Je}catch(be){throw console.error(`加载文件失败: ${fe}`,be),new Error(`无法加载文件: ${fe}`)}},Me=(fe="default")=>{if(j.has(fe))return j.get(fe);const be=new Sn({color:12303291,shininess:30,transparent:!1,alphaTest:.1,side:Wn});return j.set(fe,be),be},Ue=fe=>{try{fe.isBufferGeometry&&fe.mergeVertices&&fe.mergeVertices(),fe.computeVertexNormals&&fe.computeVertexNormals(),fe.computeBoundingSphere&&fe.computeBoundingSphere(),fe.deleteAttribute&&fe.deleteAttribute("uv2")}catch(be){console.warn("几何体优化失败,使用原始几何体:",be)}return fe},Ne=async(fe,be,Je)=>{const at=`stl_${be}`;if(ue.has(at)){const dt=ue.get(at);return new Ct(dt,Me())}const it=await fe.arrayBuffer();let yt=new la(Je).parse(it);return yt=Ue(yt),ue.set(at,yt),new Ct(yt,Me())},$=async(fe,be,Je)=>{const at=`obj_${be}`;if(oe.has(at))return oe.get(at).clone();const it=await fe.text(),z=new _o(Je),yt=be.replace(".obj",".mtl");try{const W=await(await pe(yt)).text(),ne=new vo(Je).parse(W);ne.preload(),z.setMaterials(ne)}catch{console.warn(`MTL文件加载失败,使用默认材质: ${yt}`)}const dt=z.parse(it);return dt.traverse(ot=>{ot.isMesh&&(ot.geometry=Ue(ot.geometry),ot.castShadow=!0,ot.receiveShadow=!0,ot.renderOrder=1)}),oe.set(at,dt),dt},se=(fe,be)=>{const Je=new Df;if(Je.addLevel(fe,0),fe.geometry){const at=fe.geometry.clone(),it=new Ct(at,fe.material);Je.addLevel(it,50)}return Je};let re=0,le=0;const Ee=[];J.loadMeshCb=async(fe,be,Je,at,it)=>{const z=fe.split("/").pop(),yt=Je||(()=>{});re++;const dt=new Promise(async(ot,W)=>{try{const ae=await pe(z);if(!ae||ae.size===0)throw new Error(`文件为空: ${z}`);const ne=z.split(".").pop().toLowerCase();let ye;switch(ne){case"stl":ye=await Ne(ae,z,be);break;case"obj":ye=await $(ae,z,be);break;default:throw new Error(`不支持的文件格式: ${ne}`)}B.enableLOD&&ye.isMesh&&(ye=se(ye,z)),yt(ye),le++,at&&at({loaded:le,total:re,progress:le/re}),ot(ye)}catch(ae){console.error(`mesh文件加载失败: ${z}`,ae);const ne=new ei;yt(ne),ot(ne);const ye=new Zi(.1,.1,.1),Oe=new np({color:16711680,wireframe:!0});return new Ct(ye,Oe)}});Ee.push(dt)};try{if(!H){Qr.value=void 0;break}if(g=await J.loadAsync(H),console.log(`URDF文件加载完成,等待${re}个mesh文件加载...`),Ee.length>0)try{await Promise.allSettled(Ee),console.log(`所有mesh文件处理完成,成功加载: ${le}/${re}`)}catch(Je){console.warn("部分mesh文件加载失败,但继续显示模型",Je)}g.traverse(Je=>{Je.isMesh&&(Je.castShadow=!0,Je.receiveShadow=!0,Je.renderOrder=1,Je.material&&(Je.material.needsUpdate=!0))}),console.time("计算包围盒");const fe=new qn;fe.expandByObject(g);const be=`urdf_${Date.now()}`;g.userData.boundingBox=fe.clone(),g.userData.modelId=be,kh.set(be,{box:fe.clone(),center:fe.getCenter(new F),size:fe.getSize(new F),maxSize:Math.max(...fe.getSize(new F).toArray())}),Qr.value=g,console.log("URDF模型加载完成并优化")}catch(fe){console.error("URDF加载失败:",fe),Qr.value=void 0}finally{H&&URL.revokeObjectURL(H)}break;default:throw new Error(`不支持的文件格式: ${u}`)}return g};return{addModelsFromUrls:c,loadModelByDefaultPath:async u=>{console.log(u);try{t.value=!0,n.value="正在加载模型...";const{scene:f}=s();if(!f)throw new Error("Scene not initialized");i(),await new Promise(_=>setTimeout(_,100));const m=[];for(let _=0;_<u.length;_++){const g=u[_],p=await h(g.suffix,g.blob,g.mtlBlobs||[],g.meshFiles||[]);p&&(f.add(p),e.value.push(p),m.push(p))}return t.value=!1,n.value="",m}catch(f){throw console.error("加载模型失败:",f),t.value=!1,n.value="",f}},urdfModel:Qr,modelBoundingBoxes:kh}}window._iconfont_svg_string_4634042='<svg><symbol id="icon-lookAround" viewBox="0 0 1041 1024"><path d="M520.685026 798.355937c-10.788594 0-21.577187-2.790872-31.241101-8.372615l-291.583615-168.36871A62.482203 62.482203 0 0 1 166.619208 567.505024V230.850913c0-22.368629 11.913273-42.987756 31.241102-54.109588l291.583615-168.36871a62.482203 62.482203 0 0 1 62.482203 0l291.583615 168.36871c19.327828 11.121832 31.241102 31.740959 31.241101 54.109588v336.654111a62.482203 62.482203 0 0 1-31.241101 54.109588l-291.583615 168.36871a62.857096 62.857096 0 0 1-31.241102 8.372615zM291.583615 531.39031l229.101411 132.295652 229.101412-132.295652v-264.507993l-229.101412-132.295651L291.583615 266.923972v264.466338z m520.685026 36.114714h0.416548-0.416548z" fill="#aaaaaa" ></path><path d="M520.685026 461.660172c-10.788594 0-21.577187-2.790872-31.241101-8.372616l-291.583615-168.327055a62.482203 62.482203 0 0 1 62.482203-108.219176L520.685026 326.990196l260.342513-150.248871a62.482203 62.482203 0 1 1 62.482204 108.219176l-291.583615 168.327055a62.857096 62.857096 0 0 1-31.241102 8.372616z" fill="#aaaaaa" ></path><path d="M520.685026 798.355937a62.482203 62.482203 0 0 1-62.482203-62.482203V399.177969a62.482203 62.482203 0 1 1 124.964406 0v336.695765a62.482203 62.482203 0 0 1-62.482203 62.482203z" fill="#aaaaaa" ></path><path d="M520.685026 1003.172599c-53.276492 0-520.685026-5.248505-520.685026-187.446609 0-62.982061 54.776065-111.259976 162.870276-143.584103 33.073913-9.622259 67.855673 8.914128 77.769516 41.98804s-8.872473 67.897327-41.946386 77.769516c-30.324696 9.080747-49.194321 17.619981-60.649392 24.11813 46.32014 26.242525 178.657446 62.19062 382.641012 62.19062s336.320872-35.948094 382.641012-62.19062c-11.455071-6.498149-30.324696-15.037384-60.649392-24.11813a62.482203 62.482203 0 1 1 35.82313-119.757556c108.094211 32.324126 162.870276 80.643697 162.870276 143.584103 0 182.198104-467.408534 187.446609-520.685026 187.446609z m398.886385-175.366717h0.416548-0.416548z" fill="#72B02D" ></path></symbol><symbol id="icon-xuanzhuan" viewBox="0 0 1024 1024"><path d="M378.963454 724.443778l91.182641 163.473426c6.246088 11.212239 2.252687 25.39393-9.010749 31.691216l-163.473427 91.18264c-18.123894 10.085896-39.422029-6.758062-33.739113-26.673866l72.290786-254.707264c5.682916-19.967002 32.663967-23.090045 42.749862-4.966152z" fill="#FC794B" ></path><path d="M414.64807 903.9932c-1.228739 0-2.40628-0.051197-3.635018-0.204789C169.002752 879.367232 0.000003 771.443028 0.000003 641.452727c0-52.221389 27.032248-102.19009 78.127293-144.581571a35.827969 35.827969 0 0 1 50.480676 4.710165 35.827969 35.827969 0 0 1-4.710164 50.480676C100.090998 571.824209 71.727616 603.310634 71.727616 641.452727c0 88.929954 148.984551 171.050647 346.504275 191.068847 19.711014 1.9967 34.046298 19.557422 32.049597 39.268436a35.879166 35.879166 0 0 1-35.633418 32.20319zM608.430381 904.095595c-18.175091 0-33.79031-13.772111-35.633418-32.254387-1.945503-19.711014 12.389781-37.271736 32.100795-39.217239 198.134093-19.813409 347.528224-101.985301 347.528223-191.171242 0-23.550822-10.649068-47.050447-31.58882-69.935703-13.362532-14.59127-12.389781-37.271736 2.20149-50.634268 14.59127-13.362532 37.271736-12.389781 50.634268 2.20149 32.971151 35.9918 50.429479 76.898555 50.429478 118.368481 0 130.297485-169.463527 238.221689-412.088195 262.489276-1.177541 0.102395-2.40628 0.153592-3.583821 0.153592z" fill="#FC794B" ></path><path d="M846.703267 184.413179l-325.308534 184.464377L196.137396 184.413179 521.394733 0z" fill="#BEC5CB" ></path><path d="M521.394733 737.703915l325.308534-184.41318V184.413179l-325.308534 184.464377z" fill="#808487" ></path><path d="M521.394733 737.703915L196.137396 553.290735V184.413179l325.257337 184.464377z" fill="#9CA3A9" ></path></symbol><symbol id="icon-clipping" viewBox="0 0 1024 1024"><path d="M341.930667 201.770667l353.706666 204.245333v408.448l-353.706666-204.245333z" fill="#4A80FF" fill-opacity="0.15" ></path><path d="M320.853333 165.248l396.117334 228.608v457.173333l-395.946667-228.608z m353.749334 252.970667L362.837333 238.336v359.722667l311.466667 179.882666z" fill="#72B02D" ></path><path d="M544.384 746.453333l-211.669333-211.669333 18.688-18.688 211.669333 211.669333z" fill="#72B02D" ></path><path d="M693.717333 530.261333l-266.453333-266.325333 20.906667-20.906667 266.325333 266.453334z" fill="#72B02D" ></path><path d="M688.853333 621.098667l-366.933333-366.933334 24.448-24.704 366.933333 366.933334z" fill="#72B02D" ></path><path d="M689.664 713.856L321.578667 345.770667l24.618666-24.618667 368.085334 368.128z" fill="#72B02D" ></path><path d="M683.605333 799.317333l-355.712-355.712 24.234667-24.234666 355.712 355.712z" fill="#72B02D" ></path><path d="M537.770667 944.938667h-51.2v-418.602667l-362.666667-209.28 25.6-44.330667 362.666667 209.066667 362.666666-209.066667 25.6 44.330667-362.666666 209.066667z" fill="#AAAAAA" ></path><path d="M512.170667 53.461333a31.146667 31.146667 0 0 1 15.488 4.266667l370.090666 213.632a31.232 31.232 0 0 1 15.317334 26.794667v426.922666a31.274667 31.274667 0 0 1-15.317334 26.837334l-369.834666 213.333333a31.488 31.488 0 0 1-31.061334 0l-369.834666-213.333333a31.146667 31.146667 0 0 1-15.914667-26.837334V298.069333a31.146667 31.146667 0 0 1 15.573333-27.008l369.792-213.333333a30.976 30.976 0 0 1 15.701334-4.266667z m349.866666 256l-349.866666-201.642666-349.866667 201.856v403.84l349.866667 201.813333 349.866666-201.898667z" fill="#AAAAAA" ></path></symbol><symbol id="icon-viewReset" viewBox="0 0 1024 1024"><path d="M643.2 515.2c-89.6-67.2-179.2-60.8-268.8 0-32 22.4-67.2 57.6-105.6 89.6 38.4 32 70.4 70.4 108.8 96 28.8 19.2 60.8 32 96 38.4 118.4 19.2 188.8-57.6 268.8-137.6-35.2-28.8-60.8-64-99.2-86.4zM508.8 704c-51.2 0-96-41.6-96-99.2s41.6-105.6 96-105.6 96 41.6 96 99.2c0 64-38.4 105.6-96 105.6z" fill="#AAAAAA" ></path><path d="M515.2 544c-3.2 41.6 12.8 60.8 51.2 51.2 0 32-19.2 57.6-51.2 57.6s-57.6-22.4-51.2-57.6c-6.4-32 16-51.2 51.2-51.2" fill="#AAAAAA" ></path><path d="M652.8 3.2c9.6-3.2 19.2-3.2 28.8 0 9.6 3.2 12.8 12.8 12.8 22.4v108.8c70.4 28.8 131.2 70.4 179.2 128 80 89.6 118.4 214.4 108.8 336-9.6 124.8-70.4 236.8-166.4 313.6-96 80-224 118.4-345.6 108.8-124.8-9.6-243.2-67.2-323.2-160S32 649.6 41.6 524.8c9.6-118.4 70.4-233.6 160-307.2 22.4-19.2 60.8-19.2 80 3.2 19.2 22.4 19.2 57.6-3.2 80-70.4 57.6-115.2 140.8-124.8 233.6s22.4 185.6 80 249.6c60.8 70.4 147.2 115.2 243.2 124.8 96 9.6 188.8-19.2 259.2-80s118.4-140.8 124.8-236.8c9.6-89.6-22.4-185.6-80-249.6-28.8-28.8-57.6-57.6-89.6-76.8v89.6c0 9.6-3.2 19.2-12.8 22.4-9.6 3.2-19.2 3.2-28.8 0l-227.2-160c-3.2-3.2-9.6-12.8-9.6-19.2 0-9.6 3.2-12.8 9.6-19.2L652.8 3.2z" fill="#72B02D" ></path></symbol><symbol id="icon-donghuafangzhen" viewBox="0 0 1024 1024"><path d="M868.864 228.864c-19.968 0-38.912 7.68-53.248 20.992l-291.328-170.496c-7.168-5.12-16.896-5.12-24.064 0L208.896 248.832c-14.336-12.8-33.28-20.48-53.76-20.48-43.52 0-79.872 36.864-79.872 80.896 0 33.792 21.504 63.488 53.248 74.24v318.976c0 9.216 4.608 17.408 12.288 22.016L437.248 896c11.776 30.72 41.472 51.712 74.752 52.224 33.28-0.512 62.464-20.992 74.752-52.224l296.448-171.52c7.68-4.608 12.288-13.312 12.288-22.016V386.048c31.744-11.776 53.248-42.496 53.248-76.288 0-44.032-36.352-80.896-79.872-80.896zM155.136 339.456c-16.896 0-29.184-12.288-29.184-29.696v-2.048c0.512-15.36 13.312-27.648 29.184-27.136h2.048c15.36 0.512 27.648 13.824 27.136 29.696 0 15.872-12.8 28.672-29.184 29.184zM512 897.024c-16.896 0-29.184-12.288-29.184-29.696 0-14.848 12.288-29.696 29.184-29.696h2.048c15.36 0.512 27.648 13.824 27.136 29.696 0 14.848-14.848 29.696-29.184 29.696z m74.752-58.368c-11.776-30.208-40.96-51.712-74.752-51.712-27.136 0-52.224 14.336-67.072 37.376l-3.072 1.024c-4.608 2.048-8.704 5.632-9.728 10.752l-252.416-146.944V384.512C212.48 373.76 234.496 343.04 235.52 308.736l3.072 0.512h2.048c3.584 0 7.168-1.536 10.24-3.584 7.168-5.632 8.192-16.384 2.048-23.552L512 130.56l278.528 162.816c-7.68 36.864 11.264 74.24 45.568 90.624 0.512 5.632 3.584 10.24 8.704 13.312v291.328l-258.048 150.016z m282.112-499.2c-16.896 0-29.184-12.288-29.184-29.696v-2.048c0.512-15.36 13.312-27.648 29.184-27.136h2.048c15.36 0.512 27.648 13.824 27.136 29.696v2.56c-1.024 14.848-13.824 27.136-29.184 26.624z" fill="#AAAAAA" ></path><path d="M422.912 724.992c-3.072-8.704-12.288-12.8-20.992-9.728-8.704 3.072-12.8 12.8-9.728 21.504l19.968 54.784c2.56 6.656 8.192 10.752 15.36 10.752 2.048 0 3.584-0.512 5.12-1.024 8.704-3.072 12.8-12.8 9.728-21.504l-19.456-54.784zM706.048 507.392c0-107.52-86.016-195.072-192-196.096-2.048-1.536-4.608-2.56-7.68-3.072l-24.064-3.072c-8.192-1.024-15.872 4.096-17.92 11.776-5.632 1.536-11.776 3.584-16.896 5.632 0.512-1.536 1.024-3.072 1.536-5.12 1.024-9.216-5.12-17.408-14.336-18.432l-48.128-5.632c-5.632-1.024-11.776 1.536-15.36 6.144-3.584 4.608-4.608 11.264-2.048 16.896 2.56 5.632 7.68 9.216 13.312 9.728l44.032 5.12C384 353.28 351.232 388.608 333.312 432.64c-25.088 60.928-17.92 130.048 18.432 184.832-1.024 3.584-1.024 7.168 0.512 10.24l19.968 54.784c1.024 3.072 3.072 5.632 6.144 7.68 7.168 5.12 17.408 3.072 22.528-4.096 3.072-4.608 3.584-10.24 2.048-15.36l-0.512-1.536c53.76 37.888 123.392 45.568 184.32 19.968 46.08-19.456 82.944-55.808 102.912-101.376l12.8-14.336c6.144-6.656 5.632-17.408-0.512-23.04 2.56-14.336 4.096-28.672 4.096-43.008z m-193.536 156.16C427.52 663.552 358.4 593.92 358.4 507.392c0-86.016 69.12-156.16 154.112-156.16s154.112 69.632 154.112 156.16c0 86.016-69.12 156.16-154.112 156.16z" fill="#72B02D" ></path><path d="M765.44 478.72c-6.144-5.632-15.872-5.632-22.016 0l-32.256 35.84c-4.096 4.608-5.632 11.776-3.072 17.92 2.56 6.144 8.192 9.728 14.848 9.728 4.608 0 8.704-2.048 11.776-5.12l32.256-35.84c5.12-7.168 4.608-16.896-1.536-22.528zM823.296 401.92c-5.632-1.024-11.776 0.512-15.872 5.12l-32.256 35.84c-4.608 4.608-5.632 11.776-3.072 17.92 1.024 2.048 2.56 4.096 4.096 5.632 6.656 6.144 16.896 5.632 23.04-1.536l32.256-35.84c4.096-4.096 5.632-10.752 3.584-16.384-1.024-5.632-5.632-9.728-11.776-10.752zM336.384 321.024c8.704 0 15.872-6.656 16.384-15.36 0.512-8.704-5.632-16.384-14.336-17.408l-48.128-5.632c-5.632-1.024-11.776 1.536-15.36 6.144-3.584 4.608-4.096 11.264-2.048 16.896 2.56 5.632 7.68 9.216 13.312 9.728l48.128 5.632h2.048z" fill="#72B02D" ></path></symbol><symbol id="icon-guanjianjiexi" viewBox="0 0 1024 1024"><path d="M298.496 200.704v83.456h-39.936v177.664h137.728V389.12h47.104v245.76h-47.104v-79.872H211.456c-10.752-3.584-54.272-14.336-54.272-57.856V280.064h-32.768V200.704h174.08m47.104-47.104H77.824v177.152h36.352v169.984c0 68.608 61.44 97.792 97.792 104.96H353.28v79.872h141.312V342.016H349.184v72.192h-43.52v-87.04h39.936V153.6zM627.712 389.12v79.872H812.544c10.752 3.584 54.272 14.336 54.272 54.272V740.352h32.768v83.456h-173.568v-83.456h39.936v-177.664h-137.728V634.88h-47.104V389.12h46.592m47.104-47.104h-141.312v340.48h141.312v-72.192h43.52v83.456h-39.936V870.4h267.776v-177.152h-36.352v-169.984c0-68.608-61.44-97.792-97.792-104.96H670.72V342.528h4.096z" fill="#AAAAAA" ></path></symbol><symbol id="icon-gongyishengcheng" viewBox="0 0 1024 1024"><path d="M889.344 391.68h29.696v-43.008h-208.896l1.024 45.056 28.16 3.072v20.992c55.808 5.632 108.032 28.672 150.016 66.56-0.512 0 0-92.672 0-92.672z m-366.592 102.912c13.312-13.312 27.648-24.576 43.008-34.816-2.048-70.144-5.632-153.088-8.704-179.712-5.632-48.64-34.816-204.288-226.816-202.752-191.488 1.536-223.744 164.864-230.912 207.36s-11.776 197.632-11.776 197.632h-24.576v43.008l208.896 1.024v-40.96h-24.064V316.928S245.76 230.912 335.36 231.424C424.448 232.448 415.232 327.68 414.72 327.68v313.856c4.608 0 6.144 77.824 50.176 144.896-13.312-32.256-20.48-67.072-20.48-102.912 0-71.168 27.648-138.24 78.336-188.928z" fill="#AAAAAA" ></path><path d="M75.264 601.6h31.232v281.088s41.984 29.184 141.824 0v-274.944l29.184-2.56v-44.032H75.264v40.448zM906.24 263.168h-29.184l1.024-188.416s-53.76-27.648-144.384 0l1.024 192-31.744 1.024V307.2h203.776l-0.512-44.032z" fill="#AAAAAA" ></path><path d="M934.912 627.712c-9.216-4.608-20.48-2.048-29.184 6.656l-21.504 21.504c-9.216 9.216-20.992 13.824-33.792 13.824s-24.576-5.12-33.792-13.824c-9.216-9.216-13.824-20.992-13.824-33.792s5.12-24.576 13.824-33.792l21.504-21.504c8.704-8.704 11.264-19.968 6.656-29.184-5.632-10.752-18.432-15.36-34.304-13.312-25.6 4.096-48.64 15.36-66.56 33.792-27.136 27.136-39.424 65.536-33.792 103.936l-178.176 178.176c-13.312 13.312-20.992 31.232-20.992 50.176s7.168 36.864 20.992 50.176c13.312 13.312 31.232 20.992 50.176 20.992 18.944 0 36.864-7.168 50.176-20.992l178.176-178.176c37.888 6.144 76.288-6.656 103.936-33.792 17.92-17.92 29.696-41.472 33.792-66.56 2.048-15.872-2.56-28.672-13.312-34.304z m-9.728 30.72c-3.072 20.48-12.8 38.912-27.136 53.76-23.04 23.04-56.32 33.28-89.088 26.624l-6.144-1.536-186.88 186.88c-8.704 9.216-20.992 13.824-33.792 13.824s-24.576-5.12-33.792-13.824c-9.216-9.216-13.824-20.992-13.824-33.792s5.12-24.576 13.824-33.792l186.88-186.88-1.536-6.144c-6.656-32.256 3.072-65.536 26.624-89.088 14.848-14.848 33.28-24.064 53.76-27.136 1.536-0.512 3.072-0.512 4.608-0.512 2.56 0 4.608 0.512 5.12 1.024-0.512 0.512-1.024 1.536-2.048 2.56l-21.504 21.504c-13.312 13.312-20.992 31.232-20.992 50.176s7.168 36.864 20.992 50.176c13.312 13.312 31.232 20.992 50.176 20.992 18.944 0 36.864-7.168 50.176-20.992l21.504-21.504c1.024-1.024 2.048-1.536 2.56-2.048 0.512 1.536 1.024 4.608 0.512 9.728z" fill="#72B02D" ></path><path d="M560.64 870.912c-12.8 12.8-12.8 33.28 0 45.568 6.144 6.144 14.336 9.216 23.04 9.216s16.896-3.072 23.04-9.216c6.144-6.144 9.728-14.336 9.728-23.04 0-8.704-3.584-16.896-9.728-23.04-12.8-12.288-33.792-12.288-46.08 0.512z m28.672 28.672c-3.072 3.072-8.704 3.072-11.776 0-3.072-3.072-3.072-8.704 0-11.776 1.536-1.536 3.584-2.56 6.144-2.56 2.048 0 4.096 1.024 6.144 2.56 1.536 1.536 2.56 3.584 2.56 6.144-0.512 2.048-1.536 4.096-3.072 5.632z m225.28-107.008c-4.096-4.096-10.24-4.096-14.336 0l-43.52 43.52c-4.096 4.096-4.096 10.24 0 14.336l102.4 102.4c15.872 15.872 41.984 15.872 57.856 0 15.872-15.872 15.872-41.984 0-57.856l-102.4-102.4z m-237.056-150.528l70.656 70.656 28.672-28.672-70.656-70.656-15.872-30.208-50.688-36.352-28.672 28.672 36.352 50.688 30.208 15.872z" fill="#72B02D" ></path></symbol><symbol id="icon-mojupipei" viewBox="0 0 1024 1024"><path d="M880.64 117.248c32.768 0 58.88 23.04 64.512 54.784l1.024 7.68v663.04c0.512 31.744-22.528 58.368-53.76 62.464l-7.68 1.024H151.552c-34.816 0-66.048-22.528-72.192-53.248l-1.024-6.656V183.296c0-31.744 27.648-59.904 61.952-65.024l7.168-1.024h142.848c24.064 0 44.032 16.896 48.64 39.936l1.024 6.656V406.528c0 7.68 5.12 14.848 12.288 16.896l3.584 0.512H424.96c13.312 0 25.088 9.216 29.184 22.528 6.144 23.552 33.792 46.08 58.368 46.08 22.528 0 48.128-19.456 55.808-39.424l2.048-5.632c2.048-10.24 9.216-18.432 19.456-21.504l5.12-1.024 3.072-0.512h71.168c6.144 0 11.776-3.584 14.336-9.728l1.024-3.584V164.864c0-23.04 15.872-41.984 37.888-46.592l6.144-1.024H880.64zM273.92 184.32H151.552l-2.048 0.512-2.048 0.512-2.56 1.536-1.536 649.728 3.072 1.536 3.072 1.024h1.024l328.192 3.072 2.048-286.72-2.048-0.512-10.24-3.584c-24.576-10.24-45.568-27.136-60.928-49.152l-6.144-9.216 1.024-1.536H349.184c-37.888-4.096-68.608-33.792-74.24-71.68l-1.024-8.192v-4.096V184.32z m476.16-3.072V409.6l-0.512 8.704c-3.584 36.864-32.256 66.56-68.608 72.192l-8.192 1.024h-4.096l-45.568-1.536-6.144 9.728c-14.848 22.528-36.352 40.448-61.44 51.2l-10.752 4.096-3.072 284.16h337.408v-655.36l-129.024-2.56z" fill="#AAAAAA" ></path></symbol><symbol id="icon-buchangshezhi" viewBox="0 0 1024 1024"><path d="M792.576 75.264h-686.08c-17.408 0-31.232 13.824-31.232 31.232v686.08c0 17.408 13.824 31.232 31.232 31.232h436.736c17.408 0 31.232-13.824 31.232-31.232s-13.824-31.232-31.232-31.232H137.728V262.656h624.128v280.576c0 17.408 13.824 31.232 31.232 31.232s31.232-13.824 31.232-31.232V106.496c-0.512-17.408-14.336-31.232-31.744-31.232z" fill="#AAAAAA" ></path><path d="M792.576 948.736c-17.408 0-31.232-13.824-31.232-31.232v-93.696h-93.696c-17.408 0-31.232-13.824-31.232-31.232 0-17.408 13.824-31.232 31.232-31.232h93.696v-93.696c0-17.408 13.824-31.232 31.232-31.232 17.408 0 31.232 13.824 31.232 31.232v93.696h93.696c17.408 0 31.232 13.824 31.232 31.232 0 17.408-13.824 31.232-31.232 31.232h-93.696v93.696c0 17.408-13.824 31.232-31.232 31.232z" fill="#72B02D" ></path><path d="M372.224 518.144l-110.08 110.08c-20.992 20.992-20.992 55.296 0 76.288s55.296 20.992 76.288 0l110.08-110.08c-16.896-6.144-32.768-15.872-46.592-29.696-13.824-13.312-23.552-29.696-29.696-46.592z m-57.856 162.304c-7.68 7.68-20.48 7.68-28.672 0-7.68-7.68-7.68-20.48 0-28.672 7.68-7.68 20.48-7.68 28.672 0 7.68 8.192 7.68 20.992 0 28.672z m340.48-292.864L592.384 450.56c-20.992 20.992-55.296 20.992-76.288 0s-20.992-55.296 0-76.288l62.976-62.976c-51.712-8.704-116.224 14.848-151.552 50.176-49.152 49.152-49.152 128.512 0 177.664s129.024 49.152 177.664 0c35.328-35.328 58.368-99.84 49.664-151.552z" fill="#AAAAAA" ></path></symbol><symbol id="icon-shuchujiagongchengxu" viewBox="0 0 1024 1024"><path d="M876.544 473.6v374.272c0 16.384-13.312 29.696-29.696 29.696h-522.24c-16.384 0-29.696-13.312-29.696-29.696V503.296c0-16.384 13.312-29.696 29.696-29.696h551.936m40.96-70.656H253.952c-16.384 0-29.696 13.312-29.696 29.696v486.4c0 16.384 13.312 29.696 29.696 29.696h663.552c16.384 0 29.696-13.312 29.696-29.696v-486.4c0-16.384-13.312-29.696-29.696-29.696z" fill="#AAAAAA" ></path><path d="M489.984 211.968H814.08l-41.984-41.984c-13.824-13.824-13.824-36.352 0-50.176 13.824-13.824 36.352-13.824 50.176 0L947.712 245.76l-0.512 0.512 0.512 0.512-125.952 125.952c-13.824 13.824-36.352 13.824-50.176 0-13.824-13.824-13.824-36.352 0-50.176l38.912-38.912H489.472c-19.456 0-35.328-15.872-35.328-35.328 0.512-20.48 16.384-36.352 35.84-36.352z" fill="#72B02D" ></path><path d="M531.456 717.824c0-11.776-7.68-22.016-18.944-25.6l-55.808-16.896-14.848-4.608 14.848-4.608 55.808-16.896c11.264-3.584 18.944-13.824 18.944-25.6v-2.048c0-18.432-17.92-31.232-35.328-25.088L363.52 641.024c-10.752 3.584-17.92 13.824-17.92 25.088v8.192c0 11.264 7.168 21.504 17.92 25.088l132.608 45.568c17.408 6.144 35.328-7.168 35.328-25.088v-2.048z m123.392-96.768v2.048c0 11.776 7.68 22.016 18.944 25.6l56.32 16.896 14.848 4.608-14.848 4.608-56.32 16.896c-11.264 3.584-18.944 13.824-18.944 25.6v2.56c0 18.432 17.92 31.232 35.328 25.088l132.608-45.568c10.752-3.584 17.92-13.824 17.92-25.088v-8.192c0-11.264-7.168-21.504-17.92-25.088l-132.608-45.568c-17.408-6.144-35.328 7.168-35.328 25.6z m-54.784-64l-70.144 248.32c-4.608 16.896 8.192 33.792 25.6 33.792 11.776 0 22.528-8.192 25.6-19.456l70.144-248.32c4.608-16.896-8.192-33.792-25.6-33.792-11.776 0-22.016 8.192-25.6 19.456zM147.456 814.08V173.056c0-14.848 11.776-26.624 26.624-26.624h463.872c19.456 0 35.328-15.872 35.328-35.328 0-19.456-15.872-35.328-35.328-35.328H107.008c-16.896 0-30.72 13.824-30.72 30.72v748.032c0 16.896 13.824 30.72 30.72 30.72h40.448c19.456 0 35.328-15.872 35.328-35.328 0.512-19.968-15.36-35.84-35.328-35.84z" fill="#AAAAAA" ></path></symbol><symbol id="icon-guanjiekongzhi" viewBox="0 0 1024 1024"><path d="M648.192 377.344h-71.68c-18.432 0-33.792-14.848-33.792-33.792H366.592c12.288-30.72 25.088-80.896 0-134.656H542.72c0-18.432 15.36-33.792 33.792-33.792h67.584c1.536 0 2.56 0 4.096 0.512L719.36 87.04c10.752-13.312 29.184-16.384 44.032-7.68l168.96 100.864c15.872 9.728 20.992 30.208 11.776 46.08-9.728 15.872-30.208 20.992-46.592 11.264l-143.872-85.504L677.888 245.76v61.44l75.776 93.696 143.872-85.504c15.872-9.728 36.864-4.608 46.592 11.776 9.728 15.872 4.608 36.352-11.264 46.08h-0.512l-168.96 100.864c-14.336 8.704-33.28 5.12-44.032-7.68l-71.168-89.088zM319.488 780.8L102.912 415.744c76.8 69.632 185.344 48.64 231.424-13.312l222.72 378.368H711.68c18.432 0 33.792 14.848 33.792 33.792v100.864c0 18.432-15.36 33.792-33.792 33.792H170.496c-18.432 0-33.792-14.848-33.792-33.792v-100.864c0-18.432 15.36-33.792 33.792-33.792h148.992z" fill="#AAAAAA" ></path><path d="M204.288 148.48C133.12 148.48 75.264 205.824 75.264 276.48S133.12 404.48 204.288 404.48c71.168 0 129.024-57.344 129.024-128S275.456 148.48 204.288 148.48z m0 202.752c-41.472 0-74.752-33.28-74.752-74.752 0-40.96 33.792-74.24 74.752-74.24C245.76 202.24 279.04 235.52 279.04 276.48c0 41.472-33.792 75.264-74.752 74.752z" fill="#72B02D" ></path></symbol><symbol id="icon-jiegoushu" viewBox="0 0 1024 1024"><path d="M233.984 472.064h317.44c0-44.032 35.328-79.36 79.36-79.36h238.08c44.032 0 79.36 35.328 79.36 79.36v79.36c0 44.032-35.328 79.36-79.36 79.36h-238.08c-44.032 0-79.36-35.328-79.36-79.36h-317.44v238.08h317.44c0-44.032 35.328-79.36 79.36-79.36h238.08c44.032 0 79.36 35.328 79.36 79.36v79.36c0 44.032-35.328 79.36-79.36 79.36h-238.08c-44.032 0-79.36-35.328-79.36-79.36h-317.44c-44.032 0-79.36-35.328-79.36-79.36V233.984h-39.936c-22.016 0-39.936-17.92-39.936-39.936V115.2c0-22.016 17.92-39.936 39.936-39.936h158.72c22.016 0 39.936 17.92 39.936 39.936V194.56c0 22.016-17.92 39.936-39.936 39.936h-39.936v237.568z" fill="#AAAAAA" ></path><path d="M551.936 75.264h317.44c44.032 0 79.36 35.328 79.36 79.36v79.36c0 44.032-35.328 79.36-79.36 79.36h-317.44c-44.032 0-79.36-35.328-79.36-79.36V154.624c-0.512-44.032 35.328-79.36 79.36-79.36z" fill="#72B02D" ></path></symbol><symbol id="icon-kuaitui" viewBox="0 0 1024 1024"><path d="M512 148.992c199.68 0 361.984 162.304 361.984 361.984S711.68 872.448 512 872.448s-361.984-162.304-361.984-361.984S312.32 148.992 512 148.992m0-74.752c-241.152 0-436.736 195.584-436.736 436.736s195.584 436.736 436.736 436.736 436.736-195.584 436.736-436.736-195.584-436.736-436.736-436.736z" fill="#AAAAAA" ></path><path d="M670.72 456.192v109.056l-75.264-54.784L670.72 456.192m25.6-102.912c-10.24 0-20.992 3.072-30.208 10.24l-144.896 105.472c-28.672 20.48-28.672 62.976 0 83.968l144.896 105.472c9.216 6.656 19.968 10.24 30.208 10.24 27.136 0 52.224-21.504 52.224-51.712V405.504c0-30.72-25.088-52.224-52.224-52.224z" fill="#72B02D" ></path><path d="M499.712 456.192v109.056L424.96 510.976l74.752-54.784m26.112-102.912c-10.24 0-20.992 3.072-30.208 10.24L350.208 468.992c-28.672 20.48-28.672 62.976 0 83.968l144.896 105.472c9.216 6.656 19.968 10.24 30.208 10.24 27.136 0 52.224-21.504 52.224-51.712V405.504c0-30.72-25.088-52.224-51.712-52.224z" fill="#72B02D" ></path><path d="M314.368 381.44c-21.504 0-38.912 17.408-38.912 38.912v181.248c0 21.504 17.408 38.912 38.912 38.912s38.912-17.408 38.912-38.912V420.352c0-21.504-17.408-38.912-38.912-38.912z" fill="#72B02D" ></path></symbol><symbol id="icon-bofang" viewBox="0 0 1024 1024"><path d="M512 150.016c199.68 0 361.984 162.304 361.984 361.984S711.68 873.984 512 873.984 150.016 711.68 150.016 512 312.32 150.016 512 150.016m0-74.752c-241.152 0-436.736 195.584-436.736 436.736s195.584 436.736 436.736 436.736 436.736-195.584 436.736-436.736-195.584-436.736-436.736-436.736z" fill="#AAAAAA" ></path><path d="M491.008 445.952l115.712 66.048-115.712 66.048V445.952m-23.552-87.04c-24.576 0-46.592 19.456-46.592 46.592v212.48c0 27.136 22.528 46.592 46.592 46.592 7.68 0 15.36-2.048 23.04-6.144l185.856-106.496c31.232-17.92 31.232-62.976 0-80.896L490.496 365.056c-7.168-4.096-15.36-6.144-23.04-6.144z" fill="#72B02D" ></path></symbol><symbol id="icon-kuaijin" viewBox="0 0 1024 1024"><path d="M515.584 151.04c199.168 0 360.96 161.792 360.96 360.96s-161.792 360.96-360.96 360.96-360.96-161.792-360.96-360.96 161.792-360.96 360.96-360.96m0-74.752c-240.64 0-435.712 195.072-435.712 435.712s195.072 435.712 435.712 435.712 435.712-195.072 435.712-435.712-195.072-435.712-435.712-435.712z" fill="#AAAAAA" ></path><path d="M358.912 458.24L433.152 512l-74.24 53.76v-107.52m-25.088-101.376c-26.624 0-51.2 20.992-51.2 51.2v207.872c0 30.208 24.576 51.2 51.2 51.2 10.24 0 20.48-3.072 29.696-9.728l142.848-103.936c28.16-20.48 28.16-61.952 0-82.432L363.52 366.592c-9.216-6.656-19.456-9.728-29.696-9.728z" fill="#72B02D" ></path><path d="M527.36 458.24l74.24 53.76-74.24 53.76v-107.52m-25.088-101.376c-26.624 0-51.2 20.992-51.2 51.2v207.872c0 30.208 24.576 51.2 51.2 51.2 10.24 0 20.48-3.072 29.696-9.728l142.848-103.936c28.16-20.48 28.16-61.952 0-82.432l-142.848-103.936c-9.216-7.168-19.968-10.24-29.696-10.24z" fill="#72B02D" ></path><path d="M710.144 384.512c-20.992 0-38.4 17.408-38.4 38.4v178.688c0 20.992 17.408 38.4 38.4 38.4s38.4-17.408 38.4-38.4V422.912c0-21.504-17.408-38.4-38.4-38.4z" fill="#72B02D" ></path></symbol><symbol id="icon-zanting" viewBox="0 0 1024 1024"><path d="M512 150.016c199.68 0 361.984 162.304 361.984 361.984S711.68 873.984 512 873.984 150.016 711.68 150.016 512 312.32 150.016 512 150.016m0-74.752c-241.152 0-436.736 195.584-436.736 436.736s195.584 436.736 436.736 436.736 436.736-195.584 436.736-436.736-195.584-436.736-436.736-436.736z" fill="#AAAAAA" ></path><path d="M416.768 353.28c-22.016 0-39.936 17.92-39.936 39.936v238.08c0 22.016 17.92 39.936 39.936 39.936s39.936-17.92 39.936-39.936V392.704c-0.512-21.504-17.92-39.424-39.936-39.424z m190.464 0c-22.016 0-39.936 17.92-39.936 39.936v238.08c0 22.016 17.92 39.936 39.936 39.936s39.936-17.92 39.936-39.936V392.704c0-21.504-17.92-39.424-39.936-39.424z" fill="#72B02D" ></path></symbol><symbol id="icon-zhongzhi" viewBox="0 0 1024 1024"><path d="M512 150.016c199.68 0 361.984 162.304 361.984 361.984S711.68 873.984 512 873.984 150.016 711.68 150.016 512 312.32 150.016 512 150.016m0-74.752c-241.152 0-436.736 195.584-436.736 436.736s195.584 436.736 436.736 436.736 436.736-195.584 436.736-436.736-195.584-436.736-436.736-436.736z" fill="#AAAAAA" ></path><path d="M580.096 421.376c12.288 0 22.528 10.24 22.528 22.528v136.192c0 12.288-10.24 22.528-22.528 22.528H443.904c-12.288 0-22.528-10.24-22.528-22.528V443.904c0-12.288 10.24-22.528 22.528-22.528h136.192m0-68.096H443.904C393.728 353.28 353.28 393.728 353.28 443.904v136.192c0 50.176 40.448 90.624 90.624 90.624h136.192c50.176 0 90.624-40.448 90.624-90.624V443.904c0-50.176-40.448-90.624-90.624-90.624z" fill="#72B02D" ></path></symbol><symbol id="icon-suoxiao" viewBox="0 0 1024 1024"><path d="M491.008 463.36c32.256 0 58.88-26.112 58.88-58.88s-26.112-58.88-58.88-58.88H285.696c-32.256 0-58.88 26.112-58.88 58.88s26.112 58.88 58.88 58.88h205.312z" fill="#72B02D" ></path><path d="M810.496 720.384l-158.208-158.208c29.184-48.128 46.08-104.96 46.08-165.376 0-175.616-142.848-318.976-318.976-318.976s-318.976 143.36-318.976 318.976 142.848 318.976 318.976 318.976c78.336 0 150.016-28.16 205.824-75.264l152.576 152.576c10.24 10.24 23.04 14.848 36.352 14.848 13.312 0 26.112-5.12 36.352-14.848 19.968-19.968 19.968-52.736 0-72.704z m-431.104-107.52c-119.296 0-216.064-96.768-216.064-216.064 0-119.296 96.768-216.064 216.064-216.064s216.064 96.768 216.064 216.064c0 119.296-97.28 216.064-216.064 216.064z" fill="#72B02D" ></path><path d="M811.008 106.496h-109.056V209.92h109.056c29.696 0 53.76 24.064 53.76 53.76v81.408H967.68v-81.92c0-86.016-70.144-156.672-156.672-156.672zM864.768 791.552c0 29.696-24.064 53.76-53.76 53.76h-109.056v102.912h109.056c86.528 0 156.672-70.144 156.672-156.672v-81.92h-102.912v81.92z m-690.176 0v-81.92H71.68v81.92c0 86.528 70.144 156.672 156.672 156.672h109.056v-102.912H228.352c-29.696 0-53.76-24.064-53.76-53.76z" fill="#AAAAAA" ></path></symbol><symbol id="icon-fangda" viewBox="0 0 1024 1024"><path d="M488.96 333.824h-47.104V286.72c0-34.816-28.16-62.976-62.976-62.976-34.816 0-62.976 28.16-62.976 62.976v47.104h-47.104c-34.816 0-62.976 28.16-62.976 62.976s28.16 62.976 62.976 62.976h47.104V506.88c0 34.816 28.16 62.976 62.976 62.976 34.816 0 62.976-28.16 62.976-62.976v-47.104h47.104c34.816 0 62.976-28.16 62.976-62.976 0-34.304-28.16-62.976-62.976-62.976z" fill="#72B02D" ></path><path d="M810.496 720.384l-158.208-158.208c29.184-48.128 46.08-104.96 46.08-165.376 0-175.616-142.848-318.976-318.976-318.976s-318.976 143.36-318.976 318.976 142.848 318.976 318.976 318.976c78.336 0 150.016-28.16 205.824-75.264l152.576 152.576c10.24 10.24 23.04 14.848 36.352 14.848s26.112-5.12 36.352-14.848c19.968-19.968 19.968-52.736 0-72.704z m-431.104-107.52c-119.296 0-216.064-96.768-216.064-216.064 0-119.296 96.768-216.064 216.064-216.064s216.064 96.768 216.064 216.064c0 119.296-97.28 216.064-216.064 216.064z" fill="#72B02D" ></path><path d="M811.008 106.496h-109.056V209.92h109.056c29.696 0 53.76 24.064 53.76 53.76v81.408H967.68v-81.92c0-86.016-70.144-156.672-156.672-156.672zM864.768 791.552c0 29.696-24.064 53.76-53.76 53.76h-109.056v102.912h109.056c86.528 0 156.672-70.144 156.672-156.672v-81.92h-102.912v81.92z m-690.176 0v-81.92H71.68v81.92c0 86.528 70.144 156.672 156.672 156.672h109.056v-102.912H228.352c-29.696 0-53.76-24.064-53.76-53.76z" fill="#AAAAAA" ></path></symbol><symbol id="icon-fangdazhichuangkou" viewBox="0 0 1024 1024"><path d="M949.248 858.624l-158.208-158.208c29.184-48.128 46.08-104.96 46.08-165.376 0-175.616-142.848-318.976-318.976-318.976s-318.976 142.848-318.976 318.976 142.848 318.976 318.976 318.976c78.336 0 150.016-28.16 205.824-75.264l152.576 152.576c10.24 10.24 23.04 14.848 36.352 14.848s26.112-5.12 36.352-14.848c19.968-19.968 19.968-52.736 0-72.704z m-431.616-107.52c-119.296 0-216.064-96.768-216.064-216.064 0-119.296 96.768-216.064 216.064-216.064s216.064 96.768 216.064 216.064c0 119.296-96.768 216.064-216.064 216.064z" fill="#72B02D" ></path><path d="M216.576 919.04h109.056v-102.912H216.576c-29.696 0-53.76-24.064-53.76-53.76V233.984c0-29.696 24.064-53.76 53.76-53.76H798.72c29.696 0 53.76 24.064 53.76 53.76v81.92h102.912v-81.92c0-86.528-70.144-156.672-156.672-156.672H216.576c-86.528 0-156.672 70.144-156.672 156.672v528.384c0 86.528 70.144 156.672 156.672 156.672z" fill="#AAAAAA" ></path></symbol><symbol id="icon-shiyingpingmu" viewBox="0 0 1024 1024"><path d="M876.032 75.264H147.968c-39.936 0-72.704 32.768-72.704 72.704v728.064c0 39.936 32.768 72.704 72.704 72.704h728.064c39.936 0 72.704-32.768 72.704-72.704V147.968c0-39.936-32.768-72.704-72.704-72.704z m0 764.416c0 22.016-14.336 36.352-36.352 36.352H184.32c-22.016 0-36.352-14.336-36.352-36.352V184.32c0-22.016 14.336-36.352 36.352-36.352h655.36c22.016 0 36.352 14.336 36.352 36.352v655.36z" fill="#AAAAAA" ></path><path d="M329.728 184.32H220.672c-3.584 0-10.752 0-14.336 3.584-7.168 3.584-14.336 10.752-18.432 18.432-3.584 3.584-3.584 10.752-3.584 14.336v109.056c0 22.016 14.336 36.352 36.352 36.352s36.352-14.336 36.352-36.352v-22.016l47.104 47.104c7.168 7.168 14.336 10.752 25.6 10.752 10.752 0 18.432-3.584 25.6-10.752 14.336-14.336 14.336-36.352 0-51.2l-47.104-47.104h22.016c22.016 0 36.352-14.336 36.352-36.352 0-21.504-14.848-35.84-36.864-35.84zM329.728 766.976h-22.016l47.104-47.104c14.336-14.336 14.336-36.352 0-51.2-14.336-14.336-36.352-14.336-51.2 0l-47.104 47.104v-22.016c0-22.016-14.336-36.352-36.352-36.352s-36.352 14.336-36.352 36.352v109.056c0 3.584 0 10.752 3.584 14.336 3.584 7.168 10.752 14.336 18.432 18.432 3.584 3.584 10.752 3.584 14.336 3.584h109.056c22.016 0 36.352-14.336 36.352-36.352s-13.824-35.84-35.84-35.84zM817.664 187.904c-3.584-3.584-10.752-3.584-14.336-3.584h-109.056c-22.016 0-36.352 14.336-36.352 36.352s14.336 36.352 36.352 36.352h22.016l-47.104 47.104c-14.336 14.336-14.336 36.352 0 51.2 7.168 7.168 14.336 10.752 25.6 10.752s18.432-3.584 25.6-10.752l47.104-47.104v22.016c0 22.016 14.336 36.352 36.352 36.352s36.352-14.336 36.352-36.352V220.672c0-3.584 0-10.752-3.584-14.336-4.096-7.68-11.264-14.848-18.944-18.432zM803.328 657.408c-22.016 0-36.352 14.336-36.352 36.352v22.016l-47.104-47.104c-14.336-14.336-36.352-14.336-51.2 0-14.336 14.336-14.336 36.352 0 51.2l47.104 47.104h-22.016c-22.016 0-36.352 14.336-36.352 36.352s14.336 36.352 36.352 36.352h109.056c3.584 0 10.752 0 14.336-3.584 7.168-3.584 14.336-10.752 18.432-18.432 3.584-3.584 3.584-10.752 3.584-14.336v-109.056c0.512-22.016-13.824-36.864-35.84-36.864z" fill="#72B02D" ></path></symbol><symbol id="icon-yangshitu-01" viewBox="0 0 1024 1024"><path d="M645.632 882.688H150.528l252.928-204.8 477.696 0.512z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512z m-542.72 23.552H880.64l-234.496 203.264-228.864 0.512V140.8z m0 247.296l217.088-0.512-1.024 247.296H417.28V388.096z m-43.008-223.744v180.736l-225.792 1.024 225.792-181.76zM113.152 389.12l261.632-0.512v256l-263.168 211.968 1.536-467.456z m532.48 493.568H150.528l252.928-204.288 477.696 0.512-235.52 203.776z m271.36-247.808h-239.104V375.808l239.104-208.896V634.88z" fill="#AAAAAA" ></path></symbol><symbol id="icon-zuoshitu-01" viewBox="0 0 1024 1024"><path d="M374.272 644.096l-262.656 211.968L112.64 373.76l261.632-209.408z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512zM112.64 373.76l261.632-209.408v479.744l-263.168 211.968L112.64 373.76z m520.192 507.904l-482.304 1.536 252.928-204.8h230.4l-1.024 203.264z m1.024-246.784H417.28V388.096l217.088-0.512-0.512 247.296z m12.288-290.304l-228.864 0.512V140.8H880.64l-234.496 203.776z m31.232 510.976v-177.664H880.64l-203.264 177.664z m239.616-220.672h-239.104V375.808l239.104-208.896V634.88z" fill="#AAAAAA" ></path></symbol><symbol id="icon-qianshitu-01" viewBox="0 0 1024 1024"><path d="M112.64 389.12h520.704v493.056H112.64z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512zM374.272 164.352v180.736l-225.792 1.024 225.792-181.76z m259.584 717.824H112.64V389.12h520.704v493.056z m12.288-537.6l-228.864 0.512V140.8H880.64l-234.496 203.776z m31.232 510.976v-177.664H880.64l-203.264 177.664z m239.616-220.672h-239.104V375.808l239.104-208.896V634.88z" fill="#AAAAAA" ></path></symbol><symbol id="icon-youshitu-01" viewBox="0 0 1024 1024"><path d="M916.992 659.456l-239.616 196.096V375.808l239.616-208.896z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512zM374.272 164.352v180.736l-225.792 1.024 225.792-181.76zM113.152 389.12l261.632-0.512v256l-263.168 211.968 1.536-467.456z m519.68 492.544l-482.304 1.536 252.928-204.8h230.4l-1.024 203.264z m1.024-246.784H417.28V388.096l217.088-0.512-0.512 247.296z m12.288-290.304l-228.864 0.512V140.8H880.64l-234.496 203.776z m270.848 314.88l-239.104 196.096V375.808l239.104-208.896v492.544z" fill="#AAAAAA" ></path></symbol><symbol id="icon-houshitu-01" viewBox="0 0 1024 1024"><path d="M960 118.784V117.76v-1.024-1.024-1.024-0.512-0.512c1.536 7.68-1.024 15.872-6.656 20.992L677.376 373.76v299.52h-43.008V389.12H374.272v254.976l-262.656 211.968L112.64 389.12l261.632-0.512v-42.496h269.824l280.064-243.2c3.072-2.56 6.656-4.096 10.752-5.12H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c-0.512 0.512-0.512 1.024-1.024 2.048 0 0.512 0 0.512-0.512 1.024 0 0.512 0 0.512-0.512 1.024 0 0.512 0 1.024-0.512 1.536v0.512c0 0.512 0 1.024-0.512 1.536V907.264c0 0.512 0 1.024 0.512 2.048v0.512s0 0.512 0.512 1.024c0 0.512 0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.024s0 0.512 0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512c0.512 0.512 1.024 1.024 1.536 1.024 0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512c0.512 0 1.024 0 1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-242.176 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024 0-0.512 0.512-1.024 0.512-1.536v-0.512V658.944v-2.048V118.272c1.536 1.024 1.536 1.024 1.536 0.512zM374.272 164.352v180.736l-225.792 1.024 225.792-181.76z m258.56 717.312l-482.304 1.536 252.928-204.8h230.4l-1.024 203.264z m44.544-26.112v-177.664H880.64l-203.264 177.664z m281.6-741.376v-0.512-0.512 1.024z" fill="#AAAAAA" ></path><path d="M916.992 634.88h-239.616V375.808l239.616-211.456zM644.096 346.112H417.28V141.824h462.336zM417.28 389.12H634.88v245.76H417.28z" fill="#72B02D" ></path><path d="M958.976 114.176c0 0.512 0.512 0.512 0 0z m-20.48-16.384H945.152l0.512 0.512 0.512 0.512h1.024l0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512c0 0.512 0.512 0.512 0.512 1.024s0 0.512 0.512 0.512c0 0.512 0.512 1.024 0.512 1.536 0 0.512 0.512 1.024 0.512 1.024-3.072-10.24-13.312-16.896-24.064-14.848h4.608v1.024z" fill="#C1272D" ></path></symbol><symbol id="icon-dingshitu-01" viewBox="0 0 1024 1024"><path d="M880.64 140.8l-234.496 203.776-497.664 1.536 256-206.336z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512zM113.152 389.12l261.632-0.512v256l-263.168 211.968 1.536-467.456z m519.68 492.544l-482.304 1.536 252.928-204.8h230.4l-1.024 203.264z m1.024-246.784H417.28V388.096l217.088-0.512-0.512 247.296z m12.288-290.304l-497.664 1.536 256-205.824 476.16 1.024-234.496 203.264z m31.232 510.976v-177.664H880.64l-203.264 177.664z m239.616-220.672h-239.104V375.808l239.104-208.896V634.88z" fill="#AAAAAA" ></path></symbol><symbol id="icon-toushitu-01" viewBox="0 0 1024 1024"><path d="M965.632 114.176V112.64v-1.024-0.512-1.024-0.512s0-0.512-0.512-1.024v-0.512c-0.512-1.024-0.512-2.048-1.024-3.072v-0.512c0-0.512-0.512-0.512-0.512-1.024s0-0.512-0.512-0.512l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512s-0.512-1.024-1.024-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024s-0.512 0-0.512-0.512c0 0-0.512 0-0.512-0.512H950.784h-0.512H392.704c-5.12 0-9.728 1.536-13.312 4.608l-312.32 251.392-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536 0 0 0 0.512-0.512 0.512 0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024c0 0.512 0 0.512-0.512 1.024s0 0.512 0 1.024 0 1.024-0.512 1.536v0.512c0 0.512 0 1.024-0.512 1.536V912.896c0 0.512 0 1.024 0.512 2.048v0.512s0 0.512 0.512 1.024l0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.024l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512 0 0.512 0.512 0.512 1.024 1.024l0.512 0.512 1.024 1.024 0.512 0.512c0.512 0.512 1.024 1.024 1.536 1.024 0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512c0.512 0 1.024 0 1.024 0.512h583.168c7.68 0 14.848-4.096 18.432-10.752L957.44 675.84l1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024 0-0.512 0.512-1.024 0.512-1.536v-0.512V661.504v-1.536V658.432l1.024-544.256zM372.736 343.04l-229.888 0.512L372.736 158.72v184.32z m43.008 43.008l220.672-0.512-0.512 251.392h-220.16v-250.88z m-43.008 0v260.096l-267.264 215.552 1.536-474.624 265.728-1.024z m-227.84 502.272l257.024-208.384h233.984l-0.512 206.848-490.496 1.536z m503.296-545.792l-172.544 0.512H415.232V135.68h471.04l-238.08 206.848z m31.232 337.408h207.36l-207.36 181.248v-181.248z m0-43.008V373.76l243.2-212.48v475.648h-243.2z" fill="#AAAAAA" ></path></symbol><symbol id="icon-a-jixiebi3" viewBox="0 0 1024 1024"><path d="M483.386004 821.695719H164.779715l29.075502-22.648286h260.455285l29.075502 22.648286z" fill="#3F3F3F" ></path><path d="M483.386004 776.399147H164.779715l29.075502 22.648286h260.455285l29.075502-22.648286z" fill="#7A807D" ></path><path d="M483.386004 776.399147H164.779715l29.075502-22.648285h260.455285l29.075502 22.648285z" fill="#3F3F3F" ></path><path d="M483.386004 730.796518H164.779715l29.075502 22.954344h260.455285l29.075502-22.954344zM483.386004 685.499947H164.779715l29.075502 22.648285h260.455285l29.075502-22.648285z" fill="#7A807D" ></path><path d="M483.386004 730.796518H164.779715l29.075502-22.648286h260.455285l29.075502 22.648286z" fill="#3F3F3F" ></path><path d="M150.701051 623.064132h339.418227v62.435815H150.701051z" fill="#F7A53F" ></path><path d="M150.701051 821.695719h339.418227v31.217907H150.701051z" fill="#FFFFFF" ></path><path d="M607.951575 339.654504a74.984189 74.984189 0 0 1-23.872517 103.447575 75.290247 75.290247 0 0 1-103.753633-23.872518L293.324039 120.823095A75.290247 75.290247 0 0 1 317.196557 17.069462a75.290247 75.290247 0 0 1 103.753633 23.872517zM441.762128 517.474152v105.58998H198.752144v-105.58998a122.423166 122.423166 0 1 1 244.846331 0z" fill="#FFC200" ></path><path d="M627.233224 377.605685a103.141517 103.141517 0 0 1-52.948019 82.635637l-165.88339 118.750471-2.448463 1.836347a112.93537 112.93537 0 1 1-112.017197-194.346775l195.571007-84.471985a132.523077 132.523077 0 0 1 48.357151-12.854432A89.062853 89.062853 0 0 1 627.233224 377.605685z" fill="#FFE610" ></path><path d="M401.056425 493.601635a71.005436 71.005436 0 1 1-71.005436-71.311494 71.005436 71.005436 0 0 1 71.005436 71.311494z" fill="#FFFFFF" ></path><path d="M375.34756 493.601635a45.296571 45.296571 0 1 1-45.296571-45.60263 45.296571 45.296571 0 0 1 45.296571 45.60263z" fill="#48B8BF" ></path><path d="M592.342622 376.381453a49.88744 49.88744 0 1 1-49.581382-49.88744 49.88744 49.88744 0 0 1 49.581382 49.88744z" fill="#FFFFFF" ></path><path d="M574.285205 376.381453a30.605791 30.605791 0 1 1-30.605792-30.605791 30.605791 30.605791 0 0 1 30.605792 30.605791z" fill="#48B8BF" ></path><path d="M731.048068 230.789704l165.975207-62.099151 18.883774 50.46895-165.975207 62.068545z" fill="#FFE610" ></path><path d="M734.047436 202.785404l145.836596-54.294674 9.426584 25.31099-145.867202 54.294674z" fill="#F7A53F" ></path><path d="M808.419509 259.161272l23.872517 63.353988 31.523966 35.808776-19.893765 18.057417-48.051092-38.257239-27.851271-63.660046 40.399645-15.302896zM854.940312 242.022029l23.56646 63.04793-0.306058 47.745035 26.627038 0.612116 11.324143-60.293409-20.811938-66.414568-40.399645 15.302896zM716.173654 94.379691l102.345766-38.257239 37.216643 99.468822-102.345767 38.257239z" fill="#7A807D" ></path><path d="M841.473764 83.790087a66.108509 66.108509 0 0 1-65.802452 66.10851l-407.669142 15.608953a67.944857 67.944857 0 0 1-11.324142 0 82.635637 82.635637 0 0 1 0-165.271273 67.944857 67.944857 0 0 1 11.324142 0l407.669142 17.445301A66.108509 66.108509 0 0 1 841.473764 83.790087z" fill="#FFE610" ></path><path d="M402.892773 83.790087a46.520803 46.520803 0 1 1-46.520803-46.214745A46.520803 46.520803 0 0 1 402.892773 83.790087z" fill="#FFFFFF" ></path><path d="M386.059587 83.790087a30.605791 30.605791 0 1 1-30.605791-30.605791 30.605791 30.605791 0 0 1 30.605791 30.605791z" fill="#48B8BF" ></path><path d="M810.867972 83.790087a38.257239 38.257239 0 1 1-39.787528-38.257239A38.257239 38.257239 0 0 1 810.867972 83.790087z" fill="#FFFFFF" ></path><path d="M795.565077 83.790087a24.484633 24.484633 0 1 1-24.484633-24.484633 24.484633 24.484633 0 0 1 24.484633 24.484633z" fill="#48B8BF" ></path><path d="M106.93477 852.913626h639.66104v171.086374H106.93477z" fill="#FFE610" ></path><path d="M383.305066 709.678522h337.275822v207.201208H383.305066z" fill="#4D4D4D" ></path><path d="M407.177584 732.02075h291.061076v161.904636H407.177584z" fill="#FFFFFF" ></path><path d="M429.825869 755.893267h159.150116v16.22107h-159.150116zM429.825869 784.356653h131.604903v16.22107h-131.604903zM429.825869 812.820039h199.855818v16.22107h-199.855818zM429.825869 841.283425h146.601741v16.22107h-146.601741z" fill="#92D5D2" ></path><path d="M507.564579 732.326808l-31.830023 161.904636H407.177584v-161.904636h100.386995z" fill="#F5F5F5" opacity=".5" ></path><path d="M474.816383 916.87973h155.783478v31.830023h-155.783478z" fill="#7A807D" ></path><path d="M106.93477 977.173139h639.66104v46.826861H106.93477z" fill="#F7A53F" ></path><path d="M252.006221 899.740487h66.414567v48.969266H252.006221z" fill="#7A807D" ></path><path d="M319.64502 817.716966l-3.672695 11.324143-21.730112 70.699378h-21.730112l23.872518-76.820537 3.366637-11.324143 19.893764 6.121159z" fill="#999999" ></path><path d="M341.069074 809.147344A28.463386 28.463386 0 1 1 321.17531 773.950684a28.463386 28.463386 0 0 1 19.893764 35.19666z" fill="#48B8BF" ></path><path d="M322.705599 793.538391a13.16049 13.16049 0 1 1-26.014923 0 13.16049 13.16049 0 0 1 26.014923 0z" fill="#FFFFFF" ></path><path d="M165.085773 899.740487h66.414568v49.275324H165.085773z" fill="#7A807D" ></path><path d="M163.861542 817.716966l3.366637 11.324143 22.03617 70.699378h21.730111l-23.872517-76.820537-3.672695-11.324143-19.587706 6.121159z" fill="#999999" ></path><path d="M142.437488 809.147344a28.157328 28.157328 0 1 0 18.669532-35.19666 28.157328 28.157328 0 0 0-18.669532 35.19666z" fill="#F7A53F" ></path><path d="M160.800963 793.538391a13.16049 13.16049 0 1 0 12.854432-12.854433 12.854432 12.854432 0 0 0-12.854432 12.854433z" fill="#FFFFFF" ></path></symbol><symbol id="icon-jixiebi2" viewBox="0 0 1164 1024"><path d="M848.55632 485.108049h233.370249v430.146938h-233.370249z" fill="#FFE610" ></path><path d="M974.217224 605.245396h154.314351v64.211341h-154.314351zM974.217224 689.82485h154.314351v64.211341h-154.314351zM974.217224 774.749527h154.314351v64.211341h-154.314351z" fill="#54D9D9" ></path><path d="M306.557369 245.869021l99.078789 31.760448 69.389675 22.094225 145.683794 46.259783 69.734897 22.094225 119.101681 37.974449 66.627896 21.058558 1.035667-2.761778 21.749003-69.044453 23.129891-72.151453-22.784669-7.249667-79.746343-25.201225-20.368113-6.559223-337.972595-107.364124-21.40378-6.904445-87.686455-27.617781-45.224116 142.576794-0.345222 1.035667z" fill="#FFE610" ></path><path d="M412.33347 357.755556l10.70189-33.555604 441.470229 140.401894-10.667368 33.555604z" fill="#A3A3A3" ></path><path d="M380.331366 357.686512l25.408359-79.953476 69.424197 22.094225-25.408359 79.918953zM595.508402 425.626253l25.408359-79.953476 69.389674 22.059703-25.373836 79.953476z" fill="#3F3F3F" ></path><path d="M809.200982 411.575707a144.302906 144.302906 0 0 0 4.833112 37.284004 138.088905 138.088905 0 0 0 18.987224 43.152783 144.302906 144.302906 0 0 0 15.535002 19.677669 146.719461 146.719461 0 0 0 256.154919-100.114456 144.648128 144.648128 0 0 0-34.522226-94.5909 180.206021 180.206021 0 0 0-15.880224-16.570668 146.719461 146.719461 0 0 0-96.317012-34.522227 148.445573 148.445573 0 0 0-58.687784 10.356668 146.719461 146.719461 0 0 0-89.757788 129.803571 34.522226 34.522226 0 0 0-0.345223 5.523556z" fill="#FFC200" ></path><path d="M876.174101 411.575707A80.091565 80.091565 0 1 0 956.265666 331.484142a80.091565 80.091565 0 0 0-80.091565 80.091565z" fill="#FFFFFF" ></path><path d="M904.827549 411.575707a51.438117 51.438117 0 1 0 51.438117-51.092895 51.438117 51.438117 0 0 0-51.438117 51.092895z" fill="#54D9D9" ></path><path d="M218.076903 216.594173l37.007826-117.202958 88.894733 28.06657L306.902591 244.660743zM86.512699 119.345062l92.450522-16.467102 19.401491 108.745013-92.450522 16.467102z" fill="#8A8A8A" ></path><path d="M0 65.317778l45.224116 254.083585 21.058558-3.797445 31.415226-5.523556 22.094225-4.142667-13.808891-77.675009-19.332446-109.090235-12.082779-67.318341-14.499335 2.761778-21.403781 3.797445-38.664893 6.904445z" fill="#292929" ></path><path d="M95.626567 436.43171l16.570668-3.107-14.499335-123.244348-31.415226 5.523556 29.343893 120.827792z" fill="#7A807D" ></path><path d="M138.088905 153.349455a80.782009 80.782009 0 0 0 31.070003 63.520896 79.40112 79.40112 0 0 0 49.021562 16.915891 75.258453 75.258453 0 0 0 32.10567-6.904445 80.091565 80.091565 0 0 0 48.331117-73.532342 78.710676 78.710676 0 0 0-13.808891-44.18845 76.984564 76.984564 0 0 0-31.760448-27.617781l-7.59489-3.452222a83.543787 83.543787 0 0 0-12.428001-3.452223H217.835247A80.091565 80.091565 0 0 0 138.088905 153.349455z" fill="#FFC200" ></path><path d="M167.087575 153.694677A51.092895 51.092895 0 1 0 217.835247 103.637449a50.747673 50.747673 0 0 0-50.747672 50.057228z" fill="#FFFFFF" ></path><path d="M185.384355 153.694677a32.450893 32.450893 0 1 0 32.450892-34.522226 32.450893 32.450893 0 0 0-32.450892 34.522226z" fill="#54D9D9" ></path><path d="M38.664893 58.413333l21.403781-3.797445C66.627897 19.74844 108.745013 11.117883 141.88635 14.915328a89.757788 89.757788 0 0 1 81.472454 58.687784h9.321001a83.543787 83.543787 0 0 1 12.428001 3.452223l7.59489 3.452223c53.854673-42.807561 165.016241-17.951558 187.110466 48.331116l21.40378 6.904446C439.813162 59.449 307.593036 24.581551 241.655583 69.115223a113.923346 113.923346 0 0 0-108.745012-69.044452C90.793455 0.070771 41.081449 10.772661 38.664893 58.413333zM799.189537 244.14291l20.368113 6.559223a345.222262 345.222262 0 0 0 89.412566-34.522226c48.331117-22.784669 133.601015-34.522226 144.99335 34.522226a114.613791 114.613791 0 0 1 0 48.676339 180.206021 180.206021 0 0 1 15.880224 16.570668c15.880224-50.057228 3.797445-107.364124-54.545117-124.280014-83.198565-22.439447-141.541127 45.569339-216.109136 52.473784z" fill="#3F3F3F" ></path><path d="M44.18845 731.251522a105.638012 105.638012 0 0 0 105.638012 105.638012h698.729858v-31.415226H149.826462a74.222786 74.222786 0 0 1 0-148.445573h698.729858v-31.415225H149.826462a105.638012 105.638012 0 0 0-105.638012 105.638012z" fill="#8A8A8A" ></path><path d="M75.603675 731.251522a74.222786 74.222786 0 0 0 74.222787 74.222786h698.729858V655.993069H149.826462a74.222786 74.222786 0 0 0-74.222787 75.258453z" fill="#FFE610" ></path><path d="M103.566679 731.251522a51.092895 51.092895 0 1 0 50.747672-50.747673A50.747673 50.747673 0 0 0 103.566679 731.251522z" fill="#FFFFFF" ></path><path d="M121.863459 731.251522a32.450893 32.450893 0 1 0 32.450892-32.450893 32.450893 32.450893 0 0 0-32.450892 32.450893zM290.331922 731.251522a34.522226 34.522226 0 0 0 34.522227 34.522226h414.266714a34.522226 34.522226 0 0 0 34.522226-34.522226 34.522226 34.522226 0 0 0-34.522226-34.522226h-414.266714a34.522226 34.522226 0 0 0-34.522227 34.522226z" fill="#54D9D9" ></path><path d="M827.15254 877.625761h276.523032v61.794785h-276.523032z" fill="#F7A53F" ></path><path d="M839.925764 939.765768h250.976584v31.070004h-250.976584z" fill="#707070" ></path><path d="M747.75142 657.028735v148.445573h43.152783v31.415226h57.652117v-211.276024h-57.652117v31.415225h-43.152783z" fill="#B3B3B3" opacity=".76" ></path><path d="M14.499335 970.490549h1149.590133v53.509451H14.499335z" fill="#B86805" ></path><path d="M154.314351 836.889534H272.725587v133.601015H154.314351zM614.150404 836.889534h118.411236v133.601015h-118.411236z" fill="#F7A53F" ></path><path d="M614.150404 836.889534h118.411236v78.365453h-118.411236zM154.314351 836.889534H272.725587v78.365453H154.314351z" fill="#B3B3B3" opacity=".76" ></path></symbol><symbol id="icon-jixiebi4" viewBox="0 0 1123 1024"><path d="M502.569098 505.335276h543.234824v85.15391H502.569098z" fill="#FFE610" ></path><path d="M483.047648 203.089382a81.451566 81.451566 0 0 1-41.06236 73.373725l-302.919047 173.33701a82.124719 82.124719 0 0 1-81.788143-143.045105l302.919047-173.33701a82.124719 82.124719 0 0 1 83.807603 0 79.768682 79.768682 0 0 1 27.935868 28.945597A77.412645 77.412645 0 0 1 483.047648 203.089382z" fill="#FFC200" ></path><path d="M39.776109 803.542249h1082.094151v220.121174H39.776109z" fill="#FFE610" ></path><path d="M39.776109 971.830609h1082.094151v52.169391H39.776109zM466.218812 723.43699v146.747449H219.844654v-146.747449a123.187079 123.187079 0 0 1 246.374158 0z" fill="#FFC200" ></path><path d="M396.210854 790.415757a100.973016 100.973016 0 0 1-141.698798-23.896947l-235.603704-331.864645a100.973016 100.973016 0 0 1 23.896947-141.362222 100.973016 100.973016 0 0 1 141.698799 23.896947l235.603703 331.528068a100.973016 100.973016 0 0 1-24.233523 141.698799z" fill="#FFE610" ></path><path d="M146.470929 451.146424a86.16364 86.16364 0 1 1 29.282174-118.138428 86.16364 86.16364 0 0 1-29.282174 118.138428z" fill="#B8B8B8" ></path><path d="M131.661553 424.556864a56.881466 56.881466 0 1 1 19.52145-78.085799 56.544889 56.544889 0 0 1-19.52145 78.085799z" fill="#B8B8B8" ></path><path d="M120.554522 405.035414a35.677132 35.677132 0 0 1-36.686863-60.920386A35.677132 35.677132 0 1 1 120.554522 405.035414z" fill="#FFFFFF" ></path><path d="M370.9676 757.767815a56.881466 56.881466 0 1 1 19.184873-78.085798 56.881466 56.881466 0 0 1-19.184873 78.085798z" fill="#B8B8B8" ></path><path d="M358.850839 739.592672a35.677132 35.677132 0 1 1 12.116761-48.803624 35.677132 35.677132 0 0 1-12.116761 48.803624z" fill="#FFFFFF" ></path><path d="M423.136992 384.167657l-112.416624 66.305614-32.984519-55.871735 112.753201-65.969037 9.760725 16.492259 13.463069 22.887217 9.424148 16.155682z" fill="#8A8A8A" ></path><path d="M400.18246 345.023785l70.512822-41.398937 13.463069 22.887217-70.512823 41.432594z" fill="#C4C4C4" ></path><path d="M489.442606 313.823123a21.877487 21.877487 0 0 1-11.780186 27.935868 21.54091 21.54091 0 0 1-27.935867-12.116762l-29.955328-73.373725a21.54091 21.54091 0 0 1 12.116762-27.935868 21.204333 21.204333 0 0 1 27.599291 11.780186z" fill="#F7A53F" ></path><path d="M482.037918 318.19862a12.453339 12.453339 0 0 1-9.424148 14.809376 12.789915 12.789915 0 0 1-14.809376-9.424148 12.789915 12.789915 0 0 1 9.424148-14.809376 12.453339 12.453339 0 0 1 14.809376 9.424148z" fill="#707070" ></path><path d="M303.652257 388.543155a24.5701 24.5701 0 0 0-7.404688 8.077841l-24.906677 45.10128 32.311365 44.764704 36.350285-65.63246a24.906677 24.906677 0 0 0-36.013709-33.657672z m12.453338 6.394957a14.472799 14.472799 0 0 1 16.155683 12.116762 14.136222 14.136222 0 0 1-12.116762 16.155683 13.799645 13.799645 0 0 1-16.155683-11.780185 14.136222 14.136222 0 0 1 13.463069-16.49226z" fill="#B86805" ></path><path d="M305.33514 411.430372a13.799645 13.799645 0 0 0 16.155683 11.780185 14.136222 14.136222 0 0 0 12.116762-16.155683 14.472799 14.472799 0 0 0-16.155683-12.116762 14.136222 14.136222 0 0 0-12.116762 16.49226z" fill="#5E5E5E" ></path><path d="M625.4196 163.709906l-19.858026 12.116762-37.360016 22.55064-19.858027 12.116762-20.867756-34.667402-40.389207-66.64219-19.184872-31.301635 9.424148-5.721804 58.227772-35.340556 9.424148-5.385227 80.441836 132.27465z" fill="#8A8A8A" ></path><path d="M568.066927 198.276335l37.124412-22.516982 36.484917 60.14626-37.15807 22.55064z" fill="#4D4D4D" ></path><path d="M931.031261 336.373763l-85.15391 217.765137h-128.572307l-46.447587-118.811581-30.965058-79.768683-7.404688-19.184873 46.111011-46.447587h205.648375l46.784164 46.447587z" fill="#AEBABD" ></path><path d="M744.668732 483.861681l105.954351-43.182793 2.423352 5.890093-105.988009 43.182793zM840.8287 361.953594l-120.157889-26.252984 1.682884-6.058381 119.821312 26.252984-1.346307 6.058381zM683.916634 363.838423l6.125696-1.851172 32.984518 109.252803-6.159353 1.851172z" fill="#6A5060" ></path><path d="M880.544753 403.015954a49.813354 49.813354 0 1 1-49.813354-49.813355 50.149931 50.149931 0 0 1 49.813354 49.813355zM746.923796 359.597557a33.657672 33.657672 0 1 1-33.657672-33.657672 33.657672 33.657672 0 0 1 33.657672 33.657672zM767.454975 465.282647a26.589561 26.589561 0 0 1-26.58956 26.252984A26.252984 26.252984 0 0 1 741.201991 438.693086a26.589561 26.589561 0 0 1 26.252984 26.589561z" fill="#FFFFFF" ></path><path d="M846.887081 403.015954a16.155683 16.155683 0 1 1-16.155682-16.155683 16.155683 16.155683 0 0 1 16.155682 16.155683zM724.709732 359.597557a10.097302 10.097302 0 0 1-10.097302 9.760725 9.760725 9.760725 0 1 1 0-19.52145 10.097302 10.097302 0 0 1 10.097302 9.760725zM748.943256 465.282647A7.741265 7.741265 0 0 1 741.201991 472.350758a8.077841 8.077841 0 0 1-8.077841-8.077842 8.077841 8.077841 0 0 1 8.077841-8.077841 8.077841 8.077841 0 0 1 7.741265 9.087572z" fill="#788B90" opacity=".37" ></path><path d="M698.456748 219.581642h166.268899v46.11101h-166.268899z" fill="#F7A53F" ></path><path d="M702.159092 223.620562h5.048651v38.03317h-5.048651zM711.246663 223.620562h5.048651v38.03317h-5.048651zM720.334235 223.620562h5.048651v38.03317h-5.048651zM729.421806 223.620562h5.048651v38.03317h-5.048651zM738.509378 223.620562h5.04865v38.03317h-5.04865zM747.596949 223.620562h5.048651v38.03317h-5.048651zM756.68452 223.620562h5.048651v38.03317h-5.048651zM765.772092 223.620562h5.048651v38.03317h-5.048651zM774.859663 223.620562h5.048651v38.03317H774.859663zM783.610658 223.620562h5.048651v38.03317h-5.048651zM792.698229 223.620562h5.048651v38.03317h-5.048651zM801.785801 223.620562h5.04865v38.03317h-5.04865zM810.873372 223.620562h5.048651v38.03317h-5.048651zM819.960944 223.620562h5.04865v38.03317h-5.04865zM829.048515 223.620562h5.048651v38.03317h-5.048651zM838.136086 223.620562h5.048651v38.03317h-5.048651zM847.223658 223.620562h5.048651v38.03317h-5.048651zM856.311229 223.620562h5.048651v38.03317h-5.048651z" fill="#788B90" opacity=".38" ></path><path d="M738.845954 265.692652h85.490487v23.896947h-85.490487z" fill="#707070" ></path><path d="M735.816764 288.916446h-1.682884L640.228976 355.558636l-39.0429 26.926138-4.712074 3.365767-16.492259-23.896947a25.916407 25.916407 0 0 1 6.731534-36.013709l97.270672-67.315344a25.916407 25.916407 0 0 1 36.013709 6.731534z" fill="#58BFD2" ></path><path d="M670.857457 435.327319h-33.657672a12.116762 12.116762 0 0 1-10.433878-8.414418l-24.906677-44.428127 39.042899-26.926138z" fill="#8A8A8A" ></path><path d="M827.365631 288.916446h1.682884l94.241481 65.63246 39.0429 26.926138 4.712074 3.365767 16.492259-23.896947a25.916407 25.916407 0 0 0-6.731534-35.003979l-97.270672-67.315344a25.916407 25.916407 0 0 0-36.013709 6.731534z" fill="#58BFD2" ></path><path d="M892.324938 435.327319h33.657672a12.116762 12.116762 0 0 0 10.433878-8.414418l24.906677-44.428127-39.042899-26.926138z" fill="#8A8A8A" ></path><path d="M738.845954 265.692652h85.490487v12.116762h-85.490487zM922.95342 355.558636l-31.301635 79.768683-46.447588 118.811581 49.140201-194.541343-70.007957-69.671381h4.038921l94.578058 65.63246z" fill="#848484" opacity=".25" ></path><path d="M661.433309 321.900964l-48.467048-67.988497 21.204334-12.789915 38.033169 74.383455-10.770455 6.394957z" fill="#7A807D" ></path><path d="M535.553616 36.820483l-58.227772 33.657672-11.780186-19.184873A33.657672 33.657672 0 0 1 502.905674 1.143351a33.657672 33.657672 0 0 1 21.204334 15.482529z" fill="#F7A53F" ></path><path d="M527.475775 175.826668L483.047648 203.089382A77.412645 77.412645 0 0 0 471.940616 164.046483a79.768682 79.768682 0 0 0-27.599291-28.272444l42.745243-25.916408zM527.475775 175.826668l-40.389207-66.64219 40.389207 66.64219z" fill="#C4C4C4" ></path><path d="M956.274515 854.028757H600.512923l32.311365-25.243254h290.802285l32.647942 25.243254z" fill="#999999" ></path><path d="M650.999431 304.062398l-70.007958 14.809376 69.671381 8.414418-4.712074 38.033169 25.243254-25.243254 22.887217 25.243254-3.702344-36.350286 35.003979-1.682883-31.974789-19.52145 14.809376-35.677132-33.657672 24.906677-26.252984-43.754973 2.692614 50.823084z" fill="#FFFFFF" ></path><path d="M956.274515 803.542249H600.512923l32.311365 25.243254h290.802285l32.647942-25.243254z" fill="#7A807D" ></path><path d="M956.274515 803.542249H600.512923l32.311365-25.579831h290.802285l32.647942 25.579831z" fill="#999999" ></path><path d="M956.274515 752.719165H600.512923l32.311365 25.243253h290.802285l32.647942-25.243253zM956.274515 702.232657H600.512923l32.311365 25.243254h290.802285l32.647942-25.243254z" fill="#7A807D" ></path><path d="M956.274515 752.719165H600.512923l32.311365-25.243254h290.802285l32.647942 25.243254z" fill="#999999" ></path><path d="M584.693817 632.561276h378.985386v69.671381H584.693817zM584.693817 854.028757h378.985386v34.667402H584.693817z" fill="#FFC200" ></path><path d="M502.569098 590.489186h543.234824v42.07209H502.569098z" fill="#F7A53F" ></path><path d="M273.696929 882.637778h80.441836v59.574079H273.696929z" fill="#7A807D" ></path><path d="M355.821648 783.011069l-4.375497 13.799646-26.589561 85.827063h-26.252984l28.945598-93.231751 4.375497-13.799646 23.896947 7.404688z" fill="#999999" ></path><path d="M381.738055 772.913768a33.657672 33.657672 0 1 1-22.55064-43.08182 33.657672 33.657672 0 0 1 22.55064 43.08182z" fill="#F7A53F" ></path><path d="M359.523992 753.728895a15.819106 15.819106 0 1 1-15.819106-15.819106 15.819106 15.819106 0 0 1 15.819106 15.819106z" fill="#FFFFFF" ></path><path d="M168.348416 882.637778h80.441835v59.574079H168.348416z" fill="#7A807D" ></path><path d="M166.665532 783.011069l4.375497 13.799646 26.589561 85.827063h26.252984l-28.945598-93.231751-4.03892-13.799646-24.233524 7.404688z" fill="#999999" ></path><path d="M140.749125 772.913768a33.657672 33.657672 0 1 0 67.315343-20.53118 33.657672 33.657672 0 0 0-43.08182-22.55064 33.657672 33.657672 0 0 0-24.233523 43.08182z" fill="#68FF4B" ></path><path d="M162.963188 753.728895a15.819106 15.819106 0 1 0 15.819106-15.819106 15.819106 15.819106 0 0 0-15.819106 15.819106z" fill="#FFFFFF" ></path></symbol></svg>',(s=>{var e=(t=(t=document.getElementsByTagName("script"))[t.length-1]).getAttribute("data-injectcss"),t=t.getAttribute("data-disable-injectsvg");if(!t){var n,i,r,a,o,l=function(d,u){u.parentNode.insertBefore(d,u)};if(e&&!s.__iconfont__svg__cssinject__){s.__iconfont__svg__cssinject__=!0;try{document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>")}catch(d){console&&console.log(d)}}n=function(){var d,u=document.createElement("div");u.innerHTML=s._iconfont_svg_string_4634042,(u=u.getElementsByTagName("svg")[0])&&(u.setAttribute("aria-hidden","true"),u.style.position="absolute",u.style.width=0,u.style.height=0,u.style.overflow="hidden",u=u,(d=document.body).firstChild?l(u,d.firstChild):d.appendChild(u))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(n,0):(i=function(){document.removeEventListener("DOMContentLoaded",i,!1),n()},document.addEventListener("DOMContentLoaded",i,!1)):document.attachEvent&&(r=n,a=s.document,o=!1,h(),a.onreadystatechange=function(){a.readyState=="complete"&&(a.onreadystatechange=null,c())})}function c(){o||(o=!0,r())}function h(){try{a.documentElement.doScroll("left")}catch{return void setTimeout(h,50)}c()}})(window);const Iu=ft.defineStore("formToTableComp",{state:()=>({selectArray:[],selectString:""}),actions:{setSelectArray(s){this.selectArray=s},setSelectString(s){this.selectString=s}}}),e3={class:"calculator-content"},t3={class:"calculator-child"},n3={class:"calculator-child"},i3=Y.defineComponent({__name:"calculator",setup(s){const e=Y.ref(),t=Y.ref();return Y.onMounted(()=>{e.value=[{type:"Upload",label:"输入",name:"input"}],t.value=[{type:"Upload",label:"输出",name:"output"}]}),(n,i)=>(Y.openBlock(),Y.createElementBlock("div",e3,[Y.createElementVNode("div",t3,[Y.createVNode(kn.ssForm,{rowContents:e.value,isRowFlex:!0},null,8,["rowContents"])]),Y.createElementVNode("div",n3,[Y.createVNode(kn.ssForm,{rowContents:t.value,isEdit:!1,isRowFlex:!0},null,8,["rowContents"])])]))}}),s3=gl._export_sfc(i3,[["__scopeId","data-v-73db0fe7"]]),Fu=ft.defineStore("unit",{state:()=>({selectIndex:"",selectMenu:"",selectTitle:[]}),actions:{setSelectIndex(s){this.selectIndex=s},setSelectMenu(s){this.selectMenu=s},setSelectTitle(s){this.selectTitle=s}}}),Ou=(s,e)=>{let t=s,n=e;return Array.isArray(t)&&(t=t==null?void 0:t.map((i,r)=>{if(Array.isArray(i)){let a={};return i=i==null?void 0:i.forEach((o,l)=>{var c;(c=n==null?void 0:n[l])!=null&&c.prop?a[n[l].prop]=o:Array.isArray(o)&&(a.children=Ou(o,n))}),Object.assign(a,{id:r})}else return i})),t},zu=(s,e,t)=>{let n=s,i=e;return n=n==null?void 0:n.map((r,a)=>{var o,l;return!Array.isArray(r)||!((o=i==null?void 0:i[a])!=null&&o.label)&&!t||(r.unshift(((l=i==null?void 0:i[a])==null?void 0:l.label)??""),r.some(c=>Array.isArray(c))&&(r=r==null?void 0:r.map(c=>{var h;return Array.isArray(c)&&(c=zu(c,(h=i==null?void 0:i[a])==null?void 0:h.children,t)),c}))),r}),n},r3=(s,e,t)=>{if(e==="")return s==null?void 0:s.filter(n=>(n==null?void 0:n.id)!==t);{const n=e.split("-");return a3(s,n,t)}},a3=(s,e,t)=>{let n=s,i=e;return(i==null?void 0:i.length)===0?n=n==null?void 0:n.filter(r=>r.id!==t):n=n==null?void 0:n.map(r=>(r.id.toString()===(i==null?void 0:i[0])&&(i==null||i.shift(),r=Bu(r,i,t)),r)),n},Bu=(s,e,t)=>{var r,a;let n=s,i=e;return(i==null?void 0:i.length)===0?n.children=(r=n.children)==null?void 0:r.filter(o=>o.id!==t):n.children=(a=n.children)==null?void 0:a.map(o=>(o.id.toString()===(i==null?void 0:i[0])&&(i==null||i.shift(),o=Bu(o,i,t)),o)),n},o3=(s,e,t)=>{if(e==="")return t;{const n=e.split("-");return l3(s,n,t)}},l3=(s,e,t)=>{let n=s,i=e;return(i==null?void 0:i.length)===0?n=t:n=n==null?void 0:n.map(r=>(r.id.toString()===(i==null?void 0:i[0])&&(i==null||i.shift(),r=ku(r,i,t)),r)),n},ku=(s,e,t)=>{var r;let n=s,i=e;return(i==null?void 0:i.length)===0?n.children=t:n.children=(r=n.children)==null?void 0:r.map(a=>(a.id.toString()===(i==null?void 0:i[0])&&(i==null||i.shift(),a=ku(a,i,t)),a)),n},Vu=ft.defineStore("modelTableComp",{state:()=>({tableIndex:0,tableShowThree:""}),actions:{setTableIndex(s){this.tableIndex=s},setTableShowThree(s){this.tableShowThree=s}}}),c3={class:"table-content"},h3={class:"menu-config-wrap"},u3=["onClick"],d3={class:"menu-config-wrap",style:{padding:"0 16px","box-sizing":"border-box","max-height":"300px",width:"200px",overflow:"auto"}},f3={class:"form-content"},p3={key:0,class:"dialog-footer"},m3={class:"dialog-footer"},g3={__name:"index",props:{compName:{type:String,default:"",required:!1},operatingForm:{type:Object,default:()=>{}},itemData:{type:Array,default:()=>[]},childItemData:{type:Array,default:()=>[]},index:Number,changedContent:{type:Object,default:()=>{}},showHeader:{type:Boolean,default:!0}},emits:["change","contentChange","onButtonClick","contentClick","pageChange","rowClick"],setup(s,{emit:e}){const t=Y.ref([]),n=s,i=e,r=Y.ref([]),a=Y.ref(!1),o=Y.ref(),l=ft.useMenuState(),{activeMenuPath:c}=ft.storeToRefs(l),h=Vu(ft.pinia),d=Vh.useModelComp(ft.pinia),{extraContents:u}=ft.storeToRefs(d),f=Y.ref([]);Y.ref(!1);const m=Y.ref("");Y.ref();const _=Y.ref(!0),g=Y.ref(0),p=Y.ref(!1),w=Y.ref(""),E=Y.ref(!1),S=Y.ref({label:"查看三维模型"}),U=Y.ref(!1),L=Y.ref(),D=Y.ref([]),N=Y.ref([]),b=Y.ref(!1),M=Y.ref([]),I=Y.ref([]),V=Y.ref(),H=Y.ref(),J=Iu(ft.pinia),ie=Y.ref(),B=Fu(ft.pinia),{selectIndex:oe,selectMenu:j,selectTitle:ue}=ft.storeToRefs(B),{selectString:pe}=ft.storeToRefs(J),Me=Y.ref(720),Ue=Y.computed(()=>{var W;return(W=r.value)==null?void 0:W.filter(ae=>(ae==null?void 0:ae.label)!=="操作")}),Ne=()=>{E.value=!1},$=W=>{i("clickTrigger",W)},se=(W,ae)=>{if(Object.values(ae).length!==0)return Object.values(ae).find(ne=>{var ye,Oe,T;return((ye=ne==null?void 0:ne.toString())==null?void 0:ye.includes(".txt"))||((Oe=ne==null?void 0:ne.toString())==null?void 0:Oe.includes(".cpt"))||((T=ne==null?void 0:ne.toString())==null?void 0:T.includes(".obj"))})?[...W,S.value]:W},re=W=>{var Oe;pe.value===""?W==null||W[0]:(W==null?void 0:W.find(T=>(T==null?void 0:T.selectLabel)==="("+pe.value+")"))??(W==null||W.find(T=>!(T!=null&&T.selectLabel)));let ae=W;(Oe=r.value)!=null&&Oe.find(T=>T.prop==="index");let ne=V.value;const ye=[];return ae==null||ae.forEach((T,y)=>{var K;let k={};if(Array.isArray(T)){let Q=[];T==null||T.filter(O=>!(O!=null&&O.id)).forEach((O,we)=>{var xe,Se,Ie,de,Pe;if((xe=ne==null?void 0:ne[we])!=null&&xe.prop&&!Array.isArray(O)){let qe={};qe[ne[we].column]=O,u!=null&&u.value&&((Se=u==null?void 0:u.value)==null?void 0:Se.length)>0&&((Ie=u==null?void 0:u.value)!=null&&Ie.find(ke=>JSON.stringify(ke==null?void 0:ke[0])===JSON.stringify(qe)))&&(Q=(de=u==null?void 0:u.value)==null?void 0:de.find(ke=>JSON.stringify(ke==null?void 0:ke[0])===JSON.stringify(qe))),Q&&Q.length>0?k[ne[we].prop]=Q!=null&&Q.find(ke=>{var Ae;return((Ae=Object.keys(ke))==null?void 0:Ae[0])===ne[we].column})?(Pe=Q==null?void 0:Q.find(ke=>{var Ae;return((Ae=Object.keys(ke))==null?void 0:Ae[0])===ne[we].column}))==null?void 0:Pe[ne[we].column]:O:k[ne[we].prop]=O}})}else k=T;Array.isArray(T)&&T.some(Q=>Q==null?void 0:Q.id)?ye.push(Object.assign(k,{id:(K=T==null?void 0:T.find(Q=>Q.id))==null?void 0:K.id})):k.id?ye.push(k):ye.push(Object.assign(k,{id:y}))}),ye},le=async W=>{var Oe,T,y,k,K;let ae={};for(let Q in W)W[Q]!==""&&(ae["tableData."+Q]=W[Q]);const ne=await bn.filterContents({type:"data",tableId:n==null?void 0:n.index,systemKey:sessionStorage.getItem("systemKey"),pageKey:c.value},ae),ye=(y=(T=(Oe=ft.cloneDeep(ne))==null?void 0:Oe.data)==null?void 0:T.result)==null?void 0:y.map(Q=>{var we;let O=[];return O.push({id:Q.id}),O.push((we=Q==null?void 0:Q.value)==null?void 0:we.tableData),O});f.value=re(bn.getTableContents(ye,(K=(k=ft.cloneDeep(r.value))==null?void 0:k.map(Q=>Q.label))==null?void 0:K.filter(Q=>Q!=="操作")))},Ee=async W=>{var ye,Oe,T,y,k,K,Q,O,we,xe;const ae=(ye=ft.cloneDeep(r.value))==null?void 0:ye.filter(Se=>Se==null?void 0:Se.isRoute);if((ae==null?void 0:ae.length)>0){let Se=(Oe=ae==null?void 0:ae[0])==null?void 0:Oe.prop,Ie=c.value+"/"+(W==null?void 0:W[Se]),de=c.value,Pe=await bn.getItemData(Ie,sessionStorage.getItem("systemKey"),"");if((Pe==null?void 0:Pe.length)>0)d.setRouteToChildPath(de),l.setActiveMenuPath(Ie);else{const qe=await bn.findFirstContent(n==null?void 0:n.index);qe&&(Ie=c.value+"/"+(qe==null?void 0:qe[(T=ae==null?void 0:ae[0])==null?void 0:T.label]),await bn.loadingConstruct(Ie,c.value+"/"+(W==null?void 0:W[Se])),d.setRouteToChildPath(de),l.setActiveMenuPath(c.value+"/"+(W==null?void 0:W[Se])))}}let ne=await bn.getItemData(c.value,sessionStorage.getItem("systemKey"),W.id);if(ne=ne==null?void 0:ne.filter(Se=>Se.comp!=="methodButton"),ne&&ne.length>0){const Se=!Array.isArray(ue.value)&&((y=ue.value)==null?void 0:y.key)!=="main"?[]:ue.value;Se.push({key:j.value===""?(k=W==null?void 0:W.id)==null?void 0:k.toString():j.value+"-"+((K=W==null?void 0:W.id)==null?void 0:K.toString()),value:W[(Q=Object.keys(W))==null?void 0:Q.filter(Ie=>Ie!=="index"&&Ie!=="id")[0]]}),B.setSelectMenu(j.value===""?(O=W==null?void 0:W.id)==null?void 0:O.toString():j.value+"-"+((we=W==null?void 0:W.id)==null?void 0:we.toString())),B.setSelectTitle(Se),B.setSelectIndex((xe=W==null?void 0:W.id)==null?void 0:xe.toString()),i("pageChange",ne)}},fe=W=>{var ae;(ae=ft.cloneDeep(n.itemData))==null||ae.map(ne=>((ne==null?void 0:ne.key)==="tableContents"&&(ne.contents=W),ne))},be=async(W,ae,ne,ye)=>{var Oe;if((ye==null?void 0:ye.data)==="查看"&&(W!=null&&W.every(T=>(T==null?void 0:T.url)&&(T==null?void 0:T.name)))){let T=ft.cloneDeep(W);T=await((Oe=ft.cloneDeep(T))==null?void 0:Oe.map(async k=>{var O,we,xe,Se;const K=await kn.downloadAvatarApi({url:k==null?void 0:k.url});let Q=URL.createObjectURL(K.data);return{name:(k==null?void 0:k.name)+"."+((Se=(O=k==null?void 0:k.url)==null?void 0:O.split("."))==null?void 0:Se[((xe=(we=k==null?void 0:k.url)==null?void 0:we.split("."))==null?void 0:xe.length)-1]),blobUrl:Q}}));let y=await Promise.all(T);o.value=y,a.value=!0}i("contentClick",W,ae,ne,{id:n==null?void 0:n.index,type:"table"})},Je=()=>{a.value=!1},at=W=>{i("rowClick",W)};Y.watch(()=>n.changedContent,()=>{var ne,ye;if(!n.changedContent)return;let W=(ne=f.value)==null?void 0:ne.map(Oe=>{var T;return Oe.id===((T=n.changedContent)==null?void 0:T.id)&&(Oe={...n.changedContent,id:n.changedContent.newId?n.changedContent.newId:n.changedContent.id},delete Oe.newId),Oe});const ae=(ye=n.itemData)==null?void 0:ye.map(Oe=>((Oe==null?void 0:Oe.key)==="tableContents"&&(Oe.contents=W),Oe));f.value=W,i("contentChange",{contents:ae,index:n.index}),i("change",{content:W,index:n==null?void 0:n.index,buttonName:"",id:n==null?void 0:n.index})},{deep:!0,immediate:!0});const it=()=>{},z=(W,ae,ne)=>{var ye,Oe,T;if(m.value="",b.value=!0,_.value=!0,i("onButtonClick",W,ae),W==="删除"){f.value=(ye=ft.cloneDeep(f.value))==null?void 0:ye.filter(k=>(k==null?void 0:k.id)!==(ae==null?void 0:ae.id));const y=r3(ie.value,j.value,ae==null?void 0:ae.id);fe(y),i("change",{content:f.value,singleContent:ae,index:n==null?void 0:n.index,type:"delete",buttonName:W,column:r.value})}else if(W==="新增")w.value="新增",yt(""),E.value=!0;else if(W==="编辑")w.value="编辑",yt(ae),E.value=!0;else if(W==="查看")w.value="查看",yt(ae),b.value=!1,_.value=!1,E.value=!0;else if(W==="查看三维模型"){const y={};for(let K in ae)K!=="id"&&(y[K]=ae[K]);let k=(Oe=Object.values(y))==null?void 0:Oe[1];h.setTableShowThree(k)}else((T=ne==null?void 0:ne.extra)==null?void 0:T.type)==="modelExample"&&(w.value=W,U.value=!0)},yt=W=>{var Oe,T,y,k,K,Q;const ae=[];let ne=[];for(let O in W)Array.isArray(W==null?void 0:W[O])&&ne.push(O);(T=bn.getColumnChild((Oe=ft.cloneDeep(r.value))==null?void 0:Oe.filter(O=>(O==null?void 0:O.label)!=="操作")))==null||T.forEach((O,we)=>{var xe;ne.find(Se=>Se===(O==null?void 0:O.prop))||(O!=null&&O.formType&&((xe=O==null?void 0:O.formType)==null?void 0:xe.toUpperCase())==="SELECT"?ae.push({label:(O==null?void 0:O.label)??"",name:(O==null?void 0:O.prop)??"t"+we,type:!(O!=null&&O.formType)||(O==null?void 0:O.formType)===""?"Input":O==null?void 0:O.formType,value:(W==null?void 0:W[O==null?void 0:O.prop])??(O==null?void 0:O.value)??"",id:(O==null?void 0:O.id)??we,contents:(O==null?void 0:O.options)??[],width:1,isFormColHidden:O==null?void 0:O.isFormColHidden,optionUrl:{groupSelect:O==null?void 0:O.groupSelect,menuSelect:O==null?void 0:O.formMenuSelect,type:"Select",selectRelateType:O==null?void 0:O.selectRelateType}}):ae.push({label:(O==null?void 0:O.label)??"",name:(O==null?void 0:O.prop)??"t"+we,type:!(O!=null&&O.formType)||(O==null?void 0:O.formType)===""?"Input":O==null?void 0:O.formType,value:(W==null?void 0:W[O==null?void 0:O.prop])??(O==null?void 0:O.value)??"",id:(O==null?void 0:O.id)??we,contents:(O==null?void 0:O.options)??[],width:1,isFormColHidden:O==null?void 0:O.isFormColHidden}))}),W===""||!W||(m.value=W==null?void 0:W.id);let ye=bn.getColumnChild((y=ft.cloneDeep(r.value))==null?void 0:y.filter(O=>(O==null?void 0:O.label)!=="操作"));D.value&&((k=D.value)==null?void 0:k.length)>0&&(D.value=(K=ft.cloneDeep(D).value)==null?void 0:K.map(O=>{var xe;let we=(xe=ye==null?void 0:ye.find(Se=>(Se==null?void 0:Se.label)===(O==null?void 0:O.label)))==null?void 0:xe.prop;return we&&(O.value=W[we]),O})),I.value=D.value&&((Q=D.value)==null?void 0:Q.length)>0?bn.getTableFormToForm(D.value):ae};Y.onMounted(()=>{L.value=window.innerWidth-240*2});const dt=()=>{var Oe;let W=bn.getColumnChild((Oe=ft.cloneDeep(r.value))==null?void 0:Oe.filter(T=>(T==null?void 0:T.label)!=="操作")),ae,ne=ft.cloneDeep(f.value);m.value===""?(g.value++,ne.push(Object.assign(H.value,{id:g.value})),ae=Object.assign(H.value,{id:g.value})):ne=ne==null?void 0:ne.map(T=>{var y;if((T==null?void 0:T.id)===m.value){let k={};for(let K in T){let Q=(y=W==null?void 0:W.find(O=>(O==null?void 0:O.prop)===K))==null?void 0:y.label;Q?k[K]=H.value[Q]:k[K]=T[K]}T=Object.assign(k,H.value),ae=T}return T}),f.value=ne;const ye=o3(ie.value,j.value,ne);fe(ye),E.value=!1,i("change",{content:ye,singleContent:ae,index:n==null?void 0:n.index,buttonName:w.value,column:r.value})},ot=W=>{H.value=W,i("onFormChange",W)};return Y.watch(()=>[n.itemData,pe.value,oe.value,j.value,u==null?void 0:u.value],()=>{var K,Q,O,we,xe,Se,Ie,de,Pe,qe,ke,Ae,rt,G,De,ge,ze,ve,he,Ge,lt,Lt,pt,en,vn,Di,Ni;const W=(K=ft.cloneDeep(n.itemData))==null?void 0:K.filter(je=>(je==null?void 0:je.key)==="header");(Q=ft.cloneDeep(n.itemData))==null||Q.filter(je=>(je==null?void 0:je.key)==="tableIndexColumn")[0];const ae=(O=ft.cloneDeep(n.itemData))==null?void 0:O.find(je=>(je==null?void 0:je.key)==="page"),ne=(we=ft.cloneDeep(n.itemData))==null?void 0:we.find(je=>(je==null?void 0:je.key)==="rowButton"),ye=(xe=ft.cloneDeep(n.itemData))==null?void 0:xe.find(je=>(je==null?void 0:je.key)==="extraButton"),Oe=(Se=ft.cloneDeep(n.itemData))==null?void 0:Se.filter(je=>(je==null?void 0:je.key)==="tableContents"),T=(Ie=ft.cloneDeep(n.itemData))==null?void 0:Ie.filter(je=>(je==null?void 0:je.key)==="tableIndex");D.value=(qe=(Pe=(de=ft.cloneDeep(n.itemData))==null?void 0:de.filter(je=>(je==null?void 0:je.key)==="tableToForm"))==null?void 0:Pe[0])==null?void 0:qe.contents,p.value=(ae==null?void 0:ae.contents)??!1;let y=[];pe.value===""?y=W==null?void 0:W[0]:y=(W==null?void 0:W.find(je=>(je==null?void 0:je.selectLabel)==="("+pe.value+")"))??(W==null?void 0:W.find(je=>!(je!=null&&je.selectLabel)));let k=[];if(pe.value===""?k=T==null?void 0:T[0]:k=(T==null?void 0:T.find(je=>(je==null?void 0:je.selectLabel)==="("+pe.value+")"))??(T==null?void 0:T.find(je=>!(je!=null&&je.selectLabel))),((ke=y==null?void 0:y.contents)==null?void 0:ke.length)>0){let je=[];if(y!=null&&y.contents.some(Ye=>Array.isArray(Ye)&&(Ye==null?void 0:Ye.find(Te=>Te.children))))j.value===""?je=(rt=(Ae=bn.getGradeColumns(ft.cloneDeep(y==null?void 0:y.contents)))==null?void 0:Ae[0])==null?void 0:rt.filter(Ye=>!Array.isArray(Ye)):(j.value.split("-"),je=(G=bn.getGradeColumns(ft.cloneDeep(y==null?void 0:y.contents)))==null?void 0:G[0]);else{const Ye=y!=null&&y.contents.some(Te=>Array.isArray(Te))?(De=y==null?void 0:y.contents)==null?void 0:De[0]:y==null?void 0:y.contents;Ye==null||Ye.forEach((Te,Gt)=>{var xn;je.push({label:(Te==null?void 0:Te.label)??"",prop:(Te==null?void 0:Te.label)==="操作"?"operate":(Te==null?void 0:Te.prop)??"a"+Gt,width:Te!=null&&Te.width?parseInt(Te.width):"",fixed:(Te==null?void 0:Te.fixed)??void 0,sortable:(Te==null?void 0:Te.sortable)??!1,align:(Te==null?void 0:Te.align)??"center",showOverflowTooltip:(Te==null?void 0:Te.showOverflowTooltip)??!0,isNotDrag:(Te==null?void 0:Te.isNotDrag)??!1,isEditCol:(Te==null?void 0:Te.isEditCol)??!1,isOperate:(Te==null?void 0:Te.isOperate)??!1,id:(Te==null?void 0:Te.id)??Gt,type:(Te==null?void 0:Te.label)==="操作"?"operate":void 0,formType:(Te==null?void 0:Te.formType)??(Te!=null&&Te.groupSelect?"Select":""),isTableColHidden:Te==null?void 0:Te.isTableColHidden,isFormColHidden:Te==null?void 0:Te.isFormColHidden,options:(Te==null?void 0:Te.options)??[],value:(Te==null?void 0:Te.value)??"",formMenuSelect:(Te==null?void 0:Te.formMenuSelect)??[],isRoute:(Te==null?void 0:Te.isRoute)??!1,groupSelect:Te!=null&&Te.groupSelect?(xn=Te==null?void 0:Te.groupSelect)==null?void 0:xn.replaceAll('"',"").split(":"):[]})})}r.value=je,t.value=(ge=r.value)==null?void 0:ge.map(Ye=>Ye==null?void 0:Ye.label);let qt=(ve=(ze=bn.getAllLeafNodes(ft.cloneDeep(r.value)))==null?void 0:ze.filter(Ye=>(Ye==null?void 0:Ye.type)!=="operate"))==null?void 0:ve.map((Ye,Te)=>({prop:(Ye==null?void 0:Ye.prop)??"a"+Te,column:Ye.label}));V.value=qt;let jt=[];pe.value===""?jt=Oe==null?void 0:Oe[0]:jt=(Oe==null?void 0:Oe.find(Ye=>(Ye==null?void 0:Ye.selectLabel)==="("+pe.value+")"))??(Oe==null?void 0:Oe.find(Ye=>!(Ye!=null&&Ye.selectLabel)));let wn=Array.isArray((he=jt==null?void 0:jt.contents)==null?void 0:he[0])&&((Ge=jt==null?void 0:jt.contents)!=null&&Ge[0].every(Ye=>Array.isArray(Ye)))?(lt=ft.cloneDeep(jt==null?void 0:jt.contents))==null?void 0:lt[0]:ft.cloneDeep(jt==null?void 0:jt.contents);k!=null&&k.contents&&((Lt=k==null?void 0:k.contents)==null?void 0:Lt.length)!==0&&(wn=(pt=ft.cloneDeep(wn))==null?void 0:pt.map((Ye,Te)=>{if(!Array.isArray(Ye)){let Gt={};for(let xn in Ye)xn!=="id"&&xn!=="index"&&(Gt[xn]=Ye[xn]);Ye=Object.values(Gt)}return Ye}));const vi=!!((en=r.value)!=null&&en.find(Ye=>Ye.prop==="index"));wn=zu(ft.cloneDeep(wn),k==null?void 0:k.contents,vi);const Yn=[];wn==null||wn.forEach((Ye,Te)=>{var xn;let Gt={};if(Array.isArray(Ye)){let Yt=[];Ye==null||Ye.filter(dn=>!(dn!=null&&dn.id)).forEach((dn,An)=>{var Qi,es,C,X,Z,ee;if((Qi=qt==null?void 0:qt[An])!=null&&Qi.prop&&!Array.isArray(dn)){let q={};q[qt[An].column]=dn,u!=null&&u.value&&((es=u==null?void 0:u.value)==null?void 0:es.length)>0&&((C=u==null?void 0:u.value)!=null&&C.find(me=>JSON.stringify(me==null?void 0:me[0])===JSON.stringify(q)))&&(Yt=(X=u==null?void 0:u.value)==null?void 0:X.find(me=>JSON.stringify(me==null?void 0:me[0])===JSON.stringify(q))),Yt&&Yt.length>0?Gt[qt[An].prop]=Yt!=null&&Yt.find(me=>{var Ce;return((Ce=Object.keys(me))==null?void 0:Ce[0])===qt[An].column})?(Z=Yt==null?void 0:Yt.find(me=>{var Ce;return((Ce=Object.keys(me))==null?void 0:Ce[0])===qt[An].column}))==null?void 0:Z[qt[An].column]:dn:Gt[qt[An].prop]=dn}else Array.isArray(dn)&&((ee=qt[An])!=null&&ee.prop?Gt[qt[An].prop]=dn:Gt.children=Ou(dn,qt))})}else Gt=Ye;Array.isArray(Ye)&&Ye.some(Yt=>Yt==null?void 0:Yt.id)?Yn.push(Object.assign(Gt,{id:(xn=Ye==null?void 0:Ye.find(Yt=>Yt.id))==null?void 0:xn.id})):Gt.id?Yn.push(Gt):Yn.push(Object.assign(Gt,{id:Te}))}),f.value=Yn}else r.value=[],f.value=[];((vn=ne==null?void 0:ne.contents)==null?void 0:vn.length)>0?N.value=ne==null?void 0:ne.contents:N.value=[],((Di=ye==null?void 0:ye.contents)==null?void 0:Di.length)>0?M.value=ye==null?void 0:ye.contents:M.value=[],g.value=((Ni=f==null?void 0:f.value)==null?void 0:Ni.length)??0,ie.value=f.value},{deep:!0,immediate:!0}),Y.watch(()=>n==null?void 0:n.operatingForm,W=>{W!=null&&W.form&&(yt(W==null?void 0:W.form),w.value=W==null?void 0:W.dialogTitle,b.value=!0,E.value=!0)},{immediate:!0,deep:!0}),(W,ae)=>{var y;const ne=Y.resolveComponent("el-icon"),ye=Y.resolveComponent("el-popover"),Oe=Y.resolveComponent("svg-icon"),T=Y.resolveComponent("el-button");return Y.openBlock(),Y.createElementBlock("div",c3,[(Y.openBlock(),Y.createBlock(kn.ssTable,{columns:r.value,checkedColumns:t.value,key:r.value,tableData:f.value,isShowPagination:p.value,isShowEdit:!1,isShowDelete:!1,onDbClickRow:Ee,extraButton:M.value,onContentClick:be,onRowClick:at},Y.createSlots({headerButton:Y.withCtx(k=>[s.showHeader?(Y.openBlock(),Y.createBlock(Ku,{key:0,compName:s.compName,buttons:k.buttons,onButtonClick:ae[0]||(ae[0]=K=>z(K,"",{})),columns:r.value,onFilter:le},null,8,["compName","buttons","columns"])):Y.createCommentVNode("",!0)]),operateCol:Y.withCtx(()=>[Y.createVNode(ye,{title:"选择显示列信息",placement:"left-start","popper-class":"menu-operate-popover",trigger:"click",width:200},{reference:Y.withCtx(()=>[Y.createVNode(Oe,{name:"operate",style:{width:"15px",height:"15px",cursor:"pointer"}})]),default:Y.withCtx(()=>[Y.createElementVNode("div",d3,[Y.createVNode(kn._sfc_main$5,{content:Ue.value,modelValue:t.value,"onUpdate:modelValue":ae[1]||(ae[1]=k=>t.value=k),min:2,isWrap:!0,onChange:W.handleColumnCheck},null,8,["content","modelValue","onChange"])])]),_:1})]),_:2},[((y=N.value)==null?void 0:y.length)>0?{name:"actions",fn:Y.withCtx(({item:k})=>[Y.createVNode(ye,{title:"",placement:"left-start","popper-class":"menu-operate-popover"},{reference:Y.withCtx(()=>[Y.createVNode(ne,null,{default:Y.withCtx(()=>[Y.createVNode(Y.unref(ft.more_filled_default))]),_:1})]),default:Y.withCtx(()=>[Y.createElementVNode("div",h3,[(Y.openBlock(!0),Y.createElementBlock(Y.Fragment,null,Y.renderList(se(N.value,k),(K,Q)=>(Y.openBlock(),Y.createElementBlock("div",{class:"menu-config-item",key:Q},[Y.createElementVNode("div",{style:Y.normalizeStyle({color:K==null?void 0:K.textColor}),class:"extra-button-label",onClick:O=>z(K==null?void 0:K.label,k,{extra:K})},Y.toDisplayString(K==null?void 0:K.label),13,u3)]))),128))])]),_:2},1024)]),key:"0"}:void 0]),1032,["columns","checkedColumns","tableData","isShowPagination","extraButton"])),Y.createVNode(kn.ssDialog,{title:w.value,visible:E.value,width:Me.value,onBeforeDestroy:Ne},{default:Y.withCtx(()=>[Y.createElementVNode("div",f3,[Y.createVNode(kn.ssForm,{rowContents:I.value,isEnableWrap:!1,onChange:ot,onClickTrigger:$,isEdit:_.value},null,8,["rowContents","isEdit"])])]),footer:Y.withCtx(()=>[b.value?(Y.openBlock(),Y.createElementBlock("div",p3,[Y.createVNode(T,{onClick:ae[2]||(ae[2]=k=>E.value=!1),id:"themeBorderButton"},{default:Y.withCtx(()=>ae[5]||(ae[5]=[Y.createTextVNode(Y.toDisplayString("取消"))])),_:1,__:[5]}),Y.createVNode(T,{class:"ok-button",onClick:dt,id:"themeButton"},{default:Y.withCtx(()=>ae[6]||(ae[6]=[Y.createTextVNode(Y.toDisplayString("确认"))])),_:1,__:[6]})])):Y.createCommentVNode("",!0)]),_:1},8,["title","visible","width"]),Y.createVNode(kn.ssDialog,{title:w.value,visible:U.value,width:L.value,onBeforeDestroy:ae[4]||(ae[4]=k=>U.value=!1)},{default:Y.withCtx(()=>[Y.createVNode(s3)]),footer:Y.withCtx(()=>[Y.createElementVNode("div",m3,[Y.createVNode(T,{onClick:ae[3]||(ae[3]=k=>U.value=!1),class:"cancel-button",id:"themeBorderButton"},{default:Y.withCtx(()=>ae[7]||(ae[7]=[Y.createTextVNode(Y.toDisplayString("取消"))])),_:1,__:[7]}),Y.createVNode(T,{class:"ok-button",onClick:it,id:"themeButton"},{default:Y.withCtx(()=>ae[8]||(ae[8]=[Y.createTextVNode(Y.toDisplayString("确认"))])),_:1,__:[8]})])]),_:1},8,["title","visible","width"]),a.value?(Y.openBlock(),Y.createBlock(kn.ssFilePreview,{key:0,fileDataList:o.value,onDestroy:Je},null,8,["fileDataList"])):Y.createCommentVNode("",!0)])}}},_3=gl._export_sfc(g3,[["__scopeId","data-v-86c96f8e"]]);exports.ACESFilmicToneMapping=Wh;exports.AmbientLight=Mu;exports.Box3=qn;exports.CatmullRomCurve3=mu;exports.Color=et;exports.Controls=Rp;exports.DirectionalLight=yu;exports.DoubleSide=un;exports.Euler=_n;exports.GridHelper=Cp;exports.HemisphereLight=vp;exports.MOUSE=Zu;exports.MathUtils=Xi;exports.Matrix4=st;exports.Mesh=Ct;exports.MeshPhongMaterial=Sn;exports.PCFSoftShadowMap=Gh;exports.PerspectiveCamera=an;exports.Plane=Ai;exports.PlaneGeometry=lr;exports.PointLight=xu;exports.Quaternion=Pn;exports.Ray=Us;exports.SRGBColorSpace=Tt;exports.Scene=Cl;exports.ShadowMaterial=tp;exports.Spherical=bu;exports.TOUCH=Qu;exports.TubeGeometry=Il;exports.Vector2=Be;exports.Vector3=F;exports.WebGLRenderer=dg;exports.Xe=zg;exports.ssTable=_3;exports.useFormToTableComp=Iu;exports.useModelLoader=Qg;exports.useTableComp=Vu;exports.useUnit=Fu;
|