@tresjs/core 4.3.3 → 4.3.5

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/tres.js CHANGED
@@ -1,162 +1,180 @@
1
1
  /**
2
2
  * name: @tresjs/core
3
- * version: v4.3.3
3
+ * version: v4.3.5
4
4
  * (c) 2025
5
5
  * description: Declarative ThreeJS using Vue Components
6
6
  * author: Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)
7
7
  */
8
- var Et = Object.defineProperty;
9
- var Tt = (e, t, n) => t in e ? Et(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
10
- var he = (e, t, n) => Tt(e, typeof t != "symbol" ? t + "" : t, n);
11
- import { defineComponent as fe, withAsyncContext as nt, reactive as Se, renderSlot as rt, unref as W, ref as I, computed as q, watchEffect as Ae, onUnmounted as K, shallowRef as $, watch as ae, readonly as we, provide as le, inject as St, isRef as At, useSlots as xt, getCurrentInstance as He, onMounted as kt, createElementBlock as Lt, openBlock as Rt, normalizeStyle as Ot, normalizeClass as Dt, createRenderer as jt, h as Ue, Fragment as Bt } from "vue";
12
- import * as ot from "three";
13
- import { Scene as st, MathUtils as it, Vector3 as xe, MeshBasicMaterial as at, DoubleSide as It, TextureLoader as $t, PerspectiveCamera as be, Camera as Ht, Clock as lt, REVISION as Ut, Color as Z, NoToneMapping as Ft, PCFSoftShadowMap as Wt, ACESFilmicToneMapping as ct, SRGBColorSpace as Nt, WebGLRenderer as ge, Vector2 as ve, Raycaster as zt, Object3D as Gt, BufferAttribute as Vt, ArrowHelper as Yt, Line as qt, BufferGeometry as Fe, Float32BufferAttribute as We, LineBasicMaterial as Kt, Mesh as Jt, BackSide as Qt, HemisphereLightHelper as Xt, SpotLightHelper as Zt, PointLightHelper as en, DirectionalLightHelper as tn } from "three";
14
- import { tryOnScopeDispose as nn, toValue as A, unrefElement as rn, useDevicePixelRatio as on, useWindowSize as sn, useElementSize as an, refDebounced as Ne, usePointer as ln, useElementBounding as cn, createEventHook as D, useFps as un, useMemory as fn, useRafFn as ut } from "@vueuse/core";
15
- const dn = "@tresjs/core", pn = "module", mn = "4.3.3", hn = "pnpm@9.15.5", gn = "Declarative ThreeJS using Vue Components", vn = "Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)", yn = "MIT", _n = { type: "git", url: "git+https://github.com/Tresjs/tres.git" }, wn = ["vue", "3d", "threejs", "three", "threejs-vue"], bn = !1, Mn = { ".": { types: "./dist/index.d.ts", import: "./dist/tres.js", require: "./dist/tres.umd.cjs" }, "./components": { types: "./dist/src/components/index.d.ts" }, "./composables": { types: "./dist/src/composables/index.d.ts" }, "./types": { types: "./dist/src/types/index.d.ts" }, "./utils": { types: "./dist/src/utils/index.d.ts" }, "./*": "./*" }, Pn = "./dist/tres.js", Cn = "./dist/tres.js", En = "./dist/index.d.ts", Tn = ["*.d.ts", "dist"], Sn = { access: "public" }, An = { dev: "pnpm --filter='./playground/vue' dev", "dev:nuxt": "pnpm --filter='./playground/nuxt' dev", build: "vite build", test: "vitest", "test:ci": "vitest run", "test:ui": "vitest --ui --coverage.enabled=true", release: "release-it", coverage: "vitest run --coverage", lint: "eslint .", "lint:fix": "eslint . --fix", "docs:dev": "vitepress dev docs", "docs:build": "vitepress build docs", "docs:serve": "vitepress serve docs", "docs:preview": "vitepress preview docs", "docs:contributors": "esno scripts/update-contributors.ts" }, xn = { three: ">=0.133", vue: ">=3.4" }, kn = { "@alvarosabu/utils": "^3.2.0", "@vue/devtools-api": "^6.6.3", "@vueuse/core": "^12.5.0" }, Ln = { "@release-it/conventional-changelog": "^10.0.0", "@stackblitz/sdk": "^1.11.0", "@tresjs/cientos": "4.1.0", "@tresjs/eslint-config": "^1.4.0", "@types/three": "^0.173.0", "@typescript-eslint/eslint-plugin": "^8.23.0", "@typescript-eslint/parser": "^8.23.0", "@vitejs/plugin-vue": "^5.2.1", "@vitest/coverage-c8": "^0.33.0", "@vitest/coverage-v8": "^3.0.5", "@vitest/ui": "^3.0.5", "@vue/test-utils": "^2.4.6", eslint: "^9.19.0", "eslint-plugin-vue": "^9.32.0", esno: "^4.8.0", gsap: "^3.12.7", jsdom: "^26.0.0", kolorist: "^1.8.0", ohmyfetch: "^0.4.21", pathe: "^2.0.2", "release-it": "^18.1.2", "rollup-plugin-analyzer": "^4.0.0", "rollup-plugin-copy": "^3.5.0", "rollup-plugin-visualizer": "^5.14.0", sponsorkit: "^16.3.0", three: "^0.173.0", unocss: "^65.4.3", unplugin: "^2.1.2", "unplugin-vue-components": "^28.0.0", vite: "^6.1.0", "vite-plugin-banner": "^0.8.0", "vite-plugin-dts": "4.5.0", "vite-plugin-inspect": "^10.1.0", "vite-plugin-require-transform": "^1.0.21", "vite-svg-loader": "^5.1.0", vitepress: "1.6.3", vitest: "3.0.5", vue: "3.5.13", "vue-demi": "^0.14.10" }, Rn = {
16
- name: dn,
17
- type: pn,
18
- version: mn,
19
- packageManager: hn,
20
- description: gn,
21
- author: vn,
22
- license: yn,
23
- repository: _n,
24
- keywords: wn,
25
- sideEffects: bn,
26
- exports: Mn,
27
- main: Pn,
28
- module: Cn,
29
- types: En,
30
- files: Tn,
31
- publishConfig: Sn,
32
- scripts: An,
33
- peerDependencies: xn,
34
- dependencies: kn,
35
- devDependencies: Ln
8
+ var At = Object.defineProperty;
9
+ var xt = (e, t, r) => t in e ? At(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
10
+ var de = (e, t, r) => xt(e, typeof t != "symbol" ? t + "" : t, r);
11
+ import { defineComponent as ue, withAsyncContext as ot, reactive as Se, renderSlot as st, unref as W, ref as $, computed as q, watchEffect as Ae, onUnmounted as K, shallowRef as H, watch as ie, readonly as _e, provide as ae, inject as kt, isRef as Lt, useSlots as Rt, getCurrentInstance as Ue, onMounted as Ot, createElementBlock as Dt, openBlock as jt, normalizeStyle as Bt, normalizeClass as It, createRenderer as $t, h as Fe, Fragment as Ht } from "vue";
12
+ import * as it from "three";
13
+ import { Layers as Ut, Scene as at, MathUtils as lt, Vector3 as xe, MeshBasicMaterial as ct, DoubleSide as Ft, TextureLoader as Wt, PerspectiveCamera as we, Camera as Nt, Clock as ut, REVISION as zt, Color as Z, NoToneMapping as Gt, PCFSoftShadowMap as Vt, ACESFilmicToneMapping as ft, SRGBColorSpace as Yt, WebGLRenderer as me, Vector2 as ge, Raycaster as qt, Object3D as Kt, BufferAttribute as Jt, ArrowHelper as Qt, Line as Xt, BufferGeometry as We, Float32BufferAttribute as Ne, LineBasicMaterial as Zt, Mesh as er, BackSide as tr, HemisphereLightHelper as rr, SpotLightHelper as nr, PointLightHelper as or, DirectionalLightHelper as sr } from "three";
14
+ import { tryOnScopeDispose as ir, toValue as A, unrefElement as ar, useDevicePixelRatio as lr, useWindowSize as cr, useElementSize as ur, refDebounced as ze, usePointer as fr, useElementBounding as pr, createEventHook as D, useFps as dr, useMemory as mr, useRafFn as pt } from "@vueuse/core";
15
+ const gr = "@tresjs/core", hr = "module", vr = "4.3.5", yr = "pnpm@10.6.3", _r = "Declarative ThreeJS using Vue Components", wr = "Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)", br = "MIT", Mr = { type: "git", url: "git+https://github.com/Tresjs/tres.git" }, Pr = ["vue", "3d", "threejs", "three", "threejs-vue"], Cr = !1, Er = { ".": { types: "./dist/index.d.ts", import: "./dist/tres.js", require: "./dist/tres.umd.cjs" }, "./components": { types: "./dist/src/components/index.d.ts" }, "./composables": { types: "./dist/src/composables/index.d.ts" }, "./types": { types: "./dist/src/types/index.d.ts" }, "./utils": { types: "./dist/src/utils/index.d.ts" }, "./*": "./*" }, Tr = "./dist/tres.js", Sr = "./dist/tres.js", Ar = "./dist/index.d.ts", xr = ["*.d.ts", "dist"], kr = { access: "public" }, Lr = { dev: "pnpm --filter='./playground/vue' dev", "dev:nuxt": "pnpm --filter='./playground/nuxt' dev", build: "vite build", test: "vitest", "test:ci": "vitest run", "test:ui": "vitest --ui --coverage.enabled=true", release: "release-it", coverage: "vitest run --coverage", lint: "eslint .", "lint:fix": "eslint . --fix", "docs:dev": "vitepress dev docs", "docs:build": "vitepress build docs", "docs:serve": "vitepress serve docs", "docs:preview": "vitepress preview docs", "docs:contributors": "esno scripts/update-contributors.ts" }, Rr = { three: ">=0.133", vue: ">=3.4" }, Or = { "@alvarosabu/utils": "^3.2.0", "@vue/devtools-api": "^6.6.3", "@vueuse/core": "^12.5.0" }, Dr = { "@release-it/conventional-changelog": "^10.0.0", "@stackblitz/sdk": "^1.11.0", "@tresjs/cientos": "4.1.0", "@tresjs/eslint-config": "^1.4.0", "@types/three": "^0.173.0", "@typescript-eslint/eslint-plugin": "^8.23.0", "@typescript-eslint/parser": "^8.23.0", "@vitejs/plugin-vue": "^5.2.1", "@vitest/coverage-c8": "^0.33.0", "@vitest/coverage-v8": "^3.0.5", "@vitest/ui": "^3.0.5", "@vue/test-utils": "^2.4.6", eslint: "^9.19.0", "eslint-plugin-vue": "^9.32.0", esno: "^4.8.0", gsap: "^3.12.7", jsdom: "^26.0.0", kolorist: "^1.8.0", ohmyfetch: "^0.4.21", pathe: "^2.0.2", "release-it": "^18.1.2", "rollup-plugin-analyzer": "^4.0.0", "rollup-plugin-copy": "^3.5.0", "rollup-plugin-visualizer": "^5.14.0", sponsorkit: "^16.3.0", three: "^0.173.0", unocss: "^65.4.3", unplugin: "^2.1.2", "unplugin-vue-components": "^28.0.0", vite: "^6.1.0", "vite-plugin-banner": "^0.8.0", "vite-plugin-dts": "4.5.0", "vite-plugin-inspect": "^10.1.0", "vite-plugin-require-transform": "^1.0.21", "vite-svg-loader": "^5.1.0", vitepress: "1.6.3", vitest: "3.0.5", vue: "3.5.13", "vue-demi": "^0.14.10" }, jr = {
16
+ name: gr,
17
+ type: hr,
18
+ version: vr,
19
+ packageManager: yr,
20
+ description: _r,
21
+ author: wr,
22
+ license: br,
23
+ repository: Mr,
24
+ keywords: Pr,
25
+ sideEffects: Cr,
26
+ exports: Er,
27
+ main: Tr,
28
+ module: Sr,
29
+ types: Ar,
30
+ files: xr,
31
+ publishConfig: kr,
32
+ scripts: Lr,
33
+ peerDependencies: Rr,
34
+ dependencies: Or,
35
+ devDependencies: Dr
36
36
  };
37
- function On(e) {
37
+ function Br(e) {
38
38
  const t = { nodes: {}, materials: {} };
39
- return e && e.traverse((n) => {
40
- n.name && (t.nodes[n.name] = n), n.material && !t.materials[n.material.name] && (t.materials[n.material.name] = n.material);
39
+ return e && e.traverse((r) => {
40
+ r.name && (t.nodes[r.name] = r), r.material && !t.materials[r.material.name] && (t.materials[r.material.name] = r.material);
41
41
  }), t;
42
42
  }
43
- async function Dn(e, t, n, r, o) {
43
+ async function Ir(e, t, r, n, o) {
44
44
  const { logError: l } = Q(), s = new e();
45
- return o && o(s), n && n(s), await new Promise((a, c) => {
45
+ return o && o(s), r && r(s), await new Promise((a, c) => {
46
46
  s.load(
47
47
  t,
48
48
  (i) => {
49
49
  const f = i;
50
- f.scene && Object.assign(f, On(f.scene)), a(f);
50
+ f.scene && Object.assign(f, Br(f.scene)), a(f);
51
51
  },
52
- r,
52
+ n,
53
53
  (i) => {
54
54
  l("[useLoader] - Failed to load resource", i), c(i);
55
55
  }
56
56
  );
57
57
  });
58
58
  }
59
- const Yr = /* @__PURE__ */ fe({
59
+ const eo = /* @__PURE__ */ ue({
60
60
  __name: "component",
61
61
  props: {
62
62
  loader: {},
63
63
  url: {}
64
64
  },
65
65
  async setup(e) {
66
- let t, n;
67
- const r = e, o = ([t, n] = nt(() => Se(Dn(r.loader, r.url))), t = await t, n(), t);
68
- return (l, s) => rt(l.$slots, "default", { data: W(o) });
66
+ let t, r;
67
+ const n = e, o = ([t, r] = ot(() => Se(Ir(n.loader, n.url))), t = await t, r(), t);
68
+ return (l, s) => st(l.$slots, "default", { data: W(o) });
69
69
  }
70
70
  });
71
- class jn extends ot.Mesh {
72
- constructor(...n) {
73
- super(...n);
74
- he(this, "type", "HightlightMesh");
75
- he(this, "createTime");
71
+ class $r extends it.Mesh {
72
+ constructor(...r) {
73
+ super(...r);
74
+ de(this, "type", "HightlightMesh");
75
+ de(this, "createTime");
76
76
  this.createTime = Date.now();
77
77
  }
78
78
  onBeforeRender() {
79
- const r = (Date.now() - this.createTime) / 1e3, s = 1 + 0.07 * Math.sin(2.5 * r);
79
+ const n = (Date.now() - this.createTime) / 1e3, s = 1 + 0.07 * Math.sin(2.5 * n);
80
80
  this.scale.set(s, s, s);
81
81
  }
82
82
  }
83
- function Me(e) {
83
+ function be(e) {
84
84
  return typeof e > "u";
85
85
  }
86
- function de(e) {
86
+ function ke(e) {
87
87
  return Array.isArray(e);
88
88
  }
89
- function Bn(e) {
89
+ function Hr(e) {
90
90
  return typeof e == "number";
91
91
  }
92
- function ft(e) {
92
+ function dt(e) {
93
93
  return typeof e == "string";
94
94
  }
95
- function G(e) {
95
+ function Y(e) {
96
96
  return typeof e == "function";
97
97
  }
98
- function H(e) {
99
- return e === Object(e) && !de(e) && !G(e);
98
+ function j(e) {
99
+ return e === Object(e) && !ke(e) && !Y(e);
100
100
  }
101
101
  function N(e) {
102
- return H(e) && "isObject3D" in e && !!e.isObject3D;
102
+ return j(e) && !!e.isObject3D;
103
+ }
104
+ function mt(e) {
105
+ return j(e) && !!e.isColor;
106
+ }
107
+ function Ur(e) {
108
+ return e != null && (typeof e == "string" || typeof e == "number" || mt(e));
103
109
  }
104
- function ze(e) {
105
- return H(e) && "isCamera" in e && !!e.isCamera;
110
+ function Me(e) {
111
+ return e !== null && typeof e == "object" && "set" in e && typeof e.set == "function";
112
+ }
113
+ function Fr(e) {
114
+ return Me(e) && "copy" in e && typeof e.copy == "function";
115
+ }
116
+ function Wr(e) {
117
+ return !!(e != null && e.constructor);
118
+ }
119
+ function Ge(e) {
120
+ return e instanceof Ut;
106
121
  }
107
- function In(e) {
108
- return H(e) && "isBufferGeometry" in e && !!e.isBufferGeometry;
122
+ function Ve(e) {
123
+ return j(e) && !!e.isCamera;
109
124
  }
110
- function $n(e) {
111
- return H(e) && "isMaterial" in e && !!e.isMaterial;
125
+ function Nr(e) {
126
+ return j(e) && !!e.isBufferGeometry;
112
127
  }
113
- function Hn(e) {
114
- return H(e) && "isLight" in e && !!e.isLight;
128
+ function zr(e) {
129
+ return j(e) && !!e.isMaterial;
115
130
  }
116
- function Un(e) {
117
- return H(e) && "isFog" in e && !!e.isFog;
131
+ function Gr(e) {
132
+ return j(e) && !!e.isLight;
118
133
  }
119
- function Fn(e) {
120
- return H(e) && "isScene" in e && !!e.isScene;
134
+ function Vr(e) {
135
+ return j(e) && !!e.isFog;
121
136
  }
122
- function re(e) {
123
- return N(e) || In(e) || $n(e) || Un(e);
137
+ function Yr(e) {
138
+ return j(e) && !!e.isScene;
124
139
  }
125
- function Wn(e) {
126
- return H(e) && !!e.isPrimitive;
140
+ function ne(e) {
141
+ return N(e) || Nr(e) || zr(e) || Vr(e);
127
142
  }
128
- const dt = (e, t) => {
129
- for (const n of Object.keys(t))
130
- t[n] instanceof Object && Object.assign(t[n], dt(e[n], t[n]));
143
+ function qr(e) {
144
+ return j(e) && !!e.isPrimitive;
145
+ }
146
+ const gt = (e, t) => {
147
+ for (const r of Object.keys(t))
148
+ t[r] instanceof Object && Object.assign(t[r], gt(e[r], t[r]));
131
149
  return Object.assign(e || {}, t), e;
132
- }, Nn = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot", zn = /* @__PURE__ */ Yn(Nn);
133
- function Ge(e) {
150
+ }, Kr = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot", Jr = /* @__PURE__ */ Zr(Kr);
151
+ function Ye(e) {
134
152
  return e && e.nodeType === 1;
135
153
  }
136
- function oe(e) {
137
- return e.replace(/-([a-z])/g, (t, n) => n.toUpperCase());
154
+ function he(e) {
155
+ return e.replace(/-([a-z])/g, (t, r) => r.toUpperCase());
138
156
  }
139
- const Gn = /\B([A-Z])/g;
140
- function Vn(e) {
141
- return e.replace(Gn, "-$1").toLowerCase();
157
+ const Qr = /\B([A-Z])/g;
158
+ function Xr(e) {
159
+ return e.replace(Qr, "-$1").toLowerCase();
142
160
  }
143
- function Yn(e, t) {
144
- const n = /* @__PURE__ */ Object.create(null), r = e.split(",");
145
- for (let o = 0; o < r.length; o++)
146
- n[r[o]] = !0;
147
- return t ? (o) => !!n[o.toLowerCase()] : (o) => !!n[o];
161
+ function Zr(e, t) {
162
+ const r = /* @__PURE__ */ Object.create(null), n = e.split(",");
163
+ for (let o = 0; o < n.length; o++)
164
+ r[n[o]] = !0;
165
+ return t ? (o) => !!r[o.toLowerCase()] : (o) => !!r[o];
148
166
  }
149
- const Ve = (e, t) => {
167
+ const qe = (e, t) => {
150
168
  if (!t)
151
169
  return;
152
- const n = Array.isArray(t) ? t : t.match(/([^[.\]])+/g);
153
- return n == null ? void 0 : n.reduce((r, o) => r && r[o], e);
154
- }, qn = (e, t, n) => {
155
170
  const r = Array.isArray(t) ? t : t.match(/([^[.\]])+/g);
156
- r && r.reduce((o, l, s) => (o[l] === void 0 && (o[l] = {}), s === r.length - 1 && (o[l] = n), o[l]), e);
171
+ return r == null ? void 0 : r.reduce((n, o) => n && n[o], e);
172
+ }, en = (e, t, r) => {
173
+ const n = Array.isArray(t) ? t : t.match(/([^[.\]])+/g);
174
+ n && n.reduce((o, l, s) => (o[l] === void 0 && (o[l] = {}), s === n.length - 1 && (o[l] = r), o[l]), e);
157
175
  };
158
- function pt(e, t) {
159
- if (Ge(e) && Ge(t)) {
176
+ function ht(e, t) {
177
+ if (Ye(e) && Ye(t)) {
160
178
  const o = e.attributes, l = t.attributes;
161
179
  return o.length !== l.length ? !1 : Array.from(o).every(({ name: s, value: a }) => t.getAttribute(s) === a);
162
180
  }
@@ -164,24 +182,24 @@ function pt(e, t) {
164
182
  return !0;
165
183
  if (e === null || typeof e != "object" || t === null || typeof t != "object")
166
184
  return !1;
167
- const n = Object.keys(e), r = Object.keys(t);
168
- if (n.length !== r.length)
185
+ const r = Object.keys(e), n = Object.keys(t);
186
+ if (r.length !== n.length)
169
187
  return !1;
170
- for (const o of n)
171
- if (!r.includes(o) || !pt(e[o], t[o]))
188
+ for (const o of r)
189
+ if (!n.includes(o) || !ht(e[o], t[o]))
172
190
  return !1;
173
191
  return !0;
174
192
  }
175
- function Kn(e, t) {
193
+ function tn(e, t) {
176
194
  if (!Array.isArray(e) || !Array.isArray(t) || e.length !== t.length)
177
195
  return !1;
178
- for (let n = 0; n < e.length; n++)
179
- if (!pt(e[n], t[n]))
196
+ for (let r = 0; r < e.length; r++)
197
+ if (!ht(e[r], t[r]))
180
198
  return !1;
181
199
  return !0;
182
200
  }
183
- const Jn = Array.isArray;
184
- function Qn(e, t, n, r) {
201
+ const rn = Array.isArray;
202
+ function nn(e, t, r, n) {
185
203
  const o = (c) => {
186
204
  if (c.uuid === t)
187
205
  return c;
@@ -196,160 +214,157 @@ function Qn(e, t, n, r) {
196
214
  return;
197
215
  }
198
216
  let s = l;
199
- for (let c = 0; c < n.length - 1; c++)
200
- if (s[n[c]] !== void 0)
201
- s = s[n[c]];
217
+ for (let c = 0; c < r.length - 1; c++)
218
+ if (s[r[c]] !== void 0)
219
+ s = s[r[c]];
202
220
  else {
203
- console.warn(`Property path is not valid: ${n.join(".")}`);
221
+ console.warn(`Property path is not valid: ${r.join(".")}`);
204
222
  return;
205
223
  }
206
- const a = n[n.length - 1];
207
- s[a] !== void 0 ? s[a] = r : console.warn(`Property path is not valid: ${n.join(".")}`);
224
+ const a = r[r.length - 1];
225
+ s[a] !== void 0 ? s[a] = n : console.warn(`Property path is not valid: ${r.join(".")}`);
208
226
  }
209
- function Xn(e) {
210
- const t = new at({
227
+ function on(e) {
228
+ const t = new ct({
211
229
  color: 11003607,
212
230
  // Highlight color, e.g., yellow
213
231
  transparent: !0,
214
232
  opacity: 0.2,
215
233
  depthTest: !1,
216
234
  // So the highlight is always visible
217
- side: It
235
+ side: Ft
218
236
  // To e
219
237
  });
220
- return new jn(e.geometry.clone(), t);
238
+ return new $r(e.geometry.clone(), t);
221
239
  }
222
- function Zn(e) {
223
- var n;
240
+ function sn(e) {
241
+ var r;
224
242
  let t = e.value;
225
- return e.value && ((n = e.value) != null && n.isMesh) && (t = e.value.position), Array.isArray(e.value) && (t = new xe(...t)), t;
243
+ return e.value && ((r = e.value) != null && r.isMesh) && (t = e.value.position), Array.isArray(e.value) && (t = new xe(...t)), t;
226
244
  }
227
- function er(e) {
245
+ function an(e) {
228
246
  return "map" in e;
229
247
  }
230
- function Ye(e) {
231
- er(e) && e.map && e.map.dispose(), e.dispose();
248
+ function Ke(e) {
249
+ an(e) && e.map && e.map.dispose(), e.dispose();
232
250
  }
233
- function mt(e) {
234
- var n, r;
235
- if (e.parent && ((n = e.removeFromParent) == null || n.call(e)), delete e.__tres, [...e.children].forEach((o) => mt(o)), !(e instanceof st)) {
251
+ function vt(e) {
252
+ var r, n;
253
+ if (e.parent && ((r = e.removeFromParent) == null || r.call(e)), delete e.__tres, [...e.children].forEach((o) => vt(o)), !(e instanceof at)) {
236
254
  const o = e;
237
- e && ((r = e.dispose) == null || r.call(e)), o.geometry && o.geometry.dispose(), Array.isArray(o.material) ? o.material.forEach((l) => Ye(l)) : o.material && Ye(o.material);
255
+ e && ((n = e.dispose) == null || n.call(e)), o.geometry && o.geometry.dispose(), Array.isArray(o.material) ? o.material.forEach((l) => Ke(l)) : o.material && Ke(o.material);
238
256
  }
239
257
  }
240
- function tr(e, t) {
241
- let n = 0;
242
- for (let r = 0; r < e.length; r++)
243
- t(e[r], r) && (e[n] = e[r], n++);
244
- return e.length = n, e;
258
+ function ln(e, t) {
259
+ let r = 0;
260
+ for (let n = 0; n < e.length; n++)
261
+ t(e[n], n) && (e[r] = e[n], r++);
262
+ return e.length = r, e;
245
263
  }
246
264
  function Pe(e, t) {
247
- let n = e;
265
+ let r = e;
248
266
  if (t.includes("-")) {
249
- const r = t.split("-");
250
- let o = r.shift();
251
- for (; n && r.length; )
252
- o in n ? (n = n[o], o = r.shift()) : o = qe(o, r.shift());
253
- return { target: n, key: qe(o, ...r) };
267
+ const n = t.split("-");
268
+ let o = n.shift();
269
+ for (; r && n.length; )
270
+ o in r ? (r = r[o], o = n.shift()) : o = Je(o, n.shift());
271
+ return { target: r, key: Je(o, ...n) };
254
272
  } else
255
- return { target: n, key: t };
273
+ return { target: r, key: t };
256
274
  }
257
- function qe(...e) {
258
- return e.map((t, n) => n === 0 ? t : t.charAt(0).toUpperCase() + t.slice(1)).join("");
275
+ function Je(...e) {
276
+ return e.map((t, r) => r === 0 ? t : t.charAt(0).toUpperCase() + t.slice(1)).join("");
259
277
  }
260
- const Ke = /-\d+$/;
261
- function nr(e, t, n) {
262
- if (ft(n)) {
263
- if (Ke.test(n)) {
264
- const l = n.replace(Ke, ""), { target: s, key: a } = Pe(e, l);
278
+ const Qe = /-\d+$/;
279
+ function cn(e, t, r) {
280
+ if (dt(r)) {
281
+ if (Qe.test(r)) {
282
+ const l = r.replace(Qe, ""), { target: s, key: a } = Pe(e, l);
265
283
  if (!Array.isArray(s[a])) {
266
284
  const c = s[a], i = [];
267
285
  i.__tresDetach = () => {
268
- i.every((f) => Me(f)) && (s[a] = c);
286
+ i.every((f) => be(f)) && (s[a] = c);
269
287
  }, s[a] = i;
270
288
  }
271
289
  }
272
- const { target: r, key: o } = Pe(e, n);
273
- t.__tres.previousAttach = r[o], r[o] = J(t);
290
+ const { target: n, key: o } = Pe(e, r);
291
+ t.__tres.previousAttach = n[o], n[o] = J(t);
274
292
  } else
275
- t.__tres.previousAttach = n(e, t);
293
+ t.__tres.previousAttach = r(e, t);
276
294
  }
277
- function rr(e, t, n) {
278
- var r, o, l;
279
- if (ft(n)) {
280
- const { target: s, key: a } = Pe(e, n), c = t.__tres.previousAttach;
295
+ function un(e, t, r) {
296
+ var n, o, l;
297
+ if (dt(r)) {
298
+ const { target: s, key: a } = Pe(e, r), c = t.__tres.previousAttach;
281
299
  c === void 0 ? delete s[a] : s[a] = c, "__tresDetach" in s && s.__tresDetach();
282
300
  } else
283
- (o = (r = t.__tres) == null ? void 0 : r.previousAttach) == null || o.call(r, e, t);
301
+ (o = (n = t.__tres) == null ? void 0 : n.previousAttach) == null || o.call(n, e, t);
284
302
  (l = t.__tres) == null || delete l.previousAttach;
285
303
  }
286
- function z(e, t, n) {
287
- const r = e;
288
- return r.__tres = {
304
+ function z(e, t, r) {
305
+ const n = e;
306
+ return n.__tres = {
289
307
  type: "unknown",
290
308
  eventCount: 0,
291
- root: n,
309
+ root: r,
292
310
  handlers: {},
293
311
  memoizedProps: {},
294
312
  objects: [],
295
313
  parent: null,
296
314
  previousAttach: null,
297
315
  ...t
298
- }, r.__tres.attach || (r.isMaterial ? r.__tres.attach = "material" : r.isBufferGeometry ? r.__tres.attach = "geometry" : r.isFog && (r.__tres.attach = "fog")), r;
316
+ }, n.__tres.attach || (n.isMaterial ? n.__tres.attach = "material" : n.isBufferGeometry ? n.__tres.attach = "geometry" : n.isFog && (n.__tres.attach = "fog")), n;
299
317
  }
300
- function ht(e) {
301
- var n;
302
- const t = (n = e == null ? void 0 : e.__tres) == null ? void 0 : n.root;
318
+ function yt(e) {
319
+ var r;
320
+ const t = (r = e == null ? void 0 : e.__tres) == null ? void 0 : r.root;
303
321
  t && t.render && t.render.canBeInvalidated.value && t.invalidate();
304
322
  }
305
- function or(e, t, n) {
323
+ function fn(e, t, r) {
306
324
  var o;
307
- if (!G(e.setPixelRatio))
325
+ if (!Y(e.setPixelRatio))
308
326
  return;
309
- let r = 0;
310
- if (n && de(n)) {
311
- const l = n;
312
- if (l.length >= 2) {
313
- const [s, a] = l;
314
- r = it.clamp(t, s, a);
315
- }
316
- } else Bn(n) ? r = n : r = t;
317
- r !== ((o = e.getPixelRatio) == null ? void 0 : o.call(e)) && e.setPixelRatio(r);
327
+ let n = 0;
328
+ if (r && ke(r) && r.length >= 2) {
329
+ const [l, s] = r;
330
+ n = lt.clamp(t, l, s);
331
+ } else Hr(r) ? n = r : n = t;
332
+ n !== ((o = e.getPixelRatio) == null ? void 0 : o.call(e)) && e.setPixelRatio(n);
318
333
  }
319
- function sr(e, t, n, r, o) {
334
+ function pn(e, t, r, n, o) {
320
335
  const l = [...t.__tres.objects], s = J(t);
321
336
  if (e = J(e), s === e)
322
337
  return !0;
323
338
  const a = z(e, t.__tres ?? {}, o), c = t.parent ?? t.__tres.parent ?? null, i = { ...t.__tres.memoizedProps };
324
339
  delete i.object;
325
340
  for (const f of l)
326
- gt(f, o), vt(f, o);
327
- s.__tres.objects = [], r.remove(t);
328
- for (const [f, g] of Object.entries(i))
329
- r.patchProp(a, f, a[f], g);
330
- n(e), r.insert(t, c);
341
+ _t(f, o), wt(f, o);
342
+ s.__tres.objects = [], n.remove(t);
343
+ for (const [f, v] of Object.entries(i))
344
+ n.patchProp(a, f, a[f], v);
345
+ r(e), n.insert(t, c);
331
346
  for (const f of l)
332
- r.insert(f, t);
347
+ n.insert(f, t);
333
348
  return !0;
334
349
  }
335
350
  function J(e) {
336
- return Wn(e) ? (e.object.__tres = e.__tres, e.object) : e;
351
+ return qr(e) ? (e.object.__tres = e.__tres, e.object) : e;
337
352
  }
338
- function gt(e, t) {
339
- var r, o, l, s;
340
- const n = ((r = e.__tres) == null ? void 0 : r.parent) || t.scene.value;
341
- e.__tres && (e.__tres.parent = null), n && n.__tres && "objects" in n.__tres && tr(n.__tres.objects, (a) => a !== e), (o = e.__tres) != null && o.attach ? rr(n, e, e.__tres.attach) : ((s = (l = e.parent) == null ? void 0 : l.remove) == null || s.call(l, J(e)), e.parent = null);
353
+ function _t(e, t) {
354
+ var n, o, l, s;
355
+ const r = ((n = e.__tres) == null ? void 0 : n.parent) || t.scene.value;
356
+ e.__tres && (e.__tres.parent = null), r && r.__tres && "objects" in r.__tres && ln(r.__tres.objects, (a) => a !== e), (o = e.__tres) != null && o.attach ? un(r, e, e.__tres.attach) : ((s = (l = e.parent) == null ? void 0 : l.remove) == null || s.call(l, J(e)), e.parent = null);
342
357
  }
343
- function vt(e, t) {
344
- var n;
345
- (n = e.traverse) == null || n.call(e, (r) => {
358
+ function wt(e, t) {
359
+ var r;
360
+ (r = e.traverse) == null || r.call(e, (n) => {
346
361
  var o;
347
- t.deregisterCamera(r), (o = t.eventManager) == null || o.deregisterPointerMissedObject(r);
348
- }), t.deregisterCamera(e), ht(e);
362
+ t.deregisterCamera(n), (o = t.eventManager) == null || o.deregisterPointerMissedObject(n);
363
+ }), t.deregisterCamera(e), yt(e);
349
364
  }
350
- async function ir(e, t) {
351
- const n = new $t(t), r = (o) => new Promise((l, s) => {
352
- n.load(
365
+ async function dn(e, t) {
366
+ const r = new Wt(t), n = (o) => new Promise((l, s) => {
367
+ r.load(
353
368
  o,
354
369
  (a) => l(a),
355
370
  () => null,
@@ -358,8 +373,8 @@ async function ir(e, t) {
358
373
  }
359
374
  );
360
375
  });
361
- if (Jn(e)) {
362
- const o = await Promise.all(e.map((l) => r(l)));
376
+ if (rn(e)) {
377
+ const o = await Promise.all(e.map((l) => n(l)));
363
378
  return e.length > 1 ? o : o[0];
364
379
  } else {
365
380
  const {
@@ -370,21 +385,21 @@ async function ir(e, t) {
370
385
  metalnessMap: c,
371
386
  aoMap: i,
372
387
  alphaMap: f,
373
- matcap: g
388
+ matcap: v
374
389
  } = e;
375
390
  return {
376
- map: o ? await r(o) : null,
377
- displacementMap: l ? await r(l) : null,
378
- normalMap: s ? await r(s) : null,
379
- roughnessMap: a ? await r(a) : null,
380
- metalnessMap: c ? await r(c) : null,
381
- aoMap: i ? await r(i) : null,
382
- alphaMap: f ? await r(f) : null,
383
- matcap: g ? await r(g) : null
391
+ map: o ? await n(o) : null,
392
+ displacementMap: l ? await n(l) : null,
393
+ normalMap: s ? await n(s) : null,
394
+ roughnessMap: a ? await n(a) : null,
395
+ metalnessMap: c ? await n(c) : null,
396
+ aoMap: i ? await n(i) : null,
397
+ alphaMap: f ? await n(f) : null,
398
+ matcap: v ? await n(v) : null
384
399
  };
385
400
  }
386
401
  }
387
- const qr = /* @__PURE__ */ fe({
402
+ const to = /* @__PURE__ */ ue({
388
403
  __name: "component",
389
404
  props: {
390
405
  map: {},
@@ -397,130 +412,130 @@ const qr = /* @__PURE__ */ fe({
397
412
  matcap: {}
398
413
  },
399
414
  async setup(e) {
400
- let t, n;
401
- const r = e, o = ([t, n] = nt(() => Se(ir(r))), t = await t, n(), t);
402
- return (l, s) => rt(l.$slots, "default", { textures: W(o) });
415
+ let t, r;
416
+ const n = e, o = ([t, r] = ot(() => Se(dn(n))), t = await t, r(), t);
417
+ return (l, s) => st(l.$slots, "default", { textures: W(o) });
403
418
  }
404
- }), ar = ({ sizes: e }) => {
405
- const t = I([]), n = q(
419
+ }), mn = ({ sizes: e }) => {
420
+ const t = $([]), r = q(
406
421
  () => t.value[0]
407
- ), r = (s) => {
408
- const a = s instanceof Ht ? s : t.value.find((i) => i.uuid === s);
422
+ ), n = (s) => {
423
+ const a = s instanceof Nt ? s : t.value.find((i) => i.uuid === s);
409
424
  if (!a)
410
425
  return;
411
426
  const c = t.value.filter(({ uuid: i }) => i !== a.uuid);
412
427
  t.value = [a, ...c];
413
428
  }, o = (s, a = !1) => {
414
- if (ze(s)) {
429
+ if (Ve(s)) {
415
430
  const c = s;
416
431
  if (t.value.some(({ uuid: i }) => i === c.uuid))
417
432
  return;
418
- a ? r(c) : t.value.push(c);
433
+ a ? n(c) : t.value.push(c);
419
434
  }
420
435
  }, l = (s) => {
421
- if (ze(s)) {
436
+ if (Ve(s)) {
422
437
  const a = s;
423
438
  t.value = t.value.filter(({ uuid: c }) => c !== a.uuid);
424
439
  }
425
440
  };
426
441
  return Ae(() => {
427
442
  e.aspectRatio.value && t.value.forEach((s) => {
428
- !s.manual && (s instanceof be || lr(s)) && (s instanceof be ? s.aspect = e.aspectRatio.value : (s.left = e.width.value * -0.5, s.right = e.width.value * 0.5, s.top = e.height.value * 0.5, s.bottom = e.height.value * -0.5), s.updateProjectionMatrix());
443
+ !s.manual && (s instanceof we || gn(s)) && (s instanceof we ? s.aspect = e.aspectRatio.value : (s.left = e.width.value * -0.5, s.right = e.width.value * 0.5, s.top = e.height.value * 0.5, s.bottom = e.height.value * -0.5), s.updateProjectionMatrix());
429
444
  });
430
445
  }), K(() => {
431
446
  t.value = [];
432
447
  }), {
433
- camera: n,
448
+ camera: r,
434
449
  cameras: t,
435
450
  registerCamera: o,
436
451
  deregisterCamera: l,
437
- setCameraActive: r
452
+ setCameraActive: n
438
453
  };
439
454
  };
440
- function lr(e) {
455
+ function gn(e) {
441
456
  return e.hasOwnProperty("isOrthographicCamera") && e.isOrthographicCamera;
442
457
  }
443
- const Kr = !0, pe = "[TresJS ▲ ■ ●] ";
444
- function cr(...e) {
445
- typeof e[0] == "string" ? e[0] = pe + e[0] : e.unshift(pe), console.error(...e);
458
+ const ro = !0, fe = "[TresJS ▲ ■ ●] ";
459
+ function hn(...e) {
460
+ typeof e[0] == "string" ? e[0] = fe + e[0] : e.unshift(fe), console.error(...e);
446
461
  }
447
- function ur(...e) {
448
- typeof e[0] == "string" ? e[0] = pe + e[0] : e.unshift(pe), console.warn(...e);
462
+ function vn(...e) {
463
+ typeof e[0] == "string" ? e[0] = fe + e[0] : e.unshift(fe), console.warn(...e);
449
464
  }
450
- function fr(e, t) {
465
+ function yn(e, t) {
451
466
  }
452
467
  function Q() {
453
468
  return {
454
- logError: cr,
455
- logWarning: ur,
456
- logMessage: fr
469
+ logError: hn,
470
+ logWarning: vn,
471
+ logMessage: yn
457
472
  };
458
473
  }
459
- const Ce = I({}), Ee = (e) => Object.assign(Ce.value, e);
460
- function ye() {
474
+ const Ce = $({}), Ee = (e) => Object.assign(Ce.value, e);
475
+ function ve() {
461
476
  const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set();
462
- let n = 0, r = !1;
477
+ let r = 0, n = !1;
463
478
  const o = () => {
464
- const i = Array.from(e.entries()).sort((f, g) => {
465
- const u = f[1].priority - g[1].priority;
466
- return u === 0 ? f[1].addI - g[1].addI : u;
479
+ const i = Array.from(e.entries()).sort((f, v) => {
480
+ const u = f[1].priority - v[1].priority;
481
+ return u === 0 ? f[1].addI - v[1].addI : u;
467
482
  });
468
483
  t.clear(), i.forEach((f) => t.add(f[0]));
469
484
  }, l = (i) => {
470
485
  e.delete(i), t.delete(i);
471
486
  };
472
487
  return { on: (i, f = 0) => {
473
- e.set(i, { priority: f, addI: n++ });
474
- const g = () => l(i);
475
- return nn(g), r = !0, {
476
- off: g
488
+ e.set(i, { priority: f, addI: r++ });
489
+ const v = () => l(i);
490
+ return ir(v), n = !0, {
491
+ off: v
477
492
  };
478
493
  }, off: l, trigger: (...i) => {
479
- r && (o(), r = !1), t.forEach((f) => f(...i));
494
+ n && (o(), n = !1), t.forEach((f) => f(...i));
480
495
  }, dispose: () => {
481
496
  e.clear(), t.clear();
482
497
  }, get count() {
483
498
  return e.size;
484
499
  } };
485
500
  }
486
- function dr() {
487
- let e = !0, t = !0, n = !1;
488
- const r = new lt(!1), o = I(r.running), l = I(!1);
501
+ function _n() {
502
+ let e = !0, t = !0, r = !1;
503
+ const n = new ut(!1), o = $(n.running), l = $(!1);
489
504
  let s;
490
- const a = it.generateUUID();
505
+ const a = lt.generateUUID();
491
506
  let c = null;
492
- const i = ye(), f = ye(), g = ye();
507
+ const i = ve(), f = ve(), v = ve();
493
508
  S();
494
509
  let u = {};
495
- function y(M) {
510
+ function _(M) {
496
511
  u = M;
497
512
  }
498
- function p(M, x, m = 0) {
513
+ function d(M, x, m = 0) {
499
514
  switch (x) {
500
515
  case "before":
501
516
  return i.on(M, m);
502
517
  case "render":
503
518
  return c || (c = M), f.dispose(), f.on(M);
504
519
  case "after":
505
- return g.on(M, m);
520
+ return v.on(M, m);
506
521
  }
507
522
  }
508
- function _() {
523
+ function y() {
509
524
  t && (t = !1, S(), E());
510
525
  }
511
- function d() {
526
+ function p() {
512
527
  t = !0, S(), cancelAnimationFrame(s);
513
528
  }
514
- function v() {
515
- n = !1, S();
529
+ function h() {
530
+ r = !1, S();
516
531
  }
517
532
  function P() {
518
- n = !0, S();
533
+ r = !0, S();
519
534
  }
520
535
  function C() {
521
536
  l.value = !0;
522
537
  }
523
- function w() {
538
+ function b() {
524
539
  l.value = !1;
525
540
  }
526
541
  function E() {
@@ -528,7 +543,7 @@ function dr() {
528
543
  s = requestAnimationFrame(E);
529
544
  return;
530
545
  }
531
- const M = r.getDelta(), x = r.getElapsedTime(), m = {
546
+ const M = n.getDelta(), x = n.getElapsedTime(), m = {
532
547
  camera: W(u.camera),
533
548
  scene: W(u.scene),
534
549
  renderer: W(u.renderer),
@@ -536,73 +551,73 @@ function dr() {
536
551
  controls: W(u.controls),
537
552
  invalidate: u.invalidate,
538
553
  advance: u.advance
539
- }, b = { delta: M, elapsed: x, clock: r, ...m };
540
- o.value && i.trigger(b), l.value || (f.count ? f.trigger(b) : c && c(b)), o.value && g.trigger(b), s = requestAnimationFrame(E);
554
+ }, w = { delta: M, elapsed: x, clock: n, ...m };
555
+ o.value && i.trigger(w), l.value || (f.count ? f.trigger(w) : c && c(w)), o.value && v.trigger(w), s = requestAnimationFrame(E);
541
556
  }
542
557
  function S() {
543
- const M = !t && !n;
544
- r.running !== M && (r.running ? r.stop() : r.start()), o.value = r.running;
558
+ const M = !t && !r;
559
+ n.running !== M && (n.running ? n.stop() : n.start()), o.value = n.running;
545
560
  }
546
561
  return {
547
562
  loopId: a,
548
- register: (M, x, m) => p(M, x, m),
549
- start: _,
550
- stop: d,
563
+ register: (M, x, m) => d(M, x, m),
564
+ start: y,
565
+ stop: p,
551
566
  pause: P,
552
- resume: v,
567
+ resume: h,
553
568
  pauseRender: C,
554
- resumeRender: w,
569
+ resumeRender: b,
555
570
  isRenderPaused: l,
556
571
  isActive: o,
557
- setContext: y,
572
+ setContext: _,
558
573
  setReady: (M) => e = M
559
574
  };
560
575
  }
561
- function ke(e) {
576
+ function Le(e) {
562
577
  let t = 0;
563
- return e.traverse((n) => {
564
- if (n.isMesh && n.geometry && n.type !== "HightlightMesh") {
565
- const r = n.geometry, o = r.attributes.position.count * 3 * Float32Array.BYTES_PER_ELEMENT, l = r.index ? r.index.count * Uint32Array.BYTES_PER_ELEMENT : 0, s = r.attributes.normal ? r.attributes.normal.count * 3 * Float32Array.BYTES_PER_ELEMENT : 0, a = r.attributes.uv ? r.attributes.uv.count * 2 * Float32Array.BYTES_PER_ELEMENT : 0, c = o + l + s + a;
578
+ return e.traverse((r) => {
579
+ if (r.isMesh && r.geometry && r.type !== "HightlightMesh") {
580
+ const n = r.geometry, o = n.attributes.position.count * 3 * Float32Array.BYTES_PER_ELEMENT, l = n.index ? n.index.count * Uint32Array.BYTES_PER_ELEMENT : 0, s = n.attributes.normal ? n.attributes.normal.count * 3 * Float32Array.BYTES_PER_ELEMENT : 0, a = n.attributes.uv ? n.attributes.uv.count * 2 * Float32Array.BYTES_PER_ELEMENT : 0, c = o + l + s + a;
566
581
  t += c;
567
582
  }
568
583
  }), t;
569
584
  }
570
- function pr(e) {
585
+ function wn(e) {
571
586
  return (e / 1024).toFixed(2);
572
587
  }
573
- const mr = Number.parseInt(Ut.replace("dev", ""));
574
- function Jr(e) {
588
+ const bn = Number.parseInt(zt.replace("dev", ""));
589
+ function no(e) {
575
590
  return typeof e == "number" ? [e, e, e] : e instanceof xe ? [e.x, e.y, e.z] : e;
576
591
  }
577
- function hr(e) {
592
+ function Mn(e) {
578
593
  return e instanceof Z ? e : Array.isArray(e) ? new Z(...e) : new Z(e);
579
594
  }
580
- const se = {
595
+ const oe = {
581
596
  realistic: {
582
597
  shadows: !0,
583
598
  physicallyCorrectLights: !0,
584
- outputColorSpace: Nt,
585
- toneMapping: ct,
599
+ outputColorSpace: Yt,
600
+ toneMapping: ft,
586
601
  toneMappingExposure: 3,
587
602
  shadowMap: {
588
603
  enabled: !0,
589
- type: Wt
604
+ type: Vt
590
605
  }
591
606
  },
592
607
  flat: {
593
- toneMapping: Ft,
608
+ toneMapping: Gt,
594
609
  toneMappingExposure: 1
595
610
  }
596
611
  };
597
- function gr({
612
+ function Pn({
598
613
  canvas: e,
599
614
  options: t,
600
- contextParts: { sizes: n, render: r, invalidate: o, advance: l }
615
+ contextParts: { sizes: r, render: n, invalidate: o, advance: l }
601
616
  }) {
602
617
  const s = q(() => ({
603
618
  alpha: A(t.alpha) ?? !0,
604
619
  depth: A(t.depth),
605
- canvas: rn(e),
620
+ canvas: ar(e),
606
621
  context: A(t.context),
607
622
  stencil: A(t.stencil),
608
623
  antialias: A(t.antialias) ?? !0,
@@ -612,48 +627,48 @@ function gr({
612
627
  preserveDrawingBuffer: A(t.preserveDrawingBuffer),
613
628
  logarithmicDepthBuffer: A(t.logarithmicDepthBuffer),
614
629
  failIfMajorPerformanceCaveat: A(t.failIfMajorPerformanceCaveat)
615
- })), a = $(new ge(s.value));
630
+ })), a = H(new me(s.value));
616
631
  function c() {
617
632
  t.renderMode === "on-demand" && o();
618
633
  }
619
- ae(s, () => {
620
- a.value.dispose(), a.value = new ge(s.value), c();
621
- }), ae([n.width, n.height], () => {
622
- a.value.setSize(n.width.value, n.height.value), c();
634
+ ie(s, () => {
635
+ a.value.dispose(), a.value = new me(s.value), c();
636
+ }), ie([r.width, r.height], () => {
637
+ a.value.setSize(r.width.value, r.height.value), c();
623
638
  }, {
624
639
  immediate: !0
625
- }), ae(() => t.clearColor, c);
626
- const { pixelRatio: i } = on(), { logError: f } = Q(), u = (() => {
627
- const p = new ge(), _ = {
640
+ }), ie(() => t.clearColor, c);
641
+ const { pixelRatio: i } = lr(), { logError: f } = Q(), u = (() => {
642
+ const d = new me(), y = {
628
643
  shadowMap: {
629
- enabled: p.shadowMap.enabled,
630
- type: p.shadowMap.type
644
+ enabled: d.shadowMap.enabled,
645
+ type: d.shadowMap.type
631
646
  },
632
- toneMapping: p.toneMapping,
633
- toneMappingExposure: p.toneMappingExposure,
634
- outputColorSpace: p.outputColorSpace
647
+ toneMapping: d.toneMapping,
648
+ toneMappingExposure: d.toneMappingExposure,
649
+ outputColorSpace: d.outputColorSpace
635
650
  };
636
- return p.dispose(), _;
637
- })(), y = A(t.renderMode);
638
- return y === "on-demand" && o(), y === "manual" && setTimeout(() => {
651
+ return d.dispose(), y;
652
+ })(), _ = A(t.renderMode);
653
+ return _ === "on-demand" && o(), _ === "manual" && setTimeout(() => {
639
654
  l();
640
655
  }, 100), Ae(() => {
641
- const p = A(t.preset);
642
- p && (p in se || f(`Renderer Preset must be one of these: ${Object.keys(se).join(", ")}`), dt(a.value, se[p])), or(a.value, i.value, A(t.dpr)), y === "always" && (r.frames.value = Math.max(1, r.frames.value));
643
- const _ = (P, C) => {
644
- const w = A(P), E = () => {
645
- if (p)
646
- return Ve(se[p], C);
656
+ const d = A(t.preset);
657
+ d && (d in oe || f(`Renderer Preset must be one of these: ${Object.keys(oe).join(", ")}`), gt(a.value, oe[d])), fn(a.value, i.value, A(t.dpr)), _ === "always" && (n.frames.value = Math.max(1, n.frames.value));
658
+ const y = (P, C) => {
659
+ const b = A(P), E = () => {
660
+ if (d)
661
+ return qe(oe[d], C);
647
662
  };
648
- if (w !== void 0)
649
- return w;
663
+ if (b !== void 0)
664
+ return b;
650
665
  const S = E();
651
- return S !== void 0 ? S : Ve(u, C);
652
- }, d = (P, C) => qn(a.value, C, _(P, C));
653
- d(t.shadows, "shadowMap.enabled"), d(t.toneMapping ?? ct, "toneMapping"), d(t.shadowMapType, "shadowMap.type"), mr < 150 && d(!t.useLegacyLights, "physicallyCorrectLights"), d(t.outputColorSpace, "outputColorSpace"), d(t.toneMappingExposure, "toneMappingExposure");
654
- const v = _(t.clearColor, "clearColor");
655
- v && a.value.setClearColor(
656
- v ? hr(v) : new Z(0)
666
+ return S !== void 0 ? S : qe(u, C);
667
+ }, p = (P, C) => en(a.value, C, y(P, C));
668
+ p(t.shadows, "shadowMap.enabled"), p(t.toneMapping ?? ft, "toneMapping"), p(t.shadowMapType, "shadowMap.type"), bn < 150 && p(!t.useLegacyLights, "physicallyCorrectLights"), p(t.outputColorSpace, "outputColorSpace"), p(t.toneMappingExposure, "toneMappingExposure");
669
+ const h = y(t.clearColor, "clearColor");
670
+ h && a.value.setClearColor(
671
+ h ? Mn(h) : new Z(0)
657
672
  // default clear color is not easily/efficiently retrievable from three
658
673
  );
659
674
  }), K(() => {
@@ -662,199 +677,199 @@ function gr({
662
677
  renderer: a
663
678
  };
664
679
  }
665
- function vr(e, t, n = 10) {
666
- const r = A(e) ? sn() : an(q(() => A(t).parentElement)), o = we(Ne(r.width, n)), l = we(Ne(r.height, n)), s = q(() => o.value / l.value);
680
+ function Cn(e, t, r = 10) {
681
+ const n = A(e) ? cr() : ur(q(() => A(t).parentElement)), o = _e(ze(n.width, r)), l = _e(ze(n.height, r)), s = q(() => o.value / l.value);
667
682
  return {
668
683
  height: l,
669
684
  width: o,
670
685
  aspectRatio: s
671
686
  };
672
687
  }
673
- const yr = (e, t) => {
674
- const n = q(() => t.renderer.value.domElement), r = $([]), { x: o, y: l } = ln({ target: n });
688
+ const En = (e, t) => {
689
+ const r = q(() => t.renderer.value.domElement), n = H([]), { x: o, y: l } = fr({ target: r });
675
690
  let s = 0;
676
- const { width: a, height: c, top: i, left: f } = cn(n), g = ({ x: h, y: T }) => {
677
- if (n.value)
691
+ const { width: a, height: c, top: i, left: f } = pr(r), v = ({ x: g, y: T }) => {
692
+ if (r.value)
678
693
  return {
679
- x: (h - f.value) / a.value * 2 - 1,
694
+ x: (g - f.value) / a.value * 2 - 1,
680
695
  y: -((T - i.value) / c.value) * 2 + 1
681
696
  };
682
- }, u = ({ x: h, y: T }) => {
697
+ }, u = ({ x: g, y: T }) => {
683
698
  if (t.camera.value)
684
- return t.raycaster.value.setFromCamera(new ve(h, T), t.camera.value), r.value = t.raycaster.value.intersectObjects(e.value, !0), r.value;
685
- }, y = (h) => {
686
- const T = g({
687
- x: (h == null ? void 0 : h.clientX) ?? o.value,
688
- y: (h == null ? void 0 : h.clientY) ?? l.value
699
+ return t.raycaster.value.setFromCamera(new ge(g, T), t.camera.value), n.value = t.raycaster.value.intersectObjects(e.value, !0), n.value;
700
+ }, _ = (g) => {
701
+ const T = v({
702
+ x: (g == null ? void 0 : g.clientX) ?? o.value,
703
+ y: (g == null ? void 0 : g.clientY) ?? l.value
689
704
  });
690
705
  return T ? u(T) || [] : [];
691
- }, p = D(), _ = D(), d = D(), v = D(), P = D(), C = D(), w = D(), E = D();
692
- function S(h) {
706
+ }, d = D(), y = D(), p = D(), h = D(), P = D(), C = D(), b = D(), E = D();
707
+ function S(g) {
693
708
  const T = {};
694
- for (const U in h)
695
- typeof U != "function" && (T[U] = h[U]);
709
+ for (const U in g)
710
+ typeof U != "function" && (T[U] = g[U]);
696
711
  return T;
697
712
  }
698
- const M = (h, T) => {
699
- var Be, Ie, $e;
700
- const U = S(T), ne = new xe(T == null ? void 0 : T.clientX, T == null ? void 0 : T.clientY, 0).unproject((Be = t.camera) == null ? void 0 : Be.value);
701
- h.trigger({
713
+ const M = (g, T) => {
714
+ var Ie, $e, He;
715
+ const U = S(T), re = new xe(T == null ? void 0 : T.clientX, T == null ? void 0 : T.clientY, 0).unproject((Ie = t.camera) == null ? void 0 : Ie.value);
716
+ g.trigger({
702
717
  ...U,
703
- intersections: r.value,
718
+ intersections: n.value,
704
719
  // The unprojectedPoint is wrong, math needs to be fixed
705
- unprojectedPoint: ne,
706
- ray: (Ie = t.raycaster) == null ? void 0 : Ie.value.ray,
707
- camera: ($e = t.camera) == null ? void 0 : $e.value,
720
+ unprojectedPoint: re,
721
+ ray: ($e = t.raycaster) == null ? void 0 : $e.value.ray,
722
+ camera: (He = t.camera) == null ? void 0 : He.value,
708
723
  sourceEvent: T,
709
724
  delta: s,
710
725
  stopPropagating: !1
711
726
  });
712
727
  };
713
728
  let x;
714
- const m = (h) => {
715
- y(h), M(d, h), x = h;
716
- }, b = () => {
729
+ const m = (g) => {
730
+ _(g), M(p, g), x = g;
731
+ }, w = () => {
717
732
  x && m(x);
718
733
  };
719
734
  let k, L, R;
720
- const j = (h) => {
735
+ const B = (g) => {
721
736
  var T;
722
- k = (T = r.value[0]) == null ? void 0 : T.object, s = 0, L = new ve(
723
- (h == null ? void 0 : h.clientX) ?? o.value,
724
- (h == null ? void 0 : h.clientY) ?? l.value
725
- ), M(P, h);
737
+ k = (T = n.value[0]) == null ? void 0 : T.object, s = 0, L = new ge(
738
+ (g == null ? void 0 : g.clientX) ?? o.value,
739
+ (g == null ? void 0 : g.clientY) ?? l.value
740
+ ), M(P, g);
726
741
  };
727
- let O, V = !1;
728
- const Re = (h) => {
729
- var T, U, ne;
730
- h instanceof PointerEvent && (r.value.length === 0 && M(C, h), k === ((T = r.value[0]) == null ? void 0 : T.object) && (R = new ve(
731
- (h == null ? void 0 : h.clientX) ?? o.value,
732
- (h == null ? void 0 : h.clientY) ?? l.value
733
- ), s = L == null ? void 0 : L.distanceTo(R), h.button === 0 ? (M(p, h), O === ((U = r.value[0]) == null ? void 0 : U.object) ? V = !0 : (O = (ne = r.value[0]) == null ? void 0 : ne.object, V = !1)) : h.button === 2 && M(w, h)), M(v, h));
734
- }, Oe = (h) => {
735
- V && (M(_, h), O = void 0, V = !1);
736
- }, De = (h) => M(d, h), je = (h) => M(E, h);
737
- return n.value.addEventListener("pointerup", Re), n.value.addEventListener("pointerdown", j), n.value.addEventListener("pointermove", m), n.value.addEventListener("pointerleave", De), n.value.addEventListener("dblclick", Oe), n.value.addEventListener("wheel", je), K(() => {
738
- n != null && n.value && (n.value.removeEventListener("pointerup", Re), n.value.removeEventListener("pointerdown", j), n.value.removeEventListener("pointermove", m), n.value.removeEventListener("pointerleave", De), n.value.removeEventListener("dblclick", Oe), n.value.removeEventListener("wheel", je));
742
+ let O, G = !1;
743
+ const Oe = (g) => {
744
+ var T, U, re;
745
+ g instanceof PointerEvent && (n.value.length === 0 && M(C, g), k === ((T = n.value[0]) == null ? void 0 : T.object) && (R = new ge(
746
+ (g == null ? void 0 : g.clientX) ?? o.value,
747
+ (g == null ? void 0 : g.clientY) ?? l.value
748
+ ), s = L == null ? void 0 : L.distanceTo(R), g.button === 0 ? (M(d, g), O === ((U = n.value[0]) == null ? void 0 : U.object) ? G = !0 : (O = (re = n.value[0]) == null ? void 0 : re.object, G = !1)) : g.button === 2 && M(b, g)), M(h, g));
749
+ }, De = (g) => {
750
+ G && (M(y, g), O = void 0, G = !1);
751
+ }, je = (g) => M(p, g), Be = (g) => M(E, g);
752
+ return r.value.addEventListener("pointerup", Oe), r.value.addEventListener("pointerdown", B), r.value.addEventListener("pointermove", m), r.value.addEventListener("pointerleave", je), r.value.addEventListener("dblclick", De), r.value.addEventListener("wheel", Be), K(() => {
753
+ r != null && r.value && (r.value.removeEventListener("pointerup", Oe), r.value.removeEventListener("pointerdown", B), r.value.removeEventListener("pointermove", m), r.value.removeEventListener("pointerleave", je), r.value.removeEventListener("dblclick", De), r.value.removeEventListener("wheel", Be));
739
754
  }), {
740
- intersects: r,
741
- onClick: (h) => p.on(h).off,
742
- onDblClick: (h) => _.on(h).off,
743
- onContextMenu: (h) => w.on(h).off,
744
- onPointerMove: (h) => d.on(h).off,
745
- onPointerUp: (h) => v.on(h).off,
746
- onPointerDown: (h) => P.on(h).off,
747
- onPointerMissed: (h) => C.on(h).off,
748
- onWheel: (h) => E.on(h).off,
749
- forceUpdate: b
755
+ intersects: n,
756
+ onClick: (g) => d.on(g).off,
757
+ onDblClick: (g) => y.on(g).off,
758
+ onContextMenu: (g) => b.on(g).off,
759
+ onPointerMove: (g) => p.on(g).off,
760
+ onPointerUp: (g) => h.on(g).off,
761
+ onPointerDown: (g) => P.on(g).off,
762
+ onPointerMissed: (g) => C.on(g).off,
763
+ onWheel: (g) => E.on(g).off,
764
+ forceUpdate: w
750
765
  };
751
766
  };
752
- function _e(e, t) {
767
+ function ye(e, t) {
753
768
  if (Array.isArray(e))
754
- for (const n of e)
755
- n(t);
769
+ for (const r of e)
770
+ r(t);
756
771
  typeof e == "function" && e(t);
757
772
  }
758
- function _r(e, t, n) {
773
+ function Tn(e, t, r) {
759
774
  var x;
760
- const r = $(), o = $();
761
- e && (r.value = e), t && (o.value = t);
775
+ const n = H(), o = H();
776
+ e && (n.value = e), t && (o.value = t);
762
777
  const l = (m) => {
763
- var b;
764
- return ((b = m.__tres) == null ? void 0 : b.eventCount) > 0;
778
+ var w;
779
+ return ((w = m.__tres) == null ? void 0 : w.eventCount) > 0;
765
780
  }, s = (m) => {
766
- var b;
767
- return ((b = m.children) == null ? void 0 : b.some((k) => s(k))) || l(m);
768
- }, a = $(((x = r.value) == null ? void 0 : x.children).filter(s) || []);
769
- function c(m, b) {
770
- const k = [], L = () => b.stopPropagating = !0;
771
- b.stopPropagation = L;
772
- for (const R of b == null ? void 0 : b.intersections) {
773
- if (b.stopPropagating)
781
+ var w;
782
+ return ((w = m.children) == null ? void 0 : w.some((k) => s(k))) || l(m);
783
+ }, a = H(((x = n.value) == null ? void 0 : x.children).filter(s) || []);
784
+ function c(m, w) {
785
+ const k = [], L = () => w.stopPropagating = !0;
786
+ w.stopPropagation = L;
787
+ for (const R of w == null ? void 0 : w.intersections) {
788
+ if (w.stopPropagating)
774
789
  return;
775
- b = { ...b, ...R };
776
- const { object: j } = R;
777
- b.eventObject = j, _e(j[m], b), k.push(j);
778
- let O = j.parent;
779
- for (; O !== null && !b.stopPropagating && !k.includes(O); )
780
- b.eventObject = O, _e(O[m], b), k.push(O), O = O.parent;
781
- const V = Vn(m.slice(2));
782
- n(V, { intersection: R, event: b });
790
+ w = { ...w, ...R };
791
+ const { object: B } = R;
792
+ w.eventObject = B, ye(B[m], w), k.push(B);
793
+ let O = B.parent;
794
+ for (; O !== null && !w.stopPropagating && !k.includes(O); )
795
+ w.eventObject = O, ye(O[m], w), k.push(O), O = O.parent;
796
+ const G = Xr(m.slice(2));
797
+ r(G, { intersection: R, event: w });
783
798
  }
784
799
  }
785
800
  const {
786
801
  onClick: i,
787
802
  onDblClick: f,
788
- onContextMenu: g,
803
+ onContextMenu: v,
789
804
  onPointerMove: u,
790
- onPointerDown: y,
791
- onPointerUp: p,
792
- onPointerMissed: _,
793
- onWheel: d,
794
- forceUpdate: v
795
- } = yr(a, t);
796
- p((m) => c("onPointerUp", m)), y((m) => c("onPointerDown", m)), i((m) => c("onClick", m)), f((m) => c("onDoubleClick", m)), g((m) => c("onContextMenu", m)), d((m) => c("onWheel", m));
805
+ onPointerDown: _,
806
+ onPointerUp: d,
807
+ onPointerMissed: y,
808
+ onWheel: p,
809
+ forceUpdate: h
810
+ } = En(a, t);
811
+ d((m) => c("onPointerUp", m)), _((m) => c("onPointerDown", m)), i((m) => c("onClick", m)), f((m) => c("onDoubleClick", m)), v((m) => c("onContextMenu", m)), p((m) => c("onWheel", m));
797
812
  let P = [];
798
813
  u((m) => {
799
- const b = m.intersections.map(({ object: L }) => L), k = m.intersections;
814
+ const w = m.intersections.map(({ object: L }) => L), k = m.intersections;
800
815
  P.forEach(({ object: L }) => {
801
- b.includes(L) || (m.intersections = P, c("onPointerLeave", m), c("onPointerOut", m));
816
+ w.includes(L) || (m.intersections = P, c("onPointerLeave", m), c("onPointerOut", m));
802
817
  }), m.intersections = k, m.intersections.forEach(({ object: L }) => {
803
818
  P.includes(L) || (c("onPointerEnter", m), c("onPointerOver", m));
804
819
  }), c("onPointerMove", m), P = m.intersections;
805
820
  });
806
821
  const C = [];
807
- _((m) => {
808
- const b = () => m.stopPropagating = !0;
809
- m.stopPropagation = b, C.forEach((k) => {
810
- m.stopPropagating || (m.eventObject = k, _e(k.onPointerMissed, m));
811
- }), n("pointer-missed", { event: m });
822
+ y((m) => {
823
+ const w = () => m.stopPropagating = !0;
824
+ m.stopPropagation = w, C.forEach((k) => {
825
+ m.stopPropagating || (m.eventObject = k, ye(k.onPointerMissed, m));
826
+ }), r("pointer-missed", { event: m });
812
827
  });
813
- function w(m) {
814
- re(m) && N(m) && a.value.push(m);
828
+ function b(m) {
829
+ ne(m) && N(m) && a.value.push(m);
815
830
  }
816
831
  function E(m) {
817
- if (re(m) && N(m)) {
818
- const b = a.value.indexOf(m);
819
- b > -1 && a.value.splice(b, 1);
832
+ if (ne(m) && N(m)) {
833
+ const w = a.value.indexOf(m);
834
+ w > -1 && a.value.splice(w, 1);
820
835
  }
821
836
  }
822
837
  function S(m) {
823
- re(m) && N(m) && m.onPointerMissed && C.push(m);
838
+ ne(m) && N(m) && m.onPointerMissed && C.push(m);
824
839
  }
825
840
  function M(m) {
826
- if (re(m) && N(m)) {
827
- const b = C.indexOf(m);
828
- b > -1 && C.splice(b, 1);
841
+ if (ne(m) && N(m)) {
842
+ const w = C.indexOf(m);
843
+ w > -1 && C.splice(w, 1);
829
844
  }
830
845
  }
831
846
  return t.eventManager = {
832
- forceUpdate: v,
833
- registerObject: w,
847
+ forceUpdate: h,
848
+ registerObject: b,
834
849
  deregisterObject: E,
835
850
  registerPointerMissedObject: S,
836
851
  deregisterPointerMissedObject: M
837
852
  }, {
838
- forceUpdate: v,
839
- registerObject: w,
853
+ forceUpdate: h,
854
+ registerObject: b,
840
855
  deregisterObject: E,
841
856
  registerPointerMissedObject: S,
842
857
  deregisterPointerMissedObject: M
843
858
  };
844
859
  }
845
- function wr(e, t, n = 100) {
846
- n = n <= 0 ? 100 : n;
847
- const r = D(), o = /* @__PURE__ */ new Set();
860
+ function Sn(e, t, r = 100) {
861
+ r = r <= 0 ? 100 : r;
862
+ const n = D(), o = /* @__PURE__ */ new Set();
848
863
  let l = !1, s = !1, a = null;
849
864
  function c() {
850
- a && clearTimeout(a), !s && !l && e() ? (r.trigger(t), o.forEach((u) => u()), o.clear(), l = !0) : !s && !l && (a = setTimeout(c, n));
865
+ a && clearTimeout(a), !s && !l && e() ? (n.trigger(t), o.forEach((u) => u()), o.clear(), l = !0) : !s && !l && (a = setTimeout(c, r));
851
866
  }
852
867
  function i() {
853
868
  s = !0, a && clearTimeout(a);
854
869
  }
855
870
  c();
856
- const f = (u, ...y) => {
857
- u(...y);
871
+ const f = (u, ..._) => {
872
+ u(..._);
858
873
  };
859
874
  return {
860
875
  on: (u) => {
@@ -862,22 +877,22 @@ function wr(e, t, n = 100) {
862
877
  return f(u, t), { off: () => {
863
878
  } };
864
879
  {
865
- const y = r.on(u);
866
- return o.add(y.off), r.on(u);
880
+ const _ = n.on(u);
881
+ return o.add(_.off), n.on(u);
867
882
  }
868
883
  },
869
- off: r.off,
870
- trigger: r.trigger,
871
- clear: r.clear,
884
+ off: n.off,
885
+ trigger: n.trigger,
886
+ clear: n.clear,
872
887
  cancel: i
873
888
  };
874
889
  }
875
890
  const ee = /* @__PURE__ */ new WeakMap();
876
- function yt(e) {
877
- if (e = e || me(), ee.has(e))
891
+ function bt(e) {
892
+ if (e = e || pe(), ee.has(e))
878
893
  return ee.get(e);
879
- const t = 100, n = Date.now(), l = wr(() => {
880
- if (Date.now() - n >= t)
894
+ const t = 100, r = Date.now(), l = Sn(() => {
895
+ if (Date.now() - r >= t)
881
896
  return !0;
882
897
  {
883
898
  const s = e.renderer.value, a = (s == null ? void 0 : s.domElement) || { width: 0, height: 0 };
@@ -886,52 +901,52 @@ function yt(e) {
886
901
  }, e);
887
902
  return ee.set(e, l), l;
888
903
  }
889
- function Qr(e) {
890
- const t = me();
904
+ function oo(e) {
905
+ const t = pe();
891
906
  if (t)
892
- return ee.has(t) ? ee.get(t).on(e) : yt(t).on(e);
907
+ return ee.has(t) ? ee.get(t).on(e) : bt(t).on(e);
893
908
  }
894
- function br({
909
+ function An({
895
910
  scene: e,
896
911
  canvas: t,
897
- windowSize: n,
898
- rendererOptions: r,
912
+ windowSize: r,
913
+ rendererOptions: n,
899
914
  emit: o
900
915
  }) {
901
- const l = $(e), s = vr(n, t), {
916
+ const l = H(e), s = Cn(r, t), {
902
917
  camera: a,
903
918
  cameras: c,
904
919
  registerCamera: i,
905
920
  deregisterCamera: f,
906
- setCameraActive: g
907
- } = ar({ sizes: s }), u = {
908
- mode: I(r.renderMode || "always"),
909
- priority: I(0),
910
- frames: I(0),
921
+ setCameraActive: v
922
+ } = mn({ sizes: s }), u = {
923
+ mode: $(n.renderMode || "always"),
924
+ priority: $(0),
925
+ frames: $(0),
911
926
  maxFrames: 60,
912
927
  canBeInvalidated: q(() => u.mode.value === "on-demand" && u.frames.value === 0)
913
928
  };
914
- function y(R = 1) {
915
- r.renderMode === "on-demand" && (u.frames.value = Math.min(u.maxFrames, u.frames.value + R));
929
+ function _(R = 1) {
930
+ n.renderMode === "on-demand" && (u.frames.value = Math.min(u.maxFrames, u.frames.value + R));
916
931
  }
917
- function p() {
918
- r.renderMode === "manual" && (u.frames.value = 1);
932
+ function d() {
933
+ n.renderMode === "manual" && (u.frames.value = 1);
919
934
  }
920
- const { renderer: _ } = gr(
935
+ const { renderer: y } = Pn(
921
936
  {
922
937
  canvas: t,
923
- options: r,
938
+ options: n,
924
939
  // TODO: replace contextParts with full ctx at https://github.com/Tresjs/tres/issues/516
925
- contextParts: { sizes: s, render: u, invalidate: y, advance: p }
940
+ contextParts: { sizes: s, render: u, invalidate: _, advance: d }
926
941
  }
927
- ), d = {
942
+ ), p = {
928
943
  sizes: s,
929
944
  scene: l,
930
945
  camera: a,
931
- cameras: we(c),
932
- renderer: _,
933
- raycaster: $(new zt()),
934
- controls: I(null),
946
+ cameras: _e(c),
947
+ renderer: y,
948
+ raycaster: H(new qt()),
949
+ controls: $(null),
935
950
  perf: {
936
951
  maxFrames: 160,
937
952
  fps: {
@@ -945,106 +960,106 @@ function br({
945
960
  }
946
961
  },
947
962
  render: u,
948
- advance: p,
963
+ advance: d,
949
964
  extend: Ee,
950
- invalidate: y,
965
+ invalidate: _,
951
966
  registerCamera: i,
952
- setCameraActive: g,
967
+ setCameraActive: v,
953
968
  deregisterCamera: f,
954
- loop: dr()
969
+ loop: _n()
955
970
  };
956
- le("useTres", d), d.scene.value.__tres = {
957
- root: d
958
- }, d.loop.register(() => {
959
- a.value && u.frames.value > 0 && (_.value.render(e, a.value), o("render", d.renderer.value)), u.priority.value = 0, u.mode.value === "always" ? u.frames.value = 1 : u.frames.value = Math.max(0, u.frames.value - 1);
971
+ ae("useTres", p), p.scene.value.__tres = {
972
+ root: p
973
+ }, p.loop.register(() => {
974
+ a.value && u.frames.value > 0 && (y.value.render(e, a.value), o("render", p.renderer.value)), u.priority.value = 0, u.mode.value === "always" ? u.frames.value = 1 : u.frames.value = Math.max(0, u.frames.value - 1);
960
975
  }, "render");
961
- const { on: v, cancel: P } = yt(d);
962
- d.loop.setReady(!1), d.loop.start(), v(() => {
963
- o("ready", d), d.loop.setReady(!0), _r(e, d, o);
976
+ const { on: h, cancel: P } = bt(p);
977
+ p.loop.setReady(!1), p.loop.start(), h(() => {
978
+ o("ready", p), p.loop.setReady(!0), Tn(e, p, o);
964
979
  }), K(() => {
965
- P(), d.loop.stop();
980
+ P(), p.loop.stop();
966
981
  });
967
- const C = 100, w = un({ every: C }), { isSupported: E, memory: S } = fn({ interval: C }), M = 160;
982
+ const C = 100, b = dr({ every: C }), { isSupported: E, memory: S } = mr({ interval: C }), M = 160;
968
983
  let x = performance.now();
969
984
  const m = ({ timestamp: R }) => {
970
- d.scene.value && (d.perf.memory.allocatedMem = ke(d.scene.value)), R - x >= C && (x = R, d.perf.fps.accumulator.push(w.value), d.perf.fps.accumulator.length > M && d.perf.fps.accumulator.shift(), d.perf.fps.value = w.value, E.value && S.value && (d.perf.memory.accumulator.push(S.value.usedJSHeapSize / 1024 / 1024), d.perf.memory.accumulator.length > M && d.perf.memory.accumulator.shift(), d.perf.memory.currentMem = d.perf.memory.accumulator.reduce((j, O) => j + O, 0) / d.perf.memory.accumulator.length));
985
+ p.scene.value && (p.perf.memory.allocatedMem = Le(p.scene.value)), R - x >= C && (x = R, p.perf.fps.accumulator.push(b.value), p.perf.fps.accumulator.length > M && p.perf.fps.accumulator.shift(), p.perf.fps.value = b.value, E.value && S.value && (p.perf.memory.accumulator.push(S.value.usedJSHeapSize / 1024 / 1024), p.perf.memory.accumulator.length > M && p.perf.memory.accumulator.shift(), p.perf.memory.currentMem = p.perf.memory.accumulator.reduce((B, O) => B + O, 0) / p.perf.memory.accumulator.length));
971
986
  };
972
- let b = 0;
973
- const k = 1, { pause: L } = ut(({ delta: R }) => {
974
- window.__TRES__DEVTOOLS__ && (m({ timestamp: performance.now() }), b += R, b >= k && (window.__TRES__DEVTOOLS__.cb(d), b = 0));
987
+ let w = 0;
988
+ const k = 1, { pause: L } = pt(({ delta: R }) => {
989
+ window.__TRES__DEVTOOLS__ && (m({ timestamp: performance.now() }), w += R, w >= k && (window.__TRES__DEVTOOLS__.cb(p), w = 0));
975
990
  }, { immediate: !0 });
976
991
  return K(() => {
977
992
  L();
978
- }), d;
993
+ }), p;
979
994
  }
980
- function me() {
981
- const e = St("useTres");
995
+ function pe() {
996
+ const e = kt("useTres");
982
997
  if (!e)
983
998
  throw new Error("useTresContext must be used together with useTresContextProvider");
984
999
  return e;
985
1000
  }
986
- const Xr = me;
987
- function Zr() {
1001
+ const so = pe;
1002
+ function io() {
988
1003
  const {
989
1004
  camera: e,
990
1005
  scene: t,
991
- renderer: n,
992
- loop: r,
1006
+ renderer: r,
1007
+ loop: n,
993
1008
  raycaster: o,
994
1009
  controls: l,
995
1010
  invalidate: s,
996
1011
  advance: a
997
- } = me();
998
- r.setContext({
1012
+ } = pe();
1013
+ n.setContext({
999
1014
  camera: e,
1000
1015
  scene: t,
1001
- renderer: n,
1016
+ renderer: r,
1002
1017
  raycaster: o,
1003
1018
  controls: l,
1004
1019
  invalidate: s,
1005
1020
  advance: a
1006
1021
  });
1007
- function c(g, u = 0) {
1008
- return r.register(g, "before", u);
1022
+ function c(v, u = 0) {
1023
+ return n.register(v, "before", u);
1009
1024
  }
1010
- function i(g) {
1011
- return r.register(g, "render");
1025
+ function i(v) {
1026
+ return n.register(v, "render");
1012
1027
  }
1013
- function f(g, u = 0) {
1014
- return r.register(g, "after", u);
1028
+ function f(v, u = 0) {
1029
+ return n.register(v, "after", u);
1015
1030
  }
1016
1031
  return {
1017
- pause: r.pause,
1018
- resume: r.resume,
1019
- pauseRender: r.pauseRender,
1020
- resumeRender: r.resumeRender,
1021
- isActive: r.isActive,
1032
+ pause: n.pause,
1033
+ resume: n.resume,
1034
+ pauseRender: n.pauseRender,
1035
+ resumeRender: n.resumeRender,
1036
+ isActive: n.isActive,
1022
1037
  onBeforeRender: c,
1023
1038
  render: i,
1024
1039
  onAfterRender: f
1025
1040
  };
1026
1041
  }
1027
- const _t = D(), wt = D(), Le = D(), te = new lt();
1028
- let ce = 0, ue = 0;
1029
- const { pause: Mr, resume: Je, isActive: Pr } = ut(
1042
+ const Mt = D(), Pt = D(), Re = D(), te = new ut();
1043
+ let le = 0, ce = 0;
1044
+ const { pause: xn, resume: Xe, isActive: kn } = pt(
1030
1045
  () => {
1031
- _t.trigger({ delta: ce, elapsed: ue, clock: te }), wt.trigger({ delta: ce, elapsed: ue, clock: te }), Le.trigger({ delta: ce, elapsed: ue, clock: te });
1046
+ Mt.trigger({ delta: le, elapsed: ce, clock: te }), Pt.trigger({ delta: le, elapsed: ce, clock: te }), Re.trigger({ delta: le, elapsed: ce, clock: te });
1032
1047
  },
1033
1048
  { immediate: !1 }
1034
1049
  );
1035
- Le.on(() => {
1036
- ce = te.getDelta(), ue = te.getElapsedTime();
1050
+ Re.on(() => {
1051
+ le = te.getDelta(), ce = te.getElapsedTime();
1037
1052
  });
1038
- let Qe = !1;
1039
- const eo = () => (Qe || (Qe = !0, Je()), {
1040
- onBeforeLoop: _t.on,
1041
- onLoop: wt.on,
1042
- onAfterLoop: Le.on,
1043
- pause: Mr,
1044
- resume: Je,
1045
- isActive: Pr
1053
+ let Ze = !1;
1054
+ const ao = () => (Ze || (Ze = !0, Xe()), {
1055
+ onBeforeLoop: Mt.on,
1056
+ onLoop: Pt.on,
1057
+ onAfterLoop: Re.on,
1058
+ pause: xn,
1059
+ resume: Xe,
1060
+ isActive: kn
1046
1061
  });
1047
- function to() {
1062
+ function lo() {
1048
1063
  const { logWarning: e } = Q();
1049
1064
  function t(l, s, a) {
1050
1065
  let c = null;
@@ -1052,46 +1067,45 @@ function to() {
1052
1067
  i[s] === a && (c = i);
1053
1068
  }), c || e(`Child with ${s} '${a}' not found.`), c;
1054
1069
  }
1055
- function n(l, s, a) {
1070
+ function r(l, s, a) {
1056
1071
  const c = [];
1057
1072
  return l.traverse((i) => {
1058
1073
  i[s].includes(a) && c.push(i);
1059
1074
  }), c.length || e(`Children with ${s} '${a}' not found.`), c;
1060
1075
  }
1061
- function r(l, s) {
1076
+ function n(l, s) {
1062
1077
  return t(l, "name", s);
1063
1078
  }
1064
1079
  function o(l, s) {
1065
- return n(l, "name", s);
1080
+ return r(l, "name", s);
1066
1081
  }
1067
1082
  return {
1068
1083
  seek: t,
1069
- seekByName: r,
1070
- seekAll: n,
1084
+ seekByName: n,
1085
+ seekAll: r,
1071
1086
  seekAllByName: o
1072
1087
  };
1073
1088
  }
1074
- function Cr(e, t = {}, n = {}) {
1075
- let r = e;
1089
+ function Ln(e, t = {}, r = {}) {
1090
+ let n = e;
1076
1091
  const o = (a) => {
1077
- r = a;
1092
+ n = a;
1078
1093
  };
1079
1094
  let l = new Proxy({}, {});
1080
1095
  const s = {
1081
1096
  has(a, c) {
1082
- return c in t || c in r;
1097
+ return c in t || c in n;
1083
1098
  },
1084
1099
  get(a, c, i) {
1085
- return c in t ? t[c](r) : r[c];
1100
+ return c in t ? t[c](n) : n[c];
1086
1101
  },
1087
1102
  set(a, c, i) {
1088
- const f = n[c];
1089
- return f && typeof f == "function" ? f(i, r, l, o) : r[c] = i, !0;
1103
+ return r[c] ? r[c](i, n, l, o) : n[c] = i, !0;
1090
1104
  }
1091
1105
  };
1092
1106
  return l = new Proxy({}, s), l;
1093
1107
  }
1094
- const { logError: Xe } = Q(), Ze = [
1108
+ const { logError: et } = Q(), tt = [
1095
1109
  "onClick",
1096
1110
  "onContextMenu",
1097
1111
  "onPointerMove",
@@ -1106,68 +1120,68 @@ const { logError: Xe } = Q(), Ze = [
1106
1120
  "onPointerMissed",
1107
1121
  "onLostPointerCapture",
1108
1122
  "onWheel"
1109
- ], Er = (e) => {
1123
+ ], Rn = (e) => {
1110
1124
  const t = e.scene.value;
1111
- function n(i, f, g, u) {
1112
- if (u || (u = {}), u.args || (u.args = []), i === "template" || zn(i))
1125
+ function r(i, f, v, u) {
1126
+ if (u || (u = {}), u.args || (u.args = []), i === "template" || Jr(i))
1113
1127
  return null;
1114
- let y = i.replace("Tres", ""), p;
1128
+ let _ = i.replace("Tres", ""), d;
1115
1129
  if (i === "primitive") {
1116
- (!H(u.object) || At(u.object)) && Xe(
1130
+ (!j(u.object) || Lt(u.object)) && et(
1117
1131
  "Tres primitives need an 'object' prop, whose value is an object or shallowRef<object>"
1118
- ), y = u.object.type;
1119
- const _ = {};
1120
- p = Cr(
1132
+ ), _ = u.object.type;
1133
+ const y = {};
1134
+ d = Ln(
1121
1135
  u.object,
1122
1136
  {
1123
- object: (v) => v,
1137
+ object: (h) => h,
1124
1138
  isPrimitive: () => !0,
1125
- __tres: () => _
1139
+ __tres: () => y
1126
1140
  },
1127
1141
  {
1128
- object: (v, P, C, w) => {
1129
- sr(v, C, w, { patchProp: l, remove: o, insert: r }, e);
1142
+ object: (h, P, C, b) => {
1143
+ pn(h, C, b, { patchProp: l, remove: o, insert: n }, e);
1130
1144
  },
1131
- __tres: (v) => {
1132
- Object.assign(_, v);
1145
+ __tres: (h) => {
1146
+ Object.assign(y, h);
1133
1147
  }
1134
1148
  }
1135
1149
  );
1136
1150
  } else {
1137
- const _ = Ce.value[y];
1138
- _ || Xe(
1139
- `${y} is not defined on the THREE namespace. Use extend to add it to the catalog.`
1140
- ), p = new _(...u.args);
1151
+ const y = Ce.value[_];
1152
+ y || et(
1153
+ `${_} is not defined on the THREE namespace. Use extend to add it to the catalog.`
1154
+ ), d = new y(...u.args);
1141
1155
  }
1142
- return p ? (p.isCamera && (u != null && u.position || p.position.set(3, 3, 3), u != null && u.lookAt || p.lookAt(0, 0, 0)), p = z(p, {
1143
- ...p.__tres,
1144
- type: y,
1156
+ return d ? (d.isCamera && (u != null && u.position || d.position.set(3, 3, 3), u != null && u.lookAt || d.lookAt(0, 0, 0)), d = z(d, {
1157
+ ...d.__tres,
1158
+ type: _,
1145
1159
  memoizedProps: u,
1146
1160
  eventCount: 0,
1147
1161
  primitive: i === "primitive",
1148
1162
  attach: u.attach
1149
- }, e), p) : null;
1163
+ }, e), d) : null;
1150
1164
  }
1151
- function r(i, f) {
1152
- var y, p, _;
1165
+ function n(i, f) {
1166
+ var _, d, y;
1153
1167
  if (!i)
1154
1168
  return;
1155
1169
  f = f || t;
1156
- const g = i.__tres ? i : z(i, {}, e), u = f.__tres ? f : z(f, {}, e);
1157
- i = J(g), f = J(u), i.__tres && ((y = i.__tres) == null ? void 0 : y.eventCount) > 0 && ((p = e.eventManager) == null || p.registerObject(i)), e.registerCamera(i), (_ = e.eventManager) == null || _.registerPointerMissedObject(i), g.__tres.attach ? nr(u, g, g.__tres.attach) : N(i) && N(u) && (u.add(i), i.dispatchEvent({ type: "added" })), g.__tres.parent = u, u.__tres.objects && !u.__tres.objects.includes(g) && u.__tres.objects.push(g);
1170
+ const v = i.__tres ? i : z(i, {}, e), u = f.__tres ? f : z(f, {}, e);
1171
+ i = J(v), f = J(u), i.__tres && ((_ = i.__tres) == null ? void 0 : _.eventCount) > 0 && ((d = e.eventManager) == null || d.registerObject(i)), e.registerCamera(i), (y = e.eventManager) == null || y.registerPointerMissedObject(i), v.__tres.attach ? cn(u, v, v.__tres.attach) : N(i) && N(u) && (u.add(i), i.dispatchEvent({ type: "added" })), v.__tres.parent = u, u.__tres.objects && !u.__tres.objects.includes(v) && u.__tres.objects.push(v);
1158
1172
  }
1159
1173
  function o(i, f) {
1160
- var p, _, d, v;
1174
+ var d, y, p, h;
1161
1175
  if (!i)
1162
1176
  return;
1163
- i != null && i.__tres && ((p = i.__tres) == null ? void 0 : p.eventCount) > 0 && ((_ = e.eventManager) == null || _.deregisterObject(i)), f = Me(f) ? "default" : f;
1164
- const g = (d = i.__tres) == null ? void 0 : d.dispose;
1165
- Me(g) || (g === null ? f = !1 : f = g);
1166
- const u = (v = i.__tres) == null ? void 0 : v.primitive, y = f === "default" ? !u : !!f;
1167
- if (i.__tres && "objects" in i.__tres && [...i.__tres.objects].forEach((P) => o(P, f)), y && i.children && [...i.children].forEach((P) => o(P, f)), gt(i, e), vt(i, e), y && !Fn(i)) {
1168
- if (G(f))
1177
+ i != null && i.__tres && ((d = i.__tres) == null ? void 0 : d.eventCount) > 0 && ((y = e.eventManager) == null || y.deregisterObject(i)), f = be(f) ? "default" : f;
1178
+ const v = (p = i.__tres) == null ? void 0 : p.dispose;
1179
+ be(v) || (v === null ? f = !1 : f = v);
1180
+ const u = (h = i.__tres) == null ? void 0 : h.primitive, _ = f === "default" ? !u : !!f;
1181
+ if (i.__tres && "objects" in i.__tres && [...i.__tres.objects].forEach((P) => o(P, f)), _ && i.children && [...i.children].forEach((P) => o(P, f)), _t(i, e), wt(i, e), _ && !Yr(i)) {
1182
+ if (Y(f))
1169
1183
  f(i);
1170
- else if (G(i.dispose))
1184
+ else if (Y(i.dispose))
1171
1185
  try {
1172
1186
  i.dispose();
1173
1187
  } catch {
@@ -1175,71 +1189,72 @@ const { logError: Xe } = Q(), Ze = [
1175
1189
  }
1176
1190
  "__tres" in i && delete i.__tres;
1177
1191
  }
1178
- function l(i, f, g, u) {
1192
+ function l(i, f, v, u) {
1179
1193
  var P, C;
1180
1194
  if (!i)
1181
1195
  return;
1182
- let y = i, p = f;
1196
+ let _ = i, d = f;
1183
1197
  if (i.__tres && (i.__tres.memoizedProps[f] = u), f === "attach") {
1184
- const w = ((P = i.__tres) == null ? void 0 : P.parent) || i.parent;
1185
- o(i), z(i, { attach: u }, e), w && r(i, w);
1198
+ const b = ((P = i.__tres) == null ? void 0 : P.parent) || i.parent;
1199
+ o(i), z(i, { attach: u }, e), b && n(i, b);
1186
1200
  return;
1187
1201
  }
1188
1202
  if (f === "dispose") {
1189
1203
  i.__tres || (i = z(i, {}, e)), i.__tres.dispose = u;
1190
1204
  return;
1191
1205
  }
1192
- if (N(i) && p === "blocks-pointer-events") {
1193
- u || u === "" ? i[p] = u : delete i[p];
1206
+ if (N(i) && d === "blocks-pointer-events") {
1207
+ u || u === "" ? i[d] = u : delete i[d];
1194
1208
  return;
1195
1209
  }
1196
- Ze.includes(f) && i.__tres && (i.__tres.eventCount += 1);
1197
- let _ = oe(p), d = y == null ? void 0 : y[_];
1198
- if (p === "args") {
1199
- const w = i, E = g ?? [], S = u ?? [], M = ((C = i.__tres) == null ? void 0 : C.type) || i.type;
1200
- M && E.length && !Kn(E, S) && (y = Object.assign(
1201
- w,
1210
+ tt.includes(f) && i.__tres && (i.__tres.eventCount += 1);
1211
+ let y = he(d), p = _ == null ? void 0 : _[y];
1212
+ if (d === "args") {
1213
+ const b = i, E = v ?? [], S = u ?? [], M = ((C = i.__tres) == null ? void 0 : C.type) || i.type;
1214
+ M && E.length && !tn(E, S) && (_ = Object.assign(
1215
+ b,
1202
1216
  new Ce.value[M](...u)
1203
1217
  ));
1204
1218
  return;
1205
1219
  }
1206
- if (y.type === "BufferGeometry") {
1207
- if (p === "args")
1220
+ if (_.type === "BufferGeometry") {
1221
+ if (d === "args")
1208
1222
  return;
1209
- y.setAttribute(
1210
- oe(p),
1211
- new Vt(...u)
1223
+ _.setAttribute(
1224
+ he(d),
1225
+ new Jt(...u)
1212
1226
  );
1213
1227
  return;
1214
1228
  }
1215
- if (p.includes("-") && d === void 0) {
1216
- const w = p.split("-");
1217
- d = w.reduce((E, S) => E[oe(S)], y), p = w.pop(), _ = p, d != null && d.set || (y = w.reduce((E, S) => E[oe(S)], y));
1229
+ if (d.includes("-") && p === void 0) {
1230
+ p = _;
1231
+ for (const b of d.split("-"))
1232
+ y = d = he(b), _ = p, p = p == null ? void 0 : p[d];
1218
1233
  }
1219
- let v = u;
1220
- if (v === "" && (v = !0), G(d)) {
1221
- Ze.includes(f) || (de(v) ? i[_](...v) : i[_](v)), _.startsWith("on") && G(v) && (y[_] = v);
1234
+ let h = u;
1235
+ if (h === "" && (h = !0), Y(p)) {
1236
+ tt.includes(f) || (ke(h) ? i[y](...h) : i[y](h)), y.startsWith("on") && Y(h) && (_[y] = h);
1222
1237
  return;
1223
1238
  }
1224
- !(d != null && d.set) && !G(d) ? y[_] = v : d.constructor === v.constructor && (d != null && d.copy) ? d == null || d.copy(v) : de(v) ? d.set(...v) : !d.isColor && d.setScalar ? d.setScalar(v) : d.set(v), ht(i);
1239
+ Ge(p) && Ge(h) ? p.mask = h.mask : mt(p) && Ur(h) ? p.set(h) : Fr(p) && Wr(h) && p.constructor === h.constructor ? p.copy(h) : Me(p) && Array.isArray(h) ? "fromArray" in p && typeof p.fromArray == "function" ? p.fromArray(h) : p.set(...h) : Me(p) && typeof h == "number" ? "setScalar" in p && typeof p.setScalar == "function" ? p.setScalar(h) : p.set(h) : _[y] = h, yt(i);
1225
1240
  }
1226
1241
  function s(i) {
1227
1242
  var f;
1228
1243
  return ((f = i == null ? void 0 : i.__tres) == null ? void 0 : f.parent) || null;
1229
1244
  }
1230
1245
  function a(i) {
1231
- const f = z(new Gt(), { type: "Comment" }, e);
1246
+ const f = z(new Kt(), { type: "Comment" }, e);
1232
1247
  return f.name = i, f;
1233
1248
  }
1234
1249
  function c(i) {
1235
- var y;
1236
- const f = s(i), g = ((y = f == null ? void 0 : f.__tres) == null ? void 0 : y.objects) || [], u = g.indexOf(i);
1237
- return u < 0 || u >= g.length - 1 ? null : g[u + 1];
1250
+ var _;
1251
+ const f = s(i), v = ((_ = f == null ? void 0 : f.__tres) == null ? void 0 : _.objects) || [], u = v.indexOf(i);
1252
+ return u < 0 || u >= v.length - 1 ? null : v[u + 1];
1238
1253
  }
1239
1254
  return {
1240
- insert: r,
1255
+ insert: n,
1241
1256
  remove: o,
1242
- createElement: n,
1257
+ createElement: r,
1243
1258
  patchProp: l,
1244
1259
  parentNode: s,
1245
1260
  createText: () => void 0,
@@ -1253,32 +1268,32 @@ const { logError: Xe } = Q(), Ze = [
1253
1268
  insertStaticContent: () => void 0
1254
1269
  };
1255
1270
  };
1256
- function Tr() {
1257
- return bt().__VUE_DEVTOOLS_GLOBAL_HOOK__;
1271
+ function On() {
1272
+ return Ct().__VUE_DEVTOOLS_GLOBAL_HOOK__;
1258
1273
  }
1259
- function bt() {
1274
+ function Ct() {
1260
1275
  return typeof navigator < "u" && typeof window < "u" ? window : typeof globalThis < "u" ? globalThis : {};
1261
1276
  }
1262
- const Sr = typeof Proxy == "function", Ar = "devtools-plugin:setup", xr = "plugin:settings:set";
1263
- let Y, Te;
1264
- function kr() {
1277
+ const Dn = typeof Proxy == "function", jn = "devtools-plugin:setup", Bn = "plugin:settings:set";
1278
+ let V, Te;
1279
+ function In() {
1265
1280
  var e;
1266
- return Y !== void 0 || (typeof window < "u" && window.performance ? (Y = !0, Te = window.performance) : typeof globalThis < "u" && (!((e = globalThis.perf_hooks) === null || e === void 0) && e.performance) ? (Y = !0, Te = globalThis.perf_hooks.performance) : Y = !1), Y;
1281
+ return V !== void 0 || (typeof window < "u" && window.performance ? (V = !0, Te = window.performance) : typeof globalThis < "u" && (!((e = globalThis.perf_hooks) === null || e === void 0) && e.performance) ? (V = !0, Te = globalThis.perf_hooks.performance) : V = !1), V;
1267
1282
  }
1268
- function Lr() {
1269
- return kr() ? Te.now() : Date.now();
1283
+ function $n() {
1284
+ return In() ? Te.now() : Date.now();
1270
1285
  }
1271
- class Rr {
1272
- constructor(t, n) {
1273
- this.target = null, this.targetQueue = [], this.onQueue = [], this.plugin = t, this.hook = n;
1274
- const r = {};
1286
+ class Hn {
1287
+ constructor(t, r) {
1288
+ this.target = null, this.targetQueue = [], this.onQueue = [], this.plugin = t, this.hook = r;
1289
+ const n = {};
1275
1290
  if (t.settings)
1276
1291
  for (const s in t.settings) {
1277
1292
  const a = t.settings[s];
1278
- r[s] = a.defaultValue;
1293
+ n[s] = a.defaultValue;
1279
1294
  }
1280
1295
  const o = `__vue-devtools-plugin-settings__${t.id}`;
1281
- let l = Object.assign({}, r);
1296
+ let l = Object.assign({}, n);
1282
1297
  try {
1283
1298
  const s = localStorage.getItem(o), a = JSON.parse(s);
1284
1299
  Object.assign(l, a);
@@ -1296,9 +1311,9 @@ class Rr {
1296
1311
  l = s;
1297
1312
  },
1298
1313
  now() {
1299
- return Lr();
1314
+ return $n();
1300
1315
  }
1301
- }, n && n.on(xr, (s, a) => {
1316
+ }, r && r.on(Bn, (s, a) => {
1302
1317
  s === this.plugin.id && this.fallbacks.setSettings(a);
1303
1318
  }), this.proxiedOn = new Proxy({}, {
1304
1319
  get: (s, a) => this.target ? this.target.on[a] : (...c) => {
@@ -1324,33 +1339,33 @@ class Rr {
1324
1339
  }
1325
1340
  async setRealTarget(t) {
1326
1341
  this.target = t;
1327
- for (const n of this.onQueue)
1328
- this.target.on[n.method](...n.args);
1329
- for (const n of this.targetQueue)
1330
- n.resolve(await this.target[n.method](...n.args));
1342
+ for (const r of this.onQueue)
1343
+ this.target.on[r.method](...r.args);
1344
+ for (const r of this.targetQueue)
1345
+ r.resolve(await this.target[r.method](...r.args));
1331
1346
  }
1332
1347
  }
1333
- function Or(e, t) {
1334
- const n = e, r = bt(), o = Tr(), l = Sr && n.enableEarlyProxy;
1335
- if (o && (r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !l))
1336
- o.emit(Ar, e, t);
1348
+ function Un(e, t) {
1349
+ const r = e, n = Ct(), o = On(), l = Dn && r.enableEarlyProxy;
1350
+ if (o && (n.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !l))
1351
+ o.emit(jn, e, t);
1337
1352
  else {
1338
- const s = l ? new Rr(n, o) : null;
1339
- (r.__VUE_DEVTOOLS_PLUGINS__ = r.__VUE_DEVTOOLS_PLUGINS__ || []).push({
1340
- pluginDescriptor: n,
1353
+ const s = l ? new Hn(r, o) : null;
1354
+ (n.__VUE_DEVTOOLS_PLUGINS__ = n.__VUE_DEVTOOLS_PLUGINS__ || []).push({
1355
+ pluginDescriptor: r,
1341
1356
  setupFn: t,
1342
1357
  proxy: s
1343
1358
  }), s && t(s.proxiedTarget);
1344
1359
  }
1345
1360
  }
1346
- function Dr(e, t) {
1347
- const n = `▲ ■ ●${e}`;
1348
- typeof et == "function" ? et(n, t) : console.log(n);
1361
+ function Fn(e, t) {
1362
+ const r = `▲ ■ ●${e}`;
1363
+ typeof rt == "function" ? rt(r, t) : console.log(r);
1349
1364
  }
1350
- function et(e, t) {
1365
+ function rt(e, t) {
1351
1366
  throw new Error(e + t);
1352
1367
  }
1353
- const Mt = (e) => {
1368
+ const Et = (e) => {
1354
1369
  const t = {
1355
1370
  id: e.uuid,
1356
1371
  label: e.type,
@@ -1362,13 +1377,13 @@ const Mt = (e) => {
1362
1377
  textColor: 5750629,
1363
1378
  backgroundColor: 15793395
1364
1379
  });
1365
- const n = ke(e);
1366
- return n > 0 && t.tags.push({
1367
- label: `${pr(n)} KB`,
1380
+ const r = Le(e);
1381
+ return r > 0 && t.tags.push({
1382
+ label: `${wn(r)} KB`,
1368
1383
  textColor: 15707189,
1369
1384
  backgroundColor: 16775644,
1370
1385
  tooltip: "Memory usage"
1371
- }), e.type.includes("Light") && (Hn(e) && t.tags.push({
1386
+ }), e.type.includes("Light") && (Gr(e) && t.tags.push({
1372
1387
  label: `${e.intensity}`,
1373
1388
  textColor: 9738662,
1374
1389
  backgroundColor: 16316922,
@@ -1390,56 +1405,56 @@ const Mt = (e) => {
1390
1405
  tooltip: "Position"
1391
1406
  })), t;
1392
1407
  };
1393
- function Pt(e, t, n = "") {
1394
- e.children.forEach((r) => {
1395
- if (r.type === "HightlightMesh" || n && !r.type.includes(n) && !r.name.includes(n))
1408
+ function Tt(e, t, r = "") {
1409
+ e.children.forEach((n) => {
1410
+ if (n.type === "HightlightMesh" || r && !n.type.includes(r) && !n.name.includes(r))
1396
1411
  return;
1397
- const o = Mt(r);
1398
- t.children.push(o), Pt(r, o, n);
1412
+ const o = Et(n);
1413
+ t.children.push(o), Tt(n, o, r);
1399
1414
  });
1400
1415
  }
1401
- const jr = [], X = "tres:inspector", Br = Se({
1416
+ const Wn = [], X = "tres:inspector", Nn = Se({
1402
1417
  sceneGraph: null
1403
1418
  });
1404
- function Ir(e, t) {
1405
- Or(
1419
+ function zn(e, t) {
1420
+ Un(
1406
1421
  {
1407
1422
  id: "dev.esm.tres",
1408
1423
  label: "TresJS 🪐",
1409
1424
  logo: "https://raw.githubusercontent.com/Tresjs/tres/main/public/favicon.svg",
1410
1425
  packageName: "tresjs",
1411
1426
  homepage: "https://tresjs.org",
1412
- componentStateTypes: jr,
1427
+ componentStateTypes: Wn,
1413
1428
  app: e
1414
1429
  },
1415
- (n) => {
1416
- typeof n.now != "function" && Dr(
1430
+ (r) => {
1431
+ typeof r.now != "function" && Fn(
1417
1432
  "You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."
1418
- ), n.addInspector({
1433
+ ), r.addInspector({
1419
1434
  id: X,
1420
1435
  label: "TresJS 🪐",
1421
1436
  icon: "account_tree",
1422
1437
  treeFilterPlaceholder: "Search instances"
1423
1438
  }), setInterval(() => {
1424
- n.sendInspectorTree(X);
1439
+ r.sendInspectorTree(X);
1425
1440
  }, 1e3), setInterval(() => {
1426
- n.notifyComponentUpdate();
1427
- }, 5e3), n.on.getInspectorTree((l) => {
1441
+ r.notifyComponentUpdate();
1442
+ }, 5e3), r.on.getInspectorTree((l) => {
1428
1443
  if (l.inspectorId === X) {
1429
- const s = Mt(t.scene.value);
1430
- Pt(t.scene.value, s, l.filter), Br.sceneGraph = s, l.rootNodes = [s];
1444
+ const s = Et(t.scene.value);
1445
+ Tt(t.scene.value, s, l.filter), Nn.sceneGraph = s, l.rootNodes = [s];
1431
1446
  }
1432
1447
  });
1433
- let r = null, o = null;
1434
- n.on.getInspectorState((l) => {
1448
+ let n = null, o = null;
1449
+ r.on.getInspectorState((l) => {
1435
1450
  var s;
1436
1451
  if (l.inspectorId === X) {
1437
1452
  const [a] = t.scene.value.getObjectsByProperty("uuid", l.nodeId);
1438
1453
  if (!a)
1439
1454
  return;
1440
- if (o && r && r.parent && o.remove(r), a.isMesh) {
1441
- const c = Xn(a);
1442
- a.add(c), r = c, o = a;
1455
+ if (o && n && n.parent && o.remove(n), a.isMesh) {
1456
+ const c = on(a);
1457
+ a.add(c), n = c, o = a;
1443
1458
  }
1444
1459
  l.state = {
1445
1460
  object: Object.entries(a).map(([c, i]) => c === "children" ? { key: c, value: i.filter((f) => f.type !== "HightlightMesh") } : { key: c, value: i, editable: !0 }).filter(({ key: c }) => c !== "parent")
@@ -1450,7 +1465,7 @@ function Ir(e, t) {
1450
1465
  key: "Scene Info",
1451
1466
  value: {
1452
1467
  objects: a.children.length,
1453
- memory: ke(a),
1468
+ memory: Le(a),
1454
1469
  calls: t.renderer.value.info.render.calls,
1455
1470
  triangles: t.renderer.value.info.render.triangles,
1456
1471
  points: t.renderer.value.info.render.points,
@@ -1467,13 +1482,13 @@ function Ir(e, t) {
1467
1482
  ]
1468
1483
  });
1469
1484
  }
1470
- }), n.on.editInspectorState((l) => {
1471
- l.inspectorId === X && Qn(t.scene.value, l.nodeId, l.path, l.state.value);
1485
+ }), r.on.editInspectorState((l) => {
1486
+ l.inspectorId === X && nn(t.scene.value, l.nodeId, l.path, l.state.value);
1472
1487
  });
1473
1488
  }
1474
1489
  );
1475
1490
  }
1476
- const $r = ["data-scene", "data-tres"], Hr = /* @__PURE__ */ fe({
1491
+ const Gn = ["data-scene", "data-tres"], Vn = /* @__PURE__ */ ue({
1477
1492
  __name: "TresCanvas",
1478
1493
  props: {
1479
1494
  shadows: { type: Boolean, default: void 0 },
@@ -1518,135 +1533,135 @@ const $r = ["data-scene", "data-tres"], Hr = /* @__PURE__ */ fe({
1518
1533
  "wheel",
1519
1534
  "ready"
1520
1535
  ],
1521
- setup(e, { expose: t, emit: n }) {
1522
- const r = e, o = n, l = xt(), s = I(), a = $(new st()), c = He();
1523
- Ee(ot);
1524
- const i = (p, _ = !1) => fe({
1536
+ setup(e, { expose: t, emit: r }) {
1537
+ const n = e, o = r, l = Rt(), s = $(), a = H(new at()), c = Ue();
1538
+ Ee(it);
1539
+ const i = (d, y = !1) => ue({
1525
1540
  setup() {
1526
1541
  var C;
1527
- const d = (C = He()) == null ? void 0 : C.appContext;
1528
- d && (d.app = c == null ? void 0 : c.appContext.app);
1529
- const v = {};
1530
- function P(w) {
1531
- w && (w.parent && P(w.parent), w.provides && Object.assign(v, w.provides));
1542
+ const p = (C = Ue()) == null ? void 0 : C.appContext;
1543
+ p && (p.app = c == null ? void 0 : c.appContext.app);
1544
+ const h = {};
1545
+ function P(b) {
1546
+ b && (b.parent && P(b.parent), b.provides && Object.assign(h, b.provides));
1532
1547
  }
1533
- return c != null && c.parent && r.enableProvideBridge && (P(c.parent), Reflect.ownKeys(v).forEach((w) => {
1534
- le(w, v[w]);
1535
- })), le("useTres", p), le("extend", Ee), typeof window < "u" && Ir(d == null ? void 0 : d.app, p), () => Ue(Bt, null, _ ? [] : l.default());
1548
+ return c != null && c.parent && n.enableProvideBridge && (P(c.parent), Reflect.ownKeys(h).forEach((b) => {
1549
+ ae(b, h[b]);
1550
+ })), ae("useTres", d), ae("extend", Ee), typeof window < "u" && zn(p == null ? void 0 : p.app, d), () => Fe(Ht, null, y ? [] : l.default());
1536
1551
  }
1537
- }), f = (p, _ = !1) => {
1538
- const d = i(p, _), { render: v } = jt(Er(p));
1539
- v(Ue(d), a.value);
1540
- }, g = (p, _ = !1) => {
1541
- mt(p.scene.value), _ && (p.renderer.value.dispose(), p.renderer.value.renderLists.dispose(), p.renderer.value.forceContextLoss()), a.value.__tres = {
1542
- root: p
1552
+ }), f = (d, y = !1) => {
1553
+ const p = i(d, y), { render: h } = $t(Rn(d));
1554
+ h(Fe(p), a.value);
1555
+ }, v = (d, y = !1) => {
1556
+ vt(d.scene.value), y && (d.renderer.value.dispose(), d.renderer.value.renderLists.dispose(), d.renderer.value.forceContextLoss()), a.value.__tres = {
1557
+ root: d
1543
1558
  };
1544
- }, u = $(null);
1545
- t({ context: u, dispose: () => g(u.value, !0) });
1546
- const y = () => {
1547
- g(u.value), f(u.value, !0);
1559
+ }, u = H(null);
1560
+ t({ context: u, dispose: () => v(u.value, !0) });
1561
+ const _ = () => {
1562
+ v(u.value), f(u.value, !0);
1548
1563
  };
1549
- return kt(() => {
1550
- const p = s;
1551
- u.value = br({
1564
+ return Ot(() => {
1565
+ const d = s;
1566
+ u.value = An({
1552
1567
  scene: a.value,
1553
- canvas: p,
1554
- windowSize: r.windowSize ?? !1,
1555
- rendererOptions: r,
1568
+ canvas: d,
1569
+ windowSize: n.windowSize ?? !1,
1570
+ rendererOptions: n,
1556
1571
  emit: o
1557
1572
  });
1558
- const { registerCamera: _, camera: d, cameras: v, deregisterCamera: P } = u.value;
1573
+ const { registerCamera: y, camera: p, cameras: h, deregisterCamera: P } = u.value;
1559
1574
  f(u.value);
1560
1575
  const C = () => {
1561
- const w = new be(
1576
+ const b = new we(
1562
1577
  45,
1563
1578
  window.innerWidth / window.innerHeight,
1564
1579
  0.1,
1565
1580
  1e3
1566
1581
  );
1567
- w.position.set(3, 3, 3), w.lookAt(0, 0, 0), _(w);
1582
+ b.position.set(3, 3, 3), b.lookAt(0, 0, 0), y(b);
1568
1583
  const E = Ae(() => {
1569
- v.value.length >= 2 && (w.removeFromParent(), P(w), E == null || E());
1584
+ h.value.length >= 2 && (b.removeFromParent(), P(b), E == null || E());
1570
1585
  });
1571
1586
  };
1572
- ae(
1573
- () => r.camera,
1574
- (w, E) => {
1575
- w && _(w), E && (E.removeFromParent(), P(E));
1587
+ ie(
1588
+ () => n.camera,
1589
+ (b, E) => {
1590
+ b && y(b), E && (E.removeFromParent(), P(E));
1576
1591
  },
1577
1592
  {
1578
1593
  immediate: !0
1579
1594
  }
1580
- ), d.value || C();
1581
- }), K(y), (p, _) => (Rt(), Lt("canvas", {
1595
+ ), p.value || C();
1596
+ }), K(_), (d, y) => (jt(), Dt("canvas", {
1582
1597
  ref_key: "canvas",
1583
1598
  ref: s,
1584
1599
  "data-scene": a.value.uuid,
1585
- class: Dt(p.$attrs.class),
1586
- "data-tres": `tresjs ${W(Rn).version}`,
1587
- style: Ot({
1600
+ class: It(d.$attrs.class),
1601
+ "data-tres": `tresjs ${W(jr).version}`,
1602
+ style: Bt({
1588
1603
  display: "block",
1589
1604
  width: "100%",
1590
1605
  height: "100%",
1591
- position: p.windowSize ? "fixed" : "relative",
1606
+ position: d.windowSize ? "fixed" : "relative",
1592
1607
  top: 0,
1593
1608
  left: 0,
1594
1609
  pointerEvents: "auto",
1595
1610
  touchAction: "none",
1596
- ...p.$attrs.style
1611
+ ...d.$attrs.style
1597
1612
  })
1598
- }, null, 14, $r));
1613
+ }, null, 14, Gn));
1599
1614
  }
1600
- }), Ur = [
1615
+ }), Yn = [
1601
1616
  "TresCanvas",
1602
1617
  "TresLeches",
1603
1618
  "TresScene"
1604
- ], no = {
1619
+ ], co = {
1605
1620
  template: {
1606
1621
  compilerOptions: {
1607
- isCustomElement: (e) => e.startsWith("Tres") && !Ur.includes(e) || e === "primitive"
1622
+ isCustomElement: (e) => e.startsWith("Tres") && !Yn.includes(e) || e === "primitive"
1608
1623
  }
1609
1624
  }
1610
- }, { logWarning: Fr } = Q();
1611
- let B = null;
1612
- const ro = {
1625
+ }, { logWarning: qn } = Q();
1626
+ let I = null;
1627
+ const uo = {
1613
1628
  updated: (e, t) => {
1614
1629
  var o;
1615
- const n = Zn(t);
1616
- if (!n) {
1617
- Fr(`v-distance-to: problem with binding value: ${t.value}`);
1630
+ const r = sn(t);
1631
+ if (!r) {
1632
+ qn(`v-distance-to: problem with binding value: ${t.value}`);
1618
1633
  return;
1619
1634
  }
1620
- B && (B.dispose(), e.parent.remove(B));
1621
- const r = n.clone().sub(e.position);
1622
- r.normalize(), B = new Yt(r, e.position, e.position.distanceTo(n), 16776960), e.parent.add(B), console.table(
1635
+ I && (I.dispose(), e.parent.remove(I));
1636
+ const n = r.clone().sub(e.position);
1637
+ n.normalize(), I = new Qt(n, e.position, e.position.distanceTo(r), 16776960), e.parent.add(I), console.table(
1623
1638
  [
1624
- ["Distance:", e.position.distanceTo(n)],
1639
+ ["Distance:", e.position.distanceTo(r)],
1625
1640
  [`origin: ${e.name || e.type}`, `x:${e.position.x}, y:${e.position.y}, z:${(o = e.position) == null ? void 0 : o.z}`],
1626
- [`Destiny: ${e.name || e.type}`, `x:${n.x}, y:${n.y}, z:${n == null ? void 0 : n.z}`]
1641
+ [`Destiny: ${e.name || e.type}`, `x:${r.x}, y:${r.y}, z:${r == null ? void 0 : r.z}`]
1627
1642
  ]
1628
1643
  );
1629
1644
  },
1630
1645
  unmounted: (e) => {
1631
- B == null || B.dispose(), e.parent && e.parent.remove(B);
1646
+ I == null || I.dispose(), e.parent && e.parent.remove(I);
1632
1647
  }
1633
1648
  };
1634
- class Ct extends qt {
1635
- constructor(t, n) {
1636
- const r = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, -1, 0, 1, 1, 0], o = new Fe();
1637
- o.setAttribute("position", new We(r, 3)), o.computeBoundingSphere();
1638
- const l = new Kt({ fog: !1 });
1639
- super(o, l), this.light = t, this.color = n, this.type = "RectAreaLightHelper";
1640
- const s = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, -1, 0], a = new Fe();
1641
- a.setAttribute("position", new We(s, 3)), a.computeBoundingSphere(), this.add(new Jt(a, new at({ side: Qt, fog: !1 })));
1649
+ class St extends Xt {
1650
+ constructor(t, r) {
1651
+ const n = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, -1, 0, 1, 1, 0], o = new We();
1652
+ o.setAttribute("position", new Ne(n, 3)), o.computeBoundingSphere();
1653
+ const l = new Zt({ fog: !1 });
1654
+ super(o, l), this.light = t, this.color = r, this.type = "RectAreaLightHelper";
1655
+ const s = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, -1, 0], a = new We();
1656
+ a.setAttribute("position", new Ne(s, 3)), a.computeBoundingSphere(), this.add(new er(a, new ct({ side: tr, fog: !1 })));
1642
1657
  }
1643
1658
  updateMatrixWorld() {
1644
1659
  if (this.scale.set(0.5 * this.light.width, 0.5 * this.light.height, 1), this.color !== void 0)
1645
1660
  this.material.color.set(this.color), this.children[0].material.color.set(this.color);
1646
1661
  else {
1647
1662
  this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);
1648
- const t = this.material.color, n = Math.max(t.r, t.g, t.b);
1649
- n > 1 && t.multiplyScalar(1 / n), this.children[0].material.color.copy(this.material.color);
1663
+ const t = this.material.color, r = Math.max(t.r, t.g, t.b);
1664
+ r > 1 && t.multiplyScalar(1 / r), this.children[0].material.color.copy(this.material.color);
1650
1665
  }
1651
1666
  this.matrixWorld.extractRotation(this.light.matrixWorld).scale(this.scale).copyPosition(this.light.matrixWorld), this.children[0].matrixWorld.copy(this.matrixWorld);
1652
1667
  }
@@ -1654,33 +1669,33 @@ class Ct extends qt {
1654
1669
  this.geometry.dispose(), this.material.dispose(), this.children[0].geometry.dispose(), this.children[0].material.dispose();
1655
1670
  }
1656
1671
  }
1657
- const { logWarning: tt } = Q();
1658
- let ie, F;
1659
- const Wr = {
1660
- DirectionalLight: tn,
1661
- PointLight: en,
1662
- SpotLight: Zt,
1663
- HemisphereLight: Xt,
1664
- RectAreaLight: Ct
1665
- }, oo = {
1672
+ const { logWarning: nt } = Q();
1673
+ let se, F;
1674
+ const Kn = {
1675
+ DirectionalLight: sr,
1676
+ PointLight: or,
1677
+ SpotLight: nr,
1678
+ HemisphereLight: rr,
1679
+ RectAreaLight: St
1680
+ }, fo = {
1666
1681
  mounted: (e) => {
1667
1682
  if (!e.isLight) {
1668
- tt(`${e.type} is not a light`);
1683
+ nt(`${e.type} is not a light`);
1669
1684
  return;
1670
1685
  }
1671
- ie = Wr[e.type], e.parent.add(new ie(e, 1, e.color.getHex()));
1686
+ se = Kn[e.type], e.parent.add(new se(e, 1, e.color.getHex()));
1672
1687
  },
1673
1688
  updated: (e) => {
1674
- F = e.parent.children.find((t) => t instanceof ie), !(F instanceof Ct) && F.update();
1689
+ F = e.parent.children.find((t) => t instanceof se), !(F instanceof St) && F.update();
1675
1690
  },
1676
1691
  unmounted: (e) => {
1677
1692
  if (!e.isLight) {
1678
- tt(`${e.type} is not a light`);
1693
+ nt(`${e.type} is not a light`);
1679
1694
  return;
1680
1695
  }
1681
- F = e.parent.children.find((t) => t instanceof ie), F && F.dispose && F.dispose(), e.parent && e.parent.remove(F);
1696
+ F = e.parent.children.find((t) => t instanceof se), F && F.dispose && F.dispose(), e.parent && e.parent.remove(F);
1682
1697
  }
1683
- }, so = {
1698
+ }, po = {
1684
1699
  mounted: (e, t) => {
1685
1700
  if (t.arg) {
1686
1701
  console.log(`v-log:${t.arg}`, e[t.arg]);
@@ -1688,40 +1703,40 @@ const Wr = {
1688
1703
  }
1689
1704
  console.log("v-log", e);
1690
1705
  }
1691
- }, io = {
1706
+ }, mo = {
1692
1707
  install(e) {
1693
- e.component("TresCanvas", Hr);
1708
+ e.component("TresCanvas", Vn);
1694
1709
  }
1695
1710
  };
1696
1711
  export {
1697
- Hr as TresCanvas,
1698
- Yr as UseLoader,
1699
- qr as UseTexture,
1712
+ Vn as TresCanvas,
1713
+ eo as UseLoader,
1714
+ to as UseTexture,
1700
1715
  Ce as catalogue,
1701
- dr as createRenderLoop,
1702
- io as default,
1703
- mt as dispose,
1716
+ _n as createRenderLoop,
1717
+ mo as default,
1718
+ vt as dispose,
1704
1719
  Ee as extend,
1705
- Kr as isProd,
1706
- hr as normalizeColor,
1707
- Jr as normalizeVectorFlexibleParam,
1708
- Qr as onTresReady,
1709
- no as templateCompilerOptions,
1710
- On as traverseObjects,
1711
- ar as useCamera,
1712
- Dn as useLoader,
1720
+ ro as isProd,
1721
+ Mn as normalizeColor,
1722
+ no as normalizeVectorFlexibleParam,
1723
+ oo as onTresReady,
1724
+ co as templateCompilerOptions,
1725
+ Br as traverseObjects,
1726
+ mn as useCamera,
1727
+ Ir as useLoader,
1713
1728
  Q as useLogger,
1714
- Zr as useLoop,
1715
- yr as useRaycaster,
1716
- eo as useRenderLoop,
1717
- gr as useRenderer,
1718
- to as useSeek,
1719
- ir as useTexture,
1720
- Xr as useTres,
1721
- me as useTresContext,
1722
- br as useTresContextProvider,
1723
- _r as useTresEventManager,
1724
- ro as vDistanceTo,
1725
- oo as vLightHelper,
1726
- so as vLog
1729
+ io as useLoop,
1730
+ En as useRaycaster,
1731
+ ao as useRenderLoop,
1732
+ Pn as useRenderer,
1733
+ lo as useSeek,
1734
+ dn as useTexture,
1735
+ so as useTres,
1736
+ pe as useTresContext,
1737
+ An as useTresContextProvider,
1738
+ Tn as useTresEventManager,
1739
+ uo as vDistanceTo,
1740
+ fo as vLightHelper,
1741
+ po as vLog
1727
1742
  };