@tresjs/core 0.2.0 → 0.2.1

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,6 +1,6 @@
1
1
  /**
2
2
  * name: @tresjs/core
3
- * version: v0.2.0
3
+ * version: v0.2.1
4
4
  * (c) 2022
5
5
  * description: Declarative ThreeJS using Vue Components
6
6
  * author: Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)
@@ -41,7 +41,7 @@ function jr() {
41
41
  };
42
42
  Me = new Ar(L, C.value, j, U), _n.cameras.push(Me);
43
43
  } else {
44
- const { left: j, right: U, top: L, bottom: R, near: ht, far: P } = N || {
44
+ const { left: j, right: U, top: L, bottom: R, near: ht, far: E } = N || {
45
45
  left: -100,
46
46
  right: 100,
47
47
  top: 100,
@@ -49,7 +49,7 @@ function jr() {
49
49
  near: 0.1,
50
50
  far: 1e3
51
51
  };
52
- Me = new Xa(j, U, L, R, ht, P), _n.cameras.push(Me);
52
+ Me = new Xa(j, U, L, R, ht, E), _n.cameras.push(Me);
53
53
  }
54
54
  return _n.cameras.push(Me), Me;
55
55
  }
@@ -130,32 +130,32 @@ function cl() {
130
130
  });
131
131
  let L;
132
132
  const { scene: R } = oi(), { pushCamera: ht } = jr();
133
- function P() {
133
+ function E() {
134
134
  if ((N == null ? void 0 : N.default) && (N == null ? void 0 : N.default())) {
135
- const q = N.default().map((E) => {
135
+ const q = N.default().map((P) => {
136
136
  var x;
137
137
  let J;
138
- return (x = E == null ? void 0 : E.props) != null && x.args ? J = new b[E.type.name](...E.props.args) : J = new b[E.type.name](), E != null && E.props && B(E.props, J), J;
138
+ return (x = P == null ? void 0 : P.props) != null && x.args ? J = new b[P.type.name](...P.props.args) : J = new b[P.type.name](), P != null && P.props && B(P.props, J), J;
139
139
  });
140
140
  L = new M(...q);
141
141
  } else
142
142
  j.args ? L = new M(...j.args) : L = new M();
143
143
  B(j, L), w === "PerspectiveCamera" || w === "OrtographicCamera" ? ht(L) : R == null || R.add(L), _("Instance added", R), U.expose(L);
144
144
  }
145
- function B(q, E) {
145
+ function B(q, P) {
146
146
  Object.entries(q).forEach(([J, x]) => {
147
147
  const tt = J.replace(/(-\w)/g, (Jt) => Jt[1].toUpperCase());
148
148
  if (!(tt === "args" || x === void 0)) {
149
149
  pl.includes(J) && x && (x = Bs(x));
150
150
  try {
151
- E[tt] && al(E[tt].set) ? Os(x) ? E[tt].set(...x) : E[tt].set(x) : (x === "" && (x = !0), E[tt] = x);
151
+ P[tt] && al(P[tt].set) ? Os(x) ? P[tt].set(...x) : P[tt].set(x) : (x === "" && (x = !0), P[tt] = x);
152
152
  } catch (Jt) {
153
153
  y(`There was an error setting ${tt} property`, Jt);
154
154
  }
155
155
  }
156
- }), q.ref && (q.ref = E);
156
+ }), q.ref && (q.ref = P);
157
157
  }
158
- return P(), () => {
158
+ return E(), () => {
159
159
  };
160
160
  }
161
161
  });
@@ -184,7 +184,7 @@ function ul() {
184
184
  const b = new Za(), _ = ri(b);
185
185
  return { loadingManager: b, loadingManagerRef: _ };
186
186
  }
187
- async function wl(b) {
187
+ async function gl(b) {
188
188
  const { loadingManager: _ } = ul(), y = new tl(_), C = (w) => new Promise((M, A) => {
189
189
  y.load(
190
190
  w,
@@ -316,21 +316,21 @@ var Br = { exports: {} };
316
316
  propertynotfound: (n) => `Property '${n.name}' not found`,
317
317
  shouldneverhappen: () => "This error should never happen"
318
318
  };
319
- class P {
319
+ class E {
320
320
  constructor(t) {
321
321
  var e;
322
322
  this.message = (e = ht[t.type](t.context)) !== null && e !== void 0 ? e : "Unexpected error", this.name = this.constructor.name, this.stack = new Error(this.message).stack, this.type = t.type;
323
323
  }
324
324
  static alreadyDisposed() {
325
- return new P({ type: "alreadydisposed" });
325
+ return new E({ type: "alreadydisposed" });
326
326
  }
327
327
  static notBindable() {
328
- return new P({
328
+ return new E({
329
329
  type: "notbindable"
330
330
  });
331
331
  }
332
332
  static propertyNotFound(t) {
333
- return new P({
333
+ return new E({
334
334
  type: "propertynotfound",
335
335
  context: {
336
336
  name: t
@@ -338,7 +338,7 @@ var Br = { exports: {} };
338
338
  });
339
339
  }
340
340
  static shouldNeverHappen() {
341
- return new P({ type: "shouldneverhappen" });
341
+ return new E({ type: "shouldneverhappen" });
342
342
  }
343
343
  }
344
344
  class B {
@@ -363,9 +363,9 @@ var Br = { exports: {} };
363
363
  writeProperty(t, e) {
364
364
  const r = this.read();
365
365
  if (!B.isBindable(r))
366
- throw P.notBindable();
366
+ throw E.notBindable();
367
367
  if (!(t in r))
368
- throw P.propertyNotFound(t);
368
+ throw E.propertyNotFound(t);
369
369
  r[t] = e;
370
370
  }
371
371
  }
@@ -390,7 +390,7 @@ var Br = { exports: {} };
390
390
  }), this;
391
391
  }
392
392
  }
393
- class E {
393
+ class P {
394
394
  constructor() {
395
395
  this.observers_ = {};
396
396
  }
@@ -459,7 +459,7 @@ var Br = { exports: {} };
459
459
  }
460
460
  class xn {
461
461
  constructor(t, e) {
462
- this.emitter = new E(), this.onClick_ = this.onClick_.bind(this), this.props = e.props, this.viewProps = e.viewProps, this.view = new li(t, {
462
+ this.emitter = new P(), this.onClick_ = this.onClick_.bind(this), this.props = e.props, this.viewProps = e.viewProps, this.view = new li(t, {
463
463
  props: this.props,
464
464
  viewProps: this.viewProps
465
465
  }), this.view.buttonElement.addEventListener("click", this.onClick_);
@@ -473,7 +473,7 @@ var Br = { exports: {} };
473
473
  class vt {
474
474
  constructor(t, e) {
475
475
  var r;
476
- this.constraint_ = e == null ? void 0 : e.constraint, this.equals_ = (r = e == null ? void 0 : e.equals) !== null && r !== void 0 ? r : (l, c) => l === c, this.emitter = new E(), this.rawValue_ = t;
476
+ this.constraint_ = e == null ? void 0 : e.constraint, this.equals_ = (r = e == null ? void 0 : e.equals) !== null && r !== void 0 ? r : (l, c) => l === c, this.emitter = new P(), this.rawValue_ = t;
477
477
  }
478
478
  get constraint() {
479
479
  return this.constraint_;
@@ -503,7 +503,7 @@ var Br = { exports: {} };
503
503
  }
504
504
  class Cn {
505
505
  constructor(t) {
506
- this.emitter = new E(), this.value_ = t;
506
+ this.emitter = new P(), this.value_ = t;
507
507
  }
508
508
  get rawValue() {
509
509
  return this.value_;
@@ -534,7 +534,7 @@ var Br = { exports: {} };
534
534
  }
535
535
  class k {
536
536
  constructor(t) {
537
- this.emitter = new E(), this.valMap_ = t;
537
+ this.emitter = new P(), this.valMap_ = t;
538
538
  for (const e in this.valMap_)
539
539
  this.valMap_[e].emitter.on("change", () => {
540
540
  this.emitter.emit("change", {
@@ -850,7 +850,7 @@ var Br = { exports: {} };
850
850
  }
851
851
  class Fe {
852
852
  constructor(t) {
853
- this.emitter = new E(), this.items_ = [], this.cache_ = /* @__PURE__ */ new Set(), this.onSubListAdd_ = this.onSubListAdd_.bind(this), this.onSubListRemove_ = this.onSubListRemove_.bind(this), this.extract_ = t;
853
+ this.emitter = new P(), this.items_ = [], this.cache_ = /* @__PURE__ */ new Set(), this.onSubListAdd_ = this.onSubListAdd_.bind(this), this.onSubListRemove_ = this.onSubListRemove_.bind(this), this.extract_ = t;
854
854
  }
