@tresjs/core 2.1.3 → 2.2.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,67 +1,71 @@
1
1
  /**
2
2
  * name: @tresjs/core
3
- * version: v2.1.3
3
+ * version: v2.2.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 E, shallowReactive as le, computed as de, toRefs as me, provide as Ae, inject as _e, watchEffect as pe, toRef as Oe, shallowRef as ve, watch as H, onUnmounted as ge, createRenderer as ke, defineComponent as we, onMounted as je, h as D } from "vue";
9
- import * as be from "three";
10
- import { PerspectiveCamera as N, OrthographicCamera as De, Clock as he, Color as U, SRGBColorSpace as Ie, ACESFilmicToneMapping as Be, PCFSoftShadowMap as Fe, PCFShadowMap as ze, LinearSRGBColorSpace as ae, NoToneMapping as ne, WebGLRenderer as Ge, LoadingManager as Ve, TextureLoader as He, Raycaster as We, Vector2 as Ye, BufferAttribute as $e } from "three";
11
- import { createEventHook as X, useRafFn as Ne, toValue as f, useWindowSize as Ue, useElementSize as Ke, useDevicePixelRatio as qe, unrefElement as K, useEventListener as Je } from "@vueuse/core";
12
- const re = (e) => typeof e == "function", Xe = (e) => typeof e == "string", ye = (e) => !!e && e.constructor === Array, Ce = E({}), Me = (e) => void Object.assign(Ce.value, e), p = ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2a", "2b", "2c", "2d", "2e", "2f", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3a", "3b", "3c", "3d", "3e", "3f", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4a", "4b", "4c", "4d", "4e", "4f", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "5a", "5b", "5c", "5d", "5e", "5f", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6a", "6b", "6c", "6d", "6e", "6f", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7a", "7b", "7c", "7d", "7e", "7f", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8a", "8b", "8c", "8d", "8e", "8f", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9a", "9b", "9c", "9d", "9e", "9f", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "aa", "ab", "ac", "ad", "ae", "af", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "ba", "bb", "bc", "bd", "be", "bf", "c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "ca", "cb", "cc", "cd", "ce", "cf", "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "d9", "da", "db", "dc", "dd", "de", "df", "e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9", "ea", "eb", "ec", "ed", "ee", "ef", "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "fa", "fb", "fc", "fd", "fe", "ff"];
13
- function Qe() {
14
- const e = Math.random() * 4294967295 | 0, t = Math.random() * 4294967295 | 0, o = Math.random() * 4294967295 | 0, a = Math.random() * 4294967295 | 0;
15
- return (p[e & 255] + p[e >> 8 & 255] + p[e >> 16 & 255] + p[e >> 24 & 255] + "-" + p[t & 255] + p[t >> 8 & 255] + "-" + p[t >> 16 & 15 | 64] + p[t >> 24 & 255] + "-" + p[o & 63 | 128] + p[o >> 8 & 255] + "-" + p[o >> 16 & 255] + p[o >> 24 & 255] + p[a & 255] + p[a >> 8 & 255] + p[a >> 16 & 255] + p[a >> 24 & 255]).toLowerCase();
8
+ import { ref as G, shallowReactive as ce, toRefs as ue, provide as Te, inject as Le, watchEffect as fe, toRef as _e, shallowRef as Ae, computed as V, watch as D, onUnmounted as le, reactive as Se, createRenderer as Oe, defineComponent as de, onMounted as ke, h as L } from "vue";
9
+ import * as q from "three";
10
+ import { PerspectiveCamera as z, OrthographicCamera as je, Clock as pe, Color as W, SRGBColorSpace as De, ACESFilmicToneMapping as Ie, PCFSoftShadowMap as Be, PCFShadowMap as He, LinearSRGBColorSpace as ae, NoToneMapping as ne, WebGLRenderer as Ge, LoadingManager as Ve, TextureLoader as Ne, Raycaster as Fe, Vector2 as ze, BufferAttribute as We } from "three";
11
+ import { createEventHook as A, useRafFn as Ue, toValue as m, useWindowSize as Ye, useElementSize as $e, useDevicePixelRatio as qe, unrefElement as U, usePointer as Ke, useElementBounding as Je } from "@vueuse/core";
12
+ const me = G({}), ve = (e) => void Object.assign(me.value, e), re = (e) => typeof e == "function", ge = (e) => !!e && e.constructor === Array, b = ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2a", "2b", "2c", "2d", "2e", "2f", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3a", "3b", "3c", "3d", "3e", "3f", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4a", "4b", "4c", "4d", "4e", "4f", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "5a", "5b", "5c", "5d", "5e", "5f", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6a", "6b", "6c", "6d", "6e", "6f", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7a", "7b", "7c", "7d", "7e", "7f", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8a", "8b", "8c", "8d", "8e", "8f", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9a", "9b", "9c", "9d", "9e", "9f", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "aa", "ab", "ac", "ad", "ae", "af", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "ba", "bb", "bc", "bd", "be", "bf", "c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "ca", "cb", "cc", "cd", "ce", "cf", "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "d9", "da", "db", "dc", "dd", "de", "df", "e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9", "ea", "eb", "ec", "ed", "ee", "ef", "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "fa", "fb", "fc", "fd", "fe", "ff"];
13
+ function Xe() {
14
+ const e = Math.random() * 4294967295 | 0, t = Math.random() * 4294967295 | 0, n = Math.random() * 4294967295 | 0, a = Math.random() * 4294967295 | 0;
15
+ return (b[e & 255] + b[e >> 8 & 255] + b[e >> 16 & 255] + b[e >> 24 & 255] + "-" + b[t & 255] + b[t >> 8 & 255] + "-" + b[t >> 16 & 15 | 64] + b[t >> 24 & 255] + "-" + b[n & 63 | 128] + b[n >> 8 & 255] + "-" + b[n >> 16 & 255] + b[n >> 24 & 255] + b[a & 255] + b[a >> 8 & 255] + b[a >> 16 & 255] + b[a >> 24 & 255]).toLowerCase();
16
16
  }
17
- const Q = Symbol();
18
- function Ze() {
19
- const e = le({
20
- uuid: Qe(),
17
+ const K = Symbol();
18
+ function Qe() {
19
+ const e = ce({
20
+ uuid: Xe(),
21
21
  camera: void 0,
22
22
  cameras: [],
23
+ canvas: void 0,
23
24
  scene: void 0,
24
25
  renderer: void 0,
25
- aspectRatio: de(() => window.innerWidth / window.innerHeight)
26
+ aspectRatio: void 0,
27
+ pointerEventHandler: void 0
26
28
  });
27
- function t(n) {
28
- return e[n];
29
+ function t(o) {
30
+ return e[o];
29
31
  }
30
- function o(n, r) {
31
- e[n] = r;
32
+ function n(o, i) {
33
+ e[o] = i;
32
34
  }
33
35
  const a = {
34
36
  state: e,
35
- ...me(e),
37
+ ...ue(e),
36
38
  getState: t,
37
- setState: o
39
+ setState: n
38
40
  };
39
- return Ae(Q, a), a;
41
+ return Te(K, a), a;
40
42
  }
41
- const B = () => _e(Q, {
42
- state: le({
43
+ const S = () => Le(K, {
44
+ state: ce({
43
45
  camera: void 0,
44
46
  cameras: [],
47
+ canvas: void 0,
45
48
  scene: void 0,
46
- renderer: void 0
49
+ renderer: void 0,
50
+ pointerEventHandler: void 0
47
51
  })
48
52
  });
49
- var et = /* @__PURE__ */ ((e) => (e.Perspective = "Perspective", e.Orthographic = "Orthographic", e))(et || {});
50
- const tt = 45;
51
- let _;
52
- function xe() {
53
- const { state: e, setState: t, aspectRatio: o } = B();
54
- function a(s = "Perspective", u) {
55
- var l, d, v;
53
+ var Ze = /* @__PURE__ */ ((e) => (e.Perspective = "Perspective", e.Orthographic = "Orthographic", e))(Ze || {});
54
+ const et = 45;
55
+ let x;
56
+ function tt() {
57
+ const { state: e, setState: t, aspectRatio: n } = S();
58
+ function a(s = "Perspective", c) {
59
+ var l, d, p;
56
60
  if (s === "Perspective") {
57
- const { near: C, far: M, fov: b } = u || {
61
+ const { near: y, far: h, fov: v } = c || {
58
62
  near: 0.1,
59
63
  far: 1e3,
60
- fov: tt
64
+ fov: et
61
65
  };
62
- _ = new N(b, ((l = e.aspectRatio) == null ? void 0 : l.value) || window.innerWidth / window.innerHeight, C, M), (d = e.cameras) == null || d.push(_);
66
+ x = new z(v, ((l = e.aspectRatio) == null ? void 0 : l.value) || window.innerWidth / window.innerHeight, y, h), (d = e.cameras) == null || d.push(x);
63
67
  } else {
64
- const { left: C, right: M, top: b, bottom: P, near: w, far: x } = u || {
68
+ const { left: y, right: h, top: v, bottom: M, near: w, far: E } = c || {
65
69
  left: -100,
66
70
  right: 100,
67
71
  top: 100,
@@ -69,343 +73,404 @@ function xe() {
69
73
  near: 0.1,
70
74
  far: 1e3
71
75
  };
72
- _ = new De(C, M, b, P, w, x), (v = e.cameras) == null || v.push(_);
76
+ x = new je(y, h, v, M, w, E), (p = e.cameras) == null || p.push(x);
73
77
  }
74
- return e.camera = _, t("camera", e.camera), _;
78
+ return e.camera = x, t("camera", e.camera), x;
75
79
  }
76
- function n() {
80
+ function o() {
77
81
  var s;
78
- e.camera instanceof N && e.aspectRatio && (e.camera.aspect = e.aspectRatio.value), (s = e.camera) == null || s.updateProjectionMatrix();
82
+ e.camera instanceof z && e.aspectRatio && (e.camera.aspect = e.aspectRatio.value), (s = e.camera) == null || s.updateProjectionMatrix();
79
83
  }
80
- function r(s) {
81
- var u;
82
- (u = e.cameras) == null || u.push(s), s instanceof N && e.aspectRatio && (s.aspect = e.aspectRatio.value), s.updateProjectionMatrix(), t("camera", s);
84
+ function i(s) {
85
+ var c;
86
+ (c = e.cameras) == null || c.push(s), s instanceof z && e.aspectRatio && (s.aspect = e.aspectRatio.value), s.updateProjectionMatrix(), t("camera", s);
83
87
  }
84
- function c(s) {
85
- var u;
86
- ((u = e.cameras) == null ? void 0 : u.length) === 0 && r(s);
88
+ function u(s) {
89
+ var c;
90
+ ((c = e.cameras) == null ? void 0 : c.length) === 0 && i(s);
87
91
  }
88
- function i() {
92
+ function r() {
89
93
  e.cameras = [];
90
94
  }
91
- return pe(() => {
92
- o != null && o.value && n();
95
+ return fe(() => {
96
+ n != null && n.value && o();
93
97
  }), {
94
- activeCamera: Oe(e, "camera"),
98
+ activeCamera: _e(e, "camera"),
95
99
  createCamera: a,
96
- updateCamera: n,
97
- pushCamera: r,
98
- clearCameras: i,
99
- setFirstCamera: c
100
+ updateCamera: o,
101
+ pushCamera: i,
102
+ clearCameras: r,
103
+ setFirstCamera: u
100
104
  };
101
105
  }
102
- const Re = X(), Ee = X(), Z = X(), I = new he();
103
- let W = 0, Y = 0;
104
- const { pause: at, resume: nt, isActive: rt } = Ne(
106
+ const we = A(), be = A(), J = A(), _ = new pe();
107
+ let I = 0, B = 0;
108
+ const { pause: at, resume: nt, isActive: rt } = Ue(
105
109
  () => {
106
- Re.trigger({ delta: W, elapsed: Y, clock: I }), Ee.trigger({ delta: W, elapsed: Y, clock: I }), Z.trigger({ delta: W, elapsed: Y, clock: I });
110
+ we.trigger({ delta: I, elapsed: B, clock: _ }), be.trigger({ delta: I, elapsed: B, clock: _ }), J.trigger({ delta: I, elapsed: B, clock: _ });
107
111
  },
108
112
  { immediate: !1 }
109
113
  );
110
- Z.on(() => {
111
- W = I.getDelta(), Y = I.getElapsedTime();
114
+ J.on(() => {
115
+ I = _.getDelta(), B = _.getElapsedTime();
112
116
  });
113
- function Pe() {
117
+ function he() {
114
118
  return {
115
- onBeforeLoop: Re.on,
116
- onLoop: Ee.on,
117
- onAfterLoop: Z.on,
119
+ onBeforeLoop: we.on,
120
+ onLoop: be.on,
121
+ onAfterLoop: J.on,
118
122
  pause: at,
119
123
  resume: nt,
120
124
  isActive: rt
121
125
  };
122
126
  }
123
127
  function ot(e) {
124
- return e instanceof U ? e : Array.isArray(e) ? new U(...e) : new U(e);
128
+ return e instanceof W ? e : Array.isArray(e) ? new W(...e) : new W(e);
125
129
  }
126
- const q = {
130
+ const Y = {
127
131
  realistic: {
128
- outputColorSpace: Ie,
129
- toneMapping: Be,
132
+ outputColorSpace: De,
133
+ toneMapping: Ie,
130
134
  toneMappingExposure: 3,
131
135
  shadowMap: {
132
136
  enabled: !0,
133
- type: Fe
137
+ type: Be
134
138
  }
135
139
  }
136
- }, Se = (e, t) => {
137
- for (const o of Object.keys(t))
138
- t[o] instanceof Object && Object.assign(t[o], Se(e[o], t[o]));
140
+ }, ye = (e, t) => {
141
+ for (const n of Object.keys(t))
142
+ t[n] instanceof Object && Object.assign(t[n], ye(e[n], t[n]));
139
143
  return Object.assign(e || {}, t), e;
140
144
  }, it = "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", st = /* @__PURE__ */ ct(it);
141
- function V(e) {
142
- return e.replace(/-([a-z])/g, (t, o) => o.toUpperCase());
145
+ function j(e) {
146
+ return e.replace(/-([a-z])/g, (t, n) => n.toUpperCase());
143
147
  }
144
148
  function ct(e, t) {
145
- const o = /* @__PURE__ */ Object.create(null), a = e.split(",");
146
- for (let n = 0; n < a.length; n++)
147
- o[a[n]] = !0;
148
- return t ? (n) => !!o[n.toLowerCase()] : (n) => !!o[n];
149
+ const n = /* @__PURE__ */ Object.create(null), a = e.split(",");
150
+ for (let o = 0; o < a.length; o++)
151
+ n[a[o]] = !0;
152
+ return t ? (o) => !!n[o.toLowerCase()] : (o) => !!n[o];
149
153
  }
150
- const Mt = !0, oe = "[TresJS ▲ ■ ●] ";
151
- function F() {
152
- function e(a, n) {
153
- console.error(`${oe} ${a}`, n || "");
154
+ const ut = (e, t) => {
155
+ const n = /* @__PURE__ */ new Set(), a = [];
156
+ for (const o of e) {
157
+ const i = t(o);
158
+ n.has(i) || (n.add(i), a.push(o));
159
+ }
160
+ return a;
161
+ }, Mt = !0, oe = "[TresJS ▲ ■ ●] ";
162
+ function O() {
163
+ function e(a, o) {
164
+ console.error(`${oe} ${a}`, o || "");
154
165
  }
155
166
  function t(a) {
156
167
  console.warn(`${oe} ${a}`);
157
168
  }
158
- function o(a, n) {
169
+ function n(a, o) {
159
170
  }
160
171
  return {
161
172
  logError: e,
162
173
  logWarning: t,
163
- logMessage: o
174
+ logMessage: n
164
175
  };
165
176
  }
166
- function ut(e) {
167
- const t = ve(), o = E(!1), {
177
+ function ft(e) {
178
+ const t = Ae(), n = G(!1), {
168
179
  alpha: a = !0,
169
- antialias: n = !0,
170
- depth: r,
171
- logarithmicDepthBuffer: c,
172
- failIfMajorPerformanceCaveat: i,
180
+ antialias: o = !0,
181
+ depth: i,
182
+ logarithmicDepthBuffer: u,
183
+ failIfMajorPerformanceCaveat: r,
173
184
  precision: s,
174
- premultipliedAlpha: u,
185
+ premultipliedAlpha: c,
175
186
  stencil: l,
176
187
  shadows: d = !1,
177
- shadowMapType: v = ze,
178
- useLegacyLights: C = !1,
179
- outputColorSpace: M = ae,
180
- toneMapping: b = ne,
181
- toneMappingExposure: P = 1,
188
+ shadowMapType: p = He,
189
+ useLegacyLights: y = !1,
190
+ outputColorSpace: h = ae,
191
+ toneMapping: v = ne,
192
+ toneMappingExposure: M = 1,
182
193
  context: w = void 0,
183
- powerPreference: x = "default",
184
- preserveDrawingBuffer: $ = !1,
185
- clearColor: y,
186
- windowSize: m = !1,
187
- preset: R = void 0
188
- } = me(e), { state: g, setState: h } = B(), { width: O, height: k } = f(m) == !0 || f(m) === "" || f(m) === "true" ? Ue() : Ke(g.container), { logError: S, logWarning: z } = F(), { pixelRatio: j } = qe(), { pause: T, resume: G } = Pe(), L = de(() => O.value / k.value);
194
+ powerPreference: E = "default",
195
+ preserveDrawingBuffer: k = !1,
196
+ clearColor: C,
197
+ windowSize: R = !1,
198
+ preset: N = void 0
199
+ } = ue(e), { state: f, setState: g } = S(), { width: X, height: Q } = m(R) == !0 || m(R) === "" || m(R) === "true" ? Ye() : $e(f.container), { logError: Ee, logWarning: Me } = O(), { pixelRatio: Z } = qe(), { pause: Pe, resume: Ce } = he(), F = V(() => X.value / Q.value);
189
200
  setTimeout(() => {
190
- !f(m) && !g.canvas.value.offsetHeight && z(`Oops... Seems like your canvas height is currently 0px, it's posible that you couldn't watch your scene.
201
+ var P;
202
+ !m(R) && !((P = f.canvas) != null && P.value.offsetHeight) && Me(`Oops... Seems like your canvas height is currently 0px, it's posible that you couldn't watch your scene.
191
203
  You could set windowSize=true to force the canvas to be the size of the window.`);
192
204
  }, 1e3);
193
205
  const ee = () => {
194
- t.value && (t.value.setSize(O.value, k.value), t.value.setPixelRatio(Math.min(j.value, 2)));
206
+ t.value && (t.value.setSize(X.value, Q.value), t.value.setPixelRatio(Math.min(Z.value, 2)));
195
207
  }, te = () => {
196
208
  if (!t.value)
197
209
  return;
198
- const A = f(R);
199
- if (A) {
200
- A in q || S("Renderer Preset must be one of these: " + Object.keys(q).join(", ")), Se(t.value, q[A]);
210
+ const P = m(N);
211
+ if (P) {
212
+ P in Y || Ee("Renderer Preset must be one of these: " + Object.keys(Y).join(", ")), ye(t.value, Y[P]);
201
213
  return;
202
214
  }
203
- t.value.shadowMap.enabled = f(d), t.value.shadowMap.type = f(v), t.value.toneMapping = f(b) || ne, t.value.toneMappingExposure = f(P), t.value.outputColorSpace = f(M) || ae, y != null && y.value && t.value.setClearColor(ot(f(y))), t.value.useLegacyLights = f(C);
204
- }, Te = () => {
205
- const A = K(g.canvas);
206
- A && (t.value = new Ge({
207
- canvas: A,
208
- alpha: f(a),
209
- antialias: f(n),
210
- context: f(w),
211
- depth: f(r),
212
- failIfMajorPerformanceCaveat: f(i),
213
- logarithmicDepthBuffer: f(c),
214
- powerPreference: f(x),
215
- precision: f(s),
216
- stencil: f(l),
217
- preserveDrawingBuffer: f($),
218
- premultipliedAlpha: f(u)
219
- }), h("renderer", t.value), h("clock", new he()), h("aspectRatio", L), te(), ee(), G(), o.value = !0);
220
- }, Le = () => {
221
- t.value && (t.value.dispose(), t.value = void 0, o.value = !1, T());
215
+ t.value.shadowMap.enabled = m(d), t.value.shadowMap.type = m(p), t.value.toneMapping = m(v) || ne, t.value.toneMappingExposure = m(M), t.value.outputColorSpace = m(h) || ae, C != null && C.value && t.value.setClearColor(ot(m(C))), t.value.useLegacyLights = m(y);
216
+ }, Re = () => {
217
+ const P = U(f.canvas);
218
+ P && (t.value = new Ge({
219
+ canvas: P,
220
+ alpha: m(a),
221
+ antialias: m(o),
222
+ context: m(w),
223
+ depth: m(i),
224
+ failIfMajorPerformanceCaveat: m(r),
225
+ logarithmicDepthBuffer: m(u),
226
+ powerPreference: m(E),
227
+ precision: m(s),
228
+ stencil: m(l),
229
+ preserveDrawingBuffer: m(k),
230
+ premultipliedAlpha: m(c)
231
+ }), g("renderer", t.value), g("clock", new pe()), g("aspectRatio", F), te(), ee(), Ce(), n.value = !0);
232
+ }, xe = () => {
233
+ t.value && (t.value.dispose(), t.value = void 0, n.value = !1, Pe());
222
234
  };
223
- return H([L, j], ee), H(
224
- [d, v, M, C, b, P, y],
235
+ return D([F, Z], ee), D(
236
+ [d, p, h, y, v, M, C],
225
237
  te
226
- ), H(
227
- () => [g.canvas, g.container],
238
+ ), D(
239
+ () => [f.canvas, f.container],
228
240
  () => {
229
- K(g.canvas) && K(g.container) && Te();
241
+ U(f.canvas) && U(f.container) && Re();
230
242
  },
231
243
  { immediate: !0, deep: !0 }
232
244
  ), {
233
245
  renderer: t,
234
- isReady: o,
235
- dispose: Le,
236
- aspectRatio: L
246
+ isReady: n,
247
+ dispose: xe,
248
+ aspectRatio: F
237
249
  };
238
250
  }
239
- function ft(e) {
251
+ function lt(e) {
240
252
  const t = { nodes: {}, materials: {} };
241
- return e && e.traverse((o) => {
242
- o.name && (t.nodes[o.name] = o), o.material && !t.materials[o.material.name] && (t.materials[o.material.name] = o.material);
253
+ return e && e.traverse((n) => {
254
+ n.name && (t.nodes[n.name] = n), n.material && !t.materials[n.material.name] && (t.materials[n.material.name] = n.material);
243
255
  }), t;
244
256
  }
245
- async function xt(e, t, o, a, n) {
246
- const { logError: r } = F(), c = new e();
247
- n && n(c), o && o(c);
257
+ async function Pt(e, t, n, a, o) {
258
+ const { logError: i } = O(), u = new e();
259
+ o && o(u), n && n(u);
248
260
  const s = (Array.isArray(t) ? t : [t]).map(
249
- (u) => new Promise((l, d) => {
250
- c.load(
251
- u,
252
- (v) => {
253
- v.scene && Object.assign(v, ft(v.scene)), l(v);
261
+ (c) => new Promise((l, d) => {
262
+ u.load(
263
+ c,
264
+ (p) => {
265
+ p.scene && Object.assign(p, lt(p.scene)), l(p);
254
266
  },
255
267
  a,
256
- (v) => d(r("[useLoader] - Failed to load resource", v))
268
+ (p) => d(i("[useLoader] - Failed to load resource", p))
257
269
  );
258
270
  })
259
271
  );
260
- return ye(t) ? await Promise.all(s) : await s[0];
272
+ return ge(t) ? await Promise.all(s) : await s[0];
261
273
  }
262
- async function Rt(e) {
263
- const t = new Ve(), o = new He(t), a = (n) => new Promise((r, c) => {
264
- o.load(
265
- n,
266
- (i) => r(i),
274
+ async function Ct(e) {
275
+ const t = new Ve(), n = new Ne(t), a = (o) => new Promise((i, u) => {
276
+ n.load(
277
+ o,
278
+ (r) => i(r),
267
279
  () => null,
268
280
  () => {
269
- c(new Error("[useTextures] - Failed to load texture"));
281
+ u(new Error("[useTextures] - Failed to load texture"));
270
282
  }
271
283
  );
272
284
  });
273
- if (ye(e)) {
274
- const n = await Promise.all(e.map((r) => a(r)));
275
- return e.length > 1 ? n : n[0];
285
+ if (ge(e)) {
286
+ const o = await Promise.all(e.map((i) => a(i)));
287
+ return e.length > 1 ? o : o[0];
276
288
  } else {
277
289
  const {
278
- map: n,
279
- displacementMap: r,
280
- normalMap: c,
281
- roughnessMap: i,
290
+ map: o,
291
+ displacementMap: i,
292
+ normalMap: u,
293
+ roughnessMap: r,
282
294
  metalnessMap: s,
283
- aoMap: u,
295
+ aoMap: c,
284
296
  alphaMap: l,
285
297
  matcap: d
286
298
  } = e;
287
299
  return {
288
- map: n ? await a(n) : null,
289
- displacementMap: r ? await a(r) : null,
290
- normalMap: c ? await a(c) : null,
291
- roughnessMap: i ? await a(i) : null,
300
+ map: o ? await a(o) : null,
301
+ displacementMap: i ? await a(i) : null,
302
+ normalMap: u ? await a(u) : null,
303
+ roughnessMap: r ? await a(r) : null,
292
304
  metalnessMap: s ? await a(s) : null,
293
- aoMap: u ? await a(u) : null,
305
+ aoMap: c ? await a(c) : null,
294
306
  alphaMap: l ? await a(l) : null,
295
307
  matcap: d ? await a(d) : null
296
308
  };
297
309
  }
298
310
  }
299
- function lt() {
300
- var c;
301
- const e = ve(new We()), t = E(new Ye()), o = E(null), { setState: a, state: n } = B();
302
- a("raycaster", e.value), a("pointer", t), a("currentInstance", o);
303
- function r(i) {
304
- t.value.x = i.clientX / window.innerWidth * 2 - 1, t.value.y = -(i.clientY / window.innerHeight) * 2 + 1;
305
- }
306
- return (c = n == null ? void 0 : n.renderer) == null || c.domElement.addEventListener("pointermove", r), ge(() => {
307
- var i;
308
- (i = n == null ? void 0 : n.renderer) == null || i.domElement.removeEventListener("pointermove", r);
311
+ const dt = (e) => {
312
+ const { state: t } = S(), n = V(() => {
313
+ var f;
314
+ return (f = t.canvas) == null ? void 0 : f.value;
315
+ }), { x: a, y: o } = Ke({ target: n }), { width: i, height: u, top: r, left: s } = Je(n), c = new Fe(), l = ({ x: f, y: g }) => {
316
+ if (n.value)
317
+ return {
318
+ x: (f - s.value) / i.value * 2 - 1,
319
+ y: -((g - r.value) / u.value) * 2 + 1
320
+ };
321
+ }, d = ({ x: f, y: g }) => {
322
+ if (t.camera)
323
+ return c.setFromCamera(new ze(f, g), t.camera), c.intersectObjects(e.value, !1);
324
+ }, p = (f) => {
325
+ const g = l({
326
+ x: (f == null ? void 0 : f.clientX) ?? a.value,
327
+ y: (f == null ? void 0 : f.clientY) ?? o.value
328
+ });
329
+ return g ? d(g) || [] : [];
330
+ }, y = V(() => p()), h = A(), v = A(), M = (f, g) => {
331
+ f.trigger({ event: g, intersects: p(g) });
332
+ }, w = (f) => {
333
+ M(v, f);
334
+ };
335
+ let E;
336
+ const k = (f) => {
337
+ var g;
338
+ E = (g = p(f)[0]) == null ? void 0 : g.object;
339
+ }, C = (f) => {
340
+ var g;
341
+ f instanceof PointerEvent && E === ((g = p(f)[0]) == null ? void 0 : g.object) && M(h, f);
342
+ }, R = (f) => v.trigger({ event: f, intersects: [] }), N = fe(() => {
343
+ n != null && n.value && (n.value.addEventListener("pointerup", C), n.value.addEventListener("pointerdown", k), n.value.addEventListener("pointermove", w), n.value.addEventListener("pointerleave", R), N());
344
+ });
345
+ return le(() => {
346
+ n != null && n.value && (n.value.removeEventListener("pointerup", C), n.value.removeEventListener("pointerdown", k), n.value.removeEventListener("pointermove", w), n.value.removeEventListener("pointerleave", R));
309
347
  }), {
310
- raycaster: e,
311
- pointer: t
348
+ intersects: y,
349
+ onClick: (f) => h.on(f).off,
350
+ onPointerMove: (f) => v.on(f).off
312
351
  };
313
- }
314
- function Et() {
315
- const { logWarning: e } = F();
316
- function t(a, n, r) {
317
- let c = null;
318
- return a.traverse((i) => {
319
- i[n] === r && (c = i);
320
- }), c || e(`Child with ${n} '${r}' not found.`), c;
352
+ };
353
+ function Rt() {
354
+ const { logWarning: e } = O();
355
+ function t(a, o, i) {
356
+ let u = null;
357
+ return a.traverse((r) => {
358
+ r[o] === i && (u = r);
359
+ }), u || e(`Child with ${o} '${i}' not found.`), u;
321
360
  }
322
- function o(a, n) {
323
- return t(a, "name", n);
361
+ function n(a, o) {
362
+ return t(a, "name", o);
324
363
  }
325
364
  return {
326
365
  seek: t,
327
- seekByName: o
366
+ seekByName: n
328
367
  };
329
368
  }
330
- const dt = /^on[^a-z]/, mt = (e) => dt.test(e);
331
- let J = null, ie = null;
332
- const se = {
369
+ const pt = () => {
370
+ const e = Se({
371
+ click: /* @__PURE__ */ new Map(),
372
+ pointerMove: /* @__PURE__ */ new Map(),
373
+ pointerEnter: /* @__PURE__ */ new Map(),
374
+ pointerLeave: /* @__PURE__ */ new Map()
375
+ }), t = (r) => {
376
+ Object.values(e).forEach((s) => s.delete(r));
377
+ }, n = (r) => {
378
+ const { onClick: s, onPointerMove: c, onPointerEnter: l, onPointerLeave: d } = r;
379
+ s && e.click.set(r, s), c && e.pointerMove.set(r, c), l && e.pointerEnter.set(r, l), d && e.pointerLeave.set(r, d), r.addEventListener("removed", () => {
380
+ r.traverse((p) => {
381
+ t(p);
382
+ }), t(r);
383
+ });
384
+ }, a = V(
385
+ () => ut(
386
+ Object.values(e).map((r) => Array.from(r.keys())).flat(),
387
+ ({ uuid: r }) => r
388
+ )
389
+ ), { onClick: o, onPointerMove: i } = dt(a);
390
+ o(({ intersects: r, event: s }) => {
391
+ var c;
392
+ r.length && ((c = e.click.get(r[0].object)) == null || c(r[0], s));
393
+ });
394
+ let u;
395
+ return i(({ intersects: r, event: s }) => {
396
+ var y, h, v, M;
397
+ const c = (y = r == null ? void 0 : r[0]) == null ? void 0 : y.object, { pointerLeave: l, pointerEnter: d, pointerMove: p } = e;
398
+ u && u !== c && ((h = l.get(u)) == null || h(u, s)), c && (u !== c && ((v = d.get(c)) == null || v(r[0], s)), (M = p.get(c)) == null || M(r[0], s)), u = c || null;
399
+ }), {
400
+ registerObject: n,
401
+ deregisterObject: t
402
+ };
403
+ }, H = {
333
404
  GEOMETRY_VIA_PROP: "tres__geometryViaProp",
334
- MATERIAL_VIA_PROP: "tres__materialViaProp"
335
- }, { logError: ce } = F();
336
- let ue = !0;
337
- const pt = {
338
- createElement(e, t, o, a) {
339
- var s, u;
405
+ MATERIAL_VIA_PROP: "tres__materialViaProp",
406
+ REGISTER_AT_POINTER_EVENT_HANDLER: "tres__registerAtPointerEventHandler"
407
+ };
408
+ let $ = null, T = null;
409
+ const { logError: ie } = O(), mt = {
410
+ createElement(e, t, n, a) {
411
+ var s, c;
340
412
  if (a || (a = {}), a.args || (a.args = []), e === "template" || st(e))
341
413
  return null;
342
- let n = e.replace("Tres", ""), r;
414
+ let o = e.replace("Tres", ""), i;
343
415
  if (e === "primitive") {
344
- (a == null ? void 0 : a.object) === void 0 && ce("Tres primitives need a prop 'object'");
416
+ (a == null ? void 0 : a.object) === void 0 && ie("Tres primitives need a prop 'object'");
345
417
  const l = a.object;
346
- n = l.type, r = Object.assign(l, { type: n, attach: a.attach, primitive: !0 });
418
+ o = l.type, i = Object.assign(l, { type: o, attach: a.attach, primitive: !0 });
347
419
  } else {
348
- const l = Ce.value[n];
349
- l || ce(`${n} is not defined on the THREE namespace. Use extend to add it to the catalog.`), r = new l(...a.args);
350
- }
351
- if (r.isCamera && ue) {
352
- a != null && a.position || r.position.set(3, 3, 3), a != null && a.lookAt || r.lookAt(0, 0, 0);
353
- const { setFirstCamera: l } = xe();
354
- l(r), ue = !1;
420
+ const l = me.value[o];
421
+ l || ie(`${o} is not defined on the THREE namespace. Use extend to add it to the catalog.`), i = new l(...a.args);
355
422
  }
356
- (a == null ? void 0 : a.attach) === void 0 && (r.isMaterial ? r.attach = "material" : r.isBufferGeometry && (r.attach = "geometry"));
357
- const { GEOMETRY_VIA_PROP: c, MATERIAL_VIA_PROP: i } = se;
358
- return r.isObject3D && ((s = a == null ? void 0 : a.material) != null && s.isMaterial && (r.userData[i] = !0), (u = a == null ? void 0 : a.geometry) != null && u.isBufferGeometry && (r.userData[c] = !0)), r.events = {}, r;
423
+ 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"));
424
+ const { GEOMETRY_VIA_PROP: u, MATERIAL_VIA_PROP: r } = H;
425
+ return i.isObject3D && ((s = a == null ? void 0 : a.material) != null && s.isMaterial && (i.userData[r] = !0), (c = a == null ? void 0 : a.geometry) != null && c.isBufferGeometry && (i.userData[u] = !0)), i;
359
426
  },
360
427
  insert(e, t) {
361
- var o, a, n, r, c;
362
- if (t && t.isScene && (ie = t), (((o = e == null ? void 0 : e.__vnode) == null ? void 0 : o.type) === "TresGroup" || ((a = e == null ? void 0 : e.__vnode) == null ? void 0 : a.type) === "TresObject3D") && t === null && !((r = (n = e == null ? void 0 : e.__vnode) == null ? void 0 : n.ctx) != null && r.asyncResolved)) {
363
- J = e;
428
+ var n, a, o, i, u, r, s;
429
+ if (t && t.isScene && (T = t), (((n = e == null ? void 0 : e.__vnode) == null ? void 0 : n.type) === "TresGroup" || ((a = e == null ? void 0 : e.__vnode) == null ? void 0 : a.type) === "TresObject3D") && t === null && !((i = (o = e == null ? void 0 : e.__vnode) == null ? void 0 : o.ctx) != null && i.asyncResolved)) {
430
+ $ = e;
364
431
  return;
365
432
  } else
366
- (c = e == null ? void 0 : e.__vnode) != null && c.type.includes("Controls") && t === null && (J = ie);
367
- t || (t = J), e != null && e.isObject3D && (t != null && t.isObject3D) ? (t.add(e), e.dispatchEvent({ type: "added" })) : e != null && e.isFog ? t.fog = e : typeof (e == null ? void 0 : e.attach) == "string" && (e.__previousAttach = e[t == null ? void 0 : t.attach], t && (t[e.attach] = e));
433
+ (u = e == null ? void 0 : e.__vnode) != null && u.type.includes("Controls") && t === null && ($ = T);
434
+ t || (t = $), e != null && e.isObject3D && (t != null && t.isObject3D) ? (t.add(e), e.dispatchEvent({ type: "added" }), (s = (r = T == null ? void 0 : T.userData) == null ? void 0 : r[H.REGISTER_AT_POINTER_EVENT_HANDLER]) == null || s.call(r, e)) : e != null && e.isFog ? t.fog = e : typeof (e == null ? void 0 : e.attach) == "string" && (e.__previousAttach = e[t == null ? void 0 : t.attach], t && (t[e.attach] = e));
368
435
  },
369
436
  remove(e) {
370
- var t, o;
437
+ var t, n;
371
438
  if (e) {
372
439
  if (e.isObject3D) {
373
- const a = e, n = (r) => {
374
- var s, u;
375
- const { GEOMETRY_VIA_PROP: c, MATERIAL_VIA_PROP: i } = se;
376
- r.userData[i] || (s = r.material) == null || s.dispose(), r.userData[c] || (u = r.geometry) == null || u.dispose();
440
+ const a = e, o = (i) => {
441
+ var s, c;
442
+ const { GEOMETRY_VIA_PROP: u, MATERIAL_VIA_PROP: r } = H;
443
+ i.userData[r] || (s = i.material) == null || s.dispose(), i.userData[u] || (c = i.geometry) == null || c.dispose();
377
444
  };
378
- a.traverse((r) => n(r)), n(a);
445
+ a.traverse((i) => {
446
+ o(i);
447
+ }), o(a);
379
448
  }
380
- (t = e.removeFromParent) == null || t.call(e), (o = e.dispose) == null || o.call(e);
449
+ (t = e.removeFromParent) == null || t.call(e), (n = e.dispose) == null || n.call(e);
381
450
  }
382
451
  },
383
- patchProp(e, t, o, a) {
452
+ patchProp(e, t, n, a) {
384
453
  if (e) {
385
- let n = e, r = t, c = V(r), i = n == null ? void 0 : n[c];
386
- if (n.type === "BufferGeometry") {
387
- if (r === "args")
454
+ let o = e, i = t, u = j(i), r = o == null ? void 0 : o[u];
455
+ if (o.type === "BufferGeometry") {
456
+ if (i === "args")
388
457
  return;
389
- n.setAttribute(
390
- V(r),
391
- new $e(...a)
458
+ o.setAttribute(
459
+ j(i),
460
+ new We(...a)
392
461
  );
393
462
  return;
394
463
  }
395
- if (r.includes("-") && i === void 0) {
396
- const u = r.split("-");
397
- i = u.reduce((l, d) => l[V(d)], n), r = u.pop(), c = r.toLowerCase(), i != null && i.set || (n = u.reduce((l, d) => l[V(d)], n));
398
- }
399
- if (mt(r)) {
400
- const u = r;
401
- e.events[u] = a;
464
+ if (i.includes("-") && r === void 0) {
465
+ const c = i.split("-");
466
+ r = c.reduce((l, d) => l[j(d)], o), i = c.pop(), u = i.toLowerCase(), r != null && r.set || (o = c.reduce((l, d) => l[j(d)], o));
402
467
  }
403
468
  let s = a;
404
- if (s === "" && (s = !0), re(i)) {
405
- Array.isArray(s) ? e[c](...s) : e[c](s);
469
+ if (s === "" && (s = !0), re(r)) {
470
+ Array.isArray(s) ? e[u](...s) : e[u](s);
406
471
  return;
407
472
  }
408
- !(i != null && i.set) && !re(i) ? n[c] = s : i.constructor === s.constructor && (i != null && i.copy) ? i == null || i.copy(s) : Array.isArray(s) ? i.set(...s) : !i.isColor && i.setScalar ? i.setScalar(s) : i.set(s);
473
+ !(r != null && r.set) && !re(r) ? o[u] = s : r.constructor === s.constructor && (r != null && r.copy) ? r == null || r.copy(s) : Array.isArray(s) ? r.set(...s) : !r.isColor && r.setScalar ? r.setScalar(s) : r.set(s);
409
474
  }
410
475
  },
411
476
  parentNode(e) {
@@ -420,15 +485,15 @@ const pt = {
420
485
  setScopeId: () => void 0,
421
486
  cloneNode: () => void 0,
422
487
  insertStaticContent: () => void 0
423
- }, { createApp: vt } = ke(pt), gt = (e) => {
424
- const t = vt(o);
425
- function o() {
488
+ }, { createApp: vt } = Oe(mt), gt = (e) => {
489
+ const t = vt(n);
490
+ function n() {
426
491
  return e && e.default ? e.default() : [];
427
492
  }
428
493
  return t;
429
494
  };
430
- Me(be);
431
- const { logWarning: fe } = F(), wt = we({
495
+ ve(q);
496
+ const { logWarning: se } = O(), wt = de({
432
497
  name: "TresScene",
433
498
  props: [
434
499
  "shadows",
@@ -447,57 +512,54 @@ const { logWarning: fe } = F(), wt = we({
447
512
  "disableRender",
448
513
  "camera"
449
514
  ],
450
- setup(e, { slots: t, expose: o }) {
451
- e.physicallyCorrectLights === !0 && fe("physicallyCorrectLights is deprecated, useLegacyLights is now false by default");
452
- const a = E(), n = E(), r = new be.Scene(), { setState: c } = B();
453
- c("scene", r), c("canvas", n), c("container", a);
454
- const i = E(), s = t && t.default && t.default();
455
- s && (s == null ? void 0 : s.length) > 0 && (i.value = s.some((w) => Xe(w.type) && w.type.includes("Camera")) || e.camera, i.value || fe("No camera found in the scene, please add one!"));
456
- const { onLoop: u, resume: l } = Pe();
457
- je(() => {
458
- M();
459
- }), ge(() => {
460
- c("renderer", null);
515
+ setup(e, { slots: t, expose: n }) {
516
+ e.physicallyCorrectLights === !0 && se("physicallyCorrectLights is deprecated, useLegacyLights is now false by default");
517
+ const a = G(), o = G(), i = new q.Scene(), u = pt(), { setState: r } = S();
518
+ i.userData[H.REGISTER_AT_POINTER_EVENT_HANDLER] = u.registerObject, r("scene", i), r("canvas", o), r("container", a), r("pointerEventHandler", u);
519
+ const { onLoop: s, resume: c } = he();
520
+ ke(() => {
521
+ h();
522
+ }), le(() => {
523
+ r("renderer", null);
461
524
  });
462
- const { activeCamera: d, pushCamera: v, clearCameras: C } = xe();
463
- function M() {
464
- const { renderer: w } = ut(e);
465
- e.camera && v(e.camera);
466
- const { raycaster: x, pointer: $ } = lt();
467
- let y = null, m = null;
468
- pe(() => {
469
- d.value && x.value.setFromCamera($.value, d.value);
470
- }), u(() => {
471
- var R, g, h, O, k, S, z, j, T, G;
472
- if (d.value && e.disableRender !== !0 && ((R = w.value) == null || R.render(r, d.value)), x.value) {
473
- const L = x.value.intersectObjects(r.children);
474
- L.length > 0 ? (m = L[0], y === null && ((O = (h = (g = m.object) == null ? void 0 : g.events) == null ? void 0 : h.onPointerEnter) == null || O.call(h, m)), (z = (S = (k = m.object) == null ? void 0 : k.events) == null ? void 0 : S.onPointerMove) == null || z.call(S, m)) : y !== null && ((G = (T = (j = m == null ? void 0 : m.object) == null ? void 0 : j.events) == null ? void 0 : T.onPointerLeave) == null || G.call(T, y), m = null), y = m;
475
- }
476
- }), Je(n.value, "click", () => {
477
- var R, g, h;
478
- m !== null && ((h = (g = (R = m.object) == null ? void 0 : R.events) == null ? void 0 : g.onClick) == null || h.call(g, m));
525
+ const { activeCamera: l, pushCamera: d, clearCameras: p } = tt();
526
+ function y() {
527
+ const w = i.getObjectByProperty("isCamera", !0);
528
+ if (w)
529
+ d(w);
530
+ else {
531
+ se("No camera found. Creating a default perspective camera. To have full control over a camera, please add one to the scene.");
532
+ const E = new q.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 1e3);
533
+ E.position.set(3, 3, 3), E.lookAt(0, 0, 0), d(E);
534
+ }
535
+ }
536
+ function h() {
537
+ const { renderer: w } = ft(e);
538
+ e.camera && d(e.camera), s(() => {
539
+ var E;
540
+ l.value && e.disableRender !== !0 && ((E = w.value) == null || E.render(i, l.value));
479
541
  });
480
542
  }
481
- let b;
482
- function P() {
483
- b = gt(t);
484
- const w = B();
485
- b.provide("useTres", w), b.provide(Q, w), b.provide("extend", Me), b.mount(r);
543
+ let v;
544
+ function M() {
545
+ v = gt(t);
546
+ const w = S();
547
+ v.provide("useTres", w), v.provide(K, w), v.provide("extend", ve), v.mount(i), y();
486
548
  }
487
- return P(), o({
488
- scene: r
489
- }), H(
549
+ return M(), n({
550
+ scene: i
551
+ }), D(
490
552
  () => e.camera,
491
553
  (w) => {
492
- w && (C(), v(w));
554
+ w && (p(), d(w));
493
555
  }
494
- ), () => D(
495
- D(
556
+ ), () => L(
557
+ L(
496
558
  "div",
497
559
  {
498
560
  ref: a,
499
- "data-scene": r.uuid,
500
- key: r.uuid,
561
+ "data-scene": i.uuid,
562
+ key: i.uuid,
501
563
  style: {
502
564
  position: "relative",
503
565
  width: "100%",
@@ -507,7 +569,7 @@ const { logWarning: fe } = F(), wt = we({
507
569
  }
508
570
  },
509
571
  [
510
- D(
572
+ L(
511
573
  "div",
512
574
  {
513
575
  style: {
@@ -516,9 +578,9 @@ const { logWarning: fe } = F(), wt = we({
516
578
  }
517
579
  },
518
580
  [
519
- D("canvas", {
520
- ref: n,
521
- "data-scene": r.uuid,
581
+ L("canvas", {
582
+ ref: o,
583
+ "data-scene": i.uuid,
522
584
  style: {
523
585
  display: "block",
524
586
  width: "100%",
@@ -534,7 +596,7 @@ const { logWarning: fe } = F(), wt = we({
534
596
  )
535
597
  );
536
598
  }
537
- }), bt = we({
599
+ }), bt = de({
538
600
  name: "TresCanvas",
539
601
  props: [
540
602
  "shadows",
@@ -553,32 +615,33 @@ const { logWarning: fe } = F(), wt = we({
553
615
  "disableRender",
554
616
  "camera"
555
617
  ],
556
- setup(e, { slots: t, expose: o }) {
557
- const a = Ze();
558
- return o(a), () => D(wt, e, t);
618
+ setup(e, { slots: t, expose: n }) {
619
+ const a = Qe();
620
+ return n(a), () => L(wt, e, t);
559
621
  }
560
- }), Pt = {
622
+ }), xt = {
561
623
  install(e) {
562
624
  e.component("TresCanvas", bt);
563
625
  }
564
626
  };
565
627
  export {
566
- et as CameraType,
567
- Q as TRES_CONTEXT_KEY,
628
+ Ze as CameraType,
629
+ K as TRES_CONTEXT_KEY,
568
630
  bt as TresCanvas,
569
- Ce as catalogue,
570
- Pt as default,
571
- Me as extend,
631
+ me as catalogue,
632
+ xt as default,
633
+ ve as extend,
572
634
  Mt as isProd,
573
- ft as trasverseObjects,
574
- xe as useCamera,
575
- xt as useLoader,
576
- F as useLogger,
577
- lt as useRaycaster,
578
- Pe as useRenderLoop,
579
- ut as useRenderer,
580
- Et as useSeek,
581
- Rt as useTexture,
582
- B as useTres,
583
- Ze as useTresProvider
635
+ lt as trasverseObjects,
636
+ tt as useCamera,
637
+ Pt as useLoader,
638
+ O as useLogger,
639
+ pt as usePointerEventHandler,
640
+ dt as useRaycaster,
641
+ he as useRenderLoop,
642
+ ft as useRenderer,
643
+ Rt as useSeek,
644
+ Ct as useTexture,
645
+ S as useTres,
646
+ Qe as useTresProvider
584
647
  };