@tresjs/core 3.0.1 → 3.1.0-next.0

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,475 +1,504 @@
1
1
  /**
2
2
  * name: @tresjs/core
3
- * version: v3.0.1
3
+ * version: v3.1.0-next.0
4
4
  * (c) 2023
5
5
  * description: Declarative ThreeJS using Vue Components
6
6
  * author: Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)
7
7
  */
8
- import { ref as H, computed as _, watchEffect as b, onUnmounted as j, shallowRef as z, watch as K, reactive as re, readonly as ne, provide as ae, inject as oe, createRenderer as se, defineComponent as ie, useSlots as ue, onMounted as le, openBlock as ce, createElementBlock as fe, normalizeStyle as me } from "vue";
9
- import * as pe from "three";
10
- import { PerspectiveCamera as W, OrthographicCamera as ve, Camera as de, Clock as ge, SRGBColorSpace as we, ACESFilmicToneMapping as ye, PCFSoftShadowMap as Ce, Vector3 as Pe, Color as O, WebGLRenderer as V, LoadingManager as Me, TextureLoader as _e, Vector2 as Ee, Raycaster as xe, BufferAttribute as Le, Scene as Te } from "three";
11
- import { createEventHook as A, useRafFn as be, toValue as y, unrefElement as De, useDevicePixelRatio as Ae, usePointer as ke, useElementBounding as Se, useWindowSize as he, useElementSize as Be } from "@vueuse/core";
12
- const X = H({}), $ = (e) => void Object.assign(X.value, e), N = (e) => typeof e == "function", Y = (e) => !!e && e.constructor === Array, Oe = ({ sizes: e, scene: a }) => {
13
- const t = H([]), n = _(
14
- () => t.value[0]
15
- ), r = (o, s = !1) => {
16
- t.value.some(({ uuid: u }) => u === o.uuid) || (s ? l(o) : t.value.push(o));
17
- }, i = (o) => {
18
- t.value = t.value.filter(({ uuid: s }) => s !== o.uuid);
19
- }, l = (o) => {
20
- const s = o instanceof de ? o : t.value.find((c) => c.uuid === o);
21
- if (!s)
22
- return;
23
- const u = t.value.filter(({ uuid: c }) => c !== s.uuid);
24
- t.value = [s, ...u];
8
+ import { computed as M, ref as j, watchEffect as O, triggerRef as G, shallowRef as I, watch as V, onUnmounted as se, watchPostEffect as ie, reactive as ue, readonly as le, provide as Q, inject as ce, createRenderer as fe, defineComponent as q, useSlots as me, h as U, Fragment as pe, openBlock as ve, createElementBlock as de, normalizeStyle as ge } from "vue";
9
+ import * as ye from "three";
10
+ import { PerspectiveCamera as W, OrthographicCamera as we, Camera as Ce, Clock as Pe, SRGBColorSpace as Me, ACESFilmicToneMapping as _e, PCFSoftShadowMap as Ee, Vector3 as Le, Color as B, WebGLRenderer as z, LoadingManager as xe, TextureLoader as Ae, Vector2 as he, Raycaster as ke, BufferAttribute as be, Scene as Te } from "three";
11
+ import { createEventHook as k, useRafFn as De, toValue as g, unrefElement as Se, useDevicePixelRatio as Oe, usePointer as Be, useElementBounding as Re, useWindowSize as Fe, useElementSize as je } from "@vueuse/core";
12
+ const ze = ({ sizes: e, scene: n }) => {
13
+ var s, u;
14
+ const t = M(() => n.value.children.filter((l) => l.isCamera)), a = j(((u = (s = t.value) == null ? void 0 : s[0]) == null ? void 0 : u.uuid) ?? ""), r = M(
15
+ () => t.value.find((l) => l.uuid === a.value) ?? t.value.at(0)
16
+ ), i = (l, c = !1) => {
17
+ t.value.some(({ uuid: p }) => p === l.uuid) || (n.value.add(l), G(n), c && o(l));
18
+ }, f = (l) => {
19
+ n.value.remove(l), G(n);
20
+ }, o = (l) => {
21
+ const c = l instanceof Ce ? l.uuid : l;
22
+ c && (a.value = c);
25
23
  };
26
- return b(() => {
27
- e.aspectRatio.value && t.value.forEach((o) => {
28
- o instanceof W && (o.aspect = e.aspectRatio.value), (o instanceof W || o instanceof ve) && o.updateProjectionMatrix();
24
+ return O(() => {
25
+ e.aspectRatio.value && t.value.forEach((l) => {
26
+ l instanceof W && (l.aspect = e.aspectRatio.value), (l instanceof W || l instanceof we) && l.updateProjectionMatrix();
29
27
  });
30
- }), a.userData.tres__registerCamera = r, a.userData.tres__deregisterCamera = i, j(() => {
31
- t.value = [];
32
- }), {
33
- camera: n,
28
+ }), n.value.userData.tres__registerCamera = i, n.value.userData.tres__deregisterCamera = f, {
29
+ camera: r,
34
30
  cameras: t,
35
- addCamera: r,
36
- removeCamera: i,
37
- setCameraActive: l
31
+ addCamera: i,
32
+ removeCamera: f,
33
+ setCameraActive: o
38
34
  };
39
- }, Q = A(), Z = A(), I = A(), D = new ge();
35
+ }, Z = k(), ee = k(), N = k(), h = new Pe();
40
36
  let R = 0, F = 0;
41
- const { pause: Re, resume: Fe, isActive: ze } = be(
37
+ const { pause: He, resume: Ge, isActive: Ve } = De(
42
38
  () => {
43
- Q.trigger({ delta: R, elapsed: F, clock: D }), Z.trigger({ delta: R, elapsed: F, clock: D }), I.trigger({ delta: R, elapsed: F, clock: D });
39
+ Z.trigger({ delta: R, elapsed: F, clock: h }), ee.trigger({ delta: R, elapsed: F, clock: h }), N.trigger({ delta: R, elapsed: F, clock: h });
44
40
  },
45
41
  { immediate: !1 }
46
42
  );
47
- I.on(() => {
48
- R = D.getDelta(), F = D.getElapsedTime();
43
+ N.on(() => {
44
+ R = h.getDelta(), F = h.getElapsedTime();
49
45
  });
50
- const ee = () => ({
51
- onBeforeLoop: Q.on,
52
- onLoop: Z.on,
53
- onAfterLoop: I.on,
54
- pause: Re,
55
- resume: Fe,
56
- isActive: ze
57
- }), h = {
46
+ const te = () => ({
47
+ onBeforeLoop: Z.on,
48
+ onLoop: ee.on,
49
+ onAfterLoop: N.on,
50
+ pause: He,
51
+ resume: Ge,
52
+ isActive: Ve
53
+ }), D = {
58
54
  realistic: {
59
- outputColorSpace: we,
60
- toneMapping: ye,
55
+ outputColorSpace: Me,
56
+ toneMapping: _e,
61
57
  toneMappingExposure: 3,
62
58
  shadowMap: {
63
59
  enabled: !0,
64
- type: Ce
60
+ type: Ee
65
61
  }
66
62
  }
67
- }, te = (e, a) => {
68
- for (const t of Object.keys(a))
69
- a[t] instanceof Object && Object.assign(a[t], te(e[t], a[t]));
70
- return Object.assign(e || {}, a), e;
71
- }, He = "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", Ve = /* @__PURE__ */ Ge(He);
72
- function B(e) {
73
- return e.replace(/-([a-z])/g, (a, t) => t.toUpperCase());
63
+ }, re = (e, n) => {
64
+ for (const t of Object.keys(n))
65
+ n[t] instanceof Object && Object.assign(n[t], re(e[t], n[t]));
66
+ return Object.assign(e || {}, n), e;
67
+ }, We = "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", $e = /* @__PURE__ */ Ie(We);
68
+ function S(e) {
69
+ return e.replace(/-([a-z])/g, (n, t) => t.toUpperCase());
74
70
  }
75
- function Ge(e, a) {
76
- const t = /* @__PURE__ */ Object.create(null), n = e.split(",");
77
- for (let r = 0; r < n.length; r++)
78
- t[n[r]] = !0;
79
- return a ? (r) => !!t[r.toLowerCase()] : (r) => !!t[r];
71
+ function Ie(e, n) {
72
+ const t = /* @__PURE__ */ Object.create(null), a = e.split(",");
73
+ for (let r = 0; r < a.length; r++)
74
+ t[a[r]] = !0;
75
+ return n ? (r) => !!t[r.toLowerCase()] : (r) => !!t[r];
80
76
  }
81
- const We = (e, a) => {
82
- const t = /* @__PURE__ */ new Set(), n = [];
77
+ const Ne = (e, n) => {
78
+ const t = /* @__PURE__ */ new Set(), a = [];
83
79
  for (const r of e) {
84
- const i = a(r);
85
- t.has(i) || (t.add(i), n.push(r));
80
+ const i = n(r);
81
+ t.has(i) || (t.add(i), a.push(r));
86
82
  }
87
- return n;
88
- }, q = (e, a) => {
89
- if (!a)
83
+ return a;
84
+ }, J = (e, n) => {
85
+ if (!n)
90
86
  return;
91
- const t = Array.isArray(a) ? a : a.match(/([^[.\]])+/g);
92
- return t == null ? void 0 : t.reduce((n, r) => n && n[r], e);
93
- }, je = (e, a, t) => {
94
- const n = Array.isArray(a) ? a : a.match(/([^[.\]])+/g);
95
- n && n.reduce((r, i, l) => (r[i] === void 0 && (r[i] = {}), l === n.length - 1 && (r[i] = t), r[i]), e);
96
- }, st = !0, U = "[TresJS ▲ ■ ●] ";
97
- function k() {
98
- function e(n, r) {
99
- console.error(`${U} ${n}`, r || "");
87
+ const t = Array.isArray(n) ? n : n.match(/([^[.\]])+/g);
88
+ return t == null ? void 0 : t.reduce((a, r) => a && a[r], e);
89
+ }, qe = (e, n, t) => {
90
+ const a = Array.isArray(n) ? n : n.match(/([^[.\]])+/g);
91
+ a && a.reduce((r, i, f) => (r[i] === void 0 && (r[i] = {}), f === a.length - 1 && (r[i] = t), r[i]), e);
92
+ };
93
+ function ne(e, n) {
94
+ if (e === n)
95
+ return !0;
96
+ if (e === null || typeof e != "object" || n === null || typeof n != "object")
97
+ return !1;
98
+ const t = Object.keys(e), a = Object.keys(n);
99
+ if (t.length !== a.length)
100
+ return !1;
101
+ for (const r of t)
102
+ if (!a.includes(r) || !ne(e[r], n[r]))
103
+ return !1;
104
+ return !0;
105
+ }
106
+ function Ue(e, n) {
107
+ if (!Array.isArray(e) || !Array.isArray(n) || e.length !== n.length)
108
+ return !1;
109
+ for (let t = 0; t < e.length; t++)
110
+ if (!ne(e[t], n[t]))
111
+ return !1;
112
+ return !0;
113
+ }
114
+ const ct = !0, K = "[TresJS ▲ ■ ●] ";
115
+ function b() {
116
+ function e(a, r) {
117
+ console.error(`${K} ${a}`, r || "");
100
118
  }
101
- function a(n) {
102
- console.warn(`${U} ${n}`);
119
+ function n(a) {
120
+ console.warn(`${K} ${a}`);
103
121
  }
104
- function t(n, r) {
122
+ function t(a, r) {
105
123
  }
106
124
  return {
107
125
  logError: e,
108
- logWarning: a,
126
+ logWarning: n,
109
127
  logMessage: t
110
128
  };
111
129
  }
112
- function it(e) {
113
- return typeof e == "number" ? [e, e, e] : e instanceof Pe ? [e.x, e.y, e.z] : e;
130
+ function ft(e) {
131
+ return typeof e == "number" ? [e, e, e] : e instanceof Le ? [e.x, e.y, e.z] : e;
114
132
  }
115
- function $e(e) {
116
- return e instanceof O ? e : Array.isArray(e) ? new O(...e) : new O(e);
133
+ function Je(e) {
134
+ return e instanceof B ? e : Array.isArray(e) ? new B(...e) : new B(e);
117
135
  }
118
- function Ie({
136
+ function Ke({
119
137
  scene: e,
120
- canvas: a,
138
+ canvas: n,
121
139
  options: t,
122
- disableRender: n,
140
+ disableRender: a,
123
141
  contextParts: { sizes: r, camera: i }
124
142
  }) {
125
- const l = _(() => ({
126
- alpha: y(t.alpha),
127
- depth: y(t.depth),
128
- canvas: De(a),
129
- context: y(t.context),
130
- stencil: y(t.stencil),
131
- antialias: y(t.antialias) === void 0 ? (
143
+ const f = M(() => ({
144
+ alpha: g(t.alpha),
145
+ depth: g(t.depth),
146
+ canvas: Se(n),
147
+ context: g(t.context),
148
+ stencil: g(t.stencil),
149
+ antialias: g(t.antialias) === void 0 ? (
132
150
  // an opinionated default of tres
133
151
  !0
134
- ) : y(t.antialias),
135
- precision: y(t.precision),
136
- powerPreference: y(t.powerPreference),
137
- premultipliedAlpha: y(t.premultipliedAlpha),
138
- preserveDrawingBuffer: y(t.preserveDrawingBuffer),
139
- logarithmicDepthBuffer: y(t.logarithmicDepthBuffer),
140
- failIfMajorPerformanceCaveat: y(t.failIfMajorPerformanceCaveat)
141
- })), o = z(new V(l.value));
142
- K(l, () => {
143
- o.value.dispose(), o.value = new V(l.value);
144
- }), b(() => {
152
+ ) : g(t.antialias),
153
+ precision: g(t.precision),
154
+ powerPreference: g(t.powerPreference),
155
+ premultipliedAlpha: g(t.premultipliedAlpha),
156
+ preserveDrawingBuffer: g(t.preserveDrawingBuffer),
157
+ logarithmicDepthBuffer: g(t.logarithmicDepthBuffer),
158
+ failIfMajorPerformanceCaveat: g(t.failIfMajorPerformanceCaveat)
159
+ })), o = I(new z(f.value));
160
+ V(f, () => {
161
+ o.value.dispose(), o.value = new z(f.value);
162
+ }), O(() => {
145
163
  o.value.setSize(r.width.value, r.height.value);
146
164
  });
147
- const { pixelRatio: s } = Ae();
148
- b(() => {
165
+ const { pixelRatio: s } = Oe();
166
+ O(() => {
149
167
  o.value.setPixelRatio(s.value);
150
168
  });
151
- const { logError: u } = k(), f = (() => {
152
- const p = new V(), d = {
169
+ const { logError: u } = b(), c = (() => {
170
+ const v = new z(), C = {
153
171
  shadowMap: {
154
- enabled: p.shadowMap.enabled,
155
- type: p.shadowMap.type
172
+ enabled: v.shadowMap.enabled,
173
+ type: v.shadowMap.type
156
174
  },
157
- toneMapping: p.toneMapping,
158
- toneMappingExposure: p.toneMappingExposure,
159
- outputColorSpace: p.outputColorSpace,
160
- useLegacyLights: p.useLegacyLights
175
+ toneMapping: v.toneMapping,
176
+ toneMappingExposure: v.toneMappingExposure,
177
+ outputColorSpace: v.outputColorSpace,
178
+ useLegacyLights: v.useLegacyLights
161
179
  };
162
- return p.dispose(), d;
180
+ return v.dispose(), C;
163
181
  })();
164
- b(() => {
165
- const p = y(t.preset);
166
- p && (p in h || u("Renderer Preset must be one of these: " + Object.keys(h).join(", ")), te(o.value, h[p]));
167
- const d = (L, x) => {
168
- const T = y(L), S = () => {
169
- if (p)
170
- return q(h[p], x);
182
+ O(() => {
183
+ const v = g(t.preset);
184
+ v && (v in D || u("Renderer Preset must be one of these: " + Object.keys(D).join(", ")), re(o.value, D[v]));
185
+ const C = (x, E) => {
186
+ const A = g(x), T = () => {
187
+ if (v)
188
+ return J(D[v], E);
171
189
  };
172
- if (T !== void 0)
173
- return T;
174
- const m = S();
175
- return m !== void 0 ? m : q(f, x);
176
- }, v = (L, x) => je(o.value, x, d(L, x));
177
- v(t.shadows, "shadowMap.enabled"), v(t.toneMapping, "toneMapping"), v(t.shadowMapType, "shadowMap.type"), v(t.useLegacyLights, "useLegacyLights"), v(t.outputColorSpace, "outputColorSpace"), v(t.toneMappingExposure, "toneMappingExposure");
178
- const E = d(t.clearColor, "clearColor");
179
- E && o.value.setClearColor(
180
- E ? $e(E) : new O(0)
190
+ if (A !== void 0)
191
+ return A;
192
+ const m = T();
193
+ return m !== void 0 ? m : J(c, E);
194
+ }, y = (x, E) => qe(o.value, E, C(x, E));
195
+ y(t.shadows, "shadowMap.enabled"), y(t.toneMapping, "toneMapping"), y(t.shadowMapType, "shadowMap.type"), y(t.useLegacyLights, "useLegacyLights"), y(t.outputColorSpace, "outputColorSpace"), y(t.toneMappingExposure, "toneMappingExposure");
196
+ const _ = C(t.clearColor, "clearColor");
197
+ _ && o.value.setClearColor(
198
+ _ ? Je(_) : new B(0)
181
199
  // default clear color is not easily/efficiently retrievable from three
182
200
  );
183
201
  });
184
- const { pause: w, resume: C, onLoop: M } = ee();
185
- return M(() => {
186
- i.value && !y(n) && o.value.render(e, i.value);
187
- }), C(), j(() => {
188
- w(), o.value.dispose(), o.value.forceContextLoss();
202
+ const { pause: p, resume: P, onLoop: L } = te();
203
+ return L(() => {
204
+ i.value && !g(a) && o.value.render(e.value, i.value);
205
+ }), P(), se(() => {
206
+ p(), o.value.dispose(), o.value.forceContextLoss();
189
207
  }), {
190
208
  renderer: o
191
209
  };
192
210
  }
193
- function Ne(e) {
194
- const a = { nodes: {}, materials: {} };
211
+ const X = (e) => typeof e == "function", ae = (e) => !!e && e.constructor === Array;
212
+ function Xe(e) {
213
+ const n = { nodes: {}, materials: {} };
195
214
  return e && e.traverse((t) => {
196
- t.name && (a.nodes[t.name] = t), t.material && !a.materials[t.material.name] && (a.materials[t.material.name] = t.material);
197
- }), a;
215
+ t.name && (n.nodes[t.name] = t), t.material && !n.materials[t.material.name] && (n.materials[t.material.name] = t.material);
216
+ }), n;
198
217
  }
199
- async function ut(e, a, t, n, r) {
200
- const { logError: i } = k(), l = new e();
201
- r && r(l), t && t(l);
202
- const s = (Array.isArray(a) ? a : [a]).map(
203
- (u) => new Promise((c, f) => {
204
- l.load(
218
+ async function mt(e, n, t, a, r) {
219
+ const { logError: i } = b(), f = new e();
220
+ r && r(f), t && t(f);
221
+ const s = (Array.isArray(n) ? n : [n]).map(
222
+ (u) => new Promise((l, c) => {
223
+ f.load(
205
224
  u,
206
- (w) => {
207
- w.scene && Object.assign(w, Ne(w.scene)), c(w);
225
+ (p) => {
226
+ p.scene && Object.assign(p, Xe(p.scene)), l(p);
208
227
  },
209
- n,
210
- (w) => f(i("[useLoader] - Failed to load resource", w))
228
+ a,
229
+ (p) => c(i("[useLoader] - Failed to load resource", p))
211
230
  );
212
231
  })
213
232
  );
214
- return Y(a) ? await Promise.all(s) : await s[0];
233
+ return ae(n) ? await Promise.all(s) : await s[0];
215
234
  }
216
- async function lt(e) {
217
- const a = new Me(), t = new _e(a), n = (r) => new Promise((i, l) => {
235
+ async function pt(e) {
236
+ const n = new xe(), t = new Ae(n), a = (r) => new Promise((i, f) => {
218
237
  t.load(
219
238
  r,
220
239
  (o) => i(o),
221
240
  () => null,
222
241
  () => {
223
- l(new Error("[useTextures] - Failed to load texture"));
242
+ f(new Error("[useTextures] - Failed to load texture"));
224
243
  }
225
244
  );
226
245
  });
227
- if (Y(e)) {
228
- const r = await Promise.all(e.map((i) => n(i)));
246
+ if (ae(e)) {
247
+ const r = await Promise.all(e.map((i) => a(i)));
229
248
  return e.length > 1 ? r : r[0];
230
249
  } else {
231
250
  const {
232
251
  map: r,
233
252
  displacementMap: i,
234
- normalMap: l,
253
+ normalMap: f,
235
254
  roughnessMap: o,
236
255
  metalnessMap: s,
237
256
  aoMap: u,
238
- alphaMap: c,
239
- matcap: f
257
+ alphaMap: l,
258
+ matcap: c
240
259
  } = e;
241
260
  return {
242
- map: r ? await n(r) : null,
243
- displacementMap: i ? await n(i) : null,
244
- normalMap: l ? await n(l) : null,
245
- roughnessMap: o ? await n(o) : null,
246
- metalnessMap: s ? await n(s) : null,
247
- aoMap: u ? await n(u) : null,
248
- alphaMap: c ? await n(c) : null,
249
- matcap: f ? await n(f) : null
261
+ map: r ? await a(r) : null,
262
+ displacementMap: i ? await a(i) : null,
263
+ normalMap: f ? await a(f) : null,
264
+ roughnessMap: o ? await a(o) : null,
265
+ metalnessMap: s ? await a(s) : null,
266
+ aoMap: u ? await a(u) : null,
267
+ alphaMap: l ? await a(l) : null,
268
+ matcap: c ? await a(c) : null
250
269
  };
251
270
  }
252
271
  }
253
- const qe = (e, { renderer: a, camera: t, raycaster: n }) => {
254
- const r = _(() => a.value.domElement), { x: i, y: l } = ke({ target: r }), { width: o, height: s, top: u, left: c } = Se(r), f = ({ x: m, y: P }) => {
272
+ const Ye = (e, { renderer: n, camera: t, raycaster: a }) => {
273
+ const r = M(() => n.value.domElement), { x: i, y: f } = Be({ target: r }), { width: o, height: s, top: u, left: l } = Re(r), c = ({ x: m, y: w }) => {
255
274
  if (r.value)
256
275
  return {
257
- x: (m - c.value) / o.value * 2 - 1,
258
- y: -((P - u.value) / s.value) * 2 + 1
276
+ x: (m - l.value) / o.value * 2 - 1,
277
+ y: -((w - u.value) / s.value) * 2 + 1
259
278
  };
260
- }, w = ({ x: m, y: P }) => {
279
+ }, p = ({ x: m, y: w }) => {
261
280
  if (t.value)
262
- return n.value.setFromCamera(new Ee(m, P), t.value), n.value.intersectObjects(e.value, !1);
263
- }, C = (m) => {
264
- const P = f({
281
+ return a.value.setFromCamera(new he(m, w), t.value), a.value.intersectObjects(e.value, !1);
282
+ }, P = (m) => {
283
+ const w = c({
265
284
  x: (m == null ? void 0 : m.clientX) ?? i.value,
266
- y: (m == null ? void 0 : m.clientY) ?? l.value
285
+ y: (m == null ? void 0 : m.clientY) ?? f.value
267
286
  });
268
- return P ? w(P) || [] : [];
269
- }, M = _(() => C()), p = A(), d = A(), v = (m, P) => {
270
- m.trigger({ event: P, intersects: C(P) });
271
- }, E = (m) => {
272
- v(d, m);
287
+ return w ? p(w) || [] : [];
288
+ }, L = M(() => P()), v = k(), C = k(), y = (m, w) => {
289
+ m.trigger({ event: w, intersects: P(w) });
290
+ }, _ = (m) => {
291
+ y(C, m);
273
292
  };
274
- let L;
275
- const x = (m) => {
276
- var P;
277
- L = (P = C(m)[0]) == null ? void 0 : P.object;
278
- }, T = (m) => {
279
- var P;
280
- m instanceof PointerEvent && L === ((P = C(m)[0]) == null ? void 0 : P.object) && v(p, m);
281
- }, S = (m) => d.trigger({ event: m, intersects: [] });
282
- return r.value.addEventListener("pointerup", T), r.value.addEventListener("pointerdown", x), r.value.addEventListener("pointermove", E), r.value.addEventListener("pointerleave", S), j(() => {
283
- r != null && r.value && (r.value.removeEventListener("pointerup", T), r.value.removeEventListener("pointerdown", x), r.value.removeEventListener("pointermove", E), r.value.removeEventListener("pointerleave", S));
293
+ let x;
294
+ const E = (m) => {
295
+ var w;
296
+ x = (w = P(m)[0]) == null ? void 0 : w.object;
297
+ }, A = (m) => {
298
+ var w;
299
+ m instanceof PointerEvent && x === ((w = P(m)[0]) == null ? void 0 : w.object) && y(v, m);
300
+ }, T = (m) => C.trigger({ event: m, intersects: [] });
301
+ return ie((m) => {
302
+ r.value && (r.value.addEventListener("pointerup", A), r.value.addEventListener("pointerdown", E), r.value.addEventListener("pointermove", _), r.value.addEventListener("pointerleave", T), m(() => {
303
+ r != null && r.value && (r.value.removeEventListener("pointerup", A), r.value.removeEventListener("pointerdown", E), r.value.removeEventListener("pointermove", _), r.value.removeEventListener("pointerleave", T));
304
+ }));
284
305
  }), {
285
- intersects: M,
286
- onClick: (m) => p.on(m).off,
287
- onPointerMove: (m) => d.on(m).off
306
+ intersects: L,
307
+ onClick: (m) => v.on(m).off,
308
+ onPointerMove: (m) => C.on(m).off
288
309
  };
289
310
  };
290
- function ct() {
291
- const { logWarning: e } = k();
292
- function a(n, r, i) {
293
- let l = null;
294
- return n.traverse((o) => {
295
- o[r] === i && (l = o);
296
- }), l || e(`Child with ${r} '${i}' not found.`), l;
311
+ function vt() {
312
+ const { logWarning: e } = b();
313
+ function n(a, r, i) {
314
+ let f = null;
315
+ return a.traverse((o) => {
316
+ o[r] === i && (f = o);
317
+ }), f || e(`Child with ${r} '${i}' not found.`), f;
297
318
  }
298
- function t(n, r) {
299
- return a(n, "name", r);
319
+ function t(a, r) {
320
+ return n(a, "name", r);
300
321
  }
301
322
  return {
302
- seek: a,
323
+ seek: n,
303
324
  seekByName: t
304
325
  };
305
326
  }
306
- const Ue = ({ scene: e, contextParts: a }) => {
307
- const t = re({
327
+ const Qe = ({ scene: e, contextParts: n }) => {
328
+ const t = ue({
308
329
  click: /* @__PURE__ */ new Map(),
309
330
  pointerMove: /* @__PURE__ */ new Map(),
310
331
  pointerEnter: /* @__PURE__ */ new Map(),
311
332
  pointerLeave: /* @__PURE__ */ new Map()
312
- }), n = (u) => {
313
- Object.values(t).forEach((c) => c.delete(u));
333
+ }), a = (u) => {
334
+ Object.values(t).forEach((l) => l.delete(u));
314
335
  }, r = (u) => {
315
- const { onClick: c, onPointerMove: f, onPointerEnter: w, onPointerLeave: C } = u;
316
- c && t.click.set(u, c), f && t.pointerMove.set(u, f), w && t.pointerEnter.set(u, w), C && t.pointerLeave.set(u, C);
336
+ const { onClick: l, onPointerMove: c, onPointerEnter: p, onPointerLeave: P } = u;
337
+ l && t.click.set(u, l), c && t.pointerMove.set(u, c), p && t.pointerEnter.set(u, p), P && t.pointerLeave.set(u, P);
317
338
  };
318
- e.userData.tres__registerAtPointerEventHandler = r, e.userData.tres__deregisterAtPointerEventHandler = n;
319
- const i = _(
320
- () => We(
339
+ e.userData.tres__registerAtPointerEventHandler = r, e.userData.tres__deregisterAtPointerEventHandler = a;
340
+ const i = M(
341
+ () => Ne(
321
342
  Object.values(t).map((u) => Array.from(u.keys())).flat(),
322
343
  ({ uuid: u }) => u
323
344
  )
324
- ), { onClick: l, onPointerMove: o } = qe(i, a);
325
- l(({ intersects: u, event: c }) => {
326
- var f;
327
- u.length && ((f = t.click.get(u[0].object)) == null || f(u[0], c));
345
+ ), { onClick: f, onPointerMove: o } = Ye(i, n);
346
+ f(({ intersects: u, event: l }) => {
347
+ var c;
348
+ u.length && ((c = t.click.get(u[0].object)) == null || c(u[0], l));
328
349
  });
329
350
  let s;
330
- return o(({ intersects: u, event: c }) => {
331
- var p, d, v, E;
332
- const f = (p = u == null ? void 0 : u[0]) == null ? void 0 : p.object, { pointerLeave: w, pointerEnter: C, pointerMove: M } = t;
333
- s && s !== f && ((d = w.get(s)) == null || d(s, c)), f && (s !== f && ((v = C.get(f)) == null || v(u[0], c)), (E = M.get(f)) == null || E(u[0], c)), s = f || null;
351
+ return o(({ intersects: u, event: l }) => {
352
+ var v, C, y, _;
353
+ const c = (v = u == null ? void 0 : u[0]) == null ? void 0 : v.object, { pointerLeave: p, pointerEnter: P, pointerMove: L } = t;
354
+ s && s !== c && ((C = p.get(s)) == null || C(s, l)), c && (s !== c && ((y = P.get(c)) == null || y(u[0], l)), (_ = L.get(c)) == null || _(u[0], l)), s = c || null;
334
355
  }), {
335
356
  registerObject: r,
336
- deregisterObject: n
357
+ deregisterObject: a
337
358
  };
338
- };
339
- function Je({
359
+ }, $ = j({}), oe = (e) => void Object.assign($.value, e);
360
+ function Ze({
340
361
  scene: e,
341
- canvas: a,
362
+ canvas: n,
342
363
  windowSize: t,
343
- disableRender: n,
364
+ disableRender: a,
344
365
  rendererOptions: r
345
366
  }) {
346
- const i = _(
347
- () => y(t) ? he() : Be(y(a).parentElement)
348
- ), l = _(() => i.value.width.value), o = _(() => i.value.height.value), s = _(() => l.value / o.value), u = {
367
+ const i = M(
368
+ () => {
369
+ var y;
370
+ return g(t) ? Fe() : je((y = g(n)) == null ? void 0 : y.parentElement);
371
+ }
372
+ ), f = M(() => i.value.width.value), o = M(() => i.value.height.value), s = M(() => f.value / o.value), u = {
349
373
  height: o,
350
- width: l,
374
+ width: f,
351
375
  aspectRatio: s
352
- }, c = z(e), {
353
- camera: f,
354
- cameras: w,
355
- addCamera: C,
356
- removeCamera: M,
357
- setCameraActive: p
358
- } = Oe({ sizes: u, scene: e }), { renderer: d } = Ie(
376
+ }, {
377
+ camera: l,
378
+ cameras: c,
379
+ addCamera: p,
380
+ removeCamera: P,
381
+ setCameraActive: L
382
+ } = ze({ sizes: u, scene: e }), { renderer: v } = Ke(
359
383
  {
360
384
  scene: e,
361
- canvas: a,
385
+ canvas: n,
362
386
  options: r,
363
- contextParts: { sizes: u, camera: f },
364
- disableRender: n
387
+ contextParts: { sizes: u, camera: l },
388
+ disableRender: a
365
389
  }
366
- ), v = {
390
+ ), C = {
367
391
  sizes: u,
368
- scene: c,
369
- camera: f,
370
- cameras: ne(w),
371
- renderer: d,
372
- raycaster: z(new xe()),
373
- controls: H(null),
374
- extend: $,
375
- addCamera: C,
376
- removeCamera: M,
377
- setCameraActive: p
392
+ scene: e,
393
+ camera: l,
394
+ cameras: le(c),
395
+ renderer: v,
396
+ raycaster: I(new ke()),
397
+ controls: j(null),
398
+ extend: oe,
399
+ addCamera: p,
400
+ removeCamera: P,
401
+ setCameraActive: L
378
402
  };
379
- return ae("useTres", v), v;
403
+ return Q("useTres", C), C;
380
404
  }
381
- function Ke() {
382
- const e = oe("useTres");
405
+ function et() {
406
+ const e = ce("useTres");
383
407
  if (!e)
384
408
  throw new Error("useTresContext must be used together with useTresContextProvider");
385
409
  return e;
386
410
  }
387
- const ft = Ke;
388
- let G = null, g = null;
389
- const { logError: J } = k(), Xe = {
390
- createElement(e, a, t, n) {
391
- var l, o;
392
- if (n || (n = {}), n.args || (n.args = []), e === "template" || Ve(e))
411
+ const dt = et;
412
+ let H = null, d = null;
413
+ const { logError: Y } = b(), tt = {
414
+ createElement(e, n, t, a) {
415
+ var f, o;
416
+ if (a || (a = {}), a.args || (a.args = []), e === "template" || $e(e))
393
417
  return null;
394
418
  let r = e.replace("Tres", ""), i;
395
419
  if (e === "primitive") {
396
- (n == null ? void 0 : n.object) === void 0 && J("Tres primitives need a prop 'object'");
397
- const s = n.object;
398
- r = s.type, i = Object.assign(s, { type: r, attach: n.attach, primitive: !0 });
420
+ (a == null ? void 0 : a.object) === void 0 && Y("Tres primitives need a prop 'object'");
421
+ const s = a.object;
422
+ r = s.type, i = Object.assign(s, { type: r, attach: a.attach, primitive: !0 });
399
423
  } else {
400
- const s = X.value[r];
401
- s || J(`${r} is not defined on the THREE namespace. Use extend to add it to the catalog.`), i = new s(...n.args);
424
+ const s = $.value[r];
425
+ s || Y(`${r} is not defined on the THREE namespace. Use extend to add it to the catalog.`), i = new s(...a.args);
402
426
  }
403
- return i.isCamera && (n != null && n.position || i.position.set(3, 3, 3), n != null && n.lookAt || i.lookAt(0, 0, 0)), (n == null ? void 0 : n.attach) === void 0 && (i.isMaterial ? i.attach = "material" : i.isBufferGeometry && (i.attach = "geometry")), i.isObject3D && ((l = n == null ? void 0 : n.material) != null && l.isMaterial && (i.userData.tres__materialViaProp = !0), (o = n == null ? void 0 : n.geometry) != null && o.isBufferGeometry && (i.userData.tres__geometryViaProp = !0)), i;
427
+ return i.isCamera && (a != null && a.position || i.position.set(3, 3, 3), a != null && a.lookAt || i.lookAt(0, 0, 0)), (a == null ? void 0 : a.attach) === void 0 && (i.isMaterial ? i.attach = "material" : i.isBufferGeometry && (i.attach = "geometry")), i.isObject3D && ((f = a == null ? void 0 : a.material) != null && f.isMaterial && (i.userData.tres__materialViaProp = !0), (o = a == null ? void 0 : a.geometry) != null && o.isBufferGeometry && (i.userData.tres__geometryViaProp = !0)), i;
404
428
  },
405
- insert(e, a) {
406
- var t, n, r, i, l, o, s, u, c;
407
- if (a && a.isScene && (g = a), (((t = e == null ? void 0 : e.__vnode) == null ? void 0 : t.type) === "TresGroup" || ((n = e == null ? void 0 : e.__vnode) == null ? void 0 : n.type) === "TresObject3D") && a === null && !((i = (r = e == null ? void 0 : e.__vnode) == null ? void 0 : r.ctx) != null && i.asyncResolved)) {
408
- G = e;
429
+ insert(e, n) {
430
+ var t, a, r, i, f, o, s, u, l;
431
+ if (n && n.isScene && (d = n), (((t = e == null ? void 0 : e.__vnode) == null ? void 0 : t.type) === "TresGroup" || ((a = e == null ? void 0 : e.__vnode) == null ? void 0 : a.type) === "TresObject3D") && n === null && !((i = (r = e == null ? void 0 : e.__vnode) == null ? void 0 : r.ctx) != null && i.asyncResolved)) {
432
+ H = e;
409
433
  return;
410
434
  } else
411
- (l = e == null ? void 0 : e.__vnode) != null && l.type.includes("Controls") && a === null && (G = g);
412
- if (a || (a = G), e != null && e.isObject3D) {
435
+ (f = e == null ? void 0 : e.__vnode) != null && f.type.includes("Controls") && n === null && (H = d);
436
+ if (n || (n = H), e != null && e.isObject3D) {
413
437
  if (e != null && e.isCamera) {
414
- if (!(g != null && g.userData.tres__registerCamera))
438
+ if (!(d != null && d.userData.tres__registerCamera))
415
439
  throw "could not find tres__registerCamera on scene's userData";
416
- (s = g == null ? void 0 : (o = g.userData).tres__registerCamera) == null || s.call(o, e);
440
+ (s = d == null ? void 0 : (o = d.userData).tres__registerCamera) == null || s.call(o, e);
417
441
  }
418
442
  if (e != null && e.onClick || e != null && e.onPointerMove || e != null && e.onPointerEnter || e != null && e.onPointerLeave) {
419
- if (!(g != null && g.userData.tres__registerAtPointerEventHandler))
443
+ if (!(d != null && d.userData.tres__registerAtPointerEventHandler))
420
444
  throw "could not find tres__registerAtPointerEventHandler on scene's userData";
421
- (c = g == null ? void 0 : (u = g.userData).tres__registerAtPointerEventHandler) == null || c.call(u, e);
445
+ (l = d == null ? void 0 : (u = d.userData).tres__registerAtPointerEventHandler) == null || l.call(u, e);
422
446
  }
423
447
  }
424
- e != null && e.isObject3D && (a != null && a.isObject3D) ? (a.add(e), e.dispatchEvent({ type: "added" })) : e != null && e.isFog ? a.fog = e : typeof (e == null ? void 0 : e.attach) == "string" && (e.__previousAttach = e[a == null ? void 0 : a.attach], a && (a[e.attach] = e));
448
+ e != null && e.isObject3D && (n != null && n.isObject3D) ? (n.add(e), e.dispatchEvent({ type: "added" })) : e != null && e.isFog ? n.fog = e : typeof (e == null ? void 0 : e.attach) == "string" && (e.__previousAttach = e[n == null ? void 0 : n.attach], n && (n[e.attach] = e));
425
449
  },
426
450
  remove(e) {
427
- var a, t;
451
+ var n, t;
428
452
  if (e) {
429
453
  if (e.isObject3D) {
430
- const n = e, r = (s) => {
431
- var c, f;
454
+ const a = e, r = (s) => {
455
+ var l, c;
432
456
  const u = s;
433
- s.userData.tres__materialViaProp || (c = u.material) == null || c.dispose(), s.userData.tres__geometryViaProp || (f = u.geometry) == null || f.dispose();
434
- }, i = g == null ? void 0 : g.userData.tres__deregisterAtPointerEventHandler, l = (s) => {
457
+ s.userData.tres__materialViaProp || (l = u.material) == null || l.dispose(), s.userData.tres__geometryViaProp || (c = u.geometry) == null || c.dispose();
458
+ }, i = d == null ? void 0 : d.userData.tres__deregisterAtPointerEventHandler, f = (s) => {
435
459
  if (!i)
436
460
  throw "could not find tres__deregisterAtPointerEventHandler on scene's userData";
437
461
  (s != null && s.onClick || s != null && s.onPointerMove || s != null && s.onPointerEnter || s != null && s.onPointerLeave) && (i == null || i(s));
438
462
  }, o = (s) => {
439
- const u = g == null ? void 0 : g.userData.tres__deregisterCamera;
463
+ const u = d == null ? void 0 : d.userData.tres__deregisterCamera;
440
464
  if (!u)
441
465
  throw "could not find tres__deregisterCamera on scene's userData";
442
466
  s.isCamera && (u == null || u(s));
443
467
  };
444
- n.traverse((s) => {
445
- r(s), o(s), l == null || l(s);
446
- }), r(n), o(n), l == null || l(n);
468
+ a.traverse((s) => {
469
+ r(s), o(s), f == null || f(s);
470
+ }), r(a), o(a), f == null || f(a);
447
471
  }
448
- (a = e.removeFromParent) == null || a.call(e), (t = e.dispose) == null || t.call(e);
472
+ (n = e.removeFromParent) == null || n.call(e), (t = e.dispose) == null || t.call(e);
449
473
  }
450
474
  },
451
- patchProp(e, a, t, n) {
475
+ patchProp(e, n, t, a) {
452
476
  if (e) {
453
- let r = e, i = a, l = B(i), o = r == null ? void 0 : r[l];
477
+ let r = e, i = n, f = S(i), o = r == null ? void 0 : r[f];
478
+ if (i === "args") {
479
+ const u = e, l = t ?? [], c = a ?? [];
480
+ e.type && !Ue(l, c) && (r = Object.assign(u, new $.value[e.type](...a)));
481
+ return;
482
+ }
454
483
  if (r.type === "BufferGeometry") {
455
484
  if (i === "args")
456
485
  return;
457
486
  r.setAttribute(
458
- B(i),
459
- new Le(...n)
487
+ S(i),
488
+ new be(...a)
460
489
  );
461
490
  return;
462
491
  }
463
492
  if (i.includes("-") && o === void 0) {
464
493
  const u = i.split("-");
465
- o = u.reduce((c, f) => c[B(f)], r), i = u.pop(), l = i.toLowerCase(), o != null && o.set || (r = u.reduce((c, f) => c[B(f)], r));
494
+ o = u.reduce((l, c) => l[S(c)], r), i = u.pop(), f = i.toLowerCase(), o != null && o.set || (r = u.reduce((l, c) => l[S(c)], r));
466
495
  }
467
- let s = n;
468
- if (s === "" && (s = !0), N(o)) {
469
- Array.isArray(s) ? e[l](...s) : e[l](s);
496
+ let s = a;
497
+ if (s === "" && (s = !0), X(o)) {
498
+ Array.isArray(s) ? e[f](...s) : e[f](s);
470
499
  return;
471
500
  }
472
- !(o != null && o.set) && !N(o) ? r[l] = s : o.constructor === s.constructor && (o != null && o.copy) ? o == null || o.copy(s) : Array.isArray(s) ? o.set(...s) : !o.isColor && o.setScalar ? o.setScalar(s) : o.set(s);
501
+ !(o != null && o.set) && !X(o) ? r[f] = s : o.constructor === s.constructor && (o != null && o.copy) ? o == null || o.copy(s) : Array.isArray(s) ? o.set(...s) : !o.isColor && o.setScalar ? o.setScalar(s) : o.set(s);
473
502
  }
474
503
  },
475
504
  parentNode(e) {
@@ -484,15 +513,9 @@ const { logError: J } = k(), Xe = {
484
513
  setScopeId: () => void 0,
485
514
  cloneNode: () => void 0,
486
515
  insertStaticContent: () => void 0
487
- }, { createApp: Ye } = se(Xe), Qe = (e) => {
488
- const a = Ye(t);
489
- function t() {
490
- return e && e.default ? e.default() : [];
491
- }
492
- return a;
493
- };
494
- $(pe);
495
- const Ze = ["data-scene"], et = /* @__PURE__ */ ie({
516
+ }, { render: rt } = fe(tt);
517
+ oe(ye);
518
+ const nt = ["data-scene"], at = /* @__PURE__ */ q({
496
519
  __name: "TresCanvas",
497
520
  props: {
498
521
  shadows: { type: Boolean },
@@ -519,92 +542,89 @@ const Ze = ["data-scene"], et = /* @__PURE__ */ ie({
519
542
  failIfMajorPerformanceCaveat: { type: Boolean }
520
543
  },
521
544
  setup(e) {
522
- const a = e, { logWarning: t } = k(), n = H(), r = z(new Te());
523
- ee();
524
- const i = ue();
525
- let l;
526
- const o = (u) => {
527
- l = Qe(i), l.provide("useTres", u), l.provide("extend", $), l.mount(r.value);
528
- }, s = _(() => a.disableRender);
529
- return le(() => {
530
- const u = n, c = Je({
531
- scene: r.value,
532
- canvas: u,
533
- windowSize: a.windowSize,
534
- disableRender: s,
535
- rendererOptions: a
536
- });
537
- Ue({ scene: r.value, contextParts: c });
538
- const { addCamera: f, camera: w, cameras: C, removeCamera: M } = c;
539
- o(c);
540
- const p = () => {
541
- const d = new W(45, window.innerWidth / window.innerHeight, 0.1, 1e3);
542
- d.position.set(3, 3, 3), d.lookAt(0, 0, 0), f(d);
543
- const v = b(
544
- () => {
545
- C.value.length >= 2 && (d.removeFromParent(), M(d), v == null || v());
546
- }
547
- );
548
- };
549
- K(() => a.camera, (d, v) => {
550
- d ? f(d) : v && (v.removeFromParent(), M(v));
551
- }, {
552
- immediate: !0
553
- }), w.value || (t(
545
+ const n = e, { logWarning: t } = b(), a = j(), r = I(new Te());
546
+ te();
547
+ const i = me(), f = M(() => n.disableRender), o = Ze({
548
+ scene: r,
549
+ canvas: a,
550
+ windowSize: M(() => n.windowSize),
551
+ disableRender: f,
552
+ rendererOptions: n
553
+ });
554
+ Qe({ scene: r.value, contextParts: o });
555
+ const s = q({
556
+ setup() {
557
+ return Q("useTres", o), () => U(pe, null, i && i.default ? i.default() : []);
558
+ }
559
+ }), u = () => {
560
+ const c = r.value;
561
+ rt(U(s), c), G(r);
562
+ };
563
+ V(a, (c) => {
564
+ c && (u(), !o.camera.value && !n.camera && (t(
554
565
  "No camera found. Creating a default perspective camera. To have full control over a camera, please add one to the scene."
555
- ), p());
556
- }), (u, c) => (ce(), fe("canvas", {
566
+ ), l()));
567
+ }), V(() => n.camera, (c, p) => {
568
+ c ? o.addCamera(c, !0) : p && (p.removeFromParent(), o.removeCamera(p));
569
+ }, {
570
+ immediate: !0
571
+ });
572
+ const l = () => {
573
+ const c = new W(45, window.innerWidth / window.innerHeight, 0.1, 1e3);
574
+ c.position.set(3, 3, 3), c.lookAt(0, 0, 0), o.addCamera(c), o.cameras.value.length >= 2 && (c.removeFromParent(), o.removeCamera(c));
575
+ };
576
+ return (c, p) => (ve(), de("canvas", {
557
577
  ref_key: "canvas",
558
- ref: n,
578
+ ref: a,
559
579
  "data-scene": r.value.uuid,
560
- style: me({
580
+ style: ge({
561
581
  display: "block",
562
582
  width: "100%",
563
583
  height: "100%",
564
- position: u.windowSize ? "fixed" : "relative",
584
+ position: c.windowSize ? "fixed" : "relative",
565
585
  top: 0,
566
586
  left: 0,
567
587
  pointerEvents: "auto",
568
588
  touchAction: "none",
569
589
  zIndex: 1
570
590
  })
571
- }, null, 12, Ze));
591
+ }, null, 12, nt));
572
592
  }
573
- }), tt = [
593
+ }), ot = [
574
594
  "TresCanvas",
575
595
  "TresLeches",
576
596
  "TresScene"
577
- ], rt = {
597
+ ], st = {
578
598
  template: {
579
599
  compilerOptions: {
580
- isCustomElement: (e) => e.startsWith("Tres") && !tt.includes(e) || e === "primitive"
600
+ isCustomElement: (e) => e.startsWith("Tres") && !ot.includes(e) || e === "primitive"
581
601
  }
582
602
  }
583
- }, mt = rt, pt = {
603
+ }, gt = st, yt = {
584
604
  install(e) {
585
- e.component("TresCanvas", et);
605
+ e.component("TresCanvas", at);
586
606
  }
587
607
  };
588
608
  export {
589
- et as TresCanvas,
590
- X as catalogue,
591
- pt as default,
592
- $ as extend,
593
- st as isProd,
594
- $e as normalizeColor,
595
- it as normalizeVectorFlexibleParam,
596
- mt as templateCompilerOptions,
597
- Ne as trasverseObjects,
598
- Oe as useCamera,
599
- ut as useLoader,
600
- k as useLogger,
601
- Ue as usePointerEventHandler,
602
- qe as useRaycaster,
603
- ee as useRenderLoop,
604
- Ie as useRenderer,
605
- ct as useSeek,
606
- lt as useTexture,
607
- ft as useTres,
608
- Ke as useTresContext,
609
- Je as useTresContextProvider
609
+ at as TresCanvas,
610
+ $ as catalogue,
611
+ yt as default,
612
+ oe as extend,
613
+ ct as isProd,
614
+ Je as normalizeColor,
615
+ ft as normalizeVectorFlexibleParam,
616
+ gt as templateCompilerOptions,
617
+ Xe as trasverseObjects,
618
+ ze as useCamera,
619
+ mt as useLoader,
620
+ b as useLogger,
621
+ Qe as usePointerEventHandler,
622
+ Ye as useRaycaster,
623
+ te as useRenderLoop,
624
+ Ke as useRenderer,
625
+ vt as useSeek,
626
+ pt as useTexture,
627
+ dt as useTres,
628
+ et as useTresContext,
629
+ Ze as useTresContextProvider
610
630
  };