855
855
  get items() {
856
856
  return this.items_;
@@ -869,7 +869,7 @@ var Br = { exports: {} };
869
869
  }
870
870
  add(t, e) {
871
871
  if (this.includes(t))
872
- throw P.shouldNeverHappen();
872
+ throw E.shouldNeverHappen();
873
873
  const r = e !== void 0 ? e : this.items_.length;
874
874
  this.items_.splice(r, 0, t), this.cache_.add(t);
875
875
  const l = this.extract_(t);
@@ -914,7 +914,7 @@ var Br = { exports: {} };
914
914
  }
915
915
  class Ke extends w {
916
916
  constructor(t) {
917
- super(t), this.onBindingChange_ = this.onBindingChange_.bind(this), this.emitter_ = new E(), this.controller_.binding.emitter.on("change", this.onBindingChange_);
917
+ super(t), this.onBindingChange_ = this.onBindingChange_.bind(this), this.emitter_ = new P(), this.controller_.binding.emitter.on("change", this.onBindingChange_);
918
918
  }
919
919
  get label() {
920
920
  return this.controller_.props.get("label");
@@ -945,7 +945,7 @@ var Br = { exports: {} };
945
945
  }
946
946
  class St extends w {
947
947
  constructor(t) {
948
- super(t), this.onBindingUpdate_ = this.onBindingUpdate_.bind(this), this.emitter_ = new E(), this.controller_.binding.emitter.on("update", this.onBindingUpdate_);
948
+ super(t), this.onBindingUpdate_ = this.onBindingUpdate_.bind(this), this.emitter_ = new P(), this.controller_.binding.emitter.on("update", this.onBindingUpdate_);
949
949
  }
950
950
  get label() {
951
951
  return this.controller_.props.get("label");
@@ -982,17 +982,17 @@ var Br = { exports: {} };
982
982
  function ie(n, t) {
983
983
  const e = n.find((r) => r.controller_ === t);
984
984
  if (!e)
985
- throw P.shouldNeverHappen();
985
+ throw E.shouldNeverHappen();
986
986
  return e;
987
987
  }
988
988
  function fe(n, t, e) {
989
989
  if (!B.isBindable(n))
990
- throw P.notBindable();
990
+ throw E.notBindable();
991
991
  return new B(n, t, e);
992
992
  }
993
993
  class re extends w {
994
994
  constructor(t, e) {
995
- super(t), this.onRackAdd_ = this.onRackAdd_.bind(this), this.onRackRemove_ = this.onRackRemove_.bind(this), this.onRackInputChange_ = this.onRackInputChange_.bind(this), this.onRackMonitorUpdate_ = this.onRackMonitorUpdate_.bind(this), this.emitter_ = new E(), this.apiSet_ = new Fe(ne), this.pool_ = e;
995
+ super(t), this.onRackAdd_ = this.onRackAdd_.bind(this), this.onRackRemove_ = this.onRackRemove_.bind(this), this.onRackInputChange_ = this.onRackInputChange_.bind(this), this.onRackMonitorUpdate_ = this.onRackMonitorUpdate_.bind(this), this.emitter_ = new P(), this.apiSet_ = new Fe(ne), this.pool_ = e;
996
996
  const r = this.controller_.rack;
997
997
  r.emitter.on("add", this.onRackAdd_), r.emitter.on("remove", this.onRackRemove_), r.emitter.on("inputchange", this.onRackInputChange_), r.emitter.on("monitorupdate", this.onRackMonitorUpdate_), r.children.forEach((l) => {
998
998
  this.setUpApi_(l);
@@ -1067,7 +1067,7 @@ var Br = { exports: {} };
1067
1067
  }
1068
1068
  onRackMonitorUpdate_(t) {
1069
1069
  if (!(t.bladeController instanceof yt))
1070
- throw P.shouldNeverHappen();
1070
+ throw E.shouldNeverHappen();
1071
1071
  const e = ie(this.apiSet_, t.bladeController), r = t.bladeController.binding;
1072
1072
  this.emitter_.emit("update", {
1073
1073
  event: new S(e, r.target.read(), r.target.presetKey)
@@ -1076,7 +1076,7 @@ var Br = { exports: {} };
1076
1076
  }
1077
1077
  class $e extends je {
1078
1078
  constructor(t, e) {
1079
- super(t, new re(t.rackController, e)), this.emitter_ = new E(), this.controller_.foldable.value("expanded").emitter.on("change", (r) => {
1079
+ super(t, new re(t.rackController, e)), this.emitter_ = new P(), this.controller_.foldable.value("expanded").emitter.on("change", (r) => {
1080
1080
  this.emitter_.emit("fold", {
1081
1081
  event: new N(this, r.sender.rawValue)
1082
1082
  });
@@ -1188,7 +1188,7 @@ var Br = { exports: {} };
1188
1188
  class Ei {
1189
1189
  constructor(t) {
1190
1190
  var e;
1191
- this.onBladePositionsChange_ = this.onBladePositionsChange_.bind(this), this.onSetAdd_ = this.onSetAdd_.bind(this), this.onSetRemove_ = this.onSetRemove_.bind(this), this.onChildDispose_ = this.onChildDispose_.bind(this), this.onChildPositionsChange_ = this.onChildPositionsChange_.bind(this), this.onChildInputChange_ = this.onChildInputChange_.bind(this), this.onChildMonitorUpdate_ = this.onChildMonitorUpdate_.bind(this), this.onChildValueChange_ = this.onChildValueChange_.bind(this), this.onChildViewPropsChange_ = this.onChildViewPropsChange_.bind(this), this.onDescendantLayout_ = this.onDescendantLayout_.bind(this), this.onDescendantInputChange_ = this.onDescendantInputChange_.bind(this), this.onDescendantMonitorUpdate_ = this.onDescendantMonitorUpdate_.bind(this), this.emitter = new E(), this.blade_ = t != null ? t : null, (e = this.blade_) === null || e === void 0 || e.value("positions").emitter.on("change", this.onBladePositionsChange_), this.bcSet_ = new Fe(Pi), this.bcSet_.emitter.on("add", this.onSetAdd_), this.bcSet_.emitter.on("remove", this.onSetRemove_);
1191
+ this.onBladePositionsChange_ = this.onBladePositionsChange_.bind(this), this.onSetAdd_ = this.onSetAdd_.bind(this), this.onSetRemove_ = this.onSetRemove_.bind(this), this.onChildDispose_ = this.onChildDispose_.bind(this), this.onChildPositionsChange_ = this.onChildPositionsChange_.bind(this), this.onChildInputChange_ = this.onChildInputChange_.bind(this), this.onChildMonitorUpdate_ = this.onChildMonitorUpdate_.bind(this), this.onChildValueChange_ = this.onChildValueChange_.bind(this), this.onChildViewPropsChange_ = this.onChildViewPropsChange_.bind(this), this.onDescendantLayout_ = this.onDescendantLayout_.bind(this), this.onDescendantInputChange_ = this.onDescendantInputChange_.bind(this), this.onDescendantMonitorUpdate_ = this.onDescendantMonitorUpdate_.bind(this), this.emitter = new P(), this.blade_ = t != null ? t : null, (e = this.blade_) === null || e === void 0 || e.value("positions").emitter.on("change", this.onBladePositionsChange_), this.bcSet_ = new Fe(Pi), this.bcSet_.emitter.on("add", this.onSetAdd_), this.bcSet_.emitter.on("remove", this.onSetRemove_);
1192
1192
  }
1193
1193
  get children() {
1194
1194
  return this.bcSet_.items;
@@ -1276,7 +1276,7 @@ var Br = { exports: {} };
1276
1276
  onChildInputChange_(t) {
1277
1277
  const e = xi(this.find(st), t.sender);
1278
1278
  if (!e)
1279
- throw P.shouldNeverHappen();
1279
+ throw E.shouldNeverHappen();
1280
1280
  this.emitter.emit("inputchange", {
1281
1281
  bladeController: e,
1282
1282
  options: t.options,
@@ -1286,7 +1286,7 @@ var Br = { exports: {} };
1286
1286
  onChildMonitorUpdate_(t) {
1287
1287
  const e = Ci(this.find(yt), t.sender);
1288
1288
  if (!e)
1289
- throw P.shouldNeverHappen();
1289
+ throw E.shouldNeverHappen();
1290
1290
  this.emitter.emit("monitorupdate", {
1291
1291
  bladeController: e,
1292
1292
  sender: this
@@ -1295,7 +1295,7 @@ var Br = { exports: {} };
1295
1295
  onChildValueChange_(t) {
1296
1296
  const e = yi(this.find(bt), t.sender);
1297
1297
  if (!e)
1298
- throw P.shouldNeverHappen();
1298
+ throw E.shouldNeverHappen();
1299
1299
  this.emitter.emit("inputchange", {
1300
1300
  bladeController: e,
1301
1301
  options: t.options,
@@ -1506,7 +1506,7 @@ var Br = { exports: {} };
1506
1506
  }
1507
1507
  class _e {
1508
1508
  constructor(t, e) {
1509
- this.emitter = new E(), this.onClick_ = this.onClick_.bind(this), this.props = e.props, this.viewProps = e.viewProps, this.view = new Mi(t, {
1509
+ this.emitter = new P(), this.onClick_ = this.onClick_.bind(this), this.props = e.props, this.viewProps = e.viewProps, this.view = new Mi(t, {
1510
1510
  props: e.props,
1511
1511
  viewProps: e.viewProps
1512
1512
  }), this.view.buttonElement.addEventListener("click", this.onClick_);
@@ -1589,7 +1589,7 @@ var Br = { exports: {} };
1589
1589
  }
1590
1590
  class Dn extends je {
1591
1591
  constructor(t, e) {
1592
- super(t, new re(t.rackController, e)), this.onPageAdd_ = this.onPageAdd_.bind(this), this.onPageRemove_ = this.onPageRemove_.bind(this), this.onSelect_ = this.onSelect_.bind(this), this.emitter_ = new E(), this.pageApiMap_ = /* @__PURE__ */ new Map(), this.rackApi_.on("change", (r) => {
1592
+ super(t, new re(t.rackController, e)), this.onPageAdd_ = this.onPageAdd_.bind(this), this.onPageRemove_ = this.onPageRemove_.bind(this), this.onSelect_ = this.onSelect_.bind(this), this.emitter_ = new P(), this.pageApiMap_ = /* @__PURE__ */ new Map(), this.rackApi_.on("change", (r) => {
1593
1593
  this.emitter_.emit("change", {
1594
1594
  event: r
1595
1595
  });
@@ -1605,7 +1605,7 @@ var Br = { exports: {} };
1605
1605
  return this.controller_.pageSet.items.map((t) => {
1606
1606
  const e = this.pageApiMap_.get(t);
1607
1607
  if (!e)
1608
- throw P.shouldNeverHappen();
1608
+ throw E.shouldNeverHappen();
1609
1609
  return e;
1610
1610
  });
1611
1611
  }
@@ -1622,7 +1622,7 @@ var Br = { exports: {} };
1622
1622
  this.controller_.add(r, t.index);
1623
1623
  const l = this.pageApiMap_.get(r);
1624
1624
  if (!l)
1625
- throw P.shouldNeverHappen();
1625
+ throw E.shouldNeverHappen();
1626
1626
  return l;
1627
1627
  }
1628
1628
  removePage(t) {
@@ -1637,7 +1637,7 @@ var Br = { exports: {} };
1637
1637
  setUpPageApi_(t) {
1638
1638
  const e = this.rackApi_.apiSet_.find((l) => l.controller_ === t.contentController);
1639
1639
  if (!e)
1640
- throw P.shouldNeverHappen();
1640
+ throw E.shouldNeverHappen();
1641
1641
  const r = new Ye(t, e);
1642
1642
  this.pageApiMap_.set(t, r);
1643
1643
  }
@@ -1646,7 +1646,7 @@ var Br = { exports: {} };
1646
1646
  }
1647
1647
  onPageRemove_(t) {
1648
1648
  if (!this.pageApiMap_.get(t.item))
1649
- throw P.shouldNeverHappen();
1649
+ throw E.shouldNeverHappen();
1650
1650
  this.pageApiMap_.delete(t.item);
1651
1651
  }
1652
1652
  onSelect_(t) {
@@ -1783,7 +1783,7 @@ var Br = { exports: {} };
1783
1783
  }
1784
1784
  class On {
1785
1785
  constructor() {
1786
- this.disabled = !1, this.emitter = new E();
1786
+ this.disabled = !1, this.emitter = new P();
1787
1787
  }
1788
1788
  dispose() {
1789
1789
  }
@@ -1795,7 +1795,7 @@ var Br = { exports: {} };
1795
1795
  }
1796
1796
  class We {
1797
1797
  constructor(t, e) {
1798
- this.disabled_ = !1, this.timerId_ = null, this.onTick_ = this.onTick_.bind(this), this.doc_ = t, this.emitter = new E(), this.interval_ = e, this.setTimer_();
1798
+ this.disabled_ = !1, this.timerId_ = null, this.onTick_ = this.onTick_.bind(this), this.doc_ = t, this.emitter = new P(), this.interval_ = e, this.setTimer_();
1799
1799
  }
1800
1800
  get disabled() {
1801
1801
  return this.disabled_;
@@ -2329,7 +2329,7 @@ var Br = { exports: {} };
2329
2329
  }
2330
2330
  class Tt {
2331
2331
  constructor(t) {
2332
- this.lastTouch_ = null, this.onDocumentMouseMove_ = this.onDocumentMouseMove_.bind(this), this.onDocumentMouseUp_ = this.onDocumentMouseUp_.bind(this), this.onMouseDown_ = this.onMouseDown_.bind(this), this.onTouchEnd_ = this.onTouchEnd_.bind(this), this.onTouchMove_ = this.onTouchMove_.bind(this), this.onTouchStart_ = this.onTouchStart_.bind(this), this.elem_ = t, this.emitter = new E(), t.addEventListener("touchstart", this.onTouchStart_, {
2332
+ this.lastTouch_ = null, this.onDocumentMouseMove_ = this.onDocumentMouseMove_.bind(this), this.onDocumentMouseUp_ = this.onDocumentMouseUp_.bind(this), this.onMouseDown_ = this.onMouseDown_.bind(this), this.onTouchEnd_ = this.onTouchEnd_.bind(this), this.onTouchMove_ = this.onTouchMove_.bind(this), this.onTouchStart_ = this.onTouchStart_.bind(this), this.elem_ = t, this.emitter = new P(), t.addEventListener("touchstart", this.onTouchStart_, {
2333
2333
  passive: !1
2334
2334
  }), t.addEventListener("touchmove", this.onTouchMove_, {
2335
2335
  passive: !0
@@ -3972,20 +3972,20 @@ var Br = { exports: {} };
3972
3972
  writer: (n) => {
3973
3973
  const t = br(n.initialValue, he(n.params));
3974
3974
  if (!t)
3975
- throw P.shouldNeverHappen();
3975
+ throw E.shouldNeverHappen();
3976
3976
  const e = Po(t);
3977
3977
  if (!e)
3978
- throw P.notBindable();
3978
+ throw E.notBindable();
3979
3979
  return e;
3980
3980
  }
3981
3981
  },
3982
3982
  controller: (n) => {
3983
3983
  const t = br(n.initialValue, he(n.params));
3984
3984
  if (!t)
3985
- throw P.shouldNeverHappen();
3985
+ throw E.shouldNeverHappen();
3986
3986
  const e = gr(t);
3987
3987
  if (!e)
3988
- throw P.shouldNeverHappen();
3988
+ throw E.shouldNeverHappen();
3989
3989
  const r = "expanded" in n.params ? n.params.expanded : void 0, l = "picker" in n.params ? n.params.picker : void 0;
3990
3990
  return new Pr(n.document, {
3991
3991
  colorType: t.type,
@@ -4401,7 +4401,7 @@ var Br = { exports: {} };
4401
4401
  controller: (n) => {
4402
4402
  const t = n.document, e = n.value, r = n.constraint;
4403
4403
  if (!(r instanceof Gt))
4404
- throw P.shouldNeverHappen();
4404
+ throw E.shouldNeverHappen();
4405
4405
  const l = "expanded" in n.params ? n.params.expanded : void 0, c = "picker" in n.params ? n.params.picker : void 0;
4406
4406
  return new qo(t, {
4407
4407
  axes: [
@@ -4497,7 +4497,7 @@ var Br = { exports: {} };
4497
4497
  controller: (n) => {
4498
4498
  const t = n.value, e = n.constraint;
4499
4499
  if (!(e instanceof Gt))
4500
- throw P.shouldNeverHappen();
4500
+ throw E.shouldNeverHappen();
4501
4501
  return new kr(n.document, {
4502
4502
  assembly: fs,
4503
4503
  axes: [
@@ -4593,7 +4593,7 @@ var Br = { exports: {} };
4593
4593
  controller: (n) => {
4594
4594
  const t = n.value, e = n.constraint;
4595
4595
  if (!(e instanceof Gt))
4596
- throw P.shouldNeverHappen();
4596
+ throw E.shouldNeverHappen();
4597
4597
  return new kr(n.document, {
4598
4598
  assembly: _s,
4599
4599
  axes: t.rawValue.getComponents().map((r, l) => oa(r, e.components[l])),
@@ -4895,7 +4895,7 @@ var Br = { exports: {} };
4895
4895
  };
4896
4896
  class ga {
4897
4897
  constructor(t) {
4898
- this.onValueChange_ = this.onValueChange_.bind(this), this.reader = t.reader, this.writer = t.writer, this.emitter = new E(), this.value = t.value, this.value.emitter.on("change", this.onValueChange_), this.target = t.target, this.read();
4898
+ this.onValueChange_ = this.onValueChange_.bind(this), this.reader = t.reader, this.writer = t.writer, this.emitter = new P(), this.value = t.value, this.value.emitter.on("change", this.onValueChange_), this.target = t.target, this.read();
4899
4899
  }
4900
4900
  read() {
4901
4901
  const t = this.target.read();
@@ -4950,7 +4950,7 @@ var Br = { exports: {} };
4950
4950
  }
4951
4951
  class xa {
4952
4952
  constructor(t) {
4953
- this.onTick_ = this.onTick_.bind(this), this.reader_ = t.reader, this.target = t.target, this.emitter = new E(), this.value = t.value, this.ticker = t.ticker, this.ticker.emitter.on("tick", this.onTick_), this.read();
4953
+ this.onTick_ = this.onTick_.bind(this), this.reader_ = t.reader, this.target = t.target, this.emitter = new P(), this.value = t.value, this.ticker = t.ticker, this.ticker.emitter.on("tick", this.onTick_), this.read();
4954
4954
  }
4955
4955
  dispose() {
4956
4956
  this.ticker.dispose();
@@ -5025,7 +5025,7 @@ var Br = { exports: {} };
5025
5025
  createInput(t, e, r) {
5026
5026
  const l = e.read();
5027
5027
  if (L(l))
5028
- throw new P({
5028
+ throw new E({
5029
5029
  context: {
5030
5030
  key: e.key
5031
5031
  },
@@ -5038,7 +5038,7 @@ var Br = { exports: {} };
5038
5038
  }), null);
5039
5039
  if (c)
5040
5040
  return c;
5041
- throw new P({
5041
+ throw new E({
5042
5042
  context: {
5043
5043
  key: e.key
5044
5044
  },
@@ -5053,7 +5053,7 @@ var Br = { exports: {} };
5053
5053
  }), null);
5054
5054
  if (l)
5055
5055
  return l;
5056
- throw new P({
5056
+ throw new E({
5057
5057
  context: {
5058
5058
  key: e.key
5059
5059
  },
@@ -5066,7 +5066,7 @@ var Br = { exports: {} };
5066
5066
  params: e
5067
5067
  }), null);
5068
5068
  if (!r)
5069
- throw new P({
5069
+ throw new E({
5070
5070
  type: "nomatchingview",
5071
5071
  context: {
5072
5072
  params: e
@@ -5086,7 +5086,7 @@ var Br = { exports: {} };
5086
5086
  pool: this
5087
5087
  }), null);
5088
5088
  if (!e)
5089
- throw P.shouldNeverHappen();
5089
+ throw E.shouldNeverHappen();
5090
5090
  return e;
5091
5091
  }
5092
5092
  }
@@ -5115,7 +5115,7 @@ var Br = { exports: {} };
5115
5115
  }
5116
5116
  class Cs extends w {
5117
5117
  constructor(t) {
5118
- super(t), this.emitter_ = new E(), this.controller_.valueController.value.emitter.on("change", (e) => {
5118
+ super(t), this.emitter_ = new P(), this.controller_.valueController.value.emitter.on("change", (e) => {
5119
5119
  this.emitter_.emit("change", {
5120
5120
  event: new A(this, e.rawValue)
5121
5121
  });
@@ -5148,7 +5148,7 @@ var Br = { exports: {} };
5148
5148
  }
5149
5149
  class ys extends w {
5150
5150
  constructor(t) {
5151
- super(t), this.emitter_ = new E(), this.controller_.valueController.value.emitter.on("change", (e) => {
5151
+ super(t), this.emitter_ = new P(), this.controller_.valueController.value.emitter.on("change", (e) => {
5152
5152
  this.emitter_.emit("change", {
5153
5153
  event: new A(this, e.rawValue)
5154
5154
  });
@@ -5187,7 +5187,7 @@ var Br = { exports: {} };
5187
5187
  }
5188
5188
  class Ps extends w {
5189
5189
  constructor(t) {
5190
- super(t), this.emitter_ = new E(), this.controller_.valueController.value.emitter.on("change", (e) => {
5190
+ super(t), this.emitter_ = new P(), this.controller_.valueController.value.emitter.on("change", (e) => {
5191
5191
  this.emitter_.emit("change", {
5192
5192
  event: new A(this, e.rawValue)
5193
5193
  });
@@ -5400,13 +5400,13 @@ var Br = { exports: {} };
5400
5400
  }
5401
5401
  get document() {
5402
5402
  if (!this.doc_)
5403
- throw P.alreadyDisposed();
5403
+ throw E.alreadyDisposed();
5404
5404
  return this.doc_;
5405
5405
  }
5406
5406
  dispose() {
5407
5407
  const t = this.containerElem_;
5408
5408
  if (!t)
5409
- throw P.alreadyDisposed();
5409
+ throw E.alreadyDisposed();
5410
5410
  if (this.usesDefaultWrapper_) {
5411
5411
  const e = t.parentElement;
5412
5412
  e && e.removeChild(t);
@@ -5551,21 +5551,21 @@ var si = { exports: {} };
5551
5551
  function ht(o, i) {
5552
5552
  return (s) => i(o(s));
5553
5553
  }
5554
- function P(o) {
5554
+ function E(o) {
5555
5555
  return o.rawValue;
5556
5556
  }
5557
5557
  function B(o, i) {
5558
- o.emitter.on("change", ht(P, i)), i(o.rawValue);
5558
+ o.emitter.on("change", ht(E, i)), i(o.rawValue);
5559
5559
  }
5560
5560
  function q(o, i, s) {
5561
5561
  B(o.value(i), s);
5562
5562
  }
5563
- function E(o, i, s) {
5563
+ function P(o, i, s) {
5564
5564
  s ? o.classList.add(i) : o.classList.remove(i);
5565
5565
  }
5566
5566
  function J(o, i) {
5567
5567
  return (s) => {
5568
- E(o, i, s);
5568
+ P(o, i, s);
5569
5569
  };
5570
5570
  }
5571
5571
  function x(o, i) {
@@ -8019,7 +8019,7 @@ const hl = /* @__PURE__ */ dl(si.exports), vl = /* @__PURE__ */ rl({
8019
8019
  default: hl
8020
8020
  }, [si.exports]);
8021
8021
  let Te, ii;
8022
- const xl = () => {
8022
+ const wl = () => {
8023
8023
  Te = new Br.exports.Pane({
8024
8024
  container: document.getElementById("tres-container") || void 0
8025
8025
  }), Te.registerPlugin(vl), ii = Te.addBlade({
@@ -8064,18 +8064,18 @@ function ml(b, _) {
8064
8064
  canvas: b,
8065
8065
  scene: A
8066
8066
  }), !$ && b.value && A) {
8067
- const P = {
8067
+ const E = {
8068
8068
  canvas: b.value,
8069
8069
  ..._
8070
8070
  };
8071
- _ != null && _.context && (P.context = _.context), $ = new el(P), _ != null && _.shadows && j(), $.physicallyCorrectLights = (_ == null ? void 0 : _.physicallyCorrectLights) || !1, _ != null && _.outputEncoding && ($.outputEncoding = _.outputEncoding), _ != null && _.toneMapping && ($.toneMapping = _.toneMapping, $.toneMappingExposure = 1), U(), $.render(A, S.value), N("renderer", $), Rs = Or(() => {
8071
+ _ != null && _.context && (E.context = _.context), $ = new el(E), _ != null && _.shadows && j(), $.physicallyCorrectLights = (_ == null ? void 0 : _.physicallyCorrectLights) || !1, _ != null && _.outputEncoding && ($.outputEncoding = _.outputEncoding), _ != null && _.toneMapping && ($.toneMapping = _.toneMapping, $.toneMappingExposure = 1), U(), $.render(A, S.value), N("renderer", $), Rs = Or(() => {
8072
8072
  A && $ && $.render(A, S.value);
8073
8073
  }).disposeLoop;
8074
8074
  }
8075
8075
  N("loop", Or);
8076
8076
  }
8077
- function ht(P) {
8078
- $ && $.setClearColor(ll(P));
8077
+ function ht(E) {
8078
+ $ && $.setClearColor(ll(E));
8079
8079
  }
8080
8080
  return R(), {
8081
8081
  renderer: $,
@@ -8084,7 +8084,7 @@ function ml(b, _) {
8084
8084
  disposeRenderer: L
8085
8085
  };
8086
8086
  }
8087
- const bl = Symbol("UseTresState"), Fs = /* @__PURE__ */ Ns({
8087
+ const Fs = /* @__PURE__ */ Ns({
8088
8088
  __name: "TresCanvas",
8089
8089
  props: {
8090
8090
  camera: null,
@@ -8104,7 +8104,7 @@ const bl = Symbol("UseTresState"), Fs = /* @__PURE__ */ Ns({
8104
8104
  const w = ri(), M = ri(!0), { scene: A, clearScene: S } = oi(), N = Ia(), j = ja(), { createCamera: U } = jr();
8105
8105
  let L;
8106
8106
  const R = Is();
8107
- Fa(bl, R.state);
8107
+ Fa("UseTresState", R.state);
8108
8108
  const ht = N.default ? N == null ? void 0 : N.default().some(
8109
8109
  (B) => B.type.name === "PerspectiveCamera" || B.type.name === "OrtographicCamera"
8110
8110
  ) : !1;
@@ -8112,16 +8112,16 @@ const bl = Symbol("UseTresState"), Fs = /* @__PURE__ */ Ns({
8112
8112
  if (_.camera) {
8113
8113
  const { position: B, ...q } = _.camera;
8114
8114
  if (L = U(_.ortographic === !0 ? wn.Orthographic : wn.Perspective, q || {}), B) {
8115
- const E = Bs(B);
8116
- L.position.set(...E);
8115
+ const P = Bs(B);
8116
+ L.position.set(P[0], P[1], P[2]);
8117
8117
  }
8118
8118
  A.add(L);
8119
8119
  } else
8120
8120
  L = U(_.ortographic === !0 ? wn.Orthographic : wn.Perspective, {}), L.position.set(5, 5, 5), A.add(L);
8121
8121
  Ir(_, () => {
8122
- y && (C(), S(), P());
8122
+ y && (C(), S(), E());
8123
8123
  });
8124
- function P() {
8124
+ function E() {
8125
8125
  const B = ml(w, {
8126
8126
  antialias: !0,
8127
8127
  physicallyCorrectLights: _.physicallyCorrectLights,
@@ -8132,11 +8132,11 @@ const bl = Symbol("UseTresState"), Fs = /* @__PURE__ */ Ns({
8132
8132
  y = B.renderer, C = B.disposeRenderer, _.background && B.setClearColor(_.background);
8133
8133
  }
8134
8134
  return Ds(() => {
8135
- P();
8135
+ E();
8136
8136
  }), Ka(() => {
8137
8137
  S(), C();
8138
8138
  }), (B, q) => {
8139
- var E, J, x, tt;
8139
+ var P, J, x, tt;
8140
8140
  return Tr(), ks("div", {
8141
8141
  id: "tres-container",
8142
8142
  style: Vs({
@@ -8146,7 +8146,7 @@ const bl = Symbol("UseTresState"), Fs = /* @__PURE__ */ Ns({
8146
8146
  right: 0,
8147
8147
  bottom: 0,
8148
8148
  overflow: "hidden",
8149
- width: ((J = (E = Ls(j)) == null ? void 0 : E.style) == null ? void 0 : J.width) || "100%",
8149
+ width: ((J = (P = Ls(j)) == null ? void 0 : P.style) == null ? void 0 : J.width) || "100%",
8150
8150
  height: "100%"
8151
8151
  })
8152
8152
  }, [
@@ -8166,10 +8166,10 @@ const bl = Symbol("UseTresState"), Fs = /* @__PURE__ */ Ns({
8166
8166
  ], 4);
8167
8167
  };
8168
8168
  }
8169
- }), Cl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8169
+ }), xl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8170
8170
  __proto__: null,
8171
8171
  default: Fs
8172
- }, Symbol.toStringTag, { value: "Module" })), yl = {
8172
+ }, Symbol.toStringTag, { value: "Module" })), Cl = Symbol("UseTresState"), yl = {
8173
8173
  install(b) {
8174
8174
  b.component("TresCanvas", Fs);
8175
8175
  const { createComponentInstances: _ } = cl();
@@ -8180,8 +8180,8 @@ const bl = Symbol("UseTresState"), Fs = /* @__PURE__ */ Ns({
8180
8180
  };
8181
8181
  export {
8182
8182
  wn as CameraType,
8183
- Cl as TresCanvas,
8184
- bl as UseTresStateSymbol,
8183
+ xl as TresCanvas,
8184
+ Cl as UseTresStateSymbol,
8185
8185
  yl as default,
8186
8186
  jr as useCamera,
8187
8187
  ol as useCatalog,
@@ -8190,7 +8190,7 @@ export {
8190
8190
  Or as useLoop,
8191
8191
  ml as useRenderer,
8192
8192
  oi as useScene,
8193
- wl as useTexture,
8193
+ gl as useTexture,
8194
8194
  Is as useTres,
8195
- xl as useTweakPane
8195
+ wl as useTweakPane
8196
8196
  };