ss-component-new 1.2.180 → 1.2.182
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/{MTLLoader-CXA7QTWv.cjs → MTLLoader-BHi2OdAd.cjs} +1 -1
- package/dist/{MTLLoader-D_53cLhx.js → MTLLoader-Dw2z1N-1.js} +1 -1
- package/dist/{OrbitControls-DCg_XKUq.cjs → OrbitControls-D-mjLVSs.cjs} +1 -1
- package/dist/{OrbitControls-HQ0bwqSB.js → OrbitControls-D3hTFplM.js} +1 -1
- package/dist/{animationData-BR__-Ioy.cjs → animationData-CaZgUauJ.cjs} +1 -1
- package/dist/{animationData-DQDIEx5C.js → animationData-DhYJn422.js} +2 -2
- package/dist/{array-D73aF86e.cjs → array-BaQcwJTD.cjs} +1 -1
- package/dist/{array-BU4GqVWo.js → array-C_QRPq8X.js} +1 -1
- package/dist/{dataUtil-C5qhqwHE.cjs → dataUtil-DdKPfmZ6.cjs} +1 -1
- package/dist/{dataUtil-FQYCjLBK.js → dataUtil-DfYg8_9f.js} +1 -1
- package/dist/{iconfont-dNtx_miG.cjs → iconfont-DpQ8yZIY.cjs} +1 -1
- package/dist/{iconfont-BOjqL2W7.js → iconfont-DuWQY2Cq.js} +2 -2
- package/dist/{index-CxcI017f.js → index-1nURBe5J.js} +1 -1
- package/dist/{index-DaEu4qdY.cjs → index-3hTjOQ_A.cjs} +1 -1
- package/dist/{index-BADyCL8G.js → index-77RsiC4R.js} +5 -5
- package/dist/{index-yR7o_oo6.js → index-A5ztrSHU.js} +19 -19
- package/dist/{index-BP0ngXyO.cjs → index-B3op5lx-.cjs} +1 -1
- package/dist/{index-RM6GVrTz.js → index-B6znP61v.js} +7 -7
- package/dist/{index-BSxQ42mI.cjs → index-BAjzyphl.cjs} +1 -1
- package/dist/{index-BlFQrIws.cjs → index-BBV0eNYx.cjs} +1 -1
- package/dist/{index-lJzGt1Dn.cjs → index-BCb9U9d1.cjs} +1 -1
- package/dist/{index-Bc01SW7Y.cjs → index-BE5dk7z_.cjs} +1 -1
- package/dist/{index-BDPuOpGn.js → index-BGf6jKZc.js} +1 -1
- package/dist/{index-BkNR1hKs.cjs → index-BHry4qqc.cjs} +1 -1
- package/dist/{index-zrSuqwk5.js → index-BKV0QF5F.js} +3 -3
- package/dist/{index-Dr9VGyQB.cjs → index-BMHMXQ5U.cjs} +1 -1
- package/dist/{index-DV1q_VEz.cjs → index-BNoXaSh0.cjs} +1 -1
- package/dist/{index-ZxdGAI1A.js → index-BP5KlWAa.js} +2 -2
- package/dist/{index-Cs9xd8m5.js → index-BPGmXTse.js} +11 -11
- package/dist/{index-CNFJwX3J.js → index-BZ9ZRSe_.js} +2 -2
- package/dist/{index-CqrDkROm.js → index-BadGZDLw.js} +1 -1
- package/dist/{index-DrINxDjU.js → index-Bemqyfq_.js} +2 -2
- package/dist/{index-Cb1G8UIm.cjs → index-BevR3ISU.cjs} +1 -1
- package/dist/{index-Duv9cjAe.cjs → index-BfBkrIpR.cjs} +1 -1
- package/dist/{index-DnsOFiyJ.js → index-BwIDWHyh.js} +5 -5
- package/dist/{index-qOki_sPb.cjs → index-C4UuTGqh.cjs} +1 -1
- package/dist/{index-BYpFR6Jk.cjs → index-C7NykwOd.cjs} +1 -1
- package/dist/{index-CE_aV62U.js → index-CDkmKkwu.js} +1 -1
- package/dist/{index-BuFdDkbW.cjs → index-CDqwv1he.cjs} +1 -1
- package/dist/{index-C0EABxXj.cjs → index-CFXryldl.cjs} +1 -1
- package/dist/{index-taX8cpss.js → index-CI6XYnDp.js} +1 -1
- package/dist/{index-BL4JlOcE.js → index-CQEFScjn.js} +1 -1
- package/dist/{index-C8nWSMtf.js → index-CQpoN-3d.js} +1 -1
- package/dist/{index-IBAeK_pU.cjs → index-CdJaCSIs.cjs} +1 -1
- package/dist/{index-O2JP7gNg.js → index-CfpHq9QS.js} +5 -5
- package/dist/{index-CaGIv9UM.js → index-CpBek9Nk.js} +5 -5
- package/dist/{index-B_VUoYlm.js → index-CrpcBT-h.js} +1 -1
- package/dist/{index-BSsjP8qz.js → index-D1vpKtYm.js} +2 -2
- package/dist/{index-IRYU9rHG.js → index-D2u3fC_6.js} +2 -2
- package/dist/{index-B24QN3J9.cjs → index-D3AzA33E.cjs} +1 -1
- package/dist/{index-D3kgPZzY.cjs → index-DEObTy-c.cjs} +1 -1
- package/dist/{index-BD0hh3Pr.cjs → index-DF3VMCK4.cjs} +1 -1
- package/dist/{index-eMginJxQ.cjs → index-DHJSoNbm.cjs} +1 -1
- package/dist/{index-LTx33xrW.js → index-DM5cj1hh.js} +2 -2
- package/dist/{index-CK25mtS7.cjs → index-DOMZ9ZOi.cjs} +1 -1
- package/dist/{index-DQJmJ5mq.js → index-DYtEblI6.js} +1 -1
- package/dist/{index-D-d0T39d.js → index-Da95rxVD.js} +2 -2
- package/dist/{index-BWtrTMM8.cjs → index-Djm22R-D.cjs} +1 -1
- package/dist/{index-BMF4c5i9.js → index-DkEhch8Y.js} +3 -3
- package/dist/{index-Bd7PGSWY.cjs → index-DlR_1kJv.cjs} +1 -1
- package/dist/{index-Cj8vO7e4.js → index-DqGErN3T.js} +3574 -3557
- package/dist/index-DwFmfrjb.cjs +1 -0
- package/dist/{index-BCrRtlZ4.js → index-Dxyj7nmp.js} +4 -4
- package/dist/{index-s6VBsWtA.cjs → index-ISL-UVnN.cjs} +1 -1
- package/dist/{index-C5muQ26a.js → index-LZfLSC7I.js} +2 -2
- package/dist/{index-BABAeaYW.cjs → index-Pn67hYfX.cjs} +1 -1
- package/dist/{index-BfndLzU8.cjs → index-l_ENTbgJ.cjs} +1 -1
- package/dist/{index-B6Bt54lK.cjs → index-qDxh2Zo2.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-BZKhkTFt.cjs → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-BNJJKPM3.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-CWCJeRCj.js → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-Dtyyanh2.js} +11 -11
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BtrKm__x.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BFpx7u6S.cjs} +59 -59
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Bh_I-duN.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-yrPCQlhG.js} +1648 -1643
- package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-D-9uXgS2.js → index.vue_vue_type_style_index_0_scoped_92477073_lang-KMNdmfZ-.js} +5 -5
- package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-Bk8hx7Ey.cjs → index.vue_vue_type_style_index_0_scoped_92477073_lang-KYD5YbAR.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_1_lang-DH-Iu9hK.js → index.vue_vue_type_style_index_1_lang-BVwI1BjD.js} +4 -4
- package/dist/{index.vue_vue_type_style_index_1_lang-CAsnK-eC.cjs → index.vue_vue_type_style_index_1_lang-CBZtk7dZ.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_1_lang-DTc6vo-v.cjs → index.vue_vue_type_style_index_1_lang-CrR96PnG.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_1_lang-CRJd_NK8.js → index.vue_vue_type_style_index_1_lang-mHz69z2I.js} +1 -1
- package/dist/{main-D9n4PQwR.cjs → main-DuFC4tQg.cjs} +1 -1
- package/dist/{main-Cl5RdqO3.js → main-qSOVyloP.js} +4 -4
- package/dist/obj/model.mtl +42 -0
- package/dist/obj/model.obj +26110 -0
- package/dist/{pointTrack-DWtcUCsZ.js → pointTrack-BQtadsKC.js} +1 -1
- package/dist/{pointTrack-BYSR6plf.cjs → pointTrack-CofifdK0.cjs} +1 -1
- package/dist/{robotUtil-B9183iSX.js → robotUtil-D17XTLab.js} +1 -1
- package/dist/{robotUtil-D-bniJuz.cjs → robotUtil-_QqrIBBg.cjs} +1 -1
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.css +1 -1
- package/dist/ss-component.js +10 -10
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +11 -11
- package/dist/{threeModel-Bcjv8E3x.js → threeModel-B2YffWYe.js} +5 -5
- package/dist/{threeModel-9Dg-SYgW.cjs → threeModel-hryc7q6_.cjs} +1 -1
- package/dist/{threePreview-DCXyfxGq.js → threePreview-6q1Zqswb.js} +3 -3
- package/dist/{threePreview-CZlb-j0t.cjs → threePreview-Zy0qgnvN.cjs} +1 -1
- package/dist/{threeSceneView-Bb86B-iK.cjs → threeSceneView-CcczwKWP.cjs} +1 -1
- package/dist/{threeSceneView-O7vdDzH2.js → threeSceneView-DepAlijn.js} +11 -11
- package/dist/{threeSceneViewForCPMPIP-Dh84w6pL.cjs → threeSceneViewForCPMPIP-BUOAfvpW.cjs} +1 -1
- package/dist/{threeSceneViewForCPMPIP-CC6kvzsS.js → threeSceneViewForCPMPIP-L9rnZ1Km.js} +10 -10
- package/dist/{threeTrackPathView-CaG4sjqU.cjs → threeTrackPathView-C1RMwwOd.cjs} +1 -1
- package/dist/{threeTrackPathView-RLA4GNTW.js → threeTrackPathView-D-9crRyZ.js} +5 -5
- package/dist/{threeViewerHost-CQygQldf.js → threeViewerHost-ClW07Oxb.js} +3 -3
- package/dist/{threeViewerHost-CKYUOBVo.cjs → threeViewerHost-DPjfCjcT.cjs} +2 -2
- package/dist/{urdfTree-ZDOVaKqq.cjs → urdfTree-0RfuQQhY.cjs} +1 -1
- package/dist/{urdfTree-D8iNOssy.js → urdfTree-bel4iNae.js} +1 -1
- package/dist/{workpieceTreePanel-KaY8rX4f.cjs → workpieceTreePanel-CZeMqwxL.cjs} +1 -1
- package/dist/{workpieceTreePanel-i5NlE7Z-.js → workpieceTreePanel-D29Rk3sp.js} +5 -5
- package/package.json +1 -1
- package/public/obj/model.mtl +42 -0
- package/public/obj/model.obj +26110 -0
- package/dist/index-Dg_qqSts.cjs +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { defineAsyncComponent as ae, computed as D, onMounted as W, resolveComponent as ue, createBlock as V, openBlock as H, withCtx as ce, resolveDynamicComponent as ie, defineComponent as pe, defineProps as ge, ref as g, watch as ve, reactive as fe } from "vue";
|
|
2
2
|
import { S as he } from "./index-BHtNKL1L.js";
|
|
3
3
|
import { bz as Me, p as me, s as Ce, by as ye, g as de } from "./index-CA0SFykF.js";
|
|
4
|
-
import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-
|
|
5
|
-
import { u as Ae, a as we, E as ke } from "./index.vue_vue_type_style_index_1_lang-
|
|
6
|
-
import { s as Te } from "./index-
|
|
4
|
+
import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-yrPCQlhG.js";
|
|
5
|
+
import { u as Ae, a as we, E as ke } from "./index.vue_vue_type_style_index_1_lang-mHz69z2I.js";
|
|
6
|
+
import { s as Te } from "./index-CQpoN-3d.js";
|
|
7
7
|
import { useRouter as Se } from "vue-router";
|
|
8
8
|
import { a as De, e as Pe, f as _e, g as be, h as Fe } from "./index-CAPx0_D4.js";
|
|
9
|
-
import { g as xe } from "./index-
|
|
10
|
-
const x = ae(() => import("./index-
|
|
9
|
+
import { g as xe } from "./index-DqGErN3T.js";
|
|
10
|
+
const x = ae(() => import("./index-77RsiC4R.js").then((p) => p.j));
|
|
11
11
|
x.install = (p) => {
|
|
12
12
|
p.component("ssMenu", x);
|
|
13
13
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const s=require("vue"),ce=require("./index-BpPyaNFa.cjs"),w=require("./index-CEwxrYB-.cjs");require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-
|
|
1
|
+
"use strict";const s=require("vue"),ce=require("./index-BpPyaNFa.cjs"),w=require("./index-CEwxrYB-.cjs");require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BFpx7u6S.cjs");const B=require("./index.vue_vue_type_style_index_1_lang-CrR96PnG.cjs"),ae=require("./index-BAjzyphl.cjs"),ie=require("vue-router"),A=require("./index-9hspBVrQ.cjs"),pe=require("./index-DwFmfrjb.cjs"),P=s.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-CDqwv1he.cjs")).then(v=>v.index));P.install=v=>{v.component("ssMenu",P)};const z={__name:"index",props:{name:String},setup(v){const b=v,S=s.computed(()=>w.ElIcons[b.name]);return s.onMounted(()=>{}),(x,a)=>{const T=s.resolveComponent("el-icon");return s.openBlock(),s.createBlock(T,null,{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(S.value)))]),_:1})}}};function H(v="menu"){return{name:v,components:{SvgIcon:ce.SvgIcon,ssMenu:P,DynamicIcon:z,ssDialog:ae.ssDialog},setup(b,{emit:S}){const x=s.defineProps({mode:{type:String,default:"vertical"}}),a=B.useMenuState(),T=B.useModelComp(w.pinia),F=s.ref(0),d=ie.useRouter(),{asideMenus:W,menuTriggerType:J,platform:K}=w.storeToRefs(a),L=s.computed(()=>x==null?void 0:x.mode),$=s.computed(()=>{let e=[...W.value];if((e==null?void 0:e.length)===0)return d.push("/"),[];const t=Y(e,Q.value);return t.isFlag||(e=t==null?void 0:t.data),e}),j=async e=>{T.setRouteToChildPath(""),a.setMenuTriggerType("click"),a.setActiveMenuPath(e==null?void 0:e.path),a.setActiveAsideMenu(e),e.isRouter?d.push(e.path):d.push("/"),S("node-click",e)},G=async e=>{const t=w.findNodeByPropInTree($.value,"path",e);a.setActiveAsideMenu(t),T.setRouteToChildPath(""),J.value==="click"?F.value===1?a.setActiveMenuPath(sessionStorage.getItem("pageKey")):a.setActiveMenuPath(e):(a.setMenuTriggerType("click"),a.setActiveMenuPath(e)),e!=null&&e.startsWith("/")?d.push(e):d.push("/"),F.value++},I=e=>{a.setActiveMenuPath(e)},g=e=>{const t=document.documentElement;e==null||e.forEach(o=>{t.style.setProperty(o.name,o.value)})};s.onMounted(()=>{F.value=1});const Q=s.computed(()=>{const e=sessionStorage.getItem("authority");return e?JSON.parse(e):[]});s.watch(()=>K.value,e=>{e==="browser"?g(A.browserVerticalMenuClasses):e==="client"?(g(A.clientHorizontalMenuClasses),g(A.clientVerticalMenuClasses)):e==="three"&&(g(A.threeHorizontalMenuClasses),g(A.threeVerticalMenuClasses))},{immediate:!0});const X=(e,t)=>{function o(u){u==null||u.forEach(n=>{var M,y;const c=(M=n==null?void 0:n.path)!=null&&M.startsWith("/")?(y=n==null?void 0:n.path)==null?void 0:y.substring(1):n==null?void 0:n.path;n.show=t==null?void 0:t.some(f=>f==null?void 0:f.includes(c)),n.children&&o(n.children)})}return o(e),e},Y=(e,t)=>{if(Array.isArray(t)){const o=Array.from(new Set(t==null?void 0:t.map(u=>u.substring(0,u.lastIndexOf("/")))));return{data:X(e,o),isFlag:!1}}else return{isFlag:(t==null?void 0:t.toUpperCase())==="SUPERADMIN"}},p=s.reactive({show:!1,title:"菜单配置",width:"30%",type:"create"}),Z=e=>pe.getComponent(e),ee=s.ref({}),q=s.ref([]),te=async(e,t,o)=>{var y,f,N;if(!(e!=null&&e.structureIds)||((y=e==null?void 0:e.structureIds)==null?void 0:y.length)===0)return;const u=(N=(f=e==null?void 0:e.structureIds)==null?void 0:f.filter(r=>(r==null?void 0:r.key)==="dialogConfig"))==null?void 0:N.map(r=>r==null?void 0:r.id);let n=u==null?void 0:u.map(r=>w.getInsofDataApi({id:r}));const c=await Promise.all(n);if(c==null?void 0:c.every(r=>{var l;return((l=r==null?void 0:r.data)==null?void 0:l.code)===200})){const r=c==null?void 0:c.map(l=>{var _,m,i,k,D,U,V;return{id:(i=(m=(_=l==null?void 0:l.data)==null?void 0:_.result)==null?void 0:m[0])==null?void 0:i.id,...(V=(U=(D=(k=l==null?void 0:l.data)==null?void 0:k.result)==null?void 0:D[0])==null?void 0:U.value)==null?void 0:V.pageData}});t==="create"&&(q.value=r),t==="update"&&(q.value=r==null?void 0:r.map(l=>{var _,m;return((_=l==null?void 0:l.comp)==null?void 0:_.toUpperCase())==="FORM"?{...l,compData:(m=l==null?void 0:l.compData)==null?void 0:m.map(i=>{var k;return(i==null?void 0:i.key)==="formContent"?{...i,contents:(k=i==null?void 0:i.contents)==null?void 0:k.map(D=>({...D,value:o==null?void 0:o.title}))}:i})}:l}))}},C=s.ref({}),h=s.ref({}),se=e=>{switch(e){case"新增":return"create";case"编辑":return"update";case"删除":return"delete"}},E=s.ref({}),O=e=>{a.setCacheInputMenu({type:p.type,data:e}),a.setIsRefreshMenus(!0)},ne=async(e,t)=>{p.type=se(t==null?void 0:t.operateType),await te(t,p.type,e),h.value=e,E.value=t,(t==null?void 0:t.operateType)!=="删除"?(p.show=(t==null?void 0:t.trigger)==="openDialog",p.title=(t==null?void 0:t.operateType)+"菜单"):B.ElMessageBox.confirm(`是否确认要删除【${e==null?void 0:e.title}】`,"",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{O(e)})},re=()=>{p.show=!1},le=e=>e==null?void 0:e.filter(t=>t.allowInherit),oe=()=>{var o,u,n,c,M;let e;p.type==="create"&&(e=((o=h.value)==null?void 0:o.path)+"/"+C.value[(u=C.value)==null?void 0:u.prop]),p.type==="update"&&(e=(n=h.value)==null?void 0:n.path);const t={...h.value,config:le((c=h.value)==null?void 0:c.config),children:[],childMenus:[],title:C.value[(M=C.value)==null?void 0:M.prop],path:e};console.log("clickSubmitForm",E.value,h.value,t),O(t),p.show=!1},ue=e=>{var o,u;const t=(o=e==null?void 0:e.contents)==null?void 0:o.find(n=>n.key==="formContent");t&&(C.value=(u=t==null?void 0:t.contents)==null?void 0:u.reduce((n,c)=>(n[c.key]=c.value,n.prop=c.key,n),{}))},R=s.ref(!1);return{isCollapse:R,handleMenuCollapse:()=>{R.value=!R.value},handleCompChange:ue,dialogForm:ee,dialogRenderComps:q,getComponents:Z,clickSubmitForm:oe,dialogInfo:p,beforeDialogDestroy:re,clickMenuIcon:ne,mode:L,renderMenuList:$,clickMenu:j,openMenu:G,closeMenu:I,changeMenuStyle:g}}}}const ve=s.defineComponent(H());exports._sfc_main=ve;exports._sfc_main$1=z;exports.setComponent=H;exports.ssMenu=P;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { S as Y3, O as t1, M as n1 } from "./MTLLoader-
|
|
2
|
-
import { aS as D2, a7 as G2, O as a1, Q as O1, R as j1, V as _3, r as q3, aj as _1, S as P2, a3 as U1, C as o1, s as j3, ar as C1, aT as $2, o as V3, aA as W3, f as C3, Y as W2, p as O3, aB as D1, P as T1, ap as J2, l as K2, _ as Y2, n as X2, D as Z2, u as U3, a0 as G1, ax as H1, az as Q2, w as c1, aU as T3, as as e6, ai as r1, al as t6, k as N3, y as P1, am as n6, aq as s6, ad as J3, af as E1, aV as i6, aW as a6, aX as V1, aY as o6, aZ as r6, a_ as c6, a$ as l6, b0 as $1, b1 as d6, b2 as h6, E as u6, b3 as f6, ag as W1, ao as J1, v as p6, B as m6, a5 as B1, b4 as b6 } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-
|
|
3
|
-
import { d as g6 } from "./threeViewerHost-
|
|
1
|
+
import { S as Y3, O as t1, M as n1 } from "./MTLLoader-Dw2z1N-1.js";
|
|
2
|
+
import { aS as D2, a7 as G2, O as a1, Q as O1, R as j1, V as _3, r as q3, aj as _1, S as P2, a3 as U1, C as o1, s as j3, ar as C1, aT as $2, o as V3, aA as W3, f as C3, Y as W2, p as O3, aB as D1, P as T1, ap as J2, l as K2, _ as Y2, n as X2, D as Z2, u as U3, a0 as G1, ax as H1, az as Q2, w as c1, aU as T3, as as e6, ai as r1, al as t6, k as N3, y as P1, am as n6, aq as s6, ad as J3, af as E1, aV as i6, aW as a6, aX as V1, aY as o6, aZ as r6, a_ as c6, a$ as l6, b0 as $1, b1 as d6, b2 as h6, E as u6, b3 as f6, ag as W1, ao as J1, v as p6, B as m6, a5 as B1, b4 as b6 } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-yrPCQlhG.js";
|
|
3
|
+
import { d as g6 } from "./threeViewerHost-ClW07Oxb.js";
|
|
4
4
|
import { b as s1, s as y6, p as w6 } from "./index-CA0SFykF.js";
|
|
5
5
|
import { ref as v6 } from "vue";
|
|
6
|
-
import { a as z6 } from "./index.vue_vue_type_style_index_1_lang-
|
|
6
|
+
import { a as z6 } from "./index.vue_vue_type_style_index_1_lang-mHz69z2I.js";
|
|
7
7
|
class q1 extends D2 {
|
|
8
8
|
/**
|
|
9
9
|
* Constructs a new TGA loader.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const T3=require("./MTLLoader-CXA7QTWv.cjs"),a=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BtrKm__x.cjs"),u2=require("./threeViewerHost-CKYUOBVo.cjs"),q3=require("./index-CEwxrYB-.cjs"),f2=require("vue"),p2=require("./index.vue_vue_type_style_index_1_lang-DTc6vo-v.cjs");class u1 extends a.DataTextureLoader{constructor(C){super(C)}parse(C){function P(x){switch(x.image_type){case $:case V:if(x.colormap_length>256||x.colormap_size!==24||x.colormap_type!==1)throw new Error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case h:case o:case z:case y:if(x.colormap_type)throw new Error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case h3:throw new Error("THREE.TGALoader: No data.");default:throw new Error("THREE.TGALoader: Invalid type "+x.image_type)}if(x.width<=0||x.height<=0)throw new Error("THREE.TGALoader: Invalid image size.");if(x.pixel_size!==8&&x.pixel_size!==16&&x.pixel_size!==24&&x.pixel_size!==32)throw new Error("THREE.TGALoader: Invalid pixel size "+x.pixel_size)}function R(x,o3,i3,Q,u3){let Z,s3;const W=i3.pixel_size>>3,D=i3.width*i3.height*W;if(o3&&(s3=u3.subarray(Q,Q+=i3.colormap_length*(i3.colormap_size>>3))),x){Z=new Uint8Array(D);let S,M,B,a3=0;const v=new Uint8Array(W);for(;a3<D;)if(S=u3[Q++],M=(S&127)+1,S&128){for(B=0;B<W;++B)v[B]=u3[Q++];for(B=0;B<M;++B)Z.set(v,a3+B*W);a3+=W*M}else{for(M*=W,B=0;B<M;++B)Z[a3+B]=u3[Q++];a3+=M}}else Z=u3.subarray(Q,Q+=o3?i3.width*i3.height:D);return{pixel_data:Z,palettes:s3}}function l(x,o3,i3,Q,u3,Z,s3,W,D){const S=D;let M,B=0,a3,v;const K=G.width;for(v=o3;v!==Q;v+=i3)for(a3=u3;a3!==s3;a3+=Z,B++)M=W[B],x[(a3+K*v)*4+3]=255,x[(a3+K*v)*4+2]=S[M*3+0],x[(a3+K*v)*4+1]=S[M*3+1],x[(a3+K*v)*4+0]=S[M*3+2];return x}function _(x,o3,i3,Q,u3,Z,s3,W){let D,S=0,M,B;const a3=G.width;for(B=o3;B!==Q;B+=i3)for(M=u3;M!==s3;M+=Z,S+=2)D=W[S+0]+(W[S+1]<<8),x[(M+a3*B)*4+0]=(D&31744)>>7,x[(M+a3*B)*4+1]=(D&992)>>2,x[(M+a3*B)*4+2]=(D&31)<<3,x[(M+a3*B)*4+3]=D&32768?0:255;return x}function J(x,o3,i3,Q,u3,Z,s3,W){let D=0,S,M;const B=G.width;for(M=o3;M!==Q;M+=i3)for(S=u3;S!==s3;S+=Z,D+=3)x[(S+B*M)*4+3]=255,x[(S+B*M)*4+2]=W[D+0],x[(S+B*M)*4+1]=W[D+1],x[(S+B*M)*4+0]=W[D+2];return x}function F(x,o3,i3,Q,u3,Z,s3,W){let D=0,S,M;const B=G.width;for(M=o3;M!==Q;M+=i3)for(S=u3;S!==s3;S+=Z,D+=4)x[(S+B*M)*4+2]=W[D+0],x[(S+B*M)*4+1]=W[D+1],x[(S+B*M)*4+0]=W[D+2],x[(S+B*M)*4+3]=W[D+3];return x}function X(x,o3,i3,Q,u3,Z,s3,W){let D,S=0,M,B;const a3=G.width;for(B=o3;B!==Q;B+=i3)for(M=u3;M!==s3;M+=Z,S++)D=W[S],x[(M+a3*B)*4+0]=D,x[(M+a3*B)*4+1]=D,x[(M+a3*B)*4+2]=D,x[(M+a3*B)*4+3]=255;return x}function l3(x,o3,i3,Q,u3,Z,s3,W){let D=0,S,M;const B=G.width;for(M=o3;M!==Q;M+=i3)for(S=u3;S!==s3;S+=Z,D+=2)x[(S+B*M)*4+0]=W[D+0],x[(S+B*M)*4+1]=W[D+0],x[(S+B*M)*4+2]=W[D+0],x[(S+B*M)*4+3]=W[D+1];return x}function d3(x,o3,i3,Q,u3){let Z,s3,W,D,S,M;switch((G.flags&p)>>f){default:case I:Z=0,W=1,S=o3,s3=0,D=1,M=i3;break;case L:Z=0,W=1,S=o3,s3=i3-1,D=-1,M=-1;break;case O:Z=o3-1,W=-1,S=-1,s3=0,D=1,M=i3;break;case g:Z=o3-1,W=-1,S=-1,s3=i3-1,D=-1,M=-1;break}if(Y)switch(G.pixel_size){case 8:X(x,s3,D,M,Z,W,S,Q);break;case 16:l3(x,s3,D,M,Z,W,S,Q);break;default:throw new Error("THREE.TGALoader: Format not supported.")}else switch(G.pixel_size){case 8:l(x,s3,D,M,Z,W,S,Q,u3);break;case 16:_(x,s3,D,M,Z,W,S,Q);break;case 24:J(x,s3,D,M,Z,W,S,Q);break;case 32:F(x,s3,D,M,Z,W,S,Q);break;default:throw new Error("THREE.TGALoader: Format not supported.")}return x}const h3=0,$=1,h=2,o=3,V=9,z=10,y=11,p=48,f=4,L=0,g=1,I=2,O=3;if(C.length<19)throw new Error("THREE.TGALoader: Not enough data to contain header.");let u=0;const b=new Uint8Array(C),G={id_length:b[u++],colormap_type:b[u++],image_type:b[u++],colormap_index:b[u++]|b[u++]<<8,colormap_length:b[u++]|b[u++]<<8,colormap_size:b[u++],origin:[b[u++]|b[u++]<<8,b[u++]|b[u++]<<8],width:b[u++]|b[u++]<<8,height:b[u++]|b[u++]<<8,pixel_size:b[u++],flags:b[u++]};if(P(G),G.id_length+u>C.length)throw new Error("THREE.TGALoader: No data.");u+=G.id_length;let U=!1,H=!1,Y=!1;switch(G.image_type){case V:U=!0,H=!0;break;case $:H=!0;break;case z:U=!0;break;case h:break;case y:U=!0,Y=!0;break;case o:Y=!0;break}const A3=new Uint8Array(G.width*G.height*4),g3=R(U,H,G,u,b);return d3(A3,G.width,G.height,g3.pixel_data,g3.palettes),{data:A3,width:G.width,height:G.height,flipY:!0,generateMipmaps:!0,minFilter:a.LinearMipmapLinearFilter}}}class m2 extends a.Loader{load(C,P,R,l){const _=this,J=_.path===""?a.LoaderUtils.extractUrlBase(C):_.path,F=new a.FileLoader(_.manager);F.setPath(_.path),F.setRequestHeader(_.requestHeader),F.setWithCredentials(_.withCredentials),F.load(C,function(X){try{P(_.parse(X,J))}catch(l3){l?l(l3):console.error(l3),_.manager.itemError(C)}},R,l)}parse(C,P){function R(t,e){const i=[],n=t.childNodes;for(let s=0,r=n.length;s<r;s++){const c=n[s];c.nodeName===e&&i.push(c)}return i}function l(t){if(t.length===0)return[];const e=t.trim().split(/\s+/),i=new Array(e.length);for(let n=0,s=e.length;n<s;n++)i[n]=e[n];return i}function _(t){if(t.length===0)return[];const e=t.trim().split(/\s+/),i=new Array(e.length);for(let n=0,s=e.length;n<s;n++)i[n]=parseFloat(e[n]);return i}function J(t){if(t.length===0)return[];const e=t.trim().split(/\s+/),i=new Array(e.length);for(let n=0,s=e.length;n<s;n++)i[n]=parseInt(e[n]);return i}function F(t){return t.substring(1)}function X(){return"three_default_"+d2++}function l3(t){return Object.keys(t).length===0}function d3(t){return{unit:h3(R(t,"unit")[0]),upAxis:$(R(t,"up_axis")[0])}}function h3(t){return t!==void 0&&t.hasAttribute("meter")===!0?parseFloat(t.getAttribute("meter")):1}function $(t){return t!==void 0?t.textContent:"Y_UP"}function h(t,e,i,n){const s=R(t,e)[0];if(s!==void 0){const r=R(s,i);for(let c=0;c<r.length;c++)n(r[c])}}function o(t,e){for(const i in t){const n=t[i];n.build=e(t[i])}}function V(t,e){return t.build!==void 0||(t.build=e(t)),t.build}function z(t){const e={sources:{},samplers:{},channels:{}};let i=!1;for(let n=0,s=t.childNodes.length;n<s;n++){const r=t.childNodes[n];if(r.nodeType!==1)continue;let c;switch(r.nodeName){case"source":c=r.getAttribute("id"),e.sources[c]=j3(r);break;case"sampler":c=r.getAttribute("id"),e.samplers[c]=y(r);break;case"channel":c=r.getAttribute("target"),e.channels[c]=p(r);break;case"animation":z(r),i=!0;break;default:console.log(r)}}i===!1&&(j.animations[t.getAttribute("id")||a.MathUtils.generateUUID()]=e)}function y(t){const e={inputs:{}};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"input":const r=F(s.getAttribute("source")),c=s.getAttribute("semantic");e.inputs[c]=r;break}}return e}function p(t){const e={};let n=t.getAttribute("target").split("/");const s=n.shift();let r=n.shift();const c=r.indexOf("(")!==-1,A=r.indexOf(".")!==-1;if(A)n=r.split("."),r=n.shift(),e.member=n.shift();else if(c){const m=r.split("(");r=m.shift();for(let w=0;w<m.length;w++)m[w]=parseInt(m[w].replace(/\)/,""));e.indices=m}return e.id=s,e.sid=r,e.arraySyntax=c,e.memberSyntax=A,e.sampler=F(t.getAttribute("source")),e}function f(t){const e=[],i=t.channels,n=t.samplers,s=t.sources;for(const r in i)if(i.hasOwnProperty(r)){const c=i[r],A=n[c.sampler],m=A.inputs.INPUT,w=A.inputs.OUTPUT,T=s[m],d=s[w],N=g(c,T,d);G(N,e)}return e}function L(t){return V(j.animations[t],f)}function g(t,e,i){const n=j.nodes[t.id],s=B3(n.id),r=n.transforms[t.sid],c=n.matrix.clone().transpose();let A,m,w,T,d,N;const k={};switch(r){case"matrix":for(w=0,T=e.array.length;w<T;w++)if(A=e.array[w],m=w*i.stride,k[A]===void 0&&(k[A]={}),t.arraySyntax===!0){const m3=i.array[m],c3=t.indices[0]+4*t.indices[1];k[A][c3]=m3}else for(d=0,N=i.stride;d<N;d++)k[A][d]=i.array[m+d];break;case"translate":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',r);break;case"rotate":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',r);break;case"scale":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',r);break}const q=I(k,c);return{name:s.uuid,keyframes:q}}function I(t,e){const i=[];for(const s in t)i.push({time:parseFloat(s),value:t[s]});i.sort(n);for(let s=0;s<16;s++)U(i,s,e.elements[s]);return i;function n(s,r){return s.time-r.time}}const O=new a.Vector3,u=new a.Vector3,b=new a.Quaternion;function G(t,e){const i=t.keyframes,n=t.name,s=[],r=[],c=[],A=[];for(let m=0,w=i.length;m<w;m++){const T=i[m],d=T.time,N=T.value;_3.fromArray(N).transpose(),_3.decompose(O,b,u),s.push(d),r.push(O.x,O.y,O.z),c.push(b.x,b.y,b.z,b.w),A.push(u.x,u.y,u.z)}return r.length>0&&e.push(new a.VectorKeyframeTrack(n+".position",s,r)),c.length>0&&e.push(new a.QuaternionKeyframeTrack(n+".quaternion",s,c)),A.length>0&&e.push(new a.VectorKeyframeTrack(n+".scale",s,A)),e}function U(t,e,i){let n,s=!0,r,c;for(r=0,c=t.length;r<c;r++)n=t[r],n.value[e]===void 0?n.value[e]=null:s=!1;if(s===!0)for(r=0,c=t.length;r<c;r++)n=t[r],n.value[e]=i;else H(t,e)}function H(t,e){let i,n;for(let s=0,r=t.length;s<r;s++){const c=t[s];if(c.value[e]===null){if(i=Y(t,s,e),n=A3(t,s,e),i===null){c.value[e]=n.value[e];continue}if(n===null){c.value[e]=i.value[e];continue}g3(c,i,n,e)}}}function Y(t,e,i){for(;e>=0;){const n=t[e];if(n.value[i]!==null)return n;e--}return null}function A3(t,e,i){for(;e<t.length;){const n=t[e];if(n.value[i]!==null)return n;e++}return null}function g3(t,e,i,n){if(i.time-e.time===0){t.value[n]=e.value[n];return}t.value[n]=(t.time-e.time)*(i.value[n]-e.value[n])/(i.time-e.time)+e.value[n]}function x(t){const e={name:t.getAttribute("id")||"default",start:parseFloat(t.getAttribute("start")||0),end:parseFloat(t.getAttribute("end")||0),animations:[]};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"instance_animation":e.animations.push(F(s.getAttribute("url")));break}}j.clips[t.getAttribute("id")]=e}function o3(t){const e=[],i=t.name,n=t.end-t.start||-1,s=t.animations;for(let r=0,c=s.length;r<c;r++){const A=L(s[r]);for(let m=0,w=A.length;m<w;m++)e.push(A[m])}return new a.AnimationClip(i,n,e)}function i3(t){return V(j.clips[t],o3)}function Q(t){const e={};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"skin":e.id=F(s.getAttribute("source")),e.skin=u3(s);break;case"morph":e.id=F(s.getAttribute("source")),console.warn("THREE.ColladaLoader: Morph target animation not supported yet.");break}}j.controllers[t.getAttribute("id")]=e}function u3(t){const e={sources:{}};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"bind_shape_matrix":e.bindShapeMatrix=_(s.textContent);break;case"source":const r=s.getAttribute("id");e.sources[r]=j3(s);break;case"joints":e.joints=Z(s);break;case"vertex_weights":e.vertexWeights=s3(s);break}}return e}function Z(t){const e={inputs:{}};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"input":const r=s.getAttribute("semantic"),c=F(s.getAttribute("source"));e.inputs[r]=c;break}}return e}function s3(t){const e={inputs:{}};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"input":const r=s.getAttribute("semantic"),c=F(s.getAttribute("source")),A=parseInt(s.getAttribute("offset"));e.inputs[r]={id:c,offset:A};break;case"vcount":e.vcount=J(s.textContent);break;case"v":e.v=J(s.textContent);break}}return e}function W(t){const e={id:t.id},i=j.geometries[e.id];return t.skin!==void 0&&(e.skin=D(t.skin),i.sources.skinIndices=e.skin.indices,i.sources.skinWeights=e.skin.weights),e}function D(t){const i={joints:[],indices:{array:[],stride:4},weights:{array:[],stride:4}},n=t.sources,s=t.vertexWeights,r=s.vcount,c=s.v,A=s.inputs.JOINT.offset,m=s.inputs.WEIGHT.offset,w=t.sources[t.joints.inputs.JOINT],T=t.sources[t.joints.inputs.INV_BIND_MATRIX],d=n[s.inputs.WEIGHT.id].array;let N=0,k,q,E;for(k=0,E=r.length;k<E;k++){const c3=r[k],t3=[];for(q=0;q<c3;q++){const n3=c[N+A],H3=c[N+m],k3=d[H3];t3.push({index:n3,weight:k3}),N+=2}for(t3.sort(m3),q=0;q<4;q++){const n3=t3[q];n3!==void 0?(i.indices.array.push(n3.index),i.weights.array.push(n3.weight)):(i.indices.array.push(0),i.weights.array.push(0))}}for(t.bindShapeMatrix?i.bindMatrix=new a.Matrix4().fromArray(t.bindShapeMatrix).transpose():i.bindMatrix=new a.Matrix4().identity(),k=0,E=w.array.length;k<E;k++){const c3=w.array[k],t3=new a.Matrix4().fromArray(T.array,k*T.stride).transpose();i.joints.push({name:c3,boneInverse:t3})}return i;function m3(c3,t3){return t3.weight-c3.weight}}function S(t){return V(j.controllers[t],W)}function M(t){const e={init_from:R(t,"init_from")[0].textContent};j.images[t.getAttribute("id")]=e}function B(t){return t.build!==void 0?t.build:t.init_from}function a3(t){const e=j.images[t];return e!==void 0?V(e,B):(console.warn("THREE.ColladaLoader: Couldn't find image with ID:",t),null)}function v(t){const e={};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"profile_COMMON":e.profile=K(s);break}}j.effects[t.getAttribute("id")]=e}function K(t){const e={surfaces:{},samplers:{}};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"newparam":e3(s,e);break;case"technique":e.technique=r3(s);break;case"extra":e.extra=p3(s);break}}return e}function e3(t,e){const i=t.getAttribute("sid");for(let n=0,s=t.childNodes.length;n<s;n++){const r=t.childNodes[n];if(r.nodeType===1)switch(r.nodeName){case"surface":e.surfaces[i]=f3(r);break;case"sampler2D":e.samplers[i]=x3(r);break}}}function f3(t){const e={};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"init_from":e.init_from=s.textContent;break}}return e}function x3(t){const e={};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"source":e.source=s.textContent;break}}return e}function r3(t){const e={};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"constant":case"lambert":case"blinn":case"phong":e.type=s.nodeName,e.parameters=z3(s);break;case"extra":e.extra=p3(s);break}}return e}function z3(t){const e={};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"emission":case"diffuse":case"specular":case"bump":case"ambient":case"shininess":case"transparency":e[s.nodeName]=L3(s);break;case"transparent":e[s.nodeName]={opaque:s.hasAttribute("opaque")?s.getAttribute("opaque"):"A_ONE",data:L3(s)};break}}return e}function L3(t){const e={};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"color":e[s.nodeName]=_(s.textContent);break;case"float":e[s.nodeName]=parseFloat(s.textContent);break;case"texture":e[s.nodeName]={id:s.getAttribute("texture"),extra:b3(s)};break}}return e}function b3(t){const e={technique:{}};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"extra":M3(s,e);break}}return e}function M3(t,e){for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"technique":y3(s,e);break}}}function y3(t,e){for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"repeatU":case"repeatV":case"offsetU":case"offsetV":e.technique[s.nodeName]=parseFloat(s.textContent);break;case"wrapU":case"wrapV":s.textContent.toUpperCase()==="TRUE"?e.technique[s.nodeName]=1:s.textContent.toUpperCase()==="FALSE"?e.technique[s.nodeName]=0:e.technique[s.nodeName]=parseInt(s.textContent);break;case"bump":e[s.nodeName]=R3(s);break}}}function p3(t){const e={};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"technique":e.technique=N3(s);break}}return e}function N3(t){const e={};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"double_sided":e[s.nodeName]=parseInt(s.textContent);break;case"bump":e[s.nodeName]=R3(s);break}}return e}function R3(t){const e={};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"texture":e[s.nodeName]={id:s.getAttribute("texture"),texcoord:s.getAttribute("texcoord"),extra:b3(s)};break}}return e}function W3(t){return t}function y1(t){return V(j.effects[t],W3)}function w1(t){const e={name:t.getAttribute("name")};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"instance_effect":e.url=F(s.getAttribute("url"));break}}j.materials[t.getAttribute("id")]=e}function v1(t){let e,i=t.slice((t.lastIndexOf(".")-1>>>0)+2);switch(i=i.toLowerCase(),i){case"tga":e=P3;break;default:e=l1}return e}function J3(t){const e=y1(t.url),i=e.profile.technique;let n;switch(i.type){case"phong":case"blinn":n=new a.MeshPhongMaterial;break;case"lambert":n=new a.MeshLambertMaterial;break;default:n=new a.MeshBasicMaterial;break}n.name=t.name||"";function s(m,w=null){const T=e.profile.samplers[m.id];let d=null;if(T!==void 0){const N=e.profile.surfaces[T.source];d=a3(N.init_from)}else console.warn("THREE.ColladaLoader: Undefined sampler. Access image directly (see #12530)."),d=a3(m.id);if(d!==null){const N=v1(d);if(N!==void 0){const k=N.load(d),q=m.extra;if(q!==void 0&&q.technique!==void 0&&l3(q.technique)===!1){const E=q.technique;k.wrapS=E.wrapU?a.RepeatWrapping:a.ClampToEdgeWrapping,k.wrapT=E.wrapV?a.RepeatWrapping:a.ClampToEdgeWrapping,k.offset.set(E.offsetU||0,E.offsetV||0),k.repeat.set(E.repeatU||1,E.repeatV||1)}else k.wrapS=a.RepeatWrapping,k.wrapT=a.RepeatWrapping;return w!==null&&(k.colorSpace=w),k}else return console.warn("THREE.ColladaLoader: Loader for texture %s not found.",d),null}else return console.warn("THREE.ColladaLoader: Couldn't create texture with ID:",m.id),null}const r=i.parameters;for(const m in r){const w=r[m];switch(m){case"diffuse":w.color&&n.color.fromArray(w.color),w.texture&&(n.map=s(w.texture,a.SRGBColorSpace));break;case"specular":w.color&&n.specular&&n.specular.fromArray(w.color),w.texture&&(n.specularMap=s(w.texture));break;case"bump":w.texture&&(n.normalMap=s(w.texture));break;case"ambient":w.texture&&(n.lightMap=s(w.texture,a.SRGBColorSpace));break;case"shininess":w.float&&n.shininess&&(n.shininess=w.float);break;case"emission":w.color&&n.emissive&&n.emissive.fromArray(w.color),w.texture&&(n.emissiveMap=s(w.texture,a.SRGBColorSpace));break}}a.ColorManagement.colorSpaceToWorking(n.color,a.SRGBColorSpace),n.specular&&a.ColorManagement.colorSpaceToWorking(n.specular,a.SRGBColorSpace),n.emissive&&a.ColorManagement.colorSpaceToWorking(n.emissive,a.SRGBColorSpace);let c=r.transparent,A=r.transparency;if(A===void 0&&c&&(A={float:1}),c===void 0&&A&&(c={opaque:"A_ONE",data:{color:[1,1,1,1]}}),c&&A)if(c.data.texture)n.transparent=!0;else{const m=c.data.color;switch(c.opaque){case"A_ONE":n.opacity=m[3]*A.float;break;case"RGB_ZERO":n.opacity=1-m[0]*A.float;break;case"A_ZERO":n.opacity=1-m[3]*A.float;break;case"RGB_ONE":n.opacity=m[0]*A.float;break;default:console.warn('THREE.ColladaLoader: Invalid opaque type "%s" of transparent tag.',c.opaque)}n.opacity<1&&(n.transparent=!0)}if(i.extra!==void 0&&i.extra.technique!==void 0){const m=i.extra.technique;for(const w in m){const T=m[w];switch(w){case"double_sided":n.side=T===1?a.DoubleSide:a.FrontSide;break;case"bump":n.normalMap=s(T.texture),n.normalScale=new a.Vector2(1,1);break}}}return n}function z1(t){return V(j.materials[t],J3)}function M1(t){const e={name:t.getAttribute("name")};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"optics":e.optics=x1(s);break}}j.cameras[t.getAttribute("id")]=e}function x1(t){for(let e=0;e<t.childNodes.length;e++){const i=t.childNodes[e];switch(i.nodeName){case"technique_common":return A1(i)}}return{}}function A1(t){const e={};for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];switch(n.nodeName){case"perspective":case"orthographic":e.technique=n.nodeName,e.parameters=L1(n);break}}return e}function L1(t){const e={};for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];switch(n.nodeName){case"xfov":case"yfov":case"xmag":case"ymag":case"znear":case"zfar":case"aspect_ratio":e[n.nodeName]=parseFloat(n.textContent);break}}return e}function K3(t){let e;switch(t.optics.technique){case"perspective":e=new a.PerspectiveCamera(t.optics.parameters.yfov,t.optics.parameters.aspect_ratio,t.optics.parameters.znear,t.optics.parameters.zfar);break;case"orthographic":let i=t.optics.parameters.ymag,n=t.optics.parameters.xmag;const s=t.optics.parameters.aspect_ratio;n=n===void 0?i*s:n,i=i===void 0?n/s:i,n*=.5,i*=.5,e=new a.OrthographicCamera(-n,n,i,-i,t.optics.parameters.znear,t.optics.parameters.zfar);break;default:e=new a.PerspectiveCamera;break}return e.name=t.name||"",e}function k1(t){const e=j.cameras[t];return e!==void 0?V(e,K3):(console.warn("THREE.ColladaLoader: Couldn't find camera with ID:",t),null)}function _1(t){let e={};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"technique_common":e=N1(s);break}}j.lights[t.getAttribute("id")]=e}function N1(t){const e={};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"directional":case"point":case"spot":case"ambient":e.technique=s.nodeName,e.parameters=C1(s)}}return e}function C1(t){const e={};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"color":const r=_(s.textContent);e.color=new a.Color().fromArray(r),a.ColorManagement.colorSpaceToWorking(e.color,a.SRGBColorSpace);break;case"falloff_angle":e.falloffAngle=parseFloat(s.textContent);break;case"quadratic_attenuation":const c=parseFloat(s.textContent);e.distance=c?Math.sqrt(1/c):0;break}}return e}function Y3(t){let e;switch(t.technique){case"directional":e=new a.DirectionalLight;break;case"point":e=new a.PointLight;break;case"spot":e=new a.SpotLight;break;case"ambient":e=new a.AmbientLight;break}return t.parameters.color&&e.color.copy(t.parameters.color),t.parameters.distance&&(e.distance=t.parameters.distance),e}function T1(t){const e=j.lights[t];return e!==void 0?V(e,Y3):(console.warn("THREE.ColladaLoader: Couldn't find light with ID:",t),null)}function H1(t){const e={name:t.getAttribute("name"),sources:{},vertices:{},primitives:[]},i=R(t,"mesh")[0];if(i!==void 0){for(let n=0;n<i.childNodes.length;n++){const s=i.childNodes[n];if(s.nodeType!==1)continue;const r=s.getAttribute("id");switch(s.nodeName){case"source":e.sources[r]=j3(s);break;case"vertices":e.vertices=E1(s);break;case"polygons":console.warn("THREE.ColladaLoader: Unsupported primitive type: ",s.nodeName);break;case"lines":case"linestrips":case"polylist":case"triangles":e.primitives.push(B1(s));break;default:console.log(s)}}j.geometries[t.getAttribute("id")]=e}}function j3(t){const e={array:[],stride:3};for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];if(n.nodeType===1)switch(n.nodeName){case"float_array":e.array=_(n.textContent);break;case"Name_array":e.array=l(n.textContent);break;case"technique_common":const s=R(n,"accessor")[0];s!==void 0&&(e.stride=parseInt(s.getAttribute("stride")));break}}return e}function E1(t){const e={};for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];n.nodeType===1&&(e[n.getAttribute("semantic")]=F(n.getAttribute("source")))}return e}function B1(t){const e={type:t.nodeName,material:t.getAttribute("material"),count:parseInt(t.getAttribute("count")),inputs:{},stride:0,hasUV:!1};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"input":const r=F(s.getAttribute("source")),c=s.getAttribute("semantic"),A=parseInt(s.getAttribute("offset")),m=parseInt(s.getAttribute("set")),w=m>0?c+m:c;e.inputs[w]={id:r,offset:A},e.stride=Math.max(e.stride,A+1),c==="TEXCOORD"&&(e.hasUV=!0);break;case"vcount":e.vcount=J(s.textContent);break;case"p":e.p=J(s.textContent);break}}return e}function V1(t){const e={};for(let i=0;i<t.length;i++){const n=t[i];e[n.type]===void 0&&(e[n.type]=[]),e[n.type].push(n)}return e}function S1(t){let e=0;for(let i=0,n=t.length;i<n;i++)t[i].hasUV===!0&&e++;e>0&&e<t.length&&(t.uvsNeedsFix=!0)}function X3(t){const e={},i=t.sources,n=t.vertices,s=t.primitives;if(s.length===0)return{};const r=V1(s);for(const c in r){const A=r[c];S1(A),e[c]=q1(A,i,n)}return e}function q1(t,e,i){const n={},s={array:[],stride:0},r={array:[],stride:0},c={array:[],stride:0},A={array:[],stride:0},m={array:[],stride:0},w={array:[],stride:4},T={array:[],stride:4},d=new a.BufferGeometry,N=[];let k=0;for(let q=0;q<t.length;q++){const E=t[q],m3=E.inputs;let c3=0;switch(E.type){case"lines":case"linestrips":c3=E.count*2;break;case"triangles":c3=E.count*3;break;case"polylist":for(let t3=0;t3<E.count;t3++){const n3=E.vcount[t3];switch(n3){case 3:c3+=3;break;case 4:c3+=6;break;default:c3+=(n3-2)*3;break}}break;default:console.warn("THREE.ColladaLoader: Unknown primitive type:",E.type)}d.addGroup(k,c3,q),k+=c3,E.material&&N.push(E.material);for(const t3 in m3){const n3=m3[t3];switch(t3){case"VERTEX":for(const H3 in i){const k3=i[H3];switch(H3){case"POSITION":const V3=s.array.length;if(C3(E,e[k3],n3.offset,s.array),s.stride=e[k3].stride,e.skinWeights&&e.skinIndices&&(C3(E,e.skinIndices,n3.offset,w.array),C3(E,e.skinWeights,n3.offset,T.array)),E.hasUV===!1&&t.uvsNeedsFix===!0){const h2=(s.array.length-V3)/s.stride;for(let h1=0;h1<h2;h1++)c.array.push(0,0)}break;case"NORMAL":C3(E,e[k3],n3.offset,r.array),r.stride=e[k3].stride;break;case"COLOR":C3(E,e[k3],n3.offset,m.array),m.stride=e[k3].stride;break;case"TEXCOORD":C3(E,e[k3],n3.offset,c.array),c.stride=e[k3].stride;break;case"TEXCOORD1":C3(E,e[k3],n3.offset,A.array),c.stride=e[k3].stride;break;default:console.warn('THREE.ColladaLoader: Semantic "%s" not handled in geometry build process.',H3)}}break;case"NORMAL":C3(E,e[n3.id],n3.offset,r.array),r.stride=e[n3.id].stride;break;case"COLOR":C3(E,e[n3.id],n3.offset,m.array,!0),m.stride=e[n3.id].stride;break;case"TEXCOORD":C3(E,e[n3.id],n3.offset,c.array),c.stride=e[n3.id].stride;break;case"TEXCOORD1":C3(E,e[n3.id],n3.offset,A.array),A.stride=e[n3.id].stride;break}}}return s.array.length>0&&d.setAttribute("position",new a.Float32BufferAttribute(s.array,s.stride)),r.array.length>0&&d.setAttribute("normal",new a.Float32BufferAttribute(r.array,r.stride)),m.array.length>0&&d.setAttribute("color",new a.Float32BufferAttribute(m.array,m.stride)),c.array.length>0&&d.setAttribute("uv",new a.Float32BufferAttribute(c.array,c.stride)),A.array.length>0&&d.setAttribute("uv1",new a.Float32BufferAttribute(A.array,A.stride)),w.array.length>0&&d.setAttribute("skinIndex",new a.Float32BufferAttribute(w.array,w.stride)),T.array.length>0&&d.setAttribute("skinWeight",new a.Float32BufferAttribute(T.array,T.stride)),n.data=d,n.type=t[0].type,n.materialKeys=N,n}function C3(t,e,i,n,s=!1){const r=t.p,c=t.stride,A=t.vcount;function m(d){let N=r[d+i]*T;const k=N+T;for(;N<k;N++)n.push(w[N]);if(s){const q=n.length-T-1;F3.setRGB(n[q+0],n[q+1],n[q+2],a.SRGBColorSpace),n[q+0]=F3.r,n[q+1]=F3.g,n[q+2]=F3.b}}const w=e.array,T=e.stride;if(t.vcount!==void 0){let d=0;for(let N=0,k=A.length;N<k;N++){const q=A[N];if(q===4){const E=d+c*0,m3=d+c*1,c3=d+c*2,t3=d+c*3;m(E),m(m3),m(t3),m(m3),m(c3),m(t3)}else if(q===3){const E=d+c*0,m3=d+c*1,c3=d+c*2;m(E),m(m3),m(c3)}else if(q>4)for(let E=1,m3=q-2;E<=m3;E++){const c3=d+c*0,t3=d+c*E,n3=d+c*(E+1);m(c3),m(t3),m(n3)}d+=c*q}}else for(let d=0,N=r.length;d<N;d+=c)m(d)}function Z3(t){return V(j.geometries[t],X3)}function R1(t){const e={name:t.getAttribute("name")||"",joints:{},links:[]};for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];if(n.nodeType===1)switch(n.nodeName){case"technique_common":O1(n,e);break}}j.kinematicsModels[t.getAttribute("id")]=e}function F1(t){return t.build!==void 0?t.build:t}function I1(t){return V(j.kinematicsModels[t],F1)}function O1(t,e){for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];if(n.nodeType===1)switch(n.nodeName){case"joint":e.joints[n.getAttribute("sid")]=U1(n);break;case"link":e.links.push(Q3(n));break}}}function U1(t){let e;for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];if(n.nodeType===1)switch(n.nodeName){case"prismatic":case"revolute":e=j1(n);break}}return e}function j1(t){const e={sid:t.getAttribute("sid"),name:t.getAttribute("name")||"",axis:new a.Vector3,limits:{min:0,max:0},type:t.nodeName,static:!1,zeroPosition:0,middlePosition:0};for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];if(n.nodeType===1)switch(n.nodeName){case"axis":const s=_(n.textContent);e.axis.fromArray(s);break;case"limits":const r=n.getElementsByTagName("max")[0],c=n.getElementsByTagName("min")[0];e.limits.max=parseFloat(r.textContent),e.limits.min=parseFloat(c.textContent);break}}return e.limits.min>=e.limits.max&&(e.static=!0),e.middlePosition=(e.limits.min+e.limits.max)/2,e}function Q3(t){const e={sid:t.getAttribute("sid"),name:t.getAttribute("name")||"",attachments:[],transforms:[]};for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];if(n.nodeType===1)switch(n.nodeName){case"attachment_full":e.attachments.push(D1(n));break;case"matrix":case"translate":case"rotate":e.transforms.push(e1(n));break}}return e}function D1(t){const e={joint:t.getAttribute("joint").split("/").pop(),transforms:[],links:[]};for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];if(n.nodeType===1)switch(n.nodeName){case"link":e.links.push(Q3(n));break;case"matrix":case"translate":case"rotate":e.transforms.push(e1(n));break}}return e}function e1(t){const e={type:t.nodeName},i=_(t.textContent);switch(e.type){case"matrix":e.obj=new a.Matrix4,e.obj.fromArray(i).transpose();break;case"translate":e.obj=new a.Vector3,e.obj.fromArray(i);break;case"rotate":e.obj=new a.Vector3,e.obj.fromArray(i),e.angle=a.MathUtils.degToRad(i[3]);break}return e}function G1(t){const e={name:t.getAttribute("name")||"",rigidBodies:{}};for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];if(n.nodeType===1)switch(n.nodeName){case"rigid_body":e.rigidBodies[n.getAttribute("name")]={},P1(n,e.rigidBodies[n.getAttribute("name")]);break}}j.physicsModels[t.getAttribute("id")]=e}function P1(t,e){for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];if(n.nodeType===1)switch(n.nodeName){case"technique_common":$1(n,e);break}}}function $1(t,e){for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];if(n.nodeType===1)switch(n.nodeName){case"inertia":e.inertia=_(n.textContent);break;case"mass":e.mass=_(n.textContent)[0];break}}}function W1(t){const e={bindJointAxis:[]};for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];if(n.nodeType===1)switch(n.nodeName){case"bind_joint_axis":e.bindJointAxis.push(J1(n));break}}j.kinematicsScenes[F(t.getAttribute("url"))]=e}function J1(t){const e={target:t.getAttribute("target").split("/").pop()};for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];if(n.nodeType===1)switch(n.nodeName){case"axis":const s=n.getElementsByTagName("param")[0];e.axis=s.textContent;const r=e.axis.split("inst_").pop().split("axis")[0];e.jointIndex=r.substring(0,r.length-1);break}}return e}function K1(t){return t.build!==void 0?t.build:t}function Y1(t){return V(j.kinematicsScenes[t],K1)}function X1(){const t=Object.keys(j.kinematicsModels)[0],e=Object.keys(j.kinematicsScenes)[0],i=Object.keys(j.visualScenes)[0];if(t===void 0||e===void 0)return;const n=I1(t),s=Y1(e),r=o1(i),c=s.bindJointAxis,A={};for(let T=0,d=c.length;T<d;T++){const N=c[T],k=w3.querySelector('[sid="'+N.target+'"]');if(k){const q=k.parentElement;m(N.jointIndex,q)}}function m(T,d){const N=d.getAttribute("name"),k=n.joints[T];r.traverse(function(q){q.name===N&&(A[T]={object:q,transforms:Z1(d),joint:k,position:k.zeroPosition})})}const w=new a.Matrix4;d1={joints:n&&n.joints,getJointValue:function(T){const d=A[T];if(d)return d.position;console.warn("THREE.ColladaLoader: Joint "+T+" doesn't exist.")},setJointValue:function(T,d){const N=A[T];if(N){const k=N.joint;if(d>k.limits.max||d<k.limits.min)console.warn("THREE.ColladaLoader: Joint "+T+" value "+d+" outside of limits (min: "+k.limits.min+", max: "+k.limits.max+").");else if(k.static)console.warn("THREE.ColladaLoader: Joint "+T+" is static.");else{const q=N.object,E=k.axis,m3=N.transforms;_3.identity();for(let c3=0;c3<m3.length;c3++){const t3=m3[c3];if(t3.sid&&t3.sid.indexOf(T)!==-1)switch(k.type){case"revolute":_3.multiply(w.makeRotationAxis(E,a.MathUtils.degToRad(d)));break;case"prismatic":_3.multiply(w.makeTranslation(E.x*d,E.y*d,E.z*d));break;default:console.warn("THREE.ColladaLoader: Unknown joint type: "+k.type);break}else switch(t3.type){case"matrix":_3.multiply(t3.obj);break;case"translate":_3.multiply(w.makeTranslation(t3.obj.x,t3.obj.y,t3.obj.z));break;case"scale":_3.scale(t3.obj);break;case"rotate":_3.multiply(w.makeRotationAxis(t3.obj,t3.angle));break}}q.matrix.copy(_3),q.matrix.decompose(q.position,q.quaternion,q.scale),A[T].position=d}}else console.log("THREE.ColladaLoader: "+T+" does not exist.")}}}function Z1(t){const e=[],i=w3.querySelector('[id="'+t.id+'"]');for(let n=0;n<i.childNodes.length;n++){const s=i.childNodes[n];if(s.nodeType!==1)continue;let r,c;switch(s.nodeName){case"matrix":r=_(s.textContent);const A=new a.Matrix4().fromArray(r).transpose();e.push({sid:s.getAttribute("sid"),type:s.nodeName,obj:A});break;case"translate":case"scale":r=_(s.textContent),c=new a.Vector3().fromArray(r),e.push({sid:s.getAttribute("sid"),type:s.nodeName,obj:c});break;case"rotate":r=_(s.textContent),c=new a.Vector3().fromArray(r);const m=a.MathUtils.degToRad(r[3]);e.push({sid:s.getAttribute("sid"),type:s.nodeName,obj:c,angle:m});break}}return e}function Q1(t){const e=t.getElementsByTagName("node");for(let i=0;i<e.length;i++){const n=e[i];n.hasAttribute("id")===!1&&n.setAttribute("id",X())}}const _3=new a.Matrix4,E3=new a.Vector3;function D3(t){const e={name:t.getAttribute("name")||"",type:t.getAttribute("type"),id:t.getAttribute("id"),sid:t.getAttribute("sid"),matrix:new a.Matrix4,nodes:[],instanceCameras:[],instanceControllers:[],instanceLights:[],instanceGeometries:[],instanceNodes:[],transforms:{}};for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];if(n.nodeType!==1)continue;let s;switch(n.nodeName){case"node":e.nodes.push(n.getAttribute("id")),D3(n);break;case"instance_camera":e.instanceCameras.push(F(n.getAttribute("url")));break;case"instance_controller":e.instanceControllers.push(t1(n));break;case"instance_light":e.instanceLights.push(F(n.getAttribute("url")));break;case"instance_geometry":e.instanceGeometries.push(t1(n));break;case"instance_node":e.instanceNodes.push(F(n.getAttribute("url")));break;case"matrix":s=_(n.textContent),e.matrix.multiply(_3.fromArray(s).transpose()),e.transforms[n.getAttribute("sid")]=n.nodeName;break;case"translate":s=_(n.textContent),E3.fromArray(s),e.matrix.multiply(_3.makeTranslation(E3.x,E3.y,E3.z)),e.transforms[n.getAttribute("sid")]=n.nodeName;break;case"rotate":s=_(n.textContent);const r=a.MathUtils.degToRad(s[3]);e.matrix.multiply(_3.makeRotationAxis(E3.fromArray(s),r)),e.transforms[n.getAttribute("sid")]=n.nodeName;break;case"scale":s=_(n.textContent),e.matrix.scale(E3.fromArray(s)),e.transforms[n.getAttribute("sid")]=n.nodeName;break;case"extra":break;default:console.log(n)}}return s1(e.id)?console.warn("THREE.ColladaLoader: There is already a node with ID %s. Exclude current node from further processing.",e.id):j.nodes[e.id]=e,e}function t1(t){const e={id:F(t.getAttribute("url")),materials:{},skeletons:[]};for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];switch(n.nodeName){case"bind_material":const s=n.getElementsByTagName("instance_material");for(let r=0;r<s.length;r++){const c=s[r],A=c.getAttribute("symbol"),m=c.getAttribute("target");e.materials[A]=F(m)}break;case"skeleton":e.skeletons.push(F(n.textContent));break}}return e}function e2(t,e){const i=[],n=[];let s,r,c;for(s=0;s<t.length;s++){const w=t[s];let T;if(s1(w))T=B3(w),n1(T,e,i);else if(a2(w)){const N=j.visualScenes[w].children;for(let k=0;k<N.length;k++){const q=N[k];if(q.type==="JOINT"){const E=B3(q.id);n1(E,e,i)}}}else console.error("THREE.ColladaLoader: Unable to find root bone of skeleton with ID:",w)}for(s=0;s<e.length;s++)for(r=0;r<i.length;r++)if(c=i[r],c.bone.name===e[s].name){n[s]=c,c.processed=!0;break}for(s=0;s<i.length;s++)c=i[s],c.processed===!1&&(n.push(c),c.processed=!0);const A=[],m=[];for(s=0;s<n.length;s++)c=n[s],A.push(c.bone),m.push(c.boneInverse);return new a.Skeleton(A,m)}function n1(t,e,i){t.traverse(function(n){if(n.isBone===!0){let s;for(let r=0;r<e.length;r++){const c=e[r];if(c.name===n.name){s=c.boneInverse;break}}s===void 0&&(s=new a.Matrix4),i.push({bone:n,boneInverse:s,processed:!1})}})}function t2(t){const e=[],i=t.matrix,n=t.nodes,s=t.type,r=t.instanceCameras,c=t.instanceControllers,A=t.instanceLights,m=t.instanceGeometries,w=t.instanceNodes;for(let d=0,N=n.length;d<N;d++)e.push(B3(n[d]));for(let d=0,N=r.length;d<N;d++){const k=k1(r[d]);k!==null&&e.push(k.clone())}for(let d=0,N=c.length;d<N;d++){const k=c[d],q=S(k.id),E=Z3(q.id),m3=i1(E,k.materials),c3=k.skeletons,t3=q.skin.joints,n3=e2(c3,t3);for(let H3=0,k3=m3.length;H3<k3;H3++){const V3=m3[H3];V3.isSkinnedMesh&&(V3.bind(n3,q.skin.bindMatrix),V3.normalizeSkinWeights()),e.push(V3)}}for(let d=0,N=A.length;d<N;d++){const k=T1(A[d]);k!==null&&e.push(k.clone())}for(let d=0,N=m.length;d<N;d++){const k=m[d],q=Z3(k.id),E=i1(q,k.materials);for(let m3=0,c3=E.length;m3<c3;m3++)e.push(E[m3])}for(let d=0,N=w.length;d<N;d++)e.push(B3(w[d]).clone());let T;if(n.length===0&&e.length===1)T=e[0];else{T=s==="JOINT"?new a.Bone:new a.Group;for(let d=0;d<e.length;d++)T.add(e[d])}return T.name=s==="JOINT"?t.sid:t.name,T.matrix.copy(i),T.matrix.decompose(T.position,T.quaternion,T.scale),T}const n2=new a.MeshBasicMaterial({name:a.Loader.DEFAULT_MATERIAL_NAME,color:16711935});function i2(t,e){const i=[];for(let n=0,s=t.length;n<s;n++){const r=e[t[n]];r===void 0?(console.warn("THREE.ColladaLoader: Material with key %s not found. Apply fallback material.",t[n]),i.push(n2)):i.push(z1(r))}return i}function i1(t,e){const i=[];for(const n in t){const s=t[n],r=i2(s.materialKeys,e);if(r.length===0&&(n==="lines"||n==="linestrips"?r.push(new a.LineBasicMaterial):r.push(new a.MeshPhongMaterial)),n==="lines"||n==="linestrips")for(let w=0,T=r.length;w<T;w++){const d=r[w];if(d.isMeshPhongMaterial===!0||d.isMeshLambertMaterial===!0){const N=new a.LineBasicMaterial;N.color.copy(d.color),N.opacity=d.opacity,N.transparent=d.transparent,r[w]=N}}const c=s.data.attributes.skinIndex!==void 0,A=r.length===1?r[0]:r;let m;switch(n){case"lines":m=new a.LineSegments(s.data,A);break;case"linestrips":m=new a.Line(s.data,A);break;case"triangles":case"polylist":c?m=new a.SkinnedMesh(s.data,A):m=new a.Mesh(s.data,A);break}i.push(m)}return i}function s1(t){return j.nodes[t]!==void 0}function B3(t){return V(j.nodes[t],t2)}function s2(t){const e={name:t.getAttribute("name"),children:[]};Q1(t);const i=R(t,"node");for(let n=0;n<i.length;n++)e.children.push(D3(i[n]));j.visualScenes[t.getAttribute("id")]=e}function a1(t){const e=new a.Group;e.name=t.name;const i=t.children;for(let n=0;n<i.length;n++){const s=i[n];e.add(B3(s.id))}return e}function a2(t){return j.visualScenes[t]!==void 0}function o1(t){return V(j.visualScenes[t],a1)}function o2(t){const e=R(t,"instance_visual_scene")[0];return o1(F(e.getAttribute("url")))}function r2(){const t=j.clips;if(l3(t)===!0){if(l3(j.animations)===!1){const e=[];for(const i in j.animations){const n=L(i);for(let s=0,r=n.length;s<r;s++)e.push(n[s])}I3.push(new a.AnimationClip("default",-1,e))}}else for(const e in t)I3.push(i3(e))}function c2(t){let e="";const i=[t];for(;i.length;){const n=i.shift();n.nodeType===Node.TEXT_NODE?e+=n.textContent:(e+=`
|
|
1
|
+
"use strict";const T3=require("./MTLLoader-BHi2OdAd.cjs"),a=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BFpx7u6S.cjs"),u2=require("./threeViewerHost-DPjfCjcT.cjs"),q3=require("./index-CEwxrYB-.cjs"),f2=require("vue"),p2=require("./index.vue_vue_type_style_index_1_lang-CrR96PnG.cjs");class u1 extends a.DataTextureLoader{constructor(C){super(C)}parse(C){function P(x){switch(x.image_type){case $:case V:if(x.colormap_length>256||x.colormap_size!==24||x.colormap_type!==1)throw new Error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case h:case o:case z:case y:if(x.colormap_type)throw new Error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case h3:throw new Error("THREE.TGALoader: No data.");default:throw new Error("THREE.TGALoader: Invalid type "+x.image_type)}if(x.width<=0||x.height<=0)throw new Error("THREE.TGALoader: Invalid image size.");if(x.pixel_size!==8&&x.pixel_size!==16&&x.pixel_size!==24&&x.pixel_size!==32)throw new Error("THREE.TGALoader: Invalid pixel size "+x.pixel_size)}function R(x,o3,i3,Q,u3){let Z,s3;const W=i3.pixel_size>>3,D=i3.width*i3.height*W;if(o3&&(s3=u3.subarray(Q,Q+=i3.colormap_length*(i3.colormap_size>>3))),x){Z=new Uint8Array(D);let S,M,B,a3=0;const v=new Uint8Array(W);for(;a3<D;)if(S=u3[Q++],M=(S&127)+1,S&128){for(B=0;B<W;++B)v[B]=u3[Q++];for(B=0;B<M;++B)Z.set(v,a3+B*W);a3+=W*M}else{for(M*=W,B=0;B<M;++B)Z[a3+B]=u3[Q++];a3+=M}}else Z=u3.subarray(Q,Q+=o3?i3.width*i3.height:D);return{pixel_data:Z,palettes:s3}}function l(x,o3,i3,Q,u3,Z,s3,W,D){const S=D;let M,B=0,a3,v;const K=G.width;for(v=o3;v!==Q;v+=i3)for(a3=u3;a3!==s3;a3+=Z,B++)M=W[B],x[(a3+K*v)*4+3]=255,x[(a3+K*v)*4+2]=S[M*3+0],x[(a3+K*v)*4+1]=S[M*3+1],x[(a3+K*v)*4+0]=S[M*3+2];return x}function _(x,o3,i3,Q,u3,Z,s3,W){let D,S=0,M,B;const a3=G.width;for(B=o3;B!==Q;B+=i3)for(M=u3;M!==s3;M+=Z,S+=2)D=W[S+0]+(W[S+1]<<8),x[(M+a3*B)*4+0]=(D&31744)>>7,x[(M+a3*B)*4+1]=(D&992)>>2,x[(M+a3*B)*4+2]=(D&31)<<3,x[(M+a3*B)*4+3]=D&32768?0:255;return x}function J(x,o3,i3,Q,u3,Z,s3,W){let D=0,S,M;const B=G.width;for(M=o3;M!==Q;M+=i3)for(S=u3;S!==s3;S+=Z,D+=3)x[(S+B*M)*4+3]=255,x[(S+B*M)*4+2]=W[D+0],x[(S+B*M)*4+1]=W[D+1],x[(S+B*M)*4+0]=W[D+2];return x}function F(x,o3,i3,Q,u3,Z,s3,W){let D=0,S,M;const B=G.width;for(M=o3;M!==Q;M+=i3)for(S=u3;S!==s3;S+=Z,D+=4)x[(S+B*M)*4+2]=W[D+0],x[(S+B*M)*4+1]=W[D+1],x[(S+B*M)*4+0]=W[D+2],x[(S+B*M)*4+3]=W[D+3];return x}function X(x,o3,i3,Q,u3,Z,s3,W){let D,S=0,M,B;const a3=G.width;for(B=o3;B!==Q;B+=i3)for(M=u3;M!==s3;M+=Z,S++)D=W[S],x[(M+a3*B)*4+0]=D,x[(M+a3*B)*4+1]=D,x[(M+a3*B)*4+2]=D,x[(M+a3*B)*4+3]=255;return x}function l3(x,o3,i3,Q,u3,Z,s3,W){let D=0,S,M;const B=G.width;for(M=o3;M!==Q;M+=i3)for(S=u3;S!==s3;S+=Z,D+=2)x[(S+B*M)*4+0]=W[D+0],x[(S+B*M)*4+1]=W[D+0],x[(S+B*M)*4+2]=W[D+0],x[(S+B*M)*4+3]=W[D+1];return x}function d3(x,o3,i3,Q,u3){let Z,s3,W,D,S,M;switch((G.flags&p)>>f){default:case I:Z=0,W=1,S=o3,s3=0,D=1,M=i3;break;case L:Z=0,W=1,S=o3,s3=i3-1,D=-1,M=-1;break;case O:Z=o3-1,W=-1,S=-1,s3=0,D=1,M=i3;break;case g:Z=o3-1,W=-1,S=-1,s3=i3-1,D=-1,M=-1;break}if(Y)switch(G.pixel_size){case 8:X(x,s3,D,M,Z,W,S,Q);break;case 16:l3(x,s3,D,M,Z,W,S,Q);break;default:throw new Error("THREE.TGALoader: Format not supported.")}else switch(G.pixel_size){case 8:l(x,s3,D,M,Z,W,S,Q,u3);break;case 16:_(x,s3,D,M,Z,W,S,Q);break;case 24:J(x,s3,D,M,Z,W,S,Q);break;case 32:F(x,s3,D,M,Z,W,S,Q);break;default:throw new Error("THREE.TGALoader: Format not supported.")}return x}const h3=0,$=1,h=2,o=3,V=9,z=10,y=11,p=48,f=4,L=0,g=1,I=2,O=3;if(C.length<19)throw new Error("THREE.TGALoader: Not enough data to contain header.");let u=0;const b=new Uint8Array(C),G={id_length:b[u++],colormap_type:b[u++],image_type:b[u++],colormap_index:b[u++]|b[u++]<<8,colormap_length:b[u++]|b[u++]<<8,colormap_size:b[u++],origin:[b[u++]|b[u++]<<8,b[u++]|b[u++]<<8],width:b[u++]|b[u++]<<8,height:b[u++]|b[u++]<<8,pixel_size:b[u++],flags:b[u++]};if(P(G),G.id_length+u>C.length)throw new Error("THREE.TGALoader: No data.");u+=G.id_length;let U=!1,H=!1,Y=!1;switch(G.image_type){case V:U=!0,H=!0;break;case $:H=!0;break;case z:U=!0;break;case h:break;case y:U=!0,Y=!0;break;case o:Y=!0;break}const A3=new Uint8Array(G.width*G.height*4),g3=R(U,H,G,u,b);return d3(A3,G.width,G.height,g3.pixel_data,g3.palettes),{data:A3,width:G.width,height:G.height,flipY:!0,generateMipmaps:!0,minFilter:a.LinearMipmapLinearFilter}}}class m2 extends a.Loader{load(C,P,R,l){const _=this,J=_.path===""?a.LoaderUtils.extractUrlBase(C):_.path,F=new a.FileLoader(_.manager);F.setPath(_.path),F.setRequestHeader(_.requestHeader),F.setWithCredentials(_.withCredentials),F.load(C,function(X){try{P(_.parse(X,J))}catch(l3){l?l(l3):console.error(l3),_.manager.itemError(C)}},R,l)}parse(C,P){function R(t,e){const i=[],n=t.childNodes;for(let s=0,r=n.length;s<r;s++){const c=n[s];c.nodeName===e&&i.push(c)}return i}function l(t){if(t.length===0)return[];const e=t.trim().split(/\s+/),i=new Array(e.length);for(let n=0,s=e.length;n<s;n++)i[n]=e[n];return i}function _(t){if(t.length===0)return[];const e=t.trim().split(/\s+/),i=new Array(e.length);for(let n=0,s=e.length;n<s;n++)i[n]=parseFloat(e[n]);return i}function J(t){if(t.length===0)return[];const e=t.trim().split(/\s+/),i=new Array(e.length);for(let n=0,s=e.length;n<s;n++)i[n]=parseInt(e[n]);return i}function F(t){return t.substring(1)}function X(){return"three_default_"+d2++}function l3(t){return Object.keys(t).length===0}function d3(t){return{unit:h3(R(t,"unit")[0]),upAxis:$(R(t,"up_axis")[0])}}function h3(t){return t!==void 0&&t.hasAttribute("meter")===!0?parseFloat(t.getAttribute("meter")):1}function $(t){return t!==void 0?t.textContent:"Y_UP"}function h(t,e,i,n){const s=R(t,e)[0];if(s!==void 0){const r=R(s,i);for(let c=0;c<r.length;c++)n(r[c])}}function o(t,e){for(const i in t){const n=t[i];n.build=e(t[i])}}function V(t,e){return t.build!==void 0||(t.build=e(t)),t.build}function z(t){const e={sources:{},samplers:{},channels:{}};let i=!1;for(let n=0,s=t.childNodes.length;n<s;n++){const r=t.childNodes[n];if(r.nodeType!==1)continue;let c;switch(r.nodeName){case"source":c=r.getAttribute("id"),e.sources[c]=j3(r);break;case"sampler":c=r.getAttribute("id"),e.samplers[c]=y(r);break;case"channel":c=r.getAttribute("target"),e.channels[c]=p(r);break;case"animation":z(r),i=!0;break;default:console.log(r)}}i===!1&&(j.animations[t.getAttribute("id")||a.MathUtils.generateUUID()]=e)}function y(t){const e={inputs:{}};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"input":const r=F(s.getAttribute("source")),c=s.getAttribute("semantic");e.inputs[c]=r;break}}return e}function p(t){const e={};let n=t.getAttribute("target").split("/");const s=n.shift();let r=n.shift();const c=r.indexOf("(")!==-1,A=r.indexOf(".")!==-1;if(A)n=r.split("."),r=n.shift(),e.member=n.shift();else if(c){const m=r.split("(");r=m.shift();for(let w=0;w<m.length;w++)m[w]=parseInt(m[w].replace(/\)/,""));e.indices=m}return e.id=s,e.sid=r,e.arraySyntax=c,e.memberSyntax=A,e.sampler=F(t.getAttribute("source")),e}function f(t){const e=[],i=t.channels,n=t.samplers,s=t.sources;for(const r in i)if(i.hasOwnProperty(r)){const c=i[r],A=n[c.sampler],m=A.inputs.INPUT,w=A.inputs.OUTPUT,T=s[m],d=s[w],N=g(c,T,d);G(N,e)}return e}function L(t){return V(j.animations[t],f)}function g(t,e,i){const n=j.nodes[t.id],s=B3(n.id),r=n.transforms[t.sid],c=n.matrix.clone().transpose();let A,m,w,T,d,N;const k={};switch(r){case"matrix":for(w=0,T=e.array.length;w<T;w++)if(A=e.array[w],m=w*i.stride,k[A]===void 0&&(k[A]={}),t.arraySyntax===!0){const m3=i.array[m],c3=t.indices[0]+4*t.indices[1];k[A][c3]=m3}else for(d=0,N=i.stride;d<N;d++)k[A][d]=i.array[m+d];break;case"translate":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',r);break;case"rotate":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',r);break;case"scale":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',r);break}const q=I(k,c);return{name:s.uuid,keyframes:q}}function I(t,e){const i=[];for(const s in t)i.push({time:parseFloat(s),value:t[s]});i.sort(n);for(let s=0;s<16;s++)U(i,s,e.elements[s]);return i;function n(s,r){return s.time-r.time}}const O=new a.Vector3,u=new a.Vector3,b=new a.Quaternion;function G(t,e){const i=t.keyframes,n=t.name,s=[],r=[],c=[],A=[];for(let m=0,w=i.length;m<w;m++){const T=i[m],d=T.time,N=T.value;_3.fromArray(N).transpose(),_3.decompose(O,b,u),s.push(d),r.push(O.x,O.y,O.z),c.push(b.x,b.y,b.z,b.w),A.push(u.x,u.y,u.z)}return r.length>0&&e.push(new a.VectorKeyframeTrack(n+".position",s,r)),c.length>0&&e.push(new a.QuaternionKeyframeTrack(n+".quaternion",s,c)),A.length>0&&e.push(new a.VectorKeyframeTrack(n+".scale",s,A)),e}function U(t,e,i){let n,s=!0,r,c;for(r=0,c=t.length;r<c;r++)n=t[r],n.value[e]===void 0?n.value[e]=null:s=!1;if(s===!0)for(r=0,c=t.length;r<c;r++)n=t[r],n.value[e]=i;else H(t,e)}function H(t,e){let i,n;for(let s=0,r=t.length;s<r;s++){const c=t[s];if(c.value[e]===null){if(i=Y(t,s,e),n=A3(t,s,e),i===null){c.value[e]=n.value[e];continue}if(n===null){c.value[e]=i.value[e];continue}g3(c,i,n,e)}}}function Y(t,e,i){for(;e>=0;){const n=t[e];if(n.value[i]!==null)return n;e--}return null}function A3(t,e,i){for(;e<t.length;){const n=t[e];if(n.value[i]!==null)return n;e++}return null}function g3(t,e,i,n){if(i.time-e.time===0){t.value[n]=e.value[n];return}t.value[n]=(t.time-e.time)*(i.value[n]-e.value[n])/(i.time-e.time)+e.value[n]}function x(t){const e={name:t.getAttribute("id")||"default",start:parseFloat(t.getAttribute("start")||0),end:parseFloat(t.getAttribute("end")||0),animations:[]};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"instance_animation":e.animations.push(F(s.getAttribute("url")));break}}j.clips[t.getAttribute("id")]=e}function o3(t){const e=[],i=t.name,n=t.end-t.start||-1,s=t.animations;for(let r=0,c=s.length;r<c;r++){const A=L(s[r]);for(let m=0,w=A.length;m<w;m++)e.push(A[m])}return new a.AnimationClip(i,n,e)}function i3(t){return V(j.clips[t],o3)}function Q(t){const e={};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"skin":e.id=F(s.getAttribute("source")),e.skin=u3(s);break;case"morph":e.id=F(s.getAttribute("source")),console.warn("THREE.ColladaLoader: Morph target animation not supported yet.");break}}j.controllers[t.getAttribute("id")]=e}function u3(t){const e={sources:{}};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"bind_shape_matrix":e.bindShapeMatrix=_(s.textContent);break;case"source":const r=s.getAttribute("id");e.sources[r]=j3(s);break;case"joints":e.joints=Z(s);break;case"vertex_weights":e.vertexWeights=s3(s);break}}return e}function Z(t){const e={inputs:{}};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"input":const r=s.getAttribute("semantic"),c=F(s.getAttribute("source"));e.inputs[r]=c;break}}return e}function s3(t){const e={inputs:{}};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"input":const r=s.getAttribute("semantic"),c=F(s.getAttribute("source")),A=parseInt(s.getAttribute("offset"));e.inputs[r]={id:c,offset:A};break;case"vcount":e.vcount=J(s.textContent);break;case"v":e.v=J(s.textContent);break}}return e}function W(t){const e={id:t.id},i=j.geometries[e.id];return t.skin!==void 0&&(e.skin=D(t.skin),i.sources.skinIndices=e.skin.indices,i.sources.skinWeights=e.skin.weights),e}function D(t){const i={joints:[],indices:{array:[],stride:4},weights:{array:[],stride:4}},n=t.sources,s=t.vertexWeights,r=s.vcount,c=s.v,A=s.inputs.JOINT.offset,m=s.inputs.WEIGHT.offset,w=t.sources[t.joints.inputs.JOINT],T=t.sources[t.joints.inputs.INV_BIND_MATRIX],d=n[s.inputs.WEIGHT.id].array;let N=0,k,q,E;for(k=0,E=r.length;k<E;k++){const c3=r[k],t3=[];for(q=0;q<c3;q++){const n3=c[N+A],H3=c[N+m],k3=d[H3];t3.push({index:n3,weight:k3}),N+=2}for(t3.sort(m3),q=0;q<4;q++){const n3=t3[q];n3!==void 0?(i.indices.array.push(n3.index),i.weights.array.push(n3.weight)):(i.indices.array.push(0),i.weights.array.push(0))}}for(t.bindShapeMatrix?i.bindMatrix=new a.Matrix4().fromArray(t.bindShapeMatrix).transpose():i.bindMatrix=new a.Matrix4().identity(),k=0,E=w.array.length;k<E;k++){const c3=w.array[k],t3=new a.Matrix4().fromArray(T.array,k*T.stride).transpose();i.joints.push({name:c3,boneInverse:t3})}return i;function m3(c3,t3){return t3.weight-c3.weight}}function S(t){return V(j.controllers[t],W)}function M(t){const e={init_from:R(t,"init_from")[0].textContent};j.images[t.getAttribute("id")]=e}function B(t){return t.build!==void 0?t.build:t.init_from}function a3(t){const e=j.images[t];return e!==void 0?V(e,B):(console.warn("THREE.ColladaLoader: Couldn't find image with ID:",t),null)}function v(t){const e={};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"profile_COMMON":e.profile=K(s);break}}j.effects[t.getAttribute("id")]=e}function K(t){const e={surfaces:{},samplers:{}};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"newparam":e3(s,e);break;case"technique":e.technique=r3(s);break;case"extra":e.extra=p3(s);break}}return e}function e3(t,e){const i=t.getAttribute("sid");for(let n=0,s=t.childNodes.length;n<s;n++){const r=t.childNodes[n];if(r.nodeType===1)switch(r.nodeName){case"surface":e.surfaces[i]=f3(r);break;case"sampler2D":e.samplers[i]=x3(r);break}}}function f3(t){const e={};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"init_from":e.init_from=s.textContent;break}}return e}function x3(t){const e={};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"source":e.source=s.textContent;break}}return e}function r3(t){const e={};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"constant":case"lambert":case"blinn":case"phong":e.type=s.nodeName,e.parameters=z3(s);break;case"extra":e.extra=p3(s);break}}return e}function z3(t){const e={};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"emission":case"diffuse":case"specular":case"bump":case"ambient":case"shininess":case"transparency":e[s.nodeName]=L3(s);break;case"transparent":e[s.nodeName]={opaque:s.hasAttribute("opaque")?s.getAttribute("opaque"):"A_ONE",data:L3(s)};break}}return e}function L3(t){const e={};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"color":e[s.nodeName]=_(s.textContent);break;case"float":e[s.nodeName]=parseFloat(s.textContent);break;case"texture":e[s.nodeName]={id:s.getAttribute("texture"),extra:b3(s)};break}}return e}function b3(t){const e={technique:{}};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"extra":M3(s,e);break}}return e}function M3(t,e){for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"technique":y3(s,e);break}}}function y3(t,e){for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"repeatU":case"repeatV":case"offsetU":case"offsetV":e.technique[s.nodeName]=parseFloat(s.textContent);break;case"wrapU":case"wrapV":s.textContent.toUpperCase()==="TRUE"?e.technique[s.nodeName]=1:s.textContent.toUpperCase()==="FALSE"?e.technique[s.nodeName]=0:e.technique[s.nodeName]=parseInt(s.textContent);break;case"bump":e[s.nodeName]=R3(s);break}}}function p3(t){const e={};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"technique":e.technique=N3(s);break}}return e}function N3(t){const e={};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"double_sided":e[s.nodeName]=parseInt(s.textContent);break;case"bump":e[s.nodeName]=R3(s);break}}return e}function R3(t){const e={};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"texture":e[s.nodeName]={id:s.getAttribute("texture"),texcoord:s.getAttribute("texcoord"),extra:b3(s)};break}}return e}function W3(t){return t}function y1(t){return V(j.effects[t],W3)}function w1(t){const e={name:t.getAttribute("name")};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"instance_effect":e.url=F(s.getAttribute("url"));break}}j.materials[t.getAttribute("id")]=e}function v1(t){let e,i=t.slice((t.lastIndexOf(".")-1>>>0)+2);switch(i=i.toLowerCase(),i){case"tga":e=P3;break;default:e=l1}return e}function J3(t){const e=y1(t.url),i=e.profile.technique;let n;switch(i.type){case"phong":case"blinn":n=new a.MeshPhongMaterial;break;case"lambert":n=new a.MeshLambertMaterial;break;default:n=new a.MeshBasicMaterial;break}n.name=t.name||"";function s(m,w=null){const T=e.profile.samplers[m.id];let d=null;if(T!==void 0){const N=e.profile.surfaces[T.source];d=a3(N.init_from)}else console.warn("THREE.ColladaLoader: Undefined sampler. Access image directly (see #12530)."),d=a3(m.id);if(d!==null){const N=v1(d);if(N!==void 0){const k=N.load(d),q=m.extra;if(q!==void 0&&q.technique!==void 0&&l3(q.technique)===!1){const E=q.technique;k.wrapS=E.wrapU?a.RepeatWrapping:a.ClampToEdgeWrapping,k.wrapT=E.wrapV?a.RepeatWrapping:a.ClampToEdgeWrapping,k.offset.set(E.offsetU||0,E.offsetV||0),k.repeat.set(E.repeatU||1,E.repeatV||1)}else k.wrapS=a.RepeatWrapping,k.wrapT=a.RepeatWrapping;return w!==null&&(k.colorSpace=w),k}else return console.warn("THREE.ColladaLoader: Loader for texture %s not found.",d),null}else return console.warn("THREE.ColladaLoader: Couldn't create texture with ID:",m.id),null}const r=i.parameters;for(const m in r){const w=r[m];switch(m){case"diffuse":w.color&&n.color.fromArray(w.color),w.texture&&(n.map=s(w.texture,a.SRGBColorSpace));break;case"specular":w.color&&n.specular&&n.specular.fromArray(w.color),w.texture&&(n.specularMap=s(w.texture));break;case"bump":w.texture&&(n.normalMap=s(w.texture));break;case"ambient":w.texture&&(n.lightMap=s(w.texture,a.SRGBColorSpace));break;case"shininess":w.float&&n.shininess&&(n.shininess=w.float);break;case"emission":w.color&&n.emissive&&n.emissive.fromArray(w.color),w.texture&&(n.emissiveMap=s(w.texture,a.SRGBColorSpace));break}}a.ColorManagement.colorSpaceToWorking(n.color,a.SRGBColorSpace),n.specular&&a.ColorManagement.colorSpaceToWorking(n.specular,a.SRGBColorSpace),n.emissive&&a.ColorManagement.colorSpaceToWorking(n.emissive,a.SRGBColorSpace);let c=r.transparent,A=r.transparency;if(A===void 0&&c&&(A={float:1}),c===void 0&&A&&(c={opaque:"A_ONE",data:{color:[1,1,1,1]}}),c&&A)if(c.data.texture)n.transparent=!0;else{const m=c.data.color;switch(c.opaque){case"A_ONE":n.opacity=m[3]*A.float;break;case"RGB_ZERO":n.opacity=1-m[0]*A.float;break;case"A_ZERO":n.opacity=1-m[3]*A.float;break;case"RGB_ONE":n.opacity=m[0]*A.float;break;default:console.warn('THREE.ColladaLoader: Invalid opaque type "%s" of transparent tag.',c.opaque)}n.opacity<1&&(n.transparent=!0)}if(i.extra!==void 0&&i.extra.technique!==void 0){const m=i.extra.technique;for(const w in m){const T=m[w];switch(w){case"double_sided":n.side=T===1?a.DoubleSide:a.FrontSide;break;case"bump":n.normalMap=s(T.texture),n.normalScale=new a.Vector2(1,1);break}}}return n}function z1(t){return V(j.materials[t],J3)}function M1(t){const e={name:t.getAttribute("name")};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"optics":e.optics=x1(s);break}}j.cameras[t.getAttribute("id")]=e}function x1(t){for(let e=0;e<t.childNodes.length;e++){const i=t.childNodes[e];switch(i.nodeName){case"technique_common":return A1(i)}}return{}}function A1(t){const e={};for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];switch(n.nodeName){case"perspective":case"orthographic":e.technique=n.nodeName,e.parameters=L1(n);break}}return e}function L1(t){const e={};for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];switch(n.nodeName){case"xfov":case"yfov":case"xmag":case"ymag":case"znear":case"zfar":case"aspect_ratio":e[n.nodeName]=parseFloat(n.textContent);break}}return e}function K3(t){let e;switch(t.optics.technique){case"perspective":e=new a.PerspectiveCamera(t.optics.parameters.yfov,t.optics.parameters.aspect_ratio,t.optics.parameters.znear,t.optics.parameters.zfar);break;case"orthographic":let i=t.optics.parameters.ymag,n=t.optics.parameters.xmag;const s=t.optics.parameters.aspect_ratio;n=n===void 0?i*s:n,i=i===void 0?n/s:i,n*=.5,i*=.5,e=new a.OrthographicCamera(-n,n,i,-i,t.optics.parameters.znear,t.optics.parameters.zfar);break;default:e=new a.PerspectiveCamera;break}return e.name=t.name||"",e}function k1(t){const e=j.cameras[t];return e!==void 0?V(e,K3):(console.warn("THREE.ColladaLoader: Couldn't find camera with ID:",t),null)}function _1(t){let e={};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"technique_common":e=N1(s);break}}j.lights[t.getAttribute("id")]=e}function N1(t){const e={};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"directional":case"point":case"spot":case"ambient":e.technique=s.nodeName,e.parameters=C1(s)}}return e}function C1(t){const e={};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"color":const r=_(s.textContent);e.color=new a.Color().fromArray(r),a.ColorManagement.colorSpaceToWorking(e.color,a.SRGBColorSpace);break;case"falloff_angle":e.falloffAngle=parseFloat(s.textContent);break;case"quadratic_attenuation":const c=parseFloat(s.textContent);e.distance=c?Math.sqrt(1/c):0;break}}return e}function Y3(t){let e;switch(t.technique){case"directional":e=new a.DirectionalLight;break;case"point":e=new a.PointLight;break;case"spot":e=new a.SpotLight;break;case"ambient":e=new a.AmbientLight;break}return t.parameters.color&&e.color.copy(t.parameters.color),t.parameters.distance&&(e.distance=t.parameters.distance),e}function T1(t){const e=j.lights[t];return e!==void 0?V(e,Y3):(console.warn("THREE.ColladaLoader: Couldn't find light with ID:",t),null)}function H1(t){const e={name:t.getAttribute("name"),sources:{},vertices:{},primitives:[]},i=R(t,"mesh")[0];if(i!==void 0){for(let n=0;n<i.childNodes.length;n++){const s=i.childNodes[n];if(s.nodeType!==1)continue;const r=s.getAttribute("id");switch(s.nodeName){case"source":e.sources[r]=j3(s);break;case"vertices":e.vertices=E1(s);break;case"polygons":console.warn("THREE.ColladaLoader: Unsupported primitive type: ",s.nodeName);break;case"lines":case"linestrips":case"polylist":case"triangles":e.primitives.push(B1(s));break;default:console.log(s)}}j.geometries[t.getAttribute("id")]=e}}function j3(t){const e={array:[],stride:3};for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];if(n.nodeType===1)switch(n.nodeName){case"float_array":e.array=_(n.textContent);break;case"Name_array":e.array=l(n.textContent);break;case"technique_common":const s=R(n,"accessor")[0];s!==void 0&&(e.stride=parseInt(s.getAttribute("stride")));break}}return e}function E1(t){const e={};for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];n.nodeType===1&&(e[n.getAttribute("semantic")]=F(n.getAttribute("source")))}return e}function B1(t){const e={type:t.nodeName,material:t.getAttribute("material"),count:parseInt(t.getAttribute("count")),inputs:{},stride:0,hasUV:!1};for(let i=0,n=t.childNodes.length;i<n;i++){const s=t.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"input":const r=F(s.getAttribute("source")),c=s.getAttribute("semantic"),A=parseInt(s.getAttribute("offset")),m=parseInt(s.getAttribute("set")),w=m>0?c+m:c;e.inputs[w]={id:r,offset:A},e.stride=Math.max(e.stride,A+1),c==="TEXCOORD"&&(e.hasUV=!0);break;case"vcount":e.vcount=J(s.textContent);break;case"p":e.p=J(s.textContent);break}}return e}function V1(t){const e={};for(let i=0;i<t.length;i++){const n=t[i];e[n.type]===void 0&&(e[n.type]=[]),e[n.type].push(n)}return e}function S1(t){let e=0;for(let i=0,n=t.length;i<n;i++)t[i].hasUV===!0&&e++;e>0&&e<t.length&&(t.uvsNeedsFix=!0)}function X3(t){const e={},i=t.sources,n=t.vertices,s=t.primitives;if(s.length===0)return{};const r=V1(s);for(const c in r){const A=r[c];S1(A),e[c]=q1(A,i,n)}return e}function q1(t,e,i){const n={},s={array:[],stride:0},r={array:[],stride:0},c={array:[],stride:0},A={array:[],stride:0},m={array:[],stride:0},w={array:[],stride:4},T={array:[],stride:4},d=new a.BufferGeometry,N=[];let k=0;for(let q=0;q<t.length;q++){const E=t[q],m3=E.inputs;let c3=0;switch(E.type){case"lines":case"linestrips":c3=E.count*2;break;case"triangles":c3=E.count*3;break;case"polylist":for(let t3=0;t3<E.count;t3++){const n3=E.vcount[t3];switch(n3){case 3:c3+=3;break;case 4:c3+=6;break;default:c3+=(n3-2)*3;break}}break;default:console.warn("THREE.ColladaLoader: Unknown primitive type:",E.type)}d.addGroup(k,c3,q),k+=c3,E.material&&N.push(E.material);for(const t3 in m3){const n3=m3[t3];switch(t3){case"VERTEX":for(const H3 in i){const k3=i[H3];switch(H3){case"POSITION":const V3=s.array.length;if(C3(E,e[k3],n3.offset,s.array),s.stride=e[k3].stride,e.skinWeights&&e.skinIndices&&(C3(E,e.skinIndices,n3.offset,w.array),C3(E,e.skinWeights,n3.offset,T.array)),E.hasUV===!1&&t.uvsNeedsFix===!0){const h2=(s.array.length-V3)/s.stride;for(let h1=0;h1<h2;h1++)c.array.push(0,0)}break;case"NORMAL":C3(E,e[k3],n3.offset,r.array),r.stride=e[k3].stride;break;case"COLOR":C3(E,e[k3],n3.offset,m.array),m.stride=e[k3].stride;break;case"TEXCOORD":C3(E,e[k3],n3.offset,c.array),c.stride=e[k3].stride;break;case"TEXCOORD1":C3(E,e[k3],n3.offset,A.array),c.stride=e[k3].stride;break;default:console.warn('THREE.ColladaLoader: Semantic "%s" not handled in geometry build process.',H3)}}break;case"NORMAL":C3(E,e[n3.id],n3.offset,r.array),r.stride=e[n3.id].stride;break;case"COLOR":C3(E,e[n3.id],n3.offset,m.array,!0),m.stride=e[n3.id].stride;break;case"TEXCOORD":C3(E,e[n3.id],n3.offset,c.array),c.stride=e[n3.id].stride;break;case"TEXCOORD1":C3(E,e[n3.id],n3.offset,A.array),A.stride=e[n3.id].stride;break}}}return s.array.length>0&&d.setAttribute("position",new a.Float32BufferAttribute(s.array,s.stride)),r.array.length>0&&d.setAttribute("normal",new a.Float32BufferAttribute(r.array,r.stride)),m.array.length>0&&d.setAttribute("color",new a.Float32BufferAttribute(m.array,m.stride)),c.array.length>0&&d.setAttribute("uv",new a.Float32BufferAttribute(c.array,c.stride)),A.array.length>0&&d.setAttribute("uv1",new a.Float32BufferAttribute(A.array,A.stride)),w.array.length>0&&d.setAttribute("skinIndex",new a.Float32BufferAttribute(w.array,w.stride)),T.array.length>0&&d.setAttribute("skinWeight",new a.Float32BufferAttribute(T.array,T.stride)),n.data=d,n.type=t[0].type,n.materialKeys=N,n}function C3(t,e,i,n,s=!1){const r=t.p,c=t.stride,A=t.vcount;function m(d){let N=r[d+i]*T;const k=N+T;for(;N<k;N++)n.push(w[N]);if(s){const q=n.length-T-1;F3.setRGB(n[q+0],n[q+1],n[q+2],a.SRGBColorSpace),n[q+0]=F3.r,n[q+1]=F3.g,n[q+2]=F3.b}}const w=e.array,T=e.stride;if(t.vcount!==void 0){let d=0;for(let N=0,k=A.length;N<k;N++){const q=A[N];if(q===4){const E=d+c*0,m3=d+c*1,c3=d+c*2,t3=d+c*3;m(E),m(m3),m(t3),m(m3),m(c3),m(t3)}else if(q===3){const E=d+c*0,m3=d+c*1,c3=d+c*2;m(E),m(m3),m(c3)}else if(q>4)for(let E=1,m3=q-2;E<=m3;E++){const c3=d+c*0,t3=d+c*E,n3=d+c*(E+1);m(c3),m(t3),m(n3)}d+=c*q}}else for(let d=0,N=r.length;d<N;d+=c)m(d)}function Z3(t){return V(j.geometries[t],X3)}function R1(t){const e={name:t.getAttribute("name")||"",joints:{},links:[]};for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];if(n.nodeType===1)switch(n.nodeName){case"technique_common":O1(n,e);break}}j.kinematicsModels[t.getAttribute("id")]=e}function F1(t){return t.build!==void 0?t.build:t}function I1(t){return V(j.kinematicsModels[t],F1)}function O1(t,e){for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];if(n.nodeType===1)switch(n.nodeName){case"joint":e.joints[n.getAttribute("sid")]=U1(n);break;case"link":e.links.push(Q3(n));break}}}function U1(t){let e;for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];if(n.nodeType===1)switch(n.nodeName){case"prismatic":case"revolute":e=j1(n);break}}return e}function j1(t){const e={sid:t.getAttribute("sid"),name:t.getAttribute("name")||"",axis:new a.Vector3,limits:{min:0,max:0},type:t.nodeName,static:!1,zeroPosition:0,middlePosition:0};for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];if(n.nodeType===1)switch(n.nodeName){case"axis":const s=_(n.textContent);e.axis.fromArray(s);break;case"limits":const r=n.getElementsByTagName("max")[0],c=n.getElementsByTagName("min")[0];e.limits.max=parseFloat(r.textContent),e.limits.min=parseFloat(c.textContent);break}}return e.limits.min>=e.limits.max&&(e.static=!0),e.middlePosition=(e.limits.min+e.limits.max)/2,e}function Q3(t){const e={sid:t.getAttribute("sid"),name:t.getAttribute("name")||"",attachments:[],transforms:[]};for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];if(n.nodeType===1)switch(n.nodeName){case"attachment_full":e.attachments.push(D1(n));break;case"matrix":case"translate":case"rotate":e.transforms.push(e1(n));break}}return e}function D1(t){const e={joint:t.getAttribute("joint").split("/").pop(),transforms:[],links:[]};for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];if(n.nodeType===1)switch(n.nodeName){case"link":e.links.push(Q3(n));break;case"matrix":case"translate":case"rotate":e.transforms.push(e1(n));break}}return e}function e1(t){const e={type:t.nodeName},i=_(t.textContent);switch(e.type){case"matrix":e.obj=new a.Matrix4,e.obj.fromArray(i).transpose();break;case"translate":e.obj=new a.Vector3,e.obj.fromArray(i);break;case"rotate":e.obj=new a.Vector3,e.obj.fromArray(i),e.angle=a.MathUtils.degToRad(i[3]);break}return e}function G1(t){const e={name:t.getAttribute("name")||"",rigidBodies:{}};for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];if(n.nodeType===1)switch(n.nodeName){case"rigid_body":e.rigidBodies[n.getAttribute("name")]={},P1(n,e.rigidBodies[n.getAttribute("name")]);break}}j.physicsModels[t.getAttribute("id")]=e}function P1(t,e){for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];if(n.nodeType===1)switch(n.nodeName){case"technique_common":$1(n,e);break}}}function $1(t,e){for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];if(n.nodeType===1)switch(n.nodeName){case"inertia":e.inertia=_(n.textContent);break;case"mass":e.mass=_(n.textContent)[0];break}}}function W1(t){const e={bindJointAxis:[]};for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];if(n.nodeType===1)switch(n.nodeName){case"bind_joint_axis":e.bindJointAxis.push(J1(n));break}}j.kinematicsScenes[F(t.getAttribute("url"))]=e}function J1(t){const e={target:t.getAttribute("target").split("/").pop()};for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];if(n.nodeType===1)switch(n.nodeName){case"axis":const s=n.getElementsByTagName("param")[0];e.axis=s.textContent;const r=e.axis.split("inst_").pop().split("axis")[0];e.jointIndex=r.substring(0,r.length-1);break}}return e}function K1(t){return t.build!==void 0?t.build:t}function Y1(t){return V(j.kinematicsScenes[t],K1)}function X1(){const t=Object.keys(j.kinematicsModels)[0],e=Object.keys(j.kinematicsScenes)[0],i=Object.keys(j.visualScenes)[0];if(t===void 0||e===void 0)return;const n=I1(t),s=Y1(e),r=o1(i),c=s.bindJointAxis,A={};for(let T=0,d=c.length;T<d;T++){const N=c[T],k=w3.querySelector('[sid="'+N.target+'"]');if(k){const q=k.parentElement;m(N.jointIndex,q)}}function m(T,d){const N=d.getAttribute("name"),k=n.joints[T];r.traverse(function(q){q.name===N&&(A[T]={object:q,transforms:Z1(d),joint:k,position:k.zeroPosition})})}const w=new a.Matrix4;d1={joints:n&&n.joints,getJointValue:function(T){const d=A[T];if(d)return d.position;console.warn("THREE.ColladaLoader: Joint "+T+" doesn't exist.")},setJointValue:function(T,d){const N=A[T];if(N){const k=N.joint;if(d>k.limits.max||d<k.limits.min)console.warn("THREE.ColladaLoader: Joint "+T+" value "+d+" outside of limits (min: "+k.limits.min+", max: "+k.limits.max+").");else if(k.static)console.warn("THREE.ColladaLoader: Joint "+T+" is static.");else{const q=N.object,E=k.axis,m3=N.transforms;_3.identity();for(let c3=0;c3<m3.length;c3++){const t3=m3[c3];if(t3.sid&&t3.sid.indexOf(T)!==-1)switch(k.type){case"revolute":_3.multiply(w.makeRotationAxis(E,a.MathUtils.degToRad(d)));break;case"prismatic":_3.multiply(w.makeTranslation(E.x*d,E.y*d,E.z*d));break;default:console.warn("THREE.ColladaLoader: Unknown joint type: "+k.type);break}else switch(t3.type){case"matrix":_3.multiply(t3.obj);break;case"translate":_3.multiply(w.makeTranslation(t3.obj.x,t3.obj.y,t3.obj.z));break;case"scale":_3.scale(t3.obj);break;case"rotate":_3.multiply(w.makeRotationAxis(t3.obj,t3.angle));break}}q.matrix.copy(_3),q.matrix.decompose(q.position,q.quaternion,q.scale),A[T].position=d}}else console.log("THREE.ColladaLoader: "+T+" does not exist.")}}}function Z1(t){const e=[],i=w3.querySelector('[id="'+t.id+'"]');for(let n=0;n<i.childNodes.length;n++){const s=i.childNodes[n];if(s.nodeType!==1)continue;let r,c;switch(s.nodeName){case"matrix":r=_(s.textContent);const A=new a.Matrix4().fromArray(r).transpose();e.push({sid:s.getAttribute("sid"),type:s.nodeName,obj:A});break;case"translate":case"scale":r=_(s.textContent),c=new a.Vector3().fromArray(r),e.push({sid:s.getAttribute("sid"),type:s.nodeName,obj:c});break;case"rotate":r=_(s.textContent),c=new a.Vector3().fromArray(r);const m=a.MathUtils.degToRad(r[3]);e.push({sid:s.getAttribute("sid"),type:s.nodeName,obj:c,angle:m});break}}return e}function Q1(t){const e=t.getElementsByTagName("node");for(let i=0;i<e.length;i++){const n=e[i];n.hasAttribute("id")===!1&&n.setAttribute("id",X())}}const _3=new a.Matrix4,E3=new a.Vector3;function D3(t){const e={name:t.getAttribute("name")||"",type:t.getAttribute("type"),id:t.getAttribute("id"),sid:t.getAttribute("sid"),matrix:new a.Matrix4,nodes:[],instanceCameras:[],instanceControllers:[],instanceLights:[],instanceGeometries:[],instanceNodes:[],transforms:{}};for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];if(n.nodeType!==1)continue;let s;switch(n.nodeName){case"node":e.nodes.push(n.getAttribute("id")),D3(n);break;case"instance_camera":e.instanceCameras.push(F(n.getAttribute("url")));break;case"instance_controller":e.instanceControllers.push(t1(n));break;case"instance_light":e.instanceLights.push(F(n.getAttribute("url")));break;case"instance_geometry":e.instanceGeometries.push(t1(n));break;case"instance_node":e.instanceNodes.push(F(n.getAttribute("url")));break;case"matrix":s=_(n.textContent),e.matrix.multiply(_3.fromArray(s).transpose()),e.transforms[n.getAttribute("sid")]=n.nodeName;break;case"translate":s=_(n.textContent),E3.fromArray(s),e.matrix.multiply(_3.makeTranslation(E3.x,E3.y,E3.z)),e.transforms[n.getAttribute("sid")]=n.nodeName;break;case"rotate":s=_(n.textContent);const r=a.MathUtils.degToRad(s[3]);e.matrix.multiply(_3.makeRotationAxis(E3.fromArray(s),r)),e.transforms[n.getAttribute("sid")]=n.nodeName;break;case"scale":s=_(n.textContent),e.matrix.scale(E3.fromArray(s)),e.transforms[n.getAttribute("sid")]=n.nodeName;break;case"extra":break;default:console.log(n)}}return s1(e.id)?console.warn("THREE.ColladaLoader: There is already a node with ID %s. Exclude current node from further processing.",e.id):j.nodes[e.id]=e,e}function t1(t){const e={id:F(t.getAttribute("url")),materials:{},skeletons:[]};for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];switch(n.nodeName){case"bind_material":const s=n.getElementsByTagName("instance_material");for(let r=0;r<s.length;r++){const c=s[r],A=c.getAttribute("symbol"),m=c.getAttribute("target");e.materials[A]=F(m)}break;case"skeleton":e.skeletons.push(F(n.textContent));break}}return e}function e2(t,e){const i=[],n=[];let s,r,c;for(s=0;s<t.length;s++){const w=t[s];let T;if(s1(w))T=B3(w),n1(T,e,i);else if(a2(w)){const N=j.visualScenes[w].children;for(let k=0;k<N.length;k++){const q=N[k];if(q.type==="JOINT"){const E=B3(q.id);n1(E,e,i)}}}else console.error("THREE.ColladaLoader: Unable to find root bone of skeleton with ID:",w)}for(s=0;s<e.length;s++)for(r=0;r<i.length;r++)if(c=i[r],c.bone.name===e[s].name){n[s]=c,c.processed=!0;break}for(s=0;s<i.length;s++)c=i[s],c.processed===!1&&(n.push(c),c.processed=!0);const A=[],m=[];for(s=0;s<n.length;s++)c=n[s],A.push(c.bone),m.push(c.boneInverse);return new a.Skeleton(A,m)}function n1(t,e,i){t.traverse(function(n){if(n.isBone===!0){let s;for(let r=0;r<e.length;r++){const c=e[r];if(c.name===n.name){s=c.boneInverse;break}}s===void 0&&(s=new a.Matrix4),i.push({bone:n,boneInverse:s,processed:!1})}})}function t2(t){const e=[],i=t.matrix,n=t.nodes,s=t.type,r=t.instanceCameras,c=t.instanceControllers,A=t.instanceLights,m=t.instanceGeometries,w=t.instanceNodes;for(let d=0,N=n.length;d<N;d++)e.push(B3(n[d]));for(let d=0,N=r.length;d<N;d++){const k=k1(r[d]);k!==null&&e.push(k.clone())}for(let d=0,N=c.length;d<N;d++){const k=c[d],q=S(k.id),E=Z3(q.id),m3=i1(E,k.materials),c3=k.skeletons,t3=q.skin.joints,n3=e2(c3,t3);for(let H3=0,k3=m3.length;H3<k3;H3++){const V3=m3[H3];V3.isSkinnedMesh&&(V3.bind(n3,q.skin.bindMatrix),V3.normalizeSkinWeights()),e.push(V3)}}for(let d=0,N=A.length;d<N;d++){const k=T1(A[d]);k!==null&&e.push(k.clone())}for(let d=0,N=m.length;d<N;d++){const k=m[d],q=Z3(k.id),E=i1(q,k.materials);for(let m3=0,c3=E.length;m3<c3;m3++)e.push(E[m3])}for(let d=0,N=w.length;d<N;d++)e.push(B3(w[d]).clone());let T;if(n.length===0&&e.length===1)T=e[0];else{T=s==="JOINT"?new a.Bone:new a.Group;for(let d=0;d<e.length;d++)T.add(e[d])}return T.name=s==="JOINT"?t.sid:t.name,T.matrix.copy(i),T.matrix.decompose(T.position,T.quaternion,T.scale),T}const n2=new a.MeshBasicMaterial({name:a.Loader.DEFAULT_MATERIAL_NAME,color:16711935});function i2(t,e){const i=[];for(let n=0,s=t.length;n<s;n++){const r=e[t[n]];r===void 0?(console.warn("THREE.ColladaLoader: Material with key %s not found. Apply fallback material.",t[n]),i.push(n2)):i.push(z1(r))}return i}function i1(t,e){const i=[];for(const n in t){const s=t[n],r=i2(s.materialKeys,e);if(r.length===0&&(n==="lines"||n==="linestrips"?r.push(new a.LineBasicMaterial):r.push(new a.MeshPhongMaterial)),n==="lines"||n==="linestrips")for(let w=0,T=r.length;w<T;w++){const d=r[w];if(d.isMeshPhongMaterial===!0||d.isMeshLambertMaterial===!0){const N=new a.LineBasicMaterial;N.color.copy(d.color),N.opacity=d.opacity,N.transparent=d.transparent,r[w]=N}}const c=s.data.attributes.skinIndex!==void 0,A=r.length===1?r[0]:r;let m;switch(n){case"lines":m=new a.LineSegments(s.data,A);break;case"linestrips":m=new a.Line(s.data,A);break;case"triangles":case"polylist":c?m=new a.SkinnedMesh(s.data,A):m=new a.Mesh(s.data,A);break}i.push(m)}return i}function s1(t){return j.nodes[t]!==void 0}function B3(t){return V(j.nodes[t],t2)}function s2(t){const e={name:t.getAttribute("name"),children:[]};Q1(t);const i=R(t,"node");for(let n=0;n<i.length;n++)e.children.push(D3(i[n]));j.visualScenes[t.getAttribute("id")]=e}function a1(t){const e=new a.Group;e.name=t.name;const i=t.children;for(let n=0;n<i.length;n++){const s=i[n];e.add(B3(s.id))}return e}function a2(t){return j.visualScenes[t]!==void 0}function o1(t){return V(j.visualScenes[t],a1)}function o2(t){const e=R(t,"instance_visual_scene")[0];return o1(F(e.getAttribute("url")))}function r2(){const t=j.clips;if(l3(t)===!0){if(l3(j.animations)===!1){const e=[];for(const i in j.animations){const n=L(i);for(let s=0,r=n.length;s<r;s++)e.push(n[s])}I3.push(new a.AnimationClip("default",-1,e))}}else for(const e in t)I3.push(i3(e))}function c2(t){let e="";const i=[t];for(;i.length;){const n=i.shift();n.nodeType===Node.TEXT_NODE?e+=n.textContent:(e+=`
|
|
2
2
|
`,i.push(...n.childNodes))}return e.trim()}if(C.length===0)return{scene:new a.Scene};const r1=new DOMParser().parseFromString(C,"application/xml"),w3=R(r1,"COLLADA")[0],G3=r1.getElementsByTagName("parsererror")[0];if(G3!==void 0){const t=R(G3,"div")[0];let e;return t?e=t.textContent:e=c2(G3),console.error(`THREE.ColladaLoader: Failed to parse collada file.
|
|
3
3
|
`,e),null}const l2=w3.getAttribute("version");console.debug("THREE.ColladaLoader: File version",l2);const c1=d3(R(w3,"asset")[0]),l1=new a.TextureLoader(this.manager);l1.setPath(this.resourcePath||P).setCrossOrigin(this.crossOrigin);let P3;u1&&(P3=new u1(this.manager),P3.setPath(this.resourcePath||P));const F3=new a.Color,I3=[];let d1={},d2=0;const j={animations:{},clips:{},controllers:{},images:{},effects:{},materials:{},cameras:{},lights:{},geometries:{},nodes:{},visualScenes:{},kinematicsModels:{},physicsModels:{},kinematicsScenes:{}};h(w3,"library_animations","animation",z),h(w3,"library_animation_clips","animation_clip",x),h(w3,"library_controllers","controller",Q),h(w3,"library_images","image",M),h(w3,"library_effects","effect",v),h(w3,"library_materials","material",w1),h(w3,"library_cameras","camera",M1),h(w3,"library_lights","light",_1),h(w3,"library_geometries","geometry",H1),h(w3,"library_nodes","node",D3),h(w3,"library_visual_scenes","visual_scene",s2),h(w3,"library_kinematics_models","kinematics_model",R1),h(w3,"library_physics_models","physics_model",G1),h(w3,"scene","instance_kinematics_scene",W1),o(j.animations,f),o(j.clips,o3),o(j.controllers,W),o(j.images,B),o(j.effects,W3),o(j.materials,J3),o(j.cameras,K3),o(j.lights,Y3),o(j.geometries,X3),o(j.visualScenes,a1),r2(),X1();const O3=o2(R(w3,"scene")[0]);return O3.animations=I3,c1.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."),O3.rotation.set(-Math.PI/2,0,0)),O3.scale.multiplyScalar(c1.unit),{get animations(){return console.warn("THREE.ColladaLoader: Please access animations over scene.animations now."),I3},kinematics:d1,library:j,scene:O3}}}const $3=new a.Quaternion,f1=new a.Euler;function S3(v3){return v3?v3.trim().split(/\s+/g).map(C=>parseFloat(C)):[0,0,0]}function p1(v3,C,P=!1){P||v3.rotation.set(0,0,0),f1.set(C[0],C[1],C[2],"ZYX"),$3.setFromEuler(f1),$3.multiply(v3.quaternion),v3.quaternion.copy($3)}class g1{constructor(C){this.manager=C||a.DefaultLoadingManager,this.loadMeshCb=this.defaultMeshLoader.bind(this),this.parseVisual=!0,this.parseCollision=!1,this.packages="",this.workingPath="",this.fetchOptions={}}loadAsync(C){return new Promise((P,R)=>{this.load(C,P,null,R)})}load(C,P,R,l){const _=this.manager,J=a.LoaderUtils.extractUrlBase(C),F=this.manager.resolveURL(C);_.itemStart(F),fetch(F,this.fetchOptions).then(X=>{if(X.ok)return R&&R(null),X.text();throw new Error(`URDFLoader: Failed to load url '${F}' with error code ${X.status} : ${X.statusText}.`)}).then(X=>{const l3=this.parse(X,this.workingPath||J);P(l3),_.itemEnd(F)}).catch(X=>{l?l(X):console.error("URDFLoader: Error loading file.",X),_.itemError(F),_.itemEnd(F)})}parse(C,P=this.workingPath){const R=this.packages,l=this.loadMeshCb,_=this.parseVisual,J=this.parseCollision,F=this.manager,X={},l3={},d3={};function h3(p){if(!/^package:\/\//.test(p))return P?P+p:p;const[f,L]=p.replace(/^package:\/\//,"").split(/\/(.+)/);if(typeof R=="string")return R.endsWith(f)?R+"/"+L:R+"/"+f+"/"+L;if(R instanceof Function)return R(f)+"/"+L;if(typeof R=="object")return f in R?R[f]+"/"+L:(console.error(`URDFLoader : ${f} not found in provided package list.`),null)}function $(p){let f;p instanceof Document?f=[...p.children]:p instanceof Element?f=[p]:f=[...new DOMParser().parseFromString(p,"text/xml").children];const L=f.filter(g=>g.nodeName==="robot").pop();return h(L)}function h(p){const f=[...p.children],L=f.filter(U=>U.nodeName.toLowerCase()==="link"),g=f.filter(U=>U.nodeName.toLowerCase()==="joint"),I=f.filter(U=>U.nodeName.toLowerCase()==="material"),O=new a.URDFRobot;O.robotName=p.getAttribute("name"),O.urdfRobotNode=p,I.forEach(U=>{const H=U.getAttribute("name");d3[H]=z(U)});const u={},b={};L.forEach(U=>{const H=U.getAttribute("name"),Y=p.querySelector(`child[link="${H}"]`)===null;X[H]=V(U,u,b,Y?O:null)}),g.forEach(U=>{const H=U.getAttribute("name");l3[H]=o(U)}),O.joints=l3,O.links=X,O.colliders=b,O.visual=u;const G=Object.values(l3);return G.forEach(U=>{U instanceof a.URDFMimicJoint&&l3[U.mimicJoint].mimicJoints.push(U)}),G.forEach(U=>{const H=new Set,Y=A3=>{if(H.has(A3))throw new Error("URDFLoader: Detected an infinite loop of mimic joints.");H.add(A3),A3.mimicJoints.forEach(g3=>{Y(g3)})};Y(U)}),O.frames={...b,...u,...X,...l3},O}function o(p){const f=[...p.children],L=p.getAttribute("type");let g;const I=f.find(H=>H.nodeName.toLowerCase()==="mimic");I?(g=new a.URDFMimicJoint,g.mimicJoint=I.getAttribute("joint"),g.multiplier=parseFloat(I.getAttribute("multiplier")||1),g.offset=parseFloat(I.getAttribute("offset")||0)):g=new a.URDFJoint,g.urdfNode=p,g.name=p.getAttribute("name"),g.urdfName=g.name,g.jointType=L;let O=null,u=null,b=[0,0,0],G=[0,0,0];f.forEach(H=>{const Y=H.nodeName.toLowerCase();Y==="origin"?(b=S3(H.getAttribute("xyz")),G=S3(H.getAttribute("rpy"))):Y==="child"?u=X[H.getAttribute("link")]:Y==="parent"?O=X[H.getAttribute("link")]:Y==="limit"&&(g.limit.lower=parseFloat(H.getAttribute("lower")||g.limit.lower),g.limit.upper=parseFloat(H.getAttribute("upper")||g.limit.upper))}),O.add(g),g.add(u),p1(g,G),g.position.set(b[0],b[1],b[2]);const U=f.filter(H=>H.nodeName.toLowerCase()==="axis")[0];if(U){const H=U.getAttribute("xyz").split(/\s+/g).map(Y=>parseFloat(Y));g.axis=new a.Vector3(H[0],H[1],H[2]),g.axis.normalize()}return g}function V(p,f,L,g=null){g===null&&(g=new a.URDFLink);const I=[...p.children];return g.name=p.getAttribute("name"),g.urdfName=g.name,g.urdfNode=p,_&&I.filter(u=>u.nodeName.toLowerCase()==="visual").forEach(u=>{const b=y(u,d3);if(g.add(b),u.hasAttribute("name")){const G=u.getAttribute("name");b.name=G,b.urdfName=G,f[G]=b}}),J&&I.filter(u=>u.nodeName.toLowerCase()==="collision").forEach(u=>{const b=y(u);if(g.add(b),u.hasAttribute("name")){const G=u.getAttribute("name");b.name=G,b.urdfName=G,L[G]=b}}),g}function z(p){const f=[...p.children],L=new a.MeshPhongMaterial;return L.name=p.getAttribute("name")||"",f.forEach(g=>{const I=g.nodeName.toLowerCase();if(I==="color"){const O=g.getAttribute("rgba").split(/\s/g).map(u=>parseFloat(u));L.color.setRGB(O[0],O[1],O[2]),L.opacity=O[3],L.transparent=O[3]<1,L.depthWrite=!L.transparent}else if(I==="texture"){const O=g.getAttribute("filename");if(O){const u=new a.TextureLoader(F),b=h3(O);L.map=u.load(b),L.map.colorSpace=a.SRGBColorSpace}}}),L}function y(p,f={}){const L=p.nodeName.toLowerCase()==="collision",g=[...p.children];let I=null;const O=g.filter(b=>b.nodeName.toLowerCase()==="material")[0];if(O){const b=O.getAttribute("name");b&&b in f?I=f[b]:I=z(O)}else I=new a.MeshPhongMaterial;const u=L?new a.URDFCollider:new a.URDFVisual;return u.urdfNode=p,g.forEach(b=>{const G=b.nodeName.toLowerCase();if(G==="geometry"){const U=b.children[0].nodeName.toLowerCase();if(U==="mesh"){const H=b.children[0].getAttribute("filename"),Y=h3(H);if(Y!==null){const A3=b.children[0].getAttribute("scale");if(A3){const g3=S3(A3);u.scale.set(g3[0],g3[1],g3[2])}l(Y,F,(g3,x)=>{x?console.error("URDFLoader: Error loading mesh.",x):g3&&(g3 instanceof a.Mesh&&(g3.material=I),g3.position.set(0,0,0),g3.quaternion.identity(),u.add(g3))})}}else if(U==="box"){const H=new a.Mesh;H.geometry=new a.BoxGeometry(1,1,1),H.material=I;const Y=S3(b.children[0].getAttribute("size"));H.scale.set(Y[0],Y[1],Y[2]),u.add(H)}else if(U==="sphere"){const H=new a.Mesh;H.geometry=new a.SphereGeometry(1,30,30),H.material=I;const Y=parseFloat(b.children[0].getAttribute("radius"))||0;H.scale.set(Y,Y,Y),u.add(H)}else if(U==="cylinder"){const H=new a.Mesh;H.geometry=new a.CylinderGeometry(1,1,1,30),H.material=I;const Y=parseFloat(b.children[0].getAttribute("radius"))||0,A3=parseFloat(b.children[0].getAttribute("length"))||0;H.scale.set(Y,A3,Y),H.rotation.set(Math.PI/2,0,0),u.add(H)}}else if(G==="origin"){const U=S3(b.getAttribute("xyz")),H=S3(b.getAttribute("rpy"));u.position.set(U[0],U[1],U[2]),u.rotation.set(0,0,0),p1(u,H)}}),u}return $(C)}defaultMeshLoader(C,P,R){/\.stl$/i.test(C)?new T3.STLLoader(P).load(C,_=>{const J=new a.Mesh(_,new a.MeshPhongMaterial);R(J)}):/\.dae$/i.test(C)?new m2(P).load(C,_=>R(_.scene)):console.warn(`URDFLoader: Could not load model at ${C}.
|
|
4
4
|
No loader available`)}}class b2 extends a.Loader{constructor(C){super(C),this.littleEndian=!0}load(C,P,R,l){const _=this,J=new a.FileLoader(_.manager);J.setPath(_.path),J.setResponseType("arraybuffer"),J.setRequestHeader(_.requestHeader),J.setWithCredentials(_.withCredentials),J.load(C,function(F){try{P(_.parse(F))}catch(X){l?l(X):console.error(X),_.manager.itemError(C)}},R,l)}_getDataView(C,P,R,l){switch(R){case"F":return l===8?C.getFloat64(P,this.littleEndian):C.getFloat32(P,this.littleEndian);case"I":return l===1?C.getInt8(P):l===2?C.getInt16(P,this.littleEndian):C.getInt32(P,this.littleEndian);case"U":return l===1?C.getUint8(P):l===2?C.getUint16(P,this.littleEndian):C.getUint32(P,this.littleEndian)}}parse(C){function P(h,o){const V=h.length,z=new Uint8Array(o);let y=0,p=0,f,L,g;do if(f=h[y++],f<32){if(f++,p+f>o)throw new Error("Output buffer is not large enough");if(y+f>V)throw new Error("Invalid compressed data");do z[p++]=h[y++];while(--f)}else{if(L=f>>5,g=p-((f&31)<<8)-1,y>=V)throw new Error("Invalid compressed data");if(L===7&&(L+=h[y++],y>=V))throw new Error("Invalid compressed data");if(g-=h[y++],p+L+2>o)throw new Error("Output buffer is not large enough");if(g<0)throw new Error("Invalid compressed data");if(g>=p)throw new Error("Invalid compressed data");do z[p++]=z[g++];while(--L+2)}while(y<V);return z}function R(h){const o={},V=new Uint8Array(h);let z="",y="",p=0,f=!1;const L=V.length;for(;p<L&&f===!1;){const u=String.fromCharCode(V[p++]);u===`
|