ss-component-new 1.1.593 → 1.1.594
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/{index-BSLLZL_Z.cjs → index-B4LVTE2a.cjs} +37 -37
- package/dist/{index-CfkBrtB5.cjs → index-BEhahmXR.cjs} +1 -1
- package/dist/{index-SqYyqtY7.cjs → index-BGexqST8.cjs} +1 -1
- package/dist/{index-BrNZ6SJz.js → index-BKbJ3Myo.js} +4 -4
- package/dist/{index-D-VZWLpB.js → index-BNRTUsQy.js} +1 -1
- package/dist/{index-BtAaX4CF.js → index-B_wxih7J.js} +1 -1
- package/dist/{index-Ck9C82pQ.js → index-Bb1N38wE.js} +7 -7
- package/dist/{index-C6WJJSJN.cjs → index-Bn_QEmCm.cjs} +1 -1
- package/dist/{index-BEBZO2Xj.cjs → index-Boa9Jb6y.cjs} +1 -1
- package/dist/{index-CqFbq0Sk.js → index-CGjO9Rfc.js} +4 -4
- package/dist/index-CNdbKGOV.cjs +1 -0
- package/dist/{index-D-GfvBb0.js → index-CjrWmm5T.js} +679 -659
- package/dist/index-DL2wX-Yw.js +4369 -0
- package/dist/{index-B-Wj8Fp-.cjs → index-DLukDjc6.cjs} +1 -1
- package/dist/{index-CFqiQp_G.js → index-DbfXZuSO.js} +1 -1
- package/dist/{index-BGtOcXVg.cjs → index-DgYPrVNU.cjs} +1 -1
- package/dist/{index-3DI-7A9U.cjs → index-Dl_vrtf5.cjs} +1 -1
- package/dist/{index-D0JsHny0.cjs → index-DnfA7Rxr.cjs} +1 -1
- package/dist/{index-CFEUrpsL.cjs → index-Dsnvzj37.cjs} +1 -1
- package/dist/{index-DYUxG3lJ.js → index-DulzcrfM.js} +1 -1
- package/dist/{index-DHw_VNML.js → index-ROm5ioP3.js} +2 -2
- package/dist/{index-DOZk8RhQ.js → index-SjrPaSYH.js} +7 -7
- package/dist/{index-D7CFeFSq.js → index-XLsC4WVZ.js} +1 -1
- package/dist/{index-DhBhJWsX.js → index-iyd0ruQV.js} +1 -1
- package/dist/{index-DYwNxKAj.cjs → index-lXF4qZY4.cjs} +1 -1
- package/dist/{index-DR7P93x_.cjs → index-pPqGNFo4.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_b9f960ef_lang-BS45gOQM.js → index.vue_vue_type_style_index_0_scoped_b9f960ef_lang-CyEspjGE.js} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_b9f960ef_lang-CoETU3Hy.cjs → index.vue_vue_type_style_index_0_scoped_b9f960ef_lang-DftVwwth.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_c4f9c92c_lang-DzgbjLo-.cjs → index.vue_vue_type_style_index_0_scoped_c4f9c92c_lang-BYMPEqwE.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_c4f9c92c_lang-uk_Jwi07.js → index.vue_vue_type_style_index_0_scoped_c4f9c92c_lang-pTOrebig.js} +4 -4
- package/dist/{main-B3AvU1Qk.js → main-87EMw0ji.js} +2 -2
- package/dist/{main--AedcqcX.cjs → main-Dy2XBj6t.cjs} +1 -1
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.css +1 -1
- package/dist/ss-component.js +4 -4
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +7 -7
- package/dist/{threeModel-yIL96b5N.cjs → threeModel-DQIGp3UU.cjs} +1 -1
- package/dist/{threeModel-WNFRijN4.js → threeModel-WeRc8TWE.js} +1 -1
- package/package.json +1 -1
- package/dist/index-B8aHJcgZ.js +0 -4310
- package/dist/index-kuVn7V0L.cjs +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const J=require("vue"),ue=require("./menu-DYsWoy6Z.cjs"),jn=require("./index-DQm7DvqZ.cjs"),tu=require("./modelComp-8s0tWZDU.cjs"),Tn=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DXFzvQ4G.cjs"),El=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");var od="__lodash_hash_undefined__";function ld(r){return this.__data__.set(r,od),this}function cd(r){return this.__data__.has(r)}function ns(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new ue.MapCache;++e<t;)this.add(r[e])}ns.prototype.add=ns.prototype.push=ld;ns.prototype.has=cd;function hd(r,e){for(var t=-1,n=r==null?0:r.length;++t<n;)if(e(r[t],t,r))return!0;return!1}function nu(r,e){return r.has(e)}var ud=1,dd=2;function iu(r,e,t,n,i,s){var a=t&ud,o=r.length,l=e.length;if(o!=l&&!(a&&l>o))return!1;var c=s.get(r),h=s.get(e);if(c&&h)return c==e&&h==r;var u=-1,d=!0,f=t&dd?new ns:void 0;for(s.set(r,e),s.set(e,r);++u<o;){var m=r[u],_=e[u];if(n)var g=a?n(_,m,u,e,r,s):n(m,_,u,r,e,s);if(g!==void 0){if(g)continue;d=!1;break}if(f){if(!hd(e,function(p,S){if(!nu(f,S)&&(m===p||i(m,p,t,n,s)))return f.push(S)})){d=!1;break}}else if(!(m===_||i(m,_,t,n,s))){d=!1;break}}return s.delete(r),s.delete(e),d}function fd(r){var e=-1,t=Array(r.size);return r.forEach(function(n,i){t[++e]=[i,n]}),t}function ru(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t}var pd=1,md=2,gd="[object Boolean]",_d="[object Date]",vd="[object Error]",yd="[object Map]",xd="[object Number]",Md="[object RegExp]",bd="[object Set]",Sd="[object String]",Ed="[object Symbol]",Ad="[object ArrayBuffer]",wd="[object DataView]",ec=ue.Symbol?ue.Symbol.prototype:void 0,La=ec?ec.valueOf:void 0;function Td(r,e,t,n,i,s,a){switch(t){case wd:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case Ad:return!(r.byteLength!=e.byteLength||!s(new ue.Uint8Array(r),new ue.Uint8Array(e)));case gd:case _d:case xd:return ue.eq(+r,+e);case vd:return r.name==e.name&&r.message==e.message;case Md:case Sd:return r==e+"";case yd:var o=fd;case bd:var l=n&pd;if(o||(o=ru),r.size!=e.size&&!l)return!1;var c=a.get(r);if(c)return c==e;n|=md,a.set(r,e);var h=iu(o(r),o(e),n,i,s,a);return a.delete(r),h;case Ed:if(La)return La.call(r)==La.call(e)}return!1}var Cd=1,Rd=Object.prototype,Dd=Rd.hasOwnProperty;function Pd(r,e,t,n,i,s){var a=t&Cd,o=ue.getAllKeys(r),l=o.length,c=ue.getAllKeys(e),h=c.length;if(l!=h&&!a)return!1;for(var u=l;u--;){var d=o[u];if(!(a?d in e:Dd.call(e,d)))return!1}var f=s.get(r),m=s.get(e);if(f&&m)return f==e&&m==r;var _=!0;s.set(r,e),s.set(e,r);for(var g=a;++u<l;){d=o[u];var p=r[d],S=e[d];if(n)var E=a?n(S,p,d,e,r,s):n(p,S,d,r,e,s);if(!(E===void 0?p===S||i(p,S,t,n,s):E)){_=!1;break}g||(g=d=="constructor")}if(_&&!g){var v=r.constructor,N=e.constructor;v!=N&&"constructor"in r&&"constructor"in e&&!(typeof v=="function"&&v instanceof v&&typeof N=="function"&&N instanceof N)&&(_=!1)}return s.delete(r),s.delete(e),_}var Ld=1,tc="[object Arguments]",nc="[object Array]",ms="[object Object]",Id=Object.prototype,ic=Id.hasOwnProperty;function Nd(r,e,t,n,i,s){var a=ue.isArray(r),o=ue.isArray(e),l=a?nc:ue.getTag(r),c=o?nc:ue.getTag(e);l=l==tc?ms:l,c=c==tc?ms:c;var h=l==ms,u=c==ms,d=l==c;if(d&&ue.isBuffer(r)){if(!ue.isBuffer(e))return!1;a=!0,h=!1}if(d&&!h)return s||(s=new ue.Stack),a||ue.isTypedArray(r)?iu(r,e,t,n,i,s):Td(r,e,l,t,n,i,s);if(!(t&Ld)){var f=h&&ic.call(r,"__wrapped__"),m=u&&ic.call(e,"__wrapped__");if(f||m){var _=f?r.value():r,g=m?e.value():e;return s||(s=new ue.Stack),i(_,g,t,n,s)}}return d?(s||(s=new ue.Stack),Pd(r,e,t,n,i,s)):!1}function Al(r,e,t,n,i){return r===e?!0:r==null||e==null||!ue.isObjectLike(r)&&!ue.isObjectLike(e)?r!==r&&e!==e:Nd(r,e,t,n,Al,i)}function su(r,e){return Al(r,e)}const Ud={__name:"index",props:{isVisible:{type:Boolean,default:!1},title:{type:String,default:""},width:{type:Number,default:200}},setup(r){const e=r,t=J.ref(null),n=J.ref(!1),i=J.ref(null);return J.watch(()=>e==null?void 0:e.isVisible,()=>{n.value=e==null?void 0:e.isVisible},{deep:!0,immediate:!0}),J.watch(()=>i.value,()=>{J.nextTick(()=>{var s,a;(a=(s=t.value)==null?void 0:s.updatePopper)==null||a.call(s)})},{deep:!0,immediate:!0}),(s,a)=>{const o=J.resolveComponent("el-popover");return J.openBlock(),J.createBlock(o,{visible:n.value,placement:"bottom",title:e==null?void 0:e.title,width:e==null?void 0:e.width,ref_key:"popOverRef",ref:t},{reference:J.withCtx(()=>[J.createElementVNode("div",null,[J.renderSlot(s.$slots,"reference",{ref_key:"referenceRef",ref:i})])]),default:J.withCtx(()=>[J.createElementVNode("div",null,[J.renderSlot(s.$slots,"content")])]),_:3},8,["visible","title","width"])}}},Fd={class:"extra-button-content"},Od={class:"table-operator-wrap"},zd={key:0,class:"extra-header"},Bd=["onClick"],kd={class:"extra-button-filter"},Vd={class:"form-content-value"},Hd={__name:"header",props:{compName:{type:String,default:"表格名称",required:!1},buttons:{type:Array,default:()=>[]},columns:{type:Array,default:()=>[]}},emits:["buttonClick","filter"],setup(r,{emit:e}){const t=e,n=r,i=J.ref(!1),s=J.ref([]),a=J.ref([{label:"取消"},{label:"确认"}]),o=h=>{t("buttonClick",h)},l=h=>{var u,d;s.value=(d=(u=Tn.getColumnChild(ue.cloneDeep(h)))==null?void 0:u.filter(f=>(f==null?void 0:f.label)!==""&&(f==null?void 0:f.label)!=="操作"))==null?void 0:d.map(f=>({label:(f==null?void 0:f.label)??"",value:"",name:(f==null?void 0:f.label)??"",isFormColHidden:f==null?void 0:f.isTableColHidden}))},c=h=>{(h==null?void 0:h.buttonName)==="确认"&&t("filter",h==null?void 0:h.content),i.value=!1};return J.onMounted(()=>{l(n.columns)}),J.watch(()=>n.columns,()=>{l(n.columns)},{deep:!0,immediate:!0}),(h,u)=>{var f;const d=J.resolveComponent("el-tooltip");return J.openBlock(),J.createElementBlock("div",Fd,[J.createElementVNode("div",{class:J.normalizeClass(r.compName?"table-name-wrap":"")},J.toDisplayString(r.compName),3),J.createElementVNode("div",Od,[n!=null&&n.buttons&&((f=n==null?void 0:n.buttons)==null?void 0:f.length)>0?(J.openBlock(),J.createElementBlock("div",zd,[(J.openBlock(!0),J.createElementBlock(J.Fragment,null,J.renderList(n==null?void 0:n.buttons,(m,_)=>(J.openBlock(),J.createElementBlock("div",{class:"extra-contents",key:_},[J.createElementVNode("div",{class:"extra-content",style:J.normalizeStyle({background:(m==null?void 0:m.background)??"var(--ssbutton-theme-bg)",color:"var(--ssbutton-theme-color)"}),onClick:g=>o(m==null?void 0:m.label)},J.toDisplayString(m==null?void 0:m.label),13,Bd)]))),128))])):J.createCommentVNode("",!0),J.createElementVNode("div",kd,[J.createVNode(Ud,{title:"筛选数据",width:500,isVisible:i.value},{reference:J.withCtx(()=>[J.createVNode(d,{content:"筛选",placement:"top-start"},{default:J.withCtx(()=>[J.createElementVNode("div",{class:"button-style",onClick:u[0]||(u[0]=m=>i.value=!i.value)},[J.createVNode(J.unref(ue.filter_default),{color:"var(--ssComponent-black)"})])]),_:1})]),content:J.withCtx(()=>[J.createElementVNode("div",Vd,[(J.openBlock(),J.createBlock(jn.ssForm,{rowContents:s.value,buttonValue:a.value,isRowFlex:!0,isEnableWrap:!1,isButtonRow:!1,key:a.value,isStartJustify:!1,onOnButtonClick:c},null,8,["rowContents","buttonValue"]))])]),_:1},8,["isVisible"])])])])}}},Gd=El._export_sfc(Hd,[["__scopeId","data-v-74058ccc"]]);/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2010-2025 Three.js Authors
|
|
4
4
|
* SPDX-License-Identifier: MIT
|
|
5
|
-
*/const wl="177",Wd={ROTATE:0,DOLLY:1,PAN:2},Xd={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},qd=0,rc=1,jd=2,au=1,ou=2,hi=3,Hn=0,vn=1,pn=2,wi=0,Ar=1,sc=2,ac=3,oc=4,Yd=5,Vi=100,$d=101,Jd=102,Kd=103,Zd=104,Qd=200,ef=201,tf=202,nf=203,wo=204,To=205,rf=206,sf=207,af=208,of=209,lf=210,cf=211,hf=212,uf=213,df=214,Co=0,Ro=1,Do=2,Cr=3,Lo=4,Po=5,Io=6,No=7,ba=0,ff=1,pf=2,Ti=0,mf=1,gf=2,_f=3,lu=4,vf=5,yf=6,xf=7,lc="attached",Mf="detached",cu=300,Rr=301,Dr=302,Uo=303,Fo=304,Sa=306,$n=1e3,kn=1001,Oo=1002,Cn=1003,bf=1004,gs=1005,Tn=1006,Pa=1007,ui=1008,Qn=1009,hu=1010,uu=1011,is=1012,Tl=1013,qi=1014,Jn=1015,hs=1016,Cl=1017,Rl=1018,rs=1020,du=35902,fu=1021,pu=1022,Un=1023,ss=1026,as=1027,mu=1028,Dl=1029,gu=1030,Ll=1031,Pl=1033,ra=33776,sa=33777,aa=33778,oa=33779,zo=35840,Bo=35841,ko=35842,Vo=35843,Ho=36196,Go=37492,Wo=37496,Xo=37808,qo=37809,jo=37810,Yo=37811,$o=37812,Jo=37813,Ko=37814,Zo=37815,Qo=37816,el=37817,tl=37818,nl=37819,il=37820,rl=37821,la=36492,sl=36494,al=36495,_u=36283,ol=36284,ll=36285,cl=36286,fa=2300,hl=2301,Ia=2302,cc=2400,hc=2401,uc=2402,Sf=2500,Ef=3200,Af=3201,Ea=0,wf=1,Ai="",Tt="srgb",Lr="srgb-linear",pa="linear",Nt="srgb",rr=7680,dc=519,Tf=512,Cf=513,Rf=514,vu=515,Df=516,Lf=517,Pf=518,If=519,ul=35044,fc="300 es",di=2e3,ma=2001;class $i{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 s=i.indexOf(t);s!==-1&&i.splice(s,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 s=0,a=i.length;s<a;s++)i[s].call(this,e);e.target=null}}}const dn=["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 pc=1234567;const Kr=Math.PI/180,Pr=180/Math.PI;function Vn(){const r=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(dn[r&255]+dn[r>>8&255]+dn[r>>16&255]+dn[r>>24&255]+"-"+dn[e&255]+dn[e>>8&255]+"-"+dn[e>>16&15|64]+dn[e>>24&255]+"-"+dn[t&63|128]+dn[t>>8&255]+"-"+dn[t>>16&255]+dn[t>>24&255]+dn[n&255]+dn[n>>8&255]+dn[n>>16&255]+dn[n>>24&255]).toLowerCase()}function vt(r,e,t){return Math.max(e,Math.min(t,r))}function Il(r,e){return(r%e+e)%e}function Nf(r,e,t,n,i){return n+(r-e)*(i-n)/(t-e)}function Uf(r,e,t){return r!==e?(t-r)/(e-r):0}function Zr(r,e,t){return(1-t)*r+t*e}function Ff(r,e,t,n){return Zr(r,e,1-Math.exp(-t*n))}function Of(r,e=1){return e-Math.abs(Il(r,e*2)-e)}function zf(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function Bf(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))}function kf(r,e){return r+Math.floor(Math.random()*(e-r+1))}function Vf(r,e){return r+Math.random()*(e-r)}function Hf(r){return r*(.5-Math.random())}function Gf(r){r!==void 0&&(pc=r);let e=pc+=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 Wf(r){return r*Kr}function Xf(r){return r*Pr}function qf(r){return(r&r-1)===0&&r!==0}function jf(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function Yf(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function $f(r,e,t,n,i){const s=Math.cos,a=Math.sin,o=s(t/2),l=a(t/2),c=s((e+n)/2),h=a((e+n)/2),u=s((e-n)/2),d=a((e-n)/2),f=s((n-e)/2),m=a((n-e)/2);switch(i){case"XYX":r.set(o*h,l*u,l*d,o*c);break;case"YZY":r.set(l*d,o*h,l*u,o*c);break;case"ZXZ":r.set(l*u,l*d,o*h,o*c);break;case"XZX":r.set(o*h,l*m,l*f,o*c);break;case"YXY":r.set(l*f,o*h,l*m,o*c);break;case"ZYZ":r.set(l*m,l*f,o*h,o*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Bn(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return r/4294967295;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int32Array:return Math.max(r/2147483647,-1);case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("Invalid component type.")}}function It(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return Math.round(r*4294967295);case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int32Array:return Math.round(r*2147483647);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);default:throw new Error("Invalid component type.")}}const Hi={DEG2RAD:Kr,RAD2DEG:Pr,generateUUID:Vn,clamp:vt,euclideanModulo:Il,mapLinear:Nf,inverseLerp:Uf,lerp:Zr,damp:Ff,pingpong:Of,smoothstep:zf,smootherstep:Bf,randInt:kf,randFloat:Vf,randFloatSpread:Hf,seededRandom:Gf,degToRad:Wf,radToDeg:Xf,isPowerOfTwo:qf,ceilPowerOfTwo:jf,floorPowerOfTwo:Yf,setQuaternionFromProperEuler:$f,normalize:It,denormalize:Bn};class Ge{constructor(e=0,t=0){Ge.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),s=this.x-e.x,a=this.y-e.y;return this.x=s*n-a*i+e.x,this.y=s*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 Rn{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,s,a,o){let l=n[i+0],c=n[i+1],h=n[i+2],u=n[i+3];const d=s[a+0],f=s[a+1],m=s[a+2],_=s[a+3];if(o===0){e[t+0]=l,e[t+1]=c,e[t+2]=h,e[t+3]=u;return}if(o===1){e[t+0]=d,e[t+1]=f,e[t+2]=m,e[t+3]=_;return}if(u!==_||l!==d||c!==f||h!==m){let g=1-o;const p=l*d+c*f+h*m+u*_,S=p>=0?1:-1,E=1-p*p;if(E>Number.EPSILON){const N=Math.sqrt(E),C=Math.atan2(N,p*S);g=Math.sin(g*C)/N,o=Math.sin(o*C)/N}const v=o*S;if(l=l*g+d*v,c=c*g+f*v,h=h*g+m*v,u=u*g+_*v,g===1-o){const N=1/Math.sqrt(l*l+c*c+h*h+u*u);l*=N,c*=N,h*=N,u*=N}}e[t]=l,e[t+1]=c,e[t+2]=h,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,i,s,a){const o=n[i],l=n[i+1],c=n[i+2],h=n[i+3],u=s[a],d=s[a+1],f=s[a+2],m=s[a+3];return e[t]=o*m+h*u+l*f-c*d,e[t+1]=l*m+h*d+c*u-o*f,e[t+2]=c*m+h*f+o*d-l*u,e[t+3]=h*m-o*u-l*d-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,s=e._z,a=e._order,o=Math.cos,l=Math.sin,c=o(n/2),h=o(i/2),u=o(s/2),d=l(n/2),f=l(i/2),m=l(s/2);switch(a){case"XYZ":this._x=d*h*u+c*f*m,this._y=c*f*u-d*h*m,this._z=c*h*m+d*f*u,this._w=c*h*u-d*f*m;break;case"YXZ":this._x=d*h*u+c*f*m,this._y=c*f*u-d*h*m,this._z=c*h*m-d*f*u,this._w=c*h*u+d*f*m;break;case"ZXY":this._x=d*h*u-c*f*m,this._y=c*f*u+d*h*m,this._z=c*h*m+d*f*u,this._w=c*h*u-d*f*m;break;case"ZYX":this._x=d*h*u-c*f*m,this._y=c*f*u+d*h*m,this._z=c*h*m-d*f*u,this._w=c*h*u+d*f*m;break;case"YZX":this._x=d*h*u+c*f*m,this._y=c*f*u+d*h*m,this._z=c*h*m-d*f*u,this._w=c*h*u-d*f*m;break;case"XZY":this._x=d*h*u-c*f*m,this._y=c*f*u-d*h*m,this._z=c*h*m+d*f*u,this._w=c*h*u+d*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],s=t[8],a=t[1],o=t[5],l=t[9],c=t[2],h=t[6],u=t[10],d=n+o+u;if(d>0){const f=.5/Math.sqrt(d+1);this._w=.25/f,this._x=(h-l)*f,this._y=(s-c)*f,this._z=(a-i)*f}else if(n>o&&n>u){const f=2*Math.sqrt(1+n-o-u);this._w=(h-l)/f,this._x=.25*f,this._y=(i+a)/f,this._z=(s+c)/f}else if(o>u){const f=2*Math.sqrt(1+o-n-u);this._w=(s-c)/f,this._x=(i+a)/f,this._y=.25*f,this._z=(l+h)/f}else{const f=2*Math.sqrt(1+u-n-o);this._w=(a-i)/f,this._x=(s+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,s=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-s*l,this._y=i*h+a*l+s*o-n*c,this._z=s*h+a*c+n*l-i*o,this._w=a*h-n*o-i*l-s*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,s=this._z,a=this._w;let o=a*e._w+n*e._x+i*e._y+s*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=s,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*s+t*this._z,this.normalize(),this}const c=Math.sqrt(l),h=Math.atan2(c,o),u=Math.sin((1-t)*h)/c,d=Math.sin(t*h)/c;return this._w=a*u+this._w*d,this._x=n*u+this._x*d,this._y=i*u+this._y*d,this._z=s*u+this._z*d,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),s=Math.sqrt(n);return this.set(i*Math.sin(e),i*Math.cos(e),s*Math.sin(t),s*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(mc.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(mc.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*i,this.y=s[1]*t+s[4]*n+s[7]*i,this.z=s[2]*t+s[5]*n+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,s=e.elements,a=1/(s[3]*t+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*i+s[12])*a,this.y=(s[1]*t+s[5]*n+s[9]*i+s[13])*a,this.z=(s[2]*t+s[6]*n+s[10]*i+s[14])*a,this}applyQuaternion(e){const t=this.x,n=this.y,i=this.z,s=e.x,a=e.y,o=e.z,l=e.w,c=2*(a*i-o*n),h=2*(o*t-s*i),u=2*(s*n-a*t);return this.x=t+l*c+a*u-o*h,this.y=n+l*h+o*c-s*u,this.z=i+l*u+s*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,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i,this.y=s[1]*t+s[5]*n+s[9]*i,this.z=s[2]*t+s[6]*n+s[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,s=e.z,a=t.x,o=t.y,l=t.z;return this.x=i*l-s*o,this.y=s*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 Na.copy(this).projectOnVector(e),this.sub(Na)}reflect(e){return this.sub(Na.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 Na=new F,mc=new Rn;class _t{constructor(e,t,n,i,s,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,s,a,o,l,c)}set(e,t,n,i,s,a,o,l,c){const h=this.elements;return h[0]=e,h[1]=i,h[2]=o,h[3]=t,h[4]=s,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,s=this.elements,a=n[0],o=n[3],l=n[6],c=n[1],h=n[4],u=n[7],d=n[2],f=n[5],m=n[8],_=i[0],g=i[3],p=i[6],S=i[1],E=i[4],v=i[7],N=i[2],C=i[5],T=i[8];return s[0]=a*_+o*S+l*N,s[3]=a*g+o*E+l*C,s[6]=a*p+o*v+l*T,s[1]=c*_+h*S+u*N,s[4]=c*g+h*E+u*C,s[7]=c*p+h*v+u*T,s[2]=d*_+f*S+m*N,s[5]=d*g+f*E+m*C,s[8]=d*p+f*v+m*T,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],s=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*s*h+n*o*l+i*s*c-i*a*l}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8],u=h*a-o*c,d=o*l-h*s,f=c*s-a*l,m=t*u+n*d+i*f;if(m===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/m;return e[0]=u*_,e[1]=(i*c-h*n)*_,e[2]=(o*n-i*a)*_,e[3]=d*_,e[4]=(h*t-i*l)*_,e[5]=(i*s-o*t)*_,e[6]=f*_,e[7]=(n*l-c*t)*_,e[8]=(a*t-n*s)*_,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,s,a,o){const l=Math.cos(s),c=Math.sin(s);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(Ua.makeScale(e,t)),this}rotate(e){return this.premultiply(Ua.makeRotation(-e)),this}translate(e,t){return this.premultiply(Ua.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 Ua=new _t;function yu(r){for(let e=r.length-1;e>=0;--e)if(r[e]>=65535)return!0;return!1}function os(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function Jf(){const r=os("canvas");return r.style.display="block",r}const gc={};function wr(r){r in gc||(gc[r]=!0,console.warn(r))}function Kf(r,e,t){return new Promise(function(n,i){function s(){switch(r.clientWaitSync(e,r.SYNC_FLUSH_COMMANDS_BIT,0)){case r.WAIT_FAILED:i();break;case r.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:n()}}setTimeout(s,t)})}function Zf(r){const e=r.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 Qf(r){const e=r.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const _c=new _t().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),vc=new _t().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function ep(){const r={enabled:!0,workingColorSpace:Lr,spaces:{},convert:function(i,s,a){return this.enabled===!1||s===a||!s||!a||(this.spaces[s].transfer===Nt&&(i.r=fi(i.r),i.g=fi(i.g),i.b=fi(i.b)),this.spaces[s].primaries!==this.spaces[a].primaries&&(i.applyMatrix3(this.spaces[s].toXYZ),i.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===Nt&&(i.r=Tr(i.r),i.g=Tr(i.g),i.b=Tr(i.b))),i},workingToColorSpace:function(i,s){return this.convert(i,this.workingColorSpace,s)},colorSpaceToWorking:function(i,s){return this.convert(i,s,this.workingColorSpace)},getPrimaries:function(i){return this.spaces[i].primaries},getTransfer:function(i){return i===Ai?pa:this.spaces[i].transfer},getLuminanceCoefficients:function(i,s=this.workingColorSpace){return i.fromArray(this.spaces[s].luminanceCoefficients)},define:function(i){Object.assign(this.spaces,i)},_getMatrix:function(i,s,a){return i.copy(this.spaces[s].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,s){return wr("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),r.workingToColorSpace(i,s)},toWorkingColorSpace:function(i,s){return wr("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),r.colorSpaceToWorking(i,s)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],n=[.3127,.329];return r.define({[Lr]:{primaries:e,whitePoint:n,transfer:pa,toXYZ:_c,fromXYZ:vc,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Tt},outputColorSpaceConfig:{drawingBufferColorSpace:Tt}},[Tt]:{primaries:e,whitePoint:n,transfer:Nt,toXYZ:_c,fromXYZ:vc,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Tt}}}),r}const xt=ep();function fi(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function Tr(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}let sr;class tp{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{sr===void 0&&(sr=os("canvas")),sr.width=e.width,sr.height=e.height;const i=sr.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),n=sr}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=os("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),s=i.data;for(let a=0;a<s.length;a++)s[a]=fi(s[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(fi(t[n]/255)*255):t[n]=fi(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 np=0;class Nl{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:np++}),this.uuid=Vn(),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 s;if(Array.isArray(i)){s=[];for(let a=0,o=i.length;a<o;a++)i[a].isDataTexture?s.push(Fa(i[a].image)):s.push(Fa(i[a]))}else s=Fa(i);n.url=s}return t||(e.images[this.uuid]=n),n}}function Fa(r){return typeof HTMLImageElement<"u"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&r instanceof ImageBitmap?tp.getDataURL(r):r.data?{data:Array.from(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let ip=0;const Oa=new F;class cn extends $i{constructor(e=cn.DEFAULT_IMAGE,t=cn.DEFAULT_MAPPING,n=kn,i=kn,s=Tn,a=ui,o=Un,l=Qn,c=cn.DEFAULT_ANISOTROPY,h=Ai){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:ip++}),this.uuid=Vn(),this.name="",this.source=new Nl(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=a,this.anisotropy=c,this.format=o,this.internalFormat=null,this.type=l,this.offset=new Ge(0,0),this.repeat=new Ge(1,1),this.center=new Ge(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(Oa).x}get height(){return this.source.getSize(Oa).y}get depth(){return this.source.getSize(Oa).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!==cu)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case $n:e.x=e.x-Math.floor(e.x);break;case kn:e.x=e.x<0?0:1;break;case Oo: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 $n:e.y=e.y-Math.floor(e.y);break;case kn:e.y=e.y<0?0:1;break;case Oo: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++}}cn.DEFAULT_IMAGE=null;cn.DEFAULT_MAPPING=cu;cn.DEFAULT_ANISOTROPY=1;class Mt{constructor(e=0,t=0,n=0,i=1){Mt.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,s=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*i+a[12]*s,this.y=a[1]*t+a[5]*n+a[9]*i+a[13]*s,this.z=a[2]*t+a[6]*n+a[10]*i+a[14]*s,this.w=a[3]*t+a[7]*n+a[11]*i+a[15]*s,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,s;const l=e.elements,c=l[0],h=l[4],u=l[8],d=l[1],f=l[5],m=l[9],_=l[2],g=l[6],p=l[10];if(Math.abs(h-d)<.01&&Math.abs(u-_)<.01&&Math.abs(m-g)<.01){if(Math.abs(h+d)<.1&&Math.abs(u+_)<.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,v=(f+1)/2,N=(p+1)/2,C=(h+d)/4,T=(u+_)/4,P=(m+g)/4;return E>v&&E>N?E<.01?(n=0,i=.707106781,s=.707106781):(n=Math.sqrt(E),i=C/n,s=T/n):v>N?v<.01?(n=.707106781,i=0,s=.707106781):(i=Math.sqrt(v),n=C/i,s=P/i):N<.01?(n=.707106781,i=.707106781,s=0):(s=Math.sqrt(N),n=T/s,i=P/s),this.set(n,i,s,t),this}let S=Math.sqrt((g-m)*(g-m)+(u-_)*(u-_)+(d-h)*(d-h));return Math.abs(S)<.001&&(S=1),this.x=(g-m)/S,this.y=(u-_)/S,this.z=(d-h)/S,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 rp extends $i{constructor(e=1,t=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Tn,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 Mt(0,0,e,t),this.scissorTest=!1,this.viewport=new Mt(0,0,e,t);const i={width:e,height:t,depth:n.depth},s=new cn(i);this.textures=[];const a=n.count;for(let o=0;o<a;o++)this.textures[o]=s.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:Tn,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,s=this.textures.length;i<s;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 Nl(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 rp{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class xu extends cn{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=Cn,this.minFilter=Cn,this.wrapR=kn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class sp extends cn{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=Cn,this.minFilter=Cn,this.wrapR=kn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class ei{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(Fn.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(Fn.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=Fn.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 s=n.getAttribute("position");if(t===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let a=0,o=s.count;a<o;a++)e.isMesh===!0?e.getVertexPosition(a,Fn):Fn.fromBufferAttribute(s,a),Fn.applyMatrix4(e.matrixWorld),this.expandByPoint(Fn);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),_s.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),_s.copy(n.boundingBox)),_s.applyMatrix4(e.matrixWorld),this.union(_s)}const i=e.children;for(let s=0,a=i.length;s<a;s++)this.expandByObject(i[s],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,Fn),Fn.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(kr),vs.subVectors(this.max,kr),ar.subVectors(e.a,kr),or.subVectors(e.b,kr),lr.subVectors(e.c,kr),_i.subVectors(or,ar),vi.subVectors(lr,or),Pi.subVectors(ar,lr);let t=[0,-_i.z,_i.y,0,-vi.z,vi.y,0,-Pi.z,Pi.y,_i.z,0,-_i.x,vi.z,0,-vi.x,Pi.z,0,-Pi.x,-_i.y,_i.x,0,-vi.y,vi.x,0,-Pi.y,Pi.x,0];return!za(t,ar,or,lr,vs)||(t=[1,0,0,0,1,0,0,0,1],!za(t,ar,or,lr,vs))?!1:(ys.crossVectors(_i,vi),t=[ys.x,ys.y,ys.z],za(t,ar,or,lr,vs))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Fn).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Fn).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],Fn=new F,_s=new ei,ar=new F,or=new F,lr=new F,_i=new F,vi=new F,Pi=new F,kr=new F,vs=new F,ys=new F,Ii=new F;function za(r,e,t,n,i){for(let s=0,a=r.length-3;s<=a;s+=3){Ii.fromArray(r,s);const o=i.x*Math.abs(Ii.x)+i.y*Math.abs(Ii.y)+i.z*Math.abs(Ii.z),l=e.dot(Ii),c=t.dot(Ii),h=n.dot(Ii);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>o)return!1}return!0}const ap=new ei,Vr=new F,Ba=new F;class mi{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):ap.setFromPoints(e).getCenter(n);let i=0;for(let s=0,a=e.length;s<a;s++)i=Math.max(i,n.distanceToSquared(e[s]));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;Vr.subVectors(e,this.center);const t=Vr.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.addScaledVector(Vr,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):(Ba.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Vr.copy(e.center).add(Ba)),this.expandByPoint(Vr.copy(e.center).sub(Ba))),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 si=new F,ka=new F,xs=new F,yi=new F,Va=new F,Ms=new F,Ha=new F;class Ur{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,si)),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=si.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(si.copy(this.origin).addScaledVector(this.direction,t),si.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){ka.copy(e).add(t).multiplyScalar(.5),xs.copy(t).sub(e).normalize(),yi.copy(this.origin).sub(ka);const s=e.distanceTo(t)*.5,a=-this.direction.dot(xs),o=yi.dot(this.direction),l=-yi.dot(xs),c=yi.lengthSq(),h=Math.abs(1-a*a);let u,d,f,m;if(h>0)if(u=a*l-o,d=a*o-l,m=s*h,u>=0)if(d>=-m)if(d<=m){const _=1/h;u*=_,d*=_,f=u*(u+a*d+2*o)+d*(a*u+d+2*l)+c}else d=s,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*l)+c;else d=-s,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*l)+c;else d<=-m?(u=Math.max(0,-(-a*s+o)),d=u>0?-s:Math.min(Math.max(-s,-l),s),f=-u*u+d*(d+2*l)+c):d<=m?(u=0,d=Math.min(Math.max(-s,-l),s),f=d*(d+2*l)+c):(u=Math.max(0,-(a*s+o)),d=u>0?s:Math.min(Math.max(-s,-l),s),f=-u*u+d*(d+2*l)+c);else d=a>0?-s:s,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,u),i&&i.copy(ka).addScaledVector(xs,d),f}intersectSphere(e,t){si.subVectors(e.center,this.origin);const n=si.dot(this.direction),i=si.dot(si)-n*n,s=e.radius*e.radius;if(i>s)return null;const a=Math.sqrt(s-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,s,a,o,l;const c=1/this.direction.x,h=1/this.direction.y,u=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,i=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,i=(e.min.x-d.x)*c),h>=0?(s=(e.min.y-d.y)*h,a=(e.max.y-d.y)*h):(s=(e.max.y-d.y)*h,a=(e.min.y-d.y)*h),n>a||s>i||((s>n||isNaN(n))&&(n=s),(a<i||isNaN(i))&&(i=a),u>=0?(o=(e.min.z-d.z)*u,l=(e.max.z-d.z)*u):(o=(e.max.z-d.z)*u,l=(e.min.z-d.z)*u),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,si)!==null}intersectTriangle(e,t,n,i,s){Va.subVectors(t,e),Ms.subVectors(n,e),Ha.crossVectors(Va,Ms);let a=this.direction.dot(Ha),o;if(a>0){if(i)return null;o=1}else if(a<0)o=-1,a=-a;else return null;yi.subVectors(this.origin,e);const l=o*this.direction.dot(Ms.crossVectors(yi,Ms));if(l<0)return null;const c=o*this.direction.dot(Va.cross(yi));if(c<0||l+c>a)return null;const h=-o*yi.dot(Ha);return h<0?null:this.at(h/a,s)}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 lt{constructor(e,t,n,i,s,a,o,l,c,h,u,d,f,m,_,g){lt.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,s,a,o,l,c,h,u,d,f,m,_,g)}set(e,t,n,i,s,a,o,l,c,h,u,d,f,m,_,g){const p=this.elements;return p[0]=e,p[4]=t,p[8]=n,p[12]=i,p[1]=s,p[5]=a,p[9]=o,p[13]=l,p[2]=c,p[6]=h,p[10]=u,p[14]=d,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 lt().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/cr.setFromMatrixColumn(e,0).length(),s=1/cr.setFromMatrixColumn(e,1).length(),a=1/cr.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]*s,t[5]=n[5]*s,t[6]=n[6]*s,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,s=e.z,a=Math.cos(n),o=Math.sin(n),l=Math.cos(i),c=Math.sin(i),h=Math.cos(s),u=Math.sin(s);if(e.order==="XYZ"){const d=a*h,f=a*u,m=o*h,_=o*u;t[0]=l*h,t[4]=-l*u,t[8]=c,t[1]=f+m*c,t[5]=d-_*c,t[9]=-o*l,t[2]=_-d*c,t[6]=m+f*c,t[10]=a*l}else if(e.order==="YXZ"){const d=l*h,f=l*u,m=c*h,_=c*u;t[0]=d+_*o,t[4]=m*o-f,t[8]=a*c,t[1]=a*u,t[5]=a*h,t[9]=-o,t[2]=f*o-m,t[6]=_+d*o,t[10]=a*l}else if(e.order==="ZXY"){const d=l*h,f=l*u,m=c*h,_=c*u;t[0]=d-_*o,t[4]=-a*u,t[8]=m+f*o,t[1]=f+m*o,t[5]=a*h,t[9]=_-d*o,t[2]=-a*c,t[6]=o,t[10]=a*l}else if(e.order==="ZYX"){const d=a*h,f=a*u,m=o*h,_=o*u;t[0]=l*h,t[4]=m*c-f,t[8]=d*c+_,t[1]=l*u,t[5]=_*c+d,t[9]=f*c-m,t[2]=-c,t[6]=o*l,t[10]=a*l}else if(e.order==="YZX"){const d=a*l,f=a*c,m=o*l,_=o*c;t[0]=l*h,t[4]=_-d*u,t[8]=m*u+f,t[1]=u,t[5]=a*h,t[9]=-o*h,t[2]=-c*h,t[6]=f*u+m,t[10]=d-_*u}else if(e.order==="XZY"){const d=a*l,f=a*c,m=o*l,_=o*c;t[0]=l*h,t[4]=-u,t[8]=c*h,t[1]=d*u+_,t[5]=a*h,t[9]=f*u-m,t[2]=m*u-f,t[6]=o*h,t[10]=_*u+d}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(op,e,lp)}lookAt(e,t,n){const i=this.elements;return An.subVectors(e,t),An.lengthSq()===0&&(An.z=1),An.normalize(),xi.crossVectors(n,An),xi.lengthSq()===0&&(Math.abs(n.z)===1?An.x+=1e-4:An.z+=1e-4,An.normalize(),xi.crossVectors(n,An)),xi.normalize(),bs.crossVectors(An,xi),i[0]=xi.x,i[4]=bs.x,i[8]=An.x,i[1]=xi.y,i[5]=bs.y,i[9]=An.y,i[2]=xi.z,i[6]=bs.z,i[10]=An.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,s=this.elements,a=n[0],o=n[4],l=n[8],c=n[12],h=n[1],u=n[5],d=n[9],f=n[13],m=n[2],_=n[6],g=n[10],p=n[14],S=n[3],E=n[7],v=n[11],N=n[15],C=i[0],T=i[4],P=i[8],b=i[12],x=i[1],R=i[5],B=i[9],V=i[13],W=i[2],ee=i[6],k=i[10],Q=i[14],q=i[3],ue=i[7],ye=i[11],le=i[15];return s[0]=a*C+o*x+l*W+c*q,s[4]=a*T+o*R+l*ee+c*ue,s[8]=a*P+o*B+l*k+c*ye,s[12]=a*b+o*V+l*Q+c*le,s[1]=h*C+u*x+d*W+f*q,s[5]=h*T+u*R+d*ee+f*ue,s[9]=h*P+u*B+d*k+f*ye,s[13]=h*b+u*V+d*Q+f*le,s[2]=m*C+_*x+g*W+p*q,s[6]=m*T+_*R+g*ee+p*ue,s[10]=m*P+_*B+g*k+p*ye,s[14]=m*b+_*V+g*Q+p*le,s[3]=S*C+E*x+v*W+N*q,s[7]=S*T+E*R+v*ee+N*ue,s[11]=S*P+E*B+v*k+N*ye,s[15]=S*b+E*V+v*Q+N*le,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],s=e[12],a=e[1],o=e[5],l=e[9],c=e[13],h=e[2],u=e[6],d=e[10],f=e[14],m=e[3],_=e[7],g=e[11],p=e[15];return m*(+s*l*u-i*c*u-s*o*d+n*c*d+i*o*f-n*l*f)+_*(+t*l*f-t*c*d+s*a*d-i*a*f+i*c*h-s*l*h)+g*(+t*c*u-t*o*f-s*a*u+n*a*f+s*o*h-n*c*h)+p*(-i*o*h-t*l*u+t*o*d+i*a*u-n*a*d+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],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8],u=e[9],d=e[10],f=e[11],m=e[12],_=e[13],g=e[14],p=e[15],S=u*g*c-_*d*c+_*l*f-o*g*f-u*l*p+o*d*p,E=m*d*c-h*g*c-m*l*f+a*g*f+h*l*p-a*d*p,v=h*_*c-m*u*c+m*o*f-a*_*f-h*o*p+a*u*p,N=m*u*l-h*_*l-m*o*d+a*_*d+h*o*g-a*u*g,C=t*S+n*E+i*v+s*N;if(C===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const T=1/C;return e[0]=S*T,e[1]=(_*d*s-u*g*s-_*i*f+n*g*f+u*i*p-n*d*p)*T,e[2]=(o*g*s-_*l*s+_*i*c-n*g*c-o*i*p+n*l*p)*T,e[3]=(u*l*s-o*d*s-u*i*c+n*d*c+o*i*f-n*l*f)*T,e[4]=E*T,e[5]=(h*g*s-m*d*s+m*i*f-t*g*f-h*i*p+t*d*p)*T,e[6]=(m*l*s-a*g*s-m*i*c+t*g*c+a*i*p-t*l*p)*T,e[7]=(a*d*s-h*l*s+h*i*c-t*d*c-a*i*f+t*l*f)*T,e[8]=v*T,e[9]=(m*u*s-h*_*s-m*n*f+t*_*f+h*n*p-t*u*p)*T,e[10]=(a*_*s-m*o*s+m*n*c-t*_*c-a*n*p+t*o*p)*T,e[11]=(h*o*s-a*u*s-h*n*c+t*u*c+a*n*f-t*o*f)*T,e[12]=N*T,e[13]=(h*_*i-m*u*i+m*n*d-t*_*d-h*n*g+t*u*g)*T,e[14]=(m*o*i-a*_*i-m*n*l+t*_*l+a*n*g-t*o*g)*T,e[15]=(a*u*i-h*o*i+h*n*l-t*u*l-a*n*d+t*o*d)*T,this}scale(e){const t=this.elements,n=e.x,i=e.y,s=e.z;return t[0]*=n,t[4]*=i,t[8]*=s,t[1]*=n,t[5]*=i,t[9]*=s,t[2]*=n,t[6]*=i,t[10]*=s,t[3]*=n,t[7]*=i,t[11]*=s,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),s=1-n,a=e.x,o=e.y,l=e.z,c=s*a,h=s*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,s*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,s,a){return this.set(1,n,s,0,e,1,a,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,s=t._x,a=t._y,o=t._z,l=t._w,c=s+s,h=a+a,u=o+o,d=s*c,f=s*h,m=s*u,_=a*h,g=a*u,p=o*u,S=l*c,E=l*h,v=l*u,N=n.x,C=n.y,T=n.z;return i[0]=(1-(_+p))*N,i[1]=(f+v)*N,i[2]=(m-E)*N,i[3]=0,i[4]=(f-v)*C,i[5]=(1-(d+p))*C,i[6]=(g+S)*C,i[7]=0,i[8]=(m+E)*T,i[9]=(g-S)*T,i[10]=(1-(d+_))*T,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 s=cr.set(i[0],i[1],i[2]).length();const a=cr.set(i[4],i[5],i[6]).length(),o=cr.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],On.copy(this);const c=1/s,h=1/a,u=1/o;return On.elements[0]*=c,On.elements[1]*=c,On.elements[2]*=c,On.elements[4]*=h,On.elements[5]*=h,On.elements[6]*=h,On.elements[8]*=u,On.elements[9]*=u,On.elements[10]*=u,t.setFromRotationMatrix(On),n.x=s,n.y=a,n.z=o,this}makePerspective(e,t,n,i,s,a,o=di){const l=this.elements,c=2*s/(t-e),h=2*s/(n-i),u=(t+e)/(t-e),d=(n+i)/(n-i);let f,m;if(o===di)f=-(a+s)/(a-s),m=-2*a*s/(a-s);else if(o===ma)f=-a/(a-s),m=-a*s/(a-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return l[0]=c,l[4]=0,l[8]=u,l[12]=0,l[1]=0,l[5]=h,l[9]=d,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,s,a,o=di){const l=this.elements,c=1/(t-e),h=1/(n-i),u=1/(a-s),d=(t+e)*c,f=(n+i)*h;let m,_;if(o===di)m=(a+s)*u,_=-2*u;else if(o===ma)m=s*u,_=-1*u;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-d,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 cr=new F,On=new lt,op=new F(0,0,0),lp=new F(1,1,1),xi=new F,bs=new F,An=new F,yc=new lt,xc=new Rn;class yn{constructor(e=0,t=0,n=0,i=yn.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,s=i[0],a=i[4],o=i[8],l=i[1],c=i[5],h=i[9],u=i[2],d=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,s)):(this._x=Math.atan2(d,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(-u,s),this._z=0);break;case"ZXY":this._x=Math.asin(vt(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,f),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-vt(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(l,s)):(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(-u,s)):(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(d,c),this._y=Math.atan2(o,s)):(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 yc.makeRotationFromQuaternion(e),this.setFromRotationMatrix(yc,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return xc.setFromEuler(this),this.setFromQuaternion(xc,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}}yn.DEFAULT_ORDER="XYZ";class Ul{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 cp=0;const Mc=new F,hr=new Rn,ai=new lt,Ss=new F,Hr=new F,hp=new F,up=new Rn,bc=new F(1,0,0),Sc=new F(0,1,0),Ec=new F(0,0,1),Ac={type:"added"},dp={type:"removed"},ur={type:"childadded",child:null},Ga={type:"childremoved",child:null};class Ut extends $i{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:cp++}),this.uuid=Vn(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Ut.DEFAULT_UP.clone();const e=new F,t=new yn,n=new Rn,i=new F(1,1,1);function s(){n.setFromEuler(t,!1)}function a(){t.setFromQuaternion(n,void 0,!1)}t._onChange(s),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 lt},normalMatrix:{value:new _t}}),this.matrix=new lt,this.matrixWorld=new lt,this.matrixAutoUpdate=Ut.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Ut.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Ul,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 hr.setFromAxisAngle(e,t),this.quaternion.multiply(hr),this}rotateOnWorldAxis(e,t){return hr.setFromAxisAngle(e,t),this.quaternion.premultiply(hr),this}rotateX(e){return this.rotateOnAxis(bc,e)}rotateY(e){return this.rotateOnAxis(Sc,e)}rotateZ(e){return this.rotateOnAxis(Ec,e)}translateOnAxis(e,t){return Mc.copy(e).applyQuaternion(this.quaternion),this.position.add(Mc.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(bc,e)}translateY(e){return this.translateOnAxis(Sc,e)}translateZ(e){return this.translateOnAxis(Ec,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(ai.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?Ss.copy(e):Ss.set(e,t,n);const i=this.parent;this.updateWorldMatrix(!0,!1),Hr.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?ai.lookAt(Hr,Ss,this.up):ai.lookAt(Ss,Hr,this.up),this.quaternion.setFromRotationMatrix(ai),i&&(ai.extractRotation(i.matrixWorld),hr.setFromRotationMatrix(ai),this.quaternion.premultiply(hr.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(Ac),ur.child=e,this.dispatchEvent(ur),ur.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(dp),Ga.child=e,this.dispatchEvent(Ga),Ga.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),ai.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),ai.multiply(e.parent.matrixWorld)),e.applyMatrix4(ai),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(Ac),ur.child=e,this.dispatchEvent(ur),ur.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 s=0,a=i.length;s<a;s++)i[s].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(Hr,e,hp),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Hr,up,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 s=0,a=i.length;s<a;s++)i[s].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 s(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=s(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 u=l[c];s(e.shapes,u)}else s(e.shapes,l)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(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(s(e.materials,this.material[l]));i.material=o}else i.material=s(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(s(e.animations,l))}}if(t){const o=a(e.geometries),l=a(e.materials),c=a(e.textures),h=a(e.images),u=a(e.shapes),d=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),u.length>0&&(n.shapes=u),d.length>0&&(n.skeletons=d),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}}Ut.DEFAULT_UP=new F(0,1,0);Ut.DEFAULT_MATRIX_AUTO_UPDATE=!0;Ut.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const zn=new F,oi=new F,Wa=new F,li=new F,dr=new F,fr=new F,wc=new F,Xa=new F,qa=new F,ja=new F,Ya=new Mt,$a=new Mt,Ja=new Mt;class Nn{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),zn.subVectors(e,t),i.cross(zn);const s=i.lengthSq();return s>0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,n,i,s){zn.subVectors(i,t),oi.subVectors(n,t),Wa.subVectors(e,t);const a=zn.dot(zn),o=zn.dot(oi),l=zn.dot(Wa),c=oi.dot(oi),h=oi.dot(Wa),u=a*c-o*o;if(u===0)return s.set(0,0,0),null;const d=1/u,f=(c*l-o*h)*d,m=(a*h-o*l)*d;return s.set(1-f-m,m,f)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,li)===null?!1:li.x>=0&&li.y>=0&&li.x+li.y<=1}static getInterpolation(e,t,n,i,s,a,o,l){return this.getBarycoord(e,t,n,i,li)===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(s,li.x),l.addScaledVector(a,li.y),l.addScaledVector(o,li.z),l)}static getInterpolatedAttribute(e,t,n,i,s,a){return Ya.setScalar(0),$a.setScalar(0),Ja.setScalar(0),Ya.fromBufferAttribute(e,t),$a.fromBufferAttribute(e,n),Ja.fromBufferAttribute(e,i),a.setScalar(0),a.addScaledVector(Ya,s.x),a.addScaledVector($a,s.y),a.addScaledVector(Ja,s.z),a}static isFrontFacing(e,t,n,i){return zn.subVectors(n,t),oi.subVectors(e,t),zn.cross(oi).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 zn.subVectors(this.c,this.b),oi.subVectors(this.a,this.b),zn.cross(oi).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Nn.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Nn.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,i,s){return Nn.getInterpolation(e,this.a,this.b,this.c,t,n,i,s)}containsPoint(e){return Nn.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Nn.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,i=this.b,s=this.c;let a,o;dr.subVectors(i,n),fr.subVectors(s,n),Xa.subVectors(e,n);const l=dr.dot(Xa),c=fr.dot(Xa);if(l<=0&&c<=0)return t.copy(n);qa.subVectors(e,i);const h=dr.dot(qa),u=fr.dot(qa);if(h>=0&&u<=h)return t.copy(i);const d=l*u-h*c;if(d<=0&&l>=0&&h<=0)return a=l/(l-h),t.copy(n).addScaledVector(dr,a);ja.subVectors(e,s);const f=dr.dot(ja),m=fr.dot(ja);if(m>=0&&f<=m)return t.copy(s);const _=f*c-l*m;if(_<=0&&c>=0&&m<=0)return o=c/(c-m),t.copy(n).addScaledVector(fr,o);const g=h*m-f*u;if(g<=0&&u-h>=0&&f-m>=0)return wc.subVectors(s,i),o=(u-h)/(u-h+(f-m)),t.copy(i).addScaledVector(wc,o);const p=1/(g+_+d);return a=_*p,o=d*p,t.copy(n).addScaledVector(dr,a).addScaledVector(fr,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const Mu={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},Mi={h:0,s:0,l:0},Es={h:0,s:0,l:0};function Ka(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}class st{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,xt.colorSpaceToWorking(this,t),this}setRGB(e,t,n,i=xt.workingColorSpace){return this.r=e,this.g=t,this.b=n,xt.colorSpaceToWorking(this,i),this}setHSL(e,t,n,i=xt.workingColorSpace){if(e=Il(e,1),t=vt(t,0,1),n=vt(n,0,1),t===0)this.r=this.g=this.b=n;else{const s=n<=.5?n*(1+t):n+t-n*t,a=2*n-s;this.r=Ka(a,s,e+1/3),this.g=Ka(a,s,e),this.b=Ka(a,s,e-1/3)}return xt.colorSpaceToWorking(this,i),this}setStyle(e,t=Tt){function n(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const a=i[1],o=i[2];switch(a){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=i[1],a=s.length;if(a===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(a===6)return this.setHex(parseInt(s,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=Mu[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=fi(e.r),this.g=fi(e.g),this.b=fi(e.b),this}copyLinearToSRGB(e){return this.r=Tr(e.r),this.g=Tr(e.g),this.b=Tr(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Tt){return xt.workingToColorSpace(fn.copy(this),e),Math.round(vt(fn.r*255,0,255))*65536+Math.round(vt(fn.g*255,0,255))*256+Math.round(vt(fn.b*255,0,255))}getHexString(e=Tt){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=xt.workingColorSpace){xt.workingToColorSpace(fn.copy(this),t);const n=fn.r,i=fn.g,s=fn.b,a=Math.max(n,i,s),o=Math.min(n,i,s);let l,c;const h=(o+a)/2;if(o===a)l=0,c=0;else{const u=a-o;switch(c=h<=.5?u/(a+o):u/(2-a-o),a){case n:l=(i-s)/u+(i<s?6:0);break;case i:l=(s-n)/u+2;break;case s:l=(n-i)/u+4;break}l/=6}return e.h=l,e.s=c,e.l=h,e}getRGB(e,t=xt.workingColorSpace){return xt.workingToColorSpace(fn.copy(this),t),e.r=fn.r,e.g=fn.g,e.b=fn.b,e}getStyle(e=Tt){xt.workingToColorSpace(fn.copy(this),e);const t=fn.r,n=fn.g,i=fn.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(Mi),this.setHSL(Mi.h+e,Mi.s+t,Mi.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(Mi),e.getHSL(Es);const n=Zr(Mi.h,Es.h,t),i=Zr(Mi.s,Es.s,t),s=Zr(Mi.l,Es.l,t);return this.setHSL(n,i,s),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,s=e.elements;return this.r=s[0]*t+s[3]*n+s[6]*i,this.g=s[1]*t+s[4]*n+s[7]*i,this.b=s[2]*t+s[5]*n+s[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 fn=new st;st.NAMES=Mu;let fp=0;class Dn extends $i{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:fp++}),this.uuid=Vn(),this.name="",this.type="Material",this.blending=Ar,this.side=Hn,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=wo,this.blendDst=To,this.blendEquation=Vi,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new st(0,0,0),this.blendAlpha=0,this.depthFunc=Cr,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=dc,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=rr,this.stencilZFail=rr,this.stencilZPass=rr,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!==Ar&&(n.blending=this.blending),this.side!==Hn&&(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!==wo&&(n.blendSrc=this.blendSrc),this.blendDst!==To&&(n.blendDst=this.blendDst),this.blendEquation!==Vi&&(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!==Cr&&(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!==dc&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==rr&&(n.stencilFail=this.stencilFail),this.stencilZFail!==rr&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==rr&&(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(s){const a=[];for(const o in s){const l=s[o];delete l.metadata,a.push(l)}return a}if(t){const s=i(e.textures),a=i(e.images);s.length>0&&(n.textures=s),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 s=0;s!==i;++s)n[s]=t[s].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 Ri extends Dn{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new st(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 yn,this.combine=ba,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 qt=new F,As=new Ge;let pp=0;class Gt{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:pp++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=ul,this.updateRanges=[],this.gpuType=Jn,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,s=this.itemSize;i<s;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++)As.fromBufferAttribute(this,t),As.applyMatrix3(e),this.setXY(t,As.x,As.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)qt.fromBufferAttribute(this,t),qt.applyMatrix3(e),this.setXYZ(t,qt.x,qt.y,qt.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)qt.fromBufferAttribute(this,t),qt.applyMatrix4(e),this.setXYZ(t,qt.x,qt.y,qt.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)qt.fromBufferAttribute(this,t),qt.applyNormalMatrix(e),this.setXYZ(t,qt.x,qt.y,qt.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)qt.fromBufferAttribute(this,t),qt.transformDirection(e),this.setXYZ(t,qt.x,qt.y,qt.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=Bn(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=It(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Bn(t,this.array)),t}setX(e,t){return this.normalized&&(t=It(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Bn(t,this.array)),t}setY(e,t){return this.normalized&&(t=It(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=Bn(t,this.array)),t}setZ(e,t){return this.normalized&&(t=It(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=Bn(t,this.array)),t}setW(e,t){return this.normalized&&(t=It(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=It(t,this.array),n=It(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=It(t,this.array),n=It(n,this.array),i=It(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this}setXYZW(e,t,n,i,s){return e*=this.itemSize,this.normalized&&(t=It(t,this.array),n=It(n,this.array),i=It(i,this.array),s=It(s,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=s,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!==ul&&(e.usage=this.usage),e}}class bu extends Gt{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class mp extends Gt{constructor(e,t,n){super(new Int32Array(e),t,n)}}class Su extends Gt{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class mt extends Gt{constructor(e,t,n){super(new Float32Array(e),t,n)}}let gp=0;const Ln=new lt,Za=new Ut,pr=new F,wn=new ei,Gr=new ei,Qt=new F;class Bt extends $i{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:gp++}),this.uuid=Vn(),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(yu(e)?Su:bu)(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 s=new _t().getNormalMatrix(e);n.applyNormalMatrix(s),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 Ln.makeRotationFromQuaternion(e),this.applyMatrix4(Ln),this}rotateX(e){return Ln.makeRotationX(e),this.applyMatrix4(Ln),this}rotateY(e){return Ln.makeRotationY(e),this.applyMatrix4(Ln),this}rotateZ(e){return Ln.makeRotationZ(e),this.applyMatrix4(Ln),this}translate(e,t,n){return Ln.makeTranslation(e,t,n),this.applyMatrix4(Ln),this}scale(e,t,n){return Ln.makeScale(e,t,n),this.applyMatrix4(Ln),this}lookAt(e){return Za.lookAt(e),Za.updateMatrix(),this.applyMatrix4(Za.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(pr).negate(),this.translate(pr.x,pr.y,pr.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const n=[];for(let i=0,s=e.length;i<s;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 s=e[i];t.setXYZ(i,s.x,s.y,s.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 ei);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 s=t[n];wn.setFromBufferAttribute(s),this.morphTargetsRelative?(Qt.addVectors(this.boundingBox.min,wn.min),this.boundingBox.expandByPoint(Qt),Qt.addVectors(this.boundingBox.max,wn.max),this.boundingBox.expandByPoint(Qt)):(this.boundingBox.expandByPoint(wn.min),this.boundingBox.expandByPoint(wn.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 mi);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(wn.setFromBufferAttribute(e),t)for(let s=0,a=t.length;s<a;s++){const o=t[s];Gr.setFromBufferAttribute(o),this.morphTargetsRelative?(Qt.addVectors(wn.min,Gr.min),wn.expandByPoint(Qt),Qt.addVectors(wn.max,Gr.max),wn.expandByPoint(Qt)):(wn.expandByPoint(Gr.min),wn.expandByPoint(Gr.max))}wn.getCenter(n);let i=0;for(let s=0,a=e.count;s<a;s++)Qt.fromBufferAttribute(e,s),i=Math.max(i,n.distanceToSquared(Qt));if(t)for(let s=0,a=t.length;s<a;s++){const o=t[s],l=this.morphTargetsRelative;for(let c=0,h=o.count;c<h;c++)Qt.fromBufferAttribute(o,c),l&&(pr.fromBufferAttribute(e,c),Qt.add(pr)),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,s=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Gt(new Float32Array(4*n.count),4));const a=this.getAttribute("tangent"),o=[],l=[];for(let P=0;P<n.count;P++)o[P]=new F,l[P]=new F;const c=new F,h=new F,u=new F,d=new Ge,f=new Ge,m=new Ge,_=new F,g=new F;function p(P,b,x){c.fromBufferAttribute(n,P),h.fromBufferAttribute(n,b),u.fromBufferAttribute(n,x),d.fromBufferAttribute(s,P),f.fromBufferAttribute(s,b),m.fromBufferAttribute(s,x),h.sub(c),u.sub(c),f.sub(d),m.sub(d);const R=1/(f.x*m.y-m.x*f.y);isFinite(R)&&(_.copy(h).multiplyScalar(m.y).addScaledVector(u,-f.y).multiplyScalar(R),g.copy(u).multiplyScalar(f.x).addScaledVector(h,-m.x).multiplyScalar(R),o[P].add(_),o[b].add(_),o[x].add(_),l[P].add(g),l[b].add(g),l[x].add(g))}let S=this.groups;S.length===0&&(S=[{start:0,count:e.count}]);for(let P=0,b=S.length;P<b;++P){const x=S[P],R=x.start,B=x.count;for(let V=R,W=R+B;V<W;V+=3)p(e.getX(V+0),e.getX(V+1),e.getX(V+2))}const E=new F,v=new F,N=new F,C=new F;function T(P){N.fromBufferAttribute(i,P),C.copy(N);const b=o[P];E.copy(b),E.sub(N.multiplyScalar(N.dot(b))).normalize(),v.crossVectors(C,b);const R=v.dot(l[P])<0?-1:1;a.setXYZW(P,E.x,E.y,E.z,R)}for(let P=0,b=S.length;P<b;++P){const x=S[P],R=x.start,B=x.count;for(let V=R,W=R+B;V<W;V+=3)T(e.getX(V+0)),T(e.getX(V+1)),T(e.getX(V+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 Gt(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let d=0,f=n.count;d<f;d++)n.setXYZ(d,0,0,0);const i=new F,s=new F,a=new F,o=new F,l=new F,c=new F,h=new F,u=new F;if(e)for(let d=0,f=e.count;d<f;d+=3){const m=e.getX(d+0),_=e.getX(d+1),g=e.getX(d+2);i.fromBufferAttribute(t,m),s.fromBufferAttribute(t,_),a.fromBufferAttribute(t,g),h.subVectors(a,s),u.subVectors(i,s),h.cross(u),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 d=0,f=t.count;d<f;d+=3)i.fromBufferAttribute(t,d+0),s.fromBufferAttribute(t,d+1),a.fromBufferAttribute(t,d+2),h.subVectors(a,s),u.subVectors(i,s),h.cross(u),n.setXYZ(d+0,h.x,h.y,h.z),n.setXYZ(d+1,h.x,h.y,h.z),n.setXYZ(d+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,u=o.normalized,d=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++)d[m++]=c[f++]}return new Gt(d,h,u)}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 s=this.morphAttributes;for(const o in s){const l=[],c=s[o];for(let h=0,u=c.length;h<u;h++){const d=c[h],f=e(d,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 s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],h=[];for(let u=0,d=c.length;u<d;u++){const f=c[u];h.push(f.toJSON(e.data))}h.length>0&&(i[l]=h,s=!0)}s&&(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 s=e.morphAttributes;for(const c in s){const h=[],u=s[c];for(let d=0,f=u.length;d<f;d++)h.push(u[d].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 u=a[c];this.addGroup(u.start,u.count,u.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 Tc=new lt,Ni=new Ur,ws=new mi,Cc=new F,Ts=new F,Cs=new F,Rs=new F,Qa=new F,Ds=new F,Rc=new F,Ls=new F;class Ct extends Ut{constructor(e=new Bt,t=new Ri){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 s=0,a=i.length;s<a;s++){const o=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}getVertexPosition(e,t){const n=this.geometry,i=n.attributes.position,s=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(i,e);const o=this.morphTargetInfluences;if(s&&o){Ds.set(0,0,0);for(let l=0,c=s.length;l<c;l++){const h=o[l],u=s[l];h!==0&&(Qa.fromBufferAttribute(u,e),a?Ds.addScaledVector(Qa,h):Ds.addScaledVector(Qa.sub(t),h))}t.add(Ds)}return t}raycast(e,t){const n=this.geometry,i=this.material,s=this.matrixWorld;i!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),ws.copy(n.boundingSphere),ws.applyMatrix4(s),Ni.copy(e.ray).recast(e.near),!(ws.containsPoint(Ni.origin)===!1&&(Ni.intersectSphere(ws,Cc)===null||Ni.origin.distanceToSquared(Cc)>(e.far-e.near)**2))&&(Tc.copy(s).invert(),Ni.copy(e.ray).applyMatrix4(Tc),!(n.boundingBox!==null&&Ni.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,Ni)))}_computeIntersections(e,t,n){let i;const s=this.geometry,a=this.material,o=s.index,l=s.attributes.position,c=s.attributes.uv,h=s.attributes.uv1,u=s.attributes.normal,d=s.groups,f=s.drawRange;if(o!==null)if(Array.isArray(a))for(let m=0,_=d.length;m<_;m++){const g=d[m],p=a[g.materialIndex],S=Math.max(g.start,f.start),E=Math.min(o.count,Math.min(g.start+g.count,f.start+f.count));for(let v=S,N=E;v<N;v+=3){const C=o.getX(v),T=o.getX(v+1),P=o.getX(v+2);i=Ps(this,p,e,n,c,h,u,C,T,P),i&&(i.faceIndex=Math.floor(v/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 S=o.getX(g),E=o.getX(g+1),v=o.getX(g+2);i=Ps(this,a,e,n,c,h,u,S,E,v),i&&(i.faceIndex=Math.floor(g/3),t.push(i))}}else if(l!==void 0)if(Array.isArray(a))for(let m=0,_=d.length;m<_;m++){const g=d[m],p=a[g.materialIndex],S=Math.max(g.start,f.start),E=Math.min(l.count,Math.min(g.start+g.count,f.start+f.count));for(let v=S,N=E;v<N;v+=3){const C=v,T=v+1,P=v+2;i=Ps(this,p,e,n,c,h,u,C,T,P),i&&(i.faceIndex=Math.floor(v/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 S=g,E=g+1,v=g+2;i=Ps(this,a,e,n,c,h,u,S,E,v),i&&(i.faceIndex=Math.floor(g/3),t.push(i))}}}}function _p(r,e,t,n,i,s,a,o){let l;if(e.side===vn?l=n.intersectTriangle(a,s,i,!0,o):l=n.intersectTriangle(i,s,a,e.side===Hn,o),l===null)return null;Ls.copy(o),Ls.applyMatrix4(r.matrixWorld);const c=t.ray.origin.distanceTo(Ls);return c<t.near||c>t.far?null:{distance:c,point:Ls.clone(),object:r}}function Ps(r,e,t,n,i,s,a,o,l,c){r.getVertexPosition(o,Ts),r.getVertexPosition(l,Cs),r.getVertexPosition(c,Rs);const h=_p(r,e,t,n,Ts,Cs,Rs,Rc);if(h){const u=new F;Nn.getBarycoord(Rc,Ts,Cs,Rs,u),i&&(h.uv=Nn.getInterpolatedAttribute(i,o,l,c,u,new Ge)),s&&(h.uv1=Nn.getInterpolatedAttribute(s,o,l,c,u,new Ge)),a&&(h.normal=Nn.getInterpolatedAttribute(a,o,l,c,u,new F),h.normal.dot(n.direction)>0&&h.normal.multiplyScalar(-1));const d={a:o,b:l,c,normal:new F,materialIndex:0};Nn.getNormal(Ts,Cs,Rs,d.normal),h.face=d,h.barycoord=u}return h}class Ji extends Bt{constructor(e=1,t=1,n=1,i=1,s=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:s,depthSegments:a};const o=this;i=Math.floor(i),s=Math.floor(s),a=Math.floor(a);const l=[],c=[],h=[],u=[];let d=0,f=0;m("z","y","x",-1,-1,n,t,e,a,s,0),m("z","y","x",1,-1,n,t,-e,a,s,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,s,4),m("x","y","z",-1,-1,e,t,-n,i,s,5),this.setIndex(l),this.setAttribute("position",new mt(c,3)),this.setAttribute("normal",new mt(h,3)),this.setAttribute("uv",new mt(u,2));function m(_,g,p,S,E,v,N,C,T,P,b){const x=v/T,R=N/P,B=v/2,V=N/2,W=C/2,ee=T+1,k=P+1;let Q=0,q=0;const ue=new F;for(let ye=0;ye<k;ye++){const le=ye*R-V;for(let Le=0;Le<ee;Le++){const Te=Le*x-B;ue[_]=Te*S,ue[g]=le*E,ue[p]=W,c.push(ue.x,ue.y,ue.z),ue[_]=0,ue[g]=0,ue[p]=C>0?1:-1,h.push(ue.x,ue.y,ue.z),u.push(Le/T),u.push(1-ye/P),Q+=1}}for(let ye=0;ye<P;ye++)for(let le=0;le<T;le++){const Le=d+le+ee*ye,Te=d+le+ee*(ye+1),Y=d+(le+1)+ee*(ye+1),re=d+(le+1)+ee*ye;l.push(Le,Te,re),l.push(Te,Y,re),q+=6}o.addGroup(f,q,b),f+=q,d+=Q}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Ji(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function Ir(r){const e={};for(const t in r){e[t]={};for(const n in r[t]){const i=r[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 _n(r){const e={};for(let t=0;t<r.length;t++){const n=Ir(r[t]);for(const i in n)e[i]=n[i]}return e}function vp(r){const e=[];for(let t=0;t<r.length;t++)e.push(r[t].clone());return e}function Eu(r){const e=r.getRenderTarget();return e===null?r.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:xt.workingColorSpace}const Fl={clone:Ir,merge:_n};var yp=`void main() {
|
|
5
|
+
*/const wl="177",Wd={ROTATE:0,DOLLY:1,PAN:2},Xd={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},qd=0,rc=1,jd=2,au=1,ou=2,hi=3,Hn=0,vn=1,pn=2,wi=0,Ar=1,sc=2,ac=3,oc=4,Yd=5,Vi=100,$d=101,Kd=102,Jd=103,Zd=104,Qd=200,ef=201,tf=202,nf=203,To=204,Co=205,rf=206,sf=207,af=208,of=209,lf=210,cf=211,hf=212,uf=213,df=214,Ro=0,Do=1,Po=2,Cr=3,Lo=4,Io=5,No=6,Uo=7,Sa=0,ff=1,pf=2,Ti=0,mf=1,gf=2,_f=3,lu=4,vf=5,yf=6,xf=7,lc="attached",Mf="detached",cu=300,Rr=301,Dr=302,Fo=303,Oo=304,Ea=306,$n=1e3,kn=1001,zo=1002,Rn=1003,bf=1004,gs=1005,Cn=1006,Ia=1007,ui=1008,Qn=1009,hu=1010,uu=1011,is=1012,Tl=1013,qi=1014,Kn=1015,hs=1016,Cl=1017,Rl=1018,rs=1020,du=35902,fu=1021,pu=1022,Un=1023,ss=1026,as=1027,mu=1028,Dl=1029,gu=1030,Pl=1031,Ll=1033,ra=33776,sa=33777,aa=33778,oa=33779,Bo=35840,ko=35841,Vo=35842,Ho=35843,Go=36196,Wo=37492,Xo=37496,qo=37808,jo=37809,Yo=37810,$o=37811,Ko=37812,Jo=37813,Zo=37814,Qo=37815,el=37816,tl=37817,nl=37818,il=37819,rl=37820,sl=37821,la=36492,al=36494,ol=36495,_u=36283,ll=36284,cl=36285,hl=36286,fa=2300,ul=2301,Na=2302,cc=2400,hc=2401,uc=2402,Sf=2500,Ef=3200,Af=3201,Aa=0,wf=1,Ai="",Tt="srgb",Pr="srgb-linear",pa="linear",Nt="srgb",rr=7680,dc=519,Tf=512,Cf=513,Rf=514,vu=515,Df=516,Pf=517,Lf=518,If=519,dl=35044,fc="300 es",di=2e3,ma=2001;class $i{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 s=i.indexOf(t);s!==-1&&i.splice(s,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 s=0,a=i.length;s<a;s++)i[s].call(this,e);e.target=null}}}const dn=["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 pc=1234567;const Jr=Math.PI/180,Lr=180/Math.PI;function Vn(){const r=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(dn[r&255]+dn[r>>8&255]+dn[r>>16&255]+dn[r>>24&255]+"-"+dn[e&255]+dn[e>>8&255]+"-"+dn[e>>16&15|64]+dn[e>>24&255]+"-"+dn[t&63|128]+dn[t>>8&255]+"-"+dn[t>>16&255]+dn[t>>24&255]+dn[n&255]+dn[n>>8&255]+dn[n>>16&255]+dn[n>>24&255]).toLowerCase()}function vt(r,e,t){return Math.max(e,Math.min(t,r))}function Il(r,e){return(r%e+e)%e}function Nf(r,e,t,n,i){return n+(r-e)*(i-n)/(t-e)}function Uf(r,e,t){return r!==e?(t-r)/(e-r):0}function Zr(r,e,t){return(1-t)*r+t*e}function Ff(r,e,t,n){return Zr(r,e,1-Math.exp(-t*n))}function Of(r,e=1){return e-Math.abs(Il(r,e*2)-e)}function zf(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function Bf(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))}function kf(r,e){return r+Math.floor(Math.random()*(e-r+1))}function Vf(r,e){return r+Math.random()*(e-r)}function Hf(r){return r*(.5-Math.random())}function Gf(r){r!==void 0&&(pc=r);let e=pc+=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 Wf(r){return r*Jr}function Xf(r){return r*Lr}function qf(r){return(r&r-1)===0&&r!==0}function jf(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function Yf(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function $f(r,e,t,n,i){const s=Math.cos,a=Math.sin,o=s(t/2),l=a(t/2),c=s((e+n)/2),h=a((e+n)/2),u=s((e-n)/2),d=a((e-n)/2),f=s((n-e)/2),m=a((n-e)/2);switch(i){case"XYX":r.set(o*h,l*u,l*d,o*c);break;case"YZY":r.set(l*d,o*h,l*u,o*c);break;case"ZXZ":r.set(l*u,l*d,o*h,o*c);break;case"XZX":r.set(o*h,l*m,l*f,o*c);break;case"YXY":r.set(l*f,o*h,l*m,o*c);break;case"ZYZ":r.set(l*m,l*f,o*h,o*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Bn(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return r/4294967295;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int32Array:return Math.max(r/2147483647,-1);case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("Invalid component type.")}}function It(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return Math.round(r*4294967295);case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int32Array:return Math.round(r*2147483647);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);default:throw new Error("Invalid component type.")}}const Hi={DEG2RAD:Jr,RAD2DEG:Lr,generateUUID:Vn,clamp:vt,euclideanModulo:Il,mapLinear:Nf,inverseLerp:Uf,lerp:Zr,damp:Ff,pingpong:Of,smoothstep:zf,smootherstep:Bf,randInt:kf,randFloat:Vf,randFloatSpread:Hf,seededRandom:Gf,degToRad:Wf,radToDeg:Xf,isPowerOfTwo:qf,ceilPowerOfTwo:jf,floorPowerOfTwo:Yf,setQuaternionFromProperEuler:$f,normalize:It,denormalize:Bn};class Ge{constructor(e=0,t=0){Ge.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),s=this.x-e.x,a=this.y-e.y;return this.x=s*n-a*i+e.x,this.y=s*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 Dn{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,s,a,o){let l=n[i+0],c=n[i+1],h=n[i+2],u=n[i+3];const d=s[a+0],f=s[a+1],m=s[a+2],_=s[a+3];if(o===0){e[t+0]=l,e[t+1]=c,e[t+2]=h,e[t+3]=u;return}if(o===1){e[t+0]=d,e[t+1]=f,e[t+2]=m,e[t+3]=_;return}if(u!==_||l!==d||c!==f||h!==m){let g=1-o;const p=l*d+c*f+h*m+u*_,S=p>=0?1:-1,E=1-p*p;if(E>Number.EPSILON){const N=Math.sqrt(E),C=Math.atan2(N,p*S);g=Math.sin(g*C)/N,o=Math.sin(o*C)/N}const v=o*S;if(l=l*g+d*v,c=c*g+f*v,h=h*g+m*v,u=u*g+_*v,g===1-o){const N=1/Math.sqrt(l*l+c*c+h*h+u*u);l*=N,c*=N,h*=N,u*=N}}e[t]=l,e[t+1]=c,e[t+2]=h,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,i,s,a){const o=n[i],l=n[i+1],c=n[i+2],h=n[i+3],u=s[a],d=s[a+1],f=s[a+2],m=s[a+3];return e[t]=o*m+h*u+l*f-c*d,e[t+1]=l*m+h*d+c*u-o*f,e[t+2]=c*m+h*f+o*d-l*u,e[t+3]=h*m-o*u-l*d-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,s=e._z,a=e._order,o=Math.cos,l=Math.sin,c=o(n/2),h=o(i/2),u=o(s/2),d=l(n/2),f=l(i/2),m=l(s/2);switch(a){case"XYZ":this._x=d*h*u+c*f*m,this._y=c*f*u-d*h*m,this._z=c*h*m+d*f*u,this._w=c*h*u-d*f*m;break;case"YXZ":this._x=d*h*u+c*f*m,this._y=c*f*u-d*h*m,this._z=c*h*m-d*f*u,this._w=c*h*u+d*f*m;break;case"ZXY":this._x=d*h*u-c*f*m,this._y=c*f*u+d*h*m,this._z=c*h*m+d*f*u,this._w=c*h*u-d*f*m;break;case"ZYX":this._x=d*h*u-c*f*m,this._y=c*f*u+d*h*m,this._z=c*h*m-d*f*u,this._w=c*h*u+d*f*m;break;case"YZX":this._x=d*h*u+c*f*m,this._y=c*f*u+d*h*m,this._z=c*h*m-d*f*u,this._w=c*h*u-d*f*m;break;case"XZY":this._x=d*h*u-c*f*m,this._y=c*f*u-d*h*m,this._z=c*h*m+d*f*u,this._w=c*h*u+d*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],s=t[8],a=t[1],o=t[5],l=t[9],c=t[2],h=t[6],u=t[10],d=n+o+u;if(d>0){const f=.5/Math.sqrt(d+1);this._w=.25/f,this._x=(h-l)*f,this._y=(s-c)*f,this._z=(a-i)*f}else if(n>o&&n>u){const f=2*Math.sqrt(1+n-o-u);this._w=(h-l)/f,this._x=.25*f,this._y=(i+a)/f,this._z=(s+c)/f}else if(o>u){const f=2*Math.sqrt(1+o-n-u);this._w=(s-c)/f,this._x=(i+a)/f,this._y=.25*f,this._z=(l+h)/f}else{const f=2*Math.sqrt(1+u-n-o);this._w=(a-i)/f,this._x=(s+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,s=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-s*l,this._y=i*h+a*l+s*o-n*c,this._z=s*h+a*c+n*l-i*o,this._w=a*h-n*o-i*l-s*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,s=this._z,a=this._w;let o=a*e._w+n*e._x+i*e._y+s*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=s,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*s+t*this._z,this.normalize(),this}const c=Math.sqrt(l),h=Math.atan2(c,o),u=Math.sin((1-t)*h)/c,d=Math.sin(t*h)/c;return this._w=a*u+this._w*d,this._x=n*u+this._x*d,this._y=i*u+this._y*d,this._z=s*u+this._z*d,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),s=Math.sqrt(n);return this.set(i*Math.sin(e),i*Math.cos(e),s*Math.sin(t),s*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(mc.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(mc.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*i,this.y=s[1]*t+s[4]*n+s[7]*i,this.z=s[2]*t+s[5]*n+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,s=e.elements,a=1/(s[3]*t+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*i+s[12])*a,this.y=(s[1]*t+s[5]*n+s[9]*i+s[13])*a,this.z=(s[2]*t+s[6]*n+s[10]*i+s[14])*a,this}applyQuaternion(e){const t=this.x,n=this.y,i=this.z,s=e.x,a=e.y,o=e.z,l=e.w,c=2*(a*i-o*n),h=2*(o*t-s*i),u=2*(s*n-a*t);return this.x=t+l*c+a*u-o*h,this.y=n+l*h+o*c-s*u,this.z=i+l*u+s*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,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i,this.y=s[1]*t+s[5]*n+s[9]*i,this.z=s[2]*t+s[6]*n+s[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,s=e.z,a=t.x,o=t.y,l=t.z;return this.x=i*l-s*o,this.y=s*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 Ua.copy(this).projectOnVector(e),this.sub(Ua)}reflect(e){return this.sub(Ua.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 Ua=new F,mc=new Dn;class _t{constructor(e,t,n,i,s,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,s,a,o,l,c)}set(e,t,n,i,s,a,o,l,c){const h=this.elements;return h[0]=e,h[1]=i,h[2]=o,h[3]=t,h[4]=s,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,s=this.elements,a=n[0],o=n[3],l=n[6],c=n[1],h=n[4],u=n[7],d=n[2],f=n[5],m=n[8],_=i[0],g=i[3],p=i[6],S=i[1],E=i[4],v=i[7],N=i[2],C=i[5],T=i[8];return s[0]=a*_+o*S+l*N,s[3]=a*g+o*E+l*C,s[6]=a*p+o*v+l*T,s[1]=c*_+h*S+u*N,s[4]=c*g+h*E+u*C,s[7]=c*p+h*v+u*T,s[2]=d*_+f*S+m*N,s[5]=d*g+f*E+m*C,s[8]=d*p+f*v+m*T,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],s=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*s*h+n*o*l+i*s*c-i*a*l}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8],u=h*a-o*c,d=o*l-h*s,f=c*s-a*l,m=t*u+n*d+i*f;if(m===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/m;return e[0]=u*_,e[1]=(i*c-h*n)*_,e[2]=(o*n-i*a)*_,e[3]=d*_,e[4]=(h*t-i*l)*_,e[5]=(i*s-o*t)*_,e[6]=f*_,e[7]=(n*l-c*t)*_,e[8]=(a*t-n*s)*_,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,s,a,o){const l=Math.cos(s),c=Math.sin(s);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(Fa.makeScale(e,t)),this}rotate(e){return this.premultiply(Fa.makeRotation(-e)),this}translate(e,t){return this.premultiply(Fa.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 Fa=new _t;function yu(r){for(let e=r.length-1;e>=0;--e)if(r[e]>=65535)return!0;return!1}function os(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function Kf(){const r=os("canvas");return r.style.display="block",r}const gc={};function wr(r){r in gc||(gc[r]=!0,console.warn(r))}function Jf(r,e,t){return new Promise(function(n,i){function s(){switch(r.clientWaitSync(e,r.SYNC_FLUSH_COMMANDS_BIT,0)){case r.WAIT_FAILED:i();break;case r.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:n()}}setTimeout(s,t)})}function Zf(r){const e=r.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 Qf(r){const e=r.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const _c=new _t().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),vc=new _t().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function ep(){const r={enabled:!0,workingColorSpace:Pr,spaces:{},convert:function(i,s,a){return this.enabled===!1||s===a||!s||!a||(this.spaces[s].transfer===Nt&&(i.r=fi(i.r),i.g=fi(i.g),i.b=fi(i.b)),this.spaces[s].primaries!==this.spaces[a].primaries&&(i.applyMatrix3(this.spaces[s].toXYZ),i.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===Nt&&(i.r=Tr(i.r),i.g=Tr(i.g),i.b=Tr(i.b))),i},workingToColorSpace:function(i,s){return this.convert(i,this.workingColorSpace,s)},colorSpaceToWorking:function(i,s){return this.convert(i,s,this.workingColorSpace)},getPrimaries:function(i){return this.spaces[i].primaries},getTransfer:function(i){return i===Ai?pa:this.spaces[i].transfer},getLuminanceCoefficients:function(i,s=this.workingColorSpace){return i.fromArray(this.spaces[s].luminanceCoefficients)},define:function(i){Object.assign(this.spaces,i)},_getMatrix:function(i,s,a){return i.copy(this.spaces[s].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,s){return wr("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),r.workingToColorSpace(i,s)},toWorkingColorSpace:function(i,s){return wr("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),r.colorSpaceToWorking(i,s)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],n=[.3127,.329];return r.define({[Pr]:{primaries:e,whitePoint:n,transfer:pa,toXYZ:_c,fromXYZ:vc,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Tt},outputColorSpaceConfig:{drawingBufferColorSpace:Tt}},[Tt]:{primaries:e,whitePoint:n,transfer:Nt,toXYZ:_c,fromXYZ:vc,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Tt}}}),r}const xt=ep();function fi(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function Tr(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}let sr;class tp{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{sr===void 0&&(sr=os("canvas")),sr.width=e.width,sr.height=e.height;const i=sr.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),n=sr}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=os("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),s=i.data;for(let a=0;a<s.length;a++)s[a]=fi(s[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(fi(t[n]/255)*255):t[n]=fi(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 np=0;class Nl{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:np++}),this.uuid=Vn(),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 s;if(Array.isArray(i)){s=[];for(let a=0,o=i.length;a<o;a++)i[a].isDataTexture?s.push(Oa(i[a].image)):s.push(Oa(i[a]))}else s=Oa(i);n.url=s}return t||(e.images[this.uuid]=n),n}}function Oa(r){return typeof HTMLImageElement<"u"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&r instanceof ImageBitmap?tp.getDataURL(r):r.data?{data:Array.from(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let ip=0;const za=new F;class cn extends $i{constructor(e=cn.DEFAULT_IMAGE,t=cn.DEFAULT_MAPPING,n=kn,i=kn,s=Cn,a=ui,o=Un,l=Qn,c=cn.DEFAULT_ANISOTROPY,h=Ai){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:ip++}),this.uuid=Vn(),this.name="",this.source=new Nl(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=a,this.anisotropy=c,this.format=o,this.internalFormat=null,this.type=l,this.offset=new Ge(0,0),this.repeat=new Ge(1,1),this.center=new Ge(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(za).x}get height(){return this.source.getSize(za).y}get depth(){return this.source.getSize(za).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!==cu)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case $n:e.x=e.x-Math.floor(e.x);break;case kn:e.x=e.x<0?0:1;break;case zo: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 $n:e.y=e.y-Math.floor(e.y);break;case kn:e.y=e.y<0?0:1;break;case zo: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++}}cn.DEFAULT_IMAGE=null;cn.DEFAULT_MAPPING=cu;cn.DEFAULT_ANISOTROPY=1;class Mt{constructor(e=0,t=0,n=0,i=1){Mt.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,s=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*i+a[12]*s,this.y=a[1]*t+a[5]*n+a[9]*i+a[13]*s,this.z=a[2]*t+a[6]*n+a[10]*i+a[14]*s,this.w=a[3]*t+a[7]*n+a[11]*i+a[15]*s,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,s;const l=e.elements,c=l[0],h=l[4],u=l[8],d=l[1],f=l[5],m=l[9],_=l[2],g=l[6],p=l[10];if(Math.abs(h-d)<.01&&Math.abs(u-_)<.01&&Math.abs(m-g)<.01){if(Math.abs(h+d)<.1&&Math.abs(u+_)<.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,v=(f+1)/2,N=(p+1)/2,C=(h+d)/4,T=(u+_)/4,L=(m+g)/4;return E>v&&E>N?E<.01?(n=0,i=.707106781,s=.707106781):(n=Math.sqrt(E),i=C/n,s=T/n):v>N?v<.01?(n=.707106781,i=0,s=.707106781):(i=Math.sqrt(v),n=C/i,s=L/i):N<.01?(n=.707106781,i=.707106781,s=0):(s=Math.sqrt(N),n=T/s,i=L/s),this.set(n,i,s,t),this}let S=Math.sqrt((g-m)*(g-m)+(u-_)*(u-_)+(d-h)*(d-h));return Math.abs(S)<.001&&(S=1),this.x=(g-m)/S,this.y=(u-_)/S,this.z=(d-h)/S,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 rp extends $i{constructor(e=1,t=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Cn,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 Mt(0,0,e,t),this.scissorTest=!1,this.viewport=new Mt(0,0,e,t);const i={width:e,height:t,depth:n.depth},s=new cn(i);this.textures=[];const a=n.count;for(let o=0;o<a;o++)this.textures[o]=s.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:Cn,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,s=this.textures.length;i<s;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 Nl(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 rp{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class xu extends cn{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=Rn,this.minFilter=Rn,this.wrapR=kn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class sp extends cn{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=Rn,this.minFilter=Rn,this.wrapR=kn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class ei{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(Fn.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(Fn.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=Fn.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 s=n.getAttribute("position");if(t===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let a=0,o=s.count;a<o;a++)e.isMesh===!0?e.getVertexPosition(a,Fn):Fn.fromBufferAttribute(s,a),Fn.applyMatrix4(e.matrixWorld),this.expandByPoint(Fn);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),_s.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),_s.copy(n.boundingBox)),_s.applyMatrix4(e.matrixWorld),this.union(_s)}const i=e.children;for(let s=0,a=i.length;s<a;s++)this.expandByObject(i[s],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,Fn),Fn.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(kr),vs.subVectors(this.max,kr),ar.subVectors(e.a,kr),or.subVectors(e.b,kr),lr.subVectors(e.c,kr),_i.subVectors(or,ar),vi.subVectors(lr,or),Li.subVectors(ar,lr);let t=[0,-_i.z,_i.y,0,-vi.z,vi.y,0,-Li.z,Li.y,_i.z,0,-_i.x,vi.z,0,-vi.x,Li.z,0,-Li.x,-_i.y,_i.x,0,-vi.y,vi.x,0,-Li.y,Li.x,0];return!Ba(t,ar,or,lr,vs)||(t=[1,0,0,0,1,0,0,0,1],!Ba(t,ar,or,lr,vs))?!1:(ys.crossVectors(_i,vi),t=[ys.x,ys.y,ys.z],Ba(t,ar,or,lr,vs))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Fn).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Fn).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],Fn=new F,_s=new ei,ar=new F,or=new F,lr=new F,_i=new F,vi=new F,Li=new F,kr=new F,vs=new F,ys=new F,Ii=new F;function Ba(r,e,t,n,i){for(let s=0,a=r.length-3;s<=a;s+=3){Ii.fromArray(r,s);const o=i.x*Math.abs(Ii.x)+i.y*Math.abs(Ii.y)+i.z*Math.abs(Ii.z),l=e.dot(Ii),c=t.dot(Ii),h=n.dot(Ii);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>o)return!1}return!0}const ap=new ei,Vr=new F,ka=new F;class mi{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):ap.setFromPoints(e).getCenter(n);let i=0;for(let s=0,a=e.length;s<a;s++)i=Math.max(i,n.distanceToSquared(e[s]));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;Vr.subVectors(e,this.center);const t=Vr.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.addScaledVector(Vr,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):(ka.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Vr.copy(e.center).add(ka)),this.expandByPoint(Vr.copy(e.center).sub(ka))),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 si=new F,Va=new F,xs=new F,yi=new F,Ha=new F,Ms=new F,Ga=new F;class Ur{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,si)),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=si.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(si.copy(this.origin).addScaledVector(this.direction,t),si.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){Va.copy(e).add(t).multiplyScalar(.5),xs.copy(t).sub(e).normalize(),yi.copy(this.origin).sub(Va);const s=e.distanceTo(t)*.5,a=-this.direction.dot(xs),o=yi.dot(this.direction),l=-yi.dot(xs),c=yi.lengthSq(),h=Math.abs(1-a*a);let u,d,f,m;if(h>0)if(u=a*l-o,d=a*o-l,m=s*h,u>=0)if(d>=-m)if(d<=m){const _=1/h;u*=_,d*=_,f=u*(u+a*d+2*o)+d*(a*u+d+2*l)+c}else d=s,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*l)+c;else d=-s,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*l)+c;else d<=-m?(u=Math.max(0,-(-a*s+o)),d=u>0?-s:Math.min(Math.max(-s,-l),s),f=-u*u+d*(d+2*l)+c):d<=m?(u=0,d=Math.min(Math.max(-s,-l),s),f=d*(d+2*l)+c):(u=Math.max(0,-(a*s+o)),d=u>0?s:Math.min(Math.max(-s,-l),s),f=-u*u+d*(d+2*l)+c);else d=a>0?-s:s,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,u),i&&i.copy(Va).addScaledVector(xs,d),f}intersectSphere(e,t){si.subVectors(e.center,this.origin);const n=si.dot(this.direction),i=si.dot(si)-n*n,s=e.radius*e.radius;if(i>s)return null;const a=Math.sqrt(s-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,s,a,o,l;const c=1/this.direction.x,h=1/this.direction.y,u=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,i=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,i=(e.min.x-d.x)*c),h>=0?(s=(e.min.y-d.y)*h,a=(e.max.y-d.y)*h):(s=(e.max.y-d.y)*h,a=(e.min.y-d.y)*h),n>a||s>i||((s>n||isNaN(n))&&(n=s),(a<i||isNaN(i))&&(i=a),u>=0?(o=(e.min.z-d.z)*u,l=(e.max.z-d.z)*u):(o=(e.max.z-d.z)*u,l=(e.min.z-d.z)*u),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,si)!==null}intersectTriangle(e,t,n,i,s){Ha.subVectors(t,e),Ms.subVectors(n,e),Ga.crossVectors(Ha,Ms);let a=this.direction.dot(Ga),o;if(a>0){if(i)return null;o=1}else if(a<0)o=-1,a=-a;else return null;yi.subVectors(this.origin,e);const l=o*this.direction.dot(Ms.crossVectors(yi,Ms));if(l<0)return null;const c=o*this.direction.dot(Ha.cross(yi));if(c<0||l+c>a)return null;const h=-o*yi.dot(Ga);return h<0?null:this.at(h/a,s)}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 lt{constructor(e,t,n,i,s,a,o,l,c,h,u,d,f,m,_,g){lt.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,s,a,o,l,c,h,u,d,f,m,_,g)}set(e,t,n,i,s,a,o,l,c,h,u,d,f,m,_,g){const p=this.elements;return p[0]=e,p[4]=t,p[8]=n,p[12]=i,p[1]=s,p[5]=a,p[9]=o,p[13]=l,p[2]=c,p[6]=h,p[10]=u,p[14]=d,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 lt().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/cr.setFromMatrixColumn(e,0).length(),s=1/cr.setFromMatrixColumn(e,1).length(),a=1/cr.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]*s,t[5]=n[5]*s,t[6]=n[6]*s,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,s=e.z,a=Math.cos(n),o=Math.sin(n),l=Math.cos(i),c=Math.sin(i),h=Math.cos(s),u=Math.sin(s);if(e.order==="XYZ"){const d=a*h,f=a*u,m=o*h,_=o*u;t[0]=l*h,t[4]=-l*u,t[8]=c,t[1]=f+m*c,t[5]=d-_*c,t[9]=-o*l,t[2]=_-d*c,t[6]=m+f*c,t[10]=a*l}else if(e.order==="YXZ"){const d=l*h,f=l*u,m=c*h,_=c*u;t[0]=d+_*o,t[4]=m*o-f,t[8]=a*c,t[1]=a*u,t[5]=a*h,t[9]=-o,t[2]=f*o-m,t[6]=_+d*o,t[10]=a*l}else if(e.order==="ZXY"){const d=l*h,f=l*u,m=c*h,_=c*u;t[0]=d-_*o,t[4]=-a*u,t[8]=m+f*o,t[1]=f+m*o,t[5]=a*h,t[9]=_-d*o,t[2]=-a*c,t[6]=o,t[10]=a*l}else if(e.order==="ZYX"){const d=a*h,f=a*u,m=o*h,_=o*u;t[0]=l*h,t[4]=m*c-f,t[8]=d*c+_,t[1]=l*u,t[5]=_*c+d,t[9]=f*c-m,t[2]=-c,t[6]=o*l,t[10]=a*l}else if(e.order==="YZX"){const d=a*l,f=a*c,m=o*l,_=o*c;t[0]=l*h,t[4]=_-d*u,t[8]=m*u+f,t[1]=u,t[5]=a*h,t[9]=-o*h,t[2]=-c*h,t[6]=f*u+m,t[10]=d-_*u}else if(e.order==="XZY"){const d=a*l,f=a*c,m=o*l,_=o*c;t[0]=l*h,t[4]=-u,t[8]=c*h,t[1]=d*u+_,t[5]=a*h,t[9]=f*u-m,t[2]=m*u-f,t[6]=o*h,t[10]=_*u+d}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(op,e,lp)}lookAt(e,t,n){const i=this.elements;return An.subVectors(e,t),An.lengthSq()===0&&(An.z=1),An.normalize(),xi.crossVectors(n,An),xi.lengthSq()===0&&(Math.abs(n.z)===1?An.x+=1e-4:An.z+=1e-4,An.normalize(),xi.crossVectors(n,An)),xi.normalize(),bs.crossVectors(An,xi),i[0]=xi.x,i[4]=bs.x,i[8]=An.x,i[1]=xi.y,i[5]=bs.y,i[9]=An.y,i[2]=xi.z,i[6]=bs.z,i[10]=An.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,s=this.elements,a=n[0],o=n[4],l=n[8],c=n[12],h=n[1],u=n[5],d=n[9],f=n[13],m=n[2],_=n[6],g=n[10],p=n[14],S=n[3],E=n[7],v=n[11],N=n[15],C=i[0],T=i[4],L=i[8],b=i[12],x=i[1],R=i[5],B=i[9],V=i[13],W=i[2],ee=i[6],k=i[10],Q=i[14],q=i[3],de=i[7],ye=i[11],le=i[15];return s[0]=a*C+o*x+l*W+c*q,s[4]=a*T+o*R+l*ee+c*de,s[8]=a*L+o*B+l*k+c*ye,s[12]=a*b+o*V+l*Q+c*le,s[1]=h*C+u*x+d*W+f*q,s[5]=h*T+u*R+d*ee+f*de,s[9]=h*L+u*B+d*k+f*ye,s[13]=h*b+u*V+d*Q+f*le,s[2]=m*C+_*x+g*W+p*q,s[6]=m*T+_*R+g*ee+p*de,s[10]=m*L+_*B+g*k+p*ye,s[14]=m*b+_*V+g*Q+p*le,s[3]=S*C+E*x+v*W+N*q,s[7]=S*T+E*R+v*ee+N*de,s[11]=S*L+E*B+v*k+N*ye,s[15]=S*b+E*V+v*Q+N*le,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],s=e[12],a=e[1],o=e[5],l=e[9],c=e[13],h=e[2],u=e[6],d=e[10],f=e[14],m=e[3],_=e[7],g=e[11],p=e[15];return m*(+s*l*u-i*c*u-s*o*d+n*c*d+i*o*f-n*l*f)+_*(+t*l*f-t*c*d+s*a*d-i*a*f+i*c*h-s*l*h)+g*(+t*c*u-t*o*f-s*a*u+n*a*f+s*o*h-n*c*h)+p*(-i*o*h-t*l*u+t*o*d+i*a*u-n*a*d+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],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8],u=e[9],d=e[10],f=e[11],m=e[12],_=e[13],g=e[14],p=e[15],S=u*g*c-_*d*c+_*l*f-o*g*f-u*l*p+o*d*p,E=m*d*c-h*g*c-m*l*f+a*g*f+h*l*p-a*d*p,v=h*_*c-m*u*c+m*o*f-a*_*f-h*o*p+a*u*p,N=m*u*l-h*_*l-m*o*d+a*_*d+h*o*g-a*u*g,C=t*S+n*E+i*v+s*N;if(C===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const T=1/C;return e[0]=S*T,e[1]=(_*d*s-u*g*s-_*i*f+n*g*f+u*i*p-n*d*p)*T,e[2]=(o*g*s-_*l*s+_*i*c-n*g*c-o*i*p+n*l*p)*T,e[3]=(u*l*s-o*d*s-u*i*c+n*d*c+o*i*f-n*l*f)*T,e[4]=E*T,e[5]=(h*g*s-m*d*s+m*i*f-t*g*f-h*i*p+t*d*p)*T,e[6]=(m*l*s-a*g*s-m*i*c+t*g*c+a*i*p-t*l*p)*T,e[7]=(a*d*s-h*l*s+h*i*c-t*d*c-a*i*f+t*l*f)*T,e[8]=v*T,e[9]=(m*u*s-h*_*s-m*n*f+t*_*f+h*n*p-t*u*p)*T,e[10]=(a*_*s-m*o*s+m*n*c-t*_*c-a*n*p+t*o*p)*T,e[11]=(h*o*s-a*u*s-h*n*c+t*u*c+a*n*f-t*o*f)*T,e[12]=N*T,e[13]=(h*_*i-m*u*i+m*n*d-t*_*d-h*n*g+t*u*g)*T,e[14]=(m*o*i-a*_*i-m*n*l+t*_*l+a*n*g-t*o*g)*T,e[15]=(a*u*i-h*o*i+h*n*l-t*u*l-a*n*d+t*o*d)*T,this}scale(e){const t=this.elements,n=e.x,i=e.y,s=e.z;return t[0]*=n,t[4]*=i,t[8]*=s,t[1]*=n,t[5]*=i,t[9]*=s,t[2]*=n,t[6]*=i,t[10]*=s,t[3]*=n,t[7]*=i,t[11]*=s,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),s=1-n,a=e.x,o=e.y,l=e.z,c=s*a,h=s*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,s*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,s,a){return this.set(1,n,s,0,e,1,a,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,s=t._x,a=t._y,o=t._z,l=t._w,c=s+s,h=a+a,u=o+o,d=s*c,f=s*h,m=s*u,_=a*h,g=a*u,p=o*u,S=l*c,E=l*h,v=l*u,N=n.x,C=n.y,T=n.z;return i[0]=(1-(_+p))*N,i[1]=(f+v)*N,i[2]=(m-E)*N,i[3]=0,i[4]=(f-v)*C,i[5]=(1-(d+p))*C,i[6]=(g+S)*C,i[7]=0,i[8]=(m+E)*T,i[9]=(g-S)*T,i[10]=(1-(d+_))*T,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 s=cr.set(i[0],i[1],i[2]).length();const a=cr.set(i[4],i[5],i[6]).length(),o=cr.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],On.copy(this);const c=1/s,h=1/a,u=1/o;return On.elements[0]*=c,On.elements[1]*=c,On.elements[2]*=c,On.elements[4]*=h,On.elements[5]*=h,On.elements[6]*=h,On.elements[8]*=u,On.elements[9]*=u,On.elements[10]*=u,t.setFromRotationMatrix(On),n.x=s,n.y=a,n.z=o,this}makePerspective(e,t,n,i,s,a,o=di){const l=this.elements,c=2*s/(t-e),h=2*s/(n-i),u=(t+e)/(t-e),d=(n+i)/(n-i);let f,m;if(o===di)f=-(a+s)/(a-s),m=-2*a*s/(a-s);else if(o===ma)f=-a/(a-s),m=-a*s/(a-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return l[0]=c,l[4]=0,l[8]=u,l[12]=0,l[1]=0,l[5]=h,l[9]=d,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,s,a,o=di){const l=this.elements,c=1/(t-e),h=1/(n-i),u=1/(a-s),d=(t+e)*c,f=(n+i)*h;let m,_;if(o===di)m=(a+s)*u,_=-2*u;else if(o===ma)m=s*u,_=-1*u;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-d,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 cr=new F,On=new lt,op=new F(0,0,0),lp=new F(1,1,1),xi=new F,bs=new F,An=new F,yc=new lt,xc=new Dn;class yn{constructor(e=0,t=0,n=0,i=yn.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,s=i[0],a=i[4],o=i[8],l=i[1],c=i[5],h=i[9],u=i[2],d=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,s)):(this._x=Math.atan2(d,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(-u,s),this._z=0);break;case"ZXY":this._x=Math.asin(vt(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,f),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-vt(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(l,s)):(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(-u,s)):(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(d,c),this._y=Math.atan2(o,s)):(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 yc.makeRotationFromQuaternion(e),this.setFromRotationMatrix(yc,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return xc.setFromEuler(this),this.setFromQuaternion(xc,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}}yn.DEFAULT_ORDER="XYZ";class Ul{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 cp=0;const Mc=new F,hr=new Dn,ai=new lt,Ss=new F,Hr=new F,hp=new F,up=new Dn,bc=new F(1,0,0),Sc=new F(0,1,0),Ec=new F(0,0,1),Ac={type:"added"},dp={type:"removed"},ur={type:"childadded",child:null},Wa={type:"childremoved",child:null};class Ut extends $i{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:cp++}),this.uuid=Vn(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Ut.DEFAULT_UP.clone();const e=new F,t=new yn,n=new Dn,i=new F(1,1,1);function s(){n.setFromEuler(t,!1)}function a(){t.setFromQuaternion(n,void 0,!1)}t._onChange(s),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 lt},normalMatrix:{value:new _t}}),this.matrix=new lt,this.matrixWorld=new lt,this.matrixAutoUpdate=Ut.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Ut.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Ul,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 hr.setFromAxisAngle(e,t),this.quaternion.multiply(hr),this}rotateOnWorldAxis(e,t){return hr.setFromAxisAngle(e,t),this.quaternion.premultiply(hr),this}rotateX(e){return this.rotateOnAxis(bc,e)}rotateY(e){return this.rotateOnAxis(Sc,e)}rotateZ(e){return this.rotateOnAxis(Ec,e)}translateOnAxis(e,t){return Mc.copy(e).applyQuaternion(this.quaternion),this.position.add(Mc.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(bc,e)}translateY(e){return this.translateOnAxis(Sc,e)}translateZ(e){return this.translateOnAxis(Ec,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(ai.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?Ss.copy(e):Ss.set(e,t,n);const i=this.parent;this.updateWorldMatrix(!0,!1),Hr.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?ai.lookAt(Hr,Ss,this.up):ai.lookAt(Ss,Hr,this.up),this.quaternion.setFromRotationMatrix(ai),i&&(ai.extractRotation(i.matrixWorld),hr.setFromRotationMatrix(ai),this.quaternion.premultiply(hr.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(Ac),ur.child=e,this.dispatchEvent(ur),ur.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(dp),Wa.child=e,this.dispatchEvent(Wa),Wa.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),ai.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),ai.multiply(e.parent.matrixWorld)),e.applyMatrix4(ai),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(Ac),ur.child=e,this.dispatchEvent(ur),ur.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 s=0,a=i.length;s<a;s++)i[s].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(Hr,e,hp),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Hr,up,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 s=0,a=i.length;s<a;s++)i[s].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 s(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=s(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 u=l[c];s(e.shapes,u)}else s(e.shapes,l)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(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(s(e.materials,this.material[l]));i.material=o}else i.material=s(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(s(e.animations,l))}}if(t){const o=a(e.geometries),l=a(e.materials),c=a(e.textures),h=a(e.images),u=a(e.shapes),d=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),u.length>0&&(n.shapes=u),d.length>0&&(n.skeletons=d),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}}Ut.DEFAULT_UP=new F(0,1,0);Ut.DEFAULT_MATRIX_AUTO_UPDATE=!0;Ut.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const zn=new F,oi=new F,Xa=new F,li=new F,dr=new F,fr=new F,wc=new F,qa=new F,ja=new F,Ya=new F,$a=new Mt,Ka=new Mt,Ja=new Mt;class Nn{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),zn.subVectors(e,t),i.cross(zn);const s=i.lengthSq();return s>0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,n,i,s){zn.subVectors(i,t),oi.subVectors(n,t),Xa.subVectors(e,t);const a=zn.dot(zn),o=zn.dot(oi),l=zn.dot(Xa),c=oi.dot(oi),h=oi.dot(Xa),u=a*c-o*o;if(u===0)return s.set(0,0,0),null;const d=1/u,f=(c*l-o*h)*d,m=(a*h-o*l)*d;return s.set(1-f-m,m,f)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,li)===null?!1:li.x>=0&&li.y>=0&&li.x+li.y<=1}static getInterpolation(e,t,n,i,s,a,o,l){return this.getBarycoord(e,t,n,i,li)===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(s,li.x),l.addScaledVector(a,li.y),l.addScaledVector(o,li.z),l)}static getInterpolatedAttribute(e,t,n,i,s,a){return $a.setScalar(0),Ka.setScalar(0),Ja.setScalar(0),$a.fromBufferAttribute(e,t),Ka.fromBufferAttribute(e,n),Ja.fromBufferAttribute(e,i),a.setScalar(0),a.addScaledVector($a,s.x),a.addScaledVector(Ka,s.y),a.addScaledVector(Ja,s.z),a}static isFrontFacing(e,t,n,i){return zn.subVectors(n,t),oi.subVectors(e,t),zn.cross(oi).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 zn.subVectors(this.c,this.b),oi.subVectors(this.a,this.b),zn.cross(oi).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Nn.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Nn.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,i,s){return Nn.getInterpolation(e,this.a,this.b,this.c,t,n,i,s)}containsPoint(e){return Nn.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Nn.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,i=this.b,s=this.c;let a,o;dr.subVectors(i,n),fr.subVectors(s,n),qa.subVectors(e,n);const l=dr.dot(qa),c=fr.dot(qa);if(l<=0&&c<=0)return t.copy(n);ja.subVectors(e,i);const h=dr.dot(ja),u=fr.dot(ja);if(h>=0&&u<=h)return t.copy(i);const d=l*u-h*c;if(d<=0&&l>=0&&h<=0)return a=l/(l-h),t.copy(n).addScaledVector(dr,a);Ya.subVectors(e,s);const f=dr.dot(Ya),m=fr.dot(Ya);if(m>=0&&f<=m)return t.copy(s);const _=f*c-l*m;if(_<=0&&c>=0&&m<=0)return o=c/(c-m),t.copy(n).addScaledVector(fr,o);const g=h*m-f*u;if(g<=0&&u-h>=0&&f-m>=0)return wc.subVectors(s,i),o=(u-h)/(u-h+(f-m)),t.copy(i).addScaledVector(wc,o);const p=1/(g+_+d);return a=_*p,o=d*p,t.copy(n).addScaledVector(dr,a).addScaledVector(fr,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const Mu={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},Mi={h:0,s:0,l:0},Es={h:0,s:0,l:0};function Za(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}class st{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,xt.colorSpaceToWorking(this,t),this}setRGB(e,t,n,i=xt.workingColorSpace){return this.r=e,this.g=t,this.b=n,xt.colorSpaceToWorking(this,i),this}setHSL(e,t,n,i=xt.workingColorSpace){if(e=Il(e,1),t=vt(t,0,1),n=vt(n,0,1),t===0)this.r=this.g=this.b=n;else{const s=n<=.5?n*(1+t):n+t-n*t,a=2*n-s;this.r=Za(a,s,e+1/3),this.g=Za(a,s,e),this.b=Za(a,s,e-1/3)}return xt.colorSpaceToWorking(this,i),this}setStyle(e,t=Tt){function n(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const a=i[1],o=i[2];switch(a){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=i[1],a=s.length;if(a===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(a===6)return this.setHex(parseInt(s,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=Mu[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=fi(e.r),this.g=fi(e.g),this.b=fi(e.b),this}copyLinearToSRGB(e){return this.r=Tr(e.r),this.g=Tr(e.g),this.b=Tr(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Tt){return xt.workingToColorSpace(fn.copy(this),e),Math.round(vt(fn.r*255,0,255))*65536+Math.round(vt(fn.g*255,0,255))*256+Math.round(vt(fn.b*255,0,255))}getHexString(e=Tt){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=xt.workingColorSpace){xt.workingToColorSpace(fn.copy(this),t);const n=fn.r,i=fn.g,s=fn.b,a=Math.max(n,i,s),o=Math.min(n,i,s);let l,c;const h=(o+a)/2;if(o===a)l=0,c=0;else{const u=a-o;switch(c=h<=.5?u/(a+o):u/(2-a-o),a){case n:l=(i-s)/u+(i<s?6:0);break;case i:l=(s-n)/u+2;break;case s:l=(n-i)/u+4;break}l/=6}return e.h=l,e.s=c,e.l=h,e}getRGB(e,t=xt.workingColorSpace){return xt.workingToColorSpace(fn.copy(this),t),e.r=fn.r,e.g=fn.g,e.b=fn.b,e}getStyle(e=Tt){xt.workingToColorSpace(fn.copy(this),e);const t=fn.r,n=fn.g,i=fn.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(Mi),this.setHSL(Mi.h+e,Mi.s+t,Mi.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(Mi),e.getHSL(Es);const n=Zr(Mi.h,Es.h,t),i=Zr(Mi.s,Es.s,t),s=Zr(Mi.l,Es.l,t);return this.setHSL(n,i,s),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,s=e.elements;return this.r=s[0]*t+s[3]*n+s[6]*i,this.g=s[1]*t+s[4]*n+s[7]*i,this.b=s[2]*t+s[5]*n+s[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 fn=new st;st.NAMES=Mu;let fp=0;class Pn extends $i{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:fp++}),this.uuid=Vn(),this.name="",this.type="Material",this.blending=Ar,this.side=Hn,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=To,this.blendDst=Co,this.blendEquation=Vi,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new st(0,0,0),this.blendAlpha=0,this.depthFunc=Cr,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=dc,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=rr,this.stencilZFail=rr,this.stencilZPass=rr,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!==Ar&&(n.blending=this.blending),this.side!==Hn&&(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!==To&&(n.blendSrc=this.blendSrc),this.blendDst!==Co&&(n.blendDst=this.blendDst),this.blendEquation!==Vi&&(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!==Cr&&(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!==dc&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==rr&&(n.stencilFail=this.stencilFail),this.stencilZFail!==rr&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==rr&&(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(s){const a=[];for(const o in s){const l=s[o];delete l.metadata,a.push(l)}return a}if(t){const s=i(e.textures),a=i(e.images);s.length>0&&(n.textures=s),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 s=0;s!==i;++s)n[s]=t[s].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 Ri extends Pn{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new st(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 yn,this.combine=Sa,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 qt=new F,As=new Ge;let pp=0;class Gt{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:pp++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=dl,this.updateRanges=[],this.gpuType=Kn,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,s=this.itemSize;i<s;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++)As.fromBufferAttribute(this,t),As.applyMatrix3(e),this.setXY(t,As.x,As.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)qt.fromBufferAttribute(this,t),qt.applyMatrix3(e),this.setXYZ(t,qt.x,qt.y,qt.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)qt.fromBufferAttribute(this,t),qt.applyMatrix4(e),this.setXYZ(t,qt.x,qt.y,qt.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)qt.fromBufferAttribute(this,t),qt.applyNormalMatrix(e),this.setXYZ(t,qt.x,qt.y,qt.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)qt.fromBufferAttribute(this,t),qt.transformDirection(e),this.setXYZ(t,qt.x,qt.y,qt.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=Bn(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=It(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Bn(t,this.array)),t}setX(e,t){return this.normalized&&(t=It(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Bn(t,this.array)),t}setY(e,t){return this.normalized&&(t=It(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=Bn(t,this.array)),t}setZ(e,t){return this.normalized&&(t=It(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=Bn(t,this.array)),t}setW(e,t){return this.normalized&&(t=It(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=It(t,this.array),n=It(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=It(t,this.array),n=It(n,this.array),i=It(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this}setXYZW(e,t,n,i,s){return e*=this.itemSize,this.normalized&&(t=It(t,this.array),n=It(n,this.array),i=It(i,this.array),s=It(s,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=s,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!==dl&&(e.usage=this.usage),e}}class bu extends Gt{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class mp extends Gt{constructor(e,t,n){super(new Int32Array(e),t,n)}}class Su extends Gt{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class mt extends Gt{constructor(e,t,n){super(new Float32Array(e),t,n)}}let gp=0;const Ln=new lt,Qa=new Ut,pr=new F,wn=new ei,Gr=new ei,Qt=new F;class Bt extends $i{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:gp++}),this.uuid=Vn(),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(yu(e)?Su:bu)(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 s=new _t().getNormalMatrix(e);n.applyNormalMatrix(s),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 Ln.makeRotationFromQuaternion(e),this.applyMatrix4(Ln),this}rotateX(e){return Ln.makeRotationX(e),this.applyMatrix4(Ln),this}rotateY(e){return Ln.makeRotationY(e),this.applyMatrix4(Ln),this}rotateZ(e){return Ln.makeRotationZ(e),this.applyMatrix4(Ln),this}translate(e,t,n){return Ln.makeTranslation(e,t,n),this.applyMatrix4(Ln),this}scale(e,t,n){return Ln.makeScale(e,t,n),this.applyMatrix4(Ln),this}lookAt(e){return Qa.lookAt(e),Qa.updateMatrix(),this.applyMatrix4(Qa.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(pr).negate(),this.translate(pr.x,pr.y,pr.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const n=[];for(let i=0,s=e.length;i<s;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 s=e[i];t.setXYZ(i,s.x,s.y,s.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 ei);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 s=t[n];wn.setFromBufferAttribute(s),this.morphTargetsRelative?(Qt.addVectors(this.boundingBox.min,wn.min),this.boundingBox.expandByPoint(Qt),Qt.addVectors(this.boundingBox.max,wn.max),this.boundingBox.expandByPoint(Qt)):(this.boundingBox.expandByPoint(wn.min),this.boundingBox.expandByPoint(wn.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 mi);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(wn.setFromBufferAttribute(e),t)for(let s=0,a=t.length;s<a;s++){const o=t[s];Gr.setFromBufferAttribute(o),this.morphTargetsRelative?(Qt.addVectors(wn.min,Gr.min),wn.expandByPoint(Qt),Qt.addVectors(wn.max,Gr.max),wn.expandByPoint(Qt)):(wn.expandByPoint(Gr.min),wn.expandByPoint(Gr.max))}wn.getCenter(n);let i=0;for(let s=0,a=e.count;s<a;s++)Qt.fromBufferAttribute(e,s),i=Math.max(i,n.distanceToSquared(Qt));if(t)for(let s=0,a=t.length;s<a;s++){const o=t[s],l=this.morphTargetsRelative;for(let c=0,h=o.count;c<h;c++)Qt.fromBufferAttribute(o,c),l&&(pr.fromBufferAttribute(e,c),Qt.add(pr)),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,s=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Gt(new Float32Array(4*n.count),4));const a=this.getAttribute("tangent"),o=[],l=[];for(let L=0;L<n.count;L++)o[L]=new F,l[L]=new F;const c=new F,h=new F,u=new F,d=new Ge,f=new Ge,m=new Ge,_=new F,g=new F;function p(L,b,x){c.fromBufferAttribute(n,L),h.fromBufferAttribute(n,b),u.fromBufferAttribute(n,x),d.fromBufferAttribute(s,L),f.fromBufferAttribute(s,b),m.fromBufferAttribute(s,x),h.sub(c),u.sub(c),f.sub(d),m.sub(d);const R=1/(f.x*m.y-m.x*f.y);isFinite(R)&&(_.copy(h).multiplyScalar(m.y).addScaledVector(u,-f.y).multiplyScalar(R),g.copy(u).multiplyScalar(f.x).addScaledVector(h,-m.x).multiplyScalar(R),o[L].add(_),o[b].add(_),o[x].add(_),l[L].add(g),l[b].add(g),l[x].add(g))}let S=this.groups;S.length===0&&(S=[{start:0,count:e.count}]);for(let L=0,b=S.length;L<b;++L){const x=S[L],R=x.start,B=x.count;for(let V=R,W=R+B;V<W;V+=3)p(e.getX(V+0),e.getX(V+1),e.getX(V+2))}const E=new F,v=new F,N=new F,C=new F;function T(L){N.fromBufferAttribute(i,L),C.copy(N);const b=o[L];E.copy(b),E.sub(N.multiplyScalar(N.dot(b))).normalize(),v.crossVectors(C,b);const R=v.dot(l[L])<0?-1:1;a.setXYZW(L,E.x,E.y,E.z,R)}for(let L=0,b=S.length;L<b;++L){const x=S[L],R=x.start,B=x.count;for(let V=R,W=R+B;V<W;V+=3)T(e.getX(V+0)),T(e.getX(V+1)),T(e.getX(V+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 Gt(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let d=0,f=n.count;d<f;d++)n.setXYZ(d,0,0,0);const i=new F,s=new F,a=new F,o=new F,l=new F,c=new F,h=new F,u=new F;if(e)for(let d=0,f=e.count;d<f;d+=3){const m=e.getX(d+0),_=e.getX(d+1),g=e.getX(d+2);i.fromBufferAttribute(t,m),s.fromBufferAttribute(t,_),a.fromBufferAttribute(t,g),h.subVectors(a,s),u.subVectors(i,s),h.cross(u),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 d=0,f=t.count;d<f;d+=3)i.fromBufferAttribute(t,d+0),s.fromBufferAttribute(t,d+1),a.fromBufferAttribute(t,d+2),h.subVectors(a,s),u.subVectors(i,s),h.cross(u),n.setXYZ(d+0,h.x,h.y,h.z),n.setXYZ(d+1,h.x,h.y,h.z),n.setXYZ(d+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,u=o.normalized,d=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++)d[m++]=c[f++]}return new Gt(d,h,u)}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 s=this.morphAttributes;for(const o in s){const l=[],c=s[o];for(let h=0,u=c.length;h<u;h++){const d=c[h],f=e(d,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 s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],h=[];for(let u=0,d=c.length;u<d;u++){const f=c[u];h.push(f.toJSON(e.data))}h.length>0&&(i[l]=h,s=!0)}s&&(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 s=e.morphAttributes;for(const c in s){const h=[],u=s[c];for(let d=0,f=u.length;d<f;d++)h.push(u[d].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 u=a[c];this.addGroup(u.start,u.count,u.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 Tc=new lt,Ni=new Ur,ws=new mi,Cc=new F,Ts=new F,Cs=new F,Rs=new F,eo=new F,Ds=new F,Rc=new F,Ps=new F;class Ct extends Ut{constructor(e=new Bt,t=new Ri){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 s=0,a=i.length;s<a;s++){const o=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}getVertexPosition(e,t){const n=this.geometry,i=n.attributes.position,s=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(i,e);const o=this.morphTargetInfluences;if(s&&o){Ds.set(0,0,0);for(let l=0,c=s.length;l<c;l++){const h=o[l],u=s[l];h!==0&&(eo.fromBufferAttribute(u,e),a?Ds.addScaledVector(eo,h):Ds.addScaledVector(eo.sub(t),h))}t.add(Ds)}return t}raycast(e,t){const n=this.geometry,i=this.material,s=this.matrixWorld;i!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),ws.copy(n.boundingSphere),ws.applyMatrix4(s),Ni.copy(e.ray).recast(e.near),!(ws.containsPoint(Ni.origin)===!1&&(Ni.intersectSphere(ws,Cc)===null||Ni.origin.distanceToSquared(Cc)>(e.far-e.near)**2))&&(Tc.copy(s).invert(),Ni.copy(e.ray).applyMatrix4(Tc),!(n.boundingBox!==null&&Ni.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,Ni)))}_computeIntersections(e,t,n){let i;const s=this.geometry,a=this.material,o=s.index,l=s.attributes.position,c=s.attributes.uv,h=s.attributes.uv1,u=s.attributes.normal,d=s.groups,f=s.drawRange;if(o!==null)if(Array.isArray(a))for(let m=0,_=d.length;m<_;m++){const g=d[m],p=a[g.materialIndex],S=Math.max(g.start,f.start),E=Math.min(o.count,Math.min(g.start+g.count,f.start+f.count));for(let v=S,N=E;v<N;v+=3){const C=o.getX(v),T=o.getX(v+1),L=o.getX(v+2);i=Ls(this,p,e,n,c,h,u,C,T,L),i&&(i.faceIndex=Math.floor(v/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 S=o.getX(g),E=o.getX(g+1),v=o.getX(g+2);i=Ls(this,a,e,n,c,h,u,S,E,v),i&&(i.faceIndex=Math.floor(g/3),t.push(i))}}else if(l!==void 0)if(Array.isArray(a))for(let m=0,_=d.length;m<_;m++){const g=d[m],p=a[g.materialIndex],S=Math.max(g.start,f.start),E=Math.min(l.count,Math.min(g.start+g.count,f.start+f.count));for(let v=S,N=E;v<N;v+=3){const C=v,T=v+1,L=v+2;i=Ls(this,p,e,n,c,h,u,C,T,L),i&&(i.faceIndex=Math.floor(v/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 S=g,E=g+1,v=g+2;i=Ls(this,a,e,n,c,h,u,S,E,v),i&&(i.faceIndex=Math.floor(g/3),t.push(i))}}}}function _p(r,e,t,n,i,s,a,o){let l;if(e.side===vn?l=n.intersectTriangle(a,s,i,!0,o):l=n.intersectTriangle(i,s,a,e.side===Hn,o),l===null)return null;Ps.copy(o),Ps.applyMatrix4(r.matrixWorld);const c=t.ray.origin.distanceTo(Ps);return c<t.near||c>t.far?null:{distance:c,point:Ps.clone(),object:r}}function Ls(r,e,t,n,i,s,a,o,l,c){r.getVertexPosition(o,Ts),r.getVertexPosition(l,Cs),r.getVertexPosition(c,Rs);const h=_p(r,e,t,n,Ts,Cs,Rs,Rc);if(h){const u=new F;Nn.getBarycoord(Rc,Ts,Cs,Rs,u),i&&(h.uv=Nn.getInterpolatedAttribute(i,o,l,c,u,new Ge)),s&&(h.uv1=Nn.getInterpolatedAttribute(s,o,l,c,u,new Ge)),a&&(h.normal=Nn.getInterpolatedAttribute(a,o,l,c,u,new F),h.normal.dot(n.direction)>0&&h.normal.multiplyScalar(-1));const d={a:o,b:l,c,normal:new F,materialIndex:0};Nn.getNormal(Ts,Cs,Rs,d.normal),h.face=d,h.barycoord=u}return h}class Ki extends Bt{constructor(e=1,t=1,n=1,i=1,s=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:s,depthSegments:a};const o=this;i=Math.floor(i),s=Math.floor(s),a=Math.floor(a);const l=[],c=[],h=[],u=[];let d=0,f=0;m("z","y","x",-1,-1,n,t,e,a,s,0),m("z","y","x",1,-1,n,t,-e,a,s,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,s,4),m("x","y","z",-1,-1,e,t,-n,i,s,5),this.setIndex(l),this.setAttribute("position",new mt(c,3)),this.setAttribute("normal",new mt(h,3)),this.setAttribute("uv",new mt(u,2));function m(_,g,p,S,E,v,N,C,T,L,b){const x=v/T,R=N/L,B=v/2,V=N/2,W=C/2,ee=T+1,k=L+1;let Q=0,q=0;const de=new F;for(let ye=0;ye<k;ye++){const le=ye*R-V;for(let Pe=0;Pe<ee;Pe++){const Te=Pe*x-B;de[_]=Te*S,de[g]=le*E,de[p]=W,c.push(de.x,de.y,de.z),de[_]=0,de[g]=0,de[p]=C>0?1:-1,h.push(de.x,de.y,de.z),u.push(Pe/T),u.push(1-ye/L),Q+=1}}for(let ye=0;ye<L;ye++)for(let le=0;le<T;le++){const Pe=d+le+ee*ye,Te=d+le+ee*(ye+1),Y=d+(le+1)+ee*(ye+1),re=d+(le+1)+ee*ye;l.push(Pe,Te,re),l.push(Te,Y,re),q+=6}o.addGroup(f,q,b),f+=q,d+=Q}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Ki(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function Ir(r){const e={};for(const t in r){e[t]={};for(const n in r[t]){const i=r[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 _n(r){const e={};for(let t=0;t<r.length;t++){const n=Ir(r[t]);for(const i in n)e[i]=n[i]}return e}function vp(r){const e=[];for(let t=0;t<r.length;t++)e.push(r[t].clone());return e}function Eu(r){const e=r.getRenderTarget();return e===null?r.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:xt.workingColorSpace}const Fl={clone:Ir,merge:_n};var yp=`void main() {
|
|
6
6
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
7
7
|
}`,xp=`void main() {
|
|
8
8
|
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
|
|
9
|
-
}`;class pi extends
|
|
9
|
+
}`;class pi extends Pn{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=yp,this.fragmentShader=xp,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=Ir(e.uniforms),this.uniformsGroups=vp(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 Au extends Ut{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new lt,this.projectionMatrix=new lt,this.projectionMatrixInverse=new lt,this.coordinateSystem=di}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 bi=new F,Dc=new Ge,Pc=new Ge;class ln extends Au{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=Lr*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Jr*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Lr*2*Math.atan(Math.tan(Jr*.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){bi.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(bi.x,bi.y).multiplyScalar(-e/bi.z),bi.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(bi.x,bi.y).multiplyScalar(-e/bi.z)}getViewSize(e,t){return this.getViewBounds(e,Dc,Pc),t.subVectors(Pc,Dc)}setViewOffset(e,t,n,i,s,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=s,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(Jr*.5*this.fov)/this.zoom,n=2*t,i=this.aspect*n,s=-.5*i;const a=this.view;if(this.view!==null&&this.view.enabled){const l=a.fullWidth,c=a.fullHeight;s+=a.offsetX*i/l,t-=a.offsetY*n/c,i*=a.width/l,n*=a.height/c}const o=this.filmOffset;o!==0&&(s+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+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 mr=-90,gr=1;class Mp extends Ut{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new ln(mr,gr,e,t);i.layers=this.layers,this.add(i);const s=new ln(mr,gr,e,t);s.layers=this.layers,this.add(s);const a=new ln(mr,gr,e,t);a.layers=this.layers,this.add(a);const o=new ln(mr,gr,e,t);o.layers=this.layers,this.add(o);const l=new ln(mr,gr,e,t);l.layers=this.layers,this.add(l);const c=new ln(mr,gr,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,i,s,a,o,l]=t;for(const c of t)this.remove(c);if(e===di)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),s.up.set(0,0,-1),s.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===ma)n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),s.up.set(0,0,1),s.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[s,a,o,l,c,h]=this.children,u=e.getRenderTarget(),d=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,s),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(u,d,f),e.xr.enabled=m,n.texture.needsPMREMUpdate=!0}}class wu extends cn{constructor(e=[],t=Rr,n,i,s,a,o,l,c,h){super(e,t,n,i,s,a,o,l,c,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class bp 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 wu(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,7 +41,7 @@
|
|
|
41
41
|
gl_FragColor = texture2D( tEquirect, sampleUV );
|
|
42
42
|
|
|
43
43
|
}
|
|
44
|
-
`},i=new Ji(5,5,5),s=new pi({name:"CubemapFromEquirect",uniforms:Ir(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:vn,blending:wi});s.uniforms.tEquirect.value=t;const a=new Ct(i,s),o=t.minFilter;return t.minFilter===ui&&(t.minFilter=Tn),new Mp(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 s=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(t,n,i);e.setRenderTarget(s)}}class Kn extends Ut{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Sp={type:"move"};class eo{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Kn,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 Kn,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 Kn,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,s=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"],u=c.joints["thumb-tip"],d=h.position.distanceTo(u.position),f=.02,m=.005;c.inputState.pinching&&d>f+m?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&d<=f-m&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));o!==null&&(i=t.getPose(e.targetRaySpace,n),i===null&&s!==null&&(i=s),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(Sp)))}return o!==null&&(o.visible=i!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new Kn;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}class Ol extends Ut{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 yn,this.environmentIntensity=1,this.environmentRotation=new yn,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 Tu{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=ul,this.updateRanges=[],this.version=0,this.uuid=Vn()}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,s=this.stride;i<s;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=Vn()),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=Vn()),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 gn=new F;class Zn{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++)gn.fromBufferAttribute(this,t),gn.applyMatrix4(e),this.setXYZ(t,gn.x,gn.y,gn.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)gn.fromBufferAttribute(this,t),gn.applyNormalMatrix(e),this.setXYZ(t,gn.x,gn.y,gn.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)gn.fromBufferAttribute(this,t),gn.transformDirection(e),this.setXYZ(t,gn.x,gn.y,gn.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=Bn(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=It(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=It(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=It(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=It(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=It(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=Bn(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Bn(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Bn(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Bn(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=It(t,this.array),n=It(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=It(t,this.array),n=It(n,this.array),i=It(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,s){return e=e*this.data.stride+this.offset,this.normalized&&(t=It(t,this.array),n=It(n,this.array),i=It(i,this.array),s=It(s,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]=s,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 s=0;s<this.itemSize;s++)t.push(this.data.array[i+s])}return new Gt(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 Zn(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 s=0;s<this.itemSize;s++)t.push(this.data.array[i+s])}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 Aa extends Dn{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new st(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 _r;const Wr=new F,vr=new F,yr=new F,xr=new Ge,Xr=new Ge,Cu=new lt,Is=new F,qr=new F,Ns=new F,Pc=new Ge,to=new Ge,Ic=new Ge;class zl extends Ut{constructor(e=new Aa){if(super(),this.isSprite=!0,this.type="Sprite",_r===void 0){_r=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 Tu(t,5);_r.setIndex([0,1,2,0,2,3]),_r.setAttribute("position",new Zn(n,3,0,!1)),_r.setAttribute("uv",new Zn(n,2,3,!1))}this.geometry=_r,this.material=e,this.center=new Ge(.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.'),vr.setFromMatrixScale(this.matrixWorld),Cu.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),yr.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&vr.multiplyScalar(-yr.z);const n=this.material.rotation;let i,s;n!==0&&(s=Math.cos(n),i=Math.sin(n));const a=this.center;Us(Is.set(-.5,-.5,0),yr,a,vr,i,s),Us(qr.set(.5,-.5,0),yr,a,vr,i,s),Us(Ns.set(.5,.5,0),yr,a,vr,i,s),Pc.set(0,0),to.set(1,0),Ic.set(1,1);let o=e.ray.intersectTriangle(Is,qr,Ns,!1,Wr);if(o===null&&(Us(qr.set(-.5,.5,0),yr,a,vr,i,s),to.set(0,1),o=e.ray.intersectTriangle(Is,Ns,qr,!1,Wr),o===null))return;const l=e.ray.origin.distanceTo(Wr);l<e.near||l>e.far||t.push({distance:l,point:Wr.clone(),uv:Nn.getInterpolation(Wr,Is,qr,Ns,Pc,to,Ic,new Ge),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 Us(r,e,t,n,i,s){xr.subVectors(r,t).addScalar(.5).multiply(n),i!==void 0?(Xr.x=s*xr.x-i*xr.y,Xr.y=i*xr.x+s*xr.y):Xr.copy(xr),r.copy(e),r.x+=Xr.x,r.y+=Xr.y,r.applyMatrix4(Cu)}const Fs=new F,Nc=new F;class Ep extends Ut{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 s=t[n];this.addLevel(s.object.clone(),s.distance,s.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0,n=0){t=Math.abs(t);const i=this.levels;let s;for(s=0;s<i.length&&!(t<i[s].distance);s++);return i.splice(s,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 s=t[n].distance;if(t[n].object.visible&&(s-=s*t[n].hysteresis),e<s)break}return t[n-1].object}return null}raycast(e,t){if(this.levels.length>0){Fs.setFromMatrixPosition(this.matrixWorld);const i=e.ray.origin.distanceTo(Fs);this.getObjectForDistance(i).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Fs.setFromMatrixPosition(e.matrixWorld),Nc.setFromMatrixPosition(this.matrixWorld);const n=Fs.distanceTo(Nc)/e.zoom;t[0].object.visible=!0;let i,s;for(i=1,s=t.length;i<s;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<s;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,s=n.length;i<s;i++){const a=n[i];t.object.levels.push({object:a.object.uuid,distance:a.distance,hysteresis:a.hysteresis})}return t}}const Uc=new F,Fc=new Mt,Oc=new Mt,Ap=new F,zc=new lt,Os=new F,no=new mi,Bc=new lt,io=new Ur;class wp extends Ct{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=lc,this.bindMatrix=new lt,this.bindMatrixInverse=new lt,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new ei),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Os),this.boundingBox.expandByPoint(Os)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new mi),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Os),this.boundingSphere.expandByPoint(Os)}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(),no.copy(this.boundingSphere),no.applyMatrix4(i),e.ray.intersectsSphere(no)!==!1&&(Bc.copy(i).invert(),io.copy(e.ray).applyMatrix4(Bc),!(this.boundingBox!==null&&io.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,io)))}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 Mt,t=this.geometry.attributes.skinWeight;for(let n=0,i=t.count;n<i;n++){e.fromBufferAttribute(t,n);const s=1/e.manhattanLength();s!==1/0?e.multiplyScalar(s):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===lc?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===Mf?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const n=this.skeleton,i=this.geometry;Fc.fromBufferAttribute(i.attributes.skinIndex,e),Oc.fromBufferAttribute(i.attributes.skinWeight,e),Uc.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let s=0;s<4;s++){const a=Oc.getComponent(s);if(a!==0){const o=Fc.getComponent(s);zc.multiplyMatrices(n.bones[o].matrixWorld,n.boneInverses[o]),t.addScaledVector(Ap.copy(Uc).applyMatrix4(zc),a)}}return t.applyMatrix4(this.bindMatrixInverse)}}class Ru extends Ut{constructor(){super(),this.isBone=!0,this.type="Bone"}}class Du extends cn{constructor(e=null,t=1,n=1,i,s,a,o,l,c=Cn,h=Cn,u,d){super(null,a,o,l,c,h,i,s,u,d),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const kc=new lt,Tp=new lt;class Bl{constructor(e=[],t=[]){this.uuid=Vn(),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 lt)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const n=new lt;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 s=0,a=e.length;s<a;s++){const o=e[s]?e[s].matrixWorld:Tp;kc.multiplyMatrices(o,t[s]),kc.toArray(n,s*16)}i!==null&&(i.needsUpdate=!0)}clone(){return new Bl(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,Un,Jn);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 s=e.bones[n];let a=t[s];a===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",s),a=new Ru),this.bones.push(a),this.boneInverses.push(new lt().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,s=t.length;i<s;i++){const a=t[i];e.bones.push(a.uuid);const o=n[i];e.boneInverses.push(o.toArray())}return e}}const ro=new F,Cp=new F,Rp=new _t;class Ei{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=ro.subVectors(n,t).cross(Cp.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(ro),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:t.copy(e.start).addScaledVector(n,s)}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||Rp.getNormalMatrix(e),i=this.coplanarPoint(ro).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),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 Ui=new mi,zs=new F;class kl{constructor(e=new Ei,t=new Ei,n=new Ei,i=new Ei,s=new Ei,a=new Ei){this.planes=[e,t,n,i,s,a]}set(e,t,n,i,s,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(s),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=di){const n=this.planes,i=e.elements,s=i[0],a=i[1],o=i[2],l=i[3],c=i[4],h=i[5],u=i[6],d=i[7],f=i[8],m=i[9],_=i[10],g=i[11],p=i[12],S=i[13],E=i[14],v=i[15];if(n[0].setComponents(l-s,d-c,g-f,v-p).normalize(),n[1].setComponents(l+s,d+c,g+f,v+p).normalize(),n[2].setComponents(l+a,d+h,g+m,v+S).normalize(),n[3].setComponents(l-a,d-h,g-m,v-S).normalize(),n[4].setComponents(l-o,d-u,g-_,v-E).normalize(),t===di)n[5].setComponents(l+o,d+u,g+_,v+E).normalize();else if(t===ma)n[5].setComponents(o,u,_,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(),Ui.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Ui.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Ui)}intersectsSprite(e){return Ui.center.set(0,0,0),Ui.radius=.7071067811865476,Ui.applyMatrix4(e.matrixWorld),this.intersectsSphere(Ui)}intersectsSphere(e){const t=this.planes,n=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].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(zs.x=i.normal.x>0?e.max.x:e.min.x,zs.y=i.normal.y>0?e.max.y:e.min.y,zs.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(zs)<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 Ci extends Dn{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new st(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 ga=new F,_a=new F,Vc=new lt,jr=new Ur,Bs=new mi,so=new F,Hc=new F;class Vl extends Ut{constructor(e=new Bt,t=new Ci){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,s=t.count;i<s;i++)ga.fromBufferAttribute(t,i-1),_a.fromBufferAttribute(t,i),n[i]=n[i-1],n[i]+=ga.distanceTo(_a);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,s=e.params.Line.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Bs.copy(n.boundingSphere),Bs.applyMatrix4(i),Bs.radius+=s,e.ray.intersectsSphere(Bs)===!1)return;Vc.copy(i).invert(),jr.copy(e.ray).applyMatrix4(Vc);const o=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,c=this.isLineSegments?2:1,h=n.index,d=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(_),S=h.getX(_+1),E=ks(this,e,jr,l,p,S,_);E&&t.push(E)}if(this.isLineLoop){const _=h.getX(m-1),g=h.getX(f),p=ks(this,e,jr,l,_,g,m-1);p&&t.push(p)}}else{const f=Math.max(0,a.start),m=Math.min(d.count,a.start+a.count);for(let _=f,g=m-1;_<g;_+=c){const p=ks(this,e,jr,l,_,_+1,_);p&&t.push(p)}if(this.isLineLoop){const _=ks(this,e,jr,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 s=0,a=i.length;s<a;s++){const o=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}}function ks(r,e,t,n,i,s,a){const o=r.geometry.attributes.position;if(ga.fromBufferAttribute(o,i),_a.fromBufferAttribute(o,s),t.distanceSqToSegment(ga,_a,so,Hc)>n)return;so.applyMatrix4(r.matrixWorld);const c=e.ray.origin.distanceTo(so);if(!(c<e.near||c>e.far))return{distance:c,point:Hc.clone().applyMatrix4(r.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:r}}const Gc=new F,Wc=new F;class va extends Vl{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,s=t.count;i<s;i+=2)Gc.fromBufferAttribute(t,i),Wc.fromBufferAttribute(t,i+1),n[i]=i===0?0:n[i-1],n[i+1]=n[i]+Gc.distanceTo(Wc);e.setAttribute("lineDistance",new mt(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class Wi extends Dn{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new st(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 Xc=new lt,dl=new Ur,Vs=new mi,Hs=new F;class Qr extends Ut{constructor(e=new Bt,t=new Wi){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,s=e.params.Points.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Vs.copy(n.boundingSphere),Vs.applyMatrix4(i),Vs.radius+=s,e.ray.intersectsSphere(Vs)===!1)return;Xc.copy(i).invert(),dl.copy(e.ray).applyMatrix4(Xc);const o=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,c=n.index,u=n.attributes.position;if(c!==null){const d=Math.max(0,a.start),f=Math.min(c.count,a.start+a.count);for(let m=d,_=f;m<_;m++){const g=c.getX(m);Hs.fromBufferAttribute(u,g),qc(Hs,g,l,i,e,t,this)}}else{const d=Math.max(0,a.start),f=Math.min(u.count,a.start+a.count);for(let m=d,_=f;m<_;m++)Hs.fromBufferAttribute(u,m),qc(Hs,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 s=0,a=i.length;s<a;s++){const o=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}}function qc(r,e,t,n,i,s,a){const o=dl.distanceSqToPoint(r);if(o<t){const l=new F;dl.closestPointToPoint(r,l),l.applyMatrix4(n);const c=i.ray.origin.distanceTo(l);if(c<i.near||c>i.far)return;s.push({distance:c,distanceToRay:Math.sqrt(o),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:a})}}class Dp extends cn{constructor(e,t,n,i,s,a,o,l,c){super(e,t,n,i,s,a,o,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Lu extends cn{constructor(e,t,n=qi,i,s,a,o=Cn,l=Cn,c,h=ss,u=1){if(h!==ss&&h!==as)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const d={width:e,height:t,depth:u};super(d,i,s,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 Nl(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 Hl extends Bt{constructor(e=1,t=1,n=1,i=32,s=1,a=!1,o=0,l=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:s,openEnded:a,thetaStart:o,thetaLength:l};const c=this;i=Math.floor(i),s=Math.floor(s);const h=[],u=[],d=[],f=[];let m=0;const _=[],g=n/2;let p=0;S(),a===!1&&(e>0&&E(!0),t>0&&E(!1)),this.setIndex(h),this.setAttribute("position",new mt(u,3)),this.setAttribute("normal",new mt(d,3)),this.setAttribute("uv",new mt(f,2));function S(){const v=new F,N=new F;let C=0;const T=(t-e)/n;for(let P=0;P<=s;P++){const b=[],x=P/s,R=x*(t-e)+e;for(let B=0;B<=i;B++){const V=B/i,W=V*l+o,ee=Math.sin(W),k=Math.cos(W);N.x=R*ee,N.y=-x*n+g,N.z=R*k,u.push(N.x,N.y,N.z),v.set(ee,T,k).normalize(),d.push(v.x,v.y,v.z),f.push(V,1-x),b.push(m++)}_.push(b)}for(let P=0;P<i;P++)for(let b=0;b<s;b++){const x=_[b][P],R=_[b+1][P],B=_[b+1][P+1],V=_[b][P+1];(e>0||b!==0)&&(h.push(x,R,V),C+=3),(t>0||b!==s-1)&&(h.push(R,B,V),C+=3)}c.addGroup(p,C,0),p+=C}function E(v){const N=m,C=new Ge,T=new F;let P=0;const b=v===!0?e:t,x=v===!0?1:-1;for(let B=1;B<=i;B++)u.push(0,g*x,0),d.push(0,x,0),f.push(.5,.5),m++;const R=m;for(let B=0;B<=i;B++){const W=B/i*l+o,ee=Math.cos(W),k=Math.sin(W);T.x=b*k,T.y=g*x,T.z=b*ee,u.push(T.x,T.y,T.z),d.push(0,x,0),C.x=ee*.5+.5,C.y=k*.5*x+.5,f.push(C.x,C.y),m++}for(let B=0;B<i;B++){const V=N+B,W=R+B;v===!0?h.push(W,W+1,V):h.push(W+1,W,V),P+=3}c.addGroup(p,P,v===!0?1:2),p+=P}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Hl(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class gi{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),s=0;t.push(0);for(let a=1;a<=e;a++)n=this.getPoint(a/e),s+=n.distanceTo(i),t.push(s),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 s=n.length;let a;t?a=t:a=e*n[s-1];let o=0,l=s-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/(s-1);const h=n[i],d=n[i+1]-h,f=(a-h)/d;return(i+f)/(s-1)}getTangent(e,t){let i=e-1e-4,s=e+1e-4;i<0&&(i=0),s>1&&(s=1);const a=this.getPoint(i),o=this.getPoint(s),l=t||(a.isVector2?new Ge: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=[],s=[],a=[],o=new F,l=new lt;for(let f=0;f<=e;f++){const m=f/e;i[f]=this.getTangentAt(m,new F)}s[0]=new F,a[0]=new F;let c=Number.MAX_VALUE;const h=Math.abs(i[0].x),u=Math.abs(i[0].y),d=Math.abs(i[0].z);h<=c&&(c=h,n.set(1,0,0)),u<=c&&(c=u,n.set(0,1,0)),d<=c&&n.set(0,0,1),o.crossVectors(i[0],n).normalize(),s[0].crossVectors(i[0],o),a[0].crossVectors(i[0],s[0]);for(let f=1;f<=e;f++){if(s[f]=s[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));s[f].applyMatrix4(l.makeRotationAxis(o,m))}a[f].crossVectors(i[f],s[f])}if(t===!0){let f=Math.acos(vt(s[0].dot(s[e]),-1,1));f/=e,i[0].dot(o.crossVectors(s[0],s[e]))>0&&(f=-f);for(let m=1;m<=e;m++)s[m].applyMatrix4(l.makeRotationAxis(i[m],f*m)),a[m].crossVectors(i[m],s[m])}return{tangents:i,normals:s,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 gi{constructor(e=0,t=0,n=1,i=1,s=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=s,this.aEndAngle=a,this.aClockwise=o,this.aRotation=l}getPoint(e,t=new Ge){const n=t,i=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const a=Math.abs(s)<Number.EPSILON;for(;s<0;)s+=i;for(;s>i;)s-=i;s<Number.EPSILON&&(a?s=0:s=i),this.aClockwise===!0&&!a&&(s===i?s=-i:s=s-i);const o=this.aStartAngle+e*s;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),u=Math.sin(this.aRotation),d=l-this.aX,f=c-this.aY;l=d*h-f*u+this.aX,c=d*u+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 Lp extends Pu{constructor(e,t,n,i,s,a){super(e,t,n,n,i,s,a),this.isArcCurve=!0,this.type="ArcCurve"}}function Gl(){let r=0,e=0,t=0,n=0;function i(s,a,o,l){r=s,e=o,t=-3*s+3*a-2*o-l,n=2*s-2*a+o+l}return{initCatmullRom:function(s,a,o,l,c){i(a,o,c*(o-s),c*(l-a))},initNonuniformCatmullRom:function(s,a,o,l,c,h,u){let d=(a-s)/c-(o-s)/(c+h)+(o-a)/h,f=(o-a)/h-(l-a)/(h+u)+(l-o)/u;d*=h,f*=h,i(a,o,d,f)},calc:function(s){const a=s*s,o=a*s;return r+e*s+t*a+n*o}}}const Gs=new F,ao=new Gl,oo=new Gl,lo=new Gl;class Iu extends gi{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,s=i.length,a=(s-(this.closed?0:1))*e;let o=Math.floor(a),l=a-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/s)+1)*s:l===0&&o===s-1&&(o=s-2,l=1);let c,h;this.closed||o>0?c=i[(o-1)%s]:(Gs.subVectors(i[0],i[1]).add(i[0]),c=Gs);const u=i[o%s],d=i[(o+1)%s];if(this.closed||o+2<s?h=i[(o+2)%s]:(Gs.subVectors(i[s-1],i[s-2]).add(i[s-1]),h=Gs),this.curveType==="centripetal"||this.curveType==="chordal"){const f=this.curveType==="chordal"?.5:.25;let m=Math.pow(c.distanceToSquared(u),f),_=Math.pow(u.distanceToSquared(d),f),g=Math.pow(d.distanceToSquared(h),f);_<1e-4&&(_=1),m<1e-4&&(m=_),g<1e-4&&(g=_),ao.initNonuniformCatmullRom(c.x,u.x,d.x,h.x,m,_,g),oo.initNonuniformCatmullRom(c.y,u.y,d.y,h.y,m,_,g),lo.initNonuniformCatmullRom(c.z,u.z,d.z,h.z,m,_,g)}else this.curveType==="catmullrom"&&(ao.initCatmullRom(c.x,u.x,d.x,h.x,this.tension),oo.initCatmullRom(c.y,u.y,d.y,h.y,this.tension),lo.initCatmullRom(c.z,u.z,d.z,h.z,this.tension));return n.set(ao.calc(l),oo.calc(l),lo.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 jc(r,e,t,n,i){const s=(n-e)*.5,a=(i-t)*.5,o=r*r,l=r*o;return(2*t-2*n+s+a)*l+(-3*t+3*n-2*s-a)*o+s*r+t}function Pp(r,e){const t=1-r;return t*t*e}function Ip(r,e){return 2*(1-r)*r*e}function Np(r,e){return r*r*e}function es(r,e,t,n){return Pp(r,e)+Ip(r,t)+Np(r,n)}function Up(r,e){const t=1-r;return t*t*t*e}function Fp(r,e){const t=1-r;return 3*t*t*r*e}function Op(r,e){return 3*(1-r)*r*r*e}function zp(r,e){return r*r*r*e}function ts(r,e,t,n,i){return Up(r,e)+Fp(r,t)+Op(r,n)+zp(r,i)}class Bp extends gi{constructor(e=new Ge,t=new Ge,n=new Ge,i=new Ge){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=i}getPoint(e,t=new Ge){const n=t,i=this.v0,s=this.v1,a=this.v2,o=this.v3;return n.set(ts(e,i.x,s.x,a.x,o.x),ts(e,i.y,s.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 kp extends gi{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,s=this.v1,a=this.v2,o=this.v3;return n.set(ts(e,i.x,s.x,a.x,o.x),ts(e,i.y,s.y,a.y,o.y),ts(e,i.z,s.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 Vp extends gi{constructor(e=new Ge,t=new Ge){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new Ge){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 Ge){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 Hp extends gi{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 Gp extends gi{constructor(e=new Ge,t=new Ge,n=new Ge){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new Ge){const n=t,i=this.v0,s=this.v1,a=this.v2;return n.set(es(e,i.x,s.x,a.x),es(e,i.y,s.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 Nu extends gi{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,s=this.v1,a=this.v2;return n.set(es(e,i.x,s.x,a.x),es(e,i.y,s.y,a.y),es(e,i.z,s.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 Wp extends gi{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new Ge){const n=t,i=this.points,s=(i.length-1)*e,a=Math.floor(s),o=s-a,l=i[a===0?a:a-1],c=i[a],h=i[a>i.length-2?i.length-1:a+1],u=i[a>i.length-3?i.length-1:a+2];return n.set(jc(o,l.x,c.x,h.x,u.x),jc(o,l.y,c.y,h.y,u.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 Ge().fromArray(i))}return this}}var Xp=Object.freeze({__proto__:null,ArcCurve:Lp,CatmullRomCurve3:Iu,CubicBezierCurve:Bp,CubicBezierCurve3:kp,EllipseCurve:Pu,LineCurve:Vp,LineCurve3:Hp,QuadraticBezierCurve:Gp,QuadraticBezierCurve3:Nu,SplineCurve:Wp});class us 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 s=e/2,a=t/2,o=Math.floor(n),l=Math.floor(i),c=o+1,h=l+1,u=e/o,d=t/l,f=[],m=[],_=[],g=[];for(let p=0;p<h;p++){const S=p*d-a;for(let E=0;E<c;E++){const v=E*u-s;m.push(v,-S,0),_.push(0,0,1),g.push(E/o),g.push(1-p/l)}}for(let p=0;p<l;p++)for(let S=0;S<o;S++){const E=S+c*p,v=S+c*(p+1),N=S+1+c*(p+1),C=S+1+c*p;f.push(E,v,C),f.push(v,N,C)}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 us(e.width,e.height,e.widthSegments,e.heightSegments)}}class wa extends Bt{constructor(e=1,t=32,n=16,i=0,s=Math.PI*2,a=0,o=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:i,phiLength:s,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=[],u=new F,d=new F,f=[],m=[],_=[],g=[];for(let p=0;p<=n;p++){const S=[],E=p/n;let v=0;p===0&&a===0?v=.5/t:p===n&&l===Math.PI&&(v=-.5/t);for(let N=0;N<=t;N++){const C=N/t;u.x=-e*Math.cos(i+C*s)*Math.sin(a+E*o),u.y=e*Math.cos(a+E*o),u.z=e*Math.sin(i+C*s)*Math.sin(a+E*o),m.push(u.x,u.y,u.z),d.copy(u).normalize(),_.push(d.x,d.y,d.z),g.push(C+v,1-E),S.push(c++)}h.push(S)}for(let p=0;p<n;p++)for(let S=0;S<t;S++){const E=h[p][S+1],v=h[p][S],N=h[p+1][S],C=h[p+1][S+1];(p!==0||a>0)&&f.push(E,v,C),(p!==n-1||l<Math.PI)&&f.push(v,N,C)}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 wa(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class Wl extends Bt{constructor(e=new Nu(new F(-1,-1,0),new F(-1,1,0),new F(1,1,0)),t=64,n=1,i=8,s=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:i,closed:s};const a=e.computeFrenetFrames(t,s);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;const o=new F,l=new F,c=new Ge;let h=new F;const u=[],d=[],f=[],m=[];_(),this.setIndex(m),this.setAttribute("position",new mt(u,3)),this.setAttribute("normal",new mt(d,3)),this.setAttribute("uv",new mt(f,2));function _(){for(let E=0;E<t;E++)g(E);g(s===!1?t:0),S(),p()}function g(E){h=e.getPointAt(E/t,h);const v=a.normals[E],N=a.binormals[E];for(let C=0;C<=i;C++){const T=C/i*Math.PI*2,P=Math.sin(T),b=-Math.cos(T);l.x=b*v.x+P*N.x,l.y=b*v.y+P*N.y,l.z=b*v.z+P*N.z,l.normalize(),d.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,u.push(o.x,o.y,o.z)}}function p(){for(let E=1;E<=t;E++)for(let v=1;v<=i;v++){const N=(i+1)*(E-1)+(v-1),C=(i+1)*E+(v-1),T=(i+1)*E+v,P=(i+1)*(E-1)+v;m.push(N,C,P),m.push(C,T,P)}}function S(){for(let E=0;E<=t;E++)for(let v=0;v<=i;v++)c.x=E/t,c.y=v/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 Wl(new Xp[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class qp extends Bt{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){const t=[],n=new Set,i=new F,s=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 u=l[c],d=u.start,f=u.count;for(let m=d,_=d+f;m<_;m+=3)for(let g=0;g<3;g++){const p=o.getX(m+g),S=o.getX(m+(g+1)%3);i.fromBufferAttribute(a,p),s.fromBufferAttribute(a,S),Yc(i,s,n)===!0&&(t.push(i.x,i.y,i.z),t.push(s.x,s.y,s.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,u=3*o+(c+1)%3;i.fromBufferAttribute(a,h),s.fromBufferAttribute(a,u),Yc(i,s,n)===!0&&(t.push(i.x,i.y,i.z),t.push(s.x,s.y,s.z))}}this.setAttribute("position",new mt(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function Yc(r,e,t){const n=`${r.x},${r.y},${r.z}-${e.x},${e.y},${e.z}`,i=`${e.x},${e.y},${e.z}-${r.x},${r.y},${r.z}`;return t.has(n)===!0||t.has(i)===!0?!1:(t.add(n),t.add(i),!0)}class jp extends Dn{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new st(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 Yp extends Dn{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new st(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 st(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ea,this.normalScale=new Ge(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 yn,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 bn extends Dn{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new st(16777215),this.specular=new st(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new st(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ea,this.normalScale=new Ge(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new yn,this.combine=ba,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 $p extends Dn{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new st(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new st(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ea,this.normalScale=new Ge(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new yn,this.combine=ba,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 Jp extends Dn{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Ef,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 Kp 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 Ws(r,e){return!r||r.constructor===e?r:typeof e.BYTES_PER_ELEMENT=="number"?new e(r):Array.prototype.slice.call(r)}function Zp(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function Qp(r){function e(i,s){return r[i]-r[s]}const t=r.length,n=new Array(t);for(let i=0;i!==t;++i)n[i]=i;return n.sort(e),n}function $c(r,e,t){const n=r.length,i=new r.constructor(n);for(let s=0,a=0;a!==n;++s){const o=t[s]*e;for(let l=0;l!==e;++l)i[a++]=r[o+l]}return i}function Uu(r,e,t,n){let i=1,s=r[0];for(;s!==void 0&&s[n]===void 0;)s=r[i++];if(s===void 0)return;let a=s[n];if(a!==void 0)if(Array.isArray(a))do a=s[n],a!==void 0&&(e.push(s.time),t.push(...a)),s=r[i++];while(s!==void 0);else if(a.toArray!==void 0)do a=s[n],a!==void 0&&(e.push(s.time),a.toArray(t,t.length)),s=r[i++];while(s!==void 0);else do a=s[n],a!==void 0&&(e.push(s.time),t.push(a)),s=r[i++];while(s!==void 0)}class Ta{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],s=t[n-1];n:{e:{let a;t:{i:if(!(e<i)){for(let o=n+2;;){if(i===void 0){if(e<s)break i;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===o)break;if(s=i,i=t[++n],e<i)break e}a=t.length;break t}if(!(e>=s)){const o=t[1];e<o&&(n=2,s=o);for(let l=n-2;;){if(s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===l)break;if(i=s,s=t[--n-1],e>=s)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],s=t[n-1],s===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,s,i)}return this.interpolate_(n,s,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=e*i;for(let a=0;a!==i;++a)t[a]=n[s+a];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class e0 extends Ta{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:cc,endingEnd:cc}}intervalChanged_(e,t,n){const i=this.parameterPositions;let s=e-2,a=e+1,o=i[s],l=i[a];if(o===void 0)switch(this.getSettings_().endingStart){case hc:s=e,o=2*t-n;break;case uc:s=i.length-2,o=t+i[s]-i[s+1];break;default:s=e,o=n}if(l===void 0)switch(this.getSettings_().endingEnd){case hc:a=e,l=2*n-t;break;case uc: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=s*h,this._offsetNext=a*h}interpolate_(e,t,n,i){const s=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=e*o,c=l-o,h=this._offsetPrev,u=this._offsetNext,d=this._weightPrev,f=this._weightNext,m=(n-t)/(i-t),_=m*m,g=_*m,p=-d*g+2*d*_-d*m,S=(1+d)*g+(-1.5-2*d)*_+(-.5+d)*m+1,E=(-1-f)*g+(1.5+f)*_+.5*m,v=f*g-f*_;for(let N=0;N!==o;++N)s[N]=p*a[h+N]+S*a[c+N]+E*a[l+N]+v*a[u+N];return s}}class t0 extends Ta{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const s=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=e*o,c=l-o,h=(n-t)/(i-t),u=1-h;for(let d=0;d!==o;++d)s[d]=a[c+d]*u+a[l+d]*h;return s}}class n0 extends Ta{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class Wn{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=Ws(t,this.TimeBufferType),this.values=Ws(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:Ws(e.times,Array),values:Ws(e.values,Array)};const i=e.getInterpolation();i!==e.DefaultInterpolation&&(n.interpolation=i)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new n0(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new t0(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new e0(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case fa:t=this.InterpolantFactoryMethodDiscrete;break;case hl:t=this.InterpolantFactoryMethodLinear;break;case Ia: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 fa;case this.InterpolantFactoryMethodLinear:return hl;case this.InterpolantFactoryMethodSmooth:return Ia}}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 s=0,a=i-1;for(;s!==i&&n[s]<e;)++s;for(;a!==-1&&n[a]>t;)--a;if(++a,s!==0||a!==i){s>=a&&(a=Math.max(a,1),s=a-1);const o=this.getValueSize();this.times=n.slice(s,a),this.values=this.values.slice(s*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,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let o=0;o!==s;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&&Zp(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()===Ia,s=e.length-1;let a=1;for(let o=1;o<s;++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 u=o*n,d=u-n,f=u+n;for(let m=0;m!==n;++m){const _=t[u+m];if(_!==t[d+m]||_!==t[f+m]){l=!0;break}}}if(l){if(o!==a){e[a]=e[o];const u=o*n,d=a*n;for(let f=0;f!==n;++f)t[d+f]=t[u+f]}++a}}if(s>0){e[a]=e[s];for(let o=s*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}}Wn.prototype.ValueTypeName="";Wn.prototype.TimeBufferType=Float32Array;Wn.prototype.ValueBufferType=Float32Array;Wn.prototype.DefaultInterpolation=hl;class Fr extends Wn{constructor(e,t,n){super(e,t,n)}}Fr.prototype.ValueTypeName="bool";Fr.prototype.ValueBufferType=Array;Fr.prototype.DefaultInterpolation=fa;Fr.prototype.InterpolantFactoryMethodLinear=void 0;Fr.prototype.InterpolantFactoryMethodSmooth=void 0;class Fu extends Wn{constructor(e,t,n,i){super(e,t,n,i)}}Fu.prototype.ValueTypeName="color";class ya extends Wn{constructor(e,t,n,i){super(e,t,n,i)}}ya.prototype.ValueTypeName="number";class i0 extends Ta{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const s=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)Rn.slerpFlat(s,0,a,c-o,a,c,l);return s}}class ds extends Wn{constructor(e,t,n,i){super(e,t,n,i)}InterpolantFactoryMethodLinear(e){return new i0(this.times,this.values,this.getValueSize(),e)}}ds.prototype.ValueTypeName="quaternion";ds.prototype.InterpolantFactoryMethodSmooth=void 0;class Or extends Wn{constructor(e,t,n){super(e,t,n)}}Or.prototype.ValueTypeName="string";Or.prototype.ValueBufferType=Array;Or.prototype.DefaultInterpolation=fa;Or.prototype.InterpolantFactoryMethodLinear=void 0;Or.prototype.InterpolantFactoryMethodSmooth=void 0;class Nr extends Wn{constructor(e,t,n,i){super(e,t,n,i)}}Nr.prototype.ValueTypeName="vector";class Jc{constructor(e="",t=-1,n=[],i=Sf){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=Vn(),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(s0(n[a]).scale(i));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}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 s=0,a=n.length;s!==a;++s)t.push(Wn.toJSON(n[s]));return i}static CreateFromMorphTargetSequence(e,t,n,i){const s=t.length,a=[];for(let o=0;o<s;o++){let l=[],c=[];l.push((o+s-1)%s,o,(o+1)%s),c.push(0,1,0);const h=Qp(l);l=$c(l,1,h),c=$c(c,1,h),!i&&l[0]===0&&(l.push(s),c.push(c[0])),a.push(new ya(".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={},s=/^([\w-]*?)([\d]+)$/;for(let o=0,l=e.length;o<l;o++){const c=e[o],h=c.name.match(s);if(h&&h.length>1){const u=h[1];let d=i[u];d||(i[u]=d=[]),d.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(u,d,f,m,_){if(f.length!==0){const g=[],p=[];Uu(f,g,p,m),g.length!==0&&_.push(new u(d,g,p))}},i=[],s=e.name||"default",a=e.fps||30,o=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let u=0;u<c.length;u++){const d=c[u].keys;if(!(!d||d.length===0))if(d[0].morphTargets){const f={};let m;for(m=0;m<d.length;m++)if(d[m].morphTargets)for(let _=0;_<d[m].morphTargets.length;_++)f[d[m].morphTargets[_]]=-1;for(const _ in f){const g=[],p=[];for(let S=0;S!==d[m].morphTargets.length;++S){const E=d[m];g.push(E.time),p.push(E.morphTarget===_?1:0)}i.push(new ya(".morphTargetInfluence["+_+"]",g,p))}l=f.length*a}else{const f=".bones["+t[u].name+"]";n(Nr,f+".position",d,"pos",i),n(ds,f+".quaternion",d,"rot",i),n(Nr,f+".scale",d,"scl",i)}}return i.length===0?null:new this(s,l,i,o)}resetDuration(){const e=this.tracks;let t=0;for(let n=0,i=e.length;n!==i;++n){const s=this.tracks[n];t=Math.max(t,s.times[s.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 r0(r){switch(r.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return ya;case"vector":case"vector2":case"vector3":case"vector4":return Nr;case"color":return Fu;case"quaternion":return ds;case"bool":case"boolean":return Fr;case"string":return Or}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+r)}function s0(r){if(r.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=r0(r.type);if(r.times===void 0){const t=[],n=[];Uu(r.keys,t,n,"value"),r.times=t,r.values=n}return e.parse!==void 0?e.parse(r):new e(r.name,r.times,r.values,r.interpolation)}const xa={enabled:!1,files:{},add:function(r,e){this.enabled!==!1&&(this.files[r]=e)},get:function(r){if(this.enabled!==!1)return this.files[r]},remove:function(r){delete this.files[r]},clear:function(){this.files={}}};class a0{constructor(e,t,n){const i=this;let s=!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++,s===!1&&i.onStart!==void 0&&i.onStart(h,a,o),s=!0},this.itemEnd=function(h){a++,i.onProgress!==void 0&&i.onProgress(h,a,o),a===o&&(s=!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,u){return c.push(h,u),this},this.removeHandler=function(h){const u=c.indexOf(h);return u!==-1&&c.splice(u,2),this},this.getHandler=function(h){for(let u=0,d=c.length;u<d;u+=2){const f=c[u],m=c[u+1];if(f.global&&(f.lastIndex=0),f.test(h))return m}return null}}}const Xl=new a0;class Gn{constructor(e){this.manager=e!==void 0?e:Xl,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise(function(i,s){n.load(e,i,t,s)})}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}}Gn.DEFAULT_MATERIAL_NAME="__DEFAULT";const ci={};class o0 extends Error{constructor(e,t){super(e),this.response=t}}class zr extends Gn{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 s=xa.get(e);if(s!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(s),this.manager.itemEnd(e)},0),s;if(ci[e]!==void 0){ci[e].push({onLoad:t,onProgress:n,onError:i});return}ci[e]=[],ci[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=ci[e],u=c.body.getReader(),d=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),f=d?parseInt(d):0,m=f!==0;let _=0;const g=new ReadableStream({start(p){S();function S(){u.read().then(({done:E,value:v})=>{if(E)p.close();else{_+=v.byteLength;const N=new ProgressEvent("progress",{lengthComputable:m,loaded:_,total:f});for(let C=0,T=h.length;C<T;C++){const P=h[C];P.onProgress&&P.onProgress(N)}p.enqueue(v),S()}},E=>{p.error(E)})}}});return new Response(g)}else throw new o0(`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 u=/charset="?([^;"\s]*)"?/i.exec(o),d=u&&u[1]?u[1].toLowerCase():void 0,f=new TextDecoder(d);return c.arrayBuffer().then(m=>f.decode(m))}}}).then(c=>{xa.add(e,c);const h=ci[e];delete ci[e];for(let u=0,d=h.length;u<d;u++){const f=h[u];f.onLoad&&f.onLoad(c)}}).catch(c=>{const h=ci[e];if(h===void 0)throw this.manager.itemError(e),c;delete ci[e];for(let u=0,d=h.length;u<d;u++){const f=h[u];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 l0 extends Gn{constructor(e){super(e)}load(e,t,n,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,a=xa.get(e);if(a!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(a),s.manager.itemEnd(e)},0),a;const o=os("img");function l(){h(),xa.add(e,this),t&&t(this),s.manager.itemEnd(e)}function c(u){h(),i&&i(u),s.manager.itemError(e),s.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),s.manager.itemStart(e),o.src=e,o}}class c0 extends Gn{constructor(e){super(e)}load(e,t,n,i){const s=this,a=new Du,o=new zr(this.manager);return o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(s.withCredentials),o.load(e,function(l){let c;try{c=s.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:kn,a.wrapT=c.wrapT!==void 0?c.wrapT:kn,a.magFilter=c.magFilter!==void 0?c.magFilter:Tn,a.minFilter=c.minFilter!==void 0?c.minFilter:Tn,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=ui),c.mipmapCount===1&&(a.minFilter=Tn),c.generateMipmaps!==void 0&&(a.generateMipmaps=c.generateMipmaps),a.needsUpdate=!0,t&&t(a,c)},n,i),a}}class ql extends Gn{constructor(e){super(e)}load(e,t,n,i){const s=new cn,a=new l0(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(o){s.image=o,s.needsUpdate=!0,t!==void 0&&t(s)},n,i),s}}class fs extends Ut{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new st(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 h0 extends fs{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Ut.DEFAULT_UP),this.updateMatrix(),this.groundColor=new st(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}const co=new lt,Kc=new F,Zc=new F;class jl{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Ge(512,512),this.mapType=Qn,this.map=null,this.mapPass=null,this.matrix=new lt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new kl,this._frameExtents=new Ge(1,1),this._viewportCount=1,this._viewports=[new Mt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;Kc.setFromMatrixPosition(e.matrixWorld),t.position.copy(Kc),Zc.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Zc),t.updateMatrixWorld(),co.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(co),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(co)}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 u0 extends jl{constructor(){super(new ln(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){const t=this.camera,n=Pr*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height*this.aspect,s=e.distance||t.far;(n!==t.fov||i!==t.aspect||s!==t.far)&&(t.fov=n,t.aspect=i,t.far=s,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class d0 extends fs{constructor(e,t,n=0,i=Math.PI/3,s=0,a=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Ut.DEFAULT_UP),this.updateMatrix(),this.target=new Ut,this.distance=n,this.angle=i,this.penumbra=s,this.decay=a,this.map=null,this.shadow=new u0}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 Qc=new lt,Yr=new F,ho=new F;class f0 extends jl{constructor(){super(new ln(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Ge(4,2),this._viewportCount=6,this._viewports=[new Mt(2,1,1,1),new Mt(0,1,1,1),new Mt(3,1,1,1),new Mt(1,1,1,1),new Mt(3,0,1,1),new Mt(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,s=e.distance||n.far;s!==n.far&&(n.far=s,n.updateProjectionMatrix()),Yr.setFromMatrixPosition(e.matrixWorld),n.position.copy(Yr),ho.copy(n.position),ho.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(ho),n.updateMatrixWorld(),i.makeTranslation(-Yr.x,-Yr.y,-Yr.z),Qc.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Qc)}}class Ou extends fs{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 f0}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 Ca extends Au{constructor(e=-1,t=1,n=1,i=-1,s=.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=s,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,s,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=s,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 s=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;s+=c*this.view.offsetX,a=s+c*this.view.width,o-=h*this.view.offsetY,l=o-h*this.view.height}this.projectionMatrix.makeOrthographic(s,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 p0 extends jl{constructor(){super(new Ca(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class zu extends fs{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Ut.DEFAULT_UP),this.updateMatrix(),this.target=new Ut,this.shadow=new p0}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class Bu extends fs{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class Yl{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 m0 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 g0 extends ln{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class _0{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=eh(),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=eh();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function eh(){return performance.now()}class fl extends Tu{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 th=new lt;class v0{constructor(e,t,n=0,i=1/0){this.ray=new Ur(e,t),this.near=n,this.far=i,this.camera=null,this.layers=new Ul,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 th.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(th),this}intersectObject(e,t=!0,n=[]){return pl(e,this,n,t),n.sort(nh),n}intersectObjects(e,t=!0,n=[]){for(let i=0,s=e.length;i<s;i++)pl(e[i],this,n,t);return n.sort(nh),n}}function nh(r,e){return r.distance-e.distance}function pl(r,e,t,n){let i=!0;if(r.layers.test(e.layers)&&r.raycast(e,t)===!1&&(i=!1),i===!0&&n===!0){const s=r.children;for(let a=0,o=s.length;a<o;a++)pl(s[a],e,t,!0)}}class ku{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 ih=new F,Xs=new F;class y0{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){ih.subVectors(e,this.start),Xs.subVectors(this.end,this.start);const n=Xs.dot(Xs);let s=Xs.dot(ih)/n;return t&&(s=vt(s,0,1)),s}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 x0 extends va{constructor(e=10,t=10,n=4473924,i=8947848){n=new st(n),i=new st(i);const s=t/2,a=e/t,o=e/2,l=[],c=[];for(let d=0,f=0,m=-o;d<=t;d++,m+=a){l.push(-o,0,m,o,0,m),l.push(m,0,-o,m,0,o);const _=d===s?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 u=new Ci({vertexColors:!0,toneMapped:!1});super(h,u),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class M0 extends $i{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 rh(r,e,t,n){const i=b0(n);switch(t){case fu:return r*e;case mu:return r*e/i.components*i.byteLength;case Dl:return r*e/i.components*i.byteLength;case gu:return r*e*2/i.components*i.byteLength;case Ll:return r*e*2/i.components*i.byteLength;case pu:return r*e*3/i.components*i.byteLength;case Un:return r*e*4/i.components*i.byteLength;case Pl:return r*e*4/i.components*i.byteLength;case ra:case sa:return Math.floor((r+3)/4)*Math.floor((e+3)/4)*8;case aa:case oa:return Math.floor((r+3)/4)*Math.floor((e+3)/4)*16;case Bo:case Vo:return Math.max(r,16)*Math.max(e,8)/4;case zo:case ko:return Math.max(r,8)*Math.max(e,8)/2;case Ho:case Go:return Math.floor((r+3)/4)*Math.floor((e+3)/4)*8;case Wo:return Math.floor((r+3)/4)*Math.floor((e+3)/4)*16;case Xo:return Math.floor((r+3)/4)*Math.floor((e+3)/4)*16;case qo:return Math.floor((r+4)/5)*Math.floor((e+3)/4)*16;case jo:return Math.floor((r+4)/5)*Math.floor((e+4)/5)*16;case Yo:return Math.floor((r+5)/6)*Math.floor((e+4)/5)*16;case $o:return Math.floor((r+5)/6)*Math.floor((e+5)/6)*16;case Jo:return Math.floor((r+7)/8)*Math.floor((e+4)/5)*16;case Ko:return Math.floor((r+7)/8)*Math.floor((e+5)/6)*16;case Zo:return Math.floor((r+7)/8)*Math.floor((e+7)/8)*16;case Qo:return Math.floor((r+9)/10)*Math.floor((e+4)/5)*16;case el:return Math.floor((r+9)/10)*Math.floor((e+5)/6)*16;case tl:return Math.floor((r+9)/10)*Math.floor((e+7)/8)*16;case nl:return Math.floor((r+9)/10)*Math.floor((e+9)/10)*16;case il:return Math.floor((r+11)/12)*Math.floor((e+9)/10)*16;case rl:return Math.floor((r+11)/12)*Math.floor((e+11)/12)*16;case la:case sl:case al:return Math.ceil(r/4)*Math.ceil(e/4)*16;case _u:case ol:return Math.ceil(r/4)*Math.ceil(e/4)*8;case ll:case cl:return Math.ceil(r/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function b0(r){switch(r){case Qn:case hu:return{byteLength:1,components:1};case is:case uu:case hs:return{byteLength:2,components:1};case Cl:case Rl:return{byteLength:2,components:4};case qi:case Tl:case Jn:return{byteLength:4,components:1};case du:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${r}.`)}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:wl}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=wl);/**
|
|
44
|
+
`},i=new Ki(5,5,5),s=new pi({name:"CubemapFromEquirect",uniforms:Ir(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:vn,blending:wi});s.uniforms.tEquirect.value=t;const a=new Ct(i,s),o=t.minFilter;return t.minFilter===ui&&(t.minFilter=Cn),new Mp(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 s=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(t,n,i);e.setRenderTarget(s)}}class Jn extends Ut{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Sp={type:"move"};class to{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Jn,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 Jn,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 Jn,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,s=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"],u=c.joints["thumb-tip"],d=h.position.distanceTo(u.position),f=.02,m=.005;c.inputState.pinching&&d>f+m?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&d<=f-m&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));o!==null&&(i=t.getPose(e.targetRaySpace,n),i===null&&s!==null&&(i=s),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(Sp)))}return o!==null&&(o.visible=i!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new Jn;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}class Ol extends Ut{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 yn,this.environmentIntensity=1,this.environmentRotation=new yn,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 Tu{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=dl,this.updateRanges=[],this.version=0,this.uuid=Vn()}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,s=this.stride;i<s;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=Vn()),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=Vn()),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 gn=new F;class Zn{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++)gn.fromBufferAttribute(this,t),gn.applyMatrix4(e),this.setXYZ(t,gn.x,gn.y,gn.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)gn.fromBufferAttribute(this,t),gn.applyNormalMatrix(e),this.setXYZ(t,gn.x,gn.y,gn.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)gn.fromBufferAttribute(this,t),gn.transformDirection(e),this.setXYZ(t,gn.x,gn.y,gn.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=Bn(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=It(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=It(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=It(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=It(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=It(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=Bn(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Bn(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Bn(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Bn(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=It(t,this.array),n=It(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=It(t,this.array),n=It(n,this.array),i=It(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,s){return e=e*this.data.stride+this.offset,this.normalized&&(t=It(t,this.array),n=It(n,this.array),i=It(i,this.array),s=It(s,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]=s,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 s=0;s<this.itemSize;s++)t.push(this.data.array[i+s])}return new Gt(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 Zn(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 s=0;s<this.itemSize;s++)t.push(this.data.array[i+s])}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 wa extends Pn{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new st(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 _r;const Wr=new F,vr=new F,yr=new F,xr=new Ge,Xr=new Ge,Cu=new lt,Is=new F,qr=new F,Ns=new F,Lc=new Ge,no=new Ge,Ic=new Ge;class zl extends Ut{constructor(e=new wa){if(super(),this.isSprite=!0,this.type="Sprite",_r===void 0){_r=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 Tu(t,5);_r.setIndex([0,1,2,0,2,3]),_r.setAttribute("position",new Zn(n,3,0,!1)),_r.setAttribute("uv",new Zn(n,2,3,!1))}this.geometry=_r,this.material=e,this.center=new Ge(.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.'),vr.setFromMatrixScale(this.matrixWorld),Cu.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),yr.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&vr.multiplyScalar(-yr.z);const n=this.material.rotation;let i,s;n!==0&&(s=Math.cos(n),i=Math.sin(n));const a=this.center;Us(Is.set(-.5,-.5,0),yr,a,vr,i,s),Us(qr.set(.5,-.5,0),yr,a,vr,i,s),Us(Ns.set(.5,.5,0),yr,a,vr,i,s),Lc.set(0,0),no.set(1,0),Ic.set(1,1);let o=e.ray.intersectTriangle(Is,qr,Ns,!1,Wr);if(o===null&&(Us(qr.set(-.5,.5,0),yr,a,vr,i,s),no.set(0,1),o=e.ray.intersectTriangle(Is,Ns,qr,!1,Wr),o===null))return;const l=e.ray.origin.distanceTo(Wr);l<e.near||l>e.far||t.push({distance:l,point:Wr.clone(),uv:Nn.getInterpolation(Wr,Is,qr,Ns,Lc,no,Ic,new Ge),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 Us(r,e,t,n,i,s){xr.subVectors(r,t).addScalar(.5).multiply(n),i!==void 0?(Xr.x=s*xr.x-i*xr.y,Xr.y=i*xr.x+s*xr.y):Xr.copy(xr),r.copy(e),r.x+=Xr.x,r.y+=Xr.y,r.applyMatrix4(Cu)}const Fs=new F,Nc=new F;class Ep extends Ut{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 s=t[n];this.addLevel(s.object.clone(),s.distance,s.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0,n=0){t=Math.abs(t);const i=this.levels;let s;for(s=0;s<i.length&&!(t<i[s].distance);s++);return i.splice(s,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 s=t[n].distance;if(t[n].object.visible&&(s-=s*t[n].hysteresis),e<s)break}return t[n-1].object}return null}raycast(e,t){if(this.levels.length>0){Fs.setFromMatrixPosition(this.matrixWorld);const i=e.ray.origin.distanceTo(Fs);this.getObjectForDistance(i).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Fs.setFromMatrixPosition(e.matrixWorld),Nc.setFromMatrixPosition(this.matrixWorld);const n=Fs.distanceTo(Nc)/e.zoom;t[0].object.visible=!0;let i,s;for(i=1,s=t.length;i<s;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<s;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,s=n.length;i<s;i++){const a=n[i];t.object.levels.push({object:a.object.uuid,distance:a.distance,hysteresis:a.hysteresis})}return t}}const Uc=new F,Fc=new Mt,Oc=new Mt,Ap=new F,zc=new lt,Os=new F,io=new mi,Bc=new lt,ro=new Ur;class wp extends Ct{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=lc,this.bindMatrix=new lt,this.bindMatrixInverse=new lt,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new ei),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Os),this.boundingBox.expandByPoint(Os)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new mi),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Os),this.boundingSphere.expandByPoint(Os)}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(),io.copy(this.boundingSphere),io.applyMatrix4(i),e.ray.intersectsSphere(io)!==!1&&(Bc.copy(i).invert(),ro.copy(e.ray).applyMatrix4(Bc),!(this.boundingBox!==null&&ro.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,ro)))}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 Mt,t=this.geometry.attributes.skinWeight;for(let n=0,i=t.count;n<i;n++){e.fromBufferAttribute(t,n);const s=1/e.manhattanLength();s!==1/0?e.multiplyScalar(s):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===lc?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===Mf?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const n=this.skeleton,i=this.geometry;Fc.fromBufferAttribute(i.attributes.skinIndex,e),Oc.fromBufferAttribute(i.attributes.skinWeight,e),Uc.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let s=0;s<4;s++){const a=Oc.getComponent(s);if(a!==0){const o=Fc.getComponent(s);zc.multiplyMatrices(n.bones[o].matrixWorld,n.boneInverses[o]),t.addScaledVector(Ap.copy(Uc).applyMatrix4(zc),a)}}return t.applyMatrix4(this.bindMatrixInverse)}}class Ru extends Ut{constructor(){super(),this.isBone=!0,this.type="Bone"}}class Du extends cn{constructor(e=null,t=1,n=1,i,s,a,o,l,c=Rn,h=Rn,u,d){super(null,a,o,l,c,h,i,s,u,d),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const kc=new lt,Tp=new lt;class Bl{constructor(e=[],t=[]){this.uuid=Vn(),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 lt)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const n=new lt;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 s=0,a=e.length;s<a;s++){const o=e[s]?e[s].matrixWorld:Tp;kc.multiplyMatrices(o,t[s]),kc.toArray(n,s*16)}i!==null&&(i.needsUpdate=!0)}clone(){return new Bl(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,Un,Kn);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 s=e.bones[n];let a=t[s];a===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",s),a=new Ru),this.bones.push(a),this.boneInverses.push(new lt().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,s=t.length;i<s;i++){const a=t[i];e.bones.push(a.uuid);const o=n[i];e.boneInverses.push(o.toArray())}return e}}const so=new F,Cp=new F,Rp=new _t;class Ei{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=so.subVectors(n,t).cross(Cp.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(so),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:t.copy(e.start).addScaledVector(n,s)}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||Rp.getNormalMatrix(e),i=this.coplanarPoint(so).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),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 Ui=new mi,zs=new F;class kl{constructor(e=new Ei,t=new Ei,n=new Ei,i=new Ei,s=new Ei,a=new Ei){this.planes=[e,t,n,i,s,a]}set(e,t,n,i,s,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(s),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=di){const n=this.planes,i=e.elements,s=i[0],a=i[1],o=i[2],l=i[3],c=i[4],h=i[5],u=i[6],d=i[7],f=i[8],m=i[9],_=i[10],g=i[11],p=i[12],S=i[13],E=i[14],v=i[15];if(n[0].setComponents(l-s,d-c,g-f,v-p).normalize(),n[1].setComponents(l+s,d+c,g+f,v+p).normalize(),n[2].setComponents(l+a,d+h,g+m,v+S).normalize(),n[3].setComponents(l-a,d-h,g-m,v-S).normalize(),n[4].setComponents(l-o,d-u,g-_,v-E).normalize(),t===di)n[5].setComponents(l+o,d+u,g+_,v+E).normalize();else if(t===ma)n[5].setComponents(o,u,_,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(),Ui.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Ui.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Ui)}intersectsSprite(e){return Ui.center.set(0,0,0),Ui.radius=.7071067811865476,Ui.applyMatrix4(e.matrixWorld),this.intersectsSphere(Ui)}intersectsSphere(e){const t=this.planes,n=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].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(zs.x=i.normal.x>0?e.max.x:e.min.x,zs.y=i.normal.y>0?e.max.y:e.min.y,zs.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(zs)<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 Ci extends Pn{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new st(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 ga=new F,_a=new F,Vc=new lt,jr=new Ur,Bs=new mi,ao=new F,Hc=new F;class Vl extends Ut{constructor(e=new Bt,t=new Ci){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,s=t.count;i<s;i++)ga.fromBufferAttribute(t,i-1),_a.fromBufferAttribute(t,i),n[i]=n[i-1],n[i]+=ga.distanceTo(_a);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,s=e.params.Line.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Bs.copy(n.boundingSphere),Bs.applyMatrix4(i),Bs.radius+=s,e.ray.intersectsSphere(Bs)===!1)return;Vc.copy(i).invert(),jr.copy(e.ray).applyMatrix4(Vc);const o=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,c=this.isLineSegments?2:1,h=n.index,d=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(_),S=h.getX(_+1),E=ks(this,e,jr,l,p,S,_);E&&t.push(E)}if(this.isLineLoop){const _=h.getX(m-1),g=h.getX(f),p=ks(this,e,jr,l,_,g,m-1);p&&t.push(p)}}else{const f=Math.max(0,a.start),m=Math.min(d.count,a.start+a.count);for(let _=f,g=m-1;_<g;_+=c){const p=ks(this,e,jr,l,_,_+1,_);p&&t.push(p)}if(this.isLineLoop){const _=ks(this,e,jr,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 s=0,a=i.length;s<a;s++){const o=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}}function ks(r,e,t,n,i,s,a){const o=r.geometry.attributes.position;if(ga.fromBufferAttribute(o,i),_a.fromBufferAttribute(o,s),t.distanceSqToSegment(ga,_a,ao,Hc)>n)return;ao.applyMatrix4(r.matrixWorld);const c=e.ray.origin.distanceTo(ao);if(!(c<e.near||c>e.far))return{distance:c,point:Hc.clone().applyMatrix4(r.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:r}}const Gc=new F,Wc=new F;class va extends Vl{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,s=t.count;i<s;i+=2)Gc.fromBufferAttribute(t,i),Wc.fromBufferAttribute(t,i+1),n[i]=i===0?0:n[i-1],n[i+1]=n[i]+Gc.distanceTo(Wc);e.setAttribute("lineDistance",new mt(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class Wi extends Pn{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new st(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 Xc=new lt,fl=new Ur,Vs=new mi,Hs=new F;class Qr extends Ut{constructor(e=new Bt,t=new Wi){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,s=e.params.Points.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Vs.copy(n.boundingSphere),Vs.applyMatrix4(i),Vs.radius+=s,e.ray.intersectsSphere(Vs)===!1)return;Xc.copy(i).invert(),fl.copy(e.ray).applyMatrix4(Xc);const o=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,c=n.index,u=n.attributes.position;if(c!==null){const d=Math.max(0,a.start),f=Math.min(c.count,a.start+a.count);for(let m=d,_=f;m<_;m++){const g=c.getX(m);Hs.fromBufferAttribute(u,g),qc(Hs,g,l,i,e,t,this)}}else{const d=Math.max(0,a.start),f=Math.min(u.count,a.start+a.count);for(let m=d,_=f;m<_;m++)Hs.fromBufferAttribute(u,m),qc(Hs,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 s=0,a=i.length;s<a;s++){const o=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}}function qc(r,e,t,n,i,s,a){const o=fl.distanceSqToPoint(r);if(o<t){const l=new F;fl.closestPointToPoint(r,l),l.applyMatrix4(n);const c=i.ray.origin.distanceTo(l);if(c<i.near||c>i.far)return;s.push({distance:c,distanceToRay:Math.sqrt(o),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:a})}}class Dp extends cn{constructor(e,t,n,i,s,a,o,l,c){super(e,t,n,i,s,a,o,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Pu extends cn{constructor(e,t,n=qi,i,s,a,o=Rn,l=Rn,c,h=ss,u=1){if(h!==ss&&h!==as)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const d={width:e,height:t,depth:u};super(d,i,s,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 Nl(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 Hl extends Bt{constructor(e=1,t=1,n=1,i=32,s=1,a=!1,o=0,l=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:s,openEnded:a,thetaStart:o,thetaLength:l};const c=this;i=Math.floor(i),s=Math.floor(s);const h=[],u=[],d=[],f=[];let m=0;const _=[],g=n/2;let p=0;S(),a===!1&&(e>0&&E(!0),t>0&&E(!1)),this.setIndex(h),this.setAttribute("position",new mt(u,3)),this.setAttribute("normal",new mt(d,3)),this.setAttribute("uv",new mt(f,2));function S(){const v=new F,N=new F;let C=0;const T=(t-e)/n;for(let L=0;L<=s;L++){const b=[],x=L/s,R=x*(t-e)+e;for(let B=0;B<=i;B++){const V=B/i,W=V*l+o,ee=Math.sin(W),k=Math.cos(W);N.x=R*ee,N.y=-x*n+g,N.z=R*k,u.push(N.x,N.y,N.z),v.set(ee,T,k).normalize(),d.push(v.x,v.y,v.z),f.push(V,1-x),b.push(m++)}_.push(b)}for(let L=0;L<i;L++)for(let b=0;b<s;b++){const x=_[b][L],R=_[b+1][L],B=_[b+1][L+1],V=_[b][L+1];(e>0||b!==0)&&(h.push(x,R,V),C+=3),(t>0||b!==s-1)&&(h.push(R,B,V),C+=3)}c.addGroup(p,C,0),p+=C}function E(v){const N=m,C=new Ge,T=new F;let L=0;const b=v===!0?e:t,x=v===!0?1:-1;for(let B=1;B<=i;B++)u.push(0,g*x,0),d.push(0,x,0),f.push(.5,.5),m++;const R=m;for(let B=0;B<=i;B++){const W=B/i*l+o,ee=Math.cos(W),k=Math.sin(W);T.x=b*k,T.y=g*x,T.z=b*ee,u.push(T.x,T.y,T.z),d.push(0,x,0),C.x=ee*.5+.5,C.y=k*.5*x+.5,f.push(C.x,C.y),m++}for(let B=0;B<i;B++){const V=N+B,W=R+B;v===!0?h.push(W,W+1,V):h.push(W+1,W,V),L+=3}c.addGroup(p,L,v===!0?1:2),p+=L}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Hl(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class gi{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),s=0;t.push(0);for(let a=1;a<=e;a++)n=this.getPoint(a/e),s+=n.distanceTo(i),t.push(s),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 s=n.length;let a;t?a=t:a=e*n[s-1];let o=0,l=s-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/(s-1);const h=n[i],d=n[i+1]-h,f=(a-h)/d;return(i+f)/(s-1)}getTangent(e,t){let i=e-1e-4,s=e+1e-4;i<0&&(i=0),s>1&&(s=1);const a=this.getPoint(i),o=this.getPoint(s),l=t||(a.isVector2?new Ge: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=[],s=[],a=[],o=new F,l=new lt;for(let f=0;f<=e;f++){const m=f/e;i[f]=this.getTangentAt(m,new F)}s[0]=new F,a[0]=new F;let c=Number.MAX_VALUE;const h=Math.abs(i[0].x),u=Math.abs(i[0].y),d=Math.abs(i[0].z);h<=c&&(c=h,n.set(1,0,0)),u<=c&&(c=u,n.set(0,1,0)),d<=c&&n.set(0,0,1),o.crossVectors(i[0],n).normalize(),s[0].crossVectors(i[0],o),a[0].crossVectors(i[0],s[0]);for(let f=1;f<=e;f++){if(s[f]=s[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));s[f].applyMatrix4(l.makeRotationAxis(o,m))}a[f].crossVectors(i[f],s[f])}if(t===!0){let f=Math.acos(vt(s[0].dot(s[e]),-1,1));f/=e,i[0].dot(o.crossVectors(s[0],s[e]))>0&&(f=-f);for(let m=1;m<=e;m++)s[m].applyMatrix4(l.makeRotationAxis(i[m],f*m)),a[m].crossVectors(i[m],s[m])}return{tangents:i,normals:s,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 Lu extends gi{constructor(e=0,t=0,n=1,i=1,s=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=s,this.aEndAngle=a,this.aClockwise=o,this.aRotation=l}getPoint(e,t=new Ge){const n=t,i=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const a=Math.abs(s)<Number.EPSILON;for(;s<0;)s+=i;for(;s>i;)s-=i;s<Number.EPSILON&&(a?s=0:s=i),this.aClockwise===!0&&!a&&(s===i?s=-i:s=s-i);const o=this.aStartAngle+e*s;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),u=Math.sin(this.aRotation),d=l-this.aX,f=c-this.aY;l=d*h-f*u+this.aX,c=d*u+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 Pp extends Lu{constructor(e,t,n,i,s,a){super(e,t,n,n,i,s,a),this.isArcCurve=!0,this.type="ArcCurve"}}function Gl(){let r=0,e=0,t=0,n=0;function i(s,a,o,l){r=s,e=o,t=-3*s+3*a-2*o-l,n=2*s-2*a+o+l}return{initCatmullRom:function(s,a,o,l,c){i(a,o,c*(o-s),c*(l-a))},initNonuniformCatmullRom:function(s,a,o,l,c,h,u){let d=(a-s)/c-(o-s)/(c+h)+(o-a)/h,f=(o-a)/h-(l-a)/(h+u)+(l-o)/u;d*=h,f*=h,i(a,o,d,f)},calc:function(s){const a=s*s,o=a*s;return r+e*s+t*a+n*o}}}const Gs=new F,oo=new Gl,lo=new Gl,co=new Gl;class Iu extends gi{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,s=i.length,a=(s-(this.closed?0:1))*e;let o=Math.floor(a),l=a-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/s)+1)*s:l===0&&o===s-1&&(o=s-2,l=1);let c,h;this.closed||o>0?c=i[(o-1)%s]:(Gs.subVectors(i[0],i[1]).add(i[0]),c=Gs);const u=i[o%s],d=i[(o+1)%s];if(this.closed||o+2<s?h=i[(o+2)%s]:(Gs.subVectors(i[s-1],i[s-2]).add(i[s-1]),h=Gs),this.curveType==="centripetal"||this.curveType==="chordal"){const f=this.curveType==="chordal"?.5:.25;let m=Math.pow(c.distanceToSquared(u),f),_=Math.pow(u.distanceToSquared(d),f),g=Math.pow(d.distanceToSquared(h),f);_<1e-4&&(_=1),m<1e-4&&(m=_),g<1e-4&&(g=_),oo.initNonuniformCatmullRom(c.x,u.x,d.x,h.x,m,_,g),lo.initNonuniformCatmullRom(c.y,u.y,d.y,h.y,m,_,g),co.initNonuniformCatmullRom(c.z,u.z,d.z,h.z,m,_,g)}else this.curveType==="catmullrom"&&(oo.initCatmullRom(c.x,u.x,d.x,h.x,this.tension),lo.initCatmullRom(c.y,u.y,d.y,h.y,this.tension),co.initCatmullRom(c.z,u.z,d.z,h.z,this.tension));return n.set(oo.calc(l),lo.calc(l),co.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 jc(r,e,t,n,i){const s=(n-e)*.5,a=(i-t)*.5,o=r*r,l=r*o;return(2*t-2*n+s+a)*l+(-3*t+3*n-2*s-a)*o+s*r+t}function Lp(r,e){const t=1-r;return t*t*e}function Ip(r,e){return 2*(1-r)*r*e}function Np(r,e){return r*r*e}function es(r,e,t,n){return Lp(r,e)+Ip(r,t)+Np(r,n)}function Up(r,e){const t=1-r;return t*t*t*e}function Fp(r,e){const t=1-r;return 3*t*t*r*e}function Op(r,e){return 3*(1-r)*r*r*e}function zp(r,e){return r*r*r*e}function ts(r,e,t,n,i){return Up(r,e)+Fp(r,t)+Op(r,n)+zp(r,i)}class Bp extends gi{constructor(e=new Ge,t=new Ge,n=new Ge,i=new Ge){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=i}getPoint(e,t=new Ge){const n=t,i=this.v0,s=this.v1,a=this.v2,o=this.v3;return n.set(ts(e,i.x,s.x,a.x,o.x),ts(e,i.y,s.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 kp extends gi{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,s=this.v1,a=this.v2,o=this.v3;return n.set(ts(e,i.x,s.x,a.x,o.x),ts(e,i.y,s.y,a.y,o.y),ts(e,i.z,s.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 Vp extends gi{constructor(e=new Ge,t=new Ge){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new Ge){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 Ge){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 Hp extends gi{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 Gp extends gi{constructor(e=new Ge,t=new Ge,n=new Ge){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new Ge){const n=t,i=this.v0,s=this.v1,a=this.v2;return n.set(es(e,i.x,s.x,a.x),es(e,i.y,s.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 Nu extends gi{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,s=this.v1,a=this.v2;return n.set(es(e,i.x,s.x,a.x),es(e,i.y,s.y,a.y),es(e,i.z,s.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 Wp extends gi{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new Ge){const n=t,i=this.points,s=(i.length-1)*e,a=Math.floor(s),o=s-a,l=i[a===0?a:a-1],c=i[a],h=i[a>i.length-2?i.length-1:a+1],u=i[a>i.length-3?i.length-1:a+2];return n.set(jc(o,l.x,c.x,h.x,u.x),jc(o,l.y,c.y,h.y,u.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 Ge().fromArray(i))}return this}}var Xp=Object.freeze({__proto__:null,ArcCurve:Pp,CatmullRomCurve3:Iu,CubicBezierCurve:Bp,CubicBezierCurve3:kp,EllipseCurve:Lu,LineCurve:Vp,LineCurve3:Hp,QuadraticBezierCurve:Gp,QuadraticBezierCurve3:Nu,SplineCurve:Wp});class us 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 s=e/2,a=t/2,o=Math.floor(n),l=Math.floor(i),c=o+1,h=l+1,u=e/o,d=t/l,f=[],m=[],_=[],g=[];for(let p=0;p<h;p++){const S=p*d-a;for(let E=0;E<c;E++){const v=E*u-s;m.push(v,-S,0),_.push(0,0,1),g.push(E/o),g.push(1-p/l)}}for(let p=0;p<l;p++)for(let S=0;S<o;S++){const E=S+c*p,v=S+c*(p+1),N=S+1+c*(p+1),C=S+1+c*p;f.push(E,v,C),f.push(v,N,C)}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 us(e.width,e.height,e.widthSegments,e.heightSegments)}}class Ta extends Bt{constructor(e=1,t=32,n=16,i=0,s=Math.PI*2,a=0,o=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:i,phiLength:s,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=[],u=new F,d=new F,f=[],m=[],_=[],g=[];for(let p=0;p<=n;p++){const S=[],E=p/n;let v=0;p===0&&a===0?v=.5/t:p===n&&l===Math.PI&&(v=-.5/t);for(let N=0;N<=t;N++){const C=N/t;u.x=-e*Math.cos(i+C*s)*Math.sin(a+E*o),u.y=e*Math.cos(a+E*o),u.z=e*Math.sin(i+C*s)*Math.sin(a+E*o),m.push(u.x,u.y,u.z),d.copy(u).normalize(),_.push(d.x,d.y,d.z),g.push(C+v,1-E),S.push(c++)}h.push(S)}for(let p=0;p<n;p++)for(let S=0;S<t;S++){const E=h[p][S+1],v=h[p][S],N=h[p+1][S],C=h[p+1][S+1];(p!==0||a>0)&&f.push(E,v,C),(p!==n-1||l<Math.PI)&&f.push(v,N,C)}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 Ta(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class Wl extends Bt{constructor(e=new Nu(new F(-1,-1,0),new F(-1,1,0),new F(1,1,0)),t=64,n=1,i=8,s=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:i,closed:s};const a=e.computeFrenetFrames(t,s);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;const o=new F,l=new F,c=new Ge;let h=new F;const u=[],d=[],f=[],m=[];_(),this.setIndex(m),this.setAttribute("position",new mt(u,3)),this.setAttribute("normal",new mt(d,3)),this.setAttribute("uv",new mt(f,2));function _(){for(let E=0;E<t;E++)g(E);g(s===!1?t:0),S(),p()}function g(E){h=e.getPointAt(E/t,h);const v=a.normals[E],N=a.binormals[E];for(let C=0;C<=i;C++){const T=C/i*Math.PI*2,L=Math.sin(T),b=-Math.cos(T);l.x=b*v.x+L*N.x,l.y=b*v.y+L*N.y,l.z=b*v.z+L*N.z,l.normalize(),d.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,u.push(o.x,o.y,o.z)}}function p(){for(let E=1;E<=t;E++)for(let v=1;v<=i;v++){const N=(i+1)*(E-1)+(v-1),C=(i+1)*E+(v-1),T=(i+1)*E+v,L=(i+1)*(E-1)+v;m.push(N,C,L),m.push(C,T,L)}}function S(){for(let E=0;E<=t;E++)for(let v=0;v<=i;v++)c.x=E/t,c.y=v/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 Wl(new Xp[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class qp extends Bt{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){const t=[],n=new Set,i=new F,s=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 u=l[c],d=u.start,f=u.count;for(let m=d,_=d+f;m<_;m+=3)for(let g=0;g<3;g++){const p=o.getX(m+g),S=o.getX(m+(g+1)%3);i.fromBufferAttribute(a,p),s.fromBufferAttribute(a,S),Yc(i,s,n)===!0&&(t.push(i.x,i.y,i.z),t.push(s.x,s.y,s.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,u=3*o+(c+1)%3;i.fromBufferAttribute(a,h),s.fromBufferAttribute(a,u),Yc(i,s,n)===!0&&(t.push(i.x,i.y,i.z),t.push(s.x,s.y,s.z))}}this.setAttribute("position",new mt(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function Yc(r,e,t){const n=`${r.x},${r.y},${r.z}-${e.x},${e.y},${e.z}`,i=`${e.x},${e.y},${e.z}-${r.x},${r.y},${r.z}`;return t.has(n)===!0||t.has(i)===!0?!1:(t.add(n),t.add(i),!0)}class jp extends Pn{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new st(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 Yp extends Pn{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new st(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 st(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Aa,this.normalScale=new Ge(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 yn,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 bn extends Pn{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new st(16777215),this.specular=new st(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new st(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Aa,this.normalScale=new Ge(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new yn,this.combine=Sa,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 $p extends Pn{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new st(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new st(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Aa,this.normalScale=new Ge(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new yn,this.combine=Sa,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 Kp extends Pn{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Ef,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 Jp extends Pn{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 Ws(r,e){return!r||r.constructor===e?r:typeof e.BYTES_PER_ELEMENT=="number"?new e(r):Array.prototype.slice.call(r)}function Zp(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function Qp(r){function e(i,s){return r[i]-r[s]}const t=r.length,n=new Array(t);for(let i=0;i!==t;++i)n[i]=i;return n.sort(e),n}function $c(r,e,t){const n=r.length,i=new r.constructor(n);for(let s=0,a=0;a!==n;++s){const o=t[s]*e;for(let l=0;l!==e;++l)i[a++]=r[o+l]}return i}function Uu(r,e,t,n){let i=1,s=r[0];for(;s!==void 0&&s[n]===void 0;)s=r[i++];if(s===void 0)return;let a=s[n];if(a!==void 0)if(Array.isArray(a))do a=s[n],a!==void 0&&(e.push(s.time),t.push(...a)),s=r[i++];while(s!==void 0);else if(a.toArray!==void 0)do a=s[n],a!==void 0&&(e.push(s.time),a.toArray(t,t.length)),s=r[i++];while(s!==void 0);else do a=s[n],a!==void 0&&(e.push(s.time),t.push(a)),s=r[i++];while(s!==void 0)}class Ca{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],s=t[n-1];n:{e:{let a;t:{i:if(!(e<i)){for(let o=n+2;;){if(i===void 0){if(e<s)break i;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===o)break;if(s=i,i=t[++n],e<i)break e}a=t.length;break t}if(!(e>=s)){const o=t[1];e<o&&(n=2,s=o);for(let l=n-2;;){if(s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===l)break;if(i=s,s=t[--n-1],e>=s)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],s=t[n-1],s===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,s,i)}return this.interpolate_(n,s,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=e*i;for(let a=0;a!==i;++a)t[a]=n[s+a];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class e0 extends Ca{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:cc,endingEnd:cc}}intervalChanged_(e,t,n){const i=this.parameterPositions;let s=e-2,a=e+1,o=i[s],l=i[a];if(o===void 0)switch(this.getSettings_().endingStart){case hc:s=e,o=2*t-n;break;case uc:s=i.length-2,o=t+i[s]-i[s+1];break;default:s=e,o=n}if(l===void 0)switch(this.getSettings_().endingEnd){case hc:a=e,l=2*n-t;break;case uc: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=s*h,this._offsetNext=a*h}interpolate_(e,t,n,i){const s=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=e*o,c=l-o,h=this._offsetPrev,u=this._offsetNext,d=this._weightPrev,f=this._weightNext,m=(n-t)/(i-t),_=m*m,g=_*m,p=-d*g+2*d*_-d*m,S=(1+d)*g+(-1.5-2*d)*_+(-.5+d)*m+1,E=(-1-f)*g+(1.5+f)*_+.5*m,v=f*g-f*_;for(let N=0;N!==o;++N)s[N]=p*a[h+N]+S*a[c+N]+E*a[l+N]+v*a[u+N];return s}}class t0 extends Ca{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const s=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=e*o,c=l-o,h=(n-t)/(i-t),u=1-h;for(let d=0;d!==o;++d)s[d]=a[c+d]*u+a[l+d]*h;return s}}class n0 extends Ca{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class Wn{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=Ws(t,this.TimeBufferType),this.values=Ws(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:Ws(e.times,Array),values:Ws(e.values,Array)};const i=e.getInterpolation();i!==e.DefaultInterpolation&&(n.interpolation=i)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new n0(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new t0(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new e0(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case fa:t=this.InterpolantFactoryMethodDiscrete;break;case ul:t=this.InterpolantFactoryMethodLinear;break;case Na: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 fa;case this.InterpolantFactoryMethodLinear:return ul;case this.InterpolantFactoryMethodSmooth:return Na}}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 s=0,a=i-1;for(;s!==i&&n[s]<e;)++s;for(;a!==-1&&n[a]>t;)--a;if(++a,s!==0||a!==i){s>=a&&(a=Math.max(a,1),s=a-1);const o=this.getValueSize();this.times=n.slice(s,a),this.values=this.values.slice(s*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,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let o=0;o!==s;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&&Zp(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()===Na,s=e.length-1;let a=1;for(let o=1;o<s;++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 u=o*n,d=u-n,f=u+n;for(let m=0;m!==n;++m){const _=t[u+m];if(_!==t[d+m]||_!==t[f+m]){l=!0;break}}}if(l){if(o!==a){e[a]=e[o];const u=o*n,d=a*n;for(let f=0;f!==n;++f)t[d+f]=t[u+f]}++a}}if(s>0){e[a]=e[s];for(let o=s*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}}Wn.prototype.ValueTypeName="";Wn.prototype.TimeBufferType=Float32Array;Wn.prototype.ValueBufferType=Float32Array;Wn.prototype.DefaultInterpolation=ul;class Fr extends Wn{constructor(e,t,n){super(e,t,n)}}Fr.prototype.ValueTypeName="bool";Fr.prototype.ValueBufferType=Array;Fr.prototype.DefaultInterpolation=fa;Fr.prototype.InterpolantFactoryMethodLinear=void 0;Fr.prototype.InterpolantFactoryMethodSmooth=void 0;class Fu extends Wn{constructor(e,t,n,i){super(e,t,n,i)}}Fu.prototype.ValueTypeName="color";class ya extends Wn{constructor(e,t,n,i){super(e,t,n,i)}}ya.prototype.ValueTypeName="number";class i0 extends Ca{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const s=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)Dn.slerpFlat(s,0,a,c-o,a,c,l);return s}}class ds extends Wn{constructor(e,t,n,i){super(e,t,n,i)}InterpolantFactoryMethodLinear(e){return new i0(this.times,this.values,this.getValueSize(),e)}}ds.prototype.ValueTypeName="quaternion";ds.prototype.InterpolantFactoryMethodSmooth=void 0;class Or extends Wn{constructor(e,t,n){super(e,t,n)}}Or.prototype.ValueTypeName="string";Or.prototype.ValueBufferType=Array;Or.prototype.DefaultInterpolation=fa;Or.prototype.InterpolantFactoryMethodLinear=void 0;Or.prototype.InterpolantFactoryMethodSmooth=void 0;class Nr extends Wn{constructor(e,t,n,i){super(e,t,n,i)}}Nr.prototype.ValueTypeName="vector";class Kc{constructor(e="",t=-1,n=[],i=Sf){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=Vn(),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(s0(n[a]).scale(i));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}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 s=0,a=n.length;s!==a;++s)t.push(Wn.toJSON(n[s]));return i}static CreateFromMorphTargetSequence(e,t,n,i){const s=t.length,a=[];for(let o=0;o<s;o++){let l=[],c=[];l.push((o+s-1)%s,o,(o+1)%s),c.push(0,1,0);const h=Qp(l);l=$c(l,1,h),c=$c(c,1,h),!i&&l[0]===0&&(l.push(s),c.push(c[0])),a.push(new ya(".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={},s=/^([\w-]*?)([\d]+)$/;for(let o=0,l=e.length;o<l;o++){const c=e[o],h=c.name.match(s);if(h&&h.length>1){const u=h[1];let d=i[u];d||(i[u]=d=[]),d.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(u,d,f,m,_){if(f.length!==0){const g=[],p=[];Uu(f,g,p,m),g.length!==0&&_.push(new u(d,g,p))}},i=[],s=e.name||"default",a=e.fps||30,o=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let u=0;u<c.length;u++){const d=c[u].keys;if(!(!d||d.length===0))if(d[0].morphTargets){const f={};let m;for(m=0;m<d.length;m++)if(d[m].morphTargets)for(let _=0;_<d[m].morphTargets.length;_++)f[d[m].morphTargets[_]]=-1;for(const _ in f){const g=[],p=[];for(let S=0;S!==d[m].morphTargets.length;++S){const E=d[m];g.push(E.time),p.push(E.morphTarget===_?1:0)}i.push(new ya(".morphTargetInfluence["+_+"]",g,p))}l=f.length*a}else{const f=".bones["+t[u].name+"]";n(Nr,f+".position",d,"pos",i),n(ds,f+".quaternion",d,"rot",i),n(Nr,f+".scale",d,"scl",i)}}return i.length===0?null:new this(s,l,i,o)}resetDuration(){const e=this.tracks;let t=0;for(let n=0,i=e.length;n!==i;++n){const s=this.tracks[n];t=Math.max(t,s.times[s.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 r0(r){switch(r.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return ya;case"vector":case"vector2":case"vector3":case"vector4":return Nr;case"color":return Fu;case"quaternion":return ds;case"bool":case"boolean":return Fr;case"string":return Or}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+r)}function s0(r){if(r.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=r0(r.type);if(r.times===void 0){const t=[],n=[];Uu(r.keys,t,n,"value"),r.times=t,r.values=n}return e.parse!==void 0?e.parse(r):new e(r.name,r.times,r.values,r.interpolation)}const xa={enabled:!1,files:{},add:function(r,e){this.enabled!==!1&&(this.files[r]=e)},get:function(r){if(this.enabled!==!1)return this.files[r]},remove:function(r){delete this.files[r]},clear:function(){this.files={}}};class a0{constructor(e,t,n){const i=this;let s=!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++,s===!1&&i.onStart!==void 0&&i.onStart(h,a,o),s=!0},this.itemEnd=function(h){a++,i.onProgress!==void 0&&i.onProgress(h,a,o),a===o&&(s=!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,u){return c.push(h,u),this},this.removeHandler=function(h){const u=c.indexOf(h);return u!==-1&&c.splice(u,2),this},this.getHandler=function(h){for(let u=0,d=c.length;u<d;u+=2){const f=c[u],m=c[u+1];if(f.global&&(f.lastIndex=0),f.test(h))return m}return null}}}const Xl=new a0;class Gn{constructor(e){this.manager=e!==void 0?e:Xl,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise(function(i,s){n.load(e,i,t,s)})}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}}Gn.DEFAULT_MATERIAL_NAME="__DEFAULT";const ci={};class o0 extends Error{constructor(e,t){super(e),this.response=t}}class zr extends Gn{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 s=xa.get(e);if(s!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(s),this.manager.itemEnd(e)},0),s;if(ci[e]!==void 0){ci[e].push({onLoad:t,onProgress:n,onError:i});return}ci[e]=[],ci[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=ci[e],u=c.body.getReader(),d=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),f=d?parseInt(d):0,m=f!==0;let _=0;const g=new ReadableStream({start(p){S();function S(){u.read().then(({done:E,value:v})=>{if(E)p.close();else{_+=v.byteLength;const N=new ProgressEvent("progress",{lengthComputable:m,loaded:_,total:f});for(let C=0,T=h.length;C<T;C++){const L=h[C];L.onProgress&&L.onProgress(N)}p.enqueue(v),S()}},E=>{p.error(E)})}}});return new Response(g)}else throw new o0(`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 u=/charset="?([^;"\s]*)"?/i.exec(o),d=u&&u[1]?u[1].toLowerCase():void 0,f=new TextDecoder(d);return c.arrayBuffer().then(m=>f.decode(m))}}}).then(c=>{xa.add(e,c);const h=ci[e];delete ci[e];for(let u=0,d=h.length;u<d;u++){const f=h[u];f.onLoad&&f.onLoad(c)}}).catch(c=>{const h=ci[e];if(h===void 0)throw this.manager.itemError(e),c;delete ci[e];for(let u=0,d=h.length;u<d;u++){const f=h[u];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 l0 extends Gn{constructor(e){super(e)}load(e,t,n,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,a=xa.get(e);if(a!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(a),s.manager.itemEnd(e)},0),a;const o=os("img");function l(){h(),xa.add(e,this),t&&t(this),s.manager.itemEnd(e)}function c(u){h(),i&&i(u),s.manager.itemError(e),s.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),s.manager.itemStart(e),o.src=e,o}}class c0 extends Gn{constructor(e){super(e)}load(e,t,n,i){const s=this,a=new Du,o=new zr(this.manager);return o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(s.withCredentials),o.load(e,function(l){let c;try{c=s.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:kn,a.wrapT=c.wrapT!==void 0?c.wrapT:kn,a.magFilter=c.magFilter!==void 0?c.magFilter:Cn,a.minFilter=c.minFilter!==void 0?c.minFilter:Cn,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=ui),c.mipmapCount===1&&(a.minFilter=Cn),c.generateMipmaps!==void 0&&(a.generateMipmaps=c.generateMipmaps),a.needsUpdate=!0,t&&t(a,c)},n,i),a}}class ql extends Gn{constructor(e){super(e)}load(e,t,n,i){const s=new cn,a=new l0(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(o){s.image=o,s.needsUpdate=!0,t!==void 0&&t(s)},n,i),s}}class fs extends Ut{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new st(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 h0 extends fs{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Ut.DEFAULT_UP),this.updateMatrix(),this.groundColor=new st(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}const ho=new lt,Jc=new F,Zc=new F;class jl{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Ge(512,512),this.mapType=Qn,this.map=null,this.mapPass=null,this.matrix=new lt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new kl,this._frameExtents=new Ge(1,1),this._viewportCount=1,this._viewports=[new Mt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;Jc.setFromMatrixPosition(e.matrixWorld),t.position.copy(Jc),Zc.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Zc),t.updateMatrixWorld(),ho.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(ho),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(ho)}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 u0 extends jl{constructor(){super(new ln(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){const t=this.camera,n=Lr*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height*this.aspect,s=e.distance||t.far;(n!==t.fov||i!==t.aspect||s!==t.far)&&(t.fov=n,t.aspect=i,t.far=s,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class d0 extends fs{constructor(e,t,n=0,i=Math.PI/3,s=0,a=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Ut.DEFAULT_UP),this.updateMatrix(),this.target=new Ut,this.distance=n,this.angle=i,this.penumbra=s,this.decay=a,this.map=null,this.shadow=new u0}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 Qc=new lt,Yr=new F,uo=new F;class f0 extends jl{constructor(){super(new ln(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Ge(4,2),this._viewportCount=6,this._viewports=[new Mt(2,1,1,1),new Mt(0,1,1,1),new Mt(3,1,1,1),new Mt(1,1,1,1),new Mt(3,0,1,1),new Mt(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,s=e.distance||n.far;s!==n.far&&(n.far=s,n.updateProjectionMatrix()),Yr.setFromMatrixPosition(e.matrixWorld),n.position.copy(Yr),uo.copy(n.position),uo.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(uo),n.updateMatrixWorld(),i.makeTranslation(-Yr.x,-Yr.y,-Yr.z),Qc.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Qc)}}class Ou extends fs{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 f0}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 Ra extends Au{constructor(e=-1,t=1,n=1,i=-1,s=.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=s,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,s,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=s,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 s=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;s+=c*this.view.offsetX,a=s+c*this.view.width,o-=h*this.view.offsetY,l=o-h*this.view.height}this.projectionMatrix.makeOrthographic(s,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 p0 extends jl{constructor(){super(new Ra(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class zu extends fs{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Ut.DEFAULT_UP),this.updateMatrix(),this.target=new Ut,this.shadow=new p0}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class Bu extends fs{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class Yl{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 m0 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 g0 extends ln{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class _0{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=eh(),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=eh();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function eh(){return performance.now()}class pl extends Tu{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 th=new lt;class v0{constructor(e,t,n=0,i=1/0){this.ray=new Ur(e,t),this.near=n,this.far=i,this.camera=null,this.layers=new Ul,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 th.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(th),this}intersectObject(e,t=!0,n=[]){return ml(e,this,n,t),n.sort(nh),n}intersectObjects(e,t=!0,n=[]){for(let i=0,s=e.length;i<s;i++)ml(e[i],this,n,t);return n.sort(nh),n}}function nh(r,e){return r.distance-e.distance}function ml(r,e,t,n){let i=!0;if(r.layers.test(e.layers)&&r.raycast(e,t)===!1&&(i=!1),i===!0&&n===!0){const s=r.children;for(let a=0,o=s.length;a<o;a++)ml(s[a],e,t,!0)}}class ku{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 ih=new F,Xs=new F;class y0{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){ih.subVectors(e,this.start),Xs.subVectors(this.end,this.start);const n=Xs.dot(Xs);let s=Xs.dot(ih)/n;return t&&(s=vt(s,0,1)),s}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 x0 extends va{constructor(e=10,t=10,n=4473924,i=8947848){n=new st(n),i=new st(i);const s=t/2,a=e/t,o=e/2,l=[],c=[];for(let d=0,f=0,m=-o;d<=t;d++,m+=a){l.push(-o,0,m,o,0,m),l.push(m,0,-o,m,0,o);const _=d===s?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 u=new Ci({vertexColors:!0,toneMapped:!1});super(h,u),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class M0 extends $i{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 rh(r,e,t,n){const i=b0(n);switch(t){case fu:return r*e;case mu:return r*e/i.components*i.byteLength;case Dl:return r*e/i.components*i.byteLength;case gu:return r*e*2/i.components*i.byteLength;case Pl:return r*e*2/i.components*i.byteLength;case pu:return r*e*3/i.components*i.byteLength;case Un:return r*e*4/i.components*i.byteLength;case Ll:return r*e*4/i.components*i.byteLength;case ra:case sa:return Math.floor((r+3)/4)*Math.floor((e+3)/4)*8;case aa:case oa:return Math.floor((r+3)/4)*Math.floor((e+3)/4)*16;case ko:case Ho:return Math.max(r,16)*Math.max(e,8)/4;case Bo:case Vo:return Math.max(r,8)*Math.max(e,8)/2;case Go:case Wo:return Math.floor((r+3)/4)*Math.floor((e+3)/4)*8;case Xo:return Math.floor((r+3)/4)*Math.floor((e+3)/4)*16;case qo:return Math.floor((r+3)/4)*Math.floor((e+3)/4)*16;case jo:return Math.floor((r+4)/5)*Math.floor((e+3)/4)*16;case Yo:return Math.floor((r+4)/5)*Math.floor((e+4)/5)*16;case $o:return Math.floor((r+5)/6)*Math.floor((e+4)/5)*16;case Ko:return Math.floor((r+5)/6)*Math.floor((e+5)/6)*16;case Jo:return Math.floor((r+7)/8)*Math.floor((e+4)/5)*16;case Zo:return Math.floor((r+7)/8)*Math.floor((e+5)/6)*16;case Qo:return Math.floor((r+7)/8)*Math.floor((e+7)/8)*16;case el:return Math.floor((r+9)/10)*Math.floor((e+4)/5)*16;case tl:return Math.floor((r+9)/10)*Math.floor((e+5)/6)*16;case nl:return Math.floor((r+9)/10)*Math.floor((e+7)/8)*16;case il:return Math.floor((r+9)/10)*Math.floor((e+9)/10)*16;case rl:return Math.floor((r+11)/12)*Math.floor((e+9)/10)*16;case sl:return Math.floor((r+11)/12)*Math.floor((e+11)/12)*16;case la:case al:case ol:return Math.ceil(r/4)*Math.ceil(e/4)*16;case _u:case ll:return Math.ceil(r/4)*Math.ceil(e/4)*8;case cl:case hl:return Math.ceil(r/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function b0(r){switch(r){case Qn:case hu:return{byteLength:1,components:1};case is:case uu:case hs:return{byteLength:2,components:1};case Cl:case Rl:return{byteLength:2,components:4};case qi:case Tl:case Kn:return{byteLength:4,components:1};case du:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${r}.`)}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:wl}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=wl);/**
|
|
45
45
|
* @license
|
|
46
46
|
* Copyright 2010-2025 Three.js Authors
|
|
47
47
|
* SPDX-License-Identifier: MIT
|
|
@@ -108,10 +108,10 @@
|
|
|
108
108
|
float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );
|
|
109
109
|
reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
|
|
110
110
|
#endif
|
|
111
|
-
#endif`,
|
|
111
|
+
#endif`,P0=`#ifdef USE_AOMAP
|
|
112
112
|
uniform sampler2D aoMap;
|
|
113
113
|
uniform float aoMapIntensity;
|
|
114
|
-
#endif`,
|
|
114
|
+
#endif`,L0=`#ifdef USE_BATCHING
|
|
115
115
|
#if ! defined( GL_ANGLE_multi_draw )
|
|
116
116
|
#define gl_DrawID _gl_DrawID
|
|
117
117
|
uniform int _gl_DrawID;
|
|
@@ -526,11 +526,11 @@ transformedNormal = normalMatrix * transformedNormal;
|
|
|
526
526
|
#ifdef FLIP_SIDED
|
|
527
527
|
transformedTangent = - transformedTangent;
|
|
528
528
|
#endif
|
|
529
|
-
#endif`,
|
|
529
|
+
#endif`,K0=`#ifdef USE_DISPLACEMENTMAP
|
|
530
530
|
uniform sampler2D displacementMap;
|
|
531
531
|
uniform float displacementScale;
|
|
532
532
|
uniform float displacementBias;
|
|
533
|
-
#endif`,
|
|
533
|
+
#endif`,J0=`#ifdef USE_DISPLACEMENTMAP
|
|
534
534
|
transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );
|
|
535
535
|
#endif`,Z0=`#ifdef USE_EMISSIVEMAP
|
|
536
536
|
vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );
|
|
@@ -1404,9 +1404,9 @@ IncidentLight directLight;
|
|
|
1404
1404
|
sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );
|
|
1405
1405
|
#endif
|
|
1406
1406
|
diffuseColor *= sampledDiffuseColor;
|
|
1407
|
-
#endif`,
|
|
1407
|
+
#endif`,Pm=`#ifdef USE_MAP
|
|
1408
1408
|
uniform sampler2D map;
|
|
1409
|
-
#endif`,
|
|
1409
|
+
#endif`,Lm=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
|
|
1410
1410
|
#if defined( USE_POINTS_UV )
|
|
1411
1411
|
vec2 uv = vUv;
|
|
1412
1412
|
#else
|
|
@@ -1586,12 +1586,12 @@ vec3 nonPerturbedNormal = normal;`,Hm=`#ifdef USE_NORMALMAP_OBJECTSPACE
|
|
|
1586
1586
|
#endif
|
|
1587
1587
|
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
|
|
1588
1588
|
uniform sampler2D clearcoatRoughnessMap;
|
|
1589
|
-
#endif`,
|
|
1589
|
+
#endif`,Km=`#ifdef USE_IRIDESCENCEMAP
|
|
1590
1590
|
uniform sampler2D iridescenceMap;
|
|
1591
1591
|
#endif
|
|
1592
1592
|
#ifdef USE_IRIDESCENCE_THICKNESSMAP
|
|
1593
1593
|
uniform sampler2D iridescenceThicknessMap;
|
|
1594
|
-
#endif`,
|
|
1594
|
+
#endif`,Jm=`#ifdef OPAQUE
|
|
1595
1595
|
diffuseColor.a = 1.0;
|
|
1596
1596
|
#endif
|
|
1597
1597
|
#ifdef USE_TRANSMISSION
|
|
@@ -2644,7 +2644,7 @@ void main() {
|
|
|
2644
2644
|
#elif DEPTH_PACKING == 3203
|
|
2645
2645
|
gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );
|
|
2646
2646
|
#endif
|
|
2647
|
-
}`,
|
|
2647
|
+
}`,P1=`#define DISTANCE
|
|
2648
2648
|
varying vec3 vWorldPosition;
|
|
2649
2649
|
#include <common>
|
|
2650
2650
|
#include <batching_pars_vertex>
|
|
@@ -2671,7 +2671,7 @@ void main() {
|
|
|
2671
2671
|
#include <worldpos_vertex>
|
|
2672
2672
|
#include <clipping_planes_vertex>
|
|
2673
2673
|
vWorldPosition = worldPosition.xyz;
|
|
2674
|
-
}`,
|
|
2674
|
+
}`,L1=`#define DISTANCE
|
|
2675
2675
|
uniform vec3 referencePosition;
|
|
2676
2676
|
uniform float nearDistance;
|
|
2677
2677
|
uniform float farDistance;
|
|
@@ -3374,7 +3374,7 @@ void main() {
|
|
|
3374
3374
|
#include <worldpos_vertex>
|
|
3375
3375
|
#include <shadowmap_vertex>
|
|
3376
3376
|
#include <fog_vertex>
|
|
3377
|
-
}`,
|
|
3377
|
+
}`,K1=`#define TOON
|
|
3378
3378
|
uniform vec3 diffuse;
|
|
3379
3379
|
uniform vec3 emissive;
|
|
3380
3380
|
uniform float opacity;
|
|
@@ -3427,7 +3427,7 @@ void main() {
|
|
|
3427
3427
|
#include <fog_fragment>
|
|
3428
3428
|
#include <premultiplied_alpha_fragment>
|
|
3429
3429
|
#include <dithering_fragment>
|
|
3430
|
-
}`,
|
|
3430
|
+
}`,J1=`uniform float size;
|
|
3431
3431
|
uniform float scale;
|
|
3432
3432
|
#include <common>
|
|
3433
3433
|
#include <color_pars_vertex>
|
|
@@ -3571,7 +3571,7 @@ void main() {
|
|
|
3571
3571
|
#include <tonemapping_fragment>
|
|
3572
3572
|
#include <colorspace_fragment>
|
|
3573
3573
|
#include <fog_fragment>
|
|
3574
|
-
}`,yt={alphahash_fragment:E0,alphahash_pars_fragment:A0,alphamap_fragment:w0,alphamap_pars_fragment:T0,alphatest_fragment:C0,alphatest_pars_fragment:R0,aomap_fragment:D0,aomap_pars_fragment:L0,batching_pars_vertex:P0,batching_vertex:I0,begin_vertex:N0,beginnormal_vertex:U0,bsdfs:F0,iridescence_fragment:O0,bumpmap_pars_fragment:z0,clipping_planes_fragment:B0,clipping_planes_pars_fragment:k0,clipping_planes_pars_vertex:V0,clipping_planes_vertex:H0,color_fragment:G0,color_pars_fragment:W0,color_pars_vertex:X0,color_vertex:q0,common:j0,cube_uv_reflection_fragment:Y0,defaultnormal_vertex:$0,displacementmap_pars_vertex:J0,displacementmap_vertex:K0,emissivemap_fragment:Z0,emissivemap_pars_fragment:Q0,colorspace_fragment:em,colorspace_pars_fragment:tm,envmap_fragment:nm,envmap_common_pars_fragment:im,envmap_pars_fragment:rm,envmap_pars_vertex:sm,envmap_physical_pars_fragment:gm,envmap_vertex:am,fog_vertex:om,fog_pars_vertex:lm,fog_fragment:cm,fog_pars_fragment:hm,gradientmap_pars_fragment:um,lightmap_pars_fragment:dm,lights_lambert_fragment:fm,lights_lambert_pars_fragment:pm,lights_pars_begin:mm,lights_toon_fragment:_m,lights_toon_pars_fragment:vm,lights_phong_fragment:ym,lights_phong_pars_fragment:xm,lights_physical_fragment:Mm,lights_physical_pars_fragment:bm,lights_fragment_begin:Sm,lights_fragment_maps:Em,lights_fragment_end:Am,logdepthbuf_fragment:wm,logdepthbuf_pars_fragment:Tm,logdepthbuf_pars_vertex:Cm,logdepthbuf_vertex:Rm,map_fragment:Dm,map_pars_fragment:Lm,map_particle_fragment:Pm,map_particle_pars_fragment:Im,metalnessmap_fragment:Nm,metalnessmap_pars_fragment:Um,morphinstance_vertex:Fm,morphcolor_vertex:Om,morphnormal_vertex:zm,morphtarget_pars_vertex:Bm,morphtarget_vertex:km,normal_fragment_begin:Vm,normal_fragment_maps:Hm,normal_pars_fragment:Gm,normal_pars_vertex:Wm,normal_vertex:Xm,normalmap_pars_fragment:qm,clearcoat_normal_fragment_begin:jm,clearcoat_normal_fragment_maps:Ym,clearcoat_pars_fragment:$m,iridescence_pars_fragment:Jm,opaque_fragment:Km,packing:Zm,premultiplied_alpha_fragment:Qm,project_vertex:e1,dithering_fragment:t1,dithering_pars_fragment:n1,roughnessmap_fragment:i1,roughnessmap_pars_fragment:r1,shadowmap_pars_fragment:s1,shadowmap_pars_vertex:a1,shadowmap_vertex:o1,shadowmask_pars_fragment:l1,skinbase_vertex:c1,skinning_pars_vertex:h1,skinning_vertex:u1,skinnormal_vertex:d1,specularmap_fragment:f1,specularmap_pars_fragment:p1,tonemapping_fragment:m1,tonemapping_pars_fragment:g1,transmission_fragment:_1,transmission_pars_fragment:v1,uv_pars_fragment:y1,uv_pars_vertex:x1,uv_vertex:M1,worldpos_vertex:b1,background_vert:S1,background_frag:E1,backgroundCube_vert:A1,backgroundCube_frag:w1,cube_vert:T1,cube_frag:C1,depth_vert:R1,depth_frag:D1,distanceRGBA_vert:L1,distanceRGBA_frag:P1,equirect_vert:I1,equirect_frag:N1,linedashed_vert:U1,linedashed_frag:F1,meshbasic_vert:O1,meshbasic_frag:z1,meshlambert_vert:B1,meshlambert_frag:k1,meshmatcap_vert:V1,meshmatcap_frag:H1,meshnormal_vert:G1,meshnormal_frag:W1,meshphong_vert:X1,meshphong_frag:q1,meshphysical_vert:j1,meshphysical_frag:Y1,meshtoon_vert:$1,meshtoon_frag:J1,points_vert:K1,points_frag:Z1,shadow_vert:Q1,shadow_frag:e2,sprite_vert:t2,sprite_frag:n2},Ne={common:{diffuse:{value:new st(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 Ge(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 st(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 st(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 st(16777215)},opacity:{value:1},center:{value:new Ge(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new _t},alphaMap:{value:null},alphaMapTransform:{value:new _t},alphaTest:{value:0}}},Sn={basic:{uniforms:_n([Ne.common,Ne.specularmap,Ne.envmap,Ne.aomap,Ne.lightmap,Ne.fog]),vertexShader:yt.meshbasic_vert,fragmentShader:yt.meshbasic_frag},lambert:{uniforms:_n([Ne.common,Ne.specularmap,Ne.envmap,Ne.aomap,Ne.lightmap,Ne.emissivemap,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.fog,Ne.lights,{emissive:{value:new st(0)}}]),vertexShader:yt.meshlambert_vert,fragmentShader:yt.meshlambert_frag},phong:{uniforms:_n([Ne.common,Ne.specularmap,Ne.envmap,Ne.aomap,Ne.lightmap,Ne.emissivemap,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.fog,Ne.lights,{emissive:{value:new st(0)},specular:{value:new st(1118481)},shininess:{value:30}}]),vertexShader:yt.meshphong_vert,fragmentShader:yt.meshphong_frag},standard:{uniforms:_n([Ne.common,Ne.envmap,Ne.aomap,Ne.lightmap,Ne.emissivemap,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.roughnessmap,Ne.metalnessmap,Ne.fog,Ne.lights,{emissive:{value:new st(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:yt.meshphysical_vert,fragmentShader:yt.meshphysical_frag},toon:{uniforms:_n([Ne.common,Ne.aomap,Ne.lightmap,Ne.emissivemap,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.gradientmap,Ne.fog,Ne.lights,{emissive:{value:new st(0)}}]),vertexShader:yt.meshtoon_vert,fragmentShader:yt.meshtoon_frag},matcap:{uniforms:_n([Ne.common,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.fog,{matcap:{value:null}}]),vertexShader:yt.meshmatcap_vert,fragmentShader:yt.meshmatcap_frag},points:{uniforms:_n([Ne.points,Ne.fog]),vertexShader:yt.points_vert,fragmentShader:yt.points_frag},dashed:{uniforms:_n([Ne.common,Ne.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:yt.linedashed_vert,fragmentShader:yt.linedashed_frag},depth:{uniforms:_n([Ne.common,Ne.displacementmap]),vertexShader:yt.depth_vert,fragmentShader:yt.depth_frag},normal:{uniforms:_n([Ne.common,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,{opacity:{value:1}}]),vertexShader:yt.meshnormal_vert,fragmentShader:yt.meshnormal_frag},sprite:{uniforms:_n([Ne.sprite,Ne.fog]),vertexShader:yt.sprite_vert,fragmentShader:yt.sprite_frag},background:{uniforms:{uvTransform:{value:new _t},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:yt.background_vert,fragmentShader:yt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new _t}},vertexShader:yt.backgroundCube_vert,fragmentShader:yt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:yt.cube_vert,fragmentShader:yt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:yt.equirect_vert,fragmentShader:yt.equirect_frag},distanceRGBA:{uniforms:_n([Ne.common,Ne.displacementmap,{referencePosition:{value:new F},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:yt.distanceRGBA_vert,fragmentShader:yt.distanceRGBA_frag},shadow:{uniforms:_n([Ne.lights,Ne.fog,{color:{value:new st(0)},opacity:{value:1}}]),vertexShader:yt.shadow_vert,fragmentShader:yt.shadow_frag}};Sn.physical={uniforms:_n([Sn.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new _t},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new _t},clearcoatNormalScale:{value:new Ge(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 st(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 Ge},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new _t},attenuationDistance:{value:0},attenuationColor:{value:new st(0)},specularColor:{value:new st(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new _t},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new _t},anisotropyVector:{value:new Ge},anisotropyMap:{value:null},anisotropyMapTransform:{value:new _t}}]),vertexShader:yt.meshphysical_vert,fragmentShader:yt.meshphysical_frag};const qs={r:0,b:0,g:0},Fi=new yn,i2=new lt;function r2(r,e,t,n,i,s,a){const o=new st(0);let l=s===!0?0:1,c,h,u=null,d=0,f=null;function m(E){let v=E.isScene===!0?E.background:null;return v&&v.isTexture&&(v=(E.backgroundBlurriness>0?t:e).get(v)),v}function _(E){let v=!1;const N=m(E);N===null?p(o,l):N&&N.isColor&&(p(N,1),v=!0);const C=r.xr.getEnvironmentBlendMode();C==="additive"?n.buffers.color.setClear(0,0,0,1,a):C==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,a),(r.autoClear||v)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil))}function g(E,v){const N=m(v);N&&(N.isCubeTexture||N.mapping===Sa)?(h===void 0&&(h=new Ct(new Ji(1,1,1),new pi({name:"BackgroundCubeMaterial",uniforms:Ir(Sn.backgroundCube.uniforms),vertexShader:Sn.backgroundCube.vertexShader,fragmentShader:Sn.backgroundCube.fragmentShader,side:vn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(C,T,P){this.matrixWorld.copyPosition(P.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(h)),Fi.copy(v.backgroundRotation),Fi.x*=-1,Fi.y*=-1,Fi.z*=-1,N.isCubeTexture&&N.isRenderTargetTexture===!1&&(Fi.y*=-1,Fi.z*=-1),h.material.uniforms.envMap.value=N,h.material.uniforms.flipEnvMap.value=N.isCubeTexture&&N.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=v.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(i2.makeRotationFromEuler(Fi)),h.material.toneMapped=xt.getTransfer(N.colorSpace)!==Nt,(u!==N||d!==N.version||f!==r.toneMapping)&&(h.material.needsUpdate=!0,u=N,d=N.version,f=r.toneMapping),h.layers.enableAll(),E.unshift(h,h.geometry,h.material,0,0,null)):N&&N.isTexture&&(c===void 0&&(c=new Ct(new us(2,2),new pi({name:"BackgroundMaterial",uniforms:Ir(Sn.background.uniforms),vertexShader:Sn.background.vertexShader,fragmentShader:Sn.background.fragmentShader,side:Hn,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=N,c.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,c.material.toneMapped=xt.getTransfer(N.colorSpace)!==Nt,N.matrixAutoUpdate===!0&&N.updateMatrix(),c.material.uniforms.uvTransform.value.copy(N.matrix),(u!==N||d!==N.version||f!==r.toneMapping)&&(c.material.needsUpdate=!0,u=N,d=N.version,f=r.toneMapping),c.layers.enableAll(),E.unshift(c,c.geometry,c.material,0,0,null))}function p(E,v){E.getRGB(qs,Eu(r)),n.buffers.color.setClear(qs.r,qs.g,qs.b,v,a)}function S(){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,v=1){o.set(E),l=v,p(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(E){l=E,p(o,l)},render:_,addToRenderList:g,dispose:S}}function s2(r,e){const t=r.getParameter(r.MAX_VERTEX_ATTRIBS),n={},i=d(null);let s=i,a=!1;function o(x,R,B,V,W){let ee=!1;const k=u(V,B,R);s!==k&&(s=k,c(s.object)),ee=f(x,V,B,W),ee&&m(x,V,B,W),W!==null&&e.update(W,r.ELEMENT_ARRAY_BUFFER),(ee||a)&&(a=!1,v(x,R,B,V),W!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,e.get(W).buffer))}function l(){return r.createVertexArray()}function c(x){return r.bindVertexArray(x)}function h(x){return r.deleteVertexArray(x)}function u(x,R,B){const V=B.wireframe===!0;let W=n[x.id];W===void 0&&(W={},n[x.id]=W);let ee=W[R.id];ee===void 0&&(ee={},W[R.id]=ee);let k=ee[V];return k===void 0&&(k=d(l()),ee[V]=k),k}function d(x){const R=[],B=[],V=[];for(let W=0;W<t;W++)R[W]=0,B[W]=0,V[W]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:R,enabledAttributes:B,attributeDivisors:V,object:x,attributes:{},index:null}}function f(x,R,B,V){const W=s.attributes,ee=R.attributes;let k=0;const Q=B.getAttributes();for(const q in Q)if(Q[q].location>=0){const ye=W[q];let le=ee[q];if(le===void 0&&(q==="instanceMatrix"&&x.instanceMatrix&&(le=x.instanceMatrix),q==="instanceColor"&&x.instanceColor&&(le=x.instanceColor)),ye===void 0||ye.attribute!==le||le&&ye.data!==le.data)return!0;k++}return s.attributesNum!==k||s.index!==V}function m(x,R,B,V){const W={},ee=R.attributes;let k=0;const Q=B.getAttributes();for(const q in Q)if(Q[q].location>=0){let ye=ee[q];ye===void 0&&(q==="instanceMatrix"&&x.instanceMatrix&&(ye=x.instanceMatrix),q==="instanceColor"&&x.instanceColor&&(ye=x.instanceColor));const le={};le.attribute=ye,ye&&ye.data&&(le.data=ye.data),W[q]=le,k++}s.attributes=W,s.attributesNum=k,s.index=V}function _(){const x=s.newAttributes;for(let R=0,B=x.length;R<B;R++)x[R]=0}function g(x){p(x,0)}function p(x,R){const B=s.newAttributes,V=s.enabledAttributes,W=s.attributeDivisors;B[x]=1,V[x]===0&&(r.enableVertexAttribArray(x),V[x]=1),W[x]!==R&&(r.vertexAttribDivisor(x,R),W[x]=R)}function S(){const x=s.newAttributes,R=s.enabledAttributes;for(let B=0,V=R.length;B<V;B++)R[B]!==x[B]&&(r.disableVertexAttribArray(B),R[B]=0)}function E(x,R,B,V,W,ee,k){k===!0?r.vertexAttribIPointer(x,R,B,W,ee):r.vertexAttribPointer(x,R,B,V,W,ee)}function v(x,R,B,V){_();const W=V.attributes,ee=B.getAttributes(),k=R.defaultAttributeValues;for(const Q in ee){const q=ee[Q];if(q.location>=0){let ue=W[Q];if(ue===void 0&&(Q==="instanceMatrix"&&x.instanceMatrix&&(ue=x.instanceMatrix),Q==="instanceColor"&&x.instanceColor&&(ue=x.instanceColor)),ue!==void 0){const ye=ue.normalized,le=ue.itemSize,Le=e.get(ue);if(Le===void 0)continue;const Te=Le.buffer,Y=Le.type,re=Le.bytesPerElement,ae=Y===r.INT||Y===r.UNSIGNED_INT||ue.gpuType===Tl;if(ue.isInterleavedBufferAttribute){const oe=ue.data,Ee=oe.stride,_e=ue.offset;if(oe.isInstancedInterleavedBuffer){for(let we=0;we<q.locationSize;we++)p(q.location+we,oe.meshPerAttribute);x.isInstancedMesh!==!0&&V._maxInstanceCount===void 0&&(V._maxInstanceCount=oe.meshPerAttribute*oe.count)}else for(let we=0;we<q.locationSize;we++)g(q.location+we);r.bindBuffer(r.ARRAY_BUFFER,Te);for(let we=0;we<q.locationSize;we++)E(q.location+we,le/q.locationSize,Y,ye,Ee*re,(_e+le/q.locationSize*we)*re,ae)}else{if(ue.isInstancedBufferAttribute){for(let oe=0;oe<q.locationSize;oe++)p(q.location+oe,ue.meshPerAttribute);x.isInstancedMesh!==!0&&V._maxInstanceCount===void 0&&(V._maxInstanceCount=ue.meshPerAttribute*ue.count)}else for(let oe=0;oe<q.locationSize;oe++)g(q.location+oe);r.bindBuffer(r.ARRAY_BUFFER,Te);for(let oe=0;oe<q.locationSize;oe++)E(q.location+oe,le/q.locationSize,Y,ye,le*re,le/q.locationSize*oe*re,ae)}}else if(k!==void 0){const ye=k[Q];if(ye!==void 0)switch(ye.length){case 2:r.vertexAttrib2fv(q.location,ye);break;case 3:r.vertexAttrib3fv(q.location,ye);break;case 4:r.vertexAttrib4fv(q.location,ye);break;default:r.vertexAttrib1fv(q.location,ye)}}}}S()}function N(){P();for(const x in n){const R=n[x];for(const B in R){const V=R[B];for(const W in V)h(V[W].object),delete V[W];delete R[B]}delete n[x]}}function C(x){if(n[x.id]===void 0)return;const R=n[x.id];for(const B in R){const V=R[B];for(const W in V)h(V[W].object),delete V[W];delete R[B]}delete n[x.id]}function T(x){for(const R in n){const B=n[R];if(B[x.id]===void 0)continue;const V=B[x.id];for(const W in V)h(V[W].object),delete V[W];delete B[x.id]}}function P(){b(),a=!0,s!==i&&(s=i,c(s.object))}function b(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:o,reset:P,resetDefaultState:b,dispose:N,releaseStatesOfGeometry:C,releaseStatesOfProgram:T,initAttributes:_,enableAttribute:g,disableUnusedAttributes:S}}function a2(r,e,t){let n;function i(c){n=c}function s(c,h){r.drawArrays(n,c,h),t.update(h,n,1)}function a(c,h,u){u!==0&&(r.drawArraysInstanced(n,c,h,u),t.update(h,n,u))}function o(c,h,u){if(u===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(n,c,0,h,0,u);let f=0;for(let m=0;m<u;m++)f+=h[m];t.update(f,n,1)}function l(c,h,u,d){if(u===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],d[m]);else{f.multiDrawArraysInstancedWEBGL(n,c,0,h,0,d,0,u);let m=0;for(let _=0;_<u;_++)m+=h[_]*d[_];t.update(m,n,1)}}this.setMode=i,this.render=s,this.renderInstances=a,this.renderMultiDraw=o,this.renderMultiDrawInstances=l}function o2(r,e,t,n){let i;function s(){if(i!==void 0)return i;if(e.has("EXT_texture_filter_anisotropic")===!0){const T=e.get("EXT_texture_filter_anisotropic");i=r.getParameter(T.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function a(T){return!(T!==Un&&n.convert(T)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_FORMAT))}function o(T){const P=T===hs&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(T!==Qn&&n.convert(T)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_TYPE)&&T!==Jn&&!P)}function l(T){if(T==="highp"){if(r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";T="mediump"}return T==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.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 u=t.logarithmicDepthBuffer===!0,d=t.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),f=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),m=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),_=r.getParameter(r.MAX_TEXTURE_SIZE),g=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),p=r.getParameter(r.MAX_VERTEX_ATTRIBS),S=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),E=r.getParameter(r.MAX_VARYING_VECTORS),v=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),N=m>0,C=r.getParameter(r.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:a,textureTypeReadable:o,precision:c,logarithmicDepthBuffer:u,reverseDepthBuffer:d,maxTextures:f,maxVertexTextures:m,maxTextureSize:_,maxCubemapSize:g,maxAttributes:p,maxVertexUniforms:S,maxVaryings:E,maxFragmentUniforms:v,vertexTextures:N,maxSamples:C}}function l2(r){const e=this;let t=null,n=0,i=!1,s=!1;const a=new Ei,o=new _t,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(u,d){const f=u.length!==0||d||n!==0||i;return i=d,n=u.length,f},this.beginShadows=function(){s=!0,h(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(u,d){t=h(u,d,0)},this.setState=function(u,d,f){const m=u.clippingPlanes,_=u.clipIntersection,g=u.clipShadows,p=r.get(u);if(!i||m===null||m.length===0||s&&!g)s?h(null):c();else{const S=s?0:n,E=S*4;let v=p.clippingState||null;l.value=v,v=h(m,d,E,f);for(let N=0;N!==E;++N)v[N]=t[N];p.clippingState=v,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=S}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function h(u,d,f,m){const _=u!==null?u.length:0;let g=null;if(_!==0){if(g=l.value,m!==!0||g===null){const p=f+_*4,S=d.matrixWorldInverse;o.getNormalMatrix(S),(g===null||g.length<p)&&(g=new Float32Array(p));for(let E=0,v=f;E!==_;++E,v+=4)a.copy(u[E]).applyMatrix4(S,o),a.normal.toArray(g,v),g[v+3]=a.constant}l.value=g,l.needsUpdate=!0}return e.numPlanes=_,e.numIntersection=0,g}}function c2(r){let e=new WeakMap;function t(a,o){return o===Uo?a.mapping=Rr:o===Fo&&(a.mapping=Dr),a}function n(a){if(a&&a.isTexture){const o=a.mapping;if(o===Uo||o===Fo)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 bp(l.height);return c.fromEquirectangularTexture(r,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 s(){e=new WeakMap}return{get:n,dispose:s}}const Er=4,sh=[.125,.215,.35,.446,.526,.582],Gi=20,uo=new Ca,ah=new st;let fo=null,po=0,mo=0,go=!1;const ki=(1+Math.sqrt(5))/2,Mr=1/ki,oh=[new F(-ki,Mr,0),new F(ki,Mr,0),new F(-Mr,0,ki),new F(Mr,0,ki),new F(0,ki,-Mr),new F(0,ki,Mr),new F(-1,1,-1),new F(1,1,-1),new F(-1,1,1),new F(1,1,1)],h2=new F;class lh{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,s={}){const{size:a=256,position:o=h2}=s;fo=this._renderer.getRenderTarget(),po=this._renderer.getActiveCubeFace(),mo=this._renderer.getActiveMipmapLevel(),go=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=uh(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=hh(),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(fo,po,mo),this._renderer.xr.enabled=go,e.scissorTest=!1,js(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===Rr||e.mapping===Dr?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),fo=this._renderer.getRenderTarget(),po=this._renderer.getActiveCubeFace(),mo=this._renderer.getActiveMipmapLevel(),go=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:Tn,minFilter:Tn,generateMipmaps:!1,type:hs,format:Un,colorSpace:Lr,depthBuffer:!1},i=ch(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=ch(e,t,n);const{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=u2(s)),this._blurMaterial=d2(s,e,t)}return i}_compileMaterial(e){const t=new Ct(this._lodPlanes[0],e);this._renderer.compile(t,uo)}_sceneToCubeUV(e,t,n,i,s){const l=new ln(90,1,t,n),c=[1,-1,1,1,1,1],h=[1,1,1,-1,-1,-1],u=this._renderer,d=u.autoClear,f=u.toneMapping;u.getClearColor(ah),u.toneMapping=Ti,u.autoClear=!1;const m=new Ri({name:"PMREM.Background",side:vn,depthWrite:!1,depthTest:!1}),_=new Ct(new Ji,m);let g=!1;const p=e.background;p?p.isColor&&(m.color.copy(p),e.background=null,g=!0):(m.color.copy(ah),g=!0);for(let S=0;S<6;S++){const E=S%3;E===0?(l.up.set(0,c[S],0),l.position.set(s.x,s.y,s.z),l.lookAt(s.x+h[S],s.y,s.z)):E===1?(l.up.set(0,0,c[S]),l.position.set(s.x,s.y,s.z),l.lookAt(s.x,s.y+h[S],s.z)):(l.up.set(0,c[S],0),l.position.set(s.x,s.y,s.z),l.lookAt(s.x,s.y,s.z+h[S]));const v=this._cubeSize;js(i,E*v,S>2?v:0,v,v),u.setRenderTarget(i),g&&u.render(_,l),u.render(e,l)}_.geometry.dispose(),_.material.dispose(),u.toneMapping=f,u.autoClear=d,e.background=p}_textureToCubeUV(e,t){const n=this._renderer,i=e.mapping===Rr||e.mapping===Dr;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=uh()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=hh());const s=i?this._cubemapMaterial:this._equirectMaterial,a=new Ct(this._lodPlanes[0],s),o=s.uniforms;o.envMap.value=e;const l=this._cubeSize;js(t,0,0,3*l,2*l),n.setRenderTarget(t),n.render(a,uo)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;const i=this._lodPlanes.length;for(let s=1;s<i;s++){const a=Math.sqrt(this._sigmas[s]*this._sigmas[s]-this._sigmas[s-1]*this._sigmas[s-1]),o=oh[(i-s-1)%oh.length];this._blur(e,s-1,s,a,o)}t.autoClear=n}_blur(e,t,n,i,s){const a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,i,"latitudinal",s),this._halfBlur(a,e,n,n,i,"longitudinal",s)}_halfBlur(e,t,n,i,s,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,u=new Ct(this._lodPlanes[i],c),d=c.uniforms,f=this._sizeLods[n]-1,m=isFinite(s)?Math.PI/(2*f):2*Math.PI/(2*Gi-1),_=s/m,g=isFinite(s)?1+Math.floor(h*_):Gi;g>Gi&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${g} samples when the maximum is set to ${Gi}`);const p=[];let S=0;for(let T=0;T<Gi;++T){const P=T/_,b=Math.exp(-P*P/2);p.push(b),T===0?S+=b:T<g&&(S+=2*b)}for(let T=0;T<p.length;T++)p[T]=p[T]/S;d.envMap.value=e.texture,d.samples.value=g,d.weights.value=p,d.latitudinal.value=a==="latitudinal",o&&(d.poleAxis.value=o);const{_lodMax:E}=this;d.dTheta.value=m,d.mipInt.value=E-n;const v=this._sizeLods[i],N=3*v*(i>E-Er?i-E+Er:0),C=4*(this._cubeSize-v);js(t,N,C,3*v,2*v),l.setRenderTarget(t),l.render(u,uo)}}function u2(r){const e=[],t=[],n=[];let i=r;const s=r-Er+1+sh.length;for(let a=0;a<s;a++){const o=Math.pow(2,i);t.push(o);let l=1/o;a>r-Er?l=sh[a-r+Er-1]:a===0&&(l=0),n.push(l);const c=1/(o-2),h=-c,u=1+c,d=[h,h,u,h,u,u,h,h,u,u,h,u],f=6,m=6,_=3,g=2,p=1,S=new Float32Array(_*m*f),E=new Float32Array(g*m*f),v=new Float32Array(p*m*f);for(let C=0;C<f;C++){const T=C%3*2/3-1,P=C>2?0:-1,b=[T,P,0,T+2/3,P,0,T+2/3,P+1,0,T,P,0,T+2/3,P+1,0,T,P+1,0];S.set(b,_*m*C),E.set(d,g*m*C);const x=[C,C,C,C,C,C];v.set(x,p*m*C)}const N=new Bt;N.setAttribute("position",new Gt(S,_)),N.setAttribute("uv",new Gt(E,g)),N.setAttribute("faceIndex",new Gt(v,p)),e.push(N),i>Er&&i--}return{lodPlanes:e,sizeLods:t,sigmas:n}}function ch(r,e,t){const n=new ji(r,e,t);return n.texture.mapping=Sa,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function js(r,e,t,n,i){r.viewport.set(e,t,n,i),r.scissor.set(e,t,n,i)}function d2(r,e,t){const n=new Float32Array(Gi),i=new F(0,1,0);return new pi({name:"SphericalGaussianBlur",defines:{n:Gi,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:$l(),fragmentShader:`
|
|
3574
|
+
}`,yt={alphahash_fragment:E0,alphahash_pars_fragment:A0,alphamap_fragment:w0,alphamap_pars_fragment:T0,alphatest_fragment:C0,alphatest_pars_fragment:R0,aomap_fragment:D0,aomap_pars_fragment:P0,batching_pars_vertex:L0,batching_vertex:I0,begin_vertex:N0,beginnormal_vertex:U0,bsdfs:F0,iridescence_fragment:O0,bumpmap_pars_fragment:z0,clipping_planes_fragment:B0,clipping_planes_pars_fragment:k0,clipping_planes_pars_vertex:V0,clipping_planes_vertex:H0,color_fragment:G0,color_pars_fragment:W0,color_pars_vertex:X0,color_vertex:q0,common:j0,cube_uv_reflection_fragment:Y0,defaultnormal_vertex:$0,displacementmap_pars_vertex:K0,displacementmap_vertex:J0,emissivemap_fragment:Z0,emissivemap_pars_fragment:Q0,colorspace_fragment:em,colorspace_pars_fragment:tm,envmap_fragment:nm,envmap_common_pars_fragment:im,envmap_pars_fragment:rm,envmap_pars_vertex:sm,envmap_physical_pars_fragment:gm,envmap_vertex:am,fog_vertex:om,fog_pars_vertex:lm,fog_fragment:cm,fog_pars_fragment:hm,gradientmap_pars_fragment:um,lightmap_pars_fragment:dm,lights_lambert_fragment:fm,lights_lambert_pars_fragment:pm,lights_pars_begin:mm,lights_toon_fragment:_m,lights_toon_pars_fragment:vm,lights_phong_fragment:ym,lights_phong_pars_fragment:xm,lights_physical_fragment:Mm,lights_physical_pars_fragment:bm,lights_fragment_begin:Sm,lights_fragment_maps:Em,lights_fragment_end:Am,logdepthbuf_fragment:wm,logdepthbuf_pars_fragment:Tm,logdepthbuf_pars_vertex:Cm,logdepthbuf_vertex:Rm,map_fragment:Dm,map_pars_fragment:Pm,map_particle_fragment:Lm,map_particle_pars_fragment:Im,metalnessmap_fragment:Nm,metalnessmap_pars_fragment:Um,morphinstance_vertex:Fm,morphcolor_vertex:Om,morphnormal_vertex:zm,morphtarget_pars_vertex:Bm,morphtarget_vertex:km,normal_fragment_begin:Vm,normal_fragment_maps:Hm,normal_pars_fragment:Gm,normal_pars_vertex:Wm,normal_vertex:Xm,normalmap_pars_fragment:qm,clearcoat_normal_fragment_begin:jm,clearcoat_normal_fragment_maps:Ym,clearcoat_pars_fragment:$m,iridescence_pars_fragment:Km,opaque_fragment:Jm,packing:Zm,premultiplied_alpha_fragment:Qm,project_vertex:e1,dithering_fragment:t1,dithering_pars_fragment:n1,roughnessmap_fragment:i1,roughnessmap_pars_fragment:r1,shadowmap_pars_fragment:s1,shadowmap_pars_vertex:a1,shadowmap_vertex:o1,shadowmask_pars_fragment:l1,skinbase_vertex:c1,skinning_pars_vertex:h1,skinning_vertex:u1,skinnormal_vertex:d1,specularmap_fragment:f1,specularmap_pars_fragment:p1,tonemapping_fragment:m1,tonemapping_pars_fragment:g1,transmission_fragment:_1,transmission_pars_fragment:v1,uv_pars_fragment:y1,uv_pars_vertex:x1,uv_vertex:M1,worldpos_vertex:b1,background_vert:S1,background_frag:E1,backgroundCube_vert:A1,backgroundCube_frag:w1,cube_vert:T1,cube_frag:C1,depth_vert:R1,depth_frag:D1,distanceRGBA_vert:P1,distanceRGBA_frag:L1,equirect_vert:I1,equirect_frag:N1,linedashed_vert:U1,linedashed_frag:F1,meshbasic_vert:O1,meshbasic_frag:z1,meshlambert_vert:B1,meshlambert_frag:k1,meshmatcap_vert:V1,meshmatcap_frag:H1,meshnormal_vert:G1,meshnormal_frag:W1,meshphong_vert:X1,meshphong_frag:q1,meshphysical_vert:j1,meshphysical_frag:Y1,meshtoon_vert:$1,meshtoon_frag:K1,points_vert:J1,points_frag:Z1,shadow_vert:Q1,shadow_frag:e2,sprite_vert:t2,sprite_frag:n2},Ne={common:{diffuse:{value:new st(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 Ge(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 st(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 st(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 st(16777215)},opacity:{value:1},center:{value:new Ge(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new _t},alphaMap:{value:null},alphaMapTransform:{value:new _t},alphaTest:{value:0}}},Sn={basic:{uniforms:_n([Ne.common,Ne.specularmap,Ne.envmap,Ne.aomap,Ne.lightmap,Ne.fog]),vertexShader:yt.meshbasic_vert,fragmentShader:yt.meshbasic_frag},lambert:{uniforms:_n([Ne.common,Ne.specularmap,Ne.envmap,Ne.aomap,Ne.lightmap,Ne.emissivemap,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.fog,Ne.lights,{emissive:{value:new st(0)}}]),vertexShader:yt.meshlambert_vert,fragmentShader:yt.meshlambert_frag},phong:{uniforms:_n([Ne.common,Ne.specularmap,Ne.envmap,Ne.aomap,Ne.lightmap,Ne.emissivemap,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.fog,Ne.lights,{emissive:{value:new st(0)},specular:{value:new st(1118481)},shininess:{value:30}}]),vertexShader:yt.meshphong_vert,fragmentShader:yt.meshphong_frag},standard:{uniforms:_n([Ne.common,Ne.envmap,Ne.aomap,Ne.lightmap,Ne.emissivemap,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.roughnessmap,Ne.metalnessmap,Ne.fog,Ne.lights,{emissive:{value:new st(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:yt.meshphysical_vert,fragmentShader:yt.meshphysical_frag},toon:{uniforms:_n([Ne.common,Ne.aomap,Ne.lightmap,Ne.emissivemap,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.gradientmap,Ne.fog,Ne.lights,{emissive:{value:new st(0)}}]),vertexShader:yt.meshtoon_vert,fragmentShader:yt.meshtoon_frag},matcap:{uniforms:_n([Ne.common,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.fog,{matcap:{value:null}}]),vertexShader:yt.meshmatcap_vert,fragmentShader:yt.meshmatcap_frag},points:{uniforms:_n([Ne.points,Ne.fog]),vertexShader:yt.points_vert,fragmentShader:yt.points_frag},dashed:{uniforms:_n([Ne.common,Ne.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:yt.linedashed_vert,fragmentShader:yt.linedashed_frag},depth:{uniforms:_n([Ne.common,Ne.displacementmap]),vertexShader:yt.depth_vert,fragmentShader:yt.depth_frag},normal:{uniforms:_n([Ne.common,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,{opacity:{value:1}}]),vertexShader:yt.meshnormal_vert,fragmentShader:yt.meshnormal_frag},sprite:{uniforms:_n([Ne.sprite,Ne.fog]),vertexShader:yt.sprite_vert,fragmentShader:yt.sprite_frag},background:{uniforms:{uvTransform:{value:new _t},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:yt.background_vert,fragmentShader:yt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new _t}},vertexShader:yt.backgroundCube_vert,fragmentShader:yt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:yt.cube_vert,fragmentShader:yt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:yt.equirect_vert,fragmentShader:yt.equirect_frag},distanceRGBA:{uniforms:_n([Ne.common,Ne.displacementmap,{referencePosition:{value:new F},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:yt.distanceRGBA_vert,fragmentShader:yt.distanceRGBA_frag},shadow:{uniforms:_n([Ne.lights,Ne.fog,{color:{value:new st(0)},opacity:{value:1}}]),vertexShader:yt.shadow_vert,fragmentShader:yt.shadow_frag}};Sn.physical={uniforms:_n([Sn.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new _t},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new _t},clearcoatNormalScale:{value:new Ge(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 st(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 Ge},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new _t},attenuationDistance:{value:0},attenuationColor:{value:new st(0)},specularColor:{value:new st(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new _t},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new _t},anisotropyVector:{value:new Ge},anisotropyMap:{value:null},anisotropyMapTransform:{value:new _t}}]),vertexShader:yt.meshphysical_vert,fragmentShader:yt.meshphysical_frag};const qs={r:0,b:0,g:0},Fi=new yn,i2=new lt;function r2(r,e,t,n,i,s,a){const o=new st(0);let l=s===!0?0:1,c,h,u=null,d=0,f=null;function m(E){let v=E.isScene===!0?E.background:null;return v&&v.isTexture&&(v=(E.backgroundBlurriness>0?t:e).get(v)),v}function _(E){let v=!1;const N=m(E);N===null?p(o,l):N&&N.isColor&&(p(N,1),v=!0);const C=r.xr.getEnvironmentBlendMode();C==="additive"?n.buffers.color.setClear(0,0,0,1,a):C==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,a),(r.autoClear||v)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil))}function g(E,v){const N=m(v);N&&(N.isCubeTexture||N.mapping===Ea)?(h===void 0&&(h=new Ct(new Ki(1,1,1),new pi({name:"BackgroundCubeMaterial",uniforms:Ir(Sn.backgroundCube.uniforms),vertexShader:Sn.backgroundCube.vertexShader,fragmentShader:Sn.backgroundCube.fragmentShader,side:vn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(C,T,L){this.matrixWorld.copyPosition(L.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(h)),Fi.copy(v.backgroundRotation),Fi.x*=-1,Fi.y*=-1,Fi.z*=-1,N.isCubeTexture&&N.isRenderTargetTexture===!1&&(Fi.y*=-1,Fi.z*=-1),h.material.uniforms.envMap.value=N,h.material.uniforms.flipEnvMap.value=N.isCubeTexture&&N.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=v.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(i2.makeRotationFromEuler(Fi)),h.material.toneMapped=xt.getTransfer(N.colorSpace)!==Nt,(u!==N||d!==N.version||f!==r.toneMapping)&&(h.material.needsUpdate=!0,u=N,d=N.version,f=r.toneMapping),h.layers.enableAll(),E.unshift(h,h.geometry,h.material,0,0,null)):N&&N.isTexture&&(c===void 0&&(c=new Ct(new us(2,2),new pi({name:"BackgroundMaterial",uniforms:Ir(Sn.background.uniforms),vertexShader:Sn.background.vertexShader,fragmentShader:Sn.background.fragmentShader,side:Hn,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=N,c.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,c.material.toneMapped=xt.getTransfer(N.colorSpace)!==Nt,N.matrixAutoUpdate===!0&&N.updateMatrix(),c.material.uniforms.uvTransform.value.copy(N.matrix),(u!==N||d!==N.version||f!==r.toneMapping)&&(c.material.needsUpdate=!0,u=N,d=N.version,f=r.toneMapping),c.layers.enableAll(),E.unshift(c,c.geometry,c.material,0,0,null))}function p(E,v){E.getRGB(qs,Eu(r)),n.buffers.color.setClear(qs.r,qs.g,qs.b,v,a)}function S(){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,v=1){o.set(E),l=v,p(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(E){l=E,p(o,l)},render:_,addToRenderList:g,dispose:S}}function s2(r,e){const t=r.getParameter(r.MAX_VERTEX_ATTRIBS),n={},i=d(null);let s=i,a=!1;function o(x,R,B,V,W){let ee=!1;const k=u(V,B,R);s!==k&&(s=k,c(s.object)),ee=f(x,V,B,W),ee&&m(x,V,B,W),W!==null&&e.update(W,r.ELEMENT_ARRAY_BUFFER),(ee||a)&&(a=!1,v(x,R,B,V),W!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,e.get(W).buffer))}function l(){return r.createVertexArray()}function c(x){return r.bindVertexArray(x)}function h(x){return r.deleteVertexArray(x)}function u(x,R,B){const V=B.wireframe===!0;let W=n[x.id];W===void 0&&(W={},n[x.id]=W);let ee=W[R.id];ee===void 0&&(ee={},W[R.id]=ee);let k=ee[V];return k===void 0&&(k=d(l()),ee[V]=k),k}function d(x){const R=[],B=[],V=[];for(let W=0;W<t;W++)R[W]=0,B[W]=0,V[W]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:R,enabledAttributes:B,attributeDivisors:V,object:x,attributes:{},index:null}}function f(x,R,B,V){const W=s.attributes,ee=R.attributes;let k=0;const Q=B.getAttributes();for(const q in Q)if(Q[q].location>=0){const ye=W[q];let le=ee[q];if(le===void 0&&(q==="instanceMatrix"&&x.instanceMatrix&&(le=x.instanceMatrix),q==="instanceColor"&&x.instanceColor&&(le=x.instanceColor)),ye===void 0||ye.attribute!==le||le&&ye.data!==le.data)return!0;k++}return s.attributesNum!==k||s.index!==V}function m(x,R,B,V){const W={},ee=R.attributes;let k=0;const Q=B.getAttributes();for(const q in Q)if(Q[q].location>=0){let ye=ee[q];ye===void 0&&(q==="instanceMatrix"&&x.instanceMatrix&&(ye=x.instanceMatrix),q==="instanceColor"&&x.instanceColor&&(ye=x.instanceColor));const le={};le.attribute=ye,ye&&ye.data&&(le.data=ye.data),W[q]=le,k++}s.attributes=W,s.attributesNum=k,s.index=V}function _(){const x=s.newAttributes;for(let R=0,B=x.length;R<B;R++)x[R]=0}function g(x){p(x,0)}function p(x,R){const B=s.newAttributes,V=s.enabledAttributes,W=s.attributeDivisors;B[x]=1,V[x]===0&&(r.enableVertexAttribArray(x),V[x]=1),W[x]!==R&&(r.vertexAttribDivisor(x,R),W[x]=R)}function S(){const x=s.newAttributes,R=s.enabledAttributes;for(let B=0,V=R.length;B<V;B++)R[B]!==x[B]&&(r.disableVertexAttribArray(B),R[B]=0)}function E(x,R,B,V,W,ee,k){k===!0?r.vertexAttribIPointer(x,R,B,W,ee):r.vertexAttribPointer(x,R,B,V,W,ee)}function v(x,R,B,V){_();const W=V.attributes,ee=B.getAttributes(),k=R.defaultAttributeValues;for(const Q in ee){const q=ee[Q];if(q.location>=0){let de=W[Q];if(de===void 0&&(Q==="instanceMatrix"&&x.instanceMatrix&&(de=x.instanceMatrix),Q==="instanceColor"&&x.instanceColor&&(de=x.instanceColor)),de!==void 0){const ye=de.normalized,le=de.itemSize,Pe=e.get(de);if(Pe===void 0)continue;const Te=Pe.buffer,Y=Pe.type,re=Pe.bytesPerElement,ae=Y===r.INT||Y===r.UNSIGNED_INT||de.gpuType===Tl;if(de.isInterleavedBufferAttribute){const oe=de.data,Ee=oe.stride,_e=de.offset;if(oe.isInstancedInterleavedBuffer){for(let we=0;we<q.locationSize;we++)p(q.location+we,oe.meshPerAttribute);x.isInstancedMesh!==!0&&V._maxInstanceCount===void 0&&(V._maxInstanceCount=oe.meshPerAttribute*oe.count)}else for(let we=0;we<q.locationSize;we++)g(q.location+we);r.bindBuffer(r.ARRAY_BUFFER,Te);for(let we=0;we<q.locationSize;we++)E(q.location+we,le/q.locationSize,Y,ye,Ee*re,(_e+le/q.locationSize*we)*re,ae)}else{if(de.isInstancedBufferAttribute){for(let oe=0;oe<q.locationSize;oe++)p(q.location+oe,de.meshPerAttribute);x.isInstancedMesh!==!0&&V._maxInstanceCount===void 0&&(V._maxInstanceCount=de.meshPerAttribute*de.count)}else for(let oe=0;oe<q.locationSize;oe++)g(q.location+oe);r.bindBuffer(r.ARRAY_BUFFER,Te);for(let oe=0;oe<q.locationSize;oe++)E(q.location+oe,le/q.locationSize,Y,ye,le*re,le/q.locationSize*oe*re,ae)}}else if(k!==void 0){const ye=k[Q];if(ye!==void 0)switch(ye.length){case 2:r.vertexAttrib2fv(q.location,ye);break;case 3:r.vertexAttrib3fv(q.location,ye);break;case 4:r.vertexAttrib4fv(q.location,ye);break;default:r.vertexAttrib1fv(q.location,ye)}}}}S()}function N(){L();for(const x in n){const R=n[x];for(const B in R){const V=R[B];for(const W in V)h(V[W].object),delete V[W];delete R[B]}delete n[x]}}function C(x){if(n[x.id]===void 0)return;const R=n[x.id];for(const B in R){const V=R[B];for(const W in V)h(V[W].object),delete V[W];delete R[B]}delete n[x.id]}function T(x){for(const R in n){const B=n[R];if(B[x.id]===void 0)continue;const V=B[x.id];for(const W in V)h(V[W].object),delete V[W];delete B[x.id]}}function L(){b(),a=!0,s!==i&&(s=i,c(s.object))}function b(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:o,reset:L,resetDefaultState:b,dispose:N,releaseStatesOfGeometry:C,releaseStatesOfProgram:T,initAttributes:_,enableAttribute:g,disableUnusedAttributes:S}}function a2(r,e,t){let n;function i(c){n=c}function s(c,h){r.drawArrays(n,c,h),t.update(h,n,1)}function a(c,h,u){u!==0&&(r.drawArraysInstanced(n,c,h,u),t.update(h,n,u))}function o(c,h,u){if(u===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(n,c,0,h,0,u);let f=0;for(let m=0;m<u;m++)f+=h[m];t.update(f,n,1)}function l(c,h,u,d){if(u===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],d[m]);else{f.multiDrawArraysInstancedWEBGL(n,c,0,h,0,d,0,u);let m=0;for(let _=0;_<u;_++)m+=h[_]*d[_];t.update(m,n,1)}}this.setMode=i,this.render=s,this.renderInstances=a,this.renderMultiDraw=o,this.renderMultiDrawInstances=l}function o2(r,e,t,n){let i;function s(){if(i!==void 0)return i;if(e.has("EXT_texture_filter_anisotropic")===!0){const T=e.get("EXT_texture_filter_anisotropic");i=r.getParameter(T.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function a(T){return!(T!==Un&&n.convert(T)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_FORMAT))}function o(T){const L=T===hs&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(T!==Qn&&n.convert(T)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_TYPE)&&T!==Kn&&!L)}function l(T){if(T==="highp"){if(r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";T="mediump"}return T==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.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 u=t.logarithmicDepthBuffer===!0,d=t.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),f=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),m=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),_=r.getParameter(r.MAX_TEXTURE_SIZE),g=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),p=r.getParameter(r.MAX_VERTEX_ATTRIBS),S=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),E=r.getParameter(r.MAX_VARYING_VECTORS),v=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),N=m>0,C=r.getParameter(r.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:a,textureTypeReadable:o,precision:c,logarithmicDepthBuffer:u,reverseDepthBuffer:d,maxTextures:f,maxVertexTextures:m,maxTextureSize:_,maxCubemapSize:g,maxAttributes:p,maxVertexUniforms:S,maxVaryings:E,maxFragmentUniforms:v,vertexTextures:N,maxSamples:C}}function l2(r){const e=this;let t=null,n=0,i=!1,s=!1;const a=new Ei,o=new _t,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(u,d){const f=u.length!==0||d||n!==0||i;return i=d,n=u.length,f},this.beginShadows=function(){s=!0,h(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(u,d){t=h(u,d,0)},this.setState=function(u,d,f){const m=u.clippingPlanes,_=u.clipIntersection,g=u.clipShadows,p=r.get(u);if(!i||m===null||m.length===0||s&&!g)s?h(null):c();else{const S=s?0:n,E=S*4;let v=p.clippingState||null;l.value=v,v=h(m,d,E,f);for(let N=0;N!==E;++N)v[N]=t[N];p.clippingState=v,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=S}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function h(u,d,f,m){const _=u!==null?u.length:0;let g=null;if(_!==0){if(g=l.value,m!==!0||g===null){const p=f+_*4,S=d.matrixWorldInverse;o.getNormalMatrix(S),(g===null||g.length<p)&&(g=new Float32Array(p));for(let E=0,v=f;E!==_;++E,v+=4)a.copy(u[E]).applyMatrix4(S,o),a.normal.toArray(g,v),g[v+3]=a.constant}l.value=g,l.needsUpdate=!0}return e.numPlanes=_,e.numIntersection=0,g}}function c2(r){let e=new WeakMap;function t(a,o){return o===Fo?a.mapping=Rr:o===Oo&&(a.mapping=Dr),a}function n(a){if(a&&a.isTexture){const o=a.mapping;if(o===Fo||o===Oo)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 bp(l.height);return c.fromEquirectangularTexture(r,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 s(){e=new WeakMap}return{get:n,dispose:s}}const Er=4,sh=[.125,.215,.35,.446,.526,.582],Gi=20,fo=new Ra,ah=new st;let po=null,mo=0,go=0,_o=!1;const ki=(1+Math.sqrt(5))/2,Mr=1/ki,oh=[new F(-ki,Mr,0),new F(ki,Mr,0),new F(-Mr,0,ki),new F(Mr,0,ki),new F(0,ki,-Mr),new F(0,ki,Mr),new F(-1,1,-1),new F(1,1,-1),new F(-1,1,1),new F(1,1,1)],h2=new F;class lh{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,s={}){const{size:a=256,position:o=h2}=s;po=this._renderer.getRenderTarget(),mo=this._renderer.getActiveCubeFace(),go=this._renderer.getActiveMipmapLevel(),_o=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=uh(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=hh(),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(po,mo,go),this._renderer.xr.enabled=_o,e.scissorTest=!1,js(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===Rr||e.mapping===Dr?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),po=this._renderer.getRenderTarget(),mo=this._renderer.getActiveCubeFace(),go=this._renderer.getActiveMipmapLevel(),_o=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:Cn,minFilter:Cn,generateMipmaps:!1,type:hs,format:Un,colorSpace:Pr,depthBuffer:!1},i=ch(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=ch(e,t,n);const{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=u2(s)),this._blurMaterial=d2(s,e,t)}return i}_compileMaterial(e){const t=new Ct(this._lodPlanes[0],e);this._renderer.compile(t,fo)}_sceneToCubeUV(e,t,n,i,s){const l=new ln(90,1,t,n),c=[1,-1,1,1,1,1],h=[1,1,1,-1,-1,-1],u=this._renderer,d=u.autoClear,f=u.toneMapping;u.getClearColor(ah),u.toneMapping=Ti,u.autoClear=!1;const m=new Ri({name:"PMREM.Background",side:vn,depthWrite:!1,depthTest:!1}),_=new Ct(new Ki,m);let g=!1;const p=e.background;p?p.isColor&&(m.color.copy(p),e.background=null,g=!0):(m.color.copy(ah),g=!0);for(let S=0;S<6;S++){const E=S%3;E===0?(l.up.set(0,c[S],0),l.position.set(s.x,s.y,s.z),l.lookAt(s.x+h[S],s.y,s.z)):E===1?(l.up.set(0,0,c[S]),l.position.set(s.x,s.y,s.z),l.lookAt(s.x,s.y+h[S],s.z)):(l.up.set(0,c[S],0),l.position.set(s.x,s.y,s.z),l.lookAt(s.x,s.y,s.z+h[S]));const v=this._cubeSize;js(i,E*v,S>2?v:0,v,v),u.setRenderTarget(i),g&&u.render(_,l),u.render(e,l)}_.geometry.dispose(),_.material.dispose(),u.toneMapping=f,u.autoClear=d,e.background=p}_textureToCubeUV(e,t){const n=this._renderer,i=e.mapping===Rr||e.mapping===Dr;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=uh()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=hh());const s=i?this._cubemapMaterial:this._equirectMaterial,a=new Ct(this._lodPlanes[0],s),o=s.uniforms;o.envMap.value=e;const l=this._cubeSize;js(t,0,0,3*l,2*l),n.setRenderTarget(t),n.render(a,fo)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;const i=this._lodPlanes.length;for(let s=1;s<i;s++){const a=Math.sqrt(this._sigmas[s]*this._sigmas[s]-this._sigmas[s-1]*this._sigmas[s-1]),o=oh[(i-s-1)%oh.length];this._blur(e,s-1,s,a,o)}t.autoClear=n}_blur(e,t,n,i,s){const a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,i,"latitudinal",s),this._halfBlur(a,e,n,n,i,"longitudinal",s)}_halfBlur(e,t,n,i,s,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,u=new Ct(this._lodPlanes[i],c),d=c.uniforms,f=this._sizeLods[n]-1,m=isFinite(s)?Math.PI/(2*f):2*Math.PI/(2*Gi-1),_=s/m,g=isFinite(s)?1+Math.floor(h*_):Gi;g>Gi&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${g} samples when the maximum is set to ${Gi}`);const p=[];let S=0;for(let T=0;T<Gi;++T){const L=T/_,b=Math.exp(-L*L/2);p.push(b),T===0?S+=b:T<g&&(S+=2*b)}for(let T=0;T<p.length;T++)p[T]=p[T]/S;d.envMap.value=e.texture,d.samples.value=g,d.weights.value=p,d.latitudinal.value=a==="latitudinal",o&&(d.poleAxis.value=o);const{_lodMax:E}=this;d.dTheta.value=m,d.mipInt.value=E-n;const v=this._sizeLods[i],N=3*v*(i>E-Er?i-E+Er:0),C=4*(this._cubeSize-v);js(t,N,C,3*v,2*v),l.setRenderTarget(t),l.render(u,fo)}}function u2(r){const e=[],t=[],n=[];let i=r;const s=r-Er+1+sh.length;for(let a=0;a<s;a++){const o=Math.pow(2,i);t.push(o);let l=1/o;a>r-Er?l=sh[a-r+Er-1]:a===0&&(l=0),n.push(l);const c=1/(o-2),h=-c,u=1+c,d=[h,h,u,h,u,u,h,h,u,u,h,u],f=6,m=6,_=3,g=2,p=1,S=new Float32Array(_*m*f),E=new Float32Array(g*m*f),v=new Float32Array(p*m*f);for(let C=0;C<f;C++){const T=C%3*2/3-1,L=C>2?0:-1,b=[T,L,0,T+2/3,L,0,T+2/3,L+1,0,T,L,0,T+2/3,L+1,0,T,L+1,0];S.set(b,_*m*C),E.set(d,g*m*C);const x=[C,C,C,C,C,C];v.set(x,p*m*C)}const N=new Bt;N.setAttribute("position",new Gt(S,_)),N.setAttribute("uv",new Gt(E,g)),N.setAttribute("faceIndex",new Gt(v,p)),e.push(N),i>Er&&i--}return{lodPlanes:e,sizeLods:t,sigmas:n}}function ch(r,e,t){const n=new ji(r,e,t);return n.texture.mapping=Ea,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function js(r,e,t,n,i){r.viewport.set(e,t,n,i),r.scissor.set(e,t,n,i)}function d2(r,e,t){const n=new Float32Array(Gi),i=new F(0,1,0);return new pi({name:"SphericalGaussianBlur",defines:{n:Gi,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:$l(),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 f2(r){let e=new WeakMap,t=null;function n(o){if(o&&o.isTexture){const l=o.mapping,c=l===Uo||l===Fo,h=l===Rr||l===Dr;if(c||h){let u=e.get(o);const d=u!==void 0?u.texture.pmremVersion:0;if(o.isRenderTargetTexture&&o.pmremVersion!==d)return t===null&&(t=new lh(r)),u=c?t.fromEquirectangular(o,u):t.fromCubemap(o,u),u.texture.pmremVersion=o.pmremVersion,e.set(o,u),u.texture;if(u!==void 0)return u.texture;{const f=o.image;return c&&f&&f.height>0||h&&f&&i(f)?(t===null&&(t=new lh(r)),u=c?t.fromEquirectangular(o):t.fromCubemap(o),u.texture.pmremVersion=o.pmremVersion,e.set(o,u),o.addEventListener("dispose",s),u.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 s(o){const l=o.target;l.removeEventListener("dispose",s);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 p2(r){const e={};function t(n){if(e[n]!==void 0)return e[n];let i;switch(n){case"WEBGL_depth_texture":i=r.getExtension("WEBGL_depth_texture")||r.getExtension("MOZ_WEBGL_depth_texture")||r.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=r.getExtension("EXT_texture_filter_anisotropic")||r.getExtension("MOZ_EXT_texture_filter_anisotropic")||r.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=r.getExtension("WEBGL_compressed_texture_s3tc")||r.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=r.getExtension("WEBGL_compressed_texture_pvrtc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=r.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&&wr("THREE.WebGLRenderer: "+n+" extension not supported."),i}}}function m2(r,e,t,n){const i={},s=new WeakMap;function a(u){const d=u.target;d.index!==null&&e.remove(d.index);for(const m in d.attributes)e.remove(d.attributes[m]);d.removeEventListener("dispose",a),delete i[d.id];const f=s.get(d);f&&(e.remove(f),s.delete(d)),n.releaseStatesOfGeometry(d),d.isInstancedBufferGeometry===!0&&delete d._maxInstanceCount,t.memory.geometries--}function o(u,d){return i[d.id]===!0||(d.addEventListener("dispose",a),i[d.id]=!0,t.memory.geometries++),d}function l(u){const d=u.attributes;for(const f in d)e.update(d[f],r.ARRAY_BUFFER)}function c(u){const d=[],f=u.index,m=u.attributes.position;let _=0;if(f!==null){const S=f.array;_=f.version;for(let E=0,v=S.length;E<v;E+=3){const N=S[E+0],C=S[E+1],T=S[E+2];d.push(N,C,C,T,T,N)}}else if(m!==void 0){const S=m.array;_=m.version;for(let E=0,v=S.length/3-1;E<v;E+=3){const N=E+0,C=E+1,T=E+2;d.push(N,C,C,T,T,N)}}else return;const g=new(yu(d)?Su:bu)(d,1);g.version=_;const p=s.get(u);p&&e.remove(p),s.set(u,g)}function h(u){const d=s.get(u);if(d){const f=u.index;f!==null&&d.version<f.version&&c(u)}else c(u);return s.get(u)}return{get:o,update:l,getWireframeAttribute:h}}function g2(r,e,t){let n;function i(d){n=d}let s,a;function o(d){s=d.type,a=d.bytesPerElement}function l(d,f){r.drawElements(n,f,s,d*a),t.update(f,n,1)}function c(d,f,m){m!==0&&(r.drawElementsInstanced(n,f,s,d*a,m),t.update(f,n,m))}function h(d,f,m){if(m===0)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(n,f,0,s,d,0,m);let g=0;for(let p=0;p<m;p++)g+=f[p];t.update(g,n,1)}function u(d,f,m,_){if(m===0)return;const g=e.get("WEBGL_multi_draw");if(g===null)for(let p=0;p<d.length;p++)c(d[p]/a,f[p],_[p]);else{g.multiDrawElementsInstancedWEBGL(n,f,0,s,d,0,_,0,m);let p=0;for(let S=0;S<m;S++)p+=f[S]*_[S];t.update(p,n,1)}}this.setMode=i,this.setIndex=o,this.render=l,this.renderInstances=c,this.renderMultiDraw=h,this.renderMultiDrawInstances=u}function _2(r){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function n(s,a,o){switch(t.calls++,a){case r.TRIANGLES:t.triangles+=o*(s/3);break;case r.LINES:t.lines+=o*(s/2);break;case r.LINE_STRIP:t.lines+=o*(s-1);break;case r.LINE_LOOP:t.lines+=o*s;break;case r.POINTS:t.points+=o*s;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 v2(r,e,t){const n=new WeakMap,i=new Mt;function s(a,o,l){const c=a.morphTargetInfluences,h=o.morphAttributes.position||o.morphAttributes.normal||o.morphAttributes.color,u=h!==void 0?h.length:0;let d=n.get(o);if(d===void 0||d.count!==u){let b=function(){T.dispose(),n.delete(o),o.removeEventListener("dispose",b)};d!==void 0&&d.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||[],S=o.morphAttributes.color||[];let E=0;f===!0&&(E=1),m===!0&&(E=2),_===!0&&(E=3);let v=o.attributes.position.count*E,N=1;v>e.maxTextureSize&&(N=Math.ceil(v/e.maxTextureSize),v=e.maxTextureSize);const C=new Float32Array(v*N*4*u),T=new xu(C,v,N,u);T.type=Jn,T.needsUpdate=!0;const P=E*4;for(let x=0;x<u;x++){const R=g[x],B=p[x],V=S[x],W=v*N*4*x;for(let ee=0;ee<R.count;ee++){const k=ee*P;f===!0&&(i.fromBufferAttribute(R,ee),C[W+k+0]=i.x,C[W+k+1]=i.y,C[W+k+2]=i.z,C[W+k+3]=0),m===!0&&(i.fromBufferAttribute(B,ee),C[W+k+4]=i.x,C[W+k+5]=i.y,C[W+k+6]=i.z,C[W+k+7]=0),_===!0&&(i.fromBufferAttribute(V,ee),C[W+k+8]=i.x,C[W+k+9]=i.y,C[W+k+10]=i.z,C[W+k+11]=V.itemSize===4?i.w:1)}}d={count:u,texture:T,size:new Ge(v,N)},n.set(o,d),o.addEventListener("dispose",b)}if(a.isInstancedMesh===!0&&a.morphTexture!==null)l.getUniforms().setValue(r,"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(r,"morphTargetBaseInfluence",m),l.getUniforms().setValue(r,"morphTargetInfluences",c)}l.getUniforms().setValue(r,"morphTargetsTexture",d.texture,t),l.getUniforms().setValue(r,"morphTargetsTextureSize",d.size)}return{update:s}}function y2(r,e,t,n){let i=new WeakMap;function s(l){const c=n.render.frame,h=l.geometry,u=e.get(l,h);if(i.get(u)!==c&&(e.update(u),i.set(u,c)),l.isInstancedMesh&&(l.hasEventListener("dispose",o)===!1&&l.addEventListener("dispose",o),i.get(l)!==c&&(t.update(l.instanceMatrix,r.ARRAY_BUFFER),l.instanceColor!==null&&t.update(l.instanceColor,r.ARRAY_BUFFER),i.set(l,c))),l.isSkinnedMesh){const d=l.skeleton;i.get(d)!==c&&(d.update(),i.set(d,c))}return u}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:s,dispose:a}}const Hu=new cn,dh=new Lu(1,1),Gu=new xu,Wu=new sp,Xu=new wu,fh=[],ph=[],mh=new Float32Array(16),gh=new Float32Array(9),_h=new Float32Array(4);function Br(r,e,t){const n=r[0];if(n<=0||n>0)return r;const i=e*t;let s=fh[i];if(s===void 0&&(s=new Float32Array(i),fh[i]=s),e!==0){n.toArray(s,0);for(let a=1,o=0;a!==e;++a)o+=t,r[a].toArray(s,o)}return s}function Jt(r,e){if(r.length!==e.length)return!1;for(let t=0,n=r.length;t<n;t++)if(r[t]!==e[t])return!1;return!0}function Kt(r,e){for(let t=0,n=e.length;t<n;t++)r[t]=e[t]}function Ra(r,e){let t=ph[e];t===void 0&&(t=new Int32Array(e),ph[e]=t);for(let n=0;n!==e;++n)t[n]=r.allocateTextureUnit();return t}function x2(r,e){const t=this.cache;t[0]!==e&&(r.uniform1f(this.addr,e),t[0]=e)}function M2(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(r.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Jt(t,e))return;r.uniform2fv(this.addr,e),Kt(t,e)}}function b2(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(r.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)&&(r.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(Jt(t,e))return;r.uniform3fv(this.addr,e),Kt(t,e)}}function S2(r,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)&&(r.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(Jt(t,e))return;r.uniform4fv(this.addr,e),Kt(t,e)}}function E2(r,e){const t=this.cache,n=e.elements;if(n===void 0){if(Jt(t,e))return;r.uniformMatrix2fv(this.addr,!1,e),Kt(t,e)}else{if(Jt(t,n))return;_h.set(n),r.uniformMatrix2fv(this.addr,!1,_h),Kt(t,n)}}function A2(r,e){const t=this.cache,n=e.elements;if(n===void 0){if(Jt(t,e))return;r.uniformMatrix3fv(this.addr,!1,e),Kt(t,e)}else{if(Jt(t,n))return;gh.set(n),r.uniformMatrix3fv(this.addr,!1,gh),Kt(t,n)}}function w2(r,e){const t=this.cache,n=e.elements;if(n===void 0){if(Jt(t,e))return;r.uniformMatrix4fv(this.addr,!1,e),Kt(t,e)}else{if(Jt(t,n))return;mh.set(n),r.uniformMatrix4fv(this.addr,!1,mh),Kt(t,n)}}function T2(r,e){const t=this.cache;t[0]!==e&&(r.uniform1i(this.addr,e),t[0]=e)}function C2(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(r.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Jt(t,e))return;r.uniform2iv(this.addr,e),Kt(t,e)}}function R2(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(r.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(Jt(t,e))return;r.uniform3iv(this.addr,e),Kt(t,e)}}function D2(r,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)&&(r.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(Jt(t,e))return;r.uniform4iv(this.addr,e),Kt(t,e)}}function L2(r,e){const t=this.cache;t[0]!==e&&(r.uniform1ui(this.addr,e),t[0]=e)}function P2(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(r.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Jt(t,e))return;r.uniform2uiv(this.addr,e),Kt(t,e)}}function I2(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(r.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(Jt(t,e))return;r.uniform3uiv(this.addr,e),Kt(t,e)}}function N2(r,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)&&(r.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(Jt(t,e))return;r.uniform4uiv(this.addr,e),Kt(t,e)}}function U2(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i);let s;this.type===r.SAMPLER_2D_SHADOW?(dh.compareFunction=vu,s=dh):s=Hu,t.setTexture2D(e||s,i)}function F2(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.setTexture3D(e||Wu,i)}function O2(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.setTextureCube(e||Xu,i)}function z2(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.setTexture2DArray(e||Gu,i)}function B2(r){switch(r){case 5126:return x2;case 35664:return M2;case 35665:return b2;case 35666:return S2;case 35674:return E2;case 35675:return A2;case 35676:return w2;case 5124:case 35670:return T2;case 35667:case 35671:return C2;case 35668:case 35672:return R2;case 35669:case 35673:return D2;case 5125:return L2;case 36294:return P2;case 36295:return I2;case 36296:return N2;case 35678:case 36198:case 36298:case 36306:case 35682:return U2;case 35679:case 36299:case 36307:return F2;case 35680:case 36300:case 36308:case 36293:return O2;case 36289:case 36303:case 36311:case 36292:return z2}}function k2(r,e){r.uniform1fv(this.addr,e)}function V2(r,e){const t=Br(e,this.size,2);r.uniform2fv(this.addr,t)}function H2(r,e){const t=Br(e,this.size,3);r.uniform3fv(this.addr,t)}function G2(r,e){const t=Br(e,this.size,4);r.uniform4fv(this.addr,t)}function W2(r,e){const t=Br(e,this.size,4);r.uniformMatrix2fv(this.addr,!1,t)}function X2(r,e){const t=Br(e,this.size,9);r.uniformMatrix3fv(this.addr,!1,t)}function q2(r,e){const t=Br(e,this.size,16);r.uniformMatrix4fv(this.addr,!1,t)}function j2(r,e){r.uniform1iv(this.addr,e)}function Y2(r,e){r.uniform2iv(this.addr,e)}function $2(r,e){r.uniform3iv(this.addr,e)}function J2(r,e){r.uniform4iv(this.addr,e)}function K2(r,e){r.uniform1uiv(this.addr,e)}function Z2(r,e){r.uniform2uiv(this.addr,e)}function Q2(r,e){r.uniform3uiv(this.addr,e)}function eg(r,e){r.uniform4uiv(this.addr,e)}function tg(r,e,t){const n=this.cache,i=e.length,s=Ra(t,i);Jt(n,s)||(r.uniform1iv(this.addr,s),Kt(n,s));for(let a=0;a!==i;++a)t.setTexture2D(e[a]||Hu,s[a])}function ng(r,e,t){const n=this.cache,i=e.length,s=Ra(t,i);Jt(n,s)||(r.uniform1iv(this.addr,s),Kt(n,s));for(let a=0;a!==i;++a)t.setTexture3D(e[a]||Wu,s[a])}function ig(r,e,t){const n=this.cache,i=e.length,s=Ra(t,i);Jt(n,s)||(r.uniform1iv(this.addr,s),Kt(n,s));for(let a=0;a!==i;++a)t.setTextureCube(e[a]||Xu,s[a])}function rg(r,e,t){const n=this.cache,i=e.length,s=Ra(t,i);Jt(n,s)||(r.uniform1iv(this.addr,s),Kt(n,s));for(let a=0;a!==i;++a)t.setTexture2DArray(e[a]||Gu,s[a])}function sg(r){switch(r){case 5126:return k2;case 35664:return V2;case 35665:return H2;case 35666:return G2;case 35674:return W2;case 35675:return X2;case 35676:return q2;case 5124:case 35670:return j2;case 35667:case 35671:return Y2;case 35668:case 35672:return $2;case 35669:case 35673:return J2;case 5125:return K2;case 36294:return Z2;case 36295:return Q2;case 36296:return eg;case 35678:case 36198:case 36298:case 36306:case 35682:return tg;case 35679:case 36299:case 36307:return ng;case 35680:case 36300:case 36308:case 36293:return ig;case 36289:case 36303:case 36311:case 36292:return rg}}class ag{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=B2(t.type)}}class og{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=sg(t.type)}}class lg{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const i=this.seq;for(let s=0,a=i.length;s!==a;++s){const o=i[s];o.setValue(e,t[o.id],n)}}}const _o=/(\w+)(\])?(\[|\.)?/g;function vh(r,e){r.seq.push(e),r.map[e.id]=e}function cg(r,e,t){const n=r.name,i=n.length;for(_o.lastIndex=0;;){const s=_o.exec(n),a=_o.lastIndex;let o=s[1];const l=s[2]==="]",c=s[3];if(l&&(o=o|0),c===void 0||c==="["&&a+2===i){vh(t,c===void 0?new ag(o,r,e):new og(o,r,e));break}else{let u=t.map[o];u===void 0&&(u=new lg(o),vh(t,u)),t=u}}}class ca{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let i=0;i<n;++i){const s=e.getActiveUniform(t,i),a=e.getUniformLocation(t,s.name);cg(s,a,this)}}setValue(e,t,n,i){const s=this.map[t];s!==void 0&&s.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 s=0,a=t.length;s!==a;++s){const o=t[s],l=n[o.id];l.needsUpdate!==!1&&o.setValue(e,l.value,i)}}static seqWithValue(e,t){const n=[];for(let i=0,s=e.length;i!==s;++i){const a=e[i];a.id in t&&n.push(a)}return n}}function yh(r,e,t){const n=r.createShader(e);return r.shaderSource(n,t),r.compileShader(n),n}const hg=37297;let ug=0;function dg(r,e){const t=r.split(`
|
|
3724
|
+
`}function f2(r){let e=new WeakMap,t=null;function n(o){if(o&&o.isTexture){const l=o.mapping,c=l===Fo||l===Oo,h=l===Rr||l===Dr;if(c||h){let u=e.get(o);const d=u!==void 0?u.texture.pmremVersion:0;if(o.isRenderTargetTexture&&o.pmremVersion!==d)return t===null&&(t=new lh(r)),u=c?t.fromEquirectangular(o,u):t.fromCubemap(o,u),u.texture.pmremVersion=o.pmremVersion,e.set(o,u),u.texture;if(u!==void 0)return u.texture;{const f=o.image;return c&&f&&f.height>0||h&&f&&i(f)?(t===null&&(t=new lh(r)),u=c?t.fromEquirectangular(o):t.fromCubemap(o),u.texture.pmremVersion=o.pmremVersion,e.set(o,u),o.addEventListener("dispose",s),u.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 s(o){const l=o.target;l.removeEventListener("dispose",s);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 p2(r){const e={};function t(n){if(e[n]!==void 0)return e[n];let i;switch(n){case"WEBGL_depth_texture":i=r.getExtension("WEBGL_depth_texture")||r.getExtension("MOZ_WEBGL_depth_texture")||r.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=r.getExtension("EXT_texture_filter_anisotropic")||r.getExtension("MOZ_EXT_texture_filter_anisotropic")||r.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=r.getExtension("WEBGL_compressed_texture_s3tc")||r.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=r.getExtension("WEBGL_compressed_texture_pvrtc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=r.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&&wr("THREE.WebGLRenderer: "+n+" extension not supported."),i}}}function m2(r,e,t,n){const i={},s=new WeakMap;function a(u){const d=u.target;d.index!==null&&e.remove(d.index);for(const m in d.attributes)e.remove(d.attributes[m]);d.removeEventListener("dispose",a),delete i[d.id];const f=s.get(d);f&&(e.remove(f),s.delete(d)),n.releaseStatesOfGeometry(d),d.isInstancedBufferGeometry===!0&&delete d._maxInstanceCount,t.memory.geometries--}function o(u,d){return i[d.id]===!0||(d.addEventListener("dispose",a),i[d.id]=!0,t.memory.geometries++),d}function l(u){const d=u.attributes;for(const f in d)e.update(d[f],r.ARRAY_BUFFER)}function c(u){const d=[],f=u.index,m=u.attributes.position;let _=0;if(f!==null){const S=f.array;_=f.version;for(let E=0,v=S.length;E<v;E+=3){const N=S[E+0],C=S[E+1],T=S[E+2];d.push(N,C,C,T,T,N)}}else if(m!==void 0){const S=m.array;_=m.version;for(let E=0,v=S.length/3-1;E<v;E+=3){const N=E+0,C=E+1,T=E+2;d.push(N,C,C,T,T,N)}}else return;const g=new(yu(d)?Su:bu)(d,1);g.version=_;const p=s.get(u);p&&e.remove(p),s.set(u,g)}function h(u){const d=s.get(u);if(d){const f=u.index;f!==null&&d.version<f.version&&c(u)}else c(u);return s.get(u)}return{get:o,update:l,getWireframeAttribute:h}}function g2(r,e,t){let n;function i(d){n=d}let s,a;function o(d){s=d.type,a=d.bytesPerElement}function l(d,f){r.drawElements(n,f,s,d*a),t.update(f,n,1)}function c(d,f,m){m!==0&&(r.drawElementsInstanced(n,f,s,d*a,m),t.update(f,n,m))}function h(d,f,m){if(m===0)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(n,f,0,s,d,0,m);let g=0;for(let p=0;p<m;p++)g+=f[p];t.update(g,n,1)}function u(d,f,m,_){if(m===0)return;const g=e.get("WEBGL_multi_draw");if(g===null)for(let p=0;p<d.length;p++)c(d[p]/a,f[p],_[p]);else{g.multiDrawElementsInstancedWEBGL(n,f,0,s,d,0,_,0,m);let p=0;for(let S=0;S<m;S++)p+=f[S]*_[S];t.update(p,n,1)}}this.setMode=i,this.setIndex=o,this.render=l,this.renderInstances=c,this.renderMultiDraw=h,this.renderMultiDrawInstances=u}function _2(r){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function n(s,a,o){switch(t.calls++,a){case r.TRIANGLES:t.triangles+=o*(s/3);break;case r.LINES:t.lines+=o*(s/2);break;case r.LINE_STRIP:t.lines+=o*(s-1);break;case r.LINE_LOOP:t.lines+=o*s;break;case r.POINTS:t.points+=o*s;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 v2(r,e,t){const n=new WeakMap,i=new Mt;function s(a,o,l){const c=a.morphTargetInfluences,h=o.morphAttributes.position||o.morphAttributes.normal||o.morphAttributes.color,u=h!==void 0?h.length:0;let d=n.get(o);if(d===void 0||d.count!==u){let b=function(){T.dispose(),n.delete(o),o.removeEventListener("dispose",b)};d!==void 0&&d.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||[],S=o.morphAttributes.color||[];let E=0;f===!0&&(E=1),m===!0&&(E=2),_===!0&&(E=3);let v=o.attributes.position.count*E,N=1;v>e.maxTextureSize&&(N=Math.ceil(v/e.maxTextureSize),v=e.maxTextureSize);const C=new Float32Array(v*N*4*u),T=new xu(C,v,N,u);T.type=Kn,T.needsUpdate=!0;const L=E*4;for(let x=0;x<u;x++){const R=g[x],B=p[x],V=S[x],W=v*N*4*x;for(let ee=0;ee<R.count;ee++){const k=ee*L;f===!0&&(i.fromBufferAttribute(R,ee),C[W+k+0]=i.x,C[W+k+1]=i.y,C[W+k+2]=i.z,C[W+k+3]=0),m===!0&&(i.fromBufferAttribute(B,ee),C[W+k+4]=i.x,C[W+k+5]=i.y,C[W+k+6]=i.z,C[W+k+7]=0),_===!0&&(i.fromBufferAttribute(V,ee),C[W+k+8]=i.x,C[W+k+9]=i.y,C[W+k+10]=i.z,C[W+k+11]=V.itemSize===4?i.w:1)}}d={count:u,texture:T,size:new Ge(v,N)},n.set(o,d),o.addEventListener("dispose",b)}if(a.isInstancedMesh===!0&&a.morphTexture!==null)l.getUniforms().setValue(r,"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(r,"morphTargetBaseInfluence",m),l.getUniforms().setValue(r,"morphTargetInfluences",c)}l.getUniforms().setValue(r,"morphTargetsTexture",d.texture,t),l.getUniforms().setValue(r,"morphTargetsTextureSize",d.size)}return{update:s}}function y2(r,e,t,n){let i=new WeakMap;function s(l){const c=n.render.frame,h=l.geometry,u=e.get(l,h);if(i.get(u)!==c&&(e.update(u),i.set(u,c)),l.isInstancedMesh&&(l.hasEventListener("dispose",o)===!1&&l.addEventListener("dispose",o),i.get(l)!==c&&(t.update(l.instanceMatrix,r.ARRAY_BUFFER),l.instanceColor!==null&&t.update(l.instanceColor,r.ARRAY_BUFFER),i.set(l,c))),l.isSkinnedMesh){const d=l.skeleton;i.get(d)!==c&&(d.update(),i.set(d,c))}return u}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:s,dispose:a}}const Hu=new cn,dh=new Pu(1,1),Gu=new xu,Wu=new sp,Xu=new wu,fh=[],ph=[],mh=new Float32Array(16),gh=new Float32Array(9),_h=new Float32Array(4);function Br(r,e,t){const n=r[0];if(n<=0||n>0)return r;const i=e*t;let s=fh[i];if(s===void 0&&(s=new Float32Array(i),fh[i]=s),e!==0){n.toArray(s,0);for(let a=1,o=0;a!==e;++a)o+=t,r[a].toArray(s,o)}return s}function Kt(r,e){if(r.length!==e.length)return!1;for(let t=0,n=r.length;t<n;t++)if(r[t]!==e[t])return!1;return!0}function Jt(r,e){for(let t=0,n=e.length;t<n;t++)r[t]=e[t]}function Da(r,e){let t=ph[e];t===void 0&&(t=new Int32Array(e),ph[e]=t);for(let n=0;n!==e;++n)t[n]=r.allocateTextureUnit();return t}function x2(r,e){const t=this.cache;t[0]!==e&&(r.uniform1f(this.addr,e),t[0]=e)}function M2(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(r.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Kt(t,e))return;r.uniform2fv(this.addr,e),Jt(t,e)}}function b2(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(r.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)&&(r.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;r.uniform3fv(this.addr,e),Jt(t,e)}}function S2(r,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)&&(r.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;r.uniform4fv(this.addr,e),Jt(t,e)}}function E2(r,e){const t=this.cache,n=e.elements;if(n===void 0){if(Kt(t,e))return;r.uniformMatrix2fv(this.addr,!1,e),Jt(t,e)}else{if(Kt(t,n))return;_h.set(n),r.uniformMatrix2fv(this.addr,!1,_h),Jt(t,n)}}function A2(r,e){const t=this.cache,n=e.elements;if(n===void 0){if(Kt(t,e))return;r.uniformMatrix3fv(this.addr,!1,e),Jt(t,e)}else{if(Kt(t,n))return;gh.set(n),r.uniformMatrix3fv(this.addr,!1,gh),Jt(t,n)}}function w2(r,e){const t=this.cache,n=e.elements;if(n===void 0){if(Kt(t,e))return;r.uniformMatrix4fv(this.addr,!1,e),Jt(t,e)}else{if(Kt(t,n))return;mh.set(n),r.uniformMatrix4fv(this.addr,!1,mh),Jt(t,n)}}function T2(r,e){const t=this.cache;t[0]!==e&&(r.uniform1i(this.addr,e),t[0]=e)}function C2(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(r.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Kt(t,e))return;r.uniform2iv(this.addr,e),Jt(t,e)}}function R2(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(r.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;r.uniform3iv(this.addr,e),Jt(t,e)}}function D2(r,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)&&(r.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;r.uniform4iv(this.addr,e),Jt(t,e)}}function P2(r,e){const t=this.cache;t[0]!==e&&(r.uniform1ui(this.addr,e),t[0]=e)}function L2(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(r.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Kt(t,e))return;r.uniform2uiv(this.addr,e),Jt(t,e)}}function I2(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(r.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;r.uniform3uiv(this.addr,e),Jt(t,e)}}function N2(r,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)&&(r.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;r.uniform4uiv(this.addr,e),Jt(t,e)}}function U2(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i);let s;this.type===r.SAMPLER_2D_SHADOW?(dh.compareFunction=vu,s=dh):s=Hu,t.setTexture2D(e||s,i)}function F2(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.setTexture3D(e||Wu,i)}function O2(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.setTextureCube(e||Xu,i)}function z2(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.setTexture2DArray(e||Gu,i)}function B2(r){switch(r){case 5126:return x2;case 35664:return M2;case 35665:return b2;case 35666:return S2;case 35674:return E2;case 35675:return A2;case 35676:return w2;case 5124:case 35670:return T2;case 35667:case 35671:return C2;case 35668:case 35672:return R2;case 35669:case 35673:return D2;case 5125:return P2;case 36294:return L2;case 36295:return I2;case 36296:return N2;case 35678:case 36198:case 36298:case 36306:case 35682:return U2;case 35679:case 36299:case 36307:return F2;case 35680:case 36300:case 36308:case 36293:return O2;case 36289:case 36303:case 36311:case 36292:return z2}}function k2(r,e){r.uniform1fv(this.addr,e)}function V2(r,e){const t=Br(e,this.size,2);r.uniform2fv(this.addr,t)}function H2(r,e){const t=Br(e,this.size,3);r.uniform3fv(this.addr,t)}function G2(r,e){const t=Br(e,this.size,4);r.uniform4fv(this.addr,t)}function W2(r,e){const t=Br(e,this.size,4);r.uniformMatrix2fv(this.addr,!1,t)}function X2(r,e){const t=Br(e,this.size,9);r.uniformMatrix3fv(this.addr,!1,t)}function q2(r,e){const t=Br(e,this.size,16);r.uniformMatrix4fv(this.addr,!1,t)}function j2(r,e){r.uniform1iv(this.addr,e)}function Y2(r,e){r.uniform2iv(this.addr,e)}function $2(r,e){r.uniform3iv(this.addr,e)}function K2(r,e){r.uniform4iv(this.addr,e)}function J2(r,e){r.uniform1uiv(this.addr,e)}function Z2(r,e){r.uniform2uiv(this.addr,e)}function Q2(r,e){r.uniform3uiv(this.addr,e)}function eg(r,e){r.uniform4uiv(this.addr,e)}function tg(r,e,t){const n=this.cache,i=e.length,s=Da(t,i);Kt(n,s)||(r.uniform1iv(this.addr,s),Jt(n,s));for(let a=0;a!==i;++a)t.setTexture2D(e[a]||Hu,s[a])}function ng(r,e,t){const n=this.cache,i=e.length,s=Da(t,i);Kt(n,s)||(r.uniform1iv(this.addr,s),Jt(n,s));for(let a=0;a!==i;++a)t.setTexture3D(e[a]||Wu,s[a])}function ig(r,e,t){const n=this.cache,i=e.length,s=Da(t,i);Kt(n,s)||(r.uniform1iv(this.addr,s),Jt(n,s));for(let a=0;a!==i;++a)t.setTextureCube(e[a]||Xu,s[a])}function rg(r,e,t){const n=this.cache,i=e.length,s=Da(t,i);Kt(n,s)||(r.uniform1iv(this.addr,s),Jt(n,s));for(let a=0;a!==i;++a)t.setTexture2DArray(e[a]||Gu,s[a])}function sg(r){switch(r){case 5126:return k2;case 35664:return V2;case 35665:return H2;case 35666:return G2;case 35674:return W2;case 35675:return X2;case 35676:return q2;case 5124:case 35670:return j2;case 35667:case 35671:return Y2;case 35668:case 35672:return $2;case 35669:case 35673:return K2;case 5125:return J2;case 36294:return Z2;case 36295:return Q2;case 36296:return eg;case 35678:case 36198:case 36298:case 36306:case 35682:return tg;case 35679:case 36299:case 36307:return ng;case 35680:case 36300:case 36308:case 36293:return ig;case 36289:case 36303:case 36311:case 36292:return rg}}class ag{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=B2(t.type)}}class og{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=sg(t.type)}}class lg{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const i=this.seq;for(let s=0,a=i.length;s!==a;++s){const o=i[s];o.setValue(e,t[o.id],n)}}}const vo=/(\w+)(\])?(\[|\.)?/g;function vh(r,e){r.seq.push(e),r.map[e.id]=e}function cg(r,e,t){const n=r.name,i=n.length;for(vo.lastIndex=0;;){const s=vo.exec(n),a=vo.lastIndex;let o=s[1];const l=s[2]==="]",c=s[3];if(l&&(o=o|0),c===void 0||c==="["&&a+2===i){vh(t,c===void 0?new ag(o,r,e):new og(o,r,e));break}else{let u=t.map[o];u===void 0&&(u=new lg(o),vh(t,u)),t=u}}}class ca{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let i=0;i<n;++i){const s=e.getActiveUniform(t,i),a=e.getUniformLocation(t,s.name);cg(s,a,this)}}setValue(e,t,n,i){const s=this.map[t];s!==void 0&&s.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 s=0,a=t.length;s!==a;++s){const o=t[s],l=n[o.id];l.needsUpdate!==!1&&o.setValue(e,l.value,i)}}static seqWithValue(e,t){const n=[];for(let i=0,s=e.length;i!==s;++i){const a=e[i];a.id in t&&n.push(a)}return n}}function yh(r,e,t){const n=r.createShader(e);return r.shaderSource(n,t),r.compileShader(n),n}const hg=37297;let ug=0;function dg(r,e){const t=r.split(`
|
|
3725
3725
|
`),n=[],i=Math.max(e-6,0),s=Math.min(e+6,t.length);for(let a=i;a<s;a++){const o=a+1;n.push(`${o===e?">":" "} ${o}: ${t[a]}`)}return n.join(`
|
|
3726
3726
|
`)}const xh=new _t;function fg(r){xt._getMatrix(xh,xt.workingColorSpace,r);const e=`mat3( ${xh.elements.map(t=>t.toFixed(4))} )`;switch(xt.getTransfer(r)){case pa:return[e,"LinearTransferOETF"];case Nt:return[e,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",r),[e,"LinearTransferOETF"]}}function Mh(r,e,t){const n=r.getShaderParameter(e,r.COMPILE_STATUS),i=r.getShaderInfoLog(e).trim();if(n&&i==="")return"";const s=/ERROR: 0:(\d+)/.exec(i);if(s){const a=parseInt(s[1]);return t.toUpperCase()+`
|
|
3727
3727
|
|
|
@@ -3729,9 +3729,9 @@ void main() {
|
|
|
3729
3729
|
|
|
3730
3730
|
`+dg(r.getShaderSource(e),a)}else return i}function pg(r,e){const t=fg(e);return[`vec4 ${r}( vec4 value ) {`,` return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) );`,"}"].join(`
|
|
3731
3731
|
`)}function mg(r,e){let t;switch(e){case mf:t="Linear";break;case gf:t="Reinhard";break;case _f:t="Cineon";break;case lu:t="ACESFilmic";break;case yf:t="AgX";break;case xf:t="Neutral";break;case vf:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+r+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const Ys=new F;function gg(){xt.getLuminanceCoefficients(Ys);const r=Ys.x.toFixed(4),e=Ys.y.toFixed(4),t=Ys.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${r}, ${e}, ${t} );`," return dot( weights, rgb );","}"].join(`
|
|
3732
|
-
`)}function _g(r){return[r.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",r.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(
|
|
3732
|
+
`)}function _g(r){return[r.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",r.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Kr).join(`
|
|
3733
3733
|
`)}function vg(r){const e=[];for(const t in r){const n=r[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(`
|
|
3734
|
-
`)}function yg(r,e){const t={},n=r.getProgramParameter(e,r.ACTIVE_ATTRIBUTES);for(let i=0;i<n;i++){const s=r.getActiveAttrib(e,i),a=s.name;let o=1;s.type===r.FLOAT_MAT2&&(o=2),s.type===r.FLOAT_MAT3&&(o=3),s.type===r.FLOAT_MAT4&&(o=4),t[a]={type:s.type,location:r.getAttribLocation(e,a),locationSize:o}}return t}function
|
|
3734
|
+
`)}function yg(r,e){const t={},n=r.getProgramParameter(e,r.ACTIVE_ATTRIBUTES);for(let i=0;i<n;i++){const s=r.getActiveAttrib(e,i),a=s.name;let o=1;s.type===r.FLOAT_MAT2&&(o=2),s.type===r.FLOAT_MAT3&&(o=3),s.type===r.FLOAT_MAT4&&(o=4),t[a]={type:s.type,location:r.getAttribLocation(e,a),locationSize:o}}return t}function Kr(r){return r!==""}function bh(r,e){const t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return r.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,t).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function Sh(r,e){return r.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const xg=/^[ \t]*#include +<([\w\d./]+)>/gm;function gl(r){return r.replace(xg,bg)}const Mg=new Map;function bg(r,e){let t=yt[e];if(t===void 0){const n=Mg.get(e);if(n!==void 0)t=yt[n],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,n);else throw new Error("Can not resolve #include <"+e+">")}return gl(t)}const Sg=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Eh(r){return r.replace(Sg,Eg)}function Eg(r,e,t,n){let i="";for(let s=parseInt(e);s<parseInt(t);s++)i+=n.replace(/\[\s*i\s*\]/g,"[ "+s+" ]").replace(/UNROLLED_LOOP_INDEX/g,s);return i}function Ah(r){let e=`precision ${r.precision} float;
|
|
3735
3735
|
precision ${r.precision} int;
|
|
3736
3736
|
precision ${r.precision} sampler2D;
|
|
3737
3737
|
precision ${r.precision} samplerCube;
|
|
@@ -3751,16 +3751,16 @@ void main() {
|
|
|
3751
3751
|
`;return r.precision==="highp"?e+=`
|
|
3752
3752
|
#define HIGH_PRECISION`:r.precision==="mediump"?e+=`
|
|
3753
3753
|
#define MEDIUM_PRECISION`:r.precision==="lowp"&&(e+=`
|
|
3754
|
-
#define LOW_PRECISION`),e}function Ag(r){let e="SHADOWMAP_TYPE_BASIC";return r.shadowMapType===au?e="SHADOWMAP_TYPE_PCF":r.shadowMapType===ou?e="SHADOWMAP_TYPE_PCF_SOFT":r.shadowMapType===hi&&(e="SHADOWMAP_TYPE_VSM"),e}function wg(r){let e="ENVMAP_TYPE_CUBE";if(r.envMap)switch(r.envMapMode){case Rr:case Dr:e="ENVMAP_TYPE_CUBE";break;case
|
|
3755
|
-
`:"";t.isRawShaderMaterial?(g=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,m].filter(
|
|
3754
|
+
#define LOW_PRECISION`),e}function Ag(r){let e="SHADOWMAP_TYPE_BASIC";return r.shadowMapType===au?e="SHADOWMAP_TYPE_PCF":r.shadowMapType===ou?e="SHADOWMAP_TYPE_PCF_SOFT":r.shadowMapType===hi&&(e="SHADOWMAP_TYPE_VSM"),e}function wg(r){let e="ENVMAP_TYPE_CUBE";if(r.envMap)switch(r.envMapMode){case Rr:case Dr:e="ENVMAP_TYPE_CUBE";break;case Ea:e="ENVMAP_TYPE_CUBE_UV";break}return e}function Tg(r){let e="ENVMAP_MODE_REFLECTION";if(r.envMap)switch(r.envMapMode){case Dr:e="ENVMAP_MODE_REFRACTION";break}return e}function Cg(r){let e="ENVMAP_BLENDING_NONE";if(r.envMap)switch(r.combine){case Sa:e="ENVMAP_BLENDING_MULTIPLY";break;case ff:e="ENVMAP_BLENDING_MIX";break;case pf:e="ENVMAP_BLENDING_ADD";break}return e}function Rg(r){const e=r.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 Dg(r,e,t,n){const i=r.getContext(),s=t.defines;let a=t.vertexShader,o=t.fragmentShader;const l=Ag(t),c=wg(t),h=Tg(t),u=Cg(t),d=Rg(t),f=_g(t),m=vg(s),_=i.createProgram();let g,p,S=t.glslVersion?"#version "+t.glslVersion+`
|
|
3755
|
+
`:"";t.isRawShaderMaterial?(g=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,m].filter(Kr).join(`
|
|
3756
3756
|
`),g.length>0&&(g+=`
|
|
3757
|
-
`),p=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,m].filter(
|
|
3757
|
+
`),p=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,m].filter(Kr).join(`
|
|
3758
3758
|
`),p.length>0&&(p+=`
|
|
3759
3759
|
`)):(g=[Ah(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
|
-
`].filter(
|
|
3760
|
+
`].filter(Kr).join(`
|
|
3761
3761
|
`),p=[Ah(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 "+u:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.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!==Ti?"#define TONE_MAPPING":"",t.toneMapping!==Ti?yt.tonemapping_pars_fragment:"",t.toneMapping!==Ti?mg("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",yt.colorspace_pars_fragment,pg("linearToOutputTexel",t.outputColorSpace),gg(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",`
|
|
3762
|
-
`].filter(
|
|
3763
|
-
`)),a=
|
|
3762
|
+
`].filter(Kr).join(`
|
|
3763
|
+
`)),a=gl(a),a=bh(a,t),a=Sh(a,t),o=gl(o),o=bh(o,t),o=Sh(o,t),a=Eh(a),o=Eh(o),t.isRawShaderMaterial!==!0&&(S=`#version 300 es
|
|
3764
3764
|
`,g=[f,"#define attribute in","#define varying out","#define texture2D texture"].join(`
|
|
3765
3765
|
`)+`
|
|
3766
3766
|
`+g,p=["#define varying in",t.glslVersion===fc?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===fc?"":"#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(`
|
|
@@ -3772,7 +3772,7 @@ Material Type: `+R.type+`
|
|
|
3772
3772
|
|
|
3773
3773
|
Program Info Log: `+B+`
|
|
3774
3774
|
`+Q+`
|
|
3775
|
-
`+q)}else B!==""?console.warn("THREE.WebGLProgram: Program Info Log:",B):(V===""||W==="")&&(k=!1);k&&(R.diagnostics={runnable:ee,programLog:B,vertexShader:{log:V,prefix:g},fragmentShader:{log:W,prefix:p}})}i.deleteShader(N),i.deleteShader(C),P=new ca(i,_),b=yg(i,_)}let P;this.getUniforms=function(){return P===void 0&&T(this),P};let b;this.getAttributes=function(){return b===void 0&&T(this),b};let x=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return x===!1&&(x=i.getProgramParameter(_,hg)),x},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(_),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=ug++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=N,this.fragmentShader=C,this}let Lg=0;class Pg{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,i=this._getShaderStage(t),s=this._getShaderStage(n),a=this._getShaderCacheForMaterial(e);return a.has(i)===!1&&(a.add(i),i.usedTimes++),a.has(s)===!1&&(a.add(s),s.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 Ig(e),t.set(e,n)),n}}class Ig{constructor(e){this.id=Lg++,this.code=e,this.usedTimes=0}}function Ng(r,e,t,n,i,s,a){const o=new Ul,l=new Pg,c=new Set,h=[],u=i.logarithmicDepthBuffer,d=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,x,R,B,V){const W=B.fog,ee=V.geometry,k=b.isMeshStandardMaterial?B.environment:null,Q=(b.isMeshStandardMaterial?t:e).get(b.envMap||k),q=Q&&Q.mapping===Sa?Q.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 ye=ee.morphAttributes.position||ee.morphAttributes.normal||ee.morphAttributes.color,le=ye!==void 0?ye.length:0;let Le=0;ee.morphAttributes.position!==void 0&&(Le=1),ee.morphAttributes.normal!==void 0&&(Le=2),ee.morphAttributes.color!==void 0&&(Le=3);let Te,Y,re,ae;if(ue){const pt=Sn[ue];Te=pt.vertexShader,Y=pt.fragmentShader}else Te=b.vertexShader,Y=b.fragmentShader,l.update(b),re=l.getVertexShaderID(b),ae=l.getFragmentShaderID(b);const oe=r.getRenderTarget(),Ee=r.state.buffers.depth.getReversed(),_e=V.isInstancedMesh===!0,we=V.isBatchedMesh===!0,ke=!!b.map,tt=!!b.matcap,Qe=!!Q,O=!!b.aoMap,bt=!!b.lightMap,$=!!b.bumpMap,pe=!!b.normalMap,te=!!b.displacementMap,Se=!!b.emissiveMap,he=!!b.metalnessMap,ce=!!b.roughnessMap,Ue=b.anisotropy>0,U=b.clearcoat>0,A=b.dispersion>0,G=b.iridescence>0,z=b.sheen>0,se=b.transmission>0,ne=Ue&&!!b.anisotropyMap,Ce=U&&!!b.clearcoatMap,Ae=U&&!!b.clearcoatNormalMap,Be=U&&!!b.clearcoatRoughnessMap,Ve=G&&!!b.iridescenceMap,me=G&&!!b.iridescenceThicknessMap,De=z&&!!b.sheenColorMap,Je=z&&!!b.sheenRoughnessMap,nt=!!b.specularMap,Pe=!!b.specularColorMap,ct=!!b.specularIntensityMap,H=se&&!!b.transmissionMap,Fe=se&&!!b.thicknessMap,ve=!!b.gradientMap,He=!!b.alphaMap,Me=b.alphaTest>0,ge=!!b.alphaHash,qe=!!b.extensions;let ht=Ti;b.toneMapped&&(oe===null||oe.isXRRenderTarget===!0)&&(ht=r.toneMapping);const Dt={shaderID:ue,shaderType:b.type,shaderName:b.name,vertexShader:Te,fragmentShader:Y,defines:b.defines,customVertexShaderID:re,customFragmentShaderID:ae,isRawShaderMaterial:b.isRawShaderMaterial===!0,glslVersion:b.glslVersion,precision:f,batching:we,batchingColor:we&&V._colorsTexture!==null,instancing:_e,instancingColor:_e&&V.instanceColor!==null,instancingMorph:_e&&V.morphTexture!==null,supportsVertexTextures:d,outputColorSpace:oe===null?r.outputColorSpace:oe.isXRRenderTarget===!0?oe.texture.colorSpace:Lr,alphaToCoverage:!!b.alphaToCoverage,map:ke,matcap:tt,envMap:Qe,envMapMode:Qe&&Q.mapping,envMapCubeUVHeight:q,aoMap:O,lightMap:bt,bumpMap:$,normalMap:pe,displacementMap:d&&te,emissiveMap:Se,normalMapObjectSpace:pe&&b.normalMapType===wf,normalMapTangentSpace:pe&&b.normalMapType===Ea,metalnessMap:he,roughnessMap:ce,anisotropy:Ue,anisotropyMap:ne,clearcoat:U,clearcoatMap:Ce,clearcoatNormalMap:Ae,clearcoatRoughnessMap:Be,dispersion:A,iridescence:G,iridescenceMap:Ve,iridescenceThicknessMap:me,sheen:z,sheenColorMap:De,sheenRoughnessMap:Je,specularMap:nt,specularColorMap:Pe,specularIntensityMap:ct,transmission:se,transmissionMap:H,thicknessMap:Fe,gradientMap:ve,opaque:b.transparent===!1&&b.blending===Ar&&b.alphaToCoverage===!1,alphaMap:He,alphaTest:Me,alphaHash:ge,combine:b.combine,mapUv:ke&&_(b.map.channel),aoMapUv:O&&_(b.aoMap.channel),lightMapUv:bt&&_(b.lightMap.channel),bumpMapUv:$&&_(b.bumpMap.channel),normalMapUv:pe&&_(b.normalMap.channel),displacementMapUv:te&&_(b.displacementMap.channel),emissiveMapUv:Se&&_(b.emissiveMap.channel),metalnessMapUv:he&&_(b.metalnessMap.channel),roughnessMapUv:ce&&_(b.roughnessMap.channel),anisotropyMapUv:ne&&_(b.anisotropyMap.channel),clearcoatMapUv:Ce&&_(b.clearcoatMap.channel),clearcoatNormalMapUv:Ae&&_(b.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Be&&_(b.clearcoatRoughnessMap.channel),iridescenceMapUv:Ve&&_(b.iridescenceMap.channel),iridescenceThicknessMapUv:me&&_(b.iridescenceThicknessMap.channel),sheenColorMapUv:De&&_(b.sheenColorMap.channel),sheenRoughnessMapUv:Je&&_(b.sheenRoughnessMap.channel),specularMapUv:nt&&_(b.specularMap.channel),specularColorMapUv:Pe&&_(b.specularColorMap.channel),specularIntensityMapUv:ct&&_(b.specularIntensityMap.channel),transmissionMapUv:H&&_(b.transmissionMap.channel),thicknessMapUv:Fe&&_(b.thicknessMap.channel),alphaMapUv:He&&_(b.alphaMap.channel),vertexTangents:!!ee.attributes.tangent&&(pe||Ue),vertexColors:b.vertexColors,vertexAlphas:b.vertexColors===!0&&!!ee.attributes.color&&ee.attributes.color.itemSize===4,pointsUvs:V.isPoints===!0&&!!ee.attributes.uv&&(ke||He),fog:!!W,useFog:b.fog===!0,fogExp2:!!W&&W.isFogExp2,flatShading:b.flatShading===!0,sizeAttenuation:b.sizeAttenuation===!0,logarithmicDepthBuffer:u,reverseDepthBuffer:Ee,skinning:V.isSkinnedMesh===!0,morphTargets:ee.morphAttributes.position!==void 0,morphNormals:ee.morphAttributes.normal!==void 0,morphColors:ee.morphAttributes.color!==void 0,morphTargetsCount:le,morphTextureStride:Le,numDirLights:x.directional.length,numPointLights:x.point.length,numSpotLights:x.spot.length,numSpotLightMaps:x.spotLightMap.length,numRectAreaLights:x.rectArea.length,numHemiLights:x.hemi.length,numDirLightShadows:x.directionalShadowMap.length,numPointLightShadows:x.pointShadowMap.length,numSpotLightShadows:x.spotShadowMap.length,numSpotLightShadowsWithMaps:x.numSpotLightShadowsWithMaps,numLightProbes:x.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:b.dithering,shadowMapEnabled:r.shadowMap.enabled&&R.length>0,shadowMapType:r.shadowMap.type,toneMapping:ht,decodeVideoTexture:ke&&b.map.isVideoTexture===!0&&xt.getTransfer(b.map.colorSpace)===Nt,decodeVideoTextureEmissive:Se&&b.emissiveMap.isVideoTexture===!0&&xt.getTransfer(b.emissiveMap.colorSpace)===Nt,premultipliedAlpha:b.premultipliedAlpha,doubleSided:b.side===pn,flipSided:b.side===vn,useDepthPacking:b.depthPacking>=0,depthPacking:b.depthPacking||0,index0AttributeName:b.index0AttributeName,extensionClipCullDistance:qe&&b.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(qe&&b.extensions.multiDraw===!0||we)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:b.customProgramCacheKey()};return Dt.vertexUv1s=c.has(1),Dt.vertexUv2s=c.has(2),Dt.vertexUv3s=c.has(3),c.clear(),Dt}function p(b){const x=[];if(b.shaderID?x.push(b.shaderID):(x.push(b.customVertexShaderID),x.push(b.customFragmentShaderID)),b.defines!==void 0)for(const R in b.defines)x.push(R),x.push(b.defines[R]);return b.isRawShaderMaterial===!1&&(S(x,b),E(x,b),x.push(r.outputColorSpace)),x.push(b.customProgramCacheKey),x.join()}function S(b,x){b.push(x.precision),b.push(x.outputColorSpace),b.push(x.envMapMode),b.push(x.envMapCubeUVHeight),b.push(x.mapUv),b.push(x.alphaMapUv),b.push(x.lightMapUv),b.push(x.aoMapUv),b.push(x.bumpMapUv),b.push(x.normalMapUv),b.push(x.displacementMapUv),b.push(x.emissiveMapUv),b.push(x.metalnessMapUv),b.push(x.roughnessMapUv),b.push(x.anisotropyMapUv),b.push(x.clearcoatMapUv),b.push(x.clearcoatNormalMapUv),b.push(x.clearcoatRoughnessMapUv),b.push(x.iridescenceMapUv),b.push(x.iridescenceThicknessMapUv),b.push(x.sheenColorMapUv),b.push(x.sheenRoughnessMapUv),b.push(x.specularMapUv),b.push(x.specularColorMapUv),b.push(x.specularIntensityMapUv),b.push(x.transmissionMapUv),b.push(x.thicknessMapUv),b.push(x.combine),b.push(x.fogExp2),b.push(x.sizeAttenuation),b.push(x.morphTargetsCount),b.push(x.morphAttributeCount),b.push(x.numDirLights),b.push(x.numPointLights),b.push(x.numSpotLights),b.push(x.numSpotLightMaps),b.push(x.numHemiLights),b.push(x.numRectAreaLights),b.push(x.numDirLightShadows),b.push(x.numPointLightShadows),b.push(x.numSpotLightShadows),b.push(x.numSpotLightShadowsWithMaps),b.push(x.numLightProbes),b.push(x.shadowMapType),b.push(x.toneMapping),b.push(x.numClippingPlanes),b.push(x.numClipIntersection),b.push(x.depthPacking)}function E(b,x){o.disableAll(),x.supportsVertexTextures&&o.enable(0),x.instancing&&o.enable(1),x.instancingColor&&o.enable(2),x.instancingMorph&&o.enable(3),x.matcap&&o.enable(4),x.envMap&&o.enable(5),x.normalMapObjectSpace&&o.enable(6),x.normalMapTangentSpace&&o.enable(7),x.clearcoat&&o.enable(8),x.iridescence&&o.enable(9),x.alphaTest&&o.enable(10),x.vertexColors&&o.enable(11),x.vertexAlphas&&o.enable(12),x.vertexUv1s&&o.enable(13),x.vertexUv2s&&o.enable(14),x.vertexUv3s&&o.enable(15),x.vertexTangents&&o.enable(16),x.anisotropy&&o.enable(17),x.alphaHash&&o.enable(18),x.batching&&o.enable(19),x.dispersion&&o.enable(20),x.batchingColor&&o.enable(21),b.push(o.mask),o.disableAll(),x.fog&&o.enable(0),x.useFog&&o.enable(1),x.flatShading&&o.enable(2),x.logarithmicDepthBuffer&&o.enable(3),x.reverseDepthBuffer&&o.enable(4),x.skinning&&o.enable(5),x.morphTargets&&o.enable(6),x.morphNormals&&o.enable(7),x.morphColors&&o.enable(8),x.premultipliedAlpha&&o.enable(9),x.shadowMapEnabled&&o.enable(10),x.doubleSided&&o.enable(11),x.flipSided&&o.enable(12),x.useDepthPacking&&o.enable(13),x.dithering&&o.enable(14),x.transmission&&o.enable(15),x.sheen&&o.enable(16),x.opaque&&o.enable(17),x.pointsUvs&&o.enable(18),x.decodeVideoTexture&&o.enable(19),x.decodeVideoTextureEmissive&&o.enable(20),x.alphaToCoverage&&o.enable(21),b.push(o.mask)}function v(b){const x=m[b.type];let R;if(x){const B=Sn[x];R=Fl.clone(B.uniforms)}else R=b.uniforms;return R}function N(b,x){let R;for(let B=0,V=h.length;B<V;B++){const W=h[B];if(W.cacheKey===x){R=W,++R.usedTimes;break}}return R===void 0&&(R=new Dg(r,x,b,s),h.push(R)),R}function C(b){if(--b.usedTimes===0){const x=h.indexOf(b);h[x]=h[h.length-1],h.pop(),b.destroy()}}function T(b){l.remove(b)}function P(){l.dispose()}return{getParameters:g,getProgramCacheKey:p,getUniforms:v,acquireProgram:N,releaseProgram:C,releaseShaderCache:T,programs:h,dispose:P}}function Ug(){let r=new WeakMap;function e(a){return r.has(a)}function t(a){let o=r.get(a);return o===void 0&&(o={},r.set(a,o)),o}function n(a){r.delete(a)}function i(a,o,l){r.get(a)[o]=l}function s(){r=new WeakMap}return{has:e,get:t,remove:n,update:i,dispose:s}}function Fg(r,e){return r.groupOrder!==e.groupOrder?r.groupOrder-e.groupOrder:r.renderOrder!==e.renderOrder?r.renderOrder-e.renderOrder:r.material.id!==e.material.id?r.material.id-e.material.id:r.z!==e.z?r.z-e.z:r.id-e.id}function wh(r,e){return r.groupOrder!==e.groupOrder?r.groupOrder-e.groupOrder:r.renderOrder!==e.renderOrder?r.renderOrder-e.renderOrder:r.z!==e.z?e.z-r.z:r.id-e.id}function Th(){const r=[];let e=0;const t=[],n=[],i=[];function s(){e=0,t.length=0,n.length=0,i.length=0}function a(u,d,f,m,_,g){let p=r[e];return p===void 0?(p={id:u.id,object:u,geometry:d,material:f,groupOrder:m,renderOrder:u.renderOrder,z:_,group:g},r[e]=p):(p.id=u.id,p.object=u,p.geometry=d,p.material=f,p.groupOrder=m,p.renderOrder=u.renderOrder,p.z=_,p.group=g),e++,p}function o(u,d,f,m,_,g){const p=a(u,d,f,m,_,g);f.transmission>0?n.push(p):f.transparent===!0?i.push(p):t.push(p)}function l(u,d,f,m,_,g){const p=a(u,d,f,m,_,g);f.transmission>0?n.unshift(p):f.transparent===!0?i.unshift(p):t.unshift(p)}function c(u,d){t.length>1&&t.sort(u||Fg),n.length>1&&n.sort(d||wh),i.length>1&&i.sort(d||wh)}function h(){for(let u=e,d=r.length;u<d;u++){const f=r[u];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:s,push:o,unshift:l,finish:h,sort:c}}function Og(){let r=new WeakMap;function e(n,i){const s=r.get(n);let a;return s===void 0?(a=new Th,r.set(n,[a])):i>=s.length?(a=new Th,s.push(a)):a=s[i],a}function t(){r=new WeakMap}return{get:e,dispose:t}}function zg(){const r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new F,color:new st};break;case"SpotLight":t={position:new F,direction:new F,color:new st,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new F,color:new st,distance:0,decay:0};break;case"HemisphereLight":t={direction:new F,skyColor:new st,groundColor:new st};break;case"RectAreaLight":t={color:new st,position:new F,halfWidth:new F,halfHeight:new F};break}return r[e.id]=t,t}}}function Bg(){const r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ge};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ge};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ge,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}let kg=0;function Vg(r,e){return(e.castShadow?2:0)-(r.castShadow?2:0)+(e.map?1:0)-(r.map?1:0)}function Hg(r){const e=new zg,t=Bg(),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,s=new lt,a=new lt;function o(c){let h=0,u=0,d=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,S=0,E=0,v=0,N=0,C=0,T=0;c.sort(Vg);for(let b=0,x=c.length;b<x;b++){const R=c[b],B=R.color,V=R.intensity,W=R.distance,ee=R.shadow&&R.shadow.map?R.shadow.map.texture:null;if(R.isAmbientLight)h+=B.r*V,u+=B.g*V,d+=B.b*V;else if(R.isLightProbe){for(let k=0;k<9;k++)n.probe[k].addScaledVector(R.sh.coefficients[k],V);T++}else if(R.isDirectionalLight){const k=e.get(R);if(k.color.copy(R.color).multiplyScalar(R.intensity),R.castShadow){const Q=R.shadow,q=t.get(R);q.shadowIntensity=Q.intensity,q.shadowBias=Q.bias,q.shadowNormalBias=Q.normalBias,q.shadowRadius=Q.radius,q.shadowMapSize=Q.mapSize,n.directionalShadow[f]=q,n.directionalShadowMap[f]=ee,n.directionalShadowMatrix[f]=R.shadow.matrix,S++}n.directional[f]=k,f++}else if(R.isSpotLight){const k=e.get(R);k.position.setFromMatrixPosition(R.matrixWorld),k.color.copy(B).multiplyScalar(V),k.distance=W,k.coneCos=Math.cos(R.angle),k.penumbraCos=Math.cos(R.angle*(1-R.penumbra)),k.decay=R.decay,n.spot[_]=k;const Q=R.shadow;if(R.map&&(n.spotLightMap[N]=R.map,N++,Q.updateMatrices(R),R.castShadow&&C++),n.spotLightMatrix[_]=Q.matrix,R.castShadow){const q=t.get(R);q.shadowIntensity=Q.intensity,q.shadowBias=Q.bias,q.shadowNormalBias=Q.normalBias,q.shadowRadius=Q.radius,q.shadowMapSize=Q.mapSize,n.spotShadow[_]=q,n.spotShadowMap[_]=ee,v++}_++}else if(R.isRectAreaLight){const k=e.get(R);k.color.copy(B).multiplyScalar(V),k.halfWidth.set(R.width*.5,0,0),k.halfHeight.set(0,R.height*.5,0),n.rectArea[g]=k,g++}else if(R.isPointLight){const k=e.get(R);if(k.color.copy(R.color).multiplyScalar(R.intensity),k.distance=R.distance,k.decay=R.decay,R.castShadow){const Q=R.shadow,q=t.get(R);q.shadowIntensity=Q.intensity,q.shadowBias=Q.bias,q.shadowNormalBias=Q.normalBias,q.shadowRadius=Q.radius,q.shadowMapSize=Q.mapSize,q.shadowCameraNear=Q.camera.near,q.shadowCameraFar=Q.camera.far,n.pointShadow[m]=q,n.pointShadowMap[m]=ee,n.pointShadowMatrix[m]=R.shadow.matrix,E++}n.point[m]=k,m++}else if(R.isHemisphereLight){const k=e.get(R);k.skyColor.copy(R.color).multiplyScalar(V),k.groundColor.copy(R.groundColor).multiplyScalar(V),n.hemi[p]=k,p++}}g>0&&(r.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=Ne.LTC_FLOAT_1,n.rectAreaLTC2=Ne.LTC_FLOAT_2):(n.rectAreaLTC1=Ne.LTC_HALF_1,n.rectAreaLTC2=Ne.LTC_HALF_2)),n.ambient[0]=h,n.ambient[1]=u,n.ambient[2]=d;const P=n.hash;(P.directionalLength!==f||P.pointLength!==m||P.spotLength!==_||P.rectAreaLength!==g||P.hemiLength!==p||P.numDirectionalShadows!==S||P.numPointShadows!==E||P.numSpotShadows!==v||P.numSpotMaps!==N||P.numLightProbes!==T)&&(n.directional.length=f,n.spot.length=_,n.rectArea.length=g,n.point.length=m,n.hemi.length=p,n.directionalShadow.length=S,n.directionalShadowMap.length=S,n.pointShadow.length=E,n.pointShadowMap.length=E,n.spotShadow.length=v,n.spotShadowMap.length=v,n.directionalShadowMatrix.length=S,n.pointShadowMatrix.length=E,n.spotLightMatrix.length=v+N-C,n.spotLightMap.length=N,n.numSpotLightShadowsWithMaps=C,n.numLightProbes=T,P.directionalLength=f,P.pointLength=m,P.spotLength=_,P.rectAreaLength=g,P.hemiLength=p,P.numDirectionalShadows=S,P.numPointShadows=E,P.numSpotShadows=v,P.numSpotMaps=N,P.numLightProbes=T,n.version=kg++)}function l(c,h){let u=0,d=0,f=0,m=0,_=0;const g=h.matrixWorldInverse;for(let p=0,S=c.length;p<S;p++){const E=c[p];if(E.isDirectionalLight){const v=n.directional[u];v.direction.setFromMatrixPosition(E.matrixWorld),i.setFromMatrixPosition(E.target.matrixWorld),v.direction.sub(i),v.direction.transformDirection(g),u++}else if(E.isSpotLight){const v=n.spot[f];v.position.setFromMatrixPosition(E.matrixWorld),v.position.applyMatrix4(g),v.direction.setFromMatrixPosition(E.matrixWorld),i.setFromMatrixPosition(E.target.matrixWorld),v.direction.sub(i),v.direction.transformDirection(g),f++}else if(E.isRectAreaLight){const v=n.rectArea[m];v.position.setFromMatrixPosition(E.matrixWorld),v.position.applyMatrix4(g),a.identity(),s.copy(E.matrixWorld),s.premultiply(g),a.extractRotation(s),v.halfWidth.set(E.width*.5,0,0),v.halfHeight.set(0,E.height*.5,0),v.halfWidth.applyMatrix4(a),v.halfHeight.applyMatrix4(a),m++}else if(E.isPointLight){const v=n.point[d];v.position.setFromMatrixPosition(E.matrixWorld),v.position.applyMatrix4(g),d++}else if(E.isHemisphereLight){const v=n.hemi[_];v.direction.setFromMatrixPosition(E.matrixWorld),v.direction.transformDirection(g),_++}}}return{setup:o,setupView:l,state:n}}function Ch(r){const e=new Hg(r),t=[],n=[];function i(h){c.camera=h,t.length=0,n.length=0}function s(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:s,pushShadow:a}}function Gg(r){let e=new WeakMap;function t(i,s=0){const a=e.get(i);let o;return a===void 0?(o=new Ch(r),e.set(i,[o])):s>=a.length?(o=new Ch(r),a.push(o)):o=a[s],o}function n(){e=new WeakMap}return{get:t,dispose:n}}const Wg=`void main() {
|
|
3775
|
+
`+q)}else B!==""?console.warn("THREE.WebGLProgram: Program Info Log:",B):(V===""||W==="")&&(k=!1);k&&(R.diagnostics={runnable:ee,programLog:B,vertexShader:{log:V,prefix:g},fragmentShader:{log:W,prefix:p}})}i.deleteShader(N),i.deleteShader(C),L=new ca(i,_),b=yg(i,_)}let L;this.getUniforms=function(){return L===void 0&&T(this),L};let b;this.getAttributes=function(){return b===void 0&&T(this),b};let x=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return x===!1&&(x=i.getProgramParameter(_,hg)),x},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(_),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=ug++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=N,this.fragmentShader=C,this}let Pg=0;class Lg{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,i=this._getShaderStage(t),s=this._getShaderStage(n),a=this._getShaderCacheForMaterial(e);return a.has(i)===!1&&(a.add(i),i.usedTimes++),a.has(s)===!1&&(a.add(s),s.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 Ig(e),t.set(e,n)),n}}class Ig{constructor(e){this.id=Pg++,this.code=e,this.usedTimes=0}}function Ng(r,e,t,n,i,s,a){const o=new Ul,l=new Lg,c=new Set,h=[],u=i.logarithmicDepthBuffer,d=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,x,R,B,V){const W=B.fog,ee=V.geometry,k=b.isMeshStandardMaterial?B.environment:null,Q=(b.isMeshStandardMaterial?t:e).get(b.envMap||k),q=Q&&Q.mapping===Ea?Q.image.height:null,de=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 ye=ee.morphAttributes.position||ee.morphAttributes.normal||ee.morphAttributes.color,le=ye!==void 0?ye.length:0;let Pe=0;ee.morphAttributes.position!==void 0&&(Pe=1),ee.morphAttributes.normal!==void 0&&(Pe=2),ee.morphAttributes.color!==void 0&&(Pe=3);let Te,Y,re,ae;if(de){const pt=Sn[de];Te=pt.vertexShader,Y=pt.fragmentShader}else Te=b.vertexShader,Y=b.fragmentShader,l.update(b),re=l.getVertexShaderID(b),ae=l.getFragmentShaderID(b);const oe=r.getRenderTarget(),Ee=r.state.buffers.depth.getReversed(),_e=V.isInstancedMesh===!0,we=V.isBatchedMesh===!0,ke=!!b.map,tt=!!b.matcap,Qe=!!Q,O=!!b.aoMap,bt=!!b.lightMap,$=!!b.bumpMap,pe=!!b.normalMap,te=!!b.displacementMap,Se=!!b.emissiveMap,he=!!b.metalnessMap,ce=!!b.roughnessMap,Ue=b.anisotropy>0,U=b.clearcoat>0,A=b.dispersion>0,G=b.iridescence>0,z=b.sheen>0,se=b.transmission>0,ne=Ue&&!!b.anisotropyMap,Ce=U&&!!b.clearcoatMap,Ae=U&&!!b.clearcoatNormalMap,Be=U&&!!b.clearcoatRoughnessMap,Ve=G&&!!b.iridescenceMap,me=G&&!!b.iridescenceThicknessMap,De=z&&!!b.sheenColorMap,Ke=z&&!!b.sheenRoughnessMap,nt=!!b.specularMap,Le=!!b.specularColorMap,ct=!!b.specularIntensityMap,H=se&&!!b.transmissionMap,Fe=se&&!!b.thicknessMap,ve=!!b.gradientMap,He=!!b.alphaMap,Me=b.alphaTest>0,ge=!!b.alphaHash,qe=!!b.extensions;let ht=Ti;b.toneMapped&&(oe===null||oe.isXRRenderTarget===!0)&&(ht=r.toneMapping);const Dt={shaderID:de,shaderType:b.type,shaderName:b.name,vertexShader:Te,fragmentShader:Y,defines:b.defines,customVertexShaderID:re,customFragmentShaderID:ae,isRawShaderMaterial:b.isRawShaderMaterial===!0,glslVersion:b.glslVersion,precision:f,batching:we,batchingColor:we&&V._colorsTexture!==null,instancing:_e,instancingColor:_e&&V.instanceColor!==null,instancingMorph:_e&&V.morphTexture!==null,supportsVertexTextures:d,outputColorSpace:oe===null?r.outputColorSpace:oe.isXRRenderTarget===!0?oe.texture.colorSpace:Pr,alphaToCoverage:!!b.alphaToCoverage,map:ke,matcap:tt,envMap:Qe,envMapMode:Qe&&Q.mapping,envMapCubeUVHeight:q,aoMap:O,lightMap:bt,bumpMap:$,normalMap:pe,displacementMap:d&&te,emissiveMap:Se,normalMapObjectSpace:pe&&b.normalMapType===wf,normalMapTangentSpace:pe&&b.normalMapType===Aa,metalnessMap:he,roughnessMap:ce,anisotropy:Ue,anisotropyMap:ne,clearcoat:U,clearcoatMap:Ce,clearcoatNormalMap:Ae,clearcoatRoughnessMap:Be,dispersion:A,iridescence:G,iridescenceMap:Ve,iridescenceThicknessMap:me,sheen:z,sheenColorMap:De,sheenRoughnessMap:Ke,specularMap:nt,specularColorMap:Le,specularIntensityMap:ct,transmission:se,transmissionMap:H,thicknessMap:Fe,gradientMap:ve,opaque:b.transparent===!1&&b.blending===Ar&&b.alphaToCoverage===!1,alphaMap:He,alphaTest:Me,alphaHash:ge,combine:b.combine,mapUv:ke&&_(b.map.channel),aoMapUv:O&&_(b.aoMap.channel),lightMapUv:bt&&_(b.lightMap.channel),bumpMapUv:$&&_(b.bumpMap.channel),normalMapUv:pe&&_(b.normalMap.channel),displacementMapUv:te&&_(b.displacementMap.channel),emissiveMapUv:Se&&_(b.emissiveMap.channel),metalnessMapUv:he&&_(b.metalnessMap.channel),roughnessMapUv:ce&&_(b.roughnessMap.channel),anisotropyMapUv:ne&&_(b.anisotropyMap.channel),clearcoatMapUv:Ce&&_(b.clearcoatMap.channel),clearcoatNormalMapUv:Ae&&_(b.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Be&&_(b.clearcoatRoughnessMap.channel),iridescenceMapUv:Ve&&_(b.iridescenceMap.channel),iridescenceThicknessMapUv:me&&_(b.iridescenceThicknessMap.channel),sheenColorMapUv:De&&_(b.sheenColorMap.channel),sheenRoughnessMapUv:Ke&&_(b.sheenRoughnessMap.channel),specularMapUv:nt&&_(b.specularMap.channel),specularColorMapUv:Le&&_(b.specularColorMap.channel),specularIntensityMapUv:ct&&_(b.specularIntensityMap.channel),transmissionMapUv:H&&_(b.transmissionMap.channel),thicknessMapUv:Fe&&_(b.thicknessMap.channel),alphaMapUv:He&&_(b.alphaMap.channel),vertexTangents:!!ee.attributes.tangent&&(pe||Ue),vertexColors:b.vertexColors,vertexAlphas:b.vertexColors===!0&&!!ee.attributes.color&&ee.attributes.color.itemSize===4,pointsUvs:V.isPoints===!0&&!!ee.attributes.uv&&(ke||He),fog:!!W,useFog:b.fog===!0,fogExp2:!!W&&W.isFogExp2,flatShading:b.flatShading===!0,sizeAttenuation:b.sizeAttenuation===!0,logarithmicDepthBuffer:u,reverseDepthBuffer:Ee,skinning:V.isSkinnedMesh===!0,morphTargets:ee.morphAttributes.position!==void 0,morphNormals:ee.morphAttributes.normal!==void 0,morphColors:ee.morphAttributes.color!==void 0,morphTargetsCount:le,morphTextureStride:Pe,numDirLights:x.directional.length,numPointLights:x.point.length,numSpotLights:x.spot.length,numSpotLightMaps:x.spotLightMap.length,numRectAreaLights:x.rectArea.length,numHemiLights:x.hemi.length,numDirLightShadows:x.directionalShadowMap.length,numPointLightShadows:x.pointShadowMap.length,numSpotLightShadows:x.spotShadowMap.length,numSpotLightShadowsWithMaps:x.numSpotLightShadowsWithMaps,numLightProbes:x.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:b.dithering,shadowMapEnabled:r.shadowMap.enabled&&R.length>0,shadowMapType:r.shadowMap.type,toneMapping:ht,decodeVideoTexture:ke&&b.map.isVideoTexture===!0&&xt.getTransfer(b.map.colorSpace)===Nt,decodeVideoTextureEmissive:Se&&b.emissiveMap.isVideoTexture===!0&&xt.getTransfer(b.emissiveMap.colorSpace)===Nt,premultipliedAlpha:b.premultipliedAlpha,doubleSided:b.side===pn,flipSided:b.side===vn,useDepthPacking:b.depthPacking>=0,depthPacking:b.depthPacking||0,index0AttributeName:b.index0AttributeName,extensionClipCullDistance:qe&&b.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(qe&&b.extensions.multiDraw===!0||we)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:b.customProgramCacheKey()};return Dt.vertexUv1s=c.has(1),Dt.vertexUv2s=c.has(2),Dt.vertexUv3s=c.has(3),c.clear(),Dt}function p(b){const x=[];if(b.shaderID?x.push(b.shaderID):(x.push(b.customVertexShaderID),x.push(b.customFragmentShaderID)),b.defines!==void 0)for(const R in b.defines)x.push(R),x.push(b.defines[R]);return b.isRawShaderMaterial===!1&&(S(x,b),E(x,b),x.push(r.outputColorSpace)),x.push(b.customProgramCacheKey),x.join()}function S(b,x){b.push(x.precision),b.push(x.outputColorSpace),b.push(x.envMapMode),b.push(x.envMapCubeUVHeight),b.push(x.mapUv),b.push(x.alphaMapUv),b.push(x.lightMapUv),b.push(x.aoMapUv),b.push(x.bumpMapUv),b.push(x.normalMapUv),b.push(x.displacementMapUv),b.push(x.emissiveMapUv),b.push(x.metalnessMapUv),b.push(x.roughnessMapUv),b.push(x.anisotropyMapUv),b.push(x.clearcoatMapUv),b.push(x.clearcoatNormalMapUv),b.push(x.clearcoatRoughnessMapUv),b.push(x.iridescenceMapUv),b.push(x.iridescenceThicknessMapUv),b.push(x.sheenColorMapUv),b.push(x.sheenRoughnessMapUv),b.push(x.specularMapUv),b.push(x.specularColorMapUv),b.push(x.specularIntensityMapUv),b.push(x.transmissionMapUv),b.push(x.thicknessMapUv),b.push(x.combine),b.push(x.fogExp2),b.push(x.sizeAttenuation),b.push(x.morphTargetsCount),b.push(x.morphAttributeCount),b.push(x.numDirLights),b.push(x.numPointLights),b.push(x.numSpotLights),b.push(x.numSpotLightMaps),b.push(x.numHemiLights),b.push(x.numRectAreaLights),b.push(x.numDirLightShadows),b.push(x.numPointLightShadows),b.push(x.numSpotLightShadows),b.push(x.numSpotLightShadowsWithMaps),b.push(x.numLightProbes),b.push(x.shadowMapType),b.push(x.toneMapping),b.push(x.numClippingPlanes),b.push(x.numClipIntersection),b.push(x.depthPacking)}function E(b,x){o.disableAll(),x.supportsVertexTextures&&o.enable(0),x.instancing&&o.enable(1),x.instancingColor&&o.enable(2),x.instancingMorph&&o.enable(3),x.matcap&&o.enable(4),x.envMap&&o.enable(5),x.normalMapObjectSpace&&o.enable(6),x.normalMapTangentSpace&&o.enable(7),x.clearcoat&&o.enable(8),x.iridescence&&o.enable(9),x.alphaTest&&o.enable(10),x.vertexColors&&o.enable(11),x.vertexAlphas&&o.enable(12),x.vertexUv1s&&o.enable(13),x.vertexUv2s&&o.enable(14),x.vertexUv3s&&o.enable(15),x.vertexTangents&&o.enable(16),x.anisotropy&&o.enable(17),x.alphaHash&&o.enable(18),x.batching&&o.enable(19),x.dispersion&&o.enable(20),x.batchingColor&&o.enable(21),b.push(o.mask),o.disableAll(),x.fog&&o.enable(0),x.useFog&&o.enable(1),x.flatShading&&o.enable(2),x.logarithmicDepthBuffer&&o.enable(3),x.reverseDepthBuffer&&o.enable(4),x.skinning&&o.enable(5),x.morphTargets&&o.enable(6),x.morphNormals&&o.enable(7),x.morphColors&&o.enable(8),x.premultipliedAlpha&&o.enable(9),x.shadowMapEnabled&&o.enable(10),x.doubleSided&&o.enable(11),x.flipSided&&o.enable(12),x.useDepthPacking&&o.enable(13),x.dithering&&o.enable(14),x.transmission&&o.enable(15),x.sheen&&o.enable(16),x.opaque&&o.enable(17),x.pointsUvs&&o.enable(18),x.decodeVideoTexture&&o.enable(19),x.decodeVideoTextureEmissive&&o.enable(20),x.alphaToCoverage&&o.enable(21),b.push(o.mask)}function v(b){const x=m[b.type];let R;if(x){const B=Sn[x];R=Fl.clone(B.uniforms)}else R=b.uniforms;return R}function N(b,x){let R;for(let B=0,V=h.length;B<V;B++){const W=h[B];if(W.cacheKey===x){R=W,++R.usedTimes;break}}return R===void 0&&(R=new Dg(r,x,b,s),h.push(R)),R}function C(b){if(--b.usedTimes===0){const x=h.indexOf(b);h[x]=h[h.length-1],h.pop(),b.destroy()}}function T(b){l.remove(b)}function L(){l.dispose()}return{getParameters:g,getProgramCacheKey:p,getUniforms:v,acquireProgram:N,releaseProgram:C,releaseShaderCache:T,programs:h,dispose:L}}function Ug(){let r=new WeakMap;function e(a){return r.has(a)}function t(a){let o=r.get(a);return o===void 0&&(o={},r.set(a,o)),o}function n(a){r.delete(a)}function i(a,o,l){r.get(a)[o]=l}function s(){r=new WeakMap}return{has:e,get:t,remove:n,update:i,dispose:s}}function Fg(r,e){return r.groupOrder!==e.groupOrder?r.groupOrder-e.groupOrder:r.renderOrder!==e.renderOrder?r.renderOrder-e.renderOrder:r.material.id!==e.material.id?r.material.id-e.material.id:r.z!==e.z?r.z-e.z:r.id-e.id}function wh(r,e){return r.groupOrder!==e.groupOrder?r.groupOrder-e.groupOrder:r.renderOrder!==e.renderOrder?r.renderOrder-e.renderOrder:r.z!==e.z?e.z-r.z:r.id-e.id}function Th(){const r=[];let e=0;const t=[],n=[],i=[];function s(){e=0,t.length=0,n.length=0,i.length=0}function a(u,d,f,m,_,g){let p=r[e];return p===void 0?(p={id:u.id,object:u,geometry:d,material:f,groupOrder:m,renderOrder:u.renderOrder,z:_,group:g},r[e]=p):(p.id=u.id,p.object=u,p.geometry=d,p.material=f,p.groupOrder=m,p.renderOrder=u.renderOrder,p.z=_,p.group=g),e++,p}function o(u,d,f,m,_,g){const p=a(u,d,f,m,_,g);f.transmission>0?n.push(p):f.transparent===!0?i.push(p):t.push(p)}function l(u,d,f,m,_,g){const p=a(u,d,f,m,_,g);f.transmission>0?n.unshift(p):f.transparent===!0?i.unshift(p):t.unshift(p)}function c(u,d){t.length>1&&t.sort(u||Fg),n.length>1&&n.sort(d||wh),i.length>1&&i.sort(d||wh)}function h(){for(let u=e,d=r.length;u<d;u++){const f=r[u];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:s,push:o,unshift:l,finish:h,sort:c}}function Og(){let r=new WeakMap;function e(n,i){const s=r.get(n);let a;return s===void 0?(a=new Th,r.set(n,[a])):i>=s.length?(a=new Th,s.push(a)):a=s[i],a}function t(){r=new WeakMap}return{get:e,dispose:t}}function zg(){const r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new F,color:new st};break;case"SpotLight":t={position:new F,direction:new F,color:new st,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new F,color:new st,distance:0,decay:0};break;case"HemisphereLight":t={direction:new F,skyColor:new st,groundColor:new st};break;case"RectAreaLight":t={color:new st,position:new F,halfWidth:new F,halfHeight:new F};break}return r[e.id]=t,t}}}function Bg(){const r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ge};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ge};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ge,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}let kg=0;function Vg(r,e){return(e.castShadow?2:0)-(r.castShadow?2:0)+(e.map?1:0)-(r.map?1:0)}function Hg(r){const e=new zg,t=Bg(),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,s=new lt,a=new lt;function o(c){let h=0,u=0,d=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,S=0,E=0,v=0,N=0,C=0,T=0;c.sort(Vg);for(let b=0,x=c.length;b<x;b++){const R=c[b],B=R.color,V=R.intensity,W=R.distance,ee=R.shadow&&R.shadow.map?R.shadow.map.texture:null;if(R.isAmbientLight)h+=B.r*V,u+=B.g*V,d+=B.b*V;else if(R.isLightProbe){for(let k=0;k<9;k++)n.probe[k].addScaledVector(R.sh.coefficients[k],V);T++}else if(R.isDirectionalLight){const k=e.get(R);if(k.color.copy(R.color).multiplyScalar(R.intensity),R.castShadow){const Q=R.shadow,q=t.get(R);q.shadowIntensity=Q.intensity,q.shadowBias=Q.bias,q.shadowNormalBias=Q.normalBias,q.shadowRadius=Q.radius,q.shadowMapSize=Q.mapSize,n.directionalShadow[f]=q,n.directionalShadowMap[f]=ee,n.directionalShadowMatrix[f]=R.shadow.matrix,S++}n.directional[f]=k,f++}else if(R.isSpotLight){const k=e.get(R);k.position.setFromMatrixPosition(R.matrixWorld),k.color.copy(B).multiplyScalar(V),k.distance=W,k.coneCos=Math.cos(R.angle),k.penumbraCos=Math.cos(R.angle*(1-R.penumbra)),k.decay=R.decay,n.spot[_]=k;const Q=R.shadow;if(R.map&&(n.spotLightMap[N]=R.map,N++,Q.updateMatrices(R),R.castShadow&&C++),n.spotLightMatrix[_]=Q.matrix,R.castShadow){const q=t.get(R);q.shadowIntensity=Q.intensity,q.shadowBias=Q.bias,q.shadowNormalBias=Q.normalBias,q.shadowRadius=Q.radius,q.shadowMapSize=Q.mapSize,n.spotShadow[_]=q,n.spotShadowMap[_]=ee,v++}_++}else if(R.isRectAreaLight){const k=e.get(R);k.color.copy(B).multiplyScalar(V),k.halfWidth.set(R.width*.5,0,0),k.halfHeight.set(0,R.height*.5,0),n.rectArea[g]=k,g++}else if(R.isPointLight){const k=e.get(R);if(k.color.copy(R.color).multiplyScalar(R.intensity),k.distance=R.distance,k.decay=R.decay,R.castShadow){const Q=R.shadow,q=t.get(R);q.shadowIntensity=Q.intensity,q.shadowBias=Q.bias,q.shadowNormalBias=Q.normalBias,q.shadowRadius=Q.radius,q.shadowMapSize=Q.mapSize,q.shadowCameraNear=Q.camera.near,q.shadowCameraFar=Q.camera.far,n.pointShadow[m]=q,n.pointShadowMap[m]=ee,n.pointShadowMatrix[m]=R.shadow.matrix,E++}n.point[m]=k,m++}else if(R.isHemisphereLight){const k=e.get(R);k.skyColor.copy(R.color).multiplyScalar(V),k.groundColor.copy(R.groundColor).multiplyScalar(V),n.hemi[p]=k,p++}}g>0&&(r.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=Ne.LTC_FLOAT_1,n.rectAreaLTC2=Ne.LTC_FLOAT_2):(n.rectAreaLTC1=Ne.LTC_HALF_1,n.rectAreaLTC2=Ne.LTC_HALF_2)),n.ambient[0]=h,n.ambient[1]=u,n.ambient[2]=d;const L=n.hash;(L.directionalLength!==f||L.pointLength!==m||L.spotLength!==_||L.rectAreaLength!==g||L.hemiLength!==p||L.numDirectionalShadows!==S||L.numPointShadows!==E||L.numSpotShadows!==v||L.numSpotMaps!==N||L.numLightProbes!==T)&&(n.directional.length=f,n.spot.length=_,n.rectArea.length=g,n.point.length=m,n.hemi.length=p,n.directionalShadow.length=S,n.directionalShadowMap.length=S,n.pointShadow.length=E,n.pointShadowMap.length=E,n.spotShadow.length=v,n.spotShadowMap.length=v,n.directionalShadowMatrix.length=S,n.pointShadowMatrix.length=E,n.spotLightMatrix.length=v+N-C,n.spotLightMap.length=N,n.numSpotLightShadowsWithMaps=C,n.numLightProbes=T,L.directionalLength=f,L.pointLength=m,L.spotLength=_,L.rectAreaLength=g,L.hemiLength=p,L.numDirectionalShadows=S,L.numPointShadows=E,L.numSpotShadows=v,L.numSpotMaps=N,L.numLightProbes=T,n.version=kg++)}function l(c,h){let u=0,d=0,f=0,m=0,_=0;const g=h.matrixWorldInverse;for(let p=0,S=c.length;p<S;p++){const E=c[p];if(E.isDirectionalLight){const v=n.directional[u];v.direction.setFromMatrixPosition(E.matrixWorld),i.setFromMatrixPosition(E.target.matrixWorld),v.direction.sub(i),v.direction.transformDirection(g),u++}else if(E.isSpotLight){const v=n.spot[f];v.position.setFromMatrixPosition(E.matrixWorld),v.position.applyMatrix4(g),v.direction.setFromMatrixPosition(E.matrixWorld),i.setFromMatrixPosition(E.target.matrixWorld),v.direction.sub(i),v.direction.transformDirection(g),f++}else if(E.isRectAreaLight){const v=n.rectArea[m];v.position.setFromMatrixPosition(E.matrixWorld),v.position.applyMatrix4(g),a.identity(),s.copy(E.matrixWorld),s.premultiply(g),a.extractRotation(s),v.halfWidth.set(E.width*.5,0,0),v.halfHeight.set(0,E.height*.5,0),v.halfWidth.applyMatrix4(a),v.halfHeight.applyMatrix4(a),m++}else if(E.isPointLight){const v=n.point[d];v.position.setFromMatrixPosition(E.matrixWorld),v.position.applyMatrix4(g),d++}else if(E.isHemisphereLight){const v=n.hemi[_];v.direction.setFromMatrixPosition(E.matrixWorld),v.direction.transformDirection(g),_++}}}return{setup:o,setupView:l,state:n}}function Ch(r){const e=new Hg(r),t=[],n=[];function i(h){c.camera=h,t.length=0,n.length=0}function s(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:s,pushShadow:a}}function Gg(r){let e=new WeakMap;function t(i,s=0){const a=e.get(i);let o;return a===void 0?(o=new Ch(r),e.set(i,[o])):s>=a.length?(o=new Ch(r),a.push(o)):o=a[s],o}function n(){e=new WeakMap}return{get:t,dispose:n}}const Wg=`void main() {
|
|
3776
3776
|
gl_Position = vec4( position, 1.0 );
|
|
3777
3777
|
}`,Xg=`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 qg(r,e,t){let n=new kl;const i=new Ge,s=new Ge,a=new Mt,o=new Jp({depthPacking:Af}),l=new Kp,c={},h=t.maxTextureSize,u={[Hn]:vn,[vn]:Hn,[pn]:pn},d=new pi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ge},radius:{value:4}},vertexShader:Wg,fragmentShader:Xg}),f=d.clone();f.defines.HORIZONTAL_PASS=1;const m=new Bt;m.setAttribute("position",new Gt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new Ct(m,d),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=au;let p=this.type;this.render=function(C,T,P){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||C.length===0)return;const b=r.getRenderTarget(),x=r.getActiveCubeFace(),R=r.getActiveMipmapLevel(),B=r.state;B.setBlending(wi),B.buffers.color.setClear(1,1,1,1),B.buffers.depth.setTest(!0),B.setScissorTest(!1);const V=p!==hi&&this.type===hi,W=p===hi&&this.type!==hi;for(let ee=0,k=C.length;ee<k;ee++){const Q=C[ee],q=Q.shadow;if(q===void 0){console.warn("THREE.WebGLShadowMap:",Q,"has no shadow.");continue}if(q.autoUpdate===!1&&q.needsUpdate===!1)continue;i.copy(q.mapSize);const ue=q.getFrameExtents();if(i.multiply(ue),s.copy(q.mapSize),(i.x>h||i.y>h)&&(i.x>h&&(s.x=Math.floor(h/ue.x),i.x=s.x*ue.x,q.mapSize.x=s.x),i.y>h&&(s.y=Math.floor(h/ue.y),i.y=s.y*ue.y,q.mapSize.y=s.y)),q.map===null||V===!0||W===!0){const le=this.type!==hi?{minFilter:Cn,magFilter:Cn}:{};q.map!==null&&q.map.dispose(),q.map=new ji(i.x,i.y,le),q.map.texture.name=Q.name+".shadowMap",q.camera.updateProjectionMatrix()}r.setRenderTarget(q.map),r.clear();const ye=q.getViewportCount();for(let le=0;le<ye;le++){const Le=q.getViewport(le);a.set(s.x*Le.x,s.y*Le.y,s.x*Le.z,s.y*Le.w),B.viewport(a),q.updateMatrices(Q,le),n=q.getFrustum(),v(T,P,q.camera,Q,this.type)}q.isPointLightShadow!==!0&&this.type===hi&&S(q,P),q.needsUpdate=!1}p=this.type,g.needsUpdate=!1,r.setRenderTarget(b,x,R)};function S(C,T){const P=e.update(_);d.defines.VSM_SAMPLES!==C.blurSamples&&(d.defines.VSM_SAMPLES=C.blurSamples,f.defines.VSM_SAMPLES=C.blurSamples,d.needsUpdate=!0,f.needsUpdate=!0),C.mapPass===null&&(C.mapPass=new ji(i.x,i.y)),d.uniforms.shadow_pass.value=C.map.texture,d.uniforms.resolution.value=C.mapSize,d.uniforms.radius.value=C.radius,r.setRenderTarget(C.mapPass),r.clear(),r.renderBufferDirect(T,null,P,d,_,null),f.uniforms.shadow_pass.value=C.mapPass.texture,f.uniforms.resolution.value=C.mapSize,f.uniforms.radius.value=C.radius,r.setRenderTarget(C.map),r.clear(),r.renderBufferDirect(T,null,P,f,_,null)}function E(C,T,P,b){let x=null;const R=P.isPointLight===!0?C.customDistanceMaterial:C.customDepthMaterial;if(R!==void 0)x=R;else if(x=P.isPointLight===!0?l:o,r.localClippingEnabled&&T.clipShadows===!0&&Array.isArray(T.clippingPlanes)&&T.clippingPlanes.length!==0||T.displacementMap&&T.displacementScale!==0||T.alphaMap&&T.alphaTest>0||T.map&&T.alphaTest>0||T.alphaToCoverage===!0){const B=x.uuid,V=T.uuid;let W=c[B];W===void 0&&(W={},c[B]=W);let ee=W[V];ee===void 0&&(ee=x.clone(),W[V]=ee,T.addEventListener("dispose",N)),x=ee}if(x.visible=T.visible,x.wireframe=T.wireframe,b===hi?x.side=T.shadowSide!==null?T.shadowSide:T.side:x.side=T.shadowSide!==null?T.shadowSide:u[T.side],x.alphaMap=T.alphaMap,x.alphaTest=T.alphaToCoverage===!0?.5:T.alphaTest,x.map=T.map,x.clipShadows=T.clipShadows,x.clippingPlanes=T.clippingPlanes,x.clipIntersection=T.clipIntersection,x.displacementMap=T.displacementMap,x.displacementScale=T.displacementScale,x.displacementBias=T.displacementBias,x.wireframeLinewidth=T.wireframeLinewidth,x.linewidth=T.linewidth,P.isPointLight===!0&&x.isMeshDistanceMaterial===!0){const B=r.properties.get(x);B.light=P}return x}function v(C,T,P,b,x){if(C.visible===!1)return;if(C.layers.test(T.layers)&&(C.isMesh||C.isLine||C.isPoints)&&(C.castShadow||C.receiveShadow&&x===hi)&&(!C.frustumCulled||n.intersectsObject(C))){C.modelViewMatrix.multiplyMatrices(P.matrixWorldInverse,C.matrixWorld);const V=e.update(C),W=C.material;if(Array.isArray(W)){const ee=V.groups;for(let k=0,Q=ee.length;k<Q;k++){const q=ee[k],ue=W[q.materialIndex];if(ue&&ue.visible){const ye=E(C,ue,b,x);C.onBeforeShadow(r,C,T,P,V,ye,q),r.renderBufferDirect(P,null,V,ye,C,q),C.onAfterShadow(r,C,T,P,V,ye,q)}}}else if(W.visible){const ee=E(C,W,b,x);C.onBeforeShadow(r,C,T,P,V,ee,null),r.renderBufferDirect(P,null,V,ee,C,null),C.onAfterShadow(r,C,T,P,V,ee,null)}}const B=C.children;for(let V=0,W=B.length;V<W;V++)v(B[V],T,P,b,x)}function N(C){C.target.removeEventListener("dispose",N);for(const P in c){const b=c[P],x=C.target.uuid;x in b&&(b[x].dispose(),delete b[x])}}}const jg={[Co]:Ro,[Do]:Io,[Lo]:No,[Cr]:Po,[Ro]:Co,[Io]:Do,[No]:Lo,[Po]:Cr};function Yg(r,e){function t(){let H=!1;const Fe=new Mt;let ve=null;const He=new Mt(0,0,0,0);return{setMask:function(Me){ve!==Me&&!H&&(r.colorMask(Me,Me,Me,Me),ve=Me)},setLocked:function(Me){H=Me},setClear:function(Me,ge,qe,ht,Dt){Dt===!0&&(Me*=ht,ge*=ht,qe*=ht),Fe.set(Me,ge,qe,ht),He.equals(Fe)===!1&&(r.clearColor(Me,ge,qe,ht),He.copy(Fe))},reset:function(){H=!1,ve=null,He.set(-1,0,0,0)}}}function n(){let H=!1,Fe=!1,ve=null,He=null,Me=null;return{setReversed:function(ge){if(Fe!==ge){const qe=e.get("EXT_clip_control");ge?qe.clipControlEXT(qe.LOWER_LEFT_EXT,qe.ZERO_TO_ONE_EXT):qe.clipControlEXT(qe.LOWER_LEFT_EXT,qe.NEGATIVE_ONE_TO_ONE_EXT),Fe=ge;const ht=Me;Me=null,this.setClear(ht)}},getReversed:function(){return Fe},setTest:function(ge){ge?oe(r.DEPTH_TEST):Ee(r.DEPTH_TEST)},setMask:function(ge){ve!==ge&&!H&&(r.depthMask(ge),ve=ge)},setFunc:function(ge){if(Fe&&(ge=jg[ge]),He!==ge){switch(ge){case Co:r.depthFunc(r.NEVER);break;case Ro:r.depthFunc(r.ALWAYS);break;case Do:r.depthFunc(r.LESS);break;case Cr:r.depthFunc(r.LEQUAL);break;case Lo:r.depthFunc(r.EQUAL);break;case Po:r.depthFunc(r.GEQUAL);break;case Io:r.depthFunc(r.GREATER);break;case No:r.depthFunc(r.NOTEQUAL);break;default:r.depthFunc(r.LEQUAL)}He=ge}},setLocked:function(ge){H=ge},setClear:function(ge){Me!==ge&&(Fe&&(ge=1-ge),r.clearDepth(ge),Me=ge)},reset:function(){H=!1,ve=null,He=null,Me=null,Fe=!1}}}function i(){let H=!1,Fe=null,ve=null,He=null,Me=null,ge=null,qe=null,ht=null,Dt=null;return{setTest:function(pt){H||(pt?oe(r.STENCIL_TEST):Ee(r.STENCIL_TEST))},setMask:function(pt){Fe!==pt&&!H&&(r.stencilMask(pt),Fe=pt)},setFunc:function(pt,en,je){(ve!==pt||He!==en||Me!==je)&&(r.stencilFunc(pt,en,je),ve=pt,He=en,Me=je)},setOp:function(pt,en,je){(ge!==pt||qe!==en||ht!==je)&&(r.stencilOp(pt,en,je),ge=pt,qe=en,ht=je)},setLocked:function(pt){H=pt},setClear:function(pt){Dt!==pt&&(r.clearStencil(pt),Dt=pt)},reset:function(){H=!1,Fe=null,ve=null,He=null,Me=null,ge=null,qe=null,ht=null,Dt=null}}}const s=new t,a=new n,o=new i,l=new WeakMap,c=new WeakMap;let h={},u={},d=new WeakMap,f=[],m=null,_=!1,g=null,p=null,S=null,E=null,v=null,N=null,C=null,T=new st(0,0,0),P=0,b=!1,x=null,R=null,B=null,V=null,W=null;const ee=r.getParameter(r.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let k=!1,Q=0;const q=r.getParameter(r.VERSION);q.indexOf("WebGL")!==-1?(Q=parseFloat(/^WebGL (\d)/.exec(q)[1]),k=Q>=1):q.indexOf("OpenGL ES")!==-1&&(Q=parseFloat(/^OpenGL ES (\d)/.exec(q)[1]),k=Q>=2);let ue=null,ye={};const le=r.getParameter(r.SCISSOR_BOX),Le=r.getParameter(r.VIEWPORT),Te=new Mt().fromArray(le),Y=new Mt().fromArray(Le);function re(H,Fe,ve,He){const Me=new Uint8Array(4),ge=r.createTexture();r.bindTexture(H,ge),r.texParameteri(H,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(H,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let qe=0;qe<ve;qe++)H===r.TEXTURE_3D||H===r.TEXTURE_2D_ARRAY?r.texImage3D(Fe,0,r.RGBA,1,1,He,0,r.RGBA,r.UNSIGNED_BYTE,Me):r.texImage2D(Fe+qe,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,Me);return ge}const ae={};ae[r.TEXTURE_2D]=re(r.TEXTURE_2D,r.TEXTURE_2D,1),ae[r.TEXTURE_CUBE_MAP]=re(r.TEXTURE_CUBE_MAP,r.TEXTURE_CUBE_MAP_POSITIVE_X,6),ae[r.TEXTURE_2D_ARRAY]=re(r.TEXTURE_2D_ARRAY,r.TEXTURE_2D_ARRAY,1,1),ae[r.TEXTURE_3D]=re(r.TEXTURE_3D,r.TEXTURE_3D,1,1),s.setClear(0,0,0,1),a.setClear(1),o.setClear(0),oe(r.DEPTH_TEST),a.setFunc(Cr),$(!1),pe(rc),oe(r.CULL_FACE),O(wi);function oe(H){h[H]!==!0&&(r.enable(H),h[H]=!0)}function Ee(H){h[H]!==!1&&(r.disable(H),h[H]=!1)}function _e(H,Fe){return u[H]!==Fe?(r.bindFramebuffer(H,Fe),u[H]=Fe,H===r.DRAW_FRAMEBUFFER&&(u[r.FRAMEBUFFER]=Fe),H===r.FRAMEBUFFER&&(u[r.DRAW_FRAMEBUFFER]=Fe),!0):!1}function we(H,Fe){let ve=f,He=!1;if(H){ve=d.get(Fe),ve===void 0&&(ve=[],d.set(Fe,ve));const Me=H.textures;if(ve.length!==Me.length||ve[0]!==r.COLOR_ATTACHMENT0){for(let ge=0,qe=Me.length;ge<qe;ge++)ve[ge]=r.COLOR_ATTACHMENT0+ge;ve.length=Me.length,He=!0}}else ve[0]!==r.BACK&&(ve[0]=r.BACK,He=!0);He&&r.drawBuffers(ve)}function ke(H){return m!==H?(r.useProgram(H),m=H,!0):!1}const tt={[Vi]:r.FUNC_ADD,[$d]:r.FUNC_SUBTRACT,[Jd]:r.FUNC_REVERSE_SUBTRACT};tt[Kd]=r.MIN,tt[Zd]=r.MAX;const Qe={[Qd]:r.ZERO,[ef]:r.ONE,[tf]:r.SRC_COLOR,[wo]:r.SRC_ALPHA,[lf]:r.SRC_ALPHA_SATURATE,[af]:r.DST_COLOR,[rf]:r.DST_ALPHA,[nf]:r.ONE_MINUS_SRC_COLOR,[To]:r.ONE_MINUS_SRC_ALPHA,[of]:r.ONE_MINUS_DST_COLOR,[sf]:r.ONE_MINUS_DST_ALPHA,[cf]:r.CONSTANT_COLOR,[hf]:r.ONE_MINUS_CONSTANT_COLOR,[uf]:r.CONSTANT_ALPHA,[df]:r.ONE_MINUS_CONSTANT_ALPHA};function O(H,Fe,ve,He,Me,ge,qe,ht,Dt,pt){if(H===wi){_===!0&&(Ee(r.BLEND),_=!1);return}if(_===!1&&(oe(r.BLEND),_=!0),H!==Yd){if(H!==g||pt!==b){if((p!==Vi||v!==Vi)&&(r.blendEquation(r.FUNC_ADD),p=Vi,v=Vi),pt)switch(H){case Ar:r.blendFuncSeparate(r.ONE,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case sc:r.blendFunc(r.ONE,r.ONE);break;case ac:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case oc:r.blendFuncSeparate(r.ZERO,r.SRC_COLOR,r.ZERO,r.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",H);break}else switch(H){case Ar:r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case sc:r.blendFunc(r.SRC_ALPHA,r.ONE);break;case ac:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case oc:r.blendFunc(r.ZERO,r.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",H);break}S=null,E=null,N=null,C=null,T.set(0,0,0),P=0,g=H,b=pt}return}Me=Me||Fe,ge=ge||ve,qe=qe||He,(Fe!==p||Me!==v)&&(r.blendEquationSeparate(tt[Fe],tt[Me]),p=Fe,v=Me),(ve!==S||He!==E||ge!==N||qe!==C)&&(r.blendFuncSeparate(Qe[ve],Qe[He],Qe[ge],Qe[qe]),S=ve,E=He,N=ge,C=qe),(ht.equals(T)===!1||Dt!==P)&&(r.blendColor(ht.r,ht.g,ht.b,Dt),T.copy(ht),P=Dt),g=H,b=!1}function bt(H,Fe){H.side===pn?Ee(r.CULL_FACE):oe(r.CULL_FACE);let ve=H.side===vn;Fe&&(ve=!ve),$(ve),H.blending===Ar&&H.transparent===!1?O(wi):O(H.blending,H.blendEquation,H.blendSrc,H.blendDst,H.blendEquationAlpha,H.blendSrcAlpha,H.blendDstAlpha,H.blendColor,H.blendAlpha,H.premultipliedAlpha),a.setFunc(H.depthFunc),a.setTest(H.depthTest),a.setMask(H.depthWrite),s.setMask(H.colorWrite);const He=H.stencilWrite;o.setTest(He),He&&(o.setMask(H.stencilWriteMask),o.setFunc(H.stencilFunc,H.stencilRef,H.stencilFuncMask),o.setOp(H.stencilFail,H.stencilZFail,H.stencilZPass)),Se(H.polygonOffset,H.polygonOffsetFactor,H.polygonOffsetUnits),H.alphaToCoverage===!0?oe(r.SAMPLE_ALPHA_TO_COVERAGE):Ee(r.SAMPLE_ALPHA_TO_COVERAGE)}function $(H){x!==H&&(H?r.frontFace(r.CW):r.frontFace(r.CCW),x=H)}function pe(H){H!==qd?(oe(r.CULL_FACE),H!==R&&(H===rc?r.cullFace(r.BACK):H===jd?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK))):Ee(r.CULL_FACE),R=H}function te(H){H!==B&&(k&&r.lineWidth(H),B=H)}function Se(H,Fe,ve){H?(oe(r.POLYGON_OFFSET_FILL),(V!==Fe||W!==ve)&&(r.polygonOffset(Fe,ve),V=Fe,W=ve)):Ee(r.POLYGON_OFFSET_FILL)}function he(H){H?oe(r.SCISSOR_TEST):Ee(r.SCISSOR_TEST)}function ce(H){H===void 0&&(H=r.TEXTURE0+ee-1),ue!==H&&(r.activeTexture(H),ue=H)}function Ue(H,Fe,ve){ve===void 0&&(ue===null?ve=r.TEXTURE0+ee-1:ve=ue);let He=ye[ve];He===void 0&&(He={type:void 0,texture:void 0},ye[ve]=He),(He.type!==H||He.texture!==Fe)&&(ue!==ve&&(r.activeTexture(ve),ue=ve),r.bindTexture(H,Fe||ae[H]),He.type=H,He.texture=Fe)}function U(){const H=ye[ue];H!==void 0&&H.type!==void 0&&(r.bindTexture(H.type,null),H.type=void 0,H.texture=void 0)}function A(){try{r.compressedTexImage2D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function G(){try{r.compressedTexImage3D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function z(){try{r.texSubImage2D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function se(){try{r.texSubImage3D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function ne(){try{r.compressedTexSubImage2D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function Ce(){try{r.compressedTexSubImage3D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function Ae(){try{r.texStorage2D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function Be(){try{r.texStorage3D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function Ve(){try{r.texImage2D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function me(){try{r.texImage3D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function De(H){Te.equals(H)===!1&&(r.scissor(H.x,H.y,H.z,H.w),Te.copy(H))}function Je(H){Y.equals(H)===!1&&(r.viewport(H.x,H.y,H.z,H.w),Y.copy(H))}function nt(H,Fe){let ve=c.get(Fe);ve===void 0&&(ve=new WeakMap,c.set(Fe,ve));let He=ve.get(H);He===void 0&&(He=r.getUniformBlockIndex(Fe,H.name),ve.set(H,He))}function Pe(H,Fe){const He=c.get(Fe).get(H);l.get(Fe)!==He&&(r.uniformBlockBinding(Fe,He,H.__bindingPointIndex),l.set(Fe,He))}function ct(){r.disable(r.BLEND),r.disable(r.CULL_FACE),r.disable(r.DEPTH_TEST),r.disable(r.POLYGON_OFFSET_FILL),r.disable(r.SCISSOR_TEST),r.disable(r.STENCIL_TEST),r.disable(r.SAMPLE_ALPHA_TO_COVERAGE),r.blendEquation(r.FUNC_ADD),r.blendFunc(r.ONE,r.ZERO),r.blendFuncSeparate(r.ONE,r.ZERO,r.ONE,r.ZERO),r.blendColor(0,0,0,0),r.colorMask(!0,!0,!0,!0),r.clearColor(0,0,0,0),r.depthMask(!0),r.depthFunc(r.LESS),a.setReversed(!1),r.clearDepth(1),r.stencilMask(4294967295),r.stencilFunc(r.ALWAYS,0,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.KEEP),r.clearStencil(0),r.cullFace(r.BACK),r.frontFace(r.CCW),r.polygonOffset(0,0),r.activeTexture(r.TEXTURE0),r.bindFramebuffer(r.FRAMEBUFFER,null),r.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),r.bindFramebuffer(r.READ_FRAMEBUFFER,null),r.useProgram(null),r.lineWidth(1),r.scissor(0,0,r.canvas.width,r.canvas.height),r.viewport(0,0,r.canvas.width,r.canvas.height),h={},ue=null,ye={},u={},d=new WeakMap,f=[],m=null,_=!1,g=null,p=null,S=null,E=null,v=null,N=null,C=null,T=new st(0,0,0),P=0,b=!1,x=null,R=null,B=null,V=null,W=null,Te.set(0,0,r.canvas.width,r.canvas.height),Y.set(0,0,r.canvas.width,r.canvas.height),s.reset(),a.reset(),o.reset()}return{buffers:{color:s,depth:a,stencil:o},enable:oe,disable:Ee,bindFramebuffer:_e,drawBuffers:we,useProgram:ke,setBlending:O,setMaterial:bt,setFlipSided:$,setCullFace:pe,setLineWidth:te,setPolygonOffset:Se,setScissorTest:he,activeTexture:ce,bindTexture:Ue,unbindTexture:U,compressedTexImage2D:A,compressedTexImage3D:G,texImage2D:Ve,texImage3D:me,updateUBOMapping:nt,uniformBlockBinding:Pe,texStorage2D:Ae,texStorage3D:Be,texSubImage2D:z,texSubImage3D:se,compressedTexSubImage2D:ne,compressedTexSubImage3D:Ce,scissor:De,viewport:Je,reset:ct}}function $g(r,e,t,n,i,s,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 Ge,h=new WeakMap;let u;const d=new WeakMap;let f=!1;try{f=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function m(U,A){return f?new OffscreenCanvas(U,A):os("canvas")}function _(U,A,G){let z=1;const se=Ue(U);if((se.width>G||se.height>G)&&(z=G/Math.max(se.width,se.height)),z<1)if(typeof HTMLImageElement<"u"&&U instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&U instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&U instanceof ImageBitmap||typeof VideoFrame<"u"&&U instanceof VideoFrame){const ne=Math.floor(z*se.width),Ce=Math.floor(z*se.height);u===void 0&&(u=m(ne,Ce));const Ae=A?m(ne,Ce):u;return Ae.width=ne,Ae.height=Ce,Ae.getContext("2d").drawImage(U,0,0,ne,Ce),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+se.width+"x"+se.height+") to ("+ne+"x"+Ce+")."),Ae}else return"data"in U&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+se.width+"x"+se.height+")."),U;return U}function g(U){return U.generateMipmaps}function p(U){r.generateMipmap(U)}function S(U){return U.isWebGLCubeRenderTarget?r.TEXTURE_CUBE_MAP:U.isWebGL3DRenderTarget?r.TEXTURE_3D:U.isWebGLArrayRenderTarget||U.isCompressedArrayTexture?r.TEXTURE_2D_ARRAY:r.TEXTURE_2D}function E(U,A,G,z,se=!1){if(U!==null){if(r[U]!==void 0)return r[U];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+U+"'")}let ne=A;if(A===r.RED&&(G===r.FLOAT&&(ne=r.R32F),G===r.HALF_FLOAT&&(ne=r.R16F),G===r.UNSIGNED_BYTE&&(ne=r.R8)),A===r.RED_INTEGER&&(G===r.UNSIGNED_BYTE&&(ne=r.R8UI),G===r.UNSIGNED_SHORT&&(ne=r.R16UI),G===r.UNSIGNED_INT&&(ne=r.R32UI),G===r.BYTE&&(ne=r.R8I),G===r.SHORT&&(ne=r.R16I),G===r.INT&&(ne=r.R32I)),A===r.RG&&(G===r.FLOAT&&(ne=r.RG32F),G===r.HALF_FLOAT&&(ne=r.RG16F),G===r.UNSIGNED_BYTE&&(ne=r.RG8)),A===r.RG_INTEGER&&(G===r.UNSIGNED_BYTE&&(ne=r.RG8UI),G===r.UNSIGNED_SHORT&&(ne=r.RG16UI),G===r.UNSIGNED_INT&&(ne=r.RG32UI),G===r.BYTE&&(ne=r.RG8I),G===r.SHORT&&(ne=r.RG16I),G===r.INT&&(ne=r.RG32I)),A===r.RGB_INTEGER&&(G===r.UNSIGNED_BYTE&&(ne=r.RGB8UI),G===r.UNSIGNED_SHORT&&(ne=r.RGB16UI),G===r.UNSIGNED_INT&&(ne=r.RGB32UI),G===r.BYTE&&(ne=r.RGB8I),G===r.SHORT&&(ne=r.RGB16I),G===r.INT&&(ne=r.RGB32I)),A===r.RGBA_INTEGER&&(G===r.UNSIGNED_BYTE&&(ne=r.RGBA8UI),G===r.UNSIGNED_SHORT&&(ne=r.RGBA16UI),G===r.UNSIGNED_INT&&(ne=r.RGBA32UI),G===r.BYTE&&(ne=r.RGBA8I),G===r.SHORT&&(ne=r.RGBA16I),G===r.INT&&(ne=r.RGBA32I)),A===r.RGB&&G===r.UNSIGNED_INT_5_9_9_9_REV&&(ne=r.RGB9_E5),A===r.RGBA){const Ce=se?pa:xt.getTransfer(z);G===r.FLOAT&&(ne=r.RGBA32F),G===r.HALF_FLOAT&&(ne=r.RGBA16F),G===r.UNSIGNED_BYTE&&(ne=Ce===Nt?r.SRGB8_ALPHA8:r.RGBA8),G===r.UNSIGNED_SHORT_4_4_4_4&&(ne=r.RGBA4),G===r.UNSIGNED_SHORT_5_5_5_1&&(ne=r.RGB5_A1)}return(ne===r.R16F||ne===r.R32F||ne===r.RG16F||ne===r.RG32F||ne===r.RGBA16F||ne===r.RGBA32F)&&e.get("EXT_color_buffer_float"),ne}function v(U,A){let G;return U?A===null||A===qi||A===rs?G=r.DEPTH24_STENCIL8:A===Jn?G=r.DEPTH32F_STENCIL8:A===is&&(G=r.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):A===null||A===qi||A===rs?G=r.DEPTH_COMPONENT24:A===Jn?G=r.DEPTH_COMPONENT32F:A===is&&(G=r.DEPTH_COMPONENT16),G}function N(U,A){return g(U)===!0||U.isFramebufferTexture&&U.minFilter!==Cn&&U.minFilter!==Tn?Math.log2(Math.max(A.width,A.height))+1:U.mipmaps!==void 0&&U.mipmaps.length>0?U.mipmaps.length:U.isCompressedTexture&&Array.isArray(U.image)?A.mipmaps.length:1}function C(U){const A=U.target;A.removeEventListener("dispose",C),P(A),A.isVideoTexture&&h.delete(A)}function T(U){const A=U.target;A.removeEventListener("dispose",T),x(A)}function P(U){const A=n.get(U);if(A.__webglInit===void 0)return;const G=U.source,z=d.get(G);if(z){const se=z[A.__cacheKey];se.usedTimes--,se.usedTimes===0&&b(U),Object.keys(z).length===0&&d.delete(G)}n.remove(U)}function b(U){const A=n.get(U);r.deleteTexture(A.__webglTexture);const G=U.source,z=d.get(G);delete z[A.__cacheKey],a.memory.textures--}function x(U){const A=n.get(U);if(U.depthTexture&&(U.depthTexture.dispose(),n.remove(U.depthTexture)),U.isWebGLCubeRenderTarget)for(let z=0;z<6;z++){if(Array.isArray(A.__webglFramebuffer[z]))for(let se=0;se<A.__webglFramebuffer[z].length;se++)r.deleteFramebuffer(A.__webglFramebuffer[z][se]);else r.deleteFramebuffer(A.__webglFramebuffer[z]);A.__webglDepthbuffer&&r.deleteRenderbuffer(A.__webglDepthbuffer[z])}else{if(Array.isArray(A.__webglFramebuffer))for(let z=0;z<A.__webglFramebuffer.length;z++)r.deleteFramebuffer(A.__webglFramebuffer[z]);else r.deleteFramebuffer(A.__webglFramebuffer);if(A.__webglDepthbuffer&&r.deleteRenderbuffer(A.__webglDepthbuffer),A.__webglMultisampledFramebuffer&&r.deleteFramebuffer(A.__webglMultisampledFramebuffer),A.__webglColorRenderbuffer)for(let z=0;z<A.__webglColorRenderbuffer.length;z++)A.__webglColorRenderbuffer[z]&&r.deleteRenderbuffer(A.__webglColorRenderbuffer[z]);A.__webglDepthRenderbuffer&&r.deleteRenderbuffer(A.__webglDepthRenderbuffer)}const G=U.textures;for(let z=0,se=G.length;z<se;z++){const ne=n.get(G[z]);ne.__webglTexture&&(r.deleteTexture(ne.__webglTexture),a.memory.textures--),n.remove(G[z])}n.remove(U)}let R=0;function B(){R=0}function V(){const U=R;return U>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+U+" texture units while this GPU supports only "+i.maxTextures),R+=1,U}function W(U){const A=[];return A.push(U.wrapS),A.push(U.wrapT),A.push(U.wrapR||0),A.push(U.magFilter),A.push(U.minFilter),A.push(U.anisotropy),A.push(U.internalFormat),A.push(U.format),A.push(U.type),A.push(U.generateMipmaps),A.push(U.premultiplyAlpha),A.push(U.flipY),A.push(U.unpackAlignment),A.push(U.colorSpace),A.join()}function ee(U,A){const G=n.get(U);if(U.isVideoTexture&&he(U),U.isRenderTargetTexture===!1&&U.version>0&&G.__version!==U.version){const z=U.image;if(z===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(z.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{ae(G,U,A);return}}t.bindTexture(r.TEXTURE_2D,G.__webglTexture,r.TEXTURE0+A)}function k(U,A){const G=n.get(U);if(U.version>0&&G.__version!==U.version){ae(G,U,A);return}t.bindTexture(r.TEXTURE_2D_ARRAY,G.__webglTexture,r.TEXTURE0+A)}function Q(U,A){const G=n.get(U);if(U.version>0&&G.__version!==U.version){ae(G,U,A);return}t.bindTexture(r.TEXTURE_3D,G.__webglTexture,r.TEXTURE0+A)}function q(U,A){const G=n.get(U);if(U.version>0&&G.__version!==U.version){oe(G,U,A);return}t.bindTexture(r.TEXTURE_CUBE_MAP,G.__webglTexture,r.TEXTURE0+A)}const ue={[$n]:r.REPEAT,[kn]:r.CLAMP_TO_EDGE,[Oo]:r.MIRRORED_REPEAT},ye={[Cn]:r.NEAREST,[bf]:r.NEAREST_MIPMAP_NEAREST,[gs]:r.NEAREST_MIPMAP_LINEAR,[Tn]:r.LINEAR,[Pa]:r.LINEAR_MIPMAP_NEAREST,[ui]:r.LINEAR_MIPMAP_LINEAR},le={[Tf]:r.NEVER,[If]:r.ALWAYS,[Cf]:r.LESS,[vu]:r.LEQUAL,[Rf]:r.EQUAL,[Pf]:r.GEQUAL,[Df]:r.GREATER,[Lf]:r.NOTEQUAL};function Le(U,A){if(A.type===Jn&&e.has("OES_texture_float_linear")===!1&&(A.magFilter===Tn||A.magFilter===Pa||A.magFilter===gs||A.magFilter===ui||A.minFilter===Tn||A.minFilter===Pa||A.minFilter===gs||A.minFilter===ui)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),r.texParameteri(U,r.TEXTURE_WRAP_S,ue[A.wrapS]),r.texParameteri(U,r.TEXTURE_WRAP_T,ue[A.wrapT]),(U===r.TEXTURE_3D||U===r.TEXTURE_2D_ARRAY)&&r.texParameteri(U,r.TEXTURE_WRAP_R,ue[A.wrapR]),r.texParameteri(U,r.TEXTURE_MAG_FILTER,ye[A.magFilter]),r.texParameteri(U,r.TEXTURE_MIN_FILTER,ye[A.minFilter]),A.compareFunction&&(r.texParameteri(U,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(U,r.TEXTURE_COMPARE_FUNC,le[A.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(A.magFilter===Cn||A.minFilter!==gs&&A.minFilter!==ui||A.type===Jn&&e.has("OES_texture_float_linear")===!1)return;if(A.anisotropy>1||n.get(A).__currentAnisotropy){const G=e.get("EXT_texture_filter_anisotropic");r.texParameterf(U,G.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(A.anisotropy,i.getMaxAnisotropy())),n.get(A).__currentAnisotropy=A.anisotropy}}}function Te(U,A){let G=!1;U.__webglInit===void 0&&(U.__webglInit=!0,A.addEventListener("dispose",C));const z=A.source;let se=d.get(z);se===void 0&&(se={},d.set(z,se));const ne=W(A);if(ne!==U.__cacheKey){se[ne]===void 0&&(se[ne]={texture:r.createTexture(),usedTimes:0},a.memory.textures++,G=!0),se[ne].usedTimes++;const Ce=se[U.__cacheKey];Ce!==void 0&&(se[U.__cacheKey].usedTimes--,Ce.usedTimes===0&&b(A)),U.__cacheKey=ne,U.__webglTexture=se[ne].texture}return G}function Y(U,A,G){return Math.floor(Math.floor(U/G)/A)}function re(U,A,G,z){const ne=U.updateRanges;if(ne.length===0)t.texSubImage2D(r.TEXTURE_2D,0,0,0,A.width,A.height,G,z,A.data);else{ne.sort((me,De)=>me.start-De.start);let Ce=0;for(let me=1;me<ne.length;me++){const De=ne[Ce],Je=ne[me],nt=De.start+De.count,Pe=Y(Je.start,A.width,4),ct=Y(De.start,A.width,4);Je.start<=nt+1&&Pe===ct&&Y(Je.start+Je.count-1,A.width,4)===Pe?De.count=Math.max(De.count,Je.start+Je.count-De.start):(++Ce,ne[Ce]=Je)}ne.length=Ce+1;const Ae=r.getParameter(r.UNPACK_ROW_LENGTH),Be=r.getParameter(r.UNPACK_SKIP_PIXELS),Ve=r.getParameter(r.UNPACK_SKIP_ROWS);r.pixelStorei(r.UNPACK_ROW_LENGTH,A.width);for(let me=0,De=ne.length;me<De;me++){const Je=ne[me],nt=Math.floor(Je.start/4),Pe=Math.ceil(Je.count/4),ct=nt%A.width,H=Math.floor(nt/A.width),Fe=Pe,ve=1;r.pixelStorei(r.UNPACK_SKIP_PIXELS,ct),r.pixelStorei(r.UNPACK_SKIP_ROWS,H),t.texSubImage2D(r.TEXTURE_2D,0,ct,H,Fe,ve,G,z,A.data)}U.clearUpdateRanges(),r.pixelStorei(r.UNPACK_ROW_LENGTH,Ae),r.pixelStorei(r.UNPACK_SKIP_PIXELS,Be),r.pixelStorei(r.UNPACK_SKIP_ROWS,Ve)}}function ae(U,A,G){let z=r.TEXTURE_2D;(A.isDataArrayTexture||A.isCompressedArrayTexture)&&(z=r.TEXTURE_2D_ARRAY),A.isData3DTexture&&(z=r.TEXTURE_3D);const se=Te(U,A),ne=A.source;t.bindTexture(z,U.__webglTexture,r.TEXTURE0+G);const Ce=n.get(ne);if(ne.version!==Ce.__version||se===!0){t.activeTexture(r.TEXTURE0+G);const Ae=xt.getPrimaries(xt.workingColorSpace),Be=A.colorSpace===Ai?null:xt.getPrimaries(A.colorSpace),Ve=A.colorSpace===Ai||Ae===Be?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,A.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,A.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,A.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ve);let me=_(A.image,!1,i.maxTextureSize);me=ce(A,me);const De=s.convert(A.format,A.colorSpace),Je=s.convert(A.type);let nt=E(A.internalFormat,De,Je,A.colorSpace,A.isVideoTexture);Le(z,A);let Pe;const ct=A.mipmaps,H=A.isVideoTexture!==!0,Fe=Ce.__version===void 0||se===!0,ve=ne.dataReady,He=N(A,me);if(A.isDepthTexture)nt=v(A.format===as,A.type),Fe&&(H?t.texStorage2D(r.TEXTURE_2D,1,nt,me.width,me.height):t.texImage2D(r.TEXTURE_2D,0,nt,me.width,me.height,0,De,Je,null));else if(A.isDataTexture)if(ct.length>0){H&&Fe&&t.texStorage2D(r.TEXTURE_2D,He,nt,ct[0].width,ct[0].height);for(let Me=0,ge=ct.length;Me<ge;Me++)Pe=ct[Me],H?ve&&t.texSubImage2D(r.TEXTURE_2D,Me,0,0,Pe.width,Pe.height,De,Je,Pe.data):t.texImage2D(r.TEXTURE_2D,Me,nt,Pe.width,Pe.height,0,De,Je,Pe.data);A.generateMipmaps=!1}else H?(Fe&&t.texStorage2D(r.TEXTURE_2D,He,nt,me.width,me.height),ve&&re(A,me,De,Je)):t.texImage2D(r.TEXTURE_2D,0,nt,me.width,me.height,0,De,Je,me.data);else if(A.isCompressedTexture)if(A.isCompressedArrayTexture){H&&Fe&&t.texStorage3D(r.TEXTURE_2D_ARRAY,He,nt,ct[0].width,ct[0].height,me.depth);for(let Me=0,ge=ct.length;Me<ge;Me++)if(Pe=ct[Me],A.format!==Un)if(De!==null)if(H){if(ve)if(A.layerUpdates.size>0){const qe=rh(Pe.width,Pe.height,A.format,A.type);for(const ht of A.layerUpdates){const Dt=Pe.data.subarray(ht*qe/Pe.data.BYTES_PER_ELEMENT,(ht+1)*qe/Pe.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,Me,0,0,ht,Pe.width,Pe.height,1,De,Dt)}A.clearLayerUpdates()}else t.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,Me,0,0,0,Pe.width,Pe.height,me.depth,De,Pe.data)}else t.compressedTexImage3D(r.TEXTURE_2D_ARRAY,Me,nt,Pe.width,Pe.height,me.depth,0,Pe.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else H?ve&&t.texSubImage3D(r.TEXTURE_2D_ARRAY,Me,0,0,0,Pe.width,Pe.height,me.depth,De,Je,Pe.data):t.texImage3D(r.TEXTURE_2D_ARRAY,Me,nt,Pe.width,Pe.height,me.depth,0,De,Je,Pe.data)}else{H&&Fe&&t.texStorage2D(r.TEXTURE_2D,He,nt,ct[0].width,ct[0].height);for(let Me=0,ge=ct.length;Me<ge;Me++)Pe=ct[Me],A.format!==Un?De!==null?H?ve&&t.compressedTexSubImage2D(r.TEXTURE_2D,Me,0,0,Pe.width,Pe.height,De,Pe.data):t.compressedTexImage2D(r.TEXTURE_2D,Me,nt,Pe.width,Pe.height,0,Pe.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):H?ve&&t.texSubImage2D(r.TEXTURE_2D,Me,0,0,Pe.width,Pe.height,De,Je,Pe.data):t.texImage2D(r.TEXTURE_2D,Me,nt,Pe.width,Pe.height,0,De,Je,Pe.data)}else if(A.isDataArrayTexture)if(H){if(Fe&&t.texStorage3D(r.TEXTURE_2D_ARRAY,He,nt,me.width,me.height,me.depth),ve)if(A.layerUpdates.size>0){const Me=rh(me.width,me.height,A.format,A.type);for(const ge of A.layerUpdates){const qe=me.data.subarray(ge*Me/me.data.BYTES_PER_ELEMENT,(ge+1)*Me/me.data.BYTES_PER_ELEMENT);t.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,ge,me.width,me.height,1,De,Je,qe)}A.clearLayerUpdates()}else t.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,0,me.width,me.height,me.depth,De,Je,me.data)}else t.texImage3D(r.TEXTURE_2D_ARRAY,0,nt,me.width,me.height,me.depth,0,De,Je,me.data);else if(A.isData3DTexture)H?(Fe&&t.texStorage3D(r.TEXTURE_3D,He,nt,me.width,me.height,me.depth),ve&&t.texSubImage3D(r.TEXTURE_3D,0,0,0,0,me.width,me.height,me.depth,De,Je,me.data)):t.texImage3D(r.TEXTURE_3D,0,nt,me.width,me.height,me.depth,0,De,Je,me.data);else if(A.isFramebufferTexture){if(Fe)if(H)t.texStorage2D(r.TEXTURE_2D,He,nt,me.width,me.height);else{let Me=me.width,ge=me.height;for(let qe=0;qe<He;qe++)t.texImage2D(r.TEXTURE_2D,qe,nt,Me,ge,0,De,Je,null),Me>>=1,ge>>=1}}else if(ct.length>0){if(H&&Fe){const Me=Ue(ct[0]);t.texStorage2D(r.TEXTURE_2D,He,nt,Me.width,Me.height)}for(let Me=0,ge=ct.length;Me<ge;Me++)Pe=ct[Me],H?ve&&t.texSubImage2D(r.TEXTURE_2D,Me,0,0,De,Je,Pe):t.texImage2D(r.TEXTURE_2D,Me,nt,De,Je,Pe);A.generateMipmaps=!1}else if(H){if(Fe){const Me=Ue(me);t.texStorage2D(r.TEXTURE_2D,He,nt,Me.width,Me.height)}ve&&t.texSubImage2D(r.TEXTURE_2D,0,0,0,De,Je,me)}else t.texImage2D(r.TEXTURE_2D,0,nt,De,Je,me);g(A)&&p(z),Ce.__version=ne.version,A.onUpdate&&A.onUpdate(A)}U.__version=A.version}function oe(U,A,G){if(A.image.length!==6)return;const z=Te(U,A),se=A.source;t.bindTexture(r.TEXTURE_CUBE_MAP,U.__webglTexture,r.TEXTURE0+G);const ne=n.get(se);if(se.version!==ne.__version||z===!0){t.activeTexture(r.TEXTURE0+G);const Ce=xt.getPrimaries(xt.workingColorSpace),Ae=A.colorSpace===Ai?null:xt.getPrimaries(A.colorSpace),Be=A.colorSpace===Ai||Ce===Ae?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,A.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,A.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,A.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,Be);const Ve=A.isCompressedTexture||A.image[0].isCompressedTexture,me=A.image[0]&&A.image[0].isDataTexture,De=[];for(let ge=0;ge<6;ge++)!Ve&&!me?De[ge]=_(A.image[ge],!0,i.maxCubemapSize):De[ge]=me?A.image[ge].image:A.image[ge],De[ge]=ce(A,De[ge]);const Je=De[0],nt=s.convert(A.format,A.colorSpace),Pe=s.convert(A.type),ct=E(A.internalFormat,nt,Pe,A.colorSpace),H=A.isVideoTexture!==!0,Fe=ne.__version===void 0||z===!0,ve=se.dataReady;let He=N(A,Je);Le(r.TEXTURE_CUBE_MAP,A);let Me;if(Ve){H&&Fe&&t.texStorage2D(r.TEXTURE_CUBE_MAP,He,ct,Je.width,Je.height);for(let ge=0;ge<6;ge++){Me=De[ge].mipmaps;for(let qe=0;qe<Me.length;qe++){const ht=Me[qe];A.format!==Un?nt!==null?H?ve&&t.compressedTexSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,qe,0,0,ht.width,ht.height,nt,ht.data):t.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,qe,ct,ht.width,ht.height,0,ht.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):H?ve&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,qe,0,0,ht.width,ht.height,nt,Pe,ht.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,qe,ct,ht.width,ht.height,0,nt,Pe,ht.data)}}}else{if(Me=A.mipmaps,H&&Fe){Me.length>0&&He++;const ge=Ue(De[0]);t.texStorage2D(r.TEXTURE_CUBE_MAP,He,ct,ge.width,ge.height)}for(let ge=0;ge<6;ge++)if(me){H?ve&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,0,0,0,De[ge].width,De[ge].height,nt,Pe,De[ge].data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,0,ct,De[ge].width,De[ge].height,0,nt,Pe,De[ge].data);for(let qe=0;qe<Me.length;qe++){const Dt=Me[qe].image[ge].image;H?ve&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,qe+1,0,0,Dt.width,Dt.height,nt,Pe,Dt.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,qe+1,ct,Dt.width,Dt.height,0,nt,Pe,Dt.data)}}else{H?ve&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,0,0,0,nt,Pe,De[ge]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,0,ct,nt,Pe,De[ge]);for(let qe=0;qe<Me.length;qe++){const ht=Me[qe];H?ve&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,qe+1,0,0,nt,Pe,ht.image[ge]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,qe+1,ct,nt,Pe,ht.image[ge])}}}g(A)&&p(r.TEXTURE_CUBE_MAP),ne.__version=se.version,A.onUpdate&&A.onUpdate(A)}U.__version=A.version}function Ee(U,A,G,z,se,ne){const Ce=s.convert(G.format,G.colorSpace),Ae=s.convert(G.type),Be=E(G.internalFormat,Ce,Ae,G.colorSpace),Ve=n.get(A),me=n.get(G);if(me.__renderTarget=A,!Ve.__hasExternalTextures){const De=Math.max(1,A.width>>ne),Je=Math.max(1,A.height>>ne);se===r.TEXTURE_3D||se===r.TEXTURE_2D_ARRAY?t.texImage3D(se,ne,Be,De,Je,A.depth,0,Ce,Ae,null):t.texImage2D(se,ne,Be,De,Je,0,Ce,Ae,null)}t.bindFramebuffer(r.FRAMEBUFFER,U),Se(A)?o.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,z,se,me.__webglTexture,0,te(A)):(se===r.TEXTURE_2D||se>=r.TEXTURE_CUBE_MAP_POSITIVE_X&&se<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,z,se,me.__webglTexture,ne),t.bindFramebuffer(r.FRAMEBUFFER,null)}function _e(U,A,G){if(r.bindRenderbuffer(r.RENDERBUFFER,U),A.depthBuffer){const z=A.depthTexture,se=z&&z.isDepthTexture?z.type:null,ne=v(A.stencilBuffer,se),Ce=A.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Ae=te(A);Se(A)?o.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Ae,ne,A.width,A.height):G?r.renderbufferStorageMultisample(r.RENDERBUFFER,Ae,ne,A.width,A.height):r.renderbufferStorage(r.RENDERBUFFER,ne,A.width,A.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,Ce,r.RENDERBUFFER,U)}else{const z=A.textures;for(let se=0;se<z.length;se++){const ne=z[se],Ce=s.convert(ne.format,ne.colorSpace),Ae=s.convert(ne.type),Be=E(ne.internalFormat,Ce,Ae,ne.colorSpace),Ve=te(A);G&&Se(A)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,Ve,Be,A.width,A.height):Se(A)?o.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Ve,Be,A.width,A.height):r.renderbufferStorage(r.RENDERBUFFER,Be,A.width,A.height)}}r.bindRenderbuffer(r.RENDERBUFFER,null)}function we(U,A){if(A&&A.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(r.FRAMEBUFFER,U),!(A.depthTexture&&A.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const z=n.get(A.depthTexture);z.__renderTarget=A,(!z.__webglTexture||A.depthTexture.image.width!==A.width||A.depthTexture.image.height!==A.height)&&(A.depthTexture.image.width=A.width,A.depthTexture.image.height=A.height,A.depthTexture.needsUpdate=!0),ee(A.depthTexture,0);const se=z.__webglTexture,ne=te(A);if(A.depthTexture.format===ss)Se(A)?o.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,se,0,ne):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,se,0);else if(A.depthTexture.format===as)Se(A)?o.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,se,0,ne):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,se,0);else throw new Error("Unknown depthTexture format")}function ke(U){const A=n.get(U),G=U.isWebGLCubeRenderTarget===!0;if(A.__boundDepthTexture!==U.depthTexture){const z=U.depthTexture;if(A.__depthDisposeCallback&&A.__depthDisposeCallback(),z){const se=()=>{delete A.__boundDepthTexture,delete A.__depthDisposeCallback,z.removeEventListener("dispose",se)};z.addEventListener("dispose",se),A.__depthDisposeCallback=se}A.__boundDepthTexture=z}if(U.depthTexture&&!A.__autoAllocateDepthBuffer){if(G)throw new Error("target.depthTexture not supported in Cube render targets");const z=U.texture.mipmaps;z&&z.length>0?we(A.__webglFramebuffer[0],U):we(A.__webglFramebuffer,U)}else if(G){A.__webglDepthbuffer=[];for(let z=0;z<6;z++)if(t.bindFramebuffer(r.FRAMEBUFFER,A.__webglFramebuffer[z]),A.__webglDepthbuffer[z]===void 0)A.__webglDepthbuffer[z]=r.createRenderbuffer(),_e(A.__webglDepthbuffer[z],U,!1);else{const se=U.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,ne=A.__webglDepthbuffer[z];r.bindRenderbuffer(r.RENDERBUFFER,ne),r.framebufferRenderbuffer(r.FRAMEBUFFER,se,r.RENDERBUFFER,ne)}}else{const z=U.texture.mipmaps;if(z&&z.length>0?t.bindFramebuffer(r.FRAMEBUFFER,A.__webglFramebuffer[0]):t.bindFramebuffer(r.FRAMEBUFFER,A.__webglFramebuffer),A.__webglDepthbuffer===void 0)A.__webglDepthbuffer=r.createRenderbuffer(),_e(A.__webglDepthbuffer,U,!1);else{const se=U.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,ne=A.__webglDepthbuffer;r.bindRenderbuffer(r.RENDERBUFFER,ne),r.framebufferRenderbuffer(r.FRAMEBUFFER,se,r.RENDERBUFFER,ne)}}t.bindFramebuffer(r.FRAMEBUFFER,null)}function tt(U,A,G){const z=n.get(U);A!==void 0&&Ee(z.__webglFramebuffer,U,U.texture,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,0),G!==void 0&&ke(U)}function Qe(U){const A=U.texture,G=n.get(U),z=n.get(A);U.addEventListener("dispose",T);const se=U.textures,ne=U.isWebGLCubeRenderTarget===!0,Ce=se.length>1;if(Ce||(z.__webglTexture===void 0&&(z.__webglTexture=r.createTexture()),z.__version=A.version,a.memory.textures++),ne){G.__webglFramebuffer=[];for(let Ae=0;Ae<6;Ae++)if(A.mipmaps&&A.mipmaps.length>0){G.__webglFramebuffer[Ae]=[];for(let Be=0;Be<A.mipmaps.length;Be++)G.__webglFramebuffer[Ae][Be]=r.createFramebuffer()}else G.__webglFramebuffer[Ae]=r.createFramebuffer()}else{if(A.mipmaps&&A.mipmaps.length>0){G.__webglFramebuffer=[];for(let Ae=0;Ae<A.mipmaps.length;Ae++)G.__webglFramebuffer[Ae]=r.createFramebuffer()}else G.__webglFramebuffer=r.createFramebuffer();if(Ce)for(let Ae=0,Be=se.length;Ae<Be;Ae++){const Ve=n.get(se[Ae]);Ve.__webglTexture===void 0&&(Ve.__webglTexture=r.createTexture(),a.memory.textures++)}if(U.samples>0&&Se(U)===!1){G.__webglMultisampledFramebuffer=r.createFramebuffer(),G.__webglColorRenderbuffer=[],t.bindFramebuffer(r.FRAMEBUFFER,G.__webglMultisampledFramebuffer);for(let Ae=0;Ae<se.length;Ae++){const Be=se[Ae];G.__webglColorRenderbuffer[Ae]=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,G.__webglColorRenderbuffer[Ae]);const Ve=s.convert(Be.format,Be.colorSpace),me=s.convert(Be.type),De=E(Be.internalFormat,Ve,me,Be.colorSpace,U.isXRRenderTarget===!0),Je=te(U);r.renderbufferStorageMultisample(r.RENDERBUFFER,Je,De,U.width,U.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ae,r.RENDERBUFFER,G.__webglColorRenderbuffer[Ae])}r.bindRenderbuffer(r.RENDERBUFFER,null),U.depthBuffer&&(G.__webglDepthRenderbuffer=r.createRenderbuffer(),_e(G.__webglDepthRenderbuffer,U,!0)),t.bindFramebuffer(r.FRAMEBUFFER,null)}}if(ne){t.bindTexture(r.TEXTURE_CUBE_MAP,z.__webglTexture),Le(r.TEXTURE_CUBE_MAP,A);for(let Ae=0;Ae<6;Ae++)if(A.mipmaps&&A.mipmaps.length>0)for(let Be=0;Be<A.mipmaps.length;Be++)Ee(G.__webglFramebuffer[Ae][Be],U,A,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+Ae,Be);else Ee(G.__webglFramebuffer[Ae],U,A,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+Ae,0);g(A)&&p(r.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(Ce){for(let Ae=0,Be=se.length;Ae<Be;Ae++){const Ve=se[Ae],me=n.get(Ve);t.bindTexture(r.TEXTURE_2D,me.__webglTexture),Le(r.TEXTURE_2D,Ve),Ee(G.__webglFramebuffer,U,Ve,r.COLOR_ATTACHMENT0+Ae,r.TEXTURE_2D,0),g(Ve)&&p(r.TEXTURE_2D)}t.unbindTexture()}else{let Ae=r.TEXTURE_2D;if((U.isWebGL3DRenderTarget||U.isWebGLArrayRenderTarget)&&(Ae=U.isWebGL3DRenderTarget?r.TEXTURE_3D:r.TEXTURE_2D_ARRAY),t.bindTexture(Ae,z.__webglTexture),Le(Ae,A),A.mipmaps&&A.mipmaps.length>0)for(let Be=0;Be<A.mipmaps.length;Be++)Ee(G.__webglFramebuffer[Be],U,A,r.COLOR_ATTACHMENT0,Ae,Be);else Ee(G.__webglFramebuffer,U,A,r.COLOR_ATTACHMENT0,Ae,0);g(A)&&p(Ae),t.unbindTexture()}U.depthBuffer&&ke(U)}function O(U){const A=U.textures;for(let G=0,z=A.length;G<z;G++){const se=A[G];if(g(se)){const ne=S(U),Ce=n.get(se).__webglTexture;t.bindTexture(ne,Ce),p(ne),t.unbindTexture()}}}const bt=[],$=[];function pe(U){if(U.samples>0){if(Se(U)===!1){const A=U.textures,G=U.width,z=U.height;let se=r.COLOR_BUFFER_BIT;const ne=U.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Ce=n.get(U),Ae=A.length>1;if(Ae)for(let Ve=0;Ve<A.length;Ve++)t.bindFramebuffer(r.FRAMEBUFFER,Ce.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ve,r.RENDERBUFFER,null),t.bindFramebuffer(r.FRAMEBUFFER,Ce.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ve,r.TEXTURE_2D,null,0);t.bindFramebuffer(r.READ_FRAMEBUFFER,Ce.__webglMultisampledFramebuffer);const Be=U.texture.mipmaps;Be&&Be.length>0?t.bindFramebuffer(r.DRAW_FRAMEBUFFER,Ce.__webglFramebuffer[0]):t.bindFramebuffer(r.DRAW_FRAMEBUFFER,Ce.__webglFramebuffer);for(let Ve=0;Ve<A.length;Ve++){if(U.resolveDepthBuffer&&(U.depthBuffer&&(se|=r.DEPTH_BUFFER_BIT),U.stencilBuffer&&U.resolveStencilBuffer&&(se|=r.STENCIL_BUFFER_BIT)),Ae){r.framebufferRenderbuffer(r.READ_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,Ce.__webglColorRenderbuffer[Ve]);const me=n.get(A[Ve]).__webglTexture;r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,me,0)}r.blitFramebuffer(0,0,G,z,0,0,G,z,se,r.NEAREST),l===!0&&(bt.length=0,$.length=0,bt.push(r.COLOR_ATTACHMENT0+Ve),U.depthBuffer&&U.resolveDepthBuffer===!1&&(bt.push(ne),$.push(ne),r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,$)),r.invalidateFramebuffer(r.READ_FRAMEBUFFER,bt))}if(t.bindFramebuffer(r.READ_FRAMEBUFFER,null),t.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),Ae)for(let Ve=0;Ve<A.length;Ve++){t.bindFramebuffer(r.FRAMEBUFFER,Ce.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ve,r.RENDERBUFFER,Ce.__webglColorRenderbuffer[Ve]);const me=n.get(A[Ve]).__webglTexture;t.bindFramebuffer(r.FRAMEBUFFER,Ce.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ve,r.TEXTURE_2D,me,0)}t.bindFramebuffer(r.DRAW_FRAMEBUFFER,Ce.__webglMultisampledFramebuffer)}else if(U.depthBuffer&&U.resolveDepthBuffer===!1&&l){const A=U.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT;r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,[A])}}}function te(U){return Math.min(i.maxSamples,U.samples)}function Se(U){const A=n.get(U);return U.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&A.__useRenderToTexture!==!1}function he(U){const A=a.render.frame;h.get(U)!==A&&(h.set(U,A),U.update())}function ce(U,A){const G=U.colorSpace,z=U.format,se=U.type;return U.isCompressedTexture===!0||U.isVideoTexture===!0||G!==Lr&&G!==Ai&&(xt.getTransfer(G)===Nt?(z!==Un||se!==Qn)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",G)),A}function Ue(U){return typeof HTMLImageElement<"u"&&U instanceof HTMLImageElement?(c.width=U.naturalWidth||U.width,c.height=U.naturalHeight||U.height):typeof VideoFrame<"u"&&U instanceof VideoFrame?(c.width=U.displayWidth,c.height=U.displayHeight):(c.width=U.width,c.height=U.height),c}this.allocateTextureUnit=V,this.resetTextureUnits=B,this.setTexture2D=ee,this.setTexture2DArray=k,this.setTexture3D=Q,this.setTextureCube=q,this.rebindTextures=tt,this.setupRenderTarget=Qe,this.updateRenderTargetMipmap=O,this.updateMultisampleRenderTarget=pe,this.setupDepthRenderbuffer=ke,this.setupFrameBufferTexture=Ee,this.useMultisampledRTT=Se}function Jg(r,e){function t(n,i=Ai){let s;const a=xt.getTransfer(i);if(n===Qn)return r.UNSIGNED_BYTE;if(n===Cl)return r.UNSIGNED_SHORT_4_4_4_4;if(n===Rl)return r.UNSIGNED_SHORT_5_5_5_1;if(n===du)return r.UNSIGNED_INT_5_9_9_9_REV;if(n===hu)return r.BYTE;if(n===uu)return r.SHORT;if(n===is)return r.UNSIGNED_SHORT;if(n===Tl)return r.INT;if(n===qi)return r.UNSIGNED_INT;if(n===Jn)return r.FLOAT;if(n===hs)return r.HALF_FLOAT;if(n===fu)return r.ALPHA;if(n===pu)return r.RGB;if(n===Un)return r.RGBA;if(n===ss)return r.DEPTH_COMPONENT;if(n===as)return r.DEPTH_STENCIL;if(n===mu)return r.RED;if(n===Dl)return r.RED_INTEGER;if(n===gu)return r.RG;if(n===Ll)return r.RG_INTEGER;if(n===Pl)return r.RGBA_INTEGER;if(n===ra||n===sa||n===aa||n===oa)if(a===Nt)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(n===ra)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===sa)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===aa)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===oa)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(n===ra)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===sa)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===aa)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===oa)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===zo||n===Bo||n===ko||n===Vo)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(n===zo)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===Bo)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===ko)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Vo)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===Ho||n===Go||n===Wo)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(n===Ho||n===Go)return a===Nt?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===Wo)return a===Nt?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===Xo||n===qo||n===jo||n===Yo||n===$o||n===Jo||n===Ko||n===Zo||n===Qo||n===el||n===tl||n===nl||n===il||n===rl)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(n===Xo)return a===Nt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===qo)return a===Nt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===jo)return a===Nt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===Yo)return a===Nt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===$o)return a===Nt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===Jo)return a===Nt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===Ko)return a===Nt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===Zo)return a===Nt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===Qo)return a===Nt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===el)return a===Nt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===tl)return a===Nt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===nl)return a===Nt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===il)return a===Nt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===rl)return a===Nt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===la||n===sl||n===al)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(n===la)return a===Nt?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===sl)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===al)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===_u||n===ol||n===ll||n===cl)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(n===la)return s.COMPRESSED_RED_RGTC1_EXT;if(n===ol)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===ll)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===cl)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===rs?r.UNSIGNED_INT_24_8:r[n]!==void 0?r[n]:null}return{convert:t}}const Kg=`
|
|
3803
|
+
}`;function qg(r,e,t){let n=new kl;const i=new Ge,s=new Ge,a=new Mt,o=new Kp({depthPacking:Af}),l=new Jp,c={},h=t.maxTextureSize,u={[Hn]:vn,[vn]:Hn,[pn]:pn},d=new pi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ge},radius:{value:4}},vertexShader:Wg,fragmentShader:Xg}),f=d.clone();f.defines.HORIZONTAL_PASS=1;const m=new Bt;m.setAttribute("position",new Gt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new Ct(m,d),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=au;let p=this.type;this.render=function(C,T,L){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||C.length===0)return;const b=r.getRenderTarget(),x=r.getActiveCubeFace(),R=r.getActiveMipmapLevel(),B=r.state;B.setBlending(wi),B.buffers.color.setClear(1,1,1,1),B.buffers.depth.setTest(!0),B.setScissorTest(!1);const V=p!==hi&&this.type===hi,W=p===hi&&this.type!==hi;for(let ee=0,k=C.length;ee<k;ee++){const Q=C[ee],q=Q.shadow;if(q===void 0){console.warn("THREE.WebGLShadowMap:",Q,"has no shadow.");continue}if(q.autoUpdate===!1&&q.needsUpdate===!1)continue;i.copy(q.mapSize);const de=q.getFrameExtents();if(i.multiply(de),s.copy(q.mapSize),(i.x>h||i.y>h)&&(i.x>h&&(s.x=Math.floor(h/de.x),i.x=s.x*de.x,q.mapSize.x=s.x),i.y>h&&(s.y=Math.floor(h/de.y),i.y=s.y*de.y,q.mapSize.y=s.y)),q.map===null||V===!0||W===!0){const le=this.type!==hi?{minFilter:Rn,magFilter:Rn}:{};q.map!==null&&q.map.dispose(),q.map=new ji(i.x,i.y,le),q.map.texture.name=Q.name+".shadowMap",q.camera.updateProjectionMatrix()}r.setRenderTarget(q.map),r.clear();const ye=q.getViewportCount();for(let le=0;le<ye;le++){const Pe=q.getViewport(le);a.set(s.x*Pe.x,s.y*Pe.y,s.x*Pe.z,s.y*Pe.w),B.viewport(a),q.updateMatrices(Q,le),n=q.getFrustum(),v(T,L,q.camera,Q,this.type)}q.isPointLightShadow!==!0&&this.type===hi&&S(q,L),q.needsUpdate=!1}p=this.type,g.needsUpdate=!1,r.setRenderTarget(b,x,R)};function S(C,T){const L=e.update(_);d.defines.VSM_SAMPLES!==C.blurSamples&&(d.defines.VSM_SAMPLES=C.blurSamples,f.defines.VSM_SAMPLES=C.blurSamples,d.needsUpdate=!0,f.needsUpdate=!0),C.mapPass===null&&(C.mapPass=new ji(i.x,i.y)),d.uniforms.shadow_pass.value=C.map.texture,d.uniforms.resolution.value=C.mapSize,d.uniforms.radius.value=C.radius,r.setRenderTarget(C.mapPass),r.clear(),r.renderBufferDirect(T,null,L,d,_,null),f.uniforms.shadow_pass.value=C.mapPass.texture,f.uniforms.resolution.value=C.mapSize,f.uniforms.radius.value=C.radius,r.setRenderTarget(C.map),r.clear(),r.renderBufferDirect(T,null,L,f,_,null)}function E(C,T,L,b){let x=null;const R=L.isPointLight===!0?C.customDistanceMaterial:C.customDepthMaterial;if(R!==void 0)x=R;else if(x=L.isPointLight===!0?l:o,r.localClippingEnabled&&T.clipShadows===!0&&Array.isArray(T.clippingPlanes)&&T.clippingPlanes.length!==0||T.displacementMap&&T.displacementScale!==0||T.alphaMap&&T.alphaTest>0||T.map&&T.alphaTest>0||T.alphaToCoverage===!0){const B=x.uuid,V=T.uuid;let W=c[B];W===void 0&&(W={},c[B]=W);let ee=W[V];ee===void 0&&(ee=x.clone(),W[V]=ee,T.addEventListener("dispose",N)),x=ee}if(x.visible=T.visible,x.wireframe=T.wireframe,b===hi?x.side=T.shadowSide!==null?T.shadowSide:T.side:x.side=T.shadowSide!==null?T.shadowSide:u[T.side],x.alphaMap=T.alphaMap,x.alphaTest=T.alphaToCoverage===!0?.5:T.alphaTest,x.map=T.map,x.clipShadows=T.clipShadows,x.clippingPlanes=T.clippingPlanes,x.clipIntersection=T.clipIntersection,x.displacementMap=T.displacementMap,x.displacementScale=T.displacementScale,x.displacementBias=T.displacementBias,x.wireframeLinewidth=T.wireframeLinewidth,x.linewidth=T.linewidth,L.isPointLight===!0&&x.isMeshDistanceMaterial===!0){const B=r.properties.get(x);B.light=L}return x}function v(C,T,L,b,x){if(C.visible===!1)return;if(C.layers.test(T.layers)&&(C.isMesh||C.isLine||C.isPoints)&&(C.castShadow||C.receiveShadow&&x===hi)&&(!C.frustumCulled||n.intersectsObject(C))){C.modelViewMatrix.multiplyMatrices(L.matrixWorldInverse,C.matrixWorld);const V=e.update(C),W=C.material;if(Array.isArray(W)){const ee=V.groups;for(let k=0,Q=ee.length;k<Q;k++){const q=ee[k],de=W[q.materialIndex];if(de&&de.visible){const ye=E(C,de,b,x);C.onBeforeShadow(r,C,T,L,V,ye,q),r.renderBufferDirect(L,null,V,ye,C,q),C.onAfterShadow(r,C,T,L,V,ye,q)}}}else if(W.visible){const ee=E(C,W,b,x);C.onBeforeShadow(r,C,T,L,V,ee,null),r.renderBufferDirect(L,null,V,ee,C,null),C.onAfterShadow(r,C,T,L,V,ee,null)}}const B=C.children;for(let V=0,W=B.length;V<W;V++)v(B[V],T,L,b,x)}function N(C){C.target.removeEventListener("dispose",N);for(const L in c){const b=c[L],x=C.target.uuid;x in b&&(b[x].dispose(),delete b[x])}}}const jg={[Ro]:Do,[Po]:No,[Lo]:Uo,[Cr]:Io,[Do]:Ro,[No]:Po,[Uo]:Lo,[Io]:Cr};function Yg(r,e){function t(){let H=!1;const Fe=new Mt;let ve=null;const He=new Mt(0,0,0,0);return{setMask:function(Me){ve!==Me&&!H&&(r.colorMask(Me,Me,Me,Me),ve=Me)},setLocked:function(Me){H=Me},setClear:function(Me,ge,qe,ht,Dt){Dt===!0&&(Me*=ht,ge*=ht,qe*=ht),Fe.set(Me,ge,qe,ht),He.equals(Fe)===!1&&(r.clearColor(Me,ge,qe,ht),He.copy(Fe))},reset:function(){H=!1,ve=null,He.set(-1,0,0,0)}}}function n(){let H=!1,Fe=!1,ve=null,He=null,Me=null;return{setReversed:function(ge){if(Fe!==ge){const qe=e.get("EXT_clip_control");ge?qe.clipControlEXT(qe.LOWER_LEFT_EXT,qe.ZERO_TO_ONE_EXT):qe.clipControlEXT(qe.LOWER_LEFT_EXT,qe.NEGATIVE_ONE_TO_ONE_EXT),Fe=ge;const ht=Me;Me=null,this.setClear(ht)}},getReversed:function(){return Fe},setTest:function(ge){ge?oe(r.DEPTH_TEST):Ee(r.DEPTH_TEST)},setMask:function(ge){ve!==ge&&!H&&(r.depthMask(ge),ve=ge)},setFunc:function(ge){if(Fe&&(ge=jg[ge]),He!==ge){switch(ge){case Ro:r.depthFunc(r.NEVER);break;case Do:r.depthFunc(r.ALWAYS);break;case Po:r.depthFunc(r.LESS);break;case Cr:r.depthFunc(r.LEQUAL);break;case Lo:r.depthFunc(r.EQUAL);break;case Io:r.depthFunc(r.GEQUAL);break;case No:r.depthFunc(r.GREATER);break;case Uo:r.depthFunc(r.NOTEQUAL);break;default:r.depthFunc(r.LEQUAL)}He=ge}},setLocked:function(ge){H=ge},setClear:function(ge){Me!==ge&&(Fe&&(ge=1-ge),r.clearDepth(ge),Me=ge)},reset:function(){H=!1,ve=null,He=null,Me=null,Fe=!1}}}function i(){let H=!1,Fe=null,ve=null,He=null,Me=null,ge=null,qe=null,ht=null,Dt=null;return{setTest:function(pt){H||(pt?oe(r.STENCIL_TEST):Ee(r.STENCIL_TEST))},setMask:function(pt){Fe!==pt&&!H&&(r.stencilMask(pt),Fe=pt)},setFunc:function(pt,en,je){(ve!==pt||He!==en||Me!==je)&&(r.stencilFunc(pt,en,je),ve=pt,He=en,Me=je)},setOp:function(pt,en,je){(ge!==pt||qe!==en||ht!==je)&&(r.stencilOp(pt,en,je),ge=pt,qe=en,ht=je)},setLocked:function(pt){H=pt},setClear:function(pt){Dt!==pt&&(r.clearStencil(pt),Dt=pt)},reset:function(){H=!1,Fe=null,ve=null,He=null,Me=null,ge=null,qe=null,ht=null,Dt=null}}}const s=new t,a=new n,o=new i,l=new WeakMap,c=new WeakMap;let h={},u={},d=new WeakMap,f=[],m=null,_=!1,g=null,p=null,S=null,E=null,v=null,N=null,C=null,T=new st(0,0,0),L=0,b=!1,x=null,R=null,B=null,V=null,W=null;const ee=r.getParameter(r.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let k=!1,Q=0;const q=r.getParameter(r.VERSION);q.indexOf("WebGL")!==-1?(Q=parseFloat(/^WebGL (\d)/.exec(q)[1]),k=Q>=1):q.indexOf("OpenGL ES")!==-1&&(Q=parseFloat(/^OpenGL ES (\d)/.exec(q)[1]),k=Q>=2);let de=null,ye={};const le=r.getParameter(r.SCISSOR_BOX),Pe=r.getParameter(r.VIEWPORT),Te=new Mt().fromArray(le),Y=new Mt().fromArray(Pe);function re(H,Fe,ve,He){const Me=new Uint8Array(4),ge=r.createTexture();r.bindTexture(H,ge),r.texParameteri(H,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(H,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let qe=0;qe<ve;qe++)H===r.TEXTURE_3D||H===r.TEXTURE_2D_ARRAY?r.texImage3D(Fe,0,r.RGBA,1,1,He,0,r.RGBA,r.UNSIGNED_BYTE,Me):r.texImage2D(Fe+qe,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,Me);return ge}const ae={};ae[r.TEXTURE_2D]=re(r.TEXTURE_2D,r.TEXTURE_2D,1),ae[r.TEXTURE_CUBE_MAP]=re(r.TEXTURE_CUBE_MAP,r.TEXTURE_CUBE_MAP_POSITIVE_X,6),ae[r.TEXTURE_2D_ARRAY]=re(r.TEXTURE_2D_ARRAY,r.TEXTURE_2D_ARRAY,1,1),ae[r.TEXTURE_3D]=re(r.TEXTURE_3D,r.TEXTURE_3D,1,1),s.setClear(0,0,0,1),a.setClear(1),o.setClear(0),oe(r.DEPTH_TEST),a.setFunc(Cr),$(!1),pe(rc),oe(r.CULL_FACE),O(wi);function oe(H){h[H]!==!0&&(r.enable(H),h[H]=!0)}function Ee(H){h[H]!==!1&&(r.disable(H),h[H]=!1)}function _e(H,Fe){return u[H]!==Fe?(r.bindFramebuffer(H,Fe),u[H]=Fe,H===r.DRAW_FRAMEBUFFER&&(u[r.FRAMEBUFFER]=Fe),H===r.FRAMEBUFFER&&(u[r.DRAW_FRAMEBUFFER]=Fe),!0):!1}function we(H,Fe){let ve=f,He=!1;if(H){ve=d.get(Fe),ve===void 0&&(ve=[],d.set(Fe,ve));const Me=H.textures;if(ve.length!==Me.length||ve[0]!==r.COLOR_ATTACHMENT0){for(let ge=0,qe=Me.length;ge<qe;ge++)ve[ge]=r.COLOR_ATTACHMENT0+ge;ve.length=Me.length,He=!0}}else ve[0]!==r.BACK&&(ve[0]=r.BACK,He=!0);He&&r.drawBuffers(ve)}function ke(H){return m!==H?(r.useProgram(H),m=H,!0):!1}const tt={[Vi]:r.FUNC_ADD,[$d]:r.FUNC_SUBTRACT,[Kd]:r.FUNC_REVERSE_SUBTRACT};tt[Jd]=r.MIN,tt[Zd]=r.MAX;const Qe={[Qd]:r.ZERO,[ef]:r.ONE,[tf]:r.SRC_COLOR,[To]:r.SRC_ALPHA,[lf]:r.SRC_ALPHA_SATURATE,[af]:r.DST_COLOR,[rf]:r.DST_ALPHA,[nf]:r.ONE_MINUS_SRC_COLOR,[Co]:r.ONE_MINUS_SRC_ALPHA,[of]:r.ONE_MINUS_DST_COLOR,[sf]:r.ONE_MINUS_DST_ALPHA,[cf]:r.CONSTANT_COLOR,[hf]:r.ONE_MINUS_CONSTANT_COLOR,[uf]:r.CONSTANT_ALPHA,[df]:r.ONE_MINUS_CONSTANT_ALPHA};function O(H,Fe,ve,He,Me,ge,qe,ht,Dt,pt){if(H===wi){_===!0&&(Ee(r.BLEND),_=!1);return}if(_===!1&&(oe(r.BLEND),_=!0),H!==Yd){if(H!==g||pt!==b){if((p!==Vi||v!==Vi)&&(r.blendEquation(r.FUNC_ADD),p=Vi,v=Vi),pt)switch(H){case Ar:r.blendFuncSeparate(r.ONE,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case sc:r.blendFunc(r.ONE,r.ONE);break;case ac:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case oc:r.blendFuncSeparate(r.ZERO,r.SRC_COLOR,r.ZERO,r.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",H);break}else switch(H){case Ar:r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case sc:r.blendFunc(r.SRC_ALPHA,r.ONE);break;case ac:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case oc:r.blendFunc(r.ZERO,r.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",H);break}S=null,E=null,N=null,C=null,T.set(0,0,0),L=0,g=H,b=pt}return}Me=Me||Fe,ge=ge||ve,qe=qe||He,(Fe!==p||Me!==v)&&(r.blendEquationSeparate(tt[Fe],tt[Me]),p=Fe,v=Me),(ve!==S||He!==E||ge!==N||qe!==C)&&(r.blendFuncSeparate(Qe[ve],Qe[He],Qe[ge],Qe[qe]),S=ve,E=He,N=ge,C=qe),(ht.equals(T)===!1||Dt!==L)&&(r.blendColor(ht.r,ht.g,ht.b,Dt),T.copy(ht),L=Dt),g=H,b=!1}function bt(H,Fe){H.side===pn?Ee(r.CULL_FACE):oe(r.CULL_FACE);let ve=H.side===vn;Fe&&(ve=!ve),$(ve),H.blending===Ar&&H.transparent===!1?O(wi):O(H.blending,H.blendEquation,H.blendSrc,H.blendDst,H.blendEquationAlpha,H.blendSrcAlpha,H.blendDstAlpha,H.blendColor,H.blendAlpha,H.premultipliedAlpha),a.setFunc(H.depthFunc),a.setTest(H.depthTest),a.setMask(H.depthWrite),s.setMask(H.colorWrite);const He=H.stencilWrite;o.setTest(He),He&&(o.setMask(H.stencilWriteMask),o.setFunc(H.stencilFunc,H.stencilRef,H.stencilFuncMask),o.setOp(H.stencilFail,H.stencilZFail,H.stencilZPass)),Se(H.polygonOffset,H.polygonOffsetFactor,H.polygonOffsetUnits),H.alphaToCoverage===!0?oe(r.SAMPLE_ALPHA_TO_COVERAGE):Ee(r.SAMPLE_ALPHA_TO_COVERAGE)}function $(H){x!==H&&(H?r.frontFace(r.CW):r.frontFace(r.CCW),x=H)}function pe(H){H!==qd?(oe(r.CULL_FACE),H!==R&&(H===rc?r.cullFace(r.BACK):H===jd?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK))):Ee(r.CULL_FACE),R=H}function te(H){H!==B&&(k&&r.lineWidth(H),B=H)}function Se(H,Fe,ve){H?(oe(r.POLYGON_OFFSET_FILL),(V!==Fe||W!==ve)&&(r.polygonOffset(Fe,ve),V=Fe,W=ve)):Ee(r.POLYGON_OFFSET_FILL)}function he(H){H?oe(r.SCISSOR_TEST):Ee(r.SCISSOR_TEST)}function ce(H){H===void 0&&(H=r.TEXTURE0+ee-1),de!==H&&(r.activeTexture(H),de=H)}function Ue(H,Fe,ve){ve===void 0&&(de===null?ve=r.TEXTURE0+ee-1:ve=de);let He=ye[ve];He===void 0&&(He={type:void 0,texture:void 0},ye[ve]=He),(He.type!==H||He.texture!==Fe)&&(de!==ve&&(r.activeTexture(ve),de=ve),r.bindTexture(H,Fe||ae[H]),He.type=H,He.texture=Fe)}function U(){const H=ye[de];H!==void 0&&H.type!==void 0&&(r.bindTexture(H.type,null),H.type=void 0,H.texture=void 0)}function A(){try{r.compressedTexImage2D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function G(){try{r.compressedTexImage3D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function z(){try{r.texSubImage2D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function se(){try{r.texSubImage3D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function ne(){try{r.compressedTexSubImage2D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function Ce(){try{r.compressedTexSubImage3D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function Ae(){try{r.texStorage2D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function Be(){try{r.texStorage3D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function Ve(){try{r.texImage2D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function me(){try{r.texImage3D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function De(H){Te.equals(H)===!1&&(r.scissor(H.x,H.y,H.z,H.w),Te.copy(H))}function Ke(H){Y.equals(H)===!1&&(r.viewport(H.x,H.y,H.z,H.w),Y.copy(H))}function nt(H,Fe){let ve=c.get(Fe);ve===void 0&&(ve=new WeakMap,c.set(Fe,ve));let He=ve.get(H);He===void 0&&(He=r.getUniformBlockIndex(Fe,H.name),ve.set(H,He))}function Le(H,Fe){const He=c.get(Fe).get(H);l.get(Fe)!==He&&(r.uniformBlockBinding(Fe,He,H.__bindingPointIndex),l.set(Fe,He))}function ct(){r.disable(r.BLEND),r.disable(r.CULL_FACE),r.disable(r.DEPTH_TEST),r.disable(r.POLYGON_OFFSET_FILL),r.disable(r.SCISSOR_TEST),r.disable(r.STENCIL_TEST),r.disable(r.SAMPLE_ALPHA_TO_COVERAGE),r.blendEquation(r.FUNC_ADD),r.blendFunc(r.ONE,r.ZERO),r.blendFuncSeparate(r.ONE,r.ZERO,r.ONE,r.ZERO),r.blendColor(0,0,0,0),r.colorMask(!0,!0,!0,!0),r.clearColor(0,0,0,0),r.depthMask(!0),r.depthFunc(r.LESS),a.setReversed(!1),r.clearDepth(1),r.stencilMask(4294967295),r.stencilFunc(r.ALWAYS,0,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.KEEP),r.clearStencil(0),r.cullFace(r.BACK),r.frontFace(r.CCW),r.polygonOffset(0,0),r.activeTexture(r.TEXTURE0),r.bindFramebuffer(r.FRAMEBUFFER,null),r.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),r.bindFramebuffer(r.READ_FRAMEBUFFER,null),r.useProgram(null),r.lineWidth(1),r.scissor(0,0,r.canvas.width,r.canvas.height),r.viewport(0,0,r.canvas.width,r.canvas.height),h={},de=null,ye={},u={},d=new WeakMap,f=[],m=null,_=!1,g=null,p=null,S=null,E=null,v=null,N=null,C=null,T=new st(0,0,0),L=0,b=!1,x=null,R=null,B=null,V=null,W=null,Te.set(0,0,r.canvas.width,r.canvas.height),Y.set(0,0,r.canvas.width,r.canvas.height),s.reset(),a.reset(),o.reset()}return{buffers:{color:s,depth:a,stencil:o},enable:oe,disable:Ee,bindFramebuffer:_e,drawBuffers:we,useProgram:ke,setBlending:O,setMaterial:bt,setFlipSided:$,setCullFace:pe,setLineWidth:te,setPolygonOffset:Se,setScissorTest:he,activeTexture:ce,bindTexture:Ue,unbindTexture:U,compressedTexImage2D:A,compressedTexImage3D:G,texImage2D:Ve,texImage3D:me,updateUBOMapping:nt,uniformBlockBinding:Le,texStorage2D:Ae,texStorage3D:Be,texSubImage2D:z,texSubImage3D:se,compressedTexSubImage2D:ne,compressedTexSubImage3D:Ce,scissor:De,viewport:Ke,reset:ct}}function $g(r,e,t,n,i,s,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 Ge,h=new WeakMap;let u;const d=new WeakMap;let f=!1;try{f=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function m(U,A){return f?new OffscreenCanvas(U,A):os("canvas")}function _(U,A,G){let z=1;const se=Ue(U);if((se.width>G||se.height>G)&&(z=G/Math.max(se.width,se.height)),z<1)if(typeof HTMLImageElement<"u"&&U instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&U instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&U instanceof ImageBitmap||typeof VideoFrame<"u"&&U instanceof VideoFrame){const ne=Math.floor(z*se.width),Ce=Math.floor(z*se.height);u===void 0&&(u=m(ne,Ce));const Ae=A?m(ne,Ce):u;return Ae.width=ne,Ae.height=Ce,Ae.getContext("2d").drawImage(U,0,0,ne,Ce),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+se.width+"x"+se.height+") to ("+ne+"x"+Ce+")."),Ae}else return"data"in U&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+se.width+"x"+se.height+")."),U;return U}function g(U){return U.generateMipmaps}function p(U){r.generateMipmap(U)}function S(U){return U.isWebGLCubeRenderTarget?r.TEXTURE_CUBE_MAP:U.isWebGL3DRenderTarget?r.TEXTURE_3D:U.isWebGLArrayRenderTarget||U.isCompressedArrayTexture?r.TEXTURE_2D_ARRAY:r.TEXTURE_2D}function E(U,A,G,z,se=!1){if(U!==null){if(r[U]!==void 0)return r[U];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+U+"'")}let ne=A;if(A===r.RED&&(G===r.FLOAT&&(ne=r.R32F),G===r.HALF_FLOAT&&(ne=r.R16F),G===r.UNSIGNED_BYTE&&(ne=r.R8)),A===r.RED_INTEGER&&(G===r.UNSIGNED_BYTE&&(ne=r.R8UI),G===r.UNSIGNED_SHORT&&(ne=r.R16UI),G===r.UNSIGNED_INT&&(ne=r.R32UI),G===r.BYTE&&(ne=r.R8I),G===r.SHORT&&(ne=r.R16I),G===r.INT&&(ne=r.R32I)),A===r.RG&&(G===r.FLOAT&&(ne=r.RG32F),G===r.HALF_FLOAT&&(ne=r.RG16F),G===r.UNSIGNED_BYTE&&(ne=r.RG8)),A===r.RG_INTEGER&&(G===r.UNSIGNED_BYTE&&(ne=r.RG8UI),G===r.UNSIGNED_SHORT&&(ne=r.RG16UI),G===r.UNSIGNED_INT&&(ne=r.RG32UI),G===r.BYTE&&(ne=r.RG8I),G===r.SHORT&&(ne=r.RG16I),G===r.INT&&(ne=r.RG32I)),A===r.RGB_INTEGER&&(G===r.UNSIGNED_BYTE&&(ne=r.RGB8UI),G===r.UNSIGNED_SHORT&&(ne=r.RGB16UI),G===r.UNSIGNED_INT&&(ne=r.RGB32UI),G===r.BYTE&&(ne=r.RGB8I),G===r.SHORT&&(ne=r.RGB16I),G===r.INT&&(ne=r.RGB32I)),A===r.RGBA_INTEGER&&(G===r.UNSIGNED_BYTE&&(ne=r.RGBA8UI),G===r.UNSIGNED_SHORT&&(ne=r.RGBA16UI),G===r.UNSIGNED_INT&&(ne=r.RGBA32UI),G===r.BYTE&&(ne=r.RGBA8I),G===r.SHORT&&(ne=r.RGBA16I),G===r.INT&&(ne=r.RGBA32I)),A===r.RGB&&G===r.UNSIGNED_INT_5_9_9_9_REV&&(ne=r.RGB9_E5),A===r.RGBA){const Ce=se?pa:xt.getTransfer(z);G===r.FLOAT&&(ne=r.RGBA32F),G===r.HALF_FLOAT&&(ne=r.RGBA16F),G===r.UNSIGNED_BYTE&&(ne=Ce===Nt?r.SRGB8_ALPHA8:r.RGBA8),G===r.UNSIGNED_SHORT_4_4_4_4&&(ne=r.RGBA4),G===r.UNSIGNED_SHORT_5_5_5_1&&(ne=r.RGB5_A1)}return(ne===r.R16F||ne===r.R32F||ne===r.RG16F||ne===r.RG32F||ne===r.RGBA16F||ne===r.RGBA32F)&&e.get("EXT_color_buffer_float"),ne}function v(U,A){let G;return U?A===null||A===qi||A===rs?G=r.DEPTH24_STENCIL8:A===Kn?G=r.DEPTH32F_STENCIL8:A===is&&(G=r.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):A===null||A===qi||A===rs?G=r.DEPTH_COMPONENT24:A===Kn?G=r.DEPTH_COMPONENT32F:A===is&&(G=r.DEPTH_COMPONENT16),G}function N(U,A){return g(U)===!0||U.isFramebufferTexture&&U.minFilter!==Rn&&U.minFilter!==Cn?Math.log2(Math.max(A.width,A.height))+1:U.mipmaps!==void 0&&U.mipmaps.length>0?U.mipmaps.length:U.isCompressedTexture&&Array.isArray(U.image)?A.mipmaps.length:1}function C(U){const A=U.target;A.removeEventListener("dispose",C),L(A),A.isVideoTexture&&h.delete(A)}function T(U){const A=U.target;A.removeEventListener("dispose",T),x(A)}function L(U){const A=n.get(U);if(A.__webglInit===void 0)return;const G=U.source,z=d.get(G);if(z){const se=z[A.__cacheKey];se.usedTimes--,se.usedTimes===0&&b(U),Object.keys(z).length===0&&d.delete(G)}n.remove(U)}function b(U){const A=n.get(U);r.deleteTexture(A.__webglTexture);const G=U.source,z=d.get(G);delete z[A.__cacheKey],a.memory.textures--}function x(U){const A=n.get(U);if(U.depthTexture&&(U.depthTexture.dispose(),n.remove(U.depthTexture)),U.isWebGLCubeRenderTarget)for(let z=0;z<6;z++){if(Array.isArray(A.__webglFramebuffer[z]))for(let se=0;se<A.__webglFramebuffer[z].length;se++)r.deleteFramebuffer(A.__webglFramebuffer[z][se]);else r.deleteFramebuffer(A.__webglFramebuffer[z]);A.__webglDepthbuffer&&r.deleteRenderbuffer(A.__webglDepthbuffer[z])}else{if(Array.isArray(A.__webglFramebuffer))for(let z=0;z<A.__webglFramebuffer.length;z++)r.deleteFramebuffer(A.__webglFramebuffer[z]);else r.deleteFramebuffer(A.__webglFramebuffer);if(A.__webglDepthbuffer&&r.deleteRenderbuffer(A.__webglDepthbuffer),A.__webglMultisampledFramebuffer&&r.deleteFramebuffer(A.__webglMultisampledFramebuffer),A.__webglColorRenderbuffer)for(let z=0;z<A.__webglColorRenderbuffer.length;z++)A.__webglColorRenderbuffer[z]&&r.deleteRenderbuffer(A.__webglColorRenderbuffer[z]);A.__webglDepthRenderbuffer&&r.deleteRenderbuffer(A.__webglDepthRenderbuffer)}const G=U.textures;for(let z=0,se=G.length;z<se;z++){const ne=n.get(G[z]);ne.__webglTexture&&(r.deleteTexture(ne.__webglTexture),a.memory.textures--),n.remove(G[z])}n.remove(U)}let R=0;function B(){R=0}function V(){const U=R;return U>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+U+" texture units while this GPU supports only "+i.maxTextures),R+=1,U}function W(U){const A=[];return A.push(U.wrapS),A.push(U.wrapT),A.push(U.wrapR||0),A.push(U.magFilter),A.push(U.minFilter),A.push(U.anisotropy),A.push(U.internalFormat),A.push(U.format),A.push(U.type),A.push(U.generateMipmaps),A.push(U.premultiplyAlpha),A.push(U.flipY),A.push(U.unpackAlignment),A.push(U.colorSpace),A.join()}function ee(U,A){const G=n.get(U);if(U.isVideoTexture&&he(U),U.isRenderTargetTexture===!1&&U.version>0&&G.__version!==U.version){const z=U.image;if(z===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(z.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{ae(G,U,A);return}}t.bindTexture(r.TEXTURE_2D,G.__webglTexture,r.TEXTURE0+A)}function k(U,A){const G=n.get(U);if(U.version>0&&G.__version!==U.version){ae(G,U,A);return}t.bindTexture(r.TEXTURE_2D_ARRAY,G.__webglTexture,r.TEXTURE0+A)}function Q(U,A){const G=n.get(U);if(U.version>0&&G.__version!==U.version){ae(G,U,A);return}t.bindTexture(r.TEXTURE_3D,G.__webglTexture,r.TEXTURE0+A)}function q(U,A){const G=n.get(U);if(U.version>0&&G.__version!==U.version){oe(G,U,A);return}t.bindTexture(r.TEXTURE_CUBE_MAP,G.__webglTexture,r.TEXTURE0+A)}const de={[$n]:r.REPEAT,[kn]:r.CLAMP_TO_EDGE,[zo]:r.MIRRORED_REPEAT},ye={[Rn]:r.NEAREST,[bf]:r.NEAREST_MIPMAP_NEAREST,[gs]:r.NEAREST_MIPMAP_LINEAR,[Cn]:r.LINEAR,[Ia]:r.LINEAR_MIPMAP_NEAREST,[ui]:r.LINEAR_MIPMAP_LINEAR},le={[Tf]:r.NEVER,[If]:r.ALWAYS,[Cf]:r.LESS,[vu]:r.LEQUAL,[Rf]:r.EQUAL,[Lf]:r.GEQUAL,[Df]:r.GREATER,[Pf]:r.NOTEQUAL};function Pe(U,A){if(A.type===Kn&&e.has("OES_texture_float_linear")===!1&&(A.magFilter===Cn||A.magFilter===Ia||A.magFilter===gs||A.magFilter===ui||A.minFilter===Cn||A.minFilter===Ia||A.minFilter===gs||A.minFilter===ui)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),r.texParameteri(U,r.TEXTURE_WRAP_S,de[A.wrapS]),r.texParameteri(U,r.TEXTURE_WRAP_T,de[A.wrapT]),(U===r.TEXTURE_3D||U===r.TEXTURE_2D_ARRAY)&&r.texParameteri(U,r.TEXTURE_WRAP_R,de[A.wrapR]),r.texParameteri(U,r.TEXTURE_MAG_FILTER,ye[A.magFilter]),r.texParameteri(U,r.TEXTURE_MIN_FILTER,ye[A.minFilter]),A.compareFunction&&(r.texParameteri(U,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(U,r.TEXTURE_COMPARE_FUNC,le[A.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(A.magFilter===Rn||A.minFilter!==gs&&A.minFilter!==ui||A.type===Kn&&e.has("OES_texture_float_linear")===!1)return;if(A.anisotropy>1||n.get(A).__currentAnisotropy){const G=e.get("EXT_texture_filter_anisotropic");r.texParameterf(U,G.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(A.anisotropy,i.getMaxAnisotropy())),n.get(A).__currentAnisotropy=A.anisotropy}}}function Te(U,A){let G=!1;U.__webglInit===void 0&&(U.__webglInit=!0,A.addEventListener("dispose",C));const z=A.source;let se=d.get(z);se===void 0&&(se={},d.set(z,se));const ne=W(A);if(ne!==U.__cacheKey){se[ne]===void 0&&(se[ne]={texture:r.createTexture(),usedTimes:0},a.memory.textures++,G=!0),se[ne].usedTimes++;const Ce=se[U.__cacheKey];Ce!==void 0&&(se[U.__cacheKey].usedTimes--,Ce.usedTimes===0&&b(A)),U.__cacheKey=ne,U.__webglTexture=se[ne].texture}return G}function Y(U,A,G){return Math.floor(Math.floor(U/G)/A)}function re(U,A,G,z){const ne=U.updateRanges;if(ne.length===0)t.texSubImage2D(r.TEXTURE_2D,0,0,0,A.width,A.height,G,z,A.data);else{ne.sort((me,De)=>me.start-De.start);let Ce=0;for(let me=1;me<ne.length;me++){const De=ne[Ce],Ke=ne[me],nt=De.start+De.count,Le=Y(Ke.start,A.width,4),ct=Y(De.start,A.width,4);Ke.start<=nt+1&&Le===ct&&Y(Ke.start+Ke.count-1,A.width,4)===Le?De.count=Math.max(De.count,Ke.start+Ke.count-De.start):(++Ce,ne[Ce]=Ke)}ne.length=Ce+1;const Ae=r.getParameter(r.UNPACK_ROW_LENGTH),Be=r.getParameter(r.UNPACK_SKIP_PIXELS),Ve=r.getParameter(r.UNPACK_SKIP_ROWS);r.pixelStorei(r.UNPACK_ROW_LENGTH,A.width);for(let me=0,De=ne.length;me<De;me++){const Ke=ne[me],nt=Math.floor(Ke.start/4),Le=Math.ceil(Ke.count/4),ct=nt%A.width,H=Math.floor(nt/A.width),Fe=Le,ve=1;r.pixelStorei(r.UNPACK_SKIP_PIXELS,ct),r.pixelStorei(r.UNPACK_SKIP_ROWS,H),t.texSubImage2D(r.TEXTURE_2D,0,ct,H,Fe,ve,G,z,A.data)}U.clearUpdateRanges(),r.pixelStorei(r.UNPACK_ROW_LENGTH,Ae),r.pixelStorei(r.UNPACK_SKIP_PIXELS,Be),r.pixelStorei(r.UNPACK_SKIP_ROWS,Ve)}}function ae(U,A,G){let z=r.TEXTURE_2D;(A.isDataArrayTexture||A.isCompressedArrayTexture)&&(z=r.TEXTURE_2D_ARRAY),A.isData3DTexture&&(z=r.TEXTURE_3D);const se=Te(U,A),ne=A.source;t.bindTexture(z,U.__webglTexture,r.TEXTURE0+G);const Ce=n.get(ne);if(ne.version!==Ce.__version||se===!0){t.activeTexture(r.TEXTURE0+G);const Ae=xt.getPrimaries(xt.workingColorSpace),Be=A.colorSpace===Ai?null:xt.getPrimaries(A.colorSpace),Ve=A.colorSpace===Ai||Ae===Be?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,A.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,A.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,A.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ve);let me=_(A.image,!1,i.maxTextureSize);me=ce(A,me);const De=s.convert(A.format,A.colorSpace),Ke=s.convert(A.type);let nt=E(A.internalFormat,De,Ke,A.colorSpace,A.isVideoTexture);Pe(z,A);let Le;const ct=A.mipmaps,H=A.isVideoTexture!==!0,Fe=Ce.__version===void 0||se===!0,ve=ne.dataReady,He=N(A,me);if(A.isDepthTexture)nt=v(A.format===as,A.type),Fe&&(H?t.texStorage2D(r.TEXTURE_2D,1,nt,me.width,me.height):t.texImage2D(r.TEXTURE_2D,0,nt,me.width,me.height,0,De,Ke,null));else if(A.isDataTexture)if(ct.length>0){H&&Fe&&t.texStorage2D(r.TEXTURE_2D,He,nt,ct[0].width,ct[0].height);for(let Me=0,ge=ct.length;Me<ge;Me++)Le=ct[Me],H?ve&&t.texSubImage2D(r.TEXTURE_2D,Me,0,0,Le.width,Le.height,De,Ke,Le.data):t.texImage2D(r.TEXTURE_2D,Me,nt,Le.width,Le.height,0,De,Ke,Le.data);A.generateMipmaps=!1}else H?(Fe&&t.texStorage2D(r.TEXTURE_2D,He,nt,me.width,me.height),ve&&re(A,me,De,Ke)):t.texImage2D(r.TEXTURE_2D,0,nt,me.width,me.height,0,De,Ke,me.data);else if(A.isCompressedTexture)if(A.isCompressedArrayTexture){H&&Fe&&t.texStorage3D(r.TEXTURE_2D_ARRAY,He,nt,ct[0].width,ct[0].height,me.depth);for(let Me=0,ge=ct.length;Me<ge;Me++)if(Le=ct[Me],A.format!==Un)if(De!==null)if(H){if(ve)if(A.layerUpdates.size>0){const qe=rh(Le.width,Le.height,A.format,A.type);for(const ht of A.layerUpdates){const Dt=Le.data.subarray(ht*qe/Le.data.BYTES_PER_ELEMENT,(ht+1)*qe/Le.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,Me,0,0,ht,Le.width,Le.height,1,De,Dt)}A.clearLayerUpdates()}else t.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,Me,0,0,0,Le.width,Le.height,me.depth,De,Le.data)}else t.compressedTexImage3D(r.TEXTURE_2D_ARRAY,Me,nt,Le.width,Le.height,me.depth,0,Le.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else H?ve&&t.texSubImage3D(r.TEXTURE_2D_ARRAY,Me,0,0,0,Le.width,Le.height,me.depth,De,Ke,Le.data):t.texImage3D(r.TEXTURE_2D_ARRAY,Me,nt,Le.width,Le.height,me.depth,0,De,Ke,Le.data)}else{H&&Fe&&t.texStorage2D(r.TEXTURE_2D,He,nt,ct[0].width,ct[0].height);for(let Me=0,ge=ct.length;Me<ge;Me++)Le=ct[Me],A.format!==Un?De!==null?H?ve&&t.compressedTexSubImage2D(r.TEXTURE_2D,Me,0,0,Le.width,Le.height,De,Le.data):t.compressedTexImage2D(r.TEXTURE_2D,Me,nt,Le.width,Le.height,0,Le.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):H?ve&&t.texSubImage2D(r.TEXTURE_2D,Me,0,0,Le.width,Le.height,De,Ke,Le.data):t.texImage2D(r.TEXTURE_2D,Me,nt,Le.width,Le.height,0,De,Ke,Le.data)}else if(A.isDataArrayTexture)if(H){if(Fe&&t.texStorage3D(r.TEXTURE_2D_ARRAY,He,nt,me.width,me.height,me.depth),ve)if(A.layerUpdates.size>0){const Me=rh(me.width,me.height,A.format,A.type);for(const ge of A.layerUpdates){const qe=me.data.subarray(ge*Me/me.data.BYTES_PER_ELEMENT,(ge+1)*Me/me.data.BYTES_PER_ELEMENT);t.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,ge,me.width,me.height,1,De,Ke,qe)}A.clearLayerUpdates()}else t.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,0,me.width,me.height,me.depth,De,Ke,me.data)}else t.texImage3D(r.TEXTURE_2D_ARRAY,0,nt,me.width,me.height,me.depth,0,De,Ke,me.data);else if(A.isData3DTexture)H?(Fe&&t.texStorage3D(r.TEXTURE_3D,He,nt,me.width,me.height,me.depth),ve&&t.texSubImage3D(r.TEXTURE_3D,0,0,0,0,me.width,me.height,me.depth,De,Ke,me.data)):t.texImage3D(r.TEXTURE_3D,0,nt,me.width,me.height,me.depth,0,De,Ke,me.data);else if(A.isFramebufferTexture){if(Fe)if(H)t.texStorage2D(r.TEXTURE_2D,He,nt,me.width,me.height);else{let Me=me.width,ge=me.height;for(let qe=0;qe<He;qe++)t.texImage2D(r.TEXTURE_2D,qe,nt,Me,ge,0,De,Ke,null),Me>>=1,ge>>=1}}else if(ct.length>0){if(H&&Fe){const Me=Ue(ct[0]);t.texStorage2D(r.TEXTURE_2D,He,nt,Me.width,Me.height)}for(let Me=0,ge=ct.length;Me<ge;Me++)Le=ct[Me],H?ve&&t.texSubImage2D(r.TEXTURE_2D,Me,0,0,De,Ke,Le):t.texImage2D(r.TEXTURE_2D,Me,nt,De,Ke,Le);A.generateMipmaps=!1}else if(H){if(Fe){const Me=Ue(me);t.texStorage2D(r.TEXTURE_2D,He,nt,Me.width,Me.height)}ve&&t.texSubImage2D(r.TEXTURE_2D,0,0,0,De,Ke,me)}else t.texImage2D(r.TEXTURE_2D,0,nt,De,Ke,me);g(A)&&p(z),Ce.__version=ne.version,A.onUpdate&&A.onUpdate(A)}U.__version=A.version}function oe(U,A,G){if(A.image.length!==6)return;const z=Te(U,A),se=A.source;t.bindTexture(r.TEXTURE_CUBE_MAP,U.__webglTexture,r.TEXTURE0+G);const ne=n.get(se);if(se.version!==ne.__version||z===!0){t.activeTexture(r.TEXTURE0+G);const Ce=xt.getPrimaries(xt.workingColorSpace),Ae=A.colorSpace===Ai?null:xt.getPrimaries(A.colorSpace),Be=A.colorSpace===Ai||Ce===Ae?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,A.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,A.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,A.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,Be);const Ve=A.isCompressedTexture||A.image[0].isCompressedTexture,me=A.image[0]&&A.image[0].isDataTexture,De=[];for(let ge=0;ge<6;ge++)!Ve&&!me?De[ge]=_(A.image[ge],!0,i.maxCubemapSize):De[ge]=me?A.image[ge].image:A.image[ge],De[ge]=ce(A,De[ge]);const Ke=De[0],nt=s.convert(A.format,A.colorSpace),Le=s.convert(A.type),ct=E(A.internalFormat,nt,Le,A.colorSpace),H=A.isVideoTexture!==!0,Fe=ne.__version===void 0||z===!0,ve=se.dataReady;let He=N(A,Ke);Pe(r.TEXTURE_CUBE_MAP,A);let Me;if(Ve){H&&Fe&&t.texStorage2D(r.TEXTURE_CUBE_MAP,He,ct,Ke.width,Ke.height);for(let ge=0;ge<6;ge++){Me=De[ge].mipmaps;for(let qe=0;qe<Me.length;qe++){const ht=Me[qe];A.format!==Un?nt!==null?H?ve&&t.compressedTexSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,qe,0,0,ht.width,ht.height,nt,ht.data):t.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,qe,ct,ht.width,ht.height,0,ht.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):H?ve&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,qe,0,0,ht.width,ht.height,nt,Le,ht.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,qe,ct,ht.width,ht.height,0,nt,Le,ht.data)}}}else{if(Me=A.mipmaps,H&&Fe){Me.length>0&&He++;const ge=Ue(De[0]);t.texStorage2D(r.TEXTURE_CUBE_MAP,He,ct,ge.width,ge.height)}for(let ge=0;ge<6;ge++)if(me){H?ve&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,0,0,0,De[ge].width,De[ge].height,nt,Le,De[ge].data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,0,ct,De[ge].width,De[ge].height,0,nt,Le,De[ge].data);for(let qe=0;qe<Me.length;qe++){const Dt=Me[qe].image[ge].image;H?ve&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,qe+1,0,0,Dt.width,Dt.height,nt,Le,Dt.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,qe+1,ct,Dt.width,Dt.height,0,nt,Le,Dt.data)}}else{H?ve&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,0,0,0,nt,Le,De[ge]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,0,ct,nt,Le,De[ge]);for(let qe=0;qe<Me.length;qe++){const ht=Me[qe];H?ve&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,qe+1,0,0,nt,Le,ht.image[ge]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,qe+1,ct,nt,Le,ht.image[ge])}}}g(A)&&p(r.TEXTURE_CUBE_MAP),ne.__version=se.version,A.onUpdate&&A.onUpdate(A)}U.__version=A.version}function Ee(U,A,G,z,se,ne){const Ce=s.convert(G.format,G.colorSpace),Ae=s.convert(G.type),Be=E(G.internalFormat,Ce,Ae,G.colorSpace),Ve=n.get(A),me=n.get(G);if(me.__renderTarget=A,!Ve.__hasExternalTextures){const De=Math.max(1,A.width>>ne),Ke=Math.max(1,A.height>>ne);se===r.TEXTURE_3D||se===r.TEXTURE_2D_ARRAY?t.texImage3D(se,ne,Be,De,Ke,A.depth,0,Ce,Ae,null):t.texImage2D(se,ne,Be,De,Ke,0,Ce,Ae,null)}t.bindFramebuffer(r.FRAMEBUFFER,U),Se(A)?o.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,z,se,me.__webglTexture,0,te(A)):(se===r.TEXTURE_2D||se>=r.TEXTURE_CUBE_MAP_POSITIVE_X&&se<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,z,se,me.__webglTexture,ne),t.bindFramebuffer(r.FRAMEBUFFER,null)}function _e(U,A,G){if(r.bindRenderbuffer(r.RENDERBUFFER,U),A.depthBuffer){const z=A.depthTexture,se=z&&z.isDepthTexture?z.type:null,ne=v(A.stencilBuffer,se),Ce=A.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Ae=te(A);Se(A)?o.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Ae,ne,A.width,A.height):G?r.renderbufferStorageMultisample(r.RENDERBUFFER,Ae,ne,A.width,A.height):r.renderbufferStorage(r.RENDERBUFFER,ne,A.width,A.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,Ce,r.RENDERBUFFER,U)}else{const z=A.textures;for(let se=0;se<z.length;se++){const ne=z[se],Ce=s.convert(ne.format,ne.colorSpace),Ae=s.convert(ne.type),Be=E(ne.internalFormat,Ce,Ae,ne.colorSpace),Ve=te(A);G&&Se(A)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,Ve,Be,A.width,A.height):Se(A)?o.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Ve,Be,A.width,A.height):r.renderbufferStorage(r.RENDERBUFFER,Be,A.width,A.height)}}r.bindRenderbuffer(r.RENDERBUFFER,null)}function we(U,A){if(A&&A.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(r.FRAMEBUFFER,U),!(A.depthTexture&&A.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const z=n.get(A.depthTexture);z.__renderTarget=A,(!z.__webglTexture||A.depthTexture.image.width!==A.width||A.depthTexture.image.height!==A.height)&&(A.depthTexture.image.width=A.width,A.depthTexture.image.height=A.height,A.depthTexture.needsUpdate=!0),ee(A.depthTexture,0);const se=z.__webglTexture,ne=te(A);if(A.depthTexture.format===ss)Se(A)?o.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,se,0,ne):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,se,0);else if(A.depthTexture.format===as)Se(A)?o.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,se,0,ne):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,se,0);else throw new Error("Unknown depthTexture format")}function ke(U){const A=n.get(U),G=U.isWebGLCubeRenderTarget===!0;if(A.__boundDepthTexture!==U.depthTexture){const z=U.depthTexture;if(A.__depthDisposeCallback&&A.__depthDisposeCallback(),z){const se=()=>{delete A.__boundDepthTexture,delete A.__depthDisposeCallback,z.removeEventListener("dispose",se)};z.addEventListener("dispose",se),A.__depthDisposeCallback=se}A.__boundDepthTexture=z}if(U.depthTexture&&!A.__autoAllocateDepthBuffer){if(G)throw new Error("target.depthTexture not supported in Cube render targets");const z=U.texture.mipmaps;z&&z.length>0?we(A.__webglFramebuffer[0],U):we(A.__webglFramebuffer,U)}else if(G){A.__webglDepthbuffer=[];for(let z=0;z<6;z++)if(t.bindFramebuffer(r.FRAMEBUFFER,A.__webglFramebuffer[z]),A.__webglDepthbuffer[z]===void 0)A.__webglDepthbuffer[z]=r.createRenderbuffer(),_e(A.__webglDepthbuffer[z],U,!1);else{const se=U.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,ne=A.__webglDepthbuffer[z];r.bindRenderbuffer(r.RENDERBUFFER,ne),r.framebufferRenderbuffer(r.FRAMEBUFFER,se,r.RENDERBUFFER,ne)}}else{const z=U.texture.mipmaps;if(z&&z.length>0?t.bindFramebuffer(r.FRAMEBUFFER,A.__webglFramebuffer[0]):t.bindFramebuffer(r.FRAMEBUFFER,A.__webglFramebuffer),A.__webglDepthbuffer===void 0)A.__webglDepthbuffer=r.createRenderbuffer(),_e(A.__webglDepthbuffer,U,!1);else{const se=U.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,ne=A.__webglDepthbuffer;r.bindRenderbuffer(r.RENDERBUFFER,ne),r.framebufferRenderbuffer(r.FRAMEBUFFER,se,r.RENDERBUFFER,ne)}}t.bindFramebuffer(r.FRAMEBUFFER,null)}function tt(U,A,G){const z=n.get(U);A!==void 0&&Ee(z.__webglFramebuffer,U,U.texture,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,0),G!==void 0&&ke(U)}function Qe(U){const A=U.texture,G=n.get(U),z=n.get(A);U.addEventListener("dispose",T);const se=U.textures,ne=U.isWebGLCubeRenderTarget===!0,Ce=se.length>1;if(Ce||(z.__webglTexture===void 0&&(z.__webglTexture=r.createTexture()),z.__version=A.version,a.memory.textures++),ne){G.__webglFramebuffer=[];for(let Ae=0;Ae<6;Ae++)if(A.mipmaps&&A.mipmaps.length>0){G.__webglFramebuffer[Ae]=[];for(let Be=0;Be<A.mipmaps.length;Be++)G.__webglFramebuffer[Ae][Be]=r.createFramebuffer()}else G.__webglFramebuffer[Ae]=r.createFramebuffer()}else{if(A.mipmaps&&A.mipmaps.length>0){G.__webglFramebuffer=[];for(let Ae=0;Ae<A.mipmaps.length;Ae++)G.__webglFramebuffer[Ae]=r.createFramebuffer()}else G.__webglFramebuffer=r.createFramebuffer();if(Ce)for(let Ae=0,Be=se.length;Ae<Be;Ae++){const Ve=n.get(se[Ae]);Ve.__webglTexture===void 0&&(Ve.__webglTexture=r.createTexture(),a.memory.textures++)}if(U.samples>0&&Se(U)===!1){G.__webglMultisampledFramebuffer=r.createFramebuffer(),G.__webglColorRenderbuffer=[],t.bindFramebuffer(r.FRAMEBUFFER,G.__webglMultisampledFramebuffer);for(let Ae=0;Ae<se.length;Ae++){const Be=se[Ae];G.__webglColorRenderbuffer[Ae]=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,G.__webglColorRenderbuffer[Ae]);const Ve=s.convert(Be.format,Be.colorSpace),me=s.convert(Be.type),De=E(Be.internalFormat,Ve,me,Be.colorSpace,U.isXRRenderTarget===!0),Ke=te(U);r.renderbufferStorageMultisample(r.RENDERBUFFER,Ke,De,U.width,U.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ae,r.RENDERBUFFER,G.__webglColorRenderbuffer[Ae])}r.bindRenderbuffer(r.RENDERBUFFER,null),U.depthBuffer&&(G.__webglDepthRenderbuffer=r.createRenderbuffer(),_e(G.__webglDepthRenderbuffer,U,!0)),t.bindFramebuffer(r.FRAMEBUFFER,null)}}if(ne){t.bindTexture(r.TEXTURE_CUBE_MAP,z.__webglTexture),Pe(r.TEXTURE_CUBE_MAP,A);for(let Ae=0;Ae<6;Ae++)if(A.mipmaps&&A.mipmaps.length>0)for(let Be=0;Be<A.mipmaps.length;Be++)Ee(G.__webglFramebuffer[Ae][Be],U,A,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+Ae,Be);else Ee(G.__webglFramebuffer[Ae],U,A,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+Ae,0);g(A)&&p(r.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(Ce){for(let Ae=0,Be=se.length;Ae<Be;Ae++){const Ve=se[Ae],me=n.get(Ve);t.bindTexture(r.TEXTURE_2D,me.__webglTexture),Pe(r.TEXTURE_2D,Ve),Ee(G.__webglFramebuffer,U,Ve,r.COLOR_ATTACHMENT0+Ae,r.TEXTURE_2D,0),g(Ve)&&p(r.TEXTURE_2D)}t.unbindTexture()}else{let Ae=r.TEXTURE_2D;if((U.isWebGL3DRenderTarget||U.isWebGLArrayRenderTarget)&&(Ae=U.isWebGL3DRenderTarget?r.TEXTURE_3D:r.TEXTURE_2D_ARRAY),t.bindTexture(Ae,z.__webglTexture),Pe(Ae,A),A.mipmaps&&A.mipmaps.length>0)for(let Be=0;Be<A.mipmaps.length;Be++)Ee(G.__webglFramebuffer[Be],U,A,r.COLOR_ATTACHMENT0,Ae,Be);else Ee(G.__webglFramebuffer,U,A,r.COLOR_ATTACHMENT0,Ae,0);g(A)&&p(Ae),t.unbindTexture()}U.depthBuffer&&ke(U)}function O(U){const A=U.textures;for(let G=0,z=A.length;G<z;G++){const se=A[G];if(g(se)){const ne=S(U),Ce=n.get(se).__webglTexture;t.bindTexture(ne,Ce),p(ne),t.unbindTexture()}}}const bt=[],$=[];function pe(U){if(U.samples>0){if(Se(U)===!1){const A=U.textures,G=U.width,z=U.height;let se=r.COLOR_BUFFER_BIT;const ne=U.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Ce=n.get(U),Ae=A.length>1;if(Ae)for(let Ve=0;Ve<A.length;Ve++)t.bindFramebuffer(r.FRAMEBUFFER,Ce.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ve,r.RENDERBUFFER,null),t.bindFramebuffer(r.FRAMEBUFFER,Ce.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ve,r.TEXTURE_2D,null,0);t.bindFramebuffer(r.READ_FRAMEBUFFER,Ce.__webglMultisampledFramebuffer);const Be=U.texture.mipmaps;Be&&Be.length>0?t.bindFramebuffer(r.DRAW_FRAMEBUFFER,Ce.__webglFramebuffer[0]):t.bindFramebuffer(r.DRAW_FRAMEBUFFER,Ce.__webglFramebuffer);for(let Ve=0;Ve<A.length;Ve++){if(U.resolveDepthBuffer&&(U.depthBuffer&&(se|=r.DEPTH_BUFFER_BIT),U.stencilBuffer&&U.resolveStencilBuffer&&(se|=r.STENCIL_BUFFER_BIT)),Ae){r.framebufferRenderbuffer(r.READ_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,Ce.__webglColorRenderbuffer[Ve]);const me=n.get(A[Ve]).__webglTexture;r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,me,0)}r.blitFramebuffer(0,0,G,z,0,0,G,z,se,r.NEAREST),l===!0&&(bt.length=0,$.length=0,bt.push(r.COLOR_ATTACHMENT0+Ve),U.depthBuffer&&U.resolveDepthBuffer===!1&&(bt.push(ne),$.push(ne),r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,$)),r.invalidateFramebuffer(r.READ_FRAMEBUFFER,bt))}if(t.bindFramebuffer(r.READ_FRAMEBUFFER,null),t.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),Ae)for(let Ve=0;Ve<A.length;Ve++){t.bindFramebuffer(r.FRAMEBUFFER,Ce.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ve,r.RENDERBUFFER,Ce.__webglColorRenderbuffer[Ve]);const me=n.get(A[Ve]).__webglTexture;t.bindFramebuffer(r.FRAMEBUFFER,Ce.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ve,r.TEXTURE_2D,me,0)}t.bindFramebuffer(r.DRAW_FRAMEBUFFER,Ce.__webglMultisampledFramebuffer)}else if(U.depthBuffer&&U.resolveDepthBuffer===!1&&l){const A=U.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT;r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,[A])}}}function te(U){return Math.min(i.maxSamples,U.samples)}function Se(U){const A=n.get(U);return U.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&A.__useRenderToTexture!==!1}function he(U){const A=a.render.frame;h.get(U)!==A&&(h.set(U,A),U.update())}function ce(U,A){const G=U.colorSpace,z=U.format,se=U.type;return U.isCompressedTexture===!0||U.isVideoTexture===!0||G!==Pr&&G!==Ai&&(xt.getTransfer(G)===Nt?(z!==Un||se!==Qn)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",G)),A}function Ue(U){return typeof HTMLImageElement<"u"&&U instanceof HTMLImageElement?(c.width=U.naturalWidth||U.width,c.height=U.naturalHeight||U.height):typeof VideoFrame<"u"&&U instanceof VideoFrame?(c.width=U.displayWidth,c.height=U.displayHeight):(c.width=U.width,c.height=U.height),c}this.allocateTextureUnit=V,this.resetTextureUnits=B,this.setTexture2D=ee,this.setTexture2DArray=k,this.setTexture3D=Q,this.setTextureCube=q,this.rebindTextures=tt,this.setupRenderTarget=Qe,this.updateRenderTargetMipmap=O,this.updateMultisampleRenderTarget=pe,this.setupDepthRenderbuffer=ke,this.setupFrameBufferTexture=Ee,this.useMultisampledRTT=Se}function Kg(r,e){function t(n,i=Ai){let s;const a=xt.getTransfer(i);if(n===Qn)return r.UNSIGNED_BYTE;if(n===Cl)return r.UNSIGNED_SHORT_4_4_4_4;if(n===Rl)return r.UNSIGNED_SHORT_5_5_5_1;if(n===du)return r.UNSIGNED_INT_5_9_9_9_REV;if(n===hu)return r.BYTE;if(n===uu)return r.SHORT;if(n===is)return r.UNSIGNED_SHORT;if(n===Tl)return r.INT;if(n===qi)return r.UNSIGNED_INT;if(n===Kn)return r.FLOAT;if(n===hs)return r.HALF_FLOAT;if(n===fu)return r.ALPHA;if(n===pu)return r.RGB;if(n===Un)return r.RGBA;if(n===ss)return r.DEPTH_COMPONENT;if(n===as)return r.DEPTH_STENCIL;if(n===mu)return r.RED;if(n===Dl)return r.RED_INTEGER;if(n===gu)return r.RG;if(n===Pl)return r.RG_INTEGER;if(n===Ll)return r.RGBA_INTEGER;if(n===ra||n===sa||n===aa||n===oa)if(a===Nt)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(n===ra)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===sa)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===aa)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===oa)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(n===ra)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===sa)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===aa)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===oa)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===Bo||n===ko||n===Vo||n===Ho)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(n===Bo)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===ko)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Vo)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Ho)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===Go||n===Wo||n===Xo)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(n===Go||n===Wo)return a===Nt?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===Xo)return a===Nt?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===qo||n===jo||n===Yo||n===$o||n===Ko||n===Jo||n===Zo||n===Qo||n===el||n===tl||n===nl||n===il||n===rl||n===sl)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(n===qo)return a===Nt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===jo)return a===Nt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===Yo)return a===Nt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===$o)return a===Nt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===Ko)return a===Nt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===Jo)return a===Nt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===Zo)return a===Nt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===Qo)return a===Nt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===el)return a===Nt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===tl)return a===Nt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===nl)return a===Nt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===il)return a===Nt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===rl)return a===Nt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===sl)return a===Nt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===la||n===al||n===ol)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(n===la)return a===Nt?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===al)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===ol)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===_u||n===ll||n===cl||n===hl)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(n===la)return s.COMPRESSED_RED_RGTC1_EXT;if(n===ll)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===cl)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===hl)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===rs?r.UNSIGNED_INT_24_8:r[n]!==void 0?r[n]:null}return{convert:t}}const Jg=`
|
|
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 Qg{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(this.texture===null){const i=new cn,s=e.properties.get(i);s.__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 pi({vertexShader:Kg,fragmentShader:Zg,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Ct(new us(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class e3 extends $i{constructor(e,t){super();const n=this;let i=null,s=1,a=null,o="local-floor",l=1,c=null,h=null,u=null,d=null,f=null,m=null;const _=new Qg,g=t.getContextAttributes();let p=null,S=null;const E=[],v=[],N=new Ge;let C=null;const T=new ln;T.viewport=new Mt;const P=new ln;P.viewport=new Mt;const b=[T,P],x=new g0;let R=null,B=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Y){let re=E[Y];return re===void 0&&(re=new eo,E[Y]=re),re.getTargetRaySpace()},this.getControllerGrip=function(Y){let re=E[Y];return re===void 0&&(re=new eo,E[Y]=re),re.getGripSpace()},this.getHand=function(Y){let re=E[Y];return re===void 0&&(re=new eo,E[Y]=re),re.getHandSpace()};function V(Y){const re=v.indexOf(Y.inputSource);if(re===-1)return;const ae=E[re];ae!==void 0&&(ae.update(Y.inputSource,Y.frame,c||a),ae.dispatchEvent({type:Y.type,data:Y.inputSource}))}function W(){i.removeEventListener("select",V),i.removeEventListener("selectstart",V),i.removeEventListener("selectend",V),i.removeEventListener("squeeze",V),i.removeEventListener("squeezestart",V),i.removeEventListener("squeezeend",V),i.removeEventListener("end",W),i.removeEventListener("inputsourceschange",ee);for(let Y=0;Y<E.length;Y++){const re=v[Y];re!==null&&(v[Y]=null,E[Y].disconnect(re))}R=null,B=null,_.reset(),e.setRenderTarget(p),f=null,d=null,u=null,i=null,S=null,Te.stop(),n.isPresenting=!1,e.setPixelRatio(C),e.setSize(N.width,N.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(Y){s=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 d!==null?d:f},this.getBinding=function(){return u},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",V),i.addEventListener("selectstart",V),i.addEventListener("selectend",V),i.addEventListener("squeeze",V),i.addEventListener("squeezestart",V),i.addEventListener("squeezeend",V),i.addEventListener("end",W),i.addEventListener("inputsourceschange",ee),g.xrCompatible!==!0&&await t.makeXRCompatible(),C=e.getPixelRatio(),e.getSize(N),typeof XRWebGLBinding<"u"&&"createProjectionLayer"in XRWebGLBinding.prototype){let ae=null,oe=null,Ee=null;g.depth&&(Ee=g.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,ae=g.stencil?as:ss,oe=g.stencil?rs:qi);const _e={colorFormat:t.RGBA8,depthFormat:Ee,scaleFactor:s};u=new XRWebGLBinding(i,t),d=u.createProjectionLayer(_e),i.updateRenderState({layers:[d]}),e.setPixelRatio(1),e.setSize(d.textureWidth,d.textureHeight,!1),S=new ji(d.textureWidth,d.textureHeight,{format:Un,type:Qn,depthTexture:new Lu(d.textureWidth,d.textureHeight,oe,void 0,void 0,void 0,void 0,void 0,void 0,ae),stencilBuffer:g.stencil,colorSpace:e.outputColorSpace,samples:g.antialias?4:0,resolveDepthBuffer:d.ignoreDepthValues===!1,resolveStencilBuffer:d.ignoreDepthValues===!1})}else{const ae={antialias:g.antialias,alpha:!0,depth:g.depth,stencil:g.stencil,framebufferScaleFactor:s};f=new XRWebGLLayer(i,t,ae),i.updateRenderState({baseLayer:f}),e.setPixelRatio(1),e.setSize(f.framebufferWidth,f.framebufferHeight,!1),S=new ji(f.framebufferWidth,f.framebufferHeight,{format:Un,type:Qn,colorSpace:e.outputColorSpace,stencilBuffer:g.stencil,resolveDepthBuffer:f.ignoreDepthValues===!1,resolveStencilBuffer:f.ignoreDepthValues===!1})}S.isXRRenderTarget=!0,this.setFoveation(l),c=null,a=await i.requestReferenceSpace(o),Te.setContext(i),Te.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode},this.getDepthTexture=function(){return _.getDepthTexture()};function ee(Y){for(let re=0;re<Y.removed.length;re++){const ae=Y.removed[re],oe=v.indexOf(ae);oe>=0&&(v[oe]=null,E[oe].disconnect(ae))}for(let re=0;re<Y.added.length;re++){const ae=Y.added[re];let oe=v.indexOf(ae);if(oe===-1){for(let _e=0;_e<E.length;_e++)if(_e>=v.length){v.push(ae),oe=_e;break}else if(v[_e]===null){v[_e]=ae,oe=_e;break}if(oe===-1)break}const Ee=E[oe];Ee&&Ee.connect(ae)}}const k=new F,Q=new F;function q(Y,re,ae){k.setFromMatrixPosition(re.matrixWorld),Q.setFromMatrixPosition(ae.matrixWorld);const oe=k.distanceTo(Q),Ee=re.projectionMatrix.elements,_e=ae.projectionMatrix.elements,we=Ee[14]/(Ee[10]-1),ke=Ee[14]/(Ee[10]+1),tt=(Ee[9]+1)/Ee[5],Qe=(Ee[9]-1)/Ee[5],O=(Ee[8]-1)/Ee[0],bt=(_e[8]+1)/_e[0],$=we*O,pe=we*bt,te=oe/(-O+bt),Se=te*-O;if(re.matrixWorld.decompose(Y.position,Y.quaternion,Y.scale),Y.translateX(Se),Y.translateZ(te),Y.matrixWorld.compose(Y.position,Y.quaternion,Y.scale),Y.matrixWorldInverse.copy(Y.matrixWorld).invert(),Ee[10]===-1)Y.projectionMatrix.copy(re.projectionMatrix),Y.projectionMatrixInverse.copy(re.projectionMatrixInverse);else{const he=we+te,ce=ke+te,Ue=$-Se,U=pe+(oe-Se),A=tt*ke/ce*he,G=Qe*ke/ce*he;Y.projectionMatrix.makePerspective(Ue,U,A,G,he,ce),Y.projectionMatrixInverse.copy(Y.projectionMatrix).invert()}}function ue(Y,re){re===null?Y.matrixWorld.copy(Y.matrix):Y.matrixWorld.multiplyMatrices(re.matrixWorld,Y.matrix),Y.matrixWorldInverse.copy(Y.matrixWorld).invert()}this.updateCamera=function(Y){if(i===null)return;let re=Y.near,ae=Y.far;_.texture!==null&&(_.depthNear>0&&(re=_.depthNear),_.depthFar>0&&(ae=_.depthFar)),x.near=P.near=T.near=re,x.far=P.far=T.far=ae,(R!==x.near||B!==x.far)&&(i.updateRenderState({depthNear:x.near,depthFar:x.far}),R=x.near,B=x.far),T.layers.mask=Y.layers.mask|2,P.layers.mask=Y.layers.mask|4,x.layers.mask=T.layers.mask|P.layers.mask;const oe=Y.parent,Ee=x.cameras;ue(x,oe);for(let _e=0;_e<Ee.length;_e++)ue(Ee[_e],oe);Ee.length===2?q(x,T,P):x.projectionMatrix.copy(T.projectionMatrix),ye(Y,x,oe)};function ye(Y,re,ae){ae===null?Y.matrix.copy(re.matrixWorld):(Y.matrix.copy(ae.matrixWorld),Y.matrix.invert(),Y.matrix.multiply(re.matrixWorld)),Y.matrix.decompose(Y.position,Y.quaternion,Y.scale),Y.updateMatrixWorld(!0),Y.projectionMatrix.copy(re.projectionMatrix),Y.projectionMatrixInverse.copy(re.projectionMatrixInverse),Y.isPerspectiveCamera&&(Y.fov=Pr*2*Math.atan(1/Y.projectionMatrix.elements[5]),Y.zoom=1)}this.getCamera=function(){return x},this.getFoveation=function(){if(!(d===null&&f===null))return l},this.setFoveation=function(Y){l=Y,d!==null&&(d.fixedFoveation=Y),f!==null&&f.fixedFoveation!==void 0&&(f.fixedFoveation=Y)},this.hasDepthSensing=function(){return _.texture!==null},this.getDepthSensingMesh=function(){return _.getMesh(x)};let le=null;function Le(Y,re){if(h=re.getViewerPose(c||a),m=re,h!==null){const ae=h.views;f!==null&&(e.setRenderTargetFramebuffer(S,f.framebuffer),e.setRenderTarget(S));let oe=!1;ae.length!==x.cameras.length&&(x.cameras.length=0,oe=!0);for(let we=0;we<ae.length;we++){const ke=ae[we];let tt=null;if(f!==null)tt=f.getViewport(ke);else{const O=u.getViewSubImage(d,ke);tt=O.viewport,we===0&&(e.setRenderTargetTextures(S,O.colorTexture,O.depthStencilTexture),e.setRenderTarget(S))}let Qe=b[we];Qe===void 0&&(Qe=new ln,Qe.layers.enable(we),Qe.viewport=new Mt,b[we]=Qe),Qe.matrix.fromArray(ke.transform.matrix),Qe.matrix.decompose(Qe.position,Qe.quaternion,Qe.scale),Qe.projectionMatrix.fromArray(ke.projectionMatrix),Qe.projectionMatrixInverse.copy(Qe.projectionMatrix).invert(),Qe.viewport.set(tt.x,tt.y,tt.width,tt.height),we===0&&(x.matrix.copy(Qe.matrix),x.matrix.decompose(x.position,x.quaternion,x.scale)),oe===!0&&x.cameras.push(Qe)}const Ee=i.enabledFeatures;if(Ee&&Ee.includes("depth-sensing")&&i.depthUsage=="gpu-optimized"&&u){const we=u.getDepthInformation(ae[0]);we&&we.isValid&&we.texture&&_.init(e,we,i.renderState)}}for(let ae=0;ae<E.length;ae++){const oe=v[ae],Ee=E[ae];oe!==null&&Ee!==void 0&&Ee.update(oe,re,c||a)}le&&le(Y,re),re.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:re}),m=null}const Te=new Vu;Te.setAnimationLoop(Le),this.setAnimationLoop=function(Y){le=Y},this.dispose=function(){}}}const Oi=new yn,t3=new lt;function n3(r,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,Eu(r)),p.isFog?(g.fogNear.value=p.near,g.fogFar.value=p.far):p.isFogExp2&&(g.fogDensity.value=p.density)}function i(g,p,S,E,v){p.isMeshBasicMaterial||p.isMeshLambertMaterial?s(g,p):p.isMeshToonMaterial?(s(g,p),u(g,p)):p.isMeshPhongMaterial?(s(g,p),h(g,p)):p.isMeshStandardMaterial?(s(g,p),d(g,p),p.isMeshPhysicalMaterial&&f(g,p,v)):p.isMeshMatcapMaterial?(s(g,p),m(g,p)):p.isMeshDepthMaterial?s(g,p):p.isMeshDistanceMaterial?(s(g,p),_(g,p)):p.isMeshNormalMaterial?s(g,p):p.isLineBasicMaterial?(a(g,p),p.isLineDashedMaterial&&o(g,p)):p.isPointsMaterial?l(g,p,S,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 s(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===vn&&(g.bumpScale.value*=-1)),p.normalMap&&(g.normalMap.value=p.normalMap,t(p.normalMap,g.normalMapTransform),g.normalScale.value.copy(p.normalScale),p.side===vn&&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 S=e.get(p),E=S.envMap,v=S.envMapRotation;E&&(g.envMap.value=E,Oi.copy(v),Oi.x*=-1,Oi.y*=-1,Oi.z*=-1,E.isCubeTexture&&E.isRenderTargetTexture===!1&&(Oi.y*=-1,Oi.z*=-1),g.envMapRotation.value.setFromMatrix4(t3.makeRotationFromEuler(Oi)),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,S,E){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,g.size.value=p.size*S,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 u(g,p){p.gradientMap&&(g.gradientMap.value=p.gradientMap)}function d(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,S){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===vn&&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=S.texture,g.transmissionSamplerSize.value.set(S.width,S.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 S=e.get(p).light;g.referencePosition.value.setFromMatrixPosition(S.matrixWorld),g.nearDistance.value=S.shadow.camera.near,g.farDistance.value=S.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function i3(r,e,t,n){let i={},s={},a=[];const o=r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS);function l(S,E){const v=E.program;n.uniformBlockBinding(S,v)}function c(S,E){let v=i[S.id];v===void 0&&(m(S),v=h(S),i[S.id]=v,S.addEventListener("dispose",g));const N=E.program;n.updateUBOMapping(S,N);const C=e.render.frame;s[S.id]!==C&&(d(S),s[S.id]=C)}function h(S){const E=u();S.__bindingPointIndex=E;const v=r.createBuffer(),N=S.__size,C=S.usage;return r.bindBuffer(r.UNIFORM_BUFFER,v),r.bufferData(r.UNIFORM_BUFFER,N,C),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,E,v),v}function u(){for(let S=0;S<o;S++)if(a.indexOf(S)===-1)return a.push(S),S;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function d(S){const E=i[S.id],v=S.uniforms,N=S.__cache;r.bindBuffer(r.UNIFORM_BUFFER,E);for(let C=0,T=v.length;C<T;C++){const P=Array.isArray(v[C])?v[C]:[v[C]];for(let b=0,x=P.length;b<x;b++){const R=P[b];if(f(R,C,b,N)===!0){const B=R.__offset,V=Array.isArray(R.value)?R.value:[R.value];let W=0;for(let ee=0;ee<V.length;ee++){const k=V[ee],Q=_(k);typeof k=="number"||typeof k=="boolean"?(R.__data[0]=k,r.bufferSubData(r.UNIFORM_BUFFER,B+W,R.__data)):k.isMatrix3?(R.__data[0]=k.elements[0],R.__data[1]=k.elements[1],R.__data[2]=k.elements[2],R.__data[3]=0,R.__data[4]=k.elements[3],R.__data[5]=k.elements[4],R.__data[6]=k.elements[5],R.__data[7]=0,R.__data[8]=k.elements[6],R.__data[9]=k.elements[7],R.__data[10]=k.elements[8],R.__data[11]=0):(k.toArray(R.__data,W),W+=Q.storage/Float32Array.BYTES_PER_ELEMENT)}r.bufferSubData(r.UNIFORM_BUFFER,B,R.__data)}}}r.bindBuffer(r.UNIFORM_BUFFER,null)}function f(S,E,v,N){const C=S.value,T=E+"_"+v;if(N[T]===void 0)return typeof C=="number"||typeof C=="boolean"?N[T]=C:N[T]=C.clone(),!0;{const P=N[T];if(typeof C=="number"||typeof C=="boolean"){if(P!==C)return N[T]=C,!0}else if(P.equals(C)===!1)return P.copy(C),!0}return!1}function m(S){const E=S.uniforms;let v=0;const N=16;for(let T=0,P=E.length;T<P;T++){const b=Array.isArray(E[T])?E[T]:[E[T]];for(let x=0,R=b.length;x<R;x++){const B=b[x],V=Array.isArray(B.value)?B.value:[B.value];for(let W=0,ee=V.length;W<ee;W++){const k=V[W],Q=_(k),q=v%N,ue=q%Q.boundary,ye=q+ue;v+=ue,ye!==0&&N-ye<Q.storage&&(v+=N-ye),B.__data=new Float32Array(Q.storage/Float32Array.BYTES_PER_ELEMENT),B.__offset=v,v+=Q.storage}}}const C=v%N;return C>0&&(v+=N-C),S.__size=v,S.__cache={},this}function _(S){const E={boundary:0,storage:0};return typeof S=="number"||typeof S=="boolean"?(E.boundary=4,E.storage=4):S.isVector2?(E.boundary=8,E.storage=8):S.isVector3||S.isColor?(E.boundary=16,E.storage=12):S.isVector4?(E.boundary=16,E.storage=16):S.isMatrix3?(E.boundary=48,E.storage=48):S.isMatrix4?(E.boundary=64,E.storage=64):S.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",S),E}function g(S){const E=S.target;E.removeEventListener("dispose",g);const v=a.indexOf(E.__bindingPointIndex);a.splice(v,1),r.deleteBuffer(i[E.id]),delete i[E.id],delete s[E.id]}function p(){for(const S in i)r.deleteBuffer(i[S]);a=[],i={},s={}}return{bind:l,update:c,dispose:p}}class r3{constructor(e={}){const{canvas:t=Jf(),context:n=null,depth:i=!0,stencil:s=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:u=!1,reverseDepthBuffer:d=!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 S=[],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=Ti,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const v=this;let N=!1;this._outputColorSpace=Tt;let C=0,T=0,P=null,b=-1,x=null;const R=new Mt,B=new Mt;let V=null;const W=new st(0);let ee=0,k=t.width,Q=t.height,q=1,ue=null,ye=null;const le=new Mt(0,0,k,Q),Le=new Mt(0,0,k,Q);let Te=!1;const Y=new kl;let re=!1,ae=!1;const oe=new lt,Ee=new lt,_e=new F,we=new Mt,ke={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let tt=!1;function Qe(){return P===null?q:1}let O=n;function bt(D,X){return t.getContext(D,X)}try{const D={alpha:!0,depth:i,stencil:s,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:h,failIfMajorPerformanceCaveat:u};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${wl}`),t.addEventListener("webglcontextlost",He,!1),t.addEventListener("webglcontextrestored",Me,!1),t.addEventListener("webglcontextcreationerror",ge,!1),O===null){const X="webgl2";if(O=bt(X,D),O===null)throw bt(X)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(D){throw console.error("THREE.WebGLRenderer: "+D.message),D}let $,pe,te,Se,he,ce,Ue,U,A,G,z,se,ne,Ce,Ae,Be,Ve,me,De,Je,nt,Pe,ct,H;function Fe(){$=new p2(O),$.init(),Pe=new Jg(O,$),pe=new o2(O,$,e,Pe),te=new Yg(O,$),pe.reverseDepthBuffer&&d&&te.buffers.depth.setReversed(!0),Se=new _2(O),he=new Ug,ce=new $g(O,$,te,he,pe,Pe,Se),Ue=new c2(v),U=new f2(v),A=new S0(O),ct=new s2(O,A),G=new m2(O,A,Se,ct),z=new y2(O,G,A,Se),De=new v2(O,pe,ce),Be=new l2(he),se=new Ng(v,Ue,U,$,pe,ct,Be),ne=new n3(v,he),Ce=new Og,Ae=new Gg($),me=new r2(v,Ue,U,te,z,f,l),Ve=new qg(v,z,pe),H=new i3(O,Se,pe,te),Je=new a2(O,$,Se),nt=new g2(O,$,Se),Se.programs=se.programs,v.capabilities=pe,v.extensions=$,v.properties=he,v.renderLists=Ce,v.shadowMap=Ve,v.state=te,v.info=Se}Fe();const ve=new e3(v,O);this.xr=ve,this.getContext=function(){return O},this.getContextAttributes=function(){return O.getContextAttributes()},this.forceContextLoss=function(){const D=$.get("WEBGL_lose_context");D&&D.loseContext()},this.forceContextRestore=function(){const D=$.get("WEBGL_lose_context");D&&D.restoreContext()},this.getPixelRatio=function(){return q},this.setPixelRatio=function(D){D!==void 0&&(q=D,this.setSize(k,Q,!1))},this.getSize=function(D){return D.set(k,Q)},this.setSize=function(D,X,J=!0){if(ve.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}k=D,Q=X,t.width=Math.floor(D*q),t.height=Math.floor(X*q),J===!0&&(t.style.width=D+"px",t.style.height=X+"px"),this.setViewport(0,0,D,X)},this.getDrawingBufferSize=function(D){return D.set(k*q,Q*q).floor()},this.setDrawingBufferSize=function(D,X,J){k=D,Q=X,q=J,t.width=Math.floor(D*J),t.height=Math.floor(X*J),this.setViewport(0,0,D,X)},this.getCurrentViewport=function(D){return D.copy(R)},this.getViewport=function(D){return D.copy(le)},this.setViewport=function(D,X,J,Z){D.isVector4?le.set(D.x,D.y,D.z,D.w):le.set(D,X,J,Z),te.viewport(R.copy(le).multiplyScalar(q).round())},this.getScissor=function(D){return D.copy(Le)},this.setScissor=function(D,X,J,Z){D.isVector4?Le.set(D.x,D.y,D.z,D.w):Le.set(D,X,J,Z),te.scissor(B.copy(Le).multiplyScalar(q).round())},this.getScissorTest=function(){return Te},this.setScissorTest=function(D){te.setScissorTest(Te=D)},this.setOpaqueSort=function(D){ue=D},this.setTransparentSort=function(D){ye=D},this.getClearColor=function(D){return D.copy(me.getClearColor())},this.setClearColor=function(){me.setClearColor(...arguments)},this.getClearAlpha=function(){return me.getClearAlpha()},this.setClearAlpha=function(){me.setClearAlpha(...arguments)},this.clear=function(D=!0,X=!0,J=!0){let Z=0;if(D){let j=!1;if(P!==null){const be=P.texture.format;j=be===Pl||be===Ll||be===Dl}if(j){const be=P.texture.type,Oe=be===Qn||be===qi||be===is||be===rs||be===Cl||be===Rl,Ye=me.getClearColor(),We=me.getClearAlpha(),ut=Ye.r,dt=Ye.g,et=Ye.b;Oe?(m[0]=ut,m[1]=dt,m[2]=et,m[3]=We,O.clearBufferuiv(O.COLOR,0,m)):(_[0]=ut,_[1]=dt,_[2]=et,_[3]=We,O.clearBufferiv(O.COLOR,0,_))}else Z|=O.COLOR_BUFFER_BIT}X&&(Z|=O.DEPTH_BUFFER_BIT),J&&(Z|=O.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),O.clear(Z)},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",He,!1),t.removeEventListener("webglcontextrestored",Me,!1),t.removeEventListener("webglcontextcreationerror",ge,!1),me.dispose(),Ce.dispose(),Ae.dispose(),he.dispose(),Ue.dispose(),U.dispose(),z.dispose(),ct.dispose(),H.dispose(),se.dispose(),ve.dispose(),ve.removeEventListener("sessionstart",Zt),ve.removeEventListener("sessionend",jt),tn.stop()};function He(D){D.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),N=!0}function Me(){console.log("THREE.WebGLRenderer: Context Restored."),N=!1;const D=Se.autoReset,X=Ve.enabled,J=Ve.autoUpdate,Z=Ve.needsUpdate,j=Ve.type;Fe(),Se.autoReset=D,Ve.enabled=X,Ve.autoUpdate=J,Ve.needsUpdate=Z,Ve.type=j}function ge(D){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",D.statusMessage)}function qe(D){const X=D.target;X.removeEventListener("dispose",qe),ht(X)}function ht(D){Dt(D),he.remove(D)}function Dt(D){const X=he.get(D).programs;X!==void 0&&(X.forEach(function(J){se.releaseProgram(J)}),D.isShaderMaterial&&se.releaseShaderCache(D))}this.renderBufferDirect=function(D,X,J,Z,j,be){X===null&&(X=ke);const Oe=j.isMesh&&j.matrixWorld.determinant()<0,Ye=En(D,X,J,Z,j);te.setMaterial(Z,Oe);let We=J.index,ut=1;if(Z.wireframe===!0){if(We=G.getWireframeAttribute(J),We===void 0)return;ut=2}const dt=J.drawRange,et=J.attributes.position;let gt=dt.start*ut,Rt=(dt.start+dt.count)*ut;be!==null&&(gt=Math.max(gt,be.start*ut),Rt=Math.min(Rt,(be.start+be.count)*ut)),We!==null?(gt=Math.max(gt,0),Rt=Math.min(Rt,We.count)):et!=null&&(gt=Math.max(gt,0),Rt=Math.min(Rt,et.count));const Ot=Rt-gt;if(Ot<0||Ot===1/0)return;ct.setup(j,Z,Ye,J,We);let kt,St=Je;if(We!==null&&(kt=A.get(We),St=nt,St.setIndex(kt)),j.isMesh)Z.wireframe===!0?(te.setLineWidth(Z.wireframeLinewidth*Qe()),St.setMode(O.LINES)):St.setMode(O.TRIANGLES);else if(j.isLine){let at=Z.linewidth;at===void 0&&(at=1),te.setLineWidth(at*Qe()),j.isLineSegments?St.setMode(O.LINES):j.isLineLoop?St.setMode(O.LINE_LOOP):St.setMode(O.LINE_STRIP)}else j.isPoints?St.setMode(O.POINTS):j.isSprite&&St.setMode(O.TRIANGLES);if(j.isBatchedMesh)if(j._multiDrawInstances!==null)wr("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),St.renderMultiDrawInstances(j._multiDrawStarts,j._multiDrawCounts,j._multiDrawCount,j._multiDrawInstances);else if($.get("WEBGL_multi_draw"))St.renderMultiDraw(j._multiDrawStarts,j._multiDrawCounts,j._multiDrawCount);else{const at=j._multiDrawStarts,Yt=j._multiDrawCounts,Et=j._multiDrawCount,xn=We?A.get(We).bytesPerElement:1,zt=he.get(Z).currentProgram.getUniforms();for(let rn=0;rn<Et;rn++)zt.setValue(O,"_gl_DrawID",rn),St.render(at[rn]/xn,Yt[rn])}else if(j.isInstancedMesh)St.renderInstances(gt,Ot,j.count);else if(J.isInstancedBufferGeometry){const at=J._maxInstanceCount!==void 0?J._maxInstanceCount:1/0,Yt=Math.min(J.instanceCount,at);St.renderInstances(gt,Ot,Yt)}else St.render(gt,Ot)};function pt(D,X,J){D.transparent===!0&&D.side===pn&&D.forceSinglePass===!1?(D.side=vn,D.needsUpdate=!0,nn(D,X,J),D.side=Hn,D.needsUpdate=!0,nn(D,X,J),D.side=pn):nn(D,X,J)}this.compile=function(D,X,J=null){J===null&&(J=D),p=Ae.get(J),p.init(X),E.push(p),J.traverseVisible(function(j){j.isLight&&j.layers.test(X.layers)&&(p.pushLight(j),j.castShadow&&p.pushShadow(j))}),D!==J&&D.traverseVisible(function(j){j.isLight&&j.layers.test(X.layers)&&(p.pushLight(j),j.castShadow&&p.pushShadow(j))}),p.setupLights();const Z=new Set;return D.traverse(function(j){if(!(j.isMesh||j.isPoints||j.isLine||j.isSprite))return;const be=j.material;if(be)if(Array.isArray(be))for(let Oe=0;Oe<be.length;Oe++){const Ye=be[Oe];pt(Ye,J,j),Z.add(Ye)}else pt(be,J,j),Z.add(be)}),p=E.pop(),Z},this.compileAsync=function(D,X,J=null){const Z=this.compile(D,X,J);return new Promise(j=>{function be(){if(Z.forEach(function(Oe){he.get(Oe).currentProgram.isReady()&&Z.delete(Oe)}),Z.size===0){j(D);return}setTimeout(be,10)}$.get("KHR_parallel_shader_compile")!==null?be():setTimeout(be,10)})};let en=null;function je(D){en&&en(D)}function Zt(){tn.stop()}function jt(){tn.start()}const tn=new Vu;tn.setAnimationLoop(je),typeof self<"u"&&tn.setContext(self),this.setAnimationLoop=function(D){en=D,ve.setAnimationLoop(D),D===null?tn.stop():tn.start()},ve.addEventListener("sessionstart",Zt),ve.addEventListener("sessionend",jt),this.render=function(D,X){if(X!==void 0&&X.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(N===!0)return;if(D.matrixWorldAutoUpdate===!0&&D.updateMatrixWorld(),X.parent===null&&X.matrixWorldAutoUpdate===!0&&X.updateMatrixWorld(),ve.enabled===!0&&ve.isPresenting===!0&&(ve.cameraAutoUpdate===!0&&ve.updateCamera(X),X=ve.getCamera()),D.isScene===!0&&D.onBeforeRender(v,D,X,P),p=Ae.get(D,E.length),p.init(X),E.push(p),Ee.multiplyMatrices(X.projectionMatrix,X.matrixWorldInverse),Y.setFromProjectionMatrix(Ee),ae=this.localClippingEnabled,re=Be.init(this.clippingPlanes,ae),g=Ce.get(D,S.length),g.init(),S.push(g),ve.enabled===!0&&ve.isPresenting===!0){const be=v.xr.getDepthSensingMesh();be!==null&&Di(be,X,-1/0,v.sortObjects)}Di(D,X,0,v.sortObjects),g.finish(),v.sortObjects===!0&&g.sort(ue,ye),tt=ve.enabled===!1||ve.isPresenting===!1||ve.hasDepthSensing()===!1,tt&&me.addToRenderList(g,D),this.info.render.frame++,re===!0&&Be.beginShadows();const J=p.state.shadowsArray;Ve.render(J,D,X),re===!0&&Be.endShadows(),this.info.autoReset===!0&&this.info.reset();const Z=g.opaque,j=g.transmissive;if(p.setupLights(),X.isArrayCamera){const be=X.cameras;if(j.length>0)for(let Oe=0,Ye=be.length;Oe<Ye;Oe++){const We=be[Oe];rt(Z,j,D,We)}tt&&me.render(D);for(let Oe=0,Ye=be.length;Oe<Ye;Oe++){const We=be[Oe];ti(g,D,We,We.viewport)}}else j.length>0&&rt(Z,j,D,X),tt&&me.render(D),ti(g,D,X);P!==null&&T===0&&(ce.updateMultisampleRenderTarget(P),ce.updateRenderTargetMipmap(P)),D.isScene===!0&&D.onAfterRender(v,D,X),ct.resetDefaultState(),b=-1,x=null,E.pop(),E.length>0?(p=E[E.length-1],re===!0&&Be.setGlobalState(v.clippingPlanes,p.state.camera)):p=null,S.pop(),S.length>0?g=S[S.length-1]:g=null};function Di(D,X,J,Z){if(D.visible===!1)return;if(D.layers.test(X.layers)){if(D.isGroup)J=D.renderOrder;else if(D.isLOD)D.autoUpdate===!0&&D.update(X);else if(D.isLight)p.pushLight(D),D.castShadow&&p.pushShadow(D);else if(D.isSprite){if(!D.frustumCulled||Y.intersectsSprite(D)){Z&&we.setFromMatrixPosition(D.matrixWorld).applyMatrix4(Ee);const Oe=z.update(D),Ye=D.material;Ye.visible&&g.push(D,Oe,Ye,J,we.z,null)}}else if((D.isMesh||D.isLine||D.isPoints)&&(!D.frustumCulled||Y.intersectsObject(D))){const Oe=z.update(D),Ye=D.material;if(Z&&(D.boundingSphere!==void 0?(D.boundingSphere===null&&D.computeBoundingSphere(),we.copy(D.boundingSphere.center)):(Oe.boundingSphere===null&&Oe.computeBoundingSphere(),we.copy(Oe.boundingSphere.center)),we.applyMatrix4(D.matrixWorld).applyMatrix4(Ee)),Array.isArray(Ye)){const We=Oe.groups;for(let ut=0,dt=We.length;ut<dt;ut++){const et=We[ut],gt=Ye[et.materialIndex];gt&>.visible&&g.push(D,Oe,gt,J,we.z,et)}}else Ye.visible&&g.push(D,Oe,Ye,J,we.z,null)}}const be=D.children;for(let Oe=0,Ye=be.length;Oe<Ye;Oe++)Di(be[Oe],X,J,Z)}function ti(D,X,J,Z){const j=D.opaque,be=D.transmissive,Oe=D.transparent;p.setupLightsView(J),re===!0&&Be.setGlobalState(v.clippingPlanes,J),Z&&te.viewport(R.copy(Z)),j.length>0&&Re(j,X,J),be.length>0&&Re(be,X,J),Oe.length>0&&Re(Oe,X,J),te.buffers.depth.setTest(!0),te.buffers.depth.setMask(!0),te.buffers.color.setMask(!0),te.setPolygonOffset(!1)}function rt(D,X,J,Z){if((J.isScene===!0?J.overrideMaterial:null)!==null)return;p.state.transmissionRenderTarget[Z.id]===void 0&&(p.state.transmissionRenderTarget[Z.id]=new ji(1,1,{generateMipmaps:!0,type:$.has("EXT_color_buffer_half_float")||$.has("EXT_color_buffer_float")?hs:Qn,minFilter:ui,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:xt.workingColorSpace}));const be=p.state.transmissionRenderTarget[Z.id],Oe=Z.viewport||R;be.setSize(Oe.z*v.transmissionResolutionScale,Oe.w*v.transmissionResolutionScale);const Ye=v.getRenderTarget();v.setRenderTarget(be),v.getClearColor(W),ee=v.getClearAlpha(),ee<1&&v.setClearColor(16777215,.5),v.clear(),tt&&me.render(J);const We=v.toneMapping;v.toneMapping=Ti;const ut=Z.viewport;if(Z.viewport!==void 0&&(Z.viewport=void 0),p.setupLightsView(Z),re===!0&&Be.setGlobalState(v.clippingPlanes,Z),Re(D,J,Z),ce.updateMultisampleRenderTarget(be),ce.updateRenderTargetMipmap(be),$.has("WEBGL_multisampled_render_to_texture")===!1){let dt=!1;for(let et=0,gt=X.length;et<gt;et++){const Rt=X[et],Ot=Rt.object,kt=Rt.geometry,St=Rt.material,at=Rt.group;if(St.side===pn&&Ot.layers.test(Z.layers)){const Yt=St.side;St.side=vn,St.needsUpdate=!0,Ht(Ot,J,Z,kt,St,at),St.side=Yt,St.needsUpdate=!0,dt=!0}}dt===!0&&(ce.updateMultisampleRenderTarget(be),ce.updateRenderTargetMipmap(be))}v.setRenderTarget(Ye),v.setClearColor(W,ee),ut!==void 0&&(Z.viewport=ut),v.toneMapping=We}function Re(D,X,J){const Z=X.isScene===!0?X.overrideMaterial:null;for(let j=0,be=D.length;j<be;j++){const Oe=D[j],Ye=Oe.object,We=Oe.geometry,ut=Oe.group;let dt=Oe.material;dt.allowOverride===!0&&Z!==null&&(dt=Z),Ye.layers.test(J.layers)&&Ht(Ye,X,J,We,dt,ut)}}function Ht(D,X,J,Z,j,be){D.onBeforeRender(v,X,J,Z,j,be),D.modelViewMatrix.multiplyMatrices(J.matrixWorldInverse,D.matrixWorld),D.normalMatrix.getNormalMatrix(D.modelViewMatrix),j.onBeforeRender(v,X,J,Z,D,be),j.transparent===!0&&j.side===pn&&j.forceSinglePass===!1?(j.side=vn,j.needsUpdate=!0,v.renderBufferDirect(J,X,Z,j,D,be),j.side=Hn,j.needsUpdate=!0,v.renderBufferDirect(J,X,Z,j,D,be),j.side=pn):v.renderBufferDirect(J,X,Z,j,D,be),D.onAfterRender(v,X,J,Z,j,be)}function nn(D,X,J){X.isScene!==!0&&(X=ke);const Z=he.get(D),j=p.state.lights,be=p.state.shadowsArray,Oe=j.state.version,Ye=se.getParameters(D,j.state,be,X,J),We=se.getProgramCacheKey(Ye);let ut=Z.programs;Z.environment=D.isMeshStandardMaterial?X.environment:null,Z.fog=X.fog,Z.envMap=(D.isMeshStandardMaterial?U:Ue).get(D.envMap||Z.environment),Z.envMapRotation=Z.environment!==null&&D.envMap===null?X.environmentRotation:D.envMapRotation,ut===void 0&&(D.addEventListener("dispose",qe),ut=new Map,Z.programs=ut);let dt=ut.get(We);if(dt!==void 0){if(Z.currentProgram===dt&&Z.lightsStateVersion===Oe)return hn(D,Ye),dt}else Ye.uniforms=se.getUniforms(D),D.onBeforeCompile(Ye,v),dt=se.acquireProgram(Ye,We),ut.set(We,dt),Z.uniforms=Ye.uniforms;const et=Z.uniforms;return(!D.isShaderMaterial&&!D.isRawShaderMaterial||D.clipping===!0)&&(et.clippingPlanes=Be.uniform),hn(D,Ye),Z.needsLights=Zi(D),Z.lightsStateVersion=Oe,Z.needsLights&&(et.ambientLightColor.value=j.state.ambient,et.lightProbe.value=j.state.probe,et.directionalLights.value=j.state.directional,et.directionalLightShadows.value=j.state.directionalShadow,et.spotLights.value=j.state.spot,et.spotLightShadows.value=j.state.spotShadow,et.rectAreaLights.value=j.state.rectArea,et.ltc_1.value=j.state.rectAreaLTC1,et.ltc_2.value=j.state.rectAreaLTC2,et.pointLights.value=j.state.point,et.pointLightShadows.value=j.state.pointShadow,et.hemisphereLights.value=j.state.hemi,et.directionalShadowMap.value=j.state.directionalShadowMap,et.directionalShadowMatrix.value=j.state.directionalShadowMatrix,et.spotShadowMap.value=j.state.spotShadowMap,et.spotLightMatrix.value=j.state.spotLightMatrix,et.spotLightMap.value=j.state.spotLightMap,et.pointShadowMap.value=j.state.pointShadowMap,et.pointShadowMatrix.value=j.state.pointShadowMatrix),Z.currentProgram=dt,Z.uniformsList=null,dt}function Wt(D){if(D.uniformsList===null){const X=D.currentProgram.getUniforms();D.uniformsList=ca.seqWithValue(X.seq,D.uniforms)}return D.uniformsList}function hn(D,X){const J=he.get(D);J.outputColorSpace=X.outputColorSpace,J.batching=X.batching,J.batchingColor=X.batchingColor,J.instancing=X.instancing,J.instancingColor=X.instancingColor,J.instancingMorph=X.instancingMorph,J.skinning=X.skinning,J.morphTargets=X.morphTargets,J.morphNormals=X.morphNormals,J.morphColors=X.morphColors,J.morphTargetsCount=X.morphTargetsCount,J.numClippingPlanes=X.numClippingPlanes,J.numIntersection=X.numClipIntersection,J.vertexAlphas=X.vertexAlphas,J.vertexTangents=X.vertexTangents,J.toneMapping=X.toneMapping}function En(D,X,J,Z,j){X.isScene!==!0&&(X=ke),ce.resetTextureUnits();const be=X.fog,Oe=Z.isMeshStandardMaterial?X.environment:null,Ye=P===null?v.outputColorSpace:P.isXRRenderTarget===!0?P.texture.colorSpace:Lr,We=(Z.isMeshStandardMaterial?U:Ue).get(Z.envMap||Oe),ut=Z.vertexColors===!0&&!!J.attributes.color&&J.attributes.color.itemSize===4,dt=!!J.attributes.tangent&&(!!Z.normalMap||Z.anisotropy>0),et=!!J.morphAttributes.position,gt=!!J.morphAttributes.normal,Rt=!!J.morphAttributes.color;let Ot=Ti;Z.toneMapped&&(P===null||P.isXRRenderTarget===!0)&&(Ot=v.toneMapping);const kt=J.morphAttributes.position||J.morphAttributes.normal||J.morphAttributes.color,St=kt!==void 0?kt.length:0,at=he.get(Z),Yt=p.state.lights;if(re===!0&&(ae===!0||D!==x)){const Xt=D===x&&Z.id===b;Be.setState(Z,D,Xt)}let Et=!1;Z.version===at.__version?(at.needsLights&&at.lightsStateVersion!==Yt.state.version||at.outputColorSpace!==Ye||j.isBatchedMesh&&at.batching===!1||!j.isBatchedMesh&&at.batching===!0||j.isBatchedMesh&&at.batchingColor===!0&&j.colorTexture===null||j.isBatchedMesh&&at.batchingColor===!1&&j.colorTexture!==null||j.isInstancedMesh&&at.instancing===!1||!j.isInstancedMesh&&at.instancing===!0||j.isSkinnedMesh&&at.skinning===!1||!j.isSkinnedMesh&&at.skinning===!0||j.isInstancedMesh&&at.instancingColor===!0&&j.instanceColor===null||j.isInstancedMesh&&at.instancingColor===!1&&j.instanceColor!==null||j.isInstancedMesh&&at.instancingMorph===!0&&j.morphTexture===null||j.isInstancedMesh&&at.instancingMorph===!1&&j.morphTexture!==null||at.envMap!==We||Z.fog===!0&&at.fog!==be||at.numClippingPlanes!==void 0&&(at.numClippingPlanes!==Be.numPlanes||at.numIntersection!==Be.numIntersection)||at.vertexAlphas!==ut||at.vertexTangents!==dt||at.morphTargets!==et||at.morphNormals!==gt||at.morphColors!==Rt||at.toneMapping!==Ot||at.morphTargetsCount!==St)&&(Et=!0):(Et=!0,at.__version=Z.version);let xn=at.currentProgram;Et===!0&&(xn=nn(Z,X,j));let zt=!1,rn=!1,Li=!1;const Ft=xn.getUniforms(),mn=at.uniforms;if(te.useProgram(xn.program)&&(zt=!0,rn=!0,Li=!0),Z.id!==b&&(b=Z.id,rn=!0),zt||x!==D){te.buffers.depth.getReversed()?(oe.copy(D.projectionMatrix),Zf(oe),Qf(oe),Ft.setValue(O,"projectionMatrix",oe)):Ft.setValue(O,"projectionMatrix",D.projectionMatrix),Ft.setValue(O,"viewMatrix",D.matrixWorldInverse);const $t=Ft.map.cameraPosition;$t!==void 0&&$t.setValue(O,_e.setFromMatrixPosition(D.matrixWorld)),pe.logarithmicDepthBuffer&&Ft.setValue(O,"logDepthBufFC",2/(Math.log(D.far+1)/Math.LN2)),(Z.isMeshPhongMaterial||Z.isMeshToonMaterial||Z.isMeshLambertMaterial||Z.isMeshBasicMaterial||Z.isMeshStandardMaterial||Z.isShaderMaterial)&&Ft.setValue(O,"isOrthographic",D.isOrthographicCamera===!0),x!==D&&(x=D,rn=!0,Li=!0)}if(j.isSkinnedMesh){Ft.setOptional(O,j,"bindMatrix"),Ft.setOptional(O,j,"bindMatrixInverse");const Xt=j.skeleton;Xt&&(Xt.boneTexture===null&&Xt.computeBoneTexture(),Ft.setValue(O,"boneTexture",Xt.boneTexture,ce))}j.isBatchedMesh&&(Ft.setOptional(O,j,"batchingTexture"),Ft.setValue(O,"batchingTexture",j._matricesTexture,ce),Ft.setOptional(O,j,"batchingIdTexture"),Ft.setValue(O,"batchingIdTexture",j._indirectTexture,ce),Ft.setOptional(O,j,"batchingColorTexture"),j._colorsTexture!==null&&Ft.setValue(O,"batchingColorTexture",j._colorsTexture,ce));const un=J.morphAttributes;if((un.position!==void 0||un.normal!==void 0||un.color!==void 0)&&De.update(j,J,xn),(rn||at.receiveShadow!==j.receiveShadow)&&(at.receiveShadow=j.receiveShadow,Ft.setValue(O,"receiveShadow",j.receiveShadow)),Z.isMeshGouraudMaterial&&Z.envMap!==null&&(mn.envMap.value=We,mn.flipEnvMap.value=We.isCubeTexture&&We.isRenderTargetTexture===!1?-1:1),Z.isMeshStandardMaterial&&Z.envMap===null&&X.environment!==null&&(mn.envMapIntensity.value=X.environmentIntensity),rn&&(Ft.setValue(O,"toneMappingExposure",v.toneMappingExposure),at.needsLights&&Ki(mn,Li),be&&Z.fog===!0&&ne.refreshFogUniforms(mn,be),ne.refreshMaterialUniforms(mn,Z,q,Q,p.state.transmissionRenderTarget[D.id]),ca.upload(O,Wt(at),mn,ce)),Z.isShaderMaterial&&Z.uniformsNeedUpdate===!0&&(ca.upload(O,Wt(at),mn,ce),Z.uniformsNeedUpdate=!1),Z.isSpriteMaterial&&Ft.setValue(O,"center",j.center),Ft.setValue(O,"modelViewMatrix",j.modelViewMatrix),Ft.setValue(O,"normalMatrix",j.normalMatrix),Ft.setValue(O,"modelMatrix",j.matrixWorld),Z.isShaderMaterial||Z.isRawShaderMaterial){const Xt=Z.uniformsGroups;for(let $t=0,nr=Xt.length;$t<nr;$t++){const ni=Xt[$t];H.update(ni,xn),H.bind(ni,xn)}}return xn}function Ki(D,X){D.ambientLightColor.needsUpdate=X,D.lightProbe.needsUpdate=X,D.directionalLights.needsUpdate=X,D.directionalLightShadows.needsUpdate=X,D.pointLights.needsUpdate=X,D.pointLightShadows.needsUpdate=X,D.spotLights.needsUpdate=X,D.spotLightShadows.needsUpdate=X,D.rectAreaLights.needsUpdate=X,D.hemisphereLights.needsUpdate=X}function Zi(D){return D.isMeshLambertMaterial||D.isMeshToonMaterial||D.isMeshPhongMaterial||D.isMeshStandardMaterial||D.isShadowMaterial||D.isShaderMaterial&&D.lights===!0}this.getActiveCubeFace=function(){return C},this.getActiveMipmapLevel=function(){return T},this.getRenderTarget=function(){return P},this.setRenderTargetTextures=function(D,X,J){const Z=he.get(D);Z.__autoAllocateDepthBuffer=D.resolveDepthBuffer===!1,Z.__autoAllocateDepthBuffer===!1&&(Z.__useRenderToTexture=!1),he.get(D.texture).__webglTexture=X,he.get(D.depthTexture).__webglTexture=Z.__autoAllocateDepthBuffer?void 0:J,Z.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(D,X){const J=he.get(D);J.__webglFramebuffer=X,J.__useDefaultFramebuffer=X===void 0};const Qi=O.createFramebuffer();this.setRenderTarget=function(D,X=0,J=0){P=D,C=X,T=J;let Z=!0,j=null,be=!1,Oe=!1;if(D){const We=he.get(D);if(We.__useDefaultFramebuffer!==void 0)te.bindFramebuffer(O.FRAMEBUFFER,null),Z=!1;else if(We.__webglFramebuffer===void 0)ce.setupRenderTarget(D);else if(We.__hasExternalTextures)ce.rebindTextures(D,he.get(D.texture).__webglTexture,he.get(D.depthTexture).__webglTexture);else if(D.depthBuffer){const et=D.depthTexture;if(We.__boundDepthTexture!==et){if(et!==null&&he.has(et)&&(D.width!==et.image.width||D.height!==et.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");ce.setupDepthRenderbuffer(D)}}const ut=D.texture;(ut.isData3DTexture||ut.isDataArrayTexture||ut.isCompressedArrayTexture)&&(Oe=!0);const dt=he.get(D).__webglFramebuffer;D.isWebGLCubeRenderTarget?(Array.isArray(dt[X])?j=dt[X][J]:j=dt[X],be=!0):D.samples>0&&ce.useMultisampledRTT(D)===!1?j=he.get(D).__webglMultisampledFramebuffer:Array.isArray(dt)?j=dt[J]:j=dt,R.copy(D.viewport),B.copy(D.scissor),V=D.scissorTest}else R.copy(le).multiplyScalar(q).floor(),B.copy(Le).multiplyScalar(q).floor(),V=Te;if(J!==0&&(j=Qi),te.bindFramebuffer(O.FRAMEBUFFER,j)&&Z&&te.drawBuffers(D,j),te.viewport(R),te.scissor(B),te.setScissorTest(V),be){const We=he.get(D.texture);O.framebufferTexture2D(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_CUBE_MAP_POSITIVE_X+X,We.__webglTexture,J)}else if(Oe){const We=he.get(D.texture),ut=X;O.framebufferTextureLayer(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,We.__webglTexture,J,ut)}else if(D!==null&&J!==0){const We=he.get(D.texture);O.framebufferTexture2D(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_2D,We.__webglTexture,J)}b=-1},this.readRenderTargetPixels=function(D,X,J,Z,j,be,Oe,Ye=0){if(!(D&&D.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let We=he.get(D).__webglFramebuffer;if(D.isWebGLCubeRenderTarget&&Oe!==void 0&&(We=We[Oe]),We){te.bindFramebuffer(O.FRAMEBUFFER,We);try{const ut=D.textures[Ye],dt=ut.format,et=ut.type;if(!pe.textureFormatReadable(dt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!pe.textureTypeReadable(et)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}X>=0&&X<=D.width-Z&&J>=0&&J<=D.height-j&&(D.textures.length>1&&O.readBuffer(O.COLOR_ATTACHMENT0+Ye),O.readPixels(X,J,Z,j,Pe.convert(dt),Pe.convert(et),be))}finally{const ut=P!==null?he.get(P).__webglFramebuffer:null;te.bindFramebuffer(O.FRAMEBUFFER,ut)}}},this.readRenderTargetPixelsAsync=async function(D,X,J,Z,j,be,Oe,Ye=0){if(!(D&&D.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let We=he.get(D).__webglFramebuffer;if(D.isWebGLCubeRenderTarget&&Oe!==void 0&&(We=We[Oe]),We)if(X>=0&&X<=D.width-Z&&J>=0&&J<=D.height-j){te.bindFramebuffer(O.FRAMEBUFFER,We);const ut=D.textures[Ye],dt=ut.format,et=ut.type;if(!pe.textureFormatReadable(dt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!pe.textureTypeReadable(et))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const gt=O.createBuffer();O.bindBuffer(O.PIXEL_PACK_BUFFER,gt),O.bufferData(O.PIXEL_PACK_BUFFER,be.byteLength,O.STREAM_READ),D.textures.length>1&&O.readBuffer(O.COLOR_ATTACHMENT0+Ye),O.readPixels(X,J,Z,j,Pe.convert(dt),Pe.convert(et),0);const Rt=P!==null?he.get(P).__webglFramebuffer:null;te.bindFramebuffer(O.FRAMEBUFFER,Rt);const Ot=O.fenceSync(O.SYNC_GPU_COMMANDS_COMPLETE,0);return O.flush(),await Kf(O,Ot,4),O.bindBuffer(O.PIXEL_PACK_BUFFER,gt),O.getBufferSubData(O.PIXEL_PACK_BUFFER,0,be),O.deleteBuffer(gt),O.deleteSync(Ot),be}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(D,X=null,J=0){const Z=Math.pow(2,-J),j=Math.floor(D.image.width*Z),be=Math.floor(D.image.height*Z),Oe=X!==null?X.x:0,Ye=X!==null?X.y:0;ce.setTexture2D(D,0),O.copyTexSubImage2D(O.TEXTURE_2D,J,0,0,Oe,Ye,j,be),te.unbindTexture()};const er=O.createFramebuffer(),tr=O.createFramebuffer();this.copyTextureToTexture=function(D,X,J=null,Z=null,j=0,be=null){be===null&&(j!==0?(wr("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),be=j,j=0):be=0);let Oe,Ye,We,ut,dt,et,gt,Rt,Ot;const kt=D.isCompressedTexture?D.mipmaps[be]:D.image;if(J!==null)Oe=J.max.x-J.min.x,Ye=J.max.y-J.min.y,We=J.isBox3?J.max.z-J.min.z:1,ut=J.min.x,dt=J.min.y,et=J.isBox3?J.min.z:0;else{const un=Math.pow(2,-j);Oe=Math.floor(kt.width*un),Ye=Math.floor(kt.height*un),D.isDataArrayTexture?We=kt.depth:D.isData3DTexture?We=Math.floor(kt.depth*un):We=1,ut=0,dt=0,et=0}Z!==null?(gt=Z.x,Rt=Z.y,Ot=Z.z):(gt=0,Rt=0,Ot=0);const St=Pe.convert(X.format),at=Pe.convert(X.type);let Yt;X.isData3DTexture?(ce.setTexture3D(X,0),Yt=O.TEXTURE_3D):X.isDataArrayTexture||X.isCompressedArrayTexture?(ce.setTexture2DArray(X,0),Yt=O.TEXTURE_2D_ARRAY):(ce.setTexture2D(X,0),Yt=O.TEXTURE_2D),O.pixelStorei(O.UNPACK_FLIP_Y_WEBGL,X.flipY),O.pixelStorei(O.UNPACK_PREMULTIPLY_ALPHA_WEBGL,X.premultiplyAlpha),O.pixelStorei(O.UNPACK_ALIGNMENT,X.unpackAlignment);const Et=O.getParameter(O.UNPACK_ROW_LENGTH),xn=O.getParameter(O.UNPACK_IMAGE_HEIGHT),zt=O.getParameter(O.UNPACK_SKIP_PIXELS),rn=O.getParameter(O.UNPACK_SKIP_ROWS),Li=O.getParameter(O.UNPACK_SKIP_IMAGES);O.pixelStorei(O.UNPACK_ROW_LENGTH,kt.width),O.pixelStorei(O.UNPACK_IMAGE_HEIGHT,kt.height),O.pixelStorei(O.UNPACK_SKIP_PIXELS,ut),O.pixelStorei(O.UNPACK_SKIP_ROWS,dt),O.pixelStorei(O.UNPACK_SKIP_IMAGES,et);const Ft=D.isDataArrayTexture||D.isData3DTexture,mn=X.isDataArrayTexture||X.isData3DTexture;if(D.isDepthTexture){const un=he.get(D),Xt=he.get(X),$t=he.get(un.__renderTarget),nr=he.get(Xt.__renderTarget);te.bindFramebuffer(O.READ_FRAMEBUFFER,$t.__webglFramebuffer),te.bindFramebuffer(O.DRAW_FRAMEBUFFER,nr.__webglFramebuffer);for(let ni=0;ni<We;ni++)Ft&&(O.framebufferTextureLayer(O.READ_FRAMEBUFFER,O.COLOR_ATTACHMENT0,he.get(D).__webglTexture,j,et+ni),O.framebufferTextureLayer(O.DRAW_FRAMEBUFFER,O.COLOR_ATTACHMENT0,he.get(X).__webglTexture,be,Ot+ni)),O.blitFramebuffer(ut,dt,Oe,Ye,gt,Rt,Oe,Ye,O.DEPTH_BUFFER_BIT,O.NEAREST);te.bindFramebuffer(O.READ_FRAMEBUFFER,null),te.bindFramebuffer(O.DRAW_FRAMEBUFFER,null)}else if(j!==0||D.isRenderTargetTexture||he.has(D)){const un=he.get(D),Xt=he.get(X);te.bindFramebuffer(O.READ_FRAMEBUFFER,er),te.bindFramebuffer(O.DRAW_FRAMEBUFFER,tr);for(let $t=0;$t<We;$t++)Ft?O.framebufferTextureLayer(O.READ_FRAMEBUFFER,O.COLOR_ATTACHMENT0,un.__webglTexture,j,et+$t):O.framebufferTexture2D(O.READ_FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_2D,un.__webglTexture,j),mn?O.framebufferTextureLayer(O.DRAW_FRAMEBUFFER,O.COLOR_ATTACHMENT0,Xt.__webglTexture,be,Ot+$t):O.framebufferTexture2D(O.DRAW_FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_2D,Xt.__webglTexture,be),j!==0?O.blitFramebuffer(ut,dt,Oe,Ye,gt,Rt,Oe,Ye,O.COLOR_BUFFER_BIT,O.NEAREST):mn?O.copyTexSubImage3D(Yt,be,gt,Rt,Ot+$t,ut,dt,Oe,Ye):O.copyTexSubImage2D(Yt,be,gt,Rt,ut,dt,Oe,Ye);te.bindFramebuffer(O.READ_FRAMEBUFFER,null),te.bindFramebuffer(O.DRAW_FRAMEBUFFER,null)}else mn?D.isDataTexture||D.isData3DTexture?O.texSubImage3D(Yt,be,gt,Rt,Ot,Oe,Ye,We,St,at,kt.data):X.isCompressedArrayTexture?O.compressedTexSubImage3D(Yt,be,gt,Rt,Ot,Oe,Ye,We,St,kt.data):O.texSubImage3D(Yt,be,gt,Rt,Ot,Oe,Ye,We,St,at,kt):D.isDataTexture?O.texSubImage2D(O.TEXTURE_2D,be,gt,Rt,Oe,Ye,St,at,kt.data):D.isCompressedTexture?O.compressedTexSubImage2D(O.TEXTURE_2D,be,gt,Rt,kt.width,kt.height,St,kt.data):O.texSubImage2D(O.TEXTURE_2D,be,gt,Rt,Oe,Ye,St,at,kt);O.pixelStorei(O.UNPACK_ROW_LENGTH,Et),O.pixelStorei(O.UNPACK_IMAGE_HEIGHT,xn),O.pixelStorei(O.UNPACK_SKIP_PIXELS,zt),O.pixelStorei(O.UNPACK_SKIP_ROWS,rn),O.pixelStorei(O.UNPACK_SKIP_IMAGES,Li),be===0&&X.generateMipmaps&&O.generateMipmap(Yt),te.unbindTexture()},this.copyTextureToTexture3D=function(D,X,J=null,Z=null,j=0){return wr('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(D,X,J,Z,j)},this.initRenderTarget=function(D){he.get(D).__webglFramebuffer===void 0&&ce.setupRenderTarget(D)},this.initTexture=function(D){D.isCubeTexture?ce.setTextureCube(D,0):D.isData3DTexture?ce.setTexture3D(D,0):D.isDataArrayTexture||D.isCompressedArrayTexture?ce.setTexture2DArray(D,0):ce.setTexture2D(D,0),te.unbindTexture()},this.resetState=function(){C=0,T=0,P=null,te.reset(),ct.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return di}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=xt._getDrawingBufferColorSpace(e),t.unpackColorSpace=xt._getUnpackColorSpace()}}var s3=Object.defineProperty,a3=(r,e,t)=>e in r?s3(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Lt=(r,e,t)=>a3(r,typeof e!="symbol"?e+"":e,t);const qu=(r,e)=>{const[t,n]=e.split("-");return Object.assign(r.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},o3=({placement:r,size:e,offset:t,id:n,className:i})=>{const s=document.createElement("div"),{top:a,left:o,right:l,bottom:c}=t;return Object.assign(s.style,{id:n,position:"absolute",zIndex:"1000",height:`${e}px`,width:`${e}px`,margin:`${a}px ${l}px ${c}px ${o}px`,borderRadius:"100%"}),qu(s,r),n&&(s.id=n),i&&(s.className=i),s},l3=r=>{const e=typeof r=="string"?document.querySelector(r):r;if(!e)throw Error("Invalid DOM element");return e};function gl(r,e,t){return Math.max(e,Math.min(t,r))}const c3=[["x",0,3],["y",1,4],["z",2,5]],Rh=new F;function Dh({isSphere:r},e,t){r&&(Rh.set(0,0,1).applyQuaternion(t.quaternion),c3.forEach(([n,i,s])=>{const a=Rh[n];let o=e[i],l=o.userData.opacity;o.material.opacity=gl(a>=0?l:l/2,0,1),o=e[s],l=o.userData.opacity,o.material.opacity=gl(a>=0?l/2:l,0,1)}))}const h3=(r,e,t=10)=>Math.abs(r.clientX-e.x)<t&&Math.abs(r.clientY-e.y)<t,Lh=new v0,Ph=new Ge,Ih=(r,e,t,n)=>{Ph.set((r.clientX-e.left)/e.width*2-1,-((r.clientY-e.top)/e.height)*2+1),Lh.setFromCamera(Ph,t);const i=Lh.intersectObjects(n,!1),s=i.length?i[0]:null;return!s||!s.object.visible?null:s},vo=1e-6,u3=2*Math.PI,ju=["x","y","z"],ls=[...ju,"nx","ny","nz"],d3=["x","z","y","nx","nz","ny"],f3=["z","x","y","nz","nx","ny"],_l="Right",ha="Top",vl="Front",yl="Left",ua="Bottom",xl="Back",p3=[_l,ha,vl,yl,ua,xl].map(r=>r.toLocaleLowerCase()),Yu=1.3,Nh=(r,e=!0)=>{const{material:t,userData:n}=r,{color:i,opacity:s}=e?n.hover:n;t.color.set(i),t.opacity=s},zi=r=>JSON.parse(JSON.stringify(r)),m3=r=>{const e=r.type||"sphere",t=e==="sphere",n=r.resolution||t?64:128,i=Ut.DEFAULT_UP,s=i.z===1,a=i.x===1,{container:o}=r;r.container=void 0,r=JSON.parse(JSON.stringify(r)),r.container=o;const l=s?d3:a?f3:ls;p3.forEach((d,f)=>{r[d]&&(r[l[f]]=r[d])});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}},u={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:{...zi(c),...t?{label:"X",color:16725587,line:!0}:{label:a?ha:_l}},y:{...zi(c),...t?{label:"Y",color:9100032,line:!0}:{label:s||a?vl:ha}},z:{...zi(c),...t?{label:"Z",color:2920447,line:!0}:{label:s?ha:a?_l:vl}},nx:{...zi(h),label:t?"":a?ua:yl},ny:{...zi(h),label:t?"":s||a?xl:ua},nz:{...zi(h),label:t?"":s?ua:a?yl:xl}};return Ml(r,u),ju.forEach(d=>Ml(r[`n${d}`],zi(r[d]))),{...r,isSphere:t}};function Ml(r,...e){if(r instanceof HTMLElement||typeof r!="object"||r===null)return r;for(const t of e)for(const n in t)n!=="container"&&n in t&&(r[n]===void 0?r[n]=t[n]:typeof t[n]=="object"&&!Array.isArray(t[n])&&(r[n]=Ml(r[n]||{},t[n])));return r}const g3=(r,e=2)=>{const t=new st,n=e*2,{isSphere:i,resolution:s,radius:a,font:o,corners:l,edges:c}=r,h=ls.map(T=>({...r[T],radius:a}));i&&l.enabled&&h.push(l),i&&c.enabled&&h.push(c);const u=document.createElement("canvas"),d=u.getContext("2d");u.width=s*2+n*2,u.height=s*h.length+n*h.length;const[f,m]=N(h,s,o);h.forEach(({radius:T,label:P,color:b,labelColor:x,border:R,hover:{color:B,labelColor:V,border:W}},ee)=>{const k=s*ee+ee*n+e;v(e,k,e,s,T,P,R,b,x),v(s+e*3,k,e,s,T,P,W??R,B??b,V??x)});const _=h.length,g=e/(s*2),p=e/(s*6),S=1/_,E=new Dp(u);return E.repeat.set(.5-2*g,S-2*p),E.offset.set(g,1-p),Object.assign(E,{colorSpace:Tt,wrapS:$n,wrapT:$n,userData:{offsetX:g,offsetY:p,cellHeight:S}}),E;function v(T,P,b,x,R,B,V,W,ee){if(R=R*(x/2),W!=null&&W!==""&&(k(),d.fillStyle=t.set(W).getStyle(),d.fill()),V&&V.size){const Q=V.size*x/2;T+=Q,P+=Q,x-=V.size*x,R=Math.max(0,R-Q),k(),d.strokeStyle=t.set(V.color).getStyle(),d.lineWidth=V.size*x,d.stroke()}B&&C(d,T+x/2,P+(x+b)/2,B,t.set(ee).getStyle());function k(){d.beginPath(),d.moveTo(T+R,P),d.lineTo(T+x-R,P),d.arcTo(T+x,P,T+x,P+R,R),d.lineTo(T+x,P+x-R),d.arcTo(T+x,P+x,T+x-R,P+x,R),d.lineTo(T+R,P+x),d.arcTo(T,P+x,T,P+x-R,R),d.lineTo(T,P+R),d.arcTo(T,P,T+R,P,R),d.closePath()}}function N(T,P,b){const x=[...T].sort((ye,le)=>{var Le,Te;return(((Le=ye.label)==null?void 0:Le.length)||0)-(((Te=le.label)==null?void 0:Te.length)||0)}).pop().label,{family:R,weight:B}=b,V=i?Math.sqrt(Math.pow(P*.7,2)/2):P;let W=V,ee=0,k=0;do{d.font=`${B} ${W}px ${R}`;const ye=d.measureText(x);ee=ye.width,k=ye.fontBoundingBoxDescent,W--}while(ee>V&&W>0);const Q=V/k,q=Math.min(V/ee,Q),ue=Math.floor(W*q);return[`${B} ${ue}px ${R}`,Q]}function C(T,P,b,x,R){T.font=f,T.textAlign="center",T.textBaseline="middle",T.fillStyle=R,T.fillText(x,P,b+(i?m:0))}},_3=(r,e)=>r.offset.x=(e?.5:0)+r.userData.offsetX,Jl=(r,e)=>{const{offset:t,userData:{offsetY:n,cellHeight:i}}=r;t.y=1-(e+1)*i+n};function Kl(r,e,t=2,n=2){const i=t/2-r,s=n/2-r,a=r/t,o=(t-r)/t,l=r/n,c=(n-r)/n,h=[i,s,0,-i,s,0,-i,-s,0,i,-s,0],u=[o,c,a,c,a,l,o,l],d=[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(C=>d[C]);let m,_,g,p,S,E,v,N;for(let C=0;C<4;C++){p=C<1||C>2?i:-i,S=C<2?s:-s,E=C<1||C>2?o:a,v=C<2?c:l;for(let T=0;T<=e;T++)m=Math.PI/2*(C+T/e),_=Math.cos(m),g=Math.sin(m),h.push(p+r*_,S+r*g,0),u.push(E+a*_,v+l*g),T<e&&(N=(e+1)*C+T+4,f.push(C,N,N+1))}return new Bt().setIndex(new Gt(new Uint32Array(f),1)).setAttribute("position",new Gt(new Float32Array(h),3)).setAttribute("uv",new Gt(new Float32Array(u),2))}const v3=(r,e)=>{const t=new F,{isSphere:n,radius:i,smoothness:s}=r,a=Kl(i,s);return ls.map((o,l)=>{const c=l<3,h=ls[l],u=l?e.clone():e;Jl(u,l);const{enabled:d,scale:f,opacity:m,hover:_}=r[h],g={map:u,opacity:m,transparent:!0},p=n?new zl(new Aa(g)):new Ct(a,new Ri(g)),S=c?h:h[1];return p.position[S]=(c?1:-1)*(n?Yu:1),n||p.lookAt(t.copy(p.position).multiplyScalar(1.7)),p.scale.setScalar(f),p.renderOrder=1,p.visible=d,p.userData={scale:f,opacity:m,hover:_},p})},y3=(r,e)=>{const{isSphere:t,corners:n}=r;if(!n.enabled)return[];const{color:i,opacity:s,scale:a,radius:o,smoothness:l,hover:c}=n,h=t?null:Kl(o,l),u={transparent:!0,opacity:s},d=[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(d.length/3).fill(0).map((m,_)=>{if(t){const S=e.clone();Jl(S,6),u.map=S}else u.color=i;const g=t?new zl(new Aa(u)):new Ct(h,new Ri(u)),p=_*3;return g.position.set(d[p],d[p+1],d[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:s,scale:a,hover:c},g})},x3=(r,e,t)=>{const{isSphere:n,edges:i}=r;if(!i.enabled)return[];const{color:s,opacity:a,scale:o,hover:l,radius:c,smoothness:h}=i,u=n?null:Kl(c,h,1.2,.25),d={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 v=e.clone();Jl(v,t),d.map=v}else d.color=s;const S=n?new zl(new Aa(d)):new Ct(u,new Ri(d)),E=p*3;return S.position.set(f[E],f[E+1],f[E+2]),n&&S.position.normalize().multiplyScalar(1.7),S.scale.setScalar(o),S.up.copy(_),S.lookAt(m.copy(S.position).multiplyScalar(2)),!n&&!S.position.y&&(S.rotation.z=Math.PI/2),S.renderOrder=1,S.userData={color:s,opacity:a,scale:o,hover:l},S})};function M3(r,e=!1){const t=r[0].index!==null,n=new Set(Object.keys(r[0].attributes)),i=new Set(Object.keys(r[0].morphAttributes)),s={},a={},o=r[0].morphTargetsRelative,l=new Bt;let c=0;for(let h=0;h<r.length;++h){const u=r[h];let d=0;if(t!==(u.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 u.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;s[f]===void 0&&(s[f]=[]),s[f].push(u.attributes[f]),d++}if(d!==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!==u.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 u.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(u.morphAttributes[f])}if(e){let f;if(t)f=u.index.count;else if(u.attributes.position!==void 0)f=u.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 u=[];for(let d=0;d<r.length;++d){const f=r[d].index;for(let m=0;m<f.count;++m)u.push(f.getX(m)+h);h+=r[d].attributes.position.count}l.setIndex(u)}for(const h in s){const u=Uh(s[h]);if(!u)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+h+" attribute."),null;l.setAttribute(h,u)}for(const h in a){const u=a[h][0].length;if(u===0)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[h]=[];for(let d=0;d<u;++d){const f=[];for(let _=0;_<a[h].length;++_)f.push(a[h][_][d]);const m=Uh(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 Uh(r){let e,t,n,i=-1,s=0;for(let c=0;c<r.length;++c){const h=r[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;s+=h.count*t}const a=new e(s),o=new Gt(a,t,n);let l=0;for(let c=0;c<r.length;++c){const h=r[c];if(h.isInterleavedBufferAttribute){const u=l/t;for(let d=0,f=h.count;d<f;d++)for(let m=0;m<t;m++){const _=h.getComponent(d,m);o.setComponent(d+u,m,_)}}else a.set(h.array,l);l+=h.count*t}return i!==void 0&&(o.gpuType=i),o}const b3=(r,e)=>{const{isSphere:t,background:{enabled:n,color:i,opacity:s,hover:a}}=e;let o;const l=new Ri({color:i,side:vn,opacity:s,transparent:!0,depthWrite:!1});if(!n)return null;if(t)o=new Ct(new wa(1.8,64,64),l);else{let c;r.forEach(h=>{const u=h.scale.x;h.scale.setScalar(.9),h.updateMatrix();const d=h.geometry.clone();d.applyMatrix4(h.matrix),c=c?M3([c,d]):d,h.scale.setScalar(u)}),o=new Ct(c,l)}return o.userData={color:i,opacity:s,hover:a},o},Fh=new ei,$s=new F;class $u extends m0{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 fl(t,6,1);return this.setAttribute("instanceStart",new Zn(n,3,0)),this.setAttribute("instanceEnd",new Zn(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 fl(t,6,1);return this.setAttribute("instanceColorStart",new Zn(n,3,0)),this.setAttribute("instanceColorEnd",new Zn(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 qp(e.geometry)),this}fromLineSegments(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new ei);const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;e!==void 0&&t!==void 0&&(this.boundingBox.setFromBufferAttribute(e),Fh.setFromBufferAttribute(t),this.boundingBox.union(Fh))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new mi),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 s=0,a=e.count;s<a;s++)$s.fromBufferAttribute(e,s),i=Math.max(i,n.distanceToSquared($s)),$s.fromBufferAttribute(t,s),i=Math.max(i,n.distanceToSquared($s));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)}}Ne.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new Ge(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};Sn.line={uniforms:Fl.merge([Ne.common,Ne.fog,Ne.line]),vertexShader:`
|
|
3827
|
+
}`;class Qg{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(this.texture===null){const i=new cn,s=e.properties.get(i);s.__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 pi({vertexShader:Jg,fragmentShader:Zg,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Ct(new us(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class e3 extends $i{constructor(e,t){super();const n=this;let i=null,s=1,a=null,o="local-floor",l=1,c=null,h=null,u=null,d=null,f=null,m=null;const _=new Qg,g=t.getContextAttributes();let p=null,S=null;const E=[],v=[],N=new Ge;let C=null;const T=new ln;T.viewport=new Mt;const L=new ln;L.viewport=new Mt;const b=[T,L],x=new g0;let R=null,B=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Y){let re=E[Y];return re===void 0&&(re=new to,E[Y]=re),re.getTargetRaySpace()},this.getControllerGrip=function(Y){let re=E[Y];return re===void 0&&(re=new to,E[Y]=re),re.getGripSpace()},this.getHand=function(Y){let re=E[Y];return re===void 0&&(re=new to,E[Y]=re),re.getHandSpace()};function V(Y){const re=v.indexOf(Y.inputSource);if(re===-1)return;const ae=E[re];ae!==void 0&&(ae.update(Y.inputSource,Y.frame,c||a),ae.dispatchEvent({type:Y.type,data:Y.inputSource}))}function W(){i.removeEventListener("select",V),i.removeEventListener("selectstart",V),i.removeEventListener("selectend",V),i.removeEventListener("squeeze",V),i.removeEventListener("squeezestart",V),i.removeEventListener("squeezeend",V),i.removeEventListener("end",W),i.removeEventListener("inputsourceschange",ee);for(let Y=0;Y<E.length;Y++){const re=v[Y];re!==null&&(v[Y]=null,E[Y].disconnect(re))}R=null,B=null,_.reset(),e.setRenderTarget(p),f=null,d=null,u=null,i=null,S=null,Te.stop(),n.isPresenting=!1,e.setPixelRatio(C),e.setSize(N.width,N.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(Y){s=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 d!==null?d:f},this.getBinding=function(){return u},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",V),i.addEventListener("selectstart",V),i.addEventListener("selectend",V),i.addEventListener("squeeze",V),i.addEventListener("squeezestart",V),i.addEventListener("squeezeend",V),i.addEventListener("end",W),i.addEventListener("inputsourceschange",ee),g.xrCompatible!==!0&&await t.makeXRCompatible(),C=e.getPixelRatio(),e.getSize(N),typeof XRWebGLBinding<"u"&&"createProjectionLayer"in XRWebGLBinding.prototype){let ae=null,oe=null,Ee=null;g.depth&&(Ee=g.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,ae=g.stencil?as:ss,oe=g.stencil?rs:qi);const _e={colorFormat:t.RGBA8,depthFormat:Ee,scaleFactor:s};u=new XRWebGLBinding(i,t),d=u.createProjectionLayer(_e),i.updateRenderState({layers:[d]}),e.setPixelRatio(1),e.setSize(d.textureWidth,d.textureHeight,!1),S=new ji(d.textureWidth,d.textureHeight,{format:Un,type:Qn,depthTexture:new Pu(d.textureWidth,d.textureHeight,oe,void 0,void 0,void 0,void 0,void 0,void 0,ae),stencilBuffer:g.stencil,colorSpace:e.outputColorSpace,samples:g.antialias?4:0,resolveDepthBuffer:d.ignoreDepthValues===!1,resolveStencilBuffer:d.ignoreDepthValues===!1})}else{const ae={antialias:g.antialias,alpha:!0,depth:g.depth,stencil:g.stencil,framebufferScaleFactor:s};f=new XRWebGLLayer(i,t,ae),i.updateRenderState({baseLayer:f}),e.setPixelRatio(1),e.setSize(f.framebufferWidth,f.framebufferHeight,!1),S=new ji(f.framebufferWidth,f.framebufferHeight,{format:Un,type:Qn,colorSpace:e.outputColorSpace,stencilBuffer:g.stencil,resolveDepthBuffer:f.ignoreDepthValues===!1,resolveStencilBuffer:f.ignoreDepthValues===!1})}S.isXRRenderTarget=!0,this.setFoveation(l),c=null,a=await i.requestReferenceSpace(o),Te.setContext(i),Te.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode},this.getDepthTexture=function(){return _.getDepthTexture()};function ee(Y){for(let re=0;re<Y.removed.length;re++){const ae=Y.removed[re],oe=v.indexOf(ae);oe>=0&&(v[oe]=null,E[oe].disconnect(ae))}for(let re=0;re<Y.added.length;re++){const ae=Y.added[re];let oe=v.indexOf(ae);if(oe===-1){for(let _e=0;_e<E.length;_e++)if(_e>=v.length){v.push(ae),oe=_e;break}else if(v[_e]===null){v[_e]=ae,oe=_e;break}if(oe===-1)break}const Ee=E[oe];Ee&&Ee.connect(ae)}}const k=new F,Q=new F;function q(Y,re,ae){k.setFromMatrixPosition(re.matrixWorld),Q.setFromMatrixPosition(ae.matrixWorld);const oe=k.distanceTo(Q),Ee=re.projectionMatrix.elements,_e=ae.projectionMatrix.elements,we=Ee[14]/(Ee[10]-1),ke=Ee[14]/(Ee[10]+1),tt=(Ee[9]+1)/Ee[5],Qe=(Ee[9]-1)/Ee[5],O=(Ee[8]-1)/Ee[0],bt=(_e[8]+1)/_e[0],$=we*O,pe=we*bt,te=oe/(-O+bt),Se=te*-O;if(re.matrixWorld.decompose(Y.position,Y.quaternion,Y.scale),Y.translateX(Se),Y.translateZ(te),Y.matrixWorld.compose(Y.position,Y.quaternion,Y.scale),Y.matrixWorldInverse.copy(Y.matrixWorld).invert(),Ee[10]===-1)Y.projectionMatrix.copy(re.projectionMatrix),Y.projectionMatrixInverse.copy(re.projectionMatrixInverse);else{const he=we+te,ce=ke+te,Ue=$-Se,U=pe+(oe-Se),A=tt*ke/ce*he,G=Qe*ke/ce*he;Y.projectionMatrix.makePerspective(Ue,U,A,G,he,ce),Y.projectionMatrixInverse.copy(Y.projectionMatrix).invert()}}function de(Y,re){re===null?Y.matrixWorld.copy(Y.matrix):Y.matrixWorld.multiplyMatrices(re.matrixWorld,Y.matrix),Y.matrixWorldInverse.copy(Y.matrixWorld).invert()}this.updateCamera=function(Y){if(i===null)return;let re=Y.near,ae=Y.far;_.texture!==null&&(_.depthNear>0&&(re=_.depthNear),_.depthFar>0&&(ae=_.depthFar)),x.near=L.near=T.near=re,x.far=L.far=T.far=ae,(R!==x.near||B!==x.far)&&(i.updateRenderState({depthNear:x.near,depthFar:x.far}),R=x.near,B=x.far),T.layers.mask=Y.layers.mask|2,L.layers.mask=Y.layers.mask|4,x.layers.mask=T.layers.mask|L.layers.mask;const oe=Y.parent,Ee=x.cameras;de(x,oe);for(let _e=0;_e<Ee.length;_e++)de(Ee[_e],oe);Ee.length===2?q(x,T,L):x.projectionMatrix.copy(T.projectionMatrix),ye(Y,x,oe)};function ye(Y,re,ae){ae===null?Y.matrix.copy(re.matrixWorld):(Y.matrix.copy(ae.matrixWorld),Y.matrix.invert(),Y.matrix.multiply(re.matrixWorld)),Y.matrix.decompose(Y.position,Y.quaternion,Y.scale),Y.updateMatrixWorld(!0),Y.projectionMatrix.copy(re.projectionMatrix),Y.projectionMatrixInverse.copy(re.projectionMatrixInverse),Y.isPerspectiveCamera&&(Y.fov=Lr*2*Math.atan(1/Y.projectionMatrix.elements[5]),Y.zoom=1)}this.getCamera=function(){return x},this.getFoveation=function(){if(!(d===null&&f===null))return l},this.setFoveation=function(Y){l=Y,d!==null&&(d.fixedFoveation=Y),f!==null&&f.fixedFoveation!==void 0&&(f.fixedFoveation=Y)},this.hasDepthSensing=function(){return _.texture!==null},this.getDepthSensingMesh=function(){return _.getMesh(x)};let le=null;function Pe(Y,re){if(h=re.getViewerPose(c||a),m=re,h!==null){const ae=h.views;f!==null&&(e.setRenderTargetFramebuffer(S,f.framebuffer),e.setRenderTarget(S));let oe=!1;ae.length!==x.cameras.length&&(x.cameras.length=0,oe=!0);for(let we=0;we<ae.length;we++){const ke=ae[we];let tt=null;if(f!==null)tt=f.getViewport(ke);else{const O=u.getViewSubImage(d,ke);tt=O.viewport,we===0&&(e.setRenderTargetTextures(S,O.colorTexture,O.depthStencilTexture),e.setRenderTarget(S))}let Qe=b[we];Qe===void 0&&(Qe=new ln,Qe.layers.enable(we),Qe.viewport=new Mt,b[we]=Qe),Qe.matrix.fromArray(ke.transform.matrix),Qe.matrix.decompose(Qe.position,Qe.quaternion,Qe.scale),Qe.projectionMatrix.fromArray(ke.projectionMatrix),Qe.projectionMatrixInverse.copy(Qe.projectionMatrix).invert(),Qe.viewport.set(tt.x,tt.y,tt.width,tt.height),we===0&&(x.matrix.copy(Qe.matrix),x.matrix.decompose(x.position,x.quaternion,x.scale)),oe===!0&&x.cameras.push(Qe)}const Ee=i.enabledFeatures;if(Ee&&Ee.includes("depth-sensing")&&i.depthUsage=="gpu-optimized"&&u){const we=u.getDepthInformation(ae[0]);we&&we.isValid&&we.texture&&_.init(e,we,i.renderState)}}for(let ae=0;ae<E.length;ae++){const oe=v[ae],Ee=E[ae];oe!==null&&Ee!==void 0&&Ee.update(oe,re,c||a)}le&&le(Y,re),re.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:re}),m=null}const Te=new Vu;Te.setAnimationLoop(Pe),this.setAnimationLoop=function(Y){le=Y},this.dispose=function(){}}}const Oi=new yn,t3=new lt;function n3(r,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,Eu(r)),p.isFog?(g.fogNear.value=p.near,g.fogFar.value=p.far):p.isFogExp2&&(g.fogDensity.value=p.density)}function i(g,p,S,E,v){p.isMeshBasicMaterial||p.isMeshLambertMaterial?s(g,p):p.isMeshToonMaterial?(s(g,p),u(g,p)):p.isMeshPhongMaterial?(s(g,p),h(g,p)):p.isMeshStandardMaterial?(s(g,p),d(g,p),p.isMeshPhysicalMaterial&&f(g,p,v)):p.isMeshMatcapMaterial?(s(g,p),m(g,p)):p.isMeshDepthMaterial?s(g,p):p.isMeshDistanceMaterial?(s(g,p),_(g,p)):p.isMeshNormalMaterial?s(g,p):p.isLineBasicMaterial?(a(g,p),p.isLineDashedMaterial&&o(g,p)):p.isPointsMaterial?l(g,p,S,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 s(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===vn&&(g.bumpScale.value*=-1)),p.normalMap&&(g.normalMap.value=p.normalMap,t(p.normalMap,g.normalMapTransform),g.normalScale.value.copy(p.normalScale),p.side===vn&&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 S=e.get(p),E=S.envMap,v=S.envMapRotation;E&&(g.envMap.value=E,Oi.copy(v),Oi.x*=-1,Oi.y*=-1,Oi.z*=-1,E.isCubeTexture&&E.isRenderTargetTexture===!1&&(Oi.y*=-1,Oi.z*=-1),g.envMapRotation.value.setFromMatrix4(t3.makeRotationFromEuler(Oi)),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,S,E){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,g.size.value=p.size*S,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 u(g,p){p.gradientMap&&(g.gradientMap.value=p.gradientMap)}function d(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,S){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===vn&&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=S.texture,g.transmissionSamplerSize.value.set(S.width,S.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 S=e.get(p).light;g.referencePosition.value.setFromMatrixPosition(S.matrixWorld),g.nearDistance.value=S.shadow.camera.near,g.farDistance.value=S.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function i3(r,e,t,n){let i={},s={},a=[];const o=r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS);function l(S,E){const v=E.program;n.uniformBlockBinding(S,v)}function c(S,E){let v=i[S.id];v===void 0&&(m(S),v=h(S),i[S.id]=v,S.addEventListener("dispose",g));const N=E.program;n.updateUBOMapping(S,N);const C=e.render.frame;s[S.id]!==C&&(d(S),s[S.id]=C)}function h(S){const E=u();S.__bindingPointIndex=E;const v=r.createBuffer(),N=S.__size,C=S.usage;return r.bindBuffer(r.UNIFORM_BUFFER,v),r.bufferData(r.UNIFORM_BUFFER,N,C),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,E,v),v}function u(){for(let S=0;S<o;S++)if(a.indexOf(S)===-1)return a.push(S),S;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function d(S){const E=i[S.id],v=S.uniforms,N=S.__cache;r.bindBuffer(r.UNIFORM_BUFFER,E);for(let C=0,T=v.length;C<T;C++){const L=Array.isArray(v[C])?v[C]:[v[C]];for(let b=0,x=L.length;b<x;b++){const R=L[b];if(f(R,C,b,N)===!0){const B=R.__offset,V=Array.isArray(R.value)?R.value:[R.value];let W=0;for(let ee=0;ee<V.length;ee++){const k=V[ee],Q=_(k);typeof k=="number"||typeof k=="boolean"?(R.__data[0]=k,r.bufferSubData(r.UNIFORM_BUFFER,B+W,R.__data)):k.isMatrix3?(R.__data[0]=k.elements[0],R.__data[1]=k.elements[1],R.__data[2]=k.elements[2],R.__data[3]=0,R.__data[4]=k.elements[3],R.__data[5]=k.elements[4],R.__data[6]=k.elements[5],R.__data[7]=0,R.__data[8]=k.elements[6],R.__data[9]=k.elements[7],R.__data[10]=k.elements[8],R.__data[11]=0):(k.toArray(R.__data,W),W+=Q.storage/Float32Array.BYTES_PER_ELEMENT)}r.bufferSubData(r.UNIFORM_BUFFER,B,R.__data)}}}r.bindBuffer(r.UNIFORM_BUFFER,null)}function f(S,E,v,N){const C=S.value,T=E+"_"+v;if(N[T]===void 0)return typeof C=="number"||typeof C=="boolean"?N[T]=C:N[T]=C.clone(),!0;{const L=N[T];if(typeof C=="number"||typeof C=="boolean"){if(L!==C)return N[T]=C,!0}else if(L.equals(C)===!1)return L.copy(C),!0}return!1}function m(S){const E=S.uniforms;let v=0;const N=16;for(let T=0,L=E.length;T<L;T++){const b=Array.isArray(E[T])?E[T]:[E[T]];for(let x=0,R=b.length;x<R;x++){const B=b[x],V=Array.isArray(B.value)?B.value:[B.value];for(let W=0,ee=V.length;W<ee;W++){const k=V[W],Q=_(k),q=v%N,de=q%Q.boundary,ye=q+de;v+=de,ye!==0&&N-ye<Q.storage&&(v+=N-ye),B.__data=new Float32Array(Q.storage/Float32Array.BYTES_PER_ELEMENT),B.__offset=v,v+=Q.storage}}}const C=v%N;return C>0&&(v+=N-C),S.__size=v,S.__cache={},this}function _(S){const E={boundary:0,storage:0};return typeof S=="number"||typeof S=="boolean"?(E.boundary=4,E.storage=4):S.isVector2?(E.boundary=8,E.storage=8):S.isVector3||S.isColor?(E.boundary=16,E.storage=12):S.isVector4?(E.boundary=16,E.storage=16):S.isMatrix3?(E.boundary=48,E.storage=48):S.isMatrix4?(E.boundary=64,E.storage=64):S.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",S),E}function g(S){const E=S.target;E.removeEventListener("dispose",g);const v=a.indexOf(E.__bindingPointIndex);a.splice(v,1),r.deleteBuffer(i[E.id]),delete i[E.id],delete s[E.id]}function p(){for(const S in i)r.deleteBuffer(i[S]);a=[],i={},s={}}return{bind:l,update:c,dispose:p}}class r3{constructor(e={}){const{canvas:t=Kf(),context:n=null,depth:i=!0,stencil:s=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:u=!1,reverseDepthBuffer:d=!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 S=[],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=Ti,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const v=this;let N=!1;this._outputColorSpace=Tt;let C=0,T=0,L=null,b=-1,x=null;const R=new Mt,B=new Mt;let V=null;const W=new st(0);let ee=0,k=t.width,Q=t.height,q=1,de=null,ye=null;const le=new Mt(0,0,k,Q),Pe=new Mt(0,0,k,Q);let Te=!1;const Y=new kl;let re=!1,ae=!1;const oe=new lt,Ee=new lt,_e=new F,we=new Mt,ke={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let tt=!1;function Qe(){return L===null?q:1}let O=n;function bt(D,X){return t.getContext(D,X)}try{const D={alpha:!0,depth:i,stencil:s,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:h,failIfMajorPerformanceCaveat:u};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${wl}`),t.addEventListener("webglcontextlost",He,!1),t.addEventListener("webglcontextrestored",Me,!1),t.addEventListener("webglcontextcreationerror",ge,!1),O===null){const X="webgl2";if(O=bt(X,D),O===null)throw bt(X)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(D){throw console.error("THREE.WebGLRenderer: "+D.message),D}let $,pe,te,Se,he,ce,Ue,U,A,G,z,se,ne,Ce,Ae,Be,Ve,me,De,Ke,nt,Le,ct,H;function Fe(){$=new p2(O),$.init(),Le=new Kg(O,$),pe=new o2(O,$,e,Le),te=new Yg(O,$),pe.reverseDepthBuffer&&d&&te.buffers.depth.setReversed(!0),Se=new _2(O),he=new Ug,ce=new $g(O,$,te,he,pe,Le,Se),Ue=new c2(v),U=new f2(v),A=new S0(O),ct=new s2(O,A),G=new m2(O,A,Se,ct),z=new y2(O,G,A,Se),De=new v2(O,pe,ce),Be=new l2(he),se=new Ng(v,Ue,U,$,pe,ct,Be),ne=new n3(v,he),Ce=new Og,Ae=new Gg($),me=new r2(v,Ue,U,te,z,f,l),Ve=new qg(v,z,pe),H=new i3(O,Se,pe,te),Ke=new a2(O,$,Se),nt=new g2(O,$,Se),Se.programs=se.programs,v.capabilities=pe,v.extensions=$,v.properties=he,v.renderLists=Ce,v.shadowMap=Ve,v.state=te,v.info=Se}Fe();const ve=new e3(v,O);this.xr=ve,this.getContext=function(){return O},this.getContextAttributes=function(){return O.getContextAttributes()},this.forceContextLoss=function(){const D=$.get("WEBGL_lose_context");D&&D.loseContext()},this.forceContextRestore=function(){const D=$.get("WEBGL_lose_context");D&&D.restoreContext()},this.getPixelRatio=function(){return q},this.setPixelRatio=function(D){D!==void 0&&(q=D,this.setSize(k,Q,!1))},this.getSize=function(D){return D.set(k,Q)},this.setSize=function(D,X,K=!0){if(ve.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}k=D,Q=X,t.width=Math.floor(D*q),t.height=Math.floor(X*q),K===!0&&(t.style.width=D+"px",t.style.height=X+"px"),this.setViewport(0,0,D,X)},this.getDrawingBufferSize=function(D){return D.set(k*q,Q*q).floor()},this.setDrawingBufferSize=function(D,X,K){k=D,Q=X,q=K,t.width=Math.floor(D*K),t.height=Math.floor(X*K),this.setViewport(0,0,D,X)},this.getCurrentViewport=function(D){return D.copy(R)},this.getViewport=function(D){return D.copy(le)},this.setViewport=function(D,X,K,Z){D.isVector4?le.set(D.x,D.y,D.z,D.w):le.set(D,X,K,Z),te.viewport(R.copy(le).multiplyScalar(q).round())},this.getScissor=function(D){return D.copy(Pe)},this.setScissor=function(D,X,K,Z){D.isVector4?Pe.set(D.x,D.y,D.z,D.w):Pe.set(D,X,K,Z),te.scissor(B.copy(Pe).multiplyScalar(q).round())},this.getScissorTest=function(){return Te},this.setScissorTest=function(D){te.setScissorTest(Te=D)},this.setOpaqueSort=function(D){de=D},this.setTransparentSort=function(D){ye=D},this.getClearColor=function(D){return D.copy(me.getClearColor())},this.setClearColor=function(){me.setClearColor(...arguments)},this.getClearAlpha=function(){return me.getClearAlpha()},this.setClearAlpha=function(){me.setClearAlpha(...arguments)},this.clear=function(D=!0,X=!0,K=!0){let Z=0;if(D){let j=!1;if(L!==null){const be=L.texture.format;j=be===Ll||be===Pl||be===Dl}if(j){const be=L.texture.type,Oe=be===Qn||be===qi||be===is||be===rs||be===Cl||be===Rl,Ye=me.getClearColor(),We=me.getClearAlpha(),ut=Ye.r,dt=Ye.g,et=Ye.b;Oe?(m[0]=ut,m[1]=dt,m[2]=et,m[3]=We,O.clearBufferuiv(O.COLOR,0,m)):(_[0]=ut,_[1]=dt,_[2]=et,_[3]=We,O.clearBufferiv(O.COLOR,0,_))}else Z|=O.COLOR_BUFFER_BIT}X&&(Z|=O.DEPTH_BUFFER_BIT),K&&(Z|=O.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),O.clear(Z)},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",He,!1),t.removeEventListener("webglcontextrestored",Me,!1),t.removeEventListener("webglcontextcreationerror",ge,!1),me.dispose(),Ce.dispose(),Ae.dispose(),he.dispose(),Ue.dispose(),U.dispose(),z.dispose(),ct.dispose(),H.dispose(),se.dispose(),ve.dispose(),ve.removeEventListener("sessionstart",Zt),ve.removeEventListener("sessionend",jt),tn.stop()};function He(D){D.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),N=!0}function Me(){console.log("THREE.WebGLRenderer: Context Restored."),N=!1;const D=Se.autoReset,X=Ve.enabled,K=Ve.autoUpdate,Z=Ve.needsUpdate,j=Ve.type;Fe(),Se.autoReset=D,Ve.enabled=X,Ve.autoUpdate=K,Ve.needsUpdate=Z,Ve.type=j}function ge(D){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",D.statusMessage)}function qe(D){const X=D.target;X.removeEventListener("dispose",qe),ht(X)}function ht(D){Dt(D),he.remove(D)}function Dt(D){const X=he.get(D).programs;X!==void 0&&(X.forEach(function(K){se.releaseProgram(K)}),D.isShaderMaterial&&se.releaseShaderCache(D))}this.renderBufferDirect=function(D,X,K,Z,j,be){X===null&&(X=ke);const Oe=j.isMesh&&j.matrixWorld.determinant()<0,Ye=En(D,X,K,Z,j);te.setMaterial(Z,Oe);let We=K.index,ut=1;if(Z.wireframe===!0){if(We=G.getWireframeAttribute(K),We===void 0)return;ut=2}const dt=K.drawRange,et=K.attributes.position;let gt=dt.start*ut,Rt=(dt.start+dt.count)*ut;be!==null&&(gt=Math.max(gt,be.start*ut),Rt=Math.min(Rt,(be.start+be.count)*ut)),We!==null?(gt=Math.max(gt,0),Rt=Math.min(Rt,We.count)):et!=null&&(gt=Math.max(gt,0),Rt=Math.min(Rt,et.count));const Ot=Rt-gt;if(Ot<0||Ot===1/0)return;ct.setup(j,Z,Ye,K,We);let kt,St=Ke;if(We!==null&&(kt=A.get(We),St=nt,St.setIndex(kt)),j.isMesh)Z.wireframe===!0?(te.setLineWidth(Z.wireframeLinewidth*Qe()),St.setMode(O.LINES)):St.setMode(O.TRIANGLES);else if(j.isLine){let at=Z.linewidth;at===void 0&&(at=1),te.setLineWidth(at*Qe()),j.isLineSegments?St.setMode(O.LINES):j.isLineLoop?St.setMode(O.LINE_LOOP):St.setMode(O.LINE_STRIP)}else j.isPoints?St.setMode(O.POINTS):j.isSprite&&St.setMode(O.TRIANGLES);if(j.isBatchedMesh)if(j._multiDrawInstances!==null)wr("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),St.renderMultiDrawInstances(j._multiDrawStarts,j._multiDrawCounts,j._multiDrawCount,j._multiDrawInstances);else if($.get("WEBGL_multi_draw"))St.renderMultiDraw(j._multiDrawStarts,j._multiDrawCounts,j._multiDrawCount);else{const at=j._multiDrawStarts,Yt=j._multiDrawCounts,Et=j._multiDrawCount,xn=We?A.get(We).bytesPerElement:1,zt=he.get(Z).currentProgram.getUniforms();for(let rn=0;rn<Et;rn++)zt.setValue(O,"_gl_DrawID",rn),St.render(at[rn]/xn,Yt[rn])}else if(j.isInstancedMesh)St.renderInstances(gt,Ot,j.count);else if(K.isInstancedBufferGeometry){const at=K._maxInstanceCount!==void 0?K._maxInstanceCount:1/0,Yt=Math.min(K.instanceCount,at);St.renderInstances(gt,Ot,Yt)}else St.render(gt,Ot)};function pt(D,X,K){D.transparent===!0&&D.side===pn&&D.forceSinglePass===!1?(D.side=vn,D.needsUpdate=!0,nn(D,X,K),D.side=Hn,D.needsUpdate=!0,nn(D,X,K),D.side=pn):nn(D,X,K)}this.compile=function(D,X,K=null){K===null&&(K=D),p=Ae.get(K),p.init(X),E.push(p),K.traverseVisible(function(j){j.isLight&&j.layers.test(X.layers)&&(p.pushLight(j),j.castShadow&&p.pushShadow(j))}),D!==K&&D.traverseVisible(function(j){j.isLight&&j.layers.test(X.layers)&&(p.pushLight(j),j.castShadow&&p.pushShadow(j))}),p.setupLights();const Z=new Set;return D.traverse(function(j){if(!(j.isMesh||j.isPoints||j.isLine||j.isSprite))return;const be=j.material;if(be)if(Array.isArray(be))for(let Oe=0;Oe<be.length;Oe++){const Ye=be[Oe];pt(Ye,K,j),Z.add(Ye)}else pt(be,K,j),Z.add(be)}),p=E.pop(),Z},this.compileAsync=function(D,X,K=null){const Z=this.compile(D,X,K);return new Promise(j=>{function be(){if(Z.forEach(function(Oe){he.get(Oe).currentProgram.isReady()&&Z.delete(Oe)}),Z.size===0){j(D);return}setTimeout(be,10)}$.get("KHR_parallel_shader_compile")!==null?be():setTimeout(be,10)})};let en=null;function je(D){en&&en(D)}function Zt(){tn.stop()}function jt(){tn.start()}const tn=new Vu;tn.setAnimationLoop(je),typeof self<"u"&&tn.setContext(self),this.setAnimationLoop=function(D){en=D,ve.setAnimationLoop(D),D===null?tn.stop():tn.start()},ve.addEventListener("sessionstart",Zt),ve.addEventListener("sessionend",jt),this.render=function(D,X){if(X!==void 0&&X.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(N===!0)return;if(D.matrixWorldAutoUpdate===!0&&D.updateMatrixWorld(),X.parent===null&&X.matrixWorldAutoUpdate===!0&&X.updateMatrixWorld(),ve.enabled===!0&&ve.isPresenting===!0&&(ve.cameraAutoUpdate===!0&&ve.updateCamera(X),X=ve.getCamera()),D.isScene===!0&&D.onBeforeRender(v,D,X,L),p=Ae.get(D,E.length),p.init(X),E.push(p),Ee.multiplyMatrices(X.projectionMatrix,X.matrixWorldInverse),Y.setFromProjectionMatrix(Ee),ae=this.localClippingEnabled,re=Be.init(this.clippingPlanes,ae),g=Ce.get(D,S.length),g.init(),S.push(g),ve.enabled===!0&&ve.isPresenting===!0){const be=v.xr.getDepthSensingMesh();be!==null&&Di(be,X,-1/0,v.sortObjects)}Di(D,X,0,v.sortObjects),g.finish(),v.sortObjects===!0&&g.sort(de,ye),tt=ve.enabled===!1||ve.isPresenting===!1||ve.hasDepthSensing()===!1,tt&&me.addToRenderList(g,D),this.info.render.frame++,re===!0&&Be.beginShadows();const K=p.state.shadowsArray;Ve.render(K,D,X),re===!0&&Be.endShadows(),this.info.autoReset===!0&&this.info.reset();const Z=g.opaque,j=g.transmissive;if(p.setupLights(),X.isArrayCamera){const be=X.cameras;if(j.length>0)for(let Oe=0,Ye=be.length;Oe<Ye;Oe++){const We=be[Oe];rt(Z,j,D,We)}tt&&me.render(D);for(let Oe=0,Ye=be.length;Oe<Ye;Oe++){const We=be[Oe];ti(g,D,We,We.viewport)}}else j.length>0&&rt(Z,j,D,X),tt&&me.render(D),ti(g,D,X);L!==null&&T===0&&(ce.updateMultisampleRenderTarget(L),ce.updateRenderTargetMipmap(L)),D.isScene===!0&&D.onAfterRender(v,D,X),ct.resetDefaultState(),b=-1,x=null,E.pop(),E.length>0?(p=E[E.length-1],re===!0&&Be.setGlobalState(v.clippingPlanes,p.state.camera)):p=null,S.pop(),S.length>0?g=S[S.length-1]:g=null};function Di(D,X,K,Z){if(D.visible===!1)return;if(D.layers.test(X.layers)){if(D.isGroup)K=D.renderOrder;else if(D.isLOD)D.autoUpdate===!0&&D.update(X);else if(D.isLight)p.pushLight(D),D.castShadow&&p.pushShadow(D);else if(D.isSprite){if(!D.frustumCulled||Y.intersectsSprite(D)){Z&&we.setFromMatrixPosition(D.matrixWorld).applyMatrix4(Ee);const Oe=z.update(D),Ye=D.material;Ye.visible&&g.push(D,Oe,Ye,K,we.z,null)}}else if((D.isMesh||D.isLine||D.isPoints)&&(!D.frustumCulled||Y.intersectsObject(D))){const Oe=z.update(D),Ye=D.material;if(Z&&(D.boundingSphere!==void 0?(D.boundingSphere===null&&D.computeBoundingSphere(),we.copy(D.boundingSphere.center)):(Oe.boundingSphere===null&&Oe.computeBoundingSphere(),we.copy(Oe.boundingSphere.center)),we.applyMatrix4(D.matrixWorld).applyMatrix4(Ee)),Array.isArray(Ye)){const We=Oe.groups;for(let ut=0,dt=We.length;ut<dt;ut++){const et=We[ut],gt=Ye[et.materialIndex];gt&>.visible&&g.push(D,Oe,gt,K,we.z,et)}}else Ye.visible&&g.push(D,Oe,Ye,K,we.z,null)}}const be=D.children;for(let Oe=0,Ye=be.length;Oe<Ye;Oe++)Di(be[Oe],X,K,Z)}function ti(D,X,K,Z){const j=D.opaque,be=D.transmissive,Oe=D.transparent;p.setupLightsView(K),re===!0&&Be.setGlobalState(v.clippingPlanes,K),Z&&te.viewport(R.copy(Z)),j.length>0&&Re(j,X,K),be.length>0&&Re(be,X,K),Oe.length>0&&Re(Oe,X,K),te.buffers.depth.setTest(!0),te.buffers.depth.setMask(!0),te.buffers.color.setMask(!0),te.setPolygonOffset(!1)}function rt(D,X,K,Z){if((K.isScene===!0?K.overrideMaterial:null)!==null)return;p.state.transmissionRenderTarget[Z.id]===void 0&&(p.state.transmissionRenderTarget[Z.id]=new ji(1,1,{generateMipmaps:!0,type:$.has("EXT_color_buffer_half_float")||$.has("EXT_color_buffer_float")?hs:Qn,minFilter:ui,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:xt.workingColorSpace}));const be=p.state.transmissionRenderTarget[Z.id],Oe=Z.viewport||R;be.setSize(Oe.z*v.transmissionResolutionScale,Oe.w*v.transmissionResolutionScale);const Ye=v.getRenderTarget();v.setRenderTarget(be),v.getClearColor(W),ee=v.getClearAlpha(),ee<1&&v.setClearColor(16777215,.5),v.clear(),tt&&me.render(K);const We=v.toneMapping;v.toneMapping=Ti;const ut=Z.viewport;if(Z.viewport!==void 0&&(Z.viewport=void 0),p.setupLightsView(Z),re===!0&&Be.setGlobalState(v.clippingPlanes,Z),Re(D,K,Z),ce.updateMultisampleRenderTarget(be),ce.updateRenderTargetMipmap(be),$.has("WEBGL_multisampled_render_to_texture")===!1){let dt=!1;for(let et=0,gt=X.length;et<gt;et++){const Rt=X[et],Ot=Rt.object,kt=Rt.geometry,St=Rt.material,at=Rt.group;if(St.side===pn&&Ot.layers.test(Z.layers)){const Yt=St.side;St.side=vn,St.needsUpdate=!0,Ht(Ot,K,Z,kt,St,at),St.side=Yt,St.needsUpdate=!0,dt=!0}}dt===!0&&(ce.updateMultisampleRenderTarget(be),ce.updateRenderTargetMipmap(be))}v.setRenderTarget(Ye),v.setClearColor(W,ee),ut!==void 0&&(Z.viewport=ut),v.toneMapping=We}function Re(D,X,K){const Z=X.isScene===!0?X.overrideMaterial:null;for(let j=0,be=D.length;j<be;j++){const Oe=D[j],Ye=Oe.object,We=Oe.geometry,ut=Oe.group;let dt=Oe.material;dt.allowOverride===!0&&Z!==null&&(dt=Z),Ye.layers.test(K.layers)&&Ht(Ye,X,K,We,dt,ut)}}function Ht(D,X,K,Z,j,be){D.onBeforeRender(v,X,K,Z,j,be),D.modelViewMatrix.multiplyMatrices(K.matrixWorldInverse,D.matrixWorld),D.normalMatrix.getNormalMatrix(D.modelViewMatrix),j.onBeforeRender(v,X,K,Z,D,be),j.transparent===!0&&j.side===pn&&j.forceSinglePass===!1?(j.side=vn,j.needsUpdate=!0,v.renderBufferDirect(K,X,Z,j,D,be),j.side=Hn,j.needsUpdate=!0,v.renderBufferDirect(K,X,Z,j,D,be),j.side=pn):v.renderBufferDirect(K,X,Z,j,D,be),D.onAfterRender(v,X,K,Z,j,be)}function nn(D,X,K){X.isScene!==!0&&(X=ke);const Z=he.get(D),j=p.state.lights,be=p.state.shadowsArray,Oe=j.state.version,Ye=se.getParameters(D,j.state,be,X,K),We=se.getProgramCacheKey(Ye);let ut=Z.programs;Z.environment=D.isMeshStandardMaterial?X.environment:null,Z.fog=X.fog,Z.envMap=(D.isMeshStandardMaterial?U:Ue).get(D.envMap||Z.environment),Z.envMapRotation=Z.environment!==null&&D.envMap===null?X.environmentRotation:D.envMapRotation,ut===void 0&&(D.addEventListener("dispose",qe),ut=new Map,Z.programs=ut);let dt=ut.get(We);if(dt!==void 0){if(Z.currentProgram===dt&&Z.lightsStateVersion===Oe)return hn(D,Ye),dt}else Ye.uniforms=se.getUniforms(D),D.onBeforeCompile(Ye,v),dt=se.acquireProgram(Ye,We),ut.set(We,dt),Z.uniforms=Ye.uniforms;const et=Z.uniforms;return(!D.isShaderMaterial&&!D.isRawShaderMaterial||D.clipping===!0)&&(et.clippingPlanes=Be.uniform),hn(D,Ye),Z.needsLights=Zi(D),Z.lightsStateVersion=Oe,Z.needsLights&&(et.ambientLightColor.value=j.state.ambient,et.lightProbe.value=j.state.probe,et.directionalLights.value=j.state.directional,et.directionalLightShadows.value=j.state.directionalShadow,et.spotLights.value=j.state.spot,et.spotLightShadows.value=j.state.spotShadow,et.rectAreaLights.value=j.state.rectArea,et.ltc_1.value=j.state.rectAreaLTC1,et.ltc_2.value=j.state.rectAreaLTC2,et.pointLights.value=j.state.point,et.pointLightShadows.value=j.state.pointShadow,et.hemisphereLights.value=j.state.hemi,et.directionalShadowMap.value=j.state.directionalShadowMap,et.directionalShadowMatrix.value=j.state.directionalShadowMatrix,et.spotShadowMap.value=j.state.spotShadowMap,et.spotLightMatrix.value=j.state.spotLightMatrix,et.spotLightMap.value=j.state.spotLightMap,et.pointShadowMap.value=j.state.pointShadowMap,et.pointShadowMatrix.value=j.state.pointShadowMatrix),Z.currentProgram=dt,Z.uniformsList=null,dt}function Wt(D){if(D.uniformsList===null){const X=D.currentProgram.getUniforms();D.uniformsList=ca.seqWithValue(X.seq,D.uniforms)}return D.uniformsList}function hn(D,X){const K=he.get(D);K.outputColorSpace=X.outputColorSpace,K.batching=X.batching,K.batchingColor=X.batchingColor,K.instancing=X.instancing,K.instancingColor=X.instancingColor,K.instancingMorph=X.instancingMorph,K.skinning=X.skinning,K.morphTargets=X.morphTargets,K.morphNormals=X.morphNormals,K.morphColors=X.morphColors,K.morphTargetsCount=X.morphTargetsCount,K.numClippingPlanes=X.numClippingPlanes,K.numIntersection=X.numClipIntersection,K.vertexAlphas=X.vertexAlphas,K.vertexTangents=X.vertexTangents,K.toneMapping=X.toneMapping}function En(D,X,K,Z,j){X.isScene!==!0&&(X=ke),ce.resetTextureUnits();const be=X.fog,Oe=Z.isMeshStandardMaterial?X.environment:null,Ye=L===null?v.outputColorSpace:L.isXRRenderTarget===!0?L.texture.colorSpace:Pr,We=(Z.isMeshStandardMaterial?U:Ue).get(Z.envMap||Oe),ut=Z.vertexColors===!0&&!!K.attributes.color&&K.attributes.color.itemSize===4,dt=!!K.attributes.tangent&&(!!Z.normalMap||Z.anisotropy>0),et=!!K.morphAttributes.position,gt=!!K.morphAttributes.normal,Rt=!!K.morphAttributes.color;let Ot=Ti;Z.toneMapped&&(L===null||L.isXRRenderTarget===!0)&&(Ot=v.toneMapping);const kt=K.morphAttributes.position||K.morphAttributes.normal||K.morphAttributes.color,St=kt!==void 0?kt.length:0,at=he.get(Z),Yt=p.state.lights;if(re===!0&&(ae===!0||D!==x)){const Xt=D===x&&Z.id===b;Be.setState(Z,D,Xt)}let Et=!1;Z.version===at.__version?(at.needsLights&&at.lightsStateVersion!==Yt.state.version||at.outputColorSpace!==Ye||j.isBatchedMesh&&at.batching===!1||!j.isBatchedMesh&&at.batching===!0||j.isBatchedMesh&&at.batchingColor===!0&&j.colorTexture===null||j.isBatchedMesh&&at.batchingColor===!1&&j.colorTexture!==null||j.isInstancedMesh&&at.instancing===!1||!j.isInstancedMesh&&at.instancing===!0||j.isSkinnedMesh&&at.skinning===!1||!j.isSkinnedMesh&&at.skinning===!0||j.isInstancedMesh&&at.instancingColor===!0&&j.instanceColor===null||j.isInstancedMesh&&at.instancingColor===!1&&j.instanceColor!==null||j.isInstancedMesh&&at.instancingMorph===!0&&j.morphTexture===null||j.isInstancedMesh&&at.instancingMorph===!1&&j.morphTexture!==null||at.envMap!==We||Z.fog===!0&&at.fog!==be||at.numClippingPlanes!==void 0&&(at.numClippingPlanes!==Be.numPlanes||at.numIntersection!==Be.numIntersection)||at.vertexAlphas!==ut||at.vertexTangents!==dt||at.morphTargets!==et||at.morphNormals!==gt||at.morphColors!==Rt||at.toneMapping!==Ot||at.morphTargetsCount!==St)&&(Et=!0):(Et=!0,at.__version=Z.version);let xn=at.currentProgram;Et===!0&&(xn=nn(Z,X,j));let zt=!1,rn=!1,Pi=!1;const Ft=xn.getUniforms(),mn=at.uniforms;if(te.useProgram(xn.program)&&(zt=!0,rn=!0,Pi=!0),Z.id!==b&&(b=Z.id,rn=!0),zt||x!==D){te.buffers.depth.getReversed()?(oe.copy(D.projectionMatrix),Zf(oe),Qf(oe),Ft.setValue(O,"projectionMatrix",oe)):Ft.setValue(O,"projectionMatrix",D.projectionMatrix),Ft.setValue(O,"viewMatrix",D.matrixWorldInverse);const $t=Ft.map.cameraPosition;$t!==void 0&&$t.setValue(O,_e.setFromMatrixPosition(D.matrixWorld)),pe.logarithmicDepthBuffer&&Ft.setValue(O,"logDepthBufFC",2/(Math.log(D.far+1)/Math.LN2)),(Z.isMeshPhongMaterial||Z.isMeshToonMaterial||Z.isMeshLambertMaterial||Z.isMeshBasicMaterial||Z.isMeshStandardMaterial||Z.isShaderMaterial)&&Ft.setValue(O,"isOrthographic",D.isOrthographicCamera===!0),x!==D&&(x=D,rn=!0,Pi=!0)}if(j.isSkinnedMesh){Ft.setOptional(O,j,"bindMatrix"),Ft.setOptional(O,j,"bindMatrixInverse");const Xt=j.skeleton;Xt&&(Xt.boneTexture===null&&Xt.computeBoneTexture(),Ft.setValue(O,"boneTexture",Xt.boneTexture,ce))}j.isBatchedMesh&&(Ft.setOptional(O,j,"batchingTexture"),Ft.setValue(O,"batchingTexture",j._matricesTexture,ce),Ft.setOptional(O,j,"batchingIdTexture"),Ft.setValue(O,"batchingIdTexture",j._indirectTexture,ce),Ft.setOptional(O,j,"batchingColorTexture"),j._colorsTexture!==null&&Ft.setValue(O,"batchingColorTexture",j._colorsTexture,ce));const un=K.morphAttributes;if((un.position!==void 0||un.normal!==void 0||un.color!==void 0)&&De.update(j,K,xn),(rn||at.receiveShadow!==j.receiveShadow)&&(at.receiveShadow=j.receiveShadow,Ft.setValue(O,"receiveShadow",j.receiveShadow)),Z.isMeshGouraudMaterial&&Z.envMap!==null&&(mn.envMap.value=We,mn.flipEnvMap.value=We.isCubeTexture&&We.isRenderTargetTexture===!1?-1:1),Z.isMeshStandardMaterial&&Z.envMap===null&&X.environment!==null&&(mn.envMapIntensity.value=X.environmentIntensity),rn&&(Ft.setValue(O,"toneMappingExposure",v.toneMappingExposure),at.needsLights&&Ji(mn,Pi),be&&Z.fog===!0&&ne.refreshFogUniforms(mn,be),ne.refreshMaterialUniforms(mn,Z,q,Q,p.state.transmissionRenderTarget[D.id]),ca.upload(O,Wt(at),mn,ce)),Z.isShaderMaterial&&Z.uniformsNeedUpdate===!0&&(ca.upload(O,Wt(at),mn,ce),Z.uniformsNeedUpdate=!1),Z.isSpriteMaterial&&Ft.setValue(O,"center",j.center),Ft.setValue(O,"modelViewMatrix",j.modelViewMatrix),Ft.setValue(O,"normalMatrix",j.normalMatrix),Ft.setValue(O,"modelMatrix",j.matrixWorld),Z.isShaderMaterial||Z.isRawShaderMaterial){const Xt=Z.uniformsGroups;for(let $t=0,nr=Xt.length;$t<nr;$t++){const ni=Xt[$t];H.update(ni,xn),H.bind(ni,xn)}}return xn}function Ji(D,X){D.ambientLightColor.needsUpdate=X,D.lightProbe.needsUpdate=X,D.directionalLights.needsUpdate=X,D.directionalLightShadows.needsUpdate=X,D.pointLights.needsUpdate=X,D.pointLightShadows.needsUpdate=X,D.spotLights.needsUpdate=X,D.spotLightShadows.needsUpdate=X,D.rectAreaLights.needsUpdate=X,D.hemisphereLights.needsUpdate=X}function Zi(D){return D.isMeshLambertMaterial||D.isMeshToonMaterial||D.isMeshPhongMaterial||D.isMeshStandardMaterial||D.isShadowMaterial||D.isShaderMaterial&&D.lights===!0}this.getActiveCubeFace=function(){return C},this.getActiveMipmapLevel=function(){return T},this.getRenderTarget=function(){return L},this.setRenderTargetTextures=function(D,X,K){const Z=he.get(D);Z.__autoAllocateDepthBuffer=D.resolveDepthBuffer===!1,Z.__autoAllocateDepthBuffer===!1&&(Z.__useRenderToTexture=!1),he.get(D.texture).__webglTexture=X,he.get(D.depthTexture).__webglTexture=Z.__autoAllocateDepthBuffer?void 0:K,Z.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(D,X){const K=he.get(D);K.__webglFramebuffer=X,K.__useDefaultFramebuffer=X===void 0};const Qi=O.createFramebuffer();this.setRenderTarget=function(D,X=0,K=0){L=D,C=X,T=K;let Z=!0,j=null,be=!1,Oe=!1;if(D){const We=he.get(D);if(We.__useDefaultFramebuffer!==void 0)te.bindFramebuffer(O.FRAMEBUFFER,null),Z=!1;else if(We.__webglFramebuffer===void 0)ce.setupRenderTarget(D);else if(We.__hasExternalTextures)ce.rebindTextures(D,he.get(D.texture).__webglTexture,he.get(D.depthTexture).__webglTexture);else if(D.depthBuffer){const et=D.depthTexture;if(We.__boundDepthTexture!==et){if(et!==null&&he.has(et)&&(D.width!==et.image.width||D.height!==et.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");ce.setupDepthRenderbuffer(D)}}const ut=D.texture;(ut.isData3DTexture||ut.isDataArrayTexture||ut.isCompressedArrayTexture)&&(Oe=!0);const dt=he.get(D).__webglFramebuffer;D.isWebGLCubeRenderTarget?(Array.isArray(dt[X])?j=dt[X][K]:j=dt[X],be=!0):D.samples>0&&ce.useMultisampledRTT(D)===!1?j=he.get(D).__webglMultisampledFramebuffer:Array.isArray(dt)?j=dt[K]:j=dt,R.copy(D.viewport),B.copy(D.scissor),V=D.scissorTest}else R.copy(le).multiplyScalar(q).floor(),B.copy(Pe).multiplyScalar(q).floor(),V=Te;if(K!==0&&(j=Qi),te.bindFramebuffer(O.FRAMEBUFFER,j)&&Z&&te.drawBuffers(D,j),te.viewport(R),te.scissor(B),te.setScissorTest(V),be){const We=he.get(D.texture);O.framebufferTexture2D(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_CUBE_MAP_POSITIVE_X+X,We.__webglTexture,K)}else if(Oe){const We=he.get(D.texture),ut=X;O.framebufferTextureLayer(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,We.__webglTexture,K,ut)}else if(D!==null&&K!==0){const We=he.get(D.texture);O.framebufferTexture2D(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_2D,We.__webglTexture,K)}b=-1},this.readRenderTargetPixels=function(D,X,K,Z,j,be,Oe,Ye=0){if(!(D&&D.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let We=he.get(D).__webglFramebuffer;if(D.isWebGLCubeRenderTarget&&Oe!==void 0&&(We=We[Oe]),We){te.bindFramebuffer(O.FRAMEBUFFER,We);try{const ut=D.textures[Ye],dt=ut.format,et=ut.type;if(!pe.textureFormatReadable(dt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!pe.textureTypeReadable(et)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}X>=0&&X<=D.width-Z&&K>=0&&K<=D.height-j&&(D.textures.length>1&&O.readBuffer(O.COLOR_ATTACHMENT0+Ye),O.readPixels(X,K,Z,j,Le.convert(dt),Le.convert(et),be))}finally{const ut=L!==null?he.get(L).__webglFramebuffer:null;te.bindFramebuffer(O.FRAMEBUFFER,ut)}}},this.readRenderTargetPixelsAsync=async function(D,X,K,Z,j,be,Oe,Ye=0){if(!(D&&D.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let We=he.get(D).__webglFramebuffer;if(D.isWebGLCubeRenderTarget&&Oe!==void 0&&(We=We[Oe]),We)if(X>=0&&X<=D.width-Z&&K>=0&&K<=D.height-j){te.bindFramebuffer(O.FRAMEBUFFER,We);const ut=D.textures[Ye],dt=ut.format,et=ut.type;if(!pe.textureFormatReadable(dt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!pe.textureTypeReadable(et))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const gt=O.createBuffer();O.bindBuffer(O.PIXEL_PACK_BUFFER,gt),O.bufferData(O.PIXEL_PACK_BUFFER,be.byteLength,O.STREAM_READ),D.textures.length>1&&O.readBuffer(O.COLOR_ATTACHMENT0+Ye),O.readPixels(X,K,Z,j,Le.convert(dt),Le.convert(et),0);const Rt=L!==null?he.get(L).__webglFramebuffer:null;te.bindFramebuffer(O.FRAMEBUFFER,Rt);const Ot=O.fenceSync(O.SYNC_GPU_COMMANDS_COMPLETE,0);return O.flush(),await Jf(O,Ot,4),O.bindBuffer(O.PIXEL_PACK_BUFFER,gt),O.getBufferSubData(O.PIXEL_PACK_BUFFER,0,be),O.deleteBuffer(gt),O.deleteSync(Ot),be}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(D,X=null,K=0){const Z=Math.pow(2,-K),j=Math.floor(D.image.width*Z),be=Math.floor(D.image.height*Z),Oe=X!==null?X.x:0,Ye=X!==null?X.y:0;ce.setTexture2D(D,0),O.copyTexSubImage2D(O.TEXTURE_2D,K,0,0,Oe,Ye,j,be),te.unbindTexture()};const er=O.createFramebuffer(),tr=O.createFramebuffer();this.copyTextureToTexture=function(D,X,K=null,Z=null,j=0,be=null){be===null&&(j!==0?(wr("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),be=j,j=0):be=0);let Oe,Ye,We,ut,dt,et,gt,Rt,Ot;const kt=D.isCompressedTexture?D.mipmaps[be]:D.image;if(K!==null)Oe=K.max.x-K.min.x,Ye=K.max.y-K.min.y,We=K.isBox3?K.max.z-K.min.z:1,ut=K.min.x,dt=K.min.y,et=K.isBox3?K.min.z:0;else{const un=Math.pow(2,-j);Oe=Math.floor(kt.width*un),Ye=Math.floor(kt.height*un),D.isDataArrayTexture?We=kt.depth:D.isData3DTexture?We=Math.floor(kt.depth*un):We=1,ut=0,dt=0,et=0}Z!==null?(gt=Z.x,Rt=Z.y,Ot=Z.z):(gt=0,Rt=0,Ot=0);const St=Le.convert(X.format),at=Le.convert(X.type);let Yt;X.isData3DTexture?(ce.setTexture3D(X,0),Yt=O.TEXTURE_3D):X.isDataArrayTexture||X.isCompressedArrayTexture?(ce.setTexture2DArray(X,0),Yt=O.TEXTURE_2D_ARRAY):(ce.setTexture2D(X,0),Yt=O.TEXTURE_2D),O.pixelStorei(O.UNPACK_FLIP_Y_WEBGL,X.flipY),O.pixelStorei(O.UNPACK_PREMULTIPLY_ALPHA_WEBGL,X.premultiplyAlpha),O.pixelStorei(O.UNPACK_ALIGNMENT,X.unpackAlignment);const Et=O.getParameter(O.UNPACK_ROW_LENGTH),xn=O.getParameter(O.UNPACK_IMAGE_HEIGHT),zt=O.getParameter(O.UNPACK_SKIP_PIXELS),rn=O.getParameter(O.UNPACK_SKIP_ROWS),Pi=O.getParameter(O.UNPACK_SKIP_IMAGES);O.pixelStorei(O.UNPACK_ROW_LENGTH,kt.width),O.pixelStorei(O.UNPACK_IMAGE_HEIGHT,kt.height),O.pixelStorei(O.UNPACK_SKIP_PIXELS,ut),O.pixelStorei(O.UNPACK_SKIP_ROWS,dt),O.pixelStorei(O.UNPACK_SKIP_IMAGES,et);const Ft=D.isDataArrayTexture||D.isData3DTexture,mn=X.isDataArrayTexture||X.isData3DTexture;if(D.isDepthTexture){const un=he.get(D),Xt=he.get(X),$t=he.get(un.__renderTarget),nr=he.get(Xt.__renderTarget);te.bindFramebuffer(O.READ_FRAMEBUFFER,$t.__webglFramebuffer),te.bindFramebuffer(O.DRAW_FRAMEBUFFER,nr.__webglFramebuffer);for(let ni=0;ni<We;ni++)Ft&&(O.framebufferTextureLayer(O.READ_FRAMEBUFFER,O.COLOR_ATTACHMENT0,he.get(D).__webglTexture,j,et+ni),O.framebufferTextureLayer(O.DRAW_FRAMEBUFFER,O.COLOR_ATTACHMENT0,he.get(X).__webglTexture,be,Ot+ni)),O.blitFramebuffer(ut,dt,Oe,Ye,gt,Rt,Oe,Ye,O.DEPTH_BUFFER_BIT,O.NEAREST);te.bindFramebuffer(O.READ_FRAMEBUFFER,null),te.bindFramebuffer(O.DRAW_FRAMEBUFFER,null)}else if(j!==0||D.isRenderTargetTexture||he.has(D)){const un=he.get(D),Xt=he.get(X);te.bindFramebuffer(O.READ_FRAMEBUFFER,er),te.bindFramebuffer(O.DRAW_FRAMEBUFFER,tr);for(let $t=0;$t<We;$t++)Ft?O.framebufferTextureLayer(O.READ_FRAMEBUFFER,O.COLOR_ATTACHMENT0,un.__webglTexture,j,et+$t):O.framebufferTexture2D(O.READ_FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_2D,un.__webglTexture,j),mn?O.framebufferTextureLayer(O.DRAW_FRAMEBUFFER,O.COLOR_ATTACHMENT0,Xt.__webglTexture,be,Ot+$t):O.framebufferTexture2D(O.DRAW_FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_2D,Xt.__webglTexture,be),j!==0?O.blitFramebuffer(ut,dt,Oe,Ye,gt,Rt,Oe,Ye,O.COLOR_BUFFER_BIT,O.NEAREST):mn?O.copyTexSubImage3D(Yt,be,gt,Rt,Ot+$t,ut,dt,Oe,Ye):O.copyTexSubImage2D(Yt,be,gt,Rt,ut,dt,Oe,Ye);te.bindFramebuffer(O.READ_FRAMEBUFFER,null),te.bindFramebuffer(O.DRAW_FRAMEBUFFER,null)}else mn?D.isDataTexture||D.isData3DTexture?O.texSubImage3D(Yt,be,gt,Rt,Ot,Oe,Ye,We,St,at,kt.data):X.isCompressedArrayTexture?O.compressedTexSubImage3D(Yt,be,gt,Rt,Ot,Oe,Ye,We,St,kt.data):O.texSubImage3D(Yt,be,gt,Rt,Ot,Oe,Ye,We,St,at,kt):D.isDataTexture?O.texSubImage2D(O.TEXTURE_2D,be,gt,Rt,Oe,Ye,St,at,kt.data):D.isCompressedTexture?O.compressedTexSubImage2D(O.TEXTURE_2D,be,gt,Rt,kt.width,kt.height,St,kt.data):O.texSubImage2D(O.TEXTURE_2D,be,gt,Rt,Oe,Ye,St,at,kt);O.pixelStorei(O.UNPACK_ROW_LENGTH,Et),O.pixelStorei(O.UNPACK_IMAGE_HEIGHT,xn),O.pixelStorei(O.UNPACK_SKIP_PIXELS,zt),O.pixelStorei(O.UNPACK_SKIP_ROWS,rn),O.pixelStorei(O.UNPACK_SKIP_IMAGES,Pi),be===0&&X.generateMipmaps&&O.generateMipmap(Yt),te.unbindTexture()},this.copyTextureToTexture3D=function(D,X,K=null,Z=null,j=0){return wr('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(D,X,K,Z,j)},this.initRenderTarget=function(D){he.get(D).__webglFramebuffer===void 0&&ce.setupRenderTarget(D)},this.initTexture=function(D){D.isCubeTexture?ce.setTextureCube(D,0):D.isData3DTexture?ce.setTexture3D(D,0):D.isDataArrayTexture||D.isCompressedArrayTexture?ce.setTexture2DArray(D,0):ce.setTexture2D(D,0),te.unbindTexture()},this.resetState=function(){C=0,T=0,L=null,te.reset(),ct.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return di}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=xt._getDrawingBufferColorSpace(e),t.unpackColorSpace=xt._getUnpackColorSpace()}}var s3=Object.defineProperty,a3=(r,e,t)=>e in r?s3(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Pt=(r,e,t)=>a3(r,typeof e!="symbol"?e+"":e,t);const qu=(r,e)=>{const[t,n]=e.split("-");return Object.assign(r.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},o3=({placement:r,size:e,offset:t,id:n,className:i})=>{const s=document.createElement("div"),{top:a,left:o,right:l,bottom:c}=t;return Object.assign(s.style,{id:n,position:"absolute",zIndex:"1000",height:`${e}px`,width:`${e}px`,margin:`${a}px ${l}px ${c}px ${o}px`,borderRadius:"100%"}),qu(s,r),n&&(s.id=n),i&&(s.className=i),s},l3=r=>{const e=typeof r=="string"?document.querySelector(r):r;if(!e)throw Error("Invalid DOM element");return e};function _l(r,e,t){return Math.max(e,Math.min(t,r))}const c3=[["x",0,3],["y",1,4],["z",2,5]],Rh=new F;function Dh({isSphere:r},e,t){r&&(Rh.set(0,0,1).applyQuaternion(t.quaternion),c3.forEach(([n,i,s])=>{const a=Rh[n];let o=e[i],l=o.userData.opacity;o.material.opacity=_l(a>=0?l:l/2,0,1),o=e[s],l=o.userData.opacity,o.material.opacity=_l(a>=0?l/2:l,0,1)}))}const h3=(r,e,t=10)=>Math.abs(r.clientX-e.x)<t&&Math.abs(r.clientY-e.y)<t,Ph=new v0,Lh=new Ge,Ih=(r,e,t,n)=>{Lh.set((r.clientX-e.left)/e.width*2-1,-((r.clientY-e.top)/e.height)*2+1),Ph.setFromCamera(Lh,t);const i=Ph.intersectObjects(n,!1),s=i.length?i[0]:null;return!s||!s.object.visible?null:s},yo=1e-6,u3=2*Math.PI,ju=["x","y","z"],ls=[...ju,"nx","ny","nz"],d3=["x","z","y","nx","nz","ny"],f3=["z","x","y","nz","nx","ny"],vl="Right",ha="Top",yl="Front",xl="Left",ua="Bottom",Ml="Back",p3=[vl,ha,yl,xl,ua,Ml].map(r=>r.toLocaleLowerCase()),Yu=1.3,Nh=(r,e=!0)=>{const{material:t,userData:n}=r,{color:i,opacity:s}=e?n.hover:n;t.color.set(i),t.opacity=s},zi=r=>JSON.parse(JSON.stringify(r)),m3=r=>{const e=r.type||"sphere",t=e==="sphere",n=r.resolution||t?64:128,i=Ut.DEFAULT_UP,s=i.z===1,a=i.x===1,{container:o}=r;r.container=void 0,r=JSON.parse(JSON.stringify(r)),r.container=o;const l=s?d3:a?f3:ls;p3.forEach((d,f)=>{r[d]&&(r[l[f]]=r[d])});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}},u={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:{...zi(c),...t?{label:"X",color:16725587,line:!0}:{label:a?ha:vl}},y:{...zi(c),...t?{label:"Y",color:9100032,line:!0}:{label:s||a?yl:ha}},z:{...zi(c),...t?{label:"Z",color:2920447,line:!0}:{label:s?ha:a?vl:yl}},nx:{...zi(h),label:t?"":a?ua:xl},ny:{...zi(h),label:t?"":s||a?Ml:ua},nz:{...zi(h),label:t?"":s?ua:a?xl:Ml}};return bl(r,u),ju.forEach(d=>bl(r[`n${d}`],zi(r[d]))),{...r,isSphere:t}};function bl(r,...e){if(r instanceof HTMLElement||typeof r!="object"||r===null)return r;for(const t of e)for(const n in t)n!=="container"&&n in t&&(r[n]===void 0?r[n]=t[n]:typeof t[n]=="object"&&!Array.isArray(t[n])&&(r[n]=bl(r[n]||{},t[n])));return r}const g3=(r,e=2)=>{const t=new st,n=e*2,{isSphere:i,resolution:s,radius:a,font:o,corners:l,edges:c}=r,h=ls.map(T=>({...r[T],radius:a}));i&&l.enabled&&h.push(l),i&&c.enabled&&h.push(c);const u=document.createElement("canvas"),d=u.getContext("2d");u.width=s*2+n*2,u.height=s*h.length+n*h.length;const[f,m]=N(h,s,o);h.forEach(({radius:T,label:L,color:b,labelColor:x,border:R,hover:{color:B,labelColor:V,border:W}},ee)=>{const k=s*ee+ee*n+e;v(e,k,e,s,T,L,R,b,x),v(s+e*3,k,e,s,T,L,W??R,B??b,V??x)});const _=h.length,g=e/(s*2),p=e/(s*6),S=1/_,E=new Dp(u);return E.repeat.set(.5-2*g,S-2*p),E.offset.set(g,1-p),Object.assign(E,{colorSpace:Tt,wrapS:$n,wrapT:$n,userData:{offsetX:g,offsetY:p,cellHeight:S}}),E;function v(T,L,b,x,R,B,V,W,ee){if(R=R*(x/2),W!=null&&W!==""&&(k(),d.fillStyle=t.set(W).getStyle(),d.fill()),V&&V.size){const Q=V.size*x/2;T+=Q,L+=Q,x-=V.size*x,R=Math.max(0,R-Q),k(),d.strokeStyle=t.set(V.color).getStyle(),d.lineWidth=V.size*x,d.stroke()}B&&C(d,T+x/2,L+(x+b)/2,B,t.set(ee).getStyle());function k(){d.beginPath(),d.moveTo(T+R,L),d.lineTo(T+x-R,L),d.arcTo(T+x,L,T+x,L+R,R),d.lineTo(T+x,L+x-R),d.arcTo(T+x,L+x,T+x-R,L+x,R),d.lineTo(T+R,L+x),d.arcTo(T,L+x,T,L+x-R,R),d.lineTo(T,L+R),d.arcTo(T,L,T+R,L,R),d.closePath()}}function N(T,L,b){const x=[...T].sort((ye,le)=>{var Pe,Te;return(((Pe=ye.label)==null?void 0:Pe.length)||0)-(((Te=le.label)==null?void 0:Te.length)||0)}).pop().label,{family:R,weight:B}=b,V=i?Math.sqrt(Math.pow(L*.7,2)/2):L;let W=V,ee=0,k=0;do{d.font=`${B} ${W}px ${R}`;const ye=d.measureText(x);ee=ye.width,k=ye.fontBoundingBoxDescent,W--}while(ee>V&&W>0);const Q=V/k,q=Math.min(V/ee,Q),de=Math.floor(W*q);return[`${B} ${de}px ${R}`,Q]}function C(T,L,b,x,R){T.font=f,T.textAlign="center",T.textBaseline="middle",T.fillStyle=R,T.fillText(x,L,b+(i?m:0))}},_3=(r,e)=>r.offset.x=(e?.5:0)+r.userData.offsetX,Kl=(r,e)=>{const{offset:t,userData:{offsetY:n,cellHeight:i}}=r;t.y=1-(e+1)*i+n};function Jl(r,e,t=2,n=2){const i=t/2-r,s=n/2-r,a=r/t,o=(t-r)/t,l=r/n,c=(n-r)/n,h=[i,s,0,-i,s,0,-i,-s,0,i,-s,0],u=[o,c,a,c,a,l,o,l],d=[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(C=>d[C]);let m,_,g,p,S,E,v,N;for(let C=0;C<4;C++){p=C<1||C>2?i:-i,S=C<2?s:-s,E=C<1||C>2?o:a,v=C<2?c:l;for(let T=0;T<=e;T++)m=Math.PI/2*(C+T/e),_=Math.cos(m),g=Math.sin(m),h.push(p+r*_,S+r*g,0),u.push(E+a*_,v+l*g),T<e&&(N=(e+1)*C+T+4,f.push(C,N,N+1))}return new Bt().setIndex(new Gt(new Uint32Array(f),1)).setAttribute("position",new Gt(new Float32Array(h),3)).setAttribute("uv",new Gt(new Float32Array(u),2))}const v3=(r,e)=>{const t=new F,{isSphere:n,radius:i,smoothness:s}=r,a=Jl(i,s);return ls.map((o,l)=>{const c=l<3,h=ls[l],u=l?e.clone():e;Kl(u,l);const{enabled:d,scale:f,opacity:m,hover:_}=r[h],g={map:u,opacity:m,transparent:!0},p=n?new zl(new wa(g)):new Ct(a,new Ri(g)),S=c?h:h[1];return p.position[S]=(c?1:-1)*(n?Yu:1),n||p.lookAt(t.copy(p.position).multiplyScalar(1.7)),p.scale.setScalar(f),p.renderOrder=1,p.visible=d,p.userData={scale:f,opacity:m,hover:_},p})},y3=(r,e)=>{const{isSphere:t,corners:n}=r;if(!n.enabled)return[];const{color:i,opacity:s,scale:a,radius:o,smoothness:l,hover:c}=n,h=t?null:Jl(o,l),u={transparent:!0,opacity:s},d=[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(d.length/3).fill(0).map((m,_)=>{if(t){const S=e.clone();Kl(S,6),u.map=S}else u.color=i;const g=t?new zl(new wa(u)):new Ct(h,new Ri(u)),p=_*3;return g.position.set(d[p],d[p+1],d[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:s,scale:a,hover:c},g})},x3=(r,e,t)=>{const{isSphere:n,edges:i}=r;if(!i.enabled)return[];const{color:s,opacity:a,scale:o,hover:l,radius:c,smoothness:h}=i,u=n?null:Jl(c,h,1.2,.25),d={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 v=e.clone();Kl(v,t),d.map=v}else d.color=s;const S=n?new zl(new wa(d)):new Ct(u,new Ri(d)),E=p*3;return S.position.set(f[E],f[E+1],f[E+2]),n&&S.position.normalize().multiplyScalar(1.7),S.scale.setScalar(o),S.up.copy(_),S.lookAt(m.copy(S.position).multiplyScalar(2)),!n&&!S.position.y&&(S.rotation.z=Math.PI/2),S.renderOrder=1,S.userData={color:s,opacity:a,scale:o,hover:l},S})};function M3(r,e=!1){const t=r[0].index!==null,n=new Set(Object.keys(r[0].attributes)),i=new Set(Object.keys(r[0].morphAttributes)),s={},a={},o=r[0].morphTargetsRelative,l=new Bt;let c=0;for(let h=0;h<r.length;++h){const u=r[h];let d=0;if(t!==(u.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 u.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;s[f]===void 0&&(s[f]=[]),s[f].push(u.attributes[f]),d++}if(d!==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!==u.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 u.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(u.morphAttributes[f])}if(e){let f;if(t)f=u.index.count;else if(u.attributes.position!==void 0)f=u.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 u=[];for(let d=0;d<r.length;++d){const f=r[d].index;for(let m=0;m<f.count;++m)u.push(f.getX(m)+h);h+=r[d].attributes.position.count}l.setIndex(u)}for(const h in s){const u=Uh(s[h]);if(!u)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+h+" attribute."),null;l.setAttribute(h,u)}for(const h in a){const u=a[h][0].length;if(u===0)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[h]=[];for(let d=0;d<u;++d){const f=[];for(let _=0;_<a[h].length;++_)f.push(a[h][_][d]);const m=Uh(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 Uh(r){let e,t,n,i=-1,s=0;for(let c=0;c<r.length;++c){const h=r[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;s+=h.count*t}const a=new e(s),o=new Gt(a,t,n);let l=0;for(let c=0;c<r.length;++c){const h=r[c];if(h.isInterleavedBufferAttribute){const u=l/t;for(let d=0,f=h.count;d<f;d++)for(let m=0;m<t;m++){const _=h.getComponent(d,m);o.setComponent(d+u,m,_)}}else a.set(h.array,l);l+=h.count*t}return i!==void 0&&(o.gpuType=i),o}const b3=(r,e)=>{const{isSphere:t,background:{enabled:n,color:i,opacity:s,hover:a}}=e;let o;const l=new Ri({color:i,side:vn,opacity:s,transparent:!0,depthWrite:!1});if(!n)return null;if(t)o=new Ct(new Ta(1.8,64,64),l);else{let c;r.forEach(h=>{const u=h.scale.x;h.scale.setScalar(.9),h.updateMatrix();const d=h.geometry.clone();d.applyMatrix4(h.matrix),c=c?M3([c,d]):d,h.scale.setScalar(u)}),o=new Ct(c,l)}return o.userData={color:i,opacity:s,hover:a},o},Fh=new ei,$s=new F;class $u extends m0{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 pl(t,6,1);return this.setAttribute("instanceStart",new Zn(n,3,0)),this.setAttribute("instanceEnd",new Zn(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 pl(t,6,1);return this.setAttribute("instanceColorStart",new Zn(n,3,0)),this.setAttribute("instanceColorEnd",new Zn(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 qp(e.geometry)),this}fromLineSegments(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new ei);const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;e!==void 0&&t!==void 0&&(this.boundingBox.setFromBufferAttribute(e),Fh.setFromBufferAttribute(t),this.boundingBox.union(Fh))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new mi),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 s=0,a=e.count;s<a;s++)$s.fromBufferAttribute(e,s),i=Math.max(i,n.distanceToSquared($s)),$s.fromBufferAttribute(t,s),i=Math.max(i,n.distanceToSquared($s));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)}}Ne.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new Ge(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};Sn.line={uniforms:Fl.merge([Ne.common,Ne.fog,Ne.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 Zl extends pi{constructor(e){super({type:"LineMaterial",uniforms:Fl.clone(Sn.line.uniforms),vertexShader:Sn.line.vertexShader,fragmentShader:Sn.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 yo=new Mt,Oh=new F,zh=new F,sn=new Mt,an=new Mt,Xn=new Mt,xo=new F,Mo=new lt,on=new y0,Bh=new F,Js=new ei,Ks=new mi,qn=new Mt;let Yn,Xi;function kh(r,e,t){return qn.set(0,0,-e,1).applyMatrix4(r.projectionMatrix),qn.multiplyScalar(1/qn.w),qn.x=Xi/t.width,qn.y=Xi/t.height,qn.applyMatrix4(r.projectionMatrixInverse),qn.multiplyScalar(1/qn.w),Math.abs(Math.max(qn.x,qn.y))}function S3(r,e){const t=r.matrixWorld,n=r.geometry,i=n.attributes.instanceStart,s=n.attributes.instanceEnd,a=Math.min(n.instanceCount,i.count);for(let o=0,l=a;o<l;o++){on.start.fromBufferAttribute(i,o),on.end.fromBufferAttribute(s,o),on.applyMatrix4(t);const c=new F,h=new F;Yn.distanceSqToSegment(on.start,on.end,h,c),h.distanceTo(c)<Xi*.5&&e.push({point:h,pointOnLine:c,distance:Yn.origin.distanceTo(h),object:r,face:null,faceIndex:o,uv:null,uv1:null})}}function E3(r,e,t){const n=e.projectionMatrix,i=r.material.resolution,s=r.matrixWorld,a=r.geometry,o=a.attributes.instanceStart,l=a.attributes.instanceEnd,c=Math.min(a.instanceCount,o.count),h=-e.near;Yn.at(1,Xn),Xn.w=1,Xn.applyMatrix4(e.matrixWorldInverse),Xn.applyMatrix4(n),Xn.multiplyScalar(1/Xn.w),Xn.x*=i.x/2,Xn.y*=i.y/2,Xn.z=0,xo.copy(Xn),Mo.multiplyMatrices(e.matrixWorldInverse,s);for(let u=0,d=c;u<d;u++){if(sn.fromBufferAttribute(o,u),an.fromBufferAttribute(l,u),sn.w=1,an.w=1,sn.applyMatrix4(Mo),an.applyMatrix4(Mo),sn.z>h&&an.z>h)continue;if(sn.z>h){const p=sn.z-an.z,S=(sn.z-h)/p;sn.lerp(an,S)}else if(an.z>h){const p=an.z-sn.z,S=(an.z-h)/p;an.lerp(sn,S)}sn.applyMatrix4(n),an.applyMatrix4(n),sn.multiplyScalar(1/sn.w),an.multiplyScalar(1/an.w),sn.x*=i.x/2,sn.y*=i.y/2,an.x*=i.x/2,an.y*=i.y/2,on.start.copy(sn),on.start.z=0,on.end.copy(an),on.end.z=0;const f=on.closestPointToPointParameter(xo,!0);on.at(f,Bh);const m=Hi.lerp(sn.z,an.z,f),_=m>=-1&&m<=1,g=xo.distanceTo(Bh)<Xi*.5;if(_&&g){on.start.fromBufferAttribute(o,u),on.end.fromBufferAttribute(l,u),on.start.applyMatrix4(s),on.end.applyMatrix4(s);const p=new F,S=new F;Yn.distanceSqToSegment(on.start,on.end,S,p),t.push({point:S,pointOnLine:p,distance:Yn.origin.distanceTo(S),object:r,face:null,faceIndex:u,uv:null,uv1:null})}}}class A3 extends Ct{constructor(e=new $u,t=new Zl({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)Oh.fromBufferAttribute(t,a),zh.fromBufferAttribute(n,a),i[o]=o===0?0:i[o-1],i[o+1]=i[o]+Oh.distanceTo(zh);const s=new fl(i,2,1);return e.setAttribute("instanceDistanceStart",new Zn(s,1,0)),e.setAttribute("instanceDistanceEnd",new Zn(s,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 s=e.params.Line2!==void 0&&e.params.Line2.threshold||0;Yn=e.ray;const a=this.matrixWorld,o=this.geometry,l=this.material;Xi=l.linewidth+s,o.boundingSphere===null&&o.computeBoundingSphere(),Ks.copy(o.boundingSphere).applyMatrix4(a);let c;if(n)c=Xi*.5;else{const u=Math.max(i.near,Ks.distanceToPoint(Yn.origin));c=kh(i,u,l.resolution)}if(Ks.radius+=c,Yn.intersectsSphere(Ks)===!1)return;o.boundingBox===null&&o.computeBoundingBox(),Js.copy(o.boundingBox).applyMatrix4(a);let h;if(n)h=Xi*.5;else{const u=Math.max(i.near,Js.distanceToPoint(Yn.origin));h=kh(i,u,l.resolution)}Js.expandByScalar(h),Yn.intersectsBox(Js)!==!1&&(n?S3(this,t):E3(this,i,t))}onBeforeRender(e){const t=this.material.uniforms;t&&t.resolution&&(e.getViewport(yo),this.material.uniforms.resolution.value.set(yo.z,yo.w))}}class Ju extends $u{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 w3 extends A3{constructor(e=new Ju,t=new Zl({color:Math.random()*16777215})){super(e,t),this.isLine2=!0,this.type="Line2"}}const T3=r=>{const e=new st,t=[],n=[],{isSphere:i}=r;if(ls.forEach((o,l)=>{const{enabled:c,line:h,scale:u,color:d}=r[o];if(!c||!h)return;const f=l<3?1:-1,m=(i?Yu-u/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(d).toArray();n.push(..._,..._)}),!t.length)return null;const s=new Ju().setPositions(t).setColors(n),a=new Zl({linewidth:r.lineWidth,vertexColors:!0,resolution:new Ge(window.innerWidth,window.innerHeight)});return new w3(s,a).computeLineDistances()},C3=r=>{const{corners:e,edges:t}=r,n=[],i=g3(r),s=v3(r,i);n.push(...s),e.enabled&&n.push(...y3(r,i)),t.enabled&&n.push(...x3(r,i,e.enabled?7:6));const a=b3(s,r),o=T3(r);return[n,a,o]},$r=(r,e=!0)=>{const{material:t,userData:n}=r,{opacity:i,color:s,scale:a}=e?n.hover:n;r.scale.setScalar(a),t.opacity=i,t.map?_3(t.map,e):t.color.set(s)},br=new lt,Vh=new ku,R3=new Ge,Bi=new F,Hh=new Mt;class D3 extends Ut{constructor(e,t,n={}){super(),Lt(this,"enabled",!0),Lt(this,"camera"),Lt(this,"renderer"),Lt(this,"options"),Lt(this,"target",new F),Lt(this,"animated",!0),Lt(this,"speed",1),Lt(this,"animating",!1),Lt(this,"_options"),Lt(this,"_intersections"),Lt(this,"_background",null),Lt(this,"_viewport",[0,0,0,0]),Lt(this,"_originalViewport",[0,0,0,0]),Lt(this,"_originalScissor",[0,0,0,0]),Lt(this,"_scene"),Lt(this,"_camera"),Lt(this,"_container"),Lt(this,"_domElement"),Lt(this,"_domRect"),Lt(this,"_dragging",!1),Lt(this,"_distance",0),Lt(this,"_clock",new _0),Lt(this,"_targetQuaternion",new Rn),Lt(this,"_quaternionStart",new Rn),Lt(this,"_quaternionEnd",new Rn),Lt(this,"_pointerStart",new Ge),Lt(this,"_focus",null),Lt(this,"_placement"),Lt(this,"_controls"),Lt(this,"_controlsListeners"),this.camera=e,this.renderer=t,this._scene=new Ol().add(this),this.set(n)}get placement(){return this._placement}set placement(e){this._placement=qu(this._domElement,e),this.domUpdate()}set(e={}){this.dispose(),this.options=e,this._options=m3(e),this._camera=this._options.isSphere?new Ca(-1.8,1.8,1.8,-1.8,5,10):new ln(26,1,5,10),this._camera.position.set(0,0,7);const[t,n,i]=C3(this._options);n&&this.add(n),i&&this.add(i),this.add(...t),this._background=n,this._intersections=t;const{container:s,animated:a,speed:o}=this._options;return this.animated=a,this.speed=o,this._container=s?l3(s):document.body,this._domElement=o3(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(Hh).toArray(this._originalViewport),e.getScissorTest()&&e.getScissor(Hh).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,s,a;this.remove(t);const o=t;(n=o.material)==null||n.dispose(),(s=(i=o.material)==null?void 0:i.map)==null||s.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()),Dh(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()*u3*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)<vo&&(this._controls&&(this._controls.enabled=!0),this.animating=!1,this.dispatchEvent({type:"end"}))}_setOrientation(e){const t=this.camera,n=this.target;Bi.copy(e).multiplyScalar(this._distance),br.setPosition(Bi).lookAt(Bi,this.position,this.up),this._targetQuaternion.setFromRotationMatrix(br),Bi.add(n),br.lookAt(Bi,n,this.up),this._quaternionEnd.setFromRotationMatrix(br),br.setPosition(t.position).lookAt(t.position,n,this.up),this._quaternionStart.setFromRotationMatrix(br),this.animating=!0,this._clock.start(),this.dispatchEvent({type:"start"})}_onPointerDown(e){if(!this.enabled)return;const t=l=>{if(!this._dragging){if(h3(l,this._pointerStart))return;this._dragging=!0}const c=R3.set(l.clientX,l.clientY).sub(this._pointerStart).multiplyScalar(1/this._domRect.width*Math.PI),h=this.coordinateConversion(Bi.subVectors(this.camera.position,this.target)),u=Vh.setFromVector3(h);u.theta=a-c.x,u.phi=gl(o-c.y,vo,Math.PI-vo),this.coordinateConversion(this.camera.position.setFromSpherical(u),!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&&($r(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(Bi.subVectors(this.camera.position,this.target)),s=Vh.setFromVector3(i),a=s.theta,o=s.phi;this._distance=s.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:s}=e,a=Ut.DEFAULT_UP;return a.x===1?t?e.set(i,s,n):e.set(s,n,i):a.z===1?t?e.set(s,n,i):e.set(i,s,n):e}_onPointerMove(e){!this.enabled||this._dragging||(this._background&&Nh(this._background,!0),this._handleHover(e))}_onPointerLeave(){!this.enabled||this._dragging||(this._background&&Nh(this._background,!1),this._focus&&$r(this._focus,!1),this._domElement.style.cursor="")}_handleClick(e){const t=Ih(e,this._domRect,this._camera,this._intersections);this._focus&&($r(this._focus,!1),this._focus=null),t&&(this._setOrientation(t.object.position),this.dispatchEvent({type:"change"}))}_handleHover(e){const t=Ih(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&&$r(this._focus,!1),(this._focus=n)?$r(n,!0):Dh(this._options,this._intersections,this.camera))}}const L3=/^[og]\s*(.+)?/,P3=/^mtllib /,I3=/^usemtl /,N3=/^usemap /,Gh=/\s+/,Wh=new F,bo=new F,Xh=new F,qh=new F,Pn=new F,Zs=new st;function U3(){const r={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,s){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(s)&&s.length>0?s[s.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 s=this.currentMaterial();if(s&&s.groupEnd===-1&&(s.groupEnd=this.geometry.vertices.length/3,s.groupCount=s.groupEnd-s.groupStart,s.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}),s}},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,s=this.object.geometry.vertices;s.push(i[e+0],i[e+1],i[e+2]),s.push(i[t+0],i[t+1],i[t+2]),s.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,s=this.object.geometry.normals;s.push(i[e+0],i[e+1],i[e+2]),s.push(i[t+0],i[t+1],i[t+2]),s.push(i[n+0],i[n+1],i[n+2])},addFaceNormal:function(e,t,n){const i=this.vertices,s=this.object.geometry.normals;Wh.fromArray(i,e),bo.fromArray(i,t),Xh.fromArray(i,n),Pn.subVectors(Xh,bo),qh.subVectors(Wh,bo),Pn.cross(qh),Pn.normalize(),s.push(Pn.x,Pn.y,Pn.z),s.push(Pn.x,Pn.y,Pn.z),s.push(Pn.x,Pn.y,Pn.z)},addColor:function(e,t,n){const i=this.colors,s=this.object.geometry.colors;i[e]!==void 0&&s.push(i[e+0],i[e+1],i[e+2]),i[t]!==void 0&&s.push(i[t+0],i[t+1],i[t+2]),i[n]!==void 0&&s.push(i[n+0],i[n+1],i[n+2])},addUV:function(e,t,n){const i=this.uvs,s=this.object.geometry.uvs;s.push(i[e+0],i[e+1]),s.push(i[t+0],i[t+1]),s.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,s,a,o,l,c){const h=this.vertices.length;let u=this.parseVertexIndex(e,h),d=this.parseVertexIndex(t,h),f=this.parseVertexIndex(n,h);if(this.addVertex(u,d,f),this.addColor(u,d,f),o!==void 0&&o!==""){const m=this.normals.length;u=this.parseNormalIndex(o,m),d=this.parseNormalIndex(l,m),f=this.parseNormalIndex(c,m),this.addNormal(u,d,f)}else this.addFaceNormal(u,d,f);if(i!==void 0&&i!==""){const m=this.uvs.length;u=this.parseUVIndex(i,m),d=this.parseUVIndex(s,m),f=this.parseUVIndex(a,m),this.addUV(u,d,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 s=this.parseVertexIndex(e[n],t);this.addVertexPoint(s),this.addColor(s)}},addLineGeometry:function(e,t){this.object.geometry.type="Line";const n=this.vertices.length,i=this.uvs.length;for(let s=0,a=e.length;s<a;s++)this.addVertexLine(this.parseVertexIndex(e[s],n));for(let s=0,a=t.length;s<a;s++)this.addUVLine(this.parseUVIndex(t[s],i))}};return r.startObject("",!1),r}class So extends Gn{constructor(e){super(e),this.materials=null}load(e,t,n,i){const s=this,a=new zr(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(o){try{t(s.parse(o))}catch(l){i?i(l):console.error(l),s.manager.itemError(e)}},n,i)}setMaterials(e){return this.materials=e,this}parse(e){const t=new U3;e.indexOf(`\r
|
|
4197
|
+
`};class Zl extends pi{constructor(e){super({type:"LineMaterial",uniforms:Fl.clone(Sn.line.uniforms),vertexShader:Sn.line.vertexShader,fragmentShader:Sn.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 xo=new Mt,Oh=new F,zh=new F,sn=new Mt,an=new Mt,Xn=new Mt,Mo=new F,bo=new lt,on=new y0,Bh=new F,Ks=new ei,Js=new mi,qn=new Mt;let Yn,Xi;function kh(r,e,t){return qn.set(0,0,-e,1).applyMatrix4(r.projectionMatrix),qn.multiplyScalar(1/qn.w),qn.x=Xi/t.width,qn.y=Xi/t.height,qn.applyMatrix4(r.projectionMatrixInverse),qn.multiplyScalar(1/qn.w),Math.abs(Math.max(qn.x,qn.y))}function S3(r,e){const t=r.matrixWorld,n=r.geometry,i=n.attributes.instanceStart,s=n.attributes.instanceEnd,a=Math.min(n.instanceCount,i.count);for(let o=0,l=a;o<l;o++){on.start.fromBufferAttribute(i,o),on.end.fromBufferAttribute(s,o),on.applyMatrix4(t);const c=new F,h=new F;Yn.distanceSqToSegment(on.start,on.end,h,c),h.distanceTo(c)<Xi*.5&&e.push({point:h,pointOnLine:c,distance:Yn.origin.distanceTo(h),object:r,face:null,faceIndex:o,uv:null,uv1:null})}}function E3(r,e,t){const n=e.projectionMatrix,i=r.material.resolution,s=r.matrixWorld,a=r.geometry,o=a.attributes.instanceStart,l=a.attributes.instanceEnd,c=Math.min(a.instanceCount,o.count),h=-e.near;Yn.at(1,Xn),Xn.w=1,Xn.applyMatrix4(e.matrixWorldInverse),Xn.applyMatrix4(n),Xn.multiplyScalar(1/Xn.w),Xn.x*=i.x/2,Xn.y*=i.y/2,Xn.z=0,Mo.copy(Xn),bo.multiplyMatrices(e.matrixWorldInverse,s);for(let u=0,d=c;u<d;u++){if(sn.fromBufferAttribute(o,u),an.fromBufferAttribute(l,u),sn.w=1,an.w=1,sn.applyMatrix4(bo),an.applyMatrix4(bo),sn.z>h&&an.z>h)continue;if(sn.z>h){const p=sn.z-an.z,S=(sn.z-h)/p;sn.lerp(an,S)}else if(an.z>h){const p=an.z-sn.z,S=(an.z-h)/p;an.lerp(sn,S)}sn.applyMatrix4(n),an.applyMatrix4(n),sn.multiplyScalar(1/sn.w),an.multiplyScalar(1/an.w),sn.x*=i.x/2,sn.y*=i.y/2,an.x*=i.x/2,an.y*=i.y/2,on.start.copy(sn),on.start.z=0,on.end.copy(an),on.end.z=0;const f=on.closestPointToPointParameter(Mo,!0);on.at(f,Bh);const m=Hi.lerp(sn.z,an.z,f),_=m>=-1&&m<=1,g=Mo.distanceTo(Bh)<Xi*.5;if(_&&g){on.start.fromBufferAttribute(o,u),on.end.fromBufferAttribute(l,u),on.start.applyMatrix4(s),on.end.applyMatrix4(s);const p=new F,S=new F;Yn.distanceSqToSegment(on.start,on.end,S,p),t.push({point:S,pointOnLine:p,distance:Yn.origin.distanceTo(S),object:r,face:null,faceIndex:u,uv:null,uv1:null})}}}class A3 extends Ct{constructor(e=new $u,t=new Zl({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)Oh.fromBufferAttribute(t,a),zh.fromBufferAttribute(n,a),i[o]=o===0?0:i[o-1],i[o+1]=i[o]+Oh.distanceTo(zh);const s=new pl(i,2,1);return e.setAttribute("instanceDistanceStart",new Zn(s,1,0)),e.setAttribute("instanceDistanceEnd",new Zn(s,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 s=e.params.Line2!==void 0&&e.params.Line2.threshold||0;Yn=e.ray;const a=this.matrixWorld,o=this.geometry,l=this.material;Xi=l.linewidth+s,o.boundingSphere===null&&o.computeBoundingSphere(),Js.copy(o.boundingSphere).applyMatrix4(a);let c;if(n)c=Xi*.5;else{const u=Math.max(i.near,Js.distanceToPoint(Yn.origin));c=kh(i,u,l.resolution)}if(Js.radius+=c,Yn.intersectsSphere(Js)===!1)return;o.boundingBox===null&&o.computeBoundingBox(),Ks.copy(o.boundingBox).applyMatrix4(a);let h;if(n)h=Xi*.5;else{const u=Math.max(i.near,Ks.distanceToPoint(Yn.origin));h=kh(i,u,l.resolution)}Ks.expandByScalar(h),Yn.intersectsBox(Ks)!==!1&&(n?S3(this,t):E3(this,i,t))}onBeforeRender(e){const t=this.material.uniforms;t&&t.resolution&&(e.getViewport(xo),this.material.uniforms.resolution.value.set(xo.z,xo.w))}}class Ku extends $u{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 w3 extends A3{constructor(e=new Ku,t=new Zl({color:Math.random()*16777215})){super(e,t),this.isLine2=!0,this.type="Line2"}}const T3=r=>{const e=new st,t=[],n=[],{isSphere:i}=r;if(ls.forEach((o,l)=>{const{enabled:c,line:h,scale:u,color:d}=r[o];if(!c||!h)return;const f=l<3?1:-1,m=(i?Yu-u/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(d).toArray();n.push(..._,..._)}),!t.length)return null;const s=new Ku().setPositions(t).setColors(n),a=new Zl({linewidth:r.lineWidth,vertexColors:!0,resolution:new Ge(window.innerWidth,window.innerHeight)});return new w3(s,a).computeLineDistances()},C3=r=>{const{corners:e,edges:t}=r,n=[],i=g3(r),s=v3(r,i);n.push(...s),e.enabled&&n.push(...y3(r,i)),t.enabled&&n.push(...x3(r,i,e.enabled?7:6));const a=b3(s,r),o=T3(r);return[n,a,o]},$r=(r,e=!0)=>{const{material:t,userData:n}=r,{opacity:i,color:s,scale:a}=e?n.hover:n;r.scale.setScalar(a),t.opacity=i,t.map?_3(t.map,e):t.color.set(s)},br=new lt,Vh=new ku,R3=new Ge,Bi=new F,Hh=new Mt;class D3 extends Ut{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 _0),Pt(this,"_targetQuaternion",new Dn),Pt(this,"_quaternionStart",new Dn),Pt(this,"_quaternionEnd",new Dn),Pt(this,"_pointerStart",new Ge),Pt(this,"_focus",null),Pt(this,"_placement"),Pt(this,"_controls"),Pt(this,"_controlsListeners"),this.camera=e,this.renderer=t,this._scene=new Ol().add(this),this.set(n)}get placement(){return this._placement}set placement(e){this._placement=qu(this._domElement,e),this.domUpdate()}set(e={}){this.dispose(),this.options=e,this._options=m3(e),this._camera=this._options.isSphere?new Ra(-1.8,1.8,1.8,-1.8,5,10):new ln(26,1,5,10),this._camera.position.set(0,0,7);const[t,n,i]=C3(this._options);n&&this.add(n),i&&this.add(i),this.add(...t),this._background=n,this._intersections=t;const{container:s,animated:a,speed:o}=this._options;return this.animated=a,this.speed=o,this._container=s?l3(s):document.body,this._domElement=o3(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(Hh).toArray(this._originalViewport),e.getScissorTest()&&e.getScissor(Hh).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,s,a;this.remove(t);const o=t;(n=o.material)==null||n.dispose(),(s=(i=o.material)==null?void 0:i.map)==null||s.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()),Dh(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()*u3*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)<yo&&(this._controls&&(this._controls.enabled=!0),this.animating=!1,this.dispatchEvent({type:"end"}))}_setOrientation(e){const t=this.camera,n=this.target;Bi.copy(e).multiplyScalar(this._distance),br.setPosition(Bi).lookAt(Bi,this.position,this.up),this._targetQuaternion.setFromRotationMatrix(br),Bi.add(n),br.lookAt(Bi,n,this.up),this._quaternionEnd.setFromRotationMatrix(br),br.setPosition(t.position).lookAt(t.position,n,this.up),this._quaternionStart.setFromRotationMatrix(br),this.animating=!0,this._clock.start(),this.dispatchEvent({type:"start"})}_onPointerDown(e){if(!this.enabled)return;const t=l=>{if(!this._dragging){if(h3(l,this._pointerStart))return;this._dragging=!0}const c=R3.set(l.clientX,l.clientY).sub(this._pointerStart).multiplyScalar(1/this._domRect.width*Math.PI),h=this.coordinateConversion(Bi.subVectors(this.camera.position,this.target)),u=Vh.setFromVector3(h);u.theta=a-c.x,u.phi=_l(o-c.y,yo,Math.PI-yo),this.coordinateConversion(this.camera.position.setFromSpherical(u),!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&&($r(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(Bi.subVectors(this.camera.position,this.target)),s=Vh.setFromVector3(i),a=s.theta,o=s.phi;this._distance=s.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:s}=e,a=Ut.DEFAULT_UP;return a.x===1?t?e.set(i,s,n):e.set(s,n,i):a.z===1?t?e.set(s,n,i):e.set(i,s,n):e}_onPointerMove(e){!this.enabled||this._dragging||(this._background&&Nh(this._background,!0),this._handleHover(e))}_onPointerLeave(){!this.enabled||this._dragging||(this._background&&Nh(this._background,!1),this._focus&&$r(this._focus,!1),this._domElement.style.cursor="")}_handleClick(e){const t=Ih(e,this._domRect,this._camera,this._intersections);this._focus&&($r(this._focus,!1),this._focus=null),t&&(this._setOrientation(t.object.position),this.dispatchEvent({type:"change"}))}_handleHover(e){const t=Ih(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&&$r(this._focus,!1),(this._focus=n)?$r(n,!0):Dh(this._options,this._intersections,this.camera))}}const P3=/^[og]\s*(.+)?/,L3=/^mtllib /,I3=/^usemtl /,N3=/^usemap /,Gh=/\s+/,Wh=new F,So=new F,Xh=new F,qh=new F,In=new F,Zs=new st;function U3(){const r={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,s){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(s)&&s.length>0?s[s.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 s=this.currentMaterial();if(s&&s.groupEnd===-1&&(s.groupEnd=this.geometry.vertices.length/3,s.groupCount=s.groupEnd-s.groupStart,s.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}),s}},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,s=this.object.geometry.vertices;s.push(i[e+0],i[e+1],i[e+2]),s.push(i[t+0],i[t+1],i[t+2]),s.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,s=this.object.geometry.normals;s.push(i[e+0],i[e+1],i[e+2]),s.push(i[t+0],i[t+1],i[t+2]),s.push(i[n+0],i[n+1],i[n+2])},addFaceNormal:function(e,t,n){const i=this.vertices,s=this.object.geometry.normals;Wh.fromArray(i,e),So.fromArray(i,t),Xh.fromArray(i,n),In.subVectors(Xh,So),qh.subVectors(Wh,So),In.cross(qh),In.normalize(),s.push(In.x,In.y,In.z),s.push(In.x,In.y,In.z),s.push(In.x,In.y,In.z)},addColor:function(e,t,n){const i=this.colors,s=this.object.geometry.colors;i[e]!==void 0&&s.push(i[e+0],i[e+1],i[e+2]),i[t]!==void 0&&s.push(i[t+0],i[t+1],i[t+2]),i[n]!==void 0&&s.push(i[n+0],i[n+1],i[n+2])},addUV:function(e,t,n){const i=this.uvs,s=this.object.geometry.uvs;s.push(i[e+0],i[e+1]),s.push(i[t+0],i[t+1]),s.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,s,a,o,l,c){const h=this.vertices.length;let u=this.parseVertexIndex(e,h),d=this.parseVertexIndex(t,h),f=this.parseVertexIndex(n,h);if(this.addVertex(u,d,f),this.addColor(u,d,f),o!==void 0&&o!==""){const m=this.normals.length;u=this.parseNormalIndex(o,m),d=this.parseNormalIndex(l,m),f=this.parseNormalIndex(c,m),this.addNormal(u,d,f)}else this.addFaceNormal(u,d,f);if(i!==void 0&&i!==""){const m=this.uvs.length;u=this.parseUVIndex(i,m),d=this.parseUVIndex(s,m),f=this.parseUVIndex(a,m),this.addUV(u,d,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 s=this.parseVertexIndex(e[n],t);this.addVertexPoint(s),this.addColor(s)}},addLineGeometry:function(e,t){this.object.geometry.type="Line";const n=this.vertices.length,i=this.uvs.length;for(let s=0,a=e.length;s<a;s++)this.addVertexLine(this.parseVertexIndex(e[s],n));for(let s=0,a=t.length;s<a;s++)this.addUVLine(this.parseUVIndex(t[s],i))}};return r.startObject("",!1),r}class Eo extends Gn{constructor(e){super(e),this.materials=null}load(e,t,n,i){const s=this,a=new zr(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(o){try{t(s.parse(o))}catch(l){i?i(l):console.error(l),s.manager.itemError(e)}},n,i)}setMaterials(e){return this.materials=e,this}parse(e){const t=new U3;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 u=c.split(Gh);switch(u[0]){case"v":t.vertices.push(parseFloat(u[1]),parseFloat(u[2]),parseFloat(u[3])),u.length>=7?(Zs.setRGB(parseFloat(u[4]),parseFloat(u[5]),parseFloat(u[6]),Tt),t.colors.push(Zs.r,Zs.g,Zs.b)):t.colors.push(void 0,void 0,void 0);break;case"vn":t.normals.push(parseFloat(u[1]),parseFloat(u[2]),parseFloat(u[3]));break;case"vt":t.uvs.push(parseFloat(u[1]),parseFloat(u[2]));break}}else if(h==="f"){const d=c.slice(1).trim().split(Gh),f=[];for(let _=0,g=d.length;_<g;_++){const p=d[_];if(p.length>0){const S=p.split("/");f.push(S)}}const m=f[0];for(let _=1,g=f.length-1;_<g;_++){const p=f[_],S=f[_+1];t.addFace(m[0],p[0],S[0],m[1],p[1],S[1],m[2],p[2],S[2])}}else if(h==="l"){const u=c.substring(1).trim().split(" ");let d=[];const f=[];if(c.indexOf("/")===-1)d=u;else for(let m=0,_=u.length;m<_;m++){const g=u[m].split("/");g[0]!==""&&d.push(g[0]),g[1]!==""&&f.push(g[1])}t.addLineGeometry(d,f)}else if(h==="p"){const d=c.slice(1).trim().split(" ");t.addPointGeometry(d)}else if((i=
|
|
4202
|
-
`);let i={};const s=/\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 u=h>=0?c.substring(0,h):c;u=u.toLowerCase();let d=h>=0?c.substring(h+1):"";if(d=d.trim(),u==="newmtl")i={name:d},a[d]=i;else if(u==="ka"||u==="kd"||u==="ks"||u==="ke"){const f=d.split(s,3);i[u]=[parseFloat(f[0]),parseFloat(f[1]),parseFloat(f[2])]}else i[u]=d}const o=new F3(this.resourcePath||t,this.materialOptions);return o.setCrossOrigin(this.crossOrigin),o.setManager(this.manager),o.setMaterials(a),o}}class F3{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:Hn,this.wrap=this.options.wrap!==void 0?this.options.wrap:$n}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],s={};t[n]=s;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&&(s[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 s(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(s(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=xt.colorSpaceToWorking(new st().fromArray(l),Tt);break;case"ks":i.specular=xt.colorSpaceToWorking(new st().fromArray(l),Tt);break;case"ke":i.emissive=xt.colorSpaceToWorking(new st().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 bn(i),this.materials[e]}getTextureParams(e,t){const n={scale:new Ge(1,1),offset:new Ge(0,0)},i=e.split(/\s+/);let s;return s=i.indexOf("-bm"),s>=0&&(t.bumpScale=parseFloat(i[s+1]),i.splice(s,2)),s=i.indexOf("-mm"),s>=0&&(t.displacementBias=parseFloat(i[s+1]),t.displacementScale=parseFloat(i[s+2]),i.splice(s,3)),s=i.indexOf("-s"),s>=0&&(n.scale.set(parseFloat(i[s+1]),parseFloat(i[s+2])),i.splice(s,4)),s=i.indexOf("-o"),s>=0&&(n.offset.set(parseFloat(i[s+1]),parseFloat(i[s+2])),i.splice(s,4)),n.url=i.join(" ").trim(),n}loadTexture(e,t,n,i,s){const a=this.manager!==void 0?this.manager:Xl;let o=a.getHandler(e);o===null&&(o=new ql(a)),o.setCrossOrigin&&o.setCrossOrigin(this.crossOrigin);const l=o.load(e,n,i,s);return t!==void 0&&(l.mapping=t),l}}class da extends Gn{constructor(e){super(e)}load(e,t,n,i){const s=this,a=new zr(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(o){try{t(s.parse(o))}catch(l){i?i(l):console.error(l),s.manager.itemError(e)}},n,i)}parse(e){function t(c){const h=new DataView(c),u=32/8*3+32/8*3*3+16/8,d=h.getUint32(80,!0);if(80+32/8+d*u===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,u){for(let d=0,f=c.length;d<f;d++)if(c[d]!==h.getUint8(u+d))return!1;return!0}function i(c){const h=new DataView(c),u=h.getUint32(80,!0);let d,f,m,_=!1,g,p,S,E,v;for(let R=0;R<70;R++)h.getUint32(R,!1)==1129270351&&h.getUint8(R+4)==82&&h.getUint8(R+5)==61&&(_=!0,g=new Float32Array(u*3*3),p=h.getUint8(R+6)/255,S=h.getUint8(R+7)/255,E=h.getUint8(R+8)/255,v=h.getUint8(R+9)/255);const N=84,C=12*4+2,T=new Bt,
|
|
4203
|
-
`||
|
|
4204
|
-
`);for(let p=0,S=g.length;p<S;p++){if(g[p]==="")continue;const E=g[p].split(" ");if(f.x!==void 0&&(s.push(parseFloat(E[f.x])),s.push(parseFloat(E[f.y])),s.push(parseFloat(E[f.z]))),f.rgb!==void 0){const v=i.fields.findIndex(R=>R==="rgb"),N=i.type[v],C=parseFloat(E[f.rgb]);let T=C;if(N==="F"){const R=new Float32Array(1);R[0]=C,T=new Int32Array(R.buffer)[0]}const P=(T>>16&255)/255,b=(T>>8&255)/255,x=(T>>0&255)/255;h.setRGB(P,b,x,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),S=i.offset;for(let E=0;E<i.points;E++){if(S.x!==void 0){const v=i.fields.indexOf("x"),N=i.fields.indexOf("y"),C=i.fields.indexOf("z");s.push(this._getDataView(p,i.points*S.x+i.size[v]*E,i.type[v],i.size[v])),s.push(this._getDataView(p,i.points*S.y+i.size[N]*E,i.type[N],i.size[N])),s.push(this._getDataView(p,i.points*S.z+i.size[C]*E,i.type[C],i.size[C]))}if(S.rgb!==void 0){const v=i.fields.indexOf("rgb"),N=p.getUint8(i.points*S.rgb+i.size[v]*E+2)/255,C=p.getUint8(i.points*S.rgb+i.size[v]*E+1)/255,T=p.getUint8(i.points*S.rgb+i.size[v]*E+0)/255;h.setRGB(N,C,T,Tt),o.push(h.r,h.g,h.b)}if(S.normal_x!==void 0){const v=i.fields.indexOf("normal_x"),N=i.fields.indexOf("normal_y"),C=i.fields.indexOf("normal_z");a.push(this._getDataView(p,i.points*S.normal_x+i.size[v]*E,i.type[v],i.size[v])),a.push(this._getDataView(p,i.points*S.normal_y+i.size[N]*E,i.type[N],i.size[N])),a.push(this._getDataView(p,i.points*S.normal_z+i.size[C]*E,i.type[C],i.size[C]))}if(S.intensity!==void 0){const v=i.fields.indexOf("intensity");l.push(this._getDataView(p,i.points*S.intensity+i.size[v]*E,i.type[v],i.size[v]))}if(S.label!==void 0){const v=i.fields.indexOf("label");c.push(p.getInt32(i.points*S.label+i.size[v]*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"),S=i.fields.indexOf("y"),E=i.fields.indexOf("z");s.push(this._getDataView(f,g+m.x,i.type[p],i.size[p])),s.push(this._getDataView(f,g+m.y,i.type[S],i.size[S])),s.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,S=f.getUint8(g+m.rgb+1)/255,E=f.getUint8(g+m.rgb+0)/255;h.setRGB(p,S,E,Tt),o.push(h.r,h.g,h.b)}if(m.normal_x!==void 0){const p=i.fields.indexOf("normal_x"),S=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[S],i.size[S])),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 u=new Bt;s.length>0&&u.setAttribute("position",new mt(s,3)),a.length>0&&u.setAttribute("normal",new mt(a,3)),o.length>0&&u.setAttribute("color",new mt(o,3)),l.length>0&&u.setAttribute("intensity",new mt(l,1)),c.length>0&&u.setAttribute("label",new mp(c,1)),u.computeBoundingSphere();const d=new Wi({size:.005});return o.length>0&&(d.vertexColors=!0),new Qr(u,d)}}class jh extends c0{constructor(e){super(e)}parse(e){function t(k){switch(k.image_type){case d:case _:if(k.colormap_length>256||k.colormap_size!==24||k.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(k.colormap_type)throw new Error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case u:throw new Error("THREE.TGALoader: No data.");default:throw new Error("THREE.TGALoader: Invalid type "+k.image_type)}if(k.width<=0||k.height<=0)throw new Error("THREE.TGALoader: Invalid image size.");if(k.pixel_size!==8&&k.pixel_size!==16&&k.pixel_size!==24&&k.pixel_size!==32)throw new Error("THREE.TGALoader: Invalid pixel size "+k.pixel_size)}function n(k,Q,q,ue,ye){let le,Le;const Te=q.pixel_size>>3,Y=q.width*q.height*Te;if(Q&&(Le=ye.subarray(ue,ue+=q.colormap_length*(q.colormap_size>>3))),k){le=new Uint8Array(Y);let re,ae,oe,Ee=0;const _e=new Uint8Array(Te);for(;Ee<Y;)if(re=ye[ue++],ae=(re&127)+1,re&128){for(oe=0;oe<Te;++oe)_e[oe]=ye[ue++];for(oe=0;oe<ae;++oe)le.set(_e,Ee+oe*Te);Ee+=Te*ae}else{for(ae*=Te,oe=0;oe<ae;++oe)le[Ee+oe]=ye[ue++];Ee+=ae}}else le=ye.subarray(ue,ue+=Q?q.width*q.height:Y);return{pixel_data:le,palettes:Le}}function i(k,Q,q,ue,ye,le,Le,Te,Y){const re=Y;let ae,oe=0,Ee,_e;const we=x.width;for(_e=Q;_e!==ue;_e+=q)for(Ee=ye;Ee!==Le;Ee+=le,oe++)ae=Te[oe],k[(Ee+we*_e)*4+3]=255,k[(Ee+we*_e)*4+2]=re[ae*3+0],k[(Ee+we*_e)*4+1]=re[ae*3+1],k[(Ee+we*_e)*4+0]=re[ae*3+2];return k}function s(k,Q,q,ue,ye,le,Le,Te){let Y,re=0,ae,oe;const Ee=x.width;for(oe=Q;oe!==ue;oe+=q)for(ae=ye;ae!==Le;ae+=le,re+=2)Y=Te[re+0]+(Te[re+1]<<8),k[(ae+Ee*oe)*4+0]=(Y&31744)>>7,k[(ae+Ee*oe)*4+1]=(Y&992)>>2,k[(ae+Ee*oe)*4+2]=(Y&31)<<3,k[(ae+Ee*oe)*4+3]=Y&32768?0:255;return k}function a(k,Q,q,ue,ye,le,Le,Te){let Y=0,re,ae;const oe=x.width;for(ae=Q;ae!==ue;ae+=q)for(re=ye;re!==Le;re+=le,Y+=3)k[(re+oe*ae)*4+3]=255,k[(re+oe*ae)*4+2]=Te[Y+0],k[(re+oe*ae)*4+1]=Te[Y+1],k[(re+oe*ae)*4+0]=Te[Y+2];return k}function o(k,Q,q,ue,ye,le,Le,Te){let Y=0,re,ae;const oe=x.width;for(ae=Q;ae!==ue;ae+=q)for(re=ye;re!==Le;re+=le,Y+=4)k[(re+oe*ae)*4+2]=Te[Y+0],k[(re+oe*ae)*4+1]=Te[Y+1],k[(re+oe*ae)*4+0]=Te[Y+2],k[(re+oe*ae)*4+3]=Te[Y+3];return k}function l(k,Q,q,ue,ye,le,Le,Te){let Y,re=0,ae,oe;const Ee=x.width;for(oe=Q;oe!==ue;oe+=q)for(ae=ye;ae!==Le;ae+=le,re++)Y=Te[re],k[(ae+Ee*oe)*4+0]=Y,k[(ae+Ee*oe)*4+1]=Y,k[(ae+Ee*oe)*4+2]=Y,k[(ae+Ee*oe)*4+3]=255;return k}function c(k,Q,q,ue,ye,le,Le,Te){let Y=0,re,ae;const oe=x.width;for(ae=Q;ae!==ue;ae+=q)for(re=ye;re!==Le;re+=le,Y+=2)k[(re+oe*ae)*4+0]=Te[Y+0],k[(re+oe*ae)*4+1]=Te[Y+0],k[(re+oe*ae)*4+2]=Te[Y+0],k[(re+oe*ae)*4+3]=Te[Y+1];return k}function h(k,Q,q,ue,ye){let le,Le,Te,Y,re,ae;switch((x.flags&S)>>E){default:case C:le=0,Te=1,re=Q,Le=0,Y=1,ae=q;break;case v:le=0,Te=1,re=Q,Le=q-1,Y=-1,ae=-1;break;case T:le=Q-1,Te=-1,re=-1,Le=0,Y=1,ae=q;break;case N:le=Q-1,Te=-1,re=-1,Le=q-1,Y=-1,ae=-1;break}if(V)switch(x.pixel_size){case 8:l(k,Le,Y,ae,le,Te,re,ue);break;case 16:c(k,Le,Y,ae,le,Te,re,ue);break;default:throw new Error("THREE.TGALoader: Format not supported.")}else switch(x.pixel_size){case 8:i(k,Le,Y,ae,le,Te,re,ue,ye);break;case 16:s(k,Le,Y,ae,le,Te,re,ue);break;case 24:a(k,Le,Y,ae,le,Te,re,ue);break;case 32:o(k,Le,Y,ae,le,Te,re,ue);break;default:throw new Error("THREE.TGALoader: Format not supported.")}return k}const u=0,d=1,f=2,m=3,_=9,g=10,p=11,S=48,E=4,v=0,N=1,C=2,T=3;if(e.length<19)throw new Error("THREE.TGALoader: Not enough data to contain header.");let P=0;const b=new Uint8Array(e),x={id_length:b[P++],colormap_type:b[P++],image_type:b[P++],colormap_index:b[P++]|b[P++]<<8,colormap_length:b[P++]|b[P++]<<8,colormap_size:b[P++],origin:[b[P++]|b[P++]<<8,b[P++]|b[P++]<<8],width:b[P++]|b[P++]<<8,height:b[P++]|b[P++]<<8,pixel_size:b[P++],flags:b[P++]};if(t(x),x.id_length+P>e.length)throw new Error("THREE.TGALoader: No data.");P+=x.id_length;let R=!1,B=!1,V=!1;switch(x.image_type){case _:R=!0,B=!0;break;case d:B=!0;break;case g:R=!0;break;case f:break;case p:R=!0,V=!0;break;case m:V=!0;break}const W=new Uint8Array(x.width*x.height*4),ee=n(R,B,x,P,b);return h(W,x.width,x.height,ee.pixel_data,ee.palettes),{data:W,width:x.width,height:x.height,flipY:!0,generateMipmaps:!0,minFilter:ui}}}class z3 extends Gn{load(e,t,n,i){const s=this,a=s.path===""?Yl.extractUrlBase(e):s.path,o=new zr(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(l){try{t(s.parse(l,a))}catch(c){i?i(c):console.error(c),s.manager.itemError(e)}},n,i)}parse(e,t){function n(M,y){const L=[],w=M.childNodes;for(let I=0,ie=w.length;I<ie;I++){const de=w[I];de.nodeName===y&&L.push(de)}return L}function i(M){if(M.length===0)return[];const y=M.trim().split(/\s+/),L=new Array(y.length);for(let w=0,I=y.length;w<I;w++)L[w]=y[w];return L}function s(M){if(M.length===0)return[];const y=M.trim().split(/\s+/),L=new Array(y.length);for(let w=0,I=y.length;w<I;w++)L[w]=parseFloat(y[w]);return L}function a(M){if(M.length===0)return[];const y=M.trim().split(/\s+/),L=new Array(y.length);for(let w=0,I=y.length;w<I;w++)L[w]=parseInt(y[w]);return L}function o(M){return M.substring(1)}function l(){return"three_default_"+ni++}function c(M){return Object.keys(M).length===0}function h(M){return{unit:u(n(M,"unit")[0]),upAxis:d(n(M,"up_axis")[0])}}function u(M){return M!==void 0&&M.hasAttribute("meter")===!0?parseFloat(M.getAttribute("meter")):1}function d(M){return M!==void 0?M.textContent:"Y_UP"}function f(M,y,L,w){const I=n(M,y)[0];if(I!==void 0){const ie=n(I,L);for(let de=0;de<ie.length;de++)w(ie[de])}}function m(M,y){for(const L in M){const w=M[L];w.build=y(M[L])}}function _(M,y){return M.build!==void 0||(M.build=y(M)),M.build}function g(M){const y={sources:{},samplers:{},channels:{}};let L=!1;for(let w=0,I=M.childNodes.length;w<I;w++){const ie=M.childNodes[w];if(ie.nodeType!==1)continue;let de;switch(ie.nodeName){case"source":de=ie.getAttribute("id"),y.sources[de]=ve(ie);break;case"sampler":de=ie.getAttribute("id"),y.samplers[de]=p(ie);break;case"channel":de=ie.getAttribute("target"),y.channels[de]=S(ie);break;case"animation":g(ie),L=!0;break;default:console.log(ie)}}L===!1&&(ft.animations[M.getAttribute("id")||Hi.generateUUID()]=y)}function p(M){const y={inputs:{}};for(let L=0,w=M.childNodes.length;L<w;L++){const I=M.childNodes[L];if(I.nodeType===1)switch(I.nodeName){case"input":const ie=o(I.getAttribute("source")),de=I.getAttribute("semantic");y.inputs[de]=ie;break}}return y}function S(M){const y={};let w=M.getAttribute("target").split("/");const I=w.shift();let ie=w.shift();const de=ie.indexOf("(")!==-1,Xe=ie.indexOf(".")!==-1;if(Xe)w=ie.split("."),ie=w.shift(),y.member=w.shift();else if(de){const Ie=ie.split("(");ie=Ie.shift();for(let ze=0;ze<Ie.length;ze++)Ie[ze]=parseInt(Ie[ze].replace(/\)/,""));y.indices=Ie}return y.id=I,y.sid=ie,y.arraySyntax=de,y.memberSyntax=Xe,y.sampler=o(M.getAttribute("source")),y}function E(M){const y=[],L=M.channels,w=M.samplers,I=M.sources;for(const ie in L)if(L.hasOwnProperty(ie)){const de=L[ie],Xe=w[de.sampler],Ie=Xe.inputs.INPUT,ze=Xe.inputs.OUTPUT,Ze=I[Ie],xe=I[ze],Ke=N(de,Ze,xe);x(Ke,y)}return y}function v(M){return _(ft.animations[M],E)}function N(M,y,L){const w=ft.nodes[M.id],I=gt(w.id),ie=w.transforms[M.sid],de=w.matrix.clone().transpose();let Xe,Ie,ze,Ze,xe,Ke;const $e={};switch(ie){case"matrix":for(ze=0,Ze=y.array.length;ze<Ze;ze++)if(Xe=y.array[ze],Ie=ze*L.stride,$e[Xe]===void 0&&($e[Xe]={}),M.arraySyntax===!0){const Vt=L.array[Ie],Pt=M.indices[0]+4*M.indices[1];$e[Xe][Pt]=Vt}else for(xe=0,Ke=L.stride;xe<Ke;xe++)$e[Xe][xe]=L.array[Ie+xe];break;case"translate":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',ie);break;case"rotate":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',ie);break;case"scale":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',ie);break}const ot=C($e,de);return{name:I.uuid,keyframes:ot}}function C(M,y){const L=[];for(const I in M)L.push({time:parseFloat(I),value:M[I]});L.sort(w);for(let I=0;I<16;I++)R(L,I,y.elements[I]);return L;function w(I,ie){return I.time-ie.time}}const T=new F,P=new F,b=new Rn;function x(M,y){const L=M.keyframes,w=M.name,I=[],ie=[],de=[],Xe=[];for(let Ie=0,ze=L.length;Ie<ze;Ie++){const Ze=L[Ie],xe=Ze.time,Ke=Ze.value;X.fromArray(Ke).transpose(),X.decompose(T,b,P),I.push(xe),ie.push(T.x,T.y,T.z),de.push(b.x,b.y,b.z,b.w),Xe.push(P.x,P.y,P.z)}return ie.length>0&&y.push(new Nr(w+".position",I,ie)),de.length>0&&y.push(new ds(w+".quaternion",I,de)),Xe.length>0&&y.push(new Nr(w+".scale",I,Xe)),y}function R(M,y,L){let w,I=!0,ie,de;for(ie=0,de=M.length;ie<de;ie++)w=M[ie],w.value[y]===void 0?w.value[y]=null:I=!1;if(I===!0)for(ie=0,de=M.length;ie<de;ie++)w=M[ie],w.value[y]=L;else B(M,y)}function B(M,y){let L,w;for(let I=0,ie=M.length;I<ie;I++){const de=M[I];if(de.value[y]===null){if(L=V(M,I,y),w=W(M,I,y),L===null){de.value[y]=w.value[y];continue}if(w===null){de.value[y]=L.value[y];continue}ee(de,L,w,y)}}}function V(M,y,L){for(;y>=0;){const w=M[y];if(w.value[L]!==null)return w;y--}return null}function W(M,y,L){for(;y<M.length;){const w=M[y];if(w.value[L]!==null)return w;y++}return null}function ee(M,y,L,w){if(L.time-y.time===0){M.value[w]=y.value[w];return}M.value[w]=(M.time-y.time)*(L.value[w]-y.value[w])/(L.time-y.time)+y.value[w]}function k(M){const y={name:M.getAttribute("id")||"default",start:parseFloat(M.getAttribute("start")||0),end:parseFloat(M.getAttribute("end")||0),animations:[]};for(let L=0,w=M.childNodes.length;L<w;L++){const I=M.childNodes[L];if(I.nodeType===1)switch(I.nodeName){case"instance_animation":y.animations.push(o(I.getAttribute("url")));break}}ft.clips[M.getAttribute("id")]=y}function Q(M){const y=[],L=M.name,w=M.end-M.start||-1,I=M.animations;for(let ie=0,de=I.length;ie<de;ie++){const Xe=v(I[ie]);for(let Ie=0,ze=Xe.length;Ie<ze;Ie++)y.push(Xe[Ie])}return new Jc(L,w,y)}function q(M){return _(ft.clips[M],Q)}function ue(M){const y={};for(let L=0,w=M.childNodes.length;L<w;L++){const I=M.childNodes[L];if(I.nodeType===1)switch(I.nodeName){case"skin":y.id=o(I.getAttribute("source")),y.skin=ye(I);break;case"morph":y.id=o(I.getAttribute("source")),console.warn("THREE.ColladaLoader: Morph target animation not supported yet.");break}}ft.controllers[M.getAttribute("id")]=y}function ye(M){const y={sources:{}};for(let L=0,w=M.childNodes.length;L<w;L++){const I=M.childNodes[L];if(I.nodeType===1)switch(I.nodeName){case"bind_shape_matrix":y.bindShapeMatrix=s(I.textContent);break;case"source":const ie=I.getAttribute("id");y.sources[ie]=ve(I);break;case"joints":y.joints=le(I);break;case"vertex_weights":y.vertexWeights=Le(I);break}}return y}function le(M){const y={inputs:{}};for(let L=0,w=M.childNodes.length;L<w;L++){const I=M.childNodes[L];if(I.nodeType===1)switch(I.nodeName){case"input":const ie=I.getAttribute("semantic"),de=o(I.getAttribute("source"));y.inputs[ie]=de;break}}return y}function Le(M){const y={inputs:{}};for(let L=0,w=M.childNodes.length;L<w;L++){const I=M.childNodes[L];if(I.nodeType===1)switch(I.nodeName){case"input":const ie=I.getAttribute("semantic"),de=o(I.getAttribute("source")),Xe=parseInt(I.getAttribute("offset"));y.inputs[ie]={id:de,offset:Xe};break;case"vcount":y.vcount=a(I.textContent);break;case"v":y.v=a(I.textContent);break}}return y}function Te(M){const y={id:M.id},L=ft.geometries[y.id];return M.skin!==void 0&&(y.skin=Y(M.skin),L.sources.skinIndices=y.skin.indices,L.sources.skinWeights=y.skin.weights),y}function Y(M){const L={joints:[],indices:{array:[],stride:4},weights:{array:[],stride:4}},w=M.sources,I=M.vertexWeights,ie=I.vcount,de=I.v,Xe=I.inputs.JOINT.offset,Ie=I.inputs.WEIGHT.offset,ze=M.sources[M.joints.inputs.JOINT],Ze=M.sources[M.joints.inputs.INV_BIND_MATRIX],xe=w[I.inputs.WEIGHT.id].array;let Ke=0,$e,ot,it;for($e=0,it=ie.length;$e<it;$e++){const Pt=ie[$e],At=[];for(ot=0;ot<Pt;ot++){const wt=de[Ke+Xe],ii=de[Ke+Ie],Mn=xe[ii];At.push({index:wt,weight:Mn}),Ke+=2}for(At.sort(Vt),ot=0;ot<4;ot++){const wt=At[ot];wt!==void 0?(L.indices.array.push(wt.index),L.weights.array.push(wt.weight)):(L.indices.array.push(0),L.weights.array.push(0))}}for(M.bindShapeMatrix?L.bindMatrix=new lt().fromArray(M.bindShapeMatrix).transpose():L.bindMatrix=new lt().identity(),$e=0,it=ze.array.length;$e<it;$e++){const Pt=ze.array[$e],At=new lt().fromArray(Ze.array,$e*Ze.stride).transpose();L.joints.push({name:Pt,boneInverse:At})}return L;function Vt(Pt,At){return At.weight-Pt.weight}}function re(M){return _(ft.controllers[M],Te)}function ae(M){const y={init_from:n(M,"init_from")[0].textContent};ft.images[M.getAttribute("id")]=y}function oe(M){return M.build!==void 0?M.build:M.init_from}function Ee(M){const y=ft.images[M];return y!==void 0?_(y,oe):(console.warn("THREE.ColladaLoader: Couldn't find image with ID:",M),null)}function _e(M){const y={};for(let L=0,w=M.childNodes.length;L<w;L++){const I=M.childNodes[L];if(I.nodeType===1)switch(I.nodeName){case"profile_COMMON":y.profile=we(I);break}}ft.effects[M.getAttribute("id")]=y}function we(M){const y={surfaces:{},samplers:{}};for(let L=0,w=M.childNodes.length;L<w;L++){const I=M.childNodes[L];if(I.nodeType===1)switch(I.nodeName){case"newparam":ke(I,y);break;case"technique":y.technique=O(I);break;case"extra":y.extra=he(I);break}}return y}function ke(M,y){const L=M.getAttribute("sid");for(let w=0,I=M.childNodes.length;w<I;w++){const ie=M.childNodes[w];if(ie.nodeType===1)switch(ie.nodeName){case"surface":y.surfaces[L]=tt(ie);break;case"sampler2D":y.samplers[L]=Qe(ie);break}}}function tt(M){const y={};for(let L=0,w=M.childNodes.length;L<w;L++){const I=M.childNodes[L];if(I.nodeType===1)switch(I.nodeName){case"init_from":y.init_from=I.textContent;break}}return y}function Qe(M){const y={};for(let L=0,w=M.childNodes.length;L<w;L++){const I=M.childNodes[L];if(I.nodeType===1)switch(I.nodeName){case"source":y.source=I.textContent;break}}return y}function O(M){const y={};for(let L=0,w=M.childNodes.length;L<w;L++){const I=M.childNodes[L];if(I.nodeType===1)switch(I.nodeName){case"constant":case"lambert":case"blinn":case"phong":y.type=I.nodeName,y.parameters=bt(I);break;case"extra":y.extra=he(I);break}}return y}function bt(M){const y={};for(let L=0,w=M.childNodes.length;L<w;L++){const I=M.childNodes[L];if(I.nodeType===1)switch(I.nodeName){case"emission":case"diffuse":case"specular":case"bump":case"ambient":case"shininess":case"transparency":y[I.nodeName]=$(I);break;case"transparent":y[I.nodeName]={opaque:I.hasAttribute("opaque")?I.getAttribute("opaque"):"A_ONE",data:$(I)};break}}return y}function $(M){const y={};for(let L=0,w=M.childNodes.length;L<w;L++){const I=M.childNodes[L];if(I.nodeType===1)switch(I.nodeName){case"color":y[I.nodeName]=s(I.textContent);break;case"float":y[I.nodeName]=parseFloat(I.textContent);break;case"texture":y[I.nodeName]={id:I.getAttribute("texture"),extra:pe(I)};break}}return y}function pe(M){const y={technique:{}};for(let L=0,w=M.childNodes.length;L<w;L++){const I=M.childNodes[L];if(I.nodeType===1)switch(I.nodeName){case"extra":te(I,y);break}}return y}function te(M,y){for(let L=0,w=M.childNodes.length;L<w;L++){const I=M.childNodes[L];if(I.nodeType===1)switch(I.nodeName){case"technique":Se(I,y);break}}}function Se(M,y){for(let L=0,w=M.childNodes.length;L<w;L++){const I=M.childNodes[L];if(I.nodeType===1)switch(I.nodeName){case"repeatU":case"repeatV":case"offsetU":case"offsetV":y.technique[I.nodeName]=parseFloat(I.textContent);break;case"wrapU":case"wrapV":I.textContent.toUpperCase()==="TRUE"?y.technique[I.nodeName]=1:I.textContent.toUpperCase()==="FALSE"?y.technique[I.nodeName]=0:y.technique[I.nodeName]=parseInt(I.textContent);break;case"bump":y[I.nodeName]=Ue(I);break}}}function he(M){const y={};for(let L=0,w=M.childNodes.length;L<w;L++){const I=M.childNodes[L];if(I.nodeType===1)switch(I.nodeName){case"technique":y.technique=ce(I);break}}return y}function ce(M){const y={};for(let L=0,w=M.childNodes.length;L<w;L++){const I=M.childNodes[L];if(I.nodeType===1)switch(I.nodeName){case"double_sided":y[I.nodeName]=parseInt(I.textContent);break;case"bump":y[I.nodeName]=Ue(I);break}}return y}function Ue(M){const y={};for(let L=0,w=M.childNodes.length;L<w;L++){const I=M.childNodes[L];if(I.nodeType===1)switch(I.nodeName){case"texture":y[I.nodeName]={id:I.getAttribute("texture"),texcoord:I.getAttribute("texcoord"),extra:pe(I)};break}}return y}function U(M){return M}function A(M){return _(ft.effects[M],U)}function G(M){const y={name:M.getAttribute("name")};for(let L=0,w=M.childNodes.length;L<w;L++){const I=M.childNodes[L];if(I.nodeType===1)switch(I.nodeName){case"instance_effect":y.url=o(I.getAttribute("url"));break}}ft.materials[M.getAttribute("id")]=y}function z(M){let y,L=M.slice((M.lastIndexOf(".")-1>>>0)+2);switch(L=L.toLowerCase(),L){case"tga":y=un;break;default:y=mn}return y}function se(M){const y=A(M.url),L=y.profile.technique;let w;switch(L.type){case"phong":case"blinn":w=new bn;break;case"lambert":w=new $p;break;default:w=new Ri;break}w.name=M.name||"";function I(Ie,ze=null){const Ze=y.profile.samplers[Ie.id];let xe=null;if(Ze!==void 0){const Ke=y.profile.surfaces[Ze.source];xe=Ee(Ke.init_from)}else console.warn("THREE.ColladaLoader: Undefined sampler. Access image directly (see #12530)."),xe=Ee(Ie.id);if(xe!==null){const Ke=z(xe);if(Ke!==void 0){const $e=Ke.load(xe),ot=Ie.extra;if(ot!==void 0&&ot.technique!==void 0&&c(ot.technique)===!1){const it=ot.technique;$e.wrapS=it.wrapU?$n:kn,$e.wrapT=it.wrapV?$n:kn,$e.offset.set(it.offsetU||0,it.offsetV||0),$e.repeat.set(it.repeatU||1,it.repeatV||1)}else $e.wrapS=$n,$e.wrapT=$n;return ze!==null&&($e.colorSpace=ze),$e}else return console.warn("THREE.ColladaLoader: Loader for texture %s not found.",xe),null}else return console.warn("THREE.ColladaLoader: Couldn't create texture with ID:",Ie.id),null}const ie=L.parameters;for(const Ie in ie){const ze=ie[Ie];switch(Ie){case"diffuse":ze.color&&w.color.fromArray(ze.color),ze.texture&&(w.map=I(ze.texture,Tt));break;case"specular":ze.color&&w.specular&&w.specular.fromArray(ze.color),ze.texture&&(w.specularMap=I(ze.texture));break;case"bump":ze.texture&&(w.normalMap=I(ze.texture));break;case"ambient":ze.texture&&(w.lightMap=I(ze.texture,Tt));break;case"shininess":ze.float&&w.shininess&&(w.shininess=ze.float);break;case"emission":ze.color&&w.emissive&&w.emissive.fromArray(ze.color),ze.texture&&(w.emissiveMap=I(ze.texture,Tt));break}}xt.colorSpaceToWorking(w.color,Tt),w.specular&&xt.colorSpaceToWorking(w.specular,Tt),w.emissive&&xt.colorSpaceToWorking(w.emissive,Tt);let de=ie.transparent,Xe=ie.transparency;if(Xe===void 0&&de&&(Xe={float:1}),de===void 0&&Xe&&(de={opaque:"A_ONE",data:{color:[1,1,1,1]}}),de&&Xe)if(de.data.texture)w.transparent=!0;else{const Ie=de.data.color;switch(de.opaque){case"A_ONE":w.opacity=Ie[3]*Xe.float;break;case"RGB_ZERO":w.opacity=1-Ie[0]*Xe.float;break;case"A_ZERO":w.opacity=1-Ie[3]*Xe.float;break;case"RGB_ONE":w.opacity=Ie[0]*Xe.float;break;default:console.warn('THREE.ColladaLoader: Invalid opaque type "%s" of transparent tag.',de.opaque)}w.opacity<1&&(w.transparent=!0)}if(L.extra!==void 0&&L.extra.technique!==void 0){const Ie=L.extra.technique;for(const ze in Ie){const Ze=Ie[ze];switch(ze){case"double_sided":w.side=Ze===1?pn:Hn;break;case"bump":w.normalMap=I(Ze.texture),w.normalScale=new Ge(1,1);break}}}return w}function ne(M){return _(ft.materials[M],se)}function Ce(M){const y={name:M.getAttribute("name")};for(let L=0,w=M.childNodes.length;L<w;L++){const I=M.childNodes[L];if(I.nodeType===1)switch(I.nodeName){case"optics":y.optics=Ae(I);break}}ft.cameras[M.getAttribute("id")]=y}function Ae(M){for(let y=0;y<M.childNodes.length;y++){const L=M.childNodes[y];switch(L.nodeName){case"technique_common":return Be(L)}}return{}}function Be(M){const y={};for(let L=0;L<M.childNodes.length;L++){const w=M.childNodes[L];switch(w.nodeName){case"perspective":case"orthographic":y.technique=w.nodeName,y.parameters=Ve(w);break}}return y}function Ve(M){const y={};for(let L=0;L<M.childNodes.length;L++){const w=M.childNodes[L];switch(w.nodeName){case"xfov":case"yfov":case"xmag":case"ymag":case"znear":case"zfar":case"aspect_ratio":y[w.nodeName]=parseFloat(w.textContent);break}}return y}function me(M){let y;switch(M.optics.technique){case"perspective":y=new ln(M.optics.parameters.yfov,M.optics.parameters.aspect_ratio,M.optics.parameters.znear,M.optics.parameters.zfar);break;case"orthographic":let L=M.optics.parameters.ymag,w=M.optics.parameters.xmag;const I=M.optics.parameters.aspect_ratio;w=w===void 0?L*I:w,L=L===void 0?w/I:L,w*=.5,L*=.5,y=new Ca(-w,w,L,-L,M.optics.parameters.znear,M.optics.parameters.zfar);break;default:y=new ln;break}return y.name=M.name||"",y}function De(M){const y=ft.cameras[M];return y!==void 0?_(y,me):(console.warn("THREE.ColladaLoader: Couldn't find camera with ID:",M),null)}function Je(M){let y={};for(let L=0,w=M.childNodes.length;L<w;L++){const I=M.childNodes[L];if(I.nodeType===1)switch(I.nodeName){case"technique_common":y=nt(I);break}}ft.lights[M.getAttribute("id")]=y}function nt(M){const y={};for(let L=0,w=M.childNodes.length;L<w;L++){const I=M.childNodes[L];if(I.nodeType===1)switch(I.nodeName){case"directional":case"point":case"spot":case"ambient":y.technique=I.nodeName,y.parameters=Pe(I)}}return y}function Pe(M){const y={};for(let L=0,w=M.childNodes.length;L<w;L++){const I=M.childNodes[L];if(I.nodeType===1)switch(I.nodeName){case"color":const ie=s(I.textContent);y.color=new st().fromArray(ie),xt.colorSpaceToWorking(y.color,Tt);break;case"falloff_angle":y.falloffAngle=parseFloat(I.textContent);break;case"quadratic_attenuation":const de=parseFloat(I.textContent);y.distance=de?Math.sqrt(1/de):0;break}}return y}function ct(M){let y;switch(M.technique){case"directional":y=new zu;break;case"point":y=new Ou;break;case"spot":y=new d0;break;case"ambient":y=new Bu;break}return M.parameters.color&&y.color.copy(M.parameters.color),M.parameters.distance&&(y.distance=M.parameters.distance),y}function H(M){const y=ft.lights[M];return y!==void 0?_(y,ct):(console.warn("THREE.ColladaLoader: Couldn't find light with ID:",M),null)}function Fe(M){const y={name:M.getAttribute("name"),sources:{},vertices:{},primitives:[]},L=n(M,"mesh")[0];if(L!==void 0){for(let w=0;w<L.childNodes.length;w++){const I=L.childNodes[w];if(I.nodeType!==1)continue;const ie=I.getAttribute("id");switch(I.nodeName){case"source":y.sources[ie]=ve(I);break;case"vertices":y.vertices=He(I);break;case"polygons":console.warn("THREE.ColladaLoader: Unsupported primitive type: ",I.nodeName);break;case"lines":case"linestrips":case"polylist":case"triangles":y.primitives.push(Me(I));break;default:console.log(I)}}ft.geometries[M.getAttribute("id")]=y}}function ve(M){const y={array:[],stride:3};for(let L=0;L<M.childNodes.length;L++){const w=M.childNodes[L];if(w.nodeType===1)switch(w.nodeName){case"float_array":y.array=s(w.textContent);break;case"Name_array":y.array=i(w.textContent);break;case"technique_common":const I=n(w,"accessor")[0];I!==void 0&&(y.stride=parseInt(I.getAttribute("stride")));break}}return y}function He(M){const y={};for(let L=0;L<M.childNodes.length;L++){const w=M.childNodes[L];w.nodeType===1&&(y[w.getAttribute("semantic")]=o(w.getAttribute("source")))}return y}function Me(M){const y={type:M.nodeName,material:M.getAttribute("material"),count:parseInt(M.getAttribute("count")),inputs:{},stride:0,hasUV:!1};for(let L=0,w=M.childNodes.length;L<w;L++){const I=M.childNodes[L];if(I.nodeType===1)switch(I.nodeName){case"input":const ie=o(I.getAttribute("source")),de=I.getAttribute("semantic"),Xe=parseInt(I.getAttribute("offset")),Ie=parseInt(I.getAttribute("set")),ze=Ie>0?de+Ie:de;y.inputs[ze]={id:ie,offset:Xe},y.stride=Math.max(y.stride,Xe+1),de==="TEXCOORD"&&(y.hasUV=!0);break;case"vcount":y.vcount=a(I.textContent);break;case"p":y.p=a(I.textContent);break}}return y}function ge(M){const y={};for(let L=0;L<M.length;L++){const w=M[L];y[w.type]===void 0&&(y[w.type]=[]),y[w.type].push(w)}return y}function qe(M){let y=0;for(let L=0,w=M.length;L<w;L++)M[L].hasUV===!0&&y++;y>0&&y<M.length&&(M.uvsNeedsFix=!0)}function ht(M){const y={},L=M.sources,w=M.vertices,I=M.primitives;if(I.length===0)return{};const ie=ge(I);for(const de in ie){const Xe=ie[de];qe(Xe),y[de]=Dt(Xe,L,w)}return y}function Dt(M,y,L){const w={},I={array:[],stride:0},ie={array:[],stride:0},de={array:[],stride:0},Xe={array:[],stride:0},Ie={array:[],stride:0},ze={array:[],stride:4},Ze={array:[],stride:4},xe=new Bt,Ke=[];let $e=0;for(let ot=0;ot<M.length;ot++){const it=M[ot],Vt=it.inputs;let Pt=0;switch(it.type){case"lines":case"linestrips":Pt=it.count*2;break;case"triangles":Pt=it.count*3;break;case"polylist":for(let At=0;At<it.count;At++){const wt=it.vcount[At];switch(wt){case 3:Pt+=3;break;case 4:Pt+=6;break;default:Pt+=(wt-2)*3;break}}break;default:console.warn("THREE.ColladaLoader: Unknown primitive type:",it.type)}xe.addGroup($e,Pt,ot),$e+=Pt,it.material&&Ke.push(it.material);for(const At in Vt){const wt=Vt[At];switch(At){case"VERTEX":for(const ii in L){const Mn=L[ii];switch(ii){case"POSITION":const ir=I.array.length;if(pt(it,y[Mn],wt.offset,I.array),I.stride=y[Mn].stride,y.skinWeights&&y.skinIndices&&(pt(it,y.skinIndices,wt.offset,ze.array),pt(it,y.skinWeights,wt.offset,Ze.array)),it.hasUV===!1&&M.uvsNeedsFix===!0){const ad=(I.array.length-ir)/I.stride;for(let Ql=0;Ql<ad;Ql++)de.array.push(0,0)}break;case"NORMAL":pt(it,y[Mn],wt.offset,ie.array),ie.stride=y[Mn].stride;break;case"COLOR":pt(it,y[Mn],wt.offset,Ie.array),Ie.stride=y[Mn].stride;break;case"TEXCOORD":pt(it,y[Mn],wt.offset,de.array),de.stride=y[Mn].stride;break;case"TEXCOORD1":pt(it,y[Mn],wt.offset,Xe.array),de.stride=y[Mn].stride;break;default:console.warn('THREE.ColladaLoader: Semantic "%s" not handled in geometry build process.',ii)}}break;case"NORMAL":pt(it,y[wt.id],wt.offset,ie.array),ie.stride=y[wt.id].stride;break;case"COLOR":pt(it,y[wt.id],wt.offset,Ie.array,!0),Ie.stride=y[wt.id].stride;break;case"TEXCOORD":pt(it,y[wt.id],wt.offset,de.array),de.stride=y[wt.id].stride;break;case"TEXCOORD1":pt(it,y[wt.id],wt.offset,Xe.array),Xe.stride=y[wt.id].stride;break}}}return I.array.length>0&&xe.setAttribute("position",new mt(I.array,I.stride)),ie.array.length>0&&xe.setAttribute("normal",new mt(ie.array,ie.stride)),Ie.array.length>0&&xe.setAttribute("color",new mt(Ie.array,Ie.stride)),de.array.length>0&&xe.setAttribute("uv",new mt(de.array,de.stride)),Xe.array.length>0&&xe.setAttribute("uv1",new mt(Xe.array,Xe.stride)),ze.array.length>0&&xe.setAttribute("skinIndex",new mt(ze.array,ze.stride)),Ze.array.length>0&&xe.setAttribute("skinWeight",new mt(Ze.array,Ze.stride)),w.data=xe,w.type=M[0].type,w.materialKeys=Ke,w}function pt(M,y,L,w,I=!1){const ie=M.p,de=M.stride,Xe=M.vcount;function Ie(xe){let Ke=ie[xe+L]*Ze;const $e=Ke+Ze;for(;Ke<$e;Ke++)w.push(ze[Ke]);if(I){const ot=w.length-Ze-1;Xt.setRGB(w[ot+0],w[ot+1],w[ot+2],Tt),w[ot+0]=Xt.r,w[ot+1]=Xt.g,w[ot+2]=Xt.b}}const ze=y.array,Ze=y.stride;if(M.vcount!==void 0){let xe=0;for(let Ke=0,$e=Xe.length;Ke<$e;Ke++){const ot=Xe[Ke];if(ot===4){const it=xe+de*0,Vt=xe+de*1,Pt=xe+de*2,At=xe+de*3;Ie(it),Ie(Vt),Ie(At),Ie(Vt),Ie(Pt),Ie(At)}else if(ot===3){const it=xe+de*0,Vt=xe+de*1,Pt=xe+de*2;Ie(it),Ie(Vt),Ie(Pt)}else if(ot>4)for(let it=1,Vt=ot-2;it<=Vt;it++){const Pt=xe+de*0,At=xe+de*it,wt=xe+de*(it+1);Ie(Pt),Ie(At),Ie(wt)}xe+=de*ot}}else for(let xe=0,Ke=ie.length;xe<Ke;xe+=de)Ie(xe)}function en(M){return _(ft.geometries[M],ht)}function je(M){const y={name:M.getAttribute("name")||"",joints:{},links:[]};for(let L=0;L<M.childNodes.length;L++){const w=M.childNodes[L];if(w.nodeType===1)switch(w.nodeName){case"technique_common":tn(w,y);break}}ft.kinematicsModels[M.getAttribute("id")]=y}function Zt(M){return M.build!==void 0?M.build:M}function jt(M){return _(ft.kinematicsModels[M],Zt)}function tn(M,y){for(let L=0;L<M.childNodes.length;L++){const w=M.childNodes[L];if(w.nodeType===1)switch(w.nodeName){case"joint":y.joints[w.getAttribute("sid")]=Di(w);break;case"link":y.links.push(rt(w));break}}}function Di(M){let y;for(let L=0;L<M.childNodes.length;L++){const w=M.childNodes[L];if(w.nodeType===1)switch(w.nodeName){case"prismatic":case"revolute":y=ti(w);break}}return y}function ti(M){const y={sid:M.getAttribute("sid"),name:M.getAttribute("name")||"",axis:new F,limits:{min:0,max:0},type:M.nodeName,static:!1,zeroPosition:0,middlePosition:0};for(let L=0;L<M.childNodes.length;L++){const w=M.childNodes[L];if(w.nodeType===1)switch(w.nodeName){case"axis":const I=s(w.textContent);y.axis.fromArray(I);break;case"limits":const ie=w.getElementsByTagName("max")[0],de=w.getElementsByTagName("min")[0];y.limits.max=parseFloat(ie.textContent),y.limits.min=parseFloat(de.textContent);break}}return y.limits.min>=y.limits.max&&(y.static=!0),y.middlePosition=(y.limits.min+y.limits.max)/2,y}function rt(M){const y={sid:M.getAttribute("sid"),name:M.getAttribute("name")||"",attachments:[],transforms:[]};for(let L=0;L<M.childNodes.length;L++){const w=M.childNodes[L];if(w.nodeType===1)switch(w.nodeName){case"attachment_full":y.attachments.push(Re(w));break;case"matrix":case"translate":case"rotate":y.transforms.push(Ht(w));break}}return y}function Re(M){const y={joint:M.getAttribute("joint").split("/").pop(),transforms:[],links:[]};for(let L=0;L<M.childNodes.length;L++){const w=M.childNodes[L];if(w.nodeType===1)switch(w.nodeName){case"link":y.links.push(rt(w));break;case"matrix":case"translate":case"rotate":y.transforms.push(Ht(w));break}}return y}function Ht(M){const y={type:M.nodeName},L=s(M.textContent);switch(y.type){case"matrix":y.obj=new lt,y.obj.fromArray(L).transpose();break;case"translate":y.obj=new F,y.obj.fromArray(L);break;case"rotate":y.obj=new F,y.obj.fromArray(L),y.angle=Hi.degToRad(L[3]);break}return y}function nn(M){const y={name:M.getAttribute("name")||"",rigidBodies:{}};for(let L=0;L<M.childNodes.length;L++){const w=M.childNodes[L];if(w.nodeType===1)switch(w.nodeName){case"rigid_body":y.rigidBodies[w.getAttribute("name")]={},Wt(w,y.rigidBodies[w.getAttribute("name")]);break}}ft.physicsModels[M.getAttribute("id")]=y}function Wt(M,y){for(let L=0;L<M.childNodes.length;L++){const w=M.childNodes[L];if(w.nodeType===1)switch(w.nodeName){case"technique_common":hn(w,y);break}}}function hn(M,y){for(let L=0;L<M.childNodes.length;L++){const w=M.childNodes[L];if(w.nodeType===1)switch(w.nodeName){case"inertia":y.inertia=s(w.textContent);break;case"mass":y.mass=s(w.textContent)[0];break}}}function En(M){const y={bindJointAxis:[]};for(let L=0;L<M.childNodes.length;L++){const w=M.childNodes[L];if(w.nodeType===1)switch(w.nodeName){case"bind_joint_axis":y.bindJointAxis.push(Ki(w));break}}ft.kinematicsScenes[o(M.getAttribute("url"))]=y}function Ki(M){const y={target:M.getAttribute("target").split("/").pop()};for(let L=0;L<M.childNodes.length;L++){const w=M.childNodes[L];if(w.nodeType===1)switch(w.nodeName){case"axis":const I=w.getElementsByTagName("param")[0];y.axis=I.textContent;const ie=y.axis.split("inst_").pop().split("axis")[0];y.jointIndex=ie.substring(0,ie.length-1);break}}return y}function Zi(M){return M.build!==void 0?M.build:M}function Qi(M){return _(ft.kinematicsScenes[M],Zi)}function er(){const M=Object.keys(ft.kinematicsModels)[0],y=Object.keys(ft.kinematicsScenes)[0],L=Object.keys(ft.visualScenes)[0];if(M===void 0||y===void 0)return;const w=jt(M),I=Qi(y),ie=St(L),de=I.bindJointAxis,Xe={};for(let Ze=0,xe=de.length;Ze<xe;Ze++){const Ke=de[Ze],$e=zt.querySelector('[sid="'+Ke.target+'"]');if($e){const ot=$e.parentElement;Ie(Ke.jointIndex,ot)}}function Ie(Ze,xe){const Ke=xe.getAttribute("name"),$e=w.joints[Ze];ie.traverse(function(ot){ot.name===Ke&&(Xe[Ze]={object:ot,transforms:tr(xe),joint:$e,position:$e.zeroPosition})})}const ze=new lt;nr={joints:w&&w.joints,getJointValue:function(Ze){const xe=Xe[Ze];if(xe)return xe.position;console.warn("THREE.ColladaLoader: Joint "+Ze+" doesn't exist.")},setJointValue:function(Ze,xe){const Ke=Xe[Ze];if(Ke){const $e=Ke.joint;if(xe>$e.limits.max||xe<$e.limits.min)console.warn("THREE.ColladaLoader: Joint "+Ze+" value "+xe+" outside of limits (min: "+$e.limits.min+", max: "+$e.limits.max+").");else if($e.static)console.warn("THREE.ColladaLoader: Joint "+Ze+" is static.");else{const ot=Ke.object,it=$e.axis,Vt=Ke.transforms;X.identity();for(let Pt=0;Pt<Vt.length;Pt++){const At=Vt[Pt];if(At.sid&&At.sid.indexOf(Ze)!==-1)switch($e.type){case"revolute":X.multiply(ze.makeRotationAxis(it,Hi.degToRad(xe)));break;case"prismatic":X.multiply(ze.makeTranslation(it.x*xe,it.y*xe,it.z*xe));break;default:console.warn("THREE.ColladaLoader: Unknown joint type: "+$e.type);break}else switch(At.type){case"matrix":X.multiply(At.obj);break;case"translate":X.multiply(ze.makeTranslation(At.obj.x,At.obj.y,At.obj.z));break;case"scale":X.scale(At.obj);break;case"rotate":X.multiply(ze.makeRotationAxis(At.obj,At.angle));break}}ot.matrix.copy(X),ot.matrix.decompose(ot.position,ot.quaternion,ot.scale),Xe[Ze].position=xe}}else console.log("THREE.ColladaLoader: "+Ze+" does not exist.")}}}function tr(M){const y=[],L=zt.querySelector('[id="'+M.id+'"]');for(let w=0;w<L.childNodes.length;w++){const I=L.childNodes[w];if(I.nodeType!==1)continue;let ie,de;switch(I.nodeName){case"matrix":ie=s(I.textContent);const Xe=new lt().fromArray(ie).transpose();y.push({sid:I.getAttribute("sid"),type:I.nodeName,obj:Xe});break;case"translate":case"scale":ie=s(I.textContent),de=new F().fromArray(ie),y.push({sid:I.getAttribute("sid"),type:I.nodeName,obj:de});break;case"rotate":ie=s(I.textContent),de=new F().fromArray(ie);const Ie=Hi.degToRad(ie[3]);y.push({sid:I.getAttribute("sid"),type:I.nodeName,obj:de,angle:Ie});break}}return y}function D(M){const y=M.getElementsByTagName("node");for(let L=0;L<y.length;L++){const w=y[L];w.hasAttribute("id")===!1&&w.setAttribute("id",l())}}const X=new lt,J=new F;function Z(M){const y={name:M.getAttribute("name")||"",type:M.getAttribute("type"),id:M.getAttribute("id"),sid:M.getAttribute("sid"),matrix:new lt,nodes:[],instanceCameras:[],instanceControllers:[],instanceLights:[],instanceGeometries:[],instanceNodes:[],transforms:{}};for(let L=0;L<M.childNodes.length;L++){const w=M.childNodes[L];if(w.nodeType!==1)continue;let I;switch(w.nodeName){case"node":y.nodes.push(w.getAttribute("id")),Z(w);break;case"instance_camera":y.instanceCameras.push(o(w.getAttribute("url")));break;case"instance_controller":y.instanceControllers.push(j(w));break;case"instance_light":y.instanceLights.push(o(w.getAttribute("url")));break;case"instance_geometry":y.instanceGeometries.push(j(w));break;case"instance_node":y.instanceNodes.push(o(w.getAttribute("url")));break;case"matrix":I=s(w.textContent),y.matrix.multiply(X.fromArray(I).transpose()),y.transforms[w.getAttribute("sid")]=w.nodeName;break;case"translate":I=s(w.textContent),J.fromArray(I),y.matrix.multiply(X.makeTranslation(J.x,J.y,J.z)),y.transforms[w.getAttribute("sid")]=w.nodeName;break;case"rotate":I=s(w.textContent);const ie=Hi.degToRad(I[3]);y.matrix.multiply(X.makeRotationAxis(J.fromArray(I),ie)),y.transforms[w.getAttribute("sid")]=w.nodeName;break;case"scale":I=s(w.textContent),y.matrix.scale(J.fromArray(I)),y.transforms[w.getAttribute("sid")]=w.nodeName;break;case"extra":break;default:console.log(w)}}return et(y.id)?console.warn("THREE.ColladaLoader: There is already a node with ID %s. Exclude current node from further processing.",y.id):ft.nodes[y.id]=y,y}function j(M){const y={id:o(M.getAttribute("url")),materials:{},skeletons:[]};for(let L=0;L<M.childNodes.length;L++){const w=M.childNodes[L];switch(w.nodeName){case"bind_material":const I=w.getElementsByTagName("instance_material");for(let ie=0;ie<I.length;ie++){const de=I[ie],Xe=de.getAttribute("symbol"),Ie=de.getAttribute("target");y.materials[Xe]=o(Ie)}break;case"skeleton":y.skeletons.push(o(w.textContent));break}}return y}function be(M,y){const L=[],w=[];let I,ie,de;for(I=0;I<M.length;I++){const ze=M[I];let Ze;if(et(ze))Ze=gt(ze),Oe(Ze,y,L);else if(kt(ze)){const Ke=ft.visualScenes[ze].children;for(let $e=0;$e<Ke.length;$e++){const ot=Ke[$e];if(ot.type==="JOINT"){const it=gt(ot.id);Oe(it,y,L)}}}else console.error("THREE.ColladaLoader: Unable to find root bone of skeleton with ID:",ze)}for(I=0;I<y.length;I++)for(ie=0;ie<L.length;ie++)if(de=L[ie],de.bone.name===y[I].name){w[I]=de,de.processed=!0;break}for(I=0;I<L.length;I++)de=L[I],de.processed===!1&&(w.push(de),de.processed=!0);const Xe=[],Ie=[];for(I=0;I<w.length;I++)de=w[I],Xe.push(de.bone),Ie.push(de.boneInverse);return new Bl(Xe,Ie)}function Oe(M,y,L){M.traverse(function(w){if(w.isBone===!0){let I;for(let ie=0;ie<y.length;ie++){const de=y[ie];if(de.name===w.name){I=de.boneInverse;break}}I===void 0&&(I=new lt),L.push({bone:w,boneInverse:I,processed:!1})}})}function Ye(M){const y=[],L=M.matrix,w=M.nodes,I=M.type,ie=M.instanceCameras,de=M.instanceControllers,Xe=M.instanceLights,Ie=M.instanceGeometries,ze=M.instanceNodes;for(let xe=0,Ke=w.length;xe<Ke;xe++)y.push(gt(w[xe]));for(let xe=0,Ke=ie.length;xe<Ke;xe++){const $e=De(ie[xe]);$e!==null&&y.push($e.clone())}for(let xe=0,Ke=de.length;xe<Ke;xe++){const $e=de[xe],ot=re($e.id),it=en(ot.id),Vt=dt(it,$e.materials),Pt=$e.skeletons,At=ot.skin.joints,wt=be(Pt,At);for(let ii=0,Mn=Vt.length;ii<Mn;ii++){const ir=Vt[ii];ir.isSkinnedMesh&&(ir.bind(wt,ot.skin.bindMatrix),ir.normalizeSkinWeights()),y.push(ir)}}for(let xe=0,Ke=Xe.length;xe<Ke;xe++){const $e=H(Xe[xe]);$e!==null&&y.push($e.clone())}for(let xe=0,Ke=Ie.length;xe<Ke;xe++){const $e=Ie[xe],ot=en($e.id),it=dt(ot,$e.materials);for(let Vt=0,Pt=it.length;Vt<Pt;Vt++)y.push(it[Vt])}for(let xe=0,Ke=ze.length;xe<Ke;xe++)y.push(gt(ze[xe]).clone());let Ze;if(w.length===0&&y.length===1)Ze=y[0];else{Ze=I==="JOINT"?new Ru:new Kn;for(let xe=0;xe<y.length;xe++)Ze.add(y[xe])}return Ze.name=I==="JOINT"?M.sid:M.name,Ze.matrix.copy(L),Ze.matrix.decompose(Ze.position,Ze.quaternion,Ze.scale),Ze}const We=new Ri({name:Gn.DEFAULT_MATERIAL_NAME,color:16711935});function ut(M,y){const L=[];for(let w=0,I=M.length;w<I;w++){const ie=y[M[w]];ie===void 0?(console.warn("THREE.ColladaLoader: Material with key %s not found. Apply fallback material.",M[w]),L.push(We)):L.push(ne(ie))}return L}function dt(M,y){const L=[];for(const w in M){const I=M[w],ie=ut(I.materialKeys,y);if(ie.length===0&&(w==="lines"||w==="linestrips"?ie.push(new Ci):ie.push(new bn)),w==="lines"||w==="linestrips")for(let ze=0,Ze=ie.length;ze<Ze;ze++){const xe=ie[ze];if(xe.isMeshPhongMaterial===!0||xe.isMeshLambertMaterial===!0){const Ke=new Ci;Ke.color.copy(xe.color),Ke.opacity=xe.opacity,Ke.transparent=xe.transparent,ie[ze]=Ke}}const de=I.data.attributes.skinIndex!==void 0,Xe=ie.length===1?ie[0]:ie;let Ie;switch(w){case"lines":Ie=new va(I.data,Xe);break;case"linestrips":Ie=new Vl(I.data,Xe);break;case"triangles":case"polylist":de?Ie=new wp(I.data,Xe):Ie=new Ct(I.data,Xe);break}L.push(Ie)}return L}function et(M){return ft.nodes[M]!==void 0}function gt(M){return _(ft.nodes[M],Ye)}function Rt(M){const y={name:M.getAttribute("name"),children:[]};D(M);const L=n(M,"node");for(let w=0;w<L.length;w++)y.children.push(Z(L[w]));ft.visualScenes[M.getAttribute("id")]=y}function Ot(M){const y=new Kn;y.name=M.name;const L=M.children;for(let w=0;w<L.length;w++){const I=L[w];y.add(gt(I.id))}return y}function kt(M){return ft.visualScenes[M]!==void 0}function St(M){return _(ft.visualScenes[M],Ot)}function at(M){const y=n(M,"instance_visual_scene")[0];return St(o(y.getAttribute("url")))}function Yt(){const M=ft.clips;if(c(M)===!0){if(c(ft.animations)===!1){const y=[];for(const L in ft.animations){const w=v(L);for(let I=0,ie=w.length;I<ie;I++)y.push(w[I])}$t.push(new Jc("default",-1,y))}}else for(const y in M)$t.push(q(y))}function Et(M){let y="";const L=[M];for(;L.length;){const w=L.shift();w.nodeType===Node.TEXT_NODE?y+=w.textContent:(y+=`
|
|
4205
|
-
`,
|
|
4206
|
-
`,y),null}const Li=zt.getAttribute("version");console.debug("THREE.ColladaLoader: File version",Li);const Ft=h(n(zt,"asset")[0]),mn=new ql(this.manager);mn.setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin);let un;jh&&(un=new jh(this.manager),un.setPath(this.resourcePath||t));const Xt=new st,$t=[];let nr={},ni=0;const ft={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",k),f(zt,"library_controllers","controller",ue),f(zt,"library_images","image",ae),f(zt,"library_effects","effect",_e),f(zt,"library_materials","material",G),f(zt,"library_cameras","camera",Ce),f(zt,"library_lights","light",Je),f(zt,"library_geometries","geometry",Fe),f(zt,"library_nodes","node",Z),f(zt,"library_visual_scenes","visual_scene",Rt),f(zt,"library_kinematics_models","kinematics_model",je),f(zt,"library_physics_models","physics_model",nn),f(zt,"scene","instance_kinematics_scene",En),m(ft.animations,E),m(ft.clips,Q),m(ft.controllers,Te),m(ft.images,oe),m(ft.effects,U),m(ft.materials,se),m(ft.cameras,me),m(ft.lights,ct),m(ft.geometries,ht),m(ft.visualScenes,Ot),Yt(),er();const ps=at(n(zt,"scene")[0]);return ps.animations=$t,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."),ps.rotation.set(-Math.PI/2,0,0)),ps.scale.multiplyScalar(Ft.unit),{get animations(){return console.warn("THREE.ColladaLoader: Please access animations over scene.animations now."),$t},kinematics:nr,library:ft,scene:ps}}}const Yh=new F,B3=new yn,Qs=new lt,Si=new lt,ea=new Rn,ta=new F(1,1,1),na=new F;class Da extends Ut{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 k3 extends Da{constructor(...e){super(...e),this.isURDFCollider=!0,this.type="URDFCollider"}}class V3 extends Da{constructor(...e){super(...e),this.isURDFVisual=!0,this.type="URDFVisual"}}class Ku extends Da{constructor(...e){super(...e),this.isURDFLink=!0,this.type="URDFLink"}}class Zu extends Da{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),Yh.copy(this.axis).applyEuler(this.rotation),this.position.addScaledVector(Yh,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],Si.compose(this.origPosition,this.origQuaternion,ta),ea.setFromEuler(B3.set(this.jointValue[3],this.jointValue[4],this.jointValue[5],"XYZ")),na.set(this.jointValue[0],this.jointValue[1],this.jointValue[2]),Qs.compose(na,ea,ta),Si.premultiply(Qs),this.position.setFromMatrixPosition(Si),this.rotation.setFromRotationMatrix(Si),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],Si.compose(this.origPosition,this.origQuaternion,ta),ea.setFromAxisAngle(this.axis,this.jointValue[2]),na.set(this.jointValue[0],this.jointValue[1],0),Qs.compose(na,ea,ta),Si.premultiply(Qs),this.position.setFromMatrixPosition(Si),this.rotation.setFromRotationMatrix(Si),this.matrixWorldNeedsUpdate=!0,!0)}return t}}class $h extends Zu{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 H3 extends Ku{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 Ao=new Rn,Jh=new yn;function Sr(r){return r?r.trim().split(/\s+/g).map(e=>parseFloat(e)):[0,0,0]}function Kh(r,e,t=!1){t||r.rotation.set(0,0,0),Jh.set(e[0],e[1],e[2],"ZYX"),Ao.setFromEuler(Jh),Ao.multiply(r.quaternion),r.quaternion.copy(Ao)}class G3{constructor(e){this.manager=e||Xl,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 s=this.manager,a=Yl.extractUrlBase(e),o=this.manager.resolveURL(e);s.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),s.itemEnd(o)}).catch(l=>{i?i(l):console.error("URDFLoader: Error loading file.",l),s.itemError(o),s.itemEnd(o)})}parse(e,t=this.workingPath){const n=this.packages,i=this.loadMeshCb,s=this.parseVisual,a=this.parseCollision,o=this.manager,l={},c={},h={};function u(S){if(!/^package:\/\//.test(S))return t?t+S:S;const[E,v]=S.replace(/^package:\/\//,"").split(/\/(.+)/);if(typeof n=="string")return n.endsWith(E)?n+"/"+v:n+"/"+E+"/"+v;if(n instanceof Function)return n(E)+"/"+v;if(typeof n=="object")return E in n?n[E]+"/"+v:(console.error(`URDFLoader : ${E} not found in provided package list.`),null)}function d(S){let E;S instanceof Document?E=[...S.children]:S instanceof Element?E=[S]:E=[...new DOMParser().parseFromString(S,"text/xml").children];const v=E.filter(N=>N.nodeName==="robot").pop();return f(v)}function f(S){const E=[...S.children],v=E.filter(R=>R.nodeName.toLowerCase()==="link"),N=E.filter(R=>R.nodeName.toLowerCase()==="joint"),C=E.filter(R=>R.nodeName.toLowerCase()==="material"),T=new H3;T.robotName=S.getAttribute("name"),T.urdfRobotNode=S,C.forEach(R=>{const B=R.getAttribute("name");h[B]=g(R)});const P={},b={};v.forEach(R=>{const B=R.getAttribute("name"),V=S.querySelector(`child[link="${B}"]`)===null;l[B]=_(R,P,b,V?T:null)}),N.forEach(R=>{const B=R.getAttribute("name");c[B]=m(R)}),T.joints=c,T.links=l,T.colliders=b,T.visual=P;const x=Object.values(c);return x.forEach(R=>{R instanceof $h&&c[R.mimicJoint].mimicJoints.push(R)}),x.forEach(R=>{const B=new Set,V=W=>{if(B.has(W))throw new Error("URDFLoader: Detected an infinite loop of mimic joints.");B.add(W),W.mimicJoints.forEach(ee=>{V(ee)})};V(R)}),T.frames={...b,...P,...l,...c},T}function m(S){const E=[...S.children],v=S.getAttribute("type");let N;const C=E.find(B=>B.nodeName.toLowerCase()==="mimic");C?(N=new $h,N.mimicJoint=C.getAttribute("joint"),N.multiplier=parseFloat(C.getAttribute("multiplier")||1),N.offset=parseFloat(C.getAttribute("offset")||0)):N=new Zu,N.urdfNode=S,N.name=S.getAttribute("name"),N.urdfName=N.name,N.jointType=v;let T=null,P=null,b=[0,0,0],x=[0,0,0];E.forEach(B=>{const V=B.nodeName.toLowerCase();V==="origin"?(b=Sr(B.getAttribute("xyz")),x=Sr(B.getAttribute("rpy"))):V==="child"?P=l[B.getAttribute("link")]:V==="parent"?T=l[B.getAttribute("link")]:V==="limit"&&(N.limit.lower=parseFloat(B.getAttribute("lower")||N.limit.lower),N.limit.upper=parseFloat(B.getAttribute("upper")||N.limit.upper))}),T.add(N),N.add(P),Kh(N,x),N.position.set(b[0],b[1],b[2]);const R=E.filter(B=>B.nodeName.toLowerCase()==="axis")[0];if(R){const B=R.getAttribute("xyz").split(/\s+/g).map(V=>parseFloat(V));N.axis=new F(B[0],B[1],B[2]),N.axis.normalize()}return N}function _(S,E,v,N=null){N===null&&(N=new Ku);const C=[...S.children];return N.name=S.getAttribute("name"),N.urdfName=N.name,N.urdfNode=S,s&&C.filter(P=>P.nodeName.toLowerCase()==="visual").forEach(P=>{const b=p(P,h);if(N.add(b),P.hasAttribute("name")){const x=P.getAttribute("name");b.name=x,b.urdfName=x,E[x]=b}}),a&&C.filter(P=>P.nodeName.toLowerCase()==="collision").forEach(P=>{const b=p(P);if(N.add(b),P.hasAttribute("name")){const x=P.getAttribute("name");b.name=x,b.urdfName=x,v[x]=b}}),N}function g(S){const E=[...S.children],v=new bn;return v.name=S.getAttribute("name")||"",E.forEach(N=>{const C=N.nodeName.toLowerCase();if(C==="color"){const T=N.getAttribute("rgba").split(/\s/g).map(P=>parseFloat(P));v.color.setRGB(T[0],T[1],T[2]),v.opacity=T[3],v.transparent=T[3]<1,v.depthWrite=!v.transparent}else if(C==="texture"){const T=N.getAttribute("filename");if(T){const P=new ql(o),b=u(T);v.map=P.load(b),v.map.colorSpace=Tt}}}),v}function p(S,E={}){const v=S.nodeName.toLowerCase()==="collision",N=[...S.children];let C=null;const T=N.filter(b=>b.nodeName.toLowerCase()==="material")[0];if(T){const b=T.getAttribute("name");b&&b in E?C=E[b]:C=g(T)}else C=new bn;const P=v?new k3:new V3;return P.urdfNode=S,N.forEach(b=>{const x=b.nodeName.toLowerCase();if(x==="geometry"){const R=b.children[0].nodeName.toLowerCase();if(R==="mesh"){const B=b.children[0].getAttribute("filename"),V=u(B);if(V!==null){const W=b.children[0].getAttribute("scale");if(W){const ee=Sr(W);P.scale.set(ee[0],ee[1],ee[2])}i(V,o,(ee,k)=>{k?console.error("URDFLoader: Error loading mesh.",k):ee&&(ee instanceof Ct&&(ee.material=C),ee.position.set(0,0,0),ee.quaternion.identity(),P.add(ee))})}}else if(R==="box"){const B=new Ct;B.geometry=new Ji(1,1,1),B.material=C;const V=Sr(b.children[0].getAttribute("size"));B.scale.set(V[0],V[1],V[2]),P.add(B)}else if(R==="sphere"){const B=new Ct;B.geometry=new wa(1,30,30),B.material=C;const V=parseFloat(b.children[0].getAttribute("radius"))||0;B.scale.set(V,V,V),P.add(B)}else if(R==="cylinder"){const B=new Ct;B.geometry=new Hl(1,1,1,30),B.material=C;const V=parseFloat(b.children[0].getAttribute("radius"))||0,W=parseFloat(b.children[0].getAttribute("length"))||0;B.scale.set(V,W,V),B.rotation.set(Math.PI/2,0,0),P.add(B)}}else if(x==="origin"){const R=Sr(b.getAttribute("xyz")),B=Sr(b.getAttribute("rpy"));P.position.set(R[0],R[1],R[2]),P.rotation.set(0,0,0),Kh(P,B)}}),P}return d(e)}defaultMeshLoader(e,t,n){/\.stl$/i.test(e)?new da(t).load(e,s=>{const a=new Ct(s,new bn);n(a)}):/\.dae$/i.test(e)?new z3(t).load(e,s=>n(s.scene)):console.warn(`URDFLoader: Could not load model at ${e}.
|
|
4207
|
-
No loader available`)}}const W3=tu.useModelComp(fe.pinia),{systemPath:Zh}=fe.storeToRefs(W3),ia=K.ref();function X3(r,e,t,n,i){const s=async d=>{try{const f=await jn.downloadAvatarApi({url:d});if(f.status!==200)throw new Error(`下载失败: ${f.status}`);return f.data}catch(f){throw console.error("addModelFromUrl失败:",f),f}},a=d=>new Promise((f,m)=>{const _=new FileReader;_.onload=g=>{try{const p=g.target.result,E=new Eo().parse(p);E.preload(),f(E)}catch(p){m(p)}},_.onerror=()=>{m(new Error("MTL文件读取失败"))},_.readAsText(d)}),o=async d=>{const f={materials:{},create:function(m){return this.materials[m]?this.materials[m]:(console.warn(`Material '${m}' not found, using default material`),new bn({color:8947848,side:pn}))},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 d){const _=await a(m);Object.assign(f.materials,_.materials)}return f.preload(),f},l=async(d,f=[])=>new Promise((m,_)=>{const g=new FileReader;g.onload=async p=>{try{const S=p.target.result;let E=null;f&&f.length>0&&(f.length===1?E=await a(f[0]):E=await o(f));const v=new So;E&&v.setMaterials(E);const N=v.parse(S);E||N.traverse(C=>{C.isMesh&&(C.material=new bn({color:8947848,side:pn}))}),m(N)}catch(S){_(S)}},g.onerror=()=>{_(new Error("OBJ文件读取失败"))},g.readAsText(d)}),c=async d=>{var f;try{t.value=!0;const{scene:m}=r();if(!m)throw new Error("Scene not initialized");i();const _=[];for(let g=0;g<d.length;g++){const p=d[g];n.value=`正在加载模型 ${g+1}/${d.length}...`;const S=await s(p.objUrl),E=((f=p.objUrl)==null?void 0:f.split("/").pop())||`model_${g}.obj`,v=new File([S],E,{type:S.type});let N=[];if(p.mtlUrls){const T=Array.isArray(p.mtlUrls)?p.mtlUrls:[p.mtlUrls];for(let P=0;P<T.length;P++){const b=T[P],x=await s(b),R=(b==null?void 0:b.split("/").pop())||`material_${g}_${P}.mtl`,B=new File([x],R,{type:x.type});N.push(B)}}const C=await l(v,N);m.add(C),e.value.push(C),_.push(C)}return t.value=!1,_}catch(m){throw console.error("加载模型失败:",m),t.value=!1,m}},h=async(d,f,m=[],_=[])=>{let g;const p=d.toLowerCase();switch(p){case".txt":case".cpt":case".obj":const S=await f.text();if(p===".txt"||p===".cpt"){const _e=/^(?!.*\bf\b)[^\n]*?(-?\d*\.?\d+)[^\n]*?(-?\d*\.?\d+)[^\n]*?(-?\d*\.?\d+)[^\n]*?$/gm,ke=[...S.matchAll(_e)].map(O=>({x:parseFloat(O[1]),y:parseFloat(O[2]),z:parseFloat(O[3])})),tt=new Bt,Qe=ke.flatMap(O=>[O.x,O.y,O.z]);if(tt.setAttribute("position",new mt(Qe,3)),p===".txt"){const O=new Wi({color:"#5B5C99",size:1,sizeAttenuation:!1});g=new Qr(tt,O)}else if(p===".cpt"){const O=new Ci({color:"#5B5C99",linewidth:100});g=new Vl(tt,O)}}else if(p===".obj"){const _e=new So;if(m&&m.length>0){const we=new Eo;for(const ke of m){const tt=await ke.text(),Qe=we.parse(tt);Qe.preload(),_e.setMaterials(Qe);break}}g=_e.parse(S),(!m||m.length===0)&&g.traverse(we=>{we.isMesh&&(we.material=new bn({color:"#B3B3D4"})),we instanceof Ct&&(we.material.side=pn)})}break;case".stl":const E=await f.arrayBuffer(),N=new da().parse(E),C=new bn({color:"#B3B3D4",side:pn});g=new Ct(N,C);break;case".nc":const T=["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"],P={"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 Kn,x=T.map(_e=>new Promise((we,ke)=>{new da().load(Zh.value===""?`/model/${_e}`:`${Zh.value}\\${_e}`,Qe=>{const O=new bn({color:P[_e]||"#B3B3D4",side:pn}),bt=new Ct(Qe,O);we(bt)},void 0,ke)}));try{(await Promise.all(x)).forEach(we=>b.add(we)),g=b}catch(_e){throw console.error("加载NC文件对应的STL文件失败:",_e),new Error("无法加载.NC文件对应的STL文件")}break;case".pcd":const R=new O3,B=new Kn;try{const _e=await fe.axios.get("http://139.196.154.85:20026/chfs/shared/重大专项/重大专项文件/target.pcd",{responseType:"blob",headers:{"Content-Type":"application/json"}}),we=new Blob([_e.data],{type:"application/octet-stream;charset=UTF-8"}),ke=await fe.axios.get("http://139.196.154.85:20026/chfs/shared/重大专项/重大专项文件/final.pcd",{responseType:"blob",headers:{"Content-Type":"application/json"}}),tt=new Blob([ke.data],{type:"application/octet-stream;charset=UTF-8"}),Qe=await new Promise((bt,$)=>{const pe=URL.createObjectURL(we);R.load(pe,te=>{const Se=new Float32Array(te.geometry.attributes.position.count*3);for(let he=0;he<te.geometry.attributes.position.count;he++)Se[he*3]=1,Se[he*3+1]=0,Se[he*3+2]=0;te.geometry.setAttribute("color",new Gt(Se,3)),te.material.vertexColors=!0,te.scale.set(.3,.3,.3),URL.revokeObjectURL(pe),bt(te)},void 0,$)}),O=await new Promise((bt,$)=>{const pe=URL.createObjectURL(tt);R.load(pe,te=>{const Se=new Float32Array(te.geometry.attributes.position.count*3);for(let he=0;he<te.geometry.attributes.position.count;he++)Se[he*3]=0,Se[he*3+1]=1,Se[he*3+2]=0;te.geometry.setAttribute("color",new Gt(Se,3)),te.material.vertexColors=!0,te.scale.set(.3,.3,.3),URL.revokeObjectURL(pe),bt(te)},void 0,$)});B.add(Qe),B.add(O),g=B}catch(_e){throw console.error("PCD文件加载失败:",_e),new Error("无法加载PCD文件")}break;case".urdf":const V=URL.createObjectURL(f),W=new G3,ee="http://139.196.154.85:20026/chfs/shared/机器人/urdf/SmallBender_R-2000iC-165F/meshes",k={maxConcurrentLoads:4,enableCache:!0,enableLOD:!0,simplifyGeometry:!0,shareMaterials:!0,enableInstancing:!0},Q=new Map,q=new Map,ue=new Map,ye=async _e=>{if(Q.has(_e))return console.log(`从缓存加载: ${_e}`),Q.get(_e);try{const we=await fe.axios.get(`${ee}/${_e}`,{responseType:"blob",headers:{"Content-Type":"application/json"},timeout:6e5}),ke=new Blob([we.data],{type:"application/octet-stream;charset=UTF-8"});return k.enableCache&&Q.set(_e,ke),ke}catch(we){throw console.error(`加载文件失败: ${_e}`,we),new Error(`无法加载文件: ${_e}`)}},le=(_e="default")=>{if(q.has(_e))return q.get(_e);const we=new bn({color:12303291,shininess:30,transparent:!1,alphaTest:.1,side:Hn});return q.set(_e,we),we},Le=_e=>{try{_e.isBufferGeometry&&_e.mergeVertices&&_e.mergeVertices(),_e.computeVertexNormals&&_e.computeVertexNormals(),_e.computeBoundingSphere&&_e.computeBoundingSphere(),_e.deleteAttribute&&_e.deleteAttribute("uv2")}catch(we){console.warn("几何体优化失败,使用原始几何体:",we)}return _e},Te=async(_e,we,ke)=>{const tt=`stl_${we}`;if(ue.has(tt)){const $=ue.get(tt);return new Ct($,le())}const Qe=await _e.arrayBuffer();let bt=new da(ke).parse(Qe);return bt=Le(bt),ue.set(tt,bt),new Ct(bt,le())},Y=async(_e,we,ke)=>{const tt=`obj_${we}`;if(Q.has(tt))return Q.get(tt).clone();const Qe=await _e.text(),O=new So(ke),bt=we.replace(".obj",".mtl");try{const te=await(await ye(bt)).text(),he=new Eo(ke).parse(te);he.preload(),O.setMaterials(he)}catch{console.warn(`MTL文件加载失败,使用默认材质: ${bt}`)}const $=O.parse(Qe);return $.traverse(pe=>{pe.isMesh&&(pe.geometry=Le(pe.geometry),pe.castShadow=!0,pe.receiveShadow=!0,pe.renderOrder=1)}),Q.set(tt,$),$},re=(_e,we)=>{const ke=new Ep;if(ke.addLevel(_e,0),_e.geometry){const tt=_e.geometry.clone(),Qe=new Ct(tt,_e.material);ke.addLevel(Qe,50)}return ke};let ae=0,oe=0;const Ee=[];W.loadMeshCb=async(_e,we,ke,tt,Qe)=>{const O=_e.split("/").pop(),bt=ke||(()=>{});ae++;const $=new Promise(async(pe,te)=>{try{const Se=await ye(O);if(!Se||Se.size===0)throw new Error(`文件为空: ${O}`);const he=O.split(".").pop().toLowerCase();let ce;switch(he){case"stl":ce=await Te(Se,O,we);break;case"obj":ce=await Y(Se,O,we);break;default:throw new Error(`不支持的文件格式: ${he}`)}k.enableLOD&&ce.isMesh&&(ce=re(ce,O)),bt(ce),oe++,tt&&tt({loaded:oe,total:ae,progress:oe/ae}),pe(ce)}catch(Se){console.error(`mesh文件加载失败: ${O}`,Se);const he=new Kn;bt(he),pe(he);const ce=new Ji(.1,.1,.1),Ue=new Yp({color:16711680,wireframe:!0});return new Ct(ce,Ue)}});Ee.push($)};try{if(!V){ia.value=void 0;break}if(g=await W.loadAsync(V),console.log(`URDF文件加载完成,等待${ae}个mesh文件加载...`),Ee.length>0)try{await Promise.allSettled(Ee),console.log(`所有mesh文件处理完成,成功加载: ${oe}/${ae}`)}catch(_e){console.warn("部分mesh文件加载失败,但继续显示模型",_e)}g.traverse(_e=>{_e.isMesh&&(_e.castShadow=!0,_e.receiveShadow=!0,_e.renderOrder=1,_e.material&&(_e.material.needsUpdate=!0))}),ia.value=g,console.log("URDF模型加载完成并优化")}catch(_e){console.error("URDF加载失败:",_e),ia.value=void 0}finally{V&&URL.revokeObjectURL(V)}break;default:throw new Error(`不支持的文件格式: ${d}`)}return g};return{addModelsFromUrls:c,loadModelByDefaultPath:async d=>{console.log(d);try{t.value=!0,n.value="正在加载模型...";const{scene:f}=r();if(!f)throw new Error("Scene not initialized");i(),await new Promise(_=>setTimeout(_,100));const m=[];for(let _=0;_<d.length;_++){const g=d[_],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:ia}}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>',(r=>{var e=(t=(t=document.getElementsByTagName("script"))[t.length-1]).getAttribute("data-injectcss"),t=t.getAttribute("data-disable-injectsvg");if(!t){var n,i,s,a,o,l=function(u,d){d.parentNode.insertBefore(u,d)};if(e&&!r.__iconfont__svg__cssinject__){r.__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(u){console&&console.log(u)}}n=function(){var u,d=document.createElement("div");d.innerHTML=r._iconfont_svg_string_4634042,(d=d.getElementsByTagName("svg")[0])&&(d.setAttribute("aria-hidden","true"),d.style.position="absolute",d.style.width=0,d.style.height=0,d.style.overflow="hidden",d=d,(u=document.body).firstChild?l(d,u.firstChild):u.appendChild(d))},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&&(s=n,a=r.document,o=!1,h(),a.onreadystatechange=function(){a.readyState=="complete"&&(a.onreadystatechange=null,c())})}function c(){o||(o=!0,s())}function h(){try{a.documentElement.doScroll("left")}catch{return void setTimeout(h,50)}c()}})(window);const Qu=fe.defineStore("formToTableComp",{state:()=>({selectArray:[],selectString:""}),actions:{setSelectArray(r){this.selectArray=r},setSelectString(r){this.selectString=r}}}),q3={class:"calculator-content"},j3={class:"calculator-child"},Y3={class:"calculator-child"},$3=K.defineComponent({__name:"calculator",setup(r){const e=K.ref(),t=K.ref();return K.onMounted(()=>{e.value=[{type:"Upload",label:"输入",name:"input"}],t.value=[{type:"Upload",label:"输出",name:"output"}]}),(n,i)=>(K.openBlock(),K.createElementBlock("div",q3,[K.createElementVNode("div",j3,[K.createVNode(jn.ssForm,{rowContents:e.value,isRowFlex:!0},null,8,["rowContents"])]),K.createElementVNode("div",Y3,[K.createVNode(jn.ssForm,{rowContents:t.value,isEdit:!1,isRowFlex:!0},null,8,["rowContents"])])]))}}),J3=El._export_sfc($3,[["__scopeId","data-v-73db0fe7"]]),ed=fe.defineStore("unit",{state:()=>({selectIndex:"",selectMenu:"",selectTitle:[]}),actions:{setSelectIndex(r){this.selectIndex=r},setSelectMenu(r){this.selectMenu=r},setSelectTitle(r){this.selectTitle=r}}}),td=(r,e)=>{let t=r,n=e;return Array.isArray(t)&&(t=t==null?void 0:t.map((i,s)=>{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=td(o,n))}),Object.assign(a,{id:s})}else return i})),t},nd=(r,e,t)=>{let n=r,i=e;return n=n==null?void 0:n.map((s,a)=>{var o,l;return!Array.isArray(s)||!((o=i==null?void 0:i[a])!=null&&o.label)&&!t||(s.unshift(((l=i==null?void 0:i[a])==null?void 0:l.label)??""),s.some(c=>Array.isArray(c))&&(s=s==null?void 0:s.map(c=>{var h;return Array.isArray(c)&&(c=nd(c,(h=i==null?void 0:i[a])==null?void 0:h.children,t)),c}))),s}),n},K3=(r,e,t)=>{if(e==="")return r==null?void 0:r.filter(n=>(n==null?void 0:n.id)!==t);{const n=e.split("-");return Z3(r,n,t)}},Z3=(r,e,t)=>{let n=r,i=e;return(i==null?void 0:i.length)===0?n=n==null?void 0:n.filter(s=>s.id!==t):n=n==null?void 0:n.map(s=>(s.id.toString()===(i==null?void 0:i[0])&&(i==null||i.shift(),s=id(s,i,t)),s)),n},id=(r,e,t)=>{var s,a;let n=r,i=e;return(i==null?void 0:i.length)===0?n.children=(s=n.children)==null?void 0:s.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=id(o,i,t)),o)),n},Q3=(r,e,t)=>{if(e==="")return t;{const n=e.split("-");return e_(r,n,t)}},e_=(r,e,t)=>{let n=r,i=e;return(i==null?void 0:i.length)===0?n=t:n=n==null?void 0:n.map(s=>(s.id.toString()===(i==null?void 0:i[0])&&(i==null||i.shift(),s=rd(s,i,t)),s)),n},rd=(r,e,t)=>{var s;let n=r,i=e;return(i==null?void 0:i.length)===0?n.children=t:n.children=(s=n.children)==null?void 0:s.map(a=>(a.id.toString()===(i==null?void 0:i[0])&&(i==null||i.shift(),a=rd(a,i,t)),a)),n},Ma=(r,e)=>r==null?void 0:r.map(n=>{var i,s,a,o,l,c;if(Array.isArray(n)?n=n:n=[n],(i=n==null?void 0:n.filter(h=>!(h!=null&&h.id)||typeof(h==null?void 0:h.id)=="string"))!=null&&i.every(h=>typeof h!="object"||h===null))return n;if((s=n==null?void 0:n.filter(h=>!(h!=null&&h.id)||typeof(h==null?void 0:h.id)=="string"))!=null&&s.some(h=>Array.isArray(h)))return n;{let h=[];if(h.push(n==null?void 0:n.find(u=>(u==null?void 0:u.id)&&typeof(u==null?void 0:u.id)=="number")),Array.isArray(e==null?void 0:e[0])){const u=(a=n==null?void 0:n.filter(d=>!(d!=null&&d.id)||typeof(d==null?void 0:d.id)=="string"))==null?void 0:a[0];(o=In.getColumnChild(fe.cloneDeep(e==null?void 0:e[0])))==null||o.forEach(d=>{h.push(u==null?void 0:u[(d==null?void 0:d.prop)??(d==null?void 0:d.label)??d])})}else{const u=(l=n==null?void 0:n.filter(d=>!(d!=null&&d.id)||typeof(d==null?void 0:d.id)=="string"))==null?void 0:l[0];(c=In.getColumnChild(fe.cloneDeep(e)))==null||c.forEach(d=>{h.push(u==null?void 0:u[(d==null?void 0:d.prop)??(d==null?void 0:d.label)??d])})}return h}}),t_=r=>{try{return JSON.parse(r),!0}catch{return!1}},Qh=(r,e)=>su(r,e),Yi=r=>{let e=[];function t(i){Array.isArray(i)&&(i==null||i.forEach(s=>{Array.isArray(s)||(s=[s]),s==null||s.forEach(a=>{!(a!=null&&a.children)||a.children.length===0?e.push(a.label):n(a.children)})}))}function n(i){i==null||i.forEach(s=>{!(s!=null&&s.children)||s.children.length===0?e.push(s.label):n(s.children)})}return t(r),e},n_=(r,e,t)=>{var i;let n=(i=fe.cloneDeep(r))==null?void 0:i.map(s=>(s=s.filter(a=>!(a!=null&&a.id)),s));return n=n==null?void 0:n.map(s=>{var a;return s=(a=s.map((o,l)=>{let c={};if(t!=null&&t.find(h=>h===e[l]))return c[e[l]]=o,c}))==null?void 0:a.filter(o=>o),s}),n},i_=(r,e)=>{var a,o;const t=fe.cloneDeep(r),n=(a=t==null?void 0:t.find(l=>(l==null?void 0:l.key)==="header"))==null?void 0:a.contents,i=(o=t==null?void 0:t.find(l=>(l==null?void 0:l.key)==="tableContents"))==null?void 0:o.contents;return n_(i,Yi(n).slice(0,Yi(n).length-1),e)},r_=r=>{let e={};return r==null||r.forEach(t=>{e[t.key]=t.value}),e},s_=r=>{var t;let e=[];return(t=fe.cloneDeep(r))==null||t.forEach(n=>{let i={};n==null||n.forEach(s=>{i[Object.keys(s)[0]]=Object.values(s)[0]}),e.push(i)}),e},a_=(r,e)=>{if(e!=null&&e[r])return e==null?void 0:e[r]},o_=async(r,e)=>{var o,l,c;if(!(r!=null&&r.extra))return;let t=(o=r==null?void 0:r.extra)==null?void 0:o.tableId,n=r==null?void 0:r.contents;const s=(c=(await fe.getInsofDataApi({key:{type:"data",pageKey:(l=r==null?void 0:r.extra)==null?void 0:l.pageKey,tableId:t,systemKey:sessionStorage.getItem("systemKey")}})).data.result)==null?void 0:c.map(h=>h==null?void 0:h.id);s&&(s==null?void 0:s.length)>0&&await fe.batchDeleteInsofDataApi({ids:s});let a=[];n==null||n.forEach(h=>{var d,f;let u={};(d=Object.keys(h))==null||d.forEach(m=>{e!=null&&e.find(_=>(_==null?void 0:_.label.toUpperCase())===m.toUpperCase())&&(u[e.find(_=>_.label.toUpperCase()===m.toUpperCase()).label]=h[m])}),a.push({key:{type:"data",pageKey:(f=r==null?void 0:r.extra)==null?void 0:f.pageKey,tableId:t,systemKey:sessionStorage.getItem("systemKey")},value:{tableData:u}})}),(a==null?void 0:a.length)>0&&await fe.batchAddInsofDataApi({dataList:a})},l_=(r,e)=>{var s;let t=fe.cloneDeep(r),n=!1,i=Object.keys(e);return(s=t.compData)==null||s.forEach(a=>{var o;Array.isArray(a==null?void 0:a.contents)&&((o=a==null?void 0:a.contents)==null||o.forEach(l=>{n=i.includes(l.key)}))}),n},c_=(r,e)=>{var i;let t=fe.cloneDeep(r);return l_(fe.cloneDeep(t),e)&&(t.compData=(i=t.compData)==null?void 0:i.map(s=>{var a;return(s==null?void 0:s.key)==="formContent"&&(s.contents=(a=s==null?void 0:s.contents)==null?void 0:a.map(o=>(Object.keys(e).includes(o.key)&&(o.value=e[o.key]),o))),s})),t},h_=r=>{let e=fe.cloneDeep(r);return e==null||e.forEach(t=>{let n={};for(let i in t)n[i.toUpperCase()]=t[i]}),e},u_=async r=>{var a,o,l,c,h;let e=(o=(a=r==null?void 0:r[0])==null?void 0:a.find(u=>u==null?void 0:u.id))==null?void 0:o.id;const t=await fe.getInsofDataApi({id:e});let n=await((h=(c=(l=t==null?void 0:t.data)==null?void 0:l.result)==null?void 0:c[0])==null?void 0:h.key),i=n==null?void 0:n.pageKey,s=n==null?void 0:n.tableId;return{pageKey:i,tableId:s}},d_=async r=>{let e={comp:r==null?void 0:r.comp,compData:r==null?void 0:r.compData,name:r==null?void 0:r.name};await fe.updateInsofDataApi({id:r==null?void 0:r.id,value:{pageData:e}})},f_=async r=>{let e=r==null?void 0:r.map(async t=>{var i,s,a;let n;return(t==null?void 0:t.comp)==="Form"?n=await d_(t):(t==null?void 0:t.comp)==="Table"&&(n=await o_((i=t==null?void 0:t.compData)==null?void 0:i.find(o=>(o==null?void 0:o.key)==="tableContents"),(a=(s=t==null?void 0:t.compData)==null?void 0:s.find(o=>(o==null?void 0:o.key)==="header"))==null?void 0:a.contents)),n});await Promise.all(e)},p_=r=>{var i,s,a,o;const e=r;let t=[];e.compData=(i=e.compData)==null?void 0:i.filter(l=>(l==null?void 0:l.key)!=="tableContents"&&(l==null?void 0:l.key)!=="tableIndex");const n=(a=(s=fe.cloneDeep(e.compData))==null?void 0:s.find(l=>(l==null?void 0:l.key)==="tableIndexColumn"))==null?void 0:a.contents;return(o=fe.cloneDeep(e.compData))==null||o.forEach(l=>{if((l==null?void 0:l.key)!=="tableIndexColumn"&&(l==null?void 0:l.key)!=="header")t.push(l);else if((l==null?void 0:l.key)==="header"){let c=l.contents;n&&(c!=null&&c.every(h=>Array.isArray(h))?c==null||c[0].unshift({label:n}):c.unshift({label:n})),t.push({key:"header",contents:c})}}),e.compData=t,e},m_=r=>{var s,a,o,l,c;const e=(s=r.compData)==null?void 0:s.filter(h=>(h==null?void 0:h.key)==="tableContents"||(h==null?void 0:h.key)==="tableIndex"),t=(o=(a=e==null?void 0:e.find(h=>(h==null?void 0:h.key)==="tableIndex"))==null?void 0:a.contents)==null?void 0:o.map(h=>h.label),n=(l=e==null?void 0:e.find(h=>(h==null?void 0:h.key)==="tableContents"))==null?void 0:l.contents;let i=[];return(t==null?void 0:t.length)>0&&(n!=null&&n.every(h=>Array.isArray(h)))?i=t==null?void 0:t.map((h,u)=>n[u]?[h,...n[u]]:[h]):Array.isArray(n==null?void 0:n[0])&&((c=n==null?void 0:n[0])!=null&&c.every(h=>Array.isArray(h)))?i=n==null?void 0:n[0]:Array.isArray(n==null?void 0:n[0])?i=n:i.push(n),i},g_=r=>{const e=[];function t(n){!n||n.length===0||(e.push(n==null?void 0:n.map(i=>({label:i.label}))),n==null||n.forEach(i=>{i!=null&&i.children&&(i==null?void 0:i.children.length)>0&&t(i==null?void 0:i.children)}))}return t(r),e},__=r=>{const e=[];function t(n,i=[]){!n||n.length===0||(e.push({key:i==null?void 0:i.filter(s=>!Array.isArray(s)),value:n}),n==null||n.forEach(s=>{s!=null&&s.some(a=>Array.isArray(a))&&t(s.find(a=>Array.isArray(a)),s)}))}return t(r),e},v_=r=>{const e=[];function t(n){!n||n.length===0||(e.push(n==null?void 0:n.map(i=>i==null?void 0:i.filter(s=>!Array.isArray(s)))),n==null||n.forEach(i=>{i!=null&&i.some(s=>Array.isArray(s))&&t(i.find(s=>Array.isArray(s)))}))}return t(r),e},y_=r=>{const e=[];function t(n){var i;!n||n.length===0||(n!=null&&n.every(s=>!Array.isArray(s))?e.push(n):(e.push((i=n==null?void 0:n.map(s=>s==null?void 0:s.filter(a=>!Array.isArray(a))))==null?void 0:i[0]),n==null||n.forEach(s=>{s!=null&&s.some(a=>Array.isArray(a))&&t(s.find(a=>Array.isArray(a)))})))}return t(r),e},x_=(r,e)=>{let t;function n(i,s,a=1){var l;if(!i||i.length===0)return;const o=(l=fe.cloneDeep(s))==null?void 0:l.map(c=>c==null?void 0:c.filter(h=>!Array.isArray(h)));return o!=null&&o.find(c=>Qh(c,i==null?void 0:i.key))?(s==null||s.forEach(c=>{!n(i,c.find(u=>Array.isArray(u)))&&Qh(c.filter(u=>!Array.isArray(u)),i==null?void 0:i.key)&&(t={type:a,contents:c.filter(u=>!Array.isArray(u))})}),!0):!1}return n(r,e,0),t},eu=(r,e)=>{function t(n,i){return!n||n.length===0||n==null?void 0:n.map((a,o)=>{var c,h;let l=a;return l.unshift((c=i==null?void 0:i[o])==null?void 0:c.label),l.some(u=>Array.isArray(u))&&(l[l.length-1]=t(l.find(u=>Array.isArray(u)),(h=i==null?void 0:i[o])==null?void 0:h.children)),l})}return t(r,e)},M_=r=>{var t,n,i,s,a,o,l,c,h,u,d,f,m,_,g,p,S,E,v,N,C,T,P,b,x;const e=r;if((r==null?void 0:r.comp)==="Table"){if((i=(n=(t=r.compData)==null?void 0:t.find(R=>(R==null?void 0:R.key)==="tableIndex"))==null?void 0:n.contents)!=null&&i.every(R=>!(R!=null&&R.children))||!((s=r.compData)!=null&&s.find(R=>(R==null?void 0:R.key)==="tableIndex")))return((l=(o=(a=e.compData)==null?void 0:a.find(R=>(R==null?void 0:R.key)==="tableContents"))==null?void 0:o.contents)==null?void 0:l.length)===1&&((d=(u=(h=(c=e.compData)==null?void 0:c.find(R=>(R==null?void 0:R.key)==="tableContents"))==null?void 0:h.contents)==null?void 0:u[0])!=null&&d.every(R=>Array.isArray(R)))?(e.compData=(f=e.compData)==null?void 0:f.map(R=>{var B;return(R==null?void 0:R.key)==="tableContents"&&(R.contents=(B=R.contents)==null?void 0:B[0]),R}),[e]):[e];{let R=[];const B=e.compData,V=(m=fe.cloneDeep(B))==null?void 0:m.find(le=>(le==null?void 0:le.key)==="tableIndexColumn"),W=(_=fe.cloneDeep(B))==null?void 0:_.find(le=>(le==null?void 0:le.key)==="extraButton"),ee=(g=fe.cloneDeep(B))==null?void 0:g.find(le=>(le==null?void 0:le.key)==="rowButton"),k=y_((S=(p=fe.cloneDeep(B))==null?void 0:p.find(le=>(le==null?void 0:le.key)==="header"))==null?void 0:S.contents),Q=(E=fe.cloneDeep(B))==null?void 0:E.find(le=>(le==null?void 0:le.key)==="tableIndex"),q=v_((N=(v=fe.cloneDeep(B))==null?void 0:v.find(le=>(le==null?void 0:le.key)==="tableContents"))==null?void 0:N.contents),ue=eu((T=(C=fe.cloneDeep(B))==null?void 0:C.find(le=>(le==null?void 0:le.key)==="tableContents"))==null?void 0:T.contents,Q==null?void 0:Q.contents),ye=__(eu((b=(P=fe.cloneDeep(B))==null?void 0:P.find(le=>(le==null?void 0:le.key)==="tableContents"))==null?void 0:b.contents,Q==null?void 0:Q.contents));if(Q)return(x=g_(Q.contents))==null||x.forEach((le,Le)=>{var Y;let Te=[];Te.push({key:"tableIndex",contents:le}),Te.push(V),Te.push(W),Te.push(ee),Te.push({key:"tableContents",contents:q[Le]}),Te.push({key:"header",contents:k!=null&&k[Le]?[k==null?void 0:k[Le]]:[k==null?void 0:k[0]]}),R.push({comp:"Table",compData:Te,name:"",parentTableContents:((Y=x_(ye[Le],ue))==null?void 0:Y.contents)??""})}),R}}else return[e]},cs=(r,e)=>{let t={};return Array.isArray(r)?r==null||r.forEach((n,i)=>{e!=null&&e[i]&&(t[e[i]]=n)}):[r].forEach((n,i)=>{t[e[i]]=n}),t},b_=r=>{var t,n;let e="";return(n=(t=fe.cloneDeep(r))==null?void 0:t.split("/"))==null||n.forEach((i,s)=>{var a,o;s<((o=(a=fe.cloneDeep(r))==null?void 0:a.split("/"))==null?void 0:o.length)-1&&(e=e===""?e+i:e+"/"+i)}),e},S_=async r=>{const e=fe.cloneDeep(r);let t=[],n=[];e==null||e.forEach(i=>{!(n!=null&&n.find(s=>(s==null?void 0:s.parentKey)===(i==null?void 0:i.parentKey)))&&(i==null?void 0:i.parentKey)!==""&&n.push(i)}),n=n==null?void 0:n.map(i=>{var s;return i.content=(s=i.content)==null?void 0:s.map(a=>{var o;return a.key={pageKey:(i==null?void 0:i.parentKey)??"",systemKey:((o=a.key)==null?void 0:o.systemKey)??"",version:1,type:"subStructure"},a}),i.content}),(n==null?void 0:n.length)>0&&(t=n==null?void 0:n.map(async i=>{let s;return(i==null?void 0:i.length)>0&&(s=await fe.batchAddInsofDataApi({dataList:i})),s})),await Promise.all(t)},bl=fe.useMenuState(fe.pinia),{activeMenuPath:E_}=fe.storeToRefs(bl),A_=async(r,e)=>{var c,h,u,d,f,m,_,g,p,S,E,v,N,C,T,P;const t=(h=(c=r==null?void 0:r.find(b=>(b==null?void 0:b.key)==="header"))==null?void 0:c.contents)==null?void 0:h.find(b=>b==null?void 0:b.columnPath);let n=(d=(u=fe.cloneDeep(t==null?void 0:t.columnPath))==null?void 0:u.split("["))==null?void 0:d[0],i=(p=(g=(_=(m=(f=fe.cloneDeep(t==null?void 0:t.columnPath))==null?void 0:f.split("["))==null?void 0:m[1])==null?void 0:_.split("]"))==null?void 0:g[0])==null?void 0:p.replaceAll("'",""),s=[];const a=await fe.getInsofDataApi({key:{pageKey:n,systemKey:sessionStorage.getItem("systemKey"),type:"structure"}}),o=await fe.getInsofDataApi({key:{pageKey:E_.value,systemKey:sessionStorage.getItem("systemKey"),tableId:parseInt(e),type:"data"}}),l=[];if((E=(S=o==null?void 0:o.data)==null?void 0:S.result)==null||E.forEach(b=>{l.push([{id:b==null?void 0:b.id},b.value.tableData])}),Array.isArray((v=a==null?void 0:a.data)==null?void 0:v.result)&&((C=(N=a==null?void 0:a.data)==null?void 0:N.result)==null?void 0:C.length)>0){const b=await((P=(T=a==null?void 0:a.data)==null?void 0:T.result)==null?void 0:P.map(async x=>{var R,B,V,W,ee,k,Q,q,ue,ye,le,Le,Te,Y,re;if(((B=(R=x==null?void 0:x.value)==null?void 0:R.pageData)==null?void 0:B.name)===i){s=fe.cloneDeep((W=(V=x==null?void 0:x.value)==null?void 0:V.pageData)==null?void 0:W.compData);const ae=await fe.getInsofDataApi({key:{pageKey:n,systemKey:sessionStorage.getItem("systemKey"),tableId:x==null?void 0:x.id,type:"data"}}),oe=(k=(ee=ae==null?void 0:ae.data)==null?void 0:ee.result)==null?void 0:k.map(ke=>{var Qe;let tt=[];return tt.push({id:ke==null?void 0:ke.id}),tt.push((Qe=ke==null?void 0:ke.value)==null?void 0:Qe.tableData),tt});let Ee=Ma(l,(ye=(ue=(q=(Q=x==null?void 0:x.value)==null?void 0:Q.pageData)==null?void 0:q.compData)==null?void 0:ue.find(ke=>(ke==null?void 0:ke.key)==="header"))==null?void 0:ye.contents),_e=!1;_e=((le=fe.cloneDeep(Ee))==null?void 0:le.map(ke=>ke.slice(1))).every(ke=>ke.every(tt=>tt===void 0)),_e?s.push({key:"tableContents",contents:Ma(oe,(re=(Y=(Te=(Le=x==null?void 0:x.value)==null?void 0:Le.pageData)==null?void 0:Te.compData)==null?void 0:Y.find(ke=>(ke==null?void 0:ke.key)==="header"))==null?void 0:re.contents)}):s.push({key:"tableContents",contents:Ee})}}));await Promise.all(b)}return s},Sl=async(r,e,t="",n=!1,i)=>{var f,m,_,g,p,S,E;let s;s=await fe.getInsofDataApi({key:{pageKey:r,systemKey:e,parentTable:t}});const a=await fe.getInsofDataApi({key:{pageKey:r,systemKey:e,type:"structureMethod"}}),o=(m=(f=s==null?void 0:s.data)==null?void 0:f.result)==null?void 0:m.map(v=>v.id);if(!o)return;const l=o==null?void 0:o.map(v=>fe.getInsofDataApi({key:{pageKey:r,systemKey:e,type:"data",tableId:v}})),c=await Promise.all(l),h=[];c==null||c.forEach(v=>{var T,P,b,x;const N=(T=v.data.result)==null?void 0:T.map(R=>{const B=Array.isArray(R.value.tableData)?R.value.tableData:[R.value.tableData];return B.unshift({id:R.id}),B}),C=(x=(b=(P=v.data.result)==null?void 0:P[0])==null?void 0:b.key)==null?void 0:x.tableId;h.push({key:C,contents:N})});let u=[];const d=await((_=s.data.result)==null?void 0:_.map(async v=>{var P,b,x,R,B,V;const N=v.value.pageData,C=v==null?void 0:v.id;let T=(P=fe.cloneDeep(N.compData))==null?void 0:P.filter(W=>(W==null?void 0:W.key)!=="tableContents");if(T&&(T!=null&&T.find(W=>(W==null?void 0:W.key)==="header"))&&((x=(b=T==null?void 0:T.find(W=>(W==null?void 0:W.key)==="header"))==null?void 0:b.contents)!=null&&x.every(W=>!(W!=null&&W.columnPath)))?T.push({key:"tableContents",contents:Ma((R=h==null?void 0:h.find(W=>(W==null?void 0:W.key)===v.id))==null?void 0:R.contents,(B=T==null?void 0:T.find(W=>(W==null?void 0:W.key)==="header"))==null?void 0:B.contents)}):T&&(T!=null&&T.find(W=>(W==null?void 0:W.key)==="header"))&&(T=await A_(fe.cloneDeep(T),C)),N.compData=T,N.id=v.id,((V=v.key)==null?void 0:V.type)!=="method")u.push(N);else{let W;W={name:"",compData:[N],comp:"calculator"},u.push(W)}}));return await Promise.all(d),((p=(g=a.data.result)==null?void 0:g.map(v=>v.value.pageData))==null?void 0:p.filter(v=>Object.values(v).length>0).length)>0&&u.push({comp:"methodButton",name:"",compData:(E=(S=a.data.result)==null?void 0:S.map(v=>v.value.pageData))==null?void 0:E.filter(v=>Object.values(v).length>0)}),u=u.sort((v,N)=>v.id-N.id),u},w_=async r=>{await fe.deleteInsofDataApi({id:r})},T_=async(r,e,t,n,i,s,a)=>{var l,c,h,u,d,f,m,_,g,p,S,E,v;const o=((c=(l=a==null?void 0:a.content)==null?void 0:l[0])==null?void 0:c.id)??"";if(o!==""&&((h=a==null?void 0:a.content)==null?void 0:h.length)>1){const N=await fe.getInsofDataApi({id:o});let C=((m=(f=(d=(u=N==null?void 0:N.data)==null?void 0:u.result)==null?void 0:d[0])==null?void 0:f.key)==null?void 0:m.tableId)??"",T=((S=(p=(g=(_=N==null?void 0:N.data)==null?void 0:_.result)==null?void 0:g[0])==null?void 0:p.key)==null?void 0:S.pageKey)??"";await fe.createInsofDataApi({key:{type:r,pageKey:T,tableId:C,systemKey:n},value:{tableData:cs(i,(E=Yi(s))==null?void 0:E.filter(P=>P!=="操作"))}})}else await fe.createInsofDataApi({key:{type:r,pageKey:e,tableId:t,systemKey:n},value:{tableData:cs(i,(v=Yi(s))==null?void 0:v.filter(N=>N!=="操作"))}})},C_=async(r,e,t,n,i,s,a)=>{var h,u,d,f,m,_,g,p,S,E;const o=await fe.getInsofDataApi({id:n});let l=((f=(d=(u=(h=o==null?void 0:o.data)==null?void 0:h.result)==null?void 0:u[0])==null?void 0:d.key)==null?void 0:f.tableId)??"",c=((p=(g=(_=(m=o==null?void 0:o.data)==null?void 0:m.result)==null?void 0:_[0])==null?void 0:g.key)==null?void 0:p.pageKey)??"";l&&l!==""?await fe.updateInsofDataApi({key:{type:r,pageKey:c,tableId:l,systemKey:i},value:{tableData:cs(s,(S=Yi(a))==null?void 0:S.filter(v=>v!=="操作"))},id:n}):await fe.updateInsofDataApi({key:{type:r,pageKey:e,tableId:t,systemKey:i},value:{tableData:cs(s,(E=Yi(a))==null?void 0:E.filter(v=>v!=="操作"))},id:n})},R_=async(r,e)=>{await fe.updateInsofDataApi({value:{pageData:e},id:r})},D_=async(r,e)=>await fe.getInsofDataApi({key:r,valueLikes:e}),L_=async()=>{var r,e,t,n,i,s,a,o,l;try{const c=await fe.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),layer:"superAdmin"}});((r=c==null?void 0:c.data)==null?void 0:r.code)===200&&(bl.setPlatform(((i=(n=(t=(e=c==null?void 0:c.data)==null?void 0:e.result)==null?void 0:t[0])==null?void 0:n.key)==null?void 0:i.systemType)==="制造系统"?"client":"browser"),bl.setPlatName(((l=(o=(a=(s=c==null?void 0:c.data)==null?void 0:s.result)==null?void 0:a[0])==null?void 0:o.key)==null?void 0:l.name)??""))}catch(c){return Promise.reject(c)}},sd=fe.defineStore("modelTableComp",{state:()=>({tableIndex:0,tableShowThree:""}),actions:{setTableIndex(r){this.tableIndex=r},setTableShowThree(r){this.tableShowThree=r}}}),P_={class:"table-content"},I_={class:"menu-config-wrap"},N_=["onClick"],U_={class:"form-content"},F_={key:0,class:"dialog-footer"},O_={class:"dialog-footer"},z_={__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(r,{emit:e}){const t=r,n=e,i=K.ref([]),s=K.ref(!1),a=K.ref(),o=fe.useMenuState(),{activeMenuPath:l}=fe.storeToRefs(o),c=sd(fe.pinia),h=tu.useModelComp(fe.pinia),{extraContents:u}=fe.storeToRefs(h),d=K.ref([]);K.ref(!1);const f=K.ref("");K.ref();const m=K.ref(!0),_=K.ref(0),g=K.ref(!1),p=K.ref(""),S=K.ref(!1),E=K.ref({label:"查看三维模型"}),v=K.ref(!1),N=K.ref(),C=K.ref([]),T=K.ref([]),P=K.ref(!1),b=K.ref([]),x=K.ref([]),R=K.ref(),B=K.ref(),V=Qu(fe.pinia),W=K.ref(),ee=ed(fe.pinia),{selectIndex:k,selectMenu:Q,selectTitle:q}=fe.storeToRefs(ee),{selectString:ue}=fe.storeToRefs(V),ye=K.ref(720),le=()=>{S.value=!1},Le=$=>{n("clickTrigger",$)},Te=($,pe)=>{if(Object.values(pe).length!==0)return Object.values(pe).find(te=>{var Se,he,ce;return((Se=te==null?void 0:te.toString())==null?void 0:Se.includes(".txt"))||((he=te==null?void 0:te.toString())==null?void 0:he.includes(".cpt"))||((ce=te==null?void 0:te.toString())==null?void 0:ce.includes(".obj"))})?[...$,E.value]:$},Y=$=>{var he;ue.value===""?$==null||$[0]:($==null?void 0:$.find(ce=>(ce==null?void 0:ce.selectLabel)==="("+ue.value+")"))??($==null||$.find(ce=>!(ce!=null&&ce.selectLabel)));let pe=$;(he=i.value)!=null&&he.find(ce=>ce.prop==="index");let te=R.value;const Se=[];return pe==null||pe.forEach((ce,Ue)=>{var A;let U={};if(Array.isArray(ce)){let G=[];ce==null||ce.filter(z=>!(z!=null&&z.id)).forEach((z,se)=>{var ne,Ce,Ae,Be,Ve;if((ne=te==null?void 0:te[se])!=null&&ne.prop&&!Array.isArray(z)){let me={};me[te[se].column]=z,u!=null&&u.value&&((Ce=u==null?void 0:u.value)==null?void 0:Ce.length)>0&&((Ae=u==null?void 0:u.value)!=null&&Ae.find(De=>JSON.stringify(De==null?void 0:De[0])===JSON.stringify(me)))&&(G=(Be=u==null?void 0:u.value)==null?void 0:Be.find(De=>JSON.stringify(De==null?void 0:De[0])===JSON.stringify(me))),G&&G.length>0?U[te[se].prop]=G!=null&&G.find(De=>{var Je;return((Je=Object.keys(De))==null?void 0:Je[0])===te[se].column})?(Ve=G==null?void 0:G.find(De=>{var Je;return((Je=Object.keys(De))==null?void 0:Je[0])===te[se].column}))==null?void 0:Ve[te[se].column]:z:U[te[se].prop]=z}})}else U=ce;Array.isArray(ce)&&ce.some(G=>G==null?void 0:G.id)?Se.push(Object.assign(U,{id:(A=ce==null?void 0:ce.find(G=>G.id))==null?void 0:A.id})):U.id?Se.push(U):Se.push(Object.assign(U,{id:Ue}))}),Se},re=async $=>{var he,ce,Ue,U,A;let pe={};for(let G in $)$[G]!==""&&(pe["tableData."+G]=$[G]);const te=await D_({type:"data",tableId:t==null?void 0:t.index,systemKey:sessionStorage.getItem("systemKey"),pageKey:l.value},pe),Se=(Ue=(ce=(he=fe.cloneDeep(te))==null?void 0:he.data)==null?void 0:ce.result)==null?void 0:Ue.map(G=>{var se;let z=[];return z.push({id:G.id}),z.push((se=G==null?void 0:G.value)==null?void 0:se.tableData),z});d.value=Y(Ma(Se,(A=(U=fe.cloneDeep(i.value))==null?void 0:U.map(G=>G.label))==null?void 0:A.filter(G=>G!=="操作")))},ae=async $=>{var Se,he,ce,Ue,U,A,G,z,se,ne;const pe=(Se=fe.cloneDeep(i.value))==null?void 0:Se.filter(Ce=>Ce==null?void 0:Ce.isRoute);if((pe==null?void 0:pe.length)>0){let Ce=(he=pe==null?void 0:pe[0])==null?void 0:he.prop,Ae=l.value+"/"+($==null?void 0:$[Ce]),Be=l.value,Ve=await Sl(Ae,sessionStorage.getItem("systemKey"),"");if((Ve==null?void 0:Ve.length)>0)h.setRouteToChildPath(Be),o.setActiveMenuPath(Ae);else{const me=await In.findFirstContent(t==null?void 0:t.index);me&&(Ae=l.value+"/"+(me==null?void 0:me[(ce=pe==null?void 0:pe[0])==null?void 0:ce.label]),await In.loadingConstruct(Ae,l.value+"/"+($==null?void 0:$[Ce])),h.setRouteToChildPath(Be),o.setActiveMenuPath(l.value+"/"+($==null?void 0:$[Ce])))}}let te=await Sl(l.value,sessionStorage.getItem("systemKey"),$.id);if(te=te==null?void 0:te.filter(Ce=>Ce.comp!=="methodButton"),te&&te.length>0){const Ce=!Array.isArray(q.value)&&((Ue=q.value)==null?void 0:Ue.key)!=="main"?[]:q.value;Ce.push({key:Q.value===""?(U=$==null?void 0:$.id)==null?void 0:U.toString():Q.value+"-"+((A=$==null?void 0:$.id)==null?void 0:A.toString()),value:$[(G=Object.keys($))==null?void 0:G.filter(Ae=>Ae!=="index"&&Ae!=="id")[0]]}),ee.setSelectMenu(Q.value===""?(z=$==null?void 0:$.id)==null?void 0:z.toString():Q.value+"-"+((se=$==null?void 0:$.id)==null?void 0:se.toString())),ee.setSelectTitle(Ce),ee.setSelectIndex((ne=$==null?void 0:$.id)==null?void 0:ne.toString()),n("pageChange",te)}},oe=$=>{var pe;(pe=fe.cloneDeep(t.itemData))==null||pe.map(te=>((te==null?void 0:te.key)==="tableContents"&&(te.contents=$),te))},Ee=async($,pe,te,Se)=>{var he;if((Se==null?void 0:Se.data)==="查看"&&($!=null&&$.every(ce=>(ce==null?void 0:ce.url)&&(ce==null?void 0:ce.name)))){let ce=fe.cloneDeep($);ce=await((he=fe.cloneDeep(ce))==null?void 0:he.map(async U=>{var z,se,ne,Ce;const A=await jn.downloadAvatarApi({url:U==null?void 0:U.url});let G=URL.createObjectURL(A.data);return{name:(U==null?void 0:U.name)+"."+((Ce=(z=U==null?void 0:U.url)==null?void 0:z.split("."))==null?void 0:Ce[((ne=(se=U==null?void 0:U.url)==null?void 0:se.split("."))==null?void 0:ne.length)-1]),blobUrl:G}}));let Ue=await Promise.all(ce);a.value=Ue,s.value=!0}n("contentClick",$,pe,te,{id:t==null?void 0:t.index,type:"table"})},_e=()=>{s.value=!1},we=$=>{n("rowClick",$)};K.watch(()=>t.changedContent,()=>{var te,Se;if(!t.changedContent)return;let $=(te=d.value)==null?void 0:te.map(he=>{var ce;return he.id===((ce=t.changedContent)==null?void 0:ce.id)&&(he={...t.changedContent,id:t.changedContent.newId?t.changedContent.newId:t.changedContent.id},delete he.newId),he});const pe=(Se=t.itemData)==null?void 0:Se.map(he=>((he==null?void 0:he.key)==="tableContents"&&(he.contents=$),he));d.value=$,n("contentChange",{contents:pe,index:t.index}),n("change",{content:$,index:t==null?void 0:t.index,buttonName:"",id:t==null?void 0:t.index})},{deep:!0,immediate:!0});const ke=()=>{},tt=($,pe,te)=>{var Se,he,ce;if(f.value="",P.value=!0,m.value=!0,n("onButtonClick",$,pe),$==="删除"){d.value=(Se=fe.cloneDeep(d.value))==null?void 0:Se.filter(U=>(U==null?void 0:U.id)!==(pe==null?void 0:pe.id));const Ue=K3(W.value,Q.value,pe==null?void 0:pe.id);oe(Ue),n("change",{content:d.value,singleContent:pe,index:t==null?void 0:t.index,type:"delete",buttonName:$,column:i.value})}else if($==="新增")p.value="新增",Qe(""),S.value=!0;else if($==="编辑")p.value="编辑",Qe(pe),S.value=!0;else if($==="查看")p.value="查看",Qe(pe),P.value=!1,m.value=!1,S.value=!0;else if($==="查看三维模型"){const Ue={};for(let A in pe)A!=="id"&&(Ue[A]=pe[A]);let U=(he=Object.values(Ue))==null?void 0:he[1];c.setTableShowThree(U)}else((ce=te==null?void 0:te.extra)==null?void 0:ce.type)==="modelExample"&&(p.value=$,v.value=!0)},Qe=$=>{var he,ce,Ue,U,A,G;const pe=[];let te=[];for(let z in $)Array.isArray($==null?void 0:$[z])&&te.push(z);(ce=In.getColumnChild((he=fe.cloneDeep(i.value))==null?void 0:he.filter(z=>(z==null?void 0:z.label)!=="操作")))==null||ce.forEach((z,se)=>{var ne;te.find(Ce=>Ce===(z==null?void 0:z.prop))||(z!=null&&z.formType&&((ne=z==null?void 0:z.formType)==null?void 0:ne.toUpperCase())==="SELECT"?pe.push({label:(z==null?void 0:z.label)??"",name:(z==null?void 0:z.prop)??"t"+se,type:!(z!=null&&z.formType)||(z==null?void 0:z.formType)===""?"Input":z==null?void 0:z.formType,value:($==null?void 0:$[z==null?void 0:z.prop])??(z==null?void 0:z.value)??"",id:(z==null?void 0:z.id)??se,contents:(z==null?void 0:z.options)??[],width:1,isFormColHidden:z==null?void 0:z.isFormColHidden,optionUrl:{groupSelect:z==null?void 0:z.groupSelect,menuSelect:z==null?void 0:z.formMenuSelect,type:"Select",selectRelateType:z==null?void 0:z.selectRelateType}}):pe.push({label:(z==null?void 0:z.label)??"",name:(z==null?void 0:z.prop)??"t"+se,type:!(z!=null&&z.formType)||(z==null?void 0:z.formType)===""?"Input":z==null?void 0:z.formType,value:($==null?void 0:$[z==null?void 0:z.prop])??(z==null?void 0:z.value)??"",id:(z==null?void 0:z.id)??se,contents:(z==null?void 0:z.options)??[],width:1,isFormColHidden:z==null?void 0:z.isFormColHidden}))}),$===""||!$||(f.value=$==null?void 0:$.id);let Se=In.getColumnChild((Ue=fe.cloneDeep(i.value))==null?void 0:Ue.filter(z=>(z==null?void 0:z.label)!=="操作"));C.value&&((U=C.value)==null?void 0:U.length)>0&&(C.value=(A=fe.cloneDeep(C).value)==null?void 0:A.map(z=>{var ne;let se=(ne=Se==null?void 0:Se.find(Ce=>(Ce==null?void 0:Ce.label)===(z==null?void 0:z.label)))==null?void 0:ne.prop;return se&&(z.value=$[se]),z})),x.value=C.value&&((G=C.value)==null?void 0:G.length)>0?In.getTableFormToForm(C.value):pe};K.onMounted(()=>{N.value=window.innerWidth-240*2});const O=()=>{var he;let $=In.getColumnChild((he=fe.cloneDeep(i.value))==null?void 0:he.filter(ce=>(ce==null?void 0:ce.label)!=="操作")),pe,te=fe.cloneDeep(d.value);f.value===""?(_.value++,te.push(Object.assign(B.value,{id:_.value})),pe=Object.assign(B.value,{id:_.value})):te=te==null?void 0:te.map(ce=>{var Ue;if((ce==null?void 0:ce.id)===f.value){let U={};for(let A in ce){let G=(Ue=$==null?void 0:$.find(z=>(z==null?void 0:z.prop)===A))==null?void 0:Ue.label;G?U[A]=B.value[G]:U[A]=ce[A]}ce=Object.assign(U,B.value),pe=ce}return ce}),d.value=te;const Se=Q3(W.value,Q.value,te);oe(Se),S.value=!1,n("change",{content:Se,singleContent:pe,index:t==null?void 0:t.index,buttonName:p.value,column:i.value})},bt=$=>{B.value=$,n("onFormChange",$)};return K.watch(()=>[t.itemData,ue.value,k.value,Q.value,u==null?void 0:u.value],()=>{var A,G,z,se,ne,Ce,Ae,Be,Ve,me,De,Je,nt,Pe,ct,H,Fe,ve,He,Me,ge,qe,ht,Dt,pt,en;const $=(A=fe.cloneDeep(t.itemData))==null?void 0:A.filter(je=>(je==null?void 0:je.key)==="header");(G=fe.cloneDeep(t.itemData))==null||G.filter(je=>(je==null?void 0:je.key)==="tableIndexColumn")[0];const pe=(z=fe.cloneDeep(t.itemData))==null?void 0:z.find(je=>(je==null?void 0:je.key)==="page"),te=(se=fe.cloneDeep(t.itemData))==null?void 0:se.find(je=>(je==null?void 0:je.key)==="rowButton"),Se=(ne=fe.cloneDeep(t.itemData))==null?void 0:ne.find(je=>(je==null?void 0:je.key)==="extraButton"),he=(Ce=fe.cloneDeep(t.itemData))==null?void 0:Ce.filter(je=>(je==null?void 0:je.key)==="tableContents"),ce=(Ae=fe.cloneDeep(t.itemData))==null?void 0:Ae.filter(je=>(je==null?void 0:je.key)==="tableIndex");C.value=(me=(Ve=(Be=fe.cloneDeep(t.itemData))==null?void 0:Be.filter(je=>(je==null?void 0:je.key)==="tableToForm"))==null?void 0:Ve[0])==null?void 0:me.contents,g.value=(pe==null?void 0:pe.contents)??!1;let Ue=[];ue.value===""?Ue=$==null?void 0:$[0]:Ue=($==null?void 0:$.find(je=>(je==null?void 0:je.selectLabel)==="("+ue.value+")"))??($==null?void 0:$.find(je=>!(je!=null&&je.selectLabel)));let U=[];if(ue.value===""?U=ce==null?void 0:ce[0]:U=(ce==null?void 0:ce.find(je=>(je==null?void 0:je.selectLabel)==="("+ue.value+")"))??(ce==null?void 0:ce.find(je=>!(je!=null&&je.selectLabel))),((De=Ue==null?void 0:Ue.contents)==null?void 0:De.length)>0){let je=[];if(Ue!=null&&Ue.contents.some(rt=>Array.isArray(rt)&&(rt==null?void 0:rt.find(Re=>Re.children))))Q.value===""?je=(nt=(Je=In.getGradeColumns(fe.cloneDeep(Ue==null?void 0:Ue.contents)))==null?void 0:Je[0])==null?void 0:nt.filter(rt=>!Array.isArray(rt)):(Q.value.split("-"),je=(Pe=In.getGradeColumns(fe.cloneDeep(Ue==null?void 0:Ue.contents)))==null?void 0:Pe[0]);else{const rt=Ue!=null&&Ue.contents.some(Re=>Array.isArray(Re))?(ct=Ue==null?void 0:Ue.contents)==null?void 0:ct[0]:Ue==null?void 0:Ue.contents;rt==null||rt.forEach((Re,Ht)=>{var nn;je.push({label:(Re==null?void 0:Re.label)??"",prop:(Re==null?void 0:Re.label)==="操作"?"operate":(Re==null?void 0:Re.prop)??"a"+Ht,width:Re!=null&&Re.width?parseInt(Re.width):"",fixed:(Re==null?void 0:Re.fixed)??void 0,sortable:(Re==null?void 0:Re.sortable)??!1,align:(Re==null?void 0:Re.align)??"center",showOverflowTooltip:(Re==null?void 0:Re.showOverflowTooltip)??!0,isNotDrag:(Re==null?void 0:Re.isNotDrag)??!1,isEditCol:(Re==null?void 0:Re.isEditCol)??!1,isOperate:(Re==null?void 0:Re.isOperate)??!1,id:(Re==null?void 0:Re.id)??Ht,type:(Re==null?void 0:Re.label)==="操作"?"operate":void 0,formType:(Re==null?void 0:Re.formType)??(Re!=null&&Re.groupSelect?"Select":""),isTableColHidden:Re==null?void 0:Re.isTableColHidden,isFormColHidden:Re==null?void 0:Re.isFormColHidden,options:(Re==null?void 0:Re.options)??[],value:(Re==null?void 0:Re.value)??"",formMenuSelect:(Re==null?void 0:Re.formMenuSelect)??[],isRoute:(Re==null?void 0:Re.isRoute)??!1,groupSelect:Re!=null&&Re.groupSelect?(nn=Re==null?void 0:Re.groupSelect)==null?void 0:nn.replaceAll('"',"").split(":"):[]})})}i.value=je;let Zt=(Fe=(H=In.getAllLeafNodes(fe.cloneDeep(i.value)))==null?void 0:H.filter(rt=>(rt==null?void 0:rt.type)!=="operate"))==null?void 0:Fe.map((rt,Re)=>({prop:(rt==null?void 0:rt.prop)??"a"+Re,column:rt.label}));R.value=Zt;let jt=[];ue.value===""?jt=he==null?void 0:he[0]:jt=(he==null?void 0:he.find(rt=>(rt==null?void 0:rt.selectLabel)==="("+ue.value+")"))??(he==null?void 0:he.find(rt=>!(rt!=null&&rt.selectLabel)));let tn=Array.isArray((ve=jt==null?void 0:jt.contents)==null?void 0:ve[0])&&((He=jt==null?void 0:jt.contents)!=null&&He[0].every(rt=>Array.isArray(rt)))?(Me=fe.cloneDeep(jt==null?void 0:jt.contents))==null?void 0:Me[0]:fe.cloneDeep(jt==null?void 0:jt.contents);U!=null&&U.contents&&((ge=U==null?void 0:U.contents)==null?void 0:ge.length)!==0&&(tn=(qe=fe.cloneDeep(tn))==null?void 0:qe.map((rt,Re)=>{if(!Array.isArray(rt)){let Ht={};for(let nn in rt)nn!=="id"&&nn!=="index"&&(Ht[nn]=rt[nn]);rt=Object.values(Ht)}return rt}));const Di=!!((ht=i.value)!=null&&ht.find(rt=>rt.prop==="index"));tn=nd(fe.cloneDeep(tn),U==null?void 0:U.contents,Di);const ti=[];tn==null||tn.forEach((rt,Re)=>{var nn;let Ht={};if(Array.isArray(rt)){let Wt=[];rt==null||rt.filter(hn=>!(hn!=null&&hn.id)).forEach((hn,En)=>{var Ki,Zi,Qi,er,tr,D;if((Ki=Zt==null?void 0:Zt[En])!=null&&Ki.prop&&!Array.isArray(hn)){let X={};X[Zt[En].column]=hn,u!=null&&u.value&&((Zi=u==null?void 0:u.value)==null?void 0:Zi.length)>0&&((Qi=u==null?void 0:u.value)!=null&&Qi.find(J=>JSON.stringify(J==null?void 0:J[0])===JSON.stringify(X)))&&(Wt=(er=u==null?void 0:u.value)==null?void 0:er.find(J=>JSON.stringify(J==null?void 0:J[0])===JSON.stringify(X))),Wt&&Wt.length>0?Ht[Zt[En].prop]=Wt!=null&&Wt.find(J=>{var Z;return((Z=Object.keys(J))==null?void 0:Z[0])===Zt[En].column})?(tr=Wt==null?void 0:Wt.find(J=>{var Z;return((Z=Object.keys(J))==null?void 0:Z[0])===Zt[En].column}))==null?void 0:tr[Zt[En].column]:hn:Ht[Zt[En].prop]=hn}else Array.isArray(hn)&&((D=Zt[En])!=null&&D.prop?Ht[Zt[En].prop]=hn:Ht.children=td(hn,Zt))})}else Ht=rt;Array.isArray(rt)&&rt.some(Wt=>Wt==null?void 0:Wt.id)?ti.push(Object.assign(Ht,{id:(nn=rt==null?void 0:rt.find(Wt=>Wt.id))==null?void 0:nn.id})):Ht.id?ti.push(Ht):ti.push(Object.assign(Ht,{id:Re}))}),d.value=ti}else i.value=[],d.value=[];((Dt=te==null?void 0:te.contents)==null?void 0:Dt.length)>0?T.value=te==null?void 0:te.contents:T.value=[],((pt=Se==null?void 0:Se.contents)==null?void 0:pt.length)>0?b.value=Se==null?void 0:Se.contents:b.value=[],_.value=((en=d==null?void 0:d.value)==null?void 0:en.length)??0,W.value=d.value},{deep:!0,immediate:!0}),K.watch(()=>t==null?void 0:t.operatingForm,$=>{$!=null&&$.form&&(Qe($==null?void 0:$.form),p.value=$==null?void 0:$.dialogTitle,P.value=!0,S.value=!0)},{immediate:!0,deep:!0}),($,pe)=>{var ce;const te=K.resolveComponent("el-icon"),Se=K.resolveComponent("el-popover"),he=K.resolveComponent("el-button");return K.openBlock(),K.createElementBlock("div",P_,[(K.openBlock(),K.createBlock(jn.ssTable,{columns:i.value,key:i.value,tableData:d.value,isShowPagination:g.value,isShowEdit:!1,isShowDelete:!1,onDbClickRow:ae,extraButton:b.value,onContentClick:Ee,onRowClick:we},K.createSlots({headerButton:K.withCtx(Ue=>[r.showHeader?(K.openBlock(),K.createBlock(Gd,{key:0,compName:r.compName,buttons:Ue.buttons,onButtonClick:pe[0]||(pe[0]=U=>tt(U,"",{})),columns:i.value,onFilter:re},null,8,["compName","buttons","columns"])):K.createCommentVNode("",!0)]),_:2},[((ce=T.value)==null?void 0:ce.length)>0?{name:"actions",fn:K.withCtx(({item:Ue})=>[K.createVNode(Se,{class:"box-item",title:"",placement:"left-start","popper-class":"menu-operate-popover"},{reference:K.withCtx(()=>[K.createVNode(te,null,{default:K.withCtx(()=>[K.createVNode(K.unref(fe.more_filled_default))]),_:1})]),default:K.withCtx(()=>[K.createElementVNode("div",I_,[(K.openBlock(!0),K.createElementBlock(K.Fragment,null,K.renderList(Te(T.value,Ue),(U,A)=>(K.openBlock(),K.createElementBlock("div",{class:"menu-config-item",key:A},[K.createElementVNode("div",{style:K.normalizeStyle({color:U==null?void 0:U.textColor}),class:"extra-button-label",onClick:G=>tt(U==null?void 0:U.label,Ue,{extra:U})},K.toDisplayString(U==null?void 0:U.label),13,N_)]))),128))])]),_:2},1024)]),key:"0"}:void 0]),1032,["columns","tableData","isShowPagination","extraButton"])),K.createVNode(jn.ssDialog,{title:p.value,visible:S.value,width:ye.value,onBeforeDestroy:le},{default:K.withCtx(()=>[K.createElementVNode("div",U_,[K.createVNode(jn.ssForm,{rowContents:x.value,isEnableWrap:!1,onChange:bt,onClickTrigger:Le,isEdit:m.value},null,8,["rowContents","isEdit"])])]),footer:K.withCtx(()=>[P.value?(K.openBlock(),K.createElementBlock("div",F_,[K.createVNode(he,{onClick:pe[1]||(pe[1]=Ue=>S.value=!1),id:"themeBorderButton"},{default:K.withCtx(()=>pe[4]||(pe[4]=[K.createTextVNode(K.toDisplayString("取消"))])),_:1,__:[4]}),K.createVNode(he,{class:"ok-button",onClick:O,id:"themeButton"},{default:K.withCtx(()=>pe[5]||(pe[5]=[K.createTextVNode(K.toDisplayString("确认"))])),_:1,__:[5]})])):K.createCommentVNode("",!0)]),_:1},8,["title","visible","width"]),K.createVNode(jn.ssDialog,{title:p.value,visible:v.value,width:N.value,onBeforeDestroy:pe[3]||(pe[3]=Ue=>v.value=!1)},{default:K.withCtx(()=>[K.createVNode(J3)]),footer:K.withCtx(()=>[K.createElementVNode("div",O_,[K.createVNode(he,{onClick:pe[2]||(pe[2]=Ue=>v.value=!1),class:"cancel-button",id:"themeBorderButton"},{default:K.withCtx(()=>pe[6]||(pe[6]=[K.createTextVNode(K.toDisplayString("取消"))])),_:1,__:[6]}),K.createVNode(he,{class:"ok-button",onClick:ke,id:"themeButton"},{default:K.withCtx(()=>pe[7]||(pe[7]=[K.createTextVNode(K.toDisplayString("确认"))])),_:1,__:[7]})])]),_:1},8,["title","visible","width"]),s.value?(K.openBlock(),K.createBlock(jn.ssFilePreview,{key:0,fileDataList:a.value,onDestroy:_e},null,8,["fileDataList"])):K.createCommentVNode("",!0)])}}},B_=El._export_sfc(z_,[["__scopeId","data-v-c1156fac"]]);exports.ACESFilmicToneMapping=lu;exports.AmbientLight=Bu;exports.Box3=ei;exports.CatmullRomCurve3=Iu;exports.Color=st;exports.Controls=M0;exports.DirectionalLight=zu;exports.DoubleSide=pn;exports.Euler=yn;exports.GridHelper=x0;exports.HemisphereLight=h0;exports.IsJson=t_;exports.MOUSE=Wd;exports.MathUtils=Hi;exports.Matrix4=lt;exports.Mesh=Ct;exports.MeshPhongMaterial=bn;exports.PCFSoftShadowMap=ou;exports.PerspectiveCamera=ln;exports.Plane=Ei;exports.PlaneGeometry=us;exports.PointLight=Ou;exports.Quaternion=Rn;exports.Ray=Ur;exports.SRGBColorSpace=Tt;exports.Scene=Ol;exports.SetCache=ns;exports.ShadowMaterial=jp;exports.Spherical=ku;exports.TOUCH=Xd;exports.TubeGeometry=Wl;exports.Vector2=Ge;exports.Vector3=F;exports.WebGLRenderer=r3;exports.Xe=D3;exports.addTableContents=T_;exports.baseIsEqual=Al;exports.cacheHas=nu;exports.deleteTableContents=w_;exports.fixFormContents=R_;exports.fixTableContents=C_;exports.getColumnContents=Yi;exports.getFixExtraContent=u_;exports.getFormContents=r_;exports.getFormToContent=a_;exports.getFormToData=c_;exports.getItemData=Sl;exports.getNewTableContents=h_;exports.getParentConstruct=S_;exports.getParentKey=b_;exports.getProjectContent=f_;exports.getTableToContent=s_;exports.getValueToObjectValue=cs;exports.isEqual=su;exports.loadingSystemType=L_;exports.methodTableToContent=i_;exports.setToArray=ru;exports.ssTable=B_;exports.tableEveryContents=M_;exports.tableToContents=m_;exports.tableToStruct=p_;exports.useFormToTableComp=Qu;exports.useModelLoader=X3;exports.useTableComp=sd;exports.useUnit=ed;
|
|
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 u=c.split(Gh);switch(u[0]){case"v":t.vertices.push(parseFloat(u[1]),parseFloat(u[2]),parseFloat(u[3])),u.length>=7?(Zs.setRGB(parseFloat(u[4]),parseFloat(u[5]),parseFloat(u[6]),Tt),t.colors.push(Zs.r,Zs.g,Zs.b)):t.colors.push(void 0,void 0,void 0);break;case"vn":t.normals.push(parseFloat(u[1]),parseFloat(u[2]),parseFloat(u[3]));break;case"vt":t.uvs.push(parseFloat(u[1]),parseFloat(u[2]));break}}else if(h==="f"){const d=c.slice(1).trim().split(Gh),f=[];for(let _=0,g=d.length;_<g;_++){const p=d[_];if(p.length>0){const S=p.split("/");f.push(S)}}const m=f[0];for(let _=1,g=f.length-1;_<g;_++){const p=f[_],S=f[_+1];t.addFace(m[0],p[0],S[0],m[1],p[1],S[1],m[2],p[2],S[2])}}else if(h==="l"){const u=c.substring(1).trim().split(" ");let d=[];const f=[];if(c.indexOf("/")===-1)d=u;else for(let m=0,_=u.length;m<_;m++){const g=u[m].split("/");g[0]!==""&&d.push(g[0]),g[1]!==""&&f.push(g[1])}t.addLineGeometry(d,f)}else if(h==="p"){const d=c.slice(1).trim().split(" ");t.addPointGeometry(d)}else if((i=P3.exec(c))!==null){const u=(" "+i[0].slice(1).trim()).slice(1);t.startObject(u)}else if(I3.test(c))t.object.startMaterial(c.substring(7).trim(),t.materialLibraries);else if(L3.test(c))t.materialLibraries.push(c.substring(7).trim());else if(N3.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 d=i[1].trim().toLowerCase();t.object.smooth=d!=="0"&&d!=="off"}else t.object.smooth=!0;const u=t.object.currentMaterial();u&&(u.smooth=t.object.smooth)}else{if(c==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+c+'"')}}t.finalize();const s=new Jn;if(s.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,u=c.materials,d=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 S=0,E=u.length;S<E;S++){const v=u[S],N=v.name+"_"+v.smooth+"_"+m;let C=t.materials[N];if(this.materials!==null){if(C=this.materials.create(v.name),d&&C&&!(C instanceof Ci)){const T=new Ci;Pn.prototype.copy.call(T,C),T.color.copy(C.color),C=T}else if(f&&C&&!(C instanceof Wi)){const T=new Wi({size:10,sizeAttenuation:!1});Pn.prototype.copy.call(T,C),T.color.copy(C.color),T.map=C.map,C=T}}C===void 0&&(d?C=new Ci:f?C=new Wi({size:1,sizeAttenuation:!1}):C=new bn,C.name=v.name,C.flatShading=!v.smooth,C.vertexColors=m,t.materials[N]=C),g.push(C)}let p;if(g.length>1){for(let S=0,E=u.length;S<E;S++){const v=u[S];_.addGroup(v.groupStart,v.groupCount,S)}d?p=new va(_,g):f?p=new Qr(_,g):p=new Ct(_,g)}else d?p=new va(_,g[0]):f?p=new Qr(_,g[0]):p=new Ct(_,g[0]);p.name=c.name,s.add(p)}else if(t.vertices.length>0){const o=new Wi({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 Qr(l,o);s.add(c)}return s}}class Ao extends Gn{constructor(e){super(e)}load(e,t,n,i){const s=this,a=this.path===""?Yl.extractUrlBase(e):this.path,o=new zr(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{t(s.parse(l,a))}catch(c){i?i(c):console.error(c),s.manager.itemError(e)}},n,i)}setMaterialOptions(e){return this.materialOptions=e,this}parse(e,t){const n=e.split(`
|
|
4202
|
+
`);let i={};const s=/\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 u=h>=0?c.substring(0,h):c;u=u.toLowerCase();let d=h>=0?c.substring(h+1):"";if(d=d.trim(),u==="newmtl")i={name:d},a[d]=i;else if(u==="ka"||u==="kd"||u==="ks"||u==="ke"){const f=d.split(s,3);i[u]=[parseFloat(f[0]),parseFloat(f[1]),parseFloat(f[2])]}else i[u]=d}const o=new F3(this.resourcePath||t,this.materialOptions);return o.setCrossOrigin(this.crossOrigin),o.setManager(this.manager),o.setMaterials(a),o}}class F3{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:Hn,this.wrap=this.options.wrap!==void 0?this.options.wrap:$n}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],s={};t[n]=s;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&&(s[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 s(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(s(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=xt.colorSpaceToWorking(new st().fromArray(l),Tt);break;case"ks":i.specular=xt.colorSpaceToWorking(new st().fromArray(l),Tt);break;case"ke":i.emissive=xt.colorSpaceToWorking(new st().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 bn(i),this.materials[e]}getTextureParams(e,t){const n={scale:new Ge(1,1),offset:new Ge(0,0)},i=e.split(/\s+/);let s;return s=i.indexOf("-bm"),s>=0&&(t.bumpScale=parseFloat(i[s+1]),i.splice(s,2)),s=i.indexOf("-mm"),s>=0&&(t.displacementBias=parseFloat(i[s+1]),t.displacementScale=parseFloat(i[s+2]),i.splice(s,3)),s=i.indexOf("-s"),s>=0&&(n.scale.set(parseFloat(i[s+1]),parseFloat(i[s+2])),i.splice(s,4)),s=i.indexOf("-o"),s>=0&&(n.offset.set(parseFloat(i[s+1]),parseFloat(i[s+2])),i.splice(s,4)),n.url=i.join(" ").trim(),n}loadTexture(e,t,n,i,s){const a=this.manager!==void 0?this.manager:Xl;let o=a.getHandler(e);o===null&&(o=new ql(a)),o.setCrossOrigin&&o.setCrossOrigin(this.crossOrigin);const l=o.load(e,n,i,s);return t!==void 0&&(l.mapping=t),l}}class da extends Gn{constructor(e){super(e)}load(e,t,n,i){const s=this,a=new zr(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(o){try{t(s.parse(o))}catch(l){i?i(l):console.error(l),s.manager.itemError(e)}},n,i)}parse(e){function t(c){const h=new DataView(c),u=32/8*3+32/8*3*3+16/8,d=h.getUint32(80,!0);if(80+32/8+d*u===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,u){for(let d=0,f=c.length;d<f;d++)if(c[d]!==h.getUint8(u+d))return!1;return!0}function i(c){const h=new DataView(c),u=h.getUint32(80,!0);let d,f,m,_=!1,g,p,S,E,v;for(let R=0;R<70;R++)h.getUint32(R,!1)==1129270351&&h.getUint8(R+4)==82&&h.getUint8(R+5)==61&&(_=!0,g=new Float32Array(u*3*3),p=h.getUint8(R+6)/255,S=h.getUint8(R+7)/255,E=h.getUint8(R+8)/255,v=h.getUint8(R+9)/255);const N=84,C=12*4+2,T=new Bt,L=new Float32Array(u*3*3),b=new Float32Array(u*3*3),x=new st;for(let R=0;R<u;R++){const B=N+R*C,V=h.getFloat32(B,!0),W=h.getFloat32(B+4,!0),ee=h.getFloat32(B+8,!0);if(_){const k=h.getUint16(B+48,!0);(k&32768)===0?(d=(k&31)/31,f=(k>>5&31)/31,m=(k>>10&31)/31):(d=p,f=S,m=E)}for(let k=1;k<=3;k++){const Q=B+k*12,q=R*3*3+(k-1)*3;L[q]=h.getFloat32(Q,!0),L[q+1]=h.getFloat32(Q+4,!0),L[q+2]=h.getFloat32(Q+8,!0),b[q]=V,b[q+1]=W,b[q+2]=ee,_&&(x.setRGB(d,f,m,Tt),g[q]=x.r,g[q+1]=x.g,g[q+2]=x.b)}}return T.setAttribute("position",new Gt(L,3)),T.setAttribute("normal",new Gt(b,3)),_&&(T.setAttribute("color",new Gt(g,3)),T.hasColors=!0,T.alpha=v),T}function s(c){const h=new Bt,u=/solid([\s\S]*?)endsolid/g,d=/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"),S=[],E=[],v=[],N=new F;let C,T=0,L=0,b=0;for(;(C=u.exec(c))!==null;){L=b;const x=C[0],R=(C=f.exec(x))!==null?C[1]:"";for(v.push(R);(C=d.exec(x))!==null;){let W=0,ee=0;const k=C[0];for(;(C=p.exec(k))!==null;)N.x=parseFloat(C[1]),N.y=parseFloat(C[2]),N.z=parseFloat(C[3]),ee++;for(;(C=g.exec(k))!==null;)S.push(parseFloat(C[1]),parseFloat(C[2]),parseFloat(C[3])),E.push(N.x,N.y,N.z),W++,b++;ee!==1&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+m),W!==3&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+m),m++}const B=L,V=b-L;h.userData.groupNames=v,h.addGroup(B,V,T),T++}return h.setAttribute("position",new mt(S,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 u=0;u<c.length;u++)h[u]=c.charCodeAt(u)&255;return h.buffer||h}else return c}const l=o(e);return t(l)?i(l):s(a(e))}}class O3 extends Gn{constructor(e){super(e),this.littleEndian=!0}load(e,t,n,i){const s=this,a=new zr(s.manager);a.setPath(s.path),a.setResponseType("arraybuffer"),a.setRequestHeader(s.requestHeader),a.setWithCredentials(s.withCredentials),a.load(e,function(o){try{t(s.parse(o))}catch(l){i?i(l):console.error(l),s.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,S=0,E,v,N;do if(E=f[p++],E<32){if(E++,S+E>m)throw new Error("Output buffer is not large enough");if(p+E>_)throw new Error("Invalid compressed data");do g[S++]=f[p++];while(--E)}else{if(v=E>>5,N=S-((E&31)<<8)-1,p>=_)throw new Error("Invalid compressed data");if(v===7&&(v+=f[p++],p>=_))throw new Error("Invalid compressed data");if(N-=f[p++],S+v+2>m)throw new Error("Output buffer is not large enough");if(N<0)throw new Error("Invalid compressed data");if(N>=S)throw new Error("Invalid compressed data");do g[S++]=g[N++];while(--v+2)}while(p<_);return g}function n(f){const m={},_=new Uint8Array(f);let g="",p="",S=0,E=!1;const v=_.length;for(;S<v&&E===!1;){const L=String.fromCharCode(_[S++]);L===`
|
|
4203
|
+
`||L==="\r"?(p.trim().toLowerCase().startsWith("data")&&(E=!0),p=""):p+=L,g+=L}const N=g.search(/[\r\n]DATA\s(\S*)\s/i),C=/[\r\n]DATA\s(\S*)\s/i.exec(g.slice(N-1));if(m.data=C[1],m.headerLen=C[0].length+N,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(L){return parseInt(L,10)})),m.count!==null)m.count=m.count[1].split(" ").map(function(L){return parseInt(L,10)});else{m.count=[];for(let L=0,b=m.fields.length;L<b;L++)m.count.push(1)}m.offset={};let T=0;for(let L=0,b=m.fields.length;L<b;L++)m.data==="ascii"?m.offset[m.fields[L]]=L:(m.offset[m.fields[L]]=T,T+=m.size[L]*m.count[L]);return m.rowSize=T,m}const i=n(e),s=[],a=[],o=[],l=[],c=[],h=new st;if(i.data==="ascii"){const f=i.offset,g=new TextDecoder().decode(e).slice(i.headerLen).split(`
|
|
4204
|
+
`);for(let p=0,S=g.length;p<S;p++){if(g[p]==="")continue;const E=g[p].split(" ");if(f.x!==void 0&&(s.push(parseFloat(E[f.x])),s.push(parseFloat(E[f.y])),s.push(parseFloat(E[f.z]))),f.rgb!==void 0){const v=i.fields.findIndex(R=>R==="rgb"),N=i.type[v],C=parseFloat(E[f.rgb]);let T=C;if(N==="F"){const R=new Float32Array(1);R[0]=C,T=new Int32Array(R.buffer)[0]}const L=(T>>16&255)/255,b=(T>>8&255)/255,x=(T>>0&255)/255;h.setRGB(L,b,x,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),S=i.offset;for(let E=0;E<i.points;E++){if(S.x!==void 0){const v=i.fields.indexOf("x"),N=i.fields.indexOf("y"),C=i.fields.indexOf("z");s.push(this._getDataView(p,i.points*S.x+i.size[v]*E,i.type[v],i.size[v])),s.push(this._getDataView(p,i.points*S.y+i.size[N]*E,i.type[N],i.size[N])),s.push(this._getDataView(p,i.points*S.z+i.size[C]*E,i.type[C],i.size[C]))}if(S.rgb!==void 0){const v=i.fields.indexOf("rgb"),N=p.getUint8(i.points*S.rgb+i.size[v]*E+2)/255,C=p.getUint8(i.points*S.rgb+i.size[v]*E+1)/255,T=p.getUint8(i.points*S.rgb+i.size[v]*E+0)/255;h.setRGB(N,C,T,Tt),o.push(h.r,h.g,h.b)}if(S.normal_x!==void 0){const v=i.fields.indexOf("normal_x"),N=i.fields.indexOf("normal_y"),C=i.fields.indexOf("normal_z");a.push(this._getDataView(p,i.points*S.normal_x+i.size[v]*E,i.type[v],i.size[v])),a.push(this._getDataView(p,i.points*S.normal_y+i.size[N]*E,i.type[N],i.size[N])),a.push(this._getDataView(p,i.points*S.normal_z+i.size[C]*E,i.type[C],i.size[C]))}if(S.intensity!==void 0){const v=i.fields.indexOf("intensity");l.push(this._getDataView(p,i.points*S.intensity+i.size[v]*E,i.type[v],i.size[v]))}if(S.label!==void 0){const v=i.fields.indexOf("label");c.push(p.getInt32(i.points*S.label+i.size[v]*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"),S=i.fields.indexOf("y"),E=i.fields.indexOf("z");s.push(this._getDataView(f,g+m.x,i.type[p],i.size[p])),s.push(this._getDataView(f,g+m.y,i.type[S],i.size[S])),s.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,S=f.getUint8(g+m.rgb+1)/255,E=f.getUint8(g+m.rgb+0)/255;h.setRGB(p,S,E,Tt),o.push(h.r,h.g,h.b)}if(m.normal_x!==void 0){const p=i.fields.indexOf("normal_x"),S=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[S],i.size[S])),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 u=new Bt;s.length>0&&u.setAttribute("position",new mt(s,3)),a.length>0&&u.setAttribute("normal",new mt(a,3)),o.length>0&&u.setAttribute("color",new mt(o,3)),l.length>0&&u.setAttribute("intensity",new mt(l,1)),c.length>0&&u.setAttribute("label",new mp(c,1)),u.computeBoundingSphere();const d=new Wi({size:.005});return o.length>0&&(d.vertexColors=!0),new Qr(u,d)}}class jh extends c0{constructor(e){super(e)}parse(e){function t(k){switch(k.image_type){case d:case _:if(k.colormap_length>256||k.colormap_size!==24||k.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(k.colormap_type)throw new Error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case u:throw new Error("THREE.TGALoader: No data.");default:throw new Error("THREE.TGALoader: Invalid type "+k.image_type)}if(k.width<=0||k.height<=0)throw new Error("THREE.TGALoader: Invalid image size.");if(k.pixel_size!==8&&k.pixel_size!==16&&k.pixel_size!==24&&k.pixel_size!==32)throw new Error("THREE.TGALoader: Invalid pixel size "+k.pixel_size)}function n(k,Q,q,de,ye){let le,Pe;const Te=q.pixel_size>>3,Y=q.width*q.height*Te;if(Q&&(Pe=ye.subarray(de,de+=q.colormap_length*(q.colormap_size>>3))),k){le=new Uint8Array(Y);let re,ae,oe,Ee=0;const _e=new Uint8Array(Te);for(;Ee<Y;)if(re=ye[de++],ae=(re&127)+1,re&128){for(oe=0;oe<Te;++oe)_e[oe]=ye[de++];for(oe=0;oe<ae;++oe)le.set(_e,Ee+oe*Te);Ee+=Te*ae}else{for(ae*=Te,oe=0;oe<ae;++oe)le[Ee+oe]=ye[de++];Ee+=ae}}else le=ye.subarray(de,de+=Q?q.width*q.height:Y);return{pixel_data:le,palettes:Pe}}function i(k,Q,q,de,ye,le,Pe,Te,Y){const re=Y;let ae,oe=0,Ee,_e;const we=x.width;for(_e=Q;_e!==de;_e+=q)for(Ee=ye;Ee!==Pe;Ee+=le,oe++)ae=Te[oe],k[(Ee+we*_e)*4+3]=255,k[(Ee+we*_e)*4+2]=re[ae*3+0],k[(Ee+we*_e)*4+1]=re[ae*3+1],k[(Ee+we*_e)*4+0]=re[ae*3+2];return k}function s(k,Q,q,de,ye,le,Pe,Te){let Y,re=0,ae,oe;const Ee=x.width;for(oe=Q;oe!==de;oe+=q)for(ae=ye;ae!==Pe;ae+=le,re+=2)Y=Te[re+0]+(Te[re+1]<<8),k[(ae+Ee*oe)*4+0]=(Y&31744)>>7,k[(ae+Ee*oe)*4+1]=(Y&992)>>2,k[(ae+Ee*oe)*4+2]=(Y&31)<<3,k[(ae+Ee*oe)*4+3]=Y&32768?0:255;return k}function a(k,Q,q,de,ye,le,Pe,Te){let Y=0,re,ae;const oe=x.width;for(ae=Q;ae!==de;ae+=q)for(re=ye;re!==Pe;re+=le,Y+=3)k[(re+oe*ae)*4+3]=255,k[(re+oe*ae)*4+2]=Te[Y+0],k[(re+oe*ae)*4+1]=Te[Y+1],k[(re+oe*ae)*4+0]=Te[Y+2];return k}function o(k,Q,q,de,ye,le,Pe,Te){let Y=0,re,ae;const oe=x.width;for(ae=Q;ae!==de;ae+=q)for(re=ye;re!==Pe;re+=le,Y+=4)k[(re+oe*ae)*4+2]=Te[Y+0],k[(re+oe*ae)*4+1]=Te[Y+1],k[(re+oe*ae)*4+0]=Te[Y+2],k[(re+oe*ae)*4+3]=Te[Y+3];return k}function l(k,Q,q,de,ye,le,Pe,Te){let Y,re=0,ae,oe;const Ee=x.width;for(oe=Q;oe!==de;oe+=q)for(ae=ye;ae!==Pe;ae+=le,re++)Y=Te[re],k[(ae+Ee*oe)*4+0]=Y,k[(ae+Ee*oe)*4+1]=Y,k[(ae+Ee*oe)*4+2]=Y,k[(ae+Ee*oe)*4+3]=255;return k}function c(k,Q,q,de,ye,le,Pe,Te){let Y=0,re,ae;const oe=x.width;for(ae=Q;ae!==de;ae+=q)for(re=ye;re!==Pe;re+=le,Y+=2)k[(re+oe*ae)*4+0]=Te[Y+0],k[(re+oe*ae)*4+1]=Te[Y+0],k[(re+oe*ae)*4+2]=Te[Y+0],k[(re+oe*ae)*4+3]=Te[Y+1];return k}function h(k,Q,q,de,ye){let le,Pe,Te,Y,re,ae;switch((x.flags&S)>>E){default:case C:le=0,Te=1,re=Q,Pe=0,Y=1,ae=q;break;case v:le=0,Te=1,re=Q,Pe=q-1,Y=-1,ae=-1;break;case T:le=Q-1,Te=-1,re=-1,Pe=0,Y=1,ae=q;break;case N:le=Q-1,Te=-1,re=-1,Pe=q-1,Y=-1,ae=-1;break}if(V)switch(x.pixel_size){case 8:l(k,Pe,Y,ae,le,Te,re,de);break;case 16:c(k,Pe,Y,ae,le,Te,re,de);break;default:throw new Error("THREE.TGALoader: Format not supported.")}else switch(x.pixel_size){case 8:i(k,Pe,Y,ae,le,Te,re,de,ye);break;case 16:s(k,Pe,Y,ae,le,Te,re,de);break;case 24:a(k,Pe,Y,ae,le,Te,re,de);break;case 32:o(k,Pe,Y,ae,le,Te,re,de);break;default:throw new Error("THREE.TGALoader: Format not supported.")}return k}const u=0,d=1,f=2,m=3,_=9,g=10,p=11,S=48,E=4,v=0,N=1,C=2,T=3;if(e.length<19)throw new Error("THREE.TGALoader: Not enough data to contain header.");let L=0;const b=new Uint8Array(e),x={id_length:b[L++],colormap_type:b[L++],image_type:b[L++],colormap_index:b[L++]|b[L++]<<8,colormap_length:b[L++]|b[L++]<<8,colormap_size:b[L++],origin:[b[L++]|b[L++]<<8,b[L++]|b[L++]<<8],width:b[L++]|b[L++]<<8,height:b[L++]|b[L++]<<8,pixel_size:b[L++],flags:b[L++]};if(t(x),x.id_length+L>e.length)throw new Error("THREE.TGALoader: No data.");L+=x.id_length;let R=!1,B=!1,V=!1;switch(x.image_type){case _:R=!0,B=!0;break;case d:B=!0;break;case g:R=!0;break;case f:break;case p:R=!0,V=!0;break;case m:V=!0;break}const W=new Uint8Array(x.width*x.height*4),ee=n(R,B,x,L,b);return h(W,x.width,x.height,ee.pixel_data,ee.palettes),{data:W,width:x.width,height:x.height,flipY:!0,generateMipmaps:!0,minFilter:ui}}}class z3 extends Gn{load(e,t,n,i){const s=this,a=s.path===""?Yl.extractUrlBase(e):s.path,o=new zr(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(l){try{t(s.parse(l,a))}catch(c){i?i(c):console.error(c),s.manager.itemError(e)}},n,i)}parse(e,t){function n(M,y){const P=[],w=M.childNodes;for(let I=0,ie=w.length;I<ie;I++){const fe=w[I];fe.nodeName===y&&P.push(fe)}return P}function i(M){if(M.length===0)return[];const y=M.trim().split(/\s+/),P=new Array(y.length);for(let w=0,I=y.length;w<I;w++)P[w]=y[w];return P}function s(M){if(M.length===0)return[];const y=M.trim().split(/\s+/),P=new Array(y.length);for(let w=0,I=y.length;w<I;w++)P[w]=parseFloat(y[w]);return P}function a(M){if(M.length===0)return[];const y=M.trim().split(/\s+/),P=new Array(y.length);for(let w=0,I=y.length;w<I;w++)P[w]=parseInt(y[w]);return P}function o(M){return M.substring(1)}function l(){return"three_default_"+ni++}function c(M){return Object.keys(M).length===0}function h(M){return{unit:u(n(M,"unit")[0]),upAxis:d(n(M,"up_axis")[0])}}function u(M){return M!==void 0&&M.hasAttribute("meter")===!0?parseFloat(M.getAttribute("meter")):1}function d(M){return M!==void 0?M.textContent:"Y_UP"}function f(M,y,P,w){const I=n(M,y)[0];if(I!==void 0){const ie=n(I,P);for(let fe=0;fe<ie.length;fe++)w(ie[fe])}}function m(M,y){for(const P in M){const w=M[P];w.build=y(M[P])}}function _(M,y){return M.build!==void 0||(M.build=y(M)),M.build}function g(M){const y={sources:{},samplers:{},channels:{}};let P=!1;for(let w=0,I=M.childNodes.length;w<I;w++){const ie=M.childNodes[w];if(ie.nodeType!==1)continue;let fe;switch(ie.nodeName){case"source":fe=ie.getAttribute("id"),y.sources[fe]=ve(ie);break;case"sampler":fe=ie.getAttribute("id"),y.samplers[fe]=p(ie);break;case"channel":fe=ie.getAttribute("target"),y.channels[fe]=S(ie);break;case"animation":g(ie),P=!0;break;default:console.log(ie)}}P===!1&&(ft.animations[M.getAttribute("id")||Hi.generateUUID()]=y)}function p(M){const y={inputs:{}};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"input":const ie=o(I.getAttribute("source")),fe=I.getAttribute("semantic");y.inputs[fe]=ie;break}}return y}function S(M){const y={};let w=M.getAttribute("target").split("/");const I=w.shift();let ie=w.shift();const fe=ie.indexOf("(")!==-1,Xe=ie.indexOf(".")!==-1;if(Xe)w=ie.split("."),ie=w.shift(),y.member=w.shift();else if(fe){const Ie=ie.split("(");ie=Ie.shift();for(let ze=0;ze<Ie.length;ze++)Ie[ze]=parseInt(Ie[ze].replace(/\)/,""));y.indices=Ie}return y.id=I,y.sid=ie,y.arraySyntax=fe,y.memberSyntax=Xe,y.sampler=o(M.getAttribute("source")),y}function E(M){const y=[],P=M.channels,w=M.samplers,I=M.sources;for(const ie in P)if(P.hasOwnProperty(ie)){const fe=P[ie],Xe=w[fe.sampler],Ie=Xe.inputs.INPUT,ze=Xe.inputs.OUTPUT,Ze=I[Ie],xe=I[ze],Je=N(fe,Ze,xe);x(Je,y)}return y}function v(M){return _(ft.animations[M],E)}function N(M,y,P){const w=ft.nodes[M.id],I=gt(w.id),ie=w.transforms[M.sid],fe=w.matrix.clone().transpose();let Xe,Ie,ze,Ze,xe,Je;const $e={};switch(ie){case"matrix":for(ze=0,Ze=y.array.length;ze<Ze;ze++)if(Xe=y.array[ze],Ie=ze*P.stride,$e[Xe]===void 0&&($e[Xe]={}),M.arraySyntax===!0){const Vt=P.array[Ie],Lt=M.indices[0]+4*M.indices[1];$e[Xe][Lt]=Vt}else for(xe=0,Je=P.stride;xe<Je;xe++)$e[Xe][xe]=P.array[Ie+xe];break;case"translate":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',ie);break;case"rotate":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',ie);break;case"scale":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',ie);break}const ot=C($e,fe);return{name:I.uuid,keyframes:ot}}function C(M,y){const P=[];for(const I in M)P.push({time:parseFloat(I),value:M[I]});P.sort(w);for(let I=0;I<16;I++)R(P,I,y.elements[I]);return P;function w(I,ie){return I.time-ie.time}}const T=new F,L=new F,b=new Dn;function x(M,y){const P=M.keyframes,w=M.name,I=[],ie=[],fe=[],Xe=[];for(let Ie=0,ze=P.length;Ie<ze;Ie++){const Ze=P[Ie],xe=Ze.time,Je=Ze.value;X.fromArray(Je).transpose(),X.decompose(T,b,L),I.push(xe),ie.push(T.x,T.y,T.z),fe.push(b.x,b.y,b.z,b.w),Xe.push(L.x,L.y,L.z)}return ie.length>0&&y.push(new Nr(w+".position",I,ie)),fe.length>0&&y.push(new ds(w+".quaternion",I,fe)),Xe.length>0&&y.push(new Nr(w+".scale",I,Xe)),y}function R(M,y,P){let w,I=!0,ie,fe;for(ie=0,fe=M.length;ie<fe;ie++)w=M[ie],w.value[y]===void 0?w.value[y]=null:I=!1;if(I===!0)for(ie=0,fe=M.length;ie<fe;ie++)w=M[ie],w.value[y]=P;else B(M,y)}function B(M,y){let P,w;for(let I=0,ie=M.length;I<ie;I++){const fe=M[I];if(fe.value[y]===null){if(P=V(M,I,y),w=W(M,I,y),P===null){fe.value[y]=w.value[y];continue}if(w===null){fe.value[y]=P.value[y];continue}ee(fe,P,w,y)}}}function V(M,y,P){for(;y>=0;){const w=M[y];if(w.value[P]!==null)return w;y--}return null}function W(M,y,P){for(;y<M.length;){const w=M[y];if(w.value[P]!==null)return w;y++}return null}function ee(M,y,P,w){if(P.time-y.time===0){M.value[w]=y.value[w];return}M.value[w]=(M.time-y.time)*(P.value[w]-y.value[w])/(P.time-y.time)+y.value[w]}function k(M){const y={name:M.getAttribute("id")||"default",start:parseFloat(M.getAttribute("start")||0),end:parseFloat(M.getAttribute("end")||0),animations:[]};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"instance_animation":y.animations.push(o(I.getAttribute("url")));break}}ft.clips[M.getAttribute("id")]=y}function Q(M){const y=[],P=M.name,w=M.end-M.start||-1,I=M.animations;for(let ie=0,fe=I.length;ie<fe;ie++){const Xe=v(I[ie]);for(let Ie=0,ze=Xe.length;Ie<ze;Ie++)y.push(Xe[Ie])}return new Kc(P,w,y)}function q(M){return _(ft.clips[M],Q)}function de(M){const y={};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"skin":y.id=o(I.getAttribute("source")),y.skin=ye(I);break;case"morph":y.id=o(I.getAttribute("source")),console.warn("THREE.ColladaLoader: Morph target animation not supported yet.");break}}ft.controllers[M.getAttribute("id")]=y}function ye(M){const y={sources:{}};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"bind_shape_matrix":y.bindShapeMatrix=s(I.textContent);break;case"source":const ie=I.getAttribute("id");y.sources[ie]=ve(I);break;case"joints":y.joints=le(I);break;case"vertex_weights":y.vertexWeights=Pe(I);break}}return y}function le(M){const y={inputs:{}};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"input":const ie=I.getAttribute("semantic"),fe=o(I.getAttribute("source"));y.inputs[ie]=fe;break}}return y}function Pe(M){const y={inputs:{}};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"input":const ie=I.getAttribute("semantic"),fe=o(I.getAttribute("source")),Xe=parseInt(I.getAttribute("offset"));y.inputs[ie]={id:fe,offset:Xe};break;case"vcount":y.vcount=a(I.textContent);break;case"v":y.v=a(I.textContent);break}}return y}function Te(M){const y={id:M.id},P=ft.geometries[y.id];return M.skin!==void 0&&(y.skin=Y(M.skin),P.sources.skinIndices=y.skin.indices,P.sources.skinWeights=y.skin.weights),y}function Y(M){const P={joints:[],indices:{array:[],stride:4},weights:{array:[],stride:4}},w=M.sources,I=M.vertexWeights,ie=I.vcount,fe=I.v,Xe=I.inputs.JOINT.offset,Ie=I.inputs.WEIGHT.offset,ze=M.sources[M.joints.inputs.JOINT],Ze=M.sources[M.joints.inputs.INV_BIND_MATRIX],xe=w[I.inputs.WEIGHT.id].array;let Je=0,$e,ot,it;for($e=0,it=ie.length;$e<it;$e++){const Lt=ie[$e],At=[];for(ot=0;ot<Lt;ot++){const wt=fe[Je+Xe],ii=fe[Je+Ie],Mn=xe[ii];At.push({index:wt,weight:Mn}),Je+=2}for(At.sort(Vt),ot=0;ot<4;ot++){const wt=At[ot];wt!==void 0?(P.indices.array.push(wt.index),P.weights.array.push(wt.weight)):(P.indices.array.push(0),P.weights.array.push(0))}}for(M.bindShapeMatrix?P.bindMatrix=new lt().fromArray(M.bindShapeMatrix).transpose():P.bindMatrix=new lt().identity(),$e=0,it=ze.array.length;$e<it;$e++){const Lt=ze.array[$e],At=new lt().fromArray(Ze.array,$e*Ze.stride).transpose();P.joints.push({name:Lt,boneInverse:At})}return P;function Vt(Lt,At){return At.weight-Lt.weight}}function re(M){return _(ft.controllers[M],Te)}function ae(M){const y={init_from:n(M,"init_from")[0].textContent};ft.images[M.getAttribute("id")]=y}function oe(M){return M.build!==void 0?M.build:M.init_from}function Ee(M){const y=ft.images[M];return y!==void 0?_(y,oe):(console.warn("THREE.ColladaLoader: Couldn't find image with ID:",M),null)}function _e(M){const y={};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"profile_COMMON":y.profile=we(I);break}}ft.effects[M.getAttribute("id")]=y}function we(M){const y={surfaces:{},samplers:{}};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"newparam":ke(I,y);break;case"technique":y.technique=O(I);break;case"extra":y.extra=he(I);break}}return y}function ke(M,y){const P=M.getAttribute("sid");for(let w=0,I=M.childNodes.length;w<I;w++){const ie=M.childNodes[w];if(ie.nodeType===1)switch(ie.nodeName){case"surface":y.surfaces[P]=tt(ie);break;case"sampler2D":y.samplers[P]=Qe(ie);break}}}function tt(M){const y={};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"init_from":y.init_from=I.textContent;break}}return y}function Qe(M){const y={};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"source":y.source=I.textContent;break}}return y}function O(M){const y={};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"constant":case"lambert":case"blinn":case"phong":y.type=I.nodeName,y.parameters=bt(I);break;case"extra":y.extra=he(I);break}}return y}function bt(M){const y={};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"emission":case"diffuse":case"specular":case"bump":case"ambient":case"shininess":case"transparency":y[I.nodeName]=$(I);break;case"transparent":y[I.nodeName]={opaque:I.hasAttribute("opaque")?I.getAttribute("opaque"):"A_ONE",data:$(I)};break}}return y}function $(M){const y={};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"color":y[I.nodeName]=s(I.textContent);break;case"float":y[I.nodeName]=parseFloat(I.textContent);break;case"texture":y[I.nodeName]={id:I.getAttribute("texture"),extra:pe(I)};break}}return y}function pe(M){const y={technique:{}};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"extra":te(I,y);break}}return y}function te(M,y){for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"technique":Se(I,y);break}}}function Se(M,y){for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"repeatU":case"repeatV":case"offsetU":case"offsetV":y.technique[I.nodeName]=parseFloat(I.textContent);break;case"wrapU":case"wrapV":I.textContent.toUpperCase()==="TRUE"?y.technique[I.nodeName]=1:I.textContent.toUpperCase()==="FALSE"?y.technique[I.nodeName]=0:y.technique[I.nodeName]=parseInt(I.textContent);break;case"bump":y[I.nodeName]=Ue(I);break}}}function he(M){const y={};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"technique":y.technique=ce(I);break}}return y}function ce(M){const y={};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"double_sided":y[I.nodeName]=parseInt(I.textContent);break;case"bump":y[I.nodeName]=Ue(I);break}}return y}function Ue(M){const y={};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"texture":y[I.nodeName]={id:I.getAttribute("texture"),texcoord:I.getAttribute("texcoord"),extra:pe(I)};break}}return y}function U(M){return M}function A(M){return _(ft.effects[M],U)}function G(M){const y={name:M.getAttribute("name")};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"instance_effect":y.url=o(I.getAttribute("url"));break}}ft.materials[M.getAttribute("id")]=y}function z(M){let y,P=M.slice((M.lastIndexOf(".")-1>>>0)+2);switch(P=P.toLowerCase(),P){case"tga":y=un;break;default:y=mn}return y}function se(M){const y=A(M.url),P=y.profile.technique;let w;switch(P.type){case"phong":case"blinn":w=new bn;break;case"lambert":w=new $p;break;default:w=new Ri;break}w.name=M.name||"";function I(Ie,ze=null){const Ze=y.profile.samplers[Ie.id];let xe=null;if(Ze!==void 0){const Je=y.profile.surfaces[Ze.source];xe=Ee(Je.init_from)}else console.warn("THREE.ColladaLoader: Undefined sampler. Access image directly (see #12530)."),xe=Ee(Ie.id);if(xe!==null){const Je=z(xe);if(Je!==void 0){const $e=Je.load(xe),ot=Ie.extra;if(ot!==void 0&&ot.technique!==void 0&&c(ot.technique)===!1){const it=ot.technique;$e.wrapS=it.wrapU?$n:kn,$e.wrapT=it.wrapV?$n:kn,$e.offset.set(it.offsetU||0,it.offsetV||0),$e.repeat.set(it.repeatU||1,it.repeatV||1)}else $e.wrapS=$n,$e.wrapT=$n;return ze!==null&&($e.colorSpace=ze),$e}else return console.warn("THREE.ColladaLoader: Loader for texture %s not found.",xe),null}else return console.warn("THREE.ColladaLoader: Couldn't create texture with ID:",Ie.id),null}const ie=P.parameters;for(const Ie in ie){const ze=ie[Ie];switch(Ie){case"diffuse":ze.color&&w.color.fromArray(ze.color),ze.texture&&(w.map=I(ze.texture,Tt));break;case"specular":ze.color&&w.specular&&w.specular.fromArray(ze.color),ze.texture&&(w.specularMap=I(ze.texture));break;case"bump":ze.texture&&(w.normalMap=I(ze.texture));break;case"ambient":ze.texture&&(w.lightMap=I(ze.texture,Tt));break;case"shininess":ze.float&&w.shininess&&(w.shininess=ze.float);break;case"emission":ze.color&&w.emissive&&w.emissive.fromArray(ze.color),ze.texture&&(w.emissiveMap=I(ze.texture,Tt));break}}xt.colorSpaceToWorking(w.color,Tt),w.specular&&xt.colorSpaceToWorking(w.specular,Tt),w.emissive&&xt.colorSpaceToWorking(w.emissive,Tt);let fe=ie.transparent,Xe=ie.transparency;if(Xe===void 0&&fe&&(Xe={float:1}),fe===void 0&&Xe&&(fe={opaque:"A_ONE",data:{color:[1,1,1,1]}}),fe&&Xe)if(fe.data.texture)w.transparent=!0;else{const Ie=fe.data.color;switch(fe.opaque){case"A_ONE":w.opacity=Ie[3]*Xe.float;break;case"RGB_ZERO":w.opacity=1-Ie[0]*Xe.float;break;case"A_ZERO":w.opacity=1-Ie[3]*Xe.float;break;case"RGB_ONE":w.opacity=Ie[0]*Xe.float;break;default:console.warn('THREE.ColladaLoader: Invalid opaque type "%s" of transparent tag.',fe.opaque)}w.opacity<1&&(w.transparent=!0)}if(P.extra!==void 0&&P.extra.technique!==void 0){const Ie=P.extra.technique;for(const ze in Ie){const Ze=Ie[ze];switch(ze){case"double_sided":w.side=Ze===1?pn:Hn;break;case"bump":w.normalMap=I(Ze.texture),w.normalScale=new Ge(1,1);break}}}return w}function ne(M){return _(ft.materials[M],se)}function Ce(M){const y={name:M.getAttribute("name")};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"optics":y.optics=Ae(I);break}}ft.cameras[M.getAttribute("id")]=y}function Ae(M){for(let y=0;y<M.childNodes.length;y++){const P=M.childNodes[y];switch(P.nodeName){case"technique_common":return Be(P)}}return{}}function Be(M){const y={};for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];switch(w.nodeName){case"perspective":case"orthographic":y.technique=w.nodeName,y.parameters=Ve(w);break}}return y}function Ve(M){const y={};for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];switch(w.nodeName){case"xfov":case"yfov":case"xmag":case"ymag":case"znear":case"zfar":case"aspect_ratio":y[w.nodeName]=parseFloat(w.textContent);break}}return y}function me(M){let y;switch(M.optics.technique){case"perspective":y=new ln(M.optics.parameters.yfov,M.optics.parameters.aspect_ratio,M.optics.parameters.znear,M.optics.parameters.zfar);break;case"orthographic":let P=M.optics.parameters.ymag,w=M.optics.parameters.xmag;const I=M.optics.parameters.aspect_ratio;w=w===void 0?P*I:w,P=P===void 0?w/I:P,w*=.5,P*=.5,y=new Ra(-w,w,P,-P,M.optics.parameters.znear,M.optics.parameters.zfar);break;default:y=new ln;break}return y.name=M.name||"",y}function De(M){const y=ft.cameras[M];return y!==void 0?_(y,me):(console.warn("THREE.ColladaLoader: Couldn't find camera with ID:",M),null)}function Ke(M){let y={};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"technique_common":y=nt(I);break}}ft.lights[M.getAttribute("id")]=y}function nt(M){const y={};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"directional":case"point":case"spot":case"ambient":y.technique=I.nodeName,y.parameters=Le(I)}}return y}function Le(M){const y={};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"color":const ie=s(I.textContent);y.color=new st().fromArray(ie),xt.colorSpaceToWorking(y.color,Tt);break;case"falloff_angle":y.falloffAngle=parseFloat(I.textContent);break;case"quadratic_attenuation":const fe=parseFloat(I.textContent);y.distance=fe?Math.sqrt(1/fe):0;break}}return y}function ct(M){let y;switch(M.technique){case"directional":y=new zu;break;case"point":y=new Ou;break;case"spot":y=new d0;break;case"ambient":y=new Bu;break}return M.parameters.color&&y.color.copy(M.parameters.color),M.parameters.distance&&(y.distance=M.parameters.distance),y}function H(M){const y=ft.lights[M];return y!==void 0?_(y,ct):(console.warn("THREE.ColladaLoader: Couldn't find light with ID:",M),null)}function Fe(M){const y={name:M.getAttribute("name"),sources:{},vertices:{},primitives:[]},P=n(M,"mesh")[0];if(P!==void 0){for(let w=0;w<P.childNodes.length;w++){const I=P.childNodes[w];if(I.nodeType!==1)continue;const ie=I.getAttribute("id");switch(I.nodeName){case"source":y.sources[ie]=ve(I);break;case"vertices":y.vertices=He(I);break;case"polygons":console.warn("THREE.ColladaLoader: Unsupported primitive type: ",I.nodeName);break;case"lines":case"linestrips":case"polylist":case"triangles":y.primitives.push(Me(I));break;default:console.log(I)}}ft.geometries[M.getAttribute("id")]=y}}function ve(M){const y={array:[],stride:3};for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];if(w.nodeType===1)switch(w.nodeName){case"float_array":y.array=s(w.textContent);break;case"Name_array":y.array=i(w.textContent);break;case"technique_common":const I=n(w,"accessor")[0];I!==void 0&&(y.stride=parseInt(I.getAttribute("stride")));break}}return y}function He(M){const y={};for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];w.nodeType===1&&(y[w.getAttribute("semantic")]=o(w.getAttribute("source")))}return y}function Me(M){const y={type:M.nodeName,material:M.getAttribute("material"),count:parseInt(M.getAttribute("count")),inputs:{},stride:0,hasUV:!1};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"input":const ie=o(I.getAttribute("source")),fe=I.getAttribute("semantic"),Xe=parseInt(I.getAttribute("offset")),Ie=parseInt(I.getAttribute("set")),ze=Ie>0?fe+Ie:fe;y.inputs[ze]={id:ie,offset:Xe},y.stride=Math.max(y.stride,Xe+1),fe==="TEXCOORD"&&(y.hasUV=!0);break;case"vcount":y.vcount=a(I.textContent);break;case"p":y.p=a(I.textContent);break}}return y}function ge(M){const y={};for(let P=0;P<M.length;P++){const w=M[P];y[w.type]===void 0&&(y[w.type]=[]),y[w.type].push(w)}return y}function qe(M){let y=0;for(let P=0,w=M.length;P<w;P++)M[P].hasUV===!0&&y++;y>0&&y<M.length&&(M.uvsNeedsFix=!0)}function ht(M){const y={},P=M.sources,w=M.vertices,I=M.primitives;if(I.length===0)return{};const ie=ge(I);for(const fe in ie){const Xe=ie[fe];qe(Xe),y[fe]=Dt(Xe,P,w)}return y}function Dt(M,y,P){const w={},I={array:[],stride:0},ie={array:[],stride:0},fe={array:[],stride:0},Xe={array:[],stride:0},Ie={array:[],stride:0},ze={array:[],stride:4},Ze={array:[],stride:4},xe=new Bt,Je=[];let $e=0;for(let ot=0;ot<M.length;ot++){const it=M[ot],Vt=it.inputs;let Lt=0;switch(it.type){case"lines":case"linestrips":Lt=it.count*2;break;case"triangles":Lt=it.count*3;break;case"polylist":for(let At=0;At<it.count;At++){const wt=it.vcount[At];switch(wt){case 3:Lt+=3;break;case 4:Lt+=6;break;default:Lt+=(wt-2)*3;break}}break;default:console.warn("THREE.ColladaLoader: Unknown primitive type:",it.type)}xe.addGroup($e,Lt,ot),$e+=Lt,it.material&&Je.push(it.material);for(const At in Vt){const wt=Vt[At];switch(At){case"VERTEX":for(const ii in P){const Mn=P[ii];switch(ii){case"POSITION":const ir=I.array.length;if(pt(it,y[Mn],wt.offset,I.array),I.stride=y[Mn].stride,y.skinWeights&&y.skinIndices&&(pt(it,y.skinIndices,wt.offset,ze.array),pt(it,y.skinWeights,wt.offset,Ze.array)),it.hasUV===!1&&M.uvsNeedsFix===!0){const ad=(I.array.length-ir)/I.stride;for(let Ql=0;Ql<ad;Ql++)fe.array.push(0,0)}break;case"NORMAL":pt(it,y[Mn],wt.offset,ie.array),ie.stride=y[Mn].stride;break;case"COLOR":pt(it,y[Mn],wt.offset,Ie.array),Ie.stride=y[Mn].stride;break;case"TEXCOORD":pt(it,y[Mn],wt.offset,fe.array),fe.stride=y[Mn].stride;break;case"TEXCOORD1":pt(it,y[Mn],wt.offset,Xe.array),fe.stride=y[Mn].stride;break;default:console.warn('THREE.ColladaLoader: Semantic "%s" not handled in geometry build process.',ii)}}break;case"NORMAL":pt(it,y[wt.id],wt.offset,ie.array),ie.stride=y[wt.id].stride;break;case"COLOR":pt(it,y[wt.id],wt.offset,Ie.array,!0),Ie.stride=y[wt.id].stride;break;case"TEXCOORD":pt(it,y[wt.id],wt.offset,fe.array),fe.stride=y[wt.id].stride;break;case"TEXCOORD1":pt(it,y[wt.id],wt.offset,Xe.array),Xe.stride=y[wt.id].stride;break}}}return I.array.length>0&&xe.setAttribute("position",new mt(I.array,I.stride)),ie.array.length>0&&xe.setAttribute("normal",new mt(ie.array,ie.stride)),Ie.array.length>0&&xe.setAttribute("color",new mt(Ie.array,Ie.stride)),fe.array.length>0&&xe.setAttribute("uv",new mt(fe.array,fe.stride)),Xe.array.length>0&&xe.setAttribute("uv1",new mt(Xe.array,Xe.stride)),ze.array.length>0&&xe.setAttribute("skinIndex",new mt(ze.array,ze.stride)),Ze.array.length>0&&xe.setAttribute("skinWeight",new mt(Ze.array,Ze.stride)),w.data=xe,w.type=M[0].type,w.materialKeys=Je,w}function pt(M,y,P,w,I=!1){const ie=M.p,fe=M.stride,Xe=M.vcount;function Ie(xe){let Je=ie[xe+P]*Ze;const $e=Je+Ze;for(;Je<$e;Je++)w.push(ze[Je]);if(I){const ot=w.length-Ze-1;Xt.setRGB(w[ot+0],w[ot+1],w[ot+2],Tt),w[ot+0]=Xt.r,w[ot+1]=Xt.g,w[ot+2]=Xt.b}}const ze=y.array,Ze=y.stride;if(M.vcount!==void 0){let xe=0;for(let Je=0,$e=Xe.length;Je<$e;Je++){const ot=Xe[Je];if(ot===4){const it=xe+fe*0,Vt=xe+fe*1,Lt=xe+fe*2,At=xe+fe*3;Ie(it),Ie(Vt),Ie(At),Ie(Vt),Ie(Lt),Ie(At)}else if(ot===3){const it=xe+fe*0,Vt=xe+fe*1,Lt=xe+fe*2;Ie(it),Ie(Vt),Ie(Lt)}else if(ot>4)for(let it=1,Vt=ot-2;it<=Vt;it++){const Lt=xe+fe*0,At=xe+fe*it,wt=xe+fe*(it+1);Ie(Lt),Ie(At),Ie(wt)}xe+=fe*ot}}else for(let xe=0,Je=ie.length;xe<Je;xe+=fe)Ie(xe)}function en(M){return _(ft.geometries[M],ht)}function je(M){const y={name:M.getAttribute("name")||"",joints:{},links:[]};for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];if(w.nodeType===1)switch(w.nodeName){case"technique_common":tn(w,y);break}}ft.kinematicsModels[M.getAttribute("id")]=y}function Zt(M){return M.build!==void 0?M.build:M}function jt(M){return _(ft.kinematicsModels[M],Zt)}function tn(M,y){for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];if(w.nodeType===1)switch(w.nodeName){case"joint":y.joints[w.getAttribute("sid")]=Di(w);break;case"link":y.links.push(rt(w));break}}}function Di(M){let y;for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];if(w.nodeType===1)switch(w.nodeName){case"prismatic":case"revolute":y=ti(w);break}}return y}function ti(M){const y={sid:M.getAttribute("sid"),name:M.getAttribute("name")||"",axis:new F,limits:{min:0,max:0},type:M.nodeName,static:!1,zeroPosition:0,middlePosition:0};for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];if(w.nodeType===1)switch(w.nodeName){case"axis":const I=s(w.textContent);y.axis.fromArray(I);break;case"limits":const ie=w.getElementsByTagName("max")[0],fe=w.getElementsByTagName("min")[0];y.limits.max=parseFloat(ie.textContent),y.limits.min=parseFloat(fe.textContent);break}}return y.limits.min>=y.limits.max&&(y.static=!0),y.middlePosition=(y.limits.min+y.limits.max)/2,y}function rt(M){const y={sid:M.getAttribute("sid"),name:M.getAttribute("name")||"",attachments:[],transforms:[]};for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];if(w.nodeType===1)switch(w.nodeName){case"attachment_full":y.attachments.push(Re(w));break;case"matrix":case"translate":case"rotate":y.transforms.push(Ht(w));break}}return y}function Re(M){const y={joint:M.getAttribute("joint").split("/").pop(),transforms:[],links:[]};for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];if(w.nodeType===1)switch(w.nodeName){case"link":y.links.push(rt(w));break;case"matrix":case"translate":case"rotate":y.transforms.push(Ht(w));break}}return y}function Ht(M){const y={type:M.nodeName},P=s(M.textContent);switch(y.type){case"matrix":y.obj=new lt,y.obj.fromArray(P).transpose();break;case"translate":y.obj=new F,y.obj.fromArray(P);break;case"rotate":y.obj=new F,y.obj.fromArray(P),y.angle=Hi.degToRad(P[3]);break}return y}function nn(M){const y={name:M.getAttribute("name")||"",rigidBodies:{}};for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];if(w.nodeType===1)switch(w.nodeName){case"rigid_body":y.rigidBodies[w.getAttribute("name")]={},Wt(w,y.rigidBodies[w.getAttribute("name")]);break}}ft.physicsModels[M.getAttribute("id")]=y}function Wt(M,y){for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];if(w.nodeType===1)switch(w.nodeName){case"technique_common":hn(w,y);break}}}function hn(M,y){for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];if(w.nodeType===1)switch(w.nodeName){case"inertia":y.inertia=s(w.textContent);break;case"mass":y.mass=s(w.textContent)[0];break}}}function En(M){const y={bindJointAxis:[]};for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];if(w.nodeType===1)switch(w.nodeName){case"bind_joint_axis":y.bindJointAxis.push(Ji(w));break}}ft.kinematicsScenes[o(M.getAttribute("url"))]=y}function Ji(M){const y={target:M.getAttribute("target").split("/").pop()};for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];if(w.nodeType===1)switch(w.nodeName){case"axis":const I=w.getElementsByTagName("param")[0];y.axis=I.textContent;const ie=y.axis.split("inst_").pop().split("axis")[0];y.jointIndex=ie.substring(0,ie.length-1);break}}return y}function Zi(M){return M.build!==void 0?M.build:M}function Qi(M){return _(ft.kinematicsScenes[M],Zi)}function er(){const M=Object.keys(ft.kinematicsModels)[0],y=Object.keys(ft.kinematicsScenes)[0],P=Object.keys(ft.visualScenes)[0];if(M===void 0||y===void 0)return;const w=jt(M),I=Qi(y),ie=St(P),fe=I.bindJointAxis,Xe={};for(let Ze=0,xe=fe.length;Ze<xe;Ze++){const Je=fe[Ze],$e=zt.querySelector('[sid="'+Je.target+'"]');if($e){const ot=$e.parentElement;Ie(Je.jointIndex,ot)}}function Ie(Ze,xe){const Je=xe.getAttribute("name"),$e=w.joints[Ze];ie.traverse(function(ot){ot.name===Je&&(Xe[Ze]={object:ot,transforms:tr(xe),joint:$e,position:$e.zeroPosition})})}const ze=new lt;nr={joints:w&&w.joints,getJointValue:function(Ze){const xe=Xe[Ze];if(xe)return xe.position;console.warn("THREE.ColladaLoader: Joint "+Ze+" doesn't exist.")},setJointValue:function(Ze,xe){const Je=Xe[Ze];if(Je){const $e=Je.joint;if(xe>$e.limits.max||xe<$e.limits.min)console.warn("THREE.ColladaLoader: Joint "+Ze+" value "+xe+" outside of limits (min: "+$e.limits.min+", max: "+$e.limits.max+").");else if($e.static)console.warn("THREE.ColladaLoader: Joint "+Ze+" is static.");else{const ot=Je.object,it=$e.axis,Vt=Je.transforms;X.identity();for(let Lt=0;Lt<Vt.length;Lt++){const At=Vt[Lt];if(At.sid&&At.sid.indexOf(Ze)!==-1)switch($e.type){case"revolute":X.multiply(ze.makeRotationAxis(it,Hi.degToRad(xe)));break;case"prismatic":X.multiply(ze.makeTranslation(it.x*xe,it.y*xe,it.z*xe));break;default:console.warn("THREE.ColladaLoader: Unknown joint type: "+$e.type);break}else switch(At.type){case"matrix":X.multiply(At.obj);break;case"translate":X.multiply(ze.makeTranslation(At.obj.x,At.obj.y,At.obj.z));break;case"scale":X.scale(At.obj);break;case"rotate":X.multiply(ze.makeRotationAxis(At.obj,At.angle));break}}ot.matrix.copy(X),ot.matrix.decompose(ot.position,ot.quaternion,ot.scale),Xe[Ze].position=xe}}else console.log("THREE.ColladaLoader: "+Ze+" does not exist.")}}}function tr(M){const y=[],P=zt.querySelector('[id="'+M.id+'"]');for(let w=0;w<P.childNodes.length;w++){const I=P.childNodes[w];if(I.nodeType!==1)continue;let ie,fe;switch(I.nodeName){case"matrix":ie=s(I.textContent);const Xe=new lt().fromArray(ie).transpose();y.push({sid:I.getAttribute("sid"),type:I.nodeName,obj:Xe});break;case"translate":case"scale":ie=s(I.textContent),fe=new F().fromArray(ie),y.push({sid:I.getAttribute("sid"),type:I.nodeName,obj:fe});break;case"rotate":ie=s(I.textContent),fe=new F().fromArray(ie);const Ie=Hi.degToRad(ie[3]);y.push({sid:I.getAttribute("sid"),type:I.nodeName,obj:fe,angle:Ie});break}}return y}function D(M){const y=M.getElementsByTagName("node");for(let P=0;P<y.length;P++){const w=y[P];w.hasAttribute("id")===!1&&w.setAttribute("id",l())}}const X=new lt,K=new F;function Z(M){const y={name:M.getAttribute("name")||"",type:M.getAttribute("type"),id:M.getAttribute("id"),sid:M.getAttribute("sid"),matrix:new lt,nodes:[],instanceCameras:[],instanceControllers:[],instanceLights:[],instanceGeometries:[],instanceNodes:[],transforms:{}};for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];if(w.nodeType!==1)continue;let I;switch(w.nodeName){case"node":y.nodes.push(w.getAttribute("id")),Z(w);break;case"instance_camera":y.instanceCameras.push(o(w.getAttribute("url")));break;case"instance_controller":y.instanceControllers.push(j(w));break;case"instance_light":y.instanceLights.push(o(w.getAttribute("url")));break;case"instance_geometry":y.instanceGeometries.push(j(w));break;case"instance_node":y.instanceNodes.push(o(w.getAttribute("url")));break;case"matrix":I=s(w.textContent),y.matrix.multiply(X.fromArray(I).transpose()),y.transforms[w.getAttribute("sid")]=w.nodeName;break;case"translate":I=s(w.textContent),K.fromArray(I),y.matrix.multiply(X.makeTranslation(K.x,K.y,K.z)),y.transforms[w.getAttribute("sid")]=w.nodeName;break;case"rotate":I=s(w.textContent);const ie=Hi.degToRad(I[3]);y.matrix.multiply(X.makeRotationAxis(K.fromArray(I),ie)),y.transforms[w.getAttribute("sid")]=w.nodeName;break;case"scale":I=s(w.textContent),y.matrix.scale(K.fromArray(I)),y.transforms[w.getAttribute("sid")]=w.nodeName;break;case"extra":break;default:console.log(w)}}return et(y.id)?console.warn("THREE.ColladaLoader: There is already a node with ID %s. Exclude current node from further processing.",y.id):ft.nodes[y.id]=y,y}function j(M){const y={id:o(M.getAttribute("url")),materials:{},skeletons:[]};for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];switch(w.nodeName){case"bind_material":const I=w.getElementsByTagName("instance_material");for(let ie=0;ie<I.length;ie++){const fe=I[ie],Xe=fe.getAttribute("symbol"),Ie=fe.getAttribute("target");y.materials[Xe]=o(Ie)}break;case"skeleton":y.skeletons.push(o(w.textContent));break}}return y}function be(M,y){const P=[],w=[];let I,ie,fe;for(I=0;I<M.length;I++){const ze=M[I];let Ze;if(et(ze))Ze=gt(ze),Oe(Ze,y,P);else if(kt(ze)){const Je=ft.visualScenes[ze].children;for(let $e=0;$e<Je.length;$e++){const ot=Je[$e];if(ot.type==="JOINT"){const it=gt(ot.id);Oe(it,y,P)}}}else console.error("THREE.ColladaLoader: Unable to find root bone of skeleton with ID:",ze)}for(I=0;I<y.length;I++)for(ie=0;ie<P.length;ie++)if(fe=P[ie],fe.bone.name===y[I].name){w[I]=fe,fe.processed=!0;break}for(I=0;I<P.length;I++)fe=P[I],fe.processed===!1&&(w.push(fe),fe.processed=!0);const Xe=[],Ie=[];for(I=0;I<w.length;I++)fe=w[I],Xe.push(fe.bone),Ie.push(fe.boneInverse);return new Bl(Xe,Ie)}function Oe(M,y,P){M.traverse(function(w){if(w.isBone===!0){let I;for(let ie=0;ie<y.length;ie++){const fe=y[ie];if(fe.name===w.name){I=fe.boneInverse;break}}I===void 0&&(I=new lt),P.push({bone:w,boneInverse:I,processed:!1})}})}function Ye(M){const y=[],P=M.matrix,w=M.nodes,I=M.type,ie=M.instanceCameras,fe=M.instanceControllers,Xe=M.instanceLights,Ie=M.instanceGeometries,ze=M.instanceNodes;for(let xe=0,Je=w.length;xe<Je;xe++)y.push(gt(w[xe]));for(let xe=0,Je=ie.length;xe<Je;xe++){const $e=De(ie[xe]);$e!==null&&y.push($e.clone())}for(let xe=0,Je=fe.length;xe<Je;xe++){const $e=fe[xe],ot=re($e.id),it=en(ot.id),Vt=dt(it,$e.materials),Lt=$e.skeletons,At=ot.skin.joints,wt=be(Lt,At);for(let ii=0,Mn=Vt.length;ii<Mn;ii++){const ir=Vt[ii];ir.isSkinnedMesh&&(ir.bind(wt,ot.skin.bindMatrix),ir.normalizeSkinWeights()),y.push(ir)}}for(let xe=0,Je=Xe.length;xe<Je;xe++){const $e=H(Xe[xe]);$e!==null&&y.push($e.clone())}for(let xe=0,Je=Ie.length;xe<Je;xe++){const $e=Ie[xe],ot=en($e.id),it=dt(ot,$e.materials);for(let Vt=0,Lt=it.length;Vt<Lt;Vt++)y.push(it[Vt])}for(let xe=0,Je=ze.length;xe<Je;xe++)y.push(gt(ze[xe]).clone());let Ze;if(w.length===0&&y.length===1)Ze=y[0];else{Ze=I==="JOINT"?new Ru:new Jn;for(let xe=0;xe<y.length;xe++)Ze.add(y[xe])}return Ze.name=I==="JOINT"?M.sid:M.name,Ze.matrix.copy(P),Ze.matrix.decompose(Ze.position,Ze.quaternion,Ze.scale),Ze}const We=new Ri({name:Gn.DEFAULT_MATERIAL_NAME,color:16711935});function ut(M,y){const P=[];for(let w=0,I=M.length;w<I;w++){const ie=y[M[w]];ie===void 0?(console.warn("THREE.ColladaLoader: Material with key %s not found. Apply fallback material.",M[w]),P.push(We)):P.push(ne(ie))}return P}function dt(M,y){const P=[];for(const w in M){const I=M[w],ie=ut(I.materialKeys,y);if(ie.length===0&&(w==="lines"||w==="linestrips"?ie.push(new Ci):ie.push(new bn)),w==="lines"||w==="linestrips")for(let ze=0,Ze=ie.length;ze<Ze;ze++){const xe=ie[ze];if(xe.isMeshPhongMaterial===!0||xe.isMeshLambertMaterial===!0){const Je=new Ci;Je.color.copy(xe.color),Je.opacity=xe.opacity,Je.transparent=xe.transparent,ie[ze]=Je}}const fe=I.data.attributes.skinIndex!==void 0,Xe=ie.length===1?ie[0]:ie;let Ie;switch(w){case"lines":Ie=new va(I.data,Xe);break;case"linestrips":Ie=new Vl(I.data,Xe);break;case"triangles":case"polylist":fe?Ie=new wp(I.data,Xe):Ie=new Ct(I.data,Xe);break}P.push(Ie)}return P}function et(M){return ft.nodes[M]!==void 0}function gt(M){return _(ft.nodes[M],Ye)}function Rt(M){const y={name:M.getAttribute("name"),children:[]};D(M);const P=n(M,"node");for(let w=0;w<P.length;w++)y.children.push(Z(P[w]));ft.visualScenes[M.getAttribute("id")]=y}function Ot(M){const y=new Jn;y.name=M.name;const P=M.children;for(let w=0;w<P.length;w++){const I=P[w];y.add(gt(I.id))}return y}function kt(M){return ft.visualScenes[M]!==void 0}function St(M){return _(ft.visualScenes[M],Ot)}function at(M){const y=n(M,"instance_visual_scene")[0];return St(o(y.getAttribute("url")))}function Yt(){const M=ft.clips;if(c(M)===!0){if(c(ft.animations)===!1){const y=[];for(const P in ft.animations){const w=v(P);for(let I=0,ie=w.length;I<ie;I++)y.push(w[I])}$t.push(new Kc("default",-1,y))}}else for(const y in M)$t.push(q(y))}function Et(M){let y="";const P=[M];for(;P.length;){const w=P.shift();w.nodeType===Node.TEXT_NODE?y+=w.textContent:(y+=`
|
|
4205
|
+
`,P.push(...w.childNodes))}return y.trim()}if(e.length===0)return{scene:new Ol};const xn=new DOMParser().parseFromString(e,"application/xml"),zt=n(xn,"COLLADA")[0],rn=xn.getElementsByTagName("parsererror")[0];if(rn!==void 0){const M=n(rn,"div")[0];let y;return M?y=M.textContent:y=Et(rn),console.error(`THREE.ColladaLoader: Failed to parse collada file.
|
|
4206
|
+
`,y),null}const Pi=zt.getAttribute("version");console.debug("THREE.ColladaLoader: File version",Pi);const Ft=h(n(zt,"asset")[0]),mn=new ql(this.manager);mn.setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin);let un;jh&&(un=new jh(this.manager),un.setPath(this.resourcePath||t));const Xt=new st,$t=[];let nr={},ni=0;const ft={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",k),f(zt,"library_controllers","controller",de),f(zt,"library_images","image",ae),f(zt,"library_effects","effect",_e),f(zt,"library_materials","material",G),f(zt,"library_cameras","camera",Ce),f(zt,"library_lights","light",Ke),f(zt,"library_geometries","geometry",Fe),f(zt,"library_nodes","node",Z),f(zt,"library_visual_scenes","visual_scene",Rt),f(zt,"library_kinematics_models","kinematics_model",je),f(zt,"library_physics_models","physics_model",nn),f(zt,"scene","instance_kinematics_scene",En),m(ft.animations,E),m(ft.clips,Q),m(ft.controllers,Te),m(ft.images,oe),m(ft.effects,U),m(ft.materials,se),m(ft.cameras,me),m(ft.lights,ct),m(ft.geometries,ht),m(ft.visualScenes,Ot),Yt(),er();const ps=at(n(zt,"scene")[0]);return ps.animations=$t,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."),ps.rotation.set(-Math.PI/2,0,0)),ps.scale.multiplyScalar(Ft.unit),{get animations(){return console.warn("THREE.ColladaLoader: Please access animations over scene.animations now."),$t},kinematics:nr,library:ft,scene:ps}}}const Yh=new F,B3=new yn,Qs=new lt,Si=new lt,ea=new Dn,ta=new F(1,1,1),na=new F;class Pa extends Ut{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 k3 extends Pa{constructor(...e){super(...e),this.isURDFCollider=!0,this.type="URDFCollider"}}class V3 extends Pa{constructor(...e){super(...e),this.isURDFVisual=!0,this.type="URDFVisual"}}class Ju extends Pa{constructor(...e){super(...e),this.isURDFLink=!0,this.type="URDFLink"}}class Zu extends Pa{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),Yh.copy(this.axis).applyEuler(this.rotation),this.position.addScaledVector(Yh,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],Si.compose(this.origPosition,this.origQuaternion,ta),ea.setFromEuler(B3.set(this.jointValue[3],this.jointValue[4],this.jointValue[5],"XYZ")),na.set(this.jointValue[0],this.jointValue[1],this.jointValue[2]),Qs.compose(na,ea,ta),Si.premultiply(Qs),this.position.setFromMatrixPosition(Si),this.rotation.setFromRotationMatrix(Si),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],Si.compose(this.origPosition,this.origQuaternion,ta),ea.setFromAxisAngle(this.axis,this.jointValue[2]),na.set(this.jointValue[0],this.jointValue[1],0),Qs.compose(na,ea,ta),Si.premultiply(Qs),this.position.setFromMatrixPosition(Si),this.rotation.setFromRotationMatrix(Si),this.matrixWorldNeedsUpdate=!0,!0)}return t}}class $h extends Zu{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 H3 extends Ju{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 wo=new Dn,Kh=new yn;function Sr(r){return r?r.trim().split(/\s+/g).map(e=>parseFloat(e)):[0,0,0]}function Jh(r,e,t=!1){t||r.rotation.set(0,0,0),Kh.set(e[0],e[1],e[2],"ZYX"),wo.setFromEuler(Kh),wo.multiply(r.quaternion),r.quaternion.copy(wo)}class G3{constructor(e){this.manager=e||Xl,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 s=this.manager,a=Yl.extractUrlBase(e),o=this.manager.resolveURL(e);s.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),s.itemEnd(o)}).catch(l=>{i?i(l):console.error("URDFLoader: Error loading file.",l),s.itemError(o),s.itemEnd(o)})}parse(e,t=this.workingPath){const n=this.packages,i=this.loadMeshCb,s=this.parseVisual,a=this.parseCollision,o=this.manager,l={},c={},h={};function u(S){if(!/^package:\/\//.test(S))return t?t+S:S;const[E,v]=S.replace(/^package:\/\//,"").split(/\/(.+)/);if(typeof n=="string")return n.endsWith(E)?n+"/"+v:n+"/"+E+"/"+v;if(n instanceof Function)return n(E)+"/"+v;if(typeof n=="object")return E in n?n[E]+"/"+v:(console.error(`URDFLoader : ${E} not found in provided package list.`),null)}function d(S){let E;S instanceof Document?E=[...S.children]:S instanceof Element?E=[S]:E=[...new DOMParser().parseFromString(S,"text/xml").children];const v=E.filter(N=>N.nodeName==="robot").pop();return f(v)}function f(S){const E=[...S.children],v=E.filter(R=>R.nodeName.toLowerCase()==="link"),N=E.filter(R=>R.nodeName.toLowerCase()==="joint"),C=E.filter(R=>R.nodeName.toLowerCase()==="material"),T=new H3;T.robotName=S.getAttribute("name"),T.urdfRobotNode=S,C.forEach(R=>{const B=R.getAttribute("name");h[B]=g(R)});const L={},b={};v.forEach(R=>{const B=R.getAttribute("name"),V=S.querySelector(`child[link="${B}"]`)===null;l[B]=_(R,L,b,V?T:null)}),N.forEach(R=>{const B=R.getAttribute("name");c[B]=m(R)}),T.joints=c,T.links=l,T.colliders=b,T.visual=L;const x=Object.values(c);return x.forEach(R=>{R instanceof $h&&c[R.mimicJoint].mimicJoints.push(R)}),x.forEach(R=>{const B=new Set,V=W=>{if(B.has(W))throw new Error("URDFLoader: Detected an infinite loop of mimic joints.");B.add(W),W.mimicJoints.forEach(ee=>{V(ee)})};V(R)}),T.frames={...b,...L,...l,...c},T}function m(S){const E=[...S.children],v=S.getAttribute("type");let N;const C=E.find(B=>B.nodeName.toLowerCase()==="mimic");C?(N=new $h,N.mimicJoint=C.getAttribute("joint"),N.multiplier=parseFloat(C.getAttribute("multiplier")||1),N.offset=parseFloat(C.getAttribute("offset")||0)):N=new Zu,N.urdfNode=S,N.name=S.getAttribute("name"),N.urdfName=N.name,N.jointType=v;let T=null,L=null,b=[0,0,0],x=[0,0,0];E.forEach(B=>{const V=B.nodeName.toLowerCase();V==="origin"?(b=Sr(B.getAttribute("xyz")),x=Sr(B.getAttribute("rpy"))):V==="child"?L=l[B.getAttribute("link")]:V==="parent"?T=l[B.getAttribute("link")]:V==="limit"&&(N.limit.lower=parseFloat(B.getAttribute("lower")||N.limit.lower),N.limit.upper=parseFloat(B.getAttribute("upper")||N.limit.upper))}),T.add(N),N.add(L),Jh(N,x),N.position.set(b[0],b[1],b[2]);const R=E.filter(B=>B.nodeName.toLowerCase()==="axis")[0];if(R){const B=R.getAttribute("xyz").split(/\s+/g).map(V=>parseFloat(V));N.axis=new F(B[0],B[1],B[2]),N.axis.normalize()}return N}function _(S,E,v,N=null){N===null&&(N=new Ju);const C=[...S.children];return N.name=S.getAttribute("name"),N.urdfName=N.name,N.urdfNode=S,s&&C.filter(L=>L.nodeName.toLowerCase()==="visual").forEach(L=>{const b=p(L,h);if(N.add(b),L.hasAttribute("name")){const x=L.getAttribute("name");b.name=x,b.urdfName=x,E[x]=b}}),a&&C.filter(L=>L.nodeName.toLowerCase()==="collision").forEach(L=>{const b=p(L);if(N.add(b),L.hasAttribute("name")){const x=L.getAttribute("name");b.name=x,b.urdfName=x,v[x]=b}}),N}function g(S){const E=[...S.children],v=new bn;return v.name=S.getAttribute("name")||"",E.forEach(N=>{const C=N.nodeName.toLowerCase();if(C==="color"){const T=N.getAttribute("rgba").split(/\s/g).map(L=>parseFloat(L));v.color.setRGB(T[0],T[1],T[2]),v.opacity=T[3],v.transparent=T[3]<1,v.depthWrite=!v.transparent}else if(C==="texture"){const T=N.getAttribute("filename");if(T){const L=new ql(o),b=u(T);v.map=L.load(b),v.map.colorSpace=Tt}}}),v}function p(S,E={}){const v=S.nodeName.toLowerCase()==="collision",N=[...S.children];let C=null;const T=N.filter(b=>b.nodeName.toLowerCase()==="material")[0];if(T){const b=T.getAttribute("name");b&&b in E?C=E[b]:C=g(T)}else C=new bn;const L=v?new k3:new V3;return L.urdfNode=S,N.forEach(b=>{const x=b.nodeName.toLowerCase();if(x==="geometry"){const R=b.children[0].nodeName.toLowerCase();if(R==="mesh"){const B=b.children[0].getAttribute("filename"),V=u(B);if(V!==null){const W=b.children[0].getAttribute("scale");if(W){const ee=Sr(W);L.scale.set(ee[0],ee[1],ee[2])}i(V,o,(ee,k)=>{k?console.error("URDFLoader: Error loading mesh.",k):ee&&(ee instanceof Ct&&(ee.material=C),ee.position.set(0,0,0),ee.quaternion.identity(),L.add(ee))})}}else if(R==="box"){const B=new Ct;B.geometry=new Ki(1,1,1),B.material=C;const V=Sr(b.children[0].getAttribute("size"));B.scale.set(V[0],V[1],V[2]),L.add(B)}else if(R==="sphere"){const B=new Ct;B.geometry=new Ta(1,30,30),B.material=C;const V=parseFloat(b.children[0].getAttribute("radius"))||0;B.scale.set(V,V,V),L.add(B)}else if(R==="cylinder"){const B=new Ct;B.geometry=new Hl(1,1,1,30),B.material=C;const V=parseFloat(b.children[0].getAttribute("radius"))||0,W=parseFloat(b.children[0].getAttribute("length"))||0;B.scale.set(V,W,V),B.rotation.set(Math.PI/2,0,0),L.add(B)}}else if(x==="origin"){const R=Sr(b.getAttribute("xyz")),B=Sr(b.getAttribute("rpy"));L.position.set(R[0],R[1],R[2]),L.rotation.set(0,0,0),Jh(L,B)}}),L}return d(e)}defaultMeshLoader(e,t,n){/\.stl$/i.test(e)?new da(t).load(e,s=>{const a=new Ct(s,new bn);n(a)}):/\.dae$/i.test(e)?new z3(t).load(e,s=>n(s.scene)):console.warn(`URDFLoader: Could not load model at ${e}.
|
|
4207
|
+
No loader available`)}}const W3=tu.useModelComp(ue.pinia),{systemPath:Zh}=ue.storeToRefs(W3),ia=J.ref();function X3(r,e,t,n,i){const s=async d=>{try{const f=await jn.downloadAvatarApi({url:d});if(f.status!==200)throw new Error(`下载失败: ${f.status}`);return f.data}catch(f){throw console.error("addModelFromUrl失败:",f),f}},a=d=>new Promise((f,m)=>{const _=new FileReader;_.onload=g=>{try{const p=g.target.result,E=new Ao().parse(p);E.preload(),f(E)}catch(p){m(p)}},_.onerror=()=>{m(new Error("MTL文件读取失败"))},_.readAsText(d)}),o=async d=>{const f={materials:{},create:function(m){return this.materials[m]?this.materials[m]:(console.warn(`Material '${m}' not found, using default material`),new bn({color:8947848,side:pn}))},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 d){const _=await a(m);Object.assign(f.materials,_.materials)}return f.preload(),f},l=async(d,f=[])=>new Promise((m,_)=>{const g=new FileReader;g.onload=async p=>{try{const S=p.target.result;let E=null;f&&f.length>0&&(f.length===1?E=await a(f[0]):E=await o(f));const v=new Eo;E&&v.setMaterials(E);const N=v.parse(S);E||N.traverse(C=>{C.isMesh&&(C.material=new bn({color:8947848,side:pn}))}),m(N)}catch(S){_(S)}},g.onerror=()=>{_(new Error("OBJ文件读取失败"))},g.readAsText(d)}),c=async d=>{var f;try{t.value=!0;const{scene:m}=r();if(!m)throw new Error("Scene not initialized");i();const _=[];for(let g=0;g<d.length;g++){const p=d[g];n.value=`正在加载模型 ${g+1}/${d.length}...`;const S=await s(p.objUrl),E=((f=p.objUrl)==null?void 0:f.split("/").pop())||`model_${g}.obj`,v=new File([S],E,{type:S.type});let N=[];if(p.mtlUrls){const T=Array.isArray(p.mtlUrls)?p.mtlUrls:[p.mtlUrls];for(let L=0;L<T.length;L++){const b=T[L],x=await s(b),R=(b==null?void 0:b.split("/").pop())||`material_${g}_${L}.mtl`,B=new File([x],R,{type:x.type});N.push(B)}}const C=await l(v,N);m.add(C),e.value.push(C),_.push(C)}return t.value=!1,_}catch(m){throw console.error("加载模型失败:",m),t.value=!1,m}},h=async(d,f,m=[],_=[])=>{let g;const p=d.toLowerCase();switch(p){case".txt":case".cpt":case".obj":const S=await f.text();if(p===".txt"||p===".cpt"){const _e=/^(?!.*\bf\b)[^\n]*?(-?\d*\.?\d+)[^\n]*?(-?\d*\.?\d+)[^\n]*?(-?\d*\.?\d+)[^\n]*?$/gm,ke=[...S.matchAll(_e)].map(O=>({x:parseFloat(O[1]),y:parseFloat(O[2]),z:parseFloat(O[3])})),tt=new Bt,Qe=ke.flatMap(O=>[O.x,O.y,O.z]);if(tt.setAttribute("position",new mt(Qe,3)),p===".txt"){const O=new Wi({color:"#5B5C99",size:1,sizeAttenuation:!1});g=new Qr(tt,O)}else if(p===".cpt"){const O=new Ci({color:"#5B5C99",linewidth:100});g=new Vl(tt,O)}}else if(p===".obj"){const _e=new Eo;if(m&&m.length>0){const we=new Ao;for(const ke of m){const tt=await ke.text(),Qe=we.parse(tt);Qe.preload(),_e.setMaterials(Qe);break}}g=_e.parse(S),(!m||m.length===0)&&g.traverse(we=>{we.isMesh&&(we.material=new bn({color:"#B3B3D4"})),we instanceof Ct&&(we.material.side=pn)})}break;case".stl":const E=await f.arrayBuffer(),N=new da().parse(E),C=new bn({color:"#B3B3D4",side:pn});g=new Ct(N,C);break;case".nc":const T=["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"],L={"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 Jn,x=T.map(_e=>new Promise((we,ke)=>{new da().load(Zh.value===""?`/model/${_e}`:`${Zh.value}\\${_e}`,Qe=>{const O=new bn({color:L[_e]||"#B3B3D4",side:pn}),bt=new Ct(Qe,O);we(bt)},void 0,ke)}));try{(await Promise.all(x)).forEach(we=>b.add(we)),g=b}catch(_e){throw console.error("加载NC文件对应的STL文件失败:",_e),new Error("无法加载.NC文件对应的STL文件")}break;case".pcd":const R=new O3,B=new Jn;try{const _e=await ue.axios.get("http://139.196.154.85:20026/chfs/shared/重大专项/重大专项文件/target.pcd",{responseType:"blob",headers:{"Content-Type":"application/json"}}),we=new Blob([_e.data],{type:"application/octet-stream;charset=UTF-8"}),ke=await ue.axios.get("http://139.196.154.85:20026/chfs/shared/重大专项/重大专项文件/final.pcd",{responseType:"blob",headers:{"Content-Type":"application/json"}}),tt=new Blob([ke.data],{type:"application/octet-stream;charset=UTF-8"}),Qe=await new Promise((bt,$)=>{const pe=URL.createObjectURL(we);R.load(pe,te=>{const Se=new Float32Array(te.geometry.attributes.position.count*3);for(let he=0;he<te.geometry.attributes.position.count;he++)Se[he*3]=1,Se[he*3+1]=0,Se[he*3+2]=0;te.geometry.setAttribute("color",new Gt(Se,3)),te.material.vertexColors=!0,te.scale.set(.3,.3,.3),URL.revokeObjectURL(pe),bt(te)},void 0,$)}),O=await new Promise((bt,$)=>{const pe=URL.createObjectURL(tt);R.load(pe,te=>{const Se=new Float32Array(te.geometry.attributes.position.count*3);for(let he=0;he<te.geometry.attributes.position.count;he++)Se[he*3]=0,Se[he*3+1]=1,Se[he*3+2]=0;te.geometry.setAttribute("color",new Gt(Se,3)),te.material.vertexColors=!0,te.scale.set(.3,.3,.3),URL.revokeObjectURL(pe),bt(te)},void 0,$)});B.add(Qe),B.add(O),g=B}catch(_e){throw console.error("PCD文件加载失败:",_e),new Error("无法加载PCD文件")}break;case".urdf":const V=URL.createObjectURL(f),W=new G3,ee="http://139.196.154.85:20026/chfs/shared/机器人/urdf/SmallBender_R-2000iC-165F/meshes",k={maxConcurrentLoads:4,enableCache:!0,enableLOD:!0,simplifyGeometry:!0,shareMaterials:!0,enableInstancing:!0},Q=new Map,q=new Map,de=new Map,ye=async _e=>{if(Q.has(_e))return console.log(`从缓存加载: ${_e}`),Q.get(_e);try{const we=await ue.axios.get(`${ee}/${_e}`,{responseType:"blob",headers:{"Content-Type":"application/json"},timeout:6e5}),ke=new Blob([we.data],{type:"application/octet-stream;charset=UTF-8"});return k.enableCache&&Q.set(_e,ke),ke}catch(we){throw console.error(`加载文件失败: ${_e}`,we),new Error(`无法加载文件: ${_e}`)}},le=(_e="default")=>{if(q.has(_e))return q.get(_e);const we=new bn({color:12303291,shininess:30,transparent:!1,alphaTest:.1,side:Hn});return q.set(_e,we),we},Pe=_e=>{try{_e.isBufferGeometry&&_e.mergeVertices&&_e.mergeVertices(),_e.computeVertexNormals&&_e.computeVertexNormals(),_e.computeBoundingSphere&&_e.computeBoundingSphere(),_e.deleteAttribute&&_e.deleteAttribute("uv2")}catch(we){console.warn("几何体优化失败,使用原始几何体:",we)}return _e},Te=async(_e,we,ke)=>{const tt=`stl_${we}`;if(de.has(tt)){const $=de.get(tt);return new Ct($,le())}const Qe=await _e.arrayBuffer();let bt=new da(ke).parse(Qe);return bt=Pe(bt),de.set(tt,bt),new Ct(bt,le())},Y=async(_e,we,ke)=>{const tt=`obj_${we}`;if(Q.has(tt))return Q.get(tt).clone();const Qe=await _e.text(),O=new Eo(ke),bt=we.replace(".obj",".mtl");try{const te=await(await ye(bt)).text(),he=new Ao(ke).parse(te);he.preload(),O.setMaterials(he)}catch{console.warn(`MTL文件加载失败,使用默认材质: ${bt}`)}const $=O.parse(Qe);return $.traverse(pe=>{pe.isMesh&&(pe.geometry=Pe(pe.geometry),pe.castShadow=!0,pe.receiveShadow=!0,pe.renderOrder=1)}),Q.set(tt,$),$},re=(_e,we)=>{const ke=new Ep;if(ke.addLevel(_e,0),_e.geometry){const tt=_e.geometry.clone(),Qe=new Ct(tt,_e.material);ke.addLevel(Qe,50)}return ke};let ae=0,oe=0;const Ee=[];W.loadMeshCb=async(_e,we,ke,tt,Qe)=>{const O=_e.split("/").pop(),bt=ke||(()=>{});ae++;const $=new Promise(async(pe,te)=>{try{const Se=await ye(O);if(!Se||Se.size===0)throw new Error(`文件为空: ${O}`);const he=O.split(".").pop().toLowerCase();let ce;switch(he){case"stl":ce=await Te(Se,O,we);break;case"obj":ce=await Y(Se,O,we);break;default:throw new Error(`不支持的文件格式: ${he}`)}k.enableLOD&&ce.isMesh&&(ce=re(ce,O)),bt(ce),oe++,tt&&tt({loaded:oe,total:ae,progress:oe/ae}),pe(ce)}catch(Se){console.error(`mesh文件加载失败: ${O}`,Se);const he=new Jn;bt(he),pe(he);const ce=new Ki(.1,.1,.1),Ue=new Yp({color:16711680,wireframe:!0});return new Ct(ce,Ue)}});Ee.push($)};try{if(!V){ia.value=void 0;break}if(g=await W.loadAsync(V),console.log(`URDF文件加载完成,等待${ae}个mesh文件加载...`),Ee.length>0)try{await Promise.allSettled(Ee),console.log(`所有mesh文件处理完成,成功加载: ${oe}/${ae}`)}catch(_e){console.warn("部分mesh文件加载失败,但继续显示模型",_e)}g.traverse(_e=>{_e.isMesh&&(_e.castShadow=!0,_e.receiveShadow=!0,_e.renderOrder=1,_e.material&&(_e.material.needsUpdate=!0))}),ia.value=g,console.log("URDF模型加载完成并优化")}catch(_e){console.error("URDF加载失败:",_e),ia.value=void 0}finally{V&&URL.revokeObjectURL(V)}break;default:throw new Error(`不支持的文件格式: ${d}`)}return g};return{addModelsFromUrls:c,loadModelByDefaultPath:async d=>{console.log(d);try{t.value=!0,n.value="正在加载模型...";const{scene:f}=r();if(!f)throw new Error("Scene not initialized");i(),await new Promise(_=>setTimeout(_,100));const m=[];for(let _=0;_<d.length;_++){const g=d[_],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:ia}}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>',(r=>{var e=(t=(t=document.getElementsByTagName("script"))[t.length-1]).getAttribute("data-injectcss"),t=t.getAttribute("data-disable-injectsvg");if(!t){var n,i,s,a,o,l=function(u,d){d.parentNode.insertBefore(u,d)};if(e&&!r.__iconfont__svg__cssinject__){r.__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(u){console&&console.log(u)}}n=function(){var u,d=document.createElement("div");d.innerHTML=r._iconfont_svg_string_4634042,(d=d.getElementsByTagName("svg")[0])&&(d.setAttribute("aria-hidden","true"),d.style.position="absolute",d.style.width=0,d.style.height=0,d.style.overflow="hidden",d=d,(u=document.body).firstChild?l(d,u.firstChild):u.appendChild(d))},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&&(s=n,a=r.document,o=!1,h(),a.onreadystatechange=function(){a.readyState=="complete"&&(a.onreadystatechange=null,c())})}function c(){o||(o=!0,s())}function h(){try{a.documentElement.doScroll("left")}catch{return void setTimeout(h,50)}c()}})(window);const Qu=ue.defineStore("formToTableComp",{state:()=>({selectArray:[],selectString:""}),actions:{setSelectArray(r){this.selectArray=r},setSelectString(r){this.selectString=r}}}),q3={class:"calculator-content"},j3={class:"calculator-child"},Y3={class:"calculator-child"},$3=J.defineComponent({__name:"calculator",setup(r){const e=J.ref(),t=J.ref();return J.onMounted(()=>{e.value=[{type:"Upload",label:"输入",name:"input"}],t.value=[{type:"Upload",label:"输出",name:"output"}]}),(n,i)=>(J.openBlock(),J.createElementBlock("div",q3,[J.createElementVNode("div",j3,[J.createVNode(jn.ssForm,{rowContents:e.value,isRowFlex:!0},null,8,["rowContents"])]),J.createElementVNode("div",Y3,[J.createVNode(jn.ssForm,{rowContents:t.value,isEdit:!1,isRowFlex:!0},null,8,["rowContents"])])]))}}),K3=El._export_sfc($3,[["__scopeId","data-v-73db0fe7"]]),ed=ue.defineStore("unit",{state:()=>({selectIndex:"",selectMenu:"",selectTitle:[]}),actions:{setSelectIndex(r){this.selectIndex=r},setSelectMenu(r){this.selectMenu=r},setSelectTitle(r){this.selectTitle=r}}}),td=(r,e)=>{let t=r,n=e;return Array.isArray(t)&&(t=t==null?void 0:t.map((i,s)=>{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=td(o,n))}),Object.assign(a,{id:s})}else return i})),t},nd=(r,e,t)=>{let n=r,i=e;return n=n==null?void 0:n.map((s,a)=>{var o,l;return!Array.isArray(s)||!((o=i==null?void 0:i[a])!=null&&o.label)&&!t||(s.unshift(((l=i==null?void 0:i[a])==null?void 0:l.label)??""),s.some(c=>Array.isArray(c))&&(s=s==null?void 0:s.map(c=>{var h;return Array.isArray(c)&&(c=nd(c,(h=i==null?void 0:i[a])==null?void 0:h.children,t)),c}))),s}),n},J3=(r,e,t)=>{if(e==="")return r==null?void 0:r.filter(n=>(n==null?void 0:n.id)!==t);{const n=e.split("-");return Z3(r,n,t)}},Z3=(r,e,t)=>{let n=r,i=e;return(i==null?void 0:i.length)===0?n=n==null?void 0:n.filter(s=>s.id!==t):n=n==null?void 0:n.map(s=>(s.id.toString()===(i==null?void 0:i[0])&&(i==null||i.shift(),s=id(s,i,t)),s)),n},id=(r,e,t)=>{var s,a;let n=r,i=e;return(i==null?void 0:i.length)===0?n.children=(s=n.children)==null?void 0:s.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=id(o,i,t)),o)),n},Q3=(r,e,t)=>{if(e==="")return t;{const n=e.split("-");return e_(r,n,t)}},e_=(r,e,t)=>{let n=r,i=e;return(i==null?void 0:i.length)===0?n=t:n=n==null?void 0:n.map(s=>(s.id.toString()===(i==null?void 0:i[0])&&(i==null||i.shift(),s=rd(s,i,t)),s)),n},rd=(r,e,t)=>{var s;let n=r,i=e;return(i==null?void 0:i.length)===0?n.children=t:n.children=(s=n.children)==null?void 0:s.map(a=>(a.id.toString()===(i==null?void 0:i[0])&&(i==null||i.shift(),a=rd(a,i,t)),a)),n},Ma=(r,e)=>r==null?void 0:r.map(n=>{var i,s,a,o,l,c;if(Array.isArray(n)?n=n:n=[n],(i=n==null?void 0:n.filter(h=>!(h!=null&&h.id)||typeof(h==null?void 0:h.id)=="string"))!=null&&i.every(h=>typeof h!="object"||h===null))return n;if((s=n==null?void 0:n.filter(h=>!(h!=null&&h.id)||typeof(h==null?void 0:h.id)=="string"))!=null&&s.some(h=>Array.isArray(h)))return n;{let h=[];if(h.push(n==null?void 0:n.find(u=>(u==null?void 0:u.id)&&typeof(u==null?void 0:u.id)=="number")),Array.isArray(e==null?void 0:e[0])){const u=(a=n==null?void 0:n.filter(d=>!(d!=null&&d.id)||typeof(d==null?void 0:d.id)=="string"))==null?void 0:a[0];(o=Tn.getColumnChild(ue.cloneDeep(e==null?void 0:e[0])))==null||o.forEach(d=>{h.push(u==null?void 0:u[(d==null?void 0:d.prop)??(d==null?void 0:d.label)??d])})}else{const u=(l=n==null?void 0:n.filter(d=>!(d!=null&&d.id)||typeof(d==null?void 0:d.id)=="string"))==null?void 0:l[0];(c=Tn.getColumnChild(ue.cloneDeep(e)))==null||c.forEach(d=>{h.push(u==null?void 0:u[(d==null?void 0:d.prop)??(d==null?void 0:d.label)??d])})}return h}}),t_=r=>{try{return JSON.parse(r),!0}catch{return!1}},Qh=(r,e)=>su(r,e),Yi=r=>{let e=[];function t(i){Array.isArray(i)&&(i==null||i.forEach(s=>{Array.isArray(s)||(s=[s]),s==null||s.forEach(a=>{!(a!=null&&a.children)||a.children.length===0?e.push(a.label):n(a.children)})}))}function n(i){i==null||i.forEach(s=>{!(s!=null&&s.children)||s.children.length===0?e.push(s.label):n(s.children)})}return t(r),e},n_=(r,e,t)=>{var i;let n=(i=ue.cloneDeep(r))==null?void 0:i.map(s=>(s=s.filter(a=>!(a!=null&&a.id)),s));return n=n==null?void 0:n.map(s=>{var a;return s=(a=s.map((o,l)=>{let c={};if(t!=null&&t.find(h=>h===e[l]))return c[e[l]]=o,c}))==null?void 0:a.filter(o=>o),s}),n},i_=(r,e)=>{var a,o;const t=ue.cloneDeep(r),n=(a=t==null?void 0:t.find(l=>(l==null?void 0:l.key)==="header"))==null?void 0:a.contents,i=(o=t==null?void 0:t.find(l=>(l==null?void 0:l.key)==="tableContents"))==null?void 0:o.contents;return n_(i,Yi(n).slice(0,Yi(n).length-1),e)},r_=r=>{let e={};return r==null||r.forEach(t=>{e[t.key]=t.value}),e},s_=r=>{var t;let e=[];return(t=ue.cloneDeep(r))==null||t.forEach(n=>{let i={};n==null||n.forEach(s=>{i[Object.keys(s)[0]]=Object.values(s)[0]}),e.push(i)}),e},a_=(r,e)=>{if(e!=null&&e[r])return e==null?void 0:e[r]},o_=async(r,e)=>{var o,l,c;if(!(r!=null&&r.extra))return;let t=(o=r==null?void 0:r.extra)==null?void 0:o.tableId,n=r==null?void 0:r.contents;const s=(c=(await ue.getInsofDataApi({key:{type:"data",pageKey:(l=r==null?void 0:r.extra)==null?void 0:l.pageKey,tableId:t,systemKey:sessionStorage.getItem("systemKey")}})).data.result)==null?void 0:c.map(h=>h==null?void 0:h.id);s&&(s==null?void 0:s.length)>0&&await ue.batchDeleteInsofDataApi({ids:s});let a=[];n==null||n.forEach(h=>{var d,f;let u={};(d=Object.keys(h))==null||d.forEach(m=>{e!=null&&e.find(_=>(_==null?void 0:_.label.toUpperCase())===m.toUpperCase())&&(u[e.find(_=>_.label.toUpperCase()===m.toUpperCase()).label]=h[m])}),a.push({key:{type:"data",pageKey:(f=r==null?void 0:r.extra)==null?void 0:f.pageKey,tableId:t,systemKey:sessionStorage.getItem("systemKey")},value:{tableData:u}})}),(a==null?void 0:a.length)>0&&await ue.batchAddInsofDataApi({dataList:a})},l_=(r,e)=>{var s;let t=ue.cloneDeep(r),n=!1,i=Object.keys(e);return(s=t.compData)==null||s.forEach(a=>{var o;Array.isArray(a==null?void 0:a.contents)&&((o=a==null?void 0:a.contents)==null||o.forEach(l=>{n=i.includes(l.key)}))}),n},c_=(r,e)=>{var i;let t=ue.cloneDeep(r);return l_(ue.cloneDeep(t),e)&&(t.compData=(i=t.compData)==null?void 0:i.map(s=>{var a;return(s==null?void 0:s.key)==="formContent"&&(s.contents=(a=s==null?void 0:s.contents)==null?void 0:a.map(o=>(Object.keys(e).includes(o.key)&&(o.value=e[o.key]),o))),s})),t},h_=r=>{let e=ue.cloneDeep(r);return e==null||e.forEach(t=>{let n={};for(let i in t)n[i.toUpperCase()]=t[i]}),e},u_=async r=>{var a,o,l,c,h;let e=(o=(a=r==null?void 0:r[0])==null?void 0:a.find(u=>u==null?void 0:u.id))==null?void 0:o.id;const t=await ue.getInsofDataApi({id:e});let n=await((h=(c=(l=t==null?void 0:t.data)==null?void 0:l.result)==null?void 0:c[0])==null?void 0:h.key),i=n==null?void 0:n.pageKey,s=n==null?void 0:n.tableId;return{pageKey:i,tableId:s}},d_=async r=>{let e={comp:r==null?void 0:r.comp,compData:r==null?void 0:r.compData,name:r==null?void 0:r.name};await ue.updateInsofDataApi({id:r==null?void 0:r.id,value:{pageData:e}})},f_=async r=>{let e=r==null?void 0:r.map(async t=>{var i,s,a;let n;return(t==null?void 0:t.comp)==="Form"?n=await d_(t):(t==null?void 0:t.comp)==="Table"&&(n=await o_((i=t==null?void 0:t.compData)==null?void 0:i.find(o=>(o==null?void 0:o.key)==="tableContents"),(a=(s=t==null?void 0:t.compData)==null?void 0:s.find(o=>(o==null?void 0:o.key)==="header"))==null?void 0:a.contents)),n});await Promise.all(e)},p_=async r=>{var t,n,i,s;let e="";if((n=(t=ue.cloneDeep(r))==null?void 0:t.split("/"))==null||n.forEach((a,o)=>{var l,c;o!==((c=(l=ue.cloneDeep(r))==null?void 0:l.split("/"))==null?void 0:c.length)-1&&(e=e===""?e+a:e+"/"+a)}),e!==""){let a="";const o=await ba(e,sessionStorage.getItem("systemKey"),"");(s=(i=o==null?void 0:o[0])==null?void 0:i.compData)==null||s.forEach(l=>{var c;(l==null?void 0:l.key)==="tableContents"&&((c=l==null?void 0:l.contents)==null||c.forEach((h,u)=>{if(u===0){let d=h==null?void 0:h.filter(f=>!(f!=null&&f.id));a=e+"/"+(d==null?void 0:d[0])}}))}),await Tn.loadingConstruct(a,r)}},m_=r=>{var i,s,a,o;const e=r;let t=[];e.compData=(i=e.compData)==null?void 0:i.filter(l=>(l==null?void 0:l.key)!=="tableContents"&&(l==null?void 0:l.key)!=="tableIndex");const n=(a=(s=ue.cloneDeep(e.compData))==null?void 0:s.find(l=>(l==null?void 0:l.key)==="tableIndexColumn"))==null?void 0:a.contents;return(o=ue.cloneDeep(e.compData))==null||o.forEach(l=>{if((l==null?void 0:l.key)!=="tableIndexColumn"&&(l==null?void 0:l.key)!=="header")t.push(l);else if((l==null?void 0:l.key)==="header"){let c=l.contents;n&&(c!=null&&c.every(h=>Array.isArray(h))?c==null||c[0].unshift({label:n}):c.unshift({label:n})),t.push({key:"header",contents:c})}}),e.compData=t,e},g_=r=>{var s,a,o,l,c;const e=(s=r.compData)==null?void 0:s.filter(h=>(h==null?void 0:h.key)==="tableContents"||(h==null?void 0:h.key)==="tableIndex"),t=(o=(a=e==null?void 0:e.find(h=>(h==null?void 0:h.key)==="tableIndex"))==null?void 0:a.contents)==null?void 0:o.map(h=>h.label),n=(l=e==null?void 0:e.find(h=>(h==null?void 0:h.key)==="tableContents"))==null?void 0:l.contents;let i=[];return(t==null?void 0:t.length)>0&&(n!=null&&n.every(h=>Array.isArray(h)))?i=t==null?void 0:t.map((h,u)=>n[u]?[h,...n[u]]:[h]):Array.isArray(n==null?void 0:n[0])&&((c=n==null?void 0:n[0])!=null&&c.every(h=>Array.isArray(h)))?i=n==null?void 0:n[0]:Array.isArray(n==null?void 0:n[0])?i=n:i.push(n),i},__=r=>{const e=[];function t(n){!n||n.length===0||(e.push(n==null?void 0:n.map(i=>({label:i.label}))),n==null||n.forEach(i=>{i!=null&&i.children&&(i==null?void 0:i.children.length)>0&&t(i==null?void 0:i.children)}))}return t(r),e},v_=r=>{const e=[];function t(n,i=[]){!n||n.length===0||(e.push({key:i==null?void 0:i.filter(s=>!Array.isArray(s)),value:n}),n==null||n.forEach(s=>{s!=null&&s.some(a=>Array.isArray(a))&&t(s.find(a=>Array.isArray(a)),s)}))}return t(r),e},y_=r=>{const e=[];function t(n){!n||n.length===0||(e.push(n==null?void 0:n.map(i=>i==null?void 0:i.filter(s=>!Array.isArray(s)))),n==null||n.forEach(i=>{i!=null&&i.some(s=>Array.isArray(s))&&t(i.find(s=>Array.isArray(s)))}))}return t(r),e},x_=r=>{const e=[];function t(n){var i;!n||n.length===0||(n!=null&&n.every(s=>!Array.isArray(s))?e.push(n):(e.push((i=n==null?void 0:n.map(s=>s==null?void 0:s.filter(a=>!Array.isArray(a))))==null?void 0:i[0]),n==null||n.forEach(s=>{s!=null&&s.some(a=>Array.isArray(a))&&t(s.find(a=>Array.isArray(a)))})))}return t(r),e},M_=(r,e)=>{let t;function n(i,s,a=1){var l;if(!i||i.length===0)return;const o=(l=ue.cloneDeep(s))==null?void 0:l.map(c=>c==null?void 0:c.filter(h=>!Array.isArray(h)));return o!=null&&o.find(c=>Qh(c,i==null?void 0:i.key))?(s==null||s.forEach(c=>{!n(i,c.find(u=>Array.isArray(u)))&&Qh(c.filter(u=>!Array.isArray(u)),i==null?void 0:i.key)&&(t={type:a,contents:c.filter(u=>!Array.isArray(u))})}),!0):!1}return n(r,e,0),t},eu=(r,e)=>{function t(n,i){return!n||n.length===0||n==null?void 0:n.map((a,o)=>{var c,h;let l=a;return l.unshift((c=i==null?void 0:i[o])==null?void 0:c.label),l.some(u=>Array.isArray(u))&&(l[l.length-1]=t(l.find(u=>Array.isArray(u)),(h=i==null?void 0:i[o])==null?void 0:h.children)),l})}return t(r,e)},b_=r=>{var t,n,i,s,a,o,l,c,h,u,d,f,m,_,g,p,S,E,v,N,C,T,L,b,x;const e=r;if((r==null?void 0:r.comp)==="Table"){if((i=(n=(t=r.compData)==null?void 0:t.find(R=>(R==null?void 0:R.key)==="tableIndex"))==null?void 0:n.contents)!=null&&i.every(R=>!(R!=null&&R.children))||!((s=r.compData)!=null&&s.find(R=>(R==null?void 0:R.key)==="tableIndex")))return((l=(o=(a=e.compData)==null?void 0:a.find(R=>(R==null?void 0:R.key)==="tableContents"))==null?void 0:o.contents)==null?void 0:l.length)===1&&((d=(u=(h=(c=e.compData)==null?void 0:c.find(R=>(R==null?void 0:R.key)==="tableContents"))==null?void 0:h.contents)==null?void 0:u[0])!=null&&d.every(R=>Array.isArray(R)))?(e.compData=(f=e.compData)==null?void 0:f.map(R=>{var B;return(R==null?void 0:R.key)==="tableContents"&&(R.contents=(B=R.contents)==null?void 0:B[0]),R}),[e]):[e];{let R=[];const B=e.compData,V=(m=ue.cloneDeep(B))==null?void 0:m.find(le=>(le==null?void 0:le.key)==="tableIndexColumn"),W=(_=ue.cloneDeep(B))==null?void 0:_.find(le=>(le==null?void 0:le.key)==="extraButton"),ee=(g=ue.cloneDeep(B))==null?void 0:g.find(le=>(le==null?void 0:le.key)==="rowButton"),k=x_((S=(p=ue.cloneDeep(B))==null?void 0:p.find(le=>(le==null?void 0:le.key)==="header"))==null?void 0:S.contents),Q=(E=ue.cloneDeep(B))==null?void 0:E.find(le=>(le==null?void 0:le.key)==="tableIndex"),q=y_((N=(v=ue.cloneDeep(B))==null?void 0:v.find(le=>(le==null?void 0:le.key)==="tableContents"))==null?void 0:N.contents),de=eu((T=(C=ue.cloneDeep(B))==null?void 0:C.find(le=>(le==null?void 0:le.key)==="tableContents"))==null?void 0:T.contents,Q==null?void 0:Q.contents),ye=v_(eu((b=(L=ue.cloneDeep(B))==null?void 0:L.find(le=>(le==null?void 0:le.key)==="tableContents"))==null?void 0:b.contents,Q==null?void 0:Q.contents));if(Q)return(x=__(Q.contents))==null||x.forEach((le,Pe)=>{var Y;let Te=[];Te.push({key:"tableIndex",contents:le}),Te.push(V),Te.push(W),Te.push(ee),Te.push({key:"tableContents",contents:q[Pe]}),Te.push({key:"header",contents:k!=null&&k[Pe]?[k==null?void 0:k[Pe]]:[k==null?void 0:k[0]]}),R.push({comp:"Table",compData:Te,name:"",parentTableContents:((Y=M_(ye[Pe],de))==null?void 0:Y.contents)??""})}),R}}else return[e]},cs=(r,e)=>{let t={};return Array.isArray(r)?r==null||r.forEach((n,i)=>{e!=null&&e[i]&&(t[e[i]]=n)}):[r].forEach((n,i)=>{t[e[i]]=n}),t},S_=r=>{var t,n;let e="";return(n=(t=ue.cloneDeep(r))==null?void 0:t.split("/"))==null||n.forEach((i,s)=>{var a,o;s<((o=(a=ue.cloneDeep(r))==null?void 0:a.split("/"))==null?void 0:o.length)-1&&(e=e===""?e+i:e+"/"+i)}),e},E_=async r=>{const e=ue.cloneDeep(r);let t=[],n=[];e==null||e.forEach(i=>{!(n!=null&&n.find(s=>(s==null?void 0:s.parentKey)===(i==null?void 0:i.parentKey)))&&(i==null?void 0:i.parentKey)!==""&&n.push(i)}),n=n==null?void 0:n.map(i=>{var s;return i.content=(s=i.content)==null?void 0:s.map(a=>{var o;return a.key={pageKey:(i==null?void 0:i.parentKey)??"",systemKey:((o=a.key)==null?void 0:o.systemKey)??"",version:1,type:"subStructure"},a}),i.content}),(n==null?void 0:n.length)>0&&(t=n==null?void 0:n.map(async i=>{let s;return(i==null?void 0:i.length)>0&&(s=await ue.batchAddInsofDataApi({dataList:i})),s})),await Promise.all(t)},Sl=ue.useMenuState(ue.pinia),{activeMenuPath:A_}=ue.storeToRefs(Sl),w_=async(r,e)=>{var c,h,u,d,f,m,_,g,p,S,E,v,N,C,T,L;const t=(h=(c=r==null?void 0:r.find(b=>(b==null?void 0:b.key)==="header"))==null?void 0:c.contents)==null?void 0:h.find(b=>b==null?void 0:b.columnPath);let n=(d=(u=ue.cloneDeep(t==null?void 0:t.columnPath))==null?void 0:u.split("["))==null?void 0:d[0],i=(p=(g=(_=(m=(f=ue.cloneDeep(t==null?void 0:t.columnPath))==null?void 0:f.split("["))==null?void 0:m[1])==null?void 0:_.split("]"))==null?void 0:g[0])==null?void 0:p.replaceAll("'",""),s=[];const a=await ue.getInsofDataApi({key:{pageKey:n,systemKey:sessionStorage.getItem("systemKey"),type:"structure"}}),o=await ue.getInsofDataApi({key:{pageKey:A_.value,systemKey:sessionStorage.getItem("systemKey"),tableId:parseInt(e),type:"data"}}),l=[];if((E=(S=o==null?void 0:o.data)==null?void 0:S.result)==null||E.forEach(b=>{l.push([{id:b==null?void 0:b.id},b.value.tableData])}),Array.isArray((v=a==null?void 0:a.data)==null?void 0:v.result)&&((C=(N=a==null?void 0:a.data)==null?void 0:N.result)==null?void 0:C.length)>0){const b=await((L=(T=a==null?void 0:a.data)==null?void 0:T.result)==null?void 0:L.map(async x=>{var R,B,V,W,ee,k,Q,q,de,ye,le,Pe,Te,Y,re;if(((B=(R=x==null?void 0:x.value)==null?void 0:R.pageData)==null?void 0:B.name)===i){s=ue.cloneDeep((W=(V=x==null?void 0:x.value)==null?void 0:V.pageData)==null?void 0:W.compData);const ae=await ue.getInsofDataApi({key:{pageKey:n,systemKey:sessionStorage.getItem("systemKey"),tableId:x==null?void 0:x.id,type:"data"}}),oe=(k=(ee=ae==null?void 0:ae.data)==null?void 0:ee.result)==null?void 0:k.map(ke=>{var Qe;let tt=[];return tt.push({id:ke==null?void 0:ke.id}),tt.push((Qe=ke==null?void 0:ke.value)==null?void 0:Qe.tableData),tt});let Ee=Ma(l,(ye=(de=(q=(Q=x==null?void 0:x.value)==null?void 0:Q.pageData)==null?void 0:q.compData)==null?void 0:de.find(ke=>(ke==null?void 0:ke.key)==="header"))==null?void 0:ye.contents),_e=!1;_e=((le=ue.cloneDeep(Ee))==null?void 0:le.map(ke=>ke.slice(1))).every(ke=>ke.every(tt=>tt===void 0)),_e?s.push({key:"tableContents",contents:Ma(oe,(re=(Y=(Te=(Pe=x==null?void 0:x.value)==null?void 0:Pe.pageData)==null?void 0:Te.compData)==null?void 0:Y.find(ke=>(ke==null?void 0:ke.key)==="header"))==null?void 0:re.contents)}):s.push({key:"tableContents",contents:Ee})}}));await Promise.all(b)}return s},ba=async(r,e,t="",n=!1,i)=>{var f,m,_,g,p,S,E;let s;s=await ue.getInsofDataApi({key:{pageKey:r,systemKey:e,parentTable:t}});const a=await ue.getInsofDataApi({key:{pageKey:r,systemKey:e,type:"structureMethod"}}),o=(m=(f=s==null?void 0:s.data)==null?void 0:f.result)==null?void 0:m.map(v=>v.id);if(!o)return;const l=o==null?void 0:o.map(v=>ue.getInsofDataApi({key:{pageKey:r,systemKey:e,type:"data",tableId:v}})),c=await Promise.all(l),h=[];c==null||c.forEach(v=>{var T,L,b,x;const N=(T=v.data.result)==null?void 0:T.map(R=>{const B=Array.isArray(R.value.tableData)?R.value.tableData:[R.value.tableData];return B.unshift({id:R.id}),B}),C=(x=(b=(L=v.data.result)==null?void 0:L[0])==null?void 0:b.key)==null?void 0:x.tableId;h.push({key:C,contents:N})});let u=[];const d=await((_=s.data.result)==null?void 0:_.map(async v=>{var L,b,x,R,B,V;const N=v.value.pageData,C=v==null?void 0:v.id;let T=(L=ue.cloneDeep(N.compData))==null?void 0:L.filter(W=>(W==null?void 0:W.key)!=="tableContents");if(T&&(T!=null&&T.find(W=>(W==null?void 0:W.key)==="header"))&&((x=(b=T==null?void 0:T.find(W=>(W==null?void 0:W.key)==="header"))==null?void 0:b.contents)!=null&&x.every(W=>!(W!=null&&W.columnPath)))?T.push({key:"tableContents",contents:Ma((R=h==null?void 0:h.find(W=>(W==null?void 0:W.key)===v.id))==null?void 0:R.contents,(B=T==null?void 0:T.find(W=>(W==null?void 0:W.key)==="header"))==null?void 0:B.contents)}):T&&(T!=null&&T.find(W=>(W==null?void 0:W.key)==="header"))&&(T=await w_(ue.cloneDeep(T),C)),N.compData=T,N.id=v.id,((V=v.key)==null?void 0:V.type)!=="method")u.push(N);else{let W;W={name:"",compData:[N],comp:"calculator"},u.push(W)}}));return await Promise.all(d),((p=(g=a.data.result)==null?void 0:g.map(v=>v.value.pageData))==null?void 0:p.filter(v=>Object.values(v).length>0).length)>0&&u.push({comp:"methodButton",name:"",compData:(E=(S=a.data.result)==null?void 0:S.map(v=>v.value.pageData))==null?void 0:E.filter(v=>Object.values(v).length>0)}),u=u.sort((v,N)=>v.id-N.id),u},T_=async r=>{await ue.deleteInsofDataApi({id:r})},C_=async(r,e,t,n,i,s,a)=>{var l,c,h,u,d,f,m,_,g,p,S,E,v;const o=((c=(l=a==null?void 0:a.content)==null?void 0:l[0])==null?void 0:c.id)??"";if(o!==""&&((h=a==null?void 0:a.content)==null?void 0:h.length)>1){const N=await ue.getInsofDataApi({id:o});let C=((m=(f=(d=(u=N==null?void 0:N.data)==null?void 0:u.result)==null?void 0:d[0])==null?void 0:f.key)==null?void 0:m.tableId)??"",T=((S=(p=(g=(_=N==null?void 0:N.data)==null?void 0:_.result)==null?void 0:g[0])==null?void 0:p.key)==null?void 0:S.pageKey)??"";await ue.createInsofDataApi({key:{type:r,pageKey:T,tableId:C,systemKey:n},value:{tableData:cs(i,(E=Yi(s))==null?void 0:E.filter(L=>L!=="操作"))}})}else await ue.createInsofDataApi({key:{type:r,pageKey:e,tableId:t,systemKey:n},value:{tableData:cs(i,(v=Yi(s))==null?void 0:v.filter(N=>N!=="操作"))}})},R_=async(r,e,t,n,i,s,a)=>{var h,u,d,f,m,_,g,p,S,E;const o=await ue.getInsofDataApi({id:n});let l=((f=(d=(u=(h=o==null?void 0:o.data)==null?void 0:h.result)==null?void 0:u[0])==null?void 0:d.key)==null?void 0:f.tableId)??"",c=((p=(g=(_=(m=o==null?void 0:o.data)==null?void 0:m.result)==null?void 0:_[0])==null?void 0:g.key)==null?void 0:p.pageKey)??"";l&&l!==""?await ue.updateInsofDataApi({key:{type:r,pageKey:c,tableId:l,systemKey:i},value:{tableData:cs(s,(S=Yi(a))==null?void 0:S.filter(v=>v!=="操作"))},id:n}):await ue.updateInsofDataApi({key:{type:r,pageKey:e,tableId:t,systemKey:i},value:{tableData:cs(s,(E=Yi(a))==null?void 0:E.filter(v=>v!=="操作"))},id:n})},D_=async(r,e)=>{await ue.updateInsofDataApi({value:{pageData:e},id:r})},P_=async(r,e)=>await ue.getInsofDataApi({key:r,valueLikes:e}),L_=async()=>{var r,e,t,n,i,s,a,o,l;try{const c=await ue.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),layer:"superAdmin"}});((r=c==null?void 0:c.data)==null?void 0:r.code)===200&&(Sl.setPlatform(((i=(n=(t=(e=c==null?void 0:c.data)==null?void 0:e.result)==null?void 0:t[0])==null?void 0:n.key)==null?void 0:i.systemType)==="制造系统"?"client":"browser"),Sl.setPlatName(((l=(o=(a=(s=c==null?void 0:c.data)==null?void 0:s.result)==null?void 0:a[0])==null?void 0:o.key)==null?void 0:l.name)??""))}catch(c){return Promise.reject(c)}},sd=ue.defineStore("modelTableComp",{state:()=>({tableIndex:0,tableShowThree:""}),actions:{setTableIndex(r){this.tableIndex=r},setTableShowThree(r){this.tableShowThree=r}}}),I_={class:"table-content"},N_={class:"menu-config-wrap"},U_=["onClick"],F_={class:"form-content"},O_={key:0,class:"dialog-footer"},z_={class:"dialog-footer"},B_={__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(r,{emit:e}){const t=r,n=e,i=J.ref([]),s=J.ref(!1),a=J.ref(),o=ue.useMenuState(),{activeMenuPath:l}=ue.storeToRefs(o),c=sd(ue.pinia),h=tu.useModelComp(ue.pinia),{extraContents:u}=ue.storeToRefs(h),d=J.ref([]);J.ref(!1);const f=J.ref("");J.ref();const m=J.ref(!0),_=J.ref(0),g=J.ref(!1),p=J.ref(""),S=J.ref(!1),E=J.ref({label:"查看三维模型"}),v=J.ref(!1),N=J.ref(),C=J.ref([]),T=J.ref([]),L=J.ref(!1),b=J.ref([]),x=J.ref([]),R=J.ref(),B=J.ref(),V=Qu(ue.pinia),W=J.ref(),ee=ed(ue.pinia),{selectIndex:k,selectMenu:Q,selectTitle:q}=ue.storeToRefs(ee),{selectString:de}=ue.storeToRefs(V),ye=J.ref(720),le=()=>{S.value=!1},Pe=$=>{n("clickTrigger",$)},Te=($,pe)=>{if(Object.values(pe).length!==0)return Object.values(pe).find(te=>{var Se,he,ce;return((Se=te==null?void 0:te.toString())==null?void 0:Se.includes(".txt"))||((he=te==null?void 0:te.toString())==null?void 0:he.includes(".cpt"))||((ce=te==null?void 0:te.toString())==null?void 0:ce.includes(".obj"))})?[...$,E.value]:$},Y=$=>{var he;de.value===""?$==null||$[0]:($==null?void 0:$.find(ce=>(ce==null?void 0:ce.selectLabel)==="("+de.value+")"))??($==null||$.find(ce=>!(ce!=null&&ce.selectLabel)));let pe=$;(he=i.value)!=null&&he.find(ce=>ce.prop==="index");let te=R.value;const Se=[];return pe==null||pe.forEach((ce,Ue)=>{var A;let U={};if(Array.isArray(ce)){let G=[];ce==null||ce.filter(z=>!(z!=null&&z.id)).forEach((z,se)=>{var ne,Ce,Ae,Be,Ve;if((ne=te==null?void 0:te[se])!=null&&ne.prop&&!Array.isArray(z)){let me={};me[te[se].column]=z,u!=null&&u.value&&((Ce=u==null?void 0:u.value)==null?void 0:Ce.length)>0&&((Ae=u==null?void 0:u.value)!=null&&Ae.find(De=>JSON.stringify(De==null?void 0:De[0])===JSON.stringify(me)))&&(G=(Be=u==null?void 0:u.value)==null?void 0:Be.find(De=>JSON.stringify(De==null?void 0:De[0])===JSON.stringify(me))),G&&G.length>0?U[te[se].prop]=G!=null&&G.find(De=>{var Ke;return((Ke=Object.keys(De))==null?void 0:Ke[0])===te[se].column})?(Ve=G==null?void 0:G.find(De=>{var Ke;return((Ke=Object.keys(De))==null?void 0:Ke[0])===te[se].column}))==null?void 0:Ve[te[se].column]:z:U[te[se].prop]=z}})}else U=ce;Array.isArray(ce)&&ce.some(G=>G==null?void 0:G.id)?Se.push(Object.assign(U,{id:(A=ce==null?void 0:ce.find(G=>G.id))==null?void 0:A.id})):U.id?Se.push(U):Se.push(Object.assign(U,{id:Ue}))}),Se},re=async $=>{var he,ce,Ue,U,A;let pe={};for(let G in $)$[G]!==""&&(pe["tableData."+G]=$[G]);const te=await P_({type:"data",tableId:t==null?void 0:t.index,systemKey:sessionStorage.getItem("systemKey"),pageKey:l.value},pe),Se=(Ue=(ce=(he=ue.cloneDeep(te))==null?void 0:he.data)==null?void 0:ce.result)==null?void 0:Ue.map(G=>{var se;let z=[];return z.push({id:G.id}),z.push((se=G==null?void 0:G.value)==null?void 0:se.tableData),z});d.value=Y(Ma(Se,(A=(U=ue.cloneDeep(i.value))==null?void 0:U.map(G=>G.label))==null?void 0:A.filter(G=>G!=="操作")))},ae=async $=>{var Se,he,ce,Ue,U,A,G,z,se,ne;const pe=(Se=ue.cloneDeep(i.value))==null?void 0:Se.filter(Ce=>Ce==null?void 0:Ce.isRoute);if((pe==null?void 0:pe.length)>0){let Ce=(he=pe==null?void 0:pe[0])==null?void 0:he.prop,Ae=l.value+"/"+($==null?void 0:$[Ce]),Be=l.value,Ve=await ba(Ae,sessionStorage.getItem("systemKey"),"");if((Ve==null?void 0:Ve.length)>0)h.setRouteToChildPath(Be),o.setActiveMenuPath(Ae);else{const me=await Tn.findFirstContent(t==null?void 0:t.index);me&&(Ae=l.value+"/"+(me==null?void 0:me[(ce=pe==null?void 0:pe[0])==null?void 0:ce.label]),await Tn.loadingConstruct(Ae,l.value+"/"+($==null?void 0:$[Ce])),h.setRouteToChildPath(Be),o.setActiveMenuPath(l.value+"/"+($==null?void 0:$[Ce])))}}let te=await ba(l.value,sessionStorage.getItem("systemKey"),$.id);if(te=te==null?void 0:te.filter(Ce=>Ce.comp!=="methodButton"),te&&te.length>0){const Ce=!Array.isArray(q.value)&&((Ue=q.value)==null?void 0:Ue.key)!=="main"?[]:q.value;Ce.push({key:Q.value===""?(U=$==null?void 0:$.id)==null?void 0:U.toString():Q.value+"-"+((A=$==null?void 0:$.id)==null?void 0:A.toString()),value:$[(G=Object.keys($))==null?void 0:G.filter(Ae=>Ae!=="index"&&Ae!=="id")[0]]}),ee.setSelectMenu(Q.value===""?(z=$==null?void 0:$.id)==null?void 0:z.toString():Q.value+"-"+((se=$==null?void 0:$.id)==null?void 0:se.toString())),ee.setSelectTitle(Ce),ee.setSelectIndex((ne=$==null?void 0:$.id)==null?void 0:ne.toString()),n("pageChange",te)}},oe=$=>{var pe;(pe=ue.cloneDeep(t.itemData))==null||pe.map(te=>((te==null?void 0:te.key)==="tableContents"&&(te.contents=$),te))},Ee=async($,pe,te,Se)=>{var he;if((Se==null?void 0:Se.data)==="查看"&&($!=null&&$.every(ce=>(ce==null?void 0:ce.url)&&(ce==null?void 0:ce.name)))){let ce=ue.cloneDeep($);ce=await((he=ue.cloneDeep(ce))==null?void 0:he.map(async U=>{var z,se,ne,Ce;const A=await jn.downloadAvatarApi({url:U==null?void 0:U.url});let G=URL.createObjectURL(A.data);return{name:(U==null?void 0:U.name)+"."+((Ce=(z=U==null?void 0:U.url)==null?void 0:z.split("."))==null?void 0:Ce[((ne=(se=U==null?void 0:U.url)==null?void 0:se.split("."))==null?void 0:ne.length)-1]),blobUrl:G}}));let Ue=await Promise.all(ce);a.value=Ue,s.value=!0}n("contentClick",$,pe,te,{id:t==null?void 0:t.index,type:"table"})},_e=()=>{s.value=!1},we=$=>{n("rowClick",$)};J.watch(()=>t.changedContent,()=>{var te,Se;if(!t.changedContent)return;let $=(te=d.value)==null?void 0:te.map(he=>{var ce;return he.id===((ce=t.changedContent)==null?void 0:ce.id)&&(he={...t.changedContent,id:t.changedContent.newId?t.changedContent.newId:t.changedContent.id},delete he.newId),he});const pe=(Se=t.itemData)==null?void 0:Se.map(he=>((he==null?void 0:he.key)==="tableContents"&&(he.contents=$),he));d.value=$,n("contentChange",{contents:pe,index:t.index}),n("change",{content:$,index:t==null?void 0:t.index,buttonName:"",id:t==null?void 0:t.index})},{deep:!0,immediate:!0});const ke=()=>{},tt=($,pe,te)=>{var Se,he,ce;if(f.value="",L.value=!0,m.value=!0,n("onButtonClick",$,pe),$==="删除"){d.value=(Se=ue.cloneDeep(d.value))==null?void 0:Se.filter(U=>(U==null?void 0:U.id)!==(pe==null?void 0:pe.id));const Ue=J3(W.value,Q.value,pe==null?void 0:pe.id);oe(Ue),n("change",{content:d.value,singleContent:pe,index:t==null?void 0:t.index,type:"delete",buttonName:$,column:i.value})}else if($==="新增")p.value="新增",Qe(""),S.value=!0;else if($==="编辑")p.value="编辑",Qe(pe),S.value=!0;else if($==="查看")p.value="查看",Qe(pe),L.value=!1,m.value=!1,S.value=!0;else if($==="查看三维模型"){const Ue={};for(let A in pe)A!=="id"&&(Ue[A]=pe[A]);let U=(he=Object.values(Ue))==null?void 0:he[1];c.setTableShowThree(U)}else((ce=te==null?void 0:te.extra)==null?void 0:ce.type)==="modelExample"&&(p.value=$,v.value=!0)},Qe=$=>{var he,ce,Ue,U,A,G;const pe=[];let te=[];for(let z in $)Array.isArray($==null?void 0:$[z])&&te.push(z);(ce=Tn.getColumnChild((he=ue.cloneDeep(i.value))==null?void 0:he.filter(z=>(z==null?void 0:z.label)!=="操作")))==null||ce.forEach((z,se)=>{var ne;te.find(Ce=>Ce===(z==null?void 0:z.prop))||(z!=null&&z.formType&&((ne=z==null?void 0:z.formType)==null?void 0:ne.toUpperCase())==="SELECT"?pe.push({label:(z==null?void 0:z.label)??"",name:(z==null?void 0:z.prop)??"t"+se,type:!(z!=null&&z.formType)||(z==null?void 0:z.formType)===""?"Input":z==null?void 0:z.formType,value:($==null?void 0:$[z==null?void 0:z.prop])??(z==null?void 0:z.value)??"",id:(z==null?void 0:z.id)??se,contents:(z==null?void 0:z.options)??[],width:1,isFormColHidden:z==null?void 0:z.isFormColHidden,optionUrl:{groupSelect:z==null?void 0:z.groupSelect,menuSelect:z==null?void 0:z.formMenuSelect,type:"Select",selectRelateType:z==null?void 0:z.selectRelateType}}):pe.push({label:(z==null?void 0:z.label)??"",name:(z==null?void 0:z.prop)??"t"+se,type:!(z!=null&&z.formType)||(z==null?void 0:z.formType)===""?"Input":z==null?void 0:z.formType,value:($==null?void 0:$[z==null?void 0:z.prop])??(z==null?void 0:z.value)??"",id:(z==null?void 0:z.id)??se,contents:(z==null?void 0:z.options)??[],width:1,isFormColHidden:z==null?void 0:z.isFormColHidden}))}),$===""||!$||(f.value=$==null?void 0:$.id);let Se=Tn.getColumnChild((Ue=ue.cloneDeep(i.value))==null?void 0:Ue.filter(z=>(z==null?void 0:z.label)!=="操作"));C.value&&((U=C.value)==null?void 0:U.length)>0&&(C.value=(A=ue.cloneDeep(C).value)==null?void 0:A.map(z=>{var ne;let se=(ne=Se==null?void 0:Se.find(Ce=>(Ce==null?void 0:Ce.label)===(z==null?void 0:z.label)))==null?void 0:ne.prop;return se&&(z.value=$[se]),z})),x.value=C.value&&((G=C.value)==null?void 0:G.length)>0?Tn.getTableFormToForm(C.value):pe};J.onMounted(()=>{N.value=window.innerWidth-240*2});const O=()=>{var he;let $=Tn.getColumnChild((he=ue.cloneDeep(i.value))==null?void 0:he.filter(ce=>(ce==null?void 0:ce.label)!=="操作")),pe,te=ue.cloneDeep(d.value);f.value===""?(_.value++,te.push(Object.assign(B.value,{id:_.value})),pe=Object.assign(B.value,{id:_.value})):te=te==null?void 0:te.map(ce=>{var Ue;if((ce==null?void 0:ce.id)===f.value){let U={};for(let A in ce){let G=(Ue=$==null?void 0:$.find(z=>(z==null?void 0:z.prop)===A))==null?void 0:Ue.label;G?U[A]=B.value[G]:U[A]=ce[A]}ce=Object.assign(U,B.value),pe=ce}return ce}),d.value=te;const Se=Q3(W.value,Q.value,te);oe(Se),S.value=!1,n("change",{content:Se,singleContent:pe,index:t==null?void 0:t.index,buttonName:p.value,column:i.value})},bt=$=>{B.value=$,n("onFormChange",$)};return J.watch(()=>[t.itemData,de.value,k.value,Q.value,u==null?void 0:u.value],()=>{var A,G,z,se,ne,Ce,Ae,Be,Ve,me,De,Ke,nt,Le,ct,H,Fe,ve,He,Me,ge,qe,ht,Dt,pt,en;const $=(A=ue.cloneDeep(t.itemData))==null?void 0:A.filter(je=>(je==null?void 0:je.key)==="header");(G=ue.cloneDeep(t.itemData))==null||G.filter(je=>(je==null?void 0:je.key)==="tableIndexColumn")[0];const pe=(z=ue.cloneDeep(t.itemData))==null?void 0:z.find(je=>(je==null?void 0:je.key)==="page"),te=(se=ue.cloneDeep(t.itemData))==null?void 0:se.find(je=>(je==null?void 0:je.key)==="rowButton"),Se=(ne=ue.cloneDeep(t.itemData))==null?void 0:ne.find(je=>(je==null?void 0:je.key)==="extraButton"),he=(Ce=ue.cloneDeep(t.itemData))==null?void 0:Ce.filter(je=>(je==null?void 0:je.key)==="tableContents"),ce=(Ae=ue.cloneDeep(t.itemData))==null?void 0:Ae.filter(je=>(je==null?void 0:je.key)==="tableIndex");C.value=(me=(Ve=(Be=ue.cloneDeep(t.itemData))==null?void 0:Be.filter(je=>(je==null?void 0:je.key)==="tableToForm"))==null?void 0:Ve[0])==null?void 0:me.contents,g.value=(pe==null?void 0:pe.contents)??!1;let Ue=[];de.value===""?Ue=$==null?void 0:$[0]:Ue=($==null?void 0:$.find(je=>(je==null?void 0:je.selectLabel)==="("+de.value+")"))??($==null?void 0:$.find(je=>!(je!=null&&je.selectLabel)));let U=[];if(de.value===""?U=ce==null?void 0:ce[0]:U=(ce==null?void 0:ce.find(je=>(je==null?void 0:je.selectLabel)==="("+de.value+")"))??(ce==null?void 0:ce.find(je=>!(je!=null&&je.selectLabel))),((De=Ue==null?void 0:Ue.contents)==null?void 0:De.length)>0){let je=[];if(Ue!=null&&Ue.contents.some(rt=>Array.isArray(rt)&&(rt==null?void 0:rt.find(Re=>Re.children))))Q.value===""?je=(nt=(Ke=Tn.getGradeColumns(ue.cloneDeep(Ue==null?void 0:Ue.contents)))==null?void 0:Ke[0])==null?void 0:nt.filter(rt=>!Array.isArray(rt)):(Q.value.split("-"),je=(Le=Tn.getGradeColumns(ue.cloneDeep(Ue==null?void 0:Ue.contents)))==null?void 0:Le[0]);else{const rt=Ue!=null&&Ue.contents.some(Re=>Array.isArray(Re))?(ct=Ue==null?void 0:Ue.contents)==null?void 0:ct[0]:Ue==null?void 0:Ue.contents;rt==null||rt.forEach((Re,Ht)=>{var nn;je.push({label:(Re==null?void 0:Re.label)??"",prop:(Re==null?void 0:Re.label)==="操作"?"operate":(Re==null?void 0:Re.prop)??"a"+Ht,width:Re!=null&&Re.width?parseInt(Re.width):"",fixed:(Re==null?void 0:Re.fixed)??void 0,sortable:(Re==null?void 0:Re.sortable)??!1,align:(Re==null?void 0:Re.align)??"center",showOverflowTooltip:(Re==null?void 0:Re.showOverflowTooltip)??!0,isNotDrag:(Re==null?void 0:Re.isNotDrag)??!1,isEditCol:(Re==null?void 0:Re.isEditCol)??!1,isOperate:(Re==null?void 0:Re.isOperate)??!1,id:(Re==null?void 0:Re.id)??Ht,type:(Re==null?void 0:Re.label)==="操作"?"operate":void 0,formType:(Re==null?void 0:Re.formType)??(Re!=null&&Re.groupSelect?"Select":""),isTableColHidden:Re==null?void 0:Re.isTableColHidden,isFormColHidden:Re==null?void 0:Re.isFormColHidden,options:(Re==null?void 0:Re.options)??[],value:(Re==null?void 0:Re.value)??"",formMenuSelect:(Re==null?void 0:Re.formMenuSelect)??[],isRoute:(Re==null?void 0:Re.isRoute)??!1,groupSelect:Re!=null&&Re.groupSelect?(nn=Re==null?void 0:Re.groupSelect)==null?void 0:nn.replaceAll('"',"").split(":"):[]})})}i.value=je;let Zt=(Fe=(H=Tn.getAllLeafNodes(ue.cloneDeep(i.value)))==null?void 0:H.filter(rt=>(rt==null?void 0:rt.type)!=="operate"))==null?void 0:Fe.map((rt,Re)=>({prop:(rt==null?void 0:rt.prop)??"a"+Re,column:rt.label}));R.value=Zt;let jt=[];de.value===""?jt=he==null?void 0:he[0]:jt=(he==null?void 0:he.find(rt=>(rt==null?void 0:rt.selectLabel)==="("+de.value+")"))??(he==null?void 0:he.find(rt=>!(rt!=null&&rt.selectLabel)));let tn=Array.isArray((ve=jt==null?void 0:jt.contents)==null?void 0:ve[0])&&((He=jt==null?void 0:jt.contents)!=null&&He[0].every(rt=>Array.isArray(rt)))?(Me=ue.cloneDeep(jt==null?void 0:jt.contents))==null?void 0:Me[0]:ue.cloneDeep(jt==null?void 0:jt.contents);U!=null&&U.contents&&((ge=U==null?void 0:U.contents)==null?void 0:ge.length)!==0&&(tn=(qe=ue.cloneDeep(tn))==null?void 0:qe.map((rt,Re)=>{if(!Array.isArray(rt)){let Ht={};for(let nn in rt)nn!=="id"&&nn!=="index"&&(Ht[nn]=rt[nn]);rt=Object.values(Ht)}return rt}));const Di=!!((ht=i.value)!=null&&ht.find(rt=>rt.prop==="index"));tn=nd(ue.cloneDeep(tn),U==null?void 0:U.contents,Di);const ti=[];tn==null||tn.forEach((rt,Re)=>{var nn;let Ht={};if(Array.isArray(rt)){let Wt=[];rt==null||rt.filter(hn=>!(hn!=null&&hn.id)).forEach((hn,En)=>{var Ji,Zi,Qi,er,tr,D;if((Ji=Zt==null?void 0:Zt[En])!=null&&Ji.prop&&!Array.isArray(hn)){let X={};X[Zt[En].column]=hn,u!=null&&u.value&&((Zi=u==null?void 0:u.value)==null?void 0:Zi.length)>0&&((Qi=u==null?void 0:u.value)!=null&&Qi.find(K=>JSON.stringify(K==null?void 0:K[0])===JSON.stringify(X)))&&(Wt=(er=u==null?void 0:u.value)==null?void 0:er.find(K=>JSON.stringify(K==null?void 0:K[0])===JSON.stringify(X))),Wt&&Wt.length>0?Ht[Zt[En].prop]=Wt!=null&&Wt.find(K=>{var Z;return((Z=Object.keys(K))==null?void 0:Z[0])===Zt[En].column})?(tr=Wt==null?void 0:Wt.find(K=>{var Z;return((Z=Object.keys(K))==null?void 0:Z[0])===Zt[En].column}))==null?void 0:tr[Zt[En].column]:hn:Ht[Zt[En].prop]=hn}else Array.isArray(hn)&&((D=Zt[En])!=null&&D.prop?Ht[Zt[En].prop]=hn:Ht.children=td(hn,Zt))})}else Ht=rt;Array.isArray(rt)&&rt.some(Wt=>Wt==null?void 0:Wt.id)?ti.push(Object.assign(Ht,{id:(nn=rt==null?void 0:rt.find(Wt=>Wt.id))==null?void 0:nn.id})):Ht.id?ti.push(Ht):ti.push(Object.assign(Ht,{id:Re}))}),d.value=ti}else i.value=[],d.value=[];((Dt=te==null?void 0:te.contents)==null?void 0:Dt.length)>0?T.value=te==null?void 0:te.contents:T.value=[],((pt=Se==null?void 0:Se.contents)==null?void 0:pt.length)>0?b.value=Se==null?void 0:Se.contents:b.value=[],_.value=((en=d==null?void 0:d.value)==null?void 0:en.length)??0,W.value=d.value},{deep:!0,immediate:!0}),J.watch(()=>t==null?void 0:t.operatingForm,$=>{$!=null&&$.form&&(Qe($==null?void 0:$.form),p.value=$==null?void 0:$.dialogTitle,L.value=!0,S.value=!0)},{immediate:!0,deep:!0}),($,pe)=>{var ce;const te=J.resolveComponent("el-icon"),Se=J.resolveComponent("el-popover"),he=J.resolveComponent("el-button");return J.openBlock(),J.createElementBlock("div",I_,[(J.openBlock(),J.createBlock(jn.ssTable,{columns:i.value,key:i.value,tableData:d.value,isShowPagination:g.value,isShowEdit:!1,isShowDelete:!1,onDbClickRow:ae,extraButton:b.value,onContentClick:Ee,onRowClick:we},J.createSlots({headerButton:J.withCtx(Ue=>[r.showHeader?(J.openBlock(),J.createBlock(Gd,{key:0,compName:r.compName,buttons:Ue.buttons,onButtonClick:pe[0]||(pe[0]=U=>tt(U,"",{})),columns:i.value,onFilter:re},null,8,["compName","buttons","columns"])):J.createCommentVNode("",!0)]),_:2},[((ce=T.value)==null?void 0:ce.length)>0?{name:"actions",fn:J.withCtx(({item:Ue})=>[J.createVNode(Se,{class:"box-item",title:"",placement:"left-start","popper-class":"menu-operate-popover"},{reference:J.withCtx(()=>[J.createVNode(te,null,{default:J.withCtx(()=>[J.createVNode(J.unref(ue.more_filled_default))]),_:1})]),default:J.withCtx(()=>[J.createElementVNode("div",N_,[(J.openBlock(!0),J.createElementBlock(J.Fragment,null,J.renderList(Te(T.value,Ue),(U,A)=>(J.openBlock(),J.createElementBlock("div",{class:"menu-config-item",key:A},[J.createElementVNode("div",{style:J.normalizeStyle({color:U==null?void 0:U.textColor}),class:"extra-button-label",onClick:G=>tt(U==null?void 0:U.label,Ue,{extra:U})},J.toDisplayString(U==null?void 0:U.label),13,U_)]))),128))])]),_:2},1024)]),key:"0"}:void 0]),1032,["columns","tableData","isShowPagination","extraButton"])),J.createVNode(jn.ssDialog,{title:p.value,visible:S.value,width:ye.value,onBeforeDestroy:le},{default:J.withCtx(()=>[J.createElementVNode("div",F_,[J.createVNode(jn.ssForm,{rowContents:x.value,isEnableWrap:!1,onChange:bt,onClickTrigger:Pe,isEdit:m.value},null,8,["rowContents","isEdit"])])]),footer:J.withCtx(()=>[L.value?(J.openBlock(),J.createElementBlock("div",O_,[J.createVNode(he,{onClick:pe[1]||(pe[1]=Ue=>S.value=!1),id:"themeBorderButton"},{default:J.withCtx(()=>pe[4]||(pe[4]=[J.createTextVNode(J.toDisplayString("取消"))])),_:1,__:[4]}),J.createVNode(he,{class:"ok-button",onClick:O,id:"themeButton"},{default:J.withCtx(()=>pe[5]||(pe[5]=[J.createTextVNode(J.toDisplayString("确认"))])),_:1,__:[5]})])):J.createCommentVNode("",!0)]),_:1},8,["title","visible","width"]),J.createVNode(jn.ssDialog,{title:p.value,visible:v.value,width:N.value,onBeforeDestroy:pe[3]||(pe[3]=Ue=>v.value=!1)},{default:J.withCtx(()=>[J.createVNode(K3)]),footer:J.withCtx(()=>[J.createElementVNode("div",z_,[J.createVNode(he,{onClick:pe[2]||(pe[2]=Ue=>v.value=!1),class:"cancel-button",id:"themeBorderButton"},{default:J.withCtx(()=>pe[6]||(pe[6]=[J.createTextVNode(J.toDisplayString("取消"))])),_:1,__:[6]}),J.createVNode(he,{class:"ok-button",onClick:ke,id:"themeButton"},{default:J.withCtx(()=>pe[7]||(pe[7]=[J.createTextVNode(J.toDisplayString("确认"))])),_:1,__:[7]})])]),_:1},8,["title","visible","width"]),s.value?(J.openBlock(),J.createBlock(jn.ssFilePreview,{key:0,fileDataList:a.value,onDestroy:_e},null,8,["fileDataList"])):J.createCommentVNode("",!0)])}}},k_=El._export_sfc(B_,[["__scopeId","data-v-c1156fac"]]);exports.ACESFilmicToneMapping=lu;exports.AmbientLight=Bu;exports.Box3=ei;exports.CatmullRomCurve3=Iu;exports.Color=st;exports.Controls=M0;exports.DirectionalLight=zu;exports.DoubleSide=pn;exports.Euler=yn;exports.GridHelper=x0;exports.HemisphereLight=h0;exports.IsJson=t_;exports.MOUSE=Wd;exports.MathUtils=Hi;exports.Matrix4=lt;exports.Mesh=Ct;exports.MeshPhongMaterial=bn;exports.PCFSoftShadowMap=ou;exports.PerspectiveCamera=ln;exports.Plane=Ei;exports.PlaneGeometry=us;exports.PointLight=Ou;exports.Quaternion=Dn;exports.Ray=Ur;exports.SRGBColorSpace=Tt;exports.Scene=Ol;exports.SetCache=ns;exports.ShadowMaterial=jp;exports.Spherical=ku;exports.TOUCH=Xd;exports.TubeGeometry=Wl;exports.Vector2=Ge;exports.Vector3=F;exports.WebGLRenderer=r3;exports.Xe=D3;exports.addTableContents=C_;exports.baseIsEqual=Al;exports.cacheHas=nu;exports.deleteTableContents=T_;exports.fixFormContents=D_;exports.fixTableContents=R_;exports.getColumnContents=Yi;exports.getFixExtraContent=u_;exports.getFormContents=r_;exports.getFormToContent=a_;exports.getFormToData=c_;exports.getItemData=ba;exports.getNewTableContents=h_;exports.getParentConstruct=E_;exports.getParentContents=p_;exports.getParentKey=S_;exports.getProjectContent=f_;exports.getTableToContent=s_;exports.getValueToObjectValue=cs;exports.isEqual=su;exports.loadingSystemType=L_;exports.methodTableToContent=i_;exports.setToArray=ru;exports.ssTable=k_;exports.tableEveryContents=b_;exports.tableToContents=g_;exports.tableToStruct=m_;exports.useFormToTableComp=Qu;exports.useModelLoader=X3;exports.useTableComp=sd;exports.useUnit=ed;
|